(function(){"use strict";u8.Crm.RepUser=function(t){$.extend(this,t);if(this.type===1){this.type="Group"}else if(this.type===2){this.type="Resource"}else{this.type="Rep"}};$.extend(u8.Crm.RepUser.prototype,{isGroup:function(){return this.type=="Group"},isResource:function(){return this.type=="Resource"},isRep:function(){return this.type=="Rep"},getSuperior:function(){if(!this.superiorId){return null}return this._reps.get(this.superiorId)},getLeader:function(){if(!this.leaderId){return null}return this._reps.get(this.leaderId)},getDeputy:function(){if(!this.deputyId){return null}return this._reps.get(this.deputyId)},getGroup:function(){if(!this.orgGroupId){return null}return this._reps.get(this.orgGroupId)},isLocked:function(){return this.inactive},getMembers:function(t){this._reps.getGroupMembers(this.repId,"!Group",t)},getSubordinates:function(t){this._reps.getSubordinates(this.repId,t)},getSuperiorsIds:function(){return this._reps.getSuperiorsIds()},clone:function(){var t=new u8.Crm.RepUser;for(var e in this){if(this.hasOwnProperty(e)){t[e]=this[e]}}return t},_addSubordinate:function(t){if(!this._subordinates){this._subordinates={}}this._subordinates[t.repId]=t}})})();