(function(){var e=function(e){var t=this;e.require().script("mvc/model").done(function(){var n=function(){var t=e.isArray,n=function(e){var t=0;for(var n in e)t++;return t},r=function(e,i,s){var o=typeof e,u=t(e);if(s===-1)return o==="object"||e===i;if(o!==typeof i||u!==t(i))return!1;if(e===i)return!0;if(u){if(e.length!==i.length)return!1;for(var a=0;a<e.length;a++)if(!r(e[a],i[a]))return!1;return!0}if(o==="object"||o==="function"){var f=0;for(var l in e){if(!r(e[l],i[l],s===!1?-1:undefined))return!1;f++}return f===n(i)}return!1},i=function(e){var t={};for(var n in e)if(typeof e[n]!="object"||e[n]===null)t[n]=e[n];return t};e.extend(e.Model.prototype,{backup:function(){return this._backupStore=this.serialize(),this},isDirty:function(e){return this._backupStore?!r(this.serialize(),this._backupStore,!!e):!1},restore:function(e){var t=e?this._backupStore:i(this._backupStore);return this.attrs(t),this}})};n(),t.resolveWith(n)})};dispatch("mvc/model.backup").containing(e).to("Foundry/2.1 Modules")})();