(function(){"use strict";u8.Crm.CampaignDesignerStatusModel=function(e){$.extend(this,u8.Crm.CampaignDesignerStatusModel.defaults,e);if(!this._getStatus()){this._saveStatus(this.defaultStatus)}if(this.rootUid.infoAreaId=="AK"){this.setSelectedVertexIds(this.defaultStatus.selectedVertexIds)}if(this.rootUid.infoAreaId=="CM"&&this.getSelectedVertexIds().length==0){this.setSelectedVertexIds(this.defaultStatus.selectedVertexIds)}this.bind()};u8.Crm.CampaignDesignerStatusModel.defaults={rootUid:"",defaultStatus:{selectedVertexIds:undefined,expandedVertices:[]}};$.extend(u8.Crm.CampaignDesignerStatusModel.prototype,{_getSessionStorageKey:function(){return"u8/crm/widgets/CampaignDesignerStatusModel/"+this.rootUid.infoAreaId+this.rootUid.recordId},_getStatus:function(){var e=this._getSessionStorageKey();var t=sessionStorage.getItem(e);var s=JSON.parse(t);return s},_saveStatus:function(e){var t=JSON.stringify(e);var s=this._getSessionStorageKey();sessionStorage.setItem(s,t)},expandVertex:function(e){var t=this._getStatus();if($.inArray(e,t.expandedVertices)>=0){return}t.expandedVertices.push(e);this._saveStatus(t)},collapseVertex:function(e){var t=this._getStatus();if($.inArray(e,t.expandedVertices)<0){return}t.expandedVertices.splice($.inArray(e,t.expandedVertices),1);this._saveStatus(t)},setSelectedVertexIds:function(e){var t=this._getStatus();t.selectedVertexIds=e;this._saveStatus(t)},vertexIsExpanded:function(e){var t=this._getStatus();return $.inArray(e,t.expandedVertices)>=0},getSelectedVertexIds:function(){var e=this._getStatus();return e.selectedVertexIds}});u8.Crm.CampaignDesignerStatusModel.makeClass({name:"CampaignDesignerStatusModel",events:[]})})();