(function(){"use strict";function e(){}$.extend(e.prototype,{loadItem:function(e,a){var r=this;u8.request("CalendarChannel.GetItem",e,function(e,t){a(r,t.error?t:t.response)},true)},loadItems:function(e,a){var r=this;e.campaignUid=page.url.getUid();u8.request("CampaignManagementChannel.GetCampaignParticipantCalendarItems",e,function(e,t){a(r,t.error?t:t.response)})}});page.using={types:["CampaignParticipantsCalendar","CampaignParticipantsCalendarModel"]};page.onLoad=function(){u8.request("CampaignManagementChannel.GetParticipantRepIds",{campaignUid:page.url.getUid()},function(e,a){t(a)});var r=this.url;function t(t){if(t.error){return}var i=t.response;var n=r.get("FilterSet");var d=r.get("DefaultFilterSet");var u=r.get("menuName");var s=[];i.each(function(e){s.push({repId:e})});var o=new u8.Crm.RepSet({items:s,name:$t("TXT_Campaign_Designer_141"),readonly:true});var l={model:{days:r.get("days"),range:r.get("range"),view:r.get("view"),fixedFilterNames:r.getArray("fixedFilterNames"),loader:new e,defaultRepSet:o,providers:[{id:"CalendarProviders/InfoAreaId/CM",active:true},{id:"CalendarProviders/InfoAreaId/AK",active:true},{id:"CalendarProviders/InfoAreaId/MA",active:true},{id:"CalendarProviders/InfoAreaId/TD",active:true},{id:"CalendarProviders/InfoAreaId/A1",active:true},{id:"CalendarProviders/InfoAreaId/A3",active:true}]},filterSet:n,defaultFilterSet:d,settingsRecordUid:r.getUid("settingsRecord")||r.getUid()||r.getUid("saved"),parent:page,menuName:u,repSet:o,header:{showNewButton:false},isDefault:true};var g=r.getUid();if(g){l.onCreate=a.curry(g)}var p=$("#campaignParticipantsCalendar").uniqueId("campaignParticipantsCalendar",true);u8.widget("CampaignParticipantsCalendar",p,l)}};function a(e,a){var r=a.model.items;var t=r&&r.find(function(a){return a.uid&&u8.equalsRecordUid(a.uid,e)});if(t){a.model.setSelectedItems(t.id)}}})();