(function(){"use strict";var a=this;a.require(["backbone","communicator","globals","app","views/SelectionManagerView","models/SelectionModel"],function(a,b,c,d,e,f){var g=a.Marionette.Controller.extend({model:new f.SelectionModel,initialize:function(a){this.model.set("selections",[]),this.listenTo(b.mediator,"selection:changed:json",this.onSelectionChange),this.listenTo(b.mediator,"ui:open:selectionManager",this.onSelectionManagerOpen)},onSelectionChange:function(a){if(null!=a){var b=this.model.get("selections");b.push(a),this.model.set("selections",b)}else this.model.set("selections",[])},onSelectionManagerOpen:function(a){a?d.viewContent.show(new e.SelectionManagerView({model:this.model})):d.viewContent.close()}});return new g})}).call(this);