define("backbone.es6",["underscore","backbone","backbone.controller"],function(_,Backbone){var hasNativeClassSupport=!0;try{eval("class A {}")}catch(err){hasNativeClassSupport=!1}var classes=[Backbone.View,Backbone.Model,Backbone.Collection,Backbone.Router,Backbone.History,Backbone.Controller];hasNativeClassSupport&&["View","Model","Collection","Router","History","Controller"].forEach(function(name){Backbone["_"+name]=Backbone[name],Backbone[name]=eval("class "+name+' extends Backbone["_'+name+'"] { }; '+name+";")});var getChild=function(parent,protoProps){var hasConstructor=protoProps&&_.has(protoProps,"constructor");return hasNativeClassSupport&&hasConstructor?eval("class e extends protoProps.constructor { }; e;"):hasNativeClassSupport?eval("class e extends parent { }; e;"):hasConstructor?protoProps.constructor:function(){return parent.apply(this,arguments)}},extend=function(o,e){var t=this,r=getChild(t,o);return Object.setPrototypeOf(r,t),_.extend(r,e),hasNativeClassSupport?(r.prototype={},Object.setPrototypeOf(r.prototype,t.prototype),_.extend(r.prototype,o)):r.prototype=_.create(t.prototype,o),(r.prototype.constructor=r).__super__=t.prototype,r};classes.forEach(function(o){o.extend=extend}),Backbone.Collection.prototype.model=Backbone.Model,Backbone.Collection.prototype.modelId=function(o){return o[this.model.prototype&&this.model.prototype.idAttribute||"id"]},Backbone.Collection.prototype._prepareModel=function(o,e){return this._isModel(o)?(o.collection||(o.collection=this),o):(o=((e=e?_.clone(e):{}).collection=this).model===Backbone.Model||this.model.prototype instanceof Backbone.Model?new this.model(o,e):this.model(o,e)).validationError?(this.trigger("invalid",this,o.validationError,e),!1):o}});