File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/calendar/install/js/calendar/controls/dist/controls.bundle.min.js
Back
this.BX=this.BX||{};this.BX.Calendar=this.BX.Calendar||{};(function(e,t,i,a,s,n,l,o,r,u,c,d){"use strict";var p=function(){function e(t){babelHelpers.classCallCheck(this,e);babelHelpers.defineProperty(this,"Z_INDEX",4e3);babelHelpers.defineProperty(this,"MIN_WIDTH",102);this.DOM={wrap:t.wrap,input:t.input};this.onChangeCallback=u.Type.isFunction(t.onChangeCallback)?t.onChangeCallback:null;this.create()}babelHelpers.createClass(e,[{key:"create",value:function t(){var i=this;this.selectContol=new BX.Calendar.Controls.SelectInput({input:this.DOM.input,zIndex:this.Z_INDEX,values:e.getValueList(),minWidth:this.MIN_WIDTH,onChangeCallback:function e(){if(i.onChangeCallback){i.onChangeCallback(i.selectContol.getInputValue())}}})}},{key:"setValue",value:function t(i){var a;if(u.Type.isDate(i)){a={h:i.getHours(),m:i.getMinutes()}}else{a=r.Util.parseTime(i)}var s=e.adaptTimeValue(a);this.selectContol.setValue({value:s.value});var n=Math.floor(s.value/60);var l=s.value-n*60;this.DOM.input.value=r.Util.formatTime(n,l)}}],[{key:"adaptTimeValue",value:function t(i){i=parseInt(i.h*60)+parseInt(i.m);var a=e.getValueList(),s=24*60,n=false,l;for(l=0;l<a.length;l++){if(Math.abs(a[l].value-i)<s){s=Math.abs(a[l].value-i);n=l;if(s<=15){break}}}return a[n||0]}},{key:"getValueList",value:function t(){if(!e.valueList){e.valueList=[];var i;for(i=0;i<24;i++){e.valueList.push({value:i*60,label:r.Util.formatTime(i,0)});e.valueList.push({value:i*60+30,label:r.Util.formatTime(i,30)})}}return e.valueList}}]);return e}();babelHelpers.defineProperty(p,"valueList",null);var h,f,m,v,b,g,D,y;var M=function(e){babelHelpers.inherits(t,e);function t(e){var i;babelHelpers.classCallCheck(this,t);i=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"defaultReminderTime",540);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"fullDayMode",false);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"extendedMode",true);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"selectedValues",[]);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"controlList",{});babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"viewMode",false);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"DOM",{});babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"changedByUser",false);i.setEventNamespace("BX.Calendar.Controls.Reminder");i.values=i.getValues();i.id=e.id||"reminder-"+Math.round(Math.random()*1e6);i.zIndex=e.zIndex||3200;i.rawValuesMap=new Map;i.viewMode=e.viewMode===true;i.changeCallack=e.changeCallack;i.showPopupCallBack=e.showPopupCallBack;i.hidePopupCallBack=e.hidePopupCallBack;i.create(e);i.setValue(e.selectedValues||[]);i.bindEventHandlers();return i}babelHelpers.createClass(t,[{key:"create",value:function e(t){if(u.Type.isElementNode(t.wrap)){this.DOM.wrap=t.wrap}if(!u.Type.isElementNode(this.DOM.wrap)){return}u.Dom.addClass(this.DOM.wrap,"calendar-notification-values");if(!this.viewMode){this.DOM.addButton=this.DOM.wrap.appendChild(u.Tag.render(h||(h=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<span class="calendar-notification-add-btn-wrap">\n\t\t\t\t\t<span class="calendar-notification-text">','</span>\n\t\t\t\t\t<span class="calendar-notification-btn-container calendar-notification-btn-add">\n\t\t\t\t\t\t<span class="calendar-notification-icon"></span>\n\t\t\t\t\t</span>\n\t\t\t\t</span>'])),u.Loc.getMessage("EC_REMIND1_ADD")))}}},{key:"bindEventHandlers",value:function e(){if(u.Type.isDomNode(this.DOM.addButton)){u.Event.bind(this.DOM.addButton,"click",this.showPopup.bind(this))}if(u.Type.isDomNode(this.DOM.wrap)){u.Event.bind(this.DOM.wrap,"click",this.handleClick.bind(this))}}},{key:"getValues",value:function e(){var t=[];if(!this.fullDayMode){t=t.concat([{value:0,label:u.Loc.getMessage("EC_REMIND1_0"),shortLabel:u.Loc.getMessage("EC_REMIND1_SHORT_0")},{value:5,label:u.Loc.getMessage("EC_REMIND1_5"),shortLabel:u.Loc.getMessage("EC_REMIND1_SHORT_5")},{value:10,label:u.Loc.getMessage("EC_REMIND1_10"),shortLabel:u.Loc.getMessage("EC_REMIND1_SHORT_10")},{value:15,label:u.Loc.getMessage("EC_REMIND1_15"),shortLabel:u.Loc.getMessage("EC_REMIND1_SHORT_15")},{value:20,label:u.Loc.getMessage("EC_REMIND1_20"),shortLabel:u.Loc.getMessage("EC_REMIND1_SHORT_20")},{value:30,label:u.Loc.getMessage("EC_REMIND1_30"),shortLabel:u.Loc.getMessage("EC_REMIND1_SHORT_30")},{value:60,label:u.Loc.getMessage("EC_REMIND1_60"),shortLabel:u.Loc.getMessage("EC_REMIND1_SHORT_60")},{value:120,label:u.Loc.getMessage("EC_REMIND1_120"),shortLabel:u.Loc.getMessage("EC_REMIND1_SHORT_120")}])}if(this.extendedMode){t=t.concat([{id:"time-menu-day-0",label:u.Loc.getMessage("EC_REMIND1_DAY_0"),dataset:{mode:"time-menu",daysBefore:0,time:this.defaultReminderTime}},{id:"time-menu-day-1",label:u.Loc.getMessage("EC_REMIND1_DAY_1"),dataset:{mode:"time-menu",daysBefore:1,time:this.defaultReminderTime}},{id:"time-menu-day-2",label:u.Loc.getMessage("EC_REMIND1_DAY_2"),dataset:{mode:"time-menu",daysBefore:2,time:this.defaultReminderTime}},{id:"custom",label:u.Loc.getMessage("EC_REMIND1_CUSTOM"),dataset:{mode:"custom"}}])}return t}},{key:"setValue",value:function e(t){var i=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;this.selectedValues.forEach((function(e){i.removeValue(e,a)}));if(u.Type.isArray(t)){t.forEach((function(e){i.addValue(e,a,s)}),this)}}},{key:"getSelectedValues",value:function e(){return this.selectedValues}},{key:"getSelectedRawValues",value:function e(){var t=this;var i=[];this.selectedValues.forEach((function(e){i.push(t.rawValuesMap.get(e)||e)}));return i}},{key:"setFullDayMode",value:function e(t){if(t!==this.fullDayMode){this.fullDayMode=t;this.values=this.getValues()}}},{key:"showPopup",value:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var a=this;var s=[];this.values.forEach((function(e){if(e.mode==="time-menu"||e.mode==="custom"||!BX.util.in_array(e.value,t.selectedValues)){var n={};if(e.dataset&&e.dataset.mode==="time-menu"){n.id=e.id;var l=r.Util.getTimeByInt(t.defaultReminderTime);n.text=e.label.replace("#TIME#",r.Util.formatTime(l.hour,l.min));n.dataset=BX.util.objectMerge({type:"submenu-list",value:t.defaultReminderTime},e.dataset);n.items=t.getSubmenuTimeValues(n,e.label,i);n.onclick=function(){return function(){a.addValue({before:e.dataset.daysBefore,time:e.dataset.time});BX.defer((function(){a.reminderMenu.close()}),a)();if(u.Type.isFunction(i.addValueCallback)){i.addValueCallback()}}}()}else if(e.dataset&&e.dataset.mode==="custom"){n.id="custom";n.text=e.label;n.items=[{id:"tmp",text:"tmp"}]}else{n.text=e.label;n.onclick=function(e,t){return function(){a.addValue(e);a.reminderMenu.close();if(u.Type.isFunction(i.addValueCallback)){i.addValueCallback()}}}(e.value,e.mode)}s.push(n)}}),this);this.reminderMenu=c.MenuManager.create(this.id,i.bindTarget||this.DOM.addButton,s,{closeByEsc:true,autoHide:true,zIndex:this.zIndex,offsetTop:0,offsetLeft:9,angle:true,cacheable:false});var n=this.adjustSubmenuPopup.bind(this);var l=this.closeSubmenuPopup.bind(this);o.EventEmitter.subscribe("BX.Main.Popup:onShow",n);o.EventEmitter.subscribe("BX.Main.Popup:onClose",l);this.reminderMenu.popupWindow.subscribe("onClose",(function(){o.EventEmitter.unsubscribe("BX.Main.Popup:onShow",n);o.EventEmitter.unsubscribe("BX.Main.Popup:onClose",l)}));this.reminderMenu.show()}},{key:"getSubmenuTimeValues",value:function e(i,a,s){var n=[];t.getTimeValueList(60).forEach((function(e){n.push({id:"time-"+e.value,dataset:{value:e.value,daysBefore:i.dataset.daysBefore},text:e.label,onclick:function(e,t){var n=r.Util.getTimeByInt(t.dataset.value);var l=this.reminderMenu.getMenuItem(i.id);if(l){l.setText(a.replace("#TIME#",r.Util.formatTime(n.hour,n.min)))}this.addValue({time:t.dataset.value,before:t.dataset.daysBefore});BX.defer((function(){this.reminderMenu.close()}),this)();if(u.Type.isFunction(s.addValueCallback)){s.addValueCallback()}}.bind(this)})}),this);return n}},{key:"addValue",value:function e(i){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var n;var l=t.formatValue(i);if(u.Type.isPlainObject(i)&&i.count){i=parseInt(l)}if(u.Type.isPlainObject(i)&&!this.selectedValues.includes(l)){if(u.Type.isInteger(parseInt(i.before))&&u.Type.isInteger(parseInt(i.time))){n=this.DOM.wrap.appendChild(u.Tag.render(f||(f=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="calendar-reminder-item">\n\t\t\t\t\t\t<span class="calendar-reminder-item-title">\n\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>"])),t.getReminderLabel(i)));if(!this.viewMode){n.appendChild(u.Tag.render(m||(m=babelHelpers.taggedTemplateLiteral(['<span class="calendar-reminder-clear-icon" data-bxc-value="','"/>'])),l))}}else if(i.type==="date"&&u.Type.isDate(i.value)){n=this.DOM.wrap.appendChild(u.Tag.render(v||(v=babelHelpers.taggedTemplateLiteral(['<span class="calendar-reminder-item">\n\t\t\t\t\t<span class="calendar-reminder-item-title">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</span>\n\t\t\t\t</span>"])),r.Util.formatDateUsable(i.value)+" "+r.Util.formatTime(i.value)));if(!this.viewMode){n.appendChild(u.Tag.render(b||(b=babelHelpers.taggedTemplateLiteral(['<span class="calendar-reminder-clear-icon" data-bxc-value="','"/>'])),l))}}this.selectedValues.push(l);this.controlList[l]=n;this.rawValuesMap.set(l,i)}else if(parseInt(i)>=0&&!this.selectedValues.includes(l)){for(var c=0;c<this.values.length;c++){if(this.values[c].value===parseInt(i)){n=this.DOM.wrap.appendChild(u.Tag.render(g||(g=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="calendar-reminder-item">\n\t\t\t\t\t\t<span class="calendar-reminder-item-title">\n\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</span>"])),this.values[c].shortLabel||this.values[c].label));if(!this.viewMode){n.appendChild(u.Tag.render(D||(D=babelHelpers.taggedTemplateLiteral(['<span class="calendar-reminder-clear-icon" data-bxc-value="','"/>'])),l))}this.selectedValues.push(l);this.controlList[l]=n;this.rawValuesMap.set(l,i);break}}if(n===undefined){n=this.DOM.wrap.appendChild(u.Dom.create("SPAN",{props:{className:"calendar-reminder-item"},text:t.getText(i)}));if(!this.viewMode){n.appendChild(u.Dom.create("SPAN",{props:{className:"calendar-reminder-clear-icon"},events:{click:function(){this.removeValue(i)}.bind(this)}}))}this.selectedValues.push(i);this.controlList[i]=n;this.rawValuesMap.set(i,i)}}if(this.changeCallack){this.changeCallack(this.selectedValues)}if(a){this.emit("onChange",new o.BaseEvent({data:{values:this.selectedValues}}))}this.changedByUser=a&&s;if(u.Type.isElementNode(this.DOM.addButton)){this.DOM.wrap.appendChild(this.DOM.addButton)}}},{key:"removeValue",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(this.controlList[t]&&u.Type.isDomNode(this.controlList[t])){u.Dom.remove(this.controlList[t])}this.selectedValues=BX.util.deleteFromArray(this.selectedValues,BX.util.array_search(t,this.selectedValues));if(this.changeCallack){this.changeCallack(this.selectedValues)}if(i){this.emit("onChange",new o.BaseEvent({data:{values:this.selectedValues}}));this.changedByUser=true}}},{key:"handleClick",value:function e(t){var i=this;var a=t.target||t.srcElement;var s=a.getAttribute("data-bxc-value");if(!u.Type.isNull(s)&&this.selectedValues.includes(s)){this.removeValue(s)}if(u.Dom.hasClass(a,"calendar-reminder-item-title")){this.showPopup({bindTarget:a,addValueCallback:function e(){var t=a.parentNode.querySelector(".calendar-reminder-clear-icon");if(u.Type.isElementNode(t)&&!u.Type.isNull(t.getAttribute("data-bxc-value"))){i.removeValue(t.getAttribute("data-bxc-value"))}}})}}},{key:"adjustSubmenuPopup",value:function e(t){if(t instanceof o.BaseEvent){var i=t.getTarget();if(i instanceof c.Popup){if(/^menu-popup-popup-submenu-time-menu-day-\d$/.test(i.getId())){this.adjustTimeSubmenuPopup(i)}else if(/^menu-popup-popup-submenu-custom$/.test(i.getId())){this.adjustCalendarSubmenuPopup(i)}}}}},{key:"closeSubmenuPopup",value:function e(t){if(t instanceof o.BaseEvent){var i=t.getTarget();if(i instanceof c.Popup){if(/^menu-popup-popup-submenu-time-menu-day-\d$/.test(i.getId()));else if(/^menu-popup-popup-submenu-custom$/.test(i.getId())){var a=i.bindElement;var s=a.querySelector(".menu-popup-item-text");if(u.Type.isDomNode(s)){u.Dom.clean(s);s.innerHTML=u.Loc.getMessage("EC_REMIND1_CUSTOM")}}}}}},{key:"adjustTimeSubmenuPopup",value:function e(t){var i=t.getContentContainer().querySelector('span[data-value="'+this.defaultReminderTime+'"]');if(u.Type.isDomNode(i)){setTimeout((function(){t.getContentContainer().scrollTop=parseInt(i.offsetTop)-10;u.Dom.addClass(i,"menu-popup-item-open")}),50)}}},{key:"adjustCalendarSubmenuPopup",value:function e(t){var i=this;var a=t.bindElement;var s=a.querySelector(".menu-popup-item-text");if(u.Type.isDomNode(s)){u.Dom.clean(s);var n=s.appendChild(u.Tag.render(y||(y=babelHelpers.taggedTemplateLiteral(['<input id="inp-','" type="text" class="calendar-field calendar-field-datetime" value="" autocomplete="off" placeholder="','"/>'])),Math.round(Math.random()*1e5),u.Loc.getMessage("EC_REMIND1_CUSTOM_PLACEHOLDER")));var l=BX.calendar.get();l.popup=null;l._current_layer=null;l._layers={};l.Show({node:n,value:r.Util.formatDateTime(r.Util.getUsableDateTime(new Date)),field:n,bTime:true,bHideTime:false});var o=l.popup;o.cacheable=false;if(o&&o.popupContainer){var d=o.popupContainer.querySelector(".bx-calendar");if(u.Type.isDomNode(d)){t.contentContainer.appendChild(d)}o.close();c.MenuManager.destroy(o.uniquePopupId)}u.Event.bind(n,"change",(function(){var e=n.value,t=r.Util.parseDate(e);if(u.Type.isDate(t)){i.addValue({type:"date",value:t});i.reminderMenu.close()}}))}}},{key:"setViewMode",value:function e(t){this.viewMode=t;if(this.viewMode){u.Dom.addClass(this.DOM.wrap,"calendar-reminder-readonly");if(u.Type.isElementNode(this.DOM.addButton)){this.DOM.addButton.style.display="none"}}else{u.Dom.removeClass(this.DOM.wrap,"calendar-reminder-readonly")}}},{key:"wasChangedByUser",value:function e(){return this.changedByUser}}],[{key:"getTimeValueList",value:function e(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:30;if(!t.timeValueList){t.timeValueList=[];var a;for(a=0;a<24;a++){t.timeValueList.push({value:a*60,label:r.Util.formatTime(a,0)});if(i<=30){t.timeValueList.push({value:a*60+30,label:r.Util.formatTime(a,30)})}}}return t.timeValueList}},{key:"inputCalendarClosePopupHandler",value:function e(t){BX.onCustomEvent(window,"onCalendarControlChildPopupClosed")}},{key:"getReminderLabel",value:function e(t){var i="";t.before=parseInt(t.before);t.time=parseInt(t.time);if(u.Type.isInteger(t.before)&&u.Type.isInteger(t.time)&&[0,1,2].includes(t.before)){var a=r.Util.getTimeByInt(t.time);i=u.Loc.getMessage("EC_REMIND1_DAY_"+t.before+"_SHORT").replace("#TIME#",r.Util.formatTime(a.hour,a.min))}return i}},{key:"getText",value:function e(t){var i=t,a=[60,24],s=["EC_REMIND1_MIN_COUNT","EC_REMIND1_HOUR_COUNT","EC_REMIND1_DAY_COUNT"],n="";for(var l=0;l<s.length;l++){if(i<a[l]||l===a.length){n=u.Loc.getMessage(s[l]).toString();n=n.replace("#COUNT#",i.toString());break}else{i=Math.ceil(i/a[l])}}return n}},{key:"formatValue",value:function e(t){if(u.Type.isPlainObject(t)&&u.Type.isInteger(parseInt(t.before))&&u.Type.isInteger(parseInt(t.time))){return"daybefore|"+t.before+"|"+t.time}else if(u.Type.isPlainObject(t)&&u.Type.isDate(t.value)){return"date|"+r.Util.formatDateTime(t.value)}else if(u.Type.isPlainObject(t)&&t.type){if(t.type==="min"){return t.count.toString()}if(t.type==="hour"){return(parseInt(t.count)*60).toString()}if(t.type==="day"){return(parseInt(t.count)*60*24).toString()}}return t.toString()}}]);return t}(o.EventEmitter);babelHelpers.defineProperty(M,"timeValueList",null);var C,T,E,I;function O(e,t){var i=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=L(e))||t&&e&&typeof e.length==="number"){if(i)e=i;var a=0;var s=function e(){};return{s:s,n:function t(){if(a>=e.length)return{done:true};return{done:false,value:e[a++]}},e:function e(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n=true,l=false,o;return{s:function t(){i=i.call(e)},n:function e(){var t=i.next();n=t.done;return t},e:function e(t){l=true;o=t},f:function e(){try{if(!n&&i["return"]!=null)i["return"]()}finally{if(l)throw o}}}}function L(e,t){if(!e)return;if(typeof e==="string")return k(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor)i=e.constructor.name;if(i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return k(e,t)}function k(e,t){if(t==null||t>e.length)t=e.length;for(var i=0,a=new Array(t);i<t;i++){a[i]=e[i]}return a}var w=function(){function e(t){babelHelpers.classCallCheck(this,e);babelHelpers.defineProperty(this,"datesRange",[]);babelHelpers.defineProperty(this,"viewMode",false);this.params=t;this.id=t.id||"location-"+Math.round(Math.random()*1e6);this.zIndex=t.zIndex||3100;this.DOM={wrapNode:t.wrap};this.roomsManager=t.roomsManager||null;this.locationAccess=t.locationAccess||false;this.disabled=!t.richLocationEnabled;this.value={type:"",text:"",value:""};this.inlineEditModeEnabled=t.inlineEditModeEnabled;this.meetingRooms=t.iblockMeetingRoomList||[];e.setMeetingRoomList(t.iblockMeetingRoomList);e.setLocationList(t.locationList);if(!this.disabled){this["default"]=this.setDefaultRoom(t.locationList)||""}this.create();this.setViewMode(t.viewMode===true)}babelHelpers.createClass(e,[{key:"create",value:function e(){this.DOM.inputWrap=this.DOM.wrapNode.appendChild(u.Tag.render(C||(C=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="calendar-field-block"></div>\n\t\t']))));this.DOM.alertIconLocation=u.Tag.render(T||(T=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="ui-alert-icon-danger calendar-location-alert-icon" data-hint-no-icon="Y" data-hint="','">\n\t\t\t<i></i>\n\t\t\t</div>\n\t\t'])),u.Loc.getMessage("EC_LOCATION_OVERFLOW"));if(this.inlineEditModeEnabled){this.DOM.inlineEditLinkWrap=this.DOM.wrapNode.appendChild(u.Tag.render(E||(E=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="calendar-field-place-link">',"\n\t\t\t\t</div>"])),this.DOM.inlineEditLink=u.Tag.render(I||(I=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="calendar-text-link">',"</span>"])),u.Loc.getMessage("EC_REMIND1_ADD"))));this.DOM.inputWrap.style.display="none";u.Event.bind(this.DOM.inlineEditLinkWrap,"click",this.displayInlineEditControls.bind(this))}if(this.disabled){u.Dom.addClass(this.DOM.wrapNode,"locked");this.DOM.inputWrap.appendChild(u.Dom.create("DIV",{props:{className:"calendar-lock-icon"},events:{click:function e(){top.BX.UI.InfoHelper.show("limit_office_calendar_location")}}}))}this.DOM.input=this.DOM.inputWrap.appendChild(u.Dom.create("INPUT",{attrs:{name:this.params.inputName||"",placeholder:u.Loc.getMessage("EC_LOCATION_PLACEHOLDER"),type:"text",autocomplete:this.disabled?"on":"off"},props:{className:"calendar-field calendar-field-select"},style:{paddingRight:25+"px"}}))}},{key:"setValues",value:function t(){var i=[],a=false,s=e.getMeetingRoomList(),n=e.getLocationList();if(u.Type.isArray(s)){s.forEach((function(e){e.ID=parseInt(e.ID);i.push({ID:e.ID,label:e.NAME,labelRaw:e.NAME,value:e.ID,capacity:0,type:"mr"});if(this.value.type==="mr"&&parseInt(this.value.value)===e.ID){a=i.length-1}}),this);if(i.length>0){i.push({delimiter:true})}}if(u.Type.isArray(n)){if(n.length){n.forEach((function(e){e.ID=parseInt(e.ID);e.LOCATION_ID=parseInt(e.LOCATION_ID);i.push({ID:e.ID,LOCATION_ID:e.LOCATION_ID,label:e.NAME,capacity:parseInt(e.CAPACITY)||0,color:e.COLOR,reserved:e.reserved||false,labelRaw:e.NAME,labelCapacity:this.getCapacityMessage(e.CAPACITY),value:e.ID,type:"calendar"});if(this.value.type==="calendar"&&parseInt(this.value.value)===parseInt(e.ID)){a=i.length-1}}),this);if(this.locationAccess){this.loadRoomSlider();i.push({delimiter:true});i.push({label:u.Loc.getMessage("EC_LOCATION_MEETING_ROOM_SET"),callback:this.openRoomsSlider.bind(this)})}}else{if(this.locationAccess){this.loadRoomSlider();i.push({label:u.Loc.getMessage("EC_ADD_LOCATION"),callback:this.openRoomsSlider.bind(this)})}}}if(this.value){this.DOM.input.value=this.value.str||"";if(this.value.type&&(this.value.str===this.getTextLocation(this.value)||this.getTextLocation(this.value)===u.Loc.getMessage("EC_LOCATION_EMPTY"))){this.DOM.input.value="";this.value=""}var l=O(e.locationList),o;try{for(l.s();!(o=l.n()).done;){var r=o.value;if(parseInt(r.ID)===this.value.room_id){e.setCurrentCapacity(parseInt(r.CAPACITY));break}}}catch(e){l.e(e)}finally{l.f()}}if(this.selectContol){this.selectContol.destroy()}this.selectContol=new BX.Calendar.Controls.SelectInput({input:this.DOM.input,values:i,valueIndex:a,zIndex:this.zIndex,disabled:this.disabled,minWidth:300,onChangeCallback:BX.delegate((function(){var t,a=this.DOM.input.value;this.value={text:a};for(t=0;t<i.length;t++){if(i[t].labelRaw===a){this.value.type=i[t].type;this.value.value=i[t].value;e.setCurrentCapacity(i[t].capacity);break}}if(u.Type.isFunction(this.params.onChangeCallback)){this.params.onChangeCallback()}}),this)})}},{key:"setViewMode",value:function e(t){this.viewMode=t;if(this.viewMode){u.Dom.addClass(this.DOM.wrapNode,"calendar-location-readonly")}else{u.Dom.removeClass(this.DOM.wrapNode,"calendar-location-readonly")}}},{key:"addCapacityAlert",value:function e(){var t=this;if(!u.Dom.hasClass(this.DOM.input,"calendar-field-location-select-border")){u.Dom.addClass(this.DOM.input,"calendar-field-location-select-border")}if(u.Type.isDomNode(this.DOM.alertIconLocation)){r.Util.initHintNode(this.DOM.alertIconLocation)}setTimeout((function(){t.DOM.inputWrap.appendChild(t.DOM.alertIconLocation)}),200)}},{key:"removeCapacityAlert",value:function e(){if(u.Dom.hasClass(this.DOM.input,"calendar-field-location-select-border")){u.Dom.removeClass(this.DOM.input,"calendar-field-location-select-border")}if(this.DOM.alertIconLocation.parentNode===this.DOM.inputWrap){this.DOM.inputWrap.removeChild(this.DOM.alertIconLocation)}}},{key:"getCapacityMessage",value:function e(t){var i;if(t%100>10&&t%100<20){i=5}else{i=t%10}return u.Loc.getMessage("EC_LOCATION_CAPACITY_"+i,{"#NUM#":t})}},{key:"checkLocationAccessibility",value:function t(i){var a=this;this.getLocationAccessibility(i.from,i.to).then((function(){var t;var s;var n=i.from.getTime();var l=i.to.getTime();if(i.fullDay){l+=e.DAY_LENGTH}for(var o in e.locationList){e.locationList[o].reserved=false;var c=e.locationList[o].ID;var d=O(a.datesRange),p;try{for(d.s();!(p=d.n()).done;){var h=p.value;if(u.Type.isUndefined(e.accessibility[h][c])){continue}var f=O(e.accessibility[h][c]),m;try{for(f.s();!(m=f.n()).done;){var v=m.value;if(parseInt(v.PARENT_ID)===parseInt(i.currentEventId)){continue}t=r.Util.parseDate(v.DATE_FROM).getTime();s=r.Util.parseDate(v.DATE_TO).getTime();if(v.DT_SKIP_TIME!=="Y"){t-=v["~USER_OFFSET_FROM"]*1e3;s-=v["~USER_OFFSET_TO"]*1e3}else{s+=e.DAY_LENGTH}if(t<l&&s>n){e.locationList[o].reserved=true;break}}}catch(e){f.e(e)}finally{f.f()}if(e.locationList[o].reserved){break}}}catch(e){d.e(e)}finally{d.f()}}a.setValues()}))}},{key:"getLocationAccessibility",value:function t(i,a){var s=this;return new Promise((function(t){s.datesRange=e.getDatesRange(i,a);var n=true;var l=O(s.datesRange),o;try{for(l.s();!(o=l.n()).done;){var r=o.value;if(u.Type.isUndefined(e.accessibility[r])){n=false;break}}}catch(e){l.e(e)}finally{l.f()}if(!n){BX.ajax.runAction("calendar.api.locationajax.getLocationAccessibility",{data:{datesRange:s.datesRange,locationList:e.locationList}}).then((function(i){var a=O(s.datesRange),n;try{for(a.s();!(n=a.n()).done;){var l=n.value;e.accessibility[l]=i.data[l]}}catch(e){a.e(e)}finally{a.f()}t(e.accessibility,s.datesRange)}),(function(e){t(e.errors)}))}else{t(e.accessibility,s.datesRange)}}))}},{key:"loadRoomSlider",value:function e(){if(!this.roomsManagerFromDB){this.getRoomsManager().then(this.getRoomsManagerData())}}},{key:"openRoomsSlider",value:function e(){this.getRoomsInterface().then(function(e){if(!this.roomsInterface){this.roomsInterface=new e({calendarContext:null,readonly:false,roomsManager:this.roomsManagerFromDB,isConfigureList:true})}this.roomsInterface.show()}.bind(this))}},{key:"getTextValue",value:function e(t){if(!t){t=this.value}var i=t.str||t.text||"";if(t&&t.type==="mr"){i="ECMR_"+t.value+(t.mrevid?"_"+t.mrevid:"")}else if(t&&t.type==="calendar"){i="calendar_"+t.value+(t.room_event_id?"_"+t.room_event_id:"")}return i}},{key:"getValue",value:function e(){return this.value}},{key:"setValue",value:function t(i){if(u.Type.isPlainObject(i)){this.value.text=i.text||"";this.value.type=i.type||"";this.value.value=i.value||""}else{this.value=e.parseStringValue(i)}this.setValues();if(this.inlineEditModeEnabled){var a=this.getTextLocation(this.value);this.DOM.inlineEditLink.innerHTML=u.Text.encode(a||u.Loc.getMessage("EC_REMIND1_ADD"))}}},{key:"getTextLocation",value:function t(i){var a=u.Type.isPlainObject(i)?i:e.parseStringValue(i),s,n=a.str;if(u.Type.isArray(this.meetingRooms)&&a.type==="mr"){n=u.Loc.getMessage("EC_LOCATION_EMPTY");for(s=0;s<this.meetingRooms.length;s++){if(parseInt(a.value)===parseInt(this.meetingRooms[s].ID)){n=this.meetingRooms[s].NAME;break}}}if(u.Type.isArray(e.locationList)&&a.type==="calendar"){n=u.Loc.getMessage("EC_LOCATION_EMPTY");for(s=0;s<e.locationList.length;s++){if(parseInt(a.value)===parseInt(e.locationList[s].ID)){n=e.locationList[s].NAME;break}}}return n}},{key:"displayInlineEditControls",value:function e(){this.DOM.inlineEditLinkWrap.style.display="none";this.DOM.inputWrap.style.display=""}},{key:"setDefaultRoom",value:function i(a){if(this.roomsManager&&!t.RoomsManager.isEmpty(a)){this.activeRooms=this.roomsManager.getRoomsInfo().active;if(!t.RoomsManager.isEmpty(this.activeRooms)){var s=this.activeRooms[0];var n=O(a),l;try{for(n.s();!(l=n.n()).done;){var o=l.value;if(parseInt(o.ID)===s){e.setCurrentCapacity(parseInt(o.CAPACITY));return"calendar_"+s}}}catch(e){n.e(e)}finally{n.f()}}else{e.setCurrentCapacity(parseInt(a[0].CAPACITY));return"calendar_"+a[0].ID}}else{return""}}},{key:"getRoomsInterface",value:function e(){return new Promise((function(e){var t=BX.Calendar.Util.getBX();var i="calendar.rooms";t.Runtime.loadExtension(i).then((function(){if(t.Calendar.Rooms.RoomsInterface){e(t.Calendar.Rooms.RoomsInterface)}else{console.error("Extension "+i+" not found");e(t.Calendar.Rooms.RoomsInterface)}}))}))}},{key:"getRoomsManager",value:function e(){return new Promise((function(e){var t=BX.Calendar.Util.getBX();var i="calendar.roomsmanager";t.Runtime.loadExtension(i).then((function(){if(t.Calendar.RoomsManager){e(t.Calendar.RoomsManager)}else{console.error("Extension "+i+" not found");e(t.Calendar.RoomsManager)}}))}))}},{key:"getRoomsManagerData",value:function e(){var i=this;return new Promise((function(e){BX.ajax.runAction("calendar.api.locationajax.getRoomsManagerData").then((function(a){i.roomsManagerFromDB=new t.RoomsManager({sections:a.data.sections,rooms:a.data.rooms},{locationAccess:a.data.config.locationAccess,hiddenSections:a.data.config.hiddenSections,type:a.data.config.type,ownerId:a.data.config.ownerId,userId:a.data.config.userId,new_section_access:a.data.config.defaultSectionAccess,sectionAccessTasks:a.data.config.sectionAccessTasks,showTasks:a.data.config.showTasks,locationContext:i});e(a.data)}),(function(t){console.error("Extension not found");e(t.data)}))}))}}],[{key:"handlePull",value:function t(i){if(!i.fields.DATE_FROM||!i.fields.DATE_TO){return}var a=r.Util.parseDate(i.fields.DATE_FROM);var s=r.Util.parseDate(i.fields.DATE_TO);var n=e.getDatesRange(a,s);var l=O(n),o;try{for(l.s();!(o=l.n()).done;){var u=o.value;if(e.accessibility[u]){delete e.accessibility[u]}}}catch(e){l.e(e)}finally{l.f()}}},{key:"parseStringValue",value:function e(t){if(!u.Type.isString(t)){t=""}var i={type:false,value:false,str:t};if(t.substr(0,5)==="ECMR_"){i.type="mr";var a=t.split("_");if(a.length>=2){if(!isNaN(parseInt(a[1]))&&parseInt(a[1])>0){i.value=i.mrid=parseInt(a[1])}if(!isNaN(parseInt(a[2]))&&parseInt(a[2])>0){i.mrevid=parseInt(a[2])}}}else if(t.substr(0,9)==="calendar_"){i.type="calendar";var s=t.split("_");if(s.length>=2){if(!isNaN(parseInt(s[1]))&&parseInt(s[1])>0){i.value=i.room_id=parseInt(s[1])}if(!isNaN(parseInt(s[2]))&&parseInt(s[2])>0){i.room_event_id=parseInt(s[2])}}}return i}},{key:"setLocationList",value:function t(i){if(u.Type.isArray(i)){e.locationList=i;this.sortLocationList()}}},{key:"sortLocationList",value:function t(){e.locationList.sort((function(e,t){if(e.NAME.toLowerCase()>t.NAME.toLowerCase()){return 1}if(e.NAME.toLowerCase()<t.NAME.toLowerCase()){return-1}return 0}))}},{key:"getLocationList",value:function t(){return e.locationList}},{key:"setMeetingRoomList",value:function t(i){if(u.Type.isArray(i)){e.meetingRoomList=i}}},{key:"getMeetingRoomList",value:function t(){return e.meetingRoomList}},{key:"setLocationAccessibility",value:function t(i){e.accessibility=i}},{key:"getLocationAccessibility",value:function t(){return e.accessibility}},{key:"setCurrentCapacity",value:function t(i){e.currentRoomCapacity=i}},{key:"getCurrentCapacity",value:function t(){return e.currentRoomCapacity||0}},{key:"getDateInFormat",value:function e(t){return("0"+t.getDate()).slice(-2)+"."+("0"+(t.getMonth()+1)).slice(-2)+"."+t.getFullYear()}},{key:"getDatesRange",value:function t(i,a){var s=new Date(i);var n=new Date(a);var l=s.setHours(0,0,0,0);var o=n.setHours(0,0,0,0);var r=[];while(l<=o){r.push(e.getDateInFormat(new Date(l)));l+=e.DAY_LENGTH}return r}}]);return e}();babelHelpers.defineProperty(w,"locationList",[]);babelHelpers.defineProperty(w,"meetingRoomList",[]);babelHelpers.defineProperty(w,"currentRoomCapacity",0);babelHelpers.defineProperty(w,"accessibility",[]);babelHelpers.defineProperty(w,"DAY_LENGTH",864e5);var _=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,e);this.params=t;this.id=t.id||"user_selector_"+Math.round(Math.random()*1e6);this.zIndex=t.zIndex||3100;this.DOM={wrapNode:t.wrapNode};this.destinationInputName=t.inputName||"EVENT_DESTINATION";if(u.Type.isArray(this.params.itemsSelected)&&this.params.itemsSelected.length){this.params.itemsSelected=this.convertAttendeesCodes(this.params.itemsSelected)}this.create()}babelHelpers.createClass(e,[{key:"create",value:function e(){var t=this.id;this.DOM.socnetDestinationWrap=this.DOM.wrapNode.appendChild(u.Dom.create("DIV",{props:{className:"event-grid-dest-wrap"},events:{click:function e(i){BX.SocNetLogDestination.openDialog(t)}}}));this.socnetDestinationItems=this.DOM.socnetDestinationWrap.appendChild(u.Dom.create("SPAN",{props:{className:""},events:{click:function e(i){var a=i.target||i.srcElement;if(a.className==="feed-event-del-but"){top.BX.SocNetLogDestination.deleteItem(a.getAttribute("data-item-id"),a.getAttribute("data-item-type"),t);i.preventDefault();i.stopPropagation()}},mouseover:function e(t){var i=t.target||t.srcElement;if(i.className==="feed-event-del-but")BX.addClass(i.parentNode,"event-grid-dest-hover")},mouseout:function e(t){var i=t.target||t.srcElement;if(i.className==="feed-event-del-but")BX.removeClass(i.parentNode,"event-grid-dest-hover")}}}));this.socnetDestinationInputWrap=this.DOM.socnetDestinationWrap.appendChild(u.Dom.create("SPAN",{props:{className:"feed-add-destination-input-box"}}));this.socnetDestinationInput=this.socnetDestinationInputWrap.appendChild(u.Dom.create("INPUT",{props:{id:t+"-inp",className:"feed-add-destination-inp"},attrs:{value:"",type:"text"},events:{keydown:function e(i){return top.BX.SocNetLogDestination.searchBeforeHandler(i,{formName:t,inputId:t+"-inp"})},keyup:function e(i){return top.BX.SocNetLogDestination.searchHandler(i,{formName:t,inputId:t+"-inp",linkId:"event-grid-dest-add-link",sendAjax:true})}}}));this.socnetDestinationLink=this.DOM.socnetDestinationWrap.appendChild(u.Dom.create("SPAN",{html:this.params.addLinkMessage||BX.message("EC_DESTINATION_ADD_USERS"),props:{id:t+"-link",className:"feed-add-destination-link"},events:{keydown:function e(i){return top.BX.SocNetLogDestination.searchBeforeHandler(i,{formName:t,inputId:t+"-inp"})},keyup:function e(i){return top.BX.SocNetLogDestination.searchHandler(i,{formName:t,inputId:t+"-inp",linkId:"event-grid-dest-add-link",sendAjax:true})}}}));this.init()}},{key:"init",value:function e(){var t=this;if(!this.socnetDestinationInput||!this.DOM.socnetDestinationWrap||!this.params.items){return}if(this.params.selectGroups===false){this.params.items.groups={};this.params.items.department={};this.params.items.sonetgroups={}}if(this.params.selectUsers===false){this.params.items.users={};this.params.items.groups={};this.params.items.department={}}BX.SocNetLogDestination.init({name:this.id,searchInput:this.socnetDestinationInput,extranetUser:false,userSearchArea:"I",bindMainPopup:{node:this.DOM.socnetDestinationWrap,offsetTop:"5px",offsetLeft:"15px"},bindSearchPopup:{node:this.DOM.socnetDestinationWrap,offsetTop:"5px",offsetLeft:"15px"},callback:{select:this.selectCallback.bind(this),unSelect:this.unSelectCallback.bind(this),openDialog:this.openDialogCallback.bind(this),closeDialog:this.closeDialogCallback.bind(this),openSearch:this.openDialogCallback.bind(this),closeSearch:function e(){t.closeDialogCallback(true)}},items:this.params.items,itemsLast:this.params.itemsLast,itemsSelected:this.params.itemsSelected,departmentSelectDisable:this.params.selectGroups===false})}},{key:"closeAll",value:function e(){if(top.BX.SocNetLogDestination.isOpenDialog()){top.BX.SocNetLogDestination.closeDialog()}top.BX.SocNetLogDestination.closeSearch()}},{key:"selectCallback",value:function e(t,i){var a=i,s="S";if(i==="sonetgroups"){s="SG"}else if(i==="groups"){s="UA";a="all-users"}else if(i==="users"){s="U"}else if(i==="department"){s="DR"}this.socnetDestinationItems.appendChild(u.Dom.create("span",{attrs:{"data-id":t.id},props:{className:"event-grid-dest event-grid-dest-"+a},children:[u.Dom.create("input",{attrs:{type:"hidden",name:this.destinationInputName+"["+s+"][]",value:t.id}}),u.Dom.create("span",{props:{className:"event-grid-dest-text"},html:t.name}),u.Dom.create("span",{props:{className:"feed-event-del-but"},attrs:{"data-item-id":t.id,"data-item-type":i}})]}));BX.onCustomEvent("OnDestinationAddNewItem",[t]);this.socnetDestinationInput.value="";this.socnetDestinationLink.innerHTML=this.params.addLinkMessage||(top.BX.SocNetLogDestination.getSelectedCount(this.id)>0?BX.message("EC_DESTINATION_ADD_MORE"):BX.message("EC_DESTINATION_ADD_USERS"))}},{key:"unSelectCallback",value:function e(t,i,a){var s=BX.findChildren(this.socnetDestinationItems,{attribute:{"data-id":t.id}},true);if(s!=null){for(var n=0;n<s.length;n++){BX.remove(s[n])}}BX.onCustomEvent("OnDestinationUnselect");this.socnetDestinationInput.value="";this.socnetDestinationLink.innerHTML=this.params.addLinkMessage||(top.BX.SocNetLogDestination.getSelectedCount(this.id)>0?BX.message("EC_DESTINATION_ADD_MORE"):BX.message("EC_DESTINATION_ADD_USERS"))}},{key:"openDialogCallback",value:function e(){BX.style(this.socnetDestinationInputWrap,"display","inline-block");BX.style(this.socnetDestinationLink,"display","none");BX.focus(this.socnetDestinationInput)}},{key:"closeDialogCallback",value:function e(t){if(!top.BX.SocNetLogDestination.isOpenSearch()&&this.socnetDestinationInput.value.length<=0){BX.style(this.socnetDestinationInputWrap,"display","none");BX.style(this.socnetDestinationLink,"display","inline-block");if(t===true)this.socnetDestinationInput.value="";if(top.BX.SocNetLogDestination.backspaceDisable||top.BX.SocNetLogDestination.backspaceDisable!=null)BX.unbind(window,"keydown",top.BX.SocNetLogDestination.backspaceDisable);BX.bind(window,"keydown",top.BX.SocNetLogDestination.backspaceDisable=function(e){if(e.keyCode===8){e.preventDefault();return false}});setTimeout((function(){BX.unbind(window,"keydown",top.BX.SocNetLogDestination.backspaceDisable);top.BX.SocNetLogDestination.backspaceDisable=null}),5e3)}}},{key:"getCodes",value:function e(){var t=this.socnetDestinationItems.getElementsByTagName("INPUT"),i=[],a;for(a=0;a<t.length;a++){i.push(t[a].value)}return i}},{key:"getAttendeesCodes",value:function e(){var t=this.socnetDestinationItems.getElementsByTagName("INPUT"),i=[],a;for(a=0;a<t.length;a++){i.push(t[a].value)}return this.convertAttendeesCodes(i)}},{key:"convertAttendeesCodes",value:function e(t){var i={};if(u.Type.isArray(t)){t.forEach((function(e){if(e.substr(0,2)==="DR"){i[e]="department"}else if(e.substr(0,2)==="UA"){i[e]="groups"}else if(e.substr(0,2)==="SG"){i[e]="sonetgroups"}else if(e.substr(0,1)==="U"){i[e]="users"}}))}return i}},{key:"getAttendeesCodesList",value:function e(t){var i=[];if(!t)t=this.getAttendeesCodes();for(var a in t){if(t.hasOwnProperty(a)){i.push(a)}}return i}},{key:"setValue",value:function e(t){if(this.socnetDestinationItems){u.Dom.clean(this.socnetDestinationItems)}if(u.Type.isArray(t)){this.params.itemsSelected=this.convertAttendeesCodes(t)}this.init()}}]);return e}();var N,H;var B=function(e){babelHelpers.inherits(t,e);function t(e){var i;babelHelpers.classCallCheck(this,t);i=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"LINE_MODE","line");babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"SELECTOR_MODE","selector");babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"VIEW_MODE","view");i.setEventNamespace("BX.Calendar.Controls.ColorSelector");i.id=e.id||"color-select-"+Math.round(Math.random()*1e6);i.defaultColors=r.Util.getDefaultColorList();i.colors=[];i.zIndex=3100;i.mode=e.mode||i.LINE_MODE;i.DOM={wrap:e.wrap};i.create();i.setViewMode(e.viewMode||false);return i}babelHelpers.createClass(t,[{key:"create",value:function e(){var t=this;if(this.mode===this.LINE_MODE){for(var i=0;i<this.defaultColors.length;i++){this.colors.push({color:this.defaultColors[i],node:this.DOM.wrap.appendChild(u.Dom.create("LI",{props:{className:"calendar-field-colorpicker-color-item"},attrs:{"data-bx-calendar-color":this.defaultColors[i]},style:{backgroundColor:this.defaultColors[i]},html:'<span class="calendar-field-colorpicker-color"></span>'}))})}this.DOM.customColorNode=this.DOM.wrap.appendChild(u.Dom.create("LI",{props:{className:"calendar-field-colorpicker-color-item"},style:{backgroundColor:"transparent",width:0},html:'<span class="calendar-field-colorpicker-color"></span>'}));this.DOM.customColorLink=this.DOM.wrap.appendChild(u.Dom.create("LI",{props:{className:"calendar-field-colorpicker-color-item-more"},html:'<span class="calendar-field-colorpicker-color-item-more-link">'+u.Loc.getMessage("EC_COLOR")+"</span>",events:{click:function e(){if(!t.colorPickerPopup){t.colorPickerPopup=new BX.ColorPicker({bindElement:t.DOM.customColorLink,onColorSelected:t.setValue.bind(t),popupOptions:{zIndex:t.zIndex}})}t.colorPickerPopup.open()}}}));u.Event.bind(this.DOM.wrap,"click",this.handleColorClick.bind(this))}else if(this.mode===this.SELECTOR_MODE){this.DOM.colorIcon=this.DOM.wrap.appendChild(u.Tag.render(N||(N=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div style="background-color: #000;" class="calendar-field-select-icon"></div>\n\t\t\t']))));u.Event.bind(this.DOM.wrap,"click",this.openPopup.bind(this))}else if(this.mode===this.VIEW_MODE){this.DOM.colorIcon=this.DOM.wrap.appendChild(u.Tag.render(H||(H=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div style="background-color: #000;" class="calendar-field-select-icon"></div>\n\t\t\t']))))}}},{key:"handleColorClick",value:function e(t){if(this.viewMode){return}var i=r.Util.findTargetNode(t.target||t.srcElement,this.DOM.wrap);if(i&&i.getAttribute){var a=i.getAttribute("data-bx-calendar-color");if(a!==null){this.setValue(a)}}}},{key:"setValue",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(this.viewMode){return}this.activeColor=t;if(this.mode===this.LINE_MODE){if(this.DOM.activeColorNode){BX.removeClass(this.DOM.activeColorNode,"active")}if(!BX.util.in_array(this.activeColor,this.defaultColors)&&this.activeColor){this.DOM.customColorNode.style.backgroundColor=this.activeColor;this.DOM.customColorNode.style.width="";this.DOM.activeColorNode=this.DOM.customColorNode;BX.addClass(this.DOM.activeColorNode,"active")}var a;for(a=0;a<this.colors.length;a++){if(this.colors[a].color===this.activeColor){this.DOM.activeColorNode=this.colors[a].node;BX.addClass(this.DOM.activeColorNode,"active");break}}}else if(this.mode===this.SELECTOR_MODE||this.mode===this.VIEW_MODE){if(this.DOM.colorIcon){this.DOM.colorIcon.style.backgroundColor=this.activeColor}if(this.viewMode){this.DOM.wrap.style.backgroundColor=this.activeColor}}if(i){this.emit("onChange",new o.BaseEvent({data:{value:this.activeColor}}))}}},{key:"getValue",value:function e(){return this.activeColor}},{key:"openPopup",value:function e(){var t=this;if(this.viewMode){return}if(this.popup&&this.popup.popupWindow&&this.popup.popupWindow.isShown()){return this.popup.close()}var i,a=[],s;this.defaultColors.forEach((function(e){a.push({text:e,color:e,className:"calendar-add-popup-color-menu-item",onclick:function(e){return function(){t.setValue(e);t.popup.close()}}(e)})}));this.popup=c.MenuManager.create(this.id,this.DOM.colorIcon,a,{className:"calendar-color-popup-wrap",width:162,closeByEsc:true,autoHide:true,zIndex:this.zIndex,offsetTop:0,offsetLeft:52,angle:true,cacheable:false});this.popup.show();for(i=0;i<this.popup.menuItems.length;i++){if(this.popup.menuItems[i].layout.item){s=this.popup.menuItems[i].layout.item.querySelector(".menu-popup-item-icon");if(u.Type.isDomNode(s)){s.style.backgroundColor=this.popup.menuItems[i].color}}}this.popup.popupWindow.angle.element.style.left="6px"}},{key:"setViewMode",value:function e(t){this.viewMode=t;if(this.viewMode){u.Dom.clean(this.DOM.wrap);this.DOM.wrap.className="calendar-field-select-icon";this.DOM.wrap.style.backgroundColor=this.activeColor}}}]);return t}(o.EventEmitter);var S,P,x,A,R,V,U,X;var W=function(){function e(t){babelHelpers.classCallCheck(this,e);this.id=t.id||"section-select-"+Math.round(Math.random()*1e6);this.sectionList=t.sectionList;this.sectionGroupList=t.sectionGroupList;this.selectCallback=t.selectCallback;this.openPopupCallback=t.openPopupCallback;this.closePopupCallback=t.closePopupCallback;this.getCurrentSection=t.getCurrentSection;this.defaultCalendarType=t.defaultCalendarType;this.defaultOwnerId=parseInt(t.defaultOwnerId)||0;this.zIndex=t.zIndex||3200;this.mode=t.mode;this.DOM={outerWrap:t.outerWrap};this.create();this.initEventHandlers()}babelHelpers.createClass(e,[{key:"create",value:function e(){if(this.mode==="textselect"){this.DOM.select=this.DOM.outerWrap;this.DOM.selectImageWrap=this.DOM.select.appendChild(u.Tag.render(S||(S=babelHelpers.taggedTemplateLiteral(['<span class="calendar-field-choice-calendar-img"></span>']))));this.DOM.selectInnerText=this.DOM.select.appendChild(u.Tag.render(P||(P=babelHelpers.taggedTemplateLiteral(['<span class="calendar-field-choice-calendar-name">',"</span>"])),u.Text.encode(u.Loc.getMessage("EC_CALENDAR_SECTION_TITLE")+" "+this.getCurrentTitle())))}else if(this.mode==="location"){this.DOM.select=this.DOM.outerWrap;this.DOM.selectImageWrap=this.DOM.select.appendChild(u.Tag.render(x||(x=babelHelpers.taggedTemplateLiteral(['<span class="calendar-field-choice-calendar-img"></span>']))));this.DOM.selectInnerText=this.DOM.select.appendChild(u.Tag.render(A||(A=babelHelpers.taggedTemplateLiteral(['<span class="calendar-field-choice-calendar-name calendar-field-choice-calendar-name-location">',"</span>"])),u.Text.encode(u.Loc.getMessage("EC_CALENDAR_LOCATION_TITLE")+" "+this.getCurrentTitle())))}else{this.DOM.select=this.DOM.outerWrap.appendChild(u.Dom.create("DIV",{props:{className:"calendar-field calendar-field-select"+(this.mode==="compact"?" calendar-field-tiny":"")}}));this.DOM.innerValue=this.DOM.select.appendChild(u.Dom.create("DIV",{props:{className:"calendar-field-select-icon"},style:{backgroundColor:this.getCurrentColor()}}));if(this.mode==="full"){this.DOM.selectInnerText=this.DOM.select.appendChild(u.Dom.create("SPAN",{text:this.getCurrentTitle()}))}}}},{key:"initEventHandlers",value:function e(){u.Event.bind(this.DOM.select,"click",BX.delegate(this.openPopup,this))}},{key:"openPopup",value:function t(){var i=this;if(this.viewMode){return false}if(this.sectionMenu&&this.sectionMenu.popupWindow&&this.sectionMenu.popupWindow.isShown()){return this.sectionMenu.close()}var a=[];var s=[];var n=this.getSectionList();var l;if(u.Type.isArray(this.sectionGroupList)){this.sectionGroupList.forEach((function(t){var l;if(t.belongsToView){l=n.filter((function(t){return e.getSectionType(t)===i.defaultCalendarType&&e.getSectionOwner(t)===i.defaultOwnerId}),i)}else if(t.type==="user"||t.type==="location"){l=n.filter((function(i){return e.getSectionType(i)==="user"&&e.getSectionOwner(i)===t.ownerId}))}else if(t.type==="company"){l=n.filter((function(i){return e.getSectionType(i)==="company_calendar"||e.getSectionType(i)==="calendar_company"||e.getSectionType(i)===t.type}))}else{l=n.filter((function(i){return e.getSectionType(i)===t.type}))}l=l.filter((function(e){var t=parseInt(e.id||e.ID);if(s.includes(t))return false;s.push(t);return true}));if(l.length>0){a.push(new c.MenuItem({text:t.title,delimiter:true}));for(var o=0;o<l.length;o++){a.push(i.getMenuItem(l[o]))}}}))}else{for(l=0;l<n.length;l++){a.push(this.getMenuItem(n[l]))}}var o=0;if(this.mode==="compact"){o=40}else if(this.mode==="textselect"||this.mode==="location"){o=0}this.sectionMenu=c.MenuManager.create(this.id,this.DOM.select,a,{closeByEsc:true,autoHide:true,zIndex:this.zIndex,offsetTop:0,offsetLeft:o,angle:this.mode==="compact"});this.sectionMenu.popupWindow.contentContainer.style.overflow="auto";this.sectionMenu.popupWindow.contentContainer.style.maxHeight="400px";if(this.mode==="full"){this.sectionMenu.popupWindow.setWidth(this.DOM.select.offsetWidth-2);this.sectionMenu.popupWindow.contentContainer.style.overflowX="hidden"}this.sectionMenu.show();for(l=0;l<this.sectionMenu.menuItems.length;l++){if(this.sectionMenu.menuItems[l].layout.item){var r=this.sectionMenu.menuItems[l].layout.item.querySelector(".menu-popup-item-icon");if(r){r.style.backgroundColor=this.sectionMenu.menuItems[l].color}}}BX.addClass(this.DOM.select,"active");if(u.Type.isFunction(this.openPopupCallback)){this.openPopupCallback(this)}BX.addCustomEvent(this.sectionMenu.popupWindow,"onPopupClose",BX.delegate((function(){if(u.Type.isFunction(this.openPopupCallback)){this.closePopupCallback()}BX.removeClass(this.DOM.select,"active");BX.PopupMenu.destroy(this.id);this.sectionMenu=null}),this))}},{key:"getCurrentColor",value:function e(){return(this.getCurrentSection()||{}).color||false}},{key:"getCurrentTitle",value:function e(){return(this.getCurrentSection()||{}).name||""}},{key:"getSectionList",value:function e(){return this.sectionList.filter((function(e){return e.PERM&&e.PERM.edit||u.Type.isFunction(e.canDo)&&e.canDo("edit")}))}},{key:"updateSectionImageNode",value:function t(i){var a=this;if(!u.Type.isElementNode(this.DOM.selectImageWrap)){return}if(i===undefined){i=this.sectionList.find((function(e){return parseInt(e.id)===parseInt(a.getCurrentSection().id)}))}if(i&&i.type){var s=e.getSectionImage(i);var n;if(s){n=u.Tag.render(R||(R=babelHelpers.taggedTemplateLiteral(['<img class="calendar-field-choice-calendar-img-value" src="','">'])),s)}else if(i.type==="group"){n=u.Tag.render(V||(V=babelHelpers.taggedTemplateLiteral(['<div class="ui-icon ui-icon-common-user-group"><i></i></div>'])))}else if(i.type==="user"){n=u.Tag.render(U||(U=babelHelpers.taggedTemplateLiteral(['<div class="ui-icon ui-icon-common-user"><i></i></div>'])))}else{n=u.Tag.render(X||(X=babelHelpers.taggedTemplateLiteral(['<div class="ui-icon ui-icon-common-bitrix24"><i></i></div>'])))}u.Dom.clean(this.DOM.selectImageWrap);this.DOM.selectImageWrap.appendChild(n)}}},{key:"getPopup",value:function e(){return this.sectionMenu}},{key:"getMenuItem",value:function e(t){var i=this;return{html:BX.util.htmlspecialchars(t.name||t.NAME),color:t.color||t.COLOR,className:"calendar-add-popup-section-menu-item"+(this.mode==="full"?" section-menu-item-full":""),onclick:function(e){return function(){if(u.Type.isDomNode(i.DOM.innerValue)){i.DOM.innerValue.style.backgroundColor=e.color||t.COLOR}i.updateSectionImageNode(e);if(u.Type.isFunction(i.selectCallback)){if(!e.color&&t.COLOR){e.color=t.COLOR}if(!e.id&&t.ID){e.id=t.ID}i.selectCallback(e)}i.sectionMenu.close();i.updateValue()}}(t)}}},{key:"updateValue",value:function e(){if(u.Type.isDomNode(this.DOM.innerValue)){this.DOM.innerValue.style.backgroundColor=this.getCurrentColor()}if(this.mode==="full"){this.DOM.select.appendChild(u.Dom.adjust(this.DOM.selectInnerText,{text:this.getCurrentTitle(),props:{title:this.getCurrentTitle()}}))}else if(this.mode==="textselect"){this.updateSectionImageNode();this.DOM.select.appendChild(u.Dom.adjust(this.DOM.selectInnerText,{props:{title:u.Loc.getMessage("EC_CALENDAR_SECTION_TITLE")+" "+this.getCurrentTitle()},text:u.Loc.getMessage("EC_CALENDAR_SECTION_TITLE")+" "+this.getCurrentTitle()}))}else if(this.mode==="location"){this.updateSectionImageNode();this.DOM.select.appendChild(u.Dom.adjust(this.DOM.selectInnerText,{props:{title:u.Loc.getMessage("EC_CALENDAR_LOCATION_TITLE")+" "+this.getCurrentTitle()},text:u.Loc.getMessage("EC_CALENDAR_LOCATION_TITLE")+" "+this.getCurrentTitle()}))}}},{key:"setViewMode",value:function e(t){this.viewMode=t;if(this.viewMode){u.Dom.addClass(this.DOM.outerWrap,"calendar-section-selector-readonly")}else{u.Dom.removeClass(this.DOM.outerWrap,"calendar-section-selector-readonly")}}}],[{key:"getSectionType",value:function e(t){return t.type||t.CAL_TYPE}},{key:"getSectionImage",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return t.data?t.data.IMAGE:t.IMAGE||""}},{key:"getSectionOwner",value:function e(t){return parseInt(t.OWNER_ID||t.data.OWNER_ID)}}]);return e}();var z=function(){function e(t){babelHelpers.classCallCheck(this,e);var i=t.rruleType.form.elements;this.getDate=t.getDate;this.DOM={formElements:i,wrap:t.wrap,rruleType:t.rruleType,interval:i["EVENT_RRULE[INTERVAL]"],rruleEndsOn:{never:i["rrule_endson"][0],count:i["rrule_endson"][1],until:i["rrule_endson"][2]},count:i["EVENT_RRULE[COUNT]"],until:i["EVENT_RRULE[UNTIL]"]};this.create()}babelHelpers.createClass(e,[{key:"create",value:function e(){var t=this;BX.bind(this.DOM.rruleType,"change",(function(){t.changeType(t.DOM.rruleType.value)}));BX.bind(this.DOM.until,"click",(function(e){d.DateTimeControl.showInputCalendar(e);t.DOM.rruleEndsOn.until.checked=true}));BX.bind(this.DOM.count,"click",(function(){t.DOM.rruleEndsOn.count.checked=true}))}},{key:"changeType",value:function e(t){this.DOM.rruleType.value=t?t.toUpperCase():"NONE";var i=this.DOM.rruleType.value.toLowerCase();this.DOM.wrap.className="calendar-rrule-type-"+i;if(i==="weekly"&&BX.type.isFunction(this.getDate)){var a=this.getDate();if(BX.type.isDate(a)){var s=r.Util.getWeekDayByInd(a.getDay());this.DOM.formElements["EVENT_RRULE[BYDAY][]"].forEach((function(e){e.checked=e.checked||e.value===s}),this)}}}},{key:"setValue",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.changeType(t.FREQ);this.DOM.interval.value=t.INTERVAL||1;if(t.COUNT){this.DOM.rruleEndsOn.count.checked="checked";this.DOM.count.value=t.COUNT}else if(t["~UNTIL"]){this.DOM.rruleEndsOn.until.checked="checked";this.DOM.until.value=t["~UNTIL"]}else{this.DOM.rruleEndsOn.never.checked="checked"}if(BX.type.isPlainObject(t.BYDAY)){this.DOM.formElements["EVENT_RRULE[BYDAY][]"].forEach((function(e){e.checked=t.BYDAY.hasOwnProperty(e.value)}),this)}}},{key:"getType",value:function e(){return this.DOM.rruleType.value.toLowerCase()}}]);return e}();var F=function(){function e(t){babelHelpers.classCallCheck(this,e);this.id=t.id||"bx-select-input-"+Math.round(Math.random()*1e6);this.values=t.values||false;this.input=t.input;this.defaultValue=t.defaultValue||"";this.openTitle=t.openTitle||"";this.className=t.className||"";this.onChangeCallback=t.onChangeCallback||null;this.zIndex=t.zIndex||1200;this.disabled=t.disabled;this.minWidth=t.minWidth||0;this.setValue({value:t.value,valueIndex:t.valueIndex});this.curInd=false;this.bindEventHandlers()}babelHelpers.createClass(e,[{key:"bindEventHandlers",value:function e(){if(this.onChangeCallback){BX.bind(this.input,"change",this.onChangeCallback);BX.bind(this.input,"keyup",this.onChangeCallback)}if(this.values){BX.bind(this.input,"click",BX.proxy(this.onClick,this));BX.bind(this.input,"focus",BX.proxy(this.onFocus,this));BX.bind(this.input,"blur",BX.proxy(this.onBlur,this));BX.bind(this.input,"keyup",BX.proxy(this.onKeyup,this))}}},{key:"setValue",value:function e(t){this.currentValue={value:t.value};this.currentValueIndex=t.valueIndex;if(this.currentValueIndex!==undefined&&this.values[this.currentValueIndex]){this.input.value=this.values[this.currentValueIndex].label}}},{key:"getInputValue",value:function e(){return this.input.value}},{key:"showPopup",value:function e(){if(this.shown||this.disabled)return;var t=0,i=0,a=[],s,n=this;for(s=0;s<this.values.length;s++){if(this.values[s].delimiter){a.push(this.values[s])}else{if(this.currentValue&&this.values[s]&&this.values[s].value===this.currentValue.value){t=i}var l=void 0;if(this.values[s].reserved){l='\n\t\t\t\t\t\t<span class="calendar-menu-item-title-with-status">\n\t\t\t\t\t\t\t'.concat(BX.util.htmlspecialchars(this.values[s].label),'\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class="calendar-menu-item-status --red">\n\t\t\t\t\t\t\t').concat(u.Loc.getMessage("EC_LOCATION_RESERVED"),"\n\t\t\t\t\t\t</span>")}else if(this.values[s].capacity){l='\n\t\t\t\t\t\t<span class="calendar-menu-item-title-with-status">\n\t\t\t\t\t \t'.concat(BX.util.htmlspecialchars(this.values[s].label),'\n\t\t\t\t \t</span>\n\t\t\t\t \t<span class="calendar-menu-item-capacity">\n\t\t\t\t\t \t').concat(BX.util.htmlspecialchars(this.values[s].labelCapacity),"\n\t\t\t\t \t</span>")}else{l='\n\t\t\t\t\t\t<span class="calendar-menu-item-title">\n\t\t\t\t\t\t\t'.concat(BX.util.htmlspecialchars(this.values[s].label),"\n\t\t\t\t\t\t</span>")}if(this.values[s].color){a.push({id:this.values[s].value,title:this.values[s].label,className:"menu-popup-display-flex calendar-location-popup-menu-item",html:l,color:this.values[s].color,onclick:this.values[s].callback||function(e,t){return function(){n.input.value=t;n.popupMenu.close();n.onChange()}}(this.values[s].value,this.values[s].labelRaw||this.values[s].label)})}else{a.push({id:this.values[s].value,text:this.values[s].label,title:this.values[s].label,onclick:this.values[s].callback||function(e,t){return function(){n.input.value=t;n.popupMenu.close();n.onChange()}}(this.values[s].value,this.values[s].labelRaw||this.values[s].label)})}i++}}this.popupMenu=BX.PopupMenu.create(this.id,this.input,a,{closeByEsc:true,autoHide:true,zIndex:this.zIndex,offsetTop:0,offsetLeft:-1});this.popupMenu.popupWindow.setWidth(Math.max(this.input.offsetWidth+2,this.minWidth));var o=this.popupMenu.layout.menuContainer;BX.addClass(this.popupMenu.layout.menuContainer,"calendar-select-popup");this.popupMenu.show();var r=this.popupMenu.menuItems[t];if(r&&r.layout){o.scrollTop=r.layout.item.offsetTop-r.layout.item.offsetHeight}var c=this.popupMenu.menuItems;for(s=0;s<c.length;s++){if(c[s].layout.item){var d=c[s].layout.item.querySelector(".menu-popup-item-icon");if(d){d.style.backgroundColor=c[s].color}}}BX.addCustomEvent(this.popupMenu.popupWindow,"onPopupClose",function(){BX.PopupMenu.destroy(this.id);this.shown=false;this.popupMenu=null}.bind(this));this.input.select();this.shown=true}},{key:"closePopup",value:function e(){BX.PopupMenu.destroy(this.id);this.popupMenu=null;this.shown=false}},{key:"onFocus",value:function e(){setTimeout(function(){if(!this.shown){this.showPopup()}}.bind(this),200)}},{key:"onClick",value:function e(){if(this.shown){this.closePopup()}else{this.showPopup()}}},{key:"onBlur",value:function e(){setTimeout(BX.delegate(this.closePopup,this),200)}},{key:"onKeyup",value:function e(){setTimeout(BX.delegate(this.closePopup,this),50)}},{key:"onChange",value:function e(){var t=this.input.value;BX.onCustomEvent(this,"onSelectInputChanged",[this,t]);if(BX.type.isFunction(this.onChangeCallback)){this.onChangeCallback({value:t})}}},{key:"destroy",value:function e(){if(this.onChangeCallback){BX.unbind(this.input,"change",this.onChangeCallback);BX.unbind(this.input,"keyup",this.onChangeCallback)}BX.unbind(this.input,"click",BX.proxy(this.onClick,this));BX.unbind(this.input,"focus",BX.proxy(this.onFocus,this));BX.unbind(this.input,"blur",BX.proxy(this.onBlur,this));BX.unbind(this.input,"keyup",BX.proxy(this.onKeyup,this));if(this.popupMenu){this.popupMenu.close()}BX.PopupMenu.destroy(this.id);this.popupMenu=null;this.shown=false}}]);return e}();var Y=function(){function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,e);this.id=t.id||"popup-dialog-"+Math.random();this.zIndex=t.zIndex||3200;this.DOM={};this.title=""}babelHelpers.createClass(e,[{key:"create",value:function e(){this.dialog=new BX.PopupWindow(this.id,null,{overlay:{opacity:10},autoHide:true,closeByEsc:true,zIndex:this.zIndex,offsetLeft:0,offsetTop:0,draggable:true,bindOnResize:false,titleBar:this.getTitle(),closeIcon:{right:"12px",top:"10px"},className:"bxc-popup-window",buttons:this.getButtons(),content:this.getContent(),events:{}})}},{key:"getTitle",value:function e(){return this.title}},{key:"getContent",value:function e(){this.DOM.content=BX.create("DIV");return this.DOM.content}},{key:"getButtons",value:function e(){this.buttons=[];return this.buttons}},{key:"show",value:function e(t){if(!this.dialog){this.create()}this.dialog.show()}},{key:"close",value:function e(){if(this.dialog){this.dialog.close()}}}]);return e}();var G,j,q,K,Z;var $=function(e){babelHelpers.inherits(t,e);function t(){var e;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"views",[]);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"created",false);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"currentValue",null);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"currentViewMode",null);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.ViewSelector");if(u.Type.isArray(i.views)){e.views=i.views}e.zIndex=i.zIndex||3200;e.popupId=i.id||"view-selector-"+Math.round(Math.random()*1e4);e.create();if(i.currentView){e.setValue(i.currentView)}if(i.currentViewMode){e.setViewMode(i.currentViewMode)}return e}babelHelpers.createClass(t,[{key:"create",value:function e(){this.DOM.wrap=u.Tag.render(G||(G=babelHelpers.taggedTemplateLiteral(['<div class="calendar-view-switcher-selector"></div>'])));this.DOM.selectorText=u.Tag.render(j||(j=babelHelpers.taggedTemplateLiteral(['<div class="calendar-view-switcher-text"></div>'])));this.DOM.selectorTextInner=this.DOM.selectorText.appendChild(u.Tag.render(q||(q=babelHelpers.taggedTemplateLiteral(['<div class="calendar-view-switcher-text-inner"></div>']))));this.DOM.wrap.appendChild(this.DOM.selectorText);this.DOM.wrap.appendChild(u.Tag.render(K||(K=babelHelpers.taggedTemplateLiteral(['<div class="calendar-view-switcher-dropdown"></div>']))));u.Event.bind(this.DOM.wrap,"click",this.showPopup.bind(this));this.DOM.viewModeTextInner=this.DOM.selectorText.appendChild(u.Tag.render(Z||(Z=babelHelpers.taggedTemplateLiteral(['<div class="calendar-view-switcher-text-mode-inner" style="display: none;"></div>']))));this.created=true}},{key:"getOuterWrap",value:function e(){if(!this.created){this.create()}return this.DOM.wrap}},{key:"setValue",value:function e(t){this.currentValue=this.views.find((function(e){return t.name===e.name}),this);if(this.currentValue){u.Dom.adjust(this.DOM.selectorTextInner,{text:this.currentValue.text})}}},{key:"setViewMode",value:function e(t){if(t){this.currentViewMode=this.views.find((function(e){return t===e.name&&e.type==="additional"}),this);if(this.currentViewMode){u.Dom.adjust(this.DOM.viewModeTextInner,{text:"("+this.currentViewMode.text+")"})}this.DOM.viewModeTextInner.style.display=this.currentViewMode?"":"block"}}},{key:"getMenuItems",value:function e(){var t=[];this.views.forEach((function(e){if(e.type==="base"){t.push({html:"<span>"+e.text+"</span>"+(e.hotkey?'<span class="calendar-item-hotkey">'+e.hotkey+"</span>":""),className:this.currentValue.name===e.name?"menu-popup-item-accept":" ",onclick:function(){this.emit("onChange",{name:e.name,type:e.type,dataset:e.dataset});this.menuPopup.close()}.bind(this)})}}),this);if(t.length<this.views.length){t.push({html:"<span>"+u.Loc.getMessage("EC_VIEW_MODE_SHOW_BY")+"</span>",className:"main-buttons-submenu-separator main-buttons-submenu-item main-buttons-hidden-label"});this.views.forEach((function(e){if(e.type==="additional"){t.push({text:e.text,className:this.currentViewMode.name===e.name?"menu-popup-item-accept":" ",onclick:function(){this.emit("onChange",{name:e.name,type:e.type,dataset:e.dataset});this.menuPopup.close()}.bind(this)})}}),this)}return t}},{key:"showPopup",value:function e(){if(this.menuPopup&&this.menuPopup.popupWindow&&this.menuPopup.popupWindow.isShown()){return this.menuPopup.close()}this.menuPopup=c.MenuManager.create(this.popupId,this.DOM.selectorText,this.getMenuItems(),{className:"calendar-view-switcher-popup",closeByEsc:true,autoHide:true,zIndex:this.zIndex,offsetTop:-3,offsetLeft:this.DOM.selectorText.offsetWidth-6,angle:true,cacheable:false});this.menuPopup.show()}},{key:"closePopup",value:function e(){if(this.menuPopup&&this.menuPopup.popupWindow&&this.menuPopup.popupWindow.isShown()){this.menuPopup.close()}}}]);return t}(o.EventEmitter);var Q,J;var ee=function(e){babelHelpers.inherits(t,e);function t(){var e;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"views",[]);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"created",false);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"currentValue",null);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"currentViewMode",null);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.LineViewSelector");if(u.Type.isArray(i.views)){e.views=i.views}e.viewsMap=new WeakMap;e.zIndex=i.zIndex||3200;e.popupId=i.id||"view-selector-"+Math.round(Math.random()*1e4);e.create();if(i.currentView){e.setValue(i.currentView)}return e}babelHelpers.createClass(t,[{key:"create",value:function e(){var t=this;this.DOM.wrap=u.Tag.render(Q||(Q=babelHelpers.taggedTemplateLiteral(['<div class="calendar-view-switcher-list"></div>'])));this.views.forEach((function(e){if(e.type==="base"){t.viewsMap.set(e,{wrap:t.DOM.wrap.appendChild(u.Tag.render(J||(J=babelHelpers.taggedTemplateLiteral(['<span \n\t\t\t\t\t\tclass="calendar-view-switcher-list-item"\n\t\t\t\t\t\tonclick="','"\n\t\t\t\t\t>',"</span>"])),(function(){t.emit("onChange",{name:e.name,type:e.type,dataset:e.dataset})}),e.text))})}}));this.created=true}},{key:"getOuterWrap",value:function e(){if(!this.created){this.create()}return this.DOM.wrap}},{key:"setValue",value:function e(t){this.currentValue=this.views.find((function(e){return t.name===e.name}),this);if(this.currentValue){var i=this.viewsMap.get(this.currentValue);var a=this.DOM.wrap.querySelector(".calendar-view-switcher-list-item-active");if(u.Type.isDomNode(a)){u.Dom.removeClass(a,"calendar-view-switcher-list-item-active")}if(u.Type.isDomNode(i.wrap)){u.Dom.addClass(i.wrap,"calendar-view-switcher-list-item-active")}}}},{key:"setViewMode",value:function e(t){if(t){this.currentViewMode=this.views.find((function(e){return t===e.name&&e.type==="additional"}),this)}}},{key:"getMenuItems",value:function e(){var t=this;var i=[];this.views.forEach((function(e){if(e.type==="base"){i.push({html:"<span>"+e.text+"</span>"+(e.hotkey?'<span class="calendar-item-hotkey">'+e.hotkey+"</span>":""),className:t.currentValue.name===e.name?"menu-popup-item-accept":" ",onclick:function i(){t.emit("onChange",{name:e.name,type:e.type,dataset:e.dataset});t.menuPopup.close()}})}}));if(i.length<this.views.length){i.push({html:"<span>"+u.Loc.getMessage("EC_VIEW_MODE_SHOW_BY")+"</span>",className:"main-buttons-submenu-separator main-buttons-submenu-item main-buttons-hidden-label"});this.views.forEach((function(e){if(e.type==="additional"){i.push({text:e.text,className:this.currentViewMode.name===e.name?"menu-popup-item-accept":" ",onclick:function(){this.emit("onChange",{name:e.name,type:e.type,dataset:e.dataset});this.menuPopup.close()}.bind(this)})}}),this)}return i}}]);return t}(o.EventEmitter);var te=function(e){babelHelpers.inherits(t,e);function t(){var e;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"showTasks",false);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.AddButton");e.zIndex=i.zIndex||3200;e.popupId=i.id||"add-button-"+Math.round(Math.random()*1e4);e.showTasks=i.showTasks;e.addEntryHandler=u.Type.isFunction(i.addEntry)?i.addEntry:null;e.addTaskHandler=u.Type.isFunction(i.addTask)?i.addTask:null;e.create();return e}babelHelpers.createClass(t,[{key:"create",value:function e(){this.menuItems=[{text:u.Loc.getMessage("EC_ADD_EVENT"),onclick:this.addEntry.bind(this)}];if(this.addTaskHandler){this.menuItems.push({text:u.Loc.getMessage("EC_ADD_TASK"),onclick:this.addTask.bind(this)})}if(this.menuItems.length>1){this.DOM.wrap=u.Dom.create("span",{props:{className:"ui-btn-split ui-btn-success"},children:[u.Dom.create("button",{props:{className:"ui-btn-main",type:"button"},html:u.Loc.getMessage("EC_ADD"),events:{click:this.addEntry.bind(this)}})]});this.DOM.addButtonExtra=u.Dom.create("span",{props:{className:"ui-btn-extra"},events:{click:this.showPopup.bind(this)}});this.DOM.wrap.appendChild(this.DOM.addButtonExtra)}else{this.DOM.wrap=u.Dom.create("button",{props:{className:"ui-btn ui-btn-success",type:"button"},html:u.Loc.getMessage("EC_ADD"),events:{click:this.addEntry.bind(this)}})}this.DOM.wrap.setAttribute("data-role","addButton")}},{key:"getWrap",value:function e(){return this.DOM.wrap}},{key:"showPopup",value:function e(){if(this.menuPopup&&this.menuPopup.popupWindow&&this.menuPopup.popupWindow.isShown()){return this.menuPopup.close()}this.menuPopup=BX.PopupMenu.create(this.popupId,this.DOM.addButtonExtra,this.menuItems,{closeByEsc:true,autoHide:true,zIndex:this.zIndex,offsetTop:0,offsetLeft:15,angle:true});this.menuPopup.show();BX.addCustomEvent(this.menuPopup.popupWindow,"onPopupClose",function(){BX.PopupMenu.destroy(this.popupId);this.menuPopup=null;this.addBtnMenu=null}.bind(this))}},{key:"addEntry",value:function e(){if(this.addEntryHandler){this.addEntryHandler()}if(this.menuPopup&&this.menuPopup.popupWindow&&this.menuPopup.popupWindow.isShown()){this.menuPopup.close()}}},{key:"addTask",value:function e(){if(this.addTaskHandler){this.addTaskHandler()}if(this.menuPopup&&this.menuPopup.popupWindow&&this.menuPopup.popupWindow.isShown()){this.menuPopup.close()}}}]);return t}(o.EventEmitter);var ie=function(e){babelHelpers.inherits(t,e);function t(){var e;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"showTasks",false);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.MeetingStatusControl");e.BX=r.Util.getBX();if(i.wrap&&u.Type.isDomNode(i.wrap)){e.DOM.wrap=i.wrap}else{throw new Error('The argument "params.wrap" must be a DOM node.')}e.id=i.id||"meeting-status-control-"+Math.round(Math.random()*1e4);e.zIndex=3100;e.create();e.status=i.currentStatus||null;if(e.status){e.updateStatus()}return e}babelHelpers.createClass(t,[{key:"create",value:function e(){this.acceptBtn=new BX.UI.Button({text:u.Loc.getMessage("EC_VIEW_DESIDE_BUT_Y"),className:"ui-btn ui-btn-primary",events:{click:this.accept.bind(this)}});this.acceptBtn.renderTo(this.DOM.wrap);this.declineBtn=new BX.UI.Button({text:u.Loc.getMessage("EC_VIEW_DESIDE_BUT_N"),className:"ui-btn ui-btn-light-border",events:{click:this.decline.bind(this)}});this.declineBtn.renderTo(this.DOM.wrap)}},{key:"updateStatus",value:function e(){if(this.status==="H"){this.acceptBtn.getContainer().style.display="none";this.declineBtn.getContainer().style.display="";this.declineBtn.setText(u.Loc.getMessage("EC_VIEW_DESIDE_BUT_OWNER_N"))}else{if(this.status==="Y"){this.acceptBtn.getContainer().style.display="none";this.declineBtn.getContainer().style.display=""}else if(this.status==="N"){this.acceptBtn.getContainer().style.display="";this.declineBtn.getContainer().style.display="none"}else{this.acceptBtn.getContainer().style.display="";this.declineBtn.getContainer().style.display=""}}}},{key:"accept",value:function e(){this.setStatus("Y")}},{key:"decline",value:function e(){this.setStatus("N")}},{key:"setStatus",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;this.status=t;if(this.menuPopup){this.menuPopup.close()}if(i){this.emit("onSetStatus",new u.Event.BaseEvent({data:{status:t}}))}}}]);return t}(u.Event.EventEmitter);var ae=function(e){babelHelpers.inherits(t,e);function t(){var e;babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.ConfirmStatusDialog");e.zIndex=3200;e.id="confirm-status-dialog-"+Math.round(Math.random()*1e4);return e}babelHelpers.createClass(t,[{key:"show",value:function e(){var t=this;var i=u.Dom.create("DIV");this.dialog=new BX.PopupWindow(this.id,null,{overlay:{opacity:10},autoHide:true,closeByEsc:true,zIndex:this.zIndex,offsetLeft:0,offsetTop:0,draggable:true,bindOnResize:false,titleBar:u.Loc.getMessage("EC_DECLINE_REC_EVENT"),closeIcon:{right:"12px",top:"10px"},className:"bxc-popup-window",buttons:[new BX.PopupWindowButtonLink({text:u.Loc.getMessage("EC_SEC_SLIDER_CANCEL"),className:"popup-window-button-link-cancel",events:{click:this.close.bind(this)}})],content:i,cacheable:false});i.appendChild(new BX.PopupWindowButton({text:u.Loc.getMessage("EC_DECLINE_ONLY_THIS"),events:{click:function e(){t.onDeclineHandler();t.emit("onDecline",new o.BaseEvent({data:{recursionMode:"this"}}))}}}).buttonNode);i.appendChild(new BX.PopupWindowButton({text:u.Loc.getMessage("EC_DECLINE_NEXT"),events:{click:function e(){t.onDeclineHandler();t.emit("onDecline",new o.BaseEvent({data:{recursionMode:"next"}}))}}}).buttonNode);i.appendChild(new BX.PopupWindowButton({text:u.Loc.getMessage("EC_DECLINE_ALL"),events:{click:function e(){t.onDeclineHandler();t.emit("onDecline",new o.BaseEvent({data:{recursionMode:"all"}}))}}}).buttonNode);this.dialog.show()}},{key:"close",value:function e(){if(this.dialog){this.dialog.close()}}},{key:"onDeclineHandler",value:function e(){this.close();var t=a.EntryManager.getCompactViewForm();if(t&&t.isShown()){t.close()}}}]);return t}(o.EventEmitter);var se=function(e){babelHelpers.inherits(t,e);function t(){var e;babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.ConfirmEditDialog");e.zIndex=3200;e.id="confirm-edit-dialog-"+Math.round(Math.random()*1e4);return e}babelHelpers.createClass(t,[{key:"show",value:function e(){var t=this;var i=u.Dom.create("DIV");this.dialog=new BX.PopupWindow(this.id,null,{overlay:{opacity:10},autoHide:true,closeByEsc:true,zIndex:this.zIndex,offsetLeft:0,offsetTop:0,draggable:true,bindOnResize:false,titleBar:u.Loc.getMessage("EC_EDIT_REC_EVENT"),closeIcon:{right:"12px",top:"10px"},className:"bxc-popup-window",buttons:[new BX.PopupWindowButtonLink({text:u.Loc.getMessage("EC_SEC_SLIDER_CANCEL"),className:"popup-window-button-link-cancel",events:{click:this.close.bind(this)}})],content:i,events:{},cacheable:false});i.appendChild(new BX.PopupWindowButton({text:u.Loc.getMessage("EC_REC_EV_ONLY_THIS_EVENT"),events:{click:function e(){t.emit("onEdit",new o.BaseEvent({data:{recursionMode:"this"}}));t.close()}}}).buttonNode);i.appendChild(new BX.PopupWindowButton({text:u.Loc.getMessage("EC_REC_EV_NEXT"),events:{click:function e(){t.emit("onEdit",new o.BaseEvent({data:{recursionMode:"next"}}));t.close()}}}).buttonNode);i.appendChild(new BX.PopupWindowButton({text:u.Loc.getMessage("EC_REC_EV_ALL"),events:{click:function e(){t.emit("onEdit",new o.BaseEvent({data:{recursionMode:"all"}}));t.close()}}}).buttonNode);this.dialog.show()}},{key:"close",value:function e(){if(this.dialog){this.dialog.close()}}}]);return t}(o.EventEmitter);var ne=function(e){babelHelpers.inherits(t,e);function t(){var e;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,i));e.title=BX.message("EC_DEL_REC_EVENT");e.entry=i.entry;return e}babelHelpers.createClass(t,[{key:"getContent",value:function e(){this.DOM.content=BX.create("DIV");this.DOM.content.appendChild(new BX.PopupWindowButton({text:BX.message("EC_REC_EV_ONLY_THIS_EVENT"),events:{click:function(){this.entry.deleteThis();this.close()}.bind(this)}}).buttonNode);this.DOM.content.appendChild(new BX.PopupWindowButton({text:BX.message("EC_REC_EV_NEXT"),events:{click:function(){this.entry.deleteNext();this.close()}.bind(this)}}).buttonNode);this.DOM.content.appendChild(new BX.PopupWindowButton({text:BX.message("EC_REC_EV_ALL"),events:{click:function(){this.entry.deleteAll();this.close()}.bind(this)}}).buttonNode);return this.DOM.content}},{key:"getButtons",value:function e(){return[new BX.PopupWindowButtonLink({text:BX.message("EC_SEC_SLIDER_CANCEL"),className:"popup-window-button-link-cancel",events:{click:this.close.bind(this)}})]}}]);return t}(Y);var le,oe,re,ue,ce,de,pe,he,fe,me,ve,be,ge,De;var ye=function(e){babelHelpers.inherits(t,e);function t(e){var i;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{showTimezone:true};babelHelpers.classCallCheck(this,t);i=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"DATE_INPUT_WIDTH",110);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"TIME_INPUT_WIDTH",70);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"MODIFIED_TIME_INPUT_WIDTH",80);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"zIndex",4200);i.setEventNamespace("BX.Calendar.Controls.DateTimeControl");i.showTimezone=a.showTimezone;i.inlineEditMode=!!a.inlineEditMode;i.currentInlineEditMode=a.currentInlineEditMode||"view";i.UID=e||"date-time-"+Math.round(Math.random()*1e5);i.DOM={outerWrap:a.outerWrap||null,outerContent:a.outerContent||null};i.create();return i}babelHelpers.createClass(t,[{key:"create",value:function e(){if(u.Type.isDomNode(this.DOM.outerWrap)){if(this.inlineEditMode){u.Dom.addClass(this.DOM.outerWrap,"calendar-datetime-inline-mode-view")}this.DOM.leftInnerWrap=this.DOM.outerWrap.appendChild(u.Tag.render(le||(le=babelHelpers.taggedTemplateLiteral(['<div class="calendar-field-block calendar-field-block-left"></div>']))));this.DOM.fromDate=this.DOM.leftInnerWrap.appendChild(u.Tag.render(oe||(oe=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<input class="calendar-field calendar-field-datetime" value="" type="text" autocomplete="off" style="width: ','px;"/>\n\t\t\t'])),this.DATE_INPUT_WIDTH));if(this.inlineEditMode){this.DOM.fromDateText=this.DOM.leftInnerWrap.appendChild(u.Tag.render(re||(re=babelHelpers.taggedTemplateLiteral(['<span class="calendar-field-value calendar-field-value-date"></span>']))))}this.DOM.fromTime=this.DOM.leftInnerWrap.appendChild(u.Tag.render(ue||(ue=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<input class="calendar-field calendar-field-time" value="" type="text" autocomplete="off" style="width: ','px;"/>\n\t\t\t'])),this.TIME_INPUT_WIDTH));if(this.inlineEditMode){this.DOM.fromTimeText=this.DOM.leftInnerWrap.appendChild(u.Tag.render(ce||(ce=babelHelpers.taggedTemplateLiteral(['<span class="calendar-field-value calendar-field-value-time"></span>']))))}this.DOM.betweenSpacer=this.DOM.outerWrap.appendChild(u.Tag.render(de||(de=babelHelpers.taggedTemplateLiteral(['<div class="calendar-field-block calendar-field-block-between" />']))));this.DOM.rightInnerWrap=this.DOM.outerWrap.appendChild(u.Tag.render(pe||(pe=babelHelpers.taggedTemplateLiteral(['<div class="calendar-field-block calendar-field-block-right"></div>']))));this.DOM.toTime=this.DOM.rightInnerWrap.appendChild(u.Tag.render(he||(he=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<input class="calendar-field calendar-field-time" value="" type="text" autocomplete="off" style="width: ','px;"/>\n\t\t\t'])),this.TIME_INPUT_WIDTH));if(this.inlineEditMode){this.DOM.toTimeText=this.DOM.rightInnerWrap.appendChild(u.Tag.render(fe||(fe=babelHelpers.taggedTemplateLiteral(['<span class="calendar-field-value calendar-field-value-time"></span>']))))}this.DOM.toDate=this.DOM.rightInnerWrap.appendChild(u.Tag.render(me||(me=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<input class="calendar-field calendar-field-datetime" value="" type="text" autocomplete="off" style="width: ','px;"/>'])),this.DATE_INPUT_WIDTH));if(this.inlineEditMode){this.DOM.toDateText=this.DOM.rightInnerWrap.appendChild(u.Tag.render(ve||(ve=babelHelpers.taggedTemplateLiteral(['<span class="calendar-field-value calendar-field-value-date"></span>']))))}this.fromTimeControl=new p({input:this.DOM.fromTime,onChangeCallback:this.handleTimeFromChange.bind(this)});this.toTimeControl=new p({input:this.DOM.toTime,onChangeCallback:this.handleTimeToChange.bind(this)});var t=this.DOM.outerWrap.appendChild(u.Tag.render(be||(be=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<span class="calendar-event-full-day"></span>\n\t\t\t']))));this.DOM.fullDay=t.appendChild(u.Tag.render(ge||(ge=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<input value="Y" type="checkbox" id="{this.UID}"/>\n\t\t\t']))));t.appendChild(u.Tag.render(De||(De=babelHelpers.taggedTemplateLiteral(['<label for="{this.UID}">',"</label>"])),u.Loc.getMessage("EC_ALL_DAY")))}if(this.showTimezone);this.bindEventHandlers()}},{key:"setValue",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.DOM.fromDate.value=r.Util.formatDate(t.from);this.DOM.toDate.value=r.Util.formatDate(t.to);this.lastDateValue=t.from;this.fromTimeControl.setValue(t.from);this.toTimeControl.setValue(t.to);this.DOM.fromTime.value=r.Util.formatTime(t.from);this.DOM.toTime.value=r.Util.formatTime(t.to);if(this.inlineEditMode){this.DOM.fromDateText.innerHTML=r.Util.formatDateUsable(t.from,true,true);this.DOM.toDateText.innerHTML=r.Util.formatDateUsable(t.to,true,true);this.DOM.toDateText.style.display=this.DOM.fromDate.value===this.DOM.toDate.value?"none":"";if(t.fullDay){if(this.DOM.fromDate.value===this.DOM.toDate.value){this.DOM.toTimeText.innerHTML=u.Loc.getMessage("EC_ALL_DAY");this.DOM.toTimeText.style.display="";this.DOM.fromTimeText.style.display="none";this.DOM.fromTimeText.innerHTML=""}else{this.DOM.betweenSpacer.style.display="";this.DOM.fromTimeText.style.display="none";this.DOM.toTimeText.style.display="none"}}else{this.DOM.fromTimeText.innerHTML=this.DOM.fromTime.value;this.DOM.toTimeText.innerHTML=this.DOM.toTime.value;this.DOM.betweenSpacer.style.display="";this.DOM.fromTimeText.style.display="";this.DOM.toTimeText.style.display=""}}if(t.fullDay!==undefined){this.DOM.fullDay.checked=t.fullDay}if(this.showTimezone){t.timezoneFrom=t.timezoneFrom||t.timezoneName;t.timezoneTo=t.timezoneTo||t.timezoneName;if(t.timezoneFrom!==undefined&&u.Type.isDomNode(this.DOM.fromTz)){this.DOM.fromTz.value=t.timezoneFrom}if(t.timezoneTo!==undefined&&u.Type.isDomNode(this.DOM.toTz)){this.DOM.toTz.value=t.timezoneTo}if(t.timezoneName!==undefined&&(t.timezoneName!==t.timezoneFrom||t.timezoneName!==t.timezoneTo)){this.switchTimezone(true)}}this.value=t;this.handleFullDayChange()}},{key:"getValue",value:function e(){var t={fullDay:this.DOM.fullDay.checked,fromDate:this.DOM.fromDate.value,toDate:this.DOM.toDate.value,fromTime:this.DOM.fromTime.value,toTime:this.DOM.toTime.value,timezoneFrom:this.DOM.fromTz?this.DOM.fromTz.value:this.value.timezoneFrom||this.value.timezoneName||null,timezoneTo:this.DOM.toTz?this.DOM.toTz.value:this.value.timezoneTo||this.value.timezoneName||null};t.from=r.Util.parseDate(t.fromDate);if(u.Type.isDate(t.from)){t.to=r.Util.parseDate(t.toDate);if(!u.Type.isDate(t.to)){t.to=t.from}if(t.fullDay){t.from.setHours(0,0,0);t.to.setHours(0,0,0)}else{var i=r.Util.parseTime(t.fromTime),a=r.Util.parseTime(t.toTime)||i;if(i&&a){t.from.setHours(i.h,i.m,0);t.to.setHours(a.h,a.m,0)}}}return t}},{key:"bindEventHandlers",value:function e(){var i=this;u.Event.bind(this.DOM.fromDate,"click",t.showInputCalendar);u.Event.bind(this.DOM.fromDate,"change",this.handleDateFromChange.bind(this));u.Event.bind(this.DOM.toDate,"click",t.showInputCalendar);u.Event.bind(this.DOM.toDate,"change",this.handleDateToChange.bind(this));u.Event.bind(this.DOM.fullDay,"click",(function(){i.handleFullDayChange();i.handleValueChange()}));if(this.inlineEditMode){u.Event.bind(this.DOM.outerWrap,"click",this.changeInlineEditMode.bind(this))}if(u.Type.isDomNode(this.DOM.defTimezone)){u.Event.bind(this.DOM.defTimezone,"change",BX.delegate((function(){if(this.bindFromToDefaultTimezones){this.DOM.fromTz.value=this.DOM.toTz.value=this.DOM.defTimezone.value}}),this))}if(this.showTimezone){if(u.Type.isDomNode(this.DOM.tzButton)){u.Event.bind(this.DOM.tzButton,"click",this.switchTimezone.bind(this))}u.Event.bind(this.DOM.fromTz,"change",function(){if(this.bindTimezones){this.DOM.toTz.value=this.DOM.fromTz.value}this.bindFromToDefaultTimezones=false}.bind(this));u.Event.bind(this.DOM.toTz,"change",function(){this.bindTimezones=false;this.bindFromToDefaultTimezones=false}.bind(this));this.bindTimezones=this.DOM.fromTz.value===this.DOM.toTz.value;this.bindFromToDefaultTimezones=this.bindTimezones&&this.DOM.fromTz.value===this.DOM.toTz.value&&this.DOM.fromTz.value===this.DOM.defTimezone.value}}},{key:"handleDateFromChange",value:function e(){var t=r.Util.parseTime(this.DOM.fromTime.value),i=r.Util.parseTime(this.DOM.toTime.value),a=r.Util.parseDate(this.DOM.fromDate.value),s=r.Util.parseDate(this.DOM.toDate.value);if(this.lastDateValue){if(this.DOM.fullDay.checked&&this.lastDateValue){this.lastDateValue.setHours(0,0,0)}else{if(a&&t){a.setHours(t.h,t.m,0)}if(s&&i){s.setHours(i.h,i.m,0)}}if(a&&this.lastDateValue){s=new Date(a.getTime()+(s.getTime()-this.lastDateValue.getTime()||36e5));if(s){this.DOM.toDate.value=r.Util.formatDate(s)}}}this.lastDateValue=a;this.handleValueChange()}},{key:"handleTimeFromChange",value:function e(){var t=r.Util.parseTime(this.DOM.fromTime.value),i=r.Util.parseTime(this.DOM.toTime.value),a=r.Util.parseDate(this.DOM.fromDate.value),s=r.Util.parseDate(this.DOM.toDate.value);if(a&&t){a.setHours(t.h,t.m,0)}if(s&&i){s.setHours(i.h,i.m,0)}if(this.lastDateValue){var n=new Date(r.Util.getTimeRounded(a)+r.Util.getTimeRounded(s)-r.Util.getTimeRounded(this.lastDateValue));this.DOM.toTime.value=r.Util.formatTime(n);this.DOM.toDate.value=r.Util.formatDate(n)}this.lastDateValue=a;this.handleValueChange()}},{key:"handleDateToChange",value:function e(){this.handleValueChange()}},{key:"handleTimeToChange",value:function e(){this.handleValueChange()}},{key:"handleFullDayChange",value:function e(){var t=this.getFullDayValue();if(t){if(u.Type.isDomNode(this.DOM.dateTimeWrap)){u.Dom.addClass(this.DOM.dateTimeWrap,"calendar-options-item-datetime-hide-time")}if(u.Type.isDomNode(this.DOM.outerWrap)){u.Dom.addClass(this.DOM.outerWrap,"calendar-options-item-datetime-hide-time")}}else{if(u.Type.isDomNode(this.DOM.dateTimeWrap)){u.Dom.removeClass(this.DOM.dateTimeWrap,"calendar-options-item-datetime-hide-time")}if(u.Type.isDomNode(this.DOM.outerWrap)){u.Dom.removeClass(this.DOM.outerWrap,"calendar-options-item-datetime-hide-time")}}}},{key:"handleValueChange",value:function e(){this.emit("onChange",new o.BaseEvent({data:{value:this.getValue()}}))}},{key:"getFullDayValue",value:function e(){return!!this.DOM.fullDay.checked}},{key:"switchTimezone",value:function e(t){if(!u.Type.isBoolean(t)){t=BX.hasClass(this.DOM.tzCont,"calendar-options-timezone-collapse")}if(t){u.Dom.addClass(this.DOM.tzCont,"calendar-options-timezone-expand");u.Dom.removeClass(this.DOM.tzCont,"calendar-options-timezone-collapse")}else{u.Dom.addClass(this.DOM.tzCont,"calendar-options-timezone-collapse");u.Dom.removeClass(this.DOM.tzCont,"calendar-options-timezone-expand")}}},{key:"changeInlineEditMode",value:function e(){if(!this.viewMode){this.setInlineEditMode("edit")}}},{key:"setViewMode",value:function e(t){this.viewMode=t;if(this.viewMode&&this.currentInlineEditMode==="edit"){this.setInlineEditMode("view")}}},{key:"setInlineEditMode",value:function e(t){if(this.inlineEditMode){this.currentInlineEditMode=t;if(this.currentInlineEditMode==="edit"){u.Dom.addClass(this.DOM.outerWrap,"calendar-datetime-inline-mode-edit");u.Dom.removeClass(this.DOM.outerWrap,"calendar-datetime-inline-mode-view")}else{u.Dom.removeClass(this.DOM.outerWrap,"calendar-datetime-inline-mode-edit");u.Dom.addClass(this.DOM.outerWrap,"calendar-datetime-inline-mode-view")}}}}],[{key:"showInputCalendar",value:function e(i){var a=i.target||i.srcElement;if(u.Type.isDomNode(a)&&a.nodeName.toLowerCase()==="input"){var s=BX.calendar.get();if(s.popup){s.popup.destroy();s.popup=null;s._current_layer=null;s._layers={}}s.Show({node:a.parentNode,field:a,bTime:false});BX.onCustomEvent(window,"onCalendarControlChildPopupShown");var n=s.popup;if(n){BX.removeCustomEvent(n,"onPopupClose",t.inputCalendarClosePopupHandler);BX.addCustomEvent(n,"onPopupClose",t.inputCalendarClosePopupHandler)}}}},{key:"inputCalendarClosePopupHandler",value:function e(t){BX.onCustomEvent(window,"onCalendarControlChildPopupClosed")}}]);return t}(o.EventEmitter);var Me=function(e){babelHelpers.inherits(t,e);function t(){var e;babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.ConfirmStatusDialog");e.zIndex=3200;e.id="busy-user-dialog-"+Math.round(Math.random()*1e4);return e}babelHelpers.createClass(t,[{key:"show",value:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.plural=i.users.length>1;var a,s=[];for(a=0;a<i.users.length;a++){s.push(i.users[a].DISPLAY_NAME)}s=s.join(", ");var n=BX.create("DIV",{props:{className:"calendar-busy-users-content-wrap"},html:'<div class="calendar-busy-users-content">'+BX.util.htmlspecialchars(this.plural?u.Loc.getMessage("EC_BUSY_USERS_PLURAL").replace("#USER_LIST#",s):u.Loc.getMessage("EC_BUSY_USERS_SINGLE").replace("#USER_NAME#",i.users[0].DISPLAY_NAME))+"</div>"});this.dialog=new BX.PopupWindow(this.id,null,{overlay:{opacity:10},autoHide:true,closeByEsc:true,zIndex:this.zIndex,offsetLeft:0,offsetTop:0,draggable:true,bindOnResize:false,titleBar:u.Loc.getMessage("EC_BUSY_USERS_TITLE"),closeIcon:{right:"12px",top:"10px"},className:"bxc-popup-window",content:n,events:{}});n.appendChild(new BX.PopupWindowButton({text:u.Loc.getMessage("EC_BUSY_USERS_BACK2EDIT"),events:{click:function e(){t.close()}}}).buttonNode);n.appendChild(new BX.PopupWindowButton({text:this.plural?u.Loc.getMessage("EC_BUSY_USERS_EXCLUDE_PLURAL"):u.Loc.getMessage("EC_BUSY_USERS_EXCLUDE_SINGLE"),events:{click:function e(){t.emit("onSaveWithout");t.close()}}}).buttonNode);this.dialog.show()}},{key:"close",value:function e(){if(this.dialog){this.dialog.close()}}}]);return t}(o.EventEmitter);var Ce,Te;var Ee=function(e){babelHelpers.inherits(t,e);function t(){var e;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"zIndex",4200);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"readOnlyMode",true);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"meetingNotifyValue",true);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"userSelectorDialog",null);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"attendeesEntityList",[]);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"inlineEditMode",t.VIEW_MODE);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"prevUserList",[]);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"loadedAccessibilityData",{});e.setEventNamespace("BX.Calendar.Controls.UserPlannerSelector");e.selectorId=i.id||"user-selector-"+Math.round(Math.random()*1e4);e.BX=r.Util.getBX();e.DOM={outerWrap:i.outerWrap,wrap:i.wrap,informWrap:i.informWrap,informWrapText:i.informWrap.querySelector(".calendar-field-container-inform-text"),moreLink:i.outerWrap.querySelector(".calendar-members-more"),changeLink:i.outerWrap.querySelector(".calendar-members-change-link"),attendeesLabel:i.outerWrap.querySelector(".calendar-attendees-label"),attendeesList:i.outerWrap.querySelector(".calendar-attendees-list"),userSelectorWrap:i.outerWrap.querySelector(".calendar-user-selector-wrap"),plannerOuterWrap:i.plannerOuterWrap,videocallWrap:i.outerWrap.querySelector(".calendar-videocall-wrap"),hideGuestsWrap:i.hideGuestsWrap,hideGuestsIcon:i.hideGuestsWrap.querySelector(".calendar-hide-members-icon-hidden")};e.refreshPlanner=u.Runtime.debounce(e.refreshPlannerState,100,babelHelpers.assertThisInitialized(e));if(u.Type.isBoolean(i.readOnlyMode)){e.readOnlyMode=i.readOnlyMode}e.userId=i.userId;e.type=i.type;e.ownerId=i.ownerId;e.zIndex=i.zIndex||e.zIndex;e.dayOfWeekMonthFormat=i.dayOfWeekMonthFormat;e.plannerFeatureEnabled=!!i.plannerFeatureEnabled;e.create();return e}babelHelpers.createClass(t,[{key:"create",value:function e(){var i=this;if(this.DOM.changeLink&&!this.isReadOnly()){u.Event.bind(this.DOM.changeLink,"click",(function(){if(!i.userSelectorDialog){i.userSelectorDialog=new n.Dialog({targetNode:i.DOM.changeLink,context:"CALENDAR",preselectedItems:i.attendeesPreselectedItems,enableSearch:true,zIndex:i.zIndex+10,events:{"Item:onSelect":i.handleUserSelectorChanges.bind(i),"Item:onDeselect":i.handleUserSelectorChanges.bind(i)},entities:[{id:"user",options:{inviteGuestLink:true,emailUsers:true}},{id:"project"},{id:"department",options:{selectMode:"usersAndDepartments"}},{id:"meta-user",options:{"all-users":true}}],searchTabOptions:{stubOptions:{title:u.Loc.getMessage("EC_USER_DIALOG_404_TITLE"),subtitle:u.Loc.getMessage("EC_USER_DIALOG_404_SUBTITLE"),icon:"/bitrix/images/calendar/search-email.svg",iconOpacity:100,arrow:true}}})}i.userSelectorDialog.show()}))}if(this.DOM.moreLink){u.Event.bind(this.DOM.moreLink,"click",this.showMoreAttendeesPopup.bind(this))}this.planner=new s.Planner({wrap:this.DOM.plannerOuterWrap,minWidth:t.PLANNER_WIDTH,width:t.PLANNER_WIDTH,showEntryName:false,locked:!this.plannerFeatureEnabled,dayOfWeekMonthFormat:this.dayOfWeekMonthFormat});u.Event.bind(this.DOM.informWrap,"click",(function(){i.setInformValue(!i.meetingNotifyValue);i.emit("onNotifyChange")}));this.DOM.attendeesLabel.innerHTML=u.Text.encode(u.Loc.getMessage("EC_ATTENDEES_LABEL_ONE"));this.planner.subscribe("onDateChange",(function(e){i.emit("onDateChange",e)}));this.planner.subscribe("onExpandTimeline",this.handleExpandPlannerTimeline.bind(this));if(this.DOM.hideGuestsWrap&&!this.isReadOnly()){u.Event.bind(this.DOM.hideGuestsWrap,"click",(function(){i.setHideGuestsValue(!i.hideGuests)}))}}},{key:"setValue",value:function e(t){var i,a;var s=t.attendeesEntityList,n=t.attendees,o=t.location,c=t.notify,d=t.hideGuests,p=t.viewMode,h=t.entry;this.attendeesEntityList=u.Type.isArray(s)?s:[];this.attendeesPreselectedItems=this.attendeesEntityList.map((function(e){return[e.entityId,e.id]}));this.entry=h;this.entryId=this.entry.id;if(this.attendeesEntityList.length>1&&!p){this.showPlanner()}this.setEntityList(this.attendeesEntityList);this.setInformValue(c);this.setLocationValue(o);if(u.Type.isArray(n)){this.displayAttendees(n)}this.refreshPlanner();if((i=BX)!==null&&i!==void 0&&(a=i.Intranet)!==null&&a!==void 0&&a.ControlButton&&this.DOM.videocallWrap&&this.entryId&&this.entry.getCurrentStatus()!==false){u.Dom.clean(this.DOM.videocallWrap);u.Dom.removeClass(this.DOM.videocallWrap,"calendar-videocall-hidden");this.intranetControllButton=new l.ControlButton({container:this.DOM.videocallWrap,entityType:"calendar_event",entityId:this.entry.parentId,mainItem:"chat",entityData:{dateFrom:r.Util.formatDate(this.entry.from),parentId:this.entry.parentId},analyticsLabel:{formType:"compact"}});if(u.Type.isElementNode(this.intranetControllButton.button)){this.intranetControllButton.button.setAttribute("data-role","videocallButton")}}else if(this.DOM.videocallWrap){u.Dom.addClass(this.DOM.videocallWrap,"calendar-videocall-hidden")}this.setHideGuestsValue(d)}},{key:"handleUserSelectorChanges",value:function e(){this.showPlanner();this.setEntityList(this.userSelectorDialog.getSelectedItems().map((function(e){return{entityId:e.entityId,id:e.id,entityType:e.entityType}})));this.refreshPlanner();this.emit("onUserCodesChange")}},{key:"getEntityList",value:function e(){return this.selectorEntityList}},{key:"setEntityList",value:function e(t){if(this.type==="user"&&this.userId!==this.ownerId){t.push({entityId:"user",id:this.ownerId})}this.selectorEntityList=t}},{key:"isReadOnly",value:function e(){return this.readOnlyMode}},{key:"getUserSelector",value:function e(){return BX.UI.SelectorManager.instances[this.selectorId]}},{key:"showPlanner",value:function e(){if(!this.isPlannerDisplayed()){u.Dom.addClass(this.DOM.outerWrap,"user-selector-edit-mode");this.planner.show();this.planner.showLoader()}}},{key:"checkBusyTime",value:function e(){var t=this;var i=this.getDateTime();var a=this.getEntityList();this.runPlannerDataRequest({entityList:a,from:r.Util.formatDate(i.from.getTime()-r.Util.getDayLength()*3),to:r.Util.formatDate(i.to.getTime()+r.Util.getDayLength()*10),timezone:i.timezoneFrom,location:this.getLocationValue(),entryId:this.entryId}).then((function(e){for(var a in e.data.accessibility){if(e.data.accessibility.hasOwnProperty(a)){t.loadedAccessibilityData[a]=e.data.accessibility[a]}}if(u.Type.isArray(e.data.entries)){e.data.entries.forEach((function(e){if(e.type==="user"&&!t.prevUserList.includes(parseInt(e.id))){t.prevUserList.push(parseInt(e.id))}}))}if(u.Type.isArray(e.data.accessibility[t.ownerId])){var s=t.getDateTime().from;var n=t.getDateTime().to;var l=t.preparedDataAccessibility(e.data.accessibility[t.ownerId]);var o=t.planner.checkTimePeriod(s,n,l);if(u.Type.isObject(o)&&u.Type.isArray(e.data.entries)){t.showPlanner();t.planner.update(e.data.entries,e.data.accessibility);t.planner.updateSelector(i.from,i.to,i.fullDay);t.planner.hideLoader();t.displayAttendees(t.prepareAttendeesForDisplay(e.data.entries))}}}))}},{key:"prepareAttendeesForDisplay",value:function e(t){return t.filter((function(e){return e.type==="user"})).map((function(e){return{ID:e.id,AVATAR:e.avatar,DISPLAY_NAME:e.name,EMAIL_USER:e.emailUser,STATUS:(e.status||"").toUpperCase(),URL:e.url}}))}},{key:"refreshPlannerState",value:function e(){var t=this;if(this.planner&&this.planner.isShown()){var i=this.getDateTime();this.loadPlannerData({entityList:this.getEntityList(),from:r.Util.formatDate(i.from.getTime()-r.Util.getDayLength()*3),to:r.Util.formatDate(i.to.getTime()+r.Util.getDayLength()*10),timezone:i.timezoneFrom,location:this.getLocationValue(),entryId:this.entryId,prevUserList:this.prevUserList}).then((function(e){t.displayAttendees(t.prepareAttendeesForDisplay(e.data.entries||[]))}))}}},{key:"loadPlannerData",value:function e(){var t=this;var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.planner.showLoader();return new Promise((function(e){t.runPlannerDataRequest(i).then((function(a){for(var s in a.data.accessibility){if(a.data.accessibility.hasOwnProperty(s)){t.loadedAccessibilityData[s]=a.data.accessibility[s]}}if(u.Type.isArray(a.data.entries)){a.data.entries.forEach((function(e){if(e.type==="user"&&!t.prevUserList.includes(parseInt(e.id))){t.prevUserList.push(parseInt(e.id))}}))}t.planner.hideLoader();var n=t.getDateTime();t.planner.update(a.data.entries,t.loadedAccessibilityData);t.planner.updateSelector(n.from,n.to,n.fullDay,{focus:i.focusSelector!==false});e(a)}),(function(t){e(t)}))}))}},{key:"runPlannerDataRequest",value:function e(t){return this.BX.ajax.runAction("calendar.api.calendarajax.updatePlanner",{data:{entryId:t.entryId||0,entryLocation:this.entry.data.LOCATION||"",ownerId:this.ownerId,type:this.type,entityList:t.entityList||[],dateFrom:t.from||"",dateTo:t.to||"",timezone:t.timezone||"",location:t.location||"",entries:t.entrieIds||false,prevUserList:t.prevUserList||[]}})}},{key:"setDateTime",value:function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;this.dateTime=t;if(this.planner&&i){this.planner.updateSelector(t.from,t.to,t.fullDay)}}},{key:"getDateTime",value:function e(){return this.dateTime}},{key:"setLocationValue",value:function e(t){this.location=t}},{key:"getLocationValue",value:function e(){return this.location}},{key:"displayAttendees",value:function e(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];u.Dom.clean(this.DOM.attendeesList);this.attendeeList=d.AttendeesList.sortAttendees(i);var a=this.attendeeList.accepted.length+this.attendeeList.requested.length;this.emit("onDisplayAttendees",new o.BaseEvent({data:{usersCount:a}}));var s=this.attendeeList.accepted.length;if(s>0){if(s>t.MAX_USER_COUNT_DISPLAY){s=t.MAX_USER_COUNT}for(var n=0;n<s;n++){this.attendeeList.accepted[n].shown=true;this.DOM.attendeesList.appendChild(t.getUserAvatarNode(this.attendeeList.accepted[n]))}}if(s>1){this.DOM.attendeesLabel.innerHTML=u.Text.encode(u.Loc.getMessage("EC_ATTENDEES_LABEL_NUM")).replace("#COUNT#","<span>(</span>".concat(this.attendeeList.accepted.length,"<span>)</span>"))}else{this.DOM.attendeesLabel.innerHTML=u.Text.encode(u.Loc.getMessage("EC_ATTENDEES_LABEL_ONE"))}if(s<i.length){this.DOM.moreLink.innerHTML=u.Text.encode(u.Loc.getMessage("EC_ATTENDEES_ALL_COUNT").replace("#COUNT#",i.length));u.Dom.show(this.DOM.moreLink)}else{u.Dom.hide(this.DOM.moreLink)}if(this.hasExternalEmailUsers(i)&&this.isPlannerDisplayed()&&!this.isReadOnly()){this.showHideGuestsOption()}else{this.hideHideGuestsOption()}}},{key:"showMoreAttendeesPopup",value:function e(){new d.AttendeesList(this.DOM.moreLink,this.attendeeList).showPopup()}},{key:"setInformValue",value:function e(t){if(u.Type.isBoolean(t)){var i="calendar-field-container-inform-off";this.meetingNotifyValue=t;if(this.meetingNotifyValue){u.Dom.removeClass(this.DOM.informWrap,i);this.DOM.informWrap.title=u.Loc.getMessage("EC_NOTIFY_OPTION_ON_TITLE");this.DOM.informWrapText.innerHTML=u.Loc.getMessage("EC_NOTIFY_OPTION")}else{u.Dom.addClass(this.DOM.informWrap,i);this.DOM.informWrap.title=u.Loc.getMessage("EC_NOTIFY_OPTION_OFF_TITLE");this.DOM.informWrapText.innerHTML=u.Loc.getMessage("EC_DONT_NOTIFY_OPTION")}}}},{key:"getInformValue",value:function e(t){return this.meetingNotifyValue}},{key:"setViewMode",value:function e(t){this.readOnlyMode=t;if(this.readOnlyMode){u.Dom.addClass(this.DOM.outerWrap,"calendar-userselector-readonly")}else{u.Dom.removeClass(this.DOM.outerWrap,"calendar-userselector-readonly")}}},{key:"isPlannerDisplayed",value:function e(){return this.planner.isShown()}},{key:"hasExternalEmailUsers",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return!!t.find((function(e){return e.EMAIL_USER}))||!!this.getEntityList().find((function(e){return e.entityType==="email"}))}},{key:"destroy",value:function e(){if(this.userSelectorDialog&&this.userSelectorDialog.destroy){this.userSelectorDialog.destroy();this.userSelectorDialog=null}if(this.intranetControllButton&&this.intranetControllButton.destroy){this.intranetControllButton.destroy();this.intranetControllButton=null}}},{key:"showHideGuestsOption",value:function e(){this.DOM.hideGuestsWrap.style.display="";r.Util.initHintNode(this.DOM.hideGuestsWrap.querySelector(".calendar-hide-members-helper"))}},{key:"hideHideGuestsOption",value:function e(){this.DOM.hideGuestsWrap.style.display="none"}},{key:"setHideGuestsValue",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.hideGuests=t;if(u.Type.isElementNode(this.DOM.hideGuestsIcon)){this.DOM.hideGuestsIcon.className=this.hideGuests?"calendar-hide-members-icon-hidden":"calendar-hide-members-icon-visible"}var i=this.DOM.hideGuestsWrap.querySelector(".calendar-hide-members-text");if(u.Type.isElementNode(i)){i.innerHTML=this.hideGuests?u.Loc.getMessage("EC_HIDE_GUEST_NAMES"):u.Loc.getMessage("EC_SHOW_GUEST_NAMES")}}},{key:"preparedDataAccessibility",value:function e(t){return t.map((function(e){return s.Planner.prepareAccessibilityItem(e)}))}},{key:"clearAccessibilityData",value:function e(t){if(u.Type.isArray(t)&&t.length&&this.prevUserList.length){this.prevUserList=this.prevUserList.filter((function(e){return!t.includes(e)}))}}},{key:"handleExpandPlannerTimeline",value:function e(t){if(t&&t.getData){var i=t.getData();if(i.reload){var a=this.getDateTime();this.loadPlannerData({entityList:this.getEntityList(),from:r.Util.formatDate(i.dateFrom),to:r.Util.formatDate(i.dateTo),timezone:a.timezoneFrom,location:this.getLocationValue(),entryId:this.entryId,focusSelector:false})}}}}],[{key:"getUserAvatarNode",value:function e(t){var i,a=t.AVATAR||t.SMALL_AVATAR;if(!a||a==="/bitrix/images/1.gif"){i=u.Tag.render(Ce||(Ce=babelHelpers.taggedTemplateLiteral(['<div title="','" class="ui-icon ','"><i></i></div>'])),u.Text.encode(t.DISPLAY_NAME),t.EMAIL_USER?"ui-icon-common-user-mail":"ui-icon-common-user")}else{i=u.Tag.render(Te||(Te=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<img\n\t\t\t\ttitle="','"\n\t\t\t\tclass="calendar-member"\n\t\t\t\tid="simple_popup_','"\n\t\t\t\tsrc="','"\n\t\t\t>'])),u.Text.encode(t.DISPLAY_NAME),parseInt(t.ID),a)}return i}}]);return t}(o.EventEmitter);babelHelpers.defineProperty(Ee,"VIEW_MODE","view");babelHelpers.defineProperty(Ee,"EDIT_MODE","edit");babelHelpers.defineProperty(Ee,"MAX_USER_COUNT",8);babelHelpers.defineProperty(Ee,"MAX_USER_COUNT_DISPLAY",10);babelHelpers.defineProperty(Ee,"PLANNER_WIDTH",450);var Ie=function(e){babelHelpers.inherits(t,e);function t(){var e;babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.ReinviteUserDialog");e.zIndex=3200;e.id="reinvite-dialog-"+Math.round(Math.random()*1e4);return e}babelHelpers.createClass(t,[{key:"show",value:function e(){var t=this;var i=u.Dom.create("DIV");this.dialog=new c.Popup(this.id,null,{overlay:{opacity:10},autoHide:true,closeByEsc:true,zIndex:this.zIndex,offsetLeft:0,offsetTop:0,draggable:true,bindOnResize:false,titleBar:u.Loc.getMessage("EC_REINVITE_TITLE"),closeIcon:{right:"12px",top:"10px"},className:"reinvite-popup-window",content:i,events:{},cacheable:false});new BX.UI.Button({text:u.Loc.getMessage("EC_REINVITE_YES"),className:"ui-btn ui-btn-primary",events:{click:function e(){t.emit("onSelect",new o.BaseEvent({data:{sendInvitesAgain:true}}));t.close()}}}).renderTo(i);new BX.UI.Button({text:u.Loc.getMessage("EC_REINVITE_NO"),className:"ui-btn ui-btn-light-border",events:{click:function e(){t.emit("onSelect",new o.BaseEvent({data:{sendInvitesAgain:false}}));t.close()}}}).renderTo(i);this.dialog.show()}},{key:"close",value:function e(){if(this.dialog){this.dialog.close()}}}]);return t}(o.EventEmitter);var Oe;var Le=function(e){babelHelpers.inherits(t,e);function t(e){var i;babelHelpers.classCallCheck(this,t);i=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"DOM",{});babelHelpers.defineProperty(babelHelpers.assertThisInitialized(i),"CONFIRM_POPUP_ID","add_from_email");i.setEventNamespace("BX.Calendar.Controls.EmailSelectorControl");i.DOM.select=e.selectNode;i.mailboxList=u.Type.isArray(e.mailboxList)?e.mailboxList:[];i.DOM.componentWrap=i.DOM.select.parentNode.appendChild(u.Tag.render(Oe||(Oe=babelHelpers.taggedTemplateLiteral(['<div style="display: none;"></div>']))));i.allowAddNewEmail=e.allowAddNewEmail;i.checkValueDebounce=u.Runtime.debounce(i.checkValue,50,babelHelpers.assertThisInitialized(i));i.create();return i}babelHelpers.createClass(t,[{key:"create",value:function e(){this.setSelectValues();u.Event.bind(this.DOM.select,"change",this.checkValueDebounce);u.Event.bind(this.DOM.select,"click",this.checkValueDebounce)}},{key:"checkValue",value:function e(){if(this.DOM.select.value==="add"){this.showAdd();this.setValue("")}}},{key:"getValue",value:function e(){return this.DOM.select.value}},{key:"setValue",value:function e(t){if(this.mailboxList.length&&this.mailboxList.find((function(e){return e.email===t}))){this.DOM.select.value=t}else{this.DOM.select.value=""}this.emit("onSetValue",{value:this.DOM.select.value})}},{key:"setSelectValues",value:function e(){var t=this;u.Dom.clean(this.DOM.select);this.DOM.select.options.add(new Option(u.Loc.getMessage("EC_NO_VALUE"),""));if(this.mailboxList.length){this.mailboxList.forEach((function(e){t.DOM.select.options.add(new Option(e.formatted,e.email))}),this)}if(this.allowAddNewEmail){this.DOM.select.options.add(new Option(u.Loc.getMessage("EC_ADD_NEW"),"add"))}}},{key:"onClick",value:function e(t){this.input.value=t.sender;this.mailbox.textContent=t.sender}},{key:"showAdd",value:function e(){var t=this;if(window.BXMainMailConfirm){window.BXMainMailConfirm.showForm(this.onAdd.bind(this))}var i=c.PopupManager.getPopupById(this.CONFIRM_POPUP_ID);if(i){i.subscribe("onClose",(function(){t.reloadMailboxList()}))}}},{key:"onAdd",value:function e(t){var i=this;this.reloadMailboxList().then((function(){setTimeout((function(){i.setValue(t.email)}),0)}))}},{key:"getMenuItem",value:function e(t){return{id:t.id,text:BX.util.htmlspecialchars(t.sender),onclick:this.onClick.bind(this,t)}}},{key:"loadMailboxData",value:function e(){var t=this;return new Promise((function(e){BX.ajax.runAction("calendar.api.calendarajax.getAllowedMailboxData").then((function(i){BX.html(t.DOM.componentWrap,i.data.html);t.mailboxList=i.data.additionalParams.mailboxList;t.checkBXMainMailConfirmLoaded(e)}))}))}},{key:"checkBXMainMailConfirmLoaded",value:function e(t){var i=this;if(window.BXMainMailConfirm){this.setSelectValues();t()}else{setTimeout((function(){i.checkBXMainMailConfirmLoaded(t)}),200)}}},{key:"reloadMailboxList",value:function e(){var t=this;return new Promise((function(e){BX.ajax.runAction("calendar.api.calendarajax.getAllowedMailboxList").then((function(i){t.mailboxList=i.data.mailboxList;t.setSelectValues();e()}))}))}}]);return t}(o.EventEmitter);var ke;var we=function(e){babelHelpers.inherits(t,e);function t(){var e;babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"Z_INDEX",3200);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"SLIDER_Z_INDEX",4400);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"WIDTH",400);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.ConfirmedEmailDialog");e.id="confirm-email-dialog-"+Math.round(Math.random()*1e4);return e}babelHelpers.createClass(t,[{key:"show",value:function e(){var t=this;this.DOM.content=u.Tag.render(ke||(ke=babelHelpers.taggedTemplateLiteral(['<div>\n\t\t\t<div class="calendar-confirm-email-text">','</div>\n\t\t\t<div class="calendar-confirm-email-text"><a class="calendar-confirm-email-help-link" href="javascript:void(0);">','</a></div>\n\t\t\t<div class="calendar-field-block">\n\t\t\t\t<select class="calendar-field calendar-field-select ui-btn ui-btn ui-btn-light-border ui-btn-clock"></select>\n\t\t\t</div>\n\t\t</div>'])),u.Loc.getMessage("EC_CONFIRMED_EMAIL_TEXT_1"),u.Loc.getMessage("EC_CONFIRMED_EMAIL_HELP_LINK"));this.dialog=new c.Popup(this.id,null,{overlay:{opacity:10},autoHide:true,width:this.WIDTH,closeByEsc:true,zIndex:this.Z_INDEX,offsetLeft:0,offsetTop:0,draggable:true,bindOnResize:false,titleBar:u.Loc.getMessage("EC_CONFIRMED_EMAIL_TITLE"),closeIcon:{right:"12px",top:"10px"},className:"confirmemail-popup-window",content:this.DOM.content,events:{},cacheable:false,buttons:[new BX.UI.Button({text:u.Loc.getMessage("EC_CONFIRMED_EMAIL_SEND"),className:"ui-btn ui-btn-primary ".concat(BX.UI.Button.State.DISABLED),events:{click:function e(){if(t.DOM.select.value&&t.DOM.select.value!=="add"){var i=r.Util.getUserSettings();i.sendFromEmail=t.emailSelectorControl.getValue();r.Util.setUserSettings(i);BX.userOptions.save("calendar","user_settings","sendFromEmail",i.sendFromEmail);t.emit("onSelect",new o.BaseEvent({data:{sendFromEmail:i.sendFromEmail}}));t.close()}}}}),new BX.UI.Button({text:u.Loc.getMessage("EC_SEC_SLIDER_CANCEL"),className:"ui-btn ui-btn-light-border",events:{click:this.close.bind(this)}})]});this.DOM.processButton=this.dialog.buttons[0].button;this.DOM.select=this.DOM.content.querySelector("select.calendar-field-select");u.Dom.addClass(this.DOM.select,BX.UI.Button.State.CLOCKING);this.DOM.select.disabled=true;this.emailSelectorControl=new d.EmailSelectorControl({selectNode:this.DOM.select,allowAddNewEmail:true});u.Event.bind(this.DOM.select,"change",this.handleSelectChanges.bind(this));this.emailSelectorControl.subscribe("onSetValue",this.handleSelectChanges.bind(this));this.emailSelectorControl.loadMailboxData().then((function(){t.emailSelectorControl.setValue(r.Util.getUserSettings().sendFromEmail);t.DOM.select.disabled=false;t.DOM.select.className="calendar-field calendar-field-select"}));this.DOM.helpLinlk=this.DOM.content.querySelector(".calendar-confirm-email-help-link");u.Event.bind(this.DOM.helpLinlk,"click",this.openHelpSlider.bind(this));this.dialog.show()}},{key:"close",value:function e(){if(this.dialog){this.dialog.close()}}},{key:"handleSelectChanges",value:function e(){if(this.DOM.select.value&&this.DOM.select.value!=="add"){u.Dom.removeClass(this.DOM.processButton,BX.UI.Button.State.DISABLED)}else{u.Dom.addClass(this.DOM.processButton,BX.UI.Button.State.DISABLED)}}},{key:"openHelpSlider",value:function e(){if(BX.Helper){BX.Helper.show("redirect=detail&code=12070142",{zIndex:this.SLIDER_Z_INDEX})}}}]);return t}(o.EventEmitter);var _e;var Ne=function(e){babelHelpers.inherits(t,e);function t(){var e;babelHelpers.classCallCheck(this,t);e=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this));babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"Z_INDEX",3200);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"EXPAND_LICENSE_URL","/settings/license_all.php");babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"WIDTH",480);babelHelpers.defineProperty(babelHelpers.assertThisInitialized(e),"DOM",{});e.setEventNamespace("BX.Calendar.Controls.EmailLimitationDialog");e.id="email-limitation-dialog-"+Math.round(Math.random()*1e4);return e}babelHelpers.createClass(t,[{key:"show",value:function e(){var t=this;var i=r.Util.getEventWithEmailGuestAmount();var a=r.Util.isEventWithEmailGuestAllowed();if(i===4){this.text=u.Loc.getMessage("EC_EMAIL_LIMIT_5")}else if(i===8){this.text=u.Loc.getMessage("EC_EMAIL_LIMIT_9")}else{this.text=u.Loc.getMessage("EC_EMAIL_LIMIT_DENY")}this.subText=u.Loc.getMessage("EC_EMAIL_LIMIT_SUBTEXT");this.DOM.content=u.Tag.render(_e||(_e=babelHelpers.taggedTemplateLiteral(['<div>\n\t\t\t<div class="calendar-email-limit-text">','</div>\n\t\t\t<div class="calendar-email-limit-subtext">',"</div>\n\t\t</div>"])),this.text,this.subText);this.dialog=this.getDialogPopup();this.dialog.subscribe("onClose",(function(){t.emit("onClose")}));this.dialog.show()}},{key:"getDialogPopup",value:function e(){var t=this;return new c.Popup(this.id,null,{overlay:{opacity:10},autoHide:true,width:this.WIDTH,closeByEsc:true,zIndex:this.Z_INDEX,offsetLeft:0,offsetTop:0,draggable:true,bindOnResize:false,titleBar:u.Loc.getMessage("EC_EMAIL_LIMIT_TITLE"),closeIcon:{right:"12px",top:"10px"},className:"email-limit-popup",content:this.DOM.content,events:{},cacheable:false,buttons:[new BX.UI.Button({text:u.Loc.getMessage("EC_EMAIL_LIMIT_EXPAND_PLAN"),className:"ui-btn ui-btn-primary ui-btn-icon-plan",events:{click:function e(){window.open(t.EXPAND_LICENSE_URL,"_blank")}}}),new BX.UI.Button({text:r.Util.isEventWithEmailGuestAllowed()?u.Loc.getMessage("EC_SEC_SLIDER_CLOSE"):u.Loc.getMessage("EC_EMAIL_LIMIT_SAVE_WITHOUT"),className:"ui-btn ui-btn-link",events:{click:this.close.bind(this)}})]})}},{key:"close",value:function e(){if(this.dialog){this.dialog.close()}}}]);return t}(o.EventEmitter);var He=function(){function e(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};babelHelpers.classCallCheck(this,e);this.attendeesList=i;this.node=t}babelHelpers.createClass(e,[{key:"setAttendeesList",value:function e(t){this.attendeesList=t;return this}},{key:"showPopup",value:function e(){if(this.popup){this.popup.destroy()}var t=this.getMenuItems();this.popup=this.getPopup(t);this.popup.show();this.addAvatarToMenuItems()}},{key:"addAvatarToMenuItems",value:function e(){this.popup.menuItems.forEach((function(e){var t=e.layout.item.querySelector(".menu-popup-item-icon");if(u.Type.isPlainObject(e.dataset)){t.appendChild(d.UserPlannerSelector.getUserAvatarNode(e.dataset.user))}}))}},{key:"getPopup",value:function e(t){return c.MenuManager.create("compact-event-form-attendees"+Math.round(Math.random()*1e5),this.node,t,{closeByEsc:true,autoHide:true,zIndex:this.zIndex,offsetTop:0,offsetLeft:15,angle:true,cacheable:false,className:"calendar-popup-user-menu"})}},{key:"getMenuItems",value:function e(){var t=this;var i=[];[{code:"accepted",title:u.Loc.getMessage("EC_ATTENDEES_Y_NUM")},{code:"requested",title:u.Loc.getMessage("EC_ATTENDEES_Q_NUM")},{code:"declined",title:u.Loc.getMessage("EC_ATTENDEES_N_NUM")}].forEach((function(e){var a=t.attendeesList[e.code];if(a.length>0){i.push(new c.MenuItem({text:e.title.replace("#COUNT#",a.length),delimiter:true}));a.forEach((function(e){e.toString=function(){return e.ID};i.push({text:BX.util.htmlspecialchars(e.DISPLAY_NAME),dataset:{user:e},className:"calendar-add-popup-user-menu-item",onclick:function i(){BX.SidePanel.Instance.open(e.URL,{loader:"intranet:profile",cacheable:false,allowChangeHistory:false,contentClassName:"bitrix24-profile-slider-content",width:1100});t.morePopup.close()}})}))}}));return i}}],[{key:"sortAttendees",value:function e(t){return{accepted:t.filter((function(e){return["H","Y"].includes(e.STATUS)})),requested:t.filter((function(e){return e.STATUS==="Q"||e.STATUS===""})),declined:t.filter((function(e){return e.STATUS==="N"}))}}}]);return e}();e.Reminder=M;e.Location=w;e.UserSelector=_;e.ColorSelector=B;e.SectionSelector=W;e.RepeatSelector=z;e.TimeSelector=p;e.SelectInput=F;e.PopupDialog=Y;e.ViewSelector=$;e.LineViewSelector=ee;e.AddButton=te;e.MeetingStatusControl=ie;e.ConfirmStatusDialog=ae;e.ConfirmEditDialog=se;e.ConfirmDeleteDialog=ne;e.DateTimeControl=ye;e.BusyUsersDialog=Me;e.UserPlannerSelector=Ee;e.ReinviteUserDialog=Ie;e.EmailSelectorControl=Le;e.ConfirmedEmailDialog=we;e.EmailLimitationDialog=Ne;e.AttendeesList=He})(this.BX.Calendar.Controls=this.BX.Calendar.Controls||{},BX.Calendar,BX,BX.Calendar,BX.Calendar,BX.UI.EntitySelector,BX.Intranet,BX.Event,BX.Calendar,BX,BX.Main,BX.Calendar.Controls); //# sourceMappingURL=controls.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.28 |
proxy
|
phpinfo
|
Settings