@grapecity/spread-sheets-ganttsheet
Version:
SpreadJS GanttSheet Plugin
10 lines • 293 kB
JavaScript
/*!
*
* SpreadJS Library 18.2.0
*
* Copyright(c) of respective holders. All rights reserved.
*
* Licensed under the SpreadJS Commercial License.
*
*/
!function(t){"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("@grapecity/spread-sheets")):"function"==typeof define&&define.amd?define(["@grapecity/spread-sheets"],t):"object"==typeof exports?exports.Spread=t(require("@grapecity/spread-sheets")):t(GC)}((function(t){!function(){"use strict";var n,i={"./dist/plugins/gantt/celltypes/complete.js":function(t,n,i){var e,s,r,u,o,h,a=this&&this.qKr||(c=function(t,n){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},c(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}c(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),c;Object.defineProperty(n,"__esModule",{value:!0}),n.TaskCompleteCellType=void 0,e=i("Core"),s=i("./dist/plugins/gantt/celltypes/numberInput.base.js"),r=Math.floor,u=Math.ceil,o=Math.round,h=function(t){function n(){var n=t.call(this)||this;return n.typeName="100",n}return a(n,t),n.prototype.getChangedValue=function(t){var n=t.sheet,i=t.row,e=t.col,s=t.isReservedOnButton,h=n.getValue(i,e);return"Up"===s?h=(5*r(o(100*h)/5)+5)/100:"Down"===s&&(h=(5*u(o(100*h)/5)-5)/100),h<0&&(h=0),h},n}(s.NumberInputCellType),n.TaskCompleteCellType=h,e.CellTypes.ti[100]=h},"./dist/plugins/gantt/celltypes/date.js":function(t,n,i){var e,s,r,u,o,h,a,c=this&&this.qKr||(f=function(t,n){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},f(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}f(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),f;Object.defineProperty(n,"__esModule",{value:!0}),n.TaskDateCellType=void 0,e=i("Common"),s=i("Core"),r=i("./dist/plugins/gantt/gantt.ns.js"),u=new e.Common.ResourceManager(r.SR,"GanttSheet"),o=u.getResource.bind(u),h=function(t){function n(n,i,e){var s=t.call(this,n)||this;return s.sAi=i,s.rAi=e,s}return c(n,t),n.prototype.parse=function(n){var i,e,s,r,u=t.prototype.parse.call(this,n);if(u instanceof Date)if(0===u.getHours()&&0===u.getMinutes()&&0===u.getSeconds()&&0===u.getMilliseconds())try{i=this.sAi,e=n+" ".concat(i.hour,":").concat(i.minute),(s=t.prototype.parse.call(this,e))instanceof Date&&(u=s)}catch(t){}else 1899===u.getFullYear()&&11===u.getMonth()&&30===u.getDate()&&(r=this.rAi,u.setFullYear(r.getFullYear()),u.setMonth(r.getMonth()),u.setDate(r.getDate()));return u},n}(e.Formatter.GeneralFormatter),a=function(t){function n(n){var i=t.call(this)||this;return i.typeName="101",i.hAi=!!n,i}return c(n,t),Object.defineProperty(n.prototype,"forStartDate",{get:function(){return this.hAi},set:function(t){this.hAi=t},enumerable:!1,configurable:!0}),n.prototype.getDefaultTime=function(t){return this.hAi?{hour:8,minute:0}:{hour:17,minute:0}},n.prototype.getDefaultDate=function(t){return new Date},n.prototype.parse=function(t,n,i){var s,r,u,h,a="string"==typeof n?n:o().DEFAULT_DATE_TIME_FORMAT,c=new e.Formatter.GeneralFormatter(a),f=c.parse(t);if(f instanceof Date&&0===f.getHours()&&0===f.getMinutes()&&0===f.getSeconds()&&0===f.getMilliseconds())try{s=this.getDefaultTime(i),r=t+" ".concat(s.hour,":").concat(s.minute),(u=c.parse(r))instanceof Date&&(f=u)}catch(t){}else 1899===f.getFullYear()&&11===f.getMonth()&&30===f.getDate()&&(h=this.getDefaultDate(i),f.setFullYear(h.getFullYear()),f.setMonth(h.getMonth()),f.setDate(h.getDate()));return f},n.prototype.format=function(t,n,i,s){var r="string"==typeof n?n:o().DEFAULT_DATE_TIME_FORMAT,u=new e.Formatter.GeneralFormatter(r);return u.format(t)},n.prototype.je=function(t,n,i,e){var s=n.formatter,r="string"==typeof s?s:o().DEFAULT_DATE_TIME_FORMAT,u=this.getDefaultTime(e),a=this.getDefaultDate(e);return t.Ii=new h(r,u,a),this.format(i,r,null,e)},n}(s.CellTypes.Text),n.TaskDateCellType=a,s.CellTypes.ti[101]=a},"./dist/plugins/gantt/celltypes/duration.js":function(t,n,i){var e,s,r,u,o=this&&this.qKr||(h=function(t,n){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},h(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}h(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),h;Object.defineProperty(n,"__esModule",{value:!0}),n.TaskDurationCellType=void 0,e=i("Core"),s=i("./dist/plugins/gantt/project/calendar.js"),u=function(t){function n(n){void 0===n&&(n=!0);var i=t.call(this,n)||this;return i.typeName="102",i}return o(n,t),n.prototype.oAi=function(t){if(t&&t.sheet&&t.sheet.NMi)return t.sheet.NMi.project},n.prototype.cAi=function(t){return t.row},n.prototype.parse=function(t,n,i){var e=this.oAi(i);return e?e.parseDuration(t):t},n.prototype.format=function(t,n,i,e){var s=this.oAi(e);return s?s.formatDuration(t):t},n.prototype.je=function(t,n,i,e){var s=this.oAi(e);return s?s.formatDuration(i):i},n.prototype.getChangedValue=function(t){var n,i,e=this.oAi(t),r=t.sheet.getValue(t.row,t.col);if(e)return(r=e.parseDuration(r))?(n=r.value,i=r.unit,"Up"===t.isReservedOnButton?n=Math.floor(n+1):"Down"===t.isReservedOnButton&&(n=Math.max(Math.ceil(n-1),0)),r={value:n,unit:i}):r=s.DurationHelper.default(e.calendarSettings),r=e.parseDuration(r)},n}((r=i("./dist/plugins/gantt/celltypes/numberInput.base.js")).NumberInputCellType),n.TaskDurationCellType=u,e.CellTypes.ti[102]=u},"./dist/plugins/gantt/celltypes/numberInput.base.js":function(t,n,i){var e,s,r,u,o,h,a,c,f,l=this&&this.qKr||(d=function(t,n){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},d(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}d(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),d;function v(t,n,i,e,s){var r,u=t.getCellType(n,i,s);if(u instanceof a){e&&t.Ut.do("setValueForKey",n,i,h,!0,s);try{r=t.getCellRect(n,i,s),t.repaint(r)}finally{e&&t.Ut.do("setValueForKey",n,i,h,void 0,s)}}}Object.defineProperty(n,"__esModule",{value:!0}),n.NumberInputCellType=n.NumberInputCellHitInfo=void 0,e=i("Core"),s=5,r=3,u=5,o=8,h="_leaveCell",a=function(t){function n(n){void 0===n&&(n=!0);var i=t.call(this)||this;return i.showButton=n,i.aAi="None",i.typeName="NumberInput",i}return l(n,t),n.prototype.paint=function(n,i,s,r,u,o,h,a){var c=this.isCurrentCellSelected(a.sheet,a.row,a.col),f=h.hAlign;c&&(h.hAlign=e.HorizontalAlign.left),t.prototype.paint.call(this,n,i,s,r,u,o,h,a),c&&this.showButton&&this.paintButtons(n,s,r,u,o,a),h.hAlign=f},n.prototype.isCurrentCellSelected=function(t,n,i){var e=t.Ut.getValueForKey(n,i,h);return t.getActiveRowIndex()===n&&t.getActiveColumnIndex()===i&&!0!==e},n.prototype.paintButtons=function(t,n,i,e,h,a){this.drawTriangleUp(t,n+e-o-s,i+(h-2*r-u)/2,s,r,a),this.drawTriangleDown(t,n+e-o-s,i+(h-2*r-u)/2+r+u,s,r,a)},n.prototype.drawTriangleUp=function(t,n,i,e,s,r){var u="Up"===this.aAi?"black":"gray";t.beginPath(),t.moveTo(n+e/2,i),t.lineTo(n,i+s),t.lineTo(n+e,i+s),t.lineTo(n+e/2,i),t.closePath(),t.strokeStyle=u,t.stroke(),t.fillStyle=u,t.fill()},n.prototype.drawTriangleDown=function(t,n,i,e,s,r){var u="Down"===this.aAi?"black":"gray";t.beginPath(),t.moveTo(n,i),t.lineTo(n+e/2,i+s),t.lineTo(n+e,i),t.lineTo(n,i),t.closePath(),t.strokeStyle=u,t.stroke(),t.fillStyle=u,t.fill()},n.prototype.getButtonHoveredByHitInfo=function(t){var n=t.cellRect,i=t.x,r=t.y,u=new e.Rect(n.x+n.width-o-s-1,n.y,s+2,n.height/2),h=new e.Rect(n.x+n.width-o-s-1,n.y+n.height/2,s+2,n.height/2);return t.sheet.getActiveRowIndex()===t.row&&t.sheet.getActiveColumnIndex()===t.col&&this.showButton?u.contains(i,r)?"Up":h.contains(i,r)?"Down":"None":"None"},n.prototype.refreshButtonHoverEffect=function(t,n,i){(this.aAi!==n||this.fAi&&this.fAi!==i)&&(this.aAi=n,"None"===this.aAi&&this.fAi?(t.repaint(this.fAi),delete this.fAi):(t.repaint(i),this.fAi=i))},n.prototype.getHitInfo=function(t,n,i,s,r){var u,o;if(r&&(null==(u=r.sheetArea)||3===u))return(o={x:t,y:n,row:r.row,col:r.col,cellRect:s,sheetArea:e.SheetArea.viewport,isReservedLocation:!1,sheet:r.sheet,cellStyle:i,isReservedOnButton:"None"}).isReservedOnButton=this.getButtonHoveredByHitInfo(o),o},n.prototype.processMouseMove=function(n){if(n){var i=n.cellRect;return this.refreshButtonHoverEffect(n.sheet,n.isReservedOnButton,i),t.prototype.processMouseMove.call(this,n)}},n.prototype.getChangedValue=function(t){},n.prototype.processMouseDown=function(n){if(n&&n.row===n.sheet.getActiveRowIndex()&&n.col===n.sheet.getActiveColumnIndex()&&"None"!==n.isReservedOnButton){var i=this.getChangedValue(n);return n.sheet.setValue(n.row,n.col,i),t.prototype.processMouseDown.call(this,n)}},n.prototype.processMouseLeave=function(t){return this.refreshButtonHoverEffect(t.sheet,t.isReservedOnButton,t.cellRect),!1},n.prototype.getAutoFitWidth=function(n,i,e,r,u){var h;return t.prototype.getAutoFitWidth.call(this,n,i,e,r,u)+s+2*o},n.prototype.getAutoFitHeight=function(n,i,e,s,o){var h=t.prototype.getAutoFitHeight.call(this,n,i,e,s,o);return Math.max(h,r+3*u)},n.prototype.toJSON=function(){return{typeName:this.typeName}},n}(e.CellTypes.Text),n.NumberInputCellType=a,c=function(){function t(){this.isReservedOnButton="None"}return t}(),n.NumberInputCellHitInfo=c,f="numberInputCellType",e.Worksheet.ch(f,{setHost:function(){var t=this;t.bind(e.Events.EnterCell+"."+f,(function(n,i){v(t,i.row,i.col,!1,i.sheetArea)})),t.bind(e.Events.LeaveCell+"."+f,(function(n,i){v(t,i.row,i.col,!0,i.sheetArea)})),t.bind(e.Events.TopRowChanged+"."+f,(function(n,i){v(t,i.row,i.col,!0,i.sheetArea)}))},dispose:function(t){var n=this;n.unbind(e.Events.EnterCell+"."+f),n.unbind(e.Events.LeaveCell+"."+f),n.unbind(e.Events.TopRowChanged+"."+f)}})},"./dist/plugins/gantt/celltypes/predecessor.js":function(t,n,i){var e,s,r,u,o,h,a,c,f,l,d,v,A=this&&this.qKr||(g=function(t,n){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},g(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}g(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),g;function b(){return{canUndo:!1,execute:function(t,n){var i,r,h,a,c,f=(0,e._f)(t,n.sheetName);return!!(f&&t.jg().name()===n.sheetName&&f.NMi instanceof s.GanttSheet)&&(i=n.row,r=n.col,(u(i)||u(r))&&(n.row=i=f.getActiveRowIndex(),n.col=r=f.getActiveColumnIndex()),h=n.sheetArea,u(h)&&(n.sheetArea=h=3),(a=f.getCellType(i,r,h))instanceof o&&(f.showCell(i,r,e.VerticalPosition.nearest,e.HorizontalPosition.nearest),(c=new v(f.NMi,n)).open(),!0))}}}Object.defineProperty(n,"__esModule",{value:!0}),n.TaskPredecessorCellType=void 0,e=i("Core"),s=i("./dist/plugins/gantt/gantt-sheet.js"),r=i("Common"),u=r.Common.lt.ht,o=function(t){function n(){var n=t.call(this)||this;return n.typeName="103",n}return A(n,t),n.prototype.toJSON=function(){return{typeName:this.typeName}},n}(e.CellTypes.Text),n.TaskPredecessorCellType=o,e.CellTypes.ti[103]=o,h="taskPredecessorCellType",a="data-task-number",c="OpenPredecessor",f="ribbon-dropdowngroup-popup",l="_cellButtonParam",d=window.gcGlobal,v=function(){function t(t,n){var i=this;this.globalMousedownEventHandler=function(t){var n,e;if(i.rf){for(e=n=t.target;e&&e!==i.Wc;)e=e.parentElement;e||(i.close(),t.stopPropagation(),t.preventDefault())}},this.windowResizeEventHandler=function(){i.rf&&i.close()},this.rf=!1,this.lAi=t,this.LEt=n,this.AAi=this.getOriginalValueMap()}return Object.defineProperty(t.prototype,"sheet",{get:function(){return this.lAi.Mf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"project",{get:function(){return this.lAi.project},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.rf||(d.ef(),this.bindEvent(),this.render(),this.clearPosition(),this.calcPosition(),this.scrollListToCurrentItem(),this.attachExpandButtonClick(),this.rf=!0,this.Wc.tabIndex=-1,this.Wc.style.cssText+="outline:none",this.Wc.focus())},t.prototype.dispose=function(){var t=this;document.removeEventListener("resize",this.windowResizeEventHandler),"mousedown touchstart MSPointerDown pointerdown".split(" ").forEach((function(n){document.removeEventListener(n,t.globalMousedownEventHandler,!0)})),this.Ti.parentElement.removeChild(this.Ti),this.Ti=null},t.prototype.close=function(){if(this.rf){this.rf=!1;try{this.setValue()}catch(t){}finally{this.dispose(),this.gAi(),d.cf()}}},t.prototype.gAi=function(){var t,n=this.LEt.row,i=this.LEt.col,e=this.LEt.sheetArea,s=this.sheet.Il(n,i,e).cellButtons;this.sheet&&s&&s.length>0&&(t=this.sheet.Ut.getValueForKey(n,i,l,e))&&t.isMouseDownReservedLocation&&(t.buttonDownIndex=-1,t.isMouseDownReservedLocation=!1,this.sheet.repaint(this.sheet.getCellRect(n,i)))},t.prototype.bindEvent=function(){var t=this;"mousedown touchstart MSPointerDown pointerdown".split(" ").forEach((function(n){document.addEventListener(n,t.globalMousedownEventHandler,!0)})),document.addEventListener("resize",this.windowResizeEventHandler)},t.prototype.render=function(){this.Ti=document.createElement("div"),this.Ti.style.cssText="position:absolute; z-index:10000; box-shadow:rgba(0, 0, 0, 0.4) 2px 4px 5px; outline:none",this.Ti.classList.add(f),this.Wc=document.createElement("div"),this.renderList(),this.Ti.appendChild(this.Wc),this.sheet.qc().appendChild(this.Ti)},t.prototype.renderList=function(){var t,n;this.Wc.classList.add("gc-list-control"),this.Wc.style.outline="none",(t=document.createElement("div")).className="gc-list-control-container gc-list-alignment-vertical",t.style.maxHeight="300px",t.style.maxWidth="500px",t.style.overflow="auto",this.Wc.appendChild(t),n=this.project.root,this.renderTaskTree(n,t)},t.prototype.scrollListToCurrentItem=function(){var t,n=this.project.getRowState(this.LEt.row).taskNumber,i=document.querySelector("[".concat(a,'="').concat(n,'"]'));i&&(t=i.parentElement.parentElement.offsetTop,document.querySelector(".gc-list-control-container").scrollTop=t)},t.prototype.attachExpandButtonClick=function(){var t=this;this.Wc.addEventListener("click",(function(n){var i=n.target;i.hasAttribute("data-open")&&(t.setButtonExpandStatus(i,"false"===i.getAttribute("data-open")),n.preventDefault(),n.stopImmediatePropagation())}))},t.prototype.renderTaskTree=function(t,n){var i,e=this,s=this.project.Pki(t),r=document.createElement("div");r.className="gc-list-control-tree",n.appendChild(r),s||this.renderTaskItem(t,!0,r),(i=document.createElement("div")).className="gc-list-control-tree-content gc-list-alignment-vertical",s||(i.style.marginLeft="1.5em"),r.appendChild(i),t.children.forEach((function(t){t.children.length>0?e.renderTaskTree(t,i):e.renderTaskItem(t,!1,i)}))},t.prototype.renderTaskItem=function(t,n,i){var e,s,r,u,o,h=this.project.getRowState(this.LEt.row).task,c=Object.keys(this.AAi).map((function(t){return parseInt(t)})),f=document.createElement("div");f.classList.add("gc-list-control-item"),n&&f.classList.add("gc-list-control-hassubitem"),(e=document.createElement("label")).setAttribute("for","task-".concat(t.taskNumber)),e.className="gc-list-control-tree-text",e.style.display="flex",e.style.alignItems="center",n&&((s=document.createElement("span")).style.display="inline-flex",s.style.transition="0.2s linear",s.style.borderLeft="5px solid transparent",s.style.borderRight="5px solid transparent",s.style.borderTop="6px solid #000",this.setButtonExpandStatus(s,!0),e.appendChild(s)),h&&h.taskNumber===t.taskNumber?((r=document.createElement("span")).id="task-".concat(t.taskNumber),r.style.width="23px",r.style.height="18px",r.style.display="inline-block",r.setAttribute(a,t.taskNumber.toString()),e.appendChild(r),e.style.backgroundColor="#E1E1E1",e.style.cursor="default"):((u=document.createElement("input")).id="task-".concat(t.taskNumber),u.type="checkbox",u.style.marginLeft="5px",u.style.marginRight="5px",u.setAttribute(a,t.taskNumber.toString()),c.indexOf(t.taskNumber)>-1&&(u.checked=!0),e.appendChild(u)),(o=document.createElement("span")).innerText="".concat(t.taskNumber," ").concat(t.name?t.name:""),this.setTextSpanEllipsis(o),e.appendChild(o),f.appendChild(e),i.appendChild(f)},t.prototype.setButtonExpandStatus=function(t,n){for(var i=t;i&&!i.classList.contains("gc-list-control-tree");)i=i.parentElement;n?(t.style.removeProperty("transform"),t.setAttribute("data-open","true"),i&&i.classList.remove("hide-children")):(t.style.transform="rotate(-90deg)",t.setAttribute("data-open","false"),i&&i.classList.add("hide-children"))},t.prototype.setTextSpanEllipsis=function(t){t.style.overflow="hidden",t.style.textOverflow="ellipsis",t.style.whiteSpace="nowrap",t.title=t.innerText},t.prototype.clearPosition=function(){this.Ti.style.top=this.Ti.style.bottom=this.Ti.style.left=this.Ti.style.right=""},t.prototype.getTargetRect=function(){var t=1===this.LEt.sheetArea?-1:void 0,n=2===this.LEt.sheetArea?-1:void 0,i=this.sheet.getCellRect(this.LEt.row,this.LEt.col,t,n);return i.x=this.sheet.uw().left+i.x,i.y=this.sheet.uw().top+i.y,i},t.prototype.calcPosition=function(){var t=this.calculateDropDownLocation(),n=this.Ti.offsetParent,i=n.getBoundingClientRect(),e=n===document.body,s=document.documentElement,r=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),u=(window.pageYOffset||s.scrollTop)-(s.clientTop||0);this.Ti.style.left="".concat(t.x-(e?-r:i.left),"px"),this.Ti.style.top="".concat(t.y-(e?-u:i.top),"px")},t.prototype.calculateDropDownLocation=function(){var t,n,i,s=new e.Rect(0,0,window.innerWidth,window.innerHeight),r=this.getTargetRect(),u=r.x+r.width,o=r.y,h=r.y+r.height,a=s.height-h,c=!0,f=this.Wc.offsetHeight,l=this.Wc.offsetWidth;return f>a&&(c=!1),t=u-l,n=0,n=c?h:o-f,(i=new e.Rect(t,n,l,f)).width>s.width?i.x=0:(i.x=Math.max(i.x,0),i.x=Math.min(i.x,s.width-i.width)),i.height>s.height?i.y=0:(i.y=Math.max(i.y,0),i.y=Math.min(i.y,s.height-i.height)),{x:i.x,y:i.y}},t.prototype.getOriginalValueMap=function(){var t=this.sheet.getValue(this.LEt.row,this.LEt.col),n=/^(\d*)[^\d]*$/,i={};return t?(t.split(",").forEach((function(t){if(t.match(n)){var e=t.match(n)[1];i[e]=t.match(n)[0]}})),i):{}},t.prototype.getSelectedValuesInList=function(){var t=this.AAi,n=this.Wc.querySelectorAll(".gc-list-control-item input:checked"),i=[];return n.forEach((function(n){var e=parseInt(n.getAttribute(a));t[e]?i.push(t[e]):i.push(e.toString())})),i.join(",")},t.prototype.setValue=function(){var t,n,i,e,s,r=this.sheet,o=this.getSelectedValuesInList(),h=this.LEt.row,a=this.LEt.col,c=this.LEt.sheetArea;if(r.isEditing()&&r.ci===a&&r.ui===h)t=r.getCellType(h,a),n={sheet:r,row:h,col:a,sheetArea:c},i=r.Il(h,a,c),e=r.getCellRect(h,a),t.updateEditor(r.li,i,e,n),t.setEditorValue(r.li,o,n);else{if(s=r.getValue(h,a),u(s)&&""===o)return;o!==s&&r.setValue(h,a,o)}},t}(),e.Workbook.ch(h,{init:function(){this.commandManager().register(c,b())}})},"./dist/plugins/gantt/celltypes/resources.js":function(t,n,i){var e,s,r,u,o,h,a,c,f,l,d,v,A=this&&this.qKr||(g=function(t,n){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},g(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}g(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),g;function b(){return{canUndo:!1,execute:function(t,n){var i,r,h,a,c,f=(0,e._f)(t,n.sheetName);return!!(f&&t.jg().name()===n.sheetName&&f.NMi instanceof s.GanttSheet)&&(i=n.row,r=n.col,(u(i)||u(r))&&(n.row=i=f.getActiveRowIndex(),n.col=r=f.getActiveColumnIndex()),h=n.sheetArea,u(h)&&(n.sheetArea=h=3),(a=f.getCellType(i,r,h))instanceof o&&(f.showCell(i,r,e.VerticalPosition.nearest,e.HorizontalPosition.nearest),(c=new v(f.NMi,n)).open(i),!0))}}}Object.defineProperty(n,"__esModule",{value:!0}),n.TaskResourcesCellType=void 0,e=i("Core"),s=i("./dist/plugins/gantt/gantt-sheet.js"),r=i("Common"),u=r.Common.lt.ht,o=function(t){function n(){var n=t.call(this)||this;return n.typeName="104",n}return A(n,t),n.prototype.toJSON=function(){return{typeName:this.typeName}},n}(e.CellTypes.Text),n.TaskResourcesCellType=o,e.CellTypes.ti[104]=o,h="taskResourcesCellType",a="data-resource-id",c="OpenResources",f="ribbon-dropdowngroup-popup",l="_cellButtonParam",d=window.gcGlobal,v=function(){function t(t,n){var i=this;this.globalMousedownEventHandler=function(t){var n,e;if(i.rf){for(e=n=t.target;e&&e!==i.Wc;)e=e.parentElement;e||(i.close(),t.stopPropagation(),t.preventDefault())}},this.windowResizeEventHandler=function(){i.rf&&i.close()},this.rf=!1,this.lAi=t,this.LEt=n,this.AAi=this.getOriginalValueMap()}return Object.defineProperty(t.prototype,"sheet",{get:function(){return this.lAi.Mf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"project",{get:function(){return this.lAi.project},enumerable:!1,configurable:!0}),t.prototype.open=function(t){var n,i,e,s;if(!this.rf){if(n=this.lAi.getTaskByRow(t),e=(i=this.project.host.getDataView()).gLt.primaryKey(),s=n.getDataValue(e),u(s))return!1;d.ef(),this.bindEvent(),this.render(),this.clearPosition(),this.calcPosition(),this.rf=!0,this.Wc.tabIndex=-1,this.Wc.style.cssText+="outline:none",this.Wc.focus()}},t.prototype.dispose=function(){var t=this;document.removeEventListener("resize",this.windowResizeEventHandler),"mousedown touchstart MSPointerDown pointerdown".split(" ").forEach((function(n){document.removeEventListener(n,t.globalMousedownEventHandler,!0)})),this.Ti.parentElement.removeChild(this.Ti),this.Ti=null},t.prototype.close=function(){if(this.rf){this.rf=!1;try{this.setValue()}catch(t){}finally{this.dispose(),this.gAi(),d.cf()}}},t.prototype.gAi=function(){var t,n=this.LEt.row,i=this.LEt.col,e=this.LEt.sheetArea,s=this.sheet.Il(n,i,e).cellButtons;this.sheet&&s&&s.length>0&&(t=this.sheet.Ut.getValueForKey(n,i,l,e))&&t.isMouseDownReservedLocation&&(t.buttonDownIndex=-1,t.isMouseDownReservedLocation=!1,this.sheet.repaint(this.sheet.getCellRect(n,i)))},t.prototype.bindEvent=function(){var t=this;"mousedown touchstart MSPointerDown pointerdown".split(" ").forEach((function(n){document.addEventListener(n,t.globalMousedownEventHandler,!0)})),document.addEventListener("resize",this.windowResizeEventHandler)},t.prototype.render=function(){this.Ti=document.createElement("div"),this.Ti.style.cssText="position:absolute; z-index:10000; box-shadow:rgba(0, 0, 0, 0.4) 2px 4px 5px; outline:none",this.Ti.classList.add(f),this.Wc=document.createElement("div"),this.renderList(),this.Ti.appendChild(this.Wc),this.sheet.qc().appendChild(this.Ti)},t.prototype.renderList=function(){var t,n,i;for(this.Wc.classList.add("gc-list-control"),this.Wc.style.outline="none",(t=document.createElement("div")).className="gc-list-control-container gc-list-alignment-vertical",t.style.maxHeight="300px",t.style.maxWidth="500px",t.style.overflow="auto",this.Wc.appendChild(t),n=this.project.resourcesManager.resourcesList,i=0;i<n.length;i++)this.renderResource(n[i],t)},t.prototype.renderResource=function(t,n){var i=document.createElement("div");i.className="gc-list-control-tree",n.appendChild(i),this.renderResourceItem(t,!0,i)},t.prototype.renderResourceItem=function(t,n,i){var e,s,r,u=t.id,o=t.name,h=Object.keys(this.AAi),c=document.createElement("div");c.classList.add("gc-list-control-item"),n&&c.classList.add("gc-list-control-hassubitem"),(e=document.createElement("label")).setAttribute("for","resource-".concat(u)),e.className="gc-list-control-tree-text",e.style.display="flex",e.style.alignItems="center",(s=document.createElement("input")).id="resource-".concat(u),s.type="checkbox",s.style.marginLeft="5px",s.style.marginRight="5px",s.setAttribute(a,u.toString()||""),h.indexOf(u.toString())>-1&&(s.checked=!0),e.appendChild(s),(r=document.createElement("span")).innerText="".concat(o||""),this.setTextSpanEllipsis(r),e.appendChild(r),c.appendChild(e),i.appendChild(c)},t.prototype.setTextSpanEllipsis=function(t){t.style.overflow="hidden",t.style.textOverflow="ellipsis",t.style.whiteSpace="nowrap",t.title=t.innerText},t.prototype.clearPosition=function(){this.Ti.style.top=this.Ti.style.bottom=this.Ti.style.left=this.Ti.style.right=""},t.prototype.getTargetRect=function(){var t=1===this.LEt.sheetArea?-1:void 0,n=2===this.LEt.sheetArea?-1:void 0,i=this.sheet.getCellRect(this.LEt.row,this.LEt.col,t,n);return i.x=this.sheet.uw().left+i.x,i.y=this.sheet.uw().top+i.y,i},t.prototype.calcPosition=function(){var t=this.calculateDropDownLocation(),n=this.Ti.offsetParent,i=n.getBoundingClientRect(),e=n===document.body,s=document.documentElement,r=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),u=(window.pageYOffset||s.scrollTop)-(s.clientTop||0);this.Ti.style.left="".concat(t.x-(e?-r:i.left),"px"),this.Ti.style.top="".concat(t.y-(e?-u:i.top),"px")},t.prototype.calculateDropDownLocation=function(){var t,n,i,s=new e.Rect(0,0,window.innerWidth,window.innerHeight),r=this.getTargetRect(),u=r.x+r.width,o=r.y,h=r.y+r.height,a=s.height-h,c=!0,f=this.Wc.offsetHeight,l=this.Wc.offsetWidth;return f>a&&(c=!1),t=u-l,n=0,n=c?h:o-f,(i=new e.Rect(t,n,l,f)).width>s.width?i.x=0:(i.x=Math.max(i.x,0),i.x=Math.min(i.x,s.width-i.width)),i.height>s.height?i.y=0:(i.y=Math.max(i.y,0),i.y=Math.min(i.y,s.height-i.height)),{x:i.x,y:i.y}},t.prototype.getOriginalValueMap=function(){var t=this,n=this.sheet.getValue(this.LEt.row,this.LEt.col),i={};return n?(n.forEach((function(n){var e=t.project.resourcesManager.getResourcesByName(n).id;i[e]=n})),i):{}},t.prototype.getSelectedValuesInList=function(){var t=this,n=this.AAi,i=this.Wc.querySelectorAll(".gc-list-control-item input:checked"),e=[];return i.forEach((function(i){var s,r=parseInt(i.getAttribute(a));n[r]?e.push(n[r]):(s=t.project.resourcesManager.getResourcesById(r),e.push(s.name))})),e},t.prototype.setValue=function(){var t=this.sheet,n=this.getSelectedValuesInList(),i=this.LEt.row,e=this.LEt.col;t.setValue(i,e,n)},t}(),e.Workbook.ch(h,{init:function(){this.commandManager().register(c,b())}})},"./dist/plugins/gantt/celltypes/subject.js":function(t,n,i){var e,s,r=this&&this.qKr||(u=function(t,n){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},u(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}u(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),u;Object.defineProperty(n,"__esModule",{value:!0}),n.TaskSubjectCellType=void 0,s=function(t){function n(){var n=t.call(this)||this;return n.typeName="105",n}return r(n,t),n.prototype.cAi=function(t){return t.row},n.prototype.toJSON=function(){return{typeName:this.typeName}},n}((e=i("Core")).CellTypes.Text),n.TaskSubjectCellType=s,e.CellTypes.ti[105]=s},"./dist/plugins/gantt/celltypes/taskbar.js":function(t,n,i){var e,s,r,u,o,h,a,c,f,l,d,v,A,g=this&&this.qKr||(b=function(t,n){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},b(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}b(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),b;Object.defineProperty(n,"__esModule",{value:!0}),n.TaskbarCellType=n.TipSettings=void 0,e=i("Common"),s=i("Core"),r=i("./dist/plugins/gantt/utils/util.js"),u=i("./dist/plugins/gantt/gantt-json.js"),o=i("./dist/plugins/gantt/taskbar/action.js"),h=i("./dist/plugins/gantt/gantt.enum.js"),a=i("./dist/plugins/gantt/gantt.ns.js"),c=new e.Common.ResourceManager(a.SR,"GanttSheet"),f=c.getResource.bind(c),l=s.mt.vi,d=s.CellTypes.Base,v=function(){function t(t){this.className=t}return t.prototype.getContent=function(){return'\n <div class="'.concat(this.className,'" style="padding:4px;font-size:14px;color:black;max-width:500px">\n <div style="overflow:hidden;text-overflow:ellipsis;">\n <div class="gantt-tip-title" style="text-align:center">').concat(r.GanttUtil.encodeHtml(this.title),"</div>\n ").concat(this.getBodyString(),"\n </div>\n </div>")},t.prototype.getBodyString=function(){var t,n="";for(t in this.body)this.body.hasOwnProperty(t)&&(n+='<div>\n <span class="gantt-tip-key">'.concat(r.GanttUtil.encodeHtml(this.body[t][0]),'</span>\n <span class="gantt-tip-value">').concat(r.GanttUtil.encodeHtml(this.body[t][1]),"</span>\n </div>"));return n},t.prototype.addTaskTipItems=function(t,n){var i=this;this.body||(this.body=[]),n.forEach((function(n){i.addTaskItemDictionary[n]&&i.addTaskItemDictionary[n](t)}))},Object.defineProperty(t.prototype,"addTaskItemDictionary",{get:function(){var t=this;return{name:function(n){t.addNameItem(n)},start:function(n){t.addStartItem(n)},finish:function(n){t.addFinishItem(n)},duration:function(n){t.addDurationItem(n)},"%complete":function(n){t.addCompleteTextItem(n)},completeThrough:function(n){t.addCompleteThroughItem(n)}}},enumerable:!1,configurable:!0}),t.prototype.addNameItem=function(t){t.name?this.body.push([f().GANTT_ACTION_TASK_COLON,t.name]):this.body.push([f().GANTT_ACTION_TASK_COLON,f().GANTT_TASK_BAR_UNNAMED])},t.prototype.addStartItem=function(t){var n=new e.Formatter.GeneralFormatter(t.project.layout.tipDateFormat);this.body.push([f().GANTT_ACTION_TASK_START,n.format(t.startDisplayed)])},t.prototype.addFinishItem=function(t){var n=new e.Formatter.GeneralFormatter(t.project.layout.tipDateFormat);this.body.push([f().GANTT_ACTION_TASK_FINISH,n.format(t.finishDisplayed)])},t.prototype.addDurationItem=function(t){t.duration&&this.body.push([f().GANTT_ACTION_DURATION,t.project.formatDuration(t.duration)])},t.prototype.addCompleteThroughItem=function(t){var n=new e.Formatter.GeneralFormatter(t.project.layout.tipDateFormat);t.completeThrough&&this.body.push([f().GANTT_TASK_BAR_COMPLETE_THROUGH,n.format(t.completeThrough)])},t.prototype.addCompleteTextItem=function(t){var n=new e.Formatter.GeneralFormatter("0%");this.body.push([f().GANTT_TASK_BAR_COMPLETE,n.format(t.complete)])},t.getDefaultTaskHoverTipItems=function(t){switch(t){case"progress":case"manualProgress":return["name","start","completeThrough","duration","%complete"];case"milestone":case"manualMilestone":case"finishOnlyMilestone":case"durationOnlyMilestone":case"finishOnly":return["name","finish"];case"startOnly":case"startOnlyMilestone":return["name","start"];default:return["name","start","finish","duration"]}},t}(),n.TipSettings=v,A=function(t){function n(n){void 0===n&&(n=0);var i=t.call(this)||this;return i.typeName="106",i.IOProps=["typeName","leftTextStyle","topTextStyle","rightTextStyle","bottomTextStyle","insideTextStyle","showDefaultTips","allowMoveOrResizeTask","allowLinkTask","allowChangeProgress","allowDragNewTask"],i.leftTextStyle={},i.topTextStyle={},i.rightTextStyle={},i.bottomTextStyle={},i.insideTextStyle={},i.showDefaultTips=!0,i.allowMoveOrResizeTask=!0,i.allowLinkTask=!0,i.allowChangeProgress=!0,i.allowDragNewTask=!0,i.dAi=n,i}return g(n,t),n.prototype.oAi=function(t){if(t&&t.sheet&&t.sheet.NMi)return t.sheet.NMi.project},n.prototype.cAi=function(t){return t.row-this.dAi},n.prototype.An=function(t,n,i){return t.clone()},n.prototype.paintValue=function(t,n,i,e,s,r,u,o){var a,c,f,l=o.sheet,d=this.oAi(o);t&&d&&s>0&&r>0&&(t.save(),t.rect(i,e,s,r),t.clip(),a=this.cAi(o),c=d.getTaskByRow(a),f=l.NMi.lki,o.offsetX=0,f.paintTask(t,c,i,e,s,r,u,o,this,this.paintTextCore),f.paintLinkLines(t,d,c,a,i,e,s,r),this.barAction&&this.barAction.actionStatus===h.ActionStatus.InProgress&&f.paintActionPending(t,this.barAction),t.restore())},n.prototype.paintTextCore=function(n,i,e,s,r,u,o,h){t.prototype.paintValue.call(this,n,i,e,s,r,u,o,h)},n.prototype.getHitInfo=function(t,n,i,e,r){var u,o,h,a,c,f;return r&&r.sheetArea===s.SheetArea.viewport&&e?(u=r.sheetArea,o=e.x,h=e.x+e.width,a=e.y,c=e.y+e.height,f={x:t,y:n,row:r.row,col:r.col,cellRect:e,sheetArea:u,sheet:r.sheet,cellStyle:i},o<=t&&t<=h&&a<=n&&n<=c&&(f.isReservedLocation=!0),f):null},n.prototype.processMouseDown=function(t){var n,i,e=t&&t.sheet;if(!e||!t.isReservedLocation)return!1;(n=this.oAi(t))&&((i=o.BarActionBuilder.getBarHitInfo(n,this,t)).task&&(e.clearSelection(),e.setActiveCell(t.row,t.col),e.addSelection(t.row,0,1,e.getColumnCount()-1)),this.barAction=o.BarActionBuilder.getHitAction(n,this,i),this.barAction&&this.barAction.start())},n.prototype.processMouseMove=function(t){var n,i,e,s,r,u,a,c=t&&t.sheet;if(!c||!t.isReservedLocation)return!1;(n=this.oAi(t))&&(this.barAction||(e=void 0,(i=o.BarActionBuilder.getBarHitInfo(n,this,t))&&i.task?(o.BarActionBuilder.updateCursorByBarHitInfo(c.Dg(),n,this,i),e=this.bAi(i.task,i.style),s={task:i.task,partName:i.style.name,tip:e},c.ki(h.GanttSheetEvent.Event_HoverOnBar,s),e=s.tip):(o.BarActionBuilder.updateCursorStyle(c.Dg(),h.CursorStyle.Default),(r=this.mAi(t))&&(s={dependency:r,tip:e=this.pAi(r)},c.ki(h.GanttSheetEvent.Event_HoverOnLink,s),e=s.tip)),e&&this.showDefaultTips&&(u=e.getContent(),(a=c.parent).Tw(u,0,0),a.R3.style.whiteSpace="normal",a.ny(u,t.x-25-a.R3.offsetWidth,t.y-25))))},n.prototype.bAi=function(t,n){var i,e;if(t&&n)return(e=new v((i="gc-gantt-hover-on-")+n.name)).title=n.name,e.addTaskTipItems(t,v.getDefaultTaskHoverTipItems(n.name)),e},n.prototype.pAi=function(t){var n,i;if(t)return(i=new v((n="gc-gantt-hover-on-")+"link")).title="",i.body=[[f().GANTT_TASK_BAR_TASK_LINK,this.getDependencyTypeText(t.type)],[f().GANTT_TASK_BAR_FROM,"(ID ".concat(t.from.taskNumber,") ").concat(t.from.name)],[f().GANTT_TASK_BAR_TO,"(ID ".concat(t.to.taskNumber,") ").concat(t.to.name)]],i},n.prototype.getDependencyTypeText=function(t){switch(t){case"FS":return f().GANTT_TASK_BAR_FS;case"FF":return f().GANTT_TASK_BAR_FF;case"SF":return f().GANTT_TASK_BAR_SF;case"SS":return f().GANTT_TASK_BAR_SS}},n.prototype.mAi=function(t){var n,i,e,s,r=t&&t.sheet,u=r.NMi.lki,o=this.cAi(t),h=u.getLinkLines(o,t.cellRect);for(i=0,e=h;i<e.length;i++)(s=e[i]).contains({x:t.x,y:t.y})&&(n=s.data);return n},n.prototype.isReservedKey=function(t,n){return 32===t.keyCode&&!t.ctrlKey&&!t.shiftKey&&!t.altKey},n.prototype.getAutoFitWidth=function(t,n,i,e,s){var r,u,o,h,a,c,f,l,d,v,A,g,b=s.sheet,m=b.NMi,p=m.gp();if(p)return m.wAi()*e;if(r=b.ot().width,u=0,o=b.OF())for(h=0,a=o;h<a.length;h++)u+=f=(c=a[h]).width;if(l=0,d=b.m9())for(v=m.getGanttColumnIndex(),A=0,g=d;A<g.length;A++)(c=g[A]).col!==v&&(l+=f=c.width);return r-u-l},n.prototype.getAutoFitHeight=function(n,i,e,s,r){var u=r.sheet.NMi.lki;return u?u.getBarStyleRowHeight()*s:t.prototype.getAutoFitHeight.call(this,n,i,e,s,r)},n.prototype.QD=function(t){this.isReservedKey(t)&&l(t)},n.prototype.isImeAware=function(t){return!1},n.prototype.jn=function(t){},n.prototype.Ke=function(){},n.prototype.toJSON=function(){return u.GanttSheetJsonConverter.toJSON(this,this.IOProps)},n.prototype.fromJSON=function(t){u.GanttSheetJsonConverter.fromJSON(this,t,this.IOProps)},n.prototype.activeOnClick=function(){return!1},n}(d),n.TaskbarCellType=A,s.CellTypes.ti[106]=A},"./dist/plugins/gantt/celltypes/timescales.js":function(t,n,i){var e,s,r,u,o,h,a,c,f,l,d,v,A,g,b,m,p=this&&this.qKr||(y=function(t,n){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},y(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}y(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),y;function w(t,n){return g*t*n+5}Object.defineProperty(n,"__esModule",{value:!0}),n.TimescaleCellType=n.getTimescaleHeight=void 0,e=i("Core"),s=i("./dist/plugins/gantt/gantt-column.js"),r=i("./dist/plugins/gantt/gantt-json.js"),u=i("./dist/plugins/gantt/project/calendar.js"),o=i("./dist/plugins/gantt/gantt.enum.js"),h=i("Common"),a=h.Common.lt.ht,c=e.mt.vi,f=e.CellTypes.Context,l=e.CellTypes.Base,d=e.GC$,v=null,A=void 0,g=18,n.getTimescaleHeight=w,b=function(){function t(t,n){this.lAi=t,this.startX=n,this.yAi=!1}return Object.defineProperty(t.prototype,"sheet",{get:function(){return this.lAi.Mf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"project",{get:function(){return this.lAi.project},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.jAi=this.project.timescale.currentDateUtc,this.yAi=!1,this.sheet.Dg().style.cursor="grabbing",this.Fg()},t.prototype.Fg=function(){var t=this;d(document).bind("mousemove.ganttSheet.timescale",(function(n){t.pg(n)})).bind("mouseup.ganttSheet.timescale",(function(n){t.bg(n)}))},t.prototype.OAi=function(){d(document).unbind("mousemove.ganttSheet.timescale").unbind("mouseup.ganttSheet.timescale")},t.prototype.pg=function(t){var n,i,e,s,r;this.sheet&&(n=this.sheet.uw(),i=t.pageX-n.left,e=t.pageY-n.top,s=this.sheet.hitTest(i,e),r=this.startX-s.x-this.getScrollDistance(),this.project.timescale.scroll(r))},t.prototype.getScrollDistance=function(){return-this.project.timescale.getOffsetByDateUtc(this.jAi)},t.prototype.bg=function(t){this.OAi(),this.yAi=!0,delete this.jAi},t.prototype.isFinish=function(){return this.yAi},t}(),m=function(t){function n(){var n=t.call(this)||this;return n.typeName="107",n.marginTop=2,n.marginBottom=2,n.backColor="#f0f0f0",n.topTierTextStyle={},n.middleTierTextStyle={},n.bottomTierTextStyle={},n.allowDragScroll=!0,n.IOProps=["typeName","allowDragScroll","topTierTextStyle","middleTierTextStyle","bottomTierTextStyle"],n}return p(n,t),n.prototype.oAi=function(t){if(t&&t.sheet&&t.sheet.NMi)return t.sheet.NMi.project},n.prototype.paintValue=function(t,n,i,s,r,u,o,h){if(t&&r>0&&u>0){t.save(),t.rect(i,s,r,u),t.clip(),t.beginPath();var a=void 0;a=this.backColor,t.fillStyle!==a&&(t.fillStyle=a),e.W.setFillStyle(t,a,i,s,r,u,(function(){t.fillRect(i,s,r,u)})),this.paintTimescales(t,i,s,r,u,h),t.restore()}},n.prototype.paintTimescales=function(t,n,i,r,u,h){var a,c,f,l,d=h.sheet.zoom(),v=g*d+this.marginTop,A=this.oAi(h);if(A)switch(a=A.timescale,c=new e.Style,f=new e.Style,l=new e.Style,this.topTierTextStyle&&(0,s.mergeTextStyle)(this.topTierTextStyle,c),this.middleTierTextStyle&&(0,s.mergeTextStyle)(this.middleTierTextStyle,f),this.bottomTierTextStyle&&(0,s.mergeTextStyle)(this.bottomTierTextStyle,l),h.offsetX=0,a.tierMode){case o.TimescaleTierMode.middle:u-v>=0&&(this.paintSeparatorLine(t,n,i+u-.5,r,a),this.paintTier(t,n,i+u-v,r,v,f,A,a.middleTier,h));break;case o.TimescaleTierMode.middleBottom:u-2*v>=0&&(this.paintSeparatorLine(t,n,i+u-.5,r,a),this.paintTier(t,n,i+u-v,r,v,l,A,a.bottomTier,h),this.paintTier(t,n,i+u-2*v,r,v,f,A,a.middleTier,h));break;case o.TimescaleTierMode.topMiddleBottom:u-3*v>=0&&(this.paintSeparatorLine(t,n,i+u-.5,r,a),this.paintTier(t,n,i+u-v,r,v,l,A,a.bottomTier,h),this.paintTier(t,n,i+u-2*v,r,v,f,A,a.middleTier,h),this.paintSeparatorLine(t,n,i+u-2*v-.5,r,a),this.paintTier(t,n,i+u-3*v,r,v,c,A,a.topTier,h))}},n.prototype.paintTier=function(t,n,i,s,r,o,h,c,f){var d,v,g,b,m,p,y,w,j,T,O,k=this;if(!a(c))for(v=d=h.timescale.currentDateUtc,g=o,b=c.labelAlign||"Left",g.hAlign="Left"===b?e.HorizontalAlign.left:"Center"===b?e.HorizontalAlign.center:e.HorizontalAlign.right;p=(m=h.timescale.getDateUtcRange(v,c.unit,c.count))[0],y=m[1],!((w=n+h.timescale.getOffsetByDateUtc(p))>=n+s);)j=n+h.timescale.getOffsetByDateUtc(y)+.5,j=Math.floor(j)+.5,T=c.formatDate(u.Calendar.utcToLocal(p)),O={},l.prototype.paintText.call(k,t,T,w,i,j-w,r,g,f,T,O,A,A),c.showTickLines&&(t.beginPath(),t.moveTo(j,i),t.lineTo(j,i+r),t.strokeStyle="gray",t.stroke()),v=y},n.prototype.paintSeparatorLine=function(t,n,i,e,s){s.showScaleSeparator&&(t.beginPath(),t.moveTo(n,i),t.lineTo(n+e,i),t.strokeStyle="gray",t.stroke())},n.prototype.getText=function(t,n){return t},n.prototype.getHitInfo=function(t,n,i,e,s){var r,u,o,h,a,c,f=this;return s?(r=s.sheetArea,u=e.x,o=e.x+e.width,h=e.y+f.marginTop,a=e.y+e.height-f.marginBottom,c={x:t,y:n,row:s.row,col:s.col,cellRect:e,sheetArea:r,sheet:s.sheet,cellStyle:i},u<=t&&t<=o&&h<=n&&n<=a&&(c.isReservedLocation=!0),c):v},n.prototype.processMouseDown=function(t){var n,i=this.oAi(t);return!!i&&(!!((n=t&&t.sheet)&&t.isReservedLocation&&this.allowDragScroll)&&(this.TAi=new b(t.sheet.NMi,t.x),this.TAi.start(),!0))},n.prototype.processMouseMove=function(t){this.allowDragScroll&&(this.TAi&&!this.TAi.isFinish()||(t.sheet.Dg().style.cursor="grab"),this.TAi&&!this.TAi.isFinish()&&(t.sheet.Dg().style.cursor="grabbing"))},n.prototype.processKeyDown=function(t,n){return!1},n.prototype.processKeyUp=function(t,n){return!1},n.prototype.isReservedKey=function(t,n){return 32===t.keyCode&&!t.ctrlKey&&!t.shiftKey&&!t.altKey},n.prototype.getAutoFitWidth=function(t,n,i,e,s){return f.Bt(t,n,i,e,s)},n.prototype.getAutoFitHeight=function(t,n,i,e,s){var r=this.oAi(s);return w(r?r.timescale.tierMode:o.TimescaleTierMode.middle,s.sheet.zoom())},n.prototype.QD=function(t){this.isReservedKey(t)&&c(t)},n.prototype.isImeAware=function(t){return!1},n.prototype.jn=function(t){},n.prototype.Ke=function(){},n.prototype.activeOnClick=function(){return!1},n.prototype.toJSON=function(){return r.GanttSheetJsonConverter.toJSON(this,this.IOProps)},n.prototype.fromJSON=function(t){r.GanttSheetJsonConverter.fromJSON(this,t,this.IOProps)},n}(l),n.TimescaleCellType=m,e.CellTypes.ti[107]=m},"./dist/plugins/gantt/gantt-action.js":function(t,n,i){var e,s,r,u,o,h,a,c,f,l=this&&this.iJr||function(t,n,i){if(i||2===arguments.length)for(var e=0,s=n.length,r;e<s;e++)!r&&e in n||(r||(r=Array.prototype.slice.call(n,0,e)),r[e]=n[e]);return t.concat(r||Array.prototype.slice.call(n))};function d(t){return t instanceof r.GanttSheet}function v(t){var n;t.commandManager().addListener("ganttSheetCleanUndo",(function(n){var i=n.command,e=n.vM,s=t.Wp.Nmt;0===e&&s&&s.length>0&&d(t.Ofe(i.sheetName))&&s.pop()}))}function A(t,n){var i,e=new Array(t);for(i=0;i<t;i++)e[i]=n();return e}Object.defineProperty(n,"__esModule",{value:!0}),e=i("Common"),s=i("Core"),r=i("./dist/plugins/gantt/gantt-sheet.js"),u=i("./dist/plugins/gantt/gantt.enum.js"),o=i("./dist/plugins/gantt/utils/util.js"),h=i("./dist/plugins/gantt/gantt.ns.js"),a=new e.Common.ResourceManager(h.SR,"GanttSheet"),c=a.getResource.bind(a),f=e.Common.lt.ht,s.Commands[u.GanttCommandNames.GANTTSHEET_TIMESCALE_PAGE_UP]={canUndo:!1,execute:function(t,n){var i,e,s,r=o.GanttUtil.getGanttSheet(t);if(r)return(i=r.project)&&(e=i.timescale,s=r.getTaskbarAreaVisibleSize(),e.scroll(-1*s)),!1}},s.Commands[u.GanttCommandNames.GANTTSHEET_TIMESCALE_PAGE_DOWN]={canUndo:!1,execute:function(t,n){var i,e,s,r=o.GanttUtil.getGanttSheet(t);if(r)return(i=r.project)&&(e=i.timescale,s=r.getTaskbarAreaVisibleSize(),e.scroll(s)),!1}},s.Commands[u.GanttCommandNames.GANTTSHEET_TIMESCALE_BEGIN]={canUndo:!1,execute:function(t,n){var i,e=o.GanttUtil.getGanttSheet(t);if(e)return(i=e.project).timescale.scrollTo(i.startDate,.25),!1}},s.Commands[u.GanttCommandNames.GANTTSHEET_TIMESCALE_END]={canUndo:!1,execute:function(t,n){var i,e=o.GanttUtil.getGanttSheet(t);if(e)return(i=e.project).timescale.scrollTo(i.finishDate,.75),!1}},s.Commands[u.GanttCommandNames.GANTTSHEET_TIMESCALE_LEFT]={canUndo:!1,execute:function(t,n){var i,e,s=o.GanttUtil.getGanttSheet(t);if(s)return(i=s.project)&&(e=i.timescale).scrollOneTick(!1),!1}},s.Commands[u.GanttCommandNames.GANTTSHEET_TIMESCALE_RIGHT]={canUndo:!1,execute:function(t,n){var i,e,s=o.GanttUtil.getGanttSheet(t);if(s)return(i=s.project)&&(e=i.timescale).scrollOneTick(!0),!1}},s.Commands[u.GanttCommandNames.GANTTSHEET_TIMESCALE_ZOOM_IN]={canUndo:!1,execute:function(t,n){var i,e,s=o.GanttUtil.getGanttSheet(t);if(s)return e=(i=s.project).timescale,s.uiOptions.allowZoomTimescale&&e.zoomIn(),!1}},s.Commands[u.GanttCommandNames.GANTTSHEET_TIMESCALE_ZOOM_OUT]={canUndo:!1,execute:function(t,n){var i,e,s=o.GanttUtil.getGanttSheet(t);if(s)return e=(i=s.project).timescale,s.uiOptions.allowZoomTimescale&&e.zoomOut(),!1}},s.Commands[u.GanttCommandNames.GANTTSHEET_TIMESCALE_ZOOM_CUSTOMER]={canUndo:!0,execute:function(t,n){var i,e,s,r=o.GanttUtil.getGanttSheet(t);if(r)return i=r.project,e=n.start,s=n.finish,i.timescale.zoomToRange(e,s),!0}},s.Commands[u.GanttCommandNames.GANTTSHEET_CHANGE_COMPLETE]={canUndo:!0,execute:function(t,n){var i,e,s,r,u,h=o.GanttUtil.getGanttSheet(t);if(h){for(i=o.GanttUtil.getSelectedTasks(h),e=n.complete,s=0,r=i;s<r.length;s++)(u=r[s]).complete!==e&&h.project.taskManager.setTaskValue(u,"complete",e);return!0}}},s.Commands[u.GanttCommandNames.GANTTSHEET_INDENT_TASKS]={canUndo:!0,execute:function(t,n){var i,e=o.GanttUtil.getGanttSheet(t);if(e)return i=o.GanttUtil.getSelectedTasks(e),e.project.indentTasks(i.map((function(t){return t.taskNumber}))),!0}},s.Commands[u.GanttCommandNames.GANTTSHEET_OUTDENT_TASKS]={canUndo:!0,execute:function(t,n){var i,e=o.GanttUtil.getGanttSheet(t);if(e)return i=o.GanttUtil.getSelectedTasks(e),e.project.outdentTasks(i.map((function(t){return t.taskNumber}))),!0}},s.Commands[u.GanttCommandNames.GANTTSHEET_LINK_TASKS]={canUndo:!0,execute:function(t,n){var i,e,s,r,u,h,a,c,f,l,d,v,A=o.GanttUtil.getGanttSheet(t);if(A){for(i=A.project,e=[],s=A.getSelections(),r=-1,u=0;u<s.length;u++){for(h=s[u],-1!==r&&e.push([r,h.row]),a=h.row+1;a<h.row+h.rowCount;a++)e.push([a-1,a]);r=h.row+h.rowCount-1}if(e.length<=0)return!1;for(i.suspendSchedule(),c=0,f=e;c<f.length;c++){d=(l=f[c])[0],v=l[1];try{i.addDependency({fromTaskNumber:d,toTaskNumber:v})}catch(t){}}return i.resumeSchedule(),!0}}},s.Commands[u.GanttCommandNames.GANTTSHEET_UNLINK_TASKS]={canUndo:!0,execute:function(t,n){var i,e,s,r,u,h,a,c,f=o.GanttUtil.getGanttSheet(t);if(f){if(i=o.GanttUtil.getSelectedTaskNumbers(f),e=f.project,s=[],1===i.length)r=e.getTaskByRow(i[0]),s=l(l([],r.predecessorDependencies,!0),r.successorDependencies,!0);else{for(u={},h=0,a=i;h<a.length;h++)c=a[h],u[c]=!0;s=e.dependencies.filter((function(t){return u[t.from.taskNumber]&&u[t.to.taskNumber]}))}return s.length>=1&&e.removeDependency(s),!0}}},s.Commands[u.GanttCommandNames.GANTTSHEET_CHANGE_TASK_MODE]={canUndo:!0,execute:function(t,n){var i,e,s,u,h=n.taskMode,a=t.getActiveSheetTab();if(a&&a instanceof r.GanttSheet){for(e=0,s=i=o.GanttUtil.getSelectedTasks(a);e<s.length;e++)(u=s[e]).setValue("mode",h);return!0}}},s.Commands[u.GanttCommandNames.GANTTSHEET_MOVE_TASK]={canUndo:!0,execute:function(t,n){var i,e,s,r,u=o.GanttUtil.getGanttSheet(t);if(u)return i=n.duration,e=n.forward,s=u.project,r=o.GanttUtil.getSelectedTaskNumbers(u),s.suspendSchedule(),r.forEach((function(t){var n,r,u=s.getTask(t),o=e?null!==(n=i.value)&&void 0!==n?n:0:-1*(null!==(r=i.value)&&void 0!==r?r:0);"Week"===i.unit?u.moveInWeeks(o):u.moveInWorkingDays(o)})),s.resumeSchedule(),!0}},s.Commands[u.GanttCommandNames.GANTTSHEET_INSERT_TASK]={canUndo:!0,execute:function(t,n){var i,e,s,r,u=o.GanttUtil.getGanttSheet(t);if(u)return i=u.project,e=u.getSelections().map((function(t){return t.rowCount})).reduce((function(t,n){return t+n})),s=Math.min.apply(Math,l(l([],u.getSelections().map((function(t){return t.row})),!1),[i.count],!1)),r=A(e,(function(){return{name:c().GANTT_NEW_TASK}})),i.insertTasksByRow(s,r),u.setSelection(s,-1,e,-1),!0}},s.Commands[u.GanttCommandNames.GANTTSHEET_INSERT_SUMMARY_TASK]={canUndo:!0,execute:function(t,n){var i,e,s,r,u,h,a=o.GanttUtil.getGanttSheet(t);if(a)return i=a.project,s=(e=a.getSelections()[0]).row,r=a.getTaskNumberByRow(s)||i.count,0===(u=o.GanttUtil.getSelectedRowIndexes(a).map((function(t){return a.getTaskByRow(t)})).filter((function(t){return!!t}))).length?(h=i.insertTasks(r,{name:c().GANTT_NEW_SUMMARY_TASK})[0],i.insertTasks(r+1,{name:c().GANTT_NEW_TASK},h.level+1)):(i.insertTasks(r,{name:c().GANTT_NEW_SUMMARY_TASK},u[0].level),i.sorted?i.indentTasks([u[0].taskNumber]):i.indentTasksByRange(e.row+1,e.rowCount)),a.setSelection(s,-1,1,-1),!0}},s.Commands[u.GanttCommandNames.GANTTSHEET_INSERT_MILESTONE]={canUndo:!0,execute:function(t,n){var i,e,s,r,u=o.GanttUtil.getGanttSheet(t);if(u)return i=u.project,e=u.getSelections().map((function(t){return t.rowCount})).reduce((function(t,n){return t+n})),s=Math.min.apply(Math,l(l([],u.getSelections().map((function(t){return t.row})),!1),[i.count],!1)),r=A(e,(function(){return{name:c().GANTT_NEW_MILESTONE,duration:0}})),i.insertTasksByRow(s,r),u.setSelection(s,-1,e,-1),!0}},s.Commands[u.GanttCommandNames.GANTTSHEET_DELETE_TASK]={canUndo:!0,execute:function(t,n){var i,e,s=o.GanttUtil.getGanttSheet(t);if(s)return i=s.project,e=o.GanttUtil.getSelectedTaskNumbers(s),i.removeTasks(e),!0}},s.Commands[u.GanttCommandNames.GANTTSHEET_SCROLL_TO_TASK]={canUndo:!0,execute:function(t,n){var i,e=o.GanttUtil.getGanttSheet(t);if(e)return i=e.getActiveTask(),f(i.start)&&f(i.duration)?e.project.timescale.scrollTo(i.finishDisplayed,.25):e.project.timescale.scrollTo(i.startDisplayed,.25),!0}},s.Commands.kAi=function(t){var n,i=!s.mt.Qf();t.register(u.GanttCommandNames.GANTTSHEET_TIMESCALE_PAGE_UP,s.Commands[u.GanttComm