dhtmlx-gantt
Version:
An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.
13 lines (8 loc) • 600 kB
JavaScript
/*
@license
dhtmlxGantt v.7.1.12 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
To use dhtmlxGantt in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxGantt/#licensing or contact us at sales@dhtmlx.com
(c) XB Software Ltd.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("dhtmlxgantt",[],e):"object"==typeof exports?exports.dhtmlxgantt=e():t.dhtmlxgantt=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/codebase/",n(n.s=63)}([function(t,e,n){function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r,a=n(2),o={}.constructor.toString();t.exports={copy:function t(e){var n,r;if(e&&"object"==i(e))switch(!0){case a.isDate(e):r=new Date(e);break;case a.isArray(e):for(r=new Array(e.length),n=0;n<e.length;n++)r[n]=t(e[n]);break;default:for(n in r=function(t){return t.constructor.toString()!==o}(e)?Object.create(e):{},e)Object.prototype.hasOwnProperty.apply(e,[n])&&(r[n]=t(e[n]))}return r||e},defined:function(t){return void 0!==t},mixin:function(t,e,n){for(var i in e)(void 0===t[i]||n)&&(t[i]=e[i]);return t},uid:function(){return r||(r=(new Date).valueOf()),++r},bind:function(t,e){return t.bind?t.bind(e):function(){return t.apply(e,arguments)}},event:function(t,e,n,i){t.addEventListener?t.addEventListener(e,n,void 0!==i&&i):t.attachEvent&&t.attachEvent("on"+e,n)},eventRemove:function(t,e,n,i){t.removeEventListener?t.removeEventListener(e,n,void 0!==i&&i):t.detachEvent&&t.detachEvent("on"+e,n)}}},function(t,e){function n(t){var e=0,n=0,i=0,r=0;if(t.getBoundingClientRect){var a=t.getBoundingClientRect(),o=document.body,s=document.documentElement||document.body.parentNode||document.body,l=window.pageYOffset||s.scrollTop||o.scrollTop,c=window.pageXOffset||s.scrollLeft||o.scrollLeft,u=s.clientTop||o.clientTop||0,d=s.clientLeft||o.clientLeft||0;e=a.top+l-u,n=a.left+c-d,i=document.body.offsetWidth-a.right,r=document.body.offsetHeight-a.bottom}else{for(;t;)e+=parseInt(t.offsetTop,10),n+=parseInt(t.offsetLeft,10),t=t.offsetParent;i=document.body.offsetWidth-t.offsetWidth-n,r=document.body.offsetHeight-t.offsetHeight-e}return{y:Math.round(e),x:Math.round(n),width:t.offsetWidth,height:t.offsetHeight,right:Math.round(i),bottom:Math.round(r)}}function i(t){var e=!1,n=!1;if(window.getComputedStyle){var i=window.getComputedStyle(t,null);e=i.display,n=i.visibility}else t.currentStyle&&(e=t.currentStyle.display,n=t.currentStyle.visibility);return"none"!=e&&"hidden"!=n}function r(t){return!isNaN(t.getAttribute("tabindex"))&&1*t.getAttribute("tabindex")>=0}function a(t){return!{a:!0,area:!0}[t.nodeName.loLowerCase()]||!!t.getAttribute("href")}function o(t){return!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[t.nodeName.toLowerCase()]||!t.hasAttribute("disabled")}function s(t){if(!t)return"";var e=t.className||"";return e.baseVal&&(e=e.baseVal),e.indexOf||(e=""),u(e)}var l;function c(t){var e;return t.tagName?e=t:(e=(t=t||window.event).target||t.srcElement).shadowRoot&&t.composedPath&&(e=t.composedPath()[0]),e}function u(t){return(String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")}).apply(t)}function d(){return document.head.createShadowRoot||document.head.attachShadow}function h(t){if(!t)return document.body;if(!d())return document.body;for(;t.parentNode&&(t=t.parentNode);)if(t instanceof ShadowRoot)return t.host;return document.body}t.exports={getNodePosition:n,getFocusableNodes:function(t){for(var e=t.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),n=Array.prototype.slice.call(e,0),s=0;s<n.length;s++)n[s].$position=s;for(n.sort(function(t,e){return 0===t.tabIndex&&0!==e.tabIndex?1:0!==t.tabIndex&&0===e.tabIndex?-1:t.tabIndex===e.tabIndex?t.$position-e.$position:t.tabIndex<e.tabIndex?-1:1}),s=0;s<n.length;s++){var l=n[s];(r(l)||o(l)||a(l))&&i(l)||(n.splice(s,1),s--)}return n},getScrollSize:function(){var t=document.createElement("div");t.style.cssText="visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e},getClassName:s,addClassName:function(t,e){e&&-1===t.className.indexOf(e)&&(t.className+=" "+e)},removeClassName:function(t,e){e=e.split(" ");for(var n=0;n<e.length;n++){var i=new RegExp("\\s?\\b"+e[n]+"\\b(?![-_.])","");t.className=t.className.replace(i,"")}},insertNode:function(t,e){l||(l=document.createElement("div")),l.innerHTML=e;var n=l.firstChild;return t.appendChild(n),n},removeNode:function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},getChildNodes:function(t,e){for(var n=t.childNodes,i=n.length,r=[],a=0;a<i;a++){var o=n[a];o.className&&-1!==o.className.indexOf(e)&&r.push(o)}return r},toNode:function(t){return"string"==typeof t?document.getElementById(t)||document.querySelector(t)||document.body:t||document.body},locateClassName:function(t,e,n){var i=c(t),r="";for(void 0===n&&(n=!0);i;){if(r=s(i)){var a=r.indexOf(e);if(a>=0){if(!n)return i;var o=0===a||!u(r.charAt(a-1)),l=a+e.length>=r.length||!u(r.charAt(a+e.length));if(o&&l)return i}}i=i.parentNode}return null},locateAttribute:function(t,e){if(e){for(var n=c(t);n;){if(n.getAttribute&&n.getAttribute(e))return n;n=n.parentNode}return null}},getTargetNode:c,getRelativeEventPosition:function(t,e){var i=document.documentElement,r=n(e);return{x:t.clientX+i.scrollLeft-i.clientLeft-r.x+e.scrollLeft,y:t.clientY+i.scrollTop-i.clientTop-r.y+e.scrollTop}},isChildOf:function(t,e){if(!t||!e)return!1;for(;t&&t!=e;)t=t.parentNode;return t===e},hasClass:function(t,e){return"classList"in t?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)},closest:function(t,e){if(t.closest)return t.closest(e);if(t.matches||t.msMatchesSelector||t.webkitMatchesSelector){var n=t;if(!document.documentElement.contains(n))return null;do{if((n.matches||n.msMatchesSelector||n.webkitMatchesSelector).call(n,e))return n;n=n.parentElement||n.parentNode}while(null!==n&&1===n.nodeType);return null}return console.error("Your browser is not supported"),null},getRootNode:h,hasShadowParent:function(t){return!!h(t)},isShadowDomSupported:d,getActiveElement:function(){var t=document.activeElement;return t.shadowRoot&&(t=t.shadowRoot.activeElement),t===document.body&&document.getSelection&&(t=document.getSelection().focusNode||document.body),t}}},function(t,e){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i={second:1,minute:60,hour:3600,day:86400,week:604800,month:2592e3,quarter:7776e3,year:31536e3};function r(t){return!(!t||"object"!==n(t))&&!!(t.getFullYear&&t.getMonth&&t.getDate)}function a(t,e){var n=[];if(t.filter)return t.filter(e);for(var i=0;i<t.length;i++)e(t[i],i)&&(n[n.length]=t[i]);return n}function o(t){return 0===t}t.exports={getSecondsInUnit:function(t){return i[t]||i.hour},forEach:function(t,e){if(t.forEach)t.forEach(e);else for(var n=t.slice(),i=0;i<n.length;i++)e(n[i],i)},arrayMap:function(t,e){if(t.map)return t.map(e);for(var n=t.slice(),i=[],r=0;r<n.length;r++)i.push(e(n[r],r));return i},arrayIncludes:function(t,e){if(t.includes)return t.includes(e);for(var n=0;n<t.length;n++)if(t[n]===e)return!0;return!1},arrayFind:function(t,e){if(t.find)return t.find(e);for(var n=0;n<t.length;n++)if(e(t[n],n))return t[n]},arrayFilter:a,arrayDifference:function(t,e){return a(t,function(t,n){return!e(t,n)})},arraySome:function(t,e){if(0===t.length)return!1;for(var n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},hashToArray:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e},sortArrayOfHash:function(t,e,n){var i=function(t,e){return t<e};t.sort(function(t,r){return t[e]===r[e]?0:n?i(t[e],r[e]):i(r[e],t[e])})},throttle:function(t,e){var n=!1;return function(){n||(t.apply(null,arguments),n=!0,setTimeout(function(){n=!1},e))}},isArray:function(t){return Array.isArray?Array.isArray(t):t&&void 0!==t.length&&t.pop&&t.push},isDate:r,isValidDate:function(t){return r(t)&&!isNaN(t.getTime())},isStringObject:function(t){return t&&"object"===n(t)&&"function String() { [native code] }"===Function.prototype.toString.call(t.constructor)},isNumberObject:function(t){return t&&"object"===n(t)&&"function Number() { [native code] }"===Function.prototype.toString.call(t.constructor)},isBooleanObject:function(t){return t&&"object"===n(t)&&"function Boolean() { [native code] }"===Function.prototype.toString.call(t.constructor)},delay:function(t,e){var n,i=function i(){i.$cancelTimeout(),i.$pending=!0;var r=Array.prototype.slice.call(arguments);n=setTimeout(function(){t.apply(this,r),i.$pending=!1},e)};return i.$pending=!1,i.$cancelTimeout=function(){clearTimeout(n),i.$pending=!1},i.$execute=function(){var e=Array.prototype.slice.call(arguments);t.apply(this,e),i.$cancelTimeout()},i},objectKeys:function(t){if(Object.keys)return Object.keys(t);var e,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},isEventable:function(t){return t.attachEvent&&t.detachEvent},replaceValidZeroId:function(t,e){return o(t)&&!o(e)&&(t="0"),t},checkZeroId:o,findBinary:function(t,e){for(var n,i,r,a=0,o=t.length-1;a<=o;)if(i=+t[n=Math.floor((a+o)/2)],r=+t[n-1],i<e)a=n+1;else{if(!(i>e)){for(;+t[n]==+t[n+1];)n++;return n}if(!isNaN(r)&&r<e)return n-1;o=n-1}return t.length-1}}},function(t,e){t.exports=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function i(){this.constructor=t}t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}},function(t,e){var n=function(){this._silent_mode=!1,this.listeners={}};n.prototype={_silentStart:function(){this._silent_mode=!0},_silentEnd:function(){this._silent_mode=!1}};var i=function(t){var e={},n=0,i=function(){var n=!0;for(var i in e){var r=e[i].apply(t,arguments);n=n&&r}return n};return i.addEvent=function(t,r){if("function"==typeof t){var a;if(r&&r.id?a=r.id:(a=n,n++),r&&r.once){var o=t;t=function(){o(),i.removeEvent(a)}}return e[a]=t,a}return!1},i.removeEvent=function(t){delete e[t]},i.clear=function(){e={}},i};t.exports=function(t){var e=new n;t.attachEvent=function(t,n,r){t="ev_"+t.toLowerCase(),e.listeners[t]||(e.listeners[t]=i(this)),r&&r.thisObject&&(n=n.bind(r.thisObject));var a=t+":"+e.listeners[t].addEvent(n,r);return r&&r.id&&(a=r.id),a},t.attachAll=function(t){this.attachEvent("listen_all",t)},t.callEvent=function(t,n){if(e._silent_mode)return!0;var i="ev_"+t.toLowerCase(),r=e.listeners;return r.ev_listen_all&&r.ev_listen_all.apply(this,[t].concat(n)),!r[i]||r[i].apply(this,n)},t.checkEvent=function(t){return!!e.listeners["ev_"+t.toLowerCase()]},t.detachEvent=function(t){if(t){var n=e.listeners;for(var i in n)n[i].removeEvent(t);var r=t.split(":");if(n=e.listeners,2===r.length){var a=r[0],o=r[1];n[a]&&n[a].removeEvent(o)}}},t.detachAllEvents=function(){for(var t in e.listeners)e.listeners[t].clear()}}},function(t,e){t.exports=function(t,e,n,i,r){var a=e.getItemIndexByTopPosition(r.y)||0,o=e.getItemIndexByTopPosition(r.y_end)||i.count();return{start:Math.max(0,a-1),end:Math.min(i.count(),o+1)}}},function(t,e){function n(){console.log("Method is not implemented.")}function i(){}i.prototype.render=n,i.prototype.set_value=n,i.prototype.get_value=n,i.prototype.focus=n,t.exports=function(t){return i}},function(t,e){var n="undefined"!=typeof window,i={isIE:n&&(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0),isIE6:n&&!XMLHttpRequest&&navigator.userAgent.indexOf("MSIE")>=0,isIE7:n&&navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0,isIE8:n&&navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0,isOpera:n&&navigator.userAgent.indexOf("Opera")>=0,isChrome:n&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:n&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:n&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:n&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:n&&-1!=navigator.userAgent.indexOf("Edge"),isNode:!n||"undefined"==typeof navigator};t.exports=i},function(t,e){t.exports=function(t){var e=function(){};return e.prototype={show:function(t,e,n,i){},hide:function(){},set_value:function(t,e,n,i){this.get_input(i).value=t},get_value:function(t,e,n){return this.get_input(n).value||""},is_changed:function(t,e,n,i){var r=this.get_value(e,n,i);return r&&t&&r.valueOf&&t.valueOf?r.valueOf()!=t.valueOf():r!=t},is_valid:function(t,e,n,i){return!0},save:function(t,e,n){},get_input:function(t){return t.querySelector("input")},focus:function(t){var e=this.get_input(t);e&&(e.focus&&e.focus(),e.select&&e.select())}},e}},function(t,e){t.exports=function(t,e,n,i){if((i=e?e.config:i)&&i.placeholder_task&&n.exists(t))return n.getItem(t).type===i.types.placeholder;return!1}},function(t,e,n){var i=n(7);t.exports=function(t){return i.isNode||!t.$root}},function(t,e,n){var i=n(0),r=n(4),a=n(1),o=function(){"use strict";function t(t,e,n,o){t&&(this.$container=a.toNode(t),this.$parent=t),this.$config=i.mixin(e,{headerHeight:33}),this.$gantt=o,this.$domEvents=o._createDomEventScope(),this.$id=e.id||"c"+i.uid(),this.$name="cell",this.$factory=n,r(this)}return t.prototype.destructor=function(){this.$parent=this.$container=this.$view=null,this.$gantt.$services.getService("mouseEvents").detach("click","gantt_header_arrow",this._headerClickHandler),this.$domEvents.detachAll(),this.callEvent("onDestroy",[]),this.detachAllEvents()},t.prototype.cell=function(t){return null},t.prototype.scrollTo=function(t,e){var n=this.$view;this.$config.html&&(n=this.$view.firstChild),1*t==t&&(n.scrollLeft=t),1*e==e&&(n.scrollTop=e)},t.prototype.clear=function(){this.getNode().innerHTML="",this.getNode().className="gantt_layout_content",this.getNode().style.padding="0"},t.prototype.resize=function(t){if(this.$parent)return this.$parent.resize(t);!1===t&&(this.$preResize=!0);var e=this.$container,n=e.offsetWidth,i=e.offsetHeight,r=this.getSize();e===document.body&&(n=document.body.offsetWidth,i=document.body.offsetHeight),n<r.minWidth&&(n=r.minWidth),n>r.maxWidth&&(n=r.maxWidth),i<r.minHeight&&(i=r.minHeight),i>r.maxHeight&&(i=r.maxHeight),this.setSize(n,i),this.$preResize,this.$preResize=!1},t.prototype.hide=function(){this._hide(!0),this.resize()},t.prototype.show=function(t){this._hide(!1),t&&this.$parent&&this.$parent.show(),this.resize()},t.prototype._hide=function(t){if(!0===t&&this.$view.parentNode)this.$view.parentNode.removeChild(this.$view);else if(!1===t&&!this.$view.parentNode){var e=this.$parent.cellIndex(this.$id);this.$parent.moveView(this,e)}this.$config.hidden=t},t.prototype.$toHTML=function(t,e){void 0===t&&(t=""),e=[e||"",this.$config.css||""].join(" ");var n=this.$config,i="";n.raw?t="string"==typeof n.raw?n.raw:"":(t||(t="<div class='gantt_layout_content' "+(e?" class='"+e+"' ":"")+" >"+(n.html||"")+"</div>"),n.header&&(i="<div class='gantt_layout_header'>"+(n.canCollapse?"<div class='gantt_layout_header_arrow'></div>":"")+"<div class='gantt_layout_header_content'>"+n.header+"</div></div>"));return"<div class='gantt_layout_cell "+e+"' data-cell-id='"+this.$id+"'>"+i+t+"</div>"},t.prototype.$fill=function(t,e){this.$view=t,this.$parent=e,this.init()},t.prototype.getNode=function(){return this.$view.querySelector("gantt_layout_cell")||this.$view},t.prototype.init=function(){var t=this;this._headerClickHandler=function(e){a.locateAttribute(e,"data-cell-id")==t.$id&&t.toggle()},this.$gantt.$services.getService("mouseEvents").delegate("click","gantt_header_arrow",this._headerClickHandler),this.callEvent("onReady",[])},t.prototype.toggle=function(){this.$config.collapsed=!this.$config.collapsed,this.resize()},t.prototype.getSize=function(){var t={height:this.$config.height||0,width:this.$config.width||0,gravity:this.$config.gravity||1,minHeight:this.$config.minHeight||0,minWidth:this.$config.minWidth||0,maxHeight:this.$config.maxHeight||1e11,maxWidth:this.$config.maxWidth||1e11};if(this.$config.collapsed){var e="x"===this.$config.mode;t[e?"width":"height"]=t[e?"maxWidth":"maxHeight"]=this.$config.headerHeight}return t},t.prototype.getContentSize=function(){var t=this.$lastSize.contentX;t!==1*t&&(t=this.$lastSize.width);var e=this.$lastSize.contentY;return e!==1*e&&(e=this.$lastSize.height),{width:t,height:e}},t.prototype._getBorderSizes=function(){var t={top:0,right:0,bottom:0,left:0,horizontal:0,vertical:0};return this._currentBorders&&(this._currentBorders[this._borders.left]&&(t.left=1,t.horizontal++),this._currentBorders[this._borders.right]&&(t.right=1,t.horizontal++),this._currentBorders[this._borders.top]&&(t.top=1,t.vertical++),this._currentBorders[this._borders.bottom]&&(t.bottom=1,t.vertical++)),t},t.prototype.setSize=function(t,e){this.$view.style.width=t+"px",this.$view.style.height=e+"px";var n=this._getBorderSizes(),i=e-n.vertical,r=t-n.horizontal;this.$lastSize={x:t,y:e,contentX:r,contentY:i},this.$config.header?this._sizeHeader():this._sizeContent()},t.prototype._borders={left:"gantt_layout_cell_border_left",right:"gantt_layout_cell_border_right",top:"gantt_layout_cell_border_top",bottom:"gantt_layout_cell_border_bottom"},t.prototype._setBorders=function(t,e){e||(e=this);var n=e.$view;for(var i in this._borders)a.removeClassName(n,this._borders[i]);"string"==typeof t&&(t=[t]);var r={};for(i=0;i<t.length;i++)a.addClassName(n,t[i]),r[t[i]]=!0;e._currentBorders=r},t.prototype._sizeContent=function(){var t=this.$view.childNodes[0];t&&"gantt_layout_content"==t.className&&(t.style.height=this.$lastSize.contentY+"px")},t.prototype._sizeHeader=function(){var t=this.$lastSize;t.contentY-=this.$config.headerHeight;var e=this.$view.childNodes[0],n=this.$view.childNodes[1],i="x"===this.$config.mode;if(this.$config.collapsed)if(n.style.display="none",i){e.className="gantt_layout_header collapsed_x",e.style.width=t.y+"px";var r=Math.floor(t.y/2-t.x/2);e.style.transform="rotate(90deg) translate("+r+"px, "+r+"px)",n.style.display="none"}else e.className="gantt_layout_header collapsed_y";else e.className=i?"gantt_layout_header":"gantt_layout_header vertical",e.style.width="auto",e.style.transform="",n.style.display="",n.style.height=t.contentY+"px";e.style.height=this.$config.headerHeight+"px"},t}();t.exports=o},function(t,e,n){(function(e){var n;n="undefined"!=typeof window?window:e,t.exports=n}).call(this,n(13))},function(t,e){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(i=window)}t.exports=i},function(t,e){t.exports=function(t){return t.config.smart_rendering&&t._smart_render}},function(t,e,n){var i=n(3),r=n(43);t.exports=function(t){var e=n(6)(t);function a(){return e.apply(this,arguments)||this}return i(a,e),a.prototype.render=function(t){var e="<div class='gantt_cal_ltext' style='height:"+((t.height||"23")+"px")+";'>";return e+=r.getHtmlSelect(t.options,[{key:"style",value:"width:100%;"}]),e+="</div>"},a.prototype.set_value=function(t,e,n,i){var r=t.firstChild;!r._dhx_onchange&&i.onchange&&(r.onchange=i.onchange,r._dhx_onchange=!0),void 0===e&&(e=(r.options[0]||{}).value),r.value=e||""},a.prototype.get_value=function(t){return t.firstChild.value},a.prototype.focus=function(e){var n=e.firstChild;t._focus(n,!0)},a}},function(t,e,n){},,function(t,e,n){var i=n(0);t.exports=function(t){var e=t.date,n=t.$services;return{getSum:function(t,e,n){void 0===n&&(n=t.length-1),void 0===e&&(e=0);for(var i=0,r=e;r<=n;r++)i+=t[r];return i},setSumWidth:function(t,e,n,i){var r=e.width;void 0===i&&(i=r.length-1),void 0===n&&(n=0);var a=i-n+1;if(!(n>r.length-1||a<=0||i>r.length-1)){var o=t-this.getSum(r,n,i);this.adjustSize(o,r,n,i),this.adjustSize(-o,r,i+1),e.full_width=this.getSum(r)}},splitSize:function(t,e){for(var n=[],i=0;i<e;i++)n[i]=0;return this.adjustSize(t,n),n},adjustSize:function(t,e,n,i){n||(n=0),void 0===i&&(i=e.length-1);for(var r=i-n+1,a=this.getSum(e,n,i),o=n;o<=i;o++){var s=Math.floor(t*(a?e[o]/a:1/r));a-=e[o],t-=s,r--,e[o]+=s}e[e.length-1]+=t},sortScales:function(t){function n(t,n){var i=new Date(1970,0,1);return e.add(i,n,t)-i}t.sort(function(t,e){return n(t.unit,t.step)<n(e.unit,e.step)?1:n(t.unit,t.step)>n(e.unit,e.step)?-1:0});for(var i=0;i<t.length;i++)t[i].index=i},_isLegacyMode:function(e){var n=e||t.config;return n.scale_unit||n.date_scale||n.subscales},_prepareScaleObject:function(e){var n=e.format;return n||(n=e.template||e.date||"%d %M"),"string"==typeof n&&(n=t.date.date_to_str(n)),{unit:e.unit||"day",step:e.step||1,format:n,css:e.css}},primaryScale:function(e){var i,r=n.getService("templateLoader"),a=this._isLegacyMode(e),o=e||t.config;if(a)r.initTemplate("date_scale",void 0,void 0,o,t.config.templates),i={unit:t.config.scale_unit,step:t.config.step,template:t.templates.date_scale,date:t.config.date_scale,css:t.templates.scale_cell_class};else{var s=o.scales[0];i={unit:s.unit,step:s.step,template:s.template,format:s.format,date:s.date,css:s.css||t.templates.scale_cell_class}}return this._prepareScaleObject(i)},getSubScales:function(e){var n=this._isLegacyMode(e),i=e||t.config;return(n?i.subscales||[]:i.scales.slice(1)).map(function(t){return this._prepareScaleObject(t)}.bind(this))},prepareConfigs:function(t,e,n,i,r,a,o){for(var s=this.splitSize(i,t.length),l=n,c=[],u=t.length-1;u>=0;u--){var d=u==t.length-1,h=this.initScaleConfig(t[u],r,a);d&&this.processIgnores(h),this.initColSizes(h,e,l,s[u]),this.limitVisibleRange(h),d&&(l=h.full_width),c.unshift(h)}for(u=0;u<c.length-1;u++)this.alineScaleColumns(c[c.length-1],c[u]);for(u=0;u<c.length;u++)o&&this.reverseScale(c[u]),this.setPosSettings(c[u]);return c},reverseScale:function(t){t.width=t.width.reverse(),t.trace_x=t.trace_x.reverse();var e=t.trace_indexes;t.trace_indexes={},t.trace_index_transition={},t.rtl=!0;for(var n=0;n<t.trace_x.length;n++)t.trace_indexes[t.trace_x[n].valueOf()]=n,t.trace_index_transition[e[t.trace_x[n].valueOf()]]=n;return t},setPosSettings:function(t){for(var e=0,n=t.trace_x.length;e<n;e++)t.left.push((t.width[e-1]||0)+(t.left[e-1]||0))},_ignore_time_config:function(n,i){if(t.config.skip_off_time){for(var r=!0,a=n,o=0;o<i.step;o++)o&&(a=e.add(n,o,i.unit)),r=r&&!this.isWorkTime(a,i.unit);return r}return!1},processIgnores:function(t){t.ignore_x={},t.display_count=t.count},initColSizes:function(t,n,i,r){var a=i;t.height=r;var o=void 0===t.display_count?t.count:t.display_count;o||(o=1),t.col_width=Math.floor(a/o),n&&t.col_width<n&&(t.col_width=n,a=t.col_width*o),t.width=[];for(var s=t.ignore_x||{},l=0;l<t.trace_x.length;l++)if(s[t.trace_x[l].valueOf()]||t.display_count==t.count)t.width[l]=0;else{var c=1;"month"==t.unit&&(c=Math.round((e.add(t.trace_x[l],t.step,t.unit)-t.trace_x[l])/864e5)),t.width[l]=c}this.adjustSize(a-this.getSum(t.width),t.width),t.full_width=this.getSum(t.width)},initScaleConfig:function(t,e,n){var r=i.mixin({count:0,col_width:0,full_width:0,height:0,width:[],left:[],trace_x:[],trace_indexes:{},min_date:new Date(e),max_date:new Date(n)},t);return this.eachColumn(t.unit,t.step,e,n,function(t){r.count++,r.trace_x.push(new Date(t)),r.trace_indexes[t.valueOf()]=r.trace_x.length-1}),r.trace_x_ascending=r.trace_x.slice(),r},iterateScales:function(t,e,n,i,r){for(var a=e.trace_x,o=t.trace_x,s=n||0,l=i||o.length-1,c=0,u=1;u<a.length;u++){var d=t.trace_indexes[+a[u]];void 0!==d&&d<=l&&(r&&r.apply(this,[c,u,s,d]),s=d,c=u)}},alineScaleColumns:function(t,e,n,i){this.iterateScales(t,e,n,i,function(n,i,r,a){var o=this.getSum(t.width,r,a-1);this.getSum(e.width,n,i-1)!=o&&this.setSumWidth(o,e,n,i-1)})},eachColumn:function(n,i,r,a,o){var s=new Date(r),l=new Date(a);e[n+"_start"]&&(s=e[n+"_start"](s));var c=new Date(s);for(+c>=+l&&(l=e.add(c,i,n));+c<+l;){o.call(this,new Date(c));var u=c.getTimezoneOffset();c=e.add(c,i,n),c=t._correct_dst_change(c,u,i,n),e[n+"_start"]&&(c=e[n+"_start"](c))}},limitVisibleRange:function(t){var n=t.trace_x,i=t.width.length-1,r=0;if(+n[0]<+t.min_date&&0!=i){var a=Math.floor(t.width[0]*((n[1]-t.min_date)/(n[1]-n[0])));r+=t.width[0]-a,t.width[0]=a,n[0]=new Date(t.min_date)}var o=n.length-1,s=n[o],l=e.add(s,t.step,t.unit);if(+l>+t.max_date&&o>0&&(a=t.width[o]-Math.floor(t.width[o]*((l-t.max_date)/(l-s))),r+=t.width[o]-a,t.width[o]=a),r){for(var c=this.getSum(t.width),u=0,d=0;d<t.width.length;d++){var h=Math.floor(r*(t.width[d]/c));t.width[d]+=h,u+=h}this.adjustSize(r-u,t.width)}}}}},function(t,e,n){var i=n(1),r=n(0),a=n(4),o=n(132),s=n(38),l=n(134),c=n(135).default,u=function(t,e,n,i){this.$config=r.mixin({},e||{}),this.$gantt=i,this.$parent=t,a(this),this.$state={},r.mixin(this,s(this))};u.prototype={init:function(t){var e=this.$gantt,i=e._waiAria.gridAttrString(),r=e._waiAria.gridDataAttrString(),a=this.$getConfig(),s=a.reorder_grid_columns||!1;void 0!==this.$config.reorder_grid_columns&&(s=this.$config.reorder_grid_columns),t.innerHTML="<div class='gantt_grid' style='height:inherit;width:inherit;' "+i+"></div>",this.$grid=t.childNodes[0],this.$grid.innerHTML="<div class='gantt_grid_scale' "+e._waiAria.gridScaleRowAttrString()+"></div><div class='gantt_grid_data' "+r+"></div>",this.$grid_scale=this.$grid.childNodes[0],this.$grid_data=this.$grid.childNodes[1];var u=a[this.$config.bind+"_attribute"];if(!u&&this.$config.bind&&(u="data-"+this.$config.bind+"-id"),this.$config.item_attribute=u||null,!this.$config.layers){var d=this._createLayerConfig();this.$config.layers=d}var h=o(e,this);h.init(),this._renderHeaderResizers=h.doOnRender,this._mouseDelegates=n(20)(e),l(e,this).init(),this._addLayers(this.$gantt),this._initEvents(),s&&(this._columnDND=new c(e,this),this._columnDND.init()),this.callEvent("onReady",[])},_validateColumnWidth:function(t,e){var n=t[e];if(n&&"*"!=n){var i=this.$gantt,r=1*n;isNaN(r)?i.assert(!1,"Wrong "+e+" value of column "+t.name):t[e]=r}},setSize:function(t,e){this.$config.width=this.$state.width=t,this.$config.height=this.$state.height=e;for(var n,i=this.getGridColumns(),r=0,a=(u=this.$getConfig()).grid_elastic_columns,o=0,s=i.length;o<s;o++)this._validateColumnWidth(i[o],"min_width"),this._validateColumnWidth(i[o],"max_width"),this._validateColumnWidth(i[o],"width"),r+=1*i[o].width;if(!isNaN(r)&&this.$config.scrollable||(r=n=this._setColumnsWidth(t+1)),this.$config.scrollable&&a&&!isNaN(r)){var l=0;i.forEach(function(t){l+=t.min_width||u.min_grid_column_width});var c=Math.max(l,t);r=this._setColumnsWidth(c),n=t}this.$config.scrollable?(this.$grid_scale.style.width=r+"px",this.$grid_data.style.width=r+"px"):(this.$grid_scale.style.width="inherit",this.$grid_data.style.width="inherit"),this.$config.width-=1;var u=this.$getConfig();n!==t&&(void 0!==n?(u.grid_width=n,this.$config.width=n-1):isNaN(r)||(this._setColumnsWidth(r),u.grid_width=r,this.$config.width=r-1));var d=Math.max(this.$state.height-u.scale_height,0);this.$grid_data.style.height=d+"px",this.refresh()},getSize:function(){var t=this.$getConfig(),e=this.$config.rowStore?this.getTotalHeight():0,n=this._getGridWidth();return{x:this.$state.width,y:this.$state.height,contentX:this.isVisible()?n:0,contentY:this.isVisible()?t.scale_height+e:0,scrollHeight:this.isVisible()?e:0,scrollWidth:this.isVisible()?n:0}},_bindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);if(this.$config.rowStore=t,t&&!t._gridCacheAttached){var e=this;t._gridCacheAttached=t.attachEvent("onBeforeFilter",function(){e._resetTopPositionHeight()})}}},_unbindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);t&&t._gridCacheAttached&&(t.detachEvent(t._gridCacheAttached),t._gridCacheAttached=!1)}},refresh:function(){this._bindStore(),this._resetTopPositionHeight(),this._resetHeight(),this._initSmartRenderingPlaceholder(),this._calculateGridWidth(),this._renderGridHeader()},getViewPort:function(){var t=this.$config.scrollLeft||0,e=this.$config.scrollTop||0,n=this.$config.height||0,i=this.$config.width||0;return{y:e,y_end:e+n,x:t,x_end:t+i,height:n,width:i}},scrollTo:function(t,e){if(this.isVisible()){var n=!1;this.$config.scrollTop=this.$config.scrollTop||0,this.$config.scrollLeft=this.$config.scrollLeft||0,1*t==t&&(this.$config.scrollLeft=this.$state.scrollLeft=this.$grid.scrollLeft=t,n=!0),1*e==e&&(this.$config.scrollTop=this.$state.scrollTop=this.$grid_data.scrollTop=e,n=!0),n&&this.callEvent("onScroll",[this.$config.scrollLeft,this.$config.scrollTop])}},getColumnIndex:function(t,e){for(var n=this.$getConfig().columns,i=0,r=0;r<n.length;r++)if(e&&n[r].hide&&i++,n[r].name==t)return r-i;return null},getColumn:function(t){var e=this.getColumnIndex(t);return null===e?null:this.$getConfig().columns[e]},getGridColumns:function(){return this.$getConfig().columns.slice()},isVisible:function(){return this.$parent&&this.$parent.$config?!this.$parent.$config.hidden:this.$grid.offsetWidth},_createLayerConfig:function(){var t=this.$gantt,e=this;return[{renderer:t.$ui.layers.gridLine(),container:this.$grid_data,filter:[function(){return e.isVisible()}]},{renderer:t.$ui.layers.gridTaskRowResizer(),container:this.$grid_data,append:!0,filter:[function(){return t.config.resize_rows}]}]},_addLayers:function(t){if(this.$config.bind){this._taskLayers=[];var e=this,n=this.$gantt.$services.getService("layers"),i=n.getDataRender(this.$config.bind);i||(i=n.createDataRender({name:this.$config.bind,defaultContainer:function(){return e.$grid_data}}));for(var r=this.$config.layers,a=0;r&&a<r.length;a++){var o=r[a];o.view=this;var s=i.addLayer(o);this._taskLayers.push(s)}this._bindStore(),this._initSmartRenderingPlaceholder()}},_refreshPlaceholderOnStoreUpdate:function(t){var e=this.$getConfig(),n=this.$config.rowStore;if(n&&null===t&&this.isVisible()&&e.smart_rendering){var i;if(this.$config.scrollY){var r=this.$gantt.$ui.getView(this.$config.scrollY);r&&(i=r.getScrollState().scrollSize)}if(i||(i=n?this.getTotalHeight():0),i){this.$rowsPlaceholder&&this.$rowsPlaceholder.parentNode&&this.$rowsPlaceholder.parentNode.removeChild(this.$rowsPlaceholder);var a=this.$rowsPlaceholder=document.createElement("div");a.style.visibility="hidden",a.style.height=i+"px",a.style.width="1px",this.$grid_data.appendChild(a)}}},_initSmartRenderingPlaceholder:function(){var t=this.$config.rowStore;t&&(this._initSmartRenderingPlaceholder=function(){},this._staticBgHandler=t.attachEvent("onStoreUpdated",r.bind(this._refreshPlaceholderOnStoreUpdate,this)))},_initEvents:function(){var t=this.$gantt;this._mouseDelegates.delegate("click","gantt_close",t.bind(function(t,e,n){var r=this.$config.rowStore;if(!r)return!0;var a=i.locateAttribute(t,this.$config.item_attribute);return a&&r.close(a.getAttribute(this.$config.item_attribute)),!1},this),this.$grid),this._mouseDelegates.delegate("click","gantt_open",t.bind(function(t,e,n){var r=this.$config.rowStore;if(!r)return!0;var a=i.locateAttribute(t,this.$config.item_attribute);return a&&r.open(a.getAttribute(this.$config.item_attribute)),!1},this),this.$grid)},_clearLayers:function(t){var e=this.$gantt.$services.getService("layers").getDataRender(this.$config.bind);if(this._taskLayers)for(var n=0;n<this._taskLayers.length;n++)e.removeLayer(this._taskLayers[n]);this._taskLayers=[]},_getColumnWidth:function(t,e,n){var i=t.min_width||e.min_grid_column_width,r=Math.max(n,i||10);return t.max_width&&(r=Math.min(r,t.max_width)),r},_checkGridColumnMinWidthLimits:function(t,e){for(var n=0,i=t.length;n<i;n++){var r=1*t[n].width;!t[n].min_width&&r<e.min_grid_column_width&&(t[n].min_width=r)}},_getGridWidthLimits:function(){for(var t=this.$getConfig(),e=this.getGridColumns(),n=0,i=0,r=0;r<e.length;r++)n+=e[r].min_width?e[r].min_width:t.min_grid_column_width,void 0!==i&&(i=e[r].max_width?i+e[r].max_width:void 0);return this._checkGridColumnMinWidthLimits(e,t),[n,i]},_setColumnsWidth:function(t,e){var n=this.$getConfig(),i=this.getGridColumns(),r=0,a=t;e=window.isNaN(e)?-1:e;for(var o=0,s=i.length;o<s;o++)r+=1*i[o].width;if(window.isNaN(r)){this._calculateGridWidth(),r=0;for(o=0,s=i.length;o<s;o++)r+=1*i[o].width}var l=a-r,c=0;for(o=0;o<e+1;o++)c+=i[o].width;r-=c;for(o=e+1;o<i.length;o++){var u=i[o],d=Math.round(l*(u.width/r));l<0?u.min_width&&u.width+d<u.min_width?d=u.min_width-u.width:!u.min_width&&n.min_grid_column_width&&u.width+d<n.min_grid_column_width&&(d=n.min_grid_column_width-u.width):u.max_width&&u.width+d>u.max_width&&(d=u.max_width-u.width),r-=u.width,u.width+=d,l-=d}for(var h=l>0?1:-1;l>0&&1===h||l<0&&-1===h;){var f=l;for(o=e+1;o<i.length;o++){var _;if((_=i[o].width+h)==this._getColumnWidth(i[o],n,_)&&(l-=h,i[o].width=_),!l)break}if(f==l)break}l&&e>-1&&((_=i[e].width+l)==this._getColumnWidth(i[e],n,_)&&(i[e].width=_));return this._getColsTotalWidth()},_getColsTotalWidth:function(){for(var t=this.getGridColumns(),e=0,n=0;n<t.length;n++){var i=parseFloat(t[n].width);if(window.isNaN(i))return!1;e+=i}return e},_calculateGridWidth:function(){for(var t=this.$getConfig(),e=this.getGridColumns(),n=0,i=[],r=[],a=0;a<e.length;a++){var o=parseFloat(e[a].width);window.isNaN(o)&&(o=t.min_grid_column_width||10,i.push(a)),r[a]=o,n+=o}var s=this._getGridWidth()+1;if(t.autofit||i.length){var l=s-n;if(t.autofit&&!t.grid_elastic_columns)for(a=0;a<r.length;a++){var c=Math.round(l/(r.length-a));r[a]+=c,(u=this._getColumnWidth(e[a],t,r[a]))!=r[a]&&(c=u-r[a],r[a]=u),l-=c}else if(i.length)for(a=0;a<i.length;a++){c=Math.round(l/(i.length-a));var u,d=i[a];r[d]+=c,(u=this._getColumnWidth(e[d],t,r[d]))!=r[d]&&(c=u-r[d],r[d]=u),l-=c}for(a=0;a<r.length;a++)e[a].width=r[a]}else{var h=s!=n;this.$config.width=n-1,t.grid_width=n,h&&this.$parent._setContentSize(this.$config.width,null)}},_renderGridHeader:function(){var t=this.$gantt,e=this.$getConfig(),n=this.$gantt.locale,i=this.$gantt.templates,r=this.getGridColumns();e.rtl&&(r=r.reverse());for(var a=[],o=0,s=n.labels,l=e.scale_height-1,c=0;c<r.length;c++){var u=c==r.length-1,d=r[c];d.name||(d.name=t.uid()+"");var h=1*d.width,f=this._getGridWidth();u&&f>o+h&&(d.width=h=f-o),o+=h;var _=t._sort&&d.name==t._sort.name?"<div class='gantt_sort gantt_"+t._sort.direction+"'></div>":"",g=["gantt_grid_head_cell","gantt_grid_head_"+d.name,u?"gantt_last_cell":"",i.grid_header_class(d.name,d)].join(" "),p="width:"+(h-(u?1:0))+"px;",v=d.label||s["column_"+d.name]||s[d.name];v=v||"";var m="<div class='"+g+"' style='"+p+"' "+t._waiAria.gridScaleCellAttrString(d,v)+" data-column-id='"+d.name+"' column_id='"+d.name+"' data-column-name='"+d.name+"' data-column-index='"+c+"'>"+v+_+"</div>";a.push(m)}this.$grid_scale.style.height=e.scale_height+"px",this.$grid_scale.style.lineHeight=l+"px",this.$grid_scale.innerHTML=a.join(""),this._renderHeaderResizers&&this._renderHeaderResizers()},_getGridWidth:function(){return this.$config.width},destructor:function(){this._clearLayers(this.$gantt),this._mouseDelegates&&(this._mouseDelegates.destructor(),this._mouseDelegates=null),this._unbindStore(),this.$grid=null,this.$grid_scale=null,this.$grid_data=null,this.$gantt=null,this.$config.rowStore&&(this.$config.rowStore.detachEvent(this._staticBgHandler),this.$config.rowStore=null),this.callEvent("onDestroy",[]),this.detachAllEvents()}},t.exports=u},function(t,e){t.exports=function(t){var e=[];return{delegate:function(n,i,r,a){e.push([n,i,r,a]),t.$services.getService("mouseEvents").delegate(n,i,r,a)},destructor:function(){for(var n=t.$services.getService("mouseEvents"),i=0;i<e.length;i++){var r=e[i];n.detach(r[0],r[1],r[2],r[3])}e=[]}}}},function(t,e){t.exports=function(t,e,n){return{top:e.getItemTop(t.id),height:e.getItemHeight(t.id),left:0,right:1/0}}},function(t,e,n){var i=n(18),r=n(4),a=n(0),o=n(2),s=n(38),l=n(211),c=function(t,e,n,o){this.$config=a.mixin({},e||{}),this.$scaleHelper=new i(o),this.$gantt=o,this._posFromDateCache={},this._timelineDragScroll=null,a.mixin(this,s(this)),r(this)};c.prototype={init:function(t){t.innerHTML+="<div class='gantt_task' style='width:inherit;height:inherit;'></div>",this.$task=t.childNodes[0],this.$task.innerHTML="<div class='gantt_task_scale'></div><div class='gantt_data_area'></div>",this.$task_scale=this.$task.childNodes[0],this.$task_data=this.$task.childNodes[1],this.$task_data.innerHTML="<div class='gantt_task_bg'></div><div class='gantt_links_area'></div><div class='gantt_bars_area'></div>",this.$task_bg=this.$task_data.childNodes[0],this.$task_links=this.$task_data.childNodes[1],this.$task_bars=this.$task_data.childNodes[2],this._tasks={col_width:0,width:[],full_width:0,trace_x:[],rendered:{}};var e=this.$getConfig(),n=e[this.$config.bind+"_attribute"],i=e[this.$config.bindLinks+"_attribute"];!n&&this.$config.bind&&(n="data-"+this.$config.bind+"-id"),!i&&this.$config.bindLinks&&(i="data-"+this.$config.bindLinks+"-id"),this.$config.item_attribute=n||null,this.$config.link_attribute=i||null;var r=this._createLayerConfig();this.$config.layers||(this.$config.layers=r.tasks),this.$config.linkLayers||(this.$config.linkLayers=r.links),this._attachLayers(this.$gantt),this.callEvent("onReady",[]),this.$gantt.ext.dragTimeline&&(this._timelineDragScroll=this.$gantt.ext.dragTimeline.create(),this._timelineDragScroll.attach(this))},setSize:function(t,e){var n=this.$getConfig();if(1*t===t&&(this.$config.width=t),1*e===e){this.$config.height=e;var i=Math.max(this.$config.height-n.scale_height);this.$task_data.style.height=i+"px"}this.refresh(),this.$task_bg.style.backgroundImage="",n.smart_rendering&&this.$config.rowStore?this.$task_bg.style.height=this.getTotalHeight()+"px":this.$task_bg.style.height="";for(var r=this._tasks,a=this.$task_data.childNodes,o=0,s=a.length;o<s;o++){var l=a[o];l.hasAttribute("data-layer")&&l.style&&(l.style.width=r.full_width+"px")}},isVisible:function(){return this.$parent&&this.$parent.$config?!this.$parent.$config.hidden:this.$task.offsetWidth},getSize:function(){var t=this.$getConfig(),e=this.$config.rowStore?this.getTotalHeight():0,n=this.isVisible()?this._tasks.full_width:0;return{x:this.isVisible()?this.$config.width:0,y:this.isVisible()?this.$config.height:0,contentX:this.isVisible()?n:0,contentY:this.isVisible()?t.scale_height+e:0,scrollHeight:this.isVisible()?e:0,scrollWidth:this.isVisible()?n:0}},scrollTo:function(t,e){if(this.isVisible()){var n=!1;this.$config.scrollTop=this.$config.scrollTop||0,this.$config.scrollLeft=this.$config.scrollLeft||0,1*e===e&&(this.$config.scrollTop=e,this.$task_data.scrollTop=this.$config.scrollTop,n=!0),1*t===t&&(this.$task.scrollLeft=t,this.$config.scrollLeft=this.$task.scrollLeft,this._refreshScales(),n=!0),n&&this.callEvent("onScroll",[this.$config.scrollLeft,this.$config.scrollTop])}},_refreshScales:function(){if(this.isVisible()&&this.$getConfig().smart_scales){var t=this.getViewPort(),e=this._scales;this.$task_scale.innerHTML=this._getScaleChunkHtml(e,t.x,t.x_end)}},getViewPort:function(){var t=this.$config.scrollLeft||0,e=this.$config.scrollTop||0,n=this.$config.height||0,i=this.$config.width||0;return{y:e,y_end:e+n,x:t,x_end:t+i,height:n,width:i}},_createLayerConfig:function(){var t=this,e=function(){return t.isVisible()};return{tasks:[{expose:!0,renderer:this.$gantt.$ui.layers.taskBar(),container:this.$task_bars,filter:[e,function(t,e){return!e.hide_bar}]},{renderer:this.$gantt.$ui.layers.taskSplitBar(),filter:[e],container:this.$task_bars,append:!0},{renderer:this.$gantt.$ui.layers.taskRollupBar(),filter:[e],container:this.$task_bars,append:!0},{renderer:this.$gantt.$ui.layers.taskBg(),container:this.$task_bg,filter:[e]}],links:[{expose:!0,renderer:this.$gantt.$ui.layers.link(),container:this.$task_links,filter:[e]}]}},_attachLayers:function(t){this._taskLayers=[],this._linkLayers=[];var e=this,n=this.$gantt.$services.getService("layers");if(this.$config.bind){this._bindStore();var i=n.getDataRender(this.$config.bind);i||(i=n.createDataRender({name:this.$config.bind,defaultContainer:function(){return e.$task_data}})),i.container=function(){return e.$task_data};for(var r=this.$config.layers,a=0;r&&a<r.length;a++){"string"==typeof(c=r[a])&&(c=this.$gantt.$ui.layers[c]()),("function"==typeof c||c&&c.render&&c.update)&&(c={renderer:c}),c.view=this;var o=i.addLayer(c);this._taskLayers.push(o),c.expose&&(this._taskRenderer=i.getLayer(o))}this._initStaticBackgroundRender()}if(this.$config.bindLinks){e.$config.linkStore=e.$gantt.getDatastore(e.$config.bindLinks);var s=n.getDataRender(this.$config.bindLinks);s||(s=n.createDataRender({name:this.$config.bindLinks,defaultContainer:function(){return e.$task_data}}));var l=this.$config.linkLayers;for(a=0;l&&a<l.length;a++){var c;"string"==typeof c&&(c=this.$gantt.$ui.layers[c]()),(c=l[a]).view=this;var u=s.addLayer(c);this._taskLayers.push(u),l[a].expose&&(this._linkRenderer=s.getLayer(u))}}},_initStaticBackgroundRender:function(){var t=this,e=l.create(),n=t.$config.rowStore;n&&(this._staticBgHandler=n.attachEvent("onStoreUpdated",function(n,i,r){if(null===n&&t.isVisible()){var a=t.$getConfig();if(a.static_background){var o=t.$gantt.getDatastore(t.$config.bind),s=t.$task_bg_static;s||((s=document.createElement("div")).className="gantt_task_bg",t.$task_bg_static=s,t.$task_bg.nextSibling?t.$task_data.insertBefore(s,t.$task_bg.nextSibling):t.$task_data.appendChild(s)),o&&e.render(s,a,t.getScale(),t.getTotalHeight(),t.getItemHeight(i?i.id:null))}else a.static_background&&t.$task_bg_static&&t.$task_bg_static.parentNode&&t.$task_bg_static.parentNode.removeChild(t.$task_bg_static)}}),this.attachEvent("onDestroy",function(){e.destroy()}),this._initStaticBackgroundRender=function(){})},_clearLayers:function(t){var e=this.$gantt.$services.getService("layers"),n=e.getDataRender(this.$config.bind),i=e.getDataRender(this.$config.bindLinks);if(this._taskLayers)for(var r=0;r<this._taskLayers.length;r++)n.removeLayer(this._taskLayers[r]);if(this._linkLayers)for(r=0;r<this._linkLayers.length;r++)i.removeLayer(this._linkLayers[r]);this._linkLayers=[],this._taskLayers=[]},_render_tasks_scales:function(){var t=this.$getConfig(),e="",n=0,i=0,r=this.$gantt.getState();if(this.isVisible()){var a=this.$scaleHelper,o=this._getScales();i=t.scale_height;var s=this.$config.width;"x"!=t.autosize&&"xy"!=t.autosize||(s=Math.max(t.autosize_min_width,0));var l=a.prepareConfigs(o,t.min_column_width,s,i-1,r.min_date,r.max_date,t.rtl),c=this._tasks=l[l.length-1];this._scales=l,this._posFromDateCache={},e=this._getScaleChunkHtml(l,0,this.$config.width),n=c.full_width+"px",i+="px"}this.$task_scale.style.height=i,this.$task_data.style.width=this.$task_scale.style.width=n,this.$task_scale.innerHTML=e},_getScaleChunkHtml:function(t,e,n){for(var i=[],r=this.$gantt.templates.scale_row_class,a=0;a<t.length;a++){var o="gantt_scale_line",s=r(t[a]);s&&(o+=" "+s),i.push('<div class="'+o+'" style="height:'+t[a].height+"px;position:relative;line-height:"+t[a].height+'px">'+this._prepareScaleHtml(t[a],e,n)+"</div>")}return i.join("")},_prepareScaleHtml:function(t,e,n){var i=this.$getConfig(),r=this.$gantt.templates,a=[],s=null,l=null,c=t.format||t.template||t.date;"string"==typeof c&&(c=this.$gantt.date.date_to_str(c));var u=0,d=t.count;!i.smart_scales||isNaN(e)||isNaN(n)||(u=o.findBinary(t.left,e),d=o.findBinary(t.left,n)+1),l=t.css||function(){},!t.css&&i.inherit_scale_class&&(l=r.scale_cell_class);for(var h=u;h<d&&t.trace_x[h];h++){s=new Date(t.trace_x[h]);var f=c.call(this,s),_=t.width[h],g=t.height,p=t.left[h],v="",m="",y="";if(_){v="width:"+_+"px;height:"+g+"px;"+(i.smart_scales?"position:absolute;left:"+p+"px":""),y="gantt_scale_cell"+(h==t.count-1?" gantt_last_cell":""),(m=l.call(this,s))&&(y+=" "+m);var k="<div class='"+y+"'"+this.$gantt._waiAria.getTimelineCellAttr(f)+" style='"+v+"'>"+f+"</div>";a.push(k)}}return a.join("")},dateFromPos:function(t){var e=this._tasks;if(t<0||t>e.full_width||!e.full_width)return null;var n=o.findBinary(this._tasks.left,t),i=this._tasks.left[n],r=e.width[n]||e.col_width,a=0;r&&(a=(t-i)/r,e.rtl&&(a=1-a));var s=0;return a&&(s=this._getColumnDuration(e,e.trace_x[n])),new Date(e.trace_x[n].valueOf()+Math.round(a*s))},posFromDate:function(t){if(!this.isVisible())return 0;if(!t)return 0;var e=String(t.valueOf());if(void 0!==this._posFromDateCache[e])return this._posFromDateCache[e];var n=this.columnIndexByDate(t);this.$gantt.assert(n>=0,"Invalid day index");var i=Math.floor(n),r=n%1,a=this._tasks.left[Math.min(i,this._tasks.width.length-1)];i==this._tasks.width.length&&(a+=this._tasks.width[this._tasks.width.length-1]),r&&(i<this._tasks.width.length?a+=this._tasks.width[i]*(r%1):a+=1);var o=Math.round(a);return this._posFromDateCache[e]=o,Math.round(o)},_getNextVisibleColumn:function(t,e,n){for(var i=+e[t],r=t;n[i];)i=+e[++r];return r},_getPrevVisibleColumn:function(t,e,n){for(var i=+e[t],r=t;n[i];)i=+e[--r];return r},_getClosestVisibleColumn:function(t,e,n){var i=this._getNextVisibleColumn(t,e,n);return e[i]||(i=this._getPrevVisibleColumn(t,e,n)),i},columnIndexByDate:function(t){var e=new Date(t).valueOf(),n=this._tasks.trace_x_ascending,i=this._tasks.ignore_x,r=this.$gantt.getState();if(e<=r.min_date)return this._tasks.rtl?n.length:0;if(e>=r.max_date)return this._tasks.rtl?0:n.length;var a=o.findBinary(n,e),s=this._getClosestVisibleColumn(a,n,i),l=n[s],c=this._tasks.trace_index_transition;if(!l)return c?c[0]:0;var u=(t-n[s])/this._getColumnDuration(this._tasks,n[s]);return c?c[s]+(1-u):s+u},getItemPosition:function(t,e,n){var i,r,a;return this._tasks.rtl?(r=this.posFromDate(e||t.start_date),i=this.posFromDate(n||t.end_date)):(i=this.posFromDate(e||t.start_date),r=this.posFromDate(n||t.end_date)),a=Math.max(r-i,0),{left:i,top:this.getItemTop(t.id),height:this.getBarHeight(t.id),width:a,rowHeight:this.getItemHeight(t.id)}},getBarHeight:function(t,e){var n=this.$getConfig(),i=this.$config.rowStore.getItem(t),r=i.task_height||i.bar_height||n.bar_height||n.task_height,a=this.getItemHeight(t);"full"==r&&(r=a-(n.task_height_offset||5));return r=Math.min(r,a),e&&(r=Math.round(r/Math.sqrt(2))),Math.max(r,0)},getScale:function(){return this._tasks},_getScales:function(){var t=this.$getConfig(),e=this.$scaleHelper,n=[e.primaryScale(t)].concat(e.getSubScales(t));return e.sortScales(n),n},_getColumnDuration:function(t,e){return this.$gantt.date.add(e,t.step,t.unit)-e},_bindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);if(this.$config.rowStore=t,t&&!t._timelineCacheAttached){var e=this;t._timelineCacheAttached=t.attachEvent("onBeforeFilter",function(){e._resetTopPositionHeight()})}}},_unbindStore:function(){if(this.$config.bind){var t=this.$gantt.getDatastore(this.$config.bind);t&&t._timelineCacheAttached&&(t.detachEvent(t._timelineCacheAttached),t._timelineCacheAttached=!1)}},refresh:function(){this._bindStore(),this.$config.bindLinks&&(this.$config.linkStore=this.$gantt.getDatastore(this.$config.bindLinks)),this._resetTopPositionHeight(),this._resetHeight(),this._initStaticBackgroundRender(),this._render_tasks_scales()},destructor:function(){var t=this.$gantt;this._clearLayers(t),this._unbindStore(),this.$task=null,this.$task_scale=null,this.$task_data=null,this.$task_bg=null,this.$task_links=null,this.$task_bars=null,this.$gantt=null,this.$config.rowStore&&(this.$config.rowStore.detachEvent(this._staticBgHandler),this.$config.rowStore=null),this.$config.linkStore&&(this.$config.linkStore=null),this._timelineDragScroll&&(this._timelineDragScroll.destructor(),this._timelineDragScroll=null),this.callEvent("onDestroy",[]),this.detachAllEvents()}},t.exports=c},function(t,e){t.exports=function(t,e,n,i,r){if(!t.start_date||!t.end_date)return null;var a=n.getItemTop(t.id),o=n.getItemHeight(t.id);if(a>e.y_end||a+o<e.y)return!1;var s=n.posFromDate(t.start_date),l=n.posFromDate(t.end_date),c=Math.min(s,l)-200,u=Math.max(s,l)+200;return!(c>e.x_end||u<e.x)}},function(t,e){t.exports=function(t){function e(e,a,o){if(!t._isAllowedUnscheduledTask(e)&&t._isTaskInTimelineLimits(e)){var s=a.getItemPosition(e),l=o,c=a.$getTemplates(),u=t.getTaskType(e.type),d=a.getBarHeight(e.id,u==l.types.milestone),h=0;u==l.types.milestone&&(h=(d-s.height)/2);var f=Math.floor((a.getItemHeight(e.id)-d)/2);u==l.types.milestone&&(s.left-=Math.round(d/2),s.width=d);var _=document.createElement("div"),g=Math.round(s.width);a.$config.item_attribute&&(_.setAttribute(a.$config.item_attribute,e.id),_.setAttribute(a.$config.bind+"_id",e.id)),l.show_progress&&u!=l.types.milestone&&function(e,n,i,r,a){var o=1*e.progress||0;i=Math.max(i-2,0);var s=document.createElement("div"),l=Math.round(i*o);l=Math.min(i,l)