"),e+="
"+s+this.locale.labels["section_"+t[n].name]+"
"+a.render.call(this,t[n]),
e+="
"}}return e},gantt.resizeLightbox=function(){var t=this._lightbox;if(t){var e=t.childNodes[1];e.style.height="0px",e.style.height=e.scrollHeight+"px",t.style.height=e.scrollHeight+this.config.lightbox_additional_height+"px",e.style.height=e.scrollHeight+"px"}},gantt._center_lightbox=function(t){if(t){t.style.display="table";var e=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop,n=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,a=window.innerHeight||document.documentElement.clientHeight;
e?t.style.top=Math.round(e+Math.max((a-t.offsetHeight)/2,0))+"px":t.style.top=Math.round(Math.max((a-t.offsetHeight)/2,0)+9)+"px",document.documentElement.scrollWidth>document.body.offsetWidth?t.style.left=Math.round(n+(document.body.offsetWidth-t.offsetWidth)/2)+"px":t.style.left=Math.round((document.body.offsetWidth-t.offsetWidth)/2)+"px"}},gantt.showCover=function(){if(!this._cover){this._cover=document.createElement("DIV"),this._cover.className="gantt_cal_cover";var t=void 0!==document.height?document.height:document.body.offsetHeight,e=document.documentElement?document.documentElement.scrollHeight:0;
this._cover.style.height=Math.max(t,e)+"px",document.body.appendChild(this._cover)}},gantt._init_lightbox_events=function(){gantt.lightbox_events={},gantt.lightbox_events.gantt_save_btn=function(t){gantt._save_lightbox()},gantt.lightbox_events.gantt_delete_btn=function(t){gantt.callEvent("onLightboxDelete",[gantt._lightbox_id])&&(gantt.isTaskExists(gantt._lightbox_id)?gantt.$click.buttons["delete"](gantt._lightbox_id):gantt.hideLightbox())},gantt.lightbox_events.gantt_cancel_btn=function(t){gantt._cancel_lightbox();
},gantt.lightbox_events["default"]=function(t,e){if(e.getAttribute("dhx_button"))gantt.callEvent("onLightboxButton",[e.className,e,t]);else{var n,a,i,s=gantt._getClassName(e);-1!=s.indexOf("gantt_custom_button")&&(-1!=s.indexOf("gantt_custom_button_")?(n=e.parentNode.getAttribute("index"),i=e.parentNode.parentNode):(n=e.getAttribute("index"),i=e.parentNode,e=e.firstChild));var r=gantt._get_typed_lightbox_config();n&&(a=gantt.form_blocks[r[n].type],a.button_click(n,e,i,i.nextSibling))}},dhtmlxEvent(gantt.getLightbox(),"click",function(t){
t=t||window.event;var e=t.target?t.target:t.srcElement,n=gantt._getClassName(e);if(n||(e=e.previousSibling,n=gantt._getClassName(e)),e&&n&&0===n.indexOf("gantt_btn_set")&&(e=e.firstChild,n=gantt._getClassName(e)),e&&n){var a=dhtmlx.defined(gantt.lightbox_events[e.className])?gantt.lightbox_events[e.className]:gantt.lightbox_events["default"];return a(t,e)}return!1}),gantt.getLightbox().onkeydown=function(t){switch((t||event).keyCode){case gantt.keys.edit_save:if((t||event).shiftKey)return;gantt._save_lightbox();
break;case gantt.keys.edit_cancel:gantt._cancel_lightbox()}}},gantt._cancel_lightbox=function(){var t=this.getLightboxValues();this.callEvent("onLightboxCancel",[this._lightbox_id,t.$new]),gantt.isTaskExists(t.id)&&t.$new&&this._deleteTask(t.id,!0),this.refreshData(),this.hideLightbox()},gantt._save_lightbox=function(){var t=this.getLightboxValues();this.callEvent("onLightboxSave",[this._lightbox_id,t,!!t.$new])&&(t.$new?(delete t.$new,this.addTask(t)):this.isTaskExists(t.id)&&(dhtmlx.mixin(this.getTask(t.id),t,!0),
this.updateTask(t.id)),this.refreshData(),this.hideLightbox())},gantt._resolve_default_mapping=function(t){var e=t.map_to,n={time:!0,time_optional:!0,duration:!0,duration_optional:!0};return n[t.type]&&("auto"==t.map_to?e={start_date:"start_date",end_date:"end_date",duration:"duration"}:"string"==typeof t.map_to&&(e={start_date:t.map_to})),e},gantt.getLightboxValues=function(){var t={};gantt.isTaskExists(this._lightbox_id)&&(t=dhtmlx.mixin({},this.getTask(this._lightbox_id)));for(var e=this._get_typed_lightbox_config(),n=0;n0&&(o+=" ");var _="";switch(l){case"%Y":t._time_format_order[2]=d,t._time_format_order.size++;var h,c,g,u;t.year_range&&(isNaN(t.year_range)?t.year_range.push&&(g=t.year_range[0],u=t.year_range[1]):h=t.year_range),h=h||10,c=c||Math.floor(h/2),
g=g||i.getFullYear()-c,u=u||g+h;for(var f=g;u>f;f++)_+="";break;case"%m":t._time_format_order[1]=d,t._time_format_order.size++;for(var f=0;12>f;f++)_+="";break;case"%d":t._time_format_order[0]=d,t._time_format_order.size++;for(var f=1;32>f;f++)_+="";break;case"%H:%i":t._time_format_order[3]=d,t._time_format_order.size++;var f=r,p=i.getDate();for(t._time_values=[];s>f;){
var m=this.templates.time_picker(i);_+="",t._time_values.push(f),i.setTime(i.valueOf()+60*this._get_timepicker_step()*1e3);var v=i.getDate()!=p?1:0;f=24*v*60+60*i.getHours()+i.getMinutes()}}if(_){var k=t.readonly?"disabled='disabled'":"",x=e?" style='display:none'":"";o+=""}}return o},_fill_lightbox_select:function(t,e,n,a,i){if(t[e+a[0]].value=n.getDate(),t[e+a[1]].value=n.getMonth(),t[e+a[2]].value=n.getFullYear(),dhtmlx.defined(a[3])){
var s=60*n.getHours()+n.getMinutes();s=Math.round(s/gantt._get_timepicker_step())*gantt._get_timepicker_step();var r=t[e+a[3]];r.value=s,r.setAttribute("data-value",s)}},template:{render:function(t){var e=(t.height||"30")+"px";return""},set_value:function(t,e,n,a){t.innerHTML=e||""},get_value:function(t,e,n){return t.innerHTML||""},focus:function(t){}},textarea:{render:function(t){var e=(t.height||"130")+"px";return"";
},set_value:function(t,e,n){t.firstChild.value=e||""},get_value:function(t,e){return t.firstChild.value},focus:function(t){var e=t.firstChild;gantt._focus(e,!0)}},select:{render:function(t){for(var e=(t.height||"23")+"px",n=""},set_value:function(t,e,n,a){var i=t.firstChild;!i._dhx_onchange&&a.onchange&&(i.onchange=a.onchange,
i._dhx_onchange=!0),"undefined"==typeof e&&(e=(i.options[0]||{}).value),i.value=e||""},get_value:function(t,e){return t.firstChild.value},focus:function(t){var e=t.firstChild;gantt._focus(e,!0)}},time:{render:function(t){var e=this.form_blocks.getTimePicker.call(this,t),n=[""];return n.push(e),t.single_date?(e=this.form_blocks.getTimePicker.call(this,t,!0),n.push("")):n.push(" – "),
n.push(e),n.push("
"),n.join("")},set_value:function(t,e,n,a){var i=a,s=t.getElementsByTagName("select"),r=a._time_format_order;a._time_format_size;if(i.auto_end_date)for(var o=function(){_=new Date(s[r[2]].value,s[r[1]].value,s[r[0]].value,0,0),h=gantt.calculateEndDate(_,1),this.form_blocks._fill_lightbox_select(s,r.size,h,r,i)},d=0;4>d;d++)s[d].onchange=o;var l=gantt._resolve_default_mapping(a);"string"==typeof l&&(l={start_date:l});var _=n[l.start_date]||new Date,h=n[l.end_date]||gantt.calculateEndDate(_,1);
this.form_blocks._fill_lightbox_select(s,0,_,r,i),this.form_blocks._fill_lightbox_select(s,r.size,h,r,i)},get_value:function(t,e,n){var a=t.getElementsByTagName("select"),i=n._time_format_order,s=0,r=0;if(dhtmlx.defined(i[3])){var o=parseInt(a[i[3]].value,10);s=Math.floor(o/60),r=o%60}var d=new Date(a[i[2]].value,a[i[1]].value,a[i[0]].value,s,r);if(s=r=0,dhtmlx.defined(i[3])){var o=parseInt(a[i.size+i[3]].value,10);s=Math.floor(o/60),r=o%60}var l=new Date(a[i[2]+i.size].value,a[i[1]+i.size].value,a[i[0]+i.size].value,s,r);
d>=l&&(l=gantt.date.add(d,gantt._get_timepicker_step(),"minute"));var _=gantt._resolve_default_mapping(n),h={start_date:new Date(d),end_date:new Date(l)};return"string"==typeof _?h.start_date:h},focus:function(t){gantt._focus(t.getElementsByTagName("select")[0])}},duration:{render:function(t){var e=this.form_blocks.getTimePicker.call(this,t);e=""+e+"
";var n=this.locale.labels[this.config.duration_unit+"s"],a=t.single_date?' style="display:none"':"",i=t.readonly?" disabled='disabled'":"",s=" "+n+"
",r=""+e+" "+s+"
";
return r},set_value:function(t,e,n,a){function i(){var e=gantt.form_blocks.duration._get_start_date.call(gantt,t,a),n=gantt.form_blocks.duration._get_duration.call(gantt,t,a),i=gantt.calculateEndDate(e,n);h.innerHTML=gantt.templates.task_date(i)}function s(t){var e=l.value;e=parseInt(e,10),window.isNaN(e)&&(e=0),e+=t,1>e&&(e=1),l.value=e,i()}var r=a,o=t.getElementsByTagName("select"),d=t.getElementsByTagName("input"),l=d[1],_=[d[0],d[2]],h=t.getElementsByTagName("span")[0],c=a._time_format_order;_[0].onclick=dhtmlx.bind(function(){
s(-1*this.config.duration_step)},this),_[1].onclick=dhtmlx.bind(function(){s(1*this.config.duration_step)},this),o[0].onchange=i,o[1].onchange=i,o[2].onchange=i,o[3]&&(o[3].onchange=i),l.onkeydown=dhtmlx.bind(function(t){t=t||window.event;var e=t.charCode||t.keyCode||t.which;return 40==e?(s(-1*this.config.duration_step),!1):38==e?(s(1*this.config.duration_step),!1):void window.setTimeout(function(t){i()},1)},this),l.onchange=dhtmlx.bind(function(t){i()},this);var g=gantt._resolve_default_mapping(a);
"string"==typeof g&&(g={start_date:g});var u=n[g.start_date]||new Date,f=n[g.end_date]||gantt.calculateEndDate(u,1),p=Math.round(n[g.duration])||gantt.calculateDuration(u,f);gantt.form_blocks._fill_lightbox_select(o,0,u,c,r),l.value=p,i()},_get_start_date:function(t,e){var n=t.getElementsByTagName("select"),a=e._time_format_order,i=0,s=0;if(dhtmlx.defined(a[3])){var r=n[a[3]],o=parseInt(r.value,10);isNaN(o)&&r.hasAttribute("data-value")&&(o=parseInt(r.getAttribute("data-value"),10)),i=Math.floor(o/60),
s=o%60}return new Date(n[a[2]].value,n[a[1]].value,n[a[0]].value,i,s)},_get_duration:function(t,e){var n=t.getElementsByTagName("input")[1];return n=parseInt(n.value,10),(!n||window.isNaN(n))&&(n=1),0>n&&(n*=-1),n},get_value:function(t,e,n){var a=gantt.form_blocks.duration._get_start_date(t,n),i=gantt.form_blocks.duration._get_duration(t,n),s=gantt.calculateEndDate(a,i),r=gantt._resolve_default_mapping(n),o={start_date:new Date(a),end_date:new Date(s),duration:i};return"string"==typeof r?o.start_date:o;
},focus:function(t){gantt._focus(t.getElementsByTagName("select")[0])}},parent:{_filter:function(t,e,n){var a=e.filter||function(){return!0};t=t.slice(0);for(var i=0;i",
this._obj.innerHTML=e,this.$container=this._obj.firstChild;var n=this.$container.childNodes;this.$grid=n[0],this.$task=n[1],this.$scroll_ver=n[2],this.$scroll_hor=n[3],this.$grid.innerHTML="",this.$grid_scale=this.$grid.childNodes[0],this.$grid_data=this.$grid.childNodes[1],this.$task.innerHTML="",
this.$task_scale=this.$task.childNodes[0],this.$task_data=this.$task.childNodes[1],this.$task_bg=this.$task_data.childNodes[0],this.$task_links=this.$task_data.childNodes[1],this.$task_bars=this.$task_data.childNodes[2]},gantt.$click={buttons:{edit:function(t){gantt.showLightbox(t)},"delete":function(t){var e=gantt.locale.labels.confirm_deleting,n=gantt.locale.labels.confirm_deleting_title;gantt._dhtmlx_confirm(e,n,function(){var e=gantt.getTask(t);e.$new?(gantt._deleteTask(t,!0),gantt.refreshData()):gantt.deleteTask(t),
gantt.hideLightbox()})}}},gantt._calculate_content_height=function(){var t=this.config.scale_height,e=this._order.length*this.config.row_height,n=this._scroll_hor?this.config.scroll_size+1:0;return this._is_grid_visible()||this._is_chart_visible()?t+e+2+n:0},gantt._calculate_content_width=function(){var t=this._get_grid_width(),e=this._tasks?this._tasks.full_width:0;this._scroll_ver?this.config.scroll_size+1:0;return this._is_chart_visible()||(e=0),this._is_grid_visible()||(t=0),t+e+1},gantt._get_resize_options=function(){
var t={x:!1,y:!1};return"xy"==this.config.autosize?t.x=t.y=!0:"y"==this.config.autosize||this.config.autosize===!0?t.y=!0:"x"==this.config.autosize&&(t.x=!0),t},gantt._clean_el_size=function(t){return 1*(t||"").toString().replace("px","")||0},gantt._get_box_styles=function(){var t=null;t=window.getComputedStyle?window.getComputedStyle(this._obj,null):{width:this._obj.clientWidth,height:this._obj.clientHeight};var e=["width","height","paddingTop","paddingBottom","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],n={
boxSizing:"border-box"==t.boxSizing};t.MozBoxSizing&&(n.boxSizing="border-box"==t.MozBoxSizing);for(var a=0;aMath.abs(i)){if(n.x)return!0;var s=a/-40,r=gantt.$task.scrollLeft+30*s;gantt.scrollTo(r,null),gantt.$scroll_hor.scrollTop=o}else{if(n.y)return!0;var s=i/-40;"undefined"==typeof i&&(s=t.detail);var o=gantt.$scroll_ver.scrollTop+30*s;if(!gantt.config.prevent_default_scroll&&gantt._cached_scroll_pos&&gantt._cached_scroll_pos.y==o)return!0;
gantt.scrollTo(null,o),gantt.$scroll_ver.scrollTop=o}return t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1}dhtmlxEvent(this.$scroll_hor,"scroll",function(){if(new Date-(gantt._wheel_time||0)<100)return!0;if(!gantt._touch_scroll_active){var t=gantt.$scroll_hor.scrollLeft;gantt.scrollTo(t)}}),dhtmlxEvent(this.$scroll_ver,"scroll",function(){if(!gantt._touch_scroll_active){var t=gantt.$scroll_ver.scrollTop;gantt.$grid_data.scrollTop=t,gantt.scrollTo(null,t)}}),dhtmlxEvent(this.$task,"scroll",function(){
var t=gantt.$task.scrollLeft,e=gantt.$scroll_hor.scrollLeft;e!=t&&(gantt.$scroll_hor.scrollLeft=t)}),dhtmlxEvent(this.$task_data,"scroll",function(){var t=gantt.$task_data.scrollTop,e=gantt.$scroll_ver.scrollTop;e!=t&&(gantt.$scroll_ver.scrollTop=t)});var e=_isFF&&!window._KHTMLrv;e?dhtmlxEvent(gantt.$container,"wheel",t):dhtmlxEvent(gantt.$container,"mousewheel",t)},gantt._scroll_resize=function(){if(!(this._x<20||this._y<20)){var t=this._get_grid_width(),e=Math.max(this._x-t,0),n=Math.max(this._y-this.config.scale_height,0),a=this.config.scroll_size+1,i=Math.max(this.$task_data.offsetWidth-a,0),s=this.config.row_height*this._order.length,r=this._get_resize_options(),o=this._scroll_hor=r.x?!1:i>e,d=this._scroll_ver=r.y?!1:s>n;
this.$scroll_hor.style.display=o?"block":"none",this.$scroll_hor.style.height=(o?a:0)+"px",this.$scroll_hor.style.width=Math.max(this._x-(d?a:2),0)+"px",this.$scroll_hor.firstChild.style.width=i+t+a+2+"px",this.$scroll_ver.style.display=d?"block":"none",this.$scroll_ver.style.width=(d?a:0)+"px",this.$scroll_ver.style.height=Math.max(this._y-(o?a:0)-this.config.scale_height,0)+"px",this.$scroll_ver.style.top=this.config.scale_height+"px",this.$scroll_ver.firstChild.style.height=this.config.scale_height+s+"px";
}},gantt._getClassName=function(t){if(!t)return"";var e=t.className||"";return e.baseVal&&(e=e.baseVal),e.indexOf||(e=""),gantt._trim(e)},gantt.locate=function(t){var e=gantt._get_target_node(t),n=gantt._getClassName(e);if((n||"").indexOf("gantt_task_cell")>=0)return null;for(var a=arguments[1]||this.config.task_attribute;e;){if(e.getAttribute){var i=e.getAttribute(a);if(i)return i}e=e.parentNode}return null},gantt._get_target_node=function(t){var e;return t.tagName?e=t:(t=t||window.event,e=t.target||t.srcElement),
e},gantt._trim=function(t){var e=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")};return e.apply(t)},gantt._locate_css=function(t,e,n){void 0===n&&(n=!0);for(var a=gantt._get_target_node(t),i="";a;){if(i=gantt._getClassName(a)){var s=i.indexOf(e);if(s>=0){if(!n)return a;var r=0===s||!gantt._trim(i.charAt(s-1)),o=s+e.length>=i.length||!gantt._trim(i.charAt(s+e.length));if(r&&o)return a}}a=a.parentNode}return null},gantt._locateHTML=function(t,e){var n=gantt._get_target_node(t);
for(e=e||this.config.task_attribute;n;){if(n.getAttribute){var a=n.getAttribute(e);if(a)return n}n=n.parentNode}return null},gantt.getTaskRowNode=function(t){for(var e=this.$grid_data.childNodes,n=this.config.task_attribute,a=0;an?!0:t._on_timeout?!1:(setTimeout(function(){delete t._on_timeout},n),t._on_timeout=!0,!0)},gantt.selectTask=function(t){if(!this.config.select_task)return!1;if(t){if(this._selected_task==t)return this._selected_task;if(!this.callEvent("onBeforeTaskSelected",[t]))return!1;this.unselectTask(),this._selected_task=t,
this.refreshTask(t),this.callEvent("onTaskSelected",[t])}return this._selected_task},gantt.unselectTask=function(t){var t=t||this._selected_task;t&&(this._selected_task=null,this.refreshTask(t),this.callEvent("onTaskUnselected",[t]))},gantt.getSelectedId=function(){return dhtmlx.defined(this._selected_task)?this._selected_task:null},gantt.changeLightboxType=function(t){return this.getLightboxType()==t?!0:void gantt._silent_redraw_lightbox(t)},gantt._is_render_active=function(){return!this._skip_render;
},gantt._correct_dst_change=function(t,e,n,a){var i=gantt._get_line(a)*n;if(i>3600&&86400>i){var s=t.getTimezoneOffset()-e;s&&(t=gantt.date.add(t,s,"minute"))}return t},gantt.batchUpdate=function(t){var e,n=this._dp&&"off"!=this._dp.updateMode;n&&(e=this._dp.updateMode,this._dp.setUpdateMode("off")),this._skip_render=!0;try{t()}catch(a){}this._skip_render=!1,this.render(),n&&(this._dp.setUpdateMode(e),this._dp.sendData())},gantt.date={init:function(){for(var t=gantt.locale.date.month_short,e=gantt.locale.date.month_short_hash={},n=0;n=0&&!t.getHours()&&n.getHours()&&(n.getDate()<=t.getDate()||n.getMonth()t?"0"+t:t},copy:function(t){return new Date(t.valueOf())},date_to_str:function(t,e){
return t=t.replace(/%[a-zA-Z]/g,function(t){switch(t){case"%d":return'"+gantt.date.to_fixed(date.getDate())+"';case"%m":return'"+gantt.date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+gantt.date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+gantt.locale.date.day_short[date.getDay()]+"';case"%l":return'"+gantt.locale.date.day_full[date.getDay()]+"';case"%M":return'"+gantt.locale.date.month_short[date.getMonth()]+"';
case"%F":return'"+gantt.locale.date.month_full[date.getMonth()]+"';case"%h":return'"+gantt.date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+gantt.date.to_fixed(date.getHours())+"';case"%i":return'"+gantt.date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+gantt.date.to_fixed(date.getSeconds())+"';
case"%W":return'"+gantt.date.to_fixed(gantt.date.getISOWeek(date))+"';default:return t}}),e&&(t=t.replace(/date\.get/g,"date.getUTC")),new Function("date",'return "'+t+'";')},str_to_date:function(t,e){for(var n="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",a=t.match(/%[a-zA-Z]/g),i=0;i50?1900:2000);";break;case"%g":case"%G":
case"%h":case"%H":n+="set[3]=temp["+i+"]||0;";break;case"%i":n+="set[4]=temp["+i+"]||0;";break;case"%Y":n+="set[0]=temp["+i+"]||0;";break;case"%a":case"%A":n+="set[3]=set[3]%12+((temp["+i+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":n+="set[5]=temp["+i+"]||0;";break;case"%M":n+="set[1]=gantt.locale.date.month_short_hash[temp["+i+"]]||0;";break;case"%F":n+="set[1]=gantt.locale.date.month_full_hash[temp["+i+"]]||0;"}var s="set[0],set[1],set[2],set[3],set[4],set[5]";return e&&(s=" Date.UTC("+s+")"),
new Function("date","var set=[0,0,1,0,0,0]; "+n+" return new Date("+s+");")},getISOWeek:function(t){if(!t)return!1;var e=t.getDay();0===e&&(e=7);var n=new Date(t.valueOf());n.setDate(t.getDate()+(4-e));var a=n.getFullYear(),i=Math.round((n.getTime()-new Date(a,0,1).getTime())/864e5),s=1+Math.floor(i/7);return s},getUTCISOWeek:function(t){return this.getISOWeek(t)},convert_to_utc:function(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds());
},parseDate:function(t,e){return"string"==typeof t&&(dhtmlx.defined(e)&&(e="string"==typeof e?dhtmlx.defined(gantt.templates[e])?gantt.templates[e]:gantt.date.str_to_date(e):gantt.templates.xml_date),t=t?e(t):null),t}},gantt.date.quarter_start=function(t){gantt.date.month_start(t);var e,n=t.getMonth();return e=n>=9?9:n>=6?6:n>=3?3:0,t.setMonth(e),t},gantt.date.add_quarter=function(t,e){return gantt.date.add(t,3*e,"month")},gantt.config||(gantt.config={}),gantt.config||(gantt.config={}),gantt.templates||(gantt.templates={}),
function(){dhtmlx.mixin(gantt.config,{links:{finish_to_start:"0",start_to_start:"1",finish_to_finish:"2",start_to_finish:"3"},types:{task:"task",project:"project",milestone:"milestone"},duration_unit:"day",work_time:!1,correct_work_time:!1,skip_off_time:!1,autosize:!1,autosize_min_width:0,show_links:!0,show_task_cells:!0,static_background:!1,branch_loading:!1,show_loading:!1,show_chart:!0,show_grid:!0,min_duration:36e5,xml_date:"%d-%m-%Y %H:%i",api_date:"%d-%m-%Y %H:%i",start_on_monday:!0,server_utc:!1,
show_progress:!0,fit_tasks:!1,select_task:!0,scroll_on_click:!0,preserve_scroll:!0,readonly:!1,date_grid:"%Y-%m-%d",drag_links:!0,drag_progress:!0,drag_resize:!0,drag_move:!0,drag_mode:{resize:"resize",progress:"progress",move:"move",ignore:"ignore"},round_dnd_dates:!0,link_wrapper_width:20,root_id:0,autofit:!1,columns:[{name:"text",tree:!0,width:"*",resize:!0},{name:"start_date",align:"center",resize:!0},{name:"duration",align:"center"},{name:"add",width:"44"}],step:1,scale_unit:"day",scale_offset_minimal:!0,
subscales:[],inherit_scale_class:!1,time_step:60,duration_step:1,date_scale:"%d %M",task_date:"%d %F %Y",time_picker:"%H:%i",task_attribute:"task_id",link_attribute:"link_id",layer_attribute:"data-layer",buttons_left:["gantt_save_btn","gantt_cancel_btn"],_migrate_buttons:{dhx_save_btn:"gantt_save_btn",dhx_cancel_btn:"gantt_cancel_btn",dhx_delete_btn:"gantt_delete_btn"},buttons_right:["gantt_delete_btn"],lightbox:{sections:[{name:"description",height:70,map_to:"text",type:"textarea",focus:!0},{name:"time",
type:"duration",map_to:"auto"}],project_sections:[{name:"description",height:70,map_to:"text",type:"textarea",focus:!0},{name:"type",type:"typeselect",map_to:"type"},{name:"time",type:"duration",readonly:!0,map_to:"auto"}],milestone_sections:[{name:"description",height:70,map_to:"text",type:"textarea",focus:!0},{name:"type",type:"typeselect",map_to:"type"},{name:"time",type:"duration",single_date:!0,map_to:"auto"}]},drag_lightbox:!0,sort:!1,details_on_create:!0,details_on_dblclick:!0,initial_scroll:!0,
task_scroll_offset:100,order_branch:!1,order_branch_free:!1,task_height:"full",min_column_width:70,min_grid_column_width:70,grid_resizer_column_attribute:"column_index",grid_resizer_attribute:"grid_resizer",keep_grid_width:!1,grid_resize:!1,show_unscheduled:!0,readonly_property:"readonly",editable_property:"editable",type_renderers:{},open_tree_initially:!1,optimize_render:"auto",prevent_default_scroll:!1,show_errors:!0}),gantt.keys={edit_save:13,edit_cancel:27},gantt._init_template=function(t,e,n){
var a=this._reg_templates||{};n=n||t,this.config[t]&&a[n]!=this.config[t]&&(e&&this.templates[n]||(this.templates[n]=this.date.date_to_str(this.config[t]),a[n]=this.config[t])),this._reg_templates=a},gantt._init_templates=function(){var t=gantt.locale.labels;t.gantt_save_btn=t.icon_save,t.gantt_cancel_btn=t.icon_cancel,t.gantt_delete_btn=t.icon_delete;var e=this.date.date_to_str,n=this.config;gantt._init_template("date_scale",!0),gantt._init_template("date_grid",!0,"grid_date_format"),gantt._init_template("task_date",!0),
dhtmlx.mixin(this.templates,{xml_date:this.date.str_to_date(n.xml_date,n.server_utc),xml_format:e(n.xml_date,n.server_utc),api_date:this.date.str_to_date(n.api_date),progress_text:function(t,e,n){return""},grid_header_class:function(t,e){return""},task_text:function(t,e,n){return n.text},task_class:function(t,e,n){return""},grid_row_class:function(t,e,n){return""},task_row_class:function(t,e,n){return""},task_cell_class:function(t,e){return""},scale_cell_class:function(t){return""},scale_row_class:function(t){
return""},grid_indent:function(t){return""},grid_folder:function(t){return""},grid_file:function(t){return""},grid_open:function(t){return""},grid_blank:function(t){return""},date_grid:function(t,e){return e&&gantt.isUnscheduledTask(e)&&gantt.config.show_unscheduled?gantt.templates.task_unscheduled_time(e):gantt.templates.grid_date_format(t);
},task_time:function(t,e,n){return gantt.isUnscheduledTask(n)&&gantt.config.show_unscheduled?gantt.templates.task_unscheduled_time(n):gantt.templates.task_date(t)+" - "+gantt.templates.task_date(e)},task_unscheduled_time:function(t){return""},time_picker:e(n.time_picker),link_class:function(t){return""},link_description:function(t){var e=gantt.getTask(t.source),n=gantt.getTask(t.target);return""+e.text+" – "+n.text+""},drag_link:function(t,e,n,a){t=gantt.getTask(t);var i=gantt.locale.labels,s=""+t.text+" "+(e?i.link_start:i.link_end)+"
";
return n&&(n=gantt.getTask(n),s+=" "+n.text+" "+(a?i.link_start:i.link_end)+"
"),s},drag_link_class:function(t,e,n,a){var i="";if(t&&n){var s=gantt.isLinkAllowed(t,n,e,a);i=" "+(s?"gantt_link_allow":"gantt_link_deny")}return"gantt_link_tooltip"+i}}),this.callEvent("onTemplatesReady",[])}}(),window.jQuery&&!function(t){var e=[];t.fn.dhx_gantt=function(n){if(n=n||{},"string"!=typeof n){var a=[];return this.each(function(){if(this&&this.getAttribute&&!this.getAttribute("dhxgantt")){for(var t in n)"data"!=t&&(gantt.config[t]=n[t]);
gantt.init(this),n.data&&gantt.parse(n.data),a.push(gantt)}}),1===a.length?a[0]:a}return e[n]?e[n].apply(this,[]):void t.error("Method "+n+" does not exist on jQuery.dhx_gantt")}}(jQuery),window.dhtmlx&&(dhtmlx.attaches||(dhtmlx.attaches={}),dhtmlx.attaches.attachGantt=function(t,e){var n=document.createElement("DIV");n.id="gantt_"+dhtmlx.uid(),n.style.width="100%",n.style.height="100%",n.cmp="grid",document.body.appendChild(n),this.attachObject(n.id);var a=this.vs[this.av];a.grid=gantt,gantt.init(n.id,t,e),
n.firstChild.style.border="none",a.gridId=n.id,a.gridObj=n;var i="_viewRestore";return this.vs[this[i]()].grid}),gantt.locale={date:{month_full:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],month_short:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],day_full:["Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado"],day_short:["Dom","Lun","Mar","Mie","Jue","Vie","Sab"]},labels:{new_task:"Nueva Tarea",
icon_save:"Guardar",icon_cancel:"Cancelar",icon_details:"Details",icon_edit:"Edit",icon_delete:"Borrar",confirm_closing:"",confirm_deleting:"la tarea sera eliminada permanentemente, ¿borrar?",section_description:"Descripción",section_time:"Time period",section_type:"Type",column_text:"Tarea",column_start_date:"Inicio",column_duration:"Duracion",column_add:"",link:"Link",confirm_link_deleting:"will be deleted",link_start:" (start)",link_end:" (end)",type_task:"Task",type_project:"Project",type_milestone:"Milestone",
minutes:"Minutos",hours:"Horas",days:"Dias",weeks:"Semana",months:"Mes",years:"Año"}},gantt.skins.skyblue={config:{grid_width:350,row_height:27,scale_height:27,link_line_width:1,link_arrow_size:8,lightbox_additional_height:75},_second_column_width:95,_third_column_width:80},gantt.skins.meadow={config:{grid_width:350,row_height:27,scale_height:30,link_line_width:2,link_arrow_size:6,lightbox_additional_height:72},_second_column_width:95,_third_column_width:80},gantt.skins.terrace={config:{grid_width:360,
row_height:35,scale_height:35,link_line_width:2,link_arrow_size:6,lightbox_additional_height:75},_second_column_width:90,_third_column_width:70},gantt.skins.broadway={config:{grid_width:360,row_height:35,scale_height:35,link_line_width:1,link_arrow_size:7,lightbox_additional_height:86},_second_column_width:90,_third_column_width:80,_lightbox_template:"",
_config_buttons_left:{},_config_buttons_right:{gantt_delete_btn:"icon_delete",gantt_save_btn:"icon_save"}},gantt.config.touch_drag=500,gantt.config.touch=!0,gantt.config.touch_feedback=!0,gantt._touch_feedback=function(){gantt.config.touch_feedback&&navigator.vibrate&&navigator.vibrate(1)},gantt._init_touch_events=function(){"force"!=this.config.touch&&(this.config.touch=this.config.touch&&(-1!=navigator.userAgent.indexOf("Mobile")||-1!=navigator.userAgent.indexOf("iPad")||-1!=navigator.userAgent.indexOf("Android")||-1!=navigator.userAgent.indexOf("Touch"))),
this.config.touch&&(window.navigator.msPointerEnabled?this._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(t){return t.pointerType==t.MSPOINTER_TYPE_MOUSE?null:t},function(t){return!t||t.pointerType==t.MSPOINTER_TYPE_MOUSE}):this._touch_events(["touchmove","touchstart","touchend"],function(t){return t.touches&&t.touches.length>1?null:t.touches[0]?{target:t.target,pageX:t.touches[0].pageX,pageY:t.touches[0].pageY,clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}:t},function(){
return!1}))},gantt._touch_events=function(t,e,n){function a(t){return t&&t.preventDefault&&t.preventDefault(),(t||event).cancelBubble=!0,!1}function i(t){var e=gantt._task_area_pulls,n=gantt.getTask(t);if(n&&gantt.isTaskVisible(t))for(var a in e)if(n=e[a][t],n&&n.getAttribute("task_id")&&n.getAttribute("task_id")==t){var i=n.cloneNode(!0);return h=n,e[a][t]=i,n.style.display="none",i.className+=" gantt_drag_move ",n.parentNode.appendChild(i),i}}var s,r=0,o=!1,d=!1,l=null,_=null,h=null;this._gantt_touch_event_ready||(this._gantt_touch_event_ready=1,
dhtmlxEvent(gantt.$container,t[0],function(t){if(!n(t)&&o){_&&clearTimeout(_);var i=e(t);if(gantt._tasks_dnd.drag.id||gantt._tasks_dnd.drag.start_drag)return gantt._tasks_dnd.on_mouse_move(i),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,!1;if(i&&l){var h=l.pageX-i.pageX,c=l.pageY-i.pageY;if(!d&&(Math.abs(h)>5||Math.abs(c)>5)&&(gantt._touch_scroll_active=d=!0,r=0,s=gantt.getScrollState()),d){gantt.scrollTo(s.x+h,s.y+c);var g=gantt.getScrollState();if(s.x!=g.x&&c>2*h||s.y!=g.y&&h>2*c)return a(t);
}}return a(t)}})),dhtmlxEvent(this.$container,"contextmenu",function(t){return o?a(t):void 0}),dhtmlxEvent(this.$container,t[1],function(t){if(!n(t)){if(t.touches&&t.touches.length>1)return void(o=!1);if(o=!0,l=e(t),l&&r){var s=new Date;500>s-r?(gantt._on_dblclick(l),a(t)):r=s}else r=new Date;_=setTimeout(function(){var t=gantt.locate(l);!t||gantt._locate_css(l,"gantt_link_control")||gantt._locate_css(l,"gantt_grid_data")||(gantt._tasks_dnd.on_mouse_down(l),gantt._tasks_dnd.drag&&gantt._tasks_dnd.drag.start_drag&&(i(t),
gantt._tasks_dnd._start_dnd(l),gantt._touch_drag=!0,gantt.refreshTask(t),gantt._touch_feedback())),_=null},gantt.config.touch_drag)}}),dhtmlxEvent(this.$container,t[2],function(t){if(!n(t)){_&&clearTimeout(_),gantt._touch_drag=!1,o=!1;var a=e(t);gantt._tasks_dnd.on_mouse_up(a),h&&(gantt.refreshTask(gantt.locate(h)),h.parentNode&&(h.parentNode.removeChild(h),gantt._touch_feedback())),gantt._touch_scroll_active=o=d=!1,h=null}})};
//# sourceMappingURL=sources/dhtmlxgantt.js.map