var __hasProp=Object.prototype.hasOwnProperty,__extends=function(a,b){function d(){this.constructor=a}for(var c in b)__hasProp.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a},__bind=function(a,b){return function(){return a.apply(b,arguments)}};define(["common/models/polling"],function(a){var b,c,d;return b=function(){function a(){a.__super__.constructor.apply(this,arguments)}return __extends(a,Backbone.Model),a.prototype.url=function(){var b;return b=a.__super__.url.apply(this,arguments),/\/$/.test(b)||(b+="/"),b},a.prototype.initialize=function(){return this.bind("change",function(){return App.hub.publish("report/change",this)})},a}(),c=function(){function c(){c.__super__.constructor.apply(this,arguments)}return __extends(c,a.Collection),c.prototype.url=App.endpoints.reports,c.prototype.model=b,c.prototype.comparator=function(a){return-Number(new Date(a.get("modified")))},c}(),d=function(){function b(){b.__super__.constructor.apply(this,arguments)}return __extends(b,a.Model),b.prototype.url=App.endpoints.session.report,b.prototype.defaults={name:"click to give your report a name...",description:"click to give your report a description..."},b.prototype.initialize=function(){return b.__super__.initialize.apply(this,arguments),App.hub.subscribe("report/clear",__bind(function(){return this.clear({silent:!0}),this.save(null,{success:function(){return window.location=App.endpoints.define}})},this)),App.hub.subscribe("report/change",__bind(function(a){if(a.id===this.get("reference_id"))return this.set(a.toJSON())},this))},b.prototype.push=function(){return this.save(null,{url:this.get("permalink"),success:function(){return App.hub.publish("report/push",this)}})},b.prototype.revert=function(){return this.save(null,{data:JSON.stringify({revert:!0}),contentType:"application/json",success:function(){return App.hub.publish("report/revert",this)}})},b}(),{Model:b,Collection:c,Session:d}})