TeamMemberModel.Type="TeamMember";TeamMemberModel.factory=function(b){var a=new TeamMemberModel;b&&(a.Access.setProperties(b.Access),a.Read.setProperties(b.Read),a.Edit.setProperties(b.Edit),a.Create.setProperties(b.Create),a.Control.setProperties(b.Control),a.Info=MathModelReference.factory(b.ModelKey));$.modelStorage.add(a);return a};TeamMemberModel.prototype=new MathModel;
function TeamMemberModel(){this.Access=MathModelProperty.booleanPropertyFactory();this.Read=MathModelProperty.booleanPropertyFactory();this.Edit=MathModelProperty.booleanPropertyFactory();this.Create=MathModelProperty.booleanPropertyFactory();this.Control=MathModelProperty.booleanPropertyFactory();TeamMemberModel.prototype.updateAccessRules=function(){this.Access.get(!1)||(this.Read.set(!1),this.Edit.set(!1),this.Create.set(!1),this.Control.set(!1))};TeamMemberModel.prototype.updateReadRules=function(){this.Read.get(!1)?
this.Access.set(!0):(this.Edit.set(!1),this.Create.set(!1),this.Control.set(!1))};TeamMemberModel.prototype.updateEditRules=function(){this.Edit.get(!1)?(this.Access.set(!0),this.Read.set(!0)):(this.Create.set(!1),this.Control.set(!1))};TeamMemberModel.prototype.updateCreateRules=function(){this.Create.get(!1)?(this.Access.set(!0),this.Read.set(!0),this.Edit.set(!0)):this.Control.set(!1)};TeamMemberModel.prototype.updateControlRules=function(){var b=this.Control.get(!1);this.Access.set(b);this.Read.set(b);
this.Edit.set(b);this.Create.set(b)}}TeamMemberAction.MethodNames={Access:"Access",Read:"Read",Edit:"Edit",Create:"Create",Control:"Control"};TeamMemberAction.prototype=new MathAction;
function TeamMemberAction(b){this.init(b);TeamMemberAction.prototype.accessChanged=function(a,b){a.Access.load(this.ViewElement);a.updateAccessRules()};TeamMemberAction.prototype.readChanged=function(a,b){a.Read.load(this.ViewElement);a.updateReadRules()};TeamMemberAction.prototype.controlChanged=function(a,b){a.Control.load(this.ViewElement);a.updateControlRules()};TeamMemberAction.prototype.createChanged=function(a,b){a.Create.load(this.ViewElement);a.updateCreateRules()};TeamMemberAction.prototype.editChanged=
function(a,b){a.Edit.load(this.ViewElement);a.updateEditRules()};TeamMemberAction.prototype.getChangeAction=function(){var a=this.MethodKey;if(a===TeamMemberAction.MethodNames.Access)return this.accessChanged;if(a===TeamMemberAction.MethodNames.Read)return this.readChanged;if(a===TeamMemberAction.MethodNames.Control)return this.controlChanged;if(a===TeamMemberAction.MethodNames.Create)return this.createChanged;if(a==TeamMemberAction.MethodNames.Edit)return this.editChanged}}TeamEngine.prototype=new MathEngine;
function TeamEngine(){var b=this;TeamEngine.prototype.onChange=function(){var a=$(this),d,c;if(d=MathModelProperty.getPropertyName(a))if(c=MathModel.getModelElement(a),c=b.getModelFromElement(c))a=b._actionFactory({Type:MathAction.Types.Change,Model:c,MethodKey:d,ViewElement:a}),b.enqueue(a),b.execute()};TeamEngine.prototype._actionFactory=function(a){var b=void 0;(a.Model&&a.Model.Info.Type||a.ModelRef&&a.ModelRef.Type)===TeamMemberModel.Type&&(b=new TeamMemberAction(a));return b}}
(function(b){b.procedureTeams=b.procedureTeams||new TeamEngine})(jQuery);
