(function(){"use strict";var e=[new u8.Crm.FormatChannel({xmlName:"Mailing",formName:"letter",enabled:false}),new u8.Crm.FormatChannel({xmlName:"Email",formName:"email",enabled:false}),new u8.Crm.FormatChannel({xmlName:"SMS",formName:"sms",enabled:false}),new u8.Crm.FormatChannel({xmlName:"Fax",formName:"fax",enabled:false}),new u8.Crm.FormatChannel({xmlName:"Tel",formName:"phone",enabled:false}),new u8.Crm.FormatChannel({xmlName:"InPerson",formName:"inPerson",enabled:false})];u8.Crm.ActivityExecutionFormat=function(e){$.extend(this,e)};$.extend(u8.Crm.ActivityExecutionFormat.prototype,{getActivityExecutionFormatInfo:function(n,a){var t=this;var r=n.channel;u8.request("CampaignManagementChannel.GetActivityExecutionFormatInfo",{activityUid:n.uid},function(n,m){if(m.error){return}var o=[];m.response.selectedChannels.each(function(n){var a=t.getChannelFormName(n);o.push(a);var r=t.getChannelIndex(n);e[r].enabled=true});m.response.goDirectlyToFormatDefinition=o.indexOf(r)>-1;a(this,m.response)})},getChannelFormName:function(n){var a;$.each(e,function(e,t){if(t.xmlName===n){a=t.formName}});return a},getChannelXmlName:function(n){var a;$.each(e,function(e,t){if(t.formName===n){a=t.xmlName}});return a},getChannelIndex:function(n){for(var a=0;a<e.length;a++){if(e[a].xmlName===n||e[a].formName===n){return a}}return-1},getChannelState:function(n){var a=this.getChannelIndex(n);return a===-1?true:e[a].enabled},setChannelState:function(n,a){var t=this.getChannelIndex(n);e[t].enabled=a},getChannels:function(){return e}});u8.services.add("activityExecutionFormat",u8.Crm.ActivityExecutionFormat)})();