define(["ember"],function(a){return a.Component.extend({classNames:["bauble-checkbox"],classNameBindings:["styleClass","checkedClass"],multiple:!1,first:!1,checkedClass:function(){return this.get("checked")?"checked":""}.property("checked"),check:function(a){this.get("targetClass")&&-1==a.originalEvent.target.className.indexOf(this.get("targetClass"))||(-1==this.get("checkedSet").indexOf(this.get("model"))?(this.get("multiple")||this.get("checkedSet").clear(),this.get("checkedSet").addObject(this.get("model"))):this.get("multiple")&&this.get("checkedSet").removeObject(this.get("model")))}.on("click"),checked:function(){return this.get("checkedSet")?-1!==this.get("checkedSet").indexOf(this.get("model")):!1}.property("checkedSet.@each"),selectFirst:function(){this.get("first")&&0==this.get("checkedSet.length")&&this.get("checkedSet").addObject(this.get("model"))}.on("didInsertElement"),unregister:function(){this.get("checkedSet")&&this.get("checkedSet").removeObject(this.get("model"))}.on("willDestroyElement")})});