MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / n

Function n

codebase/dhtmlxscheduler.js:9–9  ·  view source on GitHub ↗
(a,o,_)

Source from the content-addressed store, hash-verified

7(c) XB Software Ltd.
8
9*/const Q=typeof window<"u"?window:global;function Mt(e){let i=[],t=!1,n=null,s=null;function a(){return e.config.drag_highlight&&e.markTimespan}function o(d){const l=e.getView(d);return l?l.layout:d}function _(d){const{event:l,layout:h,viewName:p,sectionId:v,eventNode:g}=d;(function(f,y){switch(y){case"month":f.style.top="",f.style.left="";break;case"timeline":f.style.left="",f.style.marginLeft="1px";break;default:f.style.top=""}})(g,h);const c={};let u={start_date:l.start_date,end_date:l.end_date,css:"dhx_scheduler_dnd_marker",html:g};if(h=="timeline"){const f=e.getView(p);if(f.round_position){const y=e._get_date_index(f,l.start_date),w=f._trace_x[y];u.start_date=w}}return h!="timeline"&&h!="month"||(u={...u,end_date:e.date.add(l.start_date,1,"minute")}),v&&(c[p]=v,u.sections=c),u}function r(d){const{layout:l}=d;let h;switch(l){case"month":h=function(p){let v=[];const{event:g,layout:c,viewName:u,sectionId:f}=p,y=[];let w=new Date(g.start_date);for(;w.valueOf()<g.end_date.valueOf();){let M={start_date:w};y.push(M),w=e.date.week_start(e.date.add(w,1,"week"))}let D=e.$container.querySelectorAll(`[${e.config.event_attribute}='${g.id}']`);for(let M=0;M<D.length;M++){const k={event:y[M],layout:c,viewName:u,sectionId:f,eventNode:D[M].cloneNode(!0)};v.push(_(k))}return v}(d);break;case"timeline":case"units":h=function(p){let v=[];const{event:g,layout:c,viewName:u,eventNode:f}=p;let y=function(w){const D=e.getView(w);return D.y_property?D.y_property:D.map_to?D.map_to:void 0}(u);if(y){const w=String(g[y]).split(e.config.section_delimiter).map(M=>String(M)),D=[];for(let M=0;M<w.length;M++){D[M]=f.cloneNode(!0);const k={event:g,layout:c,viewName:u,sectionId:w[M],eventNode:D[M]};v.push(_(k))}}return v}(d);break;default:h=function(p){const{event:v,layout:g,viewName:c,sectionId:u}=p;let f=[],y=e.$container.querySelectorAll(`[${e.config.event_attribute}='${v.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`);if(y)for(let w=0;w<y.length;w++){let D=y[w].cloneNode(!0);const M={event:{start_date:new Date(+D.getAttribute("data-bar-start")),end_date:new Date(+D.getAttribute("data-bar-end"))},layout:g,viewName:c,sectionId:u,eventNode:D};f.push(_(M))}return f}(d)}h.forEach(p=>{i.push(e.markTimespan(p))})}e.attachEvent("onBeforeDrag",function(d,l,h){return a()&&(t=!0,s=e.getEvent(d),n=h.target.closest(`[${e.config.event_attribute}]`),o(e.getState().mode)=="units"&&e.config.cascade_event_display&&(e.unselect(d),n=h.target.closest(`[${e.config.event_attribute}]`))),!0}),e.attachEvent("onEventDrag",function(d,l,h){if(t&&a()){t=!1;const p=e.getState().mode,v=o(p),g=e.getActionData(h).section;s&&r({event:s,layout:v,viewName:p,sectionId:g,eventNode:n})}}),e.attachEvent("onDragEnd",function(d,l,h){for(let p=0;p<i.length;p++)e.unmarkTimespan(i[p]);i=[],n=null,s=null})}function Nt(e){e.config.mark_now=!0,e.config.display_marked_timespans=!0,e.config.overwrite_marked_timespans=!0;var i="dhx_time_block",t="default",n=function(a,o,_){var r=typeof a=="object"?a:{days:a};return r.type=i,r.css="",o&&(_&&(r.sections=_),r=function(d,l,h){return l instanceof Date&&h instanceof Date?(d.start_date=l,d.end_date=h):(d.days=l,d.zones=h),d}(r,a,o)),r};function s(a,o,_,r,d){var l=e,h=[],p={_props:"map_to",matrix:"y_property"};for(var v in p){var g=p[v];if(l[v])for(var c in l[v]){var u=l[v][c][g];a[u]&&(h=l._add_timespan_zones(h,e._get_blocked_zones(o[c],a[u],_,r,d)))}}return h=l._add_timespan_zones(h,e._get_blocked_zones(o,"global",_,r,d))}e.blockTime=function(a,o,_){var r=n(a,o,_);return e.addMarkedTimespan(r)},e.unblockTime=function(a,o,_){var r=n(a,o=o||"fullday",_);return e.deleteMarkedTimespan(r)},e.checkInMarkedTimespan=function(a,o,_){o=o||t;for(var r=!0,d=new Date(a.start_date.valueOf()),l=e.date.add(d,1,"day"),h=e._marked_timespans;d<a.end_date;d=e.date.date_part(l),l=e.date.add(d,1,"day")){var p=+e.date.date_part(new Date(d)),v=s(a,h,d.getDay(),p,o);if(v)for(var g=0;g<v.length;g+=2){var c=e._get_zone_minutes(d),u=a.end_date>l||a.end_date.getDate()!=d.getDate()?1440:e._get_zone_minutes(a.end_date),f=v[g],y=v[g+1];if(f<u&&y>c&&!(r=typeof _=="function"&&_(a,c,u,f,y)))break}}return!r},e.checkLimitViolation=function(a){if(!a||!e.config.check_limits)return!0;var o=e,_=o.config,r=[];if(a.rec_type&&a._end_date||a.rrule){const v=a._end_date||a.end_date;return!_.limit_start||!_.limit_end||v.valueOf()>=_.limit_start.valueOf()&&a.start_date.valueOf()<=_.limit_end.valueOf()}r=[a];for(var d=!0,l=0;l<r.length;l++){var h=!0,p=r[l];p._timed=e.isOneDayEvent(p),(h=!_.limit_start||!_.limit_end||p.start_date.valueOf()>=_.limit_start.valueOf()&&p.end_date.valueOf()<=_.limit_end.valueOf())&&(h=!e.checkInMarkedTimespan(p,i,function(v,g,c,u,f){var y=!0;return g<=f&&g>=u&&((f==1440||c<=f)&&(y=!1),v._timed&&o._drag_id&&o._drag_mode=="new-size"?(v.start_date.setHours(0),v.start_date.setMinutes(f)):y=!1),(c>=u&&c<=f||g<u&&c>f)&&(v._timed&&o._drag_id&&o._drag_mode=="new-size"?(v.end_date.setHours(0),v.end_date.setMinutes(u)):y=!1),y})),h||(h=o.checkEvent("onLimitViolation")?o.callEvent("onLimitViolation",[p.id,p]):h),d=d&&h}return d||(o._drag_id=null,o._drag_mode=null),d},e._get_blocked_zones=function(a,o,_,r,d){var l=[];if(a&&a[o])for(var h=a[o],p=this._get_relevant_blocked_zones(_,r,h,d),v=0;v<p.length;v++)l=this._add_timespan_zones(l,p[v].zones);return l},e._get_relevant_blocked_zones=function(a,o,_,r){var d;return e.config.overwrite_marked_timespans?d=_[o]&&_[o][r]?_[o][r]:_[a]&&_[a][r]?_[a][r]:[]:(d=[],_[o]&&_[o][r]&&(d=d.concat(_[o][r])),_[a]&&_[a][r]&&(d=d.concat(_[a][r]))),d},e._mark_now=function(a){var o="dhx_now_time";this._els[o]||(this._els[o]=[]);var _=e._currentDate(),r=this.config;if(e._remove_mark_now(),!a&&r.mark_now&&_<this._max_date&&_>this._min_date&&_.getHours()>=r.first_hour&&_.getHours()<r.last_hour){var d=this.locate_holder_day(_);this._els[o]=e._append_mark_now(d,_)}},e._append_mark_now=function(a,o){var _="dhx_now_time",r=e._get_zone_minutes(o),d={zones:[r,r+1],css:_,type:_};if(!this._table_view){if(this._props&&this._props[this._mode]){var l,h,p=this._props[this._mode],v=p.size||p.options.length;p.days>1?(p.size&&p.options.length&&(a=(p.position+a)/p.options.length*p.size),l=a,h=a+v):h=(l=0)+v;for(var g=[],c=l;c<h;c++){var u=c;d.days=u;var f=e._render_marked_timespan(d,null,u)[0];g.push(f)}return g}return d.days=a,e._render_marked_timespan(d,null,a)}if(this._mode=="month")return d.days=+e.date.date_part(o),e._render_marked_timespan(d,null,null)},e._remove_mark_now=function(){for(var a="dhx_now_time",o=this._els[a],_=0;_<o.length;_++){var r=o[_],d=r.parentNode;d&&d.removeChild(r)}this._els[a]=[]},e._marked_timespans={global:{}},e._get_zone_minutes=function(a){return 60*a.getHours()+a.getMinutes()},e._prepare_timespan_options=function(a){var o=[],_=[];if(a.days=="fullweek"&&(a.days=[0,1,2,3,4,5,6]),a.days instanceof Array){for(var r=a.days.slice(),d=0;d<r.length;d++){var l=e._lame_clone(a);l.days=r[d],o.push.apply(o,e._prepare_timespan_options(l))}return o}if(!a||!(a.start_date&&a.end_date&&a.end_date>a.start_date||a.days!==void 0&&a.zones)&&!a.type)return o;a.zones=="fullday"&&(a.zones=[0,1440]),a.zones&&a.invert_zones&&(a.zones=e.invertZones(a.zones)),a.id=e.uid(),a.css=a.css||"",a.type=a.type||t;var h=a.sections;if(h){for(var p in h)if(h.hasOwnProperty(p)){var v=h[p];for(v instanceof Array||(v=[v]),d=0;d<v.length;d++)(D=e._lame_copy({},a)).sections={},D.sections[p]=v[d],_.push(D)}}else _.push(a);for(var g=0;g<_.length;g++){var c=_[g],u=c.start_date,f=c.end_date;if(u&&f)for(var y=e.date.date_part(new Date(u)),w=e.date.add(y,1,"day");y<f;){var D;delete(D=e._lame_copy({},c)).start_date,delete D.end_date,D.days=y.valueOf();var M=u>y?e._get_zone_minutes(u):0,k=f>w||f.getDate()!=y.getDate()?1440:e._get_zone_minutes(f);D.zones=[M,k],o.push(D),y=w,w=e.date.add(w,1,"day")}else c.days instanceof Date&&(c.days=e.date.date_part(c.days).valueOf()),c.zones=a.zones.slice(),o.push(c)}return o},e._get_dates_by_index=function(a,o,_){var r=[];o=e.date.date_part(new Date(o||e._min_date)),_=new Date(_||e._max_date);for(var d=o.getDay(),l=a-d>=0?a-d:7-o.getDay()+a,h=e.date.add(o,l,"day");h<_;h=e.date.add(h,1,"week"))r.push(h);return r},e._get_css_classes_by_config=function(a){var o=[];return a.type==i&&(o.push(i),a.css&&o.push(i+"_reset")),o.push("dhx_marked_timespan",a.css),o.join(" ")},e._get_block_by_config=function(a){var o=document.createElement("div");if(a.html){let _=a.html;typeof _=="function"&&(_=_(a)),typeof _=="string"?o.innerHTML=a.html:e.config.external_render&&e.config.external_render.isElement(_)?e.config.external_render.renderElement(_,o):o.appendChild(_)}return o},e._render_marked_timespan=function(a,o,_){var r=[],d=e.config,l=this._min_date,h=this._max_date,p=!1;if(!d.display_marked_timespans)return r;if(!_&&_!==0){if(a.days<7)_=a.days;else{var v=new Date(a.days);if(p=+v,!(+h>+v&&+l<=+v))return r;_=v.getDay()}var g=l.getDay();g>_?_=7-(g-_):_-=g}var c=a.zones,u=e._get_css_classes_by_config(a);if(e._table_view&&e._mode=="month"){var f=[],y=[];if(o)f.push(o),y.push(_);else{y=p?[p]:e._get_dates_by_index(_);for(var w=0;w<y.length;w++)f.push(this._scales[y[w]])}for(w=0;w<f.length;w++){o=f[w],_=y[w];var D=this.locate_holder_day(_,!1)%this._cols.length;if(!this._ignores[D]){var M=e._get_block_by_config(a);M.className=u,M.style.top="0px",M.style.height="100%";for(var k=0;k<c.length;k+=2){var N=c[w];if((E=c[w+1])<=N)return[];(S=M.cloneNode(!0)).style.left="0px",S.style.width="100%",o.appendChild(S),r.push(S)}}}}else{var m=_;if(this._ignores[this.locate_holder_day(_,!1)])return r;if(this._props&&this._props[this._mode]&&a.sections&&a.sections[this._mode]){var x=this._props[this._mode];m=x.order[a.sections[this._mode]];var b=x.order[a.sections[this._mode]];x.days>1?m=m*(x.size||x.options.length)+b:(m=b,x.size&&m>x.position+x.size&&(m=0))}for(o=o||e.locate_holder(m),w=0;w<c.length;w+=2){var E,S;if(N=Math.max(c[w],60*d.first_hour),(E=Math.min(c[w+1],60*d.last_hour))<=N){if(w+2<c.length)continue;return[]}(S=e._get_block_by_config(a)).className=u;var T=24*this.config.hour_size_px+1,A=36e5;S.style.top=Math.round((60*N*1e3-this.config.first_hour*A)*this.config.hour_size_px/A)%T+"px",S.style.height=Math.max(Math.round(60*(E-N)*1e3*this.config.hour_size_px/A)%T,1)+"px",o.appendChild(S),r.push(S)}}return r},e._mark_timespans=function(){var a=this._els.dhx_cal_data[0],o=[];if(e._table_view&&e._mode=="month")for(var _ in this._scales){var r=new Date(+_);o.push.apply(o,e._on_scale_add_marker(this._scales[_],r))}else{r=new Date(e._min_date);for(var d=0,l=a.childNodes.length;d<l;d++){var h=a.childNodes[d];h.firstChild&&e._getClassName(h.firstChild).indexOf("dhx_scale_hour")>-1||(o.push.apply(o,e._on_scale_add_marker(h,r)),r=e.date.add(r,1,"day"))}}return o},e.markTimespan=function(a){if(!this._els)throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.");var o=!1;this._els.dhx_cal_data||(e.get_elements(),o=!0);var _=e._marked_timespans_ids,r=e._marked_timespans_types,d=e._marked_timespans;e.deleteMarkedTimespan(),e.addMarkedTimespan(a);var l=e._mark_timespans();return o&&(e._els=[]),e._marked_timespans_ids=_,e._marked_timespans_types=r,e._marked_timespans=d,l},e.unmarkTimespan=function(a){if(a)for(var o=0;o<a.length;o++){var _=a[o];_.parentNode&&_.parentNode.removeChild(_)}},e._addMarkerTimespanConfig=function(a){var o="global",_=e._marked_timespans,r=a.id,d=e._marked_timespans_ids;d[r]||(d[r]=[]);var l=a.days,h=a.sections,p=a.type;if(a.id=r,h){for(var v in h)if(h.hasOwnProperty(v)){_[v]||(_[v]={});var g=h[v],c=_[v];c[g]||(c[g]={}),c[g][l]||(c[g][l]={}),c[g][l][p]||(c[g][l][p]=[],e._marked_timespans_types||(e._marked_timespans_types={}),e._marked_timespans_types[p]||(e._marked_timespans_types[p]=!0));var u=c[g][l][p];a._array=u,u.push(a),d[r].push(a)}}else _[o][l]||(_[o][l]={}),_[o][l][p]||(_[o][l][p]=[]),e._marked_timespans_types||(e._marked_timespans_types={}),e._marked_timespans_types[p]||(e._marked_timespans_types[p]=!0),u=_[o][l][p],a._array=u,u.push(a),d[r].push(a)},e._marked_timespans_ids={},e.addMarkedTimespan=function(a){var o=e._prepare_timespan_options(a);if(o.length){for(var _=o[0].id,r=0;r<o.length;r++)e._addMarkerTimespanConfig(o[r]);return _}},e._add_timespan_zones=function(a,o){var _=a.slice();if(o=o.slice(),!_.length)return o;for(var r=0;r<_.length;r+=2)for(var d=_[r],l=_[r+1],h=r+2==_.length,p=0;p<o.length;p+=2){var v=o[p],g=o[p+1];if(g>l&&v<=l||v<d&&g>=d)_[r]=Math.min(d,v),_[r+1]=Math.max(l,g),r-=2;else{if(!h)continue;var c=d>v?0:2;_.splice(r+c,0,v,g)}o.splice(p--,2);break}return _},e._subtract_timespan_zones=function(a,o){for(var _=a.slice(),r=0;r<_.length;r+=2)for(var d=_[r],l=_[r+1],h=0;h<o.length;h+=2){var p=o[h],v=o[h+1];if(v>d&&p<l){var g=!1;d>=p&&l<=v&&_.splice(r,2),d<p&&(_.splice(r,2,d,p),g=!0),l>v&&_.splice(g?r+2:r,g?0:2,v,l),r-=2;break}}return _},e.invertZones=function(a){return e._subtract_timespan_zones([0,1440],a.slice())},e._delete_marked_timespan_by_id=function(a){var o=e._marked_timespans_ids[a];if(o){for(var _=0;_<o.length;_++)for(var r=o[_],d=r._array,l=0;l<d.length;l++)if(d[l]==r){d.splice(l,1);break}}},e._delete_marked_timespan_by_config=function(a){var o,_=e._marked_timespans,r=a.sections,d=a.days,l=a.type||t;if(r){for(var h in r)if(r.hasOwnProperty(h)&&_[h]){var p=r[h];_[h][p]&&(o=_[h][p])}}else o=_.global;if(o){if(d!==void 0)o[d]&&o[d][l]&&(e._addMarkerTimespanConfig(a),e._delete_marked_timespans_list(o[d][l],a));else for(var v in o)if(o[v][l]){var g=e._lame_clone(a);a.days=v,e._addMarkerTimespanConfig(g),e._delete_marked_timespans_list(o[v][l],a)}}},e._delete_marked_timespans_list=function(a,o){for(var _=0;_<a.length;_++){var r=a[_],d=e._subtract_timespan_zones(r.zones,o.zones);if(d.length)r.zones=d;else{a.splice(_,1),_--;for(var l=e._marked_timespans_ids[r.id],h=0;h<l.length;h++)if(l[h]==r){l.splice(h,1);break}}}},e.deleteMarkedTimespan=function(a){if(arguments.length||(e._marked_timespans={global:{}},e._marked_timespans_ids={},e._marked_timespans_types={}),typeof a!="object")e._delete_marked_timespan_by_id(a);else{a.start_date&&a.end_date||(a.days!==void 0||a.type||(a.days="fullweek"),a.zones||(a.zones="fullday"));var o=[];if(a.type)o.push(a.type);else for(var _ in e._marked_timespans_types)o.push(_);for(var r=e._prepare_timespan_options(a),d=0;d<r.length;d++)for(var l=r[d],h=0;h<o.length;h++){var p=e._lame_clone(l);p.type=o[h],e._delete_marked_timespan_by_config(p)}}},e._get_types_to_render=function(a,o){var _=a?e._lame_copy({},a):{};for(var r in o||{})o.hasOwnProperty(r)&&(_[r]=o[r]);return _},e._get_configs_to_render=function(a){var o=[];for(var _ in a)a.hasOwnProperty(_)&&o.push.apply(o,a[_]);return o},e._on_scale_add_marker=function(a,o){if(!e._table_view||e._mode=="month"){var _=o.getDay(),r=o.valueOf(),d=this._mode,l=e._marked_timespans,h=[],p=[];if(this._props&&this._props[d]){var v=this._props[d],g=v.options,c=g[e._get_unit_index(v,o)];if(v.days>1){var u=Math.round((o-e._min_date)/864e5),f=v.size||g.length;o=e.date.add(e._min_date,Math.floor(u/f),"day"),o=e.date.date_part(o)}else o=e.date.date_part(new Date(this._date));if(_=o.getDay(),r=o.valueOf(),l[d]&&l[d][c.key]){var y=l[d][c.key],w=e._get_types_to_render(y[_],y[r]);h.push.apply(h,e._get_configs_to_render(w))}}var D=l.global;if(e.config.overwrite_marked_timespans){var M=D[r]||D[_];h.push.apply(h,e._get_configs_to_render(M))}else D[r]&&h.push.apply(h,e._get_configs_to_render(D[r])),D[_]&&h.push.apply(h,e._get_configs_to_render(D[_]));for(var k=0;k<h.length;k++)p.push.apply(p,e._render_marked_timespan(h[k],a,o));return p}},e.attachEvent("onScaleAdd",function(){e._on_scale_add_marker.apply(e,arguments)}),e.dblclick_dhx_marked_timespan=function(a,o){e.callEvent("onScaleDblClick",[e.getActionData(a).date,o,a]),e.config.dblclick_create&&e.addEventNow(e.getActionData(a).date,null,a)}}function Tt(e){var i={},t=!1;function n(r,d){d=typeof d=="function"?d:function(){},i[r]||(i[r]=this[r],this[r]=d)}function s(r){i[r]&&(this[r]=i[r],i[r]=null)}function a(r){for(var d in r)n.call(this,d,r[d])}function o(){for(var r in i)s.call(this,r)}function _(r){try{r()}catch(d){window.console.error(d)}}return e.$stateProvider.registerProvider("batchUpdate",function(){return{batch_update:t}},!1),function(r,d){if(t)return void _(r);var l,h=this._dp&&this._dp.updateMode!="off";h&&(l=this._dp.updateMode,this._dp.setUpdateMode("off"));const p={setModeDate:{date:null,mode:null},needRender:!1,needUpdateView:!1,repaintEvents:{}},v=(c,u)=>{c&&(p.setModeDate.date=c),u&&(p.setModeDate.mode=u)};var g={render:(c,u)=>{p.needRender=!0,v(c,u)},setCurrentView:(c,u)=>{p.needRender=!0,v(c,u)},updateView:(c,u)=>{p.needUpdateView=!0,v(c,u)},render_data:()=>p.needRender=!0,render_view_data:c=>{c&&c.length?c.forEach(u=>p.repaintEvents[u.id]=!0):p.needRender=!0}};if(a.call(this,g),t=!0,this.callEvent("onBeforeBatchUpdate",[]),_(r),this.callEvent("onAfterBatchUpdate",[]),o.call(this),t=!1,!d)if(p.needRender)e.render(p.setModeDate.date,p.setModeDate.mode);else if(p.needUpdateView)e.updateView(p.setModeDate.date,p.setModeDate.mode);else for(const c in p.repaintEvents)e.updateEvent(c);h&&(this._dp.setUpdateMode(l),this._dp.sendData())}}class At{constructor(i){const{url:t,token:n}=i;this._url=t,this._token=n,this._mode=1,this._seed=1,this._queue=[],this.data={},this.api={},this._events={}}headers(){return{Accept:"application/json","Content-Type":"application/json","Remote-Token":this._token}}fetch(i,t){const n={credentials:"include",headers:this.headers()};return t&&(n.method="POST",n.body=t),fetch(i,n).then(s=>s.json())}load(i){return i&&(this._url=i),this.fetch(this._url).then(t=>this.parse(t))}parse(i){const{key:t,websocket:n}=i;t&&(this._token=i.key);for(const s in i.data)this.data[s]=i.data[s];for(const s in i.api){const a=this.api[s]={},o=i.api[s];for(const _ in o)a[_]=this._wrapper(s+"."+_)}return n&&this.connect(),this}connect(){const i=this._socket;i&&(this._socket=null,i.onclose=function(){},i.close()),this._mode=2,this._socket=function(t,n,s,a){let o=n;o[0]==="/"&&(o=document.location.protocol+"//"+document.location.host+n),o=o.replace(/^http(s|):/,"ws$1:");const _=o.indexOf("?")!=-1?"&":"?";o=`${o}${_}token=${s}&ws=1`;const r=new WebSocket(o);return r.onclose=()=>setTimeout(()=>t.connect(),2e3),r.onmessage=d=>{const l=JSON.parse(d.data);switch(l.action){case"result":t.result(l.body,[]);break;case"event":t.fire(l.body.name,l.body.value);break;case"start":a();break;default:t.onError(l.data)}},r}(this,this._url,this._token,()=>(this._mode=3,this._send(),this._resubscribe(),this))}_wrapper(i){return(function(){const t=[].slice.call(arguments);let n=null;const s=new Promise((a,o)=>{n={data:{id:this._uid(),name:i,args:t},status:1,resolve:a,reject:o},this._queue.push(n)});return this.onCall(n,s),this._mode===3?this._send(n):setTimeout(()=>this._send(),1),s}).bind(this)}_uid(){return(this._seed++).toString()}_send(i){if(this._mode==2)return void setTimeout(()=>this._send(),100);const t=i?[i]:this._queue.filter(s=>s.status===1);if(!t.length)return;const n=t.map(s=>(s.status=2,s.data));this._mode!==3?this.fetch(this._url,JSON.stringify(n)).catch(s=>this.onError(s)).then(s=>this.result(s,n)):this._socket.send(JSON.stringify({action:"call",body:n}))}result(i,t){const n={};if(i)for(let s=0;s<i.length;s++)n[i[s].id]=i[s];else for(let s=0;s<t.length;s++)n[t[s].id]={id:t[s].id,error:"Network Error",data:null};for(let s=this._queue.length-1;s>=0;s--){const a=this._queue[s],o=n[a.data.id];o&&(this.onResponse(a,o),o.error?a.reject(o.error):a.resolve(o.data),this._queue.splice(s,1))}}on(i,t){const n=this._uid();let s=this._events[i];const a=!!s;return a||(s=this._events[i]=[]),s.push({id:n,handler:t}),a||this._mode!=3||this._socket.send(JSON.stringify({action:"subscribe",name:i})),{name:i,id:n}}_resubscribe(){if(this._mode==3)for(const i in this._events)this._socket.send(JSON.stringify({action:"subscribe",name:i}))}detach(i){if(!i){if(this._mode==3)for(const a in this._events)this._socket.send(JSON.stringify({action:"unsubscribe",key:a}));return void(this._events={})}const{id:t,name:n}=i,s=this._events[n];if(s){const a=s.filter(o=>o.id!=t);a.length?this._events[n]=a:(delete this._events[n],this._mode==3&&this._socket.send(JSON.stringify({action:"unsubscribe",name:n})))}}fire(i,t){const n=this._events[i];if(n)for(let s=0;s<n.length;s++)n[s].handler(t)}onError(i){return null}onCall(i,t){}onResponse(i,t){}}class Ct{constructor(i,t){const n=new At({url:i,token:t});n.fetch=function(s,a){const o={headers:this.headers()};return a&&(o.method="POST",o.body=a),fetch(s,o).then(_=>_.json())},this._ready=n.load().then(s=>this._remote=s)}ready(){return this._ready}on(i,t){this.ready().then(n=>{if(typeof i=="string")n.on(i,t);else for(const s in i)n.on(s,i[s])})}}function Ot(e){function i(n,s){switch(n){case"add-event":(function(a){if(e.getEvent(a.id))return void console.warn(`Event with ID ${a.id} already exists. Skipping add.`);typeof a.start_date=="string"&&(a.start_date=e.templates.parse_date(a.start_date)),typeof a.end_date=="string"&&(a.end_date=e.templates.parse_date(a.end_date)),a.original_start&&typeof a.original_start=="string"&&(a.original_start=e.templates.parse_date(a.original_start)),t(()=>{e.addEvent(a)})})(s);break;case"update-event":(function(a){const o=a.id;if(!e.getEvent(o))return void console.warn(`Event with ID ${o} does not exist. Skipping update.`);const _=e.getEvent(o);t(()=>{for(let r in a)r!=="start_date"&&r!=="end_date"&&(_[r]=a[r]);typeof a.start_date=="string"&&(_.start_date=e.templates.parse_date(a.start_date)),typeof a.end_date=="string"&&(_.end_date=e.templates.parse_date(a.end_date)),a.original_start&&typeof a.original_start=="string"&&(_.original_start=e.templates.parse_date(a.original_start)),e.callEvent("onEventChanged",[o,_]),e.updateEvent(o),o!==a.id&&e.changeEventId(o,a.id)})})(s);break;case"delete-event":(function(a){const o=a.id;if(!e.getEvent(o))return void((a.event_pid||a.recurring_event_id)&&t(()=>{e.addEvent(a)}));t(()=>{const _=e.getEvent(o);if(_){if(_.rec_type||_.rrule){e._roll_back_dates(_);const r=e._get_rec_markers(o);for(const d in r)e.getEvent(d)&&e.deleteEvent(d,!0)}if(e.getState().lightbox_id==o&&(this._new_event=this._lightbox_id,a.id=this._lightbox_id,this._events[this._lightbox_id]=a,e.callEvent("onLiveUpdateCollision",[o,null,"delete",a])===!1))return void e.endLightbox(!1,e._lightbox);e.deleteEvent(o,!0)}})})(s)}}function t(n){e._dp?e._dp.ignore(n):n()}return{events:function(n){if(!n||!n.event||!n.event.id)return void console.error("Invalid message format:",n);const{type:s,event:a}=n;if(!e._dp||!e._dp._in_progress[a.id]){if(s==="add-event"&&e._dp){for(const o in e._dp._in_progress)if(e._dp.getState(o)==="inserted")return void e._dp.attachEvent("onFullSync",function(){e.getEvent(a.id)||i(s,a)},{once:!0})}i(s,a)}}}}function Lt(e){(function(i){const t={};i.attachEvent("onConfirmedBeforeEventDelete",function(n){return t[n]=!0,!0}),i.attachEvent("onEventDeleted",function(n,s){if(!t[n])return;delete t[n];let a=i.copy(s);i.config.undo_deleted&&!i.getState().new_event&&i.message({text:`<div class="dhx_info_message">
10 <span class="undo_popup_text">Event deleted</span>
11 <button class="undo_button" data-deleted-event-id="${s.id}">Undo</button>
12 </div>`,expire:1e4,type:"popup_after_delete",callback:function(o){o.target.closest(`[data-deleted-event-id="${s.id}"]`)&&(a.rrule&&a.duration&&(a.end_date=new Date(a.start_date.valueOf()+1e3*a.duration),i.addEvent(a)),i.addEvent(a),i.render())}})})})(e),Mt(e),Nt(e),function(i){i.batchUpdate=Tt(i)}(e),function(i){i.ext||(i.ext={}),i.ext.liveUpdates={RemoteEvents:Ct,remoteUpdates:Ot(i)}}(e)}var $t=Date.now();function Ce(e){return!(!e||typeof e!="object")&&!!(e.getFullYear&&e.getMonth&&e.getDate)}const ne={uid:function(){return $t++},mixin:function(e,i,t){for(var n in i)(e[n]===void 0||t)&&(e[n]=i[n]);return e},copy:function e(i){var t,n,s;if(i&&typeof i=="object")switch(!0){case Ce(i):n=new Date(i);break;case(s=i,Array.isArray?Array.isArray(s):s&&s.length!==void 0&&s.pop&&s.push):for(n=new Array(i.length),t=0;t<i.length;t++)n[t]=e(i[t]);break;case function(a){return a&&typeof a=="object"&&Function.prototype.toString.call(a.constructor)==="function String() { [native code] }"}(i):n=new String(i);break;case function(a){return a&&typeof a=="object"&&Function.prototype.toString.call(a.constructor)==="function Number() { [native code] }"}(i):n=new Number(i);break;case function(a){return a&&typeof a=="object"&&Function.prototype.toString.call(a.constructor)==="function Boolean() { [native code] }"}(i):n=new Boolean(i);break;default:for(t in n={},i){const a=typeof i[t];a==="string"||a==="number"||a==="boolean"?n[t]=i[t]:Ce(i[t])?n[t]=new Date(i[t]):Object.prototype.hasOwnProperty.apply(i,[t])&&(n[t]=e(i[t]))}}return n||i},defined:function(e){return e!==void 0},isDate:Ce,delay:function(e,i){var t,n=function(){n.$cancelTimeout(),n.$pending=!0;var s=Array.prototype.slice.call(arguments);t=setTimeout(function(){e.apply(this,s),n.$pending=!1},i)};return n.$pending=!1,n.$cancelTimeout=function(){clearTimeout(t),n.$pending=!1},n.$execute=function(){var s=Array.prototype.slice.call(arguments);e.apply(this,s),n.$cancelTimeout()},n}};function Ht(e){function i(g){var c=document.createElement("div");return(g||"").split(" ").forEach(function(u){c.classList.add(u)}),c}var t=function(){return i("dhx_cal_navbar_rows_container")},n=function(){return i("dhx_cal_navbar_row")},s=function(g){var c=i("dhx_cal_tab");return c.setAttribute("name",g.view+"_tab"),c.setAttribute("data-tab",g.view),e.config.fix_tab_position&&(g.$firstTab?c.classList.add("dhx_cal_tab_first"):g.$lastTab?c.classList.add("dhx_cal_tab_last"):g.view!=="week"&&c.classList.add("dhx_cal_tab_standalone"),g.$segmentedTab&&c.classList.add("dhx_cal_tab_segmented")),c},a=function(){return i("dhx_cal_date")},o=function(g){return i("dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab")},_=function(g){return i("dhx_cal_"+g.view+"_button dhx_cal_nav_button")},r=function(){return i("dhx_cal_line_spacer")},d=function(g){var c=i("dhx_minical_icon");return g.click||c.$_eventAttached||e.event(c,"click",function(){e.isCalendarVisible()?e.destroyCalendar():e.renderCalendar({position:this,date:e.getState().date,navigation:!0,handler:function(u,f){e.setCurrentView(u),e.destroyCalendar()}})}),c};function l(g){var c=function(y){var w;if(y.view)switch(y.view){case"today":case"next":case"prev":w=_;break;case"date":w=a;break;case"spacer":w=r;break;case"button":w=o;break;case"minicalendar":w=d;break;default:w=s}else y.rows?w=t:y.cols&&(w=n);return w}(g);if(c){var u=c(g);if(g.css&&u.classList.add(g.css),g.width&&((f=g.width)===1*f&&(f+="px"),u.style.width=f),g.height&&((f=g.height)===1*f&&(f+="px"),u.style.height=f),g.click&&e.event(u,"click",g.click),g.html&&(u.innerHTML=g.html),g.align){var f="";g.align=="right"?f="flex-end":g.align=="left"&&(f="flex-start"),u.style.justifyContent=f}return u}}function h(g){return typeof g=="string"&&(g={view:g}),g.view||g.rows||g.cols||(g.view="button"),g}function p(g){var c,u=document.createDocumentFragment();c=Array.isArray(g)?g:[g];for(var f=0;f<c.length;f++){var y,w=h(c[f]);w.view==="day"&&c[f+1]&&((y=h(c[f+1])).view!=="week"&&y.view!=="month"||(w.$firstTab=!0,w.$segmentedTab=!0)),w.view==="week"&&c[f-1]&&((y=h(c[f+1])).view!=="week"&&y.view!=="month"||(w.$segmentedTab=!0)),w.view==="month"&&c[f-1]&&((y=h(c[f-1])).view!=="week"&&y.view!=="day"||(w.$lastTab=!0,w.$segmentedTab=!0));var D=l(w);u.appendChild(D),(w.cols||w.rows)&&D.appendChild(p(w.cols||w.rows))}return u}e._init_nav_bar=function(g){var c=this.$container.querySelector(".dhx_cal_navline");return c||((c=document.createElement("div")).className="dhx_cal_navline dhx_cal_navline_flex",e._update_nav_bar(g,c),c)};var v=null;e._update_nav_bar=function(g,c){if(g){var u=!1,f=g.height||e.xy.nav_height;v!==null&&v===f||(u=!0),u&&(e.xy.nav_height=f),c.innerHTML="",c.appendChild(p(g)),e.unset_actions(),e._els=[],e.get_elements(),e.set_actions(),c.style.display=f===0?"none":"",v=f}}}function zt(e){function i(a){return a.isConnected!==void 0?a.isConnected:document.body.contains(a)}function t(a){return{w:a.innerWidth||document.documentElement.clientWidth,h:a.innerHeight||document.documentElement.clientHeight}}function n(a,o){var _,r=t(o);a.event(o,"resize",function(){clearTimeout(_),_=setTimeout(function(){if(i(a.$container)&&!a.$destroyed){var d,l,h=t(o);l=h,((d=r).w!=l.w||d.h!=l.h)&&(r=h,s(a))}},150)})}function s(a){a.$initialized&&!a.$destroyed&&a.$root&&i(a.$root)&&a.callEvent("onSchedulerResize",[])&&(a.updateView(),a.callEvent("onAfterSchedulerResize",[]))}(function(a){var o=a.$container;if(window.getComputedStyle(o).getPropertyValue("position")=="static"&&(o.style.position="relative"),window.ResizeObserver){let r=!0;const d=new ResizeObserver(function(l){r?r=!1:s(a)});d.observe(o),a.attachEvent("onDestroy",function(){d.unobserve(o)})}else{var _=document.createElement("iframe");_.className="scheduler_container_resize_watcher",_.tabIndex=-1,a.config.wai_aria_attributes&&(_.setAttribute("role","none"),_.setAttribute("aria-hidden",!0)),window.Sfdc||window.$A||window.Aura?function(r){var d=r.$root.offsetHeight,l=r.$root.offsetWidth;(function h(){r.$destroyed||(r.$root&&(r.$root.offsetHeight==d&&r.$root.offsetWidth==l||s(r),d=r.$root.offsetHeight,l=r.$root.offsetWidth),setTimeout(h,200))})()}(a):(o.appendChild(_),_.contentWindow?n(a,_.contentWindow):(o.removeChild(_),n(a,window)))}})(e)}class qt{constructor(){this._silent_mode=!1,this.listeners={}}_silentStart(){this._silent_mode=!0}_silentEnd(){this._silent_mode=!1}}function Oe(e){const i=new qt;e.attachEvent=function(t,n,s){t="ev_"+t.toLowerCase(),i.listeners[t]||(i.listeners[t]=function(o){let _={},r=0;const d=function(){let l=!0;for(const h in _){const p=_[h].apply(o,arguments);l=l&&p}return l};return d.addEvent=function(l,h){if(typeof l=="function"){let p;if(h&&h.id?p=h.id:(p=r,r++),h&&h.once){const v=l;l=function(){v(),d.removeEvent(p)}}return _[p]=l,p}return!1},d.removeEvent=function(l){delete _[l]},d.clear=function(){_={}},d}(this)),s&&s.thisObject&&(n=n.bind(s.thisObject));let a=t+":"+i.listeners[t].addEvent(n,s);return s&&s.id&&(a=s.id),a},e.attachAll=function(t){this.attachEvent("listen_all",t)},e.callEvent=function(t,n){if(i._silent_mode)return!0;const s="ev_"+t.toLowerCase(),a=i.listeners;return a.ev_listen_all&&a.ev_listen_all.apply(this,[t].concat(n)),!a[s]||a[s].apply(this,n)},e.checkEvent=function(t){return!!i.listeners["ev_"+t.toLowerCase()]},e.detachEvent=function(t){if(t){let n=i.listeners;for(const a in n)n[a].removeEvent(t);const s=t.split(":");if(n=i.listeners,s.length===2){const a=s[0],o=s[1];n[a]&&n[a].removeEvent(o)}}},e.detachAllEvents=function(){for(const t in i.listeners)i.listeners[t].clear()}}const Ge={event:function(e,i,t){e.addEventListener?e.addEventListener(i,t,!1):e.attachEvent&&e.attachEvent("on"+i,t)},eventRemove:function(e,i,t){e.removeEventListener?e.removeEventListener(i,t,!1):e.detachEvent&&e.detachEvent("on"+i,t)}};function jt(e){var i=function(){var t=function(n,s){n=n||Ge.event,s=s||Ge.eventRemove;var a=[],o={attach:function(_,r,d,l){a.push({element:_,event:r,callback:d,capture:l}),n(_,r,d,l)},detach:function(_,r,d,l){s(_,r,d,l);for(var h=0;h<a.length;h++){var p=a[h];p.element===_&&p.event===r&&p.callback===d&&p.capture===l&&(a.splice(h,1),h--)}},detachAll:function(){for(var _=a.slice(),r=0;r<_.length;r++){var d=_[r];o.detach(d.element,d.event,d.callback,d.capture),o.detach(d.element,d.event,d.callback,void 0),o.detach(d.element,d.event,d.callback,!1),o.detach(d.element,d.event,d.callback,!0)}a.splice(0,a.length)},extend:function(){return t(this.event,this.eventRemove)}};return o};return t()}();e.event=i.attach,e.eventRemove=i.detach,e._eventRemoveAll=i.detachAll,e._createDomEventScope=i.extend,e._trim=function(t){return(String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")}).apply(t)},e._isDate=function(t){return!(!t||typeof t!="object")&&!!(t.getFullYear&&t.getMonth&&t.getDate)},e._isObject=function(t){return t&&typeof t=="object"}}function Xe(e){if(!e)return"";var i=e.className||"";return i.baseVal&&(i=i.baseVal),i.indexOf||(i=""),i||""}function Ze(e,i,t){t===void 0&&(t=!0);for(var n=e.target||e.srcElement,s="";n;){if(s=Xe(n)){var a=s.indexOf(i);if(a>=0){if(!t)return n;var o=a===0||!(s.charAt(a-1)||"").trim(),_=a+i.length>=s.length||!s.charAt(a+i.length).trim();if(o&&_)return n}}n=n.parentNode}return null}function It(e){var i=!1,t=!1;if(window.getComputedStyle){var n=window.getComputedStyle(e,null);i=n.display,t=n.visibility}else e.currentStyle&&(i=e.currentStyle.display,t=e.currentStyle.visibility);var s=!1,a=Ze({target:e},"dhx_form_repeat",!1);return a&&(s=a.style.height=="0px"),s=s||!e.offsetHeight,i!="none"&&t!="hidden"&&!s}function Rt(e){return!isNaN(e.getAttribute("tabindex"))&&1*e.getAttribute("tabindex")>=0}function Pt(e){return!{a:!0,area:!0}[e.nodeName.loLowerCase()]||!!e.getAttribute("href")}function Ut(e){return!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[e.nodeName.toLowerCase()]||!e.hasAttribute("disabled")}function Qe(){return document.head.createShadowRoot||document.head.attachShadow}function et(e,i){if(e.closest)return e.closest(i);if(e.matches||e.msMatchesSelector||e.webkitMatchesSelector){var t=e;if(!document.documentElement.contains(t))return null;do{if((t.matches||t.msMatchesSelector||t.webkitMatchesSelector).call(t,i))return t;t=t.parentElement||t.parentNode}while(t!==null&&t.nodeType===1);return null}return console.error("Your browser is not supported"),null}function tt(e){if(!e||!Qe())return document.body;for(;e.parentNode&&(e=e.parentNode);)if(e instanceof ShadowRoot)return e.host;return document.body}const le={getAbsoluteLeft:function(e){return this.getOffset(e).left+(parseInt(window.getComputedStyle(e).paddingLeft,10)||0)},getAbsoluteTop:function(e){return this.getOffset(e).top+(parseInt(window.getComputedStyle(e).paddingTop,10)||0)},getOffsetSum:function(e){for(var i=0,t=0;e;)i+=parseInt(e.offsetTop),t+=parseInt(e.offsetLeft),e=e.offsetParent;return{top:i,left:t}},getOffsetRect:function(e){var i=e.getBoundingClientRect(),t=0,n=0;if(/Mobi/.test(navigator.userAgent)){var s=document.createElement("div");s.style.position="absolute",s.style.left="0px",s.style.top="0px",s.style.width="1px",s.style.height="1px",document.body.appendChild(s);var a=s.getBoundingClientRect();t=i.top-a.top,n=i.left-a.left,s.parentNode.removeChild(s)}else{var o=document.body,_=document.documentElement,r=window.pageYOffset||_.scrollTop||o.scrollTop,d=window.pageXOffset||_.scrollLeft||o.scrollLeft,l=_.clientTop||o.clientTop||0,h=_.clientLeft||o.clientLeft||0;t=i.top+r-l,n=i.left+d-h}return{top:Math.round(t),left:Math.round(n)}},getOffset:function(e){return e.getBoundingClientRect?this.getOffsetRect(e):this.getOffsetSum(e)},closest:function(e,i){return e&&i?et(e,i):null},insertAfter:function(e,i){i.nextSibling?i.parentNode.insertBefore(e,i.nextSibling):i.parentNode.appendChild(e)},remove:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},isChildOf:function(e,i){return i.contains(e)},getFocusableNodes:function(e){for(var i=e.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),t=Array.prototype.slice.call(i,0),n=0;n<t.length;n++)t[n].$position=n;for(t.sort(function(a,o){return a.tabIndex===0&&o.tabIndex!==0?1:a.tabIndex!==0&&o.tabIndex===0?-1:a.tabIndex===o.tabIndex?a.$position-o.$position:a.tabIndex<o.tabIndex?-1:1}),n=0;n<t.length;n++){var s=t[n];(Rt(s)||Ut(s)||Pt(s))&&It(s)||(t.splice(n,1),n--)}return t},getClassName:Xe,locateCss:Ze,getRootNode:tt,hasShadowParent:function(e){return!!tt(e)},isShadowDomSupported:Qe,getActiveElement:function(){var e=document.activeElement;return e.shadowRoot&&(e=e.shadowRoot.activeElement),e===document.body&&document.getSelection&&(e=document.getSelection().focusNode||document.body),e},getRelativeEventPosition:function(e,i){var t=document.documentElement,n=function(s){var a=0,o=0,_=0,r=0;if(s.getBoundingClientRect){var d=s.getBoundingClientRect(),l=document.body,h=document.documentElement||document.body.parentNode||document.body,p=window.pageYOffset||h.scrollTop||l.scrollTop,v=window.pageXOffset||h.scrollLeft||l.scrollLeft,g=h.clientTop||l.clientTop||0,c=h.clientLeft||l.clientLeft||0;a=d.top+p-g,o=d.left+v-c,_=document.body.offsetWidth-d.right,r=document.body.offsetHeight-d.bottom}else{for(;s;)a+=parseInt(s.offsetTop,10),o+=parseInt(s.offsetLeft,10),s=s.offsetParent;_=document.body.offsetWidth-s.offsetWidth-o,r=document.body.offsetHeight-s.offsetHeight-a}return{y:Math.round(a),x:Math.round(o),width:s.offsetWidth,height:s.offsetHeight,right:Math.round(_),bottom:Math.round(r)}}(i);return{x:e.clientX-t.clientLeft-n.x+i.scrollLeft,y:e.clientY-t.clientTop-n.y+i.scrollTop}},getTargetNode:function(e){var i;return e.tagName?i=e:(i=(e=e||window.event).target||e.srcElement).shadowRoot&&e.composedPath&&(i=e.composedPath()[0]),i},getNodePosition:function(e){var i=0,t=0,n=0,s=0;if(e.getBoundingClientRect){var a=e.getBoundingClientRect(),o=document.body,_=document.documentElement||document.body.parentNode||document.body,r=window.pageYOffset||_.scrollTop||o.scrollTop,d=window.pageXOffset||_.scrollLeft||o.scrollLeft,l=_.clientTop||o.clientTop||0,h=_.clientLeft||o.clientLeft||0;i=a.top+r-l,t=a.left+d-h,n=document.body.offsetWidth-a.right,s=document.body.offsetHeight-a.bottom}else{for(;e;)i+=parseInt(e.offsetTop,10),t+=parseInt(e.offsetLeft,10),e=e.offsetParent;n=document.body.offsetWidth-e.offsetWidth-t,s=document.body.offsetHeight-e.offsetHeight-i}return{y:Math.round(i),x:Math.round(t),width:e.offsetWidth,height:e.offsetHeight,right:Math.round(n),bottom:Math.round(s)}},closest:et};var ce=typeof window<"u";const Yt={isIE:ce&&(navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0),isOpera:ce&&navigator.userAgent.indexOf("Opera")>=0,isChrome:ce&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:ce&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:ce&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:ce&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:ce&&navigator.userAgent.indexOf("Edge")!=-1,isNode:!ce||typeof navigator>"u"};function Le(e){if(typeof e=="string"||typeof e=="number")return e;var i="";for(var t in e){var n="";e.hasOwnProperty(t)&&(n=t+"="+(n=typeof e[t]=="string"?encodeURIComponent(e[t]):typeof e[t]=="number"?e[t]:encodeURIComponent(JSON.stringify(e[t]))),i.length&&(n="&"+n),i+=n)}return i}function Vt(e){var i=function(a,o){for(var _="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",r=a.match(/%[a-zA-Z]/g),d=0;d<r.length;d++)switch(r[d]){case"%j":case"%d":_+="set[2]=temp["+d+"]||1;";break;case"%n":case"%m":_+="set[1]=(temp["+d+"]||1)-1;";break;case"%y":_+="set[0]=temp["+d+"]*1+(temp["+d+"]>50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":_+="set[3]=temp["+d+"]||0;";break;case"%i":_+="set[4]=temp["+d+"]||0;";break;case"%Y":_+="set[0]=temp["+d+"]||0;";break;case"%a":case"%A":_+="set[3]=set[3]%12+((temp["+d+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":_+="set[5]=temp["+d+"]||0;";break;case"%M":_+="set[1]=this.locale.date.month_short_hash[temp["+d+"]]||0;";break;case"%F":_+="set[1]=this.locale.date.month_full_hash[temp["+d+"]]||0;"}var l="set[0],set[1],set[2],set[3],set[4],set[5]";return o&&(l=" Date.UTC("+l+")"),new Function("date","var set=[0,0,1,0,0,0]; "+_+" return new Date("+l+");")},t=function(a,o){const _=a.match(/%[a-zA-Z]/g);return function(r){for(var d=[0,0,1,0,0,0],l=r.match(/[a-zA-Z]+|[0-9]+/g),h=0;h<_.length;h++)switch(_[h]){case"%j":case"%d":d[2]=l[h]||1;break;case"%n":case"%m":d[1]=(l[h]||1)-1;break;case"%y":d[0]=1*l[h]+(l[h]>50?1900:2e3);break;case"%g":case"%G":case"%h":case"%H":d[3]=l[h]||0;break;case"%i":d[4]=l[h]||0;break;case"%Y":d[0]=l[h]||0;break;case"%a":case"%A":d[3]=d[3]%12+((l[h]||"").toLowerCase()=="am"?0:12);break;case"%s":d[5]=l[h]||0;break;case"%M":d[1]=e.locale.date.month_short_hash[l[h]]||0;break;case"%F":d[1]=e.locale.date.month_full_hash[l[h]]||0}return o?new Date(Date.UTC(d[0],d[1],d[2],d[3],d[4],d[5])):new Date(d[0],d[1],d[2],d[3],d[4],d[5])}};let n;function s(){var a=!1;return e.config.csp==="auto"?(n===void 0&&(n=function(){try{new Function("cspEnabled = false;"),n=!1}catch{n=!0}return n}()),a=n):a=e.config.csp,a}e.date={init:function(){for(var a=e.locale.date.month_short,o=e.locale.date.month_short_hash={},_=0;_<a.length;_++)o[a[_]]=_;for(a=e.locale.date.month_full,o=e.locale.date.month_full_hash={},_=0;_<a.length;_++)o[a[_]]=_},date_part:function(a){const o=new Date(a);var _=new Date(o);return o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o.getHours()&&(o.getDate()<_.getDate()||o.getMonth()<_.getMonth()||o.getFullYear()<_.getFullYear())&&o.setTime(o.getTime()+36e5*(24-o.getHours())),o},time_part:function(a){return(a.valueOf()/1e3-60*a.getTimezoneOffset())%86400},week_start:function(a){var o=a.getDay();return e.config.start_on_monday&&(o===0?o=6:o--),this.date_part(this.add(a,-1*o,"day"))},month_start:function(a){const o=new Date(a);return o.setDate(1),this.date_part(o)},year_start:function(a){const o=new Date(a);return o.setMonth(0),this.month_start(o)},day_start:function(a){const o=new Date(a);return this.date_part(o)},_add_days:function(a,o){var _=new Date(a.valueOf());if(_.setDate(_.getDate()+o),o==Math.round(o)&&o>0){var r=(+_-+a)%864e5;if(r&&a.getTimezoneOffset()==_.getTimezoneOffset()){var d=r/36e5;_.setTime(_.getTime()+60*(24-d)*60*1e3)}}return o>=0&&!a.getHours()&&_.getHours()&&(_.getDate()<a.getDate()||_.getMonth()<a.getMonth()||_.getFullYear()<a.getFullYear())&&_.setTime(_.getTime()+36e5*(24-_.getHours())),_},add:function(a,o,_){var r=new Date(a.valueOf());switch(_){case"day":r=e.date._add_days(r,o);break;case"week":r=e.date._add_days(r,7*o);break;case"month":r.setMonth(r.getMonth()+o);break;case"year":r.setYear(r.getFullYear()+o);break;case"hour":r.setTime(r.getTime()+60*o*60*1e3);break;case"minute":r.setTime(r.getTime()+60*o*1e3);break;default:return e.date["add_"+_](a,o,_)}return r},to_fixed:function(a){return a<10?"0"+a:a},copy:function(a){return new Date(a.valueOf())},date_to_str:function(a,o){return s()?function(_,r){return function(d){return _.replace(/%[a-zA-Z]/g,function(l){switch(l){case"%d":return r?e.date.to_fixed(d.getUTCDate()):e.date.to_fixed(d.getDate());case"%m":return r?e.date.to_fixed(d.getUTCMonth()+1):e.date.to_fixed(d.getMonth()+1);case"%j":return r?d.getUTCDate():d.getDate();case"%n":return r?d.getUTCMonth()+1:d.getMonth()+1;case"%y":return r?e.date.to_fixed(d.getUTCFullYear()%100):e.date.to_fixed(d.getFullYear()%100);case"%Y":return r?d.getUTCFullYear():d.getFullYear();case"%D":return r?e.locale.date.day_short[d.getUTCDay()]:e.locale.date.day_short[d.getDay()];case"%l":return r?e.locale.date.day_full[d.getUTCDay()]:e.locale.date.day_full[d.getDay()];case"%M":return r?e.locale.date.month_short[d.getUTCMonth()]:e.locale.date.month_short[d.getMonth()];case"%F":return r?e.locale.date.month_full[d.getUTCMonth()]:e.locale.date.month_full[d.getMonth()];case"%h":return r?e.date.to_fixed((d.getUTCHours()+11)%12+1):e.date.to_fixed((d.getHours()+11)%12+1);case"%g":return r?(d.getUTCHours()+11)%12+1:(d.getHours()+11)%12+1;case"%G":return r?d.getUTCHours():d.getHours();case"%H":return r?e.date.to_fixed(d.getUTCHours()):e.date.to_fixed(d.getHours());case"%i":return r?e.date.to_fixed(d.getUTCMinutes()):e.date.to_fixed(d.getMinutes());case"%a":return r?d.getUTCHours()>11?"pm":"am":d.getHours()>11?"pm":"am";case"%A":return r?d.getUTCHours()>11?"PM":"AM":d.getHours()>11?"PM":"AM";case"%s":return r?e.date.to_fixed(d.getUTCSeconds()):e.date.to_fixed(d.getSeconds());case"%W":return r?e.date.to_fixed(e.date.getUTCISOWeek(d)):e.date.to_fixed(e.date.getISOWeek(d));default:return l}})}}(a,o):(a=a.replace(/%[a-zA-Z]/g,function(_){switch(_){case"%d":return'"+this.date.to_fixed(date.getDate())+"';case"%m":return'"+this.date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+this.date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+this.locale.date.day_short[date.getDay()]+"';case"%l":return'"+this.locale.date.day_full[date.getDay()]+"';case"%M":return'"+this.locale.date.month_short[date.getMonth()]+"';case"%F":return'"+this.locale.date.month_full[date.getMonth()]+"';case"%h":return'"+this.date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+this.date.to_fixed(date.getHours())+"';case"%i":return'"+this.date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+this.date.to_fixed(date.getSeconds())+"';case"%W":return'"+this.date.to_fixed(this.date.getISOWeek(date))+"';default:return _}}),o&&(a=a.replace(/date\.get/g,"date.getUTC")),new Function("date",'return "'+a+'";').bind(e))},str_to_date:function(a,o,_){var r=s()?t:i,d=r(a,o),l=/^[0-9]{4}(\-|\/)[0-9]{2}(\-|\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,h=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/,p=/^[0-9]{2}\-[0-9]{2}\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,v=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,g=r("%Y-%m-%d %H:%i:%s",o),c=r("%m/%d/%Y %H:%i:%s",o),u=r("%d-%m-%Y %H:%i:%s",o);return function(f){if(!_&&!e.config.parse_exact_format){if(f&&f.getISOWeek)return new Date(f);if(typeof f=="number")return new Date(f);if(y=f,l.test(String(y)))return g(f);if(function(w){return h.test(String(w))}(f))return c(f);if(function(w){return p.test(String(w))}(f))return u(f);if(function(w){return v.test(w)}(f))return new Date(f)}var y;return d.call(e,f)}},getISOWeek:function(a){if(!a)return!1;var o=(a=this.date_part(new Date(a))).getDay();o===0&&(o=7);var _=new Date(a.valueOf());_.setDate(a.getDate()+(4-o));var r=_.getFullYear(),d=Math.round((_.getTime()-new Date(r,0,1).getTime())/864e5);return 1+Math.floor(d/7)},getUTCISOWeek:function(a){return this.getISOWeek(this.convert_to_utc(a))},convert_to_utc:function(a){return new Date(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds())}}}function at(e){return(function(){var i={};for(var t in this._events){var n=this._events[t];n.id.toString().indexOf("#")==-1&&(i[n.id]=n)}return i}).bind(e)}function Ft(e){e._loaded={},e._load=function(t,n){if(t=t||this._load_url){var s;if(t+=(t.indexOf("?")==-1?"?":"&")+"timeshift="+new Date().getTimezoneOffset(),this.config.prevent_cache&&(t+="&uid="+this.uid()),n=n||this._date,this._load_mode){var a=this.templates.load_format;for(n=this.date[this._load_mode+"_start"](new Date(n.valueOf()));n>this._min_date;)n=this.date.add(n,-1,this._load_mode);s=n;for(var o=!0;s<this._max_date;)s=this.date.add(s,1,this._load_mode),this._loaded[a(n)]&&o?n=this.date.add(n,1,this._load_mode):o=!1;var _=s;do s=_,_=this.date.add(s,-1,this._load_mode);while(_>n&&this._loaded[a(_)]);if(s<=n)return!1;for(e.ajax.get(t+"&from="+a(n)+"&to="+a(s),r);n<s;)this._loaded[a(n)]=!0,n=this.date.add(n,1,this._load_mode)}else e.ajax.get(t,r);return this.callEvent("onXLS",[]),this.callEvent("onLoadStart",[]),!0}function r(d){e.on_load(d),e.callEvent("onLoadEnd",[])}},e._parsers={},function(t){t._parsers.xml={canParse:function(n,s){if(s.responseXML&&s.responseXML.firstChild)return!0;try{var a=t.ajax.parse(s.responseText),o=t.ajax.xmltop("data",a);if(o&&o.tagName==="data")return!0}catch{}return!1},parse:function(n){var s;if(n.xmlDoc.responseXML||(n.xmlDoc.responseXML=t.ajax.parse(n.xmlDoc.responseText)),(s=t.ajax.xmltop("data",n.xmlDoc)).tagName!="data")return null;var a=s.getAttribute("dhx_security");a&&(window.dhtmlx&&(window.dhtmlx.security_key=a),t.security_key=a);for(var o=t.ajax.xpath("//coll_options",n.xmlDoc),_=0;_<o.length;_++){var r=o[_].getAttribute("for"),d=t.serverList[r];d||(t.serverList[r]=d=[]),d.splice(0,d.length);for(var l=t.ajax.xpath(".//item",o[_]),h=0;h<l.length;h++){for(var p=l[h].attributes,v={key:l[h].getAttribute("value"),label:l[h].getAttribute("label")},g=0;g<p.length;g++){var c=p[g];c.nodeName!="value"&&c.nodeName!="label"&&(v[c.nodeName]=c.nodeValue)}d.push(v)}}o.length&&t.callEvent("onOptionsLoad",[]);var u=t.ajax.xpath("//userdata",n.xmlDoc);for(_=0;_<u.length;_++){var f=t._xmlNodeToJSON(u[_]);t._userdata[f.name]=f.text}var y=[];for(s=t.ajax.xpath("//event",n.xmlDoc),_=0;_<s.length;_++){var w=y[_]=t._xmlNodeToJSON(s[_]);t._init_event(w)}return y}}}(e),function(t){t.json=t._parsers.json={canParse:function(n){if(n&&typeof n=="object")return!0;if(typeof n=="string")try{var s=JSON.parse(n);return Object.prototype.toString.call(s)==="[object Object]"||Object.prototype.toString.call(s)==="[object Array]"}catch{return!1}return!1},parse:function(n){var s=[];typeof n=="string"&&(n=JSON.parse(n)),Object.prototype.toString.call(n)==="[object Array]"?s=n:n&&(n.events?s=n.events:n.data&&(s=n.data)),s=s||[],n.dhx_security&&(window.dhtmlx&&(window.dhtmlx.security_key=n.dhx_security),t.security_key=n.dhx_security);var a=n&&n.collections?n.collections:{},o=!1;for(var _ in a)if(a.hasOwnProperty(_)){o=!0;var r=a[_],d=t.serverList[_];d||(t.serverList[_]=d=[]),d.splice(0,d.length);for(var l=0;l<r.length;l++){var h=r[l],p={key:h.value,label:h.label};for(var v in h)if(h.hasOwnProperty(v)){if(v=="value"||v=="label")continue;p[v]=h[v]}d.push(p)}}o&&t.callEvent("onOptionsLoad",[]);for(var g=[],c=0;c<s.length;c++){var u=s[c];t._init_event(u),g.push(u)}return g}}}(e),function(t){t.ical=t._parsers.ical={canParse:function(n){return typeof n=="string"&&new RegExp("^BEGIN:VCALENDAR").test(n)},parse:function(n){var s=n.match(RegExp(this.c_start+"[^\f]*"+this.c_end,""));if(s.length){s[0]=s[0].replace(/[\r\n]+ /g,""),s[0]=s[0].replace(/[\r\n]+(?=[a-z \t])/g," "),s[0]=s[0].replace(/;[^:\r\n]*:/g,":");for(var a,o=[],_=RegExp("(?:"+this.e_start+")([^\f]*?)(?:"+this.e_end+")","g");(a=_.exec(s))!==null;){for(var r,d={},l=/[^\r\n]+[\r\n]+/g;(r=l.exec(a[1]))!==null;)this.parse_param(r.toString(),d);d.uid&&!d.id&&(d.id=d.uid),o.push(d)}return o}},parse_param:function(n,s){var a=n.indexOf(":");if(a!=-1){var o=n.substr(0,a).toLowerCase(),_=n.substr(a+1).replace(/\\,/g,",").replace(/[\r\n]+$/,"");o=="summary"?o="text":o=="dtstart"?(o="start_date",_=this.parse_date(_,0,0)):o=="dtend"&&(o="end_date",_=this.parse_date(_,0,0)),s[o]=_}},parse_date:function(n,s,a){var o=n.split("T"),_=!1;o[1]&&(s=o[1].substr(0,2),a=o[1].substr(2,2),_=o[1][6]=="Z");var r=o[0].substr(0,4),d=parseInt(o[0].substr(4,2),10)-1,l=o[0].substr(6,2);return t.config.server_utc||_?new Date(Date.UTC(r,d,l,s,a)):new Date(r,d,l,s,a)},c_start:"BEGIN:VCALENDAR",e_start:"BEGIN:VEVENT",e_end:"END:VEVENT",c_end:"END:VCALENDAR"}}(e),e.on_load=function(t){var n;this.callEvent("onBeforeParse",[]);var s=!1,a=!1;for(var o in this._parsers){var _=this._parsers[o];if(_.canParse(t.xmlDoc.responseText,t.xmlDoc)){try{var r=t.xmlDoc.responseText;o==="xml"&&(r=t),(n=_.parse(r))||(s=!0)}catch{s=!0}a=!0;break}}if(!a)if(this._process&&this[this._process])try{n=this[this._process].parse(t.xmlDoc.responseText)}catch{s=!0}else s=!0;(s||t.xmlDoc.status&&t.xmlDoc.status>=400)&&(this.callEvent("onLoadError",[t.xmlDoc]),n=[]),this._process_loading(n),this.callEvent("onXLE",[]),this.callEvent("onParse",[])},e._process_loading=function(t){this._loading=!0,this._not_render=!0;for(var n=0;n<t.length;n++)this.callEvent("onEventLoading",[t[n]])&&this.addEvent(t[n]);this._not_render=!1,this._render_wait&&this.render_view_data(),this._loading=!1,this._after_call&&this._after_call(),this._after_call=null},e._init_event=function(t){t.text=t.text||t._tagvalue||"",t.start_date=e._init_date(t.start_date),t.end_date=e._init_date(t.end_date)},e._init_date=function(t){return t?typeof t=="string"?e._helpers.parseDate(t):new Date(t):null};const i=at(e);e.serialize=function(){const t=[],n=i();for(var s in n){const _={};var a=n[s];for(var o in a){if(o.charAt(0)=="$"||o.charAt(0)=="_")continue;let r;const d=a[o];r=e.utils.isDate(d)?e.defined(e.templates.xml_format)?e.templates.xml_format(d):e.templates.format_date(d):d,_[o]=r}t.push(_)}return t},e.parse=function(t,n){this._process=n,this.on_load({xmlDoc:{responseText:t}})},e.load=function(t,n){typeof n=="string"&&(this._process=n,n=arguments[2]),this._load_url=t,this._after_call=n,this._load(t,this._date)},e.setLoadMode=function(t){t=="all"&&(t=""),this._load_mode=t},e.serverList=function(t,n){return n?(this.serverList[t]=n.slice(0),this.serverList[t]):(this.serverList[t]=this.serverList[t]||[],this.serverList[t])},e._userdata={},e._xmlNodeToJSON=function(t){for(var n={},s=0;s<t.attributes.length;s++)n[t.attributes[s].name]=t.attributes[s].value;for(s=0;s<t.childNodes.length;s++){var a=t.childNodes[s];a.nodeType==1&&(n[a.tagName]=a.firstChild?a.firstChild.nodeValue:"")}return n.text||(n.text=t.firstChild?t.firstChild.nodeValue:""),n},e.attachEvent("onXLS",function(){var t;this.config.show_loading===!0&&((t=this.config.show_loading=document.createElement("div")).className="dhx_loading",t.style.left=Math.round((this._x-128)/2)+"px",t.style.top=Math.round((this._y-15)/2)+"px",this._obj.appendChild(t))}),e.attachEvent("onXLE",function(){var t=this.config.show_loading;t&&typeof t=="object"&&(t.parentNode&&t.parentNode.removeChild(t),this.config.show_loading=!0)})}function Bt(e){function i(){const t=e.config.csp===!0,n=!!window.Sfdc||!!window.$A||window.Aura||"$shadowResolver$"in document.body;return t||n?e.$root:document.body}e._lightbox_controls={},e.formSection=function(t){for(var n=this.config.lightbox.sections,s=0;s<n.length&&n[s].name!=t;s++);if(s===n.length)return null;var a=n[s];e._lightbox||e.getLightbox();var o=e._lightbox.querySelector(`#${a.id}`),_=o.nextSibling,r={section:a,header:o,node:_,getValue:function(l){return e.form_blocks[a.type].get_value(_,l||{},a)},setValue:function(l,h){return e.form_blocks[a.type].set_value(_,l,h||{},a)}},d=e._lightbox_controls["get_"+a.type+"_control"];return d?d(r):r},e._lightbox_controls.get_template_control=function(t){return t.control=t.node,t},e._lightbox_controls.get_select_control=function(t){return t.control=t.node.getElementsByTagName("select")[0],t},e._lightbox_controls.get_textarea_control=function(t){return t.control=t.node.getElementsByTagName("textarea")[0],t},e._lightbox_controls.get_time_control=function(t){return t.control=t.node.getElementsByTagName("select"),t},e._lightbox_controls.defaults={template:{height:30},textarea:{height:200},select:{height:23},time:{height:20}},e.form_blocks={template:{render:function(t){return`<div class='dhx_cal_ltext dhx_cal_template' ${t.height?`style='height:${t.height}px;'`:""}></div>`},set_value:function(t,n,s,a){t.innerHTML=n||""},get_value:function(t,n,s){return t.innerHTML||""},focus:function(t){}},textarea:{render:function(t){return`<div class='dhx_cal_ltext' ${t.height?`style='height:${t.height}px;'`:""}><textarea ${t.placeholder?`placeholder='${t.placeholder}'`:""}></textarea></div>`},set_value:function(t,n,s){e.form_blocks.textarea._get_input(t).value=n||""},get_value:function(t,n){return e.form_blocks.textarea._get_input(t).value},focus:function(t){var n=e.form_blocks.textarea._get_input(t);e._focus(n,!0)},_get_input:function(t){return t.getElementsByTagName("textarea")[0]}},select:{render:function(t){for(var n=`<div class='dhx_cal_ltext dhx_cal_select' ${t.height?`style='height:${t.height}px;'`:""}><select style='width:100%;'>`,s=0;s<t.options.length;s++)n+="<option value='"+t.options[s].key+"'>"+t.options[s].label+"</option>";return n+="</select></div>"},set_value:function(t,n,s,a){var o=t.firstChild;!o._dhx_onchange&&a.onchange&&(e.event(o,"change",a.onchange),o._dhx_onchange=!0),n===void 0&&(n=(o.options[0]||{}).value),o.value=n||""},get_value:function(t,n){return t.firstChild.value},focus:function(t){var n=t.firstChild;e._focus(n,!0)}},time:{render:function(t){t.time_format||(t.time_format=["%H:%i","%d","%m","%Y"]),t._time_format_order={};var n=t.time_format,s=e.config,a=e.date.date_part(e._currentDate()),o=1440,_=0;e.config.limit_time_select&&(o=60*s.last_hour+1,_=60*s.first_hour,a.setHours(s.first_hour));for(var r="",d=0;d<n.length;d++){var l=n[d];d>0&&(r+=" ");var h="",p="";switch(l){case"%Y":var v,g,c;h="dhx_lightbox_year_select",t._time_format_order[3]=d,t.year_range&&(isNaN(t.year_range)?t.year_range.push&&(g=t.year_range[0],c=t.year_range[1]):v=t.year_range),v=v||10;var u=u||Math.floor(v/2);g=g||a.getFullYear()-u,c=c||g+v;for(var f=g;f<c;f++)p+="<option value='"+f+"'>"+f+"</option>";break;case"%m":for(h="dhx_lightbox_month_select",t._time_format_order[2]=d,f=0;f<12;f++)p+="<option value='"+f+"'>"+this.locale.date.month_full[f]+"</option>";break;case"%d":for(h="dhx_lightbox_day_select",t._time_format_order[1]=d,f=1;f<32;f++)p+="<option value='"+f+"'>"+f+"</option>";break;case"%H:%i":h="dhx_lightbox_time_select",t._time_format_order[0]=d,f=_;var y=a.getDate();for(t._time_values=[];f<o;)p+="<option value='"+f+"'>"+this.templates.time_picker(a)+"</option>",t._time_values.push(f),a.setTime(a.valueOf()+60*this.config.time_step*1e3),f=24*(a.getDate()!=y?1:0)*60+60*a.getHours()+a.getMinutes()}if(p){var w=e._waiAria.lightboxSelectAttrString(l);r+="<select class='"+h+"' "+(t.readonly?"disabled='disabled'":"")+w+">"+p+"</select> "}}return`<div class='dhx_section_time' ${t.height?`style='height:${t.height}px;'`:""}>${r}<span style='font-weight:normal; font-size:10pt;' class='dhx_section_time_spacer'> &nbsp;&ndash;&nbsp; </span>${r}</div>`},set_value:function(t,n,s,a){var o,_,r=e.config,d=t.getElementsByTagName("select"),l=a._time_format_order;if(r.full_day){if(!t._full_day){var h="<label class='dhx_fullday'><input type='checkbox' name='full_day' value='true'> "+e.locale.labels.full_day+"&nbsp;</label></input>";e.config.wide_form||(h=t.previousSibling.innerHTML+h),t.previousSibling.innerHTML=h,t._full_day=!0}var p=t.previousSibling.getElementsByTagName("input")[0];p.checked=e.date.time_part(s.start_date)===0&&e.date.time_part(s.end_date)===0,d[l[0]].disabled=p.checked,d[l[0]+d.length/2].disabled=p.checked,p.$_eventAttached||(p.$_eventAttached=!0,e.event(p,"click",function(){if(p.checked){var u={};e.form_blocks.time.get_value(t,u,a),o=e.date.date_part(u.start_date),(+(_=e.date.date_part(u.end_date))==+o||+_>=+o&&(s.end_date.getHours()!==0||s.end_date.getMinutes()!==0))&&(_=e.date.add(_,1,"day"))}else o=null,_=null;d[l[0]].disabled=p.checked,d[l[0]+d.length/2].disabled=p.checked,c(d,0,o||s.start_date),c(d,4,_||s.end_date)}))}if(r.auto_end_date&&r.event_duration)for(var v=function(){r.auto_end_date&&r.event_duration&&(o=new Date(d[l[3]].value,d[l[2]].value,d[l[1]].value,0,d[l[0]].value),_=new Date(o.getTime()+60*e.config.event_duration*1e3),c(d,4,_))},g=0;g<4;g++)d[g].$_eventAttached||(d[g].$_eventAttached=!0,e.event(d[g],"change",v));function c(u,f,y){for(var w=a._time_values,D=60*y.getHours()+y.getMinutes(),M=D,k=!1,N=0;N<w.length;N++){var m=w[N];if(m===D){k=!0;break}m<D&&(M=m)}u[f+l[0]].value=k?D:M,k||M||(u[f+l[0]].selectedIndex=-1),u[f+l[1]].value=y.getDate(),u[f+l[2]].value=y.getMonth(),u[f+l[3]].value=y.getFullYear()}c(d,0,s.start_date),c(d,4,s.end_date)},get_value:function(t,n,s){var a=t.getElementsByTagName("select"),o=s._time_format_order;if(n.start_date=new Date(a[o[3]].value,a[o[2]].value,a[o[1]].value,0,a[o[0]].value),n.end_date=new Date(a[o[3]+4].value,a[o[2]+4].value,a[o[1]+4].value,0,a[o[0]+4].value),!a[o[3]].value||!a[o[3]+4].value){var _=e.getEvent(e._lightbox_id);_&&(n.start_date=_.start_date,n.end_date=_.end_date)}return n.end_date<=n.start_date&&(n.end_date=e.date.add(n.start_date,e.config.time_step,"minute")),{start_date:new Date(n.start_date),end_date:new Date(n.end_date)}},focus:function(t){e._focus(t.getElementsByTagName("select")[0])}}},e._setLbPosition=function(t){t&&(t.style.top=Math.max(i().offsetHeight/2-t.offsetHeight/2,0)+"px",t.style.left=Math.max(i().offsetWidth/2-t.offsetWidth/2,0)+"px")},e.showCover=function(t){t&&(t.style.display="block",this._setLbPosition(t)),e.config.responsive_lightbox&&(document.documentElement.classList.add("dhx_cal_overflow_container"),i().classList.add("dhx_cal_overflow_container")),this.show_cover(),this._cover.style.display=""},e.showLightbox=function(t){if(t)if(this.callEvent("onBeforeLightbox",[t])){this.showCover(n);var n=this.getLightbox();this._setLbPosition(n),this._fill_lightbox(t,n),this._waiAria.lightboxVisibleAttr(n),this.callEvent("onLightbox",[t])}else this._new_event&&(this._new_event=null,e.getEvent(t)&&delete e.getEvent(t).$new)},e._fill_lightbox=function(t,n){var s=this.getEvent(t),a=n.getElementsByTagName("span"),o=[];if(e.templates.lightbox_header){o.push("");var _=e.templates.lightbox_header(s.start_date,s.end_date,s);o.push(_),a[1].innerHTML="",a[2].innerHTML=_}else{var r=this.templates.event_header(s.start_date,s.end_date,s),d=(this.templates.event_bar_text(s.start_date,s.end_date,s)||"").substr(0,70);o.push(r),o.push(d),a[1].innerHTML=r,a[2].innerHTML=d}this._waiAria.lightboxHeader(n,o.join(" "));for(var l=this.config.lightbox.sections,h=0;h<l.length;h++){var p=l[h],v=e._get_lightbox_section_node(p),g=this.form_blocks[p.type],c=s[p.map_to]!==void 0?s[p.map_to]:p.default_value;g.set_value.call(this,v,c,s,p),l[h].focus&&g.focus.call(this,v)}e._lightbox_id=t},e._get_lightbox_section_node=function(t){return e._lightbox.querySelector(`#${t.id}`).nextSibling},e._lightbox_out=function(t){for(var n=this.config.lightbox.sections,s=0;s<n.length;s++){var a=e._lightbox.querySelector(`#${n[s].id}`);a=a&&a.nextSibling;var o=this.form_blocks[n[s].type].get_value.call(this,a,t,n[s]);n[s].map_to!="auto"&&(t[n[s].map_to]=o)}return t},e._empty_lightbox=function(t){var n=e._lightbox_id,s=this.getEvent(n);s&&(this._lame_copy(s,t),this.setEvent(s.id,s),this._edit_stop_event(s,!0)),this.render_view_data()},e.hide_lightbox=function(t){e.endLightbox(!1,this.getLightbox())},e.hideCover=function(t){t&&(t.style.display="none"),this.hide_cover(),e.config.responsive_lightbox&&(document.documentElement.classList.remove("dhx_cal_overflow_container"),i().classList.remove("dhx_cal_overflow_container"))},e.hide_cover=function(){this._cover&&this._cover.parentNode.removeChild(this._cover),this._cover=null},e.show_cover=function(){this._cover||(this._cover=document.createElement("div"),this._cover.className="dhx_cal_cover",this._cover.style.display="none",e.event(this._cover,"mousemove",e._move_while_dnd),e.event(this._cover,"mouseup",e._finish_dnd),i().appendChild(this._cover))},e.save_lightbox=function(){var t=this._lightbox_out({},this._lame_copy(this.getEvent(this._lightbox_id)));this.checkEvent("onEventSave")&&!this.callEvent("onEventSave",[this._lightbox_id,t,this._new_event])||(this.checkEvent("onRecurringEventSave")&&e.callEvent("onRecurringEventSave",[this._lightbox_id,t,this._new_event]),this._empty_lightbox(t),this.hide_lightbox())},e.startLightbox=function(t,n){this._lightbox_id=t,this._custom_lightbox=!0,this._temp_lightbox=this._lightbox,this._lightbox=n,this.showCover(n)},e.endLightbox=function(t,n){n=n||e.getLightbox();var s=e.getEvent(this._lightbox_id);s&&this._edit_stop_event(s,t),t&&e.render_view_data(),this.hideCover(n),this._custom_lightbox&&(this._lightbox=this._temp_lightbox,this._custom_lightbox=!1),this._temp_lightbox=this._lightbox_id=null,this._waiAria.lightboxHiddenAttr(n),this.resetLightbox(),this.callEvent("onAfterLightbox",[])},e.resetLightbox=function(){e._lightbox&&!e._custom_lightbox&&e._lightbox.parentNode.removeChild(e._lightbox),e._lightbox=null},e.cancel_lightbox=function(){this._lightbox_id&&this.callEvent("onEventCancel",[this._lightbox_id,!!this._new_event]),this.hide_lightbox()},e.hideLightbox=e.cancel_lightbox,e._delete_event_confirm=function({event:t,message:n,title:s,callback:a,ok:o}){e._dhtmlx_confirm({message:n,title:s,callback:a,ok:o})},e._init_lightbox_events=function(){if(this.getLightbox().$_eventAttached)return;const t=this.getLightbox();t.$_eventAttached=!0,e.event(t,"click",function(n){n.target.closest(".dhx_cal_ltitle_close_btn")&&e.cancel_lightbox();const s=e.$domHelpers.closest(n.target,".dhx_btn_set");if(!s){const _=e.$domHelpers.closest(n.target,".dhx_custom_button[data-section-index]");if(_){const r=Number(_.getAttribute("data-section-index"));e.form_blocks[e.config.lightbox.sections[r].type].button_click(e.$domHelpers.closest(_,".dhx_cal_lsection"),_,n)}return}const a=s?s.getAttribute("data-action"):null;switch(a){case"dhx_save_btn":case"save":if(e.config.readonly_active)return;e.save_lightbox();break;case"dhx_delete_btn":case"delete":if(e.config.readonly_active)return;var o=e.locale.labels.confirm_deleting;e._delete_event_confirm({event:e.getEvent(e._lightbox_id),message:o,title:e.locale.labels.title_confirm_deleting,callback:function(){let _=e.getEvent(e._lightbox_id);_._thisAndFollowing?(_._removeFollowing=!0,e.callEvent("onRecurringEventSave",[_.id,_,e._new_event])):e.deleteEvent(e._lightbox_id),e._new_event=null,delete _.$new,e.hide_lightbox()},config:{ok:e.locale.labels.icon_delete}});break;case"dhx_cancel_btn":case"cancel":e.cancel_lightbox();break;default:e.callEvent("onLightboxButton",[a,s,n])}}),e.event(t,"keydown",function(n){var s=n||window.event,a=n.target||n.srcElement,o=a.querySelector("[dhx_button]");switch(o||(o=a.parentNode.querySelector(".dhx_custom_button, .dhx_readonly")),(n||s).keyCode){case 32:if((n||s).shiftKey)return;o&&o.click&&o.click();break;case e.keys.edit_save:if((n||s).shiftKey)return;if(o&&o.click)o.click();else{if(e.config.readonly_active)return;e.save_lightbox()}break;case e.keys.edit_cancel:e.cancel_lightbox()}}),e.event(t,"click",function(n){if(n.target.closest(".dhx_lightbox_day_select")||n.target.closest(".dhx_lightbox_month_select")){const s=t.querySelectorAll(".dhx_lightbox_month_select"),a=t.querySelectorAll(".dhx_lightbox_day_select"),o=t.querySelectorAll(".dhx_lightbox_year_select");s.length&&a.length&&o&&s.forEach((_,r)=>{const d=a[r],l=parseInt(_.value,10);let h=parseInt(o[r].value,10);h||(h=new Date(e.getState().date).getFullYear());const p=function(c,u){return new Date(c,u+1,0).getDate()}(h,l),v=p||31;let g=d.value;d.innerHTML="";for(let c=1;c<=v;c++){const u=document.createElement("option");u.value=c,u.textContent=c,d.appendChild(u)}d.value=Math.min(g,v)})}})},e.setLightboxSize=function(){},e._init_dnd_events=function(){e.event(i(),"mousemove",e._move_while_dnd),e.event(i(),"mouseup",e._finish_dnd),e._init_dnd_events=function(){}},e._move_while_dnd=function(t){if(e._dnd_start_lb){document.dhx_unselectable||(i().classList.add("dhx_unselectable"),document.dhx_unselectable=!0);var n=e.getLightbox(),s=[t.pageX,t.pageY];n.style.top=e._lb_start[1]+s[1]-e._dnd_start_lb[1]+"px",n.style.left=e._lb_start[0]+s[0]-e._dnd_start_lb[0]+"px"}},e._ready_to_dnd=function(t){var n=e.getLightbox();e._lb_start=[n.offsetLeft,n.offsetTop],e._dnd_start_lb=[t.pageX,t.pageY]},e._finish_dnd=function(){e._lb_start&&(e._lb_start=e._dnd_start_lb=!1,i().classList.remove("dhx_unselectable"),document.dhx_unselectable=!1)},e.getLightbox=function(){if(!this._lightbox){var t=document.createElement("div");t.className="dhx_cal_light",e.config.wide_form&&(t.className+=" dhx_cal_light_wide"),e.form_blocks.recurring&&(t.className+=" dhx_cal_light_rec"),e.config.rtl&&(t.className+=" dhx_cal_light_rtl"),e.config.responsive_lightbox&&(t.className+=" dhx_cal_light_responsive"),t.style.visibility="hidden";var n=this._lightbox_template,s=this.config.buttons_right;n+="<div class='dhx_cal_lcontrols'>";for(var a=0;a<s.length;a++)n+="<div "+this._waiAria.lightboxButtonAttrString(s[a])+" data-action='"+s[a]+"' class='dhx_btn_set dhx_"+(e.config.rtl?"right":"left")+"_btn_set "+s[a]+"_set'><div class='dhx_btn_inner "+s[a]+"'></div><div>"+e.locale.labels[s[a]]+"</div></div>";s=this.config.buttons_left;var o=e.config.rtl;for(a=0;a<s.length;a++)n+="<div class='dhx_cal_lcontrols_push_right'></div>",n+="<div "+this._waiAria.lightboxButtonAttrString(s[a])+" data-action='"+s[a]+"' class='dhx_btn_set dhx_"+(o?"left":"right")+"_btn_set "+s[a]+"_set'><div class='dhx_btn_inner "+s[a]+"'></div><div>"+e.locale.labels[s[a]]+"</div></div>";n+="</div>",n+="</div>",t.innerHTML=n,e.config.drag_lightbox&&(e.event(t.firstChild,"mousedown",e._ready_to_dnd),e.event(t.firstChild,"selectstart",function(v){return v.preventDefault(),!1}),t.firstChild.style.cursor="move",e._init_dnd_events()),this._waiAria.lightboxAttr(t),this.show_cover(),this._cover.insertBefore(t,this._cover.firstChild),this._lightbox=t;var _=this.config.lightbox.sections;for(n="",a=0;a<_.length;a++){var r=this.form_blocks[_[a].type];if(r){_[a].id="area_"+this.uid();var d="";_[a].button&&(d="<div "+e._waiAria.lightboxSectionButtonAttrString(this.locale.labels["button_"+_[a].button])+" class='dhx_custom_button' data-section-index='"+a+"' index='"+a+"'><div class='dhx_custom_button_"+_[a].button+"'></div><div>"+this.locale.labels["button_"+_[a].button]+"</div></div>"),this.config.wide_form&&(n+="<div class='dhx_wrap_section'>");var l=this.locale.labels["section_"+_[a].name];typeof l!="string"&&(l=_[a].name),n+="<div id='"+_[a].id+"' class='dhx_cal_lsection dhx_cal_lsection_"+_[a].name+"'>"+d+"<label>"+l+"</label></div>"+r.render.call(this,_[a]),n+="</div>"}}var h=t.getElementsByTagName("div");for(a=0;a<h.length;a++){var p=h[a];if(e._getClassName(p)=="dhx_cal_larea"){p.innerHTML=n;break}}e._bindLightboxLabels(_),this.setLightboxSize(),this._init_lightbox_events(this),t.style.visibility="visible"}return this._lightbox},e._bindLightboxLabels=function(t){for(var n=0;n<t.length;n++){var s=t[n];if(s.id&&e._lightbox.querySelector(`#${s.id}`)){for(var a=e._lightbox.querySelector(`#${s.id}`).querySelector("label"),o=e._get_lightbox_section_node(s);o&&!o.querySelector;)o=o.nextSibling;var _=!0;if(o){var r=o.querySelector("input, select, textarea");r&&(s.inputId=r.id||"input_"+e.uid(),r.id||(r.id=s.inputId),a.setAttribute("for",s.inputId),_=!1)}_&&e.form_blocks[s.type].focus&&e.event(a,"click",function(d){return function(){var l=e.form_blocks[d.type],h=e._get_lightbox_section_node(d);l&&l.focus&&l.focus.call(e,h)}}(s))}}},e.attachEvent("onEventIdChange",function(t,n){this._lightbox_id==t&&(this._lightbox_id=n)}),e._lightbox_template=`<div class='dhx_cal_ltitle'><div class="dhx_cal_ltitle_descr"><span class='dhx_mark'>&nbsp;</span><span class='dhx_time'></span><span class='dhx_title'></span>

Callers 14

NtFunction · 0.70
tFunction · 0.70
ztFunction · 0.70
hFunction · 0.70
pFunction · 0.70
JtFunction · 0.70
sFunction · 0.70
WtFunction · 0.70
rFunction · 0.70
_notifyStateChangeMethod · 0.70
_renderDayGridHeaderMethod · 0.70
aaFunction · 0.70

Calls 9

iFunction · 0.70
tFunction · 0.70
sFunction · 0.70
DFunction · 0.70
eventMethod · 0.65
focusMethod · 0.65
getEventMethod · 0.65
getStateMethod · 0.65
hideMethod · 0.45

Tested by

no test coverage detected