@syncfusion/ej2-gantt 34.2.5 → 34.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* filename: ej2-gantt.umd.min.js
|
|
3
|
+
* version : 34.2.6
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
+
* Use of this code is subject to the terms of our license.
|
|
6
|
+
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
+
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
+
* applicable laws.
|
|
9
|
+
*/
|
|
1
10
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-treegrid"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-layouts"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-richtexteditor"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-data","@syncfusion/ej2-grids","@syncfusion/ej2-treegrid","@syncfusion/ej2-dropdowns","@syncfusion/ej2-svg-base","@syncfusion/ej2-layouts","@syncfusion/ej2-navigations","@syncfusion/ej2-richtexteditor","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-calendars","@syncfusion/ej2-pdf-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Popups,e.ej2Data,e.ej2Grids,e.ej2Treegrid,e.ej2Dropdowns,e.ej2SvgBase,e.ej2Layouts,e.ej2Navigations,e.ej2Richtexteditor,e.ej2Inputs,e.ej2Buttons,e.ej2Calendars,e.ej2PdfExport)}(this,function(k,ne,E,U,T,b,F,N,L,V,h,B,A,W,re){"use strict";function S(e,t,i){for(var a=e;a&&(i?a.id!==t:!a.classList.contains(t));)a=a.parentElement;return a}function j(e){return ne.isNullOrUndefined(e.startDate)&&ne.isNullOrUndefined(e.endDate)&&ne.isNullOrUndefined(e.duration)?null:!(ne.isNullOrUndefined(e.startDate)||ne.isNullOrUndefined(e.endDate)||ne.isNullOrUndefined(e.duration))}function H(e){return!(!e.dataSource||e.dataSource instanceof U.DataManager||!("result"in e.dataSource))}function G(e){for(var t={},i=0,a=Object.keys(e);i<a.length;i++){var n=a[i];t[e[n]]=n}return t}function z(e){return!ne.isNullOrUndefined(e)&&"object"==typeof e&&0===Object.keys(e).length}function q(e){var t=e.getFullYear(),i=e.getMonth(),a=e.getDate(),n=e.getHours(),r=e.getMinutes(),s=e.getSeconds(),e=e.getMilliseconds();return Date.UTC(t,i,a,n,r,s,e)}function _(e){return e instanceof U.DataManager&&((e=e.adaptor)instanceof U.ODataAdaptor||e instanceof U.ODataV4Adaptor||e instanceof U.WebApiAdaptor||e instanceof U.WebMethodAdaptor||e instanceof U.CacheAdaptor||e instanceof U.RemoteSaveAdaptor||e instanceof U.UrlAdaptor)}function Z(e,t,i,a,n){if(i)for(var r=void 0,s=0;s<e.length;s++)r=o=t?e[parseInt(s.toString(),10)].taskData:ne.extend({},e[parseInt(s.toString(),10)].taskData,{},!0);else for(r=[],s=0;s<e.length;s++){ne.isNullOrUndefined(a)||!a.timezone||n||X(e[s],a);var o=t?e[parseInt(s.toString(),10)].taskData:ne.extend({},e[parseInt(s.toString(),10)].taskData,{},!0);r.push(o)}return r}function X(e,t){var i,a;return e&&!ne.isNullOrUndefined(e.ganttProperties)&&(i=e.taskData,a=e.ganttProperties,i[t.taskFields.startDate]=t.dateValidationModule.remove(a.startDate,t.timezone),null!==t.taskFields.endDate&&(i[t.taskFields.endDate]=t.dateValidationModule.remove(a.endDate,t.timezone)),(t.taskFields.baselineStartDate||t.taskFields.baselineEndDate)&&(i[t.taskFields.baselineStartDate]=t.dateValidationModule.remove(a.baselineStartDate,t.timezone),i[t.taskFields.baselineEndDate]=t.dateValidationModule.remove(a.baselineEndDate,t.timezone)),t.editModule.processCustomDateColumns(e,i,t,"remove")),null}function Y(e,t){for(var i,a=0;a<t.length;a++)i=new RegExp("\\{"+a+"\\}","gm"),e=e.replace(i,t[a].toString());return e}function K(e,t,i,a){for(var n=-1,r=0;r<i.length;r++)if(ne.getValue(t,i[r])===ne.getValue(t,e)&&ne.isNullOrUndefined(a)||!ne.isNullOrUndefined(a)&&ne.getValue(t,i[r])===ne.getValue(t,e)&&ne.getValue(a,i[r])===ne.getValue(a,e)){n=r;break}return n}function se(e){return 76*e/92}function oe(e){return 92*e/76}var Q=0;function $(){return Q++}(s=k.ConstraintType||(k.ConstraintType={}))[s.AsSoonAsPossible=0]="AsSoonAsPossible",s[s.AsLateAsPossible=1]="AsLateAsPossible",s[s.MustStartOn=2]="MustStartOn",s[s.MustFinishOn=3]="MustFinishOn",s[s.StartNoEarlierThan=4]="StartNoEarlierThan",s[s.StartNoLaterThan=5]="StartNoLaterThan",s[s.FinishNoEarlierThan=6]="FinishNoEarlierThan",s[s.FinishNoLaterThan=7]="FinishNoLaterThan";e.prototype.isValidateNonWorkDays=function(e){return!ne.isNullOrUndefined(e)&&e.isAutoSchedule&&(!this.parent.includeWeekend||0<e.calendarContext.defaultHolidays.length)||ne.isNullOrUndefined(e)&&(!this.parent.includeWeekend||0<this.parent.defaultCalendarContext.defaultHolidays.length)},e.prototype.checkStartDate=function(e,t,i,a,n,r){if(ne.isNullOrUndefined(e))return null;var s,o=new Date(e.getTime()),l=this.parent.getCurrentDayStartTime(o),d=this.parent.getCurrentDayEndTime(o),h=new Date(e.getTime()),p=this.getSecondsInDecimal(h);if(i=ne.isNullOrUndefined(i)?!ne.isNullOrUndefined(t)&&t.isMilestone:i,p<l&&(!i||a))this.setTime(l,h);else if(p<l&&i)this.setTime(l,h);else if(p===d&&(!t||!i)||d<p)h.setDate(h.getDate()+1),l=this.parent.getCurrentDayStartTime(h),this.setTime(l,h);else if(l<p&&p<d){var u=this.parent.workingTimeRanges;0<this.parent.weekWorkingTime.length&&(u=this.parent.getWorkingRange(h));for(var c=0;c<u.length;c++){var g=u[c];if(p>=g.to&&u[c+1]&&p<u[c+1].from){(p!==g.to||t&&i)&&p===g.to||this.setTime(u[c+1].from,h);break}}}if(!(!this.parent.autoCalculateDateScheduling||r||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping))do{s=new Date(h.getTime()),t&&!t.calendarContext&&(t.calendarContext=this.parent.defaultCalendarContext);var f=t?t.calendarContext:this.parent.defaultCalendarContext,m=f.defaultHolidays.length;if(this.isValidateNonWorkDays(t)){l=this.parent.getCurrentDayStartTime(s),t&&(d=n?this.parent.getCurrentDayEndTime(t.baselineEndDate||s):this.parent.getCurrentDayEndTime(t.endDate?t.isAutoSchedule?t.endDate:t.autoEndDate:s));var y,D=!i||a?l:d;if(this.parent.includeWeekend||n||(y=new Date(h.getTime()),h=this.getNextWorkingDay(h,f),D=this.parent.getCurrentDayStartTime(h),y.getTime()===h.getTime())||i||this.setTime(D,h),!n)for(var k=0;k<m;k++){var T=this.getDateFromFormat(new Date(f.defaultHolidays[k])),b=new Date(T.getTime());T.setHours(0,0,0,0),b.setHours(23,59,59,59),h.getTime()>=T.getTime()&&h.getTime()<b.getTime()&&(h.setDate(h.getDate()+1),D=this.parent.getCurrentDayStartTime(h),this.setTime(D,h))}}}while(s.getTime()!==h.getTime());return new Date(h.getTime())},e.prototype.getAdjustedStartDate=function(e,t){e=new Date(e),e.setDate(e.getDate()+1),e=this.parent.dateValidationModule.checkEndDate(e);return this.parent.dateValidationModule.getStartDate(e,t.duration,t.durationUnit,t)},e.prototype.getDateByConstraint=function(e,t,i){var a=e.ganttProperties||e,n=new Date(a.constraintDate),r=this.parent.isLoad;if((i=ne.isNullOrUndefined(i)?!0:i)&&(!n||!t))return null;switch(n=this.parent.editModule&&this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.dialogConstraintDate?new Date(this.parent.editModule.dialogModule.dialogConstraintDate):this.parent.assignTimeToDate(n,this.parent.getCurrentDayStartTime(n)),a.constraintType){case k.ConstraintType.AsSoonAsPossible:return r?t:(o=a.constraintDate=null,(l=this.parent.getRecordByID(a.taskId))&&l.parentItem&&(o=l.parentItem),a.predecessor&&0<a.predecessor.length?this.parent.assignTimeToDate(t,this.parent.getCurrentDayStartTime(t)):this.updateSoonAsPossibleParent(o));case k.ConstraintType.AsLateAsPossible:return r?t:(l=(o=this.parent.getRecordByID(a.taskId))&&o.parentItem?this.parent.dateValidationModule.checkEndDate(this.parent.getRecordByID(o.parentItem.taskId).ganttProperties.endDate):this.parent.dateValidationModule.checkEndDate(new Date(this.parent.projectEndDate)),this.parent.dateValidationModule.getStartDate(l,a.duration,a.durationUnit,a));case k.ConstraintType.MustStartOn:var s=n.getTime()!==a.startDate.getTime(),o=void 0,l=(this.parent.editModule&&this.parent.editModule.dialogModule&&(o=this.parent.editModule.dialogModule.dialogConstraintValue),ne.isNullOrUndefined(o)||2===o||3===o);return s&&!r&&l&&(this.parent.constraintViolationType="MustStartOn"),o=null,r?this.parent.dateValidationModule.checkStartDate(new Date(n)):this.parent.assignTimeToDate(t,this.parent.getCurrentDayStartTime(t));case k.ConstraintType.MustFinishOn:return(s=n.getTime()!==a.endDate.getTime())&&!r&&(this.parent.constraintViolationType="MustFinishOn"),this.getAdjustedStartDate(n,a);case k.ConstraintType.StartNoEarlierThan:return n.getTime()<t.getTime()||!r?this.parent.assignTimeToDate(t,this.parent.getCurrentDayStartTime(t)):this.parent.dateValidationModule.checkStartDate(new Date(n));case k.ConstraintType.StartNoLaterThan:return((s=n.getTime()<t.getTime())&&!r&&(this.parent.constraintViolationType="StartNoLaterThan"),r)?r&&s?this.parent.dateValidationModule.checkStartDate(new Date(n)):t:(l=this.parent.editModule&&this.parent.editModule.cellEditModule,o=this.parent.taskFields&&this.parent.taskFields.constraintDate,l&&l.isCellEdit&&l.editedColumn&&s&&l.editedColumn.field===o||this.parent.editModule&&this.parent.editModule.dialogModule&&s&&this.parent.editModule.dialogModule.dialogConstraintDate?n:this.parent.assignTimeToDate(t,this.parent.getCurrentDayStartTime(t)));case k.ConstraintType.FinishNoEarlierThan:return(d=this.getEndDate(t,a.duration,a.durationUnit,a,!1,!1)).getTime()<n.getTime()?this.getAdjustedStartDate(n,a):t;case k.ConstraintType.FinishNoLaterThan:var d=this.getEndDate(t,a.duration,a.durationUnit,a,!1,!1);return((s=n.getTime()<d.getTime())&&!r&&(this.parent.constraintViolationType="FinishNoLaterThan"),r)?s?this.getAdjustedStartDate(n,a):t:s?this.getAdjustedStartDate(n,a):this.parent.assignTimeToDate(t,this.parent.getCurrentDayEndTime(t));default:return t}},e.prototype.updateSoonAsPossibleParent=function(e){return e?this.parent.getRecordByID(e.taskId).ganttProperties.startDate:this.parent.dateValidationModule.checkStartDate(new Date(this.parent.projectStartDate))},e.prototype.checkEndDate=function(e,t,i,a,n){if(ne.isNullOrUndefined(e))return null;t&&!t.calendarContext&&(t.calendarContext=this.parent.defaultCalendarContext);var r,s=t?t.calendarContext:this.parent.defaultCalendarContext,o=(u=0<this.parent.weekWorkingTime.length?(d=new Date(e.getTime()),(!this.parent.includeWeekend&&t&&t.isAutoSchedule||this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.taskBarEditRecord&&!this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.isAutoSchedule)&&(d=this.getNextWorkingDay(d,s)),r=this.parent.getStartTime(d),this.parent.getEndTime(d)):(r=this.parent.defaultStartTime,this.parent.defaultEndTime),new Date(e.getTime())),l=this.getSecondsInDecimal(o);if(u<l)this.setTime(u,o);else if(l<=r&&86400!==u&&!i){var d=this.parent.taskFields;this.parent.editModule&&this.parent.editModule.editedRecord&&!this.parent.editModule.editedRecord[d.startDate]&&this.parent.editModule.editedRecord[d.endDate]?o.setDate(o.getDate()):o.setDate(o.getDate()-1),u=this.parent.getCurrentDayEndTime(o),this.setTime(u,o)}else if(r<l&&l<u)for(var h=0;h<this.parent.workingTimeRanges.length;h++)if(l>this.parent.workingTimeRanges[h].to&&this.parent.workingTimeRanges[h+1]&&l<=this.parent.workingTimeRanges[h+1].from){this.setTime(this.parent.workingTimeRanges[h].to,o);break}if(!this.parent.autoCalculateDateScheduling||n||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)ne.isNullOrUndefined(o)||86400===this.parent.defaultEndTime||(u=this.parent.getCurrentDayEndTime(e),this.setTime(u,o));else do{var p,u,c=new Date(o.getTime()),g=s.defaultHolidays.length;if(this.isValidateNonWorkDays(t)&&!a){this.parent.includeWeekend||(p=new Date(o.getTime()),o=this.getPreviousWorkingDay(o,s),u=this.parent.getCurrentDayEndTime(o),p.getTime()!==o.getTime()&&this.setTime(u,o));for(var f=0;f<g;f++){var m=this.getDateFromFormat(new Date(s.defaultHolidays[f])),y=new Date(m.getTime()),D=new Date(o.getTime());D.setMinutes(o.getMilliseconds()-2),m.setHours(0,0,0,0),y.setHours(23,59,59,59),(o.getTime()>=m.getTime()&&o.getTime()<y.getTime()||D.getTime()>=m.getTime()&&D.getTime()<y.getTime())&&(o.setDate(o.getDate()-1),u=this.parent.getCurrentDayEndTime(o),o.getTime()===m.getTime()&&86400===u&&0===this.getSecondsInDecimal(o)||this.setTime(u,o))}}}while(c.getTime()!==o.getTime());return new Date(o.getTime())},e.prototype.checkBaselineStartDate=function(e,t){if(ne.isNullOrUndefined(e))return null;var i=this.parent.getCurrentDayStartTime(e),t=this.parent.getCurrentDayEndTime(t&&t.endDate?t.isAutoSchedule?t.endDate:t.autoEndDate:e),a=new Date(e.getTime()),n=this.getSecondsInDecimal(a);if(n<i)this.setTime(i,a);else if(t<n)a.setDate(a.getDate()+1),i=0<this.parent.weekWorkingTime.length?this.parent.getStartTime(a):this.parent.defaultStartTime,this.setTime(i,a);else if(i<n&&n<t)for(var r=0;r<this.parent.workingTimeRanges.length;r++)if(n>this.parent.workingTimeRanges[r].to&&this.parent.workingTimeRanges[r+1]&&n<this.parent.workingTimeRanges[r+1].from){this.setTime(this.parent.workingTimeRanges[r+1].from,a);break}return a},e.prototype.checkBaselineEndDate=function(e,t){if(ne.isNullOrUndefined(e))return null;var i=this.parent.getCurrentDayEndTime(e),a=this.parent.getCurrentDayStartTime(t&&t.startDate?t.isAutoSchedule?t.startDate:t.autoStartDate:e),n=new Date(e.getTime()),r=this.getSecondsInDecimal(n);if(i<r)this.setTime(i,n);else if(r<a&&!ne.isNullOrUndefined(t)&&!t.isMilestone)n.setDate(n.getDate()-1),i=this.parent.getCurrentDayEndTime(n),this.setTime(i,n);else if(a<r&&r<i)for(var s=0;s<this.parent.workingTimeRanges.length;s++)if(r>this.parent.workingTimeRanges[s].to&&this.parent.workingTimeRanges[s+1]&&r<=this.parent.workingTimeRanges[s+1].from){this.setTime(this.parent.workingTimeRanges[s].to,n);break}return t&&t.baselineStartDate&&n&&t.baselineStartDate.getTime()>n.getTime()&&n.setDate(n.getDate()+1),n},e.prototype.calculateStartDate=function(e,t){var i=e.ganttProperties,a=null;t?(ne.isNullOrUndefined(i.baselineEndDate)||ne.isNullOrUndefined(i.baselineDuration)||(a=this.getStartDate(i.baselineEndDate,i.baselineDuration,i.durationUnit,i,void 0,!0)),this.parent.setRecordValue("baselineStartDate",a,i,!0),this.parent.taskFields.baselineStartDate&&this.parent.dataOperation.updateMappingData(e,"baselineStartDate")):(ne.isNullOrUndefined(i.endDate)||ne.isNullOrUndefined(i.duration)||(a=this.getStartDate(i.endDate,i.duration,i.durationUnit,i)),this.parent.setRecordValue("startDate",a,i,!0),this.parent.taskFields.startDate&&this.parent.dataOperation.updateMappingData(e,"startDate"))},e.prototype.getFieldMappings=function(e){return{startdateField:e?"baselineStartDate":"startDate",enddateField:e?"baselineEndDate":"endDate",durationField:e?"baselineDuration":"duration"}},e.prototype.calculateEndDate=function(e,t){var i,a,n=e.ganttProperties,r=null,s=this.getFieldMappings(t),o=s.startdateField,l=s.enddateField,s=s.durationField;ne.isNullOrUndefined(n[o])?(r=e[this.parent.taskFields[l]],ne.isNullOrUndefined(r)||(a=this.parent.getCurrentDayEndTime(r),this.setTime(a,r))):(!ne.isNullOrUndefined(n[l])&&ne.isNullOrUndefined(n[s])&&(1===this.compareDates(n[o],n[l])&&(this.parent.setRecordValue(o,new Date(n[l].getTime()),n,!0),i=this.parent.getCurrentDayStartTime(n.isAutoSchedule&&!t?n.autoStartDate:n[o]),a=this.parent.getCurrentDayEndTime(n.isAutoSchedule&&!t?n.autoEndDate:n[l]),this.setTime(i,n[o])),this.calculateDuration(e,t)),ne.isNullOrUndefined(n[s])||(a=!t&&!ne.isNullOrUndefined(n.segments)&&1<n.segments.length?this.totalDuration(n.segments):n[s],r=this.getEndDate(n[o],a,n.durationUnit,n,!1,t,e))),this.parent.setRecordValue(l,r,n,!0),this.parent.taskFields[l]&&this.parent.dataOperation.updateMappingData(e,l)},e.prototype.totalDuration=function(e){var t,i=0;ne.isNullOrUndefined(this.parent.timelineSettings.bottomTier)||(t=this.parent.timelineSettings.bottomTier.unit);for(var a=0;a<e.length;a++){var n=e[a].offsetDuration;"Hour"===t?n/=24:"Minutes"===t&&(n/=1440),i+=e[a].duration+n}return i=Math.ceil(i)},e.prototype.calculateDuration=function(e,t){var i,a,n,r=e.ganttProperties,s=r.calendarContext,o=(i=!t&&!ne.isNullOrUndefined(r.segments)&&0<r.segments.length&&!ne.isNullOrUndefined(this.parent.editModule.taskbarEditModule)?this.parent.editModule.taskbarEditModule.sumOfDuration(r.segments):t||ne.isNullOrUndefined(this.parent.taskFields.milestone)||ne.isNullOrUndefined(r.startDate)||ne.isNullOrUndefined(r.endDate)||r.startDate.getTime()!==r.endDate.getTime()||!1!==e.taskData[this.parent.taskFields.milestone]?(i=t?r.baselineStartDate:r.startDate,o=t?r.baselineEndDate:r.endDate,l=r.durationUnit,a=!t&&r.isAutoSchedule,n=!t&&r.isMilestone,this.getDuration(i,o,l,a,n,void 0,s)):1,t?"baselineDuration":"duration"),l=(this.parent.setRecordValue(o,i,r,!0),t?this.parent.columnByField[this.parent.columnMapping.baselineDuration]:this.parent.columnByField[this.parent.columnMapping.duration]);ne.isNullOrUndefined(this.parent.editModule)||ne.isNullOrUndefined(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isCellEdit||ne.isNullOrUndefined(l)||(ne.isNullOrUndefined(l.edit)||ne.isNullOrUndefined(l.edit.read)||(a=this.parent.editModule.dialogModule.dialog,ne.isNullOrUndefined(a))||(n=t?a.querySelector("#"+this.parent.element.id+"BaselineDuration"):a.querySelector("#"+this.parent.element.id+"Duration"),ne.isNullOrUndefined(n))||(s=n.ej2_instances[0],ne.isNullOrUndefined(s))||s.value===i.toString()||(s.value=i.toString(),s.dataBind()),(this.parent.taskFields.duration||this.parent.taskFields.baselineDuration)&&(this.parent.dataOperation.updateMappingData(e,o),this.parent.taskFields.durationUnit)&&this.parent.dataOperation.updateMappingData(e,"durationUnit"))},e.prototype.getNonworkingTime=function(e,t,i,a,n,r,s){var o=this.parent;a=!!ne.isNullOrUndefined(a)||a;var l=!r&&!o.includeWeekend&&o.autoCalculateDateScheduling&&!(o.isLoad&&o.treeGrid.loadChildOnDemand&&o.taskFields.hasChildMapping)&&i&&!s?this.getWeekendCount(e,t,n):0,a=this.getNumberOfSeconds(e,t,a),d=i&&o.autoCalculateDateScheduling&&!(o.isLoad&&o.treeGrid.loadChildOnDemand&&o.taskFields.hasChildMapping)&&!r&&!s?this.getHolidaysCount(e,t,n):0,a=(a-86400*l-86400*d)/86400,r=this.getNonWorkingSecondsOnDate(e,t,i,r,n,s);return(0<o.weekWorkingTime.length?this.nonWorkingSeconds(e,t,i,a,n,!1,s):a*(86400-o.secondsPerDay))+86400*l+86400*d+r},e.prototype.nonWorkingSeconds=function(e,t,i,a,n,r,s){var o=e.getTime()>t.getTime()?new Date(t.getTime()):new Date(e.getTime()),l=e.getTime()>t.getTime()?new Date(e.getTime()):new Date(t.getTime()),d=0,h=0;if(r?(e=this.parent.getCurrentDayStartTime(o),t=this.parent.getCurrentDayEndTime(o),o.getHours()<t/3600&&o.getHours()>=e/3600||o.setDate(o.getDate()+1)):(o.setDate(o.getDate()+1),o.setHours(0,0,0,0),l.setHours(0,0,0,0)),!(0<a||ne.isNullOrUndefined(a)))return 0;for(;r&&o.getTime()<=l.getTime()||!r&&o.getTime()<l.getTime();){if(i&&!s){if(this.isOnHolidayOrWeekEnd(o,!0,n))for(;o.setDate(o.getDate()+1),this.isOnHolidayOrWeekEnd(o,!0,n););this.parent.includeWeekend||this.getNextWorkingDay(o,n)}if(o.getTime()<=l.getTime()){h++;var p=this.parent.getSecondsPerDay(o);if(d+=r?p:86400-p,o.setDate(o.getDate()+1),i&&!s){if(this.isOnHolidayOrWeekEnd(o,!0,n))for(;o.setDate(o.getDate()+1),this.isOnHolidayOrWeekEnd(o,!0,n););this.parent.includeWeekend||this.getNextWorkingDay(o,n)}}}return r&&(0<d?d/=h:d=this.parent.secondsPerDay),d},e.prototype.getDuration=function(e,t,i,a,n,r,s){if(void 0===r&&(r=!0),!e||!t)return null;var o=0,l=this.parent.getFormatedDate(e)===this.parent.getFormatedDate(t);if(0<this.parent.weekWorkingTime.length){for(var d=new Date(e),h=this.nonWorkingSeconds(e,t,a,void 0,s,!0),p=0;d<=t;){var u=this.parent.getFormatedDate(d),c=this.parent.getSecondsPerDay(d),g=new Date(d),f=new Date(d),u=(g.setHours(0,0,0,0),f.setHours(0,0,0,0),g.setSeconds(this.parent.getCurrentDayStartTime(d)),f.setSeconds(this.parent.getCurrentDayEndTime(d)),u===this.parent.getFormatedDate(e)&&g.setTime(e.getTime()),u===this.parent.getFormatedDate(t)&&f.setTime(t.getTime()),this.getTimeDifference(g,f,r)/1e3),g=this.getNonworkingTime(g,f,a,r,s);p+=Math.max(0,u-g)/c,d.setDate(d.getDate()+1)}n&&l||(o=this.calculateDurationValue(i,p,h))}else{h=this.parent.secondsPerDay;var m=this.getTimeDifference(e,t,r)/1e3,y=this.getNonworkingTime(e,t,a,r,s);l&&n||(o=this.calculateDurationValue(i,(m-y)/h,h))}return parseFloat(o.toString())},e.prototype.calculateDurationValue=function(e,t,i){return e&&"day"!==e?"minute"===e?t*(i/60):t*(i/3600):t},e.prototype.getDurationAsSeconds=function(e,t,i){i=0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(i):this.parent.secondsPerDay;return t&&"day"!==t.toLocaleLowerCase()?"hour"===t.toLocaleLowerCase()?3600*e:60*e:i*e},e.prototype.getEndDate=function(e,t,i,a,n,r,s){var o,l=new Date(e.getTime()),l=(a.calendarContext||(a.calendarContext=this.parent.defaultCalendarContext),o=0<this.parent.weekWorkingTime.length&&(!i||"day"===i.toLocaleLowerCase())?this.calculateSecondDuration(t,l,o,e,!0,a.calendarContext):this.getDurationAsSeconds(t,i,e),this.calculateEndDateFromDuration(e,o,a,n,a.calendarContext,r,!1));return this.parent.autoCalculateDateScheduling&&this.parent.isLoad&&!ne.isNullOrUndefined(s)&&ne.isNullOrUndefined(s[this.parent.taskFields.endDate])&&!ne.isNullOrUndefined(s[this.parent.taskFields.startDate])&&!s.hasChildRecords&&(e=this.getDateFromFormat(s[this.parent.taskFields.startDate]),this.parent.dataOperation.resolveAndApplyWorkingTimes(e),o=this.checkStartDate(e,a,n,this.parent.isLoad,!1,!0),r=this.getDurationAsSeconds(t,i,e),t=this.calculateEndDateFromDuration(o,r,a,n,a.calendarContext,!1,a.isAutoSchedule),l.getTime()===t.getTime()&&e.getTime()===o.getTime()||this.parent.dataOperation.validatedGanttData.set(s.ganttProperties.taskId,s)),l},e.prototype.calculateEndDateFromDuration=function(e,t,i,a,n,r,s){for(var o=new Date(e.getTime()),l=new Date(e.getTime()),d=t;0<d;)l.setSeconds(l.getSeconds()+d),0<(d-=d-this.getNonworkingTime(o,l,i.isAutoSchedule,!0,n,r,s))&&(l=this.checkStartDate(l,i,a,void 0,r,s)),o=new Date(l.getTime());return l},e.prototype.getStartDate=function(e,t,i,a,n,r){var s,o=new Date(e.getTime()),l=new Date(e.getTime()),e=new Date(o.getTime());for(a.calendarContext||(a.calendarContext=this.parent.defaultCalendarContext),s=0<this.parent.weekWorkingTime.length?this.calculateSecondDuration(t,e,s,o,!1,a.calendarContext):this.getDurationAsSeconds(t,i,o);0<s;)l.setSeconds(l.getSeconds()-s),0<(s-=s-this.getNonworkingTime(l,o,a.isAutoSchedule,!0,a.calendarContext,r))&&(o=this.checkEndDate(l,a,r)),o=new Date(l.getTime());return n&&a.isMilestone&&(l.setDate(l.getDate()-1),e=this.parent.getCurrentDayEndTime(a.endDate?a.isAutoSchedule?a.endDate:a.autoEndDate:l),this.parent.dateValidationModule.setTime(e,l),l=this.parent.dateValidationModule.checkStartDate(l,a,!0)),l},e.prototype.calculateSecondDuration=function(e,t,i,a,n,r){if(e<1)i=this.parent.getSecondsPerDay(t)*e;else{i=0;var s=e,o=this.parent.getCurrentDayStartTime(t),l=this.parent.getCurrentDayEndTime(t);for(t.getHours()<l/3600&&t.getHours()>o/3600||!this.fromSegments||(n?t.setDate(t.getDate()+1):t.setDate(t.getDate()-1));0<s;){if(this.isOnHolidayOrWeekEnd(t,!0,r))for(;n?t.setDate(t.getDate()+1):t.setDate(t.getDate()-1),this.isOnHolidayOrWeekEnd(t,!0,r););this.parent.includeWeekend||(t=n?this.getNextWorkingDay(t,r):this.getPreviousWorkingDay(t,r));var d,h=this.parent.getSecondsPerDay(t),p=0;this.getSecondsInDecimal(a)===this.parent.getStartTime(a)||Number.isInteger(s)||(d=e.toString().split("."),h*=p=parseFloat("."+d[1]),s-=p),s<1&&(h*=s),i+=h,n?t.setDate(t.getDate()+1):t.setDate(t.getDate()-1),p||s--}}return i},e.prototype.getProjectStartDate=function(e,t){if(!ne.isNullOrUndefined(this.parent.cloneProjectStartDate))return"string"==typeof this.parent.cloneProjectStartDate&&(this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate)),s=this.checkStartDate(this.parent.cloneProjectStartDate),this.parent.cloneProjectStartDate=s,new Date(s.getTime());if(ne.isNullOrUndefined(this.parent.projectStartDate)){if(ne.isNullOrUndefined(t))return null;var i=this.parent.flatData,a=void 0;0<i.length?a=i[0].ganttProperties.startDate:(a=new Date).setHours(0,0,0,0);for(var n=1;n<i.length;n++){var r=i[n].ganttProperties.startDate;ne.isNullOrUndefined(r)||-1!==this.compareDates(r,a)||(a=r)}this.parent.cloneProjectStartDate=this.checkStartDate(a,e)}else{var s=this.getDateFromFormat(this.parent.projectStartDate);this.parent.cloneProjectStartDate=this.checkStartDate(s)}return new Date(this.parent.cloneProjectStartDate.getTime())},e.prototype.getValidStartDate=function(e,t,i){var a=null,n=i?e.baselineStartDate:t?e.autoStartDate:e.startDate,i=i?e.baselineEndDate:t?e.autoEndDate:e.endDate,t=!e.isAutoSchedule&&e.autoDuration?e.autoDuration:e.duration;if(ne.isNullOrUndefined(n))if(ne.isNullOrUndefined(i)){if(!ne.isNullOrUndefined(t)){t=this.parent.getTaskByUniqueID(e.uniqueID);if(this.parent.allowUnscheduledTasks&&t&&t.parentItem&&ne.isNullOrUndefined(n)&&ne.isNullOrUndefined(i)){for(var r=this.parent.getParentTask(t.parentItem);r&&!r.ganttProperties.startDate;)r=this.parent.getParentTask(r.parentItem);a=r&&r.ganttProperties.startDate?r.ganttProperties.startDate:this.parent.cloneProjectStartDate}else a=this.getProjectStartDate(e)}}else{a=new Date(i.getTime()),t=this.parent.getCurrentDayStartTime(a);this.setTime(t,a)}else a=new Date(n.getTime());return a},e.prototype.getValidEndDate=function(e,t,i){var a,n=null,r=i?e.baselineStartDate:t?e.autoStartDate:e.startDate,i=i?e.baselineEndDate:t?e.autoEndDate:e.endDate,t=t?e.autoDuration:e.duration;return ne.isNullOrUndefined(i)?ne.isNullOrUndefined(r)?ne.isNullOrUndefined(t)||(a=this.getValidStartDate(e))&&(n=this.getEndDate(a,t,e.durationUnit,e,!1)):e.isMilestone?n=this.checkStartDate(r):(n=new Date(r.getTime()),a=this.parent.getCurrentDayEndTime(i||n),this.setTime(a,n)):n=new Date(i.getTime()),n},e.prototype.getWorkingTime=function(e,t,i,a,n,r,s,o){var l;return ne.isNullOrUndefined(t.from)||ne.isNullOrUndefined(t.to)||(i.setHours(0,0,0,0),l=new Date(i.getTime()),i.setTime(i.getTime()+36e5*t.from),i=new Date(i.getTime()),24===t.to?l.setTime(l.getTime()+864e5):l.setTime(l.getTime()+36e5*t.to),l=(t=new Date(l.getTime())).getTime()-i.getTime(),i=this.getSecondsInDecimal(i),0===(t=this.getSecondsInDecimal(t))&&(t=86400),a+=l/1e3,0===n&&(this.parent.defaultStartTime=i,0<this.parent.weekWorkingTime.length)&&this.assignStartTime(e,i),n!==this[e.toLowerCase()+"TimeRangeLength"]-1&&""!==e||(this.parent.defaultEndTime=t,0<this.parent.weekWorkingTime.length&&this.assignEndTime(e,t)),0<n?""===e?(r.push(r[r.length-1]+i-s[n-1].to),s[n-1].to<i&&o.push({from:s[n-1].to,to:i,isWorking:!1,interval:i-s[n-1].to})):(this.parent[e.toLowerCase()+"NonWorkingHours"].push(this.parent[e.toLowerCase()+"NonWorkingHours"][this.parent[e.toLowerCase()+"NonWorkingHours"].length-1]+i-this.parent[e.toLowerCase()+"NonWorkingTimeRanges"][n-1].to),this.parent[e.toLowerCase()+"WorkingTimeRanges"][n-1].to<i&&this.parent[e.toLowerCase()+"NonWorkingTimeRanges"].push({from:this.parent[e.toLowerCase()+"WorkingTimeRanges"][n-1].to,to:i,isWorking:!1,interval:i-this.parent[e.toLowerCase()+"WorkingTimeRanges"][n-1].to})):(""===e?(r.push(0),o):(this.parent[e.toLowerCase()+"NonWorkingHours"].push(0),this.parent[e.toLowerCase()+"NonWorkingTimeRanges"])).push({from:0,to:i,isWorking:!1,interval:i}),(""===e?(s.push({from:i,to:t}),o):(this.parent[e.toLowerCase()+"WorkingTimeRanges"].push({from:i,to:t}),this.parent[e.toLowerCase()+"NonWorkingTimeRanges"])).push({from:i,to:t,isWorking:!0,interval:t-i})),a},e.prototype.assignStartTime=function(e,t){switch(e){case"Monday":this.parent.mondayDefaultStartTime=t;break;case"Tuesday":this.parent.tuesdayDefaultStartTime=t;break;case"Wednesday":this.parent.wednesdayDefaultStartTime=t;break;case"Thursday":this.parent.thursdayDefaultStartTime=t;break;case"Friday":this.parent.fridayDefaultStartTime=t;break;case"Saturday":this.parent.saturdayDefaultStartTime=t;break;case"Sunday":this.parent.sundayDefaultStartTime=t}},e.prototype.assignEndTime=function(e,t){switch(e){case"Monday":this.parent.mondayDefaultEndTime=t;break;case"Tuesday":this.parent.tuesdayDefaultEndTime=t;break;case"Wednesday":this.parent.wednesdayDefaultEndTime=t;break;case"Thursday":this.parent.thursdayDefaultEndTime=t;break;case"Friday":this.parent.fridayDefaultEndTime=t;break;case"Saturday":this.parent.saturdayDefaultEndTime=t;break;case"Sunday":this.parent.sundayDefaultEndTime=t}},e.prototype.calculateWeekWorkTime=function(e,t,i,a,n,r,s){for(var o=0,l=0;l<t.length;l++){var d=t[l];o+=this.getWorkingTime(e,d,i,a,l,n,r,s)}return this.parent[e.toLowerCase()+"DefaultStartTime"]/3600!=24&&this.parent[e.toLowerCase()+"NonWorkingTimeRanges"].push({from:this.parent[e.toLowerCase()+"DefaultEndTime"],to:86400,isWorking:!1,interval:86400-this.parent[e.toLowerCase()+"DefaultEndTime"]}),o},e.prototype.getSecondsPerDay=function(){for(var e=0,t=new Date("10/11/2018"),i=(this.parent.nonWorkingHours=[],this.parent.nonWorkingHours),a=(this.parent.workingTimeRanges=[],this.parent.workingTimeRanges),n=(this.parent.nonWorkingTimeRanges=[],this.parent.nonWorkingTimeRanges),r=this.parent.calendarModule.workingTime,s=0,o=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];s<o.length;s++)this[(f=o[s]).toLowerCase()+"TimeRangeLength"]=r.length;if(0<this.parent.weekWorkingTime.length){for(var l=0;l<this.parent.weekWorkingTime.length;l++)this[this.parent.weekWorkingTime[l].dayOfWeek.toLowerCase()+"TimeRangeLength"]=this.parent.weekWorkingTime[l].timeRange.length;for(var d=0,h=this.parent.weekWorkingTime;d<h.length;d++){var p,u=h[d];u.timeRange&&0<u.timeRange.length&&(this.parent[u.dayOfWeek.toLowerCase()+"NonWorkingHours"]=[],this.parent[u.dayOfWeek.toLowerCase()+"NonWorkingTimeRanges"]=[],this.parent[u.dayOfWeek.toLowerCase()+"WorkingTimeRanges"]=[],p=this.calculateWeekWorkTime(u.dayOfWeek,u.timeRange,t,e,i,a,n),this.parent[u.dayOfWeek.toLowerCase()+"Seconds"]=p)}for(var c=0,g=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];c<g.length;c++){var f=g[c],m=this.parent[f.toLowerCase()+"DefaultStartTime"];ne.isNullOrUndefined(m)&&(m=this.calculateWeekWorkTime(f,r,t,e,i,a,n),this.parent[f.toLowerCase()+"Seconds"]=m)}}for(var y=r.length,D=0,k=0;k<y;k++){var T=r[k];D+=this.getWorkingTime("",T,t,e,k,i,a,n)}return this.parent.defaultEndTime/3600!=24&&n.push({from:this.parent.defaultEndTime,to:86400,isWorking:!1,interval:86400-this.parent.defaultEndTime}),e=D},e.prototype.getDurationValue=function(e){var t,i=null,a=null;return"string"==typeof e?(t=e.match(/(\d*\.*\d+|.+$)/g))&&t.length<=2&&(a=parseFloat(t[0].toString().trim()),t=t[1]?t[1].toString().trim().toLowerCase():null,-1!==ne.getValue("minute",this.parent.durationUnitEditText).indexOf(t)?i="minute":-1!==ne.getValue("hour",this.parent.durationUnitEditText).indexOf(t)?i="hour":-1!==ne.getValue("day",this.parent.durationUnitEditText).indexOf(t)&&(i="day")):(a=e,i=null),{duration:a,durationUnit:i}},e.prototype.getNextWorkingDay=function(e,t){if(t&&t.getExceptionForDate(e))return e;var i=e.getDay();return this.parent.includeWeekend||-1===this.parent.nonWorkingDayIndex.indexOf(i)?e:(e.setDate(e.getDate()+1),this.getNextWorkingDay(e,t))},e.prototype.getWeekendCount=function(e,t,i){var a=0,n=new Date(e.getTime()),r=new Date(t.getTime());for(n.setHours(0,0,0,0),n.setDate(n.getDate()+1),r.setHours(0,0,0,0);n.getTime()<r.getTime();)-1===this.parent.nonWorkingDayIndex.indexOf(n.getDay())||i.getExceptionForDate(n)||(a+=1),n.setDate(n.getDate()+1);return a},e.prototype.getNumberOfSeconds=function(e,t,i){var e=new Date(e.getTime()),t=new Date(t.getTime()),a=0;return e.setDate(e.getDate()+1),e.setHours(0,0,0,0),t.setHours(0,0,0,0),a=(a=e.getTime()<t.getTime()?this.getTimeDifference(e,t,i)/1e3:a)%86400!=0?a-a%86400+86400:a},e.prototype.getHolidaysCount=function(e,t,i){var a=0,n=i.sortedDefaultHolidays;if(!n||0===n.length)return 0;e=new Date(e.getTime()),t=new Date(t.getTime());if(e.setDate(e.getDate()+1),e.setHours(0,0,0,0),t.setHours(0,0,0,0),e.getTime()<t.getTime()&&0<n.length)for(var e=e.getTime(),t=t.getTime(),e=this.getBinaryBound(n,e),r=this.getBinaryBound(n,t),s=e;s<r;s++){var o=n[s],o=this.getDateFromFormat(new Date(o));i.getExceptionForDate(o)||(!this.parent.includeWeekend&&-1===this.parent.nonWorkingDayIndex.indexOf(o.getDay())||this.parent.includeWeekend)&&(a+=1)}return a},e.prototype.getHolidayDates=function(e){"holidays"===e?this.parent.calendarModule.holidays=this.parent.holidays:"calendarSettings"===e&&(this.parent.calendarModule.holidays=this.parent.calendarSettings.projectCalendar.holidays);for(var t=this.parent.calendarModule.holidays,i=[],a=0;a<t.length;a++){var n=this.getDateFromFormat(t[a].from),r=this.getDateFromFormat(t[a].to);if(!ne.isNullOrUndefined(n)||!ne.isNullOrUndefined(r))if(ne.isNullOrUndefined(n)||ne.isNullOrUndefined(r)){var s=n||r;s.setHours(0,0,0,0),-1===i.indexOf(s.getTime())&&i.push(s.getTime())}else for(;n<=r;)n.setHours(0,0,0,0),-1===i.indexOf(n.getTime())&&i.push(n.getTime()),n.setDate(n.getDate()+1)}return i},e.prototype.isOnHolidayOrWeekEnd=function(e,t,i){var a=this.parent;if(t=ne.isNullOrUndefined(t)?a.includeWeekend:t,a.autoCalculateDateScheduling||a.isLoad&&a.treeGrid.loadChildOnDemand&&a.taskFields.hasChildMapping||(t=!0),!i.getExceptionForDate(e)){if(!t&&-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay()))return!0;var n=i.sortedDefaultHolidays;if(n&&0!==n.length)for(var r=new Date(e.getTime()).setHours(0,0,0,0),s=0,o=n.length-1;s<=o;){var l=Math.floor((s+o)/2),d=n[l];if(d===r)return!0;d<r?s=l+1:o=l-1}}return!1},e.prototype.getNonWorkingSecondsOnDate=function(e,t,i,a,n,r){var s=this.getSecondsInDecimal(e),o=this.getSecondsInDecimal(t),l=-1,d=-1,h=0,p=!(!i||!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping||a)&&this.isOnHolidayOrWeekEnd(e,null,n),i=!(!i||!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping||a)&&this.isOnHolidayOrWeekEnd(t,null,n);if(0<this.parent.weekWorkingTime.length){for(var u=this.parent.getNonWorkingRange(e),c=0;c<u.length;c++)s>=(f=u[c]).from&&s<=f.to&&(l=c);for(var g=this.parent.getNonWorkingRange(t),c=0;c<g.length;c++)o>=(f=g[c]).from&&o<=f.to&&(d=c)}else{u=this.parent.nonWorkingTimeRanges,g=this.parent.nonWorkingTimeRanges;for(var f,c=0;c<u.length;c++)s>=(f=u[c]).from&&s<=f.to&&(l=c),o>=f.from&&o<=f.to&&(d=c)}if(e.getDate()!==t.getDate()||e.getMonth()!==t.getMonth()||e.getFullYear()!==t.getFullYear()){if(!p||r)for(c=l;c<u.length;c++)ne.isNullOrUndefined(u[c])||u[c].isWorking||(h+=c===l?u[c].to-s:u[c].interval);else h+=86400-s;if(!i||r)for(c=0;c<=d;c++)g[c].isWorking||(h+=c===d?o-g[c].from:g[c].interval);else h+=o}else if(l!==d)if(!i||r)for(c=l;c<=d;c++)ne.isNullOrUndefined(u[c])||u[c].isWorking||(h+=c===l?u[c].to-s:c===d?o-u[c].from:u[c].interval);else h+=o-s;else!i||r?u[l].isWorking||(h=o-s):h+=o-s;return h},e.prototype.getPreviousWorkingDay=function(e,t){if(t&&t.getExceptionForDate(e))return e;var i=e.getDay(),a=0===i?6:i-1,n=this.parent.getCurrentDayEndTime(e);return(-1!==this.parent.nonWorkingDayIndex.indexOf(i)||-1!==this.parent.nonWorkingDayIndex.indexOf(a)&&86400!==n&&0===this.getSecondsInDecimal(e))&&(e.setDate(e.getDate()-1),-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay()))?this.getPreviousWorkingDay(e,t):e},e.prototype.getNonWorkingDayIndex=function(){for(var e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],t=e.length,i=(0===this.parent.workWeek.length&&(this.parent.workWeek=["Monday","Tuesday","Wednesday","Thursday","Friday"]),this.parent.workWeek.slice()),a=i.length,n=0;n<a;n++)i[n]=i[n].toLowerCase();this.parent.nonWorkingDayIndex=[];for(n=0;n<t;n++)-1===i.indexOf(e[n])&&this.parent.nonWorkingDayIndex.push(n)},e.prototype.setTime=function(e,t){var i=e/3600,a=(e-3600*(i=parseInt(i,10)))/60,a=parseInt(a,10);t.setHours(i,a,e-3600*i-60*a)},e.prototype.getTimeDifference=function(e,t,i){e=new Date(e.getTime()),t=new Date(t.getTime());return i&&this.updateDateWithTimeZone(e,t),t.getTime()-e.getTime()},e.prototype.updateDateWithTimeZone=function(e,t){var i,a,n,r,s=e.getTimezoneOffset(),o=t.getTimezoneOffset();s!==o&&((n=new Date((new Date).getFullYear(),0,1).getTimezoneOffset())!==s?(a=e,i=s):n!==o&&(a=t,i=o),n<0?(r=n-i,a.setTime(a.getTime()+60*r*1e3)):0<=n&&(r=i-n,a.setTime(a.getTime()-60*r*1e3)))},e.prototype.getSecondsInDecimal=function(e){return 60*e.getHours()*60+60*e.getMinutes()+e.getSeconds()+e.getMilliseconds()/1e3},e.prototype.offset=function(e,t){var i=e.getTimezoneOffset();try{var a=new Date(e.toLocaleString("en-US",{timeZone:t}));return isNaN(a.getTime())?0:(e.getTime()-a.getTime())/6e4+i}catch(e){return 0}},e.prototype.remove=function(e,t){return e=ne.isNullOrUndefined(e)?e:this.reverse(e,t,e.getTimezoneOffset())},e.prototype.reverse=function(e,t,i){"string"==typeof t&&(t=this.offset(e,t)),"string"==typeof i&&(i=this.offset(e,i));var a=e.getTimezoneOffset(),t=(e=new Date(e.getTime()+6e4*(t-i))).getTimezoneOffset();return new Date(e.getTime()+6e4*(t-a))},e.prototype.convert=function(e,t){var i=e.getTimezoneOffset(),t=this.offset(e,t),a=("string"==typeof i&&(i=this.offset(e,i)),"string"==typeof t&&(t=this.offset(e,t)),e.getTimezoneOffset()),i=(e=new Date(e.getTime()+6e4*(i-t))).getTimezoneOffset();return new Date(e.getTime()+6e4*(i-a))},e.prototype.getDateFromFormat=function(e,t){if(ne.isNullOrUndefined(e))return null;e=e instanceof Date?new Date(e.getTime()):(i=this.parent.globalize.parseDate(e,{format:this.parent.getDateFormat(),type:"dateTime"}),ne.isNullOrUndefined(i)&&!isNaN(new Date(e).getTime())?new Date(e):i);var i=!this.parent.isOnAdded;return!ne.isNullOrUndefined(this.parent.timezone)&&t&&(i&&this.parent.timezone||this.parent.isLoad)?this.convert(e,this.parent.timezone):e},e.prototype.compareDates=function(e,t){return ne.isNullOrUndefined(e)||ne.isNullOrUndefined(t)?!ne.isNullOrUndefined(e)&&ne.isNullOrUndefined(t)?1:ne.isNullOrUndefined(e)&&!ne.isNullOrUndefined(t)?-1:null:e.getTime()>t.getTime()?1:e.getTime()<t.getTime()?-1:0},e.prototype.getDurationString=function(e,t){var i="";return ne.isNullOrUndefined(e)||(i+=parseFloat(e.toFixed(2))+" ",ne.isNullOrUndefined(t))||(e=1!==e,"day"===t?i+=e?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===t?i+=e?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===t&&(i+=e?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))),i},e.prototype.getWorkString=function(e,t){var i="";return ne.isNullOrUndefined(e)||(i+=parseFloat(e).toFixed(2)+" ",ne.isNullOrUndefined(t))||(e=1!==e,"day"===t?i+=e?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===t?i+=e?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):"minute"===t&&(i+=e?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute"))),i},e.prototype.calculateProjectDatesForValidatedTasks=function(e){var t,i=this,a="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,n="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,r=null,s=null,o=ne.getValue("dataOperation.dataArray",this.parent);!o||0!==o.length||a&&n?0<o.length&&(t=o.slice().sort(function(e,t){return new Date(e[i.parent.taskFields.startDate]).getTime()-new Date(t[i.parent.taskFields.startDate]).getTime()}),o=o.slice().sort(function(e,t){return new Date(t[i.parent.taskFields.endDate]).getTime()-new Date(e[i.parent.taskFields.endDate]).getTime()}),r=t[0][this.parent.taskFields.startDate],s=o[o.length-1][this.parent.taskFields.endDate]):(r=this.getDateFromFormat(new Date),s=this.getDateFromFormat(new Date(r.getTime()))),this.parent.cloneProjectStartDate=a?new Date(a.getTime()):"string"==typeof r?new Date(r):r,this.parent.cloneProjectEndDate=n?new Date(n.getTime()):"string"==typeof s?new Date(s):s,this.calculateTimelineDates()},e.prototype.calculateProjectDates=function(e){var t,i,a,n,r,s,o,l,d=this;this.parent.isLoad&&this.parent.enablePersistence&&this.parent.cloneProjectStartDate&&this.parent.cloneProjectEndDate?(this.parent.cloneProjectStartDate=this.getDateFromFormat(this.parent.cloneProjectStartDate),this.parent.cloneProjectEndDate=this.getDateFromFormat(this.parent.cloneProjectEndDate)):(t="string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,i="string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,t=this.getDateFromFormat(t),i=this.getDateFromFormat(i),n=a=null,r=this.parent.flatData,this.parent.currentViewData,s=[],o=function(e){ne.isNullOrUndefined(e)||s.push(e)},l=function(e){0<e.length&&(e.sort(function(e,t){return e.getTime()-t.getTime()}),a=new Date(e[0].getTime()),n=1<e.length?new Date(e[e.length-1].getTime()):null)},(!t||!i)&&0<r.length||e?(r.forEach(function(e){s=[];var t,i=e.ganttProperties;"ResourceView"===d.parent.viewType&&0===e.level||(e=ne.isNullOrUndefined(i.startDate)&&ne.isNullOrUndefined(i.endDate)?t=null:(t=d.getValidStartDate(i),d.getValidEndDate(i)),o(a),o(n),o(t),o(e),d.parent.renderBaseline&&(o(i.baselineStartDate),o(i.baselineEndDate)),i.indicators&&0<i.indicators.length&&i.indicators.forEach(function(e){o(d.getDateFromFormat(e.date))}),l(s))}),s=[],o(a),o(n),0<this.parent.eventMarkers.length&&this.parent.eventMarkers.forEach(function(e,t){o(d.getDateFromFormat(e.day))}),0<this.parent.defaultCalendarContext.defaultHolidays.length&&this.parent.defaultCalendarContext.defaultHolidays.forEach(function(e,t){o(new Date(e))}),l(s),a&&n||(a?a=ne.isNullOrUndefined(a)?this.getDateFromFormat(new Date):a:(a=ne.isNullOrUndefined(a)?this.getDateFromFormat(new Date):a).setHours(0,0,0,0),(n=this.getDateFromFormat(new Date(a.getTime()))).setDate(n.getDate()+20))):t&&i||0!==r.length||(a=this.getDateFromFormat(new Date),n=this.getDateFromFormat(new Date(a.getTime()))),e?(ne.setValue("minStartDate",a,e),ne.setValue("maxEndDate",n,e)):(this.prevProjectStartDate=this.parent.cloneProjectStartDate,this.parent.cloneProjectStartDate=t?new Date(t.getTime()):"string"==typeof a?new Date(a):a,this.parent.cloneProjectEndDate=i?new Date(i.getTime()):"string"==typeof n?new Date(n):n),this.parent.isProjectDateUpdated=!0),this.calculateTimelineDates()},e.prototype.calculateTimelineDates=function(){var e,t;this.parent.isLoad&&this.parent.enablePersistence&&this.parent.cloneTimelineStartDate&&this.parent.cloneTimelineEndDate?(this.parent.cloneTimelineStartDate=this.getDateFromFormat(this.parent.cloneTimelineStartDate),this.parent.cloneTimelineEndDate=this.getDateFromFormat(this.parent.cloneTimelineEndDate)):(t=function(e){return null==e||"string"==typeof e&&"auto"===e.toLowerCase()?null:new Date(e)},"string"==typeof this.parent.projectStartDate?new Date(this.parent.projectStartDate):this.parent.projectStartDate,"string"==typeof this.parent.projectEndDate?new Date(this.parent.projectEndDate):this.parent.projectEndDate,e=t(this.parent.timelineSettings.viewStartDate),t=t(this.parent.timelineSettings.viewEndDate),this.parent.cloneTimelineStartDate=e||new Date(this.parent.cloneProjectStartDate),this.parent.cloneTimelineEndDate=t||new Date(this.parent.cloneProjectEndDate),t||this.parent.timelineModule.adjustEndDateToFillChart(!1))},e.prototype.splitTasksDuration=function(e){var t=0,i=e[0].startDate,e=e[e.length-1].endDate;return"Hour"===this.parent.timelineModule.bottomTier?t+=Math.ceil(this.getTimeDifference(i,e)/36e5):"Minutes"===this.parent.timelineModule.bottomTier?t+=Math.ceil(this.getTimeDifference(i,e)/6e4):t+=Math.ceil(this.getTimeDifference(i,e)/864e5),t},e.prototype.getBinaryBound=function(e,t){for(var i=0,a=e.length;i<a;){var n=Math.floor((i+a)/2);e[n]<t?i=n+1:a=n}return i};var J=e;function e(e){this.fromSegments=!1,this.mondayTimeRangeLength=0,this.tuesdayTimeRangeLength=0,this.wednesdayTimeRangeLength=0,this.thursdayTimeRangeLength=0,this.fridayTimeRangeLength=0,this.saturdayTimeRangeLength=0,this.sundayTimeRangeLength=0,this.parent=e}te.prototype.initialize=function(){this.buildDefaultHolidays(),this.buildExceptionsCollection()},te.prototype.buildDefaultHolidays=function(){for(var e=("projectCalendar"===this.calendar.propName?this.parent.calendarModule:this.calendar).holidays,t=this.calendar.exceptions,i=0;i<e.length;i++)for(var a=e[i],n=a.from?new Date(a.from):new Date(a.to),r=a.to?new Date(a.to):new Date(a.from),s=new Date(n);s<=r;s.setDate(s.getDate()+1)){for(var o=new Date(s).setHours(0,0,0,0),l=!1,d=0;d<t.length;d++)if(new Date(t[d].from).setHours(0,0,0,0)===o){l=!0;break}l||this.defaultHolidays.push(o)}this.sortedDefaultHolidays=this.defaultHolidays.slice().sort(function(e,t){return e-t})},te.prototype.buildExceptionsCollection=function(){for(var e=this.calendar.exceptions,t=0;t<e.length;t++){var i=e[t],a=new Date(i.from),n=new Date(i.to);this.exceptionsRanges.push({id:"exception_"+t,from:a,to:n});for(var r=new Date(a);r<=n;r.setDate(r.getDate()+1))this.exceptionDateSet.add(new Date(r).setHours(0,0,0,0))}},te.prototype.getExceptionForDate=function(e){e=new Date(e.getTime()).setHours(0,0,0,0);return this.exceptionDateSet.has(e)};var ee=te;function te(e,t){this.defaultHolidays=[],this.sortedDefaultHolidays=[],this.exceptionDateSet=new Set,this.exceptionsRanges=[],this.parent=e,this.calendar=t,this.initialize()}ie=function(e,t){return(ie=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ie(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(t,ae=J),t.prototype.addEventListener=function(){this.parent.on("beforeDataManipulate",this.checkDataBinding.bind(this))},t.prototype.checkDataBinding=function(e){var t,i=this;e&&(this.parent.flatData=[],this.parent.currentViewData=[],this.parent.updatedRecords=[],this.dataArray=[],this.taskIds={},this.parent.ids=[],this.recordIndex=0,this.hierarchyData=[],this.parent.predecessorsCollection=[],this.parent.treeGrid.parentData=[],this.parent.taskIds=[]),ne.isNullOrUndefined(this.parent.dataSource)?(this.parent.dataSource=[],this.parent.processTimeline(),this.parent.renderGantt(e)):this.parent.dataSource instanceof U.DataManager?this.initDataSource(e):(this.parent.dataSource instanceof Object&&H(this.parent)?(t=ne.getValue("result",this.parent.dataSource),this.dataArray=t):this.dataArray=this.parent.dataSource,this.processTimeline(),this.cloneDataSource(),this.parent.renderGantt(e),this.parent.flatData.map(function(e){i.parent.chartRowsModule.updateSegment(e.ganttProperties.segments,e.ganttProperties.taskId)})),this.parent.flatData.map(function(e){i.parent.chartRowsModule.updateSegment(e.ganttProperties.segments,e.ganttProperties.taskId)})},t.prototype.processTimeline=function(){this.parent.processTimeline(),this.parent.enableValidation||(this.parent.dataOperation.calculateProjectDatesForValidatedTasks(),this.parent.timelineModule.validateTimelineProp())},t.prototype.initDataSource=function(t){var i=this,e=this.parent.query instanceof U.Query?this.parent.query:new U.Query,a=(e.requiresCount(),this.parent.dataSource);this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(this.processTimeline(),this.parent.renderGantt(t)):a.executeQuery(e).then(function(e){i.dataArray=e.result,i.processTimeline(),i.parent.loadChildOnDemand&&(!i.parent.loadChildOnDemand||i.parent.taskFields.hasChildMapping)||i.cloneDataSource(),i.parent.renderGantt(t)}).catch(function(e){i.parent.processTimeline(),i.parent.renderGantt(t),i.parent.trigger("actionFailure",{error:e})})},t.prototype.constructDataSource=function(e){for(var t=new U.DataManager(e).executeLocal((new U.Query).group(this.parent.taskFields.parentID)),i=[],a=0;a<t.length;a++){var n=t[a];if(!ne.isNullOrUndefined(n.key)){var r=n.key.toString(),r=void 0!==this.taskIds[r]?this.taskIds[r]:-1;if(-1<r&&!ne.isNullOrUndefined(n.key)){e[r][this.parent.taskFields.child]=n.items;continue}}(-1!==r||this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&i.push.apply(i,n.items)}this.hierarchyData=this.dataReorder(e,i)},t.prototype.cloneDataSource=function(){var e,t,i,a=this.parent.taskFields.id,n=this.parent.taskFields.parentID,r=[];if(ne.isNullOrUndefined(a)||ne.isNullOrUndefined(n))r=this.dataArray;else{var s=[],n=void 0;this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping&&!this.parent.enableVirtualization&&(n=JSON.parse(JSON.stringify(this.dataArray)));for(var o=0;o<this.dataArray.length;o++){var l=this.dataArray[o];l.parentItem&&delete l.parentItem,s.push(ne.extend({},{},l,!0)),ne.isNullOrUndefined(l[a])||(l=l[a].toString(),this.taskIds[l]=o)}this.parent.taskFields.child||this.parent.setProperties({taskFields:{child:"Children"}},!0),ne.isNullOrUndefined(n)?this.constructDataSource(s):(this.constructDataSource(this.dataArray),this.dataArray=n),r=this.hierarchyData}this.parent.taskFields.segmentId&&(this.segmentCollection=new U.DataManager(this.parent.segmentData).executeLocal((new U.Query).group(this.parent.taskFields.segmentId)),this.parent.taskFields.segments||(this.parent.taskFields.segments="Segments")),"ProjectView"!==this.parent.viewType&&(n=ne.extend([],[],this.parent.resources,!0),this.constructResourceViewDataSource(n,r,e=[]),0<e.length&&(i=this.parent.resourceFields.name||"resourceName",(t={})[this.parent.resourceFields.id]=0,t[i]=this.parent.localeObj.getConstant("unassignedTask"),t[this.parent.taskFields.child]=e,n.push(t)),r=n),this.prepareDataSource(r)},t.prototype.constructResourceViewDataSource=function(s,o,l){for(var d=this,e=0;e<o.length;e++)!function(e){var a=o[e],n=null!==d.parent.taskFields.child?d.parent.taskFields.child:d.parent.taskFields.child="Children",e=a&&a[d.parent.taskFields.resourceInfo],r=d.parent.resourceFields.id;if(a[n]&&0!==a[n].length||!e||!e.length)(!a[n]||a[n]&&0===a[n].length)&&l.push(a);else if("string"==typeof e){d.isResourceString=!0;for(var t=e,i=0;i<s.length;i++)if(s[i][r].toString()===t.toString()){s[i][n]?s[i][n].push(a):s[i][n]=[a];break}}else e.forEach(function(e){for(var t="object"==typeof e?e[r]:e,i=0;i<s.length;i++)if(s[i][r].toString()===t.toString()){s[i][n]?s[i][n].push(a):s[i][n]=[a];break}});a[d.parent.taskFields.child]&&a[d.parent.taskFields.child].length&&d.constructResourceViewDataSource(s,a[d.parent.taskFields.child],l)}(e)},t.prototype.prepareDataSource=function(e){this.prepareRecordCollection(e,0),this.parent.initialLoadData=ne.extend({},{},this.parent.flatData,!0),(!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&(this.parent.dataMap=this.parent.flatData.reduce(function(e,t){return e.set(t.uniqueID,t),e},new Map)),"ResourceView"===this.parent.viewType&&this.calculateSharedTaskUniqueIds(),this.parent.taskFields.dependency&&this.parent.predecessorModule&&this.parent.predecessorModule.ensurePredecessorCollection()},t.prototype.calculateSharedTaskUniqueIds=function(){for(var r=this,e=0;e<this.parent.getTaskIds().length;e++)!function(e){var t=[];if(t[0]=r.parent.getTaskIds()[e][0],t[1]=r.parent.getTaskIds()[e].slice(1),"R"!==t[0]){var i=[],a=[];r.parent.flatData.filter(function(e){e.ganttProperties.taskId.toString()===t[1]&&0!==e.level&&(a.push(e.ganttProperties.rowUniqueID),i.push(e))});for(var n=0;n<i.length;n++)i[n].ganttProperties.sharedTaskUniqueIds=a}}(e)},t.prototype.appendGanttRecord=function(e){!this.isHavingUnscheduledTaskOnLoad&&this.isUnscheduledTask(e.ganttProperties)[0]&&"duration"===this.isUnscheduledTask(e.ganttProperties)[1]&&ne.isNullOrUndefined(e.parentItem)&&(this.isHavingUnscheduledTaskOnLoad=!0),this.parent.flatData.push(e)},t.prototype.prepareRecordCollection=function(e,r,s){var o,l,d,h,p,u,c,g,f,m,y,D=this;Array.isArray(e)&&(o=this.parent.taskFields,l=o.hasChildMapping,d=o.segmentId,h=o.constraintDate,p=o.constraintType,u=this.parent.enableValidation,this.parent.autoCalculateDateScheduling,c=this.parent.isLoad,g=this.parent.treeGrid.loadChildOnDemand,f=this.parent.viewType,m=this.parent.allowParentDependency,y=this.parent.dataSource instanceof Object&&H(this.parent)&&!ne.isNullOrUndefined(o.child),e.forEach(function(t){d&&D.segmentCollection&&(a=D.segmentCollection.find(function(e){return e.key===t[o.id]}))&&a.items&&a.items.length&&(t[o.segments]=a.items),l&&t.parentUniqueID&&(s=D.parent.getTaskByUniqueID(t.parentUniqueID)),h&&p&&!t.constraintDate&&!t[p]&&(t[p]=0,t[h]=t[o.startDate]||t[o.endDate]);var e,i,a=D.createRecord(t,r,s,!0,y),n=((!u||c&&g&&l)&&D.updateTaskLeftWidth(a),a.index=D.recordIndex++,D.parent.ids[a.index]=a.ganttProperties.rowUniqueID,D.appendGanttRecord(a),D.parent.setTaskIds(a),t[o.child]||t.taskData&&t.taskData[o.child]);"ResourceView"!==f||n&&0!==n.length||a.parentItem||0!==a.level||(e=a.ganttProperties,i=a,D.parent.setRecordValue(e.isAutoSchedule?"startDate":"autoStartDate",null,e,!0),D.parent.setRecordValue(e.isAutoSchedule?"endDate":"autoEndDate",null,e,!0),D.parent.setRecordValue("isMilestone",!1,e,!0),e.isAutoSchedule&&D.calculateDuration(i),D.updateWorkWithDuration(i),D.parent.setRecordValue("work",e.work,e,!0),D.parent.setRecordValue("taskType","FixedDuration",e,!0),o.type&&D.updateMappingData(i,"type"),D.parent.setRecordValue("progress",0,e,!0),D.parent.setRecordValue("totalProgress",0,e,!0),D.parent.setRecordValue("totalDuration",0,e,!0),e.isAutoSchedule||(D.parent.setRecordValue("autoDuration",D.calculateAutoDuration(e),e,!0),D.updateAutoWidthLeft(i)),m||D.resetDependency(i),D.updateWidthLeft(i),D.updateTaskData(i)),l&&(s=null),n&&0<n.length&&D.prepareRecordCollection(n,a.level+1,a)}))},t.prototype.addCustomFieldValue=function(e,t,i){var a=this.parent.ganttColumns,n=a.length;if(n)for(var r=0;r<n;r++){var s=a[r];void 0===t[s.field]&&(i?t[s.field]=void 0!==e[s.field]?e[s.field]:null:this.parent.setRecordValue(s.field,e[s.field],t))}var o,l=this.parent.taskFields.calendarId;l&&void 0!==(o=e[l])&&(i?t[l]=o:this.parent.setRecordValue(l,o,t))},t.prototype.getGanttUid=function(e){return""+e+this.uid++},t.prototype.processCustomColumns=function(n){var r=this;this.parent.customColumns&&0!==this.parent.customColumns.length&&this.parent.customColumns.forEach(function(e){var t,i,a=r.parent.getColumnByField(e,r.parent.ganttColumns);(a&&"date"===a.type||"datetime"===a.type)&&null!=(a=n[e])&&(t="string"==typeof a&&r.isValidDateString(a),i=a instanceof Date&&!isNaN(a.getTime()),t||i)&&(i=t?new Date(a):a,n[e]=r.getDateFromFormat(i,!0))})},t.prototype.isValidDateString=function(e){e=e.trim();return!!e&&!/^\d+$/.test(e)&&!isNaN(Date.parse(e))},t.prototype.createRecord=function(e,t,i,a,n){var r,s,o,l,d,h,p,u=this.parent.taskFields,c=this.parent.resourceFields,g=e[u.progress],f=null,m=null,y=e[u.notes],D=(g=100<(g=g&&parseFloat(g.toString())?parseFloat(g.toString()):0)?100:g,e[u.dependency]),k=(ne.isNullOrUndefined(D)||(r=e[u.id].toString(),s=/^(\d+)/,o=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})/,l=/^([A-Za-z]+-?\d+)/,D=D.toString().split(",").map(function(e){return e.trim()}).filter(function(e){var t=e.match(o);return(d=ne.isNullOrUndefined(t&&t[1])&&(t=e.match(l),ne.isNullOrUndefined(t&&t[1]))&&(t=e.match(s),ne.isNullOrUndefined(t&&t[1]))?d:t[1])!==r}).join(",")),this.getDateFromFormat(e[u.baselineStartDate],!0)),T=this.getDateFromFormat(e[u.baselineEndDate],!0),b=(this.processCustomColumns(e),this.parent.loadChildOnDemand&&u.hasChildMapping&&!this.parent.enableVirtualization?(h=e,p=JSON.parse(JSON.stringify(e))):h={},{}),w="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&!0!==e[u.manual],c=(this.parent.setRecordValue("ganttProperties",b,h),e.ganttProperties&&e.ganttProperties.predecessor&&0<e.ganttProperties.predecessor.length&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.setRecordValue("predecessor",e.ganttProperties.predecessor,b,!0),ne.isNullOrUndefined(e[u.id])?ne.isNullOrUndefined(e[c.id])||(f=e[c.id],m=ne.isNullOrUndefined(e[c.name])&&"Unassigned Task"===e.resourceName?e.resourceName:e[c.name],this.addTaskData(h,e,!1)):("number"==typeof(f=e[u.id])||/^-?\d+$/.test(f)||(this.isTaskIDInteger=!1),m=e[u.name],!!(this.parent.loadChildOnDemand&&u.hasChildMapping&&e.taskData)?h.taskData=e.taskData:e.taskData&&e.ganttProperties?this.addTaskData(h,e.taskData,a):this.addTaskData(h,e,a)),this.parent.setRecordValue("taskId",f,b,!0),this.parent.setRecordValue("taskName",m,b,!0),m=(f=u.calendarId?((e[u.child]&&0<e[u.child].length||u.parentID&&e.Children)&&e[u.calendarId]&&(e[u.calendarId]=void 0),c=e[u.calendarId],this.parent.setRecordValue("calendarId",c,b,!0),this.parent.calendarModule.getCalendarById(c=!c||w?c:void 0)):this.parent.calendarSettings.projectCalendar,new ee(this.parent,f)),this.parent.setRecordValue("calendarContext",m,b,!0),this.parent&&u.parentID&&this.parent.setRecordValue("parentId",e[u.parentID],b,!0),this.addCustomFieldValue(e,h,a),this.parent.setRecordValue("isAutoSchedule",w,b,!0),!this.parent.undoRedoModule||this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed?this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),b,!0):e.ganttProperties&&this.parent.setRecordValue("resourceInfo",e.ganttProperties.resourceInfo,b,!0),this.parent.setRecordValue("isMilestone",!1,b,!0),this.parent.setRecordValue("indicators",e[u.indicators],b,!0),this.updateResourceName(h),!ne.isNullOrUndefined(e[u.child])&&0<e[u.child].length||e.taskData&&e.taskData[u.child]&&0<e.taskData[u.child].length?(this.parent.setRecordValue("hasChildRecords",!0,h),this.parent.setRecordValue("isMilestone",!1,b,!0),this.parent.allowParentDependency||this.resetDependency(h)):this.parent.loadChildOnDemand&&u.hasChildMapping&&h.taskData[u.hasChildMapping]?this.parent.setRecordValue("hasChildRecords",!0,h):this.parent.setRecordValue("hasChildRecords",!1,h),e[u.constraintType]),m=(h.hasChildRecords?c&&0!==c&&4!==c&&7!==c&&(e[u.constraintType]=0):c&&(c<0||7<c)&&(e[u.constraintType]=0),this.parent.setRecordValue("constraintType",e[u.constraintType],b,!0),this.parent.setRecordValue("constraintDate",e[u.constraintDate],b,!0),a||(this.parent.setRecordValue("baselineStartDate",this.checkBaselineStartDate(k,b),b,!0),e[u.baselineEndDate]?this.parent.setRecordValue("baselineEndDate",e[u.baselineEndDate],b,!0):this.parent.setRecordValue("baselineEndDate",this.checkBaselineEndDate(T,b),b,!0)),this.calculateScheduledValues(h,e,a),this.calculateScheduledValuesforBaseline(h,e,a),this.parent.setRecordValue("progress",g,b,!0),this.parent.setRecordValue("totalProgress",g,b,!0),e.ganttProperties&&e.ganttProperties.predecessorsName&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed?this.parent.setRecordValue("predecessorsName",e.ganttProperties.predecessorsName,b,!0):this.parent.setRecordValue("predecessorsName",D,b,!0),this.parent.setRecordValue("notes",y,b,!0),this.parent.setRecordValue("cssClass",e[u.cssClass],b,!0),this.parent.setRecordValue("parentItem",this.getCloneParent(i),h),this.parent.loadChildOnDemand&&u.hasChildMapping&&0<this.parent.currentViewData.length&&(f=this.taskIds[e[u.id].toString()],this.parent.setRecordValue("parentItem",h.parentItem,this.parent.currentViewData[f])),h.parentItem?h.parentItem.uniqueID:null);return this.parent.setRecordValue("parentUniqueID",m,h),"ResourceView"!==this.parent.viewType||ne.isNullOrUndefined(u.parentID)||ne.isNullOrUndefined(h.parentItem)||this.parent.setRecordValue("parentId",h.parentItem.taskId,b,!0),this.parent.setRecordValue("level",t,h),e.ganttProperties&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.loadChildOnDemand&&u.hasChildMapping&&e.uniqueID?this.parent.setRecordValue("uniqueID",e.uniqueID,h):this.parent.setRecordValue("uniqueID",this.getGanttUid(this.parent.element.id+"_data_"),h),this.parent.setRecordValue("uniqueID",h.uniqueID,b,!0),this.parent.setRecordValue("childRecords",[],h),n&&this.parent.setRecordValue(u.child,[],h),h.hasChildRecords&&(this.parent.setRecordValue("autoStartDate",h.ganttProperties.startDate,b),this.parent.setRecordValue("autoEndDate",h.ganttProperties.endDate,b),this.parent.setRecordValue("autoDuration",h.ganttProperties.duration,b)),this.parent.setRecordValue("expanded",!h.hasChildRecords||!this.parent.collapseAllParentTasks,h),ne.isNullOrUndefined(p)?this.updateExpandStateMappingValue(h,e):this.updateExpandStateMappingValue(h,p),a||(this.parent.setRecordValue("width",this.calculateWidth(h),b,!0),this.parent.setRecordValue("left",this.calculateLeft(b,h),b,!0),this.parent.setRecordValue("progressWidth",this.getProgressWidth(b.width,g),b,!0),b.baselineEndDate&&b.baselineStartDate&&(this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(b),b,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(b),b,!0))),ne.isNullOrUndefined(u.work)&&this.updateWorkWithDuration(h),ne.isNullOrUndefined(u.manual)||this.parent.dataOperation.updateMappingData(h,"manual"),this.updateTaskData(h),D&&this.parent.predecessorsCollection.push(h),ne.isNullOrUndefined(i)||(i.childRecords.push(h),n&&i[this.parent.taskFields.child].push(h.taskData)),"ProjectView"===this.parent.viewType?this.parent.setRecordValue("rowUniqueID",b.taskId.toString(),b,!0):(w=h.uniqueID.replace(this.parent.element.id+"_data_",""),this.parent.setRecordValue("rowUniqueID",w,h),this.parent.setRecordValue("rowUniqueID",w,b,!0),this.parent.setRecordValue("sharedTaskUniqueIds",[],b,!0)),this.parent.allowUnscheduledTasks&&h.ganttProperties.startDate&&(h.ganttProperties.endDate||h.ganttProperties.duration)&&(this.parent.taskFields.segments&&(this.parent.setRecordValue("segments",this.setSegmentsInfo(h,!0),b,!0),this.parent.dataOperation.updateMappingData(h,"segments")),a||this.updateWidthLeft(h)),this.parent.chartRowsModule.updateSegment(h.ganttProperties.segments,h.ganttProperties.taskId),h},t.prototype.getValidatedTaskData=function(){for(var e=this.parent.taskFields,t=[],i=0,a=Array.from(this.validatedGanttData.values());i<a.length;i++){var n,r,s=a[i];s.taskData&&(n=Object.assign({},s.taskData),r=s.ganttProperties,n[e.startDate]&&(n[e.startDate]=r.startDate),n[e.endDate]&&(n[e.endDate]=r.endDate),n[e.duration]&&(n[e.duration]=r.duration),n[e.work]&&(n[e.work]=r.work),n[e.progress]&&(n[e.progress]=r.progress),n[e.constraintType]&&(n[e.constraintType]=r.constraintType),n[e.constraintDate]&&(n[e.constraintDate]=r.constraintDate),n[e.segments]&&(n[e.segments]=s[e.segments]),n[e.baselineStartDate]&&(n[e.baselineStartDate]=r.baselineStartDate),n[e.baselineEndDate]&&(n[e.baselineEndDate]=r.baselineEndDate),this.parent.timezone&&!ne.isNullOrUndefined(this.parent.editModule)&&this.parent.editModule.processStandardDateFields(n,n,this.parent,"remove"),t.push(n))}return t},t.prototype.sortSegmentsData=function(e,t,i){var a=this;return t?e.sort(function(e,t){var i=a.parent.taskFields.startDate;return a.getDateFromFormat(e[i]).getTime()-a.getDateFromFormat(t[i]).getTime()}):e.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),e},t.prototype.setSegmentsInfo=function(e,t){var i,a=this,n=this.parent.taskFields,r=[],s=0,o=0,l=0,d=[this.parent.taskFields.duration,this.parent.taskFields.endDate,this.parent.taskFields.startDate,this.parent.taskFields.id],h=[],p=e.ganttProperties.calendarContext,u=this.parent.editModule&&this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.isEdit;if(!ne.isNullOrUndefined(this.parent.taskFields.segments)&&(i=t?e.taskData[this.parent.taskFields.segments]:e.ganttProperties.segments,t||e.taskData[this.parent.taskFields.segments]&&0<e.taskData[this.parent.taskFields.segments].length&&e.taskData[this.parent.taskFields.segments].forEach(function(e){var t,i={};for(t in e)-1!==d.indexOf(t)?(t,e[t]):i[t]=e[t];a.customSegmentProperties.push(i)}),!ne.isNullOrUndefined(i))&&1<i.length){this.sortSegmentsData(i,t,e.ganttProperties);for(var c=0;c<i.length;c++){var g=i[c],f=t?g[n.startDate]:g.startDate,m=t?g[n.endDate]:g.endDate,y=t?g[n.duration]:g.duration,f=this.getDateFromFormat(f);if(f=this.checkStartDate(f,e.ganttProperties,!1),ne.isNullOrUndefined(y)){if((m=this.getDateFromFormat(m))&&(ne.isNullOrUndefined(y)||""===String(y))&&(D=void 0,D=0<this.parent.weekWorkingTime.length?this.parent.getEndTime(m):this.parent.defaultEndTime,0===m.getHours())&&86400!==D&&this.setTime(D,m),m=this.checkEndDate(m,e.ganttProperties,!1),y=this.getDuration(f,m,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone,void 0,p),ne.isNullOrUndefined(r[c-1])||(l=(l+=this.getDuration(r[c-1].endDate,f,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone,void 0,p))<1?1:l),n.duration){if((o=e.ganttProperties.duration-s-l)<=0)continue;y=c===i.length-1||0<o&&o<y?o:y,m=this.getEndDate(f,y,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!n.duration&&n.endDate&&m&&(y=this.getDuration(f,m,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone,void 0,p),0<r.length)&&m.getTime()<f.getTime()&&m.getTime()<=e.ganttProperties.endDate.getTime()){r[c-1].duration=this.getDuration(r[c-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone,void 0,p);continue}}else if(m=this.getEndDate(f,y,e.ganttProperties.durationUnit,e.ganttProperties,!1),n.duration){if((o=e.ganttProperties.duration-s)<=0)continue;y=c===i.length-1||0<o&&o<y?o:y,m=this.getEndDate(f,y,e.ganttProperties.durationUnit,e.ganttProperties,!1)}else if(!n.duration&&n.endDate&&m&&(m=!ne.isNullOrUndefined(e.ganttProperties.endDate)&&m.getTime()>=e.ganttProperties.endDate.getTime()&&c===i.length-1?e.ganttProperties.endDate:m,y=this.getDuration(f,m,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone,void 0,p),0<r.length)&&m.getTime()<f.getTime()&&m.getTime()<=e.ganttProperties.endDate.getTime()){r[c-1].duration=this.getDuration(r[c-1].startDate,e.ganttProperties.endDate,e.ganttProperties.durationUnit,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone,void 0,p);continue}if(g={},!f||!m||!f||ne.isNullOrUndefined(y))break;if(s+=Number(y),g.startDate=f,g.endDate=m,g.duration=Number(y),g.width=0,g.left=0,g.segmentIndex=c,r.push(g),ne.isNullOrUndefined(r[c-1]))g.offsetDuration=0;else{f=void 0,f=ne.isNullOrUndefined(this.parent.timelineSettings.bottomTier)?e.ganttProperties.durationUnit:"Minutes"===this.parent.timelineSettings.bottomTier.unit?"minute":"Hour"===this.parent.timelineSettings.bottomTier.unit?"hour":e.ganttProperties.durationUnit,y=this.getDuration(r[c-1].endDate,r[c].startDate,f,e.ganttProperties.isAutoSchedule,e.ganttProperties.isMilestone,void 0,p);if((g.offsetDuration=y)<1){if(0===this.parent.weekWorkingTime.length)g.startDate=this.getEndDate(r[c-1].endDate,1,e.ganttProperties.durationUnit,e.ganttProperties,!1);else{f=new Date(r[c-1].endDate.getTime());if(g.startDate=new Date(f.setHours(f.getHours()+24)),this.isOnHolidayOrWeekEnd(g.startDate,!0,p))for(;g.startDate.setDate(g.startDate.getDate()+1),this.isOnHolidayOrWeekEnd(g.startDate,!0,p););this.parent.includeWeekend||(g.startDate=this.getNextWorkingDay(g.startDate,p));var D=this.parent.getEndTime(r[c-1].endDate);this.getSecondsInDecimal(r[c-1].endDate)===D&&this.setTime(this.parent.getEndTime(g.startDate),g.startDate)}g.startDate=this.checkStartDate(g.startDate,e.ganttProperties,!1),g.endDate=this.getEndDate(g.startDate,g.duration,e.ganttProperties.durationUnit,e.ganttProperties,!1),g.endDate=(!n.duration&&n.endDate&&g.endDate>e.ganttProperties.endDate?e.ganttProperties:g).endDate,g.offsetDuration=1}}y=e[this.parent.taskFields.segments]||i;h.push(this.setSegmentTaskData(g,y[c]))}this.parent.setRecordValue("duration",s,e.ganttProperties,!0),ne.isNullOrUndefined(r[r.length-1])||this.parent.setRecordValue("endDate",r[r.length-1].endDate,e.ganttProperties,!0),ne.isNullOrUndefined(n.endDate)||ne.isNullOrUndefined(r[r.length-1])||this.parent.setRecordValue(this.parent.taskFields.endDate,r[r.length-1].endDate,e,!0),!t&&h&&0<h.length&&h.forEach(function(e,t){e=Object.assign({},e,a.customSegmentProperties[t]);h[t]=e}),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,h,e)}return!ne.isNullOrUndefined(i)&&0===i.length&&u&&(u=e.ganttProperties,m=this.parent.dataOperation.getEndDate(u.startDate,u.duration,u.durationUnit,u,!1),this.parent.setRecordValue("endDate",m,e.ganttProperties,!0),ne.isNullOrUndefined(this.parent.taskFields.endDate)||this.parent.setRecordValue(this.parent.taskFields.endDate,m,e,!0),this.parent.setRecordValue("segments",i,e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.segments,i,e,!0)),!ne.isNullOrUndefined(i)&&1===i.length&&this.parent.isLoad&&(this.parent.setRecordValue(this.parent.taskFields.segments,[],e,!0),this.parent.setRecordValue(this.parent.taskFields.segments,[],e.taskData,!0)),1<r.length?(this.parent.setRecordValue("segments",r,e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.segments,e.taskData[this.parent.taskFields.segments],e,!0)):r=null,r},t.prototype.setSegmentTaskData=function(e,t){var i=this.parent.taskFields,t=ne.extend({},{},t,!0);return ne.isNullOrUndefined(i.startDate)||(t[this.parent.taskFields.startDate]=e.startDate),ne.isNullOrUndefined(i.endDate)||(t[this.parent.taskFields.endDate]=e.endDate),ne.isNullOrUndefined(i.duration)||(t[this.parent.taskFields.duration]=Number(e.duration)),t},t.prototype.fetchResources=function(e){return this.parent.editModule&&this.parent.editModule.dialogModule&&(this.parent.editModule.dialogModule.isFromAddDialog||this.parent.editModule.dialogModule.isFromEditDialog)?this.parent.editModule.dialogModule.ganttResources:e.ganttProperties.resourceInfo},t.prototype.updateWorkWithDuration=function(e){if(this.parent.triggeredColumnName!==this.parent.taskFields.work||0===e.ganttProperties.duration||!ne.isNullOrUndefined(e.ganttProperties.resourceInfo)&&0===e.ganttProperties.resourceInfo.length||e.hasChildRecords){var t,i=this.fetchResources(e),a=0;if(!ne.isNullOrUndefined(i)&&0<i.length&&!e.hasChildRecords){for(var n,r=i.length,s=void 0,o=(0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(e.ganttProperties.startDate||e.ganttProperties.endDate):this.parent.secondsPerDay)/3600,l=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit),s=0;s<r;s++)0<(n=i[s][this.parent.resourceFields.unit])&&(a+=(t=o*n/100)*l);"minute"===e.ganttProperties.workUnit&&(a*=60),"day"===e.ganttProperties.workUnit&&(a/=o),a%1!=0&&(a=parseFloat(a.toFixed(2)))}else!e.hasChildRecords&&!ne.isNullOrUndefined(e.ganttProperties.work)&&!ne.isNullOrUndefined(e.ganttProperties.duration)&&0<e.ganttProperties.duration&&(a=e.ganttProperties.work);if(e.childRecords&&0<e.childRecords.length&&this.parent.isOnEdit){for(var d=0,h=0;h<e.childRecords.length;h++)d+=e.childRecords[h].ganttProperties.work;a+=d}"FixedUnit"===e.ganttProperties.taskType&&0===t&&(this.parent.setRecordValue("duration",a=0,e.ganttProperties,!0),ne.isNullOrUndefined(this.parent.taskFields.duration)||this.parent.setRecordValue(this.parent.taskFields.duration,0,e,!0)),this.parent.setRecordValue("work",a,e.ganttProperties,!0),this.parent.autoCalculateDateScheduling&&this.parent.isLoad&&!ne.isNullOrUndefined(e[this.parent.taskFields.work])&&a!==e[this.parent.taskFields.work]&&"FixedDuration"===this.parent.taskType&&this.validatedGanttData.set(e.ganttProperties.taskId,e),ne.isNullOrUndefined(this.parent.taskFields.work)||this.parent.isLoad||this.parent.dataOperation.updateMappingData(e,"work")}},t.prototype.getCloneParent=function(e){var t;return ne.isNullOrUndefined(e)?null:((t={}).uniqueID=e.uniqueID,t.expanded=e.expanded,t.level=e.level,t.index=e.index,t.taskId=e.ganttProperties.rowUniqueID,t)},t.prototype.reUpdateResources=function(){if(0<this.parent.flatData.length)for(var e,t,i,a=0;a<this.parent.flatData.length;a++)e=this.parent.flatData[a].taskData,t=this.parent.flatData[a].ganttProperties,i=this.parent.flatData[a],this.parent.setRecordValue("resourceInfo",this.setResourceInfo(e),t,!0),this.updateResourceName(i)},t.prototype.addTaskData=function(e,t,i){var a,n=this,r=this.parent.taskFields,s=this.parent.dataSource;i&&(r.parentID||s instanceof U.DataManager&&s.dataSource.json&&s.dataSource.offline)&&r.parentID?(i=t[r.id],s=this.taskIds[i.toString()],a=-1<s?this.dataArray[s]:{},ne.isNullOrUndefined(this.parent.taskFields.segmentId)||0<(r=this.segmentCollection.filter(function(e){return e.key===a[n.parent.taskFields.id]})).length&&(a[this.parent.taskFields.segments]=r[0].items),this.parent.setRecordValue("taskData",a,e)):this.parent.setRecordValue("taskData",t,e)},t.prototype.updateExpandStateMappingValue=function(e,t){var i,a=this.parent.taskFields.expandState,n=t[a];a&&e.hasChildRecords&&(ne.isNullOrUndefined(n)?ne.isNullOrUndefined(n)&&!this.parent.collapseAllParentTasks?i=!0:ne.isNullOrUndefined(n)&&this.parent.collapseAllParentTasks&&(i=!1):(i="true"===n.toString(),this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping&&!this.parent.enableVirtualization&&t.expanded&&(i=!0)),this.parent.setRecordValue("taskData."+a,i,e),this.parent.setRecordValue(a,i,e),this.parent.setRecordValue("expanded",i,e))},t.prototype.setValidatedDates=function(e,t){var i=e.ganttProperties,a=this.parent.taskFields,n=t[a.duration],r=this.getDateFromFormat(t[a.startDate],!0),t=this.getDateFromFormat(t[a.endDate],!0),n=ne.isNullOrUndefined(n)||""===n?null:n;this.parent.setRecordValue("startDate",new Date(r.getTime()),i,!0),ne.isNullOrUndefined(n)||""===n?this.calculateDuration(e):this.updateDurationValue(n,i),this.parent.setRecordValue("endDate",new Date(t.getTime()),i,!0)},t.prototype.calculateScheduledValues=function(e,t,i){var a,n,r=this.parent.taskFields,s=e.ganttProperties,o=t[r.duration],o=ne.isNullOrUndefined(o)||""===o?null:o,l=s.startDate&&s.endDate?(this.originalStartDate=this.getDateFromFormat(s.startDate,!1),this.originalEndDate=this.getDateFromFormat(s.endDate,!1),c=this.getDateFromFormat(s.startDate,!0),this.getDateFromFormat(s.endDate,!0)):(this.originalStartDate=this.getDateFromFormat(t[r.startDate],!1),this.originalEndDate=this.getDateFromFormat(t[r.endDate],!1),c=this.getDateFromFormat(t[r.startDate],!0),this.getDateFromFormat(t[r.endDate],!0)),d=r.segments?t[r.segments]||e.taskData[r.segments]:null,h=!!r.milestone&&!!t[r.milestone],p=t[r.durationUnit]||"",p=(i?s.durationUnit=this.validateDurationUnitMapping(p):this.parent.setRecordValue("durationUnit",this.validateDurationUnitMapping(p),s,!0),ne.isNullOrUndefined(t[r.work])?0:parseFloat(t[r.work])),u=(i?s.workUnit=this.validateWorkUnitMapping(this.parent.workUnit):this.parent.setRecordValue("workUnit",this.validateWorkUnitMapping(this.parent.workUnit),s,!0),t[r.type]||""),u=this.validateTaskTypeMapping(u);if(i?s.taskType=u:this.parent.setRecordValue("taskType",u,s,!0),t[this.parent.resourceFields.name]===this.parent.localeObj.getConstant("unassignedTask")&&(i?s.taskType="FixedDuration":this.parent.setRecordValue("taskType","FixedDuration",s,!0)),i&&!this.parent.enableValidation&&c&&l)this.setValidatedDates(e,t);else{if(l||c||!ne.isNullOrUndefined(o)&&""!==o)c?this.calculateDateFromStartDate(c,l,o,e,i):l?this.calculateDateFromEndDate(l,o,e):ne.isNullOrUndefined(o)||""===o||(this.updateDurationValue(o,s),c=this.parent.allowUnscheduledTasks?null:this.getProjectStartDate(s,i),i?(s.startDate=c,this.parent.allowUnscheduledTasks?s.endDate=null:this.calculateEndDate(e)):(this.parent.setRecordValue("startDate",c,s,!0),this.parent.allowUnscheduledTasks?this.parent.setRecordValue("endDate",null,s,!0):this.calculateEndDate(e)));else{if(this.parent.allowUnscheduledTasks)return;i?(s.duration=1,s.startDate=this.getProjectStartDate(s,i)):(this.parent.setRecordValue("duration",1,s,!0),this.parent.setRecordValue("startDate",this.getProjectStartDate(s,i),s,!0)),this.calculateEndDate(e)}ne.isNullOrUndefined(this.originalStartDate)&&ne.isNullOrUndefined(this.originalEndDate)||(this.originalStartDate=null,this.originalEndDate=null),this.parent.taskFields.constraintDate&&this.parent.taskFields.constraintType&&!e[this.parent.taskFields.dependency]&&(l=this.getDateByConstraint(s,s.startDate),i?(o=s.startDate,s.startDate=l,this.calculateEndDate(e),a=s.constraintType,n=this.parent.predecessorModule.getConstraintDate(a,s.startDate,s.endDate,s.constraintDate),s.constraintDate=n,this.parent.autoCalculateDateScheduling&&o.getTime()!==l.getTime()&&this.validatedGanttData.set(e.ganttProperties.taskId,e)):(this.parent.setRecordValue("startDate",l,s,!0),this.calculateEndDate(e),a=s.constraintType,n=this.parent.predecessorModule.getConstraintDate(a,s.startDate,s.endDate,s.constraintDate),this.parent.setRecordValue("constraintDate",n,s,!0)))}if((!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&(ne.isNullOrUndefined(e.ganttProperties.startDate)||ne.isNullOrUndefined(this.parent.taskFields.startDate)||(e[this.parent.taskFields.startDate]=e.ganttProperties.startDate,e.taskData[this.parent.taskFields.startDate]=e.ganttProperties.startDate),ne.isNullOrUndefined(e.ganttProperties.endDate)||ne.isNullOrUndefined(this.parent.taskFields.endDate)||(e[this.parent.taskFields.endDate]=e.ganttProperties.endDate,e.taskData[this.parent.taskFields.endDate]=e.ganttProperties.endDate)),ne.isNullOrUndefined(r.work))r.type&&s.taskType&&this.parent.dataOperation.updateMappingData(e,"type");else{var c=this.parent.taskFields.durationUnit&&t[r.durationUnit]?t[r.durationUnit]:this.parent.durationUnit;if(s.durationUnit=this.validateDurationUnitMapping(c),isNaN(p)||ne.isNullOrUndefined(p))i?(s.work=0,s.duration=0,s.isMilestone=!0,ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||(e[this.parent.taskFields.milestone]=!0),s.endDate=s.startDate):(this.parent.setRecordValue("work",0,s,!0),this.parent.setRecordValue("duration",0,s,!0),this.parent.setRecordValue("isMilestone",!0,s,!0),ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,e,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0));else{if(i?s.work=p:this.parent.setRecordValue("work",p,s,!0),!this.parent.undoRedoModule||this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed)switch(u){case"FixedDuration":(ne.isNullOrUndefined(e[this.parent.taskFields.resourceInfo])||ne.isNullOrUndefined(e.ganttProperties.resourceInfo)||0===e.ganttProperties.resourceInfo.length)&&0!==s.duration||this.updateWorkWithDuration(e);break;case"FixedWork":(ne.isNullOrUndefined(e[this.parent.taskFields.resourceInfo])||ne.isNullOrUndefined(e.ganttProperties.resourceInfo)||0===e.ganttProperties.resourceInfo.length)&&0!==s.work||this.updateDurationWithWork(e);break;case"FixedUnit":e.hasChildRecords||this.updateDurationWithWork(e)}ne.isNullOrUndefined(r.type)||this.parent.dataOperation.updateMappingData(e,"type"),0===s.duration?i?(s.isMilestone=!0,ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||(e[this.parent.taskFields.milestone]=!0),s.endDate=s.startDate):(this.parent.setRecordValue("isMilestone",!0,s,!0),ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,e,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0)):ne.isNullOrUndefined(s.startDate)||ne.isNullOrUndefined(s.duration)||(i?(s.isMilestone=!1,ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||(e[this.parent.taskFields.milestone]=!1)):(this.parent.setRecordValue("isMilestone",!1,s,!0),ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!1,e,!0)),this.calculateEndDate(e))}this.parent.dataOperation.updateMappingData(e,"work")}ne.isNullOrUndefined(d)||(i?s.segments=this.setSegmentsInfo(e,!0):this.parent.setRecordValue("segments",this.setSegmentsInfo(e,!0),s,!0)),0===s.duration&&(i?(s.isMilestone=!0,ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||(e[this.parent.taskFields.milestone]=!0),s.endDate=s.startDate):(this.parent.setRecordValue("isMilestone",!0,s,!0),ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,e,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0))),!ne.isNullOrUndefined(h)&&h&&(i?(s.duration=0,s.isMilestone=!0,ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||(e[this.parent.taskFields.milestone]=!0),ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.duration)||(e[this.parent.taskFields.duration]=s.duration),s.endDate=s.startDate):(this.parent.setRecordValue("duration",0,s,!0),this.parent.setRecordValue("isMilestone",!0,s,!0),ne.isNullOrUndefined(this.parent.taskFields)||ne.isNullOrUndefined(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,e,!0),this.parent.setRecordValue("endDate",s.startDate,s,!0)))},t.prototype.calculateScheduledValuesforBaseline=function(e,t,i){var a=this.parent.taskFields,n=e.ganttProperties,r=t[a.baselineDuration],r=ne.isNullOrUndefined(r)||""===r?null:r,s=this.getDateFromFormat(t[a.baselineStartDate],!0),t=this.getDateFromFormat(t[a.baselineEndDate],!0);s?this.calculateDateFromStartDateforBaseline(s,t,r,e,i):t?this.calculateDateFromEndDateforBaseline(t,r,e,!0):ne.isNullOrUndefined(r)||""===r||(this.updateDurationValue(r,n,!0),a=this.getProjectStartDate(n,i),this.parent.setRecordValue("baselineStartDate",a,n,!0),this.calculateEndDate(e,!0))},t.prototype.calculateDateFromStartDateforBaseline=function(e,t,i,a,n){var r=a.ganttProperties,s=!!(0===parseInt(i,10)||e&&t&&new Date(e.getTime())===new Date(t.getTime()))||null;this.parent.setRecordValue("baselineStartDate",this.checkStartDate(e,r,s,n,!0),r,!0),t||!ne.isNullOrUndefined(i)&&""!==i?ne.isNullOrUndefined(i)||t?ne.isNullOrUndefined(t)||!ne.isNullOrUndefined(i)&&""!==i?(this.updateDurationValue(i,r,!0),!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.setRecordValue("baselineEndDate",t,r,!0):this.calculateEndDate(a,!0)):(e=void 0,e=0<this.parent.weekWorkingTime.length&&t?this.parent.getEndTime(t):this.parent.defaultEndTime,t&&0===t.getHours()&&86400!==e&&this.setTime(e,t),(r.baselineStartDate&&t&&r.baselineStartDate.getTime()>t.getTime()||!ne.isNullOrUndefined(r.baselineStartDate)&&!ne.isNullOrUndefined(r.startDate)&&r.baselineStartDate.getTime()===r.startDate.getTime()&&!ne.isNullOrUndefined(t)&&!ne.isNullOrUndefined(r.endDate)&&t.toLocaleDateString()===r.endDate.toLocaleDateString()&&r.isMilestone)&&(t=r.baselineStartDate),this.parent.setRecordValue("baselineEndDate",this.checkBaselineEndDate(t,r),r,!0),1===this.compareDates(r.baselineStartDate,r.baselineEndDate)?(this.parent.setRecordValue("baselineEndDate",r.baselineStartDate,r,!0),this.parent.setRecordValue("baselineDuration",0,r,!0)):this.calculateDuration(a,!0)):(this.updateDurationValue(i,r,!0),this.calculateEndDate(a,!0)):(this.parent.setRecordValue("baselineDuration",1,r,!0),this.calculateEndDate(a,!0))},t.prototype.calculateDateFromEndDateforBaseline=function(e,t,i,a){var n=i.ganttProperties,r=0<this.parent.weekWorkingTime.length?this.parent.getEndTime(e):this.parent.defaultEndTime,r=(0===e.getHours()&&86400!==r&&this.setTime(r,e),0===parseInt(t,10)||null);this.parent.setRecordValue("baselineEndDate",this.checkEndDate(e,i.ganttProperties,r,!0),n,!0),ne.isNullOrUndefined(t)||""===t?(this.parent.setRecordValue("baselineDuration",1,n,!0),this.parent.setRecordValue("baselineStartDate",this.getStartDate(n.baselineEndDate,n.duration,n.durationUnit,n),n,!0)):ne.isNullOrUndefined(t)||""===t||(this.updateDurationValue(t,n,a),this.parent.setRecordValue("baselineStartDate",this.getStartDate(n.endDate,n.duration,n.durationUnit,n,!0),n,!0))},t.prototype.updateDurationWithWork=function(e){var t=e.ganttProperties,i=this.fetchResources(e);if(!ne.isNullOrUndefined(i)&&0<i.length){for(var a,n=ne.isNullOrUndefined(i)?0:i.length,r=0,s=(0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(e.ganttProperties.startDate||e.ganttProperties.endDate):this.parent.secondsPerDay)/3600,o=0,l=void 0,l=0;l<n;l++)r+=0<(a=i[l][this.parent.resourceFields.unit])?s*a/100:"FixedUnit"!==e.ganttProperties.taskType&&"FixedWork"!==t.taskType&&0!==t.duration?s:0;var d=this.getWorkInHour(t.work,t.workUnit);0<n&&0<r&&(o+=d/r),"FixedUnit"===t.taskType&&0===r&&(this.parent.setRecordValue("work",0,t,!0),this.parent.setRecordValue(this.parent.taskFields.work,0,e,!0)),"minute"===t.durationUnit&&(o=o*s*60),"hour"===t.durationUnit&&(o*=s),o%1!=0&&(o=parseFloat(o.toFixed(2))),ne.isNullOrUndefined(t.duration)||this.parent.setRecordValue("duration",o,t,!0),!this.parent.autoCalculateDateScheduling||!this.parent.isLoad||ne.isNullOrUndefined(e[this.parent.taskFields.duration])||o===e[this.parent.taskFields.duration]||"FixedWork"!==this.parent.taskType&&"FixedUnit"!==this.parent.taskType||this.validatedGanttData.set(e.ganttProperties.taskId,e),this.parent.dataOperation.updateMappingData(e,"duration")}},t.prototype.updateUnitWithWork=function(e){var t=e.ganttProperties,i=this.fetchResources(e),a=ne.isNullOrUndefined(i)?0:i.length,n=0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(e.ganttProperties.startDate||e.ganttProperties.endDate):this.parent.secondsPerDay,n=n/3600;if(0!==a){var r=this.getDurationInDay(e.ganttProperties.duration,e.ganttProperties.durationUnit),s=this.getWorkInHour(t.work,t.workUnit),s=0<r?s/(r*n)*100:0,o=0==s?0:0<s?s/a:100;o%1!=0&&(o=parseFloat(o.toFixed(2)));for(var l=0;l<a;l++)i[l][this.parent.resourceFields.unit]=o,this.parent.isLoad||ne.isNullOrUndefined(this.parent.editModule)||ne.isNullOrUndefined(this.parent.editModule.dialogModule)||this.parent.editModule.dialogModule.isEdit||ne.isNullOrUndefined(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isCellEdit||t.resourceInfo&&(t.resourceInfo[l][this.parent.resourceFields.unit]=o),this.parent.editModule&&this.parent.editModule.dialogModule&&!ne.isNullOrUndefined(this.parent.editModule.dialogModule.ganttResources[l])&&(this.parent.editModule.dialogModule.ganttResources[l][this.parent.resourceFields.unit]=o);this.updateResourceName(e)}},t.prototype.resolveAndApplyWorkingTimes=function(e,t){var i,a={},n=0<this.parent.weekWorkingTime.length;return e&&(i=n?this.parent.getStartTime(e):this.parent.defaultStartTime,a.startTime=i,0===e.getHours())&&this.setTime(i,e),t&&(i=n?this.parent.getEndTime(t):this.parent.defaultEndTime,a.endTime=i,0===t.getHours())&&86400!==i&&this.setTime(i,t),a},t.prototype.calculateDateFromEndDate=function(e,t,i){var a=i.ganttProperties,n=(this.resolveAndApplyWorkingTimes(null,e),0===parseInt(t,10)||null),r=(this.resolveAndApplyWorkingTimes(null,this.originalEndDate),new Date(this.originalEndDate.getTime())),e=this.checkEndDate(e,i.ganttProperties,n);this.parent.autoCalculateDateScheduling&&this.parent.isLoad&&r.getTime()!==e.getTime()&&ne.isNullOrUndefined(t)&&!i.hasChildRecords&&this.validatedGanttData.set(i.ganttProperties.taskId,i),this.parent.setRecordValue("endDate",e,a,!0),ne.isNullOrUndefined(t)||""===t?this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("startDate",null,a,!0),this.parent.setRecordValue("duration",null,a,!0)):(this.parent.setRecordValue("duration",1,a,!0),this.parent.setRecordValue("startDate",this.getStartDate(a.endDate,a.duration,a.durationUnit,a),a,!0)):ne.isNullOrUndefined(t)||""===t||(this.updateDurationValue(t,a),this.parent.setRecordValue("startDate",this.getStartDate(a.endDate,a.duration,a.durationUnit,a),a,!0))},t.prototype.calculateDateFromStartDate=function(e,t,i,a,n){var r,s=a.ganttProperties,o=!!(0===parseInt(i,10)||e&&t&&new Date(e.getTime())===new Date(t.getTime()))||null,l=this.checkStartDate(e,s,o,n),d=new Date(this.originalStartDate.getTime());0===d.getHours()&&this.resolveAndApplyWorkingTimes(d),this.parent.setRecordValue("startDate",this.checkStartDate(e,s,o,n),s,!0),t||!ne.isNullOrUndefined(i)&&""!==i?ne.isNullOrUndefined(i)||t?t&&(ne.isNullOrUndefined(i)||""===i)?(this.resolveAndApplyWorkingTimes(null,t),r=this.originalEndDate,this.resolveAndApplyWorkingTimes(null,r),n=this.checkEndDate(t,a.ganttProperties),!this.parent.autoCalculateDateScheduling||!this.parent.isLoad||ne.isNullOrUndefined(e&&t)||!ne.isNullOrUndefined(i)||a.hasChildRecords||new Date(r.getTime()).getTime()===n.getTime()&&d.getTime()===l.getTime()||this.validatedGanttData.set(a.ganttProperties.taskId,a),this.parent.setRecordValue("endDate",n,s,!0),1===this.compareDates(s.startDate,s.endDate)?(this.parent.setRecordValue("endDate",s.startDate,s,!0),this.parent.setRecordValue("isMilestone",!0,s,!0),this.parent.setRecordValue("duration",0,s,!0)):this.calculateDuration(a)):(this.updateDurationValue(i,s),this.parent.autoCalculateDateScheduling&&this.parent.isLoad&&!ne.isNullOrUndefined(e&&t&&i)&&!a.hasChildRecords&&(n=new Date(this.originalStartDate.getTime()),r=new Date(this.originalEndDate.getTime()),e=this.parent.dataOperation.getDurationAsSeconds(s.duration,s.durationUnit,n),this.parent.dataOperation.calculateEndDateFromDuration(n,e,s,o,s.calendarContext,!1,s.isAutoSchedule),this.resolveAndApplyWorkingTimes(n,r),e=this.parent.dataOperation.getEndDate(n,s.duration,s.durationUnit,s,!1),o=l.getTime()!==n.getTime(),n=e.getTime()!==r.getTime(),o||n)&&this.validatedGanttData.set(a.ganttProperties.taskId,a),!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(this.setTime(this.parent.getCurrentDayEndTime(t),t),this.parent.setRecordValue("endDate",t,s,!0)):this.calculateEndDate(a)):(this.updateDurationValue(i,s),this.calculateEndDate(a)):(this.parent.allowUnscheduledTasks?(this.parent.setRecordValue("endDate",null,s,!0),this.parent.setRecordValue("duration",null,s,!0)):(this.parent.setRecordValue("duration",1,s,!0),this.calculateEndDate(a)),this.parent.autoCalculateDateScheduling&&this.parent.isLoad&&ne.isNullOrUndefined(t)&&ne.isNullOrUndefined(i)&&!a.hasChildRecords&&d.getTime()!==l.getTime()&&this.validatedGanttData.set(a.ganttProperties.taskId,a)),this.parent.isTreeGridRendered&&a&&this.updateTaskData(a)},t.prototype.getProgressWidth=function(e,t){return e*t/100},t.prototype.calculateWidth=function(e,t){var i=e.ganttProperties,a=t?i.autoStartDate:i.startDate,n=t?i.autoEndDate:i.endDate;return ne.isNullOrUndefined(a)&&ne.isNullOrUndefined(n)&&(a=this.getValidStartDate(i,t),n=this.getValidEndDate(i,t),t=this.getDuration(a,n,i.durationUnit,!1,i.isMilestone,!0,void 0),this.parent.autoCalculateDateScheduling)&&this.parent.isLoad&&!ne.isNullOrUndefined(i.duration)&&i.duration!==t&&this.validatedGanttData.set(e.ganttProperties.taskId,e),ne.isNullOrUndefined(a)||ne.isNullOrUndefined(n)?3:!i.isMilestone||e.hasChildRecords&&!i.isAutoSchedule?this.getTaskWidth(a,n,i):0},t.prototype.getTaskbarHeight=function(){var e=this.parent.rowHeight,t=this.parent.taskbarHeight;return t<e?t:e},t.prototype.calculateLeft=function(e,t,i){var a=null,n=-300,r=i?e.autoStartDate:e.startDate,s=i?e.autoEndDate:e.endDate,i=i?e.autoDuration:e.duration,o=e.isMilestone;return(r=t&&this.parent.allowUnscheduledTasks&&ne.isNullOrUndefined(r)&&ne.isNullOrUndefined(s)&&!ne.isNullOrUndefined(i)&&!t.hasChildRecords&&t.parentItem&&("Manual"===this.parent.taskMode||"Custom"===this.parent.taskMode&&t[this.parent.taskFields.manual])&&(i=this.parent.getParentTask(t.parentItem)).ganttProperties.startDate?i.ganttProperties.startDate:r)?a=new Date(r.getTime()):s?(a=new Date(s.getTime()),o=!ne.isNullOrUndefined(r)||!this.parent.allowUnscheduledTasks):a=this.getValidStartDate(e),n=ne.isNullOrUndefined(a)?n:this.getTaskLeft(a,o,e.calendarContext)},t.prototype.calculateAutoLeft=function(e){return this.getTaskLeft(e.autoStartDate,e.isMilestone,e.calendarContext)},t.prototype.calculateAutoDuration=function(e){return this.getDuration(e.autoStartDate,e.autoEndDate,e.durationUnit,!1,e.isMilestone,void 0,e.calendarContext)},t.prototype.calculateAutoWidth=function(e){return this.getTaskWidth(e.autoStartDate,e.autoEndDate)},t.prototype.calculateBaselineLeft=function(e){var t=this.getDateFromFormat(e.baselineStartDate),i=this.getDateFromFormat(e.baselineEndDate);return t&&i?(t.getTime()>i.getTime()&&(i=t),this.getTaskLeft(t,e.isMilestone,e.calendarContext)):0},t.prototype.calculateBaselineWidth=function(e){var t=this.getDateFromFormat(e.baselineStartDate),i=this.getDateFromFormat(e.baselineEndDate);return t&&i&&t.getTime()!==i.getTime()?(this.isBaseline=!0,t.getTime()>i.getTime()&&(i=e.baselineEndDate=t),this.getTaskWidth(t,i)):0},t.prototype.getTaskWidth=function(e,t,i){var a=new Date(e.getTime()),n=new Date(t.getTime()),r=("None"!==this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.bottomTier:this.parent.timelineModule.customTimelineSettings.topTier).unit,s=(this.parent.timelineModule.customTimelineSettings,!1),o=new Date(e.getTime()),l=0,d=i?i.calendarContext:this.parent.defaultCalendarContext;if(ne.isNullOrUndefined(i)||"hour"!==i.durationUnit||(o=new Date(o.getTime()+60*i.duration*60*1e3)),(!ne.isNullOrUndefined(i)&&"minute"===i.durationUnit||!ne.isNullOrUndefined(i)&&"day"===i.durationUnit&&i.duration<1)&&(o=new Date(o.getTime()+60*i.duration*1e3)),this.isBaseline&&"Day"===r){var h=this.getDuration(a,n,"day",!0,!1,void 0,d);if(this.isBaseline=!1,0<h&&h<1)return h*this.parent.perDayWidth}var p=this.parent.calendarModule.workingTime;if(0<this.parent.weekWorkingTime.length)for(var u=new Date(e.getTime()),c=e.getDate();c<=t.getDate();c++){var g=u.getDay(),f=void 0,m=this.parent.weekWorkingTime;switch(g){case 0:f="Sunday";break;case 1:f="Monday";break;case 2:f="Tuesday";break;case 3:f="Wednesday";break;case 4:f="Thursday";break;case 5:f="Friday";break;case 6:f="Saturday";break;default:f=""}for(var y=!0,D=0;D<m.length;D++)if(m[D][f]&&0<m[D][f].length)for(var y=!1,k=0;k<m[D][f].length;k++)l=l+m[D][f][k].to-m[D][f][k].from;if(y)for(var T=0;T<p.length;T++)l=l+p[T].to-p[T].from;u=new Date(u.setDate(u.getDate()+1)),this.parent.includeWeekend||(u=this.parent.dataOperation.getNextWorkingDay(u,d))}else for(D=0;D<p.length;D++)l=l+p[D].to-p[D].from;var b,w,v,S,h=o.getTime()-a.getTime();return!ne.isNullOrUndefined(i)&&"minute"===i.durationUnit&&i.duration<60*l||!ne.isNullOrUndefined(i)&&"day"===i.durationUnit&&!ne.isNullOrUndefined(i.duration)&&/^\d+\.\d+$/.test(i.duration.toString())?("Day"===r?(w=0<this.parent.weekWorkingTime.length?(b=this.parent.getStartTime(a),this.parent.getEndTime(n)):(b=this.parent.defaultStartTime,this.parent.defaultEndTime),(Math.floor(h/36e5%24)>=l||0==h)&&(s=!0),this.getSecondsInDecimal(a)===b&&s&&a.setHours(0,0,0,0),this.getSecondsInDecimal(n)===w&&s&&n.setHours(24),this.getSecondsInDecimal(n)===b&&n.setHours(0,0,0,0)):s=!0,a.getTime()===n.getTime()?this.parent.perDayWidth:s?!(this.parent.taskFields.duration&&"day"===i.durationUnit&&/^\d+\.\d+$/.test(i.duration.toString())&&"Day"===this.parent.timelineModule.bottomTier&&ne.isNullOrUndefined(i.segments))||(e=d.defaultHolidays&&0<d.defaultHolidays.length?this.getHolidaysCount(a,n,d):0,o=this.parent.includeWeekend&&0!==d.exceptionsRanges.length?0:this.getWeekendCount(a,n,d),this.hasDSTTransition(a.getFullYear()))?this.getTimeDifference(a,n,!0)/864e5*this.parent.perDayWidth:this.parent.timelineSettings.showWeekend?(e+o+i.duration)*this.parent.perDayWidth:(e+i.duration)*this.parent.perDayWidth:(h=!1,s=a,o=n,e=i.duration,v=l,s=new Date(s),o=new Date(o),h=!(isNaN(s.getTime())||isNaN(o.getTime())||e<=0||v<=0)&&(s=new Date(s),e=e*v,S=Math.floor(e/v),e=e%v,s.setDate(s.getDate()+S),s.setHours(s.getHours()+e),s.getTime()!==o.getTime())&&1<Math.abs((s.getTime()-o.getTime())/864e5),"day"===i.durationUnit&&i.duration<1&&!h?i.duration*this.parent.perDayWidth:this.hasDSTTransition(a.getFullYear())||-180===a.getTimezoneOffset()?this.getTimeDifference(a,n,!0)/864e5*this.parent.perDayWidth:this.getTimeDifference(a,n)/(36e5*l)*this.parent.perDayWidth)):("Day"===r&&(w=0<this.parent.weekWorkingTime.length?(b=this.parent.getStartTime(a),this.parent.getEndTime(n)):(b=this.parent.defaultStartTime,this.parent.defaultEndTime),this.getSecondsInDecimal(a)===b&&a.setHours(0,0,0,0),this.getSecondsInDecimal(n)===w&&(n.setHours(24),n.setHours(0,0,0,0)),this.getSecondsInDecimal(n)===b)&&n.setHours(0,0,0,0),a.getTime()===n.getTime()?this.parent.perDayWidth:this.hasDSTTransition(a.getFullYear())?(S=v=0,this.parent.timelineSettings.showWeekend||0<(v=this.parent.timelineModule.calculateNonWorkingDaysBetweenDates(a,n))&&(S=864e5*v),(q(n)-q(a)-S)/6e4*(this.parent.perDayWidth/24)/60):(e=this.getTimeDifference(a,n)/864e5,this.parent.timelineSettings.showWeekend?e*this.parent.perDayWidth:(s=new Date(a.getTime()),(e-this.parent.timelineModule.calculateNonWorkingDaysBetweenDates(s,n))*this.parent.perDayWidth)))},t.prototype.getDSTTransitions=function(e,t){function i(e,t){var i=new Date(Date.UTC(e,t+1,0));return new Date(Date.UTC(e,t,i.getUTCDate()-i.getUTCDay()))}function a(e,t){var t=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(e).match(/\d+/g).map(Number),e=t[0],i=t[1],a=t[2],n=t[3],r=t[4],t=t[5];return new Date(a,e-1,i,n,r,t)}var n=i(e,2),e=i(e,9);return{dstStart:a(n,t),dstEnd:a(e,t)}},t.prototype.hasDSTTransition=function(e){if(e in this.cache)return this.cache[e];for(var t=0,i=11,a=new Date(e,t,1).getTimezoneOffset();t<=i;){var n=Math.floor((t+i)/2),r=new Date(e,n,1).getTimezoneOffset();if(r!==a)return this.cache[e]=!0;a<r?i=n-1:t=n+1}return this.cache[e]=!1},t.prototype.getTaskLeft=function(e,t,i,a){var n,r,s=!1,o=new Date(e.getTime()),l=("Day"===("None"!==this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.bottomTier:this.parent.timelineModule.customTimelineSettings.topTier).unit&&(r=l=void 0,r=0<this.parent.weekWorkingTime.length?(l=this.parent.getStartTime(o),this.parent.getEndTime(o)):(l=this.parent.defaultStartTime,this.parent.defaultEndTime),this.getSecondsInDecimal(o)===l?o.setHours(0,0,0,0):t&&this.getSecondsInDecimal(o)===r?(o.setHours(24),s=!0):this.getSecondsInDecimal(o)===r&&this.parent.allowUnscheduledTasks&&(o.setHours(22),s=!0)),this.parent.enableTimelineVirtualization&&(this.parent.isLoad||a)&&!this.parent.timelineModule.performedTimeSpanAction&&(n=this.parent.enableTimelineVirtualization&&0!==this.parent.ganttChartModule.scrollObject.element.scrollLeft?this.parent.ganttChartModule.scrollObject.getTimelineLeft():null),ne.isNullOrUndefined(n)?this.parent.timelineModule.timelineStartDate?new Date(this.parent.timelineModule.timelineStartDate):null:new Date(this.parent.timelineModule.dateByLeftValue(n).toString()));return l?(t=void 0,this.hasDSTTransition(e.getFullYear()),this.hasDSTTransition(o.getFullYear())?this.parent.timelineSettings.showWeekend?(q(o)-q(l))/6e4*(this.parent.perDayWidth/24)/60:this.calculateLeftValue(l,o):(r=void 0,"Day"!==this.parent.timelineModule.bottomTier||this.getSecondsInDecimal(o)===this.parent.defaultStartTime||0===this.getSecondsInDecimal(o)||s||this.parent.isFromEventMarker?t=this.parent.timelineSettings.showWeekend?(o.getTime()-l.getTime())/864e5*this.parent.perDayWidth:this.calculateLeftValue(l,o):(a=new Date(e.getTime()),n=new Date(a.setHours(0,0,0,0)),r=this.getDuration(n,e,"day",!0,!1,void 0,i)*this.parent.perDayWidth,o.setHours(0,0,0,0),t=this.parent.timelineSettings.showWeekend?(o.getTime()-l.getTime())/864e5*this.parent.perDayWidth:this.calculateLeftValue(l,o),this.getSecondsInDecimal(e)!==this.parent.defaultStartTime&&"Day"===this.parent.timelineModule.bottomTier&&(t+=r)),t)):0},t.prototype.calculateLeftValue=function(e,t){var i=new Date(this.parent.timelineModule.timelineStartDate.getTime()),i=(t.setHours(0,0,0,0),this.parent.timelineModule.calculateNonWorkingDaysBetweenDates(i,t)),t=this.hasDSTTransition(t.getFullYear())?q(t)-q(e):t.getTime()-e.getTime();return(t-24*i*60*60*1e3)/864e5*this.parent.perDayWidth},t.prototype.getSplitTaskWidth=function(e,t,i){var a,e=new Date(e.getTime()),t=new Date(this.getEndDate(e,t,i.ganttProperties.durationUnit,i.ganttProperties,!1).getTime());return"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(a=i=void 0,a=0<this.parent.weekWorkingTime.length?(i=this.parent.getStartTime(e),this.parent.getEndTime(t)):(i=this.parent.defaultStartTime,this.parent.defaultEndTime),this.getSecondsInDecimal(e)===i&&e.setHours(0,0,0,0),this.getSecondsInDecimal(t)===a&&t.setHours(24),this.getSecondsInDecimal(t)===i)&&t.setHours(0,0,0,0),this.parent.timelineSettings.showWeekend?this.getTimeDifference(e,t)/864e5*this.parent.perDayWidth:(a=new Date(e.getTime()),i=this.parent.timelineModule.calculateNonWorkingDaysBetweenDates(a,t),(t.getTime()-e.getTime()-24*i*60*60*1e3)/864e5*this.parent.perDayWidth)},t.prototype.getSplitTaskLeft=function(e,t){var i,a,n,r,e=new Date(e.getTime());return"Day"===("None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier)&&(i=r=void 0,i=0<this.parent.weekWorkingTime.length?(r=this.parent.getStartTime(e),this.parent.getStartTime(t)):r=this.parent.defaultStartTime,this.getSecondsInDecimal(e)===r&&e.setHours(0,0,0,0),this.getSecondsInDecimal(t)===i)&&t.setHours(0,0,0,0),t?(i=r=0,this.parent.timelineSettings.showWeekend||(a=new Date(t.getTime()),n=new Date(e.getTime()),0<(r=this.parent.timelineModule.calculateNonWorkingDaysBetweenDates(a,n))&&(i=864e5*r)),(e.getTime()-t.getTime()-i)/864e5*this.parent.perDayWidth):0},t.prototype.updateMappingData=function(e,t){var i=this.parent.columnMapping,a=e.ganttProperties;if((!ne.isNullOrUndefined(i[t])||"taskType"===t||"segments"===t)&&"predecessorName"!==t)if("resourceInfo"===t){var n=a.resourceInfo,r=this.parent.resourceFields,s=[],o=[];if(!ne.isNullOrUndefined(n))for(var l=0;l<n.length;l++){s.push(n[l][r.id]);var d=n[l][r.name],h=n[l][r.unit];100!==h&&(d+="["+h+"%]"),d&&o.push(d)}this.parent.setRecordValue("resourceNames",o.join(","),a,!0),this.isResourceString&&e.taskData[this.parent.taskFields.resourceInfo]&&e.taskData[this.parent.taskFields.resourceInfo][0]&&(e.taskData[this.parent.taskFields.resourceInfo]=e.taskData[this.parent.taskFields.resourceInfo][0][r.name]),this.updateTaskDataResource(e),this.parent.setRecordValue(i[t],o.join(","),e)}else"startDate"===t||"endDate"===t?this.setRecordDate(e,a[t],i[t]):"duration"===t?this.setRecordDuration(e,i[t]):"baselineStartDate"===t||"baselineEndDate"===t?this.setRecordDate(e,a[t],i[t]):"baselineDuration"===t?this.setRecordDuration(e,i[t],!0):"work"===t?(this.parent.setRecordValue("taskData."+i[t],a.work,e),this.parent.setRecordValue(i[t],a[t],e)):"type"===t?(this.parent.setRecordValue("taskData."+i[t],a.taskType,e),this.parent.setRecordValue(i[t],a.taskType,e)):"manual"===t?(this.parent.setRecordValue("taskData."+i[t],!a.isAutoSchedule,e),this.parent.setRecordValue(i[t],!a.isAutoSchedule,e)):"segments"===t?this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,this.segmentTaskData(e),e):(this.parent.setRecordValue("taskData."+i[t],a[t],e),this.parent.setRecordValue(i[t],a[t],e))},t.prototype.segmentTaskData=function(e){var i=this,t=e.ganttProperties.segments,a=this.parent.taskFields;if(ne.isNullOrUndefined(t))return _(this.parent.dataSource)?[]:null;for(var n=ne.extend([],[],e.taskData[a.segments],!0),r=0;r<t.length;r++)(this.parent.isEdit||this.parent.editModule&&this.parent.editModule.dialogModule&&ne.getValue("isEdit",this.parent.editModule.dialogModule)||this.parent.contextMenuModule&&ne.getValue("isEdit",this.parent.contextMenuModule))&&(n[r]={}),ne.isNullOrUndefined(a.startDate)||(n[r][this.parent.taskFields.startDate]=t[r].startDate),ne.isNullOrUndefined(a.endDate)||(n[r][this.parent.taskFields.endDate]=t[r].endDate),ne.isNullOrUndefined(a.duration)||(n[r][this.parent.taskFields.duration]=Number(t[r].duration));return 0<this.customSegmentProperties.length&&n&&0<n.length&&n.forEach(function(e,t){e=Object.assign({},e,i.customSegmentProperties[t]);n[t]=e}),n},t.prototype.updateTaskDataResource=function(e){var i=e.ganttProperties.resourceInfo,a=e.taskData[this.parent.taskFields.resourceInfo],n=("string"==typeof a&&(a=[parseInt(e.taskData[this.parent.taskFields.resourceInfo],10)]),this.parent.resourceFields);if(ne.isNullOrUndefined(a))e.taskData[this.parent.taskFields.resourceInfo]=i;else if(i&&i.length){for(var t=0;t<i.length;t++){var r=!1;if("string"==typeof a){if(a===i[t][n.name]){a=i[t][n.name],r=!0;break}}else for(var s=0;s<a.length;s++)if("number"==typeof a[s]||"string"==typeof a[s]){if(parseInt(a[s],10)===parseInt(i[t][n.id],10)){a[s]=i[t],r=!0;break}}else if(a[s][n.id]===i[t][n.id]&&"number"!=typeof a[s]){a[s]=ne.extend({},a[s],i[t],!0),r=!0;break}r||("string"==typeof a?a=i[t][n.name]:a.push(i[t]))}var o=[];if(!ne.isNullOrUndefined(a))if("string"!=typeof a){for(var l=0;l<a.length;l++)!function(t){i.filter(function(e){e[n.id]===a[t][n.id]&&-1===o.indexOf(a[t])&&o.push(a[t])})}(l);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,o,e)}else this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,a,e)}else this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e)},t.prototype.setRecordDate=function(e,t,i){var a="string"==typeof t?new Date(t):t;ne.isNullOrUndefined(t)||(t=new Date(a.getTime())),this.parent.setRecordValue(i,t,e),ne.isNullOrUndefined(t)||(t=new Date(a.getTime())),this.parent.isLoad||this.parent.isDynamicData||this.parent.setRecordValue("taskData."+i,t,e),this.parent.isDynamicData=!1},t.prototype.getDurationInDay=function(e,t){return"day"===t?e:"hour"===t?e/(this.parent.secondsPerDay/3600):e/(this.parent.secondsPerDay/60)},t.prototype.setRecordDuration=function(e,t,i){var a,i=i?e.ganttProperties.baselineDuration:e.ganttProperties.duration,n=e.ganttProperties.durationUnit;ne.isNullOrUndefined(i)?(this.parent.setRecordValue(t,i,e),this.parent.setRecordValue("taskData."+t,i,e)):(this.parent.setRecordValue(t,i,e),a=ne.getValue(t,e.taskData),isNaN(a)&&ne.isNullOrUndefined(this.parent.taskFields.durationUnit)&&!ne.isNullOrUndefined(a)?this.parent.setRecordValue("taskData."+t,this.getDurationString(i,n),e):ne.isNullOrUndefined(a)&&this.parent.isLoad||("string"==typeof a?this.parent.setRecordValue("taskData."+t,i.toString(),e):this.parent.setRecordValue("taskData."+t,i,e))),this.parent.taskFields.durationUnit&&(e.taskData[this.parent.taskFields.durationUnit]=e.ganttProperties.durationUnit)},t.prototype.setDataSource=function(e){for(var t,i=[],a=(t=Array.isArray(e)?e:t).length,n=0;n<a;n++){var r=e[n];i.push(r),ne.isNullOrUndefined(e[n][this.parent.taskFields.child])||this.setDataSource(e[n][this.parent.taskFields.child])}return i},t.prototype.setStartDate=function(t){var i=this;(ne.isNullOrUndefined(this.parent.taskFields.parentID)||ne.isNullOrUndefined(this.parent.taskFields.id)?this.parent.dataSource:this.setDataSource(this.parent.dataSource)).map(function(e){t.ganttProperties.taskId===e[i.parent.taskFields.id]&&(ne.isNullOrUndefined(i.parent.taskFields.startDate)||(t[i.parent.taskFields.startDate]=e[i.parent.taskFields.startDate]),ne.isNullOrUndefined(i.parent.taskFields.endDate)||(t[i.parent.taskFields.endDate]=e[i.parent.taskFields.endDate]))})},t.prototype.getWorkInHour=function(e,t){return"day"===t?e*(this.parent.secondsPerDay/3600):"minute"===t?e/60:e},t.prototype.updateTaskData=function(e){var t,i=this.parent.taskFields,a=e.ganttProperties;ne.isNullOrUndefined(e.taskData)||(t=e.taskData,i.id&&(this.parent.setRecordValue("taskData."+i.id,a.taskId,e),this.parent.setRecordValue(i.id,a.taskId,e)),i.name&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.name,a.taskName,e),this.parent.setRecordValue(i.name,a.taskName,e)),i.startDate?this.setRecordDate(e,a.startDate,i.startDate):this.setRecordDate(e,a.startDate,"StartDate"),i.endDate?this.setRecordDate(e,a.endDate,i.endDate):this.setRecordDate(e,a.endDate,"EndDate"),i.duration&&(ne.isNullOrUndefined(i.milestone)||!ne.isNullOrUndefined(i.milestone)&&!e.taskData[i.milestone])&&this.setRecordDuration(e,i.duration),i.durationUnit&&(t[i.durationUnit]=a.durationUnit),i.progress&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.progress,a.progress,e),this.parent.setRecordValue(i.progress,a.progress,e)),i.baselineStartDate&&this.setRecordDate(e,a.baselineStartDate,i.baselineStartDate),i.baselineEndDate&&this.setRecordDate(e,a.baselineEndDate,i.baselineEndDate),i.baselineDuration&&this.setRecordDuration(e,i.baselineDuration,!0),i.notes&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.notes,a.notes,e),this.parent.setRecordValue(i.notes,a.notes,e)),i.cssClass&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.cssClass,a.cssClass,e),this.parent.setRecordValue(i.cssClass,a.cssClass,e)),i.indicators&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.indicators,a.indicators,e),this.parent.setRecordValue(i.indicators,a.indicators,e)),i.parentID&&(t="ProjectView"===this.parent.viewType?a.parentId:t[i.parentID],this.parent.setRecordValue("taskData."+i.parentID,t,e),this.parent.setRecordValue(i.parentID,a.parentId,e)),i.work&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.work,a.work,e),this.parent.setRecordValue(i.work,a.work,e)),i.type&&(this.parent.setRecordValue("taskData."+i.type,a.taskType,e),this.parent.setRecordValue(i.type,a.taskType,e)),i.constraintDate&&this.setRecordDate(e,a.constraintDate,i.constraintDate),i.constraintType&&(this.parent.isLoad||this.parent.setRecordValue("taskData."+i.constraintType,a.constraintType,e),this.parent.setRecordValue(i.constraintType,a.constraintType,e)))},t.prototype.setResourceInfo=function(e){var a=null;if(ne.isNullOrUndefined(e[this.parent.taskFields.resourceInfo]))return a;var a=(!this.parent.isLoad&&e.taskData&&this.parent.taskFields.resourceInfo in e.taskData?e.taskData:e)[this.parent.taskFields.resourceInfo],n=ne.isNullOrUndefined(this.parent.editModule)||ne.isNullOrUndefined(this.parent.editModule.dialogModule)||!this.parent.editModule.dialogModule.isAddNewResource?this.parent.resources:this.parent.editModule.dialogModule.ganttResources,r=this.parent.resourceFields.id,s=this.parent.resourceFields.unit,o=this.parent.resourceFields.group,l=[];if("string"==typeof a&&""!==a){var t=[],i=e[this.parent.taskFields.resourceInfo].split(",");i&&(n.forEach(function(e){i.includes(e[r].toString())&&t.push(e)}),e=ne.extend({},t[0]),l.push(e),ne.isNullOrUndefined(s)||ne.isNullOrUndefined(a[s])||(e[s]=a[s]),ne.isNullOrUndefined(o)||ne.isNullOrUndefined(a[o])||(e[o]=a[o]))}else if(!ne.isNullOrUndefined(a))for(var d=0;d<a.length;d++)!function(t){var e=a[t],i=n.filter(function(e){return"object"==typeof a[t]&&a[t][r]===e[r]||a[t]===e[r]}),i=ne.extend({},i[0]);l.push(i),ne.isNullOrUndefined(s)||ne.isNullOrUndefined(a[t][s])||(i[s]=e[s]),ne.isNullOrUndefined(o)||ne.isNullOrUndefined(a[t][o])||(i[o]=e[o])}(d);return this.updateResourceUnit(l),l},t.prototype.updateResourceUnit=function(e){var t=this.parent.resourceFields.unit;if(!ne.isNullOrUndefined(t))for(var i=e.length,a=void 0,a=0;a<i;a++)ne.isNullOrUndefined(e[a][t])&&(e[a][t]=100)},t.prototype.updateResourceName=function(e){var t=e.ganttProperties.resourceInfo,i=[],a=this.parent.taskFields;if(t&&0<t.length){var n=t.length;if("string"==typeof e.taskData[this.parent.taskFields.resourceInfo]){var r=s=t[0][this.parent.resourceFields.name];this.parent.setRecordValue("resourceNames",r,e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.resourceInfo,r,e,!0)}else{var s=ne.extend([],[],e.taskData[this.parent.taskFields.resourceInfo],!0);this.parent.setRecordValue("taskData."+this.parent.taskFields.resourceInfo,[],e);for(var o=0;o<n;o++){var l=t[o],d=l[this.parent.resourceFields.name],h=l[this.parent.resourceFields.unit];100!==h&&(d+="["+h+"%]"),ne.isNullOrUndefined(d)||i.push(d),e.taskData&&(h=a.resourceInfo,s[o]&&(s[parseInt(o.toString(),10)],1)?e.taskData[h].push(s[o]):e.taskData[h].push(l[this.parent.resourceFields.id]))}this.parent.setRecordValue("resourceNames",i.join(","),e.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.resourceInfo,i.join(","),e,!0)}this.updateTaskDataResource(e)}},t.prototype.dataReorder=function(e,t){if(0===e.length||0===t.length)return[];for(var i=[],a=new Set(t),n=0;n<e.length&&0<a.size;){var r=e[n];a.has(r)?(i.push(r),a.delete(r),e.splice(n,1)):n++}return i},t.prototype.validateDurationUnitMapping=function(e){return"minute"===e||"minutes"===e||"m"===e||"min"===e?e="minute":"hour"===e||"hours"===e||"h"===e||"hr"===e?e="hour":"day"===e||"days"===e||"d"===e?e="day":ne.isNullOrUndefined(this.parent.durationUnit)||(e=this.parent.durationUnit.toLocaleLowerCase()),e},t.prototype.validateTaskTypeMapping=function(e){return e="FixedDuration"===e?"FixedDuration":"FixedUnit"===e?"FixedUnit":"FixedWork"===e?"FixedWork":this.parent.taskType},t.prototype.validateWorkUnitMapping=function(e){return e="minute"===e?"minute":"hour"===e?"hour":"day"===e?"day":this.parent.workUnit.toLocaleLowerCase()},t.prototype.updateDurationValue=function(e,t,i){e=this.getDurationValue(e);i&&!isNaN(ne.getValue("duration",e))?this.parent.setRecordValue("baselineDuration",ne.getValue("duration",e),t,!0):isNaN(ne.getValue("duration",e))||this.parent.setRecordValue("duration",ne.getValue("duration",e),t,!0),ne.isNullOrUndefined(ne.getValue("durationUnit",e))||this.parent.setRecordValue("durationUnit",ne.getValue("durationUnit",e),t,!0)},t.prototype.reUpdateGanttData=function(){if(0<this.parent.flatData.length){var e,t;this.parent.secondsPerDay=this.getSecondsPerDay();for(var i=0;i<this.parent.flatData.length;i++){e=this.parent.flatData[i].taskData,t=this.parent.flatData[i],ne.isNullOrUndefined(this.parent.taskFields.duration)||this.setRecordDuration(t,this.parent.taskFields.duration);var a=this.parent.calendarModule.getCalendarById(t.ganttProperties.calendarId),a=new ee(this.parent,a);this.parent.setRecordValue("calendarContext",a,t.ganttProperties,!0),this.parent.isLoad&&this.setStartDate(t),this.calculateScheduledValues(t,e,!1)}this.updateGanttData()}},t.prototype._isInStartDateRange=function(e,t,i){var a=!1;return a=e.getTime()>=t.getTime()&&e.getTime()<i.getTime()?!0:a},t.prototype._isInEndDateRange=function(e,t,i){var a=!1;return a=e.getTime()>t.getTime()&&e.getTime()<=i.getTime()?!0:a},t.prototype.updateOverlappingValues=function(e){var t,o=this,l=e.childRecords,i=[];if(l.length<=1)e.ganttProperties.workTimelineRanges=[];else{l=this.setSortedChildTasks(e),this.updateOverlappingIndex(l);for(var a=this,n=1;n<l.length;n++)!function(r){var e=((t=l[r]).ganttProperties.segments||[{startDate:t.ganttProperties.startDate,endDate:t.ganttProperties.endDate}]).map(function(e){var t=e.startDate,e=e.endDate;return{startDate:new Date(t),endDate:new Date(e)}}),s=[];e.forEach(function(e){for(var a=new Date(e.startDate.getTime()),n=new Date(e.endDate.getTime()),t=0;t<r;t++){var i=l[t];(i.ganttProperties.segments||[{startDate:i.ganttProperties.startDate,endDate:i.ganttProperties.endDate}]).map(function(e){var t=e.startDate,e=e.endDate;return{startDate:new Date(t),endDate:new Date(e)}}).forEach(function(e){var t=e.startDate,e=e.endDate,i={};a&&n&&e&&(o._isInStartDateRange(a,t,e)||o._isInEndDateRange(n,t,e)||t.getTime()>=a.getTime()&&e.getTime()<=n.getTime())&&(t.getTime()>a.getTime()&&t.getTime()<n.getTime()&&e.getTime()>a.getTime()&&e.getTime()>=n.getTime()||a.getTime()===t.getTime()&&n.getTime()<=e.getTime()?(i.from=t,i.to=n):a.getTime()===t.getTime()&&n.getTime()>e.getTime()?(i.from=t,i.to=e):a.getTime()>t.getTime()&&n.getTime()>=e.getTime()?(i.from=a,i.to=e):a.getTime()>t.getTime()&&n.getTime()<e.getTime()?(i.from=a,i.to=n):t.getTime()>=a.getTime()&&e.getTime()<=n.getTime()&&(i.from=t,i.to=e),i.from)&&i.to&&s.push(i)})}}),i=i.concat(a.mergeRangeCollections(s))}(n);this.parent.setRecordValue("workTimelineRanges",this.mergeRangeCollections(i,!0),e.ganttProperties,!0),this.calculateRangeLeftWidth(e.ganttProperties.workTimelineRanges,e.ganttProperties.calendarContext)}},t.prototype.updateOverlappingIndex=function(e){for(var t=0;t<e.length;t++)e[t].ganttProperties.eOverlapIndex=t},t.prototype.calculateRangeLeftWidth=function(e,t){for(var i=0;i<e.length;i++)e[i].left=this.getTaskLeft(e[i].from,!1,t),e[i].width=this.getTaskWidth(e[i].from,e[i].to)},t.prototype.mergeRangeCollections=function(e,t){for(var i,a,n,r,s=[],o={},l=new U.DataManager(e).executeLocal((new U.Query).sortBy(this.parent.taskFields.startDate,"Ascending")),d=0;d<l.length;d++)0===s.length&&0===d?s.push(l[d]):(i=(o=s[s.length-1]).from,a=o.to,n=(r=l[d]).from,r=r.to,i.getTime()===n.getTime()&&a.getTime()>=r.getTime()||i.getTime()<n.getTime()&&a.getTime()>=r.getTime()||(i.getTime()<=n.getTime()&&a.getTime()>=n.getTime()&&a.getTime()<r.getTime()||a.getTime()<n.getTime()&&this.checkStartDate(a).getTime()===n.getTime()?o.to=r:a.getTime()<n.getTime()&&this.checkStartDate(a).getTime()!==n.getTime()&&s.push(l[d])));return s=t?this.splitRangeCollection(s):s},t.prototype.setSortedChildTasks=function(e){return new U.DataManager(e.childRecords).executeLocal((new U.Query).sortBy(this.parent.taskFields.startDate,"Ascending"))},t.prototype.splitRangeCollection=function(e,t,i){var a=!this.parent.timelineModule.isSingleTier||"None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier;return"Week"===a||"Month"===a||"Year"===a?e:"Day"===a||0===this.parent.workingTimeRanges[0].from&&86400===this.parent.workingTimeRanges[0].to?this.getRangeWithWeek(e,t,i):this.getRangeWithDay(e,t,i)},t.prototype.getRangeWithDay=function(e,t,i){for(var a=[],n=0;n<e.length;n++)Array.prototype.push.apply(a,this.splitRangeForDayMode(e[parseInt(n.toString(),10)],t,i));return a},t.prototype.splitRangeForDayMode=function(e,t,i){var a=t||"from",n=i||"to",r=new Date(e[a]),s=new Date(e[n]),o=[],l={};if(r.getTime()<s.getTime())do{for(var d,h=new Date(r.getTime()),p=new Date(r.getTime()),u=this.parent.dataOperation.getSecondsInDecimal(r),c=-1,g=0;g<this.parent.workingTimeRanges.length;g++){var f=this.parent.workingTimeRanges[g];if(u>=f.from&&u<=f.to){c=g;break}}-1!==c&&(d=Math.round(this.parent.workingTimeRanges[c].to-u),p.setSeconds(p.getSeconds()+d))}while(p.getTime()<s.getTime()?(l={},e.task&&(l.task=ne.extend([],e.task)),l[a]=h,l[n]=p):(l={},e.task&&(l.task=ne.extend([],e.task)),l[a]=h,l[n]=s),l.isSplit=!0,o.push(l),(r=this.checkStartDate(p)).getTime()<s.getTime());else o.push(e);return o},t.prototype.getRangeWithWeek=function(e,t,i){for(var a=[],n=0;n<e.length;n++)a.push.apply(a,this.splitRangeForWeekMode(e[n],t,i));return a},t.prototype.splitRangeForWeekMode=function(e,t,i){var a,n,r,s,o=t||"from",l=i||"to",d=new Date(e[o]),h=new Date(e[o]),p=new Date(e[l]),u=!1,c=[],g={};if(h.setDate(h.getDate()+1),h.getTime()<p.getTime()){do{}while(this.parent.dataOperation.isOnHolidayOrWeekEnd(h,null,this.parent.defaultCalendarContext)?(n=void(a=new Date(h.getTime())).setDate(h.getDate()-1),n=0<this.parent.weekWorkingTime.length?this.parent.getEndTime(a):this.parent.defaultEndTime,this.setTime(n,a),(g={})[o]=d,g.isSplit=!0,g[l]=new Date(a),e.task&&(g.task=ne.extend([],e.task,!0)),n=!this.parent.dataOperation.isOnHolidayOrWeekEnd(d,null,this.parent.defaultCalendarContext),r=!this.parent.dataOperation.isOnHolidayOrWeekEnd(a,null,this.parent.defaultCalendarContext),s=d.getTime()!==a.getTime(),n&&r&&s&&c.push(g),a.setDate(a.getDate()+1),d=this.checkStartDate(a),h=new Date(d.getTime()),u=!0):h.setDate(h.getDate()+1),h.getTime()<p.getTime());u?d.getTime()!==p.getTime()&&(g={},e.task&&(g.task=ne.extend([],e.task,!0)),g[o]=d,g[l]=p,g.isSplit=!0,c.push(g)):c.push(e)}else c.push(e);return c},t.prototype.updateGanttData=function(){var t=this,e=(this.systemTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.parent.flatData);if(e.length){for(var i=new Map,a=0,n=e.length;a<n;a++){var r=e[a];i.set(r.uniqueID,r),this.updateTaskLeftWidth(r,i),!this.parent.skipOffsetUpdate&&this.parent.isLoad&&r.ganttProperties.predecessorsName&&this.parent.autoUpdatePredecessorOffset&&this.parent.predecessorModule.calculateOffset(r)}(this.parent.isLoad||this.parent.isFromOnPropertyChange)&&this.offsetUpdateParentList&&this.offsetUpdateParentList.forEach(function(e){t.parent.predecessorModule.calculateOffset(e)})}},t.prototype.shouldProcessUpdateWidth=function(){return!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&Boolean(this.parent.taskFields.hasChildMapping)},t.prototype.updateTaskLeftWidth=function(e,t){void 0===t&&(t=null);var i,a=e.ganttProperties,a=(e.hasChildRecords&&!this.shouldProcessUpdateWidth()||this.updateWidthLeft(e),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(a),a,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(a),a,!0),e.parentItem?null!=t?t.get(e.parentItem.uniqueID):this.parent.getParentTask(e.parentItem):null),n=a&&a.childRecords.slice(-1)[0]===e;a&&(i=a.uniqueID,n&&!e.hasChildRecords&&this.parent.enableValidation?((!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&"ResourceView"!==this.parent.viewType||this.processedParentItems.has(i)||(this.updateParentItems(a,!0,t),this.processedParentItems.add(i)),this.shouldProcessUpdateWidth()&&this.updateWidthLeft(a)):a&&!this.parent.enableValidation&&this.updateWidthLeft(a))},t.prototype.reUpdateGanttDataPosition=function(){for(var e=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.flatData,t=e.length,i=0;i<t;i++){var a=e[i],n=a.ganttProperties,r=JSON.stringify(this.parent.removeCalendarContext(n));this.updateWidthLeft(a),"Auto"!==this.parent.taskMode&&a.hasChildRecords&&this.updateAutoWidthLeft(a),this.parent.setRecordValue("baselineLeft",this.calculateBaselineLeft(n),n,!0),this.parent.setRecordValue("baselineWidth",this.calculateBaselineWidth(n),n,!0),r!==JSON.stringify(this.parent.removeCalendarContext(n))&&this.parent.dataOperation.updateTaskData(a)}},t.prototype.updateWidthLeft=function(e){var t=e.ganttProperties,i=0,a=0;if(!ne.isNullOrUndefined(t.segments)&&0<t.segments.length){for(var n=t.segments,r=0;r<n.length;r++){var s,o=n[r];0!==r||ne.isNullOrUndefined(t.startDate)||ne.isNullOrUndefined(o.startDate)||ne.isNullOrUndefined(o.startDate.getTime())||o.startDate.getTime()===t.startDate.getTime()||(o.startDate=t.startDate,s=this.parent.dataOperation.getEndDate(o.startDate,o.duration,t.durationUnit,t,!1),o.endDate=this.parent.dataOperation.checkEndDate(s,t,!1),this.parent.chartRowsModule.incrementSegments(n,0,e)),o.width=this.getSplitTaskWidth(o.startDate,o.duration,e),i+=o.width,o.showProgress=!1,o.progressWidth=-1,0!==r&&(s=new Date(t.startDate.getTime()),o.left=this.getSplitTaskLeft(o.startDate,s))}for(var l=this.parent.dataOperation.getProgressWidth(i,t.progress),d=!0,r=0;r<n.length;r++)d&&(l<=n[r].width?(n[r].progressWidth=l,d=!(n[r].showProgress=!0)):(n[r].progressWidth=n[r].width,l-=n[r].progressWidth),n[r].showProgress)&&(a=a+n[r].left+n[r].progressWidth);this.parent.setRecordValue("segments",t.segments,t,!0),this.parent.dataOperation.updateMappingData(e,"segments")}this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e),t,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(t,e),t,!0),!ne.isNullOrUndefined(t.segments)&&0<t.segments.length?this.parent.setRecordValue("progressWidth",a,t,!0):this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.isAutoSchedule||!e.hasChildRecords?t.width:t.autoWidth,t.progress),t,!0)},t.prototype.updateAutoWidthLeft=function(e){var t=e.ganttProperties;this.parent.setRecordValue("autoWidth",this.calculateWidth(e,!0),t,!0),this.parent.setRecordValue("autoLeft",this.calculateLeft(t,e,!0),t,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.isAutoSchedule||!e.hasChildRecords?t.width:t.autoWidth,t.progress),t,!0)},t.prototype.getParentProgress=function(e){var t=0,i={},a=0<this.parent.weekWorkingTime.length?this.parent.getSecondsPerDay(e.ganttProperties.startDate||e.ganttProperties.endDate):this.parent.secondsPerDay;switch(e.ganttProperties.durationUnit){case"hour":t=e.ganttProperties.duration/(a/3600);break;case"minute":t=e.ganttProperties.duration/(a/60);break;default:t=e.ganttProperties.duration}return e.hasChildRecords?(ne.setValue("totalProgress",e.ganttProperties.totalProgress,i),ne.setValue("totalDuration",e.ganttProperties.totalDuration||0,i)):(ne.setValue("totalProgress",e.ganttProperties.progress*t,i),ne.setValue("totalDuration",t,i)),i},t.prototype.resetDependency=function(e){var t,i=this.parent.taskFields.dependency;ne.isNullOrUndefined(i)||(t=e.ganttProperties,this.parent.setRecordValue("predecessor",[],t,!0),this.parent.setRecordValue("predecessorsName",null,t,!0),this.parent.setRecordValue("taskData."+i,null,e),this.parent.setRecordValue(i,null,e))},t.prototype.isUnscheduledTask=function(e,t){for(var i=0,a=null,n=0,r=["startDate","endDate","duration"];n<r.length;n++){var s=r[n];e&&!ne.isNullOrUndefined(e[s])&&(i++,a=s)}return 1===i||0===i&&!ne.isNullOrUndefined(t)&&t.hasChildRecords?[!0,a]:[!1,null]},t.prototype.isFromManual=function(e){return!!(this.parent.allowUnscheduledTasks&&this.parent.editModule&&this.parent.oldRecords&&0<this.parent.oldRecords.length&&ne.isNullOrUndefined(e.ganttProperties.startDate)&&ne.isNullOrUndefined(e.ganttProperties.endDate)&&!ne.isNullOrUndefined(e.ganttProperties.duration)&&!e.hasChildRecords&&e.parentItem&&("Manual"===this.parent.taskMode||"Custom"===this.parent.taskMode&&e[this.parent.taskFields.manual]))},t.prototype.updateParentItems=function(e,t,o){var l=this;void 0===o&&(o=null);var i,d=(d=t?e:this.parent.getParentTask(e,o))||e,h=!1,p=ne.isNullOrUndefined(d)?null:d.ganttProperties,t=(this.processedParentItems&&this.processedParentItems.add(d.uniqueID),this.isUnscheduledTask(p,d)),u=t[0];t[1];if(this.parent.autoCalculateDateScheduling&&!(this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)||"ResourceView"===this.parent.viewType){if(d&&d.childRecords&&0<d.childRecords.length){for(var c,e=p.isAutoSchedule?p.startDate:p.autoStartDate,t=p.isAutoSchedule?p.endDate:p.autoEndDate,g=d.childRecords,f=g.length,m=0,y=null,D=null,k=0,T=0,b=0,w=[],a=0,n=0,v=0,S=(g.some(function(e){var t=l.isUnscheduledTask(e.ganttProperties),i=t[0],t=t[1];return i&&"duration"===t?++n:i||ne.isNullOrUndefined(e.ganttProperties.startDate)||ne.isNullOrUndefined(e.ganttProperties.endDate)||ne.isNullOrUndefined(e.ganttProperties.duration)||++a,0<a&&0<n}),0<a&&0<n||void 0),P=this,r=0;r<f;r++)!function(t){c=P.parent.loadChildOnDemand&&P.parent.taskFields.hasChildMapping?P.parent.currentViewData.filter(function(e){return e.ganttProperties.taskId===g[t][l.parent.taskFields.id]})[0]:g[t];var e=P.isUnscheduledTask(c.ganttProperties),i=e[0],e=e[1];if(i&&"duration"===e&&(w.push(c),c.ganttProperties.duration>v)&&(v=c.ganttProperties.duration),P.parent.isOnDelete&&c.isDelete)return 1===f&&"ProjectView"===P.parent.viewType&&(h=!0);var a=void 0,n=void 0,r=void 0,s=(r=P.isFromManual(c)&&(s=P.parent.oldRecords.filter(function(e){return e.ganttProperties.uniqueID===c.ganttProperties.uniqueID})[0])?P.parent.getParentTask(s.parentItem,o):r)||c,r=r?r.ganttProperties:p,a=i&&"startDate"!==e&&"endDate"!==e&&!u?p.startDate:P.getValidStartDate(s.ganttProperties),r=(i&&"startDate"!==e&&"endDate"!==e&&P.parent.setRecordValue("left",P.getTaskLeft(a,!1,s.ganttProperties.calendarContext),s.ganttProperties,!0),!d.hasChildRecords||r.isAutoSchedule||ne.isNullOrUndefined(s.ganttProperties.autoStartDate)||(a=s.ganttProperties.autoStartDate),n=i&&"startDate"!==e&&"endDate"!==e&&!u?P.getEndDate(p.startDate,s.ganttProperties.duration,s.ganttProperties.durationUnit,s.ganttProperties,!1):P.getValidEndDate(s.ganttProperties),i&&"startDate"!==e&&"endDate"!==e&&P.parent.setRecordValue("width",P.getTaskWidth(a,n,s.ganttProperties),s.ganttProperties,!0),!d.hasChildRecords||r.isAutoSchedule||ne.isNullOrUndefined(s.ganttProperties.autoEndDate)||(n=s.ganttProperties.autoEndDate),S&&!i||ne.isNullOrUndefined(S)),r=(ne.isNullOrUndefined(y)&&r&&(y=P.getDateFromFormat(a)),ne.isNullOrUndefined(D)&&r&&(D=P.getDateFromFormat(n)),ne.isNullOrUndefined(n)||!D||1!==P.compareDates(n,D)||i&&"endDate"!==e&&"startDate"!==e||(D=P.getDateFromFormat(n)),ne.isNullOrUndefined(a)||!y||-1!==P.compareDates(a,y)||i&&"startDate"!==e&&"endDate"!==e||(y=P.getDateFromFormat(a)),!c.ganttProperties.isMilestone&&j(c.ganttProperties)?(s=P.getParentProgress(c),T+=ne.getValue("totalProgress",s),m+=ne.getValue("totalDuration",s),c[P.parent.taskFields.duration]<1&&(m=Number(m.toFixed(4)))):k++,c.ganttProperties.work);"string"==typeof r?(n=parseFloat(r),isNaN(n)||(b+=n)):"number"==typeof r&&(b+=r)}(r);if(!h){var s=this.parent.isOnDelete&&c.isDelete?f-k-1:f-k,C=0<s&&0<m?Number((T/m).toFixed(2)):0,R=d.ganttProperties,s=!(0!=s||!y||!D||y.getTime()!==D.getTime()),s=(0!==this.compareDates(e,y)&&(this.parent.setRecordValue(p.isAutoSchedule?"startDate":"autoStartDate",y,d.ganttProperties,!0),ne.isNullOrUndefined(p.autoDuration)?0===p.duration:0===p.autoDuration)&&d.isManual&&s&&d.hasChildRecords&&d.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("startDate",y,d.ganttProperties,!0),0!==this.compareDates(t,D)&&(this.parent.setRecordValue(p.isAutoSchedule?"endDate":"autoEndDate",D,d.ganttProperties,!0),ne.isNullOrUndefined(p.autoDuration)?0===p.duration:0===p.autoDuration)&&d.isManual&&s&&d.hasChildRecords&&d.ganttProperties.isAutoSchedule&&"TaskbarEditing"!==this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action&&this.parent.setRecordValue("endDate",D,d.ganttProperties,!0),d.hasChildRecords&&-1===this.parent.editedRecords.indexOf(d)&&!this.parent.allowTaskbarOverlap&&this.parent.enableMultiTaskbar&&this.parent.editedRecords.push(d),this.parent.setRecordValue("isMilestone",s,R,!0),ne.isNullOrUndefined(this.parent.taskFields.milestone)||(this.updateMappingData(d,"milestone"),this.parent.setRecordValue(this.parent.taskFields.milestone,s,d,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.milestone,s,d,!0)),R.isAutoSchedule&&(this.isFromManual(c)?(1===d.childRecords.length&&(d.ganttProperties.duration=c.ganttProperties.duration),this.calculateEndDate(d)):this.calculateDuration(d),0<w.length)&&(d.ganttProperties.duration<v&&!ne.isNullOrUndefined(d.ganttProperties.startDate)&&(d.ganttProperties.duration=v),this.calculateEndDate(d)),this.parent.autoCalculateDateScheduling&&d&&d.hasChildRecords&&this.parent.isLoad&&"ResourceView"!==this.parent.viewType&&(t=(e=d.taskData[this.parent.taskFields.startDate])instanceof Date?e:"string"==typeof e?this.getDateFromFormat(e,!1):null,e=(s=d.taskData[this.parent.taskFields.endDate])instanceof Date?s:"string"==typeof s?this.getDateFromFormat(s,!1):null,ne.isNullOrUndefined(t)||this.resolveAndApplyWorkingTimes(t),ne.isNullOrUndefined(e)||this.resolveAndApplyWorkingTimes(null,e),t&&d.ganttProperties.startDate&&t.getTime()!==d.ganttProperties.startDate.getTime()||e&&d.ganttProperties.endDate&&e.getTime()!==d.ganttProperties.endDate.getTime())&&this.validatedGanttData.set(d.ganttProperties.taskId,d),this.updateWorkWithDuration(d),R.work),s=this.parent.isOnEdit?s:s+b;if(this.parent.setRecordValue("work",s,R,!0),this.parent.setRecordValue("taskType","FixedDuration",R,!0),ne.isNullOrUndefined(this.parent.taskFields.type)||this.updateMappingData(d,"type"),this.parent.setRecordValue("progress",Math.floor(C),R,!0),this.parent.setRecordValue("totalProgress",T,R,!0),this.parent.setRecordValue("totalDuration",m,R,!0),this.parent.setRecordValue("autoDuration",R.duration,R,!0),R.isAutoSchedule||(this.parent.setRecordValue("autoDuration",this.calculateAutoDuration(R),R,!0),this.updateAutoWidthLeft(d)),this.parent.allowParentDependency||this.resetDependency(d),this.updateWidthLeft(d),this.updateTaskData(d),this.parent.isLoad&&0<w.length)for(var M=0;M<w.length;M++)w[M].ganttProperties.left=d.ganttProperties.left}}}else this.parent.setRecordValue("endDate",d.taskData[this.parent.taskFields.endDate],d.ganttProperties,!0);h&&1===d.childRecords.length&&0===d.ganttProperties.duration&&(this.parent.setRecordValue("isMilestone",!0,d.ganttProperties,!0),this.updateWidthLeft(d),this.updateTaskData(d)),this.parent.allowParentDependency&&d.ganttProperties.predecessor&&1<=d.ganttProperties.predecessor.length&&(t=d.ganttProperties.predecessor,i=("ResourceView"===this.parent.viewType?d.ganttProperties.taskId:d.ganttProperties.rowUniqueID).toString(),0<t.filter(function(e){return e.to===i?e:null}).length)&&this.offsetUpdateParentList.push(d);e=ne.isNullOrUndefined(d)?null:this.parent.getParentTask(d.parentItem,o);!e||(!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&"ResourceView"!==this.parent.viewType||this.updateParentItems(e,!0,o),h=!1};var ie,ae,le=t;function t(e){e=ae.call(this,e)||this;return e.customSegmentProperties=[],e.processedParentItems=new Set,e.isBaseline=!1,e.uid=0,e.isTaskIDInteger=!0,e.cache={},e.offsetUpdateParentList=[],e.validatedGanttData=new Map,e.isHavingUnscheduledTaskOnLoad=!1,e.originalStartDate=null,e.originalEndDate=null,e.recordIndex=0,e.taskIds={},e.hierarchyData=[],e.addEventListener(),e}var de="e-gantt",he="e-gantt-chart-pane",pe="e-gantt-single-timeline",ue="e-chart-root-container",ce="e-chart-rows-container",ge="e-device",fe="e-grid",me="e-timeline-header-container",ye="e-timeline-header-table-container",De="e-timeline-header-table-body",ke="e-left-label-container",Te="e-left-label-inner-div",be="e-right-label-container",we="e-right-label-inner-div",ve="e-taskbar-main-container",Se="e-task-label",Pe="e-gantt-child-taskbar-inner-div",Ce="e-gantt-child-progressbar-inner-div",Re="e-gantt-child-critical-taskbar-inner-div",Me="e-gantt-child-critical-progressbar-inner-div",xe="e-critical-milestone",Oe="e-baseline-bar",Ie="e-baseline-gantt-milestone-container",Ee="e-chart-row-cell",Fe="e-chart-row",Ue="e-gantt-multi-taskbar",Ne="e-taskbar-left-resizer",Le="e-taskbar-right-resizer",Ve="e-child-progress-resizer",Be="e-progressbar-handler",Ae="e-progressbar-handler-element",We="e-progressbar-handler-after",je="e-icon",He="e-gantt-milestone",Ge="e-gantt-child-taskbar",ze="e-gantt-child-progressbar",qe="e-manualparent-main-container",_e="e-gantt-manualparenttaskbar",Ze="e-gantt-manualparent-milestone",Xe="e-gantt-child-manualtaskbar",Ye="e-gantt-manualparenttaskbar-right",Ke="e-gantt-parent-taskbar",Qe="e-gantt-parent-progressbar",$e="e-gantt-unscheduled-task",Je="e-left-resize-gripper",et="e-right-resize-gripper",tt="e-progress-resize-gripper",l="e-label",it="e-template-padding",at="e-gantt-unscheduled-taskbar-left",nt="e-gantt-unscheduled-taskbar-right",rt="e-connector-line-container",st="e-connector-line",ot="e-critical-line",lt="e-critical-line-arrow",dt="e-connector-line-arrow",ht="e-connector-line-z-index",pt="e-connectorpoint-left",ut="e-connectorpoint-right",ct="e-connectorpoint-left-hover",gt="e-connectorpoint-right-hover",ft="e-right-connectorpoint-outer-div",mt="e-connectorpoint-allow-block",yt="e-gantt-tooltip",p=".e-content",Dt=".e-gridform",kt="e-edit",Tt="e-active-parent-task",bt="e-active-child-task",wt="e-active-connected-task",vt="e-predecessor-touch-mode",St="e-rangecontainer",Pt="e-rg-rangdiv",Ct="e-constraint-label",Rt=(i.prototype.addEventListeners=function(){this.parent.on("grid-scroll",this.gridScrollHandler,this),ne.EventHandler.add(this.element,"scroll",this.onScroll,this),ne.EventHandler.add(this.element,"pointerdown",this.startHold,this),ne.EventHandler.add(this.element,"pointerup",this.stopHold,this),ne.EventHandler.add(this.element,"pointercancel",this.stopHold,this),this.parent.treeGrid.grid.on("showGanttShimmer",this.updateShimmer,this),this.parent.treeGrid.grid.on("removeGanttShimmer",this.removeShimmer,this),this.parent.treeGrid.grid.on("virtualTransform",this.transformChange,this)},i.prototype.removeEventListeners=function(){ne.EventHandler.remove(this.element,"scroll",this.onScroll),ne.EventHandler.remove(this.element,"pointerdown",this.startHold),ne.EventHandler.remove(this.element,"pointerup",this.stopHold),ne.EventHandler.remove(this.element,"pointercancel",this.stopHold),this.parent.off("grid-scroll",this.gridScrollHandler),this.parent.treeGrid.grid.off("showGanttShimmer",this.updateShimmer),this.parent.treeGrid.grid.off("removeGanttShimmer",this.removeShimmer),this.parent.treeGrid.grid.off("virtualTransform",this.transformChange)},i.prototype.gridScrollHandler=function(e){this.element.scrollTop=ne.getValue("top",e),this.isFromTreeGrid=!0},i.prototype.updateContent=function(){var e=this.parent.element,e=Math.round(this.element.scrollLeft/e.offsetWidth);(this.previousCount!==e||this.parent.timelineModule.performedTimeSpanAction||this.parent.timelineModule.isZoomingAction)&&(this.parent.timelineModule.isZoomingAction=!1,this.deleteTableElements(),this.parent.timelineModule.createTimelineSeries(),this.parent.isLoad||!this.parent.isReact||ne.isNullOrUndefined(this.parent.timelineTemplate)||this.parent.renderTemplates(),"Vertical"!==this.parent.gridLines&&"Both"!==this.parent.gridLines||this.parent.renderChartVerticalLines(),this.parent.dayMarkersModule&&this.parent.dayMarkersModule.eventMarkerRender.renderEventMarkers(),this.parent.timelineModule.performedTimeSpanAction=!1,this.parent.dayMarkersModule&&(this.parent.dayMarkersModule.nonworkingDayRender.renderWeekends(),this.parent.dayMarkersModule.nonworkingDayRender.renderHolidays()),this.updateChartElementStyles(),this.previousCount=e,this.isSetScrollLeft)&&(this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft)},i.prototype.getTimelineLeft=function(){var e,t=this.parent.element,i=this.parent.timelineModule.wholeTimelineWidth>3*t.offsetWidth?this.parent.timelineModule.wholeTimelineWidth-3*t.offsetWidth:0;return(e=i<=(e=this.element.scrollLeft===(this.parent.enableRtl?-i:i)?this.element.scrollLeft:(e=this.parent.enableRtl?-this.element.scrollLeft:this.element.scrollLeft)>t.offsetWidth?e-t.offsetWidth:0)?i:e)<=t.offsetWidth&&this.isBackwardScrolled&&(e=0),e=this.parent.timelineModule.isZoomToFit||this.parent.timelineModule.isZooming?0:e},i.prototype.deleteTableElements=function(){for(var e=this.parent.element.getElementsByClassName("e-timeline-header-table-container");e[0].remove(),0<e.length;);this.parent.element.querySelector("#ganttContainerline-container")&&(this.parent.element.querySelector("#ganttContainerline-container").innerHTML=""),this.parent.element.querySelector(".e-nonworking-day-container")&&(this.parent.element.querySelector(".e-nonworking-day-container").outerHTML=null)},i.prototype.updateChartElementStyles=function(){var e,t,i=this.getTimelineLeft();this.parent.enableTimelineVirtualization&&(e=this.parent.connectorLineModule.dependencyViewContainer,t=this.parent.chartRowsModule.taskTable,this.parent.enableRtl?(e.style.left=i+"px",t.style.right=-i+"px"):(e.style.left=-i+"px",t.style.left=-i+"px"),t.style.width=this.parent.timelineModule.wholeTimelineWidth+"px")},i.prototype.updateTopPosition=function(){var e,t,i,a=this.parent.treeGrid.element.querySelector(".e-content").scrollTop;a=this.parent.virtualScrollModule&&this.parent.enableVirtualization?a-this.parent.virtualScrollModule.getTopPosition():a,ne.isNullOrUndefined(this.parent.dayMarkersModule)||(e=ne.getValue("nonworkingDayRender.holidayContainer",this.parent.dayMarkersModule),t=ne.getValue("nonworkingDayRender.weekendContainer",this.parent.dayMarkersModule),i=ne.getValue("eventMarkerRender.eventMarkersContainer",this.parent.dayMarkersModule),e&&(e.style.top=ne.formatUnit(a)),t&&(t.style.top=ne.formatUnit(a)),i&&(i.style.top=ne.formatUnit(a))),this.parent.chartVerticalLineContainer&&(this.parent.chartVerticalLineContainer.style.top=ne.formatUnit(a))},i.prototype.removeShimmer=function(){var i=this.parent;setTimeout(function(){if(i.hideMaskRow(),!i.allowTaskbarOverlap&&i.showOverAllocation){for(var e=0;e<i.currentViewData.length;e++){var t=i.chartRowsModule.ganttChartTableBody.childNodes[e];"none"!==t.style.display&&i.currentViewData[e].hasChildRecords&&!i.currentViewData[e].expanded&&(i.ganttChartModule.isExpandAll||i.ganttChartModule.isCollapseAll?i.treeGrid.getRowByIndex(e).style.height=t.style.height:i.treeGrid.getRows()[e].style.height=t.style.height)}i.contentHeight=(i.enableRtl?i.element.getElementsByClassName("e-content")[2]:i.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,i.element.getElementsByClassName("e-chart-rows-container")[0].style.height=i.contentHeight+"px"}},0)},i.prototype.transformChange=function(){this.parent.ganttChartModule.virtualRender.adjustTable(),this.parent.ganttChartModule.scrollObject.updateTopPosition()},i.prototype.updateShimmer=function(){var e=this.parent;setTimeout(function(){e.showMaskRow()},0)},i.prototype.updateSpinner=function(){var e=this.parent;this.parent.showSpinner(),window.clearTimeout(this.isScrolling),this.isScrolling=setTimeout(function(){e.hideSpinner()},200)},i.prototype.onScroll=function(){var e=this,t={};this.element.scrollTop!==this.previousScroll.top&&(this.isFromTreeGrid?this.isFromTreeGrid=!1:this.parent.notify("chartScroll",{top:this.element.scrollTop}),t.previousScrollTop=this.previousScroll.top,this.previousScroll.top=this.element.scrollTop,t.scrollTop=this.element.scrollTop,t.scrollDirection="Vertical",t.action="VerticalScroll",this.updateTopPosition()),this.element.scrollLeft!==this.previousScroll.left&&(this.isBackwardScrolled=this.parent.enableRtl?this.element.scrollLeft>this.previousScroll.left:this.element.scrollLeft<this.previousScroll.left,this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,t.previousScrollLeft=this.previousScroll.left,this.previousScroll.left=this.element.scrollLeft,t.scrollLeft=this.element.scrollLeft,t.scrollDirection="Horizontal",t.action="HorizontalScroll",this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth>3*this.parent.element.offsetWidth?(this.isSetScrollLeft=!0,this.parent.timelineModule.totalTimelineWidth>3*this.parent.element.offsetWidth&&this.updateContent(),this.parent.ganttChartModule.updateWidthAndHeight(),this.parent.element.getElementsByClassName("e-weekend-container")[0]&&(this.parent.element.getElementsByClassName("e-weekend-container")[0].style.height="100%"),this.parent.element.getElementsByClassName("e-holiday-container")[0]&&(this.parent.element.getElementsByClassName("e-holiday-container")[0].style.height="100%")):this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth<3*this.parent.element.offsetWidth&&this.parent.connectorLineModule.svgObject.setAttribute("width","100%"),!this.parent.enableInfiniteTimelineScroll||this.parent.timelineModule.isZoomedToFit||this.parent.ganttChartModule.scrollObject.isBackwardScrolled||this.parent.timelineModule.handleInfiniteTimelineScroll("right"),!ne.isNullOrUndefined(document.body.className))&&document.body.className.includes("e-bigger")&&this.parent.enableInfiniteTimelineScroll&&this.trimTimelines(),this.parent.timelineModule.performedTimeSpanAction=!1,ne.isNullOrUndefined(t.scrollDirection)||!0!==this.parent.enableVirtualization&&!0!==this.parent.enableTimelineVirtualization||!this.parent.isToolBarClick&&!ne.isNullOrUndefined(this.parent.isToolBarClick)||(this.parent.isVirtualScroll=!0,this.parent.isVirtualScrollAction=!0,(this.parent.showIndicator||ne.isNullOrUndefined(this.parent.showIndicator))&&(!this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization&&"Spinner"===this.parent.loadingIndicator.indicatorType?this.updateSpinner():this.parent.enableTimelineVirtualization&&!this.parent.isRowSelected&&1e3<Math.abs(this.element.scrollLeft-t.previousScrollLeft)&&(this.parent.enableVirtualMaskRow||"Spinner"!==this.parent.loadingIndicator.indicatorType?(this.parent.showMaskRow(),setTimeout(function(){e.removeShimmer()},0)):this.updateSpinner()),this.parent.isRowSelected=!1)),this.isSetScrollLeft=!1,this.parent.isToolBarClick=!0,t.requestType="scroll",this.parent.trigger("actionComplete",t),this.parent.isVirtualScroll=!1,this.parent.timelineModule.isZoomOut=!1},i.prototype.startHold=function(e){var t,i;!this.parent.enableInfiniteTimelineScroll||this.parent.timelineModule.isZoomedToFit||(i=(t=this.element).offsetHeight-16,i=e.clientY>=t.getBoundingClientRect().top+i,t.scrollWidth<=t.clientWidth)||this.extendStartHold(i,e,t)},i.prototype.extendStartHold=function(e,t,i){e&&(this.isScrollArrowPressed=!0,e=i.getBoundingClientRect(),t.clientX<e.left+30?(this.scrollArrowDirection="left",this.startContinuousScroll("left")):t.clientX>e.right-30&&(this.scrollArrowDirection="right",this.startContinuousScroll("right")))},i.prototype.startContinuousScroll=function(e){var t=this;this.scrollArrowInterval&&clearInterval(this.scrollArrowInterval),this.scrollArrowInterval=window.setInterval(function(){t.isScrollArrowPressed?t.extendContinuousScrolling(e):(clearInterval(t.scrollArrowInterval),t.scrollArrowInterval=0)},100)},i.prototype.extendContinuousScrolling=function(e){"left"===e?this.parent.enableInfiniteTimelineScroll&&this.parent.timelineModule&&(this.parent.enableRtl?this.parent.timelineModule.handleInfiniteTimelineScroll("right"):this.parent.timelineModule.handleInfiniteTimelineScroll("left")):"right"===e&&this.parent.enableInfiniteTimelineScroll&&this.parent.timelineModule&&(this.parent.enableRtl?this.parent.timelineModule.handleInfiniteTimelineScroll("left"):this.parent.timelineModule.handleInfiniteTimelineScroll("right"))},i.prototype.stopHold=function(e){this.isScrollArrowPressed&&(this.isScrollArrowPressed=!1,this.scrollArrowDirection=null,this.scrollArrowInterval&&(clearInterval(this.scrollArrowInterval),this.scrollArrowInterval=0),this.trimTimelines())},i.prototype.trimTimelines=function(){this.parent.enableInfiniteTimelineScroll&&!this.parent.timelineModule.isZoomedToFit&&this.parent.ganttChartModule.scrollObject.isBackwardScrolled?this.parent.timelineModule.trimInfiniteTimelineRightCells():!this.parent.enableInfiniteTimelineScroll||this.parent.timelineModule.isZoomedToFit||this.parent.ganttChartModule.scrollObject.isBackwardScrolled||this.parent.timelineModule.trimInfiniteTimelineLeftCells()},i.prototype.setHeight=function(e){this.element.style.height=ne.formatUnit(e)},i.prototype.setWidth=function(e){this.element.style.width=ne.formatUnit(e)},i.prototype.setScrollTop=function(e){this.parent.enableVirtualization&&(this.parent.isVirtualScrollAction=!0),this.element.scrollTop=e,this.parent.treeGrid.element.querySelector(".e-content").scrollTop=e},i.prototype.setScrollLeft=function(e,t){e=-1===t&&this.parent.enableRtl?-e:e,this.isSetScrollLeft=!0,this.element.scrollLeft=e,this.parent.ganttChartModule.chartTimelineContainer.scrollLeft=this.element.scrollLeft,this.parent.enableTimelineVirtualization||(this.previousScroll.left=this.element.scrollLeft)},i.prototype.destroy=function(){this.removeEventListeners()},i);function i(e){this.previousCount=-1,this.isSetScrollLeft=!1,this.previousScroll={top:0,left:0},this.isScrollArrowPressed=!1,this.scrollArrowDirection=null,this.scrollArrowInterval=0,this.lastScrollLeft=0,this.parent=e,this.element=this.parent.ganttChartModule.scrollElement,this.addEventListeners()}xt.prototype.renderWrapper=function(){this.wrapper=ne.createElement("div",{className:"e-virtualtable",styles:"position: absolute; transform: translate3d(0px, 0px, 0px) translateZ(0);"}),this.parent.ganttChartModule.scrollElement.appendChild(this.wrapper),this.virtualTrack=ne.createElement("div",{className:"e-virtualtrack",styles:"position: relative; pointer-events: none; width: 100%;"}),this.parent.ganttChartModule.scrollElement.appendChild(this.virtualTrack),this.wrapper.appendChild(this.parent.ganttChartModule.chartBodyContent)},xt.prototype.appendChildElements=function(e){this.wrapper.appendChild(e)},xt.prototype.adjustTable=function(){var e,t,i,a,n=this.parent.treeGrid.getContent().querySelector(".e-content").querySelector(".e-virtualtable");this.parent.enableTimelineVirtualization?(i=document.getElementsByClassName("e-virtualtable")[1].style.transform,a=this.parent.treeGrid.element.getElementsByClassName("e-virtualtable")[0].style.transform,t=void 0,e=/translate(?:3d)?\(([^\)]+)\)/,t=""!==i?i.match(/translate.*\((.+)\)/)[1].split(", ")[0]:this.parent.ganttChartModule.scrollElement.getElementsByClassName("e-virtualtable")[0].style.transform.match(e)[1].split(",")[0].trim(),i=a.match(e)[1].split(","),a=this.parent.getTranslateY(i),this.parent.ganttChartModule.virtualRender.wrapper.style.transform="translate3d("+t+", "+a+", 0px) translateZ(0)"):this.parent.ganttChartModule.virtualRender.wrapper.style.transform=n.style.transform};var Mt=xt;function xt(e){this.parent=e}a.prototype.addEventListener=function(){this.parent.on("renderPanels",this.renderChartContainer,this),this.parent.on("recordsUpdated",this.renderChartElements,this),this.parent.on("dataReady",this.renderInitialContents,this),this.parent.on("tree-grid-created",this.renderChartContents,this),this.parent.on("destroy",this.destroy,this)},a.prototype.renderChartContents=function(){this.parent.notify("refreshDayMarkers",{}),this.wireEvents()},a.prototype.renderChartContainer=function(){this.chartElement=ne.createElement("div",{id:this.parent.element.id+"GanttChart",className:"e-gantt-chart"}),this.parent.chartPane.appendChild(this.chartElement),this.renderTimelineContainer(),this.renderBodyContainers()},a.prototype.renderInitialContents=function(){this.parent.ganttChartModule.chartTimelineContainer.innerHTML="",this.parent.timelineModule.createTimelineSeries()},a.prototype.renderOverAllocationContainer=function(){for(var e=0;e<this.parent.flatData.length;e++){var t=this.parent.flatData[e];0<t.childRecords.length&&this.parent.dataOperation.updateOverlappingValues(t)}var i=this.parent.element.querySelector("."+St);i&&(i.innerHTML=""),0===this.parent.treeGrid.grid.filterSettings.columns.length&&this.renderRangeContainer(this.parent.currentViewData)},a.prototype.renderChartElements=function(){if(this.parent.isFromOnPropertyChange)this.rangeViewContainer.innerHTML="",this.parent.updateProjectDates(this.parent.cloneProjectStartDate,this.parent.cloneProjectEndDate,this.parent.isTimelineRoundOff),this.parent.isFromOnPropertyChange=!1;else{this.parent.chartRowsModule.renderChartRows(),this.parent.predecessorModule&&this.parent.taskFields.dependency&&(this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection()),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);for(var e,t=0;t<this.parent.chartRowsModule.ganttChartTableBody.children.length;t++)this.parent.chartRowsModule.ganttChartTableBody.children[t].children[0].children[1].children[4]?(this.parent.chartRowsModule.ganttChartTableBody.children[t].children[0].children[1].children[1].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[t].children[0].children[1].children[2].setAttribute("tabindex","-1"),this.parent.chartRowsModule.ganttChartTableBody.children[t].children[0].children[1].children[4].setAttribute("tabindex","-1")):"ProjectView"===this.parent.viewType?(e=this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(t.toString(),10)].children[0].children[1].children[1],ne.isNullOrUndefined(e)||this.parent.chartRowsModule.ganttChartTableBody.children[t].children[0].children[1].children[1].setAttribute("tabindex","-1")):this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(t.toString(),10)].children[0].children[1].children[0]&&this.parent.chartRowsModule.ganttChartTableBody.children[t].children[0].children[1].children[0].setAttribute("tabindex","-1");var i=this.parent.criticalPathModule;this.parent.enableCriticalPath&&i&&i.criticalPathCollection&&this.parent.criticalPathModule.criticalConnectorLine(i.criticalPathCollection,i.detailPredecessorCollection,this.parent.enableCriticalPath,i.predecessorCollectionTaskIds),this.parent.showOverAllocation&&this.renderOverAllocationContainer()}this.updateWidthAndHeight();i=this.parent.loadChildOnDemand&&(this.parent.isExpandPerformed||!ne.isNullOrUndefined(this.parent.isVirtualScroll)&&this.parent.isVirtualScroll);this.parent.isLoad&&!i&&this.parent.notify("selectRowByIndex",{}),this.parent.timelineModule.isZoomedToFit&&!this.parent.isVirtualScrollAction&&this.parent.timelineModule.processZoomToFit(),this.parent.isVirtualScrollAction=!1},a.prototype.renderRangeContainer=function(e){var t,i,a,n=e.length;if(0===this.parent.treeGrid.grid.filterSettings.columns.length)for(t=0;t<n;t++)(a=(i=e[t]).ganttProperties.workTimelineRanges)&&this.renderRange(a,i)},a.prototype.getTopValue=function(e){var t,i=this.parent.expandedRecords,a=i.indexOf(e);return e.parentItem&&-1===a&&(t=this.parent.getRecordByID(e.parentItem.taskId),a=i.indexOf(t)),e.expanded?(a+1)*this.parent.rowHeight:a*this.parent.rowHeight},a.prototype.getHierarchyChildRecords=function(e){for(var t=[],i=0,a=e;i<a.length;i++){var n=a[i];n.childRecords&&0<n.childRecords.length&&(t.push(n),this.collectHierarchyChildren(n.childRecords,t))}return t},a.prototype.collectHierarchyChildren=function(e,t){for(var i=0,a=e;i<a.length;i++){var n=a[i];n.childRecords&&0<n.childRecords.length&&(t.push(n),this.collectHierarchyChildren(n.childRecords,t))}},a.prototype.getRangeHeight=function(e){var t,i=Math.floor(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight);return!e.expanded&&e.hasChildRecords?this.calculateCollapsedRowHeight(i):(t=this.calculateHierarchyChildLength(e),this.calculateExpandedRowHeight(e.childRecords.length,t,i))},a.prototype.calculateCollapsedRowHeight=function(e){return this.parent.rowHeight-e},a.prototype.calculateHierarchyChildLength=function(e){if(!e.childRecords||0===e.childRecords.length)return 0;for(var t=0,i=0,a=this.getHierarchyChildRecords(e.childRecords);i<a.length;i++){var n=a[i];0!==n.childRecords.length&&n.expanded&&(t+=n.childRecords.length)}return t},a.prototype.calculateExpandedRowHeight=function(e,t,i){return(e+t)*this.parent.rowHeight-i},a.prototype.renderRange=function(e,t){var i=0,a=this.parent.currentViewData.indexOf(t),n=(i=!this.parent.allowTaskbarOverlap&&this.parent.enableMultiTaskbar?(o=t.parentItem?this.parent.getParentTask(t.parentItem):null,t.parentItem&&o&&!o.expanded&&t.hasChildRecords&&!t.expanded?this.parent.getRowByIndex(this.parent.getRootParent(t,0).index).offsetTop:(n=this.parent.getRowByIndex(a).offsetTop,t.expanded?n+this.parent.rowHeight:n)):this.getTopValue(t),this.rangeViewContainer.querySelector(".rangeContainer"+t.ganttProperties.rowUniqueID)),r=(n&&n.remove(),ne.createElement("div",{className:"rangeContainer"+t.ganttProperties.rowUniqueID,styles:"top:"+i+"px; position: absolute;"}));if((0!==t.level||t.expanded||!ne.isNullOrUndefined(t.parentItem)||this.parent.enableMultiTaskbar)&&(!(0<t.level&&t.expanded)||this.parent.getRecordByID(t.parentItem.taskId).expanded)){for(var s=0;s<e.length;s++){var o,l=void 0,d=this.parent.chartRowsModule.ganttChartTableBody.childNodes,d=(l=this.parent.allowTaskbarOverlap||t.expanded||!this.parent.enableMultiTaskbar?this.getRangeHeight(t):(o=this.parent.getRootParent(t,0),a=this.resolveNextElement(o.expanded,a,this.parent.currentViewData.indexOf(o)),parseInt(d[a].style.height,10)-(this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)),ne.createElement("div",{className:Pt+" e-leftarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[s].left+e[s].width-5:e[s].left)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px;\n height: "+(l+1)+"px; border-right: 0px;\n z-index: "+("ProjectView"===this.parent.viewType?1<t.childRecords.length?t.childRecords.length+1:t.childRecords.length:6)})),l=ne.createElement("div",{className:Pt+" e-rightarc",styles:(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?e[s].left:e[s].left+e[s].width-5)+"px;\n top: "+Math.floor((this.parent.rowHeight-this.parent.chartRowsModule.taskBarHeight)/2)+"px; height: "+(l+1)+"px;\n border-left: 0px;\n z-index: "+("ProjectView"===this.parent.viewType?1<t.childRecords.length?t.childRecords.length+1:t.childRecords.length:6)});r.appendChild(d),r.appendChild(l),this.rangeViewContainer.appendChild(r)}this.parent.ganttChartModule.chartBodyContent.appendChild(this.rangeViewContainer)}},a.prototype.renderTimelineContainer=function(){this.chartTimelineContainer=ne.createElement("div",{className:me}),this.parent.enableRtl&&(this.chartTimelineContainer.style.borderLeftWidth="1px",this.chartTimelineContainer.style.borderRightWidth="0px"),this.chartTimelineContainer.setAttribute("role","presentation"),this.chartElement.appendChild(this.chartTimelineContainer)},a.prototype.renderBodyContainers=function(){this.chartBodyContainer=ne.createElement("div",{className:ue}),this.parent.enableHover&&this.chartBodyContainer.classList.add("e-chart-row-hover"),this.chartElement.appendChild(this.chartBodyContainer),this.scrollElement=ne.createElement("div",{className:"e-chart-scroll-container e-content",styles:"position:relative;"}),this.chartBodyContainer.appendChild(this.scrollElement),this.chartBodyContent=ne.createElement("div",{className:ce,styles:"position:relative; overflow:hidden "}),this.parent.virtualScrollModule&&this.parent.enableVirtualization||this.parent.enableTimelineVirtualization?this.parent.ganttChartModule.virtualRender.renderWrapper():this.scrollElement.appendChild(this.chartBodyContent),this.scrollObject=new Rt(this.parent);var e=0;ne.isNullOrUndefined(this.parent.toolbarModule)||ne.isNullOrUndefined(this.parent.toolbarModule.element)||(e=this.parent.toolbarModule.element.offsetHeight),this.scrollObject.setHeight(this.parent.ganttHeight-this.chartTimelineContainer.offsetHeight-e)},a.prototype.updateWidthAndHeight=function(){var e=0===this.parent.contentHeight?1<this.parent.flatData.length?36:0:this.parent.contentHeight,t=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0];e>=t.offsetHeight||"auto"===this.parent.height||t.offsetHeight-e<36?this.chartBodyContent.style.height=ne.formatUnit(e):(e=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight,t.offsetHeight>=e?this.chartBodyContent.style.height=t.offsetHeight-17+"px":this.chartBodyContent.style.height=t.offsetHeight+"px"),this.parent.timelineModule.isZoomToFit&&this.parent.enableTimelineVirtualization?this.chartBodyContent.style.width=this.resolveNextElement(this.parent.enableTimelineVirtualization&&this.parent.timelineModule.totalTimelineWidth>3*this.parent.element.offsetWidth,ne.formatUnit(3*this.parent.element.offsetWidth),ne.formatUnit(this.parent.timelineModule.totalTimelineWidth-this.parent.timelineModule.clientWidthDifference)):this.chartBodyContent.style.width=this.parent.enableTimelineVirtualization&&this.parent.timelineModule.totalTimelineWidth>3*this.parent.element.offsetWidth?ne.formatUnit(3*this.parent.element.offsetWidth):ne.formatUnit(this.parent.timelineModule.totalTimelineWidth),this.parent.timelineModule.isZoomedToFit&&this.parent.enableVirtualization&&(e=Math.abs(this.parent.timelineModule.totalTimelineWidth-this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].clientWidth),this.parent.ganttChartModule.chartBodyContent.style.width=ne.formatUnit(this.parent.timelineModule.totalTimelineWidth-e)),this.setVirtualHeight(),this.parent.notify("updateHeight",{}),this.parent.updateGridLineContainerHeight(),this.updateLastRowBottomWidth()},a.prototype.setVirtualHeight=function(){var e,t,i,a,n;this.parent.virtualScrollModule&&this.parent.enableVirtualization&&(ne.getValue("virtualTrack",this.parent.ganttChartModule.virtualRender).style.height=this.parent.treeGrid.element.getElementsByClassName("e-virtualtrack")[0].style.height,e=ne.getValue("wrapper",this.parent.ganttChartModule.virtualRender),t=this.parent.treeGrid.element.getElementsByClassName("e-virtualtable")[0].style.transform,n=document.getElementsByClassName("e-virtualtable")[1].style.transform,this.parent.enableTimelineVirtualization?(i=void 0,a=/translate(?:3d)?\(([^\)]+)\)/,i=""!==n?n.match(/translate.*\((.+)\)/)[1].split(", ")[0]:(n=this.parent.ganttChartModule.scrollElement.getElementsByClassName("e-virtualtable")[0].style.transform.match(a))?n[1].split(",")[0].trim():"0px",n=1<(a=(n=t.match(a))?n[1].split(","):[]).length?a[1].trim():"0px",e.style.transform="translate3d("+i+", "+n+", 0px) translateZ(0)"):e.style.transform=t)},a.prototype.updateLastRowBottomWidth=function(){var e,t;0<this.parent.currentViewData.length&&"auto"!==this.parent.height&&(t=(t=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.expandedRecords)[t.length-1],t=this.parent.currentViewData.indexOf(t),t=this.parent.getRowByIndex(t),(e=this.parent.chartRowsModule.ganttChartTableBody).querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow")&&ne.removeClass(e.querySelectorAll(".e-chart-row-cell.e-chart-row-border.e-lastrow"),"e-lastrow"),this.chartBodyContent.clientHeight<this.chartBodyContainer.clientHeight)&&t&&(ne.addClass(t.querySelectorAll("td"),"e-lastrow"),e=1<this.parent.flatData.length?36:0,(t=0===this.parent.contentHeight?e:this.parent.contentHeight)>=(e=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0]).offsetHeight||e.offsetHeight-t<36?this.chartBodyContent.style.height=ne.formatUnit(t):(t=this.parent.element.getElementsByClassName("e-chart-rows-container")[0].offsetHeight,e.offsetHeight>=t?this.chartBodyContent.style.height=e.offsetHeight-17+"px":this.chartBodyContent.style.height=e.offsetHeight+"px"))},a.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("renderPanels",this.renderChartContainer),this.parent.off("recordsUpdated",this.renderChartElements),this.parent.off("dataReady",this.renderInitialContents),this.parent.off("tree-grid-created",this.renderChartContents),this.parent.off("destroy",this.destroy))},a.prototype.ganttChartMouseDown=function(e){var t,i=!1;"touches"in e&&"touchstart"===e.type&&e instanceof TouchEvent&&e.touches&&2===e.touches.length&&(this.initPinchDistance=this.calculatePinchDistance(e.touches[0],e.touches[1]),this.isPinching=!0),this.parent.allowTaskbarDragAndDrop&&this.parent.editModule&&this.parent.editSettings.allowTaskbarEditing&&!this.isPinching&&("ChildDrag"!==(t=this.parent.editModule.taskbarEditModule.getTaskBarAction(e))&&"ParentDrag"!==t&&"MilestoneDrag"!==t&&"ManualParentDrag"!==t||(t={cancel:i,data:this.getRecordByTaskBar(e.target),target:e.target,chartRow:ne.closest(e.target,"tr")},this.parent.trigger("rowDragStartHelper",t),i=t.cancel)),this.isTouchMoved&&(this.isTouchMoved=!1),i||this.isPinching||(3!==e.which&&this.parent.editSettings.allowTaskbarEditing&&(this.parent.notify("chartMouseDown",e),this.parent.element.tabIndex=0),t=!1,(t=this.parent.editSettings.allowTaskbarEditing&&(this.parent.element.querySelector(".e-left-resize-gripper")||this.parent.element.querySelector(".e-left-connectorpoint-outer-div"))?!0:t)&&2!==e.button)||this.parent.editSettings.allowEditing&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&this.parent.treeGrid.endEdit()},a.prototype.calculatePinchDistance=function(e,t){var i=t.clientX-e.clientX,t=t.clientY-e.clientY;return Math.sqrt(i*i+t*t)},a.prototype.ganttChartMouseClick=function(e){this.parent.autoFocusTasks&&this.scrollToTarget(e),this.parent.notify("chartMouseClick",e)},a.prototype.ganttChartMouseUp=function(e){var t,i;"touchend"===e.type&&(this.initPinchDistance=null,this.isPinching=!1,t=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div"),ne.isNullOrUndefined(t)||t.remove(),t=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar")||this.parent.chartPane.querySelector(".e-clone-taskbar"),ne.isNullOrUndefined(t)||t.parentElement.parentElement.remove(),t=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-gantt-false-line"),ne.isNullOrUndefined(t)||this.parent.editModule.taskbarEditModule.removeFalseLine(!0)),0<this.parent.element.querySelectorAll(".e-editedbatchcell").length&&e.target&&ne.closest(e.target,"."+he)&&this.parent.treeGrid.saveCell(),this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseUp",e),this.parent.editSettings.allowEditing||(t=!1,t=!!(this.parent.editSettings.allowTaskbarEditing&&ne.getValue("editModule.taskbarEditModule.isMouseDragged",this.parent)&&ne.getValue("editModule.taskbarEditModule.taskBarEditAction",this.parent))||t)||(t=e.target,i=e.target.classList.contains(ve)||ne.closest(e.target,"."+ve),!ne.closest(t,".e-gantt-parent-taskbar")||this.parent.editSettings.allowEditing||this.parent.isAdaptive?i||!this.parent.autoFocusTasks||this.isTouchMoved||this.scrollToTarget(e):this.chartExpandCollapseRequest(e))},a.prototype.scrollToTarget=function(e){var t,i=ne.closest(e.target,"tr");i&&this.parent.element.contains(i)&&(this.parent.element.querySelectorAll(".e-chart-rows-container")[0].contains(e.target)||this.parent.element.querySelectorAll(".e-gridcontent")[0].contains(e.target))&&0<this.parent.currentViewData.length&&(i=ne.getValue("rowIndex",ne.closest(e.target,"tr")),e=this.parent.currentViewData[i].ganttProperties.startDate,t=this.parent.currentViewData[i].ganttProperties.left,ne.isNullOrUndefined(e)||(e=this.resolveNextElement(!this.parent.enableTimelineVirtualization,this.parent.dataOperation.getTaskLeft(e,!1,this.parent.currentViewData[i].ganttProperties.calendarContext),{}),this.parent.autoFocusTasks&&(this.parent.enableTimelineVirtualization?this.updateScrollLeft(t):this.updateScrollLeft(e))))},a.prototype.updateScrollLeft=function(e){e=this.scrollElement.scrollWidth<=(e=0<e?e:0)?this.scrollElement.scrollWidth:e,(this.scrollElement.offsetWidth+this.parent.ganttChartModule.scrollElement.scrollLeft<e||this.scrollElement.scrollLeft>e)&&this.scrollObject.setScrollLeft(e-50,this.parent.enableRtl?-1:0)},a.prototype.mouseUp=function(e){"touchend"===e.type&&(this.initPinchDistance=null,this.isPinching=!1),ne.isNullOrUndefined(this.parent.editModule)||ne.isNullOrUndefined(this.parent.editModule.taskbarEditModule)||this.parent.editModule.taskbarEditModule.removeFalseLine(!1);var t=this.parent.element.querySelector(".e-taskbar-resize-div");ne.isNullOrUndefined(t)||t.remove(),this.parent.allowTaskbarDragAndDrop&&this.parent.editModule&&this.parent.editModule.taskbarEditModule&&(this.parent.editModule.taskbarEditModule.previousLeftValue=0),this.parent.allowRowDragAndDrop&&(t=this.parent.element.querySelector(".e-ganttdrag"))&&t.remove(),this.isGanttElement||this.parent.notify("chartMouseUp",e),this.isGanttElement=!1,this.isTouchMoved=!1},a.prototype.documentMouseUp=function(e){var t,i,a;"touchend"===e.type&&(this.initPinchDistance=null,this.isPinching=!1,this.previousPinchDistance=0),0<this.parent.element.querySelectorAll(".e-editedbatchcell").length&&e.target&&ne.closest(e.target,"."+he)&&this.parent.treeGrid.saveCell(),this.isGanttElement=!0,(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse"))&&!0===ne.getValue("isEditCollapse",this.parent.treeGrid)&&ne.setValue("isEditCollapse",!1,this.parent.treeGrid),this.parent.allowRowDragAndDrop&&(t=this.parent.element.querySelector(".e-ganttdrag"))&&t.remove(),this.parent.isDestroyed||3===e.which||(t=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div"),ne.isNullOrUndefined(t)||t.remove(),t=this.parent.element.getElementsByClassName("e-clone-taskbar")[0],ne.isNullOrUndefined(t)||t.parentElement.parentElement.remove(),t=!1,this.parent.editSettings.allowTaskbarEditing&&ne.getValue("editModule.taskbarEditModule.isMouseDragged",this.parent)&&ne.getValue("editModule.taskbarEditModule.taskBarEditAction",this.parent)&&(t=!0),this.parent.notify("chartMouseUp",e),this.parent.showActiveElement&&(this.parent.showIndicator=!0,!e.target.classList.contains("e-split-bar"))&&this.focusedElement&&(this.focusedElement.tabIndex=0===this.focusedElement.tabIndex?-1:this.focusedElement.tabIndex,ne.removeClass([this.focusedElement],"e-active-container")),t||(i=e.target,a=e.target.classList.contains(ve)||ne.closest(e.target,"."+ve),ne.closest(i,".e-gantt-parent-taskbar")&&!this.parent.editSettings.allowEditing?this.chartExpandCollapseRequest(e):a||!this.parent.autoFocusTasks||this.isTouchMoved||this.scrollToTarget(e)),this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.removeFalseLine(!0),!t&&!ne.isNullOrUndefined(this.parent.onTaskbarClick)&&(i=e.target,a=ne.closest(i,".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone"))&&this.onTaskbarClick(e,i,a))},a.prototype.onTaskbarClick=function(e,t,i){var a,n=ne.closest(t,"tr"),n=(ne.isNullOrUndefined(n)||(a=ne.getValue("rowIndex",n)),this.getRecordByTarget(e));this.parent.trigger("onTaskbarClick",{data:n,taskbarElement:i,rowIndex:a,target:t})},a.prototype.ganttChartLeave=function(e){this.parent.editSettings.allowTaskbarEditing&&this.parent.notify("chartMouseLeave",e)},a.prototype.ganttChartMove=function(e){var t;if("touches"in e&&"touchmove"===e.type&&!0===this.isPinching&&e instanceof TouchEvent&&e.touches&&2===e.touches.length&&(t=this.calculatePinchDistance(e.touches[0],e.touches[1]),15<Math.abs(this.previousPinchDistance-t))&&(t>this.previousPinchDistance?this.parent.timelineModule.processZooming(!0):t<this.previousPinchDistance&&this.parent.timelineModule.processZooming(!1),this.previousPinchDistance=t),"touches"in e&&e instanceof TouchEvent&&"touchmove"===e.type&&(this.isTouchMoved=!0),this.parent.editSettings.allowTaskbarEditing&&!1===this.isPinching){if(!this.parent.enableRtl&&0<this.parent.element.getElementsByClassName("e-clone-taskbar").length)if(("touchmove"===e.type||"touchstart"===e.type||"touchend"===e.type?e.changedTouches[0]:e).pageX<=this.parent.getOffsetRect(this.parent.ganttChartModule.chartElement).left)return;this.parent.notify("chartMouseMove",e),!ne.isNullOrUndefined(this.parent.taskFields.dependency)&&this.parent.connectorLineEditModule&&this.parent.connectorLineEditModule.updateConnectorLineEditElement(e)}},a.prototype.contextClick=function(e){this.parent.allowFiltering&&this.parent.filterModule&&this.parent.filterModule.closeFilterOnContextClick(e.srcElement),0<this.parent.element.querySelectorAll(".e-focused").length&&this.parent.element.querySelectorAll(".e-focused").forEach(function(e){e.classList.remove("e-focused")}),this.parent.allowTaskbarDragAndDrop&&(e=this.parent.chartPane.querySelector(".e-clone-taskbar"),ne.isNullOrUndefined(e)||e.parentElement.parentElement.remove())},a.prototype.mouseMoveHandler=function(e){if((this.parent.flatData.length||e.target.classList.contains("e-header-cell-label")||e.target.classList.contains("e-headercell"))&&!ne.isNullOrUndefined(this.parent.onMouseMove)){var t=e.target,i={originalEvent:e},a=ne.closest(t,".e-chart-row-cell,.e-connector-line-container,.e-event-markers,.e-header-cell-label,.e-rowcell,.e-headercell,.e-indicator-span");if(a){var n,r=void 0,s=ne.closest(t,".e-rowcell,.e-chart-row-cell"),o=ne.closest(t,".e-rowcell,.e-headercell");if(s&&(r=this.parent.ganttChartModule.getRecordByTarget(e),i.data=r),o&&(s=ne.getValue("cellIndex",o),i.column=this.parent.treeGrid.columns[s]),ne.closest(t,".e-indicator-span")){var l=0,d=r.ganttProperties.indicators;if(1<d.length)for(l=0;l<d.length&&d[l].name!==a.innerText.trim();l++);i.indicator=d[l]}ne.closest(t,".e-connector-line-container")&&((n={}).target=a,i.predecessor=this.parent.tooltipModule.getPredecessorTooltipData(n)),ne.closest(t,".e-event-markers")&&((n={}).target=a,i.eventMarkers=this.parent.tooltipModule.getMarkerTooltipData(n)),t.classList.contains("e-header-cell-label")&&(i.date=new Date(t.dataset.content))}this.parent.trigger("onMouseMove",i)}},a.prototype.doubleClickHandler=function(e){var t=e.target,i=ne.closest(t,"tr"),a=ne.getValue("rowIndex",i),n=this.parent.ganttChartModule.getRecordByTarget(e),e=(this.parent.editSettings.allowEditing&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&this.parent.treeGrid.endEdit(),this.parent.notify("chartDblClick",e),{row:i,rowData:n,rowIndex:a,target:t});this.recordDoubleClick(e)},a.prototype.recordDoubleClick=function(e){this.parent.trigger("recordDoubleClick",e)},a.prototype.getRecordByTarget=function(e){var t,i=ne.closest(e.target,"div."+ve);return ne.isNullOrUndefined(i)?(i=ne.closest(e.target,"tr"))&&(e=ne.getValue("rowIndex",ne.closest(e.target,"tr")),t=this.parent.currentViewData[e]):(e=i.getAttribute("rowUniqueId"),t=this.parent.getRecordByID(e)),t},a.prototype.getChartRows=function(){return null!==document.getElementById(this.parent.element.id+"GanttTaskTableBody")?document.getElementById(this.parent.element.id+"GanttTaskTableBody").querySelectorAll(".e-chart-row"):null},a.prototype.chartExpandCollapseRequest=function(e){var t,i,a;this.parent.enableMultiTaskbar||(i=e.target,t=ne.closest(i,".e-gantt-parent-taskbar"),e=this.getRecordByTarget(e),i=ne.closest(i,"tr"),a=ne.getValue("rowIndex",i),e={data:e,gridRow:this.parent.treeGrid.getRows()[a],chartRow:i,cancel:!1},this.isExpandCollapseFromChart=!0,t.classList.contains("e-row-expand")?this.collapseGanttRow(e):t.classList.contains("e-row-collapse")&&this.expandGanttRow(e))},a.prototype.reRenderConnectorLines=function(){this.parent.connectorLineModule.dependencyViewContainer.innerHTML="",this.parent.connectorLineIds=[],this.parent.updatedConnectorLineCollection=[],this.parent.predecessorModule.createConnectorLinesCollection(),this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);var e=this.parent.criticalPathModule;this.parent.enableCriticalPath&&e&&e.criticalPathCollection&&e.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds)},a.prototype.collapseGanttRow=function(e){var t=this;this.parent.trigger("collapsing",e,function(e){t.isExpandCollapseFromChart&&!ne.getValue("cancel",e)&&t.collapsedGanttRow(e),t.isExpandCollapseFromChart=!1})},a.prototype.collapsedGanttRow=function(t){var i,e,a=this,n=this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.currentViewData.filter(function(e){return e.ganttProperties[a.parent.taskFields.id]===t.data[a.parent.taskFields.id]})[0]:ne.getValue("data",t);ne.isNullOrUndefined(t.gridRow)&&this.parent.enableVirtualization||ne.isNullOrUndefined(t.chartRow)?n&&(n.expanded=!1):(this.isExpandCollapseFromChart?(this.expandCollapseChartRows("collapse",ne.getValue("chartRow",t),n,null),i=this.parent.taskFields.id,this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(e=this.parent.treeGrid.getCurrentViewRecords().filter(function(e){return e[i]===t.data[i]})[0],this.parent.treeGrid.collapseRow(ne.getValue("gridRow",t),e)):this.parent.treeGrid.collapseRow(ne.getValue("gridRow",t),n),this.isExpandCollapseFromChart=!1):this.expandCollapseChartRows("collapse",ne.getValue("chartRow",t),n,null),this.parent.enableMultiTaskbar&&this.parent.chartRowsModule.refreshRecords([n],!0),ne.getValue("chartRow",t).setAttribute("aria-expanded","false"))},a.prototype.expandGanttRow=function(e){var t=this;this.parent.trigger("expanding",e,function(e){t.isExpandCollapseFromChart&&!ne.getValue("cancel",e)&&t.expandedGanttRow(e),t.isExpandCollapseFromChart=!1})},a.prototype.expandedGanttRow=function(t){var i,e,a=this,n=this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.currentViewData.filter(function(e){return e.ganttProperties.taskId===t.data[a.parent.taskFields.id]})[0]:ne.getValue("data",t);ne.isNullOrUndefined(t.gridRow)&&this.parent.enableVirtualization||ne.isNullOrUndefined(t.chartRow)?n&&(n.expanded=!0):(this.isExpandCollapseFromChart?(this.expandCollapseChartRows("expand",ne.getValue("chartRow",t),n,null),i=this.parent.taskFields.id,this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(e=this.parent.treeGrid.getCurrentViewRecords().filter(function(e){return e[i]===t.data[i]})[0],this.parent.treeGrid.expandRow(ne.getValue("gridRow",t),e)):this.parent.treeGrid.expandRow(ne.getValue("gridRow",t),n),this.isExpandCollapseFromChart=!1):(this.parent.isExpandCollapseLevelMethod||this.expandCollapseChartRows("expand",ne.getValue("chartRow",t),n,null),this.parent.isExpandCollapseLevelMethod=!1),this.parent.enableMultiTaskbar&&this.parent.chartRowsModule.refreshRecords([n],!0),ne.getValue("chartRow",t).setAttribute("aria-expanded","true"))},a.prototype.expandCollapseChartRows=function(e,t,i,a){var n;if("expand"===e){n="table-row",a||(i.expanded=!0);for(var r=t.querySelectorAll(".e-row-collapse"),s=0;s<r.length;s++)ne.addClass([r[s]],"e-row-expand"),ne.removeClass([r[s]],"e-row-collapse")}else if("collapse"===e){n="none",a||(i.expanded=!1);for(r=t.querySelectorAll(".e-row-expand"),s=0;s<r.length;s++)ne.addClass([r[s]],"e-row-collapse"),ne.removeClass([r[s]],"e-row-expand")}if(!this.parent.enableVirtualization){for(var o=i.childRecords,l=this.getChartRows(),d=[],h=0;h<l.length;h++)l[h].classList.contains("gridrowtaskId"+i.ganttProperties.rowUniqueID+"level"+(i.level+1))&&d.push(l[h]);for(h=0;h<d.length;h++)d[h].style.display=n,!ne.isNullOrUndefined(o[h])&&o[h].childRecords&&o[h].childRecords.length&&("collapse"===e||o[h].expanded||this.isExpandAll)&&this.expandCollapseChartRows(e,d[h],o[h],!0)}},a.prototype.expandCollapseAll=function(e){"expand"===e?(this.isExpandAll=!0,this.parent.treeGrid.expandAll()):(this.isCollapseAll=!0,this.parent.treeGrid.collapseAll(),this.isCollapseAll&&!this.parent.allowTaskbarOverlap&&(e=(this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2].children[0]:this.parent.element.getElementsByClassName("e-content")).offsetHeight,this.parent.contentHeight=e,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")),this.isExpandAll=!1,this.isCollapseAll=!1},a.prototype.expandAtLevel=function(e){this.parent.treeGrid.expandAtLevel(e)},a.prototype.collapseAtLevel=function(e){this.parent.enableVirtualization&&(this.parent.isExpandCollapseLevelMethod=!0),this.parent.treeGrid.collapseAtLevel(e)},a.prototype.wireEvents=function(){var t,i=this,e=ne.Browser.isPointer,a=ne.Browser.touchStartEvent,n=ne.Browser.touchEndEvent,r=ne.Browser.touchMoveEvent,e=this.resolveNextElement(!!e,"pointerleave","mouseleave");ne.EventHandler.add(this.parent.chartPane,a,this.ganttChartMouseDown,this),ne.EventHandler.add(this.parent.chartPane,e,this.ganttChartLeave,this),ne.EventHandler.add(this.parent.chartPane,r,this.ganttChartMove,this),ne.EventHandler.add(this.parent.chartPane,"wheel",this.onWheelZoom,this),this.parent.isAdaptive&&(ne.EventHandler.add(this.parent.chartRowsModule.ganttChartTableBody,"pointerdown",function(e){t?(clearTimeout(t),t=null,i.doubleClickHandler(e)):t=setTimeout(function(){t=null},200)},this),ne.EventHandler.add(this.parent.chartPane,T.click,this.ganttChartMouseClick,this),ne.EventHandler.add(this.parent.chartPane,n,this.ganttChartMouseUp,this)),this.parent.isAdaptive||(ne.EventHandler.add(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler,this),ne.EventHandler.add(this.parent.element,n,this.documentMouseUp,this),ne.EventHandler.add(document,n,this.mouseUp,this)),ne.EventHandler.add(this.parent.element,"mousemove",this.mouseMoveHandler,this),ne.EventHandler.add(document.body,"contextmenu",this.contextClick,this),ne.EventHandler.add(document,"mouseup",this.contextClick,this)},a.prototype.unWireEvents=function(){var e=ne.Browser.isPointer,t=ne.Browser.touchStartEvent,i=ne.Browser.touchEndEvent,a=ne.Browser.touchMoveEvent,e=this.resolveNextElement(!!e,"pointerleave","mouseleave");ne.isNullOrUndefined(this.parent.chartRowsModule.ganttChartTableBody)||ne.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,t,this.ganttChartMouseDown),ne.isNullOrUndefined(this.parent.chartPane)||(ne.EventHandler.remove(this.parent.chartPane,e,this.ganttChartLeave),ne.EventHandler.remove(this.parent.chartPane,a,this.ganttChartMove),ne.EventHandler.remove(this.parent.chartPane,"wheel",this.onWheelZoom),ne.EventHandler.remove(this.parent.chartPane,t,this.ganttChartMouseDown)),this.parent.isAdaptive&&!ne.isNullOrUndefined(this.parent.chartPane)&&(ne.EventHandler.remove(this.parent.chartPane,T.click,this.ganttChartMouseClick),ne.EventHandler.remove(this.parent.chartPane,i,this.ganttChartMouseUp)),this.parent.isAdaptive||(ne.isNullOrUndefined(this.parent.element)||ne.EventHandler.remove(this.parent.element,i,this.documentMouseUp),ne.isNullOrUndefined(document))||ne.EventHandler.remove(document,i,this.mouseUp),ne.isNullOrUndefined(this.parent.element)||ne.EventHandler.remove(this.parent.element,"mousemove",this.mouseMoveHandler),ne.isNullOrUndefined(document)||(ne.EventHandler.remove(document,"mouseup",this.contextClick),ne.isNullOrUndefined(document.body))||ne.EventHandler.remove(document.body,"contextmenu",this.contextClick),ne.isNullOrUndefined(this.parent.chartRowsModule.ganttChartTableBody)||ne.EventHandler.remove(this.parent.chartRowsModule.ganttChartTableBody,"dblclick",this.doubleClickHandler)},a.prototype.isTouchpad=function(e){return Math.abs(e)<75},a.prototype.updateDebounceTimeout=function(){this.debounceTimeout&&(this.debounceTimeoutNext+20>this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeoutNext+20<=this.debounceTimeout)&&(this.debounceTimeoutNext=this.debounceTimeout)},a.prototype.performZoomCheck=function(e,t,i){e=Math.abs(e);(i?.5<e&&e<15:5<e&&e<=200)&&this.parent.timelineModule.processZooming(t)},a.prototype.onWheelZoom=function(e){var t,i;e.ctrlKey&&(e.preventDefault(),t=e.deltaY<0,i=this.isTouchpad(e.deltaY),this.updateDebounceTimeout(),this.debounceTimeout=setTimeout(function(){this.performZoomCheck(e.deltaY,t,i)}.bind(this),100))},a.prototype.getRecordByTaskBar=function(e){return this.parent.flatData[this.getIndexByTaskBar(e)]},a.prototype.updateElement=function(e,t,i,a,n){if(this.parent.ganttColumns[parseInt(e.getAttribute("aria-colindex"),10)-1].field===this.parent.taskFields.progress){for(var r=n.index;n.hasChildRecords&&(e=this.getNextElement(e,i,a)),t=this.parent.ganttColumns[parseInt(e.getAttribute("aria-colindex"),10)-1],r=this.parent.treeGrid.getRows().indexOf(e.parentElement),!t.allowEditing;);this.parent.treeGrid.saveCell(),this.parent.treeGrid.editCell(r,this.parent.ganttColumns[parseInt(e.getAttribute("aria-colindex"),10)-1].field)}return e},a.prototype.resolveNextElement=function(e,t,i){return e?t:i},a.prototype.onTabAction=function(e){this.parent.treeGrid.grid.enableHeaderFocus=this.parent.enableHeaderFocus;var t=document.getElementsByClassName("e-toolbar-item"),i=this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit;if(i||this.parent.showActiveElement){var a=i?e.target.closest(".e-rowcell"):e.target,n=((a=0<this.parent.element.querySelectorAll(".e-focused").length?this.parent.element.querySelectorAll(".e-focused")[0]:a)&&!(a.classList.contains("e-toolbar-item")||a.classList.contains("e-input")||a.classList.contains("e-btn"))&&(this.currentToolbarIndex=-1),(a.closest(".e-rowcell")||a.closest(".e-chart-row"))&&this.parent.focusModule.setActiveElement(a),this.focusedRowIndex=a.closest(".e-rowcell")?a.parentElement.rowIndex:a.closest(".e-chart-row")?a.closest(".e-chart-row").rowIndex:-1,"tab"===e.action),r=this.getNextElement(a,n,i);if(r&&("noNextRow"===r||r.classList.contains("e-rowdragheader"))&&("noNextRow"===r&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&this.parent.treeGrid.saveCell(),r=null),r&&a.classList.contains("e-headercell")){var s=parseInt(r.getAttribute("aria-colindex"),10)-1;if("shiftTab"===e.action){for(;-1!==s&&!this.parent.treeGrid.columns[s].visible;)s-=1;if(-1!==s)s=this.resolveNextElement(this.parent.allowRowDragAndDrop,s+1,s),r=document.getElementsByClassName("e-columnheader")[0].childNodes[s];else for(var o=document.getElementsByClassName("e-toolbar-item").length-1;0<o;o--)if(!document.getElementsByClassName("e-toolbar-item")[o].classList.contains("e-hidden")){r=document.getElementsByClassName("e-toolbar-item")[o],this.currentToolbarIndex=o;break}}else{for(;!this.parent.treeGrid.columns[s].visible;)s+=1;s=this.parent.allowRowDragAndDrop?s+1:s,r=document.getElementsByClassName("e-columnheader")[0].childNodes[s]}}if(this.parent.toolbarModule&&0<this.parent.toolbar.length&&(a.classList.contains("e-headercell")||a.classList.contains("e-toolbar-item")||a.classList.contains("e-treegrid")||a.classList.contains("e-input")||a.classList.contains("e-btn"))&&!r){var l=-1!==this.currentToolbarIndex?this.resolveNextElement("tab"===e.action,this.currentToolbarIndex+1,this.currentToolbarIndex-1):this.resolveNextElement("shiftTab"===e.action,t.length-1,1),d=!1;if(-1!==l&&("shiftTab"===e.action||"tab"===e.action&&l<t.length))for(;t[l].classList.contains("e-hidden")?"tab"===e.action?l++:l--:((r=t[l]).setAttribute("tabindex","-1"),r.querySelector(".e-btn")===a&&("tab"===e.action?l++:l--,r=t[l]),r.querySelector(".e-btn")&&r.querySelector(".e-btn").setAttribute("tabindex","0"),d=!0,this.currentToolbarIndex=l),!d;);}if("tab"===e.action&&!r&&this.currentToolbarIndex===t.length-1&&(a.classList.contains("e-toolbar-item")||a.classList.contains("e-input")||a.classList.contains("e-btn")))for(o=0;o<this.parent.treeGrid.columns.length;o++)if(this.parent.treeGrid.columns[o].visible){r=document.getElementsByClassName("e-columnheader")[0].childNodes[o];break}if(this.tempNextElement=r,ne.isNullOrUndefined(r)||ne.isNullOrUndefined(r.cellIndex)||(this.parent.allowRowDragAndDrop?(this.childrenIndex=r.cellIndex,this.nextElementIndex=r.cellIndex-1):(this.childrenIndex=r.cellIndex,this.nextElementIndex=r.cellIndex),-1===this.nextElementIndex||this.parent.ganttColumns[this.nextElementIndex].allowEditing||this.parent.ganttColumns[this.nextElementIndex].field===this.parent.taskFields.id?this.isEditableElement=!1:this.isEditableElement=!0),ne.isNullOrUndefined(r)||"noNextRow"===r)this.manageFocus(a,"remove",!0);else if("string"!=typeof r)if(a.closest(".e-chart-row-cell")&&r.closest(".e-rowcell")&&(this.preventScrollIntoView=!0),(a.classList.contains("e-rowcell")||a.closest(".e-chart-row-cell")||a.classList.contains("e-headercell")||a.closest(".e-segmented-taskbar"))&&e.preventDefault(),n&&a.classList.contains("e-rowdragdrop"))this.parent.treeGrid.grid.notify("key-pressed",e);else{if(a.classList.contains("e-rowcell")&&r&&r.classList.contains("e-rowcell")||a.classList.contains("e-headercell"))if(n){if(this.parent.editSettings.allowNextRowEdit){var h=this.parent.currentViewData[this.focusedRowIndex],p=this.parent.ganttColumns[parseInt(r.getAttribute("aria-colindex"),10)-1].field;h.hasChildRecords?p===this.parent.taskFields.endDate||p===this.parent.taskFields.duration||p===this.parent.taskFields.dependency||p===this.parent.taskFields.progress||p===this.parent.taskFields.work||p===this.parent.taskFields.type||"taskType"===p?(this.parent.treeGrid.grid.endEdit(),this.parent.treeGrid.grid.notify("key-pressed",e)):p===this.parent.taskFields.name||p===this.parent.taskFields.startDate?this.parent.treeGrid.grid.notify("key-pressed",e):(this.parent.treeGrid.grid.notify("key-pressed",e),i&&this.parent.treeGrid.editCell(this.focusedRowIndex,p)):this.parent.treeGrid.grid.notify("key-pressed",e)}else if(!r||!r.classList.contains("e-headercell")){a.classList.contains("e-headercell")&&this.manageFocus(a,"remove",!1);var u=r;if(!(g=this.parent.currentViewData[a.parentElement.rowIndex]).hasChildRecords||this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].field!==this.parent.taskFields.progress&&this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].allowEditing||this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].field===this.parent.taskFields.id||!a.classList.contains("e-editedbatchcell"))r&&!a.classList.contains("e-editedbatchcell")||this.parent.treeGrid.grid.notify("key-pressed",e);else{var c=void 0;for(u=this.updateElement(u,c,n,i,g);!this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].allowEditing;)u=this.getNextElement(u,n,i);u=this.updateElement(u,c,n,i,g)}}}else if(r&&!r.classList.contains("e-headercell")&&r.classList.contains("e-rowcell")&&!r.classList.contains("e-toolbar-item")){var g,u=r;if(!(g=this.parent.currentViewData[a.parentElement.rowIndex]).hasChildRecords||this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].field!==this.parent.taskFields.progress&&this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].allowEditing||this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].field===this.parent.taskFields.id||!a.classList.contains("e-editedbatchcell"))if(parseInt(u.parentElement.getAttribute("aria-rowindex"),10)-1!=0&&parseInt(u.getAttribute("aria-colindex"),10)-1==0&&this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].field===this.parent.taskFields.id&&a.classList.contains("e-editedbatchcell")){var p=a.parentElement.rowIndex,p=this.getNextRowElement(p,n,!0);if(u=this.getChildElement(p,n),!(h=this.parent.flatData[parseInt(p.getAttribute("aria-rowindex"),10)-1]).hasChildRecords||this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].allowEditing&&this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].field!==this.parent.taskFields.progress)this.parent.treeGrid.grid.notify("key-pressed",e);else{c=void 0;for(u=this.updateElement(u,c,n,i,h);!this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].allowEditing;)u=this.getNextElement(u,n,i);u=this.updateElement(u,c,n,i,h)}}else this.parent.treeGrid.grid.notify("key-pressed",e);else{var c=void 0;for(u=this.updateElement(u,c,n,i,g);!this.parent.ganttColumns[parseInt(u.getAttribute("aria-colindex"),10)-1].allowEditing;)u=this.getNextElement(u,n,i);u=this.updateElement(u,c,n,i,g)}}0<this.parent.element.querySelectorAll(".e-focused").length&&this.manageFocus(this.parent.element.querySelectorAll(".e-focused")[0],"remove",!1),this.parent.editModule&&this.parent.editModule.cellEditModule&&!ne.isNullOrUndefined(this.parent.editModule.cellEditModule.editedColumn)||r&&(a.classList.contains("e-rowcell")?this.manageFocus(a,"remove",!1):this.manageFocus(a,"remove",!0),p=ne.getValue("focusModule",this.parent.treeGrid.grid),r.classList.contains("e-rowcell")&&a.nextElementSibling||a.classList.contains("e-right-label-container")?(h=this.resolveNextElement(r.parentElement.classList.contains("e-chart-row-cell"),r.parentElement.parentElement,r.parentElement),a.classList.contains("e-rowcell")||this.parent.treeGrid.grid.notify("key-pressed",e),this.manageFocus(r,"add",!1),p.currentInfo.element=r,p.currentInfo.elementToFocus=r,p.content.matrix.current=[h.rowIndex,r.cellIndex]):r&&(r.classList.contains("e-toolbar-item")||r.classList.contains("e-headercell")||r.classList.contains("e-rowcell"))?(this.manageFocus(a,"remove",!1),r.classList.contains("e-toolbar-item")||this.manageFocus(r,"add",!1),a.classList.contains("e-treegrid")&&e.preventDefault()):this.manageFocus(r,"add",!0),this.parent.focusModule.setActiveElement(r))}}},a.prototype.getNextElement=function(e,t,i){var a=t?e.nextElementSibling:e.previousElementSibling;if(e.parentElement.classList.contains("e-taskbar-main-container")){if(this.parent.labelSettings.rightLabel&&t)return e.parentElement.nextElementSibling;if(!t&&this.parent.labelSettings.leftLabel)return e.parentElement.previousElementSibling}for(;a&&a.parentElement.classList.contains("e-row");){if(!a.matches(".e-hide")&&!a.matches(".e-rowdragdrop"))return a;a=t?a.nextElementSibling:a.previousElementSibling}if(ne.isNullOrUndefined(a)||!a.classList.contains("e-taskbar-main-container")&&!a.classList.contains("e-right-connectorpoint-outer-div")||(n=this.parent.currentViewData[this.focusedRowIndex],!ne.isNullOrUndefined(n.ganttProperties.segments)&&0<n.ganttProperties.segments.length&&(a=this.resolveNextElement(a.classList.contains("e-right-connectorpoint-outer-div"),a.parentElement.nextElementSibling,a.getElementsByClassName("e-gantt-child-taskbar-inner-div")[0]))),this.validateNextElement(a))return a;var n=-1,r=null;if(e.classList.contains("e-rowcell")&&i&&this.parent.editSettings.allowNextRowEdit)return n=e.parentElement.rowIndex,r=this.getNextRowElement(n,t,!0),this.getChildElement(r,t);if(e.classList.contains("e-rowcell"))if(n=e.parentElement.rowIndex,t){if(r=this.parent.getRowByIndex(n),0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length)return r=this.getNextRowElement(n,t,!0),this.getChildElement(r,t);if(this.validateNextElement(r,"e-left-label-container"))return r.getElementsByClassName("e-left-label-container")[0];if(this.validateNextElement(r,"e-taskbar-main-container"))return r.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(r,"e-right-label-container"))return r.getElementsByClassName("e-right-label-container")[0]}else{if(r=this.getNextRowElement(n,t,!1),this.validateNextElement(r,"e-right-label-container"))return r.getElementsByClassName("e-right-label-container")[0];if(this.validateNextElement(r,"e-taskbar-main-container"))return r.getElementsByClassName("e-taskbar-main-container")[0];if(this.validateNextElement(r,"e-left-label-container"))return r.getElementsByClassName("e-left-label-container")[0]}else if(e.parentElement.classList.contains("e-chart-row-cell")||e.parentElement.parentElement.classList.contains("e-chart-row-cell"))return n=ne.closest(e,".e-chart-row").rowIndex,r=t?this.getNextRowElement(n,t,!0):this.parent.treeGrid.getRows()[n],this.getChildElement(r,t);return a=e,null},a.prototype.getNextRowElement=function(e,t,i){var a=this.parent.expandedRecords,e=this.parent.currentViewData[e],e=a.indexOf(e),t=t?a[e+1]:a[e-1],a=this.parent.currentViewData.indexOf(t);return t?i?this.parent.treeGrid.getRows()[a]:this.parent.getRowByIndex(a):null},a.prototype.validateNextElement=function(e,t){return!((!e||!e.classList.contains("e-rowcell"))&&(e&&t?!(t=e.getElementsByClassName(t)[0])||!t.hasChildNodes():!e||ne.isNullOrUndefined(e)||!e.hasChildNodes()))},a.prototype.getChildElement=function(e,t){var i;if(!e)return"noNextRow";for(i=t?e.children[0]:e.children[e.children.length-1];i;){if(!i.matches(".e-hide")&&!i.matches(".e-rowdragdrop"))return i;i=t?i.nextElementSibling:i.previousElementSibling}return i},a.prototype.manageFocus=function(e,t,i,a){var n;i?(i=null,e.classList.contains("e-left-label-container")||e.classList.contains("e-right-label-container")?i=e.getElementsByTagName("span")[0]:(e.classList.contains("e-taskbar-main-container")||e.classList.contains("e-gantt-child-taskbar-inner-div"))&&(n=ne.closest(e,".e-chart-row").rowIndex,n=(n=this.parent.currentViewData[n]).hasChildRecords?n.ganttProperties.isAutoSchedule?"e-gantt-parent-taskbar":"e-manualparent-main-container":n.ganttProperties.isMilestone?"e-gantt-milestone":!ne.isNullOrUndefined(n.ganttProperties.segments)&&0<n.ganttProperties.segments.length?"e-segmented-taskbar":"e-gantt-child-taskbar",i=e.getElementsByClassName(n)[0],ne.isNullOrUndefined(i))&&(i=e),(e.classList.contains("e-right-label-temp-container")||e.classList.contains("e-left-label-temp-container")||e.classList.contains("e-indicator-span"))&&("add"===t?(e.setAttribute("tabIndex","0"),ne.addClass([e],"e-active-container"),e.focus()):(ne.removeClass([e],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur())),"add"!==t||ne.isNullOrUndefined(i)?ne.isNullOrUndefined(i)||(ne.removeClass([i],"e-active-container"),e.setAttribute("tabIndex","-1"),e.blur()):(e.setAttribute("tabIndex","0"),ne.addClass([i],"e-active-container"),e.focus(),this.focusedElement=i)):"add"===t?(e.setAttribute("tabIndex","0"),ne.addClass([e],["e-focused","e-focus"]),this.preventScrollIntoView||e.scrollIntoView({block:"nearest",inline:"nearest"}),this.preventScrollIntoView=!1,e.focus()):(e.setAttribute("tabIndex","-1"),ne.removeClass([e],["e-focused","e-focus"]),e.blur())},a.prototype.getIndexByTaskBar=function(e){var t=e.classList.contains(ve)?e:ne.closest(e,"div."+ve);return ne.isNullOrUndefined(t)?(t=ne.closest(e,"tr."+Fe),[].slice.call(this.parent.chartRowsModule.ganttChartTableBody.childNodes).indexOf(t)):(e=t.getAttribute("rowUniqueId"),t=this.parent.getRecordByID(e),(!this.parent.enableVirtualization||!this.parent.enableMultiTaskbar)&&this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport&&t?this.parent.ids.indexOf(t.ganttProperties.taskId.toString()):this.parent.flatData.indexOf(t))},a.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.chartElement=null,this.rangeViewContainer=null,this.chartBodyContent=null,this.scrollElement=null,this.chartTimelineContainer=null,this.chartBodyContainer=null,ne.isNullOrUndefined(this.scrollObject)||(this.scrollObject.destroy(),this.scrollObject=null)};var Ot=a;function a(e){this.isExpandCollapseFromChart=!1,this.isExpandAll=!1,this.isCollapseAll=!1,this.isTouchMoved=!1,this.debounceTimeoutNext=0,this.debounceTimeout=0,this.isGanttElement=!1,this.previousPinchDistance=0,this.currentToolbarIndex=-1,this.isPinching=!1,this.preventScrollIntoView=!1,this.parent=e,this.chartTimelineContainer=null,this.rangeViewContainer=ne.createElement("div",{className:St}),this.rangeViewContainer.setAttribute("role","button"),this.rangeViewContainer.setAttribute("aria-label","RangeContainer"),this.virtualRender=new Mt(this.parent),this.addEventListener()}n.prototype.initProperties=function(){this.timelineStartDate=null,this.timelineEndDate=null,this.totalTimelineWidth=0,this.customTimelineSettings=null,this.parent.isTimelineRoundOff=!this.isZoomToFit&&!("auto"!==this.parent.timelineSettings.viewEndDate||"auto"!==this.parent.timelineSettings.viewStartDate||!ne.isNullOrUndefined(this.parent.projectStartDate)),this.parent.enablePersistence&&this.parent.isLoad&&(this.parent.timelineSettings=this.parent.currentZoomingLevel)},n.prototype.validateTimelineProp=function(){this.roundOffDays(),this.processTimelineProperty(),this.timelineWidthCalculation()},n.prototype.refreshTimeline=function(){this.initProperties(),this.processTimelineUnit(),this.parent.undoRedoModule&&(!this.parent.undoRedoModule||this.parent.undoRedoModule.isZoomingUndoRedoProgress)||this.parent.dataOperation.calculateProjectDates(),this.parent.isFromOnPropertyChange||this.parent.updateTimelineDates(this.parent.cloneTimelineStartDate,this.parent.cloneTimelineEndDate,this.parent.isTimelineRoundOff);var e=this.parent.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight;this.parent.element.getElementsByClassName("e-gridcontent")[0].style.height="calc(100% - "+e+"px)",this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].style.height="calc(100% - "+e+"px)"},n.prototype.refreshTimelineByTimeSpan=function(){this.validateTimelineProp(),(!this.parent.pdfExportModule||this.parent.pdfExportModule&&!this.parent.pdfExportModule.isPdfExport||this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&!this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(this.parent.ganttChartModule.chartTimelineContainer.innerHTML=""),this.createTimelineSeries()},n.prototype.updateChartByNewTimeline=function(){this.parent.chartRowsModule.refreshChartByTimeline();var e=this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollLeft;this.parent.element.getElementsByClassName("e-timeline-header-container")[0].scrollLeft=e,this.parent.notify("refreshDayMarkers",{}),"Vertical"!==this.parent.gridLines&&"Both"!==this.parent.gridLines||this.parent.renderChartGridLines()},n.prototype.processZooming=function(e){this.parent.isReact&&this.parent.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","BaselineTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.isZoomToFit=this.isZoomedToFit=!1,this.updateUndoRedo(e),this.parent.isProjectDateUpdated||this.parent.dateValidationModule.calculateProjectDates(),this.parent.zoomingProjectStartDate&&(this.parent.cloneProjectStartDate=this.parent.zoomingProjectStartDate,this.parent.cloneProjectEndDate=this.parent.zoomingProjectEndDate),this.parent.zoomingProjectStartDate=this.parent.zoomingProjectEndDate=null;var t=this.checkCurrentZoomingLevel(),i=(this.isZoomIn=e,this.isZoomOut=!e,this.isZooming=!0,this.getZoomLevel(t,e)),i=(this.updateToolbar(i,e),this.parent.zoomingLevels.findIndex(function(e){return e.level===i})),t={requestType:e?"beforeZoomIn":"beforeZoomOut",timeline:this.parent.zoomingLevels[i],cancel:!1};this.parent.trigger("actionBegin",t),t.cancel||(this.parent.showLoadingIndicator(),this.changeTimelineSettings(t.timeline)),this.isZooming=!1,this.updateTimelineSettingsAfterZooming()},n.prototype.updateUndoRedo=function(e){var e=e?"ZoomIn":"ZoomOut";this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent(e)&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(e={action:e,previousZoomingLevel:ne.extend({},{},this.parent.currentZoomingLevel,!0)}).previousZoomingLevel.bottomTier.format=this.customTimelineSettings.bottomTier.format,e.previousZoomingLevel.topTier.format=this.customTimelineSettings.topTier.format,this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=e)},n.prototype.getZoomLevel=function(e,t){var i=e+(t?1:-1);return this.parent.zoomingLevels.find(function(e){return e.level===i})?i:e},n.prototype.updateToolbar=function(e,t){this.parent.toolbarModule&&(t?(e===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1),this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!0)):(e===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1),this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!0)))},n.prototype.changeTimelineSettings=function(i){var a=this,n=(this.isZoomToFit||this.isZooming?this.isSingleTier="None"===this.customTimelineSettings.topTier.unit||"None"===this.customTimelineSettings.bottomTier.unit:this.isSingleTier="None"===i.topTier.unit||"None"===i.bottomTier.unit,this.isSingleTier?"None"===this.customTimelineSettings.topTier.unit?"topTier":"bottomTier":null),e=(Object.keys(this.customTimelineSettings).forEach(function(e){var t;e!==n?a.customTimelineSettings[e]="object"!=typeof i[e]||ne.isNullOrUndefined(i[e])?i[e]:Object.assign({},i[e]):"None"!==i[t="bottomTier"].unit&&(a.customTimelineSettings["topTier"===e?"bottomTier":"topTier"]=Object.assign({},i[t]))}),this.parent.isTimelineRoundOff=!this.isZoomToFit&&!("auto"!==this.parent.timelineSettings.viewEndDate||"auto"!==this.parent.timelineSettings.viewStartDate||!ne.isNullOrUndefined(this.parent.projectStartDate)),this.processTimelineUnit(),this.parent.updateTimelineDates(this.parent.cloneTimelineStartDate,this.parent.cloneTimelineEndDate,this.parent.isTimelineRoundOff),this.parent.criticalPathModule),e=(this.parent.enableCriticalPath&&e&&e.criticalPathCollection&&e.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds),(this.isZooming||this.isZoomToFit)&&(e={requestType:this.isZoomIn?"AfterZoomIn":this.isZoomToFit?"AfterZoomToProject":"AfterZoomOut",timeline:this.parent.currentZoomingLevel},this.parent.trigger("actionComplete",e),this.parent.hideLoadingIndicator()),"None"===this.topTier?"bottomTier":"topTier");this.parent.enableTimelineVirtualization&&(!this.parent.pdfExportModule||this.parent.pdfExportModule&&!this.parent.pdfExportModule.isPdfExport)&&(this.wholeTimelineWidth=this.calculateWidthBetweenTwoDate(e,this.parent.timelineModule.timelineStartDate,this.parent.timelineModule.timelineEndDate),this.wholeTimelineWidth<=this.totalTimelineWidth&&(this.wholeTimelineWidth=this.totalTimelineWidth),this.isZoomToFit?(this.clientWidthDifference=Math.abs(this.wholeTimelineWidth-this.parent.element.getElementsByClassName("e-chart-scroll-container e-content")[0].clientWidth)+1,this.parent.element.querySelectorAll(".e-chart-scroll-container")[0].querySelector(".e-virtualtrack").style.width=this.wholeTimelineWidth-this.clientWidthDifference+"px",ne.isNullOrUndefined(this.parent.element.querySelectorAll(".e-timeline-header-container")[0].querySelector(".e-virtualtrack"))||(this.parent.element.querySelectorAll(".e-timeline-header-container")[0].querySelector(".e-virtualtrack").style.width=this.wholeTimelineWidth-this.clientWidthDifference+"px")):(this.parent.element.querySelectorAll(".e-chart-scroll-container")[0].querySelector(".e-virtualtrack").style.width=this.wholeTimelineWidth+"px",ne.isNullOrUndefined(this.parent.element.querySelectorAll(".e-timeline-header-container")[0].querySelector(".e-virtualtrack"))||(this.parent.element.querySelectorAll(".e-timeline-header-container")[0].querySelector(".e-virtualtrack").style.width=this.wholeTimelineWidth+"px")),this.parent.ganttChartModule.updateWidthAndHeight())},n.prototype.processZoomToFit=function(){this.parent.isReact&&this.parent.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","BaselineTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.isZoomIn=!1,this.isZoomToFit=!0,this.isZooming=!1,this.isZoomedToFit=!0;var e={},e=(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent("ZoomToFit")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),e.action="ZoomToFit",e.previousTimelineStartDate=ne.extend([],[],[this.parent.cloneProjectStartDate],!0)[0],e.previousTimelineEndDate=ne.extend([],[],[this.parent.cloneProjectEndDate],!0)[0],e.previousZoomingLevel=ne.extend({},{},this.parent.currentZoomingLevel,!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=e),this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.cloneTimelineStartDate=new Date(this.parent.cloneProjectStartDate),this.parent.cloneTimelineEndDate=new Date(this.parent.cloneProjectEndDate),0);this.parent.timelineSettings.showWeekend||(e=this.calculateNonWorkingDaysBetweenDates(this.parent.cloneTimelineStartDate,this.parent.cloneTimelineEndDate));var t,i,a,n=(this.parent.cloneTimelineEndDate.getTime()-this.parent.cloneTimelineStartDate.getTime())/864e5,r=this.parent.ganttChartModule.chartElement.offsetWidth,s=r/(n-=e),o=this.parent.zoomingLevels.slice().sort(function(e,t){return e.perDayWidth||t.perDayWidth?e.perDayWidth<t.perDayWidth?1:-1:0});if(0!=s){for(var l=0;l<o.length;l++){if(i=o[l],l===o.length-1){t=o[l];break}if(a=o[l+1],s>=i.perDayWidth){t=o[l];break}if(s<i.perDayWidth&&s>a.perDayWidth){t=o[l+1];break}}var e=ne.extend({},{},t,!0),n=(ne.isNullOrUndefined(this.parent.projectStartDate)&&this.roundOffDateToZoom(this.parent.cloneTimelineStartDate,!0,s,e.bottomTier.unit,t),ne.isNullOrUndefined(this.parent.projectEndDate)&&this.roundOffDateToZoom(this.parent.cloneTimelineEndDate,!1,s,e.bottomTier.unit,t),this.calculateNumberOfTimelineCells(e)),d=this.parent.ganttChartModule.scrollElement.offsetHeight-17,h=this.parent.ganttChartModule.chartBodyContent.offsetHeight-1,r=(e.timelineUnitSize=Math.abs(r-(h<=d?0:17))/n,{requestType:"beforeZoomToProject",timeline:e});this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin",this.parent.controlId+"_zoomout"],!0),this.parent.trigger("actionBegin",r),r.cancel||(this.parent.showLoadingIndicator(),this.changeTimelineSettings(e),this.parent.currentZoomingLevel=ne.extend({},{},e,!0),this.parent.isTimelineRoundOff=!!ne.isNullOrUndefined(this.parent.projectStartDate)),this.isZoomToFit=!1,this.updateTimelineSettingsAfterZooming()}},n.prototype.bottomTierCellWidthCalc=function(e,t,i){switch(e){case"Minutes":n=6e4*t.bottomTier.count;break;case"Hour":n=36e5*t.bottomTier.count;break;case"Week":n=6048e5*t.bottomTier.count;break;case"Day":n=864e5*t.bottomTier.count;break;case"Month":var a=new Date(i.getFullYear(),i.getMonth()+1,0).getDate(),n=t.bottomTier.count*(86400*a*1e3);break;case"Year":a=i.getFullYear()%400==0||i.getFullYear()%100!=0&&i.getFullYear()%4==0?366:365;n=t.bottomTier.count*(86400*a*1e3)}return n},n.prototype.roundOffDateToZoom=function(e,t,i,a,n){a=this.bottomTierCellWidthCalc(a,n,e);t?e.setTime(e.getTime()-a):e.setTime(e.getTime()+a)},n.prototype.calculateNumberOfTimelineCells=function(e){var t=new Date(this.parent.cloneTimelineStartDate.getTime()),i=new Date(this.parent.cloneTimelineEndDate.getTime()),a=(this.parent.dateValidationModule.updateDateWithTimeZone(t,i),0),t=(this.parent.timelineSettings.showWeekend||(a=this.calculateNonWorkingDaysBetweenDates(this.parent.cloneTimelineStartDate,this.parent.cloneTimelineEndDate)),i=Math.abs((i.getTime()-t.getTime())/864e5),i-=a,e.bottomTier.count),a=e.bottomTier.unit;return"Day"===a?i/t:"Week"===a?i/t/7:"Month"===a?i/t/28:"Year"===a?i/t/336:"Hour"===a?24/t*i:1440/t*i},n.prototype.processTimelineUnit=function(){var e=["Year","Month","Week","Day","Hour","Minutes"];this.customTimelineSettings=this.customTimelineSettings||this.extendFunction(this.parent.timelineSettings,["timelineViewMode","timelineUnitSize","weekStartDay","weekendBackground"],{topTier:["unit","format","count","formatter"],bottomTier:["unit","format","count","formatter"]}),-1===e.indexOf(this.customTimelineSettings.topTier.unit)&&-1===e.indexOf(this.customTimelineSettings.bottomTier.unit)?(this.customTimelineSettings.topTier.unit=-1!==e.indexOf(this.customTimelineSettings.timelineViewMode)?this.customTimelineSettings.timelineViewMode:"Week",this.customTimelineSettings.bottomTier.unit=5!==e.indexOf(this.customTimelineSettings.topTier.unit)?e[e.indexOf(this.customTimelineSettings.topTier.unit)+1]:"None"):-1!==e.indexOf(this.customTimelineSettings.topTier.unit)&&-1!==e.indexOf(this.customTimelineSettings.bottomTier.unit)&&e.indexOf(this.customTimelineSettings.topTier.unit)>e.indexOf(this.customTimelineSettings.bottomTier.unit)?this.customTimelineSettings.bottomTier.unit=this.customTimelineSettings.topTier.unit:(this.customTimelineSettings.topTier.unit=-1===e.indexOf(this.customTimelineSettings.topTier.unit)?"None":this.customTimelineSettings.topTier.unit,this.customTimelineSettings.bottomTier.unit=-1===e.indexOf(this.customTimelineSettings.bottomTier.unit)?"None":this.customTimelineSettings.bottomTier.unit),this.topTier=this.customTimelineSettings.topTier.unit,this.bottomTier=this.customTimelineSettings.bottomTier.unit,this.previousIsSingleTier=this.isSingleTier,this.isSingleTier="None"===this.topTier||"None"===this.bottomTier},n.prototype.processTimelineProperty=function(){this.customTimelineSettings.topTier.count="None"===this.topTier?1:this.validateCount(this.customTimelineSettings.topTier.unit,this.customTimelineSettings.topTier.count,"topTier"),this.customTimelineSettings.bottomTier.count="None"===this.customTimelineSettings.bottomTier.unit?1:this.validateCount(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.count,"bottomTier"),this.customTimelineSettings.bottomTier.format=this.validateFormat(this.customTimelineSettings.bottomTier.unit,this.customTimelineSettings.bottomTier.format),this.customTimelineSettings.topTier.format=this.validateFormat(this.topTier,this.customTimelineSettings.topTier.format),this.customTimelineSettings.weekStartDay=0<=this.customTimelineSettings.weekStartDay&&this.customTimelineSettings.weekStartDay<=6?this.customTimelineSettings.weekStartDay:0,this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth||this.checkCurrentZoomingLevel()},n.prototype.calculateZoomingLevelsPerDayWidth=function(){for(var e=this.parent.zoomingLevels,t=0;t<e.length;t++){var i=this.getPerDayWidth(e[t].timelineUnitSize,e[t].bottomTier.count,e[t].bottomTier.unit);e[t].perDayWidth=i}},n.prototype.checkCurrentZoomingLevel=function(){var e=("None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier:this.customTimelineSettings.topTier).count,t=("None"!==this.customTimelineSettings.bottomTier.unit?this.customTimelineSettings.bottomTier:this.customTimelineSettings.topTier).unit,i="None"!==this.customTimelineSettings.bottomTier.unit?"bottomTier":"topTier",t=this.getCurrentZoomingLevel(t,e,i),a=this.parent.currentZoomingLevel;return a&&!ne.isNullOrUndefined(a.timelineUnitSize)&&-1===this.parent.zoomingLevels.findIndex(function(e){return e.timelineUnitSize===a.timelineUnitSize})&&this.parent.isLoad?ne.isNullOrUndefined(a.level)||(t=a.level):this.parent.currentZoomingLevel=this.parent.zoomingLevels[t],this.parent.toolbarModule&&(t===this.parent.zoomingLevels[this.parent.zoomingLevels.length-1].level?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):t===this.parent.zoomingLevels[0].level&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),t},n.prototype.getCurrentZoomingLevel=function(t,e,i){this.parent.zoomingLevels.length||(this.parent.zoomingLevels=this.parent.getZoomingLevels());for(var a,n,r,s,o,l,d=this.parent.zoomingLevels.filter(function(e){return"bottomTier"===i?e.bottomTier.unit===t:e.topTier.unit===t}),h=(0===d.length&&(l=this.getClosestUnit(t,"",!1),d=this.parent.zoomingLevels.filter(function(e){return"bottomTier"===i?e.bottomTier.unit===l:e.topTier.unit===l})),d.sort(function(e,t){return"bottomTier"===i?e.bottomTier.count&&t.bottomTier.count?e.bottomTier.count<t.bottomTier.count?1:-1:0:e.topTier.count&&t.topTier.count?e.topTier.count<t.topTier.count?1:-1:0})),p=0;p<h.length;p++){if(o=h[p],p===h.length-1){a=h[p].level;break}if(s=h[p+1],e>=o[""+i].count){n=h[p],a=1<(r=h.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count})).length?this.checkCollectionsWidth(r):r[0].level;break}if(e<o[""+i].count&&e>s[""+i].count){n=h[p+1],a=1<(r=h.filter(function(e){return"bottomTier"===i?e.bottomTier.count===n.bottomTier.count:e.topTier.count===n.topTier.count})).length?this.checkCollectionsWidth(r):r[0].level;break}}return a},n.prototype.getClosestUnit=function(t,e,i){var a=["Year","Month","Week","Day","Hour","Minutes"],n=a.indexOf(t);return 0===n&&(i=!0),t=this.isZoomIn||i?a[n+1]:a[n-1],0===this.parent.zoomingLevels.filter(function(e){return e.bottomTier.unit===t}).length?("Year"===t&&(i=!0),e=t,this.getClosestUnit(t,e,i)):t},n.prototype.checkCollectionsWidth=function(e){for(var t,i,a,n=this.customTimelineSettings.timelineUnitSize,r=e.sort(function(e,t){return e.timelineUnitSize<t.timelineUnitSize?1:-1}),s=0;s<r.length;s++){if(a=r[s],s===r.length-1){t=r[s].level;break}if(i=r[s+1],n>=a.timelineUnitSize){t=r[s].level;break}if(n<a.timelineUnitSize&&n>i.timelineUnitSize){t=r[s+1].level;break}}return t},n.prototype.updateTimelineHeaderHeight=function(){var e;this.parent.timelineModule.isSingleTier?this.parent.element.classList.add(pe):this.parent.element.classList.remove(pe),this.previousIsSingleTier!==this.isSingleTier&&(e=0,ne.isNullOrUndefined(this.parent.toolbarModule)||ne.isNullOrUndefined(this.parent.toolbarModule.element)||(e=this.parent.toolbarModule.element.offsetHeight),this.parent.ganttChartModule.scrollObject.setHeight(this.parent.ganttHeight-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight-e),this.parent.treeGrid.height=this.parent.ganttHeight-e-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight)},n.prototype.dateByLeftValue=function(e,t,i){var a=new Date(this.parent.timelineModule.timelineStartDate.toString()),n=864e5/this.parent.perDayWidth,e=(this.parent.timelineSettings.showWeekend?a.setTime(a.getTime()+e*n):a=this.calculateDateExcludingNonWorkingDays(e,a),t&&!ne.isNullOrUndefined(i.predecessorsName)&&""!==i.predecessorsName&&(a.setDate(a.getDate()-1),n=this.parent.getCurrentDayEndTime(i.isAutoSchedule?i.autoEndDate:i.endDate),this.parent.dateValidationModule.setTime(n,a),a=this.parent.dateValidationModule.checkStartDate(a,i,!0)),"None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.topTier:this.parent.timelineModule.bottomTier);return"Hour"!==e&&"Minutes"!==e&&(!this.parent.isInDst(a)&&this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))?a.setTime(a.getTime()+36e5):!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&this.parent.isInDst(a)&&a.setTime(a.getTime()-36e5)),a},n.prototype.calculateDateExcludingNonWorkingDays=function(e,t){for(var i=864e5/this.parent.perDayWidth,a=this.parent.nonWorkingDayIndex,e=Math.ceil(e*i/864e5),i=7-a.length,n=Math.floor(e/i),r=e%i,s=new Date(t),o=(s.setDate(s.getDate()+7*n),0);o<r;)s.setDate(s.getDate()+1),-1===a.indexOf(s.getDay())&&o++;return s},n.prototype.createTimelineSeries=function(){var e,t,i,a,n,r=this.isSingleTier?1:2,s="None"===this.topTier?"bottomTier":"topTier",o=(this.topTierCollection=[],this.bottomTierCollection=[],!this.parent.pdfExportModule||this.parent.pdfExportModule&&!this.parent.pdfExportModule.isPdfExport||this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&!this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth);if(!0===this.restrictRender&&(this.wholeTimelineWidth=this.calculateWidthBetweenTwoDate(s,this.parent.timelineModule.timelineStartDate,this.parent.timelineModule.timelineEndDate)),this.parent.enableTimelineVirtualization&&this.wholeTimelineWidth>3*this.parent.element.offsetWidth){for(var l=0;l<r;l++){(i=ne.createElement("table",{className:ye,styles:"display: block;"})).setAttribute("role","none");var d=ne.createElement("thead",{className:De,styles:"display:block; border-collapse:collapse"}),h=this.createTimelineTemplate(s),p=ne.createElement("tr");this.parent.enableHover&&p.classList.add("e-timeline-cell-hover"),Array.from(h.childNodes).forEach(function(e){p.appendChild(e)}),e=ne.createElement("td"),t=ne.createElement("div",{styles:"width: 20px"}),a=ne.createElement("div",{className:"e-virtualtable"}),n=ne.createElement("div",{className:"e-virtualtrack"}),e.appendChild(t),p.appendChild(e),a.appendChild(p),d.appendChild(a),d.appendChild(n),i.appendChild(d),o&&this.parent.ganttChartModule.chartTimelineContainer.appendChild(i),p=null,this.restrictRender=!(s="bottomTier")}this.updateTimelineHeaderHeight(),this.timelineVirtualizationStyles()}else{for(l=0;l<r;l++){(i=ne.createElement("table",{className:ye,styles:"display: block;"})).setAttribute("role","none"),d=ne.createElement("thead",{className:De,styles:"display:block; border-collapse:collapse"});h=this.createTimelineTemplate(s);p=ne.createElement("tr"),this.parent.enableHover&&p.classList.add("e-timeline-cell-hover"),Array.from(h.childNodes).forEach(function(e){p.appendChild(e)}),e=ne.createElement("td"),t=ne.createElement("div",{styles:"width: 20px"}),e.appendChild(t),p.appendChild(e),d.appendChild(p),i.appendChild(d),o&&this.parent.ganttChartModule.chartTimelineContainer.appendChild(i),s="bottomTier",p=null}this.updateTimelineHeaderHeight(),this.wholeTimelineWidth=this.totalTimelineWidth}},n.prototype.timelineVirtualizationStyles=function(){var e,t,i=0,a=this.wholeTimelineWidth;this.parent.enableTimelineVirtualization&&(i=this.parent.enableTimelineVirtualization&&!ne.isNullOrUndefined(this.parent.ganttChartModule.scrollObject.element.scrollLeft)&&0!==this.parent.ganttChartModule.scrollObject.element.scrollLeft?this.parent.ganttChartModule.scrollObject.getTimelineLeft():0,this.parent.enableRtl&&(i=-i),e=this.parent.element.querySelectorAll(".e-chart-scroll-container")[0].querySelector(".e-virtualtable"),this.parent.undoRedoModule&&(!this.parent.undoRedoModule||this.parent.undoRedoModule.isZoomingUndoRedoProgress)||(e.style.transform="translate3d("+i+"px, 0px, 0px) translateZ(0)"),(e=this.parent.element.querySelectorAll(".e-chart-scroll-container")[0].querySelector(".e-virtualtrack")).style.position="relative",e.style.width=a+"px",this.parent.ganttChartModule.scrollObject.isSetScrollLeft&&(e=this.parent.element.querySelectorAll(".e-timeline-header-table-container")[0].querySelector(".e-virtualtable"),t=void 0,ne.isNullOrUndefined(this.parent.element.querySelectorAll(".e-timeline-header-table-container")[1])||(t=this.parent.element.querySelectorAll(".e-timeline-header-table-container")[1].querySelector(".e-virtualtable")),e.style.transform="translate("+i+"px, 0px)",ne.isNullOrUndefined(t)||(t.style.transform="translate("+i+"px, 0px)")),e=this.parent.element.querySelectorAll(".e-timeline-header-table-container")[0].querySelector(".e-virtualtrack"),t=void 0,ne.isNullOrUndefined(this.parent.element.querySelectorAll(".e-timeline-header-table-container")[1])||(t=this.parent.element.querySelectorAll(".e-timeline-header-table-container")[1].querySelector(".e-virtualtrack")),ne.isNullOrUndefined(t)||(t.style.position="relative",t.style.width=a+"px"),e.style.position="relative",e.style.width=a+"px",this.parent.connectorLineModule.svgObject.style.width=a+"px",this.parent.element.querySelector("."+me).style.width="calc(100% - 17px)",this.parent.timelineModule.isZooming||this.parent.timelineModule.isZoomToFit)&&(this.parent.ganttChartModule.scrollElement.scrollLeft=0,this.isZoomingAction=!0,this.parent.ganttChartModule.scrollObject.updateChartElementStyles())},n.prototype.validateCount=function(e,t,i){var a,n=!ne.isNullOrUndefined(t)&&0<parseInt(t.toString(),10)?parseInt(t.toString(),10):1,r=Math.abs(this.timelineRoundOffEndDate.getTime()-this.timelineStartDate.getTime());switch(e){case"Year":n=n<=(a=Math.round(r/864e5/336))?n:0<a?a:1,"None"!==this.topTier&&"bottomTier"===i&&(n=this.validateBottomTierCount(e,n));break;case"Month":n=n<=(a=Math.round(r/864e5/28))?n:0<a?a+1:1,"None"!==this.topTier&&"bottomTier"===i&&(n=this.validateBottomTierCount(e,n));break;case"Week":n=n<=(a=Math.round(r/864e5/7))?n:0<a?a:1,"None"!==this.topTier&&"bottomTier"===i&&(n=this.validateBottomTierCount(e,n));break;case"Day":n=n<=(a=Math.round(r/864e5))?n:0<a?a:1,"None"!==this.topTier&&"bottomTier"===i&&(n=this.validateBottomTierCount(e,n));break;case"Hour":n=n<=(a=Math.round(r/36e5))?n:0<a?a:1,"None"!==this.topTier&&"bottomTier"===i&&(n=this.validateBottomTierCount(e,n));break;case"Minutes":n=n<=(a=Math.round(r/6e4))?n:0<a?a:1,"None"!==this.topTier&&"bottomTier"===i&&(n=this.validateBottomTierCount(e,n))}return t!==n&&this.isZooming&&this.parent.toolbarModule&&("bottomTier"===i||this.isSingleTier)&&(this.isZoomIn?this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomin"],!1):this.parent.toolbarModule.enableItems([this.parent.controlId+"_zoomout"],!1)),n},n.prototype.validateBottomTierCount=function(e,t){var i;switch(e){case"Year":i=t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Month":i="Year"===this.topTier?t<=12*this.customTimelineSettings.topTier.count?t:12*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Week":i="Year"===this.topTier?t<=48*this.customTimelineSettings.topTier.count?t:48*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=4*this.customTimelineSettings.topTier.count?t:4*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Day":i="Year"===this.topTier?t<=336*this.customTimelineSettings.topTier.count?t:336*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=28*this.customTimelineSettings.topTier.count?t:28*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count?t:7*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Hour":i="Year"===this.topTier?t<=8064*this.customTimelineSettings.topTier.count?t:8064*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=672*this.customTimelineSettings.topTier.count?t:672*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count*24?t:7*this.customTimelineSettings.topTier.count*24:"Day"===this.topTier?t<=24*this.customTimelineSettings.topTier.count?t:24*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count;break;case"Minutes":i="Year"===this.topTier?t<=483840*this.customTimelineSettings.topTier.count?t:483840*this.customTimelineSettings.topTier.count:"Month"===this.topTier?t<=40320*this.customTimelineSettings.topTier.count?t:40320*this.customTimelineSettings.topTier.count:"Week"===this.topTier?t<=7*this.customTimelineSettings.topTier.count*24*60?t:7*this.customTimelineSettings.topTier.count*24*60:"Day"===this.topTier?t<=24*this.customTimelineSettings.topTier.count*60?t:24*this.customTimelineSettings.topTier.count*60:"Hour"===this.topTier?t<=60*this.customTimelineSettings.topTier.count?t:60*this.customTimelineSettings.topTier.count:t<=this.customTimelineSettings.topTier.count?t:this.customTimelineSettings.topTier.count}return i},n.prototype.validateFormat=function(e,t){var i;switch(e){case"Week":i=t||"MMM dd, yyyy";break;case"Day":case"None":i=t||"";break;case"Hour":i=t||"H";break;case"Month":i=t||"MMM yyyy";break;case"Year":i=t||"yyyy";break;case"Minutes":i=t||"m"}return i},n.prototype.extendFunction=function(t,e,i){for(var a=this,n={},r=0;r<e.length;r++)n[e[r]]=t[e[r]];return i&&Object.keys(i).forEach(function(e){n[e]=a.extendFunction(t[e],i[e],null)}),n},n.prototype.formatDateHeader=function(e,t,i){var a,t=new Date(t.getTime());return""===e?(a=this.parent.globalize.formatDate(t,{format:"E"}),"zh"===this.parent.locale?a=a.slice(1):"ar"!==this.parent.locale&&(a=a.slice(0,1))):(a=this.parent.globalize.formatDate(t,{format:e}),i&&(a=this.updateHourInFormat(e,a,i.getHours()).updatedFormat)),a},n.prototype.isDateAffectedByDST=function(e){for(var t=new Date(e),i=t.getTimezoneOffset(),a=1;a<=3;a++)if(new Date(t.getTime()-60*a*60*1e3).getTimezoneOffset()!==i)return!0;return!1},n.prototype.calculateIteration=function(e,t,i,a){var n,r;return e.setHours(t.getHours()),this.isFirstLoop&&this.parent.isInDst(t)&&this.isDateAffectedByDST(t)&&(e.setHours(e.getHours()-1),this.increaseIteration=!0),this.isFirstLoop=!1,e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e.setMilliseconds(t.getMilliseconds()),"Hour"===i?(r=t.getHours(),n=Math.ceil((24-r)/a)):"Minutes"===i&&(r=t.getHours(),i=t.getMinutes(),n=Math.ceil((1440-(60*r+i))/a)),this.increaseIteration&&(n+=1,this.increaseIteration=!1),{iterations:n,dummystartDate:e}},n.prototype.updateHourInFormat=function(e,t,i){var a,n=e.match(/(h{1,2})/)||e.match(/(H{1,2})/);return!n||(n=n[0],e=e.split(/[\s,:]+/),a=t.split(/[\s,:]+/),-1===(e=e.findIndex(function(e){return e.includes("h")||e.includes("H")})))||e>=a.length?{hasHour:!1,updatedFormat:t}:(i=function(e,t){for(var i=String(e);i.length<t;)i="0"+i;return i}(i,n.length),a[e]=i,{hasHour:!0,hourIndex:e,updatedFormat:a.join(" ")})},n.prototype.customFormat=function(e,t,i,a,n){return(n="string"==typeof n?ne.getValue(n,window):n)(e,t,i,a)},n.prototype.createTimelineTemplate=function(e){var t,i,a=!1,n=this.parent,r=ne.createElement("th"),s=("topTier"===e?n.timelineModule.customTimelineSettings.topTier:n.timelineModule.customTimelineSettings.bottomTier).unit,o=("topTier"===e?n.timelineModule.customTimelineSettings.topTier:n.timelineModule.customTimelineSettings.bottomTier).count,l=n.timelineModule.customTimelineSettings.topTier,d=n.timelineModule.customTimelineSettings.bottomTier,n=this.parent.enableTimelineVirtualization&&0!==this.parent.ganttChartModule.scrollObject.element.scrollLeft?this.parent.ganttChartModule.scrollObject.getTimelineLeft():null,h=this.parent.enableTimelineVirtualization&&!ne.isNullOrUndefined(n)?new Date(this.dateByLeftValue(n).toString()):new Date(this.parent.timelineModule.timelineStartDate.toString()),p=new Date(this.timelineRoundOffEndDate.toString()),u=[],c=new Set,g=0,f=3*this.parent.element.offsetWidth,m=this.parent.dataOperation.hasDSTTransition(h.getFullYear()),y=new Date(2e3,0,1,0,0,0,0),D=!1;this.isFirstLoop=!0;do{if(!this.parent.timelineSettings.showWeekend&&this.isNonWorkingDayHeader(s,e,h))t=Math.abs(this.getIncrement(h,o,s,a,!0)),i=h.getTime()+t,h.setTime(i);else{var k={};k.startDate=new Date(h.getTime());if("Month"!==s&&"Hour"!==s||"bottomTier"!==e||1===o||0!==u.length||(a=!0),("Hour"===s||"Minutes"===s&&60===o||"Hour"===l.unit&&"Minutes"===d.unit)&&m){var T=this.calculateIteration(y,h,s,o),b=T.iterations;y.setTime(T.dummystartDate.getTime());for(var w=0;w<b;w++){(k={}).startDate=new Date(h.getTime()),h.getHours()!==y.getHours()&&(this.applyDstHour=!0);var v=this.getHeaterTemplateString(new Date(h.toString()),s,e,!1,o,k,a,y),S=new Date(h.toString()),P=S.getTime(),P=(c.has(P)||(c.add(P),u.push(S)),this.getIncrement(h,o,s,a,!0)),S=P,C=("Minutes"!==s&&"Hour"!==s||(this.dstIncreaseHour&&(this.fromDummyDate=!0,S=this.getIncrement(y,o,s,a,!0),this.dstIncreaseHour=!1,this.fromDummyDate=!1),y.setTime(y.getTime()+S),this.inconsistenceDstApplied?(h.setTime(h.getTime()+P-18e5),this.inconsistenceDstApplied=!1):h.setTime(h.getTime()+P)),a=!1,w===b-1&&0!==h.getHours()&&h.setHours(0),23===h.getHours()&&h.getHours()!==y.getHours()&&h.setHours(h.getHours()-1),p<=h&&(v=this.getHeaterTemplateString(u[u.length-1],s,e,!0,o,k),D=!0),r.appendChild(v),"topTier"===e?this.topTierCollection:this.bottomTierCollection);if(k.endDate=new Date(h.getTime()),(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.enableTimelineVirtualization?"topTier"===e?this.pdfExportTopTierCollection:this.pdfExportBottomTierCollection:C).push(k),g+=k.width,this.weekendEndDate=k.endDate>=p?p:k.endDate,D){D=!1;break}}this.applyDstHour=!1,"Hour"===s?Math.floor(b*o/24):"Minutes"===s&&Math.floor(b*o/1440),y=new Date(2e3,0,1,0,0,0,0)}else{if(v=this.getHeaterTemplateString(new Date(h.toString()),s,e,!1,o,k,a),u.push(new Date(h.toString())),i=a&&"Month"===s?this.calculateQuarterEndDate(h,o).getTime():(t=Math.abs(this.getIncrement(h,o,s,a,!0)),h.getTime()+t),a=!1,!this.parent.timelineSettings.showWeekend&&"Day"===s){for(var R=0,M=new Date(h);R<o;)M.setHours(0,0,0,0),M.setDate(M.getDate()+1),-1===this.parent.nonWorkingDayIndex.indexOf(M.getDay())&&R++;i=M.getTime()}h.setTime(i),"Day"!==s&&"Month"!==s&&"Week"!==s||!m||h.setHours(0,0,0,0),p<=h&&(v=this.getHeaterTemplateString(u[u.length-1],s,e,!0,o,k)),r.appendChild(v);C="topTier"===e?this.topTierCollection:this.bottomTierCollection;k.endDate=new Date(h.getTime()),(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.enableTimelineVirtualization?"topTier"===e?this.pdfExportTopTierCollection:this.pdfExportBottomTierCollection:C).push(k),g+=k.width,this.weekendEndDate=k.endDate>=p?p:k.endDate}}}while((!this.parent.enableTimelineVirtualization||this.parent.pdfExportModule&&(!this.parent.pdfExportModule||this.parent.pdfExportModule.isPdfExport)||g<f)&&h<p);return r},n.prototype.isNonWorkingDayHeader=function(e,t,i){return("Day"===e||"Hour"===e||"Minutes"===e)&&-1!==this.parent.nonWorkingDayIndex.indexOf(i.getDay())},n.prototype.updateTimelineAfterZooming=function(e,t){var i,a=document.getElementsByClassName("e-chart-scroll-container e-content")[0];if(!(ne.isNullOrUndefined(a)||this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport)){var n=!this.parent.isLoad&&this.parent.splitterModule&&this.parent.splitterModule.splitterObject&&"Chart"===this.parent.splitterSettings.view?a.offsetWidth+this.parent.splitterModule.splitterObject.allPanes[0].offsetWidth:a.offsetWidth,a=a.offsetHeight,r=document.getElementsByClassName("e-chart-rows-container")[0].offsetHeight,s=Math.abs(this.timelineStartDate.getTime()-e.getTime());if(s/=864e5,this.parent.timelineSettings.showWeekend||(s-=this.calculateNonWorkingDaysBetweenDates(this.timelineStartDate,e)),i="None"===this.bottomTier?this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize,this.customTimelineSettings.topTier.count,this.topTier):this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize,this.customTimelineSettings.bottomTier.count,this.bottomTier),(a=a<r?i*s+17:i*s)<=n){r=n-a;if(this.parent.timelineSettings.showWeekend)r=Math.round(r/i),e.setDate(e.getDate()+r);else{for(var o=Math.ceil(r/i),l=0,d=0,h=this.parent.nonWorkingDayIndex;d<o;){l++;var p=new Date(e.getTime());p.setDate(p.getDate()+l),-1===h.indexOf(p.getDay())&&d++}e.setDate(e.getDate()+l)}this.parent.timelineModule.timelineEndDate=e,t&&this.parent.updateTimelineDates(this.timelineStartDate,this.timelineEndDate,this.parent.isTimelineRoundOff)}}},n.prototype.getTimelineRoundOffEndDate=function(e){var t="None"===this.topTier?this.bottomTier:this.topTier,e=new Date(e.toString());return this.parent.isTimelineRoundOff&&("Hour"===t?e.setMinutes(60):"Minutes"===t?e.setSeconds(60):e.setHours(24,0,0,0)),"auto"===this.parent.timelineSettings.viewEndDate&&this.updateTimelineAfterZooming(e,!1),e},n.prototype.getIncrement=function(e,t,i,a,n){var r=new Date(e.getTime()),s=new Date(e.getTime()),o=!1,l=new Date(r);switch(i){case"Year":var r=e,s=new Date(e.getFullYear()+(t-1),11,31),d=q(e),h=this.resetToNextYear(e,t),p=this.adjustForDST(r,s,h-d,s.getTime()-r.getTime()+864e5,n,!0);break;case"Month":r=e,s=new Date(e.getFullYear(),e.getMonth()+t,1);d=q(e),h=this.resetToNextMonth(e,t);p=this.adjustForDST(r,s,h-d,s.getTime()-r.getTime(),n,!0);break;case"Week":var u=this.parent.timelineModule.customTimelineSettings.weekStartDay,c=e.getDay()<u?u-e.getDay():6-e.getDay()+u,u=(t=0<c?t-1:0,s.setHours(24,0,0,0),c=e.getDay()<u&&0<c?c-1:c,s.setDate(s.getDate()+(c+7*t)),this.resetToNextDay(e)),d=q(e),h=u+24*(c+7*t)*60*60*1e3;p=this.adjustForDST(r,s,h-d,s.getTime()-r.getTime(),n,!0);break;case"Day":s.setHours(24,0,0,0);c=(h=(u=this.resetToNextDay(r))+24*(t-1)*60*60*1e3)-(d=q(r));p=s.getTime()-r.getTime()+864e5*(t-1),(g=new Date(r)).setTime(g.getTime()+p),p=this.adjustForDST(r,g,c,g.getTime()-r.getTime(),n,!0);break;case"Hour":s.setMinutes(60),s.setSeconds(0);u=(h=this.resetToNextHour(r)+60*(t-1)*60*1e3)-(d=q(r));p=s.getTime()-r.getTime()+36e5*(t-1);(g=new Date(r)).setTime(g.getTime()+p),a&&12===t&&0!==r.getHours()&&g.setHours(0,0,0,0);c=new Date(r);c.setHours(c.getHours()-t),-30==r.getTimezoneOffset()-c.getTimezoneOffset()&&(g.setMinutes(g.getMinutes()+30),this.inconsistenceDstApplied=!0),g.getHours()<l.getHours()+t&&(o=!0),p=this.adjustForDST(r,g,u,g.getTime()-r.getTime(),n,o);break;case"Minutes":s.setSeconds(60);var g,c=(h=this.resetToNextMinute(r)+60*(t-1)*1e3)-(d=q(r));p=s.getTime()-r.getTime()+6e4*(t-1),(g=new Date(r)).setTime(g.getTime()+p),g.getMinutes()<=l.getMinutes()&&(o=!0),p=this.adjustForDST(r,g,c,g.getTime()-r.getTime(),n,o)}return p},n.prototype.resetToNextYear=function(e,t){e=e.getFullYear()+t;return Date.UTC(e,0,1,0,0,0,0)},n.prototype.resetToNextMonth=function(e,t){var i=e.getFullYear(),e=e.getMonth();return Date.UTC(i,e+t,1,0,0,0,0)},n.prototype.resetToNextDay=function(e){var t=e.getFullYear(),i=e.getMonth(),e=e.getDate();return Date.UTC(t,i,e+1,0,0,0,0)},n.prototype.resetToNextHour=function(e){var t=e.getFullYear(),i=e.getMonth(),a=e.getDate(),e=e.getHours();return Date.UTC(t,i,a,e+1,0,0,0)},n.prototype.resetToNextMinute=function(e){var t=e.getFullYear(),i=e.getMonth(),a=e.getDate(),n=e.getHours(),e=e.getMinutes();return Date.UTC(t,i,a,n,e+1,0,0)},n.prototype.adjustForDST=function(e,t,i,a,n,r){if(this.parent.dataOperation.hasDSTTransition(e.getFullYear())&&!this.inconsistenceDstApplied){var s=a-i;if(t.getTimezoneOffset()>e.getTimezoneOffset()&&n)return this.dstIncreaseHour=!0,this.fromDummyDate?i:r?a+36e5:a;0<s?a-=s:s<0&&(a+=Math.abs(s))}return a},n.prototype.isWeekendHeaderCell=function(e,t,i){return!("Day"!==e&&"Hour"!==e&&"Minutes"!==e||1!==this.customTimelineSettings[t].count&&"Hour"!==e&&"Minutes"!==e||-1===this.parent.nonWorkingDayIndex.indexOf(i.getDay()))},n.prototype.calculateQuarterEndDate=function(e,t){var i=e.getMonth();return 3===t?0<=i&&i<=2?new Date(e.getFullYear(),3,1):3<=i&&i<=5?new Date(e.getFullYear(),6,1):6<=i&&i<=8?new Date(e.getFullYear(),9,1):new Date(e.getFullYear()+1,0,1):0<=i&&i<=5?new Date(e.getFullYear(),6,1):new Date(e.getFullYear()+1,0,1)},n.prototype.calculateTotalHours=function(e,t){var i=0;switch(e){case"Hour":i=+t;break;case"Day":i=24*t;break;case"Week":i=168*t;break;case"Minutes":i=t/60}return i},n.prototype.getHeaterTemplateString=function(e,t,i,a,n,r,s,o){var l=null,d=(ne.isNullOrUndefined(this.parent.timelineTemplate)||(l=this.parent.chartRowsModule.templateCompiler(this.parent.timelineTemplate)),("topTier"===i?this.parent.timelineModule.customTimelineSettings.topTier:this.parent.timelineModule.customTimelineSettings.bottomTier).format),h=("topTier"===i?this.parent.timelineModule.customTimelineSettings.topTier:this.parent.timelineModule.customTimelineSettings.bottomTier).formatter,p=this.getIncrement(e,n,t,s),u=(this.parent.timelineSettings.showWeekend||("Week"!==t&&"Month"!==t&&"Year"!==t||"topTier"!==i||"Day"!==this.parent.currentZoomingLevel.bottomTier.unit)&&"Hour"!==this.parent.currentZoomingLevel.bottomTier.unit&&!this.isZoomToFit||(c=new Date(e),u=new Date(e),(u=new Date(u.getTime()+p)).setHours(0,0,0,0),p-=24*this.calculateNonWorkingDaysBetweenDates(c,u)*60*60*1e3),c=Math.abs(p/864e5*this.parent.perDayWidth)),c=a?this.calculateWidthBetweenTwoDate(t,e,this.timelineRoundOffEndDate,r,a):s&&"Hour"!==t?this.calculateWidthBetweenTwoDate(t,e,this.calculateQuarterEndDate(e,n)):c,p=(this.isFirstLoop&&this.parent.isInDst(e)&&1===e.getHours()&&this.isDateAffectedByDST(e)&&(c+=this.parent.perDayWidth/24),this.isFirstLoop=!1,this.isWeekendHeaderCell(t,i,e)),g="topTier"===i?" e-gantt-top-cell-text":"",f=(s&&20===e.getHours()&&12===n&&"bottomTier"===i&&"Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit&&e.setTime(e.getTime()-72e6),new Date(e));if(this.parent.timelineSettings.showWeekend)f=new Date(e);else if(this.isWeekend(f))for(;-1!==this.parent.nonWorkingDayIndex.indexOf(f.getDay());)f.setDate(f.getDate()+1);var m,s=ne.isNullOrUndefined(h)?this.parent.globalize.formatDate(f,{format:this.parent.getDateFormat()}):this.customFormat(f,d,i,t,h),n=this.applyDstHour?ne.isNullOrUndefined(h)?this.formatDateHeader(d,f,o):this.customFormat(f,d,i,t,h):ne.isNullOrUndefined(h)?this.formatDateHeader(d,f):this.customFormat(f,d,i,t,h),o=(ne.isNullOrUndefined(l)||(e=(m=l(ne.extend({},{date:s,tier:i,value:n}),this.parent,"TimelineTemplate",this.parent.chartRowsModule.getTemplateID("TimelineTemplate"),!1,void 0,null,this.parent.root))[0])instanceof HTMLElement&&(e.setAttribute("data-tier",i),e.setAttribute("date",s),e.setAttribute("value",n)),this.parent.timelineModule.isSingleTier?"e-timeline-single-header-cell":"e-timeline-top-header-cell"),d=ne.createElement("th",{className:o+(p?" e-weekend-header-cell":""),styles:"width:"+c+"px;"+(p&&this.customTimelineSettings.weekendBackground?"background-color:"+this.customTimelineSettings.weekendBackground+";":"")}),t=(p&&this.parent.enableHover&&d.classList.add("e-weekend-cell-hover"),d.tabIndex=-1,d.setAttribute("aria-label",this.parent.localeObj.getConstant("timelineCell")+" "+s),ne.createElement("div",{className:"e-header-cell-label"+g,styles:"width:"+(c-1)+"px;"}));return t.title=this.parent.timelineSettings.showTooltip?s:"",t.textContent=n,t.setAttribute("data-tier",i),this.parent.isReact&&!ne.isNullOrUndefined(m)&&0<m.length&&(m[0].style.width="100%",m[0].style.height="100%"),!ne.isNullOrUndefined(l)&&!ne.isNullOrUndefined(m)&&0<m.length?ne.append(m,d):d.append(t),d.outerHTML,!this.isSingleTier&&"topTier"!==i||a?(this.isSingleTier||"topTier"===i)&&a&&(this.totalTimelineWidth=this.totalTimelineWidth-u+c):this.totalTimelineWidth=this.totalTimelineWidth+c,r.value=n,r.isWeekend=p,r.width=c,d},n.prototype.calculateNonWorkingDaysBetweenDates=function(e,t){for(var t=Math.ceil((t.getTime()-e.getTime())/864e5),i=t%7,a=Math.floor(t/7)*this.parent.nonWorkingDayIndex.length,n=e.getDay(),r=0;r<i;r++)-1!==this.parent.nonWorkingDayIndex.indexOf((n+r)%7)&&a++;return a},n.prototype.isWeekend=function(e){e=e.getDay();return-1!==this.parent.nonWorkingDayIndex.indexOf(e)},n.prototype.calculateWidthBetweenTwoDate=function(e,t,i,a,n){t=new Date(t.getTime()),i=new Date(i.getTime());this.parent.dateValidationModule.updateDateWithTimeZone(t,i);i=(i.getTime()-t.getTime())/864e5;if(this.parent.timelineSettings.showWeekend||"Day"!==this.parent.currentZoomingLevel.bottomTier.unit&&"Hour"!==this.parent.currentZoomingLevel.bottomTier.unit&&!this.isZoomToFit)return i*this.parent.perDayWidth;var r=Math.floor(i/7)*(7-this.parent.nonWorkingDayIndex.length),s=i%7;if(1<s||1<r){for(var o=0,l=new Date(t),d=0;d<s;d++){var h=l.getDay();-1===this.parent.nonWorkingDayIndex.indexOf(h)&&o++,l.setDate(l.getDate()+1)}return(r+o)*this.parent.perDayWidth}return this.isZoomToFit&&n?a.width:i*this.parent.perDayWidth},n.prototype.timelineWidthCalculation=function(){var e=this.customTimelineSettings.timelineUnitSize,t=this.customTimelineSettings.bottomTier.count,i=this.customTimelineSettings.topTier.count;this.bottomTierCellWidth=e,"None"===this.bottomTier?this.parent.perDayWidth=this.getPerDayWidth(e,i,this.topTier):this.parent.perDayWidth=this.getPerDayWidth(e,t,this.bottomTier),this.topTierCellWidth="None"!==this.bottomTier?"Week"===this.topTier?7*this.parent.perDayWidth:"Hour"===this.topTier?this.parent.perDayWidth/24:"Minutes"===this.topTier?this.parent.perDayWidth/1440:this.parent.perDayWidth:e,this.topTierCellWidth=this.isSingleTier?this.topTierCellWidth:this.topTierCellWidth*i},n.prototype.getPerDayWidth=function(e,t,i){var a;switch(i){case"Year":a=e/t/336;break;case"Month":a=e/t/28;break;case"Week":a=e/t/7;break;case"Day":a=e/t;break;case"Hour":a=24/t*e;break;case"Minutes":a=1440/t*e}return a},n.prototype.roundOffDays=function(){var e=this.parent.cloneTimelineStartDate,t=this.parent.cloneTimelineEndDate,i="None"===this.topTier?this.bottomTier:this.topTier,a=this.parent.defaultCalendarContext;if(this.parent.isTimelineRoundOff){if("Year"===i)e=new Date(e.getFullYear(),0,1),t=new Date(t.getFullYear(),11,31);else if("Month"===i)e=new Date(e.getFullYear(),e.getMonth(),1),t=new Date(t.getFullYear(),t.getMonth()+1,0);else if("Week"===i){var n=ne.isNullOrUndefined(this.customTimelineSettings.weekStartDay)?0:this.parent.timelineModule.customTimelineSettings.weekStartDay,r=e.getDay()<n?e.getDate()-(7-n+e.getDay()):e.getDate()-e.getDay()+n;if(!this.parent.timelineSettings.showWeekend)for(;this.isWeekend(new Date(e.getFullYear(),e.getMonth(),r));)r++;e.setDate(r);var s=t.getDate()-t.getDay();t.setDate(6+s+n)}"Hour"===i?e.setMinutes(0):"Minutes"===i?e.setSeconds(0):e.setHours(0,0,0,0),e=this.parent.dataOperation.getNextWorkingDay(e,a),t=this.parent.dataOperation.getNextWorkingDay(t,a),this.parent.allowUnscheduledTasks&&!this.parent.projectStartDate&&this.parent.dataOperation.isHavingUnscheduledTaskOnLoad&&this.parent.cloneTimelineStartDate&&this.parent.cloneProjectStartDate&&this.parent.cloneTimelineStartDate.getTime()===this.parent.cloneProjectStartDate.getTime()&&(s=this.parent.cloneTimelineStartDate)&&e&&e.getTime()>=s.getTime()&&(n=new Date(s),"Hour"===i?n.setHours(n.getHours()-1):"Minutes"===i?n.setMinutes(n.getMinutes()-1):n.setDate(n.getDate()-1),e=n=this.parent.dataOperation.getPreviousWorkingDay&&!this.parent.includeWeekend?this.parent.dataOperation.getPreviousWorkingDay(n,a):n,this.parent.cloneTimelineStartDate=e)}this.timelineStartDate=e,this.timelineEndDate=t,this.timelineRoundOffEndDate=this.getTimelineRoundOffEndDate(this.timelineEndDate),this.parent.isLoad&&this.parent.enableInfiniteTimelineScroll&&(this.initialTimelineStartDate=this.timelineStartDate,this.initialTimelineEndDate=this.timelineRoundOffEndDate)},n.prototype.updateScheduleDatesByToolBar=function(e,t,i,a){var n=this;if("Year"===e&&("prevTimeSpan"===t?i=0===i.getMonth()?new Date(i.getFullYear()-1,0,1):new Date(i.getFullYear(),0,1):a=11===a.getMonth()?new Date(a.getFullYear()+1,0,1):new Date(a.getFullYear(),12,1)),"Month"===e&&("prevTimeSpan"===t?i=1===i.getDate()?new Date(i.getFullYear(),i.getMonth()-1,1):new Date(i.getFullYear(),i.getMonth(),1):a=new Date(a.getFullYear(),a.getMonth()+1,1)),"Week"===e){var r=this.parent.timelineModule.customTimelineSettings.weekStartDay,s=void 0;if("prevTimeSpan"===t)if(this.parent.timelineSettings.showWeekend)s=i.getDay()<r?7-(r-i.getDay()):i.getDay()-r,i.setHours(0,0,0,0),0===s?i.setDate(i.getDate()-7):i.setDate(i.getDate()-s);else{var o=Array.from({length:7},function(e,t){return t}).filter(function(e){return-1===n.parent.nonWorkingDayIndex.indexOf(e)});if(i.setHours(0,0,0,0),1<this.parent.timelineModule.customTimelineSettings.weekStartDay)for(;;){i.setDate(i.getDate()-1);var l=i.getDay();if(-1!==o.indexOf(l)&&l===this.parent.timelineModule.customTimelineSettings.weekStartDay)break}else for(var d=0;d<o.length;){i.setDate(i.getDate()-1);var h=i.getDay();-1!==o.indexOf(h)&&d++}}else s=a.getDay()<r?r-a.getDay():7-a.getDay()+r,a.setHours(0,0,0,0),0===s?a.setDate(a.getDate()+6):a.setDate(a.getDate()+s)}if("Day"===e)if("prevTimeSpan"===t)if(0===i.getHours()){if(i.setTime(i.getTime()-864e5),!this.parent.timelineSettings.showWeekend)for(;-1!==this.parent.nonWorkingDayIndex.indexOf(i.getDay());)i.setTime(i.getTime()-864e5)}else i.setHours(0);else if(0===a.getHours()){if(a.setTime(a.getTime()+864e5),!this.parent.timelineSettings.showWeekend)for(;-1!==this.parent.nonWorkingDayIndex.indexOf(a.getDay());)a.setTime(a.getTime()+864e5)}else a.setHours(24);"Hour"===e&&("prevTimeSpan"===t?0===i.getMinutes()?i.setTime(i.getTime()-36e5):i.setMinutes(0):0===a.getMinutes()?a.setTime(a.getTime()+36e5):a.setMinutes(60)),"Minutes"===e&&("prevTimeSpan"===t?0===i.getSeconds()?i.setTime(i.getTime()-6e4):i.setSeconds(0):0===a.getSeconds()?a.setTime(a.getTime()+6e4):a.setSeconds(60)),this.parent.cloneTimelineStartDate=i,this.parent.cloneTimelineEndDate=a,"auto"===this.parent.timelineSettings.viewStartDate&&"auto"===this.parent.timelineSettings.viewEndDate||this.parent.setProperties({timelineSettings:{viewStartDate:i,viewEndDate:a}},!0)},n.prototype.updateTimeLineOnEditing=function(e,t){if(1<=e[0].length)for(var i=0;i<e.length;i++){var a=e[parseInt(i.toString(),10)],n=a.filter(function(e){return!ne.isNullOrUndefined(e.ganttProperties.startDate)}),r=a.filter(function(e){return!ne.isNullOrUndefined(e.ganttProperties.endDate)}),s=0<n.length?new Date(U.DataUtil.aggregates.min(n,"ganttProperties.startDate")):null,o=0<n.length?new Date(U.DataUtil.aggregates.min(r,"ganttProperties.endDate")):null,l=0<r.length?new Date(U.DataUtil.aggregates.max(r,"ganttProperties.endDate")):null,d=new Date(this.parent.dataOperation.checkStartDate(this.timelineStartDate).getTime()),h=new Date(this.parent.dataOperation.checkEndDate(this.timelineEndDate).getTime()),p=ne.isNullOrUndefined(s)?null:this.parent.dataOperation.getTaskLeft(s,!1,n[0].ganttProperties.calendarContext),r=ne.isNullOrUndefined(l)?null:this.parent.dataOperation.getTaskLeft(l,!1,r[0].ganttProperties.calendarContext),d=this.parent.dataOperation.getTaskLeft(d,!1,this.parent.defaultCalendarContext),h=this.parent.dataOperation.getTaskLeft(h,!1,this.parent.defaultCalendarContext),u=void 0,c=this.parent.editModule.taskbarEditModule,n=0<n.length?new Date(U.DataUtil.aggregates.min(n,"ganttProperties.startDate")).setHours(0,0,0,0):null,g=new Date(this.timelineStartDate.getTime()).setHours(0,0,0,0),s=!(!ne.isNullOrUndefined(p)&&!ne.isNullOrUndefined(c)&&(c.taskBarEditAction&&"RightResizing"!==c.taskBarEditAction||ne.isNullOrUndefined(c.taskBarEditAction))&&n<=g&&(p<this.bottomTierCellWidth||p<=d))||(u="prevTimeSpan",s>this.timelineStartDate)?this.timelineStartDate:s,l=!(!ne.isNullOrUndefined(r)&&r>=(this.parent.enableTimelineVirtualization?this.wholeTimelineWidth:this.totalTimelineWidth)-this.bottomTierCellWidth&&h<r)||(u="prevTimeSpan"===u?"both":"nextTimeSpan",l<this.timelineEndDate)?this.timelineEndDate:l;u?this.performTimeSpanAction(u,t,s,l):ne.isNullOrUndefined(a[0].ganttProperties.segments)||this.parent.dataOperation.updateWidthLeft(a[0]),!ne.isNullOrUndefined(s)&&!ne.isNullOrUndefined(o)&&o<=s&&("CellEditing"===t||"DialogEditing"===t)&&this.parent.allowUnscheduledTasks?(s=new Date(Math.min(s.getTime(),o.getTime())),s=new Date(Math.min(s.getTime(),this.timelineStartDate.getTime())),this.performTimeSpanAction("prevTimeSpan",t,s,l)):ne.isNullOrUndefined(o)&&o<=s&&("CellEditing"===t||"DialogEditing"===t)&&this.parent.allowUnscheduledTasks&&1===e[0].length&&!ne.isNullOrUndefined(e[0][0].ganttProperties.endDate)&&ne.isNullOrUndefined(a[0].ganttProperties.startDate)&&a[0].ganttProperties.endDate<=this.timelineStartDate&&(s=new Date(Math.min(e[0][0].ganttProperties.endDate.getTime(),s.getTime())),this.performTimeSpanAction("prevTimeSpan",t,s,l)),this.parent.cloneProjectStartDate=s,this.parent.cloneProjectEndDate=l;break}},n.prototype.performTimeSpanAction=function(e,t,i,a,n){this.isZoomedToFit=!1,n=ne.isNullOrUndefined(n)?"None"===this.parent.timelineModule.topTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier:n;var r=new Date(this.parent.cloneTimelineStartDate.getTime()),s=new Date(this.parent.cloneTimelineEndDate.getTime()),n=("publicMethod"!==t&&"both"===e?(this.updateScheduleDatesByToolBar(n,"prevTimeSpan",i,a),this.updateScheduleDatesByToolBar(n,"nextTimeSpan",new Date(this.parent.cloneTimelineStartDate.getTime()),a)):this.updateScheduleDatesByToolBar(n,e,i,a),this.timeSpanActionEvent("actionBegin",e,t));n.cancel?(this.parent.cloneTimelineStartDate=r,this.parent.cloneTimelineEndDate=s):(this.restrictRender=!0,this.performedTimeSpanAction=!0,i=this.parent.ganttChartModule.scrollElement.scrollLeft,this.parent.updateTimelineDates(n.timelineStartDate,n.timelineEndDate,n.isTimelineRoundOff,t),"prevTimeSpan"!==e||"publicMethod"!==t&&"InfiniteScroll"!==t?"nextTimeSpan"===e&&"publicMethod"===t?(this.parent.ganttChartModule.updateScrollLeft(this.parent.enableTimelineVirtualization?this.wholeTimelineWidth:this.totalTimelineWidth),this.parent.timelineModule.isZoomToFit=!1):"nextTimeSpan"===e&&"TaskbarEditing"===t&&(a=document.getElementsByClassName("e-chart-scroll-container e-content")[0].scrollLeft,this.parent.element.querySelector(".e-timeline-header-container").scrollLeft=a,this.parent.timelineModule.isZoomToFit=!1):(this.parent.ganttChartModule.updateScrollLeft(0),this.parent.timelineModule.isZoomToFit=!1),("TaskbarEditing"===t||"InfiniteScroll"===t)&&this.parent.enableTimelineVirtualization&&this.wholeTimelineWidth>3*this.parent.element.offsetWidth&&(this.parent.ganttChartModule.scrollObject.setScrollLeft(i),this.parent.ganttChartModule.scrollObject.updateContent()),this.parent.timelineModule.timeSpanActionEvent("actionComplete",e,t))},n.prototype.handleInfiniteTimelineScroll=function(e){var t,i,a;this.parent.enableInfiniteTimelineScroll&&(a=this.parent.ganttChartModule.scrollElement)&&(t=a.scrollLeft,i=a.scrollWidth,a=a.clientWidth,("right"===e?this.parent.enableRtl?Math.abs(t)>=i-a-10:i-t-a<=10:this.parent.enableRtl?Math.abs(t)<10:t<10)&&this.performTimeSpanAction("right"===e?"nextTimeSpan":"prevTimeSpan","InfiniteScroll",new Date(this.parent.cloneTimelineStartDate.getTime()),new Date(this.parent.cloneTimelineEndDate.getTime())),this.lastScrollLeftPosition=t)},n.prototype.trimInfiniteTimelineRightCells=function(){if(this.parent.enableInfiniteTimelineScroll&&!this.isInfiniteScrollTrimming){var e="None"!==this.parent.timelineModule.topTier&&0<this.topTierCollection.length,t=this.parent.ganttChartModule.scrollElement;if(t){var i=t.scrollLeft,a=t.scrollWidth,t=t.clientWidth,a=a-(this.parent.enableRtl?Math.abs(i):i)-t,i=t;if(!(a<=i)){var n,r=a-i;if(e){for(var s=0,o=0,t=this.topTierCollection.length,l=t-1;0<=l;l--){if(!(s+(d=this.topTierCollection[l].width)<=r))break;s+=d,o++}if(0===o||t-o<3)return;this.isInfiniteScrollTrimming=!0;a=t-o,i=this.topTierCollection.slice(a)[0].startDate;this.topTierCollection.splice(a,o),n=new Date(i.getTime())}else{for(var d,s=0,h=0,e=this.bottomTierCollection.length,l=e-1;0<=l;l--){if(!(s+(d=this.bottomTierCollection[l].width)<=r))break;s+=d,h++}if(0===h||e-h<3)return;this.isInfiniteScrollTrimming=!0;t=e-h,a=this.bottomTierCollection.slice(t)[0].startDate;this.bottomTierCollection.splice(t,h),n=new Date(a.getTime())}n<this.parent.timelineModule.initialTimelineEndDate?this.parent.cloneTimelineEndDate=this.parent.timelineModule.initialTimelineEndDate:this.parent.cloneTimelineEndDate=n,this.parent.updateTimelineDates(this.parent.cloneTimelineStartDate,this.parent.cloneTimelineEndDate,!1),this.isInfiniteScrollTrimming=!1}}}},n.prototype.trimInfiniteTimelineLeftCells=function(){if(this.parent.enableInfiniteTimelineScroll&&!this.isInfiniteScrollTrimming){var e="None"!==this.parent.timelineModule.topTier&&0<this.topTierCollection.length,t=this.parent.ganttChartModule.scrollElement;if(t){var i=t.scrollLeft,a=t.clientWidth,n=this.parent.enableRtl?Math.abs(i):i;if(!(n<=a)){var r,s=n-a,o=0;if(e){for(var l=0,d=this.topTierCollection.length,h=0;h<d;h++){if(!(o+(p=this.topTierCollection[h].width)<=s))break;o+=p,l++}if(0===l||d-l<3)return;this.isInfiniteScrollTrimming=!0;n=this.topTierCollection.slice(0,l)[l-1].endDate;this.topTierCollection.splice(0,l),r=new Date(n.getTime())}else{for(var p,u=0,c=this.bottomTierCollection.length,h=0;h<c;h++){if(!(o+(p=this.bottomTierCollection[h].width)<=s))break;o+=p,u++}if(0===u||c-u<3)return;this.isInfiniteScrollTrimming=!0;a=this.bottomTierCollection.slice(0,u)[u-1].endDate;this.bottomTierCollection.splice(0,u),r=new Date(a.getTime())}r<this.parent.timelineModule.initialTimelineStartDate?(this.parent.cloneTimelineStartDate=r,this.parent.enableRtl?t.scrollLeft=Math.min(0,i+o):t.scrollLeft=Math.max(0,i-o)):this.parent.cloneTimelineStartDate=this.parent.timelineModule.initialTimelineStartDate,this.parent.updateTimelineDates(this.parent.cloneTimelineStartDate,this.parent.cloneTimelineEndDate,!1),this.isInfiniteScrollTrimming=!1}}}},n.prototype.adjustEndDateToFillChart=function(e){function t(e){i.parent.cloneTimelineEndDate=e}var i=this,a=this.parent.ganttChartModule.chartElement.offsetWidth,n=this.parent.perDayWidth,r=this.parent.cloneTimelineEndDate,s=this.parent.cloneTimelineStartDate,o=!this.parent.timelineSettings.viewEndDate||"string"==typeof this.parent.timelineSettings.viewEndDate&&"auto"===this.parent.timelineSettings.viewEndDate.toLowerCase();if(s&&a&&n&&o){var r=r||new Date(s.getTime()),o=Math.ceil((r.getTime()-s.getTime())/864e5),l=(this.parent.timelineSettings.showWeekend||(o-=this.calculateNonWorkingDaysBetweenDates(s,r)),Math.ceil(a/n));if(o<l){var d=new Date(s.getTime());if(this.parent.timelineSettings.showWeekend)d.setDate(d.getDate()+l);else for(var h=0;h<l;)d.setDate(d.getDate()+1),-1===this.parent.nonWorkingDayIndex.indexOf(d.getDay())&&h++;t(d),e&&this.updateTimelineAfterZooming(r,!0)}}},n.prototype.updateTimelineSettingsAfterZooming=function(){this.parent.setProperties({timelineSettings:{timelineViewMode:this.customTimelineSettings.timelineViewMode,timelineUnitSize:this.customTimelineSettings.timelineUnitSize,bottomTier:{unit:this.customTimelineSettings.bottomTier.unit,format:this.customTimelineSettings.bottomTier.format,count:this.customTimelineSettings.bottomTier.count},topTier:{unit:this.customTimelineSettings.topTier.unit,format:this.customTimelineSettings.topTier.format,count:this.customTimelineSettings.topTier.count},weekStartDay:this.customTimelineSettings.weekStartDay,weekendBackground:this.customTimelineSettings.weekendBackground}},!0)},n.prototype.timeSpanActionEvent=function(e,t,i){var a={};return a.timelineStartDate=new Date(this.parent.cloneTimelineStartDate.getTime()),a.timelineEndDate=new Date(this.parent.cloneTimelineEndDate.getTime()),a.requestType="publicMethod"===i?t:"beforeAdd"===i?"TimelineRefreshOnAdd":"TaskbarEditing"===i?"TimelineRefreshOnEdit":t,"actionBegin"===e&&(a.isTimelineRoundOff=!1,a.cancel=!1),a.action="TimescaleUpdate",this.parent.trigger(e,a),a};var It=n;function n(e){this.isZoomIn=!1,this.isZoomOut=!1,this.isZooming=!1,this.isZoomToFit=!1,this.topTierCollection=[],this.bottomTierCollection=[],this.pdfExportTopTierCollection=[],this.pdfExportBottomTierCollection=[],this.restrictRender=!0,this.applyDstHour=!1,this.performedTimeSpanAction=!1,this.dstIncreaseHour=!1,this.fromDummyDate=!1,this.isZoomedToFit=!1,this.isZoomingAction=!1,this.isInfiniteScrollTrimming=!1,this.lastScrollLeftPosition=0,this.increaseIteration=!1,this.isFirstLoop=!1,this.inconsistenceDstApplied=!1,this.parent=e,this.initProperties()}var Et=function(e){this.allowEditing=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.allowResizing=!0,this.allowSorting=!0,this.allowFiltering=!0,this.edit={},ne.merge(this,e)},Ft=(r.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createContainer,this),this.parent.on("chartScroll",this.updateScrollTop,this),this.parent.on("destroy",this.destroy,this),this.parent.treeGrid.on("renderReactTemplate",this.renderReactTemplate,this),this.parent.treeGrid.grid.on("beforeSetPartialRecords",this.setPartialSelectionForGrid,this)},r.prototype.renderReactTemplate=function(e){for(var t="portals",i=0,a=e;i<a.length;i++){var n=a[i];-1===this.parent[t].indexOf(n)&&this.parent[t].push(n)}this.parent.renderTemplates()},r.prototype.createContainer=function(){this.treeGridElement=ne.createElement("div",{id:"treeGrid"+this.parent.element.id,className:"e-gantt-tree-grid"});var e=ne.createElement("div",{className:"e-gantt-temp-header"});this.parent.treeGridPane.appendChild(this.treeGridElement),this.treeGridElement.appendChild(e),this.parent.treeGridPane.classList.add("e-temp-content")},r.prototype.renderTreeGrid=function(){this.composeProperties(),this.bindEvents();var e="root";this.parent.treeGrid[e]=this.parent[e]||this.parent,ne.setValue("registeredTemplate",this.parent.registeredTemplate,this.parent.treeGrid);ne.setValue("viewContainerRef",this.parent.viewContainerRef,this.parent.treeGrid),this.treeGridElement.contains(this.parent.treeGrid.element)||this.parent.treeGrid.appendTo(this.treeGridElement),this.parent.treeGrid.grid&&this.parent.toolbarModule&&this.parent.isReact&&(this.parent.treeGrid.grid.portals=this.parent.portals),this.wireEvents()},r.prototype.composeProperties=function(){var e;this.parent.treeGrid.enableAdaptiveUI=this.parent.enableAdaptiveUI,this.parent.treeGrid.hasChildMapping=this.parent.taskFields.hasChildMapping,this.parent.treeGrid.query=this.parent.query,this.parent.treeGrid.locale=this.parent.locale,this.parent.treeGrid.loadChildOnDemand=this.parent.loadChildOnDemand,this.parent.treeGrid.isFromGantt=!0,this.parent.treeGrid.parentIdMapping=this.parent.taskFields.parentID,this.parent.taskFields.parentID&&(this.parent.treeGrid.idMapping=this.parent.taskFields.id),this.parent.treeGrid.showColumnMenu=this.parent.showColumnMenu,this.parent.treeGrid.enableCollapseAll=this.parent.collapseAllParentTasks,this.parent.treeGrid.columnMenuItems=this.parent.columnMenuItems,this.parent.treeGrid.enableRtl=this.parent.enableRtl,this.parent.treeGrid.childMapping=ne.isNullOrUndefined(this.parent.taskFields.child)?"":this.parent.taskFields.child,this.parent.treeGrid.treeColumnIndex=this.parent.treeColumnIndex,this.parent.treeGrid.columns=this.treeGridColumns,this.parent.treeGrid.loadingIndicator=this.parent.loadingIndicator,this.parent.treeGrid.enableVirtualMaskRow=this.parent.enableVirtualMaskRow,this.parent.dataSource instanceof Object&&H(this.parent)?(this.parent.treeGrid.hasChildMapping="isParent",e=ne.getValue("count",this.parent.dataSource),this.parent.treeGrid.dataSource={result:this.parent.flatData,count:e}):this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.treeGrid.dataSource=this.parent.dataSource:(this.parent.treeGrid.hasChildMapping=null,this.parent.treeGrid.dataSource=this.parent.flatData),this.parent.treeGrid.expandStateMapping=this.parent.taskFields.expandState,this.parent.treeGrid.isGantt=!0,this.parent.treeGrid.rowHeight=this.parent.rowHeight,this.parent.treeGrid.gridLines=this.parent.gridLines,0===this.parent.searchSettings.fields.length&&""===this.parent.searchSettings.key||(this.parent.treeGrid.searchSettings=this.parent.searchSettings);this.parent.treeGrid.isJsComponent=!0,ne.isNullOrUndefined(this.parent.toolbarModule)||ne.isNullOrUndefined(this.parent.toolbarModule.element)?this.parent.splitterElement.style.height="100%":this.parent.splitterElement.style.height="calc(100% - "+this.parent.toolbarModule.element.offsetHeight+"px)",this.parent.treeGrid.height="100%",this.parent.treeGrid.emptyRecordTemplate=this.parent.emptyRecordTemplate,this.parent.treeGrid.mergedColumns=this.parent.mergedColumns,this.parent.enableVirtualization&&(this.parent.treeGrid.grid.enableSeamlessScrolling=!1)},r.prototype.getContentDiv=function(){return this.treeGridElement.querySelector(".e-content")},r.prototype.getHeaderDiv=function(){return this.treeGridElement.querySelector(".e-headercontent")},r.prototype.getScrollbarWidth=function(){var e=document.createElement("div"),t=(e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",document.createElement("div")),t=(e.appendChild(t),this.parent.element.appendChild(e),e.offsetWidth-t.offsetWidth);return e.parentNode.removeChild(e),t},r.prototype.ensureScrollBar=function(){var e=this.getContentDiv(),t=this.getHeaderDiv(),i=this.getScrollbarWidth(),a=/Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);0===i&&navigator.userAgent.includes("Firefox")?(t.style.cssText+="width: calc(100% + 6px);",e.style.cssText+="width: calc(100% + 6px);"):0!==i?e.style.cssText+="width: calc(100% + "+i+"px);":e.classList.add("e-gantt-scroll-padding"),0===i&&a&&(t.style.cssText+="width: calc(100% + 17px);")},r.prototype.bindEvents=function(){this.parent.treeGrid.dataBound=this.dataBound.bind(this),this.parent.treeGrid.collapsing=this.collapsing.bind(this),this.parent.treeGrid.collapsed=this.collapsed.bind(this),this.parent.treeGrid.expanding=this.expanding.bind(this),this.parent.treeGrid.expanded=this.expanded.bind(this),this.parent.treeGrid.actionBegin=this.actionBegin.bind(this),this.parent.treeGrid.actionComplete=this.treeActionComplete.bind(this),this.parent.treeGrid.created=this.created.bind(this),this.parent.treeGrid.actionFailure=this.actionFailure.bind(this),this.parent.treeGrid.headerCellInfo=this.headerCellInfo.bind(this),this.parent.treeGrid.rowDataBound=this.rowDataBound.bind(this),this.parent.treeGrid.columnMenuOpen=this.columnMenuOpen.bind(this),this.parent.treeGrid.columnMenuClick=this.columnMenuClick.bind(this),this.parent.treeGrid.beforeDataBound=this.beforeDataBound.bind(this),this.parent.treeGrid.dataStateChange=this.dataStateChange.bind(this),this.parent.treeGrid.dataSourceChanged=this.dataSourceChanged.bind(this),null!=this.parent.queryCellInfo&&(this.parent.treeGrid.queryCellInfo=this.queryCellInfo.bind(this))},r.prototype.beforeDataBound=function(e){this.parent.enableHover&&this.treeGridElement.querySelector(".e-columnheader").classList.add("e-headercell-hover"),this.parent.filterModule&&this.parent.treeGrid.filterModule&&(this.parent.filterModule.filteredResult=this.parent.treeGrid.filterModule.filteredResult);var t={result:e.result},t=(this.parent.trigger("beforeDataBound",t),!ne.isNullOrUndefined(this.parent.selectionModule)&&this.parent.selectionSettings&&this.parent.selectionSettings.persistSelection&&0<this.parent.selectionModule.getSelectedRowIndexes().length&&"sorting"===e.actionArgs.requestType&&(this.isPersist=!0),this.parent.updatedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?ne.getValue("virtualScrollModule.visualData",this.parent.treeGrid):ne.getValue("result",e),e.actionArgs||null),i=!t||"sorting"!==t.requestType||"WBSCode"!==t.columnName,t=t&&("filtering"===t.requestType||"searching"===t.requestType),a=this.parent.filterSettings.columns&&0<this.parent.filterSettings.columns.length||"string"==typeof this.parent.searchSettings.key&&0<this.parent.searchSettings.key.length;!this.parent.enableWBS||this.parent.isVirtualScroll||!i||t||a||this.parent.generateWBSCodes(this.parent.updatedRecords),this.parent.virtualScrollModule&&this.parent.enableVirtualization&&this.parent.updateContentHeight(e),ne.setValue("contentModule.objectEqualityChecker",this.objectEqualityChecker,this.parent.treeGrid.grid),this.parent.isExpandPerformed=!1,this.parent.isCollapsePerformed=!1},r.prototype.dataBound=function(e){this.parent.isReact&&this.parent.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","BaselineTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.ensureScrollBar(),this.parent.treeDataBound(e),this.parent.dataOperation.validatedGanttData&&0<this.parent.dataOperation.validatedGanttData.size&&this.parent.isLoad&&(e={type:"refresh",modifiedTasks:this.parent.dataOperation.getValidatedTaskData()},this.parent.trigger("actionComplete",e),this.parent.dataOperation.validatedGanttData.clear()),this.parent.isLoad=!1,this.parent.isVirtualScroll&&((this.parent.enableVirtualMaskRow&&this.parent.enableVirtualization||this.parent.enableVirtualization&&!this.parent.enableVirtualMaskRow&&"Shimmer"===this.parent.loadingIndicator.indicatorType||"Shimmer"===this.parent.loadingIndicator.indicatorType)&&this.parent.hideMaskRow(),this.parent.editModule&&this.parent.editModule.cellEditModule&&(this.parent.editModule.cellEditModule.isCellEdit=!1),this.parent.isVirtualScroll=!1,ne.isNullOrUndefined(this.parent.selectionModule)||ne.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()),this.prevCurrentView=ne.extend([],[],this.parent.currentViewData,!0)},r.prototype.dataStateChange=function(e){e.action&&"refresh"===e.action.requestType&&(this.parent.treeGrid.dataSource={result:ne.getValue("result",this.parent.treeGrid.dataSource),count:ne.getValue("count",this.parent.treeGrid.dataSource)}),this.parent.trigger("dataStateChange",e)},r.prototype.dataSourceChanged=function(e){this.parent.trigger("dataSourceChanged",e)},r.prototype.collapsing=function(e){var t,i=ne.getValue("data",e),a=i.length;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){if(ne.isNullOrUndefined(a))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.collapseGanttRow(t);else for(var n=0;n<a;n++)t=this.createExpandCollapseArgs(e,i[n]),this.parent.ganttChartModule.collapseGanttRow(t);ne.setValue("cancel",ne.getValue("cancel",t),e)}},r.prototype.expanding=function(e){var t,i=ne.getValue("data",e),a=i.length;if(!this.parent.ganttChartModule.isExpandCollapseFromChart){if(ne.isNullOrUndefined(a))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.expandGanttRow(t);else for(var n=0;n<a;n++)t=this.createExpandCollapseArgs(e,i[n]),this.parent.ganttChartModule.expandGanttRow(t);ne.setValue("cancel",ne.getValue("cancel",t),e)}},r.prototype.collapsed=function(e){var t=e.data,t=t&&t.expanded;if(this.parent.isCollapsePerformed=!0,!this.parent.enableVirtualization&&this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping&&!t&&(e.data[this.parent.taskFields.expandState]=!1),!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var i=void 0,a=ne.getValue("data",e),n=a.length;if(ne.isNullOrUndefined(n))i=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.collapsedGanttRow(i);else for(var r=0;r<n;r++)i=this.createExpandCollapseArgs(e,a[r]),this.parent.ganttChartModule.collapsedGanttRow(i);this.parent.ganttChartModule.isCollapseAll||!i.gridRow||this.parent.allowTaskbarOverlap||(i.gridRow.style.height=i.chartRow.style.height,this.parent.contentHeight=(this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2]:this.parent.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}this.parent.expandedRecords=this.parent.getExpandedRecords(this.parent.currentViewData),this.parent.showOverAllocation&&this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.parent.ganttChartModule.updateWidthAndHeight(),this.parent.ganttChartModule.reRenderConnectorLines(),this.parent.hideLoadingIndicator(),this.parent.trigger("collapsed",e),this.parent.isCollapsePerformed=!1},r.prototype.expanded=function(e){if(this.parent.isExpandPerformed=!0,!this.parent.ganttChartModule.isExpandCollapseFromChart&&!this.parent.isExpandCollapseLevelMethod){var t=void 0,i=ne.getValue("data",e),a=i.length;if(ne.isNullOrUndefined(a))t=this.createExpandCollapseArgs(e,null),this.parent.ganttChartModule.expandedGanttRow(t);else for(var n=0;n<a;n++)t=this.createExpandCollapseArgs(e,i[n]),this.parent.ganttChartModule.expandedGanttRow(t);this.parent.ganttChartModule.isExpandAll||!e.row||this.parent.allowTaskbarOverlap||(e.row.style.height=this.parent.rowHeight+"px",this.parent.contentHeight=(this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2]:this.parent.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px")}this.parent.expandedRecords=this.parent.getExpandedRecords(this.parent.currentViewData),this.parent.showOverAllocation&&this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData),this.parent.enableVirtualization||this.parent.updateContentHeight(),this.parent.ganttChartModule.updateWidthAndHeight(),this.parent.ganttChartModule.reRenderConnectorLines(),this.parent.hideLoadingIndicator(),this.parent.isCollapseAll=!1,this.parent.trigger("expanded",e),this.parent.isExpandPerformed=!0},r.prototype.actionBegin=function(e){if("save"===e.type&&e.column&&e.columnName===this.parent.taskFields.dependency&&e.value&&"ProjectView"===this.parent.viewType){var t=e.value.split(",").map(function(e){return e.trim()}).filter(Boolean);if(0===t.length)return;for(var i,a,n=this.parent.ids,r=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,s=/[A-Za-z]/,o=new Set(["FS","FF","SF","SS"]),l=e.rowData.ganttProperties.taskId.toString(),d=[],h=0,p=t;h<p.length;h++){var u=p[h],c=this.parent.predecessorModule.processPredecessorElement(u,n,!1,r,s,o);if(ne.isNullOrUndefined(c))break;var g=this.parent.connectorLineEditModule.idFromPredecessor(u);g&&0!==g.length&&(g={from:g[0],to:l,type:c.predecessorText},this.parent.allowParentDependency)&&(this.parent.cyclicValidator.resolve(),this.parent.cyclicValidator.wouldCreateCycleWhenAdding(g).wouldCreate)&&d.push({from:g.from,to:g.to,type:g.type,text:u})}0<d.length&&(i="Cyclic dependency detected for: "+d.map(function(e){return"Task ID "+e.from+" to Task ID "+e.to+" ("+e.type+")"}).join(", ")+". Please provide valid dependency.",a=new Set(d.map(function(e){return e.text})),t=t.filter(function(e){return!a.has(e)}).join(","),e.rowData[this.parent.taskFields.dependency]=e.rowData.ganttProperties.predecessorsName=""===t?null:t,this.parent.trigger("actionFailure",{error:i}))}"filterchoicerequest"===e.requestType&&(t=ne.getValue("filterModel.dlg",e))&&(t.classList.add("e-grid-popup"),t.style.display="none"),e&&"save"===e.type&&e.rowData&&e.rowData.ganttProperties&&(this.perviousStartDate=e.rowData.ganttProperties.startDate,this.perviousEndDate=e.rowData.ganttProperties.endDate),this.parent.notify("actionBegin",e),null!==ne.getValue("doubleClickTarget",this.parent.treeGrid.editModule)&&ne.setValue("doubleClickTarget",null,this.parent.treeGrid.editModule),this.parent.trigger("actionBegin",e),this.parent.trigger("cellSave",e),"virtualscroll"===e.requestType||"edit"===e.type||"beginEdit"===e.requestType||e.cancel||this.parent.showLoadingIndicator()},r.prototype.created=function(e){this.updateKeyConfigSettings()},r.prototype.actionFailure=function(e){this.parent.trigger("actionFailure",e)},r.prototype.createExpandCollapseArgs=function(e,t){var i=ne.getValue("data",e).length;return ne.isNullOrUndefined(i)?{data:i=ne.getValue("data",e),gridRow:ne.getValue("row",e),chartRow:this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(i)],cancel:!1}:{data:t,gridRow:ne.getValue("row",e),chartRow:this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(t)],cancel:!1}},r.prototype.maxLimits=function(e){switch(e){case"day":return 1e3;case"minute":return 24e3;case"hour":return 144e4;default:return 1e3}},r.prototype.isGuID=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},r.prototype.splitByLastOffset=function(e){var t=e.lastIndexOf("+"),i=e.lastIndexOf("-"),t=Math.max(t,i),i="";return-1===t?null:(i=e.substring(t),t=Number(i.match(/\d+/)),this.isGuID(e)?0:t)},r.prototype.updatePredecessorLimits=function(e,r,s){var o=this;return e.map(function(e){var t,i,a="",n=o.splitByLastOffset(e);return!isNaN(n)&&s<=n?(t=e.split(/[\+\-]/),-1!==(i=(n=r.split(",")).findIndex(function(e){return e.trim().toLowerCase()===t[0].trim().toLowerCase()}))&&(a=n[i],t.pop())):a=e,a}).join(",")},r.prototype.treeActionComplete=function(e){var t,i=!1,a=ne.extend({},e);if("reorder"===ne.getValue("requestType",e)){this.parent.undoRedoModule&&!this.parent.undoRedoModule.isFromUndoRedo&&this.parent.isUndoRedoItemPresent("ColumnReorder")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(n={action:"ColumnReorder"}).fromIndex=ne.extend([],[],[e.fromIndex],!0)[0],n.toIndex=ne.extend([],[],[e.toIndex],!0)[0],n.toColumn=ne.extend([],[],[this.parent.treeGrid.columns[e.toIndex].field],!0)[0],n.fromColumn=ne.extend([],[],[this.parent.treeGrid.columns[e.fromIndex].field],!0)[0],this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=n);var n,r=null;if(this.parent.treeGrid&&this.parent.treeGrid.columnModel&&this.parent.treeGrid.columnModel[this.parent.treeGrid.treeColumnIndex]?r=this.parent.treeGrid.columnModel[this.parent.treeGrid.treeColumnIndex].field:this.parent.previousGanttColumns&&this.parent.previousGanttColumns[this.parent.treeColumnIndex]&&(r=this.parent.previousGanttColumns[this.parent.treeColumnIndex].field),!ne.isNullOrUndefined(r)){for(var s=-1,o=0;o<this.parent.columns.length;o++)if(this.parent.columns[o]&&this.parent.columns[o].field===r){s=o;break}-1!==s&&(this.parent.treeColumnIndex=s)}}if("columnstate"===ne.getValue("requestType",e)&&this.parent.undoRedoModule&&!this.parent.undoRedoModule.isFromUndoRedo&&this.parent.isUndoRedoItemPresent("ColumnState")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(n={action:"ColumnState"}).showhideColumns=ne.extend([],[],e.columns,!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=n),"sorting"===ne.getValue("requestType",e)?(this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("Sorting")&&(this.parent.undoRedoModule.currentAction&&this.parent.undoRedoModule.currentAction.sortColumns&&1<this.parent.undoRedoModule.currentAction.sortColumns.length&&this.parent.undoRedoModule.sortedColumnsLength++,this.parent.undoRedoModule.currentAction&&(!this.parent.undoRedoModule.currentAction.sortColumns||this.parent.undoRedoModule.sortedColumnsLength===this.parent.undoRedoModule.currentAction.sortColumns.length)||this.parent.undoRedoModule.isFromUndoRedo||(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(n={action:"Sorting",sortColumns:[]}).sortColumns=this.parent.undoRedoModule.previousSortedColumns,this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=n),this.parent.undoRedoModule.previousSortedColumns=this.parent.treeGrid.sortSettings.columns),this.parent.notify("updateModel",{}),ne.deleteObject(a,"isFrozen")):"filtering"===ne.getValue("requestType",e)?(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isFromUndoRedo&&this.parent.isUndoRedoItemPresent("Filtering")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(n={action:"Filtering"}).filteredColumns=ne.extend([],[],e.columns,!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=n),this.parent.notify("updateModel",{})):"save"===ne.getValue("type",e)&&((g=ne.isNullOrUndefined(e.column)?null:e.column.field)&&e.previousData===e.data[g]&&(i=!0),this.parent.editModule)&&this.parent.editModule.cellEditModule&&(t=ne.getValue("data",e),!ne.isNullOrUndefined(g)&&(g===this.parent.taskFields.startDate||g===this.parent.taskFields.endDate)&&e.previousData instanceof Date&&ne.isNullOrUndefined(e.data[g])&&(this.isDateColumnCellEdit=!0),ne.isNullOrUndefined(t)||ne.isNullOrUndefined(this.parent.getTaskByUniqueID(t.uniqueID))||(this.parent.getTaskByUniqueID(t.uniqueID).taskData[this.parent.taskFields.duration]=t.taskData[this.parent.taskFields.duration],ne.isNullOrUndefined(t.taskData[this.parent.taskFields.resourceInfo]))||(this.parent.getTaskByUniqueID(t.uniqueID).taskData[this.parent.taskFields.resourceInfo]=t.taskData[this.parent.taskFields.resourceInfo]),z(this.currentEditRow)&&e.column&&e.column.edit&&e.column.field===this.parent.taskFields.resourceInfo&&(g=this.parent.taskFields.resourceInfo,this.currentEditRow=((c={})[g]=t.resources,c)),e.data[this.parent.taskFields.dependency]&&e.column.field===this.parent.taskFields.dependency&&(g=e.data[this.parent.taskFields.dependency].split(","),t=this.maxLimits(this.parent.durationUnit),e.data[this.parent.taskFields.dependency]=this.updatePredecessorLimits(g,e.previousData,t)),this.parent.editModule.cellEditModule.initiateCellEdit(e,this.currentEditRow),this.parent.editModule.cellEditModule.isCellEdit=!1,this.currentEditRow={}),"filterAfterOpen"===ne.getValue("requestType",e)&&this.parent.notify("actionComplete",e),"searching"===ne.getValue("requestType",e)&&(this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("Search")&&(this.parent.undoRedoModule.isFromUndoRedo||(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(n={action:"Search"}).searchString=this.parent.undoRedoModule.searchString,this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=n),this.parent.undoRedoModule.searchString=this.parent.treeGrid.searchSettings.key),this.parent.notify("actionComplete",e)),ne.isNullOrUndefined(this.parent.toolbarModule)||ne.isNullOrUndefined(ne.getValue("batchChanges",e))||this.parent.toolbarModule.refreshToolbarItems(),this.parent.isCancelled&&(ne.setValue("requestType","cancel",a),ne.setValue("action","CellEditing",a),this.parent.isCancelled=!1),"refresh"===ne.getValue("requestType",e)&&ne.isNullOrUndefined(ne.getValue("type",e))&&this.parent.addDeleteRecord){if(-1!==this.parent.selectedRowIndex)if(this.parent.editModule.isAdded&&!ne.isNullOrUndefined(this.parent.selectionModule)&&this.parent.selectionSettings&&this.parent.selectionSettings.persistSelection){var l=this.parent.selectionModule.selectedRowIndexes;if(1<l.length&&this.parent.selectionSettings.persistSelection)for(o=0;o<l.length;o++){var d=this.parent.flatData[l[o].toString()];this.parent.selectRows(d)}}else this.parent.selectRow(this.parent.selectedRowIndex),this.parent.selectedRowIndex>this.parent.currentViewData.length-1&&(this.parent.selectedRowIndex=-1);else{if(!ne.isNullOrUndefined(this.parent.selectionModule)&&this.parent.selectionSettings&&this.parent.selectionSettings.persistSelection&&this.parent.editModule&&!this.parent.editModule.isAdded)for(var h=this.parent.selectionModule.getSelectedRecords(),p=this,o=h.length-1;0<=o;o--)!function(e){var t=h[e][p.parent.taskFields.id];p.parent.editModule.deletedRecord.some(function(e){return e.ganttProperties.taskId===t})&&h.splice(e,1)}(o);var u=0,c=this.parent.enableVirtualization?this.parent.flatData:this.parent.currentViewData,g=this.parent.currentSelection,f="ResourceView"===this.parent.viewType;if(!ne.isNullOrUndefined(g)){var m=g.ganttProperties;if(ne.isNullOrUndefined(m))return;var y=(ne.isNullOrUndefined(m)||ne.isNullOrUndefined(g.hasChildRecords)||!g.hasChildRecords?"T":"R")+m.taskId,D=g[this.parent.taskFields.id];c.map(function(e,t){var i;ne.isNullOrUndefined(e)||(i=e.ganttProperties,ne.isNullOrUndefined(i))||(f?(!ne.isNullOrUndefined(m)&&!ne.isNullOrUndefined(i)&&(!ne.isNullOrUndefined(e.hasChildRecords)&&e.hasChildRecords?"R":"T")+i.taskId)===y:i.taskId===D)&&(u=t)})}this.addedRecord=!0,this.parent.selectRow(ne.isNullOrUndefined(u)?0:u)}this.parent.isExpandPerformed||(this.parent.addDeleteRecord=!1),this.parent.isExpandPerformed=!1,this.parent.isCollapsePerformed=!1}if(this.parent.undoRedoModule&&(this.parent.undoRedoModule.isFromUndoRedo=!1),"refresh"===ne.getValue("requestType",e)&&this.parent.initiateEditAction(!1),i||this.setCancelArgs||this.parent.isDynamicDataUpdate||this.parent.trigger("actionComplete",a),this.parent.isDynamicDataUpdate&&(this.parent.isDynamicDataUpdate=!1),this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap){for(o=0;o<this.parent.currentViewData.length;o++)this.parent.currentViewData[o].hasChildRecords&&!this.parent.currentViewData[o].expanded&&this.parent.chartRowsModule.updateDragDropRecords(this.parent.currentViewData[o]);this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}"save"!==e.type&&this.parent.hideLoadingIndicator(),this.parent.filterModule&&this.parent.initialHierarchyMode!==this.parent.filterSettings.hierarchyMode&&(this.parent.initialHierarchyMode=this.parent.filterSettings.hierarchyMode,this.parent.filterModule.filteredResult)&&0<this.parent.filterModule.filteredResult.length&&this.parent.setProperties({dataSource:this.parent.dataSource},!1)},r.prototype.updateKeyConfigSettings=function(){delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.delete,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.insert,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlHome,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.ctrlEnd,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.grid.keyboardModule.keyConfigs.shiftTab,delete this.parent.treeGrid.keyboardModule.keyConfigs.enter,delete this.parent.treeGrid.keyboardModule.keyConfigs.upArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.downArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlShiftDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlUpArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.ctrlDownArrow,delete this.parent.treeGrid.keyboardModule.keyConfigs.tab,delete this.parent.treeGrid.keyboardModule.keyConfigs.shiftTab},r.prototype.wireEvents=function(){var e=this.parent.treeGrid.element.querySelector(".e-content");e&&ne.EventHandler.add(e,"scroll",this.scrollHandler,this),this.parent.isAdaptive&&ne.EventHandler.add(this.parent.treeGridPane,"click",this.treeGridClickHandler,this)},r.prototype.unWireEvents=function(){var e=this.parent.treeGrid.element&&this.parent.treeGrid.element.querySelector(".e-content");e&&ne.EventHandler.remove(e,"scroll",this.scrollHandler),this.parent.isAdaptive&&ne.EventHandler.remove(this.parent.treeGridPane,"click",this.treeGridClickHandler)},r.prototype.scrollHandler=function(e){var t=this.parent.treeGrid.element.querySelector(".e-content");t.scrollTop!==this.previousScroll.top&&this.parent.notify("grid-scroll",{top:t.scrollTop}),this.parent.contextMenuModule&&this.parent.contextMenuModule.isOpen&&this.previousScroll.top!==t.scrollTop&&this.parent.contextMenuModule.contextMenu.close(),this.previousScroll.top=t.scrollTop},r.prototype.validateGanttColumns=function(){for(var a=this.parent,e=a.columns.length,n=this.parent.taskFields,r=(this.parent.columnMapping={},this.parent.columnByField={},this.parent.customColumns=[],this.parent.ganttColumns=[],["id","name","startDate","endDate","duration","dependency","progress","baselineStartDate","baselineEndDate","baselineDuration","resourceInfo","notes","work","manual","type","milestone","segments","constraintType","constraintDate"]),s=this,t=0;t<e;t++)!function(e){var t={},e=("string"==typeof a.columns[e]?t.field=a.columns[e]:t=a.columns[e],t.isFrozen=t.isFrozen||void 0,t.freeze=t.freeze||void 0,[]);if(0===(e=0<r.length?r.filter(function(e){return t.field===n[e]}):e).length)return t.field!==s.parent.resourceFields.group&&("WBSCode"!==t.field&&"WBSPredecessor"!==t.field&&s.parent.customColumns.push(t.field),t.headerText=ne.isNullOrUndefined(t.headerText)?t.field:t.headerText,t.width=t.width||150,"WBSCode"===t.field?t.allowEditing=!1:t.allowEditing=!!ne.isNullOrUndefined(t.allowEditing)||t.allowEditing,"WBSCode"!==t.field&&"WBSPredecessor"!==t.field||(t.clipMode="EllipsisWithTooltip"),void 0===t.editType&&("date"===t.type?t.editType="datepickeredit":"datetime"===t.type?t.editType="datetimepickeredit":t.editType="stringedit"),t.type=t.type||"string","checkbox"===t.type&&s.parent.setProperties({selectionSettings:{type:"Multiple"}},!0),s.bindTreeGridColumnProperties(t,!0));var i=r.indexOf(e[0]);r.splice(i,1),s.createTreeGridColumn(t,!0),s.parent.columnMapping[e[0]]=t.field}(t);for(var i=0;i<r.length;i++){var o={};ne.isNullOrUndefined(n[r[i]])||(o.field=n[r[i]],this.createTreeGridColumn(o,0===e),this.parent.columnMapping[r[i]]=o.field)}"ProjectView"!==this.parent.viewType&&(this.composeUniqueIDColumn(o={}),this.createTreeGridColumn(o,!0))},r.prototype.getLocalizedConstraintTypeText=function(e){return this.parent.localeObj.getConstant("constraintType"+e)},r.prototype.createTreeGridColumn=function(t,e){var i,a=this,n=this.parent.taskFields,r=this.parent.previousGanttColumns.filter(function(e){return t.field===e.field})[0];t.disableHtmlEncode=(ne.isNullOrUndefined(t.disableHtmlEncode)?this.parent:t).disableHtmlEncode,n.id!==t.field&&(t.clipMode=t.clipMode||"EllipsisWithTooltip"),n.id===t.field?this.composeIDColumn(t):n.name===t.field?(this.parent.isLocaleChanged&&r?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("name"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("name"):t.headerText,t.width=t.width||150,t.editType=t.editType||"stringedit",t.type=t.type||"string"):n.startDate===t.field?(this.parent.isLocaleChanged&&r?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("startDate"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("startDate"):t.headerText,t.editType=t.editType||(-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"),t.format=t.format||{type:"date",format:this.parent.getDateFormat()},t.width=t.width||150,t.edit&&t.edit.params?t.edit.params.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent):t.edit?t.edit.params={renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}:t.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}}):n.baselineStartDate===t.field||n.baselineEndDate===t.field?(i=n.baselineEndDate===t.field?"baselineEndDate":"baselineStartDate",t.width=t.width||150,this.parent.isLocaleChanged&&r?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant(i):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant(i):t.headerText,t.format=t.format||{type:"date",format:this.parent.getDateFormat()},t.editType=t.editType||(-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit")):n.endDate===t.field?(this.parent.isLocaleChanged&&r?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("endDate"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("endDate"):t.headerText,t.format=t.format||{type:"date",format:this.parent.getDateFormat()},t.editType=t.editType||(-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"),t.width=t.width||150,t.edit&&t.edit.params?t.edit.params.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent):t.edit?t.edit.params={renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}:t.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}}):n.constraintDate===t.field?(this.parent.isLocaleChanged&&r?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("constraintDate"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("constraintDate"):t.headerText,t.format=t.format||{type:"date",format:this.parent.getDateFormat()},t.editType=t.editType||(-1!==this.parent.getDateFormat().toLowerCase().indexOf("hh")?"datetimepickeredit":"datepickeredit"),t.width=t.width||150,t.edit&&t.edit.params?t.edit.params.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent):t.edit?t.edit.params={renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}:t.edit={params:{renderDayCell:this.parent.renderWorkingDayCell.bind(this.parent)}}):n.duration===t.field?(t.width=t.width||150,this.parent.isLocaleChanged&&r?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("duration"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("duration"):t.headerText,t.valueAccessor=t.valueAccessor||(ne.isNullOrUndefined(t.edit)||ne.isNullOrUndefined(t.edit.read)?this.durationValueAccessor.bind(this):null),t.editType=t.editType||"stringedit",t.type=t.type||"string"):n.progress===t.field?this.composeProgressColumn(t):n.dependency===t.field?(this.parent.isLocaleChanged&&r?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("dependency"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("dependency"):t.headerText,t.width=t.width||150,t.editType=t.editType||"stringedit",t.type="string",t.allowFiltering=!1!==t.allowFiltering,t.valueAccessor=t.valueAccessor||this.dependencyValueAccessor.bind(this),ne.isNullOrUndefined(t.filter)&&"en-US"!==this.parent.locale&&(t.filter={ui:{create:function(e){var t=ne.createElement("input",{className:"flm-input"});e.target.appendChild(t),a.dropInstance=new F.AutoComplete({dataSource:a.changeLocale(a.parent.treeGrid.grid.dataSource),fields:{text:a.parent.taskFields.dependency,value:a.parent.taskFields.dependency},placeholder:a.parent.localeObj.getConstant("enterValue"),popupHeight:"200px"}),a.dropInstance.appendTo(t)},write:function(e){a.dropInstance.value=e.filteredValue},read:function(e){e.fltrObj.filterByColumn(e.column.field,e.operator,a.changeDelocale(a.dropInstance.value))}}})):n.resourceInfo===t.field?this.composeResourceColumn(t):n.notes===t.field?(r&&this.parent.isLocaleChanged?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("notes"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("notes"):t.headerText,t.width=t.width||150,t.editType=t.editType||"stringedit",this.parent.showInlineNotes||t.template||(t.template=ne.initializeCSPTemplate(function(){return'<div class="e-ganttnotes-info">\n <span class="e-icons e-notes-info"></span>\n </div>'}))):n.baselineDuration===t.field?(t.width=t.width||150,this.parent.isLocaleChanged&&r?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("baselineDuration"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("baselineDuration"):t.headerText,t.valueAccessor=t.valueAccessor||(ne.isNullOrUndefined(t.edit)||ne.isNullOrUndefined(t.edit.read)?this.baselineDurationValueAccessor.bind(this):null),t.editType=t.editType||"stringedit",t.type=t.type||"string"):n.work===t.field?(r&&this.parent.isLocaleChanged?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("work"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("work"):t.headerText,t.width=t.width||150,t.valueAccessor=t.valueAccessor||this.workValueAccessor.bind(this),t.editType=t.editType||"numericedit"):n.type===t.field?(r&&this.parent.isLocaleChanged?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("taskType"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("taskType"):t.headerText,t.width=t.width||150,t.editType="dropdownedit",t.valueAccessor=t.valueAccessor||this.taskTypeValueAccessor.bind(this)):n.manual===t.field&&"Custom"===this.parent.taskMode?(r&&this.parent.isLocaleChanged?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("taskMode"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("taskMode"):t.headerText,t.width=t.width||120,t.editType=t.editType||"dropdownedit",t.valueAccessor=t.valueAccessor||this.modeValueAccessor.bind(this),t.edit={params:{query:new U.Query,dataSource:[{id:1,text:this.parent.localeObj.getConstant("manual"),value:!0},{id:2,text:this.parent.localeObj.getConstant("auto"),value:!1}],fields:{text:"text",value:"value"}}}):n.constraintType===t.field&&(r&&this.parent.isLocaleChanged?t.headerText=ne.isNullOrUndefined(r.headerText)?this.parent.localeObj.getConstant("constraintType"):r.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("constraintType"):t.headerText,t.width=t.width||160,t.editType=t.editType||"dropdownedit",i=Object.keys(k.ConstraintType).filter(function(e){return!isNaN(Number(k.ConstraintType[e]))}).map(function(e){return{text:a.getLocalizedConstraintTypeText(e),value:k.ConstraintType[e]}}),t.valueAccessor=t.valueAccessor||this.constraintTypeValueAccessor.bind(this),t.edit={params:{dataSource:i,fields:{text:"text",value:"value"},query:new U.Query}}),this.bindTreeGridColumnProperties(t,e)},r.prototype.changeLocale=function(e){var n=this,t=[];return e.map(function(e){return e.ganttProperties.predecessorsName}).map(function(e){var i,a;ne.isNullOrUndefined(e)||(i="",(a=e.split(",")).map(function(e,t){e.includes("FS")?i=(i+=e.replace("FS",n.parent.localeObj.getConstant("FS")))+(a.length!==t+1?",":""):e.includes("FF")?i=(i+=e.replace("FF",n.parent.localeObj.getConstant("FF")))+(a.length!==t+1?",":""):e.includes("SS")?i=(i+=e.replace("SS",n.parent.localeObj.getConstant("SS")))+(a.length!==t+1?",":""):e.includes("SF")&&(i=(i+=e.replace("SF",n.parent.localeObj.getConstant("SF")))+(a.length!==t+1?",":""))}),t.push(i))}),t},r.prototype.changeDelocale=function(e){var i,a,n=this.parent.localeObj.getConstant("FF"),r=this.parent.localeObj.getConstant("FS"),s=this.parent.localeObj.getConstant("SS"),o=this.parent.localeObj.getConstant("SF");return ne.isNullOrUndefined(e)?null:(i=e.split(","),a="",i.map(function(e,t){a=e.includes(n)?(a+=e.replace(n,"FF"))+(i.length!==t+1?",":""):e.includes(r)?(a+=e.replace(r,"FS"))+(i.length!==t+1?",":""):e.includes(s)?(a+=e.replace(s,"SS"))+(i.length!==t+1?",":""):e.includes(o)?(a+=e.replace(o,"SF"))+(i.length!==t+1?",":""):(a+=e)+(i.length!==t+1?",":"")}),a)},r.prototype.composeResourceColumn=function(t){var e=this.parent.previousGanttColumns.filter(function(e){return t.field===e.field})[0];e&&this.parent.isLocaleChanged?t.headerText=ne.isNullOrUndefined(e.headerText)?this.parent.localeObj.getConstant("resourceName"):e.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("resourceName"):t.headerText,t.width=t.width||150,t.type="string",t.valueAccessor=t.valueAccessor||this.resourceValueAccessor.bind(this),t.allowFiltering=!1!==t.allowFiltering},r.prototype.getResourceIds=function(e){var t=ne.getValue(this.parent.taskFields.resourceInfo,e.taskData),i=[];if(ne.isNullOrUndefined(t))return t;for(var a=0;a<t.length;a++)i.push("object"==typeof t[a]?t[a][this.parent.resourceFields.id]:t[a]);return i},r.prototype.composeIDColumn=function(t){var e,i,a="ProjectView"===this.parent.viewType,n=this.parent.dataSource?this.parent.dataSource.length:0;t.isPrimaryKey=a,this.parent.isLocaleChanged?(i=this.parent.previousGanttColumns.filter(function(e){return t.field===e.field})[0])&&(t.headerText=ne.isNullOrUndefined(i.headerText)?this.parent.localeObj.getConstant("id"):i.headerText):t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("id"):t.headerText,t.width=t.width||100;for(var r=0;r<n;r++)if(!ne.isNullOrUndefined(this.parent.dataSource[r][this.parent.taskFields.id])){e=this.parent.dataSource[r][this.parent.taskFields.id];break}ne.isNullOrUndefined(t.type)||"string"!==t.type||"string"!=typeof e&&!ne.isNullOrUndefined(e)?(t.allowEditing=t.allowEditing||!1,t.editType=t.editType||"numericedit"):("ResourceView"===this.parent.viewType?t.allowEditing=t.allowEditing||!1:t.allowEditing=t.allowEditing||!0,t.editType=t.editType||"stringedit"),t.valueAccessor=a?null:this.idValueAccessor.bind(this)},r.prototype.composeUniqueIDColumn=function(e){e.field="rowUniqueID",e.isPrimaryKey=!0,e.headerText="UniqueID",e.allowEditing=!1,e.visible=!1},r.prototype.composeProgressColumn=function(t){var e=this.parent.previousGanttColumns.filter(function(e){return t.field===e.field})[0];this.parent.isLocaleChanged&&e?t.headerText=ne.isNullOrUndefined(e.headerText)?this.parent.localeObj.getConstant("progress"):e.headerText:t.headerText=ne.isNullOrUndefined(t.headerText)?this.parent.localeObj.getConstant("progress"):t.headerText,t.width=t.width||150,t.editType=t.editType||"numericedit"},r.prototype.bindTreeGridColumnProperties=function(e,t){for(var i={},a={},n=0,r=Object.keys(e);n<r.length;n++)i[s=r[n]]=a[s]=e[s];for(var s,o=0,l=["template","editTemplate","filterTemplate","filter_itemTemplate","headerTemplate","formatter"];o<l.length;o++)(s=l[o])in e&&null!=e[s]&&(i[s]=a[s]=e[s]);a.field!==this.parent.taskFields.constraintDate||"type"in a||("datepickeredit"===a.editType?a.type="date":"datetimepickeredit"===a.editType&&(a.type="datetime"),i.type=a.type),this.parent.columnByField[a.field]=a,this.parent.ganttColumns.push(new Et(a)),t&&this.treeGridColumns.push(i)},r.prototype.durationValueAccessor=function(e,t,i){return ne.isNullOrUndefined(this.parent.treeGrid.excelExportModule)||ne.isNullOrUndefined(this.parent.treeGrid.excelExportModule.dataResults.data)||!ne.isNullOrUndefined(t.ganttProperties)||ne.isNullOrUndefined(t[this.parent.taskFields.id])||(t=this.parent.getRecordByID(t[this.parent.taskFields.id].toString())),ne.isNullOrUndefined(t)||ne.isNullOrUndefined(t.ganttProperties)?this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.dataOperation.getDurationString(parseInt(t[this.parent.taskFields.duration],10),this.parent.durationUnit):"":(t=t.ganttProperties,this.parent.dataOperation.getDurationString(t.duration,t.durationUnit))},r.prototype.dependencyValueAccessor=function(e,t,i){var a,n,r=this;return(t=ne.isNullOrUndefined(this.parent.treeGrid.excelExportModule)||ne.isNullOrUndefined(this.parent.treeGrid.excelExportModule.dataResults.data)||!ne.isNullOrUndefined(t.ganttProperties)||ne.isNullOrUndefined(t[this.parent.taskFields.id])?t:this.parent.getRecordByID(t[this.parent.taskFields.id].toString()))&&t.ganttProperties&&!ne.isNullOrUndefined(t.ganttProperties.predecessorsName)?(a="",(n=t.ganttProperties.predecessorsName.split(",")).map(function(e,t){e.includes("FS")?a=(a+=e.replace("FS",r.parent.localeObj.getConstant("FS")))+(n.length!==t+1?",":""):e.includes("FF")?a=(a+=e.replace("FF",r.parent.localeObj.getConstant("FF")))+(n.length!==t+1?",":""):e.includes("SS")?a=(a+=e.replace("SS",r.parent.localeObj.getConstant("SS")))+(n.length!==t+1?",":""):e.includes("SF")&&(a=(a+=e.replace("SF",r.parent.localeObj.getConstant("SF")))+(n.length!==t+1?",":""))}),a):""},r.prototype.resourceValueAccessor=function(e,t,i){var a;return ne.isNullOrUndefined(t)||(a=t.ganttProperties),ne.isNullOrUndefined(a)?"":a.resourceNames},r.prototype.workValueAccessor=function(e,t,i){return ne.isNullOrUndefined(t)||ne.isNullOrUndefined(t.ganttProperties)?"":(t=t.ganttProperties,this.parent.dataOperation.getWorkString(t.work,t.workUnit))},r.prototype.taskTypeValueAccessor=function(e,t,i){return ne.isNullOrUndefined(t)||ne.isNullOrUndefined(t.ganttProperties)?"":t.ganttProperties.taskType},r.prototype.modeValueAccessor=function(e,t,i){return t[e]?"Manual":"Auto"},r.prototype.constraintTypeValueAccessor=function(t,i,e){var a=Object.keys(k.ConstraintType).find(function(e){return k.ConstraintType[e]===i[t]});return this.getLocalizedConstraintTypeText(a)},r.prototype.baselineDurationValueAccessor=function(e,t,i){return ne.isNullOrUndefined(t)||ne.isNullOrUndefined(t.ganttProperties)?this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?this.parent.dataOperation.getDurationString(parseInt(t[this.parent.taskFields.baselineDuration],10),this.parent.durationUnit):"":(t=t.ganttProperties,this.parent.dataOperation.getDurationString(t.baselineDuration,t.durationUnit))},r.prototype.idValueAccessor=function(e,t,i){return 0===t.level?"R-"+t.ganttProperties.taskId:"T-"+t.ganttProperties.taskId},r.prototype.updateScrollTop=function(e){e=ne.getValue("top",e);this.treeGridElement.querySelector(".e-content").scrollTop=e,this.previousScroll.top=this.treeGridElement.querySelector(".e-content").scrollTop,this.parent.contextMenuModule&&this.parent.contextMenuModule.isOpen&&this.parent.contextMenuModule.contextMenu.close()},r.prototype.treeGridClickHandler=function(e){this.parent.notify("treeGridClick",e)},r.prototype.setPartialSelectionForGrid=function(e){e.isResetPartialRecords=this.parent.addDeleteRecord},r.prototype.removeEventListener=function(){this.parent.off("renderPanels",this.createContainer),this.parent.off("chartScroll",this.updateScrollTop),this.parent.off("destroy",this.destroy),this.parent.treeGrid.off("reactTemplateRender",this.renderReactTemplate),this.parent.treeGrid.grid.off("beforeSetPartialRecords",this.setPartialSelectionForGrid)},r.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents(),this.parent.treeGrid.element&&this.parent.treeGrid.destroy()},r);function r(e){var s=this;this.isPersist=!1,this.setCancelArgs=!1,this.isDateColumnCellEdit=!1,this.previousScroll={top:0,left:0},this.queryCellInfo=function(e){s.parent.trigger("queryCellInfo",e)},this.headerCellInfo=function(e){s.parent.trigger("headerCellInfo",e)},this.rowDataBound=function(e){s.parent.trigger("rowDataBound",e)},this.columnMenuOpen=function(e){s.parent.notify("columnMenuOpen",e),s.parent.trigger("columnMenuOpen",e),document.querySelector(".e-colmenu").addEventListener("mousemove",function(){var e=document.querySelector(".e-filter-popup"),t=document.querySelector(".e-filter-item");ne.isNullOrUndefined(e)||t.classList.contains("e-focused")||ne.remove(s.parent.filterModule.filterMenuElement)})},this.columnMenuClick=function(e){s.parent.trigger("columnMenuClick",e)},this.objectEqualityChecker=function(e,t){if(e){for(var i=Object.keys(e),a=!0,n=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","ganttProperties"],r=0;r<i.length;r++)if((e[i[parseInt(r.toString(),10)]]instanceof Date?new Date(e[i[parseInt(r.toString(),10)]]).getTime():e[i[parseInt(r.toString(),10)]])!==(t[i[parseInt(r.toString(),10)]]instanceof Date?new Date(t[i[parseInt(r.toString(),10)]]).getTime():t[i[parseInt(r.toString(),10)]])&&-1===n.indexOf(i[r])){s.parent.modifiedRecords.push(t),a=!1;break}return a}return!1},this.parent=e,this.parent.treeGrid=new b.TreeGrid,this.parent.treeGrid.allowSelection=!1,this.parent.treeGrid.allowKeyboard=this.parent.allowKeyboard,this.parent.treeGrid["${enableHtmlSanitizer}"]=this.parent.enableHtmlSanitizer,this.parent.treeGrid.enableImmutableMode=this.parent.enableImmutableMode,this.parent.treeGrid.enableHover=this.parent.enableHover,this.treeGridColumns=[],!this.parent.isLocaleChanged&&this.parent.isLoad&&(this.parent.previousGanttColumns=ne.extend([],[],this.parent.columns,!0)),this.validateGanttColumns(),this.parent.isLocaleChanged&&(this.parent.isLocaleChanged=!1),this.addEventListener()}Ut=function(e,t){return(Ut=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ut,Nt,s=function(e,t){function i(){this.constructor=e}Ut(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Lt=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},s=(Nt=ne.ChildProperty,s(Vt,Nt),Lt([ne.Property(null)],Vt.prototype,"from",void 0),Lt([ne.Property(null)],Vt.prototype,"to",void 0),Vt);function Vt(){return null!==Nt&&Nt.apply(this,arguments)||this}Bt=function(e,t){return(Bt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Bt,At,Lt=function(e,t){function i(){this.constructor=e}Bt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Wt=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Lt=(At=ne.ChildProperty,Lt(jt,At),Wt([ne.Property(null)],jt.prototype,"type",void 0),Wt([ne.Property(null)],jt.prototype,"headerText",void 0),Wt([ne.Property([])],jt.prototype,"fields",void 0),Wt([ne.Property({})],jt.prototype,"additionalParams",void 0),jt);function jt(){return null!==At&&At.apply(this,arguments)||this}Ht=function(e,t){return(Ht=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ht,Gt,Wt=function(e,t){function i(){this.constructor=e}Ht(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},zt=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Wt=(Gt=ne.ChildProperty,Wt(qt,Gt),zt([ne.Property(null)],qt.prototype,"type",void 0),zt([ne.Property(null)],qt.prototype,"headerText",void 0),zt([ne.Property([])],qt.prototype,"fields",void 0),zt([ne.Property({})],qt.prototype,"additionalParams",void 0),qt);function qt(){return null!==Gt&&Gt.apply(this,arguments)||this}_t=function(e,t){return(_t=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var _t,Zt,zt=function(e,t){function i(){this.constructor=e}_t(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Xt=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},zt=(Zt=ne.ChildProperty,zt(Yt,Zt),Xt([ne.Property(!1)],Yt.prototype,"allowEditing",void 0),Xt([ne.Property(!1)],Yt.prototype,"allowAdding",void 0),Xt([ne.Property(!1)],Yt.prototype,"allowDeleting",void 0),Xt([ne.Property("Auto")],Yt.prototype,"mode",void 0),Xt([ne.Property("Top")],Yt.prototype,"newRowPosition",void 0),Xt([ne.Property(!1)],Yt.prototype,"showDeleteConfirmDialog",void 0),Xt([ne.Property(!1)],Yt.prototype,"allowTaskbarEditing",void 0),Xt([ne.Property(!1)],Yt.prototype,"allowNextRowEdit",void 0),Yt);function Yt(){return null!==Zt&&Zt.apply(this,arguments)||this}Kt=function(e,t){return(Kt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Kt,Qt,Xt=function(e,t){function i(){this.constructor=e}Kt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},$t=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Xt=(Qt=ne.ChildProperty,Xt(Jt,Qt),$t([ne.Property(null)],Jt.prototype,"day",void 0),$t([ne.Property(null)],Jt.prototype,"label",void 0),$t([ne.Property(null)],Jt.prototype,"cssClass",void 0),$t([ne.Property("50px")],Jt.prototype,"top",void 0),Jt);function Jt(){return null!==Qt&&Qt.apply(this,arguments)||this}ei=function(e,t){return(ei=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ei,ti,$t=function(e,t){function i(){this.constructor=e}ei(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ii=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},$t=(ti=ne.ChildProperty,$t(ai,ti),ii([ne.Collection([],T.Predicate)],ai.prototype,"columns",void 0),ii([ne.Property("Menu")],ai.prototype,"type",void 0),ii([ne.Property()],ai.prototype,"operators",void 0),ii([ne.Property(!1)],ai.prototype,"ignoreAccent",void 0),ii([ne.Property("Parent")],ai.prototype,"hierarchyMode",void 0),ai);function ai(){return null!==ti&&ti.apply(this,arguments)||this}ni=function(e,t){return(ni=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ni,ri,ii=function(e,t){function i(){this.constructor=e}ni(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},si=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},ii=(ri=ne.ChildProperty,ii(oi,ri),si([ne.Property([])],oi.prototype,"fields",void 0),si([ne.Property(!1)],oi.prototype,"ignoreCase",void 0),si([ne.Property("contains")],oi.prototype,"operator",void 0),si([ne.Property("")],oi.prototype,"key",void 0),si([ne.Property("Parent")],oi.prototype,"hierarchyMode",void 0),oi);function oi(){return null!==ri&&ri.apply(this,arguments)||this}li=function(e,t){return(li=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var li,di,si=function(e,t){function i(){this.constructor=e}li(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},hi=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},si=(di=ne.ChildProperty,si(pi,di),hi([ne.Property(null)],pi.prototype,"from",void 0),hi([ne.Property(null)],pi.prototype,"to",void 0),hi([ne.Property(null)],pi.prototype,"label",void 0),hi([ne.Property(null)],pi.prototype,"cssClass",void 0),pi);function pi(){return null!==di&&di.apply(this,arguments)||this}ui=function(e,t){return(ui=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ui,ci,hi=function(e,t){function i(){this.constructor=e}ui(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},gi=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},hi=(ci=ne.ChildProperty,hi(fi,ci),gi([ne.Property(null)],fi.prototype,"rightLabel",void 0),gi([ne.Property(null)],fi.prototype,"leftLabel",void 0),gi([ne.Property(null)],fi.prototype,"taskLabel",void 0),fi);function fi(){return null!==ci&&ci.apply(this,arguments)||this}mi=function(e,t){return(mi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var mi,yi,gi=function(e,t){function i(){this.constructor=e}mi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Di=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},gi=(yi=ne.ChildProperty,gi(ki,yi),Di([ne.Property("Row")],ki.prototype,"mode",void 0),Di([ne.Property("Flow")],ki.prototype,"cellSelectionMode",void 0),Di([ne.Property("Single")],ki.prototype,"type",void 0),Di([ne.Property(!1)],ki.prototype,"persistSelection",void 0),Di([ne.Property(!1)],ki.prototype,"enableToggle",void 0),ki);function ki(){return null!==yi&&yi.apply(this,arguments)||this}Ti=function(e,t){return(Ti=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ti,bi,Di=function(e,t){function i(){this.constructor=e}Ti(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wi=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Di=(bi=ne.ChildProperty,Di(vi,bi),wi([ne.Property(null)],vi.prototype,"position",void 0),wi([ne.Property(-1)],vi.prototype,"columnIndex",void 0),wi([ne.Property(4)],vi.prototype,"separatorSize",void 0),wi([ne.Property(null)],vi.prototype,"minimum",void 0),wi([ne.Property("Default")],vi.prototype,"view",void 0),vi);function vi(){return null!==bi&&bi.apply(this,arguments)||this}Si=function(e,t){return(Si=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Si,Pi,wi=function(e,t){function i(){this.constructor=e}Si(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},o=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},wi=(Pi=ne.ChildProperty,wi(d,Pi),o([ne.Property(null)],d.prototype,"id",void 0),o([ne.Property(null)],d.prototype,"name",void 0),o([ne.Property(null)],d.prototype,"parentID",void 0),o([ne.Property(null)],d.prototype,"hasChildMapping",void 0),o([ne.Property(null)],d.prototype,"startDate",void 0),o([ne.Property(null)],d.prototype,"endDate",void 0),o([ne.Property(null)],d.prototype,"dependency",void 0),o([ne.Property(null)],d.prototype,"progress",void 0),o([ne.Property(null)],d.prototype,"child",void 0),o([ne.Property(null)],d.prototype,"milestone",void 0),o([ne.Property(null)],d.prototype,"duration",void 0),o([ne.Property(null)],d.prototype,"durationUnit",void 0),o([ne.Property(null)],d.prototype,"cssClass",void 0),o([ne.Property(null)],d.prototype,"baselineStartDate",void 0),o([ne.Property(null)],d.prototype,"baselineEndDate",void 0),o([ne.Property(null)],d.prototype,"baselineDuration",void 0),o([ne.Property(null)],d.prototype,"resourceInfo",void 0),o([ne.Property(null)],d.prototype,"expandState",void 0),o([ne.Property(null)],d.prototype,"indicators",void 0),o([ne.Property(null)],d.prototype,"notes",void 0),o([ne.Property(null)],d.prototype,"work",void 0),o([ne.Property(null)],d.prototype,"manual",void 0),o([ne.Property(null)],d.prototype,"type",void 0),o([ne.Property(null)],d.prototype,"segments",void 0),o([ne.Property(null)],d.prototype,"segmentId",void 0),o([ne.Property(null)],d.prototype,"constraintType",void 0),o([ne.Property(null)],d.prototype,"constraintDate",void 0),o([ne.Property(null)],d.prototype,"calendarId",void 0),d);function d(){return null!==Pi&&Pi.apply(this,arguments)||this}Ci=function(e,t){return(Ci=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ci,Ri,o=function(e,t){function i(){this.constructor=e}Ci(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Mi=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},xi=(Ri=ne.ChildProperty,o(Oi,Ri),Mi([ne.Property("")],Oi.prototype,"format",void 0),Mi([ne.Property("None")],Oi.prototype,"unit",void 0),Mi([ne.Property(1)],Oi.prototype,"count",void 0),Mi([ne.Property(null)],Oi.prototype,"formatter",void 0),Oi);function Oi(){return null!==Ri&&Ri.apply(this,arguments)||this}Ii=ne.ChildProperty,o(Ei,Ii),Mi([ne.Property("Week")],Ei.prototype,"timelineViewMode",void 0),Mi([ne.Complex({},xi)],Ei.prototype,"topTier",void 0),Mi([ne.Complex({},xi)],Ei.prototype,"bottomTier",void 0),Mi([ne.Property(33)],Ei.prototype,"timelineUnitSize",void 0),Mi([ne.Property(0)],Ei.prototype,"weekStartDay",void 0),Mi([ne.Property(null)],Ei.prototype,"weekendBackground",void 0),Mi([ne.Property(!0)],Ei.prototype,"showTooltip",void 0),Mi([ne.Property(!0)],Ei.prototype,"updateTimescaleView",void 0),Mi([ne.Property(!0)],Ei.prototype,"showWeekend",void 0),Mi([ne.Property("auto")],Ei.prototype,"viewStartDate",void 0),Mi([ne.Property("auto")],Ei.prototype,"viewEndDate",void 0);var Ii,o=Ei;function Ei(){return null!==Ii&&Ii.apply(this,arguments)||this}Fi=function(e,t){return(Fi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Fi,Ui,Mi=function(e,t){function i(){this.constructor=e}Fi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ni=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Mi=(Ui=ne.ChildProperty,Mi(Li,Ui),Ni([ne.Property(!0)],Li.prototype,"showTooltip",void 0),Ni([ne.Property()],Li.prototype,"taskbar",void 0),Ni([ne.Property()],Li.prototype,"baseline",void 0),Ni([ne.Property()],Li.prototype,"connectorLine",void 0),Ni([ne.Property()],Li.prototype,"editing",void 0),Ni([ne.Property()],Li.prototype,"timeline",void 0),Li);function Li(){return null!==Ui&&Ui.apply(this,arguments)||this}Vi=function(e,t){return(Vi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Vi,Bi,Ni=function(e,t){function i(){this.constructor=e}Vi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ai=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Wi=(Bi=ne.ChildProperty,Ni(ji,Bi),Ai([ne.Property()],ji.prototype,"field",void 0),Ai([ne.Property()],ji.prototype,"direction",void 0),ji);function ji(){return null!==Bi&&Bi.apply(this,arguments)||this}Hi=ne.ChildProperty,Ni(Gi,Hi),Ai([ne.Collection([],Wi)],Gi.prototype,"columns",void 0),Ai([ne.Property(!0)],Gi.prototype,"allowUnsort",void 0);var Hi,Ni=Gi;function Gi(){return null!==Hi&&Hi.apply(this,arguments)||this}zi=function(e,t){return(zi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var zi,qi,Ai=function(e,t){function i(){this.constructor=e}zi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},_i=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Ai=(qi=ne.ChildProperty,Ai(Zi,qi),_i([ne.Property(null)],Zi.prototype,"id",void 0),_i([ne.Property(null)],Zi.prototype,"name",void 0),_i([ne.Property(null)],Zi.prototype,"unit",void 0),_i([ne.Property(null)],Zi.prototype,"group",void 0),Zi);function Zi(){return null!==qi&&qi.apply(this,arguments)||this}Xi=function(e,t){return(Xi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Xi,Yi,_i=function(e,t){function i(){this.constructor=e}Xi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ki=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},_i=(Yi=ne.ChildProperty,_i(Qi,Yi),Ki([ne.Property("Spinner")],Qi.prototype,"indicatorType",void 0),Qi);function Qi(){return null!==Yi&&Yi.apply(this,arguments)||this}$i=function(e,t){return($i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var $i,Ji,Ki=function(e,t){function i(){this.constructor=e}$i(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ea=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Ki=(Ji=ne.ChildProperty,Ki(ta,Ji),ea([ne.Property()],ta.prototype,"dayOfWeek",void 0),ea([ne.Collection([],s)],ta.prototype,"timeRange",void 0),ta);function ta(){return null!==Ji&&Ji.apply(this,arguments)||this}ia=function(e,t){return(ia=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ia,aa,ea=function(e,t){function i(){this.constructor=e}ia(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},na=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},ea=(aa=ne.ChildProperty,ea(ra,aa),na([ne.Property(null)],ra.prototype,"from",void 0),na([ne.Property(null)],ra.prototype,"to",void 0),na([ne.Property(null)],ra.prototype,"label",void 0),ra);function ra(){return null!==aa&&aa.apply(this,arguments)||this}sa=function(e,t){return(sa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var sa,oa,na=function(e,t){function i(){this.constructor=e}sa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},la=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},da=(oa=ne.ChildProperty,na(ha,oa),la([ne.Collection([{from:8,to:12},{from:13,to:17}],s)],ha.prototype,"workingTime",void 0),la([ne.Collection([],si)],ha.prototype,"holidays",void 0),la([ne.Collection([],ea)],ha.prototype,"exceptions",void 0),ha);function ha(){return null!==oa&&oa.apply(this,arguments)||this}pa=ne.ChildProperty,na(ua,pa),la([ne.Property(null)],ua.prototype,"calendarId",void 0),la([ne.Collection([],si)],ua.prototype,"holidays",void 0),la([ne.Collection([],ea)],ua.prototype,"exceptions",void 0);var pa,na=ua;function ua(){return null!==pa&&pa.apply(this,arguments)||this}ca=function(e,t){return(ca=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ca,ga,la=function(e,t){function i(){this.constructor=e}ca(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},fa=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},la=(ga=ne.ChildProperty,la(ma,ga),fa([ne.Complex({},da)],ma.prototype,"projectCalendar",void 0),fa([ne.Collection([],na)],ma.prototype,"taskCalendars",void 0),ma);function ma(){return null!==ga&&ga.apply(this,arguments)||this}ya=function(e,t){return(ya=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ya(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(u,Da=J),u.prototype.initPublicProp=function(){this.ganttChartTableBody=null},u.prototype.addEventListener=function(){this.parent.on("renderPanels",this.createChartTable,this),this.parent.on("dataReady",this.initiateTemplates,this),this.parent.on("destroy",this.destroy,this)},u.prototype.refreshChartByTimeline=function(){this.taskTable.style.width=ne.formatUnit(this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth);var e=ne.getValue("prevProjectStartDate",this.parent.dataOperation),t=!1;e&&(t=e.getTime()===this.parent.cloneProjectStartDate.getTime()),this.isUpdated=!!(this.parent.isFromOnPropertyChange&&t&&ne.getValue("mutableData",this.parent.treeGrid.grid.contentModule)),this.refreshGanttRows(),this.isUpdated=!0},u.prototype.createChartTable=function(){this.taskTable=ne.createElement("table",{className:"e-task-table e-zero-spacing",id:"GanttTaskTable"+this.parent.element.id,styles:"position: absolute; width: "+(this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth)+"px;",attrs:{cellspacing:"0.25px"}});var e=ne.createElement("colgroup"),t=ne.createElement("col",{styles:"width:"+this.parent.timelineModule.totalTimelineWidth+"px;"});e.appendChild(t),this.taskTable.appendChild(e),this.ganttChartTableBody=ne.createElement("tbody",{id:this.parent.element.id+"GanttTaskTableBody"}),this.taskTable.appendChild(this.ganttChartTableBody),this.parent.ganttChartModule.chartBodyContent.appendChild(this.taskTable)},u.prototype.initiateTemplates=function(){this.taskTable.style.width=ne.formatUnit(this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth),this.initChartHelperPrivateVariable(),this.initializeChartTemplate()},u.prototype.renderChartRows=function(){this.createTaskbarTemplate(),this.parent.isGanttChartRendered=!0},u.prototype.getIndicatorNode=function(e){e='<label class="'+l+' e-indicator-span" style="display: inline-flex; align-items: center; margin-top: 0; line-height:'+this.parent.rowHeight+"px;"+(this.parent.enableRtl?"right:":"left:")+this.getIndicatorleft(e.date)+'px;"><i class="'+e.iconClass+'" style="margin-right: 3px;"></i> </label>';return this.createDivElement(e)},u.prototype.getIndicatorleft=function(e){return e=this.parent.dateValidationModule.getDateFromFormat(e),this.parent.dataOperation.getTaskLeft(e,!1,this.parent.defaultCalendarContext)},u.prototype.getChildTaskbarNode=function(e,t){var i,a,n,r,s=null,o=this.templateData,l=this.parent.enableRtl?"right:":"left:",s=this.childTaskbarTemplateFunction?this.childTaskbarTemplateFunction(ne.extend({index:e},o),this.parent,"TaskbarTemplate",this.getTemplateID("TaskbarTemplate"),!1,void 0,t[0],this.parent.treeGrid.root):(r=t="",a=i=void 0,o.ganttProperties.startDate&&o.ganttProperties.endDate&&o.ganttProperties.duration&&(i=this.createDivElement('<div class="'+Pe+" "+Ge+" "+(o.ganttProperties.isAutoSchedule?"":Xe)+'"style="width:'+o.ganttProperties.width+"px;height:"+this.taskBarHeight+'px; margin-top :-1px"></div>'),a=this.createDivElement('<div class="'+Ce+" "+ze+" "+(o.ganttProperties.isAutoSchedule?"":"e-gantt-child-manualprogressbar")+'" style="border-style:'+(o.ganttProperties.progressWidth?"solid;":"none;")+"width:"+o.ganttProperties.progressWidth+"px;height:100%;border-top-right-radius:"+this.getBorderRadius(o.ganttProperties)+"px;border-bottom-right-radius:"+this.getBorderRadius(o.ganttProperties)+'px;"></div>')),n=ne.createElement("div"),this.taskLabelTemplateFunction&&!ne.isNullOrUndefined(a)&&0<a.length?(e=this.taskLabelTemplateFunction(ne.extend({index:e},o),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,a[0]))&&0<e.length&&(ne.append(e,n),t=n.innerHTML,t="isCustomTemplate"===(t=this.getTaskLabel(this.parent.labelSettings.taskLabel))?n.innerHTML:t,this.parent.enableHtmlSanitizer)&&"string"==typeof t&&(t=ne.SanitizeHtmlHelper.sanitize(t)):(e=this.parent.labelSettings.taskLabel,t="isCustomTemplate"===(t=this.getTaskLabel(e))?this.parent.labelSettings.taskLabel:t,this.parent.enableHtmlSanitizer&&"string"==typeof t&&(t=ne.SanitizeHtmlHelper.sanitize(t))),-1===t.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(t=""),r=isNaN(parseInt(t,10))?'<span class="'+Se+'" style="line-height:'+(this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(o.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="'+Se+'" style="line-height:'+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"text-align:"+(this.parent.enableRtl?"right;":"left;"):"")+ +("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+ +("ResourceView"===this.parent.viewType?o.ganttProperties.width-10:"")+"px; height:"+this.taskBarHeight+'px;"></span>'),e=!ne.isNullOrUndefined(o.ganttProperties.segments)&&0<o.ganttProperties.segments.length?this.splitTaskbar(o,t):o.ganttProperties.startDate&&o.ganttProperties.endDate&&o.ganttProperties.duration?r:!o.ganttProperties.startDate||o.ganttProperties.endDate||o.ganttProperties.duration?!o.ganttProperties.endDate||o.ganttProperties.startDate||o.ganttProperties.duration?!o.ganttProperties.duration||o.ganttProperties.startDate||o.ganttProperties.endDate?"":'<div class="'+Ce+" "+Ge+" e-gantt-unscheduled-taskbar "+(o.ganttProperties.isAutoSchedule?"":Xe)+'"style="'+l+o.ganttProperties.left+"px; width:"+o.ganttProperties.width+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+Ce+" "+Ge+" "+nt+" "+(o.ganttProperties.isAutoSchedule?"":Xe)+'"style="'+l+o.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>':'<div class="'+Ce+" "+Ge+" "+at+" "+(o.ganttProperties.isAutoSchedule?"":Xe)+'"style="'+l+o.ganttProperties.left+"px; height:"+this.taskBarHeight+'px;"></div>',o.ganttProperties.segments&&0<o.ganttProperties.segments.length&&(e+=this.getSplitProgressResizerNode()),o.ganttProperties.startDate&&o.ganttProperties.endDate&&o.ganttProperties.duration&&(ne.isNullOrUndefined(o.ganttProperties.segments)||!ne.isNullOrUndefined(o.ganttProperties.segments)&&0===o.ganttProperties.segments.length)?(""!==e&&!ne.isNullOrUndefined(a)&&0<a.length&&(r=this.createDivElement(e)[0],this.parent.disableHtmlEncode?r.innerText=t:r.innerHTML=t,(l=this.parent.labelSettings.taskLabel)&&l.elementRef&&r.appendChild(n),a[0].appendChild(r),""!==a[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(l)&&a[0].querySelectorAll(".e-task-label")[0].children[0]&&this.parent.disableHtmlEncode&&a[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""===a[0].querySelectorAll(".e-task-label")[0].textContent)&&l&&!l.elementRef&&""!==n.innerHTML&&(a[0].querySelectorAll(".e-task-label")[0].textContent=l),!ne.isNullOrUndefined(i)&&0<i.length&&i[0].appendChild([].slice.call(a)[0]),i):this.createDivElement(e));return this.parent.enableRtl&&!ne.isNullOrUndefined(s)&&s[0]&&s[0].querySelector(".e-task-label")&&(s[0].querySelector(".e-task-label").style.marginLeft="15px",s[0].querySelector(".e-task-label").style.marginRight="8px",s[0].querySelector(".e-gantt-child-progressbar"))&&(s[0].querySelector(".e-gantt-child-progressbar").style.textAlign="left"),s},u.prototype.splitTaskbar=function(e,t){for(var i="",a=0;a<e.ganttProperties.segments.length;a++){var n=e.ganttProperties.segments[a],r=void 0,r=n.showProgress?"initial":"hidden",s=0===a?"e-segment-first":a===e.ganttProperties.segments.length-1?"e-segment-last":"e-segment-inprogress";i+='<div class="'+Pe+" "+s+" "+Ge+' e-segmented-taskbar"style="width:'+n.width+"px;position: absolute;"+(this.parent.enableRtl?"right:":"left:")+n.left+"px;height:"+this.taskBarHeight+"px; overflow:"+r+';" data-segment-index = "'+a+'" aria-label = "'+this.generateSpiltTaskAriaLabel(n,e.ganttProperties)+'"> '+this.getSplitTaskbarLeftResizerNode()+'<div class="'+Ce+" "+ze+' " style="border-style:'+(n.progressWidth?"solid;":"none;")+"display:"+(0<=n.progressWidth?"block;":"none;")+"width:"+n.progressWidth+"px;height:100%;text-align:"+(this.parent.enableRtl?"left;":"right;")+"border-top-right-radius:"+this.getSplitTaskBorderRadius(n)+"px;border-bottom-right-radius:"+this.getSplitTaskBorderRadius(n)+'px;"><span class="'+Se+'" style="line-height:'+(this.taskBarHeight-1)+"px;display:"+(n.showProgress?"inline;":"none;")+"height:"+this.taskBarHeight+'px;">'+t+"</span></div>"+this.getSplitTaskbarRightResizerNode(n)+"</div></div>"}return i},u.prototype.getSplitTaskbarLeftResizerNode=function(){var e=!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?5:-2;return'<div class="'+Ne+" "+je+'" style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>'},u.prototype.getSplitTaskbarRightResizerNode=function(e){var t=!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?-17:-10;return'<div class="'+Le+" "+je+'" style="'+(this.parent.enableRtl?"right:":"left:")+(e.width+t)+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>'},u.prototype.getSplitProgressResizerNode=function(){var e=this.parent.enableRtl?this.templateData.ganttProperties.progressWidth+8:this.templateData.ganttProperties.progressWidth-6;return'<div class="'+Ve+'" style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+Be+'"><div class="'+Ae+'"></div><div class="'+We+'"></div></div>'},u.prototype.getSegmentIndex=function(e,t){var i=-1,a=t.ganttProperties,n=a.segments;if(!ne.isNullOrUndefined(n)){n.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()});for(var r=n.length,s=0;s<r;s++){var o,l,d=n[s];e.getTime()===a.startDate.getTime()?(this.dropSplit=!0,i=0):e.getTime()===d.startDate.getTime()?(this.dropSplit=!0,o=d.startDate,o=new Date(o.getTime()),l=this.parent.timelineModule.customTimelineSettings.bottomTier,this.parent.contextMenuModule.isFromContextMenuBeforeOpen||("Day"===l.unit?o.setDate(o.getDate()+1):"Hour"===l.unit?o.setHours(o.getHours()+1):"Minutes"===l.unit&&o.setMinutes(o.getMinutes()+1)),o=d.startDate=this.parent.dataOperation.checkStartDate(o,a,!1),d.startDate=o,l=d.endDate,l=this.parent.dataOperation.getEndDate(o,d.duration,a.durationUnit,a,!1),d.endDate=l,s===n.length-1&&this.parent.setRecordValue("endDate",l,a,!0),this.incrementSegments(n,s,t),i=d.segmentIndex):(d.endDate=this.parent.dataOperation.getEndDate(d.startDate,d.duration,a.durationUnit,a,!1),e.getTime()>=d.startDate.getTime()&&e.getTime()<=d.endDate.getTime()&&(i=d.segmentIndex)),this.parent.setRecordValue("segments",a.segments,a,!0)}}return-1===i&&(this.dropSplit=!0),i},u.prototype.mergeTask=function(t,e){var i,a,n=e.length,r=this.parent.taskFields,s=this.parent.flatData.filter(function(e){return e[r.id]===t?e:null})[0],o=(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&(i={action:"MergeTaskbar"},this.parent.isUndoRedoItemPresent("Edit"))&&(this.parent.editModule&&this.parent.editModule.taskbarEditModule.isDragged&&0<this.parent.getUndoActions().length&&this.parent.undoRedoModule.getUndoCollection.splice(this.parent.undoRedoModule.getUndoCollection.length-1,1),this.parent.undoRedoModule.createUndoCollection(),a=this.parent.previousFlatData[s.index],i.modifiedRecords=ne.extend([],[a],[],!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=i),s.ganttProperties.segments);e=e.sort(function(e,t){return t.firstSegmentIndex-e.firstSegmentIndex});for(var l,d=0;d<n;d++){var h=o[e[d].firstSegmentIndex],p=o[e[d].secondSegmentIndex],p=h.duration+p.duration,u=this.parent.dataOperation.getEndDate(h.startDate,p,s.ganttProperties.durationUnit,s.ganttProperties,!1),h={startDate:h.startDate,endDate:u,duration:p},p=e[d].firstSegmentIndex;o.splice(p,2,h),this.parent.setRecordValue("segments",o,s.ganttProperties,!0),this.parent.dataOperation.updateMappingData(s,"segments"),1===o.length?(this.parent.setRecordValue("endDate",u,s.ganttProperties,!0),this.parent.setRecordValue("EndDate",u,s,!0),this.parent.setRecordValue("segments",null,s.ganttProperties,!0),this.parent.dataOperation.updateMappingData(s,"segments")):s.ganttProperties.endDate!==o[o.length-1].endDate&&this.parent.setRecordValue("endDate",o[o.length-1].endDate,s.ganttProperties,!0)}ne.isNullOrUndefined(s[r.segments])||ne.isNullOrUndefined(s[r.segments][0])||(l=Object.keys(s[r.segments][0]));for(var c=[],g=0;g<o.length;g++)ne.isNullOrUndefined(l)||c[g]||(c[g]={}),ne.isNullOrUndefined(l)||-1===l.indexOf("StartDate")||(c[g][r.startDate]=o[g].startDate),ne.isNullOrUndefined(l)||-1===l.indexOf("EndDate")||(c[g][r.endDate]=o[g].endDate),ne.isNullOrUndefined(l)||-1===l.indexOf("Duration")||(c[g][r.duration]=o[g].duration);s[r.segments]=c,this.updateSegment(s.ganttProperties.segments,t),this.refreshChartAfterSegment(s,"mergeSegment")},u.prototype.updateSegment=function(e,t){var i=this;if(!ne.isNullOrUndefined(this.parent.taskFields.segmentId)&&0<this.parent.segmentData.length){if(ne.isNullOrUndefined(e))o=this.parent.segmentData.filter(function(e){return!(t===e[i.parent.taskFields.segmentId])});else{for(var a=[],n=0;n<e.length;n++){var r={},s=e[n];r[this.parent.taskFields.segmentId]=t,ne.isNullOrUndefined(this.parent.taskFields.startDate)||(r[this.parent.taskFields.startDate]=s.startDate),ne.isNullOrUndefined(this.parent.taskFields.duration)||(r[this.parent.taskFields.duration]=s.duration),ne.isNullOrUndefined(this.parent.taskFields.endDate)||(r[this.parent.taskFields.endDate]=s.endDate),a.push(r)}for(var o=this.parent.segmentData.filter(function(e){return!(t===e[i.parent.taskFields.segmentId])}),n=0;n<a.length;n++)o.push(a[n])}this.parent.segmentData=o}},u.prototype.refreshChartAfterSegment=function(e,t){this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e,!1),e.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e,"segments"),this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateParentItems(e),e.ganttProperties.sharedTaskUniqueIds&&1<e.ganttProperties.sharedTaskUniqueIds.length&&this.parent.editModule.updateSharedTask(e),this.parent.predecessorModule&&this.parent.taskFields.dependency&&(this.parent.predecessorModule.updatedRecordsDateByPredecessor(),this.parent.connectorLineModule.removePreviousConnectorLines(this.parent.flatData),this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.flatData),e.parentItem)&&this.parent.getParentTask(e.parentItem).ganttProperties.isAutoSchedule&&this.parent.isInPredecessorValidation&&this.parent.dataOperation.updateParentItems(e.parentItem),this.refreshRecords(this.parent.currentViewData);var i=this.parent.criticalPathModule,i=(i&&this.parent.criticalPathModule.criticalConnectorLine(i.criticalPathCollection,i.detailPredecessorCollection,!0,i.predecessorCollectionTaskIds),this.ganttChartTableBody.querySelectorAll("tr")[this.parent.currentViewData.indexOf(e)]),a={requestType:t,rowData:e,modifiedRecords:this.parent.editedRecords,modifiedTaskData:Z(this.parent.editedRecords,!0)},n=(this.triggerQueryTaskbarInfoByIndex(i,e),this.parent.selectionModule&&this.parent.selectionModule.clearSelection(),a.rowData.taskData[this.parent.taskFields.segments]);if(this.parent.timezone&&null!=n)for(var r=0;r<n.length;r++)n[r][this.parent.taskFields.startDate]=this.parent.dateValidationModule.remove(a.rowData.ganttProperties.segments[r].startDate,this.parent.timezone),this.parent.taskFields.endDate&&(n[r][this.parent.taskFields.endDate]=this.parent.dateValidationModule.remove(a.rowData.ganttProperties.segments[r].endDate,this.parent.timezone));this.parent.trigger("actionComplete",a),this.parent.dataSource&&"result"in this.parent.dataSource&&!ne.isNullOrUndefined(this.parent.contextMenuModule)&&this.parent.contextMenuModule.isOpen&&("SplitTask"===this.parent.contextMenuModule.item||"Left"===this.parent.contextMenuModule.item||"Right"===this.parent.contextMenuModule.item)&&(a.action=a.requestType,a.requestType="save",this.parent.treeGrid.grid.renderModule.refresh(a)),this.parent.hideLoadingIndicator(),ne.setValue("isEdit",!1,this.parent.contextMenuModule),ne.setValue("isEdit",!1,this.parent)},u.prototype.splitTask=function(t,e){var i=this.parent.taskFields,a=e,n=this.parent.flatData.filter(function(e){return e[i.id]===t?e:null})[0],r=(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&(r={action:"MergeTaskbar"},this.parent.isUndoRedoItemPresent("Edit"))&&(this.parent.undoRedoModule.createUndoCollection(),r.modifiedRecords=ne.extend([],[n],[],!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=r),n.ganttProperties),s=(this.dropSplit=!1,-1),o=r.segments,l=r.calendarContext;if(ne.isNullOrUndefined(e.length)||e.length<0){var d=this.parent.dataOperation.checkStartDate(a,r,!1);if(d.getTime()!==r.startDate.getTime()){if(r.isAutoSchedule){if(!ne.isNullOrUndefined(o)&&0<o.length&&(s=this.getSegmentIndex(d,n)),!1===this.dropSplit&&a.getTime()>r.startDate.getTime()&&a.getTime()<r.endDate.getTime()){for(var o=-1!==s?o:[],d=-1!==s?o[s].startDate:new Date(r.startDate.getTime()),h=-1!==s?o[s].endDate:new Date(r.endDate.getTime()),l=this.parent.dataOperation.getDuration(d,h,r.durationUnit,r.isAutoSchedule,r.isMilestone,void 0,l),p=(this.parent.setRecordValue("segments",this.splitSegmentedTaskbar(d,h,a,s,o,n,l),r,!0),[]),u=0;u<o.length;u++)p[u]||(p[u]={}),p[u][i.startDate]=o[u].startDate,p[u][i.endDate]=o[u].endDate,p[u][i.duration]=o[u].duration;n[i.segments]=p,-1!==s&&this.incrementSegments(o,s+1,n),this.parent.setRecordValue("endDate",o[o.length-1].endDate,r,!0),this.parent.taskFields.endDate&&this.parent.dataOperation.updateMappingData(n,"endDate")}this.updateSegment(n.ganttProperties.segments,t),this.refreshChartAfterSegment(n,"splitTaskbar")}}else this.parent.hideLoadingIndicator()}else e.sort(function(e,t){return e.getTime()-t.getTime()}),this.parent.setRecordValue("segments",this.constructSegments(e,n.ganttProperties),n.ganttProperties,!0),this.updateSegment(n.ganttProperties.segments,t),this.refreshChartAfterSegment(n,"splitTask")},u.prototype.constructSegments=function(e,t){for(var i,a,n=[],r=new Date,s=0;s<e.length+1&&(r=0===s?t.startDate:r,r=this.parent.dataOperation.checkStartDate(r,t,!1),i=s===e.length||new Date(e[s].getTime())>t.endDate?t.endDate:new Date(e[s].getTime()),i=this.parent.dataOperation.checkEndDate(i,t,!1),a=this.parent.dataOperation.getDuration(r,i,t.durationUnit,t.isAutoSchedule,t.isMilestone,void 0,t.calendarContext),i.getTime()>=r.getTime()&&n.push({startDate:r,endDate:i,duration:a}),s!==e.length);s++)(r=new Date(e[s].getTime())).setDate(e[s].getDate()+1);return n},u.prototype.splitSegmentedTaskbar=function(e,t,i,a,n,r,s){var o=r.ganttProperties,l=o.calendarContext,r=this.parent.includeWeekend||0<l.exceptionsRanges.length?-1:this.parent.nonWorkingDayIndex.indexOf(i.getDay()),d=-1===r?0:0===r||1===r?1:2,h=(e=this.parent.dataOperation.checkStartDate(e,o,!1),new Date(i.getTime()));h=this.parent.dataOperation.checkEndDate(h,o,!1);for(var p=0;p<2;p++){0<this.parent.weekWorkingTime.length&&(g=this.parent.getCurrentDayEndTime(h),this.setTime(g,h));var u,c,g={startDate:e,endDate:h,duration:this.parent.dataOperation.getDuration(e,h,o.durationUnit,o.isAutoSchedule,o.isMilestone,void 0,l),offsetDuration:1},f=this.parent.includeWeekend||0<l.exceptionsRanges.length?-1:this.parent.nonWorkingDayIndex.indexOf(h.getDay()),m=(-1!==a&&(n.splice(a,1),a=-1),n.push(g),this.parent.timelineModule.customTimelineSettings.bottomTier),y=m.unit;if("Hour"===y||"Minutes"===y)e=new Date(i.getTime()),e=this.parent.dataOperation.checkStartDate(e,o,!1),h=new Date(t.getTime()),12!==m.count&&6!==m.count&&(y=m.count,m=m.unit,u=this.parent.timelineModule.getIncrement(e,y,m),c=e.getTime()+u,e.setTime(c+d),u=this.parent.timelineModule.getIncrement(h,y,m),c=h.getTime()+u,h.setTime(c+d));else{(e=new Date(i.getTime())).setDate(e.getDate()+1+d);y=this.parent.getCurrentDayStartTime(e);if(this.setTime(y,e),e=this.parent.dataOperation.checkStartDate(e,o,!1),!this.parent.taskFields.duration&&d<=0&&e.setDate(e.getDate()+1),(h=new Date(t.getTime()))<e&&h.setDate(h.getDate()+1),this.isOnHolidayOrWeekEnd(h,!0,l))for(;h.setDate(h.getDate()+1),this.isOnHolidayOrWeekEnd(h,!0,l););this.parent.includeWeekend||(h=this.getNextWorkingDay(h,l))}h=-1!==f?this.parent.dataOperation.getEndDate(e,s-g.duration,o.durationUnit,o,!1):this.parent.dataOperation.checkEndDate(h,o,!1)}return n.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),n},u.prototype.incrementSegments=function(e,t,i){for(var a=i.ganttProperties,n=t+1;n<e.length;n++){var r=e[n],s=0!==n?new Date(e[n-1].endDate.getTime()):new Date(r.startDate.getTime()),s=(this.parent.dataOperation.fromSegments=!0,s=this.parent.dataOperation.getEndDate(s,r.offsetDuration,a.durationUnit,a,!1),this.parent.dataOperation.fromSegments=!1,s=this.parent.dataOperation.checkStartDate(s,a,!1),r.startDate=s,r.endDate=this.parent.dataOperation.getEndDate(s,r.duration,a.durationUnit,a,!1));r.endDate=s,n===e.length-1&&(this.parent.setRecordValue("endDate",s,a,!0),this.parent.taskFields.endDate)&&this.parent.dataOperation.updateMappingData(i,"endDate")}e.sort(function(e,t){return e.startDate.getTime()-t.startDate.getTime()}),this.parent.setRecordValue("segments",e,a,!0),this.parent.dataOperation.updateMappingData(i,"segments")},u.prototype.calculateLeftValue=function(e){var t=this.parent.renderBaseline?.45:!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?.7:.62,t=Math.floor(this.parent.rowHeight*t);return!ne.isNullOrUndefined(this.parent.taskbarHeight)&&this.parent.taskbarHeight<=t||ne.isNullOrUndefined(this.parent.taskbarHeight)&&e<=36||e<=36?1:-1/12*(e-36)+1},u.prototype.getMilestoneNode=function(e,t){var i=this.templateData,a=this.parent.rowHeight,a=this.calculateLeftValue(a);return this.milestoneTemplateFunction?this.milestoneTemplateFunction(ne.extend({index:e},i),this.parent,"MilestoneTemplate",this.getTemplateID("MilestoneTemplate"),!1,void 0,t[0],this.parent.treeGrid.root):(e='<div class="'+He+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6)+"px;position:absolute;transform: rotate(45deg);left:"+a+'px;"> </div>',this.createDivElement(e))},u.prototype.getTaskBaselineNode=function(e,t){var i=this.templateData;return this.baselineTemplateFunction?(i={taskData:this.templateData,baselineColor:this.baselineColor,isMilestoneBaseline:!1,left:this.templateData.ganttProperties.left,width:this.templateData.ganttProperties.width},this.baselineTemplateFunction(ne.extend({index:e},i),this.parent,"BaselineTemplate",this.getTemplateID("BaselineTemplate"),!1,void 0,null,this.parent.treeGrid.root)):(e='<div class="'+Oe+' " role="term" style="margin-top:'+this.baselineTop+"px;"+(this.parent.enableRtl?"right:":"left:")+i.ganttProperties.baselineLeft+"px;width:"+i.ganttProperties.baselineWidth+"px;height:"+this.baselineHeight+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+'"></div>',this.createDivElement(e))},u.prototype.updateTaskBaselineNode=function(e){e='<div class="'+Oe+' " role="term" style="margin-top:'+this.baselineTop+"px;"+(this.parent.enableRtl?"right:":"left:")+e.ganttProperties.baselineLeft+"px;width:"+e.ganttProperties.baselineWidth+"px;height:"+this.baselineHeight+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+'"></div>';return this.createDivElement(e)},u.prototype.getMilestoneBaselineNode=function(e,t){var i=this.templateData;return this.baselineTemplateFunction?(i={taskData:this.templateData,baselineColor:this.baselineColor,isMilestoneBaseline:!0,left:this.templateData.ganttProperties.left,width:this.templateData.ganttProperties.width},this.baselineTemplateFunction(ne.extend({index:e},i),this.parent,"BaselineTemplate",this.getTemplateID("BaselineTemplate"),!1,void 0,null,this.parent.treeGrid.root)):(e=this.parent.renderBaseline?5:2,i='<div class="'+Ie+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-10)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-10)+"px;position:absolute;transform:rotate(45deg);"+(this.parent.enableRtl?"right:":"left:")+(this.parent.enableRtl?i.ganttProperties.left-this.milestoneHeight/2+3:i.ganttProperties.baselineLeft-this.milestoneHeight/2+1)+"px;"+(this.baselineColor?"background-color: "+this.baselineColor+";":"")+"margin-top:"+(-Math.floor(this.parent.rowHeight-this.milestoneMarginTop)+e+2)+'px"> </div>',this.createDivElement(i))},u.prototype.getLeftLabelNode=function(e){var t,i=this.leftLabelContainer(),a=(""!==this.generateTaskLabelAriaLabel("left")&&i[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("left")),null);return this.leftTaskLabelTemplateFunction?a=this.leftTaskLabelTemplateFunction(ne.extend({index:e},this.templateData),this.parent,"LeftLabelTemplate",this.getTemplateID("LeftLabelTemplate"),!1,void 0,i[0],this.parent.treeGrid.root):(e=this.parent.labelSettings.leftLabel,(t=this.getTaskLabel(e))&&(a=this.getLableText(t="isCustomTemplate"===t?e:t,Te),this.parent.enableHtmlSanitizer)&&"string"==typeof t&&(t=ne.SanitizeHtmlHelper.sanitize(t),a=this.getLableText(t="isCustomTemplate"===t?e:t,Te))),a&&0<a.length&&("null"===a[0].data&&(a[0].data=""),ne.append(a,i[0])),this.parent.enableRtl&&(i[0].style.paddingLeft="25px",i[0].style.paddingRight="0px"),i},u.prototype.getLableText=function(e,t){var i=this.parent.renderBaseline?(this.parent.rowHeight-this.taskBarHeight)/2:this.taskBarMarginTop,t=ne.createElement("div",{className:t,styles:"height:"+this.taskBarHeight+"px;margin-top:"+i+"px;"}),i=ne.createElement("span",{className:l}),e=(i[this.parent.disableHtmlEncode?"textContent":"innerHTML"]=e,t.appendChild(i),ne.createElement("div"));return e.appendChild(t),e.childNodes},u.prototype.getRightLabelNode=function(e){var t,i=this.rightLabelContainer(),a=(""!==this.generateTaskLabelAriaLabel("right")&&i[0].setAttribute("aria-label",this.generateTaskLabelAriaLabel("right")),null);return this.rightTaskLabelTemplateFunction?a=this.rightTaskLabelTemplateFunction(ne.extend({index:e},this.templateData),this.parent,"RightLabelTemplate",this.getTemplateID("RightLabelTemplate"),!1,void 0,i[0],this.parent.treeGrid.root):(e=this.parent.labelSettings.rightLabel,(t=this.getTaskLabel(e))&&(a=this.getLableText(t="isCustomTemplate"===t?e:t,we),this.parent.enableHtmlSanitizer)&&"string"==typeof t&&(t=ne.SanitizeHtmlHelper.sanitize(t),a=this.getLableText(t="isCustomTemplate"===t?e:t,we))),a&&0<a.length&&("null"===a[0].data&&(a[0].data=""),ne.append(a,i[0])),this.parent.enableRtl&&(i[0].style.marginLeft="0px",i[0].style.paddingRight="25px"),i},u.prototype.getManualTaskbar=function(){var e=this.templateData,t=this.taskBarHeight/2-1,i=(e.ganttProperties.startDate&&e.ganttProperties.endDate&&(e.ganttProperties.duration||e.hasChildRecords)?'<div class="'+_e+'" style="width:'+e.ganttProperties.width+"px;height:"+t/5+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>':e.ganttProperties.startDate||e.ganttProperties.endDate||!e.ganttProperties.duration?'<div class="'+_e+" "+(e.ganttProperties.startDate?at:nt)+'" style="width:'+e.ganttProperties.width+"px;height:"+2*t+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>':'<div class="'+_e+' e-gantt-unscheduled-manualtask" style="width:'+e.ganttProperties.width+"px;height:"+(t/5+1)+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div>')+(e.ganttProperties.startDate&&e.ganttProperties.endDate&&(e.ganttProperties.duration||e.hasChildRecords)||e.ganttProperties.duration?'<div class="e-gantt-manualparenttaskbar-left" style='+(this.parent.enableRtl?"margin-right:0px;":"")+'"height:'+t+"px;border-left-width:"+t/5+"px; border-bottom:"+t/5+'px solid transparent;"></div><div class="e-gantt-manualparenttaskbar-right" style="'+(this.parent.enableRtl?"margin-right:-8px;":"")+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.width-Math.floor((t/5+8)/5))+"px;height:"+t+"px;border-right-width:"+t/5+"px;border-bottom:"+t/5+'px solid transparent;"></div></div>':""),t='<div class="'+qe+'"style='+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-e.ganttProperties.autoLeft)+"px;width:"+e.ganttProperties.width+"px;height:"+t+"px;cursor:"+(this.parent.editSettings.allowTaskbarEditing?"move;":"default;")+"</div>",a='<div class="'+Ze+'" style="width:'+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;position:absolute;transform: rotate(45deg);top:"+(40<this.parent.rowHeight?0:2)+"px;left:"+(this.parent.renderBaseline?2:1)+'px;"> </div>';return this.createDivElement(0===e.ganttProperties.duration&&e.hasChildRecords&&!e.ganttProperties.isAutoSchedule?a+i:t+i)},u.prototype.getParentTaskbarNode=function(e,t){var i,a,n,r,s=null,o=this.templateData,s=0!==o.ganttProperties.autoDuration&&!o.ganttProperties.isMilestone&&this.parentTaskbarTemplateFunction?this.parentTaskbarTemplateFunction(ne.extend({index:e},o),this.parent,"ParentTaskbarTemplate",this.getTemplateID("ParentTaskbarTemplate"),!1,void 0,t[0],this.parent.treeGrid.root):(t="",r=void 0,i=this.taskBarHeight/5,i=this.createDivElement('<div class="e-gantt-parent-taskbar-inner-div '+this.getExpandClass(o)+" "+Ke+'" style="width:'+(o.ganttProperties.isAutoSchedule?o.ganttProperties.width:o.ganttProperties.autoWidth)+"px;height:"+(o.ganttProperties.isAutoSchedule?this.taskBarHeight:3*i)+"px;margin-top:"+(o.ganttProperties.isAutoSchedule?-1:2*i)+'px; "></div>'),a=this.createDivElement('<div class="e-gantt-parent-progressbar-inner-div '+this.getExpandClass(o)+" "+Qe+'" style="border-style:'+(o.ganttProperties.progressWidth?"solid;":"none;")+"width:"+o.ganttProperties.progressWidth+"px;border-top-right-radius:"+this.getBorderRadius(o)+"px;border-bottom-right-radius:"+this.getBorderRadius(o)+'px;height:100%;"></div>'),n=ne.createElement("div"),this.taskLabelTemplateFunction?(e=this.taskLabelTemplateFunction(ne.extend({index:e},o),this.parent,"TaskLabelTemplate",this.getTemplateID("TaskLabelTemplate"),!1,void 0,a[0]))&&0<e.length&&(ne.append(e,n),t=n.innerHTML,t="isCustomTemplate"===(t=this.getTaskLabel(this.parent.labelSettings.taskLabel))?n.innerHTML:t,this.parent.enableHtmlSanitizer)&&"string"==typeof t&&(t=ne.SanitizeHtmlHelper.sanitize(t)):(t="isCustomTemplate"===(t=this.getTaskLabel(this.parent.labelSettings.taskLabel))?this.parent.labelSettings.taskLabel:t,this.parent.enableHtmlSanitizer&&"string"==typeof t&&(t=ne.SanitizeHtmlHelper.sanitize(t))),-1===t.indexOf("null")&&("isCustomTemplate"!==this.getTaskLabel(this.parent.labelSettings.taskLabel)||this.isTemplate(this.parent.labelSettings.taskLabel)||(t=""),r=isNaN(parseInt(t,10))?'<span class="'+Se+'" style="line-height:'+(o[this.parent.taskFields.manual]&&o.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px; text-align:"+(this.parent.enableRtl?"right;":"left;")+"display:inline-block;width:"+(o.ganttProperties.width-10)+"px; height:"+this.taskBarHeight+'px;"></span>':'<span class="'+Se+'" style="line-height:'+(o[this.parent.taskFields.manual]&&o.hasChildRecords?Math.floor(.6*this.taskBarHeight):this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display:inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(o.ganttProperties.width-10):"")+"px; height:"+(this.taskBarHeight-1)+"px;"+("ResourceView"===this.parent.viewType?"display: inline-flex;":"")+("ResourceView"===this.parent.viewType?"width:"+(o.ganttProperties.width-10):"")+"px; height:"+this.taskBarHeight+'px;"></span>',e=this.createDivElement(r)[0],this.parent.disableHtmlEncode?e.innerText=t:e.innerHTML=t,(r=this.parent.labelSettings.taskLabel)&&r.elementRef&&e.appendChild(n),a[0].appendChild(e),""!==a[0].querySelectorAll(".e-task-label")[0].textContent&&!this.isTemplate(r)&&a[0].querySelectorAll(".e-task-label")[0].children[0]&&this.parent.disableHtmlEncode&&a[0].querySelectorAll(".e-task-label")[0].children[0].remove(),""===a[0].querySelectorAll(".e-task-label")[0].textContent)&&r&&!r.elementRef&&""!==n.innerHTML&&(a[0].querySelectorAll(".e-task-label")[0].textContent=r),t='<div class="e-gantt-parent-milestone" style="width:'+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;height:"+(this.parent.renderBaseline?this.taskBarHeight-3:this.taskBarHeight-7)+"px;position:absolute;transform: rotate(45deg);top:"+(40<this.parent.rowHeight?0:2)+"px;left:"+(this.parent.renderBaseline?2:1)+'px;"> </div>',i[0].appendChild([].slice.call(a)[0]),o.ganttProperties.isMilestone?this.createDivElement(o.ganttProperties.isAutoSchedule?t:""):i);return this.parent.enableRtl&&!ne.isNullOrUndefined(s)&&s[0]&&s[0].querySelector(".e-task-label")&&(s[0].querySelector(".e-task-label").style.marginLeft="15px",s[0].querySelector(".e-task-label").style.marginRight="8px",s[0].querySelector(".e-gantt-parent-progressbar"))&&(s[0].querySelector(".e-gantt-parent-progressbar").style.textAlign="left"),s},u.prototype.getTableTrNode=function(e,t,i){var a,n,r,s=this,o=ne.createElement("table"),l="Horizontal"===this.parent.gridLines||"Both"===this.parent.gridLines?"e-chart-row-border":"",i=(this.parent.treeGridModule.isPersist?setTimeout(function(){ne.isNullOrUndefined(s.parent.treeGrid.grid)||ne.isNullOrUndefined(s.parent.treeGrid.grid.contentModule)||ne.isNullOrUndefined(s.parent.treeGrid.grid.contentModule.getRows())||(r=s.parent.treeGrid.grid.contentModule.getRows()[e],a=r&&r.isSelected?"e-active":"")},0):(n=t.ganttProperties.taskId,t=!1,t=i&&n?(n=n.toString(),!(!(i=(r=i).find(function(e){return e.data[s.parent.taskFields.id]&&e.data[s.parent.taskFields.id].toString()===n}))||!i.isSelected)):!(!(r=this.parent.treeGrid.grid.contentModule.getRows()[e])||!r.isSelected),a=t?"e-active":""),o.querySelector("tbody")),t=(i||(i=document.createElement("tbody"),o.appendChild(i)),document.createElement("tr")),d=(t.classList.add(this.getRowClassName(this.templateData),Fe),a&&t.classList.add(a),t.style.display=this.getExpandDisplayProp(this.templateData),t.style.height=this.parent.rowHeight+"px",document.createElement("td"));return l?d.classList.add(Ee,l):d.classList.add(Ee),d.style.width=this.parent.timelineModule.totalTimelineWidth+"px",t.appendChild(d),i.appendChild(t),o.childNodes},u.prototype.initializeChartTemplate=function(){ne.isNullOrUndefined(this.parent.parentTaskbarTemplate)||(this.parentTaskbarTemplateFunction=this.templateCompiler(this.parent.parentTaskbarTemplate)),!ne.isNullOrUndefined(this.parent.labelSettings.leftLabel)&&this.isTemplate(this.parent.labelSettings.leftLabel)&&(this.leftTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.leftLabel)),!ne.isNullOrUndefined(this.parent.labelSettings.rightLabel)&&this.isTemplate(this.parent.labelSettings.rightLabel)&&(this.rightTaskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.rightLabel)),!ne.isNullOrUndefined(this.parent.labelSettings.taskLabel)&&this.isTemplate(this.parent.labelSettings.taskLabel)&&(this.taskLabelTemplateFunction=this.templateCompiler(this.parent.labelSettings.taskLabel)),ne.isNullOrUndefined(this.parent.taskbarTemplate)||(this.childTaskbarTemplateFunction=this.templateCompiler(this.parent.taskbarTemplate)),ne.isNullOrUndefined(this.parent.milestoneTemplate)||(this.milestoneTemplateFunction=this.templateCompiler(this.parent.milestoneTemplate)),ne.isNullOrUndefined(this.parent.baselineTemplate)||(this.baselineTemplateFunction=this.templateCompiler(this.parent.baselineTemplate))},u.prototype.createDivElement=function(e){var t=document.createElement("div");return this.parseTemplate(e).forEach(function(e){return t.appendChild(e)}),t.childNodes},u.prototype.parseTemplate=function(e){var t=this;return this.parseHtmlStringToElementTree(e).map(function(e){return t.constructElementFromNode(e)})},u.prototype.parseHtmlStringToElementTree=function(e){for(var t=[],i=[],a=0;null!==(o=this.tagRegex.exec(e));){var n=o[0],r=o[1],s=o[2],s=void 0===s?"":s,o=e.substring(a,o.index).trim(),a=this.tagRegex.lastIndex,r={tagName:r,attributes:s,children:[]};n.startsWith("</")?(0<i.length&&o&&(i[i.length-1].value=o),i.pop()):n.endsWith("/>")||((0<i.length?i[i.length-1].children:t).push(r),i.push(r))}return t},u.prototype.constructElementFromNode=function(e){var t=this,i=document.createElement(e.tagName);return e.value&&(i.textContent=e.value),this.setAttributes(i,e.attributes),e.children.forEach(function(e){e=t.constructElementFromNode(e);i.appendChild(e)}),i},u.prototype.setAttributes=function(e,t){for(t=t.replace(/style=([^"'\s][^ >]*)/g,'style="$1"');null!==(a=this.attributeRegex.exec(t));){var i=a[1],a=a[2];"class"===i?e.className=a:"style"===i?e.style.cssText=this.cleanStyleString(a):e.setAttribute(i,a)}},u.prototype.cleanStyleString=function(e){return e.split(";").map(function(e){return e.trim()}).filter(Boolean).join("; ")},u.prototype.isTemplate=function(e){for(var t=!1,i=0;i<this.parent.ganttColumns.length;i++)if(e===this.parent.ganttColumns[i].field){t=!0;break}return t="string"!=typeof e||0===e.indexOf("#")||-1<e.indexOf("<")||-1<e.indexOf("$")||!t},u.prototype.getTemplateID=function(e){return this.parent.element.id+e},u.prototype.leftLabelContainer=function(){var e='<div class="'+(this.leftTaskLabelTemplateFunction?"e-left-label-container e-left-label-temp-container":ke)+' " tabindex="-1" role="term" style="height:'+(this.parent.rowHeight-2)+"px;width:"+this.taskNameWidth(this.templateData)+'"></div>';return this.createDivElement(e)},u.prototype.taskbarContainer=function(){var e=this.templateData,t=!(!this.parent.editModule||!this.parent.editSettings.allowTaskbarEditing||"ParentResizing"!==this.parent.editModule.taskbarEditModule.taskBarEditAction),t='<div class="'+ve+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+" "+(e.ganttProperties.cssClass||"")+'" tabindex="-1" role="term" style="'+(!e.ganttProperties.isMilestone||t||e.hasChildRecords&&!e.ganttProperties.isAutoSchedule?"width:"+e.ganttProperties.width+"px;margin-top:"+this.taskBarMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(!e.hasChildRecords||e.ganttProperties.isAutoSchedule?e.ganttProperties.left:e.ganttProperties.autoLeft)+"px;height:"+this.taskBarHeight+"px;cursor:"+(this.parent.editSettings.allowTaskbarEditing?"move;":"default;"):"width:"+this.milestoneHeight+"px;height:"+this.milestoneHeight+"px;margin-top:"+this.milestoneMarginTop+"px;"+(this.parent.enableRtl?"right:":"left:")+(e.ganttProperties.left-this.milestoneHeight/2)+"px;cursor:"+(this.parent.editSettings.allowTaskbarEditing?"move;":"default;"))+'"></div>';return this.createDivElement(t)},u.prototype.rightLabelContainer=function(){var e='<div class="'+(this.rightTaskLabelTemplateFunction?"e-right-label-container e-right-label-temp-container":be)+'" tabindex="-1" role="term" style="'+(this.parent.enableRtl?"right:":"left:")+this.getRightLabelLeft(this.templateData)+"px; height:"+(this.parent.rowHeight-2)+'px;"></div>';return this.createDivElement(e)},u.prototype.childTaskbarLeftResizer=function(){var e=!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?5:-2,e='<div class="'+Ne+" "+je+'"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>';return this.createDivElement(e)},u.prototype.childTaskbarRightResizer=function(){var e=!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?-17:-11,e='<div class="'+Le+" "+je+'"style="'+(this.parent.enableRtl?"right:":"left:")+(this.templateData.ganttProperties.width+e)+"px;height:"+this.taskBarHeight+'px;z-index:1"></div>';return this.createDivElement(e)},u.prototype.childTaskbarProgressResizer=function(){var e=this.parent.enableRtl?this.templateData.ganttProperties.progressWidth+8:this.templateData.ganttProperties.progressWidth-6,e='<div class="'+Ve+'"style="'+(this.parent.enableRtl?"right:":"left:")+e+"px;margin-top:"+(this.taskBarHeight-4)+'px;"><div class="'+Be+'"><div class="'+Ae+'"></div><div class="'+We+'"></div></div>';return this.createDivElement(e)},u.prototype.getLeftPointNode=function(){var e=this.templateData,t=!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?12:0,i=!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?6:3,t=-(2+this.connectorPointWidth+t),i=-(this.connectorPointWidth+i),a=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),n=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px",r=!0,a=(e.hasChildRecords&&!this.parent.allowParentDependency&&(r=!1),'<div class="e-left-connectorpoint-outer-div" style="'+(e.ganttProperties.isMilestone?"margin-top:"+a+"px;left:"+i+"px;":n+";left:"+t+"px;")+'"><div class="'+(r?pt:"")+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width: '+this.connectorPointWidth+"px;"+(this.parent.enableRtl?"margin-right:2px;":"")+"height: "+this.connectorPointWidth+'px;">'+this.touchLeftConnectorpoint+"</div></div>");return this.createDivElement(a)},u.prototype.getRightPointNode=function(){var e=this.templateData,t=-(3+(!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?-12:0)),i=Math.floor(this.milesStoneRadius-this.connectorPointWidth/2),a=!this.templateData.ganttProperties.isAutoSchedule&&this.templateData.hasChildRecords&&this.parent.allowParentDependency?"":"margin-top:"+this.connectorPointMargin+"px",n=!0,i=(e.hasChildRecords&&!this.parent.allowParentDependency&&(n=!1),'<div class="'+ft+'" style="'+(e.ganttProperties.isMilestone?"left:"+(!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?this.milestoneHeight+5:this.milestoneHeight-2)+"px;margin-top:"+i+"px;":"left:"+(e.ganttProperties.width+t)+"px;"+a+";")+'"><div class="'+(n?ut:"")+" "+this.parent.getUnscheduledTaskClass(e.ganttProperties)+'" style="width:'+this.connectorPointWidth+"px;height:"+this.connectorPointWidth+'px;">'+this.touchRightConnectorpoint+"</div></div>");return this.createDivElement(i)},u.prototype.getTaskLabel=function(e){var t=this.parent.ganttColumns.length,i=null;if(ne.isNullOrUndefined(e)||""===e)i="";else if(e===this.parent.taskFields.resourceInfo)i=this.getResourceName(this.templateData);else{for(var a=0;a<t;a++)if(e===this.parent.ganttColumns[a].field){i=this.getFieldValue(this.templateData[e]).toString();break}if(ne.isNullOrUndefined(i))return"isCustomTemplate"}return i},u.prototype.getExpandDisplayProp=function(e){return e=this.templateData,!ne.isNullOrUndefined(e.filterLevel)||this.parent.getExpandStatus(e)?"table-row":"none"},u.prototype.getRowClassName=function(e){var t="gridrowtaskId",i=(e=this.templateData).parentItem;return i&&(t+=i.taskId.toString()),t=(t+="level")+e.level.toString()},u.prototype.getBorderRadius=function(e){e=(e=this.templateData).ganttProperties.width-e.ganttProperties.progressWidth;return e<=4?4-e:0},u.prototype.getSplitTaskBorderRadius=function(e){e=e.width-e.progressWidth;return e<=4?4-e:0},u.prototype.taskNameWidth=function(e){var t,i=(e=this.templateData).ganttProperties;return(t=(t=e.ganttProperties.isMilestone?(t=this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6,i.left-t*Math.SQRT2/2):e.hasChildRecords&&!i.isAutoSchedule?this.parent.allowUnscheduledTasks?i.left<i.autoLeft?i.left:i.autoLeft:i.autoStartDate.getTime()<i.startDate.getTime()?i.autoLeft:i.left:e.ganttProperties.left)<0?0:t)+"px"},u.prototype.getRightLabelLeft=function(e){var t,i,a=(e=this.templateData).ganttProperties;return e.ganttProperties.isMilestone?(i=this.parent.renderBaseline?this.taskBarHeight:this.taskBarHeight-6,a.left+i*Math.SQRT2/2):e.hasChildRecords&&!a.isAutoSchedule?(i=this.parent.allowUnscheduledTasks?(t=a.left<a.autoLeft?a.autoLeft:a.left,a.autoWidth):(t=a.autoStartDate.getTime()<a.startDate.getTime()?a.autoLeft:a.left,(a.autoEndDate.getTime()<a.endDate.getTime()?this.parent.dataOperation.getTaskLeft(a.endDate,a.isMilestone,a.calendarContext):this.parent.dataOperation.getTaskLeft(a.autoEndDate,a.isMilestone,a.calendarContext))-t),t+i):e.ganttProperties.left+e.ganttProperties.width},u.prototype.getExpandClass=function(e){return(e=this.templateData).expanded?"e-row-expand":!e.expanded&&e.hasChildRecords?"e-row-collapse":""},u.prototype.getFieldValue=function(e){return ne.isNullOrUndefined(e)?"":e},u.prototype.getResourceName=function(e){e=this.templateData;var t=null;if(!ne.isNullOrUndefined(e.ganttProperties.resourceInfo)){var i=e.ganttProperties.resourceInfo.length;if(0<i){for(var a=0;a<i;a++){var n=e.ganttProperties.resourceInfo[a][this.parent.resourceFields.name],r=e.ganttProperties.resourceInfo[a][this.parent.resourceFields.unit];100!==r&&(n+="["+r+"%]"),ne.isNullOrUndefined(t)?t=n:t+=" , "+n}return t}}return""},u.prototype.initChartHelperPrivateVariable=function(){var e=this.parent.renderBaseline?.45:!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?.7:.62,t=this.parent.renderBaseline?4:2,i=this.parent.renderBaseline?1.13:.82;this.parent.rowHeight=ne.isNullOrUndefined(this.parent.rowHeight)?36:this.parent.rowHeight,this.baselineColor=ne.isNullOrUndefined(this.parent.baselineColor)||""===this.parent.baselineColor?null:this.parent.baselineColor,this.taskBarHeight=ne.isNullOrUndefined(this.parent.taskbarHeight)||this.parent.taskbarHeight>=this.parent.rowHeight?Math.floor(this.parent.rowHeight*e):this.parent.taskbarHeight,this.parent.renderBaseline&&(e=void 0,e=this.taskBarHeight+this.baselineHeight<=this.parent.rowHeight?this.taskBarHeight:this.taskBarHeight-(this.baselineHeight+1),this.taskBarHeight=e),this.milestoneHeight=Math.floor(this.taskBarHeight*i),this.taskBarMarginTop=Math.floor((this.parent.rowHeight-this.taskBarHeight)/t),this.milestoneMarginTop=Math.floor((this.parent.rowHeight-this.milestoneHeight)/2),this.milesStoneRadius=Math.floor(this.milestoneHeight/2),this.baselineTop=-(Math.floor(this.parent.rowHeight-(this.taskBarHeight+this.taskBarMarginTop))-4),this.connectorPointWidth=this.parent.isAdaptive?Math.round(this.taskBarHeight/2):9,this.connectorPointMargin=Math.floor(this.taskBarHeight/2-this.connectorPointWidth/1.5)},u.prototype.refreshGanttRows=function(){if(this.parent.currentViewData=this.parent.treeGrid.getCurrentViewRecords().slice(),this.createTaskbarTemplate(),this.parent.showOverAllocation){for(var e=0;e<this.parent.currentViewData.length;e++){var t=this.parent.currentViewData[e];0<t.childRecords.length&&(this.parent.setRecordValue("workTimelineRanges",this.parent.dataOperation.mergeRangeCollections(t.ganttProperties.workTimelineRanges,!0),t.ganttProperties,!0),this.parent.dataOperation.calculateRangeLeftWidth(t.ganttProperties.workTimelineRanges,t.ganttProperties.calendarContext))}this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)}this.parent.ganttChartModule.updateLastRowBottomWidth()},u.prototype.createTaskbarTemplate=function(){var e,t=this,i=[].slice.call(this.ganttChartTableBody.querySelectorAll("tr")),a=(this.ganttChartTableBody.innerHTML="",[]),n=this.parent.treeGridModule.prevCurrentView;if(this.refreshedTr=[],this.refreshedData=[],this.parent.enableImmutableMode&&n&&0<n.length&&this.isUpdated){for(var r={},s=[],o=this.parent.treeGrid.getPrimaryKeyFieldNames()[0],l=0;l<n.length;l++)s[l]=i[l],r[n[l][o]]=l;for(var d=0;d<this.parent.currentViewData.length;d++){var h=r[this.parent.currentViewData[d][o]],p=this.parent.modifiedRecords.indexOf(this.parent.currentViewData[d]);ne.isNullOrUndefined(h)||-1!==p||this.parent.isFromRenderBaseline?(f=this.getGanttChartRow(d,this.parent.currentViewData[d]),this.ganttChartTableBody.appendChild(f),this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll("tr")[d]),this.refreshedData.push(this.parent.currentViewData[d])):this.ganttChartTableBody.appendChild(s[h]),this.ganttChartTableBody.querySelectorAll("tr")[d].setAttribute("aria-rowindex",(d+1).toString())}}else{for(var u=this.parent.treeGrid.grid.contentModule.getRows(),c=ne.createElement("tbody",{id:this.parent.element.id+"GanttTaskTableBody"}),l=0;l<this.parent.currentViewData.length;l++){var g=this.parent.currentViewData[l],f=(!g.expanded&&this.parent.enableMultiTaskbar&&a.push(g),this.getGanttChartRow(l,g,u));g.hasChildRecords&&!g.expanded&&this.parent.enableMultiTaskbar&&!this.parent.allowTaskbarOverlap&&this.updateDragDropRecords(g,f),c.appendChild(f),this.parent.enableImmutableMode&&(this.refreshedTr.push(c.querySelectorAll("tr")[l]),this.refreshedData.push(this.parent.currentViewData[l])),this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.maintainSelectedRecords(parseInt(f.getAttribute("aria-rowindex"),10)-1)}(e=this.ganttChartTableBody).replaceChildren.apply(e,c.childNodes),this.ganttChartTableBody.childNodes.forEach(function(e){e instanceof Element&&(e.addEventListener("touchmove",t.handleTouchMove),e.addEventListener("touchend",t.handleTouchEnd))}),this.parent.initialChartRowElements=this.parent.ganttChartModule.getChartRows()}if(this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(e=this.parent.criticalPathModule).criticalPathCollection&&this.parent.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds),this.parent.renderTemplates(),this.triggerQueryTaskbarInfo(),this.parent.modifiedRecords=[],this.parent.showOverAllocation&&this.updateOverlapped(),a.length)for(var m=0;m<a.length;m++)a[m].hasChildRecords&&(this.parent.isGanttChartRendered=!0,this.parent.enableMultiTaskbar&&(this.skipReactRefresh=!0),this.parent.chartRowsModule.refreshRecords([a[m]]));this.parent.isGanttChartRendered=!0,this.parent.renderTemplates()},u.prototype.getGanttChartRow=function(e,t,i){this.templateData=t;var a,n,r=this.getTableTrNode(e,t,i),i=this.getLeftLabelNode(e);if((o=this.taskbarContainer())[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),o[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID),a=this.getLeftPointNode(),(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)&&o[0].appendChild([].slice.call(a)[0]),this.templateData.hasChildRecords){var s=void 0;if(!this.parent.enableMultiTaskbar||this.parent.enableMultiTaskbar&&this.templateData.expanded)s=this.getParentTaskbarNode(e,o);else for(var o=[],l=0;l<this.templateData.childRecords.length;l++){this.templateData=this.templateData.childRecords[l];var d=this.taskbarContainer();d[0].setAttribute("aria-label",this.generateAriaLabel(this.templateData)),d[0].setAttribute("rowUniqueId",this.templateData.ganttProperties.rowUniqueID),this.parent.allowParentDependency?(a=this.getLeftPointNode(),this.templateData.hasChildRecords&&!this.templateData.ganttProperties.isAutoSchedule||d[0].appendChild([].slice.call(a)[0])):(a=this.getLeftPointNode(),d[0].appendChild([].slice.call(a)[0])),this.appendChildTaskbars(t,e,d,n,o)}this.templateData.ganttProperties.isAutoSchedule||(h=this.getManualTaskbar(),ne.isNullOrUndefined(h[0]))||(this.parent.allowParentDependency&&(a=this.getLeftPointNode(),h[0].appendChild([].slice.call(a)[0]),p=this.getRightPointNode(),h[0].appendChild([].slice.call(p)[0])),o[0].appendChild([].slice.call(h)[0])),0!==this.templateData.ganttProperties.autoDuration&&!this.templateData.ganttProperties.isMilestone&&s&&0<s.length?ne.append(s,o[0]):0===this.templateData.ganttProperties.duration&&this.templateData.ganttProperties.isMilestone&&this.templateData.ganttProperties.isAutoSchedule&&(p=this.getMilestoneNode(e,o))&&0<p.length&&ne.append(p,o[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(this.taskBaselineTemplateNode=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(ne.isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate)||ne.isNullOrUndefined(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||ne.isNullOrUndefined(this.templateData.ganttProperties.baselineEndDate)||ne.isNullOrUndefined(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode(e,o):this.getMilestoneBaselineNode(e,o)),!(!this.parent.enableMultiTaskbar||this.parent.enableMultiTaskbar&&this.templateData.expanded)||(this.parent.allowParentDependency&&(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)||!this.parent.allowParentDependency)&&(n=this.getRightPointNode(),o[0].appendChild([].slice.call(n)[0]))}else this.appendChildTaskbars(t,e,o,n);var h=this.getRightLabelNode(e);if(this.parent.enableMultiTaskbar&&this.templateData.hasChildRecords&&!this.templateData.expanded){s=ne.createElement("div",{className:"e-collapse-parent"});r[0].childNodes[0].childNodes[0].appendChild(s);for(l=0;l<o.length;l++)ne.addClass([o[l]],"collpse-parent-border"),r[0].childNodes[0].childNodes[0].childNodes[0].appendChild([].slice.call(o)[l]);r[0].childNodes[0].childNodes[0].appendChild([].slice.call(i)[0]),h&&0<h.length&&r[0].childNodes[0].childNodes[0].appendChild([].slice.call(h)[0]);var p=this.templateData.ganttProperties;p.indicators&&0<p.indicators.length&&this.appendIndicators(e,r)}else r[0].childNodes[0].childNodes[0].appendChild([].slice.call(i)[0]),r[0].childNodes[0].childNodes[0].appendChild([].slice.call(o)[0]),this.templateData.ganttProperties.indicators&&0<this.templateData.ganttProperties.indicators.length&&this.appendIndicators(e,r),h&&0<h.length&&r[0].childNodes[0].childNodes[0].appendChild([].slice.call(h)[0]);!ne.isNullOrUndefined(this.taskBaselineTemplateNode)&&0<this.taskBaselineTemplateNode.length&&ne.append(this.taskBaselineTemplateNode,r[0].childNodes[0].childNodes[0]),this.taskBaselineTemplateNode=null;s=r[0].childNodes[0];return this.setAriaRowIndex(t,s),s},u.prototype.setAriaRowIndex=function(t,e){var i,a=this,n=this.parent.treeGrid.getCurrentViewRecords(),n=this.parent.virtualScrollModule&&this.parent.enableVirtualization?ne.getValue("virtualScrollModule.visualData",this.parent.treeGrid):n;this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping?(i=this.parent.treeGrid.grid.contentModule.rows.filter(function(e){if(e.data[a.parent.taskFields.id]===t.ganttProperties.taskId)return e})[0],e.setAttribute("data-rowindex",i.index.toString()),e.setAttribute("aria-rowindex",(i.index+1).toString())):(i=n.indexOf(t),e.setAttribute("aria-rowindex",(i+1).toString()))},u.prototype.triggerQueryTaskbarInfo=function(){if(this.parent.queryTaskbarInfo)for(var e=(this.parent.enableImmutableMode?this.refreshedTr:this.ganttChartTableBody.querySelectorAll("tr")).length,t=0;t<e;t++){var i=(this.parent.enableImmutableMode?this.refreshedTr:this.ganttChartTableBody.querySelectorAll("tr"))[t],a=(0<this.refreshedData.length?this.refreshedData:this.parent.currentViewData)[t],n=!ne.isNullOrUndefined(a.ganttProperties.segments)&&a.ganttProperties.segments.length;if(0<n)for(var r=0;r<n;r++){var s=i.getElementsByClassName("e-segmented-taskbar")[r];this.triggerQueryTaskbarInfoByIndex(s,a)}else i&&this.triggerQueryTaskbarInfoByIndex(i,a)}},u.prototype.appendIndicators=function(e,t){for(var i,a,n=this.templateData.ganttProperties.indicators,r=0;r<n.length;r++)(a=this.getIndicatorNode(n[r]))[0].setAttribute("aria-label",n[r].name),i=-1<n[r].name.indexOf("$")||-1<n[r].name.indexOf("#")?this.templateCompiler(n[r].name)(ne.extend({index:e},this.templateData),this.parent,"indicatorLabelText"):((i=ne.createElement("Text")).innerHTML=n[r].name,this.parent.enableHtmlSanitizer&&"string"==typeof n[r].name&&(n[r].name=ne.SanitizeHtmlHelper.sanitize(n[r].name)),i.childNodes),a[0].appendChild([].slice.call(i)[0]),a[0].title=ne.isNullOrUndefined(n[r].tooltip)?"":n[r].tooltip,t[0].childNodes[0].childNodes[0].appendChild([].slice.call(a)[0])},u.prototype.appendChildTaskbars=function(e,t,i,a,n){if(this.templateData.ganttProperties.isMilestone){var r=this.getMilestoneNode(t,i);r&&0<r.length&&ne.append(r,i[0]),this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(this.taskBaselineTemplateNode=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(ne.isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate)||ne.isNullOrUndefined(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||ne.isNullOrUndefined(this.templateData.ganttProperties.baselineEndDate)||ne.isNullOrUndefined(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode(t,i):this.getMilestoneBaselineNode(t,i)),n&&(n.push(i[0]),this.templateData=e)}else{var r=j(this.templateData.ganttProperties),s=null,o=null,l=null;if(!ne.isNullOrUndefined(r)){(r||this.templateData.ganttProperties.duration)&&r&&(ne.isNullOrUndefined(this.templateData.ganttProperties.segments)||this.templateData.ganttProperties.segments.length<=0)&&(s=this.childTaskbarProgressResizer(),l=this.childTaskbarLeftResizer(),o=this.childTaskbarRightResizer());var d=this.getChildTaskbarNode(t,i);if(l&&i[0].appendChild([].slice.call(l)[0]),d&&0<d.length)if(this.templateData.ganttProperties.segments&&0<this.templateData.ganttProperties.segments.length){var h=this.templateData.ganttProperties.segments.length,r=this.createDivElement('<div class="e-gantt-split-container-line"></div>');i[0].appendChild([].slice.call(r)[0]);for(var p=0;p<h;p++)ne.append(d,i[0])}else ne.append(d,i[0]);s&&i[0].appendChild([].slice.call(s)[0]),o&&i[0].appendChild([].slice.call(o)[0])}this.parent.renderBaseline&&this.templateData.ganttProperties.baselineStartDate&&this.templateData.ganttProperties.baselineEndDate&&(this.taskBaselineTemplateNode=this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.baselineEndDate.getTime()&&(ne.isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate)||ne.isNullOrUndefined(this.templateData.ganttProperties.startDate)||this.templateData.ganttProperties.baselineStartDate.getTime()!==this.templateData.ganttProperties.startDate.getTime()||ne.isNullOrUndefined(this.templateData.ganttProperties.baselineEndDate)||ne.isNullOrUndefined(this.templateData.ganttProperties.endDate)||this.templateData.ganttProperties.baselineEndDate.getTime()!==this.templateData.ganttProperties.endDate.getTime()||!this.templateData.ganttProperties.isMilestone)?this.getTaskBaselineNode(t,i):this.getMilestoneBaselineNode(t,i))}(this.parent.allowParentDependency&&(this.templateData.ganttProperties.isAutoSchedule&&"ProjectView"===this.parent.viewType||!this.templateData.hasChildRecords)||!this.parent.allowParentDependency)&&(a=this.getRightPointNode(),i[0].appendChild([].slice.call(a)[0])),n&&(n.push(i[0]),this.templateData=e)},u.prototype.customizeTaskbars=function(e,t,i){var a,n,r,s=this,o=(e.ganttProperties.segments&&0<e.ganttProperties.segments.length&&t&&t.parentElement&&t.parentElement.parentElement&&t.parentElement.parentElement.parentElement&&(a=t.parentElement.parentElement.parentElement),e.hasChildRecords?"ParentTask":e.ganttProperties.isMilestone?"Milestone":"ChildTask"),e=(ne.isNullOrUndefined(i)||(o=i.classList&&i.classList.contains(Ke)||i.querySelector("."+Ke)?"ParentTask":i.classList&&i.classList.contains(He)||e.ganttProperties.isMilestone?"Milestone":"ChildTask"),{data:e,rowElement:t,taskbarElement:i,taskbarType:o}),o=this.getClassName(e);"Milestone"===e.taskbarType?(e.milestoneColor=i.querySelector(o[0])?getComputedStyle(i.querySelector(o[0])).backgroundColor:null,e.baselineColor=t.querySelector(o[1])?getComputedStyle(t.querySelector(o[1])).backgroundColor:t.querySelector("."+Oe)?getComputedStyle(t.querySelector("."+Oe)).backgroundColor:null):i&&(n=i.querySelector(o[0]),r=i.querySelector(o[1]),e.taskbarBgColor=ne.isNullOrUndefined(n)?null:(i.classList.contains(Ge)?getComputedStyle(i):getComputedStyle(i.querySelector(o[0]))).backgroundColor,e.taskbarBorderColor=ne.isNullOrUndefined(n)?null:i.classList.contains(Ge)?getComputedStyle(i).backgroundColor:getComputedStyle(i.querySelector(o[0])).outlineColor,e.progressBarBgColor=ne.isNullOrUndefined(r)?null:(i.classList.contains(ze)?getComputedStyle(i):getComputedStyle(i.querySelector(o[1]))).backgroundColor,e.baselineColor=a?a.querySelector("."+Oe)?getComputedStyle(a.querySelector("."+Oe)).backgroundColor:null:t.querySelector("."+Oe)?getComputedStyle(t.querySelector("."+Oe)).backgroundColor:null,e.taskLabelColor=i.querySelector("."+Se)?getComputedStyle(i.querySelector("."+Se)).color:null),a?(e.rightLabelColor=a.querySelector("."+be)&&a.querySelector("."+be).querySelector("."+l)?getComputedStyle(a.querySelector("."+be).querySelector("."+l)).color:null,e.leftLabelColor=a.querySelector("."+ke)&&a.querySelector("."+ke).querySelector("."+l)?getComputedStyle(a.querySelector("."+ke).querySelector("."+l)).color:null):(e.rightLabelColor=t.querySelector("."+be)&&t.querySelector("."+be).querySelector("."+l)?getComputedStyle(t.querySelector("."+be).querySelector("."+l)).color:null,e.leftLabelColor=t.querySelector("."+ke)&&t.querySelector("."+ke).querySelector("."+l)?getComputedStyle(t.querySelector("."+ke).querySelector("."+l)).color:null),this.parent.trigger("queryTaskbarInfo",e,function(e){s.updateQueryTaskbarInfoArgs(e,void 0,void 0)})},u.prototype.triggerQueryTaskbarInfoByIndex=function(e,t){if(!ne.isNullOrUndefined(e)){var i=t;if(!ne.isNullOrUndefined(t.ganttProperties.segments)&&0<t.ganttProperties.segments.length)(r=e)&&this.customizeTaskbars(t,e,r);else if(this.parent.enableMultiTaskbar)for(var a=e.querySelectorAll("."+ve),n=0;n<a.length;n++){var r=a[n],i=!t.expanded&&t.hasChildRecords?t.childRecords[n]:i,s="ResourceView"===this.parent.viewType?r.getAttribute("rowUniqueId"):i.ganttProperties.taskId.toString();if(i.parentItem&&!t.expanded&&i.ganttProperties.segments&&0<i.ganttProperties.segments.length&&(s="ResourceView"===this.parent.viewType?t.ganttProperties.rowUniqueID:t.ganttProperties.taskId.toString()),e=(e=this.parent.getRowByID(s))||r.querySelector(".e-gantt-child-taskbar"),e=ne.isNullOrUndefined(e)&&i.ganttProperties.isMilestone?r:e){s=e.querySelectorAll(".e-segmented-taskbar");if(s&&0<s.length)for(var o=(e.querySelector('.e-taskbar-main-container[rowuniqueid="'+i.ganttProperties.rowUniqueID+'"]')||e).querySelectorAll(".e-segmented-taskbar"),l=0;l<o.length;l++)r=o[l],this.customizeTaskbars(i,o[l],r);else this.customizeTaskbars(i,e,r)}}else{var d=e.querySelector("."+ve);e&&this.customizeTaskbars(i,e,d)}}},u.prototype.updateQueryTaskbarInfoArgs=function(e,t,i){var a,n=e.rowElement,r=this.parent.enableVirtualization?e.rowElement:e.taskbarElement,s=this.getClassName(e);e.data.ganttProperties.segments&&0<e.data.ganttProperties.segments.length&&(a=n.parentElement.parentElement.parentElement),"Milestone"===e.taskbarType?(r.querySelector(s[0])&&getComputedStyle(r.querySelector(s[0])).backgroundColor!==e.milestoneColor&&(r.querySelector(s[0]).style.backgroundColor=e.milestoneColor),n.querySelector(s[1])&&getComputedStyle(n.querySelector(s[1])).backgroundColor!==e.baselineColor&&(n.querySelector(s[1]).style.backgroundColor=e.baselineColor),n.querySelector("."+Oe)&&getComputedStyle(n.querySelector("."+Oe)).borderTopColor!==e.baselineColor&&(n.querySelector("."+Oe).style.backgroundColor=e.baselineColor)):r&&(r.querySelector(s[0])&&getComputedStyle(r.querySelector(s[0])).backgroundColor!==e.taskbarBgColor&&("ChildTask"===e.taskbarType?r.querySelector(s[0]).style.background=e.taskbarBgColor:r.querySelector(s[0]).style.backgroundColor=e.taskbarBgColor),r.querySelector(s[0])&&getComputedStyle(r.querySelector(s[0])).outlineColor!==e.taskbarBorderColor&&(r.querySelector(s[0]).style.outlineColor=e.taskbarBorderColor),r.querySelector(s[1])&&getComputedStyle(r.querySelector(s[1])).backgroundColor!==e.progressBarBgColor&&(r.querySelector(s[1]).style.backgroundColor=e.progressBarBgColor),r.classList.contains(Ge)&&getComputedStyle(r).backgroundColor!==e.taskbarBgColor&&("ChildTask"===e.taskbarType?r.style.background=e.taskbarBgColor:r.style.backgroundColor=e.taskbarBgColor),r.classList.contains(Ge)&&getComputedStyle(r).outlineColor!==e.taskbarBorderColor&&(r.style.outlineColor=e.taskbarBorderColor),r.classList.contains(ze)&&getComputedStyle(r).backgroundColor!==e.progressBarBgColor&&(r.style.backgroundColor=e.progressBarBgColor),r.querySelector("."+Se)&&getComputedStyle(r.querySelector("."+Se)).color!==e.taskLabelColor&&(r.querySelector("."+Se).style.color=e.taskLabelColor),a?a.querySelector("."+Oe)&&getComputedStyle(a.querySelector("."+Oe)).backgroundColor!==e.baselineColor&&(a.querySelector("."+Oe).style.backgroundColor=e.baselineColor):n.querySelector("."+Oe)&&getComputedStyle(n.querySelector("."+Oe)).backgroundColor!==e.baselineColor&&(n.querySelector("."+Oe).style.backgroundColor=e.baselineColor)),a?(a.querySelector("."+ke)&&a.querySelector("."+ke).querySelector("."+l)&&getComputedStyle(a.querySelector("."+ke).querySelector("."+l)).color!==e.leftLabelColor&&(a.querySelector("."+ke).querySelector("."+l).style.color=e.leftLabelColor),a.querySelector("."+be)&&a.querySelector("."+be).querySelector("."+l)&&getComputedStyle(a.querySelector("."+be).querySelector("."+l)).color!==e.rightLabelColor&&(a.querySelector("."+be).querySelector("."+l).style.color=e.rightLabelColor)):(n.querySelector("."+ke)&&n.querySelector("."+ke).querySelector("."+l)&&getComputedStyle(n.querySelector("."+ke).querySelector("."+l)).color!==e.leftLabelColor&&(n.querySelector("."+ke).querySelector("."+l).style.color=e.leftLabelColor),n.querySelector("."+be)&&n.querySelector("."+be).querySelector("."+l)&&getComputedStyle(n.querySelector("."+be).querySelector("."+l)).color!==e.rightLabelColor&&(n.querySelector("."+be).querySelector("."+l).style.color=e.rightLabelColor))},u.prototype.getClassName=function(e){var t=[];return t.push("."+("ParentTask"===e.taskbarType?Ke:"ChildTask"===e.taskbarType?Ge:He)),t.push("."+("ParentTask"===e.taskbarType?Qe:"ChildTask"===e.taskbarType?ze:Ie)),t},u.prototype.templateCompiler=function(t){if(!ne.isNullOrUndefined(t)&&""!==t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?ne.compile(document.querySelector(t).innerHTML.trim(),this.parent):ne.compile(t,this.parent)}catch(e){return ne.compile(t,this.parent)}return null},u.prototype.updateOverlapped=function(){for(var e=0;e<this.parent.treeGrid.parentData.length;e++)for(var t=this.parent.treeGrid.parentData[e].childRecords,i=0;i<t.length;i++){t[i+1]&&(t[i].ganttProperties.eOverlapped=void 0);for(var a=i+1;a<t.length;a++)t[a].ganttProperties.eOverlapped=void 0,t[i].ganttProperties.startDate.getTime()<t[a].ganttProperties.endDate.getTime()&&t[i].ganttProperties.endDate.getTime()>t[a].ganttProperties.startDate.getTime()?(t[a].ganttProperties.eOverlapped=!0,t[i].ganttProperties.eOverlapped=!0):(ne.isNullOrUndefined(t[a].ganttProperties.eOverlapped)&&(t[a].ganttProperties.eOverlapped=!1),ne.isNullOrUndefined(t[i].ganttProperties.eOverlapped)&&(t[i].ganttProperties.eOverlapped=!1))}},u.prototype.updateDragDropRecords=function(e,t){var i=e.childRecords,a=this.parent.currentViewData.indexOf(e),n=(this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2]:this.parent.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,r=(t=t||this.ganttChartTableBody.childNodes[a],this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll?t.style.height=this.parent.treeGrid.getRowByIndex(a).style.height=this.parent.rowHeight+"px":t.style.height=this.parent.treeGrid.getRows()[a].style.height=this.parent.rowHeight+"px",this.parent.contentHeight=n,[]),s=0;if(e){for(var o=0;o<i.length;o++)for(var l=o+1;l<i.length;l++)for(var d=t.getElementsByClassName("e-taskbar-main-container"),h=0;h<d.length;h++){var p,u=("ResourceView"===this.parent.viewType?i[l]:i[l].ganttProperties).rowUniqueID;i[o].ganttProperties.startDate.getTime()<i[l].ganttProperties.endDate.getTime()&&i[o].ganttProperties.endDate.getTime()>i[l].ganttProperties.startDate.getTime()?d[h].getAttribute("rowuniqueid")===u&&-1===r.indexOf(u)&&(r.push(u),s++,t.children[0].style.verticalAlign="baseline",t.getElementsByClassName("e-taskbar-main-container")[h].style.marginTop=s*this.parent.rowHeight+this.taskBarMarginTop+"px",p="string"==typeof this.parent.rowHeight?parseInt(this.parent.rowHeight,10):this.parent.rowHeight,p=parseInt(t.style.height,10)+p,this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll?t.style.height=this.parent.treeGrid.getRowByIndex(a).style.height=p+"px":t.style.height=this.parent.treeGrid.getRows()[a].style.height=p+"px"):d[h].getAttribute("rowuniqueid")===u&&-1===r.indexOf(u)&&this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.draggedRecord&&d[h].getAttribute("rowuniqueid")===this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID&&this.parent.rowDragAndDropModule.draggedRecord.rowUniqueID===i[l].rowUniqueID&&(t.getElementsByClassName("e-taskbar-main-container")[h].style.marginTop=this.parent.editModule.taskbarEditModule.draggedRecordMarginTop)}this.parent.contentHeight=(this.parent.enableRtl?this.parent.element.getElementsByClassName("e-content")[2]:this.parent.element.getElementsByClassName("e-content")[0]).children[0].offsetHeight,document.getElementsByClassName("e-chart-rows-container")[0].style.height=this.parent.contentHeight+"px"}},u.prototype.setRowHeight=function(e,t,i,a,n){a=a?i.getRowByIndex(e):i.getRows()[e];a&&(a.style.height=t+"px"),n&&(n.style.height=t+"px")},u.prototype.refreshRow=function(e,t,i){var a=this,n=this.ganttChartTableBody.childNodes[e],r=(i?this.parent.previousFlatData:this.parent.currentViewData)[e];if(-1!==e&&r){var s=r;if(!this.parent.allowTaskbarOverlap&&s.expanded){var o=this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll;if(this.setRowHeight(e,this.parent.rowHeight,this.parent.treeGrid,o,n),this.parent.freezeModule&&s.hasChildRecords)for(var l="ResourceView"===this.parent.viewType?"rowUniqueID":"taskId",d=0,h=s.childRecords;d<h.length;d++){var p=h[d],p=i?this.parent.ids.indexOf(p.ganttProperties[l].toString()):this.parent.currentViewData.indexOf(p);this.setRowHeight(p,this.parent.rowHeight,this.parent.treeGrid,o)}}s.hasChildRecords&&!s.expanded&&this.parent.enableMultiTaskbar?(n.replaceChild(this.getGanttChartRow(e,s).childNodes[0],n.childNodes[0]),this.parent.renderBaseline&&s.childRecords.forEach(function(e){ne.isNullOrUndefined(e.ganttProperties.baselineStartDate&&e.ganttProperties.baselineEndDate)||n.childNodes[0].appendChild(a.updateTaskBaselineNode(e)[0])})):this.parent.allowTaskbarDragAndDrop&&!s.expanded?n.replaceWith(this.getGanttChartRow(e,s)):(n.replaceChild(this.getGanttChartRow(e,s).childNodes[0],n.childNodes[0]),this.parent.enableMultiTaskbar&&s.parentItem&&(m=s.parentItem.taskId,(y=this.parent.getRecordByID(m)).expanded||(u=this.parent.getRowByID(m)).replaceChild(this.getGanttChartRow(Number(m),y).childNodes[0],u.childNodes[0]))),this.parent.renderTemplates(),this.parent.showOverAllocation&&this.parent.allowTaskbarOverlap&&(s.hasChildRecords||s.parentItem&&this.parent.editedRecords.every(function(e){return e.ganttProperties.taskId.toString()!==s.parentItem.taskId.toString()}))&&(t?this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData):(m=s.hasChildRecords?s:this.parent.getRecordByID(s.parentItem.taskId),this.parent.dataOperation.updateOverlappingValues(m),this.parent.ganttChartModule.renderRangeContainer([m])));var u,c=!ne.isNullOrUndefined(s.ganttProperties.segments)&&s.ganttProperties.segments.length;if(0<c)for(var g=0;g<c;g++){var f=n.getElementsByClassName("e-segmented-taskbar")[g];this.triggerQueryTaskbarInfoByIndex(f,s)}else this.triggerQueryTaskbarInfoByIndex(n,s),this.parent.enableMultiTaskbar&&s.parentItem&&this.parent.queryTaskbarInfo&&!this.parent.getParentTask(s.parentItem).expanded&&(y=s.parentItem.index,u=void 0,u=(i?this.parent.previousFlatData:this.parent.currentViewData)[y],this.triggerQueryTaskbarInfoByIndex(this.ganttChartTableBody.querySelectorAll("tr")[y],u));var t="ProjectView"===this.parent.viewType?s.ganttProperties.taskId:s.ganttProperties.rowUniqueID,m=(this.parent.ganttChartModule.isExpandAll||this.parent.ganttChartModule.isCollapseAll||this.isGridRowRefreshed||this.parent.treeGrid.setRowData(t,s),s.hasChildRecords&&!s.expanded&&this.parent.enableMultiTaskbar&&!this.parent.allowTaskbarOverlap&&this.updateDragDropRecords(r,n),s.hasChildRecords&&this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap&&(this.parent.dataOperation.updateOverlappingValues(s),this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData)),this.parent.ganttChartModule.tempNextElement),y=(this.parent.ganttChartModule.isEditableElement&&m&&(this.parent.treeGrid.grid.focusModule.focus(),ne.addClass([this.parent.treeGrid.getRows()[parseInt(n.getAttribute("aria-rowindex"),10)-1].children[this.parent.ganttChartModule.childrenIndex]],"e-focused"),this.parent.ganttChartModule.tempNextElement=null),this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[e].getAttribute("data-uid")));ne.isNullOrUndefined(y)||(y.data=s)}},u.prototype.refreshRecords=function(e,t,i){if(_(this.parent.dataSource)&&this.parent.focusModule.tabElement.isTab&&(this.parent.editModule.remoteCrud=!0),this.parent.isGanttChartRendered){this.parent.renderTemplates(),this.parent.enableMultiTaskbar&&(e=new U.DataManager(e).executeLocal((new U.Query).sortBy("expanded","Descending"))),!this.parent.ganttChartModule.isExpandAll&&!this.parent.ganttChartModule.isCollapseAll&&!this.skipReactRefresh&&0<this.parent.treeGrid.grid.element.querySelectorAll(".e-templatecell").length&&this.parent.isReact&&(this.isGridRowRefreshed=!0,this.parent.treeGrid.grid.portals=[],this.parent.treeGrid.grid.refresh());for(var a=0;a<e.length;a++){var n=void 0,n=i?this.parent.ids.indexOf(e[a].ganttProperties.taskId.toString()):this.parent.currentViewData.indexOf(e[a]);this.parent.enableMultiTaskbar&&(!this.parent.enableMultiTaskbar||!e[a].expanded&&this.parent.isLoad)||this.refreshRow(n,t,i)}this.parent.ganttChartModule.updateLastRowBottomWidth(),this.skipReactRefresh=!1}},u.prototype.removeEventListener=function(){var t=this;this.parent.isDestroyed||(this.ganttChartTableBody.childNodes.forEach(function(e){e instanceof Element&&(e.removeEventListener("touchmove",t.handleTouchMove),e.removeEventListener("touchend",t.handleTouchEnd))}),this.parent.off("renderPanels",this.createChartTable),this.parent.off("dataReady",this.initiateTemplates),this.parent.off("destroy",this.destroy))},u.prototype.destroy=function(){this.removeEventListener()},u.prototype.generateAriaLabel=function(e){e=this.templateData;var t="",i=this.parent.localeObj.getConstant("name"),a=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),r=this.parent.localeObj.getConstant("duration"),s=e.ganttProperties.taskName,o=e.ganttProperties.startDate,l=e.ganttProperties.endDate,d=e.ganttProperties.duration;return e.ganttProperties.isMilestone?t=i+" "+s+" "+a+" "+this.parent.getFormatedDate(o):(s&&(t+=i+" "+s+" "),o&&(t+=a+" "+this.parent.getFormatedDate(o)+" "),l&&(t+=n+" "+this.parent.getFormatedDate(l)+" "),d&&(t+=r+" "+this.parent.getDurationString(d,e.ganttProperties.durationUnit))),t},u.prototype.generateSpiltTaskAriaLabel=function(e,t){var i="",a=this.parent.localeObj.getConstant("startDate"),n=this.parent.localeObj.getConstant("endDate"),r=this.parent.localeObj.getConstant("duration"),s=e.startDate,o=e.endDate,e=e.duration;return s&&(i+=a+" "+this.parent.getFormatedDate(s)+" "),o&&(i+=n+" "+this.parent.getFormatedDate(o)+" "),e&&(i+=r+" "+this.parent.getDurationString(e,t.durationUnit)),i},u.prototype.generateTaskLabelAriaLabel=function(e){var t="";return"left"===e&&this.parent.labelSettings.leftLabel&&!this.leftTaskLabelTemplateFunction?t+=this.parent.localeObj.getConstant("leftTaskLabel")+" "+this.getTaskLabel(this.parent.labelSettings.leftLabel):"right"===e&&this.parent.labelSettings.rightLabel&&!this.rightTaskLabelTemplateFunction&&(t+=this.parent.localeObj.getConstant("rightTaskLabel")+" "+this.getTaskLabel(this.parent.labelSettings.rightLabel)),t};var ya,Da,ka=u;function u(e){var t=Da.call(this,e)||this;return t.taskBarHeight=0,t.milestoneHeight=0,t.milesStoneRadius=0,t.baselineTop=0,t.baselineHeight=8,t.isGridRowRefreshed=!1,t.touchLeftConnectorpoint="",t.touchRightConnectorpoint="",t.dropSplit=!1,t.refreshedTr=[],t.refreshedData=[],t.isUpdated=!0,t.tagRegex=/<\/?(\w+)([^>]*?)(\/?)>/g,t.attributeRegex=/([\w-]+)\s*=\s*"([^"]*)"/g,t.taskBaselineTemplateNode=null,t.skipReactRefresh=!1,t.handleTouchMove=function(e){t.parent.ganttChartModule.ganttChartMove(e)},t.handleTouchEnd=function(e){t.parent.ganttChartModule.documentMouseUp(e)},t.parent=e,t.initPublicProp(),t.addEventListener(),t}var Ta=function(){return(Ta=Object.assign||function(e){for(var t,i=1,a=arguments.length;i<a;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},ba=(c.prototype.ensurePredecessorCollection=function(){var e=this.parent.predecessorsCollection,t=this.parent.flatData,i=new Map;if(null!=t)for(var a=0,n=t;a<n.length;a++){var r=n[a];i.set(r.ganttProperties.rowUniqueID.toString(),r)}for(var s=0,o=e;s<o.length;s++){var l=o[s];(l.hasChildRecords||this.parent.allowParentDependency)&&!this.parent.allowParentDependency||this.ensurePredecessorCollectionHelper(l,l.ganttProperties,i)}},c.prototype.ensurePredecessorCollectionHelper=function(e,t,i){void 0===i&&(i=null);var a=t.predecessorsName;if(!a||"string"!=typeof a&&"number"!=typeof a){if(a&&"object"==typeof a&&a.length){for(var n=[],r=0;r<a.length;r++){var s=a[r],o={},l=(o.from=ne.getValue("from",s)?ne.getValue("from",s):a[r],o.to=ne.getValue("to",s)?ne.getValue("to",s):t.rowUniqueID,o.type=ne.getValue("type",s)?ne.getValue("type",s):"FS",ne.getValue("offset",s));ne.isNullOrUndefined(l)?(o.offset=0,ne.isNullOrUndefined(this.parent.durationUnit)||(o.offsetUnit=this.parent.durationUnit.toLocaleLowerCase())):"string"==typeof l?(s=this.getOffsetDurationUnit(ne.getValue("offset",s)),o.offset=s.duration,o.offsetUnit=s.durationUnit):(o.offset=parseFloat(l.toString()),ne.isNullOrUndefined(this.parent.durationUnit)||(o.offsetUnit=this.parent.durationUnit.toLocaleLowerCase())),this.checkIsParent(o.from.toString())||n.push(o)}this.parent.setRecordValue("predecessor",n,t,!0)}}else this.parent.setRecordValue("predecessor",this.calculatePredecessor(a,e,i),t,!0);this.parent.setRecordValue("predecessorsName",this.getPredecessorStringValue(e),t,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,t.predecessorsName,e),this.parent.setRecordValue(this.parent.taskFields.dependency,t.predecessorsName,e)},c.prototype.updateUnscheduledDependency=function(e){for(var t=this.parent.taskFields,i=ne.isNullOrUndefined(e[t.dependency])?[]:e[t.dependency].toString().split(","),a=0;a<i.length;a++){var n=parseInt(i[a],10);if(!isNaN(n)){var n=this.parent.connectorLineModule.getRecordByID(n.toString()),r=ne.isNullOrUndefined(n)?null:ne.extend({},{},n.taskData,!0);if(!ne.isNullOrUndefined(r)&&ne.isNullOrUndefined(r[t.startDate])&&ne.isNullOrUndefined(r[t.duration])&&ne.isNullOrUndefined(r[t.endDate])){r[t.duration]=1;var s=void 0;if(n.parentItem){for(var o=this.parent.getParentTask(n.parentItem);o&&!o.ganttProperties.startDate;)o=this.parent.getParentTask(o.parentItem);s=o?o.ganttProperties.startDate:this.parent.cloneProjectStartDate}else s=this.parent.cloneProjectStartDate;r[t.startDate]=s,this.parent.updateRecordByID(r)}}}},c.prototype.checkIsParent=function(e){var t=!1;return t=this.parent.connectorLineModule.getRecordByID(e).hasChildRecords?!0:t},c.prototype.getRootParent=function(t){var e=t;return t.parentItem&&(e=this.parent.flatData.filter(function(e){return e.uniqueID===t.parentUniqueID})[0]).parentItem?this.getRootParent(e):e},c.prototype.validateParentPredecessor=function(e,t){if(e&&t)if(t.hasChildRecords&&!e.hasChildRecords){if(e.parentUniqueID===t.uniqueID)return!1;do{if(e.parentItem&&(e=this.parent.flatData[this.parent.ids.indexOf(e.parentItem.taskId)]).uniqueID===t.uniqueID)return!1}while(e.parentItem)}else if(!t.hasChildRecords&&e.hasChildRecords){if(t.parentUniqueID===e.uniqueID)return!1;do{if(t.parentItem&&(t=this.parent.flatData[this.parent.ids.indexOf(t.parentItem.taskId)]).uniqueID===e.uniqueID)return!1}while(t.parentItem)}else if(t.hasChildRecords&&e.hasChildRecords)if(t.parentItem&&e.parentItem){if(e.parentUniqueID===t.uniqueID||e.uniqueID===t.parentUniqueID)return!1}else if(!t.parentItem&&e.parentItem){if(this.getRootParent(e).uniqueID===t.uniqueID)return!1}else if(t.parentItem&&!e.parentItem)if(this.getRootParent(t).uniqueID===e.uniqueID)return!1;return!0},c.prototype.calculatePredecessor=function(e,t,i){void 0===i&&(i=null);for(var e=e.toString(),a=[],n=[],r="ResourceView"===this.parent.viewType,s="ProjectView"===this.parent.viewType,o=this.parent.allowParentDependency,l=r?this.parent.getTaskIds():this.parent.ids,d=(r?t.ganttProperties.taskId:t.ganttProperties.rowUniqueID).toString(),h=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,p=/[A-Za-z]/,u=new Set(["FS","FF","SF","SS"]),c=0,g=e.replace(/\s+/g,"").split(",");c<g.length;c++){var f,m,y,D=g[c],D=this.processPredecessorElement(D,l,r,h,p,u);D&&(f=D.match,m=D.predecessorText,y=D.offsetValue,y=1<(D=D.values).length?y+D[1]:"0",D=this.getOffsetDurationUnit(y),y={from:f[0],type:m,isDrawn:!1,to:d,offsetUnit:D.durationUnit,offset:D.duration},o?this.handleParentDependency(y,a,n,i,s):this.checkIsParent(f[0])||a.push(y))}return this.handleUndoRedoParentRecords(n),this.removeDuplicatePredecessors(a)},c.prototype.processPredecessorElement=function(e,t,i,a,n,r){var s="+",a=this.processElementFormat(e,a,t,i,r),o=(a.isGuid,a.processedValues),s=a.processedOffset,o=this.extractAndValidateMatch((a=o)[0],t,i);return o?{match:o,predecessorText:this.determinePredecessorType(e,o,n,r),offsetValue:s,values:a}:null},c.prototype.processElementFormat=function(e,t,i,a,n){var r=e.split("-"),s=[],o="+",l=!1;if(5<=r.length){var d=e.substring(0,36);if(t.test(d))return l=!0,(t=r[4]+(r[5]?"-"+r[5]:"")).includes("+")?(h=t.split("+"),s=[e.slice(0,-(h[1].length+1)).trim(),h[1].trim()],o="+"):t.includes("-")&&1<(h=t.split("-")).length?(s=[e.slice(0,-(h[1].length+1)).trim(),h[1].trim()],o="-"):s=[e],{isGuid:l,processedValues:s,processedOffset:o}}var h,p,u,d=e.includes("+")?"+":e.includes("-")?"-":null;return null!==d?(r=e.lastIndexOf(d),t=e.substring(0,r),h=e.substring(r+1),p=t.slice(-2).toUpperCase(),r=t,u=(r=n.has(p)?r:t+"FS").slice(0,-2).trim(),o=-1===i.indexOf(a?"T"+u:u)||""===h?(s=[e],"+"):(s=[r,h],d)):(p=e.slice(-2).toUpperCase(),s=(n.has(p)&&(u=e.slice(0,-2),i.indexOf(a?"T"+u:u)),[e])),{isGuid:l,processedValues:s,processedOffset:o}},c.prototype.extractAndValidateMatch=function(e,t,i){var a;return-1!==t.indexOf(i?"T"+e:e)||-1!==t.indexOf(e)?[e]:(1===(a=e.split(" ")).length&&(-1!==e.indexOf(" ")?a=e.match(/(\d+|[A-z]+)/g)||[]:2<e.length&&(a=[e.slice(0,-2),e.slice(-2)])),e=i?"T"+a[0]:a[0],-1!==t.indexOf(e)?a:null)},c.prototype.determinePredecessorType=function(e,t,i,a){var n;return 1<t.length?(n=t[1].toUpperCase(),a.has(n)?n:(this.parent.trigger("actionFailure",{error:"The provided dependency type, "+n+", is invalid. Please ensure that the Dependency Type is FS or FF or SS or SF"}),"FS")):-1!==e.indexOf("-")&&i.test(e)&&(n=e.slice(-2).toUpperCase(),a.has(n))?n:"FS"},c.prototype.handleParentDependency=function(e,t,i,a,n){var r=null,s=null;(s=n&&a&&0<a.size?(r=a.get(e.from),a.get(e.to)):(r=this.parent.connectorLineModule.getRecordByID(e.from),this.parent.connectorLineModule.getRecordByID(e.to)))&&r?this.validateParentPredecessor(r,s)&&(t.push(e),r.hasChildRecords)&&-1===i.indexOf(r)&&this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&i.push(ne.extend([],[],[r],!0)[0]):t.push(e)},c.prototype.handleUndoRedoParentRecords=function(e){var t;0<e.length&&this.parent.undoRedoModule&&this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&(t=(t=this.parent.undoRedoModule.getUndoCollection)[t.length-1])&&(t.connectedRecords=e)},c.prototype.removeDuplicatePredecessors=function(e){for(var t=new Map,i=0,a=e;i<a.length;i++){var n=a[i],r=n.from+"-"+n.to;t.set(r,n)}return Array.from(t.values())},c.prototype.generatePredecessorValue=function(e,t){var i;return 0!==e.offset&&(t+=0<e.offset?"+"+e.offset+" ":e.offset+" ",i=1!==e.offset,"day"===e.offsetUnit?t+=i?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===e.offsetUnit?t+=i?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):t+=i?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute")),t},c.prototype.getPredecessorStringValue=function(e){var t=e.ganttProperties.predecessor,i="",a=[];if(t)for(var n=t.length,r=0;r<n;r++){var s=t[r],o="",l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;s.from!==l.toString()&&(o=s.from+s.type,o="string"==typeof e.ganttProperties.taskId?(a[0]=o.slice(0,-2),a[1]=o.slice(-2),a[0]+" "+a[1]):o,0!==s.offset&&(o+=0<s.offset?"+"+s.offset+" ":s.offset+" ",l=1!==s.offset,"day"===s.offsetUnit?o+=l?this.parent.localeObj.getConstant("days"):this.parent.localeObj.getConstant("day"):"hour"===s.offsetUnit?o+=l?this.parent.localeObj.getConstant("hours"):this.parent.localeObj.getConstant("hour"):o+=l?this.parent.localeObj.getConstant("minutes"):this.parent.localeObj.getConstant("minute")),i=0<i.length?i+","+o:o)}return i=""===i?null:i},c.prototype.getOffsetDurationUnit=function(e){var t,i=0,a=(ne.isNullOrUndefined(this.parent.durationUnit)||(t=this.parent.durationUnit.toLocaleLowerCase()),this.parent.durationUnitEditText);if("string"==typeof e){for(var n=e.match(/[^0-9]+|[0-9]+/g),r=0;r<n.length;r++)n[r]=n[r].trim();"-"===n[0]&&n[1]?(n[1]=n[0]+n[1],n.shift()):"+"===n[0]&&n.shift(),"."!==n[1]||isNaN(parseInt(n[2],10))||(n[0]+=n[1]+n[2],n.splice(1,2)),n&&n.length<=2&&(i=parseFloat(n[0]),t=n[1]?n[1].toLowerCase().trim():"",-1!==ne.getValue("minute",a).indexOf(t)?t="minute":-1!==ne.getValue("hour",a).indexOf(t)?t="hour":-1!==ne.getValue("day",a).indexOf(t)?t="day":ne.isNullOrUndefined(this.parent.durationUnit)||(t=this.parent.durationUnit.toLocaleLowerCase()))}else i=e,ne.isNullOrUndefined(this.parent.durationUnit)||(t=this.parent.durationUnit.toLocaleLowerCase());return isNaN(i)&&(this.parent.trigger("actionFailure",{error:"The provided value for the offset field is invalid.Please ensure the offset field contains only valid numeric values"}),i=0,ne.isNullOrUndefined(this.parent.durationUnit)||(t=this.parent.durationUnit.toLocaleLowerCase())),{duration:i,durationUnit:t}},c.prototype.updatePredecessors=function(e){void 0===e&&(e=null);for(var t,i=this.parent.predecessorsCollection,a=i.length,n=0;n<a;n++)((t=i[n]).hasChildRecords||this.parent.allowParentDependency)&&!this.parent.allowParentDependency||(this.updatePredecessorHelper(t,i,e),!this.parent.isInPredecessorValidation&&this.parent.autoUpdatePredecessorOffset&&this.calculateOffset(t),t.ganttProperties.isAutoSchedule)||!this.parent.editSettings.allowEditing||(this.validatedOffsetIds=[],this.calculateOffset(t))},c.prototype.updatePredecessorHelper=function(e,t,i){void 0===i&&(i=null);var a=e.ganttProperties.predecessor,n=a.length;t=ne.isNullOrUndefined(t)?[]:t;for(var r=0;r<n;r++){var s=a[r],o="ProjectView"!==this.parent.viewType||ne.isNullOrUndefined(i)?this.parent.connectorLineModule.getRecordByID(s.from):i.get(s.from),l="ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID;s.from!==l.toString()&&o&&(l=void 0,o.ganttProperties.predecessor?((l=ne.extend([],o.ganttProperties.predecessor,[],!0)).push(s),this.parent.setRecordValue("predecessor",l,o.ganttProperties,!0)):((l=[]).push(s),this.parent.setRecordValue("predecessor",l,o.ganttProperties,!0),t.push(o)))}},c.prototype.traverseParents=function(e,t){this.parent.dataOperation.updateParentItems(e,t)},c.prototype.updatedRecordsDateByPredecessor=function(t){var i=this;if(void 0===t&&(t=null),this.parent.autoCalculateDateScheduling&&!(this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)){var e=this.parent.flatData,a=e.length;if(0!==a){if(ne.isNullOrUndefined(t)){t=new Map;for(var n=0,r=e;n<r.length;n++){var s=r[n];t.set(s.ganttProperties.rowUniqueID.toString(),s)}}for(var o=new Set,l="ProjectView"===this.parent.viewType,d=this.parent.allowParentDependency,h=new Set,p=0;p<a;p++){var u=e[p],c=u.ganttProperties;if(c.predecessorsName){var g=u.ganttProperties.taskId.toString(),g=(h.has(g)||this.validatePredecessorDates(u,t),u.hasChildRecords&&c.startDate&&d&&this.updateChildItems(u),c.predecessor);if(g&&1<g.length)for(var f=u.ganttProperties.taskId.toString(),m=0,y=g;m<y.length;m++){var D=y[m],D=l?t.get(D.to):this.parent.connectorLineModule.getRecordByID(D.to);D&&D.ganttProperties.taskId.toString()!==f&&(this.validatePredecessorDates(D,t),h.add(D.ganttProperties.taskId.toString()))}(u.parentItem||u.hasChildRecords)&&(c=(u.parentItem||u.ganttProperties).taskId,o.add(c))}}this.parent.isLoad||o.forEach(function(e){o.has(e)&&(e=l?t.get(e):i.parent.getRecordByID(e))&&i.traverseParents(e,!0)}),this.parent.dataOperation.processedParentItems.clear()}}},c.prototype.updateParentPredecessor=function(e){if(0===(e=void 0===e?null:e).size)this.parentPredecessors=[];else if(this.parent.enablePredecessorValidation)for(var t=this.parentPredecessors.length-1;0<=t;t--){var i=this.parentPredecessors[t];this.validatePredecessorDates(i,e),i.ganttProperties.startDate&&this.updateChildItems(i)}},c.prototype.validatePredecessorDates=function(e,t){void 0===t&&(t=null);var i,a,n,r,s,o,l,d,h,p,u,c,g,f,m=e.ganttProperties.predecessor;m&&0!==m.length&&(l="ResourceView"===this.parent.viewType,i="ProjectView"===this.parent.viewType,a=this.parent.allowParentDependency,n=this.parent.allowTaskbarDragAndDrop,r=this.parent.validateManualTasksOnLinking,s=this.parent.isLoad,u=i&&!ne.isNullOrUndefined(t),o=(l?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID).toString(),0!==(l=m.filter(function(e){return e.to===o})).length)&&(m=l[0],p=h=null,u=u?(d=t.get(m.from),t.get(m.to)):(d=this.parent.connectorLineModule.getRecordByID(m.from),this.parent.connectorLineModule.getRecordByID(m.to)),c=this.parent.taskFields,this.parent.autoCalculateDateScheduling&&this.parent.isLoad&&(u&&u[c.startDate]&&(g=u[c.startDate],this.parent.dataOperation.resolveAndApplyWorkingTimes(g),h=new Date(g.getTime())),u)&&u[c.endDate]&&(g=u[c.endDate],this.parent.dataOperation.resolveAndApplyWorkingTimes(null,g),p=new Date(g.getTime())),a&&d&&d.hasChildRecords&&this.parent.dataOperation.updateParentItems(d),i&&n&&(ne.isNullOrUndefined(u)?-1!==(f=this.parent.editModule.taskbarEditModule.previousIds.indexOf(m.to))&&(u=this.parent.editModule.taskbarEditModule.previousFlatData[f]):ne.isNullOrUndefined(d)&&-1!==(f=this.parent.editModule.taskbarEditModule.previousIds.indexOf(m.from))&&(d=this.parent.editModule.taskbarEditModule.previousFlatData[f])),a&&s&&-1===this.parentPredecessors.indexOf(e)&&(e.hasChildRecords||u&&u.hasChildRecords)&&this.parentPredecessors.push(e),u&&(u.ganttProperties.isAutoSchedule||r)&&this.validateChildGanttRecord(d,u,t,l),this.parent.autoCalculateDateScheduling)&&this.parent.isLoad&&ne.isNullOrUndefined(u[c.constraintDate])&&(u[c.startDate]&&h&&h.getTime()!==u[c.startDate].getTime()||u[c.endDate]&&p&&p.getTime()!==u[c.endDate].getTime())&&this.parent.dataOperation.validatedGanttData.set(u.ganttProperties.taskId,u)},c.prototype.getConstraintDate=function(e,t,i,a){var n=null;switch(e){case k.ConstraintType.AsSoonAsPossible:case k.ConstraintType.AsLateAsPossible:return null;case k.ConstraintType.MustStartOn:case k.ConstraintType.StartNoEarlierThan:if(!a)return t;n=t;break;case k.ConstraintType.MustFinishOn:case k.ConstraintType.FinishNoEarlierThan:case k.ConstraintType.StartNoLaterThan:case k.ConstraintType.FinishNoLaterThan:if(!a)return i;n=i;break;default:return null}return n&&(a="string"==typeof a?new Date(a):a)instanceof Date&&a.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),a},c.prototype.validateChildGanttRecord=function(e,t,i,a){var n,r,s,o,l,d,h,p;void 0===i&&(i=null),-1!==this.parent.editedPredecessorRecords.indexOf(t)||e&&ne.isNullOrUndefined(j(e.ganttProperties))||t&&ne.isNullOrUndefined(j(t.ganttProperties))||(n=this.parent.isInPredecessorValidation,h=this.parent.validateManualTasksOnLinking,r=t.ganttProperties,n&&(r.isAutoSchedule||h)&&(h="ResourceView"===this.parent.viewType,s=(s=this.parent.taskFields).constraintDate&&s.constraintType,o=this.parent.isLoad,l=this.parent.isFromOnPropertyChange,p=this.parent.updateOffsetOnTaskbarEdit,d=(h?r.taskId:r.rowUniqueID).toString(),0===(h=ne.isNullOrUndefined(a)?r.predecessor.filter(function(e){return e.to===d}):a).length&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&0<e.ganttProperties.predecessor.length&&(h=e.ganttProperties.predecessor.filter(function(e){return e.to===t.ganttProperties.taskId.toString()})),a=this.getPredecessorDate(t,h,i),this.parent.setRecordValue("startDate",a,r,!0),this.parent.dataOperation.updateMappingData(t,"startDate"),s&&p&&this.calculateOffset(t),e=r.segments,!ne.isNullOrUndefined(e)&&0!==e.length||this.dateValidateModule.calculateEndDate(t),this.parent.dataOperation.updateWidthLeft(t),!o&&!l&&t.parentItem&&n&&this.parent.getParentTask(t.parentItem).ganttProperties.isAutoSchedule&&(h=t.parentItem.uniqueID,-1===this.parentIds.indexOf(h))&&(this.parentIds.push(h),this.parentRecord.push(t.parentItem)),s)&&(i=r.constraintType,a=r.startDate,p=r.endDate,e=this.getConstraintDate(i,a,p,r.constraintDate),this.parent.setRecordValue("constraintDate",e,r,!0),this.parent.autoCalculateDateScheduling&&this.parent.isLoad&&r.constraintDate&&a.getTime()!==r.constraintDate.getTime()&&this.parent.dataOperation.validatedGanttData.set(t.ganttProperties.taskId,t),this.parent.dataOperation.updateMappingData(t,"constraintDate")))},c.prototype.filterPredecessorsByTarget=function(e,t,i){var a;return e&&Array.isArray(e)&&t&&t.ganttProperties&&i?(a="ResourceView"===i?t.ganttProperties.taskId:t.ganttProperties.rowUniqueID,e.filter(function(e){return e.to===a.toString()})):[]},c.prototype.getPredecessorDate=function(e,t,i){void 0===i&&(i=null);var a=this.filterPredecessorsByTarget(t,e,this.parent.viewType);if(!a||0===a.length)return null;for(var n="ProjectView"===this.parent.viewType,r=n&&!ne.isNullOrUndefined(i),s=this.parent.allowTaskbarDragAndDrop,t=!ne.isNullOrUndefined(this.parent.taskFields.constraintDate)&&!ne.isNullOrUndefined(this.parent.taskFields.constraintType),o=this.parent.editModule,l=!t&&o&&o.cellEditModule&&!o.cellEditModule.isCellEdit&&!o.dialogModule.isFromEditDialog&&!this.parent.updateOffsetOnTaskbarEdit&&!this.parent.isLoad,d=null,h=a.length,p=0;p<h;p++){var u,c,g=a[p],f=void 0,m=void 0,m=r?(f=i.get(g.from),i.get(g.to)):(f=this.parent.connectorLineModule.getRecordByID(g.from),this.parent.connectorLineModule.getRecordByID(g.to));!n||!s||ne.isNullOrUndefined(m)&&ne.isNullOrUndefined(f)||(ne.isNullOrUndefined(m)&&(m=this.getRecord(f,m,g)),ne.isNullOrUndefined(f)&&(f=this.getRecord(f,m,g))),l&&(u=this.getOffsetForPredecessor(g,this.parent.connectorLineModule.getRecordByID(g.from),m),g.offset<=u)&&0<=u&&(c=m.ganttProperties.startDate,null!==d&&1!==this.dateValidateModule.compareDates(c,d)||(d=c)),m&&f&&(c=this.getValidatedStartDate(m.ganttProperties,f.ganttProperties,g),null!==d&&1!==this.dateValidateModule.compareDates(c,d)||(d=c))}return d=t?this.dateValidateModule.getDateByConstraint(e.ganttProperties,d,0<h):d},c.prototype.getValidatedStartDate=function(e,t,i){var a=i.type,n=i.offset,r=e.calendarContext;switch(a){case"FS":l=this.dateValidateModule.getValidEndDate(t),e.isMilestone&&0===n||(l=this.dateValidateModule.checkStartDate(l,e)),0!==n&&(l=this.updateDateByOffset(l,i,e)),o=e.isMilestone?l:this.dateValidateModule.checkStartDate(l,e);break;case"FF":case"SF":var s,o,l="FF"===a?this.dateValidateModule.getValidEndDate(t):this.dateValidateModule.getValidStartDate(t);0!==n&&(l=this.updateDateByOffset(l,i,e)),e.isMilestone||((s=new Date(l)).setDate(s.getDate()-1),l=this.parent.allowUnscheduledTasks&&ne.isNullOrUndefined(e.endDate)&&ne.isNullOrUndefined(e.duration)?this.dateValidateModule.checkStartDate(l,e):this.dateValidateModule.checkEndDate(l,e)),o=e.segments&&0!==e.segments.length?(s=this.dateValidateModule.getDuration(e.startDate,e.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,r),this.dateValidateModule.getStartDate(l,s,e.durationUnit,e)):this.dateValidateModule.getStartDate(l,e.duration,e.durationUnit,e);break;case"SS":l=this.dateValidateModule.getValidStartDate(t),0!==n&&(l=this.updateDateByOffset(l,i,e)),o=e.isMilestone?l:this.dateValidateModule.checkStartDate(l,e)}return o},c.prototype.updateDateByOffset=function(e,t,i){var a,n=t.offset,t=t.offsetUnit;return n<0&&!ne.isNullOrUndefined(e)?a=this.dateValidateModule.getStartDate(this.dateValidateModule.checkEndDate(e,i),-1*n,t,i,!0):(ne.isNullOrUndefined(e)||(a=this.dateValidateModule.getEndDate(e,n,t,i,!1)),i.isMilestone||(a=this.dateValidateModule.checkStartDate(a,i))),a},c.prototype.createConnectorLinesCollection=function(e){var t,i=e||this.parent.currentViewData,e=this.parent.pdfExportModule,a=e&&e.isPdfExport,n=(a&&(h=(t=e.helper&&e.helper.exportProps)&&t.fitToWidthSettings,t)&&h&&h.isFitToWidth&&(h=t.exportType,t=e.helper.beforeSinglePageExport,i="CurrentViewData"===h?t.cloneCurrentViewData:t.cloneFlatData),i.length),e=(this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.pdfExportModule.isPdfExport?this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData):this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.expandedRecords,this.parent.flatData),r=a?null:new Map;if(!a&&!ne.isNullOrUndefined(e))for(var s=0,o=e;s<o.length;s++){var l=o[s];r.set(l.ganttProperties.rowUniqueID.toString(),l)}for(var d,h=this.parent.ganttChartModule.getChartRows(),p=!ne.isNullOrUndefined(h)&&h[0]&&h[0].offsetHeight,u=0;u<n;u++)this.parent.editModule&&0<this.parent.editModule.deletedTaskDetails.length&&(d=i[u].parentItem)&&(d=ne.isNullOrUndefined(r)?this.parent.getRecordByID(d.taskId.toString()):r.get(d.taskId.toString()),this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(d),i[u])),(d=i[u].ganttProperties.predecessor)&&this.addPredecessorsCollection(d,r,p)},c.prototype.addPredecessorsCollection=function(e,t,i){var a,n,r;if(void 0===t&&(t=null),void 0===i&&(i=0),e)for(a=e.length,n=0;n<a;n++){var s;if((s=e[n]).from===s.to)break;var o="ProjectView"!==this.parent.viewType||ne.isNullOrUndefined(t)?(r=this.parent.connectorLineModule.getRecordByID(s.from),this.parent.connectorLineModule.getRecordByID(s.to)):(r=t.get(s.from),t.get(s.to)),l=!0;(l=(r&&r.hasChildRecords&&!r.expanded||o&&o.hasChildRecords&&!o.expanded)&&!this.parent.allowTaskbarOverlap&&"ProjectView"===this.parent.viewType?!1:l)&&this.parent.connectorLineModule.expandedRecords&&-1!==this.parent.connectorLineModule.expandedRecords.indexOf(r)&&-1!==this.parent.connectorLineModule.expandedRecords.indexOf(o)&&this.updateConnectorLineObject(r,o,s,i)}},c.prototype.updateConnectorLineObject=function(e,t,i,a){a=this.parent.connectorLineModule.createConnectorLineObject(e,t,i,a=void 0===a?0:a);return a&&(t.isCritical&&e.isCritical&&(a.isCritical=!0),0<this.parent.connectorLineIds.length&&-1===this.parent.connectorLineIds.indexOf(a.connectorLineId)||0===this.parent.connectorLineIds.length?(this.parent.updatedConnectorLineCollection.push(a),this.parent.connectorLineIds.push(a.connectorLineId)):-1!==this.parent.connectorLineIds.indexOf(a.connectorLineId)&&(t=this.parent.connectorLineIds.indexOf(a.connectorLineId),this.parent.updatedConnectorLineCollection[t]=a),i.isDrawn=!0),a},c.prototype.shouldUpdatePredecessor=function(e,t,i,a,n){if(ne.isNullOrUndefined(t)||ne.isNullOrUndefined(t.ganttProperties)||ne.isNullOrUndefined(t.ganttProperties.taskId)||ne.isNullOrUndefined(e)||ne.isNullOrUndefined(e.ganttProperties))return!1;if(!n&&ne.isNullOrUndefined(i)&&ne.isNullOrUndefined(a))return!0;n=e.ganttProperties.predecessor;if(ne.isNullOrUndefined(n)||!Array.isArray(n))return!1;i=n.find(function(e){return e.to===t.ganttProperties.taskId.toString()});if(ne.isNullOrUndefined(i))return!1;a=i.type,n=e.ganttProperties,e=t.ganttProperties;if(ne.isNullOrUndefined(n)||ne.isNullOrUndefined(e))return!1;var r=n.startDate,s=n.endDate,o=e.startDate,l=e.endDate,e=i.offset,i=i.offsetUnit;switch(0!==e&&(0<e?(r=r&&this.parent.dataOperation.getEndDate(r,Math.abs(e),i,n,!1),s=s&&this.parent.dataOperation.getEndDate(s,Math.abs(e),i,n,!1)):(o=o&&this.parent.dataOperation.getEndDate(o,Math.abs(e),i,n,!1),l=l&&this.parent.dataOperation.getEndDate(l,Math.abs(e),i,n,!1))),a){case"FS":return(null!=o?o:l)<(null!=s?s:r);case"SS":return(null!=o?o:l)<(null!=r?r:s);case"SF":return(null!=l?l:o)<(null!=r?r:s);case"FF":return(null!=l?l:o)<(null!=s?s:r);default:return!1}},c.prototype.handleTaskUpdate=function(e,t){var i,a,n=this.parent.previousRecords[e.uniqueID],n=(n&&n.ganttProperties&&(r=n.ganttProperties,this.parent.editModule.isDialogEditing?(a=i=null,this.parent.editModule.isDialogEditing=!1):(i=r.startDate,a=r.endDate)),r&&"predecessor"in r),r=this.shouldUpdatePredecessor(e,t,i,a,n);(this.parent.updateOffsetOnTaskbarEdit||r)&&(this.validateChildGanttRecord(e,t),t.hasChildRecords)&&t.ganttProperties.isAutoSchedule&&this.updateChildItems(t)},c.prototype.validateAllChildPredecessorsWithUpdate=function(e){for(var t=[],i=e.childRecords.length-1;0<=i;i--)t.push(e.childRecords[i]);for(;0<t.length;){var a=t.pop(),n=a.ganttProperties;if(-1===this.isChildRecordValidated.indexOf(n.taskId)){if(this.isChildRecordValidated.push(n.taskId),n.predecessor&&0<n.predecessor.length)for(var r=0;r<n.predecessor.length;r++){var s=n.predecessor[r],o=void 0,o=s.to!==e.ganttProperties.taskId.toString()?s.to:s.from,s=this.parent.flatData[this.parent.ids.indexOf(o)];s&&(this.validatePredecessor(s,[],""),s.hasChildRecords&&this.parent.editModule.editedRecord.hasChildRecords&&this.updateChildItems(s),this.isValidatedParentTaskID=s.ganttProperties.taskId)}if(a.hasChildRecords)for(i=a.childRecords.length-1;0<=i;i--)t.push(a.childRecords[i])}}},c.prototype.updateParentCollection=function(e,t,i){var a;e.parentItem&&(a=this.parent.getTaskByUniqueID(e.parentItem.uniqueID))&&!i.has(a.uniqueID)&&(i.add(a.uniqueID),this.parent.editModule.updateParentRecords.push(a)),t.parentItem&&(a=this.parent.getTaskByUniqueID(t.parentItem.uniqueID))&&!i.has(a.uniqueID)&&(i.add(a.uniqueID),this.parent.editModule.updateParentRecords.push(a))},c.prototype.validatePredecessor=function(e,t,i){if(this.parent.isInPredecessorValidation&&e.ganttProperties.predecessor){for(var a="ResourceView"===this.parent.viewType,n=this.parent.editModule.editedRecord,r=this.parent.editModule.taskbarEditModule,s=r?r.taskBarEditRecord:void 0,o=e.ganttProperties.predecessor,l=(a?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID).toString(),d=o.filter(function(e){return e.to===l}),h=o.filter(function(e){return e.from===l}),p=new Set(this.parent.editModule.updateParentRecords.map(function(e){return e.uniqueID})),u=0;u<d.length;u++){var c=d[u],g=this.parent.connectorLineModule.getRecordByID(c.from),f=this.parent.connectorLineModule.getRecordByID(c.to),m=(this.updateParentCollection(f,g,p),"ProjectView"!==this.parent.viewType||!this.parent.allowTaskbarDragAndDrop||null==f&&null==g||(null==f&&(f=this.getRecord(g,f,c)),null==g&&(g=this.getRecord(g,f,c))),this.parent.isValidationEnabled=this.parent.isInPredecessorValidation&&f.ganttProperties.isAutoSchedule,a?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID);m.toString()!==c.to&&m.toString()!==c.from||i&&"predecessor"!==i||(this.handleTaskUpdate(g,f),n&&n.hasChildRecords&&!n.parentItem&&(this.isValidatedParentTaskID=f.ganttProperties.taskId))}for(u=0;u<h.length;u++){var y=h[u];g=this.parent.connectorLineModule.getRecordByID(y.from),f=this.parent.connectorLineModule.getRecordByID(y.to),this.updateParentCollection(f,g,p),"ProjectView"!==this.parent.viewType||!this.parent.allowTaskbarDragAndDrop||null==f&&null==g||(null==f&&(f=this.getRecord(g,f,y)),null==g&&(g=this.getRecord(g,f,y))),this.parent.isValidationEnabled=this.parent.isInPredecessorValidation&&f.ganttProperties.isAutoSchedule,"predecessor"!==i&&this.parent.isValidationEnabled?(this.handleTaskUpdate(g,f),n&&f&&(y=g.parentItem?this.getRootParent(g):null,!f.hasChildRecords||n.hasChildRecords&&(f.parentItem||y&&y.ganttProperties.taskId!==n.ganttProperties.taskId)||this.isValidatedParentTaskID===f.ganttProperties.taskId||(this.updateChildItems(f),this.validateAllChildPredecessorsWithUpdate(f),this.isValidatedParentTaskID=f.ganttProperties.taskId),n.hasChildRecords)&&!n.parentItem&&(this.isValidatedParentTaskID=f.ganttProperties.taskId)):!f.ganttProperties.isAutoSchedule&&this.parent.updateOffsetOnTaskbarEdit&&(this.validatedOffsetIds=[],this.calculateOffset(f)),!1!==g.expanded&&!1!==f.expanded||!f?f&&(this.parent.editModule.isFirstCall&&(y=a?this.parent.getTaskIds():this.parent.ids,this.storeId=y.slice(),this.parent.editModule.isFirstCall=!1),this.storeId?(y=f[this.parent.taskFields.id].toString(),-1!==(k=this.storeId.indexOf(a?"T"+y:y))&&(this.storeId.splice(k,1),this.validatePredecessor(f,void 0,"successor"))):this.validatePredecessor(f,void 0,"successor")):this.validatePredecessor(f,void 0,"successor")}f&&!f.hasChildRecords&&f.parentItem&&!this.validatedParentIds.indexOf(f.parentItem.taskId)&&this.validatedParentIds.push(f.parentItem.taskId);o=!0;if((o=f&&f.hasChildRecords&&this.validatedParentIds.indexOf(f.ganttProperties.taskId.toString())?!1:o)&&f)if(f.ganttProperties.taskId!==this.isValidatedParentTaskID&&s){if("ParentDrag"!==r.taskBarEditAction&&"ChildDrag"!==r.taskBarEditAction&&!s.hasChildRecords&&f.hasChildRecords&&(this.updateChildItems(f),this.isValidatedParentTaskID=f.ganttProperties.taskId),f.parentItem){this.parent.dataOperation.updateParentItems(f,!0);var D=this.parent.getParentTask(f.parentItem);if(this.storeId&&D.ganttProperties.predecessor&&0<D.ganttProperties.predecessor.length){var k,o=D[this.parent.taskFields.id].toString();if(-1!==(k=this.storeId.indexOf(o)))for(u=0;u<D.ganttProperties.predecessor.length;u++){var T=D.ganttProperties.predecessor[u];T.to!==D.ganttProperties.taskId.toString()&&(T=this.parent.flatData[this.parent.ids.indexOf(T.to)])&&T.parentItem&&this.validateChildGanttRecord(f,T)}}}}else f.hasChildRecords&&this.isValidatedParentTaskID!==f.ganttProperties.taskId&&!s&&(this.updateChildItems(f),this.isValidatedParentTaskID=f.ganttProperties.taskId)}},c.prototype.updateChildItems=function(e){var t=this,i=e.ganttProperties.calendarContext;if(0<e.childRecords.length&&this.validatedChildItems&&0<this.validatedChildItems.length)if(!!e.childRecords.some(function(e){return t.validatedChildItems.includes(e)}))return;var a,n,r,s=this.parent.previousRecords[e.uniqueID],o=(ne.isNullOrUndefined(s)||ne.isNullOrUndefined(s)&&!ne.isNullOrUndefined(s.ganttProperties)?a=new Date(e.ganttProperties.startDate.getTime()):ne.isNullOrUndefined(s.ganttProperties.startDate)||(a=new Date(s.ganttProperties.startDate.getTime())),e.ganttProperties.startDate),l=[];if(this.getUpdatableChildRecords(e,l),0!==l.length)for(var d,h=!ne.isNullOrUndefined(a)&&!ne.isNullOrUndefined(o)&&a.getTime()>o.getTime()?(n=this.parent.dateValidationModule.checkStartDate(o),r=this.parent.dateValidationModule.checkEndDate(a,e.ganttProperties),!1):(n=this.parent.dateValidationModule.checkStartDate(a),r=this.parent.dateValidationModule.checkEndDate(o,e.ganttProperties),!0),p=!ne.isNullOrUndefined(n)&&!ne.isNullOrUndefined(r)&&n.getTime()>=r.getTime()?0:this.parent.dateValidationModule.getDuration(n,r,e.ganttProperties.durationUnit,!0,!1,void 0,i),u=0;u<l.length;u++)l[u].ganttProperties.isAutoSchedule&&(0<p?(d=j(l[u].ganttProperties)?l[u].ganttProperties.startDate:l[u].ganttProperties.startDate||l[u].ganttProperties.endDate||new Date(a.toString()),d=h?this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(d,l[u].ganttProperties,l[u].ganttProperties.isMilestone),p,l[u].ganttProperties.durationUnit,l[u].ganttProperties,!1):this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(d,l[u].ganttProperties),p,l[u].ganttProperties.durationUnit,l[u].ganttProperties),this.calculateDateByRoundOffDuration(l[u],d),this.parent.isOnEdit&&-1===this.validatedChildItems.indexOf(l[u])&&this.validatedChildItems.push(l[u])):ne.isNullOrUndefined(s)&&(d=a,!ne.isNullOrUndefined(l[u].ganttProperties.startDate)&&l[u].ganttProperties.startDate.getTime()<=d.getTime()&&this.calculateDateByRoundOffDuration(l[u],d),this.parent.isOnEdit)&&-1===this.validatedChildItems.indexOf(l[u])&&this.validatedChildItems.push(l[u]))},c.prototype.getUpdatableChildRecords=function(e,t){for(var i=0,a=e.childRecords;i<a.length;i++){var n=a[i];n.ganttProperties.isAutoSchedule&&(t.push(n),n.hasChildRecords)&&this.getUpdatableChildRecords(n,t)}},c.prototype.calculateDateByRoundOffDuration=function(e,t){var i,a=e,n=a.ganttProperties,t=new Date(t.getTime());!ne.isNullOrUndefined(n.endDate)&&ne.isNullOrUndefined(n.startDate)?(i=this.parent.dateValidationModule.checkStartDate(t,n,null),this.parent.setRecordValue("endDate",this.parent.dateValidationModule.checkEndDate(i,a.ganttProperties),n,!0)):(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(t,n,!1),n,!0),ne.isNullOrUndefined(n.duration)||this.parent.dateValidationModule.calculateEndDate(a)),this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(a)},c.prototype.getRecord=function(e,t,i){var a,n;return ne.isNullOrUndefined(t)?(a=this.parent.editModule.taskbarEditModule.previousIds.indexOf(i.to),n=this.parent.editModule.taskbarEditModule.previousFlatData[a]):ne.isNullOrUndefined(e)&&(a=this.parent.editModule.taskbarEditModule.previousIds.indexOf(i.from),n=this.parent.editModule.taskbarEditModule.previousFlatData[a]),n},c.prototype.getValidPredecessor=function(i){var e,a=this,t=[];return ne.isNullOrUndefined(i)||(e=i.ganttProperties.predecessor)&&0<e.length&&(t=e.filter(function(e){var t="ResourceView"===a.parent.viewType?i.ganttProperties.taskId:i.ganttProperties.rowUniqueID;return e.from!==t.toString()})),t},c.prototype.compareObjects=function(t,i){var e=Object.keys(t).filter(function(e){return"offset"!==e}),a=Object.keys(i).filter(function(e){return"offset"!==e});return e.length===a.length&&e.every(function(e){return t[e]===i[e]})},c.prototype.getOffsetForPredecessor=function(e,t,i){var a=0;if((t.ganttProperties.startDate||t.ganttProperties.endDate)&&(i.ganttProperties.startDate||i.ganttProperties.endDate)){var n,r=void 0,s=void 0,o=void 0,l=void 0;switch(e.type){case"FS":r=new Date((t.ganttProperties.endDate||t.ganttProperties.startDate).getTime()),s=new Date((i.ganttProperties.startDate||i.ganttProperties.endDate).getTime());break;case"SS":r=new Date((t.ganttProperties.startDate||t.ganttProperties.endDate).getTime()),s=new Date((i.ganttProperties.startDate||i.ganttProperties.endDate).getTime());break;case"SF":r=new Date((t.ganttProperties.startDate||t.ganttProperties.endDate).getTime()),s=new Date((i.ganttProperties.endDate||i.ganttProperties.startDate).getTime());break;case"FF":r=new Date((t.ganttProperties.endDate||t.ganttProperties.startDate).getTime()),s=new Date((i.ganttProperties.endDate||i.ganttProperties.startDate).getTime())}l=r.getTime()<s.getTime()?(r=this.dateValidateModule.checkStartDate(r),s=this.dateValidateModule.checkEndDate(s,null),!1):(n=new Date(r.getTime()),r=this.dateValidateModule.checkStartDate(s),s=this.dateValidateModule.checkEndDate(n,null),!0),r.getTime()<s.getTime()&&(o=this.dateValidateModule.getDuration(r,s,e.offsetUnit,!0,!1,void 0,i.ganttProperties.calendarContext),this.parent.durationUnit===e.offsetUnit&&(t.ganttProperties.startDate&&ne.isNullOrUndefined(t.ganttProperties.endDate)||ne.isNullOrUndefined(t.ganttProperties.startDate)&&t.ganttProperties.endDate)&&--o,a=l?-o:o)}return a},c.prototype.calculateOffset=function(r,e){var i=this;if(this.parent.autoCalculateDateScheduling&&!(this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)&&r&&null!==j(r.ganttProperties)){var s=ne.extend([],r.ganttProperties.predecessor,[],!0),o=this.parent.predecessorModule.getValidPredecessor(r);if(0<o.length){this.cumulativePredecessorChanges=s;for(var l=this,t=0;t<o.length;t++)!function(t){var e=o[parseInt(t.toString(),10)],i=l.parent.connectorLineModule.getRecordByID(e.from),a=(l.parent.undoRedoModule&&l.parent.undoRedoModule.isUndoRedoPerformed&&"ProjectView"===l.parent.viewType&&0===i.ganttProperties.predecessor.filter(function(e){return e.from===o[t].from&&e.to===o[t].to}).length&&i.ganttProperties.predecessor.push(o[t]),l.getOffsetForPredecessor(e,i,r)),n=K(e,"from",s,"to"),n=(-1!==n&&(s[n].offset=a),ne.extend([],i.ganttProperties.predecessor,[],!0)),e=K(e,"from",n,"to");-1!==e&&(n[e].offset=a),l.parent.setRecordValue("predecessor",n,i.ganttProperties,!0)}(t)}else{var a=r.ganttProperties.predecessor;a&&0<a.length&&a.forEach(function(e){-1===i.validatedOffsetIds.indexOf(e.to)&&("ResourceView"===i.parent.viewType?(i.validatedOffsetIds.push(e.to),i.calculateOffset(i.parent.getRecordByID(i.parent.taskIds.indexOf("T"+e.to).toString()),!0)):i.calculateOffset(i.parent.getRecordByID(e.to),!0))})}e?this.parent.setRecordValue("predecessor",s,r.ganttProperties,!0):(0===o.length&&(this.cumulativePredecessorChanges=[]),s&&0<s.length&&this.cumulativePredecessorChanges&&0<this.cumulativePredecessorChanges.length&&(a=s.map(function(t){var e=i.cumulativePredecessorChanges.find(function(e){return i.compareObjects(e,t)});return e?Ta({},e):null}).filter(function(e){return null!==e}),this.parent.setRecordValue("predecessor",a,r.ganttProperties,!0)));e=this.parent.predecessorModule.getPredecessorStringValue(r);if(this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,e,r),this.parent.setRecordValue(this.parent.taskFields.dependency,e,r),this.parent.setRecordValue("predecessorsName",e,r.ganttProperties,!0),-1===this.validatedOffsetIds.indexOf(r.ganttProperties.taskId.toString())&&this.validatedOffsetIds.push(r.ganttProperties.taskId.toString()),r.hasChildRecords)for(t=0;t<r.childRecords.length;t++)-1===this.validatedOffsetIds.indexOf(r.childRecords[t].ganttProperties.taskId.toString())&&r.childRecords[t].ganttProperties.predecessor&&0<r.childRecords[t].ganttProperties.predecessor.length&&this.calculateOffset(r.childRecords[t]);if(r.parentItem)for(var n=r.parentItem;n;){var d=this.parent.getRecordByID(n.taskId),h=d.ganttProperties.taskId.toString();if(-1===this.validatedOffsetIds.indexOf(h)&&d.ganttProperties.predecessor&&0<d.ganttProperties.predecessor.length){this.calculateOffset(d);break}n=d.parentItem}}},c);function c(e){this.parentRecord=[],this.parentIds=[],this.parentPredecessors=[],this.validatedParentIds=[],this.storeId=[],this.isChildRecordValidated=[],this.validatedOffsetIds=[],this.predecessorsCollection=new Map,this.successorsCollection=new Map,this.parent=e,this.dateValidateModule=this.parent.dateValidationModule}g.prototype.getconnectorLineGap=function(e){return e.milestoneChild?this.parent.chartRowsModule.milestoneMarginTop/2+this.parent.chartRowsModule.milestoneHeight/2:this.parent.chartRowsModule.taskBarMarginTop/2+this.parent.chartRowsModule.taskBarHeight/2},g.prototype.initPublicProp=function(){this.lineColor=this.parent.connectorLineBackground,this.lineStroke=4<this.parent.connectorLineWidth?4:this.parent.connectorLineWidth,this.createConnectorLineTooltipTable()},g.prototype.getTaskbarMidpoint=function(e){return Math.floor(e?this.parent.chartRowsModule.milestoneMarginTop+this.parent.chartRowsModule.milestoneHeight/2:this.parent.chartRowsModule.taskBarMarginTop+this.parent.chartRowsModule.taskBarHeight/2)+1},g.prototype.createConnectorLineObject=function(t,i,e,a){void 0===a&&(a=0);var n,r,s={},o=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport?this.parent.flatData:this.expandedRecords,o=(r=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?(n=this.parent.flatData.filter(function(e){return e.ganttProperties.taskId.toString()===t.ganttProperties.taskId.toString()})[0],r=this.parent.flatData.filter(function(e){return e.ganttProperties.taskId.toString()===i.ganttProperties.taskId.toString()})[0],n=n.index,r.index):(n=o.indexOf(t),o.indexOf(i)),t.ganttProperties),l=i.ganttProperties,d=this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData:this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData):this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.currentViewData:this.parent.expandedRecords;return s.parentIndexInCurrentView=d.indexOf(t),s.childIndexInCurrentView=d.indexOf(i),!(this.parent.virtualScrollModule&&this.parent.enableVirtualization)&&(-1===s.parentIndexInCurrentView||-1===s.childIndexInCurrentView)||-1===s.parentIndexInCurrentView&&-1===s.childIndexInCurrentView||(s.parentLeft=o.isMilestone?o.left-this.parent.chartRowsModule.milestoneHeight/2:o.left,s.childLeft=l.isMilestone?l.left-this.parent.chartRowsModule.milestoneHeight/2:l.left,s.parentWidth=0===o.width||o.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):o.width,s.childWidth=0===l.width||l.isMilestone?Math.floor(this.parent.chartRowsModule.milestoneHeight):l.width,s.parentIndex=n,s.childIndex=r,0===a?(d=this.parent.ganttChartModule.getChartRows(),s.rowHeight=!ne.isNullOrUndefined(d)&&d[0]&&d[0].offsetHeight):s.rowHeight=a,s.type=e.type,n="ResourceView"===this.parent.viewType?o.taskId:o.rowUniqueID,r="ResourceView"===this.parent.viewType?l.taskId:l.rowUniqueID,s.connectorLineId="parent"+n+"child"+r,s.milestoneParent=!!o.isMilestone,s.milestoneChild=!!l.isMilestone,s.parentEndPoint=s.parentLeft+s.parentWidth,s.childEndPoint=s.childLeft+s.childWidth,ne.isNullOrUndefined(j(o)))||ne.isNullOrUndefined(j(l))?null:s},g.prototype.renderConnectorLines=function(e){var t,i=[];this.svgObject.innerHTML="";for(var a=0;a<e.length;a++)t=this.getConnectorLineTemplate(e[a]),this.svgObject.appendChild(t),i.push(e[a]);for(var n=this.parent.connectorLineModule.svgObject.childNodes,r=0;r<n.length;r++)for(var s=n[r].childNodes,o=0;o<s.length;o++){var l="Connector Line "+this.parent.connectorLineModule.generateAriaLabel(i[r]);s[o].setAttribute("aria-label",l),s[o].setAttribute("role","img")}this.parent.ganttChartModule.chartBodyContent.insertBefore(this.dependencyViewContainer,this.parent.ganttChartModule.chartBodyContent.lastChild),this.dependencyViewContainer.appendChild(this.svgObject);for(r=0;r<this.svgObject.children.length;r++)this.svgObject.children[r].children[0].setAttribute("tabindex","-1")},g.prototype.getParentPosition=function(e){if(e.parentIndex<e.childIndex){if("FF"===e.type)return e.childLeft+e.childWidth>=e.parentLeft+e.parentWidth?"FFType2":"FFType1";if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth+25){if("FS"===e.type)return"FSType1";if("SF"===e.type)return"SFType1";if("SS"===e.type)return"SSType2"}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.parentLeft>e.childLeft+e.childWidth+25&&"SF"===e.type)return"SFType2";if(e.parentLeft>e.childLeft){if("SS"===e.type)return"SSType1";if("SF"===e.type)return"SFType1"}if("FS"===e.type)return"FSType2";if("SS"===e.type)return"SSType2";if("SF"===e.type)return"SFType1"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType2";if("SS"===e.type)return"SSType2";if("SF"===e.type)return"SFType1"}}else if(e.parentIndex>e.childIndex)if(e.parentLeft<e.childLeft&&e.childLeft>e.parentLeft+e.parentWidth){if("FS"===e.type)return e.childLeft-(e.milestoneParent?e.parentLeft+e.parentWidth+4:e.parentLeft+e.parentWidth)<=30?"FSType3":"FSType4";if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}}else if(e.parentLeft<e.childLeft&&e.childLeft<e.parentLeft+e.parentWidth||e.parentLeft===e.childLeft||e.parentLeft>e.childLeft){if(e.childLeft+e.childWidth<=e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType3";if("SF"===e.type)return e.childLeft+e.childWidth+25<e.parentLeft?"SFType3":"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}else if(e.childLeft+e.childWidth>e.parentLeft+e.parentWidth){if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4";if("SS"===e.type)return e.childLeft<=e.parentLeft?"SSType3":"SSType4"}if("FS"===e.type)return"FSType3"}else if(e.parentLeft<e.childLeft){if("FS"===e.type)return"FSType3";if("SS"===e.type)return"SSType4";if("FF"===e.type)return"FFType4";if("SF"===e.type)return"SFType4"}return null},g.prototype.getHeightValue=function(){return this.parent.showOverAllocation&&this.parent.allowTaskbarOverlap,this.parentRowIndexHeight>this.childRowIndexHeight?this.parentRowIndexHeight-this.childRowIndexHeight:this.childRowIndexHeight-this.parentRowIndexHeight},g.prototype.getInnerElementWidthSSType2=function(e){return e.parentLeft===e.childLeft?10:e.childLeft-e.parentLeft},g.prototype.getInnerElementLeftSSType2=function(e){return e.parentLeft===e.childLeft?e.parentLeft-20:e.parentLeft-10},g.prototype.getInnerChildWidthSSType2=function(e){return e.parentLeft+e.parentWidth<e.childLeft?10:e.parentLeft===e.childLeft?20:e.parentLeft+e.parentWidth>=e.childLeft?10:e.childLeft-e.parentLeft},g.prototype.calculateAdjustments=function(e,t,i){var a=this.parent.renderBaseline?.45:!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")?.7:.62,a=Math.floor(this.parent.rowHeight*a);return ne.isNullOrUndefined(this.parent.taskbarHeight)&&e<=36||!ne.isNullOrUndefined(this.parent.taskbarHeight)&&this.parent.taskbarHeight<=a||!t||e<=36?{adjustY1:0,adjustX:0,adjustY2:0,adjustZ:0}:{adjustY1:(e-36)/("FSType2"===i||"FSType3"===i||"FSType4"===i||"SSType1"===i||"SSType2"===i||"SSType4"===i||"SFType2"===i?12:24),adjustX:-(e-36)/4,adjustZ:-2*(e-36)/24}},g.prototype.shouldAdjustForBaseline=function(e,t){if(!this.parent.renderBaseline||!e.milestoneParent&&!e.milestoneChild||e.milestoneParent&&e.milestoneChild)return 0;switch(t){case"FSType1":case"FSType2":return e.milestoneParent?-this.parent.chartRowsModule.milestoneMarginTop/2:this.parent.chartRowsModule.taskBarMarginTop;case"FSType3":case"FFType2":case"SFType2":case"SSType2":return e.milestoneParent?this.parent.chartRowsModule.milestoneMarginTop/2:-this.parent.chartRowsModule.taskBarMarginTop;case"FSType4":case"FFType3":case"SFType4":case"FFType4":case"SFType3":case"SFType1":return e.milestoneParent?-this.parent.chartRowsModule.milestoneMarginTop/2:this.parent.chartRowsModule.taskBarMarginTop;case"SSType3":case"SSType4":return e.milestoneParent?-this.parent.chartRowsModule.taskBarMarginTop:this.parent.chartRowsModule.taskBarMarginTop;case"SSType1":case"FFType1":return e.milestoneParent?this.parent.chartRowsModule.taskBarMarginTop:-this.parent.chartRowsModule.milestoneMarginTop/2;default:return 0}},g.prototype.updateParentChildRowsHeight=function(e){var t=this.parent.currentViewData.length-1,i=this.parent.ganttChartModule.getChartRows(),a=(this.parentRowIndexHeight=e.parentIndexInCurrentView*e.rowHeight,this.childRowIndexHeight=e.childIndexInCurrentView*e.rowHeight,this.lastRowIndexHeight=t*e.rowHeight,0);if(!this.parent.allowTaskbarOverlap&&this.parent.enableMultiTaskbar)for(var n=this.parentRowIndexHeight=this.childRowIndexHeight=this.lastRowIndexHeight=0;n<t;n++){var r=i[n];r&&"none"!==r.style.display&&(a<e.parentIndexInCurrentView&&(this.parentRowIndexHeight+=i[n].offsetHeight),a<e.childIndexInCurrentView&&(this.childRowIndexHeight+=i[n].offsetHeight),this.lastRowIndexHeight+=i[n].offsetHeight,a++)}},g.prototype.getConnectorLineTemplate=function(e){var t=this.getInnerChildWidthSSType2(e),i=this.getInnerElementWidthSSType2(e),a=this.getInnerElementLeftSSType2(e),n=(this.updateParentChildRowsHeight(e),this.getHeightValue()),r=!!e.milestoneChild,s=this.getPosition(e,this.getParentPosition(e),n),n=this.getPosition(e,this.getParentPosition(e),n).top,s=(this.parent.renderBaseline&&(this.parent.rowHeight,e.milestoneParent&&e.milestoneChild||(e.milestoneParent||e.milestoneChild)),s.height),o=0,l=0,d=0,h=0;if(this.parent.showOverAllocation&&!this.parent.allowTaskbarOverlap){for(var p=0;p<this.parent.currentViewData.length;p++)"none"!==this.parent.getRowByIndex(p).style.display&&h<e.parentIndex&&(h++,this.parent.getRowByIndex(p).offsetHeight);for(var h=0,u=0;u<this.parent.currentViewData.length;u++)"none"!==this.parent.getRowByIndex(u).style.display&&h<e.childIndex&&(h++,d+=this.parent.getRowByIndex(u).offsetHeight)}var c,g,f,m,y=this.parent.connectorLineModule.expandedRecords,D=(y[e.parentIndex]&&y[e.childIndex]&&this.parent.allowParentDependency&&(D=y[e.parentIndex].hasChildRecords,c=y[e.childIndex].hasChildRecords,g=y[e.parentIndex].ganttProperties.isAutoSchedule,y=y[e.childIndex].ganttProperties.isAutoSchedule,!(D&&g&&!c||c&&y&&!D||D&&g&&y&&c||!D&&!c))&&(D&&!g&&c&&!y?l=-11:e.childIndex>e.parentIndex?!D&&c?o=-11:l=-(o=11):D&&!c?o=-11:l=-(o=11),this.parent.currentViewData[e.parentIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(l=-11,o=12):"SS"!==e.type&&"FF"!==e.type||(l=-5):this.parent.currentViewData[e.childIndex].ganttProperties.isMilestone?e.parentIndex>e.childIndex?(l=5,o=-10):e.parentIndex<e.childIndex&&("SS"!==e.type&&"FF"!==e.type||(l=-10)):(e.parentIndex<e.childIndex&&g&&!y||e.childIndex<e.parentIndex&&!g&&y)&&(l=0,o=-11),n+=l),this.getParentPosition(e));return D&&(c=this.getParentPosition(e),g=this.parent.rowHeight,y=this.calculateAdjustments(g,r,c),this.transform=this.parent.enableRtl?"translate("+(this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth)+", 0) scale(-1, 1)":"",this.connectorId="ConnectorLine"+e.connectorLineId,this.groupObject=this.renderer.createGroup({id:this.connectorId,transform:this.transform,style:"pointer-events: stroke",class:rt}),this.connectorPath=this.renderer.drawPath({class:st,d:this.connectorLinePath,fill:"transparent","stroke-width":this.lineStroke}),this.arrowlinePath=this.renderer.drawPath({d:this.arrowPath,class:dt}),l=this.lineColor&&!this.parent.enableCriticalPath?this.lineColor:"",this.connectorPath.style.stroke=l,this.arrowlinePath.style.fill=l,this.groupObject.appendChild(this.connectorPath),this.groupObject.appendChild(this.arrowlinePath),g=this.shouldAdjustForBaseline(e,D),"FSType1"===D&&(this.taskLineValue=e.milestoneChild?1:0,this.x1=e.parentEndPoint+(e.milestoneParent||e.milestoneChild?-1:0),this.x2=e.milestoneParent?e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10+1:e.childLeft-(e.parentLeft+e.parentWidth+10)+this.lineStroke-10,this.y1=n,this.y2=s+this.taskLineValue+o-this.lineStroke,this.connectorLinePath="M "+this.x1+" "+(this.y1-g)+" L "+(this.x1+this.x2+y.adjustZ)+" "+(this.y1-g)+" L "+(this.x1+this.x2+y.adjustZ)+" "+(this.y1+this.y2+y.adjustY1)+" L "+(this.x1+this.x2+12+y.adjustX)+" "+(this.y1+this.y2+y.adjustY1),this.arrowPath="M "+(this.x1+this.x2+20+y.adjustX)+" "+(this.y1+this.y2+y.adjustY1)+" L "+(this.x1+this.x2+12+y.adjustX)+" "+(this.y1+this.y2-(4+this.lineStroke)+y.adjustY1)+" L "+(this.x1+this.x2+12+y.adjustX)+" "+(this.y1+this.y2+4+y.adjustY1)+" Z"),"FSType2"===D&&(this.x1=e.parentLeft,this.x2=e.parentWidth+(e.milestoneParent?-1:0),this.x3=this.x2+(e.milestoneParent?11:10),this.x4=e.parentWidth-(e.parentEndPoint-e.childLeft+20),this.y1=n,this.y2=s+o-this.getconnectorLineGap(e)-this.lineStroke,this.y3=this.getconnectorLineGap(e),this.y4=this.parent.allowTaskbarOverlap?this.y1+this.y2-(this.y1+this.y2)%e.rowHeight:d,this.connectorLinePath="M "+(this.x1+this.x2)+" "+(this.y1-g)+" L "+(this.x1+this.x3)+" "+(this.y1-g)+" L "+(this.x1+this.x3)+" "+this.y4+" L "+(this.x1+this.x4+y.adjustZ)+" "+this.y4+" L "+(this.x1+this.x4+y.adjustZ)+" "+(this.y1+this.y2+this.y3+y.adjustY1)+" L "+(this.x1+this.x4+12+y.adjustX)+" "+(this.y1+this.y2+this.y3+y.adjustY1),this.arrowPath="M "+(this.x1+this.x4+20+y.adjustX)+" "+(this.y1+this.y2+this.y3+y.adjustY1)+" L "+(this.x1+this.x4+12+y.adjustX)+" "+(this.y1+this.y2+this.y3-(4+this.lineStroke)+y.adjustY1)+" L "+(this.x1+this.x4+12+y.adjustX)+" "+(this.y1+this.y2+this.y3+4+this.lineStroke+y.adjustY1)+" Z"),"FSType3"===D&&(this.taskLineValue=e.milestoneChild?1:0,this.point1=n,this.x1=e.childLeft+(e.milestoneChild?-1:0)+(e.milestoneParent?1:0)-20,this.x2=e.parentEndPoint-e.childLeft+30,this.y1=this.point1,this.y2=this.point1+s+o-this.getconnectorLineGap(e)-this.lineStroke+this.taskLineValue,this.y3=this.getconnectorLineGap(e),this.y4=this.y2-this.y2%e.rowHeight,this.connectorLinePath="M "+(this.x1+12)+" "+(this.y1-g+y.adjustY1)+" L "+this.x1+" "+(this.y1-g+y.adjustY1)+" L "+this.x1+" "+this.y4+" L "+(this.x1+this.x2)+" "+this.y4+" L "+(this.x1+this.x2)+" "+(this.y2+this.y3)+" L "+(this.x1+this.x2-12)+" "+(this.y2+this.y3),this.arrowPath="M "+(this.x1+20+y.adjustX)+" "+(this.y1-g+y.adjustY1)+" L "+(this.x1+12+y.adjustX)+" "+(this.y1-(4+this.lineStroke)-g+y.adjustY1)+" L "+(this.x1+12+y.adjustX)+" "+(this.y1+4+this.lineStroke-g+y.adjustY1)+" Z"),"FSType4"===D&&(this.point1=n,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.parentEndPoint+(e.milestoneChild?-1:0)+(e.milestoneParent?1:0),this.x2=e.childLeft-e.parentEndPoint-20,this.y1=this.point1+(e.milestoneChild?-1:0),this.y2=this.point1+s+o-this.lineStroke+1+this.taskLineValue,this.connectorLinePath="M "+(this.x1+this.x2+12)+" "+(this.y1+y.adjustY1)+" L "+(this.x1+this.x2)+" "+(this.y1+y.adjustY1)+" L "+(this.x1+this.x2)+" "+(this.y2-g)+" L "+this.x1+" "+(this.y2-g),this.arrowPath="M "+(this.x1+this.x2+20+y.adjustX)+" "+(this.y1+y.adjustY1)+" L "+(this.x1+this.x2+12+y.adjustX)+" "+(this.y1-(4+this.lineStroke)+y.adjustY1)+" L "+(this.x1+this.x2+12+y.adjustX)+" "+(this.y1+4+this.lineStroke+y.adjustY1)+" Z"),"SSType4"===D&&(f=0!==y.adjustX?y.adjustX+2:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.point1=s+this.taskLineValue+o,this.x1=e.parentLeft-10,this.x2=e.childLeft-e.parentLeft,this.y1=n,this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+this.x2+f)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+(this.y2-g)+" L "+(this.x1+10)+" "+(this.y2-g),this.arrowPath="M "+(this.x1+this.x2+8+f)+" "+this.y1+" L "+(this.x1+this.x2+f)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+this.x2+f)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType3"===D&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=s+this.taskLineValue+o-(this.lineStroke-1),this.x1=e.childLeft-20,this.y1=n,this.x2=e.parentLeft-e.childLeft+21,this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+12+y.adjustX)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+(this.y2-g)+" L "+(this.x1+this.x2)+" "+(this.y2-g),this.arrowPath="M "+(this.x1+20+y.adjustX)+" "+this.y1+" L "+(this.x1+12+y.adjustX)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+12+y.adjustX)+" "+(this.y1+4+this.lineStroke)+" Z"),"SSType2"===D&&(f=0!==y.adjustX?y.adjustX+2:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=s+this.taskLineValue+o-this.lineStroke,this.x1=a,this.x2=t+1,this.y1=n,this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+(this.y2+y.adjustY1-g)+" L "+(this.x1+i+f)+" "+(this.y2+y.adjustY1-g),this.arrowPath="M "+(this.x1+i+8+f)+" "+(this.y2+y.adjustY1-g)+" L "+(this.x1+i+f)+" "+(this.y2-(4+this.lineStroke)+y.adjustY1-g)+" L "+(this.x1+i+f)+" "+(this.y2+4+this.lineStroke+y.adjustY1-g)+" Z"),"SSType1"===D&&(this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=s+this.taskLineValue+o-this.lineStroke,this.x1=e.childLeft-20,this.x2=e.parentLeft-e.childLeft+21,this.y1=n,this.y2=this.y1+this.point1,this.connectorLinePath="M "+(this.x1+this.x2)+" "+this.y1+" L "+this.x1+" "+this.y1+" L "+this.x1+" "+(this.y2+y.adjustY1-g)+" L "+(this.x1+12+y.adjustX)+" "+(this.y2+y.adjustY1-g),this.arrowPath="M "+(this.x1+20+y.adjustX)+" "+(this.y2+y.adjustY1-g)+" L "+(this.x1+12+y.adjustX)+" "+(this.y2-(4+this.lineStroke)+y.adjustY1-g)+" L "+(this.x1+12+y.adjustX)+" "+(this.y2+4+this.lineStroke+y.adjustY1-g)+" Z"),"FFType1"===D&&(f=0!==y.adjustX?y.adjustX+11:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.x1=e.childEndPoint,this.x2=e.parentEndPoint+(e.milestoneParent?-1:0),this.x3=e.milestoneParent?22:21,this.x4=e.milestoneChild?4:8,this.y1=n,this.y2=s+this.taskLineValue+o-this.lineStroke+1,m=this.parent.renderBaseline?0:f,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+(this.x2+this.x3)+" "+this.y1+" L "+(this.x2+this.x3)+" "+(this.y1+this.y2+y.adjustY1-g)+" L "+(this.x1+this.x4)+" "+(this.y1+this.y2+y.adjustY1-g),this.arrowPath="M "+(this.x1+m)+" "+(this.y1+this.y2+y.adjustY1-g)+" L "+(this.x1+8+m)+" "+(this.y1+this.y2-(4+this.lineStroke)+y.adjustY1-g)+" L "+(this.x1+8+m)+" "+(this.y1+this.y2+4+this.lineStroke+y.adjustY1-g)+" Z"),"FFType2"===D&&(f=0!==y.adjustX?y.adjustX+11:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.x1=e.parentEndPoint,this.x2=e.childEndPoint+(e.milestoneParent?22:21),this.x3=e.childEndPoint+(e.milestoneChild?9:8),this.y1=n,this.y2=s+this.taskLineValue+o-this.lineStroke+1,m=this.parent.renderBaseline?0:f,this.connectorLinePath="M "+this.x1+" "+this.y1+" L "+this.x2+" "+this.y1+" L "+this.x2+" "+(this.y1+this.y2+y.adjustY1-g)+" L "+this.x3+" "+(this.y1+this.y2+y.adjustY1-g),this.arrowPath="M "+(this.x3-8+m)+" "+(this.y1+this.y2+y.adjustY1-g)+" L "+(this.x3+m)+" "+(this.y1+this.y2-(4+this.lineStroke)+y.adjustY1-g)+" L "+(this.x3+m)+" "+(this.y1+this.y2+4+this.lineStroke+y.adjustY1-g)+" Z"),"FFType3"===D&&(f=0!==y.adjustX?y.adjustX+11:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.childEndPoint,this.x2=this.x1+(e.milestoneChild?4:8),this.x3=e.parentEndPoint-e.childEndPoint+(e.milestoneChild?16:10),this.x4=e.parentEndPoint+(e.milestoneParent?-1:0),this.y1=n,this.y2=s+this.taskLineValue+o-this.lineStroke+1,m=this.parent.renderBaseline?0:f,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+(this.x2+this.x3)+" "+this.y1+" L "+(this.x2+this.x3)+" "+(this.y1+this.y2-g)+" L "+this.x4+" "+(this.y1+this.y2-g),this.arrowPath="M "+(this.x1+m)+" "+this.y1+" L "+(this.x1+8+m)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x1+8+m)+" "+(this.y1+4+this.lineStroke)+" Z"),"FFType4"===D&&(f=0!==y.adjustX?y.adjustX+11:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.parentEndPoint,this.x2=e.childEndPoint+(e.milestoneChild?7:8),this.x3=this.x2+(e.milestoneChild?12:11),this.y1=n,this.y2=s+this.taskLineValue+o-this.lineStroke+1,m=this.parent.renderBaseline?0:f,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+(this.y1+this.y2-g)+" L "+this.x1+" "+(this.y1+this.y2-g),this.arrowPath="M "+(this.x2-8+m)+" "+this.y1+" L "+(this.x2+m)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x2+m)+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType4"===D&&(f=0!==y.adjustX?y.adjustX+11:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?-1:0,this.point1=this.taskLineValue+s+o-this.getconnectorLineGap(e)-(this.lineStroke-1),this.point2=n,this.x1=e.parentLeft-10,this.x2=this.x1+(e.childEndPoint-e.parentLeft+18),this.x3=this.x2+(e.milestoneChild?16:11),this.y1=this.point2,this.y2=this.y1+this.point1,this.y3=this.getconnectorLineGap(e),this.y4=this.y2-this.y2%e.rowHeight,m=this.parent.renderBaseline?0:f,this.connectorLinePath="M "+this.x2+" "+(this.y1-y.adjustY1)+" L "+this.x3+" "+(this.y1-y.adjustY1)+" L "+this.x3+" "+this.y4+" L "+this.x1+" "+this.y4+" L "+this.x1+" "+(this.y2+this.y3-g)+" L "+(this.x1+11)+" "+(this.y2+this.y3-g),this.arrowPath="M "+(this.x2-8+m)+" "+(this.y1-y.adjustY1)+" L "+(this.x2+m)+" "+(this.y1-(4+this.lineStroke)-y.adjustY1)+" L "+(this.x2+m)+" "+(this.y1+4+this.lineStroke-y.adjustY1)+" Z"),"SFType3"===D&&(f=0!==y.adjustX?y.adjustX+11:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.point1=e.parentLeft-(e.childEndPoint+(e.milestoneParent?23:20))+1,this.point2=n,this.x1=e.childEndPoint,this.x2=this.x1+(e.milestoneChild?9:8),this.x3=this.x2+(e.milestoneChild?17:11),this.y1=this.point2,this.y2=this.y1+s+o-(this.lineStroke-1)+this.taskLineValue,m=this.parent.renderBaseline?0:f,this.connectorLinePath="M "+this.x2+" "+this.y1+" L "+this.x3+" "+this.y1+" L "+this.x3+" "+(this.y2-g)+" L "+(this.x3+this.point1)+" "+(this.y2-g),this.arrowPath="M "+(this.x2-8+m)+" "+this.y1+" L "+(this.x2+m)+" "+(this.y1-(4+this.lineStroke))+" L "+(this.x2+m)+" "+(this.y1+4+this.lineStroke)+" Z"),"SFType1"===D&&(f=0!==y.adjustX?y.adjustX+11:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:e.milestoneChild?1:0,this.point1=s+o-this.getconnectorLineGap(e)+this.taskLineValue-this.lineStroke,this.point2=this.getconnectorLineGap(e),this.x1=e.parentLeft-10,this.y1=n,this.x2=e.childEndPoint-e.parentLeft+31,this.y2=this.y1+this.point1,this.x3=e.childEndPoint-e.parentLeft+18,this.y3=this.y2-this.y2%e.rowHeight,m=this.parent.renderBaseline?0:f,this.connectorLinePath="M "+(this.x1+11)+" "+(this.y1-g)+" L "+this.x1+" "+(this.y1-g)+" L "+this.x1+" "+this.y3+" L "+(this.x1+this.x2)+" "+this.y3+" L "+(this.x1+this.x2)+" "+(this.y2+this.point2+y.adjustY1)+" L "+(this.x1+this.x3)+" "+(this.y2+this.point2+y.adjustY1),this.arrowPath="M "+(this.x1+this.x3-8+m)+" "+(this.y2+this.point2+y.adjustY1)+" L "+(this.x1+this.x3+m)+" "+(this.y2+this.point2-(4+this.lineStroke)+y.adjustY1)+" L "+(this.x1+this.x3+m)+" "+(this.y2+this.point2+4+this.lineStroke+y.adjustY1)+" Z"),"SFType2"===D&&(f=0!==y.adjustX?y.adjustX+11:y.adjustX,this.taskLineValue=this.parent.renderBaseline?this.taskLineValue:0,this.x1=e.childEndPoint,this.y1=n,this.x2=e.parentLeft-e.childEndPoint,this.y2=this.y1+s+this.taskLineValue+o-this.lineStroke,m=this.parent.renderBaseline?0:f,this.connectorLinePath="M "+(this.x1+this.x2+1)+" "+this.y1+" L "+(this.x1+this.x2-10)+" "+this.y1+" L "+(this.x1+this.x2-10)+" "+(this.y2+y.adjustY1-g)+" L "+(this.x1+8)+" "+(this.y2+y.adjustY1-g),this.arrowPath="M "+(this.x1+m)+" "+(this.y2+y.adjustY1-g)+" L "+(this.x1+8+m)+" "+(this.y2-(4+this.lineStroke)+y.adjustY1-g)+" L "+(this.x1+8+m)+" "+(this.y2+4+this.lineStroke+y.adjustY1-g)+" Z"),this.connectorPath.setAttribute("d",this.connectorLinePath),this.arrowlinePath.setAttribute("d",this.arrowPath)),this.groupObject},g.prototype.getPosition=function(e,t,i){var a=0,n=0,r=!!e.milestoneParent,s=!!e.milestoneChild,r=this.getTaskbarMidpoint(r)-(this.lineStroke-1),s=this.getTaskbarMidpoint(s)-(this.lineStroke-1),o=-1!==e.parentIndexInCurrentView,e=-1!==e.childIndexInCurrentView;return"SSType1"===t||"SSType2"===t||"FFType1"===t||"FFType2"===t||"SFType2"===t?(a=o?this.parentRowIndexHeight+r:0,n=o&&e?i:e?this.childRowIndexHeight+r:this.lastRowIndexHeight+r):"SSType3"===t||"SSType4"===t||"FSType4"===t||"FFType3"===t||"FFType4"===t||"SFType4"===t||"SFType3"===t?(a=e?this.childRowIndexHeight+s:0,n=o&&e?i:o?this.parentRowIndexHeight+s:this.lastRowIndexHeight+s):"FSType3"===t?(a=e?this.childRowIndexHeight+r:0,n=o&&e?i:o?this.parentRowIndexHeight+s:this.lastRowIndexHeight+r):"SFType1"!==t&&"FSType1"!==t&&"FSType2"!==t||(a=o?this.parentRowIndexHeight+s:0,n=o&&e?i:e?this.childRowIndexHeight+s:this.lastRowIndexHeight+s),{top:a,height:n}},g.prototype.createConnectorLineTooltipTable=function(){this.tooltipTable=ne.createElement("table",{className:".e-tooltiptable",styles:"margin-top:0px",attrs:{cellspacing:"2px",cellpadding:"2px"}});var e=ne.createElement("tbody");e.innerHTML="",this.tooltipTable.appendChild(e)},g.prototype.getConnectorLineTooltipInnerTd=function(e,t,i,a){function n(e,t,i,a){var n=document.createElement("tr");return n.id=e,(e=document.createElement("td")).style.padding="2px",e.textContent=r.parent.localeObj.getConstant(t),(t=document.createElement("td")).textContent=i,(i=document.createElement("td")).style.padding="2px",i.textContent=r.parent.localeObj.getConstant(a),n.append(e,t,i),n}var r=this,s=document.createElement("tbody");return s.appendChild(n("fromPredecessor","from",e,t)),s.appendChild(n("toPredecessor","to",i||"",a||"")),s},g.prototype.generateAriaLabel=function(e){var t=e.type,i=this.expandedRecords,a=i[e.parentIndex].ganttProperties.taskName,i=i[e.childIndex].ganttProperties.taskName,e=this.parent.localeObj.getConstant("start"),n=this.parent.localeObj.getConstant("finish");return"FS"===t?a+" "+n+" to "+i+" "+e:"FF"===t?a+" "+n+" to "+i+" "+n:"SS"===t?a+" "+e+" to "+i+" "+e:a+" "+e+" to "+i+" "+n},g.prototype.getRecordByID=function(t){return ne.isNullOrUndefined(t)?null:this.parent.pdfExportModule&&this.parent.pdfExportModule.isPdfExport&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth?this.parent.pdfExportModule.helper.beforeSinglePageExport.cloneFlatData.filter(function(e){return e.ganttProperties.taskId.toString()===t.toString()})[0]:"ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf("T"+t.toString())]:this.parent.getRecordByID(t)},g.prototype.removePreviousConnectorLines=function(e){for(var t=ne.isObject(e),i=Object.keys(e),a=0;a<i.length;a++){var n=(t?e[i[a]]:e[a]).ganttProperties,n=n&&n.predecessor;if(n&&0<n.length)for(var r=0,s=n;r<s.length;r++){var o=s[r],o="parent"+o.from+"child"+o.to;this.removeConnectorLineById(o)}}},g.prototype.removeConnectorLineById=function(e){e=this.parent.connectorLineModule.dependencyViewContainer.querySelector("#ConnectorLine"+e.replace(/([.])/g,"\\$1"));ne.isNullOrUndefined(e)||ne.remove(e)};var wa=g;function g(e){this.transform="",this.connectorLinePath="",this.arrowPath="",this.taskLineValue=0,this.expandedRecords=[],this.parent=e,this.dependencyViewContainer=ne.createElement("div",{className:"e-gantt-dependency-view-container"}),Object.assign(this.dependencyViewContainer.style,{width:"100%",height:"100%",zIndex:2,position:"absolute",pointerEvents:"none"}),this.renderer=new N.SvgRenderer(this.parent.element.id),this.initPublicProp(),this.svgObject=this.renderer.createSvg({id:this.parent.element.id+"_svg"}),this.svgObject.setAttribute("height","100%"),this.svgObject.setAttribute("width","100%")}Sa.prototype.renderSplitter=function(){var n=this,e=this.calculateSplitterPosition(this.parent.splitterSettings),t=(this.parent.splitterElement=ne.createElement("div",{className:"e-gantt-splitter"}),this.parent.treeGridPane=ne.createElement("div",{className:"e-gantt-tree-grid-pane"}),this.parent.chartPane=ne.createElement("div",{className:he}),ne.addClass([this.parent.chartPane],"e-droppable"),this.parent.enableRtl?(this.parent.splitterElement.appendChild(this.parent.chartPane),this.parent.splitterElement.appendChild(this.parent.treeGridPane)):(this.parent.splitterElement.appendChild(this.parent.treeGridPane),this.parent.splitterElement.appendChild(this.parent.chartPane)),this.splitterObject=new L.Splitter({height:null,width:this.parent.ganttWidth.toString(),enableRtl:this.parent.enableRtl,separatorSize:this.parent.splitterSettings.separatorSize,paneSettings:[{resizable:!0,size:e,min:this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum)},{resizable:!0}],orientation:"Horizontal",resizeStart:function(e){n.parent.contextMenuModule&&n.parent.contextMenuModule.isOpen&&n.parent.contextMenuModule.contextMenu.close();var t=e.pane[0],i=e.pane[1],a=(n.splitterPreviousPositionGrid=t.scrollWidth+1+"px",n.splitterPreviousPositionChart=i.scrollWidth+1+"px",new U.Deferred);return n.parent.trigger("splitterResizeStart",e,function(e){a.resolve(e)}),a},resizing:function(e){n.parent.trigger("splitterResizing",e),n.parent.timelineModule.isZoomToFit&&n.parent.timelineModule.updateTimelineAfterZooming(n.parent.timelineModule.timelineEndDate,!0)},resizeStop:function(e){n.parent.calculateDimensions(),n.isSplitterResized=!0;var t=e.pane[0],i=(n.splitterPreviousPositionGrid=t.scrollWidth+1+"px",n.splitterObject.paneSettings[0].size=n.getSpliterPositionInPercentage(n.splitterPreviousPositionGrid),n.parent.splitterSettings.position=n.splitterObject.paneSettings[0].size,new U.Deferred);return n.parent.trigger("splitterResized",e,function(e){!0===e.cancel&&(n.splitterObject.paneSettings[0].size=null,n.splitterObject.paneSettings[0].size=n.getSpliterPositionInPercentage(n.splitterPreviousPositionGrid),n.parent.splitterSettings.position=n.splitterObject.paneSettings[0].size,n.splitterObject.paneSettings[1].size=null,n.splitterObject.paneSettings[1].size=n.getSpliterPositionInPercentage(n.splitterPreviousPositionChart)),"auto"===n.parent.timelineSettings.viewEndDate&&n.parent.timelineModule.updateTimelineAfterZooming(n.parent.timelineModule.timelineEndDate,!0),i.resolve(e)}),i}}),this.parent.element.appendChild(this.parent.splitterElement),this.splitterObject.appendTo(this.parent.splitterElement),this.splitterObject.element.querySelector(".e-split-bar"));t&&(e=parseFloat(e.replace("%","")),e=Math.min(100,Math.max(0,e)),t.setAttribute("aria-valuenow",e.toString())),this.parent.allowKeyboard||(t=this.parent.splitterElement.querySelector(".e-split-bar"))&&(t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"))},Sa.prototype.calculateSplitterPosition=function(e){var t;return!ne.isNullOrUndefined(this.splitterObject)&&this.parent.enablePersistence?this.splitterObject.paneSettings[0].size:"Grid"===e.view?this.parent.enableRtl?"0%":"100%":"Chart"===e.view?this.parent.enableRtl?"100%":"0%":!ne.isNullOrUndefined(this.parent.splitterUpdateType)&&"position"!==this.parent.splitterUpdateType||ne.isNullOrUndefined(e.position)||""===e.position?(ne.isNullOrUndefined(this.parent.splitterUpdateType)||"columnIndex"===this.parent.splitterUpdateType)&&!ne.isNullOrUndefined(e.columnIndex)&&0<=e.columnIndex?150*e.columnIndex<this.parent.ganttWidth||!this.parent.element.classList.contains("e-device")?this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(e.columnIndex).toString()+"px"):this.getSpliterPositionInPercentage(130*e.columnIndex+"px"):(t=this.parent.ganttWidth,this.parent.enableRtl?this.getSpliterPositionInPercentage(t-250+"px"):this.getSpliterPositionInPercentage("250px")):this.getSpliterPositionInPercentage(e.position)},Sa.prototype.getSpliterPositionInPercentage=function(e){var t,i=ne.isNullOrUndefined(e)||""===e?null:e;return i=ne.isNullOrUndefined(i)?i:-1!==e.indexOf("px")?(t=parseInt(e,10))/this.parent.ganttWidth*100<=100?t/this.parent.ganttWidth*100+"%":"25%":this.parent.enableRtl?100-parseFloat(e)+"%":-1===e.indexOf("%")?e+"%":e},Sa.prototype.getTotalColumnWidthByIndex=function(e){var t=0,i=this.parent.ganttWidth,a=this.parent.ganttColumns.filter(function(e){return void 0===e.visible||!0===e.visible}).map(function(e){return Object.assign({},e)});if(e=a.length>e?e:a.length,this.parent.enableRtl){for(var n=0;n<e;n++)t+=parseInt(a[n].width,10);t=i-t}else for(n=0;n<e;n++)t+=parseInt(a[n].width,10);return t},Sa.prototype.updateSplitterPosition=function(){this.splitterObject.separatorSize=this.parent.splitterSettings.separatorSize;var e=this.calculateSplitterPosition(this.parent.splitterSettings);this.splitterObject.paneSettings[0].min=this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum),this.splitterObject.dataBind(),this.isSplitterResized||(this.splitterObject.paneSettings[0].size=e),this.isSplitterResized=!1,"auto"===this.parent.timelineSettings.viewEndDate&&this.parent.timelineModule.updateTimelineAfterZooming(this.parent.timelineModule.timelineEndDate,!0)},Sa.prototype.triggerCustomResizedEvent=function(){var e=this.splitterObject.element.querySelectorAll(".e-pane")[0],t=this.splitterObject.element.querySelectorAll(".e-pane")[1],e={event:null,element:this.splitterObject.element,pane:[e,t],index:[0,1],separator:this.splitterObject.element.querySelector(".e-split-bar"),paneSize:[e.offsetWidth,t.offsetWidth]};this.parent.trigger("splitterResized",e),!0===e.cancel&&(this.splitterObject.paneSettings[0].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionGrid),this.splitterObject.paneSettings[1].size=this.getSpliterPositionInPercentage(this.splitterPreviousPositionChart))},Sa.prototype.destroy=function(){this.splitterObject.destroy(),this.parent.off("destroy",this.destroy)};var va=Sa;function Sa(e){this.isSplitterResized=!1,this.parent=e,this.parent.on("destroy",this.destroy,this)}Ca.prototype.createTooltip=function(){this.toolTipObj=new E.Tooltip,this.toolTipObj.target=".e-header-cell-label, .e-gantt-child-taskbar,.e-gantt-parent-taskbar, .e-gantt-milestone, .e-gantt-unscheduled-taskbar.e-event-markers, .e-baseline-bar, .e-event-markers,.e-connector-line-container, .e-indicator-span, .e-notes-info, .e-gantt-manualparent-milestone,.e-taskbar-left-resizer, .e-taskbar-right-resizer, .e-baseline-gantt-milestone-container, .e-gantt-manualparenttaskbar",this.toolTipObj.position="BottomCenter",this.toolTipObj.openDelay=700,this.toolTipObj.enableRtl=this.parent.enableRtl,this.toolTipObj.enableHtmlSanitizer=this.parent.enableHtmlSanitizer,this.toolTipObj.cssClass=yt,this.toolTipObj.animation={open:{effect:"None",delay:0},close:{effect:"None",delay:0}},this.toolTipObj.afterOpen=this.updateTooltipPosition.bind(this),this.toolTipObj.showTipPointer=!1,this.toolTipObj.beforeRender=this.tooltipBeforeRender.bind(this),this.toolTipObj.afterClose=this.tooltipCloseHandler.bind(this),this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.element)},Ca.prototype.tooltipBeforeRender=function(t){var e=this.parent;if(e.isOnEdit)t.cancel=!0;else{var i,a,n,r,s,o,l=ne.closest(t.target,"div."+ve),l=(ne.isNullOrUndefined(l)?(r=S(t.target,Ee),(t.target.classList.contains(Oe)||t.target.classList.contains(Ie))&&(r=r.querySelector(".e-taskbar-main-container"))):r=t.target,{data:{},args:t,cancel:!1,content:""});if(t.target.classList.contains("e-header-cell-label")?e.timelineSettings.showTooltip?(a=t.target.getAttribute("data-tier"),n=t.target.title,s=ne.isNullOrUndefined(e.timelineTemplate)?t.target.textContent:t.target.getAttribute("value"),n=e.tooltipSettings.timeline?e.tooltipModule.templateCompiler(e.tooltipSettings.timeline,e,ne.extend({},{date:n,value:s,tier:a}),"TooltipTaskbarTemplate"):null,s=document.createElement("div"),n?(ne.append(n,s),l.content=this.toolTipObj.content=s):l.content=this.toolTipObj.content=e.tooltipModule.getTooltipContent("timeline",i,e,t)):t.cancel=!0:e.tooltipSettings.showTooltip?(r&&(l.data=e.ganttChartModule.getRecordByTaskBar(r),i=l.data),t.target.classList.contains("e-gantt-child-taskbar")||t.target.classList.contains("e-gantt-parent-taskbar")||t.target.classList.contains("e-gantt-milestone")||t.target.classList.contains("e-gantt-unscheduled-taskbar")||t.target.classList.contains("e-taskbar-left-resizer")||t.target.classList.contains("e-taskbar-right-resizer")||t.target.classList.contains("e-gantt-manualparenttaskbar")&&e.tooltipSettings.taskbar?(a=void 0,e.tooltipSettings.taskbar&&(a=e.tooltipModule.templateCompiler(e.tooltipSettings.taskbar,e,i,"TooltipTaskbarTemplate")),s=document.createElement("div"),a&&ne.append(a,s),l.content=this.toolTipObj.content=a?s:i?e.tooltipModule.getTooltipContent(i.ganttProperties.isMilestone?"milestone":"taskbar",i,e,t):""):t.target.classList.contains("e-baseline-bar")||t.target.classList.contains("e-baseline-gantt-milestone-container")?(n=void 0,e.tooltipSettings.baseline&&(n=e.tooltipModule.templateCompiler(e.tooltipSettings.baseline,e,i,"TooltipBaselineTemplate")),r=document.createElement("div"),n&&ne.append(n,r),l.content=this.toolTipObj.content=n?r:i?e.tooltipModule.getTooltipContent(i.ganttProperties.isMilestone?"milestone":"baseline",i,e,t):""):t.target.classList.contains("e-event-markers")?l.content=this.toolTipObj.content=e.tooltipModule.getTooltipContent("marker",i,e,t):t.target.classList.contains("e-connector-line-container")?(a=void 0,e.tooltipModule.predecessorTooltipData=e.tooltipModule.getPredecessorTooltipData(t),l.data=this.predecessorTooltipData,e.tooltipSettings.connectorLine&&(a=e.tooltipModule.templateCompiler(e.tooltipSettings.connectorLine,e,e.tooltipModule.predecessorTooltipData,"TooltipConnectorLineTemplate")),l.content=this.toolTipObj.content=a?a[0]:e.tooltipModule.getTooltipContent("connectorLine",i,e,t)):t.target.classList.contains("e-indicator-span")?(l.content=this.toolTipObj.content=e.tooltipModule.getTooltipContent("indicator",i,e,t),ne.isNullOrUndefined(l.content)&&(t.cancel=!0)):t.target.classList.contains("e-notes-info")?(n=this.parent.ganttChartModule.getRecordByTarget(t.event),l.content=this.toolTipObj.content=n.ganttProperties.notes,ne.isNullOrUndefined(l.content)&&(t.cancel=!0)):t.target.classList.contains("e-gantt-manualparenttaskbar")?(l.content=this.toolTipObj.content=e.tooltipModule.getTooltipContent("manualtaskbar",i,e,t),ne.isNullOrUndefined(l.content)&&(t.cancel=!0)):t.target.classList.contains("e-gantt-manualparent-milestone")&&(r=void 0,e.tooltipSettings.taskbar&&(r=e.tooltipModule.templateCompiler(e.tooltipSettings.taskbar,e,i,"TooltipTaskbarTemplate")),s=document.createElement("div"),r&&ne.append(r,s),l.content=this.toolTipObj.content=r?s:i?e.tooltipModule.getTooltipContent("manualmilestone",i,e,t):"",ne.isNullOrUndefined(l.content))&&(t.cancel=!0)):t.cancel=!0,!1===t.cancel)return o=new U.Deferred,e.trigger("beforeTooltipRender",l,function(e){o.resolve(e),e.cancel&&(t.cancel=!0)}),this.toolTipObj.content=l.content,this.parent.isAdaptive||"mouseover"!==t.event.type?t.event:(this.currentTarget=t.target,ne.EventHandler.add(this.currentTarget,"mousemove",this.mouseMoveHandler.bind(this))),this.parent.renderTemplates(),o;t.cancel}},Ca.prototype.tooltipCloseHandler=function(e){this.tooltipMouseEvent=null,this.parent.isAdaptive||ne.isNullOrUndefined(this.currentTarget)?this.currentTarget:ne.EventHandler.remove(this.currentTarget,"mousemove",this.mouseMoveHandler),this.currentTarget=null},Ca.prototype.mouseMoveHandler=function(e){this.tooltipMouseEvent=e},Ca.prototype.updateTooltipPosition=function(e){e.element.style.visibility="visible";var t=this.parent.element.closest('[style*="zoom"]');if(ne.isNullOrUndefined(t)&&!ne.isNullOrUndefined(this.tooltipMouseEvent)&&!e.target.classList.contains("e-notes-info")){this.tooltipMouseEvent;var t=this.getPointorPosition(this.tooltipMouseEvent),i=this.parent.getOffsetRect(this.parent.chartPane),a=i.top+this.parent.chartPane.offsetHeight,n=i.left+this.parent.chartPane.offsetWidth,r=t.x,i=t.y;if(n<r+e.element.offsetWidth+10)for(;n<r+e.element.offsetWidth+10;)r=n-e.element.offsetWidth-10,e.element.style.left=r+"px";else e.element.style.left=(r+=10)+"px";e.event.clientY>e.element.offsetHeight&&a<(i=window.innerHeight<e.element.offsetHeight+i?i-e.element.offsetHeight-10:i)+e.element.offsetHeight+20?i=i-e.element.offsetHeight-10:i+=10,e.element.style.top=i+"px"}},Ca.prototype.getPointorPosition=function(e){var t,i;return ne.isNullOrUndefined(ne.getValue("pageX",e))&&ne.isNullOrUndefined(ne.getValue("pageY",e))?ne.isNullOrUndefined(ne.getValue("clientX",e))&&ne.isNullOrUndefined(ne.getValue("clientY",e))||(t=ne.getValue("clientX",e)+document.body.scrollLeft+document.documentElement.scrollLeft,i=ne.getValue("clientY",e)+document.body.scrollTop+document.documentElement.scrollTop):(t=ne.getValue("pageX",e),i=ne.getValue("pageY",e)),{x:t,y:i}},Ca.prototype.getTooltipContent=function(e,t,i,a){var n,r,s,o;switch(t&&(s=(r=t.ganttProperties).taskName,this.parent.enableHtmlSanitizer&&"string"==typeof s&&(s=ne.SanitizeHtmlHelper.sanitize(s)),n=ne.isNullOrUndefined(s)?"":'<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">'+(this.parent.disableHtmlEncode?s.replace(/</g,"<").replace(/>/g,">"):s)+"</td></tr>"),e){case"milestone":var l=void 0,d=(a.target.className.includes("e-baseline-gantt-milestone-container")&&!ne.isNullOrUndefined(r.baselineStartDate)?l=r.baselineStartDate:ne.isNullOrUndefined(r.startDate)||(l=r.startDate),this.parent.getFormatedDate(l,this.parent.getDateFormat())),h=(this.parent.enableHtmlSanitizer&&"string"==typeof d&&(d=ne.SanitizeHtmlHelper.sanitize(d)),ne.isNullOrUndefined(l)?"":'<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+d+"</td></tr>"),l=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+n+h+"</tbody></table>"},p=ne.initializeCSPTemplate(l);break;case"taskbar":var d=!(t.hasChildRecords&&!r.isAutoSchedule),u=this.parent.getFormatedDate(d?r.startDate:r.autoStartDate,this.parent.getDateFormat()),c=this.parent.getFormatedDate(d?r.endDate:r.autoEndDate,this.parent.getDateFormat()),g=this.parent.getDurationString(d?r.duration:r.autoDuration,r.durationUnit),f=r.progress,m=(this.parent.enableHtmlSanitizer&&(u="string"==typeof u?ne.SanitizeHtmlHelper.sanitize(u):u,c="string"==typeof c?ne.SanitizeHtmlHelper.sanitize(c):c,g=ne.SanitizeHtmlHelper.sanitize(g)),r.startDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(d?"startDate":"subTasksStartDate")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value"> '+u+"</td></tr>":""),y=r.endDate?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant(d?"endDate":"subTasksEndDate")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value">'+c+"</td></tr>":"",D=ne.isNullOrUndefined(r.duration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value"> '+g+"</td></tr>",k='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+"</td><td class="+it+">:</td><td>"+f+"</td></tr>",l=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+n+m+y+D+k+"</tbody></table>"};p=ne.initializeCSPTemplate(l);break;case"baseline":var T=this.parent.getFormatedDate(r.baselineStartDate,this.parent.getDateFormat()),b=this.parent.getFormatedDate(r.baselineEndDate,this.parent.getDateFormat()),w=this.parent.getDurationString(r.baselineDuration,r.durationUnit),l=(this.parent.enableHtmlSanitizer&&(T=ne.SanitizeHtmlHelper.sanitize(T),b=ne.SanitizeHtmlHelper.sanitize(b),w=ne.SanitizeHtmlHelper.sanitize(w)),function(){var e=this.parent.taskFields,t=r.baselineStartDate&&!ne.isNullOrUndefined(e.baselineStartDate)?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineStartDate")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value"> '+T+"</td></tr>":"",i=r.baselineEndDate&&!ne.isNullOrUndefined(e.baselineEndDate)?'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineEndDate")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value">'+b+"</td></tr>":"",e=ne.isNullOrUndefined(r.baselineDuration)||ne.isNullOrUndefined(e.baselineDuration)?"":'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("baselineDuration")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value"> '+w+"</td></tr>";return'<table class = "e-gantt-tooltiptable"><tbody>'+n+t+i+e+"</tbody></table>"});p=ne.initializeCSPTemplate(l,this);break;case"marker":var u=i.tooltipModule.getMarkerTooltipData(a),v=this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(u.day),this.parent.getDateFormat()),S=u.label||"",l=(this.parent.enableHtmlSanitizer&&(S=ne.SanitizeHtmlHelper.sanitize(S),v=ne.SanitizeHtmlHelper.sanitize(v)),function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr><td>'+v+"</td></tr><tr><td>"+(this.parent.disableHtmlEncode?S.replace(/</g,"<").replace(/>/g,">"):S)+"</td></tr></tbody></table>"});p=ne.initializeCSPTemplate(l,this);break;case"connectorLine":var P=i.tooltipModule.predecessorTooltipData.fromName,C=i.tooltipModule.predecessorTooltipData.fromId,R=i.tooltipModule.predecessorTooltipData.toName,M=i.tooltipModule.predecessorTooltipData.toId,x=i.tooltipModule.predecessorTooltipData.linkText,O=i.tooltipModule.predecessorTooltipData.offsetString,l=(this.parent.enableHtmlSanitizer&&(P=ne.SanitizeHtmlHelper.sanitize(P),C=ne.SanitizeHtmlHelper.sanitize(C),R=ne.SanitizeHtmlHelper.sanitize(R),M=ne.SanitizeHtmlHelper.sanitize(M),x=ne.SanitizeHtmlHelper.sanitize(x),O=ne.SanitizeHtmlHelper.sanitize(O)),function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("from")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?P.replace(/</g,"<").replace(/>/g,">"):P)+" ("+(this.parent.disableHtmlEncode&&"string"==typeof C?C.replace(/</g,"<").replace(/>/g,">"):C)+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("to")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+(this.parent.disableHtmlEncode?R.replace(/</g,"<").replace(/>/g,">"):R)+" ("+M+')</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("taskLink")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+x+'</td></tr><tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("lag")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+O+"</td></tr></tbody></table>"});p=ne.initializeCSPTemplate(l,this);break;case"indicator":a.target.title.length?(o=a.target.title,this.parent.enableHtmlSanitizer&&"string"==typeof o&&(o=ne.SanitizeHtmlHelper.sanitize(o)),p=ne.initializeCSPTemplate(l=function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr>'+o+"</tr></tbody></table>"})):a.target;break;case"timeline":var I=a.target.title,l=(this.parent.enableHtmlSanitizer&&"string"==typeof I&&(I=ne.SanitizeHtmlHelper.sanitize(I)),function(){return'<table class = "e-gantt-tooltiptable"><tbody><tr>'+I+"</tr></tbody></table>"});p=ne.initializeCSPTemplate(l);break;case"manualtaskbar":var d=this.parent.getFormatedDate(r.autoStartDate,this.parent.getDateFormat()),c=this.parent.getFormatedDate(r.autoEndDate,this.parent.getDateFormat()),g=this.parent.getDurationString(r.duration,r.durationUnit),f=this.parent.getFormatedDate(r.startDate,this.parent.getDateFormat()),u=this.parent.getFormatedDate(r.endDate,this.parent.getDateFormat()),E=(this.parent.enableHtmlSanitizer&&(d=ne.SanitizeHtmlHelper.sanitize(d),c=ne.SanitizeHtmlHelper.sanitize(c),g=ne.SanitizeHtmlHelper.sanitize(g),f=ne.SanitizeHtmlHelper.sanitize(f),u=ne.SanitizeHtmlHelper.sanitize(u)),'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+d+"</td></tr>"),F='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+c+"</td></tr>",U='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+g+"</td></tr>",N='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+f+"</td></tr>",L='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+u+"</td></tr>",l=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+n+N+E+L+F+U+"</tbody></table>"};p=ne.initializeCSPTemplate(l);break;case"manualmilestone":var d=this.parent.getFormatedDate(r.autoStartDate,this.parent.getDateFormat()),c=this.parent.getFormatedDate(r.autoEndDate,this.parent.getDateFormat()),g=this.parent.getFormatedDate(r.startDate,this.parent.getDateFormat()),V=(this.parent.enableHtmlSanitizer&&(d=ne.SanitizeHtmlHelper.sanitize(d),c=ne.SanitizeHtmlHelper.sanitize(c),g=ne.SanitizeHtmlHelper.sanitize(g)),'<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksStartDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value"> '+d+"</td></tr>"),B='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("subTasksEndDate")+'</td><td>:</td><td class = "e-gantt-tooltip-value">'+c+"</td></tr>",A='<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td><td class = "e-gantt-tooltip-value">'+g+"</tr>",l=function(){return'<table class = "e-gantt-tooltiptable"><tbody>'+n+A+V+B+"</tbody></table>"};p=ne.initializeCSPTemplate(l)}return p},Ca.prototype.getMarkerTooltipData=function(e){e=e.target.id.match(/\d+/g);return this.parent.eventMarkers[Number(e)]},Ca.prototype.getPredecessorTooltipData=function(e){var t,e=e.target.id,i=(e=this.parent.enableHtmlSanitizer&&"string"==typeof e?ne.SanitizeHtmlHelper.sanitize(e):e).match(/ConnectorLineparent(.*)child(.*)/),a=(i.shift(),e="ResourceView"===this.parent.viewType?(t=this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i[0])],this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i[1])]):(t=this.parent.flatData[this.parent.ids.indexOf(i[0])],this.parent.flatData[this.parent.ids.indexOf(i[1])]),t.ganttProperties.predecessor.filter(function(e){return e.to===i[1]}));return{fromId:"ResourceView"===this.parent.viewType?t.ganttProperties.taskId:t.ganttProperties.rowUniqueID,toId:"ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID,fromName:t.ganttProperties.taskName,toName:e.ganttProperties.taskName,linkType:a[0].type,linkText:this.parent.getPredecessorTextValue(a[0].type),offset:a[0].offset,offsetUnit:a[0].offsetUnit,offsetString:this.parent.getDurationString(a[0].offset,a[0].offsetUnit)}},Ca.prototype.templateCompiler=function(e,t,i,a){var e=t.chartRowsModule.templateCompiler(e),n=t.chartRowsModule.getTemplateID(a);return e(ne.extend({index:0},i),t,a,n,!0)},Ca.prototype.destroy=function(){this.toolTipObj.destroy()};var Pa=Ca;function Ca(e){this.parent=e,this.createTooltip(),this.parent.on("destroy",this.destroy,this)}Ma.prototype.getActiveElement=function(e){return e?this.previousActiveElement:this.activeElement},Ma.prototype.setActiveElement=function(e){this.previousActiveElement=this.activeElement,this.activeElement=e},Ma.prototype.onKeyPress=function(e){var t=this.parent,i=e.target,a=t.expandedRecords,n=(!ne.isNullOrUndefined(this.parent.focusModule.getActiveElement())||"expandAll"!==e.action&&"collapseAll"!==e.action||this.parent.element.querySelector(".e-treegrid").focus(),!this.parent.isEdit&&!ne.isNullOrUndefined(i)&&i.closest(".e-headercell")&&"Enter"===e.key&&this.parent.sortModule&&this.parent.allowSorting&&(e.action="enter",this.parent.treeGrid.grid.notify("key-pressed",e)),this.parent.focusModule.getActiveElement());if("home"!==e.action&&"end"!==e.action&&"downArrow"!==e.action&&"upArrow"!==e.action&&"delete"!==e.action&&"rightArrow"!==e.action&&"leftArrow"!==e.action&&"focusTask"!==e.action&&"focusSearch"!==e.action&&"expandAll"!==e.action&&"collapseAll"!==e.action&&"undo"!==e.action&&"redo"!==e.action&&"selectAll"!==e.action||ne.isNullOrUndefined(t.editModule)||ne.isNullOrUndefined(t.editModule.cellEditModule)||!0!==t.editModule.cellEditModule.isCellEdit)switch(!t.isAdaptive||"addRowDialog"!==e.action&&"editRowDialog"!==e.action&&"delete"!==e.action&&"addRow"!==e.action||t.selectionModule&&"Multiple"===t.selectionSettings.type&&(t.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none"),e.action){case"home":t.selectionModule&&("Cell"===t.selectionSettings.mode?t.selectionModule.selectCell({rowIndex:0,cellIndex:0}):(t.clearSelection(),t.selectionModule.selectRow(0)));break;case"end":if(t.selectionModule&&"Cell"!==t.selectionSettings.mode){var r=a[a.length-1];if(t.selectedRowIndex===t.flatData.indexOf(r))return;t.selectionModule&&0===t.selectionModule.getCellSelectedRecords().length&&t.selectionModule.selectRow(t.flatData.indexOf(r),!1,!0)}break;case"downArrow":case"upArrow":(l=t.element.querySelector("#"+t.element.id+"_searchbar"))&&l.parentElement.classList.contains("e-input-focus")&&t.selectionModule.clearSelection(),t.element.classList.contains("e-scroll-disabled")||(this.upDownKeyNavigate(e),ne.isNullOrUndefined(n)||ne.isNullOrUndefined(n.closest(".e-chart-row"))||t.ganttChartModule.manageFocus(this.getActiveElement(),"remove",!0,e.action),t.selectionSettings&&"Both"===t.selectionSettings.mode&&e.target instanceof HTMLElement&&e.target.classList.contains("e-cellselectionbackground")&&e.target.classList.remove("e-cellselectionbackground"));break;case"expandAll":t.ganttChartModule.expandCollapseAll("expand");break;case"collapseAll":t.ganttChartModule.expandCollapseAll("collapse");break;case"expandRow":case"collapseRow":this.expandCollapseKey(e);break;case"saveRequest":if(!ne.isNullOrUndefined(t.editModule)&&!ne.isNullOrUndefined(t.editModule.cellEditModule)&&t.editModule.cellEditModule.isCellEdit){var r=t.editModule.cellEditModule.editedColumn;if(r.field!==t.columnMapping.duration||ne.isNullOrUndefined(r.edit)||ne.isNullOrUndefined(r.edit.read)||(h=e.target.ej2_instances[0],d=e.target.value,s=void 0,r.field===t.columnMapping.duration&&d!==(s=ne.isNullOrUndefined(r.edit)||ne.isNullOrUndefined(r.edit.read)?s:r.edit.read()).toString()&&(h.value=d,h.dataBind())),t.editModule.dialogModule.dialogObj&&ne.getValue("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.treeGrid.grid.saveCell(),t.element.querySelector(".e-treegrid").focus()}!ne.isNullOrUndefined(n)&&!ne.isNullOrUndefined(n.closest(".e-chart-row"))&&(o=e.target,r=n.querySelector(".e-gantt-parent-taskbar,.e-gantt-child-taskbar,.e-gantt-milestone"))&&this.parent.ganttChartModule.onTaskbarClick(e,o,r);break;case"escape":ne.isNullOrUndefined(t.editModule)||ne.isNullOrUndefined(t.editModule.cellEditModule)||(t.editModule.cellEditModule.isCellEdit=!1,ne.isNullOrUndefined(t.toolbarModule))||t.toolbarModule.refreshToolbarItems();break;case"addRow":t.editModule&&t.editModule.cellEditModule&&t.editModule.cellEditModule.isCellEdit?e.stopPropagation():ne.isNullOrUndefined(document.getElementById(this.parent.element.id+"_dialog"))&&(e.preventDefault(),t.addRecord(void 0,this.parent.editSettings.newRowPosition,this.parent.selectedRowIndex),t.element.focus());break;case"addRowDialog":if(e.preventDefault(),t.editModule&&t.editModule.dialogModule&&t.editSettings.allowAdding){if(t.editModule.dialogModule.dialogObj&&ne.getValue("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.editModule.dialogModule.openAddDialog()}break;case"editRowDialog":if(e.preventDefault(),t.element.querySelector(".e-treegrid").focus(),t.editModule&&t.editModule.dialogModule&&t.editSettings.allowEditing){if(t.editModule.dialogModule.dialogObj&&ne.getValue("dialogOpen",t.editModule.dialogModule.dialogObj))return;t.editModule.dialogModule.openToolbarEditDialog()}break;case"delete":t.selectionModule&&t.editModule&&t.editModule.dialogModule&&(!t.editModule.dialogModule.dialogObj||t.editModule.dialogModule.dialogObj&&!t.editModule.dialogModule.dialogObj.visible)&&(!t.editSettings.allowTaskbarEditing||t.editSettings.allowTaskbarEditing&&!t.editModule.taskbarEditModule.touchEdit)&&("Cell"!==t.selectionSettings.mode&&t.selectionModule.selectedRowIndexes.length||"Cell"===t.selectionSettings.mode&&t.selectionModule.getSelectedRowCellIndexes().length)&&(ne.isNullOrUndefined(e.target)||"INPUT"!==e.target.tagName)&&t.editModule.startDeleteAction();break;case"focusTask":e.preventDefault();var s=void 0;t.selectionModule&&(d=t.currentViewData,"Cell"===t.selectionSettings.mode||ne.isNullOrUndefined(d[t.selectedRowIndex])?"Cell"===t.selectionSettings.mode&&0<t.selectionModule.getSelectedRowCellIndexes().length&&(s=d[(h=t.selectionModule.getSelectedRowCellIndexes())[h.length-1].rowIndex].ganttProperties.rowUniqueID):s=t.currentViewData[t.selectedRowIndex].ganttProperties.rowUniqueID),s&&t.scrollToTask(s.toString());break;case"focusSearch":t.element.querySelector("#"+t.element.id+"_searchbar")&&((l=t.element.querySelector("#"+t.element.id+"_searchbar")).setAttribute("tabIndex","-1"),l.focus());break;case"tab":case"shiftTab":var o=e.target,s=(0<this.parent.element.querySelectorAll(".e-focused").length&&(o=this.parent.element.querySelectorAll(".e-focused")[0]),_(this.parent.dataSource)&&0<this.parent.element.querySelectorAll(".e-editedbatchcell").length&&(r=this.parent.element.querySelectorAll(".e-editedbatchcell")[0],d=this.parent.ganttChartModule.getNextElement(r,"tab"===e.action,!1),h=this.parent.ganttColumns[parseInt(d.getAttribute("aria-colindex"),10)-1].field,this.tabElement={column:h,isTab:!0}),this.parent.ganttChartModule.getNextElement(o,"tab"===e.action,!1));if(!t.element.classList.contains("e-scroll-disabled")){if(o.classList.contains("e-headercell")&&!s||o.classList.contains("e-rowcell")&&!s)return void this.parent.treeGrid.grid.notify("key-pressed",e);if(o.classList.contains("e-headercell"))return void this.parent.treeGrid.grid.notify("key-pressed",e);t.ganttChartModule.onTabAction(e)}break;case"contextMenu":var l=document.getElementById(this.parent.element.id+"_contextmenu").ej2_instances[0],r=this.parent.getOffsetRect(e.target),d=r.top+r.height/2,h=r.left+r.width/2;this.setActiveElement(e.target),l.open(d,h),e.preventDefault();break;case"undo":this.parent.undoRedoModule&&0<this.parent.undoRedoModule.getUndoCollection.length&&this.parent.undo();break;case"redo":this.parent.undoRedoModule&&0<this.parent.undoRedoModule.getRedoCollection.length&&this.parent.redo();break;case"selectAll":e.preventDefault();s=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children);0<s.length&&(o=parseInt(s[0].getAttribute("aria-rowindex"),10)-1,r=parseInt(s[s.length-1].getAttribute("aria-rowindex"),10)-1,ne.isNullOrUndefined(o)||(o=Number(o)),ne.isNullOrUndefined(r)||(r=Number(r)),ne.isNullOrUndefined(o)||ne.isNullOrUndefined(r)||this.parent.selectionModule.selectRowsByRange(o,r));break;default:l={requestType:"keyPressed",action:e.action,keyEvent:e};t.trigger("actionComplete",l)}},Ma.prototype.upDownKeyNavigate=function(e){e.preventDefault();var t,i,a=this.parent,n=e.target;a.selectionModule?(-1===a.selectedRowIndex||!(!n||!n.classList.contains("e-rowcell")&&!n.classList.contains("e-headercell")||this.parent.contextMenuModule&&this.parent.contextMenuModule.isOpen)||this.parent.filterModule&&null!=this.parent.filterModule.filterMenuElement?this.parent.treeGrid.grid.notify("key-pressed",e):(n=("downArrow"===e.action||"upArrow"===e.action)&&this.parent.selectionModule&&this.parent.allowSelection&&this.parent.virtualScrollModule&&this.parent.enableVirtualization?a.getExpandedRecords(a.flatData):a.expandedRecords,i=void 0,i=(("downArrow"===e.action||"upArrow"===e.action)&&this.parent.selectionModule&&this.parent.allowSelection&&this.parent.virtualScrollModule&&this.parent.enableVirtualization?a.flatData:a.currentViewData)[a.selectedRowIndex],(t=a.element.querySelector(".e-focused"))&&ne.removeClass([t],"e-focused"),t=n.indexOf(i),i="downArrow"===e.action?n[t+1]:n[t-1],n=this.parent.args,document.activeElement!==n&&(("downArrow"===e.action||"upArrow"===e.action)&&this.parent.selectionModule&&this.parent.allowSelection&&this.parent.virtualScrollModule&&this.parent.enableVirtualization?a.selectionModule.selectRow(a.flatData.indexOf(i),!1,!0):a.selectionModule.selectRow(a.currentViewData.indexOf(i),!1,!0))),this.parent.ganttChartModule.focusedRowIndex=this.parent.selectedRowIndex):this.parent.treeGrid.grid.notify("key-pressed",e)},Ma.prototype.expandCollapseKey=function(e){var t,i,a=this.parent;a.selectionModule&&-1!==a.selectedRowIndex&&("Cell"!==a.selectionSettings.mode?i=a.selectedRowIndex:"Cell"===a.selectionSettings.mode&&0<a.selectionModule.getSelectedRowCellIndexes().length&&(t=a.selectionModule.getSelectedRowCellIndexes(),i=t[t.length-1].rowIndex),this.parent.virtualScrollModule&&this.parent.enableVirtualization&&(i=this.parent.currentViewData.findIndex(function(e){return e.ganttProperties.rowUniqueID===i.toString()})+1),"expandRow"===e.action?(this.isFromKeyboardAction=!0,a.expandByIndex(i)):(this.isFromKeyboardAction=!0,a.collapseByIndex(i)),this.isFromKeyboardAction=!1)};var Ra=Ma;function Ma(e){this.isFromKeyboardAction=!1,this.tabElement={column:"",isTab:!1},this.parent=e,this.activeElement=null,this.previousActiveElement=null}Oa.prototype.buildMaps=function(e){if(this.idToItem.clear(),e&&e.clear(),this.parentToChildren.clear(),"ProjectView"===this.parent.viewType)for(var t=0,i=this.parent.flatData;t<i.length;t++){var a=i[t],n=(e&&e.set(a.ganttProperties.rowUniqueID.toString(),a),String(a.ganttProperties.taskId)),r=(this.idToItem.set(n,a),this.adjacency.has(n)||this.adjacency.set(n,new Set),void 0);null!=(r=a.parentItem&&a.parentItem.taskId?a.parentItem.taskId:r)&&""!==r&&(a=r,this.parentToChildren.has(a)||this.parentToChildren.set(a,[]),this.parentToChildren.get(a).push(n))}},Oa.prototype.getLeafDescendants=function(e){if(this.leafCache.has(e))return this.leafCache.get(e);for(var t=[],i=(t.push(e),[e]);i.length;){var a=i.pop(),n=this.parentToChildren.get(a);if(n&&0!==n.length)for(var r=0,s=n;r<s.length;r++){var o=s[r];i.push(o)}else t.push(a)}return this.leafCache.set(e,t),t},Oa.prototype.resolveOnePred=function(e){for(var t=e.from,i=e.to,t=this.getLeafDescendants(t),a=this.getLeafDescendants(i),n=[],r=0,s=t;r<s.length;r++)for(var o=s[r],l=0,d=a;l<d.length;l++){var h=d[l];n.push({fromLeaf:o,toLeaf:h,source:e})}return n},Oa.prototype.resolve=function(){this.adjacency.clear(),this.resolvedEdgesPerTask.clear(),this.leafCache.clear(),this.cycles=[],this.topoOrder=null;for(var e=Array.from(this.idToItem.keys()),t=0;t<e.length;t++){var i=e[t];this.adjacency.has(i)||this.adjacency.set(i,new Set)}for(var a=this.idToItem.entries(),n=a.next();!n.done;){for(var r=n.value,i=r[0],s=r[1].ganttProperties.predecessor||[],o=[],t=0;t<s.length;t++)for(var l=s[t],d=this.resolveOnePred(l),h=0;h<d.length;h++){var p=d[h];this.adjacency.has(p.fromLeaf)||this.adjacency.set(p.fromLeaf,new Set),this.adjacency.get(p.fromLeaf).add(p.toLeaf),o.push(p)}this.resolvedEdgesPerTask.set(i,o),n=a.next()}this.cycles=this.detectAllCycles(),0===this.cycles.length&&(this.topoOrder=this.computeTopologicalOrder())},Oa.prototype.cloneAdjacency=function(){for(var e=new Map,t=this.adjacency.entries(),i=t.next();!i.done;){var a=i.value,n=a[0],a=a[1];e.set(n,new Set(Array.from(a))),i=t.next()}return e},Oa.prototype.addPredToAdjacencyClone=function(e){for(var t=this.cloneAdjacency(),i=0,a=this.resolveOnePred(e);i<a.length;i++){var n=a[i];t&&!t.has(n.fromLeaf)&&t.set(n.fromLeaf,new Set),t.get(n.fromLeaf).add(n.toLeaf)}return t},Oa.prototype.wouldCreateCycleWhenAdding=function(e){e=this.addPredToAdjacencyClone(e),e=this.detectCyclesStatic(e);return{wouldCreate:0<e.length,cycles:e}},Oa.prototype.detectAllCycles=function(){for(var e=[],t=0,i=this.detectCyclesStatic(this.adjacency);t<i.length;t++){var a=i[t];a[0]&&a[1]&&e.push({fromId:a[0],toId:a[1]})}return e},Oa.prototype.removePredecessor=function(e,t){return!e||e===t?"":e.split(",").map(function(e){return e.trim()}).filter(function(e){return e!==t&&e!==t.trim()}).join(",")},Oa.prototype.getCyclesWithDetails=function(e){var p=this;return"Cyclic dependency is detected for the tasks from "+e.map(function(e){var t=e.fromId,i=e.toId,a=p.idToItem.get(i),n=(p.idToItem.get(t),a.ganttProperties.predecessor),r="Task ID "+t+" to Task ID "+i,s=[];if(n){for(var o=0;o<n.length;o++){var l,d=n[o],h=p.getLeafDescendants(d.from);d.from===t||h&&-1!==h.indexOf(t)?(r="Task ID "+d.from+" to Task ID "+i,h=d.from+d.type,h=p.parent.predecessorModule.generatePredecessorValue(d,h),l=p.parent.taskFields.dependency,a.taskData[l]=a[l]=a.ganttProperties.predecessorsName=p.removePredecessor(a.ganttProperties.predecessorsName,h),h.split(",").forEach(function(e){e=e.replace(/(FS|SS|SF|FF).*$/,""),e=p.idToItem.get(e);e.ganttProperties.predecessor&&(e.ganttProperties.predecessor=e.ganttProperties.predecessor.filter(function(e){return e.to.toString()!==a.ganttProperties.taskId.toString()}))})):s.push(d)}a.ganttProperties.predecessor=s}return r}).filter(function(e,t,i){return i.indexOf(e)===t}).join(", ")+". Please provide valid dependency"},Oa.prototype.detectCyclesStatic=function(e){for(var t=new Map,i=Array.from(e.keys()),a=0;a<i.length;a++){var n=i[a];t.set(n,0)}for(var r=[],s=[],o=[],l=Array.from(e.keys()),a=0;a<l.length;a++){var d=l[a];if(0===t.get(d))for(o.push({entered:!1,neighbors:Array.from(e.get(d)||[]),nextIndex:0,node:d});0<o.length;){var h=o[o.length-1];if(h.entered||(h.entered=!0,t.set(h.node,1),r.push(h.node)),h.nextIndex<h.neighbors.length){var p=h.neighbors[h.nextIndex],u=(h.nextIndex++,t.has(p)?t.get(p):0);if(0===u)o.push({entered:!1,neighbors:Array.from(e.get(p)||[]),nextIndex:0,node:p});else if(1===u){y=m=f=g=void 0;for(var c=p,g=-1,f=0;f<r.length;f++)if(r[f]===c){g=f;break}if(-1!==g){for(var m=[],y=g;y<r.length;y++)m.push(r[y]);s.push(m)}}}else o.pop(),r.pop(),t.set(h.node,2)}}for(var D=[],k=new Set,T=0,b=s;T<b.length;T++){var w=b[T];if(0!==w.length){for(var v=w.slice(),S=0,a=1;a<v.length;a++)v[a]<v[S]&&(S=a);var w=v.slice(S).concat(v.slice(0,S)),P=w.join("->");k.has(P)||(k.add(P),D.push(w))}}return D},Oa.prototype.decrementDegree=function(e,t){var i=e.has(t)?e.get(t):0;e.set(t,i-1)},Oa.prototype.computeTopologicalOrder=function(){for(var e=new Map,t=Array.from(this.adjacency.keys()),i=0;i<t.length;i++)e.set(t[i],0);for(var a=this.adjacency.entries(),n=a.next();!n.done;){for(var r=n.value[1].values(),s=r.next();!s.done;){var o=s.value,l=e.has(o)?e.get(o):0;e.set(o,l+1),s=r.next()}n=a.next()}for(var d=[],h=(e.forEach(function(e,t){0===e&&d.push(t)}),[]);d.length;){var p=d.shift(),p=(h.push(p),this.adjacency.get(p));if(p)for(var u=p.values(),c=u.next();!c.done;){var g=c.value;this.decrementDegree(e,g),0===e.get(g)&&d.push(g),c=u.next()}}return h};var xa=Oa;function Oa(e,t){this.idToItem=new Map,this.parentToChildren=new Map,this.leafCache=new Map,this.adjacency=new Map,this.resolvedEdgesPerTask=new Map,this.cycles=[],this.topoOrder=null,this.parent=e,this.buildMaps(t)}Ea.prototype.getCalendarById=function(e){var t=this.parent.calendarSettings.taskCalendars,i=this.parent.calendarSettings.projectCalendar;if(e&&t&&0<t.length)for(var a=0;a<t.length;a++)if(t[a].calendarId===e)return t[a];return i};var Ia=Ea;function Ea(e){this.holidays=[],this.workingTime=[],this.parent=e}Fa=function(e,t){return(Fa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Fa,Ua,fa=function(e,t){function i(){this.constructor=e}Fa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},f=function(e,t,i,a){var n,r=arguments.length,s=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(n=e[o])&&(s=(r<3?n(s):3<r?n(t,i,s):n(t,i))||s);return 3<r&&s&&Object.defineProperty(t,i,s),s},Na=function(e,t){var i={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&(i[n[a]]=e[n[a]]);return i},fa=(Ua=ne.Component,fa(m,Ua),m.prototype.getModuleName=function(){return"gantt"},m.prototype.preRender=function(){this.initProperties()},m.prototype.getCurrentDayStartTime=function(e){e=0<this.weekWorkingTime.length?this.getStartTime(e):this.defaultStartTime;return e},m.prototype.getCurrentDayEndTime=function(e){e=0<this.weekWorkingTime.length?this.getEndTime(e):this.defaultEndTime;return e},m.prototype.getStartTime=function(e){var t;switch(e.getDay()){case 0:t=this.sundayDefaultStartTime;break;case 1:t=this.mondayDefaultStartTime;break;case 2:t=this.tuesdayDefaultStartTime;break;case 3:t=this.wednesdayDefaultStartTime;break;case 4:t=this.thursdayDefaultStartTime;break;case 5:t=this.fridayDefaultStartTime;break;default:t=this.saturdayDefaultStartTime}return t},m.prototype.getEndTime=function(e){var t;switch(e.getDay()){case 0:t=this.sundayDefaultEndTime;break;case 1:t=this.mondayDefaultEndTime;break;case 2:t=this.tuesdayDefaultEndTime;break;case 3:t=this.wednesdayDefaultEndTime;break;case 4:t=this.thursdayDefaultEndTime;break;case 5:t=this.fridayDefaultEndTime;break;default:t=this.saturdayDefaultEndTime}return t},m.prototype.getNonWorkingRange=function(e){var t;switch(e.getDay()){case 0:t=this.sundayNonWorkingTimeRanges;break;case 1:t=this.mondayNonWorkingTimeRanges;break;case 2:t=this.tuesdayNonWorkingTimeRanges;break;case 3:t=this.wednesdayNonWorkingTimeRanges;break;case 4:t=this.thursdayNonWorkingTimeRanges;break;case 5:t=this.fridayNonWorkingTimeRanges;break;default:t=this.saturdayNonWorkingTimeRanges}return t},m.prototype.getWorkingRange=function(e){var t;switch(e.getDay()){case 0:t=this.sundayWorkingTimeRanges;break;case 1:t=this.mondayWorkingTimeRanges;break;case 2:t=this.tuesdayWorkingTimeRanges;break;case 3:t=this.wednesdayWorkingTimeRanges;break;case 4:t=this.thursdayWorkingTimeRanges;break;case 5:t=this.fridayWorkingTimeRanges;break;default:t=this.saturdayWorkingTimeRanges}return t},m.prototype.getSecondsPerDay=function(e){var t;switch(e.getDay()){case 0:t=this.sundaySeconds;break;case 1:t=this.mondaySeconds;break;case 2:t=this.tuesdaySeconds;break;case 3:t=this.wednesdaySeconds;break;case 4:t=this.thursdaySeconds;break;case 5:t=this.fridaySeconds;break;case 6:t=this.saturdaySeconds;break;default:t=this.secondsPerDay}return t},m.prototype.showLoadingIndicator=function(){ne.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.showSpinner():this.showMaskRow()},m.prototype.hideLoadingIndicator=function(){ne.isNullOrUndefined(this.loadingIndicator)||"Shimmer"!==this.loadingIndicator.indicatorType?this.hideSpinner():this.hideMaskRow()},m.prototype.isCustomDayWorkingTime=function(e){var t=[{from:8,to:12},{from:13,to:17}];if(!e||e.length!==t.length)return!0;for(var i=0;i<t.length;i++){var a=e[i],n=t[i];if(a.from!==n.from||a.to!==n.to)return!0}return!1},m.prototype.assignPropertiesToCalendar=function(){0<this.holidays.length?this.calendarModule.holidays=this.holidays:this.calendarModule.holidays=this.calendarSettings.projectCalendar.holidays,this.isCustomDayWorkingTime(this.dayWorkingTime)?this.calendarModule.workingTime=this.dayWorkingTime:this.calendarModule.workingTime=this.calendarSettings.projectCalendar.workingTime},m.prototype.initProperties=function(){this.globalize=new ne.Internationalization(this.locale),this.isAdaptive=ne.Browser.isDevice,this.flatData=[],this.currentViewData=[],this.updatedRecords=[],this.ids=[],this.ganttColumns=[],this.localeObj=new ne.L10n(this.getModuleName(),this.getDefaultLocale(),this.locale),this.dataOperation=new le(this),this.nonWorkingHours=[],this.mondayNonWorkingHours=[],this.tuesdayNonWorkingHours=[],this.wednesdayNonWorkingHours=[],this.thursdayNonWorkingHours=[],this.fridayNonWorkingHours=[],this.saturdayNonWorkingHours=[],this.sundayNonWorkingHours=[],this.nonWorkingTimeRanges=[],this.mondayNonWorkingTimeRanges=[],this.tuesdayNonWorkingTimeRanges=[],this.wednesdayNonWorkingTimeRanges=[],this.thursdayNonWorkingTimeRanges=[],this.fridayNonWorkingTimeRanges=[],this.saturdayNonWorkingTimeRanges=[],this.sundayNonWorkingTimeRanges=[],this.workingTimeRanges=[],this.mondayWorkingTimeRanges=[],this.tuesdayWorkingTimeRanges=[],this.wednesdayWorkingTimeRanges=[],this.thursdayWorkingTimeRanges=[],this.fridayWorkingTimeRanges=[],this.saturdayWorkingTimeRanges=[],this.sundayWorkingTimeRanges=[],this.defaultEndTime=null,this.defaultStartTime=null,this.mondayDefaultStartTime=null,this.mondayDefaultEndTime=null,this.tuesdayDefaultStartTime=null,this.tuesdayDefaultEndTime=null,this.wednesdayDefaultStartTime=null,this.wednesdayDefaultEndTime=null,this.thursdayDefaultStartTime=null,this.thursdayDefaultEndTime=null,this.fridayDefaultStartTime=null,this.fridayDefaultEndTime=null,this.saturdayDefaultStartTime=null,this.saturdayDefaultEndTime=null,this.sundayDefaultStartTime=null,this.sundayDefaultEndTime=null,this.durationUnitTexts={days:"days",hours:"hours",minutes:"minutes",day:"day",hour:"hour",minute:"minute"},this.durationUnitEditText={minute:["m","min","minute","minutes"],hour:["h","hr","hour","hours"],day:["d","dy","day","days"]},this.perDayWidth=null,this.isMileStoneEdited=!1,this.chartVerticalLineContainer=null,this.updatedConnectorLineCollection=[],this.connectorLineIds=[],this.predecessorsCollection=[],this.isInPredecessorValidation=this.enablePredecessorValidation,this.isValidationEnabled=!0,this.isLoad=!0,this.editedPredecessorRecords=[],this.validationDialogElement=null,this.currentEditedArgs={},this.dialogValidateMode={respectLink:!1,removeLink:!1,preserveLinkWithEditing:!0},this.taskFields.constraintType&&this.taskFields.constraintDate&&(this.dialogValidateMode.respectMustStartOn=!1,this.dialogValidateMode.respectMustFinishOn=!1,this.dialogValidateMode.respectStartNoLaterThan=!1,this.dialogValidateMode.respectFinishNoLaterThan=!1),this.calendarModule=new Ia(this),this.assignPropertiesToCalendar(),this.secondsPerDay=this.dataOperation.getSecondsPerDay(),this.nonWorkingDayIndex=[],this.dataOperation.getNonWorkingDayIndex(),this.columnMapping={},this.controlId=this.element.id,this.cloneProjectStartDate=this.enablePersistence&&this.cloneProjectStartDate?this.cloneProjectStartDate:null,this.cloneProjectEndDate=this.enablePersistence&&this.cloneProjectEndDate?this.cloneProjectEndDate:null,this.cloneTimelineStartDate=this.enablePersistence&&this.cloneTimelineStartDate?this.cloneTimelineStartDate:null,this.cloneTimelineEndDate=this.enablePersistence&&this.cloneTimelineEndDate?this.cloneTimelineEndDate:null,this.totalHolidayDates=this.dataOperation.getHolidayDates(),this.ganttChartModule=new Ot(this),this.timelineModule=new It(this),this.chartRowsModule=new ka(this),this.treeGridModule=new Ft(this),this.dateValidationModule=new J(this),this.predecessorModule=new ba(this),this.connectorLineModule=new wa(this),this.splitterModule=new va(this),this.tooltipModule=new Pa(this),this.keyConfig={home:"home",end:"end",downArrow:"downarrow",upArrow:"uparrow",collapseAll:"ctrl+uparrow",expandAll:"ctrl+downarrow",collapseRow:"ctrl+shift+uparrow",expandRow:"ctrl+shift+downarrow",saveRequest:"13",escape:"27",addRow:"insert",addRowDialog:"ctrl+insert",editRowDialog:"ctrl+f2",delete:"delete",tab:"tab",shiftTab:"shift+tab",focusTask:"shift+f5",indentLevel:"shift+leftarrow",outdentLevel:"shift+rightarrow",focusSearch:"ctrl+shift+70",contextMenu:"shift+F10",undo:"ctrl+z",redo:"ctrl+y",selectAll:"ctrl+a"},this.focusModule=new Ra(this),0===this.zoomingLevels.length&&this.setProperties({zoomingLevels:this.getZoomingLevels()},!0),this.resourceFieldsMapping(),ne.isNullOrUndefined(this.resourceFields.unit)&&this.setProperties({resourceFields:{unit:"unit"}},!0),this.taskIds=[],this.defaultCalendarContext=new ee(this,this.calendarSettings.projectCalendar)},m.prototype.isUndoRedoItemPresent=function(e){return!(!this.undoRedoModule||!this.undoRedoActions||-1===this.undoRedoActions.indexOf(e))},m.prototype.insertRecord=function(e,t){this.flatData.splice(t,0,e)},m.prototype.removeRecords=function(e,t){this.flatData.splice(e,t=void 0===t?1:t)},m.prototype.getDateFormat=function(){return ne.isNullOrUndefined(this.dateFormat)?this.globalize.getDatePattern({skeleton:"yMd"}):this.dateFormat},m.prototype.getDefaultTZOffset=function(){var e=new Date((new Date).getFullYear(),0,1),t=new Date((new Date).getFullYear(),6,1);return Math.max(e.getTimezoneOffset(),t.getTimezoneOffset())},m.prototype.isInDst=function(e){return e.getTimezoneOffset()<this.getDefaultTZOffset()},m.prototype.resourceFieldsMapping=function(){var e=this.resourceFields;e.id=ne.isNullOrUndefined(e.id)?this.resourceIDMapping:e.id,e.name=ne.isNullOrUndefined(e.name)?this.resourceNameMapping:e.name},m.prototype.validateDimentionValue=function(e){return ne.isNullOrUndefined(e)?null:"string"==typeof e&&"auto"!==e&&-1===e.indexOf("%")?-1===e.indexOf("px")?e+"px":e:"number"==typeof e?e+"px":e.toString()},m.prototype.calculateDimensions=function(){var e=this.validateDimentionValue(this.height),t=this.validateDimentionValue(this.width),i=(ne.isNullOrUndefined(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(t=this.width),this.element.style.height),a=this.element.style.width;t&&(this.element.style.width=t),e&&(this.element.style.height=e),e||i||(this.element.style.height="auto"),t||a||(this.element.style.width="auto"),this.ganttHeight=this.element.offsetHeight,this.ganttWidth=this.element.offsetWidth},m.prototype.render=function(){var e;ne.initializeTelemetry("Gantt"),this.isReact&&(this.treeGrid.isReact=!0,this.treeGrid.grid.isReact=!0),this.isVue&&(this.treeGrid.isVue=!0,this.treeGrid.grid.isVue=!0,this.treeGrid.vueInstance=this.vueInstance,this.treeGrid.grid.vueInstance=this.vueInstance),this.taskFields&&this.taskFields.constraintDate&&this.taskFields.constraintType&&!this.updateOffsetOnTaskbarEdit&&(this.updateOffsetOnTaskbarEdit=!1),this.element.setAttribute("role","application"),E.createSpinner({target:this.element},this.createElement),this.trigger("load",{}),this.element.classList.add(de),this.isAdaptive?this.element.classList.add(ge):this.element.classList.remove(ge),this.calculateDimensions(),ne.isNullOrUndefined(this.toolbarModule)||this.renderToolbar(),this.splitterModule.renderSplitter(),this.notify("renderPanels",null),this.actionFailures(),this.showLoadingIndicator(),this.dataMap&&this.dataMap.clear(),ne.isNullOrUndefined(this.initialHierarchyMode)&&this.filterModule&&(e=this.filterSettings.hierarchyMode,this.initialHierarchyMode=e),this.dataOperation.checkDataBinding()},m.prototype.actionFailures=function(){for(var e,t,i,a,n=[],r=/^[a-zA-Z\s/]+$/,s=!0,o=this.taskFields.properties,l=(Object.keys(o).forEach(function(e){null!==o[e]&&(s=!1)}),!0),d=0;d<this.columns.length;d++)if(this.columns[d].isPrimaryKey){l=!1;break}function h(t,e,i,a){var n;ne.isNullOrUndefined(i)||(n=i.filter(function(e){return e.prototype.getModuleName()===t})),e&&!ne.isNullOrUndefined(n)&&0===n.length&&a.push("Module "+t+" is not available in Gantt component! You either misspelled the module name or forgot to load it!")}s&&n.push("Gantt Task Fields are not configured properly. The task fields are crucial for both the project and resource views to function properly. Please ensure that the gantt task fields are properly configured!"),"ResourceView"!==this.viewType||this.resourceFields.id||n.push("Gantt Resource Fields are not properly configured, which is crucial for the Resource View. Please ensure that the resource fields are configured correctly!"),this.dataSource instanceof U.DataManager&&ne.isNullOrUndefined(this.taskFields.hasChildMapping)&&n.push("hasChildMapping property is not configured for load-on-demand. Please ensure its properly configured in the Gantt Task Fields!"),ne.isNullOrUndefined(this.timelineSettings.topTier.format)||""===this.timelineSettings.topTier.format||r.test(this.timelineSettings.topTier.format)||n.push("The provided top tier format is invalid. Please ensure that you provide a valid format for these tier. Make sure to use only letters and avoid numbers or special characters!"),ne.isNullOrUndefined(this.timelineSettings.bottomTier.format)||""===this.timelineSettings.bottomTier.format||r.test(this.timelineSettings.bottomTier.format)||n.push("The provided bottom tier format is invalid. Please ensure that you provide a valid format for these tier. Make sure to use only letters and avoid numbers or special characters!"),l&&"ResourceView"!==this.viewType&&n.push("Primarykey is not configured properly. The primarykey is crucial for doing CRUD operations or map taskId in column field of gantt!"),0<this.eventMarkers.length&&this.eventMarkers.forEach(function(e){e.day||n.push("Day is not configured properly in event markers.Please ensure that the day in event markers is properly configured!")}),h("sort",this.allowSorting,this.injectedModules,n),h("edit",c=this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing||this.editSettings.allowNextRowEdit||this.editSettings.allowTaskbarEditing||this.editSettings.mode||this.editSettings.newRowPosition||this.editSettings.showDeleteConfirmDialog?!0:c,this.injectedModules,n),h("reorder",this.allowReordering,this.injectedModules,n),h("excelExport",this.allowExcelExport,this.injectedModules,n),h("rowDragAndDrop",e=this.allowRowDragAndDrop||this.allowTaskbarDragAndDrop?!0:e,this.injectedModules,n),h("criticalPath",this.enableCriticalPath,this.injectedModules,n),h("undoRedo",this.enableUndoRedo,this.injectedModules,n),h("resize",this.allowResizing,this.injectedModules,n),h("toolbar",t=this.toolbar&&0<this.toolbar.length?!0:t,this.injectedModules,n),h("filter",i=this.allowFiltering||this.toolbar&&-1!==this.toolbar.indexOf("Search")?!0:i,this.injectedModules,n),h("selection",this.allowSelection,this.injectedModules,n);var p,u,r=this.calendarModule.holidays,c=(h("dayMarkers",a=this.highlightWeekends||r&&0<r.length||this.eventMarkers&&0<this.eventMarkers.length?!0:a,this.injectedModules,n),h("contextMenu",this.enableContextMenu,this.injectedModules,n),h("columnMenu",this.showColumnMenu,this.injectedModules,n),h("pdfExport",this.allowPdfExport,this.injectedModules,n),h("virtualScroll",this.enableVirtualization,this.injectedModules,n),Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze}));h("freeze",p=this.frozenColumns||c||this.getFrozenColumnsCount()?!0:p,this.injectedModules,n),0<n.length&&(u={error:{}},n.forEach(function(e,t){u.error[parseInt(t,10)]=e}),this.trigger("actionFailure",u))},m.prototype.hideMaskRow=function(){var e,t=this.element.querySelectorAll(".e-masked-table").length;for(ne.isNullOrUndefined(this.contentMaskTable)||0===t&&!this.contentMaskTable||(e=this.contentMaskTable,ne.remove(e),this.contentMaskTable=null),t=this.element.querySelectorAll(".e-masked-table").length,ne.isNullOrUndefined(this.headerMaskTable)||0===t&&!this.headerMaskTable||(e=this.headerMaskTable,ne.remove(e),this.headerMaskTable=null);0!==this.element.querySelectorAll(".e-table-background").length;)this.element.querySelectorAll(".e-table-background")[0].remove();for(;0!==this.element.querySelectorAll(".e-temp-timeline").length;)this.element.querySelectorAll(".e-temp-timeline")[0].remove();if(0!==this.element.querySelectorAll("."+ye).length)for(var i=0;i<this.singleTier;i++)ne.isNullOrUndefined(this.element.querySelectorAll("."+ye)[parseInt(i.toString(),10)])||(this.element.querySelectorAll("."+ye)[parseInt(i.toString(),10)].style.visibility="visible");ne.isNullOrUndefined(this.element.querySelector("."+me))||(this.element.querySelector("."+me).style.position="relative"),ne.isNullOrUndefined(this.element.getElementsByClassName(ce)[0])||(this.element.getElementsByClassName(ce)[0].style.visibility="visible")},m.prototype.showMaskRow=function(){var e=this.chartPane.childNodes[0].childNodes[0],t=(this.scrollLeftValue=this.chartPane.childNodes[0].childNodes[0].scrollLeft,this.chartPane.childNodes[0].childNodes[1]);if(this.treeGrid.element&&this.ganttChartModule.setVirtualHeight(),!this.contentMaskTable){if(t){var i=t;if(this.renderBackGround(i),this.ganttChartModule.scrollObject.isSetScrollLeft){if(0!==this.element.querySelectorAll("."+ye).length){this.singleTier=this.timelineModule.isSingleTier?1:2;for(var a=0;a<this.singleTier;a++)this.element.querySelectorAll("."+ye)[parseInt(a.toString(),10)].style.visibility="hidden"}0===this.singleTier&&(this.singleTier=2)}this.element.getElementsByClassName(ce)[0].style.visibility="hidden",this.contentMaskTable=this.contentMaskTable=this.createMaskTable(i)}e&&this.ganttChartModule.scrollObject.isSetScrollLeft&&(this.element.querySelector("."+me).style.position="static",this.renderHeaderBackground(i=e),this.headerMaskTable=this.headerMaskTable=this.createMaskTable(i))}},m.prototype.convertToWBSPredecessor=function(e,t){var i=this;return e.split(",").map(function(e){var t=e.trim().match(/^(.*?)(FS|SS|FF|SF|\+|\s|$)(.*)/i);return t?i.connectorLineModule.getRecordByID(t[1]).ganttProperties.wbsCode+(t[2]+t[3]).trim():e.trim()}).join(",")},m.prototype.updateWBSPredecessor=function(e){var t=e[this.taskFields.dependency]&&""!==e[this.taskFields.dependency]?this.convertToWBSPredecessor(e[this.taskFields.dependency],e):null;e.WBSPredecessor=t,e.ganttProperties.wbsPredecessor=t},m.prototype.updateWBSCodes=function(e,t,i,a){var n=this.getParentTask(e.parentItem),r=(i.get(n)||0)+1;return i.set(n,r),n=n?t.get(n)+"."+r:""+r,t.set(e,n),a||(e.WBSCode=n.toString(),e.ganttProperties.wbsCode=n.toString()),{wbsMap:t,siblingCountMap:i}},m.prototype.getMaxRootWBSCode=function(e,t){for(var i="",a=0,n=e;a<n.length;a++){var r=n[a].ganttProperties.wbsCode;if(r){for(var s=i.split(".").map(Number),o=r.split(".").map(Number),l=Math.max(s.length,o.length),d=!1,h=0;h<l;h++){var p=o[h]||0,u=s[h]||0;if(u<p){d=!0;break}if(p<u)break}i&&!d||(i=r)}}return i?((e=i.split(".").map(Number))[e.length-1]++,e.join(".")):t.ganttProperties.wbsCode+".1"},m.prototype.generateWBSCodes=function(e){for(var t=new Map,i=[],a=new Map,n=0,r=e;n<r.length;n++){var s,o,l=r[n];this.enableAutoWbsUpdate||this.isLoad?(t=(o=this.updateWBSCodes(l,t,a)).wbsMap,a=o.siblingCountMap):l.ganttProperties.wbsCode||(o=void 0,o=l.parentItem?(o=(s=this.getParentTask(l.parentItem)).ganttProperties.wbsCode,this.getMaxRootWBSCode(s.childRecords,s)):this.getMaxRootWBSCode(this.treeGrid.parentData),l.WBSCode=o,l.ganttProperties.wbsCode=o),l[this.taskFields.dependency]?i.push(l):(l.WBSPredecessor=null,l.ganttProperties.wbsPredecessor=null)}for(var d=0,h=i;d<h.length;d++){l=h[d];this.updateWBSPredecessor(l)}},m.prototype.renderHeaderBackground=function(e){var t=e;if(!!ne.closest(t,"."+me)){for(var i=this.createElement("div",{className:"e-table-background"}),a=0,n=Math.round(e.getBoundingClientRect().width),r=0;r<3;r++)this.enableRtl?i.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(n-=160)+"px; top:0px;"}})):i.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(a+=160)+"px; top:0px;"}}));t.insertBefore(i,t.firstChild)}},m.prototype.assignTimeToDate=function(e,t){var e=new Date(e),i=Math.floor(t/3600),a=Math.floor(t%3600/60);return e.setHours(i,a,t%60,0),e},m.prototype.renderBackGround=function(e){var t=e;if(!!ne.closest(t,"."+ue)){for(var i=this.createElement("div",{className:"e-table-background"}),a=0,n=Math.round(e.getBoundingClientRect().width),r=0;r<3;r++)this.enableRtl?i.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(n-=160)+"px;z-index:1;"}})):i.appendChild(this.createElement("div",{className:"e-div-background",attrs:{style:"left: "+(a+=160)+"px;z-index:1;"}}));t.insertBefore(i,t.firstChild)}},m.prototype.createMaskTable=function(e){var t,i=e,a=e.getBoundingClientRect().height,n=!!ne.closest(i,"."+me);return n?((t=this.createEmptyTimeLineTable(a)).style.position="sticky",t.style.left="0px",this.enableRtl&&t.style.removeProperty("left")):((t=this.createEmptyMaskTable(a)).style.position="absolute",t.style.zIndex=1),n?(t.style.height=e.getBoundingClientRect().height+"px",(n=this.createElement("div",{className:"e-temp-timeline"})).style.width=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth+"px",n.style.position="sticky",this.enableRtl?n.style["margin-right"]=Math.abs(this.scrollLeftValue)+"px":n.style["margin-left"]=this.scrollLeftValue+"px",n.appendChild(t),i.insertBefore(n,i.firstChild)):(t.style.height=e.getBoundingClientRect().height+"px",i.insertBefore(t,i.firstChild)),e.style.height=a+"px",t},m.prototype.createEmptyTimeLineTable=function(e){for(var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),a=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/2+"px;"}}),r=0;r<this.singleTier;r++)a.push(n.cloneNode(!0));for(r=this.topBottomHeader=0;r<a.length;r++)i.appendChild(this.applyTimelineMaskRow(a[parseInt(r.toString(),10)])),this.topBottomHeader=this.topBottomHeader+1;return t.appendChild(i),t.style.width="100%",t},m.prototype.applyTimelineMaskRow=function(e){var t=e,i=4;4<this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth/166&&(i=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth/166);for(var a=0;a<i;a++)t.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(a=0;a<t.childNodes.length-1;a++)t.childNodes[parseInt(a.toString(),10)].style.width="166px";for(var n=[].slice.call(t.childNodes),a=0;a<n.length;a++){var r=n[parseInt(a.toString(),10)];switch(this.topBottomHeader){case 0:this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>',r.children[0].style.left="-20px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-timelineHeader"></span>';break;case 1:r.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),r.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"})),r.appendChild(this.createElement("td",{className:"e-timeline-masked-top-header-cell"}));for(var s=[].slice.call(r.childNodes),o=0;o<s.length;o++){var l=s[parseInt(o.toString(),10)];0===o?this.enableRtl?(l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>',l.children[0].style.left="-14px"):l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>':1===o?this.enableRtl?(l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>',l.children[0].style.left="-30px"):l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML1"></span>':this.enableRtl?(l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>',l.children[0].style.left="-60px"):l.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML2"></span>'}}}return t},m.prototype.createEmptyMaskTable=function(e){for(var t=this.createElement("table",{className:"e-table e-masked-table"}),i=this.createElement("tbody",{className:"e-masked-tbody"}),a=[],n=this.createElement("tr",{className:"e-masked-row e-row",attrs:{style:"height: "+e/7+"px;"}}),r=this.columnLoop=0;r<6;r++)a.push(n.cloneNode(!0));for(var s=0;s<a.length;s++)this.columnLoop<4?this.columnLoop=this.columnLoop+1:4===this.columnLoop&&(this.columnLoop=1),i.appendChild(this.applyMaskRow(a[parseInt(s.toString(),10)]));t.appendChild(i),t.style.width="100%";e=this.createElement("div",{className:"e-temp-container"});return e.style.width="calc(100% - 17px)",e.style.overflow="hidden",e.appendChild(t),e},m.prototype.applyMaskRow=function(e){var t=e;if(this.columnLoop<4){var i=2;2<this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth/300&&(i=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetWidth/300);for(var a=0;a<i;a++)t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}))}else t.appendChild(this.createElement("td",{className:"e-masked-cell e-rowcell"}));for(var n=[].slice.call(t.childNodes),a=0;a<n.length;a++){var r=n[parseInt(a.toString(),10)];switch(this.columnLoop){case 1:0===a?this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>',r.children[0].style.left="-14px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell01"></span>':r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell02"></span>';break;case 2:0===a?this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>',r.children[0].style.left="-14px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell03"></span>':r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell04"></span>';break;case 3:0===a?this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>',r.children[0].style.left="-64px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell05"></span>':this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>',r.children[0].style.left="-192px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell06"></span>';break;case 4:this.enableRtl?(r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>',r.children[0].style.left="-388px"):r.innerHTML='<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-maskcell07"></span>'}}return t},m.prototype.showSpinner=function(){E.showSpinner(this.element)},m.prototype.hideSpinner=function(){E.hideSpinner(this.element)},m.prototype.processTimeline=function(){this.timelineModule.processTimelineUnit(),this.timelineModule.calculateZoomingLevelsPerDayWidth()},m.prototype.renderGantt=function(e){e&&(this.isFromOnPropertyChange=e),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp());var t,i=new Map;this.cyclicValidator=new xa(this,i),this.allowParentDependency&&(this.cyclicValidator.resolve(),0<this.cyclicValidator.cycles.length&&(t=this.cyclicValidator.getCyclesWithDetails(this.cyclicValidator.cycles),this.trigger("actionFailure",{error:t})),this.predecessorModule.updateParentPredecessor(i)),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors(i),this.isInPredecessorValidation)&&this.enableValidation&&this.autoCalculateDateScheduling&&(!this.isLoad||this.treeGrid.loadChildOnDemand||!this.taskFields.hasChildMapping)&&this.predecessorModule.updatedRecordsDateByPredecessor(i),this.enableValidation&&(this.dataOperation.calculateProjectDates(),this.timelineModule.validateTimelineProp(),this.dataOperation.updateGanttData()),e?(this.dataSource instanceof Object&&H(this)?(t=ne.getValue("count",this.dataSource),this.treeGrid.dataSource={result:this.flatData,count:t}):this.treeGrid.setProperties({dataSource:this.flatData},!1),ne.isNullOrUndefined(this.selectionModule)||this.treeGrid.setProperties({selectedRowIndex:this.selectedRowIndex},!1)):(this.treeGridPane.classList.remove("e-temp-content"),ne.isNullOrUndefined(this.treeGridPane.querySelector(".e-gantt-temp-header"))||ne.remove(this.treeGridPane.querySelector(".e-gantt-temp-header")),this.notify("dataReady",{}),this.enableContextMenu&&this.notify("initiate-contextMenu",{}),i=!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger")&&36===this.rowHeight?46:this.rowHeight,this.rowHeight=ne.isNullOrUndefined(this.rowHeight)?36:i,this.renderTreeGrid(),this.wireEvents(),this.notify("initPredessorDialog",{})),this.isFromOnPropertyChange||this.splitterModule.updateSplitterPosition(),"Vertical"!==this.gridLines&&"Both"!==this.gridLines||this.dayMarkersModule||this.renderChartVerticalLines()},m.prototype.removeCriticalPathStyles=function(){var e=this.ganttChartModule.chartElement;ne.removeClass(e.querySelectorAll(".e-gantt-child-taskbar-inner-div"),Re),ne.removeClass(e.querySelectorAll(".e-gantt-child-progressbar-inner-div"),Me),ne.removeClass(e.querySelectorAll(".e-critical-milestone"),xe),ne.removeClass(this.element.querySelectorAll(".e-connector-line"),ot),ne.removeClass(this.element.querySelectorAll(".e-connector-line-arrow"),lt)},m.prototype.wireEvents=function(){this.allowKeyboard&&(this.keyboardModule=new ne.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfig,eventName:"keydown"})),ne.EventHandler.add(window,"resize",this.windowResize,this),ne.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)},m.prototype.unwireEvents=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),ne.EventHandler.remove(window,"resize",this.windowResize),ne.EventHandler.remove(document.body,"keydown",this.keyDownHandler)},m.prototype.keyDownHandler=function(e){e.altKey&&74===e.keyCode&&(this.ganttChartModule.manageFocus(this.treeGrid.element.childNodes[1],"remove",!1),this.ganttChartModule.manageFocus(this.element,"add",!1)),"Enter"===e.key&&!this.allowKeyboard&&S(e.target,"e-editedbatchcell")&&e.preventDefault()},m.prototype.windowResize=function(){var e,t,i=this;ne.isNullOrUndefined(this.element)||(this.updateContentHeight(),this.ganttChartModule.updateWidthAndHeight(),this.treeGridModule.ensureScrollBar(),this.predecessorModule&&this.taskFields.dependency&&(this.updateRowHeightInConnectorLine(this.updatedConnectorLineCollection),this.connectorLineModule.renderConnectorLines(this.updatedConnectorLineCollection)),e=this.criticalPathModule,this.enableCriticalPath&&e&&e.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds),this.calculateDimensions(),e=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[0],t=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[1],this.splitterModule.splitterPreviousPositionGrid=e.scrollWidth+1+"px",this.splitterModule.splitterPreviousPositionChart=t.scrollWidth+1+"px",this.timelineModule.isZoomedToFit&&setTimeout(function(){i.timelineModule.processZoomToFit()},0)),this.dayMarkersModule&&this.dayMarkersModule.eventMarkerRender&&this.dayMarkersModule.eventMarkerRender.updateContainerHeight(),this.enableTimelineVirtualization&&this.timelineModule.refreshTimeline()},m.prototype.keyActionHandler=function(e){var t;this.enableContextMenu&&this.contextMenuModule&&("downArrow"===e.action||"upArrow"===e.action)&&document.getElementById(this.element.id+"_contextmenu")&&this.args&&(t=this.args,ne.isNullOrUndefined(t)||t.focus()),e.target&&("downArrow"===e.action||"upArrow"===e.action)&&e.target===this.element.querySelector(".e-rowcell")||e.target&&"escape"===e.action&&this.treeGrid.grid.columnMenuModule&&"block"===this.treeGrid.grid.columnMenuModule.columnMenu.element.style.display?this.treeGrid.grid.notify("key-pressed",e):this.focusModule.onKeyPress(e)},m.prototype.updateRowHeightInConnectorLine=function(e){if(e&&e.length){var t=!ne.isNullOrUndefined(this.ganttChartModule)&&this.ganttChartModule.getChartRows()[0]&&this.ganttChartModule.getChartRows()[0].getBoundingClientRect().height;if(t&&!isNaN(t))for(var i=0;i<e.length;i++)e[i].rowHeight=t}},m.prototype.renderToolbar=function(){ne.isNullOrUndefined(this.toolbarModule)||(this.toolbarModule.renderToolbar(),this.toolbarModule.refreshToolbarItems())},m.prototype.renderTreeGrid=function(){this.treeGridModule.renderTreeGrid()},m.prototype.updateCurrentViewData=function(){var t=this;if(this.currentViewData=this.treeGrid.getCurrentViewRecords().slice(),0<this.currentViewData.length&&this.loadChildOnDemand&&this.taskFields.hasChildMapping){this.isLoad=!0,this.flatData=[],this.dataOperation.taskIds={},this.ids=[],this.dataOperation.recordIndex=0,this.dataOperation.dataArray=this.currentViewData,this.dataOperation.cloneDataSource(),this.predecessorModule&&this.taskFields.dependency&&(this.predecessorModule.parentIds=[],this.predecessorModule.parentRecord=[],this.predecessorModule.updatePredecessors());for(var e=this.treeGrid.grid.contentModule.rows.filter(function(e){if(e.data[t.taskFields.id]===t.flatData[0].ganttProperties.taskId)return e})[0].index,i=0;i<this.flatData.length;i++)this.flatData[i].index=e,e++;this.currentViewData=this.flatData,this.treeGrid.grid.currentViewData=this.flatData,ne.isNullOrUndefined(this.treeGrid.virtualScrollModule)||(this.treeGrid.virtualScrollModule.visualData=this.flatData,this.updatedRecords=this.flatData)}var a=this.expandedRecords;this.expandedRecords=this.getExpandedRecords(this.currentViewData),this.isOnAddOrDelete=a.length!==this.expandedRecords.length&&!this.isLoad},m.prototype.getRecordFromFlatdata=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getTaskByUniqueID(e[i].uniqueID));return t},m.prototype.updateContentHeight=function(e){var t,i;(this.allowTaskbarOverlap||this.ganttChartModule.isCollapseAll||this.ganttChartModule.isExpandAll||this.isOnAddOrDelete||this.isLoad)&&(this.virtualScrollModule&&this.enableVirtualization&&!ne.isNullOrUndefined(e)?(e=ne.getValue("result.length",e),this.contentHeight=e*this.rowHeight):(e=this.virtualScrollModule&&this.enableVirtualization?this.currentViewData:this.expandedRecords,i=void(this.expandedRecords=e),t=ne.isNullOrUndefined(this.ganttChartModule)||ne.isNullOrUndefined(this.ganttChartModule.getChartRows())?null:this.ganttChartModule.getChartRows()[0],i=!ne.isNullOrUndefined(t)&&0<t.offsetHeight?t.offsetHeight:this.rowHeight,this.contentHeight=e.length*i,this.isOnAddOrDelete=!1))},m.prototype.getExpandStatus=function(e){e=this.getParentTask(e.parentItem);return!!ne.isNullOrUndefined(e)||!1!==e.expanded&&(!e.parentItem||!1!==this.getParentTask(e.parentItem).expanded&&this.getExpandStatus(this.getParentTask(e.parentItem)))},m.prototype.getExpandedRecords=function(e){if(!e||0===e.length)return this.expandedRecords=[],[];for(var t=new Map,i=new Map,a=new Map,n=0,r=e;n<r.length;n++){var s=(p=r[n]).uniqueID;t.set(s,p),p.parentItem&&(g=p.uniqueID,i.has(g)||i.set(g,[]),i.get(g).push(s))}for(var o=[],l=new Set,d=0,h=e;d<h.length;d++){var p,s=(p=h[d]).uniqueID;if(l.has(s))a.get(s)&&o.push(p);else{l.add(s);var u=!1!==p.expanded;if(u&&p.parentItem)for(var c=p;c.parentItem;){var g=c.parentItem.uniqueID,f=this.getParentTask(c.parentItem,t);if(l.has(g)){if(a.has(g)&&f&&f.expanded){u=a.get(g);break}u=!1;break}if(l.add(g),f&&-1===e.indexOf(f)&&f.expanded&&!a.get(g)&&a.set(g,!0),!f){u=!1;break}if(!1===f.expanded){u=!1;break}c=f}else if(!u){for(var m=!0,c=p;c.parentItem;){var y=this.getParentTask(c.parentItem,t);if(!y||!1===y.expanded){m=!1;break}c=y}u=m}a.set(s,u),u&&o.push(p)}}return this.expandedRecords=o},m.prototype.getZoomingLevels=function(){var e=this.timelineSettings.weekStartDay,t=this.timelineSettings.weekendBackground;return[{topTier:{unit:"Year",format:"yyyy",count:50},bottomTier:{unit:"Year",format:"yyyy",count:10},timelineUnitSize:99,level:0,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:20},bottomTier:{unit:"Year",format:"yyyy",count:5},timelineUnitSize:99,level:1,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:5},bottomTier:{unit:"Year",format:"yyyy",count:1},timelineUnitSize:99,level:2,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:66,level:3,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayHalfValue,count:6},timelineUnitSize:99,level:4,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Year",format:"MMM, yy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:66,level:5,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",formatter:this.displayQuarterValue,count:3},timelineUnitSize:99,level:6,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Year",format:"yyyy",count:1},bottomTier:{unit:"Month",format:"MMM yyyy",count:1},timelineUnitSize:99,level:7,timelineViewMode:"Year",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yy",count:1},bottomTier:{unit:"Week",format:"dd",count:1},timelineUnitSize:33,level:8,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:66,level:9,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Month",format:"MMM, yyyy",count:1},bottomTier:{unit:"Week",format:"dd MMM",count:1},timelineUnitSize:99,level:10,timelineViewMode:"Month",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:33,level:11,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:66,level:12,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Week",format:"MMM dd, yyyy",count:1},bottomTier:{unit:"Day",format:"d",count:1},timelineUnitSize:99,level:13,timelineViewMode:"Week",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:66,level:14,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:12},timelineUnitSize:99,level:15,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:66,level:16,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:6},timelineUnitSize:99,level:17,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:66,level:18,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:2},timelineUnitSize:99,level:19,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:66,level:20,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Day",format:"E dd yyyy",count:1},bottomTier:{unit:"Hour",format:"hh a",count:1},timelineUnitSize:99,level:21,timelineViewMode:"Day",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:30},timelineUnitSize:66,level:22,timelineViewMode:"Hour",weekStartDay:0,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:15},timelineUnitSize:66,level:23,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0},{topTier:{unit:"Hour",format:"ddd MMM, h a",count:1},bottomTier:{unit:"Minutes",format:"mm",count:1},timelineUnitSize:66,level:24,timelineViewMode:"Hour",weekStartDay:e,updateTimescaleView:!0,weekendBackground:t,showTooltip:!0}]},m.prototype.displayQuarterValue=function(e){e=e.getMonth();return 0<=e&&e<=2?"Q1":3<=e&&e<=5?"Q2":6<=e&&e<=8?"Q3":"Q4"},m.prototype.displayHalfValue=function(e){e=e.getMonth();return 0<=e&&e<=5?"H1":"H2"},m.prototype.getFormatedDate=function(e,t){return ne.isNullOrUndefined(e)?null:(ne.isNullOrUndefined(t)&&(t=this.getDateFormat()),this.globalize.formatDate(e,{format:t}))},m.prototype.getDurationString=function(e,t){return this.dateValidationModule.getDurationString(e,t)},m.prototype.getWorkString=function(e,t){return this.dateValidationModule.getWorkString(e,t)},m.prototype.updateTreeColumns=function(){var e,t=this.treeGrid.grid.getColumns();-1!==this.treeColumnIndex&&this.columns[this.treeColumnIndex]&&!ne.isNullOrUndefined(this.columns[this.treeColumnIndex].template)&&(e=this.columns[this.treeColumnIndex].template);for(var i=0;i<t.length;i++)for(var a={},n=0;n<this.columns.length;n++)if(this.columns[n].field===t[i].field){for(var r=0,s=Object.keys(this.columns[n]);r<s.length;r++){var o=s[r];ne.isUndefined(this.columns[n][o])||(a[o]=t[i][o]),a.visible=t[i].visible,a.width=t[i].width}this.columns[n]=a,"checkbox"===this.columns[n].type||ne.isNullOrUndefined(e)||""===e||(this.columns[n].template=e)}0<this.columns.length&&this.treeGrid.setProperties({columns:this.columns},!0)},m.prototype.validateCycles=function(){var e;this.cyclicValidator.buildMaps(),this.cyclicValidator.resolve(),0<this.cyclicValidator.cycles.length&&(e=this.cyclicValidator.getCyclesWithDetails(this.cyclicValidator.cycles),this.trigger("actionFailure",{error:e})),this.regenerateCycles=!1},m.prototype.treeDataBound=function(e){var r=this,t=(this.isLoad&&this.undoRedoModule&&(0<this.sortSettings.columns.length?this.undoRedoModule.previousSortedColumns=this.sortSettings.columns:""!==this.searchSettings.key&&(this.undoRedoModule.searchString=this.searchSettings.key)),this.chartRowsModule.isGridRowRefreshed=!1,this.element.getElementsByClassName("e-chart-root-container")[0].style.height="100%",this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0]);t.setAttribute("tabindex","0"),t.classList.add("e-yscroll");this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].childNodes[0].setAttribute("role","treegrid");var t=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight,i=this.element.getElementsByClassName("e-chart-scroll-container e-content")[0];i.style.height="calc(100% - "+t+"px)",i.setAttribute("tabindex","0"),this.filterSettings&&this.filterSettings.properties&&this.filterSettings.properties.columns&&this.filterSettings.properties.columns.forEach(function(e){for(var t=e.properties.field,i=null,a=0;a<r.treeGrid.columns.length;a++){var n=r.treeGrid.columns[a];if(n.field===t){i=n;break}}i&&e.properties.uid!==i.uid&&(e.properties.uid=i.uid)}),this.regenerateCycles&&"ProjectView"===this.viewType&&this.allowParentDependency&&this.validateCycles(),this.isLoad?(this.enablePersistence&&this.updateTreeColumns(),this.updateCurrentViewData(),this.enableVirtualization?this.virtualScrollModule&&this.enableVirtualization&&(this.ganttChartModule.virtualRender.adjustTable(),this.ganttChartModule.scrollObject.updateTopPosition()):this.updateContentHeight(),this.isTreeGridRendered||(this.isTreeGridRendered=!0,this.timelineModule.isSingleTier?this.element.classList.add(pe):this.element.classList.remove(pe),t=this.element.getElementsByClassName("e-timeline-header-container")[0].offsetHeight,i.style.height="calc(100% - "+t+"px)",this.treeGrid.setProperties({height:"100%"},!1),this.notify("tree-grid-created",{}),this.createGanttPopUpElement(),this.hideLoadingIndicator(),ne.setValue("isGanttCreated",!0,e),this.renderComplete())):this.getCurrentRecords(e),this.loadChildOnDemand&&this.taskFields.hasChildMapping&&this.updateContentHeight(),this.enableCriticalPath&&this.criticalPathModule&&this.criticalPathModule.showCriticalPath(this.enableCriticalPath),this.notify("recordsUpdated",{});for(var a=0;a<document.getElementsByClassName("e-timeline-header-table-container").length;a++)for(var n=0;n<document.getElementsByClassName("e-timeline-header-table-container")[a].children[0].children[0].children.length;n++){var s=document.getElementsByClassName("e-timeline-header-table-container")[a].children[0].children[0].children[n].children[0];s&&s.setAttribute("tabindex","-1")}i=this.criticalPathModule;this.enableCriticalPath&&i&&i.criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(i.criticalPathCollection,i.detailPredecessorCollection,!0,i.predecessorCollectionTaskIds),this.initialChartRowElements=this.ganttChartModule.getChartRows(),this.isExpandPerformed=!!this.enableVirtualization&&this.isExpandPerformed,this.isExpandPerformed||this.isVirtualScroll||!this.undoRedoModule||(this.previousFlatData=ne.extend([],this.flatData,[],!0)),this.undoRedoModule&&0!==Object.keys(this.undoRedoModule.undoActionDetails).length&&("RowDragAndDrop"===(t=this.undoRedoModule.undoActionDetails).action||"TaskbarDragAndDrop"===t.action?(this.undoRedoModule.isUndoRedoPerformed=!0,t.beforeDrop.forEach(function(e){r.updateRecordByID(e.data)}),"child"===t.afterDrop.dropPosition&&this.updateRecordByID(t.afterDrop.dropRecord)):"Outdent"!==t.action&&"Indent"!==t.action||this.updateRecordByID(t.droppedRecord),this.undoRedoModule.undoActionDetails={}),this.undoRedoModule&&this.undoRedoModule.isPreventRowDeselectOnUndoRedo&&(this.undoRedoModule.isPreventRowDeselectOnUndoRedo=!1),this.undoRedoModule&&this.undoRedoModule.isUndoRedoPerformed&&(this.undoRedoModule.isUndoRedoPerformed=!1),this.trigger("dataBound",e)},m.prototype.getCurrentRecords=function(e){this.predecessorModule&&this.taskFields.dependency&&this.connectorLineModule.removePreviousConnectorLines(this.currentViewData),this.updateCurrentViewData(),this.enableVirtualization||this.updateContentHeight(),this.virtualScrollModule&&this.enableVirtualization&&(this.ganttChartModule.virtualRender.adjustTable(),this.ganttChartModule.scrollObject.updateTopPosition())},m.prototype.handleTaskSchedulingChanges=function(e,t,i){var a=!1,a=("calendarSettings"===e&&t[e].projectCalendar&&(t[e].projectCalendar.workingTime||t[e].projectCalendar.exceptions)&&(a=!0),"calendarSettings"===e&&Array.isArray(t[e].taskCalendars)&&(a=!0),"dayWorkingTime"!==e&&"weekWorkingTime"!==e&&"enableHover"!==e&&!a||(i.isRefresh=!0),!1);"calendarSettings"===e&&t[e].projectCalendar&&t[e].projectCalendar.holidays&&(a=!0),("includeWeekend"===e||"allowUnscheduledTasks"===e||"holidays"===e||a)&&(this.isLoad=!0,"holidays"!==e&&!a||(this.totalHolidayDates=this.dataOperation.getHolidayDates(e),a&&(t.holidays=t[e].projectCalendar.holidays),this.notify("ui-update",{module:"day-markers",properties:t})),this.dataOperation.reUpdateGanttData(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isLoad=!1,this.taskFields.dependency)&&(this.predecessorModule.updatedRecordsDateByPredecessor(),this.treeGrid.refreshColumns(),this.chartRowsModule.refreshGanttRows())},m.prototype.onPropertyChanged=function(e,t){for(var i={isRefresh:!1},a=0,n=Object.keys(e);a<n.length;a++){var r,s=n[a];switch(s){case"allowSelection":case"allowRowDragAndDrop":case"allowFiltering":case"showColumnMenu":case"allowResizing":case"allowReordering":case"allowSorting":case"enableImmutableMode":this.treeGrid[s]=this[s],this.treeGrid.dataBind();break;case"enableVirtualization":this.enableVirtualization&&(this.treeGrid.grid.enableSeamlessScrolling=!1),i.isRefresh=!0;break;case"workWeek":this.dataOperation.getNonWorkingDayIndex(),this.dataOperation.reUpdateGanttData(),this.chartRowsModule.initiateTemplates(),this.taskFields.dependency&&this.predecessorModule.updatedRecordsDateByPredecessor(),this.chartRowsModule.refreshGanttRows(),this.treeGrid.refreshColumns(),this.timelineModule.refreshTimeline();break;case"toolbar":this.notify("ui-toolbarupdate",{module:"toolbar",properties:e});break;case"columnMenuItems":this.treeGrid.grid.columnMenuItems=T.getActualProperties(this.columnMenuItems);break;case"eventMarkers":case"highlightWeekends":this.notify("ui-update",{module:"day-markers",properties:e});break;case"sortSettings":this.treeGrid.sortSettings=T.getActualProperties(this.sortSettings),this.treeGrid.dataBind();break;case"timelineSettings":this.isTimelineRoundOff=!this.timelineModule.isZoomToFit&&!("auto"!==this.timelineSettings.viewEndDate||"auto"!==this.timelineSettings.viewStartDate||!ne.isNullOrUndefined(this.projectStartDate)),this.timelineModule.refreshTimeline(),this.enableTimelineVirtualization&&(!this.undoRedoModule||this.undoRedoModule&&!this.undoRedoModule.isZoomingUndoRedoProgress)&&(i.isRefresh=!0),this.undoRedoModule&&this.undoRedoModule.isZoomingUndoRedoProgress&&(this.undoRedoModule.isZoomingUndoRedoProgress=!1);break;case"rowHeight":case"taskbarHeight":this.treeGrid.rowHeight=this.rowHeight,this.treeGrid.dataBind(),this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines();break;case"timezone":case"durationUnit":this.isLoad=!0,this.dataOperation.checkDataBinding(!0);break;case"enableCriticalPath":this.hideLoadingIndicator(),this.enableCriticalPath&&this.criticalPathModule?(this.criticalPathModule.showCriticalPath(this.enableCriticalPath),(r=this.criticalPathModule).criticalPathCollection&&this.criticalPathModule.criticalConnectorLine(r.criticalPathCollection,r.detailPredecessorCollection,!0,r.predecessorCollectionTaskIds)):this.removeCriticalPathStyles();break;case"filterSettings":ne.isNullOrUndefined(e.filterSettings)&&(this.filterSettings.columns=[]),this.treeGrid.filterSettings=T.getActualProperties(this.filterSettings),this.treeGrid.dataBind();break;case"gridLines":this.treeGrid.gridLines=this.gridLines,this.treeGrid.dataBind(),this.renderChartGridLines();break;case"tooltipSettings":this.tooltipModule.toolTipObj&&this.tooltipModule.toolTipObj.destroy(),this.tooltipModule.createTooltip();break;case"splitterSettings":e.splitterSettings.position?this.splitterUpdateType="position":e.splitterSettings.columnIndex&&(this.splitterUpdateType="columnIndex"),this.splitterModule.updateSplitterPosition(),this.splitterUpdateType=null;break;case"selectionSettings":this.treeGrid.selectionSettings=T.getActualProperties(this.selectionSettings),this.treeGrid.grid.selectionSettings.enableToggle=this.selectionSettings.enableToggle,this.treeGrid.dataBind();break;case"searchSettings":void 0!==e.searchSettings.key&&(this.treeGrid.grid.searchSettings=T.getActualProperties(this.searchSettings),this.treeGrid.grid.dataBind()),this.treeGrid.searchSettings=T.getActualProperties(this.searchSettings),this.treeGrid.dataBind(),this.toolbarModule&&this.toolbarModule.updateSearchTextBox();break;case"labelSettings":case"renderBaseline":case"baselineColor":this.isFromRenderBaseline=!0,this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows(),this.isFromRenderBaseline=!1;break;case"resourceIDMapping":case"resourceNameMapping":case"resources":this.dataOperation.reUpdateResources(),this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.chartRowsModule.refreshGanttRows();break;case"includeWeekend":case"allowUnscheduledTasks":case"holidays":case"calendarSettings":case"dayWorkingTime":case"weekWorkingTime":case"enableHover":this.skipOffsetUpdate=!0,this.handleTaskSchedulingChanges(s,e,i);break;case"addDialogFields":case"editDialogFields":this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.processDialogFields();break;case"columns":this.isFrozenGrid()?i.isRefresh=!0:(this.treeGridModule.treeGridColumns=[],this.treeGridModule.validateGanttColumns(),this.editModule&&this.editModule.updateDefaultColumnEditors(),this.treeGrid.columns=this.treeGridModule.treeGridColumns,this.treeGrid.refreshColumns(),this.chartRowsModule.initiateTemplates(),this.timelineModule.updateChartByNewTimeline());break;case"width":case"height":this.reUpdateDimention(s);break;case"editSettings":this.treeGrid.editSettings.allowAdding=this.editSettings.allowAdding,this.treeGrid.editSettings.allowDeleting=this.editSettings.allowDeleting,this.treeGrid.editSettings.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,this.treeGrid.editSettings.allowEditing=this.editSettings.allowEditing,this.treeGrid.editSettings.allowNextRowEdit=this.editSettings.allowNextRowEdit,ne.isNullOrUndefined(this.editModule)||this.editModule.reUpdateEditModules(),ne.isNullOrUndefined(this.toolbarModule)||this.toolbarModule.refreshToolbarItems();break;case"allowPdfExport":case"allowExcelExport":ne.isNullOrUndefined(this.toolbarModule)||this.toolbarModule.refreshToolbarItems();break;case"connectorLineBackground":case"connectorLineWidth":this.taskFields.dependency&&(this.connectorLineModule.initPublicProp(),this.ganttChartModule.reRenderConnectorLines());break;case"treeColumnIndex":this.treeGrid.treeColumnIndex=this.treeColumnIndex;break;case"projectStartDate":case"projectEndDate":this.timelineModule.isZoomToFit=!1,this.dataOperation.calculateProjectDates(),this.isTimelineRoundOff=!this.timelineModule.isZoomToFit&&!("auto"!==this.timelineSettings.viewEndDate||"auto"!==this.timelineSettings.viewStartDate||!ne.isNullOrUndefined(this.projectStartDate)),this.updateProjectDates(this.cloneProjectStartDate,this.cloneProjectEndDate,this.isTimelineRoundOff);break;case"selectedRowIndex":ne.isNullOrUndefined(this.selectionModule)||this.selectionModule.selectRowByIndex();break;case"dataSource":this.isLoad=!0,this.isReact&&this.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","BaselineTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.closeGanttActions(),this.dataSource instanceof Object&&H(this)?(this.treeGrid.hasChildMapping="isParent",r=ne.getValue("count",this.dataSource),this.treeGrid.dataSource={result:this.flatData,count:r}):this.treeGrid.hasChildMapping=null,this.isDynamicDataUpdate=!0,this.dataOperation.checkDataBinding(!0);break;case"enableContextMenu":case"contextMenuItems":this.enableContextMenu||"contextMenuItems"===s?this.notify("reRender-contextMenu",{module:"contextMenu",enable:!0}):this.treeGrid.contextMenuItems=[],this.treeGrid.dataBind();break;case"currencyCode":case"locale":case"enableRtl":case"readOnly":case"viewType":case"taskFields":case"allowTaskbarDragAndDrop":case"allowTaskbarOverlap":case"allowParentDependency":case"enableMultiTaskbar":case"autoUpdatePredecessorOffset":if("locale"===s&&(this.isLocaleChanged=!0),"taskFields"===s&&!ne.isNullOrUndefined(e.taskFields.child))return;"allowTaskbarDragAndDrop"!==s&&(i.isRefresh=!0);break;case"validateManualTasksOnLinking":this.validateManualTasksOnLinking=e.validateManualTasksOnLinking;break;case"showOverAllocation":this.updateOverAllocationCotainer();break;case"emptyRecordTemplate":this.treeGrid.emptyRecordTemplate=this.emptyRecordTemplate;break;case"frozenColumns":this.treeGrid.frozenColumns=this.frozenColumns,i.isRefresh=!0}}i.isRefresh&&(this.isLoad&&this.contentMaskTable&&(this.contentMaskTable=null),this.refresh())},m.prototype.updateOverAllocationCotainer=function(){var e;this.showOverAllocation?this.ganttChartModule.renderOverAllocationContainer():(e=this.element.querySelector("."+St))&&(e.innerHTML="")},m.prototype.getPersistData=function(){for(var e=["sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","currentZoomingLevel","cloneProjectStartDate","cloneProjectEndDate","splitterSettings","cloneTimelineStartDate","cloneTimelineEndDate"],t={filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[]},i=0;i<e.length;i++)for(var a=this[e[i]],n=0,r=t[e[i]];!ne.isNullOrUndefined(r)&&n<r.length;n++)delete a[r[n]];return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},m.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)this.ignoreInColumn(e,t[i])},m.prototype.ignoreInColumn=function(e,t){for(var i=0;i<e.length;i++)delete t[e[i]],t.filter={}},m.prototype.destroy=function(){this.notify("destroy",{}),this.unwireEvents(),ne.isNullOrUndefined(this.validationDialogElement)||this.validationDialogElement.isDestroyed||this.validationDialogElement.destroy();for(var e=["ganttChartModule","timelineModule","chartRowsModule","treeGridModule","ganttDataUpdatesModule","dateValidationModule","tooltipModule"],t=0;t<e.length;t++)this[e[t]]&&(this[e[t]]=null);this.keyboardModule&&this.keyboardModule.destroy(),this.editModule&&this.editModule.dialogModule&&this.editModule.dialogModule.destroy(),this.splitterModule&&this.splitterModule.destroy(),this.toolbarModule&&this.toolbarModule.toolbar&&this.toolbarModule.toolbar.destroy(),ne.isNullOrUndefined(this.dayMarkersModule)||(ne.isNullOrUndefined(this.dayMarkersModule.eventMarkerRender)||ne.isNullOrUndefined(this.dayMarkersModule.eventMarkerRender.eventMarkersContainer)||(this.dayMarkersModule.eventMarkerRender.eventMarkersContainer=null),ne.isNullOrUndefined(this.dayMarkersModule.nonworkingDayRender))||(ne.isNullOrUndefined(this.dayMarkersModule.nonworkingDayRender.nonworkingContainer)||(this.dayMarkersModule.nonworkingDayRender.nonworkingContainer=null),ne.isNullOrUndefined(this.dayMarkersModule.nonworkingDayRender.weekendContainer)||(this.dayMarkersModule.nonworkingDayRender.weekendContainer=null),ne.isNullOrUndefined(this.dayMarkersModule.nonworkingDayRender.holidayContainer))||(this.dayMarkersModule.nonworkingDayRender.holidayContainer=null),this.connectorLineModule&&(this.connectorLineModule.dependencyViewContainer=null,this.connectorLineModule.svgObject=null,this.connectorLineModule.renderer=null,this.connectorLineModule.tooltipTable=null),this.treeGridPane=null,this.chartPane=null,this.initialChartRowElements=null,Ua.prototype.destroy.call(this),this.chartVerticalLineContainer=null,this.element.innerHTML="",ne.removeClass([this.element],de),this.element.innerHTML="",this.isTreeGridRendered=!1,this.dataOperation.isHavingUnscheduledTaskOnLoad=!1,this.resetTemplates(),this.dataOperation.uid=null},m.prototype.getTaskbarHeight=function(){return this.chartRowsModule.taskBarHeight},m.prototype.requiredModules=function(){var e=[],t=this.calendarModule.holidays;return!this.isDestroyed&&(this.allowSorting&&e.push({member:"sort",args:[this]}),(this.allowFiltering||this.toolbar&&-1!==this.toolbar.indexOf("Search"))&&e.push({member:"filter",args:[this]}),this.allowReordering&&e.push({member:"reorder",args:[this]}),this.allowExcelExport&&e.push({member:"excelExport",args:[this]}),(this.allowRowDragAndDrop||this.allowTaskbarDragAndDrop)&&e.push({member:"rowDragAndDrop",args:[this]}),this.enableCriticalPath&&e.push({member:"criticalPath",args:[this]}),this.enableUndoRedo&&e.push({member:"undoRedo",args:[this]}),this.allowResizing&&e.push({member:"resize",args:[this]}),this.toolbar&&0<this.toolbar.length&&e.push({member:"toolbar",args:[this]}),(this.editSettings.allowAdding||this.editSettings.allowEditing||this.editSettings.allowDeleting||this.editSettings.allowTaskbarEditing||this.allowRowDragAndDrop)&&e.push({member:"edit",args:[this]}),this.allowSelection&&e.push({member:"selection",args:[this]}),this.tooltipSettings.showTooltip&&e.push({member:"tooltip",args:[this]}),(this.highlightWeekends||t&&0<t.length||this.eventMarkers&&0<this.eventMarkers.length)&&e.push({member:"dayMarkers",args:[this]}),this.enableContextMenu&&e.push({member:"contextMenu",args:[this]}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this]}),this.allowPdfExport&&e.push({member:"pdfExport",args:[this]}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this]}),t=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze}),this.frozenColumns||t||this.getFrozenColumnsCount())&&e.push({member:"freeze",args:[this]}),e},m.prototype.sortColumn=function(e,t,i){this.sortModule&&this.allowSorting&&this.sortModule.sortColumn(e,t,i)},m.prototype.mergePersistGanttData=function(){this.treeGrid||(this.treeGrid=new b.TreeGrid);this.treeGrid.grid.mergePersistGridData.apply(this)},m.prototype.mergeColumns=function(e,t){this.treeGrid.grid.mergeColumns.apply(this,[e,t])},m.prototype.setFrozenCount=function(){this.treeGrid.grid.setFrozenCount.apply(this)},m.prototype.splitFrozenCount=function(e){this.treeGrid.grid.splitFrozenCount.apply(this,[e])},m.prototype.isFrozenGrid=function(){var e,t=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return e=this.frozenColumns||t||this.getFrozenColumnsCount()?!0:e},m.prototype.removeBorder=function(e){this.treeGrid.grid.removeBorder.apply(this,[e])},m.prototype.frozenLeftBorderColumns=function(e){this.treeGrid.grid.frozenLeftBorderColumns.apply(this,[e])},m.prototype.frozenRightBorderColumns=function(e){this.treeGrid.grid.frozenRightBorderColumns.apply(this,[e])},m.prototype.clearSorting=function(){this.sortModule.clearSorting()},m.prototype.renderChartGridLines=function(){var e="e-chart-row-border",t=this.chartVerticalLineContainer,i=document.getElementById(this.element.id+"GanttTaskTableBody").querySelectorAll("td");if("Vertical"===this.gridLines){if(ne.isNullOrUndefined(t)||this.enableInfiniteTimelineScroll?this.renderChartVerticalLines():"none"===window.getComputedStyle(t).display&&(t.style.display="block"),i&&0<i.length&&i[0].classList.contains(e))for(var a=0;a<i.length;a++)ne.removeClass([i[a]],e)}else if("Horizontal"===this.gridLines){if(ne.isNullOrUndefined(t)||(t.style.display="none"),i&&0<i.length&&!i[0].classList.contains(e))for(a=0;a<i.length;a++)ne.addClass([i[a]],e)}else if("Both"===this.gridLines){if(ne.isNullOrUndefined(t)||this.enableInfiniteTimelineScroll?this.renderChartVerticalLines():"none"===window.getComputedStyle(t).display&&(t.style.display="block"),i&&0<i.length&&!i[0].classList.contains(e))for(a=0;a<i.length;a++)ne.addClass([i[a]],e)}else if("None"===this.gridLines&&(ne.isNullOrUndefined(t)||"none"===window.getComputedStyle(t).display||(t.style.display="none"),i)&&0<i.length&&i[0].classList.contains(e))for(a=0;a<i.length;a++)ne.removeClass([i[a]],e)},m.prototype.updateGridLineContainerHeight=function(){this.chartVerticalLineContainer&&(this.chartVerticalLineContainer.style.height=ne.formatUnit(this.getContentHeight()))},m.prototype.getContentHeight=function(){var e=this.ganttChartModule.scrollElement.offsetHeight-16,t=this.ganttChartModule.chartBodyContent.offsetHeight;return t<e?t:e},m.prototype.reUpdateDimention=function(e){var t,i,a,n=0;this.calculateDimensions(),ne.isNullOrUndefined(this.toolbarModule)||ne.isNullOrUndefined(this.toolbarModule.element)||(this.toolbarModule.refreshToolbarItems(),n=this.toolbarModule.element.offsetHeight),this.treeGrid.height=this.ganttHeight-n-this.treeGrid.grid.getHeaderContent().offsetHeight,this.splitterModule.splitterObject.height=(this.ganttHeight-n).toString(),ne.isNullOrUndefined(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer.style.height=this.ganttHeight+"px"),ne.isNullOrUndefined(this.dayMarkersModule)||(t=ne.getValue("nonworkingDayRender.holidayContainer",this.dayMarkersModule),i=ne.getValue("nonworkingDayRender.weekendContainer",this.dayMarkersModule),a=ne.getValue("eventMarkerRender.eventMarkersContainer",this.dayMarkersModule),t&&(t.style.height=this.ganttHeight+"px"),i&&(i.style.height=this.ganttHeight+"px"),a&&(a.style.height=this.ganttHeight+"px")),"width"===e&&(this.splitterModule.splitterObject.width=this.ganttWidth.toString()),this.ganttChartModule.scrollObject.setHeight(this.ganttHeight-this.ganttChartModule.chartTimelineContainer.offsetHeight-n)},m.prototype.renderChartVerticalLines=function(){this.element.contains(this.chartVerticalLineContainer)||(this.chartVerticalLineContainer=ne.createElement("div",{id:this.element.id+"line-container",styles:"position:absolute;height:100%;"}),this.ganttChartModule.chartBodyContent.insertBefore(this.chartVerticalLineContainer,this.ganttChartModule.chartBodyContent.lastChild)),this.chartVerticalLineContainer.innerHTML="";for(var e=this.element.getElementsByClassName("e-timeline-header-table-container")[1],t=(e=ne.isNullOrUndefined(e)?this.element.getElementsByClassName("e-timeline-header-table-container")[0]:e).getElementsByTagName("th"),i=t.length,a=0,n=ne.createElement("div"),r=0;r<i;r++){var a=0===r?-1:a+parseFloat(s),s=t[r].style.width,o=ne.createElement("div",{className:"e-line-container-cell",styles:(this.enableRtl?"right:"+(a+1):"left:"+(-1!==a?a+.3:a))+"px"});n.appendChild(o)}for(;n.firstChild;)this.chartVerticalLineContainer.appendChild(n.firstChild)},m.prototype.getDefaultLocale=function(){return{emptyRecord:"No records to display",id:"ID",name:"Name",startDate:"Start Date",endDate:"End Date",constraintDate:"Constraint Date",constraintType:"Constraint Type",advancedTab:"Advanced",duration:"Duration",progress:"Progress",dependency:"Dependency",notes:"Notes",criticalPath:"Critical Path",undo:"Undo",redo:"Redo",baselineStartDate:"Baseline Start Date",baselineEndDate:"Baseline End Date",baselineDuration:"Baseline Duration",taskMode:"Task Mode",changeScheduleMode:"Change Schedule Mode",subTasksStartDate:"SubTasks Start Date",subTasksEndDate:"SubTasks End Date",scheduleStartDate:"Schedule Start Date",scheduleEndDate:"Schedule End Date",auto:"Auto",manual:"Manual",type:"Type",offset:"Offset",resourceName:"Resources",resourceID:"Resource ID",day:"day",hour:"hour",minute:"minute",days:"days",hours:"hours",minutes:"minutes",generalTab:"General",customTab:"Custom Columns",writeNotes:"Write Notes",addDialogTitle:"New Task",editDialogTitle:"Task Information",add:"Add",edit:"Edit",update:"Update",delete:"Delete",cancel:"Cancel",search:"Search",task:" task",tasks:" tasks",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomToFit:"Zoom to fit",excelExport:"Excel export",csvExport:"CSV export",pdfExport:"PDF export",expandAll:"Expand all",collapseAll:"Collapse all",nextTimeSpan:"Next timespan",prevTimeSpan:"Previous timespan",saveButton:"Save",cancelLink:"Cancel, keep the existing link",removeLink:'Remove the link and move "{0}" to start on "{1}".',removeConstraint:'Remove {0} constraint of task "{1}"',preserveLink:'Move the "{0}" to start on "{1}" and keep the link.',removeDependency:'Remove dependency from "{0}" to "{1}"',cancelChange:"Cancel the change and do nothing",validateEditing:"Validate Editing",schedulingConflicts:"Scheduling conflict",constraintTypeAsSoonAsPossible:"As Soon As Possible",constraintTypeAsLateAsPossible:"As Late As Possible",constraintTypeMustStartOn:"Must Start On",constraintTypeMustFinishOn:"Must Finish On",constraintTypeStartNoEarlierThan:"Start No Earlier Than",constraintTypeStartNoLaterThan:"Start No Later Than",constraintTypeFinishNoEarlierThan:"Finish No Earlier Than",constraintTypeFinishNoLaterThan:"Finish No Later Than",taskBeforePredecessorFS:'You moved "{0}" to start before "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorFS:'You moved "{0}" away from "{1}" and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorSS:'You moved "{0}" to start before "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorSS:'You moved "{0}" to start after "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorFF:'You moved "{0}" to finish before "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorFF:'You moved "{0}" to finish after "{1}" finishes and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskBeforePredecessorSF:'You moved "{0}" away from "{1}" to starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',taskAfterPredecessorSF:'You moved "{0}" to finish after "{1}" starts and the two tasks are linked.As the result, the links cannot be honored. Select one action below to perform',okText:"OK",confirmDelete:"Are you sure you want to Delete Record?",from:"From",to:"To",taskLink:"Task Link",lag:"Lag",start:"Start",finish:"Finish",enterValue:"Enter the value",taskInformation:"Task Information",deleteTask:"Delete Task",deleteDependency:"Delete Dependency",convert:"Convert",save:"Save",above:"Above",below:"Below",child:"Child",milestone:"Milestone",toTask:"To Task",toMilestone:"To Milestone",eventMarkers:"Event markers",leftTaskLabel:"Left task label",rightTaskLabel:"Right task label",timelineCell:"Timeline cell",confirmPredecessorDelete:"Are you sure you want to remove dependency link?",unit:"Unit",work:"Work",taskType:"Task Type",unassignedTask:"Unassigned Task",group:"Group",indent:"Indent",outdent:"Outdent",segments:"Segments",splitTask:"Split Task",mergeTask:"Merge Task",left:"Left",right:"Right",FF:"FF",FS:"FS",SF:"SF",SS:"SS"}},m.prototype.removeSortColumn=function(e){this.sortModule.removeSortColumn(e)},m.prototype.actionBeginTask=function(e){this.trigger("actionBegin",e),ne.getValue("cancel",e)||this.showLoadingIndicator()},m.prototype.scrollToDate=function(e){e=this.dateValidationModule.getDateFromFormat(e),e=this.dataOperation.getTaskLeft(e,!1,this.defaultCalendarContext);this.ganttChartModule.updateScrollLeft(e)},m.prototype.scrollToTask=function(e){-1!==this.ids.indexOf(e)&&(e=this.flatData[this.ids.indexOf(e)].ganttProperties.left,this.ganttChartModule.updateScrollLeft(e))},m.prototype.updateChartScrollOffset=function(e,t){ne.isNullOrUndefined(e)||(e=this.ganttChartModule.scrollElement.scrollWidth<=e?this.ganttChartModule.scrollElement.scrollWidth:e,this.ganttChartModule.scrollObject.setScrollLeft(e,this.enableRtl?-1:0)),ne.isNullOrUndefined(t)||(t=this.ganttChartModule.scrollElement.scrollHeight<=t?this.ganttChartModule.scrollElement.scrollHeight:t,this.ganttChartModule.scrollObject.setScrollTop(t))},m.prototype.getParentTask=function(t,e){if(ne.isNullOrUndefined(t))return null;if(e&&0<e.size){e=e.get(t.uniqueID);if(e)return e}if(!this.autoCalculateDateScheduling&&this.dataMap&&0<this.dataMap.size&&!this.taskFields.hasChildMapping&&this.isLoad){e=this.dataMap.get(t.uniqueID);if(e)return e}return this.flatData.find(function(e){return t.uniqueID===e.uniqueID})||null},m.prototype.getRootParent=function(e,t){return e.level===t?e:this.getRootParent(this.getParentTask(e.parentItem),t)},m.prototype.filterByColumn=function(e,t,i,a,n,r){this.closeGanttActions(),this.treeGrid.filterByColumn(e,t,i,a,n,r)},m.prototype.refreshColumns=function(e){this.treeGrid.refreshColumns(e)},m.prototype.excelExport=function(e,t,i,a){return this.excelExportModule?this.treeGrid.excelExport(e,t,i,a):null},m.prototype.csvExport=function(e,t,i,a){return this.excelExportModule?this.treeGrid.csvExport(e,t,i,a):null},m.prototype.pdfExport=function(e,t,i,a){return this.pdfExportModule?this.pdfExportModule.export(e,t,i,a):null},m.prototype.clearFiltering=function(e){this.closeGanttActions(),this.treeGrid.grid.clearFiltering(e)},m.prototype.removeFilteredColsByField=function(e){this.treeGrid.removeFilteredColsByField(e,!1)},m.prototype.renderWorkingDayCell=function(e){var t,i=!1,a=!1,i="Auto"!==this.taskMode&&"Custom"!==this.taskMode||!(!this.includeWeekend&&this.autoCalculateDateScheduling),n=("Custom"===this.taskMode&&this.taskFields.manual&&((n=this.editModule)&&n.cellEditModule&&n.cellEditModule.isCellEdit?a=n.cellEditModule.currentEditedRowData[this.taskFields.manual]:n&&n.dialogModule&&n.dialogModule.isEdit&&(a=n.dialogModule.editedRecord[this.taskFields.manual]),i=a||this.includeWeekend||!this.autoCalculateDateScheduling),i?[]:this.nonWorkingDayIndex),a=null,i=this.editModule,i=(i&&(i.cellEditModule&&i.cellEditModule.isCellEdit&&i.cellEditModule.currentEditedRowData&&i.cellEditModule.currentEditedRowData.ganttProperties&&i.cellEditModule.currentEditedRowData.ganttProperties.calendarContext?(t=i.cellEditModule.currentEditedRowData.ganttProperties,a=i.cellEditModule.currentEditedRowData.ganttProperties.calendarContext):i.dialogModule&&i.dialogModule.editedRecord&&i.dialogModule.editedRecord.ganttProperties&&i.dialogModule.editedRecord.ganttProperties.calendarContext&&(t=i.dialogModule.editedRecord.ganttProperties,a=i.dialogModule.editedRecord.ganttProperties.calendarContext)),(a||this.defaultCalendarContext).defaultHolidays);0<n.length&&-1!==n.indexOf(e.date.getDay())?e.isDisabled=!0:0<i.length&&((n=new Date(e.date.getTime())).setHours(0,0,0),-1!==i.indexOf(n.getTime()))&&(!this.autoCalculateDateScheduling||this.isLoad&&!this.treeGrid.loadChildOnDemand&&this.taskFields.hasChildMapping?e.isDisabled=!1:e.isDisabled=!0),a&&(a.getExceptionForDate(e.date)||t.isMilestone&&e.isDisabled&&t.startDate&&t.startDate.getTime()===e.date.getTime())&&(e.isDisabled=!1)},m.prototype.previousTimeSpan=function(e){var t;this.isReact&&this.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","BaselineTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.undoRedoModule&&this.isUndoRedoItemPresent("PreviousTimeSpan")&&(this.undoRedoModule.redoEnabled&&this.undoRedoModule.disableRedo(),this.undoRedoModule.createUndoCollection(),(t={action:"PreviousTimeSpan"}).previousTimelineStartDate=ne.extend([],[],[this.timelineModule.timelineStartDate],!0)[0],t.previousTimelineEndDate=ne.extend([],[],[this.timelineModule.timelineEndDate],!0)[0],this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1]=t),this.timelineModule.performTimeSpanAction("prevTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},m.prototype.nextTimeSpan=function(e){var t;this.isReact&&this.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","BaselineTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate"]),this.undoRedoModule&&this.isUndoRedoItemPresent("NextTimeSpan")&&(this.undoRedoModule.redoEnabled&&this.undoRedoModule.disableRedo(),this.undoRedoModule.createUndoCollection(),(t={action:"NextTimeSpan"}).previousTimelineStartDate=ne.extend([],[],[this.timelineModule.timelineStartDate],!0)[0],t.previousTimelineEndDate=ne.extend([],[],[this.timelineModule.timelineEndDate],!0)[0],this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1]=t),this.timelineModule.performTimeSpanAction("nextTimeSpan","publicMethod",new Date(this.timelineModule.timelineStartDate.getTime()),new Date(this.timelineModule.timelineEndDate.getTime()),e)},m.prototype.removeCalendarContext=function(e){return e&&(e.calendarContext,Na(e,["calendarContext"]))},m.prototype.updateProjectDates=function(e,t,i,a){this.timelineModule.totalTimelineWidth=0,this.cloneProjectStartDate=e,this.cloneProjectEndDate=t,this.isTimelineRoundOff=i,this.updateTimelineDates(this.cloneProjectStartDate,this.cloneProjectEndDate,i,a)},m.prototype.updateTimelineDates=function(e,t,i,a){this.timelineModule.totalTimelineWidth=0,this.cloneTimelineStartDate=new Date(e),this.cloneTimelineEndDate=new Date(t),this.isTimelineRoundOff=i,this.timelineModule.refreshTimelineByTimeSpan(),this.dataOperation.reUpdateGanttDataPosition(),(!this.pdfExportModule||this.pdfExportModule&&!this.pdfExportModule.isPdfExport||this.pdfExportModule&&this.pdfExportModule.isPdfExport&&this.pdfExportModule.helper.exportProps&&this.pdfExportModule.helper.exportProps.fitToWidthSettings&&!this.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)&&(this.timelineModule.updateChartByNewTimeline(),e=window.outerWidth/window.innerWidth,this.timelineModule.isZoomToFit&&!this.enableTimelineVirtualization&&e<1?(t=void 0,t=this.enableVirtualization?Math.abs(this.timelineModule.totalTimelineWidth-this.element.getElementsByClassName("e-chart-scroll-container e-content")[0].clientWidth)+1:Math.abs(this.timelineModule.totalTimelineWidth-this.ganttChartModule.chartBodyContent.parentElement.clientWidth),this.ganttChartModule.chartBodyContent.style.width=ne.formatUnit(this.timelineModule.totalTimelineWidth-t)):this.ganttChartModule.chartBodyContent.style.width=ne.formatUnit(this.timelineModule.totalTimelineWidth),this.ganttChartModule.updateLastRowBottomWidth(),this.taskFields.dependency&&this.ganttChartModule.reRenderConnectorLines(),"beforeAdd"!==a)&&this.notify("selectRowByIndex",{})},m.prototype.splitTask=function(e,t){this.isEdit=!0,this.chartRowsModule.splitTask(e,t)},m.prototype.mergeTask=function(e,t){this.chartRowsModule.mergeTask(e,t)},m.prototype.reorderColumns=function(e,t){this.treeGrid.reorderColumns(e,t)},m.prototype.initiateEditAction=function(e){this.isOnEdit=e,this.previousRecords={},this.editedRecords=[]},m.prototype.setRecordValue=function(e,t,i,a){if(t=ne.isUndefined(t)?null:t,!(!this.isOnEdit&&!this.isOnDelete)){this.makeCloneData(e,i,a);var a=a?i:i.ganttProperties,n=e.includes(".")?e.split(".")[1]:e,r=a.rowUniqueID,s=this.getRecordByID(r),r=!1,o=[];if("childRecords"===e)for(var l=0;l<i.childRecords.length;l++)o[l]=this.removeCalendarContext(i.childRecords[l].ganttProperties);else o=i;r=!(!ne.isNullOrUndefined(t)&&!ne.isNullOrUndefined(i[""+n])&&(ne.isNullOrUndefined(t)||ne.isNullOrUndefined(i[""+n])||(t instanceof Date&&i[""+n]instanceof Date?t.getTime()===i[""+n].getTime():Array.isArray(t)||"object"==typeof t?JSON.stringify(t)===JSON.stringify(i[""+n]):i[""+n]===t)))||r,"totalDuration"===n&&s&&(r=i.progress!==s.ganttProperties.progress),this.treeGridModule.isDateColumnCellEdit&&(r=!0),s&&r&&(-1===this.editedRecords.indexOf(s)||0===this.editedRecords.length)&&(this.editModule.draggedRecord&&this.editModule.draggedRecord.ganttProperties.taskId===a.taskId?this.editedRecords.splice(0,0,s):this.editedRecords.push(s),this.undoRedoModule&&(-1===this.undoRedoModule.changedRecords.indexOf(s)&&this.undoRedoModule.changedRecords.push(ne.extend({},{},s,!0)),r=0<(n=this.undoRedoModule.getUndoCollection).length?n[n.length-1].action:null,!this.editModule||!this.editSettings.allowEditing||this.undoRedoModule.isUndoRedoPerformed||this.isOnDelete||this.isOnAdded||"outdent"===r||"indent"===r||"RowDragAndDrop"===r||"TaskbarDragAndDrop"===r||(a=this.previousFlatData.filter(function(e){return e.ganttProperties.taskId===s.ganttProperties.taskId})[0])&&n[n.length-1]&&n[n.length-1].modifiedRecords&&-1===n[n.length-1].modifiedRecords.indexOf(a)&&n[n.length-1].modifiedRecords.push(a)),this.enableImmutableMode)&&this.modifiedRecords.push(s)}ne.setValue(e,t,i)},m.prototype.makeCloneData=function(e,t,i){var a=ne.getValue(e,t);i&&(e="ganttProperties."+e),ne.isNullOrUndefined(this.previousRecords[t.uniqueID])&&(this.previousRecords[t.uniqueID]={}),i=this.previousRecords[t.uniqueID],t=ne.getValue(e,i),ne.isUndefined(t)&&(t=a instanceof Date?new Date(a.getTime()):ne.isObjectArray(a)?ne.extend([],a,[],!0):ne.isObject(a)?ne.extend({},{},a,!0):a,ne.isUndefined(t)?ne.setValue(e,null,i):ne.setValue(e,t,i))},m.prototype.closeGanttActions=function(){this.editModule&&(this.editModule.cellEditModule&&this.editModule.cellEditModule.isCellEdit?(this.treeGrid.closeEdit(),this.editModule.cellEditModule.isCellEdit=!1,ne.isNullOrUndefined(this.toolbarModule)||this.toolbarModule.refreshToolbarItems()):this.editModule.dialogModule&&this.editModule.dialogModule.dialogObj&&this.editModule.dialogModule.dialogObj.visible&&(this.editModule.dialogModule.dialogObj.hide(),this.editModule.dialogModule.dialogClose()))},m.prototype.getTaskByUniqueID=function(t){var e=this.flatData.filter(function(e){return e.uniqueID===t});return 0<e.length?e[0]:null},m.prototype.getRecordByID=function(e){return ne.isNullOrUndefined(e)?null:this.flatData[this.ids.indexOf(e.toString())]},m.prototype.setSplitterPosition=function(e,t){var i={},e=(i[t]=e,"position"===t?this.splitterUpdateType="position":"columnIndex"===t&&(this.splitterUpdateType="columnIndex"),this.splitterModule.calculateSplitterPosition(i));switch(t){case"view":this.splitterSettings.view=i[t];break;case"columnIndex":this.splitterModule.isSplitterResized=!0,this.splitterSettings.columnIndex=i[t];break;case"position":this.splitterModule.isSplitterResized=!0,this.splitterSettings.position=i[t]}var a=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[0],n=this.splitterModule.splitterObject.element.querySelectorAll(".e-pane")[1];this.splitterModule.splitterPreviousPositionGrid=a.scrollWidth+1+"px",this.splitterModule.splitterPreviousPositionChart=n.scrollWidth+1+"px",this.splitterModule.splitterObject.paneSettings[0].size=e,this.splitterModule.splitterObject.paneSettings[1].size=parseFloat("99.75%")-parseFloat(e)+"%",this.splitterModule.triggerCustomResizedEvent()},m.prototype.expandByIndex=function(e){if("number"==typeof e){var t=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t)}else for(var i,a=0;a<e.length;a++)"number"==typeof e[a]&&(i=e[a],t=this.contructExpandCollapseArgs(null,i),this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(t))},m.prototype.expandByID=function(e){this.enableVirtualization&&(this.isExpandPerformed=!0);e=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.expandGanttRow(e)},m.prototype.collapseByIndex=function(e){e=this.contructExpandCollapseArgs(null,e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(e)},m.prototype.collapseByID=function(e){e=this.contructExpandCollapseArgs(e);this.ganttChartModule.isExpandCollapseFromChart=!0,this.ganttChartModule.collapseGanttRow(e)},m.prototype.addRecord=function(e,t,i){if(this.editModule&&this.editSettings.allowAdding)if("ResourceView"===this.viewType){this.editModule.addRowPosition=t,this.editModule.addRowIndex=i;var a=void 0,n=(ne.isNullOrUndefined(e)||(a=this.undoRedoModule&&this.undoRedoModule.isUndoRedoPerformed?e.ganttProperties.resourceInfo:e[this.taskFields.resourceInfo]),void 0),r=void 0;if(!ne.isNullOrUndefined(a)&&a.length){for(var s,o,l=0;l<a.length&&(n="object"==typeof a[l]?a[l][this.resourceFields.id]:a[0],!(r=this.flatData[this.getTaskIds().indexOf("R"+n)]));l++);r&&(0===r.level||r.childRecords.length)?(s=r.childRecords[i],"ResourceView"===this.viewType&&this.undoRedoModule&&this.undoRedoModule.isUndoRedoPerformed?this.editModule.addRecord(e,t,i):s?"Child"===(o="Above"===t||"Below"===t?t:"Child")?this.editModule.addRecord(e,o,this.getTaskIds().indexOf("R"+n)):this.editModule.addRecord(e,o,this.flatData.indexOf(s)):this.editModule.addRecord(e,"Child",this.getTaskIds().indexOf("R"+n))):this.editModule.addRecord(e,"Bottom")}else this.undoRedoModule&&this.undoRedoModule.isUndoRedoPerformed?this.editModule.addRecord(e,t,i):this.editModule.addRecord(e,"Bottom");this.editModule.addRowPosition=null,this.editModule.addRowIndex=null}else this.editModule.addRecord(e,t,i),"Bottom"===t&&(this.selectedRowIndex=i)},m.prototype.updateRecordByID=function(e){this.editModule&&this.editSettings.allowEditing&&(this.updateDuration=!0,this.editModule.updateRecordByID(e),this.updateDuration=!1)},m.prototype.getCurrentViewData=function(){return this.treeGrid.getCurrentViewRecords().map(function(e){return e.taskData})},m.prototype.autoFitColumns=function(e){this.treeGrid.autoFitColumns(e)},m.prototype.getTaskInfo=function(e){var t=this.getRecordByID(e),i={};if(t&&t.ganttProperties){var a,n=t.ganttProperties,e=this.taskFields,r={baseline:this.renderBaseline,isCritical:this.enableCriticalPath,progressWidth:e.progress,segments:e.segments,isAutoSchedule:n.isAutoSchedule,wbs:this.enableWBS};for(a in r)if(Object.prototype.hasOwnProperty.call(r,a))switch(a){case"baseline":n.baselineStartDate&&n.baselineEndDate&&(ne.isNullOrUndefined(n.baselineLeft)||(i.baselineLeft=n.baselineLeft),ne.isNullOrUndefined(n.baselineWidth)||(i.baselineWidth=n.baselineWidth));break;case"isCritical":n.isCritical&&(i.isCritical=n.isCritical,i.slack=n.slack);break;case"progressWidth":n.progressWidth&&(i.progressWidth=n.progressWidth);break;case"segments":n.segments&&(i.segments=n.segments);break;case"wbs":n.wbsCode&&(i.wbsCode=n.wbsCode),n.wbsPredecessor&&(i.wbsPredecessor=n.wbsPredecessor);break;case"isAutoSchedule":i.isAutoSchedule=n.isAutoSchedule,n.isAutoSchedule?(i.autoTaskLeft=n.left,i.autoTaskWidth=n.width):(!n.isAutoSchedule&&t.hasChildRecords&&(i.manualTaskAutoLeft=n.autoLeft,i.manualTaskAutoWidth=n.autoWidth),i.manualTaskLeft=n.left,i.manualTaskWidth=n.width)}}return i},m.prototype.updateTaskId=function(e,t){this.editModule&&this.editSettings.allowEditing&&this.editModule.updateTaskId(e,t)},m.prototype.expandAtLevel=function(e){this.enableVirtualization&&(this.isExpandCollapseLevelMethod=!0),this.ganttChartModule.expandAtLevel(e)},m.prototype.indent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.indent()},m.prototype.outdent=function(){this.editModule&&this.editSettings.allowEditing&&this.editModule.outdent()},m.prototype.getUndoActions=function(){return this.undoRedoModule?this.undoRedoModule.getUndoCollection:[]},m.prototype.getRedoActions=function(){return this.undoRedoModule?this.undoRedoModule.getRedoCollection:[]},m.prototype.clearUndoCollection=function(){this.undoRedoModule&&(this.undoRedoModule.getUndoCollection=[],this.toolbarModule)&&this.toolbarModule.enableItems([this.controlId+"_undo"],!1)},m.prototype.clearRedoCollection=function(){this.undoRedoModule&&(this.undoRedoModule.getRedoCollection=[],this.toolbarModule)&&this.toolbarModule.enableItems([this.controlId+"_redo"],!1)},m.prototype.undo=function(){this.undoRedoModule&&this.undoRedoModule.undoAction()},m.prototype.redo=function(){this.undoRedoModule&&this.undoRedoModule.redoAction()},m.prototype.showCriticalPath=function(e){this.criticalPathModule&&(this.criticalPathModule.showCriticalPath(e),e=this.criticalPathModule,this.criticalPathModule.criticalConnectorLine(e.criticalPathCollection,e.detailPredecessorCollection,!0,e.predecessorCollectionTaskIds))},m.prototype.getCriticalTasks=function(){return!ne.isNullOrUndefined(this.criticalPathModule)&&this.enableCriticalPath?this.criticalPathModule.getCriticalTasks():null},m.prototype.zoomIn=function(){this.timelineModule.processZooming(!0)},m.prototype.zoomOut=function(){this.timelineModule.processZooming(!1)},m.prototype.fitToProject=function(){this.timelineModule.isZoomIn=!1,this.timelineModule.processZoomToFit(),this.ganttChartModule.updateScrollLeft(0)},m.prototype.reorderRows=function(e,t,i){this.rowDragAndDropModule.reorderRows(e,t,i)},m.prototype.updateRecordByIndex=function(e,t){var i;this.editModule&&this.editSettings.allowEditing&&(i=this.taskFields,e=!(0<this.updatedRecords.length)||ne.isNullOrUndefined(this.updatedRecords[e])?null:this.updatedRecords[e],ne.isNullOrUndefined(e)||(t[i.id]=e[i.id],this.editModule.updateRecordByID(t)))},m.prototype.addPredecessor=function(e,t){this.connectorLineModule&&(e=this.connectorLineModule.getRecordByID(e.toString()),this.editModule)&&!ne.isNullOrUndefined(e)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.addPredecessor(e,t)},m.prototype.removePredecessor=function(e){this.connectorLineModule&&(e=this.connectorLineModule.getRecordByID(e.toString()),this.editModule)&&!ne.isNullOrUndefined(e)&&this.editSettings.allowTaskbarEditing&&this.connectorLineEditModule.removePredecessor(e)},m.prototype.updatePredecessor=function(e,t){var i,a;this.connectorLineModule&&(i=this.taskFields.dependency,e=this.connectorLineModule.getRecordByID(e.toString()),this.editModule)&&!ne.isNullOrUndefined(e)&&this.editSettings.allowTaskbarEditing&&(t=t.split(","),a=this.treeGridModule.maxLimits(this.durationUnit),t=this.treeGridModule.updatePredecessorLimits(t,e[i],a),this.connectorLineEditModule.updatePredecessor(e,t))},m.prototype.openAddDialog=function(){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowAdding&&this.editModule.dialogModule.openAddDialog()},m.prototype.openEditDialog=function(e){this.editModule&&this.editModule.dialogModule&&this.editSettings.allowEditing&&this.editModule.dialogModule.openEditDialog(e)},m.prototype.contructExpandCollapseArgs=function(e,t){ne.isNullOrUndefined(t)&&e?(n=this.getRecordByID(e.toString()),i=this.getRowByID(e),ne.isNullOrUndefined(i)||(a=ne.getValue("rowIndex",i))):ne.isNullOrUndefined(t)||(i=this.getRowByIndex(t),a=(e=this.focusModule.isFromKeyboardAction)?ne.getValue("rowIndex",i):t,n=(e?this.currentViewData:this.flatData)[a]);var i,a,n,t=this.treeGrid.getRows()[a];return{data:n,gridRow:t,chartRow:i,cancel:!1}},m.prototype.getRowByIndex=function(e){try{var t=this.element.querySelectorAll(".e-chart-row");return ne.isNullOrUndefined(e)?null:t[e]}catch(e){return null}},m.prototype.getRowByID=function(e){var t=this,e=this.getRecordByID(e.toString()),e=this.loadChildOnDemand&&this.taskFields.hasChildMapping?this.updatedRecords.map(function(e){return e[t.taskFields.id]}).indexOf(e.ganttProperties.taskId):(this.enableVirtualization?this.currentViewData:this.updatedRecords).indexOf(e);return-1!==e?this.getRowByIndex(e):null},m.prototype.getUnscheduledTaskClass=function(e){return ne.isNullOrUndefined(e.startDate)&&ne.isNullOrUndefined(e.endDate)&&ne.isNullOrUndefined(e.duration)||ne.isNullOrUndefined(e.startDate)||ne.isNullOrUndefined(e.endDate)||ne.isNullOrUndefined(e.duration)?" "+$e:""},m.prototype.isUnscheduledTask=function(e){return!!(ne.isNullOrUndefined(e.startDate)||ne.isNullOrUndefined(e.endDate)||ne.isNullOrUndefined(e.duration))},m.prototype.createGanttPopUpElement=function(){var e=this.createElement("div",{className:"e-ganttpopup",styles:"display:none;"}),t=this.createElement("div",{className:"e-content",attrs:{tabIndex:"-1"}});ne.append([t,this.createElement("div",{className:"e-uptail e-tail"})],e),t.appendChild(this.createElement("span")),ne.append([t,this.createElement("div",{className:"e-downtail e-tail"})],e),document.getElementById(this.element.id+"GanttChart").appendChild(e)},m.prototype.getPredecessorTextValue=function(e){var t;switch(e){case"SS":t=this.localeObj.getConstant("start")+"-"+this.localeObj.getConstant("start");break;case"FF":t=this.localeObj.getConstant("finish")+"-"+this.localeObj.getConstant("finish");break;case"SF":t=this.localeObj.getConstant("start")+"-"+this.localeObj.getConstant("finish");break;case"FS":t=this.localeObj.getConstant("finish")+"-"+this.localeObj.getConstant("start")}return t},m.prototype.search=function(e){this.filterModule&&(this.searchSettings.key=e,this.dataBind())},m.prototype.getOffsetRect=function(e){var e=e.getBoundingClientRect(),t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,a=document.documentElement.clientTop||document.body.clientTop||0,n=document.documentElement.clientLeft||document.body.clientLeft||0,t=e.top+t-a,a=this.enableRtl?e.right+i-n:e.left+i-n;return{top:Math.round(t),left:Math.round(a),width:e.width,height:e.height}},m.prototype.expandAll=function(){this.ganttChartModule.expandCollapseAll("expand")},m.prototype.updateDataSource=function(e,t){if(this.isDynamicData=!0,!ne.isNullOrUndefined(t))for(var i=0,a=Object.keys(t);i<a.length;i++){var n=a[i];switch(n){case"projectStartDate":this.setProperties({projectStartDate:t[n]},!0);break;case"projectEndDate":this.setProperties({projectEndDate:t[n]},!0)}}this.ganttChartModule.scrollObject.element.scrollLeft=0,this.dataSource=e},m.prototype.collapseAll=function(){this.ganttChartModule.expandCollapseAll("collapse")},m.prototype.getGridColumns=function(){return this.treeGrid.getColumns()},m.prototype.getColumnByField=function(t,e){e=e.filter(function(e){return e.field===t});return 0<e.length?e[0]:null},m.prototype.getGanttColumns=function(){return this.updateColumnModel(this.getGridColumns()),this.ganttColumns},m.prototype.updateColumnModel=function(e){var t,i,a=ne.isNullOrUndefined(e)?this.getGridColumns():e;if(-1!==this.treeColumnIndex&&this.ganttColumns[this.treeColumnIndex]&&!ne.isNullOrUndefined(this.ganttColumns[this.treeColumnIndex].template)&&(t=this.ganttColumns[this.treeColumnIndex].template,i=this.ganttColumns[this.treeColumnIndex].field),this.ganttColumns.length===a.length)for(var n=0;n<a.length;n++){for(var r=0,s=Object.keys(this.ganttColumns[parseInt(n.toString(),10)]);r<s.length;r++){var o=s[r];this.ganttColumns[parseInt(n.toString(),10)][""+o]=a[parseInt(n.toString(),10)][""+o]}i!==this.ganttColumns[parseInt(n.toString(),10)].field||"checkbox"===this.ganttColumns[parseInt(n.toString(),10)].type||ne.isNullOrUndefined(t)||""===t||(this.ganttColumns[parseInt(n.toString(),10)].template=t)}return this.ganttColumns},m.prototype.showColumn=function(e,t){this.treeGrid.showColumns(e,t),this.updateTreeColumns()},m.prototype.hideColumn=function(e,t){this.treeGrid.hideColumns(e,t),this.updateTreeColumns()},m.prototype.setScrollTop=function(e){this.ganttChartModule.scrollObject.setScrollTop(e)},m.prototype.cancelEdit=function(){this.isCancelled=!0,this.closeGanttActions()},m.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},m.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},m.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},m.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},m.prototype.deleteRecord=function(e){this.editModule&&this.editModule.deleteRecord(e)},m.prototype.enableItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},m.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},m.prototype.updateDataArgs=function(e){var t;return Array.isArray(e.data)||((t=[]).push(e.data),ne.setValue("data",t,e)),e},m.prototype.convertToMilestone=function(e){var t,i,e=this.getRecordByID(e);ne.isNullOrUndefined(e)||((t=ne.extend({},{},e.taskData,!0))[(i=this.taskFields).startDate]&&this.setRecordValue(i.startDate,e.ganttProperties.startDate,t,!0),ne.isNullOrUndefined(i.duration)?(t[i.startDate]=new Date(e.ganttProperties.startDate),t[i.endDate]=new Date(e.ganttProperties.endDate)):t[i.duration]=0,ne.isNullOrUndefined(i.work)||(t[i.work]=null),ne.isNullOrUndefined(i.milestone)||!1===t[i.milestone]&&(t[i.milestone]=!0),ne.isNullOrUndefined(i.progress)||(t[i.progress]=0),!ne.isNullOrUndefined(i.child)&&t[i.child]&&(t[i.child]=[]),!ne.isNullOrUndefined(i.parentID)&&t[i.parentID]&&(t[i.parentID]=null),ne.isNullOrUndefined(i.segments)||(_(this.dataSource)?t[i.segments]=[]:t[i.segments]=null),"FixedWork"===(ne.isNullOrUndefined(e.ganttProperties.taskType)?this:e.ganttProperties).taskType&&(ne.isNullOrUndefined(t[i.work])?e.ganttProperties.work=0:t[i.work]=0),!ne.isNullOrUndefined(this.contextMenuModule)&&this.contextMenuModule.isOpen&&"Milestone"===this.contextMenuModule.item?(ne.isNullOrUndefined(i.dependency)||(t[i.dependency]=null),i=this.editSettings.newRowPosition,this.addRecord(t,i,this.selectedRowIndex)):e.hasChildRecords||e.ganttProperties.isMilestone||(this.isConvertedMilestone=!0,this.updateRecordByID(t),this.isConvertedMilestone=!1))},m.prototype.changeTaskMode=function(e){this.undoRedoModule&&!this.undoRedoModule.isUndoRedoPerformed&&(this.undoRedoModule.redoEnabled&&this.undoRedoModule.disableRedo(),this.undoRedoModule.createUndoCollection(),(t={action:"TaskMode"}).modifiedRecords=ne.extend([],[e],[],!0),this.undoRedoModule.getUndoCollection[this.undoRedoModule.getUndoCollection.length-1]=t);var t=this.taskFields,e=this.getRecordByID(e[t.id]),i=e.ganttProperties,t=(this.isOnEdit=!0,this.setRecordValue("isAutoSchedule",!i.isAutoSchedule,i,!0),ne.isNullOrUndefined(this.taskFields.manual)||(this.setRecordValue("taskData."+t.manual,!i.isAutoSchedule,e),this.setRecordValue(t.manual,!i.isAutoSchedule,e)),this.editModule.updateTaskScheduleModes(e),{data:e});this.editModule.initiateUpdateAction(t)},m.prototype.getTaskIds=function(){return this.taskIds},m.prototype.setTaskIds=function(e){var t;"ProjectView"!==this.viewType&&(t=e.ganttProperties.taskId,t=0===e.level?"R"+t:"T"+t,this.taskIds.push(t))},m.prototype.renderTemplates=function(){this.isReact&&this.renderReactTemplates()},m.prototype.resetTemplates=function(){this.isReact&&this.clearTemplate(["TaskbarTemplate","ParentTaskbarTemplate","MilestoneTemplate","BaselineTemplate","TaskLabelTemplate","RightLabelTemplate","LeftLabelTemplate","TooltipTaskbarTemplate","TooltipBaselineTemplate","TooltipConnectorLineTemplate","TimelineTemplate"])},m.prototype.getFrozenColumnsCount=function(){return this.getFrozenCount(!ne.isNullOrUndefined(this.columns)&&this.columns,0)+this.frozenColumns},m.prototype.getFrozenCount=function(e,t){for(var i=0,a=e.length;i<a;i++)e[parseInt(i.toString(),10)].isFrozen&&t++;return t},m.prototype.normalizeTranslate=function(e){return e=!e.includes(",")&&navigator.userAgent.includes("Firefox")?"translate("+e.substring(e.lastIndexOf("(")+1,e.lastIndexOf(")"))+", 0px)":e},f([ne.Property(!(m.prototype.getTranslateY=function(e){return(1<e.length?e[1]:e[0]).trim()}))],m.prototype,"autoUpdatePredecessorOffset",void 0),f([ne.Property(!0)],m.prototype,"allowKeyboard",void 0),f([ne.Property(!1)],m.prototype,"enableImmutableMode",void 0),f([ne.Property(!0)],m.prototype,"allowParentDependency",void 0),f([ne.Property(!0)],m.prototype,"enableHtmlSanitizer",void 0),f([ne.Property(!0)],m.prototype,"disableHtmlEncode",void 0),f([ne.Complex({},_i)],m.prototype,"loadingIndicator",void 0),f([ne.Property(!0)],m.prototype,"enableVirtualMaskRow",void 0),f([ne.Property(!1)],m.prototype,"enableInfiniteTimelineScroll",void 0),f([ne.Property(!0)],m.prototype,"loadChildOnDemand",void 0),f([ne.Property(!0)],m.prototype,"updateOffsetOnTaskbarEdit",void 0),f([ne.Property(!0)],m.prototype,"autoCalculateDateScheduling",void 0),f([ne.Property(!0)],m.prototype,"autoFocusTasks",void 0),f([ne.Property(!1)],m.prototype,"enableAdaptiveUI",void 0),f([ne.Property(!1)],m.prototype,"enableWBS",void 0),f([ne.Property(!1)],m.prototype,"enableAutoWbsUpdate",void 0),f([ne.Property(!0)],m.prototype,"allowSelection",void 0),f([ne.Property(!1)],m.prototype,"enableHover",void 0),f([ne.Property(!1)],m.prototype,"allowSorting",void 0),f([ne.Property(!0)],m.prototype,"enablePredecessorValidation",void 0),f([ne.Property(!1)],m.prototype,"showColumnMenu",void 0),f([ne.Property()],m.prototype,"columnMenuItems",void 0),f([ne.Property(["Sorting","Add","ColumnReorder","ColumnResize","ColumnState","Delete","Edit","Filtering","Indent","Outdent","NextTimeSpan","PreviousTimeSpan","RowDragAndDrop","TaskbarDragAndDrop","Search","ZoomIn","ZoomOut","ZoomToFit"])],m.prototype,"undoRedoActions",void 0),f([ne.Property(null)],m.prototype,"timezone",void 0),f([ne.Property(!1)],m.prototype,"collapseAllParentTasks",void 0),f([ne.Property(!1)],m.prototype,"highlightWeekends",void 0),f([ne.Property(0)],m.prototype,"treeColumnIndex",void 0),f([ne.Property([])],m.prototype,"dataSource",void 0),f([ne.Property("day")],m.prototype,"durationUnit",void 0),f([ne.Property(null)],m.prototype,"query",void 0),f([ne.Property(null)],m.prototype,"dateFormat",void 0),f([ne.Property("auto")],m.prototype,"height",void 0),f([ne.Property(!1)],m.prototype,"renderBaseline",void 0),f([ne.Property(null)],m.prototype,"baselineTemplate",void 0),f([ne.Complex({},la)],m.prototype,"calendarSettings",void 0),f([ne.Property(!1)],m.prototype,"allowTaskbarDragAndDrop",void 0),f([ne.Property(!0)],m.prototype,"allowTaskbarOverlap",void 0),f([ne.Property("Horizontal")],m.prototype,"gridLines",void 0),f([ne.Complex({},hi)],m.prototype,"labelSettings",void 0),f([ne.Property(null)],m.prototype,"taskbarTemplate",void 0),f([ne.Property(null)],m.prototype,"parentTaskbarTemplate",void 0),f([ne.Property(null)],m.prototype,"timelineTemplate",void 0),f([ne.Property(null)],m.prototype,"milestoneTemplate",void 0),f([ne.Property()],m.prototype,"baselineColor",void 0),f([ne.Property("auto")],m.prototype,"width",void 0),f([ne.Property(!1)],m.prototype,"enableVirtualization",void 0),f([ne.Property(!1)],m.prototype,"enableTimelineVirtualization",void 0),f([ne.Property()],m.prototype,"toolbar",void 0),f([ne.Property(["Monday","Tuesday","Wednesday","Thursday","Friday"])],m.prototype,"workWeek",void 0),f([ne.Property(!1)],m.prototype,"includeWeekend",void 0),f([ne.Property(!1)],m.prototype,"allowUnscheduledTasks",void 0),f([ne.Property(!1)],m.prototype,"showInlineNotes",void 0),f([ne.Property(36)],m.prototype,"rowHeight",void 0),f([ne.Property(null)],m.prototype,"taskbarHeight",void 0),f([ne.Property(null)],m.prototype,"projectStartDate",void 0),f([ne.Property(null)],m.prototype,"projectEndDate",void 0),f([ne.Property(null)],m.prototype,"resourceIDMapping",void 0),f([ne.Property(null)],m.prototype,"resourceNameMapping",void 0),f([ne.Property([])],m.prototype,"resources",void 0),f([ne.Property([])],m.prototype,"segmentData",void 0),f([ne.Property(null)],m.prototype,"connectorLineBackground",void 0),f([ne.Property(1)],m.prototype,"connectorLineWidth",void 0),f([ne.Property([])],m.prototype,"columns",void 0),f([ne.Property([])],m.prototype,"addDialogFields",void 0),f([ne.Property([])],m.prototype,"editDialogFields",void 0),f([ne.Property(-1)],m.prototype,"selectedRowIndex",void 0),f([ne.Property("hour")],m.prototype,"workUnit",void 0),f([ne.Property("FixedUnit")],m.prototype,"taskType",void 0),f([ne.Property("ProjectView")],m.prototype,"viewType",void 0),f([ne.Collection([{from:8,to:12},{from:13,to:17}],s)],m.prototype,"dayWorkingTime",void 0),f([ne.Collection([],Ki)],m.prototype,"weekWorkingTime",void 0),f([ne.Collection([],si)],m.prototype,"holidays",void 0),f([ne.Collection([],Xt)],m.prototype,"eventMarkers",void 0),f([ne.Complex({},wi)],m.prototype,"taskFields",void 0),f([ne.Complex({},Ai)],m.prototype,"resourceFields",void 0),f([ne.Complex({},o)],m.prototype,"timelineSettings",void 0),f([ne.Property([])],m.prototype,"zoomingLevels",void 0),f([ne.Complex({},Ni)],m.prototype,"sortSettings",void 0),f([ne.Complex({},zt)],m.prototype,"editSettings",void 0),f([ne.Complex({},Mi)],m.prototype,"tooltipSettings",void 0),f([ne.Complex({},gi)],m.prototype,"selectionSettings",void 0),f([ne.Property(!1)],m.prototype,"allowFiltering",void 0),f([ne.Property(!1)],m.prototype,"allowExcelExport",void 0),f([ne.Property(!1)],m.prototype,"allowRowDragAndDrop",void 0),f([ne.Property(!1)],m.prototype,"allowReordering",void 0),f([ne.Property(!1)],m.prototype,"readOnly",void 0),f([ne.Property(!1)],m.prototype,"allowResizing",void 0),f([ne.Property(!1)],m.prototype,"enableContextMenu",void 0),f([ne.Property(!1)],m.prototype,"enableCriticalPath",void 0),f([ne.Property(!1)],m.prototype,"enableUndoRedo",void 0),f([ne.Property(10)],m.prototype,"undoRedoStepsCount",void 0),f([ne.Property()],m.prototype,"contextMenuItems",void 0),f([ne.Property(!1)],m.prototype,"allowPdfExport",void 0),f([ne.Property(!1)],m.prototype,"validateManualTasksOnLinking",void 0),f([ne.Property(!1)],m.prototype,"enableMultiTaskbar",void 0),f([ne.Property(!1)],m.prototype,"showOverAllocation",void 0),f([ne.Property("Auto")],m.prototype,"taskMode",void 0),f([ne.Property(0)],m.prototype,"frozenColumns",void 0),f([ne.Property()],m.prototype,"emptyRecordTemplate",void 0),f([ne.Complex({},$t)],m.prototype,"filterSettings",void 0),f([ne.Complex({},ii)],m.prototype,"searchSettings",void 0),f([ne.Complex({},Di)],m.prototype,"splitterSettings",void 0),f([ne.Event()],m.prototype,"queryTaskbarInfo",void 0),f([ne.Event()],m.prototype,"beforeExcelExport",void 0),f([ne.Event()],m.prototype,"excelExportComplete",void 0),f([ne.Event()],m.prototype,"excelQueryCellInfo",void 0),f([ne.Event()],m.prototype,"excelHeaderQueryCellInfo",void 0),f([ne.Event()],m.prototype,"rowDrag",void 0),f([ne.Event()],m.prototype,"rowDragStart",void 0),f([ne.Event()],m.prototype,"rowDragStartHelper",void 0),f([ne.Event()],m.prototype,"rowDrop",void 0),f([ne.Event()],m.prototype,"collapsing",void 0),f([ne.Event()],m.prototype,"collapsed",void 0),f([ne.Event()],m.prototype,"expanding",void 0),f([ne.Event()],m.prototype,"expanded",void 0),f([ne.Event()],m.prototype,"actionBegin",void 0),f([ne.Event()],m.prototype,"cellSave",void 0),f([ne.Event()],m.prototype,"actionComplete",void 0),f([ne.Event()],m.prototype,"actionFailure",void 0),f([ne.Event()],m.prototype,"dataStateChange",void 0),f([ne.Event()],m.prototype,"dataSourceChanged",void 0),f([ne.Event()],m.prototype,"taskbarEdited",void 0),f([ne.Event()],m.prototype,"endEdit",void 0),f([ne.Event()],m.prototype,"cellEdit",void 0),f([ne.Event()],m.prototype,"load",void 0),f([ne.Event()],m.prototype,"created",void 0),f([ne.Event()],m.prototype,"destroyed",void 0),f([ne.Event()],m.prototype,"taskbarEditing",void 0),f([ne.Event()],m.prototype,"dataBound",void 0),f([ne.Event()],m.prototype,"beforeDataBound",void 0),f([ne.Event()],m.prototype,"resizeStart",void 0),f([ne.Event()],m.prototype,"resizing",void 0),f([ne.Event()],m.prototype,"resizeStop",void 0),f([ne.Event()],m.prototype,"splitterResizeStart",void 0),f([ne.Event()],m.prototype,"splitterResizing",void 0),f([ne.Event()],m.prototype,"splitterResized",void 0),f([ne.Event()],m.prototype,"columnDragStart",void 0),f([ne.Event()],m.prototype,"columnDrag",void 0),f([ne.Event()],m.prototype,"columnDrop",void 0),f([ne.Event()],m.prototype,"beforeTooltipRender",void 0),f([ne.Event()],m.prototype,"rowSelecting",void 0),f([ne.Event()],m.prototype,"rowSelected",void 0),f([ne.Event()],m.prototype,"rowDeselecting",void 0),f([ne.Event()],m.prototype,"rowDeselected",void 0),f([ne.Event()],m.prototype,"cellSelecting",void 0),f([ne.Event()],m.prototype,"cellSelected",void 0),f([ne.Event()],m.prototype,"cellDeselecting",void 0),f([ne.Event()],m.prototype,"cellDeselected",void 0),f([ne.Event()],m.prototype,"queryCellInfo",void 0),f([ne.Event()],m.prototype,"headerCellInfo",void 0),f([ne.Event()],m.prototype,"rowDataBound",void 0),f([ne.Event()],m.prototype,"columnMenuOpen",void 0),f([ne.Event()],m.prototype,"toolbarClick",void 0),f([ne.Event()],m.prototype,"columnMenuClick",void 0),f([ne.Event()],m.prototype,"contextMenuOpen",void 0),f([ne.Event()],m.prototype,"contextMenuClick",void 0),f([ne.Event()],m.prototype,"onTaskbarClick",void 0),f([ne.Event()],m.prototype,"recordDoubleClick",void 0),f([ne.Event()],m.prototype,"onMouseMove",void 0),f([ne.Event()],m.prototype,"beforePdfExport",void 0),f([ne.Event()],m.prototype,"pdfExportComplete",void 0),f([ne.Event()],m.prototype,"pdfQueryCellInfo",void 0),f([ne.Event()],m.prototype,"pdfQueryTaskbarInfo",void 0),f([ne.Event()],m.prototype,"pdfQueryTimelineCellInfo",void 0),f([ne.Event()],m.prototype,"pdfColumnHeaderQueryCellInfo",void 0),f([ne.NotifyPropertyChanges],m));function m(e,t){e=Ua.call(this,e,t)||this;return e.isRowSelected=!1,e.showIndicator=!0,e.singleTier=0,e.regenerateCycles=!1,e.expandedRecords=[],e.isLocaleChanged=!1,e.triggeredColumnName="",e.totalUndoAction=0,e.previousFlatData=[],e.isExpandPerformed=!1,e.isCollapsePerformed=!1,e.oldRecords=[],e.updateDuration=!1,e.isConvertedMilestone=!1,e.isDynamicDataUpdate=!1,e.skipOffsetUpdate=!1,e.isCancelled=!1,e.isCollapseAll=!1,e.previousRecords={},e.editedRecords=[],e.modifiedRecords=[],e.isOnEdit=!1,e.isOnDelete=!1,e.isOnAdded=!1,e.isExpandCollapseLevelMethod=!1,e.isFromEventMarker=!1,e.isDynamicData=!1,e.isConnectorLineUpdate=!1,e.staticSelectedRowIndex=-1,e.needsID=!0,e.showActiveElement=!0,e.addDeleteRecord=!1,e.enableHeaderFocus=!0,e.enableValidation=!0,e.isOnAddOrDelete=!1,e.isTreeGridRendered=!1,e.isFromOnPropertyChange=!1,e.isFromRenderBaseline=!1,e.isGanttChartRendered=!1,e.isEdit=!1,e.eventMarkerColloction=[],ne.setValue("mergePersistData",e.mergePersistGanttData,e),e}(f=k.PdfHorizontalOverflowType||(k.PdfHorizontalOverflowType={}))[f.NextPage=0]="NextPage",f[f.LastPage=1]="LastPage";var La="toolbarClick",Va=(y.prototype.bindTreeGridProperties=function(){this.parent.treeGrid.editSettings.allowEditing=this.parent.editSettings.allowEditing,this.parent.treeGrid.editSettings.allowNextRowEdit=this.parent.editSettings.allowNextRowEdit,this.parent.treeGrid.editSettings.mode="Cell",this.parent.treeGrid.cellEdit=this.ensureEditCell.bind(this),this.parent.editSettings.allowEditing&&b.TreeGrid.Inject(b.Edit)},y.prototype.ensureEditCell=function(i){var e,t,a,n,r,s,o=this,l=i.rowData,d=i.columnName,h=(this.editedColumn=this.parent.getColumnByField(d,this.parent.ganttColumns),this.parent.taskFields);if(!this.parent.readOnly&&("Dialog"!==this.parent.editSettings.mode&&(i.columnObject&&i.columnObject.field===this.parent.taskFields.constraintType&&i.columnObject.edit&&i.columnObject.edit.params&&Array.isArray(i.columnObject.edit.params.dataSource)&&(e=Object.keys(k.ConstraintType).filter(function(e){return!isNaN(Number(k.ConstraintType[e]))}).map(function(e){return{text:o.parent.treeGridModule.getLocalizedConstraintTypeText(e),value:k.ConstraintType[e]}}),i.rowData&&i.rowData.hasChildRecords?(t=this.parent.treeGridModule.getLocalizedConstraintTypeText("AsSoonAsPossible"),a=this.parent.treeGridModule.getLocalizedConstraintTypeText("StartNoEarlierThan"),n=this.parent.treeGridModule.getLocalizedConstraintTypeText("FinishNoLaterThan"),i.columnObject.edit.params.dataSource=e.filter(function(e){return e.text===t||e.text===a||e.text===n})):i.columnObject.edit.params.dataSource=e),!l.hasChildRecords||(d!==h.endDate||(ne.isNullOrUndefined(l[h.manual])||!1!==l[h.manual])&&"Auto"!==this.parent.taskMode)&&d!==h.duration&&d!==h.progress&&d!==h.work&&d!==h.type&&"taskType"!==d&&(d!==h.dependency||this.parent.allowParentDependency))))return r=new U.Deferred,s=this.parent,this.currentEditedRowData=i.rowData,this.parent.trigger("cellEdit",i,function(e){var t;e.columnName===s.taskFields.progress&&e.rowData.hasChildRecords&&(e.cancel=!0),i.rowData.ganttProperties.isAutoSchedule||-1!==[(t=o.parent.taskFields).constraintDate,t.constraintType].indexOf(i.columnObject.field)&&(e.cancel=!0),0===l.level&&"ResourceView"===o.parent.viewType&&(e.cancel=!0),r.resolve(e),e.cancel||(e.columnName===o.parent.taskFields.notes||"WBSPredecessor"===e.columnName?o.openNotesEditor(e):(o.isCellEdit=!0,ne.isNullOrUndefined(o.parent.toolbarModule)||o.parent.toolbarModule.refreshToolbarItems()))}),r;i.cancel=!0},y.prototype.openNotesEditor=function(e){var t=this.parent.taskFields,i=e.rowData,a=e.columnName;(a!==t.notes||this.parent.showInlineNotes)&&"WBSPredecessor"!==a||(e.cancel=!0,e=this.parent.editModule.dialogModule.updatedEditFields.map(function(e){return e.type}),-1===(e="WBSPredecessor"===a?e.indexOf("Dependency"):e.indexOf("Notes")))||(this.parent.editModule.dialogModule.openEditDialog(i.ganttProperties.rowUniqueID),document.getElementById(this.parent.element.id+"_Tab").ej2_instances[0].selectedItem=e),a===t.notes&&!0===this.parent.showInlineNotes&&(this.isCellEdit=!0)},y.prototype.initiateCellEdit=function(e,t){var i,a=!0,a=("actionComplete"===e.name&&e.previousData===e.data[e.column.field]&&(a=!1),this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("Edit")&&a&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(a={action:"CellEditing"}).editedColumn=e.column.field,a.modifiedRecords=[],this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=a),ne.getValue("column",e)),n=ne.getValue("data",e),r={action:"CellEditing"},s=(r.data=this.parent.getTaskByUniqueID(n.uniqueID),ne.getValue("previousData",e)),o=this.parent.taskFields.baselineEndDate===a.field||this.parent.taskFields.baselineStartDate===a.field,o=this.parent.allowUnscheduledTasks&&!o||!ne.isNullOrUndefined(n[a.field])&&""!==n[a.field]||this.parent.taskFields.duration!==a.field&&this.parent.taskFields.startDate!==a.field&&this.parent.taskFields.endDate!==a.field&&this.parent.taskFields.baselineDuration!==a.field&&this.parent.taskFields.baselineEndDate!==a.field&&this.parent.taskFields.baselineStartDate!==a.field?n[a.field]:s;ne.isNullOrUndefined(n)?this.parent.editModule.endEditAction(e):(n[a.field]=s,r.data[a.field]=s,this.parent.initiateEditAction(!0),0<this.parent.weekWorkingTime.length&&o&&(a.field===this.parent.taskFields.startDate||a.field===this.parent.taskFields.baselineStartDate)&&(i=a.field===this.parent.taskFields.startDate?n.ganttProperties.startDate:n.ganttProperties.baselineStartDate,this.parent.getStartTime(i)/3600===i.getHours())&&(i=this.parent.getStartTime(o),this.parent.dataOperation.setTime(i,o)),this.parent.setRecordValue(a.field,o,r.data),a.field===this.parent.taskFields.name?this.taskNameEdited(r):a.field===this.parent.taskFields.startDate?this.startDateEdited(r,!1):a.field===this.parent.taskFields.constraintDate||a.field===this.parent.taskFields.constraintType?this.constraintEdited(r):a.field===this.parent.taskFields.endDate?this.endDateEdited(r,e.previousData):a.field===this.parent.taskFields.duration?this.durationEdited(r):a.field===this.parent.taskFields.resourceInfo?this.resourceEdited(r,t,n):a.field===this.parent.taskFields.progress?this.progressEdited(r):a.field===this.parent.taskFields.baselineStartDate?this.startDateEdited(r,!0):a.field===this.parent.taskFields.baselineEndDate?this.endDateEditedforBaseline(r,e.previousData):a.field===this.parent.taskFields.baselineDuration?this.durationEdited(r,!0):a.field===this.parent.taskFields.dependency?this.dependencyEdited(r,s):a.field===this.parent.taskFields.notes?this.notedEdited(r):a.field===this.parent.taskFields.work?this.workEdited(r):a.field!==this.parent.taskFields.type&&"taskType"!==a.field||ne.isNullOrUndefined(this.parent.taskFields.work)?a.field===this.parent.taskFields.manual?this.taskmodeEdited(r):(this.parent.setRecordValue("taskData."+a.field,r.data[a.field],r.data),this.parent.editModule.initiateSaveAction(r)):this.typeEdited(r,t)),this.isCellEdit=!1,this.parent.treeGridModule.isDateColumnCellEdit&&(this.parent.treeGridModule.isDateColumnCellEdit=!1),ne.isNullOrUndefined(this.parent.editModule.cellEditModule.editedColumn)||(this.parent.editModule.cellEditModule.editedColumn=null),ne.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},y.prototype.taskNameEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.name,e.data[this.parent.taskFields.name],e.data),this.parent.setRecordValue("taskName",e.data[this.parent.taskFields.name],e.data.ganttProperties,!0),this.updateEditedRecord(e)},y.prototype.notedEdited=function(e){this.parent.setRecordValue("taskData."+this.parent.taskFields.notes,e.data[this.parent.taskFields.notes],e.data),this.parent.setRecordValue("notes",e.data[this.parent.taskFields.notes],e.data.ganttProperties,!0),this.updateEditedRecord(e)},y.prototype.taskmodeEdited=function(e){this.parent.setRecordValue("isAutoSchedule",!e.data[this.parent.taskFields.manual],e.data.ganttProperties,!0),this.parent.editModule.updateTaskScheduleModes(e.data),this.updateEditedRecord(e)},y.prototype.updateGanttDataProperties=function(e,t,i){var a=e.data,n=a.ganttProperties,r=this.parent.dateValidationModule.getFieldMappings(i),s=r.startdateField,o=r.enddateField,r=r.durationField;ne.isNullOrUndefined(t)?a.hasChildRecords||(i||(this.parent.setRecordValue(s,null,n,!0),this.parent.setRecordValue("isMilestone",!1,n,!0)),null===n.startDate&&null===n.endDate&&null!==n.duration)||this.parent.setRecordValue(r,null,n,!0):n[o]||!ne.isNullOrUndefined(n[r])?(this.parent.setRecordValue(s,new Date(t.getTime()),n,!0),i&&ne.isNullOrUndefined(this.parent.taskFields.baselineDuration)||this.parent.dateValidationModule.calculateEndDate(a,i)):ne.isNullOrUndefined(n[o])&&ne.isNullOrUndefined(n[r])&&this.parent.setRecordValue(s,new Date(t.getTime()),n,!0),i||this.parent.setRecordValue("isMilestone",0===n.duration,n,!0),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(a,s),this.parent.dataOperation.updateMappingData(a,o),this.parent.dataOperation.updateMappingData(a,r)},y.prototype.startDateEdited=function(e,t){var i=e.data,a=(e.data.ganttProperties,(a=t?e.data[this.parent.taskFields.baselineStartDate]:e.data[this.parent.taskFields.startDate])?new Date(a.getTime()):null);a=this.parent.dateValidationModule.checkStartDate(a,i.ganttProperties,i.ganttProperties.isMilestone,void 0,t),e.data.ganttProperties.constraintDate&&(e.data.ganttProperties.constraintDate=a),this.updateGanttDataProperties(e,a,t),this.updateEditedRecord(e)},y.prototype.constraintEdited=function(e){var t=e.data,i=e.data.ganttProperties,a=e.data[this.parent.taskFields.startDate],n=e.data[this.parent.taskFields.constraintDate],r=e.data[this.parent.taskFields.constraintType],a=a?new Date(a.getTime()):null;if(ne.isNullOrUndefined(n)){var s=t[this.parent.taskFields.startDate],o=t[this.parent.taskFields.endDate];switch(r){case k.ConstraintType.MustStartOn:case k.ConstraintType.StartNoEarlierThan:case k.ConstraintType.StartNoLaterThan:ne.isNullOrUndefined(s)||(this.parent.setRecordValue("constraintDate",new Date(s.getTime()),i,!0),n=i.constraintDate);break;case k.ConstraintType.MustFinishOn:case k.ConstraintType.FinishNoEarlierThan:case k.ConstraintType.FinishNoLaterThan:ne.isNullOrUndefined(o)||(this.parent.setRecordValue("constraintDate",new Date(o.getTime()),i,!0),n=i.constraintDate)}}else this.parent.setRecordValue("constraintDate",new Date(n.getTime()),i,!0);this.parent.setRecordValue("constraintType",r,i,!0),i.predecessor&&i.constraintType===k.ConstraintType.AsSoonAsPossible?(r=this.parent.predecessorModule.getPredecessorDate(e.data,i.predecessor))&&(a=r):a=i.constraintType===k.ConstraintType.StartNoEarlierThan||i.constraintType===k.ConstraintType.MustStartOn||i.constraintType===k.ConstraintType.MustFinishOn?this.parent.dateValidationModule.getDateByConstraint(t,n):this.parent.dateValidationModule.getDateByConstraint(t,a),this.updateGanttDataProperties(e,a),this.parent.dataOperation.updateMappingData(t,"constraintDate"),this.updateEditedRecord(e)},y.prototype.validateEndDateWithSegments=function(e){for(var t=[],i=e.segments,a=e?e.calendarContext:this.parent.defaultCalendarContext,n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)],s=r.endDate,s=!ne.isNullOrUndefined(e.endDate)&&s.getTime()<e.endDate.getTime()&&n!==i.length-1?s:e.endDate;r.duration=this.parent.dataOperation.getDuration(r.startDate,s,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,a),0<i.length&&s.getTime()<r.startDate.getTime()&&s.getTime()<=e.endDate.getTime()?i[n-1].duration=this.parent.dataOperation.getDuration(i[n-1].startDate,e.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,a):t.push(r)}return t},y.prototype.endDateEdited=function(e,t){var i,a=e.data.ganttProperties,n=(n=e.data[this.parent.taskFields.endDate])?new Date(n.getTime()):null;ne.isNullOrUndefined(n)?(this.parent.setRecordValue("endDate",n,a,!0),null===a.startDate&&null===a.endDate&&null!==a.duration||this.parent.setRecordValue("duration",null,a,!0),this.parent.setRecordValue("isMilestone",!1,a,!0)):(i=this.parent.getCurrentDayEndTime(n),(0===n.getHours()||t&&n.toTimeString().slice(0,5)===t.toTimeString().slice(0,5))&&86400!==i&&this.parent.dateValidationModule.setTime(i,n),n=this.parent.dateValidationModule.checkEndDate(n,a,a.isMilestone),this.parent.setRecordValue("endDate",n,a,!0),!ne.isNullOrUndefined(a.startDate)&&ne.isNullOrUndefined(a.duration)?-1===this.parent.dateValidationModule.compareDates(a.endDate,a.startDate)&&(this.parent.setRecordValue("endDate",new Date(a.startDate.getTime()),a,!0),i=this.parent.getCurrentDayEndTime(a.endDate),this.parent.dateValidationModule.setTime(i,a.endDate)):!ne.isNullOrUndefined(a.duration)&&ne.isNullOrUndefined(a.startDate)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(a.endDate,a.duration,a.durationUnit,a),a,!0),ne.isNullOrUndefined(a.segments)||(a.segments=this.validateEndDateWithSegments(a)),this.compareDatesFromRecord(a)<=0?this.parent.dateValidationModule.calculateDuration(e.data):this.parent.editModule.revertCellEdit(e),this.updateDates(e),this.parent.setRecordValue("isMilestone",0===a.duration,a,!0),a.isMilestone&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(a.startDate,a),a,!0)),!ne.isNullOrUndefined(e.data.ganttProperties.segments)&&0<e.data.ganttProperties.segments.length&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),e.data.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"startDate"),this.parent.dataOperation.updateMappingData(e.data,"endDate"),this.parent.dataOperation.updateMappingData(e.data,"duration"),this.parent.editModule.updateResourceRelatedFields(e.data,"endDate"),this.updateEditedRecord(e)},y.prototype.endDateEditedforBaseline=function(e,t){var i,a=e.data.ganttProperties,n=(n=e.data[this.parent.taskFields.baselineEndDate])?new Date(n.getTime()):null;ne.isNullOrUndefined(n)?(this.parent.setRecordValue("baselineEndDate",n,a,!0),null===a.baselineStartDate&&null===a.baselineEndDate&&null!==a.baselineDuration||this.parent.setRecordValue("baselineDuration",null,a,!0)):(i=this.parent.getCurrentDayEndTime(n),(0===n.getHours()||t&&n.toTimeString().slice(0,5)===t.toTimeString().slice(0,5))&&86400!==i&&this.parent.dateValidationModule.setTime(i,n),n=this.parent.dateValidationModule.checkEndDate(n,a,a.isMilestone,!0),this.parent.setRecordValue("baselineEndDate",n,a,!0),!ne.isNullOrUndefined(a.baselineStartDate)&&ne.isNullOrUndefined(a.baselineDuration)?-1===this.parent.dateValidationModule.compareDates(a.baselineEndDate,a.baselineStartDate)&&(this.parent.setRecordValue("baselineEndDate",new Date(a.baselineStartDate.getTime()),a,!0),i=this.parent.getCurrentDayEndTime(a.baselineEndDate),this.parent.dateValidationModule.setTime(i,a.baselineEndDate)):!ne.isNullOrUndefined(a.baselineDuration)&&ne.isNullOrUndefined(a.baselineStartDate)&&this.parent.setRecordValue("baselineStartDate",this.parent.dateValidationModule.getStartDate(a.baselineEndDate,a.baselineDuration,a.durationUnit,a,!0),a,!0),this.compareDatesFromRecord(a,!0)<=0?this.parent.dateValidationModule.calculateDuration(e.data,!0):this.parent.editModule.revertCellEdit(e),this.updateDatesforBaseline(e)),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"baselineStartDate"),this.parent.dataOperation.updateMappingData(e.data,"baselineEndDate"),this.parent.dataOperation.updateMappingData(e.data,"baselineDuration"),this.updateEditedRecord(e)},y.prototype.durationEdited=function(e,t){var i=t?"baselineDuration":"duration",a=(/^[^\d.-]+$/.test(e.data[this.parent.taskFields[i]])&&(a="The provided value for the "+this.parent.taskFields[i]+" field is invalid. Please ensure the "+this.parent.taskFields[i]+" field contains only valid numeric values.",this.parent.trigger("actionFailure",{error:a})),e.data.ganttProperties),i=(!t&&parseInt(e.data[this.parent.taskFields.duration],10)<0?e.data[this.parent.taskFields.duration]=a.duration:t&&parseInt(e.data[this.parent.taskFields.baselineDuration],10)<0&&(e.data[this.parent.taskFields.baselineDuration]=a.baselineDuration),e.data[this.parent.taskFields[i]]);this.parent.dataOperation.updateDurationValue(i,a,t),t?this.updateDatesforBaseline(e):(this.updateDates(e),this.parent.editModule.updateResourceRelatedFields(e.data,"duration")),this.updateEditedRecord(e)},y.prototype.updateDates=function(e){var t=e.data.ganttProperties,i=this.parent.dateValidationModule.getDateFromFormat(t.endDate),a=this.parent.dateValidationModule.getDateFromFormat(t.startDate),n=t.duration;ne.isNullOrUndefined(n)?(this.parent.setRecordValue("isMilestone",!1,t,!0),null!==e.data[this.parent.taskFields.duration]&&this.parent.setRecordValue("endDate",null,t,!0)):(ne.isNullOrUndefined(a)&&!ne.isNullOrUndefined(i)&&this.parent.setRecordValue("startDate",this.parent.dateValidationModule.getStartDate(i,n,t.durationUnit,t),t,!0),0!==n&&t.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,t,!0),ne.isNullOrUndefined(this.parent.taskFields.milestone)||this.parent.setRecordValue(this.parent.taskFields.milestone,!1,e.data,!0),this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(t.startDate,t),t,!0)),!ne.isNullOrUndefined(t.segments)&&0<t.segments.length&&(this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(e.data,!1),t,!0),this.parent.dataOperation.updateMappingData(e.data,"segments")),a=0===t.duration,this.parent.setRecordValue("isMilestone",a,t,!0),ne.isNullOrUndefined(this.parent.taskFields.milestone)||(e.data[this.parent.taskFields.milestone]=a),this.parent.dateValidationModule.calculateEndDate(e.data)),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"endDate"),this.parent.dataOperation.updateMappingData(e.data,"startDate"),this.parent.dataOperation.updateMappingData(e.data,"duration")},y.prototype.updateDatesforBaseline=function(e){var t=e.data.ganttProperties,i=this.parent.dateValidationModule.getDateFromFormat(t.baselineEndDate),a=this.parent.dateValidationModule.getDateFromFormat(t.baselineStartDate),n=t.baselineDuration;!ne.isNullOrUndefined(i)&&ne.isNullOrUndefined(a)&&this.parent.setRecordValue("baselineStartDate",this.parent.dateValidationModule.getStartDate(i,n,t.durationUnit,t,void 0,!0),t,!0),0!==n&&this.parent.setRecordValue("baselineStartDate",this.parent.dateValidationModule.checkStartDate(t.baselineStartDate,t,void 0,void 0,!0),t,!0),this.parent.dateValidationModule.calculateEndDate(e.data,!0),this.parent.dataOperation.updateWidthLeft(e.data),this.parent.dataOperation.updateMappingData(e.data,"baselineEndDate"),this.parent.dataOperation.updateMappingData(e.data,"baselineStartDate"),this.parent.dataOperation.updateMappingData(e.data,"baselineDuration")},y.prototype.progressEdited=function(e){var t,i=e.data;this.parent.setRecordValue("progress",100<i[this.parent.taskFields.progress]?100:i[this.parent.taskFields.progress],i.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.progress,100<i[this.parent.taskFields.progress]?100:i[this.parent.taskFields.progress],e.data),i.ganttProperties.isAutoSchedule||this.parent.setRecordValue("autoWidth",this.parent.dataOperation.calculateWidth(i,!1),i.ganttProperties,!0),!ne.isNullOrUndefined(e.data.ganttProperties.segments)&&0<e.data.ganttProperties.segments.length&&!ne.isNullOrUndefined(this.parent.editModule.taskbarEditModule)&&this.parent.editModule.taskbarEditModule.updateSegmentProgress(e.data.ganttProperties),e.data.hasChildRecords||(t=i.ganttProperties.isAutoSchedule?i.ganttProperties.width:i.ganttProperties.autoWidth,this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t,i.ganttProperties.progress),i.ganttProperties,!0)),this.updateEditedRecord(e)},y.prototype.resourceEdited=function(e,t,i){var a=this.parent.resourceFields,n=t[this.parent.taskFields.resourceInfo];if(n){this.isResourceCellEdited=!0;for(var r=this.parent.dataOperation.setResourceInfo(t).length,s=i.ganttProperties.resourceInfo,o=void 0,l=[],d=this.parent.resources,h=void 0,p=0;p<r;p++)!function(t){if(s){var e=s.length;for(h=0;h<e;h++){if(s[h][a.id]===n[t]){o=h;break}o=-1}}var i;ne.isNullOrUndefined(o)||-1===o?(i=d.filter(function(e){return n[t]===e[a.id]}),(i=ne.extend({},i[0]))[a.unit]=100,l.push(i)):l.push(s[parseInt(o.toString(),10)])}(p);e.data.ganttProperties.resourceInfo=l,this.parent.dataOperation.updateMappingData(e.data,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(e.data,"resource"),"ResourceView"===this.parent.viewType&&(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=s),this.updateDates(e),this.updateEditedRecord(e)}},y.prototype.dependencyEdited=function(e,t){/[!@#$%^&*()_=[\]{};:<>|./?-]/.test(e.data[this.parent.taskFields.dependency])&&(i="The provided value for the "+this.parent.taskFields.dependency+" field is invalid. Please ensure that the "+this.parent.taskFields.dependency+" field does not contain any special characters.",this.parent.trigger("actionFailure",{error:i})),this.parent.predecessorModule.updateUnscheduledDependency(e.data);var i,a,n=this.parent.localeObj.getConstant("FF"),r=this.parent.localeObj.getConstant("FS"),s=this.parent.localeObj.getConstant("SS"),o=this.parent.localeObj.getConstant("SF"),l="";ne.isNullOrUndefined(e.data[this.parent.taskFields.dependency])||(a=e.data[this.parent.taskFields.dependency].split(",")).map(function(e,t){l=e.includes(n)?(l+=e.replace(n,"FF"))+(a.length!==t+1?",":""):e.includes(r)?(l+=e.replace(r,"FS"))+(a.length!==t+1?",":""):e.includes(s)?(l+=e.replace(s,"SS"))+(a.length!==t+1?",":""):e.includes(o)?(l+=e.replace(o,"SF"))+(a.length!==t+1?",":""):(l+=e)+(a.length!==t+1?",":"")}),this.parent.connectorLineEditModule.updatePredecessor(e.data,l,e)||this.parent.editModule.revertCellEdit(t)},y.prototype.workEdited=function(e){var t=e.data.ganttProperties,i=((e.data[this.parent.taskFields.work]<0||ne.isNullOrUndefined(e.data[this.parent.taskFields.work]))&&(e.data[this.parent.taskFields.work]=0),this.parent.updateDuration=!0,e.data[this.parent.taskFields.work]);this.parent.setRecordValue("work",i,t,!0),this.parent.editModule.updateResourceRelatedFields(e.data,"work"),this.updateDates(e),this.updateEditedRecord(e),this.parent.updateDuration=!1},y.prototype.typeEdited=function(e,t){var i=this.parent.taskFields.type||"taskType",a=e.data.ganttProperties,t=t[""+i];this.parent.setRecordValue("taskType",t,a,!0),"FixedDuration"===a.taskType&&0===a.duration&&this.parent.editModule.updateResourceRelatedFields(e.data,"work"),this.updateEditedRecord(e)},y.prototype.compareDatesFromRecord=function(e,t){var i=this.parent.dateValidationModule.getValidStartDate(e,null,t),e=this.parent.dateValidationModule.getValidEndDate(e,null,t);return this.parent.dateValidationModule.compareDates(i,e)},y.prototype.updateEditedRecord=function(e){this.parent.editModule.initiateUpdateAction(e)},y.prototype.destroy=function(){this.parent.editModule.cellEditModule=void 0},y);function y(e){this.isCellEdit=!1,this.isResourceCellEdited=!1,this.parent=e,this.bindTreeGridProperties()}Aa.prototype.createTooltip=function(e,t,i){var a=this;this.toolTipObj=new E.Tooltip({opensOn:e,position:"TopRight",enableRtl:this.parent.enableRtl,mouseTrail:t,cssClass:yt,windowCollision:!0,target:i||null,animation:{open:{effect:"None"},close:{effect:"None"}}}),this.toolTipObj.target=".e-connectorpoint-left, .e-connectorpoint-right",this.toolTipObj.beforeRender=function(e){e={data:a.taskbarEdit.taskBarEditRecord,args:e,content:a.toolTipObj.content};a.parent.trigger("beforeTooltipRender",e)},this.toolTipObj.afterOpen=function(e){a.updateTooltipPosition(e)},this.toolTipObj.isStringTemplate=!0,this.toolTipObj.appendTo(this.parent.chartPane)},Aa.prototype.updateTooltipPosition=function(e){e.element.style.visibility="visible";var t,i=this.parent.element.closest('[style*="zoom"]');ne.isNullOrUndefined(i)&&((i=this.parent.getOffsetRect(this.parent.chartPane).left+this.parent.chartPane.offsetWidth)<(t=e.element.offsetLeft)+e.element.offsetWidth&&(t+=i-(t+e.element.offsetWidth)),e.element.style.left=t+"px",e.element.style.visibility="visible",e.target)&&this.parent.tooltipSettings.editing&&(i=e.target.getBoundingClientRect().top+window.scrollY,t=void 0,t=e.target.classList.contains("e-connectorpoint-left")||e.target.classList.contains("e-connectorpoint-right")?i-e.element.offsetHeight-14:i-e.element.offsetHeight-8,this.toolTipHeight=e.element.style.top=t+"px")},Aa.prototype.showHideTaskbarEditTooltip=function(e,t){e&&this.parent.tooltipSettings.showTooltip?(this.createTooltip("Custom",!1),this.parent.tooltipModule.toolTipObj.close(),this.updateTooltip(t),this.parent.tooltipSettings.editing&&(this.toolTipObj.openDelay=500),"ConnectorPointLeftDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+pt)):"ConnectorPointRightDrag"===this.taskbarEdit.connectorSecondAction?this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector("."+ut)):this.toolTipObj.open(this.taskbarEdit.taskBarEditElement)):ne.isNullOrUndefined(this.toolTipObj)||(this.toolTipObj.destroy(),this.toolTipObj=null)},Aa.prototype.updateTooltip=function(e){var t=this.taskbarEdit.taskBarEditRecord.ganttProperties,i=(ne.isNullOrUndefined(e)||-1===e?t:t.segments[e]).width,a=(ne.isNullOrUndefined(e)||-1===e?t:t.segments[e]).progressWidth,n=ne.isNullOrUndefined(e)||-1===e?t.left:t.left+t.segments[e].left;ne.isNullOrUndefined(this.toolTipObj)||("ConnectorPointLeftDrag"===this.taskbarEdit.taskBarEditAction||"ConnectorPointRightDrag"===this.taskbarEdit.taskBarEditAction?(this.toolTipObj.content=this.getTooltipText(e),this.parent.tooltipSettings.editing&&(this.toolTipObj.openDelay=500),this.toolTipObj.offsetY=-3):(this.parent.tooltipSettings.editing&&(this.toolTipObj.openDelay=500),this.toolTipObj.content=this.getTooltipText(e),t.segments&&0<t.segments.length&&this.taskbarEdit.mainElement&&"ProgressResizing"===this.taskbarEdit.taskBarEditAction?(t=this.taskbarEdit.mainElement.querySelectorAll(".e-segmented-taskbar"),this.toolTipObj.refresh(t[e])):this.toolTipObj.refresh(this.taskbarEdit.taskBarEditElement),"LeftResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=0:this.toolTipObj.offsetX=-i:"RightResizing"===this.taskbarEdit.taskBarEditAction||"ParentResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-i:this.toolTipObj.offsetX=0:"ProgressResizing"===this.taskbarEdit.taskBarEditAction?this.parent.enableRtl?this.toolTipObj.offsetX=-a:this.toolTipObj.offsetX=-(i-a):"MilestoneDrag"===this.taskbarEdit.taskBarEditAction?this.toolTipObj.offsetX=-this.parent.chartRowsModule.milestoneHeight/2:5<i&&(this.toolTipObj.offsetX=-(i+n-this.taskbarEdit.tooltipPositionX)),this.parent.tooltipSettings.editing&&document.getElementsByClassName("e-gantt-tooltip")[0]&&this.toolTipHeight&&(document.getElementsByClassName("e-gantt-tooltip")[0].style.top=this.toolTipHeight)))},Aa.prototype.getTooltipText=function(e){var t="",i=this.parent.globalize,a=this.taskbarEdit.taskBarEditRecord.ganttProperties;if(!ne.isNullOrUndefined(a.segments)&&0<a.segments.length&&-1!==e&&"ProgressResizing"!==this.taskbarEdit.taskBarEditAction&&(a=a.segments[e]),this.parent.tooltipSettings.editing){var e=this.parent.tooltipModule.templateCompiler(this.parent.tooltipSettings.editing,this.parent,this.taskbarEdit.taskBarEditRecord,"TooltipEditingTemplate"),n=document.createElement("div");e&&ne.append(e,n),ne.getValue("tooltipEle",this.toolTipObj)&&this.parent.renderTemplates(),t=n}else{var r=void 0,s=void 0,o=void 0;switch(ne.isNullOrUndefined(a)||ne.isNullOrUndefined(a.startDate)||(r='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("startDate")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value">'+i.formatDate(a.startDate,{format:this.parent.getDateFormat()})+"</td></tr>"),ne.isNullOrUndefined(a)||ne.isNullOrUndefined(a.endDate)||(s='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("endDate")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value">'+i.formatDate(a.endDate,{format:this.parent.getDateFormat()})+"</td></tr>"),ne.isNullOrUndefined(a)||ne.isNullOrUndefined(a.duration)||(o='<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("duration")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value">'+this.parent.getDurationString(a.duration,a.durationUnit)+"</td></tr>"),this.taskbarEdit.taskBarEditAction){case"ProgressResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+('<tr><td class = "e-gantt-tooltip-label">'+this.parent.localeObj.getConstant("progress")+"</td><td class="+it+'>:</td><td class = "e-gantt-tooltip-value">'+a.progress+"</td></tr>")+"</tbody></table>";break;case"LeftResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+r+o+"</tbody></table>";break;case"RightResizing":case"ParentResizing":t='<table class = "e-gantt-tooltiptable"><tbody>'+s+o+"</tbody></table>";break;case"ChildDrag":case"ParentDrag":case"MilestoneDrag":case"ManualParentDrag":var l="",d="";ne.isNullOrUndefined(this.taskbarEdit.taskBarEditRecord.ganttProperties.startDate)||(l=r),ne.isNullOrUndefined(this.taskbarEdit.taskBarEditRecord.ganttProperties.endDate)||(d=s),t='<table class = "e-gantt-tooltiptable"><tbody>'+l+d+"</tbody></table>";break;case"ConnectorPointLeftDrag":case"ConnectorPointRightDrag":t=this.parent.connectorLineModule.tooltipTable,ne.isNullOrUndefined(this.toolTipObj)&&(this.parent.connectorLineModule.tooltipTable.innerHTML="",this.parent.connectorLineModule.tooltipTable.appendChild(this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.taskName,this.parent.editModule.taskbarEditModule.fromPredecessorText,"","")))}}return"string"==typeof t?ne.initializeCSPTemplate(function(){return t}):t};var Ba=Aa;function Aa(e,t){this.parent=e,this.taskbarEdit=t}Wa=function(e,t){return(Wa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Wa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(D,ja=J),D.prototype.wireEvents=function(){this.parent.on("chartMouseDown",this.mouseDownHandler,this),this.parent.on("chartMouseUp",this.mouseUpHandler,this),this.parent.on("chartMouseLeave",this.mouseLeaveHandler,this),this.parent.on("chartMouseMove",this.mouseMoveAction,this),this.parent.on("chartMouseClick",this.mouseClickHandler,this)},D.prototype.initPublicProp=function(){this.taskBarEditElement=null,this.taskBarEditRecord=null,this.taskBarEditAction=null,this.connectorSecondElement=null,this.connectorSecondRecord=null,this.connectorSecondAction=null,this.highlightedSecondElement=null,this.fromPredecessorText=null,this.toPredecessorText=null,this.finalPredecessor=null,this.drawPredecessor=!1,this.roundOffDuration=!0,this.dragMouseLeave=!1,this.isMouseDragged=!1,this.previousItemProperty=["left","progress","duration","isMilestone","startDate","endDate","width","progressWidth","autoLeft","autoDuration","autoStartDate","autoEndDate","autoWidth","segments"],this.tapPointOnFocus=!1,this.touchEdit=!1},D.prototype.mouseDownHandler=function(e){var t;this.parent.editSettings.allowTaskbarEditing&&!this.parent.readOnly&&(this.canDrag=!1,this.taskBarEditElement?(t=S(this.getElementByPosition(e),ve),this.taskBarEditElement.classList.contains("e-segmented-taskbar")||this.taskBarEditElement.classList.contains("collpse-parent-border")||t&&t.innerHTML===this.taskBarEditElement.innerHTML?(this.updateTaskBarEditElement(e),this.canDrag=!0,e.preventDefault()):this.canDrag=!1):this.parent.isAdaptive||this.updateTaskBarEditElement(e))},D.prototype.mouseClickHandler=function(e){var t,i;this.parent.editSettings.allowTaskbarEditing&&(i=S(t=this.getElementByPosition(e),ve),this.parent.selectionModule&&this.parent.selectionModule.enableSelectMultiTouch?this.tapPointOnFocus&&this.updateTaskBarEditElement(e):this.tapPointOnFocus&&!ne.isNullOrUndefined(this.taskBarEditElement)&&i&&i.innerHTML!==this.taskBarEditElement.innerHTML?(this.connectorSecondRecord=this.parent.ganttChartModule.getRecordByTaskBar(i),this.connectorSecondAction="ConnectorPointLeftDrag",this.connectorSecondElement=i,this.fromPredecessorText="Finish",this.validateConnectorPoint()&&this.taskBarEditingAction(e,!0),this.showHideActivePredecessors(!1),this.initPublicProp()):t.classList.contains(ct)?(this.canDrag=!1,this.multipleSelectionEnabled(),this.showHideTaskBarEditingElements(t,this.taskBarEditElement),this.tapPointOnFocus=!0,this.taskBarEditAction="ConnectorPointLeftDrag",this.connectorSecondRecord=this.taskBarEditRecord,this.taskBarEditingAction(e,!1)):t.classList.contains(gt)?(this.canDrag=!1,this.multipleSelectionEnabled(),this.showHideTaskBarEditingElements(t,this.taskBarEditElement),this.tapPointOnFocus=!0,this.taskBarEditAction="ConnectorPointRightDrag",this.connectorSecondRecord=this.taskBarEditRecord,this.taskBarEditingAction(e,!1)):(this.tapPointOnFocus&&(this.showHideActivePredecessors(!1),this.showHideTaskBarEditingElements(i,this.taskBarEditElement)),this.updateTaskBarEditElement(e)))},D.prototype.showHideActivePredecessors=function(e){var t=this.taskBarEditRecord.ganttProperties,i=t.predecessor,a="ResourceView"===this.parent.viewType?t.taskId:t.rowUniqueID;if(i)for(var n=0;n<i.length;n++){var r=i[n];a.toString()!==r.to&&a.toString()!==r.from||this.applyActiveColor(r.from,r.to,e)}t=this.parent.ganttChartModule.chartBodyContainer;e?(ne.addClass([this.taskBarEditElement],[bt]),ne.addClass([t],[vt])):(ne.removeClass([this.taskBarEditElement],[bt]),ne.removeClass([t],[vt])),this.touchEdit=e,ne.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},D.prototype.applyActiveColor=function(e,t,i){var a=("ProjectView"===this.parent.viewType?this.taskBarEditRecord.ganttProperties.taskId:this.taskBarEditRecord.ganttProperties.rowUniqueID).toString()===e?this.parent.connectorLineModule.getRecordByID(t):this.parent.connectorLineModule.getRecordByID(e),a=this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(a)];ne.isNullOrUndefined(a)||(a=a.querySelector("."+ve),e=this.parent.element.querySelector("#ConnectorLineparent"+e+"child"+t),i?(ne.addClass([a],[wt]),e&&ne.addClass([e],[wt])):(ne.removeClass([a],[wt]),e&&ne.removeClass([e],[wt])))},D.prototype.validateConnectorPoint=function(){var e=this.taskBarEditRecord.ganttProperties,t=this.connectorSecondRecord.ganttProperties,i=!0,a="ResourceView"===this.parent.viewType?e.taskId:e.rowUniqueID,n="ResourceView"===this.parent.viewType?t.taskId:t.rowUniqueID;if(this.connectorSecondRecord.hasChildRecords)i=!1;else if(t.predecessor)for(var r=0;r<t.predecessor.length;r++){var s=t.predecessor[r];if(s.from===a.toString()&&s.to===n.toString()){this.parent.connectorLineEditModule.childRecord=this.connectorSecondRecord,this.parent.connectorLineEditModule.predecessorIndex=r,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}if(s.from===n.toString()&&s.to===a.toString()){this.parent.connectorLineEditModule.childRecord=this.taskBarEditRecord,this.parent.connectorLineEditModule.predecessorIndex=r,this.parent.connectorLineEditModule.renderPredecessorDeleteConfirmDialog(),i=!1;break}}return i},D.prototype.mouseLeaveHandler=function(e){"ChildDrag"===this.taskBarEditAction||"ParentDrag"===this.taskBarEditAction||"ProgressResizing"===this.taskBarEditAction||"LeftResizing"===this.taskBarEditAction||"RightResizing"===this.taskBarEditAction?this.dragMouseLeave=!1:this.dragMouseLeave=!0},D.prototype.resolveCondition=function(e,t,i){return e?t:i},D.prototype.updateTaskBarEditElement=function(e){var t,i,a,n,r,s=this.getElementByPosition(e);if(s.classList.contains(Ye)||s.classList.contains(qe)||s.classList.contains(_e))l=S(s,qe);else if(s.classList.contains(Ze))l=S(s,Ze);else{var o,l=S(s,ve);if(!ne.isNullOrUndefined(l)&&!s.classList.contains("e-connectorpoint-left")&&!s.classList.contains("e-connectorpoint-right"))if((o=this.parent.ganttChartModule.getRecordByTaskBar(l))&&o.ganttProperties&&!ne.isNullOrUndefined(o.ganttProperties.segments)&&0<o.ganttProperties.segments.length)if(s.classList.contains("e-progressbar-handler-after")){for(var d=0;d<o.ganttProperties.segments.length;d++)if(o.ganttProperties.segments[d].showProgress){l=l.querySelectorAll(".e-segmented-taskbar")[d];break}}else l=S(s,Pe)}this.parent.editSettings.allowTaskbarEditing&&l?(this.showHideTaskBarEditingElements(l,this.editElement),this.editElement=l,this.realTaskbarElement=this.editElement,s=this.editElement.getAttribute("data-segment-index"),ne.isNullOrUndefined(s)?this.segmentIndex=-1:this.segmentIndex=Number(s),this.taskBarEditRecord=this.parent.ganttChartModule.getRecordByTaskBar(this.editElement),"mousedown"!==e.type&&"touchstart"!==e.type&&"click"!==e.type||(this.taskBarEditAction=this.getTaskBarAction(e),s=this.editElement.getAttribute("data-segment-index"),a=(o=this.parent.ganttChartModule.getRecordByTaskBar(l)).ganttProperties,t=this.editElement.parentElement.offsetLeft,this.currentData=o,i=ne.createElement("div",{styles:"height:100%;border-style:dashed;border-bottom:none;border-top:none;border-width:1px;position:absolute;z-index:10000"}),ne.addClass([i],"e-taskbar-resize-div"),i.style.setProperty("width",a.width+"px"),r=this.editElement.getAttribute("data-segment-index"),!ne.isNullOrUndefined(a.segments)&&this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction?i.style.setProperty("left",this.resolveCondition(!ne.isNullOrUndefined(a.segments),t+"px",a.left+"px")):i.style.setProperty("left",!ne.isNullOrUndefined(a.segments)&&1<a.segments.length?t+a.segments[Number(r)].left+"px":a.left+"px"),t=this.parent.createElement("table"),(r=this.parent.createElement("tbody")).appendChild(i),t.appendChild(r),a=this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-clone-taskbar"),i=null,r=(!("ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||ne.isNullOrUndefined(s)||ne.isNullOrUndefined(s)||0!==Number(s))||-1!==this.segmentIndex&&this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction?this.editElement.parentElement:this.editElement).cloneNode(!0),a||(ne.addClass([r],"e-clone-taskbar"),r.style.setProperty("position","absolute"),o.hasChildRecords&&!o.ganttProperties.isAutoSchedule&&(a=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),n=this.parent.getOffsetRect(this.editElement),this.editElement.classList.contains("e-manualparent-main-container")?r.style.setProperty("left",o.ganttProperties.left-o.ganttProperties.autoLeft+"px"):r.style.setProperty(this.parent.enableRtl?"right":"left",Math.abs(n.left-a.left+Math.abs(this.parent.ganttChartModule.scrollElement.scrollLeft))+"px")),r.style.setProperty("top","0px"),i=this.parent.createElement("div"),(n=this.parent.createElement("div")).appendChild(r),i.appendChild(n)),"ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||ne.isNullOrUndefined(s)||ne.isNullOrUndefined(s)||0!==Number(s)?this.cloneTaskbarElement=r:(a=r.getElementsByClassName("e-segmented-taskbar"),this.cloneTaskbarElement=a[Number(s)]),this.taskBarEditElement=this.cloneTaskbarElement,this.taskbarElement=i,this.taskbarResizer=t,this.currentIndex=s,this.roundOffDuration=!0,"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||!ne.isNullOrUndefined(this.parent.taskFields.dependency)||(this.taskBarEditAction=null),this.updateMouseDownProperties(e),"ResourceView"!==this.parent.viewType&&"ProjectView"!==this.parent.viewType)||0!==this.taskBarEditRecord.level&&this.parent.enableMultiTaskbar&&(n=this.parent.getTaskByUniqueID(this.taskBarEditRecord.parentItem.uniqueID),ne.isNullOrUndefined(n)||n.expanded||(this.prevZIndex=this.taskBarEditElement.style.zIndex,this.taskBarEditElement.style.zIndex="1000",this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")&&ne.addClass([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag")))):this.parent.isAdaptive?(this.taskBarEditElement&&this.showHideTaskBarEditingElements(l,this.editElement),this.initPublicProp()):this.showHideTaskBarEditingElements(l,this.editElement)},D.prototype.showHideTaskBarEditingElements=function(e,t,i){t=t||this.editElement;var a,n,r,s,o=!!this.parent.taskFields.progress,l=!0;this.parent.readOnly||(a=e?this.parent.ganttChartModule.getRecordByTaskBar(e):t?this.parent.ganttChartModule.getRecordByTaskBar(t):null,this.parent.enableMultiTaskbar&&e&&(r=this.parent.getParentTask(a.parentItem),ne.isNullOrUndefined(r)||r.expanded||(l=!1,a&&a.ganttProperties.segments&&0<a.ganttProperties.segments.length?ne.addClass([e.parentElement],[Ue]):ne.addClass([e],[Ue]))),e?(e.querySelector("."+Ne)?(ne.addClass([e.querySelector("."+Ne)],[Je]),ne.addClass([e.querySelector("."+Le)],[et]),o&&(n=(a&&a.ganttProperties.segments&&0<a.ganttProperties.segments.length?e.parentElement:e).querySelector("."+Ve),ne.isNullOrUndefined(n)||(ne.addClass([n],[tt]),n.style.top="3px"))):this.parent.isAdaptive&&o&&this.parent.ganttChartModule.getRecordByTaskBar(e).hasChildRecords&&ne.addClass([e],[Tt]),ne.addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+rt),[ht]),!ne.isNullOrUndefined(this.parent.taskFields.dependency)&&(e.querySelector("."+pt)||e.parentElement.querySelector("."+pt))&&l&&(s=ne.isNullOrUndefined(e.querySelector("."+pt))?e.parentElement:e,ne.isNullOrUndefined(s.querySelector("."+pt))||ne.addClass([s.querySelector("."+pt)],[ct]),ne.isNullOrUndefined(s.querySelector("."+ut))||ne.addClass([s.querySelector("."+ut)],[gt]))):i||ne.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+rt),[ht]),t&&e!==t&&(t.querySelector("."+Ne)&&(ne.removeClass([t.querySelector("."+Ne)],[Je]),ne.removeClass([t.querySelector("."+Le)],[et]),n=a&&a.ganttProperties.segments&&0<a.ganttProperties.segments.length?t.parentElement:t)&&n.querySelector("."+Ve)&&ne.removeClass([n.querySelector("."+Ve)],[tt]),ne.isNullOrUndefined(this.parent.taskFields.dependency)||!t.querySelector("."+pt)&&!t.parentElement.querySelector("."+pt)?this.parent.isAdaptive&&(r=this.parent.ganttChartModule.getRecordByTaskBar(t))&&r.hasChildRecords&&ne.removeClass([t],[Tt]):(o=(s=ne.isNullOrUndefined(t.querySelector("."+pt))?t.parentElement:t).querySelector("."+pt),l=s.querySelector("."+ut),o&&ne.removeClass([o],[ct]),l&&ne.removeClass([l],[gt])),this.editElement=null))},D.prototype.getTaskBarAction=function(e){var e=this.getElementByPosition(e),t=this.taskBarEditRecord,i="";return e.classList.contains(Ne)?i="LeftResizing":e.classList.contains(Le)?i="RightResizing":(e.classList.contains(Ve)||ne.closest(e,"."+Ve))&&this.parent.taskFields.progress?i="ProgressResizing":e.classList.contains(pt)?i="ConnectorPointLeftDrag":e.classList.contains(ut)?i="ConnectorPointRightDrag":e.classList.contains(Ye)?i="ParentResizing":e.classList.contains(_e)||e.classList.contains(qe)||e.classList.contains(Ze)?i="ManualParentDrag":t&&(i=t.hasChildRecords?this.resolveCondition(t[this.parent.taskFields.manual],"","ParentDrag"):t.ganttProperties.isMilestone?"MilestoneDrag":"ChildDrag"),i},D.prototype.updateMouseDownProperties=function(e){var e=this.getCoordinate(e),t=this.parent.element.closest('[style*="zoom"]');t&&(t=parseFloat(getComputedStyle(t).zoom),e.pageX=e.pageX/t,e.pageY=e.pageY/t),(e.pageX||e.pageY)&&(t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),this.parent.enableRtl?this.mouseDownX=Math.abs(e.pageX-(t.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseDownX=e.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseDownX,this.mouseDownY=this.dragMoveY=e.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top),"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.fromPredecessorText="ConnectorPointLeftDrag"===this.taskBarEditAction?"start":"finish",this.parent.connectorLineModule.tooltipTable.innerHTML="",this.parent.connectorLineModule.tooltipTable.appendChild(this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName,this.fromPredecessorText,"","")))},D.prototype.isMouseDragCheck=function(){var e;!this.isMouseDragged&&this.taskBarEditAction&&(this.mouseDownX!==this.mouseMoveX&&(this.mouseDownX+3<this.mouseMoveX||this.mouseDownX-3>this.mouseMoveX)||this.mouseDownY!==this.mouseMoveY&&(this.mouseDownY+3<this.mouseMoveY||this.mouseDownY-3>this.mouseMoveY))&&(this.isMouseDragged=!0,this.parent.initiateEditAction(!0),e=this.taskBarEditRecord.ganttProperties,this.previousItem=this.parent.timelineModule.extendFunction(e,this.previousItemProperty),"ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction||"ResourceView"===this.parent.viewType&&"ParentDrag"===this.taskBarEditAction||this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),this.taskBarEditElement.setAttribute("aria-grabbed","true"))},D.prototype.removeFirstBorder=function(e){("bottomSegment"===this.parent.rowDragAndDropModule.dropPosition||0<this.parent.element.getElementsByClassName("e-firstrow-border").length&&e&&e.getAttribute("aria-rowindex")-1!=0)&&this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove()},D.prototype.removeLastBorder=function(e){var t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow")),t=this.parent.enableVirtualization?e&&!t&&this.parent.treeGrid.getRows()[this.parent.treeGrid.getCurrentViewRecords().length-1].getAttribute("data-uid")!==e.getAttribute("data-uid"):e&&!t&&this.parent.treeGrid.getRowByIndex(this.parent.treeGrid.getCurrentViewRecords().length-1).getAttribute("data-uid")!==e.getAttribute("data-uid"),i="topSegment"===this.parent.rowDragAndDropModule.dropPosition||t;0<this.parent.element.getElementsByClassName("e-lastrow-border").length&&e&&(i||t)&&this.parent.element.getElementsByClassName("e-lastrow-border")[0].remove()},D.prototype.removetopOrBottomBorder=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop"));e.length&&(this.addRemoveClasses(e,!1,"e-dropbottom"),this.addRemoveClasses(e,!1,"e-droptop"))},D.prototype.topOrBottomBorder=function(t){var e;(e=(this.parent.enableVirtualization?(e=this.parent.treeGrid.getRows().filter(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1==parseInt(t.getAttribute("aria-rowindex"),10)-1})[0],e=this.parent.treeGrid.getRows().indexOf(e),this.parent.getRowByIndex(e)):this.parent.getRowByIndex(parseInt(t.getAttribute("aria-rowindex"),10)-1)).children)&&("above"===this.parent.rowDragAndDropModule.dropPosition&&(this.addRemoveClasses(e,!0,"e-droptop"),0<this.parent.element.getElementsByClassName("e-lastrow-dragborder").length)&&this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0].remove(),"below"===this.parent.rowDragAndDropModule.dropPosition)&&this.addRemoveClasses(e,!0,"e-dropbottom")},D.prototype.removeChildBorder=function(){var e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder"));0<e.length&&this.addRemoveClasses(e,!1,"e-childborder")},D.prototype.addRemoveClasses=function(e,t,i){for(var a=0,n=e.length;a<n;a++)t?e[parseInt(a.toString(),10)].classList.add(i):e[parseInt(a.toString(),10)].classList.remove(i)},D.prototype.processDropPosition=function(e,t,i){var a,n,r,s,o;i&&(s=0,a=this.parent.enableVirtualization?this.parent.treeGrid.getRows().filter(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1==parseInt(i.getAttribute("aria-rowindex"),10)-1})[0]:this.parent.treeGrid.getRows()[parseInt(i.getAttribute("aria-rowindex"),10)-1],this.removeFirstBorder(a),this.removeLastBorder(a),(ne.isNullOrUndefined(a)||a.getAttribute("data-uid")!==this.draggedTreeGridRowElement.getAttribute("data-uid"))&&S(t,"e-chart-rows-container")||(this.parent.rowDragAndDropModule.dropPosition="Invalid",this.addErrorElem()),t=0,o=(n=this.parent).toolbarModule?this.parent.toolbarModule.element.offsetHeight:0,r=this.parent.getOffsetRect(n.element),r=n.treeGrid.getHeaderContent().offsetHeight+r.top+o,o=n.treeGrid.getContent().firstElementChild.scrollTop,ne.isNullOrUndefined(a)||(s=a.offsetTop-o),n=((t=this.parent.enableVirtualization?this.parent.getOffsetRect(a).top:s+r)+this.draggedTreeGridRowHeight-t)/3,r=(s=(o=t+n)+n)+n,n=(t="mousemove"===e.type?e.pageY:ne.isNullOrUndefined(e.changedTouches)?null:e.changedTouches[0].pageY)<=o,e=t<=r&&s<t,(r=t<=s&&o<t)||e||n)&&(s=void 0,s=this.parent.enableVirtualization?(o=this.parent.treeGrid.getRows().indexOf(a),this.parent.getRowByIndex(o)):this.parent.getRowByIndex(parseInt(a.getAttribute("aria-rowindex"),10)-1),t=ne.getValue("rowIndex",s),o=this.parent.currentViewData[t],t=!0,"ResourceView"!==this.parent.viewType||this.taskBarEditRecord.hasChildRecords||o.hasChildRecords||ne.isNullOrUndefined(o.parentItem)||this.taskBarEditRecord.parentItem.taskId!==o.parentItem.taskId||(t=!1),o&&this.ensurePosition([this.taskBarEditRecord],o),t)&&"Invalid"!==this.parent.rowDragAndDropModule.dropPosition&&(n&&(this.parent.rowDragAndDropModule.dropPosition="above",this.removeChildBorder(),this.removeErrorElem(),this.removetopOrBottomBorder(),this.topOrBottomBorder(s)),r&&(this.parent.rowDragAndDropModule.dropPosition="child",this.removetopOrBottomBorder(),this.addRemoveClasses(s.children,!0,"e-childborder")),e)&&(this.parent.rowDragAndDropModule.dropPosition="below",this.removetopOrBottomBorder(),this.removeErrorElem(),this.removeChildBorder(),this.removeFirstBorder(a),this.topOrBottomBorder(a))},D.prototype.handleRowDrop=function(e,t,i){var a,n,r;e&&(e=t[t=Array.from(this.parent.ganttChartModule.getChartRows()).indexOf(e)],a=this.parent.getRootParent(e,0).index,n=this.parent.getRootParent(this.taskBarEditRecord,0).index,r={cancel:!1,data:this.taskBarEditRecord,fromIndex:this.taskBarEditRecord.index,dropIndex:e.index,dropPosition:this.parent.rowDragAndDropModule.dropPosition,dropRecord:e},this.parent.trigger("rowDrop",r),!r.cancel)&&e&&t!==i&&(a!==n||this.taskBarEditRecord.hasChildRecords&&e.hasChildRecords||!this.taskBarEditRecord.hasChildRecords)&&(r=this.parent.flatData.indexOf(e),t=void 0,t=("ProjectView"!==this.parent.viewType||ne.isNullOrUndefined(this.parent.rowDragAndDropModule.dropPosition))&&(e.hasChildRecords||0===e.childRecords.length&&!e.parentItem)?"child":this.parent.rowDragAndDropModule.dropPosition,this.parent.rowDragAndDropModule&&("ResourceView"!==this.parent.viewType||"child"!==t||e.hasChildRecords||ne.isNullOrUndefined(e.parentItem)||(this.parent.rowDragAndDropModule.dropPosition=t="Invalid"),t)&&this.parent.rowDragAndDropModule.reorderRows([i],r,t),this.dragMoveY=0)},D.prototype.shouldIgnoreWeekendExceptions=function(e){return!this.parent.includeWeekend||0===e.exceptionsRanges.length},D.prototype.addErrorElem=function(){var e,t=document.getElementsByClassName("e-clone-taskbar")[0];document.querySelectorAll(".e-errorelem").length||(e=document.createElement("div"),ne.classList(e,["e-errorcontainer"],[]),ne.classList(e,["e-icons","e-errorelem"],[]),this.taskBarEditRecord.ganttProperties.segments&&0<this.taskBarEditRecord.ganttProperties.segments.length&&(e.style.paddingTop=this.parent.taskbarHeight+"px"),t.appendChild(e))},D.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem");e&&e.remove()},D.prototype.ensurePosition=function(e,t){var i=this;e.filter(function(e){e.hasChildRecords&&!ne.isNullOrUndefined(e.childRecords)&&(-1===e.childRecords.indexOf(t)?i.ensurePosition(e.childRecords,t):(i.parent.rowDragAndDropModule.dropPosition="Invalid",i.addErrorElem()))})},D.prototype.mouseMoveAction=function(i){var a=this;if(0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&!ne.isNullOrUndefined(this.taskBarEditAction)&&this.parent.cancelEdit(),this.parent.isAdaptive){if(!this.canDrag)return;this.multipleSelectionEnabled()}var e=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),t=this.getCoordinate(i),t=(this.parent.enableRtl?this.mouseMoveX=Math.abs(t.pageX-(e.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=t.pageX-e.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.mouseMoveY=t.pageY-e.top+this.parent.ganttChartModule.scrollObject.previousScroll.top,this.dragMouseLeave=!1);if("ChildDrag"!==this.taskBarEditAction&&"ParentDrag"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction&&"MilestoneDrag"!==this.taskBarEditAction||(e=void 0,e=this.parent.enableVirtualization?(n=this.parent.currentViewData.indexOf(this.taskBarEditRecord),this.parent.getRowByIndex(n)):this.parent.getRowByIndex(this.taskBarEditRecord.index),n={cancel:t,cloneElement:this.taskbarElement,data:this.taskBarEditRecord,target:i.target,rows:e},this.parent.trigger("rowDrag",n),t=n.cancel),t||this.isMouseDragCheck(),this.isMouseDragged&&this.taskBarEditAction){if(i.preventDefault(),ne.isNullOrUndefined(this.taskbarElement)||ne.isNullOrUndefined(this.editElement)||"ConnectorPointRightDrag"===this.taskBarEditAction||"ConnectorPointLeftDrag"===this.taskBarEditAction||"ResourceView"===this.parent.viewType&&this.currentData.hasChildRecords||(s=this.editElement.parentElement,this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth>3*this.parent.element.offsetWidth?s.style.setProperty("position","relative"):s.style.setProperty("position","absolute"),("ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||ne.isNullOrUndefined(this.currentIndex)||ne.isNullOrUndefined(this.currentIndex)||0!==Number(this.currentIndex)?this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction?this.parent.chartPane.getElementsByClassName("e-gantt-chart")[0]:s:(this.taskbarElement.childNodes[0].childNodes[0].style.setProperty("top",s.parentElement.offsetTop+"px"),this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction?this.parent.chartPane.getElementsByClassName("e-gantt-chart")[0]:s.parentElement)).appendChild(this.taskbarElement),"ProgressResizing"!==this.taskBarEditAction&&(this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth>3*this.parent.element.offsetWidth?this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-scroll-container"):this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-rows-container"))[0].appendChild(this.taskbarResizer)),this.parent.allowTaskbarDragAndDrop&&("ChildDrag"===this.taskBarEditAction||"ParentDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction||"ManualParentDrag"===this.taskBarEditAction)){var e=this.parent.getOffsetRect(this.taskBarEditElement),n=this.resolveCondition(!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger"),12,0),t=3+this.parent.chartRowsModule.connectorPointWidth+n,n=void 0,n=this.parent.enableRtl?Math.abs(e.left+t+1):Math.abs(e.left-t-1),e=(this.isClonedElement||this.parent.enableRtl||(n-=this.parent.ganttChartModule.scrollElement.scrollLeft,this.isClonedElement=!0),this.parent.rowDragAndDropModule.dropPosition=void 0),t=void 0,t="touchmove"===i.type||"touchstart"===i.type||"touchend"===i.type?i.changedTouches[0].pageY:i.y,n=(this.parent.enableRtl?(e=document.elementFromPoint(this.parent.ganttChartModule.chartBodyContainer.offsetWidth,t)).classList.contains("e-taskbar-resize-div")&&(e=document.elementFromPoint(this.parent.ganttChartModule.chartBodyContainer.offsetWidth-e.offsetWidth,t)):e=document.elementFromPoint(n,t),void 0);if(this.parent.enableVirtualization)this.draggedTreeGridRowElement||(n=(s=this.editElement.parentElement).parentElement,this.draggedTreeGridRowElement=n,this.draggedTreeGridRowHeight=this.draggedTreeGridRowElement.offsetHeight);else if(n=this.parent.treeGrid.getRows()[this.parent.flatData.indexOf(this.taskBarEditRecord)],this.draggedTreeGridRowElement=n,this.parent.enableMultiTaskbar)if(this.taskBarEditRecord.parentItem&&!ne.isNullOrUndefined(this.parent.getRowByID(this.taskBarEditRecord.parentItem.taskId))){if(this.draggedTreeGridRowHeight=this.parent.getRowByID(this.taskBarEditRecord.parentItem.taskId).offsetHeight,"ProjectView"===this.parent.viewType&&0===this.draggedTreeGridRowHeight)for(var r=this.parent.getRecordByID(this.taskBarEditRecord.parentItem.taskId);r.parentItem;)r=this.parent.getRecordByID(r.parentItem.taskId),this.draggedTreeGridRowHeight=this.parent.getRowByID(r.TaskID).offsetHeight}else{var s=this.editElement.parentElement;this.draggedTreeGridRowElement=s.parentElement,this.draggedTreeGridRowHeight=this.draggedTreeGridRowElement.offsetHeight}else this.draggedTreeGridRowHeight=this.draggedTreeGridRowElement.offsetHeight;t=void 0;e&&(t=ne.closest(e,"tr."+Fe)),this.processDropPosition(i,e,t)}var o={cancel:!1,requestType:"taskbarediting",taskBarEditAction:this.taskBarEditAction,data:this.taskBarEditRecord};-1!==this.segmentIndex&&(o.requestType="mergeSegment"),this.parent.trigger("actionBegin",o,function(e){var t;"ConnectorPointRightDrag"!==o.taskBarEditAction&&"ConnectorPointLeftDrag"!==o.taskBarEditAction&&"LeftResizing"!==o.taskBarEditAction&&"RightResizing"!==o.taskBarEditAction&&"ProgressResizing"!==o.taskBarEditAction&&"ChildDrag"!==o.taskBarEditAction&&"ParentDrag"!==o.taskBarEditAction&&"MilestoneDrag"!==o.taskBarEditAction&&"ManualParentDrag"!==o.taskBarEditAction&&"ParentResizing"!==o.taskBarEditAction||(a.parent.showIndicator=!1,a.parent.undoRedoModule&&a.parent.isUndoRedoItemPresent("Edit")&&(a.parent.undoRedoModule.redoEnabled&&a.parent.undoRedoModule.disableRedo(),t={},0===a.parent.undoRedoModule.getUndoCollection.length||a.parent.editModule.createArray)&&(a.isDragged=!0,t.modifiedRecords=[],t.action=o.taskBarEditAction,a.parent.undoRedoModule.createUndoCollection(),a.parent.undoRedoModule.getUndoCollection[a.parent.undoRedoModule.getUndoCollection.length-1]=t,a.parent.editModule.createArray=!1,a.parent.undoRedoModule.changedRecords=[])),!1===e.cancel?(a.parent.showIndicator&&a.parent.showLoadingIndicator(),a.taskBarEditingAction(i,!1)):a.editTooltip.updateTooltip(a.segmentIndex)})}else this.parent.isAdaptive||this.taskBarEditAction||this.updateTaskBarEditElement(i)},D.prototype.taskBarEditingAction=function(e,t){var a=this,n={},i=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement);if(null!==this.taskBarEditRecord&&(n.editingFields=this.taskBarEditRecord.ganttProperties,n.data=this.taskBarEditRecord,"ResourceView"!==this.parent.viewType||0!==n.data.level)){n.recordIndex=i,n.taskBarEditAction=this.taskBarEditAction,n.roundOffDuration=this.roundOffDuration,n.cancel=!1,n.previousData=this.previousItem,n.segmentIndex=this.segmentIndex,this.roundOffDuration=n.roundOffDuration,this.targetElement=n.target=this.cloneTaskbarElement,this.updateMouseMoveProperties(e),this.oldData||(this.oldData=ne.extend([],[],[this.taskBarEditRecord],!0)[0]);var r=-1!==this.segmentIndex?this.segmentIndex:null;if("ProgressResizing"===this.taskBarEditAction){if(this.mainElement=S(this.taskBarEditElement,ve),this.taskBarEditRecord.ganttProperties.segments&&0<this.taskBarEditRecord.ganttProperties.segments.length)for(var r=-1,s=0;s<this.taskBarEditRecord.ganttProperties.segments.length;s++){var o=document.getElementsByClassName("e-child-progress-resizer e-progress-resize-gripper")[0].style,o=this.resolveCondition(this.parent.enableRtl,parseInt(o.right,10)-8,parseInt(o.left,10)+8);o<this.taskBarEditRecord.ganttProperties.segments[s].width&&0===s&&(r=s),this.taskBarEditRecord.ganttProperties.segments[s+1]&&o<this.taskBarEditRecord.ganttProperties.segments[s+1].width+this.taskBarEditRecord.ganttProperties.segments[s+1].left&&o>this.taskBarEditRecord.ganttProperties.segments[s+1].left&&(r=s+1)}this.performProgressResize(e,r)}else"LeftResizing"===this.taskBarEditAction?this.enableLeftResizing(e):"RightResizing"===this.taskBarEditAction||"ParentResizing"===this.taskBarEditAction?this.enableRightResizing(e):"ParentDrag"===this.taskBarEditAction||"ChildDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction||"ManualParentDrag"===this.taskBarEditAction?this.enableDragging(e):"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||(this.updateConnectorLineSecondProperties(e),this.triggerDependencyEvent(e),this.drawFalseLine());if(this.parent.allowTaskbarDragAndDrop&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction){var i=this.parent.getOffsetRect(this.parent.chartPane),l=this.getCoordinate(e),d=l.pageY,l=l.pageX,l={left:Math.abs(l-i.left),top:d-i.top};if("ResourceView"===this.parent.viewType&&this.parent.enableMultiTaskbar){var h=this.parent.getRecordByID(this.taskBarEditRecord.parentItem.taskId);if(!this.parent.allowTaskbarOverlap&&this.taskBarEditRecord.parentItem&&!h.expanded){var p=0;if(parseInt(this.editElement.style.marginTop,10)>this.parent.rowHeight){for(s=0;s<h.childRecords.length&&h.childRecords[s].ganttProperties.taskId!==this.taskBarEditRecord.ganttProperties.taskId;s++)p+=this.parent.rowHeight;l.top=l.top-p}}}this.topValue=l.top;d=void 0,d=("touchmove"===e.type||"touchstart"===e.type||"touchend"===e.type?e.changedTouches[0]:e).pageX;this.parent.enableRtl?this.leftValue=l.left-Math.abs(d-this.parent.getOffsetRect(this.taskBarEditElement).left)-this.resolveCondition(0!==this.previousLeftValue,d-this.previousLeftValue,0):this.leftValue=l.left-(d-this.parent.getOffsetRect(this.taskBarEditElement).left)+this.resolveCondition(0!==this.previousLeftValue,d-this.previousLeftValue,0),0===this.previousLeftValue&&(this.parent.enableRtl?(this.leftValue=this.leftValue-this.parent.ganttChartModule.scrollObject.previousScroll.left,0===this.parent.ganttChartModule.scrollObject.previousScroll.left&&(this.leftValue=this.leftValue-60)):this.leftValue=this.leftValue-this.parent.ganttChartModule.scrollObject.previousScroll.left),this.previousLeftValue=d}else this.leftValue=this.taskBarEditRecord.ganttProperties.left;this.currentSegmentIndex=r,this.setItemPosition(),this.updateEditedItem(),this.tooltipValue=("touchmove"===e.type||"touchstart"===e.type||"touchend"===e.type?e.changedTouches[0]:e).pageX,this.taskBarEditRecord.ganttProperties.segments&&-1===r||this.editTooltip.updateTooltip(r),t&&this.taskBarEditedAction(e),this.parent.trigger("taskbarEditing",n,function(e){var t,i=!!a.parent.taskFields.constraintType&&!!a.parent.taskFields.constraintDate;!0!==e.cancel&&i&&2!==e.data.ganttProperties.constraintType&&3!==e.data.ganttProperties.constraintType&&-1!==["ChildDrag","ParentDrag","MilestoneDrag","LeftResizing","RightResizing"].indexOf(e.taskBarEditAction)&&(n.data.ganttProperties.constraintType=4,n.data.ganttProperties.constraintDate=n.data.ganttProperties.startDate),("ChildDrag"!==e.taskBarEditAction&&"ParentDrag"!==e.taskBarEditAction&&"MilestoneDrag"!==e.taskBarEditAction||2!==e.data.ganttProperties.constraintType&&3!==e.data.ganttProperties.constraintType)&&("LeftResizing"!==e.taskBarEditAction||2!==e.data.ganttProperties.constraintType)&&("RightResizing"!==e.taskBarEditAction||3!==e.data.ganttProperties.constraintType)||(i=a.parent.predecessorModule.filterPredecessorsByTarget(n.data.ganttProperties.predecessor,n.data,a.parent.viewType),t=(!(t=e.data.ganttProperties.predecessor&&0<e.data.ganttProperties.predecessor.length)||0!==i.length)&&t)||(e.cancel=!0),e.cancel&&null!==a.taskBarEditRecord&&(a.tapPointOnFocus=!1,ne.merge(a.taskBarEditRecord.ganttProperties,e.previousData))})}},D.prototype.updateMouseMoveProperties=function(e){var t=this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer),e=this.getCoordinate(e),i=this.parent.element.closest('[style*="zoom"]'),i=(i&&(i=parseFloat(getComputedStyle(i).zoom),e.pageX=e.pageX/i,e.pageY=e.pageY/i),(e.pageX||e.pageY)&&(this.parent.enableRtl?this.mouseMoveX=Math.abs(e.pageX-(t.left+Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left))):this.mouseMoveX=e.pageX-t.left+this.parent.ganttChartModule.scrollObject.previousScroll.left,this.tooltipPositionX=this.mouseMoveX,this.mouseMoveY=e.pageY-t.top+this.parent.ganttChartModule.scrollObject.previousScroll.top),"ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction);(3<this.taskBarEditRecord.ganttProperties.width||this.taskBarEditRecord.ganttProperties.isMilestone)&&("ProgressResizing"!==this.taskBarEditAction||0!==this.taskBarEditRecord.ganttProperties.progress&&100!==this.taskBarEditRecord.ganttProperties.progress)||i?(e=0,e=this.parent.enableRtl?Math.abs(Math.abs(this.mouseMoveX)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left)+t.left):this.mouseMoveX-this.parent.ganttChartModule.scrollObject.previousScroll.left+t.left,i=this.mouseMoveY-this.parent.ganttChartModule.scrollObject.previousScroll.top+t.top,e+20>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):e+40>t.left+this.parent.ganttChartModule.chartBodyContainer.offsetWidth&&this.parent.enableRtl&&0===this.parent.ganttChartModule.scrollObject.previousScroll.left?(this.parent.ganttChartModule.scrollObject.previousScroll.left=-1,this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("right")):e-20<t.left?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.left,this.startScrollTimer("left")):i+80>t.top+this.parent.ganttChartModule.chartBodyContainer.offsetHeight?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("bottom")):i-20<t.top?(this.timerCount=this.parent.ganttChartModule.scrollObject.previousScroll.top,this.startScrollTimer("top")):this.stopScrollTimer()):this.stopScrollTimer()},D.prototype.startScrollTimer=function(e){var t=this,i=(this.stopScrollTimer(),0);this.scrollTimer=window.setInterval(function(){i=t.handleScrollTimerTick(e,i)},0)},D.prototype.handleScrollTimerTick=function(e,t){var i;return-1===Math.sign(this.timerCount)&&(t=-1,this.timerCount=Math.abs(this.timerCount)),"right"===e?(i=this.resolveCondition(this.parent.enableTimelineVirtualization,this.parent.timelineModule.wholeTimelineWidth,this.parent.timelineModule.totalTimelineWidth),this.timerCount=this.resolveCondition(this.timerCount+1>=i,i,this.timerCount+1)):this.timerCount="bottom"===e?this.timerCount+1:this.timerCount-1<0?0:this.timerCount-1,"bottom"===e||"top"===e?this.parent.ganttChartModule.scrollObject.setScrollTop(this.timerCount):this.parent.ganttChartModule.scrollObject.setScrollLeft(this.timerCount,t),"ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||this.drawFalseLine(),t},D.prototype.stopScrollTimer=function(){window.clearInterval(this.scrollTimer),this.scrollTimer=null},D.prototype.enableDragging=function(e){var t,i,a,n,r,s=this.taskBarEditRecord.ganttProperties,o=this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:this.parent.timelineModule.totalTimelineWidth,l=0;this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&!this.taskBarEditElement.classList.contains("e-segment-first")?(i=(t=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return Object.assign({},e)}))[this.segmentIndex],this.mouseDownX>this.mouseMoveX?(l=ne.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,i.left=i.left-l):(l=ne.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,i.left=i.left+l),a=t[this.segmentIndex-1],n=t[this.segmentIndex+1],r=void 0,r=this.taskBarEditElement.classList.contains("e-segment-inprogress")?i.left<a.left+a.width?a.left+a.width:i.width+i.left>n.left?n.left-i.width:i.left:i.left<a.left+a.width?a.left+a.width:s.left+i.width+i.left>=o?o-i.width:i.left,i.left=r,this.parent.setRecordValue("segments",t,s,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")):(this.mouseDownX>this.mouseMoveX?0<(l=this.mouseDownX-this.mouseMoveX)&&this.parent.setRecordValue("left",this.previousItem.left-l,s,!0):(l=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+l,s,!0)),r=s.left<0?0:s.left+s.width>=o?o-s.width:s.left,this.parent.setRecordValue("left",r,s,!0))},D.prototype.validateProgressWidth=function(e,t,i){if(-1!==this.currentSegmentIndex&&e.segments){var a=this.currentSegmentIndex>=this.segmentIndex?0:0!==this.currentSegmentIndex?this.currentSegmentIndex:-1,n=this.currentSegmentIndex>=this.segmentIndex?this.currentSegmentIndex:this.segmentIndex;if(-1!==a)for(var r=a;r<n;r++)t-=e.segments[r+1].left-(e.segments[r].left+e.segments[r].width)}return e.segments&&0<e.segments.length&&(i=this.splitTasksDuration(e.segments)*this.parent.perDayWidth,i=e.segments.reduce(function(e,t){return e+t.width},0)),{progressWidth:t=i<t?i:t,totalTaskWidth:i}},D.prototype.performProgressResize=function(e,t){var i=this.taskBarEditRecord.ganttProperties,a=0,n=i.progressWidth,a=(this.mouseDownX>this.mouseMoveX?this.mouseMoveX>i.left&&this.mouseMoveX<i.left+i.width&&0<i.left?(a=this.mouseMoveX-i.left,this.parent.setRecordValue("progressWidth",a,i,!0)):this.mouseMoveX>=i.left+i.width?this.parent.setRecordValue("progressWidth",i.width,i,!0):this.parent.setRecordValue("progressWidth",0,i,!0):this.mouseMoveX>i.left&&this.mouseMoveX<i.left+i.width?(a=this.mouseMoveX-i.left,this.parent.setRecordValue("progressWidth",a,i,!0)):this.mouseMoveX<=i.left?this.parent.setRecordValue("progressWidth",0,i,!0):this.parent.setRecordValue("progressWidth",i.width,i,!0),this.resolveCondition(i.progressWidth>i.width,i.width,i.progressWidth),this.resolveCondition(i.progressWidth<0,0,i.progressWidth)),t=(t&&-1===t?this.parent.setRecordValue("progressWidth",n,i,!0):this.parent.setRecordValue("progressWidth",a,i,!0),this.progressValue=a,i.width-i.progressWidth);this.progressBorderRadius=t<=4?4-t:0},D.prototype.enableLeftResizing=function(e){var t=this.taskBarEditRecord.ganttProperties,i=0;this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&1<t.segments.length?this.enableSplitTaskLeftResize(t):(this.mouseDownX>this.mouseMoveX?this.mouseMoveX<t.left+t.width?(i=this.mouseDownX-this.mouseMoveX,0<t.left&&(this.parent.setRecordValue("left",this.previousItem.left-i,t,!0),this.parent.setRecordValue("width",this.previousItem.width+i,t,!0))):this.mouseMoveX>t.left+t.width&&(i=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("left",this.previousItem.left-i,t,!0),this.parent.setRecordValue("width",3,t,!0)):this.mouseMoveX<t.left+t.width?(i=this.mouseMoveX-this.mouseDownX,t.left<t.left+t.width&&this.previousItem.left+i<=this.previousItem.left+this.previousItem.width&&(this.parent.setRecordValue("left",this.previousItem.left+i,t,!0),this.parent.setRecordValue("width",this.previousItem.width-i,t,!0))):(i=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("left",this.previousItem.left+i,t,!0),this.parent.setRecordValue("width",3,t,!0)),t.segments&&1===t.segments.length&&(t.segments[0].width=t.width),this.updateEditPosition(e,t),this.parent.setRecordValue("left",this.previousItem.left+this.previousItem.width-t.width,t,!0))},D.prototype.enableSplitTaskLeftResize=function(e){var t=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return Object.assign({},e)}),i=t[this.segmentIndex],a=0;if(this.mouseDownX>this.mouseMoveX)if(this.mouseMoveX<e.left+i.width+i.left){var n,a=ne.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX;if(this.previousMouseMove=this.mouseMoveX,0<i.left)i.left=i.left-a,i.width=i.width+a,0!==this.segmentIndex&&(n=t[this.segmentIndex-1],e.left+i.left<e.left+n.left+n.width)&&(n=e.left+n.left+n.width-(e.left+i.left),i.width-=n,i.left=i.left+n);else if(i.left<=0&&0===this.segmentIndex){this.parent.setRecordValue("left",e.left-a,e,!0),this.parent.setRecordValue("width",e.width+a,e,!0),i.width=i.width+a;for(var r=1;r<e.segments.length;r++){var s=t[r];s.left=s.left+a}}}else this.mouseMoveX>e.left+i.width+i.left&&(a=ne.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,i.left=i.left-a,i.width=this.parent.perDayWidth);else if(this.mouseMoveX<e.left+i.width+i.left-this.parent.perDayWidth)if(a=ne.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,0===this.segmentIndex&&i.left<=0){this.parent.setRecordValue("left",e.left+a,e,!0),this.parent.setRecordValue("width",e.width-a,e,!0),i.width=i.width-a;for(r=1;r<e.segments.length;r++){var o=t[r];o.left=o.left-a}}else i.left<i.left+i.width&&i.left+a<=i.left+i.width&&(i.left=i.left+a,i.width=i.width-a);else if(this.mouseMoveX<e.left+i.left+i.width&&i.width>this.parent.perDayWidth)if(a=ne.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,a-=i.width-a<this.parent.perDayWidth?this.parent.perDayWidth>i.width?this.parent.perDayWidth-i.width:i.width-this.parent.perDayWidth:0,0===this.segmentIndex){this.parent.setRecordValue("width",e.width-a,e,!0),this.parent.setRecordValue("left",e.left+a,e,!0),i.width=i.width-a;for(r=1;r<e.segments.length;r++){var l=t[r];l.left=l.left-a}}else i.left=i.left+a,i.width=i.width-a;this.parent.setRecordValue("segments",t,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},D.prototype.updateEditPosition=function(e,t){this.updateIsMilestone(t),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(t.width,t.progress),t,!0)},D.prototype.updateIsMilestone=function(e){e.width<=3?(this.parent.setRecordValue("width",3,e,!0),this.parent.setRecordValue("isMilestone",!0,e,!0),ne.isNullOrUndefined(this.taskBarEditRecord[this.parent.taskFields.milestone])||this.parent.setRecordValue(this.parent.taskFields.milestone,!0,this.taskBarEditRecord,!0)):(this.parent.setRecordValue("width",e.width,e,!0),this.parent.setRecordValue("isMilestone",!1,e,!0),ne.isNullOrUndefined(this.taskBarEditRecord[this.parent.taskFields.milestone])||this.parent.setRecordValue(this.parent.taskFields.milestone,!1,this.taskBarEditRecord,!0))},D.prototype.enableRightResizing=function(e){var t,i,a,n,r=this.taskBarEditRecord.ganttProperties,s=0;this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&1<r.segments.length?(i=(t=this.taskBarEditRecord.ganttProperties.segments.map(function(e){return Object.assign({},e)}))[this.segmentIndex],a=void(this.mouseDownX>this.mouseMoveX?this.mouseMoveX>r.left+i.left&&3<this.mouseDownX-this.mouseMoveX?(s=ne.isNullOrUndefined(this.previousMouseMove)?this.mouseDownX-this.mouseMoveX:this.previousMouseMove-this.mouseMoveX,this.previousMouseMove=this.mouseMoveX,i.width=i.width-s):this.mouseMoveX<r.left+i.left&&(a=this.parent.timelineModule.isSingleTier&&("Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Hour"===this.parent.timelineModule.customTimelineSettings.topTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.topTier.unit)||"Hour"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit||"Minutes"===this.parent.timelineModule.customTimelineSettings.bottomTier.unit?this.parent.timelineModule.customTimelineSettings.timelineUnitSize:this.parent.perDayWidth,i.width=a):this.mouseMoveX>i.left&&(s=ne.isNullOrUndefined(this.previousMouseMove)?this.mouseMoveX-this.mouseDownX:this.mouseMoveX-this.previousMouseMove,this.previousMouseMove=this.mouseMoveX,i.width=i.width+s)),n=this.segmentIndex!==t.length-1?t[this.segmentIndex+1]:null,ne.isNullOrUndefined(n)||(this.taskBarEditElement.classList.contains("e-segment-last")||(a=i.left+i.width>n.left?n.left-i.left:i.width),i.width=a),this.segmentIndex===r.segments.length-1&&0===this.segmentIndex&&this.parent.setRecordValue("width",i.width,r,!0),this.parent.setRecordValue("segments",t,r,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")):(this.mouseDownX>this.mouseMoveX?this.mouseMoveX>r.left&&3<this.mouseDownX-this.mouseMoveX?(s=this.mouseDownX-this.mouseMoveX,this.parent.setRecordValue("width",this.previousItem.width-s,r,!0)):this.mouseMoveX<r.left&&this.parent.setRecordValue("width",3,r,!0):this.mouseMoveX>r.left&&(s=this.mouseMoveX-this.mouseDownX,this.parent.setRecordValue("width",this.previousItem.width+s,r,!0)),r.segments&&1===r.segments.length&&(r.segments[0].width=r.width),this.updateEditPosition(e,r))},D.prototype.updateEditedItem=function(){var e,t,i,a=this.taskBarEditRecord.ganttProperties;switch(this.taskBarEditAction){case"ProgressResizing":var n=a.progressWidth,r=a.width,n=this.validateProgressWidth(a,n,r);this.parent.setRecordValue("progress",this.getProgressPercent(n.totalTaskWidth,n.progressWidth),a,!0);break;case"LeftResizing":-1===this.segmentIndex?(t=this.getRoundOffStartLeft(a,this.roundOffDuration),r=this.getDateByLeft(t),ne.isNullOrUndefined(a.endDate)&&(i=this.parent.dateValidationModule.getValidEndDate(a),this.parent.setRecordValue("endDate",i,a,!0)),e=this.parent.dateValidationModule.checkStartDate(r,a,null),this.parent.setRecordValue("startDate",new Date(e.getTime()),a,!0),0===this.parent.dateValidationModule.compareDates(a.startDate,a.endDate)&&ne.isNullOrUndefined(a.isMilestone)&&!1===a.isMilestone&&0===a.duration&&this.parent.setRecordValue("duration",1,a,!0),a.isMilestone&&this.parent.setRecordValue("endDate",new Date(e.getTime()),a,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")):this.updateSplitLeftResize(a);break;case"RightResizing":case"ParentResizing":-1===this.segmentIndex?(t=this.getRoundOffEndLeft(a,this.roundOffDuration),n=this.getDateByLeft(t),ne.isNullOrUndefined(a.startDate)&&(e=this.parent.dateValidationModule.getValidStartDate(a),this.parent.setRecordValue("startDate",e,a,!0)),r=ne.isNullOrUndefined(a.startDate)?e:a.startDate,i=a.isMilestone?r:this.parent.dateValidationModule.checkEndDate(n,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",new Date(i.getTime()),a,!0),this.parent.dateValidationModule.calculateDuration(this.taskBarEditRecord),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")):this.updateSplitRightResizing(a);break;case"ParentDrag":case"ChildDrag":case"MilestoneDrag":case"ManualParentDrag":-1===this.segmentIndex||0===this.segmentIndex||-1!==this.segmentIndex&&this.parent.allowTaskbarDragAndDrop?this.updateChildDrag(a):this.setSplitTaskDrag(a)}ne.isNullOrUndefined(this.taskBarEditRecord.ganttProperties.segments)||this.parent.chartRowsModule.updateSegment(this.taskBarEditRecord.ganttProperties.segments,this.taskBarEditRecord.ganttProperties.taskId)},D.prototype.extractEndDates=function(e){var a=this,n=new Date(0);return e.forEach(function(e){var t=a.parent.getRecordByID(e.from);if(t&&t.ganttProperties){var i=null;switch(e.type){case"FS":case"FF":i=t.ganttProperties.endDate||t.ganttProperties.startDate;break;case"SS":case"SF":i=t.ganttProperties.startDate||t.ganttProperties.endDate}i&&i.getTime()>n.getTime()&&(n=i)}}),{maxEndDate:n}},D.prototype.isValidDependency=function(e){var t,i;return!ne.isNullOrUndefined(e.ganttProperties)&&!ne.isNullOrUndefined(e.ganttProperties.predecessor)&&(t=e.ganttProperties.predecessor,i=this.extractEndDates(t).maxEndDate,i=this.parent.predecessorModule.getPredecessorDate(e,t,null))?{isValid:(ne.isNullOrUndefined(e.ganttProperties.startDate)?e.ganttProperties.endDate:e.ganttProperties.startDate).getTime()>=i.getTime(),maxDate:i}:{isValid:!0}},D.prototype.updateChildDrag=function(e){var t,i=this.getRoundOffStartLeft(e,this.roundOffDuration),i=this.getDateByLeft(i,e.isMilestone,e);0===this.segmentIndex?(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(i,e,null),e,!0),e.segments[0].startDate=i,e.segments[0].endDate=this.parent.dataOperation.getEndDate(e.segments[0].startDate,e.segments[0].duration,e.durationUnit,e,!1),this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments"),this.parent.chartRowsModule.incrementSegments(e.segments,0,this.taskBarEditRecord),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,this.parent.dataOperation.segmentTaskData(this.taskBarEditRecord),this.taskBarEditRecord,!0)):!ne.isNullOrUndefined(e.endDate)&&ne.isNullOrUndefined(e.startDate)?(t=this.parent.dateValidationModule.checkStartDate(i,e,null),t=this.parent.dateValidationModule.checkEndDate(t,this.taskBarEditRecord.ganttProperties),this.parent.setRecordValue("endDate",t,e,!0)):(this.parent.setRecordValue("startDate",this.parent.dateValidationModule.checkStartDate(i,e,null),e,!0),ne.isNullOrUndefined(e.duration)||this.parent.dateValidationModule.calculateEndDate(this.taskBarEditRecord))},D.prototype.updateSplitLeftResize=function(e){var t=e.calendarContext,i=e.segments[this.segmentIndex],a=0===this.segmentIndex?this.getRoundOffStartLeft(e,this.roundOffDuration):this.getRoundOffStartLeft(i,this.roundOffDuration),a=this.getDateByLeft(a),a=this.parent.dataOperation.checkStartDate(a,e,!1),n=this.parent.dataOperation.getDuration(a,i.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,t);i.startDate=new Date(a.getTime()),i.duration=n,this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),0===this.segmentIndex&&this.parent.setRecordValue("startDate",i.startDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration"),ne.isNullOrUndefined(e.segments[this.segmentIndex-1])||(a=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,t),i.offsetDuration=a),this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},D.prototype.updateSplitRightResizing=function(e){var t=e.calendarContext,i=e.segments[this.segmentIndex],a=this.getRoundOffEndLeft(e,this.roundOffDuration),a=this.getDateByLeft(a),a=this.parent.dataOperation.checkEndDate(a,e,!1),n=this.parent.dataOperation.getDuration(i.startDate,a,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,t);i.endDate=new Date(a.getTime()),i.duration=n,ne.isNullOrUndefined(e.segments[this.segmentIndex+1])||(a=e.segments[this.segmentIndex+1],n=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,a.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,t),i.offsetDuration=n),this.parent.setRecordValue("segments",e.segments,e,!0),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments"),this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),this.parent.editModule.updateResourceRelatedFields(this.taskBarEditRecord,"duration")},D.prototype.sumOfDuration=function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].duration;return t},D.prototype.setSplitTaskDrag=function(e){var t,i=e.calendarContext,a=e.segments[this.segmentIndex],n=this.parent.taskFields,r=this.getRoundOffStartLeft(a,this.roundOffDuration),r=this.getDateByLeft(r),r=this.parent.dateValidationModule.checkStartDate(r,e,null),r=(a.startDate=r,this.parent.dataOperation.getEndDate(a.startDate,a.duration,e.durationUnit,e,!1));e.segments[this.segmentIndex+1]&&r.getTime()>e.segments[this.segmentIndex+1].startDate.getTime()?a.endDate=e.segments[this.segmentIndex+1].startDate:a.endDate=r,a.duration=this.parent.dataOperation.getDuration(a.startDate,a.endDate,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,i),this.parent.setRecordValue("duration",this.sumOfDuration(e.segments),e,!0),this.parent.setRecordValue("endDate",e.segments[e.segments.length-1].endDate,e,!0),ne.isNullOrUndefined(n.endDate)||this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"endDate"),ne.isNullOrUndefined(e.segments[this.segmentIndex-1])||(t=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex-1].endDate,e.segments[this.segmentIndex].startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,i),1===a.startDate.getDay()&&0===t&&this.shouldIgnoreWeekendExceptions(i)&&(t=1),a.offsetDuration=t),ne.isNullOrUndefined(e.segments[this.segmentIndex+1])||(r=e.segments[this.segmentIndex+1],t=this.parent.dataOperation.getDuration(e.segments[this.segmentIndex].endDate,r.startDate,e.durationUnit,e.isAutoSchedule,e.isMilestone,void 0,i),1===r.startDate.getDay()&&0===t&&this.shouldIgnoreWeekendExceptions(i)&&(t=1),r.offsetDuration=t),this.parent.setRecordValue("segments",e.segments,e,!0),this.taskBarEditRecord[n.segments][this.segmentIndex]=this.parent.dataOperation.setSegmentTaskData(a,this.taskBarEditRecord[n.segments][this.segmentIndex]),this.parent.dataOperation.updateMappingData(this.taskBarEditRecord,"segments")},D.prototype.getRoundOffEndLeft=function(e,t){var i="None"!==this.parent.timelineModule.bottomTier?this.parent.timelineModule.bottomTier:this.parent.timelineModule.topTier,a=e.width+e.left,e=(-1!==this.segmentIndex&&1<e.segments.length&&(n=e.segments[this.segmentIndex],a=a-e.width+n.width+n.left),1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(a),1,"Day")/864e5)),n=this.parent.perDayWidth-this.parent.perDayWidth/e,r=n/this.parent.perDayWidth;return(t=void 0===t?!1:t)?"Hour"===i?(t=this.parent.perDayWidth/24,e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(a),1,"Hour")/36e5),0!==(n=this.parent.perDayWidth/24-this.parent.perDayWidth/24/e)&&(a=a-n+t)):"Minutes"===i?(t=this.parent.perDayWidth/1440,e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(a),1,"Minutes")/6e4),0!==(n=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/e)&&(a=a-n+t)):0!==n&&(a=a-n+this.parent.perDayWidth):"Hour"!==i&&"Minutes"!==i&&(.5<r?a=a-n+this.parent.perDayWidth:r<.5&&(a=a-n+this.parent.perDayWidth/2)),a},D.prototype.getRoundOffStartLeft=function(e,t){ne.isNullOrUndefined(e);var i=e.left,a=(-1!==this.segmentIndex&&ne.isNullOrUndefined(e.segments)&&(i=e.left+this.taskBarEditRecord.ganttProperties.left),this.resolveCondition("None"!==this.parent.timelineModule.bottomTier,this.parent.timelineModule.bottomTier,this.parent.timelineModule.topTier)),e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(i,ne.isNullOrUndefined(e)?e.isMilestone:null,e),1,"Day")/864e5),n=this.parent.perDayWidth-this.parent.perDayWidth/e,r=n/this.parent.perDayWidth;return(t=void 0===t?!1:t)?"Hour"===a?(e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(i),1,"Hour")/36e5),i-=n=this.parent.perDayWidth/24-this.parent.perDayWidth/24/e):"Minutes"===a?(e=1/(this.parent.timelineModule.getIncrement(this.getDateByLeft(i),1,"Minutes")/6e4),i-=n=this.parent.perDayWidth/1440-this.parent.perDayWidth/1440/e):i-=n:"Hour"!==a&&"Minutes"!==a&&(r<=.5?i-=n:.5<r&&(i=i-n+this.parent.perDayWidth/2)),i},D.prototype.getDSTTransitions=function(e){for(var t,i,a=Date.UTC(e,0,1),n=Date.UTC(e+1,0,1),r=new Date(a).getTimezoneOffset(),s=a;s<n;s+=36e5){var o=new Date(s),l=o.getTimezoneOffset();l!==r&&(l<r?t=o:i=o,r=l)}return{dstStart:t,dstEnd:i}},D.prototype.shouldAdjustForDst=function(e,t,i){return!!this.parent.isInDst(e)&&t<this.getDSTTransitions(i.getFullYear()).dstStart},D.prototype.getDateByLeft=function(e,t,i){var a=new Date(this.parent.timelineModule.timelineStartDate.toString()),n=new Date(a),r=864e5/this.parent.perDayWidth,s=new Date(n),e=(this.parent.timelineSettings.showWeekend?s.setTime(s.getTime()+e*r):n=s=this.parent.timelineModule.calculateDateExcludingNonWorkingDays(e,n),this.parent.timelineSettings.showWeekend?this.shouldAdjustForDst(s,a,n)?n.setTime(n.getTime()+(e-this.parent.perDayWidth/24)*r):n.setTime(n.getTime()+e*r):n=s,t&&!ne.isNullOrUndefined(i.predecessorsName)&&""!==i.predecessorsName&&(a=this.parent.getCurrentDayEndTime(this.resolveCondition(i.isAutoSchedule,i.autoEndDate,i.endDate)),this.parent.dateValidationModule.setTime(a,n),n=this.parent.dateValidationModule.checkStartDate(n,i,!0)),this.resolveCondition("None"!==this.parent.timelineModule.bottomTier,this.parent.timelineModule.topTier,this.parent.timelineModule.bottomTier));return"Hour"!==e&&"Minutes"!==e&&!this.parent.isInDst(n)&&this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString()))&&n.setTime(n.getTime()+36e5),n},D.prototype.setItemPosition=function(){ne.isNullOrUndefined(this.editElement)||(n=this.editElement.parentElement,a=this.taskBarEditRecord.ganttProperties.segments&&0<this.taskBarEditRecord.ganttProperties.segments.length,this.parent.allowTaskbarDragAndDrop&&"ChildDrag"===this.taskBarEditAction?n.style.position=null:this.parent.enableTimelineVirtualization&&this.parent.timelineModule.wholeTimelineWidth>3*this.parent.element.offsetWidth&&!a?n.style.setProperty("position","relative"):n.style.setProperty("position","absolute"));var e,t=this.taskBarEditRecord.ganttProperties,i=this.parent.enableRtl?"right":"left",a=ne.isNullOrUndefined(t.segments)?null:t.segments[this.segmentIndex],n="MilestoneDrag"===this.taskBarEditAction||t.isMilestone?this.parent.chartRowsModule.milestoneHeight:t.width,r=this.parent.isAdaptive?n-2:n-10,s=(ne.isNullOrUndefined(a)||(r=this.parent.isAdaptive?a.width-2:a.width-10),this.taskBarEditElement.style.setProperty("opacity",".75"),e=this.parent.allowTaskbarDragAndDrop&&!t.isAutoSchedule&&this.taskBarEditRecord.hasChildRecords||this.taskBarEditElement.classList.contains(ve)?this.taskBarEditElement:"ChildDrag"!==this.taskBarEditAction&&"LeftResizing"!==this.taskBarEditAction||0!==this.segmentIndex?ne.closest(this.taskBarEditElement,"tr."+Fe).querySelector("."+ve):this.taskBarEditElement.parentElement,!(!this.taskBarEditElement.classList.contains("e-segmented-taskbar")&&!this.taskBarEditElement.querySelector(".e-segmented-taskbar"))),o=this.taskBarEditElement.querySelector("."+ze),l=this.taskBarEditElement.querySelector("."+Ge),d=(s?S(this.taskBarEditElement,ve):this.taskBarEditElement).querySelector("."+Ve),h=this.taskBarEditElement.querySelector("."+Le),p=this.taskBarEditElement.querySelector("."+Ke),u=this.taskBarEditElement.querySelector("."+Qe),c=this.taskBarEditElement.querySelector("."+ft),g=e.querySelector("."+ft),f=this.taskBarEditElement,m=this.taskBarEditElement.querySelector("."+_e),y=(this.taskBarEditElement.querySelector("."+Ye),this.taskBarEditElement.querySelector(".e-gantt-manualparenttaskbar-left"),this.parent.ganttChartModule.chartBodyContainer.querySelector(".e-taskbar-resize-div"));if(this.parent.allowTaskbarDragAndDrop&&!this.updatePosition&&(this.leftValue=this.leftValue+30,this.updatePosition=!0),"ConnectorPointRightDrag"!==this.taskBarEditAction&&"ConnectorPointLeftDrag"!==this.taskBarEditAction){if("ParentResizing"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction){if(!s||ne.isNullOrUndefined(t.segments)||"RightResizing"!==this.taskBarEditAction&&0===this.segmentIndex||(ne.isNullOrUndefined(y)||(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&"ChildDrag"!==this.taskBarEditAction&&"ParentDrag"!==this.taskBarEditAction)&&(y.style.width=a.width+"px"),this.taskBarEditElement.style.width=a.width+"px",this.parent.enableRtl?this.taskBarEditElement.style.right=a.left+"px":(this.taskBarEditElement.style.left=a.left+"px",ne.isNullOrUndefined(y)||(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&"ChildDrag"!==this.taskBarEditAction&&"ParentDrag"!==this.taskBarEditAction)&&(y.style.left=a.left+this.editElement.parentElement.offsetLeft+"px"))),e.style.setProperty(i,(this.parent.allowTaskbarDragAndDrop?this.leftValue:t.left)+"px"),e.style.width=n+"px",s&&g&&(g.style.left=(this.parent.isAdaptive?n+10:n+2)+"px"),this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&"LeftResizing"!==this.taskBarEditAction&&"RightResizing"!==this.taskBarEditAction&&"ProgressResizing"!==this.taskBarEditAction&&(g=this.parent.taskbarHeight/2,e.style.setProperty("top",this.topValue+g+"px"),e.style.zIndex="4"),"LeftResizing"===this.taskBarEditAction&&0===this.segmentIndex){this.taskBarEditElement.style.setProperty("opacity",".75");for(var D=this.taskBarEditElement.parentElement.getElementsByClassName("e-segmented-taskbar"),k=0;k<t.segments.length;k++){var T=t.segments[k],b=D[k];b.style.width=T.width+"px",1===t.segments.length?(y.style.width=T.width+"px",y.style.setProperty(i,t.left+"px")):(0===k&&(y.style.width=T.width+"px",y.style.setProperty(i,T.left+t.left+"px")),this.parent.enableRtl?b.style.right=T.left+"px":b.style.left=T.left+"px")}}"ChildDrag"===this.taskBarEditAction&&(0===this.segmentIndex||-1!==this.segmentIndex&&this.parent.allowTaskbarDragAndDrop)&&(y.style.width=n+"px",y.style.setProperty(i,t.left+"px"),e.style.setProperty("opacity",".75"))}if(c&&(this.parent.enableRtl?c.style.left=this.resolveCondition(!!this.parent.isAdaptive,n+10,n-2)+"px":c.style.left=this.resolveCondition(!!this.parent.isAdaptive,n+10,n+2)+"px"),c&&"LeftResizing"===this.taskBarEditAction&&(c.style.left=n-2+"px"),d&&o&&("LeftResizing"===this.taskBarEditAction||"RightResizing"===this.taskBarEditAction||"ChildDrag"===this.taskBarEditAction||"ParentDrag"===this.taskBarEditAction)&&(d.style.display="none",o.style.display="none"),c&&"ProgressResizing"===this.taskBarEditAction&&(c.style.display="none"),"MilestoneDrag"===this.taskBarEditAction||t.isMilestone)e.style.setProperty(i,(this.parent.allowTaskbarDragAndDrop?this.leftValue:t.left-n/2)+"px"),y.style.setProperty(i,t.left-n/2+"px"),y.style.width=n+"px";else if("ProgressResizing"===this.taskBarEditAction)if(-1===this.segmentIndex)l.style.setProperty(i,t.left+t.progressWidth-10+"px"),ne.isNullOrUndefined(o)||(o.style.width=t.progressWidth+"px",o.style.borderBottomRightRadius=this.progressBorderRadius+"px",o.style.borderTopRightRadius=this.progressBorderRadius+"px",g=this.resolveCondition(this.parent.enableRtl,t.progressWidth+8,t.progressWidth-8),d.style.setProperty(i,g+"px"));else{this.updateSegmentProgress(this.taskBarEditRecord.ganttProperties);for(var w=e.querySelectorAll(".e-gantt-child-progressbar"),v=0;v<w.length;v++)t.segments[v]&&t.segments[v].progressWidth&&this.segmentIndex!==v&&(w[v].style.display="block",w[v].style.width=t.segments[v].progressWidth+"px");o.style.width=t.segments[this.segmentIndex].progressWidth+"px",o.style.borderBottomRightRadius=this.progressBorderRadius+"px",o.style.borderTopRightRadius=this.progressBorderRadius+"px";c=this.resolveCondition(this.parent.enableRtl,this.progressValue+8,this.progressValue-8);d.style.setProperty(i,c+"px")}else"RightResizing"!==this.taskBarEditAction||ne.isNullOrUndefined(l)?"ParentDrag"===this.taskBarEditAction?(y.style.setProperty(i,t.left+"px"),y.style.width=n+"px",y.style.width=t.width+"px",ne.isNullOrUndefined(p)||(p.style.width=n+"px",y.style.width=t.width+"px"),ne.isNullOrUndefined(o)||ne.isNullOrUndefined(u)||(u.style.width=t.progressWidth+"px")):"ParentResizing"===this.taskBarEditAction?(y.style.width=t.width+"px",y.style.setProperty(i,t.left+"px"),f.style.setProperty("width",t.width+"px"),m.style.setProperty("width",t.width+"px"),this.editElement.parentElement.style.setProperty("width",t.width+"px")):"ManualParentDrag"===this.taskBarEditAction?(y.style.width=t.width+"px",y.style.setProperty(i,t.left+"px"),f.style.setProperty(i,t.left-t.autoLeft+"px"),this.parent.allowTaskbarDragAndDrop&&(f.style.setProperty(i,this.leftValue+"px"),f.style.setProperty("top",this.topValue+"px"),f.style.zIndex="4")):(ne.isNullOrUndefined(l)||s||(l.style.width=t.width+"px",l.style.left=t.left+"px",this.taskBarEditElement.style.width=t.width+"px",this.taskBarEditElement.style.left=(this.parent.allowTaskbarDragAndDrop?this.leftValue:t.left)+"px",y.style.setProperty(i,t.left+"px"),y.style.width=t.width+"px"),ne.isNullOrUndefined(o)||(h.style.setProperty(i,r+"px"),o.style.width=t.progressWidth+"px",ne.isNullOrUndefined(d))||d.style.setProperty(i,t.progressWidth-10+"px"),s&&(h.style.setProperty(i,r+"px"),o.style.width=a.width+"px",ne.isNullOrUndefined(d)||d.style.setProperty(i,a.width-10+"px"))):(y.style.width=n+"px",l.style.width=n+"px",ne.isNullOrUndefined(o)||(o.style.width=t.progressWidth+"px",h.style.setProperty(i,r+"px"),ne.isNullOrUndefined(d))||d.style.setProperty(i,t.progressWidth-10+"px"))}!this.parent.allowTaskbarDragAndDrop||"ChildDrag"!==this.taskBarEditAction&&"ParentDrag"!==this.taskBarEditAction&&"ManualParentDrag"!==this.taskBarEditAction&&"MilestoneDrag"!==this.taskBarEditAction||(g=this.parent.enableRtl?parseInt(y.style.right,10):parseInt(y.style.left,10),this.parent.enableRtl?y.style.right=g-30+"px":y.style.left=g+30+"px")},D.prototype.mouseUpHandler=function(e){var t,i,a,n=this.isMouseDragged;this.previousMouseMove=null,this.leftValue=0,this.previousLeftValue=0,this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),this.taskBarEditAction&&this.isMouseDragged&&(!this.dragMouseLeave&&this.taskBarEditedAction||this.parent.allowTaskbarDragAndDrop?("touchmove"===e.type||"touchstart"===e.type||"touchend"===e.type?(a=this.getCoordinate(e),this.droppedTarget=document.elementFromPoint(a.pageX,a.pageY)):(this.taskBarEditRecord.hasChildRecords&&!this.taskBarEditRecord.ganttProperties.isAutoSchedule?(a=this.parent.getOffsetRect(this.taskBarEditElement),t=this.resolveCondition(!ne.isNullOrUndefined(document.body.className)&&document.body.className.includes("e-bigger"),12,0),t=3+this.parent.chartRowsModule.connectorPointWidth+t,i=void 0,i=this.parent.enableRtl?Math.abs(a.left+t+1):Math.abs(Math.abs(a.left-t-1)-this.parent.ganttChartModule.scrollElement.scrollLeft),this.droppedTarget=document.elementFromPoint(i,e.y)):this.droppedTarget=document.elementFromPoint(e.x,e.y),this.droppedTarget&&this.droppedTarget.classList.contains("e-span-label")&&(this.droppedTarget=document.elementFromPoint(e.x+this.droppedTarget.offsetWidth,e.y))),this.previousIds=this.parent.ids.slice(),this.previousFlatData=Object.assign([],this.parent.flatData),this.taskBarEditedAction(e),this.isMouseDragged=!1,this.parent.hideSpinner()):(this.parent.isOnEdit=!1,this.cancelTaskbarEditActionInMouseLeave(),a=this.parent.criticalPathModule,this.parent.enableCriticalPath&&a&&a.criticalPathCollection&&a.criticalConnectorLine(a.criticalPathCollection,a.detailPredecessorCollection,!0,a.predecessorCollectionTaskIds))),!this.parent.enableMultiTaskbar||ne.isNullOrUndefined(this.taskBarEditElement)||ne.isNullOrUndefined(this.taskBarEditElement.querySelector(".e-gantt-child-taskbar"))||this.taskBarEditElement.querySelector(".e-gantt-child-taskbar").classList.contains("e-collapsed-taskbar-drag")&&(ne.removeClass([this.taskBarEditElement.querySelector(".e-gantt-child-taskbar")],"e-collapsed-taskbar-drag"),this.taskBarEditElement.style.zIndex=this.prevZIndex,this.prevZIndex=""),this.parent.isAdaptive&&!n||this.initPublicProp(),this.stopScrollTimer()},D.prototype.taskBarEditedAction=function(e){var t={},i=this.mouseDownX,a=this.mouseDownY,n=this.taskBarEditRecord,r=this.parent.ganttChartModule.getIndexByTaskBar(this.taskBarEditElement),s=this.mouseMoveX,e=this.getCoordinate(e).pageY-this.parent.ganttChartModule.chartBodyContainer.offsetTop,o=("ConnectorPointLeftDrag"!==this.taskBarEditAction&&"ConnectorPointRightDrag"!==this.taskBarEditAction||this.drawPredecessor||(this.dependencyCancel=!0),[]);("ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction)&&this.drawPredecessor&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)?(o.push(ne.extend([],[],[this.taskBarEditRecord],!0)[0]),this.parent.undoRedoModule&&0<this.parent.undoRedoModule.getUndoCollection.length&&(this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1].connectedRecords=o,this.parent.toolbarModule)&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord,this.finalPredecessor)):("ConnectorPointLeftDrag"===this.taskBarEditAction||"ConnectorPointRightDrag"===this.taskBarEditAction||this.oldData&&JSON.stringify(this.parent.removeCalendarContext(n.ganttProperties))===JSON.stringify(this.parent.removeCalendarContext(this.oldData.ganttProperties))?this.parent.undoRedoModule&&0<this.parent.undoRedoModule.getUndoCollection.length&&(this.parent.totalUndoAction--,this.parent.undoRedoModule.getUndoCollection.splice(this.parent.undoRedoModule.getUndoCollection.length-1,1),this.parent.toolbarModule)&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!1):this.parent.undoRedoModule&&this.parent.toolbarModule&&0<this.parent.undoRedoModule.getUndoCollection.length&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),(i!==s||Math.abs(a-e)>=(this.parent.rowHeight-this.parent.taskbarHeight)/2)&&null!==n&&(t.editingFields=n.ganttProperties,t.data=n,t.recordIndex=r,t.previousData=this.previousItem,t.taskBarEditAction=this.taskBarEditAction,t.action="TaskbarEditing",t.roundOffDuration=this.roundOffDuration,t.target=this.targetElement,this.taskbarEditedArgs=t,this.taskbarEdited(t))),this.parent.isProjectDateUpdated=!1},D.prototype.cancelTaskbarEditActionInMouseLeave=function(){this.parent.editModule.reUpdatePreviousRecords(!0)},D.prototype.updateSegmentProgress=function(e){for(var t=e.segments,i=!0,a=this.splitTasksDuration(t)*this.parent.perDayWidth,n=s=a*(e.progressWidth/a*100)/100,r=0;r<t.length;r++){var s,o=t[r];0!==r&&(s=o.left<=n?n-o.left:0),delete o.progressWidth,0<s&&s>o.width?(s-=o.width,o.progressWidth=o.width,o.showProgress=!1):i&&(o.progressWidth=s,o.showProgress=!0,s-=o.width,i=!1)}},D.prototype.taskbarEdited=function(e){var e=ne.extend({},e),t=e.data,i=t.ganttProperties,a=i.calendarContext,n=this.parent.flatData.indexOf(t);if((this.parent.allowTaskbarDragAndDrop&&"ChildDrag"===this.taskBarEditAction||"ParentDrag"===this.taskBarEditAction||"MilestoneDrag"===this.taskBarEditAction||"ManualParentDrag"===this.taskBarEditAction)&&0<this.dragMoveY&&("ResourceView"===this.parent.viewType&&!t.hasChildRecords||"ProjectView"===this.parent.viewType)&&(this.parent.rowDragAndDropModule&&(l=this.parent.currentViewData,this.taskBarEditRecord.parentItem&&l[this.taskBarEditRecord.parentItem.index]&&-1===this.parent.editedRecords.indexOf(l[this.taskBarEditRecord.parentItem.index])&&this.parent.editedRecords.push(l[this.taskBarEditRecord.parentItem.index]),this.removeChildBorder(),this.removeErrorElem(),this.removetopOrBottomBorder(),this.updatePosition=!1,s=void(this.draggedRecordMarginTop=this.taskBarEditElement.style.marginTop),ne.isNullOrUndefined(this.droppedTarget)||(s=ne.closest(this.droppedTarget,"tr."+Fe)),this.handleRowDrop(s,l,n),this.isClonedElement=!1),this.parent.showOverAllocation)&&this.parent.ganttChartModule.renderOverAllocationContainer(),"ProgressResizing"===e.taskBarEditAction)e.previousData.progress!==i.progress&&(s=e.data.ganttProperties.progressWidth,l=e.data.ganttProperties.width,n=this.validateProgressWidth(e.data.ganttProperties,s,l),this.parent.setRecordValue("progress",this.getProgressPercent(n.totalTaskWidth,n.progressWidth),i,!0),t.parentItem&&this.parent.editModule.updateParentProgress(t.parentItem),!ne.isNullOrUndefined(i.segments))&&0<i.segments.length&&this.updateSegmentProgress(i);else{var r=e.data.ganttProperties.segments;if(!ne.isNullOrUndefined(r)&&0<r.length&&("LeftResizing"===this.taskBarEditAction&&0!==this.segmentIndex||"ChildDrag"===this.taskBarEditAction&&0!==this.segmentIndex||"RightResizing"===this.taskBarEditAction)){var s=r[this.segmentIndex],o=this.taskBarEditRecord.ganttProperties,l=0===this.segmentIndex?null:r[this.segmentIndex-1],n=this.segmentIndex===r.length-1?null:r[this.segmentIndex+1],d=ne.isNullOrUndefined(n)?this.parent.cloneProjectEndDate:new Date(n.startDate.getTime()),h=ne.isNullOrUndefined(l)?this.parent.cloneProjectStartDate:new Date(l.endDate.getTime()),p=new Date(s.startDate.getTime()),u=new Date(s.endDate.getTime());if(p.setDate(p.getDate()),u.setDate(u.getDate()),this.parent.includeWeekend||0<a.exceptionsRanges.length){if(d.setHours(0,0,0,0),h.setHours(0,0,0,0),p.setDate(p.getDate()-1),u.setDate(u.getDate()+1),p.setHours(0,0,0,0),u.setHours(0,0,0,0),p.getTime()<=h.getTime()&&!ne.isNullOrUndefined(l)&&!ne.isNullOrUndefined(s)){var c=[{firstSegmentIndex:l.segmentIndex,secondSegmentIndex:s.segmentIndex}];this.parent.chartRowsModule.mergeTask(o.taskId,c)}else if(u.getTime()>=d.getTime()&&this.segmentIndex!==r.length-1){var c=[{firstSegmentIndex:s.segmentIndex,secondSegmentIndex:n.segmentIndex}];this.parent.chartRowsModule.mergeTask(o.taskId,c)}else if(u.getTime()>=d.getTime()){s.endDate.setDate(this.parent.cloneProjectEndDate.getDate()-1),s.startDate=this.parent.dataOperation.getStartDate(s.endDate,s.duration,o.durationUnit,o);for(var g=r.length-2;0<=g;g--){var f,m=Object.assign({},r[g]);ne.isNullOrUndefined(m)||((f=new Date(m.endDate)).setDate(f.getDate()-m.offsetDuration),m.endDate=f,m.startDate=this.parent.dataOperation.getStartDate(m.endDate,m.duration,o.durationUnit,o))}}}else u.getTime()<=d.getTime()&&this.segmentIndex!==r.length-1&&this.shouldIgnoreWeekendExceptions(a)&&0===this.parent.dataOperation.getDuration(this.parent.dataOperation.checkStartDate(u,i,!1),d,i.durationUnit,!1,!1,void 0,a)?(c=[{firstSegmentIndex:s.segmentIndex,secondSegmentIndex:n.segmentIndex}],this.parent.chartRowsModule.mergeTask(o.taskId,c)):p.getTime()>=h.getTime()&&!ne.isNullOrUndefined(l)&&!ne.isNullOrUndefined(s)&&this.shouldIgnoreWeekendExceptions(a)&&0===this.parent.dataOperation.getDuration(this.parent.dataOperation.checkEndDate(p,i,!1),h,i.durationUnit,!1,!1,void 0,a)&&(c=[{firstSegmentIndex:l.segmentIndex,secondSegmentIndex:s.segmentIndex}],this.parent.chartRowsModule.mergeTask(o.taskId,c))}this.parent.dataOperation.updateWidthLeft(e.data)}this.isDragged=!1,this.parent.dataOperation.updateTaskData(t),this.parent.editModule.initiateUpdateAction(e)},D.prototype.getProgressPercent=function(e,t){return Math.ceil(t/e*100)},D.prototype.drawFalseLine=function(){var e,t=this.mouseDownX,i=this.mouseDownY,a=this.mouseMoveX,n=this.mouseMoveY,r=Math.sqrt((t-a)*(t-a)+(i-n)*(i-n)),n=180*Math.atan2(n-i,a-t)/Math.PI,i="rotate("+this.resolveCondition(this.parent.enableRtl,-n,n)+"deg)",a=0,t=(ne.isNullOrUndefined(document.querySelectorAll(".e-chart-row")[0])||(a=document.querySelectorAll(".e-chart-row")[0].offsetWidth),"ConnectorPointLeftDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?a-(this.elementOffsetLeft+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft-this.parent.chartRowsModule.connectorPointWidth/2-this.parent.ganttChartModule.scrollObject.previousScroll.left),"ConnectorPointRightDrag"===this.taskBarEditAction&&(e=this.parent.enableRtl?a-(this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2)-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left):this.elementOffsetLeft+this.elementOffsetWidth+this.parent.chartRowsModule.connectorPointWidth/2-Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left)),this.elementOffsetTop+this.elementOffsetHeight/2+this.parent.ganttChartModule.chartBodyContainer.offsetTop-this.parent.ganttChartModule.scrollObject.previousScroll.top);this.removeFalseLine(!1),this.falseLine=ne.createElement("div",{className:"e-gantt-false-line",id:"ganttfalseline"+this.parent.element.id,styles:"position: absolute;transform:"+i+";border-top-width: 1px;border-top-style: dashed;z-index: 5;width:"+(r-3)+"px;top:"+t+"px;"}),this.parent.enableRtl?(this.falseLine.style.left="auto",this.falseLine.style.right=e+"px",this.falseLine.style.transformOrigin="100% 0%"):(this.falseLine.style.right="auto",this.falseLine.style.left=e+"px",this.falseLine.style.transformOrigin="0% 100%"),this.parent.ganttChartModule.chartBodyContainer.appendChild(this.falseLine)},D.prototype.removeFalseLine=function(e){this.falseLine&&(ne.remove(this.falseLine),this.falseLine=null,e)&&(this.elementOffsetLeft=0,this.elementOffsetTop=0,this.elementOffsetWidth=0,this.elementOffsetHeight=0,ne.removeClass(this.parent.ganttChartModule.scrollElement.querySelectorAll("."+rt),[ht]))},D.prototype.updateConnectorLineSecondProperties=function(e){var e=this.getElementByPosition(e),t=S(e,ve),i=document.body.className.includes("e-bigger"),a=(this.connectorSecondAction=null,0);S(e,pt)?(this.connectorSecondAction="ConnectorPointLeftDrag",this.toPredecessorText="Start"):S(e,ut)?(this.connectorSecondAction="ConnectorPointRightDrag",this.toPredecessorText="Finish"):(this.connectorSecondAction=null,this.toPredecessorText=null),this.taskBarEditElement!==t&&this.taskBarEditElement!==this.highlightedSecondElement&&(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&(a=this.parent.virtualScrollModule.getTopPosition()),(this.parent.virtualScrollModule&&this.parent.enableVirtualization&&!this.elementOffsetLeft||!this.parent.enableVirtualization)&&(this.parent.allowParentDependency?this.taskBarEditElement.children[0].classList.contains("e-manualparent-main-container")?(this.elementOffsetLeft=this.realTaskbarElement.children[0].offsetLeft+this.realTaskbarElement.offsetLeft-(i?10:0),this.elementOffsetTop=this.realTaskbarElement.parentElement.offsetTop+this.realTaskbarElement.offsetHeight/3-5+this.taskBarEditElement.children[0].offsetTop+a):(this.elementOffsetLeft=this.realTaskbarElement.offsetLeft-this.resolveCondition(i,10,0),this.elementOffsetTop=this.realTaskbarElement.parentElement.offsetTop+this.realTaskbarElement.offsetHeight/3+a):(this.elementOffsetLeft=this.realTaskbarElement.offsetLeft-(i?10:0),this.elementOffsetTop=this.realTaskbarElement.parentElement.offsetTop+this.realTaskbarElement.offsetHeight/3+a),this.elementOffsetWidth=this.realTaskbarElement.offsetWidth+this.resolveCondition(i,20,0),this.elementOffsetHeight=this.realTaskbarElement.offsetHeight),this.showHideTaskBarEditingElements(t,this.highlightedSecondElement,!0)),ne.isNullOrUndefined(this.connectorSecondAction)&&!ne.isNullOrUndefined(this.connectorSecondElement)&&(!this.connectorSecondRecord.hasChildRecords||this.connectorSecondRecord.hasChildRecords&&this.parent.allowParentDependency)&&(this.editTooltip.showHideTaskbarEditTooltip(!1,this.segmentIndex),ne.removeClass([this.connectorSecondElement.querySelector("."+pt)],[mt]),ne.removeClass([this.connectorSecondElement.querySelector("."+ut)],[mt])),this.connectorSecondElement=this.connectorSecondAction?t:null,this.highlightedSecondElement=t,this.connectorSecondRecord=ne.isNullOrUndefined(this.connectorSecondElement)?null:this.parent.ganttChartModule.getRecordByTaskBar(this.connectorSecondElement)},D.prototype.triggerDependencyEvent=function(e,t){var i,a,n,r,s,o=this.parent.element.closest('[style*="zoom"]'),o=(o&&(o=parseFloat(getComputedStyle(o).zoom),i=e.pageY/o),this.taskBarEditRecord.ganttProperties),l=this.connectorSecondRecord?this.connectorSecondRecord.ganttProperties:null,d=this.getElementByPosition(e),h=d,p="ResourceView"===this.parent.viewType?o.taskId:o.rowUniqueID;"ConnectorPointLeftDrag"===this.taskBarEditAction?r=p+(s=this.resolveCondition(this.parent.enableRtl,"F","S")):"ConnectorPointRightDrag"===this.taskBarEditAction&&(r=p+(s=this.resolveCondition(this.parent.enableRtl,"S","F"))),this.connectorSecondAction&&("ConnectorPointLeftDrag"===this.connectorSecondAction?(r+=n=this.resolveCondition(this.parent.enableRtl,"F","S"),s+=n,a=this.resolveCondition(this.parent.enableRtl,"finish","start")):"ConnectorPointRightDrag"===this.connectorSecondAction&&(r+=n=this.resolveCondition(this.parent.enableRtl,"S","F"),s+=n,a=this.resolveCondition(this.parent.enableRtl,"start","finish"))),ne.isNullOrUndefined(l)?this.drawPredecessor=!1:(l.predecessorsName?this.finalPredecessor=l.predecessorsName+","+r:this.finalPredecessor=r,p=this.parent.connectorLineEditModule.validatePredecessorRelation(this.connectorSecondRecord,this.finalPredecessor),n={from:this.taskBarEditRecord.ganttProperties.taskId.toString(),to:l.taskId.toString(),offset:0,isDrawn:!0,offsetUnit:this.parent.durationUnit.toLocaleLowerCase(),type:s},p&&"ProjectView"===this.parent.viewType&&this.parent.allowParentDependency&&(this.parent.cyclicValidator.resolve(),p=!this.parent.cyclicValidator.wouldCreateCycleWhenAdding(n).wouldCreate),s=this.parent.predecessorModule.calculatePredecessor(r,this.connectorSecondRecord),(n={}).fromItem=o,n.toItem=l,n.newPredecessorString=this.finalPredecessor,n.predecessor=s&&s[0],n.isValidLink=p,n.requestType="ValidateDependency",this.parent.trigger("actionBegin",n),ne.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||"ValidateDependency"===n.requestType?"ValidateDependency"!==n.requestType&&this.parent.showSpinner():this.parent.showMaskRow(),n.isValidLink=!(!p&&n.isValidLink)&&n.isValidLink,n.isValidLink?(this.editTooltip.toolTipObj||this.parent.isAdaptive||this.editTooltip.showHideTaskbarEditTooltip(!0,this.segmentIndex),ne.isNullOrUndefined(this.editTooltip.toolTipObj)||(this.parent.connectorLineModule.tooltipTable.innerHTML="",this.parent.connectorLineModule.tooltipTable.appendChild(this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.parent.editModule.taskbarEditModule.taskBarEditRecord.ganttProperties.taskName,this.parent.editModule.taskbarEditModule.fromPredecessorText,"","")),(r=this.parent.connectorLineModule.tooltipTable.querySelector("#toPredecessor").querySelectorAll("td"))[1].innerText=l.taskName,r[2].innerText=this.parent.localeObj.getConstant(a),ne.isNullOrUndefined(this.parent.connectorLineModule.tooltipTable.parentElement))||ne.isNullOrUndefined(this.parent.connectorLineModule.tooltipTable.parentElement.parentElement)||(o=this.parent.connectorLineModule.tooltipTable.parentElement.parentElement,s=this.resolveCondition(ne.isNullOrUndefined(i),e.pageY,i),o.offsetTop+o.offsetHeight>s&&(o.style.top=e.pageY-o.offsetHeight-20+"px")),this.drawPredecessor=!0):(this.parent.isAdaptive?(d.classList.contains(pt)||d.classList.contains(ut))&&this.showHideActivePredecessors(!0):ne.addClass([h],[mt]),this.drawPredecessor=!1))},D.prototype.getCoordinate=function(e){var t={},i=e;return t.pageX=i.pageX,t.pageY=i.pageY,!e||"click"===e.type||"touchmove"!==(i=e).type&&"touchstart"!==i.type&&"touchend"!==i.type||(t.pageX=i.changedTouches[0].pageX,t.pageY=i.changedTouches[0].pageY),t},D.prototype.getElementByPosition=function(e){var t;return this.parent.isAdaptive?(t=this.getCoordinate(e),document.elementFromPoint(t.pageX-window.pageXOffset,t.pageY-window.pageYOffset)):e.target},D.prototype.multipleSelectionEnabled=function(){this.parent.selectionModule&&"Cell"!==this.parent.selectionSettings.mode&&"Multiple"===this.parent.selectionSettings.type&&this.parent.selectionModule.hidePopUp()},D.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.parent.off("chartMouseDown",this.mouseDownHandler),this.parent.off("chartMouseUp",this.mouseUpHandler),this.parent.off("chartMouseLeave",this.mouseLeaveHandler),this.parent.off("chartMouseMove",this.mouseMoveAction),this.parent.off("chartMouseClick",this.mouseClickHandler))},D.prototype.destroy=function(){this.unWireEvents(),this.stopScrollTimer(),this.parent.editModule.taskbarEditModule=void 0};var Wa,ja,Ha=D;function D(e){var t=ja.call(this,e)||this;return t.leftValue=0,t.previousLeftValue=0,t.isMouseDragged=!1,t.dependencyCancel=!1,t.isDragged=!1,t.editElement=null,t.elementOffsetLeft=0,t.elementOffsetTop=0,t.elementOffsetWidth=0,t.elementOffsetHeight=0,t.segmentIndex=-1,t.currentItemTop=0,t.currentItemPrevTop=0,t.topValue=0,t.draggedRecordMarginTop="0px",t.isClonedElement=!1,t.updatePosition=!1,t.tooltipValue=0,t.parent=e,t.initPublicProp(),t.wireEvents(),t.editTooltip=new Ba(t.parent,t),t}w.prototype.wireEvents=function(){this.parent.on("chartDblClick",this.dblClickHandler,this)},w.prototype.dblClickHandler=function(e){e=this.parent.ganttChartModule.getRecordByTarget(e);!ne.isNullOrUndefined(e)&&this.parent.editModule&&this.parent.editSettings.allowEditing&&this.openEditDialog(e)},w.prototype.processDialogFields=function(){ne.isNullOrUndefined(this.parent.editDialogFields)||this.parent.editDialogFields&&0===this.parent.editDialogFields.length?(this.updatedEditFields=this.getDefaultDialogFields(),this.updatedEditFields=this.validateDialogFields(this.updatedEditFields)):this.updatedEditFields=this.validateDialogFields(this.parent.editDialogFields),ne.isNullOrUndefined(this.parent.addDialogFields)||this.parent.addDialogFields&&0===this.parent.addDialogFields.length?(this.updatedAddFields=this.getDefaultDialogFields(),this.updatedAddFields=this.validateDialogFields(this.updatedAddFields)):this.updatedAddFields=this.validateDialogFields(this.parent.addDialogFields)},w.prototype.validateDialogFields=function(e){for(var t=[],i=0,a=0;a<e.length;a++){var n=T.getActualProperties(e[a]);"General"!==n.type||!ne.isNullOrUndefined(n.fields)&&0!==n.fields.length||(n.fields=this.getGeneralColumnFields()),"Advanced"!==n.type||!ne.isNullOrUndefined(n.fields)&&0!==n.fields.length||(n.fields=this.getAdvancedColumnFields()),"Dependency"===n.type&&ne.isNullOrUndefined(this.parent.taskFields.dependency)||"Resources"===n.type&&ne.isNullOrUndefined(this.parent.taskFields.resourceInfo)||"Notes"===n.type&&ne.isNullOrUndefined(this.parent.taskFields.notes)||("Custom"!==n.type||!ne.isNullOrUndefined(n.fields)&&0!==n.fields.length||(i+=1,n.fields=this.getCustomColumnFields()),1<i)||t.push(n)}return t},w.prototype.getGeneralColumnFields=function(){for(var e=[],t=0,i=Object.keys(this.parent.columnMapping);t<i.length;t++){var a=i[t];"dependency"!==a&&"resourceInfo"!==a&&"notes"!==a&&"constraintType"!==a&&"constraintDate"!==a&&e.push(this.parent.columnMapping[a])}return e},w.prototype.getAdvancedColumnFields=function(){var e=[];return this.parent.columnMapping.constraintType?e.push(this.parent.columnMapping.constraintType):e=[],this.parent.columnMapping.constraintDate?e.push(this.parent.columnMapping.constraintDate):e=Object.assign([],e),e},w.prototype.getCustomColumnFields=function(){for(var e=[],t=0;t<this.parent.customColumns.length;t++)e.push(this.parent.customColumns[t]);return e},w.prototype.getDefaultDialogFields=function(){var e=[],t={},i=this.parent.taskFields,a=this.parent.columnMapping;return 0!==Object.keys(a).length&&(t.type="General",e.push(t)),ne.isNullOrUndefined(ne.getValue("dependency",a))||(!(t={})!==this.parent.columnByField[a.dependency.valueOf()].visible&&(t.type="Dependency"),e.push(t)),ne.isNullOrUndefined(ne.getValue("resourceInfo",a))||(!(t={})!==this.parent.columnByField[a.resourceInfo.valueOf()].visible&&(t.type="Resources"),e.push(t)),ne.isNullOrUndefined(ne.getValue("constraintType",a))||ne.isNullOrUndefined(ne.getValue("constraintDate",a))||e.push(t={type:"Advanced"}),ne.isNullOrUndefined(ne.getValue("notes",a))||(!(t={})!==this.parent.columnByField[a.notes.valueOf()].visible&&(t.type="Notes"),e.push(t)),ne.isNullOrUndefined(ne.getValue("segments",i))||e.push(t={type:"Segments"}),0<this.parent.customColumns.length&&e.push(t={type:"Custom"}),e},w.prototype.openAddDialog=function(){this.isEdit=!1,this.editedRecord=this.composeAddRecord(),this.isFromAddDialog=!0,this.createDialog()},w.prototype.getMinimumStartDate=function(){var e=U.DataUtil.aggregates.min(this.parent.flatData,"ganttProperties.startDate"),e=ne.isNullOrUndefined(e)?new Date(this.parent.timelineModule.timelineStartDate.getTime()):new Date(e.getTime());return e=this.parent.dateValidationModule.checkStartDate(e),new Date(e.getTime())},w.prototype.resolveCondition=function(e,t,i){return e?t:i},w.prototype.composeAddRecord=function(){for(var e={ganttProperties:{}},t=this.parent.ganttColumns,i=this.parent.taskFields,a=this.parent.editModule.getNewTaskId(),n=0;n<t.length;n++){var r=t[n].field;r===i.id?(e[r]=a,e.ganttProperties.rowUniqueID=e[r]):t[n].field===i.startDate?(ne.isNullOrUndefined(e[i.endDate])?e[r]=this.getMinimumStartDate():e[r]=new Date(e[i.endDate]),e.ganttProperties.startDate=new Date(e[r])):t[n].field===i.endDate?(ne.isNullOrUndefined(e[i.startDate])?e[r]=this.getMinimumStartDate():e[r]=new Date(e[i.startDate]),e.ganttProperties.endDate=new Date(e[r])):t[n].field===i.duration?(e[r]=1,e.ganttProperties.duration=e[r],e.ganttProperties.durationUnit=this.parent.durationUnit.toLocaleLowerCase()):t[n].field===i.name?(e[r]=this.localeObj.getConstant("addDialogTitle")+" "+a,e.ganttProperties.taskName=e[r]):t[n].field===i.progress?(e[r]=0,e.ganttProperties.progress=e[r]):t[n].field===i.work?(e[r]=0,e.ganttProperties.work=e[r]):t[n].field===i.type?(e[r]=this.parent.taskType,e.ganttProperties.taskType=e[r]):e[this.parent.ganttColumns[n].field]=""}return e.ganttProperties.isAutoSchedule="Auto"===this.parent.taskMode||"Manual"!==this.parent.taskMode&&this.resolveCondition(!0===e[i.manual],!1,!0),e.ganttProperties.calendarContext=this.resolveCondition(!ne.isNullOrUndefined(this.parent.defaultCalendarContext),this.parent.defaultCalendarContext,null),e},w.prototype.openToolbarEditDialog=function(){var e=this.parent;e.editModule&&e.editSettings.allowEditing&&(e.selectionModule&&-1<this.parent.ganttChartModule.focusedRowIndex&&e.selectionModule.selectRow(this.parent.ganttChartModule.focusedRowIndex,!1,!1),e=e.selectionModule?"Row"!==e.selectionSettings.mode&&"Both"!==e.selectionSettings.mode||1!==e.selectionModule.selectedRowIndexes.length?"Cell"===e.selectionSettings.mode&&1===e.selectionModule.getSelectedRowCellIndexes().length?e.updatedRecords[e.selectionModule.getSelectedRowCellIndexes()[0].rowIndex].ganttProperties.rowUniqueID:null:e.updatedRecords[e.selectionModule.selectedRowIndexes[0]].ganttProperties.rowUniqueID:null,ne.isNullOrUndefined(e)||this.openEditDialog(e))},w.prototype.openEditDialog=function(e){var t=this.parent;ne.isNullOrUndefined(e)||(ne.isNullOrUndefined(e.ganttProperties)||("string"==typeof e.ganttProperties.taskId?this.numericOrString="stringedit":this.numericOrString="numericedit"),ne.isNullOrUndefined(e.ganttProperties)&&!ne.isNullOrUndefined(e)&&(isNaN(Number(e))||"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?this.numericOrString="stringedit":this.numericOrString="numericedit")),"object"!=typeof e||ne.isNullOrUndefined(e)?ne.isNullOrUndefined(e)?-1<t.selectedRowIndex&&(this.rowData=t.currentViewData[t.selectedRowIndex],this.rowIndex=t.selectedRowIndex):(this.rowIndex=t.ids.indexOf(e.toString()),-1<this.rowIndex&&(this.rowData=t.flatData[this.rowIndex])):(this.rowIndex=this.parent.currentViewData.indexOf(e),-1<this.rowIndex&&(this.rowData=e)),this.isEdit=!0,"ResourceView"===this.parent.viewType&&0===this.rowData.level||0!==Object.keys(this.rowData).length&&(this.editedRecord=ne.extend({},{},this.rowData,!0),this.isFromEditDialog=!0,this.createDialog())},w.prototype.createDialog=function(){var i=this,e=this.parent,t={},a=(this.beforeOpenArgs.dialogModel=t,this.beforeOpenArgs.rowData=this.editedRecord,this.beforeOpenArgs.rowIndex=this.rowIndex,this.parent.isAdaptive?"":"600px"),a=this.parent.createElement("div",{id:e.element.id+"_dialog",styles:"max-width:"+a}),e=(a.classList.add("e-gantt-dialog"),e.element.appendChild(a),t.animationSettings={effect:"None"},t.header=this.localeObj.getConstant(this.isEdit?"editDialogTitle":"addDialogTitle"),t.isModal=!0,t.enableRtl=this.parent.enableRtl,t.allowDragging=!this.parent.isAdaptive&&!this.parent.enableAdaptiveUI,t.showCloseIcon=!0,this.parent.isAdaptive?{X:"top",Y:"left"}:{X:"center",Y:"center"});t.position=e,t.height=this.parent.isAdaptive?"100%":"auto",t.target=document.body,t.close=this.dialogClose.bind(this),t.closeOnEscape=!0,t.beforeClose=function(e){"escape"===e.closedBy&&"key-pressed"===e.event.name&&"INPUT"===e.event.target.nodeName&&(e.cancel=!0)},t.open=function(e){var e=ne.getValue("element",e),t=e.querySelector("#"+i.parent.element.id+"GeneralTabContainer");t&&t.scrollHeight>t.offsetHeight&&t.classList.add("e-scroll"),0===i.tabObj.selectedItem&&i.tabObj.select(0),i.parent.isAdaptive&&(e.style.maxHeight="none"),i.parent.focusModule&&i.parent.focusModule.setActiveElement(e)},t.locale=this.parent.locale,t.buttons=[{buttonModel:{content:this.localeObj.getConstant("saveButton"),cssClass:"e-primary"},click:this.buttonClick.bind(this)},{buttonModel:{cssClass:"e-flat",content:this.localeObj.getConstant("cancel")},click:this.buttonClick.bind(this)}],this.createTab(t,a)},w.prototype.buttonClick=function(e){var t=e.target;if(t.style.pointerEvents="none",this.localeObj.getConstant("cancel").toLowerCase()===e.target.innerText.trim().toLowerCase())this.dialog&&!this.dialogObj.isDestroyed&&(this.CustomformObj=null,this.formObj=null,this.storeValidTab=null,this.customFieldColumn=[],this.taskFieldColumn=[],this.dialogObj.hide(),this.dialogClose());else if(this.CustomformObj&&!this.CustomformObj.validate())t.style.pointerEvents="";else{if(this.formObj)if(!this.formObj.validate())return void(t.style.pointerEvents="");if(this.storeDependencyTab||"Dependency"===this.firstOccuringTab){var i=void 0;if(i=("Dependency"===this.firstOccuringTab?e.target.closest("#"+this.parent.element.id+"_dialog"):this.storeDependencyTab).querySelector(".e-gridform"))if(!i.ej2_instances[0].validate())return void(t.style.pointerEvents="")}if(this.storeResourceTab||"Resources"===this.firstOccuringTab){i=void 0;if(i=("Resources"===this.firstOccuringTab?e.target.closest("#"+this.parent.element.id+"_dialog"):this.storeResourceTab).querySelector(".e-gridform"))if(!i.ej2_instances[0].validate())return void(t.style.pointerEvents="")}this.initiateDialogSave(),this.parent.updateDuration=!1,this.CustomformObj=null,this.formObj=null,this.storeValidTab=null,this.customFieldColumn=[],this.taskFieldColumn=[],t.style.pointerEvents="auto"}},w.prototype.dialogClose=function(){this.dialog&&this.resetValues(),ne.isNullOrUndefined(this.parent.focusModule)||ne.isNullOrUndefined(this.parent.focusModule.getActiveElement(!0))||this.parent.focusModule.getActiveElement(!0).focus()},w.prototype.resetValues=function(){this.isEdit=!1,this.isAddNewResource=!1,this.editedRecord={},this.parent.triggeredColumnName="",this.rowData={},this.rowIndex=-1,this.addedRecord=null,this.ganttResources=[],this.dialogEditValidationFlag=!1,this.isFromAddDialog=!1,this.isFromEditDialog=!1,this.dialogConstraintDate=null,this.dialog&&!this.dialogObj.isDestroyed&&(this.destroyDialogInnerElements(),this.dialogObj.destroy(),ne.remove(this.dialog),this.dialog=null)},w.prototype.destroyDialogInnerElements=function(){for(var e=this.parent,t=this.beforeOpenArgs.tabModel.items,i=0;i<t.length;i++){var a=t[i].content,n=a.getAttribute("id");ne.isNullOrUndefined(n)||("General"===(n=(n=n.replace(e.element.id,"")).replace("TabContainer",""))?this.destroyCustomField(a):"Dependency"===n||"Notes"===n||"Resources"===n?a.ej2_instances[0].destroy():-1!==n.indexOf("Custom")&&this.destroyCustomField(a))}},w.prototype.destroyCustomField=function(e){for(var t=e.childNodes,i=this.parent,a=0;a<t.length;a++){var n=t[a],r=n.querySelector('input[id^="'+i.element.id+'"]');r&&(r=r.id.replace(i.element.id,""),n=n.querySelector("#"+i.element.id+r).ej2_instances[0],ne.isNullOrUndefined(n)||(r=i.columnByField[r],ne.isNullOrUndefined(r)||ne.isNullOrUndefined(r.edit)||ne.isNullOrUndefined(r.edit.destroy)||!ne.isNullOrUndefined(r.edit.params)?n.destroy():"string"==typeof(n=r.edit.destroy)?(n=T.getObject(n,window))():r.edit.destroy()))}},w.prototype.destroy=function(){this.resetValues(),this.parent.isDestroyed||(this.parent.off("chartDblClick",this.dblClickHandler),this.parent.editModule.dialogModule=void 0)},w.prototype.getEditFields=function(){return this.isEdit?this.updatedEditFields:this.updatedAddFields},w.prototype.filterGeneralTabs=function(e){return e.filter(function(e){return"General"===e.type})},w.prototype.createTab=function(t,i){var a,n=this,r=this.parent,s={},e=[],o=this.getEditFields(),l=(!0===this.isEdit&&"ResourceView"===r.viewType&&this.rowData.hasChildRecords&&(o=this.filterGeneralTabs(o)),r.taskFields),d=o.length,h=(s.items=e,s.locale=this.parent.locale,s.enableRtl=this.parent.enableRtl,s.swipeMode="Touch",this.beforeOpenArgs.tabModel=s,0);if(0<d)for(var p=0;p<d;p++){var u=o[p],c={};if("General"===u.type){if(0===Object.keys(r.columnMapping).length)continue;ne.isNullOrUndefined(u.headerText)&&(u.headerText=this.localeObj.getConstant("generalTab")),c.content="General",this.beforeOpenArgs[c.content]=this.getFieldsModel(u.fields)}else if("Segments"===u.type){if(ne.isNullOrUndefined(l.segments))continue;ne.isNullOrUndefined(u.headerText)&&(u.headerText=this.localeObj.getConstant("segments")),c.content="Segments",this.beforeOpenArgs[c.content]=this.getSegmentsModel(u.fields)}else if("Dependency"!==u.type||!this.parent||!this.parent.allowParentDependency&&this.rowData.hasChildRecords)if("Resources"===u.type){if(ne.isNullOrUndefined(l.resourceInfo))continue;ne.isNullOrUndefined(u.headerText)&&(u.headerText=this.localeObj.getConstant("resourceName")),c.content="Resources",this.beforeOpenArgs[c.content]=this.getResourcesModel(u.fields)}else if("Notes"===u.type){if(ne.isNullOrUndefined(l.notes))continue;ne.isNullOrUndefined(u.headerText)&&(u.headerText=this.localeObj.getConstant("notes")),c.content="Notes",this.beforeOpenArgs[c.content]=this.getNotesModel(u.fields)}else{if("Advanced"===u.type)ne.isNullOrUndefined(u.headerText)&&(u.headerText=this.localeObj.getConstant("advancedTab")),c.content="Advanced";else{if(ne.isNullOrUndefined(u.fields)||0===u.fields.length)continue;ne.isNullOrUndefined(u.headerText)&&(u.headerText=this.localeObj.getConstant("customTab")),c.content="Custom"+h++}this.beforeOpenArgs[c.content]=this.getFieldsModel(u.fields)}else{if(ne.isNullOrUndefined(l.dependency))continue;ne.isNullOrUndefined(u.headerText)&&(u.headerText=this.localeObj.getConstant("dependency")),c.content="Dependency",this.beforeOpenArgs[c.content]=this.getPredecessorModel(u.fields)}c.header={text:u.headerText},e.push(c)}this.beforeOpenArgs.requestType=this.isEdit?"beforeOpenEditDialog":"beforeOpenAddDialog",this.parent.trigger("actionBegin",this.beforeOpenArgs,function(e){e.cancel?(e.cancel=!1,n.parent.hideLoadingIndicator()):(n.parent.showLoadingIndicator(),n.renderTabItems(),s.selected=n.tabSelectedEvent.bind(n),s.height=n.parent.isAdaptive?"100%":"auto",s.overflowMode="Scrollable",n.tabObj=new V.Tab(s),n.tabObj.isStringTemplate=!0,a=n.parent.createElement("div",{id:r.element.id+"_Tab"}),n.tabObj.appendTo(a),t.content=a,n.dialog=i,n.dialogObj=new E.Dialog(t),n.dialogObj.isStringTemplate=!0,n.dialogObj.appendTo(n.dialog),e={action:"OpenDialog",requestType:n.isEdit?"openEditDialog":"openAddDialog",data:n.beforeOpenArgs.rowData,element:n.dialog,cancel:!1},n.parent.treeGrid.grid.getColumns().some(function(e){return e.validationRules})&&(n.CustomformObj=null,n.formObj=null,n.storeValidTab=null,n.customFieldColumn=[],n.taskFieldColumn=[],n.changeFormObj(e.element)),n.parent.trigger("actionComplete",e,function(e){n.parent.hideLoadingIndicator(),e.cancel&&n.resetValues()}))})},w.prototype.changeFormObj=function(e){var t;if(this.storeColumn||(this.storeColumn=this.parent.treeGrid.grid.getColumns()),this.taskfields||(this.taskfields=this.parent.taskFields.properties),this.storeValidTab||(this.storeValidTab=this.getFilteredDialogFields()),0!==this.customFieldColumn.length&&0!==this.taskFieldColumn.length||this.validateColumn(this.storeColumn,this.taskfields,this.storeValidTab),this.isFromAddDialog&&this.parent.addDialogFields&&0<this.parent.addDialogFields.length?"Resources"!==(t=this.parent.addDialogFields[0].type)&&"Dependency"!==t||(this.firstOccuringTab=t):this.isFromEditDialog&&this.parent.editDialogFields&&0<this.parent.editDialogFields.length&&("Resources"!==(t=this.parent.editDialogFields[0].type)&&"Dependency"!==t||(this.firstOccuringTab=t)),!this.CustomformObj||!this.formObj){var i=this.customFieldColumn,a=this.taskFieldColumn;if(!this.CustomformObj&&i&&0<i.length){for(var n={},r=0;r<i.length;r++){var s=i[r];s.visible&&s.validationRules&&(n[s.field]=s.validationRules)}0<Object.keys(n).length&&(this.CustomformObj=e.querySelector("#"+this.parent.element.id+"Custom0TabContainer"),this.CustomformObj)&&(this.CustomformObj=this.createFormObj(this.CustomformObj,n))}if(!this.formObj&&a&&0<a.length){for(n={},r=0;r<a.length;r++){var o=a[r];o.visible&&o.validationRules&&(n[o.field]=o.validationRules)}0<Object.keys(n).length&&(this.formObj=e.querySelector("#"+this.parent.element.id+"GeneralTabContainer"),this.formObj)&&(this.formObj=this.createFormObj(this.formObj,n))}}this.isFromAddDialog=!1,this.isFromEditDialog=!1},w.prototype.getFilteredDialogFields=function(){var e=this.isFromAddDialog?this.parent.addDialogFields:this.parent.editDialogFields;return 0!==e.length?e.filter(function(e){return"General"===e.type||"Custom"===e.type}):null},w.prototype.validateColumn=function(a,e,t){var n=this;t?t.forEach(function(e){var i=n.resolveCondition("General"===e.type,n.taskFieldColumn,n.customFieldColumn);e.fields.forEach(function(e){var t=n.parent.getColumnByField(e,a);null!==t?i.push(t):i.push(n.parent.columnByField[e])})}):a.forEach(function(e){(-1!==n.parent.customColumns.indexOf(e.field)?n.customFieldColumn:n.taskFieldColumn).push(e)})},w.prototype.createFormObj=function(e,t){var a=this;return new B.FormValidator(e,{rules:t,locale:this.parent.locale,validationComplete:function(e){a.validationComplete(e)},customPlacement:function(e,t){var i=e.getAttribute("name");i&&a.valErrorPlacement(e,t,i)}})},w.prototype.valErrorPlacement=function(e,t,i){var i=i+"-tooltip",a=this.getElemTable(e);a?(a=a.querySelector(".e-tip-content"))&&(a.innerHTML=t.outerHTML):this.createTooltip(e,t,i)},w.prototype.createTooltip=function(e,t,i,a){void 0===a&&(a="block");var n=document.getElementById(i),n=(n&&n.remove(),e.parentElement),e=(n&&(n.style.position="relative"),document.createElement("div")),a=(e.className="e-tooltip-wrap e-lib e-control e-popup e-griderror",e.style.display=a,e.style.zIndex="1000",i+"-label"),i=document.createElement("div"),r=(i.id=a,i.className="sr-only",document.createElement("div")),s=(r.className="e-tip-content",document.createElement("div")),t=(s.className="error-message",s.appendChild(t.cloneNode(!0)),document.createElement("div"));t.className="e-arrow-tip e-tip-top",t.appendChild(document.createElement("div")).className="e-arrow-tip-outer e-tip-top",t.appendChild(document.createElement("div")).className="e-arrow-tip-inner e-tip-top",e.setAttribute("aria-labelledby",a),r.appendChild(s),e.appendChild(r),e.appendChild(t),e.style.top="125%",e.style.left="50%",e.style.transform="translateX(-50%)",n&&(n.appendChild(i),n.appendChild(e))},w.prototype.getElemTable=function(e){e=e.parentElement;return e?e.querySelector(".e-tooltip-wrap"):null},w.prototype.validationComplete=function(e){var t=this.getElemTable(e.element);t&&("failure"===e.status?t.style.display="":t.style.display="none")},w.prototype.tabSelectedEvent=function(e){var t=this.parent,i=e.selectedContent.childNodes[0].id,a=this.parent.editModule.dialogModule,n=a.dialog,r=0<n.getElementsByClassName("e-editedbatchcell").length,n=0<n.getElementsByClassName("e-editedrow").length||0<n.getElementsByClassName("e-addedrow").length;a.storeResourceTab&&r?document.querySelector("#"+t.element.id+"ResourcesTabContainer_gridcontrol").ej2_instances[0].saveCell():n&&a.storeDependencyTab&&document.querySelector("#"+t.element.id+"DependencyTabContainer").ej2_instances[0].editModule.batchSave(),i===t.element.id+"DependencyTabContainer"&&(this.storeDependencyTab=e.selectedContent),i===t.element.id+"ResourcesTabContainer"&&(this.storeResourceTab=e.selectedContent),i===t.element.id+"Custom0TabContainer"&&this.parent.treeGrid.grid.getColumns().some(function(e){return e.validationRules})&&this.changeFormObj(e.selectedContent),i===t.element.id+"GeneralTabContainer"&&this.parent.treeGrid.grid.getColumns().some(function(e){return e.validationRules})&&this.changeFormObj(e.selectedContent),(this.parent.isAdaptive||this.parent.enableAdaptiveUI)&&this.responsiveTabContent(i,t),i===t.element.id+"ResourcesTabContainer"?this.resourceSelection(i):i===t.element.id+"NotesTabContainer"?document.getElementById(i).ej2_instances[0].refresh():i===t.element.id+"SegmentsTabContainer"&&(ne.isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)?document.getElementById(i).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!1):document.getElementById(i).ej2_instances[0].enableToolbarItems([this.parent.element.id+"SegmentsTabContainer_add"],!0))},w.prototype.responsiveTabContent=function(e,t){var t=document.getElementById(t.element.id+"_dialog_dialog-content"),i=t.clientHeight,t=(i-=t.querySelector(".e-tab-header").offsetHeight,document.querySelector("#"+e));t.classList.contains("e-grid")&&(i-=t.ej2_instances[0].getHeaderContent().offsetHeight,e=t.querySelector(".e-toolbar"))&&(i-=e.offsetHeight),t.parentElement.style.height=i+"px"},w.prototype.getFieldsModel=function(e){for(var t,i={},a=this.parent.columnByField,n=0;n<e.length;n++)e[n]===this.parent.taskFields.dependency||e[n]===this.parent.taskFields.resourceInfo||e[n]===this.parent.taskFields.notes||ne.isNullOrUndefined(a[e[n]])||(t=e[n],this.createInputModel(a[t],i));return i},w.prototype.processAndValidateScheduleDates=function(e,t){var i=e.editModule.dialogModule.dialog.querySelector("#"+e.element.id+t.constraintDate),a=e.editModule.dialogModule.dialog.querySelector("#"+e.element.id+t.constraintType),n=this.dialog.querySelector("#"+e.element.id+t.startDate),e=this.dialog.querySelector("#"+e.element.id+t.endDate);this.alignDateWithConstraint(i,a,n,e)},w.prototype.createInputModel=function(t,e){var i=this,a=this.parent,n=this.parent.locale,r=this.parent.taskFields,s={placeholder:t.headerText,floatLabelType:"Auto"};if(ne.isNullOrUndefined(this.parent.taskFields.id)||ne.isNullOrUndefined(this.parent.columnMapping.id)||ne.isNullOrUndefined(this.numericOrString)||r.id===t.field&&(t.editType=this.numericOrString),t.editTemplate){var o=this.parent.currentViewData.indexOf(this.rowData),o=this.parent.chartRowsModule.templateCompiler(t.editTemplate)(ne.extend({index:o},this.editedRecord),this.parent,"EditTemplate",this.parent.chartRowsModule.getTemplateID("EditTemplate"),!1,void 0,null,this.parent.treeGrid.root);e[t.field]=o}else switch(t.editType){case"booleanedit":var l={label:t.headerText,locale:n,enableRtl:this.parent.enableRtl};e[t.field]=l;break;case"defaultedit":case"stringedit":var l=s;l.enableRtl=this.parent.enableRtl,t.field!==a.columnMapping.duration&&t.field!==a.columnMapping.id&&t.field!==a.columnMapping.startDate&&t.field!==a.columnMapping.endDate&&t.field!==a.columnMapping.baselineDuration||(l.change=function(e){i.isTriggered?i.parent.triggeredColumnName="":(t.field!==i.parent.taskFields.duration&&t.field!==i.parent.taskFields.work&&t.field!==i.parent.taskFields.baselineDuration||i.isTriggered||(i.isTriggered=!0,i.parent.triggeredColumnName=t.field),i.validateScheduleFields(e,t,a))}),e[t.field]=s;break;case"numericedit":l=s;l.enableRtl=this.parent.enableRtl,r.progress===t.field&&(l.min=0,l.max=100),l.change=function(e){i.isTriggered?i.parent.triggeredColumnName="":(t.field!==i.parent.taskFields.duration&&t.field!==i.parent.taskFields.work||i.isTriggered||(i.isTriggered=!0,i.parent.triggeredColumnName=t.field),i.validateScheduleFields(e,t,a))},e[t.field]=l;break;case"datepickeredit":l=s;l.format=this.parent.getDateFormat(),l.enableRtl=this.parent.enableRtl,l.strictMode=!0,l.firstDayOfWeek=a.timelineModule.customTimelineSettings.weekStartDay,t.field!==a.columnMapping.startDate&&t.field!==a.columnMapping.endDate&&t.field!==a.columnMapping.constraintDate&&t.field!==a.columnMapping.baselineStartDate&&t.field!==a.columnMapping.baselineEndDate||(t.field===a.columnMapping.baselineStartDate||t.field===a.columnMapping.baselineEndDate||(l.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent)),l.change=function(e){t.field!==r.constraintDate?i.validateScheduleFields(e,t,a):i.processAndValidateScheduleDates(a,r)}),e[t.field]=l;break;case"datetimepickeredit":l=s;l.format=this.parent.getDateFormat(),l.enableRtl=this.parent.enableRtl,l.strictMode=!0,l.firstDayOfWeek=a.timelineModule.customTimelineSettings.weekStartDay,t.field!==a.columnMapping.startDate&&t.field!==a.columnMapping.endDate&&t.field!==a.columnMapping.baselineStartDate&&t.field!==a.columnMapping.baselineEndDate||(t.field===a.columnMapping.baselineStartDate||t.field===a.columnMapping.baselineEndDate||(l.renderDayCell=this.parent.renderWorkingDayCell.bind(this.parent)),l.change=function(e){t.field!==r.constraintDate?i.validateScheduleFields(e,t,a):i.processAndValidateScheduleDates(a,r)}),e[t.field]=l;break;case"dropdownedit":t.field!==a.columnMapping.type&&t.field!==a.columnMapping.manual&&t.field!==a.columnMapping.constraintType||(s.dataSource=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}],s.fields={value:"Value"},(l=s).enableRtl=this.parent.enableRtl,l.change=function(e){t.field===r.manual&&(i.editedRecord.ganttProperties.isAutoSchedule=!e.value),t.field!==r.constraintType?i.validateScheduleFields(e,t,a):(i.dialogConstraintValue=Number(e.value),i.processAndValidateScheduleDates(a,r))}),e[t.field]=s;break;case"maskededit":e[t.field]=s}return ne.isNullOrUndefined(t.edit)||ne.isNullOrUndefined(t.edit.params)||ne.extend(e[t.field],t.edit.params),e},w.prototype.setConstraintDateBasedOnType=function(e,t,i,a,n){if(!e&&i)switch(t){case k.ConstraintType.StartNoEarlierThan:case k.ConstraintType.StartNoLaterThan:case k.ConstraintType.MustStartOn:i.value=new Date(a);break;case k.ConstraintType.FinishNoEarlierThan:case k.ConstraintType.FinishNoLaterThan:case k.ConstraintType.MustFinishOn:i.value=new Date(n)}},w.prototype.handleMissingConstraintDate=function(e,t,i,a,n){!e&&t!==k.ConstraintType.AsSoonAsPossible&&t!==k.ConstraintType.AsLateAsPossible&&i&&this.setConstraintDateBasedOnType(e,t,i.ej2_instances[0],a,n)},w.prototype.alignDateWithConstraint=function(e,t,i,a){var n,r,s=e?e.ej2_instances[0].value:this.editedRecord.ganttProperties.constraintDate,t=t?t.ej2_instances[0].value:this.editedRecord.ganttProperties.constraintType,o=i?i.ej2_instances[0].value:this.editedRecord.ganttProperties.startDate,a=a?a.ej2_instances[0].value:this.editedRecord.ganttProperties.endDate,l=(this.handleMissingConstraintDate(s,t,e,o,a),new Date(o)),d=new Date(a),h=this.parent.assignTimeToDate(s,this.parent.getCurrentDayStartTime(s)),p=this.parent.predecessorModule.filterPredecessorsByTarget(this.editedRecord.ganttProperties.predecessor,this.editedRecord,this.parent.viewType);switch(t){case k.ConstraintType.MustStartOn:h=s=this.parent.dateValidationModule.checkStartDate(new Date(h)),l.getTime()!==h.getTime()&&i&&(i.ej2_instances[0].value=s);break;case k.ConstraintType.MustFinishOn:h.setDate(h.getDate()+1),h=s=this.parent.dateValidationModule.checkEndDate(new Date(h)),d.getTime()!==h.getTime()&&(s=this.parent.dateValidationModule.getStartDate(s,this.editedRecord.ganttProperties.duration,this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties),i)&&(i.ej2_instances[0].value=s);break;case k.ConstraintType.StartNoEarlierThan:h=s=this.parent.dateValidationModule.checkStartDate(new Date(h)),i&&(i.ej2_instances[0].value=s);break;case k.ConstraintType.StartNoLaterThan:this.editedRecord.ganttProperties.predecessor&&0<this.editedRecord.ganttProperties.predecessor.length&&0!==p.length?(this.dialogConstraintDate=new Date(h),r=this.parent.editModule.taskbarEditModule.isValidDependency(this.editedRecord),i&&(i.ej2_instances[0].value=r.maxDate)):this.editedRecord.parentItem?i&&(i.ej2_instances[0].value=this.parent.getRecordByID(this.editedRecord.parentItem.taskId).ganttProperties.startDate):i&&(i.ej2_instances[0].value=this.parent.dateValidationModule.checkStartDate(new Date(this.parent.projectStartDate)));break;case k.ConstraintType.FinishNoEarlierThan:h.setDate(h.getDate()+1),h=s=this.parent.dateValidationModule.checkEndDate(new Date(h)),d.getTime()!==h.getTime()&&(s=this.parent.dateValidationModule.getStartDate(s,this.editedRecord.ganttProperties.duration,this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties),i)&&(i.ej2_instances[0].value=s);break;case k.ConstraintType.FinishNoLaterThan:this.editedRecord.ganttProperties.predecessor&&0<this.editedRecord.ganttProperties.predecessor.length&&0!==p.length?(this.dialogConstraintDate=new Date(h),r=this.parent.editModule.taskbarEditModule.isValidDependency(this.editedRecord),i&&(i.ej2_instances[0].value=r.maxDate)):this.editedRecord.parentItem?i&&(i.ej2_instances[0].value=this.parent.getRecordByID(this.editedRecord.parentItem.taskId).ganttProperties.startDate):i&&(i.ej2_instances[0].value=this.parent.dateValidationModule.checkStartDate(new Date(this.parent.projectStartDate)));break;case k.ConstraintType.AsSoonAsPossible:this.editedRecord.ganttProperties.predecessor&&0<this.editedRecord.ganttProperties.predecessor.length&&0!==p.length?(r=this.parent.editModule.taskbarEditModule.isValidDependency(this.editedRecord)).maxDate&&i&&(i.ej2_instances[0].value=r.maxDate):this.editedRecord.parentItem?i&&(i.ej2_instances[0].value=this.parent.getRecordByID(this.editedRecord.parentItem.taskId).ganttProperties.startDate):i&&(i.ej2_instances[0].value=this.parent.dateValidationModule.checkStartDate(new Date(this.parent.projectStartDate))),e&&(e.ej2_instances[0].value=null);break;case k.ConstraintType.AsLateAsPossible:this.editedRecord.parentItem?(n=this.parent.dateValidationModule.checkEndDate(this.parent.getRecordByID(this.editedRecord.parentItem.taskId).ganttProperties.endDate),r=this.parent.dateValidationModule.getStartDate(n,this.editedRecord.ganttProperties.duration,this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties),i&&(i.ej2_instances[0].value=r)):(n=this.parent.dateValidationModule.checkEndDate(new Date(this.parent.projectEndDate)),r=this.parent.dateValidationModule.getStartDate(n,this.editedRecord.ganttProperties.duration,this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties),i&&(i.ej2_instances[0].value=r)),e&&(e.ej2_instances[0].value=null)}},w.prototype.uniqueIdValidatorFn=function(t,i){return function(e){return"ResourceView"===i?-1===t.indexOf("T"+e.value)&&-1===t.indexOf("R"+e.value):-1===t.indexOf(e.value)}},w.prototype.validateScheduleFields=function(e,t,i){ne.isNullOrUndefined(i.editModule.dialogModule.dialog)||(a=i.editModule.dialogModule.dialog);var a,n,r=null,s=i.editModule.dialogModule.editedRecord,o=null,l=null,d="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,h=this.parent.viewType;return ne.isNullOrUndefined(e.element)?ne.isNullOrUndefined(e.container)?ne.isNullOrUndefined(e.event)||ne.isNullOrUndefined(e.event.path)||ne.isNullOrUndefined(e.event.path[1])||(r=(n=e.event.path[1]).querySelector("input").getAttribute("id"),n=n.querySelector("#"+r)):(r=(n=e.container).querySelector("input").getAttribute("id"),n=n.querySelector("#"+r)):r=(n=e.element).getAttribute("id"),ne.isNullOrUndefined(n)?(o=e.value,l=t.field):(o=("datetimepickeredit"===t.editType?e:n).value,l=r.replace(i.element.id,""),"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType&&(n={rules:((t={})[this.parent.taskFields.id]={required:!0,minLength:[this.uniqueIdValidatorFn(d,h),"ID is already present, please enter new value"]},t)},new B.FormValidator("#"+this.parent.element.id+"GeneralTabContainer",n))),0===l.search("Segments")?(l=l.replace("SegmentsTabContainer",""),this.validateSegmentFields(i,l,o,e),!(this.isTriggered=!1)):(r=!1,this.parent.taskFields.baselineDuration!==l&&this.parent.taskFields.baselineStartDate!==l&&this.parent.taskFields.baselineEndDate!==l||(r=!0),this.validateScheduleValuesByCurrentField(l,o,this.editedRecord,r),d=s.ganttProperties,t=(h=this.parent.dateValidationModule.getFieldMappings(r)).startdateField,n=h.enddateField,o=h.durationField,s=i.taskFields,ne.isNullOrUndefined(s.startDate||!ne.isNullOrUndefined(s.baselineStartDate))||s[t]===l||this.updateScheduleFields(a,d,t),s[n]===l&&!ne.isNullOrUndefined(d[t])&&!ne.isNullOrUndefined(e.value)&&d[t].getTime()>e.value&&this.updateScheduleFields(a,d,n),ne.isNullOrUndefined(s[n])||s[n]===l||(this.updateScheduleFields(a,d,n),this.parent.taskFields.constraintType&&this.updateScheduleFields(a,d,"constraintDate")),(!ne.isNullOrUndefined(s[o])&&s[o]!==l||0<=d[o])&&this.updateScheduleFields(a,d,o),ne.isNullOrUndefined(s.work)||s.work===l&&"FixedWork"===d.taskType||this.updateScheduleFields(a,d,"work"),this.dialogEditValidationFlag=!1,!(r=this.isTriggered=!1))},w.prototype.getConstraintDateElement=function(e,t,i){if(t===i.constraintDate)for(var a=0,n=this.beforeOpenArgs.tabModel.items;a<n.length;a++){var r=n[a];if("Advanced"===r.header.text)return r.content.querySelector("#"+e+t)}return null},w.prototype.updateScheduleFields=function(e,t,i){var a,n,r=this.parent,s=r.element.id,o=ne.getValue(i,r.columnMapping),l=r.columnByField[o],d=this.parent.taskFields;l&&(e=e.querySelector("#"+s+o),"stringedit"===l.editType?e&&(a=e.ej2_instances[0])&&(n=ne.isNullOrUndefined(l.edit)||ne.isNullOrUndefined(l.edit.read)?ne.isNullOrUndefined(l.valueAccessor)?this.parent.dataOperation.getDurationString(t[i],t.durationUnit):l.valueAccessor(o,r.editModule.dialogModule.editedRecord,l):l.edit.read(),a.value!==n.toString()&&d[i]===o?(a.value=n,a.dataBind()):d.startDate!==o&&d.endDate!==o&&d.baselineStartDate!==o&&d.baselineEndDate!==o||this.updateTextBoxValue(d,o,a,t)):"datepickeredit"===l.editType||"datetimepickeredit"===l.editType?(e=e||this.getConstraintDateElement(s,o,d))&&(l.editType,r=e.ej2_instances[0])&&(n=t[i],ne.isNullOrUndefined(r.value)&&!ne.isNullOrUndefined(n)||ne.isNullOrUndefined(n)&&!ne.isNullOrUndefined(r.value)||r.value!==n&&!ne.isNullOrUndefined(r.value)&&!ne.isNullOrUndefined(n)&&r.value.toString()!==n.toString())&&(r.value=n,r.dataBind()):"numericedit"===l.editType&&e&&(a=e.ej2_instances[0],n=t[i],ne.isNullOrUndefined(n)||a.value===n||(a.value=n,a.dataBind())))},w.prototype.validateDuration=function(e,t){var i,a=e.ganttProperties;this.dialogEditValidationFlag||(t||ne.isNullOrUndefined(a.startDate)||j(a)||!ne.isNullOrUndefined(a.duration)?t||!j(a)&&ne.isNullOrUndefined(a.startDate)?t&&!ne.isNullOrUndefined(a.baselineStartDate)?(0!==e.ganttProperties.baselineDuration&&(i=this.parent.dateValidationModule.checkStartDate(a.baselineStartDate,void 0,void 0,void 0,!0),this.parent.setRecordValue("baselineStartDate",i,a,!0),this.parent.taskFields.baselineStartDate)&&this.parent.dataOperation.updateMappingData(e,"baselineStartDate"),this.parent.dateValidationModule.calculateEndDate(e,t)):(j(a)||ne.isNullOrUndefined(a.endDate))&&ne.isNullOrUndefined(a.endDate)&&!ne.isNullOrUndefined(a.baselineEndDate)||this.parent.dateValidationModule.calculateStartDate(e,t):(e.ganttProperties.isMilestone&&0!==e.ganttProperties.duration&&(i=this.parent.dateValidationModule.checkStartDate(a.startDate),this.parent.setRecordValue("startDate",i,a,!0),this.parent.taskFields.startDate)&&this.parent.dataOperation.updateMappingData(e,"startDate"),this.parent.dateValidationModule.calculateEndDate(e)):(this.parent.setRecordValue("endDate",null,a,!0),this.parent.setRecordValue("isMilestone",!1,a,!0)),t||(i=0===a.duration,this.parent.setRecordValue("isMilestone",i,a,!0)),this.dialogEditValidationFlag=!0)},w.prototype.validateStartDate=function(e,t){var i=e.ganttProperties,a=this.parent.taskFields,n=this.parent.dateValidationModule.getFieldMappings(t),r=n.startdateField,s=n.enddateField,n=n.durationField;this.dialogEditValidationFlag||(ne.isNullOrUndefined(i[r])?(this.parent.setRecordValue(n,null,i,!0),t||(this.parent.setRecordValue("isMilestone",!1,i,!0),this.parent.allowUnscheduledTasks&&ne.isNullOrUndefined(a.endDate)&&this.parent.setRecordValue("endDate",null,i,!0))):j(i)||t?ne.isNullOrUndefined(a[n])?this.parent.dateValidationModule.calculateDuration(e,t):(ne.isNullOrUndefined(a[s]),this.parent.dateValidationModule.calculateEndDate(e,t)):ne.isNullOrUndefined(i.endDate)?ne.isNullOrUndefined(i.duration)||this.parent.dateValidationModule.calculateEndDate(e):this.parent.dateValidationModule.calculateDuration(e),this.dialogEditValidationFlag=!0)},w.prototype.validateEndDate=function(e,t){var i,a,n=e.ganttProperties,r=this.parent.taskFields;this.dialogEditValidationFlag||(i=(a=this.parent.dateValidationModule.getFieldMappings(t)).startdateField,a.enddateField,a=a.durationField,j(n)||t?ne.isNullOrUndefined(r[a])?this.parent.dateValidationModule.calculateDuration(e,t):ne.isNullOrUndefined(n[i])?this.parent.dateValidationModule.calculateStartDate(e,t):(t||!ne.isNullOrUndefined(n.segments)&&0<n.segments.length&&this.parent.editModule&&this.parent.editModule.cellEditModule&&(n.segments=this.parent.editModule.cellEditModule.validateEndDateWithSegments(n)),this.parent.dateValidationModule.calculateDuration(e,t)):ne.isNullOrUndefined(n[a])?ne.isNullOrUndefined(n[i])||this.parent.dateValidationModule.calculateDuration(e,t):this.parent.dateValidationModule.calculateStartDate(e,t),this.dialogEditValidationFlag=!0)},w.prototype.updateConstraintDate=function(e,t){var i=e.constraintType;i===k.ConstraintType.StartNoEarlierThan||i===k.ConstraintType.StartNoLaterThan?this.parent.setRecordValue("constraintDate",e.startDate,e,!0):i!==k.ConstraintType.FinishNoEarlierThan&&i!==k.ConstraintType.FinishNoLaterThan||this.parent.setRecordValue("constraintDate",e.endDate,e,!0),this.parent.dataOperation.updateMappingData(t,"constraintDate")},w.prototype.validateScheduleValuesByCurrentField=function(e,t,i,a){var n,r,s,o,l,d,h,p,u=this.parent,c=i.ganttProperties,g=u.taskFields;return g.duration!==e&&g.baselineDuration!==e||(h=!ne.isNullOrUndefined(t)&&""!==t&&0<=parseFloat(t),r=/^[^\d.-]+$/.test(t),n=""===t,d=a?g.baselineDuration:g.duration,s=(l=this.parent.dateValidationModule.getFieldMappings(a)).startdateField,o=l.enddateField,l=l.durationField,h?(u.dataOperation.updateDurationValue(t,c,a),this.parent.setRecordValue(d,t,i),this.parent.setRecordValue("taskData."+d,c[l],i),a||!c.isMilestone||ne.isNullOrUndefined(this.parent.editModule.cellEditModule)||((p={}).data=i,this.parent.editModule.cellEditModule.updateDates(p)),this.validateDuration(i,a)):(a&&h||u.allowUnscheduledTasks)&&(c[s]&&c[o]&&c[s].getTime()>c[o].getTime()||-1!==t.indexOf("-")?(this.parent.setRecordValue(l,0,c,!0),c[o]&&this.parent.setRecordValue(s,c[o],c,!0)):n?(this.parent.setRecordValue(l,null,c,!0),c[s]&&c[s]&&this.parent.setRecordValue(o,null,c,!0)):(r&&(d=a?g.baselineDuration:g.duration,this.parent.trigger("actionFailure",{error:"The provided value for the "+d+" field is invalid. Please ensure it contains only valid numeric values."})),this.parent.setRecordValue(l,c[l],c,!0))),a)||this.parent.editModule.updateResourceRelatedFields(i,"duration"),g.startDate!==e&&g.baselineStartDate!==e||(""!==t?(h=a?"baselineStartDate":"startDate",n=this.parent.dateValidationModule.getDateFromFormat(t),n=this.parent.dateValidationModule.checkStartDate(n,c,void 0,void 0,a),this.parent.setRecordValue(h,n,c,!0),this.validateStartDate(i,a),this.parent.taskFields.constraintType&&this.updateConstraintDate(c,i)):a||!u.allowUnscheduledTasks||i.hasChildRecords||(this.parent.setRecordValue("startDate",null,c,!0),this.parent.setRecordValue("duration",null,c,!0),this.parent.setRecordValue("isMilestone",!1,c,!0))),g.endDate!==e&&g.baselineEndDate!==e||(s=(r=this.parent.dateValidationModule.getFieldMappings(a)).startdateField,o=r.enddateField,l=r.durationField,""!==t?(d=this.parent.dateValidationModule.getDateFromFormat(t),h=this.parent.getCurrentDayEndTime(d),0===d.getHours()&&86400!==h&&this.parent.dateValidationModule.setTime(h,d),!ne.isNullOrUndefined(c[s])&&!ne.isNullOrUndefined(c[o])&&!ne.isNullOrUndefined(d)&&c[s].getTime()>d.getTime()&&(d=c[o]),d=this.parent.dateValidationModule.checkEndDate(d,c,void 0,a),(ne.isNullOrUndefined(c[s])||d.getTime()>=c[s].getTime())&&this.parent.setRecordValue(o,d,c,!0),this.validateEndDate(i,a),a||!c.isMilestone||ne.isNullOrUndefined(this.parent.editModule.cellEditModule)||((p={}).data=i,this.parent.editModule.cellEditModule.updateDates(p))):u.allowUnscheduledTasks&&!a&&(this.parent.setRecordValue(o,null,c,!0),this.parent.setRecordValue(l,null,c,!0),a||this.parent.setRecordValue("isMilestone",!1,c,!0))),g.work!==e||ne.isNullOrUndefined(t)||""===t||(this.parent.setRecordValue("work",t,c,!0),this.parent.editModule.updateResourceRelatedFields(i,"work"),this.validateDuration(i)),e===g.type&&(this.parent.setRecordValue("taskType",t,c,!0),t)&&"FixedDuration"===t&&0===c.duration&&this.parent.editModule.updateResourceRelatedFields(i,"work"),g.manual===e&&this.parent.editModule.updateTaskScheduleModes(i),!0},w.prototype.getSegmentsModel=function(r){for(var s=this,e=this.parent.taskFields,e=(!ne.isNullOrUndefined(r)&&0!==r.length||(r=[],ne.isNullOrUndefined(e.startDate)||r.push(this.parent.taskFields.startDate),ne.isNullOrUndefined(e.endDate)||r.push(this.parent.taskFields.endDate),ne.isNullOrUndefined(e.duration)||r.push(this.parent.taskFields.duration),ne.isNullOrUndefined(e.id))||r.push(this.parent.taskFields.id),{}),t=(e.editSettings={allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal",newRowPosition:"Bottom"},e.locale=this.parent.locale,e.dataSource=[],e.rowHeight=this.resolveCondition(this.parent.isAdaptive,48,null),e.toolbar=[{id:this.parent.element.id+"SegmentsTabContainer_add",prefixIcon:"e-add",tooltipText:this.localeObj.getConstant("add"),align:"Right",text:this.resolveCondition(this.parent.isAdaptive,"",this.localeObj.getConstant("add"))},{id:this.parent.element.id+"SegmentsTabContainer_delete",prefixIcon:"e-delete",tooltipText:this.localeObj.getConstant("delete"),align:"Right",text:this.resolveCondition(this.parent.isAdaptive,"",this.localeObj.getConstant("delete"))}],[]),i=this,a=0;a<r.length;a++)!function(a){var e={},n="General";switch(r[a]){case i.parent.taskFields.id:e={field:r[a],visible:!1,isPrimaryKey:!0},t.push(e);break;case i.parent.taskFields.startDate:case i.parent.taskFields.endDate:e={field:r[a],headerText:i.localeObj.getConstant(r[a]===i.parent.taskFields.startDate?"startDate":"endDate"),editType:"stringedit",width:"200px",edit:{write:function(e){t=(ne.isNullOrUndefined(s.beforeOpenArgs[n])||ne.isNullOrUndefined(s.beforeOpenArgs[n][r[a]])?(t=s.getGeneralColumnFields(),s.getFieldsModel(t)):s.beforeOpenArgs[n])[r[a]];var t,i=e.rowData[e.column.field];ne.setValue("value",i,t),new s.inputs[s.parent.columnByField[r[a]].editType](t).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value}},format:i.parent.getDateFormat()},r[a]===i.parent.taskFields.startDate&&(e.validationRules={required:!0}),t.push(e);break;case i.parent.taskFields.duration:e={field:r[a],headerText:i.localeObj.getConstant(r[a].toLocaleLowerCase()),editType:"stringedit",width:"100px",edit:{write:function(e){(t=(ne.isNullOrUndefined(s.beforeOpenArgs[n])||ne.isNullOrUndefined(s.beforeOpenArgs[n][r[a]])?(t=s.getGeneralColumnFields(),s.getFieldsModel(t)):s.beforeOpenArgs[n])[r[a]]).floatLabelType="Never";var t,i=e.rowData[e.column.field];ne.isNullOrUndefined(i)?ne.setValue("value",null,t):ne.setValue("value",i,t),ne.setValue("value",i,t),new B.TextBox(t).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value.toString()}}},t.push(e)}}(a);return e.columns=t,e.height=this.resolveCondition(this.parent.isAdaptive||this.parent.enableAdaptiveUI,"100%","153px"),e},w.prototype.getGridColumnByField=function(e,t){for(var i,a=0;a<t.length;a++)t[a].field===e&&(i=t[a]);return i},w.prototype.updateSegmentField=function(e,t,i){var a,n=this.parent.editModule.dialogModule.dialog,r=ne.getValue("Segments",this.beforeOpenArgs),r=this.getGridColumnByField(e,r.columns),s=this.parent.element.id,i=i[e];"datepickeredit"!==r.editType&&"stringedit"!==r.editType||(a=n.querySelector("#"+s+"SegmentsTabContainer"+e).ej2_instances[0]),ne.isNullOrUndefined(a.value)||ne.isNullOrUndefined(i)||a.value.toString()===i.toString()||(a.value=i,a.dataBind())},w.prototype.validateSegmentFields=function(e,t,i,a){var n,r=this.parent.taskFields,s=this.parent.defaultCalendarContext;ne.isNullOrUndefined(r.duration)||r.duration.toLowerCase()!==t.toLowerCase()||ne.isNullOrUndefined(i)||""===i||(n=this.parent.dateValidationModule.getDurationValue(i),this.selectedSegment[r.duration]=Math.abs(Number(ne.getValue("duration",n))),n=e.dataOperation.getEndDate(this.selectedSegment[r.startDate],Math.abs(Number(ne.getValue("duration",n))),this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1),n=e.dataOperation.checkEndDate(n,this.editedRecord.ganttProperties,!1),this.selectedSegment[r.endDate]=n),ne.isNullOrUndefined(r.startDate)||r.startDate.toLowerCase()!==t.toLowerCase()||""!==i&&(e=this.parent.dateValidationModule.getDateFromFormat(i),e=this.parent.dateValidationModule.checkStartDate(e),this.selectedSegment[r.startDate]=e,ne.isNullOrUndefined(r.endDate)||(this.selectedSegment.endDate=this.parent.dataOperation.getEndDate(e,this.selectedSegment[r.duration],this.editedRecord.ganttProperties.durationUnit,this.editedRecord.ganttProperties,!1))),ne.isNullOrUndefined(r.endDate)||r.endDate.toLowerCase()!==t.toLowerCase()||""!==i&&(n=this.parent.dateValidationModule.getDateFromFormat(i),e=this.parent.getCurrentDayEndTime(n),0===n.getHours()&&86400!==e&&this.parent.dateValidationModule.setTime(e,n),n=this.parent.dateValidationModule.checkEndDate(n,this.editedRecord.ganttProperties),this.selectedSegment[r.endDate]=n,this.selectedSegment[r.duration]=this.parent.dataOperation.getDuration(this.selectedSegment[r.startDate],this.selectedSegment[r.endDate],this.editedRecord.ganttProperties.durationUnit,!0,!1,!0,s)),ne.isNullOrUndefined(r.startDate)||this.updateSegmentField(r.startDate,a,this.selectedSegment),ne.isNullOrUndefined(r.endDate)||this.updateSegmentField(r.endDate,a,this.selectedSegment),ne.isNullOrUndefined(r.duration)||this.updateSegmentField(r.duration,a,this.selectedSegment)},w.prototype.getPredecessorModel=function(e){!ne.isNullOrUndefined(e)&&0!==e.length||(e=["ID","Name","Type","Offset","UniqueId"]);var t={editSettings:{allowEditing:!0,allowAdding:!0,allowDeleting:!0,mode:"Normal"}};t.locale=this.parent.locale,t.dataSource=[],t.rowHeight=this.parent.isAdaptive?48:null,t.toolbar=[{id:this.parent.element.id+"DependencyTabContainer_add",prefixIcon:"e-add",tooltipText:this.localeObj.getConstant("add"),align:"Right",text:this.resolveCondition(this.parent.isAdaptive,"",this.localeObj.getConstant("add"))},{id:this.parent.element.id+"DependencyTabContainer_delete",prefixIcon:"e-delete",tooltipText:this.localeObj.getConstant("delete"),align:"Right",text:this.resolveCondition(this.parent.isAdaptive,"",this.localeObj.getConstant("delete"))}];for(var i=[],a=0;a<e.length;a++){var n={};"id"===e[a].toLowerCase()?(n={field:"id",headerText:this.localeObj.getConstant("id"),allowEditing:!1,width:"70px"},i.push(n)):"name"===e[a].toLowerCase()?(n={field:"name",headerText:this.localeObj.getConstant("name"),editType:"stringedit",width:"250px",validationRules:{required:!0}},i.push(n)):"type"===e[a].toLowerCase()?(n={field:"type",headerText:this.localeObj.getConstant("type"),editType:"dropdownedit",dataSource:this.types,foreignKeyField:"id",foreignKeyValue:"text",defaultValue:"FS",validationRules:{required:!0},width:"150px"},i.push(n)):"offset"===e[a].toLowerCase()?(n={field:"offset",headerText:this.localeObj.getConstant("offset"),editType:"stringedit",defaultValue:this.parent.dataOperation.getDurationString(0,this.beforeOpenArgs.rowData.ganttProperties.durationUnit),validationRules:{required:!0},width:"100px"},i.push(n)):"uniqueid"===e[a].toLowerCase()&&(n={field:"uniqueId",isPrimaryKey:!0,visible:!1,defaultValue:(Q++).toString()},i.push(n))}return t.columns=i,t.height=this.resolveCondition(this.parent.isAdaptive||this.parent.enableAdaptiveUI,"100%","153px"),t},w.prototype.getResourcesModel=function(e){for(var t=this.parent.resourceFields,i=(!ne.isNullOrUndefined(e)&&0!==e.length||(e=[t.id,t.name,t.unit,t.group]),{allowFiltering:!0,treeColumnIndex:-1,childMapping:"",editSettings:{allowEditing:!0,mode:"Cell"},locale:this.parent.locale,allowSelection:!0,rowHeight:this.parent.isAdaptive?48:null,filterSettings:{type:"Menu"},selectionSettings:{checkboxOnly:!0,checkboxMode:"Default",persistSelection:!0,type:"Multiple"}}),a=[{type:"checkbox",allowEditing:!1,allowSorting:!1,allowFiltering:!1,width:60}],n=0;n<e.length;n++){var r={};e[n]===t.id?(r={field:t.id,headerText:this.localeObj.getConstant("id"),isPrimaryKey:!0,width:"100px",allowEditing:!1},a.push(r)):e[n]===t.name?(r={field:t.name,headerText:this.localeObj.getConstant("name"),allowEditing:!1},a.push(r)):e[n]===t.unit?(r={field:t.unit,headerText:this.localeObj.getConstant("unit"),editType:"numericedit",edit:{params:{min:0}}},a.push(r)):e[n]!==t.group||ne.isNullOrUndefined(t.group)||(r={field:t.group,headerText:this.localeObj.getConstant("group"),allowEditing:!1},a.push(r))}return i.columns=a,i.height=this.parent.isAdaptive||this.parent.enableAdaptiveUI?"100%":"196px",i},w.prototype.getNotesModel=function(e){return!ne.isNullOrUndefined(e)&&0!==e.length||(e=["Bold","Italic","Underline","StrikeThrough","FontName","FontSize","FontColor","BackgroundColor","LowerCase","UpperCase","|","Alignments","OrderedList","UnorderedList","Outdent","Indent","|","CreateTable","CreateLink","|","ClearFormat","Print","|","Undo","Redo"]),{placeholder:this.localeObj.getConstant("writeNotes"),toolbarSettings:{items:e},height:this.parent.isAdaptive||this.parent.enableAdaptiveUI?"100%":"auto",locale:this.parent.locale}},w.prototype.createDivElement=function(e,t){return ne.createElement("div",{className:e,id:t})},w.prototype.createFormElement=function(e,t){return ne.createElement("form",{className:e,id:t})},w.prototype.createInputElement=function(e,t,i,a){return ne.createElement(a||"input",{className:e,attrs:{type:"text",id:t,name:i,title:i}})},w.prototype.renderTabItems=function(){for(var e=this.beforeOpenArgs.tabModel.items,t=0,i=0;i<e.length;i++){var a=e[i];a.content instanceof HTMLElement||("General"===a.content?a.content=this.renderGeneralTab(a.content):"Advanced"===a.content?a.content=this.renderAdvancedTab(a.content):"Dependency"===a.content?(this.editedRecord.hasChildRecords&&!this.parent.allowParentDependency&&(a.disabled=!0),a.content=this.renderPredecessorTab(a.content)):"Resources"===a.content?a.content=this.renderResourceTab(a.content):a.content==="Custom"+t?(a.content=this.renderCustomTab(a.content,!0),t++):"Notes"===a.content?a.content=this.renderNotesTab(a.content):"Segments"===a.content&&(this.editedRecord.hasChildRecords&&(a.disabled=!0),a.content=this.renderSegmentsTab(a.content)))}},w.prototype.calculateSegmentDuration=function(e,t,i,a){return e.getTime()===t.getTime()?1:(a=a.rowData.ganttProperties?a.rowData.ganttProperties.calendarContext:this.parent.defaultCalendarContext,this.parent.dataOperation.getDuration(e,t,i.durationUnit,!0,!1,!0,a))},w.prototype.segmentGridActionBegin=function(e){var t=this.parent.taskFields,i=this.beforeOpenArgs.Segments;if("add"===e.requestType||"beginEdit"===e.requestType||"save"===e.requestType){var a,n,r,s=i.dataSource,o=ne.getValue("rowData",e),l=this.beforeOpenArgs.rowData.ganttProperties.startDate;if(ne.isNullOrUndefined(l)||"add"===e.requestType&&(l={},a=ne.getValue(this.parent.taskFields.startDate,o),n=this.parent.taskFields.endDate?ne.getValue(this.parent.taskFields.endDate,o):null,r=void 0,ne.isNullOrUndefined(this.parent.taskFields.duration)||(r=ne.getValue(this.parent.taskFields.duration,o)),(o=!ne.isNullOrUndefined(s)&&0<s.length?ne.isNullOrUndefined(t.endDate)||ne.isNullOrUndefined(s[0][t.endDate])?new Date(ne.getValue(t.startDate,s[0]).getTime()):new Date(ne.getValue(t.endDate,s[0]).getTime()):!ne.isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)&&new Date(this.beforeOpenArgs.rowData.ganttProperties.startDate.getTime())).setHours(0,0,0,0),!ne.isNullOrUndefined(s)&&0<s.length&&o.setDate(o.getDate()+2),a=this.parent.dataOperation.checkStartDate(o),n=this.parent.dateValidationModule.getDateFromFormat(a),86400!==(o=this.parent.getCurrentDayEndTime(n))&&0===n.getHours()&&this.parent.dateValidationModule.setTime(o,n),n=!ne.isNullOrUndefined(t.endDate)&&!ne.isNullOrUndefined(s)&&s.length<=0?this.beforeOpenArgs.rowData.ganttProperties.endDate:n,o=this.beforeOpenArgs.rowData.ganttProperties,r=this.calculateSegmentDuration(a,n,o,this.beforeOpenArgs),l=ne.isNullOrUndefined(t.duration)?((s={})[t.startDate]=a,s[t.endDate]=n,s):((o={})[t.startDate]=a,o[t.endDate]=n,o[t.duration]=r,o),e.rowData=l),"save"===e.requestType){for(var d=i.dataSource,h=this.parent.taskFields.id,p=d.length;d.some(function(e){return e[h]===p});)p++;ne.isNullOrUndefined(e.data[h])&&(e.data[h]=p,e.rowData[h]=p)}ne.isNullOrUndefined(e.data)||ne.isNullOrUndefined(e.data[t.duration])||this.validateSegmentFields(this.parent,"Duration",e.data[t.duration],e.data),this.selectedSegment=e.rowData,e.data=this.selectedSegment}},w.prototype.getDialogTabIndex=function(i){var a;return this.isEdit?this.parent.editDialogFields.map(function(e,t){e.type===i&&(a=t)}):this.parent.addDialogFields.map(function(e,t){e.type===i&&(a=t)}),a},w.prototype.setInjected=function(e,t,i,a,n,r,s){if(!ne.isNullOrUndefined(e)&&!ne.isNullOrUndefined(e.additionalParams))for(var o in t=e.additionalParams)if(Object.prototype.hasOwnProperty.call(t,o))switch(o){case"allowFiltering":i.Inject(T.Filter);break;case"allowSorting":i.Inject(T.Sort);break;case"allowPaging":i.Inject(T.Page);break;case"allowGrouping":i.Inject(T.Group);break;case"editSettings":i.Inject(T.Edit);break;case"aggregates":i.Inject(T.Aggregate);break;case"showColumnChooser":i.Inject(T.ColumnChooser);break;case"showColumnMenu":i.Inject(T.ColumnMenu);break;case"contextMenuItems":i.Inject(T.ContextMenu);break;case"allowResizing":i.Inject(T.Resize);break;case"allowReordering":i.Inject(T.Reorder);break;case"detailTemplate":i.Inject(T.DetailRow);break;case"allowRowDragAndDrop":i.Inject(T.RowDD);break;case"searchSettings":i.Inject(T.Search);break;case"selectionSettings":i.Inject(Selection);break;case"enableVirtualization":i.Inject(b.VirtualScroll);break;case"toolbar":t.toolbar.map(function(e){switch(e){case"Search":i.Inject(T.Search);break;case"Print":i.Inject(T.Print);break;case"PdfExport":i.Inject(T.PdfExport);break;case"ExcelExport":i.Inject(T.ExcelExport)}}),r.toolbar,i.Inject(T.Toolbar);break;case"columns":r.columns}},w.prototype.renderSegmentsTab=function(e){var i=this,t=this.parent,a=this.beforeOpenArgs[e],n=(a.enableAdaptiveUI=this.parent.enableAdaptiveUI,this.beforeOpenArgs.rowData),r=[],n=((r=this.isEdit?ne.isNullOrUndefined(n.taskData[this.parent.taskFields.segments])?[]:n.taskData[this.parent.taskFields.segments]:r).map(function(e,t){ne.isNullOrUndefined(e[i.parent.taskFields.id])&&(e[i.parent.taskFields.id]=t)}),a.dataSource=r,a.actionBegin=this.segmentGridActionBegin.bind(this),this.getDialogTabIndex("Segments")),r=(this.isEdit?this.isEdit&&(s=this.parent.editDialogFields[n]):s=this.parent.addDialogFields[n],[]),n=[],s=(ne.isNullOrUndefined(s)||ne.isNullOrUndefined(s.additionalParams)||(o=s.additionalParams),this.setInjected(s,o,T.Grid,void 0,r,a,n),T.Grid.Inject(T.Edit,T.Page,T.Toolbar,T.ForeignKey),(a=Object.assign({},a,o)).toolbar=r.concat(a.toolbar),this.updateColumns(n,a.columns)),o=(a.columns=s,new T.Grid(a)),r=this.createDivElement("",t.element.id+""+e+"TabContainer");return o.appendTo(r),r},w.prototype.renderGeneralTab=function(e,t){var r,i=this.parent,s=[],o=this.beforeOpenArgs[e],l=t?this.createDivElement("e-edit-form-row",i.element.id+""+e+"TabContainer"):this.createFormElement("e-edit-form-row",i.element.id+""+e+"TabContainer");this.parent.enableAdaptiveUI&&(l.style.height="100%",(h=ne.createElement("table",{className:"e-table"})).style.width="100%",r=ne.createElement("tbody"));for(var t=l.id,d=this,a=0,n=Object.keys(o);a<n.length;a++)!function(e){if(!1===d.parent.columnByField[e].visible||"WBSCode"===e||"WBSPredecessor"===e)return;var t,i=d.parent.columnByField[e],a=o[e],n=void 0,n=i.editTemplate?(t=d.createDivElement("e-edit-form-column"),a.forEach(function(e){return t.appendChild(e)}),t):d.renderInputElements(a,i);(d.parent.enableAdaptiveUI?r:l).appendChild(n),s.push(e)}(n[a]);this.parent.enableAdaptiveUI&&(h.appendChild(r),l.appendChild(h)),t!==l.id&&(l.id=t);i=this.getDialogTabIndex("General"),e=[];if(this.isEdit||ne.isNullOrUndefined(this.parent.addDialogFields[i])||ne.isNullOrUndefined(this.parent.addDialogFields[i].fields)?!this.isEdit||ne.isNullOrUndefined(this.parent.editDialogFields[i])||ne.isNullOrUndefined(this.parent.editDialogFields[i].fields)||(e=this.parent.editDialogFields[i].fields):e=this.parent.addDialogFields[i].fields,!ne.isNullOrUndefined(e)){var h=e.filter(function(e){return!s.includes(e)});if(!ne.isNullOrUndefined(h))for(var p=h,u=0;u<=p.length-1;u++){var c,g=document.getElementById(p[u]);ne.isNullOrUndefined(g)||(g=g.innerHTML,(c=ne.createElement("div")).innerHTML=g,l.appendChild(c.children[0]))}}return l},w.prototype.appendTemplateFields=function(e,t){for(var i=0;i<=e.length-1;i++){var a,n=document.getElementById(e[i]);ne.isNullOrUndefined(n)||(n=n.innerHTML,(a=ne.createElement("div")).innerHTML=n,t.appendChild(a.children[0]))}},w.prototype.renderAdvancedTab=function(e,t){var r,i=this.parent,s=[],o=this.beforeOpenArgs[e],l=t?this.createDivElement("e-edit-form-row",i.element.id+""+e+"TabContainer"):this.createFormElement("e-edit-form-row",i.element.id+""+e+"TabContainer");this.parent.enableAdaptiveUI&&(l.style.height="100%",(h=ne.createElement("table",{className:"e-table"})).style.width="100%",r=ne.createElement("tbody"));for(var t=l.id,d=this,a=0,n=Object.keys(o);a<n.length;a++)!function(e){if(!1===d.parent.columnByField[e].visible)return;var t,i=d.parent.columnByField[e],a=o[e],n=void 0,n=i.editTemplate?(t=d.createDivElement("e-edit-form-column"),a.forEach(function(e){return t.appendChild(e)}),t):d.renderInputElements(a,i);(d.parent.enableAdaptiveUI?r:l).appendChild(n),s.push(e)}(n[a]);this.parent.enableAdaptiveUI&&(h.appendChild(r),l.appendChild(h)),t!==l.id&&(l.id=t);var h,i=this.getDialogTabIndex("Advanced"),e=[];return this.isEdit||ne.isNullOrUndefined(this.parent.addDialogFields[i])||ne.isNullOrUndefined(this.parent.addDialogFields[i].fields)?!this.isEdit||ne.isNullOrUndefined(this.parent.editDialogFields[i])||ne.isNullOrUndefined(this.parent.editDialogFields[i].fields)||(e=this.parent.editDialogFields[i].fields):e=this.parent.addDialogFields[i].fields,ne.isNullOrUndefined(e)||(h=e.filter(function(e){return!s.includes(e)}),ne.isNullOrUndefined(h))||this.appendTemplateFields(h,l),l},w.prototype.isCheckIsDisabled=function(e){var t,i,a=!1;if(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)if(-1!==this.parent.customColumns.indexOf(e.field))a=!0;else if(e.field===this.parent.taskFields.baselineStartDate||e.field===this.parent.taskFields.baselineEndDate||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type||e.field===this.parent.taskFields.id||e.field===this.parent.taskFields.name||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.startDate||e.field===this.parent.taskFields.endDate||e.field===this.parent.taskFields.constraintDate||e.field===this.parent.taskFields.constraintType){for(var n=0;n<this.parent.currentViewData.length;n++)if(!ne.isNullOrUndefined(this.parent.currentViewData[n].ganttProperties.taskId)){t=this.parent.currentViewData[n].ganttProperties.taskId;break}a=!("string"==typeof t&&!this.parent.readOnly)}return this.isEdit&&((e.field===this.parent.taskFields.id||"ResourceView"===this.parent.viewType&&this.rowData.hasChildRecords)&&(a=!0),this.editedRecord.hasChildRecords)&&(e.field===this.parent.taskFields.endDate&&(!ne.isNullOrUndefined(this.editedRecord[this.parent.taskFields.manual])&&!1===this.editedRecord[this.parent.taskFields.manual]||"Auto"===this.parent.taskMode)||e.field===this.parent.taskFields.duration||e.field===this.parent.taskFields.progress||e.field===this.parent.taskFields.work||e.field===this.parent.taskFields.type)&&(a=!0),this.editedRecord.ganttProperties.isAutoSchedule||-1!==[(i=this.parent.taskFields).constraintDate,i.constraintType].indexOf(e.field)&&(a=!0),a},w.prototype.isParentValid=function(e){if(0<e.length)for(var t=0;t<e.length;t++){if(e[t].uniqueID===this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}if(e[t].hasChildRecords&&this.isParentValid(e[t].childRecords),!this.isValidData)break}return this.isValidData},w.prototype.renderPredecessorTab=function(e){var i=this,t=this.parent,a=this.beforeOpenArgs[e],n=this.parent.columnByField[this.parent.taskFields.dependency],n=((!1===n.allowEditing||n.isPrimaryKey||this.parent.readOnly)&&(a.editSettings.allowEditing=!1,a.editSettings.allowAdding=!1,a.editSettings.allowDeleting=!1),this.beforeOpenArgs.rowData),r=[];this.taskNameCollection(),this.isEdit&&(r=this.predecessorEditCollection(n),this.updatePredecessorDropDownData(n)),n[this.parent.taskFields.dependency]&&(s=n[this.parent.taskFields.dependency].split(",").length),0!==this.preTableCollection.length&&this.preTableCollection.length!==s||(a.editSettings.allowAdding=!1),a.actionComplete=this.gridActionComplete.bind(this),a.dataSource=r,a.enableAdaptiveUI=this.parent.enableAdaptiveUI,a.enableRtl=this.parent.enableRtl,a.locale=this.parent.locale,a.actionBegin=this.gridActionBegin.bind(this);a.columns[1].edit={write:function(e){"add"===ne.getValue("requestType",e)&&ne.setValue("rowData.uniqueId",Q++,e);new F.ComboBox({dataSource:new U.DataManager(i.idCollection),popupHeight:"180px",allowCustom:!1,enableRtl:i.parent.enableRtl,fields:{value:"text"},value:e.rowData.name,change:function(e){var t=ne.closest(e.element,"tr").querySelector("#"+i.parent.element.id+"DependencyTabContainerid");t&&(ne.isNullOrUndefined(e.itemData)||ne.isNullOrUndefined(e.item)?t.value="":t.value=e.itemData.id)},autofill:!0}).appendTo(e.element)},read:function(e){return e.ej2_instances[0].value}};var n=this.getDialogTabIndex("Dependency"),s=(this.isEdit?this.isEdit&&(o=this.parent.editDialogFields[n]):o=this.parent.addDialogFields[n],[]),r=[],n=(ne.isNullOrUndefined(o)||ne.isNullOrUndefined(o.additionalParams)||(l=o.additionalParams),this.setInjected(o,l,T.Grid,void 0,s,a,r),T.Grid.Inject(T.Edit,T.Page,T.Toolbar,T.ForeignKey),(a=Object.assign({},a,l)).toolbar=(a.toolbar||[]).concat(s),this.updateColumns(r,a.columns)),o=(a.columns=n,new T.Grid(a)),l=this.createDivElement("e-dependent-div",t.element.id+""+e+"TabContainer");return o.appendTo(l),l},w.prototype.updateColumns=function(i,e){var a={};return i.forEach(function(e){"object"==typeof e&&(a[e.field]=e)}),e.forEach(function(e){var t;"object"==typeof e&&(t=e.field,a[t]?Object.assign(a[t],e):i.push(e))}),i},w.prototype.gridActionBegin=function(n){var r=this,e=this.beforeOpenArgs.Dependency;if("add"===n.requestType||"beginEdit"===n.requestType)for(var s="add"!==n.requestType,o=(this.idCollection=ne.extend([],[],this.preTableCollection,!0),e.dataSource),t=this,i=0;i<=o.length;i++)!function(a){t.idCollection.forEach(function(e,t){var i;e.id===ne.getValue("id",o[a])&&(i=ne.getValue("rowData",n),s&&ne.getValue("id",i)===e.id||r.idCollection.splice(r.idCollection.indexOf(e),1))})}(i)},w.prototype.filterDataSourceByCycles=function(i,a){for(var n=[],e=0;e<i.length;e++)!function(e){var t=i[e].id;a.cycles.some(function(e){return-1!==e.indexOf(t)})||n.push(i[e])}(e);return n},w.prototype.hasCyclesAndData=function(e,t){return 0<e.cycles.length&&0<t.length},w.prototype.gridActionComplete=function(e){var t,i,a,n,r=this.parent.editModule.dialogModule.dialog.querySelector("#"+this.parent.element.id+"DependencyTabContainer");"save"===e.requestType&&("ProjectView"===this.parent.viewType&&e.data&&(t={from:e.data.id,to:this.editedRecord[this.parent.taskFields.id].toString(),offset:e.data.offset,type:e.data.type},this.parent.cyclicValidator.resolve(),i=this.parent.cyclicValidator.wouldCreateCycleWhenAdding(t),a=this.beforeOpenArgs.Dependency.dataSource,this.hasCyclesAndData(i,a))&&(a=this.filterDataSourceByCycles(a,i),(n=r.ej2_instances[0]).dataSource=this.beforeOpenArgs.Dependency.dataSource=a,this.parent.trigger("actionFailure",{error:"Cyclic Dependency is detected for the newly added dependency from the Task ID "+t.from+" to Task ID "+t.to+". Please provide valid dependency."})),ne.isNullOrUndefined(r)||ne.isNullOrUndefined(e.rows)||e.rows.length!==this.preTableCollection.length||(n=r.ej2_instances[0])&&(n.editSettings.allowAdding=!1))},w.prototype.updateResourceCollection=function(e,t){if(!ne.isNullOrUndefined(e.data)&&Object.keys(e.data).length){t=document.querySelector("#"+t).ej2_instances[0];if(!ne.isNullOrUndefined(t)&&0<t.getSelectedRecords().length){for(var i=t.getSelectedRecords(),a=void 0,n=[],a=0;a<i.length;a++){var r=i[a],r=(ne.isNullOrUndefined(r.taskData)||ne.isNullOrUndefined(r.taskData[this.parent.resourceFields.unit])||ne.isNullOrUndefined(e.data[this.parent.resourceFields.unit])||r.taskData[this.parent.resourceFields.id]!==e.data[this.parent.resourceFields.id]||(r.taskData[this.parent.resourceFields.unit]=e.data[this.parent.resourceFields.unit]),this.parent.resourceFields.id),s=i[a].taskData[r];this.editedRecord&&this.editedRecord.ganttProperties&&Array.isArray(this.editedRecord.ganttProperties.resourceInfo)&&!ne.isNullOrUndefined(this.editedRecord.ganttProperties.resourceInfo[a])&&this.editedRecord.ganttProperties.resourceInfo[a][r]===s?n.push(this.editedRecord.ganttProperties.resourceInfo[a]):n.push(i[a].taskData)}this.ganttResources=ne.extend([],n)}else this.ganttResources=[]}else this.ganttResources=[]},w.prototype.processResourceInfo=function(e,t,i){if(e&&!ne.isNullOrUndefined(t))for(var a=0;a<t.length;a++)i.push(t[a]);else if(!e&&!ne.isNullOrUndefined(t))for(a=0;a<t.length;a++)i.push(t[a])},w.prototype.renderResourceTab=function(e){var i=this,t=this.parent,a=t.resourceFields,n=this.beforeOpenArgs.rowData,r=(("beforeOpenEditDialog"===this.beforeOpenArgs.requestType&&!ne.isNullOrUndefined(this.editedRecord[this.parent.taskFields.resourceInfo])||"beforeOpenAddDialog"===this.beforeOpenArgs.requestType&&!ne.isNullOrUndefined(this.editedRecord[this.parent.taskFields.resourceInfo]))&&"object"==typeof this.editedRecord[this.parent.taskFields.resourceInfo]&&this.parent.setRecordValue("resourceInfo",this.parent.dataOperation.setResourceInfo(this.editedRecord),n.ganttProperties,!0),n.ganttProperties.resourceInfo),s=((y=this.beforeOpenArgs[e]).enableAdaptiveUI=this.parent.enableAdaptiveUI,y.enableRtl=this.parent.enableRtl,y.locale=this.parent.locale,t.element.id+""+e+"TabContainer"),o=[],o=ne.extend([],[],t.resources,!0);if(this.parent.dataOperation.updateResourceUnit(o),!ne.isNullOrUndefined(r))for(var l=void 0,d=r.length,h=void 0,p=o.length,l=0;l<d;l++)for(h=0;h<p;h++)r[l][a.id]===o[h][a.id]&&(o[h][a.unit]=r[l][a.unit]);y.dataSource=this.reorderResources(r,o,a);var u,c,g,e=n.ganttProperties.resourceInfo,t=(this.processResourceInfo(this.isEdit,e,this.ganttResources),y.actionBegin=function(e){if(e.rowData&&e.columnName===i.parent.resourceFields.unit&&i.editedRecord.ganttProperties.resourceInfo)for(var t=0;t<i.editedRecord.ganttProperties.resourceInfo.length;t++)i.editedRecord.ganttProperties.resourceInfo[t][i.parent.resourceFields.id]===e.rowData[i.parent.resourceFields.id]&&(i.editedRecord.ganttProperties.resourceInfo[t][i.parent.resourceFields.unit]=e.value)},y.rowSelected=function(e){i.updateResourceCollection(e,s),i.currentResources=i.ganttResources},y.rowDeselected=function(e){i.updateResourceCollection(e,s),0===i.ganttResources.length?i.currentResources=null:i.currentResources=i.ganttResources},this.createDivElement("e-resource-div",s)),n=this.getDialogTabIndex("Resources"),f=(this.isEdit?this.isEdit&&(u=this.parent.editDialogFields[n]):u=this.parent.addDialogFields[n],[]);if(!ne.isNullOrUndefined(u)&&!ne.isNullOrUndefined(u.additionalParams))for(var m in c=u.additionalParams)if(Object.prototype.hasOwnProperty.call(c,m))switch(m){case"allowFiltering":b.TreeGrid.Inject(b.Filter);break;case"allowSorting":b.TreeGrid.Inject(b.Sort);break;case"allowPaging":b.TreeGrid.Inject(b.Page);break;case"editSettings":b.TreeGrid.Inject(b.Edit);break;case"aggregates":case"showColumnChooser":b.TreeGrid.Inject(b.Aggregate);break;case"showColumnMenu":b.TreeGrid.Inject(T.ColumnMenu);break;case"contextMenuItems":b.TreeGrid.Inject(T.ContextMenu);break;case"allowResizing":b.TreeGrid.Inject(b.Resize);break;case"allowReordering":b.TreeGrid.Inject(b.Reorder);break;case"detailTemplate":b.TreeGrid.Inject(T.DetailRow);break;case"allowRowDragAndDrop":b.TreeGrid.Inject(b.RowDD);break;case"searchSettings":b.TreeGrid.Inject(T.Search);break;case"selectionSettings":b.TreeGrid.Inject(b.Selection);break;case"toolbar":(g=c.toolbar).map(function(e){switch(e){case"Search":b.TreeGrid.Inject(T.Search);break;case"Print":b.TreeGrid.Inject(T.Print);break;case"PdfExport":b.TreeGrid.Inject(T.PdfExport);break;case"ExcelExport":b.TreeGrid.Inject(T.ExcelExport)}}),ne.isNullOrUndefined(g)||(y.toolbar=[],y.toolbar=y.toolbar.concat(g)),b.TreeGrid.Inject(b.Toolbar);break;case"enableVirtualization":b.TreeGrid.Inject(b.VirtualScroll);break;case"columns":f=y.columns}b.TreeGrid.Inject(b.Selection,b.Filter,b.Edit,b.VirtualScroll,b.Toolbar);var y=Object.assign({},y,c),e=this.updateColumns(f,y.columns),D=(y.columns=e,!1),k=(y.showColumnMenu&&(D=y.showColumnMenu,y.showColumnMenu=!1),new b.TreeGrid(y)),n=this.parent.columnByField[this.parent.taskFields.resourceInfo];return(!1===n.allowEditing||n.isPrimaryKey||this.parent.readOnly)&&(k.allowSelection=!1,k.allowFiltering=!1,k.editSettings.allowEditing=!1),k.dataBound=function(){var e;D&&(k.showColumnMenu=!0),1<=i.parent.editDialogFields.length&&"Resources"===i.parent.editDialogFields[0].type&&(e=i.parent.element.id+"ResourcesTabContainer",i.resourceSelection(e))},k.appendTo(t),t},w.prototype.reorderResources=function(e,t,i){if(ne.isNullOrUndefined(e)||0===e.length)return t;for(var a=new Map,n=0;n<t.length;n++){var r=t[n][i.id];a.set(r,n)}for(var s=[],o=new Set,n=0;n<e.length;n++){var l=e[n][i.id],l=a.get(l);ne.isNullOrUndefined(l)||(s.push(t[l]),o.add(l))}for(var d=[],n=0;n<t.length;n++)o.has(n)||d.push(t[n]);return s.concat(d)},w.prototype.resourceSelection=function(e){var a=this,n=document.querySelector("#"+e).ej2_instances[0],e=(this.parent.triggeredColumnName="",n.getCurrentViewRecords()),r=this.ganttResources;r&&0<r.length&&e.forEach(function(e,t){for(var i=0;i<r.length;i++)e.taskData[a.parent.resourceFields.id]!==r[i][a.parent.resourceFields.id]||ne.isNullOrUndefined(n.selectionModule)||-1!==n.getSelectedRowIndexes().indexOf(t)||n.selectRow(t)})},w.prototype.renderCustomTab=function(e,t){return this.renderGeneralTab(e,t)},w.prototype.renderNotesTab=function(e){var t,i,a=this.parent,n=this.beforeOpenArgs[e],r=(n.enableHtmlSanitizer=this.parent.enableHtmlSanitizer,this.editedRecord.ganttProperties),a=this.createDivElement("",a.element.id+""+e+"TabContainer"),e=this.getDialogTabIndex("Notes"),s=[];if(this.isEdit?this.isEdit&&(t=this.parent.editDialogFields[e]):t=this.parent.addDialogFields[e],!ne.isNullOrUndefined(t)&&!ne.isNullOrUndefined(t.additionalParams))for(var o in i=t.additionalParams)if(Object.prototype.hasOwnProperty.call(i,o))switch(o){case"toolbarSettings":for(var l=0;l<i.toolbarSettings.items.length;l++){var d=i.toolbarSettings.items[l];if(d)switch(d){case"Image":h.RichTextEditor.Inject(h.Image);break;case"CreateTable":h.RichTextEditor.Inject(h.Table);break;case"EmojiPicker":h.RichTextEditor.Inject(h.EmojiPicker);break;case"FileManager":h.RichTextEditor.Inject(h.FileManager);break;case"FormatPainter":h.RichTextEditor.Inject(h.FormatPainter)}}ne.isNullOrUndefined(i.toolbarSettings.items)||(s=n.toolbarSettings.items),h.RichTextEditor.Inject(h.Toolbar);break;case"editorMode":h.RichTextEditor.Inject(h.MarkdownEditor)}h.RichTextEditor.Inject(h.Toolbar,h.Link,h.HtmlEditor,h.QuickToolbar,h.Count,h.Table),n.value=r.notes;e=this.parent.columnByField[this.parent.taskFields.notes];return(!1===e.allowEditing||e.isPrimaryKey||this.parent.readOnly)&&(n.enabled=!1),(n=Object.assign({},n,i)).toolbarSettings.items=s.concat(n.toolbarSettings.items),new h.RichTextEditor(n).appendTo(a),a},w.prototype.renderInputElements=function(e,t){var i,a,n,r,s,o,l,d,h,p,u=this,c=this.parent.element.id,g=this.editedRecord,f=this.createDivElement("e-edit-form-column"),m=(this.parent.enableAdaptiveUI&&(i=ne.createElement("tr"),a=ne.createElement("td"),f.style.width="100%"),{column:t,data:g});return ne.isNullOrUndefined(t.edit)||!Object.prototype.hasOwnProperty.call(t.edit,"create")||Object.prototype.hasOwnProperty.call(t.edit,"params")?n=this.createInputElement("",c+""+t.field,t.field):((n="string"==typeof(h=t.edit.create)?(h=T.getObject(h,window))(m):t.edit.create(m)).className="",n.setAttribute("type","text"),n.setAttribute("id",c+""+t.field),n.setAttribute("name",t.field),n.setAttribute("title",t.field)),f.appendChild(n),e.enabled=ne.isNullOrUndefined(e.enabled)?!this.isCheckIsDisabled(t):e.enabled,t.field===this.parent.taskFields.constraintType&&g.hasChildRecords&&(r=this.parent.treeGridModule.getLocalizedConstraintTypeText("AsSoonAsPossible"),s=this.parent.treeGridModule.getLocalizedConstraintTypeText("StartNoEarlierThan"),o=this.parent.treeGridModule.getLocalizedConstraintTypeText("FinishNoLaterThan"),e.dataSource=e.dataSource.filter(function(e){e=e.text;return e===r||e===s||e===o})),t.field===this.parent.taskFields.duration?ne.isNullOrUndefined(t.valueAccessor)?ne.isNullOrUndefined(t.edit)&&(l=g.ganttProperties,e.value=this.parent.dataOperation.getDurationString(l.duration,l.durationUnit)):"string"==typeof t.valueAccessor?(d=T.getObject(t.valueAccessor,window),e.value=d(t.field,g,t)):"numericedit"===t.editType?e.value=g.ganttProperties.duration:e.value=t.valueAccessor(t.field,g,t):t.field===this.parent.taskFields.baselineDuration?ne.isNullOrUndefined(t.valueAccessor)?ne.isNullOrUndefined(t.edit)&&(l=g.ganttProperties,e.value=this.parent.dataOperation.getDurationString(l.baselineDuration,l.durationUnit)):"string"==typeof t.valueAccessor?(d=T.getObject(t.valueAccessor,window),e.value=d(t.field,g,t)):e.value=t.valueAccessor(t.field,g,t):"booleanedit"===t.editType?!0===g[t.field]?e.checked=!0:e.checked=!1:this.parent.taskFields[t.field]||"numericedit"!==t.editType||""!==g[t.field]&&0!==g[t.field]?e.value=g[t.field]:e.value=0,ne.isNullOrUndefined(t.edit)||!Object.prototype.hasOwnProperty.call(t.edit,"write")||Object.prototype.hasOwnProperty.call(t.edit,"params")?(p=new this.inputs[t.editType](e)).appendTo(n):(p=void 0,p="string"==typeof(h=t.edit.write)?(h=T.getObject(h,window))({column:t,rowData:g,element:n}):t.edit.write({column:t,rowData:g,element:n}),t.field===this.parent.taskFields.duration&&(p.change=function(e){u.validateScheduleFields(e,t,u.parent)})),this.parent.enableAdaptiveUI?(a.appendChild(f),i.appendChild(a),i):f},w.prototype.taskNameCollection=function(){var e=this.parent.flatData;this.preTaskIds=[],this.preTableCollection=[];for(var t=0;t<e.length;t++){var i=e[t];if(this.parent.allowParentDependency){var a=i;if(i.parentUniqueID===this.beforeOpenArgs.rowData.uniqueID)this.isValidData=!1;else do{if(a.parentItem&&(a=this.parent.flatData[this.parent.ids.indexOf(a.parentItem.taskId)]).uniqueID===this.beforeOpenArgs.rowData.uniqueID){this.isValidData=!1;break}}while(a.parentItem);if(i.hasChildRecords&&this.isValidData&&(this.isValidData=this.isParentValid(i.childRecords)),!this.isValidData){this.isValidData=!0;continue}}else if(i.hasChildRecords)continue;var n=("ResourceView"===this.parent.viewType?i.ganttProperties.taskId:i.ganttProperties.rowUniqueID).toString(),i={id:n,text:n+"-"+i.ganttProperties.taskName,value:n};this.preTaskIds.push(i.id),this.preTableCollection.push(i)}},w.prototype.predecessorEditCollection=function(e){var t=[],i=e.ganttProperties;if(this.isEdit&&!ne.isNullOrUndefined(this.parent.taskFields.dependency)&&!ne.isNullOrUndefined(e)&&!ne.isNullOrUndefined(i.predecessor))for(var a=i.predecessor,n=this.preTableCollection,r=0;r<a.length;r++){var s=a[r].from.toString(),o={};if(("ResourceView"===this.parent.viewType?i.taskId:i.rowUniqueID).toString()!==s){o.id=s;for(var l=0;l<n.length;l++)if(n[l].value===s){o.name=n[l].text;break}o.type=a[r].type;var d=a[r].offset,h=a[r].offsetUnit;o.offset=this.parent.dataOperation.getDurationString(d,h),o.uniqueId=Q++,t.push(o)}}return t},w.prototype.updatePredecessorDropDownData=function(e){this.processedId.length=0;var t=("ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID).toString(),t=this.preTaskIds.indexOf(t);this.preTableCollection.splice(t,1),this.preTaskIds.splice(t,1),this.validSuccessorTasks(e,this.preTaskIds,this.preTableCollection)},w.prototype.validSuccessorTasks=function(e,d,h){var t,p,u=this,e=e.ganttProperties;e.predecessor&&0<e.predecessor.length&&(t=e.predecessor,p=("ResourceView"===this.parent.viewType?e.taskId:e.rowUniqueID).toString(),t.forEach(function(e){if(e.from.toString()===p){var t,e=e.to;-1<(t=d.indexOf(e))&&(d.splice(t,1),h.splice(t,1));for(var i=u.parent.connectorLineModule.getRecordByID(e),a=!0,n=0,r=u.processedId;n<r.length;n++){var s=r[n];if(s.id===i.ganttProperties.taskId&&Array.isArray(s.value)&&Array.isArray(i.ganttProperties.predecessor)&&s.value.length===i.ganttProperties.predecessor.length){for(var o=!0,l=0;l<s.value.length;l++)if(s.value[l]!==i.ganttProperties.predecessor[l]){o=!1;break}if(o){a=!1;break}}}a&&(u.processedId.push({id:i.ganttProperties.taskId,value:i.ganttProperties.predecessor}),u.validSuccessorTasks(i,d,h))}}))},w.prototype.getPredecessorType=function(){var e=[this.parent.getPredecessorTextValue("SS"),this.parent.getPredecessorTextValue("SF"),this.parent.getPredecessorTextValue("FS"),this.parent.getPredecessorTextValue("FF")];return[{id:"FS",text:e[2],value:e[2]},{id:"FF",text:e[3],value:e[3]},{id:"SS",text:e[0],value:e[0]},{id:"SF",text:e[1],value:e[1]}]},w.prototype.initiateDialogSave=function(){if(this.isEdit?this.parent.initiateEditAction(!0):this.addedRecord={},this.currentResources&&(this.currentResources=null),this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("Edit")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.isEdit)){this.parent.undoRedoModule.createUndoCollection();var e={action:"DialogEdit",modifiedRecords:[]};if(this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=e,"ResourceView"===this.parent.viewType){var n,r,t=!1;if(this.rowData.ganttProperties.resourceInfo){if(this.ganttResources.length!==this.rowData.ganttProperties.resourceInfo.length)t=!0;else for(var i=0;i<this.rowData.ganttProperties.resourceInfo.length;i++)if(this.ganttResources[i][this.parent.resourceFields.id]!==this.rowData.ganttProperties.resourceInfo[i][this.parent.resourceFields.id]){t=!0;break}}else 0<this.ganttResources.length&&(t=!0);t&&(e={deletedIndexes:[]},n="T"+this.rowData.ganttProperties.taskId,r=[],this.parent.taskIds.reduce(function(e,t){if(t===n)if(0===this.ganttResources.length)r.push(this.parent.flatData[this.parent.taskIds.indexOf(t)]);else for(var i=this.parent.getTaskByUniqueID(this.parent.flatData[this.parent.taskIds.indexOf(t)].parentUniqueID),a=0;a<this.ganttResources.length;a++)i.ganttProperties.taskId!==this.ganttResources[a][this.parent.resourceFields.id]&&-1===r.indexOf(this.parent.flatData[this.parent.taskIds.indexOf(t)])&&r.push(this.parent.flatData[this.parent.taskIds.indexOf(t)])}.bind(this),[]),this.parent.undoRedoModule.findPosition(ne.extend([],[],r,!0),e,"deletedIndexes"),this.indexes?this.indexes.deletedIndexes[this.indexes.deletedIndexes.length]=e.deletedIndexes[0]:this.indexes=e)}}this.parent.updateDuration=!0;for(var a=this.parent,s=this.beforeOpenArgs.tabModel.items,i=0;i<s.length;i++){var o=s[i].content,l=o.getAttribute("id");ne.isNullOrUndefined(l)||("General"===(l=(l=l.replace(a.element.id,"")).replace("TabContainer",""))?this.updateGeneralTab(o,!1):"Advanced"===l?this.updateAdvancedTab(o):"Dependency"===l?(this.isFromDialogPredecessor=!0,this.updatePredecessorTab(o),this.isFromDialogPredecessor=!1):"Notes"===l?this.updateNotesTab(o):"Resources"===l?(this.updateResourceTab(o),this.dialogEditValidationFlag=!1):-1!==l.indexOf("Custom")?this.updateCustomTab(o):"Segments"===l&&this.updateSegmentsData(o))}if(!this.disableUndo&&this.parent.undoRedoModule&&(this.parent.undoRedoModule.getUndoCollection.splice(this.parent.undoRedoModule.getUndoCollection.length-1,1),this.parent.toolbarModule&&0===this.parent.undoRedoModule.getUndoCollection.length&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!1),this.parent.totalUndoAction--),this.isEdit){this.parent.editModule.editedRecord=this.rowData,this.parent.dataOperation.updateWidthLeft(this.rowData);e={data:this.rowData,action:"DialogEditing"};this.parent.editModule.initiateUpdateAction(e)}else if(this.parent.editModule.editedRecord=this.addedRecord,"ResourceView"===this.parent.viewType){var d=ne.extend({},this.addedRecord,!0);if(d[this.parent.taskFields.resourceInfo].length)for(i=0;i<d[this.parent.taskFields.resourceInfo].length;i++){var l=d[this.parent.taskFields.resourceInfo][i].toString(),h=this.parent.getTaskIds().indexOf("R"+l.toString());if(-1!==h){this.parent.editModule.addRecord(this.addedRecord,"Child",h);break}}else this.parent.editModule.addRecord(this.addedRecord,"Bottom")}else this.parent.editModule.addRecord(this.addedRecord,this.parent.editSettings.newRowPosition,this.parent.selectedRowIndex);return!0},w.prototype.compareObjects=function(e,r){return!ne.isNullOrUndefined(e)&&e.every(function(e,t){var i=r[t],a=Object.keys(e);if(!ne.isNullOrUndefined(e)&&!ne.isNullOrUndefined(i))for(var n=0;n<a.length;n++)if("startDate"===a[n]||"endDate"===a[n]){if(e[a[n]].getTime()!==i[a[n]].getTime())return!0}else if("duration"===a[n]&&e[a[n]]!==i[a[n]])return!0;return!1})},w.prototype.updateSegmentTaskData=function(e){var t,i,a=this.parent.taskFields;this.isEdit?(t=this.rowData.ganttProperties.segments,1===e.length?this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,[],this.rowData):this.parent.setRecordValue("taskData."+this.parent.taskFields.segments,e,this.rowData),i=this.parent.dataOperation.setSegmentsInfo(this.rowData,!0),(this.parent.enableUndoRedo&&t&&i&&t.length!==i.length||!t&&i||t&&!i||this.compareObjects(t,i))&&(this.disableUndo=!0),this.parent.setRecordValue("segments",i,this.rowData.ganttProperties,!0),this.parent.setRecordValue("segments",this.parent.dataOperation.setSegmentsInfo(this.rowData,!1),this.rowData.ganttProperties,!0),e.length<=0&&this.validateDuration(this.rowData)):this.addedRecord[a.segments]=e},w.prototype.updateSegmentsData=function(e){var t=this,e=e.ej2_instances[0],i=e.isEdit;e.isEdit&&e.endEdit(),i=i&&e.currentViewData.length!==e.dataSource.length?e.dataSource.map(function(e){e=Object.assign({},e);return delete e[t.parent.taskFields.id],e}):e.currentViewData.map(function(e){e=Object.assign({},e);return delete e[t.parent.taskFields.id],e}),this.updateSegmentTaskData(i)},w.prototype.updateGeneralTab=function(e,t){var i=this.parent,a=e.childNodes,n={};this.isEdit||(n=this.addedRecord);for(var r=0;r<a.length;r++){var s,o,l,d=a[r],h=d.querySelector('input[id^="'+i.element.id+'"]')||d.querySelector('textarea[id^="'+i.element.id+'"]'),p=Array.from(d.children).find(function(e){return e.classList.contains("e-richtexteditor")});(h=p?p:h)&&(p=h.id.replace(i.element.id,""),d=d.querySelector("#"+i.element.id+p).ej2_instances[0],"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType&&p===this.parent.taskFields.id&&(s=d.value.toString(),d.value=s),s=i.columnByField[p],(p===this.parent.taskFields.duration||this.parent.taskFields.baselineDuration?parseInt(this.rowData[p],10)!==parseInt(d.value,10):this.rowData[p]!==d.value)&&(this.disableUndo=!0),ne.isNullOrUndefined(s)||ne.isNullOrUndefined(s.edit)||ne.isNullOrUndefined(s.edit.read)||!ne.isNullOrUndefined(s.edit.params)?ne.isNullOrUndefined(s)||"booleanedit"!==s.editType?(p===this.parent.taskFields.duration||p===this.parent.taskFields.baselineDuration?(o=parseFloat(String(d.value)),n[p]=o):(0<this.parent.weekWorkingTime.length&&d.value&&(p===this.parent.taskFields.startDate||p===this.parent.taskFields.baselineStartDate)&&(o=p===this.parent.taskFields.startDate?this.beforeOpenArgs.rowData.ganttProperties.startDate:this.beforeOpenArgs.rowData.ganttProperties.baselineStartDate,this.parent.getStartTime(o)/3600===o.getHours())&&(l=this.parent.getStartTime(d.value),this.parent.dataOperation.setTime(l,d.value)),n[p]=d.value),this.parent.enableHtmlSanitizer&&"string"==typeof d.value&&"string"===this.parent.columnByField[p].type&&(d.value=ne.SanitizeHtmlHelper.sanitize(d.value),n[p]=d.value)):h instanceof HTMLInputElement&&!0===h.checked?n[p]=!0:n[p]=!1:"string"==typeof(l=s.edit.read)?(l=T.getObject(l,window),n[p]=l(h,d.value)):n[p]=s.edit.read(h,d.value))}this.isEdit&&(t||this.updateScheduleProperties(this.editedRecord,this.rowData),i.editModule.validateUpdateValues(n,this.rowData,!0))},w.prototype.executeReadFunction=function(e,t,i){e=e.edit.read;return(e="string"==typeof e?T.getObject(e,window):e)(t,i.value)},w.prototype.updateAdvancedTab=function(e){for(var t=this.parent,i=e.childNodes,a=this.isEdit?this.rowData:this.addedRecord,n=0;n<i.length;n++){var r,s=i[n],o=s.querySelector('input[id^="'+t.element.id+'"]'),l=Array.from(s.children).find(function(e){return e.classList.contains("e-richtexteditor")});(o=l?l:o)&&(l=o.id.replace(t.element.id,""),s=s.querySelector("#"+t.element.id+l).ej2_instances[0],r=t.columnByField[l],this.rowData[l]!==s.value&&(this.disableUndo=!0),r&&r.edit&&!r.edit.params?a[l]=this.executeReadFunction(r,o,s):a[l]=o.ej2_instances[0].value)}this.isEdit&&t.editModule.validateUpdateValues(a,this.rowData,!0)},w.prototype.updateScheduleProperties=function(e,t){this.parent.setRecordValue("startDate",e.ganttProperties.startDate,t.ganttProperties,!0),this.parent.setRecordValue("endDate",e.ganttProperties.endDate,t.ganttProperties,!0),this.parent.setRecordValue("duration",e.ganttProperties.duration,t.ganttProperties,!0),this.parent.setRecordValue("baselineDuration",e.ganttProperties.baselineDuration,t.ganttProperties,!0),this.parent.setRecordValue("baselineStartDate",e.ganttProperties.baselineStartDate,t.ganttProperties,!0),this.parent.setRecordValue("baselineEndDate",e.ganttProperties.baselineEndDate,t.ganttProperties,!0),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,t.ganttProperties,!0),this.parent.setRecordValue("work",e.ganttProperties.work,t.ganttProperties,!0),this.parent.setRecordValue("type",e.ganttProperties.taskType,t.ganttProperties,!0),this.parent.setRecordValue("taskType",e.ganttProperties.taskType,t.ganttProperties,!0),this.parent.setRecordValue("resourceNames",e.ganttProperties.resourceNames,t.ganttProperties,!0),this.parent.setRecordValue("resourceInfo",e.ganttProperties.resourceInfo,t.ganttProperties,!0),ne.isNullOrUndefined(this.parent.taskFields.startDate)||this.parent.dataOperation.updateMappingData(t,"startDate"),ne.isNullOrUndefined(this.parent.taskFields.endDate)||this.parent.dataOperation.updateMappingData(t,"endDate"),ne.isNullOrUndefined(this.parent.taskFields.duration)||(this.parent.dataOperation.updateMappingData(t,"duration"),this.parent.setRecordValue("durationUnit",e.ganttProperties.durationUnit,this.rowData,!0),e=0===this.rowData.ganttProperties.duration,this.parent.setRecordValue("isMilestone",e,t.ganttProperties,!0),ne.isNullOrUndefined(this.parent.taskFields.milestone))||(t[this.parent.taskFields.milestone]=!0),ne.isNullOrUndefined(this.parent.taskFields.baselineDuration)||this.parent.dataOperation.updateMappingData(t,"baselineDuration"),ne.isNullOrUndefined(this.parent.taskFields.work)||this.parent.dataOperation.updateMappingData(this.rowData,"work"),ne.isNullOrUndefined(this.parent.taskFields.manual)||this.parent.dataOperation.updateMappingData(this.rowData,"manual"),ne.isNullOrUndefined(this.parent.taskFields.type)||this.parent.dataOperation.updateMappingData(this.rowData,"type"),ne.isNullOrUndefined(this.parent.taskFields.resourceInfo)||this.parent.dataOperation.updateMappingData(this.rowData,"resourceInfo")},w.prototype.getMatchingPrefix=function(e,t){for(var i=e.name.split("-"),a="",n=0;n<i.length;n++)if(a=""===a?i[n]:a+"-"+i[n],-1!==t.indexOf(a))return[a];return[]},w.prototype.shouldUpdatePreData=function(e,t){return ne.isNullOrUndefined(e.id)||e.id!==t[0]&&!ne.isNullOrUndefined(t[0])},w.prototype.shouldDisableUndo=function(e,t,i){return""!==e||!ne.isNullOrUndefined(t.ganttProperties.predecessorsName)&&t.ganttProperties.predecessorsName!==e&&!i},w.prototype.collectCycleIds=function(e,t){for(var i=0,a=e;i<a.length;i++)for(var n=0,r=a[i];n<r.length;n++){var s=r[n];t.add(s)}},w.prototype.updatePredecessorTab=function(e){for(var e=e.ej2_instances[0],t=(e.isEdit&&e.endEdit(),this.parent.cyclicValidator.resolve(),new Set),i=0,a=e.dataSource;i<a.length;i++){var n=a[i],n={from:n.id,to:this.editedRecord[this.parent.taskFields.id].toString(),offset:n.offset,type:n.type},n=this.parent.cyclicValidator.wouldCreateCycleWhenAdding(n);this.collectCycleIds(n.cycles,t)}for(var r,s,o=e.dataSource.filter(function(e){return!t.has(e.id)}),e=e.dataSource.filter(function(e){return t.has(e.id)}),l=(0<e.length&&(e=e.map(function(e){return e.id}).join(", "),this.parent.trigger("actionFailure",{error:"Cyclic Dependency detected. The following Task IDs were removed due to invalid dependencies: "+e+". Please provide valid dependency."})),[]),e=[],d="",h=[],p=[],u=0;u<o.length;u++){var c=o[u],g=this.getMatchingPrefix(c,this.parent.ids);this.shouldUpdatePreData(c,g)&&(c.id=g[0]),-1===h.indexOf(c.id)&&("ProjectView"===this.parent.viewType&&(g=this.parent.flatData[this.parent.ids.indexOf(c.id)]).hasChildRecords&&-1===p.indexOf(g)&&p.push(g),g=c.id+c.type,c.offset&&-1!==c.offset.indexOf("-")?g+=c.offset:g+="+"+c.offset,l.push(g),h.push(c.id))}this.isEdit?(d=0<l.length?(r=this.parent.treeGridModule.maxLimits(this.parent.durationUnit),s=this.parent.taskFields.dependency,s=this.parent.treeGridModule.updatePredecessorLimits(l,this.rowData[s],r),e=this.parent.predecessorModule.calculatePredecessor(s,this.rowData),this.parent.setRecordValue("predecessor",e,this.rowData.ganttProperties,!0),this.parent.predecessorModule.getPredecessorStringValue(this.rowData)):(this.parent.setRecordValue("predecessor",e=[],this.rowData.ganttProperties,!0),null),this.parent.undoRedoModule&&0<this.parent.undoRedoModule.getUndoCollection.length&&(this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1].connectedRecords=p,this.shouldDisableUndo(d,this.rowData,this.disableUndo))&&(this.disableUndo=!0),this.parent.setRecordValue("predecessorsName",d,this.rowData.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,d,this.rowData),this.parent.setRecordValue(this.parent.taskFields.dependency,d,this.rowData),this.parent.predecessorModule.updateUnscheduledDependency(this.rowData)):this.addedRecord[this.parent.taskFields.dependency]=0<l.length?l.join(","):""},w.prototype.updateResourceTab=function(e){var t=this,e=e.ej2_instances[0],i=(e&&e.grid.endEdit(),this.ganttResources),a=(i.forEach(function(e){null===e[t.parent.resourceFields.unit]&&(e[t.parent.resourceFields.unit]=0)}),"ResourceView"!==this.parent.viewType||ne.isNullOrUndefined(this.rowData.ganttProperties)||(JSON.stringify(this.ganttResources)!==JSON.stringify(this.rowData.ganttProperties.resourceInfo)?(this.isResourceUpdate=!0,this.previousResource=ne.isNullOrUndefined(this.rowData.ganttProperties.resourceInfo)?[]:Object.assign([],this.rowData.ganttProperties.resourceInfo)):this.isResourceUpdate=!1),[]);if(this.isEdit){if((this.rowData.ganttProperties.resourceInfo&&i.length!==this.rowData.ganttProperties.resourceInfo.length||ne.isNullOrUndefined(this.rowData.ganttProperties.resourceInfo)&&0<i.length)&&(this.disableUndo=!0),!this.disableUndo)for(var n=0;n<i.length;n++)if(JSON.stringify(i[n])!==JSON.stringify(this.rowData.ganttProperties.resourceInfo[n])){this.disableUndo=!0;break}this.parent.setRecordValue("resourceInfo",i,this.editedRecord.ganttProperties,!0),this.parent.dataOperation.updateMappingData(this.editedRecord,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(this.editedRecord,"resource"),this.validateDuration(this.editedRecord),this.updateScheduleProperties(this.editedRecord,this.rowData)}else{for(n=0;n<i.length;n++)a.push(i[n][this.parent.resourceFields.id]),this.isAddNewResource=!0;this.addedRecord[this.parent.taskFields.resourceInfo]=a}},w.prototype.updateNotesTab=function(e){var t=this.parent,e=e.ej2_instances[0];this.isEdit?(t.columnByField[t.taskFields.notes].disableHtmlEncode?(this.rowData.ganttProperties.notes===e.getText()||null===this.rowData.ganttProperties.notes&&""===e.getText()||this.disableUndo||(this.disableUndo=!0),e.getHtml().includes("href")?this.parent.setRecordValue("notes",e.getHtml(),this.rowData.ganttProperties,!0):this.parent.setRecordValue("notes",e.getText(),this.rowData.ganttProperties,!0)):(this.rowData.ganttProperties.notes===e.getHtml()||null===this.rowData.ganttProperties.notes&&"<p><br></p>"===e.getHtml()||this.disableUndo||(this.disableUndo=!0),this.parent.setRecordValue("notes",e.getHtml(),this.rowData.ganttProperties,!0)),t.dataOperation.updateMappingData(this.rowData,"notes")):t.columnByField[t.taskFields.notes].disableHtmlEncode?this.addedRecord[this.parent.taskFields.notes]=e.getText():this.addedRecord[this.parent.taskFields.notes]=e.getHtml()},w.prototype.updateCustomTab=function(e){this.updateGeneralTab(e,!0)},w.prototype.updateTextBoxValue=function(e,t,i,a){e.startDate===t?i.value=a.startDate.toString():e.endDate===t?i.value=a.endDate.toString():e.baselineStartDate===t?i.value=a.baselineStartDate.toString():e.baselineEndDate===t&&(i.value=a.baselineEndDate.toString()),i.dataBind()};var Ga=w;function w(e){this.isFromDialogPredecessor=!1,this.isTriggered=!1,this.taskFieldColumn=[],this.customFieldColumn=[],this.processedId=[],this.updatedEditFields=null,this.updatedAddFields=null,this.addedRecord=null,this.dialogEditValidationFlag=!1,this.ganttResources=[],this.isValidData=!0,this.isResourceTabUpdated=!1,this.previousResource=[],this.isResourceUpdate=!1,this.parent=e,this.localeObj=this.parent.localeObj,this.beforeOpenArgs={cancel:!1},this.types=this.getPredecessorType(),this.rowData={},this.editedRecord={},this.inputs={booleanedit:A.CheckBox,dropdownedit:F.DropDownList,datepickeredit:W.DatePicker,datetimepickeredit:W.DateTimePicker,maskededit:B.MaskedTextBox,numericedit:B.NumericTextBox,stringedit:B.TextBox,defaultedit:B.TextBox},this.processDialogFields(),this.wireEvents()}v.prototype.updateConnectorLineEditElement=function(e){e=this.getConnectorLineHoverElement(e.target);ne.getValue("editModule.taskbarEditModule.taskBarEditAction",this.parent)||this.highlightConnectorLineElements(e)},v.prototype.getConnectorLineHoverElement=function(e){var t=S(e,st),i=S(e,dt),a=S(e,ot),n=S(e,lt);return t||i||a||n?S(e,rt):null},v.prototype.highlightConnectorLineElements=function(e){e?e!==this.connectorLineElement&&(this.removeHighlight(),this.addHighlight(e)):this.removeHighlight()},v.prototype.addHighlight=function(e){e=(this.connectorLineElement=e).querySelector("."+st);e&&e.setAttribute("stroke-width",(this.parent.connectorLineModule.lineStroke+1).toString())},v.prototype.removeHighlight=function(){var e;this.connectorLineElement&&((e=this.connectorLineElement.querySelector("."+st))&&e.setAttribute("stroke-width",this.parent.connectorLineModule.lineStroke.toString()),this.connectorLineElement=null)},v.prototype.getEditedConnectorLineString=function(e){for(var t,i=new Set,a=document.createDocumentFragment(),n=0;n<e.length;n++)if(t=e[n].ganttProperties.predecessor)for(var r=0;r<t.length;r++){var s,o=t[r],l="parent"+o.from+"child"+o.to;this.parent.connectorLineModule.removeConnectorLineById(l),l=this.parent.connectorLineModule.getRecordByID(o.from),s=this.parent.connectorLineModule.getRecordByID(o.to),(!this.parent.allowParentDependency&&(l&&l.expanded||s&&s.expanded)||this.parent.allowParentDependency&&(l||s))&&(l=this.parent.predecessorModule.updateConnectorLineObject(l,s,o),ne.isNullOrUndefined(l)||i.has(l.connectorLineId)||(s=this.parent.connectorLineModule.getConnectorLineTemplate(l),i.add(l.connectorLineId),a.appendChild(s)))}return a},v.prototype.refreshEditedRecordConnectorLine=function(e){this.parent.connectorLineModule.removePreviousConnectorLines(this.parent.previousRecords),this.parent.connectorLineModule.expandedRecords=this.parent.virtualScrollModule&&this.parent.enableVirtualization?this.parent.updatedRecords:this.parent.expandedRecords;e=this.getEditedConnectorLineString(e);e&&this.parent.connectorLineModule.svgObject.appendChild(e)},v.prototype.idFromPredecessor=function(e){for(var t=e.split(","),i=[],a=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,n=/\s*([A-Z]{1,2})([+-]\d*\.?\d+\s*(?:days|day|hours|hour|minutes|minute|[DHM])?)?$/i,r=/([+-]\d*\.?\d+\s*(?:days|day|hours|hour|minutes|minute|[DHM])?)$/i,s=this.parent.ids,o=0;o<t.length;o++){var l,d,h=t[o].trim(),p=h;a.test(h.substring(0,36))?p=h.substring(0,36):-1!==s.indexOf(h)?p=h:(p=(p=(d=h.match(n))&&(l=h.substring(0,h.length-d[0].length),-1!==s.indexOf(l))?l:p)===h&&(d=h.match(r))&&(l=h.substring(0,h.length-d[0].length),-1!==s.indexOf(l))?l:p)===h&&(d=h.includes("+")?"+":"-",(h=h.split(d))[0])&&-1!==s.indexOf(h[0])&&(p=h[0]),i.push(p)}return i},v.prototype.predecessorValidation=function(e,t){for(var i,a=t.rowUniqueID,n=0;n<e.length;n++)for(var r=e[n],s=[],o=(e.slice(0).splice(n,1),this);null!==r;){var l=function(){var t=[];return-1===s.indexOf(r)?ne.isNullOrUndefined(o.parent.connectorLineModule.getRecordByID(r))||(i=o.parent.connectorLineModule.getRecordByID(r).ganttProperties,!ne.isNullOrUndefined(i.predecessor)&&0<i.predecessor.length&&i.predecessor.forEach(function(e){i.rowUniqueID.toString()!==e.from&&t.push(e.from.toString())}),a.toString()===i.rowUniqueID.toString())||-1!==t.indexOf(a.toString())?{value:!1}:(s.push(r),!ne.isNullOrUndefined(i.predecessor)&&0<i.predecessor.length?void(r=i.predecessor[0].from):"break"):"break"}();if("object"==typeof l)return l.value;if("break"===l)break}return!0},v.prototype.validatePredecessorRelation=function(s,e){var o,l=!0,d="ResourceView"===this.parent.viewType?s.ganttProperties.taskId:s.ganttProperties.rowUniqueID;if(!ne.isNullOrUndefined(e)&&0<e.length)for(var h=this.idFromPredecessor(e),t=function(e){if(p.parent.allowParentDependency)parseInt(h[h.length-1],10)!==s[p.parent.taskFields.id]&&(t=p.parent.ids.indexOf(h[h.length-1]),t=p.parent.currentViewData[t])&&s&&(l=p.parent.predecessorModule.validateParentPredecessor(t,s));else if(!p.checkParentRelation(s,h))return{value:!1};var t=h.slice(0),i=[],a=!0;if(t.forEach(function(e){-1===i.indexOf(e)?i.push(e):a=!1}),!a)return{value:!1};o=h[e];var r=[];for(h.slice(0).splice(e,1);null!==o;){var n=function(){var i,e,a,n=[];return-1===r.indexOf(o)?ne.isNullOrUndefined(p.parent.connectorLineModule.getRecordByID(o.toString()))||(a=p.parent.connectorLineModule.getRecordByID(o.toString()).ganttProperties,!ne.isNullOrUndefined(a.predecessor)&&0<a.predecessor.length&&a.predecessor.forEach(function(e,t){a.rowUniqueID.toString()!==e.from&&(n.push(e.from.toString()),i=t)}),d.toString()===a.rowUniqueID.toString())||-1!==n.indexOf(d.toString())?{value:!1}:(r.push(o),!ne.isNullOrUndefined(a.predecessor)&&0<a.predecessor.length?(e=void 0,1<n.length?e=p.predecessorValidation(n,s.ganttProperties):1===n.length&&(o=a.predecessor[i].from),!1===e?{value:!1}:void 0):"break"):"break"}();if("object"==typeof n)return n;if("break"===n)break}},p=this,i=0;i<h.length;i++){var a=t(i);if("object"==typeof a)return a.value}return l},v.prototype.addPredecessor=function(e,t){t=ne.isNullOrUndefined(e.ganttProperties.predecessorsName)||""===e.ganttProperties.predecessorsName?t:e.ganttProperties.predecessorsName+","+t;this.updatePredecessorHelper(e,t)},v.prototype.removePredecessor=function(e){this.isPublicDependencyDelete=!0,this.updatePredecessorHelper(e,null)},v.prototype.updatePredecessor=function(e,t,i){return this.updatePredecessorHelper(e,t,i)},v.prototype.updatePredecessorHelper=function(e,t,i){var a;return ne.isUndefined(t)||this.validatePredecessorRelation(e,t)?(this.parent.isOnEdit=!0,a=[],ne.isNullOrUndefined(t)||""===t||(a=this.parent.predecessorModule.calculatePredecessor(t,e)),this.parent.setRecordValue("predecessor",a,e.ganttProperties,!0),a=this.parent.predecessorModule.getPredecessorStringValue(e),this.parent.setRecordValue("predecessorsName",a,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,e),this.parent.setRecordValue(this.parent.taskFields.dependency,a,e),(a={}).action=i&&i.action&&"CellEditing"===i.action?i.action:this.parent.contextMenuModule&&this.parent.contextMenuModule.isContextMenuDependencyDelete||this.isPublicDependencyDelete?"DeleteConnectorLine":"DrawConnectorLine",a.data=e,this.parent.editModule.initiateUpdateAction(a),!0):(e.taskData[this.parent.taskFields.dependency]&&(e.taskData[this.parent.taskFields.dependency]=null),i=t+" is an invalid relation for task "+this.parent.taskFields.id+". Kindly ensure the "+this.parent.taskFields.dependency+" field contains only valid predecessor relations.",this.parent.trigger("actionFailure",{error:i}),!1)},v.prototype.checkParentRelation=function(e,i){if(e&&e.parentItem&&-1!==i.indexOf(e.parentItem.taskId.toString()))return!1;for(var a=this,t=0;t<i.length;t++){var n=function(t){var e=a.parent.currentViewData.filter(function(e){return e&&e.ganttProperties.rowUniqueID.toString()===i[t].toString()});if(e[0]&&e[0].hasChildRecords)return{value:!1}}(t);if("object"==typeof n)return n.value}return!0},v.prototype.initPredecessorValidationDialog=function(){var e;this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation&&(e=ne.createElement("div",{id:this.parent.element.id+"_dialogValidationRule"}),this.parent.element.appendChild(e),this.renderValidationDialog())},v.prototype.renderValidationDialog=function(){var e=this.parent.taskFields,e=e.constraintType&&e.constraintDate?this.parent.localeObj.getConstant("schedulingConflicts"):this.parent.localeObj.getConstant("validateEditing"),t=this.parent.element.id+"_dialogValidationRule",i=document.getElementById(t),i=(i?(i.innerHTML="",i.style.zIndex="2000"):((i=document.createElement("div")).id=t,i.style.zIndex="2000",document.body.appendChild(i)),new E.Dialog({header:e,isModal:!0,enableRtl:this.parent.enableRtl,visible:!1,width:"50%",showCloseIcon:!0,zIndex:2e3,close:this.validationDialogClose.bind(this),content:"",buttons:[{click:this.validationDialogOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.validationDialogCancelButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:document.body,animationSettings:{effect:"None"}}));i.isStringTemplate=!0,i.appendTo("#"+t),this.parent.validationDialogElement=i},v.prototype.validationDialogOkButton=function(){var e=this.parent.currentEditedArgs,t=document.getElementById(this.parent.element.id+"_ValidationAddlineOffset"),i=document.getElementById(this.parent.element.id+"_ValidationRemoveline"),a=document.getElementById(this.parent.element.id+"_ValidationCancel"),n=document.getElementById(this.parent.element.id+"_RemoveConstraint"),r=document.getElementById(this.parent.element.id+"_RemoveDependency"),s=document.getElementById(this.parent.element.id+"_CancelChange"),o=this.parent.editModule.violationArgs,l=o.matchedModifiedTask,d=o.args,o=o.matchedParedRecord||null;if(null!==n&&n.checked)l.ganttProperties.constraintType=4,this.parent.constraintViolationType="",this.parent.editModule.initiateSaveAction(d);else if(null!==r&&r.checked){var h=[],p=(o||d.data).ganttProperties.taskId;if(l&&Array.isArray(l.ganttProperties.predecessor))for(var u=0,c=l.ganttProperties.predecessor;u<c.length;u++){var g=c[u];if(g.from.toString()===p.toString()){h=[g];break}}this.parent.editModule.reUpdatePreviousRecords(void 0,void 0,l.uniqueID),l.parentItem&&l.parentItem.taskId&&(o=this.parent.getRecordByID(l.parentItem.taskId),this.parent.dataOperation.updateParentItems(o,!0)),this.removePredecessors(l,h),this.parent.editModule.initiateSaveAction(d)}else null!==s&&s.checked&&(e.validateMode.respectLink=!0,this.applyPredecessorOption());null!==n&&n.checked||null!==r&&r.checked||null!==s&&s.checked||(e.validateMode.preserveLinkWithEditing=null!==t&&t.checked,e.validateMode.removeLink=null!==i&&i.checked,e.validateMode.respectLink=null!==a&&a.checked,this.applyPredecessorOption()),this.parent.hideSpinner(),this.parent.validationDialogElement.hide()},v.prototype.validationDialogCancelButton=function(){this.parent.constraintViolationType="",this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption(),this.parent.hideSpinner(),this.parent.validationDialogElement.hide()},v.prototype.validationDialogClose=function(e){this.parent.constraintViolationType="",ne.getValue("isInteracted",e)&&(this.parent.currentEditedArgs.validateMode.respectLink=!0,this.applyPredecessorOption(),this.parent.hideSpinner())},v.prototype.applyPredecessorOption=function(){var t,i,e=this.parent.currentEditedArgs,a=e.data;e.validateMode.respectLink?(this.parent.editModule.reUpdatePreviousRecords(),this.parent.chartRowsModule.refreshRecords([e.data])):e.validateMode.removeLink?(this.checkChildRecords(a),this.parent.editModule.updateEditedTask(e.editEventArgs)):e.validateMode.preserveLinkWithEditing&&(this.parent.updateOffsetOnTaskbarEdit&&(i=a.ganttProperties.taskId.toString(),a.ganttProperties.predecessor)&&a.ganttProperties.predecessor.forEach(function(e){i===e.from&&(t=e.to)}),this.parent.editModule.updateEditedTask(e.editEventArgs),this.processPredecessor(t,[]))},v.prototype.compareArrays=function(e,t){return e.length===t.length&&JSON.stringify(e)===JSON.stringify(t)},v.prototype.processPredecessor=function(e,t){var i,a,n=this;e&&(i=this.parent.getRecordByID(e))&&i.ganttProperties&&i.ganttProperties.predecessor&&(this.parent.predecessorModule.validatedOffsetIds=[],this.parent.predecessorModule.calculateOffset(i),a=!0,(e=this.validatedId.find(function(e){return e.id===i.ganttProperties.taskId}))&&(e=e.value,this.compareArrays(e,i.ganttProperties.predecessor))&&(a=!1),i.ganttProperties.predecessor.forEach(function(e){i.ganttProperties.taskId===e.from&&a&&t&&-1===t.indexOf(e.to)&&(n.processPredecessor(e.to,t),t.push(e.to))}))},v.prototype.checkChildRecords=function(e){var t,i=[],a=e.ganttProperties.taskId,n=e.ganttProperties.predecessor;if(ne.isNullOrUndefined(n))this.validationPredecessor=n;else{for(var r=0;r<n.length;r++){var s=n[r];s.to.toString()===a.toString()&&i.push(s)}this.validationPredecessor=i}if(ne.isNullOrUndefined(this.validationPredecessor)||this.removePredecessors(e,this.validationPredecessor),0<e.childRecords.length)for(r=0;r<e.childRecords.length;r++){var o=e.childRecords[r];this.validationPredecessor=o.ganttProperties.predecessor,ne.isNullOrUndefined(this.validationPredecessor)||this.removePredecessors(o,this.validationPredecessor),0<o.childRecords.length&&this.checkChildRecords(o)}else ne.isNullOrUndefined(e.parentItem)||(t=this.parent.getRecordByID(e.parentItem.taskId),this.validationPredecessor=t.ganttProperties.predecessor,this.removePredecessors(t,this.validationPredecessor))},v.prototype.removePredecessors=function(e,t){var i=ne.extend([],[],e.ganttProperties.predecessor,!0);if(!ne.isNullOrUndefined(t)){for(var a,n=t.length,r=0;r<n;r++){var s=this.parent.connectorLineModule.getRecordByID(t[r].from),o=ne.extend([],[],s.ganttProperties.predecessor,!0),l=K(t[r],"from",i,"to"),l=(i.splice(l,1),K(t[parseInt(r.toString(),10)],"from",o,"to"));o.splice(l,1),this.parent.setRecordValue("predecessor",o,s.ganttProperties,!0)}i.length!==e.ganttProperties.predecessor.length&&(this.parent.setRecordValue("predecessor",i,e.ganttProperties,!0),a=this.parent.predecessorModule.getPredecessorStringValue(e),this.parent.setRecordValue("predecessorsName",a,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,a,e),this.parent.setRecordValue(this.parent.taskFields.dependency,a,e))}},v.prototype.formatViolationType=function(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2")},v.prototype.updateZIndex=function(e){var t;e&&e.editModule&&e.editModule.dialogModule&&e.editModule.dialogModule.dialog&&e.editModule.dialogModule.dialog.style&&""!==e.editModule.dialogModule.dialog.style.zIndex&&(t=parseInt(e.editModule.dialogModule.dialog.style.zIndex,10),e=e.validationDialogElement&&e.validationDialogElement.element,!isNaN(t))&&e&&(t=(t+1).toString(),e.style.zIndex=t,e.parentElement)&&(e.parentElement.style.zIndex=t)},v.prototype.openValidationDialog=function(e){var t=this.parent,e=this.validationDialogTemplate(e),e=(t.validationDialogElement.setProperties({content:e}),t.element.id+"_dialogValidationRule_dialog-content"),e=(t.validationDialogElement.element.querySelector("#"+e).style.paddingTop="10px",t.element.id+"_dialogValidationRule_dialog-header");t.validationDialogElement.element.querySelector("#"+e).style.padding="8px 16px",this.updateZIndex(t),t.validationDialogElement.show()},v.prototype.validationDialogTemplate=function(e){var t=this.parent.element.id,i=ne.createElement("div",{className:"e-ValidationContent"}),a=ne.getValue("task",e),n=ne.getValue("parentTask",e),e=ne.getValue("violationType",e),r=a.ganttProperties.taskName,s=ne.isNullOrUndefined(this.parent.dateFormat)?"M/d/yyyy h:mm a":this.parent.dateFormat,a=this.parent.getFormatedDate(a.ganttProperties.startDate,s),s=[r,n.ganttProperties.taskName],n="",s=("MustStartOn"!==e&&"MustFinishOn"!==e&&"StartNoLaterThan"!==e&&"FinishNoLaterThan"!==e&&("taskBeforePredecessor_FS"===e?n=this.parent.localeObj.getConstant("taskBeforePredecessor_FS"):"taskAfterPredecessor_FS"===e?n=this.parent.localeObj.getConstant("taskAfterPredecessor_FS"):"taskBeforePredecessor_SS"===e?n=this.parent.localeObj.getConstant("taskBeforePredecessor_SS"):"taskAfterPredecessor_SS"===e?n=this.parent.localeObj.getConstant("taskAfterPredecessor_SS"):"taskBeforePredecessor_FF"===e?n=this.parent.localeObj.getConstant("taskBeforePredecessor_FF"):"taskAfterPredecessor_FF"===e?n=this.parent.localeObj.getConstant("taskAfterPredecessor_FF"):"taskBeforePredecessor_SF"===e?n=this.parent.localeObj.getConstant("taskBeforePredecessor_SF"):"taskAfterPredecessor_SF"===e&&(n=this.parent.localeObj.getConstant("taskAfterPredecessor_SF")),n=Y(n,s)),'<div id="'+t+'_ValidationText">'+n+"</div>"),n=this.parent.localeObj.getConstant("cancelLink"),o=Y(this.parent.localeObj.getConstant("removeLink"),[r,a]),e=Y(this.parent.localeObj.getConstant("removeConstraint"),[this.formatViolationType(e),r]),r=Y(this.parent.localeObj.getConstant("preserveLink"),[r,a]),a=(i.innerHTML=s+('\n <table>\n <tr><td><input type="radio" id="'+t+'_ValidationCancel" name="ValidationRule" checked/></td></tr>\n <tr><td><input type="radio" id="'+t+'_ValidationRemoveline" name="ValidationRule"/></td></tr>\n <tr><td><input type="radio" id="'+t+'_RemoveConstraint" name="ValidationRule"/></td></tr>\n <tr><td><input type="radio" id="'+t+'_ValidationAddlineOffset" name="ValidationRule"/></td></tr>\n </table>'),i.querySelector("#"+t+"_ValidationCancel")),s=i.querySelector("#"+t+"_ValidationRemoveline"),l=i.querySelector("#"+t+"_RemoveConstraint"),t=i.querySelector("#"+t+"_ValidationAddlineOffset");return a&&new A.RadioButton({label:n,name:"ValidationRule",value:"cancel",checked:!0,cssClass:Ct}).appendTo(a),s&&new A.RadioButton({label:o,name:"ValidationRule",value:"removeLink",cssClass:Ct}).appendTo(s),l&&new A.RadioButton({label:e,name:"ValidationRule",value:"removeConstraint",cssClass:Ct}).appendTo(l),t&&new A.RadioButton({label:r,name:"ValidationRule",value:"preserveLink",cssClass:Ct}).appendTo(t),i.querySelectorAll(".e-radio-wrapper").forEach(function(e){e.style.padding="6px",e.querySelector("span").style.fontWeight="normal"}),i},v.prototype.openConstraintValidationDialog=function(e){var t=this.parent,e=this.constraintValidationDialogTemplate(e),i=t.localeObj.getConstant("schedulingConflicts"),e=(t.validationDialogElement.setProperties({content:e,header:i}),t.element.id+"_dialogValidationRule_dialog-content"),i=(t.validationDialogElement.element.querySelector("#"+e).style.paddingTop="10px",t.element.id+"_dialogValidationRule_dialog-header");t.validationDialogElement.element.querySelector("#"+i).style.padding="8px 16px",this.updateZIndex(t),t.validationDialogElement.show()},v.prototype.constraintValidationDialogTemplate=function(e){var t=this.parent.element.id,i=e.parentRecord,a=e.record,n=e.predecessorLink,e=e.violationType,r=ne.createElement("div",{className:"e-ValidationContent"}),a=a.ganttProperties.taskName,s="",i=(i&&i.ganttProperties&&i.ganttProperties.taskName&&(s=i.ganttProperties.taskName),this.parent.localeObj.getConstant("removeConstraint")),o=this.parent.localeObj.getConstant("removeDependency"),l=this.parent.localeObj.getConstant("cancelChange"),i=Y(i,[this.formatViolationType(e),a]),e=Y(o,[s,a]),o="<table>",s=(o+='\n <tr>\n <td>\n <input type="radio" id="'+t+'_RemoveConstraint" name="ValidationRule" />\n </td>\n </tr>',void 0!==n&&(o+='\n <tr>\n <td>\n <input type="radio" id="'+t+'_RemoveDependency" name="ValidationRule"/>\n </td>\n </tr>'),r.innerHTML=o=o+('\n <tr>\n <td>\n <input type="radio" id="'+t+'_CancelChange" name="ValidationRule"/>\n </td>\n </tr>')+"</table>",r.querySelector("#"+t+"_RemoveConstraint")),o=(s&&new A.RadioButton({label:i,name:"ValidationRule",value:"removeConstraint",checked:!0,cssClass:Ct}).appendTo(s),void 0!==n&&(a=r.querySelector("#"+t+"_RemoveDependency"))&&new A.RadioButton({label:e,name:"ValidationRule",value:"removeDependency",cssClass:Ct}).appendTo(a),r.querySelector("#"+t+"_CancelChange"));return o&&new A.RadioButton({label:l,name:"ValidationRule",value:"cancelChange",cssClass:Ct}).appendTo(o),r.querySelectorAll(".e-radio-wrapper").forEach(function(e){e.style.padding="6px",e.querySelector("span").style.fontWeight="normal"}),r},v.prototype.validateTypes=function(e,t){for(var i,a=this.parent.predecessorModule.getValidPredecessor(e),n=(this.validationPredecessor=[],e&&e.ganttProperties&&e.ganttProperties.calendarContext?e.ganttProperties.calendarContext:this.parent.defaultCalendarContext),r=this.parent.predecessorModule.getPredecessorDate(e,a,null),s=(t||e).ganttProperties,o=this.parent.allowUnscheduledTasks&&ne.isNullOrUndefined(r)?s.endDate:this.dateValidateModule.getEndDate(r,s.duration,s.durationUnit,s,!1),l=0;l<a.length;l++){var d,h,p,u=this.parent.connectorLineModule.getRecordByID(a[l].from),c=null;"FS"===a[l].type?(0!==(p=this.parent.dateValidationModule.getDuration(r,s.startDate,this.parent.durationUnit,s.isAutoSchedule,s.isMilestone,!0,n))||0===p&&!1===this.parent.updateOffsetOnTaskbarEdit)&&(s.startDate<r?(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskBeforePredecessor_FS"):s.startDate>r&&(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskAfterPredecessor_FS")):"SS"===a[l].type?(d=new Date(s.endDate),h=new Date(r),s.startDate<r?(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskBeforePredecessor_SS"):s.startDate>r?(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskAfterPredecessor_SS"):this.parent.allowUnscheduledTasks&&ne.isNullOrUndefined(s.startDate)&&ne.isNullOrUndefined(s.duration)&&d.setHours(0,0,0,0)<h.setHours(0,0,0,0)?(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskBeforePredecessor_SS"):this.parent.allowUnscheduledTasks&&ne.isNullOrUndefined(s.startDate)&&ne.isNullOrUndefined(s.duration)&&d.setHours(0,0,0,0)>h.setHours(0,0,0,0)&&(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskAfterPredecessor_SS")):"FF"===a[l].type?(0!==(p=this.parent.dateValidationModule.getDuration(r,u.ganttProperties.endDate,this.parent.durationUnit,u.ganttProperties.isAutoSchedule,u.ganttProperties.isMilestone,!0,n))||0===p&&!1===this.parent.updateOffsetOnTaskbarEdit)&&(o<=u.ganttProperties.endDate?(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskBeforePredecessor_FF"):o>u.ganttProperties.endDate&&(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskAfterPredecessor_FF")):"SF"===a[l].type&&(0!==(p=this.parent.dateValidationModule.getDuration(u.ganttProperties.startDate,o,this.parent.durationUnit,u.ganttProperties.isAutoSchedule,u.ganttProperties.isMilestone,!0,n))||0===p&&!1===this.parent.updateOffsetOnTaskbarEdit)&&(o<u.ganttProperties.startDate?(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskBeforePredecessor_SF"):o>=u.ganttProperties.startDate&&(this.validationPredecessor.push(a[parseInt(l.toString(),10)]),c="taskAfterPredecessor_SF")),!ne.isNullOrUndefined(c)&&ne.isNullOrUndefined(g)&&(i=u,g=c)}if(!g&&this.parent.constraintViolationType){var g=this.parent.constraintViolationType,t=e.ganttProperties.predecessor,f=("ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID).toString(),m=t.filter(function(e){return e.to===f?e:null}),y=-1/0;if(0<m.length)for(l=0;l<m.length;l++){var D,k=m[l].from,k=this.parent.getRecordByID(k);k&&k.ganttProperties.endDate&&e.ganttProperties.startDate&&y<(D=k.ganttProperties.endDate.getTime()-e.ganttProperties.startDate.getTime())&&(y=D,i=k)}}return{parentTask:i,task:e,violationType:g}},v.prototype.addRemovePredecessor=function(n){var e=this.parent.previousRecords[n.uniqueID],a=ne.isNullOrUndefined(n.ganttProperties.predecessor)?n.ganttProperties.predecessor:n.ganttProperties.predecessor.slice();if(e&&e.ganttProperties&&e.ganttProperties.hasOwnProperty("predecessor")){var r=e.ganttProperties.predecessor;if(!ne.isNullOrUndefined(r))for(var s=this,t=0;t<r.length;t++)!function(t){var e,i,a=s.parent.connectorLineModule.getRecordByID(r[parseInt(t.toString(),10)].from);a===n?0!==n.ganttProperties.predecessor.filter(function(e){return r[t].from===e.from&&r[t].to===e.to}).length||n.parentItem&&s.parent.taskFields.dependency&&n.ganttProperties.predecessor&&s.parent.allowParentDependency&&(r[t].from===n.parentItem.taskId||r[t].to===n.parentItem.taskId)||n.ganttProperties.predecessor.push(r[parseInt(t.toString(),10)]):(e=ne.extend([],[],a.ganttProperties.predecessor,!0),-1!==(i=K(r[parseInt(t.toString(),10)],"from",e,"to"))&&(e.splice(i,1),s.parent.setRecordValue("predecessor",e,a.ganttProperties,!0)))}(t);if(!ne.isNullOrUndefined(a))for(var o=this,i=0;i<a.length;i++)!function(t){var e=o.parent.connectorLineModule.getRecordByID(a[parseInt(t.toString(),10)].from),i=ne.extend([],[],e.ganttProperties.predecessor,!0);0===i.filter(function(e){return a[t].from===e.from&&a[t].to===e.to}).length&&(i.push(a[parseInt(t.toString(),10)]),o.parent.setRecordValue("predecessor",i,e.ganttProperties,!0))}(i)}},v.prototype.removePredecessorByIndex=function(e,t){this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent("Edit")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection(),(i={action:"DeleteDependency"}).modifiedRecords=ne.extend([],[e],[],!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=i);var i=e.ganttProperties.predecessor,t=i.splice(t,1),a=this.parent.connectorLineModule.getRecordByID(t[0].from).ganttProperties.predecessor,n=K(t[0],"from",a,"to"),a=(a.splice(n,1),this.parent.predecessorModule.getPredecessorStringValue(e));i.push(t[0]),this.parent.connectorLineEditModule.updatePredecessor(e,a)},v.prototype.renderPredecessorDeleteConfirmDialog=function(){this.confirmPredecessorDialog=new E.Dialog({width:"320px",isModal:!0,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmPredecessorDelete"),buttons:[{click:this.confirmOkDeleteButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.confirmCloseDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});var e=ne.createElement("div",{id:this.parent.element.id+"_deletePredecessorConfirmDialog"});this.parent.element.appendChild(e),this.confirmPredecessorDialog.isStringTemplate=!0,this.confirmPredecessorDialog.appendTo(e)},v.prototype.confirmCloseDialog=function(){this.confirmPredecessorDialog.destroy()},v.prototype.confirmOkDeleteButton=function(){this.removePredecessorByIndex(this.childRecord,this.predecessorIndex),this.confirmPredecessorDialog.destroy()};var za=v;function v(e){this.validationPredecessor=null,this.confirmPredecessorDialog=null,this.predecessorIndex=null,this.childRecord=null,this.validatedId=[],this.isPublicDependencyDelete=!1,this.parent=e,this.dateValidateModule=this.parent.dateValidationModule,this.parent.on("initPredessorDialog",this.initPredecessorValidationDialog,this)}P.prototype.getModuleName=function(){return"edit"},P.prototype.updateDefaultColumnEditors=function(){for(var e,t=[this.parent.taskFields.id,this.parent.taskFields.progress,this.parent.taskFields.resourceInfo,this.parent.taskFields.type,"taskType"],i=0;i<t.length;i++)!ne.isNullOrUndefined(t[i])&&0<t[i].length&&(e=this.parent.getColumnByField(t[parseInt(i.toString(),10)],this.parent.treeGridModule.treeGridColumns))&&(e.field===this.parent.taskFields.id?this.updateIDColumnEditParams(e):e.field===this.parent.taskFields.progress&&ne.isNullOrUndefined(e.edit)?this.updateProgessColumnEditParams(e):e.field===this.parent.taskFields.resourceInfo?this.updateResourceColumnEditor(e):e.field!==this.parent.taskFields.type&&"taskType"!==e.field||this.updateTaskTypeColumnEditor(e))},P.prototype.updateIDColumnEditParams=function(e){var t={min:0,decimals:0,enableRtl:this.parent.enableRtl,validateDecimalOnType:!0,format:"n0",showSpinButton:!1};this.updateEditParams(e,t)},P.prototype.updateProgessColumnEditParams=function(e){var t={min:0,enableRtl:this.parent.enableRtl,decimals:0,validateDecimalOnType:!0,max:100,format:"n0"};this.updateEditParams(e,t)},P.prototype.updateEditParams=function(e,t){ne.isNullOrUndefined(e.edit)?(e.edit={},e.edit.params={}):ne.isNullOrUndefined(e.edit.params)&&(e.edit.params={}),ne.extend(t,e.edit.params),e.edit.params=t,this.parent.getColumnByField(e.field,this.parent.ganttColumns).edit=e.edit},P.prototype.updateResourceColumnEditor=function(e){var t;this.parent.treeGridModule.currentEditRow={},this.parent.editSettings.allowEditing&&ne.isNullOrUndefined(e.edit)&&"Auto"===this.parent.editSettings.mode&&(e.editType="dropdownedit",e.edit=this.getResourceEditor(),(t=this.parent.getColumnByField(e.field,this.parent.ganttColumns)).editType="dropdownedit",t.edit=e.edit)},P.prototype.getResourceEditor=function(){var t,r=this,s=this.parent.resourceFields,e={};return F.MultiSelect.Inject(F.CheckBoxSelection),e.write=function(e){r.parent.treeGridModule.currentEditRow={},(t=new F.MultiSelect({dataSource:new U.DataManager(r.parent.resources),fields:{text:s.name,value:s.id},enableRtl:r.parent.enableRtl,mode:"CheckBox",showDropDownIcon:!0,popupHeight:"350px",delimiterChar:",",value:r.parent.treeGridModule.getResourceIds(e.rowData)})).appendTo(e.element)},e.read=function(e){var t=e.ej2_instances[0].value,i=[];ne.isNullOrUndefined(t)&&(t=[]);for(var a=0;a<t.length;a++)for(var n=0;n<r.parent.resources.length;n++)if(r.parent.resources[n][s.id]===t[a]){i.push(r.parent.resources[n][s.name]);break}return r.parent.treeGridModule.currentEditRow[r.parent.taskFields.resourceInfo]=t,i.join(",")},e.destroy=function(){t&&t.destroy()},e},P.prototype.updateTaskTypeColumnEditor=function(e){var t;this.parent.editSettings.allowEditing&&ne.isNullOrUndefined(e.edit)&&"Auto"===this.parent.editSettings.mode&&(e.editType="dropdownedit",e.edit=this.getTaskTypeEditor(),(t=this.parent.getColumnByField(e.field,this.parent.ganttColumns)).editType="dropdownedit",t.edit=e.edit)},P.prototype.resolveFallback=function(e,t){return e||t},P.prototype.getTaskTypeEditor=function(){var t,i=this,e={},a=[{ID:1,Value:"FixedUnit"},{ID:2,Value:"FixedWork"},{ID:3,Value:"FixedDuration"}];return e.write=function(e){i.parent.treeGridModule.currentEditRow={},(t=new F.DropDownList({dataSource:new U.DataManager(a),enableRtl:i.parent.enableRtl,fields:{value:"Value"},popupHeight:"350px",value:ne.getValue("taskType",e.rowData.ganttProperties)})).appendTo(e.element)},e.read=function(e){var e=e.ej2_instances[0].value,t=i.resolveFallback(i.parent.taskFields.type,"taskType");return i.parent.treeGridModule.currentEditRow[t]=e},e.destroy=function(){t&&t.destroy()},e},P.prototype.reUpdateEditModules=function(){var e,t=this.parent.editSettings;t.allowEditing?(this.parent.editModule.cellEditModule&&"Dialog"===t.mode?(this.cellEditModule.destroy(),this.parent.treeGrid.recordDoubleClick=this.recordDoubleClick.bind(this)):ne.isNullOrUndefined(this.parent.editModule.cellEditModule)&&"Auto"===t.mode&&(this.cellEditModule=new Va(this.parent)),this.parent.editModule.dialogModule&&"Auto"===t.mode?this.parent.treeGrid.recordDoubleClick=void 0:ne.isNullOrUndefined(this.parent.editModule.dialogModule)&&(this.dialogModule=new Ga(this.parent))):(this.cellEditModule&&this.cellEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy()),t.allowDeleting&&t.showDeleteConfirmDialog?ne.isNullOrUndefined(this.confirmDialog)&&(e=ne.createElement("div",{id:this.parent.element.id+"_deleteConfirmDialog"}),this.parent.element.appendChild(e),this.renderDeleteConfirmDialog()):t.allowDeleting&&t.showDeleteConfirmDialog||this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy(),t.allowTaskbarEditing?ne.isNullOrUndefined(this.parent.editModule.taskbarEditModule)&&(this.taskbarEditModule=new Ha(this.parent)):this.taskbarEditModule&&this.taskbarEditModule.destroy()},P.prototype.recordDoubleClick=function(e){var t,i;this.parent.editSettings.allowEditing&&"Dialog"===this.parent.editSettings.mode&&(i=void 0,e.row&&(t=ne.getValue("rowIndex",e.row),i=this.parent.currentViewData[t]),ne.isNullOrUndefined(i)||this.dialogModule.openEditDialog(i)),this.parent.ganttChartModule.recordDoubleClick(e)},P.prototype.destroy=function(){this.cellEditModule&&this.cellEditModule.destroy(),this.taskbarEditModule&&this.taskbarEditModule.destroy(),this.dialogModule&&this.dialogModule.destroy(),this.confirmDialog&&!this.confirmDialog.isDestroyed&&this.confirmDialog.destroy()},P.prototype.updateRecordByID=function(r){var s=this;if(this.parent.enableImmutableMode&&this.parent.editSettings.allowEditing&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&this.parent.treeGrid.endEdit(),!this.parent.readOnly){var e=this.parent.taskFields;if(!ne.isNullOrUndefined(r)&&!ne.isNullOrUndefined(r[e.id])){var o="ResourceView"===this.parent.viewType?this.parent.flatData[this.parent.getTaskIds().indexOf((r.hasChildRecords?"R":"T")+r[e.id])]:this.parent.getRecordByID(r[e.id]);if(ne.isNullOrUndefined(o[e.milestone])||!0===o[e.milestone]&&(o[e.milestone]=!1),this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent("Edit")&&o&&(this.parent.undoRedoModule.createUndoCollection(),(d={}).requestType=this.parent.contextMenuModule&&this.parent.contextMenuModule.item?this.parent.contextMenuModule.item:"methodUpdate",d.modifiedRecords=ne.extend([],[o],[],!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=d),!ne.isNullOrUndefined(this.parent.editModule)&&o){if(this.parent.isOnEdit=!0,this.validateUpdateValues(r,o,!0),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed){if("ProjectView"===this.parent.viewType&&r.ganttProperties.predecessor&&o.ganttProperties.predecessor){for(var l=this,t=0;t<r.ganttProperties.predecessor.length;t++)if("break"===function(t){var e=o.ganttProperties.predecessor.filter(function(e){return e.from===r.ganttProperties.predecessor[t].from&&e.to===r.ganttProperties.predecessor[t].to&&r.ganttProperties.predecessor[t].offset!==e.offset&&(s.parent.flatData[s.parent.ids.indexOf(e.to)].ganttProperties.predecessor.filter(function(e){return e.from===r.ganttProperties.predecessor[t].from&&e.to===r.ganttProperties.predecessor[t].to})[0].offset=r.ganttProperties.predecessor[t].offset),e.from!==r.ganttProperties.predecessor[t].from&&e.from!==r.ganttProperties.predecessor[t].to});if(0<e.length){for(var i=0;i<e.length;i++)for(var a=l.parent.flatData[l.parent.ids.indexOf(e[i].from)],n=0;n<a.ganttProperties.predecessor.length;n++)if(a.ganttProperties.predecessor[n].from===e[i].from&&a.ganttProperties.predecessor[n].to===e[i].to){a.ganttProperties.predecessor.splice(n,1);break}return"break"}}(t))break}else if(!r.ganttProperties.predecessor&&o.ganttProperties.predecessor)for(t=0;t<o.ganttProperties.predecessor.length;t++){var i=void 0,i=o.ganttProperties.taskId.toString()===o.ganttProperties.predecessor[t].from?o.ganttProperties.predecessor[t].to:o.ganttProperties.predecessor[t].from,a=this.parent.flatData[this.parent.ids.indexOf(i)];if(!ne.isNullOrUndefined(a)&&!ne.isNullOrUndefined(a.ganttProperties)&&!ne.isNullOrUndefined(a.ganttProperties.predecessor))for(var n=0;n<a.ganttProperties.predecessor.length;n++)a.ganttProperties.predecessor[n].from===o.ganttProperties.predecessor[t].from&&a.ganttProperties.predecessor[n].to===o.ganttProperties.predecessor[t].to&&a.ganttProperties.predecessor.splice(n,1)}o.ganttProperties.resourceInfo=r.ganttProperties.resourceInfo,o[this.parent.taskFields.resourceInfo]=r[this.parent.taskFields.resourceInfo],o.taskData[this.parent.taskFields.resourceInfo]=r.taskData[this.parent.taskFields.resourceInfo],this.parent.setRecordValue("resourceNames",r.ganttProperties.resourceNames,o.ganttProperties,!0),this.parent.setRecordValue("predecessorsName",r.ganttProperties.predecessorsName,o.ganttProperties,!0),this.parent.taskFields.dependency&&this.parent.setRecordValue(this.parent.taskFields.dependency,r[this.parent.taskFields.dependency],o),this.parent.setRecordValue("predecessor",r.ganttProperties.predecessor,o.ganttProperties,!0)}r[this.parent.taskFields.resourceInfo]&&(0!==o.ganttProperties.duration||"FixedWork"===o.ganttProperties.taskType&&!this.parent.isConvertedMilestone||this.parent.dataOperation.updateWorkWithDuration(o),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||this.updateResourceRelatedFields(o,"resource"),this.parent.dateValidationModule.calculateEndDate(o));var d=Object.keys(r);-1===d.indexOf(e.startDate)&&-1===d.indexOf(e.endDate)&&-1===d.indexOf(e.duration)||this.parent.dataOperation.calculateScheduledValues(o,o.taskData,!1),-1!==d.indexOf(e.baselineDuration)&&this.parent.dataOperation.calculateScheduledValuesforBaseline(o,o.taskData,!1),this.parent.dataOperation.updateWidthLeft(o),ne.isUndefined(r[this.parent.taskFields.dependency])||r[this.parent.taskFields.dependency]===o.ganttProperties.predecessorsName?((d={}).data=o,this.parent.isConvertedMilestone||this.parent.contextMenuModule&&this.parent.contextMenuModule.isOpen&&"ToTask"===this.parent.contextMenuModule.item||(d.action="methodUpdate"),this.parent.editModule.initiateUpdateAction(d)):this.parent.connectorLineEditModule.updatePredecessor(o,r[this.parent.taskFields.dependency])}}}},P.prototype.resolveCondition=function(e,t,i){return e?t:i},P.prototype.validateUpdateValues=function(e,t,i){for(var a=this.parent,n=a.taskFields,r=G(a.columnMapping),s=[],o=!1,l=0,d=Object.keys(e);l<d.length;l++){var h=d[l];if(n.startDate===h||n.endDate===h||n.duration===h||n.baselineDuration===h){var p=n.baselineDuration===h;ne.isNullOrUndefined(e[""+h])&&!a.allowUnscheduledTasks||(c=t.ganttProperties,g=n.duration===h||n.baselineDuration===h,i?(g?(a.dataOperation.updateDurationValue(e[h],c,p),!p&&0<c.duration&&c.isMilestone&&this.parent.setRecordValue("isMilestone",!1,c,!0)):(g="string"==typeof e[h]?new Date(e[h]):e[h],h===n.endDate&&ne.isNullOrUndefined(c.startDate)&&(ne.isNullOrUndefined(e[n.duration])||""===e[n.duration]||Number.isNaN(e[n.duration]))&&(g=this.resolveCondition(this.parent.editModule.dialogModule.isFromEditDialog,t.ganttProperties.endDate,e[n.endDate])),a.setRecordValue(r[h],g,c,!0),!t[n.startDate]||t[n.startDate]instanceof Date||(t[n.startDate]=new Date(t[n.startDate])),!t[n.endDate]||t[n.endDate]instanceof Date||(t[n.endDate]=new Date(t[n.endDate]))),a.dataOperation.updateMappingData(t,r[h])):(s.push(h),o=!0))}else if(n.resourceInfo===h){p=a.dataOperation.setResourceInfo(e);"ResourceView"===this.parent.viewType&&(JSON.stringify(p)!==JSON.stringify(t.ganttProperties.resourceInfo)?(this.parent.editModule.dialogModule.isResourceUpdate=!0,this.parent.editModule.dialogModule.previousResource=ne.isNullOrUndefined(t.ganttProperties.resourceInfo)?[]:Object.assign([],t.ganttProperties.resourceInfo)):this.parent.editModule.dialogModule.isResourceUpdate=!1),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||(t.ganttProperties.resourceInfo=p),a.dataOperation.updateMappingData(t,"resourceInfo")}else if(n.dependency!==h)if(-1!==[n.progress,n.notes,n.durationUnit,n.milestone,n.name,n.baselineStartDate,n.baselineEndDate,n.id,n.segments,n.cssClass,n.constraintDate,n.constraintType].indexOf(h)){var u,c,g,f=a.columnByField[h],m=e[h],y=(ne.isNullOrUndefined(f)||"datepickeredit"!==f.editType&&"datetimepickeredit"!==f.editType||(m=a.dataOperation.getDateFromFormat(m)),r[h]);switch(h){case n.id:y="taskId";break;case n.name:y="taskName";break;case n.constraintDate:y="constraintDate";break;case n.constraintType:y="constraintType";break;case n.cssClass:y="cssClass";break;case n.milestone:var D,k,y="isMilestone";ne.isNullOrUndefined(n.duration)||(D=t.ganttProperties,k=e[n.duration],k=m?0:this.resolveCondition(k<=0,1,k),a.setRecordValue(n.duration,k,t,!0),a.setRecordValue("duration",k,D,!0),a.setRecordValue("taskData."+n.duration,k,t));break;case n.segments:t.ganttProperties.segments&&(y="segments",e)&&!ne.isNullOrUndefined(e[n.segments])&&0<e[n.segments].length&&e.ganttProperties&&e.ganttProperties.segments&&(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&(t.ganttProperties.segments=e.ganttProperties.segments),D=t.ganttProperties.segments.reduce(function(e,t){return e+t.duration},0),k=t.ganttProperties.startDate,u=this.parent.dataOperation.getEndDate(k,D,t.ganttProperties.durationUnit,t.ganttProperties,!1),a.setRecordValue("endDate",a.dataOperation.getDateFromFormat(u),t.ganttProperties,!0))}if(!ne.isNullOrUndefined(y)){var T=[];if("segments"===y&&m&&0<m.length&&!ne.isNullOrUndefined(t.ganttProperties.segments)){for(var b=0;b<m.length;b++){var w={};m[b][n.startDate]&&(w.startDate=m[b][n.startDate]),m[b][n.endDate]&&(w.endDate=m[b][n.endDate]),m[b][n.duration]&&(w.duration=parseFloat(m[b][n.duration])),m[b][n.id]&&(w.id=m[b][n.id]),T.push(w)}a.setRecordValue(y,T,t.ganttProperties,!0)}else("segments"!==y||"segments"===y&&(ne.isNullOrUndefined(m)||Array.isArray(m)&&0===m.length))&&a.setRecordValue(y,m,t.ganttProperties,!0)}(h===n.baselineStartDate||h===n.baselineEndDate)&&t.ganttProperties.baselineStartDate&&t.ganttProperties.baselineEndDate&&(c=t.ganttProperties,a.setRecordValue("baselineStartDate",a.dataOperation.checkBaselineStartDate(c.baselineStartDate,c),c,!0),g=this.parent.getCurrentDayEndTime(c.baselineEndDate),c.baselineEndDate&&0===c.baselineEndDate.getHours()&&86400!==g&&a.dataOperation.setTime(g,c.baselineEndDate),(c.baselineStartDate&&c.baselineEndDate&&c.baselineStartDate.getTime()>c.baselineEndDate.getTime()||!ne.isNullOrUndefined(c.baselineStartDate)&&!ne.isNullOrUndefined(c.startDate)&&c.baselineStartDate.getTime()===c.startDate.getTime()&&!ne.isNullOrUndefined(c.baselineEndDate)&&!ne.isNullOrUndefined(c.endDate)&&c.baselineEndDate.toLocaleDateString()===c.endDate.toLocaleDateString()&&c.isMilestone)&&(c.baselineEndDate=c.baselineStartDate),a.setRecordValue("baselineEndDate",a.dataOperation.checkBaselineEndDate(c.baselineEndDate),c,!0),a.setRecordValue("baselineLeft",a.dataOperation.calculateBaselineLeft(c),c,!0),a.setRecordValue("baselineWidth",a.dataOperation.calculateBaselineWidth(c),c,!0),!t[n.baselineStartDate]||t[n.baselineStartDate]instanceof Date||(t[n.baselineStartDate]=new Date(t[n.baselineStartDate])),!t[n.baselineEndDate]||t[n.baselineEndDate]instanceof Date||(t[n.baselineEndDate]=new Date(t[n.baselineEndDate]))),a.setRecordValue("taskData."+h,m,t),h===n.segments&&e&&!ne.isNullOrUndefined(e[n.segments])&&0<e[n.segments].length&&(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&e.ganttProperties&&e.ganttProperties.segments&&(t.ganttProperties.segments=e.ganttProperties.segments),a.dataOperation.setSegmentsInfo(t,!0)),a.setRecordValue(h,m,t)}else n.indicators===h?(m=e[h],a.setRecordValue("indicators",m,t.ganttProperties,!0),a.setRecordValue("taskData."+h,m,t),a.setRecordValue(h,m,t)):n.work===h?(a.setRecordValue("work",e[h],t.ganttProperties,!0),this.parent.dataOperation.updateMappingData(t,"work"),this.parent.dataOperation.updateMappingData(t,"duration"),this.parent.dataOperation.updateMappingData(t,"endDate")):h===n.type?(m=e[h],a.setRecordValue("taskType",m,t.ganttProperties,!0),a.setRecordValue(h,m,t),a.setRecordValue("taskData."+h,m,t)):h===n.expandState?(m=e[h],this.parent.setRecordValue("taskData."+h,m,t),this.parent.setRecordValue(this.parent.taskFields.expandState,m,t),this.parent.setRecordValue("expanded",m,t),this.parent.treeGrid.refresh()):-1!==a.customColumns.indexOf(h)?(f=a.columnByField[h],m=e[h],!ne.isNullOrUndefined(f.edit)||"datepickeredit"!==f.editType&&"datetimepickeredit"!==f.editType||(m=a.dataOperation.getDateFromFormat(m)),a.setRecordValue("taskData."+h,m,t),a.setRecordValue(h,m,t)):n.manual===h&&(a.setRecordValue("isAutoSchedule",!e[h],t.ganttProperties,!0),this.parent.setRecordValue(h,e[h],t),this.updateTaskScheduleModes(t))}o&&this.validateScheduleValues(s,t,e)},P.prototype.updateResourceRelatedFields=function(e,t){var i=e.ganttProperties,a=this.parent.previousRecords,n=i.taskType||this.parent.taskType,r=i.isAutoSchedule,s=this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.currentResources?this.parent.editModule.dialogModule.currentResources:e.ganttProperties.resourceInfo;if(ne.isNullOrUndefined(s))ne.isNullOrUndefined(s)&&"FixedDuration"===n&&0===i.duration&&this.parent.dataOperation.updateWorkWithDuration(e);else switch(n){case"FixedUnit":ne.isNullOrUndefined(a[i.uniqueID])||ne.isNullOrUndefined(a[i.uniqueID].ganttProperties)||null!==a[i.uniqueID].ganttProperties.resourceNames&&""!==a[i.uniqueID].ganttProperties.resourceNames||this.parent.dataOperation.updateWorkWithDuration(e),0!==s.length&&(r&&s.length?"resource"===t||"work"===t?this.parent.dataOperation.updateDurationWithWork(e):"duration"!==t&&"endDate"!==t||(this.parent.dataOperation.updateWorkWithDuration(e),0===i.duration&&this.parent.setRecordValue("isMilestone",!0,i,!0)):r||"work"!==t?this.parent.dataOperation.updateWorkWithDuration(e):this.parent.dataOperation.updateUnitWithWork(e));break;case"FixedWork":0!==s.length&&(r?"duration"===t||"endDate"===t?(this.parent.dataOperation.updateUnitWithWork(e),0===i.duration&&this.parent.setRecordValue("isMilestone",!0,i,!0)):this.parent.dataOperation.updateDurationWithWork(e):"work"===t?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e));break;case"FixedDuration":0===s.length?this.parent.dataOperation.updateWorkWithDuration(e):s.length&&"work"===t?this.parent.dataOperation.updateUnitWithWork(e):this.parent.dataOperation.updateWorkWithDuration(e)}},P.prototype.validateScheduleValues=function(e,t,i){var a=this.parent;2<e.length?a.dataOperation.calculateScheduledValues(t,i,!1):1<e.length?this.validateScheduleByTwoValues(i,e,t):this.dialogModule.validateScheduleValuesByCurrentField(e[0],i[e[0]],t)},P.prototype.validateScheduleByTwoValues=function(e,t,i){var a,n,r,s=this.parent,o=s.taskFields,l=i.ganttProperties,d=s.allowUnscheduledTasks;-1!==t.indexOf(o.startDate)&&(a=e[o.startDate]),-1!==t.indexOf(o.endDate)&&(n=e[o.endDate]),-1!==t.indexOf(o.duration)&&(r=e[o.duration]),a&&n||d&&-1!==t.indexOf(o.startDate)&&-1!==t.indexOf(o.endDate)?(s.setRecordValue("startDate",s.dataOperation.getDateFromFormat(a),l,!0),s.setRecordValue("endDate",s.dataOperation.getDateFromFormat(n),l,!0),s.dataOperation.calculateDuration(i)):n&&r||d&&-1!==t.indexOf(o.endDate)&&-1!==t.indexOf(o.duration)?(s.setRecordValue("endDate",s.dataOperation.getDateFromFormat(n),l,!0),s.dataOperation.updateDurationValue(r,l)):(a&&r||d&&-1!==t.indexOf(o.startDate)&&-1!==t.indexOf(o.duration))&&(s.setRecordValue("startDate",s.dataOperation.getDateFromFormat(a),l,!0),s.dataOperation.updateDurationValue(r,l))},P.prototype.isTaskbarMoved=function(e){var t,i,a,n,r=!1,s=e.ganttProperties,e=this.parent.previousRecords&&this.parent.previousRecords[e.uniqueID];return e&&e.ganttProperties&&(t=ne.getValue("ganttProperties.startDate",e),i=ne.getValue("ganttProperties.endDate",e),a=ne.getValue("ganttProperties.duration",e),n=ne.getValue("ganttProperties.durationUnit",e),-1===(e=Object.keys(e.ganttProperties)).indexOf("startDate")&&-1===e.indexOf("endDate")&&-1===e.indexOf("duration")&&-1===e.indexOf("durationUnit")||(ne.isNullOrUndefined(t)&&!ne.isNullOrUndefined(s.startDate)||ne.isNullOrUndefined(i)&&!ne.isNullOrUndefined(s.endDate)||ne.isNullOrUndefined(s.startDate)&&!ne.isNullOrUndefined(t)||ne.isNullOrUndefined(s.endDate)&&!ne.isNullOrUndefined(i)||t&&t.getTime()!==s.startDate.getTime()||i&&i.getTime()!==s.endDate.getTime()||!ne.isNullOrUndefined(a)&&a!==s.duration||!ne.isNullOrUndefined(a)&&a===s.duration&&n!==s.durationUnit)&&(r=!0)),r},P.prototype.removeImmediateParentDependency=function(e,t){if(!Array.isArray(e))return[];for(var i=[],a=0;a<e.length;a++){var n,r,s=e[a],o=t.getRecordByID(s.from),l=t.getRecordByID(s.to);o&&l&&o.ganttProperties&&l.ganttProperties?(n=o.ganttProperties.taskId,r=l.ganttProperties.taskId,o=o.parentItem,l=l.parentItem,o=o&&o.taskId,l=l&&l.taskId,o=!ne.isNullOrUndefined(o)&&!ne.isNullOrUndefined(r)&&o.toString()===r.toString(),r=!ne.isNullOrUndefined(l)&&!ne.isNullOrUndefined(n)&&l.toString()===n.toString(),o||r||i.push(s)):i.push(s)}return i},P.prototype.isPredecessorUpdated=function(e){var t=!1,i=this.parent.previousRecords[e.uniqueID];if(i&&i.ganttProperties&&i.ganttProperties.hasOwnProperty("predecessor"))if(e.ganttProperties.predecessorsName===i.ganttProperties.predecessorsName||ne.isNullOrUndefined(e.ganttProperties.predecessorsName)&&ne.isNullOrUndefined(i.ganttProperties.predecessorsName)){if(ne.isNullOrUndefined(e.ganttProperties.predecessorsName)&&ne.isNullOrUndefined(i.ganttProperties.predecessorsName)&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed)return t;i=this.removeImmediateParentDependency(i.ganttProperties.predecessor,this.parent);this.parent.setRecordValue("predecessor",i,e.ganttProperties,!0)}else t=!0;return t},P.prototype.isCheckPredecessor=function(e){var t=!1;return t=this.parent.previousRecords[e.uniqueID]&&this.parent.taskFields.dependency&&this.parent.isInPredecessorValidation&&0<this.parent.predecessorModule.getValidPredecessor(e).length&&this.isTaskbarMoved(e)?!0:t},P.prototype.updateGanttProperties=function(t,i){var a=["taskId","uniqueID","rowUniqueID","parentId","predecessor"];Object.keys(t.ganttProperties).forEach(function(e){-1===a.indexOf(e)&&(i.ganttProperties[e]=t.ganttProperties[e])})},P.prototype.shouldShowDialog=function(e,t){return!(!t||("MustStartOn"===e?t.respectMustStartOn:"MustFinishOn"===e?t.respectMustFinishOn:"StartNoLaterThan"===e?t.respectStartNoLaterThan:"FinishNoLaterThan"!==e||t.respectFinishNoLaterThan))},P.prototype.isTaskToMilestone=function(e){var t,i,a,n=!1;return e&&e.data&&(a=(e=e.data.ganttProperties).duration,t=e.startDate,i=e.endDate,ne.isNullOrUndefined(this.parent.taskFields.duration)?t&&i&&new Date(t).getTime()===new Date(i).getTime()&&(n=!0):0===a&&(n=!0),n=!(!(i=this.parent.previousRecords&&this.parent.previousRecords[e.uniqueID])||!i.ganttProperties||ne.isNullOrUndefined(i.ganttProperties.isMilestone)||(a=i.ganttProperties.startDate,e=t&&a&&new Date(t).getTime()===new Date(a).getTime(),i.ganttProperties.isMilestone)||!n||!e&&a)),n},P.prototype.initiateUpdateAction=function(e){var t,i=this.isCheckPredecessor(e.data);if(this.isTaskToMilestone(e)&&e.data.ganttProperties.predecessor&&(n=e.data.ganttProperties.predecessor,n=this.parent.predecessorModule.getPredecessorDate(e.data,n,null))&&new Date(n).getTime()!==new Date(e.data.ganttProperties.startDate).getTime()&&(this.parent.setRecordValue("startDate",new Date(n.getTime()),e.data.ganttProperties,!0),this.parent.setRecordValue("endDate",new Date(n.getTime()),e.data.ganttProperties,!0),this.parent.dataOperation.updateTaskData(e.data)),ne.isNullOrUndefined(e.data.parentItem)||i){if(0<e.data.childRecords.length&&!i&&!(i=this.isCheckPredecessor(e.data))&&this.isTaskbarMoved(e.data))for(var a=0;a<e.data.childRecords.length;a++)0<this.parent.predecessorModule.getValidPredecessor(e.data.childRecords[a]).length&&(t=a,i=!0)}else d=this.parent.getRecordByID(e.data.parentItem.taskId),i=!!(this.isTaskbarMoved(e.data)&&0<this.parent.predecessorModule.getValidPredecessor(d).length&&this.parent.isInPredecessorValidation);(!this.parent.undoRedoModule||this.parent.undoRedoModule&&!this.parent.undoRedoModule.currentAction||this.parent.undoRedoModule.currentAction&&"indent"!==this.parent.undoRedoModule.currentAction.action&&"outdent"!==this.parent.undoRedoModule.currentAction.action)&&(this.taskbarMoved=this.isTaskbarMoved(e.data)),this.predecessorUpdated=this.isPredecessorUpdated(e.data),this.predecessorUpdated&&(this.parent.isConnectorLineUpdate=!0,this.parent.connectorLineEditModule.addRemovePredecessor(e.data));var n={};if(!i||!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)this.taskbarMoved&&(this.parent.isConnectorLineUpdate=!0),this.updateEditedTask(e);else{n=ne.isNullOrUndefined(d)?ne.isNullOrUndefined(t)?this.parent.connectorLineEditModule.validateTypes(e.data):this.parent.connectorLineEditModule.validateTypes(e.data.childRecords[t],e.data):this.parent.connectorLineEditModule.validateTypes(d,e.data),this.parent.isConnectorLineUpdate=!0;var r,s,o,l,d=this.parent.predecessorModule.filterPredecessorsByTarget(e.data.ganttProperties.predecessor,e.data,this.parent.viewType),h=e&&e.data&&e.data.ganttProperties?e.data.ganttProperties.constraintType:null,h=!ne.isNullOrUndefined(ne.getValue("violationType",n))||h===k.ConstraintType.MustStartOn||h===k.ConstraintType.MustFinishOn;if(h&&ne.isNullOrUndefined(ne.getValue("violationType",n))){for(var p,u=e.data.ganttProperties.predecessor,c=null,g=e.data.ganttProperties.taskId,a=0;a<u.length;a++){var f=u[a];if(f.to.toString()===g.toString()){c=f;break}}c&&(p=this.parent.connectorLineModule.getRecordByID(c.from),n.parentTask=p)}!h||0===d.length&&e.data.ganttProperties.predecessor?this.updateEditedTask(e):(h=!(p=void 0),p=this.parent.taskFields.constraintDate&&this.parent.taskFields.constraintType?(this.taskViolation=this.parent.constraintViolationType,this.parent.constraintViolationType="PredecessorLink",this.validateConstraintViolation(e)):this.validateTaskEvent(e),d=!1,l="",this.parent.editModule&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.editedColumn&&(l=this.resolveFallback(this.parent.editModule.cellEditModule.editedColumn.field,"")),o=p.data.ganttProperties.constraintType,r=this.parent.taskFields,s=e.taskBarEditAction,d=(o=this.updateConstraintViolationAction(l,o,r,!1,e,s,h)).shouldRespectLink,h=(!(h=o.showDialog)||l!==r.constraintType&&l!==r.constraintDate||"MustFinishOn"!==this.taskViolation&&"MustStartOn"!==this.taskViolation)&&h&&this.shouldShowDialog(this.taskViolation,p.validateMode),s=null,(s=this.parent&&this.parent.editModule&&this.parent.editModule.taskbarEditModule&&"function"==typeof this.parent.editModule.taskbarEditModule.isValidDependency?this.parent.editModule.taskbarEditModule.isValidDependency(e.data):s)&&(o=s.isValid,h||(l=p.data.ganttProperties.constraintType===k.ConstraintType.MustStartOn&&d||p.data.ganttProperties.constraintType===k.ConstraintType.MustFinishOn&&d,(!1===this.parent.updateOffsetOnTaskbarEdit&&!1===o&&!1===p.validateMode.respectLink||l&&!1===p.validateMode.respectLink)&&(p.validateMode.respectLink=!0),!1===this.parent.updateOffsetOnTaskbarEdit&&!1===o&&!1===p.validateMode.respectLink&&(p.validateMode.respectLink=!0),l&&(p.validateMode.respectLink=!0))),!1===p.validateMode.preserveLinkWithEditing&&!1===p.validateMode.removeLink&&!1===p.validateMode.respectLink||h?(this.violationArgs={matchedModifiedTask:e.data,args:e},this.taskViolation&&this.parent.taskFields.constraintDate&&this.parent.taskFields.constraintType&&(n.violationType=this.taskViolation,n.predecessorLink=!0),this.parent.connectorLineEditModule.openValidationDialog(n)):(this.parent.editModule&&this.parent.editModule.dialogModule&&this.parent.editModule.dialogModule.isEdit&&this.predecessorUpdated&&(this.isValidatedEditedRecord=!0,this.parent.predecessorModule.validatePredecessor(e.data,[],"")),this.parent.connectorLineEditModule.applyPredecessorOption()))}},P.prototype.updateConstraintViolationAction=function(e,t,i,a,n,r,s){return e&&""!==e.trim()?t===k.ConstraintType.MustStartOn&&e===i.startDate?(a=!0,this.parent.constraintViolationType="MustStartOn",this.taskViolation="MustStartOn"):t===k.ConstraintType.MustFinishOn&&e===i.endDate&&(a=!0,this.parent.constraintViolationType="MustFinishOn",this.taskViolation="MustFinishOn"):"DialogEditing"!==n.action&&(t===k.ConstraintType.MustStartOn?"ProgressResizing"!==r&&"RightResizing"!==r?(a=!0,this.parent.constraintViolationType="MustStartOn",this.taskViolation="MustStartOn"):"ProgressResizing"!==r&&(s=!1):t===k.ConstraintType.MustFinishOn&&("ProgressResizing"!==r&&"LeftResizing"!==r?(a=!0,this.parent.constraintViolationType="MustFinishOn",this.taskViolation="MustFinishOn"):"ProgressResizing"!==r&&(s=!1))),{shouldRespectLink:a,showDialog:s}},P.prototype.validateTaskEvent=function(e){var t={};return this.resetValidateArgs(),(this.parent.currentEditedArgs=t).cancel=!1,t.data=e.data,t.requestType="validateLinkedTask",t.validateMode=this.parent.dialogValidateMode,t.editEventArgs=e,this.parent.actionBeginTask(t),t},P.prototype.validateConstraintViolation=function(e){var t={};return this.resetValidateArgs(),(this.parent.currentEditedArgs=t).cancel=!1,t.data=e.data,t.requestType="validateTaskViolation",t.violationType=this.parent.constraintViolationType,t.validateMode=this.parent.dialogValidateMode,t.editEventArgs=e,this.parent.actionBeginTask(t),t},P.prototype.resetValidateArgs=function(){this.parent.dialogValidateMode.preserveLinkWithEditing=!0,this.parent.dialogValidateMode.removeLink=!1,this.parent.dialogValidateMode.respectLink=!1,this.parent.dialogValidateMode.respectMustFinishOn=!1,this.parent.dialogValidateMode.respectMustFinishOn=!1,this.parent.dialogValidateMode.respectStartNoLaterThan=!1,this.parent.dialogValidateMode.respectFinishNoLaterThan=!1},P.prototype.validateChildPredecessors=function(){for(var i=this,a=this,e=0;e<this.parent.predecessorModule.validatedChildItems.length;e++)!function(e){var t=a.parent.predecessorModule.validatedChildItems[e];t.ganttProperties.predecessor&&0<t.ganttProperties.predecessor.length&&(a.parent.editedPredecessorRecords.some(function(e){return e[i.parent.taskFields.id]===t[i.parent.taskFields.id]})||a.parent.editedPredecessorRecords.push(t),a.isValidatedEditedRecord||(a.isFirstCall=!0),a.parent.predecessorModule.validatePredecessor(t,[],""))}(e)},P.prototype.processSuccessorChainAndChildren=function(e){for(var t=this.getTaskId(e),i=[],e=this.resolveFallback(e.ganttProperties.predecessor,[]).filter(function(e){return e.from===t}).map(function(e){return{from:e.from,to:e.to}}),i=i.concat(e),a=new Set;0<i.length;){var n=i.shift();if(!a.has(n.to)){a.add(n.to);var r=this.parent.connectorLineModule.getRecordByID(n.from),n=this.parent.connectorLineModule.getRecordByID(n.to);if(n){if(this.parent.predecessorModule.validateChildGanttRecord(r,n),n.hasChildRecords&&n.ganttProperties.isAutoSchedule&&this.parent.predecessorModule.updateChildItems(n),n.parentItem&&n.ganttProperties.isAutoSchedule&&this.parent.dataOperation.updateParentItems(n),n.parentItem)for(var s=this.parent.getRecordByID(n.parentItem.taskId);s;){if(s.ganttProperties.predecessor&&s.ganttProperties.predecessor.length)for(var o,l,d=this.getTaskId(s),h=0,p=s.ganttProperties.predecessor;h<p.length;h++)(u=p[h]).from===d&&(o=this.parent.connectorLineModule.getRecordByID(u.to))&&(l=this.parent.connectorLineModule.getRecordByID(u.from),this.parent.predecessorModule.validateChildGanttRecord(l,o));s=s.parentItem?this.parent.getRecordByID(s.parentItem.taskId):null}if(n.hasChildRecords&&this.updateSuccessorChildren(n.childRecords),n.ganttProperties.predecessor)for(var u,c=this.getTaskId(n),g=0,f=n.ganttProperties.predecessor;g<f.length;g++)(u=f[g]).from===c&&i.push({from:u.from,to:u.to})}}}},P.prototype.getTaskId=function(e){return("ResourceView"===this.parent.viewType?e.ganttProperties.taskId:e.ganttProperties.rowUniqueID).toString()},P.prototype.updateSuccessorChildren=function(e){for(var t=Object.assign([],e),i=new Set;0<t.length;){var a=t.shift(),n=this.getTaskId(a);if(!i.has(n)){if(i.add(n),a.ganttProperties.predecessor)for(var r=0,s=a.ganttProperties.predecessor;r<s.length;r++){var o,l=s[r];l.from===n&&(o=this.parent.connectorLineModule.getRecordByID(l.to))&&(l=this.parent.connectorLineModule.getRecordByID(l.from),this.parent.predecessorModule.validateChildGanttRecord(l,o),o.hasChildRecords)&&this.parent.predecessorModule.updateChildItems(o)}a.hasChildRecords&&(t=t.concat(a.childRecords))}}},P.prototype.updateEditedTask=function(e){var t=e.data;if(this.editedRecord=t,!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping||this.updateParentChildRecord(t),this.parent.predecessorModule&&(this.parent.predecessorModule.isValidatedParentTaskID=""),(this.parent.isConnectorLineUpdate||this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed)&&this.parent.autoCalculateDateScheduling&&!(this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)){if(this.validateChildPredecessors(),t.ganttProperties.predecessor&&(this.parent.isMileStoneEdited=t.ganttProperties.isMilestone,this.taskbarMoved&&this.parent.editedPredecessorRecords.push(t),this.isValidatedEditedRecord||(this.isFirstCall=!0,"DialogEditing"===e.action&&(this.isDialogEditing=!0),this.parent.predecessorModule.validatePredecessor(t,[],""),this.parent.predecessorModule.isChildRecordValidated=[]),this.isValidatedEditedRecord=!1),this.parent.predecessorModule.isValidatedParentTaskID="",this.parent.allowParentDependency&&this.parent.predecessorModule.isValidatedParentTaskID!==t.ganttProperties.taskId&&t.hasChildRecords&&this.parent.previousRecords[t.uniqueID].ganttProperties.startDate&&"TaskbarEditing"!==e.action&&(!t.hasChildRecords||t.hasChildRecords&&t.ganttProperties.isAutoSchedule)&&(this.parent.predecessorModule.updateChildItems(t),this.validateChildPredecessors()),this.parent.predecessorModule.isValidatedParentTaskID="",this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed)for(var i=0;i<t.childRecords.length;i++)t.childRecords[i].ganttProperties.predecessor&&this.parent.predecessorModule.validatePredecessor(t.childRecords[i],[],"");this.updateParentItemOnEditing(),this.parent.dataOperation.updateParentItems(t,!0)}if(t.parentItem){!this.parent.autoCalculateDateScheduling||this.parent.isLoad&&this.parent.treeGrid.loadChildOnDemand&&this.parent.taskFields.hasChildMapping||this.parent.dataOperation.updateParentItems(t,!0);for(var a=this.parent.getRecordByID(t.parentItem.taskId);!ne.isNullOrUndefined(a);)a.ganttProperties.predecessorsName?a.ganttProperties.predecessor&&this.parent.updateOffsetOnTaskbarEdit&&(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed||!this.parent.undoRedoModule)&&this.processSuccessorChainAndChildren(a):(this.isFirstCall=!0,this.parent.predecessorModule.validatePredecessor(a,[],""),this.updateParentItemOnEditing()),a=a.parentItem?this.parent.getRecordByID(a.parentItem.taskId):null}if(this.parent.updateOffsetOnTaskbarEdit&&e.data&&this.parent.taskFields.dependency&&(this.parent.predecessorModule.validatedOffsetIds=[],this.parent.predecessorModule.calculateOffset(e.data)),this.parent.predecessorModule.validatedParentIds=[],ne.isNullOrUndefined(this.dialogModule)||this.dialogModule&&!this.dialogModule.isFromDialogPredecessor){var n=e.data.ganttProperties.predecessor,r=this.parent.editedRecords,s=void 0,o=-1,l=void 0,d=this.parent.taskFields.constraintDate,h=this.parent.taskFields.constraintType,p=[k.ConstraintType.MustStartOn,k.ConstraintType.MustFinishOn,k.ConstraintType.StartNoLaterThan,k.ConstraintType.FinishNoLaterThan];if(d&&h&&n&&r){for(i=0;i<n.length;i++)if("break"===function(e){var t=n[e].to,e=r.findIndex(function(e){return e.ganttProperties.taskId.toString()===t&&-1<p.indexOf(e.ganttProperties.constraintType)});if(-1!==e)return s=r[e],o=e,"break"}(i))break}else if(r){for(i=0;i<r.length;i++){var u=r[i];if(-1!==p.indexOf(u.ganttProperties.constraintType)){s=u;break}}if(s&&s.ganttProperties&&s.ganttProperties.predecessor)for(n=s.ganttProperties.predecessor,i=0;i<n.length;i++)if("break"===function(e){var t=n[e].from,e=r.findIndex(function(e){return e.ganttProperties.taskId.toString()===t});if(-1!==e)return l=r[e],o=e,"break"}(i))break}var c,d=e.data.ganttProperties.taskId,h=this.parent.validationDialogElement?this.parent.validationDialogElement.element:null,g=!1;(g=h?!h.ej2_instances[0].dialogOpen:g)&&s&&s.ganttProperties.taskId!==d&&"ProgressResizing"!==e.taskBarEditAction&&(this.violationArgs={matchedModifiedTask:s,matchedModifiedTaskIndex:o,args:e,matchedParedRecord:l},h=s,g=l||e.data,!ne.isNullOrUndefined(this.parent.constraintViolationType)&&""!==this.parent.constraintViolationType||(d=s.ganttProperties.constraintType,this.updateConstraintViolationType(d)),(d=this.parent.editModule.validateConstraintViolation(e)).violationType)?(c=d.validateMode,this.shouldShowDialog(d.violationType,c)?this.parent.connectorLineEditModule.openConstraintValidationDialog({violationType:d.violationType,parentRecord:g,record:h,predecessorLink:n}):(d.validateMode.respectLink=!0,this.parent.connectorLineEditModule.applyPredecessorOption())):this.initiateSaveAction(e)}},P.prototype.updateConstraintViolationType=function(e){e===k.ConstraintType.MustStartOn?this.parent.constraintViolationType="MustStartOn":e===k.ConstraintType.MustFinishOn?this.parent.constraintViolationType="MustFinishOn":e===k.ConstraintType.StartNoLaterThan?this.parent.constraintViolationType="StartNoLaterThan":e===k.ConstraintType.FinishNoLaterThan&&(this.parent.constraintViolationType="FinishNoLaterThan")},P.prototype.updateParentItemOnEditing=function(){for(var t=this,e=ne.getValue("parentRecord",this.parent.predecessorModule),i=0;i<e.length;i++)this.parent.dataOperation.updateParentItems(e[i]);this.parent.editModule.updateParentRecords&&0<this.parent.editModule.updateParentRecords.length&&this.parent.editModule.updateParentRecords.forEach(function(e){e.ganttProperties.predecessor&&0<e.ganttProperties.predecessor.length&&t.parent.predecessorModule.validatePredecessor(e,[],"")});for(i=0;i<e.length;i++)this.parent.dataOperation.updateParentItems(e[i]);ne.setValue("parentRecord",[],this.parent.predecessorModule),ne.setValue("parentIds",[],this.parent.predecessorModule)},P.prototype.updateParentChildRecord=function(e){!e.hasChildRecords||!this.taskbarMoved||!1!==e[this.parent.taskFields.manual]&&"Auto"!==this.parent.taskMode||ne.isNullOrUndefined(this.parent.editModule.cellEditModule)||this.parent.editModule.cellEditModule.isResourceCellEdited||this.parent.predecessorModule.updateChildItems(e),ne.isNullOrUndefined(this.parent.editModule.cellEditModule)||(this.parent.editModule.cellEditModule.isResourceCellEdited=!1)},P.prototype.updateTaskScheduleModes=function(e){var t=e[this.parent.taskFields.startDate],i=e.ganttProperties;this.parent.taskFields.manual&&this.parent.setRecordValue(this.parent.taskFields.manual,!e.ganttProperties.isAutoSchedule,e),e.hasChildRecords&&i.isAutoSchedule?(this.parent.setRecordValue("startDate",i.autoStartDate,i,!0),this.parent.setRecordValue("endDate",i.autoEndDate,i,!0),this.parent.setRecordValue("StartDate",i.autoStartDate,e,!0),this.parent.setRecordValue("EndDate",i.autoEndDate,e,!0),this.parent.setRecordValue("taskData.StartDate",i.autoStartDate,e,!0),this.parent.setRecordValue("taskData.EndDate",i.autoEndDate,e,!0),this.parent.setRecordValue("width",this.parent.dataOperation.calculateWidth(e,!0),i,!0),this.parent.setRecordValue("left",this.parent.dataOperation.calculateLeft(i,e,!0),i,!0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(i.width,i.progress),i,!0),this.parent.dataOperation.calculateDuration(e)):e.hasChildRecords&&!i.isAutoSchedule?(this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.calculateDuration(e),this.parent.setRecordValue("autoStartDate",i.autoStartDate,i,!0),this.parent.setRecordValue("autoEndDate",i.autoEndDate,i,!0),this.parent.setRecordValue("autoDuration",this.parent.dataOperation.calculateAutoDuration(e),i,!0),this.parent.dataOperation.updateAutoWidthLeft(e)):(i=this.parent.dateValidationModule.checkStartDate(t,e.ganttProperties),this.parent.setRecordValue("startDate",i,e.ganttProperties,!0),this.parent.dataOperation.updateMappingData(e,"startDate"),this.parent.dateValidationModule.calculateEndDate(e),this.parent.setRecordValue("taskData."+this.parent.taskFields.manual,e[this.parent.taskFields.manual],e),this.parent.dataOperation.updateWidthLeft(e))},P.prototype.getValueOrFallback=function(e,t,i){return e?e[t]:i},P.prototype.updateParentProgress=function(e){var t,i=0,e=this.parent.getParentTask(e),a=e.childRecords,n=this.getValueOrFallback(a,"length",0),r=0,s=0,o=0;if(a){for(var l=0;l<n;l++)a[l].ganttProperties.isMilestone&&!a[l].hasChildRecords||!j(a[l].ganttProperties)?s+=1:(t=this.parent.dataOperation.getParentProgress(a[l]),r+=ne.getValue("totalProgress",t),o+=ne.getValue("totalDuration",t));i=this.resolveCondition(0<n-s,Math.round(r/o),0),isNaN(i)&&(i=0),this.parent.setRecordValue("progressWidth",this.parent.dataOperation.getProgressWidth(this.resolveCondition(e.ganttProperties.isAutoSchedule,e.ganttProperties.width,e.ganttProperties.autoWidth),i),e.ganttProperties,!0),this.parent.setRecordValue("progress",Math.floor(i),e.ganttProperties,!0),this.parent.setRecordValue("totalProgress",r,e.ganttProperties,!0),this.parent.setRecordValue("totalDuration",o,e.ganttProperties,!0)}this.parent.dataOperation.updateTaskData(e),e.parentItem&&this.updateParentProgress(e.parentItem)},P.prototype.revertCellEdit=function(e){this.parent.editModule.reUpdatePreviousRecords(!1,!0),this.resetEditProperties()},P.prototype.reUpdatePreviousRecords=function(e,t,i){for(var a=this.parent.previousRecords,n=i?[i]:Object.keys(a),r=0;r<n.length;r++){var s,o=n[r],l=a[o];l&&(o=this.parent.getTaskByUniqueID(o),this.copyTaskData(o.taskData,l.taskData),delete l.taskData,this.copyTaskData(o.ganttProperties,l.ganttProperties),delete l.ganttProperties,this.copyTaskData(o,l),l=this.parent.currentViewData.indexOf(o),e&&this.parent.chartRowsModule.refreshRow(l),t)&&(s=this.resolveCondition("ProjectView"===this.parent.viewType,o.ganttProperties.taskId,o.ganttProperties.rowUniqueID),this.parent.treeGrid.setRowData(s,o),this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[l].getAttribute("data-uid")).data=o)}},P.prototype.copyTaskData=function(e,t){ne.isNullOrUndefined(t)||ne.extend(e,t)},P.prototype.updateScheduleDatesOnEditing=function(e){},P.prototype.initiateSaveAction=function(k){var T=this,b=(this.parent.editModule.updateParentRecords=[],{}),w=(b.requestType="beforeSave",b.data=k.data,this.createArray=!(b.cancel=!1),this.parent.toolbarModule&&this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&0<this.parent.undoRedoModule.getUndoCollection.length&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),b.modifiedRecords=this.parent.editedRecords,ne.isNullOrUndefined(k.target)||(b.target=k.target),b.modifiedTaskData=Z(this.parent.editedRecords,!0),"DrawConnectorLine"!==k.action&&"DeleteConnectorLine"!==k.action||(b.action=k.action,"DeleteConnectorLine"===k.action&&(this.parent.connectorLineEditModule.isPublicDependencyDelete=!1,this.parent.contextMenuModule)&&(this.parent.contextMenuModule.isContextMenuDependencyDelete=!1)),ne.isNullOrUndefined(k.action)&&(this.parent.isConvertedMilestone||this.parent.contextMenuModule&&this.parent.contextMenuModule.isOpen&&"ToTask"===this.parent.contextMenuModule.item)&&(this.parent.isConvertedMilestone?k.action="ToMilestone":this.parent.contextMenuModule&&"ToTask"===this.parent.contextMenuModule.item&&(k.action="ToTask")),this.parent),v=Object.assign({},b.data.ganttProperties.baselineStartDate),S=Object.assign({},b.data.ganttProperties.baselineEndDate),P=b.data.ganttProperties.progress,C=b.data.ganttProperties.duration,R=b.data.ganttProperties.taskName,M=b.data.ganttProperties.startDate,x=b.data.ganttProperties.endDate,O=b.data.ganttProperties.work,I=b.data.ganttProperties.isMilestone,E=!1,F=ne.extend({},b.data.ganttProperties,void 0,!0);this.parent.trigger("actionBegin",b,function(e){T.parent.treeGridModule.setCancelArgs=e.cancel;var t,i=e.data.ganttProperties,a=T.parent.taskFields,n=(v===i.baselineStartDate&&S===i.baselineEndDate||(w.setRecordValue("baselineLeft",w.dataOperation.calculateBaselineLeft(i),i,!0),w.setRecordValue("baselineWidth",w.dataOperation.calculateBaselineWidth(i),i,!0)),T.parent.autoCalculateDateScheduling&&F!==i&&!ne.isNullOrUndefined(e.data.parentItem)&&(T.updateParentItemOnEditing(),T.parent.dataOperation.updateParentItems(e.data,!0)),i.startDate),r=i.endDate,s=(i.segments,i.durationUnit),o=i.isAutoSchedule,l=i.isMilestone,d=T.parent.treeGridModule.perviousStartDate,h=T.parent.treeGridModule.perviousEndDate;if(!ne.isNullOrUndefined(i.segments)&&0!==i.segments.length||(ne.isNullOrUndefined(d)||d.getTime()===(!ne.isNullOrUndefined(n)&&n.getTime()))&&(ne.isNullOrUndefined(h)||h.getTime()===(!ne.isNullOrUndefined(r)&&r.getTime()))||0!==(t=T.parent.dateValidationModule.getDuration(n,r,s,o,l,!0,i.calendarContext))&&(i.isMilestone=!1,i.duration=t),ne.isNullOrUndefined(a.milestone)||ne.isNullOrUndefined(I)||ne.isNullOrUndefined(e.data[a.milestone])||I===e.data[a.milestone]||(e.data[a.milestone]?(i.isMilestone=e.data[a.milestone],i.duration=0,i.width=0,E=!0):(i.isMilestone=e.data[a.milestone],d=T.parent.previousRecords&&T.parent.previousRecords[e.data.uniqueID],i.duration=d.ganttProperties.duration),h=T.parent.dataOperation.getEndDate(i.startDate,i.duration,i.durationUnit,i,!1),i.endDate=h),ne.isNullOrUndefined(a.duration)||ne.isNullOrUndefined(e.data[a.duration])||C===e.data[a.duration]||(i.duration=e.data[a.duration],0!==e.data[a.duration]&&(i.isMilestone=!1,ne.isNullOrUndefined(a.milestone)||(e.data[a.milestone]=!1)),ne.isNullOrUndefined(a.work)||ne.isNullOrUndefined(e.data[a.work])||T.parent.editModule.updateResourceRelatedFields(e.data,"duration"),n=T.parent.dataOperation.getEndDate(i.startDate,i.duration,i.durationUnit,i,!1),i.endDate=n,E=!0),ne.isNullOrUndefined(a.name)||R===e.data[a.name]||(i.taskName=e.data[a.name]),ne.isNullOrUndefined(a.startDate)||ne.isNullOrUndefined(M)||ne.isNullOrUndefined(e.data[a.startDate])||M.getTime()===e.data[a.startDate].getTime()||(r=T.parent.dateValidationModule.checkStartDate(e.data[a.startDate],i),i.startDate=r,E=!0),ne.isNullOrUndefined(a.endDate)||ne.isNullOrUndefined(x)||ne.isNullOrUndefined(e.data[a.endDate])||x.getTime()===e.data[a.endDate].getTime()||(s=T.parent.dateValidationModule.checkEndDate(e.data[a.endDate],i),i.endDate=s,t=T.parent.dataOperation.getDuration(i.startDate,s,i.durationUnit,!0,!1,!0,i.calendarContext),i.duration=t,0!==i.duration&&(i.isMilestone=!1),E=!0),ne.isNullOrUndefined(a.work)||ne.isNullOrUndefined(O)||ne.isNullOrUndefined(e.data[a.work])||O===e.data[a.work]||(i.work=e.data[a.work],T.parent.editModule.updateResourceRelatedFields(e.data,"work"),o=T.parent.dataOperation.getEndDate(i.startDate,i.duration,i.durationUnit,i,!1),i.endDate=o,E=!0),E&&(T.parent.predecessorModule.validatePredecessor(e.data,[],""),E=!1),T.parent.dataOperation.updateWidthLeft(e.data),ne.isNullOrUndefined(a.progress)||ne.isNullOrUndefined(e.data[a.progress])||P===e.data[a.progress]||(l=i.isAutoSchedule?i.width:i.autoWidth,T.parent.setRecordValue("progressWidth",T.parent.dataOperation.getProgressWidth(l,e.data[a.progress]),i,!0),100<e.data[a.progress]&&(e.data[a.progress]=100),i.progress=e.data[a.progress]),T.parent.chartRowsModule.updateSegment(i.segments,e.data.ganttProperties.taskId),e.cancel)T.reUpdatePreviousRecords(),T.parent.chartRowsModule.refreshRecords([k.data]),T.resetEditProperties(b);else{if(T.parent.showLoadingIndicator(),e.modifiedRecords)for(var p=0;p<e.modifiedRecords.length;p++)T.parent.enableWBS&&T.parent.updateWBSPredecessor(e.modifiedRecords[p]),T.parent.dataOperation.updateTaskData(e.modifiedRecords[p]);if(e.modifiedTaskData=Z(e.modifiedRecords,null,null,T.parent),_(T.parent.dataSource)){var u=T.parent.dataSource,d={changedRecords:e.modifiedTaskData},c=T.parent.query instanceof U.Query?T.parent.query:new U.Query,h=null,n=u.adaptor;if(!(n instanceof U.WebApiAdaptor||n instanceof U.ODataAdaptor||n instanceof U.ODataV4Adaptor||n instanceof U.GraphQLAdaptor)||u.dataSource.batchUrl)h=u.saveChanges(d,T.parent.taskFields.id,null,c);else{r=d.changedRecords;if(r instanceof Array){for(var g=T.parent.taskFields.id,f=Promise.resolve(),m=[],y=0,D=r;y<D.length;y++)!function(e){e[g];f=f.then(function(){return u.update(g,e,null,c).then(function(e){return m.push(e),e})})}(D[y]);f.then(function(){T.dmSuccess({changedRecords:m},k)}).catch(function(e){T.dmFailure(e,k)})}else s=r?r[T.parent.taskFields.id]:null,h=u.update(T.parent.taskFields.id,r,s,c)}ne.isNullOrUndefined(h)||T.remoteCrud||h.then(function(e){return T.dmSuccess(e,k)}).catch(function(e){return T.dmFailure(e,k)})}else T.saveSuccess(k);T.parent.enableVirtualization&&T.parent.enableTimelineVirtualization&&T.parent.ganttChartModule.setVirtualHeight(),T.parent.undoRedoModule&&(T.parent.previousFlatData=ne.extend([],T.parent.flatData,[],!0))}}),this.parent.ganttChartModule.reRenderConnectorLines()},P.prototype.processCustomDateColumns=function(i,a,n,r){n.customColumns&&0!==n.customColumns.length&&n.customColumns.forEach(function(e){var t=i[e];t instanceof Date&&(t=n.dateValidationModule[r](t,n.timezone),a[e]=t)})},P.prototype.processStandardDateFields=function(e,t,i,a){if(i.timezone)for(var n=i.taskFields,r=[n.startDate,n.endDate,n.baselineStartDate,n.baselineEndDate],s=0;s<r.length;s++){var o=r[s];o&&e[o]&&e[o]instanceof Date&&(t[o]=i.dateValidationModule[a](e[o],i.timezone))}},P.prototype.updateEditedFields=function(e){for(var t,i=(e.changedRecords||e).length,a=0;a<i;a++){t=e.changedRecords?(t=e.changedRecords[parseInt(a.toString(),10)])&&!ne.isNullOrUndefined(t.result)?t.result:t:e[parseInt(a.toString(),10)],this.parent.timezone&&this.processStandardDateFields(t,t,this.parent,"convert"),this.processCustomDateColumns(t,t,this.parent,"convert");for(var n=Object.keys(t).length,r=0,s=Object.keys(t);r<n;r++){var o=s[parseInt(r.toString(),10)];this.parent.editedRecords[parseInt(a.toString(),10)][""+o]=t[""+o],this.parent.editedRecords[parseInt(a.toString(),10)].taskData[""+o]=t[""+o]}this.updateEditedRecordFields(t,this.parent.editedRecords[parseInt(a.toString(),10)])}},P.prototype.dmSuccess=function(e,t){this.updateEditedFields(e),this.saveSuccess(t),this.remoteCrud=!1,this.parent.focusModule.tabElement.isTab&&(this.parent.treeGrid.editCell(this.parent.ganttChartModule.focusedRowIndex,this.parent.focusModule.tabElement.column),this.parent.focusModule.tabElement=Object.assign({},this.parent.focusModule.tabElement,{isTab:!1}))},P.prototype.updateEditedRecordFields=function(e,t){for(var i,a=this.parent.taskFields,n=Object.keys(e).length,r=0,s=Object.keys(e);r<n;r++){var o=s[parseInt(r.toString(),10)];t[""+o]=e[""+o]}null!==a.id?t.ganttProperties.taskId=e[a.id]:t.ganttProperties.taskId,null!==a.name?t.ganttProperties.taskName=e[a.name]:t.ganttProperties.taskName,null!==a.startDate?t.ganttProperties.startDate=e[a.startDate]:t.ganttProperties.startDate,null!==a.endDate?t.ganttProperties.endDate=e[a.endDate]:t.ganttProperties.endDate,null!==a.duration?(i=e[a.duration],t.ganttProperties.duration=null!=i&&""!==i?parseFloat(i):null):t.ganttProperties.duration,null!==a.durationUnit?t.ganttProperties.durationUnit=e[a.durationUnit]:t.ganttProperties.durationUnit,null!==a.progress?t.ganttProperties.progress=e[a.progress]:t.ganttProperties.progress,null!==a.dependency?t.ganttProperties.dependency=e[a.dependency]:t.ganttProperties.dependency,null!==a.parentID?t.ganttProperties.parentID=e[a.parentID]:t.ganttProperties.parentID,null!==a.baselineEndDate?t.ganttProperties.baselineEndDate=e[a.baselineEndDate]:t.ganttProperties.baselineEndDate,null!==a.baselineStartDate?t.ganttProperties.baselineStartDate=e[a.baselineStartDate]:t.ganttProperties.baselineStartDate,null!==a.resourceInfo?t.ganttProperties.resources=e[a.resourceInfo]:t.ganttProperties.resources},P.prototype.dmFailure=function(e,t){if(this.deletedTaskDetails.length){for(var i=this.deletedTaskDetails,a=0;a<i.length;a++)i[a].isDelete=!1;this.deletedTaskDetails=[]}this.reUpdatePreviousRecords(!0,!0),this.parent.predecessorModule&&this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.ganttChartModule&&this.parent.ganttChartModule.reRenderConnectorLines(),this.resetEditProperties(),this.parent.trigger("actionFailure",{error:e})},P.prototype.updateSharedTask=function(e){for(var t=e.ganttProperties.sharedTaskUniqueIds,i=0;i<t.length;i++){var a=this.parent.flatData[this.parent.ids.indexOf(t[i].toString())];a&&a.uniqueID!==e.uniqueID&&(this.updateGanttProperties(e,a),this.parent.setRecordValue("taskData",e.taskData,a,!0),this.parent.dataOperation.updateTaskData(a),this.parent.dataOperation.updateResourceName(a),ne.isNullOrUndefined(a.parentItem)||this.parent.dataOperation.updateParentItems(a.parentItem))}},P.prototype.saveSuccess=function(e){var t={};this.parent.timelineSettings.updateTimescaleView&&(a=this.parent.editedRecords,this.parent.timelineModule.updateTimeLineOnEditing([a],e.action)),"ResourceView"===this.parent.viewType&&("TaskbarEditing"===e.action||"DrawConnectorLine"===e.action||"DeleteConnectorLine"===e.action?this.updateSharedTask(e.data):"DialogEditing"!==e.action&&"CellEditing"!==e.action&&"methodUpdate"!==e.action||(this.parent.editModule.dialogModule.isResourceUpdate?(this.updateResoures(this.parent.editModule.dialogModule.previousResource,e.data.ganttProperties.resourceInfo,e.data),this.updateSharedTask(e.data),this.updateRowIndex(),this.isTreeGridRefresh=!0):this.updateSharedTask(e.data)),this.parent.editModule.dialogModule.isResourceUpdate=!1,this.parent.editModule.dialogModule.previousResource=[]);for(var i=0;i<this.updateParentRecords.length;i++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[i]);this.updateParentRecords=[];var a=this.parent.criticalPathModule;this.parent.enableCriticalPath&&a&&a.criticalPathCollection&&(a.showCriticalPath(!0),a.criticalConnectorLine(a.criticalPathCollection,a.detailPredecessorCollection,!0,a.predecessorCollectionTaskIds)),this.isTreeGridRefresh||(!this.parent.focusModule.tabElement.isTab&&this.parent.editSettings.allowEditing&&0<this.parent.treeGrid.element.getElementsByClassName("e-editedbatchcell").length&&(this.parent.treeGrid.grid.element.querySelector("form").ej2_instances[0].validate()||(ne.setValue("isEdit",!1,this.parent.treeGrid.grid),this.parent.editModule.cellEditModule.isCellEdit=!1),this.parent.treeGrid.endEdit()),this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords),!this.parent.allowTaskbarOverlap&&this.parent.showOverAllocation&&(this.parent.contentHeight=this.parent.element.getElementsByClassName("e-content")[0].children[0].offsetHeight,this.parent.ganttChartModule.chartBodyContent.style.height=this.parent.contentHeight+"px",this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData),this.parent.taskFields.dependency)&&this.parent.ganttChartModule.reRenderConnectorLines(),(this.parent.isConnectorLineUpdate||this.parent.undoRedoModule&&this.parent.undoRedoModule.currentAction&&this.parent.undoRedoModule.currentAction.connectedRecords)&&!ne.isNullOrUndefined(this.parent.connectorLineEditModule)&&(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.editedRecords),this.updateScheduleDatesOnEditing(e))),!this.parent.editSettings.allowTaskbarEditing||this.parent.editSettings.allowTaskbarEditing&&!this.taskbarEditModule.dependencyCancel?(t.requestType="save",t.data=e.data,t.modifiedRecords=this.parent.editedRecords,t.modifiedTaskData=Z(this.parent.editedRecords,null,null,this.parent),!this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition&&this.updateRowIndex(),ne.isNullOrUndefined(e.action)||ne.setValue("action",e.action,t),"TaskbarEditing"===e.action&&(t.taskBarEditAction=e.taskBarEditAction),this.parent.dataSource&&"result"in this.parent.dataSource&&("ToMilestone"===e.action||"ToTask"===e.action||"TaskbarEditing"===e.action||"DrawConnectorLine"===e.action||"DeleteConnectorLine"===e.action||"methodUpdate"===e.action)&&this.parent.treeGrid.grid.renderModule.refresh(t),this.endEditAction(e),this.parent.trigger("actionComplete",t),this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.draggedRecord&&(this.parent.rowDragAndDropModule.draggedRecord=null)):(this.taskbarEditModule.dependencyCancel=!1,this.resetEditProperties()),this.parent.hideLoadingIndicator(),"ResourceView"===this.parent.viewType&&this.isTreeGridRefresh&&(this.parent.treeGrid.parentData=[],this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&(this.parent.undoRedoModule.isPreventRowDeselectOnUndoRedo=!0),this.parent.treeGrid.refresh(),this.isTreeGridRefresh=!1),this.parent.editedRecords=[]},P.prototype.updateResoures=function(e,t,i){var a=this.parent.flatData,n=t?t.length:0,r=this.getValueOrFallback(e,"length",0);if(0!==n||0!==r){for(var s=0;s<n;s++){var o,l=[];if("NaN"===(c=parseInt(t[s][this.parent.resourceFields.id],10).toString())&&(c=t[s][this.parent.resourceFields.id]),!ne.isNullOrUndefined(e))for(var d=0;d<e.length;d++){var h=parseInt(e[d][this.parent.resourceFields.id],10).toString();if((h="NaN"===h?e[d][this.parent.resourceFields.id]:h)===c){l.push(d);break}}0===l.length?(o=a[this.parent.getTaskIds().indexOf("R"+c)])&&this.addNewRecord(i,o):("NaN"===(o=parseInt(l[0].toString(),10)).toString()&&(o=l[0].toString()),e.splice(o,1))}for(var p=this.getValueOrFallback(e,"length",0),s=0;s<p;s++){var u=i.ganttProperties.taskId,c=e[s][this.parent.resourceFields.id],g=a[this.parent.getTaskIds().indexOf("R"+c)];if(!ne.isNullOrUndefined(g))for(var f=0;f<g.childRecords.length;f++)g.childRecords[f].ganttProperties.taskId===u&&this.removeChildRecord(g.childRecords[f])}0<n&&(r=this.parent.getParentTask(i.parentItem))&&r.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.removeChildRecord(i),0===n&&this.checkWithUnassignedTask(i),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.flatData[this.parent.flatData.length-1].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&!this.isFlatDataHaveUnAsignedTask&&(this.parent.removeRecords(this.parent.flatData.length-1),this.parent.currentViewData.splice(this.parent.currentViewData.length-1,1),this.parent.taskIds.splice(this.parent.flatData.length-1,1),this.parent.ids.splice(this.parent.flatData.length-1,1)),this.isFlatDataHaveUnAsignedTask=!1}},P.prototype.checkWithUnassignedTask=function(t){for(var e,i=null,a=0;a<this.parent.flatData.length;a++)this.parent.flatData[a].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&(i=this.parent.flatData[a]);ne.isNullOrUndefined(i)?((n={})[this.parent.taskFields.id]=0,n[this.parent.taskFields.name]=this.parent.localeObj.getConstant("unassignedTask"),e=this.parent.isOnEdit,this.parent.isOnEdit=!1,n=this.parent.dataOperation.createRecord(n,0),this.parent.isOnEdit=e,this.addRecordAsBottom(n),e=this.parent.flatData[this.parent.flatData.length-1],n=this.parent.flatData.indexOf(e)+1+e.childRecords.length,t.index=n,t.level=e.level+1,this.addNewRecord(t,e)):(this.addNewRecord(t,i),this.isFlatDataHaveUnAsignedTask=!0);var n=this.parent.currentViewData.filter(function(e){return e.ganttProperties.taskId===t.ganttProperties.taskId&&e.hasChildRecords===t.hasChildRecords})[0];t.parentItem=n.parentItem,t.parentUniqueID=n.parentUniqueID},P.prototype.addRecordAsBottom=function(e){var t=this.parent.flatData.length,i=(this.parent.currentViewData.splice(t+1,0,e),this.parent.insertRecord(e,t+1),this.parent.ids.splice(t+1,0,e.ganttProperties.rowUniqueID.toString()),0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId);this.parent.getTaskIds().splice(t+1,0,i),this.updateTreeGridUniqueID(e,"add")},P.prototype.addNewRecord=function(e,t){var i=null,i=ne.extend({},{},e,!0),a=(this.parent.setRecordValue("uniqueID",this.parent.dataOperation.getGanttUid(this.parent.element.id+"_data_"),i),this.parent.setRecordValue("uniqueID",i.uniqueID,i.ganttProperties,!0),i.uniqueID.replace(this.parent.element.id+"_data_","")),n=(this.parent.setRecordValue("rowUniqueID",a,i),this.parent.setRecordValue("rowUniqueID",a,i.ganttProperties,!0),this.parent.setRecordValue("level",1,i),this.parent.taskFields.parentID&&this.parent.setRecordValue("parentId",t.ganttProperties.taskId,i.ganttProperties,!0),this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(t),i),this.getValueOrFallback(i.parentItem,"uniqueID",null));this.parent.setRecordValue("parentUniqueID",n,i),e.ganttProperties.sharedTaskUniqueIds.push(a),i.ganttProperties.sharedTaskUniqueIds=e.ganttProperties.sharedTaskUniqueIds,this.addRecordAsChild(t,i)},P.prototype.removeChildRecord=function(e){var t=this.parent,i=[],i=this.parent.dataSource instanceof U.DataManager&&0<this.parent.dataSource.dataSource.json.length?this.parent.dataSource.dataSource.json:this.parent.currentViewData,a=this.parent.dataSource,n=e,e=this.parent.getParentTask(n.parentItem);if(n){n.parentItem&&(d=0,r=this.getValueOrFallback(e,"childRecords",[]))&&0<r.length&&(1===r.length&&(this.parent.isOnDelete=!0,r[0].isDelete=!0,this.parent.dataOperation.updateParentItems(e),this.parent.isOnDelete=!1,r[0].isDelete=!1),d=r.indexOf(n),e.childRecords.splice(d,1),this.updateParentRecords.push(e)),n.ganttProperties.sharedTaskUniqueIds.length&&(r=n.ganttProperties.sharedTaskUniqueIds.indexOf(n.ganttProperties.rowUniqueID),n.ganttProperties.sharedTaskUniqueIds.splice(r,1)),this.updateTreeGridUniqueID(n,"delete"),this.parent.taskFields.parentID||((d=[]).push(n.ganttProperties.rowUniqueID.toString()),"ProjectView"===this.parent.viewType&&this.parent.editModule.removeFromDataSource(d));var r=this.parent.flatData.indexOf(n);if(t.taskFields.parentID){for(var s=void 0,o=this.parent.currentViewData,l=0;l<o.length;l++)o[l].ganttProperties.rowUniqueID===n.ganttProperties.rowUniqueID&&(s=l);-1!==s&&(0<a.length&&a.splice(s,1),i.splice(s,1),this.parent.removeRecords(r),this.parent.ids.splice(r,1),this.parent.getTaskIds().splice(r,1))}var d=i.indexOf(n);t.taskFields.parentID||(a=this.parent.editModule.getChildCount(n,0),i.splice(d,a+1),this.parent.removeRecords(r,a+1),this.parent.ids.splice(r,a+1),this.parent.getTaskIds().splice(r,a+1)),n.parentItem&&e&&e.childRecords&&!e.childRecords.length&&(this.parent.setRecordValue("expanded",!1,e),this.parent.setRecordValue("hasChildRecords",!1,e))}},P.prototype.addRecordAsChild=function(e,t){var i,a,n=this.parent,r=this.parent.flatData.indexOf(e),s=this.parent.editModule.getChildCount(e,0),o=this.parent.getTaskByUniqueID(t.parentItem.uniqueID);if(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.dialogModule.indexes&&this.dialogModule.indexes.deletedIndexes&&0<this.dialogModule.indexes.deletedIndexes.length)if(o.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask"))h=this.parent.taskIds.length+1;else for(var l=0;l<this.dialogModule.indexes.deletedIndexes.length;l++){if(this.dialogModule.indexes.deletedIndexes[l].data.parentUniqueID===t.parentUniqueID&&t.ganttProperties.taskId===this.dialogModule.indexes.deletedIndexes[l].data.ganttProperties.taskId){for(var d=this.dialogModule.indexes.deletedIndexes[l].index,h="above"===this.dialogModule.indexes.deletedIndexes[l].position?d:d+1,p=0;p<e.childRecords.length;p++)if("T"+e.childRecords[p].ganttProperties.taskId===this.dialogModule.indexes.deletedIndexes[l].id){i="above"===this.dialogModule.indexes.deletedIndexes[l].position?p:p+1;break}break}if(this.dialogModule.indexes.deletedIndexes[l].data.parentUniqueID!==t.parentUniqueID&&t.ganttProperties.taskId===this.dialogModule.indexes.deletedIndexes[l].data.ganttProperties.taskId){d=this.parent.getTaskByUniqueID(t.parentItem.uniqueID);h=d.index+d.childRecords.length+1;break}}else if(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&o.ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask")&&this.parent.undoRedoModule.currentAction.deletedRecordsDetails){for(p=0;p<this.parent.undoRedoModule.currentAction.deletedRecordsDetails.length;p++)if(this.parent.undoRedoModule.currentAction.deletedRecordsDetails[p].data.ganttProperties.taskId===t.ganttProperties.taskId){i=o.index?(h=this.parent.undoRedoModule.currentAction.deletedRecordsDetails[p].data.index)-o.index-1:(h=ne.isNullOrUndefined(s)||0===s?r+1:s+r+1,0);break}}else h=!ne.isNullOrUndefined(this.addRowIndex)&&this.addRowPosition&&e.childRecords&&"Child"!==this.addRowPosition?(u=e.childRecords[this.addRowIndex],a="Above"===this.addRowPosition||"Below"===this.addRowPosition?this.addRowPosition:"Child",h=u?this.addRowIndex+r+1:s+r+1,"Above"===a?h:h+1):ne.isNullOrUndefined(s)||0===s?r+1:s+r+1;this.parent.currentViewData.splice(h,0,t),this.parent.insertRecord(t,h),this.parent.ids.splice(h,0,t.ganttProperties.rowUniqueID.toString()),this.updateTreeGridUniqueID(t,"add");var u=0===t.level?"R"+t.ganttProperties.taskId:"T"+t.ganttProperties.taskId;this.parent.getTaskIds().splice(h,0,u),e.hasChildRecords||(this.parent.setRecordValue("hasChildRecords",!0,e),this.parent.setRecordValue("expanded",!0,e),e.childRecords.length)||(e.childRecords=[],!n.taskFields.parentID&&ne.isNullOrUndefined(e.taskData[this.parent.taskFields.child])&&(e.taskData[this.parent.taskFields.child]=[])),0<=i?e.childRecords.splice(i,0,t):e.childRecords.splice(e.childRecords.length,0,t),ne.isNullOrUndefined(t)||this.parent.taskFields.parentID||ne.isNullOrUndefined(e.taskData[this.parent.taskFields.child])||e.taskData[this.parent.taskFields.child].splice(e.childRecords.length,0,t.taskData),ne.isNullOrUndefined(t.parentItem)||this.updateParentRecords.push(e)},P.prototype.resetEditProperties=function(e){this.parent.currentEditedArgs={},this.resetValidateArgs(),this.parent.isOnEdit=!1,this.parent.predecessorModule.validatedChildItems=[],this.parent.isConnectorLineUpdate=!1,this.parent.editedPredecessorRecords=[],this.taskbarMoved=!1,this.predecessorUpdated=!1,ne.isNullOrUndefined(this.dialogModule)||!ne.isNullOrUndefined(e)&&(ne.isNullOrUndefined(e)||"beforeSave"!==e.requestType||e.cancel)||(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose()),this.parent.hideSpinner(),this.parent.initiateEditAction(!1)},P.prototype.endEditAction=function(e){this.resetEditProperties(),"TaskbarEditing"===e.action?(e.target=this.taskbarEditModule.editElement,this.parent.trigger("taskbarEdited",e)):"CellEditing"===e.action?this.parent.trigger("endEdit",e):"DialogEditing"===e.action&&(this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose())},P.prototype.saveFailed=function(e){this.reUpdatePreviousRecords(),this.parent.hideSpinner()},P.prototype.renderDeleteConfirmDialog=function(){var e=new E.Dialog({width:"320px",isModal:!0,visible:!1,enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("confirmDelete"),buttons:[{click:this.confirmDeleteOkButton.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("okText"),isPrimary:!0}},{click:this.closeConfirmDialog.bind(this),buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],target:this.parent.element,animationSettings:{effect:"None"}});e.appendTo("#"+this.parent.element.id+"_deleteConfirmDialog"),this.confirmDialog=e},P.prototype.closeConfirmDialog=function(){this.confirmDialog.hide()},P.prototype.confirmDeleteOkButton=function(){this.deleteSelectedItems(),this.confirmDialog.hide(),this.parent.element.querySelector(".e-treegrid").focus()},P.prototype.startDeleteAction=function(){this.parent.editSettings.allowDeleting&&!this.parent.readOnly&&(this.parent.editSettings.showDeleteConfirmDialog?this.confirmDialog.show():(this.deleteSelectedItems(),this.parent.element.querySelector(".e-treegrid").focus()))},P.prototype.deleteResourceRecords=function(n){for(var r=this,s=[],o=this,e=0;e<n.length;e++)!function(t){if(n[t].parentItem)if(1===n[t].ganttProperties.sharedTaskUniqueIds.length){for(var e=n[t],i=e.ganttProperties.sharedTaskUniqueIds,a=0;a<i.length;a++)-1!==o.parent.ids.indexOf(i[a].toString())?s.push(o.parent.flatData[o.parent.ids.indexOf(i[a].toString())]):o.parent.undoRedoModule&&o.parent.undoRedoModule.isUndoRedoPerformed&&o.parent.undoRedoModule.currentAction&&"Delete"===o.parent.undoRedoModule.currentAction.action&&s.push(o.parent.flatData[o.parent.taskIds.indexOf("T"+n[t].ganttProperties.taskId)]);-1!==o.parent.ids.indexOf(e.ganttProperties.rowUniqueID)&&-1===s.indexOf(o.parent.flatData[o.parent.ids.indexOf(e.ganttProperties.rowUniqueID)])&&s.push(o.parent.flatData[o.parent.ids.indexOf(e.ganttProperties.rowUniqueID)])}else 1<n[t].ganttProperties.sharedTaskUniqueIds.length&&n.forEach(function(e){e.ganttProperties.sharedTaskUniqueIds.forEach(function(e){s.push(r.parent.getTaskByUniqueID(r.parent.element.id+"_data_"+e))})});else{e=o.parent.flatData.filter(function(e){return e.ganttProperties.taskId===n[t].ganttProperties.taskId&&e.hasChildRecords})[0];ne.isNullOrUndefined(e)||s.push(e)}}(e);this.deleteRow(s)},P.prototype.add=function(e,t){if(t.push(e),e.hasChildRecords)for(var i=e.childRecords,a=0;a<i.length;a++)this.add(i[a],t);else-1===t.indexOf(e)&&t.push(e)},P.prototype.deleteSelectedItems=function(){var e;this.isFromDeleteMethod?(this.targetedRecords.length&&("ResourceView"===this.parent.viewType?this.deleteResourceRecords(this.targetedRecords):this.deleteRow(this.targetedRecords)),this.isFromDeleteMethod=!1):(e=[],"Cell"!==this.parent.selectionSettings.mode?e=this.parent.selectionModule.getSelectedRecords():"Cell"===this.parent.selectionSettings.mode&&(e=this.parent.selectionModule.getCellSelectedRecords()),"ResourceView"===this.parent.viewType?this.deleteResourceRecords(e):this.deleteRow(e))},P.prototype.deleteRecord=function(e){this.isFromDeleteMethod=!0;var t=typeof e;switch(this.targetedRecords=[],t){case"number":case"string":var i=e.toString();"ResourceView"===this.parent.viewType?ne.isNullOrUndefined(i)||-1===this.parent.getTaskIds().indexOf("T"+i)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i)]):ne.isNullOrUndefined(i)||-1===this.parent.ids.indexOf(i)||this.targetedRecords.push(this.parent.getRecordByID(i));break;case"object":Array.isArray(e)?this.updateTargetedRecords(e):this.targetedRecords.push(e.valueOf())}this.startDeleteAction()},P.prototype.updateTargetedRecords=function(e){if(e.length)if("object"==typeof e[0])this.targetedRecords=e;else for(var t=0;t<e.length;t++){var i=e[t].toString();"ResourceView"===this.parent.viewType?ne.isNullOrUndefined(i)||-1===this.parent.getTaskIds().indexOf("T"+i)||this.targetedRecords.push(this.parent.flatData[this.parent.getTaskIds().indexOf("T"+i)]):ne.isNullOrUndefined(i)||-1===this.parent.ids.indexOf(i)||this.targetedRecords.push(this.parent.getRecordByID(i))}},P.prototype.deleteRow=function(e){var t=this,l=e&&e.length?e:this.parent.selectionModule.getSelectedRecords();if(this.parent.addDeleteRecord=!0,l.length){this.parent.isOnDelete=!0,l.forEach(function(e){t.parent.undoRedoModule&&t.parent.undoRedoModule.isUndoRedoPerformed&&(("ProjectView"===t.parent.viewType?t.parent.getRecordByID(e.ganttProperties.taskId):t.parent.flatData[t.parent.taskIds.indexOf((e.hasChildRecords?"R":"T")+e.ganttProperties.taskId)]).isDelete=!0),e.isDelete=!0}),"ResourceView"!==this.parent.viewType||e.length||(l=[]),this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent("Delete")&&(this.parent.undoRedoModule.redoEnabled&&!this.parent.undoRedoModule.isUndoRedoPerformed&&(this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.getUndoCollection[0]=[]),this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.undoRedoModule.createUndoCollection(),e={action:"Delete",deletedRecordsDetails:[]},this.parent.undoRedoModule.findPosition(ne.extend([],[],l,!0),e,"deletedRecordsDetails"),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=e);for(var d=this,i=0;i<l.length;i++)!function(e){var t=l[e];if(-1!==d.deletedTaskDetails.indexOf(t))return;var i,a=[t];"ResourceView"===d.parent.viewType&&d.parent.undoRedoModule&&d.parent.undoRedoModule.isUndoRedoPerformed&&l[e].ganttProperties.resourceInfo&&1<l[e].ganttProperties.resourceInfo.length&&(a=[],l[e].hasChildRecords||(i="T"+l[e].ganttProperties.taskId,d.parent.taskIds.reduce(function(e,t){e===i&&a.push(this.parent.flatData[t])}.bind(d),[])));for(var n=0;n<a.length;n++){var r=d.parent.getParentTask(a[n].parentItem),s=(a[n].parentItem&&(s=void 0,ne.isNullOrUndefined(r)||0<(1===(s=r.childRecords).length?s:s.filter(function(e){return!e.isDelete})).length&&d.parent.dataOperation.updateParentItems(a[n].parentItem)),a[n].ganttProperties.predecessor),o=!0;"ResourceView"===d.parent.viewType&&r&&r.ganttProperties.taskName!==d.parent.localeObj.getConstant("unassignedTask")&&(o=!1),s&&s.length&&o&&d.removePredecessorOnDelete(a[n]),d.deletedTaskDetails.push(a[n]),a[n].hasChildRecords&&d.deleteChildRecords(a[n])}}(i);this.parent.selectionModule&&this.parent.allowSelection&&this.parent.selectionModule.clearSelection();e={};e.deletedRecordCollection=this.deletedTaskDetails,e.updatedRecordCollection=this.parent.editedRecords,e.cancel=!1,e.action="delete",this.initiateDeleteAction(e),this.parent.isOnDelete=!1}ne.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},P.prototype.removePredecessorOnDelete=function(c){for(var g=this,f=c.ganttProperties.predecessor,m=this,e=0;e<f.length;e++)!function(e){var t=f[e],i=m.resolveCondition("ResourceView"===m.parent.viewType,c.ganttProperties.taskId,c.ganttProperties.rowUniqueID),e=m.parent.rowDragAndDropModule&&"middleSegment"===m.parent.rowDragAndDropModule.dropPosition||m.dropPosition&&"middleSegment"===m.dropPosition,a=c.hasChildRecords&&c.childRecords.some(function(e){return t.to.toString()===e[g.parent.taskFields.id].toString()}),n=c.hasChildRecords&&c.childRecords.some(function(e){return t.from.toString()===e[g.parent.taskFields.id].toString()});if(t.from.toString()===i.toString()&&(a&&e||m.parent.isOnDelete)){var r=m.parent.connectorLineModule.getRecordByID(t.to.toString());if(!ne.isNullOrUndefined(r)){for(var s=ne.extend([],[],r.ganttProperties.predecessor,!0),o=void 0,l=0;l<s.length;l++){var d=m.resolveCondition("ResourceView"===m.parent.viewType,r.ganttProperties.taskId,r.ganttProperties.rowUniqueID);if(s[l].to.toString()===d.toString()&&s[l].from.toString()===i.toString()){o=l;break}}s.splice(o,1),m.updatePredecessorValues(r,s)}}else if(t.to.toString()===i.toString()&&(n&&e||m.parent.isOnDelete)){var h=m.parent.connectorLineModule.getRecordByID(t.from.toString());if(!ne.isNullOrUndefined(h)){for(var p=ne.extend([],[],h.ganttProperties.predecessor,!0),o=void 0,l=0;l<p.length;l++){var u=m.resolveCondition("ResourceView"===m.parent.viewType,h.ganttProperties.taskId,h.ganttProperties.rowUniqueID);if(p[l].from.toString()===u.toString()&&p[l].to.toString()===i.toString()){o=l;break}}c.uniqueID!==h.parentUniqueID&&c.parentUniqueID!==h.uniqueID&&!m.parent.isOnDelete||(p.splice(o,1),m.updatePredecessorValues(h,p))}}}(e)},P.prototype.updatePredecessorValues=function(e,t){this.parent.setRecordValue("predecessor",t,e.ganttProperties,!0);t=this.parent.predecessorModule.getPredecessorStringValue(e);this.parent.setRecordValue("predecessorsName",t,e.ganttProperties,!0),this.parent.setRecordValue("taskData."+this.parent.taskFields.dependency,t,e),this.parent.setRecordValue(this.parent.taskFields.dependency,t,e)},P.prototype.updateTaskId=function(e,t){if(!this.parent.readOnly){var i=this.resolveCondition("number"==typeof e,e.toString(),e),a="number"==typeof t?t.toString():t,n=this.parent.ids;if(!ne.isNullOrUndefined(i)&&!ne.isNullOrUndefined(a)){var e=n.indexOf(i),r=n.indexOf(a);if(!(-1===e||-1<r)){r=this.parent.flatData[e];if(ne.isNullOrUndefined(r)||(this.parent.setRecordValue("taskId",t,r.ganttProperties,!0),this.parent.setRecordValue("rowUniqueID",a,r.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.id,t,r,!0),this.parent.setRecordValue(this.parent.taskFields.id,t,r.taskData,!0)),n[e]=a,r.hasChildRecords&&this.parent.taskFields.parentID)for(var s=r.childRecords,o=0;o<s.length;o++){var l=s[o];l[this.parent.taskFields.parentID]=t,this.parent.chartRowsModule.refreshRecords([l])}if(this.parent.taskFields.dependency&&!ne.isNullOrUndefined(r.ganttProperties.predecessor))for(var d=r.ganttProperties.predecessor,h=void 0,p=0;p<d.length;p++){var u=d[p];u.to===i?h=this.parent.flatData[n.indexOf(u.from)]:u.from===i&&(h=this.parent.flatData[n.indexOf(u.to)]),this.updatePredecessorOnUpdateId(h,i,a)}this.parent.treeGrid.parentData=[],this.parent.treeGrid.refresh()}}}},P.prototype.updatePredecessorOnUpdateId=function(e,t,i){if(-1<this.parent.flatData.indexOf(e))for(var a=e.ganttProperties.predecessor,n=0;n<a.length;n++){var r=a[n];r.to===t?r.to=i:r.from===t&&(r.from=i)}this.updatePredecessorValues(e,e.ganttProperties.predecessor)},P.prototype.deleteChildRecords=function(e){for(var t=this,i=e.childRecords,a=0;a<i.length;a++){var n,r,s,o=i[a];-1===this.deletedTaskDetails.indexOf(o)&&(n=o.ganttProperties.predecessor,r=!0,s=this.parent.getParentTask(o.parentItem),"ResourceView"===this.parent.viewType&&s&&s.ganttProperties.taskName!==this.parent.localeObj.getConstant("unassignedTask")&&(r=!1),n&&n.length&&r&&this.removePredecessorOnDelete(o),!ne.isNullOrUndefined(o.ganttProperties.sharedTaskUniqueIds)&&1<o.ganttProperties.sharedTaskUniqueIds.length?o.ganttProperties.sharedTaskUniqueIds.forEach(function(e){t.deletedTaskDetails.push(t.parent.getTaskByUniqueID(t.parent.element.id+"_data_"+e))}):this.deletedTaskDetails.push(o),o.hasChildRecords)&&this.deleteChildRecords(o)}},P.prototype.removeFromDataSource=function(e){var t=this.parent.dataSource instanceof U.DataManager?this.parent.dataSource.dataSource.json:this.parent.dataSource;this.removeData(t,e),this.isBreakLoop=!1},P.prototype.removeData=function(e,t){for(var i,a=0;a<e.length&&!this.isBreakLoop;a++)if(-1!==t.indexOf(ne.getValue(this.parent.taskFields.id,e[a]).toString())){if(e[a][this.parent.taskFields.child]&&(i=e[a][this.parent.taskFields.child],this.removeData(i,t)),t.splice(t.indexOf(ne.getValue(this.parent.taskFields.id,e[a]).toString()),1),e.splice(a,1),0===t.length){this.isBreakLoop=!0;break}}else e[a][this.parent.taskFields.child]&&(i=e[a][this.parent.taskFields.child],this.removeData(i,t))},P.prototype.initiateDeleteAction=function(p){var u=this,e=(this.parent.showSpinner(),{});e.requestType="beforeDelete",e.data=p.deletedRecordCollection,e.modifiedRecords=p.updatedRecordCollection,e.modifiedTaskData=Z(p.updatedRecordCollection,null,null,this.parent),this.parent.trigger("actionBegin",e,function(e){if(e.cancel){for(var t=u.deletedTaskDetails,i=0;i<t.length;i++)t[i].isDelete=!1;u.deletedTaskDetails=[],u.reUpdatePreviousRecords(),u.parent.initiateEditAction(!1),u.parent.hideSpinner()}else if(u.parent.showLoadingIndicator(),_(u.parent.dataSource)){var n=u.parent.dataSource,r=(u.parent.timezone&&e.modifiedRecords.forEach(function(e){X(e,u.parent)}),{deletedRecords:Z(e.data,null,null,u.parent),changedRecords:e.modifiedTaskData}),e=n.adaptor,s=u.parent.query instanceof U.Query?u.parent.query:new U.Query;if(!(e instanceof U.WebApiAdaptor||e instanceof U.ODataAdaptor||e instanceof U.ODataV4Adaptor||e instanceof U.GraphQLAdaptor)||n.dataSource.batchUrl)n.saveChanges(r,u.parent.taskFields.id,null,s).then(function(){return u.deleteSuccess(p)}).catch(function(e){return u.dmFailure(e,p)});else{for(var a="deletedRecords",o=null,l=u.parent.taskFields.id,d=0;d<r[a].length;d++)var h=r[a][d][l],o=n.remove(l,h,null,s);o.then(function(){for(var i="changedRecords",e=r[i].length-1;0<=e;e--)!function(t){r.deletedRecords.some(function(e){return e[u.parent.taskFields.id]===r[i][t][l]})&&r[i].splice(t,1)}(e);for(var a=Promise.resolve(),e=0;e<r[i].length;e++)!function(e){var t=r[i][e];a=a.then(function(){return n.update(l,t,null,s)})}(e);a.then(function(){return u.deleteSuccess(p)}).catch(function(e){return u.dmFailure(e,p)})}).catch(function(e){return u.dmFailure(e,p)})}}else u.deleteSuccess(p)})},P.prototype.deleteSuccess=function(e){for(var n=this,t=this.parent.flatData,i=this.parent.currentViewData,a=[],r=0;r<e.deletedRecordCollection.length;r++)if("ProjectView"===this.parent.viewType){var s=this.parent.getRecordByID(e.deletedRecordCollection[r].ganttProperties.taskId);ne.isNullOrUndefined(s)||a.push(s)}else{var o=e.deletedRecordCollection[r].hasChildRecords,l=e.deletedRecordCollection[r].ganttProperties.taskName===this.parent.localeObj.getConstant("unassignedTask"),d=!e.deletedRecordCollection[r].expanded;if(o&&l&&d)return this.parent.hideLoadingIndicator(),this.deletedTaskDetails=[],void this.parent.initiateEditAction(!1);e.deletedRecordCollection[r].hasChildRecords?"R"+e.deletedRecordCollection[r].ganttProperties.taskId:"T"+e.deletedRecordCollection[r].ganttProperties.taskId,a.push(this.parent.getTaskByUniqueID(e.deletedRecordCollection[r].uniqueID))}var h=[];0<a.length&&(this.parent.regenerateCycles=!0,s=D=void 0,this.parent.enableVirtualization?(D=this.parent.flatData.indexOf(a[a.length-1]),this.parent.staticSelectedRowIndex=this.parent.selectedRowIndex=D,s=this.parent.flatData[this.parent.selectedRowIndex+1],this.parent.isCollapseAll||(this.parent.staticSelectedRowIndex=D-(a.length-1))):(D=this.parent.currentViewData.indexOf(a[a.length-1]),this.parent.staticSelectedRowIndex=this.parent.selectedRowIndex=D,s=this.parent.currentViewData[this.parent.selectedRowIndex+1]),ne.isNullOrUndefined(s)?0<=(D=this.parent.selectedRowIndex-1)&&(this.parent.currentSelection=(this.parent.enableVirtualization?this.parent.flatData:this.parent.currentViewData)[D]):this.parent.currentSelection=s),this.deletedRecord=a;for(r=0;r<a.length;r++){var p=a[r],u=void 0,c=void 0,g=void 0,f=("ResourceView"===this.parent.viewType?c=p.hasChildRecords?(u=this.parent.taskIds.indexOf("R"+p.ganttProperties.taskId.toString()),this.parent.taskIds.indexOf("R"+p.ganttProperties.taskId.toString())):(u=this.parent.taskIds.indexOf("T"+p.ganttProperties.taskId.toString()),this.parent.taskIds.indexOf("T"+p.ganttProperties.taskId.toString())):(u=i.indexOf(p),c=t.indexOf(p),this.parent.editModule&&this.parent.editModule.updateParentRecords&&0<this.parent.editModule.updateParentRecords.length&&(g=this.parent.editModule.updateParentRecords.indexOf(p))),this.parent.treeGrid.parentData.indexOf(p)),m=ne.getValue("dataOperation.dataArray",this.parent),y=m.indexOf(p.taskData);-1!==u&&i.splice(u,1),-1!==c&&this.parent.removeRecords(c),-1!==y&&m.splice(y,1),"number"==typeof g&&-1!==g&&this.parent.editModule.updateParentRecords.splice(g,1),ne.isNullOrUndefined(p)||(h.push(p.ganttProperties.taskId.toString()),-1!==c&&(this.parent.ids.splice(c,1),"ResourceView"===this.parent.viewType)&&(this.parent.getTaskIds().splice(c,1),p.hasChildRecords||(p.ganttProperties.resourceInfo=null,delete p.ganttProperties.resourceNames,p[this.parent.taskFields.resourceInfo]=null,p.ganttProperties.sharedTaskUniqueIds=[],delete p.taskData[this.parent.taskFields.resourceInfo])),0===p.level&&-1!==f&&this.parent.treeGrid.parentData.splice(f,1),p.parentItem&&(u=this.parent.getParentTask(p.parentItem))&&(-1!==(y=(m=u.childRecords).indexOf(p))&&m.splice(y,1),m.length||this.parent.setRecordValue("hasChildRecords",!1,u)),this.updateTreeGridUniqueID(p,"delete"))}0<h.length&&this.removeFromDataSource(h),this.updateRowIndex();var D={};if(this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.treeGrid.parentData=[],this.isAdded=!1,this.parent.treeGrid.editModule&&(this.parent.treeGrid.editModule.isOnBatch=!1),this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&this.refreshRecordInImmutableMode(),D.requestType="delete",D.data=e.deletedRecordCollection,D.modifiedRecords=e.updatedRecordCollection,D.modifiedTaskData=Z(e.updatedRecordCollection,null,null,this.parent),ne.setValue("action",e.action,D),this.parent.isOnDelete=!1,"ResourceView"===this.parent.viewType&&(!this.parent.undoRedoModule||this.parent.undoRedoModule&&(!this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.undoRedoModule.isUndoRedoPerformed&&"Delete"===this.parent.undoRedoModule.currentAction.action)))for(var k=D.data.filter(function(e){return!e.hasChildRecords}),T=this,r=0;r<k.length;r++)!function(t){var i=T.parent.flatData.filter(function(e){return e.ganttProperties.taskName===n.parent.localeObj.getConstant("unassignedTask")})[0],e=[],a=(i&&(e=i.childRecords.filter(function(e){return e.ganttProperties.taskId===k[t].ganttProperties.taskId})),T.parent.getParentTask(k[t].parentItem)),a=((!a||a.ganttProperties.taskName===T.parent.localeObj.getConstant("unassignedTask")||0!==e.length)&&(a||e&&0!==e.length)||T.checkWithUnassignedTask(k[t]),i=T.parent.flatData.filter(function(e){return e.ganttProperties.taskName===n.parent.localeObj.getConstant("unassignedTask")})[0],T.parent.currentViewData.filter(function(e){return e.ganttProperties.taskId===k[t].ganttProperties.taskId&&!e.hasChildRecords&&e.parentItem&&i.uniqueID===e.parentItem.uniqueID?e:null}));a[0]&&T.parent.dataOperation.updateParentItems(a[0])}(r);this.parent.trigger("actionComplete",D),this.deletedTaskDetails=[],this.parent.initiateEditAction(!1),this.parent.hideLoadingIndicator(),this.parent.hideSpinner()},P.prototype.getNewTaskId=function(){var e="ResourceView"===this.parent.viewType?this.parent.getTaskIds():this.parent.ids,t=e.length,i=this.parent.dataOperation.isTaskIDInteger&&0<this.parent.ids.length?Math.max.apply(null,this.parent.ids.map(function(e){return Number(e)})):t+1;if("ResourceView"===this.parent.viewType){if(!(-1===e.indexOf("T"+i)&&-1===e.indexOf("R"+i)||-1===e.indexOf("T"+(i+=1))&&-1===e.indexOf("R"+i)))for(;-1!==e.indexOf("T"+(i+=1))||-1!==e.indexOf("R"+i););}else if(-1!==e.indexOf(i.toString())&&-1!==e.indexOf((i+=1).toString()))for(;-1!==e.indexOf((i+=1).toString()););return"string"===this.parent.columnByField[this.parent.taskFields.id].type&&"stringedit"===this.parent.columnByField[this.parent.taskFields.id].editType?i.toString():i},P.prototype.prepareNewlyAddedData=function(e,t){var i=this.parent.taskFields,a=this.parent.ids;e[i.id]&&(-1!==a.indexOf(e[i.id].toString())?e[i.id]=null:(a="string"==typeof e[i.id]?e[i.id]:parseInt(e[i.id],10),e[i.id]=this.resolveCondition(ne.isNullOrUndefined(a),null,a))),e[i.id]||(a=this.getNewTaskId(),e[i.id]=a),this.parent.allowUnscheduledTasks||e[i.startDate]||(e[i.startDate]=this.parent.projectStartDate),!this.parent.allowUnscheduledTasks&&i.duration&&ne.isNullOrUndefined(e[i.duration])&&!e[i.endDate]&&(e[i.duration]="5"),i.progress&&(e[i.progress]=e[i.progress]?this.resolveCondition(100<e[i.progress],100,e[i.progress]):0),this.parent.allowUnscheduledTasks||e[i.endDate]||!i.endDate||e[i.duration]||(a=this.parent.dataOperation.getDateFromFormat(this.parent.projectStartDate),ne.isNullOrUndefined(a))||(a.setDate(a.getDate()+4),e[i.endDate]=this.parent.getFormatedDate(a,this.parent.getDateFormat()))},P.prototype.processPredecessors=function(e,t){if(e.ganttProperties.predecessorsName&&(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.predecessorModule.ensurePredecessorCollectionHelper(e,e.ganttProperties),this.parent.predecessorModule.updatePredecessorHelper(e),this.parent.predecessorModule.validatePredecessorDates(e)),e.childRecords&&0<e.childRecords.length&&t)for(var i=0;i<e.childRecords.length;i++)this.processPredecessors(e.childRecords[i],t)},P.prototype.updateNewlyAddedDataBeforeAjax=function(e,t,i,a,n){var r=this.parent.dataOperation.createRecord(e,t);switch(i){case"Above":r.index=n;break;case"Below":case"Child":r.index=n+1;break;case"Bottom":r.index=(this.parent.enableVirtualization?this.parent.flatData:this.parent.currentViewData).length;break;case"Top":r.index=0}if(ne.isNullOrUndefined(a)||(this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(a),r),p=this.getValueOrFallback(r.parentItem,"index",null),this.parent.setRecordValue("parentIndex",p,r),u=this.getValueOrFallback(r.parentItem,"uniqueID",null),this.parent.setRecordValue("parentUniqueID",u,r),ne.isNullOrUndefined(this.parent.taskFields.id))||ne.isNullOrUndefined(this.parent.taskFields.parentID)||!r.parentItem||("ProjectView"===this.parent.viewType&&this.parent.setRecordValue(this.parent.taskFields.parentID,r.parentItem.taskId,r.taskData,!0),this.parent.setRecordValue("parentId",r.parentItem.taskId,r.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.parentID,r.parentItem.taskId,r,!0)),this.parent.isOnEdit=!0,this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed)if(e.hasChildRecords){for(var s=[],o=this.parent.undoRedoModule.currentAction.deletedRecordsDetails,l=0;l<e.childRecords.length;l++)this.add(e.childRecords[l],s);for(var d=0;d<o.length;d++)if(e.ganttProperties.taskId===o[d].data.ganttProperties.taskId){"child"===o[d].position?i="Child":"below"===o[d].position?i="Below":"above"===o[d].position&&(i="Above"),this.backUpAndPushNewlyAddedRecord(r,i,a);for(l=0;l<s.length;l++)"ProjectView"===this.parent.viewType?s[l].parentItem.taskId===r.ganttProperties.taskId&&(s[l].parentItem.index=r.index,s[l].parentItem.taskId=r.ganttProperties.taskId,s[l].parentItem.uniqueID=r.ganttProperties.uniqueID,s[l].parentUniqueID=r.ganttProperties.uniqueID):(s[l].parentItem.index=r.index,s[l].parentItem.taskId=r.ganttProperties.rowUniqueID,s[l].parentItem.uniqueID=r.ganttProperties.uniqueID,s[l].parentUniqueID=r.ganttProperties.uniqueID);break}(this.addRowSelectedItem=r).taskData[this.parent.taskFields.child]=[];for(var h=0;h<s.length;h++){this.parent.isOnEdit=!1;var p,u,c=this.parent.dataOperation.createRecord(s[h],s[h].level);0===c.childRecords.length&&c.taskData[this.parent.taskFields.child]&&(c.taskData[this.parent.taskFields.child]=[]),a=this.parent.getRecordByID(s[h].parentItem.taskId),ne.isNullOrUndefined(a)||(this.parent.setRecordValue("parentItem",this.parent.dataOperation.getCloneParent(a),c),p=this.getValueOrFallback(c.parentItem,"index",null),this.parent.setRecordValue("parentIndex",p,c),u=this.getValueOrFallback(c.parentItem,"uniqueID",null),this.parent.setRecordValue("parentUniqueID",u,c),ne.isNullOrUndefined(this.parent.taskFields.id))||ne.isNullOrUndefined(this.parent.taskFields.parentID)||!c.parentItem||("ProjectView"===this.parent.viewType&&this.parent.setRecordValue(this.parent.taskFields.parentID,c.parentItem.taskId,c.taskData,!0),this.parent.setRecordValue("parentId",c.parentItem.taskId,c.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.parentID,c.parentItem.taskId,c,!0)),this.parent.isOnEdit=!0,c.parentItem&&(i=0===a.childRecords.length?"Child":"Below"),0<this.parent.getParentTask(c.parentItem).childRecords.length?this.addRowSelectedItem=this.parent.getParentTask(c.parentItem).childRecords[this.parent.getParentTask(c.parentItem).childRecords.length-1]:this.addRowSelectedItem=this.parent.getParentTask(c.parentItem),this.backUpAndPushNewlyAddedRecord(c,i,a);for(l=0;l<s.length;l++)"ProjectView"===this.parent.viewType?s[l].parentItem.taskId===c.ganttProperties.taskId&&(s[l].parentItem.index=c.index,s[l].parentItem.taskId=c.ganttProperties.taskId,s[l].parentItem.uniqueID=c.ganttProperties.uniqueID,s[l].parentUniqueID=c.ganttProperties.uniqueID):(s[l].parentItem.index=r.index,s[l].parentItem.taskId=r.ganttProperties.rowUniqueID,s[l].parentItem.uniqueID=r.ganttProperties.uniqueID,s[l].parentUniqueID=r.ganttProperties.uniqueID)}}else this.backUpAndPushNewlyAddedRecord(r,i,a);else this.backUpAndPushNewlyAddedRecord(r,i,a);if(this.parent.taskFields.dependency){var g=!(!this.parent.undoRedoModule||!this.parent.undoRedoModule.isUndoRedoPerformed);if(r.ganttProperties.predecessorsName)this.processPredecessors(r,g);else if(!r.ganttProperties.predecessorsName&&0<r.childRecords.length&&g)for(l=0;l<r.childRecords.length;l++)this.processPredecessors(r.childRecords[l],g)}return r.parentItem&&this.parent.getParentTask(r.parentItem).ganttProperties.isAutoSchedule&&this.parent.dataOperation.updateParentItems(r.parentItem),this.parent.isOnEdit=!1,r},P.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var a=0;a<e.childRecords.length;a++)t++,(i=e.childRecords[a]).hasChildRecords&&(t=this.getChildCount(i,t));return t},P.prototype.getVisibleChildRecordCount=function(e,t,i){if(e.hasChildRecords)for(var a,n=(a=e.childRecords).length,r=0;r<n;r++)-1!==i.indexOf(a[r])&&t++,a[r].hasChildRecords&&(t=this.getVisibleChildRecordCount(a[r],t,i));else-1!==i.indexOf(e)&&t++;return t},P.prototype.updatePredecessorOnIndentOutdent=function(e){for(var t=e.ganttProperties.predecessor.length,i=e.ganttProperties,a=i.predecessor,n=0;n<t;n++){var r,s,o,l=this.parent.getRecordByID(a[n].from),d=this.parent.getRecordByID(a[n].to);(o=this.parent.predecessorModule.validateParentPredecessor(l,d))&&this.parent.allowParentDependency||(a[n].to===i.rowUniqueID.toString()?(r=this.parent.getRecordByID(a[n].from),s=K(a[n],"from",r.ganttProperties.predecessor,"to"),(l=ne.extend([],r.ganttProperties.predecessor,[],!0)).splice(s,1),this.parent.setRecordValue("predecessor",l,r.ganttProperties,!0)):a[n].from===i.rowUniqueID.toString()&&(d=(r=this.parent.getRecordByID(a[n].to)).ganttProperties.predecessorsName.toString().split(","),l=a[n].from+a[n].type,l=d.indexOf(l),d.splice(l,1),this.parent.setRecordValue("predecessorsName",d.join(","),r.ganttProperties,!0),this.parent.setRecordValue(this.parent.taskFields.dependency,d.join(","),r),s=K(a[n],"from",r.ganttProperties.predecessor,"to"),(l=ne.extend([],r.ganttProperties.predecessor,[],!0)).splice(s,1),this.parent.setRecordValue("predecessor",l,r.ganttProperties,!0),this.parent.predecessorModule.validatePredecessorDates(r)))}o&&this.parent.allowParentDependency||(this.parent.setRecordValue("predecessor",[],e.ganttProperties,!0),this.parent.setRecordValue("predecessorsName","",e.ganttProperties,!0))},P.prototype.backUpAndPushNewlyAddedRecord=function(e,t,i){var a,n=this.parent.flatData,r=this.parent.currentViewData,s=this.parent.ids;switch(t){case"Top":n.splice(0,0,e),r.splice(0,0,e),s.splice(0,0,e.ganttProperties.rowUniqueID.toString());break;case"Bottom":n.push(e),r.push(e),s.push(e.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType&&(a=0===e.level?"R"+e.ganttProperties.taskId:"T"+e.ganttProperties.taskId,this.parent.getTaskIds().push(a));break;case"Above":o=n.indexOf(this.addRowSelectedItem),l=r.indexOf(this.addRowSelectedItem),this.recordCollectionUpdate(void 0,o,l,e,i,t);break;case"Below":var o,l,d=n.indexOf(this.addRowSelectedItem);l=this.addRowSelectedItem.hasChildRecords?(o=d+this.getChildCount(this.addRowSelectedItem,0)+1,r.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,r)+1):(o=d+1,r.indexOf(this.addRowSelectedItem)+1),this.recordCollectionUpdate(NaN,o,l,e,i,t);break;case"Child":d=n.indexOf(this.addRowSelectedItem),this.addRowSelectedItem.hasChildRecords?(o=d+this.getChildCount(this.addRowSelectedItem,0)+1,this.addRowSelectedItem.expanded||this.parent.enableMultiTaskbar||this.parent.expandByID(this.addRowSelectedItem.ganttProperties.rowUniqueID),l=r.indexOf(this.addRowSelectedItem)+this.getVisibleChildRecordCount(this.addRowSelectedItem,0,r)+1):(this.parent.setRecordValue("hasChildRecords",!0,this.addRowSelectedItem),this.parent.setRecordValue("isMilestone",!1,this.addRowSelectedItem.ganttProperties,!0),this.parent.setRecordValue("expanded",!0,this.addRowSelectedItem),this.parent.setRecordValue("childRecords",[],this.addRowSelectedItem),o=d+1,l=r.indexOf(this.addRowSelectedItem)+1,this.addRowSelectedItem.ganttProperties.predecessor&&this.updatePredecessorOnIndentOutdent(this.addRowSelectedItem),ne.isNullOrUndefined(this.addRowSelectedItem.ganttProperties.segments)||(this.addRowSelectedItem.ganttProperties.segments=null)),this.recordCollectionUpdate(NaN,o,l,e,i,t)}this.newlyAddedRecordBackup=e},P.prototype.recordCollectionUpdate=function(e,t,i,a,n,r){var s=this.parent.flatData,o=this.parent.currentViewData,l=this.parent.ids;s.splice(t,0,a),o.splice(i,0,a),l.splice(t,0,a.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType&&(s=0===a.level?"R"+a.ganttProperties.taskId:"T"+a.ganttProperties.taskId,this.parent.getTaskIds().splice(t,0,s)),!ne.isNullOrUndefined(n)&&(e="Above"===r?n.childRecords.indexOf(this.addRowSelectedItem):"Below"===r?n.childRecords.indexOf(this.addRowSelectedItem)+1:n.childRecords.length,n.childRecords.splice(e,0,a),this.parent.taskFields.child||(this.parent.taskFields.child="Children"),this.parent.dataSource instanceof U.DataManager&&ne.isNullOrUndefined(n.taskData[this.parent.taskFields.parentID])||!ne.isNullOrUndefined(this.parent.dataSource))&&(o=this.parent.taskFields.child,n.taskData[o]&&0<n.taskData[o].length?"Above"===r||"Below"===r?n.taskData[o].splice(e,0,a.taskData):n.taskData[o].push(a.taskData):this.parent.taskFields.parentID||(n.taskData[o]=[],n.taskData[o].push(a.taskData)))},P.prototype.constructTaskAddedEventArgs=function(e,t,i){var a={};if(a.action=a.requestType=i,1<e.length){a.data=[],a.newTaskData=[],a.recordIndex=[];for(var n=0;n<e.length;n++)a.data[n]=e[n],a.newTaskData[n]=Z([e[n]],a.data[n],a,this.parent),a.recordIndex[n]=e[n].index}else if(1===e.length)for(n=0;n<e.length;n++)a.data=e[n],a.newTaskData=Z([e[n]],a.data,a,this.parent),a.recordIndex=e[n].index;i=e&&0<e.length;return a.modifiedRecords=t,a.modifiedTaskData=Z(t,null,null,this.parent,i),a},P.prototype.addSuccess=function(e){this.parent.regenerateCycles=!0,this.parent.updatedConnectorLineCollection=[],this.parent.connectorLineIds=[],this.parent.predecessorModule.createConnectorLinesCollection(this.parent.flatData),this.parent.treeGrid.parentData=[],this.parent.addDeleteRecord=!0,this.parent.treeGrid.isAddedFromGantt=!0,this.isAdded=!0,this.parent.treeGrid.editModule&&(this.parent.treeGrid.editModule.isOnBatch=!1),this.parent.enableImmutableMode&&(this.parent.modifiedRecords=e.modifiedRecords,this.parent.modifiedRecords.push(e.data),this.refreshRecordInImmutableMode())},P.prototype.refreshRecordInImmutableMode=function(e,t){if(!t&&!ne.isNullOrUndefined(e))for(var i=e[0].index+1;i<this.parent.currentViewData.length&&e[0].level<this.parent.currentViewData[i].level;i++)this.parent.modifiedRecords.push(this.parent.currentViewData[i]);for(var r=this,i=0;i<this.parent.modifiedRecords.length;i++)!function(e){var t,i=r.parent.modifiedRecords[e],e=r.parent.rowDragAndDropModule&&r.parent.allowRowDragAndDrop?1:0,a=r.parent.taskFields.id,n=r.parent.currentViewData.findIndex(function(e){return e[a]===i[a]});r.parent.treeGrid.getRows()[n]&&(t=r.parent.treeGrid.grid.getRowObjectFromUID(r.parent.treeGrid.grid.getDataRows()[n].getAttribute("data-uid")),r.parent.treeGrid.renderModule.cellRender({data:t.data,cell:r.parent.treeGrid.getRows()[n].cells[r.parent.treeColumnIndex+e],column:r.parent.treeGrid.grid.getColumns()[r.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),r.parent.treeGrid.renderModule.RowModifier({data:i,row:r.parent.treeGrid.getRows()[n],rowHeight:r.parent.rowHeight}))}(i)},P.prototype.updateRealDataSource=function(e,t){var i=this.parent.taskFields,a=H(this.parent)?ne.getValue("result",this.parent.dataSource):this.parent.dataSource;this.parent.dataSource instanceof U.DataManager&&(a=this.parent.dataSource.dataSource.json);for(var n=0;n<e.length;n++)"Top"===(t=ne.isNullOrUndefined(t)||ne.isNullOrUndefined(this.addRowSelectedItem)?"Bottom"===t?"Bottom":"Top":t)?a.splice(0,0,e[n].taskData):"Bottom"!==t&&(ne.isNullOrUndefined(i.id)||ne.isNullOrUndefined(i.parentID)||"Child"!==t)?this.addDataInRealDataSource(a,e[n].taskData,t):a.push(e[n].taskData),this.isBreakLoop=!1},P.prototype.addDataInRealDataSource=function(e,t,i){for(var a=0;a<e.length;a++){var n=this.parent.taskFields.child;if(this.isBreakLoop)break;if(ne.getValue(this.parent.taskFields.id,e[a]).toString()===this.addRowSelectedItem.ganttProperties.rowUniqueID.toString()){var r=void 0;if(this.parent.rowDragAndDropModule&&this.parent.rowDragAndDropModule.droppedRecord&&"ResourceView"===this.parent.viewType)for(var s=0;s<e.length;s++)if(e[s][this.parent.taskFields.id]===this.parent.rowDragAndDropModule.droppedRecord.ganttProperties.taskId){r=s;break}"Above"===i&&-1===e.indexOf(t)?r?e.splice(r,0,t):e.splice(a,0,t):"Below"===i&&-1===e.indexOf(t)?r?e.splice(r+1,0,t):e.splice(a+1,0,t):"Child"===i&&(e[a][n]&&0<e[a][n].length?-1===e[a][n].indexOf(t)&&e[a][n].push(t):(e[a][n]=[],e[a][n].push(t))),this.isBreakLoop=!0;break}e[a][n]&&-1===e.indexOf(t)&&(n=e[a][n],this.addDataInRealDataSource(n,t,i))}},P.prototype.updateClientDataFromServer=function(e,t){for(var i=e.addedRecords[0],a=Object.assign({},i),n=(this.parent.timezone&&this.processStandardDateFields(i,a,this.parent,"convert"),this.processCustomDateColumns(a,a,this.parent,"convert"),new Set(this.resolveFallback(this.parent.customColumns,[]))),r=Object.keys(i),s=r.length,o=0;o<s;o++){var l=r[o],d=l===this.parent.taskFields.startDate,h=l===this.parent.taskFields.endDate,p=n.has(l),u=l===this.parent.taskFields.baselineStartDate,c=l===this.parent.taskFields.baselineEndDate;t.data[l]=(d||h||u||c||p?a:i)[l]}null!==this.parent.taskFields.id?t.data.ganttProperties.taskId=i[this.parent.taskFields.id]:t.data.ganttProperties.taskId=t.data.ganttProperties.taskId,null!==this.parent.taskFields.name?t.data.ganttProperties.taskName=i[this.parent.taskFields.name]:t.data.ganttProperties.taskName=t.data.ganttProperties.taskName,null!==this.parent.taskFields.startDate?t.data.ganttProperties.startDate=a[this.parent.taskFields.startDate]:t.data.ganttProperties.startDate=t.data.ganttProperties.startDate,null!==this.parent.taskFields.endDate?t.data.ganttProperties.endDate=a[this.parent.taskFields.endDate]:t.data.ganttProperties.endDate=t.data.ganttProperties.endDate,null!==this.parent.taskFields.duration?t.data.ganttProperties.duration=parseFloat(i[this.parent.taskFields.duration]):t.data.ganttProperties.duration=t.data.ganttProperties.duration,null!==this.parent.taskFields.durationUnit?t.data.ganttProperties.durationUnit=i[this.parent.taskFields.durationUnit]:t.data.ganttProperties.durationUnit=t.data.ganttProperties.durationUnit,null!==this.parent.taskFields.progress?t.data.ganttProperties.progress=i[this.parent.taskFields.progress]:t.data.ganttProperties.progress=t.data.ganttProperties.progress,null!==this.parent.taskFields.dependency?t.data.ganttProperties.dependency=i[this.parent.taskFields.dependency]:t.data.ganttProperties.dependency=t.data.ganttProperties.dependency,null!==this.parent.taskFields.parentID?t.data.ganttProperties.parentID=i[this.parent.taskFields.parentID]:t.data.ganttProperties.parentID=t.data.ganttProperties.parentID,null!==this.parent.taskFields.baselineEndDate?t.data.ganttProperties.baselineEndDate=a[this.parent.taskFields.baselineEndDate]:t.data.ganttProperties.baselineEndDate=t.data.ganttProperties.baselineEndDate,null!==this.parent.taskFields.baselineStartDate?t.data.ganttProperties.baselineStartDate=a[this.parent.taskFields.baselineStartDate]:t.data.ganttProperties.baselineStartDate=t.data.ganttProperties.baselineStartDate,null!==this.parent.taskFields.resourceInfo?t.data.ganttProperties.resources=i[this.parent.taskFields.resourceInfo]:t.data.ganttProperties.resources=t.data.ganttProperties.resources},P.prototype.addNewUndoCollection=function(e,t){if(this.parent.undoRedoModule&&(!this.parent.undoRedoModule.isUndoRedoPerformed||this.parent.undoRedoModule.isUndoRedoPerformed&&"Add"===this.parent.undoRedoModule.currentAction.action&&"ResourceView"===this.parent.viewType)&&this.parent.isUndoRedoItemPresent("Add")){e.action="Add";for(var i=0<t.data.length?ne.extend([],[],t.data,!0):[t.data],a=[],n=this,r=0;r<i.length;r++)!function(t){a=n.parent.flatData.filter(function(e){return i[t].index===e.index&&i[t].ganttProperties.taskId===e.ganttProperties.taskId})}(r);e.addedRecords=ne.extend([],[],a,!0),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=e}},P.prototype.resolveQuery=function(e){return e instanceof U.Query?e:new U.Query},P.prototype.addRecord=function(e,m,t){var y=this,D=this.parent.taskFields.id;if(this.parent.editModule&&this.parent.editSettings.allowAdding){this.parent.isDynamicData=!0,this.parent.treeGrid.isAddedFromGantt=!0,this.parent.isOnAdded=!0;var k=[];if(ne.isNullOrUndefined(e))this.validateTaskPosition(e,m,t,k);else if(e instanceof Array)if(this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed){var i=e,a=t;"ResourceView"===this.parent.viewType&&("below"===e[0].position?m="Below":"above"===e[0].position?m="Above":"child"===e[0].position&&(m="Child"),a=this.parent.taskIds.indexOf(e[0].id.toString()),i=e[0].data),this.validateTaskPosition(i,m,a,k)}else for(var n=0;n<e.length;n++)this.validateTaskPosition(e[n],m,t,k);else{if("object"!=typeof e)return;this.validateTaskPosition(e,m,t,k)}var i={},i=this.constructTaskAddedEventArgs(k,this.parent.editedRecords,"beforeAdd"),T=(ne.isNullOrUndefined(m)||(i.rowPosition=m),this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent("Add")&&(this.parent.undoRedoModule.redoEnabled&&this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection()),ne.extend({},{},i.newTaskData,!0)),b=(this.parent.timezone&&this.processStandardDateFields(i.newTaskData,i.newTaskData,this.parent,"remove"),this.processCustomDateColumns(i.newTaskData,i.newTaskData,this.parent,"remove"),ne.extend({},{},i.newTaskData,!0));this.parent.trigger("actionBegin",i,function(a){y.parent.previousRecords={};var e=y.parent.taskFields;if(y.parent.timezone)for(var t=0,i=[e.startDate,e.endDate,e.baselineStartDate,e.baselineEndDate];t<i.length;t++){var n=i[t];!ne.isNullOrUndefined(a.newTaskData&&a.newTaskData[n])&&a.newTaskData[n]instanceof Date&&!ne.isNullOrUndefined(b[n])&&b[n]instanceof Date&&a.newTaskData[n].getTime()===b[n].getTime()&&(a.newTaskData[n]=T[n])}if(e="ResourceView"===y.parent.viewType?0<a.data.childRecords.length?y.parent.flatData[y.parent.getTaskIds().indexOf("R"+a.data[e.id])]:y.parent.flatData[y.parent.getTaskIds().indexOf("T"+a.data[e.id])]:y.parent.getRecordByID(a.data[e.id]),ne.isNullOrUndefined(e)||(y.validateUpdateValues(a.newTaskData,e,!0),y.parent.dateValidationModule.calculateEndDate(e),y.parent.dataOperation.updateWidthLeft(e),y.parent.dataOperation.updateParentItems(e)),!ne.isNullOrUndefined(a.data[""+D])&&a.data[D]!==a.data.ganttProperties.taskId){for(var r=0,s=Object.keys(y.parent.ids);r<s.length;r++){var o=s[r];if(y.parent.ids[o]===a.data.ganttProperties.taskId.toString()){y.parent.ids[o]=a.data[D].toString();break}}a.data.ganttProperties.taskId=a.data[D],a.newTaskData[D]=a.data[D],a.data.ganttProperties.rowUniqueID=a.data[D].toString()}if(a.cancel)y.removeAddedRecord(),y.reUpdatePreviousRecords(),y._resetProperties();else{y.parent.showLoadingIndicator();if(y.parent.timezone&&y.processStandardDateFields(a.newTaskData,a.newTaskData,y.parent,"remove"),y.processCustomDateColumns(a.newTaskData,a.newTaskData,y.parent,"remove"),_(y.parent.dataSource)){var l,d=y.parent.dataSource,h={addedRecords:[a.newTaskData],changedRecords:a.modifiedTaskData},p=y.resolveQuery(y.parent.query),u=d.adaptor;!(u instanceof U.WebApiAdaptor||u instanceof U.ODataAdaptor||u instanceof U.ODataV4Adaptor||u instanceof U.GraphQLAdaptor)||d.dataSource.batchUrl?(l=a.data.ganttProperties.taskId,d.saveChanges(h,y.parent.taskFields.id,null,p).then(function(t){ne.isNullOrUndefined(t)||ne.isNullOrUndefined(t.addedRecords)||t.addedRecords[0][y.parent.taskFields.id].toString()===a.data.ganttProperties.taskId||(e=y.parent.ids.indexOf(l),a.data.ganttProperties.taskId=t.addedRecords[0][y.parent.taskFields.id].toString(),a.newTaskData[D]=t.addedRecords[0][y.parent.taskFields.id].toString(),a.data.ganttProperties.rowUniqueID=t.addedRecords[0][y.parent.taskFields.id].toString(),y.parent.ids.some(function(e){return e===t.addedRecords[0][y.parent.taskFields.id].toString()})?(i="The provided ID value "+t.addedRecords[0][y.parent.taskFields.id]+" already exists. Please provide a unique ID value.",y.parent.trigger("actionFailure",{error:i})):-1!==e?y.parent.ids.splice(e,1,t.addedRecords[0][y.parent.taskFields.id].toString()):y.parent.ids.push(t.addedRecords[0][y.parent.taskFields.id].toString()));var e,i=a.data.ganttProperties.taskId.toString();!y.parent.taskFields.id||ne.isNullOrUndefined(t)||ne.isNullOrUndefined(t.addedRecords)||ne.isNullOrUndefined(t.addedRecords[0][y.parent.taskFields.id])||t.addedRecords[0][y.parent.taskFields.id].toString()!==i||(y.parent.setRecordValue("taskId",t.addedRecords[0][y.parent.taskFields.id],a.data.ganttProperties,!0),y.parent.setRecordValue("taskData",t.addedRecords[0],a.data),y.parent.setRecordValue(y.parent.taskFields.id,t.addedRecords[0][y.parent.taskFields.id],a.data),y.parent.setRecordValue("rowUniqueID",t.addedRecords[0][y.parent.taskFields.id].toString(),a.data.ganttProperties,!0),y.updateClientDataFromServer(t,a),-1!==(e=y.parent.ids.indexOf(i))&&(y.parent.ids[e]=t.addedRecords[0][y.parent.taskFields.id].toString())),y.updateNewRecord(k,a)}).catch(function(e){y.removeAddedRecord(),y.dmFailure(e,a),y._resetProperties()})):d.insert(h.addedRecords[0],null,p).then(function(e){var t=(ne.isNullOrUndefined(e[0])?h.addedRecords:e)[0];k.forEach(function(e){ne.isNullOrUndefined(e)||(y.updateEditedRecordFields(t,e),y.parent.dataOperation.updateTaskData(e))}),y.updateNewRecord(k,a)}).catch(function(e){y.removeAddedRecord(),y.dmFailure(e,a),y._resetProperties()})}else{if(y.parent.currentSelection=k[0],"ProjectView"===y.parent.viewType?("Top"===m||"Bottom"===m||"Above"===m||"Below"===m||"Child"===m||ne.isNullOrUndefined(m)&&!a.data.parentItem)&&(a.data instanceof Array?y.updateRealDataSource(a.data,m):((u=[]).push(a.data),y.updateRealDataSource(u,m),y.parent.currentSelection=k[0])):(H(y.parent)?ne.getValue("result",y.parent.dataSource):y.parent.dataSource).push(a.data.taskData),0===k.level&&y.parent.treeGrid.parentData.splice(0,0,k),y.updateTreeGridUniqueID(k,"add"),"ResourceView"===y.parent.viewType&&y.parent.undoRedoModule&&y.parent.undoRedoModule.currentAction){d=!1;if((a.data.hasChildRecords||a.data.parentItem&&y.parent.getTaskByUniqueID(a.data.parentItem.uniqueID).ganttProperties.taskName!==y.parent.localeObj.getConstant("unassignedTask"))&&(d=!0),-1!==y.parent.taskIds.indexOf("R0")&&y.parent.undoRedoModule&&y.parent.undoRedoModule.isUndoRedoPerformed&&"Delete"===y.parent.undoRedoModule.currentAction.action&&d){for(var c=y.parent.flatData[y.parent.taskIds.indexOf("R0")],g=c.childRecords.filter(function(e){return e.ganttProperties.taskId===a.data.ganttProperties.taskId}),f=(a.data.hasChildRecords&&(g=a.data.childRecords),0);f<g.length;f++)!function(e){var a,t;1===c.childRecords.length?(y.parent.removeRecords(y.parent.taskIds.indexOf("R0"),2),y.parent.ids.splice(y.parent.taskIds.indexOf("R0"),2),y.parent.taskIds.splice(y.parent.taskIds.indexOf("R0"),2)):(t=y.parent.taskIds.indexOf("T"+g[e].ganttProperties.taskId),a="T"+g[e].ganttProperties.taskId,t=(e=y.parent.taskIds.reduce(function(e,t,i){return t===a&&e.push(i),e},[]))[e.length-1],y.parent.removeRecords(t),y.parent.taskIds.splice(t,1),y.parent.ids.splice(t,1))}(f);c&&"ResourceView"===y.parent.viewType&&(p=y.parent.taskIds.indexOf("R0"),y.parent.flatData[p+1]||(y.parent.removeRecords(p),y.parent.ids.splice(p,1),y.parent.taskIds.splice(p,1)))}}y.refreshNewlyAddedRecord(a,k),"ResourceView"===y.parent.viewType&&y.parent.taskFields.work&&e&&y.parent.dataOperation.updateParentItems(e,!0),y.addNewUndoCollection({},a),y._resetProperties()}y.parent.isOnAdded=!1}})}},P.prototype.createNewRecord=function(){for(var e={},t=this.parent.ganttColumns,i=this.parent.taskFields,a=this.parent.editModule.getNewTaskId(),n=0;n<t.length;n++){var r=t[n].field;r===i.id?e[r]=a:t[n].field===i.startDate?ne.isNullOrUndefined(e[i.endDate])?e[r]=this.parent.editModule.dialogModule.getMinimumStartDate():e[r]=new Date(e[i.endDate]):t[n].field===i.endDate?ne.isNullOrUndefined(e[i.startDate])?e[r]=this.parent.editModule.dialogModule.getMinimumStartDate():e[r]=new Date(e[i.startDate]):t[n].field===i.duration?e[r]=1:t[n].field===i.name?e[r]=this.parent.editModule.dialogModule.localeObj.getConstant("addDialogTitle")+" "+a:t[n].field===i.progress||t[n].field===i.work?e[r]=0:t[n].field===i.type||"taskType"===t[n].field?e[r]=this.parent.taskType:t[n].field===i.milestone?e[r]=null:t[n].field===i.segments?e[this.parent.ganttColumns[n].field]=[]:e[this.parent.ganttColumns[n].field]=""}return e},P.prototype.validateTaskPosition=function(e,t,i,a){var n,r=ne.isNullOrUndefined(i)||isNaN(parseInt(i.toString(),10))?this.parent.selectionModule?"Row"!==this.parent.selectionSettings.mode&&"Both"!==this.parent.selectionSettings.mode||1!==this.parent.selectionModule.selectedRowIndexes.length?"Cell"===this.parent.selectionSettings.mode&&1===this.parent.selectionModule.getSelectedRowCellIndexes().length?this.parent.selectionModule.getSelectedRowCellIndexes()[0].rowIndex:null:this.parent.selectionModule.selectedRowIndexes[0]:null:i,s=(this.addRowSelectedItem=ne.isNullOrUndefined(r)?null:this.parent.updatedRecords[r],t=ne.isNullOrUndefined(t)?this.parent.editSettings.newRowPosition:t,e=ne.isNullOrUndefined(e)?this.createNewRecord():e,0);switch(t=(ne.isNullOrUndefined(r)||r<0||ne.isNullOrUndefined(this.addRowSelectedItem))&&("Above"===t||"Below"===t||"Child"===t)||!t||"Above"!==t&&"Below"!==t&&"Child"!==t&&"Top"!==t&&"Bottom"!==t?"Top":t){case"Top":case"Bottom":s="ResourceView"===this.parent.viewType?1:0;break;case"Above":case"Below":s=this.addRowSelectedItem.level,n=this.parent.getParentTask(this.addRowSelectedItem.parentItem);break;case"Child":s=this.addRowSelectedItem.level+1,n=this.addRowSelectedItem}this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed||this.prepareNewlyAddedData(e,t);r=this.updateNewlyAddedDataBeforeAjax(e,s,t,n,i);a.push(r)},P.prototype.updateRowIndex=function(){for(var e=this.parent.currentViewData,t=e.length,i=0;i<t;i++){var a=i;e[i].index=a,e[i].parentItem&&e[i].parentItem.taskId&&(a=this.parent.getRecordByID(e[i].parentItem.taskId),ne.isNullOrUndefined(a)||ne.isNullOrUndefined(a.index)||ne.isNullOrUndefined(a.level)||(e[i].parentItem.index=a.index,e[i].parentItem.level=a.level))}},P.prototype.updateNewRecord=function(e,t){var i=this;e.forEach(function(e){0===e.level&&(i.parent.treeGrid.parentData.splice(0,0,e),ne.getValue("dataOperation.dataArray",i.parent).splice(0,0,e.taskData)),i.updateTreeGridUniqueID(e,"add")}),this.updateTreeGridUniqueID(e,"add"),this.refreshNewlyAddedRecord(t,e);this.addNewUndoCollection({},t),this._resetProperties()},P.prototype._resetProperties=function(){this.parent.isOnEdit=!1,this.parent.hideSpinner(),this.addRowSelectedItem=null,this.newlyAddedRecordBackup=null,this.isBreakLoop=!1,this.parent.element.tabIndex=0,this.parent.initiateEditAction(!1)},P.prototype.updateTreeGridUniqueID=function(e,t){"add"===t?ne.setValue("uniqueIDCollection."+e.uniqueID,e,this.parent.treeGrid):"delete"===t&&ne.deleteObject(ne.getValue("uniqueIDCollection",this.parent.treeGrid),e.uniqueID)},P.prototype.refreshNewlyAddedRecord=function(e,t){var i=this;if(this.parent.selectionModule&&this.parent.allowSelection&&("Row"===this.parent.selectionSettings.mode||"Both"===this.parent.selectionSettings.mode)&&(this.parent.staticSelectedRowIndex=this.parent.currentViewData.indexOf(e.data)),this.parent.timelineSettings.updateTimescaleView&&(s=[],0<e.modifiedRecords.length?(s=0<e.data.length?ne.extend([],[],e.data,!0):[e.data]).push.apply(s,e.modifiedRecords):s=0<e.data.length?ne.extend([],[],e.data,!0):[e.data],this.parent.timelineModule.updateTimeLineOnEditing([s],e.action),this.parent.timezone&&this.parent.timelineModule.performedTimeSpanAction&&this.processStandardDateFields(e.newTaskData,e.newTaskData,this.parent,"remove"),"beforeAdd"===e.action)&&this.parent.timelineModule.performedTimeSpanAction&&(this.parent.timelineModule.performedTimeSpanAction=!1),this.addSuccess(e),e=this.constructTaskAddedEventArgs(t,e.modifiedRecords,"add"),this.parent.dataSource&&"result"in this.parent.dataSource&&(e.requestType="save",this.parent.treeGrid.grid.renderModule.refresh(e)),this.parent.treeGrid.refresh(),this.updateRowIndex(),this.parent.trigger("actionComplete",e),this.parent.hideLoadingIndicator(),this.dialogModule.dialog&&!this.dialogModule.dialogObj.isDestroyed&&this.dialogModule.dialogObj.hide(),this.dialogModule.dialogClose(),"ResourceView"===this.parent.viewType)if(1<t.length)for(var a,n=0;n<t.length;n++){e.data[n].ganttProperties.sharedTaskUniqueIds.push(e.data[n].ganttProperties.rowUniqueID),e.data[n].ganttProperties.resourceInfo?((a=ne.extend([],[],e.data[n].ganttProperties.resourceInfo,!0)).splice(0,1),this.updateResoures([],a,e.data[n])):this.parent.undoRedoModule&&(!this.parent.undoRedoModule||e.data[n].hasChildRecords||!this.parent.undoRedoModule.isUndoRedoPerformed)&&this.parent.undoRedoModule.isUndoRedoPerformed||(this.removeChildRecord(e.data[n]),this.parent.editModule.checkWithUnassignedTask(e.data[n]));for(var r=0;r<this.updateParentRecords.length;r++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[r]);this.updateParentRecords=[]}else{e.data.ganttProperties.sharedTaskUniqueIds.push(e.data.ganttProperties.rowUniqueID);var s=e.data,o=s.ganttProperties,l=s.childRecords,d=this.parent.undoRedoModule,h=function(e,t){e&&1<e.length&&((e=ne.extend([],[],e,!0)).splice(0,1),d&&d.isUndoRedoPerformed&&(i.parent.editModule.addRowIndex=void 0),i.updateResoures([],e,t))};o.resourceInfo&&o.resourceInfo.length?h(o.resourceInfo,s):0<l.length&&l[0].ganttProperties.resourceInfo&&l[0].ganttProperties.resourceInfo.length?h(l[0].ganttProperties.resourceInfo,e.data.childRecords[0]):this.parent.undoRedoModule&&(!this.parent.undoRedoModule||e.data.hasChildRecords||!this.parent.undoRedoModule.isUndoRedoPerformed)&&this.parent.undoRedoModule.isUndoRedoPerformed||(this.removeChildRecord(e.data),this.parent.editModule.checkWithUnassignedTask(e.data));for(r=0;r<this.updateParentRecords.length;r++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[r]);this.updateParentRecords=[]}},P.prototype.removeAddedRecord=function(){var e,t,i=this.parent.flatData,a=this.parent.currentViewData,n=this.parent.ids,r=i.indexOf(this.newlyAddedRecordBackup),s=a.indexOf(this.newlyAddedRecordBackup),o=n.indexOf(this.newlyAddedRecordBackup.ganttProperties.rowUniqueID.toString());ne.deleteObject(this.parent.previousRecords,i[r].uniqueID),this.newlyAddedRecordBackup.parentItem&&(t=(e=this.parent.getParentTask(this.newlyAddedRecordBackup.parentItem)).childRecords.indexOf(this.newlyAddedRecordBackup),e.childRecords.splice(t,1),0===e.childRecords.length)&&e.hasChildRecords&&(e.hasChildRecords=!1),i.splice(r,1),a.splice(s,1),n.splice(o,1)},P.prototype.getPrevRecordIndex=function(){var e=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1],t=this.parent.selectionModule.getSelectedRecords()[0],e=this.parent.getRootParent(e,t.level);return this.parent.updatedRecords.indexOf(e)},P.prototype.indent=function(){var e=this.parent.selectedRowIndex,t=1===this.parent.selectionModule.selectedRowIndexes.length||this.resolveCondition(1===this.parent.selectionModule.getSelectedRowCellIndexes().length,!0,!1),i=this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0]-1],a=this.parent.selectionModule.getSelectedRecords()[0];this.parent.editSettings.allowEditing&&0!==e&&-1!==e&&t&&"ResourceView"!==this.parent.viewType&&(ne.isNullOrUndefined(this.parent.updatedRecords[e])||this.parent.updatedRecords[e].level-i.level!=1)&&(t=i.level-a.level==0?this.parent.selectionModule.getSelectedRowIndexes()[0]-1:this.getPrevRecordIndex(),this.indentOutdentRow([this.parent.selectionModule.getSelectedRowIndexes()[0]],t,"child"))},P.prototype.outdent=function(){var e=this.parent.selectionModule.getSelectedRowIndexes()[0],t=1===this.parent.selectionModule.selectedRowIndexes.length||this.resolveCondition(1===this.parent.selectionModule.getSelectedRowCellIndexes().length,!0,!1);this.parent.editSettings.allowEditing&&-1!==e&&0!==e&&t&&"ResourceView"!==this.parent.viewType&&0!==this.parent.updatedRecords[e].level&&(t=this.parent.getTaskByUniqueID(this.parent.selectionModule.getSelectedRecords()[0].parentItem.uniqueID),t=this.parent.updatedRecords.indexOf(t),this.indentOutdentRow([e],t,"below"))},P.prototype.indentOutdentRow=function(e,t,i){var a=this;e[0],"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var i=void 0,n=[],r=0;r<e.length;r++)this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.undoRedoModule.currentAction?this.parent.undoRedoModule.currentAction.modifiedRecord?n[r]=this.parent.undoRedoModule.currentAction.modifiedRecord[r].data:n[r]=this.parent.undoRedoModule.currentAction.data[r]:n[r]=this.parent.updatedRecords[e[r]];var s={data:n,dropIndex:t,dropPosition:this.dropPosition};"middleSegment"===this.dropPosition?i="indenting":"bottomSegment"===this.dropPosition&&(i="outdenting"),this.parent.trigger("actionBegin",{action:i,data:n[0],cancel:!1},function(e){e.cancel?a.parent.hideLoadingIndicator():(a.parent.showLoadingIndicator(),a.reArrangeRows(s,!0))})},P.prototype.reArrangeRows=function(e,t){var i=this;if(this.dropPosition=e.dropPosition,this.parent.oldRecords=[],this.parent.oldRecords=ne.extend([],[],e.data,!0),"Invalid"!==e.dropPosition&&this.parent.editModule){for(var a,n,r,s,o,l=this.parent,l=(this.droppedRecord=l.updatedRecords[e.dropIndex],"middleSegment"===e.dropPosition?"Indent":"Outdent"),d=(this.parent.undoRedoModule&&!this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.isUndoRedoItemPresent(l)&&((n={}).action=l,n.modifiedRecord=[],n.selectedRowIndexes=ne.extend([],[],this.parent.selectionModule.selectedRowIndexes,!0),this.parent.undoRedoModule.findPosition(ne.extend([],[],[e.data],!0)[0],n,"modifiedRecord"),n.droppedRecord=ne.extend([],[],this.droppedRecord,!0),this.parent.undoRedoModule.redoEnabled&&(this.parent.undoRedoModule.redoEnabled=!1,this.parent.undoRedoModule.getUndoCollection=[],this.parent.undoRedoModule.getRedoCollection=[],this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_redo"],!1),this.parent.undoRedoModule.getUndoCollection[0]=[]),this.parent.undoRedoModule.createUndoCollection(),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=n),[]),h=this.droppedRecord,p=(e.data[0]?d=e.data:d.push(e.data),0),u=d.length,c=0;c<u;c++)this.parent.isOnEdit=!0,a=d[c],this.draggedRecord=a,"Invalid"!==this.dropPosition&&(t&&this.deleteDragRow(),o=this.treeGridData.indexOf(h),this.parent.editModule.updateResourceRelatedFields(h,""),"bottomSegment"===this.dropPosition&&-1!==o&&(h.hasChildRecords?(p=this.parent.editModule.getChildCount(h,0),this.parent.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(o+p+1,0,this.draggedRecord.taskData),this.treeGridData.splice(o+p+1,0,this.draggedRecord),this.parent.ids.splice(o+p+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),(r=this.parent.ids.indexOf(this.draggedRecord[this.parent.taskFields.id].toString()))!==o+p+1&&(this.parent.ids.splice(r,1),this.parent.ids.splice(o+p+1,0,this.draggedRecord[this.parent.taskFields.id].toString()))):(this.parent.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(o+1,0,this.draggedRecord.taskData),this.treeGridData.splice(o+1,0,this.draggedRecord),this.parent.ids.splice(o+1,0,this.draggedRecord.ganttProperties.rowUniqueID.toString())),this.parent.setRecordValue("parentItem",this.treeGridData[o].parentItem,a),this.parent.setRecordValue("parentUniqueID",this.treeGridData[o].parentUniqueID,a),this.parent.setRecordValue("level",this.treeGridData[o].level,a),a.hasChildRecords&&(this.updateChildRecordLevel(a,1),this.updateChildRecord(a,o+p+1)),h.parentItem)&&(s=(r=n=this.parent.getParentTask(h.parentItem).childRecords).indexOf(h)+1,r.splice(s,0,a)),"middleSegment"===this.dropPosition&&this.dropMiddle(o),ne.isNullOrUndefined(a.parentItem&&-1!==this.updateParentRecords.indexOf(a.parentItem))||this.updateParentRecords.push(this.parent.getTaskByUniqueID(a.parentItem.uniqueID))),ne.isNullOrUndefined(a.parentItem)&&(o=(s=this.parent.treeGrid.parentData).indexOf(this.droppedRecord),"bottomSegment"===this.dropPosition)&&s.splice(o+1,0,a),this.refreshDataSource();if("middleSegment"===this.dropPosition){if(!ne.isNullOrUndefined(h.ganttProperties.predecessor))for(var g,f,m=h.ganttProperties.predecessor.length-1;0<=m;m--)ne.isNullOrUndefined(h.ganttProperties.predecessor)||(f=this.parent.getRecordByID(h.ganttProperties.predecessor[m].from),g=this.parent.getRecordByID(h.ganttProperties.predecessor[m].to),f=this.parent.predecessorModule.validateParentPredecessor(f,g),!h.ganttProperties.predecessor)||f&&this.parent.allowParentDependency||(this.parent.editModule.removePredecessorOnDelete(h),h.ganttProperties.predecessor.splice(m,1),h.ganttProperties.predecessorsName=null,h[this.parent.taskFields.dependency]=null,h.taskData[this.parent.taskFields.dependency]=null);h.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,h.ganttProperties,!0),ne.isNullOrUndefined(h.taskData[this.parent.taskFields.milestone])||!0===h.taskData[this.parent.taskFields.milestone]&&(h.taskData[this.parent.taskFields.milestone]=!1))}for(var y=0;y<this.updateParentRecords.length;y++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[y]);this.parent.editedRecords.forEach(function(e){i.isFirstCall=!0,i.parent.predecessorModule.validatePredecessor(e,[],"")});for(y=0;y<this.updateParentRecords.length;y++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[y]);this.updateParentRecords=[],this.parent.isOnEdit=!1}this.canReset=!0,this.refreshRecord(e)},P.prototype.refreshRecord=function(t,i){var a=this;if(_(this.parent.dataSource)){var n=this.parent.dataSource,e={changedRecords:Z(this.parent.editedRecords,null,null,this.parent)},r=this.resolveQuery(this.parent.query),s=null,o=n.adaptor;if(!(o instanceof U.WebApiAdaptor||o instanceof U.ODataAdaptor||o instanceof U.ODataV4Adaptor||o instanceof U.GraphQLAdaptor)||n.dataSource.batchUrl)s=n.saveChanges(e,this.parent.taskFields.id,null,r);else{o=e.changedRecords;if(o instanceof Array){for(var l=this.parent.taskFields.id,d=Promise.resolve(),h=[],p=0,u=o;p<u.length;p++)!function(e){e[l];d=d.then(function(){return n.update(l,e,null,r).then(function(e){return h.push(e),e})})}(u[p]);d.then(function(){a.indentSuccess({changedRecords:h},t,i)}).catch(function(e){return a.indentFailure(e)})}else e=o?o[this.parent.taskFields.id]:null,s=n.update(this.parent.taskFields.id,o,e,r)}ne.isNullOrUndefined(s)||s.then(function(e){return a.indentSuccess(e,t,i)}).catch(function(e){return a.indentFailure(e)})}else this.indentOutdentSuccess(t,i)},P.prototype.indentSuccess=function(e,t,i){this.updateEditedFields(e),this.indentOutdentSuccess(t,i)},P.prototype.indentFailure=function(e){this.parent.trigger("actionFailure",{error:e})},P.prototype.indentOutdentSuccess=function(e,t){if(this.parent.treeGrid.parentData=[],"ProjectView"===this.parent.viewType&&this.parent.allowParentDependency&&this.parent.validateCycles(),this.parent.treeGrid.editModule&&(this.parent.treeGrid.editModule.isOnBatch=!1),this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&(this.parent.undoRedoModule.isPreventRowDeselectOnUndoRedo=!0),this.parent.isReact&&0<this.parent.treeGrid.grid.element.querySelectorAll(".e-templatecell").length?this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords):this.parent.treeGrid.refresh(),this.parent.enableImmutableMode&&(this.refreshRecordInImmutableMode(e.data,t),this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords)),t?e.requestType="rowDropped":"middleSegment"===this.dropPosition?e.requestType="indented":"bottomSegment"===this.dropPosition&&(e.requestType="outdented"),e.modifiedRecords=this.parent.editedRecords,this.parent.timezone)for(var i=0;i<e.modifiedRecords.length;i++)X(e.modifiedRecords[i],this.parent);this.canReset&&(this.parent.previousRecords={}),this.canReset=!1,this.parent.trigger("actionComplete",e),this.parent.hideLoadingIndicator(),this.parent.rowDragAndDropModule&&(this.parent.rowDragAndDropModule.draggedRecord=null),this.parent.staticSelectedRowIndex=-1},P.prototype.refreshDataSource=function(){var e,t,i=this.draggedRecord,a=this.droppedRecord,n=this.parent,r=this.parent.dataSource instanceof U.DataManager?ne.getValue("dataOperation.dataArray",this.parent):n.dataSource;if(0<r.length&&!ne.isNullOrUndefined(a)&&!a.parentItem){for(var s=0;s<Object.keys(r).length;s++)r[s][this.parent.taskFields.child]===a.taskData[this.parent.taskFields.child]&&(e=s);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||r.splice(e,0,i.taskData):"bottomSegment"!==this.dropPosition||this.parent.taskFields.parentID||r.splice(e+1,0,i.taskData)}else this.parent.taskFields.parentID||ne.isNullOrUndefined(a)||!a.parentItem||"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition||(n=this.resolveCondition("topSegment"===this.dropPosition,"Above","Below"),this.parent.editModule.addRowSelectedItem=a,t=[],Array.isArray(i)?t=i:t[0]=i,this.parent.editModule.updateRealDataSource(t,n),delete this.parent.editModule.addRowSelectedItem);this.parent.taskFields.parentID&&(i.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(i[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID],i.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.parentID],i.ganttProperties.parentId=a[this.parent.taskFields.parentID]):(i[this.parent.taskFields.parentID]=a[this.parent.taskFields.id],i.taskData[this.parent.taskFields.parentID]=a[this.parent.taskFields.id],i.ganttProperties.parentId=a[this.parent.taskFields.id]):(i[this.parent.taskFields.parentID]=null,i.taskData[this.parent.taskFields.parentID]=null,i.ganttProperties.parentId=null))},P.prototype.deleteDragRow=function(){this.parent.dataSource instanceof U.DataManager?this.ganttData=ne.getValue("dataOperation.dataArray",this.parent):this.ganttData=H(this.parent)?ne.getValue("result",this.parent.dataSource):this.parent.dataSource,this.treeGridData=H(this.parent)?ne.getValue("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource;var e=this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);this.removeRecords(e)},P.prototype.updateIndentedChildRecords=function(e){for(var t={uniqueID:e.uniqueID,expanded:e.expanded,level:e.level,index:e.index,taskId:e.ganttProperties.rowUniqueID},i=0;i<e.childRecords.length;i++)this.parent.setRecordValue("parentItem",t,e.childRecords[i]),this.parent.setRecordValue("parentUniqueID",e.uniqueID,e.childRecords[i]);if(e.hasChildRecords){e=e.childRecords;for(var a=0;a<e.length;a++)this.updateIndentedChildRecords(e[a])}},P.prototype.dropMiddle=function(e){var t,i,a=this.parent;this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.undoRedoModule.currentAction.modifiedRecord&&"child"!==this.parent.undoRedoModule.currentAction.modifiedRecord[0].position?"above"===this.parent.undoRedoModule.currentAction.modifiedRecord[0].position?t=this.parent.ids.indexOf(this.parent.undoRedoModule.currentAction.modifiedRecord[0].id.toString()):"below"===this.parent.undoRedoModule.currentAction.modifiedRecord[0].position&&(t=this.parent.ids.indexOf(this.parent.undoRedoModule.currentAction.modifiedRecord[0].id.toString())+1):(i=this.parent.editModule.getChildCount(this.droppedRecord,0),t=ne.isNullOrUndefined(i)||0===i?e+1:i+e+1),"middleSegment"===this.dropPosition&&(this.droppedRecord.ganttProperties.isAutoSchedule&&!ne.isNullOrUndefined(this.droppedRecord.ganttProperties.predecessorsName)&&""!==this.droppedRecord.ganttProperties.predecessorsName&&(i=this.droppedRecord.ganttProperties.startDate,this.parent.setRecordValue("startDate",i,this.draggedRecord.ganttProperties,!0),this.parent.dateValidationModule.calculateEndDate(this.draggedRecord),this.parent.dataOperation.updateTaskData(this.draggedRecord),this.parent.dataOperation.updateTaskLeftWidth(this.draggedRecord)),a.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(t,0,this.draggedRecord.taskData),this.treeGridData.splice(t,0,this.draggedRecord),this.parent.ids.splice(t,0,this.draggedRecord[this.parent.taskFields.id].toString()),this.recordLevel(),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,t,this.droppedRecord.expanded),this.parent.enableImmutableMode)&&(e=this.draggedRecord,this.updateIndentedChildRecords(e)),ne.isNullOrUndefined(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem)))&&this.updateParentRecords.push(this.draggedRecord.parentItem)},P.prototype.updateChildRecordLevel=function(e,t){if(t++,!e.hasChildRecords)return 0;for(var i=e.childRecords.length,a=0;a<i;a++){var n=e.childRecords[a],r=void 0;e.parentItem&&(r=this.parent.treeGrid.uniqueIDCollection[e.parentItem.uniqueID]),n.level=e.parentItem?r.level+t:e.level+1,n.hasChildRecords&&(t--,t=this.updateChildRecordLevel(n,t))}return t},P.prototype.updateChildRecord=function(e,t,i){var a,n=this.parent;if(!e.hasChildRecords)return 0;for(var r=e.childRecords.length,s=0;s<r;s++)a=e.childRecords[s],this.parent.insertRecord(a,++t),this.parent.ids.splice(t,0,a.ganttProperties.rowUniqueID.toString()),n.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(t,0,a.taskData),a.hasChildRecords&&(t=this.updateChildRecord(a,t));return t},P.prototype.removeRecords=function(e){var t=this.parent,i=this.parent.dataSource instanceof U.DataManager?ne.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource,a=e;if(a){e=this.parent.getParentTask(a.parentItem);if(a.parentItem&&(l=0,d=this.getValueOrFallback(e,"childRecords",[]))&&0<d.length&&(l=d.indexOf(a),e.childRecords.splice(l,1),this.parent.taskFields.parentID||e.taskData[this.parent.taskFields.child].splice(l,1),this.updateParentRecords.push(e)),t.taskFields.parentID){a.hasChildRecords&&0<a.childRecords.length&&this.removeChildItem(a);for(var n=void 0,r=this.resolveCondition(0<i.length,i,this.parent.currentViewData),s=0;s<r.length;s++)r[s][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(n=s);if(-1!==n){0<i.length&&i.splice(n,1);for(var o=void 0,s=0;s<this.treeGridData.length;s++)this.treeGridData[s][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(o=s);this.treeGridData.splice(o,1),this.parent.ids.splice(o,1),-1!==this.parent.treeGrid.parentData.indexOf(a)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(a),1)}}var l,d=this.treeGridData.indexOf(a);t.taskFields.parentID||(l=this.getChildCount(a,0),this.treeGridData.splice(d,l+1),this.parent.ids.splice(d,l+1),-1!==(i=this.ganttData.indexOf(a.taskData))&&(this.ganttData.splice(i,1),this.parent.treeGrid.parentData.splice(i,1))),a.parentItem&&e&&e.childRecords&&!e.childRecords.length&&(this.parent.setRecordValue("expanded",!1,e),this.parent.setRecordValue("hasChildRecords",!1,e))}},P.prototype.removeChildItem=function(e){for(var t,i=0;i<e.childRecords.length;i++){for(var a=e.childRecords[i],n=void 0,n=this.parent.dataSource instanceof U.DataManager?ne.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource,r=0;r<n.length;r++)n[r][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(t=r);if(-1!==t){0<n.length&&n.splice(t,1);for(var s=void 0,o=0;o<this.treeGridData.length;o++)this.treeGridData[o][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(s=o);this.treeGridData.splice(s,1),this.parent.ids.splice(s,1)}a.hasChildRecords&&this.removeChildItem(a)}},P.prototype.insertDraggedRecordAtIndex=function(e,t){var i=t.index,a=e.childRecords.findIndex(function(e){return e.index>=i});-1===a?e.childRecords.splice(e.childRecords.length,0,t):e.childRecords.splice(a,0,t)},P.prototype.recordLevel=function(){var e,t=this.parent,i=this.draggedRecord,a=this.droppedRecord,n=t.taskFields.child;a.hasChildRecords||(a.hasChildRecords=!0,a.childRecords.length)||(a.childRecords=[],!t.taskFields.parentID&&ne.isNullOrUndefined(a.taskData[n])&&(a.taskData[n]=[])),"middleSegment"===this.dropPosition&&(delete(e=ne.extend({},a)).childRecords,e={uniqueID:e.uniqueID,expanded:e.expanded,level:e.level,index:e.index,taskId:e.ganttProperties.rowUniqueID},this.parent.setRecordValue("parentItem",e,i),this.parent.setRecordValue("parentUniqueID",a.uniqueID,i),this.insertDraggedRecordAtIndex(a,i),ne.isNullOrUndefined(i)||t.taskFields.parentID||ne.isNullOrUndefined(a.taskData[n])||a.taskData[t.taskFields.child].splice(a.childRecords.length,0,i.taskData),!ne.isNullOrUndefined(a.ganttProperties.segments)&&0<a.ganttProperties.segments.length&&(a.ganttProperties.segments=null,a.taskData[t.taskFields.segments]=null),i.hasChildRecords?(i.level=a.level+1,this.updateChildRecordLevel(i,1)):i.level=a.level+1,a.expanded=!0)};f=P;function P(e){this.isFromDeleteMethod=!1,this.targetedRecords=[],this.isValidatedEditedRecord=!1,this.createArray=!0,this.violationArgs={},this.deletedRecord=[],this.canReset=!1,this.isFlatDataHaveUnAsignedTask=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.confirmDialog=null,this.taskbarMoved=!1,this.predecessorUpdated=!1,this.isBreakLoop=!1,this.isDialogEditing=!1,this.remoteCrud=!1,this.deletedTaskDetails=[],ne.initializeTelemetryFeature("Edit","Gantt"),this.parent=e,this.parent.predecessorModule.validatedChildItems=[],this.parent.editSettings.allowEditing&&"Auto"===this.parent.editSettings.mode&&(this.cellEditModule=new Va(this.parent)),this.parent.taskFields.dependency&&this.parent.editSettings.allowEditing&&(this.parent.connectorLineEditModule=new za(this.parent)),(this.parent.editSettings.allowAdding||this.parent.editSettings.allowEditing&&("Dialog"===this.parent.editSettings.mode||"Auto"===this.parent.editSettings.mode))&&(this.dialogModule=new Ga(this.parent)),this.parent.editSettings.allowTaskbarEditing&&(this.taskbarEditModule=new Ha(this.parent)),this.parent.editSettings.allowDeleting&&(e=ne.createElement("div",{id:this.parent.element.id+"_deleteConfirmDialog"}),this.parent.element.appendChild(e),this.renderDeleteConfirmDialog()),this.parent.treeGrid.recordDoubleClick=this.recordDoubleClick.bind(this),this.parent.treeGrid.editSettings.allowAdding=this.parent.editSettings.allowAdding,this.parent.treeGrid.editSettings.allowDeleting=this.parent.editSettings.allowDeleting,this.parent.treeGrid.editSettings.showDeleteConfirmDialog=this.parent.editSettings.showDeleteConfirmDialog,this.parent.treeGrid.editSettings.allowNextRowEdit=this.parent.editSettings.allowNextRowEdit,"Dialog"===this.parent.editSettings.mode&&b.TreeGrid.Inject(b.Edit),this.updateDefaultColumnEditors()}_a.prototype.getModuleName=function(){return"reorder"},_a.prototype.bindEvents=function(){var t=this;this.parent.treeGrid.columnDragStart=function(e){t.parent.trigger("columnDragStart",e)},this.parent.treeGrid.columnDrag=function(e){t.parent.trigger("columnDrag",e)},this.parent.treeGrid.columnDrop=function(e){t.parent.trigger("columnDrop",e)}},_a.prototype.destroy=function(){};var qa=_a;function _a(e){this.parent=e,b.TreeGrid.Inject(b.Reorder),this.parent.treeGrid.allowReordering=this.parent.allowReordering,this.bindEvents()}Xa.prototype.getModuleName=function(){return"resize"},Xa.prototype.bindEvents=function(){var i=this;this.parent.treeGrid.resizeStart=function(e){var t;i.parent.undoRedoModule&&i.parent.isUndoRedoItemPresent("ColumnResize")&&(i.parent.undoRedoModule.createUndoCollection(),(t={action:"ColumnResize"}).resizedColumn=Object.assign({},e.column),i.parent.undoRedoModule.getUndoCollection[i.parent.undoRedoModule.getUndoCollection.length-1]=t),i.parent.trigger("resizeStart",e)},this.parent.treeGrid.resizing=function(e){i.parent.trigger("resizing",e)},this.parent.treeGrid.resizeStop=function(e){i.parent.trigger("resizeStop",e)}},Xa.prototype.destroy=function(){};var Za=Xa;function Xa(e){this.parent=e,b.TreeGrid.Inject(b.Resize),this.parent.treeGrid.allowResizing=this.parent.allowResizing,this.bindEvents()}C.prototype.getModuleName=function(){return"filter"},C.prototype.updateCustomFilters=function(){for(var e=this.parent.taskFields,t=0;t<this.parent.ganttColumns.length;t++){var i=this.parent.ganttColumns[t];("datepickeredit"!==i.editType&&"datetimepickeredit"!==i.editType||i.field!==e.startDate&&i.field!==e.endDate&&i.field!==e.baselineStartDate&&i.field!==e.baselineEndDate)&&(i.field!==e.duration||"stringedit"!==i.editType)||this.initiateFiltering(this.parent.ganttColumns[t])}},C.prototype.updateModel=function(){this.parent.filterSettings=this.parent.treeGrid.filterSettings},C.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("actionBegin",this.actionBegin,this),this.parent.on("actionComplete",this.actionComplete,this),this.parent.on("columnMenuOpen",this.columnMenuOpen,this)},C.prototype.wireEvents=function(e){ne.EventHandler.add(document.getElementById(e),"click",this.mouseClickHandler,this)},C.prototype.initiateFiltering=function(e){var t=this.parent.getColumnByField(e.field,this.parent.treeGridModule.treeGridColumns);e.allowFiltering=!1!==e.allowFiltering,!e.allowFiltering||"Menu"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||e.filter||(e.filter={ui:this.getCustomFilterUi(e)}),t&&(t.allowFiltering=e.allowFiltering,t.filter=e.allowFiltering?e.filter:{})},C.prototype.getCustomFilterUi=function(e){var t=this.parent.taskFields,i={};return"datepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?"datetimepickeredit"!==e.editType||e.field!==t.startDate&&e.field!==t.endDate&&e.field!==t.baselineStartDate&&e.field!==t.baselineEndDate?e.field===t.duration&&"stringedit"===e.editType&&(i=this.getDurationFilter()):i=this.getDateTimePickerFilter():i=this.getDatePickerFilter(e.field),i},C.prototype.mouseClickHandler=function(e){ne.closest(e.target,".e-excelfilter")&&this.parent.treeGrid.grid.notify("click",e)},C.prototype.unWireEvents=function(){ne.EventHandler.remove(this.parent.element,"click",this.mouseClickHandler)},C.prototype.getDatePickerFilter=function(e){var a,n=this,t=this.parent,i=e===t.taskFields.startDate||e===t.taskFields.baselineStartDate?t.defaultStartTime:t.defaultEndTime;return{create:function(e){var t=T.getCustomDateFormat(e.column.format,e.column.type),i=ne.createElement("input",{className:"flm-input"});e.target.appendChild(i),(a=new W.DatePicker({placeholder:n.parent.localeObj.getConstant("enterValue"),format:t})).enableRtl=n.parent.enableRtl,a.appendTo(i)},write:function(e){a.value=e.filteredValue},read:function(e){a.value&&a.value.setSeconds(i),e.fltrObj.filterByColumn(e.column.field,e.operator,a.value)}}},C.prototype.getDateTimePickerFilter=function(){var a,n=this;return{create:function(e){var t=T.getCustomDateFormat(e.column.format,e.column.type),i=ne.createElement("input",{className:"flm-input"});e.target.appendChild(i),(a=new W.DateTimePicker({placeholder:n.parent.localeObj.getConstant("enterValue"),format:t})).enableRtl=n.parent.enableRtl,a.appendTo(i)},write:function(e){a.value=e.filteredValue},read:function(e){e.fltrObj.filterByColumn(e.column.field,e.operator,a.value)}}},C.prototype.getDurationFilter=function(){var n,r=this,s=this.parent,o="";return{create:function(e){var t=ne.createElement("input",{className:"e-input"});t.setAttribute("placeholder",r.parent.localeObj.getConstant("enterValue")),e.target.appendChild(t),(n=new B.TextBox).enableRtl=r.parent.enableRtl,n.appendTo(t)},write:function(e){n.value=e.filteredValue?o:""},read:function(e){var t,i=r.parent.dataOperation.getDurationValue(n.value),a=ne.getValue("duration",i),i=ne.getValue("durationUnit",i);o=0<=a?(t=void 0,"minute"===i?t=60*a/s.secondsPerDay:"hour"===i?t=60*a*60/s.secondsPerDay:(t=a,i="day"),e.fltrObj.filterByColumn(e.column.field,e.operator,t),r.parent.dataOperation.getDurationString(a,i)):(e.fltrObj.filterByColumn(e.column.field,e.operator,null),null)}}},C.prototype.columnMenuOpen=function(e){this.filterMenuElement&&document.body.contains(this.filterMenuElement)&&ne.remove(this.filterMenuElement),this.filterMenuElement=null},C.prototype.actionBegin=function(e){},C.prototype.closeFilterOnContextClick=function(e){var t,i=document.querySelector("body > div.e-datepicker"),a=document.querySelector("body > div.e-datetimepicker");this.filterMenuElement&&document.body.contains(this.filterMenuElement)&&(t=ne.closest(e,"#"+this.parent.element.id)||e.querySelector("#"+this.parent.element.id),(this.filterMenuElement.contains(e)||ne.isNullOrUndefined(t))&&(this.filterMenuElement.contains(e)||this.parent.enableAdaptiveUI||!ne.isNullOrUndefined(i)||!ne.isNullOrUndefined(a)||"DIV"!==e.nodeName&&"HTML"!==e.nodeName&&"SPAN"!==e.nodeName&&"BUTTON"!==e.nodeName||e.classList.contains("e-dropdownbase"))||(ne.remove(this.filterMenuElement),this.parent.treeGrid.grid.notify("filter-menu-close",{isOpen:!1}),this.filterMenuElement=null))},C.prototype.actionComplete=function(e){var t,i,a,n,r,s;ne.isNullOrUndefined(e.filterModel)||ne.isNullOrUndefined(e.filterModel.dialogObj)||ne.isNullOrUndefined(e.filterModel.dialogObj.element)||"Excel"===this.parent.filterSettings.type&&this.wireEvents(e.filterModel.dialogObj.element.id),e.requestType===T.filterAfterOpen&&(i=this.parent.treeGrid.filterSettings.type,t=this.parent.treeGrid.getColumnByField(e.columnName).filter.type,this.filterMenuElement=ne.getValue("filterModel."+("Menu"===(t||i)?"dlgObj":"dialogObj")+".element",e),this.updateFilterMenuPosition(this.filterMenuElement,e),t=this.parent.taskFields.id,i=this.parent.taskFields.dependency,a=this.parent.taskFields.resourceInfo,n=this.parent.treeGrid.grid.filterModule,n=ne.getValue("values",n),e.columnName===i&&ne.isNullOrUndefined(ne.getValue(i,n))||e.columnName===a&&ne.isNullOrUndefined(ne.getValue(a,n))?(r=this.filterMenuElement.querySelector(".e-dropdownlist"),s=void 0,ne.isNullOrUndefined(r)||((s=ne.getValue("ej2_instances[0]",r)).index=2,s.dataBind())):e.columnName===t&&ne.isNullOrUndefined(ne.getValue(t,n))&&"Menu"===this.parent.treeGrid.filterSettings.type&&(r=this.filterMenuElement.querySelector(".e-flmenu-input"),s=ne.getValue("ej2_instances[0]",r),!ne.isNullOrUndefined(s))&&ne.isNullOrUndefined(this.parent.columnByField[e.columnName].format)&&(s.format="n"))},C.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),a=this.parent.element.offsetParent.getBoundingClientRect(),e=e.getBoundingClientRect(),n=t.getBoundingClientRect(),r=i.left-e.left,r=this.parent.enableRtl?Math.abs(r)-n.width:e.width-r,a=a.top,i=("BODY"===t.offsetParent.tagName&&(a=0),i.width<=r+n.width?(r-=e.width+n.width,e.left<n.width&&(r=e.left+n.width/2)):r<0&&(r+=n.width+e.width),this.parent.element),n=window.getComputedStyle(i),i=(r-=parseFloat(n.paddingLeft),e.top-a+window.scrollY);t.style.left="",t.style.top=i+"px",t.style.marginLeft=r+"px"},C.prototype.updateFilterMenuPosition=function(e,t){ne.addClass([e],"e-gantt"),this.parent.enableAdaptiveUI||document.querySelector("#"+this.parent.controlId).appendChild(e),e.style.display="block";var i,a,n=this.parent.treeGrid.filterSettings.type,n=this.parent.treeGrid.getColumnByField(t.columnName).filter.type||n;this.parent.showColumnMenu?(a=document.querySelector("#treeGrid"+this.parent.controlId+"_gridcontrol_colmenu_Filter"))&&(e.style.zIndex=a.parentElement.style.zIndex,"Menu"===this.parent.treeGrid.filterSettings.type?this.setPosition(a,ne.getValue("filterModel.dlgObj.element",t)):((i=ne.getValue("filterModel.dialogObj.element",t))&&(i.style.visibility="hidden"),this.setPosition(a,i))):(a=this.parent.treeGrid.grid.getColumnHeaderByField(t.columnName).querySelector(".e-filtermenudiv"),T.getFilterMenuPostion(a,ne.getValue("filterModel."+("Menu"===n?"dlgObj":"dialogObj"),t))),e.style.visibility="visible",("Menu"===n?e.querySelector(".e-valid-input"):document.querySelector(".e-searchinput")).focus()},C.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("actionBegin",this.actionBegin),this.parent.off("actionComplete",this.actionComplete),this.parent.off("columnMenuOpen",this.columnMenuOpen))},C.prototype.destroy=function(){this.removeEventListener(),this.unWireEvents()};var Ya=C;function C(e){this.filteredResult=[],ne.initializeTelemetryFeature("Filter","Gantt"),this.parent=e,b.TreeGrid.Inject(b.Filter),this.parent.treeGrid.allowFiltering=this.parent.allowFiltering,this.updateCustomFilters(),this.parent.treeGrid.filterSettings=T.getActualProperties(this.parent.filterSettings),this.addEventListener()}Qa.prototype.getModuleName=function(){return"sort"},Qa.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this)},Qa.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("updateModel",this.updateModel)},Qa.prototype.destroy=function(){this.removeEventListener()},Qa.prototype.sortColumn=function(e,t,i){this.parent.treeGrid.sortByColumn(e,t,i)},Qa.prototype.clearSorting=function(){this.parent.treeGrid.clearSorting()},Qa.prototype.updateModel=function(){this.parent.sortSettings=this.parent.treeGrid.sortSettings},Qa.prototype.removeSortColumn=function(e){this.parent.treeGrid.grid.removeSortColumn(e)};var Ka=Qa;function Qa(e){ne.initializeTelemetryFeature("Sort","Gantt"),this.parent=e,b.TreeGrid.Inject(b.Sort),this.parent.treeGrid.allowSorting=this.parent.allowSorting,this.parent.treeGrid.sortSettings=T.getActualProperties(this.parent.sortSettings),this.addEventListener()}R.prototype.getModuleName=function(){return"selection"},R.prototype.wireEvents=function(){this.parent.on("selectRowByIndex",this.selectRowByIndex,this),this.parent.isAdaptive?(this.parent.on("chartMouseClick",this.mouseUpHandler,this),this.parent.on("treeGridClick",this.popUpClickHandler,this)):this.parent.on("chartMouseUp",this.mouseUpHandler,this)},R.prototype.selectRowByIndex=function(){-1===this.parent.selectedRowIndex&&-1===this.parent.staticSelectedRowIndex||(this.selectRow(-1!==this.parent.staticSelectedRowIndex?this.parent.staticSelectedRowIndex:this.parent.selectedRowIndex),this.parent.staticSelectedRowIndex=-1)},R.prototype.bindEvents=function(){this.parent.treeGrid.rowSelecting=this.rowSelecting.bind(this),this.parent.treeGrid.rowSelected=this.rowSelected.bind(this),this.parent.treeGrid.rowDeselecting=this.rowDeselecting.bind(this),this.parent.treeGrid.rowDeselected=this.rowDeselected.bind(this),this.parent.treeGrid.cellSelecting=this.cellSelecting.bind(this),this.parent.treeGrid.cellSelected=this.cellSelected.bind(this),this.parent.treeGrid.cellDeselecting=this.cellDeselecting.bind(this),this.parent.treeGrid.cellDeselected=this.cellDeselected.bind(this)},R.prototype.rowSelecting=function(e){this.parent.isGanttChartRendered?(e.isCtrlPressed=this.isMultiCtrlRequest||e.isCtrlPressed,e.isShiftPressed=this.isMultiShiftRequest||e.isShiftPressed,e.target=this.actualTarget,ne.isNullOrUndefined(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.parent.selectionSettings&&this.parent.selectionSettings.persistSelection&&(this.parent.treeGrid.grid.selectionModule.checkSelectAllClicked=!0),this.parent.trigger("rowSelecting",e),(this.isMultiShiftRequest||this.isMultiCtrlRequest)&&(this.isMultiShiftRequest=this.isMultiCtrlRequest=!1)):e.cancel=!0},R.prototype.rowSelected=function(e){var t="rowIndexes",t="Multiple"!==this.parent.selectionSettings.type||ne.isNullOrUndefined(e[t])?[e.rowIndex]:e[t];if((this.addRemoveClass(t,e.name),this.selectedRowIndexes=ne.extend([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:this.parent.treeGrid.grid.selectedRowIndex},!0),this.isMultiShiftRequest&&(this.selectedRowIndexes=t),this.parent.autoFocusTasks)&&(this.parent.enableTimelineVirtualization&&(this.parent.isRowSelected=!0),!this.parent.enableInfiniteTimelineScroll))if(e.data&&!ne.isNullOrUndefined(e.data.length))for(var i=0;i<e.data.length;i++)this.parent.ganttChartModule.updateScrollLeft(e.data[i].ganttProperties.left);else this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping&&ne.isNullOrUndefined(ne.getValue("data.ganttProperties.left",e))&&(e.data=this.parent.getRecordByID(e.data.taskId)),this.parent.ganttChartModule.isTouchMoved||this.parent.ganttChartModule.updateScrollLeft(ne.getValue("data.ganttProperties.left",e));ne.isNullOrUndefined(e.target)&&(e.target=this.actualTarget),ne.isNullOrUndefined(e.foreignKeyData)||0!==Object.keys(e.foreignKeyData).length||delete e.foreignKeyData,this.prevRowIndex=e.rowIndex,ne.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(e),ne.isNullOrUndefined(this.parent.focusModule.previousActiveElement)||(t=this.parent.focusModule.previousActiveElement,ne.removeClass([t],"e-focused"),ne.removeClass([t],"e-focus")),this.parent.trigger("rowSelected",e),this.actualTarget=void 0},R.prototype.rowDeselecting=function(e){this.parent.chartRowsModule.isGridRowRefreshed&&(e.cancel=!0),e.target=this.actualTarget,e.isInteracted=this.isInteracted;var t=this.parent.undoRedoModule;t&&t.isPreventRowDeselectOnUndoRedo&&(e.cancel=!0),this.parent.trigger("rowDeselecting",e)},R.prototype.rowDeselected=function(e){var t,i;if(0!==this.multipleIndexes.length)t=this.multipleIndexes,this.addRemoveClass(t);else if(!0===e.isHeaderCheckboxClicked)this.clearSelection();else{if(ne.isNullOrUndefined(e.rowIndexes))t=[e.rowIndex];else{for(var a=0;a<e.rowIndexes.length;a++)e.rowIndexes[a]===e.rowIndex&&(i=!0);t=i?e.rowIndexes:[e.rowIndex]}this.addRemoveClass(t)}this.selectedRowIndexes=ne.extend([],this.getSelectedRowIndexes(),[],!0),this.parent.setProperties({selectedRowIndex:-1},!0),1===this.selectedRowIndexes.length&&this.parent.setProperties({selectedRowIndex:this.selectedRowIndexes[0]},!0),ne.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&0===this.selectedRowIndexes.length&&this.hidePopUp(),e.target=this.actualTarget,e.isInteracted=this.isInteracted,this.parent.trigger("rowDeselected",e),this.isInteracted=!1,this.multipleIndexes=[]},R.prototype.cellSelecting=function(e){var t=new U.Deferred;return this.parent.trigger("cellSelecting",e,function(e){t.resolve(e)}),t},R.prototype.cellSelected=function(e){this.parent.trigger("cellSelected",e),ne.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},R.prototype.cellDeselecting=function(e){this.parent.trigger("cellDeselecting",e)},R.prototype.cellDeselected=function(e){this.parent.trigger("cellDeselected",e),ne.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems()},R.prototype.selectCell=function(e,t){this.parent.treeGrid.selectCell(e,t)},R.prototype.selectCells=function(e){this.parent.treeGrid.grid.selectCells(e)},R.prototype.selectRow=function(t,e,i){var a,n=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),n=(this.parent.enableVirtualization&&(this.parent.treeGridModule.addedRecord||this.parent.editModule&&this.parent.editModule.isAdded)&&(t=this.parent.getExpandedRecords(this.parent.flatData).indexOf(this.parent.flatData[t]),this.parent.treeGridModule.addedRecord=!1,this.parent.editModule)&&(this.parent.editModule.isAdded=!1),n.filter(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1===t})[0]);-1===t||ne.isNullOrUndefined(n)&&!this.parent.enableVirtualization||"Cell"===this.parent.selectionSettings.mode||(this.parent.showActiveElement&&!ne.isNullOrUndefined(i)&&!i||this.isFromChart?(this.isFromChart&&(this.isFromChart=!1),this.parent.treeGrid.grid.selectionModule.preventFocus=!0):this.parent.treeGrid.grid.selectionModule.preventFocus=!1,!0!==(a=ne.isNullOrUndefined(this.selectedClass)||this.selectedClass!==n||e?a:!0)&&this.parent.treeGrid.selectRow(t,e),this.parent.treeGrid.grid.selectionModule.preventFocus=!0!==this.parent.treeGrid.grid.selectionModule.preventFocus&&this.parent.treeGrid.grid.selectionModule.preventFocus,this.prevRowIndex=t,this.selectedClass=n)},R.prototype.selectRows=function(e){!ne.isNullOrUndefined(e)&&0<e.length&&this.parent.treeGrid.selectRows(e)},R.prototype.getSelectedRowIndexes=function(){return this.parent.treeGrid.getSelectedRowIndexes()},R.prototype.getSelectedRowCellIndexes=function(){return this.parent.treeGrid.getSelectedRowCellIndexes()},R.prototype.getSelectedRecords=function(){if(this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping){for(var i=[],a=this.parent.selectionModule.getSelectedRowIndexes(),n=this,e=0;e<a.length;e++)!function(t){var e=n.parent.currentViewData.filter(function(e){return e.index===a[t]})[0];i.push(e)}(e);return i}return this.parent.treeGrid.getSelectedRecords()},R.prototype.getCellSelectedRecords=function(){for(var e=this.parent.selectionModule.getSelectedRowCellIndexes(),t=[],i=0;i<e.length;i++)t.push(this.parent.currentViewData[e[i].rowIndex]);return t},R.prototype.getSelectedRows=function(){return this.parent.treeGrid.getSelectedRows()},R.prototype.clearSelection=function(){this.addRemoveClass(this.selectedRowIndexes),this.parent.treeGrid.clearSelection(),this.parent.selectedRowIndex=-1,this.selectedRowIndexes=[],this.selectedClass=null,ne.isNullOrUndefined(this.parent.toolbarModule)||this.parent.toolbarModule.refreshToolbarItems(),this.isInteracted=!1},R.prototype.highlightSelectedRows=function(e,t){var i;this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch,this.isMultiShiftRequest=e.shiftKey,this.actualTarget=e.target,this.isInteracted=!0,(this.isSelectionFromChart=t)&&(t=ne.closest(e.target,"tr.e-chart-row"),t=parseInt(t.getAttribute("aria-rowindex"),10)-1,i=this.parent.selectionSettings.enableToggle,"Single"!==this.parent.selectionSettings.type&&(this.isMultiCtrlRequest||this.isMultiShiftRequest||this.parent.treeGrid.grid.isCheckBoxSelection)?this.isMultiShiftRequest?this.selectRowsByRange(ne.isNullOrUndefined(this.prevRowIndex)?t:this.prevRowIndex,t):(ne.setValue("isMultiCtrlRequest",!0,this.parent.treeGrid.grid.selectionModule),this.parent.treeGrid.grid.selectionModule.addRowsToSelection([t]),-1<this.selectedRowIndexes.indexOf(t)&&!this.parent.treeGrid.grid.isCheckBoxSelection&&this.addRemoveClass([t],e.name)):(this.parent.selectionSettings.persistSelection&&this.addRemoveClass(this.selectedRowIndexes,e.name),(!this.parent.allowTaskbarDragAndDrop||this.parent.allowTaskbarDragAndDrop&&this.parent.rowDragAndDropModule&&!this.parent.rowDragAndDropModule.draggedRecord)&&(this.isFromChart=!0,this.selectRow(t,i))))},R.prototype.getselectedrowsIndex=function(e,t){for(var i=[],a=e<t?{i:e,max:t}:{i:t,max:e},n=a.i,r=a.max;n<=r;n++)i.push(n);t<e&&i.reverse(),this.selectedRowIndexes=i},R.prototype.selectRowsByRange=function(e,t){this.isSelectionFromChart=!0,this.getselectedrowsIndex(e,t),this.selectRows(this.selectedRowIndexes)},R.prototype.addRemoveClass=function(r,s){if("number"==typeof r&&(r=[r]),this.parent.ganttChartModule.chartBodyContent)for(var o=[].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector("tbody").children),l=this,e=0;e<r.length;e++)!function(t){var e,i,a,n=o.filter(function(e){return parseInt(e.getAttribute("aria-rowindex"),10)-1===r[parseInt(t.toString(),10)]})[0];ne.isNullOrUndefined(n)||(e=!1,i=l.getSelectedRowIndexes().indexOf(r[parseInt(t.toString(),10)]),a=l.getSelectedRecords().length,l.parent.selectionSettings.persistSelection&&l.parent.selectionSettings.enableToggle&&!ne.isNullOrUndefined(s)&&"Multiple"!==l.parent.selectionSettings.type&&0<a&&(e=!0),l.parent.selectionSettings.enableToggle&&l.parent.selectionSettings.persistSelection&&-1<i&&"Single"===l.parent.selectionSettings.type&&e||-1<i&&!ne.isNullOrUndefined(s)&&"Multiple"===l.parent.selectionSettings.type?l.addClass(n):ne.isNullOrUndefined(s)?l.removeClass(n):-1<i&&l.addClass(n),l.parent.selectionSettings.enableToggle&&-1<i&&("Single"===l.parent.selectionSettings.type||!l.isMultiCtrlRequest&&!l.isMultiShiftRequest)&&l.parent.selectionSettings.persistSelection&&"chartMouseUp"===s&&l.isSelectionFromChart&&l.removeClass(n))}(e)},R.prototype.addClass=function(e){ne.addClass([e],"e-active"),e.setAttribute("aria-selected","true")},R.prototype.removeClass=function(e){ne.removeClass([e],"e-active"),e.removeAttribute("aria-selected")},R.prototype.showPopup=function(e){this.isSelectionFromChart?(T.setCssInGridPopUp(this.parent.element.querySelector(".e-ganttpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(this.enableSelectMultiTouch&&(1<this.getSelectedRecords().length||1<this.getSelectedRowCellIndexes().length)?" e-spanclicked":"")),document.getElementsByClassName("e-gridpopup")[0].style.display="none",this.openPopup=!0):0===this.selectedRowIndexes.length&&this.hidePopUp()},R.prototype.hidePopUp=function(){this.openPopup?(document.getElementsByClassName("e-ganttpopup")[0].style.display="none",this.openPopup=!1):document.getElementsByClassName("e-gridpopup")[0].style.display="none"},R.prototype.popUpClickHandler=function(e){var e=e.target,t=this.parent.treeGrid.grid,i=ne.closest(e,".e-ganttpopup")?ne.closest(e,".e-ganttpopup"):ne.closest(e,".e-gridpopup");i?(i=i.querySelector(".e-rowselect"),ne.closest(e,".e-ganttpopup")&&!i.classList.contains("e-spanclicked")?(this.enableSelectMultiTouch=!0,i.classList.add("e-spanclicked")):ne.closest(e,".e-gridpopup")&&i.classList.contains("e-spanclicked")?(this.openPopup=!0,this.enableSelectMultiTouch=!0):(this.hidePopUp(),this.enableSelectMultiTouch=!1,ne.closest(e,".e-ganttpopup")&&i.classList.remove("e-spanclicked"))):"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&ne.closest(e,".e-rowcell")&&(0===this.selectedRowIndexes.length&&"Row"===this.parent.selectionSettings.mode||0===this.getCellSelectedRecords().length&&"Cell"===this.parent.selectionSettings.mode)&&this.hidePopUp(),t&&ne.setValue("enableSelectMultiTouch",this.enableSelectMultiTouch,t.selectionModule)},R.prototype.mouseUpHandler=function(e){var t=!1,i=document.querySelectorAll(".e-drag-item"),a=null;e.target.closest(".e-rowcell")?a=e.target:e.target.closest(".e-chart-row")&&(a=e.target.closest(".e-left-label-container")||e.target.closest(".e-taskbar-main-container")||e.target.closest(".e-right-label-container")),this.parent.focusModule&&this.parent.focusModule.setActiveElement(a),!(t=this.parent.editModule&&this.parent.editSettings.allowTaskbarEditing&&this.parent.editModule.taskbarEditModule&&((a=this.parent.editModule.taskbarEditModule).isMouseDragged||a.tapPointOnFocus)?!0:t)&&this.parent.element.contains(e.target)&&1!==i.length&&(a=T.parentsUntil(e.target,"e-chart-row"),i=(t=e.target).classList.contains("e-rowcell")||t.closest("td.e-rowcell")&&t.closest("td.e-rowcell").classList.contains("e-rowcell")||t.classList.contains("e-row")||t.parentElement&&t.parentElement.classList.contains("e-checkbox-wrapper")||t.classList.contains("e-treegridexpand")||t.classList.contains("e-treegridcollapse")||!ne.isNullOrUndefined(a),this.popUpClickHandler(e),"Cell"!==this.parent.selectionSettings.mode&&i?(ne.closest(e.target,"tr.e-chart-row")?(this.parent.enableVirtualization&&(this.parent.treeGrid.grid.selectionModule.isInteracted=!0),this.parent.treeGrid.isFromChartSide=!0,this.highlightSelectedRows(e,!0)):(this.parent.treeGrid.isFromChartSide=!1,this.highlightSelectedRows(e,!1)),"Multiple"===this.parent.selectionSettings.type&&this.parent.isAdaptive&&(0<this.selectedRowIndexes.length?this.showPopup(e):this.hidePopUp())):this.isSelectionFromChart=!1)},R.prototype.maintainSelectedRecords=function(e){-1<this.parent.selectionModule.getSelectedRowIndexes().indexOf(e)&&this.addRemoveClass([e])},R.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off("selectRowByIndex",this.selectRowByIndex),this.parent.isAdaptive?(this.parent.off("chartMouseClick",this.mouseUpHandler),this.parent.off("treeGridClick",this.popUpClickHandler)):this.parent.off("chartMouseUp",this.mouseUpHandler))};var $a=R;function R(e){this.isSelectionFromChart=!1,this.isFromChart=!1,this.multipleIndexes=[],this.selectedRowIndexes=[],this.enableSelectMultiTouch=!1,this.openPopup=!1,this.parent=e,this.bindEvents(),this.parent.treeGrid.selectedRowIndex=this.parent.selectedRowIndex,this.parent.treeGrid.allowSelection=this.parent.allowSelection,this.parent.treeGrid.grid.selectionSettings.enableToggle=this.parent.selectionSettings.enableToggle,this.parent.treeGrid.selectionSettings=T.getActualProperties(this.parent.selectionSettings),this.wireEvents()}M.prototype.getModuleName=function(){return"toolbar"},M.prototype.renderToolbar=function(){if(0<(this.parent.toolbar||[]).length){this.element=ne.createElement("div",{id:this.parent.controlId+"_Gantt_Toolbar",className:"e-gantt-toolbar"}),this.parent.treeGrid.grid.headerModule?this.parent.element.insertBefore(this.element,this.parent.treeGridPane.offsetParent):this.parent.element.appendChild(this.element);for(var e=0,t=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath","Undo","Redo"];e<t.length;e++){var i=t[e],a=void 0,n=void 0,n="CriticalPath"===i?(a="critical-path","criticalPath"):(a=i.toLowerCase(),i[0].toLowerCase()+i.slice(1));this.predefinedItems[i]={id:this.parent.element.id+"_"+a,prefixIcon:"e-"+a,text:this.parent.isAdaptive?"":this.parent.localeObj.getConstant(n),tooltipText:this.parent.localeObj.getConstant(n)+("add"===n||"edit"===n||"delete"===n?this.parent.localeObj.getConstant("task"):"expandAll"===n||"collapseAll"===n?this.parent.localeObj.getConstant("tasks"):""),align:this.parent.isAdaptive?"Right":"Left"},this.parent.enableRtl&&("PrevTimeSpan"===i&&(this.predefinedItems[i].prefixIcon="e-nexttimespan"),"NextTimeSpan"===i)&&(this.predefinedItems[i].prefixIcon="e-prevtimespan")}var r=this.parent.localeObj.getConstant("search");this.parent.isAdaptive?this.predefinedItems.Search={id:this.id+"_searchbutton",prefixIcon:"e-search-icon",tooltipText:r,align:"Right"}:this.predefinedItems.Search={id:this.id+"_search",template:'<div class="e-input-group e-search" role="search"><input id="'+this.id+'_searchbar" class="e-input" name="input" type="search"placeholder= "'+r+'"/><span id="'+this.id+'_clearbutton" class="e-input-group-icon e-icons e-sicon"tabindex="-1" aria-label= "clear" role="button" style="cursor: default;"></span><span id="'+this.id+'_searchbutton" class="e-input-group-icon e-search-icon e-icons"tabindex="-1" title="'+r+'" aria-label= "search" role="button"></span></div>',tooltipText:r,align:"Right",cssClass:"e-search-wrapper"},this.createToolbar()}},M.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},M.prototype.createToolbar=function(){var e=this.getItems(),e=(this.toolbar=new V.Toolbar({items:e,enableRtl:this.parent.enableRtl,clicked:this.toolbarClickHandler.bind(this),height:this.parent.isAdaptive?48:"auto"}),this.toolbar.isStringTemplate=!0,this.toolbar.isReact=this.parent.isReact,this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this),"viewContainerRef"),e=(this.parent[e]&&(this.toolbar.registeredTemplate={},this.toolbar[e]=this.parent[e]),this.toolbar.appendTo(this.element),this.parent.treeGrid.grid&&this.parent.isReact&&(this.parent.treeGrid.grid.portals=this.parent.portals),this.element.querySelector("#"+this.parent.element.id+"_cancel")),t=this.element.querySelector("#"+this.parent.element.id+"_update"),i=(e&&ne.addClass([e],fe),t&&ne.addClass([t],fe),!1);this.parent.toolbar.map(function(e){"Search"===e&&(i=!0)}),this.parent.isAdaptive&&i?(this.element.insertBefore(this.getSearchBarElement(),this.element.childNodes[0]),this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar"),new B.TextBox({placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,floatLabelType:"Never",showClearButton:!0}).appendTo(this.searchElement)):this.searchElement=this.element.querySelector("#"+this.parent.element.id+"_searchbar"),this.parent.filterModule&&(this.wireEvent(),this.parent.searchSettings)&&this.updateSearchTextBox(),this.enableItems([this.parent.controlId+"_redo",this.parent.controlId+"_undo"],!1),this.parent.readOnly&&this.enableItems([this.parent.element.id+"_add",this.parent.element.id+"_update",this.parent.element.id+"_delete",this.parent.element.id+"_cancel",this.parent.element.id+"_indent",this.parent.element.id+"_outdent"],!1)},M.prototype.getSearchBarElement=function(){var e=this,t=ne.createElement("div",{className:"e-adaptive-searchbar",styles:"display: none"}),i=ne.createElement("input",{attrs:{type:"text"},id:this.parent.element.id+"_searchbar"}),a=ne.createElement("span",{className:"e-backarrowspan e-icons"});return a.onclick=function(){t.style.display="none",e.element.childNodes[1].style.display="block"},t.appendChild(a),t.appendChild(i),t},M.prototype.wireEvent=function(){this.searchElement&&(ne.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),ne.EventHandler.add(this.searchElement,"focus",this.focusHandler,this),ne.EventHandler.add(this.searchElement,"blur",this.blurHandler,this))},M.prototype.propertyChanged=function(e){ne.getValue("module",e)===this.getModuleName()&&this.parent.toolbar&&(this.element&&this.element.parentNode&&ne.remove(this.element),this.renderToolbar(),this.refreshToolbarItems())},M.prototype.unWireEvent=function(){this.searchElement&&(ne.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),ne.EventHandler.remove(this.searchElement,"focus",this.focusHandler),ne.EventHandler.remove(this.searchElement,"blur",this.blurHandler),this.searchElement=null),this.parent.isDestroyed||this.parent.off("ui-toolbarupdate",this.propertyChanged)},M.prototype.keyUpHandler=function(e){13===e.keyCode&&this.parent.searchSettings.key!==this.searchElement.value&&(this.parent.searchSettings.key=this.searchElement.value,this.parent.dataBind()),this.searchElement&&(this.sIcon=this.searchElement.parentElement.querySelector(".e-sicon"),this.searchElement.value.length&&this.sIcon?(this.sIcon.classList.add("e-clear-icon"),this.sIcon.setAttribute("title","Clear"),this.sIcon.style.cursor="pointer"):this.sIcon&&(this.sIcon.classList.remove("e-clear-icon"),this.sIcon.removeAttribute("title"),this.sIcon.style.cursor="default"))},M.prototype.focusHandler=function(e){e.target.parentElement.classList.add("e-input-focus")},M.prototype.blurHandler=function(e){e.target.parentElement.classList.remove("e-input-focus")},M.prototype.updateSearchTextBox=function(){this.searchElement&&this.searchElement.value!==this.parent.searchSettings.key&&(this.searchElement.value=this.parent.searchSettings.key)},M.prototype.getItems=function(){var e,t=[],i=this.parent.toolbar,a=-1;i.forEach(function(e,t){("string"==typeof e&&"Search"===e||"object"==typeof e&&"Search"===e.text)&&(a=t)}),-1<a&&(e=i.splice(a,1),i.push(e[0]));for(var n=0,r=i;n<r.length;n++){var s=r[n];t.push("string"==typeof s?this.getItemObject(s):this.getItem(s))}return t},M.prototype.getItem=function(e){var t=this.predefinedItems[e.text],t=t?ne.extend(t,t,e):e;return t.align||(t.align=this.parent.isAdaptive?"Right":"Left"),t},M.prototype.getItemObject=function(e){return this.predefinedItems[e]||{text:e,id:this.id+"_"+e}},M.prototype.toolbarClickHandler=function(a){var n=this,r=this.parent,s=this.id;this.parent.isToolBarClick=!1,ne.extend(a,{cancel:!1}),r.trigger(La,a,function(e){if(!e.cancel)switch(a.item.properties.id!==n.parent.element.id+"_pdfexport"&&a.item.properties.id!==n.parent.element.id+"_critical-path"||n.parent.showLoadingIndicator(),!0!==n.parent.isAdaptive||e.item.id!==s+"_edit"&&e.item.id!==s+"_add"&&e.item.id!==s+"_delete"&&e.item.id!==s+"_searchbutton"&&e.item.id!==s+"_expandall"&&e.item.id!==s+"_collapseall"||n.parent.selectionModule&&"Multiple"===n.parent.selectionSettings.type&&(n.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none"),!ne.isNullOrUndefined(e.item)&&e.item.id){case s+"_edit":r.editModule&&r.editSettings.allowEditing&&r.editModule.dialogModule.openToolbarEditDialog();break;case s+"_indent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.indent();break;case s+"_critical-path":r.enableCriticalPath?r.enableCriticalPath=!1:r.enableCriticalPath=!0;break;case s+"_outdent":r.editModule&&r.selectionModule.getSelectedRecords().length&&r.outdent();break;case s+"_update":r.editModule.cellEditModule.isCellEdit=!1,r.treeGrid.grid.saveCell();break;case s+"_cancel":r.cancelEdit();break;case s+"_add":r.editModule&&r.editSettings.allowAdding&&r.editModule.dialogModule.openAddDialog();break;case s+"_delete":n.parent.selectionModule&&n.parent.editModule&&("Cell"!==n.parent.selectionSettings.mode&&n.parent.selectionModule.selectedRowIndexes.length||"Cell"===n.parent.selectionSettings.mode&&n.parent.selectionModule.getSelectedRowCellIndexes().length)&&n.parent.editModule.startDeleteAction();break;case s+"_search":var t=ne.getValue("originalEvent.target.id",e);t===n.parent.element.id+"_searchbutton"&&n.parent.filterModule&&(i=n.element.querySelector("#"+n.parent.element.id+"_searchbar").value,n.parent.searchSettings.key!==i)&&(n.parent.searchSettings.key=i,n.parent.dataBind()),t===n.parent.element.id+"_clearbutton"&&n.parent.filterModule&&(n.parent.searchSettings.key="",n.parent.dataBind(),n.searchElement.value="",n.searchElement)&&(n.sIcon=n.searchElement.parentElement.querySelector(".e-sicon"),n.sIcon.classList.remove("e-clear-icon"),n.sIcon.removeAttribute("title"),n.sIcon.style.cursor="default");break;case s+"_searchbutton":var i=n.element.querySelector(".e-adaptive-searchbar");i.parentElement.childNodes[1].style.display="none",i.style.display="block";break;case s+"_expandall":n.parent.ganttChartModule.expandCollapseAll("expand"),n.parent.isCollapseAll=!1;break;case s+"_collapseall":n.parent.ganttChartModule.expandCollapseAll("collapse"),n.parent.isCollapseAll=!0;break;case s+"_prevtimespan":n.parent.previousTimeSpan();break;case s+"_nexttimespan":n.parent.nextTimeSpan();break;case s+"_zoomin":n.zoomIn();break;case s+"_zoomout":n.zoomOut();break;case s+"_zoomtofit":n.zoomToFit();break;case s+"_undo":n.parent.undo();break;case s+"_redo":n.parent.redo()}})},M.prototype.zoomIn=function(){this.parent.timelineModule.processZooming(!0),this.parent.timelineModule.isZooming=!1},M.prototype.zoomToFit=function(){this.parent.timelineModule.isZoomIn&&(this.parent.timelineModule.isZoomIn=!1),this.parent.timelineModule.processZoomToFit(),this.parent.ganttChartModule.updateScrollLeft(0),this.parent.timelineModule.isZoomToFit=!1},M.prototype.zoomOut=function(){this.parent.timelineModule.processZooming(!1),this.parent.timelineModule.isZooming=!1},M.prototype.refreshToolbarItems=function(e){var t=this.parent,i=[],a=[],n=t.editSettings,r=this.id,s=t.selectedRowIndex;if(this.parent.loadChildOnDemand&&this.parent.taskFields.hasChildMapping)for(var o=0;o<t.updatedRecords.length;o++)if(t.updatedRecords[o].index===s){s=o;break}var l=!1,d=(!t.selectionModule||1!==t.selectionModule.getSelectedRecords().length&&1!==t.selectionModule.getSelectedRowCellIndexes().length||(l=!0),t.selectionModule&&"Multiple"===t.selectionSettings.type&&1<t.selectionModule.selectedRowIndexes.length&&(l=!1),!1);if(t.selectionModule&&t.selectionSettings.persistSelection){var h=t.selectionModule.getSelectedRecords().length;if(t.selectionSettings.persistSelection&&1===h)for(o=0;o<h;o++)-1===(k=t.currentViewData.indexOf(t.selectionModule.getSelectedRecords()[o]))&&(d=!0);d&&(l=!1)}var p=this.toolbar?this.toolbar.items:[],u=[r+"_add",r+"_edit",r+"_delete",r+"_update",r+"_cancel",r+"_indent",r+"_outdent"],e="ResourceView"===this.parent.viewType&&0!==ne.getValue("data.level",e)||"ProjectView"===this.parent.viewType;if((t.pdfExportModule&&t.allowPdfExport?i:a).push(r+"_pdfexport"),(t.excelExportModule&&t.allowExcelExport?i:a).push(r+"_excelexport",r+"_csvexport"),ne.isNullOrUndefined(this.parent.editModule))a.push(r+"_delete"),a.push(r+"_add"),a.push(r+"_edit"),a.push(r+"_update"),a.push(r+"_cancel"),a.push(r+"_indent"),a.push(r+"_outdent");else{var c=!!t.editModule.taskbarEditModule&&t.editModule.taskbarEditModule.touchEdit,g=t.flatData&&t.flatData.length,f=((n.allowAdding&&!c?i:a).push(r+"_add"),(n.allowEditing&&e&&g&&l&&!c?i:a).push(r+"_edit"),n.allowEditing&&0!==s&&-1!==s&&g&&l&&"ResourceView"!==this.parent.viewType?ne.isNullOrUndefined(t.updatedRecords[s])||0!==t.updatedRecords[s].level||!g||c?(e=t.updatedRecords[s-1],ne.isNullOrUndefined(t.updatedRecords[s])||t.updatedRecords[s].level-e.level!=1||-1===s?-1!==s&&(i.push(r+"_indent"),i.push(r+"_outdent")):(a.push(r+"_indent"),i.push(r+"_outdent"))):(i.push(r+"_indent"),a.push(r+"_outdent")):(a.push(r+"_indent"),a.push(r+"_outdent")),!!t.selectionModule&&(0<t.selectionModule.getSelectedRecords().length||0<t.selectionModule.getSelectedRowCellIndexes().length));if(t.selectionModule&&t.selectionSettings.persistSelection){d&&(f=!1);var m=(h=t.selectionModule.getSelectedRecords()).length;if(t.selectionSettings.persistSelection&&1<m)for(o=0;o<m;o++){if(-1<(k=t.currentViewData.indexOf(h[o]))){f=!0;break}f=!1}}if((n.allowDeleting&&g&&f&&!c?i:a).push(r+"_delete"),"Auto"===t.editSettings.mode&&!ne.isNullOrUndefined(t.editModule.cellEditModule)&&t.editModule.cellEditModule.isCellEdit){(i=[]).push(r+"_update",r+"_cancel");for(var a=[],y=0;y<p.length;y++)p[y].id!==r+"_update"&&p[y].id!==r+"_cancel"&&-1!==u.indexOf(p[y].id)&&a.push(p[y].id)}else{a.push(r+"_update",r+"_cancel");for(y=0;y<p.length;y++)-1===i.indexOf(p[y].id)&&-1===a.indexOf(p[y].id)&&i.push(p[y].id)}}for(var D=0;D<i.length;D++){for(var k=void 0,y=0;y<p.length;y++)if(p[y].id===i[D]){k=y;break}0<p.length&&!ne.isNullOrUndefined(p[k])&&p[k].properties.visible&&this.toolbar.hideItem(k,!1)}for(var T=0;T<a.length;T++){for(k=void 0,y=0;y<p.length;y++)if(p[y].id===a[T]){k=y;break}0<p.length&&this.toolbar.hideItem(k,!0)}},M.prototype.enableItems=function(e,t){for(var i=0,a=e;i<a.length;i++){var n=a[i],n=this.element.querySelector("#"+n);n&&this.toolbar.enableItems(n.parentElement,t)}},M.prototype.destroy=function(){this.parent.filterModule&&this.unWireEvent(),this.parent.isDestroyed||(this.toolbar&&this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.toolbar.destroy(),ne.remove(this.element))};var Ja=M;function M(e){this.predefinedItems={},this.items=["Add","Edit","Update","Delete","Cancel","ExpandAll","CollapseAll","Search","PrevTimeSpan","NextTimeSpan","ZoomIn","ZoomOut","ZoomToFit","ExcelExport","CsvExport","PdfExport","Indent","Outdent","CriticalPath"],this.parent=e,this.id=this.parent.element.id,this.parent.on("ui-toolbarupdate",this.propertyChanged,this)}tn.prototype.createNonworkingContainer=function(){this.parent.ganttChartModule.chartBodyContent.contains(this.nonworkingContainer)||(this.nonworkingContainer=ne.createElement("div",{className:"e-nonworking-day-container"}),this.parent.enableTimelineVirtualization&&(this.nonworkingContainer.style.height="100%"),this.parent.ganttChartModule.chartBodyContent.insertBefore(this.nonworkingContainer,this.parent.ganttChartModule.chartBodyContent.firstChild))},tn.prototype.renderHolidays=function(){var t=this,e=this.parent.calendarModule.holidays;e&&0<e.length?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.holidayContainer)||(this.holidayContainer=ne.createElement("div",{className:"e-holiday-container"}),this.parent.enableTimelineVirtualization&&(this.holidayContainer.style.height="100%",this.holidayContainer.style.zIndex="-1"),this.nonworkingContainer.appendChild(this.holidayContainer)),e=this.getHolidaysElement().childNodes,this.holidayContainer.innerHTML="",e.forEach(function(e){t.holidayContainer.appendChild(e.cloneNode(!0))})):this.holidayContainer&&this.holidayContainer.parentNode&&(ne.remove(this.holidayContainer),this.nonworkingContainer)&&0===this.nonworkingContainer.childNodes.length&&ne.remove(this.nonworkingContainer)},tn.prototype.getHolidaysElement=function(){for(var e,t,i=ne.createElement("div"),a=this.parent.contentHeight,n=0,r=this.parent.calendarModule.holidays,s=(ne.isNullOrUndefined(this.parent.toolbarModule)||ne.isNullOrUndefined(this.parent.toolbarModule.element)||(n=this.parent.toolbarModule.element.offsetHeight),this.parent.ganttHeight-n-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight),o=0;o<r.length;o++){r[o].from&&r[o].to?(e=this.parent.dateValidationModule.getDateFromFormat(r[o].from),(t=this.parent.dateValidationModule.getDateFromFormat(r[o].to)).setDate(t.getDate()+1),e.setHours(0,0,0,0),t.setHours(0,0,0,0)):r[o].from?(e=this.parent.dateValidationModule.getDateFromFormat(r[o].from)).setHours(0,0,0,0):r[o].to&&(e=this.parent.dateValidationModule.getDateFromFormat(r[o].to)).setHours(0,0,0,0);var l=r[o].from&&r[o].to?this.parent.dataOperation.getTaskWidth(e,t):this.parent.perDayWidth,d=this.parent.dataOperation.getTaskLeft(e,!1,this.parent.defaultCalendarContext,!0),d=this.parent.enableRtl?"right:"+d+"px;":"left:"+d+"px;",d=ne.createElement("div",{className:"e-holiday",styles:d+" width:"+l+"px; height:100%;"}),l=ne.createElement("span",{className:"e-span",styles:"top:"+(s<a?s/2:a/2)+"px;left:"+l/2+"px;"}),h=this.parent.disableHtmlEncode?"textContent":"innerHTML";l[h]=r[o].label||"",this.parent.enableHtmlSanitizer&&"string"==typeof l[h]&&(l[h]=ne.SanitizeHtmlHelper.sanitize(l[h])),d.appendChild(l),r[o].cssClass&&d.classList.add(r[o].cssClass),i.appendChild(d)}return i},tn.prototype.renderWeekends=function(){var e,t=this;this.parent.highlightWeekends&&this.parent.timelineSettings.showWeekend?(this.createNonworkingContainer(),this.nonworkingContainer.contains(this.weekendContainer)||(this.weekendContainer=ne.createElement("div",{className:"e-weekend-container"}),this.parent.enableTimelineVirtualization&&(this.weekendContainer.style.height="100%",this.weekendContainer.style.zIndex="-1"),this.nonworkingContainer.appendChild(this.weekendContainer)),e=this.getWeekendElements().childNodes,this.weekendContainer.innerHTML="",e.forEach(function(e){t.weekendContainer.appendChild(e.cloneNode(!0))})):this.weekendContainer&&(ne.remove(this.weekendContainer),this.weekendContainer=null,this.nonworkingContainer)&&0===this.nonworkingContainer.childNodes.length&&(ne.remove(this.nonworkingContainer),this.nonworkingContainer=null)},tn.prototype.getWeekendElements=function(){var e,t,i,a,n,r,s,o=ne.createElement("div"),l=this.parent.enableTimelineVirtualization&&0!==this.parent.ganttChartModule.scrollObject.element.scrollLeft?this.parent.ganttChartModule.scrollObject.getTimelineLeft():null,d=this.parent.enableTimelineVirtualization&&!ne.isNullOrUndefined(l)?new Date(this.parent.timelineModule.dateByLeftValue(l).getTime()):new Date(this.parent.timelineModule.timelineStartDate.getTime()),h=this.parent.enableTimelineVirtualization?new Date(this.parent.timelineModule.weekendEndDate.getTime()):new Date(this.parent.timelineModule.timelineEndDate.getTime()),p=this.parent.nonWorkingDayIndex,u=!0,c=!0,g=(this.weekendWidthUpdated=!1,this.parent.dataOperation.hasDSTTransition(d.getFullYear()));do{}while(-1!==p.indexOf(d.getDay())&&(e=this.parent.dataOperation.getTaskLeft(d,!1,this.parent.defaultCalendarContext,!0),t=this.parent.perDayWidth,u&&(i=new Date(d.getTime()),(a=new Date(i.getTime())).setDate(a.getDate()+1),a.setHours(0,0,0,0),t=this.parent.dataOperation.getTaskWidth(i,a),u=!1),g||(i=new Date(d),a=new Date(d),i.setDate(i.getDate()+1),s=i.getTimezoneOffset(),n=a.getTimezoneOffset(),c?c=!1:(r="Hour"===this.parent.timelineModule.bottomTier&&1===this.parent.timelineModule.customTimelineSettings.bottomTier.count||"Minutes"===this.parent.timelineModule.bottomTier&&60===this.parent.timelineModule.customTimelineSettings.bottomTier.count||"Hour"===this.parent.timelineModule.topTier&&1===this.parent.timelineModule.customTimelineSettings.topTier.count&&"Minutes"===this.parent.timelineModule.bottomTier&&(30===this.parent.timelineModule.customTimelineSettings.bottomTier.count||15===this.parent.timelineModule.customTimelineSettings.bottomTier.count),this.weekendWidthUpdated||r&&s<n&&(t-=this.parent.perDayWidth/24,this.weekendWidthUpdated=!0))),r=this.parent.enableRtl?"right:"+e+"px;":"left:"+e+"px;",s=ne.createElement("div",{className:"e-weekend",styles:r+" width:"+t+"px;height:100%;"}),o.appendChild(s)),d.setDate(d.getDate()+1),d.setHours(0,0,0,0),d<h);return o},tn.prototype.updateHolidayLabelHeight=function(){for(var e=this.parent.getContentHeight(),t=document.getElementById(this.parent.element.id),i=0,t=(ne.isNullOrUndefined(this.parent.toolbarModule)||ne.isNullOrUndefined(this.parent.toolbarModule.element)||(i=this.parent.toolbarModule.element.offsetHeight),"auto"===this.parent.height?t.offsetHeight-i-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight:this.parent.ganttHeight-i-this.parent.ganttChartModule.chartTimelineContainer.offsetHeight),a=t<e?t/2:e/2,n=this.holidayContainer.querySelectorAll(".e-span"),r=0;r<n.length;r++)n[r].style.top=ne.formatUnit(a)},tn.prototype.updateContainerHeight=function(){var e=this.parent.getContentHeight();this.holidayContainer&&(this.holidayContainer.style.height=ne.formatUnit(e),this.updateHolidayLabelHeight()),this.weekendContainer&&(this.weekendContainer.style.height=ne.formatUnit(e))},tn.prototype.removeContainers=function(){this.holidayContainer&&ne.remove(this.holidayContainer),this.weekendContainer&&(ne.remove(this.weekendContainer),this.weekendContainer=null),this.nonworkingContainer&&(ne.remove(this.nonworkingContainer),this.nonworkingContainer=null)};var en=tn;function tn(e){this.weekendWidthUpdated=!1,this.parent=e,this.nonworkingContainer=null,this.holidayContainer=null,this.weekendContainer=null}nn.prototype.renderEventMarkers=function(){this.parent.eventMarkers&&0<this.parent.eventMarkers.length?(this.parent.ganttChartModule.chartBodyContent.contains(this.eventMarkersContainer)||(this.eventMarkersContainer=ne.createElement("div",{className:"e-event-markers-container"}),this.eventMarkersContainer.setAttribute("role","term"),this.parent.ganttChartModule.chartBodyContent.appendChild(this.eventMarkersContainer)),this.eventMarkersContainer.innerHTML="",this.getEventMarkersElements(this.eventMarkersContainer)):this.removeContainer()},nn.prototype.removeContainer=function(){this.eventMarkersContainer&&(ne.remove(this.eventMarkersContainer),this.eventMarkersContainer=null)},nn.prototype.getEventMarkersElements=function(e){for(var t,i,a,n,r,s=[],o=0;o<this.parent.eventMarkers.length;o++)ne.isNullOrUndefined(this.parent.eventMarkers[o].day)||(r=this.parent.eventMarkers[o].day,this.parent.isFromEventMarker=!(n=void 0),n=r instanceof Date?new Date(r.getTime()):(t=this.parent.globalize.parseDate(r,{format:this.parent.getDateFormat(),type:"dateTime"}),ne.isNullOrUndefined(t)&&!isNaN(new Date(r).getTime())?new Date(r):t),t=n=this.isDateOnlyInput(r,n)&&!this.hasExplicitTime(r)?this.normalizeToTimezone(n):n,r=this.parent.dataOperation.getTaskLeft(t,!1,this.parent.defaultCalendarContext,!0),n=this.parent.eventMarkers[o].properties.top,a=!0,this.parent.ganttHeight&&(a=parseFloat(n)<=this.parent.ganttHeight-155),a=n&&0<=parseFloat(n)&&a&&n.includes("px")?n:"50px",!n&&document.body.className.includes("e-bigger")&&(a=parseFloat(a)+15+"px"),this.parent.isFromEventMarker=!1,n=void s.push({id:o,left:r,label:this.parent.eventMarkers[o].label,date:t,top:a}),n=this.parent.enableRtl?"right:"+r+"px;":"left:"+r+"px;",r=ne.createElement("div",{className:"e-event-markers",styles:n+" height:100%;",id:"stripline"+o}),this.parent.eventMarkers[o].label&&((n=ne.createElement("div",{className:"e-span-label"}))[i=this.parent.disableHtmlEncode?"textContent":"innerHTML"]=this.parent.eventMarkers[o].label,this.parent.enableHtmlSanitizer&&"string"==typeof n[i]&&(n[i]=ne.SanitizeHtmlHelper.sanitize(n[i])),this.parent.enableRtl?n.style.right="5px":n.style.left="5px",n.style.setProperty("top",a,"important"),r.appendChild(n),i=ne.createElement("div",{className:"e-gantt-right-arrow"}),a=parseFloat(n.style.top)<10?parseFloat(n.style.top)-1:parseFloat(n.style.top),document.body.className.includes("e-bigger")?i.style.setProperty("top",a+8+"px","important"):i.style.setProperty("top",a+10+"px","important"),r.appendChild(i)),this.parent.eventMarkers[o].cssClass&&r.classList.add(this.parent.eventMarkers[o].cssClass),r.setAttribute("tabindex","-1"),r.setAttribute("aria-label",this.parent.localeObj.getConstant("eventMarkers")+" "+("string"==typeof this.parent.eventMarkers[o].day?this.parent.eventMarkers[o].day:this.parent.getFormatedDate(this.parent.eventMarkers[o].day))+" "+this.parent.eventMarkers[o].label),e.appendChild(r));this.parent.eventMarkerColloction=s},nn.prototype.isDateOnlyInput=function(e,t){return"string"==typeof e?e.includes("T")?0===t.getUTCHours()&&0===t.getUTCMinutes()&&0===t.getUTCSeconds():!e.includes(":"):(e=0===t.getHours()&&0===t.getMinutes()&&0===t.getSeconds()&&0===t.getMilliseconds(),t=0===t.getUTCHours()&&0===t.getUTCMinutes()&&0===t.getUTCSeconds(),e||t)},nn.prototype.hasExplicitTime=function(e){var t,i;return"string"==typeof e&&!(!e.includes(":")||(t=(e=e.split(/T|\s/)[1].split(":"))[0],i=void 0===(i=e[1])?"0":i,e=void 0===(e=e[2])?"0":e,t=parseInt(void 0===t?"0":t,10)||0,i=parseInt(i,10)||0,e=parseInt(e,10)||0,0===t&&0===i&&0===e))},nn.prototype.normalizeToTimezone=function(e,t){var i,a,t="string"==typeof t&&this.ISO_DATE_PATTERN.test(t)||this.isISODateObject(e)?(i=e.getUTCFullYear(),a=e.getUTCMonth(),e.getUTCDate()):(i=e.getFullYear(),a=e.getMonth(),e.getDate());return new Date(i,a,t,0,0,0,0)},nn.prototype.isISODateObject=function(e){var t=0===e.getUTCHours()&&0===e.getUTCMinutes()&&0===e.getUTCSeconds()&&0===e.getUTCMilliseconds(),e=!(0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds());return t&&e},nn.prototype.updateContainerHeight=function(){this.eventMarkersContainer&&(this.eventMarkersContainer.style.height=ne.formatUnit(this.parent.getContentHeight()))};var an=nn;function nn(e){this.ISO_DATE_PATTERN=/^\d{4}-\d{2}-\d{2}/,this.parent=e,this.eventMarkersContainer=null}sn.prototype.wireEvents=function(){this.parent.on("refreshDayMarkers",this.refreshMarkers,this),this.parent.on("updateHeight",this.updateHeight,this),this.parent.on("ui-update",this.propertyChanged,this)},sn.prototype.propertyChanged=function(e){for(var t=Object.keys(ne.getValue("properties",e)),i=0;i<t.length;i++)switch(t[i]){case"eventMarkers":this.eventMarkerRender.renderEventMarkers(),this.updateHeight();break;case"highlightWeekends":this.nonworkingDayRender.renderWeekends(),this.updateHeight();break;case"holidays":this.nonworkingDayRender.renderHolidays(),this.updateHeight()}},sn.prototype.refreshMarkers=function(){this.nonworkingDayRender.renderWeekends(),this.nonworkingDayRender.renderHolidays(),"Vertical"!==this.parent.gridLines&&"Both"!==this.parent.gridLines||this.parent.renderChartVerticalLines(),this.eventMarkerRender.renderEventMarkers()},sn.prototype.updateHeight=function(){this.nonworkingDayRender.updateContainerHeight(),this.eventMarkerRender.updateContainerHeight(),this.parent.ganttChartModule.scrollObject.updateTopPosition()},sn.prototype.getModuleName=function(){return"dayMarkers"},sn.prototype.destroy=function(){this.parent.isDestroyed||(this.nonworkingDayRender.removeContainers(),this.eventMarkerRender.removeContainer(),this.parent.off("refreshDayMarkers",this.refreshMarkers),this.parent.off("updateHeight",this.updateHeight),this.parent.off("ui-update",this.propertyChanged))};var rn=sn;function sn(e){this.parent=e,this.nonworkingDayRender=new en(this.parent),this.eventMarkerRender=new an(this.parent),this.wireEvents()}ln.prototype.getCriticalTasks=function(){return this.criticalTasks},ln.prototype.showCriticalPath=function(e){var a=this.parent.ids,n=this.parent.flatData;if(e&&0<this.parent.flatData.length){this.parent.enableCriticalPath=!0;var t,i=this.parent.treeGrid.parentData,r=this.parent.projectEndDate?new Date(this.parent.projectEndDate):i[0].ganttProperties.endDate,s=0,o=[],l=[],d=[],h=0,p=[],u=[],c=[],g=[],f=[];if(this.criticalTasks=[],i[0].ganttProperties.autoEndDate>i[0].ganttProperties.endDate&&!i[0].ganttProperties.isAutoSchedule&&(r=i[0].ganttProperties.autoEndDate),ne.isNullOrUndefined(this.parent.projectEndDate))for(var m=1;m<i.length;m++)i[m].ganttProperties.endDate>=r&&(r=i[m].ganttProperties.endDate),i[m].ganttProperties.isAutoSchedule||i[m].ganttProperties.autoEndDate>=r&&(r=i[m].ganttProperties.autoEndDate);this.maxEndDate=r;for(var y=0;y<n.length;y++){n[y].isCritical=!1,n[y].ganttProperties.isCritical=!1;var D=n[y].ganttProperties,k=void 0,k=D?D.calendarContext:this.parent.defaultCalendarContext,s=this.parent.dataOperation.getDuration(n[y].ganttProperties.endDate,r,n[y].ganttProperties.durationUnit,n[y].ganttProperties.isAutoSchedule,n[y].ganttProperties.isMilestone,void 0,k);n[y].slack=s+" "+n[y].ganttProperties.durationUnit,n[y].ganttProperties.slack=s+" "+n[y].ganttProperties.durationUnit,n[y].ganttProperties.endDate>=r&&o.push(n[y].ganttProperties.taskId),n[y].ganttProperties.predecessor&&0!==n[y].ganttProperties.predecessor.length&&(l.push(n[y]),d.push(n[y].ganttProperties.taskId))}if("ResourceView"===this.parent.viewType)for(m=0;m<this.parent.taskIds.length;m++)this.resourceCollectionIds[m]=this.parent.taskIds[m].slice(1);for(var T=this,b=0;b<o.length;b++)!function(t){if(-1===d.indexOf(o[t])){if("ProjectView"===T.parent.viewType)h=a.indexOf(o[t].toString());else for(var e=T.parent.currentViewData.filter(function(e){return parseInt(e.ganttProperties.taskId,10)===o[t]}),i=0;i<e.length;i++)!e[i].hasChildRecords&&e[i].ganttProperties.endDate>=T.maxEndDate&&(h=e[i].index);n[h].ganttProperties.progress<100&&(n[h].isCritical=!0,n[h].ganttProperties.isCritical=!0),n[h].slack="0 "+n[h].ganttProperties.durationUnit,p.push(o[t])}else u.push(o[t])}(b);for(var L=l.length,w=[],v=0;v<L;v++){for(var S=-1,P=-1,C=-1,R=-1,V=v,M=l[v].ganttProperties.predecessor,B=l[v].ganttProperties.predecessor.length,x=l[v].ganttProperties.taskId,O=0;O<B;O++)(isNaN(Number(M[O].from))||"string"==typeof x?(isNaN(Number(M[O].from)),M[O].from):parseInt(M[O].from,10))===x&&(C=-1===S?(S=M[O].offset?M[O].to+":"+M[O].offset+M[O].offsetUnit:M[O].to,M[O].type):(S=M[O].offset?S+","+M[O].to+":"+M[O].offset+M[O].offsetUnit:S+","+M[O].to,C+","+M[O].type)),(isNaN(Number(M[O].to))||"string"==typeof x?(isNaN(Number(M[O].to)),M[O].to):parseInt(M[O].to,10))===x&&(R=-1===P?(P=M[O].offset?M[O].from+":"+M[O].offset+M[O].offsetUnit:M[O].from,M[O].type):(P=M[O].offset?P+","+M[O].from+":"+M[O].offset+M[O].offsetUnit:P+","+M[O].from,R+","+M[O].type));-1===P&&(R=P=null),-1===S&&(C=S=null),c.push({from:P,fromPredecessor:R,taskid:x,to:S,toPredecessor:C,currentIndex:V,slack:null,enddate:null}),g.push(x)}for(var I,A=c.length,E=0,F=void 0,U=0;U<A;U++)c[U].to||(F=c[U].taskid,E=("ProjectView"===this.parent.viewType?a:this.resourceCollectionIds).indexOf(F.toString()),I=n[E].ganttProperties,s=this.parent.dataOperation.getDuration(I.endDate,r,"minute",I.isAutoSchedule,I.isMilestone,void 0,I.calendarContext),c[U].slack=s,c[U].fs=-1,c[U].enddate=I.endDate,w.push({fromdata:c[U].from,todateID:c[U].taskid,fromDataPredecessor:c[U].fromPredecessor}));for(var W={},b=0;b<w.length;b++)f.push(w[b]),this.slackCalculation(f,c,g,r,n,a,W);t=this.finalCriticalPath(c,p,n,a,r),this.validatedids=[],this.criticalPathCollection=t,this.detailPredecessorCollection=c,this.predecessorCollectionTaskIds=g}if(!1===e&&0<this.parent.flatData.length){var N;this.parent.enableCriticalPath=!1;for(U=0;U<this.criticalPathCollection.length;U++)N=a.indexOf(this.criticalPathCollection[U].toString()),n[N].isCritical=!1;this.criticalPathCollection=[],this.detailPredecessorCollection=[],this.predecessorCollectionTaskIds=[]}},ln.prototype.slackCalculation=function(e,t,i,a,n,r,s){for(var o,l,d,h,p,u,c,g=e[0].fromdata.split(","),f=e[0].fromDataPredecessor.split(","),m=(i=(i=i.toString()).split(","),[]),y=0;y<g.length;y++){if(m=g[y].split(":"),o=i.indexOf(m[0].toString()),d=i.indexOf(e[0].todateID.toString()),-1!==o){var D=o.toString(),k=JSON.stringify(t[o]);if(Object.prototype.hasOwnProperty.call(s,D)&&s[D]===k)return;s[D]=k}var D=("ProjectView"===this.parent.viewType?(l=r.indexOf(m[0].toString()),r):(l=this.resourceCollectionIds.indexOf(m[0].toString()),this.resourceCollectionIds)).indexOf(e[0].todateID.toString()),k=void 0,T=(-1!==l&&(k=n[l].ganttProperties),n[D].ganttProperties);1<m.length&&(u=-1!==m[1].indexOf("hour")?60*parseFloat(m[1]):-1!==m[1].indexOf("day")?parseFloat(m[1])*(this.parent.secondsPerDay/3600)*60:parseFloat(m[1])),k&&-1!==o&&("FS"===f[y]&&(h=k.endDate>T.startDate?-this.parent.dataOperation.getDuration(T.startDate,k.endDate,"minute",k.isAutoSchedule,k.isMilestone,void 0,T.calendarContext):this.parent.dataOperation.getDuration(k.endDate,T.startDate,"minute",k.isAutoSchedule,k.isMilestone,void 0,T.calendarContext),ne.isNullOrUndefined(t[o].slack)?m.length<=1&&(t[d].slack+h<=0?t[o].slack=0:t[o].slack=t[d].slack+h):t[o].slack>h&&0!==t[o].slack&&m.length<=1&&(t[d].slack+h<=0?t[o].slack=0:t[o].slack=t[d].slack+h),1<m.length&&(t[o].slack=t[d].slack+h,t[o].slack=t[o].slack-u,t[o].slack<=0)&&(t[o].slack=0),t[o].fs=1,t[o].fsslack=t[o].slack,t[o].enddate=k.startDate,k.endDate>=a)&&(t[o].slack=0),"SS"===f[y]&&(k.isAutoSchedule?(h=k.startDate>T.startDate?-this.parent.dataOperation.getDuration(T.endDate,k.startDate,"minute",k.isAutoSchedule,k.isMilestone,void 0,T.calendarContext):this.parent.dataOperation.getDuration(k.startDate,T.startDate,"minute",k.isAutoSchedule,k.isMilestone,void 0,T.calendarContext),ne.isNullOrUndefined(t[o].slack)?m.length<=1&&(t[d].slack+h<=0?t[o].slack=0:t[o].slack=t[d].slack+h):t[o].slack>h&&0!==t[o].slack&&m.length<=1&&(t[d].slack+h<=0?t[o].slack=0:t[o].slack=t[d].slack+h),1<m.length&&(t[o].slack=t[d].slack+h,t[o].slack=t[o].slack-u,t[o].slack<=0)&&(t[o].slack=0),t[o].fs=1,t[o].fsslack=t[o].slack,t[o].enddate=k.startDate):!k.isAutoSchedule&&(h=this.getSlackDuration(k.endDate,a,"minute",n[l]),ne.isNullOrUndefined(t[o].slack)||0!==t[o].slack&&t[o].slack>h)&&(t[o].slack=h),k.endDate>=a)&&k.endDate<=a&&(t[o].slack=0),"FF"===f[y]&&(1!==t[d].fs&&1!==t[d].ff&&-1!==t[d].fs||(1!==t[d].fs&&1!==t[d].ff||(p=T.endDate,c=t[d].slack),-1===t[d].fs&&(p=t[d].enddate,c=t[d].slack),h=p>k.endDate?-this.getSlackDuration(k.endDate,p,"minute",n[l]):this.getSlackDuration(p,k.endDate,"minute",n[l]),ne.isNullOrUndefined(t[o].slack)?m.length<=1&&(t[o].slack=c-h<0?0:c-h):t[o].slack>h&&0!==t[o].slack&&m.length<=1&&(t[o].slack=c-h<0?0:c-h),1<m.length&&(t[o].slack=t[d].slack-h,t[o].slack=t[o].slack-u,t[o].slack<=0)&&(t[o].slack=0),t[o].ff=1,t[o].enddate=p,t[o].fsslack=c),k.endDate>=a)&&k.endDate<=a&&(t[o].slack=0),"SF"===f[y]&&(k.isAutoSchedule?(ne.isNullOrUndefined(t[o].slack)?m.length<=1?ne.isNullOrUndefined(t[d].to)?(h=this.getSlackDuration(k.endDate,a,"minute",n[l]),t[o].slack=h):ne.isNullOrUndefined(t[d].to)||(h=T.endDate>k.startDate?-this.parent.dataOperation.getDuration(k.startDate,T.endDate,"minute",k.isAutoSchedule,k.isMilestone,void 0,T.calendarContext):this.getSlackDuration(T.endDate,k.startDate,"minute",n[l]),t[d].slack+h<=0?t[o].slack=0:t[o].slack=t[d].slack+h):1<m.length&&(h=T.endDate>=k.endDate?k.startDate>T.endDate?-this.getSlackDuration(T.endDate,k.startDate,"minute",n[l]):this.parent.dataOperation.getDuration(k.startDate,T.endDate,"minute",k.isAutoSchedule,k.isMilestone,void 0,T.calendarContext):this.getSlackDuration(k.endDate,a,"minute",n[l]),t[o].slack=t[d].slack+h,t[o].slack=t[o].slack-u,t[o].slack<=0)&&(t[o].slack=0):m.length<=1?(ne.isNullOrUndefined(t[d].to)?h=this.getSlackDuration(k.endDate,a,"minute",n[l]):ne.isNullOrUndefined(t[d].to)||(h=T.endDate>k.startDate?-this.parent.dataOperation.getDuration(k.startDate,T.endDate,"minute",k.isAutoSchedule,k.isMilestone,void 0,T.calendarContext):this.getSlackDuration(T.endDate,k.startDate,"minute",n[l])),t[o].slack>h&&0!==t[o].slack&&(ne.isNullOrUndefined(t[d].to)?t[o].slack=h:ne.isNullOrUndefined(t[d].to)||(t[d].slack+h<=0?t[o].slack=0:t[o].slack=t[d].slack+h))):1<m.length&&(h=T.endDate>k.endDate?k.startDate>T.endDate?-this.getSlackDuration(T.endDate,k.startDate,"minute",n[l]):this.parent.dataOperation.getDuration(k.startDate,T.endDate,"minute",k.isAutoSchedule,k.isMilestone,void 0,T.calendarContext):this.getSlackDuration(k.endDate,a,"minute",n[l]),t[o].slack>h)&&0!==t[o].slack&&(t[o].slack=t[d].slack+h,t[o].slack=t[o].slack-u,t[o].slack<=0)&&(t[o].slack=0),t[o].fs=1,t[o].fsslack=t[o].slack,t[o].enddate=k.startDate):!k.isAutoSchedule&&(h=this.getSlackDuration(k.endDate,a,"minute",n[l]),ne.isNullOrUndefined(t[o].slack)||0!==t[o].slack&&t[o].slack>h)&&(t[o].slack=h),k.endDate>=a)&&k.endDate<=a&&(t[o].slack=0),t[o].from)&&((T=[]).push({fromdata:t[o].from,todateID:t[o].taskid,fromDataPredecessor:t[o].fromPredecessor}),this.slackCalculation(T,t,i,a,n,r,s))}},ln.prototype.getSlackDuration=function(e,t,i,a){e=this.parent.dateValidationModule.checkStartDate(new Date(e)),t=this.parent.dateValidationModule.checkEndDate(new Date(t));return this.parent.dataOperation.getTimeDifference(e,t,!0)<=0?0:this.parent.dataOperation.getDuration(e,t,i,a.ganttProperties.isAutoSchedule,!0,void 0,a.ganttProperties.calendarContext)},ln.prototype.updateCriticalTasks=function(e,t){for(var i,a=0;a<e.ganttProperties.predecessor.length;a++){var n,r,s=void 0,o=(s="ProjectView"===this.parent.viewType?this.parent.getRecordByID(e.ganttProperties.predecessor[a].from):(o=this.resourceCollectionIds.indexOf(e.ganttProperties.predecessor[a].from.toString()),this.parent.flatData[o]),void 0);e.ganttProperties.endDate&&e.ganttProperties.endDate.getTime()>=this.maxEndDate.getTime()&&(e.ganttProperties.slack=e.slack="0 "+e.ganttProperties.durationUnit,e.ganttProperties.progress<100)&&(e.isCritical=!0,e.ganttProperties.isCritical=!0,-1===t.indexOf(e.ganttProperties.taskId))&&t.push(e.ganttProperties.taskId),s&&("FS"===e.ganttProperties.predecessor[a].type?o=this.parent.dataOperation.getDuration(s.ganttProperties.endDate,e.ganttProperties.startDate,s.ganttProperties.durationUnit,s.ganttProperties.isAutoSchedule,!0,void 0,e.ganttProperties.calendarContext):"SS"===e.ganttProperties.predecessor[a].type?o=this.parent.dataOperation.getDuration(s.ganttProperties.startDate,e.ganttProperties.startDate,s.ganttProperties.durationUnit,s.ganttProperties.isAutoSchedule,!0,void 0,e.ganttProperties.calendarContext):"FF"===e.ganttProperties.predecessor[a].type?o=this.parent.dataOperation.getDuration(s.ganttProperties.endDate,e.ganttProperties.endDate,s.ganttProperties.durationUnit,s.ganttProperties.isAutoSchedule,!0,void 0,e.ganttProperties.calendarContext):"SF"===e.ganttProperties.predecessor[a].type&&(n=e.ganttProperties.endDate,(r=s.ganttProperties.startDate)<n&&!this.parent.updateOffsetOnTaskbarEdit&&(n=(i=[r,n])[0],r=i[1]),o=this.parent.dataOperation.getDuration(n,r,s.ganttProperties.durationUnit,s.ganttProperties.isAutoSchedule,!0,void 0,e.ganttProperties.calendarContext)),this.parent.updateOffsetOnTaskbarEdit?0<=o:o<=e.ganttProperties.predecessor[a].offset)&&-1===this.validatedids.indexOf(parseInt(s.ganttProperties.taskId,10))&&s.ganttProperties.taskId!==e.ganttProperties.taskId&&(s.ganttProperties.slack=e.ganttProperties.slack,s.slack=e.slack,s.isCritical=e.ganttProperties.isCritical,s.ganttProperties.isCritical=e.ganttProperties.isCritical,-1===t.indexOf(s.ganttProperties.taskId)&&s.ganttProperties.isCritical&&s.ganttProperties.progress<100&&(t.push(s.ganttProperties.taskId),this.validatedids.push(parseInt(s.ganttProperties.taskId,10)),-1===this.criticalTasks.indexOf(s))&&this.criticalTasks.push(s),s.ganttProperties.predecessorsName)&&this.updateCriticalTasks(s,t)}},ln.prototype.updateChildCriticalTasks=function(e,t,i){for(var a=e.childRecords,n=0;n<a.length;n++){var r=a[n],s=this.parent.dataOperation.getDuration(r.ganttProperties.endDate,i,r.ganttProperties.durationUnit,r.ganttProperties.isAutoSchedule,!0,void 0,r.ganttProperties.calendarContext);r.ganttProperties.slack=r.slack=s+" "+r.ganttProperties.durationUnit,0===s&&r.ganttProperties.progress<100&&-1===this.validatedids.indexOf(parseInt(r.ganttProperties.taskId,10))&&e.isCritical&&(r.isCritical=!0,r.ganttProperties.isCritical=!0,-1===t.indexOf(r.ganttProperties.taskId)&&t.push(r.ganttProperties.taskId),this.validatedids.push(parseInt(r.ganttProperties.taskId,10)),-1===this.criticalTasks.indexOf(r))&&this.criticalTasks.push(r),r.hasChildRecords&&r.childRecords&&r.childRecords.length&&(s=r.isCritical?r.ganttProperties.endDate:i,this.updateChildCriticalTasks(r,t,s))}},ln.prototype.updateSlackByDependency=function(e,t,i,a,n){-1!==t&&(0===i&&e!==t&&a[e].slack!==n?(a[e].slack=a[t].slack,a[e].ganttProperties.slack=a[t].slack):0!==i&&e!==t&&a[t].isCritical&&(a[e].slack=i+" "+a[e].ganttProperties.durationUnit,a[e].ganttProperties.slack=i+" "+a[e].ganttProperties.durationUnit))},ln.prototype.adjustSlackByMaxEndDate=function(e,t,i,a,n){var r,s,o=this.parent.dataOperation.getEndDate(t.endDate,Math.abs(e),t.durationUnit,t,!1);return o.getTime()>i.getTime()&&((s=o)<(r=i)&&(r=(o=[o,i])[0],s=o[1]),e-=this.parent.dataOperation.getDuration(r,s,t.durationUnit,t.isAutoSchedule,t.isMilestone,void 0,a[n].ganttProperties.calendarContext),e=Math.max(0,e)),e},ln.prototype.finalCriticalPath=function(e,t,i,a,n){for(var r=[],s=this.parent.updateOffsetOnTaskbarEdit,o=e.length-1;0<=o;o--){var l,d=i[l=("ProjectView"===this.parent.viewType?a:this.resourceCollectionIds).indexOf(e[o].taskid.toString())].ganttProperties.predecessor,h="0 "+i[l].ganttProperties.durationUnit;if(d&&0<d.length)for(var p=d.length-1;0<=p;p--){var u=void 0,u=("ProjectView"===this.parent.viewType?this.parent.ids:this.resourceCollectionIds).indexOf(d[p].to),c=void 0,g=i[l].ganttProperties,f=d[p].offset||0;-1!==u&&("FS"===d[p].type?d[p].to!==g.taskId.toString()&&("ResourceView"!==this.parent.viewType&&d[p].to===g.taskId.toString()||(c=this.parent.dataOperation.getDuration(g.endDate,i[u].ganttProperties.startDate,g.durationUnit,g.isAutoSchedule,g.isMilestone,void 0,i[u].ganttProperties.calendarContext),s)||(c-=f,c=this.adjustSlackByMaxEndDate(c,g,this.maxEndDate,i,u)),this.updateSlackByDependency(l,u,c,i,h)):(c="SF"===d[p].type?this.parent.dataOperation.getDuration(g.startDate,i[u].ganttProperties.endDate,g.durationUnit,g.isAutoSchedule,g.isMilestone,void 0,i[u].ganttProperties.calendarContext):"SS"===d[p].type?this.parent.dataOperation.getDuration(g.startDate,i[u].ganttProperties.startDate,g.durationUnit,g.isAutoSchedule,g.isMilestone,void 0,i[u].ganttProperties.calendarContext):this.parent.dataOperation.getDuration(g.endDate,i[u].ganttProperties.endDate,g.durationUnit,g.isAutoSchedule,g.isMilestone,void 0,i[u].ganttProperties.calendarContext),s||(c-=f,c=this.adjustSlackByMaxEndDate(c,g,this.maxEndDate,i,u),this.updateSlackByDependency(l,u,c,i,h))),("number"==typeof i[l][this.parent.taskFields.id]?parseInt(d[p].from,10):d[p].from)===i[l][this.parent.taskFields.id])&&i[u].slack===h&&c<=0&&(i[l].slack=h,i[l].ganttProperties.slack=h)}var m=!(this.parent.projectEndDate&&i[l]&&i[l].ganttProperties&&i[l].ganttProperties.endDate)||i[l].ganttProperties.endDate.getTime()>=this.maxEndDate.getTime();i[l].slack===h&&m&&i[l].ganttProperties.progress<100&&(i[l].isCritical=!0,i[l].ganttProperties.isCritical=!0,-1===this.criticalTasks.indexOf(i[l])&&this.criticalTasks.push(i[l]),-1===r.indexOf(e[o].taskid))&&r.push(e[o].taskid),i[l].ganttProperties.predecessor&&0<i[l].ganttProperties.predecessor.length&&(this.updateCriticalTasks(i[l],r),i[l].hasChildRecords)&&(m=i[l].isCritical?i[l].ganttProperties.endDate:n,this.updateChildCriticalTasks(i[l],r,m))}if(0<t.length)for(p=0;p<t.length;p++)-1!==(l=("ProjectView"===this.parent.viewType?a:this.resourceCollectionIds).indexOf(t[p].toString()))&&i[l].ganttProperties.progress<100&&(-1===this.criticalTasks.indexOf(i[l])&&this.criticalTasks.push(i[l]),-1===r.indexOf(t[p]))&&(r=r.concat(t[p]));return r},ln.prototype.criticalConnectorLine=function(h,e,t,i){this.parent.removeCriticalPathStyles();for(var p=this,a=0;a<h.length;a++)!function(t){var i;if("ProjectView"===p.parent.viewType)i=p.parent.flatData[p.parent.ids.indexOf(h[t].toString())];else for(var e=p.parent.flatData.filter(function(e){return e.ganttProperties.taskId.toString()===h[t].toString()}),a=0;a<e.length;a++)(e[a].ganttProperties.isCritical||e[a].ganttProperties.endDate>=p.maxEndDate)&&(i=e[a]);var n=p.parent.currentViewData.indexOf(i),n=p.parent.getRowByIndex(n),r=void 0,s=p.parent.taskFields;if(i&&i.parentItem){var o=p.parent.currentViewData.filter(function(e){return i.parentItem.uniqueID===e.uniqueID}),o=p.parent.flatData.indexOf(o[0]),o=p.parent.getRowByIndex(o);if(o)for(var l=o.querySelectorAll(".e-taskbar-main-container"),d=0;d<l.length;d++)l[d].getAttribute("rowuniqueid")===i.rowUniqueID&&ne.addClass(l[d].querySelectorAll(".e-gantt-child-taskbar-inner-div"),Re)}r=p.parent.allowUnscheduledTasks&&i&&!i[s.startDate]&&!i[s.endDate]&&i[s.duration]?"e-gantt-critical-unscheduled-taskbar":Me,n&&("ProjectView"===p.parent.viewType||"ResourceView"===p.parent.viewType&&!i.hasChildRecords)&&(n.getElementsByClassName("e-gantt-milestone")[0]&&ne.addClass(n.querySelectorAll(".e-gantt-milestone"),xe),0<n.getElementsByClassName("e-gantt-child-taskbar-inner-div").length&&ne.addClass(n.querySelectorAll(".e-gantt-child-taskbar-inner-div"),Re),0<n.getElementsByClassName("e-gantt-child-progressbar-inner-div").length)&&ne.addClass(n.querySelectorAll(".e-gantt-child-progressbar-inner-div"),r)}(a);if(0!==e.length)for(var n,r=void 0,s=[],o=void 0,l=void 0,a=0;a<this.criticalPathCollection.length;a++)if(r=e[n=i.indexOf(this.criticalPathCollection[a])],-1!==n&&r.to)for(var s=r.to.split(","),d=0;d<s.length;d++){var u,c,l=s[d].split("+"),o=(l=0<=s[d].indexOf("-")?s[d].split("-"):l)[0].replace(":","");"number"==typeof h[d]&&(o=parseInt(l[0],10)),-1!==h.indexOf(o)&&(u=String(r.taskid),c=String(o),0<this.parent.element.querySelectorAll("#ConnectorLineparent"+u.replace(/([.])/g,"\\$1")+"child"+c.replace(/([.])/g,"\\$1")).length)&&(ne.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+u.replace(/([.])/g,"\\$1")+"child"+c.replace(/([.])/g,"\\$1"))[0].querySelectorAll(".e-connector-line"),ot),ne.addClass(this.parent.element.querySelectorAll("#ConnectorLineparent"+u.replace(/([.])/g,"\\$1")+"child"+c.replace(/([.])/g,"\\$1"))[0].querySelectorAll(".e-connector-line-arrow"),lt))}},ln.prototype.getModuleName=function(){return"criticalPath"},ln.prototype.destroy=function(){!this.parent.enableCriticalPath&&this.parent.criticalPathModule&&(this.parent.criticalPathModule=void 0)};var on=ln;function ln(e){this.validatedids=[],this.resourceCollectionIds=[],this.criticalTasks=[],ne.initializeTelemetryFeature("CriticalPath","Gantt"),this.parent=e}var dn=function(){return(dn=Object.assign||function(e){for(var t,i=1,a=arguments.length;i<a;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},hn=(pn.prototype.isInHierarchyOf=function(e,t){for(var i=e.parentItem;i;){if(i.taskId===t.ganttProperties.taskId.toString())return!0;i=i.parentItem}return!1},pn.prototype.isPartOfExistingHierarchy=function(t){return this.uniqueDeletedRecords.some(function(e){return!!this.isInHierarchyOf(t.data,e.data)||!!(e.data&&e.data.childRecords&&e.data.childRecords.some(function(e){return e.ganttProperties.taskId===t.data.ganttProperties.taskId}))}.bind(this))},pn.prototype.undoAction=function(){var i=this;if(0<this.getUndoCollection.length){var e=this.getUndoCollection[this.getUndoCollection.length-1],t={};if("ZoomIn"===e.action||"ZoomOut"===e.action||"ZoomToFit"===e.action)t.action=e.action,t.previousZoomingLevel=ne.extend({},{},this.parent.currentZoomingLevel,!0);else if("NextTimeSpan"===e.action||"PreviousTimeSpan"===e.action)t.action=e.action,t.previousTimelineStartDate=ne.extend([],[this.parent.timelineModule.timelineStartDate],[],!0)[0],t.previousTimelineEndDate=ne.extend([],[this.parent.timelineModule.timelineEndDate],[],!0)[0];else if("Sorting"===e.action)t.action="Sorting",t.sortColumns=this.previousSortedColumns;else if("Filtering"===e.action)t.action="Filtering",t.filteredColumns=e.filteredColumns;else if("ColumnReorder"===e.action)t.action=e.action,t.toColumn=e.fromColumn,t.fromColumn=e.toColumn,t.fromIndex=e.toIndex,t.toIndex=e.fromIndex;else if("Search"===e.action)t.action=e.action,t.searchString=this.searchString;else if("ColumnState"===e.action)t.action=e.action,t.showhideColumns=e.showhideColumns;else if("ColumnResize"===e.action)t.action=e.action,t.resizedColumn=dn({},this.parent.treeGrid.columns[e.resizedColumn.index]);else if("RowDragAndDrop"===e.action||"TaskbarDragAndDrop"===e.action){for(var a=[],n=0;n<e.beforeDrop.length;n++)"ProjectView"===this.parent.viewType?a.push(this.parent.getRecordByID(e.beforeDrop[n].data.ganttProperties.taskId)):a.push(this.parent.flatData[this.getResourceViewRowIndex(e.beforeDrop[n].data)]);t.action=e.action,t.beforeDrop=[];var r={},s=ne.extend([],[],[this.parent.getRecordByID(e.afterDrop.dropRecord.ganttProperties.taskId)],!0)[0];r.data=[];for(n=0;n<e.afterDrop.data.length;n++)"ProjectView"===this.parent.viewType?r.data.push(ne.extend([],[],[this.parent.getRecordByID(e.afterDrop.data[n].ganttProperties.taskId)],!0)[0]):r.data.push(ne.extend([],[],[this.parent.flatData[this.getResourceViewRowIndex(e.afterDrop.data[n])]],!0)[0]);r.dropRecord=ne.extend([],[],[s],!0)[0],r.dropPosition=e.afterDrop.dropPosition,t.afterDrop=r,this.findPosition(a,t,"beforeDrop")}else if("Indent"===e.action||"Outdent"===e.action)t.selectedRowIndexes=e.selectedRowIndexes,t.droppedRecord=ne.extend([],[],[this.parent.flatData[this.parent.ids.indexOf(e.droppedRecord.ganttProperties.taskId.toString())]],!0)[0],t.modifiedRecord=[],this.findPosition(ne.extend([],[],[this.parent.flatData[this.parent.ids.indexOf(e.modifiedRecord[0].data.ganttProperties.taskId.toString())]],!0),t,"modifiedRecord"),t.action=e.action;else if("Delete"===e.action){t.action="Delete",t.deleteRecords=[];for(n=0;n<e.deletedRecordsDetails.length;n++){var o=e.deletedRecordsDetails[n];this.isPartOfExistingHierarchy(o)||this.uniqueDeletedRecords.push(o)}e.deletedRecordsDetails=this.uniqueDeletedRecords,t.deleteRecords=this.uniqueDeletedRecords.map(function(e){return e.data}),this.uniqueDeletedRecords=[]}else if("Add"===e.action){t.action="Add",t.deletedRecordsDetails=[];a=e.addedRecords;this.findPosition(a,t,"deletedRecordsDetails")}else{t.action=e.action,t.modifiedRecords=[];for(n=0;n<e.modifiedRecords.length;n++){var l=void 0,l="ProjectView"===this.parent.viewType?this.findTaskRowIndex(e.modifiedRecords[n].ganttProperties.taskId.toString()):this.parent.undoRedoModule.getResourceViewRowIndex(e.modifiedRecords[n]);0<this.parent.sortSettings.columns.length?t.modifiedRecords.push(ne.extend([],[this.parent.updatedRecords[l]],[],!0)[0]):t.modifiedRecords.push(ne.extend([],[this.parent.flatData[l]],[],!0)[0])}}if(this.getRedoCollection.push(t),this.isUndoRedoPerformed=!0,this.changedRecords=[],"ZoomIn"===(this.currentAction=e).action||"ZoomOut"===e.action||"ZoomToFit"===e.action)this.parent.timelineSettings.timelineViewMode=e.previousZoomingLevel.timelineViewMode,this.parent.timelineSettings.timelineUnitSize=e.previousZoomingLevel.timelineUnitSize,this.parent.timelineSettings.updateTimescaleView=e.previousZoomingLevel.updateTimescaleView,this.parent.timelineSettings.topTier.unit=e.previousZoomingLevel.topTier.unit,this.parent.timelineSettings.topTier.count=e.previousZoomingLevel.topTier.count,this.parent.timelineSettings.topTier.format=e.previousZoomingLevel.topTier.format,this.parent.timelineSettings.bottomTier.unit=e.previousZoomingLevel.bottomTier.unit,this.parent.timelineSettings.bottomTier.count=e.previousZoomingLevel.bottomTier.count,this.parent.timelineSettings.bottomTier.format=e.previousZoomingLevel.bottomTier.format,this.parent.timelineSettings.weekStartDay=e.previousZoomingLevel.weekStartDay,this.parent.timelineSettings.weekendBackground=e.previousZoomingLevel.weekendBackground,this.isZoomingUndoRedoProgress=!0,this.isUndoRedoPerformed=!1;else if("NextTimeSpan"===e.action||"PreviousTimeSpan"===e.action)this.parent.updateTimelineDates(e.previousTimelineStartDate,e.previousTimelineEndDate,!1),this.isUndoRedoPerformed=!1;else if("Sorting"===e.action)if(this.isFromUndoRedo=!0,(this.sortedColumnsLength=0)<e.sortColumns.length)for(n=0;n<e.sortColumns.length;n++)this.parent.treeGrid.sortByColumn(e.sortColumns[n].field,e.sortColumns[n].direction,0<n);else this.parent.clearSorting();else if("Filtering"===e.action){this.isFromUndoRedo=!0;for(n=this.getUndoCollection.length-1;0<=n;n--)if(this.getUndoCollection[n].filteredColumns){for(var d=[],h=0;h<this.getUndoCollection[n].filteredColumns.length;h++)d.push(this.getUndoCollection[n].filteredColumns[h].field);this.parent.clearFiltering(d)}}else if("ColumnReorder"===e.action){this.isFromUndoRedo=!0;var s=this.parent.treeGrid.columns[e.fromIndex].field,p=this.parent.treeGrid.columns[e.toIndex].field;this.parent.reorderColumns(s,p)}else if("Search"===e.action)this.isFromUndoRedo=!0,this.parent.search(e.searchString);else if("ColumnState"===e.action){this.isFromUndoRedo=!0;for(n=0;n<e.showhideColumns.length;n++)e.showhideColumns[n].visible?this.parent.hideColumn(e.showhideColumns[n].field,"field"):this.parent.showColumn(e.showhideColumns[n].field,"field");this.isUndoRedoPerformed=!1}else if("ColumnResize"===e.action)this.parent.treeGrid.columns[e.resizedColumn.index].width=e.resizedColumn.width,this.parent.treeGrid.refreshColumns();else if("RowDragAndDrop"===e.action||"TaskbarDragAndDrop"===e.action)for(n=0;n<e.beforeDrop.length;n++){var u=this.findTaskRowIndex(e.beforeDrop[n].data.ganttProperties.taskId.toString()),c=this.findTaskRowIndex(e.beforeDrop[n].id.toString());this.parent.reorderRows([u],c,e.beforeDrop[n].position)}else if("Indent"===e.action||"Outdent"===e.action)this.parent.selectRow(this.findTaskRowIndex(e.modifiedRecord[0].data.ganttProperties.taskId.toString())),"Indent"===e.action?this.parent.outdent():this.parent.indent();else if("Delete"===e.action)for(n=0;n<e.deletedRecordsDetails.length;n++){var g,f=this.findTaskRowIndex(e.deletedRecordsDetails[n].id.toString()),m=void 0;"above"===e.deletedRecordsDetails[n].position&&(m="Above"),"below"===e.deletedRecordsDetails[n].position&&(m="Below"),"child"===e.deletedRecordsDetails[n].position&&(m="Child"),ne.isNullOrUndefined(m)&&(m=(g=e.deletedRecordsDetails[n].position).charAt(0).toUpperCase()+g.slice(1)),e.deletedRecordsDetails[n].data.ganttProperties.predecessor&&0<e.deletedRecordsDetails[n].data.ganttProperties.predecessor.length&&e.deletedRecordsDetails[n].data.ganttProperties.predecessor.forEach(function(e){var t=i.parent.connectorLineModule.getRecordByID(e.to);t&&(t.ganttProperties.predecessor.push(e),e=i.parent.predecessorModule.getPredecessorStringValue(t),t.ganttProperties.predecessorsName=e)}),this.parent.addRecord(e.deletedRecordsDetails[n].data,m,f)}else if("Add"===e.action){s=ne.extend([],[this.parent.editSettings.showDeleteConfirmDialog],[],!0)[0],p=(this.parent.editSettings.showDeleteConfirmDialog=!1,e.addedRecords);"ResourceView"===this.parent.viewType&&1===e.addedRecords.length&&e.addedRecords[0].parentItem&&1===(y=this.parent.getTaskByUniqueID(e.addedRecords[0].parentItem.uniqueID)).childRecords.length&&"Unassigned Task"===y.ganttProperties.taskName&&(p=y),this.parent.deleteRecord(p),this.parent.enableVirtualization&&this.parent.treeGrid.virtualScrollModule&&!ne.isNullOrUndefined(this.parent.treeGrid.virtualScrollModule.ganttEndIndex)&&(this.parent.treeGrid.virtualScrollModule.ganttEndIndex=this.parent.flatData.length),this.parent.editSettings.showDeleteConfirmDialog=s}else{if(this.parent.updateRecordByID(this.getUndoCollection[this.getUndoCollection.length-1].modifiedRecords[0]),e.connectedRecords&&"ProjectView"===this.parent.viewType)for(n=0;n<e.connectedRecords.length;n++)this.parent.updateRecordByID(e.connectedRecords[n]);this.isUndoRedoPerformed=!1}var y={};(y=ne.extend([],[],[this.getUndoCollection[this.getUndoCollection.length-1]],!0)[0]).requestType="afterUndoAction",this.parent.trigger("onAfterUndo",y),"RowDragAndDrop"!==e.action&&"TaskbarDragAndDrop"!==e.action&&"Indent"!==e.action&&"Outdent"!==e.action||(this.undoActionDetails=this.getUndoCollection[this.getUndoCollection.length-1]),0<this.getRedoCollection.length&&(this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_redo"],!0),this.redoEnabled=!0)}this.getUndoCollection.splice(this.getUndoCollection.length-1,1),0===this.getUndoCollection.length&&this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!1),this.parent.timelineModule.isZoomedToFit=!1},pn.prototype.redoAction=function(){if(0<this.getRedoCollection.length){var e=this.getRedoCollection[this.getRedoCollection.length-1],t={};if("ZoomIn"===e.action||"ZoomOut"===e.action||"ZoomToFit"===e.action)t.action=e.action,t.previousZoomingLevel=ne.extend({},{},this.parent.currentZoomingLevel,!0),t.previousZoomingLevel.bottomTier.format=this.parent.timelineModule.customTimelineSettings.bottomTier.format,t.previousZoomingLevel.topTier.format=this.parent.timelineModule.customTimelineSettings.topTier.format;else if("NextTimeSpan"===e.action||"PreviousTimeSpan"===e.action)t.action=e.action,t.previousTimelineStartDate=ne.extend([],[this.parent.timelineModule.timelineStartDate],[],!0)[0],t.previousTimelineEndDate=ne.extend([],[this.parent.timelineModule.timelineEndDate],[],!0)[0];else if("Sorting"===e.action)t.action="Sorting",t.sortColumns=ne.extend([],this.parent.sortSettings.columns,[],!0);else if("Filtering"===e.action)t.action="Filtering",t.filteredColumns=e.filteredColumns;else if("ColumnReorder"===e.action)t.action=e.action,t.toColumn=e.fromColumn,t.fromColumn=e.toColumn,t.fromIndex=e.toIndex,t.toIndex=e.fromIndex;else if("Search"===e.action)t.action=e.action,t.searchString=ne.extend([],[this.parent.searchSettings.key],[],!0)[0];else if("ColumnState"===e.action)t.action=e.action,t.showhideColumns=e.showhideColumns;else if("ColumnResize"===e.action)t.action=e.action,t.resizedColumn=dn({},this.parent.treeGrid.columns[e.resizedColumn.index]);else if("RowDragAndDrop"===e.action||"TaskbarDragAndDrop"===e.action){for(var i=[],a=0;a<e.beforeDrop.length;a++)"ProjectView"===this.parent.viewType?i.push(this.parent.getRecordByID(e.beforeDrop[a].data.ganttProperties.taskId)):i.push(this.parent.flatData[this.getResourceViewRowIndex(e.beforeDrop[a].data)]);t.action=e.action,t.beforeDrop=[];var n={},r=void 0;e.afterDrop.dropRecord&&(r=ne.extend([],[],[this.parent.getRecordByID(e.afterDrop.dropRecord.ganttProperties.taskId)],!0)[0]),n.data=[];for(a=0;a<e.afterDrop.data.length;a++)"ProjectView"===this.parent.viewType?n.data.push(ne.extend([],[],[this.parent.getRecordByID(e.afterDrop.data[a].ganttProperties.taskId)],!0)[0]):void 0!==e.afterDrop.data[a]&&n.data.push(ne.extend([],[],[this.parent.flatData[this.getResourceViewRowIndex(e.afterDrop.data[a])]],!0)[0]);n.dropRecord=ne.extend([],[],[r],!0)[0],n.dropPosition=e.afterDrop.dropPosition,t.afterDrop=n,this.findPosition(i,t,"beforeDrop")}else if("Indent"===e.action||"Outdent"===e.action)t.selectedRowIndexes=e.selectedRowIndexes,t.droppedRecord=ne.extend([],[],[this.parent.flatData[this.parent.ids.indexOf(e.droppedRecord.ganttProperties.taskId.toString())]],!0)[0],t.modifiedRecord=[],this.findPosition(ne.extend([],[],[this.parent.flatData[this.parent.ids.indexOf(e.modifiedRecord[0].data.ganttProperties.taskId.toString())]],!0),t,"modifiedRecord"),t.action=e.action;else if("Delete"===e.action)t.action="Delete",t.deletedRecordsDetails=[],this.findPosition(ne.extend([],[],e.deleteRecords,!0),t,"deletedRecordsDetails");else if("Add"===e.action)t.action="Add",t.addedRecords=[e.deletedRecordsDetails[0].data];else{t.action=e.action,t.modifiedRecords=[];for(a=0;a<e.modifiedRecords.length;a++){var s=this.findTaskRowIndex(e.modifiedRecords[a].ganttProperties.taskId.toString());0<this.parent.sortSettings.columns.length?t.modifiedRecords.push(ne.extend([],[this.parent.updatedRecords[s]],[],!0)[0]):t.modifiedRecords.push(ne.extend([],[this.parent.flatData[s]],[],!0)[0])}}if(this.getUndoCollection.push(t),this.isUndoRedoPerformed=!0,"ZoomIn"===(this.currentAction=e).action||"ZoomOut"===e.action||"ZoomToFit"===e.action)"ZoomToFit"===e.action?this.parent.fitToProject():(this.parent.timelineSettings.timelineViewMode=e.previousZoomingLevel.timelineViewMode,this.parent.timelineSettings.timelineUnitSize=e.previousZoomingLevel.timelineUnitSize,this.parent.timelineSettings.updateTimescaleView=e.previousZoomingLevel.updateTimescaleView,this.parent.timelineSettings.topTier.unit=e.previousZoomingLevel.topTier.unit,this.parent.timelineSettings.topTier.count=e.previousZoomingLevel.topTier.count,this.parent.timelineSettings.topTier.format=e.previousZoomingLevel.topTier.format,this.parent.timelineSettings.bottomTier.unit=e.previousZoomingLevel.bottomTier.unit,this.parent.timelineSettings.bottomTier.count=e.previousZoomingLevel.bottomTier.count,this.parent.timelineSettings.bottomTier.format=e.previousZoomingLevel.bottomTier.format,this.parent.timelineSettings.weekStartDay=e.previousZoomingLevel.weekStartDay,this.parent.timelineSettings.weekendBackground=e.previousZoomingLevel.weekendBackground,this.isZoomingUndoRedoProgress=!0),this.isUndoRedoPerformed=!1;else if("NextTimeSpan"===e.action||"PreviousTimeSpan"===e.action)this.parent.updateTimelineDates(e.previousTimelineStartDate,e.previousTimelineEndDate,!1),this.isUndoRedoPerformed=!1;else if("Sorting"===e.action)if(this.isFromUndoRedo=!0,(this.sortedColumnsLength=0)===e.sortColumns.length)this.parent.clearSorting();else for(a=0;a<e.sortColumns.length;a++)this.parent.treeGrid.sortByColumn(e.sortColumns[a].field,e.sortColumns[a].direction,1<e.sortColumns.length);else if("ColumnState"===e.action){this.isFromUndoRedo=!0;for(a=0;a<e.showhideColumns.length;a++)e.showhideColumns[a].visible?this.parent.hideColumn(e.showhideColumns[a].field,"field"):this.parent.showColumn(e.showhideColumns[a].field,"field");this.isUndoRedoPerformed=!1}else if("Filtering"===e.action)for(var o=0;o<e.filteredColumns.length;o++)this.isFromUndoRedo=!0,this.parent.filterByColumn(e.filteredColumns[o].field,e.filteredColumns[o].operator,e.filteredColumns[o].value,e.filteredColumns[o].predicate,e.filteredColumns[o].matchCase,e.filteredColumns[o].ignoreAccent);else if("ColumnReorder"===e.action){this.isFromUndoRedo=!0;var r=this.parent.treeGrid.columns[e.fromIndex].field,l=this.parent.treeGrid.columns[e.toIndex].field;this.parent.reorderColumns(r,l)}else if("Search"===e.action)this.isFromUndoRedo=!0,this.parent.search(e.searchString);else if("ColumnResize"===e.action)this.parent.treeGrid.columns[e.resizedColumn.index].width=e.resizedColumn.width,this.parent.treeGrid.refreshColumns();else if("RowDragAndDrop"===e.action||"TaskbarDragAndDrop"===e.action)for(a=0;a<e.beforeDrop.length;a++){var d=this.findTaskRowIndex(e.beforeDrop[a].data.ganttProperties.taskId.toString()),h=this.findTaskRowIndex(e.beforeDrop[a].id.toString());this.parent.reorderRows([d],h,e.beforeDrop[a].position)}else if("Indent"===e.action||"Outdent"===e.action)this.parent.selectRow(e.selectedRowIndexes[0]),"Indent"===e.action&&this.parent.indent(),"Outdent"===e.action&&this.parent.outdent();else if("Delete"===e.action){r=ne.extend([],[this.parent.editSettings.showDeleteConfirmDialog],[],!0)[0];this.parent.editSettings.showDeleteConfirmDialog=!1,this.parent.deleteRecord(e.deleteRecords),this.parent.editSettings.showDeleteConfirmDialog=r}else if("Add"===e.action)if("ResourceView"===this.parent.viewType&&1<e.deletedRecordsDetails.length)this.parent.editModule.addRecord(ne.extend([],[],e.deletedRecordsDetails,!0));else for(a=0;a<e.deletedRecordsDetails.length;a++){var p=this.findTaskRowIndex(e.deletedRecordsDetails[a].id.toString()),u=void 0;"above"===e.deletedRecordsDetails[a].position&&(u="Above"),"below"===e.deletedRecordsDetails[a].position&&(u="Below"),"child"===e.deletedRecordsDetails[a].position&&(u="Child"),"bottom"===e.deletedRecordsDetails[a].position&&(u="Bottom"),this.parent.editModule.addRecord(e.deletedRecordsDetails[a].data,u,p)}else this.parent.updateRecordByID(e.modifiedRecords[0]),this.isUndoRedoPerformed=!1;0<this.getUndoCollection.length&&this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),this.getRedoCollection.splice(this.getRedoCollection.length-1,1),0===this.getRedoCollection.length&&this.parent.toolbarModule&&(this.redoEnabled=!1,this.parent.toolbarModule.enableItems([this.parent.controlId+"_redo"],!1))}},pn.prototype.findTaskRowIndex=function(i){var a=this;return this.parent.updatedRecords.findIndex(function(e){var t=e.ganttProperties.taskId.toString();return"ProjectView"===a.parent.viewType?t===i:(e=(0===e.level||"Unassigned Task"===e.ganttProperties.taskName?"R":"T")+t,t===i||e===i)})},pn.prototype.getResourceViewRowIndex=function(e){var t;return e?(t=0===e.level?"R":"T",this.parent.taskIds.indexOf(t+e.ganttProperties.taskId.toString())):-1},pn.prototype.createUndoCollection=function(){this.parent.totalUndoAction+1>this.parent.undoRedoStepsCount&&this.getUndoCollection.length===this.parent.totalUndoAction&&(this.getUndoCollection.splice(0,1),this.disableRedo()),this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0),0===this.getUndoCollection.length?(this.getUndoCollection[0]=[],this.parent.totalUndoAction+1<=this.parent.undoRedoStepsCount&&this.parent.totalUndoAction++):0<Object.keys(this.getUndoCollection[this.getUndoCollection.length-1]).length&&(this.getUndoCollection[this.getUndoCollection.length]=[],this.parent.totalUndoAction+1<=this.parent.undoRedoStepsCount)&&this.parent.totalUndoAction++},pn.prototype.disableRedo=function(){this.redoEnabled=!1,this.getRedoCollection=[],this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_redo"],!1)},pn.prototype.findPosition=function(k,T,b){for(var w=this,e=0;e<k.length;e++)!function(t){var i,e,a={};if(a.data=k[t],"ProjectView"===w.parent.viewType)if(!k[t].hasChildRecords&&k[t].parentItem)if(1<(f=w.parent.getRecordByID(k[t].parentItem.taskId)).childRecords.length){var n=w.parent.ids.indexOf(k[t].ganttProperties.taskId.toString());if((u=w.parent.flatData[n-1]).parentItem&&u.parentItem.taskId.toString()===f.ganttProperties.taskId.toString())a.position="below",a.id=ne.extend([],[w.parent.flatData[w.parent.ids.indexOf(k[t].ganttProperties.taskId.toString())-1].ganttProperties.taskId],[],!0)[0];else{a.position="above";var r=w.parent.flatData[w.parent.ids.indexOf(k[t].ganttProperties.taskId.toString())+1],s=w.parent.ids.indexOf(k[t].ganttProperties.taskId.toString())+1,o=t;do{}while((y=k[o+1])&&r.ganttProperties.taskId.toString()===y.ganttProperties.taskId.toString()?(o++,r=w.parent.flatData[++s]):r&&r.parentItem?a.id=ne.extend([],[r.ganttProperties.taskId],[],!0)[0]:(a.id=ne.extend([],[k[t].parentItem.taskId],[],!0)[0],a.position="child"),!a.id)}}else a.position="child",a.id=ne.extend([],[f.ganttProperties.taskId],[],!0)[0];else if(k[t].hasChildRecords||k[t].parentItem)if(k[t].hasChildRecords&&!k[t].parentItem){for(l=void 0,r=void 0,d=void 0,h=0;h<w.parent.treeGrid.parentData.length;h++)if(w.parent.treeGrid.parentData[h].ganttProperties.taskId.toString()===k[t].ganttProperties.taskId.toString()){l=h,r=w.parent.treeGrid.parentData[h+1],d=h+1;break}if(-1!==l)if(0===l){a.position="above";o=t;do{}while((y=k[o+1])&&r.ganttProperties.taskId.toString()===y.ganttProperties.taskId.toString()?(o++,r=w.parent.treeGrid.parentData[++d]):(r=r||w.parent.treeGrid.parentData[l],a.id=ne.extend([],[r.ganttProperties.taskId],[],!0)[0]),!a.id)}else a.position="below",a.id=ne.extend([],[w.parent.treeGrid.parentData[l-1].ganttProperties.taskId],[],!0)[0]}else k[t].hasChildRecords&&k[t].parentItem&&(e=(m=(f=w.parent.getRecordByID(k[t].parentItem.taskId)).childRecords).length,i=k[t].ganttProperties.taskId.toString(),1===e?(a.position="child",a.id=ne.extend([],[f.ganttProperties.taskId],[],!0)[0]):-1!==(e=m.findIndex(function(e){return e.ganttProperties.taskId.toString()===i}))&&(0===e?(a.position="above",a.id=m[1].ganttProperties.taskId):(a.position="below",a.id=m[e-1].ganttProperties.taskId)));else{w.parent.ids.indexOf(k[t].ganttProperties.taskId.toString())===w.parent.ids.length-1?a.position="below":a.position="above";for(var l=void 0,r=void 0,d=void 0,h=0;h<w.parent.treeGrid.parentData.length;h++)if(w.parent.treeGrid.parentData[h].ganttProperties.taskId.toString()===k[t].ganttProperties.taskId.toString()){l=h,r=w.parent.treeGrid.parentData[h+1],d=h+1;break}var o=t;do{}while((y=k[o+1])&&r.ganttProperties.taskId.toString()===y.ganttProperties.taskId.toString()?(o++,r=w.parent.treeGrid.parentData[++d]):(r=(r=r||w.parent.treeGrid.parentData[l-1])||w.parent.treeGrid.parentData[l],a.id=ne.extend([],[r.ganttProperties.taskId],[],!0)[0]),!a.id)}else if(k[t].parentItem){var p=void 0;if(1===(p=k[t].parentItem.index?w.parent.flatData[k[t].parentItem.index]:w.parent.flatData[w.parent.ids.indexOf(k[t].parentItem.taskId)]).childRecords.length)a.position="child",a.id="R"+p.ganttProperties.taskId,"deletedIndexes"===b&&(a.position="child",a.index=p.index);else{for(var u,c=void 0,g=0;g<p.childRecords.length;g++)if(p.childRecords[g].ganttProperties.taskId.toString()===k[t].ganttProperties.taskId.toString()){c=g;break}if((u=p.childRecords[c-1])&&u.parentItem&&u.parentUniqueID===p.uniqueID)a.position="below",a.id=ne.extend([],["T"+w.parent.flatData[w.parent.taskIds.indexOf("T"+k[t].ganttProperties.taskId.toString())-1].ganttProperties.taskId],[],!0)[0],"deletedIndexes"===b&&(a.index=w.parent.taskIds.indexOf("T"+k[t].ganttProperties.taskId.toString())-1);else{s=void 0;if(c!==p.childRecords.length-1){a.position="above",0===c&&p.childRecords[1]?s=p.childRecords[1].index:p.childRecords[c-1]&&(s=p.childRecords[c-1].index);r=w.parent.flatData[s],n=s,o=t;do{}while((y=k[o+1])&&r.ganttProperties.taskId.toString()===y.ganttProperties.taskId.toString()?(o++,r=w.parent.flatData[++n]):r&&r.parentItem?(a.id=ne.extend([],["T"+r.ganttProperties.taskId],[],!0)[0],"deletedIndexes"===b&&(a.index=ne.extend([],[r.index],[],!0)[0],0===c)&&p.childRecords[1].ganttProperties.taskId===r.ganttProperties.taskId&&(a.index=a.index-1)):(a.id=ne.extend([],["R"+k[t].parentItem.taskId],[],!0)[0],a.position="child","deletedIndexes"===b&&(a.index=k[t].parentItem.index)),!a.id)}else a.position="below",a.id="T"+p.childRecords[c-1].ganttProperties.taskId,"deletedIndexes"===b&&(a.index=p.childRecords[c-1].index)}}}else{var f=w.parent.treeGrid.parentData.filter(function(e){return e.ganttProperties.taskId===k[t].ganttProperties.taskId})[0],m=w.parent.treeGrid.parentData.indexOf(f);if(0===m){a.position="above";for(r=void 0,d=void 0,h=0;h<w.parent.treeGrid.parentData.length;h++)if(w.parent.treeGrid.parentData[h].ganttProperties.taskId===k[t].ganttProperties.taskId){r=w.parent.treeGrid.parentData[h+1],d=h+1;break}var y,o=t;do{}while((y=k[o+1])&&r.ganttProperties.taskId===y.ganttProperties.taskId?(o++,r=w.parent.treeGrid.parentData[++d]):(a.id="R"+r.ganttProperties.taskId,"deletedIndexes"===b&&(a.index=r.index)),!a.id)}else a.position="below",a.id="R"+w.parent.treeGrid.parentData[m-1].ganttProperties.taskId,"deletedIndexes"===b&&(a.index=w.parent.treeGrid.parentData[m-1].index)}if("deletedIndexes"===b){var D=w.parent.getTaskByUniqueID(a.data.parentUniqueID);if(0===w.parent.editModule.dialogModule.ganttResources.length&&-1===T[b].indexOf(a))T[b].push(a);else for(g=0;g<w.parent.editModule.dialogModule.ganttResources.length;g++)w.parent.editModule.dialogModule.ganttResources[g][w.parent.resourceFields.id]!==D.ganttProperties.taskId&&-1===T[b].indexOf(a)&&T[b].push(a)}else T[b].some(function(e){return e.data.ganttProperties.taskId===a.data.ganttProperties.taskId})||T[b].push(a)}(e)},pn.prototype.getModuleName=function(){return"undoRedo"},pn.prototype.destroy=function(){!this.parent.enableUndoRedo&&this.parent.undoRedoModule&&(this.parent.undoRedoModule=void 0)},pn);function pn(e){this.isUndoRedoPerformed=!1,this.changedRecords=[],this.getRedoCollection=[],this.getUndoCollection=[],this.redoEnabled=!1,this.previousSortedColumns=[],this.searchString="",this.isFromUndoRedo=!1,this.undoActionDetails={},this.sortedColumnsLength=0,this.isZoomingUndoRedoProgress=!1,this.isPreventRowDeselectOnUndoRedo=!1,this.uniqueDeletedRecords=[],ne.initializeTelemetryFeature("UndoRedo","Gantt"),this.parent=e}x.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("initiate-contextMenu",this.render,this),this.parent.on("reRender-contextMenu",this.reRenderContextMenu,this),this.parent.on("contextMenuClick",this.contextMenuItemClick,this),this.parent.on("contextMenuOpen",this.contextMenuBeforeOpen,this))},x.prototype.reRenderContextMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),ne.remove(this.element)),this.resetItems(),this.render())},x.prototype.render=function(){this.element=this.parent.createElement("ul",{id:this.ganttID+"_contextmenu",className:fe}),this.parent.element.appendChild(this.element);var e="#"+this.ganttID;this.contextMenu=new V.ContextMenu({items:this.getMenuItems(),locale:this.parent.locale,enableRtl:this.parent.enableRtl,target:e,animationSettings:{effect:"None"},select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),cssClass:"e-gantt"}),this.contextMenu.appendTo(this.element),this.parent.treeGrid.contextMenuItems=this.headerMenuItems},x.prototype.contextMenuItemClick=function(e){this.item=this.getKeyFromId(e.item.id);var t,i,a,n,r,s,o=ne.getValue("parentObj",e.item),l=-1;switch(e.type="Content",e.rowData=this.rowData,this.parent.trigger("contextMenuClick",e),o&&!ne.isNullOrUndefined(o.id)&&"DeleteDependency"===this.getKeyFromId(o.id)&&(l=o.items.indexOf(e.item)),!this.parent.isAdaptive||"TaskInformation"!==this.item&&"Above"!==this.item&&"Below"!==this.item&&"Child"!==this.item&&"DeleteTask"!==this.item||this.parent.selectionModule&&"Multiple"===this.parent.selectionSettings.type&&(this.parent.selectionModule.hidePopUp(),document.getElementsByClassName("e-gridpopup")[0].style.display="none"),this.item){case"TaskInformation":ne.isNullOrUndefined(this.rowData)||("string"==typeof this.rowData.ganttProperties.taskId?this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID):this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID)));break;case"Above":case"Below":case"Child":ne.isNullOrUndefined(this.rowData)?0===this.parent.flatData.length&&this.parent.addRecord():(r=this.item,(a=ne.extend({},{},this.rowData.taskData,!0))[(n=this.parent.taskFields).startDate]&&this.parent.setRecordValue(n.startDate,this.rowData.ganttProperties.startDate,a,!0),this.rowData[n.duration]&&this.parent.setRecordValue(n.duration,this.rowData.ganttProperties.duration,a,!0),a[n.endDate]&&this.parent.setRecordValue(n.endDate,this.rowData.ganttProperties.endDate,a,!0),ne.isNullOrUndefined(n.dependency)||(a[n.dependency]=null),!ne.isNullOrUndefined(n.child)&&a[n.child]&&delete a[n.child],!ne.isNullOrUndefined(n.parentID)&&a[n.parentID]&&(a[n.parentID]=null),this.rowData&&("ResourceView"===this.parent.viewType&&this.rowData.parentItem&&a[this.parent.taskFields.resourceInfo]&&(t=this.parent.getParentTask(this.rowData.parentItem),i=this.parent.resourceFields.id,s=this.rowData.taskData[this.parent.taskFields.resourceInfo].find(function(e){return e[i]===t.ganttProperties.taskId}),a[this.parent.taskFields.resourceInfo]=s?[s]:[]),s=this.parent.updatedRecords.indexOf(this.rowData),this.parent.addRecord(a,r,s)));break;case"Milestone":case"ToMilestone":ne.isNullOrUndefined(this.rowData)?0===this.parent.flatData.length&&"Milestone"===this.item&&(r=this.parent.editModule.createNewRecord(),s=this.parent.taskFields,this.parent.taskFields.duration&&(r[s.duration]=0),this.parent.taskFields.milestone&&(r[s.milestone]=!0),this.parent.addRecord(r)):this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);break;case"DeleteTask":"Cell"!==this.parent.selectionSettings.mode&&1<this.parent.selectionModule.selectedRowIndexes.length||"Cell"===this.parent.selectionSettings.mode&&this.parent.selectionModule.getSelectedRowCellIndexes().length?this.parent.editModule.startDeleteAction():this.parent.editModule.deleteRecord(this.rowData);break;case"ToTask":ne.isNullOrUndefined(this.rowData)||(a=ne.extend({},{},this.rowData.taskData,!0),n=this.parent.taskFields,ne.isNullOrUndefined(n.duration)?(a[n.startDate]=new Date(this.rowData.taskData[n.startDate]),(s=new Date(this.rowData.taskData[n.startDate])).setDate(s.getDate()+1),a[n.endDate]=s):(r=parseInt(a[n.duration],10)<=0?1:a[n.duration],a[n.duration]=r,this.parent.setRecordValue("duration",r,this.rowData.ganttProperties,!0)),ne.isNullOrUndefined(a[n.milestone])||!0===a[n.milestone]&&(a[n.milestone]=!1),"FixedWork"!==(s=(ne.isNullOrUndefined(this.rowData.ganttProperties.taskType)?this.parent:this.rowData.ganttProperties).taskType)&&"FixedUnit"!==s||(this.parent.dataOperation.updateWorkWithDuration(this.rowData),ne.isNullOrUndefined(a[n.work]))||(a[n.work]=this.rowData.ganttProperties.work),a[n.startDate]&&this.parent.setRecordValue(n.startDate,this.rowData.ganttProperties.startDate,a,!0),this.parent.updateRecordByID(a));break;case"Cancel":this.parent.cancelEdit();break;case"Save":this.parent.editModule.cellEditModule.isCellEdit=!1,this.parent.treeGrid.grid.saveCell();break;case"Dependency"+l:this.isContextMenuDependencyDelete=!0,this.parent.connectorLineEditModule.removePredecessorByIndex(this.rowData,l);break;case"Auto":case"Manual":this.parent.changeTaskMode(this.rowData);break;case"Indent":this.parent.indent();break;case"Outdent":this.parent.outdent();break;case"Left":case"Right":this.mergeCall(this.item);break;case"SplitTask":this.splitTaskCall(e)}},x.prototype.splitTaskCall=function(e){var t=this,i=(this.isEdit=!0,this.parent.taskFields),a=this.getClickedDate(e.element),e=this.parent.timelineModule.customTimelineSettings.bottomTier,e=(ne.isNullOrUndefined(e)||"Hour"===e.unit||"Minutes"===e.unit||a.setHours(0,0,0,0),{rowData:this.rowData,requestType:"splitTaskbar",splitDate:a,cancel:!1,target:this.targetElement});this.parent.trigger("actionBegin",e,function(e){e.cancel||(t.parent.showLoadingIndicator(),t.parent.chartRowsModule.splitTask(t.rowData[i.id],a),t.parent.chartRowsModule.updateSegment(t.rowData.ganttProperties.segments,t.rowData.ganttProperties.taskId))})},x.prototype.mergeCall=function(e){var t=this,i=(this.isEdit=!0,this.parent.taskFields),a=this.rowData.ganttProperties.segments,n=[{firstSegmentIndex:("Right"===e?this:a[this.segmentIndex-1]).segmentIndex,secondSegmentIndex:("Left"===e?this:a[this.segmentIndex+1]).segmentIndex}],e={rowData:this.rowData,mergeSegmentIndexes:n,requestType:"mergeSegment",cancel:!1,target:this.targetElement};this.parent.trigger("actionBegin",e,function(e){!1===e.cancel&&(ne.isNullOrUndefined(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow(),t.parent.chartRowsModule.mergeTask(t.rowData[i.id],n))})},x.prototype.getClickedDate=function(e){n=this.parent.enableRtl?(n=this.parent.element.getBoundingClientRect(),t=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,i=document.documentElement.clientLeft||document.body.clientLeft||0,n.left+t-i):this.parent.getOffsetRect(this.parent.element).left,t=this.parent.enableRtl?(r=Math.abs(n+this.parent.ganttChartModule.chartElement.offsetWidth-this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft),Math.abs(this.clickedPosition-r)):(r=n+this.parent.ganttChartModule.chartElement.offsetLeft+this.rowData.ganttProperties.left-this.parent.ganttChartModule.scrollElement.scrollLeft,this.clickedPosition-r);var t,i=Math.ceil(t/this.parent.perDayWidth);if(!this.parent.timelineSettings.showWeekend){var a=new Date(this.rowData.ganttProperties.startDate),n=864e5/this.parent.perDayWidth;if(!this.parent.timelineSettings.showWeekend){for(var r=Math.floor(t*n/864e5),n=7-this.parent.nonWorkingDayIndex.length,s=Math.floor(r/n),o=r%n,l=(a.setDate(a.getDate()+7*s),0);l<o;)a.setDate(a.getDate()+1),-1===this.parent.nonWorkingDayIndex.indexOf(a.getDay())&&l++;r=a;i+=this.parent.timelineModule.calculateNonWorkingDaysBetweenDates(new Date(this.rowData.ganttProperties.startDate),r)}}var d,n=this.rowData.ganttProperties.startDate,s=this.parent.timelineModule.customTimelineSettings,r=("None"===s.bottomTier.unit?s.topTier:s.bottomTier).unit;return"Hour"===r||"Minutes"===r?(s=this.parent.timelineModule.dateByLeftValue(this.rowData.ganttProperties.left+t),d=new Date(s),"Hour"===r?d.setMinutes(0,0,0):d.setSeconds(0,0)):d=this.parent.dataOperation.getEndDate(n,i,1<this.rowData.ganttProperties.duration?this.rowData.ganttProperties.durationUnit:("None"!==this.parent.timelineSettings.bottomTier.unit?this.parent.timelineSettings.bottomTier:this.parent.timelineSettings.topTier).unit.toLocaleLowerCase(),this.rowData,!1),d},x.prototype.contextMenuBeforeOpen=function(t){var i=this,e=("ResourceView"===this.parent.viewType&&(this.hideItems=[],this.disableItems=[]),t.event?t.event.target:this.parent.focusModule?this.parent.focusModule.getActiveElement():this.parent.ganttChartModule.targetElement),a=(!ne.isNullOrUndefined(this.parent.editModule)&&this.parent.editModule.cellEditModule&&this.parent.editModule.cellEditModule.isCellEdit&&(e.parentElement.classList.contains("e-row")||e.parentElement.classList.contains("e-treecolumn-container"))&&this.parent.treeGrid.endEdit(),ne.isNullOrUndefined(t.element)||t.element.id!==this.parent.element.id+"_contextmenu"||(this.clickedPosition=ne.getValue("event",t).clientX),ne.closest(e,".e-gantt-child-taskbar")),a=(a&&(this.targetElement=t.target=a),t.gridRow=ne.closest(e,".e-row"),t.chartRow=ne.closest(e,".e-chart-row"),ne.isNullOrUndefined(t.gridRow)&&ne.isNullOrUndefined(t.chartRow)&&(!ne.isNullOrUndefined(ne.closest(e,".e-gridcontent"))||!ne.isNullOrUndefined(ne.closest(e,".e-chart-scroll-container"))||!ne.isNullOrUndefined(ne.closest(e,".e-chart-rows-container")))),n=ne.closest(e,".e-gantt"),r=ne.closest(e,Dt),s=this.parent.editModule;if(!r&&s&&s.cellEditModule&&s.cellEditModule.isCellEdit&&s.dialogModule.dialogObj&&!s.dialogModule.dialogObj.open&&(this.parent.treeGrid.grid.saveCell(),this.parent.editModule.cellEditModule.isCellEdit=!1),this.parent.readOnly&&this.contextMenu.enableItems(["Add","Save","Convert","Delete Dependency","Delete Task","TaskMode","Indent","Outdent","SplitTask","MergeTask"],!1),(ne.isNullOrUndefined(t.gridRow)&&ne.isNullOrUndefined(t.chartRow)||0===this.contentMenuItems.length)&&(!a&&(ne.isNullOrUndefined(n)||ne.isNullOrUndefined(t.parentItem))?t.cancel=!0:t.cancel=!1),!t.cancel){var o=-1;if(t.gridRow&&!a?o=parseInt(t.gridRow.getAttribute("aria-rowindex"),0)-1:t.chartRow&&!a&&(o=parseInt(t.chartRow.getAttribute("aria-rowindex"),0)-1),this.parent.selectionModule&&this.parent.allowSelection&&!t.parentItem&&!ne.isNullOrUndefined(t.chartRow)&&this.parent.selectionModule.selectRow(o),t.parentItem||a||(this.rowData=this.parent.ganttChartModule.getRecordByTarget(t.event)),this.isFromContextMenuBeforeOpen=!0,a)for(var l=0,d=t.items;l<d.length;l++)(h=d[l]).separator||-1===this.getDefaultItems().indexOf(this.getKeyFromId(h.id))||this.hideItems.push(h.text);else for(var h,p,u,c,g,f,m,y,D=0,k=t.items;D<k.length;D++)(h=k[D]).separator||(c=y=!1,h.text===this.getLocale("splitTask")&&this.rowData&&(m=this.rowData.ganttProperties,this.parent.editModule)&&this.parent.editModule.taskbarEditModule&&(p=this.parent.editModule.taskbarEditModule.segmentIndex,u=("None"===(u=this.parent.timelineModule.customTimelineSettings).bottomTier.unit?u.topTier:u.bottomTier).unit,y=m&&m.segments&&1<m.segments.length&&-1===p,m.segments&&-1!==p&&m.segments[p]&&(g=1<m.segments.length,f=m.segments[p].width>this.parent.timelineSettings.timelineUnitSize,c=!g&&!f),ne.isNullOrUndefined(m.segments)&&!ne.isNullOrUndefined(this.parent.taskFields.segments)&&!ne.isNullOrUndefined(m.startDate)||0===p&&!ne.isNullOrUndefined(m.segments[p].startDate))&&(g=this.getClickedDate(e),!ne.isNullOrUndefined(g))&&(m=(f=(ne.isNullOrUndefined(m.segments)?m:m.segments[p]).startDate).getFullYear()===g.getFullYear()&&f.getMonth()===g.getMonth()&&f.getDate()===g.getDate(),"Day"===u&&m||"Hour"===u&&m&&f.getHours()===g.getHours()||"Minutes"===u&&m&&f.getHours()===g.getHours()&&f.getMinutes()===g.getMinutes())&&(c=!0),e.classList.contains("e-gantt-unscheduled-taskbar")&&(h.text===this.getLocale("splitTask")||h.text===this.getLocale("mergeTask"))||y||c?this.hideItems.push(h.text):this.updateItemStatus(h,e,o));t.rowData=this.rowData,t.type="Content",t.disableItems=this.disableItems,t.hideItems=this.hideItems,t.hideChildItems=[],ne.isNullOrUndefined(t.rowData)||0!==t.rowData.level||"ResourceView"!==this.parent.viewType||(t.cancel=!0);var T=new U.Deferred;return this.parent.trigger("contextMenuOpen",t,function(e){T.resolve(e),e.cancel||(i.hideItems=e.hideItems,i.disableItems=e.disableItems,e.parentItem||e.hideItems.length!==e.items.length||(i.revertItemStatus(),e.cancel=!0),0<i.hideItems.length&&i.contextMenu.hideItems(i.hideItems),0<i.disableItems.length&&i.contextMenu.enableItems(i.disableItems,!1),0<t.hideChildItems.length&&i.contextMenu.hideItems(t.hideChildItems))}),this.isFromContextMenuBeforeOpen=!1,T}},x.prototype.updateItemStatus=function(e,t,i){var a,n=this.getKeyFromId(e.id),r=ne.closest(t,Dt),s=[],o=ne.closest(t,".e-gantt-child-taskbar")||ne.closest(t,"e-taskbar-right-resizer")||ne.closest(t,"e-taskbar-left-resizer");if(r)"Save"!==n&&"Cancel"!==n&&this.hideItems.push(e.text);else switch(n){case"TaskInformation":this.parent.editSettings.allowEditing&&this.parent.editModule||this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"Add":this.parent.editSettings.allowAdding&&this.parent.editModule||this.updateItemVisibility(e.text),"ResourceView"===this.parent.viewType&&0===this.rowData.level&&this.hideItems.push(e.text);break;case"Save":case"Cancel":this.hideItems.push(e.text);break;case"Convert":!ne.isNullOrUndefined(this.rowData)&&this.rowData.hasChildRecords?this.hideItems.push(e.text):this.parent.editSettings.allowEditing&&this.parent.editModule?(ne.isNullOrUndefined(this.rowData)||this.rowData.ganttProperties.isMilestone?s.push(this.createItemModel(p,"ToTask",this.getLocale("toTask"))):s.push(this.createItemModel(p,"ToMilestone",this.getLocale("toMilestone"))),e.items=s):this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text);break;case"DeleteDependency":var l=this.getPredecessorsItems();ne.isNullOrUndefined(this.rowData)||!this.rowData.hasChildRecords||this.parent.allowParentDependency?this.parent.editSettings.allowDeleting&&0!==l.length&&this.parent.editModule?0<l.length&&(e.items=l):this.updateItemVisibility(e.text):this.hideItems.push(e.text);break;case"DeleteTask":this.parent.editSettings.allowDeleting&&this.parent.editModule||this.updateItemVisibility(e.text),0===this.parent.flatData.length&&this.hideItems.push(e.text),"ResourceView"===this.parent.viewType&&0===this.rowData.level&&this.hideItems.push(e.text);break;case"TaskMode":"Custom"!==this.parent.taskMode?this.updateItemVisibility(e.text):(this.rowData.ganttProperties.isAutoSchedule?s.push(this.createItemModel(p,"Manual",this.getLocale("manual"))):s.push(this.createItemModel(p,"Auto",this.getLocale("auto"))),e.items=s);break;case"Indent":this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings?(l=this.parent.selectedRowIndex,h=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),d=this.parent.selectionModule?this.parent.selectionModule.getSelectedRowIndexes()[0]:-1,d=!ne.isNullOrUndefined(d)&&0<d?this.parent.updatedRecords[d-1]:null,a=0<=l?this.parent.updatedRecords[parseInt(l.toString(),10)]:null,this.parent.editSettings.allowEditing&&0!==l&&-1!==l&&h&&"ResourceView"!==this.parent.viewType&&!ne.isNullOrUndefined(d)&&!ne.isNullOrUndefined(a)&&a.level-d.level!=1||this.updateItemVisibility(e.text)):this.hideItems.push(e.text);break;case"Outdent":this.parent.allowSelection&&this.parent.editModule&&this.parent.editSettings?(l=this.parent.selectionModule?this.parent.selectionModule.getSelectedRowIndexes()[0]:void 0,h=!!this.parent.selectionModule&&(1===this.parent.selectionModule.selectedRowIndexes.length||1===this.parent.selectionModule.getSelectedRowCellIndexes().length),a=!ne.isNullOrUndefined(l)&&0<=l?this.parent.updatedRecords[parseInt(l.toString(),10)]:null,this.parent.editSettings.allowEditing&&!ne.isNullOrUndefined(l)&&-1!==l&&0!==l&&h&&"ResourceView"!==this.parent.viewType&&!ne.isNullOrUndefined(a)&&0!==a.level||this.updateItemVisibility(e.text)):this.hideItems.push(e.text);break;case"SplitTask":var d=!1,l=!1,h=this.parent.taskFields;ne.isNullOrUndefined(this.parent.timelineSettings.bottomTier)||(d="Minutes"===this.parent.timelineSettings.bottomTier.unit,l="Hour"===this.parent.timelineSettings.bottomTier.unit),(this.parent.readOnly||!o||ne.isNullOrUndefined(h.segments)||this.parent.updatedRecords[Number(i)].hasChildRecords||!d&&!l&&this.parent.updatedRecords[Number(i)].ganttProperties.duration<2)&&this.updateItemVisibility(e.text);break;case"MergeTask":this.parent.readOnly||!o?this.updateItemVisibility(e.text):this.mergeItemVisiblity(t,e)}},x.prototype.mergeItemVisiblity=function(e,t){var i=[],a=this.parent.taskFields,e=this.getClickedDate(e),e=(this.segmentIndex=this.parent.chartRowsModule.getSegmentIndex(e,this.rowData),this.rowData.ganttProperties.segments);!ne.isNullOrUndefined(e)&&0<e.length&&0!==this.segmentIndex?-1===this.segmentIndex&&ne.isNullOrUndefined(a.segments)?this.updateItemVisibility(t.text):(0===this.segmentIndex?i.push(this.createItemModel(p,"Right",this.getLocale("right"))):(this.segmentIndex!==e.length-1&&i.push(this.createItemModel(p,"Right",this.getLocale("right"))),i.push(this.createItemModel(p,"Left",this.getLocale("left")))),t.items=i):this.hideItems.push(t.text)},x.prototype.updateItemVisibility=function(e){(!!ne.isNullOrUndefined(this.parent.contextMenuItems)?this.hideItems:this.disableItems).push(e)},x.prototype.contextMenuOpen=function(e){this.isOpen=!0;e=this.parent.args=e.element.querySelectorAll("li:not(.e-menu-hide):not(.e-disabled)")[0];ne.isNullOrUndefined(e)||ne.addClass([e],"e-focused")},x.prototype.getMenuItems=function(){for(var e=0,t=ne.isNullOrUndefined(this.parent.contextMenuItems)?this.getDefaultItems():this.parent.contextMenuItems;e<t.length;e++){var i=t[e];"string"==typeof i&&-1!==this.getDefaultItems().indexOf(i)?this.buildDefaultItems(i):"string"!=typeof i&&(-1!==this.getDefaultItems().indexOf(i.text)?this.buildDefaultItems(i.text,i.iconCss):(".e-gridheader"===i.target?this.headerMenuItems:this.contentMenuItems).push(i))}return this.contentMenuItems},x.prototype.createItemModel=function(e,t,i,a){return{text:i,id:this.generateID(t),target:e,iconCss:a?"e-icons "+a:null}},x.prototype.getLocale=function(e){return this.parent.localeObj.getConstant(e)},x.prototype.buildDefaultItems=function(e,t){var i;switch(e){case"AutoFitAll":case"AutoFit":case"SortAscending":case"SortDescending":this.headerMenuItems.push(e);break;case"TaskInformation":i=this.createItemModel(p,e,this.getLocale("taskInformation"),this.getIconCSS(kt,t));break;case"Indent":i=this.createItemModel(p,e,this.getLocale("indent"),this.getIconCSS("e-indent",t));break;case"Outdent":i=this.createItemModel(p,e,this.getLocale("outdent"),this.getIconCSS("e-outdent",t));break;case"Save":i=this.createItemModel(kt,e,this.getLocale("save"),this.getIconCSS("e-save",t));break;case"Cancel":i=this.createItemModel(kt,e,this.getLocale("cancel"),this.getIconCSS("e-cancel",t));break;case"Add":(i=this.createItemModel(p,e,this.getLocale("add"),this.getIconCSS("e-add",t))).items=[],i.items.push(this.createItemModel(p,"Above",this.getLocale("above"),this.getIconCSS("e-add-above",t))),i.items.push(this.createItemModel(p,"Below",this.getLocale("below"),this.getIconCSS("e-add-below",t))),"ResourceView"!==this.parent.viewType&&i.items.push(this.createItemModel(p,"Child",this.getLocale("child"))),i.items.push(this.createItemModel(p,"Milestone",this.getLocale("milestone")));break;case"DeleteTask":i=this.createItemModel(p,e,this.getLocale("deleteTask"),this.getIconCSS("e-delete",t));break;case"DeleteDependency":(i=this.createItemModel(p,e,this.getLocale("deleteDependency"))).items=[],i.items.push({});break;case"Convert":(i=this.createItemModel(p,e,this.getLocale("convert"))).items=[],i.items.push({});break;case"TaskMode":(i=this.createItemModel(p,e,this.getLocale("changeScheduleMode"))).items=[],i.items.push({});break;case"SplitTask":i=this.createItemModel(p,e,this.getLocale("splitTask"));break;case"MergeTask":(i=this.createItemModel(p,e,this.getLocale("mergeTask"))).items=[],i.items.push({})}i&&this.contentMenuItems.push(i)},x.prototype.getIconCSS=function(e,t){return ne.isNullOrUndefined(t)?e:t},x.prototype.getPredecessorsItems=function(){this.predecessors=this.parent.predecessorModule.getValidPredecessor(this.rowData);for(var e=[],t=0,i=0,a=this.predecessors;i<a.length;i++){var n=a[i],n=this.parent.connectorLineModule.getRecordByID(n.from).ganttProperties,n=n.rowUniqueID+" - "+n.taskName,r="Dependency"+t++,r=this.createItemModel(p,r,n);e.push(r)}return e},x.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","TaskInformation","DeleteTask","Save","Cancel","SortAscending","SortDescending","Add","DeleteDependency","Convert","TaskMode","Indent","Outdent","SplitTask","MergeTask"]},x.prototype.getModuleName=function(){return"contextMenu"},x.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("initiate-contextMenu",this.render),this.parent.off("reRender-contextMenu",this.reRenderContextMenu),this.parent.off("contextMenuClick",this.contextMenuItemClick),this.parent.off("contextMenuOpen",this.contextMenuOpen))},x.prototype.contextMenuOnClose=function(e){0<e.items.length&&e.items[0].parentObj instanceof V.ContextMenu&&this.revertItemStatus()},x.prototype.revertItemStatus=function(){this.contextMenu.showItems(this.hideItems),this.contextMenu.enableItems(this.disableItems),this.hideItems=[],this.disableItems=[],this.isOpen=!1},x.prototype.resetItems=function(){this.hideItems=[],this.disableItems=[],this.headerMenuItems=[],this.contentMenuItems=[],this.item=null},x.prototype.generateID=function(e){return this.ganttID+"_contextMenu_"+e},x.prototype.getKeyFromId=function(e){var t=this.ganttID+"_contextMenu_";return-1<e.indexOf(t)?e.replace(t,""):"Custom"},x.prototype.destroy=function(){this.contextMenu.destroy(),ne.remove(this.element),this.removeEventListener(),this.contextMenu=null,this.element=null};var un=x;function x(e){var a=this;this.segmentIndex=-1,this.isContextMenuDependencyDelete=!1,this.isFromContextMenuBeforeOpen=!1,this.headerContextMenuClick=function(e){var t=ne.closest(e.event.target,".e-row"),i=ne.closest(e.event.target,".e-chart-row");ne.isNullOrUndefined(t)&&ne.isNullOrUndefined(i)&&(e.type="Header",a.parent.trigger("contextMenuClick",e))},this.headerContextMenuOpen=function(e){var t=ne.closest(e.event.target,".e-row"),i=ne.closest(e.event.target,".e-chart-row");ne.isNullOrUndefined(t)&&ne.isNullOrUndefined(i)?(e.type="Header",a.parent.trigger("contextMenuOpen",e)):e.cancel=!0},this.parent=e,this.ganttID=e.element.id,b.TreeGrid.Inject(b.ContextMenu),this.parent.treeGrid.contextMenuClick=this.headerContextMenuClick.bind(this),this.parent.treeGrid.contextMenuOpen=this.headerContextMenuOpen.bind(this),this.addEventListener(),this.resetItems()}gn.prototype.getModuleName=function(){return"excelExport"},gn.prototype.destroy=function(){},gn.prototype.bindEvents=function(){var t=this;this.parent.treeGrid.beforeExcelExport=function(e){t.parent.trigger("beforeExcelExport",e),ne.isNullOrUndefined(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.showSpinner():t.parent.showMaskRow()},this.parent.treeGrid.excelQueryCellInfo=function(e){t.parent.trigger("excelQueryCellInfo",e)},this.parent.treeGrid.excelHeaderQueryCellInfo=function(e){t.parent.trigger("excelHeaderQueryCellInfo",e)},this.parent.treeGrid.excelExportComplete=function(e){t.parent.trigger("excelExportComplete",e),ne.isNullOrUndefined(t.parent.loadingIndicator)||"Shimmer"!==t.parent.loadingIndicator.indicatorType?t.parent.hideSpinner():t.parent.hideMaskRow()}};var cn=gn;function gn(e){ne.initializeTelemetryFeature("ExcelExport","Gantt"),this.parent=e,b.TreeGrid.Inject(b.ExcelExport),this.parent.treeGrid.allowExcelExport=this.parent.allowExcelExport,this.bindEvents()}mn.prototype.getColumnMenu=function(){return this.parent.treeGrid.columnMenuModule.getColumnMenu()},mn.prototype.destroy=function(){},mn.prototype.getModuleName=function(){return"columnMenu"};var fn=mn;function mn(e){b.TreeGrid.Inject(b.ColumnMenu),this.parent=e}O.prototype.getModuleName=function(){return"rowDragAndDrop"},O.prototype.destroy=function(){},O.prototype.bindEvents=function(){this.parent.treeGrid.rowDragStart=this.rowDragStart.bind(this),this.parent.treeGrid.rowDragStartHelper=this.rowDragStartHelper.bind(this),this.parent.treeGrid.rowDrag=this.rowDrag.bind(this),this.parent.treeGrid.rowDrop=this.rowDrop.bind(this)},O.prototype.rowDragStart=function(e){this.parent.trigger("rowDragStart",e),this.parent.element.style.position="relative"},O.prototype.addErrorElem=function(){var e,t,i,a,n=document.querySelector(".e-ganttdrag");n&&!!!n.querySelector(".e-errorelem")&&((e=document.createElement("div")).classList.add("e-errorcontainer","e-icons","e-errorelem"),n=n.querySelector(".e-rowcell"))&&(t=n.childNodes,(i=n.querySelector(".errorValue"))&&(t=i.childNodes,i.remove()),n.innerHTML="",(a=document.createElement("span")).className="errorValue",a.style.paddingLeft="16px",t.forEach(function(e){a.appendChild(e.cloneNode(!0))}),n.appendChild(e),n.appendChild(a))},O.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem");e&&e.remove()},O.prototype.rowDrag=function(e){var t,i=this.parent.element.querySelector(".e-cloneproperties"),i=(i.style.display="none",i.cloneNode(!0)),i=(i.classList.add("e-ganttdrag"),i.style.display="",1<this.parent.element.querySelectorAll(".e-cloneproperties").length?document.getElementsByClassName("e-cloneproperties")[0].querySelectorAll(".e-errorelem").length?this.addErrorElem():this.removeErrorElem():this.parent.element.appendChild(i),"Both"===this.parent.gridLines&&ne.addClass(this.parent.element.querySelectorAll(".e-ganttdrag .e-rowcell"),["e-bothganttlines"]),this.parent.element.querySelector(".e-ganttdrag")),a=this.parent.element.getClientRects()[0].top,n=this.parent.element.getClientRects()[0].left,n=this.parent.isAdaptive?(t=e.originalEvent.event.touches[0].clientX-n,e.originalEvent.event.touches[0].clientY-a):(t=ne.getValue("event",e.originalEvent).clientX-n,ne.getValue("event",e.originalEvent).clientY-a);i.style.left=t+20+"px",i.style.top=n+20+"px",this.parent.trigger("rowDrag",e)},O.prototype.rowDragStartHelper=function(e){this.parent.trigger("rowDragStartHelper",e),this.parent.readOnly&&(e.cancel=!0)},O.prototype.rowDrop=function(e){this.parent.isAdaptive&&(t=document.querySelector(".e-ganttdrag"))&&t.remove();var t=ne.closest(e.target,".e-row"),t=(this.parent.oldRecords=ne.extend([],[],e.data,!0),t?parseInt(t.getAttribute("aria-rowindex"),10)-1:e.dropIndex);e.dropIndex=t,e.dropRecord=this.parent.updatedRecords[e.dropIndex],this.parent.trigger("rowDrop",e),"ResourceView"!==this.parent.viewType||this.validPosition(e,e.dropRecord)||(e.cancel=!0),e.cancel||(e.requestType="beforeDrop",this.parent.trigger("actionBegin",e),e.cancel?this.parent.hideLoadingIndicator():(this.parent.showLoadingIndicator(),this.dropRows(e,!0),e.cancel=!0)),this.parent.element.style.position=""},O.prototype.validPosition=function(e,t){var i=t.level,a=ne.getValue("level",e.data[0]),n=e.data[0];return this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&(n=this.parent.currentViewData[this.parent.undoRedoModule.getResourceViewRowIndex(n)]),!("middleSegment"===e.dropPosition&&(1===i||0===a)||"middleSegment"!==e.dropPosition&&(0===a&&1===i||1===a&&0===i)||ne.getValue("parentItem",n)&&t.uniqueID===ne.getValue("parentItem",n).uniqueID)},O.prototype.dropRows=function(i,u){if(!this.parent.readOnly){if(this.dropPosition=i.dropPosition,"Invalid"!==i.dropPosition&&this.parent.editModule){var c=this.parent;if(this.droppedRecord=c.updatedRecords[i.dropIndex],"ResourceView"===this.parent.viewType&&!this.validPosition(i,this.droppedRecord))return void(this.droppedRecord=null);if(this.parent.undoRedoModule&&this.parent.isUndoRedoItemPresent("RowDragAndDrop")){if(!this.parent.undoRedoModule.isUndoRedoPerformed){this.parent.undoRedoModule.redoEnabled&&(this.parent.undoRedoModule.disableRedo(),this.parent.undoRedoModule.createUndoCollection()),!i.target&&this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.editModule.taskbarEditModule.taskBarEditAction?this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=[]:this.parent.undoRedoModule.createUndoCollection();for(var e=[],a=this,n=0;n<i.data.length;n++)!function(t){e.push(a.parent.flatData.filter(function(e){return i.data[t].ganttProperties.taskId===e.ganttProperties.taskId})[0])}(n);var t=ne.extend([],[],e,!0),r={},s=(i.name?r.action="RowDragAndDrop":r.action="TaskbarDragAndDrop",r.beforeDrop=[],{});s.dropRecord=ne.extend([],[],[i.dropRecord||this.droppedRecord],!0)[0],s.data=ne.extend([],[],i.data,!0),"middleSegment"===i.dropPosition?s.dropPosition="child":"topSegment"===i.dropPosition?s.dropPosition="above":"bottomSegment"===i.dropPosition&&(s.dropPosition="below"),r.afterDrop=s,this.parent.undoRedoModule.findPosition(t,r,"beforeDrop"),this.parent.undoRedoModule.getUndoCollection[this.parent.undoRedoModule.getUndoCollection.length-1]=r}this.parent.toolbarModule&&this.parent.toolbarModule.enableItems([this.parent.controlId+"_undo"],!0)}for(var g=void 0,f=[],m=this.droppedRecord,y=(i.data[0]?f=i.data:f.push(i.data),"bottomSegment"===i.dropPosition&&f.reverse(),0),o=f.length,l=function(e){if(D.parent.isOnEdit=!0,g=f[e],D.draggedRecord=g,"Invalid"!==D.dropPosition){if("ResourceView"===D.parent.viewType&&(D.checkisSharedTask(),0!==D.draggedRecord.level)&&(D.previousParent=D.draggedRecord.parentItem.uniqueID),D.isSharedTask)return{value:void 0};u&&D.deleteDragRow();var t,e=D.treeGridData.indexOf(m);if("topSegment"===D.dropPosition&&D.dropAtTop(e),"bottomSegment"!==D.dropPosition||D.isSharedTask||(m.hasChildRecords?(y=D.parent.editModule.getChildCount(m,0),D.parent.taskFields.parentID&&0<D.ganttData.length&&D.ganttData.splice(e+y+1,0,D.draggedRecord.taskData),D.treeGridData.splice(e+y+1,0,D.draggedRecord),D.parent.ids.splice(e+y+1,0,D.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===D.parent.viewType&&(r="R"+D.draggedRecord.ganttProperties.taskId,D.parent.getTaskIds().splice(e+y+1,0,r))):(D.parent.taskFields.parentID&&0<D.ganttData.length&&D.ganttData.splice(e+1,0,D.draggedRecord.taskData),D.treeGridData.splice(e+1,0,D.draggedRecord),D.parent.ids.splice(e+1,0,D.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===D.parent.viewType&&(r="T"+D.draggedRecord.ganttProperties.taskId,D.parent.getTaskIds().splice(e+1,0,r))),D.parent.setRecordValue("parentItem",D.treeGridData[e].parentItem,g),D.parent.setRecordValue("parentUniqueID",D.treeGridData[e].parentUniqueID,g),D.parent.setRecordValue("level",D.treeGridData[e].level,g),g.hasChildRecords&&(D.updateChildRecordLevel(g,1),D.updateChildRecord(g,e+y+1)),m.parentItem&&(t=(r=D.parent.getParentTask(m.parentItem).childRecords).indexOf(m)+1,r.splice(t,0,g))),"middleSegment"===D.dropPosition&&(D.dropMiddle(e),0<m.childRecords.length)&&(delete m.ganttProperties.segments,delete m.taskData[D.parent.taskFields.segments]),0!==D.treeGridData.length)for(var i,a=0;a<D.treeGridData.length;a++)D.treeGridData[parseInt(a.toString(),10)].index=a,ne.isNullOrUndefined(D.treeGridData[parseInt(a.toString(),10)].parentItem)||(i=ne.getValue("uniqueIDCollection."+D.treeGridData[parseInt(a.toString(),10)].parentUniqueID,D.parent.treeGrid),D.treeGridData[parseInt(a.toString(),10)].parentItem.index=i.index);ne.isNullOrUndefined(g.parentItem&&-1!==D.updateParentRecords.indexOf(g.parentItem))||D.updateParentRecords.push(g.parentItem)}if(!D.parent.enableVirtualization){var n=c.flatData,r=void 0,s=void 0,o=D.parent.dataSource,l=D.parent.taskFields.id;if(g.index<m.index){for(var r=g.index,d=0;d<o.length;d++)if("break"===function(t){var e=D.parent.currentViewData.filter(function(e){return e[l]===o[t][l]})[0];if(e&&e.index>m.index)return s=e.index,"break"}(d))break}else{r=m.index;for(var h=0;h<o.length;h++)if("break"===function(t){var e=D.parent.currentViewData.filter(function(e){return e[l]===o[t][l]})[0];if(e&&e.index>g.index)return s=e.index,"break"}(h))break}for(var p=r;p<=s;p++)!function(t){var e;ne.isNullOrUndefined(n[t])||(n[t].index=t,ne.isNullOrUndefined(n[t].parentItem))||(e=n.filter(function(e){return e.uniqueID===n[t].parentUniqueID})[0],n[t].parentItem.index=e.index)}(p)}c.rowDragAndDropModule.refreshDataSource()},D=this,n=0;n<o;n++){var d=l(n);if("object"==typeof d)return d.value}if("middleSegment"===this.dropPosition){if(m.ganttProperties.predecessor)for(var h=m.ganttProperties.predecessor.length,p=0;p<h;p++)if(m.ganttProperties.predecessor&&m.ganttProperties.predecessor[p]){var k=this.parent.getRecordByID(m.ganttProperties.predecessor[p].from),T=this.parent.getRecordByID(m.ganttProperties.predecessor[p].to),k=this.parent.predecessorModule.validateParentPredecessor(k,T);if(m.ganttProperties.predecessor&&(!k||!this.parent.allowParentDependency)&&(this.parent.editModule.removePredecessorOnDelete(m),m.ganttProperties.predecessor.splice(0,1),m.ganttProperties.predecessorsName)){for(var b=m.ganttProperties.predecessorsName.split(","),n=0;n<b.length;n++)-1!==b[n].indexOf(g.ganttProperties.taskId+"")&&b.splice(n,1);T=b.join();m.ganttProperties.predecessorsName=T,m[this.parent.taskFields.dependency]=T,m.taskData[this.parent.taskFields.dependency]=T}}m.ganttProperties.isMilestone&&(this.parent.setRecordValue("isMilestone",!1,m.ganttProperties,!0),ne.isNullOrUndefined(m.taskData[this.parent.taskFields.milestone])||!0===m.taskData[this.parent.taskFields.milestone]&&(m.taskData[this.parent.taskFields.milestone]=!1))}if("ResourceView"!==this.parent.viewType||this.isSharedTask||(s=void 0,s=("middleSegment"!==this.dropPosition&&this.droppedRecord.parentItem||this.droppedRecord).uniqueID,t=this.parent.getTaskByUniqueID(s),(r={})[this.parent.taskFields.resourceInfo]=[],r[this.parent.taskFields.resourceInfo].push(t.ganttProperties.taskId),this.removeExistingResources(),s=this.parent.dataOperation.setResourceInfo(r),r=this.draggedRecord,ne.isNullOrUndefined(r.ganttProperties.resourceInfo)&&(r.ganttProperties.resourceInfo=[]),"Unassigned Task"===t.ganttProperties.taskName?(r.ganttProperties.resourceInfo=[],r.ganttProperties.sharedTaskUniqueIds=[r.ganttProperties.rowUniqueID]):r.ganttProperties.resourceInfo.push(s[0]),this.updateCurrentTask(r),"Unassigned Task"===t.ganttProperties.taskName?this.deleteSharedResourceTask():this.updateSharedResourceTask()),this.parent.taskFields.dependency&&this.parent.allowParentDependency){var s=void 0,s=g.parentItem?this.parent.flatData[this.parent.ids.indexOf(g.parentItem.taskId)]:g,w=m.parentItem?this.parent.flatData[this.parent.ids.indexOf(m.parentItem.taskId)]:m,v=void 0;if(w.uniqueID===s.uniqueID||s.parentItem&&w.uniqueID===this.parent.flatData[this.parent.ids.indexOf(s.parentItem.taskId)].uniqueID)for(var v=this.parent.currentViewData.filter(function(e){if(e.ganttProperties.predecessor&&0<e.ganttProperties.predecessor.length){var t=0;if(t<e.ganttProperties.predecessor.length)return parseInt(e.ganttProperties.predecessor[t].to,10)===parseInt(w.ganttProperties.taskId,10)||parseInt(e.ganttProperties.predecessor[t].from,10)===parseInt(w.ganttProperties.taskId,10)}return null}),S=[],n=0;n<v.length;n++){if(S=[],v[n].ganttProperties.predecessor)for(var P=0;P<v[n].ganttProperties.predecessor.length;P++)parseInt(v[n].ganttProperties.taskId,10)!==parseInt(v[n].ganttProperties.predecessor[P].from,10)?S.push(v[n].ganttProperties.predecessor[P].from):S.push(v[n].ganttProperties.predecessor[P].to);for(var C=this,R=0;R<S.length;R++)!function(e){var t=S[e].replace(/\D/g,""),e=C.parent.currentViewData.filter(function(e){return parseInt(e.ganttProperties.taskId,10)===parseInt(t,10)});C.parent.predecessorModule.validateParentPredecessor(v[n],e[0])||(C.parent.dataOperation.resetDependency(v[n]),C.parent.dataOperation.resetDependency(e[0]))}(R)}}for(R=0;R<this.updateParentRecords.length;R++)this.parent.dataOperation.updateParentItems(this.updateParentRecords[R]);"ProjectView"===this.parent.viewType&&this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.predecessorModule&&"TaskbarDragAndDrop"===this.parent.undoRedoModule.currentAction.action&&"child"!==this.parent.undoRedoModule.currentAction.beforeDrop[0].position&&(r=this.parent.flatData[this.parent.ids.indexOf(this.parent.undoRedoModule.currentAction.afterDrop.dropRecord.ganttProperties.taskId.toString())],this.parent.editModule.taskbarEditModule.taskBarEditRecord=r,this.parent.editModule.taskbarEditModule.taskBarEditAction="ChildDrag",this.parent.predecessorModule.validatePredecessor(r,[],""),this.parent.editModule.taskbarEditModule.taskBarEditAction=null),this.updateParentRecords=[],this.parent.isOnEdit=!1}ne.isNullOrUndefined(this.parent.editModule)||this.parent.editModule.refreshRecord(i,!0),(!this.parent.undoRedoModule||this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed)&&(this.parent.previousFlatData=ne.extend([],[],this.parent.flatData,!0))}this.parent.oldRecords=[]},O.prototype.updateCurrentTask=function(e){this.parent.dataOperation.updateMappingData(e,"resourceInfo"),this.parent.editModule.updateResourceRelatedFields(e,"resource"),this.parent.editModule.dialogModule.dialogEditValidationFlag=!1,this.parent.editModule.dialogModule.validateDuration(e),this.parent.dataOperation.updateWidthLeft(e),this.parent.dataOperation.updateTaskData(e)},O.prototype.deleteSharedResourceTask=function(){for(var e=0;e<this.parent.getTaskIds().length;e++)this.parent.getTaskIds()[e]==="T"+this.draggedRecord.ganttProperties.taskId&&("Unassigned Task"!==this.parent.getTaskByUniqueID(this.parent.flatData[e].parentItem.uniqueID).ganttProperties.taskName&&this.removeRecords(this.parent.flatData[e]),ne.isNullOrUndefined(this.parent.flatData[parseInt(e.toString(),10)].parentItem&&-1!==this.updateParentRecords.indexOf(this.parent.flatData[parseInt(e.toString(),10)].parentItem))||this.updateParentRecords.push(this.parent.flatData[e].parentItem))},O.prototype.removeExistingResources=function(){var e=this.parent.getTaskByUniqueID(this.previousParent);if(this.draggedRecord.ganttProperties.resourceInfo&&e)for(var t=0;t<this.draggedRecord.ganttProperties.resourceInfo.length;t++)if(this.draggedRecord.ganttProperties.resourceInfo[parseInt(t.toString(),10)][this.parent.resourceFields.id]===e.ganttProperties.taskId){this.draggedRecord.ganttProperties.resourceInfo.splice(t,1);break}},O.prototype.updateSharedResourceTask=function(){for(var e=0;e<this.parent.getTaskIds().length;e++)this.parent.getTaskIds()[e]==="T"+this.draggedRecord.ganttProperties.taskId&&(this.parent.editModule.updateGanttProperties(this.draggedRecord,this.parent.flatData[e]),this.parent.dataOperation.updateTaskData(this.parent.flatData[e]),ne.isNullOrUndefined(this.parent.flatData[parseInt(e.toString(),10)].parentItem&&-1!==this.updateParentRecords.indexOf(this.parent.flatData[parseInt(e.toString(),10)].parentItem))||this.updateParentRecords.push(this.parent.flatData[e].parentItem))},O.prototype._getExistingTaskWithID=function(e){for(var t=[],i=0;i<this.parent.getTaskIds().length;i++)this.parent.getTaskIds()[i]==="T"+e.ganttProperties.taskId&&t.push(this.parent.flatData[i]);return t},O.prototype.removeResourceInfo=function(e){var t=this.parent.getTaskByUniqueID(this.draggedRecord.parentItem.uniqueID);if(e.ganttProperties.resourceInfo&&1<e.ganttProperties.resourceInfo.length){var i=this._getExistingTaskWithID(e);if(null!==i)for(var a=0;a<i.length;a++)for(var n,r=(n=i[a]).ganttProperties.resourceInfo,s=0;s<r.length;s++)if(r[s][this.parent.resourceFields.id]===t.ganttProperties.taskId){r.splice(s,1),this.parent.setRecordValue("resourceInfo",r,n.ganttProperties,!0),this.updateCurrentTask(n),ne.isNullOrUndefined(n.parentItem&&-1!==this.updateParentRecords.indexOf(n.parentItem))||this.updateParentRecords.push(n.parentItem);break}}},O.prototype.refreshDataSource=function(){var e,t=this.draggedRecord,i=this.droppedRecord,a=this.parent,n=this.parent.taskFields,r=this.parent.dataSource instanceof U.DataManager?ne.getValue("dataOperation.dataArray",this.parent):a.dataSource;if(0<r.length&&!ne.isNullOrUndefined(i)&&!i.parentItem){for(var s=0;s<Object.keys(r).length;s++)(!ne.isNullOrUndefined(i.taskData[n.child])&&r[s][n.child]===i.taskData[n.child]||ne.isNullOrUndefined(i.taskData[n.child])&&i.taskData[n.id]===r[s][n.id])&&(e=s);"topSegment"===this.dropPosition?this.parent.taskFields.parentID||r.splice(e,0,t.taskData):"bottomSegment"!==this.dropPosition||this.parent.taskFields.parentID||r.splice(e+1,0,t.taskData)}else this.parent.taskFields.parentID||ne.isNullOrUndefined(i)||!i.parentItem||"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition||(a="topSegment"===this.dropPosition?"Above":"Below",this.parent.editModule.addRowSelectedItem=i,this.parent.editModule.updateRealDataSource([t],a),delete this.parent.editModule.addRowSelectedItem);this.parent.taskFields.parentID&&(t.parentItem?(a="middleSegment"===this.dropPosition?this.parent.taskFields.id:this.parent.taskFields.parentID,t[this.parent.taskFields.parentID]=i[a],t.ganttProperties.parentId=i[a],("ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition||"ProjectView"===this.parent.viewType)&&(t.taskData[this.parent.taskFields.parentID]=i.taskData[a])):(t[this.parent.taskFields.parentID]=null,t.taskData[this.parent.taskFields.parentID]=null,t.ganttProperties.parentId=null)),this.parent.editModule&&this.parent.editModule.taskbarEditModule&&this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&this.parent.predecessorModule&&"TaskbarDragAndDrop"===this.parent.undoRedoModule.currentAction.action&&(a=void 0,a="ProjectView"===this.parent.viewType?this.parent.flatData[this.parent.ids.indexOf(this.parent.undoRedoModule.currentAction.afterDrop.data[0].ganttProperties.taskId.toString())]:this.parent.flatData[this.parent.undoRedoModule.getResourceViewRowIndex(this.parent.undoRedoModule.currentAction.afterDrop.data[0])],this.parent.editModule.taskbarEditModule.taskBarEditRecord=a,this.parent.editModule.taskbarEditModule.taskBarEditAction="ChildDrag",this.parent.predecessorModule.validatePredecessor(a,[],""),this.parent.editModule.taskbarEditModule.taskBarEditAction=null)},O.prototype.dropMiddle=function(e){var t=this.parent,i=this.parent.editModule.getChildCount(this.droppedRecord,0),i=ne.isNullOrUndefined(i)||0===i?e+1:i+e+1;"middleSegment"!==this.dropPosition||this.isSharedTask||(t.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(i,0,this.draggedRecord.taskData),this.treeGridData.splice(i,0,this.draggedRecord),this.parent.ids.splice(i,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType&&(e="T"+this.draggedRecord.ganttProperties.taskId,this.parent.getTaskIds().splice(i,0,e)),this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,i,this.droppedRecord.expanded),this.recordLevel(),ne.isNullOrUndefined(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem))&&this.updateParentRecords.push(this.draggedRecord.parentItem))},O.prototype.recordLevel=function(){var e,t=this.parent,i=this.draggedRecord,a=this.droppedRecord,n=t.taskFields.child;a.hasChildRecords||(a.hasChildRecords=!0,a.childRecords.length)||(a.childRecords=[],!t.taskFields.parentID&&ne.isNullOrUndefined(a.taskData[n])&&(a.taskData[n]=[])),"middleSegment"===this.dropPosition&&(delete(e=ne.extend({},a)).childRecords,e={uniqueID:e.uniqueID,expanded:e.expanded,level:e.level,index:e.index,taskId:e.ganttProperties.rowUniqueID},this.parent.setRecordValue("parentItem",e,i),this.parent.setRecordValue("parentUniqueID",a.uniqueID,i),a.childRecords.splice(a.childRecords.length,0,i),ne.isNullOrUndefined(i)||t.taskFields.parentID||ne.isNullOrUndefined(a.taskData[n])||a.taskData[t.taskFields.child].splice(a.childRecords.length,0,i.taskData),i.hasChildRecords?(i.level=a.level+1,this.parent.setRecordValue("level",this.draggedRecord.level,this.draggedRecord),this.updateChildRecordLevel(i,1)):i.level=a.level+1,this.parent.enableMultiTaskbar||(a.expanded=!0))},O.prototype.deleteDragRow=function(){var e;this.treeGridData=H(this.parent)?ne.getValue("result",this.parent.treeGrid.dataSource):this.parent.treeGrid.dataSource,this.parent.dataSource instanceof U.DataManager?this.ganttData=ne.getValue("dataOperation.dataArray",this.parent):this.ganttData=H(this.parent)?ne.getValue("result",this.parent.dataSource):this.parent.dataSource,e=this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed?"ProjectView"===this.parent.viewType?this.parent.flatData[this.parent.ids.indexOf(this.draggedRecord.ganttProperties.taskId.toString())]:(e=this.draggedRecord.hasChildRecords?"R":"T",this.parent.flatData[this.parent.taskIds.indexOf(e+this.draggedRecord.ganttProperties.taskId)]):this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID),this.removeRecords(e)},O.prototype.checkisSharedTask=function(){this.isSharedTask=!1;for(var e=null,t=(0===this.droppedRecord.level?this.droppedRecord:this.droppedRecord.parentItem).uniqueID,i=this.parent.getTaskByUniqueID(t).childRecords,a=0;a<i.length;a++)this.draggedRecord.hasChildRecords||"T"+this.draggedRecord.ganttProperties.taskId!="T"+i[a].ganttProperties.taskId||(this.isSharedTask=!0,e=i[a]);this.isSharedTask&&this.removeResourceInfo(e)},O.prototype.dropAtTop=function(e){var t=this.parent;this.isSharedTask||(t.taskFields.parentID&&0<this.ganttData.length&&this.ganttData.splice(e,0,this.draggedRecord.taskData),this.treeGridData.splice(e,0,this.draggedRecord),this.parent.ids.splice(e,0,this.draggedRecord.ganttProperties.rowUniqueID.toString()),this.parent.setRecordValue("parentItem",this.droppedRecord.parentItem,this.draggedRecord),this.parent.setRecordValue("parentUniqueID",this.droppedRecord.parentUniqueID,this.draggedRecord),this.parent.setRecordValue("level",this.droppedRecord.level,this.draggedRecord),"ResourceView"===this.parent.viewType&&(t=0===this.draggedRecord.level?"R"+this.draggedRecord.ganttProperties.taskId:"T"+this.draggedRecord.ganttProperties.taskId,this.parent.getTaskIds().splice(e,0,t)),this.draggedRecord.hasChildRecords&&(this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)),this.droppedRecord.parentItem&&(e=(t=this.parent.getParentTask(this.droppedRecord.parentItem).childRecords).indexOf(this.droppedRecord),t.splice(e,0,this.draggedRecord)),ne.isNullOrUndefined(this.draggedRecord.parentItem&&-1!==this.updateParentRecords.indexOf(this.draggedRecord.parentItem)))||this.updateParentRecords.push(this.draggedRecord.parentItem)},O.prototype.updateChildRecordLevel=function(e,t){if(t++,!e.hasChildRecords)return 0;for(var i=e.childRecords.length,a=0;a<i;a++){var n=e.childRecords[a],r=void 0;e.parentItem&&(r=this.parent.treeGrid.uniqueIDCollection[e.parentItem.uniqueID]),n.level=e.parentItem?r.level+t:e.level+1,this.parent.setRecordValue("level",n.level,n),n.hasChildRecords&&(t--,t=this.updateChildRecordLevel(n,t))}return t},O.prototype.updateChildRecord=function(e,t,i){var a=this.parent;if(!e.hasChildRecords)return 0;for(var n=e.childRecords.length,r=0;r<n;r++){var s,o=e.childRecords[r];t++,this.parent.insertRecord(o,t),this.parent.ids.splice(t,0,o.ganttProperties.rowUniqueID.toString()),"ResourceView"===this.parent.viewType&&(s="T"+o.ganttProperties.taskId,this.parent.getTaskIds().splice(t,0,s)),a.taskFields.parentID&&0<a.dataSource.length&&this.ganttData.splice(t,0,o.taskData),o.hasChildRecords&&(t=this.updateChildRecord(o,t))}return t},O.prototype.removeRecords=function(e){var t=this.parent,i=this.parent.dataSource instanceof U.DataManager?ne.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource,a=e,e=a&&a.parentItem?this.parent.getParentTask(a.parentItem):null;if(a){if(a.parentItem&&(l=[],o=0,l=e?e.childRecords:l)&&0<l.length&&("ResourceView"===this.parent.viewType&&1===l.length&&(this.parent.isOnDelete=!0,l[0].isDelete=!0,this.parent.dataOperation.updateParentItems(e),this.parent.isOnDelete=!1,l[0].isDelete=!1),o=l.indexOf(a),e.childRecords.splice(o,1),!this.parent.taskFields.parentID&&e.taskData[this.parent.taskFields.child]&&e.taskData[this.parent.taskFields.child].splice(o,1),this.updateParentRecords.push(e)),!this.parent.taskFields.parentID&&((l=[]).push(a.ganttProperties.taskId.toString()),"ProjectView"===this.parent.viewType||"ResourceView"===this.parent.viewType&&"middleSegment"!==this.dropPosition)&&this.parent.editModule.removeFromDataSource(l),t.taskFields.parentID){a.hasChildRecords&&0<a.childRecords.length&&this.removeChildItem(a);for(var n=void 0,r=0<i.length&&"ResourceView"!==this.parent.viewType?i:this.parent.updatedRecords,s=0;s<r.length;s++)"ResourceView"===this.parent.viewType?r[s].ganttProperties.rowUniqueID===a.ganttProperties.rowUniqueID&&(n=s):r[s][this.parent.taskFields.id]===a.taskData[this.parent.taskFields.id]&&(n=s);-1!==n&&(0<i.length&&i.splice(n,1),o=this.treeGridData.indexOf(a),this.treeGridData.splice(o,1),this.parent.ids.splice(o,1),-1!==this.parent.treeGrid.parentData.indexOf(a)&&this.parent.treeGrid.parentData.splice(this.parent.treeGrid.parentData.indexOf(a),1),"ResourceView"===this.parent.viewType)&&this.parent.getTaskIds().splice(n,1)}var o,l=this.treeGridData.indexOf(a);t.taskFields.parentID||(i=this.parent.editModule.getChildCount(a,0),this.treeGridData.splice(l,i+1),this.parent.ids.splice(l,i+1),-1!==(o=this.ganttData.indexOf(a.taskData))&&(this.ganttData.splice(o,1),this.parent.treeGrid.parentData.splice(o,1)),"ResourceView"===this.parent.viewType&&this.parent.getTaskIds().splice(l,i+1)),a.parentItem&&e&&e.childRecords&&!e.childRecords.length&&(e.expanded=!1,e.hasChildRecords=!1)}},O.prototype.removeChildItem=function(e){for(var t,i=0;i<e.childRecords.length;i++){for(var a,n=e.childRecords[i],r=void 0,r=this.parent.dataSource instanceof U.DataManager?ne.getValue("dataOperation.dataArray",this.parent):this.parent.dataSource,s=0;s<r.length;s++)r[s][this.parent.taskFields.id]===n.taskData[this.parent.taskFields.id]&&(t=s);-1!==t&&(0<r.length&&r.splice(t,1),a=this.treeGridData.indexOf(n),this.treeGridData.splice(a,1),this.parent.ids.splice(a,1),"ResourceView"===this.parent.viewType)&&this.parent.getTaskIds().splice(t,1),n.hasChildRecords&&this.removeChildItem(n)}},O.prototype.reorderRows=function(e,t,i){if(!this.parent.readOnly&&e[0]!==t&&("above"===i||"below"===i||"child"===i)){"above"===i&&(this.dropPosition="topSegment"),"below"===i&&(this.dropPosition="bottomSegment"),"child"===i&&(this.dropPosition="middleSegment");for(var a=void 0,n=(this.parent.undoRedoModule&&(a=ne.extend([],[],[this.parent.undoRedoModule.currentAction],!0)[0]),[]),r=0;r<e.length;r++)this.parent.undoRedoModule&&this.parent.undoRedoModule.isUndoRedoPerformed&&("RowDragAndDrop"===a.action||"TaskbarDragAndDrop"===a.action)?n[r]=a.beforeDrop[r].data:n[r]=this.parent.flatData[e[r]];i={data:n,dropIndex:t,dropPosition:this.dropPosition};this.dropRows(i,!0)}};var yn=O;function O(e){this.isTest=!1,this.updateParentRecords=[],this.isaddtoBottom=!1,this.updateCollection={},this.isSharedTask=!1,this.canDrop=!0,ne.initializeTelemetryFeature("RowDragAndDrop","Gantt"),this.parent=e,b.TreeGrid.Inject(b.RowDD),this.parent.treeGrid.allowRowDragAndDrop=this.parent.allowRowDragAndDrop,this.bindEvents()}Object.defineProperty(kn.prototype,"style",{get:function(){return this.ganttStyle},enumerable:!0,configurable:!0}),kn.prototype.setTheme=function(e,t){switch(this.initStyles(e),e.columnHeader.fontSize=9.5,e.columnHeader.fontColor=new re.PdfColor(0,0,0),e.columnHeader.fontColor.gray=.2,e.columnHeader.backgroundColor=new re.PdfColor(255,255,255),e.columnHeader.borderColor=new re.PdfColor(234,234,234),e.columnHeader.format.lineAlignment=1,e.columnHeader.format.alignment=0,e.fontFamily=re.PdfFontFamily.Helvetica,e.cell.fontSize=9.5,e.cell.backgroundColor=new re.PdfColor(255,255,255),e.cell.borderColor=new re.PdfColor(234,234,234),e.cell.fontColor=new re.PdfColor(0,0,0),e.cell.fontColor.gray=.2,e.cell.format.lineAlignment=1,e.cell.format.alignment=0,e.footer.fontSize=9.5,e.footer.fontStyle=0,e.footer.format.alignment=1,e.footer.format.lineAlignment=1,e.footer.borderColor=new re.PdfColor(235,235,235),e.timeline.fontSize=9.5,e.timeline.fontStyle=0,e.timeline.backgroundColor=new re.PdfColor(252,252,252),e.timeline.fontColor=new re.PdfColor(40,40,39),e.chartGridLineColor=new re.PdfColor(235,235,235),e.timeline.borderColor=new re.PdfColor(235,235,235),e.eventMarker.label.backgroundColor=new re.PdfColor(100,253,191),e.eventMarker.label.fontColor=new re.PdfColor(33,33,33),e.eventMarker.lineStyle=new re.PdfPen(new re.PdfColor(227,22,91)),e.eventMarker.lineStyle.dashStyle=re.PdfDashStyle.Dash,e.holiday.backgroundColor=new re.PdfColor(238,238,238),t){case"Bootstrap":e.taskbar.taskColor=new re.PdfColor(49,122,185),e.taskbar.progressColor=new re.PdfColor(33,82,125),e.taskbar.criticalTaskColor=new re.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new re.PdfColor(255,85,85),e.taskbar.baselineColor=new re.PdfColor(240,173,78),e.taskbar.baselineBorderColor=new re.PdfColor(240,173,78),e.criticalConnectorLineColor=new re.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new re.PdfColor(255,85,85),e.taskbar.parentTaskColor=new re.PdfColor(119,119,119),e.taskbar.parentProgressColor=new re.PdfColor(85,85,85),e.taskbar.taskBorderColor=new re.PdfColor(33,82,125),e.taskbar.parentTaskBorderColor=new re.PdfColor(85,85,85),e.taskbar.milestoneColor=new re.PdfColor(85,85,85),e.footer.fontColor=new re.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new re.PdfColor(33,82,125),e.footer.backgroundColor=new re.PdfColor(255,255,255),e.taskbar.progressFontColor=new re.PdfColor(255,255,255),e.label.fontColor=new re.PdfColor(0,0,0),e.taskbar.splitLineBackground=new re.PdfColor(51,51,51),e.taskbar.unscheduledTaskBarColor=new re.PdfColor(49,122,185),e.taskbar.manualParentBackground=new re.PdfColor(119,119,119),e.taskbar.manualParentProgress=new re.PdfColor(85,85,85),e.taskbar.manualChildBackground=new re.PdfColor(117,56,201),e.taskbar.manualChildProgress=new re.PdfColor(87,42,150),e.taskbar.manualLineColor=new re.PdfColor(152,154,156),e.taskbar.manualParentBorder=new re.PdfColor(85,85,85),e.taskbar.manualChildBorder=new re.PdfColor(87,42,150),e.eventMarker.label.backgroundColor=new re.PdfColor(138,109,59),e.eventMarker.label.fontColor=new re.PdfColor(252,248,227),e.eventMarker.lineStyle=new re.PdfPen(new re.PdfColor(49,122,185)),e.holiday.backgroundColor=new re.PdfColor(238,238,238);break;case"Bootstrap 4":e.taskbar.taskColor=new re.PdfColor(0,123,255),e.taskbar.progressColor=new re.PdfColor(0,86,179),e.taskbar.criticalTaskColor=new re.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new re.PdfColor(255,85,85),e.taskbar.baselineColor=new re.PdfColor(255,193,7),e.taskbar.baselineBorderColor=new re.PdfColor(255,193,7),e.criticalConnectorLineColor=new re.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new re.PdfColor(255,85,85),e.taskbar.parentTaskColor=new re.PdfColor(108,117,125),e.taskbar.parentProgressColor=new re.PdfColor(73,80,87),e.taskbar.taskBorderColor=new re.PdfColor(0,86,179),e.taskbar.parentTaskBorderColor=new re.PdfColor(73,80,87),e.taskbar.milestoneColor=new re.PdfColor(73,80,87),e.footer.fontColor=new re.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new re.PdfColor(0,86,179),e.footer.backgroundColor=new re.PdfColor(255,255,255),e.taskbar.progressFontColor=new re.PdfColor(255,255,255),e.label.fontColor=new re.PdfColor(33,37,41),e.taskbar.splitLineBackground=new re.PdfColor(0,0,0),e.taskbar.unscheduledTaskBarColor=new re.PdfColor(0,123,255),e.taskbar.manualParentBackground=new re.PdfColor(108,117,125),e.taskbar.manualParentProgress=new re.PdfColor(73,80,87),e.taskbar.manualChildBackground=new re.PdfColor(133,83,241),e.taskbar.manualChildProgress=new re.PdfColor(102,40,238),e.taskbar.manualLineColor=new re.PdfColor(152,154,156),e.taskbar.manualParentBorder=new re.PdfColor(73,80,87),e.taskbar.manualChildBorder=new re.PdfColor(102,40,238),e.eventMarker.label.backgroundColor=new re.PdfColor(255,193,7),e.eventMarker.label.fontColor=new re.PdfColor(0,0,0),e.eventMarker.lineStyle=new re.PdfPen(new re.PdfColor(0,123,255)),e.holiday.backgroundColor=new re.PdfColor(233,236,239);break;case"Fabric":e.columnHeader.fontColor=new re.PdfColor(102,102,102),e.cell.fontColor=new re.PdfColor(51,51,51),e.taskbar.taskColor=new re.PdfColor(0,120,214),e.taskbar.progressColor=new re.PdfColor(0,91,163),e.taskbar.criticalTaskColor=new re.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new re.PdfColor(255,85,85),e.taskbar.baselineColor=new re.PdfColor(216,59,1),e.taskbar.baselineBorderColor=new re.PdfColor(216,59,1),e.criticalConnectorLineColor=new re.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new re.PdfColor(255,85,85),e.taskbar.parentTaskColor=new re.PdfColor(118,118,118),e.taskbar.parentProgressColor=new re.PdfColor(80,80,80),e.taskbar.taskBorderColor=new re.PdfColor(0,91,163),e.taskbar.parentTaskBorderColor=new re.PdfColor(80,80,80),e.taskbar.milestoneColor=new re.PdfColor(80,80,80),e.footer.fontColor=new re.PdfColor(51,51,51),e.footer.fontColor.gray=.2,e.connectorLineColor=new re.PdfColor(0,69,122),e.footer.backgroundColor=new re.PdfColor(255,255,255),e.taskbar.progressFontColor=new re.PdfColor(255,255,255),e.label.fontColor=new re.PdfColor(51,51,51),e.taskbar.splitLineBackground=new re.PdfColor(0,0,0),e.taskbar.unscheduledTaskBarColor=new re.PdfColor(0,120,214),e.taskbar.manualParentBackground=new re.PdfColor(118,118,118),e.taskbar.manualParentProgress=new re.PdfColor(80,80,80),e.taskbar.manualChildBackground=new re.PdfColor(154,56,186),e.taskbar.manualChildProgress=new re.PdfColor(109,24,136),e.taskbar.manualLineColor=new re.PdfColor(152,154,156),e.taskbar.manualParentBorder=new re.PdfColor(80,80,80),e.taskbar.manualChildBorder=new re.PdfColor(109,24,136),e.eventMarker.label.backgroundColor=new re.PdfColor(202,232,255),e.eventMarker.label.fontColor=new re.PdfColor(0,90,158),e.eventMarker.lineStyle=new re.PdfPen(new re.PdfColor(0,120,214)),e.holiday.backgroundColor=new re.PdfColor(244,244,244);break;default:e.taskbar.taskColor=new re.PdfColor(88,105,197),e.taskbar.progressColor=new re.PdfColor(63,81,181),e.taskbar.criticalTaskColor=new re.PdfColor(255,139,139),e.taskbar.criticalProgressColor=new re.PdfColor(255,85,85),e.taskbar.baselineColor=new re.PdfColor(193,87,0),e.taskbar.baselineBorderColor=new re.PdfColor(193,87,0),e.criticalConnectorLineColor=new re.PdfColor(255,85,85),e.taskbar.criticalTaskBorderColor=new re.PdfColor(255,85,85),e.taskbar.parentTaskColor=new re.PdfColor(132,132,132),e.taskbar.parentProgressColor=new re.PdfColor(97,97,97),e.taskbar.taskBorderColor=new re.PdfColor(63,81,181),e.taskbar.parentTaskBorderColor=new re.PdfColor(51,51,51),e.taskbar.milestoneColor=new re.PdfColor(97,97,97),e.footer.fontColor=new re.PdfColor(0,0,0),e.footer.fontColor.gray=.2,e.connectorLineColor=new re.PdfColor(63,81,181),e.footer.backgroundColor=new re.PdfColor(255,255,255),e.taskbar.progressFontColor=new re.PdfColor(255,255,255),e.label.fontColor=new re.PdfColor(51,51,51),e.taskbar.splitLineBackground=new re.PdfColor(0,0,0),e.taskbar.unscheduledTaskBarColor=new re.PdfColor(63,81,181),e.taskbar.manualParentBackground=new re.PdfColor(97,97,97),e.taskbar.manualParentProgress=new re.PdfColor(97,97,97),e.taskbar.manualChildBackground=new re.PdfColor(0,135,134),e.taskbar.manualChildProgress=new re.PdfColor(0,135,134),e.taskbar.manualLineColor=new re.PdfColor(152,154,156),e.taskbar.manualParentBorder=new re.PdfColor(97,97,97),e.taskbar.manualChildBorder=new re.PdfColor(0,135,134),e.eventMarker.label.backgroundColor=new re.PdfColor(253,191,100),e.eventMarker.label.fontColor=new re.PdfColor(33,33,33),e.eventMarker.lineStyle=new re.PdfPen(new re.PdfColor(227,22,91)),e.holiday.backgroundColor=new re.PdfColor(238,238,238)}},kn.prototype.initStyles=function(e){e.columnHeader={},e.columnHeader.format=new re.PdfStringFormat,e.cell={},e.cell.format=new re.PdfStringFormat,e.timeline={},e.footer={},e.footer.format=new re.PdfStringFormat,e.label={},e.taskbar={},e.eventMarker={},e.eventMarker.label={},e.eventMarker.lineStyle=new re.PdfPen(null),e.holiday={}};var Dn=kn;function kn(e){this.theme=e,this.ganttStyle={},this.setTheme(this.ganttStyle,this.theme),this.ganttStyle.eventMarker.lineStyle.dashStyle=re.PdfDashStyle.Dash}bn.prototype.size=function(){return this.mKeys.length},bn.prototype.add=function(e,t){if(null==e||null==t)throw new ReferenceError("Provided key or value is not valid.");if(this.mKeys.indexOf(e)<0)return this.mKeys.push(e),this.mValues.push(t),1;throw new RangeError("An item with the same key has already been added.")},bn.prototype.keys=function(){return this.mKeys},bn.prototype.values=function(){return this.mValues},bn.prototype.getValue=function(e){if(null==e)throw new ReferenceError("Provided key is not valid.");e=this.mKeys.indexOf(e);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mValues[e]},bn.prototype.setValue=function(e,t){if(null==e)throw new ReferenceError("Provided key is not valid.");var i=this.mKeys.indexOf(e);i<0?(this.mKeys.push(e),this.mValues.push(t)):this.mValues[i]=t},bn.prototype.remove=function(e){if(null==e)throw new ReferenceError("Provided key is not valid.");e=this.mKeys.indexOf(e);if(e<0)throw new RangeError("No item with the specified key has been added.");return this.mKeys.splice(e,1),this.mValues.splice(e,1),!0},bn.prototype.containsKey=function(e){if(null==e)throw new ReferenceError("Provided key is not valid.");return!(this.mKeys.indexOf(e)<0)},bn.prototype.clear=function(){this.mKeys=[],this.mValues=[]};var Tn=bn;function bn(){this.mKeys=[],this.mValues=[]}Object.defineProperty(vn.prototype,"left",{get:function(){return this.leftPen},set:function(e){this.leftPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"right",{get:function(){return this.rightPen},set:function(e){this.rightPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"top",{get:function(){return this.topPen},set:function(e){this.topPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"bottom",{get:function(){return this.bottomPen},set:function(e){this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"all",{set:function(e){this.leftPen=this.rightPen=this.topPen=this.bottomPen=e},enumerable:!0,configurable:!0}),Object.defineProperty(vn.prototype,"isAll",{get:function(){return this.leftPen===this.rightPen&&this.leftPen===this.topPen&&this.leftPen===this.bottomPen},enumerable:!0,configurable:!0}),Object.defineProperty(vn,"default",{get:function(){return new vn},enumerable:!0,configurable:!0});var wn=vn;function vn(){var e=new re.PdfPen(new re.PdfColor(0,0,0)),t=(e.dashStyle=re.PdfDashStyle.Solid,new re.PdfPen(new re.PdfColor(0,0,0))),i=(t.dashStyle=re.PdfDashStyle.Solid,new re.PdfPen(new re.PdfColor(0,0,0))),a=(i.dashStyle=re.PdfDashStyle.Solid,new re.PdfPen(new re.PdfColor(0,0,0)));a.dashStyle=re.PdfDashStyle.Solid,this.leftPen=e,this.rightPen=t,this.topPen=i,this.bottomPen=a}Object.defineProperty(Pn.prototype,"left",{get:function(){return this.leftPad},set:function(e){this.leftPad=e,this.hasLeftPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Pn.prototype,"right",{get:function(){return this.rightPad},set:function(e){this.rightPad=e,this.hasRightPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Pn.prototype,"top",{get:function(){return this.topPad},set:function(e){this.topPad=e,this.hasTopPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Pn.prototype,"bottom",{get:function(){return this.bottomPad},set:function(e){this.bottomPad=e,this.hasBottomPad=!0},enumerable:!0,configurable:!0}),Object.defineProperty(Pn.prototype,"all",{set:function(e){this.leftPad=this.rightPad=this.topPad=this.bottomPad=e,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0},enumerable:!0,configurable:!0});var Sn=Pn;function Pn(e,t,i,a){this.hasLeftPad=!1,this.hasRightPad=!1,this.hasTopPad=!1,this.hasBottomPad=!1,void 0===e?(this.leftPad=this.rightPad=5.76,this.bottomPad=this.topPad=.5):(this.leftPad=e,this.rightPad=t,this.topPad=i,this.bottomPad=a,this.hasLeftPad=!0,this.hasRightPad=!0,this.hasTopPad=!0,this.hasBottomPad=!0)}function Cn(){}var Rn,Mn,xn=function(){this.cellSpacing=0,this.borderOverlapStyle=re.PdfBorderOverlapStyle.Overlap,this.allowHorizontalOverflow=!1,this.horizontalOverflowType=k.PdfHorizontalOverflowType.LastPage,this.cellPadding=new Sn},On=(Rn=function(e,t){return(Rn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)},function(e,t){function i(){this.constructor=e}Rn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),In=(Mn=re.ElementLayouter,On(En,Mn),Object.defineProperty(En.prototype,"treegrid",{get:function(){return this.elements},enumerable:!0,configurable:!0}),En.prototype.layoutInternal=function(e){this.currentPage=e.page;var t=e.format;return null!==this.currentPage&&(this.currentPageBounds=this.currentPage.getClientSize()),this.currentGraphics=this.currentPage.graphics,null!==t&&t.break===re.PdfLayoutBreakType.FitColumnsToPage?this.currentBounds=new re.RectangleF(new re.PointF(e.bounds.x,e.bounds.y),new re.SizeF(this.treegrid.columns.width,this.currentGraphics.clientSize.height)):this.currentBounds=new re.RectangleF(new re.PointF(e.bounds.x,e.bounds.y),this.currentGraphics.clientSize),0!==this.treegrid.rows.count&&(this.currentBounds.width=0<e.bounds.width?e.bounds.width:this.currentBounds.width-this.treegrid.rows.getRow(0).cells.getCell(0).style.borders.left.width/2),this.startLocation=new re.PointF(e.bounds.x,e.bounds.y),0<e.bounds.height&&(this.currentBounds.height=e.bounds.height),this.treegrid.style.allowHorizontalOverflow||this.treegrid.isFitToWidth?(this.treegrid.measureColumnsWidth(this.currentBounds),this.columnRanges.push([0,this.treegrid.columns.count-1])):(this.treegrid.measureColumnsWidth(),this.determineColumnDrawRanges()),this.layoutOnPage(e)},En.prototype.determineColumnDrawRanges=function(){for(var e=0,t=0,i=0,a=this.treegrid.taskbar.isAutoFit()?oe(this.currentGraphics.clientSize.width)-this.currentBounds.x:this.currentGraphics.clientSize.width-this.currentBounds.x,n=0;n<this.treegrid.columns.count;n++)if(a<=(i+=this.treegrid.columns.getColumn(n).width)){for(var r=0,s=e;s<=n&&!(a<(r+=this.treegrid.columns.getColumn(s).width));s++)t=s;this.columnRanges.push([e,t]),e=t+1,t<=n&&(i=this.treegrid.columns.getColumn(n).width)}this.columnRanges.push([e,this.treegrid.columns.count-1])},En.prototype.getFormat=function(e){return e},En.prototype.updateCollection=function(e,t,i,a,n,r,s){null!=e&&(e=r,0<t.length&&(e=t[t.length-1].pageNumber),i.push({rowIndex:a,height:n,pageNumber:e+s}))},En.prototype.layoutOnPage=function(e){for(var t=0,i=0,a=[],n=[],r=this.getFormat(e.format),s=new Tn,o=e.page,l=0;l<this.columnRanges.length;l++){for(var d=this.columnRanges[l],h=(this.cellStartIndex=d[0],this.cellEndIndex=d[1],this.treegrid.rows.count),p=0,u=!1,c=0;c<h;c++){var g=this.treegrid.rows.getRow(c),f=(p++,this.currentBounds.y),m=(null===this.currentPage||s.containsKey(this.currentPage)||(a.push({height:t,pageNumber:i}),i++,t=0,s.add(this.currentPage,d)),this.drawRow(g));for(f===this.currentBounds.y?(u=!0,this.repeatRowIndex=this.treegrid.rows.rowCollection.indexOf(g)):(u=!1,this.repeatRowIndex=-1,this.updateCollection(this.currentPage,a,n,c,g.height,i,0));!m.isFinish&&null!==o;)if(this.treegrid.allowRowBreakAcrossPages)this.currentPage=this.getNextPageFormat(r),this.treegrid.enableHeader&&this.drawHeader(),this.checkBounds(r),m=this.drawRow(g),t+=g.height,this.updateCollection(this.currentPage,a,n,c,g.height,i,1);else{if(!this.treegrid.allowRowBreakAcrossPages&&p<length){this.currentPage=this.getNextPageFormat(r),this.treegrid.enableHeader&&this.drawHeader();break}if(p>=length)break}!m.isFinish&&null!==o&&r.layout!==re.PdfLayoutType.OnePage&&u&&(this.startLocation.x=this.currentBounds.x,this.currentPage=this.getNextPageFormat(r),this.layoutOnPageHelper(r,s,d,g),this.updateCollection(this.currentPage,a,n,c,g.height,i,0))}this.columnRanges.indexOf(d)<this.columnRanges.length-1&&null!==o&&r.layout!==re.PdfLayoutType.OnePage&&(this.currentPage=this.getNextPageFormat(r),this.checkBounds(r))}e=this.getLayoutResult(),this.treegrid.style.allowHorizontalOverflow&&this.treegrid.style.horizontalOverflowType===k.PdfHorizontalOverflowType.NextPage&&this.reArrangePages(s),a.push({height:t,pageNumber:i});var y={},D=(0<n.length&&(this.headerHeight=n[0].height),n.forEach(function(e){y[e.pageNumber]||(y[e.pageNumber]=[]),y[e.pageNumber].push(e.height)}),Object.keys(y).map(function(e){e=parseInt(e,10);return{pageNumber:e,totalHeight:y[e].reduce(function(e,t){return e+t},0)}}));return this.pageHeightCollection=D,e},En.prototype.layoutOnPageHelper=function(e,t,i,a){this.treegrid.enableHeader&&this.drawHeader(),this.startLocation.y=this.currentBounds.y,e.paginateBounds===new re.RectangleF(0,0,0,0)?this.currentBounds.x+=this.startLocation.x:(e=this.currentBounds.x,this.currentBounds.x=e),this.currentBounds.x===wn.default.left.width/2&&(this.currentBounds.y+=this.startLocation.x),this.drawRow(a),null===this.currentPage||t.containsKey(this.currentPage)||t.add(this.currentPage,i)},En.prototype.checkBounds=function(e){var t=new re.PointF(wn.default.right.width/2,wn.default.top.width/2);e.paginateBounds===new re.RectangleF(0,0,0,0)&&this.startLocation===t&&(this.currentBounds.x+=this.startLocation.x,this.currentBounds.y+=this.startLocation.y)},En.prototype.drawHeader=function(){this.drawRow(this.treegrid.rows.getRow(0))},En.prototype.reArrangePages=function(e){for(var t=this.currentPage.document,i=[],a=e.keys(),n=0;n<a.length;n++)(o=a[n]).section=null,i.push(o),t.pages.remove(o);for(n=0;n<e.size();n++)for(var r=e.size()/this.columnRanges.length,s=n;s<e.size();s+=r){var o=i[s];-1===t.pages.indexOf(o)&&t.pages.add(o)}},En.prototype.getNextPageFormat=function(e){var t=this.currentPage.section,i=null,a=t.indexOf(this.currentPage),i=a===t.count-1?t.add():t.getPages()[a+1];return this.currentGraphics=i.graphics,this.currentBounds=new re.RectangleF(new re.PointF(0,0),i.getClientSize()),i},En.prototype.getLayoutResult=function(){var e=new re.RectangleF(this.startLocation,new re.SizeF(this.currentBounds.width,this.currentBounds.y-this.startLocation.y));return new Un(this.currentPage,e)},En.prototype.checkIfDefaultFormat=function(e){var t=new re.PdfStringFormat;return e.alignment===t.alignment&&e.characterSpacing===t.characterSpacing&&e.clipPath===t.clipPath&&e.firstLineIndent===t.firstLineIndent&&e.horizontalScalingFactor===t.horizontalScalingFactor&&e.lineAlignment===t.lineAlignment&&e.lineLimit===t.lineLimit&&e.lineSpacing===t.lineSpacing&&e.measureTrailingSpaces===t.measureTrailingSpaces&&e.noClip===t.noClip&&e.paragraphIndent===t.paragraphIndent&&e.rightToLeft===t.rightToLeft&&e.subSuperScript===t.subSuperScript&&e.wordSpacing===t.wordSpacing&&e.wordWrap===t.wordWrap},En.prototype.drawRow=function(e,t,i){var a;if(ne.isNullOrUndefined(t))return a=new re.RowLayoutResult,(i=0<e.rowBreakHeight?e.rowBreakHeight:e.height)>this.currentPageBounds.height?this.treegrid.allowRowBreakAcrossPages?(a.isFinish=!0,this.drawRowWithBreak(a,e,i)):(a.isFinish=!1,this.drawRow(e,a,i)):this.currentBounds.y+i>this.currentPageBounds.height||this.currentBounds.y+i>this.currentBounds.height?-1<this.repeatRowIndex&&this.repeatRowIndex===e.rowIndex?this.treegrid.allowRowBreakAcrossPages?(a.isFinish=!0,this.drawRowWithBreak(a,e,i)):(a.isFinish=!1,this.drawRow(e,a,i)):a.isFinish=!1:(a.isFinish=!0,this.drawRow(e,a,i)),a;var n=new re.PointF(this.currentBounds.x,this.currentBounds.y),r=(t.bounds=new re.RectangleF(n,new re.SizeF(0,0)),0);i=this.reCalculateHeight(e,i);for(var s=this.cellStartIndex;s<=this.cellEndIndex;s++){var o=e.cells.getCell(s),l=this.treegrid.columns.getColumn(s);if(!ne.isNullOrUndefined(o.value)){l.isTreeColumn&&(r=e.level);var d=1<o.columnSpan&&s>this.cellEndIndex+1;if(!d)for(var h=1;h<o.columnSpan;h++)e.cells.getCell(s+h).isCellMergeContinue=!0;var p=new re.SizeF(l.width,i);1<o.columnSpan&&(p=new re.SizeF(o.width,i),s+=o.columnSpan),!this.checkIfDefaultFormat(l.format)&&this.checkIfDefaultFormat(o.style.format)&&(o.style.format=l.format),o.draw(this.currentGraphics,new re.RectangleF(n,p),d,r),e.treegrid.style.allowHorizontalOverflow&&(o.columnSpan>this.cellEndIndex||s+o.columnSpan>this.cellEndIndex+1)&&this.cellEndIndex<e.cells.count-1&&(e.rowOverflowIndex=this.cellEndIndex),n.x+=l.width,r=0}}return this.currentBounds.y+=i,t.bounds=new re.RectangleF(new re.PointF(t.bounds.x,t.bounds.y),new re.SizeF(n.x,n.y)),null},En.prototype.drawRowWithBreak=function(e,t,i){var a=new re.PointF(this.currentBounds.x,this.currentBounds.y),n=(e.bounds=new re.RectangleF(a,new re.SizeF(0,0)),0);this.treegridHeight=this.currentBounds.height,t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height;for(var r=0;r<t.cells.count;r++)(l=t.cells.getCell(r)).measureHeight()===i&&null===l.value&&(t.rowBreakHeight=this.currentBounds.y+i-this.currentBounds.height);for(var s=this.cellStartIndex;s<=this.cellEndIndex;s++){var o=this.treegrid.columns.getColumn(s);o.isTreeColumn&&(n=10*t.level);var l,d=(l=t.cells.getCell(s)).columnSpan+s>this.cellEndIndex+1&&1<l.columnSpan;if(!d)for(var h=1;h<l.columnSpan;h++)t.cells.getCell(s+h).isCellMergeContinue=!0;var p=0<this.treegridHeight?this.treegridHeight:this.currentBounds.height,p=new re.SizeF(o.width,p);!this.checkIfDefaultFormat(o.format)&&this.checkIfDefaultFormat(l.style.format)&&(l.style.format=o.format),l.draw(this.currentGraphics,new re.RectangleF(a,p),d,n),e.isFinish=e.isFinish&&l.finishedDrawingCell,a.x+=o.width,this.currentBounds.y+=(n=0)<this.treegridHeight?this.treegridHeight:i,e.bounds=new re.RectangleF(new re.PointF(e.bounds.x,e.bounds.y),new re.SizeF(a.x,a.y))}},En.prototype.reCalculateHeight=function(e,t){for(var i=0,a=this.cellStartIndex;a<=this.cellEndIndex;a++)ne.isNullOrUndefined(e.cells.getCell(a).remainingString)&&""!==e.cells.getCell(a).remainingString||(i=Math.max(i,e.cells.getCell(a).measureHeight()));return Math.max(t,i)},En);function En(e){e=Mn.call(this,e)||this;return e.columnRanges=[],e.repeatRowIndex=-1,e.pageHeightCollection=[],e.headerHeight=0,e.currentBounds=new re.RectangleF(0,0,0,0),e}Fn=re.PdfLayoutResult,On(Nn,Fn);var Fn,Un=Nn;function Nn(e,t){return Fn.call(this,e,t)||this}Ln=re.PdfLayoutFormat,On(Bn,Ln);var Ln,Vn=Bn;function Bn(e){return void 0===e?Ln.call(this)||this:Ln.call(this,e)||this}An=function(e,t){return(An=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var An,Wn,On=function(e,t){function i(){this.constructor=e}An(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},jn=(Wn=re.PdfLayoutElement,On(Hn,Wn),Object.defineProperty(Hn.prototype,"size",{get:function(){return 0===this.treeGridSize.width&&0===this.treeGridSize.height&&(this.treeGridSize=this.calculateTreeGridSize()),this.treeGridSize},set:function(e){this.treeGridSize=e},enumerable:!0,configurable:!0}),Hn.prototype.draw=function(e,t,i,a){var n;return t instanceof re.PointF&&void 0===t.width&&void 0===i?this.drawHelper(e,t.x,t.y):"number"==typeof t&&"number"==typeof i&&void 0===a?this.drawHelper(e,t,i,null):t instanceof re.RectangleF&&void 0!==t.width&&void 0===i?this.drawHelper(e,t,null):t instanceof re.PointF&&void 0===t.width&&i instanceof re.PdfLayoutFormat?this.drawHelper(e,t.x,t.y,i):"number"==typeof t&&"number"==typeof i&&(a instanceof re.PdfLayoutFormat||null===a)?(n=e.graphics.clientSize.width-t,n=new re.RectangleF(t,i,n,0),this.drawHelper(e,n,a)):t instanceof re.RectangleF&&void 0!==t.width&&"boolean"==typeof i?this.drawHelper(e,t,null):this.drawHelper(e,t,i)},Hn.prototype.measureColumnsWidth=function(e){if(void 0!==e)for(var t=this.columns.getDefaultWidths(e.width-e.x),i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i]);else{for(var t=[],a=0,n=0,r=this.columns.count,i=0;i<r;i++){for(var s=this.rows.count,o=0;o<s;o++){var l=this.rows.getRow(o).cells.getCell(i).width,l=0<this.initialWidth?Math.min(this.initialWidth,l):l,a=Math.max(a,l);a=Math.max(this.columns.getColumn(i).width,a),this.columns.getColumn(i).isTreeColumn&&(n=Math.max(n,this.rows.getRow(o).level))}this.columns.getColumn(i).isTreeColumn?t.push(a+10*n):t.push(a),a=0}for(i=0;i<this.columns.count;i++)this.columns.getColumn(i).width<0&&(this.columns.getColumn(i).width=t[i])}},Hn.prototype.calculateTreeGridSize=function(){for(var e=0,t=this.columns.width,i=0;i<this.headers.count;i++)e+=this.headers.getHeader(i).height;for(i=0;i<this.rows.count;i++)e+=this.rows.getRow(i).height;return new re.SizeF(t,e)},Hn.prototype.drawGrid=function(e,t,i,a){this.initialWidth=e.graphics.clientSize.width;var n=new re.RectangleF(0,0,e.getClientSize().height,0);return this.draw(e,n,a)},Hn.prototype.layout=function(e){var t,i;return 0!==this.rows.count&&(t=0!==this.rows.getRow(0).cells.count?this.rows.getRow(0).cells.getCell(0).style:null,ne.isNullOrUndefined(t)||1===t.borders.left.width||(i=t.borders.left.width/2,t=t.borders.top.width/2,e.bounds.x===wn.default.right.width/2&&e.bounds.y===wn.default.right.width/2&&(i=new re.RectangleF(new re.PointF(i,t),new re.SizeF(this.size.width,this.size.height)),e.bounds=i))),this.layouter=new In(this),this.layouter.layoutInternal(e)},Hn);function Hn(){var e=Wn.call(this)||this;return e.treeGridSize=new re.SizeF(0,0),e.treeColumnIndex=0,e.allowRowBreakAcrossPages=!0,e.enableHeader=!0,e.isFitToWidth=!1,e.columns=new tr(e),e.rows=new Yn(e),e.headers=new Qn(e),e.style=new xn,e.rowHeight=0,e}Object.defineProperty(zn.prototype,"height",{get:function(){return 0===this.cellHeight&&(this.cellHeight=this.measureHeight()),this.cellHeight},set:function(e){this.cellHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(zn.prototype,"width",{get:function(){return 0===this.cellWidth&&(this.cellWidth=this.measureWidth()),Math.round(this.cellWidth)},set:function(e){this.cellWidth=e},enumerable:!0,configurable:!0}),zn.prototype.measureWidth=function(){var e,t=0,i=new re.PdfStringLayouter;return"string"==typeof this.value&&(e=new re.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),e=this.row.isParentRow?new re.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,re.PdfFontStyle.Bold):new re.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),this.row.treegrid.ganttStyle.font&&(e=this.row.treegrid.ganttStyle.font),t=(t+=i.layout(this.value,e,this.style.format,new re.SizeF(Number.MAX_VALUE,Number.MAX_VALUE),!1,new re.SizeF(0,0)).actualSize.width)+2*(this.style.borders.left.width+this.style.borders.right.width)),void 0!==this.row.treegrid.style.cellPadding.left&&this.row.treegrid.style.cellPadding.hasLeftPad&&(t+=this.row.treegrid.style.cellPadding.left),void 0!==this.row.treegrid.style.cellPadding.right&&this.row.treegrid.style.cellPadding.hasRightPad&&(t+=this.row.treegrid.style.cellPadding.right),t+=this.row.treegrid.style.cellSpacing},zn.prototype.measureHeight=function(){var e,t,i=this.row.treegrid.rowHeight,a=0,n=this.calculateWidth(),r=(n=(n-=this.row.treegrid.style.cellPadding.right+this.row.treegrid.style.cellPadding.left)-(this.style.borders?this.style.borders.left.width+this.style.borders.right.width:0),new re.PdfStringLayouter);return"string"!=typeof this.value&&"string"!=typeof this.remainingString||(e=this.value,this.finishedDrawingCell||(e=ne.isNullOrUndefined(this.remainingString)||""===this.remainingString?this.value:this.remainingString),t=null,t=this.row.isParentRow?new re.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,re.PdfFontStyle.Bold):new re.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),this.row.treegrid.ganttStyle.font&&(t=this.row.treegrid.ganttStyle.font),r=r.layout(e,t,this.style.format,new re.SizeF(n-10,0),!1,new re.SizeF(0,0)),t=Math.max(r.lineHeight,r.actualSize.height),80<e.length?a+=t+20:a+=t+r.size.height/2,a+=2*(this.style.borders.top.width+this.style.borders.bottom.width)),i<(a=(a+=this.row.treegrid.style.cellPadding.top+this.row.treegrid.style.cellPadding.bottom)+this.row.treegrid.style.cellSpacing)?a:i},zn.prototype.calculateWidth=function(){for(var e=this.row.cells.indexOf(this),t=this.columnSpan,i=0,a=0;a<t;a++)i+=this.row.treegrid.columns.getColumn(e+a)?this.row.treegrid.columns.getColumn(e+a).width:0;return this.row.treegrid.columns.getColumn(e)&&this.row.treegrid.columns.getColumn(e).isTreeColumn&&(i-=10*this.row.level),i},zn.prototype.draw=function(e,t,i,a){var n,r,s,o,l,d=null,h=(this.drawCellBackground(e,t),new re.PdfSolidBrush(this.style.fontColor)),p=null,p=this.row.isParentRow?(u=re.PdfFontStyle.Bold,this.style.fontStyle&&(u=this.style.fontStyle),new re.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,u)):new re.PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily,this.style.fontSize,this.style.fontStyle),u=(this.row.treegrid.ganttStyle.font&&(p=this.row.treegrid.ganttStyle.font),t);return this.isHeaderCell||(u.x=u.x,u.width=u.width),u.height>=e.clientSize.height&&(this.row.treegrid.allowRowBreakAcrossPages?(u.height-=u.y,t.height-=t.y):(u.height=e.clientSize.height,t.height=e.clientSize.height)),u=this.adjustContentLayoutArea(u),this.image&&this.value?(n=void 0,n=this.image.width<=u.width?new re.RectangleF(u.x+a,u.y-this.style.padding.bottom,this.image.width,this.image.height):u,e.drawImage(this.image,n.x+a,n.y-5,n.width,n.height),r=null,s=void 0,l=(l=this.fontStyle)||this.style,o=new re.PdfStandardFont(l.fontFamily,l.fontSize,l.fontStyle),s=l.fontFamily?o:p,l=h,this.row.treegrid.ganttStyle.cell.fontBrush&&(l=new re.PdfSolidBrush(this.row.treegrid.ganttStyle.cell.fontBrush)),this.row.treegrid.ganttStyle.cell.format.alignment&&!this.isHeaderCell&&(this.style.format.alignment=this.row.treegrid.ganttStyle.cell.format.alignment),this.finishedDrawingCell?(r=""===this.remainingString?this.remainingString:this.value,e.drawString(r,s,null,l,u.x+a+(n.width?n.width+8:0),this.isHeaderCell?u.y-16:u.y-this.style.padding.bottom,u.width-a-10,u.height-10,this.style.format)):e.drawString(this.remainingString,s,null,l,u.x+a,this.isHeaderCell?u.y-16:u.y,this.style.format),d=e.stringLayoutResult):"string"==typeof this.value||"string"==typeof this.remainingString?(r=null,s=void 0,o=new re.PdfStandardFont(this.style.fontFamily,this.style.fontSize,this.style.fontStyle),s=this.style.fontFamily?o:p,l=h,this.row.treegrid.ganttStyle.cell.fontBrush&&(l=new re.PdfSolidBrush(this.row.treegrid.ganttStyle.cell.fontBrush)),this.row.treegrid.ganttStyle.cell.format.alignment&&!this.isHeaderCell&&(this.style.format.alignment=this.row.treegrid.ganttStyle.cell.format.alignment),this.finishedDrawingCell?(r=""===this.remainingString?this.remainingString:this.value,e.drawString(r,s,null,l,u.x+a,this.isHeaderCell?u.y-16:u.y-this.style.padding.bottom-3,u.width-a-10,u.height-10,this.style.format)):e.drawString(this.remainingString,s,null,l,u.x+a,this.isHeaderCell?u.y-16:u.y,this.style.format),d=e.stringLayoutResult):this.value instanceof re.PdfImage||this.value instanceof re.PdfBitmap?this.drawImageBound(u,e,this.value):this.value instanceof re.PdfTextWebLink&&this.value.draw(e.currentPage,u),null!==this.style.borders&&this.drawCellBorder(e,t),d},zn.prototype.drawImageBound=function(e,t,i){e=i.width<=e.width?new re.RectangleF(e.x,e.y,i.width,e.height):e;t.drawImage(i,e.x,e.y-10,e.width,e.height)},zn.prototype.drawCellBackground=function(e,t){var i=new re.PdfSolidBrush(this.style.backgroundColor);null!==i&&(e.save(),e.drawRectangle(i,t.x,t.y,t.width,t.height),e.restore())},zn.prototype.adjustContentLayoutArea=function(e){var t,e=new re.RectangleF(new re.PointF(e.x,e.y),new re.SizeF(e.width,e.height)),i=this.style.padding;return this.value instanceof jn?(t=this.value.size,this.style.format.alignment===re.PdfTextAlignment.Center?(e.x+=i.left+(e.width-t.width)/2,e.y+=i.top+(e.height-t.height)/2):this.style.format.alignment===re.PdfTextAlignment.Left?(e.x+=i.left,e.y+=i.top):this.style.format.alignment===re.PdfTextAlignment.Right&&(e.x+=i.left+(e.width-t.width),e.y+=i.top)):(e.x+=i.left,e.y+=i.top),e},zn.prototype.drawCellBorder=function(e,t){var i,a,n;this.row.treegrid.style.borderOverlapStyle===re.PdfBorderOverlapStyle.Inside&&(t.x+=this.style.borders.left.width,t.y+=this.style.borders.top.width,t.width-=this.style.borders.right.width,t.height-=this.style.borders.bottom.width),this.style.borders.isAll&&this.isHeaderCell?e.drawRectangle(this.style.borders.left,t.x,t.y,t.width,t.height):(i=new re.PointF(t.x,t.y+t.height),a=new re.PointF(t.x,t.y),(n=this.style.borders.left).lineCap=this.style.borders.left.dashStyle===re.PdfDashStyle.Solid?re.PdfLineCap.Square:n.lineCap,e.drawLine(n,i,a),e.restore(),i=new re.PointF(t.x+t.width,t.y),a=new re.PointF(t.x+t.width,t.y+t.height),n=this.style.borders.right,t.x+t.width>e.clientSize.width-n.width/2&&(i=new re.PointF(e.clientSize.width-n.width/2,t.y),a=new re.PointF(e.clientSize.width-n.width/2,t.y+t.height)),n.lineCap=this.style.borders.right.dashStyle===re.PdfDashStyle.Solid?re.PdfLineCap.Square:n.lineCap,e.drawLine(n,i,a),e.restore(),i=new re.PointF(t.x,t.y),a=new re.PointF(t.x+t.width,t.y),(n=this.style.borders.top).lineCap=this.style.borders.top.dashStyle===re.PdfDashStyle.Solid?re.PdfLineCap.Square:n.lineCap,e.drawLine(n,i,a),e.restore(),i=new re.PointF(t.x+t.width,t.y+t.height),a=new re.PointF(t.x,t.y+t.height),n=this.style.borders.bottom,t.y+t.height>e.clientSize.height-n.width/2&&(i=new re.PointF(t.x+t.width,e.clientSize.height-n.width/2),a=new re.PointF(t.x,e.clientSize.height-n.width/2)),n.lineCap=this.style.borders.bottom.dashStyle===re.PdfDashStyle.Solid?re.PdfLineCap.Square:n.lineCap,e.drawLine(n,i,a)),e.restore()};var Gn=zn;function zn(e){this.cellWidth=0,this.cellHeight=0,this.finishedDrawingCell=!0,ne.isNullOrUndefined(e)?(this.rowSpan=1,this.columnSpan=1):this.row=e,this.style={}}_n.prototype.getCell=function(e){if(e<0||e>=this.count)throw new Error("IndexOutOfRangeException");return this.cells[e]},Object.defineProperty(_n.prototype,"count",{get:function(){return this.cells.length},enumerable:!0,configurable:!0}),_n.prototype.add=function(e){var t;if(void 0===e)return t=new Gn,this.add(t),e;e.row=this.treegridRow,this.cells.push(e)},_n.prototype.indexOf=function(e){return this.cells.indexOf(e)};var qn=_n;function _n(e){this.treegridRow=e,this.cells=[]}Object.defineProperty(Xn.prototype,"cells",{get:function(){return ne.isNullOrUndefined(this.treegridCells)&&(this.treegridCells=new qn(this)),this.treegridCells},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"isParentRow",{get:function(){return this._isParentRow},set:function(e){this._isParentRow=e},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"treegrid",{get:function(){return this.pdfTreeGrid},set:function(e){this.pdfTreeGrid=e},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"rowBreakHeight",{get:function(){return void 0===this.treegridRowBreakHeight&&(this.treegridRowBreakHeight=0),this.treegridRowBreakHeight},set:function(e){this.treegridRowBreakHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"rowOverflowIndex",{get:function(){return this.treegridRowOverflowIndex},set:function(e){this.treegridRowOverflowIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"level",{get:function(){return this.intendLevel},set:function(e){this.intendLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"height",{get:function(){return 0===this.rowHeight&&(this.rowHeight=this.measureHeight()),this.rowHeight},set:function(e){this.rowHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"width",{get:function(){return 0===this.rowWidth&&(this.rowWidth=this.measureWidth()),this.rowWidth},enumerable:!0,configurable:!0}),Object.defineProperty(Xn.prototype,"rowIndex",{get:function(){return this.treegrid.rows.rowCollection.indexOf(this)},enumerable:!0,configurable:!0}),Xn.prototype.measureWidth=function(){for(var e=this.treegrid.columns.columns,t=0,i=0;i<e.length;i++)t+=e[i].width;return t},Xn.prototype.measureHeight=function(){for(var e=0===this.cells.count||ne.isNullOrUndefined(this.cells.getCell(0).height)?33:this.cells.getCell(0).height,t=0;t<this.cells.count;t++){var i=this.cells.getCell(t),e=1===i.columnSpan||1===i.rowSpan?Math.max(e,i.height):Math.min(e,i.height);i.height=e}return e};var Zn=Xn;function Xn(e){this.treegridRowOverflowIndex=0,this.rowHeight=0,this.rowWidth=0,this._isParentRow=!1,this.intendLevel=0,this.pdfTreeGrid=e}Object.defineProperty(Kn.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),Object.defineProperty(Kn.prototype,"rowCollection",{get:function(){return this.rows},enumerable:!0,configurable:!0}),Kn.prototype.addRow=function(e){var t;if(void 0===e)return t=new Zn(this.treegrid),this.addRow(t),t;if(0===e.cells.count)for(var i=0;i<this.treegrid.columns.count;i++)e.cells.add(new Gn);this.rows.push(e)},Kn.prototype.getRow=function(e){return this.rows[e]};var Yn=Kn;function Kn(e){this.rows=[],this.treegrid=e}$n.prototype.getHeader=function(e){return this.rows[e]},Object.defineProperty($n.prototype,"count",{get:function(){return this.rows.length},enumerable:!0,configurable:!0}),$n.prototype.add=function(e){this.rows.push(e)},$n.prototype.indexOf=function(e){return this.rows.indexOf(e)};var Qn=$n;function $n(e){this.rows=[],this.treegrid=e,this.rows=[]}Object.defineProperty(er.prototype,"headerText",{get:function(){return this._headerText},set:function(e){this._headerText=e},enumerable:!0,configurable:!0}),Object.defineProperty(er.prototype,"field",{get:function(){return this._field},set:function(e){this._field=e},enumerable:!0,configurable:!0}),Object.defineProperty(er.prototype,"width",{get:function(){return this.columnWidth},set:function(e){this.columnWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(er.prototype,"isTreeColumn",{get:function(){return this.treeColumnIndex},set:function(e){this.treeColumnIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(er.prototype,"format",{get:function(){return ne.isNullOrUndefined(this.stringFormat)&&(this.stringFormat=new re.PdfStringFormat),this.stringFormat},set:function(e){this.stringFormat=e},enumerable:!0,configurable:!0});var Jn=er;function er(e){this.columnWidth=0,this.treeColumnIndex=!1,this._headerText="",this._field="",this.treegrid=e}ir.prototype.add=function(e){for(var t=0;t<e;t++){this.internalColumns.push(new Jn(this.treegrid));for(var i=0;i<this.treegrid.rows.count;i++){var a=this.treegrid.rows.getRow(i),n=new Gn;n.value="",a.cells.add(n)}}},Object.defineProperty(ir.prototype,"count",{get:function(){return this.internalColumns.length},enumerable:!0,configurable:!0}),Object.defineProperty(ir.prototype,"width",{get:function(){return 0===this.columnWidth&&(this.columnWidth=this.measureColumnsWidth()),this.columnWidth},enumerable:!0,configurable:!0}),Object.defineProperty(ir.prototype,"columns",{get:function(){return this.internalColumns},enumerable:!0,configurable:!0}),ir.prototype.getColumn=function(e){if(0<=e&&e<=this.columns.length)return this.columns[e];throw Error("can not get the column from the index: "+e)},ir.prototype.measureColumnsWidth=function(){var e=0;this.treegrid.measureColumnsWidth();for(var t=0,i=this.internalColumns.length;t<i;t++)e+=this.internalColumns[t].width;return e},ir.prototype.getDefaultWidths=function(e){for(var t=[],i=this.count,a=0;a<this.count;a++)t[a]=this.internalColumns[a].width,0<this.internalColumns[a].width?(e-=this.internalColumns[a].width,i--):t[a]=0;for(a=0;a<this.count;a++)t[a]<=0&&(t[a]=e/i);return t};var tr=ir;function ir(e){this.internalColumns=[],this.columnWidth=0,this.treegrid=e,this.internalColumns=[]}I.prototype.resolveCondition=function(e,t,i){return e?t:i},I.prototype.evaluateConditions=function(e,t,i,a){return e&&t?i:a},I.prototype.shouldProcessChart=function(){var e,t;return this.exportProps&&this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth&&(this.exportProps.fitToWidthSettings.chartWidth&&(e=parseInt(this.exportProps.fitToWidthSettings.chartWidth.split("%")[0],10),e=this.resolveCondition(100<e,100,e)),this.exportProps.fitToWidthSettings.gridWidth)&&(t=parseInt(this.exportProps.fitToWidthSettings.gridWidth.split("%")[0],10),t=this.resolveCondition(100<t,100,t)),!(this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth&&(0===e||100===t))},I.prototype.processToFit=function(){this.beforeSinglePageExport.zoomingProjectStartDate=this.parent.zoomingProjectStartDate,this.beforeSinglePageExport.zoomingProjectEndDate=this.parent.zoomingProjectEndDate,this.beforeSinglePageExport.cloneProjectStartDate=this.parent.cloneProjectStartDate,this.beforeSinglePageExport.cloneProjectEndDate=this.parent.cloneProjectEndDate,this.beforeSinglePageExport.customTimelineSettings=ne.extend({},this.parent.timelineModule.customTimelineSettings,null,!0),this.beforeSinglePageExport.isTimelineRoundOff=this.parent.isTimelineRoundOff,this.beforeSinglePageExport.topTier=this.parent.timelineModule.topTier,this.beforeSinglePageExport.topTierCellWidth=this.parent.timelineModule.topTierCellWidth,this.beforeSinglePageExport.topTierCollection=this.parent.timelineModule.topTierCollection,this.beforeSinglePageExport.bottomTier=this.parent.timelineModule.bottomTier,this.beforeSinglePageExport.bottomTierCellWidth=this.parent.timelineModule.bottomTierCellWidth,this.beforeSinglePageExport.bottomTierCollection=this.parent.timelineModule.bottomTierCollection,this.beforeSinglePageExport.totalTimelineWidth=this.parent.timelineModule.totalTimelineWidth,this.beforeSinglePageExport.timelineStartDate=this.parent.timelineModule.timelineStartDate,this.beforeSinglePageExport.timelineEndDate=this.parent.timelineModule.timelineEndDate,this.beforeSinglePageExport.timelineRoundOffEndDate=this.parent.timelineModule.timelineRoundOffEndDate,this.beforeSinglePageExport.perDayWidth=this.parent.perDayWidth,this.beforeSinglePageExport.updatedConnectorLineCollection=ne.extend([],this.parent.updatedConnectorLineCollection,null,!0),this.beforeSinglePageExport.cloneTimelineStartDate=this.parent.cloneTimelineStartDate,this.beforeSinglePageExport.cloneTimelineEndDate=this.parent.cloneTimelineEndDate,this.parent.timelineModule.isZoomToFit=!0,this.parent.timelineModule.isZooming=!1,this.parent.zoomingProjectStartDate||(this.parent.zoomingProjectStartDate=this.parent.cloneProjectStartDate,this.parent.zoomingProjectEndDate=this.parent.cloneProjectEndDate),this.parent.cloneTimelineStartDate=new Date(this.parent.cloneProjectStartDate),this.parent.cloneTimelineEndDate=new Date(this.parent.cloneProjectEndDate);var e,t,i,a=(this.parent.cloneTimelineEndDate.getTime()-this.parent.cloneTimelineStartDate.getTime())/864e5,n=(this.exportProps.fitToWidthSettings.gridWidth&&(r=parseInt(this.exportProps.fitToWidthSettings.gridWidth.split("%")[0],10),r=this.resolveCondition(100<r,100,r)),this.exportProps.fitToWidthSettings.chartWidth?(n=parseInt(this.exportProps.fitToWidthSettings.chartWidth.split("%")[0],10),this.resolveCondition(100<n,100,n)):this.exportProps.fitToWidthSettings.gridWidth?100-r:70),r=this.parent.pdfExportModule.pdfPageDimensions.width*n/100,s=r/a,o=Object.assign([],this.parent.zoomingLevels).sort(function(e,t){return e.perDayWidth||t.perDayWidth?e.perDayWidth<t.perDayWidth?1:-1:0});if(0!=s){for(var l=0;l<o.length;l++){if(t=o[l],l===o.length-1){e=o[l];break}if(i=o[l+1],s>=t.perDayWidth){e=o[l];break}if(s<t.perDayWidth&&s>i.perDayWidth){e=o[l+1];break}}var n=ne.extend({},{},e,!0),a=(ne.isNullOrUndefined(this.parent.projectStartDate)&&this.parent.timelineModule.roundOffDateToZoom(this.parent.cloneTimelineStartDate,!0,s,n.bottomTier.unit,e),ne.isNullOrUndefined(this.parent.projectEndDate)&&this.parent.timelineModule.roundOffDateToZoom(this.parent.cloneTimelineEndDate,!1,s,n.bottomTier.unit,e),this.parent.timelineModule.calculateNumberOfTimelineCells(n)),d=this.parent.pdfExportModule.pdfPageDimensions.height,d=this.resolveCondition(d<=0,0,17);n.timelineUnitSize=Math.abs(r-d)/a,this.parent.timelineModule.changeTimelineSettings(n),this.parent.timelineModule.isZoomToFit=!1,this.parent.timelineModule.isZooming=!1}},I.prototype.processGridExport=function(e,t,i){this.flatData=e,this.gantt=t,this.exportValueFormatter=new nr(this.parent.locale),this.exportProps=i,this.rowIndex=0,this.colIndex=0,this.columns=this.parent.treeGrid.columns,this.gantt.treeColumnIndex=this.parent.treeColumnIndex,this.gantt.rowHeight=se(this.parent.rowHeight),this.gantt.style.cellPadding.left=0,this.gantt.style.cellPadding.right=0,this.ganttStyle=this.gantt.ganttStyle,this.gantt.borderColor=this.ganttStyle.chartGridLineColor,this.parent.pdfExportModule.isPdfExport=!0,this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth&&this.processToFit(),this.processHeaderContent(),this.processGanttContent(),this.shouldProcessChart()&&(this.processTimeline(),this.processTaskbar(),this.processPredecessor()),this.parent.pdfExportModule.isPdfExport=!1},I.prototype.processHeaderContent=function(){var t=this,i=(this.rowIndex++,this.row=this.gantt.rows.addRow(),0);this.columns.forEach(function(e){t.isColumnVisible(e)&&(t.processColumnHeader(e,i),i++)})},I.prototype.processColumnHeader=function(e,t){this.gantt.columns.add(1);var i=this.gantt.columns.getColumn(t),a=(this.columns[this.parent.treeColumnIndex].field===e.field&&(i.isTreeColumn=!0),parseInt(e.width,10)),a=(i.width=se(a),this.totalColumnWidth+=i.width,i.headerText=e.headerText,i.field=e.field,this.row.cells.getCell(t)),i=(a.value=e.headerText,a.isHeaderCell=!0,this.ganttStyle&&this.ganttStyle.columnHeader&&!ne.isNullOrUndefined(this.ganttStyle.columnHeader.fontBrush)&&(a.style.fontBrush=new re.PdfColor(this.ganttStyle.columnHeader.fontBrush)),this.parent.timelineModule.isSingleTier?45:60),t=(this.copyStyles(this.ganttStyle.columnHeader,a,!1),this.row.height=se(i),e.headerTextAlign&&(a.style.format.alignment=re.PdfTextAlignment[e.headerTextAlign]),a.fontStyle={fontSize:9},{cell:a,style:a.style,value:a.value,column:e,image:null,headerTemplate:{image:null,value:null,fontStyle:{fontBrush:null}}});this.parent.pdfColumnHeaderQueryCellInfo&&this.parent.trigger("pdfColumnHeaderQueryCellInfo",t),t.headerTemplate.image&&t.headerTemplate.value?(t.image=new re.PdfBitmap(t.headerTemplate.image[0].base64),t.image.height=t.headerTemplate.image[0].height||t.image.height,t.image.width=t.headerTemplate.image[0].width||t.image.width,a.image=t.image,a.value=t.headerTemplate.value,a.fontStyle.fontSize=t.headerTemplate.fontStyle.fontSize,a.fontStyle.fontFamily=t.headerTemplate.fontStyle.fontFamily,a.fontStyle.fontBrush=t.headerTemplate.fontStyle.fontColor):a.value=t.value},I.prototype.isColumnVisible=function(e){return e.visible||this.exportProps.includeHiddenColumn},I.prototype.processGanttContent=function(){var t=this;0===this.flatData.length?this.renderEmptyGantt():this.flatData.forEach(function(e){t.row=t.gantt.rows.addRow(),e.hasChildRecords&&(t.gantt.rows.getRow(t.rowIndex).isParentRow=!0),t.processRecordRow(e),t.rowIndex++})},I.prototype.processTimeline=function(){this.parent.enableTimelineVirtualization&&(this.parent.timelineModule.pdfExportTopTierCollection=[],this.parent.timelineModule.pdfExportBottomTierCollection=[],this.parent.timelineModule.createTimelineSeries());var e,t=this.parent.timelineModule;this.gantt.chartHeader.topTierHeight=this.gantt.chartHeader.bottomTierHeight=this.parent.timelineModule.isSingleTier?45:30,this.gantt.chartHeader.topTierCellWidth=t.topTierCellWidth,this.gantt.chartHeader.bottomTierCellWidth=t.bottomTierCellWidth,this.gantt.chartHeader.topTier=ne.extend([],[],this.parent.enableTimelineVirtualization?t.pdfExportTopTierCollection:t.topTierCollection,!0),this.gantt.chartHeader.bottomTier=ne.extend([],[],this.parent.enableTimelineVirtualization?t.pdfExportBottomTierCollection:t.bottomTierCollection,!0),this.exportProps&&this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth&&this.parent.enableTimelineVirtualization?(e="None"===t.topTier?"bottomTier":"topTier",this.gantt.chartHeader.width=t.calculateWidthBetweenTwoDate(e,t.timelineStartDate,t.timelineEndDate)):this.gantt.chartHeader.width=this.parent.enableTimelineVirtualization?this.parent.timelineModule.wholeTimelineWidth:t.totalTimelineWidth,this.gantt.chartHeader.height=ne.isNullOrUndefined(this.gantt.rows.getRow(0).height)?65:this.gantt.rows.getRow(0).height,this.gantt.timelineStartDate=new Date(t.timelineStartDate.getTime())},I.prototype.processPredecessor=function(){var i=this;(ne.isNullOrUndefined(this.exportProps.showPredecessorLines)||this.exportProps.showPredecessorLines)&&(this.parent.pdfExportModule.isPdfExport=!0,this.parent.predecessorModule.createConnectorLinesCollection(this.flatData),this.parent.updatedConnectorLineCollection.forEach(function(e){var t=i.gantt.predecessor.add();t.parentLeft=e.parentLeft,t.childLeft=e.childLeft,t.parentWidth=e.parentWidth,t.childWidth=e.childWidth,t.parentIndex=i.findIndexUsingParent(i.flatData,e.parentIndex),t.childIndex=i.findIndexUsingParent(i.flatData,e.childIndex),t.rowHeight=e.rowHeight,t.type=e.type,t.milestoneParent=e.milestoneParent,t.milestoneChild=e.milestoneChild,t.parentEndPoint=e.parentEndPoint,t.lineWidth=5<i.parent.connectorLineWidth?se(5):se(i.parent.connectorLineWidth),e.isCritical?t.connectorLineColor=i.ganttStyle.criticalConnectorLineColor:t.connectorLineColor=i.ganttStyle.connectorLineColor,i.gantt.predecessorCollection.push(t)}),this.parent.pdfExportModule.isPdfExport=!1)},I.prototype.findIndexUsingParent=function(e,t){return e.findIndex(function(e){return e.index===t})},I.prototype.processRecordRow=function(t){var i=this;this.colIndex=0,this.row.level=t.level,this.columns.forEach(function(e){i.isColumnVisible(e)&&(i.processRecordCell(t,e,i.row),i.colIndex++)})},I.prototype.processRecordCell=function(e,t,i){var a=i.cells.getCell(this.colIndex),n=this.parent.taskFields,r=e.ganttProperties;"datepickeredit"===t.editType||"datetimepickeredit"===t.editType?a.value=e[t.field]:t.field===n.duration?a.value=this.parent.getDurationString(r.duration,r.durationUnit):t.field===n.baselineDuration?a.value=this.parent.getDurationString(r.baselineDuration,r.durationUnit):t.field===n.resourceInfo?a.value=r.resourceNames:t.field===n.work?a.value=this.parent.getWorkString(r.work,r.workUnit):a.value=ne.isNullOrUndefined(e[t.field])?"":"number"===t.type?e[t.field]:e[t.field].toString();var n=ne.isNullOrUndefined(a.value)?"":"number"===t.type?a.value:a.value.toString(),r=this.resolveCondition(!ne.isNullOrUndefined(n),n,""),n=(a.isHeaderCell=!1,a.style.padding=new Sn,this.copyStyles(this.ganttStyle.cell,a,i.isParentRow),t.index!==this.parent.treeColumnIndex?a.style.format.alignment=re.PdfTextAlignment[t.textAlign]:a.style.format.paragraphIndent=10*a.row.level,{data:e,value:r,column:t,style:a.style,cell:a});n.value=this.exportValueFormatter.formatCellValue(n,this.parent),this.parent.pdfQueryCellInfo&&(this.parent.trigger("pdfQueryCellInfo",n),n.style.backgroundColor&&(a.style.backgroundColor=n.style.backgroundColor),n.style.borderColor&&(a.style.borderColor=n.style.borderColor),n.style.fontBrush&&(a.style.fontBrush=n.style.fontBrush),n.style.fontColor&&(a.style.fontColor=n.style.fontColor),n.style.fontFamily?(i=n.style.fontFamily,e=this.getFontFamily(i),a.style.fontFamily=e):a.style.fontFamily=this.ganttStyle.fontFamily,n.style.fontSize&&(a.style.fontSize=n.style.fontSize),n.style.fontStyle?(r=n.style.fontStyle,t=this.getFontStyle(r),a.style.fontStyle=t):a.style.fontStyle=this.ganttStyle.footer.fontStyle,n.style.format&&(a.style.format=n.style.format),n.style.padding)&&(a.style.padding=n.style.padding),ne.isNullOrUndefined(n.image)||ne.isNullOrUndefined(n.image.base64)||(i=ne.extend({},n.image,null,!0),n.image=new re.PdfBitmap(n.image.base64),n.image.height=i.height||n.image.height,n.image.width=i.width||n.image.width,a.image=n.image),a.value=n.value,ne.isNullOrUndefined(n.hyperLink)||ne.isNullOrUndefined(n.hyperLink.displayText)&&ne.isNullOrUndefined(n.hyperLink.target)||(a.value=this.setHyperLink(n))},I.prototype.setHyperLink=function(e){var t=new re.PdfTextWebLink;return t.url=e.hyperLink.target,t.text=e.hyperLink.displayText||e.hyperLink.target,t.font=new re.PdfStandardFont(re.PdfFontFamily.Helvetica,9.75),t.brush=new re.PdfSolidBrush(new re.PdfColor(51,102,187)),t},I.prototype.processTaskbar=function(){var c=this;this.flatData.forEach(function(e){var r=c.gantt.taskbar.add(),t=e.ganttProperties,i=(r.left=t.left,r.width=t.width,r.left<0&&(r.width=r.width+r.left,r.left=0),r.progress=t.progress,r.isScheduledTask=j(t),ne.isNullOrUndefined(t.endDate)&&ne.isNullOrUndefined(t.duration)?r.unscheduledTaskBy="startDate":ne.isNullOrUndefined(t.startDate)&&ne.isNullOrUndefined(t.duration)?r.unscheduledTaskBy="endDate":(r.unscheduledTaskBy="duration",r.unscheduleStarteDate=c.parent.dateValidationModule.getValidStartDate(e.ganttProperties),r.unscheduleEndDate=c.parent.dateValidationModule.getValidEndDate(e.ganttProperties)),r.startDate=t.startDate,r.endDate=t.endDate,r.height=c.parent.chartRowsModule.taskBarHeight,r.indicators=t.indicators,r.autoStartDate=t.autoStartDate,r.autoEndDate=t.autoEndDate,r.isAutoSchedule=t.isAutoSchedule,r.autoWidth=t.autoWidth,r.autoLeft=t.autoLeft,r.segment=t.segments,r.isSpliterTask=!ne.isNullOrUndefined(t.segments)&&0!==t.segments.length,r.isSpliterTask&&(r.segmentCollection=r.segment.map(function(e){return Object.assign({},e)})),r.baselineTop=c.parent.chartRowsModule.baselineTop,r.isMilestone=t.isMilestone,r.baselineStartDate=t.baselineStartDate,r.baselineEndDate=t.baselineEndDate,r.baselineLeft=t.baselineLeft,r.baselineWidth=t.baselineWidth,r.baselineLeft<0&&(r.baselineWidth=r.baselineWidth+r.baselineLeft,r.baselineLeft=0),r.milestoneColor=new re.PdfColor(c.ganttStyle.taskbar.milestoneColor),r.isParentTask=e.hasChildRecords,t.isMilestone&&(r.height=t.width),e[c.parent.labelSettings.leftLabel]&&(r.leftTaskLabel.value=e[c.parent.labelSettings.leftLabel].toString()),e[c.parent.labelSettings.rightLabel]&&(r.rightTaskLabel.value=e[c.parent.labelSettings.rightLabel].toString()),ne.isNullOrUndefined(e[c.parent.labelSettings.taskLabel])||(r.taskLabel=e[c.parent.labelSettings.taskLabel].toString()),t.isMilestone?Math.floor(c.parent.chartRowsModule.taskBarHeight/2)+33:33),a=!(e.hasChildRecords&&!e.ganttProperties.isAutoSchedule),n=a?t.left:t.autoLeft,a=a?t.width:t.autoWidth,n=(r.rightTaskLabel.left=n+a+i,r.fontFamily=c.ganttStyle.fontFamily,r.progressWidth=t.progressWidth,r.labelColor=new re.PdfColor(c.ganttStyle.label.fontColor),r.progressFontColor=new re.PdfColor(c.ganttStyle.taskbar.progressFontColor),r.isParentTask?(r.taskColor=new re.PdfColor(c.ganttStyle.taskbar.parentTaskColor),r.taskBorderColor=new re.PdfColor(c.ganttStyle.taskbar.parentTaskBorderColor),r.progressColor=new re.PdfColor(c.ganttStyle.taskbar.parentProgressColor)):e.isCritical?(r.taskColor=new re.PdfColor(c.ganttStyle.taskbar.criticalTaskColor),r.progressColor=new re.PdfColor(c.ganttStyle.taskbar.criticalProgressColor),r.taskBorderColor=new re.PdfColor(c.ganttStyle.taskbar.criticalTaskBorderColor),r.milestoneColor=new re.PdfColor(c.ganttStyle.taskbar.criticalTaskColor)):(r.taskColor=new re.PdfColor(c.ganttStyle.taskbar.taskColor),r.progressColor=new re.PdfColor(c.ganttStyle.taskbar.progressColor),r.taskBorderColor=new re.PdfColor(c.ganttStyle.taskbar.taskBorderColor)),r.manualParentBorder=new re.PdfColor(c.ganttStyle.taskbar.manualParentBorder),r.manualChildBorder=new re.PdfColor(c.ganttStyle.taskbar.manualChildBorder),r.manuallineColor=new re.PdfColor(c.ganttStyle.taskbar.manualLineColor),r.unscheduledTaskBarColor=new re.PdfColor(c.ganttStyle.taskbar.unscheduledTaskBarColor),r.manualParentBackground=new re.PdfColor(c.ganttStyle.taskbar.manualParentBackground),r.manualParentProgress=new re.PdfColor(c.ganttStyle.taskbar.manualParentProgress),r.manualChildBackground=new re.PdfColor(c.ganttStyle.taskbar.manualChildBackground),r.manualChildProgress=new re.PdfColor(c.ganttStyle.taskbar.manualChildProgress),r.splitLineBackground=new re.PdfColor(c.ganttStyle.taskbar.splitLineBackground),r.baselineColor=new re.PdfColor(c.ganttStyle.taskbar.baselineColor),r.baselineBorderColor=new re.PdfColor(c.ganttStyle.taskbar.baselineBorderColor),r.gridLineColor=new re.PdfColor(c.ganttStyle.chartGridLineColor),{}),a=(n.leftLabel={value:null,image:null,fontStyle:{fontBrush:null}},n.rightLabel={value:null,image:null,fontStyle:{fontBrush:null}},n.taskLabel={value:null,image:null,fontStyle:{fontBrush:null}},r.labelSettings=n,{value:null,image:null,fontStyle:{fontBrush:null}}),i=(r.taskbarTemplate=a,c.gantt.taskbarCollection.push(r),{}),s=(i.progressFontColor=r.progressFontColor,i.taskColor=r.taskColor,i.taskBorderColor=r.taskBorderColor,i.progressColor=r.progressColor,i.milestoneColor=r.milestoneColor,i.baselineColor=r.baselineColor,i.baselineBorderColor=r.baselineBorderColor,i.unscheduledTaskBarColor=r.unscheduledTaskBarColor,i.manualParentBackground=r.manualParentBackground,i.manualParentBorder=r.manualParentBorder,i.manualParentProgress=r.manualParentProgress,i.manualChildBackground=r.manualChildBackground,i.manualChildProgress=r.manualChildProgress,i.manualLineColor=r.manuallineColor,i.manualChildBorder=r.manualChildBorder,i.manualChildProgress=r.manualChildProgress,i.splitLineBackground=r.splitLineBackground,{taskbar:i,data:e,indicators:e.ganttProperties.indicators,labelSettings:n,taskbarTemplate:a});if(c.parent.pdfQueryTaskbarInfo){var o=[];if(s.taskbar.taskSegmentStyles=null,s.data.ganttProperties.segments){for(var l=0;l<s.data.ganttProperties.segments.length;l++){var d={taskColor:s.taskbar.taskColor,taskBorderColor:s.taskbar.taskBorderColor,progressColor:s.taskbar.progressColor};o.push(d)}s.taskbar.taskSegmentStyles=o}c.parent.trigger("pdfQueryTaskbarInfo",s),r.taskSegmentStyles=s.taskbar.taskSegmentStyles,r.progressFontColor=s.taskbar.progressFontColor,r.taskColor=s.taskbar.taskColor,r.taskBorderColor=s.taskbar.taskBorderColor,r.progressColor=s.taskbar.progressColor,r.milestoneColor=s.taskbar.milestoneColor,r.baselineColor=s.taskbar.baselineColor,r.baselineBorderColor=s.taskbar.baselineBorderColor,r.unscheduledTaskBarColor=s.taskbar.unscheduledTaskBarColor,r.manualParentBackground=s.taskbar.manualParentBackground,r.manualParentProgress=s.taskbar.manualParentProgress,r.manualParentBorder=s.taskbar.manualParentBorder,r.manualChildBackground=s.taskbar.manualChildBackground,r.manualChildProgress=s.taskbar.manualChildProgress,r.manuallineColor=s.taskbar.manualLineColor,r.manualChildBorder=s.taskbar.manualChildBorder,r.manualChildProgress=s.taskbar.manualChildProgress,r.splitLineBackground=s.taskbar.splitLineBackground,r.indicators=s.indicators,r.labelSettings.leftLabel.value=s.labelSettings.leftLabel.value;var h=s.labelSettings.leftLabel.image,p=(r.labelSettings.rightLabel.value=s.labelSettings.rightLabel.value,s.labelSettings.rightLabel.image);if(ne.isNullOrUndefined(s.labelSettings.taskLabel.value)||(r.taskLabel=s.labelSettings.taskLabel.value),!ne.isNullOrUndefined(s.labelSettings.leftLabel.image)&&Array.isArray(s.labelSettings.leftLabel.image[0].base64)&&0<s.labelSettings.leftLabel.image[0].base64.length){var u=s.labelSettings.leftLabel.image[0].base64.length;r.labelSettings.leftLabel.image=[];for(l=0;l<u;l++)r.labelSettings.leftLabel.image.push({base64:h[0].base64[l],width:h[0].width,height:h[0].height})}else ne.isNullOrUndefined(s.labelSettings.leftLabel.image)||(r.labelSettings.leftLabel.image=s.labelSettings.leftLabel.image);if(!ne.isNullOrUndefined(s.labelSettings.rightLabel.image)&&Array.isArray(s.labelSettings.rightLabel.image[0].base64)&&0<s.labelSettings.rightLabel.image[0].base64.length){u=s.labelSettings.rightLabel.image[0].base64.length;r.labelSettings.rightLabel.image=[];for(l=0;l<u;l++)r.labelSettings.rightLabel.image.push({base64:p[0].base64[l],width:p[0].width,height:p[0].height})}else ne.isNullOrUndefined(s.labelSettings.rightLabel.image)||(r.labelSettings.rightLabel.image=s.labelSettings.rightLabel.image);t=function(e,t){var i,a,n;e.progressFontColor=t.taskbar.progressFontColor,e.taskColor=new re.PdfColor(t.taskbar.taskColor),e.taskBorderColor=t.taskbar.taskBorderColor,e.progressColor=t.taskbar.progressColor,e.milestoneColor=t.taskbar.milestoneColor,ne.isNullOrUndefined(t.taskbarTemplate.image)||ne.isNullOrUndefined(t.taskbarTemplate.image[0].base64)||(i=t.taskbarTemplate.image[0].width,n=r.isMilestone&&t.taskbarTemplate.image[0].height<.7*c.parent.chartRowsModule.taskBarHeight?t.taskbarTemplate.image[0].height:.7*c.parent.chartRowsModule.taskBarHeight-2,a=!ne.isNullOrUndefined(t.taskbarTemplate.image[0].height)&&t.taskbarTemplate.image[0].height<r.height?t.taskbarTemplate.image[0].height:r.height-2,n=r.isMilestone?n:a,e.taskbarTemplate.image=t.taskbarTemplate.image,e.taskbarTemplate.image[0].width=i,e.taskbarTemplate.image[0].height=n),ne.isNullOrUndefined(t.taskbarTemplate.value)||(e.taskbarTemplate.value=t.taskbarTemplate.value,e.taskbarTemplate.value=t.taskbarTemplate.value,e.taskbarTemplate.fontStyle.fontColor=t.taskbarTemplate.fontStyle.fontColor,e.taskbarTemplate.fontStyle.fontSize=t.taskbarTemplate.fontStyle.fontSize,e.taskbarTemplate.fontStyle.fontFamily=t.taskbarTemplate.fontStyle.fontFamily,e.taskbarTemplate.fontStyle.fontStyle=t.taskbarTemplate.fontStyle.fontStyle,e.taskbarTemplate.fontStyle.fontBrush=t.taskbarTemplate.fontStyle.fontBrush)};(!s.data.hasChildRecords&&0!==s.data.ganttProperties.duration||s.data.hasChildRecords&&0!==s.data.ganttProperties.duration||0===s.data.ganttProperties.duration)&&t(r,s)}})},I.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new re.PdfStringFormat),e){case"Right":t.alignment=re.PdfTextAlignment.Right;break;case"Center":t.alignment=re.PdfTextAlignment.Center;break;case"Justify":t.alignment=re.PdfTextAlignment.Justify;break;case"Left":t.alignment=re.PdfTextAlignment.Left}return t},I.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new re.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=re.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=re.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=re.PdfVerticalAlignment.Top}return t},I.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},I.prototype.getFontStyle=function(e){switch(e){case"Strikeout":return 8;case"Underline":return 4;case"Italic":return 2;case"Bold":return 1;default:return 0}},I.prototype.getFont=function(e){var t,i;return e.font||(i=this.exportProps.ganttStyle&&this.exportProps.ganttStyle.fontFamily?this.exportProps.ganttStyle.fontFamily:re.PdfFontFamily.TimesRoman,t=ne.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,i=ne.isNullOrUndefined(e.style.fontFamily)?i:this.getFontFamily(e.style.fontFamily),e=re.PdfFontStyle.Regular,new re.PdfStandardFont(i,t,e))},I.prototype.renderEmptyGantt=function(){var e=this.gantt.rows.addRow(),t=(0===e.cells.count&&e.cells.add(),e.cells.getCell(0).isHeaderCell=!1,e.height=se(this.parent.rowHeight),this.copyStyles(this.ganttStyle.columnHeader,e.cells.getCell(0),e.isParentRow),e.cells.count);e.cells.getCell(0).value=this.parent.localeObj.getConstant("emptyRecord"),this.mergeCells(1,0,t)},I.prototype.mergeCells=function(e,t,i){this.gantt.rows.getRow(e).cells.getCell(t).columnSpan=i},I.prototype.copyStyles=function(e,t,i){t.style.fontColor=new re.PdfColor(e.fontColor),t.style.backgroundColor=new re.PdfColor(e.backgroundColor),t.style.borderColor=new re.PdfColor(e.borderColor),t.style.fontSize=e.fontSize,t.style.fontStyle=e.fontStyle,t.style.format=Object.assign(new re.PdfStringFormat,e.format),t.style.borders=new wn,t.style.borders.all=new re.PdfPen(t.style.borderColor),t.style.padding=new Sn;var a=0;t.isHeaderCell?(a=this.parent.timelineModule.isSingleTier?22.5:30,t.style.padding.top=this.resolveCondition(0<a-e.fontSize,a-e.fontSize,a)):(a=this.parent.rowHeight/2,t.style.padding.top=a),t.style.padding.bottom=0<a-e.fontSize?a-e.fontSize:0,t.style.padding.left=10,t.style.padding.right=10,e.padding&&(t.style.padding=e.padding),e.borders&&(t.style.borders=e.borders)},I.prototype.initializePdf=function(e){this.pdfDoc=e;var t=[],i=this.pdfDoc.pageSettings.width-82;if(this.exportProps&&this.exportProps.fitToWidthSettings&&this.exportProps.fitToWidthSettings.isFitToWidth){var a=void 0;a=this.exportProps.fitToWidthSettings.gridWidth?parseInt(this.exportProps.fitToWidthSettings.gridWidth.split("%")[0],10):this.exportProps.fitToWidthSettings.chartWidth?100-parseInt(this.exportProps.fitToWidthSettings.chartWidth.split("%")[0],10):30;for(var n=this.parent.pdfExportModule.pdfPageDimensions.width*a/100/this.gantt.columns.columns.length,r=0;r<this.gantt.columns.columns.length;r++)this.gantt.columns.getColumn(r).width=n}var s,o,l,d,h,a=this.parent.pdfExportModule.pdfPage,p=(this.totalColumnWidth>this.pdfDoc.pageSettings.width-82&&this.totalColumnWidth<a.getClientSize().width?this.gantt.style.allowHorizontalOverflow=!0:i/this.columns.length<t[0]&&(this.gantt.columns.getColumn(0).width=t[0]),(this.exportProps.enableFooter||ne.isNullOrUndefined(this.exportProps.enableFooter))&&(i=this.parent.pdfExportModule.getPageSize(this.exportProps.pageSize),h=new re.RectangleF(0,0,i.width,35),t=new re.PdfPen(this.ganttStyle.footer.borderColor),o=new re.PdfPageTemplateElement(h),p=new re.PdfSolidBrush(this.ganttStyle.footer.backgroundColor),o.graphics.drawRectangle(t,p,0,0,i.width,35),t=new re.PdfStandardFont(this.ganttStyle.fontFamily,this.ganttStyle.footer.fontSize,this.ganttStyle.footer.fontStyle),this.ganttStyle.font&&(t=this.ganttStyle.font),p=new re.PdfSolidBrush(this.ganttStyle.footer.fontColor),i=new re.PdfPageNumberField(t),s=new re.PdfPageCountField(t,p),(t=new re.PdfCompositeField(t,p,"Page {0}",i,s)).stringFormat=this.ganttStyle.footer.format,t.bounds=h,t.draw(o.graphics,new re.PointF(0,0)),e.template.bottom=o),a.size),i=this.resolveCondition(!ne.isNullOrUndefined(p),p,this.pdfDoc.pageSettings.size);ne.isNullOrUndefined(this.exportProps.header)||(s=this.exportProps.header,l=new re.PointF(0,s.fromTop),d=new re.SizeF(1.1*i.width,this.evaluateConditions(s,s.height,.75*s.height,50)),h=new re.RectangleF(l,d),e.template.top=this.drawPageTemplate(new re.PdfPageTemplateElement(h),s)),this.exportProps.enableFooter||ne.isNullOrUndefined(this.exportProps.footer)||(o=this.exportProps.footer,l=new re.PointF(0,i.width-80-this.evaluateConditions(o,o.fromBottom,.75*o.fromBottom,0)),d=new re.SizeF(1.1*i.width,this.evaluateConditions(o,o.height,.75*o.height,50)),h=new re.RectangleF(l,d),this.pdfDoc.template.bottom=this.drawPageTemplate(new re.PdfPageTemplateElement(h),o))},I.prototype.drawPageTemplate=function(e,t){for(var i=0,a=t.contents;i<a.length;i++){var n=a[i];switch(n.type){case"Text":if(""===n.value||void 0===n.value||null===n.value||"string"!=typeof n.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,n);break;case"PageNumber":this.drawPageNumber(e,n);break;case"Image":if(void 0===n.src||null===n.src||""===n.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,n);break;case"Line":this.drawLine(e,n);break;default:throw new Error("Please set valid content type...")}}return e},I.prototype.drawText=function(e,t){var i=this.getFont(t),a=(this.ganttStyle.font&&(i=this.ganttStyle.font),this.getBrushFromContent(t)),n=null,r=(ne.isNullOrUndefined(t.style.textPenColor)||(r=this.hexToRgb(t.style.textPenColor),n=new re.PdfPen(new re.PdfColor(r.r,r.g,r.b))),null===a&&null===n&&(a=new re.PdfSolidBrush(new re.PdfColor(0,0,0))),t.value.toString()),s=.75*t.position.x,o=.75*t.position.y,l=new re.PdfStringFormat,t=(ne.isNullOrUndefined(t.style.stringFormat)||(l.alignment=t.style.stringFormat.alignment),this.setContentFormat(t,l));null===t||ne.isNullOrUndefined(t.format)||ne.isNullOrUndefined(t.size)?e.graphics.drawString(r,i,n,a,s,o,l):e.graphics.drawString(r,i,n,a,s,o,t.size.width,t.size.height,t.format)},I.prototype.drawPageNumber=function(e,t){var i,a,n,r=this.getFont(t),s=null,o=(s=ne.isNullOrUndefined(t.style.textBrushColor)?new re.PdfSolidBrush(new re.PdfColor(0,0,0)):(o=this.hexToRgb(t.style.textBrushColor),new re.PdfSolidBrush(new re.PdfColor(o.r,o.g,o.b))),new re.PdfPageNumberField(r,s)),o=(o.numberStyle=this.getPageNumberStyle(t.pageNumberType),n=ne.isNullOrUndefined(t.format)?new re.PdfCompositeField(r,s,a="{0}",o):(n="$current",-1!==t.format.indexOf(l="$total")&&-1!==t.format.indexOf(n)?((i=new re.PdfPageCountField(r)).numberStyle=this.getPageNumberStyle(t.pageNumberType),a=t.format.indexOf(l)>t.format.indexOf(n)?(a=t.format.replace(n,"0")).replace(l,"1"):(a=t.format.replace(n,"1")).replace(l,"0"),new re.PdfCompositeField(r,s,a,o,i)):-1!==t.format.indexOf(n)&&-1===t.format.indexOf(l)?(a=t.format.replace(n,"0"),new re.PdfCompositeField(r,s,a,o)):(i=new re.PdfPageCountField(r),a=t.format.replace(l,"0"),new re.PdfCompositeField(r,s,a,i))),.75*t.position.x),l=.75*t.position.y,r=this.setContentFormat(t,n.stringFormat);null===r||ne.isNullOrUndefined(r.format)||ne.isNullOrUndefined(r.size)||(n.stringFormat=r.format,n.bounds=new re.RectangleF(o,l,r.size.width,r.size.height)),n.draw(e.graphics,o,l)},I.prototype.drawImage=function(e,t){var i=.75*t.position.x,a=.75*t.position.y,n=ne.isNullOrUndefined(t.size)||ne.isNullOrUndefined(t.size.width)?void 0:.5*t.size.width,r=ne.isNullOrUndefined(t.size)||ne.isNullOrUndefined(t.size.height)?void 0:.75*t.size.height,t=new re.PdfBitmap(t.src);ne.isNullOrUndefined(n)?e.graphics.drawImage(t,i,a):e.graphics.drawImage(t,i,a,n,r)},I.prototype.drawLine=function(e,t){var i=.75*t.points.x1,a=.75*t.points.y1,n=.75*t.points.x2,r=.75*t.points.y2,s=this.getPenFromContent(t);ne.isNullOrUndefined(t.style)||(ne.isNullOrUndefined(t.style.penSize)||"number"!=typeof t.style.penSize||(s.width=.75*t.style.penSize),s.dashStyle=this.getDashStyle(t.style.dashStyle)),e.graphics.drawLine(s,i,a,n,r)},I.prototype.getPenFromContent=function(e){var t=new re.PdfPen(new re.PdfColor(0,0,0));return ne.isNullOrUndefined(e.style)||null===e.style||ne.isNullOrUndefined(e.style.penColor)||(e=this.hexToRgb(e.style.penColor),t=new re.PdfPen(new re.PdfColor(e.r,e.g,e.b))),t},I.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},I.prototype.getBrushFromContent=function(e){var t=null;return ne.isNullOrUndefined(e.style.textBrushColor)||(e=this.hexToRgb(e.style.textBrushColor),t=new re.PdfSolidBrush(new re.PdfColor(e.r,e.g,e.b))),t},I.prototype.hexToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color...");e=e.substring(1);e=parseInt(e,16);return{r:e>>16&255,g:e>>8&255,b:255&e}},I.prototype.setContentFormat=function(e,t){var i=e.size?.75*e.size.width:this.pdfDoc.pageSettings.size.width,a=e.size?.75*e.size.height:ne.isNullOrUndefined(this.exportProps.footer)?0:.5*this.exportProps.footer.height;if(t=new re.PdfStringFormat(re.PdfTextAlignment.Left,re.PdfVerticalAlignment.Middle),!ne.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":t.alignment=re.PdfTextAlignment.Right;break;case"Center":t.alignment=re.PdfTextAlignment.Center;break;case"Justify":t.alignment=re.PdfTextAlignment.Justify;break;default:t.alignment=re.PdfTextAlignment.Left}return{format:t=ne.isNullOrUndefined(e.style.vAlign)?t:this.getVerticalAlignment(e.style.vAlign,t),size:new re.SizeF(i,a)}},I.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}};var ar=I;function I(e){this.totalColumnWidth=0,this.beforeSinglePageExport={},this.baselineHeight=8,this.parent=e}rr.prototype.returnFormattedValue=function(e,t){return!ne.isNullOrUndefined(e.value)&&e.value?this.valueFormatter.getFormatFunction(t)(e.value):""},rr.prototype.formatCellValue=function(e,t){var i;return e.isForeignKey&&(e.value=ne.getValue(e.column.foreignKeyValue,T.getForeignData(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format?e.value?this.internationalization.getNumberFormat({format:e.column.format})(e.value):"":"boolean"===e.column.type?t.taskFields.manual===e.column.field&&"Custom"===t.taskMode?"true"===e.value?"Manual":"Auto":"true"===e.value?"true":"false":"date"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format||""===e.value?(ne.isNullOrUndefined(e.column.type)||ne.isNullOrUndefined(e.value))&&ne.isNullOrUndefined(e.value)?"":(e.column.field===t.taskFields.constraintType&&(i=k.ConstraintType[e.value],t=t.treeGridModule.getLocalizedConstraintTypeText(i),e.value=t),e.value.toString()):("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format?(i=void 0,i="date"===e.column.type?{type:"date",format:e.column.format}:"time"===e.column.type?{type:"time",format:e.column.format}:{type:"dateTime",format:e.column.format},this.returnFormattedValue(e,i)):e.column.format instanceof Object&&void 0===e.column.format.type?e.value.toString():(t=void 0,t="date"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,t)))};var nr=rr;function rr(e){this.valueFormatter=new T.ValueFormatter(e),this.internationalization=new ne.Internationalization(e)}or.prototype.add=function(){return new or(this.parent)},or.prototype.GetNextPage=function(e){var t=e.section,e=t.indexOf(e);return e===t.count-1?t.add():t.getPages()[e+1]},or.prototype.isAutoFit=function(){return!!(this.parent.pdfExportModule&&this.parent.pdfExportModule.helper.exportProps&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings&&this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth||this.parent.timelineModule.isZoomedToFit)},or.prototype.safeDrawString=function(e,t,i,a,n,r,s,o,l,d){ne.isNullOrUndefined(e.taskbarTemplate.value)||t.drawString(e.taskbarTemplate.value,i,a,n,r,s,o,l,d)},or.prototype.drawTaskbar=function(s,h,p,u,L,c,V,B){var g,f,e,t,m,y,A,W,j,i,H,a,G,z,q,_,D,k,T,Z,X,b,Y,n,K,Q,$,J,r,o,l,d,ee,w,v,S,P,C=this,R=s.graphics,te=!1,M=s.getClientSize(),ie=(h.y+L>M.height&&((s=this.GetNextPage(s)).contentWidth=this.isAutoFit()?oe(p.endPoint-p.startPoint):p.endPoint-p.startPoint,R=s.graphics,h.y=0,this.parent.pdfExportModule.gantt.currentPage=this.parent.pdfExportModule.gantt.currentPage+1,this.parent.pdfExportModule.gantt.eventMarker.renderHeight=this.parent.pdfExportModule.gantt.layouter.pageHeightCollection[this.parent.pdfExportModule.gantt.currentPage].totalHeight,this.parent.pdfExportModule.gantt.enableHeader&&(this.parent.pdfExportModule.gantt.chartHeader.drawPageTimeline(s,h,p,this.parent.pdfExportModule.gantt.currentPage),h.y=se(this.parent.timelineModule.isSingleTier?45:60)),te=!0),this.drawLeftLabel(s,h,p,u,c),new re.PdfStandardFont(this.fontFamily,this.defaultFontSize,re.PdfFontStyle.Regular)),M=null,x=new re.PdfSolidBrush(this.progressFontColor),O=ie,I=(!ne.isNullOrUndefined(c.taskbarTemplate.value)&&c.taskbarTemplate.fontStyle&&c.taskbarTemplate.fontStyle.fontFamily&&c.taskbarTemplate.fontStyle.fontSize&&(O=new re.PdfStandardFont(c.taskbarTemplate.fontStyle.fontFamily,c.taskbarTemplate.fontStyle.fontSize,c.taskbarTemplate.fontStyle.fontStyle)),g=!ne.isNullOrUndefined(c.taskbarTemplate.value)&&c.taskbarTemplate.fontStyle&&c.taskbarTemplate.fontStyle.fontColor?new re.PdfSolidBrush(c.taskbarTemplate.fontStyle.fontColor):x,f=!ne.isNullOrUndefined(c.taskbarTemplate.value)&&c.taskbarTemplate.fontStyle&&c.taskbarTemplate.fontStyle.fontBrush?new re.PdfPen(c.taskbarTemplate.fontStyle.fontBrush):M,!ne.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(ie=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),this.parent.pdfExportModule.helper.exportProps.ganttStyle),E=this.labelSettings.taskLabel,F=(E.fontStyle.fontSize||E.fontStyle.fontFamily||E.fontStyle.fontStyle?(t=E.fontStyle&&E.fontStyle.fontFamily?E.fontStyle.fontFamily:this.fontFamily||re.PdfFontFamily.Helvetica,U=E.fontStyle&&E.fontStyle.fontSize?E.fontStyle.fontSize:this.defaultFontSize,E=E.fontStyle&&"string"==typeof E.fontStyle.fontStyle?this.parent.pdfExportModule.helper.getFontStyle(E.fontStyle.fontStyle):E.fontStyle&&E.fontStyle.fontStyle?E.fontStyle.fontStyle:re.PdfFontStyle.Regular,t=new re.PdfStandardFont(t,U,E)):I&&I.label&&I.label.fontBrush?e=new re.PdfSolidBrush(I.label.fontBrush):t=ie,e=c.labelSettings.taskLabel.fontStyle.fontColor?new re.PdfSolidBrush(c.labelSettings.taskLabel.fontStyle.fontColor):I&&I.label&&I.label.fontColor?new re.PdfSolidBrush(I.label.fontColor):x,ne.isNullOrUndefined(I)||ne.isNullOrUndefined(I.label)||ne.isNullOrUndefined(I.label.fontBrush)||(M=new re.PdfPen(I.label.fontBrush)),ne.isNullOrUndefined(I)||ne.isNullOrUndefined(I.label)||ne.isNullOrUndefined(I.label.fontSize)&&ne.isNullOrUndefined(I.label.fontStyle)&&ne.isNullOrUndefined(I.label.fontFamily)||(t=this.getPdfFont(I)),new re.PdfStringFormat),U=(F.lineAlignment=re.PdfVerticalAlignment.Middle,F.alignment=re.PdfTextAlignment.Right,!1),E=(ne.isNullOrUndefined(this.taskLabel)||!/^[a-zA-Z0-9]/.test(this.taskLabel)||"0"!==this.taskLabel&&"0%"!==this.taskLabel||(n=this.width,F.alignment=re.PdfTextAlignment.Left),(ne.isNullOrUndefined(this.taskLabel)||!/^[a-zA-Z]/.test(this.taskLabel))&&ne.isNullOrUndefined(c.taskbarTemplate.value)||(U=!0,F.alignment=re.PdfTextAlignment.Left),ne.isNullOrUndefined(I)||ne.isNullOrUndefined(I.label)||ne.isNullOrUndefined(I.label.format)||(F=I.label.format),{left:0,right:0,top:0,bottom:0}),x=(ne.isNullOrUndefined(I)||ne.isNullOrUndefined(I.label)||ne.isNullOrUndefined(I.label.padding)||(E=I.label.padding),-1),I=new re.PdfPen(c.baselineBorderColor),ae=new re.PdfSolidBrush(c.baselineColor),N=c.taskbarTemplate;return c.isMilestone?(this.drawMilestone(s,h,p,u,c,!1),this.parent.renderBaseline&&c.baselineStartDate&&c.baselineEndDate&&this.drawMilestone(s,h,p,u,c,!0)):(m=new re.PdfPen(c.taskBorderColor),y=new re.PdfSolidBrush(c.taskColor),A=new re.PdfPen(c.manualParentBorder),W=new re.PdfPen(c.manualChildBorder),j=new re.PdfPen(c.manuallineColor),new re.PdfPen(c.manualParentProgress),i=new re.PdfPen(c.manuallineColor),H=new re.PdfSolidBrush(c.manuallineColor),a=new re.PdfPen(c.splitLineBackground),G=new re.PdfSolidBrush(c.manualParentBackground),z=new re.PdfSolidBrush(c.manualChildBackground),q=new re.PdfSolidBrush(c.manualChildProgress),_=new re.PdfSolidBrush(c.manualParentProgress),D=new re.PdfPen(c.progressColor),k=new re.PdfSolidBrush(c.progressColor),X=se((this.parent.rowHeight-this.height)/2),Z=se((this.parent.rowHeight-this.height)/4.5),T=this.parent.renderBaseline?Z:X,x=s.section.indexOf(s),Z=ne.isNullOrUndefined(this.unscheduleStarteDate)?this.startDate:this.unscheduleStarteDate,X=ne.isNullOrUndefined(this.unscheduleEndDate)?this.endDate:this.unscheduleEndDate,p.startDate<=Z&&X<=p.endDate?(this.isStartPoint||(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),this.isScheduledTask||"duration"!==this.unscheduledTaskBy?(this.isScheduledTask||"endDate"!==this.unscheduledTaskBy)&&(this.isScheduledTask||"duration"===this.unscheduledTaskBy)?(c.isSpliterTask?(a.dashStyle=re.PdfDashStyle.Dot,this.isAutoFit()?R.drawLine(a,new re.PointF(h.x+(this.left-u)+.5,h.y+T+se(c.height/2)),new re.PointF(c.width+h.x+(this.left-u)+.5,h.y+T+se(c.height/2))):R.drawLine(a,new re.PointF(h.x+se(this.left-u)+.5,h.y+T+se(c.height/2)),new re.PointF(se(c.width)+h.x+se(this.left-u)+.5,h.y+T+se(c.height/2))),c.segmentCollection.map(function(e,t){var i,a,n=ne.isNullOrUndefined(C.taskSegmentStyles)?m:new re.PdfPen(C.taskSegmentStyles[t].taskBorderColor),t=ne.isNullOrUndefined(C.taskSegmentStyles)?y:new re.PdfSolidBrush(C.taskSegmentStyles[t].taskColor);C.isAutoFit()?(R.drawRectangle(n,t,h.x+(C.left+e.left-u)+.5,h.y+T,e.width,se(c.height)),(N.image||N.value)&&(i=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?i=0:(i=c.taskbarTemplate.image[0].width,a=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(a,h.x+(C.left+e.left-u)+.5,h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),C.safeDrawString(c,R,O,f,g,h.x+(C.left+e.left-u)+.5+i,h.y+T,se(e.width),se(c.height),F))):(R.drawRectangle(n,t,h.x+se(C.left+e.left-u)+.5,h.y+T,se(e.width),se(c.height)),(N.image||N.value)&&(i=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?i=0:(i=c.taskbarTemplate.image[0].width,a=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(a,h.x+se(C.left+e.left-u)+.5,h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),C.safeDrawString(c,R,O,f,g,h.x+se(C.left+e.left-u)+.5+i,h.y+T,se(e.width),se(c.height),F)))})):!c.isAutoSchedule&&c.isParentTask?(R.save(),(Q=new re.PdfPath).addEllipse(0,0,5,5),this.isAutoFit()?R.translateTransform(h.x+(this.left-u)+.5,h.y+T-2):R.translateTransform(h.x+se(this.left-u)+.5,h.y+T-2),R.drawPath(j,H,Q),R.restore(),(K=new re.PdfPath).addEllipse(0,0,5,5),R.save(),this.isAutoFit()?R.translateTransform(h.x+(this.left-u)+.5+this.width,h.y+T-2):R.translateTransform(h.x+se(this.left-u)+.5+se(this.width),h.y+T-2),R.drawPath(j,H,K),R.restore(),i.dashStyle=re.PdfDashStyle.Solid,this.isAutoFit()?R.drawLine(i,new re.PointF(h.x+(this.left-u)+.5,h.y+T),new re.PointF(c.width+h.x+(this.left-u)+.5,h.y+T)):R.drawLine(i,new re.PointF(h.x+se(this.left-u)+.5,h.y+T),new re.PointF(se(c.width)+h.x+se(this.left-u)+.5,h.y+T))):c.isAutoSchedule||c.isParentTask?this.isAutoFit()?ne.isNullOrUndefined(N.value)&&ne.isNullOrUndefined(N.image)?R.drawRectangle(m,y,h.x+(this.left-u)+.5,h.y+T,c.width,se(c.height)):(R.drawRectangle(m,y,h.x+(this.left-u)+.5,h.y+T,c.width,se(c.height)),l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width/2,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+(this.left-u)+.5,h.y+T+(c.height-c.taskbarTemplate.image[0].height)/2,c.taskbarTemplate.image[0].width/2,c.taskbarTemplate.image[0].height/2)),c.taskbarTemplate.value&&(U&&(n=this.width),R.drawString(c.taskbarTemplate.value,O,f,g,h.x+(this.left-u)+l,h.y+T,n,se(this.height),F))):ne.isNullOrUndefined(N.value)&&ne.isNullOrUndefined(N.image)?R.drawRectangle(m,y,h.x+se(this.left-u)+.5,h.y+T,se(c.width),se(c.height)):(R.drawRectangle(m,y,h.x+se(this.left-u)+.5,h.y+T,se(c.width),se(c.height)),l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+se(this.left-u)+1,h.y+T+1+se((c.height-c.taskbarTemplate.image[0].height)/2),se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),this.safeDrawString(c,R,O,f,g,h.x+se(this.left-u)+l,h.y+T,se(n),se(this.height),F)):(R.save(),R.setTransparency(.87),this.isAutoFit()?R.drawRectangle(W,z,h.x+(this.left-u)+.5,h.y+T,c.width,se(c.height)):R.drawRectangle(W,z,h.x+se(this.left-u)+.5,h.y+T,se(c.width),se(c.height)),R.restore(),this.isAutoFit()?R.drawRectangle(null,q,h.x+(this.left-u)+.5,h.y+T,c.progressWidth,se(this.height)):R.drawRectangle(null,q,h.x+se(this.left-u)+.5,h.y+T,se(c.progressWidth),se(this.height))),this.isScheduledTask&&!c.isSpliterTask?ne.isNullOrUndefined(N.image)&&ne.isNullOrUndefined(N.value)&&(this.isAutoFit()&&c.isAutoSchedule?R.drawRectangle(D,k,h.x+(this.left-u)+.5,h.y+T,c.progressWidth,se(c.height)):c.isAutoSchedule&&R.drawRectangle(D,k,h.x+se(this.left-u)+.5,h.y+T,se(c.progressWidth),se(c.height)),ne.isNullOrUndefined(this.parent.labelSettings.taskLabel)||ne.isNullOrUndefined(this.taskLabel)||("0"!==this.taskLabel&&"0%"!==this.taskLabel&&(n=this.progressWidth),U&&(n=this.width),this.isAutoFit()?R.drawString(this.taskLabel.toString(),t,M,e,h.x+(this.left-u)-(E.left+E.right),h.y+T-(E.top+E.bottom),n,se(this.height),F):R.drawString(this.taskLabel.toString(),t,M,e,h.x+se(this.left-u)-(E.left+E.right),h.y+T-(E.top+E.bottom),se(n),se(this.height),F))):c.isSpliterTask&&c.segment.map(function(e,t){var i=ne.isNullOrUndefined(C.taskSegmentStyles)?D:new re.PdfPen(C.taskSegmentStyles[t].progressColor),t=ne.isNullOrUndefined(C.taskSegmentStyles)?k:new re.PdfSolidBrush(C.taskSegmentStyles[t].progressColor);C.isAutoFit()?R.drawRectangle(i,t,h.x+(C.left+e.left-u)+.5,h.y+T,e.progressWidth,se(c.height)):R.drawRectangle(i,t,h.x+se(C.left+e.left-u)+.5,h.y+T,se(e.progressWidth),se(c.height))})):this.drawUnscheduledTask(R,h,u,T):(o=r=void 0,this.isAutoFit()?(r=new re.PdfLinearGradientBrush(new re.PointF(h.x+(this.left-u)+.5+c.width/2,0),new re.PointF(h.x+(this.left-u),0),new re.PdfColor(c.unscheduledTaskBarColor),new re.PdfColor(255,255,255)),R.drawRectangle(r,h.x+(this.left-u)+.5,h.y+T,c.width,se(c.height)),o=new re.PdfLinearGradientBrush(new re.PointF(h.x+(this.left-u)+.5+c.width,0),new re.PointF(h.x+(this.left-u)+c.width/2,0),new re.PdfColor(255,255,255),new re.PdfColor(c.unscheduledTaskBarColor)),R.drawRectangle(o,h.x+(this.left-u)+.5+c.width/2,h.y+T,c.width/2,se(c.height)),(N.image||N.value)&&(l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+(this.left-u)+.5,h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),this.safeDrawString(c,R,O,f,g,h.x+(this.left-u)+.5+l,h.y+T,se(c.width),se(this.height),F))):(r=new re.PdfLinearGradientBrush(new re.PointF(h.x+se(this.left-u)+.5+se(c.width)/2,0),new re.PointF(h.x+se(this.left-u),0),new re.PdfColor(c.unscheduledTaskBarColor),new re.PdfColor(255,255,255)),R.drawRectangle(r,h.x+se(this.left-u)+.5,h.y+T,se(c.width),se(c.height)),o=new re.PdfLinearGradientBrush(new re.PointF(h.x+se(this.left-u)+.5+se(c.width),0),new re.PointF(h.x+se(this.left-u)+se(c.width)/2,0),new re.PdfColor(255,255,255),new re.PdfColor(c.unscheduledTaskBarColor)),R.drawRectangle(o,h.x+se(this.left-u)+.5+se(c.width)/2,h.y+T,se(c.width)/2,se(c.height)),(N.image||N.value)&&(l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+se(this.left-u)+.5,h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),this.safeDrawString(c,R,O,f,g,h.x+se(this.left-u)+.5+l,h.y+T,se(c.width),se(this.height),F)))),this.isCompleted=!0,this.startPage=x,this.endPage=x):p.startDate<=Z&&p.endDate>=Z&&X>=p.endDate?(this.isStartPoint||(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),ee=this.width,v=b=0,this.width=this.width-(p.totalWidth-(this.left-u)),b=p.totalWidth-(this.left-u),v=p.totalWidth-(this.left-u),ee<b&&(b=ee),this.isScheduledTask||"duration"!==this.unscheduledTaskBy?this.isScheduledTask||"duration"===this.unscheduledTaskBy?!c.isAutoSchedule&&c.isParentTask?(R.save(),(Q=new re.PdfPath).addEllipse(0,0,5,5),this.isAutoFit()?R.translateTransform(h.x+(this.left-u)+.5,h.y+T-2):R.translateTransform(h.x+se(this.left-u)+.5,h.y+T-2),R.drawPath(j,H,Q),R.restore(),i.dashStyle=re.PdfDashStyle.Solid,this.isAutoFit()?R.drawLine(i,new re.PointF(h.x+(this.left-u)+.5,h.y+T),new re.PointF(b+h.x+(this.left-u)+.5,h.y+T)):R.drawLine(i,new re.PointF(h.x+se(this.left-u)+.5,h.y+T),new re.PointF(se(b)+h.x+se(this.left-u)+.5,h.y+T))):c.isAutoSchedule||c.isParentTask?(this.isScheduledTask||"duration"===this.unscheduledTaskBy)&&(this.isScheduledTask||"endDate"!==this.unscheduledTaskBy)?c.isSpliterTask?(Y=0,a.dashStyle=re.PdfDashStyle.Dot,this.isAutoFit()?R.drawLine(a,new re.PointF(h.x+(this.left-u)+.5,h.y+T+se(c.height/2)),new re.PointF(b+(this.left-u)+h.x,h.y+T+se(c.height/2))):R.drawLine(a,new re.PointF(h.x+se(this.left-u)+.5,h.y+T+se(c.height/2)),new re.PointF(se(b)+se(this.left-u)+h.x,h.y+T+se(c.height/2))),c.segmentCollection.map(function(e,t){var i,a,n,r,s,o,l,d;e.startDate<p.endDate&&e.endDate>p.startDate&&(i=ne.isNullOrUndefined(C.taskSegmentStyles)?m:new re.PdfPen(C.taskSegmentStyles[t].taskBorderColor),a=ne.isNullOrUndefined(C.taskSegmentStyles)?y:new re.PdfSolidBrush(C.taskSegmentStyles[t].taskColor),n=ne.isNullOrUndefined(C.taskSegmentStyles)?D:new re.PdfPen(C.taskSegmentStyles[t].progressColor),r=ne.isNullOrUndefined(C.taskSegmentStyles)?k:new re.PdfSolidBrush(C.taskSegmentStyles[t].progressColor),s=b-e.left,o=s=e.width<s?e.width:s,e.progressWidth<o&&(o=e.progressWidth),C.isAutoFit()?(R.drawRectangle(i,a,h.x+(C.left-u)+.5+e.left,h.y+T,e.width,se(c.height)),R.drawRectangle(n,r,h.x+(C.left+e.left-u)+.5,h.y+T,e.progressWidth,se(c.height)),(N.image||N.value)&&(l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+(C.left-u)+.5+e.left,h.y+T,c.taskbarTemplate.image[0].width,c.taskbarTemplate.image[0].height)),C.safeDrawString(c,R,O,f,g,h.x+(C.left-u)+.5+e.left+l,h.y+T,e.width,c.height,F))):(R.drawRectangle(i,a,h.x+se(C.left-u)+.5+se(e.left),h.y+T,se(s),se(c.height)),R.drawRectangle(n,r,h.x+se(C.left+e.left-u)+.5,h.y+T,se(o),se(c.height)),(N.image||N.value)&&(l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+se(C.left-u)+.5+se(e.left),h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),C.safeDrawString(c,R,O,f,g,h.x+se(C.left-u)+.5+se(e.left)+l,h.y+T,se(e.width),se(c.height),F))),0===C.segmentCollection[parseInt(t.toString(),10)].width?C.segmentCollection[parseInt(t.toString(),10)].progressWidth=0:e.width-C.segmentCollection[parseInt(t.toString(),10)].width<e.progressWidth&&e.width!==C.segmentCollection[t].width&&(C.segmentCollection[parseInt(t.toString(),10)].progressWidth=e.progressWidth-(e.width-C.segmentCollection[t].width)),(Y=e.left+e.width)<=s?(C.segmentCollection[parseInt(t.toString(),10)].width=0,C.segmentCollection[parseInt(t.toString(),10)].left=0):(s>=Y-e.width?(C.segmentCollection[parseInt(t.toString(),10)].left=0,C.segmentCollection[parseInt(t.toString(),10)].width=e.width-s):C.segmentCollection[parseInt(t.toString(),10)].left=e.left-p.totalWidth,Y<=b&&(C.segmentCollection[parseInt(t.toString(),10)].width=0)))}),this.pageDetailedWidth+=b):(this.isAutoFit()?ne.isNullOrUndefined(N.value)&&ne.isNullOrUndefined(N.image)?R.drawRectangle(m,y,h.x+(this.left-u)+.5,h.y+T,b,se(c.height)):(R.drawRectangle(m,y,h.x+(this.left-u)+.5,h.y+T,b,se(c.height)),ne.isNullOrUndefined(c.taskbarTemplate.image)||(d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+(this.left-u)+.5,h.y+T+se((c.height-c.taskbarTemplate.image[0].height)/.5),c.taskbarTemplate.image[0].width/2,c.taskbarTemplate.image[0].height/2)),ne.isNullOrUndefined(c.taskbarTemplate.value)||(l=ne.isNullOrUndefined(c.taskbarTemplate.image)?0:c.taskbarTemplate.image[0].width,R.drawString(c.taskbarTemplate.value,O,f,g,h.x+(this.left-u)+l,h.y+T,se(n),se(this.height),F))):ne.isNullOrUndefined(N.value)&&ne.isNullOrUndefined(N.image)?R.drawRectangle(m,y,h.x+se(this.left-u)+.5,h.y+T,se(b),se(c.height)):(R.drawRectangle(m,y,h.x+se(this.left-u)+.5,h.y+T,se(b),se(c.height)),l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+se(this.left-u)+1,h.y+T+1+se((c.height-c.taskbarTemplate.image[0].height)/2),se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),ne.isNullOrUndefined(c.taskbarTemplate.value)||(this.stringLeft=se(this.left),S=this.getWidth(c.taskbarTemplate.value,p.endPoint-this.stringLeft,15),R.drawString(S.lines[0].text,O,f,g,h.x+se(this.left-u)+l,h.y+T,se(n),se(this.height),F),ne.isNullOrUndefined(S.remainder))||(this.remainString=S.remainder,this.stringLeft=p.endPoint)),c.isAutoSchedule&&!c.isSpliterTask&&(P=0,P=this.progressWidth<=b?this.progressWidth:b,ne.isNullOrUndefined(N.image)&&ne.isNullOrUndefined(N.value)&&(this.isAutoFit()?R.drawRectangle(D,k,h.x+(this.left-u)+.5,h.y+T,P,se(c.height)):R.drawRectangle(D,k,h.x+se(this.left-u)+.5,h.y+T,se(P),se(c.height))),this.progressWidth-=P,this.parent.labelSettings.taskLabel)&&!ne.isNullOrUndefined(this.taskLabel)&&(n=U?b:P,this.stringLeft=this.left,ne.isNullOrUndefined(c.taskbarTemplate.value)?(S=this.getWidth(this.taskLabel.toString(),p.endPoint-this.stringLeft,15),R.drawString(S.lines[0].text,t,M,e,h.x+se(this.left-u),h.y+T,se(n),se(this.height),F),ne.isNullOrUndefined(S.remainder)||(this.remainString=S.remainder,this.stringLeft=p.endPoint)):this.isAutoFit()?R.drawString(this.taskLabel.toString(),t,M,e,h.x+(this.left-u)-(E.left+E.right),h.y+T-(E.top+E.bottom),n,se(this.height),F):R.drawString(this.taskLabel.toString(),t,M,e,h.x+se(this.left-u)-(E.left+E.right),h.y+T-(E.top+E.bottom),se(n),se(this.height),F))):this.drawUnscheduledTask(R,h,u,T):(this.isAutoFit()?R.drawRectangle(W,null,h.x+(this.left-u)+.5,h.y+T,b,se(c.height)):R.drawRectangle(W,null,h.x+se(this.left-u)+.5,h.y+T,se(b),se(c.height)),R.save(),R.setTransparency(.87),this.isAutoFit()?R.drawRectangle(null,z,h.x+(this.left-u)+.5,h.y+T,b,se(c.height)):R.drawRectangle(null,z,h.x+se(this.left-u)+.5,h.y+T,se(b),se(c.height)),R.restore(),this.isAutoFit()?R.drawRectangle(null,q,h.x+(this.left-u)+.5,h.y+T,v,se(c.height)):R.drawRectangle(null,q,h.x+se(this.left-u)+.5,h.y+T,se(v),se(c.height)),c.progressWidth=c.progressWidth-v):this.drawUnscheduledTask(R,h,u,T):(o=r=void 0,this.isAutoFit()?(r=new re.PdfLinearGradientBrush(new re.PointF(h.x+(this.left-u)+.5+b/2,0),new re.PointF(h.x+(this.left-u),0),new re.PdfColor(c.unscheduledTaskBarColor),new re.PdfColor(255,255,255)),R.drawRectangle(r,h.x+(this.left-u)+.5,h.y+T,b,se(c.height)),o=new re.PdfLinearGradientBrush(new re.PointF(h.x+(this.left-u)+.5+b,0),new re.PointF(h.x+(this.left-u)+b/2,0),new re.PdfColor(255,255,255),new re.PdfColor(c.unscheduledTaskBarColor)),R.drawRectangle(o,h.x+(this.left-u)+.5+b/2,h.y+T,b/2,se(c.height)),(N.image||N.value)&&(l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+(this.left-u)+.5,h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),this.safeDrawString(c,R,O,f,g,h.x+(this.left-u)+.5+l,h.y+T,se(c.width),se(this.height),F))):(r=new re.PdfLinearGradientBrush(new re.PointF(h.x+se(this.left-u)+.5+se(b)/2,0),new re.PointF(h.x+se(this.left-u),0),new re.PdfColor(c.unscheduledTaskBarColor),new re.PdfColor(255,255,255)),R.drawRectangle(r,h.x+se(this.left-u)+.5,h.y+T,se(b),se(c.height)),o=new re.PdfLinearGradientBrush(new re.PointF(h.x+se(this.left-u)+.5+se(b),0),new re.PointF(h.x+se(this.left-u)+se(b)/2,0),new re.PdfColor(255,255,255),new re.PdfColor(c.unscheduledTaskBarColor)),R.drawRectangle(o,h.x+se(this.left-u)+.5+se(b)/2,h.y+T,se(b)/2,se(c.height)),(N.image||N.value)&&(l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+se(this.left-u)+.5,h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),ne.isNullOrUndefined(c.taskbarTemplate.value)||R.drawString(c.taskbarTemplate.value,O,f,g,h.x+se(this.left-u)+.5+l,h.y+T,se(c.width),se(this.height),F)))),this.left=0,this.isCompleted=!1,this.startPage=x):X<=p.endDate&&p.startDate<=X&&!this.isCompleted?(this.isStartPoint||(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),this.isScheduledTask||"duration"!==this.unscheduledTaskBy?!c.isAutoSchedule&&c.isParentTask?((K=new re.PdfPath).addEllipse(0,0,5,5),R.save(),Q=h.x+se(this.left+.5),$=se(c.width)+Q-5,J=h.y+T,R.drawLine(i,Q,J,$,J),R.translateTransform($,J-2),R.drawPath(j,H,K),R.restore(),i.dashStyle=re.PdfDashStyle.Solid):c.isAutoSchedule||c.isParentTask?this.isScheduledTask||"endDate"!==this.unscheduledTaskBy?c.isSpliterTask?(a.dashStyle=re.PdfDashStyle.Dot,R.drawLine(a,new re.PointF(h.x+se(this.left)+.5,h.y+T+se(c.height/2)),new re.PointF(se(c.width)+h.x+se(this.left),h.y+T+se(c.height/2))),c.segmentCollection.map(function(e,t){var i,a,n=ne.isNullOrUndefined(C.taskSegmentStyles)?m:new re.PdfPen(C.taskSegmentStyles[t].taskBorderColor),r=ne.isNullOrUndefined(C.taskSegmentStyles)?y:new re.PdfSolidBrush(C.taskSegmentStyles[t].taskColor);0!==e.width&&e.startDate<p.endDate&&e.endDate>p.startDate&&(0!==C.segmentCollection[t].left&&(C.segmentCollection[t].left=C.segmentCollection[t].left-C.pageDetailedWidth),a=p.totalWidth-e.left,i=a=e.width<a?e.width:a,e.progressWidth<i&&(i=e.progressWidth),R.drawRectangle(n,r,h.x+se(c.left+.5+e.left),h.y+T,se(a),se(c.height)),n=ne.isNullOrUndefined(C.taskSegmentStyles)?D:new re.PdfPen(C.taskSegmentStyles[t].progressColor),r=ne.isNullOrUndefined(C.taskSegmentStyles)?k:new re.PdfSolidBrush(C.taskSegmentStyles[t].progressColor),R.drawRectangle(n,r,h.x+se(c.left+.5+e.left),h.y+T,se(i),se(c.height)),N.image||N.value)&&(a=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?a=0:(a=c.taskbarTemplate.image[0].width,t=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(t,h.x+se(c.left+.5+e.left),h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),C.safeDrawString(c,R,O,f,g,h.x+se(c.left+.5+e.left)+a,h.y+T,se(e.width),se(c.height),F))}),this.pageDetailedWidth+=p.totalWidth):R.drawRectangle(m,y,h.x+se(c.left+.5),h.y+T,se(c.width),se(c.height)):this.drawUnscheduledTask(R,h,u,T):(R.drawRectangle(W,null,h.x+se(this.left+.5),h.y+T,se(c.width),se(c.height)),R.save(),R.setTransparency(.87),R.drawRectangle(null,z,h.x+se(this.left+.5),h.y+T,se(c.width),se(c.height)),R.restore(),R.drawRectangle(null,q,h.x+se(this.left+.5),h.y+T,se(c.progressWidth),se(c.height))):(o=r=void 0,r=new re.PdfLinearGradientBrush(new re.PointF(h.x+se(c.left+.5)+se(c.width)/2,0),new re.PointF(h.x+se(c.left+.5),0),new re.PdfColor(c.unscheduledTaskBarColor),new re.PdfColor(255,255,255)),R.drawRectangle(r,h.x+se(c.left+.5),h.y+T,se(c.width),se(c.height)),o=new re.PdfLinearGradientBrush(new re.PointF(h.x+se(c.left+.5)+se(c.width),0),new re.PointF(h.x+se(c.left+.5)+se(c.width)/2,0),new re.PdfColor(255,255,255),new re.PdfColor(c.unscheduledTaskBarColor)),R.drawRectangle(o,h.x+se(c.left+.5)+se(c.width)/2,h.y+T,se(c.width)/2,se(c.height)),(N.image||N.value)&&(l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+se(c.left+.5),h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),this.safeDrawString(c,R,O,f,g,h.x+se(c.left+.5)+l,h.y+T,se(c.width),se(this.height),F))),this.isScheduledTask&&!c.isSpliterTask&&(ne.isNullOrUndefined(N.image)&&ne.isNullOrUndefined(N.value)&&c.isAutoSchedule&&R.drawRectangle(D,k,h.x+se(c.left+.5),h.y+T,se(c.progressWidth),se(c.height)),ne.isNullOrUndefined(this.taskLabel)||(n=this.progressWidth,U&&(n=this.width),U&&ne.isNullOrUndefined(c.taskbarTemplate.value)?ne.isNullOrUndefined(this.remainString)||(S=this.getWidth(this.remainString,p.endPoint-this.stringLeft,15),R.drawString(S.lines[0].text,t,M,e,h.x+se(this.left)-(E.left+E.right),h.y+T-(E.top+E.bottom),se(n),se(this.height),F)):ne.isNullOrUndefined(this.taskLabel)||U||(n=this.progressWidth,U&&(n=this.width),R.drawString(this.taskLabel.toString(),t,M,e,h.x+se(this.left)-(E.left+E.right),h.y+T-(E.top+E.bottom),se(n),se(this.height),F)))),this.isCompleted=!0,this.endPage=x):Z<p.startDate&&X>p.endDate&&(this.isStartPoint||(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),this.isScheduledTask||"duration"!==this.unscheduledTaskBy?this.isScheduledTask||"endDate"!==this.unscheduledTaskBy?c.isAutoSchedule||c.isParentTask?!c.isAutoSchedule&&c.isParentTask?(i.dashStyle=re.PdfDashStyle.Solid,R.drawLine(i,h.x+se(c.left)+.5,h.y+T,se(p.totalWidth),h.y+T)):c.isSpliterTask?(a.dashStyle=re.PdfDashStyle.Dot,this.isAutoFit()?R.drawLine(a,new re.PointF(h.x+this.left+.5,h.y+T+se(c.height/2)),new re.PointF(p.totalWidth+h.x+this.left,h.y+T+se(c.height/2))):R.drawLine(a,new re.PointF(h.x+se(this.left)+.5,h.y+T+se(c.height/2)),new re.PointF(se(p.totalWidth)+h.x+se(this.left),h.y+T+se(c.height/2))),c.segmentCollection.map(function(e,t){var i,a,n=ne.isNullOrUndefined(C.taskSegmentStyles)?m:new re.PdfPen(C.taskSegmentStyles[t].taskBorderColor),r=ne.isNullOrUndefined(C.taskSegmentStyles)?y:new re.PdfSolidBrush(C.taskSegmentStyles[t].taskColor);0!==e.width&&e.startDate<p.endDate&&e.endDate>p.startDate&&(0!==C.segmentCollection[t].left&&(C.segmentCollection[t].left=C.segmentCollection[t].left-C.pageDetailedWidth),i=p.totalWidth-e.left,a=i=e.width<i?e.width:i,e.progressWidth<a&&(a=e.progressWidth),R.drawRectangle(n,r,h.x+se(c.left+.5+e.left),h.y+T,se(i),se(c.height)),n=ne.isNullOrUndefined(C.taskSegmentStyles)?D:new re.PdfPen(C.taskSegmentStyles[t].progressColor),r=ne.isNullOrUndefined(C.taskSegmentStyles)?k:new re.PdfSolidBrush(C.taskSegmentStyles[t].progressColor),R.drawRectangle(n,r,h.x+se(c.left+.5+e.left),h.y+T,se(a),se(c.height)),e.width>i)&&(C.segmentCollection[parseInt(t.toString(),10)].width=e.width-i,C.segmentCollection[parseInt(t.toString(),10)].left=0)}),this.pageDetailedWidth+=p.totalWidth):(R.drawRectangle(m,y,h.x+se(c.left)+.5,h.y+T,se(p.totalWidth),se(c.height)),ne.isNullOrUndefined(c.taskbarTemplate.value)||ne.isNullOrUndefined(this.remainString)||(S=this.getWidth(this.remainString,p.endPoint-this.stringLeft,15),R.drawString(S.lines[0].text,O,f,g,h.x+se(c.left)+.5,h.y+T,se(p.totalWidth),se(this.height),F)),this.isScheduledTask&&!c.isParentTask&&(P=0,P=this.progressWidth<=p.totalWidth?this.progressWidth:p.totalWidth,ne.isNullOrUndefined(N.image)&&ne.isNullOrUndefined(N.value)&&R.drawRectangle(D,k,h.x+se(c.left)+.5,h.y+T,se(P),se(c.height)),this.progressWidth-=P,ne.isNullOrUndefined(this.taskLabel)||(n=P,U&&(n=this.width),R.drawString(this.taskLabel.toString(),t,M,e,h.x+se(this.left)-(E.left+E.right),h.y+T-(E.top+E.bottom),se(n),se(this.height),F)))):(R.drawRectangle(W,null,h.x+se(c.left)+.5,h.y+T,se(p.totalWidth),se(c.height)),R.save(),R.setTransparency(.87),R.drawRectangle(null,z,h.x+se(c.left)+.5,h.y+T,se(p.totalWidth),se(c.height)),R.restore(),P=0,P=this.progressWidth<=p.totalWidth?this.progressWidth:p.totalWidth,ne.isNullOrUndefined(N.image)&&ne.isNullOrUndefined(N.value)&&R.drawRectangle(D,k,h.x+se(c.left)+.5,h.y+T,se(P),se(c.height)),this.progressWidth-=P,R.drawRectangle(null,q,h.x+se(c.left)+.5,h.y+T,se(P),se(c.height))):this.drawUnscheduledTask(R,h,u,T):(o=r=void 0,r=new re.PdfLinearGradientBrush(new re.PointF(h.x+se(c.left)+.5+se(p.totalWidth)/2,0),new re.PointF(h.x+se(c.left),0),new re.PdfColor(c.unscheduledTaskBarColor),new re.PdfColor(255,255,255)),R.drawRectangle(r,h.x+se(c.left)+.5,h.y+T,se(p.totalWidth),se(c.height)),o=new re.PdfLinearGradientBrush(new re.PointF(h.x+se(c.left)+.5+se(p.totalWidth),0),new re.PointF(h.x+se(c.left)+se(p.totalWidth)/2,0),new re.PdfColor(255,255,255),new re.PdfColor(c.unscheduledTaskBarColor)),R.drawRectangle(o,h.x+se(c.left)+.5+se(p.totalWidth)/2,h.y+T,se(p.totalWidth)/2,se(c.height)),(N.image||N.value)&&(l=void 0,ne.isNullOrUndefined(c.taskbarTemplate.image)?l=0:(l=c.taskbarTemplate.image[0].width,d=new re.PdfBitmap(c.taskbarTemplate.image[0].base64),R.drawImage(d,h.x+se(c.left)+.5,h.y+T,se(c.taskbarTemplate.image[0].width),se(c.taskbarTemplate.image[0].height))),ne.isNullOrUndefined(c.taskbarTemplate.value)||R.drawString(c.taskbarTemplate.value,O,f,g,h.x+se(c.left+.5)+l,h.y+T,se(c.width),se(this.height),F))),this.isCompleted=!1,this.width-=p.totalWidth),this.parent.renderBaseline&&c.baselineStartDate&&c.baselineEndDate&&(p.startDate<=c.baselineStartDate&&c.baselineEndDate<=p.endDate?(this.isStartPoint||(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),this.parent.renderBaseline&&c.baselineStartDate&&c.baselineEndDate&&(this.isAutoFit()?R.drawRectangle(I,ae,h.x+(c.baselineLeft-u)+.5,h.y+T+se(c.height+3),c.baselineWidth,se(this.baselineHeight)):R.drawRectangle(I,ae,h.x+se(c.baselineLeft-u)+.5,h.y+T+se(c.height+3),se(c.baselineWidth),se(this.baselineHeight))),this.isCompletedBaseline=!0,this.startPage=x,this.endPage=x):p.startDate<=c.baselineStartDate&&p.endDate>=c.baselineStartDate&&c.baselineEndDate>=p.endDate?(this.isStartPoint||(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),w=0,(ee=this.baselineWidth)<(w=p.totalWidth-(c.baselineLeft-u))&&(w=ee),this.parent.renderBaseline&&c.baselineStartDate&&c.baselineEndDate&&(this.isAutoFit()?R.drawRectangle(I,ae,h.x+(c.baselineLeft-u)+.5,h.y+T+se(c.height+3),w,se(this.baselineHeight)):R.drawRectangle(I,ae,h.x+se(c.baselineLeft-u)+.5,h.y+T+se(c.height+3),se(w),se(this.baselineHeight))),c.baselineWidth=c.baselineWidth-w,this.baselineLeft=0,this.isCompletedBaseline=!1,this.startPage=x):c.baselineEndDate<=p.endDate&&p.startDate<=c.baselineEndDate&&!this.isCompletedBaseline?(this.parent.renderBaseline&&c.baselineStartDate&&c.baselineEndDate&&(this.isAutoFit()?R.drawRectangle(I,ae,h.x+(c.baselineLeft+.5),h.y+T+se(c.height+3),c.baselineWidth,se(this.baselineHeight)):R.drawRectangle(I,ae,h.x+se(c.baselineLeft+.5),h.y+T+se(c.height+3),se(c.baselineWidth),se(this.baselineHeight))),this.isCompletedBaseline=!0,this.endPage=x):c.baselineStartDate<p.startDate&&c.baselineEndDate>p.endDate&&(this.parent.renderBaseline&&c.baselineStartDate&&c.baselineEndDate&&(this.isAutoFit()?R.drawRectangle(I,ae,h.x+c.baselineLeft+.5,h.y+T+se(c.height+3),p.totalWidth,se(c.baselineHeight)):R.drawRectangle(I,ae,h.x+se(c.baselineLeft)+.5,h.y+T+se(c.height+3),se(p.totalWidth),se(c.baselineHeight))),this.isCompletedBaseline=!1,this.baselineWidth-=p.totalWidth)),!this.isAutoSchedule&&c.isParentTask&&(p.startDate<=c.autoStartDate&&c.autoEndDate<=p.endDate?(this.isStartPoint||(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),!c.isAutoSchedule&&c.isParentTask&&(this.isAutoFit()?R.drawRectangle(A,null,h.x+(this.autoLeft-u)+.5,h.y+T+10,this.autoWidth,se(12)):R.drawRectangle(A,null,h.x+se(this.autoLeft-u)+.5,h.y+T+10,se(this.autoWidth),se(12)),R.save(),R.setTransparency(.87),this.isAutoFit()?R.drawRectangle(null,G,h.x+(this.autoLeft-u)+.5,h.y+T+10,this.autoWidth,se(12)):R.drawRectangle(null,G,h.x+se(this.autoLeft-u)+.5,h.y+T+10,se(this.autoWidth),se(12)),R.restore(),this.isAutoFit()?R.drawRectangle(null,_,h.x+(this.autoLeft-u)+.5,h.y+T+10,c.progressWidth,se(12)):R.drawRectangle(null,_,h.x+se(this.autoLeft-u)+.5,h.y+T+10,se(c.progressWidth),se(12))),ne.isNullOrUndefined(this.taskLabel)||(this.isAutoFit()?R.drawString(this.taskLabel.toString(),t,M,e,h.x+(this.autoLeft-u)+.5-(E.left+E.right),h.y+T+8-(E.top+E.bottom),this.autoWidth,se(this.height),F):R.drawString(this.taskLabel.toString(),t,M,e,h.x+se(this.autoLeft-u)+.5-(E.left+E.right),h.y+T+8-(E.top+E.bottom),se(this.autoWidth),se(this.height),F)),this.isCompletedAutotask=!0,this.startPage=x,this.endPage=x):p.startDate<=c.autoStartDate&&p.endDate>=c.autoStartDate&&c.autoEndDate>=p.endDate?(this.isStartPoint||(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),v=w=0,w=p.totalWidth-(this.autoLeft-u),v=p.totalWidth-(this.autoLeft-u),!c.isAutoSchedule&&c.isParentTask&&(this.isAutoFit()?R.drawRectangle(A,null,h.x+(this.autoLeft-u)+.5,h.y+T+10,w,se(12)):R.drawRectangle(A,null,h.x+se(this.autoLeft-u)+.5,h.y+T+10,se(w),se(12)),R.save(),R.setTransparency(.87),this.isAutoFit()?R.drawRectangle(null,G,h.x+(this.autoLeft-u)+.5,h.y+T+10,w,se(12)):R.drawRectangle(null,G,h.x+se(this.autoLeft-u)+.5,h.y+T+10,se(w),se(12)),R.restore(),this.isAutoFit()?R.drawRectangle(null,_,h.x+(this.autoLeft-u)+.5,h.y+T+10,c.progressWidth,se(12)):R.drawRectangle(null,_,h.x+se(this.autoLeft-u)+.5,h.y+T+10,se(v),se(12)),c.autoWidth=c.autoWidth-w,c.progressWidth=c.progressWidth-v),this.parent.labelSettings.taskLabel&&!ne.isNullOrUndefined(this.taskLabel)&&(this.stringLeft=this.autoLeft,ne.isNullOrUndefined(c.taskbarTemplate.value)?(S=this.getWidth(this.taskLabel.toString(),p.endPoint-this.stringLeft,15),R.drawString(S.lines[0].text,t,M,e,h.x+se(this.autoLeft-u)+.5,h.y+T+10,se(c.progressWidth),se(this.height),F),ne.isNullOrUndefined(S.remainder)||(this.remainString=S.remainder,this.stringLeft=p.endPoint)):this.isAutoFit()?R.drawString(this.taskLabel.toString(),t,M,e,h.x+(this.autoLeft-u)+.5-(E.left+E.right),h.y+T+10-(E.top+E.bottom),c.progressWidth,se(this.height),F):R.drawString(this.taskLabel.toString(),t,M,e,h.x+se(this.autoLeft-u)+.5-(E.left+E.right),h.y+T+10-(E.top+E.bottom),se(c.progressWidth),se(this.height),F)),this.autoLeft=0,this.isCompletedAutotask=!1,this.startPage=x):c.autoEndDate<=p.endDate&&p.startDate<=c.autoEndDate&&!this.isCompletedAutotask?(this.isStartPoint?!c.isAutoSchedule&&c.isParentTask&&(R.drawRectangle(A,null,h.x+se(this.autoLeft+.5),h.y+T+10,se(c.autoWidth),se(12)),R.save(),R.setTransparency(.87),R.drawRectangle(G,h.x+se(this.autoLeft+.5),h.y+T+10,se(c.autoWidth),se(12)),R.restore(),R.drawRectangle(null,_,h.x+se(this.autoLeft+.5),h.y+T+10,se(c.progressWidth),se(12))):(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),ne.isNullOrUndefined(this.taskLabel)||(U&&ne.isNullOrUndefined(c.taskbarTemplate.value)?ne.isNullOrUndefined(this.remainString)||(S=this.getWidth(this.remainString,p.endPoint-this.stringLeft,15),R.drawString(S.lines[0].text,t,M,e,h.x+se(this.autoLeft+.5)-(E.left+E.right),h.y+T+10-(E.top+E.bottom),se(c.progressWidth),se(this.height),F)):ne.isNullOrUndefined(this.taskLabel)||U||R.drawString(this.taskLabel.toString(),t,M,e,h.x+se(this.autoLeft+.5)-(E.left+E.right),h.y+T+10-(E.top+E.bottom),se(c.progressWidth),se(this.height),F)),this.isCompletedAutotask=!0,this.endPage=x):c.autoStartDate<p.startDate&&c.autoEndDate>p.endDate&&(this.isStartPoint||(this.taskStartPoint=Object.assign({},h),this.isStartPoint=!0),!c.isAutoSchedule&&c.isParentTask&&(P=0,P=this.progressWidth<=p.totalWidth?this.progressWidth:p.totalWidth,this.isAutoFit()?R.drawRectangle(null,_,h.x+(this.autoLeft+.5),h.y+T+10,P,se(12)):0!==c.progressWidth&&R.drawRectangle(null,_,h.x+se(this.autoLeft+.5),h.y+T+10,se(P),se(12)),this.progressWidth-=P,this.isAutoFit()?R.drawRectangle(A,null,h.x+this.autoLeft+.5,h.y+T+10,p.totalWidth,se(12)):R.drawRectangle(A,null,h.x+se(this.autoLeft)+.5,h.y+T+10,se(p.totalWidth),se(12)),R.save(),R.setTransparency(.87),this.isAutoFit()?R.drawRectangle(null,G,h.x+(this.autoLeft-u)+.5,h.y+T+10,p.totalWidth,se(12)):R.drawRectangle(null,G,h.x+se(this.autoLeft)+.5,h.y+T+10,se(p.totalWidth),se(12)),R.restore()),this.isCompletedAutotask=!1,this.autoWidth-=p.totalWidth)),!ne.isNullOrUndefined(c.indicators)&&0<c.indicators.length&&c.indicators.map(function(e,t){var i,a,n,r=C.parent.dateValidationModule.getDateFromFormat(e.date,!0);p.startDate<=r&&r<=p.endDate&&(r=C.parent.chartRowsModule.getIndicatorleft(e.date),ne.isNullOrUndefined(e.base64)||(i=new re.PdfBitmap(e.base64),(a=new re.PdfStringFormat).wordWrap=re.PdfWordWrapType.None,C.isAutoFit()?(R.drawImage(i,h.x+(r-u)+.5+10-C.parent.perDayWidth/2,h.y+T,10,10),n=R.save(),R.setClip(new re.RectangleF(h.x,h.y,s.contentWidth,L)),R.drawString(e.name,ie,null,re.PdfBrushes.Black,h.x+(r-u)+.5+15+10-C.parent.perDayWidth/2,h.y+T,a)):(R.drawImage(i,h.x+se(r-u)+.5+10,h.y+T,10,10),n=R.save(),R.setClip(new re.RectangleF(h.x,h.y,s.contentWidth,L)),R.drawString(e.name,ie,null,re.PdfBrushes.Black,h.x+se(r-u)+.5+15+10,h.y+T,a)),R.restore(n)))})),this.drawRightLabel(s,h,p,u),te},or.prototype.getPdfFont=function(e){var t,i,a;return e&&e.label&&(e.label.fontSize||e.label.fontStyle||e.label.fontFamily)&&(t=e.label.fontSize||this.defaultFontSize,i=e.label.fontFamily,i=e.label.fontFamily?i:this.fontFamily,a=e.label.fontStyle,e=e.label.fontStyle?this.parent.pdfExportModule.helper.getFontStyle(a):re.PdfFontStyle.Regular,a=new re.PdfStandardFont(i,t,e)),a},or.prototype.drawRightLabel=function(e,t,i,a){var n=e.graphics;if(ne.isNullOrUndefined(this.rightTaskLabel.value))if(ne.isNullOrUndefined(this.labelSettings.rightLabel.image))this.labelSettings.rightLabel.value&&this.drawRightLabelValue(e,t,i,a,this.labelSettings.rightLabel.value);else{this.previousWidthofRightImage=0;for(var r,s=this.previousWidthofRightValue=0;s<this.labelSettings.rightLabel.image.length;s++)this.drawRigthlabelImage(e,t,i,a,this.labelSettings.rightLabel.image[s]),this.labelSettings.rightLabel.value&&(r=this.labelSettings.rightLabel.value.split(","))&&(this.rightTaskLabel.isCompleted=!1,this.drawRightLabelValue(e,t,i,a-this.spaceBetweenImageAndValue,r[s]))}else{var o,l,d,h,p,u,c,g=this.rightTaskLabel.isLeftCalculated||this.isAutoFit()?this.rightTaskLabel.left:se(this.rightTaskLabel.left),f=void 0,f=this.isAutoFit()?g-a+t.x:g-se(a)+t.x,g=this.isAutoFit()?se(g):g;i.startPoint<=g&&g<i.endPoint&&!ne.isNullOrUndefined(this.rightTaskLabel.value)&&!this.rightTaskLabel.isCompleted&&(g=this.getWidth(this.rightTaskLabel.value,i.endPoint-g,15),o=new re.PdfStandardFont(this.fontFamily,this.defaultFontSize),l=void 0,c=this.parent.pdfExportModule.helper.exportProps.ganttStyle,ne.isNullOrUndefined(c)||ne.isNullOrUndefined(c.label)||ne.isNullOrUndefined(c.label.fontSize)&&ne.isNullOrUndefined(c.label.fontStyle)&&ne.isNullOrUndefined(c.label.fontFamily)||(l=this.getPdfFont(c)),ne.isNullOrUndefined(l)||(o=l),l={left:0,right:0,top:0,bottom:0},ne.isNullOrUndefined(c)||ne.isNullOrUndefined(c.label)||ne.isNullOrUndefined(c.label.padding)||(l=c.label.padding),!ne.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(o=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),d=(se(this.parent.rowHeight)-g.actualSize.height)/2,d=new re.PointF(f+l.left,t.y+d+l.top),f=new re.SizeF(e.contentWidth-f-(l.left+l.right),g.actualSize.height-(l.top+l.bottom)),l=new re.RectangleF(d,f),(d=new re.PdfStringFormat).alignment=re.PdfTextAlignment.Left,d.lineAlignment=re.PdfVerticalAlignment.Middle,ne.isNullOrUndefined(c)||ne.isNullOrUndefined(c.label)||ne.isNullOrUndefined(c.label.format)||ne.isNullOrUndefined(c.label.format.alignment)||(d.alignment=c.label.format.alignment),0<g.actualSize.width?(c=this.parent.pdfExportModule.helper.exportProps.ganttStyle,h=new re.PdfSolidBrush(c&&c.label&&c.label.fontBrush?c.label.fontBrush:this.labelColor),p=null,ne.isNullOrUndefined(c)||ne.isNullOrUndefined(c.label)||ne.isNullOrUndefined(c.label.backgroundColor)||(p=new re.PdfSolidBrush(c.label.backgroundColor)),u=null,ne.isNullOrUndefined(c)||ne.isNullOrUndefined(c.label)||ne.isNullOrUndefined(c.label.borderColor)||(u=new re.PdfPen(c.label.borderColor)),c=o.measureString(g.lines[0].text),n.drawRectangle(u,p,l.x-3,l.y,c.width+6,c.height),n.drawString(g.lines[0].text,o,null,h,l.x,l.y,f.width,f.height,d),null!==g.remainder?(this.rightTaskLabel.value=g.remainder,this.rightTaskLabel.left=i.endPoint,this.rightTaskLabel.isLeftCalculated=!0):this.rightTaskLabel.isCompleted=!0):this.rightTaskLabel.left=i.endPoint)}},or.prototype.drawRigthlabelImage=function(e,t,i,a,n){var r,s,e=e.graphics;ne.isNullOrUndefined(this.labelSettings.rightLabel)||ne.isNullOrUndefined(this.labelSettings.rightLabel.image)||(s=void(this.labelSettings.isLeftCalculated?r=this.rightTaskLabel.left:this.isAutoFit()?1<this.labelSettings.rightLabel.image.length?(r=this.rightTaskLabel.left+ +this.previousWidthofRightValue,this.previousWidthofRightImage=n.width):r=this.rightTaskLabel.left:(s=void 0,ne.isNullOrUndefined(this.labelSettings.rightLabel.value)||(s=this.labelSettings.rightLabel.value.split(",")),1<this.labelSettings.rightLabel.image.length&&1<s.length?(r=se(this.rightTaskLabel.left)+this.previousWidthofRightValue,this.previousWidthofRightImage=n.width):1<this.labelSettings.rightLabel.image.length?(r=se(this.rightTaskLabel.left)+this.previousWidthofRightImage,this.previousWidthofRightImage=n.width):r=se(this.rightTaskLabel.left))),s=this.isAutoFit()?r-a+t.x:r-se(a)+t.x,a=this.isAutoFit()?se(r):r,i.startPoint<=a&&a<i.endPoint&&!ne.isNullOrUndefined(this.labelSettings.rightLabel)&&!this.rightTaskLabel.isCompleted&&(r=new re.SizeF(n.width,n.height),a=(se(this.parent.rowHeight)-r.height)/2,s=new re.PointF(s,t.y+a),t=new re.SizeF(r.width,r.height),a=new re.RectangleF(s,t),s=new re.PdfBitmap(n.base64),0<r.width?(e.drawImage(s,a.x,a.y,r.width,r.height),null!==this.labelSettings.rightLabel.value?this.rightTaskLabel.isLeftCalculated=!0:ne.isNullOrUndefined(this.labelSettings.rightLabel.value)&&(this.rightTaskLabel.isCompleted=!0)):this.rightTaskLabel.left=i.endPoint))},or.prototype.drawRightLabelValue=function(e,t,i,a,n){var r,s,o,l,d,h,e=e.graphics;ne.isNullOrUndefined(this.labelSettings.rightLabel.value)||(s=void(this.labelSettings.isLeftCalculated?h=this.rightTaskLabel.left:this.isAutoFit()?this.labelSettings.rightLabel.image?1<this.labelSettings.rightLabel.image.length?(h=this.rightTaskLabel.left+this.previousWidthofRightImage+this.previousWidthofRightValue,ne.isNullOrUndefined(n)||(r=this.getWidthofrightLabel(n,i.endPoint-h,15),this.previousWidthofRightValue+=r.actualSize.width+this.previousWidthofRightImage)):h=this.rightTaskLabel.left+this.labelSettings.rightLabel.image[0].width:h=this.rightTaskLabel.left:this.labelSettings.rightLabel.image?1<this.labelSettings.rightLabel.image.length?(h=se(this.rightTaskLabel.left)+this.previousWidthofRightImage+this.previousWidthofRightValue,ne.isNullOrUndefined(n)||(r=this.getWidthofrightLabel(n,i.endPoint-h,15),this.previousWidthofRightValue+=r.actualSize.width+this.previousWidthofRightImage)):h=se(this.rightTaskLabel.left)+this.labelSettings.rightLabel.image[0].width:h=se(this.rightTaskLabel.left)),s=this.isAutoFit()?h-a+t.x:h-se(a)+t.x,a=this.isAutoFit()?se(h):h,i.startPoint<=a&&a<i.endPoint&&!ne.isNullOrUndefined(n)&&!this.rightTaskLabel.isCompleted&&(r=this.getWidthofrightLabel(n,i.endPoint-a,15),h=new re.PdfStandardFont(this.fontFamily,this.defaultFontSize),!ne.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(h=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),a=(se(this.parent.rowHeight)-r.actualSize.height)/2,s=new re.PointF(s,t.y+a),t=new re.SizeF(r.actualSize.width,r.actualSize.height),a=new re.RectangleF(s,t),(s=new re.PdfStringFormat).alignment=re.PdfTextAlignment.Right,s.lineAlignment=re.PdfVerticalAlignment.Middle,0<r.actualSize.width?(t=new re.PdfSolidBrush(this.labelColor),d=(o=this.labelSettings.rightLabel).fontStyle&&o.fontStyle.fontFamily?o.fontStyle.fontFamily:this.fontFamily||re.PdfFontFamily.Helvetica,h=o.fontStyle&&o.fontStyle.fontSize?o.fontStyle.fontSize:h.fontSize||this.defaultFontSize,l=o.fontStyle&&"string"==typeof o.fontStyle.fontStyle?this.parent.pdfExportModule.helper.getFontStyle(o.fontStyle.fontStyle):o.fontStyle&&o.fontStyle.fontStyle?o.fontStyle.fontStyle:re.PdfFontStyle.Regular,d=new re.PdfStandardFont(d,h,l),h=o.fontStyle.fontColor?new re.PdfSolidBrush(o.fontStyle.fontColor):t,e.drawString(n,d,null,h,a.x,a.y,r.actualSize.width,r.actualSize.height,s),ne.isNullOrUndefined(r.remainder)||null===r.remainder?ne.isNullOrUndefined(o.value)&&(this.rightTaskLabel.isCompleted=!0):(this.rightTaskLabel.value=r.remainder,this.rightTaskLabel.left=i.endPoint,this.rightTaskLabel.isLeftCalculated=!0)):this.rightTaskLabel.left=i.endPoint))},or.prototype.drawLeftLabel=function(e,t,i,a,n){var r=e.graphics;if(ne.isNullOrUndefined(this.leftTaskLabel.value))if(ne.isNullOrUndefined(this.labelSettings.leftLabel)||ne.isNullOrUndefined(this.labelSettings.leftLabel.image))ne.isNullOrUndefined(this.labelSettings.leftLabel)||ne.isNullOrUndefined(this.labelSettings.leftLabel.value)||this.drawLeftLabelValue(e,t,i,a,this.labelSettings.leftLabel.value);else{this.previousWidthofLeftImage=0,this.previousWidthofLeftValue=0;for(var s=this.totalLeftWidth=0;s<this.labelSettings.leftLabel.image.length;s++){var o=void 0,l=void 0,d=(ne.isNullOrUndefined(this.labelSettings.leftLabel.value)||(o=this.labelSettings.leftLabel.value.split(","),l=this.getWidth(o[s],Number.MAX_VALUE,15)),ne.isNullOrUndefined(l)?0:l.actualSize.width);this.totalLeftWidth+=this.labelSettings.leftLabel.image[s].width+d}for(s=0;s<this.labelSettings.leftLabel.image.length;s++)this.drawLeftLabelImage(e,t,i,a,this.labelSettings.leftLabel.image[s]),this.labelSettings.leftLabel.value&&(o=this.labelSettings.leftLabel.value.split(","))&&this.drawLeftLabelValue(e,t,i,a-this.spaceBetweenImageAndValue,o[s])}else{var l,h,p,u,c,g=this.left,g=(this.leftTaskLabel.isLeftCalculated?c=this.leftTaskLabel.left:(l=this.getWidth(this.leftTaskLabel.value,Number.MAX_VALUE,15),f=this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33,c=this.isAutoFit()?g-f-l.actualSize.width:se(g-f)-l.actualSize.width,this.leftTaskLabel.left=c,this.leftTaskLabel.isLeftCalculated=!0),void 0),f=(this.isAutoFit()?(g=c-se(a)+t.x,!n.isAutoSchedule&&n.isParentTask&&(h=n.left-n.autoLeft,g=n.left<n.autoLeft?c-a+t.x:c-a+t.x-h)):(g=c-se(a)+t.x,!n.isAutoSchedule&&n.isParentTask&&(h=se(n.left)-se(n.autoLeft),g=n.left<n.autoLeft?c-se(a)+t.x:c-se(a)+t.x-h)),this.isAutoFit()?se(c):c);i.startPoint<=f&&f<i.endPoint&&!ne.isNullOrUndefined(this.leftTaskLabel.value)&&!this.leftTaskLabel.isCompleted&&(l=this.getWidth(this.leftTaskLabel.value,i.endPoint-f,15),n=new re.PdfStandardFont(this.fontFamily,this.defaultFontSize),h=void 0,c=this.parent.pdfExportModule.helper.exportProps.ganttStyle,ne.isNullOrUndefined(c)||ne.isNullOrUndefined(c.label)||ne.isNullOrUndefined(c.label.fontSize)&&ne.isNullOrUndefined(c.label.fontStyle)&&ne.isNullOrUndefined(c.label.fontFamily)||(h=this.getPdfFont(c)),ne.isNullOrUndefined(h)||(n=h),!ne.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(n=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),f={left:0,right:0,top:0,bottom:0},ne.isNullOrUndefined(c)||ne.isNullOrUndefined(c.label)||ne.isNullOrUndefined(c.label.padding)||(f=c.label.padding),h=(se(this.parent.rowHeight)-l.actualSize.height)/2,g=new re.PointF(g+f.left,t.y+h+f.top),h=new re.SizeF(l.actualSize.width-(f.left+f.right),l.actualSize.height-(f.top+f.bottom)),f=new re.RectangleF(g,h),(g=new re.PdfStringFormat).alignment=re.PdfTextAlignment.Right,g.lineAlignment=re.PdfVerticalAlignment.Middle,0<l.actualSize.width?(h=new re.PdfSolidBrush(c&&c.label&&c.label.fontBrush?c.label.fontBrush:this.labelColor),p=null,ne.isNullOrUndefined(c)||ne.isNullOrUndefined(c.label)||ne.isNullOrUndefined(c.label.backgroundColor)||(p=new re.PdfSolidBrush(c.label.backgroundColor)),u=null,ne.isNullOrUndefined(c)||ne.isNullOrUndefined(c.label)||ne.isNullOrUndefined(c.label.borderColor)||(u=new re.PdfPen(c.label.borderColor)),c=n.measureString(l.lines[0].text),r.drawRectangle(u,p,f.x-3,f.y,c.width+6,c.height),r.drawString(l.lines[0].text,n,null,h,f.x,f.y,l.actualSize.width,l.actualSize.height,g),null!==l.remainder?(this.leftTaskLabel.value=l.remainder,this.leftTaskLabel.left=i.endPoint):this.leftTaskLabel.isCompleted=!0):this.leftTaskLabel.left=i.endPoint)}},or.prototype.drawLeftLabelImage=function(e,t,i,a,n){var r,s,o,l,e=e.graphics,d=this.left;ne.isNullOrUndefined(this.labelSettings.leftLabel)||ne.isNullOrUndefined(this.labelSettings.leftLabel.image)||(l=void(this.leftTaskLabel.isLeftCalculated?o=1<this.labelSettings.leftLabel.image.length?this.leftTaskLabel.left+this.previousWidthofLeftValue:this.leftTaskLabel.left:(r=new re.SizeF(n.width,n.height),s=this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33,l=this.labelSettings.leftLabel.value.split(","),this.isAutoFit()?0<this.labelSettings.leftLabel.image.length&&0<l.length?(o=d-this.totalLeftWidth-r.width,this.previousWidthofLeftImage+=r.width):o=d-s-r.width:0<this.labelSettings.leftLabel.image.length&&0<l.length?(o=se(d)-this.totalLeftWidth-r.width,this.previousWidthofLeftImage+=r.width):o=se(d-s)-r.width,this.leftTaskLabel.left=o,this.leftTaskLabel.isLeftCalculated=!0)),this.isAutoFit(),l=o-se(a)+t.x,i.startPoint<=o&&o<i.endPoint&&!ne.isNullOrUndefined(n)&&!this.leftTaskLabel.isCompleted&&(r=new re.SizeF(n.width,n.height),d=(se(this.parent.rowHeight)-r.height)/2,s=new re.PointF(l,t.y+d),a=new re.SizeF(r.width,r.height),o=new re.RectangleF(s,a),l=new re.PdfBitmap(n.base64),0<r.width?(e.drawImage(l,o.x,o.y,r.width,r.height),this.totalLeftWidth=this.totalLeftWidth-r.width):this.leftTaskLabel.left=i.endPoint))},or.prototype.drawLeftLabelValue=function(e,t,i,a,n){var r,s,o,l,d,h,p,u,c,e=e.graphics;ne.isNullOrUndefined(n)||(h=0,h=this.left,l=void(this.leftTaskLabel.isLeftCalculated?1===(c=this.labelSettings.leftLabel.value.split(",")).length?(s=this.leftTaskLabel.left+(this.previousWidthofLeftImage||0),this.labelSettings.left=s,r=this.getWidthofLeftLabel(n,Number.MAX_VALUE,15),this.previousWidthofLeftValue+=this.previousWidthofLeftImage+r.actualSize.width):1<c.length?(u=0!==this.previousWidthofLeftValue?this.previousWidthofLeftValue+this.previousWidthofLeftImage:this.previousWidthofLeftImage,s=this.leftTaskLabel.left+u,this.labelSettings.left=s,r=this.getWidthofLeftLabel(n,Number.MAX_VALUE,15),this.previousWidthofLeftValue+=this.previousWidthofLeftImage+r.actualSize.width):s=this.leftTaskLabel.left:(r=this.getWidthofLeftLabel(n,Number.MAX_VALUE,15),p=this.isMilestone?Math.floor(this.parent.chartRowsModule.taskBarHeight/2)+33:33,c=this.labelSettings.leftLabel.value.split(","),this.isAutoFit()?(o=(l=!ne.isNullOrUndefined(this.labelSettings.leftLabel.image))?this.labelSettings.leftLabel.image.length:0,1===c.length&&l&&1===o?(s=this.leftTaskLabel.left+this.previousWidthofLeftImage,this.labelSettings.left=s,d=this.getWidthofLeftLabel(n,Number.MAX_VALUE,15),this.previousWidthofLeftValue+=this.previousWidthofLeftImage+d.actualSize.width):1<c.length&&l&&1<o?(u=0!==this.previousWidthofLeftValue?this.previousWidthofLeftValue+this.previousWidthofLeftImage:this.previousWidthofLeftImage,s=this.leftTaskLabel.left+u,this.labelSettings.left=s,d=this.getWidthofLeftLabel(n,Number.MAX_VALUE,15),this.previousWidthofLeftValue+=this.previousWidthofLeftImage+d.actualSize.width):s=h-p-r.actualSize.width):s=se(h-p)-r.actualSize.width,this.leftTaskLabel.left=s,this.leftTaskLabel.isLeftCalculated=!0)),this.isAutoFit(),l=s-se(a)+t.x,o=this.isAutoFit()?se(s):s,i.startPoint<=o&&o<i.endPoint&&!ne.isNullOrUndefined(n)&&!this.leftTaskLabel.isCompleted&&(r=this.getWidthofLeftLabel(n,i.endPoint-o,15),u=new re.PdfStandardFont(this.fontFamily,this.defaultFontSize),!ne.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(u=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),d=(se(this.parent.rowHeight)-r.actualSize.height)/2,h=new re.PointF(l,t.y+d),p=new re.SizeF(r.actualSize.width,r.actualSize.height),a=new re.RectangleF(h,p),(s=new re.PdfStringFormat).alignment=re.PdfTextAlignment.Right,s.lineAlignment=re.PdfVerticalAlignment.Middle,0<r.actualSize.width?(o=new re.PdfSolidBrush(this.labelColor),t=(l=this.labelSettings.leftLabel).fontStyle&&l.fontStyle.fontFamily?l.fontStyle.fontFamily:this.fontFamily||re.PdfFontFamily.Helvetica,d=l.fontStyle&&l.fontStyle.fontSize?l.fontStyle.fontSize:u.fontSize||this.defaultFontSize,h=l.fontStyle&&"string"==typeof l.fontStyle.fontStyle?this.parent.pdfExportModule.helper.getFontStyle(l.fontStyle.fontStyle):l.fontStyle&&l.fontStyle.fontStyle?l.fontStyle.fontStyle:re.PdfFontStyle.Regular,p=new re.PdfStandardFont(t,d,h),u=l.fontStyle.fontColor?new re.PdfSolidBrush(l.fontStyle.fontColor):o,e.drawString(n,p,null,u,a.x,a.y,r.actualSize.width,r.actualSize.height,s),c=l.value.split(","),ne.isNullOrUndefined(r.remainder)||null===r.remainder?ne.isNullOrUndefined(l.image)||1!==l.image.length||1!==c.length||(this.leftTaskLabel.isCompleted=!0):(this.leftTaskLabel.value=r.remainder,this.leftTaskLabel.left=i.endPoint)):this.leftTaskLabel.left=i.endPoint))},or.prototype.getWidth=function(e,t,i){var a=new re.PdfStandardFont(this.fontFamily,this.defaultFontSize),n=this.parent.pdfExportModule.helper.exportProps.ganttStyle,n=(ne.isNullOrUndefined(n)||ne.isNullOrUndefined(n.label)||ne.isNullOrUndefined(n.label.fontSize)&&ne.isNullOrUndefined(n.label.fontStyle)&&ne.isNullOrUndefined(n.label.fontFamily)||(i=(a=this.getPdfFont(n)).height),!ne.isNullOrUndefined(n)&&n.font&&(i=(a=n.font).height),new re.PdfStringLayouter),r=new re.PdfStringFormat;return r.alignment=re.PdfTextAlignment.Left,r.wordWrap=re.PdfWordWrapType.Character,r.lineAlignment=re.PdfVerticalAlignment.Middle,n.layout(e,a,r,new re.SizeF(t,i),!1,new re.SizeF(t,i))},or.prototype.getWidthofLeftLabel=function(e,t,i){var a,n=this.labelSettings.leftLabel,r=(a=n.fontStyle.fontSize||n.fontStyle.fontFamily||n.fontStyle.fontStyle?(a=n.fontStyle&&n.fontStyle.fontFamily?n.fontStyle.fontFamily:this.fontFamily||re.PdfFontFamily.Helvetica,r=n.fontStyle&&n.fontStyle.fontSize?n.fontStyle.fontSize:this.defaultFontSize,n=n.fontStyle&&"string"==typeof n.fontStyle.fontStyle?this.parent.pdfExportModule.helper.getFontStyle(n.fontStyle.fontStyle):n.fontStyle&&n.fontStyle.fontStyle?n.fontStyle.fontStyle:re.PdfFontStyle.Regular,new re.PdfStandardFont(a,r,n)):new re.PdfStandardFont(this.fontFamily,this.defaultFontSize),!ne.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(a=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),new re.PdfStringLayouter),n=new re.PdfStringFormat;return n.alignment=re.PdfTextAlignment.Left,n.wordWrap=re.PdfWordWrapType.Character,n.lineAlignment=re.PdfVerticalAlignment.Middle,r.layout(e,a,n,new re.SizeF(t,i),!1,new re.SizeF(t,i))},or.prototype.getWidthofrightLabel=function(e,t,i){var a,n=this.labelSettings.rightLabel,r=(a=n.fontStyle.fontSize||n.fontStyle.fontFamily||n.fontStyle.fontStyle?(a=n.fontStyle&&n.fontStyle.fontFamily?n.fontStyle.fontFamily:this.fontFamily||re.PdfFontFamily.Helvetica,r=n.fontStyle&&n.fontStyle.fontSize?n.fontStyle.fontSize:this.defaultFontSize,n=n.fontStyle&&"string"==typeof n.fontStyle.fontStyle?this.parent.pdfExportModule.helper.getFontStyle(n.fontStyle.fontStyle):n.fontStyle&&n.fontStyle.fontStyle?n.fontStyle.fontStyle:re.PdfFontStyle.Regular,new re.PdfStandardFont(a,r,n)):new re.PdfStandardFont(this.fontFamily,this.defaultFontSize),!ne.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(a=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),new re.PdfStringLayouter),n=new re.PdfStringFormat;return n.alignment=re.PdfTextAlignment.Left,n.wordWrap=re.PdfWordWrapType.Character,n.lineAlignment=re.PdfVerticalAlignment.Middle,r.layout(e,a,n,new re.SizeF(t,i),!1,new re.SizeF(t,i))},or.prototype.drawUnscheduledTask=function(e,t,i,a){var n=new re.PdfSolidBrush(this.taskColor);this.isAutoFit()?e.drawRectangle(n,t.x+(this.left-i),t.y+a,se(3),se(this.height)):e.drawRectangle(n,t.x+se(this.left-i),t.y+a,se(3),se(this.height))},or.prototype.drawMilestone=function(e,t,i,a,n,r){var s,o,l,d,h,p,u,c;i.startDate<=this.startDate&&this.startDate<=i.endDate&&(i=e.graphics,e=e.section.indexOf(e),this.taskStartPoint=Object.assign({},t),s=new re.PdfPen(this.milestoneColor),o=se((this.parent.rowHeight-this.height)/3),l=se((this.parent.rowHeight-this.height)/2),o=this.parent.renderBaseline?o:l,l=new re.PdfSolidBrush(this.milestoneColor),h=new re.PdfPen(this.baselineBorderColor),p=new re.PdfSolidBrush(this.baselineColor),i.save(),d=Math.floor(.8*this.parent.chartRowsModule.taskBarHeight),r||(this.isAutoFit()?i.translateTransform(t.x+(this.left-a),t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2):i.translateTransform(t.x+se(this.left-a),t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2)),r&&(this.isAutoFit()?i.translateTransform(t.x+(n.baselineLeft-a),t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2):i.translateTransform(t.x+se(n.baselineLeft-a),t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2)),i.rotateTransform(45),this.parent.renderBaseline&&this.baselineStartDate&&this.baselineEndDate&&r&&i.drawRectangle(h,p,2,2,se(d),se(d)),r||i.drawRectangle(s,l,0,0,se(d),se(d)),i.restore(),this.isAutoFit()?ne.isNullOrUndefined(n.taskbarTemplate.image)||(u=new re.PdfBitmap(n.taskbarTemplate.image[0].base64),c=t.x+(this.left-a)-.7*this.parent.chartRowsModule.taskBarHeight/2+(.7*this.parent.chartRowsModule.taskBarHeight-n.taskbarTemplate.image[0].height),h=n.taskbarTemplate.image[0].width/2,p=n.taskbarTemplate.image[0].height/2,i.drawImage(u,c,t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2+(.7*this.parent.chartRowsModule.taskBarHeight-n.taskbarTemplate.image[0].height)/.5,h,p)):ne.isNullOrUndefined(n.taskbarTemplate.image)||(u=new re.PdfBitmap(n.taskbarTemplate.image[0].base64),c=t.x+se(this.left-a)-.7*this.parent.chartRowsModule.taskBarHeight/2+ +se(.7*this.parent.chartRowsModule.taskBarHeight-n.taskbarTemplate.image[0].height),i.drawImage(u,c,t.y+o-.7*this.parent.chartRowsModule.taskBarHeight/2+se((.7*this.parent.chartRowsModule.taskBarHeight-n.taskbarTemplate.image[0].height)/.5),se(n.taskbarTemplate.image[0].width),se(n.taskbarTemplate.image[0].height-2))),this.endPage=this.startPage=e)};var sr=or;function or(e){this.baselineHeight=8,this.segment=[],this.segmentCollection=[],this.leftTaskLabel={},this.rightTaskLabel={},this.startPage=-1,this.endPage=-1,this.pageDetailedWidth=0,this.defaultFontSize=9,this.spaceBetweenImageAndValue=8,this.parent=e}dr.prototype.drawTimeline=function(e,t,i,a){this.detailsTimeline=i,this.pageIndex=a,this.timelineHeight=this.gantt.layouter.headerHeight;for(var n=Math.round(i.totalWidth),r=0,a=(this.topTierPoint.x=t.x,this.topTierPoint.y=t.y,this.prevTopTierIndex=this.topTierIndex,this.prevBottomTierIndex=this.bottomTierIndex,this.parent.timelineModule.timelineStartDate),s=a.getHours(),o=a.getMinutes(),a=a.getSeconds();0<n;){var l,d=this.topTier[this.topTierIndex];this.topTier.length>this.topTierIndex?(h=!1,this.topTier[this.topTierIndex].isFinished||(n>=d.width?(r=d.width,d.isFinished=!0,d.completedWidth=r,h=!0):(r=n,d.isFinished=h=!1,d.width=d.width-n,d.completedWidth=r)),l=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?r:se(r),this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,l,d.value,!0,this.parent.timelineModule.isSingleTier&&"Day"===this.parent.timelineSettings.topTier.unit?d.startDate:null),this.topTierPoint.x+=l,n-=r,h&&this.topTierIndex++):n=0}n=0!==s||0!==o||0!==a?i.totalWidth:Math.round(i.totalWidth),s=this.parent.timelineModule.isSingleTier?0:this.topTierHeight;for(this.bottomTierPoint=new re.PointF(t.x,se(t.y+s));0<n;){var h,p,u=this.bottomTier[this.bottomTierIndex];this.bottomTier.length>this.bottomTierIndex?(h=!0,n<(p=u.width)&&(p=n,h=!1,u.completedWidth=p),this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?p:se(p),u.value,!1,u.startDate),this.bottomTierPoint.x=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?this.bottomTierPoint.x+p:this.bottomTierPoint.x+se(p),n-=p,u.completedWidth=p,this.bottomTierIndex++,0<n&&n<p&&(n=u.width-1)):n=0}this.timelineWidth=this.lastWidth},dr.prototype.drawPageTimeline=function(e,t,i,a){this.pageIndex=a,this.timelineHeight=0,this.topTierPoint=ne.extend({},{},t,!0);for(var n,r=this.prevTopTierIndex;r<=this.topTierIndex;r++)this.topTier.length>r&&0<(n=this.topTier[r]).completedWidth&&(this.triggerQueryTimelinecell(e,this.topTierPoint.x,this.topTierPoint.y,this.topTierHeight,this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?n.completedWidth:se(n.completedWidth),n.value,!0,this.parent.timelineModule.isSingleTier&&"Day"===this.parent.timelineSettings.topTier.unit?n.startDate:null),this.topTierPoint.x+=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?n.completedWidth:se(n.completedWidth));this.bottomTierPoint.x=t.x,this.bottomTierPoint.y=se(t.y+this.topTierHeight);for(var s,r=this.prevBottomTierIndex;r<=this.bottomTierIndex;r++)this.bottomTier.length>r&&0<(s=this.bottomTier[r]).completedWidth&&(this.triggerQueryTimelinecell(e,this.bottomTierPoint.x,this.bottomTierPoint.y,this.bottomTierHeight,this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?s.width:se(s.width),s.value,!1,s.startDate),this.bottomTierPoint.x=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?this.bottomTierPoint.x+s.width:this.bottomTierPoint.x+se(s.width))},dr.prototype.triggerQueryTimelinecell=function(e,n,t,i,r,a,s,o){var l=this,d=new Date(o).getDay(),h=e.graphics,e={},p=this.gantt.ganttStyle,u=(e.borderColor=new re.PdfColor(p.timeline.borderColor),e.fontColor=new re.PdfColor(p.timeline.fontColor),e.fontSize=p.timeline.fontSize,e.fontStyle=p.timeline.fontStyle,e.backgroundColor=new re.PdfColor(p.timeline.backgroundColor),p.timeline.padding&&(e.padding=p.timeline.padding),this.initializePdfStringFormat(p,s)),u=(e.format=u,{timelineCell:e,value:a}),e=(this.parent.pdfQueryTimelineCellInfo&&this.parent.trigger("pdfQueryTimelineCellInfo",u),u.timelineCell),c=new re.PdfSolidBrush(u.timelineCell.backgroundColor),g=this.parent.nonWorkingDayIndex,f=!1,m=new re.PdfSolidBrush(p.holiday.backgroundColor),a=(this.parent.highlightWeekends&&-1!==g.indexOf(d)&&("Day"===this.parent.timelineModule.bottomTier||"None"===this.parent.timelineModule.bottomTier&&"Day"===this.parent.timelineModule.topTier)&&(c=m,f=!0),this.parent.calendarModule.holidays.map(function(t){var i=new Date(t.from),e=new Date(t.to),a=new Date(o);i<=a&&a<=e&&("Day"===l.parent.timelineModule.bottomTier||"None"===l.parent.timelineModule.bottomTier&&"Day"===l.parent.timelineModule.topTier)?(c=m,i.getTime()===a.getTime()&&(l.holidayWidth=n),e.getTime()===a.getTime()&&(l.holidayLabel=t.label,(e=new Date(t.to)).setDate(e.getDate()+1),a=l.parent.dataOperation.getTaskWidth(i,e),l.holidayNumberOfDays=se(a)/r,l.holidayCompleted=!0),f=!0):"Day"!==l.parent.timelineModule.bottomTier&&l.detailsTimeline.startDate<=i&&l.detailsTimeline.endDate>=i&&l.parent.timelineModule.bottomTierCollection.map(function(e){e.startDate<=i&&e.endDate>=i&&e.startDate===o&&(l.fitHolidayCompleted=!0,l.fromDataHoliday=t.from,l.holidayLabel=t.label)})}),f&&p.holiday&&p.holiday.borders?p.holiday.borders.left:f&&p.holiday&&p.holiday.borderColor?new re.PdfPen(p.holiday.borderColor):new re.PdfPen(u.timelineCell.borderColor)),d=(this.parent.pdfExportModule.gantt.taskbar.isAutoFit()||(this.lastWidth=n+r),f&&(p.holiday.borderColor||p.holiday.borders)?r-2:r),y=(h.drawRectangle(a,c,n,t,d,se(i)),s||"Both"!==this.parent.gridLines&&"Vertical"!==this.parent.gridLines?null:new re.PdfPen(p.chartGridLineColor)),D=f&&(p.holiday.borderColor||p.holiday.borders)?a:y;if(h.drawRectangle(D,c,n,t+se(i),d,this.gantt.layouter.pageHeightCollection[this.pageIndex].totalHeight-this.timelineHeight),this.parent.highlightWeekends&&"Day"!==this.parent.timelineModule.bottomTier&&("None"!==this.parent.timelineModule.bottomTier||"Day"!==this.parent.timelineModule.topTier)){var k,a=this.detailsTimeline.startDate,T=this.detailsTimeline.endDate,b=new Date(a);for(0<n&&0===this.gridPageWidth&&(this.gridPageWidth=n);b<=T;)-1!==g.indexOf(new Date(b).getDay())&&(k=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(b,!0),!1,this.parent.defaultCalendarContext,!0),k=(this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?k:se(k))+this.gridPageWidth,h.drawRectangle(D,m,k,t+se(i),this.parent.perDayWidth,this.gantt.layouter.pageHeightCollection[this.pageIndex].totalHeight-this.timelineHeight)),b.setDate(b.getDate()+1)}var w,v,y=new re.PdfStandardFont(p.fontFamily,e.fontSize,e.fontStyle),d=(p.font&&(y=p.font),this.getPdfFont(p)),a=(ne.isNullOrUndefined(d)||(y=d),p.holiday&&p.holiday.fontColor?new re.PdfSolidBrush(p.holiday.fontColor):new re.PdfSolidBrush(new re.PdfColor(0,0,0))),d=p.holiday&&p.holiday.fontBrush?new re.PdfPen(new re.PdfColor(p.holiday.fontBrush)):null,S=(new re.PdfStringFormat,p.holiday&&p.holiday.format?p.holiday.format:null),P={left:0,right:0,top:0,bottom:0},C=(ne.isNullOrUndefined(p)||ne.isNullOrUndefined(p.holiday)||ne.isNullOrUndefined(p.holiday.padding)||(P=p.holiday.padding),ne.isNullOrUndefined(this.holidayLabel)||(w=y.measureString(this.holidayLabel)),this.holidayCompleted&&(M=(this.gantt.layouter.pageHeightCollection[this.pageIndex].totalHeight-this.timelineHeight)/2,C=h.save(),v=y.height,R=y.size,h.translateTransform(this.holidayWidth+r-R/2*this.holidayNumberOfDays-v+v/2+r*this.holidayNumberOfDays/2,40),h.rotateTransform(-90),h.translateTransform(-M,-((this.holidayWidth+r+R)/((this.holidayWidth+r)/r))),!ne.isNullOrUndefined(w)&&w.width+10<M&&h.drawString(this.holidayLabel,y,d,a,5-(P.left+P.right),5-(P.top+P.bottom),w.width+10,w.height+10,S),h.restore(C),this.holidayCompleted=!1),this.fitHolidayCompleted&&(M=(this.gantt.layouter.pageHeightCollection[this.pageIndex].totalHeight-this.timelineHeight)/2,R=y.size,h.drawRectangle(D,m,n+r/2-R,t+se(i),R,2*M),v=h.save(),h.translateTransform(n+r+r/2-R,40),h.rotateTransform(-90),h.translateTransform(-M,-((this.holidayWidth+r+R)/((this.holidayWidth+r)/r))),!ne.isNullOrUndefined(w)&&w.width+10<M&&h.drawString(this.holidayLabel,y,d,a,5-(P.left+P.right),5-(P.top+P.bottom),w.width+10,w.height+10,S),h.restore(v),this.fitHolidayCompleted=!1),new re.PdfStandardFont(p.fontFamily,e.fontSize,e.fontStyle)),R=(p.font&&(C=p.font),new re.PdfSolidBrush(ne.isNullOrUndefined(p.timeline.fontBrush)?u.timelineCell.fontColor:p.timeline.fontBrush)),M=p.timeline.padding?u.timelineCell.padding.left:0,y=p.timeline.padding?u.timelineCell.padding.top:0,d=h.save();h.setClip(new re.RectangleF(n,t,r,se(i))),s?n=n+M+this.topTierValueLeftPadding:n+=M,h.drawString(u.value,C,null,R,n,t+y,se(r),se(i),e.format),h.restore(d)},dr.prototype.initializePdfStringFormat=function(e,t){var i=new re.PdfStringFormat;return ne.isNullOrUndefined(e.timeline.format)?t?(i.lineAlignment=re.PdfVerticalAlignment.Middle,i.alignment=re.PdfTextAlignment.Left):(i.lineAlignment=re.PdfVerticalAlignment.Middle,i.alignment=re.PdfTextAlignment.Center,i.wordWrap=re.PdfWordWrapType.Character):i=e.timeline.format,i},dr.prototype.getPdfFont=function(e){var t,i;return e&&e.holiday&&(e.holiday.fontSize||e.holiday.fontStyle||e.holiday.fontFamily)&&(t=e.holiday.fontSize||9,i=e.holiday.fontFamily||this.fontFamily,e=e.holiday.fontStyle||re.PdfFontStyle.Regular,i=new re.PdfStandardFont(i,t,e)),i};var lr=dr;function dr(e){this.holidayCompleted=!1,this.holidayWidth=0,this.fitHolidayCompleted=!1,this.timelineWidth=0,this.lastWidth=0,this.topTierValueLeftPadding=8,this.timelineHeight=0,this.gridPageWidth=0,this.width=0,this.gantt=e,this.parent=e.parent,this.topTierPoint=new re.PointF,this.bottomTierPoint=new re.PointF,this.topTierIndex=0,this.bottomTierIndex=0,this.prevTopTierIndex=0,this.prevBottomTierIndex=0}pr.prototype.add=function(){return new pr(this.parent)},pr.prototype.drawPredecessor=function(e){var t,i,a=(this.pdfGantt=e).result.page.section.getPages(),n=e.taskbarCollection[this.parentIndex],r=e.taskbarCollection[this.childIndex],s=new re.PdfPage,o=new re.PdfPage,l="";if(r&&n){switch(this.type){case"FS":if(!(-1<r.startPage&&-1<n.endPage))return;s=a[n.endPage],o=a[r.startPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[r.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType1":"FSType2":this.parentLeft<this.childLeft&&this.childLeft>this.parentLeft+this.parentWidth+25?"FSType3":"FSType4";break;case"SF":if(!(-1<r.endPage&&-1<n.startPage))return;s=a[n.startPage],o=a[r.endPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[r.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>this.childLeft+this.childWidth?"SFType1":"SFType2":this.parentLeft>this.childLeft+this.childWidth?"SFType3":"SFType4";break;case"FF":if(!(-1<r.endPage&&-1<n.endPage))return;s=a[n.endPage],o=a[r.endPage],t=e.pdfPageDetail[n.endPage-e.chartPageIndex],i=e.pdfPageDetail[r.endPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType1":"FFType2":this.childLeft+this.childWidth>=this.parentLeft+this.parentWidth?"FFType3":"FFType4";break;case"SS":if(!(-1<r.startPage&&-1<n.startPage))return;s=a[n.startPage],o=a[r.startPage],t=e.pdfPageDetail[n.startPage-e.chartPageIndex],i=e.pdfPageDetail[r.startPage-e.chartPageIndex],l=this.parentIndex<this.childIndex?this.parentLeft>=this.childLeft?"SSType1":"SSType2":this.parentLeft>=this.childLeft?"SSType3":"SSType4"}var d=Math.round((this.parent.rowHeight-15)/2),h=Math.round((this.parent.rowHeight-1)/2),p=Math.round((this.parent.rowHeight-10)/2),u=se(this.parent.renderBaseline?p:!n.isAutoSchedule&&n.isParentTask||!r.isAutoSchedule&&r.isParentTask?d:h),c=void 0,g=void 0,f=void 0,m=void 0,y=void 0,D=void 0,c=g=f=m=y=D=new re.PointF,p=(n.taskStartPoint.x,n.taskStartPoint.y),d=(r.taskStartPoint.x,r.taskStartPoint.y),k=p+t.startPoint.y,T=d+i.startPoint.y,b=void 0,w=void 0,v=void 0,S=void 0,P=void 0,P=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(b=new re.PointF(this.parentLeft+this.parentWidth,k+u),w=new re.PointF(this.parentLeft-1,k+u),v=new re.PointF(this.childLeft-20,T+u),S=new re.PointF(this.childLeft-6-this.lineWidth-1,T+u),new re.PointF(this.childLeft+this.childWidth+6+this.lineWidth+1,T+u)):(b=new re.PointF(se(this.parentLeft+this.parentWidth),k+u),w=new re.PointF(se(this.parentLeft)-1,k+u),v=new re.PointF(se(this.childLeft-20),T+u),S=new re.PointF(se(this.childLeft-6-this.lineWidth)-1,T+u),new re.PointF(se(this.childLeft+this.childWidth+6+this.lineWidth)+1,T+u));switch(l){case"FSType1":case"FSType3":c=b,g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new re.PointF(this.childLeft-20,k+u):new re.PointF(se(this.childLeft-20),k+u),f=v,m=S,this.connectLines(s,o,c,g,f,m,r,u);break;case"FSType2":c=b,g=new re.PointF(c.x+10,k+u),f=new re.PointF(c.x+10,T+2),m=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new re.PointF(this.childLeft-20,T+2):new re.PointF(se(this.childLeft-20),T+2),y=v,D=S,this.connectLines(s,o,c,g,f,m,r,u,y,D);break;case"FSType4":c=b,g=new re.PointF(c.x+10,k+u),f=new re.PointF(c.x+10,k+2),m=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new re.PointF(this.childLeft-20,k+2):new re.PointF(se(this.childLeft-20),k+2),y=v,D=S,this.connectLines(s,o,c,g,f,m,r,u,y,D);break;case"FFType1":case"FFType3":g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(c=new re.PointF(this.parentLeft+this.parentWidth+1,k+u),new re.PointF(this.childLeft+this.childWidth+20,k+u)):(c=new re.PointF(se(this.parentLeft+this.parentWidth)+1,k+u),new re.PointF(se(this.childLeft+this.childWidth+20),k+u)),f=new re.PointF(g.x,T+u),m=P,this.connectLines(s,o,c,g,f,m,r,u);break;case"FFType2":case"FFType4":g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(c=new re.PointF(this.parentLeft+this.parentWidth+1,k+u),new re.PointF(this.parentLeft+this.parentWidth+20,k+u)):(c=new re.PointF(se(this.parentLeft+this.parentWidth)+1,k+u),new re.PointF(se(this.parentLeft+this.parentWidth+20),k+u)),f=new re.PointF(g.x,T+u),m=P,this.connectLines(s,o,c,g,f,m,r,u);break;case"SSType1":case"SSType3":c=w,g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new re.PointF(this.childLeft-20,k+u):new re.PointF(se(this.childLeft-20),k+u),f=new re.PointF(g.x,T+u),m=S,this.connectLines(s,o,c,g,f,m,r,u);break;case"SSType2":case"SSType4":c=w,g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new re.PointF(this.parentLeft-20,k+u):new re.PointF(se(this.parentLeft-20),k+u),f=new re.PointF(g.x,T+u),m=S,this.connectLines(s,o,c,g,f,m,r,u);break;case"SFType1":case"SFType3":c=w,g=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?new re.PointF(this.childLeft+this.childWidth+20,k+u):new re.PointF(se(this.childLeft+this.childWidth+20),k+u),f=new re.PointF(g.x,T+u),m=P,this.connectLines(s,o,c,g,f,m,r,u);break;case"SFType2":c=w,m=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(g=new re.PointF(this.parentLeft-20,k+u),new re.PointF(this.childLeft+this.childWidth+20,T+2)):(g=new re.PointF(se(this.parentLeft-20),k+u),new re.PointF(se(this.childLeft+this.childWidth+20),T+2)),f=new re.PointF(g.x,T+2),y=new re.PointF(m.x,T+u),D=P,this.connectLines(s,o,c,g,f,m,r,u,y,D);break;case"SFType4":c=w,m=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(g=new re.PointF(this.parentLeft-20,k+u),new re.PointF(this.childLeft+this.childWidth+20,k+2)):(g=new re.PointF(se(this.parentLeft-20),k+u),new re.PointF(se(this.childLeft+this.childWidth+20),k+2)),f=new re.PointF(g.x,k+2),y=new re.PointF(m.x,T+u),D=P,this.connectLines(s,o,c,g,f,m,r,u,y,D)}}},pr.prototype.connectLines=function(e,t,i,a,n,r,s,o,l,d){this.drawLine(e,i,a),this.drawLine(e,a,n),this.drawLine(e,n,r),ne.isNullOrUndefined(l)||ne.isNullOrUndefined(d)||(this.drawLine(e,r,l),this.drawLine(e,l,d)),this.drawArrow(t,s,o)},pr.prototype.contains=function(e,t,i){return e.x<=t&&t<e.x+e.width&&e.y<=i&&i<e.y+e.height},pr.prototype.findPageIndex=function(e){for(var t=-1,i=0;i<this.pdfGantt.pdfPageDetail.length;i++){var a=this.pdfGantt.pdfPageDetail[i],a=new re.RectangleF(a.startPoint.x,a.startPoint.y,a.width,a.height);if(this.contains(a,e.x,e.y)){t=i;break}}return t},pr.prototype.drawLine=function(e,t,i){var a,n,r=this.pdfGantt.result.page.section.getPages(),s=e.graphics,o={x:i.x,y:i.y},l={x:i.x,y:i.y},d={x:i.x,y:i.y},e=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],h=new re.RectangleF(e.startPoint.x,e.startPoint.y,e.width,e.height),p=this.contains(h,t.x,t.y),u=this.contains(h,i.x,i.y),c=-1;t=new re.PointF(t.x,t.y),i=new re.PointF(i.x,i.y),!p&&!u||u&&!p?-1<(c=this.findPageIndex(t))&&(e=this.pdfGantt.pdfPageDetail[c],l=t,o=i,this.drawLine(r[c+this.pdfGantt.chartPageIndex],l,o)):!u&&p&&(u=h.x,n=h.x+h.width,a=h.y+h.height,h=h.y,u>i.x?(d.x=i.x=u-1,l.x=u-1):n<i.x?(d.x=i.x=n,l.x=n,d.x+=1):a<i.y?(d.y=i.y=a,l.y=a,d.y+=1,this.pdfGantt.enableHeader&&(l.y+=this.parent.timelineModule.isSingleTier?se(45):se(62))):h>i.y&&(l.y=d.y=h-1,i.y=h,this.pdfGantt.enableHeader)&&(d.y+=this.parent.timelineModule.isSingleTier?se(45):se(62),i.y+=this.parent.timelineModule.isSingleTier?se(45):se(62)),-1!==(c=this.findPageIndex(d)))&&this.drawLine(r[c+this.pdfGantt.chartPageIndex],l,o),p&&(t=new re.PointF(t.x,t.y),i=new re.PointF(i.x,i.y),t.x=t.x+e.pageStartX-e.startPoint.x,t.y=t.y-e.startPoint.y,i.x=i.x+e.pageStartX-e.startPoint.x,i.y=i.y-e.startPoint.y,u=new re.PdfSolidBrush(this.connectorLineColor),n=new re.PdfPen(u,se(this.lineWidth)),s.drawLine(n,t,i))},pr.prototype.drawArrow=function(e,t,i){var a,n=this.pdfGantt.pdfPageDetail[e.section.indexOf(e)-this.pdfGantt.chartPageIndex],r=new re.RectangleF(new re.PointF(n.startPoint.x,n.startPoint.y),new re.SizeF(n.width,n.height)),s=new re.PointF,o=e.section.getPages(),l=6+this.lineWidth,s=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?"FS"===this.type||"SS"===this.type?new re.PointF(this.childLeft-1,t.taskStartPoint.y+n.startPoint.y):new re.PointF(this.childLeft+this.childWidth+1,t.taskStartPoint.y+n.startPoint.y):"FS"===this.type||"SS"===this.type?new re.PointF(se(this.childLeft)-1,t.taskStartPoint.y+n.startPoint.y):new re.PointF(se(this.childLeft+this.childWidth)+1,t.taskStartPoint.y+n.startPoint.y),r=(this.contains(r,s.x,s.y)||-1<(t=this.findPageIndex(s))&&(n=this.pdfGantt.pdfPageDetail[t],e=o[t+this.pdfGantt.chartPageIndex]),e.graphics),o=(s.x=s.x-n.startPoint.x+n.pageStartX,s.y=s.y-n.startPoint.y,new re.PointF(s.x,s.y+i)),t=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?"FS"===this.type||"SS"===this.type?new re.PointF(o.x-l,o.y-l):new re.PointF(o.x+l,o.y-l):"FS"===this.type||"SS"===this.type?new re.PointF(o.x-se(l),o.y-se(l)):new re.PointF(o.x+se(l),o.y-se(l)),e=new re.PdfSolidBrush(this.connectorLineColor),n=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(a=new re.PointF(t.x,t.y+2*l),new re.PdfPen(e,this.lineWidth)):(a=new re.PointF(t.x,t.y+se(2*l)),new re.PdfPen(e,se(this.lineWidth)));0<this.childLeft&&(r.drawLine(n,o,t),r.drawLine(n,t,a),r.drawLine(n,a,o))};var hr=pr;function pr(e,t){this.parent=e,this.pdfGantt=t}cr.prototype.drawEventMarker=function(e,t,i,a,n,r,s){var o,l,d,h,p,u,c=e.graphics,e=(e.getClientSize(),new re.PdfStandardFont(re.PdfFontFamily.Helvetica,10)),g=(!ne.isNullOrUndefined(this.parent.pdfExportModule.helper.exportProps.ganttStyle)&&this.parent.pdfExportModule.helper.exportProps.ganttStyle.font&&(e=this.parent.pdfExportModule.helper.exportProps.ganttStyle.font),ne.isNullOrUndefined(n.label)||(o=e.measureString(n.label)),s.eventMarker.lineStyle);g.dashStyle=s.eventMarker.lineStyle.dashStyle,a.startDate<=n.date&&n.date<=a.endDate&&((a=new re.PdfStringFormat).alignment=re.PdfTextAlignment.Center,a=ne.isNullOrUndefined(s.eventMarker.label.format)?a:s.eventMarker.label.format,l=new re.PdfSolidBrush(s.eventMarker.label.backgroundColor),d=s.eventMarker.label&&s.eventMarker.label.fontColor?new re.PdfSolidBrush(s.eventMarker.label.fontColor):null,h=this.getPdfFont(s),ne.isNullOrUndefined(h)&&(h=e),e=s.eventMarker.label.borders||null,s.eventMarker.label.borderColor&&((p=new wn).all=new re.PdfPen(new re.PdfColor(s.eventMarker.label.borderColor)),e=p),p=ne.isNullOrUndefined(e)||ne.isNullOrUndefined(e.left)?null:e.left,e={left:0,right:0,top:0,bottom:0},ne.isNullOrUndefined(s)||ne.isNullOrUndefined(s.eventMarker)||ne.isNullOrUndefined(s.eventMarker.label)||ne.isNullOrUndefined(s.eventMarker.label.padding)||(e=s.eventMarker.label.padding),s=ne.isNullOrUndefined(s.eventMarker.label.fontBrush)?null:new re.PdfPen(s.eventMarker.label.fontBrush),u=this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(n.date,!0),!1,this.parent.defaultCalendarContext,!0),this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?(c.drawLine(g,new re.PointF(t.x+(u-i)+10,r),new re.PointF(t.x+(u-i)+10,this.renderHeight)),!ne.isNullOrUndefined(n.label)&&0<n.label.length&&r+se(parseFloat(n.top))+2*o.height<this.renderHeight&&(c.save(),c.translateTransform(t.x+(u-i)+7+10,r+se(parseFloat(n.top))+o.height/2),c.rotateTransform(45),c.drawRectangle(p,l,0,0,8,8),c.restore(),c.drawRectangle(p,l,t.x+(u-i)+7+10,r+se(parseFloat(n.top)),o.width+10,2*o.height),c.drawString(n.label,h,s,d,t.x+(u-i)+12+10-(e.left+e.right),r+se(parseFloat(n.top))+se(o.height/2)-(e.top+e.bottom),o.width,o.height,a))):(c.drawLine(g,new re.PointF(t.x+se(u-i)+10,r),new re.PointF(t.x+se(u-i)+10,this.renderHeight)),!ne.isNullOrUndefined(n.label)&&0<n.label.length&&r+se(parseFloat(n.top))+2*o.height<this.renderHeight&&(c.save(),c.translateTransform(t.x+se(u-i)+7+10,r+se(parseFloat(n.top))+o.height/2),c.rotateTransform(45),c.drawRectangle(p,l,0,0,8,8),c.restore(),c.drawRectangle(p,l,t.x+se(u-i)+7+10,r+se(parseFloat(n.top)),o.width+10,2*o.height),c.drawString(n.label,h,s,d,t.x+se(u-i)+12+10-(e.left+e.right),r+se(parseFloat(n.top)+1)+se(o.height/2)-(e.top+e.bottom),o.width,o.height,a))))},cr.prototype.getPdfFont=function(e){var t,i;return e&&e.eventMarker&&e.eventMarker.label&&(e.eventMarker.label.fontSize||e.eventMarker.label.fontStyle||e.eventMarker.label.fontFamily)&&(t=e.eventMarker.label.fontSize||9,i=e.eventMarker.label.fontFamily||this.fontFamily,e=e.eventMarker.label.fontStyle||re.PdfFontStyle.Regular,i=new re.PdfStandardFont(i,t,e)),i};var ur=cr;function cr(e){this.renderHeight=0,this.parent=e}gr=function(e,t){return(gr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}gr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(yr,fr=jn),Object.defineProperty(yr.prototype,"taskbar",{get:function(){return ne.isNullOrUndefined(this.taskbars)&&(this.taskbars=new sr(this.parent)),this.taskbars},enumerable:!0,configurable:!0}),yr.prototype.drawChart=function(e){this.result=e,this.totalPages=this.result.page.section.count,this.perColumnPages=this.totalPages/this.layouter.columnRanges.length,this.calculateRange(),this.drawGantttChart(),this.drawPageBorder()},yr.prototype.calculateRange=function(){for(var e=this.layouter.columnRanges[this.layouter.columnRanges.length-1],t=0,i=!0,a=0,n=0,r=0,s=se(this.chartHeader.width),o=this.parent.timelineModule,l=this.parent.pdfExportModule.helper.shouldProcessChart(),d=e[0];d<=e[1];d++)t+=this.layouter.treegrid.columns.getColumn(d).width;for((t+=.5)+100<this.result.page.getClientSize().width||!l?(n=this.result.page.getClientSize().width-t,this.chartPageIndex=this.startPageIndex=this.totalPages-this.perColumnPages,i=!1,this.startPoint=new re.PointF(t,0)):(this.result.page.section.add(),this.chartPageIndex=this.startPageIndex=this.totalPages,i=!0,this.startPoint=new re.PointF(r,0));Math.round(r)<Math.round(s);){i?a=this.result.page.getClientSize().width:(a=n,i=!0);var h,p,u,c,g,f={},m=[],y=se(this.chartHeader.bottomTierCellWidth),D=0,k=(0!==this.chartHeader.bottomTierCellWidth&&(D=Math.floor(a/y)*y),0===(m[0]=r)&&this.parent.timelineModule.timelineStartDate&&(h=(u=this.parent.timelineModule.timelineStartDate).getHours(),p=u.getMinutes(),u=u.getSeconds(),0===h&&0===p&&0===u||(g=0,"Minutes"===(c="None"===(c=o.customTimelineSettings.bottomTier.unit)?o.customTimelineSettings.topTier.unit:c)?g=u/60:"Hour"===c?g=p/60:"Day"!==c&&"Week"!==c||(g=(60*h*60+60*p+u)/86400),0<g&&(D-=y*g))),s-r<=D?f.totalWidth=oe((m[1]=s)-r):(m[1]=r+D,f.totalWidth=oe(D)),f.startPoint=m[0],f.endPoint=m[1],this.parent.projectStartDate&&0===this.parent.cloneProjectStartDate.getHours()&&0===this.parent.cloneProjectStartDate.getMinutes()&&0===this.parent.cloneProjectStartDate.getSeconds()&&(this.changeCloneProjectDates=!0,this.parent.cloneProjectStartDate.setHours(8)),this.parent.timelineSettings.viewStartDate&&!ne.isNullOrUndefined(this.parent.cloneTimelineStartDate)&&0===this.parent.cloneTimelineStartDate.getHours()&&0===this.parent.cloneTimelineStartDate.getMinutes()&&0===this.parent.cloneTimelineStartDate.getSeconds()&&(this.changeCloneTimelineDates=!0,this.parent.cloneTimelineStartDate.setHours(8)),this.parent.dataOperation.getDateFromFormat(this.parent.timelineModule.timelineStartDate)),T=o.customTimelineSettings.bottomTier.count;switch(ne.isNullOrUndefined(T)&&(T=o.customTimelineSettings.topTier.count),("None"===o.customTimelineSettings.bottomTier.unit?o.customTimelineSettings.topTier:o.customTimelineSettings.bottomTier).unit){case"Minutes":f.startDate=new Date(k.getTime());var b=Math.floor(oe(f.startPoint)/this.chartHeader.bottomTierCellWidth),b=(f.startDate.setMinutes(f.startDate.getMinutes()+b*T),f.startDate.setSeconds(f.startDate.getSeconds()+1),f.endDate=new Date(f.startDate.getTime()),Math.floor(oe(f.endPoint-f.startPoint)/this.chartHeader.bottomTierCellWidth));f.endDate.setMinutes(f.endDate.getMinutes()+b*T);break;case"Hour":f.startDate=new Date(k.getTime());var b=Math.floor(oe(f.startPoint)/this.chartHeader.bottomTierCellWidth),w=new Date(f.startDate.getTime()),v=(this.parent.timelineSettings.showWeekend?(f.startDate.setHours(f.startDate.getHours()+b*T),f.startDate.setMinutes(f.startDate.getMinutes()+1)):(w=this.calculateHoursWithoutNonworkingDays(w,b,T),f.startDate=new Date(w.getTime())),Math.floor((f.endPoint-f.startPoint)/oe(this.chartHeader.bottomTierCellWidth)));w=new Date(f.startDate.getTime()),this.parent.timelineSettings.showWeekend?w.setHours(w.getHours()+v*T):w=this.calculateHoursWithoutNonworkingDays(w,v,T),f.endDate=new Date(w.getTime());break;case"Day":f.startDate=new Date(k.getTime());var v=Math.round(f.startPoint/se(this.chartHeader.bottomTierCellWidth)),w=new Date(f.startDate.getTime()),S=(this.parent.timelineSettings.showWeekend?f.startDate.setDate(f.startDate.getDate()+v*T):f.startDate=this.calculateDaysWithoutNonworkingDays(f.startDate,v*T),Math.round((f.endPoint-f.startPoint)/se(this.chartHeader.bottomTierCellWidth))-1),S=(f.startDate.setHours(0,0,0,0),w=new Date(f.startDate.getTime()),this.parent.timelineSettings.showWeekend?w.setDate(w.getDate()+S*T):w=this.calculateDaysWithoutNonworkingDays(w,S*T),1e3*this.parent.workingTimeRanges[this.parent.workingTimeRanges.length-1].to);f.endDate=new Date(w.getTime()),f.endDate.setTime(f.endDate.getTime()+S);break;case"Week":f.startDate=new Date(k.getTime());S=f.startPoint/se(this.chartHeader.bottomTierCellWidth)*7;this.parent.timelineSettings.showWeekend?f.startDate.setDate(f.startDate.getDate()+S*T):f.startDate=this.calculateDaysWithoutNonworkingDays(f.startDate,S*T),P=this.parent.pdfExportModule.gantt.taskbar.isAutoFit()?Math.round((f.endPoint-f.startPoint)/se(this.chartHeader.bottomTierCellWidth)*7-1):7*Math.round((f.endPoint-f.startPoint)/se(this.chartHeader.bottomTierCellWidth))-1,f.endDate=new Date(f.startDate.getTime()),this.parent.timelineSettings.showWeekend?f.endDate.setDate(f.startDate.getDate()+P*T):f.endDate=this.calculateDaysWithoutNonworkingDays(f.endDate,P*T);break;case"Month":f.startDate=new Date(k.getTime());var P=f.startPoint/se(this.chartHeader.bottomTierCellWidth)*31,C=(f.startDate.setDate(f.startDate.getDate()+P*T),31*Math.round((f.endPoint-f.startPoint)/se(this.chartHeader.bottomTierCellWidth))-1);f.endDate=new Date(f.startDate.getTime()),f.endDate.setDate(f.startDate.getDate()+C*T);break;case"Year":f.startDate=new Date(k.getTime());var C=f.startPoint/se(this.chartHeader.bottomTierCellWidth)*365,R=(f.startDate.setDate(f.startDate.getDate()+C*T),365*Math.round((f.endPoint-f.startPoint)/se(this.chartHeader.bottomTierCellWidth))-1);f.endDate=new Date(f.startDate.getTime()),f.endDate.setDate(f.startDate.getDate()+R*T)}this.headerDetails.push(f),r+=D}},yr.prototype.calculateHoursWithoutNonworkingDays=function(e,t,i){for(var a=0;a<t*i;)e.setHours(e.getHours()+1),-1===this.parent.nonWorkingDayIndex.indexOf(e.getDay())&&a++,-1!==this.parent.nonWorkingDayIndex.indexOf(e.getDay())&&e.setHours(24,0,0,0);return e},yr.prototype.calculateDaysWithoutNonworkingDays=function(e,t){var i=new Date(e.getTime()),e=7-this.parent.nonWorkingDayIndex.length,a=Math.floor(t/e),n=t%e;for(i.setDate(i.getDate()+7*a);0<n;)i.setDate(i.getDate()+1),-1===this.parent.nonWorkingDayIndex.indexOf(i.getDay())&&n--;return i},yr.prototype.drawPageBorder=function(){for(var e=this.result.page.section.getPages(),t=0;t<e.length;t++){var i=e[t],a=i.graphics,i=i.getClientSize(),n=new re.PdfPen(new re.PdfColor(this.ganttStyle.chartGridLineColor));a.drawRectangle(n,0,0,i.width,i.height)}},yr.prototype.drawGantttChart=function(){var h,p,u=this,c=this.startPoint,g=new re.PointF,f=0,m=0;this.headerDetails.forEach(function(a,e){u.currentPage=0;var t=u.result.page.section.getPages()[u.startPageIndex];t.contentWidth=u.parent.pdfExportModule.gantt.taskbar.isAutoFit()?oe(u.headerDetails[e].endPoint-u.headerDetails[e].startPoint):u.headerDetails[e].endPoint-u.headerDetails[e].startPoint,u.chartHeader.drawTimeline(t,u.startPoint,a,0),c.y=c.y+se(u.parent.timelineModule.isSingleTier?45:60),h=c.x,m=se(u.parent.timelineModule.isSingleTier?45:60),u.headerDetails[u.headerDetails.indexOf(a)].startIndex=u.startPageIndex,u.headerDetails[u.headerDetails.indexOf(a)].pageStartPoint=c;for(var i=0;i<u.taskbarCollection.length;i++){var n=u.taskbarCollection[i],r=u.rows.getRow(i+1).height,s=u.result.page.section.getPages()[u.startPageIndex],o=s.graphics,l=new re.PdfPen(new re.PdfColor(u.ganttStyle.chartGridLineColor)),d=void 0;!t.contentWidth||"Both"!==u.parent.gridLines&&"Horizontal"!==u.parent.gridLines||(d=u.chartHeader.timelineWidth,o.drawRectangle(l,h,c.y,t.contentWidth+.5,r)),n.drawTaskbar(s,c,a,f,r,u.taskbarCollection[parseInt(i.toString(),10)],d,e)&&(u.enableHeader?c.y=se(u.parent.timelineModule.isSingleTier?45:60):c.y=0,u.startPageIndex++,(p={}).height=m,p.pageStartX=h,p.startPoint=Object.assign({},g),u.parent.pdfExportModule.gantt.taskbar.isAutoFit()?p.width=a.totalWidth:p.width=se(a.totalWidth),u.pdfPageDetail.push(p),g.y+=p.height,m=u.enableHeader?u.chartHeader.height:c.y=0),c.y+=r,m+=r,u.eventMarker.renderHeight=u.layouter.pageHeightCollection[u.currentPage].totalHeight,u.parent.eventMarkerColloction.map(function(e){var t=se(u.parent.timelineModule.isSingleTier?45:60),i=(0!==u.currentPage&&(u.eventMarker.renderHeight=u.layouter.pageHeightCollection[u.currentPage].totalHeight+t),u.result.page.section.getPages()[u.startPageIndex]);u.eventMarker.drawEventMarker(i,c,f,a,e,t,u.ganttStyle)})}u.headerDetails[e].endIndex=u.startPageIndex,f+=a.totalWidth,(p={}).height=m,p.pageStartX=h,p.startPoint=Object.assign({},g),u.parent.pdfExportModule.gantt.taskbar.isAutoFit()?p.width=a.totalWidth:p.width=se(a.totalWidth),u.pdfPageDetail.push(p),g.x+=p.width,g.y=0,u.enableHeader?m=u.chartHeader.height:c.y=0,u.headerDetails.indexOf(a)!==u.headerDetails.length-1&&(u.result.page.section.add(),u.startPageIndex=u.result.page.section.count-1,c=u.startPoint=new re.PointF(0,0))});for(var e=0;e<this.predecessorCollection.length;e++)this.predecessorCollection[e].drawPredecessor(this)};var gr,fr,mr=yr;function yr(e){var t=fr.call(this)||this;return t.exportProps={},t.changeCloneProjectDates=!1,t.changeCloneTimelineDates=!1,t.currentPage=0,t.parent=e,t.chartHeader=new lr(t),t.eventMarker=new ur(e),t.predecessor=new hr(e,t),t.headerDetails=[],t.pdfPageDetail=[],t.taskbarCollection=[],t.predecessorCollection=[],t}Dr.prototype.getModuleName=function(){return"pdfExport"},Dr.prototype.destroy=function(){},Dr.prototype.initGantt=function(){this.pdfDocument=void 0,this.gantt=new mr(this.parent)},Dr.prototype.export=function(i,a,n,e){var r=this,e=(this.isBlob=e,{requestType:"beforePdfExport",ganttObject:this.parent,cancel:!1});return this.parent.trigger("beforePdfExport",e),ne.getValue("cancel",e)||this.parent.showLoadingIndicator(),ne.getValue("cancel",e)?new Promise(function(e,t){return e()}):new Promise(function(e,t){r.exportWithData(n,e,i,a)})},Dr.prototype.exportWithData=function(e,t,i,a){var n=this,r=[],s=this.parent.getExpandedRecords(this.parent.updatedRecords),r=(i=ne.isNullOrUndefined(i)?{}:i).fitToWidthSettings&&i.fitToWidthSettings.isFitToWidth?("CurrentViewData"===i.exportType?this.helper.beforeSinglePageExport.cloneFlatData=ne.extend([],this.parent.currentViewData,null,!0):"AllData"===i.exportType?this.helper.beforeSinglePageExport.cloneFlatData=ne.extend([],this.parent.flatData,null,!0):this.helper.beforeSinglePageExport.cloneFlatData=ne.extend([],s,null,!0),this.helper.beforeSinglePageExport.cloneCurrentViewData=ne.extend([],this.parent.currentViewData,null,!0),this.helper.beforeSinglePageExport.cloneFlatData):ne.isNullOrUndefined(i.exportType)?s:"CurrentViewData"===i.exportType?this.parent.currentViewData:this.parent.flatData;this.initGantt(),ne.isNullOrUndefined(e)?this.pdfDocument=new re.PdfDocument:this.pdfDocument=e,this.processExport(r,i,a).then(function(){n.parent.trigger("pdfExportComplete",n.isBlob?{promise:n.blobPromise}:{}),n.parent.hideLoadingIndicator(),t(n.pdfDocument)})},Dr.prototype.processExport=function(i,a,t){var n=this,e=this.pdfDocument.sections.add();return this.processSectionExportProperties(e,a),this.pdfPage=e.pages.add(),this.pdfPageDimensions=this.pdfPage.getClientSize(),new Promise(function(e,t){n.helper.processGridExport(i,n.gantt,a),n.helper.initializePdf(n.pdfDocument),e()}).then(function(){var e=new Vn,e=(e.break=re.PdfLayoutBreakType.FitElement,n.gantt.drawGrid(n.pdfPage,0,0,e));return n.gantt.drawChart(e),n.helper.exportProps&&n.helper.exportProps.fitToWidthSettings&&n.helper.exportProps.fitToWidthSettings.isFitToWidth&&(n.parent.zoomingProjectStartDate=n.helper.beforeSinglePageExport.zoomingProjectStartDate,n.parent.zoomingProjectEndDate=n.helper.beforeSinglePageExport.zoomingProjectEndDate,n.parent.cloneProjectStartDate=n.helper.beforeSinglePageExport.cloneProjectStartDate,n.parent.cloneProjectEndDate=n.helper.beforeSinglePageExport.cloneProjectEndDate,n.parent.cloneTimelineStartDate=n.helper.beforeSinglePageExport.cloneTimelineStartDate,n.parent.cloneTimelineEndDate=n.helper.beforeSinglePageExport.cloneTimelineEndDate,n.parent.timelineModule.customTimelineSettings=n.helper.beforeSinglePageExport.customTimelineSettings,n.parent.isTimelineRoundOff=n.helper.beforeSinglePageExport.isTimelineRoundOff,n.parent.timelineModule.topTier=n.helper.beforeSinglePageExport.topTier,n.parent.timelineModule.topTierCellWidth=n.helper.beforeSinglePageExport.topTierCellWidth,n.parent.timelineModule.topTierCollection=n.helper.beforeSinglePageExport.topTierCollection,n.parent.timelineModule.bottomTier=n.helper.beforeSinglePageExport.bottomTier,n.parent.timelineModule.bottomTierCellWidth=n.helper.beforeSinglePageExport.bottomTierCellWidth,n.parent.timelineModule.bottomTierCollection=n.helper.beforeSinglePageExport.bottomTierCollection,n.parent.timelineModule.totalTimelineWidth=n.helper.beforeSinglePageExport.totalTimelineWidth,n.parent.timelineModule.timelineStartDate=n.helper.beforeSinglePageExport.timelineStartDate,n.parent.timelineModule.timelineEndDate=n.helper.beforeSinglePageExport.timelineEndDate,n.parent.timelineModule.timelineRoundOffEndDate=n.helper.beforeSinglePageExport.timelineRoundOffEndDate,n.parent.perDayWidth=n.helper.beforeSinglePageExport.perDayWidth,n.parent.updatedConnectorLineCollection=n.helper.beforeSinglePageExport.updatedConnectorLineCollection),n.gantt.changeCloneProjectDates&&n.parent.cloneProjectStartDate&&(n.parent.cloneProjectStartDate instanceof Date&&n.parent.cloneProjectStartDate.setHours(0),n.gantt.changeCloneProjectDates=!1),n.gantt.changeCloneTimelineDates&&n.parent.cloneTimelineStartDate&&(n.parent.cloneTimelineStartDate instanceof Date&&n.parent.cloneTimelineStartDate.setHours(0),n.gantt.changeCloneTimelineDates=!1),t||(n.isBlob?n.blobPromise=n.pdfDocument.save():!ne.isNullOrUndefined(a)&&a.fileName?n.pdfDocument.save(a.fileName):n.pdfDocument.save("Export.pdf"),n.pdfDocument.destroy()),n.pdfDocument})},Dr.prototype.processSectionExportProperties=function(e,t){var i;ne.isNullOrUndefined(t)||(i=new re.PdfPageSettings,ne.isNullOrUndefined(t.pageOrientation)||"Portrait"!==t.pageOrientation?i.orientation=re.PdfPageOrientation.Landscape:i.orientation=re.PdfPageOrientation.Portrait,ne.isNullOrUndefined(t.pageSize)||(i.size=this.getPageSize(t.pageSize)),e.setPageSettings(i),ne.isNullOrUndefined(t.ganttStyle))?this.gantt.ganttStyle=new Dn(t.theme).style:(e=new Dn(t.theme).style,this.gantt.ganttStyle=ne.extend({},e,t.ganttStyle,!0))},Dr.prototype.getPageSize=function(e){switch(e){case"Letter":return new re.SizeF(612,792);case"Note":return new re.SizeF(540,720);case"Legal":return new re.SizeF(612,1008);case"A0":return new re.SizeF(2380,3368);case"A1":return new re.SizeF(1684,2380);case"A2":return new re.SizeF(1190,1684);case"A3":return new re.SizeF(842,1190);case"A5":return new re.SizeF(421,595);case"A6":return new re.SizeF(297,421);case"A7":return new re.SizeF(210,297);case"A8":return new re.SizeF(148,210);case"A9":return new re.SizeF(105,148);case"B0":return new re.SizeF(2836,4008);case"B1":return new re.SizeF(2004,2836);case"B2":return new re.SizeF(1418,2004);case"B3":return new re.SizeF(1002,1418);case"B4":return new re.SizeF(709,1002);case"B5":return new re.SizeF(501,709);case"Archa":return new re.SizeF(648,864);case"Archb":return new re.SizeF(864,1296);case"Archc":return new re.SizeF(1296,1728);case"Archd":return new re.SizeF(1728,2592);case"Arche":return new re.SizeF(2592,3456);case"Flsa":return new re.SizeF(612,936);case"HalfLetter":return new re.SizeF(396,612);case"Letter11x17":return new re.SizeF(792,1224);case"Ledger":return new re.SizeF(1224,792);default:return new re.SizeF(595,842)}};On=Dr;function Dr(e){this.isPdfExport=!1,ne.initializeTelemetryFeature("PdfExport","Gantt"),this.parent=e,this.helper=new ar(this.parent),this.pdfDocument=void 0}Tr.prototype.getModuleName=function(){return"virtualScroll"},Tr.prototype.bindTreeGridProperties=function(){this.parent.treeGrid.enableVirtualization=this.parent.enableVirtualization,b.TreeGrid.Inject(b.VirtualScroll)},Tr.prototype.getTopPosition=function(){var e=this.parent.ganttChartModule.scrollElement.querySelector(".e-virtualtable"),t=e.style.transform,t=(t=this.parent.normalizeTranslate(t)).split(",");return e=1<t.length?t[1].trim().split(")")[0]:(t=e.style.transform).substring(t.lastIndexOf("(")+1,t.lastIndexOf(")")),parseFloat(e)},Tr.prototype.destroy=function(){};var kr=Tr;function Tr(e){ne.initializeTelemetryFeature("VirtualScroll","Gantt"),this.parent=e,this.bindTreeGridProperties()}wr.prototype.getModuleName=function(){return"freeze"},wr.prototype.destroy=function(){};var br=wr;function wr(e){this.parent=e,b.TreeGrid.Inject(b.Freeze),this.parent.treeGrid.frozenColumns=this.parent.frozenColumns}k.AddDialogFieldSettings=Lt,k.CalendarException=ea,k.CalendarSettings=la,k.Column=Et,k.ColumnMenu=fn,k.ContextMenu=un,k.CriticalPath=on,k.DayMarkers=rn,k.DayWorkingTime=s,k.Dependency=ba,k.Edit=f,k.EditDialogFieldSettings=Wt,k.EditSettings=zt,k.EventMarker=Xt,k.ExcelExport=cn,k.Filter=Ya,k.FilterSettings=$t,k.Freeze=br,k.Gantt=fa,k.Holiday=si,k.LabelSettings=hi,k.LoadingIndicator=_i,k.PdfBorders=wn,k.PdfExport=On,k.PdfGanttTheme=Dn,k.PdfPaddings=Sn,k.PdfTreeGridCell=Gn,k.PdfTreeGridCellCollection=qn,k.PdfTreeGridColumn=Jn,k.PdfTreeGridColumnCollection=tr,k.PdfTreeGridHeaderCollection=Qn,k.PdfTreeGridLayoutFormat=Vn,k.PdfTreeGridLayoutResult=Un,k.PdfTreeGridLayouter=In,k.PdfTreeGridRow=Zn,k.PdfTreeGridRowCollection=Yn,k.PdfTreeGridStyle=xn,k.PdfTreeGridStyleBase=Cn,k.ProjectCalendar=da,k.Reorder=qa,k.Resize=Za,k.ResourceFields=Ai,k.RowDD=yn,k.SearchSettings=ii,k.Selection=$a,k.SelectionSettings=gi,k.Sort=Ka,k.SortDescriptor=Wi,k.SortSettings=Ni,k.SplitterSettings=Di,k.TaskCalendar=na,k.TaskFields=wi,k.TemporaryDictionary=Tn,k.TimelineSettings=o,k.TimelineTierSettings=xi,k.Toolbar=Ja,k.TooltipSettings=Mi,k.UndoRedo=hn,k.VirtualScroll=kr,k.WeekWorkingTime=Ki,k.cyclicValidator=xa,k.formatString=Y,k.getIndex=K,k.getRandom=function(){var e=new Uint32Array(1);return window.crypto.getRandomValues(e),e[0]/4294967296},k.getSwapKey=G,k.getTaskData=Z,k.getUid=$,k.getUniversalTime=q,k.isCountRequired=H,k.isEmptyObject=z,k.isRemoteData=_,k.isScheduledTask=j,k.keyPressed="key-pressed",k.load="load",k.parentsUntil=S,k.pixelToPoint=se,k.pointToPixel=oe,k.queryCellInfo="queryCellInfo",k.rowDataBound="rowDataBound",k.toolbarClick=La,k.updateDates=X,Object.defineProperty(k,"__esModule",{value:!0})});
|
|
2
11
|
//# sourceMappingURL=ej2-gantt.umd.min.js.map
|