/*
@license
dhtmlxScheduler v.5.1.6 Stardard

This software is covered by GPL license. You also can obtain Commercial or Enterprise license to use it in non-GPL project - please contact sales@dhtmlx.com. Usage without proper license is prohibited.

(c) Dinamenta, UAB.
*/
!function(){scheduler.config.all_timed="short",scheduler.config.all_timed_month=!1;var e=function(e){return(e.end_date-e.start_date)/36e5>=24?"resize"==scheduler._drag_mode&&scheduler._drag_id==e.id?!0:!1:!0};scheduler._safe_copy=function(e){var t=null,a=scheduler._copy_event(e);return e.event_pid&&(t=scheduler.getEvent(e.event_pid)),t&&t.isPrototypeOf(e)&&(delete a.event_length,delete a.event_pid,delete a.rec_pattern,delete a.rec_type),a};var t=scheduler._pre_render_events_line,a=scheduler._pre_render_events_table,i=function(e,i){
return this._table_view?a.call(this,e,i):t.call(this,e,i)};scheduler._pre_render_events_line=scheduler._pre_render_events_table=function(t,a){function n(e){var t=r(e.start_date);return+e.end_date>+t}function r(e){var t=scheduler.date.add(e,1,"day");return t=scheduler.date.date_part(t)}function l(e,t){var a=scheduler.date.date_part(new Date(e));return a.setHours(t),a}if(!this.config.all_timed||this._table_view&&"month"!=this._mode||"month"==this._mode&&!this.config.all_timed_month)return i.call(this,t,a);
for(var o=0;o<t.length;o++){var d=t[o];if(!d._timed)if("short"!=this.config.all_timed||e(d)){var s=this._safe_copy(d);d._virtual?s._first_chunk=!1:s._first_chunk=!0,s._drag_resize=!1,s._virtual=!0,s.start_date=new Date(s.start_date),n(d)?(s.end_date=r(s.start_date),24!=this.config.last_hour&&(s.end_date=l(s.start_date,this.config.last_hour))):s.end_date=new Date(d.end_date);var _=!1;s.start_date<this._max_date&&s.end_date>this._min_date&&s.start_date<s.end_date&&(t[o]=s,_=!0);var c=this._safe_copy(d);
if(c._virtual=!0,c.end_date=new Date(c.end_date),c.start_date<this._min_date?c.start_date=l(this._min_date,this.config.first_hour):c.start_date=l(r(d.start_date),this.config.first_hour),c.start_date<this._max_date&&c.start_date<c.end_date){if(!_){t[o--]=c;continue}t.splice(o+1,0,c),c._last_chunk=!1}else s._last_chunk=!0,s._drag_resize=!0}else"month"!=this._mode&&t.splice(o--,1)}var u="move"==this._drag_mode?!1:a;return i.call(this,t,u)};var n=scheduler.get_visible_events;scheduler.get_visible_events=function(e){
return this.config.all_timed&&this.config.multi_day?n.call(this,!1):n.call(this,e)},scheduler.attachEvent("onBeforeViewChange",function(e,t,a,i){return scheduler._allow_dnd="day"==a||"week"==a,!0}),scheduler._is_main_area_event=function(t){return!!(t._timed||this.config.all_timed===!0||"short"==this.config.all_timed&&e(t))};var r=scheduler.updateEvent;scheduler.updateEvent=function(e){var t,a,i=scheduler.getEvent(e);i&&(t=scheduler.config.all_timed&&!(scheduler.isOneDayEvent(scheduler._events[e])||scheduler.getState().drag_id),
t&&(a=scheduler.config.update_render,scheduler.config.update_render=!0)),r.apply(scheduler,arguments),i&&t&&(scheduler.config.update_render=a)}}();
//# sourceMappingURL=../sources/ext/dhtmlxscheduler_all_timed.js.map