dist/ember-spade.js in ember-source-1.2.0.beta.2 vs dist/ember-spade.js in ember-source-1.2.0.beta.3
- old
+ new
@@ -6,11 +6,11 @@
// License: Licensed under MIT license
// See https://raw.github.com/emberjs/ember.js/master/LICENSE
// ==========================================================================
- // Version: 1.2.0-beta.2
+ // Version: 1.2.0-beta.3
var define, requireModule;
(function() {
var registry = {}, seen = {};
@@ -45,6 +45,6 @@
var value = callback.apply(this, reified);
return seen[name] = exports || value;
};
})();
-minispade.register('container', "(function() {/**\n@private\nPublic api for the container is still in flux.\nThe public api, specified on the application namespace should be considered the stable api.\n// @module container\n*/\n\n/*\n Flag to enable/disable model factory injections (disabled by default)\n If model factory injections are enabled, models should not be\n accessed globally (only through `container.lookupFactory('model:modelName'))`);\n*/\nEmber.MODEL_FACTORY_INJECTIONS = false || !!Ember.ENV.MODEL_FACTORY_INJECTIONS;\n\ndefine(\"container\",\n [],\n function() {\n\n // A safe and simple inheriting object.\n function InheritingDict(parent) {\n this.parent = parent;\n this.dict = {};\n }\n\n InheritingDict.prototype = {\n\n /**\n @property parent\n @type InheritingDict\n @default null\n */\n\n parent: null,\n\n /**\n Object used to store the current nodes data.\n\n @property dict\n @type Object\n @default Object\n */\n dict: null,\n\n /**\n Retrieve the value given a key, if the value is present at the current\n level use it, otherwise walk up the parent hierarchy and try again. If\n no matching key is found, return undefined.\n\n @method get\n @return {any}\n */\n get: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return dict[key];\n }\n\n if (this.parent) {\n return this.parent.get(key);\n }\n },\n\n /**\n Set the given value for the given key, at the current level.\n\n @method set\n @param {String} key\n @param {Any} value\n */\n set: function(key, value) {\n this.dict[key] = value;\n },\n\n /**\n Delete the given key\n\n @method remove\n @param {String} key\n */\n remove: function(key) {\n delete this.dict[key];\n },\n\n /**\n Check for the existence of given a key, if the key is present at the current\n level return true, otherwise walk up the parent hierarchy and try again. If\n no matching key is found, return false.\n\n @method has\n @param {String} key\n @return {Boolean}\n */\n has: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return true;\n }\n\n if (this.parent) {\n return this.parent.has(key);\n }\n\n return false;\n },\n\n /**\n Iterate and invoke a callback for each local key-value pair.\n\n @method eachLocal\n @param {Function} callback\n @param {Object} binding\n */\n eachLocal: function(callback, binding) {\n var dict = this.dict;\n\n for (var prop in dict) {\n if (dict.hasOwnProperty(prop)) {\n callback.call(binding, prop, dict[prop]);\n }\n }\n }\n };\n\n\n // A lightweight container that helps to assemble and decouple components.\n // Public api for the container is still in flux.\n // The public api, specified on the application namespace should be considered the stable api.\n function Container(parent) {\n this.parent = parent;\n this.children = [];\n\n this.resolver = parent && parent.resolver || function() {};\n\n this.registry = new InheritingDict(parent && parent.registry);\n this.cache = new InheritingDict(parent && parent.cache);\n this.factoryCache = new InheritingDict(parent && parent.cache);\n this.typeInjections = new InheritingDict(parent && parent.typeInjections);\n this.injections = {};\n\n this.factoryTypeInjections = new InheritingDict(parent && parent.factoryTypeInjections);\n this.factoryInjections = {};\n\n this._options = new InheritingDict(parent && parent._options);\n this._typeOptions = new InheritingDict(parent && parent._typeOptions);\n }\n\n Container.prototype = {\n\n /**\n @property parent\n @type Container\n @default null\n */\n parent: null,\n\n /**\n @property children\n @type Array\n @default []\n */\n children: null,\n\n /**\n @property resolver\n @type function\n */\n resolver: null,\n\n /**\n @property registry\n @type InheritingDict\n */\n registry: null,\n\n /**\n @property cache\n @type InheritingDict\n */\n cache: null,\n\n /**\n @property typeInjections\n @type InheritingDict\n */\n typeInjections: null,\n\n /**\n @property injections\n @type Object\n @default {}\n */\n injections: null,\n\n /**\n @private\n\n @property _options\n @type InheritingDict\n @default null\n */\n _options: null,\n\n /**\n @private\n\n @property _typeOptions\n @type InheritingDict\n */\n _typeOptions: null,\n\n /**\n Returns a new child of the current container. These children are configured\n to correctly inherit from the current container.\n\n @method child\n @return {Container}\n */\n child: function() {\n var container = new Container(this);\n this.children.push(container);\n return container;\n },\n\n /**\n Sets a key-value pair on the current container. If a parent container,\n has the same key, once set on a child, the parent and child will diverge\n as expected.\n\n @method set\n @param {Object} object\n @param {String} key\n @param {any} value\n */\n set: function(object, key, value) {\n object[key] = value;\n },\n\n /**\n Registers a factory for later injection.\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('model:user', Person, {singleton: false });\n container.register('fruit:favorite', Orange);\n container.register('communication:main', Email, {singleton: false});\n ```\n\n @method register\n @param {String} fullName\n @param {Function} factory\n @param {Object} options\n */\n register: function(fullName, factory, options) {\n if (fullName.indexOf(':') === -1) {\n throw new TypeError(\"malformed fullName, expected: `type:name` got: \" + fullName + \"\");\n }\n\n if (factory === undefined) {\n throw new TypeError('Attempting to register an unknown factory: `' + fullName + '`');\n }\n\n var normalizedName = this.normalize(fullName);\n\n if (this.cache.has(normalizedName)) {\n throw new Error('Cannot re-register: `' + fullName +'`, as it has already been looked up.');\n }\n\n this.registry.set(normalizedName, factory);\n this._options.set(normalizedName, options || {});\n },\n\n /**\n Unregister a fullName\n\n ```javascript\n var container = new Container();\n container.register('model:user', User);\n\n container.lookup('model:user') instanceof User //=> true\n\n container.unregister('model:user')\n container.lookup('model:user') === undefined //=> true\n ```\n\n @method unregister\n @param {String} fullName\n */\n unregister: function(fullName) {\n var normalizedName = this.normalize(fullName);\n\n this.registry.remove(normalizedName);\n this.cache.remove(normalizedName);\n this.factoryCache.remove(normalizedName);\n this._options.remove(normalizedName);\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n By default `resolve` will retrieve the factory from\n its container's registry.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n container.resolve('api:twitter') // => Twitter\n ```\n\n Optionally the container can be provided with a custom resolver.\n If provided, `resolve` will first provide the custom resolver\n the oppertunity to resolve the fullName, otherwise it will fallback\n to the registry.\n\n ```javascript\n var container = new Container();\n container.resolver = function(fullName) {\n // lookup via the module system of choice\n };\n\n // the twitter factory is added to the module system\n container.resolve('api:twitter') // => Twitter\n ```\n\n @method resolve\n @param {String} fullName\n @return {Function} fullName's factory\n */\n resolve: function(fullName) {\n return this.resolver(fullName) || this.registry.get(fullName);\n },\n\n /**\n A hook that can be used to describe how the resolver will\n attempt to find the factory.\n\n For example, the default Ember `.describe` returns the full\n class name (including namespace) where Ember's resolver expects\n to find the `fullName`.\n\n @method describe\n */\n describe: function(fullName) {\n return fullName;\n },\n\n /**\n A hook to enable custom fullName normalization behaviour\n\n @method normalize\n @param {String} fullName\n @return {string} normalized fullName\n */\n normalize: function(fullName) {\n return fullName;\n },\n\n /**\n @method makeToString\n\n @param {any} factory\n @param {string} fullName\n @return {function} toString function\n */\n makeToString: function(factory, fullName) {\n return factory.toString();\n },\n\n /**\n Given a fullName return a corresponding instance.\n\n The default behaviour is for lookup to return a singleton instance.\n The singleton is scoped to the container, allowing multiple containers\n to all have their own locally scoped singletons.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter');\n\n twitter instanceof Twitter; // => true\n\n // by default the container will return singletons\n twitter2 = container.lookup('api:twitter');\n twitter instanceof Twitter; // => true\n\n twitter === twitter2; //=> true\n ```\n\n If singletons are not wanted an optional flag can be provided at lookup.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter', { singleton: false });\n var twitter2 = container.lookup('api:twitter', { singleton: false });\n\n twitter === twitter2; //=> false\n ```\n\n @method lookup\n @param {String} fullName\n @param {Object} options\n @return {any}\n */\n lookup: function(fullName, options) {\n fullName = this.normalize(fullName);\n\n options = options || {};\n\n if (this.cache.has(fullName) && options.singleton !== false) {\n return this.cache.get(fullName);\n }\n\n var value = instantiate(this, fullName);\n\n if (value === undefined) { return; }\n\n if (isSingleton(this, fullName) && options.singleton !== false) {\n this.cache.set(fullName, value);\n }\n\n return value;\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n @method lookupFactory\n @param {String} fullName\n @return {any}\n */\n lookupFactory: function(fullName) {\n return factoryFor(this, fullName);\n },\n\n /**\n Given a fullName check if the container is aware of its factory\n or singleton instance.\n\n @method has\n @param {String} fullName\n @return {Boolean}\n */\n has: function(fullName) {\n if (this.cache.has(fullName)) {\n return true;\n }\n\n return !!factoryFor(this, fullName);\n },\n\n /**\n Allow registering options for all factories of a type.\n\n ```javascript\n var container = new Container();\n\n // if all of type `connection` must not be singletons\n container.optionsForType('connection', { singleton: false });\n\n container.register('connection:twitter', TwitterConnection);\n container.register('connection:facebook', FacebookConnection);\n\n var twitter = container.lookup('connection:twitter');\n var twitter2 = container.lookup('connection:twitter');\n\n twitter === twitter2; // => false\n\n var facebook = container.lookup('connection:facebook');\n var facebook2 = container.lookup('connection:facebook');\n\n facebook === facebook2; // => false\n ```\n\n @method optionsForType\n @param {String} type\n @param {Object} options\n */\n optionsForType: function(type, options) {\n if (this.parent) { illegalChildOperation('optionsForType'); }\n\n this._typeOptions.set(type, options);\n },\n\n /**\n @method options\n @param {String} type\n @param {Object} options\n */\n options: function(type, options) {\n this.optionsForType(type, options);\n },\n\n /**\n @private\n\n Used only via `injection`.\n\n Provides a specialized form of injection, specifically enabling\n all objects of one type to be injected with a reference to another\n object.\n\n For example, provided each object of type `controller` needed a `router`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.register('router:main', Router);\n container.register('controller:user', UserController);\n container.register('controller:post', PostController);\n\n container.typeInjection('controller', 'router', 'router:main');\n\n var user = container.lookup('controller:user');\n var post = container.lookup('controller:post');\n\n user.router instanceof Router; //=> true\n post.router instanceof Router; //=> true\n\n // both controllers share the same router\n user.router === post.router; //=> true\n ```\n\n @method typeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n typeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('typeInjection'); }\n\n addTypeInjection(this.typeInjections, type, property, fullName);\n },\n\n /**\n Defines injection rules.\n\n These rules are used to inject dependencies onto objects when they\n are instantiated.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('source:main', Source);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another fullName\n // eg. each user model gets a post model\n container.injection('model:user', 'post', 'model:post');\n\n // injecting one fullName on another type\n container.injection('model', 'source', 'source:main');\n\n var user = container.lookup('model:user');\n var post = container.lookup('model:post');\n\n user.source instanceof Source; //=> true\n post.source instanceof Source; //=> true\n\n user.post instanceof Post; //=> true\n\n // and both models share the same source\n user.source === post.source; //=> true\n ```\n\n @method injection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\n */\n injection: function(factoryName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n if (factoryName.indexOf(':') === -1) {\n return this.typeInjection(factoryName, property, injectionName);\n }\n\n addInjection(this.injections, factoryName, property, injectionName);\n },\n\n\n /**\n @private\n\n Used only via `factoryInjection`.\n\n Provides a specialized form of injection, specifically enabling\n all factory of one type to be injected with a reference to another\n object.\n\n For example, provided each factory of type `model` needed a `store`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.registerFactory('model:user', User);\n container.register('store:main', SomeStore);\n\n container.factoryTypeInjection('model', 'store', 'store:main');\n\n var store = container.lookup('store:main');\n var UserFactory = container.lookupFactory('model:user');\n\n UserFactory.store instanceof SomeStore; //=> true\n ```\n\n @method factoryTypeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n factoryTypeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('factoryTypeInjection'); }\n\n addTypeInjection(this.factoryTypeInjections, type, property, fullName);\n },\n\n /**\n Defines factory injection rules.\n\n Similar to regular injection rules, but are run against factories, via\n `Container#lookupFactory`.\n\n These rules are used to inject objects onto factories when they\n are looked up.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('store:main', Store);\n container.register('store:secondary', OtherStore);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another type\n container.factoryInjection('model', 'store', 'store:main');\n\n // injecting one fullName on another fullName\n container.factoryInjection('model:post', 'secondaryStore', 'store:secondary');\n\n var UserFactory = container.lookupFactory('model:user');\n var PostFactory = container.lookupFactory('model:post');\n var store = container.lookup('store:main');\n\n UserFactory.store instanceof Store; //=> true\n UserFactory.secondaryStore instanceof OtherStore; //=> false\n\n PostFactory.store instanceof Store; //=> true\n PostFactory.secondaryStore instanceof OtherStore; //=> true\n\n // and both models share the same source instance\n UserFactory.store === PostFactory.store; //=> true\n ```\n\n @method factoryInjection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\n */\n factoryInjection: function(factoryName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n if (factoryName.indexOf(':') === -1) {\n return this.factoryTypeInjection(factoryName, property, injectionName);\n }\n\n addInjection(this.factoryInjections, factoryName, property, injectionName);\n },\n\n /**\n A depth first traversal, destroying the container, its descendant containers and all\n their managed objects.\n\n @method destroy\n */\n destroy: function() {\n this.isDestroyed = true;\n\n for (var i=0, l=this.children.length; i<l; i++) {\n this.children[i].destroy();\n }\n\n this.children = [];\n\n eachDestroyable(this, function(item) {\n item.destroy();\n });\n\n this.parent = undefined;\n this.isDestroyed = true;\n },\n\n /**\n @method reset\n */\n reset: function() {\n for (var i=0, l=this.children.length; i<l; i++) {\n resetCache(this.children[i]);\n }\n resetCache(this);\n }\n };\n\n function illegalChildOperation(operation) {\n throw new Error(operation + \" is not currently supported on child containers\");\n }\n\n function isSingleton(container, fullName) {\n var singleton = option(container, fullName, 'singleton');\n\n return singleton !== false;\n }\n\n function buildInjections(container, injections) {\n var hash = {};\n\n if (!injections) { return hash; }\n\n var injection, lookup;\n\n for (var i=0, l=injections.length; i<l; i++) {\n injection = injections[i];\n lookup = container.lookup(injection.fullName);\n\n if (lookup !== undefined) {\n hash[injection.property] = lookup;\n } else {\n throw new Error('Attempting to inject an unknown injection: `' + injection.fullName + '`');\n }\n }\n\n return hash;\n }\n\n function option(container, fullName, optionName) {\n var options = container._options.get(fullName);\n\n if (options && options[optionName] !== undefined) {\n return options[optionName];\n }\n\n var type = fullName.split(\":\")[0];\n options = container._typeOptions.get(type);\n\n if (options) {\n return options[optionName];\n }\n }\n\n function factoryFor(container, fullName) {\n var name = container.normalize(fullName);\n var factory = container.resolve(name);\n var injectedFactory;\n var cache = container.factoryCache;\n var type = fullName.split(\":\")[0];\n\n if (factory === undefined) { return; }\n\n if (cache.has(fullName)) {\n return cache.get(fullName);\n }\n\n if (!factory || typeof factory.extend !== 'function' || (!Ember.MODEL_FACTORY_INJECTIONS && type === 'model')) {\n // TODO: think about a 'safe' merge style extension\n // for now just fallback to create time injection\n return factory;\n } else {\n\n var injections = injectionsFor(container, fullName);\n var factoryInjections = factoryInjectionsFor(container, fullName);\n\n factoryInjections._toString = container.makeToString(factory, fullName);\n\n injectedFactory = factory.extend(injections);\n injectedFactory.reopenClass(factoryInjections);\n\n cache.set(fullName, injectedFactory);\n\n return injectedFactory;\n }\n }\n\n function injectionsFor(container ,fullName) {\n var splitName = fullName.split(\":\"),\n type = splitName[0],\n injections = [];\n\n injections = injections.concat(container.typeInjections.get(type) || []);\n injections = injections.concat(container.injections[fullName] || []);\n\n injections = buildInjections(container, injections);\n injections._debugContainerKey = fullName;\n injections.container = container;\n\n return injections;\n }\n\n function factoryInjectionsFor(container, fullName) {\n var splitName = fullName.split(\":\"),\n type = splitName[0],\n factoryInjections = [];\n\n factoryInjections = factoryInjections.concat(container.factoryTypeInjections.get(type) || []);\n factoryInjections = factoryInjections.concat(container.factoryInjections[fullName] || []);\n\n factoryInjections = buildInjections(container, factoryInjections);\n factoryInjections._debugContainerKey = fullName;\n\n return factoryInjections;\n }\n\n function instantiate(container, fullName) {\n var factory = factoryFor(container, fullName);\n\n if (option(container, fullName, 'instantiate') === false) {\n return factory;\n }\n\n if (factory) {\n if (typeof factory.extend === 'function') {\n // assume the factory was extendable and is already injected\n return factory.create();\n } else {\n // assume the factory was extendable\n // to create time injections\n // TODO: support new'ing for instantiation and merge injections for pure JS Functions\n return factory.create(injectionsFor(container, fullName));\n }\n }\n }\n\n function eachDestroyable(container, callback) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n callback(value);\n });\n }\n\n function resetCache(container) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n value.destroy();\n });\n container.cache.dict = {};\n }\n\n function addTypeInjection(rules, type, property, fullName) {\n var injections = rules.get(type);\n\n if (!injections) {\n injections = [];\n rules.set(type, injections);\n }\n\n injections.push({\n property: property,\n fullName: fullName\n });\n }\n\n function addInjection(rules, factoryName, property, injectionName) {\n var injections = rules[factoryName] = rules[factoryName] || [];\n injections.push({ property: property, fullName: injectionName });\n }\n\n return Container;\n});\n\n})();\n//@ sourceURL=container");minispade.register('ember-application/ext', "(function() {minispade.require('ember-application/ext/controller');\n\n})();\n//@ sourceURL=ember-application/ext");minispade.register('ember-application/ext/controller', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nfunction verifyNeedsDependencies(controller, container, needs) {\n var dependency, i, l;\n\n for (i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency.indexOf(':') === -1) {\n dependency = \"controller:\" + dependency;\n }\n\n // Structure assert to still do verification but not string concat in production\n if (!container.has(dependency)) {\n Ember.assert(Ember.inspect(controller) + \" needs \" + dependency + \" but it does not exist\", false);\n }\n }\n}\n\n/**\n @class ControllerMixin\n @namespace Ember\n*/\nEmber.ControllerMixin.reopen({\n concatenatedProperties: ['needs'],\n\n /**\n An array of other controller objects available inside\n instances of this controller via the `controllers`\n property:\n\n For example, when you define a controller:\n\n ```javascript\n App.CommentsController = Ember.ArrayController.extend({\n needs: ['post']\n });\n ```\n\n The application's single instance of these other\n controllers are accessible by name through the\n `controllers` property:\n\n ```javascript\n this.get('controllers.post'); // instance of App.PostController\n ```\n\n This is only available for singleton controllers.\n\n @property {Array} needs\n @default []\n */\n needs: [],\n\n init: function() {\n var needs = get(this, 'needs'),\n length = get(needs, 'length');\n\n if (length > 0) {\n Ember.assert(' `' + Ember.inspect(this) + ' specifies `needs`, but does not have a container. Please ensure this controller was instantiated with a container.', this.container);\n\n verifyNeedsDependencies(this, this.container, needs);\n\n // if needs then initialize controllers proxy\n get(this, 'controllers');\n }\n\n this._super.apply(this, arguments);\n },\n\n /**\n @method controllerFor\n @see {Ember.Route#controllerFor}\n @deprecated Use `needs` instead\n */\n controllerFor: function(controllerName) {\n Ember.deprecate(\"Controller#controllerFor is deprecated, please use Controller#needs instead\");\n return Ember.controllerFor(get(this, 'container'), controllerName);\n },\n\n /**\n Stores the instances of other controllers available from within\n this controller. Any controller listed by name in the `needs`\n property will be accessible by name through this property.\n\n ```javascript\n App.CommentsController = Ember.ArrayController.extend({\n needs: ['post'],\n postTitle: function(){\n var currentPost = this.get('controllers.post'); // instance of App.PostController\n return currentPost.get('title');\n }.property('controllers.post.title')\n });\n ```\n\n @see {Ember.ControllerMixin#needs}\n @property {Object} controllers\n @default null\n */\n controllers: Ember.computed(function() {\n var controller = this;\n\n return {\n needs: get(controller, 'needs'),\n container: get(controller, 'container'),\n unknownProperty: function(controllerName) {\n var needs = this.needs,\n dependency, i, l;\n for (i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency === controllerName) {\n return this.container.lookup('controller:' + controllerName);\n }\n }\n\n var errorMessage = Ember.inspect(controller) + '#needs does not include `' + controllerName + '`. To access the ' + controllerName + ' controller from ' + Ember.inspect(controller) + ', ' + Ember.inspect(controller) + ' should have a `needs` property that is an array of the controllers it has access to.';\n throw new ReferenceError(errorMessage);\n }\n };\n }).readOnly()\n});\n\n})();\n//@ sourceURL=ember-application/ext/controller");minispade.register('ember-application', "(function() {minispade.require('ember-views');\nminispade.require('ember-routing');\nminispade.require('ember-application/system');\nminispade.require('ember-application/ext');\n\n/**\nEmber Application\n\n@module ember\n@submodule ember-application\n@requires ember-views, ember-routing\n*/\n\n})();\n//@ sourceURL=ember-application");minispade.register('ember-application/system', "(function() {minispade.require('ember-application/system/dag');\nminispade.require('ember-application/system/resolver');\nminispade.require('ember-application/system/application');\n\n})();\n//@ sourceURL=ember-application/system");minispade.register('ember-application/system/application', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nfunction DeprecatedContainer(container) {\n this._container = container;\n}\n\nDeprecatedContainer.deprecate = function(method) {\n return function() {\n var container = this._container;\n\n Ember.deprecate('Using the defaultContainer is no longer supported. [defaultContainer#' + method + '] see: http://git.io/EKPpnA', false);\n return container[method].apply(container, arguments);\n };\n};\n\nDeprecatedContainer.prototype = {\n _container: null,\n lookup: DeprecatedContainer.deprecate('lookup'),\n resolve: DeprecatedContainer.deprecate('resolve'),\n register: DeprecatedContainer.deprecate('register')\n};\n\n/**\n An instance of `Ember.Application` is the starting point for every Ember\n application. It helps to instantiate, initialize and coordinate the many\n objects that make up your app.\n\n Each Ember app has one and only one `Ember.Application` object. In fact, the\n very first thing you should do in your application is create the instance:\n\n ```javascript\n window.App = Ember.Application.create();\n ```\n\n Typically, the application object is the only global variable. All other\n classes in your app should be properties on the `Ember.Application` instance,\n which highlights its first role: a global namespace.\n\n For example, if you define a view class, it might look like this:\n\n ```javascript\n App.MyView = Ember.View.extend();\n ```\n\n By default, calling `Ember.Application.create()` will automatically initialize\n your application by calling the `Ember.Application.initialize()` method. If\n you need to delay initialization, you can call your app's `deferReadiness()`\n method. When you are ready for your app to be initialized, call its\n `advanceReadiness()` method.\n\n You can define a `ready` method on the `Ember.Application` instance, which\n will be run by Ember when the application is initialized.\n\n Because `Ember.Application` inherits from `Ember.Namespace`, any classes\n you create will have useful string representations when calling `toString()`.\n See the `Ember.Namespace` documentation for more information.\n\n While you can think of your `Ember.Application` as a container that holds the\n other classes in your application, there are several other responsibilities\n going on under-the-hood that you may want to understand.\n\n ### Event Delegation\n\n Ember uses a technique called _event delegation_. This allows the framework\n to set up a global, shared event listener instead of requiring each view to\n do it manually. For example, instead of each view registering its own\n `mousedown` listener on its associated element, Ember sets up a `mousedown`\n listener on the `body`.\n\n If a `mousedown` event occurs, Ember will look at the target of the event and\n start walking up the DOM node tree, finding corresponding views and invoking\n their `mouseDown` method as it goes.\n\n `Ember.Application` has a number of default events that it listens for, as\n well as a mapping from lowercase events to camel-cased view method names. For\n example, the `keypress` event causes the `keyPress` method on the view to be\n called, the `dblclick` event causes `doubleClick` to be called, and so on.\n\n If there is a bubbling browser event that Ember does not listen for by\n default, you can specify custom events and their corresponding view method\n names by setting the application's `customEvents` property:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the paste event\n 'paste: \"paste\"\n }\n });\n ```\n\n By default, the application sets up these event listeners on the document\n body. However, in cases where you are embedding an Ember application inside\n an existing page, you may want it to set up the listeners on an element\n inside the body.\n\n For example, if only events inside a DOM element with the ID of `ember-app`\n should be delegated, set your application's `rootElement` property:\n\n ```javascript\n window.App = Ember.Application.create({\n rootElement: '#ember-app'\n });\n ```\n\n The `rootElement` can be either a DOM element or a jQuery-compatible selector\n string. Note that *views appended to the DOM outside the root element will\n not receive events.* If you specify a custom root element, make sure you only\n append views inside it!\n\n To learn more about the advantages of event delegation and the Ember view\n layer, and a list of the event listeners that are setup by default, visit the\n [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation).\n\n ### Initializers\n\n Libraries on top of Ember can register additional initializers, like so:\n\n ```javascript\n Ember.Application.initializer({\n name: \"store\",\n\n initialize: function(container, application) {\n container.register('store:main', application.Store);\n }\n });\n ```\n\n ### Routing\n\n In addition to creating your application's router, `Ember.Application` is\n also responsible for telling the router when to start routing. Transitions\n between routes can be logged with the `LOG_TRANSITIONS` flag, and more\n detailed intra-transition logging can be logged with\n the `LOG_TRANSITIONS_INTERNAL` flag:\n\n ```javascript\n window.App = Ember.Application.create({\n LOG_TRANSITIONS: true, // basic logging of successful transitions\n LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n });\n ```\n\n By default, the router will begin trying to translate the current URL into\n application state once the browser emits the `DOMContentReady` event. If you\n need to defer routing, you can call the application's `deferReadiness()`\n method. Once routing can begin, call the `advanceReadiness()` method.\n\n If there is any setup required before routing begins, you can implement a\n `ready()` method on your app that will be invoked immediately before routing\n begins.\n ```\n\n @class Application\n @namespace Ember\n @extends Ember.Namespace\n*/\n\nvar Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin, {\n\n /**\n The root DOM element of the Application. This can be specified as an\n element or a\n [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).\n\n This is the element that will be passed to the Application's,\n `eventDispatcher`, which sets up the listeners for event delegation. Every\n view in your application should be a child of the element you specify here.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n The `Ember.EventDispatcher` responsible for delegating events to this\n application's views.\n\n The event dispatcher is created by the application at initialization time\n and sets up event listeners on the DOM element described by the\n application's `rootElement` property.\n\n See the documentation for `Ember.EventDispatcher` for more information.\n\n @property eventDispatcher\n @type Ember.EventDispatcher\n @default null\n */\n eventDispatcher: null,\n\n /**\n The DOM events for which the event dispatcher should listen.\n\n By default, the application's `Ember.EventDispatcher` listens\n for a set of standard DOM events, such as `mousedown` and\n `keyup`, and delegates them to your application's `Ember.View`\n instances.\n\n If you would like additional bubbling events to be delegated to your\n views, set your `Ember.Application`'s `customEvents` property\n to a hash containing the DOM event name as the key and the\n corresponding view method name as the value. For example:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the paste event\n 'paste: \"paste\"\n }\n });\n ```\n\n @property customEvents\n @type Object\n @default null\n */\n customEvents: null,\n\n // Start off the number of deferrals at 1. This will be\n // decremented by the Application's own `initialize` method.\n _readinessDeferrals: 1,\n\n init: function() {\n if (!this.$) { this.$ = Ember.$; }\n this.__container__ = this.buildContainer();\n\n this.Router = this.defaultRouter();\n\n this._super();\n\n this.scheduleInitialize();\n\n Ember.libraries.registerCoreLibrary('Handlebars', Ember.Handlebars.VERSION);\n Ember.libraries.registerCoreLibrary('jQuery', Ember.$().jquery);\n\n if ( Ember.LOG_VERSION ) {\n Ember.LOG_VERSION = false; // we only need to see this once per Application#init\n var maxNameLength = Math.max.apply(this, Ember.A(Ember.libraries).mapBy(\"name.length\"));\n\n Ember.debug('-------------------------------');\n Ember.libraries.each(function(name, version) {\n var spaces = new Array(maxNameLength - name.length + 1).join(\" \");\n Ember.debug([name, spaces, ' : ', version].join(\"\"));\n });\n Ember.debug('-------------------------------');\n }\n },\n\n /**\n @private\n\n Build the container for the current application.\n\n Also register a default application view in case the application\n itself does not.\n\n @method buildContainer\n @return {Ember.Container} the configured container\n */\n buildContainer: function() {\n var container = this.__container__ = Application.buildContainer(this);\n\n return container;\n },\n\n /**\n @private\n\n If the application has not opted out of routing and has not explicitly\n defined a router, supply a default router for the application author\n to configure.\n\n This allows application developers to do:\n\n ```javascript\n var App = Ember.Application.create();\n\n App.Router.map(function() {\n this.resource('posts');\n });\n ```\n\n @method defaultRouter\n @return {Ember.Router} the default router\n */\n\n defaultRouter: function() {\n if (this.Router === false) { return; }\n var container = this.__container__;\n\n if (this.Router) {\n container.unregister('router:main');\n container.register('router:main', this.Router);\n }\n\n return container.lookupFactory('router:main');\n },\n\n /**\n @private\n\n Automatically initialize the application once the DOM has\n become ready.\n\n The initialization itself is scheduled on the actions queue\n which ensures that application loading finishes before\n booting.\n\n If you are asynchronously loading code, you should call\n `deferReadiness()` to defer booting, and then call\n `advanceReadiness()` once all of your code has finished\n loading.\n\n @method scheduleInitialize\n */\n scheduleInitialize: function() {\n var self = this;\n\n if (!this.$ || this.$.isReady) {\n Ember.run.schedule('actions', self, '_initialize');\n } else {\n this.$().ready(function() {\n Ember.run(self, '_initialize');\n });\n }\n },\n\n /**\n Use this to defer readiness until some condition is true.\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n App.deferReadiness();\n\n jQuery.getJSON(\"/auth-token\", function(token) {\n App.token = token;\n App.advanceReadiness();\n });\n ```\n\n This allows you to perform asynchronous setup logic and defer\n booting your application until the setup has finished.\n\n However, if the setup requires a loading UI, it might be better\n to use the router for this purpose.\n\n @method deferReadiness\n */\n deferReadiness: function() {\n Ember.assert(\"You must call deferReadiness on an instance of Ember.Application\", this instanceof Ember.Application);\n Ember.assert(\"You cannot defer readiness since the `ready()` hook has already been called.\", this._readinessDeferrals > 0);\n this._readinessDeferrals++;\n },\n\n /**\n Call `advanceReadiness` after any asynchronous setup logic has completed.\n Each call to `deferReadiness` must be matched by a call to `advanceReadiness`\n or the application will never become ready and routing will not begin.\n\n @method advanceReadiness\n @see {Ember.Application#deferReadiness}\n */\n advanceReadiness: function() {\n Ember.assert(\"You must call advanceReadiness on an instance of Ember.Application\", this instanceof Ember.Application);\n this._readinessDeferrals--;\n\n if (this._readinessDeferrals === 0) {\n Ember.run.once(this, this.didBecomeReady);\n }\n },\n\n /**\n registers a factory for later injection\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n\n App.Person = Ember.Object.extend({});\n App.Orange = Ember.Object.extend({});\n App.Email = Ember.Object.extend({});\n App.Session = Ember.Object.create({});\n\n App.register('model:user', App.Person, {singleton: false });\n App.register('fruit:favorite', App.Orange);\n App.register('communication:main', App.Email, {singleton: false});\n App.register('session', App.Session, {instantiate: false});\n ```\n\n @method register\n @param fullName {String} type:name (e.g., 'model:user')\n @param factory {Function} (e.g., App.Person)\n @param options {String} (optional)\n **/\n register: function() {\n var container = this.__container__;\n container.register.apply(container, arguments);\n },\n /**\n defines an injection or typeInjection\n\n Example:\n\n ```javascript\n App.inject(<full_name or type>, <property name>, <full_name>)\n App.inject('model:user', 'email', 'model:email')\n App.inject('model', 'source', 'source:main')\n ```\n\n @method inject\n @param factoryNameOrType {String}\n @param property {String}\n @param injectionName {String}\n **/\n inject: function() {\n var container = this.__container__;\n container.injection.apply(container, arguments);\n },\n\n /**\n @private\n @deprecated\n\n Calling initialize manually is not supported.\n\n Please see Ember.Application#advanceReadiness and\n Ember.Application#deferReadiness.\n\n @method initialize\n **/\n initialize: function() {\n Ember.deprecate('Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and Ember.Application#deferReadiness');\n },\n /**\n @private\n\n Initialize the application. This happens automatically.\n\n Run any initializers and run the application load hook. These hooks may\n choose to defer readiness. For example, an authentication hook might want\n to defer readiness until the auth token has been retrieved.\n\n @method _initialize\n */\n _initialize: function() {\n if (this.isDestroyed) { return; }\n\n // At this point, the App.Router must already be assigned\n if (this.Router) {\n var container = this.__container__;\n container.unregister('router:main');\n container.register('router:main', this.Router);\n }\n\n this.runInitializers();\n Ember.runLoadHooks('application', this);\n\n // At this point, any initializers or load hooks that would have wanted\n // to defer readiness have fired. In general, advancing readiness here\n // will proceed to didBecomeReady.\n this.advanceReadiness();\n\n return this;\n },\n\n /**\n Reset the application. This is typically used only in tests. It cleans up\n the application in the following order:\n\n 1. Deactivate existing routes\n 2. Destroy all objects in the container\n 3. Create a new application container\n 4. Re-route to the existing url\n\n Typical Example:\n\n ```javascript\n\n var App;\n\n Ember.run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n App.reset();\n }\n });\n\n test(\"first test\", function() {\n // App is freshly reset\n });\n\n test(\"first test\", function() {\n // App is again freshly reset\n });\n ```\n\n Advanced Example:\n\n Occasionally you may want to prevent the app from initializing during\n setup. This could enable extra configuration, or enable asserting prior\n to the app becoming ready.\n\n ```javascript\n\n var App;\n\n Ember.run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n Ember.run(function() {\n App.reset();\n App.deferReadiness();\n });\n }\n });\n\n test(\"first test\", function() {\n ok(true, 'something before app is initialized');\n\n Ember.run(function() {\n App.advanceReadiness();\n });\n ok(true, 'something after app is initialized');\n });\n ```\n\n @method reset\n **/\n reset: function() {\n this._readinessDeferrals = 1;\n\n function handleReset() {\n var router = this.__container__.lookup('router:main');\n router.reset();\n\n Ember.run(this.__container__, 'destroy');\n\n this.buildContainer();\n\n Ember.run.schedule('actions', this, function() {\n this._initialize();\n });\n }\n\n Ember.run.join(this, handleReset);\n },\n\n /**\n @private\n @method runInitializers\n */\n runInitializers: function() {\n var initializers = get(this.constructor, 'initializers'),\n container = this.__container__,\n graph = new Ember.DAG(),\n namespace = this,\n name, initializer;\n\n for (name in initializers) {\n initializer = initializers[name];\n graph.addEdges(initializer.name, initializer.initialize, initializer.before, initializer.after);\n }\n\n graph.topsort(function (vertex) {\n var initializer = vertex.value;\n Ember.assert(\"No application initializer named '\"+vertex.name+\"'\", initializer);\n initializer(container, namespace);\n });\n },\n\n /**\n @private\n @method didBecomeReady\n */\n didBecomeReady: function() {\n this.setupEventDispatcher();\n this.ready(); // user hook\n this.startRouting();\n\n if (!Ember.testing) {\n // Eagerly name all classes that are already loaded\n Ember.Namespace.processAll();\n Ember.BOOTED = true;\n }\n\n this.resolve(this);\n },\n\n /**\n @private\n\n Setup up the event dispatcher to receive events on the\n application's `rootElement` with any registered\n `customEvents`.\n\n @method setupEventDispatcher\n */\n setupEventDispatcher: function() {\n var customEvents = get(this, 'customEvents'),\n rootElement = get(this, 'rootElement'),\n dispatcher = this.__container__.lookup('event_dispatcher:main');\n\n set(this, 'eventDispatcher', dispatcher);\n dispatcher.setup(customEvents, rootElement);\n },\n\n /**\n @private\n\n trigger a new call to `route` whenever the URL changes.\n If the application has a router, use it to route to the current URL, and\n\n @method startRouting\n @property router {Ember.Router}\n */\n startRouting: function() {\n var router = this.__container__.lookup('router:main');\n if (!router) { return; }\n\n router.startRouting();\n },\n\n handleURL: function(url) {\n var router = this.__container__.lookup('router:main');\n\n router.handleURL(url);\n },\n\n /**\n Called when the Application has become ready.\n The call will be delayed until the DOM has become ready.\n\n @event ready\n */\n ready: Ember.K,\n\n /**\n @deprecated Use 'Resolver' instead\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n\n @property resolver\n */\n resolver: null,\n\n /**\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n @property resolver\n */\n Resolver: null,\n\n willDestroy: function() {\n Ember.BOOTED = false;\n\n this.__container__.destroy();\n },\n\n initializer: function(options) {\n this.constructor.initializer(options);\n }\n});\n\nEmber.Application.reopenClass({\n initializers: {},\n initializer: function(initializer) {\n // If this is the first initializer being added to a subclass, we are going to reopen the class\n // to make sure we have a new `initializers` object, which extends from the parent class' using\n // prototypal inheritance. Without this, attempting to add initializers to the subclass would\n // pollute the parent class as well as other subclasses.\n if (this.superclass.initializers !== undefined && this.superclass.initializers === this.initializers) {\n this.reopenClass({\n initializers: Ember.create(this.initializers)\n });\n }\n\n Ember.assert(\"The initializer '\" + initializer.name + \"' has already been registered\", !this.initializers[initializer.name]);\n Ember.assert(\"An initializer cannot be registered with both a before and an after\", !(initializer.before && initializer.after));\n Ember.assert(\"An initializer cannot be registered without an initialize function\", Ember.canInvoke(initializer, 'initialize'));\n\n this.initializers[initializer.name] = initializer;\n },\n\n /**\n @private\n\n This creates a container with the default Ember naming conventions.\n\n It also configures the container:\n\n * registered views are created every time they are looked up (they are\n not singletons)\n * registered templates are not factories; the registered value is\n returned directly.\n * the router receives the application as its `namespace` property\n * all controllers receive the router as their `target` and `controllers`\n properties\n * all controllers receive the application as their `namespace` property\n * the application view receives the application controller as its\n `controller` property\n * the application view receives the application template as its\n `defaultTemplate` property\n\n @method buildContainer\n @static\n @param {Ember.Application} namespace the application to build the\n container for.\n @return {Ember.Container} the built container\n */\n buildContainer: function(namespace) {\n var container = new Ember.Container();\n\n Ember.Container.defaultContainer = new DeprecatedContainer(container);\n\n container.set = Ember.set;\n container.resolver = resolverFor(namespace);\n container.normalize = container.resolver.normalize;\n container.describe = container.resolver.describe;\n container.makeToString = container.resolver.makeToString;\n\n container.optionsForType('component', { singleton: false });\n container.optionsForType('view', { singleton: false });\n container.optionsForType('template', { instantiate: false });\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n container.optionsForType('helper', { instantiate: false });\n }\n\n container.register('application:main', namespace, { instantiate: false });\n\n container.register('controller:basic', Ember.Controller, { instantiate: false });\n container.register('controller:object', Ember.ObjectController, { instantiate: false });\n container.register('controller:array', Ember.ArrayController, { instantiate: false });\n container.register('route:basic', Ember.Route, { instantiate: false });\n container.register('event_dispatcher:main', Ember.EventDispatcher);\n\n container.register('router:main', Ember.Router);\n container.injection('router:main', 'namespace', 'application:main');\n\n container.injection('controller', 'target', 'router:main');\n container.injection('controller', 'namespace', 'application:main');\n\n container.injection('route', 'router', 'router:main');\n\n return container;\n }\n});\n\n/**\n @private\n\n This function defines the default lookup rules for container lookups:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after classifying the name.\n For example, `controller:post` looks up `App.PostController` by default.\n * if the default lookup fails, look for registered classes on the container\n\n This allows the application to register default injections in the container\n that could be overridden by the normal naming convention.\n\n @method resolverFor\n @param {Ember.Namespace} namespace the namespace to look for classes\n @return {*} the resolved value for a given lookup\n*/\nfunction resolverFor(namespace) {\n if (namespace.get('resolver')) {\n Ember.deprecate('Application.resolver is deprecated in favor of Application.Resolver', false);\n }\n\n var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || Ember.DefaultResolver;\n var resolver = ResolverClass.create({\n namespace: namespace\n });\n\n function resolve(fullName) {\n return resolver.resolve(fullName);\n }\n\n resolve.describe = function(fullName) {\n return resolver.lookupDescription(fullName);\n };\n\n resolve.makeToString = function(factory, fullName) {\n return resolver.makeToString(factory, fullName);\n };\n\n resolve.normalize = function(fullName) {\n if (resolver.normalize) {\n return resolver.normalize(fullName);\n } else {\n Ember.deprecate('The Resolver should now provide a \\'normalize\\' function', false);\n return fullName;\n }\n };\n\n return resolve;\n}\n\nEmber.runLoadHooks('Ember.Application', Ember.Application);\n\n})();\n//@ sourceURL=ember-application/system/application");minispade.register('ember-application/system/dag', "(function() {function visit(vertex, fn, visited, path) {\n var name = vertex.name,\n vertices = vertex.incoming,\n names = vertex.incomingNames,\n len = names.length,\n i;\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n}\n\nfunction DAG() {\n this.names = [];\n this.vertices = {};\n}\n\nDAG.prototype.add = function(name) {\n if (!name) { return; }\n if (this.vertices.hasOwnProperty(name)) {\n return this.vertices[name];\n }\n var vertex = {\n name: name, incoming: {}, incomingNames: [], hasOutgoing: false, value: null\n };\n this.vertices[name] = vertex;\n this.names.push(name);\n return vertex;\n};\n\nDAG.prototype.map = function(name, value) {\n this.add(name).value = value;\n};\n\nDAG.prototype.addEdge = function(fromName, toName) {\n if (!fromName || !toName || fromName === toName) {\n return;\n }\n var from = this.add(fromName), to = this.add(toName);\n if (to.incoming.hasOwnProperty(fromName)) {\n return;\n }\n function checkCycle(vertex, path) {\n if (vertex.name === toName) {\n throw new Ember.Error(\"cycle detected: \" + toName + \" <- \" + path.join(\" <- \"));\n }\n }\n visit(from, checkCycle);\n from.hasOutgoing = true;\n to.incoming[fromName] = from;\n to.incomingNames.push(fromName);\n};\n\nDAG.prototype.topsort = function(fn) {\n var visited = {},\n vertices = this.vertices,\n names = this.names,\n len = names.length,\n i, vertex;\n for (i = 0; i < len; i++) {\n vertex = vertices[names[i]];\n if (!vertex.hasOutgoing) {\n visit(vertex, fn, visited);\n }\n }\n};\n\nDAG.prototype.addEdges = function(name, value, before, after) {\n var i;\n this.map(name, value);\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n for (i = 0; i < before.length; i++) {\n this.addEdge(name, before[i]);\n }\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n for (i = 0; i < after.length; i++) {\n this.addEdge(after[i], name);\n }\n }\n }\n};\n\nEmber.DAG = DAG;\n\n})();\n//@ sourceURL=ember-application/system/dag");minispade.register('ember-application/system/resolver', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get,\n classify = Ember.String.classify,\n capitalize = Ember.String.capitalize,\n decamelize = Ember.String.decamelize;\n\n/**\n The DefaultResolver defines the default lookup rules to resolve\n container lookups before consulting the container for registered\n items:\n\n* templates are looked up on `Ember.TEMPLATES`\n* other names are looked up on the application after converting\n the name. For example, `controller:post` looks up\n `App.PostController` by default.\n* there are some nuances (see examples below)\n\n ### How Resolving Works\n\n The container calls this object's `resolve` method with the\n `fullName` argument.\n\n It first parses the fullName into an object using `parseName`.\n\n Then it checks for the presence of a type-specific instance\n method of the form `resolve[Type]` and calls it if it exists.\n For example if it was resolving 'template:post', it would call\n the `resolveTemplate` method.\n\n Its last resort is to call the `resolveOther` method.\n\n The methods of this object are designed to be easy to override\n in a subclass. For example, you could enhance how a template\n is resolved like so:\n\n ```javascript\n App = Ember.Application.create({\n Resolver: Ember.DefaultResolver.extend({\n resolveTemplate: function(parsedName) {\n var resolvedTemplate = this._super(parsedName);\n if (resolvedTemplate) { return resolvedTemplate; }\n return Ember.TEMPLATES['not_found'];\n }\n })\n });\n ```\n\n Some examples of how names are resolved:\n\n ```\n 'template:post' //=> Ember.TEMPLATES['post']\n 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:blogPost' //=> Ember.TEMPLATES['blogPost']\n // OR\n // Ember.TEMPLATES['blog_post']\n 'controller:post' //=> App.PostController\n 'controller:posts.index' //=> App.PostsIndexController\n 'controller:blog/post' //=> Blog.PostController\n 'controller:basic' //=> Ember.Controller\n 'route:post' //=> App.PostRoute\n 'route:posts.index' //=> App.PostsIndexRoute\n 'route:blog/post' //=> Blog.PostRoute\n 'route:basic' //=> Ember.Route\n 'view:post' //=> App.PostView\n 'view:posts.index' //=> App.PostsIndexView\n 'view:blog/post' //=> Blog.PostView\n 'view:basic' //=> Ember.View\n 'foo:post' //=> App.PostFoo\n 'model:post' //=> App.Post\n ```\n\n @class DefaultResolver\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.DefaultResolver = Ember.Object.extend({\n /**\n This will be set to the Application instance when it is\n created.\n\n @property namespace\n */\n namespace: null,\n\n normalize: function(fullName) {\n var split = fullName.split(':', 2),\n type = split[0],\n name = split[1];\n\n Ember.assert(\"Tried to normalize a container name without a colon (:) in it. You probably tried to lookup a name that did not contain a type, a colon, and a name. A proper lookup name would be `view:post`.\", split.length === 2);\n\n if (type !== 'template') {\n var result = name;\n\n if (result.indexOf('.') > -1) {\n result = result.replace(/\\.(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n if (name.indexOf('_') > -1) {\n result = result.replace(/_(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n return type + ':' + result;\n } else {\n return fullName;\n }\n },\n\n\n /**\n This method is called via the container's resolver method.\n It parses the provided `fullName` and then looks up and\n returns the appropriate template or class.\n\n @method resolve\n @param {String} fullName the lookup string\n @return {Object} the resolved factory\n */\n resolve: function(fullName) {\n var parsedName = this.parseName(fullName),\n typeSpecificResolveMethod = this[parsedName.resolveMethodName];\n\n if (!parsedName.name || !parsedName.type) {\n throw new TypeError(\"Invalid fullName: `\" + fullName + \"`, must of of the form `type:name` \");\n }\n\n if (typeSpecificResolveMethod) {\n var resolved = typeSpecificResolveMethod.call(this, parsedName);\n if (resolved) { return resolved; }\n }\n return this.resolveOther(parsedName);\n },\n /**\n Convert the string name of the form \"type:name\" to\n a Javascript object with the parsed aspects of the name\n broken out.\n\n @protected\n @param {String} fullName the lookup string\n @method parseName\n */\n parseName: function(fullName) {\n var nameParts = fullName.split(\":\"),\n type = nameParts[0], fullNameWithoutType = nameParts[1],\n name = fullNameWithoutType,\n namespace = get(this, 'namespace'),\n root = namespace;\n\n if (type !== 'template' && name.indexOf('/') !== -1) {\n var parts = name.split('/');\n name = parts[parts.length - 1];\n var namespaceName = capitalize(parts.slice(0, -1).join('.'));\n root = Ember.Namespace.byName(namespaceName);\n\n Ember.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root);\n }\n\n return {\n fullName: fullName,\n type: type,\n fullNameWithoutType: fullNameWithoutType,\n name: name,\n root: root,\n resolveMethodName: \"resolve\" + classify(type)\n };\n },\n /**\n Look up the template in Ember.TEMPLATES\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveTemplate\n */\n resolveTemplate: function(parsedName) {\n var templateName = parsedName.fullNameWithoutType.replace(/\\./g, '/');\n\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n\n templateName = decamelize(templateName);\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n },\n /**\n Given a parseName object (output from `parseName`), apply\n the conventions expected by `Ember.Router`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method useRouterNaming\n */\n useRouterNaming: function(parsedName) {\n parsedName.name = parsedName.name.replace(/\\./g, '_');\n if (parsedName.name === 'basic') {\n parsedName.name = '';\n }\n },\n /**\n Lookup the controller using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveController\n */\n resolveController: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the route using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveRoute\n */\n resolveRoute: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the view using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveView\n */\n resolveView: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n\n resolveHelper: function(parsedName) {\n return this.resolveOther(parsedName) || Ember.Handlebars.helpers[parsedName.fullNameWithoutType];\n },\n\n /**\n Lookup the model on the Application namespace\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveModel\n */\n resolveModel: function(parsedName) {\n var className = classify(parsedName.name),\n factory = get(parsedName.root, className);\n\n if (factory) { return factory; }\n },\n /**\n Look up the specified object (from parsedName) on the appropriate\n namespace (usually on the Application)\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveOther\n */\n resolveOther: function(parsedName) {\n var className = classify(parsedName.name) + classify(parsedName.type),\n factory = get(parsedName.root, className);\n if (factory) { return factory; }\n },\n\n /**\n Returns a human-readable description for a fullName. Used by the\n Application namespace in assertions to describe the\n precise name of the class that Ember is looking for, rather than\n container keys.\n\n @protected\n @param {String} fullName the lookup string\n @method lookupDescription\n */\n lookupDescription: function(fullName) {\n var parsedName = this.parseName(fullName);\n\n if (parsedName.type === 'template') {\n return \"template at \" + parsedName.fullNameWithoutType.replace(/\\./g, '/');\n }\n\n var description = parsedName.root + \".\" + classify(parsedName.name);\n if (parsedName.type !== 'model') { description += classify(parsedName.type); }\n\n return description;\n },\n\n makeToString: function(factory, fullName) {\n return factory.toString();\n }\n});\n\n})();\n//@ sourceURL=ember-application/system/resolver");minispade.register('ember-debug', "(function() {/*global __fail__*/\n\n/**\nEmber Debug\n\n@module ember\n@submodule ember-debug\n*/\n\n/**\n@class Ember\n*/\n\nif ('undefined' === typeof Ember) {\n Ember = {};\n\n if ('undefined' !== typeof window) {\n window.Em = window.Ember = Em = Ember;\n }\n}\n\nEmber.ENV = 'undefined' === typeof ENV ? {} : ENV;\n\nif (!('MANDATORY_SETTER' in Ember.ENV)) {\n Ember.ENV.MANDATORY_SETTER = true; // default to true for debug dist\n}\n\n/**\n Define an assertion that will throw an exception if the condition is not\n met. Ember build tools will remove any calls to `Ember.assert()` when\n doing a production build. Example:\n\n ```javascript\n // Test for truthiness\n Ember.assert('Must pass a valid object', obj);\n // Fail unconditionally\n Ember.assert('This code path should never be run')\n ```\n\n @method assert\n @param {String} desc A description of the assertion. This will become\n the text of the Error thrown if the assertion fails.\n @param {Boolean} test Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.\n*/\nEmber.assert = function(desc, test) {\n if (!test) {\n Ember.Logger.assert(test, desc);\n }\n\n if (Ember.testing && !test) {\n // when testing, ensure test failures when assertions fail\n throw new Ember.Error(\"Assertion Failed: \" + desc);\n }\n};\n\n\n/**\n Display a warning with the provided message. Ember build tools will\n remove any calls to `Ember.warn()` when doing a production build.\n\n @method warn\n @param {String} message A warning to display.\n @param {Boolean} test An optional boolean. If falsy, the warning\n will be displayed.\n*/\nEmber.warn = function(message, test) {\n if (!test) {\n Ember.Logger.warn(\"WARNING: \"+message);\n if ('trace' in Ember.Logger) Ember.Logger.trace();\n }\n};\n\n/**\n Display a debug notice. Ember build tools will remove any calls to\n `Ember.debug()` when doing a production build.\n\n ```javascript\n Ember.debug(\"I'm a debug notice!\");\n ```\n\n @method debug\n @param {String} message A debug message to display.\n*/\nEmber.debug = function(message) {\n Ember.Logger.debug(\"DEBUG: \"+message);\n};\n\n/**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only). Ember build tools will remove any calls to\n `Ember.deprecate()` when doing a production build.\n\n @method deprecate\n @param {String} message A description of the deprecation.\n @param {Boolean} test An optional boolean. If falsy, the deprecation\n will be displayed.\n*/\nEmber.deprecate = function(message, test) {\n if (Ember.TESTING_DEPRECATION) { return; }\n\n if (arguments.length === 1) { test = false; }\n if (test) { return; }\n\n if (Ember.ENV.RAISE_ON_DEPRECATION) { throw new Ember.Error(message); }\n\n var error;\n\n // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome\n try { __fail__.fail(); } catch (e) { error = e; }\n\n if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {\n var stack, stackStr = '';\n if (error['arguments']) {\n // Chrome\n stack = error.stack.replace(/^\\s+at\\s+/gm, '').\n replace(/^([^\\(]+?)([\\n$])/gm, '{anonymous}($1)$2').\n replace(/^Object.<anonymous>\\s*\\(([^\\)]+)\\)/gm, '{anonymous}($1)').split('\\n');\n stack.shift();\n } else {\n // Firefox\n stack = error.stack.replace(/(?:\\n@:0)?\\s+$/m, '').\n replace(/^\\(/gm, '{anonymous}(').split('\\n');\n }\n\n stackStr = \"\\n \" + stack.slice(2).join(\"\\n \");\n message = message + stackStr;\n }\n\n Ember.Logger.warn(\"DEPRECATION: \"+message);\n};\n\n\n\n/**\n Alias an old, deprecated method with its new counterpart.\n\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only) when the assigned method is called.\n\n Ember build tools will not remove calls to `Ember.deprecateFunc()`, though\n no warnings will be shown in production.\n\n ```javascript\n Ember.oldMethod = Ember.deprecateFunc(\"Please use the new, updated method\", Ember.newMethod);\n ```\n\n @method deprecateFunc\n @param {String} message A description of the deprecation.\n @param {Function} func The new function called to replace its deprecated counterpart.\n @return {Function} a new function that wrapped the original function with a deprecation warning\n*/\nEmber.deprecateFunc = function(message, func) {\n return function() {\n Ember.deprecate(message);\n return func.apply(this, arguments);\n };\n};\n\n\n// Inform the developer about the Ember Inspector if not installed.\nif (!Ember.testing) {\n if (typeof window !== 'undefined' && window.chrome && window.addEventListener) {\n window.addEventListener(\"load\", function() {\n if (document.body && document.body.dataset && !document.body.dataset.emberExtension) {\n Ember.debug('For more advanced debugging, install the Ember Inspector from https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi');\n }\n }, false);\n }\n}\n\n})();\n//@ sourceURL=ember-debug");minispade.register('ember-extension-support/data_adapter', "(function() {/**\n@module ember\n@submodule ember-extension-support\n*/\nminispade.require('ember-application');\n\n/**\n The `DataAdapter` helps a data persistence library\n interface with tools that debug Ember such\n as the Chrome Ember Extension.\n\n This class will be extended by a persistence library\n which will override some of the methods with\n library-specific code.\n\n The methods likely to be overriden are\n `getFilters`, `detect`, `columnsForType`,\n `getRecords`, `getRecordColumnValues`,\n `getRecordKeywords`, `getRecordFilterValues`,\n `getRecordColor`, `observeRecord`\n\n The adapter will need to be registered\n in the application's container as `dataAdapter:main`\n\n Example:\n ```javascript\n Application.initializer({\n name: \"dataAdapter\",\n\n initialize: function(container, application) {\n application.register('dataAdapter:main', DS.DataAdapter);\n }\n });\n ```\n\n @class DataAdapter\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.DataAdapter = Ember.Object.extend({\n init: function() {\n this._super();\n this.releaseMethods = Ember.A();\n },\n\n /**\n The container of the application being debugged.\n This property will be injected\n on creation.\n */\n container: null,\n\n /**\n @private\n\n Number of attributes to send\n as columns. (Enough to make the record\n identifiable).\n */\n attributeLimit: 3,\n\n /**\n @private\n\n Stores all methods that clear observers.\n These methods will be called on destruction.\n */\n releaseMethods: Ember.A(),\n\n /**\n @public\n\n Specifies how records can be filtered.\n Records returned will need to have a `filterValues`\n property with a key for every name in the returned array.\n\n @method getFilters\n @return {Array} List of objects defining filters.\n The object should have a `name` and `desc` property.\n */\n getFilters: function() {\n return Ember.A();\n },\n\n /**\n @public\n\n Fetch the model types and observe them for changes.\n\n @method watchModelTypes\n\n @param {Function} typesAdded Callback to call to add types.\n Takes an array of objects containing wrapped types (returned from `wrapModelType`).\n\n @param {Function} typesUpdated Callback to call when a type has changed.\n Takes an array of objects containing wrapped types.\n\n @return {Function} Method to call to remove all observers\n */\n watchModelTypes: function(typesAdded, typesUpdated) {\n var modelTypes = this.getModelTypes(),\n self = this, typesToSend, releaseMethods = Ember.A();\n\n typesToSend = modelTypes.map(function(type) {\n var wrapped = self.wrapModelType(type);\n releaseMethods.push(self.observeModelType(type, typesUpdated));\n return wrapped;\n });\n\n typesAdded(typesToSend);\n\n var release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n self.releaseMethods.removeObject(release);\n };\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n /**\n @public\n\n Fetch the records of a given type and observe them for changes.\n\n @method watchRecords\n\n @param {Function} recordsAdded Callback to call to add records.\n Takes an array of objects containing wrapped records.\n The object should have the following properties:\n columnValues: {Object} key and value of a table cell\n object: {Object} the actual record object\n\n @param {Function} recordsUpdated Callback to call when a record has changed.\n Takes an array of objects containing wrapped records.\n\n @param {Function} recordsRemoved Callback to call when a record has removed.\n Takes the following parameters:\n index: the array index where the records were removed\n count: the number of records removed\n\n @return {Function} Method to call to remove all observers\n */\n watchRecords: function(type, recordsAdded, recordsUpdated, recordsRemoved) {\n var self = this, releaseMethods = Ember.A(), records = this.getRecords(type), release;\n\n var recordUpdated = function(updatedRecord) {\n recordsUpdated([updatedRecord]);\n };\n\n var recordsToSend = records.map(function(record) {\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n return self.wrapRecord(record);\n });\n\n\n var contentDidChange = function(array, idx, removedCount, addedCount) {\n for (var i = idx; i < idx + addedCount; i++) {\n var record = array.objectAt(i);\n var wrapped = self.wrapRecord(record);\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n recordsAdded([wrapped]);\n }\n\n if (removedCount) {\n recordsRemoved(idx, removedCount);\n }\n };\n\n var observer = { didChange: contentDidChange, willChange: Ember.K };\n records.addArrayObserver(self, observer);\n\n release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n records.removeArrayObserver(self, observer);\n self.releaseMethods.removeObject(release);\n };\n\n recordsAdded(recordsToSend);\n\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n /**\n @private\n\n Clear all observers before destruction\n */\n willDestroy: function() {\n this._super();\n this.releaseMethods.forEach(function(fn) {\n fn();\n });\n },\n\n /**\n @private\n\n Detect whether a class is a model.\n\n Test that against the model class\n of your persistence library\n\n @method detect\n @param {Class} klass The class to test\n @return boolean Whether the class is a model class or not\n */\n detect: function(klass) {\n return false;\n },\n\n /**\n @private\n\n Get the columns for a given model type.\n\n @method columnsForType\n @param {Class} type The model type\n @return {Array} An array of columns of the following format:\n name: {String} name of the column\n desc: {String} Humanized description (what would show in a table column name)\n */\n columnsForType: function(type) {\n return Ember.A();\n },\n\n /**\n @private\n\n Adds observers to a model type class.\n\n @method observeModelType\n @param {Class} type The model type class\n @param {Function} typesUpdated Called when a type is modified.\n @return {Function} The function to call to remove observers\n */\n\n observeModelType: function(type, typesUpdated) {\n var self = this, records = this.getRecords(type);\n\n var onChange = function() {\n typesUpdated([self.wrapModelType(type)]);\n };\n var observer = {\n didChange: function() {\n Ember.run.scheduleOnce('actions', this, onChange);\n },\n willChange: Ember.K\n };\n\n records.addArrayObserver(this, observer);\n\n var release = function() {\n records.removeArrayObserver(self, observer);\n };\n\n return release;\n },\n\n\n /**\n @private\n\n Wraps a given model type and observes changes to it.\n\n @method wrapModelType\n @param {Class} type A model class\n @param {Function} typesUpdated callback to call when the type changes\n @return {Object} contains the wrapped type and the function to remove observers\n Format:\n type: {Object} the wrapped type\n The wrapped type has the following format:\n name: {String} name of the type\n count: {Integer} number of records available\n columns: {Columns} array of columns to describe the record\n object: {Class} the actual Model type class\n release: {Function} The function to remove observers\n */\n wrapModelType: function(type, typesUpdated) {\n var release, records = this.getRecords(type),\n typeToSend, self = this;\n\n typeToSend = {\n name: type.toString(),\n count: Ember.get(records, 'length'),\n columns: this.columnsForType(type),\n object: type\n };\n\n\n return typeToSend;\n },\n\n\n /**\n @private\n\n Fetches all models defined in the application.\n TODO: Use the resolver instead of looping over namespaces.\n\n @method getModelTypes\n @return {Array} Array of model types\n */\n getModelTypes: function() {\n var namespaces = Ember.A(Ember.Namespace.NAMESPACES), types = Ember.A(), self = this;\n\n namespaces.forEach(function(namespace) {\n for (var key in namespace) {\n if (!namespace.hasOwnProperty(key)) { continue; }\n var klass = namespace[key];\n if (self.detect(klass)) {\n types.push(klass);\n }\n }\n });\n return types;\n },\n\n /**\n @private\n\n Fetches all loaded records for a given type.\n\n @method getRecords\n @return {Array} array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.\n */\n getRecords: function(type) {\n return Ember.A();\n },\n\n /**\n @private\n\n Wraps a record and observers changes to it\n\n @method wrapRecord\n @param {Object} record The record instance\n @return {Object} the wrapped record. Format:\n columnValues: {Array}\n searchKeywords: {Array}\n */\n wrapRecord: function(record) {\n var recordToSend = { object: record }, columnValues = {}, self = this;\n\n recordToSend.columnValues = this.getRecordColumnValues(record);\n recordToSend.searchKeywords = this.getRecordKeywords(record);\n recordToSend.filterValues = this.getRecordFilterValues(record);\n recordToSend.color = this.getRecordColor(record);\n\n return recordToSend;\n },\n\n /**\n @private\n\n Gets the values for each column.\n\n @method getRecordColumnValues\n @return {Object} Keys should match column names defined\n by the model type.\n */\n getRecordColumnValues: function(record) {\n return {};\n },\n\n /**\n @private\n\n Returns keywords to match when searching records.\n\n @method getRecordKeywords\n @return {Array} Relevant keywords for search.\n */\n getRecordKeywords: function(record) {\n return Ember.A();\n },\n\n /**\n @private\n\n Returns the values of filters defined by `getFilters`.\n\n @method getRecordFilterValues\n @param {Object} record The record instance\n @return {Object} The filter values\n */\n getRecordFilterValues: function(record) {\n return {};\n },\n\n /**\n @private\n\n Each record can have a color that represents its state.\n\n @method getRecordColor\n @param {Object} record The record instance\n @return {String} The record's color\n Possible options: black, red, blue, green\n */\n getRecordColor: function(record) {\n return null;\n },\n\n /**\n @private\n\n Observes all relevant properties and re-sends the wrapped record\n when a change occurs.\n\n @method observerRecord\n @param {Object} record The record instance\n @param {Function} recordUpdated The callback to call when a record is updated.\n @return {Function} The function to call to remove all observers.\n */\n observeRecord: function(record, recordUpdated) {\n return function(){};\n }\n\n});\n\n\n})();\n//@ sourceURL=ember-extension-support/data_adapter");minispade.register('ember-extension-support', "(function() {/**\nEmber Extension Support\n\n@module ember\n@submodule ember-extension-support\n@requires ember-application\n*/\nminispade.require('ember-extension-support/data_adapter');\n\n})();\n//@ sourceURL=ember-extension-support");minispade.register('ember-handlebars-compiler', "(function() {/**\n@module ember\n@submodule ember-handlebars-compiler\n*/\n\n// Eliminate dependency on any Ember to simplify precompilation workflow\nvar objectCreate = Object.create || function(parent) {\n function F() {}\n F.prototype = parent;\n return new F();\n};\n\nvar Handlebars = this.Handlebars || (Ember.imports && Ember.imports.Handlebars);\nif (!Handlebars && typeof require === 'function') {\n Handlebars = require('handlebars');\n}\n\nEmber.assert(\"Ember Handlebars requires Handlebars version 1.0.0. Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before you link to Ember.\", Handlebars);\nEmber.assert(\"Ember Handlebars requires Handlebars version 1.0.0, COMPILER_REVISION expected: 4, got: \" + Handlebars.COMPILER_REVISION + \" - Please note: Builds of master may have other COMPILER_REVISION values.\", Handlebars.COMPILER_REVISION === 4);\n\n/**\n Prepares the Handlebars templating library for use inside Ember's view\n system.\n\n The `Ember.Handlebars` object is the standard Handlebars library, extended to\n use Ember's `get()` method instead of direct property access, which allows\n computed properties to be used inside templates.\n\n To create an `Ember.Handlebars` template, call `Ember.Handlebars.compile()`.\n This will return a function that can be used by `Ember.View` for rendering.\n\n @class Handlebars\n @namespace Ember\n*/\nEmber.Handlebars = objectCreate(Handlebars);\n\n/**\n Register a bound helper or custom view helper.\n\n ## Simple bound helper example\n\n ```javascript\n Ember.Handlebars.helper('capitalize', function(value) {\n return value.toUpperCase();\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n For more examples of bound helpers, see documentation for\n `Ember.Handlebars.registerBoundHelper`.\n\n ## Custom view helper example\n\n Assuming a view subclass named `App.CalendarView` were defined, a helper\n for rendering instances of this view could be registered as follows:\n\n ```javascript\n Ember.Handlebars.helper('calendar', App.CalendarView):\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{calendar}}\n ```\n\n Which is functionally equivalent to:\n\n ```handlebars\n {{view App.CalendarView}}\n ```\n\n Options in the helper will be passed to the view in exactly the same\n manner as with the `view` helper.\n\n @method helper\n @for Ember.Handlebars\n @param {String} name\n @param {Function|Ember.View} function or view class constructor\n @param {String} dependentKeys*\n*/\nEmber.Handlebars.helper = function(name, value) {\n Ember.assert(\"You tried to register a component named '\" + name + \"', but component names must include a '-'\", !Ember.Component.detect(value) || name.match(/-/));\n\n if (Ember.View.detect(value)) {\n Ember.Handlebars.registerHelper(name, Ember.Handlebars.makeViewHelper(value));\n } else {\n Ember.Handlebars.registerBoundHelper.apply(null, arguments);\n }\n};\n\n/**\n @private\n\n Returns a helper function that renders the provided ViewClass.\n\n Used internally by Ember.Handlebars.helper and other methods\n involving helper/component registration.\n\n @method helper\n @for Ember.Handlebars\n @param {Function} ViewClass view class constructor\n*/\nEmber.Handlebars.makeViewHelper = function(ViewClass) {\n return function(options) {\n Ember.assert(\"You can only pass attributes (such as name=value) not bare values to a helper for a View\", arguments.length < 2);\n return Ember.Handlebars.helpers.view.call(this, ViewClass, options);\n };\n};\n\n/**\n@class helpers\n@namespace Ember.Handlebars\n*/\nEmber.Handlebars.helpers = objectCreate(Handlebars.helpers);\n\n/**\n Override the the opcode compiler and JavaScript compiler for Handlebars.\n\n @class Compiler\n @namespace Ember.Handlebars\n @private\n @constructor\n*/\nEmber.Handlebars.Compiler = function() {};\n\n// Handlebars.Compiler doesn't exist in runtime-only\nif (Handlebars.Compiler) {\n Ember.Handlebars.Compiler.prototype = objectCreate(Handlebars.Compiler.prototype);\n}\n\nEmber.Handlebars.Compiler.prototype.compiler = Ember.Handlebars.Compiler;\n\n/**\n @class JavaScriptCompiler\n @namespace Ember.Handlebars\n @private\n @constructor\n*/\nEmber.Handlebars.JavaScriptCompiler = function() {};\n\n// Handlebars.JavaScriptCompiler doesn't exist in runtime-only\nif (Handlebars.JavaScriptCompiler) {\n Ember.Handlebars.JavaScriptCompiler.prototype = objectCreate(Handlebars.JavaScriptCompiler.prototype);\n Ember.Handlebars.JavaScriptCompiler.prototype.compiler = Ember.Handlebars.JavaScriptCompiler;\n}\n\n\nEmber.Handlebars.JavaScriptCompiler.prototype.namespace = \"Ember.Handlebars\";\n\nEmber.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {\n return \"''\";\n};\n\n/**\n @private\n\n Override the default buffer for Ember Handlebars. By default, Handlebars\n creates an empty String at the beginning of each invocation and appends to\n it. Ember's Handlebars overrides this to append to a single shared buffer.\n\n @method appendToBuffer\n @param string {String}\n*/\nEmber.Handlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {\n return \"data.buffer.push(\"+string+\");\";\n};\n\n// Hacks ahead:\n// Handlebars presently has a bug where the `blockHelperMissing` hook\n// doesn't get passed the name of the missing helper name, but rather\n// gets passed the value of that missing helper evaluated on the current\n// context, which is most likely `undefined` and totally useless.\n//\n// So we alter the compiled template function to pass the name of the helper\n// instead, as expected.\n//\n// This can go away once the following is closed:\n// https://github.com/wycats/handlebars.js/issues/617\n\nvar DOT_LOOKUP_REGEX = /helpers\\.(.*?)\\)/,\n BRACKET_STRING_LOOKUP_REGEX = /helpers\\['(.*?)'/,\n INVOCATION_SPLITTING_REGEX = /(.*blockHelperMissing\\.call\\(.*)(stack[0-9]+)(,.*)/;\n\nEmber.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation = function(source) {\n var helperInvocation = source[source.length - 1],\n helperName = (DOT_LOOKUP_REGEX.exec(helperInvocation) || BRACKET_STRING_LOOKUP_REGEX.exec(helperInvocation))[1],\n matches = INVOCATION_SPLITTING_REGEX.exec(helperInvocation);\n\n source[source.length - 1] = matches[1] + \"'\" + helperName + \"'\" + matches[3];\n}\nvar stringifyBlockHelperMissing = Ember.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation;\n\nvar originalBlockValue = Ember.Handlebars.JavaScriptCompiler.prototype.blockValue;\nEmber.Handlebars.JavaScriptCompiler.prototype.blockValue = function() {\n originalBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\n};\n\nvar originalAmbiguousBlockValue = Ember.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue;\nEmber.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue = function() {\n originalAmbiguousBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\n};\n\nvar prefix = \"ember\" + (+new Date()), incr = 1;\n\n/**\n @private\n\n Rewrite simple mustaches from `{{foo}}` to `{{bind \"foo\"}}`. This means that\n all simple mustaches in Ember's Handlebars will also set up an observer to\n keep the DOM up to date when the underlying property changes.\n\n @method mustache\n @for Ember.Handlebars.Compiler\n @param mustache\n*/\nEmber.Handlebars.Compiler.prototype.mustache = function(mustache) {\n if (mustache.isHelper && mustache.id.string === 'control') {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"controlID\", new Handlebars.AST.StringNode(prefix + incr++)]);\n } else if (mustache.params.length || mustache.hash) {\n // no changes required\n } else {\n var id = new Handlebars.AST.IdNode([{ part: '_triageMustache' }]);\n\n // Update the mustache node to include a hash value indicating whether the original node\n // was escaped. This will allow us to properly escape values when the underlying value\n // changes and we need to re-render the value.\n if (!mustache.escaped) {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"unescaped\", new Handlebars.AST.StringNode(\"true\")]);\n }\n mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);\n }\n\n return Handlebars.Compiler.prototype.mustache.call(this, mustache);\n};\n\n/**\n Used for precompilation of Ember Handlebars templates. This will not be used\n during normal app execution.\n\n @method precompile\n @for Ember.Handlebars\n @static\n @param {String} string The template to precompile\n*/\nEmber.Handlebars.precompile = function(string) {\n var ast = Handlebars.parse(string);\n\n var options = {\n knownHelpers: {\n action: true,\n unbound: true,\n bindAttr: true,\n template: true,\n view: true,\n _triageMustache: true\n },\n data: true,\n stringParams: true\n };\n\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n};\n\n// We don't support this for Handlebars runtime-only\nif (Handlebars.compile) {\n /**\n The entry point for Ember Handlebars. This replaces the default\n `Handlebars.compile` and turns on template-local data and String\n parameters.\n\n @method compile\n @for Ember.Handlebars\n @static\n @param {String} string The template to compile\n @return {Function}\n */\n Ember.Handlebars.compile = function(string) {\n var ast = Handlebars.parse(string);\n var options = { data: true, stringParams: true };\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n var templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n\n var template = Ember.Handlebars.template(templateSpec);\n template.isMethod = false; //Make sure we don't wrap templates with ._super\n\n return template;\n };\n}\n\n\n})();\n//@ sourceURL=ember-handlebars-compiler");minispade.register('ember-handlebars/component_lookup', "(function() {Ember.ComponentLookup = Ember.Object.extend({\n lookupFactory: function(name, container) {\n\n container = container || this.container;\n\n var fullName = 'component:' + name,\n templateFullName = 'template:components/' + name,\n templateRegistered = container && container.has(templateFullName);\n\n if (templateRegistered) {\n container.injection(fullName, 'layout', templateFullName);\n }\n\n var Component = container.lookupFactory(fullName);\n\n // Only treat as a component if either the component\n // or a template has been registered.\n if (templateRegistered || Component) {\n if (!Component) {\n container.register(fullName, Ember.Component);\n Component = container.lookupFactory(fullName);\n }\n return Component;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/component_lookup");minispade.register('ember-handlebars/controls', "(function() {minispade.require(\"ember-handlebars/controls/checkbox\");\nminispade.require(\"ember-handlebars/controls/text_field\");\nminispade.require(\"ember-handlebars/controls/button\");\nminispade.require(\"ember-handlebars/controls/text_area\");\nminispade.require(\"ember-handlebars/controls/select\");\n\n/**\n@module ember\n@submodule ember-handlebars-compiler\n*/\n\n/**\n\n The `{{input}}` helper inserts an HTML `<input>` tag into the template,\n with a `type` value of either `text` or `checkbox`. If no `type` is provided,\n `text` will be the default value applied. The attributes of `{{input}}`\n match those of the native HTML tag as closely as possible for these two types.\n\n ## Use as text field\n An `{{input}}` with no `type` or a `type` of `text` will render an HTML text input.\n The following HTML attributes can be set via the helper:\n\n* `value`\n* `size`\n* `name`\n* `pattern`\n* `placeholder`\n* `disabled`\n* `maxlength`\n* `tabindex`\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input value=\"http://www.facebook.com\"}}\n ```\n\n\n ```html\n <input type=\"text\" value=\"http://www.facebook.com\"/>\n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n firstName: \"Stanley\",\n entryNotAllowed: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"text\" value=firstName disabled=entryNotAllowed size=\"50\"}}\n ```\n\n\n ```html\n <input type=\"text\" value=\"Stanley\" disabled=\"disabled\" size=\"50\"/>\n ```\n\n ## Extension\n\n Internally, `{{input type=\"text\"}}` creates an instance of `Ember.TextField`, passing\n arguments from the helper to `Ember.TextField`'s `create` method. You can extend the\n capablilties of text inputs in your applications by reopening this class. For example,\n if you are deploying to browsers where the `required` attribute is used, you\n can add this to the `TextField`'s `attributeBindings` property:\n\n ```javascript\n Ember.TextField.reopen({\n attributeBindings: ['required']\n });\n ```\n\n Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n\n ## Use as checkbox\n\n An `{{input}}` with a `type` of `checkbox` will render an HTML checkbox input.\n The following HTML attributes can be set via the helper:\n\n* `checked`\n* `disabled`\n* `tabindex`\n* `indeterminate`\n* `name`\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input type=\"checkbox\" name=\"isAdmin\"}}\n ```\n\n ```html\n <input type=\"checkbox\" name=\"isAdmin\" />\n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n isAdmin: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"checkbox\" checked=isAdmin }}\n ```\n\n\n ```html\n <input type=\"checkbox\" checked=\"checked\" />\n ```\n\n ## Extension\n\n Internally, `{{input type=\"checkbox\"}}` creates an instance of `Ember.Checkbox`, passing\n arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the\n capablilties of checkbox inputs in your applications by reopening this class. For example,\n if you wanted to add a css class to all checkboxes in your application:\n\n ```javascript\n Ember.Checkbox.reopen({\n classNames: ['my-app-checkbox']\n });\n ```\n\n\n @method input\n @for Ember.Handlebars.helpers\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('input', function(options) {\n Ember.assert('You can only pass attributes to the `input` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes,\n inputType = hash.type,\n onEvent = hash.on;\n\n delete hash.type;\n delete hash.on;\n\n if (inputType === 'checkbox') {\n return Ember.Handlebars.helpers.view.call(this, Ember.Checkbox, options);\n } else {\n if (inputType) { hash.type = inputType; }\n hash.onEvent = onEvent || 'enter';\n return Ember.Handlebars.helpers.view.call(this, Ember.TextField, options);\n }\n});\n\n/**\n `{{textarea}}` inserts a new instance of `<textarea>` tag into the template.\n The attributes of `{{textarea}}` match those of the native HTML tags as\n closely as possible.\n\n The following HTML attributes can be set:\n\n * `value`\n * `name`\n * `rows`\n * `cols`\n * `placeholder`\n * `disabled`\n * `maxlength`\n * `tabindex`\n\n When set to a quoted string, these value will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n Unbound:\n\n ```handlebars\n {{textarea value=\"Lots of static text that ISN'T bound\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of static text that ISN'T bound\n </textarea>\n ```\n\n Bound:\n\n In the following example, the `writtenWords` property on `App.ApplicationController`\n will be updated live as the user types 'Lots of text that IS bound' into\n the text area of their browser's window.\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\"\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n ```\n\n If you wanted a one way binding between the text area and a div tag\n somewhere else on your screen, you could use `Ember.computed.oneWay`:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n outputWrittenWords: Ember.computed.oneWay(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n\n <div>\n {{outputWrittenWords}}\n </div>\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n\n <-- the following div will be updated in real time as you type -->\n\n <div>\n Lots of text that IS bound\n </div>\n ```\n\n Finally, this example really shows the power and ease of Ember when two\n properties are bound to eachother via `Ember.computed.alias`. Type into\n either text area box and they'll both stay in sync. Note that\n `Ember.computed.alias` costs more in terms of performance, so only use it when\n your really binding in both directions:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n twoWayWrittenWords: Ember.computed.alias(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n {{textarea value=twoWayWrittenWords}}\n ```\n\n ```html\n <textarea id=\"ember1\" class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n\n <-- both updated in real time -->\n\n <textarea id=\"ember2\" class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n ```\n\n ## Extension\n\n Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing\n arguments from the helper to `Ember.TextArea`'s `create` method. You can\n extend the capabilities of text areas in your application by reopening this\n class. For example, if you are deploying to browsers where the `required`\n attribute is used, you can globally add support for the `required` attribute\n on all {{textarea}}'s' in your app by reopening `Ember.TextArea` or\n `Ember.TextSupport` and adding it to the `attributeBindings` concatenated\n property:\n\n ```javascript\n Ember.TextArea.reopen({\n attributeBindings: ['required']\n });\n ```\n\n Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n @method textarea\n @for Ember.Handlebars.helpers\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('textarea', function(options) {\n Ember.assert('You can only pass attributes to the `textarea` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes;\n\n return Ember.Handlebars.helpers.view.call(this, Ember.TextArea, options);\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls");minispade.register('ember-handlebars/controls/button', "(function() {minispade.require('ember-runtime/mixins/target_action_support');\n\n/*\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n @class Button\n @namespace Ember\n @extends Ember.View\n @uses Ember.TargetActionSupport\n @deprecated\n*/\nEmber.Button = Ember.View.extend(Ember.TargetActionSupport, {\n classNames: ['ember-button'],\n classNameBindings: ['isActive'],\n\n tagName: 'button',\n\n propagateEvents: false,\n\n attributeBindings: ['type', 'disabled', 'href', 'tabindex'],\n\n /*\n @private\n\n Overrides `TargetActionSupport`'s `targetObject` computed\n property to use Handlebars-specific path resolution.\n\n @property targetObject\n */\n targetObject: Ember.computed(function() {\n var target = get(this, 'target'),\n root = get(this, 'context'),\n data = get(this, 'templateData');\n\n if (typeof target !== 'string') { return target; }\n\n return Ember.Handlebars.get(root, target, { data: data });\n }).property('target'),\n\n // Defaults to 'button' if tagName is 'input' or 'button'\n type: Ember.computed(function(key) {\n var tagName = this.tagName;\n if (tagName === 'input' || tagName === 'button') { return 'button'; }\n }),\n\n disabled: false,\n\n // Allow 'a' tags to act like buttons\n href: Ember.computed(function() {\n return this.tagName === 'a' ? '#' : null;\n }),\n\n mouseDown: function() {\n if (!get(this, 'disabled')) {\n set(this, 'isActive', true);\n this._mouseDown = true;\n this._mouseEntered = true;\n }\n return get(this, 'propagateEvents');\n },\n\n mouseLeave: function() {\n if (this._mouseDown) {\n set(this, 'isActive', false);\n this._mouseEntered = false;\n }\n },\n\n mouseEnter: function() {\n if (this._mouseDown) {\n set(this, 'isActive', true);\n this._mouseEntered = true;\n }\n },\n\n mouseUp: function(event) {\n if (get(this, 'isActive')) {\n // Actually invoke the button's target and action.\n // This method comes from the Ember.TargetActionSupport mixin.\n this.triggerAction();\n set(this, 'isActive', false);\n }\n\n this._mouseDown = false;\n this._mouseEntered = false;\n return get(this, 'propagateEvents');\n },\n\n keyDown: function(event) {\n // Handle space or enter\n if (event.keyCode === 13 || event.keyCode === 32) {\n this.mouseDown();\n }\n },\n\n keyUp: function(event) {\n // Handle space or enter\n if (event.keyCode === 13 || event.keyCode === 32) {\n this.mouseUp();\n }\n },\n\n // TODO: Handle proper touch behavior. Including should make inactive when\n // finger moves more than 20x outside of the edge of the button (vs mouse\n // which goes inactive as soon as mouse goes out of edges.)\n\n touchStart: function(touch) {\n return this.mouseDown(touch);\n },\n\n touchEnd: function(touch) {\n return this.mouseUp(touch);\n },\n\n init: function() {\n Ember.deprecate(\"Ember.Button is deprecated and will be removed from future releases. Consider using the `{{action}}` helper.\");\n this._super();\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/button");minispade.register('ember-handlebars/controls/checkbox', "(function() {minispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/ext\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set, get = Ember.get;\n\n/**\n The internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `checkbox`.\n\n See Handlebars.helpers.input for usage details.\n\n ## Direct manipulation of `checked`\n\n The `checked` attribute of an `Ember.Checkbox` object should always be set\n through the Ember object or by interacting with its rendered element\n representation via the mouse, keyboard, or touch. Updating the value of the\n checkbox via jQuery will result in the checked value of the object and its\n element losing synchronization.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class Checkbox\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Checkbox = Ember.View.extend({\n classNames: ['ember-checkbox'],\n\n tagName: 'input',\n\n attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name'],\n\n type: \"checkbox\",\n checked: false,\n disabled: false,\n indeterminate: false,\n\n init: function() {\n this._super();\n this.on(\"change\", this, this._updateElementValue);\n },\n\n didInsertElement: function() {\n this._super();\n this.get('element').indeterminate = !!this.get('indeterminate');\n },\n\n _updateElementValue: function() {\n set(this, 'checked', this.$().prop('checked'));\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/checkbox");minispade.register('ember-handlebars/controls/select', "(function() {/*jshint eqeqeq:false */\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set,\n get = Ember.get,\n indexOf = Ember.EnumerableUtils.indexOf,\n indexesOf = Ember.EnumerableUtils.indexesOf,\n forEach = Ember.EnumerableUtils.forEach,\n replace = Ember.EnumerableUtils.replace,\n isArray = Ember.isArray,\n precompileTemplate = Ember.Handlebars.compile;\n\nEmber.SelectOption = Ember.View.extend({\n tagName: 'option',\n attributeBindings: ['value', 'selected'],\n\n defaultTemplate: function(context, options) {\n options = { data: options.data, hash: {} };\n Ember.Handlebars.helpers.bind.call(context, \"view.label\", options);\n },\n\n init: function() {\n this.labelPathDidChange();\n this.valuePathDidChange();\n\n this._super();\n },\n\n selected: Ember.computed(function() {\n var content = get(this, 'content'),\n selection = get(this, 'parentView.selection');\n if (get(this, 'parentView.multiple')) {\n return selection && indexOf(selection, content.valueOf()) > -1;\n } else {\n // Primitives get passed through bindings as objects... since\n // `new Number(4) !== 4`, we use `==` below\n return content == selection;\n }\n }).property('content', 'parentView.selection'),\n\n labelPathDidChange: Ember.observer('parentView.optionLabelPath', function() {\n var labelPath = get(this, 'parentView.optionLabelPath');\n\n if (!labelPath) { return; }\n\n Ember.defineProperty(this, 'label', Ember.computed(function() {\n return get(this, labelPath);\n }).property(labelPath));\n }),\n\n valuePathDidChange: Ember.observer('parentView.optionValuePath', function() {\n var valuePath = get(this, 'parentView.optionValuePath');\n\n if (!valuePath) { return; }\n\n Ember.defineProperty(this, 'value', Ember.computed(function() {\n return get(this, valuePath);\n }).property(valuePath));\n })\n});\n\nEmber.SelectOptgroup = Ember.CollectionView.extend({\n tagName: 'optgroup',\n attributeBindings: ['label'],\n\n selectionBinding: 'parentView.selection',\n multipleBinding: 'parentView.multiple',\n optionLabelPathBinding: 'parentView.optionLabelPath',\n optionValuePathBinding: 'parentView.optionValuePath',\n\n itemViewClassBinding: 'parentView.optionView'\n});\n\n/**\n The `Ember.Select` view class renders a\n [select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,\n allowing the user to choose from a list of options.\n\n The text and `value` property of each `<option>` element within the\n `<select>` element are populated from the objects in the `Element.Select`'s\n `content` property. The underlying data object of the selected `<option>` is\n stored in the `Element.Select`'s `value` property.\n\n ## The Content Property (array of strings)\n\n The simplest version of an `Ember.Select` takes an array of strings as its\n `content` property. The string will be used as both the `value` property and\n the inner text of each `<option>` element inside the rendered `<select>`.\n\n Example:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n names: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select content=names}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n You can control which `<option>` is selected through the `Ember.Select`'s\n `value` property:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n selectedName: 'Tom',\n names: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=names\n value=selectedName\n }}\n ```\n\n Would result in the following HTML with the `<option>` for 'Tom' selected:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n A user interacting with the rendered `<select>` to choose \"Yehuda\" would\n update the value of `selectedName` to \"Yehuda\".\n\n ## The Content Property (array of Objects)\n\n An `Ember.Select` can also take an array of JavaScript or Ember objects as\n its `content` property.\n\n When using objects you need to tell the `Ember.Select` which property should\n be accessed on each object to supply the `value` attribute of the `<option>`\n and which property should be used to supply the element text.\n\n The `optionValuePath` option is used to specify the path on each object to\n the desired property for the `value` attribute. The `optionLabelPath`\n specifies the path on each object to the desired property for the\n element's text. Both paths must reference each object itself as `content`:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\">Tom</option>\n </select>\n ```\n\n The `value` attribute of the selected `<option>` within an `Ember.Select`\n can be bound to a property on another object:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ],\n currentProgrammer: {\n id: 2\n }\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n value=currentProgrammer.id}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `id` of `currentProgrammer`\n to match the `value` property of the newly selected `<option>`.\n\n Alternatively, you can control selection through the underlying objects\n used to render each object by binding the `selection` option. When the selected\n `<option>` is changed, the property path provided to `selection`\n will be updated to match the content object of the rendered `<option>`\n element:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n selectedPerson: null,\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n selection=selectedPerson}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `selectedPerson` to match the object of\n the newly selected `<option>`. In this case it is the first object\n in the `programmers`\n\n ## Supplying a Prompt\n\n A `null` value for the `Ember.Select`'s `value` or `selection` property\n results in there being no `<option>` with a `selected` attribute:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n selectedProgrammer: null,\n programmers: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ``` handlebars\n {{view Ember.Select\n content=programmers\n value=selectedProgrammer\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n Although `selectedProgrammer` is `null` and no `<option>`\n has a `selected` attribute the rendered HTML will display the\n first item as though it were selected. You can supply a string\n value for the `Ember.Select` to display when there is no selection\n with the `prompt` option:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n selectedProgrammer: null,\n programmers: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n value=selectedProgrammer\n prompt=\"Please select a name\"\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option>Please select a name</option>\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n @class Select\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Select = Ember.View.extend(\n /** @scope Ember.Select.prototype */ {\n\n tagName: 'select',\n classNames: ['ember-select'],\n defaultTemplate: precompileTemplate('{{#if view.prompt}}<option value=\"\">{{view.prompt}}</option>{{/if}}{{#if view.optionGroupPath}}{{#each view.groupedContent}}{{view view.groupView content=content label=label}}{{/each}}{{else}}{{#each view.content}}{{view view.optionView content=this}}{{/each}}{{/if}}'),\n attributeBindings: ['multiple', 'disabled', 'tabindex', 'name'],\n\n /**\n The `multiple` attribute of the select element. Indicates whether multiple\n options can be selected.\n\n @property multiple\n @type Boolean\n @default false\n */\n multiple: false,\n\n /**\n The `disabled` attribute of the select element. Indicates whether\n the element is disabled from interactions.\n\n @property disabled\n @type Boolean\n @default false\n */\n disabled: false,\n\n /**\n The list of options.\n\n If `optionLabelPath` and `optionValuePath` are not overridden, this should\n be a list of strings, which will serve simultaneously as labels and values.\n\n Otherwise, this should be a list of objects. For instance:\n\n ```javascript\n Ember.Select.create({\n content: Ember.A([\n { id: 1, firstName: 'Yehuda' },\n { id: 2, firstName: 'Tom' }\n ]),\n optionLabelPath: 'content.firstName',\n optionValuePath: 'content.id'\n });\n ```\n\n @property content\n @type Array\n @default null\n */\n content: null,\n\n /**\n When `multiple` is `false`, the element of `content` that is currently\n selected, if any.\n\n When `multiple` is `true`, an array of such elements.\n\n @property selection\n @type Object or Array\n @default null\n */\n selection: null,\n\n /**\n In single selection mode (when `multiple` is `false`), value can be used to\n get the current selection's value or set the selection by it's value.\n\n It is not currently supported in multiple selection mode.\n\n @property value\n @type String\n @default null\n */\n value: Ember.computed(function(key, value) {\n if (arguments.length === 2) { return value; }\n var valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, '');\n return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection');\n }).property('selection'),\n\n /**\n If given, a top-most dummy option will be rendered to serve as a user\n prompt.\n\n @property prompt\n @type String\n @default null\n */\n prompt: null,\n\n /**\n The path of the option labels. See [content](/api/classes/Ember.Select.html#property_content).\n\n @property optionLabelPath\n @type String\n @default 'content'\n */\n optionLabelPath: 'content',\n\n /**\n The path of the option values. See [content](/api/classes/Ember.Select.html#property_content).\n\n @property optionValuePath\n @type String\n @default 'content'\n */\n optionValuePath: 'content',\n\n /**\n The path of the option group.\n When this property is used, `content` should be sorted by `optionGroupPath`.\n\n @property optionGroupPath\n @type String\n @default null\n */\n optionGroupPath: null,\n\n /**\n The view class for optgroup.\n\n @property groupView\n @type Ember.View\n @default Ember.SelectOptgroup\n */\n groupView: Ember.SelectOptgroup,\n\n groupedContent: Ember.computed(function() {\n var groupPath = get(this, 'optionGroupPath');\n var groupedContent = Ember.A();\n var content = get(this, 'content') || [];\n\n forEach(content, function(item) {\n var label = get(item, groupPath);\n\n if (get(groupedContent, 'lastObject.label') !== label) {\n groupedContent.pushObject({\n label: label,\n content: Ember.A()\n });\n }\n\n get(groupedContent, 'lastObject.content').push(item);\n });\n\n return groupedContent;\n }).property('optionGroupPath', 'content.@each'),\n\n /**\n The view class for option.\n\n @property optionView\n @type Ember.View\n @default Ember.SelectOption\n */\n optionView: Ember.SelectOption,\n\n _change: function() {\n if (get(this, 'multiple')) {\n this._changeMultiple();\n } else {\n this._changeSingle();\n }\n },\n\n selectionDidChange: Ember.observer('selection.@each', function() {\n var selection = get(this, 'selection');\n if (get(this, 'multiple')) {\n if (!isArray(selection)) {\n set(this, 'selection', Ember.A([selection]));\n return;\n }\n this._selectionDidChangeMultiple();\n } else {\n this._selectionDidChangeSingle();\n }\n }),\n\n valueDidChange: Ember.observer('value', function() {\n var content = get(this, 'content'),\n value = get(this, 'value'),\n valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, ''),\n selectedValue = (valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection')),\n selection;\n\n if (value !== selectedValue) {\n selection = content ? content.find(function(obj) {\n return value === (valuePath ? get(obj, valuePath) : obj);\n }) : null;\n\n this.set('selection', selection);\n }\n }),\n\n\n _triggerChange: function() {\n var selection = get(this, 'selection');\n var value = get(this, 'value');\n\n if (!Ember.isNone(selection)) { this.selectionDidChange(); }\n if (!Ember.isNone(value)) { this.valueDidChange(); }\n\n this._change();\n },\n\n _changeSingle: function() {\n var selectedIndex = this.$()[0].selectedIndex,\n content = get(this, 'content'),\n prompt = get(this, 'prompt');\n\n if (!content || !get(content, 'length')) { return; }\n if (prompt && selectedIndex === 0) { set(this, 'selection', null); return; }\n\n if (prompt) { selectedIndex -= 1; }\n set(this, 'selection', content.objectAt(selectedIndex));\n },\n\n\n _changeMultiple: function() {\n var options = this.$('option:selected'),\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n content = get(this, 'content'),\n selection = get(this, 'selection');\n\n if (!content) { return; }\n if (options) {\n var selectedIndexes = options.map(function() {\n return this.index - offset;\n }).toArray();\n var newSelection = content.objectsAt(selectedIndexes);\n\n if (isArray(selection)) {\n replace(selection, 0, get(selection, 'length'), newSelection);\n } else {\n set(this, 'selection', newSelection);\n }\n }\n },\n\n _selectionDidChangeSingle: function() {\n var el = this.get('element');\n if (!el) { return; }\n\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectionIndex = content ? indexOf(content, selection) : -1,\n prompt = get(this, 'prompt');\n\n if (prompt) { selectionIndex += 1; }\n if (el) { el.selectedIndex = selectionIndex; }\n },\n\n _selectionDidChangeMultiple: function() {\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectedIndexes = content ? indexesOf(content, selection) : [-1],\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n options = this.$('option'),\n adjusted;\n\n if (options) {\n options.each(function() {\n adjusted = this.index > -1 ? this.index - offset : -1;\n this.selected = indexOf(selectedIndexes, adjusted) > -1;\n });\n }\n },\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._triggerChange);\n this.on(\"change\", this, this._change);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/select");minispade.register('ember-handlebars/controls/text_area', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/controls/text_support\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The internal class used to create textarea element when the `{{textarea}}`\n helper is used.\n\n See [handlebars.helpers.textarea](/api/classes/Ember.Handlebars.helpers.html#method_textarea) for usage details.\n\n ## Layout and LayoutName properties\n\n Because HTML `textarea` elements do not contain inner HTML the `layout` and\n `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextArea\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n*/\nEmber.TextArea = Ember.Component.extend(Ember.TextSupport, {\n classNames: ['ember-text-area'],\n\n tagName: \"textarea\",\n attributeBindings: ['rows', 'cols', 'name'],\n rows: null,\n cols: null,\n\n _updateElementValue: Ember.observer('value', function() {\n // We do this check so cursor position doesn't get affected in IE\n var value = get(this, 'value'),\n $el = this.$();\n if ($el && value !== $el.val()) {\n $el.val(value);\n }\n }),\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._updateElementValue);\n }\n\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_area");minispade.register('ember-handlebars/controls/text_field', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/controls/text_support\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n\n The internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `text`.\n\n See [handlebars.helpers.input](/api/classes/Ember.Handlebars.helpers.html#method_input) for usage details.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextField\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n*/\nEmber.TextField = Ember.Component.extend(Ember.TextSupport,\n /** @scope Ember.TextField.prototype */ {\n\n classNames: ['ember-text-field'],\n tagName: \"input\",\n attributeBindings: ['type', 'value', 'size', 'pattern', 'name'],\n\n /**\n The `value` attribute of the input element. As the user inputs text, this\n property is updated live.\n\n @property value\n @type String\n @default \"\"\n */\n value: \"\",\n\n /**\n The `type` attribute of the input element.\n\n @property type\n @type String\n @default \"text\"\n */\n type: \"text\",\n\n /**\n The `size` of the text field in characters.\n\n @property size\n @type String\n @default null\n */\n size: null,\n\n /**\n The `pattern` the pattern attribute of input element.\n\n @property pattern\n @type String\n @default null\n */\n pattern: null\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_field");minispade.register('ember-handlebars/controls/text_support', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Shared mixin used by `Ember.TextField` and `Ember.TextArea`.\n\n @class TextSupport\n @namespace Ember\n @private\n*/\nEmber.TextSupport = Ember.Mixin.create({\n value: \"\",\n\n attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex', 'readonly'],\n placeholder: null,\n disabled: false,\n maxlength: null,\n\n init: function() {\n this._super();\n this.on(\"focusOut\", this, this._elementValueDidChange);\n this.on(\"change\", this, this._elementValueDidChange);\n this.on(\"paste\", this, this._elementValueDidChange);\n this.on(\"cut\", this, this._elementValueDidChange);\n this.on(\"input\", this, this._elementValueDidChange);\n this.on(\"keyUp\", this, this.interpretKeyEvents);\n },\n\n /**\n The action to be sent when the user presses the return key.\n\n This is similar to the `{{action}}` helper, but is fired when\n the user presses the return key when editing a text field, and sends\n the value of the field as the context.\n\n @property action\n @type String\n @default null\n */\n action: null,\n\n /**\n The event that should send the action.\n\n Options are:\n\n * `enter`: the user pressed enter\n * `keyPress`: the user pressed a key\n\n @property onEvent\n @type String\n @default enter\n */\n onEvent: 'enter',\n\n /**\n Whether they `keyUp` event that triggers an `action` to be sent continues\n propagating to other views.\n\n By default, when the user presses the return key on their keyboard and\n the text field has an `action` set, the action will be sent to the view's\n controller and the key event will stop propagating.\n\n If you would like parent views to receive the `keyUp` event even after an\n action has been dispatched, set `bubbles` to true.\n\n @property bubbles\n @type Boolean\n @default false\n */\n bubbles: false,\n\n interpretKeyEvents: function(event) {\n var map = Ember.TextSupport.KEY_EVENTS;\n var method = map[event.keyCode];\n\n this._elementValueDidChange();\n if (method) { return this[method](event); }\n },\n\n _elementValueDidChange: function() {\n set(this, 'value', this.$().val());\n },\n\n /**\n The action to be sent when the user inserts a new line.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 13.\n Uses sendAction to send the `enter` action to the controller.\n\n @method insertNewline\n @param {Event} event\n */\n insertNewline: function(event) {\n sendAction('enter', this, event);\n sendAction('insert-newline', this, event);\n },\n\n /**\n Called when the user hits escape.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 27.\n Uses sendAction to send the `escape-press` action to the controller.\n\n @method cancel\n @param {Event} event\n */\n cancel: function(event) {\n sendAction('escape-press', this, event);\n },\n\n /**\n Called when the text area is focused.\n\n @method focusIn\n @param {Event} event\n */\n focusIn: function(event) {\n sendAction('focus-in', this, event);\n },\n\n /**\n Called when the text area is blurred.\n\n @method focusOut\n @param {Event} event\n */\n focusOut: function(event) {\n sendAction('focus-out', this, event);\n },\n\n /**\n The action to be sent when the user presses a key. Enabled by setting\n the `onEvent` property to `keyPress`.\n\n Uses sendAction to send the `keyPress` action to the controller.\n\n @method keyPress\n @param {Event} event\n */\n keyPress: function(event) {\n sendAction('key-press', this, event);\n }\n\n});\n\nEmber.TextSupport.KEY_EVENTS = {\n 13: 'insertNewline',\n 27: 'cancel'\n};\n\n// In principle, this shouldn't be necessary, but the legacy\n// sectionAction semantics for TextField are different from\n// the component semantics so this method normalizes them.\nfunction sendAction(eventName, view, event) {\n var action = get(view, eventName),\n on = get(view, 'onEvent'),\n value = get(view, 'value');\n\n // back-compat support for keyPress as an event name even though\n // it's also a method name that consumes the event (and therefore\n // incompatible with sendAction semantics).\n if (on === eventName || (on === 'keyPress' && eventName === 'key-press')) {\n view.sendAction('action', value);\n }\n\n view.sendAction(eventName, value);\n\n if (action || on === eventName) {\n if(!get(view, 'bubbles')) {\n event.stopPropagation();\n }\n }\n}\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_support");minispade.register('ember-handlebars/ext', "(function() {minispade.require('ember-handlebars-compiler');\n\nvar slice = Array.prototype.slice,\n originalTemplate = Ember.Handlebars.template;\n\n/**\n @private\n\n If a path starts with a reserved keyword, returns the root\n that should be used.\n\n @method normalizePath\n @for Ember\n @param root {Object}\n @param path {String}\n @param data {Hash}\n*/\nvar normalizePath = Ember.Handlebars.normalizePath = function(root, path, data) {\n var keywords = (data && data.keywords) || {},\n keyword, isKeyword;\n\n // Get the first segment of the path. For example, if the\n // path is \"foo.bar.baz\", returns \"foo\".\n keyword = path.split('.', 1)[0];\n\n // Test to see if the first path is a keyword that has been\n // passed along in the view's data hash. If so, we will treat\n // that object as the new root.\n if (keywords.hasOwnProperty(keyword)) {\n // Look up the value in the template's data hash.\n root = keywords[keyword];\n isKeyword = true;\n\n // Handle cases where the entire path is the reserved\n // word. In that case, return the object itself.\n if (path === keyword) {\n path = '';\n } else {\n // Strip the keyword from the path and look up\n // the remainder from the newly found root.\n path = path.substr(keyword.length+1);\n }\n }\n\n return { root: root, path: path, isKeyword: isKeyword };\n};\n\n\n/**\n Lookup both on root and on window. If the path starts with\n a keyword, the corresponding object will be looked up in the\n template's data hash and used to resolve the path.\n\n @method get\n @for Ember.Handlebars\n @param {Object} root The object to look up the property on\n @param {String} path The path to be lookedup\n @param {Object} options The template's option hash\n*/\nvar handlebarsGet = Ember.Handlebars.get = function(root, path, options) {\n var data = options && options.data,\n normalizedPath = normalizePath(root, path, data),\n value;\n\n // In cases where the path begins with a keyword, change the\n // root to the value represented by that keyword, and ensure\n // the path is relative to it.\n root = normalizedPath.root;\n path = normalizedPath.path;\n\n value = Ember.get(root, path);\n\n // If the path starts with a capital letter, look it up on Ember.lookup,\n // which defaults to the `window` object in browsers.\n if (value === undefined && root !== Ember.lookup && Ember.isGlobalPath(path)) {\n value = Ember.get(Ember.lookup, path);\n }\n return value;\n};\n\nEmber.Handlebars.resolveParams = function(context, params, options) {\n var resolvedParams = [], types = options.types, param, type;\n\n for (var i=0, l=params.length; i<l; i++) {\n param = params[i];\n type = types[i];\n\n if (type === 'ID') {\n resolvedParams.push(handlebarsGet(context, param, options));\n } else {\n resolvedParams.push(param);\n }\n }\n\n return resolvedParams;\n};\n\nEmber.Handlebars.resolveHash = function(context, hash, options) {\n var resolvedHash = {}, types = options.hashTypes, type;\n\n for (var key in hash) {\n if (!hash.hasOwnProperty(key)) { continue; }\n\n type = types[key];\n\n if (type === 'ID') {\n resolvedHash[key] = handlebarsGet(context, hash[key], options);\n } else {\n resolvedHash[key] = hash[key];\n }\n }\n\n return resolvedHash;\n};\n\n/**\n @private\n\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('helperMissing', function(path) {\n var error, view = \"\";\n\n var options = arguments[arguments.length - 1];\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n\n var helper = Ember.Handlebars.resolveHelper(options.data.view.container, path);\n\n if (helper) {\n return helper.apply(this, slice.call(arguments, 1));\n }\n }\n\n error = \"%@ Handlebars error: Could not find property '%@' on object %@.\";\n if (options.data) {\n view = options.data.view;\n }\n throw new Ember.Error(Ember.String.fmt(error, [view, path, this]));\n});\n\n/**\n @private\n\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('blockHelperMissing', function(path) {\n\n var options = arguments[arguments.length - 1];\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n\n var helper = Ember.Handlebars.resolveHelper(options.data.view.container, path);\n\n if (helper) {\n return helper.apply(this, slice.call(arguments, 1));\n }\n }\n\n return Handlebars.helpers.blockHelperMissing.apply(this, arguments);\n});\n\n/**\n Register a bound handlebars helper. Bound helpers behave similarly to regular\n handlebars helpers, with the added ability to re-render when the underlying data\n changes.\n\n ## Simple example\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalize', function(value) {\n return value.toUpperCase();\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n ## Example with options\n\n Like normal handlebars helpers, bound helpers have access to the options\n passed into the helper call.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('repeat', function(value, options) {\n var count = options.hash.count;\n var a = [];\n while(a.length < count) {\n a.push(value);\n }\n return a.join('');\n });\n ```\n\n This helper could be used in a template as follows:\n\n ```handlebars\n {{repeat text count=3}}\n ```\n\n ## Example with bound options\n\n Bound hash options are also supported. Example:\n\n ```handlebars\n {{repeat text countBinding=\"numRepeats\"}}\n ```\n\n In this example, count will be bound to the value of\n the `numRepeats` property on the context. If that property\n changes, the helper will be re-rendered.\n\n ## Example with extra dependencies\n\n The `Ember.Handlebars.registerBoundHelper` method takes a variable length\n third parameter which indicates extra dependencies on the passed in value.\n This allows the handlebars helper to update when these dependencies change.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalizeName', function(value) {\n return value.get('name').toUpperCase();\n }, 'name');\n ```\n\n ## Example with multiple bound properties\n\n `Ember.Handlebars.registerBoundHelper` supports binding to\n multiple properties, e.g.:\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('concatenate', function() {\n var values = Array.prototype.slice.call(arguments, 0, -1);\n return values.join('||');\n });\n ```\n\n Which allows for template syntax such as `{{concatenate prop1 prop2}}` or\n `{{concatenate prop1 prop2 prop3}}`. If any of the properties change,\n the helpr will re-render. Note that dependency keys cannot be\n using in conjunction with multi-property helpers, since it is ambiguous\n which property the dependent keys would belong to.\n\n ## Use with unbound helper\n\n The `{{unbound}}` helper can be used with bound helper invocations\n to render them in their unbound form, e.g.\n\n ```handlebars\n {{unbound capitalize name}}\n ```\n\n In this example, if the name property changes, the helper\n will not re-render.\n\n ## Use with blocks not supported\n\n Bound helpers do not support use with Handlebars blocks or\n the addition of child views of any kind.\n\n @method registerBoundHelper\n @for Ember.Handlebars\n @param {String} name\n @param {Function} function\n @param {String} dependentKeys*\n*/\nEmber.Handlebars.registerBoundHelper = function(name, fn) {\n var boundHelperArgs = slice.call(arguments, 1),\n boundFn = Ember.Handlebars.makeBoundHelper.apply(this, boundHelperArgs);\n Ember.Handlebars.registerHelper(name, boundFn);\n};\n\n/**\n @private\n\n A (mostly) private helper function to `registerBoundHelper`. Takes the\n provided Handlebars helper function fn and returns it in wrapped\n bound helper form.\n\n The main use case for using this outside of `registerBoundHelper`\n is for registering helpers on the container:\n\n ```js\n var boundHelperFn = Ember.Handlebars.makeBoundHelper(function(word) {\n return word.toUpperCase();\n });\n\n container.register('helper:my-bound-helper', boundHelperFn);\n ```\n\n In the above example, if the helper function hadn't been wrapped in\n `makeBoundHelper`, the registered helper would be unbound.\n\n @method makeBoundHelper\n @for Ember.Handlebars\n @param {Function} function\n @param {String} dependentKeys*\n*/\nEmber.Handlebars.makeBoundHelper = function(fn) {\n var dependentKeys = slice.call(arguments, 1);\n\n function helper() {\n var properties = slice.call(arguments, 0, -1),\n numProperties = properties.length,\n options = arguments[arguments.length - 1],\n normalizedProperties = [],\n types = options.types,\n data = options.data,\n hash = options.hash,\n view = data.view,\n contexts = options.contexts,\n currentContext = (contexts && contexts.length) ? contexts[0] : this,\n prefixPathForDependentKeys = '',\n loc, len, hashOption,\n boundOption, property,\n normalizedValue = Ember._SimpleHandlebarsView.prototype.normalizedValue;\n\n Ember.assert(\"registerBoundHelper-generated helpers do not support use with Handlebars blocks.\", !options.fn);\n\n // Detect bound options (e.g. countBinding=\"otherCount\")\n var boundOptions = hash.boundOptions = {};\n for (hashOption in hash) {\n if (Ember.IS_BINDING.test(hashOption)) {\n // Lop off 'Binding' suffix.\n boundOptions[hashOption.slice(0, -7)] = hash[hashOption];\n }\n }\n\n // Expose property names on data.properties object.\n var watchedProperties = [];\n data.properties = [];\n for (loc = 0; loc < numProperties; ++loc) {\n data.properties.push(properties[loc]);\n if (types[loc] === 'ID') {\n var normalizedProp = normalizePath(currentContext, properties[loc], data);\n normalizedProperties.push(normalizedProp);\n watchedProperties.push(normalizedProp);\n } else {\n normalizedProperties.push(null);\n }\n }\n\n // Handle case when helper invocation is preceded by `unbound`, e.g.\n // {{unbound myHelper foo}}\n if (data.isUnbound) {\n return evaluateUnboundHelper(this, fn, normalizedProperties, options);\n }\n\n var bindView = new Ember._SimpleHandlebarsView(null, null, !options.hash.unescaped, options.data);\n\n // Override SimpleHandlebarsView's method for generating the view's content.\n bindView.normalizedValue = function() {\n var args = [], boundOption;\n\n // Copy over bound hash options.\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n property = normalizePath(currentContext, boundOptions[boundOption], data);\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n hash[boundOption] = normalizedValue.call(bindView);\n }\n\n for (loc = 0; loc < numProperties; ++loc) {\n property = normalizedProperties[loc];\n if (property) {\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n args.push(normalizedValue.call(bindView));\n } else {\n args.push(properties[loc]);\n }\n }\n args.push(options);\n\n // Run the supplied helper function.\n return fn.apply(currentContext, args);\n };\n\n view.appendChild(bindView);\n\n // Assemble list of watched properties that'll re-render this helper.\n for (boundOption in boundOptions) {\n if (boundOptions.hasOwnProperty(boundOption)) {\n watchedProperties.push(normalizePath(currentContext, boundOptions[boundOption], data));\n }\n }\n\n // Observe each property.\n for (loc = 0, len = watchedProperties.length; loc < len; ++loc) {\n property = watchedProperties[loc];\n view.registerObserver(property.root, property.path, bindView, bindView.rerender);\n }\n\n if (types[0] !== 'ID' || normalizedProperties.length === 0) {\n return;\n }\n\n // Add dependent key observers to the first param\n var normalized = normalizedProperties[0],\n pathRoot = normalized.root,\n path = normalized.path;\n\n if(!Ember.isEmpty(path)) {\n prefixPathForDependentKeys = path + '.';\n }\n for (var i=0, l=dependentKeys.length; i<l; i++) {\n view.registerObserver(pathRoot, prefixPathForDependentKeys + dependentKeys[i], bindView, bindView.rerender);\n }\n }\n\n helper._rawFunction = fn;\n return helper;\n};\n\n/**\n @private\n\n Renders the unbound form of an otherwise bound helper function.\n\n @method evaluateUnboundHelper\n @param {Function} fn\n @param {Object} context\n @param {Array} normalizedProperties\n @param {String} options\n*/\nfunction evaluateUnboundHelper(context, fn, normalizedProperties, options) {\n var args = [], hash = options.hash, boundOptions = hash.boundOptions, loc, len, property, boundOption;\n\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n hash[boundOption] = Ember.Handlebars.get(context, boundOptions[boundOption], options);\n }\n\n for(loc = 0, len = normalizedProperties.length; loc < len; ++loc) {\n property = normalizedProperties[loc];\n args.push(Ember.Handlebars.get(property.root, property.path, options));\n }\n args.push(options);\n return fn.apply(context, args);\n}\n\n/**\n @private\n\n Overrides Handlebars.template so that we can distinguish\n user-created, top-level templates from inner contexts.\n\n @method template\n @for Ember.Handlebars\n @param {String} spec\n*/\nEmber.Handlebars.template = function(spec) {\n var t = originalTemplate(spec);\n t.isTop = true;\n return t;\n};\n\n})();\n//@ sourceURL=ember-handlebars/ext");minispade.register('ember-handlebars/helpers', "(function() {minispade.require(\"ember-handlebars/helpers/shared\");\nminispade.require(\"ember-handlebars/helpers/binding\");\nminispade.require(\"ember-handlebars/helpers/collection\");\nminispade.require(\"ember-handlebars/helpers/view\");\nminispade.require(\"ember-handlebars/helpers/unbound\");\nminispade.require(\"ember-handlebars/helpers/debug\");\nminispade.require(\"ember-handlebars/helpers/each\");\nminispade.require(\"ember-handlebars/helpers/template\");\nminispade.require(\"ember-handlebars/helpers/partial\");\nminispade.require(\"ember-handlebars/helpers/yield\");\nminispade.require(\"ember-handlebars/helpers/loc\");\n\n})();\n//@ sourceURL=ember-handlebars/helpers");minispade.register('ember-handlebars/helpers/binding', "(function() {minispade.require('ember-handlebars/ext');\nminispade.require('ember-handlebars/views/handlebars_bound_view');\nminispade.require('ember-handlebars/views/metamorph_view');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\nvar handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\nvar forEach = Ember.ArrayPolyfills.forEach;\n\nvar EmberHandlebars = Ember.Handlebars, helpers = EmberHandlebars.helpers;\n\nfunction exists(value) {\n return !Ember.isNone(value);\n}\n\n// Binds a property into the DOM. This will create a hook in DOM that the\n// KVO system will look for and update if the property changes.\nfunction bind(property, options, preserveContext, shouldDisplay, valueNormalizer, childProperties) {\n var data = options.data,\n fn = options.fn,\n inverse = options.inverse,\n view = data.view,\n currentContext = this,\n normalized, observer, i;\n\n normalized = normalizePath(currentContext, property, data);\n\n // Set up observers for observable objects\n if ('object' === typeof this) {\n if (data.insideGroup) {\n observer = function() {\n Ember.run.once(view, 'rerender');\n };\n\n var template, context, result = handlebarsGet(currentContext, property, options);\n\n result = valueNormalizer ? valueNormalizer(result) : result;\n\n context = preserveContext ? currentContext : result;\n if (shouldDisplay(result)) {\n template = fn;\n } else if (inverse) {\n template = inverse;\n }\n\n template(context, { data: options.data });\n } else {\n // Create the view that will wrap the output of this template/property\n // and add it to the nearest view's childViews array.\n // See the documentation of Ember._HandlebarsBoundView for more.\n var bindView = view.createChildView(Ember._HandlebarsBoundView, {\n preserveContext: preserveContext,\n shouldDisplayFunc: shouldDisplay,\n valueNormalizerFunc: valueNormalizer,\n displayTemplate: fn,\n inverseTemplate: inverse,\n path: property,\n pathRoot: currentContext,\n previousContext: currentContext,\n isEscaped: !options.hash.unescaped,\n templateData: options.data\n });\n\n view.appendChild(bindView);\n\n observer = function() {\n Ember.run.scheduleOnce('render', bindView, 'rerenderIfNeeded');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n if (childProperties) {\n for (i=0; i<childProperties.length; i++) {\n view.registerObserver(normalized.root, normalized.path+'.'+childProperties[i], observer);\n }\n }\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n data.buffer.push(handlebarsGet(currentContext, property, options));\n }\n}\n\nfunction simpleBind(currentContext, property, options) {\n var data = options.data,\n view = data.view,\n normalized, observer, pathRoot, output;\n\n normalized = normalizePath(currentContext, property, data);\n pathRoot = normalized.root;\n\n // Set up observers for observable objects\n if (pathRoot && ('object' === typeof pathRoot)) {\n if (data.insideGroup) {\n observer = function() {\n Ember.run.once(view, 'rerender');\n };\n\n var result = handlebarsGet(currentContext, property, options);\n if (result === null || result === undefined) { result = \"\"; }\n data.buffer.push(result);\n } else {\n var bindView = new Ember._SimpleHandlebarsView(\n property, currentContext, !options.hash.unescaped, options.data\n );\n\n bindView._parentView = view;\n view.appendChild(bindView);\n\n observer = function() {\n Ember.run.scheduleOnce('render', bindView, 'rerender');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n output = handlebarsGet(currentContext, property, options);\n data.buffer.push((output === null || typeof output === 'undefined') ? '' : output);\n }\n}\n\n/**\n @private\n\n '_triageMustache' is used internally select between a binding, helper, or component for\n the given context. Until this point, it would be hard to determine if the\n mustache is a property reference or a regular helper reference. This triage\n helper resolves that.\n\n This would not be typically invoked by directly.\n\n @method _triageMustache\n @for Ember.Handlebars.helpers\n @param {String} property Property/helperID to triage\n @param {Object} options hash of template/rendering options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('_triageMustache', function(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the _triageMustache helper\", arguments.length <= 2);\n\n if (helpers[property]) {\n return helpers[property].call(this, options);\n }\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n\n var helper = Ember.Handlebars.resolveHelper(options.data.view.container, property);\n if (helper) {\n return helper.call(this, options);\n }\n }\n\n return helpers.bind.call(this, property, options);\n});\n\nEmber.Handlebars.resolveHelper = function(container, name) {\n\n if (!container || name.indexOf('-') === -1) {\n return;\n }\n\n var helper = container.lookup('helper:' + name);\n if (!helper) {\n var componentLookup = container.lookup('component-lookup:main');\n Ember.assert(\"Could not find 'component-lookup:main' on the provided container, which is necessary for performing component lookups\", componentLookup);\n\n var Component = componentLookup.lookupFactory(name, container);\n if (Component) {\n helper = EmberHandlebars.makeViewHelper(Component);\n container.register('helper:' + name, helper);\n }\n }\n return helper;\n};\n\n/**\n @private\n\n `bind` can be used to display a value, then update that value if it\n changes. For example, if you wanted to print the `title` property of\n `content`:\n\n ```handlebars\n {{bind \"content.title\"}}\n ```\n\n This will return the `title` property as a string, then create a new observer\n at the specified path. If it changes, it will update the value in DOM. Note\n that if you need to support IE7 and IE8 you must modify the model objects\n properties using `Ember.get()` and `Ember.set()` for this to work as it\n relies on Ember's KVO system. For all other browsers this will be handled for\n you automatically.\n\n @method bind\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bind', function(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the bind helper\", arguments.length <= 2);\n\n var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this;\n\n if (!options.fn) {\n return simpleBind(context, property, options);\n }\n\n return bind.call(context, property, options, false, exists);\n});\n\n/**\n @private\n\n Use the `boundIf` helper to create a conditional that re-evaluates\n whenever the truthiness of the bound value changes.\n\n ```handlebars\n {{#boundIf \"content.shouldDisplayTitle\"}}\n {{content.title}}\n {{/boundIf}}\n ```\n\n @method boundIf\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('boundIf', function(property, fn) {\n var context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : this;\n var func = function(result) {\n var truthy = result && get(result, 'isTruthy');\n if (typeof truthy === 'boolean') { return truthy; }\n\n if (Ember.isArray(result)) {\n return get(result, 'length') !== 0;\n } else {\n return !!result;\n }\n };\n\n return bind.call(context, property, fn, true, func, func, ['isTruthy', 'length']);\n});\n\n/**\n @method with\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('with', function(context, options) {\n if (arguments.length === 4) {\n var keywordName, path, rootPath, normalized;\n\n Ember.assert(\"If you pass more than one argument to the with helper, it must be in the form #with foo as bar\", arguments[1] === \"as\");\n options = arguments[3];\n keywordName = arguments[2];\n path = arguments[0];\n\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n if (Ember.isGlobalPath(path)) {\n Ember.bind(options.data.keywords, keywordName, path);\n } else {\n normalized = normalizePath(this, path, options.data);\n path = normalized.path;\n rootPath = normalized.root;\n\n // This is a workaround for the fact that you cannot bind separate objects\n // together. When we implement that functionality, we should use it here.\n var contextKey = Ember.$.expando + Ember.guidFor(rootPath);\n options.data.keywords[contextKey] = rootPath;\n\n // if the path is '' (\"this\"), just bind directly to the current context\n var contextPath = path ? contextKey + '.' + path : contextKey;\n Ember.bind(options.data.keywords, keywordName, contextPath);\n }\n\n return bind.call(this, path, options, true, exists);\n } else {\n Ember.assert(\"You must pass exactly one argument to the with helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n return helpers.bind.call(options.contexts[0], context, options);\n }\n});\n\n\n/**\n See [boundIf](/api/classes/Ember.Handlebars.helpers.html#method_boundIf)\n\n @method if\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('if', function(context, options) {\n Ember.assert(\"You must pass exactly one argument to the if helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the if helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n return helpers.boundIf.call(options.contexts[0], context, options);\n});\n\n/**\n @method unless\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('unless', function(context, options) {\n Ember.assert(\"You must pass exactly one argument to the unless helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the unless helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n var fn = options.fn, inverse = options.inverse;\n\n options.fn = inverse;\n options.inverse = fn;\n\n return helpers.boundIf.call(options.contexts[0], context, options);\n});\n\n/**\n `bind-attr` allows you to create a binding between DOM element attributes and\n Ember objects. For example:\n\n ```handlebars\n <img {{bind-attr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n The above handlebars template will fill the `<img>`'s `src` attribute will\n the value of the property referenced with `\"imageUrl\"` and its `alt`\n attribute with the value of the property referenced with `\"imageTitle\"`.\n\n If the rendering context of this template is the following object:\n\n ```javascript\n {\n imageUrl: 'http://lolcats.info/haz-a-funny',\n imageTitle: 'A humorous image of a cat'\n }\n ```\n\n The resulting HTML output will be:\n\n ```html\n <img src=\"http://lolcats.info/haz-a-funny\" alt=\"A humorous image of a cat\">\n ```\n\n `bind-attr` cannot redeclare existing DOM element attributes. The use of `src`\n in the following `bind-attr` example will be ignored and the hard coded value\n of `src=\"/failwhale.gif\"` will take precedence:\n\n ```handlebars\n <img src=\"/failwhale.gif\" {{bind-attr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n ### `bind-attr` and the `class` attribute\n\n `bind-attr` supports a special syntax for handling a number of cases unique\n to the `class` DOM element attribute. The `class` attribute combines\n multiple discrete values into a single attribute as a space-delimited\n list of strings. Each string can be:\n\n * a string return value of an object's property.\n * a boolean return value of an object's property\n * a hard-coded value\n\n A string return value works identically to other uses of `bind-attr`. The\n return value of the property will become the value of the attribute. For\n example, the following view and template:\n\n ```javascript\n AView = Ember.View.extend({\n someProperty: function() {\n return \"aValue\";\n }.property()\n })\n ```\n\n ```handlebars\n <img {{bind-attr class=\"view.someProperty}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"aValue\">\n ```\n\n A boolean return value will insert a specified class name if the property\n returns `true` and remove the class name if the property returns `false`.\n\n A class name is provided via the syntax\n `somePropertyName:class-name-if-true`.\n\n ```javascript\n AView = Ember.View.extend({\n someBool: true\n })\n ```\n\n ```handlebars\n <img {{bind-attr class=\"view.someBool:class-name-if-true\"}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"class-name-if-true\">\n ```\n\n An additional section of the binding can be provided if you want to\n replace the existing class instead of removing it when the boolean\n value changes:\n\n ```handlebars\n <img {{bind-attr class=\"view.someBool:class-name-if-true:class-name-if-false\"}}>\n ```\n\n A hard-coded value can be used by prepending `:` to the desired\n class name: `:class-name-to-always-apply`.\n\n ```handlebars\n <img {{bind-attr class=\":class-name-to-always-apply\"}}>\n ```\n\n Results in the following rendered output:\n\n ```html\n <img class=\"class-name-to-always-apply\">\n ```\n\n All three strategies - string return value, boolean return value, and\n hard-coded value – can be combined in a single declaration:\n\n ```handlebars\n <img {{bind-attr class=\":class-name-to-always-apply view.someBool:class-name-if-true view.someProperty\"}}>\n ```\n\n @method bind-attr\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bind-attr', function(options) {\n\n var attrs = options.hash;\n\n Ember.assert(\"You must specify at least one hash argument to bind-attr\", !!Ember.keys(attrs).length);\n\n var view = options.data.view;\n var ret = [];\n var ctx = this;\n\n // Generate a unique id for this element. This will be added as a\n // data attribute to the element so it can be looked up when\n // the bound property changes.\n var dataId = ++Ember.uuid;\n\n // Handle classes differently, as we can bind multiple classes\n var classBindings = attrs['class'];\n if (classBindings != null) {\n var classResults = EmberHandlebars.bindClasses(this, classBindings, view, dataId, options);\n\n ret.push('class=\"' + Handlebars.Utils.escapeExpression(classResults.join(' ')) + '\"');\n delete attrs['class'];\n }\n\n var attrKeys = Ember.keys(attrs);\n\n // For each attribute passed, create an observer and emit the\n // current value of the property as an attribute.\n forEach.call(attrKeys, function(attr) {\n var path = attrs[attr],\n normalized;\n\n Ember.assert(fmt(\"You must provide an expression as the value of bound attribute. You specified: %@=%@\", [attr, path]), typeof path === 'string');\n\n normalized = normalizePath(ctx, path, options.data);\n\n var value = (path === 'this') ? normalized.root : handlebarsGet(ctx, path, options),\n type = Ember.typeOf(value);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [value]), value === null || value === undefined || type === 'number' || type === 'string' || type === 'boolean');\n\n var observer, invoker;\n\n observer = function observer() {\n var result = handlebarsGet(ctx, path, options);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [result]), result === null || result === undefined || typeof result === 'number' || typeof result === 'string' || typeof result === 'boolean');\n\n var elem = view.$(\"[data-bindattr-\" + dataId + \"='\" + dataId + \"']\");\n\n // If we aren't able to find the element, it means the element\n // to which we were bound has been removed from the view.\n // In that case, we can assume the template has been re-rendered\n // and we need to clean up the observer.\n if (!elem || elem.length === 0) {\n Ember.removeObserver(normalized.root, normalized.path, invoker);\n return;\n }\n\n Ember.View.applyAttributeBindings(elem, attr, result);\n };\n\n // Add an observer to the view for when the property changes.\n // When the observer fires, find the element using the\n // unique data id and update the attribute to the new value.\n // Note: don't add observer when path is 'this' or path\n // is whole keyword e.g. {{#each x in list}} ... {{bind-attr attr=\"x\"}}\n if (path !== 'this' && !(normalized.isKeyword && normalized.path === '' )) {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n\n // if this changes, also change the logic in ember-views/lib/views/view.js\n if ((type === 'string' || (type === 'number' && !isNaN(value)))) {\n ret.push(attr + '=\"' + Handlebars.Utils.escapeExpression(value) + '\"');\n } else if (value && type === 'boolean') {\n // The developer controls the attr name, so it should always be safe\n ret.push(attr + '=\"' + attr + '\"');\n }\n }, this);\n\n // Add the unique identifier\n // NOTE: We use all lower-case since Firefox has problems with mixed case in SVG\n ret.push('data-bindattr-' + dataId + '=\"' + dataId + '\"');\n return new EmberHandlebars.SafeString(ret.join(' '));\n});\n\n/**\n See `bind-attr`\n\n @method bindAttr\n @for Ember.Handlebars.helpers\n @deprecated\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bindAttr', EmberHandlebars.helpers['bind-attr']);\n\n/**\n @private\n\n Helper that, given a space-separated string of property paths and a context,\n returns an array of class names. Calling this method also has the side\n effect of setting up observers at those property paths, such that if they\n change, the correct class name will be reapplied to the DOM element.\n\n For example, if you pass the string \"fooBar\", it will first look up the\n \"fooBar\" value of the context. If that value is true, it will add the\n \"foo-bar\" class to the current element (i.e., the dasherized form of\n \"fooBar\"). If the value is a string, it will add that string as the class.\n Otherwise, it will not add any new class name.\n\n @method bindClasses\n @for Ember.Handlebars\n @param {Ember.Object} context The context from which to lookup properties\n @param {String} classBindings A string, space-separated, of class bindings\n to use\n @param {Ember.View} view The view in which observers should look for the\n element to update\n @param {Srting} bindAttrId Optional bindAttr id used to lookup elements\n @return {Array} An array of class names to add\n*/\nEmberHandlebars.bindClasses = function(context, classBindings, view, bindAttrId, options) {\n var ret = [], newClass, value, elem;\n\n // Helper method to retrieve the property from the context and\n // determine which class string to return, based on whether it is\n // a Boolean or not.\n var classStringForPath = function(root, parsedPath, options) {\n var val,\n path = parsedPath.path;\n\n if (path === 'this') {\n val = root;\n } else if (path === '') {\n val = true;\n } else {\n val = handlebarsGet(root, path, options);\n }\n\n return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n };\n\n // For each property passed, loop through and setup\n // an observer.\n forEach.call(classBindings.split(' '), function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n\n var observer, invoker;\n\n var parsedPath = Ember.View._parsePropertyPath(binding),\n path = parsedPath.path,\n pathRoot = context,\n normalized;\n\n if (path !== '' && path !== 'this') {\n normalized = normalizePath(context, path, options.data);\n\n pathRoot = normalized.root;\n path = normalized.path;\n }\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n observer = function() {\n // Get the current value of the property\n newClass = classStringForPath(context, parsedPath, options);\n elem = bindAttrId ? view.$(\"[data-bindattr-\" + bindAttrId + \"='\" + bindAttrId + \"']\") : view.$();\n\n // If we can't find the element anymore, a parent template has been\n // re-rendered and we've been nuked. Remove the observer.\n if (!elem || elem.length === 0) {\n Ember.removeObserver(pathRoot, path, invoker);\n } else {\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n }\n };\n\n if (path !== '' && path !== 'this') {\n view.registerObserver(pathRoot, path, observer);\n }\n\n // We've already setup the observer; now we just need to figure out the\n // correct behavior right now on the first pass through.\n value = classStringForPath(context, parsedPath, options);\n\n if (value) {\n ret.push(value);\n\n // Make sure we save the current value so that it can be removed if the\n // observer fires.\n oldClass = value;\n }\n });\n\n return ret;\n};\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/binding");minispade.register('ember-handlebars/helpers/collection', "(function() {/*globals Handlebars */\n\n// TODO: Don't require all of this module\nminispade.require('ember-handlebars');\nminispade.require('ember-handlebars/helpers/view');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, handlebarsGet = Ember.Handlebars.get, fmt = Ember.String.fmt;\n\n/**\n `{{collection}}` is a `Ember.Handlebars` helper for adding instances of\n `Ember.CollectionView` to a template. See [Ember.CollectionView](/api/classes/Ember.CollectionView.html)\n for additional information on how a `CollectionView` functions.\n\n `{{collection}}`'s primary use is as a block helper with a `contentBinding`\n option pointing towards an `Ember.Array`-compatible object. An `Ember.View`\n instance will be created for each item in its `content` property. Each view\n will have its own `content` property set to the appropriate item in the\n collection.\n\n The provided block will be applied as the template for each item's view.\n\n Given an empty `<body>` the following template:\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n And the following application code\n\n ```javascript\n App = Ember.Application.create()\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Hi Dave</div>\n <div class=\"ember-view\">Hi Mary</div>\n <div class=\"ember-view\">Hi Sara</div>\n </div>\n ```\n\n ### Blockless Use\n\n If you provide an `itemViewClass` option that has its own `template` you can\n omit the block.\n\n The following template:\n\n ```handlebars\n {{collection contentBinding=\"App.items\" itemViewClass=\"App.AnItemView\"}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create();\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ];\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{view.content.name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n ### Specifying a CollectionView subclass\n\n By default the `{{collection}}` helper will create an instance of\n `Ember.CollectionView`. You can supply a `Ember.CollectionView` subclass to\n the helper by passing it as the first argument:\n\n ```handlebars\n {{#collection App.MyCustomCollectionClass contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n ### Forwarded `item.*`-named Options\n\n As with the `{{view}}`, helper options passed to the `{{collection}}` will be\n set on the resulting `Ember.CollectionView` as properties. Additionally,\n options prefixed with `item` will be applied to the views rendered for each\n item (note the camelcasing):\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"\n itemTagName=\"p\"\n itemClassNames=\"greeting\"}}\n Howdy {{view.content.name}}\n {{/collection}}\n ```\n\n Will result in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <p class=\"ember-view greeting\">Howdy Dave</p>\n <p class=\"ember-view greeting\">Howdy Mary</p>\n <p class=\"ember-view greeting\">Howdy Sara</p>\n </div>\n ```\n\n @method collection\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n @deprecated Use `{{each}}` helper instead.\n*/\nEmber.Handlebars.registerHelper('collection', function(path, options) {\n Ember.deprecate(\"Using the {{collection}} helper without specifying a class has been deprecated as the {{each}} helper now supports the same functionality.\", path !== 'collection');\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = undefined;\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 1);\n } else {\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 2);\n }\n\n var fn = options.fn;\n var data = options.data;\n var inverse = options.inverse;\n var view = options.data.view;\n\n // If passed a path string, convert that into an object.\n // Otherwise, just default to the standard class.\n var collectionClass;\n collectionClass = path ? handlebarsGet(this, path, options) : Ember.CollectionView;\n Ember.assert(fmt(\"%@ #collection: Could not find collection class %@\", [data.view, path]), !!collectionClass);\n\n var hash = options.hash, itemHash = {}, match;\n\n // Extract item view class if provided else default to the standard class\n var collectionPrototype = collectionClass.proto(),\n itemViewClass;\n\n if (hash.itemView) {\n var controller = data.keywords.controller;\n Ember.assert('You specified an itemView, but the current context has no container to look the itemView up in. This probably means that you created a view manually, instead of through the container. Instead, use container.lookup(\"view:viewName\"), which will properly instantiate your view.', controller && controller.container);\n var container = controller.container;\n itemViewClass = container.resolve('view:' + hash.itemView);\n Ember.assert('You specified the itemView ' + hash.itemView + \", but it was not found at \" + container.describe(\"view:\" + hash.itemView) + \" (and it was not registered in the container)\", !!itemViewClass);\n } else if (hash.itemViewClass) {\n itemViewClass = handlebarsGet(collectionPrototype, hash.itemViewClass, options);\n } else {\n itemViewClass = collectionPrototype.itemViewClass;\n }\n\n Ember.assert(fmt(\"%@ #collection: Could not find itemViewClass %@\", [data.view, itemViewClass]), !!itemViewClass);\n\n delete hash.itemViewClass;\n delete hash.itemView;\n\n // Go through options passed to the {{collection}} helper and extract options\n // that configure item views instead of the collection itself.\n for (var prop in hash) {\n if (hash.hasOwnProperty(prop)) {\n match = prop.match(/^item(.)(.*)$/);\n\n if (match && prop !== 'itemController') {\n // Convert itemShouldFoo -> shouldFoo\n itemHash[match[1].toLowerCase() + match[2]] = hash[prop];\n // Delete from hash as this will end up getting passed to the\n // {{view}} helper method.\n delete hash[prop];\n }\n }\n }\n\n if (fn) {\n itemHash.template = fn;\n delete options.fn;\n }\n\n var emptyViewClass;\n if (inverse && inverse !== Handlebars.VM.noop) {\n emptyViewClass = get(collectionPrototype, 'emptyViewClass');\n emptyViewClass = emptyViewClass.extend({\n template: inverse,\n tagName: itemHash.tagName\n });\n } else if (hash.emptyViewClass) {\n emptyViewClass = handlebarsGet(this, hash.emptyViewClass, options);\n }\n if (emptyViewClass) { hash.emptyView = emptyViewClass; }\n\n if (!hash.keyword) {\n itemHash._context = Ember.computed.alias('content');\n }\n\n var viewOptions = Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);\n hash.itemViewClass = itemViewClass.extend(viewOptions);\n\n return Ember.Handlebars.helpers.view.call(this, collectionClass, options);\n});\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/collection");minispade.register('ember-handlebars/helpers/debug', "(function() {/*jshint debug:true*/\nminispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\n\n/**\n `log` allows you to output the value of a variable in the current rendering\n context.\n\n ```handlebars\n {{log myVariable}}\n ```\n\n @method log\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('log', function(property, options) {\n var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this,\n normalized = normalizePath(context, property, options.data),\n pathRoot = normalized.root,\n path = normalized.path,\n value = (path === 'this') ? pathRoot : handlebarsGet(pathRoot, path, options);\n Ember.Logger.log(value);\n});\n\n/**\n Execute the `debugger` statement in the current context.\n\n ```handlebars\n {{debugger}}\n ```\n\n @method debugger\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('debugger', function(options) {\n debugger;\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/debug");minispade.register('ember-handlebars/helpers/each', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/collection_view\");\nminispade.require(\"ember-handlebars/views/metamorph_view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, {\n init: function() {\n var itemController = get(this, 'itemController');\n var binding;\n\n if (itemController) {\n var controller = get(this, 'controller.container').lookupFactory('controller:array').create({\n parentController: get(this, 'controller'),\n itemController: itemController,\n target: get(this, 'controller'),\n _eachView: this\n });\n\n this.disableContentObservers(function() {\n set(this, 'content', controller);\n binding = new Ember.Binding('content', '_eachView.dataSource').oneWay();\n binding.connect(controller);\n });\n\n set(this, '_arrayController', controller);\n } else {\n this.disableContentObservers(function() {\n binding = new Ember.Binding('content', 'dataSource').oneWay();\n binding.connect(this);\n });\n }\n\n return this._super();\n },\n\n _assertArrayLike: function(content) {\n Ember.assert(\"The value that #each loops over must be an Array. You passed \" + content.constructor + \", but it should have been an ArrayController\", !Ember.ControllerMixin.detect(content) || (content && content.isGenerated) || content instanceof Ember.ArrayController);\n Ember.assert(\"The value that #each loops over must be an Array. You passed \" + ((Ember.ControllerMixin.detect(content) && content.get('model') !== undefined) ? (\"\" + content.get('model') + \" (wrapped in \" + content + \")\") : (\"\" + content)), Ember.Array.detect(content));\n },\n\n disableContentObservers: function(callback) {\n Ember.removeBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.removeObserver(this, 'content', null, '_contentDidChange');\n\n callback.call(this);\n\n Ember.addBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.addObserver(this, 'content', null, '_contentDidChange');\n },\n\n itemViewClass: Ember._MetamorphView,\n emptyViewClass: Ember._MetamorphView,\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n // At the moment, if a container view subclass wants\n // to insert keywords, it is responsible for cloning\n // the keywords hash. This will be fixed momentarily.\n var keyword = get(this, 'keyword');\n var content = get(view, 'content');\n\n if (keyword) {\n var data = get(view, 'templateData');\n\n data = Ember.copy(data);\n data.keywords = view.cloneKeywords();\n set(view, 'templateData', data);\n\n // In this case, we do not bind, because the `content` of\n // a #each item cannot change.\n data.keywords[keyword] = content;\n }\n\n // If {{#each}} is looping over an array of controllers,\n // point each child view at their respective controller.\n if (content && get(content, 'isController')) {\n set(view, 'controller', content);\n }\n\n return view;\n },\n\n destroy: function() {\n if (!this._super()) { return; }\n\n var arrayController = get(this, '_arrayController');\n\n if (arrayController) {\n arrayController.destroy();\n }\n\n return this;\n }\n});\n\nvar GroupedEach = Ember.Handlebars.GroupedEach = function(context, path, options) {\n var self = this,\n normalized = Ember.Handlebars.normalizePath(context, path, options.data);\n\n this.context = context;\n this.path = path;\n this.options = options;\n this.template = options.fn;\n this.containingView = options.data.view;\n this.normalizedRoot = normalized.root;\n this.normalizedPath = normalized.path;\n this.content = this.lookupContent();\n\n this.addContentObservers();\n this.addArrayObservers();\n\n this.containingView.on('willClearRender', function() {\n self.destroy();\n });\n};\n\nGroupedEach.prototype = {\n contentWillChange: function() {\n this.removeArrayObservers();\n },\n\n contentDidChange: function() {\n this.content = this.lookupContent();\n this.addArrayObservers();\n this.rerenderContainingView();\n },\n\n contentArrayWillChange: Ember.K,\n\n contentArrayDidChange: function() {\n this.rerenderContainingView();\n },\n\n lookupContent: function() {\n return Ember.Handlebars.get(this.normalizedRoot, this.normalizedPath, this.options);\n },\n\n addArrayObservers: function() {\n if (!this.content) { return; }\n\n this.content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n removeArrayObservers: function() {\n if (!this.content) { return; }\n\n this.content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n addContentObservers: function() {\n Ember.addBeforeObserver(this.normalizedRoot, this.normalizedPath, this, this.contentWillChange);\n Ember.addObserver(this.normalizedRoot, this.normalizedPath, this, this.contentDidChange);\n },\n\n removeContentObservers: function() {\n Ember.removeBeforeObserver(this.normalizedRoot, this.normalizedPath, this.contentWillChange);\n Ember.removeObserver(this.normalizedRoot, this.normalizedPath, this.contentDidChange);\n },\n\n render: function() {\n if (!this.content) { return; }\n\n var content = this.content,\n contentLength = get(content, 'length'),\n data = this.options.data,\n template = this.template;\n\n data.insideEach = true;\n for (var i = 0; i < contentLength; i++) {\n template(content.objectAt(i), { data: data });\n }\n },\n\n rerenderContainingView: function() {\n var self = this;\n Ember.run.scheduleOnce('render', this, function() {\n // It's possible it's been destroyed after we enqueued a re-render call.\n if (!self.destroyed) {\n self.containingView.rerender();\n }\n });\n },\n\n destroy: function() {\n this.removeContentObservers();\n if (this.content) {\n this.removeArrayObservers();\n }\n this.destroyed = true;\n }\n};\n\n/**\n The `{{#each}}` helper loops over elements in a collection, rendering its\n block once for each item. It is an extension of the base Handlebars `{{#each}}`\n helper:\n\n ```javascript\n Developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}];\n ```\n\n ```handlebars\n {{#each Developers}}\n {{name}}\n {{/each}}\n ```\n\n `{{each}}` supports an alternative syntax with element naming:\n\n ```handlebars\n {{#each person in Developers}}\n {{person.name}}\n {{/each}}\n ```\n\n When looping over objects that do not have properties, `{{this}}` can be used\n to render the object:\n\n ```javascript\n DeveloperNames = ['Yehuda', 'Tom', 'Paul']\n ```\n\n ```handlebars\n {{#each DeveloperNames}}\n {{this}}\n {{/each}}\n ```\n ### {{else}} condition\n `{{#each}}` can have a matching `{{else}}`. The contents of this block will render\n if the collection is empty.\n\n ```\n {{#each person in Developers}}\n {{person.name}}\n {{else}}\n <p>Sorry, nobody is available for this task.</p>\n {{/each}}\n ```\n ### Specifying a View class for items\n If you provide an `itemViewClass` option that references a view class\n with its own `template` you can omit the block.\n\n The following template:\n\n ```handlebars\n {{#view App.MyView }}\n {{each view.items itemViewClass=\"App.AnItemView\"}}\n {{/view}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create({\n MyView: Ember.View.extend({\n items: [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n })\n });\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n If an `itemViewClass` is defined on the helper, and therefore the helper is not\n being used as a block, an `emptyViewClass` can also be provided optionally.\n The `emptyViewClass` will match the behavior of the `{{else}}` condition\n described above. That is, the `emptyViewClass` will render if the collection\n is empty.\n\n ### Representing each item with a Controller.\n By default the controller lookup within an `{{#each}}` block will be\n the controller of the template where the `{{#each}}` was used. If each\n item needs to be presented by a custom controller you can provide a\n `itemController` option which references a controller by lookup name.\n Each item in the loop will be wrapped in an instance of this controller\n and the item itself will be set to the `content` property of that controller.\n\n This is useful in cases where properties of model objects need transformation\n or synthesis for display:\n\n ```javascript\n App.DeveloperController = Ember.ObjectController.extend({\n isAvailableForHire: function() {\n return !this.get('content.isEmployed') && this.get('content.isSeekingWork');\n }.property('isEmployed', 'isSeekingWork')\n })\n ```\n\n ```handlebars\n {{#each person in developers itemController=\"developer\"}}\n {{person.name}} {{#if person.isAvailableForHire}}Hire me!{{/if}}\n {{/each}}\n ```\n\n Each itemController will receive a reference to the current controller as\n a `parentController` property.\n\n ### (Experimental) Grouped Each\n\n When used in conjunction with the experimental [group helper](https://github.com/emberjs/group-helper),\n you can inform Handlebars to re-render an entire group of items instead of\n re-rendering them one at a time (in the event that they are changed en masse\n or an item is added/removed).\n\n ```handlebars\n {{#group}}\n {{#each people}}\n {{firstName}} {{lastName}}\n {{/each}}\n {{/group}}\n ```\n\n This can be faster than the normal way that Handlebars re-renders items\n in some cases.\n\n If for some reason you have a group with more than one `#each`, you can make\n one of the collections be updated in normal (non-grouped) fashion by setting\n the option `groupedRows=true` (counter-intuitive, I know).\n\n For example,\n\n ```handlebars\n {{dealershipName}}\n\n {{#group}}\n {{#each dealers}}\n {{firstName}} {{lastName}}\n {{/each}}\n\n {{#each car in cars groupedRows=true}}\n {{car.make}} {{car.model}} {{car.color}}\n {{/each}}\n {{/group}}\n ```\n Any change to `dealershipName` or the `dealers` collection will cause the\n entire group to be re-rendered. However, changes to the `cars` collection\n will be re-rendered individually (as normal).\n\n Note that `group` behavior is also disabled by specifying an `itemViewClass`.\n\n @method each\n @for Ember.Handlebars.helpers\n @param [name] {String} name for item (used with `in`)\n @param [path] {String} path\n @param [options] {Object} Handlebars key/value pairs of options\n @param [options.itemViewClass] {String} a path to a view class used for each item\n @param [options.itemController] {String} name of a controller to be created for each item\n @param [options.groupedRows] {boolean} enable normal item-by-item rendering when inside a `#group` helper\n*/\nEmber.Handlebars.registerHelper('each', function(path, options) {\n if (arguments.length === 4) {\n Ember.assert(\"If you pass more than one argument to the each helper, it must be in the form #each foo in bar\", arguments[1] === \"in\");\n\n var keywordName = arguments[0];\n\n options = arguments[3];\n path = arguments[2];\n if (path === '') { path = \"this\"; }\n\n options.hash.keyword = keywordName;\n }\n\n if (arguments.length === 1) {\n options = path;\n path = 'this';\n }\n\n options.hash.dataSourceBinding = path;\n // Set up emptyView as a metamorph with no tag\n //options.hash.emptyViewClass = Ember._MetamorphView;\n\n if (options.data.insideGroup && !options.hash.groupedRows && !options.hash.itemViewClass) {\n new Ember.Handlebars.GroupedEach(this, path, options).render();\n } else {\n return Ember.Handlebars.helpers.collection.call(this, 'Ember.Handlebars.EachView', options);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/each");minispade.register('ember-handlebars/helpers/loc', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `loc` looks up the string in the localized strings hash.\n This is a convenient way to localize text. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"home\">\n {{loc \"welcome\"}}\n </script>\n ```\n\n Take note that `\"welcome\"` is a string and not an object\n reference.\n\n @method loc\n @for Ember.Handlebars.helpers\n @param {String} str The string to format\n*/\n\nEmber.Handlebars.registerHelper('loc', function(str) {\n return Ember.String.loc(str);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/loc");minispade.register('ember-handlebars/helpers/partial', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `partial` renders a template directly using the current context.\n If needed the context can be set using the `{{#with foo}}` helper.\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"header_bar\">\n {{#with currentUser}}\n {{partial user_info}}\n {{/with}}\n </script>\n ```\n\n The `data-template-name` attribute of a partial template\n is prefixed with an underscore.\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"_user_info\">\n <span>Hello {{username}}!</span>\n </script>\n ```\n\n @method partial\n @for Ember.Handlebars.helpers\n @param {String} partialName the name of the template to render minus the leading underscore\n*/\n\nEmber.Handlebars.registerHelper('partial', function(name, options) {\n var nameParts = name.split(\"/\"),\n lastPart = nameParts[nameParts.length - 1];\n\n nameParts[nameParts.length - 1] = \"_\" + lastPart;\n\n var view = options.data.view,\n underscoredName = nameParts.join(\"/\"),\n template = view.templateForName(underscoredName),\n deprecatedTemplate = !template && view.templateForName(name);\n\n Ember.assert(\"Unable to find partial with name '\"+name+\"'.\", template || deprecatedTemplate);\n\n template = template || deprecatedTemplate;\n\n template(this, { data: options.data });\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/partial");minispade.register('ember-handlebars/helpers/shared', "(function() {Ember.Handlebars.resolvePaths = function(options) {\n var ret = [],\n contexts = options.contexts,\n roots = options.roots,\n data = options.data;\n\n for (var i=0, l=contexts.length; i<l; i++) {\n ret.push( Ember.Handlebars.get(roots[i], contexts[i], { data: data }) );\n }\n\n return ret;\n};\n\n})();\n//@ sourceURL=ember-handlebars/helpers/shared");minispade.register('ember-handlebars/helpers/template', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `template` allows you to render a template from inside another template.\n This allows you to re-use the same template in multiple places. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"logged_in_user\">\n {{#with loggedInUser}}\n Last Login: {{lastLogin}}\n User Info: {{template \"user_info\"}}\n {{/with}}\n </script>\n ```\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"user_info\">\n Name: <em>{{name}}</em>\n Karma: <em>{{karma}}</em>\n </script>\n ```\n\n ```handlebars\n {{#if isUser}}\n {{template \"user_info\"}}\n {{else}}\n {{template \"unlogged_user_info\"}}\n {{/if}}\n ```\n\n This helper looks for templates in the global `Ember.TEMPLATES` hash. If you\n add `<script>` tags to your page with the `data-template-name` attribute set,\n they will be compiled and placed in this hash automatically.\n\n You can also manually register templates by adding them to the hash:\n\n ```javascript\n Ember.TEMPLATES[\"my_cool_template\"] = Ember.Handlebars.compile('<b>{{user}}</b>');\n ```\n\n @deprecated\n @method template\n @for Ember.Handlebars.helpers\n @param {String} templateName the template to render\n*/\n\nEmber.Handlebars.registerHelper('template', function(name, options) {\n Ember.deprecate(\"The `template` helper has been deprecated in favor of the `partial` helper. Please use `partial` instead, which will work the same way.\");\n return Ember.Handlebars.helpers.partial.apply(this, arguments);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/template");minispade.register('ember-handlebars/helpers/unbound', "(function() {/*globals Handlebars */\nminispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar handlebarsGet = Ember.Handlebars.get;\n\n/**\n `unbound` allows you to output a property without binding. *Important:* The\n output will not be updated if the property changes. Use with caution.\n\n ```handlebars\n <div>{{unbound somePropertyThatDoesntChange}}</div>\n ```\n\n `unbound` can also be used in conjunction with a bound helper to\n render it in its unbound form:\n\n ```handlebars\n <div>{{unbound helperName somePropertyThatDoesntChange}}</div>\n ```\n\n @method unbound\n @for Ember.Handlebars.helpers\n @param {String} property\n @return {String} HTML string\n*/\nEmber.Handlebars.registerHelper('unbound', function(property, fn) {\n var options = arguments[arguments.length - 1], helper, context, out;\n\n if (arguments.length > 2) {\n // Unbound helper call.\n options.data.isUnbound = true;\n helper = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing;\n out = helper.apply(this, Array.prototype.slice.call(arguments, 1));\n delete options.data.isUnbound;\n return out;\n }\n\n context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : this;\n return handlebarsGet(context, property, fn);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/unbound");minispade.register('ember-handlebars/helpers/view', "(function() {/*globals Handlebars */\n\n// TODO: Don't require the entire module\nminispade.require(\"ember-handlebars\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar EmberHandlebars = Ember.Handlebars;\nvar LOWERCASE_A_Z = /^[a-z]/;\nvar VIEW_PREFIX = /^view\\./;\n\nfunction makeBindings(thisContext, options) {\n var hash = options.hash,\n hashType = options.hashTypes;\n\n for (var prop in hash) {\n if (hashType[prop] === 'ID') {\n\n var value = hash[prop];\n\n if (Ember.IS_BINDING.test(prop)) {\n Ember.warn(\"You're attempting to render a view by passing \" + prop + \"=\" + value + \" to a view helper, but this syntax is ambiguous. You should either surround \" + value + \" in quotes or remove `Binding` from \" + prop + \".\");\n } else {\n hash[prop + 'Binding'] = value;\n hashType[prop + 'Binding'] = 'STRING';\n delete hash[prop];\n delete hashType[prop];\n }\n }\n }\n\n if (hash.hasOwnProperty('idBinding')) {\n // id can't be bound, so just perform one-time lookup.\n hash.id = EmberHandlebars.get(thisContext, hash.idBinding, options);\n hashType.id = 'STRING';\n delete hash.idBinding;\n delete hashType.idBinding;\n }\n}\n\nEmberHandlebars.ViewHelper = Ember.Object.create({\n\n propertiesFromHTMLOptions: function(options) {\n var hash = options.hash, data = options.data;\n var extensions = {},\n classes = hash['class'],\n dup = false;\n\n if (hash.id) {\n extensions.elementId = hash.id;\n dup = true;\n }\n\n if (hash.tag) {\n extensions.tagName = hash.tag;\n dup = true;\n }\n\n if (classes) {\n classes = classes.split(' ');\n extensions.classNames = classes;\n dup = true;\n }\n\n if (hash.classBinding) {\n extensions.classNameBindings = hash.classBinding.split(' ');\n dup = true;\n }\n\n if (hash.classNameBindings) {\n if (extensions.classNameBindings === undefined) extensions.classNameBindings = [];\n extensions.classNameBindings = extensions.classNameBindings.concat(hash.classNameBindings.split(' '));\n dup = true;\n }\n\n if (hash.attributeBindings) {\n Ember.assert(\"Setting 'attributeBindings' via Handlebars is not allowed. Please subclass Ember.View and set it there instead.\");\n extensions.attributeBindings = null;\n dup = true;\n }\n\n if (dup) {\n hash = Ember.$.extend({}, hash);\n delete hash.id;\n delete hash.tag;\n delete hash['class'];\n delete hash.classBinding;\n }\n\n // Set the proper context for all bindings passed to the helper. This applies to regular attribute bindings\n // as well as class name bindings. If the bindings are local, make them relative to the current context\n // instead of the view.\n var path;\n\n // Evaluate the context of regular attribute bindings:\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n\n // Test if the property ends in \"Binding\"\n if (Ember.IS_BINDING.test(prop) && typeof hash[prop] === 'string') {\n path = this.contextualizeBindingPath(hash[prop], data);\n if (path) { hash[prop] = path; }\n }\n }\n\n // Evaluate the context of class name bindings:\n if (extensions.classNameBindings) {\n for (var b in extensions.classNameBindings) {\n var full = extensions.classNameBindings[b];\n if (typeof full === 'string') {\n // Contextualize the path of classNameBinding so this:\n //\n // classNameBinding=\"isGreen:green\"\n //\n // is converted to this:\n //\n // classNameBinding=\"_parentView.context.isGreen:green\"\n var parsedPath = Ember.View._parsePropertyPath(full);\n path = this.contextualizeBindingPath(parsedPath.path, data);\n if (path) { extensions.classNameBindings[b] = path + parsedPath.classNames; }\n }\n }\n }\n\n return Ember.$.extend(hash, extensions);\n },\n\n // Transform bindings from the current context to a context that can be evaluated within the view.\n // Returns null if the path shouldn't be changed.\n //\n // TODO: consider the addition of a prefix that would allow this method to return `path`.\n contextualizeBindingPath: function(path, data) {\n var normalized = Ember.Handlebars.normalizePath(null, path, data);\n if (normalized.isKeyword) {\n return 'templateData.keywords.' + path;\n } else if (Ember.isGlobalPath(path)) {\n return null;\n } else if (path === 'this') {\n return '_parentView.context';\n } else {\n return '_parentView.context.' + path;\n }\n },\n\n helper: function(thisContext, path, options) {\n var data = options.data,\n fn = options.fn,\n newView;\n\n makeBindings(thisContext, options);\n\n if ('string' === typeof path) {\n\n // TODO: this is a lame conditional, this should likely change\n // but something along these lines will likely need to be added\n // as deprecation warnings\n //\n if (options.types[0] === 'STRING' && LOWERCASE_A_Z.test(path) && !VIEW_PREFIX.test(path)) {\n Ember.assert(\"View requires a container\", !!data.view.container);\n newView = data.view.container.lookupFactory('view:' + path);\n } else {\n newView = EmberHandlebars.get(thisContext, path, options);\n }\n\n Ember.assert(\"Unable to find view at path '\" + path + \"'\", !!newView);\n } else {\n newView = path;\n }\n\n Ember.assert(Ember.String.fmt('You must pass a view to the #view helper, not %@ (%@)', [path, newView]), Ember.View.detect(newView) || Ember.View.detectInstance(newView));\n\n var viewOptions = this.propertiesFromHTMLOptions(options, thisContext);\n var currentView = data.view;\n viewOptions.templateData = data;\n var newViewProto = newView.proto ? newView.proto() : newView;\n\n if (fn) {\n Ember.assert(\"You cannot provide a template block if you also specified a templateName\", !get(viewOptions, 'templateName') && !get(newViewProto, 'templateName'));\n viewOptions.template = fn;\n }\n\n // We only want to override the `_context` computed property if there is\n // no specified controller. See View#_context for more information.\n if (!newViewProto.controller && !newViewProto.controllerBinding && !viewOptions.controller && !viewOptions.controllerBinding) {\n viewOptions._context = thisContext;\n }\n\n currentView.appendChild(newView, viewOptions);\n }\n});\n\n/**\n `{{view}}` inserts a new instance of `Ember.View` into a template passing its\n options to the `Ember.View`'s `create` method and using the supplied block as\n the view's own template.\n\n An empty `<body>` and the following template:\n\n ```handlebars\n A span:\n {{#view tagName=\"span\"}}\n hello.\n {{/view}}\n ```\n\n Will result in HTML structure:\n\n ```html\n <body>\n <!-- Note: the handlebars template script\n also results in a rendered Ember.View\n which is the outer <div> here -->\n\n <div class=\"ember-view\">\n A span:\n <span id=\"ember1\" class=\"ember-view\">\n Hello.\n </span>\n </div>\n </body>\n ```\n\n ### `parentView` setting\n\n The `parentView` property of the new `Ember.View` instance created through\n `{{view}}` will be set to the `Ember.View` instance of the template where\n `{{view}}` was called.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile(\"{{#view}} my parent: {{parentView.elementId}} {{/view}}\")\n });\n\n aView.appendTo('body');\n ```\n\n Will result in HTML structure:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view\">\n my parent: ember1\n </div>\n </div>\n ```\n\n ### Setting CSS id and class attributes\n\n The HTML `id` attribute can be set on the `{{view}}`'s resulting element with\n the `id` option. This option will _not_ be passed to `Ember.View.create`.\n\n ```handlebars\n {{#view tagName=\"span\" id=\"a-custom-id\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"a-custom-id\" class=\"ember-view\">\n hello.\n </span>\n </div>\n ```\n\n The HTML `class` attribute can be set on the `{{view}}`'s resulting element\n with the `class` or `classNameBindings` options. The `class` option will\n directly set the CSS `class` attribute and will not be passed to\n `Ember.View.create`. `classNameBindings` will be passed to `create` and use\n `Ember.View`'s class name binding functionality:\n\n ```handlebars\n {{#view tagName=\"span\" class=\"a-custom-class\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"ember2\" class=\"ember-view a-custom-class\">\n hello.\n </span>\n </div>\n ```\n\n ### Supplying a different view class\n\n `{{view}}` can take an optional first argument before its supplied options to\n specify a path to a custom view class.\n\n ```handlebars\n {{#view \"MyApp.CustomView\"}}\n hello.\n {{/view}}\n ```\n\n The first argument can also be a relative path accessible from the current\n context.\n\n ```javascript\n MyApp = Ember.Application.create({});\n MyApp.OuterView = Ember.View.extend({\n innerViewClass: Ember.View.extend({\n classNames: ['a-custom-view-class-as-property']\n }),\n template: Ember.Handlebars.compile('{{#view \"view.innerViewClass\"}} hi {{/view}}')\n });\n\n MyApp.OuterView.create().appendTo('body');\n ```\n\n Will result in the following HTML:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view a-custom-view-class-as-property\">\n hi\n </div>\n </div>\n ```\n\n ### Blockless use\n\n If you supply a custom `Ember.View` subclass that specifies its own template\n or provide a `templateName` option to `{{view}}` it can be used without\n supplying a block. Attempts to use both a `templateName` option and supply a\n block will throw an error.\n\n ```handlebars\n {{view \"MyApp.ViewWithATemplateDefined\"}}\n ```\n\n ### `viewName` property\n\n You can supply a `viewName` option to `{{view}}`. The `Ember.View` instance\n will be referenced as a property of its parent view by this name.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile('{{#view viewName=\"aChildByName\"}} hi {{/view}}')\n });\n\n aView.appendTo('body');\n aView.get('aChildByName') // the instance of Ember.View created by {{view}} helper\n ```\n\n @method view\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('view', function(path, options) {\n Ember.assert(\"The view helper only takes a single argument\", arguments.length <= 2);\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = \"Ember.View\";\n }\n\n return EmberHandlebars.ViewHelper.helper(this, path, options);\n});\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/view");minispade.register('ember-handlebars/helpers/yield', "(function() {/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n `{{yield}}` denotes an area of a template that will be rendered inside\n of another template. It has two main uses:\n\n ### Use with `layout`\n When used in a Handlebars template that is assigned to an `Ember.View`\n instance's `layout` property Ember will render the layout template first,\n inserting the view's own rendered output at the `{{yield}}` location.\n\n An empty `<body>` and the following application code:\n\n ```javascript\n AView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n layout: Ember.Handlebars.compile('<div class=\"wrapper\">{{yield}}</div>'),\n template: Ember.Handlebars.compile('<span>I am wrapped</span>')\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will result in the following HTML output:\n\n ```html\n <body>\n <div class='ember-view a-view-with-layout'>\n <div class=\"wrapper\">\n <span>I am wrapped</span>\n </div>\n </div>\n </body>\n ```\n\n The `yield` helper cannot be used outside of a template assigned to an\n `Ember.View`'s `layout` property and will throw an error if attempted.\n\n ```javascript\n BView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n template: Ember.Handlebars.compile('{{yield}}')\n });\n\n bView = BView.create();\n bView.appendTo('body');\n\n // throws\n // Uncaught Error: assertion failed:\n // You called yield in a template that was not a layout\n ```\n\n ### Use with Ember.Component\n When designing components `{{yield}}` is used to denote where, inside the component's\n template, an optional block passed to the component should render:\n\n ```handlebars\n <!-- application.hbs -->\n {{#labeled-textfield value=someProperty}}\n First name:\n {{/labeled-textfield}}\n ```\n\n ```handlebars\n <!-- components/labeled-textfield.hbs -->\n <label>\n {{yield}} {{input value=value}}\n </label>\n ```\n\n Result:\n\n ```html\n <label>\n First name: <input type=\"text\" />\n <label>\n ```\n\n @method yield\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmber.Handlebars.registerHelper('yield', function(options) {\n var view = options.data.view;\n\n while (view && !get(view, 'layout')) {\n if (view._contextView) {\n view = view._contextView;\n } else {\n view = get(view, 'parentView');\n }\n }\n\n Ember.assert(\"You called yield in a template that was not a layout\", !!view);\n\n view._yield(this, options);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/yield");minispade.register('ember-handlebars/loader', "(function() {/*globals Handlebars */\nminispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-handlebars/component_lookup\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n @private\n\n Find templates stored in the head tag as script tags and make them available\n to `Ember.CoreView` in the global `Ember.TEMPLATES` object. This will be run\n as as jQuery DOM-ready callback.\n\n Script tags with `text/x-handlebars` will be compiled\n with Ember's Handlebars and are suitable for use as a view's template.\n Those with type `text/x-raw-handlebars` will be compiled with regular\n Handlebars and are suitable for use in views' computed properties.\n\n @method bootstrap\n @for Ember.Handlebars\n @static\n @param ctx\n*/\nEmber.Handlebars.bootstrap = function(ctx) {\n var selectors = 'script[type=\"text/x-handlebars\"], script[type=\"text/x-raw-handlebars\"]';\n\n Ember.$(selectors, ctx)\n .each(function() {\n // Get a reference to the script tag\n var script = Ember.$(this);\n\n var compile = (script.attr('type') === 'text/x-raw-handlebars') ?\n Ember.$.proxy(Handlebars.compile, Handlebars) :\n Ember.$.proxy(Ember.Handlebars.compile, Ember.Handlebars),\n // Get the name of the script, used by Ember.View's templateName property.\n // First look for data-template-name attribute, then fall back to its\n // id if no name is found.\n templateName = script.attr('data-template-name') || script.attr('id') || 'application',\n template = compile(script.html());\n\n // Check if template of same name already exists\n if (Ember.TEMPLATES[templateName] !== undefined) {\n throw new Ember.Error('Template named \"' + templateName + '\" already exists.');\n }\n\n // For templates which have a name, we save them and then remove them from the DOM\n Ember.TEMPLATES[templateName] = template;\n\n // Remove script tag from DOM\n script.remove();\n });\n};\n\nfunction bootstrap() {\n Ember.Handlebars.bootstrap( Ember.$(document) );\n}\n\nfunction registerComponents(container) {\n var templates = Ember.TEMPLATES, match;\n if (!templates) { return; }\n\n for (var prop in templates) {\n if (match = prop.match(/^components\\/(.*)$/)) {\n registerComponent(container, match[1]);\n }\n }\n}\n\n\nfunction registerComponent(container, name) {\n Ember.assert(\"You provided a template named 'components/\" + name + \"', but custom components must include a '-'\", name.match(/-/));\n\n var fullName = 'component:' + name;\n\n container.injection(fullName, 'layout', 'template:components/' + name);\n\n var Component = container.lookupFactory(fullName);\n\n if (!Component) {\n container.register(fullName, Ember.Component);\n Component = container.lookupFactory(fullName);\n }\n\n Ember.Handlebars.helper(name, Component);\n}\n\nfunction registerComponentLookup(container) {\n container.register('component-lookup:main', Ember.ComponentLookup);\n}\n\n/*\n We tie this to application.load to ensure that we've at least\n attempted to bootstrap at the point that the application is loaded.\n\n We also tie this to document ready since we're guaranteed that all\n the inline templates are present at this point.\n\n There's no harm to running this twice, since we remove the templates\n from the DOM after processing.\n*/\n\nEmber.onLoad('Ember.Application', function(Application) {\n Application.initializer({\n name: 'domTemplates',\n initialize: bootstrap\n });\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n Application.initializer({\n name: 'registerComponentLookup',\n after: 'domTemplates',\n initialize: registerComponentLookup\n });\n } else {\n Application.initializer({\n name: 'registerComponents',\n after: 'domTemplates',\n initialize: registerComponents\n });\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/loader");minispade.register('ember-handlebars', "(function() {minispade.require(\"ember-runtime\");\nminispade.require(\"ember-handlebars-compiler\");\nminispade.require(\"ember-views\");\nminispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-handlebars/string\");\nminispade.require(\"ember-handlebars/helpers\");\nminispade.require(\"ember-handlebars/views\");\nminispade.require(\"ember-handlebars/controls\");\nminispade.require(\"ember-handlebars/loader\");\n\n/**\nEmber Handlebars\n\n@module ember\n@submodule ember-handlebars\n@requires ember-views\n*/\n\nEmber.runLoadHooks('Ember.Handlebars', Ember.Handlebars);\n\n})();\n//@ sourceURL=ember-handlebars");minispade.register('ember-handlebars/string', "(function() {/**\n Mark a string as safe for unescaped output with Handlebars. If you\n return HTML from a Handlebars helper, use this function to\n ensure Handlebars does not escape the HTML.\n\n ```javascript\n Ember.String.htmlSafe('<div>someString</div>')\n ```\n\n @method htmlSafe\n @for Ember.String\n @static\n @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars\n*/\nEmber.String.htmlSafe = function(str) {\n return new Handlebars.SafeString(str);\n};\n\nvar htmlSafe = Ember.String.htmlSafe;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n Mark a string as being safe for unescaped output with Handlebars.\n\n ```javascript\n '<div>someString</div>'.htmlSafe()\n ```\n\n See [Ember.String.htmlSafe](/api/classes/Ember.String.html#method_htmlSafe).\n\n @method htmlSafe\n @for String\n @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars\n */\n String.prototype.htmlSafe = function() {\n return htmlSafe(this);\n };\n}\n\n})();\n//@ sourceURL=ember-handlebars/string");minispade.register('ember-handlebars/views', "(function() {minispade.require(\"ember-handlebars/views/handlebars_bound_view\");\nminispade.require(\"ember-handlebars/views/metamorph_view\");\n\n})();\n//@ sourceURL=ember-handlebars/views");minispade.register('ember-handlebars/views/handlebars_bound_view', "(function() {/*globals Handlebars */\n/*jshint newcap:false*/\nminispade.require(\"metamorph\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set, handlebarsGet = Ember.Handlebars.get;\nvar Metamorph = requireModule('metamorph');\nminispade.require('ember-views/views/view');\nminispade.require('ember-handlebars/views/metamorph_view');\n\nfunction SimpleHandlebarsView(path, pathRoot, isEscaped, templateData) {\n this.path = path;\n this.pathRoot = pathRoot;\n this.isEscaped = isEscaped;\n this.templateData = templateData;\n\n this.morph = Metamorph();\n this.state = 'preRender';\n this.updateId = null;\n this._parentView = null;\n this.buffer = null;\n}\n\nEmber._SimpleHandlebarsView = SimpleHandlebarsView;\n\nSimpleHandlebarsView.prototype = {\n isVirtual: true,\n isView: true,\n\n destroy: function () {\n if (this.updateId) {\n Ember.run.cancel(this.updateId);\n this.updateId = null;\n }\n if (this._parentView) {\n this._parentView.removeChild(this);\n }\n this.morph = null;\n this.state = 'destroyed';\n },\n\n propertyWillChange: Ember.K,\n\n propertyDidChange: Ember.K,\n\n normalizedValue: function() {\n var path = this.path,\n pathRoot = this.pathRoot,\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = this.templateData;\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return result;\n },\n\n renderToBuffer: function(buffer) {\n var string = '';\n\n string += this.morph.startTag();\n string += this.render();\n string += this.morph.endTag();\n\n buffer.push(string);\n },\n\n render: function() {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = this.isEscaped;\n var result = this.normalizedValue();\n\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n return result;\n },\n\n rerender: function() {\n switch(this.state) {\n case 'preRender':\n case 'destroyed':\n break;\n case 'inBuffer':\n throw new Ember.Error(\"Something you did tried to replace an {{expression}} before it was inserted into the DOM.\");\n case 'hasElement':\n case 'inDOM':\n this.updateId = Ember.run.scheduleOnce('render', this, 'update');\n break;\n }\n\n return this;\n },\n\n update: function () {\n this.updateId = null;\n this.morph.html(this.render());\n },\n\n transitionTo: function(state) {\n this.state = state;\n }\n};\n\nvar states = Ember.View.cloneStates(Ember.View.states), merge = Ember.merge;\n\nmerge(states._default, {\n rerenderIfNeeded: Ember.K\n});\n\nmerge(states.inDOM, {\n rerenderIfNeeded: function(view) {\n if (view.normalizedValue() !== view._lastNormalizedValue) {\n view.rerender();\n }\n }\n});\n\n/**\n `Ember._HandlebarsBoundView` is a private view created by the Handlebars\n `{{bind}}` helpers that is used to keep track of bound properties.\n\n Every time a property is bound using a `{{mustache}}`, an anonymous subclass\n of `Ember._HandlebarsBoundView` is created with the appropriate sub-template\n and context set up. When the associated property changes, just the template\n for this view will re-render.\n\n @class _HandlebarsBoundView\n @namespace Ember\n @extends Ember._MetamorphView\n @private\n*/\nEmber._HandlebarsBoundView = Ember._MetamorphView.extend({\n instrumentName: 'boundHandlebars',\n states: states,\n\n /**\n The function used to determine if the `displayTemplate` or\n `inverseTemplate` should be rendered. This should be a function that takes\n a value and returns a Boolean.\n\n @property shouldDisplayFunc\n @type Function\n @default null\n */\n shouldDisplayFunc: null,\n\n /**\n Whether the template rendered by this view gets passed the context object\n of its parent template, or gets passed the value of retrieving `path`\n from the `pathRoot`.\n\n For example, this is true when using the `{{#if}}` helper, because the\n template inside the helper should look up properties relative to the same\n object as outside the block. This would be `false` when used with `{{#with\n foo}}` because the template should receive the object found by evaluating\n `foo`.\n\n @property preserveContext\n @type Boolean\n @default false\n */\n preserveContext: false,\n\n /**\n If `preserveContext` is true, this is the object that will be used\n to render the template.\n\n @property previousContext\n @type Object\n */\n previousContext: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `true`.\n\n @property displayTemplate\n @type Function\n @default null\n */\n displayTemplate: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `false`.\n\n @property inverseTemplate\n @type Function\n @default null\n */\n inverseTemplate: null,\n\n\n /**\n The path to look up on `pathRoot` that is passed to\n `shouldDisplayFunc` to determine which template to render.\n\n In addition, if `preserveContext` is `false,` the object at this path will\n be passed to the template when rendering.\n\n @property path\n @type String\n @default null\n */\n path: null,\n\n /**\n The object from which the `path` will be looked up. Sometimes this is the\n same as the `previousContext`, but in cases where this view has been\n generated for paths that start with a keyword such as `view` or\n `controller`, the path root will be that resolved object.\n\n @property pathRoot\n @type Object\n */\n pathRoot: null,\n\n normalizedValue: function() {\n var path = get(this, 'path'),\n pathRoot = get(this, 'pathRoot'),\n valueNormalizer = get(this, 'valueNormalizerFunc'),\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = get(this, 'templateData');\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return valueNormalizer ? valueNormalizer(result) : result;\n },\n\n rerenderIfNeeded: function() {\n this.currentState.rerenderIfNeeded(this);\n },\n\n /**\n Determines which template to invoke, sets up the correct state based on\n that logic, then invokes the default `Ember.View` `render` implementation.\n\n This method will first look up the `path` key on `pathRoot`,\n then pass that value to the `shouldDisplayFunc` function. If that returns\n `true,` the `displayTemplate` function will be rendered to DOM. Otherwise,\n `inverseTemplate`, if specified, will be rendered.\n\n For example, if this `Ember._HandlebarsBoundView` represented the `{{#with\n foo}}` helper, it would look up the `foo` property of its context, and\n `shouldDisplayFunc` would always return true. The object found by looking\n up `foo` would be passed to `displayTemplate`.\n\n @method render\n @param {Ember.RenderBuffer} buffer\n */\n render: function(buffer) {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = get(this, 'isEscaped');\n\n var shouldDisplay = get(this, 'shouldDisplayFunc'),\n preserveContext = get(this, 'preserveContext'),\n context = get(this, 'previousContext');\n\n var inverseTemplate = get(this, 'inverseTemplate'),\n displayTemplate = get(this, 'displayTemplate');\n\n var result = this.normalizedValue();\n this._lastNormalizedValue = result;\n\n // First, test the conditional to see if we should\n // render the template or not.\n if (shouldDisplay(result)) {\n set(this, 'template', displayTemplate);\n\n // If we are preserving the context (for example, if this\n // is an #if block, call the template with the same object.\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n // Otherwise, determine if this is a block bind or not.\n // If so, pass the specified object to the template\n if (displayTemplate) {\n set(this, '_context', result);\n } else {\n // This is not a bind block, just push the result of the\n // expression to the render context and return.\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n buffer.push(result);\n return;\n }\n }\n } else if (inverseTemplate) {\n set(this, 'template', inverseTemplate);\n\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n set(this, '_context', result);\n }\n } else {\n set(this, 'template', function() { return ''; });\n }\n\n return this._super(buffer);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/views/handlebars_bound_view");minispade.register('ember-handlebars/views/metamorph_view', "(function() {/*jshint newcap:false*/\nminispade.require(\"metamorph\");\nminispade.require(\"ember-views/views/view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set, get = Ember.get;\nvar Metamorph = requireModule('metamorph');\n\nfunction notifyMutationListeners() {\n Ember.run.once(Ember.View, 'notifyMutationListeners');\n}\n\n// DOMManager should just abstract dom manipulation between jquery and metamorph\nvar DOMManager = {\n remove: function(view) {\n view.morph.remove();\n notifyMutationListeners();\n },\n\n prepend: function(view, html) {\n view.morph.prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.morph.after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.morph.html(html);\n notifyMutationListeners();\n },\n\n // This is messed up.\n replace: function(view) {\n var morph = view.morph;\n\n view.transitionTo('preRender');\n\n Ember.run.schedule('render', this, function() {\n if (view.isDestroying) { return; }\n\n view.clearRenderedChildren();\n var buffer = view.renderToBuffer();\n\n view.invokeRecursively(function(view) {\n view.propertyWillChange('element');\n });\n view.triggerRecursively('willInsertElement');\n\n morph.replaceWith(buffer.string());\n view.transitionTo('inDOM');\n\n view.invokeRecursively(function(view) {\n view.propertyDidChange('element');\n });\n view.triggerRecursively('didInsertElement');\n\n notifyMutationListeners();\n });\n },\n\n empty: function(view) {\n view.morph.html(\"\");\n notifyMutationListeners();\n }\n};\n\n// The `morph` and `outerHTML` properties are internal only\n// and not observable.\n\n/**\n @class _Metamorph\n @namespace Ember\n @private\n*/\nEmber._Metamorph = Ember.Mixin.create({\n isVirtual: true,\n tagName: '',\n\n instrumentName: 'metamorph',\n\n init: function() {\n this._super();\n this.morph = Metamorph();\n Ember.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated. You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName);\n },\n\n beforeRender: function(buffer) {\n buffer.push(this.morph.startTag());\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n buffer.push(this.morph.endTag());\n },\n\n createElement: function() {\n var buffer = this.renderToBuffer();\n this.outerHTML = buffer.string();\n this.clearBuffer();\n },\n\n domManager: DOMManager\n});\n\n/**\n @class _MetamorphView\n @namespace Ember\n @extends Ember.View\n @uses Ember._Metamorph\n @private\n*/\nEmber._MetamorphView = Ember.View.extend(Ember._Metamorph);\n\n/**\n @class _SimpleMetamorphView\n @namespace Ember\n @extends Ember.CoreView\n @uses Ember._Metamorph\n @private\n*/\nEmber._SimpleMetamorphView = Ember.CoreView.extend(Ember._Metamorph);\n\n\n})();\n//@ sourceURL=ember-handlebars/views/metamorph_view");minispade.register('ember-metal/array', "(function() {/*jshint newcap:false*/\n/**\n@module ember-metal\n*/\n\n// NOTE: There is a bug in jshint that doesn't recognize `Object()` without `new`\n// as being ok unless both `newcap:false` and not `use strict`.\n// https://github.com/jshint/jshint/issues/392\n\n// Testing this is not ideal, but we want to use native functions\n// if available, but not to use versions created by libraries like Prototype\nvar isNativeFunc = function(func) {\n // This should probably work in all browsers likely to have ES5 array methods\n return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1;\n};\n\n// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/map\nvar arrayMap = isNativeFunc(Array.prototype.map) ? Array.prototype.map : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var res = new Array(len);\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n res[i] = fun.call(thisp, t[i], i, t);\n }\n }\n\n return res;\n};\n\n// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach\nvar arrayForEach = isNativeFunc(Array.prototype.forEach) ? Array.prototype.forEach : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n fun.call(thisp, t[i], i, t);\n }\n }\n};\n\nvar arrayIndexOf = isNativeFunc(Array.prototype.indexOf) ? Array.prototype.indexOf : function (obj, fromIndex) {\n if (fromIndex === null || fromIndex === undefined) { fromIndex = 0; }\n else if (fromIndex < 0) { fromIndex = Math.max(0, this.length + fromIndex); }\n for (var i = fromIndex, j = this.length; i < j; i++) {\n if (this[i] === obj) { return i; }\n }\n return -1;\n};\n\n/**\n Array polyfills to support ES5 features in older browsers.\n\n @namespace Ember\n @property ArrayPolyfills\n*/\nEmber.ArrayPolyfills = {\n map: arrayMap,\n forEach: arrayForEach,\n indexOf: arrayIndexOf\n};\n\nif (Ember.SHIM_ES5) {\n if (!Array.prototype.map) {\n Array.prototype.map = arrayMap;\n }\n\n if (!Array.prototype.forEach) {\n Array.prototype.forEach = arrayForEach;\n }\n\n if (!Array.prototype.indexOf) {\n Array.prototype.indexOf = arrayIndexOf;\n }\n}\n\n})();\n//@ sourceURL=ember-metal/array");minispade.register('ember-metal/binding', "(function() {minispade.require('ember-metal/core'); // Ember.Logger\nminispade.require('ember-metal/property_get'); // get\nminispade.require('ember-metal/property_set'); // set\nminispade.require('ember-metal/utils'); // guidFor, meta\nminispade.require('ember-metal/observer'); // addObserver, removeObserver\nminispade.require('ember-metal/run_loop'); // Ember.run.schedule\nminispade.require('ember-metal/map');\n\n/**\n@module ember-metal\n*/\n\n// ..........................................................\n// CONSTANTS\n//\n\n/**\n Debug parameter you can turn on. This will log all bindings that fire to\n the console. This should be disabled in production code. Note that you\n can also enable this from the console or temporarily.\n\n @property LOG_BINDINGS\n @for Ember\n @type Boolean\n @default false\n*/\nEmber.LOG_BINDINGS = false || !!Ember.ENV.LOG_BINDINGS;\n\nvar get = Ember.get,\n set = Ember.set,\n guidFor = Ember.guidFor,\n IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;\n\n/**\n Returns true if the provided path is global (e.g., `MyApp.fooController.bar`)\n instead of local (`foo.bar.baz`).\n\n @method isGlobalPath\n @for Ember\n @private\n @param {String} path\n @return Boolean\n*/\nvar isGlobalPath = Ember.isGlobalPath = function(path) {\n return IS_GLOBAL.test(path);\n};\n\nfunction getWithGlobals(obj, path) {\n return get(isGlobalPath(path) ? Ember.lookup : obj, path);\n}\n\n// ..........................................................\n// BINDING\n//\n\nvar Binding = function(toPath, fromPath) {\n this._direction = 'fwd';\n this._from = fromPath;\n this._to = toPath;\n this._directionMap = Ember.Map.create();\n};\n\n/**\n@class Binding\n@namespace Ember\n*/\n\nBinding.prototype = {\n /**\n This copies the Binding so it can be connected to another object.\n\n @method copy\n @return {Ember.Binding} `this`\n */\n copy: function () {\n var copy = new Binding(this._to, this._from);\n if (this._oneWay) { copy._oneWay = true; }\n return copy;\n },\n\n // ..........................................................\n // CONFIG\n //\n\n /**\n This will set `from` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method from\n @param {String} path the property path to connect to\n @return {Ember.Binding} `this`\n */\n from: function(path) {\n this._from = path;\n return this;\n },\n\n /**\n This will set the `to` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method to\n @param {String|Tuple} path A property path or tuple\n @return {Ember.Binding} `this`\n */\n to: function(path) {\n this._to = path;\n return this;\n },\n\n /**\n Configures the binding as one way. A one-way binding will relay changes\n on the `from` side to the `to` side, but not the other way around. This\n means that if you change the `to` side directly, the `from` side may have\n a different value.\n\n @method oneWay\n @return {Ember.Binding} `this`\n */\n oneWay: function() {\n this._oneWay = true;\n return this;\n },\n\n /**\n @method toString\n @return {String} string representation of binding\n */\n toString: function() {\n var oneWay = this._oneWay ? '[oneWay]' : '';\n return \"Ember.Binding<\" + guidFor(this) + \">(\" + this._from + \" -> \" + this._to + \")\" + oneWay;\n },\n\n // ..........................................................\n // CONNECT AND SYNC\n //\n\n /**\n Attempts to connect this binding instance so that it can receive and relay\n changes. This method will raise an exception if you have not set the\n from/to properties yet.\n\n @method connect\n @param {Object} obj The root object for this binding.\n @return {Ember.Binding} `this`\n */\n connect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);\n\n var fromPath = this._from, toPath = this._to;\n Ember.trySet(obj, toPath, getWithGlobals(obj, fromPath));\n\n // add an observer on the object to be notified when the binding should be updated\n Ember.addObserver(obj, fromPath, this, this.fromDidChange);\n\n // if the binding is a two-way binding, also set up an observer on the target\n if (!this._oneWay) { Ember.addObserver(obj, toPath, this, this.toDidChange); }\n\n this._readyToSync = true;\n\n return this;\n },\n\n /**\n Disconnects the binding instance. Changes will no longer be relayed. You\n will not usually need to call this method.\n\n @method disconnect\n @param {Object} obj The root object you passed when connecting the binding.\n @return {Ember.Binding} `this`\n */\n disconnect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);\n\n var twoWay = !this._oneWay;\n\n // remove an observer on the object so we're no longer notified of\n // changes that should update bindings.\n Ember.removeObserver(obj, this._from, this, this.fromDidChange);\n\n // if the binding is two-way, remove the observer from the target as well\n if (twoWay) { Ember.removeObserver(obj, this._to, this, this.toDidChange); }\n\n this._readyToSync = false; // disable scheduled syncs...\n return this;\n },\n\n // ..........................................................\n // PRIVATE\n //\n\n /* called when the from side changes */\n fromDidChange: function(target) {\n this._scheduleSync(target, 'fwd');\n },\n\n /* called when the to side changes */\n toDidChange: function(target) {\n this._scheduleSync(target, 'back');\n },\n\n _scheduleSync: function(obj, dir) {\n var directionMap = this._directionMap;\n var existingDir = directionMap.get(obj);\n\n // if we haven't scheduled the binding yet, schedule it\n if (!existingDir) {\n Ember.run.schedule('sync', this, this._sync, obj);\n directionMap.set(obj, dir);\n }\n\n // If both a 'back' and 'fwd' sync have been scheduled on the same object,\n // default to a 'fwd' sync so that it remains deterministic.\n if (existingDir === 'back' && dir === 'fwd') {\n directionMap.set(obj, 'fwd');\n }\n },\n\n _sync: function(obj) {\n var log = Ember.LOG_BINDINGS;\n\n // don't synchronize destroyed objects or disconnected bindings\n if (obj.isDestroyed || !this._readyToSync) { return; }\n\n // get the direction of the binding for the object we are\n // synchronizing from\n var directionMap = this._directionMap;\n var direction = directionMap.get(obj);\n\n var fromPath = this._from, toPath = this._to;\n\n directionMap.remove(obj);\n\n // if we're synchronizing from the remote object...\n if (direction === 'fwd') {\n var fromValue = getWithGlobals(obj, this._from);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '->', fromValue, obj);\n }\n if (this._oneWay) {\n Ember.trySet(obj, toPath, fromValue);\n } else {\n Ember._suspendObserver(obj, toPath, this, this.toDidChange, function () {\n Ember.trySet(obj, toPath, fromValue);\n });\n }\n // if we're synchronizing *to* the remote object\n } else if (direction === 'back') {\n var toValue = get(obj, this._to);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '<-', toValue, obj);\n }\n Ember._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {\n Ember.trySet(Ember.isGlobalPath(fromPath) ? Ember.lookup : obj, fromPath, toValue);\n });\n }\n }\n\n};\n\nfunction mixinProperties(to, from) {\n for (var key in from) {\n if (from.hasOwnProperty(key)) {\n to[key] = from[key];\n }\n }\n}\n\nmixinProperties(Binding, {\n\n /*\n See `Ember.Binding.from`.\n\n @method from\n @static\n */\n from: function() {\n var C = this, binding = new C();\n return binding.from.apply(binding, arguments);\n },\n\n /*\n See `Ember.Binding.to`.\n\n @method to\n @static\n */\n to: function() {\n var C = this, binding = new C();\n return binding.to.apply(binding, arguments);\n },\n\n /**\n Creates a new Binding instance and makes it apply in a single direction.\n A one-way binding will relay changes on the `from` side object (supplied\n as the `from` argument) the `to` side, but not the other way around.\n This means that if you change the \"to\" side directly, the \"from\" side may have\n a different value.\n\n See `Binding.oneWay`.\n\n @method oneWay\n @param {String} from from path.\n @param {Boolean} [flag] (Optional) passing nothing here will make the\n binding `oneWay`. You can instead pass `false` to disable `oneWay`, making the\n binding two way again.\n @return {Ember.Binding} `this`\n */\n oneWay: function(from, flag) {\n var C = this, binding = new C(null, from);\n return binding.oneWay(flag);\n }\n\n});\n\n/**\n An `Ember.Binding` connects the properties of two objects so that whenever\n the value of one property changes, the other property will be changed also.\n\n ## Automatic Creation of Bindings with `/^*Binding/`-named Properties\n\n You do not usually create Binding objects directly but instead describe\n bindings in your class or object definition using automatic binding\n detection.\n\n Properties ending in a `Binding` suffix will be converted to `Ember.Binding`\n instances. The value of this property should be a string representing a path\n to another object or a custom binding instanced created using Binding helpers\n (see \"One Way Bindings\"):\n\n ```\n valueBinding: \"MyApp.someController.title\"\n ```\n\n This will create a binding from `MyApp.someController.title` to the `value`\n property of your object instance automatically. Now the two values will be\n kept in sync.\n\n ## One Way Bindings\n\n One especially useful binding customization you can use is the `oneWay()`\n helper. This helper tells Ember that you are only interested in\n receiving changes on the object you are binding from. For example, if you\n are binding to a preference and you want to be notified if the preference\n has changed, but your object will not be changing the preference itself, you\n could do:\n\n ```\n bigTitlesBinding: Ember.Binding.oneWay(\"MyApp.preferencesController.bigTitles\")\n ```\n\n This way if the value of `MyApp.preferencesController.bigTitles` changes the\n `bigTitles` property of your object will change also. However, if you\n change the value of your `bigTitles` property, it will not update the\n `preferencesController`.\n\n One way bindings are almost twice as fast to setup and twice as fast to\n execute because the binding only has to worry about changes to one side.\n\n You should consider using one way bindings anytime you have an object that\n may be created frequently and you do not intend to change a property; only\n to monitor it for changes (such as in the example above).\n\n ## Adding Bindings Manually\n\n All of the examples above show you how to configure a custom binding, but the\n result of these customizations will be a binding template, not a fully active\n Binding instance. The binding will actually become active only when you\n instantiate the object the binding belongs to. It is useful however, to\n understand what actually happens when the binding is activated.\n\n For a binding to function it must have at least a `from` property and a `to`\n property. The `from` property path points to the object/key that you want to\n bind from while the `to` path points to the object/key you want to bind to.\n\n When you define a custom binding, you are usually describing the property\n you want to bind from (such as `MyApp.someController.value` in the examples\n above). When your object is created, it will automatically assign the value\n you want to bind `to` based on the name of your binding key. In the\n examples above, during init, Ember objects will effectively call\n something like this on your binding:\n\n ```javascript\n binding = Ember.Binding.from(this.valueBinding).to(\"value\");\n ```\n\n This creates a new binding instance based on the template you provide, and\n sets the to path to the `value` property of the new object. Now that the\n binding is fully configured with a `from` and a `to`, it simply needs to be\n connected to become active. This is done through the `connect()` method:\n\n ```javascript\n binding.connect(this);\n ```\n\n Note that when you connect a binding you pass the object you want it to be\n connected to. This object will be used as the root for both the from and\n to side of the binding when inspecting relative paths. This allows the\n binding to be automatically inherited by subclassed objects as well.\n\n Now that the binding is connected, it will observe both the from and to side\n and relay changes.\n\n If you ever needed to do so (you almost never will, but it is useful to\n understand this anyway), you could manually create an active binding by\n using the `Ember.bind()` helper method. (This is the same method used by\n to setup your bindings on objects):\n\n ```javascript\n Ember.bind(MyApp.anotherObject, \"value\", \"MyApp.someController.value\");\n ```\n\n Both of these code fragments have the same effect as doing the most friendly\n form of binding creation like so:\n\n ```javascript\n MyApp.anotherObject = Ember.Object.create({\n valueBinding: \"MyApp.someController.value\",\n\n // OTHER CODE FOR THIS OBJECT...\n });\n ```\n\n Ember's built in binding creation method makes it easy to automatically\n create bindings for you. You should always use the highest-level APIs\n available, even if you understand how it works underneath.\n\n @class Binding\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Binding = Binding;\n\n\n/**\n Global helper method to create a new binding. Just pass the root object\n along with a `to` and `from` path to create and connect the binding.\n\n @method bind\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n*/\nEmber.bind = function(obj, to, from) {\n return new Ember.Binding(to, from).connect(obj);\n};\n\n/**\n @method oneWay\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n*/\nEmber.oneWay = function(obj, to, from) {\n return new Ember.Binding(to, from).oneWay().connect(obj);\n};\n\n})();\n//@ sourceURL=ember-metal/binding");minispade.register('ember-metal/chains', "(function() {minispade.require('ember-metal/utils');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/watch_key');\n\nvar metaFor = Ember.meta, // utils.js\n get = Ember.get, // property_get.js\n normalizeTuple = Ember.normalizeTuple, // property_get.js\n forEach = Ember.ArrayPolyfills.forEach, // array.js\n warn = Ember.warn,\n watchKey = Ember.watchKey,\n unwatchKey = Ember.unwatchKey,\n FIRST_KEY = /^([^\\.\\*]+)/;\n\nfunction firstKey(path) {\n return path.match(FIRST_KEY)[0];\n}\n\nvar pendingQueue = [];\n\n// attempts to add the pendingQueue chains again. If some of them end up\n// back in the queue and reschedule is true, schedules a timeout to try\n// again.\nEmber.flushPendingChains = function() {\n if (pendingQueue.length === 0) { return; } // nothing to do\n\n var queue = pendingQueue;\n pendingQueue = [];\n\n forEach.call(queue, function(q) { q[0].add(q[1]); });\n\n warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);\n};\n\n\nfunction addChainWatcher(obj, keyName, node) {\n if (!obj || ('object' !== typeof obj)) { return; } // nothing to do\n\n var m = metaFor(obj), nodes = m.chainWatchers;\n\n if (!m.hasOwnProperty('chainWatchers')) {\n nodes = m.chainWatchers = {};\n }\n\n if (!nodes[keyName]) { nodes[keyName] = []; }\n nodes[keyName].push(node);\n watchKey(obj, keyName);\n}\n\nvar removeChainWatcher = Ember.removeChainWatcher = function(obj, keyName, node) {\n if (!obj || 'object' !== typeof obj) { return; } // nothing to do\n\n var m = metaFor(obj, false);\n if (!m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m.chainWatchers;\n\n if (nodes[keyName]) {\n nodes = nodes[keyName];\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i] === node) { nodes.splice(i, 1); }\n }\n }\n unwatchKey(obj, keyName);\n};\n\n// A ChainNode watches a single key on an object. If you provide a starting\n// value for the key then the node won't actually watch it. For a root node\n// pass null for parent and key and object for value.\nvar ChainNode = Ember._ChainNode = function(parent, key, value) {\n this._parent = parent;\n this._key = key;\n\n // _watching is true when calling get(this._parent, this._key) will\n // return the value of this node.\n //\n // It is false for the root of a chain (because we have no parent)\n // and for global paths (because the parent node is the object with\n // the observer on it)\n this._watching = value===undefined;\n\n this._value = value;\n this._paths = {};\n if (this._watching) {\n this._object = parent.value();\n if (this._object) { addChainWatcher(this._object, this._key, this); }\n }\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n //\n // TODO: Replace this with an efficient callback that the EachProxy\n // can implement.\n if (this._parent && this._parent._key === '@each') {\n this.value();\n }\n};\n\nvar ChainNodePrototype = ChainNode.prototype;\n\nfunction lazyGet(obj, key) {\n if (!obj) return undefined;\n\n var meta = metaFor(obj, false);\n // check if object meant only to be a prototype\n if (meta.proto === obj) return undefined;\n\n if (key === \"@each\") return get(obj, key);\n\n // if a CP only return cached value\n var desc = meta.descs[key];\n if (desc && desc._cacheable) {\n if (key in meta.cache) {\n return meta.cache[key];\n } else {\n return undefined;\n }\n }\n\n return get(obj, key);\n}\n\nChainNodePrototype.value = function() {\n if (this._value === undefined && this._watching) {\n var obj = this._parent.value();\n this._value = lazyGet(obj, this._key);\n }\n return this._value;\n};\n\nChainNodePrototype.destroy = function() {\n if (this._watching) {\n var obj = this._object;\n if (obj) { removeChainWatcher(obj, this._key, this); }\n this._watching = false; // so future calls do nothing\n }\n};\n\n// copies a top level object only\nChainNodePrototype.copy = function(obj) {\n var ret = new ChainNode(null, null, obj),\n paths = this._paths, path;\n for (path in paths) {\n if (paths[path] <= 0) { continue; } // this check will also catch non-number vals.\n ret.add(path);\n }\n return ret;\n};\n\n// called on the root node of a chain to setup watchers on the specified\n// path.\nChainNodePrototype.add = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n paths[path] = (paths[path] || 0) + 1;\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n\n // the path was a local path\n if (tuple[0] && tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n\n // global path, but object does not exist yet.\n // put into a queue and try to connect later.\n } else if (!tuple[0]) {\n pendingQueue.push([this, path]);\n tuple.length = 0;\n return;\n\n // global path, and object already exists\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.chain(key, path, src);\n};\n\n// called on the root node of a chain to teardown watcher on the specified\n// path\nChainNodePrototype.remove = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n if (paths[path] > 0) { paths[path]--; }\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n if (tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.unchain(key, path);\n};\n\nChainNodePrototype.count = 0;\n\nChainNodePrototype.chain = function(key, path, src) {\n var chains = this._chains, node;\n if (!chains) { chains = this._chains = {}; }\n\n node = chains[key];\n if (!node) { node = chains[key] = new ChainNode(this, key, src); }\n node.count++; // count chains...\n\n // chain rest of path if there is one\n if (path && path.length>0) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.chain(key, path); // NOTE: no src means it will observe changes...\n }\n};\n\nChainNodePrototype.unchain = function(key, path) {\n var chains = this._chains, node = chains[key];\n\n // unchain rest of path first...\n if (path && path.length>1) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.unchain(key, path);\n }\n\n // delete node if needed.\n node.count--;\n if (node.count<=0) {\n delete chains[node._key];\n node.destroy();\n }\n\n};\n\nChainNodePrototype.willChange = function(events) {\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].willChange(events);\n }\n }\n\n if (this._parent) { this._parent.chainWillChange(this, this._key, 1, events); }\n};\n\nChainNodePrototype.chainWillChange = function(chain, path, depth, events) {\n if (this._key) { path = this._key + '.' + path; }\n\n if (this._parent) {\n this._parent.chainWillChange(this, path, depth+1, events);\n } else {\n if (depth > 1) {\n events.push(this.value(), path);\n }\n path = 'this.' + path;\n if (this._paths[path] > 0) {\n events.push(this.value(), path);\n }\n }\n};\n\nChainNodePrototype.chainDidChange = function(chain, path, depth, events) {\n if (this._key) { path = this._key + '.' + path; }\n if (this._parent) {\n this._parent.chainDidChange(this, path, depth+1, events);\n } else {\n if (depth > 1) {\n events.push(this.value(), path);\n }\n path = 'this.' + path;\n if (this._paths[path] > 0) {\n events.push(this.value(), path);\n }\n }\n};\n\nChainNodePrototype.didChange = function(events) {\n // invalidate my own value first.\n if (this._watching) {\n var obj = this._parent.value();\n if (obj !== this._object) {\n removeChainWatcher(this._object, this._key, this);\n this._object = obj;\n addChainWatcher(obj, this._key, this);\n }\n this._value = undefined;\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n if (this._parent && this._parent._key === '@each')\n this.value();\n }\n\n // then notify chains...\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].didChange(events);\n }\n }\n\n // if no events are passed in then we only care about the above wiring update\n if (events === null) { return; }\n\n // and finally tell parent about my path changing...\n if (this._parent) { this._parent.chainDidChange(this, this._key, 1, events); }\n};\n\nEmber.finishChains = function(obj) {\n var m = metaFor(obj, false), chains = m.chains;\n if (chains) {\n if (chains.value() !== obj) {\n m.chains = chains = chains.copy(obj);\n }\n chains.didChange(null);\n }\n};\n\n})();\n//@ sourceURL=ember-metal/chains");minispade.register('ember-metal/computed', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/expand_properties');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/property_set');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/watching');\nminispade.require('ember-metal/property_events');\n\n/**\n@module ember-metal\n*/\n\nEmber.warn(\"The CP_DEFAULT_CACHEABLE flag has been removed and computed properties are always cached by default. Use `volatile` if you don't want caching.\", Ember.ENV.CP_DEFAULT_CACHEABLE !== false);\n\n\nvar get = Ember.get,\n set = Ember.set,\n metaFor = Ember.meta,\n a_slice = [].slice,\n o_create = Ember.create,\n META_KEY = Ember.META_KEY,\n watch = Ember.watch,\n unwatch = Ember.unwatch;\n\nif (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n var expandProperties = Ember.expandProperties;\n}\n\n// ..........................................................\n// DEPENDENT KEYS\n//\n\n// data structure:\n// meta.deps = {\n// 'depKey': {\n// 'keyName': count,\n// }\n// }\n\n/*\n This function returns a map of unique dependencies for a\n given object and key.\n*/\nfunction keysForDep(depsMeta, depKey) {\n var keys = depsMeta[depKey];\n if (!keys) {\n // if there are no dependencies yet for a the given key\n // create a new empty list of dependencies for the key\n keys = depsMeta[depKey] = {};\n } else if (!depsMeta.hasOwnProperty(depKey)) {\n // otherwise if the dependency list is inherited from\n // a superclass, clone the hash\n keys = depsMeta[depKey] = o_create(keys);\n }\n return keys;\n}\n\nfunction metaForDeps(meta) {\n return keysForDep(meta, 'deps');\n}\n\nfunction addDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) + 1;\n // Watch the depKey\n watch(obj, depKey);\n }\n}\n\nfunction removeDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) - 1;\n // Watch the depKey\n unwatch(obj, depKey);\n }\n}\n\n// ..........................................................\n// COMPUTED PROPERTY\n//\n\n/**\n A computed property transforms an objects function into a property.\n\n By default the function backing the computed property will only be called\n once and the result will be cached. You can specify various properties\n that your computed property is dependent on. This will force the cached\n result to be recomputed if the dependencies are modified.\n\n In the following example we declare a computed property (by calling\n `.property()` on the fullName function) and setup the properties\n dependencies (depending on firstName and lastName). The fullName function\n will be called once (regardless of how many times it is accessed) as long\n as it's dependencies have not been changed. Once firstName or lastName are updated\n any future calls (or anything bound) to fullName will incorporate the new\n values.\n\n ```javascript\n Person = Ember.Object.extend({\n // these will be supplied by `create`\n firstName: null,\n lastName: null,\n\n fullName: function() {\n var firstName = this.get('firstName');\n var lastName = this.get('lastName');\n\n return firstName + ' ' + lastName;\n }.property('firstName', 'lastName')\n });\n\n var tom = Person.create({\n firstName: \"Tom\",\n lastName: \"Dale\"\n });\n\n tom.get('fullName') // \"Tom Dale\"\n ```\n\n You can also define what Ember should do when setting a computed property.\n If you try to set a computed property, it will be invoked with the key and\n value you want to set it to. You can also accept the previous value as the\n third parameter.\n\n ```javascript\n\n Person = Ember.Object.extend({\n // these will be supplied by `create`\n firstName: null,\n lastName: null,\n\n fullName: function(key, value, oldValue) {\n // getter\n if (arguments.length === 1) {\n var firstName = this.get('firstName');\n var lastName = this.get('lastName');\n\n return firstName + ' ' + lastName;\n\n // setter\n } else {\n var name = value.split(\" \");\n\n this.set('firstName', name[0]);\n this.set('lastName', name[1]);\n\n return value;\n }\n }.property('firstName', 'lastName')\n });\n\n var person = Person.create();\n person.set('fullName', \"Peter Wagenet\");\n person.get('firstName') // Peter\n person.get('lastName') // Wagenet\n ```\n\n @class ComputedProperty\n @namespace Ember\n @extends Ember.Descriptor\n @constructor\n*/\nfunction ComputedProperty(func, opts) {\n this.func = func;\n\n this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;\n this._dependentKeys = opts && opts.dependentKeys;\n this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly);\n}\n\nEmber.ComputedProperty = ComputedProperty;\nComputedProperty.prototype = new Ember.Descriptor();\n\nvar ComputedPropertyPrototype = ComputedProperty.prototype;\n\n/**\n Properties are cacheable by default. Computed property will automatically\n cache the return value of your function until one of the dependent keys changes.\n\n Call `volatile()` to set it into non-cached mode. When in this mode\n the computed property will not automatically cache the return value.\n\n However, if a property is properly observable, there is no reason to disable\n caching.\n\n @method cacheable\n @param {Boolean} aFlag optional set to `false` to disable caching\n @return {Ember.ComputedProperty} this\n @chainable\n*/\nComputedPropertyPrototype.cacheable = function(aFlag) {\n this._cacheable = aFlag !== false;\n return this;\n};\n\n/**\n Call on a computed property to set it into non-cached mode. When in this\n mode the computed property will not automatically cache the return value.\n\n ```javascript\n MyApp.outsideService = Ember.Object.create({\n value: function() {\n return OutsideService.getValue();\n }.property().volatile()\n });\n ```\n\n @method volatile\n @return {Ember.ComputedProperty} this\n @chainable\n*/\nComputedPropertyPrototype.volatile = function() {\n return this.cacheable(false);\n};\n\n/**\n Call on a computed property to set it into read-only mode. When in this\n mode the computed property will throw an error when set.\n\n ```javascript\n MyApp.person = Ember.Object.create({\n guid: function() {\n return 'guid-guid-guid';\n }.property().readOnly()\n });\n\n MyApp.person.set('guid', 'new-guid'); // will throw an exception\n ```\n\n @method readOnly\n @return {Ember.ComputedProperty} this\n @chainable\n*/\nComputedPropertyPrototype.readOnly = function(readOnly) {\n this._readOnly = readOnly === undefined || !!readOnly;\n return this;\n};\n\n/**\n Sets the dependent keys on this computed property. Pass any number of\n arguments containing key paths that this computed property depends on.\n\n ```javascript\n MyApp.president = Ember.Object.create({\n fullName: Ember.computed(function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember that this computed property depends on firstName\n // and lastName\n }).property('firstName', 'lastName')\n });\n ```\n\n @method property\n @param {String} path* zero or more property paths\n @return {Ember.ComputedProperty} this\n @chainable\n*/\nComputedPropertyPrototype.property = function() {\n var addArg;\n\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n // Slightly odd setup to keep JSHint happy\n addArg = function(arg) { args.push(arg); };\n }\n\n var args = [];\n for (var i = 0, l = arguments.length; i < l; i++) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(arguments[i], addArg);\n } else {\n args.push(arguments[i]);\n }\n }\n this._dependentKeys = args;\n return this;\n};\n\n/**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For example,\n computed property functions may close over variables that are then no longer\n available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n The hash that you pass to the `meta()` function will be saved on the\n computed property descriptor under the `_meta` key. Ember runtime\n exposes a public API for retrieving these values from classes,\n via the `metaForProperty()` function.\n\n @method meta\n @param {Hash} meta\n @chainable\n*/\n\nComputedPropertyPrototype.meta = function(meta) {\n if (arguments.length === 0) {\n return this._meta || {};\n } else {\n this._meta = meta;\n return this;\n }\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.didChange = function(obj, keyName) {\n // _suspended is set via a CP.set to ensure we don't clear\n // the cached value set by the setter\n if (this._cacheable && this._suspended !== obj) {\n var meta = metaFor(obj);\n if (keyName in meta.cache) {\n delete meta.cache[keyName];\n removeDependentKeys(this, obj, keyName, meta);\n }\n }\n};\n\nfunction finishChains(chainNodes)\n{\n for (var i=0, l=chainNodes.length; i<l; i++) {\n chainNodes[i].didChange(null);\n }\n}\n\n/**\n Access the value of the function backing the computed property.\n If this property has already been cached, return the cached result.\n Otherwise, call the function passing the property name as an argument.\n\n ```javascript\n Person = Ember.Object.extend({\n fullName: function(keyName) {\n // the keyName parameter is 'fullName' in this case.\n\n return this.get('firstName') + ' ' + this.get('lastName');\n }.property('firstName', 'lastName')\n });\n\n\n var tom = Person.create({\n firstName: \"Tom\",\n lastName: \"Dale\"\n });\n\n tom.get('fullName') // \"Tom Dale\"\n ```\n\n @method get\n @param {String} keyName The key being accessed.\n @return {Object} The return value of the function backing the CP.\n*/\nComputedPropertyPrototype.get = function(obj, keyName) {\n var ret, cache, meta, chainNodes;\n if (this._cacheable) {\n meta = metaFor(obj);\n cache = meta.cache;\n if (keyName in cache) { return cache[keyName]; }\n ret = cache[keyName] = this.func.call(obj, keyName);\n chainNodes = meta.chainWatchers && meta.chainWatchers[keyName];\n if (chainNodes) { finishChains(chainNodes); }\n addDependentKeys(this, obj, keyName, meta);\n } else {\n ret = this.func.call(obj, keyName);\n }\n return ret;\n};\n\n/**\n Set the value of a computed property. If the function that backs your\n computed property does not accept arguments then the default action for\n setting would be to define the property on the current object, and set\n the value of the property to the value being set.\n\n Generally speaking if you intend for your computed property to be set\n your backing function should accept either two or three arguments.\n\n @method set\n @param {String} keyName The key being accessed.\n @param {Object} newValue The new value being assigned.\n @param {String} oldValue The old value being replaced.\n @return {Object} The return value of the function backing the CP.\n*/\nComputedPropertyPrototype.set = function(obj, keyName, value) {\n var cacheable = this._cacheable,\n func = this.func,\n meta = metaFor(obj, cacheable),\n watched = meta.watching[keyName],\n oldSuspended = this._suspended,\n hadCachedValue = false,\n cache = meta.cache,\n funcArgLength, cachedValue, ret;\n\n if (this._readOnly) {\n throw new Ember.Error('Cannot Set: ' + keyName + ' on: ' + obj.toString() );\n }\n\n this._suspended = obj;\n\n try {\n\n if (cacheable && cache.hasOwnProperty(keyName)) {\n cachedValue = cache[keyName];\n hadCachedValue = true;\n }\n\n // Check if the CP has been wrapped. If if has, use the\n // length from the wrapped function.\n funcArgLength = (func.wrappedFunction ? func.wrappedFunction.length : func.length);\n\n // For backwards-compatibility with computed properties\n // that check for arguments.length === 2 to determine if\n // they are being get or set, only pass the old cached\n // value if the computed property opts into a third\n // argument.\n if (funcArgLength === 3) {\n ret = func.call(obj, keyName, value, cachedValue);\n } else if (funcArgLength === 2) {\n ret = func.call(obj, keyName, value);\n } else {\n Ember.defineProperty(obj, keyName, null, cachedValue);\n Ember.set(obj, keyName, value);\n return;\n }\n\n if (hadCachedValue && cachedValue === ret) { return; }\n\n if (watched) { Ember.propertyWillChange(obj, keyName); }\n\n if (hadCachedValue) {\n delete cache[keyName];\n }\n\n if (cacheable) {\n if (!hadCachedValue) {\n addDependentKeys(this, obj, keyName, meta);\n }\n cache[keyName] = ret;\n }\n\n if (watched) { Ember.propertyDidChange(obj, keyName); }\n } finally {\n this._suspended = oldSuspended;\n }\n return ret;\n};\n\n/* called before property is overridden */\nComputedPropertyPrototype.teardown = function(obj, keyName) {\n var meta = metaFor(obj);\n\n if (keyName in meta.cache) {\n removeDependentKeys(this, obj, keyName, meta);\n }\n\n if (this._cacheable) { delete meta.cache[keyName]; }\n\n return null; // no value to restore\n};\n\n\n/**\n This helper returns a new property descriptor that wraps the passed\n computed property function. You can use this helper to define properties\n with mixins or via `Ember.defineProperty()`.\n\n The function you pass will be used to both get and set property values.\n The function should accept two parameters, key and value. If value is not\n undefined you should set the value first. In either case return the\n current value of the property.\n @method computed\n @for Ember\n @param {Function} func The computed property function.\n @return {Ember.ComputedProperty} property descriptor instance\n*/\nEmber.computed = function(func) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n func = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Computed Property declared without a property function\");\n }\n\n var cp = new ComputedProperty(func);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n};\n\n/**\n Returns the cached value for a property, if one exists.\n This can be useful for peeking at the value of a computed\n property that is generated lazily, without accidentally causing\n it to be created.\n\n @method cacheFor\n @for Ember\n @param {Object} obj the object whose property you want to check\n @param {String} key the name of the property whose cached value you want\n to return\n @return {*} the cached value\n*/\nEmber.cacheFor = function cacheFor(obj, key) {\n var cache = metaFor(obj, false).cache;\n\n if (cache && key in cache) {\n return cache[key];\n }\n};\n\nfunction getProperties(self, propertyNames) {\n var ret = {};\n for(var i = 0; i < propertyNames.length; i++) {\n ret[propertyNames[i]] = get(self, propertyNames[i]);\n }\n return ret;\n}\n\nfunction registerComputed(name, macro) {\n Ember.computed[name] = function(dependentKey) {\n var args = a_slice.call(arguments);\n return Ember.computed(dependentKey, function() {\n return macro.apply(this, args);\n });\n };\n}\n\nfunction registerComputedWithProperties(name, macro) {\n Ember.computed[name] = function() {\n var properties = a_slice.call(arguments);\n\n var computed = Ember.computed(function() {\n return macro.apply(this, [getProperties(this, properties)]);\n });\n\n return computed.property.apply(computed, properties);\n };\n}\n\n/**\n A computed property that returns true if the value of the dependent\n property is null, an empty string, empty array, or empty function.\n\n Note: When using `Ember.computed.empty` to watch an array make sure to\n use the `array.[]` syntax so the computed can subscribe to transitions\n from empty to non-empty states.\n\n Example\n\n ```javascript\n var ToDoList = Ember.Object.extend({\n done: Ember.computed.empty('todos.[]') // detect array changes\n });\n var todoList = ToDoList.create({todos: ['Unit Test', 'Documentation', 'Release']});\n todoList.get('done'); // false\n todoList.get('todos').clear(); // []\n todoList.get('done'); // true\n ```\n\n @method computed.empty\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which negate\n the original value for property\n*/\nregisterComputed('empty', function(dependentKey) {\n return Ember.isEmpty(get(this, dependentKey));\n});\n\n/**\n A computed property that returns true if the value of the dependent\n property is NOT null, an empty string, empty array, or empty function.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasStuff: Ember.computed.notEmpty('backpack')\n });\n var hampster = Hampster.create({backpack: ['Food', 'Sleeping Bag', 'Tent']});\n hampster.get('hasStuff'); // true\n hampster.get('backpack').clear(); // []\n hampster.get('hasStuff'); // false\n ```\n\n @method computed.notEmpty\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which returns true if\n original value for property is not empty.\n*/\nregisterComputed('notEmpty', function(dependentKey) {\n return !Ember.isEmpty(get(this, dependentKey));\n});\n\n/**\n A computed property that returns true if the value of the dependent\n property is null or undefined. This avoids errors from JSLint complaining\n about use of ==, which can be technically confusing.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n isHungry: Ember.computed.none('food')\n });\n var hampster = Hampster.create();\n hampster.get('isHungry'); // true\n hampster.set('food', 'Banana');\n hampster.get('isHungry'); // false\n hampster.set('food', null);\n hampster.get('isHungry'); // true\n ```\n\n @method computed.none\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which\n returns true if original value for property is null or undefined.\n*/\nregisterComputed('none', function(dependentKey) {\n return Ember.isNone(get(this, dependentKey));\n});\n\n/**\n A computed property that returns the inverse boolean value\n of the original value for the dependent property.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n isAnonymous: Ember.computed.not('loggedIn')\n });\n var user = User.create({loggedIn: false});\n user.get('isAnonymous'); // true\n user.set('loggedIn', true);\n user.get('isAnonymous'); // false\n ```\n\n @method computed.not\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which returns\n inverse of the original value for property\n*/\nregisterComputed('not', function(dependentKey) {\n return !get(this, dependentKey);\n});\n\n/**\n A computed property that converts the provided dependent property\n into a boolean value.\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasBananas: Ember.computed.bool('numBananas')\n });\n var hampster = Hampster.create();\n hampster.get('hasBananas'); // false\n hampster.set('numBananas', 0);\n hampster.get('hasBananas'); // false\n hampster.set('numBananas', 1);\n hampster.get('hasBananas'); // true\n hampster.set('numBananas', null);\n hampster.get('hasBananas'); // false\n ```\n\n @method computed.bool\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which converts\n to boolean the original value for property\n*/\nregisterComputed('bool', function(dependentKey) {\n return !!get(this, dependentKey);\n});\n\n/**\n A computed property which matches the original value for the\n dependent property against a given RegExp, returning `true`\n if they values matches the RegExp and `false` if it does not.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n hasValidEmail: Ember.computed.match('email', /^.+@.+\\..+$/)\n });\n var user = User.create({loggedIn: false});\n user.get('hasValidEmail'); // false\n user.set('email', '');\n user.get('hasValidEmail'); // false\n user.set('email', 'ember_hampster@example.com');\n user.get('hasValidEmail'); // true\n ```\n\n @method computed.match\n @for Ember\n @param {String} dependentKey\n @param {RegExp} regexp\n @return {Ember.ComputedProperty} computed property which match\n the original value for property against a given RegExp\n*/\nregisterComputed('match', function(dependentKey, regexp) {\n var value = get(this, dependentKey);\n return typeof value === 'string' ? !!value.match(regexp) : false;\n});\n\n/**\n A computed property that returns true if the provided dependent property\n is equal to the given value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n napTime: Ember.computed.equal('state', 'sleepy')\n });\n var hampster = Hampster.create();\n hampster.get('napTime'); // false\n hampster.set('state', 'sleepy');\n hampster.get('napTime'); // true\n hampster.set('state', 'hungry');\n hampster.get('napTime'); // false\n ```\n\n @method computed.equal\n @for Ember\n @param {String} dependentKey\n @param {String|Number|Object} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is equal to the given value.\n*/\nregisterComputed('equal', function(dependentKey, value) {\n return get(this, dependentKey) === value;\n});\n\n/**\n A computed property that returns true if the provied dependent property\n is greater than the provided value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasTooManyBananas: Ember.computed.gt('numBananas', 10)\n });\n var hampster = Hampster.create();\n hampster.get('hasTooManyBananas'); // false\n hampster.set('numBananas', 3);\n hampster.get('hasTooManyBananas'); // false\n hampster.set('numBananas', 11);\n hampster.get('hasTooManyBananas'); // true\n ```\n\n @method computed.gt\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is greater then given value.\n*/\nregisterComputed('gt', function(dependentKey, value) {\n return get(this, dependentKey) > value;\n});\n\n/**\n A computed property that returns true if the provided dependent property\n is greater than or equal to the provided value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasTooManyBananas: Ember.computed.gte('numBananas', 10)\n });\n var hampster = Hampster.create();\n hampster.get('hasTooManyBananas'); // false\n hampster.set('numBananas', 3);\n hampster.get('hasTooManyBananas'); // false\n hampster.set('numBananas', 10);\n hampster.get('hasTooManyBananas'); // true\n ```\n\n @method computed.gte\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is greater or equal then given value.\n*/\nregisterComputed('gte', function(dependentKey, value) {\n return get(this, dependentKey) >= value;\n});\n\n/**\n A computed property that returns true if the provided dependent property\n is less than the provided value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n needsMoreBananas: Ember.computed.lt('numBananas', 3)\n });\n var hampster = Hampster.create();\n hampster.get('needsMoreBananas'); // true\n hampster.set('numBananas', 3);\n hampster.get('needsMoreBananas'); // false\n hampster.set('numBananas', 2);\n hampster.get('needsMoreBananas'); // true\n ```\n\n @method computed.lt\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is less then given value.\n*/\nregisterComputed('lt', function(dependentKey, value) {\n return get(this, dependentKey) < value;\n});\n\n/**\n A computed property that returns true if the provided dependent property\n is less than or equal to the provided value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n needsMoreBananas: Ember.computed.lte('numBananas', 3)\n });\n var hampster = Hampster.create();\n hampster.get('needsMoreBananas'); // true\n hampster.set('numBananas', 5);\n hampster.get('needsMoreBananas'); // false\n hampster.set('numBananas', 3);\n hampster.get('needsMoreBananas'); // true\n ```\n\n @method computed.lte\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is less or equal then given value.\n*/\nregisterComputed('lte', function(dependentKey, value) {\n return get(this, dependentKey) <= value;\n});\n\n/**\n A computed property that performs a logical `and` on the\n original values for the provided dependent properties.\n\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n readyForCamp: Ember.computed.and('hasTent', 'hasBackpack')\n });\n var hampster = Hampster.create();\n hampster.get('readyForCamp'); // false\n hampster.set('hasTent', true);\n hampster.get('readyForCamp'); // false\n hampster.set('hasBackpack', true);\n hampster.get('readyForCamp'); // true\n ```\n\n @method computed.and\n @for Ember\n @param {String} dependentKey, [dependentKey...]\n @return {Ember.ComputedProperty} computed property which performs\n a logical `and` on the values of all the original values for properties.\n*/\nregisterComputedWithProperties('and', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && !properties[key]) {\n return false;\n }\n }\n return true;\n});\n\n/**\n A computed property which performs a logical `or` on the\n original values for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella')\n });\n var hampster = Hampster.create();\n hampster.get('readyForRain'); // false\n hampster.set('hasJacket', true);\n hampster.get('readyForRain'); // true\n ```\n\n @method computed.or\n @for Ember\n @param {String} dependentKey, [dependentKey...]\n @return {Ember.ComputedProperty} computed property which performs\n a logical `or` on the values of all the original values for properties.\n*/\nregisterComputedWithProperties('or', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n return true;\n }\n }\n return false;\n});\n\n/**\n A computed property that returns the first truthy value\n from a list of dependent properties.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasClothes: Ember.computed.any('hat', 'shirt')\n });\n var hampster = Hampster.create();\n hampster.get('hasClothes'); // null\n hampster.set('shirt', 'Hawaiian Shirt');\n hampster.get('hasClothes'); // 'Hawaiian Shirt'\n ```\n\n @method computed.any\n @for Ember\n @param {String} dependentKey, [dependentKey...]\n @return {Ember.ComputedProperty} computed property which returns\n the first truthy value of given list of properties.\n*/\nregisterComputedWithProperties('any', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n return properties[key];\n }\n }\n return null;\n});\n\n/**\n A computed property that returns the array of values\n for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n clothes: Ember.computed.map('hat', 'shirt')\n });\n var hampster = Hampster.create();\n hampster.get('clothes'); // [null, null]\n hampster.set('hat', 'Camp Hat');\n hampster.set('shirt', 'Camp Shirt');\n hampster.get('clothes'); // ['Camp Hat', 'Camp Shirt']\n ```\n\n @method computed.map\n @for Ember\n @param {String} dependentKey, [dependentKey...]\n @return {Ember.ComputedProperty} computed property which maps\n values of all passed properties in to an array.\n*/\nregisterComputedWithProperties('collect', function(properties) {\n var res = [];\n for (var key in properties) {\n if (properties.hasOwnProperty(key)) {\n if (Ember.isNone(properties[key])) {\n res.push(null);\n } else {\n res.push(properties[key]);\n }\n }\n }\n return res;\n});\n\n/**\n Creates a new property that is an alias for another property\n on an object. Calls to `get` or `set` this property behave as\n though they were called on the original property.\n\n ```javascript\n Person = Ember.Object.extend({\n name: 'Alex Matchneer',\n nomen: Ember.computed.alias('name')\n });\n\n alex = Person.create();\n alex.get('nomen'); // 'Alex Matchneer'\n alex.get('name'); // 'Alex Matchneer'\n\n alex.set('nomen', '@machty');\n alex.get('name'); // '@machty'\n ```\n @method computed.alias\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates an\n alias to the original value for property.\n*/\nEmber.computed.alias = function(dependentKey) {\n return Ember.computed(dependentKey, function(key, value) {\n if (arguments.length > 1) {\n set(this, dependentKey, value);\n return value;\n } else {\n return get(this, dependentKey);\n }\n });\n};\n\n/**\n Where `computed.alias` aliases `get` and `set`, and allows for bidirectional\n data flow, `computed.oneWay` only provides an aliased `get`. The `set` will\n not mutate the upstream property, rather causes the current property to\n become the value set. This causes the downstream property to permentantly\n diverge from the upstream property.\n\n Example\n\n ```javascript\n User = Ember.Object.extend({\n firstName: null,\n lastName: null,\n nickName: Ember.computed.oneWay('firstName')\n });\n\n user = User.create({\n firstName: 'Teddy',\n lastName: 'Zeenny'\n });\n\n user.get('nickName');\n # 'Teddy'\n\n user.set('nickName', 'TeddyBear');\n # 'TeddyBear'\n\n user.get('firstName');\n # 'Teddy'\n ```\n\n @method computed.oneWay\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates a\n one way computed property to the original value for property.\n*/\nEmber.computed.oneWay = function(dependentKey) {\n return Ember.computed(dependentKey, function() {\n return get(this, dependentKey);\n });\n};\n\n\n/**\n A computed property that acts like a standard getter and setter,\n but returns the value at the provided `defaultPath` if the\n property itself has not been set to a value\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n wishList: Ember.computed.defaultTo('favoriteFood')\n });\n var hampster = Hampster.create({favoriteFood: 'Banana'});\n hampster.get('wishList'); // 'Banana'\n hampster.set('wishList', 'More Unit Tests');\n hampster.get('wishList'); // 'More Unit Tests'\n hampster.get('favoriteFood'); // 'Banana'\n ```\n\n @method computed.defaultTo\n @for Ember\n @param {String} defaultPath\n @return {Ember.ComputedProperty} computed property which acts like\n a standard getter and setter, but defaults to the value from `defaultPath`.\n*/\nEmber.computed.defaultTo = function(defaultPath) {\n return Ember.computed(function(key, newValue, cachedValue) {\n if (arguments.length === 1) {\n return cachedValue != null ? cachedValue : get(this, defaultPath);\n }\n return newValue != null ? newValue : get(this, defaultPath);\n });\n};\n\n\n\n})();\n//@ sourceURL=ember-metal/computed");minispade.register('ember-metal/core', "(function() {/*globals Em:true ENV */\n\n/**\n@module ember\n@submodule ember-metal\n*/\n\n/**\n All Ember methods and functions are defined inside of this namespace. You\n generally should not add new properties to this namespace as it may be\n overwritten by future versions of Ember.\n\n You can also use the shorthand `Em` instead of `Ember`.\n\n Ember-Runtime is a framework that provides core functions for Ember including\n cross-platform functions, support for property observing and objects. Its\n focus is on small size and performance. You can use this in place of or\n along-side other cross-platform libraries such as jQuery.\n\n The core Runtime framework is based on the jQuery API with a number of\n performance optimizations.\n\n @class Ember\n @static\n @version 1.2.0-beta.2\n*/\n\nif ('undefined' === typeof Ember) {\n // Create core object. Make it act like an instance of Ember.Namespace so that\n // objects assigned to it are given a sane string representation.\n Ember = {};\n}\n\n// Default imports, exports and lookup to the global object;\nvar imports = Ember.imports = Ember.imports || this;\nvar exports = Ember.exports = Ember.exports || this;\nvar lookup = Ember.lookup = Ember.lookup || this;\n\n// aliases needed to keep minifiers from removing the global context\nexports.Em = exports.Ember = Em = Ember;\n\n// Make sure these are set whether Ember was already defined or not\n\nEmber.isNamespace = true;\n\nEmber.toString = function() { return \"Ember\"; };\n\n\n/**\n @property VERSION\n @type String\n @default '1.2.0-beta.2'\n @final\n*/\nEmber.VERSION = '1.2.0-beta.2';\n\n/**\n Standard environmental variables. You can define these in a global `ENV`\n variable before loading Ember to control various configuration\n settings.\n\n @property ENV\n @type Hash\n*/\n\nif ('undefined' === typeof ENV) {\n exports.ENV = {};\n}\n\n// We disable the RANGE API by default for performance reasons\nif ('undefined' === typeof ENV.DISABLE_RANGE_API) {\n ENV.DISABLE_RANGE_API = true;\n}\n\n\nEmber.ENV = Ember.ENV || ENV;\n\nEmber.config = Ember.config || {};\n\n/**\n Hash of enabled Canary features. Add to before creating your application.\n\n You can also define `ENV.FEATURES` if you need to enable features flagged at runtime.\n\n @property FEATURES\n @type Hash\n*/\n\nEmber.FEATURES = Ember.ENV.FEATURES || {};\n\n/**\n Test that a feature is enabled. Parsed by Ember's build tools to leave\n experimental features out of beta/stable builds.\n\n You can define the following configuration options:\n\n * `ENV.ENABLE_ALL_FEATURES` - force all features to be enabled.\n * `ENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly\n enabled/disabled.\n\n @method isEnabled\n @param {string} feature\n*/\n\nEmber.FEATURES.isEnabled = function(feature) {\n var featureValue = Ember.FEATURES[feature];\n\n if (Ember.ENV.ENABLE_ALL_FEATURES) {\n return true;\n } else if (featureValue === true || featureValue === false || featureValue === undefined) {\n return featureValue;\n } else if (Ember.ENV.ENABLE_OPTIONAL_FEATURES) {\n return true;\n } else {\n return false;\n }\n};\n\n// ..........................................................\n// BOOTSTRAP\n//\n\n/**\n Determines whether Ember should enhances some built-in object prototypes to\n provide a more friendly API. If enabled, a few methods will be added to\n `Function`, `String`, and `Array`. `Object.prototype` will not be enhanced,\n which is the one that causes most trouble for people.\n\n In general we recommend leaving this option set to true since it rarely\n conflicts with other code. If you need to turn it off however, you can\n define an `ENV.EXTEND_PROTOTYPES` config to disable it.\n\n @property EXTEND_PROTOTYPES\n @type Boolean\n @default true\n*/\nEmber.EXTEND_PROTOTYPES = Ember.ENV.EXTEND_PROTOTYPES;\n\nif (typeof Ember.EXTEND_PROTOTYPES === 'undefined') {\n Ember.EXTEND_PROTOTYPES = true;\n}\n\n/**\n Determines whether Ember logs a full stack trace during deprecation warnings\n\n @property LOG_STACKTRACE_ON_DEPRECATION\n @type Boolean\n @default true\n*/\nEmber.LOG_STACKTRACE_ON_DEPRECATION = (Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== false);\n\n/**\n Determines whether Ember should add ECMAScript 5 shims to older browsers.\n\n @property SHIM_ES5\n @type Boolean\n @default Ember.EXTEND_PROTOTYPES\n*/\nEmber.SHIM_ES5 = (Ember.ENV.SHIM_ES5 === false) ? false : Ember.EXTEND_PROTOTYPES;\n\n/**\n Determines whether Ember logs info about version of used libraries\n\n @property LOG_VERSION\n @type Boolean\n @default true\n*/\nEmber.LOG_VERSION = (Ember.ENV.LOG_VERSION === false) ? false : true;\n\n/**\n Empty function. Useful for some operations. Always returns `this`.\n\n @method K\n @private\n @return {Object}\n*/\nEmber.K = function() { return this; };\n\n\n// Stub out the methods defined by the ember-debug package in case it's not loaded\n\nif ('undefined' === typeof Ember.assert) { Ember.assert = Ember.K; }\nif ('undefined' === typeof Ember.warn) { Ember.warn = Ember.K; }\nif ('undefined' === typeof Ember.debug) { Ember.debug = Ember.K; }\nif ('undefined' === typeof Ember.deprecate) { Ember.deprecate = Ember.K; }\nif ('undefined' === typeof Ember.deprecateFunc) {\n Ember.deprecateFunc = function(_, func) { return func; };\n}\n\n/**\n Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from\n jQuery master. We'll just bootstrap our own uuid now.\n\n @property uuid\n @type Number\n @private\n*/\nEmber.uuid = 0;\n\n/**\n Merge the contents of two objects together into the first object.\n\n ```javascript\n Ember.merge({first: 'Tom'}, {last: 'Dale'}); // {first: 'Tom', last: 'Dale'}\n var a = {first: 'Yehuda'}, b = {last: 'Katz'};\n Ember.merge(a, b); // a == {first: 'Yehuda', last: 'Katz'}, b == {last: 'Katz'}\n ```\n\n @method merge\n @for Ember\n @param {Object} original The object to merge into\n @param {Object} updates The object to copy properties from\n @return {Object}\n*/\nEmber.merge = function(original, updates) {\n for (var prop in updates) {\n if (!updates.hasOwnProperty(prop)) { continue; }\n original[prop] = updates[prop];\n }\n return original;\n};\n\n/**\n Returns true if the passed value is null or undefined. This avoids errors\n from JSLint complaining about use of ==, which can be technically\n confusing.\n\n ```javascript\n Ember.isNone(); // true\n Ember.isNone(null); // true\n Ember.isNone(undefined); // true\n Ember.isNone(''); // false\n Ember.isNone([]); // false\n Ember.isNone(function() {}); // false\n ```\n\n @method isNone\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n*/\nEmber.isNone = function(obj) {\n return obj === null || obj === undefined;\n};\nEmber.none = Ember.deprecateFunc(\"Ember.none is deprecated. Please use Ember.isNone instead.\", Ember.isNone);\n\n/**\n Verifies that a value is `null` or an empty string, empty array,\n or empty function.\n\n Constrains the rules on `Ember.isNone` by returning false for empty\n string and empty arrays.\n\n ```javascript\n Ember.isEmpty(); // true\n Ember.isEmpty(null); // true\n Ember.isEmpty(undefined); // true\n Ember.isEmpty(''); // true\n Ember.isEmpty([]); // true\n Ember.isEmpty('Adam Hawkins'); // false\n Ember.isEmpty([0,1,2]); // false\n ```\n\n @method isEmpty\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n*/\nEmber.isEmpty = function(obj) {\n return Ember.isNone(obj) || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);\n};\nEmber.empty = Ember.deprecateFunc(\"Ember.empty is deprecated. Please use Ember.isEmpty instead.\", Ember.isEmpty) ;\n\n\n})();\n//@ sourceURL=ember-metal/core");minispade.register('ember-metal/enumerable_utils', "(function() {var map, forEach, indexOf, splice;\nminispade.require('ember-metal/array');\n\nmap = Array.prototype.map || Ember.ArrayPolyfills.map;\nforEach = Array.prototype.forEach || Ember.ArrayPolyfills.forEach;\nindexOf = Array.prototype.indexOf || Ember.ArrayPolyfills.indexOf;\nsplice = Array.prototype.splice;\n\nvar utils = Ember.EnumerableUtils = {\n map: function(obj, callback, thisArg) {\n return obj.map ? obj.map.call(obj, callback, thisArg) : map.call(obj, callback, thisArg);\n },\n\n forEach: function(obj, callback, thisArg) {\n return obj.forEach ? obj.forEach.call(obj, callback, thisArg) : forEach.call(obj, callback, thisArg);\n },\n\n indexOf: function(obj, element, index) {\n return obj.indexOf ? obj.indexOf.call(obj, element, index) : indexOf.call(obj, element, index);\n },\n\n indexesOf: function(obj, elements) {\n return elements === undefined ? [] : utils.map(elements, function(item) {\n return utils.indexOf(obj, item);\n });\n },\n\n addObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index === -1) { array.push(item); }\n },\n\n removeObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index !== -1) { array.splice(index, 1); }\n },\n\n _replace: function(array, idx, amt, objects) {\n var args = [].concat(objects), chunk, ret = [],\n // https://code.google.com/p/chromium/issues/detail?id=56588\n size = 60000, start = idx, ends = amt, count;\n\n while (args.length) {\n count = ends > size ? size : ends;\n if (count <= 0) { count = 0; }\n\n chunk = args.splice(0, size);\n chunk = [start, count].concat(chunk);\n\n start += size;\n ends -= count;\n\n ret = ret.concat(splice.apply(array, chunk));\n }\n return ret;\n },\n\n replace: function(array, idx, amt, objects) {\n if (array.replace) {\n return array.replace(idx, amt, objects);\n } else {\n return utils._replace(array, idx, amt, objects);\n }\n },\n\n intersection: function(array1, array2) {\n var intersection = [];\n\n utils.forEach(array1, function(element) {\n if (utils.indexOf(array2, element) >= 0) {\n intersection.push(element);\n }\n });\n\n return intersection;\n }\n};\n\n})();\n//@ sourceURL=ember-metal/enumerable_utils");minispade.register('ember-metal/error', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\n\nvar errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];\n\n/**\n A subclass of the JavaScript Error object for use in Ember.\n\n @class Error\n @namespace Ember\n @extends Error\n @constructor\n*/\nEmber.Error = function() {\n var tmp = Error.apply(this, arguments);\n\n // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n for (var idx = 0; idx < errorProps.length; idx++) {\n this[errorProps[idx]] = tmp[errorProps[idx]];\n }\n};\n\nEmber.Error.prototype = Ember.create(Error.prototype);\n\n// ..........................................................\n// ERROR HANDLING\n//\n\n/**\n A function may be assigned to `Ember.onerror` to be called when Ember\n internals encounter an error. This is useful for specialized error handling\n and reporting code.\n\n ```javascript\n Ember.onerror = function(error) {\n Em.$.ajax('/report-error', 'POST', {\n stack: error.stack,\n otherInformation: 'whatever app state you want to provide'\n });\n };\n ```\n\n @event onerror\n @for Ember\n @param {Exception} error the error object\n*/\nEmber.onerror = null;\n\n/**\n @private\n\n Wrap code block in a try/catch if `Ember.onerror` is set.\n\n @method handleErrors\n @for Ember\n @param {Function} func\n @param [context]\n*/\nEmber.handleErrors = function(func, context) {\n // Unfortunately in some browsers we lose the backtrace if we rethrow the existing error,\n // so in the event that we don't have an `onerror` handler we don't wrap in a try/catch\n if ('function' === typeof Ember.onerror) {\n try {\n return func.call(context || this);\n } catch (error) {\n Ember.onerror(error);\n }\n } else {\n return func.call(context || this);\n }\n};\n\n})();\n//@ sourceURL=ember-metal/error");minispade.register('ember-metal/events', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\n\n/**\n@module ember-metal\n*/\n\nvar o_create = Ember.create,\n metaFor = Ember.meta,\n META_KEY = Ember.META_KEY,\n a_slice = [].slice,\n /* listener flags */\n ONCE = 1, SUSPENDED = 2;\n\n/*\n The event system uses a series of nested hashes to store listeners on an\n object. When a listener is registered, or when an event arrives, these\n hashes are consulted to determine which target and action pair to invoke.\n\n The hashes are stored in the object's meta hash, and look like this:\n\n // Object's meta hash\n {\n listeners: { // variable name: `listenerSet`\n \"foo:changed\": [ // variable name: `actions`\n target, method, flags\n ]\n }\n }\n\n*/\n\nfunction indexOf(array, target, method) {\n var index = -1;\n for (var i = 0, l = array.length; i < l; i += 3) {\n if (target === array[i] && method === array[i+1]) { index = i; break; }\n }\n return index;\n}\n\nfunction actionsFor(obj, eventName) {\n var meta = metaFor(obj, true),\n actions;\n\n if (!meta.listeners) { meta.listeners = {}; }\n\n if (!meta.hasOwnProperty('listeners')) {\n // setup inherited copy of the listeners object\n meta.listeners = o_create(meta.listeners);\n }\n\n actions = meta.listeners[eventName];\n\n // if there are actions, but the eventName doesn't exist in our listeners, then copy them from the prototype\n if (actions && !meta.listeners.hasOwnProperty(eventName)) {\n actions = meta.listeners[eventName] = meta.listeners[eventName].slice();\n } else if (!actions) {\n actions = meta.listeners[eventName] = [];\n }\n\n return actions;\n}\n\nfunction actionsUnion(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n var target = actions[i],\n method = actions[i+1],\n flags = actions[i+2],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex === -1) {\n otherActions.push(target, method, flags);\n }\n }\n}\n\nfunction actionsDiff(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName],\n diffActions = [];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n var target = actions[i],\n method = actions[i+1],\n flags = actions[i+2],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex !== -1) { continue; }\n\n otherActions.push(target, method, flags);\n diffActions.push(target, method, flags);\n }\n\n return diffActions;\n}\n\n/**\n Add an event listener\n\n @method addListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Boolean} once A flag whether a function should only be called once\n*/\nfunction addListener(obj, eventName, target, method, once) {\n Ember.assert(\"You must pass at least an object and event name to Ember.addListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method),\n flags = 0;\n\n if (once) flags |= ONCE;\n\n if (actionIndex !== -1) { return; }\n\n actions.push(target, method, flags);\n\n if ('function' === typeof obj.didAddListener) {\n obj.didAddListener(eventName, target, method);\n }\n}\n\n/**\n Remove an event listener\n\n Arguments should match those passed to `Ember.addListener`.\n\n @method removeListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n*/\nfunction removeListener(obj, eventName, target, method) {\n Ember.assert(\"You must pass at least an object and event name to Ember.removeListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n function _removeListener(target, method) {\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n // action doesn't exist, give up silently\n if (actionIndex === -1) { return; }\n\n actions.splice(actionIndex, 3);\n\n if ('function' === typeof obj.didRemoveListener) {\n obj.didRemoveListener(eventName, target, method);\n }\n }\n\n if (method) {\n _removeListener(target, method);\n } else {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n _removeListener(actions[i], actions[i+1]);\n }\n }\n}\n\n/**\n @private\n\n Suspend listener during callback.\n\n This should only be used by the target of the event listener\n when it is taking an action that would cause the event, e.g.\n an object might suspend its property change listener while it is\n setting that property.\n\n @method suspendListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n*/\nfunction suspendListener(obj, eventName, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n actions[actionIndex+2] |= SUSPENDED; // mark the action as suspended\n }\n\n function tryable() { return callback.call(target); }\n function finalizer() { if (actionIndex !== -1) { actions[actionIndex+2] &= ~SUSPENDED; } }\n\n return Ember.tryFinally(tryable, finalizer);\n}\n\n/**\n @private\n\n Suspends multiple listeners during a callback.\n\n \n @method suspendListeners\n @for Ember\n @param obj\n @param {Array} eventName Array of event names\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n*/\nfunction suspendListeners(obj, eventNames, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var suspendedActions = [],\n actionsList = [],\n eventName, actions, i, l;\n\n for (i=0, l=eventNames.length; i<l; i++) {\n eventName = eventNames[i];\n actions = actionsFor(obj, eventName);\n var actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n actions[actionIndex+2] |= SUSPENDED;\n suspendedActions.push(actionIndex);\n actionsList.push(actions);\n }\n }\n\n function tryable() { return callback.call(target); }\n\n function finalizer() {\n for (var i = 0, l = suspendedActions.length; i < l; i++) {\n var actionIndex = suspendedActions[i];\n actionsList[i][actionIndex+2] &= ~SUSPENDED;\n }\n }\n\n return Ember.tryFinally(tryable, finalizer);\n}\n\n/**\n @private\n\n Return a list of currently watched events\n\n @method watchedEvents\n @for Ember\n @param obj\n*/\nfunction watchedEvents(obj) {\n var listeners = obj[META_KEY].listeners, ret = [];\n\n if (listeners) {\n for(var eventName in listeners) {\n if (listeners[eventName]) { ret.push(eventName); }\n }\n }\n return ret;\n}\n\n/**\n Send an event. The execution of suspended listeners\n is skipped, and once listeners are removed. A listener without\n a target is executed on the passed object. If an array of actions\n is not passed, the actions stored on the passed object are invoked.\n \n @method sendEvent\n @for Ember\n @param obj\n @param {String} eventName\n @param {Array} params Optional parameters for each listener.\n @param {Array} actions Optional array of actions (listeners).\n @return true\n*/\nfunction sendEvent(obj, eventName, params, actions) {\n // first give object a chance to handle it\n if (obj !== Ember && 'function' === typeof obj.sendEvent) {\n obj.sendEvent(eventName, params);\n }\n\n if (!actions) {\n var meta = obj[META_KEY];\n actions = meta && meta.listeners && meta.listeners[eventName];\n }\n\n if (!actions) { return; }\n\n for (var i = actions.length - 3; i >= 0; i -= 3) { // looping in reverse for once listeners\n var target = actions[i], method = actions[i+1], flags = actions[i+2];\n if (!method) { continue; }\n if (flags & SUSPENDED) { continue; }\n if (flags & ONCE) { removeListener(obj, eventName, target, method); }\n if (!target) { target = obj; }\n if ('string' === typeof method) { method = target[method]; }\n if (params) {\n method.apply(target, params);\n } else {\n method.call(target);\n }\n }\n return true;\n}\n\n/**\n @private\n @method hasListeners\n @for Ember\n @param obj\n @param {String} eventName\n*/\nfunction hasListeners(obj, eventName) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n return !!(actions && actions.length);\n}\n\n/**\n @private\n @method listenersFor\n @for Ember\n @param obj\n @param {String} eventName\n*/\nfunction listenersFor(obj, eventName) {\n var ret = [];\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return ret; }\n\n for (var i = 0, l = actions.length; i < l; i += 3) {\n var target = actions[i],\n method = actions[i+1];\n ret.push([target, method]);\n }\n\n return ret;\n}\n\n/**\n Define a property as a function that should be executed when\n a specified event or events are triggered.\n\n var Job = Ember.Object.extend({\n logCompleted: Ember.on('completed', function(){\n console.log('Job completed!');\n })\n });\n var job = Job.create();\n Ember.sendEvent(job, 'completed'); // Logs \"Job completed!\"\n\n @method on\n @for Ember\n @param {String} eventNames*\n @param {Function} func\n @return func\n*/\nEmber.on = function(){\n var func = a_slice.call(arguments, -1)[0],\n events = a_slice.call(arguments, 0, -1);\n func.__ember_listens__ = events;\n return func;\n};\n\nEmber.addListener = addListener;\nEmber.removeListener = removeListener;\nEmber._suspendListener = suspendListener;\nEmber._suspendListeners = suspendListeners;\nEmber.sendEvent = sendEvent;\nEmber.hasListeners = hasListeners;\nEmber.watchedEvents = watchedEvents;\nEmber.listenersFor = listenersFor;\nEmber.listenersDiff = actionsDiff;\nEmber.listenersUnion = actionsUnion;\n\n})();\n//@ sourceURL=ember-metal/events");minispade.register('ember-metal/expand_properties', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/utils');\n\n\n/**\n @module ember-metal\n*/\n\nif (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n var forEach = Ember.EnumerableUtils.forEach,\n IS_BRACE_EXPANSION = /^\\{([^.]*)\\}$/;\n\n /**\n Expands `pattern`, invoking `callback` for each expansion.\n\n The only pattern supported is brace-expansion, anything else will be passed\n once to `callback` directly. Furthermore, brace-expansion is only applied to\n the entire pattern, not to substrings.\n\n Example\n ```js\n function echo(arg){ console.log(arg); }\n\n Ember.expandProperties('foo.bar', echo); //=> 'foo.bar'\n Ember.expandProperties('{foo,bar}', echo); //=> 'foo', 'bar'\n Ember.expandProperties('foo.{bar,baz}', echo); //=> 'foo.{bar,baz}'\n ```\n\n @method\n @private\n @param {string} pattern The property pattern to expand.\n @param {function} callback The callback to invoke. It is invoked once per\n expansion, and is passed the expansion.\n */\n Ember.expandProperties = function (pattern, callback) {\n if (IS_BRACE_EXPANSION.test(pattern)) {\n forEach(pattern.substring(1, pattern.length-1).split(','), callback);\n return;\n }\n\n callback(pattern);\n };\n}\n\n})();\n//@ sourceURL=ember-metal/expand_properties");minispade.register('ember-metal/get_properties', "(function() {minispade.require('ember-metal/property_get');\nminispade.require('ember-metal/utils');\n\nvar get = Ember.get;\n\n/**\n To get multiple properties at once, call `Ember.getProperties`\n with an object followed by a list of strings or an array:\n\n ```javascript\n Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param obj\n @param {String...|Array} list of keys to get\n @return {Hash}\n*/\nEmber.getProperties = function(obj) {\n var ret = {},\n propertyNames = arguments,\n i = 1;\n\n if (arguments.length === 2 && Ember.typeOf(arguments[1]) === 'array') {\n i = 0;\n propertyNames = arguments[1];\n }\n for(var len = propertyNames.length; i < len; i++) {\n ret[propertyNames[i]] = get(obj, propertyNames[i]);\n }\n return ret;\n};\n\n})();\n//@ sourceURL=ember-metal/get_properties");minispade.register('ember-metal/instrumentation', "(function() {minispade.require('ember-metal/utils'); // Ember.tryCatchFinally\n\n/**\n The purpose of the Ember Instrumentation module is\n to provide efficient, general-purpose instrumentation\n for Ember.\n\n Subscribe to a listener by using `Ember.subscribe`:\n\n ```javascript\n Ember.subscribe(\"render\", {\n before: function(name, timestamp, payload) {\n\n },\n\n after: function(name, timestamp, payload) {\n\n }\n });\n ```\n\n If you return a value from the `before` callback, that same\n value will be passed as a fourth parameter to the `after`\n callback.\n\n Instrument a block of code by using `Ember.instrument`:\n\n ```javascript\n Ember.instrument(\"render.handlebars\", payload, function() {\n // rendering logic\n }, binding);\n ```\n\n Event names passed to `Ember.instrument` are namespaced\n by periods, from more general to more specific. Subscribers\n can listen for events by whatever level of granularity they\n are interested in.\n\n In the above example, the event is `render.handlebars`,\n and the subscriber listened for all events beginning with\n `render`. It would receive callbacks for events named\n `render`, `render.handlebars`, `render.container`, or\n even `render.handlebars.layout`.\n\n @class Instrumentation\n @namespace Ember\n @static\n*/\nEmber.Instrumentation = {};\n\nvar subscribers = [], cache = {};\n\nvar populateListeners = function(name) {\n var listeners = [], subscriber;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n subscriber = subscribers[i];\n if (subscriber.regex.test(name)) {\n listeners.push(subscriber.object);\n }\n }\n\n cache[name] = listeners;\n return listeners;\n};\n\nvar time = (function() {\n var perf = 'undefined' !== typeof window ? window.performance || {} : {};\n var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow;\n // fn.bind will be available in all the browsers that support the advanced window.performance... ;-)\n return fn ? fn.bind(perf) : function() { return +new Date(); };\n})();\n\n/**\n Notifies event's subscribers, calls `before` and `after` hooks.\n\n @method instrument\n @namespace Ember.Instrumentation\n\n @param {String} [name] Namespaced event name.\n @param {Object} payload\n @param {Function} callback Function that you're instrumenting.\n @param {Object} binding Context that instrument function is called with.\n*/\nEmber.Instrumentation.instrument = function(name, payload, callback, binding) {\n var listeners = cache[name], timeName, ret;\n\n if (Ember.STRUCTURED_PROFILE) {\n timeName = name + \": \" + payload.object;\n console.time(timeName);\n }\n\n if (!listeners) {\n listeners = populateListeners(name);\n }\n\n if (listeners.length === 0) {\n ret = callback.call(binding);\n if (Ember.STRUCTURED_PROFILE) { console.timeEnd(timeName); }\n return ret;\n }\n\n var beforeValues = [], listener, i, l;\n\n function tryable() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n }\n\n function catchable(e) {\n payload = payload || {};\n payload.exception = e;\n }\n\n function finalizer() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n\n if (Ember.STRUCTURED_PROFILE) {\n console.timeEnd(timeName);\n }\n }\n\n return Ember.tryCatchFinally(tryable, catchable, finalizer);\n};\n\n/**\n Subscribes to a particular event or instrumented block of code.\n\n @method subscribe\n @namespace Ember.Instrumentation\n\n @param {String} [pattern] Namespaced event name.\n @param {Object} [object] Before and After hooks.\n*/\nEmber.Instrumentation.subscribe = function(pattern, object) {\n var paths = pattern.split(\".\"), path, regex = [];\n\n for (var i=0, l=paths.length; i<l; i++) {\n path = paths[i];\n if (path === \"*\") {\n regex.push(\"[^\\\\.]*\");\n } else {\n regex.push(path);\n }\n }\n\n regex = regex.join(\"\\\\.\");\n regex = regex + \"(\\\\..*)?\";\n\n var subscriber = {\n pattern: pattern,\n regex: new RegExp(\"^\" + regex + \"$\"),\n object: object\n };\n\n subscribers.push(subscriber);\n cache = {};\n\n return subscriber;\n};\n\n/**\n Unsubscribes from a particular event or instrumented block of code.\n\n @method unsubscribe\n @namespace Ember.Instrumentation\n\n @param {Object} [subscriber]\n*/\nEmber.Instrumentation.unsubscribe = function(subscriber) {\n var index;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n if (subscribers[i] === subscriber) {\n index = i;\n }\n }\n\n subscribers.splice(index, 1);\n cache = {};\n};\n\n/**\n Resets `Ember.Instrumentation` by flushing list of subscribers.\n\n @method reset\n @namespace Ember.Instrumentation\n*/\nEmber.Instrumentation.reset = function() {\n subscribers = [];\n cache = {};\n};\n\nEmber.instrument = Ember.Instrumentation.instrument;\nEmber.subscribe = Ember.Instrumentation.subscribe;\n})();\n//@ sourceURL=ember-metal/instrumentation");minispade.register('ember-metal/libraries', "(function() {// Provides a way to register library versions with ember.\nvar forEach = Ember.EnumerableUtils.forEach,\n indexOf = Ember.EnumerableUtils.indexOf;\n\nEmber.libraries = function() {\n var libraries = [];\n var coreLibIndex = 0;\n\n var getLibrary = function(name) {\n for (var i = 0; i < libraries.length; i++) {\n if (libraries[i].name === name) {\n return libraries[i];\n }\n }\n };\n\n libraries.register = function(name, version) {\n if (!getLibrary(name)) {\n libraries.push({name: name, version: version});\n }\n };\n\n libraries.registerCoreLibrary = function(name, version) {\n if (!getLibrary(name)) {\n libraries.splice(coreLibIndex++, 0, {name: name, version: version});\n }\n };\n\n libraries.deRegister = function(name) {\n var lib = getLibrary(name);\n if (lib) libraries.splice(indexOf(libraries, lib), 1);\n };\n\n libraries.each = function (callback) {\n forEach(libraries, function(lib) {\n callback(lib.name, lib.version);\n });\n };\n\n return libraries;\n}();\n\nEmber.libraries.registerCoreLibrary('Ember', Ember.VERSION);\n\n})();\n//@ sourceURL=ember-metal/libraries");minispade.register('ember-metal/logger', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/error');\n\nfunction consoleMethod(name) {\n var consoleObj;\n if (Ember.imports.console) {\n consoleObj = Ember.imports.console;\n } else if (typeof console !== 'undefined') {\n consoleObj = console;\n }\n\n var method = typeof consoleObj === 'object' ? consoleObj[name] : null;\n\n if (method) {\n // Older IE doesn't support apply, but Chrome needs it\n if (method.apply) {\n return function() {\n method.apply(consoleObj, arguments);\n };\n } else {\n return function() {\n var message = Array.prototype.join.call(arguments, ', ');\n method(message);\n };\n }\n }\n}\n\nfunction assertPolyfill(test, message) {\n if (!test) {\n try {\n // attempt to preserve the stack\n throw new Ember.Error(\"assertion failed: \" + message);\n } catch(error) {\n setTimeout(function() {\n throw error;\n }, 0);\n }\n }\n}\n\n/**\n Inside Ember-Metal, simply uses the methods from `imports.console`.\n Override this to provide more robust logging functionality.\n\n @class Logger\n @namespace Ember\n*/\nEmber.Logger = {\n /**\n Logs the arguments to the console.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n var foo = 1;\n Ember.Logger.log('log value of foo:', foo); // \"log value of foo: 1\" will be printed to the console\n ```\n\n @method log\n @for Ember.Logger\n @param {*} arguments\n */\n log: consoleMethod('log') || Ember.K,\n /**\n Prints the arguments to the console with a warning icon.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n Ember.Logger.warn('Something happened!'); // \"Something happened!\" will be printed to the console with a warning icon.\n ```\n\n @method warn\n @for Ember.Logger\n @param {*} arguments\n */\n warn: consoleMethod('warn') || Ember.K,\n /**\n Prints the arguments to the console with an error icon, red text and a stack race.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n Ember.Logger.error('Danger! Danger!'); // \"Danger! Danger!\" will be printed to the console in red text.\n ```\n\n @method error\n @for Ember.Logger\n @param {*} arguments\n */\n error: consoleMethod('error') || Ember.K,\n /**\n Logs the arguments to the console.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n var foo = 1;\n Ember.Logger.info('log value of foo:', foo); // \"log value of foo: 1\" will be printed to the console\n ```\n\n @method info\n @for Ember.Logger\n @param {*} arguments\n */\n info: consoleMethod('info') || Ember.K,\n /**\n Logs the arguments to the console in blue text.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n var foo = 1;\n Ember.Logger.debug('log value of foo:', foo); // \"log value of foo: 1\" will be printed to the console\n ```\n\n @method debug\n @for Ember.Logger\n @param {*} arguments\n */\n debug: consoleMethod('debug') || consoleMethod('info') || Ember.K,\n /**\n\n If the value passed into Ember.Logger.assert is not truthy it will throw an error with a stack trace.\n\n ```javascript\n Ember.Logger.assert(true); // undefined\n Ember.Logger.assert(true === false); // Throws an Assertion failed error.\n ```\n\n @method assert\n @for Ember.Logger\n @param {Boolean} bool Value to test\n */\n assert: consoleMethod('assert') || assertPolyfill\n};\n\n\n})();\n//@ sourceURL=ember-metal/logger");minispade.register('ember-metal', "(function() {/**\nEmber Metal\n\n@module ember\n@submodule ember-metal\n*/\nminispade.require('ember-metal/core');\nminispade.require('ember-metal/instrumentation');\nminispade.require('ember-metal/map');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/error');\nminispade.require('ember-metal/logger');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/property_set');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/property_events');\nminispade.require('ember-metal/get_properties');\nminispade.require('ember-metal/set_properties');\nminispade.require('ember-metal/chains');\nminispade.require('ember-metal/computed');\nminispade.require('ember-metal/watching');\nminispade.require('ember-metal/watch_key');\nminispade.require('ember-metal/watch_path');\nminispade.require('ember-metal/events');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/mixin');\nminispade.require('ember-metal/binding');\nminispade.require('ember-metal/run_loop');\nminispade.require('ember-metal/libraries');\n\n})();\n//@ sourceURL=ember-metal");minispade.register('ember-metal/map', "(function() {/**\n@module ember-metal\n*/\n\n/*\n JavaScript (before ES6) does not have a Map implementation. Objects,\n which are often used as dictionaries, may only have Strings as keys.\n\n Because Ember has a way to get a unique identifier for every object\n via `Ember.guidFor`, we can implement a performant Map with arbitrary\n keys. Because it is commonly used in low-level bookkeeping, Map is\n implemented as a pure JavaScript object for performance.\n\n This implementation follows the current iteration of the ES6 proposal for\n maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),\n with two exceptions. First, because we need our implementation to be pleasant\n on older browsers, we do not use the `delete` name (using `remove` instead).\n Second, as we do not have the luxury of in-VM iteration, we implement a\n forEach method for iteration.\n\n Map is mocked out to look like an Ember object, so you can do\n `Ember.Map.create()` for symmetry with other Ember classes.\n*/\nminispade.require('ember-metal/enumerable_utils');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/core');\nminispade.require('ember-metal/property_set');\n\nvar set = Ember.set,\n guidFor = Ember.guidFor,\n indexOf = Ember.ArrayPolyfills.indexOf;\n\nvar copy = function(obj) {\n var output = {};\n\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) { output[prop] = obj[prop]; }\n }\n\n return output;\n};\n\nvar copyMap = function(original, newObject) {\n var keys = original.keys.copy(),\n values = copy(original.values);\n\n newObject.keys = keys;\n newObject.values = values;\n newObject.length = original.length;\n\n return newObject;\n};\n\n/**\n This class is used internally by Ember and Ember Data.\n Please do not use it at this time. We plan to clean it up\n and add many tests soon.\n\n @class OrderedSet\n @namespace Ember\n @constructor\n @private\n*/\nvar OrderedSet = Ember.OrderedSet = function() {\n this.clear();\n};\n\n/**\n @method create\n @static\n @return {Ember.OrderedSet}\n*/\nOrderedSet.create = function() {\n return new OrderedSet();\n};\n\n\nOrderedSet.prototype = {\n /**\n @method clear\n */\n clear: function() {\n this.presenceSet = {};\n this.list = [];\n },\n\n /**\n @method add\n @param obj\n */\n add: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n if (guid in presenceSet) { return; }\n\n presenceSet[guid] = true;\n list.push(obj);\n },\n\n /**\n @method remove\n @param obj\n */\n remove: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n delete presenceSet[guid];\n\n var index = indexOf.call(list, obj);\n if (index > -1) {\n list.splice(index, 1);\n }\n },\n\n /**\n @method isEmpty\n @return {Boolean}\n */\n isEmpty: function() {\n return this.list.length === 0;\n },\n\n /**\n @method has\n @param obj\n @return {Boolean}\n */\n has: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet;\n\n return guid in presenceSet;\n },\n\n /**\n @method forEach\n @param {Function} fn\n @param self\n */\n forEach: function(fn, self) {\n // allow mutation during iteration\n var list = this.toArray();\n\n for (var i = 0, j = list.length; i < j; i++) {\n fn.call(self, list[i]);\n }\n },\n\n /**\n @method toArray\n @return {Array}\n */\n toArray: function() {\n return this.list.slice();\n },\n\n /**\n @method copy\n @return {Ember.OrderedSet}\n */\n copy: function() {\n var set = new OrderedSet();\n\n set.presenceSet = copy(this.presenceSet);\n set.list = this.toArray();\n\n return set;\n }\n};\n\n/**\n A Map stores values indexed by keys. Unlike JavaScript's\n default Objects, the keys of a Map can be any JavaScript\n object.\n\n Internally, a Map has two data structures:\n\n 1. `keys`: an OrderedSet of all of the existing keys\n 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)`\n\n When a key/value pair is added for the first time, we\n add the key to the `keys` OrderedSet, and create or\n replace an entry in `values`. When an entry is deleted,\n we delete its entry in `keys` and `values`.\n\n @class Map\n @namespace Ember\n @private\n @constructor\n*/\nvar Map = Ember.Map = function() {\n this.keys = Ember.OrderedSet.create();\n this.values = {};\n};\n\n/**\n @method create\n @static\n*/\nMap.create = function() {\n return new Map();\n};\n\nMap.prototype = {\n /**\n This property will change as the number of objects in the map changes.\n \n @property length\n @type number\n @default 0\n */\n length: 0,\n \n \n /**\n Retrieve the value associated with a given key.\n\n @method get\n @param {*} key\n @return {*} the value associated with the key, or `undefined`\n */\n get: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values[guid];\n },\n\n /**\n Adds a value to the map. If a value for the given key has already been\n provided, the new value will replace the old value.\n\n @method set\n @param {*} key\n @param {*} value\n */\n set: function(key, value) {\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n keys.add(key);\n values[guid] = value;\n set(this, 'length', keys.list.length);\n },\n\n /**\n Removes a value from the map for an associated key.\n\n @method remove\n @param {*} key\n @return {Boolean} true if an item was removed, false otherwise\n */\n remove: function(key) {\n // don't use ES6 \"delete\" because it will be annoying\n // to use in browsers that are not ES6 friendly;\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n if (values.hasOwnProperty(guid)) {\n keys.remove(key);\n delete values[guid];\n set(this, 'length', keys.list.length);\n return true;\n } else {\n return false;\n }\n },\n\n /**\n Check whether a key is present.\n\n @method has\n @param {*} key\n @return {Boolean} true if the item was present, false otherwise\n */\n has: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values.hasOwnProperty(guid);\n },\n\n /**\n Iterate over all the keys and values. Calls the function once\n for each key, passing in the key and value, in that order.\n\n The keys are guaranteed to be iterated over in insertion order.\n\n @method forEach\n @param {Function} callback\n @param {*} self if passed, the `this` value inside the\n callback. By default, `this` is the map.\n */\n forEach: function(callback, self) {\n var keys = this.keys,\n values = this.values;\n\n keys.forEach(function(key) {\n var guid = guidFor(key);\n callback.call(self, key, values[guid]);\n });\n },\n\n /**\n @method copy\n @return {Ember.Map}\n */\n copy: function() {\n return copyMap(this, new Map());\n }\n};\n\n/**\n @class MapWithDefault\n @namespace Ember\n @extends Ember.Map\n @private\n @constructor\n @param [options]\n @param {*} [options.defaultValue]\n*/\nvar MapWithDefault = Ember.MapWithDefault = function(options) {\n Map.call(this);\n this.defaultValue = options.defaultValue;\n};\n\n/**\n @method create\n @static\n @param [options]\n @param {*} [options.defaultValue]\n @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns\n `Ember.MapWithDefault` otherwise returns `Ember.Map`\n*/\nMapWithDefault.create = function(options) {\n if (options) {\n return new MapWithDefault(options);\n } else {\n return new Map();\n }\n};\n\nMapWithDefault.prototype = Ember.create(Map.prototype);\n\n/**\n Retrieve the value associated with a given key.\n\n @method get\n @param {*} key\n @return {*} the value associated with the key, or the default value\n*/\nMapWithDefault.prototype.get = function(key) {\n var hasValue = this.has(key);\n\n if (hasValue) {\n return Map.prototype.get.call(this, key);\n } else {\n var defaultValue = this.defaultValue(key);\n this.set(key, defaultValue);\n return defaultValue;\n }\n};\n\n/**\n @method copy\n @return {Ember.MapWithDefault}\n*/\nMapWithDefault.prototype.copy = function() {\n return copyMap(this, new MapWithDefault({\n defaultValue: this.defaultValue\n }));\n};\n\n})();\n//@ sourceURL=ember-metal/map");minispade.register('ember-metal/mixin', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/computed');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/binding');\n\n/**\n@module ember\n@submodule ember-metal\n*/\n\nvar Mixin, REQUIRED, Alias,\n a_map = Ember.ArrayPolyfills.map,\n a_indexOf = Ember.ArrayPolyfills.indexOf,\n a_forEach = Ember.ArrayPolyfills.forEach,\n a_slice = [].slice,\n o_create = Ember.create,\n defineProperty = Ember.defineProperty,\n guidFor = Ember.guidFor;\n\nfunction mixinsMeta(obj) {\n var m = Ember.meta(obj, true), ret = m.mixins;\n if (!ret) {\n ret = m.mixins = {};\n } else if (!m.hasOwnProperty('mixins')) {\n ret = m.mixins = o_create(ret);\n }\n return ret;\n}\n\nfunction initMixin(mixin, args) {\n if (args && args.length > 0) {\n mixin.mixins = a_map.call(args, function(x) {\n if (x instanceof Mixin) { return x; }\n\n // Note: Manually setup a primitive mixin here. This is the only\n // way to actually get a primitive mixin. This way normal creation\n // of mixins will give you combined mixins...\n var mixin = new Mixin();\n mixin.properties = x;\n return mixin;\n });\n }\n return mixin;\n}\n\nfunction isMethod(obj) {\n return 'function' === typeof obj &&\n obj.isMethod !== false &&\n obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;\n}\n\nvar CONTINUE = {};\n\nfunction mixinProperties(mixinsMeta, mixin) {\n var guid;\n\n if (mixin instanceof Mixin) {\n guid = guidFor(mixin);\n if (mixinsMeta[guid]) { return CONTINUE; }\n mixinsMeta[guid] = mixin;\n return mixin.properties;\n } else {\n return mixin; // apply anonymous mixin properties\n }\n}\n\nfunction concatenatedMixinProperties(concatProp, props, values, base) {\n var concats;\n\n // reset before adding each new mixin to pickup concats from previous\n concats = values[concatProp] || base[concatProp];\n if (props[concatProp]) {\n concats = concats ? concats.concat(props[concatProp]) : props[concatProp];\n }\n\n return concats;\n}\n\nfunction giveDescriptorSuper(meta, key, property, values, descs) {\n var superProperty;\n\n // Computed properties override methods, and do not call super to them\n if (values[key] === undefined) {\n // Find the original descriptor in a parent mixin\n superProperty = descs[key];\n }\n\n // If we didn't find the original descriptor in a parent mixin, find\n // it on the original object.\n superProperty = superProperty || meta.descs[key];\n\n if (!superProperty || !(superProperty instanceof Ember.ComputedProperty)) {\n return property;\n }\n\n // Since multiple mixins may inherit from the same parent, we need\n // to clone the computed property so that other mixins do not receive\n // the wrapped version.\n property = o_create(property);\n property.func = Ember.wrap(property.func, superProperty.func);\n\n return property;\n}\n\nfunction giveMethodSuper(obj, key, method, values, descs) {\n var superMethod;\n\n // Methods overwrite computed properties, and do not call super to them.\n if (descs[key] === undefined) {\n // Find the original method in a parent mixin\n superMethod = values[key];\n }\n\n // If we didn't find the original value in a parent mixin, find it in\n // the original object\n superMethod = superMethod || obj[key];\n\n // Only wrap the new method if the original method was a function\n if ('function' !== typeof superMethod) {\n return method;\n }\n\n return Ember.wrap(method, superMethod);\n}\n\nfunction applyConcatenatedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n return baseValue.concat(value);\n } else {\n return Ember.makeArray(baseValue).concat(value);\n }\n } else {\n return Ember.makeArray(value);\n }\n}\n\nfunction applyMergedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (!baseValue) { return value; }\n\n var newBase = Ember.merge({}, baseValue);\n for (var prop in value) {\n if (!value.hasOwnProperty(prop)) { continue; }\n\n var propValue = value[prop];\n if (isMethod(propValue)) {\n // TODO: support for Computed Properties, etc?\n newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {});\n } else {\n newBase[prop] = propValue;\n }\n }\n\n return newBase;\n}\n\nfunction addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) {\n if (value instanceof Ember.Descriptor) {\n if (value === REQUIRED && descs[key]) { return CONTINUE; }\n\n // Wrap descriptor function to implement\n // _super() if needed\n if (value.func) {\n value = giveDescriptorSuper(meta, key, value, values, descs);\n }\n\n descs[key] = value;\n values[key] = undefined;\n } else {\n if ((concats && a_indexOf.call(concats, key) >= 0) ||\n key === 'concatenatedProperties' ||\n key === 'mergedProperties') {\n value = applyConcatenatedProperties(base, key, value, values);\n } else if ((mergings && a_indexOf.call(mergings, key) >= 0)) {\n value = applyMergedProperties(base, key, value, values);\n } else if (isMethod(value)) {\n value = giveMethodSuper(base, key, value, values, descs);\n }\n\n descs[key] = undefined;\n values[key] = value;\n }\n}\n\nfunction mergeMixins(mixins, m, descs, values, base, keys) {\n var mixin, props, key, concats, mergings, meta;\n\n function removeKeys(keyName) {\n delete descs[keyName];\n delete values[keyName];\n }\n\n for(var i=0, l=mixins.length; i<l; i++) {\n mixin = mixins[i];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n props = mixinProperties(m, mixin);\n if (props === CONTINUE) { continue; }\n\n if (props) {\n meta = Ember.meta(base);\n if (base.willMergeMixin) { base.willMergeMixin(props); }\n concats = concatenatedMixinProperties('concatenatedProperties', props, values, base);\n mergings = concatenatedMixinProperties('mergedProperties', props, values, base);\n\n for (key in props) {\n if (!props.hasOwnProperty(key)) { continue; }\n keys.push(key);\n addNormalizedProperty(base, key, props[key], meta, descs, values, concats, mergings);\n }\n\n // manually copy toString() because some JS engines do not enumerate it\n if (props.hasOwnProperty('toString')) { base.toString = props.toString; }\n } else if (mixin.mixins) {\n mergeMixins(mixin.mixins, m, descs, values, base, keys);\n if (mixin._without) { a_forEach.call(mixin._without, removeKeys); }\n }\n }\n}\n\nvar IS_BINDING = Ember.IS_BINDING = /^.+Binding$/;\n\nfunction detectBinding(obj, key, value, m) {\n if (IS_BINDING.test(key)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[key] = value;\n }\n}\n\nfunction connectBindings(obj, m) {\n // TODO Mixin.apply(instance) should disconnect binding if exists\n var bindings = m.bindings, key, binding, to;\n if (bindings) {\n for (key in bindings) {\n binding = bindings[key];\n if (binding) {\n to = key.slice(0, -7); // strip Binding off end\n if (binding instanceof Ember.Binding) {\n binding = binding.copy(); // copy prototypes' instance\n binding.to(to);\n } else { // binding is string path\n binding = new Ember.Binding(to, binding);\n }\n binding.connect(obj);\n obj[key] = binding;\n }\n }\n // mark as applied\n m.bindings = {};\n }\n}\n\nfunction finishPartial(obj, m) {\n connectBindings(obj, m || Ember.meta(obj));\n return obj;\n}\n\nfunction followAlias(obj, desc, m, descs, values) {\n var altKey = desc.methodName, value;\n if (descs[altKey] || values[altKey]) {\n value = values[altKey];\n desc = descs[altKey];\n } else if (m.descs[altKey]) {\n desc = m.descs[altKey];\n value = undefined;\n } else {\n desc = undefined;\n value = obj[altKey];\n }\n\n return { desc: desc, value: value };\n}\n\nfunction updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) {\n var paths = observerOrListener[pathsKey];\n\n if (paths) {\n for (var i=0, l=paths.length; i<l; i++) {\n Ember[updateMethod](obj, paths[i], null, key);\n }\n }\n}\n\nfunction replaceObserversAndListeners(obj, key, observerOrListener) {\n var prev = obj[key];\n\n if ('function' === typeof prev) {\n updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', 'removeBeforeObserver');\n updateObserversAndListeners(obj, key, prev, '__ember_observes__', 'removeObserver');\n updateObserversAndListeners(obj, key, prev, '__ember_listens__', 'removeListener');\n }\n\n if ('function' === typeof observerOrListener) {\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', 'addBeforeObserver');\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', 'addObserver');\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', 'addListener');\n }\n}\n\nfunction applyMixin(obj, mixins, partial) {\n var descs = {}, values = {}, m = Ember.meta(obj),\n key, value, desc, keys = [];\n\n // Go through all mixins and hashes passed in, and:\n //\n // * Handle concatenated properties\n // * Handle merged properties\n // * Set up _super wrapping if necessary\n // * Set up computed property descriptors\n // * Copying `toString` in broken browsers\n mergeMixins(mixins, mixinsMeta(obj), descs, values, obj, keys);\n\n for(var i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n if (key === 'constructor' || !values.hasOwnProperty(key)) { continue; }\n\n desc = descs[key];\n value = values[key];\n\n if (desc === REQUIRED) { continue; }\n\n while (desc && desc instanceof Alias) {\n var followed = followAlias(obj, desc, m, descs, values);\n desc = followed.desc;\n value = followed.value;\n }\n\n if (desc === undefined && value === undefined) { continue; }\n\n replaceObserversAndListeners(obj, key, value);\n detectBinding(obj, key, value, m);\n defineProperty(obj, key, desc, value, m);\n }\n\n if (!partial) { // don't apply to prototype\n finishPartial(obj, m);\n }\n\n return obj;\n}\n\n/**\n @method mixin\n @for Ember\n @param obj\n @param mixins*\n @return obj\n*/\nEmber.mixin = function(obj) {\n var args = a_slice.call(arguments, 1);\n applyMixin(obj, args, false);\n return obj;\n};\n\n/**\n The `Ember.Mixin` class allows you to create mixins, whose properties can be\n added to other classes. For instance,\n\n ```javascript\n App.Editable = Ember.Mixin.create({\n edit: function() {\n console.log('starting to edit');\n this.set('isEditing', true);\n },\n isEditing: false\n });\n\n // Mix mixins into classes by passing them as the first arguments to\n // .extend.\n App.CommentView = Ember.View.extend(App.Editable, {\n template: Ember.Handlebars.compile('{{#if view.isEditing}}...{{else}}...{{/if}}')\n });\n\n commentView = App.CommentView.create();\n commentView.edit(); // outputs 'starting to edit'\n ```\n\n Note that Mixins are created with `Ember.Mixin.create`, not\n `Ember.Mixin.extend`.\n\n Note that mixins extend a constructor's prototype so arrays and object literals\n defined as properties will be shared amongst objects that implement the mixin.\n If you want to define an property in a mixin that is not shared, you can define\n it either as a computed property or have it be created on initialization of the object.\n\n ```javascript\n //filters array will be shared amongst any object implementing mixin\n App.Filterable = Ember.Mixin.create({\n filters: Ember.A()\n });\n\n //filters will be a separate array for every object implementing the mixin\n App.Filterable = Ember.Mixin.create({\n filters: Ember.computed(function(){return Ember.A();})\n });\n\n //filters will be created as a separate array during the object's initialization\n App.Filterable = Ember.Mixin.create({\n init: function() {\n this._super();\n this.set(\"filters\", Ember.A());\n }\n });\n ```\n\n @class Mixin\n @namespace Ember\n*/\nEmber.Mixin = function() { return initMixin(this, arguments); };\n\nMixin = Ember.Mixin;\n\nMixin.prototype = {\n properties: null,\n mixins: null,\n ownerConstructor: null\n};\n\nMixin._apply = applyMixin;\n\nMixin.applyPartial = function(obj) {\n var args = a_slice.call(arguments, 1);\n return applyMixin(obj, args, true);\n};\n\nMixin.finishPartial = finishPartial;\n\nEmber.anyUnprocessedMixins = false;\n\n/**\n @method create\n @static\n @param arguments*\n*/\nMixin.create = function() {\n Ember.anyUnprocessedMixins = true;\n var M = this;\n return initMixin(new M(), arguments);\n};\n\nvar MixinPrototype = Mixin.prototype;\n\n/**\n @method reopen\n @param arguments*\n*/\nMixinPrototype.reopen = function() {\n var mixin, tmp;\n\n if (this.properties) {\n mixin = Mixin.create();\n mixin.properties = this.properties;\n delete this.properties;\n this.mixins = [mixin];\n } else if (!this.mixins) {\n this.mixins = [];\n }\n\n var len = arguments.length, mixins = this.mixins, idx;\n\n for(idx=0; idx < len; idx++) {\n mixin = arguments[idx];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n if (mixin instanceof Mixin) {\n mixins.push(mixin);\n } else {\n tmp = Mixin.create();\n tmp.properties = mixin;\n mixins.push(tmp);\n }\n }\n\n return this;\n};\n\n/**\n @method apply\n @param obj\n @return applied object\n*/\nMixinPrototype.apply = function(obj) {\n return applyMixin(obj, [this], false);\n};\n\nMixinPrototype.applyPartial = function(obj) {\n return applyMixin(obj, [this], true);\n};\n\nfunction _detect(curMixin, targetMixin, seen) {\n var guid = guidFor(curMixin);\n\n if (seen[guid]) { return false; }\n seen[guid] = true;\n\n if (curMixin === targetMixin) { return true; }\n var mixins = curMixin.mixins, loc = mixins ? mixins.length : 0;\n while (--loc >= 0) {\n if (_detect(mixins[loc], targetMixin, seen)) { return true; }\n }\n return false;\n}\n\n/**\n @method detect\n @param obj\n @return {Boolean}\n*/\nMixinPrototype.detect = function(obj) {\n if (!obj) { return false; }\n if (obj instanceof Mixin) { return _detect(obj, this, {}); }\n var mixins = Ember.meta(obj, false).mixins;\n if (mixins) {\n return !!mixins[guidFor(this)];\n }\n return false;\n};\n\nMixinPrototype.without = function() {\n var ret = new Mixin(this);\n ret._without = a_slice.call(arguments);\n return ret;\n};\n\nfunction _keys(ret, mixin, seen) {\n if (seen[guidFor(mixin)]) { return; }\n seen[guidFor(mixin)] = true;\n\n if (mixin.properties) {\n var props = mixin.properties;\n for (var key in props) {\n if (props.hasOwnProperty(key)) { ret[key] = true; }\n }\n } else if (mixin.mixins) {\n a_forEach.call(mixin.mixins, function(x) { _keys(ret, x, seen); });\n }\n}\n\nMixinPrototype.keys = function() {\n var keys = {}, seen = {}, ret = [];\n _keys(keys, this, seen);\n for(var key in keys) {\n if (keys.hasOwnProperty(key)) { ret.push(key); }\n }\n return ret;\n};\n\n// returns the mixins currently applied to the specified object\n// TODO: Make Ember.mixin\nMixin.mixins = function(obj) {\n var mixins = Ember.meta(obj, false).mixins, ret = [];\n\n if (!mixins) { return ret; }\n\n for (var key in mixins) {\n var mixin = mixins[key];\n\n // skip primitive mixins since these are always anonymous\n if (!mixin.properties) { ret.push(mixin); }\n }\n\n return ret;\n};\n\nREQUIRED = new Ember.Descriptor();\nREQUIRED.toString = function() { return '(Required Property)'; };\n\n/**\n Denotes a required property for a mixin\n\n @method required\n @for Ember\n*/\nEmber.required = function() {\n return REQUIRED;\n};\n\nAlias = function(methodName) {\n this.methodName = methodName;\n};\nAlias.prototype = new Ember.Descriptor();\n\n/**\n Makes a property or method available via an additional name.\n\n ```javascript\n App.PaintSample = Ember.Object.extend({\n color: 'red',\n colour: Ember.alias('color'),\n name: function() {\n return \"Zed\";\n },\n moniker: Ember.alias(\"name\")\n });\n\n var paintSample = App.PaintSample.create()\n paintSample.get('colour'); // 'red'\n paintSample.moniker(); // 'Zed'\n ```\n\n @method alias\n @for Ember\n @param {String} methodName name of the method or property to alias\n @return {Ember.Descriptor}\n @deprecated Use `Ember.aliasMethod` or `Ember.computed.alias` instead\n*/\nEmber.alias = function(methodName) {\n Ember.deprecate(\"Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.\");\n return new Alias(methodName);\n};\n\n/**\n Makes a method available via an additional name.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name: function() {\n return 'Tomhuda Katzdale';\n },\n moniker: Ember.aliasMethod('name')\n });\n\n var goodGuy = App.Person.create()\n ```\n\n @method aliasMethod\n @for Ember\n @param {String} methodName name of the method to alias\n @return {Ember.Descriptor}\n*/\nEmber.aliasMethod = function(methodName) {\n return new Alias(methodName);\n};\n\n// ..........................................................\n// OBSERVER HELPER\n//\n\n/**\n Specify a method that observes property changes.\n\n ```javascript\n Ember.Object.extend({\n valueObserver: Ember.observer('value', function() {\n // Executes whenever the \"value\" property changes\n })\n });\n ```\n\n In the future this method may become asynchronous. If you want to ensure\n synchronous behavior, use `immediateObserver`.\n\n Also available as `Function.prototype.observes` if prototype extensions are\n enabled.\n\n @method observer\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n*/\nEmber.observer = function() {\n var func = a_slice.call(arguments, -1)[0];\n var paths = a_slice.call(arguments, 0, -1);\n\n if (typeof func !== \"function\") {\n // revert to old, soft-deprecated argument ordering\n\n func = arguments[0];\n paths = a_slice.call(arguments, 1);\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Ember.observer called without a function\");\n }\n\n func.__ember_observes__ = paths;\n return func;\n};\n\n/**\n Specify a method that observes property changes.\n\n ```javascript\n Ember.Object.extend({\n valueObserver: Ember.immediateObserver('value', function() {\n // Executes whenever the \"value\" property changes\n })\n });\n ```\n\n In the future, `Ember.observer` may become asynchronous. In this event,\n `Ember.immediateObserver` will maintain the synchronous behavior.\n\n Also available as `Function.prototype.observesImmediately` if prototype extensions are\n enabled.\n\n @method immediateObserver\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n*/\nEmber.immediateObserver = function() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", typeof arg !== \"string\" || arg.indexOf('.') === -1);\n }\n\n return Ember.observer.apply(this, arguments);\n};\n\n/**\n When observers fire, they are called with the arguments `obj`, `keyName`.\n\n Note, `@each.property` observer is called per each add or replace of an element\n and it's not called with a specific enumeration item.\n\n A `beforeObserver` fires before a property changes.\n\n A `beforeObserver` is an alternative form of `.observesBefore()`.\n\n ```javascript\n App.PersonView = Ember.View.extend({\n\n friends: [{ name: 'Tom' }, { name: 'Stefan' }, { name: 'Kris' }],\n\n valueWillChange: Ember.beforeObserver('content.value', function(obj, keyName) {\n this.changingFrom = obj.get(keyName);\n }),\n\n valueDidChange: Ember.observer('content.value', function(obj, keyName) {\n // only run if updating a value already in the DOM\n if (this.get('state') === 'inDOM') {\n var color = obj.get(keyName) > this.changingFrom ? 'green' : 'red';\n // logic\n }\n }),\n\n friendsDidChange: Ember.observer('friends.@each.name', function(obj, keyName) {\n // some logic\n // obj.get(keyName) returns friends array\n })\n });\n ```\n\n Also available as `Function.prototype.observesBefore` if prototype extensions are\n enabled.\n\n @method beforeObserver\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n*/\nEmber.beforeObserver = function() {\n var func = a_slice.call(arguments, -1)[0];\n var paths = a_slice.call(arguments, 0, -1);\n\n if (typeof func !== \"function\") {\n // revert to old, soft-deprecated argument ordering\n\n func = arguments[0];\n paths = a_slice.call(arguments, 1);\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Ember.beforeObserver called without a function\");\n }\n\n func.__ember_observesBefore__ = paths;\n return func;\n};\n\n})();\n//@ sourceURL=ember-metal/mixin");minispade.register('ember-metal/observer', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils'); // Ember.tryFinally\nminispade.require('ember-metal/expand_properties');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/array');\n\n/**\n@module ember-metal\n*/\n\nvar AFTER_OBSERVERS = ':change',\n BEFORE_OBSERVERS = ':before';\n\nif (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n var expandProperties = Ember.expandProperties;\n}\n\nfunction changeEvent(keyName) {\n return keyName+AFTER_OBSERVERS;\n}\n\nfunction beforeEvent(keyName) {\n return keyName+BEFORE_OBSERVERS;\n}\n\n/**\n @method addObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.addObserver = function(obj, _path, target, method) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_path, function (path) {\n Ember.addListener(obj, changeEvent(path), target, method);\n Ember.watch(obj, path);\n });\n } else {\n Ember.addListener(obj, changeEvent(_path), target, method);\n Ember.watch(obj, _path);\n }\n\n return this;\n};\n\nEmber.observersFor = function(obj, path) {\n return Ember.listenersFor(obj, changeEvent(path));\n};\n\n/**\n @method removeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.removeObserver = function(obj, _path, target, method) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_path, function (path) {\n Ember.unwatch(obj, path);\n Ember.removeListener(obj, changeEvent(path), target, method);\n });\n } else {\n Ember.unwatch(obj, _path);\n Ember.removeListener(obj, changeEvent(_path), target, method);\n }\n return this;\n};\n\n/**\n @method addBeforeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.addBeforeObserver = function(obj, _path, target, method) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_path, function (path) {\n Ember.addListener(obj, beforeEvent(path), target, method);\n Ember.watch(obj, path);\n });\n } else {\n Ember.addListener(obj, beforeEvent(_path), target, method);\n Ember.watch(obj, _path);\n }\n return this;\n};\n\n// Suspend observer during callback.\n//\n// This should only be used by the target of the observer\n// while it is setting the observed path.\nEmber._suspendBeforeObserver = function(obj, path, target, method, callback) {\n return Ember._suspendListener(obj, beforeEvent(path), target, method, callback);\n};\n\nEmber._suspendObserver = function(obj, path, target, method, callback) {\n return Ember._suspendListener(obj, changeEvent(path), target, method, callback);\n};\n\nvar map = Ember.ArrayPolyfills.map;\n\nEmber._suspendBeforeObservers = function(obj, paths, target, method, callback) {\n var events = map.call(paths, beforeEvent);\n return Ember._suspendListeners(obj, events, target, method, callback);\n};\n\nEmber._suspendObservers = function(obj, paths, target, method, callback) {\n var events = map.call(paths, changeEvent);\n return Ember._suspendListeners(obj, events, target, method, callback);\n};\n\nEmber.beforeObserversFor = function(obj, path) {\n return Ember.listenersFor(obj, beforeEvent(path));\n};\n\n/**\n @method removeBeforeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.removeBeforeObserver = function(obj, _path, target, method) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_path, function (path) {\n Ember.unwatch(obj, path);\n Ember.removeListener(obj, beforeEvent(path), target, method);\n });\n } else {\n Ember.unwatch(obj, _path);\n Ember.removeListener(obj, beforeEvent(_path), target, method);\n }\n return this;\n};\n\n})();\n//@ sourceURL=ember-metal/observer");minispade.register('ember-metal/observer_set', "(function() {var guidFor = Ember.guidFor,\n sendEvent = Ember.sendEvent;\n\n/*\n this.observerSet = {\n [senderGuid]: { // variable name: `keySet`\n [keyName]: listIndex\n }\n },\n this.observers = [\n {\n sender: obj,\n keyName: keyName,\n eventName: eventName,\n listeners: [\n [target, method, flags]\n ]\n },\n ...\n ]\n*/\nvar ObserverSet = Ember._ObserverSet = function() {\n this.clear();\n};\n\nObserverSet.prototype.add = function(sender, keyName, eventName) {\n var observerSet = this.observerSet,\n observers = this.observers,\n senderGuid = guidFor(sender),\n keySet = observerSet[senderGuid],\n index;\n\n if (!keySet) {\n observerSet[senderGuid] = keySet = {};\n }\n index = keySet[keyName];\n if (index === undefined) {\n index = observers.push({\n sender: sender,\n keyName: keyName,\n eventName: eventName,\n listeners: []\n }) - 1;\n keySet[keyName] = index;\n }\n return observers[index].listeners;\n};\n\nObserverSet.prototype.flush = function() {\n var observers = this.observers, i, len, observer, sender;\n this.clear();\n for (i=0, len=observers.length; i < len; ++i) {\n observer = observers[i];\n sender = observer.sender;\n if (sender.isDestroying || sender.isDestroyed) { continue; }\n sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners);\n }\n};\n\nObserverSet.prototype.clear = function() {\n this.observerSet = {};\n this.observers = [];\n};\n})();\n//@ sourceURL=ember-metal/observer_set");minispade.register('ember-metal/platform', "(function() {/*globals Node */\nminispade.require('ember-metal/core');\n\n/**\n@module ember-metal\n*/\n\n/**\n Platform specific methods and feature detectors needed by the framework.\n\n @class platform\n @namespace Ember\n @static\n*/\nvar platform = Ember.platform = {};\n\n\n/**\n Identical to `Object.create()`. Implements if not available natively.\n\n @method create\n @for Ember\n*/\nEmber.create = Object.create;\n\n// IE8 has Object.create but it couldn't treat property descripters.\nif (Ember.create) {\n if (Ember.create({a: 1}, {a: {value: 2}}).a !== 2) {\n Ember.create = null;\n }\n}\n\n// STUB_OBJECT_CREATE allows us to override other libraries that stub\n// Object.create different than we would prefer\nif (!Ember.create || Ember.ENV.STUB_OBJECT_CREATE) {\n var K = function() {};\n\n Ember.create = function(obj, props) {\n K.prototype = obj;\n obj = new K();\n if (props) {\n K.prototype = obj;\n for (var prop in props) {\n K.prototype[prop] = props[prop].value;\n }\n obj = new K();\n }\n K.prototype = null;\n\n return obj;\n };\n\n Ember.create.isSimulated = true;\n}\n\nvar defineProperty = Object.defineProperty;\nvar canRedefineProperties, canDefinePropertyOnDOM;\n\n// Catch IE8 where Object.defineProperty exists but only works on DOM elements\nif (defineProperty) {\n try {\n defineProperty({}, 'a',{get:function() {}});\n } catch (e) {\n defineProperty = null;\n }\n}\n\nif (defineProperty) {\n // Detects a bug in Android <3.2 where you cannot redefine a property using\n // Object.defineProperty once accessors have already been set.\n canRedefineProperties = (function() {\n var obj = {};\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n get: function() { },\n set: function() { }\n });\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: true\n });\n\n return obj.a === true;\n })();\n\n // This is for Safari 5.0, which supports Object.defineProperty, but not\n // on DOM nodes.\n canDefinePropertyOnDOM = (function() {\n try {\n defineProperty(document.createElement('div'), 'definePropertyOnDOM', {});\n return true;\n } catch(e) { }\n\n return false;\n })();\n\n if (!canRedefineProperties) {\n defineProperty = null;\n } else if (!canDefinePropertyOnDOM) {\n defineProperty = function(obj, keyName, desc) {\n var isNode;\n\n if (typeof Node === \"object\") {\n isNode = obj instanceof Node;\n } else {\n isNode = typeof obj === \"object\" && typeof obj.nodeType === \"number\" && typeof obj.nodeName === \"string\";\n }\n\n if (isNode) {\n // TODO: Should we have a warning here?\n return (obj[keyName] = desc.value);\n } else {\n return Object.defineProperty(obj, keyName, desc);\n }\n };\n }\n}\n\n/**\n@class platform\n@namespace Ember\n*/\n\n/**\n Identical to `Object.defineProperty()`. Implements as much functionality\n as possible if not available natively.\n\n @method defineProperty\n @param {Object} obj The object to modify\n @param {String} keyName property name to modify\n @param {Object} desc descriptor hash\n @return {void}\n*/\nplatform.defineProperty = defineProperty;\n\n/**\n Set to true if the platform supports native getters and setters.\n\n @property hasPropertyAccessors\n @final\n*/\nplatform.hasPropertyAccessors = true;\n\nif (!platform.defineProperty) {\n platform.hasPropertyAccessors = false;\n\n platform.defineProperty = function(obj, keyName, desc) {\n if (!desc.get) { obj[keyName] = desc.value; }\n };\n\n platform.defineProperty.isSimulated = true;\n}\n\nif (Ember.ENV.MANDATORY_SETTER && !platform.hasPropertyAccessors) {\n Ember.ENV.MANDATORY_SETTER = false;\n}\n\n})();\n//@ sourceURL=ember-metal/platform");minispade.register('ember-metal/properties', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/property_get');\n\n/**\n@module ember-metal\n*/\n\nvar META_KEY = Ember.META_KEY,\n metaFor = Ember.meta,\n objectDefineProperty = Ember.platform.defineProperty;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n// ..........................................................\n// DESCRIPTOR\n//\n\n/**\n Objects of this type can implement an interface to respond to requests to\n get and set. The default implementation handles simple properties.\n\n You generally won't need to create or subclass this directly.\n\n @class Descriptor\n @namespace Ember\n @private\n @constructor\n*/\nEmber.Descriptor = function() {};\n\n// ..........................................................\n// DEFINING PROPERTIES API\n//\n\nvar MANDATORY_SETTER_FUNCTION = Ember.MANDATORY_SETTER_FUNCTION = function(value) {\n Ember.assert(\"You must use Ember.set() to access this property (of \" + this + \")\", false);\n};\n\nvar DEFAULT_GETTER_FUNCTION = Ember.DEFAULT_GETTER_FUNCTION = function(name) {\n return function() {\n var meta = this[META_KEY];\n return meta && meta.values[name];\n };\n};\n\n/**\n @private\n\n NOTE: This is a low-level method used by other parts of the API. You almost\n never want to call this method directly. Instead you should use\n `Ember.mixin()` to define new properties.\n\n Defines a property on an object. This method works much like the ES5\n `Object.defineProperty()` method except that it can also accept computed\n properties and other special descriptors.\n\n Normally this method takes only three parameters. However if you pass an\n instance of `Ember.Descriptor` as the third param then you can pass an\n optional value as the fourth parameter. This is often more efficient than\n creating new descriptor hashes for each property.\n\n ## Examples\n\n ```javascript\n // ES5 compatible mode\n Ember.defineProperty(contact, 'firstName', {\n writable: true,\n configurable: false,\n enumerable: true,\n value: 'Charles'\n });\n\n // define a simple property\n Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');\n\n // define a computed property\n Ember.defineProperty(contact, 'fullName', Ember.computed(function() {\n return this.firstName+' '+this.lastName;\n }).property('firstName', 'lastName'));\n ```\n\n @method defineProperty\n @for Ember\n @param {Object} obj the object to define this property on. This may be a prototype.\n @param {String} keyName the name of the property\n @param {Ember.Descriptor} [desc] an instance of `Ember.Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.\n @param {*} [data] something other than a descriptor, that will\n become the explicit value of this property.\n*/\nEmber.defineProperty = function(obj, keyName, desc, data, meta) {\n var descs, existingDesc, watching, value;\n\n if (!meta) meta = metaFor(obj);\n descs = meta.descs;\n existingDesc = meta.descs[keyName];\n watching = meta.watching[keyName] > 0;\n\n if (existingDesc instanceof Ember.Descriptor) {\n existingDesc.teardown(obj, keyName);\n }\n\n if (desc instanceof Ember.Descriptor) {\n value = desc;\n\n descs[keyName] = desc;\n if (MANDATORY_SETTER && watching) {\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: undefined // make enumerable\n });\n } else {\n obj[keyName] = undefined; // make enumerable\n }\n } else {\n descs[keyName] = undefined; // shadow descriptor in proto\n if (desc == null) {\n value = data;\n\n if (MANDATORY_SETTER && watching) {\n meta.values[keyName] = data;\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: MANDATORY_SETTER_FUNCTION,\n get: DEFAULT_GETTER_FUNCTION(keyName)\n });\n } else {\n obj[keyName] = data;\n }\n } else {\n value = desc;\n\n // compatibility with ES5\n objectDefineProperty(obj, keyName, desc);\n }\n }\n\n // if key is being watched, override chains that\n // were initialized with the prototype\n if (watching) { Ember.overrideChains(obj, keyName, meta); }\n\n // The `value` passed to the `didDefineProperty` hook is\n // either the descriptor or data, whichever was passed.\n if (obj.didDefineProperty) { obj.didDefineProperty(obj, keyName, value); }\n\n return this;\n};\n\n\n})();\n//@ sourceURL=ember-metal/properties");minispade.register('ember-metal/property_events', "(function() {minispade.require('ember-metal/utils');\nminispade.require('ember-metal/events');\nminispade.require('ember-metal/observer_set');\n\nvar metaFor = Ember.meta,\n guidFor = Ember.guidFor,\n tryFinally = Ember.tryFinally,\n sendEvent = Ember.sendEvent,\n listenersUnion = Ember.listenersUnion,\n listenersDiff = Ember.listenersDiff,\n ObserverSet = Ember._ObserverSet,\n beforeObserverSet = new ObserverSet(),\n observerSet = new ObserverSet(),\n deferred = 0;\n\n// ..........................................................\n// PROPERTY CHANGES\n//\n\n/**\n This function is called just before an object property is about to change.\n It will notify any before observers and prepare caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyDidChange()` which you should call just\n after the property value changes.\n\n @method propertyWillChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n*/\nfunction propertyWillChange(obj, keyName) {\n var m = metaFor(obj, false),\n watching = m.watching[keyName] > 0 || keyName === 'length',\n proto = m.proto,\n desc = m.descs[keyName];\n\n if (!watching) { return; }\n if (proto === obj) { return; }\n if (desc && desc.willChange) { desc.willChange(obj, keyName); }\n dependentKeysWillChange(obj, keyName, m);\n chainsWillChange(obj, keyName, m);\n notifyBeforeObservers(obj, keyName);\n}\nEmber.propertyWillChange = propertyWillChange;\n\n/**\n This function is called just after an object property has changed.\n It will notify any observers and clear caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyWillChange()` which you should call just\n before the property value changes.\n\n @method propertyDidChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n*/\nfunction propertyDidChange(obj, keyName) {\n var m = metaFor(obj, false),\n watching = m.watching[keyName] > 0 || keyName === 'length',\n proto = m.proto,\n desc = m.descs[keyName];\n\n if (proto === obj) { return; }\n\n // shouldn't this mean that we're watching this key?\n if (desc && desc.didChange) { desc.didChange(obj, keyName); }\n if (!watching && keyName !== 'length') { return; }\n\n dependentKeysDidChange(obj, keyName, m);\n chainsDidChange(obj, keyName, m, false);\n notifyObservers(obj, keyName);\n}\nEmber.propertyDidChange = propertyDidChange;\n\nvar WILL_SEEN, DID_SEEN;\n\n// called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...)\nfunction dependentKeysWillChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = WILL_SEEN, top = !seen;\n if (top) { seen = WILL_SEEN = {}; }\n iterDeps(propertyWillChange, obj, depKey, seen, meta);\n if (top) { WILL_SEEN = null; }\n}\n\n// called whenever a property has just changed to update dependent keys\nfunction dependentKeysDidChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = DID_SEEN, top = !seen;\n if (top) { seen = DID_SEEN = {}; }\n iterDeps(propertyDidChange, obj, depKey, seen, meta);\n if (top) { DID_SEEN = null; }\n}\n\nfunction iterDeps(method, obj, depKey, seen, meta) {\n var guid = guidFor(obj);\n if (!seen[guid]) seen[guid] = {};\n if (seen[guid][depKey]) return;\n seen[guid][depKey] = true;\n\n var deps = meta.deps;\n deps = deps && deps[depKey];\n if (deps) {\n for(var key in deps) {\n var desc = meta.descs[key];\n if (desc && desc._suspended === obj) continue;\n method(obj, key);\n }\n }\n}\n\nfunction chainsWillChange(obj, keyName, m) {\n if (!(m.hasOwnProperty('chainWatchers') &&\n m.chainWatchers[keyName])) {\n return;\n }\n\n var nodes = m.chainWatchers[keyName],\n events = [],\n i, l;\n\n for(i = 0, l = nodes.length; i < l; i++) {\n nodes[i].willChange(events);\n }\n\n for (i = 0, l = events.length; i < l; i += 2) {\n propertyWillChange(events[i], events[i+1]);\n }\n}\n\nfunction chainsDidChange(obj, keyName, m, suppressEvents) {\n if (!(m.hasOwnProperty('chainWatchers') &&\n m.chainWatchers[keyName])) {\n return;\n }\n\n var nodes = m.chainWatchers[keyName],\n events = suppressEvents ? null : [],\n i, l;\n\n for(i = 0, l = nodes.length; i < l; i++) {\n nodes[i].didChange(events);\n }\n\n if (suppressEvents) {\n return;\n }\n\n for (i = 0, l = events.length; i < l; i += 2) {\n propertyDidChange(events[i], events[i+1]);\n }\n}\n\nEmber.overrideChains = function(obj, keyName, m) {\n chainsDidChange(obj, keyName, m, true);\n};\n\n/**\n @method beginPropertyChanges\n @chainable\n*/\nfunction beginPropertyChanges() {\n deferred++;\n}\n\nEmber.beginPropertyChanges = beginPropertyChanges;\n\n/**\n @method endPropertyChanges\n*/\nfunction endPropertyChanges() {\n deferred--;\n if (deferred<=0) {\n beforeObserverSet.clear();\n observerSet.flush();\n }\n}\n\nEmber.endPropertyChanges = endPropertyChanges;\n\n/**\n Make a series of property changes together in an\n exception-safe way.\n\n ```javascript\n Ember.changeProperties(function() {\n obj1.set('foo', mayBlowUpWhenSet);\n obj2.set('bar', baz);\n });\n ```\n\n @method changeProperties\n @param {Function} callback\n @param [binding]\n*/\nEmber.changeProperties = function(cb, binding) {\n beginPropertyChanges();\n tryFinally(cb, endPropertyChanges, binding);\n};\n\nfunction notifyBeforeObservers(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = keyName + ':before', listeners, diff;\n if (deferred) {\n listeners = beforeObserverSet.add(obj, keyName, eventName);\n diff = listenersDiff(obj, eventName, listeners);\n sendEvent(obj, eventName, [obj, keyName], diff);\n } else {\n sendEvent(obj, eventName, [obj, keyName]);\n }\n}\n\nfunction notifyObservers(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = keyName + ':change', listeners;\n if (deferred) {\n listeners = observerSet.add(obj, keyName, eventName);\n listenersUnion(obj, eventName, listeners);\n } else {\n sendEvent(obj, eventName, [obj, keyName]);\n }\n}\n\n})();\n//@ sourceURL=ember-metal/property_events");minispade.register('ember-metal/property_get', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\n\n/**\n@module ember-metal\n*/\n\nvar META_KEY = Ember.META_KEY, get;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\nvar IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\\.\\*]/;\nvar HAS_THIS = /^this[\\.\\*]/;\nvar FIRST_KEY = /^([^\\.\\*]+)/;\n\n// ..........................................................\n// GET AND SET\n//\n// If we are on a platform that supports accessors we can use those.\n// Otherwise simulate accessors by looking up the property directly on the\n// object.\n\n/**\n Gets the value of a property on an object. If the property is computed,\n the function will be invoked. If the property is not defined but the\n object implements the `unknownProperty` method then that will be invoked.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to retrieve a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to retrieve\n properties if the property might not be defined on the object and you want\n to respect the `unknownProperty` handler. Otherwise you can ignore this\n method.\n\n Note that if the object itself is `undefined`, this method will throw\n an error.\n\n @method get\n @for Ember\n @param {Object} obj The object to retrieve from.\n @param {String} keyName The property key to retrieve\n @return {Object} the property value or `null`.\n*/\nget = function get(obj, keyName) {\n // Helpers that operate with 'this' within an #each\n if (keyName === '') {\n return obj;\n }\n\n if (!keyName && 'string'===typeof obj) {\n keyName = obj;\n obj = null;\n }\n\n Ember.assert(\"Cannot call get with \"+ keyName +\" key.\", !!keyName);\n Ember.assert(\"Cannot call get with '\"+ keyName +\"' on an undefined object.\", obj !== undefined);\n\n if (obj === null || keyName.indexOf('.') !== -1) {\n return getPath(obj, keyName);\n }\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;\n if (desc) {\n return desc.get(obj, keyName);\n } else {\n if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {\n ret = meta.values[keyName];\n } else {\n ret = obj[keyName];\n }\n\n if (ret === undefined &&\n 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {\n return obj.unknownProperty(keyName);\n }\n\n return ret;\n }\n};\n\n// Currently used only by Ember Data tests\nif (Ember.config.overrideAccessors) {\n Ember.get = get;\n Ember.config.overrideAccessors();\n get = Ember.get;\n}\n\n/**\n @private\n\n Normalizes a target/path pair to reflect that actual target/path that should\n be observed, etc. This takes into account passing in global property\n paths (i.e. a path beginning with a captial letter not defined on the\n target) and * separators.\n\n @method normalizeTuple\n @for Ember\n @param {Object} target The current target. May be `null`.\n @param {String} path A path on the target or a global property path.\n @return {Array} a temporary array with the normalized target/path pair.\n*/\nvar normalizeTuple = Ember.normalizeTuple = function(target, path) {\n var hasThis = HAS_THIS.test(path),\n isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),\n key;\n\n if (!target || isGlobal) target = Ember.lookup;\n if (hasThis) path = path.slice(5);\n\n if (target === Ember.lookup) {\n key = path.match(FIRST_KEY)[0];\n target = get(target, key);\n path = path.slice(key.length+1);\n }\n\n // must return some kind of path to be valid else other things will break.\n if (!path || path.length===0) throw new Ember.Error('Invalid Path');\n\n return [ target, path ];\n};\n\nvar getPath = Ember._getPath = function(root, path) {\n var hasThis, parts, tuple, idx, len;\n\n // If there is no root and path is a key name, return that\n // property from the global object.\n // E.g. get('Ember') -> Ember\n if (root === null && path.indexOf('.') === -1) { return get(Ember.lookup, path); }\n\n // detect complicated paths and normalize them\n hasThis = HAS_THIS.test(path);\n\n if (!root || hasThis) {\n tuple = normalizeTuple(root, path);\n root = tuple[0];\n path = tuple[1];\n tuple.length = 0;\n }\n\n parts = path.split(\".\");\n len = parts.length;\n for (idx = 0; root != null && idx < len; idx++) {\n root = get(root, parts[idx], true);\n if (root && root.isDestroyed) { return undefined; }\n }\n return root;\n};\n\nEmber.getWithDefault = function(root, key, defaultValue) {\n var value = get(root, key);\n\n if (value === undefined) { return defaultValue; }\n return value;\n};\n\n\nEmber.get = get;\n\n})();\n//@ sourceURL=ember-metal/property_get");minispade.register('ember-metal/property_set', "(function() {minispade.require('ember-metal/utils'); // META_KEY\nminispade.require('ember-metal/property_get'); // _getPath\nminispade.require('ember-metal/property_events'); // propertyWillChange, propertyDidChange\n\nvar META_KEY = Ember.META_KEY,\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/,\n getPath = Ember._getPath;\n\n/**\n Sets the value of a property on an object, respecting computed properties\n and notifying observers and other listeners of the change. If the\n property is not defined but the object implements the `setUnknownProperty`\n method then that will be invoked as well.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to set a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to set\n properties if the property might not be defined on the object and you want\n to respect the `setUnknownProperty` handler. Otherwise you can ignore this\n method.\n\n @method set\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} keyName The property key to set\n @param {Object} value The value to set\n @return {Object} the passed value.\n*/\nvar set = function set(obj, keyName, value, tolerant) {\n if (typeof obj === 'string') {\n Ember.assert(\"Path '\" + obj + \"' must be global if no obj is given.\", IS_GLOBAL.test(obj));\n value = keyName;\n keyName = obj;\n obj = null;\n }\n\n Ember.assert(\"Cannot call set with \"+ keyName +\" key.\", !!keyName);\n\n if (!obj || keyName.indexOf('.') !== -1) {\n return setPath(obj, keyName, value, tolerant);\n }\n\n Ember.assert(\"You need to provide an object and key to `set`.\", !!obj && keyName !== undefined);\n Ember.assert('calling set on destroyed object', !obj.isDestroyed);\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName],\n isUnknown, currentValue;\n if (desc) {\n desc.set(obj, keyName, value);\n } else {\n isUnknown = 'object' === typeof obj && !(keyName in obj);\n\n // setUnknownProperty is called if `obj` is an object,\n // the property does not already exist, and the\n // `setUnknownProperty` method exists on the object\n if (isUnknown && 'function' === typeof obj.setUnknownProperty) {\n obj.setUnknownProperty(keyName, value);\n } else if (meta && meta.watching[keyName] > 0) {\n if (MANDATORY_SETTER) {\n currentValue = meta.values[keyName];\n } else {\n currentValue = obj[keyName];\n }\n // only trigger a change if the value has changed\n if (value !== currentValue) {\n Ember.propertyWillChange(obj, keyName);\n if (MANDATORY_SETTER) {\n if (currentValue === undefined && !(keyName in obj)) {\n Ember.defineProperty(obj, keyName, null, value); // setup mandatory setter\n } else {\n meta.values[keyName] = value;\n }\n } else {\n obj[keyName] = value;\n }\n Ember.propertyDidChange(obj, keyName);\n }\n } else {\n obj[keyName] = value;\n }\n }\n return value;\n};\n\n// Currently used only by Ember Data tests\nif (Ember.config.overrideAccessors) {\n Ember.set = set;\n Ember.config.overrideAccessors();\n set = Ember.set;\n}\n\nfunction setPath(root, path, value, tolerant) {\n var keyName;\n\n // get the last part of the path\n keyName = path.slice(path.lastIndexOf('.') + 1);\n\n // get the first part of the part\n path = path.slice(0, path.length-(keyName.length+1));\n\n // unless the path is this, look up the first part to\n // get the root\n if (path !== 'this') {\n root = getPath(root, path);\n }\n\n if (!keyName || keyName.length === 0) {\n throw new Ember.Error('You passed an empty path');\n }\n\n if (!root) {\n if (tolerant) { return; }\n else { throw new Ember.Error('Object in path '+path+' could not be found or was destroyed.'); }\n }\n\n return set(root, keyName, value);\n}\n\nEmber.set = set;\n\n/**\n Error-tolerant form of `Ember.set`. Will not blow up if any part of the\n chain is `undefined`, `null`, or destroyed.\n\n This is primarily used when syncing bindings, which may try to update after\n an object has been destroyed.\n\n @method trySet\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} path The property path to set\n @param {Object} value The value to set\n*/\nEmber.trySet = function(root, path, value) {\n return set(root, path, value, true);\n};\n\n})();\n//@ sourceURL=ember-metal/property_set");minispade.register('ember-metal/run_loop', "(function() {minispade.require('ember-metal/vendor/backburner');\n\nvar onBegin = function(current) {\n Ember.run.currentRunLoop = current;\n};\n\nvar onEnd = function(current, next) {\n Ember.run.currentRunLoop = next;\n};\n\nvar Backburner = requireModule('backburner').Backburner,\n backburner = new Backburner(['sync', 'actions', 'destroy'], {\n sync: {\n before: Ember.beginPropertyChanges,\n after: Ember.endPropertyChanges\n },\n defaultQueue: 'actions',\n onBegin: onBegin,\n onEnd: onEnd\n }),\n slice = [].slice;\n\n// ..........................................................\n// Ember.run - this is ideally the only public API the dev sees\n//\n\n/**\n Runs the passed target and method inside of a RunLoop, ensuring any\n deferred actions including bindings and views updates are flushed at the\n end.\n\n Normally you should not need to invoke this method yourself. However if\n you are implementing raw event handlers when interfacing with other\n libraries or plugins, you should probably wrap all of your code inside this\n call.\n\n ```javascript\n Ember.run(function() {\n // code to be execute within a RunLoop\n });\n ```\n\n @class run\n @namespace Ember\n @static\n @constructor\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function.\n*/\nEmber.run = function(target, method) {\n var ret;\n\n if (Ember.onerror) {\n try {\n ret = backburner.run.apply(backburner, arguments);\n } catch (e) {\n Ember.onerror(e);\n }\n } else {\n ret = backburner.run.apply(backburner, arguments);\n }\n\n return ret;\n};\n\n/**\n\n If no run-loop is present, it creates a new one. If a run loop is\n present it will queue itself to run on the existing run-loops action\n queue.\n\n Please note: This is not for normal usage, and should be used sparingly.\n\n If invoked when not within a run loop:\n\n ```javascript\n Ember.run.join(function() {\n // creates a new run-loop\n });\n ```\n\n Alternatively, if called within an existing run loop:\n\n ```javascript\n Ember.run(function() {\n // creates a new run-loop\n Ember.run.join(function() {\n // joins with the existing run-loop, and queues for invocation on\n // the existing run-loops action queue.\n });\n });\n ```\n\n @method join\n @namespace Ember\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function. Please note,\n when called within an existing loop, no return value is possible.\n*/\nEmber.run.join = function(target, method) {\n if (!Ember.run.currentRunLoop) {\n return Ember.run.apply(Ember.run, arguments);\n }\n\n var args = slice.call(arguments);\n args.unshift('actions');\n Ember.run.schedule.apply(Ember.run, args);\n};\n\nEmber.run.backburner = backburner;\n\nvar run = Ember.run;\n\nEmber.run.currentRunLoop = null;\n\nEmber.run.queues = backburner.queueNames;\n\n/**\n Begins a new RunLoop. Any deferred actions invoked after the begin will\n be buffered until you invoke a matching call to `Ember.run.end()`. This is\n a lower-level way to use a RunLoop instead of using `Ember.run()`.\n\n ```javascript\n Ember.run.begin();\n // code to be execute within a RunLoop\n Ember.run.end();\n ```\n\n @method begin\n @return {void}\n*/\nEmber.run.begin = function() {\n backburner.begin();\n};\n\n/**\n Ends a RunLoop. This must be called sometime after you call\n `Ember.run.begin()` to flush any deferred actions. This is a lower-level way\n to use a RunLoop instead of using `Ember.run()`.\n\n ```javascript\n Ember.run.begin();\n // code to be execute within a RunLoop\n Ember.run.end();\n ```\n\n @method end\n @return {void}\n*/\nEmber.run.end = function() {\n backburner.end();\n};\n\n/**\n Array of named queues. This array determines the order in which queues\n are flushed at the end of the RunLoop. You can define your own queues by\n simply adding the queue name to this array. Normally you should not need\n to inspect or modify this property.\n\n @property queues\n @type Array\n @default ['sync', 'actions', 'destroy']\n*/\n\n/**\n Adds the passed target/method and any optional arguments to the named\n queue to be executed at the end of the RunLoop. If you have not already\n started a RunLoop when calling this method one will be started for you\n automatically.\n\n At the end of a RunLoop, any methods scheduled in this way will be invoked.\n Methods will be invoked in an order matching the named queues defined in\n the `Ember.run.queues` property.\n\n ```javascript\n Ember.run.schedule('sync', this, function() {\n // this will be executed in the first RunLoop queue, when bindings are synced\n console.log(\"scheduled on sync queue\");\n });\n\n Ember.run.schedule('actions', this, function() {\n // this will be executed in the 'actions' queue, after bindings have synced.\n console.log(\"scheduled on actions queue\");\n });\n\n // Note the functions will be run in order based on the run queues order. Output would be:\n // scheduled on sync queue\n // scheduled on actions queue\n ```\n\n @method schedule\n @param {String} queue The name of the queue to schedule against.\n Default queues are 'sync' and 'actions'\n @param {Object} [target] target object to use as the context when invoking a method.\n @param {String|Function} method The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.\n @param {Object} [arguments*] Optional arguments to be passed to the queued method.\n @return {void}\n*/\nEmber.run.schedule = function(queue, target, method) {\n checkAutoRun();\n backburner.schedule.apply(backburner, arguments);\n};\n\n// Used by global test teardown\nEmber.run.hasScheduledTimers = function() {\n return backburner.hasTimers();\n};\n\n// Used by global test teardown\nEmber.run.cancelTimers = function () {\n backburner.cancelTimers();\n};\n\n/**\n Immediately flushes any events scheduled in the 'sync' queue. Bindings\n use this queue so this method is a useful way to immediately force all\n bindings in the application to sync.\n\n You should call this method anytime you need any changed state to propagate\n throughout the app immediately without repainting the UI (which happens\n in the later 'render' queue added by the `ember-views` package).\n\n ```javascript\n Ember.run.sync();\n ```\n\n @method sync\n @return {void}\n*/\nEmber.run.sync = function() {\n if (backburner.currentInstance) {\n backburner.currentInstance.queues.sync.flush();\n }\n};\n\n/**\n Invokes the passed target/method and optional arguments after a specified\n period if time. The last parameter of this method must always be a number\n of milliseconds.\n\n You should use this method whenever you need to run some action after a\n period of time instead of using `setTimeout()`. This method will ensure that\n items that expire during the same script execution cycle all execute\n together, which is often more efficient than using a real setTimeout.\n\n ```javascript\n Ember.run.later(myContext, function() {\n // code here will execute within a RunLoop in about 500ms with this == myContext\n }, 500);\n ```\n\n @method later\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait Number of milliseconds to wait.\n @return {String} a string you can use to cancel the timer in\n `Ember.run.cancel` later.\n*/\nEmber.run.later = function(target, method) {\n return backburner.later.apply(backburner, arguments);\n};\n\n/**\n Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling `scheduleOnce` with the \"actions\" queue.\n\n @method once\n @param {Object} [target] The target of the method to invoke.\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.once = function(target, method) {\n checkAutoRun();\n var args = slice.call(arguments);\n args.unshift('actions');\n return backburner.scheduleOnce.apply(backburner, args);\n};\n\n/**\n Schedules a function to run one time in a given queue of the current RunLoop.\n Calling this method with the same queue/target/method combination will have\n no effect (past the initial call).\n\n Note that although you can pass optional arguments these will not be\n considered when looking for duplicates. New arguments will replace previous\n calls.\n\n ```javascript\n Ember.run(function() {\n var sayHi = function() { console.log('hi'); }\n Ember.run.scheduleOnce('afterRender', myContext, sayHi);\n Ember.run.scheduleOnce('afterRender', myContext, sayHi);\n // sayHi will only be executed once, in the afterRender queue of the RunLoop\n });\n ```\n\n Also note that passing an anonymous function to `Ember.run.scheduleOnce` will\n not prevent additional calls with an identical anonymous function from\n scheduling the items multiple times, e.g.:\n\n ```javascript\n function scheduleIt() {\n Ember.run.scheduleOnce('actions', myContext, function() { console.log(\"Closure\"); });\n }\n scheduleIt();\n scheduleIt();\n // \"Closure\" will print twice, even though we're using `Ember.run.scheduleOnce`,\n // because the function we pass to it is anonymous and won't match the\n // previously scheduled operation.\n ```\n\n Available queues, and their order, can be found at `Ember.run.queues`\n\n @method scheduleOnce\n @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'.\n @param {Object} [target] The target of the method to invoke.\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.scheduleOnce = function(queue, target, method) {\n checkAutoRun();\n return backburner.scheduleOnce.apply(backburner, arguments);\n};\n\n/**\n Schedules an item to run from within a separate run loop, after\n control has been returned to the system. This is equivalent to calling\n `Ember.run.later` with a wait time of 1ms.\n\n ```javascript\n Ember.run.next(myContext, function() {\n // code to be executed in the next run loop, which will be scheduled after the current one\n });\n ```\n\n Multiple operations scheduled with `Ember.run.next` will coalesce\n into the same later run loop, along with any other operations\n scheduled by `Ember.run.later` that expire right around the same\n time that `Ember.run.next` operations will fire.\n\n Note that there are often alternatives to using `Ember.run.next`.\n For instance, if you'd like to schedule an operation to happen\n after all DOM element operations have completed within the current\n run loop, you can make use of the `afterRender` run loop queue (added\n by the `ember-views` package, along with the preceding `render` queue\n where all the DOM element operations happen). Example:\n\n ```javascript\n App.MyCollectionView = Ember.CollectionView.extend({\n didInsertElement: function() {\n Ember.run.scheduleOnce('afterRender', this, 'processChildElements');\n },\n processChildElements: function() {\n // ... do something with collectionView's child view\n // elements after they've finished rendering, which\n // can't be done within the CollectionView's\n // `didInsertElement` hook because that gets run\n // before the child elements have been added to the DOM.\n }\n });\n ```\n\n One benefit of the above approach compared to using `Ember.run.next` is\n that you will be able to perform DOM/CSS operations before unprocessed\n elements are rendered to the screen, which may prevent flickering or\n other artifacts caused by delaying processing until after rendering.\n\n The other major benefit to the above approach is that `Ember.run.next`\n introduces an element of non-determinism, which can make things much\n harder to test, due to its reliance on `setTimeout`; it's much harder\n to guarantee the order of scheduled operations when they are scheduled\n outside of the current run loop, i.e. with `Ember.run.next`.\n\n @method next\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.next = function() {\n var args = slice.call(arguments);\n args.push(1);\n return backburner.later.apply(backburner, args);\n};\n\n/**\n Cancels a scheduled item. Must be a value returned by `Ember.run.later()`,\n `Ember.run.once()`, or `Ember.run.next()`.\n\n ```javascript\n var runNext = Ember.run.next(myContext, function() {\n // will not be executed\n });\n Ember.run.cancel(runNext);\n\n var runLater = Ember.run.later(myContext, function() {\n // will not be executed\n }, 500);\n Ember.run.cancel(runLater);\n\n var runOnce = Ember.run.once(myContext, function() {\n // will not be executed\n });\n Ember.run.cancel(runOnce);\n ```\n\n @method cancel\n @param {Object} timer Timer object to cancel\n @return {void}\n*/\nEmber.run.cancel = function(timer) {\n return backburner.cancel(timer);\n};\n\n/**\n Delay calling the target method until the debounce period has elapsed\n with no additional debounce calls. If `debounce` is called again before\n the specified time has elapsed, the timer is reset and the entire period\n must pass again before the target method is called.\n\n This method should be used when an event may be called multiple times\n but the action should only be called once when the event is done firing.\n A common example is for scroll events where you only want updates to\n happen once scrolling has ceased.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'debounce'};\n\n Ember.run.debounce(myContext, myFunc, 150);\n\n // less than 150ms passes\n\n Ember.run.debounce(myContext, myFunc, 150);\n\n // 150ms passes\n // myFunc is invoked with context myContext\n // console logs 'debounce ran.' one time.\n ```\n\n @method debounce\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait Number of milliseconds to wait.\n @param {Boolean} immediate Trigger the function on the leading instead of the trailing edge of the wait interval.\n @return {void}\n*/\nEmber.run.debounce = function() {\n return backburner.debounce.apply(backburner, arguments);\n};\n\n/**\n Ensure that the target method is never called more frequently than\n the specified spacing period.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'throttle'};\n\n Ember.run.throttle(myContext, myFunc, 150);\n\n // 50ms passes\n Ember.run.throttle(myContext, myFunc, 150);\n\n // 50ms passes\n Ember.run.throttle(myContext, myFunc, 150);\n\n // 50ms passes\n Ember.run.throttle(myContext, myFunc, 150);\n\n // 150ms passes\n // myFunc is invoked with context myContext\n // console logs 'throttle ran.' twice, 150ms apart.\n ```\n\n @method throttle\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} spacing Number of milliseconds to space out requests.\n @return {void}\n*/\nEmber.run.throttle = function() {\n return backburner.throttle.apply(backburner, arguments);\n};\n\n// Make sure it's not an autorun during testing\nfunction checkAutoRun() {\n if (!Ember.run.currentRunLoop) {\n Ember.assert(\"You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run\", !Ember.testing);\n }\n}\n\n})();\n//@ sourceURL=ember-metal/run_loop");minispade.register('ember-metal/set_properties', "(function() {minispade.require('ember-metal/property_events');\nminispade.require('ember-metal/property_set');\n\nvar changeProperties = Ember.changeProperties,\n set = Ember.set;\n\n/**\n Set a list of properties on an object. These properties are set inside\n a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n observers will be buffered.\n\n ```javascript\n anObject.setProperties({\n firstName: \"Stanley\",\n lastName: \"Stuart\",\n age: \"21\"\n })\n ```\n\n @method setProperties\n @param self\n @param {Object} hash\n @return self\n*/\nEmber.setProperties = function(self, hash) {\n changeProperties(function() {\n for(var prop in hash) {\n if (hash.hasOwnProperty(prop)) { set(self, prop, hash[prop]); }\n }\n });\n return self;\n};\n\n})();\n//@ sourceURL=ember-metal/set_properties");minispade.register('ember-metal/utils', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/error');\n\n/**\n@module ember-metal\n*/\n\n/**\n @private\n \n Prefix used for guids through out Ember.\n \n*/\nEmber.GUID_PREFIX = 'ember';\n\n\nvar o_defineProperty = Ember.platform.defineProperty,\n o_create = Ember.create,\n // Used for guid generation...\n GUID_KEY = '__ember'+ (+ new Date()),\n uuid = 0,\n numberCache = [],\n stringCache = {};\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n/**\n @private\n\n A unique key used to assign guids and other private metadata to objects.\n If you inspect an object in your browser debugger you will often see these.\n They can be safely ignored.\n\n On browsers that support it, these properties are added with enumeration\n disabled so they won't show up when you iterate over your properties.\n\n @property GUID_KEY\n @for Ember\n @type String\n @final\n*/\nEmber.GUID_KEY = GUID_KEY;\n\nvar GUID_DESC = {\n writable: false,\n configurable: false,\n enumerable: false,\n value: null\n};\n\n/**\n @private\n\n Generates a new guid, optionally saving the guid to the object that you\n pass in. You will rarely need to use this method. Instead you should\n call `Ember.guidFor(obj)`, which return an existing guid if available.\n\n @method generateGuid\n @for Ember\n @param {Object} [obj] Object the guid will be used for. If passed in, the guid will\n be saved on the object and reused whenever you pass the same object\n again.\n\n If no object is passed, just generate a new guid.\n @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to\n separate the guid into separate namespaces.\n @return {String} the guid\n*/\nEmber.generateGuid = function generateGuid(obj, prefix) {\n if (!prefix) prefix = Ember.GUID_PREFIX;\n var ret = (prefix + (uuid++));\n if (obj) {\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n }\n return ret;\n};\n\n/**\n @private\n\n Returns a unique id for the object. If the object does not yet have a guid,\n one will be assigned to it. You can call this on any object,\n `Ember.Object`-based or not, but be aware that it will add a `_guid`\n property.\n\n You can also use this method on DOM Element objects.\n\n @method guidFor\n @for Ember\n @param {Object} obj any object, string, number, Element, or primitive\n @return {String} the unique guid for this instance.\n*/\nEmber.guidFor = function guidFor(obj) {\n\n // special cases where we don't want to add a key to object\n if (obj === undefined) return \"(undefined)\";\n if (obj === null) return \"(null)\";\n\n var ret;\n var type = typeof obj;\n\n // Don't allow prototype changes to String etc. to change the guidFor\n switch(type) {\n case 'number':\n ret = numberCache[obj];\n if (!ret) ret = numberCache[obj] = 'nu'+obj;\n return ret;\n\n case 'string':\n ret = stringCache[obj];\n if (!ret) ret = stringCache[obj] = 'st'+(uuid++);\n return ret;\n\n case 'boolean':\n return obj ? '(true)' : '(false)';\n\n default:\n if (obj[GUID_KEY]) return obj[GUID_KEY];\n if (obj === Object) return '(Object)';\n if (obj === Array) return '(Array)';\n ret = 'ember'+(uuid++);\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n return ret;\n }\n};\n\n// ..........................................................\n// META\n//\n\nvar META_DESC = {\n writable: true,\n configurable: false,\n enumerable: false,\n value: null\n};\n\nvar META_KEY = Ember.GUID_KEY+'_meta';\n\n/**\n The key used to store meta information on object for property observing.\n\n @property META_KEY\n @for Ember\n @private\n @final\n @type String\n*/\nEmber.META_KEY = META_KEY;\n\n// Placeholder for non-writable metas.\nvar EMPTY_META = {\n descs: {},\n watching: {}\n};\n\nif (MANDATORY_SETTER) { EMPTY_META.values = {}; }\n\nEmber.EMPTY_META = EMPTY_META;\n\nif (Object.freeze) Object.freeze(EMPTY_META);\n\nvar isDefinePropertySimulated = Ember.platform.defineProperty.isSimulated;\n\nfunction Meta(obj) {\n this.descs = {};\n this.watching = {};\n this.cache = {};\n this.source = obj;\n}\n\nif (isDefinePropertySimulated) {\n // on platforms that don't support enumerable false\n // make meta fail jQuery.isPlainObject() to hide from\n // jQuery.extend() by having a property that fails\n // hasOwnProperty check.\n Meta.prototype.__preventPlainObject__ = true;\n\n // Without non-enumerable properties, meta objects will be output in JSON\n // unless explicitly suppressed\n Meta.prototype.toJSON = function () { };\n}\n\n/**\n Retrieves the meta hash for an object. If `writable` is true ensures the\n hash is writable for this object as well.\n\n The meta object contains information about computed property descriptors as\n well as any watched properties and other information. You generally will\n not access this information directly but instead work with higher level\n methods that manipulate this hash indirectly.\n\n @method meta\n @for Ember\n @private\n\n @param {Object} obj The object to retrieve meta for\n @param {Boolean} [writable=true] Pass `false` if you do not intend to modify\n the meta hash, allowing the method to avoid making an unnecessary copy.\n @return {Object} the meta hash for an object\n*/\nEmber.meta = function meta(obj, writable) {\n\n var ret = obj[META_KEY];\n if (writable===false) return ret || EMPTY_META;\n\n if (!ret) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = new Meta(obj);\n\n if (MANDATORY_SETTER) { ret.values = {}; }\n\n obj[META_KEY] = ret;\n\n // make sure we don't accidentally try to create constructor like desc\n ret.descs.constructor = null;\n\n } else if (ret.source !== obj) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = o_create(ret);\n ret.descs = o_create(ret.descs);\n ret.watching = o_create(ret.watching);\n ret.cache = {};\n ret.source = obj;\n\n if (MANDATORY_SETTER) { ret.values = o_create(ret.values); }\n\n obj[META_KEY] = ret;\n }\n return ret;\n};\n\nEmber.getMeta = function getMeta(obj, property) {\n var meta = Ember.meta(obj, false);\n return meta[property];\n};\n\nEmber.setMeta = function setMeta(obj, property, value) {\n var meta = Ember.meta(obj, true);\n meta[property] = value;\n return value;\n};\n\n/**\n @deprecated\n @private\n\n In order to store defaults for a class, a prototype may need to create\n a default meta object, which will be inherited by any objects instantiated\n from the class's constructor.\n\n However, the properties of that meta object are only shallow-cloned,\n so if a property is a hash (like the event system's `listeners` hash),\n it will by default be shared across all instances of that class.\n\n This method allows extensions to deeply clone a series of nested hashes or\n other complex objects. For instance, the event system might pass\n `['listeners', 'foo:change', 'ember157']` to `prepareMetaPath`, which will\n walk down the keys provided.\n\n For each key, if the key does not exist, it is created. If it already\n exists and it was inherited from its constructor, the constructor's\n key is cloned.\n\n You can also pass false for `writable`, which will simply return\n undefined if `prepareMetaPath` discovers any part of the path that\n shared or undefined.\n\n @method metaPath\n @for Ember\n @param {Object} obj The object whose meta we are examining\n @param {Array} path An array of keys to walk down\n @param {Boolean} writable whether or not to create a new meta\n (or meta property) if one does not already exist or if it's\n shared with its constructor\n*/\nEmber.metaPath = function metaPath(obj, path, writable) {\n Ember.deprecate(\"Ember.metaPath is deprecated and will be removed from future releases.\");\n var meta = Ember.meta(obj, writable), keyName, value;\n\n for (var i=0, l=path.length; i<l; i++) {\n keyName = path[i];\n value = meta[keyName];\n\n if (!value) {\n if (!writable) { return undefined; }\n value = meta[keyName] = { __ember_source__: obj };\n } else if (value.__ember_source__ !== obj) {\n if (!writable) { return undefined; }\n value = meta[keyName] = o_create(value);\n value.__ember_source__ = obj;\n }\n\n meta = value;\n }\n\n return value;\n};\n\n/**\n @private\n\n Wraps the passed function so that `this._super` will point to the superFunc\n when the function is invoked. This is the primitive we use to implement\n calls to super.\n\n @method wrap\n @for Ember\n @param {Function} func The function to call\n @param {Function} superFunc The super function.\n @return {Function} wrapped function.\n*/\nEmber.wrap = function(func, superFunc) {\n function K() {}\n\n function superWrapper() {\n var ret, sup = this._super;\n this._super = superFunc || K;\n ret = func.apply(this, arguments);\n this._super = sup;\n return ret;\n }\n\n superWrapper.wrappedFunction = func;\n superWrapper.__ember_observes__ = func.__ember_observes__;\n superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__;\n superWrapper.__ember_listens__ = func.__ember_listens__;\n\n return superWrapper;\n};\n\n/**\n Returns true if the passed object is an array or Array-like.\n\n Ember Array Protocol:\n\n - the object has an objectAt property\n - the object is a native Array\n - the object is an Object, and has a length property\n\n Unlike `Ember.typeOf` this method returns true even if the passed object is\n not formally array but appears to be array-like (i.e. implements `Ember.Array`)\n\n ```javascript\n Ember.isArray(); // false\n Ember.isArray([]); // true\n Ember.isArray( Ember.ArrayProxy.create({ content: [] }) ); // true\n ```\n\n @method isArray\n @for Ember\n @param {Object} obj The object to test\n @return {Boolean} true if the passed object is an array or Array-like\n*/\nEmber.isArray = function(obj) {\n if (!obj || obj.setInterval) { return false; }\n if (Array.isArray && Array.isArray(obj)) { return true; }\n if (Ember.Array && Ember.Array.detect(obj)) { return true; }\n if ((obj.length !== undefined) && 'object'===typeof obj) { return true; }\n return false;\n};\n\n/**\n Forces the passed object to be part of an array. If the object is already\n an array or array-like, returns the object. Otherwise adds the object to\n an array. If obj is `null` or `undefined`, returns an empty array.\n\n ```javascript\n Ember.makeArray(); // []\n Ember.makeArray(null); // []\n Ember.makeArray(undefined); // []\n Ember.makeArray('lindsay'); // ['lindsay']\n Ember.makeArray([1,2,42]); // [1,2,42]\n\n var controller = Ember.ArrayProxy.create({ content: [] });\n Ember.makeArray(controller) === controller; // true\n ```\n\n @method makeArray\n @for Ember\n @param {Object} obj the object\n @return {Array}\n*/\nEmber.makeArray = function(obj) {\n if (obj === null || obj === undefined) { return []; }\n return Ember.isArray(obj) ? obj : [obj];\n};\n\nfunction canInvoke(obj, methodName) {\n return !!(obj && typeof obj[methodName] === 'function');\n}\n\n/**\n Checks to see if the `methodName` exists on the `obj`.\n\n ```javascript\n var foo = {bar: Ember.K, baz: null};\n Ember.canInvoke(foo, 'bar'); // true\n Ember.canInvoke(foo, 'baz'); // false\n Ember.canInvoke(foo, 'bat'); // false\n ```\n\n @method canInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @return {Boolean}\n*/\nEmber.canInvoke = canInvoke;\n\n/**\n Checks to see if the `methodName` exists on the `obj`,\n and if it does, invokes it with the arguments passed.\n\n ```javascript\n var d = new Date('03/15/2013');\n Ember.tryInvoke(d, 'getTime'); // 1363320000000\n Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000\n Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined\n ```\n\n @method tryInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @param {Array} [args] The arguments to pass to the method\n @return {*} the return value of the invoked method or undefined if it cannot be invoked\n*/\nEmber.tryInvoke = function(obj, methodName, args) {\n if (canInvoke(obj, methodName)) {\n return obj[methodName].apply(obj, args || []);\n }\n};\n\n// https://github.com/emberjs/ember.js/pull/1617\nvar needsFinallyFix = (function() {\n var count = 0;\n try{\n try { }\n finally {\n count++;\n throw new Error('needsFinallyFixTest');\n }\n } catch (e) {}\n\n return count !== 1;\n})();\n\n/**\n Provides try { } finally { } functionality, while working\n around Safari's double finally bug.\n\n ```javascript\n var tryable = function() {\n someResource.lock();\n runCallback(); // May throw error.\n };\n var finalizer = function() {\n someResource.unlock();\n };\n Ember.tryFinally(tryable, finalizer);\n ```\n\n @method tryFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} finalizer The function to run the finally callback\n @param {Object} [binding] The optional calling object. Defaults to 'this'\n @return {*} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable\n*/\n\nif (needsFinallyFix) {\n Ember.tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e) {\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n} else {\n Ember.tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n}\n\n/**\n Provides try { } catch finally { } functionality, while working\n around Safari's double finally bug.\n\n ```javascript\n var tryable = function() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n };\n\n var catchable = function(e) {\n payload = payload || {};\n payload.exception = e;\n };\n\n var finalizer = function() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n };\n Ember.tryCatchFinally(tryable, catchable, finalizer);\n ```\n\n @method tryCatchFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} catchable The function to run the catchable callback\n @param {Function} finalizer The function to run the finally callback\n @param {Object} [binding] The optional calling object. Defaults to 'this'\n @return {*} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable.\n*/\nif (needsFinallyFix) {\n Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e) {\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n} else {\n Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n}\n\n// ........................................\n// TYPING & ARRAY MESSAGING\n//\n\nvar TYPE_MAP = {};\nvar t = \"Boolean Number String Function Array Date RegExp Object\".split(\" \");\nEmber.ArrayPolyfills.forEach.call(t, function(name) {\n TYPE_MAP[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\nvar toString = Object.prototype.toString;\n\n/**\n Returns a consistent type for the passed item.\n\n Use this instead of the built-in `typeof` to get the type of an item.\n It will return the same result across all browsers and includes a bit\n more detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive |\n | 'number' | Number primitive |\n | 'boolean' | Boolean primitive |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'class' | An Ember class (created using Ember.Object.extend()) |\n | 'instance' | An Ember object instance |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object not inheriting from Ember.Object |\n\n Examples:\n\n ```javascript\n Ember.typeOf(); // 'undefined'\n Ember.typeOf(null); // 'null'\n Ember.typeOf(undefined); // 'undefined'\n Ember.typeOf('michael'); // 'string'\n Ember.typeOf(101); // 'number'\n Ember.typeOf(true); // 'boolean'\n Ember.typeOf(Ember.makeArray); // 'function'\n Ember.typeOf([1,2,90]); // 'array'\n Ember.typeOf(Ember.Object.extend()); // 'class'\n Ember.typeOf(Ember.Object.create()); // 'instance'\n Ember.typeOf(new Error('teamocil')); // 'error'\n\n // \"normal\" JavaScript object\n Ember.typeOf({a: 'b'}); // 'object'\n ```\n\n @method typeOf\n @for Ember\n @param {Object} item the item to check\n @return {String} the type\n*/\nEmber.typeOf = function(item) {\n var ret;\n\n ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object';\n\n if (ret === 'function') {\n if (Ember.Object && Ember.Object.detect(item)) ret = 'class';\n } else if (ret === 'object') {\n if (item instanceof Error) ret = 'error';\n else if (Ember.Object && item instanceof Ember.Object) ret = 'instance';\n else ret = 'object';\n }\n\n return ret;\n};\n\n})();\n//@ sourceURL=ember-metal/utils");minispade.register('ember-metal/vendor/backburner', "(function() {define(\"backburner/queue\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n function Queue(daq, name, options) {\n this.daq = daq;\n this.name = name;\n this.options = options;\n this._queue = [];\n }\n\n Queue.prototype = {\n daq: null,\n name: null,\n options: null,\n _queue: null,\n\n push: function(target, method, args, stack) {\n var queue = this._queue;\n queue.push(target, method, args, stack);\n return {queue: this, target: target, method: method};\n },\n\n pushUnique: function(target, method, args, stack) {\n var queue = this._queue, currentTarget, currentMethod, i, l;\n\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === target && currentMethod === method) {\n queue[i+2] = args; // replace args\n queue[i+3] = stack; // replace stack\n return {queue: this, target: target, method: method}; // TODO: test this code path\n }\n }\n\n this._queue.push(target, method, args, stack);\n return {queue: this, target: target, method: method};\n },\n\n // TODO: remove me, only being used for Ember.run.sync\n flush: function() {\n var queue = this._queue,\n options = this.options,\n before = options && options.before,\n after = options && options.after,\n target, method, args, stack, i, l = queue.length;\n\n if (l && before) { before(); }\n for (i = 0; i < l; i += 4) {\n target = queue[i];\n method = queue[i+1];\n args = queue[i+2];\n stack = queue[i+3]; // Debugging assistance\n\n // TODO: error handling\n if (args && args.length > 0) {\n method.apply(target, args);\n } else {\n method.call(target);\n }\n }\n if (l && after) { after(); }\n\n // check if new items have been added\n if (queue.length > l) {\n this._queue = queue.slice(l);\n this.flush();\n } else {\n this._queue.length = 0;\n }\n },\n\n cancel: function(actionToCancel) {\n var queue = this._queue, currentTarget, currentMethod, i, l;\n\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === actionToCancel.target && currentMethod === actionToCancel.method) {\n queue.splice(i, 4);\n return true;\n }\n }\n\n // if not found in current queue\n // could be in the queue that is being flushed\n queue = this._queueBeingFlushed;\n if (!queue) {\n return;\n }\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === actionToCancel.target && currentMethod === actionToCancel.method) {\n // don't mess with array during flush\n // just nullify the method\n queue[i+1] = null;\n return true;\n }\n }\n }\n };\n\n\n __exports__.Queue = Queue;\n });\n\ndefine(\"backburner/deferred_action_queues\",\n [\"backburner/queue\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Queue = __dependency1__.Queue;\n\n function DeferredActionQueues(queueNames, options) {\n var queues = this.queues = {};\n this.queueNames = queueNames = queueNames || [];\n\n var queueName;\n for (var i = 0, l = queueNames.length; i < l; i++) {\n queueName = queueNames[i];\n queues[queueName] = new Queue(this, queueName, options[queueName]);\n }\n }\n\n DeferredActionQueues.prototype = {\n queueNames: null,\n queues: null,\n\n schedule: function(queueName, target, method, args, onceFlag, stack) {\n var queues = this.queues,\n queue = queues[queueName];\n\n if (!queue) { throw new Error(\"You attempted to schedule an action in a queue (\" + queueName + \") that doesn't exist\"); }\n\n if (onceFlag) {\n return queue.pushUnique(target, method, args, stack);\n } else {\n return queue.push(target, method, args, stack);\n }\n },\n\n flush: function() {\n var queues = this.queues,\n queueNames = this.queueNames,\n queueName, queue, queueItems, priorQueueNameIndex,\n queueNameIndex = 0, numberOfQueues = queueNames.length;\n\n outerloop:\n while (queueNameIndex < numberOfQueues) {\n queueName = queueNames[queueNameIndex];\n queue = queues[queueName];\n queueItems = queue._queueBeingFlushed = queue._queue.slice();\n queue._queue = [];\n\n var options = queue.options,\n before = options && options.before,\n after = options && options.after,\n target, method, args, stack,\n queueIndex = 0, numberOfQueueItems = queueItems.length;\n\n if (numberOfQueueItems && before) { before(); }\n while (queueIndex < numberOfQueueItems) {\n target = queueItems[queueIndex];\n method = queueItems[queueIndex+1];\n args = queueItems[queueIndex+2];\n stack = queueItems[queueIndex+3]; // Debugging assistance\n\n if (typeof method === 'string') { method = target[method]; }\n\n // method could have been nullified / canceled during flush\n if (method) {\n // TODO: error handling\n if (args && args.length > 0) {\n method.apply(target, args);\n } else {\n method.call(target);\n }\n }\n\n queueIndex += 4;\n }\n queue._queueBeingFlushed = null;\n if (numberOfQueueItems && after) { after(); }\n\n if ((priorQueueNameIndex = indexOfPriorQueueWithActions(this, queueNameIndex)) !== -1) {\n queueNameIndex = priorQueueNameIndex;\n continue outerloop;\n }\n\n queueNameIndex++;\n }\n }\n };\n\n function indexOfPriorQueueWithActions(daq, currentQueueIndex) {\n var queueName, queue;\n\n for (var i = 0, l = currentQueueIndex; i <= l; i++) {\n queueName = daq.queueNames[i];\n queue = daq.queues[queueName];\n if (queue._queue.length) { return i; }\n }\n\n return -1;\n }\n\n\n __exports__.DeferredActionQueues = DeferredActionQueues;\n });\n\ndefine(\"backburner\",\n [\"backburner/deferred_action_queues\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var DeferredActionQueues = __dependency1__.DeferredActionQueues;\n\n var slice = [].slice,\n pop = [].pop,\n throttlers = [],\n debouncees = [],\n timers = [],\n autorun, laterTimer, laterTimerExpiresAt,\n global = this,\n NUMBER = /\\d+/;\n\n function isCoercableNumber(number) {\n return typeof number === 'number' || NUMBER.test(number);\n }\n\n function Backburner(queueNames, options) {\n this.queueNames = queueNames;\n this.options = options || {};\n if (!this.options.defaultQueue) {\n this.options.defaultQueue = queueNames[0];\n }\n this.instanceStack = [];\n }\n\n Backburner.prototype = {\n queueNames: null,\n options: null,\n currentInstance: null,\n instanceStack: null,\n\n begin: function() {\n var onBegin = this.options && this.options.onBegin,\n previousInstance = this.currentInstance;\n\n if (previousInstance) {\n this.instanceStack.push(previousInstance);\n }\n\n this.currentInstance = new DeferredActionQueues(this.queueNames, this.options);\n if (onBegin) {\n onBegin(this.currentInstance, previousInstance);\n }\n },\n\n end: function() {\n var onEnd = this.options && this.options.onEnd,\n currentInstance = this.currentInstance,\n nextInstance = null;\n\n try {\n currentInstance.flush();\n } finally {\n this.currentInstance = null;\n\n if (this.instanceStack.length) {\n nextInstance = this.instanceStack.pop();\n this.currentInstance = nextInstance;\n }\n\n if (onEnd) {\n onEnd(currentInstance, nextInstance);\n }\n }\n },\n\n run: function(target, method /*, args */) {\n var ret;\n this.begin();\n\n if (!method) {\n method = target;\n target = null;\n }\n\n if (typeof method === 'string') {\n method = target[method];\n }\n\n // Prevent Safari double-finally.\n var finallyAlreadyCalled = false;\n try {\n if (arguments.length > 2) {\n ret = method.apply(target, slice.call(arguments, 2));\n } else {\n ret = method.call(target);\n }\n } finally {\n if (!finallyAlreadyCalled) {\n finallyAlreadyCalled = true;\n this.end();\n }\n }\n return ret;\n },\n\n defer: function(queueName, target, method /* , args */) {\n if (!method) {\n method = target;\n target = null;\n }\n\n if (typeof method === 'string') {\n method = target[method];\n }\n\n var stack = this.DEBUG ? new Error().stack : undefined,\n args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;\n if (!this.currentInstance) { createAutorun(this); }\n return this.currentInstance.schedule(queueName, target, method, args, false, stack);\n },\n\n deferOnce: function(queueName, target, method /* , args */) {\n if (!method) {\n method = target;\n target = null;\n }\n\n if (typeof method === 'string') {\n method = target[method];\n }\n\n var stack = this.DEBUG ? new Error().stack : undefined,\n args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;\n if (!this.currentInstance) { createAutorun(this); }\n return this.currentInstance.schedule(queueName, target, method, args, true, stack);\n },\n\n setTimeout: function() {\n var args = slice.call(arguments);\n var length = args.length;\n var method, wait, target;\n var self = this;\n var methodOrTarget, methodOrWait, methodOrArgs;\n\n if (length === 0) {\n return;\n } else if (length === 1) {\n method = args.shift();\n wait = 0;\n } else if (length === 2) {\n methodOrTarget = args[0];\n methodOrWait = args[1];\n\n if (typeof methodOrWait === 'function' || typeof methodOrTarget[methodOrWait] === 'function') {\n target = args.shift();\n method = args.shift();\n wait = 0;\n } else if (isCoercableNumber(methodOrWait)) {\n method = args.shift();\n wait = args.shift();\n } else {\n method = args.shift();\n wait = 0;\n }\n } else {\n var last = args[args.length - 1];\n\n if (isCoercableNumber(last)) {\n wait = args.pop();\n }\n\n methodOrTarget = args[0];\n methodOrArgs = args[1];\n\n if (typeof methodOrArgs === 'function' || (typeof methodOrArgs === 'string' &&\n methodOrTarget !== null &&\n methodOrArgs in methodOrTarget)) {\n target = args.shift();\n method = args.shift();\n } else {\n method = args.shift();\n }\n }\n\n var executeAt = (+new Date()) + parseInt(wait, 10);\n\n if (typeof method === 'string') {\n method = target[method];\n }\n\n function fn() {\n method.apply(target, args);\n }\n\n // find position to insert - TODO: binary search\n var i, l;\n for (i = 0, l = timers.length; i < l; i += 2) {\n if (executeAt < timers[i]) { break; }\n }\n\n timers.splice(i, 0, executeAt, fn);\n\n if (laterTimer && laterTimerExpiresAt < executeAt) { return fn; }\n\n if (laterTimer) {\n clearTimeout(laterTimer);\n laterTimer = null;\n }\n laterTimer = global.setTimeout(function() {\n executeTimers(self);\n laterTimer = null;\n laterTimerExpiresAt = null;\n }, wait);\n laterTimerExpiresAt = executeAt;\n\n return fn;\n },\n\n throttle: function(target, method /* , args, wait */) {\n var self = this,\n args = arguments,\n wait = parseInt(pop.call(args), 10),\n throttler;\n\n for (var i = 0, l = throttlers.length; i < l; i++) {\n throttler = throttlers[i];\n if (throttler[0] === target && throttler[1] === method) { return; } // do nothing\n }\n\n var timer = global.setTimeout(function() {\n self.run.apply(self, args);\n\n // remove throttler\n var index = -1;\n for (var i = 0, l = throttlers.length; i < l; i++) {\n throttler = throttlers[i];\n if (throttler[0] === target && throttler[1] === method) {\n index = i;\n break;\n }\n }\n\n if (index > -1) { throttlers.splice(index, 1); }\n }, wait);\n\n throttlers.push([target, method, timer]);\n },\n\n debounce: function(target, method /* , args, wait, [immediate] */) {\n var self = this,\n args = arguments,\n immediate = pop.call(args),\n wait,\n index,\n debouncee;\n\n if (typeof immediate === \"number\" || typeof immediate === \"string\") {\n wait = immediate;\n immediate = false;\n } else {\n wait = pop.call(args);\n }\n\n wait = parseInt(wait, 10);\n // Remove debouncee\n index = findDebouncee(target, method);\n\n if (index !== -1) {\n debouncee = debouncees[index];\n debouncees.splice(index, 1);\n clearTimeout(debouncee[2]);\n }\n\n var timer = global.setTimeout(function() {\n if (!immediate) {\n self.run.apply(self, args);\n }\n index = findDebouncee(target, method);\n if (index) {\n debouncees.splice(index, 1);\n }\n }, wait);\n\n if (immediate && index === -1) {\n self.run.apply(self, args);\n }\n\n debouncees.push([target, method, timer]);\n },\n\n cancelTimers: function() {\n var i, len;\n\n for (i = 0, len = throttlers.length; i < len; i++) {\n clearTimeout(throttlers[i][2]);\n }\n throttlers = [];\n\n for (i = 0, len = debouncees.length; i < len; i++) {\n clearTimeout(debouncees[i][2]);\n }\n debouncees = [];\n\n if (laterTimer) {\n clearTimeout(laterTimer);\n laterTimer = null;\n }\n timers = [];\n\n if (autorun) {\n clearTimeout(autorun);\n autorun = null;\n }\n },\n\n hasTimers: function() {\n return !!timers.length || autorun;\n },\n\n cancel: function(timer) {\n if (timer && typeof timer === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce\n return timer.queue.cancel(timer);\n } else if (typeof timer === 'function') { // we're cancelling a setTimeout\n for (var i = 0, l = timers.length; i < l; i += 2) {\n if (timers[i + 1] === timer) {\n timers.splice(i, 2); // remove the two elements\n return true;\n }\n }\n } else {\n return; // timer was null or not a timer\n }\n }\n };\n\n Backburner.prototype.schedule = Backburner.prototype.defer;\n Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce;\n Backburner.prototype.later = Backburner.prototype.setTimeout;\n\n function createAutorun(backburner) {\n backburner.begin();\n autorun = global.setTimeout(function() {\n autorun = null;\n backburner.end();\n });\n }\n\n function executeTimers(self) {\n var now = +new Date(),\n time, fns, i, l;\n\n self.run(function() {\n // TODO: binary search\n for (i = 0, l = timers.length; i < l; i += 2) {\n time = timers[i];\n if (time > now) { break; }\n }\n\n fns = timers.splice(0, i);\n\n for (i = 1, l = fns.length; i < l; i += 2) {\n self.schedule(self.options.defaultQueue, null, fns[i]);\n }\n });\n\n if (timers.length) {\n laterTimer = global.setTimeout(function() {\n executeTimers(self);\n laterTimer = null;\n laterTimerExpiresAt = null;\n }, timers[0] - now);\n laterTimerExpiresAt = timers[0];\n }\n }\n\n function findDebouncee(target, method) {\n var debouncee,\n index = -1;\n\n for (var i = 0, l = debouncees.length; i < l; i++) {\n debouncee = debouncees[i];\n if (debouncee[0] === target && debouncee[1] === method) {\n index = i;\n break;\n }\n }\n\n return index;\n }\n\n\n __exports__.Backburner = Backburner;\n });\n\n})();\n//@ sourceURL=ember-metal/vendor/backburner");minispade.register('ember-metal/watch_key', "(function() {minispade.require('ember-metal/utils');\nminispade.require('ember-metal/platform');\n\nvar metaFor = Ember.meta, // utils.js\n typeOf = Ember.typeOf, // utils.js\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n o_defineProperty = Ember.platform.defineProperty;\n\nEmber.watchKey = function(obj, keyName) {\n // can't watch length on Array - it is special...\n if (keyName === 'length' && typeOf(obj) === 'array') { return; }\n\n var m = metaFor(obj), watching = m.watching;\n\n // activate watching first time\n if (!watching[keyName]) {\n watching[keyName] = 1;\n\n if ('function' === typeof obj.willWatchProperty) {\n obj.willWatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n m.values[keyName] = obj[keyName];\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: Ember.MANDATORY_SETTER_FUNCTION,\n get: Ember.DEFAULT_GETTER_FUNCTION(keyName)\n });\n }\n } else {\n watching[keyName] = (watching[keyName] || 0) + 1;\n }\n};\n\n\nEmber.unwatchKey = function(obj, keyName) {\n var m = metaFor(obj), watching = m.watching;\n\n if (watching[keyName] === 1) {\n watching[keyName] = 0;\n\n if ('function' === typeof obj.didUnwatchProperty) {\n obj.didUnwatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: m.values[keyName]\n });\n delete m.values[keyName];\n }\n } else if (watching[keyName] > 1) {\n watching[keyName]--;\n }\n};\n\n})();\n//@ sourceURL=ember-metal/watch_key");minispade.register('ember-metal/watch_path', "(function() {minispade.require('ember-metal/utils');\nminispade.require('ember-metal/chains');\n\nvar metaFor = Ember.meta, // utils.js\n typeOf = Ember.typeOf, // utils.js\n ChainNode = Ember._ChainNode; // chains.js\n\n// get the chains for the current object. If the current object has\n// chains inherited from the proto they will be cloned and reconfigured for\n// the current object.\nfunction chainsFor(obj) {\n var m = metaFor(obj), ret = m.chains;\n if (!ret) {\n ret = m.chains = new ChainNode(null, null, obj);\n } else if (ret.value() !== obj) {\n ret = m.chains = ret.copy(obj);\n }\n return ret;\n}\n\nEmber.watchPath = function(obj, keyPath) {\n // can't watch length on Array - it is special...\n if (keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n var m = metaFor(obj), watching = m.watching;\n\n if (!watching[keyPath]) { // activate watching first time\n watching[keyPath] = 1;\n chainsFor(obj).add(keyPath);\n } else {\n watching[keyPath] = (watching[keyPath] || 0) + 1;\n }\n};\n\nEmber.unwatchPath = function(obj, keyPath) {\n var m = metaFor(obj), watching = m.watching;\n\n if (watching[keyPath] === 1) {\n watching[keyPath] = 0;\n chainsFor(obj).remove(keyPath);\n } else if (watching[keyPath] > 1) {\n watching[keyPath]--;\n }\n};\n})();\n//@ sourceURL=ember-metal/watch_path");minispade.register('ember-metal/watching', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/expand_properties');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/watch_key');\nminispade.require('ember-metal/watch_path');\n\n/**\n@module ember-metal\n*/\n\nvar metaFor = Ember.meta, // utils.js\n GUID_KEY = Ember.GUID_KEY, // utils.js\n META_KEY = Ember.META_KEY, // utils.js\n removeChainWatcher = Ember.removeChainWatcher,\n watchKey = Ember.watchKey, // watch_key.js\n unwatchKey = Ember.unwatchKey,\n watchPath = Ember.watchPath, // watch_path.js\n unwatchPath = Ember.unwatchPath,\n typeOf = Ember.typeOf, // utils.js\n generateGuid = Ember.generateGuid,\n IS_PATH = /[\\.\\*]/;\n\nif (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n var expandProperties = Ember.expandProperties;\n}\n\n// returns true if the passed path is just a keyName\nfunction isKeyName(path) {\n return path==='*' || !IS_PATH.test(path);\n}\n\n/**\n @private\n\n Starts watching a property on an object. Whenever the property changes,\n invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the\n primitive used by observers and dependent keys; usually you will never call\n this method directly but instead use higher level methods like\n `Ember.addObserver()`\n\n @method watch\n @for Ember\n @param obj\n @param {String} keyName\n*/\nEmber.watch = function(obj, _keyPath) {\n // can't watch length on Array - it is special...\n if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_keyPath, function (keyPath) {\n if (isKeyName(keyPath)) {\n watchKey(obj, keyPath);\n } else {\n watchPath(obj, keyPath);\n }\n });\n } else {\n if (isKeyName(_keyPath)) {\n watchKey(obj, _keyPath);\n } else {\n watchPath(obj, _keyPath);\n }\n }\n};\n\nEmber.isWatching = function isWatching(obj, key) {\n var meta = obj[META_KEY];\n return (meta && meta.watching[key]) > 0;\n};\n\nEmber.watch.flushPending = Ember.flushPendingChains;\n\nEmber.unwatch = function(obj, _keyPath) {\n // can't watch length on Array - it is special...\n if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_keyPath, function (keyPath) {\n if (isKeyName(keyPath)) {\n unwatchKey(obj, keyPath);\n } else {\n unwatchPath(obj, keyPath);\n }\n });\n } else {\n if (isKeyName(_keyPath)) {\n unwatchKey(obj, _keyPath);\n } else {\n unwatchPath(obj, _keyPath);\n }\n }\n};\n\n/**\n @private\n\n Call on an object when you first beget it from another object. This will\n setup any chained watchers on the object instance as needed. This method is\n safe to call multiple times.\n\n @method rewatch\n @for Ember\n @param obj\n*/\nEmber.rewatch = function(obj) {\n var m = metaFor(obj, false), chains = m.chains;\n\n // make sure the object has its own guid.\n if (GUID_KEY in obj && !obj.hasOwnProperty(GUID_KEY)) {\n generateGuid(obj);\n }\n\n // make sure any chained watchers update.\n if (chains && chains.value() !== obj) {\n m.chains = chains.copy(obj);\n }\n};\n\nvar NODE_STACK = [];\n\n/**\n Tears down the meta on an object so that it can be garbage collected.\n Multiple calls will have no effect.\n\n @method destroy\n @for Ember\n @param {Object} obj the object to destroy\n @return {void}\n*/\nEmber.destroy = function (obj) {\n var meta = obj[META_KEY], node, nodes, key, nodeObject;\n if (meta) {\n obj[META_KEY] = null;\n // remove chainWatchers to remove circular references that would prevent GC\n node = meta.chains;\n if (node) {\n NODE_STACK.push(node);\n // process tree\n while (NODE_STACK.length > 0) {\n node = NODE_STACK.pop();\n // push children\n nodes = node._chains;\n if (nodes) {\n for (key in nodes) {\n if (nodes.hasOwnProperty(key)) {\n NODE_STACK.push(nodes[key]);\n }\n }\n }\n // remove chainWatcher in node object\n if (node._watching) {\n nodeObject = node._object;\n if (nodeObject) {\n removeChainWatcher(nodeObject, node._key, node);\n }\n }\n }\n }\n }\n};\n\n})();\n//@ sourceURL=ember-metal/watching");minispade.register('ember-routing/ext', "(function() {minispade.require('ember-routing/ext/controller');\nminispade.require('ember-routing/ext/view');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\n// Add a new named queue after the 'actions' queue (where RSVP promises\n// resolve), which is used in router transitions to prevent unnecessary\n// loading state entry if all context promises resolve on the \n// 'actions' queue first.\n\nvar queues = Ember.run.queues,\n indexOf = Ember.ArrayPolyfills.indexOf;\nqueues.splice(indexOf.call(queues, 'actions') + 1, 0, 'routerTransitions');\n\n})();\n//@ sourceURL=ember-routing/ext");minispade.register('ember-routing/ext/controller', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.ControllerMixin.reopen({\n /**\n Transition the application into another route. The route may\n be either a single route or route path:\n\n ```javascript\n aController.transitionToRoute('blogPosts');\n aController.transitionToRoute('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n aController.transitionToRoute('blogPost', aPost);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n \n aController.transitionToRoute('blogComment', aPost, aComment);\n ```\n\n See also 'replaceRoute'.\n\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n @for Ember.ControllerMixin\n @method transitionToRoute\n */\n transitionToRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.transitionToRoute || target.transitionTo;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method transitionTo\n */\n transitionTo: function() {\n Ember.deprecate(\"transitionTo is deprecated. Please use transitionToRoute.\");\n return this.transitionToRoute.apply(this, arguments);\n },\n\n /**\n Transition into another route while replacing the current URL, if possible.\n This will replace the current history entry instead of adding a new one. \n Beside that, it is identical to `transitionToRoute` in all other respects.\n\n ```javascript\n aController.replaceRoute('blogPosts');\n aController.replaceRoute('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n aController.replaceRoute('blogPost', aPost);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n \n aController.replaceRoute('blogComment', aPost, aComment);\n ```\n\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n @for Ember.ControllerMixin\n @method replaceRoute\n */\n replaceRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.replaceRoute || target.replaceWith;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method replaceWith\n */\n replaceWith: function() {\n Ember.deprecate(\"replaceWith is deprecated. Please use replaceRoute.\");\n return this.replaceRoute.apply(this, arguments);\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/controller");minispade.register('ember-routing/ext/view', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.View.reopen({\n\n /**\n Sets the private `_outlets` object on the view.\n\n @method init\n */\n init: function() {\n set(this, '_outlets', {});\n this._super();\n },\n\n /**\n Manually fill any of a view's `{{outlet}}` areas with the\n supplied view.\n\n Example\n\n ```javascript\n var MyView = Ember.View.extend({\n template: Ember.Handlebars.compile('Child view: {{outlet \"main\"}} ')\n });\n var myView = MyView.create();\n myView.appendTo('body');\n // The html for myView now looks like:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n\n myView.connectOutlet('main', Ember.View.extend({\n template: Ember.Handlebars.compile('<h1>Foo</h1> ')\n }));\n // The html for myView now looks like:\n // <div id=\"ember228\" class=\"ember-view\">Child view:\n // <div id=\"ember234\" class=\"ember-view\"><h1>Foo</h1> </div>\n // </div>\n ```\n @method connectOutlet\n @param {String} outletName A unique name for the outlet\n @param {Object} view An Ember.View\n */\n connectOutlet: function(outletName, view) {\n if (this._pendingDisconnections) {\n delete this._pendingDisconnections[outletName];\n }\n\n if (this._hasEquivalentView(outletName, view)) {\n view.destroy();\n return;\n }\n\n var outlets = get(this, '_outlets'),\n container = get(this, 'container'),\n router = container && container.lookup('router:main'),\n renderedName = get(view, 'renderedName');\n\n set(outlets, outletName, view);\n\n if (router && renderedName) {\n router._connectActiveView(renderedName, view);\n }\n },\n\n /**\n @private\n\n Determines if the view has already been created by checking if\n the view has the same constructor, template, and context as the\n view in the `_outlets` object.\n\n @method _hasEquivalentView\n @param {String} outletName The name of the outlet we are checking\n @param {Object} view An Ember.View\n @return {Boolean}\n */\n _hasEquivalentView: function(outletName, view) {\n var existingView = get(this, '_outlets.'+outletName);\n return existingView &&\n existingView.constructor === view.constructor &&\n existingView.get('template') === view.get('template') &&\n existingView.get('context') === view.get('context');\n },\n\n /**\n Removes an outlet from the view.\n\n Example\n\n ```javascript\n var MyView = Ember.View.extend({\n template: Ember.Handlebars.compile('Child view: {{outlet \"main\"}} ')\n });\n var myView = MyView.create();\n myView.appendTo('body');\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n\n myView.connectOutlet('main', Ember.View.extend({\n template: Ember.Handlebars.compile('<h1>Foo</h1> ')\n }));\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view:\n // <div id=\"ember234\" class=\"ember-view\"><h1>Foo</h1> </div>\n // </div>\n\n myView.disconnectOutlet('main');\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n ```\n\n @method disconnectOutlet\n @param {String} outletName The name of the outlet to be removed\n */\n disconnectOutlet: function(outletName) {\n if (!this._pendingDisconnections) {\n this._pendingDisconnections = {};\n }\n this._pendingDisconnections[outletName] = true;\n Ember.run.once(this, '_finishDisconnections');\n },\n\n /**\n @private\n\n Gets an outlet that is pending disconnection and then\n nullifys the object on the `_outlet` object.\n\n @method _finishDisconnections\n */\n _finishDisconnections: function() {\n var outlets = get(this, '_outlets');\n var pendingDisconnections = this._pendingDisconnections;\n this._pendingDisconnections = null;\n\n for (var outletName in pendingDisconnections) {\n set(outlets, outletName, null);\n }\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/view");minispade.register('ember-routing/helpers', "(function() {minispade.require('ember-routing/helpers/shared');\nminispade.require('ember-routing/helpers/link_to');\nminispade.require('ember-routing/helpers/outlet');\nminispade.require('ember-routing/helpers/render');\nminispade.require('ember-routing/helpers/action');\nminispade.require('ember-routing/helpers/control');\n\n})();\n//@ sourceURL=ember-routing/helpers");minispade.register('ember-routing/helpers/action', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\nminispade.require('ember-handlebars/ext');\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n var EmberHandlebars = Ember.Handlebars,\n handlebarsGet = EmberHandlebars.get,\n SafeString = EmberHandlebars.SafeString,\n forEach = Ember.ArrayPolyfills.forEach,\n get = Ember.get,\n a_slice = Array.prototype.slice;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return ret.concat(resolveParams(options.context, options.params, { types: types, data: data }));\n }\n\n var ActionHelper = EmberHandlebars.ActionHelper = {\n registeredActions: {}\n };\n\n var keys = [\"alt\", \"shift\", \"meta\", \"ctrl\"];\n\n var isAllowedClick = function(event, allowedKeys) {\n if (typeof allowedKeys === \"undefined\") {\n return isSimpleClick(event);\n }\n\n if (allowedKeys.indexOf(\"any\") >= 0) {\n return true;\n }\n\n var allowed = true;\n\n forEach.call(keys, function(key) {\n if (event[key + \"Key\"] && allowedKeys.indexOf(key) === -1) {\n allowed = false;\n }\n });\n\n return allowed;\n };\n\n ActionHelper.registerAction = function(actionName, options, allowedKeys) {\n var actionId = (++Ember.uuid).toString();\n\n ActionHelper.registeredActions[actionId] = {\n eventName: options.eventName,\n handler: function(event) {\n if (!isAllowedClick(event, allowedKeys)) { return true; }\n\n event.preventDefault();\n\n if (options.bubbles === false) {\n event.stopPropagation();\n }\n\n var target = options.target;\n\n if (target.target) {\n target = handlebarsGet(target.root, target.target, target.options);\n } else {\n target = target.root;\n }\n\n Ember.run(function() {\n if (target.send) {\n target.send.apply(target, args(options.parameters, actionName));\n } else {\n Ember.assert(\"The action '\" + actionName + \"' did not exist on \" + target, typeof target[actionName] === 'function');\n target[actionName].apply(target, args(options.parameters));\n }\n });\n }\n };\n\n options.view.on('willClearRender', function() {\n delete ActionHelper.registeredActions[actionId];\n });\n\n return actionId;\n };\n\n /**\n The `{{action}}` helper registers an HTML element within a template for DOM\n event handling and forwards that interaction to the templates's controller\n or supplied `target` option (see 'Specifying a Target').\n\n If the controller does not implement the event, the event is sent\n to the current route, and it bubbles up the route hierarchy from there.\n\n User interaction with that element will invoke the supplied action name on\n the appropriate target.\n\n Given the following application Handlebars template on the page\n\n ```handlebars\n <div {{action 'anActionName'}}>\n click me\n </div>\n ```\n\n And application code\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n anActionName: function() {\n \n } \n }\n });\n ```\n\n Will result in the following rendered HTML\n\n ```html\n <div class=\"ember-view\">\n <div data-ember-action=\"1\">\n click me\n </div>\n </div>\n ```\n\n Clicking \"click me\" will trigger the `anActionName` action of the\n `App.ApplicationController`. In this case, no additional parameters will be passed.\n\n If you provide additional parameters to the helper:\n\n ```handlebars\n <button {{action 'edit' post}}>Edit</button>\n ```\n\n Those parameters will be passed along as arguments to the JavaScript\n function implementing the action.\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers.\n\n To also disable bubbling, pass `bubbles=false` to the helper:\n\n ```handlebars\n <button {{action 'edit' post bubbles=false}}>Edit</button>\n ```\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See [Ember.View](/api/classes/Ember.View.html)\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n <div {{action \"anActionName\" on=\"doubleClick\"}}>\n click me\n </div>\n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n NOTE: Because `{{action}}` depends on Ember's event dispatch system it will\n only function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new `Ember.Application`\n is created. Having an instance of `Ember.Application` will satisfy this\n requirement.\n\n ### Specifying whitelisted modifier keys\n\n By default the `{{action}}` helper will ignore click event with pressed modifier\n keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.\n\n ```handlebars\n <div {{action \"anActionName\" allowedKeys=\"alt\"}}>\n click me\n </div>\n ```\n\n This way the `{{action}}` will fire when clicking with the alt key pressed down.\n\n Alternatively, supply \"any\" to the `allowedKeys` option to accept any combination of modifier keys.\n\n ```handlebars\n <div {{action \"anActionName\" allowedKeys=\"any\"}}>\n click me with any key pressed\n </div>\n ```\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical Ember application, where views are managed through use of the\n `{{outlet}}` helper, actions will bubble to the current controller, then\n to the current route, and then up the route hierarchy.\n\n Alternatively, a `target` option can be provided to the helper to change\n which object will receive the method call. This option must be a path\n to an object, accessible in the current context:\n\n ```handlebars\n {{! the application template }}\n <div {{action \"anActionName\" target=view}}>\n click me\n </div>\n ```\n\n ```javascript\n App.ApplicationView = Ember.View.extend({\n actions: {\n anActionName: function(){}\n }\n });\n\n ```\n\n ### Additional Parameters\n\n You may specify additional parameters to the `{{action}}` helper. These\n parameters are passed along as the arguments to the JavaScript function\n implementing the action.\n\n ```handlebars\n {{#each person in people}}\n <div {{action \"edit\" person}}>\n click me\n </div>\n {{/each}}\n ```\n\n Clicking \"click me\" will trigger the `edit` method on the current controller\n with the value of `person` as a parameter.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object} [context]*\n @param {Hash} options\n */\n EmberHandlebars.registerHelper('action', function(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n controller;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\"\n };\n\n action.parameters = {\n context: this,\n options: options,\n params: contexts\n };\n\n action.view = options.data.view;\n\n var root, target;\n\n if (hash.target) {\n root = this;\n target = hash.target;\n } else if (controller = options.data.keywords.controller) {\n root = controller;\n }\n\n action.target = { root: root, target: target, options: options };\n action.bubbles = hash.bubbles;\n\n var actionId = ActionHelper.registerAction(actionName, action, hash.allowedKeys);\n return new SafeString('data-ember-action=\"' + actionId + '\"');\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/action");minispade.register('ember-routing/helpers/control', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nif (Ember.ENV.EXPERIMENTAL_CONTROL_HELPER) {\n var get = Ember.get, set = Ember.set;\n\n /**\n `{{control}}` works like render, except it uses a new controller instance for every call, instead of reusing the singleton controller.\n\n The control helper is currently under development and is considered experimental.\n To enable it, set `ENV.EXPERIMENTAL_CONTROL_HELPER = true` before requiring Ember.\n\n For example if you had this `author` template.\n\n ```handlebars\n<div class=\"author\">\n Written by {{firstName}} {{lastName}}.\n Total Posts: {{postCount}}\n</div>\n ```\n\n You could render it inside the `post` template using the `control` helper.\n\n ```handlebars\n<div class=\"post\">\n <h1>{{title}}</h1>\n <div>{{body}}</div>\n {{control \"author\" author}}\n</div>\n ```\n\n @method control\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {String} modelPath\n @param {Hash} options\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('control', function(path, modelPath, options) {\n if (arguments.length === 2) {\n options = modelPath;\n modelPath = undefined;\n }\n\n var model;\n\n if (modelPath) {\n model = Ember.Handlebars.get(this, modelPath, options);\n }\n\n var controller = options.data.keywords.controller,\n view = options.data.keywords.view,\n children = get(controller, '_childContainers'),\n controlID = options.hash.controlID,\n container, subContainer;\n\n if (children.hasOwnProperty(controlID)) {\n subContainer = children[controlID];\n } else {\n container = get(controller, 'container'),\n subContainer = container.child();\n children[controlID] = subContainer;\n }\n\n var normalizedPath = path.replace(/\\//g, '.');\n\n var childView = subContainer.lookup('view:' + normalizedPath) || subContainer.lookup('view:default'),\n childController = subContainer.lookup('controller:' + normalizedPath),\n childTemplate = subContainer.lookup('template:' + path);\n\n Ember.assert(\"Could not find controller for path: \" + normalizedPath, childController);\n Ember.assert(\"Could not find view for path: \" + normalizedPath, childView);\n\n set(childController, 'target', controller);\n set(childController, 'model', model);\n\n options.hash.template = childTemplate;\n options.hash.controller = childController;\n\n function observer() {\n var model = Ember.Handlebars.get(this, modelPath, options);\n set(childController, 'model', model);\n childView.rerender();\n }\n\n if (modelPath) {\n Ember.addObserver(this, modelPath, observer);\n childView.one('willDestroyElement', this, function() {\n Ember.removeObserver(this, modelPath, observer);\n });\n }\n\n Ember.Handlebars.helpers.view.call(this, childView, options);\n });\n}\n\n})();\n//@ sourceURL=ember-routing/helpers/control");minispade.register('ember-routing/helpers/link_to', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n resolvePaths = Ember.Router.resolvePaths,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n function fullRouteName(router, name) {\n if (!router.hasRoute(name)) {\n name = name + '.index';\n }\n\n return name;\n }\n\n function getResolvedPaths(options) {\n\n var types = options.options.types,\n data = options.options.data;\n\n return resolvePaths(options.context, options.params, { types: types, data: data });\n }\n\n /**\n `Ember.LinkView` renders an element whose `click` event triggers a\n transition of the application's instance of `Ember.Router` to\n a supplied route by name.\n\n Instances of `LinkView` will most likely be created through\n the `link-to` Handlebars helper, but properties of this class\n can be overridden to customize application-wide behavior.\n\n @class LinkView\n @namespace Ember\n @extends Ember.View\n @see {Handlebars.helpers.link-to}\n **/\n var LinkView = Ember.LinkView = Ember.View.extend({\n tagName: 'a',\n currentWhen: null,\n\n /**\n Sets the `title` attribute of the `LinkView`'s HTML element.\n\n @property title\n @default null\n **/\n title: null,\n\n /**\n Sets the `rel` attribute of the `LinkView`'s HTML element.\n\n @property rel\n @default null\n **/\n rel: null,\n\n /**\n The CSS class to apply to `LinkView`'s element when its `active`\n property is `true`.\n\n @property activeClass\n @type String\n @default active\n **/\n activeClass: 'active',\n\n /**\n The CSS class to apply to `LinkView`'s element when its `loading`\n property is `true`.\n\n @property loadingClass\n @type String\n @default loading\n **/\n loadingClass: 'loading',\n\n /**\n The CSS class to apply to a `LinkView`'s element when its `disabled`\n property is `true`.\n\n @property disabledClass\n @type String\n @default disabled\n **/\n disabledClass: 'disabled',\n _isDisabled: false,\n\n /**\n Determines whether the `LinkView` will trigger routing via\n the `replaceWith` routing strategy.\n\n @property replace\n @type Boolean\n @default false\n **/\n replace: false,\n\n /**\n By default the `{{link-to}}` helper will bind to the `href` and\n `title` attributes. It's discourage that you override these defaults,\n however you can push onto the array if needed.\n\n @property attributeBindings\n @type Array | String\n @default ['href', 'title', 'rel']\n **/\n attributeBindings: ['href', 'title', 'rel'],\n\n /**\n By default the `{{link-to}}` helper will bind to the `active`, `loading`, and\n `disabled` classes. It is discouraged to override these directly.\n\n @property classNameBindings\n @type Array\n @default ['active', 'loading', 'disabled']\n **/\n classNameBindings: ['active', 'loading', 'disabled'],\n\n /**\n By default the `{{link-to}}` helper responds to the `click` event. You\n can override this globally by setting this property to your custom\n event name.\n\n This is particularly useful on mobile when one wants to avoid the 300ms\n click delay using some sort of custom `tap` event.\n\n @property eventName\n @type String\n @default click\n */\n eventName: 'click',\n\n // this is doc'ed here so it shows up in the events\n // section of the API documentation, which is where\n // people will likely go looking for it.\n /**\n Triggers the `LinkView`'s routing behavior. If\n `eventName` is changed to a value other than `click`\n the routing behavior will trigger on that custom event\n instead.\n\n @event click\n **/\n\n /**\n An overridable method called when LinkView objects are instantiated.\n\n Example:\n\n ```javascript\n App.MyLinkView = Ember.LinkView.extend({\n init: function() {\n this._super();\n Ember.Logger.log('Event is ' + this.get('eventName'));\n }\n });\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n @method init\n */\n init: function() {\n this._super.apply(this, arguments);\n\n // Map desired event name to invoke function\n var eventName = get(this, 'eventName');\n this.on(eventName, this, this._invoke);\n\n var helperParameters = this.parameters,\n templateContext = helperParameters.context,\n paths = getResolvedPaths(helperParameters),\n length = paths.length,\n path, i, normalizedPath;\n\n if (Ember.FEATURES.isEnabled('link-to-non-block')) {\n var linkTextPath = helperParameters.options.linkTextPath;\n if (linkTextPath) {\n normalizedPath = Ember.Handlebars.normalizePath(templateContext, linkTextPath, helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this.rerender);\n }\n }\n\n for(i=0; i < length; i++) {\n path = paths[i];\n if (null === path) {\n // A literal value was provided, not a path, so nothing to observe.\n continue;\n }\n\n normalizedPath = Ember.Handlebars.normalizePath(templateContext, path, helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this._paramsChanged);\n }\n\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n var queryParams = get(this, '_potentialQueryParams') || [];\n\n for(i=0; i < queryParams.length; i++) {\n this.registerObserver(this, queryParams[i], this, this._queryParamsChanged);\n }\n }\n },\n\n /**\n @private\n\n This method is invoked by observers installed during `init` that fire\n whenever the params change\n @method _paramsChanged\n */\n _paramsChanged: function() {\n this.notifyPropertyChange('resolvedParams');\n },\n\n\n /**\n @private\n\n This method is invoked by observers installed during `init` that fire\n whenever the query params change\n */\n _queryParamsChanged: function (object, path) {\n this.notifyPropertyChange('queryParams');\n },\n\n\n /**\n @private\n\n Even though this isn't a virtual view, we want to treat it as if it is\n so that you can access the parent with {{view.prop}}\n\n @method concreteView\n **/\n concreteView: Ember.computed(function() {\n return get(this, 'parentView');\n }).property('parentView'),\n\n /**\n\n Accessed as a classname binding to apply the `LinkView`'s `disabledClass`\n CSS `class` to the element when the link is disabled.\n\n When `true` interactions with the element will not trigger route changes.\n @property disabled\n */\n disabled: Ember.computed(function(key, value) {\n if (value !== undefined) { this.set('_isDisabled', value); }\n\n return value ? get(this, 'disabledClass') : false;\n }),\n\n /**\n Accessed as a classname binding to apply the `LinkView`'s `activeClass`\n CSS `class` to the element when the link is active.\n\n A `LinkView` is considered active when its `currentWhen` property is `true`\n or the application's current route is the route the `LinkView` would trigger\n transitions into.\n\n @property active\n **/\n active: Ember.computed(function() {\n if (get(this, 'loading')) { return false; }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs'),\n contexts = routeArgs.slice(1),\n resolvedParams = get(this, 'resolvedParams'),\n currentWhen = this.currentWhen || resolvedParams[0],\n currentWithIndex = currentWhen + '.index',\n isActive = router.isActive.apply(router, [currentWhen].concat(contexts)) ||\n router.isActive.apply(router, [currentWithIndex].concat(contexts));\n\n if (isActive) { return get(this, 'activeClass'); }\n }).property('resolvedParams', 'routeArgs', 'router.url'),\n\n /**\n Accessed as a classname binding to apply the `LinkView`'s `loadingClass`\n CSS `class` to the element when the link is loading.\n\n A `LinkView` is considered loading when it has at least one\n parameter whose value is currently null or undefined. During\n this time, clicking the link will perform no transition and\n emit a warning that the link is still in a loading state.\n\n @property loading\n **/\n loading: Ember.computed(function() {\n if (!get(this, 'routeArgs')) { return get(this, 'loadingClass'); }\n }).property('routeArgs'),\n\n /**\n @private\n\n Returns the application's main router from the container.\n\n @property router\n **/\n router: Ember.computed(function() {\n return get(this, 'controller').container.lookup('router:main');\n }),\n\n /**\n @private\n\n Event handler that invokes the link, activating the associated route.\n\n @method _invoke\n @param {Event} event\n */\n _invoke: function(event) {\n if (!isSimpleClick(event)) { return true; }\n\n event.preventDefault();\n if (this.bubbles === false) { event.stopPropagation(); }\n\n if (get(this, '_isDisabled')) { return false; }\n\n if (get(this, 'loading')) {\n Ember.Logger.warn(\"This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.\");\n return false;\n }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs');\n\n if (get(this, 'replace')) {\n router.replaceWith.apply(router, routeArgs);\n } else {\n router.transitionTo.apply(router, routeArgs);\n }\n },\n\n /**\n @private\n\n Computed property that returns the resolved parameters.\n\n @property\n @return {Array}\n */\n resolvedParams: Ember.computed(function() {\n var parameters = this.parameters,\n options = parameters.options,\n types = options.types,\n data = options.data;\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n if (parameters.params.length === 0) {\n var appController = this.container.lookup('controller:application');\n return [get(appController, 'currentRouteName')];\n } else {\n return resolveParams(parameters.context, parameters.params, { types: types, data: data });\n }\n }\n\n // Original implementation if query params not enabled\n return resolveParams(parameters.context, parameters.params, { types: types, data: data });\n }).property(),\n\n /**\n @private\n\n Computed property that returns the current route name and\n any dynamic segments.\n\n @property\n @return {Array} An array with the route name and any dynamic segments\n */\n routeArgs: Ember.computed(function() {\n var resolvedParams = get(this, 'resolvedParams').slice(0),\n router = get(this, 'router'),\n namedRoute = resolvedParams[0];\n\n if (!namedRoute) { return; }\n\n namedRoute = fullRouteName(router, namedRoute);\n resolvedParams[0] = namedRoute;\n\n Ember.assert(fmt(\"The attempt to link-to route '%@' failed. The router did not find '%@' in its possible routes: '%@'\", [namedRoute, namedRoute, Ember.keys(router.router.recognizer.names).join(\"', '\")]), router.hasRoute(namedRoute));\n\n for (var i = 1, len = resolvedParams.length; i < len; ++i) {\n var param = resolvedParams[i];\n if (param === null || typeof param === 'undefined') {\n // If contexts aren't present, consider the linkView unloaded.\n return;\n }\n }\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n var queryParams = get(this, 'queryParams');\n\n if (queryParams || queryParams === false) { resolvedParams.push({queryParams: queryParams}); }\n }\n\n return resolvedParams;\n }).property('resolvedParams', 'queryParams', 'router.url'),\n\n\n _potentialQueryParams: Ember.computed(function () {\n var namedRoute = get(this, 'resolvedParams')[0];\n if (!namedRoute) { return null; }\n var router = get(this, 'router');\n\n namedRoute = fullRouteName(router, namedRoute);\n\n return router.router.queryParamsForHandler(namedRoute);\n }).property('resolvedParams'),\n\n queryParams: Ember.computed(function () {\n var self = this,\n queryParams = null,\n allowedQueryParams = get(this, '_potentialQueryParams');\n\n if (!allowedQueryParams) { return null; }\n allowedQueryParams.forEach(function (param) {\n var value = get(self, param);\n if (typeof value !== 'undefined') {\n queryParams = queryParams || {};\n queryParams[param] = value;\n }\n });\n\n\n return queryParams;\n }).property('_potentialQueryParams.[]'),\n\n /**\n Sets the element's `href` attribute to the url for\n the `LinkView`'s targeted route.\n\n If the `LinkView`'s `tagName` is changed to a value other\n than `a`, this property will be ignored.\n\n @property href\n **/\n href: Ember.computed(function() {\n if (get(this, 'tagName') !== 'a') { return; }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs');\n\n return routeArgs ? router.generate.apply(router, routeArgs) : get(this, 'loadingHref');\n }).property('routeArgs'),\n\n /**\n The default href value to use while a link-to is loading.\n Only applies when tagName is 'a'\n\n @property loadingHref\n @type String\n @default #\n */\n loadingHref: '#'\n });\n\n LinkView.toString = function() { return \"LinkView\"; };\n\n /**\n The `{{link-to}}` helper renders a link to the supplied\n `routeName` passing an optionally supplied model to the\n route as its `model` context of the route. The block\n for `{{link-to}}` becomes the innerHTML of the rendered\n element:\n\n ```handlebars\n {{#link-to 'photoGallery'}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos\">\n Great Hamster Photos\n </a>\n ```\n\n ### Supplying a tagName\n By default `{{link-to}}` renders an `<a>` element. This can\n be overridden for a single use of `{{link-to}}` by supplying\n a `tagName` option:\n\n ```handlebars\n {{#link-to 'photoGallery' tagName=\"li\"}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n ```html\n <li>\n Great Hamster Photos\n </li>\n ```\n\n To override this option for your entire application, see\n \"Overriding Application-wide Defaults\".\n \n ### Disabling the `link-to` helper\n By default `{{link-to}}` is enabled. \n any passed value to `disabled` helper property will disable the `link-to` helper.\n \n static use: the `disabled` option:\n \n ```handlebars\n {{#link-to 'photoGallery' disabled=true}}\n Great Hamster Photos\n {{/link-to}}\n ```\n \n dynamic use: the `disabledWhen` option:\n \n ```handlebars\n {{#link-to 'photoGallery' disabledWhen=controller.someProperty}}\n Great Hamster Photos\n {{/link-to}}\n ```\n \n any passed value to `disabled` will disable it except `undefined`.\n to ensure that only `true` disable the `link-to` helper you can\n override the global behaviour of `Ember.LinkView`.\n \n ```javascript \n Ember.LinkView.reopen({\n disabled: Ember.computed(function(key, value) {\n if (value !== undefined) { \n this.set('_isDisabled', value === true); \n }\n return value === true ? get(this, 'disabledClass') : false;\n })\n });\n ```\n \n see \"Overriding Application-wide Defaults\" for more.\n \n ### Handling `href`\n `{{link-to}}` will use your application's Router to\n fill the element's `href` property with a url that\n matches the path to the supplied `routeName` for your\n routers's configured `Location` scheme, which defaults\n to Ember.HashLocation.\n\n ### Handling current route\n `{{link-to}}` will apply a CSS class name of 'active'\n when the application's current route matches\n the supplied routeName. For example, if the application's\n current route is 'photoGallery.recent' the following\n use of `{{link-to}}`:\n\n ```handlebars\n {{#link-to 'photoGallery.recent'}}\n Great Hamster Photos from the last week\n {{/link-to}}\n ```\n\n will result in\n\n ```html\n <a href=\"/hamster-photos/this-week\" class=\"active\">\n Great Hamster Photos\n </a>\n ```\n\n The CSS class name used for active classes can be customized\n for a single use of `{{link-to}}` by passing an `activeClass`\n option:\n\n ```handlebars\n {{#link-to 'photoGallery.recent' activeClass=\"current-url\"}}\n Great Hamster Photos from the last week\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/this-week\" class=\"current-url\">\n Great Hamster Photos\n </a>\n ```\n\n To override this option for your entire application, see\n \"Overriding Application-wide Defaults\".\n\n ### Supplying a model\n An optional model argument can be used for routes whose\n paths contain dynamic segments. This argument will become\n the model context of the linked route:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n });\n ```\n\n ```handlebars\n {{#link-to 'photoGallery' aPhoto}}\n {{aPhoto.title}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42\">\n Tomster\n </a>\n ```\n\n ### Supplying multiple models\n For deep-linking to route paths that contain multiple\n dynamic segments, multiple model arguments can be used.\n As the router transitions through the route path, each\n supplied model argument will become the context for the\n route with the dynamic segments:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"}, function() {\n this.route(\"comment\", {path: \"comments/:comment_id\"});\n });\n });\n ```\n This argument will become the model context of the linked route:\n\n ```handlebars\n {{#link-to 'photoGallery.comment' aPhoto comment}}\n {{comment.body}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42/comment/718\">\n A+++ would snuggle again.\n </a>\n ```\n\n ### Supplying an explicit dynamic segment value\n If you don't have a model object available to pass to `{{link-to}}`,\n an optional string or integer argument can be passed for routes whose\n paths contain dynamic segments. This argument will become the value\n of the dynamic segment:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n });\n ```\n\n ```handlebars\n {{#link-to 'photoGallery' aPhotoId}}\n {{aPhoto.title}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42\">\n Tomster\n </a>\n ```\n\n When transitioning into the linked route, the `model` hook will\n be triggered with parameters including this passed identifier.\n\n ### Overriding attributes\n You can override any given property of the Ember.LinkView\n that is generated by the `{{link-to}}` helper by passing\n key/value pairs, like so:\n\n ```handlebars\n {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames=['pic', 'sweet']}}\n Uh-mazing!\n {{/link-to}}\n ```\n\n See [Ember.LinkView](/api/classes/Ember.LinkView.html) for a\n complete list of overrideable properties. Be sure to also\n check out inherited properties of `LinkView`.\n\n ### Overriding Application-wide Defaults\n ``{{link-to}}`` creates an instance of Ember.LinkView\n for rendering. To override options for your entire\n application, reopen Ember.LinkView and supply the\n desired values:\n\n ``` javascript\n Ember.LinkView.reopen({\n activeClass: \"is-active\",\n tagName: 'li'\n })\n ```\n\n It is also possible to override the default event in\n this manner:\n\n ``` javascript\n Ember.LinkView.reopen({\n eventName: 'customEventName'\n });\n ```\n\n @method link-to\n @for Ember.Handlebars.helpers\n @param {String} routeName\n @param {Object} [context]*\n @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkView\n @return {String} HTML string\n @see {Ember.LinkView}\n */\n Ember.Handlebars.registerHelper('link-to', function(name) {\n var options = [].slice.call(arguments, -1)[0],\n params = [].slice.call(arguments, 0, -1),\n hash = options.hash;\n\n hash.disabledBinding = hash.disabledWhen;\n\n if (Ember.FEATURES.isEnabled('link-to-non-block')) {\n if (!options.fn) {\n var linkTitle = params.shift();\n var linkType = options.types.shift();\n var context = this;\n if (linkType === 'ID') {\n options.linkTextPath = linkTitle;\n options.fn = function() {\n return Ember.Handlebars.get(context, linkTitle, options);\n };\n } else {\n options.fn = function() {\n return linkTitle;\n };\n }\n }\n }\n\n hash.parameters = {\n context: this,\n options: options,\n params: params\n };\n\n return Ember.Handlebars.helpers.view.call(this, LinkView, options);\n });\n\n /**\n See [link-to](/api/classes/Ember.Handlebars.helpers.html#method_link-to)\n\n @method linkTo\n @for Ember.Handlebars.helpers\n @deprecated\n @param {String} routeName\n @param {Object} [context]*\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('linkTo', Ember.Handlebars.helpers['link-to']);\n});\n\n\n\n})();\n//@ sourceURL=ember-routing/helpers/link_to");minispade.register('ember-routing/helpers/outlet', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n /**\n @module ember\n @submodule ember-routing\n */\n\n Handlebars.OutletView = Ember.ContainerView.extend(Ember._Metamorph);\n\n /**\n The `outlet` helper is a placeholder that the router will fill in with\n the appropriate template based on the current state of the application.\n\n ``` handlebars\n {{outlet}}\n ```\n\n By default, a template based on Ember's naming conventions will be rendered\n into the `outlet` (e.g. `App.PostsRoute` will render the `posts` template).\n\n You can render a different template by using the `render()` method in the\n route's `renderTemplate` hook. The following will render the `favoritePost`\n template into the `outlet`.\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost');\n }\n });\n ```\n\n You can create custom named outlets for more control.\n\n ``` handlebars\n {{outlet 'favoritePost'}}\n {{outlet 'posts'}}\n ```\n\n Then you can define what template is rendered into each outlet in your\n route.\n\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost', { outlet: 'favoritePost' });\n this.render('posts', { outlet: 'posts' });\n }\n });\n ```\n\n You can specify the view class that the outlet uses to contain and manage the\n templates rendered into it.\n\n ``` handlebars\n {{outlet viewClass=App.SectionContainer}}\n ```\n\n ``` javascript\n App.SectionContainer = Ember.ContainerView.extend({\n tagName: 'section',\n classNames: ['special']\n });\n ```\n\n @method outlet\n @for Ember.Handlebars.helpers\n @param {String} property the property on the controller\n that holds the view for this outlet\n @return {String} HTML string\n */\n Handlebars.registerHelper('outlet', function(property, options) {\n var outletSource, outletContainerClass;\n\n if (property && property.data && property.data.isRenderData) {\n options = property;\n property = 'main';\n }\n\n outletSource = options.data.view;\n while (!outletSource.get('template.isTop')) {\n outletSource = outletSource.get('_parentView');\n }\n\n outletContainerClass = options.hash.viewClass || Handlebars.OutletView;\n\n options.data.view.set('outletSource', outletSource);\n options.hash.currentViewBinding = '_view.outletSource._outlets.' + property;\n\n return Handlebars.helpers.view.call(this, outletContainerClass, options);\n });\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/outlet");minispade.register('ember-routing/helpers/render', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n /**\n Calling ``{{render}}`` from within a template will insert another\n template that matches the provided name. The inserted template will\n access its properties on its own controller (rather than the controller\n of the parent template).\n\n If a view class with the same name exists, the view class also will be used.\n\n Note: A given controller may only be used *once* in your app in this manner.\n A singleton instance of the controller will be created for you.\n\n Example:\n\n ```javascript\n App.NavigationController = Ember.Controller.extend({\n who: \"world\"\n });\n ```\n\n ```handlebars\n <!-- navigation.hbs -->\n Hello, {{who}}.\n ```\n\n ```handelbars\n <!-- application.hbs -->\n <h1>My great app</h1>\n {{render navigation}}\n ```\n\n ```html\n <h1>My great app</h1>\n <div class='ember-view'>\n Hello, world.\n </div>\n ```\n\n Optionally you may provide a second argument: a property path\n that will be bound to the `model` property of the controller.\n\n If a `model` property path is specified, then a new instance of the\n controller will be created and `{{render}}` can be used multiple times\n with the same name.\n\n For example if you had this `author` template.\n\n ```handlebars\n<div class=\"author\">\n Written by {{firstName}} {{lastName}}.\n Total Posts: {{postCount}}\n</div>\n ```\n\n You could render it inside the `post` template using the `render` helper.\n\n ```handlebars\n<div class=\"post\">\n <h1>{{title}}</h1>\n <div>{{body}}</div>\n {{render \"author\" author}}\n</div>\n ```\n\n @method render\n @for Ember.Handlebars.helpers\n @param {String} name\n @param {Object?} contextString\n @param {Hash} options\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('render', function(name, contextString, options) {\n Ember.assert(\"You must pass a template to render\", arguments.length >= 2);\n var contextProvided = arguments.length === 3,\n container, router, controller, view, context, lookupOptions;\n\n if (arguments.length === 2) {\n options = contextString;\n contextString = undefined;\n }\n\n if (typeof contextString === 'string') {\n context = Ember.Handlebars.get(options.contexts[1], contextString, options);\n lookupOptions = { singleton: false };\n }\n\n name = name.replace(/\\//g, '.');\n container = options.data.keywords.controller.container;\n router = container.lookup('router:main');\n\n Ember.assert(\"You can only use the {{render}} helper once without a model object as its second argument, as in {{render \\\"post\\\" post}}.\", contextProvided || !router || !router._lookupActiveView(name));\n\n view = container.lookup('view:' + name) || container.lookup('view:default');\n\n var controllerName = options.hash.controller;\n\n // Look up the controller by name, if provided.\n if (controllerName) {\n controller = container.lookup('controller:' + controllerName, lookupOptions);\n Ember.assert(\"The controller name you supplied '\" + controllerName + \"' did not resolve to a controller.\", !!controller);\n } else {\n controller = container.lookup('controller:' + name, lookupOptions) ||\n Ember.generateController(container, name, context);\n }\n\n if (controller && contextProvided) {\n controller.set('model', context);\n }\n\n var root = options.contexts[1];\n\n if (root) {\n view.registerObserver(root, contextString, function() {\n controller.set('model', Ember.Handlebars.get(root, contextString, options));\n });\n }\n\n controller.set('target', options.data.keywords.controller);\n\n options.hash.viewName = Ember.String.camelize(name);\n options.hash.template = container.lookup('template:' + name);\n options.hash.controller = controller;\n\n if (router && !context) {\n router._connectActiveView(name, view);\n }\n\n Ember.Handlebars.helpers.view.call(this, view, options);\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/render");minispade.register('ember-routing/helpers/shared', "(function() {minispade.require('ember-routing/system/router');\n\nEmber.onLoad('Ember.Handlebars', function() {\n var handlebarsResolve = Ember.Handlebars.resolveParams,\n map = Ember.ArrayPolyfills.map,\n get = Ember.get,\n handlebarsGet = Ember.Handlebars.get;\n\n function resolveParams(context, params, options) {\n return map.call(resolvePaths(context, params, options), function(path, i) {\n if (null === path) {\n // Param was string/number, not a path, so just return raw string/number.\n return params[i];\n } else {\n return handlebarsGet(context, path, options);\n }\n });\n }\n\n function resolvePaths(context, params, options) {\n var resolved = handlebarsResolve(context, params, options),\n types = options.types;\n\n return map.call(resolved, function(object, i) {\n if (types[i] === 'ID') {\n return unwrap(object, params[i]);\n } else {\n return null;\n }\n });\n\n function unwrap(object, path) {\n if (path === 'controller') { return path; }\n\n if (Ember.ControllerMixin.detect(object)) {\n return unwrap(get(object, 'model'), path ? path + '.model' : 'model');\n } else {\n return path;\n }\n }\n }\n\n Ember.Router.resolveParams = resolveParams;\n Ember.Router.resolvePaths = resolvePaths;\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/shared");minispade.register('ember-routing/location', "(function() {minispade.require('ember-views');\nminispade.require('ember-routing/location/api');\nminispade.require('ember-routing/location/none_location');\nminispade.require('ember-routing/location/hash_location');\nminispade.require('ember-routing/location/history_location');\n\n})();\n//@ sourceURL=ember-routing/location");minispade.register('ember-routing/location/api', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n This file implements the `location` API used by Ember's router.\n\n That API is:\n\n getURL: returns the current URL\n setURL(path): sets the current URL\n replaceURL(path): replace the current URL (optional)\n onUpdateURL(callback): triggers the callback when the URL changes\n formatURL(url): formats `url` to be placed into `href` attribute\n\n Calling setURL or replaceURL will not trigger onUpdateURL callbacks.\n\n TODO: This should perhaps be moved so that it's visible in the doc output.\n*/\n\n/**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n You can pass it a `implementation` ('hash', 'history', 'none') to force a\n particular implementation.\n\n @class Location\n @namespace Ember\n @static\n*/\nEmber.Location = {\n /**\n Create an instance of a an implementation of the `location` API. Requires\n an options object with an `implementation` property.\n\n Example\n\n ```javascript\n var hashLocation = Ember.Location.create({implementation: 'hash'});\n var historyLocation = Ember.Location.create({implementation: 'history'});\n var noneLocation = Ember.Location.create({implementation: 'none'});\n ```\n\n @method create\n @param {Object} options\n @return {Object} an instance of an implementation of the `location` API\n */\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n /**\n Registers a class that implements the `location` API with an implementation\n name. This implementation name can then be specified by the location property on\n the application's router class.\n\n Example\n\n ```javascript\n Ember.Location.registerImplementation('history', Ember.HistoryLocation);\n\n App.Router.reopen({\n location: 'history'\n });\n ```\n\n @method registerImplementation\n @param {String} name\n @param {Object} implementation of the `location` API\n */\n registerImplementation: function(name, implementation) {\n this.implementations[name] = implementation;\n },\n\n implementations: {}\n};\n\n})();\n//@ sourceURL=ember-routing/location/api");minispade.register('ember-routing/location/hash_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.HashLocation implements the location API using the browser's\n hash. At present, it relies on a hashchange event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HashLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n },\n\n /**\n @private\n\n Returns the current `location.hash`, minus the '#' at the front.\n\n @method getURL\n */\n getURL: function() {\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n // location.hash is not used because it is inconsistently\n // URL-decoded between browsers.\n var href = get(this, 'location').href,\n hashIndex = href.indexOf('#');\n\n if ( hashIndex === -1 ) {\n return \"\";\n } else {\n return href.substr(hashIndex + 1);\n }\n }\n // Default implementation without feature flag enabled\n return get(this, 'location').hash.substr(1);\n },\n\n /**\n @private\n\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n @private\n\n Uses location.replace to update the url without a page reload\n or history modification.\n\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n get(this, 'location').replace('#' + path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = Ember.guidFor(this);\n\n Ember.$(window).on('hashchange.ember-location-'+guid, function() {\n Ember.run(function() {\n var path = location.hash.substr(1);\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(path);\n });\n });\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n /**\n @private\n\n Cleans up the HashLocation event listener.\n\n @method willDestroy\n */\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).off('hashchange.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('hash', Ember.HashLocation);\n\n})();\n//@ sourceURL=ember-routing/location/hash_location");minispade.register('ember-routing/location/history_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar popstateFired = false;\nvar supportsHistoryState = window.history && 'state' in window.history;\n\n/**\n Ember.HistoryLocation implements the location API using the browser's\n history.pushState API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HistoryLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n this.initState();\n },\n\n /**\n @private\n\n Used to set state on first call to setURL\n\n @method initState\n */\n initState: function() {\n set(this, 'history', get(this, 'history') || window.history);\n this.replaceState(this.formatURL(this.getURL()));\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Returns the current `location.pathname` without rootURL\n\n @method getURL\n @return url {String}\n */\n getURL: function() {\n var rootURL = get(this, 'rootURL'),\n location = get(this, 'location'),\n path = location.pathname;\n\n rootURL = rootURL.replace(/\\/$/, '');\n var url = path.replace(rootURL, '');\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n var search = location.search || '';\n url += search;\n }\n\n return url;\n },\n\n /**\n @private\n\n Uses `history.pushState` to update the url without a page reload.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n var state = this.getState();\n path = this.formatURL(path);\n\n if (state && state.path !== path) {\n this.pushState(path);\n }\n },\n\n /**\n @private\n\n Uses `history.replaceState` to update the url without a page reload\n or history modification.\n\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n var state = this.getState();\n path = this.formatURL(path);\n\n if (state && state.path !== path) {\n this.replaceState(path);\n }\n },\n\n /**\n @private\n\n Get the current `history.state`\n Polyfill checks for native browser support and falls back to retrieving\n from a private _historyState variable\n\n @method getState\n @return state {Object}\n */\n getState: function() {\n return supportsHistoryState ? get(this, 'history').state : this._historyState;\n },\n\n /**\n @private\n\n Pushes a new state\n\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n var state = { path: path };\n\n get(this, 'history').pushState(state, null, path);\n\n // store state if browser doesn't support `history.state`\n if (!supportsHistoryState) {\n this._historyState = state;\n }\n\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n @private\n\n Replaces the current state\n\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n var state = { path: path };\n\n get(this, 'history').replaceState(state, null, path);\n\n // store state if browser doesn't support `history.state`\n if (!supportsHistoryState) {\n this._historyState = state;\n }\n\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n @private\n\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = Ember.guidFor(this),\n self = this;\n\n Ember.$(window).on('popstate.ember-location-'+guid, function(e) {\n // Ignore initial page load popstate event in Chrome\n if (!popstateFired) {\n popstateFired = true;\n if (self.getURL() === self._previousURL) { return; }\n }\n callback(self.getURL());\n });\n },\n\n /**\n @private\n\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @method formatURL\n @param url {String}\n @return formatted url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n }\n\n return rootURL + url;\n },\n\n /**\n @private\n\n Cleans up the HistoryLocation event listener.\n\n @method willDestroy\n */\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).off('popstate.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('history', Ember.HistoryLocation);\n\n})();\n//@ sourceURL=ember-routing/location/history_location");minispade.register('ember-routing/location/none_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.NoneLocation does not interact with the browser. It is useful for\n testing, or when you need to manage state with your Router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.NoneLocation = Ember.Object.extend({\n path: '',\n\n /**\n @private\n\n Returns the current path.\n\n @method getURL\n @return {String} path\n */\n getURL: function() {\n return get(this, 'path');\n },\n\n /**\n @private\n\n Set the path and remembers what was set. Using this method\n to change the path will not invoke the `updateURL` callback.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the path changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n this.updateCallback = callback;\n },\n\n /**\n @private\n\n Sets the path and calls the `updateURL` callback.\n\n @method handleURL\n @param callback {Function}\n */\n handleURL: function(url) {\n set(this, 'path', url);\n this.updateCallback(url);\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n @return {String} url\n */\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n});\n\nEmber.Location.registerImplementation('none', Ember.NoneLocation);\n\n})();\n//@ sourceURL=ember-routing/location/none_location");minispade.register('ember-routing', "(function() {minispade.require('ember-runtime');\nminispade.require('ember-views');\nminispade.require('ember-handlebars');\nminispade.require('ember-routing/vendor/route-recognizer');\nminispade.require('ember-routing/vendor/router');\nminispade.require('ember-routing/system');\nminispade.require('ember-routing/helpers');\nminispade.require('ember-routing/ext');\nminispade.require('ember-routing/location');\n\n/**\nEmber Routing\n\n@module ember\n@submodule ember-routing\n@requires ember-views\n*/\n\n})();\n//@ sourceURL=ember-routing");minispade.register('ember-routing/system', "(function() {minispade.require('ember-routing/system/dsl');\nminispade.require('ember-routing/system/controller_for');\nminispade.require('ember-routing/system/router');\nminispade.require('ember-routing/system/route');\n\n})();\n//@ sourceURL=ember-routing/system");minispade.register('ember-routing/system/controller_for', "(function() {var get = Ember.get;\n\n/**\n@module ember\n@submodule ember-routing\n*/\n\n/**\n \n Finds a controller instance.\n\n @for Ember\n @method controllerFor\n @private\n*/\nEmber.controllerFor = function(container, controllerName, lookupOptions) {\n return container.lookup('controller:' + controllerName, lookupOptions);\n};\n\n/**\n Generates a controller automatically if none was provided.\n The type of generated controller depends on the context.\n You can customize your generated controllers by defining\n `App.ObjectController` and `App.ArrayController`\n \n @for Ember\n @method generateController\n @private\n*/\nEmber.generateController = function(container, controllerName, context) {\n var ControllerFactory, fullName, instance, name, factoryName, controllerType;\n\n if (context && Ember.isArray(context)) {\n controllerType = 'array';\n } else if (context) {\n controllerType = 'object';\n } else {\n controllerType = 'basic';\n }\n\n factoryName = 'controller:' + controllerType;\n\n ControllerFactory = container.lookupFactory(factoryName).extend({\n isGenerated: true,\n toString: function() {\n return \"(generated \" + controllerName + \" controller)\";\n }\n });\n\n fullName = 'controller:' + controllerName;\n\n container.register(fullName, ControllerFactory);\n\n instance = container.lookup(fullName);\n\n if (get(instance, 'namespace.LOG_ACTIVE_GENERATION')) {\n Ember.Logger.info(\"generated -> \" + fullName, { fullName: fullName });\n }\n\n return instance;\n};\n\n})();\n//@ sourceURL=ember-routing/system/controller_for");minispade.register('ember-routing/system/dsl', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nfunction DSL(name) {\n this.parent = name;\n this.matches = [];\n}\n\nDSL.prototype = {\n resource: function(name, options, callback) {\n if (arguments.length === 2 && typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n if (arguments.length === 1) {\n options = {};\n }\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (callback) {\n var dsl = new DSL(name);\n dsl.route('loading');\n dsl.route('error', { path: \"/_unused_dummy_error_path/:error\" });\n callback.call(dsl);\n this.push(options.path, name, dsl.generate(), options.queryParams);\n } else {\n this.push(options.path, name, null, options.queryParams);\n }\n },\n\n push: function(url, name, callback, queryParams) {\n var parts = name.split('.');\n if (url === \"\" || url === \"/\" || parts[parts.length-1] === \"index\") { this.explicitIndex = true; }\n\n this.matches.push([url, name, callback, queryParams]);\n },\n\n route: function(name, options) {\n Ember.assert(\"You must use `this.resource` to nest\", typeof options !== 'function');\n\n options = options || {};\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (this.parent && this.parent !== 'application') {\n name = this.parent + \".\" + name;\n }\n\n this.push(options.path, name, null, options.queryParams);\n },\n\n generate: function() {\n var dslMatches = this.matches;\n\n if (!this.explicitIndex) {\n this.route(\"index\", { path: \"/\" });\n }\n\n return function(match) {\n for (var i=0, l=dslMatches.length; i<l; i++) {\n var dslMatch = dslMatches[i];\n var matchObj = match(dslMatch[0]).to(dslMatch[1], dslMatch[2]);\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n if(dslMatch[3]) {\n matchObj.withQueryParams.apply(matchObj, dslMatch[3]);\n }\n }\n }\n };\n }\n};\n\nDSL.map = function(callback) {\n var dsl = new DSL();\n callback.call(dsl);\n return dsl;\n};\n\nEmber.RouterDSL = DSL;\n\n})();\n//@ sourceURL=ember-routing/system/dsl");minispade.register('ember-routing/system/route', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set,\n getProperties = Ember.getProperties,\n classify = Ember.String.classify,\n fmt = Ember.String.fmt,\n a_forEach = Ember.EnumerableUtils.forEach,\n a_replace = Ember.EnumerableUtils.replace;\n\nvar defaultActionHandlers = {\n\n willResolveModel: function(transition, originRoute) {\n this.router._scheduleLoadingEvent(transition, originRoute);\n },\n\n error: function(error, transition, originRoute) {\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n if (this !== originRoute) {\n var childErrorRouteName = findChildRouteName(this, 'error');\n if (childErrorRouteName) {\n this.intermediateTransitionTo(childErrorRouteName, error);\n return;\n }\n }\n }\n\n if (this.routeName === 'application') {\n Ember.Logger.assert(false, 'Error while loading route: ' + Ember.inspect(error));\n }\n\n return true;\n },\n\n loading: function(transition, originRoute) {\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n if (this === originRoute) {\n // This is the route with the error; just bubble\n // so that the parent route can look up its child loading route.\n return true;\n }\n\n var childLoadingRouteName = findChildRouteName(this, 'loading');\n if (childLoadingRouteName) {\n this.intermediateTransitionTo(childLoadingRouteName);\n } else if (transition.pivotHandler !== this) {\n return true;\n }\n }\n }\n};\n\n/**\n The `Ember.Route` class is used to define individual routes. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Route\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.Route = Ember.Object.extend(Ember.ActionHandler, {\n\n /**\n @private\n\n @method exit\n */\n exit: function() {\n this.deactivate();\n this.teardownViews();\n },\n\n /**\n @private\n\n @method enter\n */\n enter: function() {\n this.activate();\n },\n\n /**\n The collection of functions, keyed by name, available on this route as\n action targets.\n\n These functions will be invoked when a matching `{{action}}` is triggered\n from within a template and the application's current route is this route.\n\n Actions can also be invoked from other parts of your application via `Route#send`\n or `Controller#send`.\n\n The `actions` hash will inherit action handlers from\n the `actions` hash defined on extended Route parent classes\n or mixins rather than just replace the entire hash, e.g.:\n\n ```js\n App.CanDisplayBanner = Ember.Mixin.create({\n actions: {\n displayBanner: function(msg) {\n // ...\n }\n }\n });\n\n App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, {\n actions: {\n playMusic: function() {\n // ...\n }\n }\n });\n\n // `WelcomeRoute`, when active, will be able to respond\n // to both actions, since the actions hash is merged rather\n // then replaced when extending mixins / parent classes.\n this.send('displayBanner');\n this.send('playMusic');\n ```\n\n Within a route's action handler, the value of the `this` context\n is the Route object:\n\n ```js\n App.SongRoute = Ember.Route.extend({\n actions: {\n myAction: function() {\n this.controllerFor(\"song\");\n this.transitionTo(\"other.route\");\n ...\n }\n }\n });\n ```\n\n It is also possible to call `this._super()` from within an\n action handler if it overrides a handler defined on a parent\n class or mixin:\n\n Take for example the following routes:\n\n ```js\n App.DebugRoute = Ember.Mixin.create({\n actions: {\n debugRouteInformation: function() {\n console.debug(\"trololo\");\n }\n }\n });\n\n App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, {\n actions: {\n debugRouteInformation: function() {\n // also call the debugRouteInformation of mixed in App.DebugRoute\n this._super();\n\n // show additional annoyance\n window.alert(...);\n }\n }\n });\n ```\n\n ## Bubbling\n\n By default, an action will stop bubbling once a handler defined\n on the `actions` hash handles it. To continue bubbling the action,\n you must return `true` from the handler:\n\n ```js\n App.Router.map(function() {\n this.resource(\"album\", function() {\n this.route(\"song\");\n });\n });\n\n App.AlbumRoute = Ember.Route.extend({\n actions: {\n startPlaying: function() {\n }\n }\n });\n\n App.AlbumSongRoute = Ember.Route.extend({\n actions: {\n startPlaying: function() {\n // ...\n\n if (actionShouldAlsoBeTriggeredOnParentRoute) {\n return true;\n }\n }\n }\n });\n ```\n\n ## Built-in actions\n\n There are a few built-in actions pertaining to transitions that you\n can use to customize transition behavior: `willTransition` and\n `error`.\n\n ### `willTransition`\n\n The `willTransition` action is fired at the beginning of any\n attempted transition with a `Transition` object as the sole\n argument. This action can be used for aborting, redirecting,\n or decorating the transition from the currently active routes.\n\n A good example is preventing navigation when a form is\n half-filled out:\n\n ```js\n App.ContactFormRoute = Ember.Route.extend({\n actions: {\n willTransition: function(transition) {\n if (this.controller.get('userHasEnteredData')) {\n this.controller.displayNavigationConfirm();\n transition.abort();\n }\n }\n }\n });\n ```\n\n You can also redirect elsewhere by calling\n `this.transitionTo('elsewhere')` from within `willTransition`.\n Note that `willTransition` will not be fired for the\n redirecting `transitionTo`, since `willTransition` doesn't\n fire when there is already a transition underway. If you want\n subsequent `willTransition` actions to fire for the redirecting\n transition, you must first explicitly call\n `transition.abort()`.\n\n ### `error`\n\n When attempting to transition into a route, any of the hooks\n may throw an error, or return a promise that rejects, at which\n point an `error` action will be fired on the partially-entered\n routes, allowing for per-route error handling logic, or shared\n error handling logic defined on a parent route.\n\n Here is an example of an error handler that will be invoked\n for rejected promises / thrown errors from the various hooks\n on the route, as well as any unhandled errors from child\n routes:\n\n ```js\n App.AdminRoute = Ember.Route.extend({\n beforeModel: function() {\n throw \"bad things!\";\n // ...or, equivalently:\n return Ember.RSVP.reject(\"bad things!\");\n },\n\n actions: {\n error: function(error, transition) {\n // Assuming we got here due to the error in `beforeModel`,\n // we can expect that error === \"bad things!\",\n // but a promise model rejecting would also\n // call this hook, as would any errors encountered\n // in `afterModel`.\n\n // The `error` hook is also provided the failed\n // `transition`, which can be stored and later\n // `.retry()`d if desired.\n\n this.transitionTo('login');\n }\n }\n });\n ```\n\n `error` actions that bubble up all the way to `ApplicationRoute`\n will fire a default error handler that logs the error. You can\n specify your own global default error handler by overriding the\n `error` handler on `ApplicationRoute`:\n\n ```js\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n error: function(error, transition) {\n this.controllerFor('banner').displayError(error.message);\n }\n }\n });\n ```\n\n @see {Ember.Route#send}\n @see {Handlebars.helpers.action}\n\n @property actions\n @type Hash\n @default null\n */\n actions: null,\n\n _actions: defaultActionHandlers,\n\n /**\n @deprecated\n\n Please use `actions` instead.\n @method events\n */\n events: defaultActionHandlers,\n\n mergedProperties: ['events'],\n\n /**\n This hook is executed when the router completely exits this route. It is\n not executed when the model for the route changes.\n\n @method deactivate\n */\n deactivate: Ember.K,\n\n /**\n This hook is executed when the router enters the route for the first time.\n It is not executed when the model for the route changes.\n\n @method activate\n */\n activate: Ember.K,\n\n /**\n Transition into another route. Optionally supply model(s) for the\n route in question. If multiple models are supplied they will be applied\n last to first recursively up the resource tree (see Multiple Models Example\n below). The model(s) will be serialized into the URL using the appropriate\n route's `serialize` hook. See also 'replaceWith'.\n\n Simple Transition Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.route(\"secret\");\n this.route(\"fourOhFour\", { path: \"*:\"});\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n moveToSecret: function(context){\n if (authorized()){\n this.transitionTo('secret', context);\n }\n this.transitionTo('fourOhFour');\n }\n }\n });\n ```\n\n Multiple Models Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.resource('breakfast', {path:':breakfastId'}, function(){\n this.resource('cereal', {path: ':cerealId'});\n });\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n moveToChocolateCereal: function(){\n var cereal = { cerealId: \"ChocolateYumminess\"},\n breakfast = {breakfastId: \"CerealAndMilk\"};\n\n this.transitionTo('cereal', breakfast, cereal);\n }\n }\n });\n\n @method transitionTo\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n */\n transitionTo: function(name, context) {\n var router = this.router;\n return router.transitionTo.apply(router, arguments);\n },\n\n /**\n Perform a synchronous transition into another route with out attempting\n to resolve promises, update the URL, or abort any currently active\n asynchronous transitions (i.e. regular transitions caused by\n `transitionTo` or URL changes).\n\n This method is handy for performing intermediate transitions on the\n way to a final destination route, and is called internally by the\n default implementations of the `error` and `loading` handlers.\n\n @method intermediateTransitionTo\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n */\n intermediateTransitionTo: function() {\n var router = this.router;\n router.intermediateTransitionTo.apply(router, arguments);\n },\n\n /**\n Transition into another route while replacing the current URL, if possible.\n This will replace the current history entry instead of adding a new one.\n Beside that, it is identical to `transitionTo` in all other respects. See\n 'transitionTo' for additional information regarding multiple models.\n\n Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.route(\"secret\");\n });\n\n App.SecretRoute = Ember.Route.extend({\n afterModel: function() {\n if (!authorized()){\n this.replaceWith('index');\n }\n }\n });\n ```\n\n @method replaceWith\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n */\n replaceWith: function() {\n var router = this.router;\n return router.replaceWith.apply(router, arguments);\n },\n\n /**\n Sends an action to the router, which will delegate it to the currently\n active route hierarchy per the bubbling rules explained under `actions`.\n\n Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n });\n\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n track: function(arg) {\n console.log(arg, 'was clicked');\n }\n }\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n trackIfDebug: function(arg) {\n if (debug) {\n this.send('track', arg);\n }\n }\n }\n });\n ```\n\n @method send\n @param {String} name the name of the action to trigger\n @param {...*} args\n */\n send: function() {\n return this.router.send.apply(this.router, arguments);\n },\n\n /**\n @private\n\n This hook is the entry point for router.js\n\n @method setup\n */\n setup: function(context, queryParams) {\n var controllerName = this.controllerName || this.routeName,\n controller = this.controllerFor(controllerName, true);\n if (!controller) {\n controller = this.generateController(controllerName, context);\n }\n\n // Assign the route's controller so that it can more easily be\n // referenced in action handlers\n this.controller = controller;\n\n var args = [controller, context];\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n args.push(queryParams);\n }\n\n if (this.setupControllers) {\n Ember.deprecate(\"Ember.Route.setupControllers is deprecated. Please use Ember.Route.setupController(controller, model) instead.\");\n this.setupControllers(controller, context);\n } else {\n this.setupController.apply(this, args);\n }\n\n if (this.renderTemplates) {\n Ember.deprecate(\"Ember.Route.renderTemplates is deprecated. Please use Ember.Route.renderTemplate(controller, model) instead.\");\n this.renderTemplates(context);\n } else {\n this.renderTemplate.apply(this, args);\n }\n },\n\n /**\n A hook you can implement to optionally redirect to another route.\n\n If you call `this.transitionTo` from inside of this hook, this route\n will not be entered in favor of the other hook.\n\n Note that this hook is called by the default implementation of\n `afterModel`, so if you override `afterModel`, you must either\n explicitly call `redirect` or just put your redirecting\n `this.transitionTo()` call within `afterModel`.\n\n @method redirect\n @param {Object} model the model for this route\n */\n redirect: Ember.K,\n\n /**\n This hook is the first of the route entry validation hooks\n called when an attempt is made to transition into a route\n or one of its children. It is called before `model` and\n `afterModel`, and is appropriate for cases when:\n\n 1) A decision can be made to redirect elsewhere without\n needing to resolve the model first.\n 2) Any async operations need to occur first before the\n model is attempted to be resolved.\n\n This hook is provided the current `transition` attempt\n as a parameter, which can be used to `.abort()` the transition,\n save it for a later `.retry()`, or retrieve values set\n on it from a previous hook. You can also just call\n `this.transitionTo` to another route to implicitly\n abort the `transition`.\n\n You can return a promise from this hook to pause the\n transition until the promise resolves (or rejects). This could\n be useful, for instance, for retrieving async code from\n the server that is required to enter a route.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n beforeModel: function(transition) {\n if (!App.Post) {\n return Ember.$.getScript('/models/post.js');\n }\n }\n });\n ```\n\n If `App.Post` doesn't exist in the above example,\n `beforeModel` will use jQuery's `getScript`, which\n returns a promise that resolves after the server has\n successfully retrieved and executed the code from the\n server. Note that if an error were to occur, it would\n be passed to the `error` hook on `Ember.Route`, but\n it's also possible to handle errors specific to\n `beforeModel` right from within the hook (to distinguish\n from the shared error handling behavior of the `error`\n hook):\n\n ```js\n App.PostRoute = Ember.Route.extend({\n beforeModel: function(transition) {\n if (!App.Post) {\n var self = this;\n return Ember.$.getScript('post.js').then(null, function(e) {\n self.transitionTo('help');\n\n // Note that the above transitionTo will implicitly\n // halt the transition. If you were to return\n // nothing from this promise reject handler,\n // according to promise semantics, that would\n // convert the reject into a resolve and the\n // transition would continue. To propagate the\n // error so that it'd be handled by the `error`\n // hook, you would have to either\n return Ember.RSVP.reject(e);\n // or\n throw e;\n });\n }\n }\n });\n ```\n\n @method beforeModel\n @param {Transition} transition\n @param {Object} queryParams the active query params for this route\n @return {Promise} if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.\n */\n beforeModel: Ember.K,\n\n /**\n This hook is called after this route's model has resolved.\n It follows identical async/promise semantics to `beforeModel`\n but is provided the route's resolved model in addition to\n the `transition`, and is therefore suited to performing\n logic that can only take place after the model has already\n resolved.\n\n ```js\n App.PostsRoute = Ember.Route.extend({\n afterModel: function(posts, transition) {\n if (posts.length === 1) {\n this.transitionTo('post.show', posts[0]);\n }\n }\n });\n ```\n\n Refer to documentation for `beforeModel` for a description\n of transition-pausing semantics when a promise is returned\n from this hook.\n\n @method afterModel\n @param {Object} resolvedModel the value returned from `model`,\n or its resolved value if it was a promise\n @param {Transition} transition\n @param {Object} queryParams the active query params for this handler\n @return {Promise} if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.\n */\n afterModel: function(resolvedModel, transition, queryParams) {\n this.redirect(resolvedModel, transition);\n },\n\n\n /**\n @private\n\n Called when the context is changed by router.js.\n\n @method contextDidChange\n */\n contextDidChange: function() {\n this.currentModel = this.context;\n },\n\n /**\n A hook you can implement to convert the URL into the model for\n this route.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n The model for the `post` route is `App.Post.find(params.post_id)`.\n\n By default, if your route has a dynamic segment ending in `_id`:\n\n * The model class is determined from the segment (`post_id`'s\n class is `App.Post`)\n * The find method is called on the model class with the value of\n the dynamic segment.\n\n Note that for routes with dynamic segments, this hook is only\n executed when entered via the URL. If the route is entered\n through a transition (e.g. when using the `linkTo` Handlebars\n helper), then a model context is already provided and this hook\n is not called. Routes without dynamic segments will always\n execute the model hook.\n\n This hook follows the asynchronous/promise semantics\n described in the documentation for `beforeModel`. In particular,\n if a promise returned from `model` fails, the error will be\n handled by the `error` hook on `Ember.Route`.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n return App.Post.find(params.post_id);\n }\n });\n ```\n\n @method model\n @param {Object} params the parameters extracted from the URL\n @param {Transition} transition\n @param {Object} queryParams the query params for this route\n @return {Object|Promise} the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.\n */\n model: function(params, transition) {\n var match, name, sawParams, value;\n\n for (var prop in params) {\n if (match = prop.match(/^(.*)_id$/)) {\n name = match[1];\n value = params[prop];\n }\n sawParams = true;\n }\n\n if (!name && sawParams) { return params; }\n else if (!name) { return; }\n\n return this.findModel(name, value);\n },\n\n /**\n\n @method findModel\n @param {String} type the model type\n @param {Object} value the value passed to find\n */\n findModel: function(){\n var store = get(this, 'store');\n return store.find.apply(store, arguments);\n },\n\n /**\n Store property provides a hook for data persistence libraries to inject themselves.\n\n By default, this store property provides the exact same functionality previously\n in the model hook.\n\n Currently, the required interface is:\n\n `store.find(modelName, findArguments)`\n\n @method store\n @param {Object} store\n */\n store: Ember.computed(function(){\n var container = this.container;\n var routeName = this.routeName;\n var namespace = get(this, 'router.namespace');\n\n return {\n find: function(name, value) {\n var modelClass = container.lookupFactory('model:' + name);\n\n Ember.assert(\"You used the dynamic segment \" + name + \"_id in your route \"+ routeName + \", but \" + namespace + \".\" + classify(name) + \" did not exist and you did not override your route's `model` hook.\", modelClass);\n\n return modelClass.find(value);\n }\n };\n }),\n\n /**\n A hook you can implement to convert the route's model into parameters\n for the URL.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n // the server returns `{ id: 12 }`\n return jQuery.getJSON(\"/posts/\" + params.post_id);\n },\n\n serialize: function(model) {\n // this will make the URL `/posts/12`\n return { post_id: model.id };\n }\n });\n ```\n\n The default `serialize` method will insert the model's `id` into the\n route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.\n If the route has multiple dynamic segments or does not contain '_id', `serialize`\n will return `Ember.getProperties(model, params)`\n\n This method is called when `transitionTo` is called with a context\n in order to populate the URL.\n\n @method serialize\n @param {Object} model the route's model\n @param {Array} params an Array of parameter names for the current\n route (in the example, `['post_id']`.\n @return {Object} the serialized parameters\n */\n serialize: function(model, params) {\n if (params.length < 1) { return; }\n\n var name = params[0], object = {};\n\n if (/_id$/.test(name) && params.length === 1) {\n object[name] = get(model, \"id\");\n } else {\n object = getProperties(model, params);\n }\n\n return object;\n },\n\n /**\n A hook you can use to setup the controller for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook.\n\n By default, the `setupController` hook sets the `content` property of\n the controller to the `model`.\n\n This means that your template will get a proxy for the model as its\n context, and you can act as though the model itself was the context.\n\n The provided controller will be one resolved based on the name\n of this route.\n\n If no explicit controller is defined, Ember will automatically create\n an appropriate controller for the model.\n\n * if the model is an `Ember.Array` (including record arrays from Ember\n Data), the controller is an `Ember.ArrayController`.\n * otherwise, the controller is an `Ember.ObjectController`.\n\n As an example, consider the router:\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n For the `post` route, a controller named `App.PostController` would\n be used if it is defined. If it is not defined, an `Ember.ObjectController`\n instance would be used.\n\n Example\n \n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, model) {\n controller.set('model', model);\n }\n });\n ```\n\n @method setupController\n @param {Controller} controller instance\n @param {Object} model\n */\n setupController: function(controller, context) {\n if (controller && (context !== undefined)) {\n set(controller, 'model', context);\n }\n },\n\n /**\n Returns the controller for a particular route or name.\n\n The controller instance must already have been created, either through entering the\n associated route or using `generateController`.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.controllerFor('posts').set('currentPost', post);\n }\n });\n ```\n\n @method controllerFor\n @param {String} name the name of the route or controller\n @return {Ember.Controller}\n */\n controllerFor: function(name, _skipAssert) {\n var container = this.container,\n route = container.lookup('route:'+name),\n controller;\n\n if (route && route.controllerName) {\n name = route.controllerName;\n }\n\n controller = container.lookup('controller:' + name);\n\n // NOTE: We're specifically checking that skipAssert is true, because according\n // to the old API the second parameter was model. We do not want people who\n // passed a model to skip the assertion.\n Ember.assert(\"The controller named '\"+name+\"' could not be found. Make sure that this route exists and has already been entered at least once. If you are accessing a controller not associated with a route, make sure the controller class is explicitly defined.\", controller || _skipAssert === true);\n\n return controller;\n },\n\n /**\n Generates a controller for a route.\n\n If the optional model is passed then the controller type is determined automatically,\n e.g., an ArrayController for arrays.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.generateController('posts', post);\n }\n });\n ```\n\n @method generateController\n @param {String} name the name of the controller\n @param {Object} model the model to infer the type of the controller (optional)\n */\n generateController: function(name, model) {\n var container = this.container;\n\n model = model || this.modelFor(name);\n\n return Ember.generateController(container, name, model);\n },\n\n /**\n Returns the current model for a given route.\n\n This is the object returned by the `model` hook of the route\n in question.\n\n Example\n\n ```js\n App.Router.map(function() {\n this.resource('post', { path: '/post/:post_id' }, function() {\n this.resource('comments');\n });\n });\n\n App.CommentsRoute = Ember.Route.extend({\n afterModel: function() {\n this.set('post', this.modelFor('post'));\n }\n });\n ```\n\n @method modelFor\n @param {String} name the name of the route\n @return {Object} the model object\n */\n modelFor: function(name) {\n\n var route = this.container.lookup('route:' + name),\n transition = this.router.router.activeTransition;\n\n // If we are mid-transition, we want to try and look up\n // resolved parent contexts on the current transitionEvent.\n if (transition) {\n var modelLookupName = (route && route.routeName) || name;\n if (transition.resolvedModels.hasOwnProperty(modelLookupName)) {\n return transition.resolvedModels[modelLookupName];\n }\n }\n\n return route && route.currentModel;\n },\n\n /**\n A hook you can use to render the template for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook. By default, it renders the route's\n template, configured with the controller for the route.\n\n This method can be overridden to set up and render additional or\n alternative templates.\n\n ```js\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function(controller, model) {\n var favController = this.controllerFor('favoritePost');\n\n // Render the `favoritePost` template into\n // the outlet `posts`, and display the `favoritePost`\n // controller.\n this.render('favoritePost', {\n outlet: 'posts',\n controller: favController\n });\n }\n });\n ```\n\n @method renderTemplate\n @param {Object} controller the route's controller\n @param {Object} model the route's model\n */\n renderTemplate: function(controller, model) {\n this.render();\n },\n\n /**\n Renders a template into an outlet.\n\n This method has a number of defaults, based on the name of the\n route specified in the router.\n\n For example:\n\n ```js\n App.Router.map(function() {\n this.route('index');\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render();\n }\n });\n ```\n\n The name of the `PostRoute`, as defined by the router, is `post`.\n\n By default, render will:\n\n * render the `post` template\n * with the `post` view (`PostView`) for event handling, if one exists\n * and the `post` controller (`PostController`), if one exists\n * into the `main` outlet of the `application` template\n\n You can override this behavior:\n\n ```js\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render('myPost', { // the template to render\n into: 'index', // the template to render into\n outlet: 'detail', // the name of the outlet in that template\n controller: 'blogPost' // the controller to use for the template\n });\n }\n });\n ```\n\n Remember that the controller's `content` will be the route's model. In\n this case, the default model will be `App.Post.find(params.post_id)`.\n\n @method render\n @param {String} name the name of the template to render\n @param {Object} options the options\n */\n render: function(name, options) {\n Ember.assert(\"The name in the given arguments is undefined\", arguments.length > 0 ? !Ember.isNone(arguments[0]) : true);\n\n var namePassed = !!name;\n\n if (typeof name === 'object' && !options) {\n options = name;\n name = this.routeName;\n }\n\n options = options || {};\n name = name ? name.replace(/\\//g, '.') : this.routeName;\n var viewName = options.view || this.viewName || name;\n var templateName = this.templateName || name;\n\n var container = this.container,\n view = container.lookup('view:' + viewName),\n template = view ? view.get('template') : null;\n\n if (!template) {\n template = container.lookup('template:' + templateName);\n }\n\n if (!view && !template) {\n Ember.assert(\"Could not find \\\"\" + name + \"\\\" template or view.\", !namePassed);\n if (get(this.router, 'namespace.LOG_VIEW_LOOKUPS')) {\n Ember.Logger.info(\"Could not find \\\"\" + name + \"\\\" template or view. Nothing will be rendered\", { fullName: 'template:' + name });\n }\n return;\n }\n\n options = normalizeOptions(this, name, template, options);\n view = setupView(view, container, options);\n\n if (options.outlet === 'main') { this.lastRenderedTemplate = name; }\n\n appendView(this, view, options);\n },\n\n /**\n Disconnects a view that has been rendered into an outlet.\n\n You may pass any or all of the following options to `disconnectOutlet`:\n\n * `outlet`: the name of the outlet to clear (default: 'main')\n * `parentView`: the name of the view containing the outlet to clear\n (default: the view rendered by the parent route)\n\n Example:\n\n ```js\n App.ApplicationRoute = App.Route.extend({\n actions: {\n showModal: function(evt) {\n this.render(evt.modalName, {\n outlet: 'modal',\n into: 'application'\n });\n },\n hideModal: function(evt) {\n this.disconnectOutlet({\n outlet: 'modal',\n parentView: 'application'\n });\n }\n }\n });\n ```\n\n @method disconnectOutlet\n @param {Object} options the options\n */\n disconnectOutlet: function(options) {\n options = options || {};\n options.parentView = options.parentView ? options.parentView.replace(/\\//g, '.') : parentTemplate(this);\n options.outlet = options.outlet || 'main';\n\n var parentView = this.router._lookupActiveView(options.parentView);\n parentView.disconnectOutlet(options.outlet);\n },\n\n willDestroy: function() {\n this.teardownViews();\n },\n\n /**\n @private\n\n @method teardownViews\n */\n teardownViews: function() {\n // Tear down the top level view\n if (this.teardownTopLevelView) { this.teardownTopLevelView(); }\n\n // Tear down any outlets rendered with 'into'\n var teardownOutletViews = this.teardownOutletViews || [];\n a_forEach(teardownOutletViews, function(teardownOutletView) {\n teardownOutletView();\n });\n\n delete this.teardownTopLevelView;\n delete this.teardownOutletViews;\n delete this.lastRenderedTemplate;\n }\n});\n\nfunction parentRoute(route) {\n var handlerInfos = route.router.router.targetHandlerInfos;\n\n if (!handlerInfos) { return; }\n\n var parent, current;\n\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n current = handlerInfos[i].handler;\n if (current === route) { return parent; }\n parent = current;\n }\n}\n\nfunction parentTemplate(route) {\n var parent = parentRoute(route), template;\n\n if (!parent) { return; }\n\n if (template = parent.lastRenderedTemplate) {\n return template;\n } else {\n return parentTemplate(parent);\n }\n}\n\nfunction normalizeOptions(route, name, template, options) {\n options = options || {};\n options.into = options.into ? options.into.replace(/\\//g, '.') : parentTemplate(route);\n options.outlet = options.outlet || 'main';\n options.name = name;\n options.template = template;\n options.LOG_VIEW_LOOKUPS = get(route.router, 'namespace.LOG_VIEW_LOOKUPS');\n\n Ember.assert(\"An outlet (\"+options.outlet+\") was specified but was not found.\", options.outlet === 'main' || options.into);\n\n var controller = options.controller, namedController;\n\n if (options.controller) {\n controller = options.controller;\n } else if (namedController = route.container.lookup('controller:' + name)) {\n controller = namedController;\n } else {\n controller = route.controllerName || route.routeName;\n }\n\n if (typeof controller === 'string') {\n controller = route.container.lookup('controller:' + controller);\n }\n\n options.controller = controller;\n\n return options;\n}\n\nfunction setupView(view, container, options) {\n if (view) {\n if (options.LOG_VIEW_LOOKUPS) {\n Ember.Logger.info(\"Rendering \" + options.name + \" with \" + view, { fullName: 'view:' + options.name });\n }\n } else {\n var defaultView = options.into ? 'view:default' : 'view:toplevel';\n view = container.lookup(defaultView);\n if (options.LOG_VIEW_LOOKUPS) {\n Ember.Logger.info(\"Rendering \" + options.name + \" with default view \" + view, { fullName: 'view:' + options.name });\n }\n }\n\n if (!get(view, 'templateName')) {\n set(view, 'template', options.template);\n\n set(view, '_debugTemplateName', options.name);\n }\n\n set(view, 'renderedName', options.name);\n set(view, 'controller', options.controller);\n\n return view;\n}\n\nfunction appendView(route, view, options) {\n if (options.into) {\n var parentView = route.router._lookupActiveView(options.into);\n var teardownOutletView = generateOutletTeardown(parentView, options.outlet);\n if (!route.teardownOutletViews) { route.teardownOutletViews = []; }\n a_replace(route.teardownOutletViews, 0, 0, [teardownOutletView]);\n parentView.connectOutlet(options.outlet, view);\n } else {\n var rootElement = get(route, 'router.namespace.rootElement');\n // tear down view if one is already rendered\n if (route.teardownTopLevelView) {\n route.teardownTopLevelView();\n }\n route.router._connectActiveView(options.name, view);\n route.teardownTopLevelView = generateTopLevelTeardown(view);\n view.appendTo(rootElement);\n }\n}\n\nfunction generateTopLevelTeardown(view) {\n return function() { view.destroy(); };\n}\n\nfunction generateOutletTeardown(parentView, outlet) {\n return function() { parentView.disconnectOutlet(outlet); };\n}\n\nfunction findChildRouteName(route, name) {\n var container = route.container;\n\n var childName = route.routeName === 'application' ? name : route.routeName + '.' + name;\n\n var hasChild = route.router.hasRoute(childName) &&\n (container.has('template:' + childName) ||\n container.has('route:' + childName));\n\n return hasChild && childName;\n}\n\n\n})();\n//@ sourceURL=ember-routing/system/route");minispade.register('ember-routing/system/router', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar Router = requireModule(\"router\");\nvar get = Ember.get, set = Ember.set;\nvar defineProperty = Ember.defineProperty;\n\nvar DefaultView = Ember._MetamorphView;\nminispade.require(\"ember-routing/system/dsl\");\n\n/**\n The `Ember.Router` class manages the application state and URLs. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Router\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.Router = Ember.Object.extend(Ember.Evented, {\n location: 'hash',\n\n init: function() {\n this.router = this.constructor.router || this.constructor.map(Ember.K);\n this._activeViews = {};\n this._setupLocation();\n },\n\n url: Ember.computed(function() {\n return get(this, 'location').getURL();\n }),\n\n startRouting: function() {\n this.router = this.router || this.constructor.map(Ember.K);\n\n var router = this.router,\n location = get(this, 'location'),\n container = this.container,\n self = this;\n\n this._setupRouter(router, location);\n\n container.register('view:default', DefaultView);\n container.register('view:toplevel', Ember.View.extend());\n\n location.onUpdateURL(function(url) {\n self.handleURL(url);\n });\n\n this.handleURL(location.getURL());\n },\n\n didTransition: function(infos) {\n updatePaths(this);\n\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n this._cancelLoadingEvent();\n } else {\n exitLegacyLoadingRoute(this);\n }\n\n this.notifyPropertyChange('url');\n\n if (Ember.FEATURES.isEnabled(\"ember-routing-didTransition-hook\")) {\n // Put this in the runloop so url will be accurate. Seems\n // less surprising than didTransition being out of sync.\n Ember.run.once(this, this.trigger, 'didTransition');\n }\n\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Transitioned into '\" + Ember.Router._routePath(infos) + \"'\");\n }\n },\n\n handleURL: function(url) {\n return this._doTransition('handleURL', [url]);\n },\n\n transitionTo: function() {\n return this._doTransition('transitionTo', arguments);\n },\n\n intermediateTransitionTo: function() {\n this.router.intermediateTransitionTo.apply(this.router, arguments);\n\n updatePaths(this);\n\n var infos = this.router.currentHandlerInfos;\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Intermediate-transitioned into '\" + Ember.Router._routePath(infos) + \"'\");\n }\n },\n\n replaceWith: function() {\n return this._doTransition('replaceWith', arguments);\n },\n\n generate: function() {\n var url = this.router.generate.apply(this.router, arguments);\n return this.location.formatURL(url);\n },\n\n isActive: function(routeName) {\n var router = this.router;\n return router.isActive.apply(router, arguments);\n },\n\n send: function(name, context) {\n this.router.trigger.apply(this.router, arguments);\n },\n\n hasRoute: function(route) {\n return this.router.hasRoute(route);\n },\n\n /**\n @private\n\n Resets the state of the router by clearing the current route\n handlers and deactivating them.\n\n @method reset\n */\n reset: function() {\n this.router.reset();\n },\n\n _lookupActiveView: function(templateName) {\n var active = this._activeViews[templateName];\n return active && active[0];\n },\n\n _connectActiveView: function(templateName, view) {\n var existing = this._activeViews[templateName];\n\n if (existing) {\n existing[0].off('willDestroyElement', this, existing[1]);\n }\n\n var disconnect = function() {\n delete this._activeViews[templateName];\n };\n\n this._activeViews[templateName] = [view, disconnect];\n view.one('willDestroyElement', this, disconnect);\n },\n\n _setupLocation: function() {\n var location = get(this, 'location'),\n rootURL = get(this, 'rootURL'),\n options = {};\n\n if (typeof rootURL === 'string') {\n options.rootURL = rootURL;\n }\n\n if ('string' === typeof location) {\n options.implementation = location;\n location = set(this, 'location', Ember.Location.create(options));\n }\n },\n\n _getHandlerFunction: function() {\n var seen = {}, container = this.container,\n DefaultRoute = container.lookupFactory('route:basic'),\n self = this;\n\n return function(name) {\n var routeName = 'route:' + name,\n handler = container.lookup(routeName);\n\n if (seen[name]) { return handler; }\n\n seen[name] = true;\n\n if (!handler) {\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n } else {\n if (name === 'loading') { return {}; }\n }\n\n container.register(routeName, DefaultRoute.extend());\n handler = container.lookup(routeName);\n\n if (get(self, 'namespace.LOG_ACTIVE_GENERATION')) {\n Ember.Logger.info(\"generated -> \" + routeName, { fullName: routeName });\n }\n }\n\n handler.routeName = name;\n return handler;\n };\n },\n\n _setupRouter: function(router, location) {\n var lastURL, emberRouter = this;\n\n router.getHandler = this._getHandlerFunction();\n\n var doUpdateURL = function() {\n location.setURL(lastURL);\n };\n\n router.updateURL = function(path) {\n lastURL = path;\n Ember.run.once(doUpdateURL);\n };\n\n if (location.replaceURL) {\n var doReplaceURL = function() {\n location.replaceURL(lastURL);\n };\n\n router.replaceURL = function(path) {\n lastURL = path;\n Ember.run.once(doReplaceURL);\n };\n }\n\n router.didTransition = function(infos) {\n emberRouter.didTransition(infos);\n };\n },\n\n _doTransition: function(method, args) {\n // Normalize blank route to root URL.\n args = [].slice.call(args);\n args[0] = args[0] || '/';\n\n var passedName = args[0], name, self = this,\n isQueryParamsOnly = false;\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n isQueryParamsOnly = (args.length === 1 && args[0].hasOwnProperty('queryParams'));\n }\n\n if (!isQueryParamsOnly && passedName.charAt(0) === '/') {\n name = passedName;\n } else if (!isQueryParamsOnly) {\n if (!this.router.hasRoute(passedName)) {\n name = args[0] = passedName + '.index';\n } else {\n name = passedName;\n }\n\n Ember.assert(\"The route \" + passedName + \" was not found\", this.router.hasRoute(name));\n }\n\n var transitionPromise = this.router[method].apply(this.router, args);\n\n // Don't schedule loading state entry if user has already aborted the transition.\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n } else {\n scheduleLegacyLoadingRouteEntry(this);\n }\n\n transitionPromise.then(null, function(error) {\n if (error.name === \"UnrecognizedURLError\") {\n Ember.assert(\"The URL '\" + error.message + \"' did not match any routes in your application\");\n }\n });\n\n // We want to return the configurable promise object\n // so that callers of this function can use `.method()` on it,\n // which obviously doesn't exist for normal RSVP promises.\n return transitionPromise;\n },\n\n _scheduleLoadingEvent: function(transition, originRoute) {\n this._cancelLoadingEvent();\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n this._loadingStateTimer = Ember.run.scheduleOnce('routerTransitions', this, '_fireLoadingEvent', transition, originRoute);\n }\n },\n\n _fireLoadingEvent: function(transition, originRoute) {\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n if (!this.router.activeTransition) {\n // Don't fire an event if we've since moved on from\n // the transition that put us in a loading state.\n return;\n }\n\n transition.trigger(true, 'loading', transition, originRoute);\n } else {\n enterLegacyLoadingRoute(this);\n }\n },\n\n _cancelLoadingEvent: function () {\n if (this._loadingStateTimer) {\n Ember.run.cancel(this._loadingStateTimer);\n }\n this._loadingStateTimer = null;\n }\n});\n\nfunction triggerEvent(handlerInfos, ignoreFailure, args) {\n var name = args.shift();\n\n if (!handlerInfos) {\n if (ignoreFailure) { return; }\n throw new Ember.Error(\"Could not trigger event '\" + name + \"'. There are no active handlers\");\n }\n\n var eventWasHandled = false;\n\n for (var i=handlerInfos.length-1; i>=0; i--) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler._actions && handler._actions[name]) {\n if (handler._actions[name].apply(handler, args) === true) {\n eventWasHandled = true;\n } else {\n return;\n }\n }\n }\n\n if (!eventWasHandled && !ignoreFailure) {\n throw new Ember.Error(\"Nothing handled the action '\" + name + \"'. If you did handle the action, this error can be caused by returning true from an action handler, causing the action to bubble.\");\n }\n}\n\nfunction updatePaths(router) {\n var appController = router.container.lookup('controller:application'),\n infos = router.router.currentHandlerInfos,\n path = Ember.Router._routePath(infos);\n\n if (!('currentPath' in appController)) {\n defineProperty(appController, 'currentPath');\n }\n\n set(appController, 'currentPath', path);\n\n if (!('currentRouteName' in appController)) {\n defineProperty(appController, 'currentRouteName');\n }\n\n set(appController, 'currentRouteName', infos[infos.length - 1].name);\n}\n\nfunction scheduleLegacyLoadingRouteEntry(router) {\n cancelLegacyLoadingRouteEntry(router);\n if (router.router.activeTransition) {\n router._legacyLoadingStateTimer = Ember.run.scheduleOnce('routerTransitions', null, enterLegacyLoadingRoute, router);\n }\n}\n\nfunction enterLegacyLoadingRoute(router) {\n var loadingRoute = router.router.getHandler('loading');\n if (loadingRoute && !loadingRoute._loadingStateActive) {\n if (loadingRoute.enter) { loadingRoute.enter(); }\n if (loadingRoute.setup) { loadingRoute.setup(); }\n loadingRoute._loadingStateActive = true;\n }\n}\n\nfunction cancelLegacyLoadingRouteEntry(router) {\n if (router._legacyLoadingStateTimer) {\n Ember.run.cancel(router._legacyLoadingStateTimer);\n }\n router._legacyLoadingStateTimer = null;\n}\n\nfunction exitLegacyLoadingRoute(router) {\n\n cancelLegacyLoadingRouteEntry(router);\n\n var loadingRoute = router.router.getHandler('loading');\n\n if (loadingRoute && loadingRoute._loadingStateActive) {\n if (loadingRoute.exit) { loadingRoute.exit(); }\n loadingRoute._loadingStateActive = false;\n }\n}\n\nEmber.Router.reopenClass({\n router: null,\n map: function(callback) {\n var router = this.router;\n if (!router) {\n router = new Router();\n router.callbacks = [];\n router.triggerEvent = triggerEvent;\n this.reopenClass({ router: router });\n }\n\n if (get(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) {\n router.log = Ember.Logger.debug;\n }\n\n var dsl = Ember.RouterDSL.map(function() {\n this.resource('application', { path: \"/\" }, function() {\n for (var i=0; i < router.callbacks.length; i++) {\n router.callbacks[i].call(this);\n }\n callback.call(this);\n });\n });\n\n router.callbacks.push(callback);\n router.map(dsl.generate());\n return router;\n },\n\n _routePath: function(handlerInfos) {\n var path = [];\n\n for (var i=1, l=handlerInfos.length; i<l; i++) {\n var name = handlerInfos[i].name,\n nameParts = name.split(\".\");\n\n path.push(nameParts[nameParts.length - 1]);\n }\n\n return path.join(\".\");\n }\n});\n\nRouter.Transition.prototype.send = Router.Transition.prototype.trigger;\n\n\n\n})();\n//@ sourceURL=ember-routing/system/router");minispade.register('ember-routing/vendor/route-recognizer', "(function() {define(\"route-recognizer\",\n [],\n function() {\n \"use strict\";\n var specials = [\n '/', '.', '*', '+', '?', '|',\n '(', ')', '[', ']', '{', '}', '\\\\'\n ];\n\n var escapeRegex = new RegExp('(\\\\' + specials.join('|\\\\') + ')', 'g');\n\n // A Segment represents a segment in the original route description.\n // Each Segment type provides an `eachChar` and `regex` method.\n //\n // The `eachChar` method invokes the callback with one or more character\n // specifications. A character specification consumes one or more input\n // characters.\n //\n // The `regex` method returns a regex fragment for the segment. If the\n // segment is a dynamic of star segment, the regex fragment also includes\n // a capture.\n //\n // A character specification contains:\n //\n // * `validChars`: a String with a list of all valid characters, or\n // * `invalidChars`: a String with a list of all invalid characters\n // * `repeat`: true if the character specification can repeat\n\n function StaticSegment(string) { this.string = string; }\n StaticSegment.prototype = {\n eachChar: function(callback) {\n var string = this.string, char;\n\n for (var i=0, l=string.length; i<l; i++) {\n char = string.charAt(i);\n callback({ validChars: char });\n }\n },\n\n regex: function() {\n return this.string.replace(escapeRegex, '\\\\$1');\n },\n\n generate: function() {\n return this.string;\n }\n };\n\n function DynamicSegment(name) { this.name = name; }\n DynamicSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"/\", repeat: true });\n },\n\n regex: function() {\n return \"([^/]+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function StarSegment(name) { this.name = name; }\n StarSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"\", repeat: true });\n },\n\n regex: function() {\n return \"(.+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function EpsilonSegment() {}\n EpsilonSegment.prototype = {\n eachChar: function() {},\n regex: function() { return \"\"; },\n generate: function() { return \"\"; }\n };\n\n function parse(route, names, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.charAt(0) === \"/\") { route = route.substr(1); }\n\n var segments = route.split(\"/\"), results = [];\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i], match;\n\n if (match = segment.match(/^:([^\\/]+)$/)) {\n results.push(new DynamicSegment(match[1]));\n names.push(match[1]);\n types.dynamics++;\n } else if (match = segment.match(/^\\*([^\\/]+)$/)) {\n results.push(new StarSegment(match[1]));\n names.push(match[1]);\n types.stars++;\n } else if(segment === \"\") {\n results.push(new EpsilonSegment());\n } else {\n results.push(new StaticSegment(segment));\n types.statics++;\n }\n }\n\n return results;\n }\n\n // A State has a character specification and (`charSpec`) and a list of possible\n // subsequent states (`nextStates`).\n //\n // If a State is an accepting state, it will also have several additional\n // properties:\n //\n // * `regex`: A regular expression that is used to extract parameters from paths\n // that reached this accepting state.\n // * `handlers`: Information on how to convert the list of captures into calls\n // to registered handlers with the specified parameters\n // * `types`: How many static, dynamic or star segments in this route. Used to\n // decide which route to use if multiple registered routes match a path.\n //\n // Currently, State is implemented naively by looping over `nextStates` and\n // comparing a character specification against a character. A more efficient\n // implementation would use a hash of keys pointing at one or more next states.\n\n function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }\n\n State.prototype = {\n get: function(charSpec) {\n var nextStates = this.nextStates;\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n var child = nextStates[i];\n\n var isEqual = child.charSpec.validChars === charSpec.validChars;\n isEqual = isEqual && child.charSpec.invalidChars === charSpec.invalidChars;\n\n if (isEqual) { return child; }\n }\n },\n\n put: function(charSpec) {\n var state;\n\n // If the character specification already exists in a child of the current\n // state, just return that state.\n if (state = this.get(charSpec)) { return state; }\n\n // Make a new state for the character spec\n state = new State(charSpec);\n\n // Insert the new state as a child of the current state\n this.nextStates.push(state);\n\n // If this character specification repeats, insert the new state as a child\n // of itself. Note that this will not trigger an infinite loop because each\n // transition during recognition consumes a character.\n if (charSpec.repeat) {\n state.nextStates.push(state);\n }\n\n // Return the new state\n return state;\n },\n\n // Find a list of child states matching the next character\n match: function(char) {\n // DEBUG \"Processing `\" + char + \"`:\"\n var nextStates = this.nextStates,\n child, charSpec, chars;\n\n // DEBUG \" \" + debugState(this)\n var returned = [];\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n child = nextStates[i];\n\n charSpec = child.charSpec;\n\n if (typeof (chars = charSpec.validChars) !== 'undefined') {\n if (chars.indexOf(char) !== -1) { returned.push(child); }\n } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') {\n if (chars.indexOf(char) === -1) { returned.push(child); }\n }\n }\n\n return returned;\n }\n\n /** IF DEBUG\n , debug: function() {\n var charSpec = this.charSpec,\n debug = \"[\",\n chars = charSpec.validChars || charSpec.invalidChars;\n\n if (charSpec.invalidChars) { debug += \"^\"; }\n debug += chars;\n debug += \"]\";\n\n if (charSpec.repeat) { debug += \"+\"; }\n\n return debug;\n }\n END IF **/\n };\n\n /** IF DEBUG\n function debug(log) {\n console.log(log);\n }\n\n function debugState(state) {\n return state.nextStates.map(function(n) {\n if (n.nextStates.length === 0) { return \"( \" + n.debug() + \" [accepting] )\"; }\n return \"( \" + n.debug() + \" <then> \" + n.nextStates.map(function(s) { return s.debug() }).join(\" or \") + \" )\";\n }).join(\", \")\n }\n END IF **/\n\n // This is a somewhat naive strategy, but should work in a lot of cases\n // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id\n function sortSolutions(states) {\n return states.sort(function(a, b) {\n if (a.types.stars !== b.types.stars) { return a.types.stars - b.types.stars; }\n if (a.types.dynamics !== b.types.dynamics) { return a.types.dynamics - b.types.dynamics; }\n if (a.types.statics !== b.types.statics) { return a.types.statics - b.types.statics; }\n\n return 0;\n });\n }\n\n function recognizeChar(states, char) {\n var nextStates = [];\n\n for (var i=0, l=states.length; i<l; i++) {\n var state = states[i];\n\n nextStates = nextStates.concat(state.match(char));\n }\n\n return nextStates;\n }\n\n function findHandler(state, path, queryParams) {\n var handlers = state.handlers, regex = state.regex;\n var captures = path.match(regex), currentCapture = 1;\n var result = [];\n\n for (var i=0, l=handlers.length; i<l; i++) {\n var handler = handlers[i], names = handler.names, params = {},\n watchedQueryParams = handler.queryParams || [],\n activeQueryParams = {},\n j, m;\n\n for (j=0, m=names.length; j<m; j++) {\n params[names[j]] = captures[currentCapture++];\n }\n for (j=0, m=watchedQueryParams.length; j < m; j++) {\n var key = watchedQueryParams[j];\n if(queryParams[key]){\n activeQueryParams[key] = queryParams[key];\n }\n }\n var currentResult = { handler: handler.handler, params: params, isDynamic: !!names.length };\n if(watchedQueryParams && watchedQueryParams.length > 0) {\n currentResult.queryParams = activeQueryParams;\n }\n result.push(currentResult);\n }\n\n return result;\n }\n\n function addSegment(currentState, segment) {\n segment.eachChar(function(char) {\n var state;\n\n currentState = currentState.put(char);\n });\n\n return currentState;\n }\n\n // The main interface\n\n var RouteRecognizer = function() {\n this.rootState = new State();\n this.names = {};\n };\n\n\n RouteRecognizer.prototype = {\n add: function(routes, options) {\n var currentState = this.rootState, regex = \"^\",\n types = { statics: 0, dynamics: 0, stars: 0 },\n handlers = [], allSegments = [], name;\n\n var isEmpty = true;\n\n for (var i=0, l=routes.length; i<l; i++) {\n var route = routes[i], names = [];\n\n var segments = parse(route.path, names, types);\n\n allSegments = allSegments.concat(segments);\n\n for (var j=0, m=segments.length; j<m; j++) {\n var segment = segments[j];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n isEmpty = false;\n\n // Add a \"/\" for the new segment\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n\n // Add a representation of the segment to the NFA and regex\n currentState = addSegment(currentState, segment);\n regex += segment.regex();\n }\n\n var handler = { handler: route.handler, names: names };\n if(route.queryParams) {\n handler.queryParams = route.queryParams;\n }\n handlers.push(handler);\n }\n\n if (isEmpty) {\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n }\n\n currentState.handlers = handlers;\n currentState.regex = new RegExp(regex + \"$\");\n currentState.types = types;\n\n if (name = options && options.as) {\n this.names[name] = {\n segments: allSegments,\n handlers: handlers\n };\n }\n },\n\n handlersFor: function(name) {\n var route = this.names[name], result = [];\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n for (var i=0, l=route.handlers.length; i<l; i++) {\n result.push(route.handlers[i]);\n }\n\n return result;\n },\n\n hasRoute: function(name) {\n return !!this.names[name];\n },\n\n generate: function(name, params) {\n var route = this.names[name], output = \"\";\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n var segments = route.segments;\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n output += \"/\";\n output += segment.generate(params);\n }\n\n if (output.charAt(0) !== '/') { output = '/' + output; }\n\n if (params && params.queryParams) {\n output += this.generateQueryString(params.queryParams, route.handlers);\n }\n\n return output;\n },\n\n generateQueryString: function(params, handlers) {\n var pairs = [], allowedParams = [];\n for(var i=0; i < handlers.length; i++) {\n var currentParamList = handlers[i].queryParams;\n if(currentParamList) {\n allowedParams.push.apply(allowedParams, currentParamList);\n }\n }\n for(var key in params) {\n if (params.hasOwnProperty(key)) {\n if(allowedParams.indexOf(key) === -1) {\n throw 'Query param \"' + key + '\" is not specified as a valid param for this route';\n }\n var value = params[key];\n var pair = encodeURIComponent(key);\n if(value !== true) {\n pair += \"=\" + encodeURIComponent(value);\n }\n pairs.push(pair);\n }\n }\n\n if (pairs.length === 0) { return ''; }\n\n return \"?\" + pairs.join(\"&\");\n },\n\n parseQueryString: function(queryString) {\n var pairs = queryString.split(\"&\"), queryParams = {};\n for(var i=0; i < pairs.length; i++) {\n var pair = pairs[i].split('='),\n key = decodeURIComponent(pair[0]),\n value = pair[1] ? decodeURIComponent(pair[1]) : true;\n queryParams[key] = value;\n }\n return queryParams;\n },\n\n recognize: function(path) {\n var states = [ this.rootState ],\n pathLen, i, l, queryStart, queryParams = {};\n\n queryStart = path.indexOf('?');\n if (queryStart !== -1) {\n var queryString = path.substr(queryStart + 1, path.length);\n path = path.substr(0, queryStart);\n queryParams = this.parseQueryString(queryString);\n }\n\n // DEBUG GROUP path\n\n if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\n pathLen = path.length;\n if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n path = path.substr(0, pathLen - 1);\n }\n\n for (i=0, l=path.length; i<l; i++) {\n states = recognizeChar(states, path.charAt(i));\n if (!states.length) { break; }\n }\n\n // END DEBUG GROUP\n\n var solutions = [];\n for (i=0, l=states.length; i<l; i++) {\n if (states[i].handlers) { solutions.push(states[i]); }\n }\n\n states = sortSolutions(solutions);\n\n var state = solutions[0];\n\n if (state && state.handlers) {\n return findHandler(state, path, queryParams);\n }\n }\n };\n\n function Target(path, matcher, delegate) {\n this.path = path;\n this.matcher = matcher;\n this.delegate = delegate;\n }\n\n Target.prototype = {\n to: function(target, callback) {\n var delegate = this.delegate;\n\n if (delegate && delegate.willAddRoute) {\n target = delegate.willAddRoute(this.matcher.target, target);\n }\n\n this.matcher.add(this.path, target);\n\n if (callback) {\n if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n this.matcher.addChild(this.path, target, callback, this.delegate);\n }\n return this;\n },\n\n withQueryParams: function() {\n if (arguments.length === 0) { throw new Error(\"you must provide arguments to the withQueryParams method\"); }\n for (var i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] !== \"string\") {\n throw new Error('you should call withQueryParams with a list of strings, e.g. withQueryParams(\"foo\", \"bar\")');\n }\n }\n var queryParams = [].slice.call(arguments);\n this.matcher.addQueryParams(this.path, queryParams);\n }\n };\n\n function Matcher(target) {\n this.routes = {};\n this.children = {};\n this.queryParams = {};\n this.target = target;\n }\n\n Matcher.prototype = {\n add: function(path, handler) {\n this.routes[path] = handler;\n },\n\n addQueryParams: function(path, params) {\n this.queryParams[path] = params;\n },\n\n addChild: function(path, target, callback, delegate) {\n var matcher = new Matcher(target);\n this.children[path] = matcher;\n\n var match = generateMatch(path, matcher, delegate);\n\n if (delegate && delegate.contextEntered) {\n delegate.contextEntered(target, match);\n }\n\n callback(match);\n }\n };\n\n function generateMatch(startingPath, matcher, delegate) {\n return function(path, nestedCallback) {\n var fullPath = startingPath + path;\n\n if (nestedCallback) {\n nestedCallback(generateMatch(fullPath, matcher, delegate));\n } else {\n return new Target(startingPath + path, matcher, delegate);\n }\n };\n }\n\n function addRoute(routeArray, path, handler, queryParams) {\n var len = 0;\n for (var i=0, l=routeArray.length; i<l; i++) {\n len += routeArray[i].path.length;\n }\n\n path = path.substr(len);\n var route = { path: path, handler: handler };\n if(queryParams) { route.queryParams = queryParams; }\n routeArray.push(route);\n }\n\n function eachRoute(baseRoute, matcher, callback, binding) {\n var routes = matcher.routes;\n var queryParams = matcher.queryParams;\n\n for (var path in routes) {\n if (routes.hasOwnProperty(path)) {\n var routeArray = baseRoute.slice();\n addRoute(routeArray, path, routes[path], queryParams[path]);\n\n if (matcher.children[path]) {\n eachRoute(routeArray, matcher.children[path], callback, binding);\n } else {\n callback.call(binding, routeArray);\n }\n }\n }\n }\n\n RouteRecognizer.prototype.map = function(callback, addRouteCallback) {\n var matcher = new Matcher();\n\n callback(generateMatch(\"\", matcher, this.delegate));\n\n eachRoute([], matcher, function(route) {\n if (addRouteCallback) { addRouteCallback(this, route); }\n else { this.add(route); }\n }, this);\n };\n return RouteRecognizer;\n });\n\n})();\n//@ sourceURL=ember-routing/vendor/route-recognizer");minispade.register('ember-routing/vendor/router', "(function() {define(\"router\",\n [\"route-recognizer\",\"rsvp\"],\n function(RouteRecognizer, RSVP) {\n \"use strict\";\n /**\n @private\n\n This file references several internal structures:\n\n ## `RecognizedHandler`\n\n * `{String} handler`: A handler name\n * `{Object} params`: A hash of recognized parameters\n\n ## `HandlerInfo`\n\n * `{Boolean} isDynamic`: whether a handler has any dynamic segments\n * `{String} name`: the name of a handler\n * `{Object} handler`: a handler object\n * `{Object} context`: the active context for the handler\n */\n\n\n var slice = Array.prototype.slice;\n\n\n\n /**\n @private\n\n A Transition is a thennable (a promise-like object) that represents\n an attempt to transition to another route. It can be aborted, either\n explicitly via `abort` or by attempting another transition while a\n previous one is still underway. An aborted transition can also\n be `retry()`d later.\n */\n\n function Transition(router, promise) {\n this.router = router;\n this.promise = promise;\n this.data = {};\n this.resolvedModels = {};\n this.providedModels = {};\n this.providedModelsArray = [];\n this.sequence = ++Transition.currentSequence;\n this.params = {};\n }\n\n Transition.currentSequence = 0;\n\n Transition.prototype = {\n targetName: null,\n urlMethod: 'update',\n providedModels: null,\n resolvedModels: null,\n params: null,\n pivotHandler: null,\n resolveIndex: 0,\n handlerInfos: null,\n\n isActive: true,\n\n /**\n The Transition's internal promise. Calling `.then` on this property\n is that same as calling `.then` on the Transition object itself, but\n this property is exposed for when you want to pass around a\n Transition's promise, but not the Transition object itself, since\n Transition object can be externally `abort`ed, while the promise\n cannot.\n */\n promise: null,\n\n /**\n Custom state can be stored on a Transition's `data` object.\n This can be useful for decorating a Transition within an earlier\n hook and shared with a later hook. Properties set on `data` will\n be copied to new transitions generated by calling `retry` on this\n transition.\n */\n data: null,\n\n /**\n A standard promise hook that resolves if the transition\n succeeds and rejects if it fails/redirects/aborts.\n\n Forwards to the internal `promise` property which you can\n use in situations where you want to pass around a thennable,\n but not the Transition itself.\n\n @param {Function} success\n @param {Function} failure\n */\n then: function(success, failure) {\n return this.promise.then(success, failure);\n },\n\n /**\n Aborts the Transition. Note you can also implicitly abort a transition\n by initiating another transition while a previous one is underway.\n */\n abort: function() {\n if (this.isAborted) { return this; }\n log(this.router, this.sequence, this.targetName + \": transition was aborted\");\n this.isAborted = true;\n this.isActive = false;\n this.router.activeTransition = null;\n return this;\n },\n\n /**\n Retries a previously-aborted transition (making sure to abort the\n transition if it's still active). Returns a new transition that\n represents the new attempt to transition.\n */\n retry: function() {\n this.abort();\n var recogHandlers = this.router.recognizer.handlersFor(this.targetName),\n handlerInfos = generateHandlerInfosWithQueryParams(this.router, recogHandlers, this.queryParams),\n newTransition = performTransition(this.router, handlerInfos, this.providedModelsArray, this.params, this.queryParams, this.data);\n\n return newTransition;\n },\n\n /**\n Sets the URL-changing method to be employed at the end of a\n successful transition. By default, a new Transition will just\n use `updateURL`, but passing 'replace' to this method will\n cause the URL to update using 'replaceWith' instead. Omitting\n a parameter will disable the URL change, allowing for transitions\n that don't update the URL at completion (this is also used for\n handleURL, since the URL has already changed before the\n transition took place).\n\n @param {String} method the type of URL-changing method to use\n at the end of a transition. Accepted values are 'replace',\n falsy values, or any other non-falsy value (which is\n interpreted as an updateURL transition).\n\n @return {Transition} this transition\n */\n method: function(method) {\n this.urlMethod = method;\n return this;\n },\n\n /**\n Fires an event on the current list of resolved/resolving\n handlers within this transition. Useful for firing events\n on route hierarchies that haven't fully been entered yet.\n\n @param {Boolean} ignoreFailure the name of the event to fire\n @param {String} name the name of the event to fire\n */\n trigger: function(ignoreFailure) {\n var args = slice.call(arguments);\n if (typeof ignoreFailure === 'boolean') {\n args.shift();\n } else {\n // Throw errors on unhandled trigger events by default\n ignoreFailure = false;\n }\n trigger(this.router, this.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args);\n },\n\n toString: function() {\n return \"Transition (sequence \" + this.sequence + \")\";\n }\n };\n\n function Router() {\n this.recognizer = new RouteRecognizer();\n }\n\n // TODO: separate into module?\n Router.Transition = Transition;\n\n\n\n /**\n Promise reject reasons passed to promise rejection\n handlers for failed transitions.\n */\n Router.UnrecognizedURLError = function(message) {\n this.message = (message || \"UnrecognizedURLError\");\n this.name = \"UnrecognizedURLError\";\n };\n\n Router.TransitionAborted = function(message) {\n this.message = (message || \"TransitionAborted\");\n this.name = \"TransitionAborted\";\n };\n\n function errorTransition(router, reason) {\n return new Transition(router, RSVP.reject(reason));\n }\n\n\n Router.prototype = {\n /**\n The main entry point into the router. The API is essentially\n the same as the `map` method in `route-recognizer`.\n\n This method extracts the String handler at the last `.to()`\n call and uses it as the name of the whole route.\n\n @param {Function} callback\n */\n map: function(callback) {\n this.recognizer.delegate = this.delegate;\n\n this.recognizer.map(callback, function(recognizer, route) {\n var lastHandler = route[route.length - 1].handler;\n var args = [route, { as: lastHandler }];\n recognizer.add.apply(recognizer, args);\n });\n },\n\n hasRoute: function(route) {\n return this.recognizer.hasRoute(route);\n },\n\n /**\n Clears the current and target route handlers and triggers exit\n on each of them starting at the leaf and traversing up through\n its ancestors.\n */\n reset: function() {\n eachHandler(this.currentHandlerInfos || [], function(handlerInfo) {\n var handler = handlerInfo.handler;\n if (handler.exit) {\n handler.exit();\n }\n });\n this.currentHandlerInfos = null;\n this.targetHandlerInfos = null;\n },\n\n activeTransition: null,\n\n /**\n var handler = handlerInfo.handler;\n The entry point for handling a change to the URL (usually\n via the back and forward button).\n\n Returns an Array of handlers and the parameters associated\n with those parameters.\n\n @param {String} url a URL to process\n\n @return {Array} an Array of `[handler, parameter]` tuples\n */\n handleURL: function(url) {\n // Perform a URL-based transition, but don't change\n // the URL afterward, since it already happened.\n var args = slice.call(arguments);\n if (url.charAt(0) !== '/') { args[0] = '/' + url; }\n return doTransition(this, args).method(null);\n },\n\n /**\n Hook point for updating the URL.\n\n @param {String} url a URL to update to\n */\n updateURL: function() {\n throw new Error(\"updateURL is not implemented\");\n },\n\n /**\n Hook point for replacing the current URL, i.e. with replaceState\n\n By default this behaves the same as `updateURL`\n\n @param {String} url a URL to update to\n */\n replaceURL: function(url) {\n this.updateURL(url);\n },\n\n /**\n Transition into the specified named route.\n\n If necessary, trigger the exit callback on any handlers\n that are no longer represented by the target route.\n\n @param {String} name the name of the route\n */\n transitionTo: function(name) {\n return doTransition(this, arguments);\n },\n\n intermediateTransitionTo: function(name) {\n doTransition(this, arguments, true);\n },\n\n /**\n Identical to `transitionTo` except that the current URL will be replaced\n if possible.\n\n This method is intended primarily for use with `replaceState`.\n\n @param {String} name the name of the route\n */\n replaceWith: function(name) {\n return doTransition(this, arguments).method('replace');\n },\n\n /**\n @private\n\n This method takes a handler name and a list of contexts and returns\n a serialized parameter hash suitable to pass to `recognizer.generate()`.\n\n @param {String} handlerName\n @param {Array[Object]} contexts\n @return {Object} a serialized parameter hash\n */\n\n paramsForHandler: function(handlerName, contexts) {\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1));\n return paramsForHandler(this, handlerName, partitionedArgs[0], partitionedArgs[1]);\n },\n\n /**\n This method takes a handler name and returns a list of query params\n that are valid to pass to the handler or its parents\n\n @param {String} handlerName\n @return {Array[String]} a list of query parameters\n */\n queryParamsForHandler: function (handlerName) {\n return queryParamsForHandler(this, handlerName);\n },\n\n /**\n Take a named route and context objects and generate a\n URL.\n\n @param {String} name the name of the route to generate\n a URL for\n @param {...Object} objects a list of objects to serialize\n\n @return {String} a URL\n */\n generate: function(handlerName) {\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1)),\n suppliedParams = partitionedArgs[0],\n queryParams = partitionedArgs[1];\n\n var params = paramsForHandler(this, handlerName, suppliedParams, queryParams),\n validQueryParams = queryParamsForHandler(this, handlerName);\n\n var missingParams = [];\n\n for (var key in queryParams) {\n if (queryParams.hasOwnProperty(key) && !~validQueryParams.indexOf(key)) {\n missingParams.push(key);\n }\n }\n\n if (missingParams.length > 0) {\n var err = 'You supplied the params ';\n err += missingParams.map(function(param) {\n return '\"' + param + \"=\" + queryParams[param] + '\"';\n }).join(' and ');\n\n err += ' which are not valid for the \"' + handlerName + '\" handler or its parents';\n\n throw new Error(err);\n }\n\n return this.recognizer.generate(handlerName, params);\n },\n\n isActive: function(handlerName) {\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1)),\n contexts = partitionedArgs[0],\n queryParams = partitionedArgs[1],\n activeQueryParams = {},\n effectiveQueryParams = {};\n\n var targetHandlerInfos = this.targetHandlerInfos,\n found = false, names, object, handlerInfo, handlerObj;\n\n if (!targetHandlerInfos) { return false; }\n\n var recogHandlers = this.recognizer.handlersFor(targetHandlerInfos[targetHandlerInfos.length - 1].name);\n for (var i=targetHandlerInfos.length-1; i>=0; i--) {\n handlerInfo = targetHandlerInfos[i];\n if (handlerInfo.name === handlerName) { found = true; }\n\n if (found) {\n var recogHandler = recogHandlers[i];\n\n merge(activeQueryParams, handlerInfo.queryParams);\n if (queryParams !== false) {\n merge(effectiveQueryParams, handlerInfo.queryParams);\n mergeSomeKeys(effectiveQueryParams, queryParams, recogHandler.queryParams);\n }\n\n if (handlerInfo.isDynamic && contexts.length > 0) {\n object = contexts.pop();\n\n if (isParam(object)) {\n var name = recogHandler.names[0];\n if (\"\" + object !== this.currentParams[name]) { return false; }\n } else if (handlerInfo.context !== object) {\n return false;\n }\n }\n }\n }\n\n\n return contexts.length === 0 && found && queryParamsEqual(activeQueryParams, effectiveQueryParams);\n },\n\n trigger: function(name) {\n var args = slice.call(arguments);\n trigger(this, this.currentHandlerInfos, false, args);\n },\n\n /**\n Hook point for logging transition status updates.\n\n @param {String} message The message to log.\n */\n log: null\n };\n\n /**\n @private\n\n Used internally for both URL and named transition to determine\n a shared pivot parent route and other data necessary to perform\n a transition.\n */\n function getMatchPoint(router, handlers, objects, inputParams, queryParams) {\n\n var matchPoint = handlers.length,\n providedModels = {}, i,\n currentHandlerInfos = router.currentHandlerInfos || [],\n params = {},\n oldParams = router.currentParams || {},\n activeTransition = router.activeTransition,\n handlerParams = {},\n obj;\n\n objects = slice.call(objects);\n merge(params, inputParams);\n\n for (i = handlers.length - 1; i >= 0; i--) {\n var handlerObj = handlers[i],\n handlerName = handlerObj.handler,\n oldHandlerInfo = currentHandlerInfos[i],\n hasChanged = false;\n\n // Check if handler names have changed.\n if (!oldHandlerInfo || oldHandlerInfo.name !== handlerObj.handler) { hasChanged = true; }\n\n if (handlerObj.isDynamic) {\n // URL transition.\n\n if (obj = getMatchPointObject(objects, handlerName, activeTransition, true, params)) {\n hasChanged = true;\n providedModels[handlerName] = obj;\n } else {\n handlerParams[handlerName] = {};\n for (var prop in handlerObj.params) {\n if (!handlerObj.params.hasOwnProperty(prop)) { continue; }\n var newParam = handlerObj.params[prop];\n if (oldParams[prop] !== newParam) { hasChanged = true; }\n handlerParams[handlerName][prop] = params[prop] = newParam;\n }\n }\n } else if (handlerObj.hasOwnProperty('names')) {\n // Named transition.\n\n if (objects.length) { hasChanged = true; }\n\n if (obj = getMatchPointObject(objects, handlerName, activeTransition, handlerObj.names[0], params)) {\n providedModels[handlerName] = obj;\n } else {\n var names = handlerObj.names;\n handlerParams[handlerName] = {};\n for (var j = 0, len = names.length; j < len; ++j) {\n var name = names[j];\n handlerParams[handlerName][name] = params[name] = params[name] || oldParams[name];\n }\n }\n }\n\n // If there is an old handler, see if query params are the same. If there isn't an old handler,\n // hasChanged will already be true here\n if(oldHandlerInfo && !queryParamsEqual(oldHandlerInfo.queryParams, handlerObj.queryParams)) {\n hasChanged = true;\n }\n\n if (hasChanged) { matchPoint = i; }\n }\n\n if (objects.length > 0) {\n throw new Error(\"More context objects were passed than there are dynamic segments for the route: \" + handlers[handlers.length - 1].handler);\n }\n\n var pivotHandlerInfo = currentHandlerInfos[matchPoint - 1],\n pivotHandler = pivotHandlerInfo && pivotHandlerInfo.handler;\n\n return { matchPoint: matchPoint, providedModels: providedModels, params: params, handlerParams: handlerParams, pivotHandler: pivotHandler };\n }\n\n function getMatchPointObject(objects, handlerName, activeTransition, paramName, params) {\n\n if (objects.length && paramName) {\n\n var object = objects.pop();\n\n // If provided object is string or number, treat as param.\n if (isParam(object)) {\n params[paramName] = object.toString();\n } else {\n return object;\n }\n } else if (activeTransition) {\n // Use model from previous transition attempt, preferably the resolved one.\n return activeTransition.resolvedModels[handlerName] ||\n (paramName && activeTransition.providedModels[handlerName]);\n }\n }\n\n function isParam(object) {\n return (typeof object === \"string\" || object instanceof String || !isNaN(object));\n }\n\n\n\n /**\n @private\n\n This method takes a handler name and returns a list of query params\n that are valid to pass to the handler or its parents\n\n @param {Router} router\n @param {String} handlerName\n @return {Array[String]} a list of query parameters\n */\n function queryParamsForHandler(router, handlerName) {\n var handlers = router.recognizer.handlersFor(handlerName),\n queryParams = [];\n\n for (var i = 0; i < handlers.length; i++) {\n queryParams.push.apply(queryParams, handlers[i].queryParams || []);\n }\n\n return queryParams;\n }\n /**\n @private\n\n This method takes a handler name and a list of contexts and returns\n a serialized parameter hash suitable to pass to `recognizer.generate()`.\n\n @param {Router} router\n @param {String} handlerName\n @param {Array[Object]} objects\n @return {Object} a serialized parameter hash\n */\n function paramsForHandler(router, handlerName, objects, queryParams) {\n\n var handlers = router.recognizer.handlersFor(handlerName),\n params = {},\n handlerInfos = generateHandlerInfosWithQueryParams(router, handlers, queryParams),\n matchPoint = getMatchPoint(router, handlerInfos, objects).matchPoint,\n mergedQueryParams = {},\n object, handlerObj, handler, names, i;\n\n params.queryParams = {};\n\n for (i=0; i<handlers.length; i++) {\n handlerObj = handlers[i];\n handler = router.getHandler(handlerObj.handler);\n names = handlerObj.names;\n\n // If it's a dynamic segment\n if (names.length) {\n // If we have objects, use them\n if (i >= matchPoint) {\n object = objects.shift();\n // Otherwise use existing context\n } else {\n object = handler.context;\n }\n\n // Serialize to generate params\n merge(params, serialize(handler, object, names));\n }\n if (queryParams !== false) {\n mergeSomeKeys(params.queryParams, router.currentQueryParams, handlerObj.queryParams);\n mergeSomeKeys(params.queryParams, queryParams, handlerObj.queryParams);\n }\n }\n\n if (queryParamsEqual(params.queryParams, {})) { delete params.queryParams; }\n return params;\n }\n\n function merge(hash, other) {\n for (var prop in other) {\n if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; }\n }\n }\n\n function mergeSomeKeys(hash, other, keys) {\n if (!other || !keys) { return; }\n for(var i = 0; i < keys.length; i++) {\n var key = keys[i], value;\n if(other.hasOwnProperty(key)) {\n value = other[key];\n if(value === null || value === false || typeof value === \"undefined\") {\n delete hash[key];\n } else {\n hash[key] = other[key];\n }\n }\n }\n }\n\n /**\n @private\n */\n\n function generateHandlerInfosWithQueryParams(router, handlers, queryParams) {\n var handlerInfos = [];\n\n for (var i = 0; i < handlers.length; i++) {\n var handler = handlers[i],\n handlerInfo = { handler: handler.handler, names: handler.names, context: handler.context, isDynamic: handler.isDynamic },\n activeQueryParams = {};\n\n if (queryParams !== false) {\n mergeSomeKeys(activeQueryParams, router.currentQueryParams, handler.queryParams);\n mergeSomeKeys(activeQueryParams, queryParams, handler.queryParams);\n }\n\n if (handler.queryParams && handler.queryParams.length > 0) {\n handlerInfo.queryParams = activeQueryParams;\n }\n\n handlerInfos.push(handlerInfo);\n }\n\n return handlerInfos;\n }\n\n /**\n @private\n */\n function createQueryParamTransition(router, queryParams, isIntermediate) {\n var currentHandlers = router.currentHandlerInfos,\n currentHandler = currentHandlers[currentHandlers.length - 1],\n name = currentHandler.name;\n\n log(router, \"Attempting query param transition\");\n\n return createNamedTransition(router, [name, queryParams], isIntermediate);\n }\n\n /**\n @private\n */\n function createNamedTransition(router, args, isIntermediate) {\n var partitionedArgs = extractQueryParams(args),\n pureArgs = partitionedArgs[0],\n queryParams = partitionedArgs[1],\n handlers = router.recognizer.handlersFor(pureArgs[0]),\n handlerInfos = generateHandlerInfosWithQueryParams(router, handlers, queryParams);\n\n\n log(router, \"Attempting transition to \" + pureArgs[0]);\n\n return performTransition(router,\n handlerInfos,\n slice.call(pureArgs, 1),\n router.currentParams,\n queryParams,\n null,\n isIntermediate);\n }\n\n /**\n @private\n */\n function createURLTransition(router, url, isIntermediate) {\n var results = router.recognizer.recognize(url),\n currentHandlerInfos = router.currentHandlerInfos,\n queryParams = {},\n i, len;\n\n log(router, \"Attempting URL transition to \" + url);\n\n if (results) {\n // Make sure this route is actually accessible by URL.\n for (i = 0, len = results.length; i < len; ++i) {\n\n if (router.getHandler(results[i].handler).inaccessiblyByURL) {\n results = null;\n break;\n }\n }\n }\n\n if (!results) {\n return errorTransition(router, new Router.UnrecognizedURLError(url));\n }\n\n for(i = 0, len = results.length; i < len; i++) {\n merge(queryParams, results[i].queryParams);\n }\n\n return performTransition(router, results, [], {}, queryParams, null, isIntermediate);\n }\n\n\n /**\n @private\n\n Takes an Array of `HandlerInfo`s, figures out which ones are\n exiting, entering, or changing contexts, and calls the\n proper handler hooks.\n\n For example, consider the following tree of handlers. Each handler is\n followed by the URL segment it handles.\n\n ```\n |~index (\"/\")\n | |~posts (\"/posts\")\n | | |-showPost (\"/:id\")\n | | |-newPost (\"/new\")\n | | |-editPost (\"/edit\")\n | |~about (\"/about/:id\")\n ```\n\n Consider the following transitions:\n\n 1. A URL transition to `/posts/1`.\n 1. Triggers the `*model` callbacks on the\n `index`, `posts`, and `showPost` handlers\n 2. Triggers the `enter` callback on the same\n 3. Triggers the `setup` callback on the same\n 2. A direct transition to `newPost`\n 1. Triggers the `exit` callback on `showPost`\n 2. Triggers the `enter` callback on `newPost`\n 3. Triggers the `setup` callback on `newPost`\n 3. A direct transition to `about` with a specified\n context object\n 1. Triggers the `exit` callback on `newPost`\n and `posts`\n 2. Triggers the `serialize` callback on `about`\n 3. Triggers the `enter` callback on `about`\n 4. Triggers the `setup` callback on `about`\n\n @param {Transition} transition\n @param {Array[HandlerInfo]} handlerInfos\n */\n function setupContexts(transition, handlerInfos) {\n var router = transition.router,\n partition = partitionHandlers(router.currentHandlerInfos || [], handlerInfos);\n\n router.targetHandlerInfos = handlerInfos;\n\n eachHandler(partition.exited, function(handlerInfo) {\n var handler = handlerInfo.handler;\n delete handler.context;\n if (handler.exit) { handler.exit(); }\n });\n\n var currentHandlerInfos = partition.unchanged.slice();\n router.currentHandlerInfos = currentHandlerInfos;\n\n eachHandler(partition.updatedContext, function(handlerInfo) {\n handlerEnteredOrUpdated(transition, currentHandlerInfos, handlerInfo, false);\n });\n\n eachHandler(partition.entered, function(handlerInfo) {\n handlerEnteredOrUpdated(transition, currentHandlerInfos, handlerInfo, true);\n });\n }\n\n /**\n @private\n\n Helper method used by setupContexts. Handles errors or redirects\n that may happen in enter/setup.\n */\n function handlerEnteredOrUpdated(transition, currentHandlerInfos, handlerInfo, enter) {\n var handler = handlerInfo.handler,\n context = handlerInfo.context;\n\n try {\n if (enter && handler.enter) { handler.enter(); }\n checkAbort(transition);\n\n setContext(handler, context);\n setQueryParams(handler, handlerInfo.queryParams);\n\n if (handler.setup) { handler.setup(context, handlerInfo.queryParams); }\n checkAbort(transition);\n } catch(e) {\n if (!(e instanceof Router.TransitionAborted)) {\n // Trigger the `error` event starting from this failed handler.\n transition.trigger(true, 'error', e, transition, handler);\n }\n\n // Propagate the error so that the transition promise will reject.\n throw e;\n }\n\n currentHandlerInfos.push(handlerInfo);\n }\n\n\n /**\n @private\n\n Iterates over an array of `HandlerInfo`s, passing the handler\n and context into the callback.\n\n @param {Array[HandlerInfo]} handlerInfos\n @param {Function(Object, Object)} callback\n */\n function eachHandler(handlerInfos, callback) {\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n callback(handlerInfos[i]);\n }\n }\n\n /**\n @private\n\n determines if two queryparam objects are the same or not\n **/\n function queryParamsEqual(a, b) {\n a = a || {};\n b = b || {};\n var checkedKeys = [], key;\n for(key in a) {\n if (!a.hasOwnProperty(key)) { continue; }\n if(b[key] !== a[key]) { return false; }\n checkedKeys.push(key);\n }\n for(key in b) {\n if (!b.hasOwnProperty(key)) { continue; }\n if (~checkedKeys.indexOf(key)) { continue; }\n // b has a key not in a\n return false;\n }\n return true;\n }\n\n /**\n @private\n\n This function is called when transitioning from one URL to\n another to determine which handlers are no longer active,\n which handlers are newly active, and which handlers remain\n active but have their context changed.\n\n Take a list of old handlers and new handlers and partition\n them into four buckets:\n\n * unchanged: the handler was active in both the old and\n new URL, and its context remains the same\n * updated context: the handler was active in both the\n old and new URL, but its context changed. The handler's\n `setup` method, if any, will be called with the new\n context.\n * exited: the handler was active in the old URL, but is\n no longer active.\n * entered: the handler was not active in the old URL, but\n is now active.\n\n The PartitionedHandlers structure has four fields:\n\n * `updatedContext`: a list of `HandlerInfo` objects that\n represent handlers that remain active but have a changed\n context\n * `entered`: a list of `HandlerInfo` objects that represent\n handlers that are newly active\n * `exited`: a list of `HandlerInfo` objects that are no\n longer active.\n * `unchanged`: a list of `HanderInfo` objects that remain active.\n\n @param {Array[HandlerInfo]} oldHandlers a list of the handler\n information for the previous URL (or `[]` if this is the\n first handled transition)\n @param {Array[HandlerInfo]} newHandlers a list of the handler\n information for the new URL\n\n @return {Partition}\n */\n function partitionHandlers(oldHandlers, newHandlers) {\n var handlers = {\n updatedContext: [],\n exited: [],\n entered: [],\n unchanged: []\n };\n\n var handlerChanged, contextChanged, queryParamsChanged, i, l;\n\n for (i=0, l=newHandlers.length; i<l; i++) {\n var oldHandler = oldHandlers[i], newHandler = newHandlers[i];\n\n if (!oldHandler || oldHandler.handler !== newHandler.handler) {\n handlerChanged = true;\n } else if (!queryParamsEqual(oldHandler.queryParams, newHandler.queryParams)) {\n queryParamsChanged = true;\n }\n\n if (handlerChanged) {\n handlers.entered.push(newHandler);\n if (oldHandler) { handlers.exited.unshift(oldHandler); }\n } else if (contextChanged || oldHandler.context !== newHandler.context || queryParamsChanged) {\n contextChanged = true;\n handlers.updatedContext.push(newHandler);\n } else {\n handlers.unchanged.push(oldHandler);\n }\n }\n\n for (i=newHandlers.length, l=oldHandlers.length; i<l; i++) {\n handlers.exited.unshift(oldHandlers[i]);\n }\n\n return handlers;\n }\n\n function trigger(router, handlerInfos, ignoreFailure, args) {\n if (router.triggerEvent) {\n router.triggerEvent(handlerInfos, ignoreFailure, args);\n return;\n }\n\n var name = args.shift();\n\n if (!handlerInfos) {\n if (ignoreFailure) { return; }\n throw new Error(\"Could not trigger event '\" + name + \"'. There are no active handlers\");\n }\n\n var eventWasHandled = false;\n\n for (var i=handlerInfos.length-1; i>=0; i--) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler.events && handler.events[name]) {\n if (handler.events[name].apply(handler, args) === true) {\n eventWasHandled = true;\n } else {\n return;\n }\n }\n }\n\n if (!eventWasHandled && !ignoreFailure) {\n throw new Error(\"Nothing handled the event '\" + name + \"'.\");\n }\n }\n\n function setContext(handler, context) {\n handler.context = context;\n if (handler.contextDidChange) { handler.contextDidChange(); }\n }\n\n function setQueryParams(handler, queryParams) {\n handler.queryParams = queryParams;\n if (handler.queryParamsDidChange) { handler.queryParamsDidChange(); }\n }\n\n\n /**\n @private\n\n Extracts query params from the end of an array\n **/\n\n function extractQueryParams(array) {\n var len = (array && array.length), head, queryParams;\n\n if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) {\n queryParams = array[len - 1].queryParams;\n head = slice.call(array, 0, len - 1);\n return [head, queryParams];\n } else {\n return [array, null];\n }\n }\n\n function performIntermediateTransition(router, recogHandlers, matchPointResults) {\n\n var handlerInfos = generateHandlerInfos(router, recogHandlers);\n for (var i = 0; i < handlerInfos.length; ++i) {\n var handlerInfo = handlerInfos[i];\n handlerInfo.context = matchPointResults.providedModels[handlerInfo.name];\n }\n\n var stubbedTransition = {\n router: router,\n isAborted: false\n };\n\n setupContexts(stubbedTransition, handlerInfos);\n }\n\n /**\n @private\n\n Creates, begins, and returns a Transition.\n */\n function performTransition(router, recogHandlers, providedModelsArray, params, queryParams, data, isIntermediate) {\n\n var matchPointResults = getMatchPoint(router, recogHandlers, providedModelsArray, params, queryParams),\n targetName = recogHandlers[recogHandlers.length - 1].handler,\n wasTransitioning = false,\n currentHandlerInfos = router.currentHandlerInfos;\n\n if (isIntermediate) {\n return performIntermediateTransition(router, recogHandlers, matchPointResults);\n }\n\n // Check if there's already a transition underway.\n if (router.activeTransition) {\n if (transitionsIdentical(router.activeTransition, targetName, providedModelsArray, queryParams)) {\n return router.activeTransition;\n }\n router.activeTransition.abort();\n wasTransitioning = true;\n }\n\n var deferred = RSVP.defer(),\n transition = new Transition(router, deferred.promise);\n\n transition.targetName = targetName;\n transition.providedModels = matchPointResults.providedModels;\n transition.providedModelsArray = providedModelsArray;\n transition.params = matchPointResults.params;\n transition.data = data || {};\n transition.queryParams = queryParams;\n transition.pivotHandler = matchPointResults.pivotHandler;\n router.activeTransition = transition;\n\n var handlerInfos = generateHandlerInfos(router, recogHandlers);\n transition.handlerInfos = handlerInfos;\n\n // Fire 'willTransition' event on current handlers, but don't fire it\n // if a transition was already underway.\n if (!wasTransitioning) {\n trigger(router, currentHandlerInfos, true, ['willTransition', transition]);\n }\n\n log(router, transition.sequence, \"Beginning validation for transition to \" + transition.targetName);\n validateEntry(transition, matchPointResults.matchPoint, matchPointResults.handlerParams)\n .then(transitionSuccess, transitionFailure);\n\n return transition;\n\n function transitionSuccess() {\n checkAbort(transition);\n\n try {\n log(router, transition.sequence, \"Validation succeeded, finalizing transition;\");\n\n // Don't overwrite contexts / update URL if this was a noop transition.\n if (!currentHandlerInfos || !currentHandlerInfos.length ||\n !router.recognizer.hasRoute(currentHandlerInfos[currentHandlerInfos.length - 1].name) ||\n currentHandlerInfos.length !== matchPointResults.matchPoint) {\n finalizeTransition(transition, handlerInfos);\n }\n\n // currentHandlerInfos was updated in finalizeTransition\n trigger(router, router.currentHandlerInfos, true, ['didTransition']);\n\n if (router.didTransition) {\n router.didTransition(handlerInfos);\n }\n\n log(router, transition.sequence, \"TRANSITION COMPLETE.\");\n\n // Resolve with the final handler.\n transition.isActive = false;\n deferred.resolve(handlerInfos[handlerInfos.length - 1].handler);\n } catch(e) {\n deferred.reject(e);\n }\n\n // Don't nullify if another transition is underway (meaning\n // there was a transition initiated with enter/setup).\n if (!transition.isAborted) {\n router.activeTransition = null;\n }\n }\n\n function transitionFailure(reason) {\n deferred.reject(reason);\n }\n }\n\n /**\n @private\n\n Accepts handlers in Recognizer format, either returned from\n recognize() or handlersFor(), and returns unified\n `HandlerInfo`s.\n */\n function generateHandlerInfos(router, recogHandlers) {\n var handlerInfos = [];\n for (var i = 0, len = recogHandlers.length; i < len; ++i) {\n var handlerObj = recogHandlers[i],\n isDynamic = handlerObj.isDynamic || (handlerObj.names && handlerObj.names.length);\n\n var handlerInfo = {\n isDynamic: !!isDynamic,\n name: handlerObj.handler,\n handler: router.getHandler(handlerObj.handler)\n };\n if(handlerObj.queryParams) {\n handlerInfo.queryParams = handlerObj.queryParams;\n }\n handlerInfos.push(handlerInfo);\n }\n return handlerInfos;\n }\n\n /**\n @private\n */\n function transitionsIdentical(oldTransition, targetName, providedModelsArray, queryParams) {\n\n if (oldTransition.targetName !== targetName) { return false; }\n\n var oldModels = oldTransition.providedModelsArray;\n if (oldModels.length !== providedModelsArray.length) { return false; }\n\n for (var i = 0, len = oldModels.length; i < len; ++i) {\n if (oldModels[i] !== providedModelsArray[i]) { return false; }\n }\n\n if(!queryParamsEqual(oldTransition.queryParams, queryParams)) {\n return false;\n }\n\n return true;\n }\n\n /**\n @private\n\n Updates the URL (if necessary) and calls `setupContexts`\n to update the router's array of `currentHandlerInfos`.\n */\n function finalizeTransition(transition, handlerInfos) {\n\n var router = transition.router,\n seq = transition.sequence,\n handlerName = handlerInfos[handlerInfos.length - 1].name,\n urlMethod = transition.urlMethod,\n i;\n\n // Collect params for URL.\n var objects = [], providedModels = transition.providedModelsArray.slice();\n for (i = handlerInfos.length - 1; i>=0; --i) {\n var handlerInfo = handlerInfos[i];\n if (handlerInfo.isDynamic) {\n var providedModel = providedModels.pop();\n objects.unshift(isParam(providedModel) ? providedModel.toString() : handlerInfo.context);\n }\n\n if (handlerInfo.handler.inaccessiblyByURL) {\n urlMethod = null;\n }\n }\n\n var newQueryParams = {};\n for (i = handlerInfos.length - 1; i>=0; --i) {\n merge(newQueryParams, handlerInfos[i].queryParams);\n }\n router.currentQueryParams = newQueryParams;\n\n\n var params = paramsForHandler(router, handlerName, objects, transition.queryParams);\n\n router.currentParams = params;\n\n if (urlMethod) {\n var url = router.recognizer.generate(handlerName, params);\n\n if (urlMethod === 'replace') {\n router.replaceURL(url);\n } else {\n // Assume everything else is just a URL update for now.\n router.updateURL(url);\n }\n }\n\n setupContexts(transition, handlerInfos);\n }\n\n /**\n @private\n\n Internal function used to construct the chain of promises used\n to validate a transition. Wraps calls to `beforeModel`, `model`,\n and `afterModel` in promises, and checks for redirects/aborts\n between each.\n */\n function validateEntry(transition, matchPoint, handlerParams) {\n\n var handlerInfos = transition.handlerInfos,\n index = transition.resolveIndex;\n\n if (index === handlerInfos.length) {\n // No more contexts to resolve.\n return RSVP.resolve(transition.resolvedModels);\n }\n\n var router = transition.router,\n handlerInfo = handlerInfos[index],\n handler = handlerInfo.handler,\n handlerName = handlerInfo.name,\n seq = transition.sequence;\n\n if (index < matchPoint) {\n log(router, seq, handlerName + \": using context from already-active handler\");\n\n // We're before the match point, so don't run any hooks,\n // just use the already resolved context from the handler.\n transition.resolvedModels[handlerInfo.name] =\n transition.providedModels[handlerInfo.name] ||\n handlerInfo.handler.context;\n return proceed();\n }\n\n transition.trigger(true, 'willResolveModel', transition, handler);\n\n return RSVP.resolve().then(handleAbort)\n .then(beforeModel)\n .then(handleAbort)\n .then(model)\n .then(handleAbort)\n .then(afterModel)\n .then(handleAbort)\n .then(null, handleError)\n .then(proceed);\n\n function handleAbort(result) {\n if (transition.isAborted) {\n log(transition.router, transition.sequence, \"detected abort.\");\n return RSVP.reject(new Router.TransitionAborted());\n }\n\n return result;\n }\n\n function handleError(reason) {\n if (reason instanceof Router.TransitionAborted) {\n // if the transition was aborted and *no additional* error was thrown,\n // reject with the Router.TransitionAborted instance\n return RSVP.reject(reason);\n }\n\n // otherwise, we're here because of a different error\n transition.abort();\n\n log(router, seq, handlerName + \": handling error: \" + reason);\n\n // An error was thrown / promise rejected, so fire an\n // `error` event from this handler info up to root.\n transition.trigger(true, 'error', reason, transition, handlerInfo.handler);\n\n // Propagate the original error.\n return RSVP.reject(reason);\n }\n\n function beforeModel() {\n\n log(router, seq, handlerName + \": calling beforeModel hook\");\n\n var args;\n\n if (handlerInfo.queryParams) {\n args = [handlerInfo.queryParams, transition];\n } else {\n args = [transition];\n }\n\n var p = handler.beforeModel && handler.beforeModel.apply(handler, args);\n return (p instanceof Transition) ? null : p;\n }\n\n function model() {\n log(router, seq, handlerName + \": resolving model\");\n var p = getModel(handlerInfo, transition, handlerParams[handlerName], index >= matchPoint);\n return (p instanceof Transition) ? null : p;\n }\n\n function afterModel(context) {\n\n log(router, seq, handlerName + \": calling afterModel hook\");\n\n // Pass the context and resolved parent contexts to afterModel, but we don't\n // want to use the value returned from `afterModel` in any way, but rather\n // always resolve with the original `context` object.\n\n transition.resolvedModels[handlerInfo.name] = context;\n\n var args;\n\n if (handlerInfo.queryParams) {\n args = [context, handlerInfo.queryParams, transition];\n } else {\n args = [context, transition];\n }\n\n var p = handler.afterModel && handler.afterModel.apply(handler, args);\n return (p instanceof Transition) ? null : p;\n }\n\n function proceed() {\n log(router, seq, handlerName + \": validation succeeded, proceeding\");\n\n handlerInfo.context = transition.resolvedModels[handlerInfo.name];\n transition.resolveIndex++;\n return validateEntry(transition, matchPoint, handlerParams);\n }\n }\n\n /**\n @private\n\n Throws a TransitionAborted if the provided transition has been aborted.\n */\n function checkAbort(transition) {\n if (transition.isAborted) {\n log(transition.router, transition.sequence, \"detected abort.\");\n throw new Router.TransitionAborted();\n }\n }\n\n /**\n @private\n\n Encapsulates the logic for whether to call `model` on a route,\n or use one of the models provided to `transitionTo`.\n */\n function getModel(handlerInfo, transition, handlerParams, needsUpdate) {\n var handler = handlerInfo.handler,\n handlerName = handlerInfo.name, args;\n\n if (!needsUpdate && handler.hasOwnProperty('context')) {\n return handler.context;\n }\n\n if (transition.providedModels.hasOwnProperty(handlerName)) {\n var providedModel = transition.providedModels[handlerName];\n return typeof providedModel === 'function' ? providedModel() : providedModel;\n }\n\n if (handlerInfo.queryParams) {\n args = [handlerParams || {}, handlerInfo.queryParams, transition];\n } else {\n args = [handlerParams || {}, transition, handlerInfo.queryParams];\n }\n\n return handler.model && handler.model.apply(handler, args);\n }\n\n /**\n @private\n */\n function log(router, sequence, msg) {\n\n if (!router.log) { return; }\n\n if (arguments.length === 3) {\n router.log(\"Transition #\" + sequence + \": \" + msg);\n } else {\n msg = sequence;\n router.log(msg);\n }\n }\n\n /**\n @private\n\n Begins and returns a Transition based on the provided\n arguments. Accepts arguments in the form of both URL\n transitions and named transitions.\n\n @param {Router} router\n @param {Array[Object]} args arguments passed to transitionTo,\n replaceWith, or handleURL\n */\n function doTransition(router, args, isIntermediate) {\n // Normalize blank transitions to root URL transitions.\n var name = args[0] || '/';\n\n if(args.length === 1 && args[0].hasOwnProperty('queryParams')) {\n return createQueryParamTransition(router, args[0], isIntermediate);\n } else if (name.charAt(0) === '/') {\n return createURLTransition(router, name, isIntermediate);\n } else {\n return createNamedTransition(router, slice.call(args), isIntermediate);\n }\n }\n\n /**\n @private\n\n Serializes a handler using its custom `serialize` method or\n by a default that looks up the expected property name from\n the dynamic segment.\n\n @param {Object} handler a router handler\n @param {Object} model the model to be serialized for this handler\n @param {Array[Object]} names the names array attached to an\n handler object returned from router.recognizer.handlersFor()\n */\n function serialize(handler, model, names) {\n\n var object = {};\n if (isParam(model)) {\n object[names[0]] = model;\n return object;\n }\n\n // Use custom serialize if it exists.\n if (handler.serialize) {\n return handler.serialize(model, names);\n }\n\n if (names.length !== 1) { return; }\n\n var name = names[0];\n\n if (/_id$/.test(name)) {\n object[name] = model.id;\n } else {\n object[name] = model;\n }\n return object;\n }\n\n\n return Router;\n });\n\n})();\n//@ sourceURL=ember-routing/vendor/router");minispade.register('ember-runtime/computed/array_computed', "(function() {minispade.require('ember-metal/computed');\nminispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/computed/reduce_computed');\n\nvar ReduceComputedProperty = Ember.ReduceComputedProperty,\n a_slice = [].slice,\n o_create = Ember.create,\n forEach = Ember.EnumerableUtils.forEach;\n\nfunction ArrayComputedProperty() {\n var cp = this;\n\n ReduceComputedProperty.apply(this, arguments);\n\n this.func = (function(reduceFunc) {\n return function (propertyName) {\n if (!cp._hasInstanceMeta(this, propertyName)) {\n // When we recompute an array computed property, we need already\n // retrieved arrays to be updated; we can't simply empty the cache and\n // hope the array is re-retrieved.\n forEach(cp._dependentKeys, function(dependentKey) {\n Ember.addObserver(this, dependentKey, function() {\n cp.recomputeOnce.call(this, propertyName);\n });\n }, this);\n }\n\n return reduceFunc.apply(this, arguments);\n };\n })(this.func);\n\n return this;\n}\nEmber.ArrayComputedProperty = ArrayComputedProperty;\nArrayComputedProperty.prototype = o_create(ReduceComputedProperty.prototype);\nArrayComputedProperty.prototype.initialValue = function () {\n return Ember.A();\n};\nArrayComputedProperty.prototype.resetValue = function (array) {\n array.clear();\n return array;\n};\n\n/**\n Creates a computed property which operates on dependent arrays and\n is updated with \"one at a time\" semantics. When items are added or\n removed from the dependent array(s) an array computed only operates\n on the change instead of re-evaluating the entire array. This should\n return an array, if you'd like to use \"one at a time\" semantics and\n compute some value other then an array look at\n `Ember.reduceComputed`.\n\n If there are more than one arguments the first arguments are\n considered to be dependent property keys. The last argument is\n required to be an options object. The options object can have the\n following three properties.\n\n `initialize` - An optional initialize function. Typically this will be used\n to set up state on the instanceMeta object.\n\n `removedItem` - A function that is called each time an element is\n removed from the array.\n\n `addedItem` - A function that is called each time an element is\n added to the array.\n\n\n The `initialize` function has the following signature:\n\n ```javascript\n function (array, changeMeta, instanceMeta)\n ```\n\n `array` - The initial value of the arrayComputed, an empty array.\n\n `changeMeta` - An object which contains meta information about the\n computed. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n\n The `removedItem` and `addedItem` functions both have the following signature:\n\n ```javascript\n function (accumulatedValue, item, changeMeta, instanceMeta)\n ```\n\n `accumulatedValue` - The value returned from the last time\n `removedItem` or `addedItem` was called or an empty array.\n\n `item` - the element added or removed from the array\n\n `changeMeta` - An object which contains meta information about the\n change. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n - `index` the index of the added or removed item\n - `item` the added or removed item: this is exactly the same as\n the second arg\n - `arrayChanged` the array that triggered the change. Can be\n useful when depending on multiple arrays.\n\n For property changes triggered on an item property change (when\n depKey is something like `someArray.@each.someProperty`),\n `changeMeta` will also contain the following property:\n\n - `previousValues` an object whose keys are the properties that changed on\n the item, and whose values are the item's previous values.\n\n `previousValues` is important Ember coalesces item property changes via\n Ember.run.once. This means that by the time removedItem gets called, item has\n the new values, but you may need the previous value (eg for sorting &\n filtering).\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n The `removedItem` and `addedItem` functions should return the accumulated\n value. It is acceptable to not return anything (ie return undefined)\n to invalidate the computation. This is generally not a good idea for\n arrayComputed but it's used in eg max and min.\n\n Example\n\n ```javascript\n Ember.computed.map = function(dependentKey, callback) {\n var options = {\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var mapped = callback(item);\n array.insertAt(changeMeta.index, mapped);\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n array.removeAt(changeMeta.index, 1);\n return array;\n }\n };\n\n return Ember.arrayComputed(dependentKey, options);\n };\n ```\n\n @method arrayComputed\n @for Ember\n @param {String} [dependentKeys*]\n @param {Object} options\n @return {Ember.ComputedProperty}\n*/\nEmber.arrayComputed = function (options) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n options = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof options !== \"object\") {\n throw new Ember.Error(\"Array Computed Property declared without an options hash\");\n }\n\n var cp = new ArrayComputedProperty(options);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n};\n\n})();\n//@ sourceURL=ember-runtime/computed/array_computed");minispade.register('ember-runtime/computed/reduce_computed', "(function() {minispade.require('ember-metal/computed');\nminispade.require('ember-runtime/mixins/array');\n\nvar e_get = Ember.get,\n set = Ember.set,\n guidFor = Ember.guidFor,\n metaFor = Ember.meta,\n propertyWillChange = Ember.propertyWillChange,\n propertyDidChange = Ember.propertyDidChange,\n addBeforeObserver = Ember.addBeforeObserver,\n removeBeforeObserver = Ember.removeBeforeObserver,\n addObserver = Ember.addObserver,\n removeObserver = Ember.removeObserver,\n ComputedProperty = Ember.ComputedProperty,\n a_slice = [].slice,\n o_create = Ember.create,\n forEach = Ember.EnumerableUtils.forEach,\n // Here we explicitly don't allow `@each.foo`; it would require some special\n // testing, but there's no particular reason why it should be disallowed.\n eachPropertyPattern = /^(.*)\\.@each\\.(.*)/,\n doubleEachPropertyPattern = /(.*\\.@each){2,}/;\n\nfunction get(obj, key) {\n if (Ember.FEATURES.isEnabled('reduceComputedSelf')) {\n if (key === '@this') {\n return obj;\n }\n }\n\n return e_get(obj, key);\n}\n\n/*\n Tracks changes to dependent arrays, as well as to properties of items in\n dependent arrays.\n\n @class DependentArraysObserver\n*/\nfunction DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // the ReduceComputedPropertyInstanceMeta this DependentArraysObserver is\n // associated with\n this.instanceMeta = instanceMeta;\n\n // A map of array guids to dependentKeys, for the given context. We track\n // this because we want to set up the computed property potentially before the\n // dependent array even exists, but when the array observer fires, we lack\n // enough context to know what to update: we can recover that context by\n // getting the dependentKey.\n this.dependentKeysByGuid = {};\n\n // a map of dependent array guids -> Ember.TrackedArray instances. We use\n // this to lazily recompute indexes for item property observers.\n this.trackedArraysByGuid = {};\n\n // We suspend observers to ignore replacements from `reset` when totally\n // recomputing. Unfortunately we cannot properly suspend the observers\n // because we only have the key; instead we make the observers no-ops\n this.suspended = false;\n\n // This is used to coalesce item changes from property observers.\n this.changedItems = {};\n}\n\nfunction ItemPropertyObserverContext (dependentArray, index, trackedArray) {\n Ember.assert(\"Internal error: trackedArray is null or undefined\", trackedArray);\n\n this.dependentArray = dependentArray;\n this.index = index;\n this.item = dependentArray.objectAt(index);\n this.trackedArray = trackedArray;\n this.beforeObserver = null;\n this.observer = null;\n\n this.destroyed = false;\n}\n\nDependentArraysObserver.prototype = {\n setValue: function (newValue) {\n this.instanceMeta.setValue(newValue, true);\n },\n getValue: function () {\n return this.instanceMeta.getValue();\n },\n\n setupObservers: function (dependentArray, dependentKey) {\n Ember.assert(\"dependent array must be an `Ember.Array`\", Ember.Array.detect(dependentArray));\n\n this.dependentKeysByGuid[guidFor(dependentArray)] = dependentKey;\n\n dependentArray.addArrayObserver(this, {\n willChange: 'dependentArrayWillChange',\n didChange: 'dependentArrayDidChange'\n });\n\n if (this.cp._itemPropertyKeys[dependentKey]) {\n this.setupPropertyObservers(dependentKey, this.cp._itemPropertyKeys[dependentKey]);\n }\n },\n\n teardownObservers: function (dependentArray, dependentKey) {\n var itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || [];\n\n delete this.dependentKeysByGuid[guidFor(dependentArray)];\n\n this.teardownPropertyObservers(dependentKey, itemPropertyKeys);\n\n dependentArray.removeArrayObserver(this, {\n willChange: 'dependentArrayWillChange',\n didChange: 'dependentArrayDidChange'\n });\n },\n\n suspendArrayObservers: function (callback, binding) {\n var oldSuspended = this.suspended;\n this.suspended = true;\n callback.call(binding);\n this.suspended = oldSuspended;\n },\n\n setupPropertyObservers: function (dependentKey, itemPropertyKeys) {\n var dependentArray = get(this.instanceMeta.context, dependentKey),\n length = get(dependentArray, 'length'),\n observerContexts = new Array(length);\n\n this.resetTransformations(dependentKey, observerContexts);\n\n forEach(dependentArray, function (item, index) {\n var observerContext = this.createPropertyObserverContext(dependentArray, index, this.trackedArraysByGuid[dependentKey]);\n observerContexts[index] = observerContext;\n\n forEach(itemPropertyKeys, function (propertyKey) {\n addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver);\n addObserver(item, propertyKey, this, observerContext.observer);\n }, this);\n }, this);\n },\n\n teardownPropertyObservers: function (dependentKey, itemPropertyKeys) {\n var dependentArrayObserver = this,\n trackedArray = this.trackedArraysByGuid[dependentKey],\n beforeObserver,\n observer,\n item;\n\n if (!trackedArray) { return; }\n\n trackedArray.apply(function (observerContexts, offset, operation) {\n if (operation === Ember.TrackedArray.DELETE) { return; }\n\n forEach(observerContexts, function (observerContext) {\n observerContext.destroyed = true;\n beforeObserver = observerContext.beforeObserver;\n observer = observerContext.observer;\n item = observerContext.item;\n\n forEach(itemPropertyKeys, function (propertyKey) {\n removeBeforeObserver(item, propertyKey, dependentArrayObserver, beforeObserver);\n removeObserver(item, propertyKey, dependentArrayObserver, observer);\n });\n });\n });\n },\n\n createPropertyObserverContext: function (dependentArray, index, trackedArray) {\n var observerContext = new ItemPropertyObserverContext(dependentArray, index, trackedArray);\n\n this.createPropertyObserver(observerContext);\n\n return observerContext;\n },\n\n createPropertyObserver: function (observerContext) {\n var dependentArrayObserver = this;\n\n observerContext.beforeObserver = function (obj, keyName) {\n return dependentArrayObserver.itemPropertyWillChange(obj, keyName, observerContext.dependentArray, observerContext);\n };\n observerContext.observer = function (obj, keyName) {\n return dependentArrayObserver.itemPropertyDidChange(obj, keyName, observerContext.dependentArray, observerContext);\n };\n },\n\n resetTransformations: function (dependentKey, observerContexts) {\n this.trackedArraysByGuid[dependentKey] = new Ember.TrackedArray(observerContexts);\n },\n\n trackAdd: function (dependentKey, index, newItems) {\n var trackedArray = this.trackedArraysByGuid[dependentKey];\n if (trackedArray) {\n trackedArray.addItems(index, newItems);\n }\n },\n\n trackRemove: function (dependentKey, index, removedCount) {\n var trackedArray = this.trackedArraysByGuid[dependentKey];\n\n if (trackedArray) {\n return trackedArray.removeItems(index, removedCount);\n }\n\n return [];\n },\n\n updateIndexes: function (trackedArray, array) {\n var length = get(array, 'length');\n // OPTIMIZE: we could stop updating once we hit the object whose observer\n // fired; ie partially apply the transformations\n trackedArray.apply(function (observerContexts, offset, operation) {\n // we don't even have observer contexts for removed items, even if we did,\n // they no longer have any index in the array\n if (operation === Ember.TrackedArray.DELETE) { return; }\n if (operation === Ember.TrackedArray.RETAIN && observerContexts.length === length && offset === 0) {\n // If we update many items we don't want to walk the array each time: we\n // only need to update the indexes at most once per run loop.\n return;\n }\n\n forEach(observerContexts, function (context, index) {\n context.index = index + offset;\n });\n });\n },\n\n dependentArrayWillChange: function (dependentArray, index, removedCount, addedCount) {\n if (this.suspended) { return; }\n\n var removedItem = this.callbacks.removedItem,\n changeMeta,\n guid = guidFor(dependentArray),\n dependentKey = this.dependentKeysByGuid[guid],\n itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || [],\n length = get(dependentArray, 'length'),\n normalizedIndex = normalizeIndex(index, length, 0),\n normalizedRemoveCount = normalizeRemoveCount(normalizedIndex, length, removedCount),\n item,\n itemIndex,\n sliceIndex,\n observerContexts;\n\n observerContexts = this.trackRemove(dependentKey, normalizedIndex, normalizedRemoveCount);\n\n function removeObservers(propertyKey) {\n observerContexts[sliceIndex].destroyed = true;\n removeBeforeObserver(item, propertyKey, this, observerContexts[sliceIndex].beforeObserver);\n removeObserver(item, propertyKey, this, observerContexts[sliceIndex].observer);\n }\n\n for (sliceIndex = normalizedRemoveCount - 1; sliceIndex >= 0; --sliceIndex) {\n itemIndex = normalizedIndex + sliceIndex;\n if (itemIndex >= length) { break; }\n\n item = dependentArray.objectAt(itemIndex);\n\n forEach(itemPropertyKeys, removeObservers, this);\n\n changeMeta = createChangeMeta(dependentArray, item, itemIndex, this.instanceMeta.propertyName, this.cp);\n this.setValue( removedItem.call(\n this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta));\n }\n },\n\n dependentArrayDidChange: function (dependentArray, index, removedCount, addedCount) {\n if (this.suspended) { return; }\n\n var addedItem = this.callbacks.addedItem,\n guid = guidFor(dependentArray),\n dependentKey = this.dependentKeysByGuid[guid],\n observerContexts = new Array(addedCount),\n itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey],\n length = get(dependentArray, 'length'),\n normalizedIndex = normalizeIndex(index, length, addedCount),\n changeMeta,\n observerContext;\n\n forEach(dependentArray.slice(normalizedIndex, normalizedIndex + addedCount), function (item, sliceIndex) {\n if (itemPropertyKeys) {\n observerContext =\n observerContexts[sliceIndex] =\n this.createPropertyObserverContext(dependentArray, normalizedIndex + sliceIndex, this.trackedArraysByGuid[dependentKey]);\n forEach(itemPropertyKeys, function (propertyKey) {\n addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver);\n addObserver(item, propertyKey, this, observerContext.observer);\n }, this);\n }\n\n changeMeta = createChangeMeta(dependentArray, item, normalizedIndex + sliceIndex, this.instanceMeta.propertyName, this.cp);\n this.setValue( addedItem.call(\n this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta));\n }, this);\n\n this.trackAdd(dependentKey, normalizedIndex, observerContexts);\n },\n\n itemPropertyWillChange: function (obj, keyName, array, observerContext) {\n var guid = guidFor(obj);\n\n if (!this.changedItems[guid]) {\n this.changedItems[guid] = {\n array: array,\n observerContext: observerContext,\n obj: obj,\n previousValues: {}\n };\n }\n\n this.changedItems[guid].previousValues[keyName] = get(obj, keyName);\n },\n\n itemPropertyDidChange: function(obj, keyName, array, observerContext) {\n this.flushChanges();\n },\n\n flushChanges: function() {\n var changedItems = this.changedItems, key, c, changeMeta;\n\n for (key in changedItems) {\n c = changedItems[key];\n if (c.observerContext.destroyed) { continue; }\n\n this.updateIndexes(c.observerContext.trackedArray, c.observerContext.dependentArray);\n\n changeMeta = createChangeMeta(c.array, c.obj, c.observerContext.index, this.instanceMeta.propertyName, this.cp, c.previousValues);\n this.setValue(\n this.callbacks.removedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta));\n this.setValue(\n this.callbacks.addedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta));\n }\n this.changedItems = {};\n }\n};\n\nfunction normalizeIndex(index, length, newItemsOffset) {\n if (index < 0) {\n return Math.max(0, length + index);\n } else if (index < length) {\n return index;\n } else /* index > length */ {\n return Math.min(length - newItemsOffset, index);\n }\n}\n\nfunction normalizeRemoveCount(index, length, removedCount) {\n return Math.min(removedCount, length - index);\n}\n\nfunction createChangeMeta(dependentArray, item, index, propertyName, property, previousValues) {\n var meta = {\n arrayChanged: dependentArray,\n index: index,\n item: item,\n propertyName: propertyName,\n property: property\n };\n\n if (previousValues) {\n // previous values only available for item property changes\n meta.previousValues = previousValues;\n }\n\n return meta;\n}\n\nfunction addItems (dependentArray, callbacks, cp, propertyName, meta) {\n forEach(dependentArray, function (item, index) {\n meta.setValue( callbacks.addedItem.call(\n this, meta.getValue(), item, createChangeMeta(dependentArray, item, index, propertyName, cp), meta.sugarMeta));\n }, this);\n}\n\nfunction reset(cp, propertyName) {\n var callbacks = cp._callbacks(),\n meta;\n\n if (cp._hasInstanceMeta(this, propertyName)) {\n meta = cp._instanceMeta(this, propertyName);\n meta.setValue(cp.resetValue(meta.getValue()));\n } else {\n meta = cp._instanceMeta(this, propertyName);\n }\n\n if (cp.options.initialize) {\n cp.options.initialize.call(this, meta.getValue(), { property: cp, propertyName: propertyName }, meta.sugarMeta);\n }\n}\n\nfunction ReduceComputedPropertyInstanceMeta(context, propertyName, initialValue) {\n this.context = context;\n this.propertyName = propertyName;\n this.cache = metaFor(context).cache;\n\n this.dependentArrays = {};\n this.sugarMeta = {};\n\n this.initialValue = initialValue;\n}\n\nReduceComputedPropertyInstanceMeta.prototype = {\n getValue: function () {\n if (this.propertyName in this.cache) {\n return this.cache[this.propertyName];\n } else {\n return this.initialValue;\n }\n },\n\n setValue: function(newValue, triggerObservers) {\n // This lets sugars force a recomputation, handy for very simple\n // implementations of eg max.\n if (newValue !== undefined) {\n var fireObservers = triggerObservers && (newValue !== this.cache[this.propertyName]);\n\n if (fireObservers) {\n propertyWillChange(this.context, this.propertyName);\n }\n\n this.cache[this.propertyName] = newValue;\n\n if (fireObservers) {\n propertyDidChange(this.context, this.propertyName);\n }\n } else {\n delete this.cache[this.propertyName];\n }\n }\n};\n\n/**\n A computed property whose dependent keys are arrays and which is updated with\n \"one at a time\" semantics.\n\n @class ReduceComputedProperty\n @namespace Ember\n @extends Ember.ComputedProperty\n @constructor\n*/\nfunction ReduceComputedProperty(options) {\n var cp = this;\n\n this.options = options;\n this._instanceMetas = {};\n\n this._dependentKeys = null;\n // A map of dependentKey -> [itemProperty, ...] that tracks what properties of\n // items in the array we must track to update this property.\n this._itemPropertyKeys = {};\n this._previousItemPropertyKeys = {};\n\n this.readOnly();\n this.cacheable();\n\n this.recomputeOnce = function(propertyName) {\n // What we really want to do is coalesce by <cp, propertyName>.\n // We need a form of `scheduleOnce` that accepts an arbitrary token to\n // coalesce by, in addition to the target and method.\n Ember.run.once(this, recompute, propertyName);\n };\n var recompute = function(propertyName) {\n var dependentKeys = cp._dependentKeys,\n meta = cp._instanceMeta(this, propertyName),\n callbacks = cp._callbacks();\n\n reset.call(this, cp, propertyName);\n\n meta.dependentArraysObserver.suspendArrayObservers(function () {\n forEach(cp._dependentKeys, function (dependentKey) {\n var dependentArray = get(this, dependentKey),\n previousDependentArray = meta.dependentArrays[dependentKey];\n\n if (dependentArray === previousDependentArray) {\n // The array may be the same, but our item property keys may have\n // changed, so we set them up again. We can't easily tell if they've\n // changed: the array may be the same object, but with different\n // contents.\n if (cp._previousItemPropertyKeys[dependentKey]) {\n delete cp._previousItemPropertyKeys[dependentKey];\n meta.dependentArraysObserver.setupPropertyObservers(dependentKey, cp._itemPropertyKeys[dependentKey]);\n }\n } else {\n meta.dependentArrays[dependentKey] = dependentArray;\n\n if (previousDependentArray) {\n meta.dependentArraysObserver.teardownObservers(previousDependentArray, dependentKey);\n }\n\n if (dependentArray) {\n meta.dependentArraysObserver.setupObservers(dependentArray, dependentKey);\n }\n }\n }, this);\n }, this);\n\n forEach(cp._dependentKeys, function(dependentKey) {\n var dependentArray = get(this, dependentKey);\n if (dependentArray) {\n addItems.call(this, dependentArray, callbacks, cp, propertyName, meta);\n }\n }, this);\n };\n\n this.func = function (propertyName) {\n Ember.assert(\"Computed reduce values require at least one dependent key\", cp._dependentKeys);\n\n recompute.call(this, propertyName);\n\n return cp._instanceMeta(this, propertyName).getValue();\n };\n}\n\nEmber.ReduceComputedProperty = ReduceComputedProperty;\nReduceComputedProperty.prototype = o_create(ComputedProperty.prototype);\n\nfunction defaultCallback(computedValue) {\n return computedValue;\n}\n\nReduceComputedProperty.prototype._callbacks = function () {\n if (!this.callbacks) {\n var options = this.options;\n this.callbacks = {\n removedItem: options.removedItem || defaultCallback,\n addedItem: options.addedItem || defaultCallback\n };\n }\n return this.callbacks;\n};\n\nReduceComputedProperty.prototype._hasInstanceMeta = function (context, propertyName) {\n var guid = guidFor(context),\n key = guid + ':' + propertyName;\n\n return !!this._instanceMetas[key];\n};\n\nReduceComputedProperty.prototype._instanceMeta = function (context, propertyName) {\n var guid = guidFor(context),\n key = guid + ':' + propertyName,\n meta = this._instanceMetas[key];\n\n if (!meta) {\n meta = this._instanceMetas[key] = new ReduceComputedPropertyInstanceMeta(context, propertyName, this.initialValue());\n meta.dependentArraysObserver = new DependentArraysObserver(this._callbacks(), this, meta, context, propertyName, meta.sugarMeta);\n }\n\n return meta;\n};\n\nReduceComputedProperty.prototype.initialValue = function () {\n if (typeof this.options.initialValue === 'function') {\n return this.options.initialValue();\n }\n else {\n return this.options.initialValue;\n }\n};\n\nReduceComputedProperty.prototype.resetValue = function (value) {\n return this.initialValue();\n};\n\nReduceComputedProperty.prototype.itemPropertyKey = function (dependentArrayKey, itemPropertyKey) {\n this._itemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey] || [];\n this._itemPropertyKeys[dependentArrayKey].push(itemPropertyKey);\n};\n\nReduceComputedProperty.prototype.clearItemPropertyKeys = function (dependentArrayKey) {\n if (this._itemPropertyKeys[dependentArrayKey]) {\n this._previousItemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey];\n this._itemPropertyKeys[dependentArrayKey] = [];\n }\n};\n\nReduceComputedProperty.prototype.property = function () {\n var cp = this,\n args = a_slice.call(arguments),\n propertyArgs = new Ember.Set(),\n match,\n dependentArrayKey,\n itemPropertyKey;\n\n forEach(a_slice.call(arguments), function (dependentKey) {\n if (doubleEachPropertyPattern.test(dependentKey)) {\n throw new Ember.Error(\"Nested @each properties not supported: \" + dependentKey);\n } else if (match = eachPropertyPattern.exec(dependentKey)) {\n dependentArrayKey = match[1];\n itemPropertyKey = match[2];\n cp.itemPropertyKey(dependentArrayKey, itemPropertyKey);\n propertyArgs.add(dependentArrayKey);\n } else {\n propertyArgs.add(dependentKey);\n }\n });\n\n return ComputedProperty.prototype.property.apply(this, propertyArgs.toArray());\n};\n\n/**\n Creates a computed property which operates on dependent arrays and\n is updated with \"one at a time\" semantics. When items are added or\n removed from the dependent array(s) a reduce computed only operates\n on the change instead of re-evaluating the entire array.\n\n If there are more than one arguments the first arguments are\n considered to be dependent property keys. The last argument is\n required to be an options object. The options object can have the\n following four properties:\n\n `initialValue` - A value or function that will be used as the initial\n value for the computed. If this property is a function the result of calling\n the function will be used as the initial value. This property is required.\n\n `initialize` - An optional initialize function. Typically this will be used\n to set up state on the instanceMeta object.\n\n `removedItem` - A function that is called each time an element is removed\n from the array.\n\n `addedItem` - A function that is called each time an element is added to\n the array.\n\n\n The `initialize` function has the following signature:\n\n ```javascript\n function (initialValue, changeMeta, instanceMeta)\n ```\n\n `initialValue` - The value of the `initialValue` property from the\n options object.\n\n `changeMeta` - An object which contains meta information about the\n computed. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n\n The `removedItem` and `addedItem` functions both have the following signature:\n\n ```javascript\n function (accumulatedValue, item, changeMeta, instanceMeta)\n ```\n\n `accumulatedValue` - The value returned from the last time\n `removedItem` or `addedItem` was called or `initialValue`.\n\n `item` - the element added or removed from the array\n\n `changeMeta` - An object which contains meta information about the\n change. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n - `index` the index of the added or removed item\n - `item` the added or removed item: this is exactly the same as\n the second arg\n - `arrayChanged` the array that triggered the change. Can be\n useful when depending on multiple arrays.\n\n For property changes triggered on an item property change (when\n depKey is something like `someArray.@each.someProperty`),\n `changeMeta` will also contain the following property:\n\n - `previousValues` an object whose keys are the properties that changed on\n the item, and whose values are the item's previous values.\n\n `previousValues` is important Ember coalesces item property changes via\n Ember.run.once. This means that by the time removedItem gets called, item has\n the new values, but you may need the previous value (eg for sorting &\n filtering).\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n The `removedItem` and `addedItem` functions should return the accumulated\n value. It is acceptable to not return anything (ie return undefined)\n to invalidate the computation. This is generally not a good idea for\n arrayComputed but it's used in eg max and min.\n\n Note that observers will be fired if either of these functions return a value\n that differs from the accumulated value. When returning an object that\n mutates in response to array changes, for example an array that maps\n everything from some other array (see `Ember.computed.map`), it is usually\n important that the *same* array be returned to avoid accidentally triggering observers.\n\n Example\n\n ```javascript\n Ember.computed.max = function (dependentKey) {\n return Ember.reduceComputed.call(null, dependentKey, {\n initialValue: -Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.max(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item < accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n };\n ```\n\n Dependent keys may refer to `@this` to observe changes to the object itself,\n which must be array-like, rather than a property of the object. This is\n mostly useful for array proxies, to ensure objects are retrieved via\n `objectAtContent`. This is how you could sort items by properties defined on an item controller.\n\n Example\n\n ```javascript\n App.PeopleController = Ember.ArrayController.extend({\n itemController: 'person',\n\n sortedPeople: Ember.computed.sort('@this.@each.reversedName', function(personA, personB) {\n // `reversedName` isn't defined on Person, but we have access to it via\n // the item controller App.PersonController. If we'd used\n // `content.@each.reversedName` above, we would be getting the objects\n // directly and not have access to `reversedName`.\n //\n var reversedNameA = get(personA, 'reversedName'),\n reversedNameB = get(personB, 'reversedName');\n\n return Ember.compare(reversedNameA, reversedNameB);\n })\n });\n\n App.PersonController = Ember.ObjectController.extend({\n reversedName: function () {\n return reverse(get(this, 'name'));\n }.property('name')\n })\n ```\n\n @method reduceComputed\n @for Ember\n @param {String} [dependentKeys*]\n @param {Object} options\n @return {Ember.ComputedProperty}\n*/\nEmber.reduceComputed = function (options) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n options = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof options !== \"object\") {\n throw new Ember.Error(\"Reduce Computed Property declared without an options hash\");\n }\n\n if (!('initialValue' in options)) {\n throw new Ember.Error(\"Reduce Computed Property declared without an initial value\");\n }\n\n var cp = new ReduceComputedProperty(options);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n};\n\n})();\n//@ sourceURL=ember-runtime/computed/reduce_computed");minispade.register('ember-runtime/computed/reduce_computed_macros', "(function() {minispade.require('ember-runtime/computed/array_computed');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get,\n set = Ember.set,\n guidFor = Ember.guidFor,\n merge = Ember.merge,\n a_slice = [].slice,\n forEach = Ember.EnumerableUtils.forEach,\n map = Ember.EnumerableUtils.map;\n\n/**\n A computed property that calculates the maximum value in the\n dependent array. This will return `-Infinity` when the dependent\n array is empty.\n\n Example\n\n ```javascript\n App.Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age'),\n maxChildAge: Ember.computed.max('childAges')\n });\n\n var lordByron = App.Person.create({children: []});\n lordByron.get('maxChildAge'); // -Infinity\n lordByron.get('children').pushObject({name: 'Augusta Ada Byron', age: 7});\n lordByron.get('maxChildAge'); // 7\n lordByron.get('children').pushObjects([{name: 'Allegra Byron', age: 5}, {name: 'Elizabeth Medora Leigh', age: 8}]);\n lordByron.get('maxChildAge'); // 8\n ```\n\n @method computed.max\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array\n*/\nEmber.computed.max = function (dependentKey) {\n return Ember.reduceComputed.call(null, dependentKey, {\n initialValue: -Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.max(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item < accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n};\n\n/**\n A computed property that calculates the minimum value in the\n dependent array. This will return `Infinity` when the dependent\n array is empty.\n\n Example\n\n ```javascript\n App.Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age'),\n minChildAge: Ember.computed.min('childAges')\n });\n\n var lordByron = App.Person.create({children: []});\n lordByron.get('minChildAge'); // Infinity\n lordByron.get('children').pushObject({name: 'Augusta Ada Byron', age: 7});\n lordByron.get('minChildAge'); // 7\n lordByron.get('children').pushObjects([{name: 'Allegra Byron', age: 5}, {name: 'Elizabeth Medora Leigh', age: 8}]);\n lordByron.get('minChildAge'); // 5\n ```\n\n @method computed.min\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array\n*/\nEmber.computed.min = function (dependentKey) {\n return Ember.reduceComputed.call(null, dependentKey, {\n initialValue: Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.min(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item > accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n};\n\n/**\n Returns an array mapped via the callback\n\n The callback method you provide should have the following signature:\n\n ```javascript\n function(item);\n ```\n\n - `item` is the current item in the iteration.\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n excitingChores: Ember.computed.map('chores', function(chore) {\n return chore.toUpperCase() + '!';\n })\n });\n\n var hampster = App.Hampster.create({chores: ['cook', 'clean', 'write more unit tests']});\n hampster.get('excitingChores'); // ['COOK!', 'CLEAN!', 'WRITE MORE UNIT TESTS!']\n ```\n\n @method computed.map\n @for Ember\n @param {String} dependentKey\n @param {Function} callback\n @return {Ember.ComputedProperty} an array mapped via the callback\n*/\nEmber.computed.map = function(dependentKey, callback) {\n var options = {\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var mapped = callback.call(this, item);\n array.insertAt(changeMeta.index, mapped);\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n array.removeAt(changeMeta.index, 1);\n return array;\n }\n };\n\n return Ember.arrayComputed(dependentKey, options);\n};\n\n/**\n Returns an array mapped to the specified key.\n\n Example\n\n ```javascript\n App.Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age')\n });\n\n var lordByron = App.Person.create({children: []});\n lordByron.get('childAges'); // []\n lordByron.get('children').pushObject({name: 'Augusta Ada Byron', age: 7});\n lordByron.get('childAges'); // [7]\n lordByron.get('children').pushObjects([{name: 'Allegra Byron', age: 5}, {name: 'Elizabeth Medora Leigh', age: 8}]);\n lordByron.get('childAges'); // [7, 5, 8]\n ```\n\n @method computed.mapBy\n @for Ember\n @param {String} dependentKey\n @param {String} propertyKey\n @return {Ember.ComputedProperty} an array mapped to the specified key\n*/\nEmber.computed.mapBy = function(dependentKey, propertyKey) {\n var callback = function(item) { return get(item, propertyKey); };\n return Ember.computed.map(dependentKey + '.@each.' + propertyKey, callback);\n};\n\n/**\n @method computed.mapProperty\n @for Ember\n @deprecated Use `Ember.computed.mapBy` instead\n @param dependentKey\n @param propertyKey\n*/\nEmber.computed.mapProperty = Ember.computed.mapBy;\n\n/**\n Filters the array by the callback.\n\n The callback method you provide should have the following signature:\n\n ```javascript\n function(item);\n ```\n\n - `item` is the current item in the iteration.\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n remainingChores: Ember.computed.filter('chores', function(chore) {\n return !chore.done;\n })\n });\n\n var hampster = App.Hampster.create({chores: [\n {name: 'cook', done: true},\n {name: 'clean', done: true},\n {name: 'write more unit tests', done: false}\n ]});\n hampster.get('remainingChores'); // [{name: 'write more unit tests', done: false}]\n ```\n\n @method computed.filter\n @for Ember\n @param {String} dependentKey\n @param {Function} callback\n @return {Ember.ComputedProperty} the filtered array\n*/\nEmber.computed.filter = function(dependentKey, callback) {\n var options = {\n initialize: function (array, changeMeta, instanceMeta) {\n instanceMeta.filteredArrayIndexes = new Ember.SubArray();\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var match = !!callback.call(this, item),\n filterIndex = instanceMeta.filteredArrayIndexes.addItem(changeMeta.index, match);\n\n if (match) {\n array.insertAt(filterIndex, item);\n }\n\n return array;\n },\n\n removedItem: function(array, item, changeMeta, instanceMeta) {\n var filterIndex = instanceMeta.filteredArrayIndexes.removeItem(changeMeta.index);\n\n if (filterIndex > -1) {\n array.removeAt(filterIndex);\n }\n\n return array;\n }\n };\n\n return Ember.arrayComputed(dependentKey, options);\n};\n\n/**\n Filters the array by the property and value\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n remainingChores: Ember.computed.filterBy('chores', 'done', false)\n });\n\n var hampster = App.Hampster.create({chores: [\n {name: 'cook', done: true},\n {name: 'clean', done: true},\n {name: 'write more unit tests', done: false}\n ]});\n hampster.get('remainingChores'); // [{name: 'write more unit tests', done: false}]\n ```\n\n @method computed.filterBy\n @for Ember\n @param {String} dependentKey\n @param {String} propertyKey\n @param {String} value\n @return {Ember.ComputedProperty} the filtered array\n*/\nEmber.computed.filterBy = function(dependentKey, propertyKey, value) {\n var callback;\n\n if (arguments.length === 2) {\n callback = function(item) {\n return get(item, propertyKey);\n };\n } else {\n callback = function(item) {\n return get(item, propertyKey) === value;\n };\n }\n\n return Ember.computed.filter(dependentKey + '.@each.' + propertyKey, callback);\n};\n\n/**\n @method computed.filterProperty\n @for Ember\n @param dependentKey\n @param propertyKey\n @param value\n @deprecated Use `Ember.computed.filterBy` instead\n*/\nEmber.computed.filterProperty = Ember.computed.filterBy;\n\n/**\n A computed property which returns a new array with all the unique\n elements from one or more dependent arrays.\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n uniqueFruits: Ember.computed.uniq('fruits')\n });\n\n var hampster = App.Hampster.create({fruits: [\n 'banana',\n 'grape',\n 'kale',\n 'banana'\n ]});\n hampster.get('uniqueFruits'); // ['banana', 'grape', 'kale']\n ```\n\n @method computed.uniq\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n unique elements from the dependent array\n*/\nEmber.computed.uniq = function() {\n var args = a_slice.call(arguments);\n args.push({\n initialize: function(array, changeMeta, instanceMeta) {\n instanceMeta.itemCounts = {};\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var guid = guidFor(item);\n\n if (!instanceMeta.itemCounts[guid]) {\n instanceMeta.itemCounts[guid] = 1;\n } else {\n ++instanceMeta.itemCounts[guid];\n }\n array.addObject(item);\n return array;\n },\n removedItem: function(array, item, _, instanceMeta) {\n var guid = guidFor(item),\n itemCounts = instanceMeta.itemCounts;\n\n if (--itemCounts[guid] === 0) {\n array.removeObject(item);\n }\n return array;\n }\n });\n return Ember.arrayComputed.apply(null, args);\n};\n\n/**\n Alias for [Ember.computed.uniq](/api/#method_computed_uniq).\n\n @method computed.union\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n unique elements from the dependent array\n*/\nEmber.computed.union = Ember.computed.uniq;\n\n/**\n A computed property which returns a new array with all the duplicated\n elements from two or more dependeny arrays.\n\n Example\n\n ```javascript\n var obj = Ember.Object.createWithMixins({\n adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'],\n friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends')\n });\n\n obj.get('friendsInCommon'); // ['William King', 'Mary Somerville']\n ```\n\n @method computed.intersect\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n duplicated elements from the dependent arrays\n*/\nEmber.computed.intersect = function () {\n var getDependentKeyGuids = function (changeMeta) {\n return map(changeMeta.property._dependentKeys, function (dependentKey) {\n return guidFor(dependentKey);\n });\n };\n\n var args = a_slice.call(arguments);\n args.push({\n initialize: function (array, changeMeta, instanceMeta) {\n instanceMeta.itemCounts = {};\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var itemGuid = guidFor(item),\n dependentGuids = getDependentKeyGuids(changeMeta),\n dependentGuid = guidFor(changeMeta.arrayChanged),\n numberOfDependentArrays = changeMeta.property._dependentKeys.length,\n itemCounts = instanceMeta.itemCounts;\n\n if (!itemCounts[itemGuid]) { itemCounts[itemGuid] = {}; }\n if (itemCounts[itemGuid][dependentGuid] === undefined) { itemCounts[itemGuid][dependentGuid] = 0; }\n\n if (++itemCounts[itemGuid][dependentGuid] === 1 &&\n numberOfDependentArrays === Ember.keys(itemCounts[itemGuid]).length) {\n\n array.addObject(item);\n }\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n var itemGuid = guidFor(item),\n dependentGuids = getDependentKeyGuids(changeMeta),\n dependentGuid = guidFor(changeMeta.arrayChanged),\n numberOfDependentArrays = changeMeta.property._dependentKeys.length,\n numberOfArraysItemAppearsIn,\n itemCounts = instanceMeta.itemCounts;\n\n if (itemCounts[itemGuid][dependentGuid] === undefined) { itemCounts[itemGuid][dependentGuid] = 0; }\n if (--itemCounts[itemGuid][dependentGuid] === 0) {\n delete itemCounts[itemGuid][dependentGuid];\n numberOfArraysItemAppearsIn = Ember.keys(itemCounts[itemGuid]).length;\n\n if (numberOfArraysItemAppearsIn === 0) {\n delete itemCounts[itemGuid];\n }\n array.removeObject(item);\n }\n return array;\n }\n });\n return Ember.arrayComputed.apply(null, args);\n};\n\n/**\n A computed property which returns a new array with all the\n properties from the first dependent array that are not in the second\n dependent array.\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n likes: ['banana', 'grape', 'kale'],\n wants: Ember.computed.setDiff('likes', 'fruits')\n });\n\n var hampster = App.Hampster.create({fruits: [\n 'grape',\n 'kale',\n ]});\n hampster.get('wants'); // ['banana']\n ```\n\n @method computed.setDiff\n @for Ember\n @param {String} setAProperty\n @param {String} setBProperty\n @return {Ember.ComputedProperty} computes a new array with all the\n items from the first dependent array that are not in the second\n dependent array\n*/\nEmber.computed.setDiff = function (setAProperty, setBProperty) {\n if (arguments.length !== 2) {\n throw new Ember.Error(\"setDiff requires exactly two dependent arrays.\");\n }\n return Ember.arrayComputed.call(null, setAProperty, setBProperty, {\n addedItem: function (array, item, changeMeta, instanceMeta) {\n var setA = get(this, setAProperty),\n setB = get(this, setBProperty);\n\n if (changeMeta.arrayChanged === setA) {\n if (!setB.contains(item)) {\n array.addObject(item);\n }\n } else {\n array.removeObject(item);\n }\n return array;\n },\n\n removedItem: function (array, item, changeMeta, instanceMeta) {\n var setA = get(this, setAProperty),\n setB = get(this, setBProperty);\n\n if (changeMeta.arrayChanged === setB) {\n if (setA.contains(item)) {\n array.addObject(item);\n }\n } else {\n array.removeObject(item);\n }\n return array;\n }\n });\n};\n\nfunction binarySearch(array, item, low, high) {\n var mid, midItem, res, guidMid, guidItem;\n\n if (arguments.length < 4) { high = get(array, 'length'); }\n if (arguments.length < 3) { low = 0; }\n\n if (low === high) {\n return low;\n }\n\n mid = low + Math.floor((high - low) / 2);\n midItem = array.objectAt(mid);\n\n guidMid = _guidFor(midItem);\n guidItem = _guidFor(item);\n\n if (guidMid === guidItem) {\n return mid;\n }\n\n res = this.order(midItem, item);\n if (res === 0) {\n res = guidMid < guidItem ? -1 : 1;\n }\n\n\n if (res < 0) {\n return this.binarySearch(array, item, mid+1, high);\n } else if (res > 0) {\n return this.binarySearch(array, item, low, mid);\n }\n\n return mid;\n\n function _guidFor(item) {\n if (Ember.ObjectProxy.detectInstance(item)) {\n return guidFor(get(item, 'content'));\n }\n return guidFor(item);\n }\n}\n\n/**\n A computed property which returns a new array with all the\n properties from the first dependent array sorted based on a property\n or sort function.\n\n The callback method you provide should have the following signature:\n\n ```javascript\n function(itemA, itemB);\n ```\n\n - `itemA` the first item to compare.\n - `itemB` the second item to compare.\n\n This function should return `-1` when `itemA` should come before\n `itemB`. It should return `1` when `itemA` should come after\n `itemB`. If the `itemA` and `itemB` are equal this function should return `0`.\n\n Example\n\n ```javascript\n var ToDoList = Ember.Object.extend({\n todosSorting: ['name'],\n sortedTodos: Ember.computed.sort('todos', 'todosSorting'),\n priorityTodos: Ember.computed.sort('todos', function(a, b){\n if (a.priority > b.priority) {\n return 1;\n } else if (a.priority < b.priority) {\n return -1;\n }\n return 0;\n }),\n });\n var todoList = ToDoList.create({todos: [\n {name: 'Unit Test', priority: 2},\n {name: 'Documentation', priority: 3},\n {name: 'Release', priority: 1}\n ]});\n\n todoList.get('sortedTodos'); // [{name:'Documentation', priority:3}, {name:'Release', priority:1}, {name:'Unit Test', priority:2}]\n todoList.get('priorityTodos'); // [{name:'Release', priority:1}, {name:'Unit Test', priority:2}, {name:'Documentation', priority:3}]\n ```\n\n @method computed.sort\n @for Ember\n @param {String} dependentKey\n @param {String or Function} sortDefinition a dependent key to an\n array of sort properties or a function to use when sorting\n @return {Ember.ComputedProperty} computes a new sorted array based\n on the sort property array or callback function\n*/\nEmber.computed.sort = function (itemsKey, sortDefinition) {\n Ember.assert(\"Ember.computed.sort requires two arguments: an array key to sort and either a sort properties key or sort function\", arguments.length === 2);\n\n var initFn, sortPropertiesKey;\n\n if (typeof sortDefinition === 'function') {\n initFn = function (array, changeMeta, instanceMeta) {\n instanceMeta.order = sortDefinition;\n instanceMeta.binarySearch = binarySearch;\n };\n } else {\n sortPropertiesKey = sortDefinition;\n initFn = function (array, changeMeta, instanceMeta) {\n function setupSortProperties() {\n var sortPropertyDefinitions = get(this, sortPropertiesKey),\n sortProperty,\n sortProperties = instanceMeta.sortProperties = [],\n sortPropertyAscending = instanceMeta.sortPropertyAscending = {},\n idx,\n asc;\n\n Ember.assert(\"Cannot sort: '\" + sortPropertiesKey + \"' is not an array.\", Ember.isArray(sortPropertyDefinitions));\n\n changeMeta.property.clearItemPropertyKeys(itemsKey);\n\n forEach(sortPropertyDefinitions, function (sortPropertyDefinition) {\n if ((idx = sortPropertyDefinition.indexOf(':')) !== -1) {\n sortProperty = sortPropertyDefinition.substring(0, idx);\n asc = sortPropertyDefinition.substring(idx+1).toLowerCase() !== 'desc';\n } else {\n sortProperty = sortPropertyDefinition;\n asc = true;\n }\n\n sortProperties.push(sortProperty);\n sortPropertyAscending[sortProperty] = asc;\n changeMeta.property.itemPropertyKey(itemsKey, sortProperty);\n });\n\n sortPropertyDefinitions.addObserver('@each', this, updateSortPropertiesOnce);\n }\n\n function updateSortPropertiesOnce() {\n Ember.run.once(this, updateSortProperties, changeMeta.propertyName);\n }\n\n function updateSortProperties(propertyName) {\n setupSortProperties.call(this);\n changeMeta.property.recomputeOnce.call(this, propertyName);\n }\n\n Ember.addObserver(this, sortPropertiesKey, updateSortPropertiesOnce);\n\n setupSortProperties.call(this);\n\n\n instanceMeta.order = function (itemA, itemB) {\n var sortProperty, result, asc;\n for (var i = 0; i < this.sortProperties.length; ++i) {\n sortProperty = this.sortProperties[i];\n result = Ember.compare(get(itemA, sortProperty), get(itemB, sortProperty));\n\n if (result !== 0) {\n asc = this.sortPropertyAscending[sortProperty];\n return asc ? result : (-1 * result);\n }\n }\n\n return 0;\n };\n\n instanceMeta.binarySearch = binarySearch;\n };\n }\n\n return Ember.arrayComputed.call(null, itemsKey, {\n initialize: initFn,\n\n addedItem: function (array, item, changeMeta, instanceMeta) {\n var index = instanceMeta.binarySearch(array, item);\n array.insertAt(index, item);\n return array;\n },\n\n removedItem: function (array, item, changeMeta, instanceMeta) {\n var proxyProperties, index, searchItem;\n\n if (changeMeta.previousValues) {\n proxyProperties = merge({ content: item }, changeMeta.previousValues);\n\n searchItem = Ember.ObjectProxy.create(proxyProperties);\n } else {\n searchItem = item;\n }\n\n index = instanceMeta.binarySearch(array, searchItem);\n array.removeAt(index);\n return array;\n }\n });\n};\n\n})();\n//@ sourceURL=ember-runtime/computed/reduce_computed_macros");minispade.register('ember-runtime/controllers', "(function() {minispade.require('ember-runtime/controllers/array_controller');\nminispade.require('ember-runtime/controllers/object_controller');\nminispade.require('ember-runtime/controllers/controller');\n\n})();\n//@ sourceURL=ember-runtime/controllers");minispade.register('ember-runtime/controllers/array_controller', "(function() {minispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/controllers/controller');\nminispade.require('ember-runtime/mixins/sortable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach,\n replace = Ember.EnumerableUtils.replace;\n\n/**\n `Ember.ArrayController` provides a way for you to publish a collection of\n objects so that you can easily bind to the collection from a Handlebars\n `#each` helper, an `Ember.CollectionView`, or other controllers.\n\n The advantage of using an `ArrayController` is that you only have to set up\n your view bindings once; to change what's displayed, simply swap out the\n `content` property on the controller.\n\n For example, imagine you wanted to display a list of items fetched via an XHR\n request. Create an `Ember.ArrayController` and set its `content` property:\n\n ```javascript\n MyApp.listController = Ember.ArrayController.create();\n\n $.get('people.json', function(data) {\n MyApp.listController.set('content', data);\n });\n ```\n\n Then, create a view that binds to your new controller:\n\n ```handlebars\n {{#each MyApp.listController}}\n {{firstName}} {{lastName}}\n {{/each}}\n ```\n\n Although you are binding to the controller, the behavior of this controller\n is to pass through any methods or properties to the underlying array. This\n capability comes from `Ember.ArrayProxy`, which this class inherits from.\n\n Sometimes you want to display computed properties within the body of an\n `#each` helper that depend on the underlying items in `content`, but are not\n present on those items. To do this, set `itemController` to the name of a\n controller (probably an `ObjectController`) that will wrap each individual item.\n\n For example:\n\n ```handlebars\n {{#each post in controller}}\n <li>{{title}} ({{titleLength}} characters)</li>\n {{/each}}\n ```\n\n ```javascript\n App.PostsController = Ember.ArrayController.extend({\n itemController: 'post'\n });\n\n App.PostController = Ember.ObjectController.extend({\n // the `title` property will be proxied to the underlying post.\n\n titleLength: function() {\n return this.get('title').length;\n }.property('title')\n });\n ```\n\n In some cases it is helpful to return a different `itemController` depending\n on the particular item. Subclasses can do this by overriding\n `lookupItemController`.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n The itemController instances will have a `parentController` property set to\n either the the `parentController` property of the `ArrayController`\n or to the `ArrayController` instance itself.\n\n @class ArrayController\n @namespace Ember\n @extends Ember.ArrayProxy\n @uses Ember.SortableMixin\n @uses Ember.ControllerMixin\n*/\n\nEmber.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,\n Ember.SortableMixin, {\n\n /**\n The controller used to wrap items, if any.\n\n @property itemController\n @type String\n @default null\n */\n itemController: null,\n\n /**\n Return the name of the controller to wrap items, or `null` if items should\n be returned directly. The default implementation simply returns the\n `itemController` property, but subclasses can override this method to return\n different controllers for different objects.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @method lookupItemController\n @param {Object} object\n @return {String}\n */\n lookupItemController: function(object) {\n return get(this, 'itemController');\n },\n\n objectAtContent: function(idx) {\n var length = get(this, 'length'),\n arrangedContent = get(this,'arrangedContent'),\n object = arrangedContent && arrangedContent.objectAt(idx);\n\n if (idx >= 0 && idx < length) {\n var controllerClass = this.lookupItemController(object);\n if (controllerClass) {\n return this.controllerAt(idx, object, controllerClass);\n }\n }\n\n // When `controllerClass` is falsy, we have not opted in to using item\n // controllers, so return the object directly.\n\n // When the index is out of range, we want to return the \"out of range\"\n // value, whatever that might be. Rather than make assumptions\n // (e.g. guessing `null` or `undefined`) we defer this to `arrangedContent`.\n return object;\n },\n\n arrangedContentDidChange: function() {\n this._super();\n this._resetSubControllers();\n },\n\n arrayContentDidChange: function(idx, removedCnt, addedCnt) {\n var subControllers = get(this, '_subControllers'),\n subControllersToRemove = subControllers.slice(idx, idx+removedCnt);\n\n forEach(subControllersToRemove, function(subController) {\n if (subController) { subController.destroy(); }\n });\n\n replace(subControllers, idx, removedCnt, new Array(addedCnt));\n\n // The shadow array of subcontrollers must be updated before we trigger\n // observers, otherwise observers will get the wrong subcontainer when\n // calling `objectAt`\n this._super(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n\n this.set('_subControllers', Ember.A());\n },\n\n content: Ember.computed(function () {\n return Ember.A();\n }),\n\n controllerAt: function(idx, object, controllerClass) {\n var container = get(this, 'container'),\n subControllers = get(this, '_subControllers'),\n subController = subControllers[idx],\n factory, fullName;\n\n if (subController) { return subController; }\n\n fullName = \"controller:\" + controllerClass;\n\n if (!container.has(fullName)) {\n throw new Ember.Error('Could not resolve itemController: \"' + controllerClass + '\"');\n }\n\n subController = container.lookupFactory(fullName).create({\n target: this,\n parentController: get(this, 'parentController') || this,\n content: object\n });\n\n subControllers[idx] = subController;\n\n return subController;\n },\n\n _subControllers: null,\n\n _resetSubControllers: function() {\n var subControllers = get(this, '_subControllers');\n if (subControllers) {\n forEach(subControllers, function(subController) {\n if (subController) { subController.destroy(); }\n });\n }\n\n this.set('_subControllers', Ember.A());\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/controllers/array_controller");minispade.register('ember-runtime/controllers/controller', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/string');\n\nvar get = Ember.get;\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ControllerMixin` provides a standard interface for all classes that\n compose Ember's controller layer: `Ember.Controller`,\n `Ember.ArrayController`, and `Ember.ObjectController`.\n\n @class ControllerMixin\n @namespace Ember\n*/\nEmber.ControllerMixin = Ember.Mixin.create(Ember.ActionHandler, {\n /* ducktype as a controller */\n isController: true,\n\n /**\n The object to which actions from the view should be sent.\n\n For example, when a Handlebars template uses the `{{action}}` helper,\n it will attempt to send the action to the view's controller's `target`.\n\n By default, a controller's `target` is set to the router after it is\n instantiated by `Ember.Application#initialize`.\n\n @property target\n @default null\n */\n target: null,\n\n container: null,\n\n parentController: null,\n\n store: null,\n\n model: Ember.computed.alias('content'),\n\n deprecatedSendHandles: function(actionName) {\n return !!this[actionName];\n },\n\n deprecatedSend: function(actionName) {\n var args = [].slice.call(arguments, 1);\n Ember.assert('' + this + \" has the action \" + actionName + \" but it is not a function\", typeof this[actionName] === 'function');\n Ember.deprecate('Action handlers implemented directly on controllers are deprecated in favor of action handlers on an `actions` object (' + actionName + ' on ' + this + ')', false);\n this[actionName].apply(this, args);\n return;\n }\n});\n\n/**\n @class Controller\n @namespace Ember\n @extends Ember.Object\n @uses Ember.ControllerMixin\n*/\nEmber.Controller = Ember.Object.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/controller");minispade.register('ember-runtime/controllers/object_controller', "(function() {minispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/controllers/controller');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ObjectController` is part of Ember's Controller layer. It is intended\n to wrap a single object, proxying unhandled attempts to `get` and `set` to the underlying\n content object, and to forward unhandled action attempts to its `target`.\n\n `Ember.ObjectController` derives this functionality from its superclass\n `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin.\n\n @class ObjectController\n @namespace Ember\n @extends Ember.ObjectProxy\n @uses Ember.ControllerMixin\n**/\nEmber.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/object_controller");minispade.register('ember-runtime/core', "(function() {/*globals ENV */\nminispade.require('ember-metal');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar indexOf = Ember.EnumerableUtils.indexOf;\n\n/**\n This will compare two javascript values of possibly different types.\n It will tell you which one is greater than the other by returning:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n The order is calculated based on `Ember.ORDER_DEFINITION`, if types are different.\n In case they have the same type an appropriate comparison for this type is made.\n\n ```javascript\n Ember.compare('hello', 'hello'); // 0\n Ember.compare('abc', 'dfg'); // -1\n Ember.compare(2, 1); // 1\n ```\n\n @method compare\n @for Ember\n @param {Object} v First value to compare\n @param {Object} w Second value to compare\n @return {Number} -1 if v < w, 0 if v = w and 1 if v > w.\n*/\nEmber.compare = function compare(v, w) {\n if (v === w) { return 0; }\n\n var type1 = Ember.typeOf(v);\n var type2 = Ember.typeOf(w);\n\n var Comparable = Ember.Comparable;\n if (Comparable) {\n if (type1==='instance' && Comparable.detect(v.constructor)) {\n return v.constructor.compare(v, w);\n }\n\n if (type2 === 'instance' && Comparable.detect(w.constructor)) {\n return 1-w.constructor.compare(w, v);\n }\n }\n\n // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION,\n // do so now.\n var mapping = Ember.ORDER_DEFINITION_MAPPING;\n if (!mapping) {\n var order = Ember.ORDER_DEFINITION;\n mapping = Ember.ORDER_DEFINITION_MAPPING = {};\n var idx, len;\n for (idx = 0, len = order.length; idx < len; ++idx) {\n mapping[order[idx]] = idx;\n }\n\n // We no longer need Ember.ORDER_DEFINITION.\n delete Ember.ORDER_DEFINITION;\n }\n\n var type1Index = mapping[type1];\n var type2Index = mapping[type2];\n\n if (type1Index < type2Index) { return -1; }\n if (type1Index > type2Index) { return 1; }\n\n // types are equal - so we have to check values now\n switch (type1) {\n case 'boolean':\n case 'number':\n if (v < w) { return -1; }\n if (v > w) { return 1; }\n return 0;\n\n case 'string':\n var comp = v.localeCompare(w);\n if (comp < 0) { return -1; }\n if (comp > 0) { return 1; }\n return 0;\n\n case 'array':\n var vLen = v.length;\n var wLen = w.length;\n var l = Math.min(vLen, wLen);\n var r = 0;\n var i = 0;\n while (r === 0 && i < l) {\n r = compare(v[i],w[i]);\n i++;\n }\n if (r !== 0) { return r; }\n\n // all elements are equal now\n // shorter array should be ordered first\n if (vLen < wLen) { return -1; }\n if (vLen > wLen) { return 1; }\n // arrays are equal now\n return 0;\n\n case 'instance':\n if (Ember.Comparable && Ember.Comparable.detect(v)) {\n return v.compare(v, w);\n }\n return 0;\n\n case 'date':\n var vNum = v.getTime();\n var wNum = w.getTime();\n if (vNum < wNum) { return -1; }\n if (vNum > wNum) { return 1; }\n return 0;\n\n default:\n return 0;\n }\n};\n\nfunction _copy(obj, deep, seen, copies) {\n var ret, loc, key;\n\n // primitive data types are immutable, just return them.\n if ('object' !== typeof obj || obj===null) return obj;\n\n // avoid cyclical loops\n if (deep && (loc=indexOf(seen, obj))>=0) return copies[loc];\n\n Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof Ember.Object) || (Ember.Copyable && Ember.Copyable.detect(obj)));\n\n // IMPORTANT: this specific test will detect a native array only. Any other\n // object will need to implement Copyable.\n if (Ember.typeOf(obj) === 'array') {\n ret = obj.slice();\n if (deep) {\n loc = ret.length;\n while(--loc>=0) ret[loc] = _copy(ret[loc], deep, seen, copies);\n }\n } else if (Ember.Copyable && Ember.Copyable.detect(obj)) {\n ret = obj.copy(deep, seen, copies);\n } else {\n ret = {};\n for(key in obj) {\n if (!obj.hasOwnProperty(key)) continue;\n\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') continue;\n\n ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];\n }\n }\n\n if (deep) {\n seen.push(obj);\n copies.push(ret);\n }\n\n return ret;\n}\n\n/**\n Creates a clone of the passed object. This function can take just about\n any type of object and create a clone of it, including primitive values\n (which are not actually cloned because they are immutable).\n\n If the passed object implements the `clone()` method, then this function\n will simply call that method and return the result.\n\n @method copy\n @for Ember\n @param {Object} obj The object to clone\n @param {Boolean} deep If true, a deep copy of the object is made\n @return {Object} The cloned object\n*/\nEmber.copy = function(obj, deep) {\n // fast paths\n if ('object' !== typeof obj || obj===null) return obj; // can't copy primitives\n if (Ember.Copyable && Ember.Copyable.detect(obj)) return obj.copy(deep);\n return _copy(obj, deep, deep ? [] : null, deep ? [] : null);\n};\n\n/**\n Convenience method to inspect an object. This method will attempt to\n convert the object into a useful string description.\n\n It is a pretty simple implementation. If you want something more robust,\n use something like JSDump: https://github.com/NV/jsDump\n\n @method inspect\n @for Ember\n @param {Object} obj The object you want to inspect.\n @return {String} A description of the object\n*/\nEmber.inspect = function(obj) {\n var type = Ember.typeOf(obj);\n if (type === 'array') {\n return '[' + obj + ']';\n }\n if (type !== 'object') {\n return obj + '';\n }\n\n var v, ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) {\n v = obj[key];\n if (v === 'toString') { continue; } // ignore useless items\n if (Ember.typeOf(v) === 'function') { v = \"function() { ... }\"; }\n ret.push(key + \": \" + v);\n }\n }\n return \"{\" + ret.join(\", \") + \"}\";\n};\n\n/**\n Compares two objects, returning true if they are logically equal. This is\n a deeper comparison than a simple triple equal. For sets it will compare the\n internal objects. For any other object that implements `isEqual()` it will\n respect that method.\n\n ```javascript\n Ember.isEqual('hello', 'hello'); // true\n Ember.isEqual(1, 2); // false\n Ember.isEqual([4,2], [4,2]); // false\n ```\n\n @method isEqual\n @for Ember\n @param {Object} a first object to compare\n @param {Object} b second object to compare\n @return {Boolean}\n*/\nEmber.isEqual = function(a, b) {\n if (a && 'function'===typeof a.isEqual) return a.isEqual(b);\n return a === b;\n};\n\n// Used by Ember.compare\nEmber.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [\n 'undefined',\n 'null',\n 'boolean',\n 'number',\n 'string',\n 'array',\n 'object',\n 'instance',\n 'function',\n 'class',\n 'date'\n];\n\n/**\n Returns all of the keys defined on an object or hash. This is useful\n when inspecting objects for debugging. On browsers that support it, this\n uses the native `Object.keys` implementation.\n\n @method keys\n @for Ember\n @param {Object} obj\n @return {Array} Array containing keys of obj\n*/\nEmber.keys = Object.keys;\n\nif (!Ember.keys || Ember.create.isSimulated) {\n var prototypeProperties = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n 'toLocaleString',\n 'toString'\n ],\n pushPropertyName = function(obj, array, key) {\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') return;\n if (key === '_super') return;\n if (indexOf(array, key) >= 0) return;\n if (!obj.hasOwnProperty(key)) return;\n\n array.push(key);\n };\n\n Ember.keys = function(obj) {\n var ret = [], key;\n for (key in obj) {\n pushPropertyName(obj, ret, key);\n }\n\n // IE8 doesn't enumerate property that named the same as prototype properties.\n for (var i = 0, l = prototypeProperties.length; i < l; i++) {\n key = prototypeProperties[i];\n\n pushPropertyName(obj, ret, key);\n }\n\n return ret;\n };\n}\n\n})();\n//@ sourceURL=ember-runtime/core");minispade.register('ember-runtime/ext', "(function() {minispade.require('ember-runtime/ext/ember');\nminispade.require('ember-runtime/ext/string');\nminispade.require('ember-runtime/ext/function');\n\n})();\n//@ sourceURL=ember-runtime/ext");minispade.register('ember-runtime/ext/ember', "(function() {/**\n Expose RSVP implementation\n \n Documentation can be found here: https://github.com/tildeio/rsvp.js/blob/master/README.md\n\n @class RSVP\n @namespace Ember\n @constructor\n*/\nEmber.RSVP = requireModule('rsvp');\n\n})();\n//@ sourceURL=ember-runtime/ext/ember");minispade.register('ember-runtime/ext/function', "(function() {minispade.require('ember-runtime/core');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar a_slice = Array.prototype.slice;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {\n\n /**\n The `property` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n `true`, which is the default.\n\n Computed properties allow you to treat a function like a property:\n\n ```javascript\n MyApp.President = Ember.Object.extend({\n firstName: '',\n lastName: '',\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Call this flag to mark the function as a property\n }.property()\n });\n\n var president = MyApp.President.create({\n firstName: \"Barack\",\n lastName: \"Obama\"\n });\n\n president.get('fullName'); // \"Barack Obama\"\n ```\n\n Treating a function like a property is useful because they can work with\n bindings, just like any other property.\n\n Many computed properties have dependencies on other properties. For\n example, in the above example, the `fullName` property depends on\n `firstName` and `lastName` to determine its value. You can tell Ember\n about these dependencies like this:\n\n ```javascript\n MyApp.President = Ember.Object.extend({\n firstName: '',\n lastName: '',\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember.js that this computed property depends on firstName\n // and lastName\n }.property('firstName', 'lastName')\n });\n ```\n\n Make sure you list these dependencies so Ember knows when to update\n bindings that connect to a computed property. Changing a dependency\n will not immediately trigger an update of the computed property, but\n will instead clear the cache so that it is updated when the next `get`\n is called on the property.\n\n See [Ember.ComputedProperty](/api/classes/Ember.ComputedProperty.html), [Ember.computed](/api/#method_computed).\n\n @method property\n @for Function\n */\n Function.prototype.property = function() {\n var ret = Ember.computed(this);\n return ret.property.apply(ret, arguments);\n };\n\n /**\n The `observes` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n In the future this method may become asynchronous. If you want to ensure\n synchronous behavior, use `observesImmediately`.\n\n See `Ember.observer`.\n\n @method observes\n @for Function\n */\n Function.prototype.observes = function() {\n this.__ember_observes__ = a_slice.call(arguments);\n return this;\n };\n\n /**\n The `observesImmediately` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can observe property changes simply by adding the `observesImmediately`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes immediately after the \"value\" property changes\n }.observesImmediately('value')\n });\n ```\n\n In the future, `observes` may become asynchronous. In this event,\n `observesImmediately` will maintain the synchronous behavior.\n\n See `Ember.immediateObserver`.\n\n @method observesImmediately\n @for Function\n */\n Function.prototype.observesImmediately = function() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", arg.indexOf('.') === -1);\n }\n\n return this.observes.apply(this, arguments);\n };\n\n /**\n The `observesBefore` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can get notified when a property change is about to happen by\n by adding the `observesBefore` call to the end of your method\n declarations in classes that you write. For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property is about to change\n }.observesBefore('value')\n });\n ```\n\n See `Ember.beforeObserver`.\n\n @method observesBefore\n @for Function\n */\n Function.prototype.observesBefore = function() {\n this.__ember_observesBefore__ = a_slice.call(arguments);\n return this;\n };\n\n /**\n The `on` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can listen for events simply by adding the `on` call to the end of\n your method declarations in classes or mixins that you write. For example:\n\n ```javascript\n Ember.Mixin.create({\n doSomethingWithElement: function() {\n // Executes whenever the \"didInsertElement\" event fires\n }.on('didInsertElement')\n });\n ```\n\n See `Ember.on`.\n\n @method on\n @for Function\n */\n Function.prototype.on = function() {\n var events = a_slice.call(arguments);\n this.__ember_listens__ = events;\n return this;\n };\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/function");minispade.register('ember-runtime/ext/string', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar fmt = Ember.String.fmt,\n w = Ember.String.w,\n loc = Ember.String.loc,\n camelize = Ember.String.camelize,\n decamelize = Ember.String.decamelize,\n dasherize = Ember.String.dasherize,\n underscore = Ember.String.underscore,\n capitalize = Ember.String.capitalize,\n classify = Ember.String.classify;\n\nif (Ember.FEATURES.isEnabled(\"string-humanize\")) {\n var humanize = Ember.String.humanize;\n}\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n See [Ember.String.fmt](/api/classes/Ember.String.html#method_fmt).\n\n @method fmt\n @for String\n */\n String.prototype.fmt = function() {\n return fmt(this, arguments);\n };\n\n /**\n See [Ember.String.w](/api/classes/Ember.String.html#method_w).\n\n @method w\n @for String\n */\n String.prototype.w = function() {\n return w(this);\n };\n\n /**\n See [Ember.String.loc](/api/classes/Ember.String.html#method_loc).\n\n @method loc\n @for String\n */\n String.prototype.loc = function() {\n return loc(this, arguments);\n };\n\n /**\n See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize).\n\n @method camelize\n @for String\n */\n String.prototype.camelize = function() {\n return camelize(this);\n };\n\n /**\n See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize).\n\n @method decamelize\n @for String\n */\n String.prototype.decamelize = function() {\n return decamelize(this);\n };\n\n /**\n See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize).\n\n @method dasherize\n @for String\n */\n String.prototype.dasherize = function() {\n return dasherize(this);\n };\n\n /**\n See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore).\n\n @method underscore\n @for String\n */\n String.prototype.underscore = function() {\n return underscore(this);\n };\n\n /**\n See [Ember.String.classify](/api/classes/Ember.String.html#method_classify).\n\n @method classify\n @for String\n */\n String.prototype.classify = function() {\n return classify(this);\n };\n\n /**\n See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize).\n\n @method capitalize\n @for String\n */\n String.prototype.capitalize = function() {\n return capitalize(this);\n };\n\n if (Ember.FEATURES.isEnabled(\"string-humanize\")) {\n /**\n See [Ember.String.humanize](/api/classes/Ember.String.html#method_humanize).\n\n @method humanize\n @for String\n */\n String.prototype.humanize = function() {\n return humanize(this);\n };\n }\n\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/string");minispade.register('ember-runtime', "(function() {/**\nEmber Runtime\n\n@module ember\n@submodule ember-runtime\n@requires ember-metal\n*/\nminispade.require('container');\nminispade.require('ember-metal');\nminispade.require('ember-runtime/core');\nminispade.require('ember-runtime/computed/reduce_computed_macros');\nminispade.require('ember-runtime/ext');\nminispade.require('ember-runtime/mixins');\nminispade.require('ember-runtime/system');\nminispade.require('ember-runtime/controllers');\n\n})();\n//@ sourceURL=ember-runtime");minispade.register('ember-runtime/mixins', "(function() {minispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/comparable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/enumerable');\nminispade.require('ember-runtime/mixins/freezable');\nminispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/mixins/target_action_support');\nminispade.require('ember-runtime/mixins/evented');\nminispade.require('ember-runtime/mixins/deferred');\nminispade.require('ember-runtime/mixins/action_handler');\nminispade.require('ember-runtime/mixins/promise_proxy');\n\n})();\n//@ sourceURL=ember-runtime/mixins");minispade.register('ember-runtime/mixins/action_handler', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, typeOf = Ember.typeOf;\n\n/**\n The `Ember.ActionHandler` mixin implements support for moving an `actions`\n property to an `_actions` property at extend time, and adding `_actions`\n to the object's mergedProperties list.\n\n `Ember.ActionHandler` is used internally by Ember in `Ember.View`,\n `Ember.Controller`, and `Ember.Route`.\n\n @class ActionHandler\n @namespace Ember\n*/\nEmber.ActionHandler = Ember.Mixin.create({\n mergedProperties: ['_actions'],\n\n /**\n @private\n\n Moves `actions` to `_actions` at extend time. Note that this currently\n modifies the mixin themselves, which is technically dubious but\n is practically of little consequence. This may change in the future.\n\n @method willMergeMixin\n */\n willMergeMixin: function(props) {\n var hashName;\n\n if (!props._actions) {\n if (typeOf(props.actions) === 'object') {\n hashName = 'actions';\n } else if (typeOf(props.events) === 'object') {\n Ember.deprecate('Action handlers contained in an `events` object are deprecated in favor of putting them in an `actions` object', false);\n hashName = 'events';\n }\n\n if (hashName) {\n props._actions = Ember.merge(props._actions || {}, props[hashName]);\n }\n\n delete props[hashName];\n }\n },\n\n send: function(actionName) {\n var args = [].slice.call(arguments, 1), target;\n\n if (this._actions && this._actions[actionName]) {\n if (this._actions[actionName].apply(this, args) === true) {\n // handler returned true, so this action will bubble\n } else {\n return;\n }\n } else if (this.deprecatedSend && this.deprecatedSendHandles && this.deprecatedSendHandles(actionName)) {\n if (this.deprecatedSend.apply(this, [].slice.call(arguments)) === true) {\n // handler return true, so this action will bubble\n } else {\n return;\n }\n }\n\n if (target = get(this, 'target')) {\n Ember.assert(\"The `target` for \" + this + \" (\" + target + \") does not have a `send` method\", typeof target.send === 'function');\n target.send.apply(target, arguments);\n }\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/action_handler");minispade.register('ember-runtime/mixins/array', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set, isNone = Ember.isNone, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;\n\n// ..........................................................\n// ARRAY\n//\n/**\n This module implements Observer-friendly Array-like behavior. This mixin is\n picked up by the Array class as well as other controllers, etc. that want to\n appear to be arrays.\n\n Unlike `Ember.Enumerable,` this mixin defines methods specifically for\n collections that provide index-ordered access to their contents. When you\n are designing code that needs to accept any kind of Array-like object, you\n should use these methods instead of Array primitives because these will\n properly notify observers of changes to the array.\n\n Although these methods are efficient, they do add a layer of indirection to\n your application so it is a good idea to use them only when you need the\n flexibility of using both true JavaScript arrays and \"virtual\" arrays such\n as controllers and collections.\n\n You can use the methods defined in this module to access and modify array\n contents in a KVO-friendly way. You can also be notified whenever the\n membership of an array changes by changing the syntax of the property to\n `.observes('*myProperty.[]')`.\n\n To support `Ember.Array` in your own class, you must override two\n primitives to use it: `replace()` and `objectAt()`.\n\n Note that the Ember.Array mixin also incorporates the `Ember.Enumerable`\n mixin. All `Ember.Array`-like objects are also enumerable.\n\n @class Array\n @namespace Ember\n @uses Ember.Enumerable\n @since Ember 0.9.0\n*/\nEmber.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.prototype */ {\n\n /**\n Your array must support the `length` property. Your replace methods should\n set this property whenever it changes.\n\n @property {Number} length\n */\n length: Ember.required(),\n\n /**\n Returns the object at the given `index`. If the given `index` is negative\n or is greater or equal than the array length, returns `undefined`.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n If your object supports retrieving the value of an array item using `get()`\n (i.e. `myArray.get(0)`), then you do not need to implement this method\n yourself.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectAt(0); // \"a\"\n arr.objectAt(3); // \"d\"\n arr.objectAt(-1); // undefined\n arr.objectAt(4); // undefined\n arr.objectAt(5); // undefined\n ```\n\n @method objectAt\n @param {Number} idx The index of the item to return.\n @return {*} item at index or undefined\n */\n objectAt: function(idx) {\n if ((idx < 0) || (idx>=get(this, 'length'))) return undefined ;\n return get(this, idx);\n },\n\n /**\n This returns the objects at the specified indexes, using `objectAt`.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectsAt([0, 1, 2]); // [\"a\", \"b\", \"c\"]\n arr.objectsAt([2, 3, 4]); // [\"c\", \"d\", undefined]\n ```\n\n @method objectsAt\n @param {Array} indexes An array of indexes of items to return.\n @return {Array}\n */\n objectsAt: function(indexes) {\n var self = this;\n return map(indexes, function(idx) { return self.objectAt(idx); });\n },\n\n // overrides Ember.Enumerable version\n nextObject: function(idx) {\n return this.objectAt(idx);\n },\n\n /**\n This is the handler for the special array content property. If you get\n this property, it will return this. If you set this property it a new\n array, it will replace the current content.\n\n This property overrides the default property defined in `Ember.Enumerable`.\n\n @property []\n @return this\n */\n '[]': Ember.computed(function(key, value) {\n if (value !== undefined) this.replace(0, get(this, 'length'), value) ;\n return this ;\n }),\n\n firstObject: Ember.computed(function() {\n return this.objectAt(0);\n }),\n\n lastObject: Ember.computed(function() {\n return this.objectAt(get(this, 'length')-1);\n }),\n\n // optimized version from Enumerable\n contains: function(obj) {\n return this.indexOf(obj) >= 0;\n },\n\n // Add any extra methods to Ember.Array that are native to the built-in Array.\n /**\n Returns a new array that is a slice of the receiver. This implementation\n uses the observable array methods to retrieve the objects for the new\n slice.\n\n ```javascript\n var arr = ['red', 'green', 'blue'];\n arr.slice(0); // ['red', 'green', 'blue']\n arr.slice(0, 2); // ['red', 'green']\n arr.slice(1, 100); // ['green', 'blue']\n ```\n\n @method slice\n @param {Integer} beginIndex (Optional) index to begin slicing from.\n @param {Integer} endIndex (Optional) index to end the slice at.\n @return {Array} New array with specified slice\n */\n slice: function(beginIndex, endIndex) {\n var ret = Ember.A();\n var length = get(this, 'length') ;\n if (isNone(beginIndex)) beginIndex = 0 ;\n if (isNone(endIndex) || (endIndex > length)) endIndex = length ;\n\n if (beginIndex < 0) beginIndex = length + beginIndex;\n if (endIndex < 0) endIndex = length + endIndex;\n\n while(beginIndex < endIndex) {\n ret[ret.length] = this.objectAt(beginIndex++) ;\n }\n return ret ;\n },\n\n /**\n Returns the index of the given object's first occurrence.\n If no `startAt` argument is given, the starting location to\n search is 0. If it's negative, will count backward from\n the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.indexOf(\"a\"); // 0\n arr.indexOf(\"z\"); // -1\n arr.indexOf(\"a\", 2); // 4\n arr.indexOf(\"a\", -1); // 4\n arr.indexOf(\"b\", 3); // -1\n arr.indexOf(\"a\", 100); // -1\n ```\n\n @method indexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n indexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined) startAt = 0;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this.objectAt(idx) === object) return idx ;\n }\n return -1;\n },\n\n /**\n Returns the index of the given object's last occurrence.\n If no `startAt` argument is given, the search starts from\n the last position. If it's negative, will count backward\n from the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.lastIndexOf(\"a\"); // 4\n arr.lastIndexOf(\"z\"); // -1\n arr.lastIndexOf(\"a\", 2); // 0\n arr.lastIndexOf(\"a\", -1); // 4\n arr.lastIndexOf(\"b\", 3); // 1\n arr.lastIndexOf(\"a\", 100); // 4\n ```\n\n @method lastIndexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n lastIndexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined || startAt >= len) startAt = len-1;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this.objectAt(idx) === object) return idx ;\n }\n return -1;\n },\n\n // ..........................................................\n // ARRAY OBSERVERS\n //\n\n /**\n Adds an array observer to the receiving array. The array observer object\n normally must implement two methods:\n\n * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be\n called just before the array is modified.\n * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be\n called just after the array is modified.\n\n Both callbacks will be passed the observed object, starting index of the\n change as well a a count of the items to be removed and added. You can use\n these callbacks to optionally inspect the array during the change, clear\n caches, or do any other bookkeeping necessary.\n\n In addition to passing a target, you can also include an options hash\n which you can use to override the method names that will be invoked on the\n target.\n\n @method addArrayObserver\n @param {Object} target The observer object.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n addArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.addListener(this, '@array:before', target, willChange);\n Ember.addListener(this, '@array:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Removes an array observer from the object if the observer is current\n registered. Calling this method multiple times with the same object will\n have no effect.\n\n @method removeArrayObserver\n @param {Object} target The object observing the array.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n removeArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.removeListener(this, '@array:before', target, willChange);\n Ember.removeListener(this, '@array:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property Boolean\n */\n hasArrayObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@array:change') || Ember.hasListeners(this, '@array:before');\n }),\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just before the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentWillChange\n @param {Number} startIdx The starting index in the array that will change.\n @param {Number} removeAmt The number of items that will be removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that will be added. If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentWillChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n // Make sure the @each proxy is set up if anyone is observing @each\n if (Ember.isWatching(this, '@each')) { get(this, '@each'); }\n\n Ember.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);\n\n var removing, lim;\n if (startIdx>=0 && removeAmt>=0 && get(this, 'hasEnumerableObservers')) {\n removing = [];\n lim = startIdx+removeAmt;\n for(var idx=startIdx;idx<lim;idx++) removing.push(this.objectAt(idx));\n } else {\n removing = removeAmt;\n }\n\n this.enumerableContentWillChange(removing, addAmt);\n\n return this;\n },\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just after the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentDidChange\n @param {Number} startIdx The starting index in the array that did change.\n @param {Number} removeAmt The number of items that were removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that were added. If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentDidChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n var adding, lim;\n if (startIdx>=0 && addAmt>=0 && get(this, 'hasEnumerableObservers')) {\n adding = [];\n lim = startIdx+addAmt;\n for(var idx=startIdx;idx<lim;idx++) adding.push(this.objectAt(idx));\n } else {\n adding = addAmt;\n }\n\n this.enumerableContentDidChange(removeAmt, adding);\n Ember.sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]);\n\n var length = get(this, 'length'),\n cachedFirst = cacheFor(this, 'firstObject'),\n cachedLast = cacheFor(this, 'lastObject');\n if (this.objectAt(0) !== cachedFirst) {\n Ember.propertyWillChange(this, 'firstObject');\n Ember.propertyDidChange(this, 'firstObject');\n }\n if (this.objectAt(length-1) !== cachedLast) {\n Ember.propertyWillChange(this, 'lastObject');\n Ember.propertyDidChange(this, 'lastObject');\n }\n\n return this;\n },\n\n // ..........................................................\n // ENUMERATED PROPERTIES\n //\n\n /**\n Returns a special object that can be used to observe individual properties\n on the array. Just get an equivalent property on this object and it will\n return an enumerable that maps automatically to the named key on the\n member objects.\n\n If you merely want to watch for any items being added or removed to the array,\n use the `[]` property instead of `@each`.\n\n @property @each\n */\n '@each': Ember.computed(function() {\n if (!this.__each) this.__each = new Ember.EachProxy(this);\n return this.__each;\n })\n\n}) ;\n\n})();\n//@ sourceURL=ember-runtime/mixins/array");minispade.register('ember-runtime/mixins/comparable', "(function() {minispade.require('ember-runtime/core');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n/**\n Implements some standard methods for comparing objects. Add this mixin to\n any class you create that can compare its instances.\n\n You should implement the `compare()` method.\n\n @class Comparable\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Comparable = Ember.Mixin.create( /** @scope Ember.Comparable.prototype */{\n\n /**\n Override to return the result of the comparison of the two parameters. The\n compare method should return:\n\n - `-1` if `a < b`\n - `0` if `a == b`\n - `1` if `a > b`\n\n Default implementation raises an exception.\n\n @method compare\n @param a {Object} the first object to compare\n @param b {Object} the second object to compare\n @return {Integer} the result of the comparison\n */\n compare: Ember.required(Function)\n\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/comparable");minispade.register('ember-runtime/mixins/copyable', "(function() {minispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Implements some standard methods for copying an object. Add this mixin to\n any object you create that can create a copy of itself. This mixin is\n added automatically to the built-in array.\n\n You should generally implement the `copy()` method to return a copy of the\n receiver.\n\n Note that `frozenCopy()` will only work if you also implement\n `Ember.Freezable`.\n\n @class Copyable\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Copyable = Ember.Mixin.create(/** @scope Ember.Copyable.prototype */ {\n\n /**\n Override to return a copy of the receiver. Default implementation raises\n an exception.\n\n @method copy\n @param {Boolean} deep if `true`, a deep copy of the object should be made\n @return {Object} copy of receiver\n */\n copy: Ember.required(Function),\n\n /**\n If the object implements `Ember.Freezable`, then this will return a new\n copy if the object is not frozen and the receiver if the object is frozen.\n\n Raises an exception if you try to call this method on a object that does\n not support freezing.\n\n You should use this method whenever you want a copy of a freezable object\n since a freezable object can simply return itself without actually\n consuming more memory.\n\n @method frozenCopy\n @return {Object} copy of receiver or receiver\n */\n frozenCopy: function() {\n if (Ember.Freezable && Ember.Freezable.detect(this)) {\n return get(this, 'isFrozen') ? this : this.copy().freeze();\n } else {\n throw new Ember.Error(Ember.String.fmt(\"%@ does not support freezing\", [this]));\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/copyable");minispade.register('ember-runtime/mixins/deferred', "(function() {var RSVP = requireModule(\"rsvp\");\n\nRSVP.configure('async', function(callback, promise) {\n Ember.run.schedule('actions', promise, callback, promise);\n});\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get;\n\n/**\n @class Deferred\n @namespace Ember\n */\nEmber.DeferredMixin = Ember.Mixin.create({\n /**\n Add handlers to be called when the Deferred object is resolved or rejected.\n\n @method then\n @param {Function} resolve a callback function to be called when done\n @param {Function} reject a callback function to be called when failed\n */\n then: function(resolve, reject) {\n var deferred, promise, entity;\n\n entity = this;\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n function fulfillmentHandler(fulfillment) {\n if (fulfillment === promise) {\n return resolve(entity);\n } else {\n return resolve(fulfillment);\n }\n }\n\n return promise.then(resolve && fulfillmentHandler, reject);\n },\n\n /**\n Resolve a Deferred object and call any `doneCallbacks` with the given args.\n\n @method resolve\n */\n resolve: function(value) {\n var deferred, promise;\n\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n if (value === this) {\n deferred.resolve(promise);\n } else {\n deferred.resolve(value);\n }\n },\n\n /**\n Reject a Deferred object and call any `failCallbacks` with the given args.\n\n @method reject\n */\n reject: function(value) {\n get(this, '_deferred').reject(value);\n },\n\n _deferred: Ember.computed(function() {\n return RSVP.defer();\n })\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/deferred");minispade.register('ember-runtime/mixins/enumerable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\nvar a_slice = Array.prototype.slice;\nvar a_indexOf = Ember.EnumerableUtils.indexOf;\n\nvar contexts = [];\n\nfunction popCtx() {\n return contexts.length===0 ? {} : contexts.pop();\n}\n\nfunction pushCtx(ctx) {\n contexts.push(ctx);\n return null;\n}\n\nfunction iter(key, value) {\n var valueProvided = arguments.length === 2;\n\n function i(item) {\n var cur = get(item, key);\n return valueProvided ? value===cur : !!cur;\n }\n return i ;\n}\n\n/**\n This mixin defines the common interface implemented by enumerable objects\n in Ember. Most of these methods follow the standard Array iteration\n API defined up to JavaScript 1.8 (excluding language-specific features that\n cannot be emulated in older versions of JavaScript).\n\n This mixin is applied automatically to the Array class on page load, so you\n can use any of these methods on simple arrays. If Array already implements\n one of these methods, the mixin will not override them.\n\n ## Writing Your Own Enumerable\n\n To make your own custom class enumerable, you need two items:\n\n 1. You must have a length property. This property should change whenever\n the number of items in your enumerable object changes. If you using this\n with an `Ember.Object` subclass, you should be sure to change the length\n property using `set().`\n\n 2. If you must implement `nextObject().` See documentation.\n\n Once you have these two methods implement, apply the `Ember.Enumerable` mixin\n to your class and you will be able to enumerate the contents of your object\n like any other collection.\n\n ## Using Ember Enumeration with Other Libraries\n\n Many other libraries provide some kind of iterator or enumeration like\n facility. This is often where the most common API conflicts occur.\n Ember's API is designed to be as friendly as possible with other\n libraries by implementing only methods that mostly correspond to the\n JavaScript 1.8 API.\n\n @class Enumerable\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Enumerable = Ember.Mixin.create({\n\n /**\n Implement this method to make your class enumerable.\n\n This method will be call repeatedly during enumeration. The index value\n will always begin with 0 and increment monotonically. You don't have to\n rely on the index value to determine what object to return, but you should\n always check the value and start from the beginning when you see the\n requested index is 0.\n\n The `previousObject` is the object that was returned from the last call\n to `nextObject` for the current iteration. This is a useful way to\n manage iteration if you are tracing a linked list, for example.\n\n Finally the context parameter will always contain a hash you can use as\n a \"scratchpad\" to maintain any other state you need in order to iterate\n properly. The context object is reused and is not reset between\n iterations so make sure you setup the context with a fresh state whenever\n the index parameter is 0.\n\n Generally iterators will continue to call `nextObject` until the index\n reaches the your current length-1. If you run out of data before this\n time for some reason, you should simply return undefined.\n\n The default implementation of this method simply looks up the index.\n This works great on any Array-like objects.\n\n @method nextObject\n @param {Number} index the current index of the iteration\n @param {Object} previousObject the value returned by the last call to\n `nextObject`.\n @param {Object} context a context object you can use to maintain state.\n @return {Object} the next object in the iteration or undefined\n */\n nextObject: Ember.required(Function),\n\n /**\n Helper method returns the first object from a collection. This is usually\n used by bindings and other parts of the framework to extract a single\n object if the enumerable contains only one item.\n\n If you override this method, you should implement it so that it will\n always return the same value each time it is called. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('firstObject'); // \"a\"\n\n var arr = [];\n arr.get('firstObject'); // undefined\n ```\n\n @property firstObject\n @return {Object} the object or undefined\n */\n firstObject: Ember.computed(function() {\n if (get(this, 'length')===0) return undefined ;\n\n // handle generic enumerables\n var context = popCtx(), ret;\n ret = this.nextObject(0, null, context);\n pushCtx(context);\n return ret ;\n }).property('[]'),\n\n /**\n Helper method returns the last object from a collection. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('lastObject'); // \"c\"\n\n var arr = [];\n arr.get('lastObject'); // undefined\n ```\n\n @property lastObject\n @return {Object} the last object or undefined\n */\n lastObject: Ember.computed(function() {\n var len = get(this, 'length');\n if (len===0) return undefined ;\n var context = popCtx(), idx=0, cur, last = null;\n do {\n last = cur;\n cur = this.nextObject(idx++, last, context);\n } while (cur !== undefined);\n pushCtx(context);\n return last;\n }).property('[]'),\n\n /**\n Returns `true` if the passed object can be found in the receiver. The\n default version will iterate through the enumerable until the object\n is found. You may want to override this with a more efficient version.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.contains(\"a\"); // true\n arr.contains(\"z\"); // false\n ```\n\n @method contains\n @param {Object} obj The object to search for.\n @return {Boolean} `true` if object is found in enumerable.\n */\n contains: function(obj) {\n return this.find(function(item) { return item===obj; }) !== undefined;\n },\n\n /**\n Iterates through the enumerable, calling the passed function on each\n item. This method corresponds to the `forEach()` method defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method forEach\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} receiver\n */\n forEach: function(callback, target) {\n if (typeof callback !== \"function\") throw new TypeError() ;\n var len = get(this, 'length'), last = null, context = popCtx();\n\n if (target === undefined) target = null;\n\n for(var idx=0;idx<len;idx++) {\n var next = this.nextObject(idx, last, context) ;\n callback.call(target, next, idx, this);\n last = next ;\n }\n last = null ;\n context = pushCtx(context);\n return this ;\n },\n\n /**\n Alias for `mapBy`\n\n @method getEach\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n getEach: function(key) {\n return this.mapBy(key);\n },\n\n /**\n Sets the value on the named property for each member. This is more\n efficient than using other methods defined on this helper. If the object\n implements Ember.Observable, the value will be changed to `set(),` otherwise\n it will be set directly. `null` objects are skipped.\n\n @method setEach\n @param {String} key The key to set\n @param {Object} value The object to set\n @return {Object} receiver\n */\n setEach: function(key, value) {\n return this.forEach(function(item) {\n set(item, key, value);\n });\n },\n\n /**\n Maps all of the items in the enumeration to another value, returning\n a new array. This method corresponds to `map()` defined in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the mapped value.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method map\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} The mapped array.\n */\n map: function(callback, target) {\n var ret = Ember.A();\n this.forEach(function(x, idx, i) {\n ret[idx] = callback.call(target, x, idx,i);\n });\n return ret ;\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapBy\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n mapBy: function(key) {\n return this.map(function(next) {\n return get(next, key);\n });\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapProperty\n @param {String} key name of the property\n @return {Array} The mapped array.\n @deprecated Use `mapBy` instead\n */\n\n mapProperty: Ember.aliasMethod('mapBy'),\n\n /**\n Returns an array with all of the items in the enumeration that the passed\n function returns true for. This method corresponds to `filter()` defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method filter\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A filtered array.\n */\n filter: function(callback, target) {\n var ret = Ember.A();\n this.forEach(function(x, idx, i) {\n if (callback.call(target, x, idx, i)) ret.push(x);\n });\n return ret ;\n },\n\n /**\n Returns an array with all of the items in the enumeration where the passed\n function returns false for. This method is the inverse of filter().\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n function(item, index, enumerable);\n\n - *item* is the current item in the iteration.\n - *index* is the current index in the iteration\n - *enumerable* is the enumerable object itself.\n\n It should return the a falsey value to include the item in the results.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as \"this\" on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method reject\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A rejected array.\n */\n reject: function(callback, target) {\n return this.filter(function() {\n return !(callback.apply(target, arguments));\n });\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} filtered array\n */\n filterBy: function(key, value) {\n return this.filter(iter.apply(this, arguments));\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} filtered array\n @deprecated Use `filterBy` instead\n */\n filterProperty: Ember.aliasMethod('filterBy'),\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n */\n rejectBy: function(key, value) {\n var exactValue = function(item) { return get(item, key) === value; },\n hasValue = function(item) { return !!get(item, key); },\n use = (arguments.length === 2 ? exactValue : hasValue);\n\n return this.reject(use);\n },\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n @deprecated Use `rejectBy` instead\n */\n rejectProperty: Ember.aliasMethod('rejectBy'),\n\n /**\n Returns the first item in the array for which the callback returns true.\n This method works similar to the `filter()` method defined in JavaScript 1.6\n except that it will stop working on the array once a match is found.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method find\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} Found item or `undefined`.\n */\n find: function(callback, target) {\n var len = get(this, 'length') ;\n if (target === undefined) target = null;\n\n var last = null, next, found = false, ret ;\n var context = popCtx();\n for(var idx=0;idx<len && !found;idx++) {\n next = this.nextObject(idx, last, context) ;\n if (found = callback.call(target, next, idx, this)) ret = next ;\n last = next ;\n }\n next = last = null ;\n context = pushCtx(context);\n return ret ;\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n */\n findBy: function(key, value) {\n return this.find(iter.apply(this, arguments));\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n @deprecated Use `findBy` instead\n */\n findProperty: Ember.aliasMethod('findBy'),\n\n /**\n Returns `true` if the passed function returns true for every item in the\n enumeration. This corresponds with the `every()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` or `false`.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Example Usage:\n\n ```javascript\n if (people.every(isEngineer)) { Paychecks.addBigBonus(); }\n ```\n\n @method every\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean}\n */\n every: function(callback, target) {\n return !this.find(function(x, idx, i) {\n return !callback.call(target, x, idx, i);\n });\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for all items in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method everyBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean}\n */\n everyBy: function(key, value) {\n return this.every(iter.apply(this, arguments));\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for all items in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method everyProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean}\n @deprecated Use `everyBy` instead\n */\n everyProperty: Ember.aliasMethod('everyBy'),\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.any(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method any\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean} `true` if the passed function returns `true` for any item\n */\n any: function(callback, target) {\n return !!this.find(function(x, idx, i) {\n return !!callback.call(target, x, idx, i);\n });\n },\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.some(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method some\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `any` instead\n */\n some: Ember.aliasMethod('any'),\n\n /**\n Returns `true` if the passed property resolves to `true` for any item in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method anyBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n */\n anyBy: function(key, value) {\n return this.any(iter.apply(this, arguments));\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for any item in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method someProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `anyBy` instead\n */\n someProperty: Ember.aliasMethod('anyBy'),\n\n /**\n This will combine the values of the enumerator into a single value. It\n is a useful way to collect a summary value from an enumeration. This\n corresponds to the `reduce()` method defined in JavaScript 1.8.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(previousValue, item, index, enumerable);\n ```\n\n - `previousValue` is the value returned by the last call to the iterator.\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Return the new cumulative value.\n\n In addition to the callback you can also pass an `initialValue`. An error\n will be raised if you do not pass an initial value and the enumerator is\n empty.\n\n Note that unlike the other methods, this method does not allow you to\n pass a target object to set as this for the callback. It's part of the\n spec. Sorry.\n\n @method reduce\n @param {Function} callback The callback to execute\n @param {Object} initialValue Initial value for the reduce\n @param {String} reducerProperty internal use only.\n @return {Object} The reduced value.\n */\n reduce: function(callback, initialValue, reducerProperty) {\n if (typeof callback !== \"function\") { throw new TypeError(); }\n\n var ret = initialValue;\n\n this.forEach(function(item, i) {\n ret = callback.call(null, ret, item, i, this, reducerProperty);\n }, this);\n\n return ret;\n },\n\n /**\n Invokes the named method on every object in the receiver that\n implements it. This method corresponds to the implementation in\n Prototype 1.6.\n\n @method invoke\n @param {String} methodName the name of the method\n @param {Object...} args optional arguments to pass as well.\n @return {Array} return values from calling invoke.\n */\n invoke: function(methodName) {\n var args, ret = Ember.A();\n if (arguments.length>1) args = a_slice.call(arguments, 1);\n\n this.forEach(function(x, idx) {\n var method = x && x[methodName];\n if ('function' === typeof method) {\n ret[idx] = args ? method.apply(x, args) : method.call(x);\n }\n }, this);\n\n return ret;\n },\n\n /**\n Simply converts the enumerable into a genuine array. The order is not\n guaranteed. Corresponds to the method implemented by Prototype.\n\n @method toArray\n @return {Array} the enumerable as an array.\n */\n toArray: function() {\n var ret = Ember.A();\n this.forEach(function(o, idx) { ret[idx] = o; });\n return ret ;\n },\n\n /**\n Returns a copy of the array with all null and undefined elements removed.\n\n ```javascript\n var arr = [\"a\", null, \"c\", undefined];\n arr.compact(); // [\"a\", \"c\"]\n ```\n\n @method compact\n @return {Array} the array without null and undefined elements.\n */\n compact: function() {\n return this.filter(function(value) { return value != null; });\n },\n\n /**\n Returns a new enumerable that excludes the passed value. The default\n implementation returns an array regardless of the receiver type unless\n the receiver does not contain the value.\n\n ```javascript\n var arr = [\"a\", \"b\", \"a\", \"c\"];\n arr.without(\"a\"); // [\"b\", \"c\"]\n ```\n\n @method without\n @param {Object} value\n @return {Ember.Enumerable}\n */\n without: function(value) {\n if (!this.contains(value)) return this; // nothing to do\n var ret = Ember.A();\n this.forEach(function(k) {\n if (k !== value) ret[ret.length] = k;\n }) ;\n return ret ;\n },\n\n /**\n Returns a new enumerable that contains only unique values. The default\n implementation returns an array regardless of the receiver type.\n\n ```javascript\n var arr = [\"a\", \"a\", \"b\", \"b\"];\n arr.uniq(); // [\"a\", \"b\"]\n ```\n\n @method uniq\n @return {Ember.Enumerable}\n */\n uniq: function() {\n var ret = Ember.A();\n this.forEach(function(k) {\n if (a_indexOf(ret, k)<0) ret.push(k);\n });\n return ret;\n },\n\n /**\n This property will trigger anytime the enumerable's content changes.\n You can observe this property to be notified of changes to the enumerables\n content.\n\n For plain enumerables, this property is read only. `Ember.Array` overrides\n this method.\n\n @property []\n @type Ember.Array\n @return this\n */\n '[]': Ember.computed(function(key, value) {\n return this;\n }),\n\n // ..........................................................\n // ENUMERABLE OBSERVERS\n //\n\n /**\n Registers an enumerable observer. Must implement `Ember.EnumerableObserver`\n mixin.\n\n @method addEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n addEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.addListener(this, '@enumerable:before', target, willChange);\n Ember.addListener(this, '@enumerable:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Removes a registered enumerable observer.\n\n @method removeEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n removeEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.removeListener(this, '@enumerable:before', target, willChange);\n Ember.removeListener(this, '@enumerable:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property hasEnumerableObservers\n @type Boolean\n */\n hasEnumerableObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@enumerable:change') || Ember.hasListeners(this, '@enumerable:before');\n }),\n\n\n /**\n Invoke this method just before the contents of your enumerable will\n change. You can either omit the parameters completely or pass the objects\n to be removed or added if available or just a count.\n\n @method enumerableContentWillChange\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to be\n added or the number of items to be added.\n @chainable\n */\n enumerableContentWillChange: function(removing, adding) {\n\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding,'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.propertyWillChange(this, '[]');\n if (hasDelta) Ember.propertyWillChange(this, 'length');\n Ember.sendEvent(this, '@enumerable:before', [this, removing, adding]);\n\n return this;\n },\n\n /**\n Invoke this method when the contents of your enumerable has changed.\n This will notify any observers watching for content changes. If your are\n implementing an ordered enumerable (such as an array), also pass the\n start and end values where the content changed so that it can be used to\n notify range observers.\n\n @method enumerableContentDidChange\n @param {Number} [start] optional start offset for the content change.\n For unordered enumerables, you should always pass -1.\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to\n be added or the number of items to be added.\n @chainable\n */\n enumerableContentDidChange: function(removing, adding) {\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding, 'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.sendEvent(this, '@enumerable:change', [this, removing, adding]);\n if (hasDelta) Ember.propertyDidChange(this, 'length');\n Ember.propertyDidChange(this, '[]');\n\n return this ;\n }\n\n});\n\nif (Ember.FEATURES.isEnabled(\"ember-runtime-sortBy\")) {\n Ember.Enumerable.reopen({\n /**\n Converts the enumerable into an array and sorts by the keys\n specified in the argument.\n\n You may provide multiple arguments to sort by multiple properties.\n\n @method sortBy\n @param {String} property name(s) to sort on\n @return {Array} The sorted array.\n */\n sortBy: function() {\n var sortKeys = arguments;\n return this.toArray().sort(function(a, b){\n for(var i = 0; i < sortKeys.length; i++) {\n var key = sortKeys[i],\n propA = get(a, key),\n propB = get(b, key);\n // return 1 or -1 else continue to the next sortKey\n var compareValue = Ember.compare(propA, propB);\n if (compareValue) { return compareValue; }\n }\n return 0;\n });\n }\n });\n}\n\n})();\n//@ sourceURL=ember-runtime/mixins/enumerable");minispade.register('ember-runtime/mixins/evented', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n This mixin allows for Ember objects to subscribe to and emit events.\n\n ```javascript\n App.Person = Ember.Object.extend(Ember.Evented, {\n greet: function() {\n // ...\n this.trigger('greet');\n }\n });\n\n var person = App.Person.create();\n\n person.on('greet', function() {\n console.log('Our person has greeted');\n });\n\n person.greet();\n\n // outputs: 'Our person has greeted'\n ```\n\n You can also chain multiple event subscriptions:\n\n ```javascript\n person.on('greet', function() {\n console.log('Our person has greeted');\n }).one('greet', function() {\n console.log('Offer one-time special');\n }).off('event', this, forgetThis);\n ```\n\n @class Evented\n @namespace Ember\n */\nEmber.Evented = Ember.Mixin.create({\n\n /**\n Subscribes to a named event with given function.\n\n ```javascript\n person.on('didLoad', function() {\n // fired once the person has loaded\n });\n ```\n\n An optional target can be passed in as the 2nd argument that will\n be set as the \"this\" for the callback. This is a good way to give your\n function access to the object triggering the event. When the target\n parameter is used the callback becomes the third argument.\n\n @method on\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n on: function(name, target, method) {\n Ember.addListener(this, name, target, method);\n return this;\n },\n\n /**\n Subscribes a function to a named event and then cancels the subscription\n after the first time the event is triggered. It is good to use ``one`` when\n you only care about the first time an event has taken place.\n\n This function takes an optional 2nd argument that will become the \"this\"\n value for the callback. If this argument is passed then the 3rd argument\n becomes the function.\n\n @method one\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n one: function(name, target, method) {\n if (!method) {\n method = target;\n target = null;\n }\n\n Ember.addListener(this, name, target, method, true);\n return this;\n },\n\n /**\n Triggers a named event for the object. Any additional arguments\n will be passed as parameters to the functions that are subscribed to the\n event.\n\n ```javascript\n person.on('didEat', function(food) {\n console.log('person ate some ' + food);\n });\n\n person.trigger('didEat', 'broccoli');\n\n // outputs: person ate some broccoli\n ```\n @method trigger\n @param {String} name The name of the event\n @param {Object...} args Optional arguments to pass on\n */\n trigger: function(name) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n Ember.sendEvent(this, name, args);\n },\n\n /**\n Cancels subscription for given name, target, and method.\n\n @method off\n @param {String} name The name of the event\n @param {Object} target The target of the subscription\n @param {Function} method The function of the subscription\n @return this\n */\n off: function(name, target, method) {\n Ember.removeListener(this, name, target, method);\n return this;\n },\n\n /**\n Checks to see if object has any subscriptions for named event.\n\n @method has\n @param {String} name The name of the event\n @return {Boolean} does the object have a subscription for event\n */\n has: function(name) {\n return Ember.hasListeners(this, name);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/evented");minispade.register('ember-runtime/mixins/freezable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.Freezable` mixin implements some basic methods for marking an\n object as frozen. Once an object is frozen it should be read only. No changes\n may be made the internal state of the object.\n\n ## Enforcement\n\n To fully support freezing in your subclass, you must include this mixin and\n override any method that might alter any property on the object to instead\n raise an exception. You can check the state of an object by checking the\n `isFrozen` property.\n\n Although future versions of JavaScript may support language-level freezing\n object objects, that is not the case today. Even if an object is freezable,\n it is still technically possible to modify the object, even though it could\n break other parts of your application that do not expect a frozen object to\n change. It is, therefore, very important that you always respect the\n `isFrozen` property on all freezable objects.\n\n ## Example Usage\n\n The example below shows a simple object that implement the `Ember.Freezable`\n protocol.\n\n ```javascript\n Contact = Ember.Object.extend(Ember.Freezable, {\n firstName: null,\n lastName: null,\n\n // swaps the names\n swapNames: function() {\n if (this.get('isFrozen')) throw Ember.FROZEN_ERROR;\n var tmp = this.get('firstName');\n this.set('firstName', this.get('lastName'));\n this.set('lastName', tmp);\n return this;\n }\n\n });\n\n c = Context.create({ firstName: \"John\", lastName: \"Doe\" });\n c.swapNames(); // returns c\n c.freeze();\n c.swapNames(); // EXCEPTION\n ```\n\n ## Copying\n\n Usually the `Ember.Freezable` protocol is implemented in cooperation with the\n `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will\n return a frozen object, if the object implements this method as well.\n\n @class Freezable\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Freezable = Ember.Mixin.create(/** @scope Ember.Freezable.prototype */ {\n\n /**\n Set to `true` when the object is frozen. Use this property to detect\n whether your object is frozen or not.\n\n @property isFrozen\n @type Boolean\n */\n isFrozen: false,\n\n /**\n Freezes the object. Once this method has been called the object should\n no longer allow any properties to be edited.\n\n @method freeze\n @return {Object} receiver\n */\n freeze: function() {\n if (get(this, 'isFrozen')) return this;\n set(this, 'isFrozen', true);\n return this;\n }\n\n});\n\nEmber.FROZEN_ERROR = \"Frozen object cannot be modified.\";\n\n})();\n//@ sourceURL=ember-runtime/mixins/freezable");minispade.register('ember-runtime/mixins/mutable_array', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\nminispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\n\n// ..........................................................\n// CONSTANTS\n//\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\" ;\nvar EMPTY = [];\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n This mixin defines the API for modifying array-like objects. These methods\n can be applied only to a collection that keeps its items in an ordered set.\n\n Note that an Array can change even if it does not implement this mixin.\n For example, one might implement a SparseArray that cannot be directly\n modified, but if its underlying enumerable changes, it will change also.\n\n @class MutableArray\n @namespace Ember\n @uses Ember.Array\n @uses Ember.MutableEnumerable\n*/\nEmber.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,/** @scope Ember.MutableArray.prototype */ {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n You should replace amt objects started at idx with the objects in the\n passed array. You should also call `this.enumerableContentDidChange()`\n\n @method replace\n @param {Number} idx Starting index in the array to replace. If\n idx >= length, then append to the end of the array.\n @param {Number} amt Number of elements that should be removed from\n the array, starting at *idx*.\n @param {Array} objects An array of zero or more objects that should be\n inserted into the array at *idx*\n */\n replace: Ember.required(),\n\n /**\n Remove all elements from self. This is useful if you\n want to reuse an existing array without having to recreate it.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n color.length(); // 3\n colors.clear(); // []\n colors.length(); // 0\n ```\n\n @method clear\n @return {Ember.Array} An empty Array.\n */\n clear: function () {\n var len = get(this, 'length');\n if (len === 0) return this;\n this.replace(0, len, EMPTY);\n return this;\n },\n\n /**\n This will use the primitive `replace()` method to insert an object at the\n specified index.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.insertAt(2, \"yellow\"); // [\"red\", \"green\", \"yellow\", \"blue\"]\n colors.insertAt(5, \"orange\"); // Error: Index out of range\n ```\n\n @method insertAt\n @param {Number} idx index of insert the object at.\n @param {Object} object object to insert\n @return this\n */\n insertAt: function(idx, object) {\n if (idx > get(this, 'length')) throw new Ember.Error(OUT_OF_RANGE_EXCEPTION) ;\n this.replace(idx, 0, [object]) ;\n return this ;\n },\n\n /**\n Remove an object at the specified index using the `replace()` primitive\n method. You can pass either a single index, or a start and a length.\n\n If you pass a start and length that is beyond the\n length this method will throw an `OUT_OF_RANGE_EXCEPTION`\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\", \"yellow\", \"orange\"];\n colors.removeAt(0); // [\"green\", \"blue\", \"yellow\", \"orange\"]\n colors.removeAt(2, 2); // [\"green\", \"blue\"]\n colors.removeAt(4, 2); // Error: Index out of range\n ```\n\n @method removeAt\n @param {Number} start index, start of range\n @param {Number} len length of passing range\n @return {Object} receiver\n */\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Ember.Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n // fast case\n if (len === undefined) len = 1;\n this.replace(start, len, EMPTY);\n }\n\n return this ;\n },\n\n /**\n Push the object onto the end of the array. Works just like `push()` but it\n is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObject(\"black\"); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObject([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", [\"yellow\", \"orange\"]]\n ```\n\n @method pushObject\n @param {*} obj object to push\n @return {*} the same obj passed as param\n */\n pushObject: function(obj) {\n this.insertAt(get(this, 'length'), obj) ;\n return obj ;\n },\n\n /**\n Add the objects in the passed numerable to the end of the array. Defers\n notifying observers of the change until all objects are added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObjects([\"black\"]); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObjects([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", \"yellow\", \"orange\"]\n ```\n\n @method pushObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n pushObjects: function(objects) {\n if (!(Ember.Enumerable.detect(objects) || Ember.isArray(objects))) {\n throw new TypeError(\"Must pass Ember.Enumerable to Ember.MutableArray#pushObjects\");\n }\n this.replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n /**\n Pop object from array or nil if none are left. Works just like `pop()` but\n it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.popObject(); // \"blue\"\n console.log(colors); // [\"red\", \"green\"]\n ```\n\n @method popObject\n @return object\n */\n popObject: function() {\n var len = get(this, 'length') ;\n if (len === 0) return null ;\n\n var ret = this.objectAt(len-1) ;\n this.removeAt(len-1, 1) ;\n return ret ;\n },\n\n /**\n Shift an object from start of array or nil if none are left. Works just\n like `shift()` but it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.shiftObject(); // \"red\"\n console.log(colors); // [\"green\", \"blue\"]\n ```\n\n @method shiftObject\n @return object\n */\n shiftObject: function() {\n if (get(this, 'length') === 0) return null ;\n var ret = this.objectAt(0) ;\n this.removeAt(0) ;\n return ret ;\n },\n\n /**\n Unshift an object to start of array. Works just like `unshift()` but it is\n KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObject(\"yellow\"); // [\"yellow\", \"red\", \"green\", \"blue\"]\n colors.unshiftObject([\"black\", \"white\"]); // [[\"black\", \"white\"], \"yellow\", \"red\", \"green\", \"blue\"]\n ```\n\n @method unshiftObject\n @param {*} obj object to unshift\n @return {*} the same obj passed as param\n */\n unshiftObject: function(obj) {\n this.insertAt(0, obj) ;\n return obj ;\n },\n\n /**\n Adds the named objects to the beginning of the array. Defers notifying\n observers until all objects have been added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObjects([\"black\", \"white\"]); // [\"black\", \"white\", \"red\", \"green\", \"blue\"]\n colors.unshiftObjects(\"yellow\"); // Type Error: 'undefined' is not a function\n ```\n\n @method unshiftObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n unshiftObjects: function(objects) {\n this.replace(0, 0, objects);\n return this;\n },\n\n /**\n Reverse objects in the array. Works just like `reverse()` but it is\n KVO-compliant.\n\n @method reverseObjects\n @return {Ember.Array} receiver\n */\n reverseObjects: function() {\n var len = get(this, 'length');\n if (len === 0) return this;\n var objects = this.toArray().reverse();\n this.replace(0, len, objects);\n return this;\n },\n\n /**\n Replace all the the receiver's content with content of the argument.\n If argument is an empty array receiver will be cleared.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.setObjects([\"black\", \"white\"]); // [\"black\", \"white\"]\n colors.setObjects([]); // []\n ```\n\n @method setObjects\n @param {Ember.Array} objects array whose content will be used for replacing\n the content of the receiver\n @return {Ember.Array} receiver with the new content\n */\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this.replace(0, len, objects);\n return this;\n },\n\n // ..........................................................\n // IMPLEMENT Ember.MutableEnumerable\n //\n\n removeObject: function(obj) {\n var loc = get(this, 'length') || 0;\n while(--loc >= 0) {\n var curObject = this.objectAt(loc) ;\n if (curObject === obj) this.removeAt(loc) ;\n }\n return this ;\n },\n\n addObject: function(obj) {\n if (!this.contains(obj)) this.pushObject(obj);\n return this ;\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_array");minispade.register('ember-runtime/mixins/mutable_enumerable', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar forEach = Ember.EnumerableUtils.forEach;\n\n/**\n This mixin defines the API for modifying generic enumerables. These methods\n can be applied to an object regardless of whether it is ordered or\n unordered.\n\n Note that an Enumerable can change even if it does not implement this mixin.\n For example, a MappedEnumerable cannot be directly modified but if its\n underlying enumerable changes, it will change also.\n\n ## Adding Objects\n\n To add an object to an enumerable, use the `addObject()` method. This\n method will only add the object to the enumerable if the object is not\n already present and is of a type supported by the enumerable.\n\n ```javascript\n set.addObject(contact);\n ```\n\n ## Removing Objects\n\n To remove an object from an enumerable, use the `removeObject()` method. This\n will only remove the object if it is present in the enumerable, otherwise\n this method has no effect.\n\n ```javascript\n set.removeObject(contact);\n ```\n\n ## Implementing In Your Own Code\n\n If you are implementing an object and want to support this API, just include\n this mixin in your class and implement the required methods. In your unit\n tests, be sure to apply the Ember.MutableEnumerableTests to your object.\n\n @class MutableEnumerable\n @namespace Ember\n @uses Ember.Enumerable\n*/\nEmber.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable, {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to add the passed object to the receiver if the object is not\n already present in the collection. If the object is present, this method\n has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method addObject\n @param {Object} object The object to add to the enumerable.\n @return {Object} the passed object\n */\n addObject: Ember.required(Function),\n\n /**\n Adds each object in the passed enumerable to the receiver.\n\n @method addObjects\n @param {Ember.Enumerable} objects the objects to add.\n @return {Object} receiver\n */\n addObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.addObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n },\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to remove the passed object from the receiver collection if the\n object is present in the collection. If the object is not present,\n this method has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method removeObject\n @param {Object} object The object to remove from the enumerable.\n @return {Object} the passed object\n */\n removeObject: Ember.required(Function),\n\n\n /**\n Removes each object in the passed enumerable from the receiver.\n\n @method removeObjects\n @param {Ember.Enumerable} objects the objects to remove\n @return {Object} receiver\n */\n removeObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.removeObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_enumerable");minispade.register('ember-runtime/mixins/observable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get,\n set = Ember.set,\n slice = Array.prototype.slice,\n getProperties = Ember.getProperties;\n\n/**\n ## Overview\n\n This mixin provides properties and property observing functionality, core\n features of the Ember object model.\n\n Properties and observers allow one object to observe changes to a\n property on another object. This is one of the fundamental ways that\n models, controllers and views communicate with each other in an Ember\n application.\n\n Any object that has this mixin applied can be used in observer\n operations. That includes `Ember.Object` and most objects you will\n interact with as you write your Ember application.\n\n Note that you will not generally apply this mixin to classes yourself,\n but you will use the features provided by this module frequently, so it\n is important to understand how to use it.\n\n ## Using `get()` and `set()`\n\n Because of Ember's support for bindings and observers, you will always\n access properties using the get method, and set properties using the\n set method. This allows the observing objects to be notified and\n computed properties to be handled properly.\n\n More documentation about `get` and `set` are below.\n\n ## Observing Property Changes\n\n You typically observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n Although this is the most common way to add an observer, this capability\n is actually built into the `Ember.Object` class on top of two methods\n defined in this mixin: `addObserver` and `removeObserver`. You can use\n these two methods to add and remove observers yourself if you need to\n do so at runtime.\n\n To add an observer for a property, call:\n\n ```javascript\n object.addObserver('propertyKey', targetObject, targetAction)\n ```\n\n This will call the `targetAction` method on the `targetObject` whenever\n the value of the `propertyKey` changes.\n\n Note that if `propertyKey` is a computed property, the observer will be\n called when any of the property dependencies are changed, even if the\n resulting value of the computed property is unchanged. This is necessary\n because computed properties are not computed until `get` is called.\n\n @class Observable\n @namespace Ember\n*/\nEmber.Observable = Ember.Mixin.create({\n\n /**\n Retrieves the value of a property from the object.\n\n This method is usually similar to using `object[keyName]` or `object.keyName`,\n however it supports both computed properties and the unknownProperty\n handler.\n\n Because `get` unifies the syntax for accessing all these kinds\n of properties, it can make many refactorings easier, such as replacing a\n simple property with a computed property, or vice versa.\n\n ### Computed Properties\n\n Computed properties are methods defined with the `property` modifier\n declared at the end, such as:\n\n ```javascript\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n }.property('firstName', 'lastName')\n ```\n\n When you call `get` on a computed property, the function will be\n called and the return value will be returned instead of the function\n itself.\n\n ### Unknown Properties\n\n Likewise, if you try to call `get` on a property whose value is\n `undefined`, the `unknownProperty()` method will be called on the object.\n If this method returns any value other than `undefined`, it will be returned\n instead. This allows you to implement \"virtual\" properties that are\n not defined upfront.\n\n @method get\n @param {String} keyName The property to retrieve\n @return {Object} The property value or undefined.\n */\n get: function(keyName) {\n return get(this, keyName);\n },\n\n /**\n To get multiple properties at once, call `getProperties`\n with a list of strings or an array:\n\n ```javascript\n record.getProperties('firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n record.getProperties(['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param {String...|Array} list of keys to get\n @return {Hash}\n */\n getProperties: function() {\n return getProperties.apply(null, [this].concat(slice.call(arguments)));\n },\n\n /**\n Sets the provided key or path to the value.\n\n This method is generally very similar to calling `object[key] = value` or\n `object.key = value`, except that it provides support for computed\n properties, the `setUnknownProperty()` method and property observers.\n\n ### Computed Properties\n\n If you try to set a value on a key that has a computed property handler\n defined (see the `get()` method for an example), then `set()` will call\n that method, passing both the value and key instead of simply changing\n the value itself. This is useful for those times when you need to\n implement a property that is composed of one or more member\n properties.\n\n ### Unknown Properties\n\n If you try to set a value on a key that is undefined in the target\n object, then the `setUnknownProperty()` handler will be called instead. This\n gives you an opportunity to implement complex \"virtual\" properties that\n are not predefined on the object. If `setUnknownProperty()` returns\n undefined, then `set()` will simply set the value on the object.\n\n ### Property Observers\n\n In addition to changing the property, `set()` will also register a property\n change with the object. Unless you have placed this call inside of a\n `beginPropertyChanges()` and `endPropertyChanges(),` any \"local\" observers\n (i.e. observer methods declared on the same object), will be called\n immediately. Any \"remote\" observers (i.e. observer methods declared on\n another object) will be placed in a queue and called at a later time in a\n coalesced manner.\n\n ### Chaining\n\n In addition to property changes, `set()` returns the value of the object\n itself so you can do chaining like this:\n\n ```javascript\n record.set('firstName', 'Charles').set('lastName', 'Jolley');\n ```\n\n @method set\n @param {String} keyName The property to set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n set: function(keyName, value) {\n set(this, keyName, value);\n return this;\n },\n\n /**\n To set multiple properties at once, call `setProperties`\n with a Hash:\n\n ```javascript\n record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });\n ```\n\n @method setProperties\n @param {Hash} hash the hash of keys and values to set\n @return {Ember.Observable}\n */\n setProperties: function(hash) {\n return Ember.setProperties(this, hash);\n },\n\n /**\n Begins a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call this\n method at the beginning of the changes to begin deferring change\n notifications. When you are done making changes, call\n `endPropertyChanges()` to deliver the deferred change notifications and end\n deferring.\n\n @method beginPropertyChanges\n @return {Ember.Observable}\n */\n beginPropertyChanges: function() {\n Ember.beginPropertyChanges();\n return this;\n },\n\n /**\n Ends a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call\n `beginPropertyChanges()` at the beginning of the changes to defer change\n notifications. When you are done making changes, call this method to\n deliver the deferred change notifications and end deferring.\n\n @method endPropertyChanges\n @return {Ember.Observable}\n */\n endPropertyChanges: function() {\n Ember.endPropertyChanges();\n return this;\n },\n\n /**\n Notify the observer system that a property is about to change.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyDidChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyWillChange\n @param {String} keyName The property key that is about to change.\n @return {Ember.Observable}\n */\n propertyWillChange: function(keyName) {\n Ember.propertyWillChange(this, keyName);\n return this;\n },\n\n /**\n Notify the observer system that a property has just changed.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyWillChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyDidChange\n @param {String} keyName The property key that has just changed.\n @return {Ember.Observable}\n */\n propertyDidChange: function(keyName) {\n Ember.propertyDidChange(this, keyName);\n return this;\n },\n\n /**\n Convenience method to call `propertyWillChange` and `propertyDidChange` in\n succession.\n\n @method notifyPropertyChange\n @param {String} keyName The property key to be notified about.\n @return {Ember.Observable}\n */\n notifyPropertyChange: function(keyName) {\n this.propertyWillChange(keyName);\n this.propertyDidChange(keyName);\n return this;\n },\n\n addBeforeObserver: function(key, target, method) {\n Ember.addBeforeObserver(this, key, target, method);\n },\n\n /**\n Adds an observer on a property.\n\n This is the core method used to register an observer for a property.\n\n Once you call this method, any time the key's value is set, your observer\n will be notified. Note that the observers are triggered any time the\n value is set, regardless of whether it has actually changed. Your\n observer should be prepared to handle that.\n\n You can also pass an optional context parameter to this method. The\n context will be passed to your observer method whenever it is triggered.\n Note that if you add the same target/method pair on a key multiple times\n with different context parameters, your observer will only be called once\n with the last context you passed.\n\n ### Observer Methods\n\n Observer methods you pass should generally have the following signature if\n you do not pass a `context` parameter:\n\n ```javascript\n fooDidChange: function(sender, key, value, rev) { };\n ```\n\n The sender is the object that changed. The key is the property that\n changes. The value property is currently reserved and unused. The rev\n is the last property revision of the object when it changed, which you can\n use to detect if the key value has really changed or not.\n\n If you pass a `context` parameter, the context will be passed before the\n revision like so:\n\n ```javascript\n fooDidChange: function(sender, key, value, context, rev) { };\n ```\n\n Usually you will not need the value, context or revision parameters at\n the end. In this case, it is common to write observer methods that take\n only a sender and key value as parameters or, if you aren't interested in\n any of these values, to write an observer that has no parameters at all.\n\n @method addObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Object} self\n */\n addObserver: function(key, target, method) {\n Ember.addObserver(this, key, target, method);\n },\n\n /**\n Remove an observer you have previously registered on this object. Pass\n the same key, target, and method you passed to `addObserver()` and your\n target will no longer receive notifications.\n\n @method removeObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Observable} receiver\n */\n removeObserver: function(key, target, method) {\n Ember.removeObserver(this, key, target, method);\n },\n\n /**\n Returns `true` if the object currently has observers registered for a\n particular key. You can use this method to potentially defer performing\n an expensive action until someone begins observing a particular property\n on the object.\n\n @method hasObserverFor\n @param {String} key Key to check\n @return {Boolean}\n */\n hasObserverFor: function(key) {\n return Ember.hasListeners(this, key+':change');\n },\n\n /**\n Retrieves the value of a property, or a default value in the case that the\n property returns `undefined`.\n\n ```javascript\n person.getWithDefault('lastName', 'Doe');\n ```\n\n @method getWithDefault\n @param {String} keyName The name of the property to retrieve\n @param {Object} defaultValue The value to return if the property value is undefined\n @return {Object} The property value or the defaultValue.\n */\n getWithDefault: function(keyName, defaultValue) {\n return Ember.getWithDefault(this, keyName, defaultValue);\n },\n\n /**\n Set the value of a property to the current value plus some amount.\n\n ```javascript\n person.incrementProperty('age');\n team.incrementProperty('score', 2);\n ```\n\n @method incrementProperty\n @param {String} keyName The name of the property to increment\n @param {Number} increment The amount to increment by. Defaults to 1\n @return {Number} The new property value\n */\n incrementProperty: function(keyName, increment) {\n if (Ember.isNone(increment)) { increment = 1; }\n Ember.assert(\"Must pass a numeric value to incrementProperty\", (!isNaN(parseFloat(increment)) && isFinite(increment)));\n set(this, keyName, (get(this, keyName) || 0) + increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a property to the current value minus some amount.\n\n ```javascript\n player.decrementProperty('lives');\n orc.decrementProperty('health', 5);\n ```\n\n @method decrementProperty\n @param {String} keyName The name of the property to decrement\n @param {Number} decrement The amount to decrement by. Defaults to 1\n @return {Number} The new property value\n */\n decrementProperty: function(keyName, decrement) {\n if (Ember.isNone(decrement)) { decrement = 1; }\n Ember.assert(\"Must pass a numeric value to decrementProperty\", (!isNaN(parseFloat(decrement)) && isFinite(decrement)));\n set(this, keyName, (get(this, keyName) || 0) - decrement);\n return get(this, keyName);\n },\n\n /**\n Set the value of a boolean property to the opposite of it's\n current value.\n\n ```javascript\n starship.toggleProperty('warpDriveEngaged');\n ```\n\n @method toggleProperty\n @param {String} keyName The name of the property to toggle\n @return {Object} The new property value\n */\n toggleProperty: function(keyName) {\n set(this, keyName, !get(this, keyName));\n return get(this, keyName);\n },\n\n /**\n Returns the cached value of a computed property, if it exists.\n This allows you to inspect the value of a computed property\n without accidentally invoking it if it is intended to be\n generated lazily.\n\n @method cacheFor\n @param {String} keyName\n @return {Object} The cached value of the computed property, if any\n */\n cacheFor: function(keyName) {\n return Ember.cacheFor(this, keyName);\n },\n\n // intended for debugging purposes\n observersForKey: function(keyName) {\n return Ember.observersFor(this, keyName);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/observable");minispade.register('ember-runtime/mixins/promise_proxy', "(function() {var set = Ember.set, get = Ember.get,\n resolve = Ember.RSVP.resolve,\n rethrow = Ember.RSVP.rethrow,\n not = Ember.computed.not,\n or = Ember.computed.or;\n\n/**\n @module ember\n @submodule ember-runtime\n */\n\nfunction installPromise(proxy, promise) {\n promise.then(function(value) {\n set(proxy, 'isFulfilled', true);\n set(proxy, 'content', value);\n\n return value;\n }, function(reason) {\n set(proxy, 'isRejected', true);\n set(proxy, 'reason', reason);\n }).fail(rethrow);\n}\n\n/**\n A low level mixin making ObjectProxy, ObjectController or ArrayController's promise aware.\n\n ```javascript\n var ObjectPromiseController = Ember.ObjectController.extend(Ember.PromiseProxyMixin);\n\n var controller = ObjectPromiseController.create({\n promise: $.getJSON('/some/remote/data.json')\n });\n\n controller.then(function(json){\n // the json\n }, function(reason) {\n // the reason why you have no json\n });\n ```\n\n the controller has bindable attributes which\n track the promises life cycle\n\n ```javascript\n controller.get('isPending') //=> true\n controller.get('isSettled') //=> false\n controller.get('isRejected') //=> false\n controller.get('isFulfilled') //=> false\n ```\n\n When the the $.getJSON completes, and the promise is fulfilled\n with json, the life cycle attributes will update accordingly.\n\n ```javascript\n controller.get('isPending') //=> false\n controller.get('isSettled') //=> true\n controller.get('isRejected') //=> false\n controller.get('isFulfilled') //=> true\n ```\n\n As the controller is an ObjectController, and the json now its content,\n all the json properties will be available directly from the controller.\n\n ```javascript\n // Assuming the following json:\n {\n firstName: 'Stefan',\n lastName: 'Penner'\n }\n\n // both properties will accessible on the controller\n controller.get('firstName') //=> 'Stefan'\n controller.get('lastName') //=> 'Penner'\n ```\n\n If the controller is backing a template, the attributes are \n bindable from within that template\n\n ```handlebars\n {{#if isPending}}\n loading...\n {{else}}\n firstName: {{firstName}}\n lastName: {{lastName}}\n {{/if}}\n ```\n @class Ember.PromiseProxyMixin\n*/\nEmber.PromiseProxyMixin = Ember.Mixin.create({\n reason: null,\n isPending: not('isSettled').readOnly(),\n isSettled: or('isRejected', 'isFulfilled').readOnly(),\n isRejected: false,\n isFulfilled: false,\n\n promise: Ember.computed(function(key, promise) {\n if (arguments.length === 2) {\n promise = resolve(promise);\n installPromise(this, promise);\n return promise;\n } else {\n throw new Ember.Error(\"PromiseProxy's promise must be set\");\n }\n }),\n\n then: function(fulfill, reject) {\n return get(this, 'promise').then(fulfill, reject);\n }\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/promise_proxy");minispade.register('ember-runtime/mixins/sortable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach;\n\n/**\n `Ember.SortableMixin` provides a standard interface for array proxies\n to specify a sort order and maintain this sorting when objects are added,\n removed, or updated without changing the implicit order of their underlying\n content array:\n\n ```javascript\n songs = [\n {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'},\n {trackNumber: 2, title: 'Back in the U.S.S.R.'},\n {trackNumber: 3, title: 'Glass Onion'},\n ];\n\n songsController = Ember.ArrayController.create({\n content: songs,\n sortProperties: ['trackNumber'],\n sortAscending: true\n });\n\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.addObject({trackNumber: 1, title: 'Dear Prudence'});\n songsController.get('firstObject'); // {trackNumber: 1, title: 'Dear Prudence'}\n ```\n\n If you add or remove the properties to sort by or change the sort direction the content\n sort order will be automatically updated.\n\n ```javascript\n songsController.set('sortProperties', ['title']);\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.toggleProperty('sortAscending');\n songsController.get('firstObject'); // {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'}\n ```\n\n SortableMixin works by sorting the arrangedContent array, which is the array that\n arrayProxy displays. Due to the fact that the underlying 'content' array is not changed, that\n array will not display the sorted list:\n\n ```javascript\n songsController.get('content').get('firstObject'); // Returns the unsorted original content\n songsController.get('firstObject'); // Returns the sorted content.\n ``` \n \n Although the sorted content can also be accessed through the arrangedContent property,\n it is preferable to use the proxied class and not the arrangedContent array directly.\n\n @class SortableMixin\n @namespace Ember\n @uses Ember.MutableEnumerable\n*/\nEmber.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {\n\n /**\n Specifies which properties dictate the arrangedContent's sort order.\n\n When specifying multiple properties the sorting will use properties\n from the `sortProperties` array prioritized from first to last.\n\n @property {Array} sortProperties\n */\n sortProperties: null,\n\n /**\n Specifies the arrangedContent's sort direction\n\n @property {Boolean} sortAscending\n */\n sortAscending: true,\n\n /**\n The function used to compare two values. You can override this if you\n want to do custom comparisons. Functions must be of the type expected by\n Array#sort, i.e.\n return 0 if the two parameters are equal,\n return a negative value if the first parameter is smaller than the second or\n return a positive value otherwise:\n\n ```javascript\n function(x,y) { // These are assumed to be integers\n if (x === y)\n return 0;\n return x < y ? -1 : 1;\n }\n ```\n\n @property sortFunction\n @type {Function}\n @default Ember.compare\n */\n sortFunction: Ember.compare,\n\n orderBy: function(item1, item2) {\n var result = 0,\n sortProperties = get(this, 'sortProperties'),\n sortAscending = get(this, 'sortAscending'),\n sortFunction = get(this, 'sortFunction');\n\n Ember.assert(\"you need to define `sortProperties`\", !!sortProperties);\n\n forEach(sortProperties, function(propertyName) {\n if (result === 0) {\n result = sortFunction(get(item1, propertyName), get(item2, propertyName));\n if ((result !== 0) && !sortAscending) {\n result = (-1) * result;\n }\n }\n });\n\n return result;\n },\n\n destroy: function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super();\n },\n\n isSorted: Ember.computed.bool('sortProperties'),\n\n /**\n Overrides the default arrangedContent from arrayProxy in order to sort by sortFunction.\n Also sets up observers for each sortProperty on each item in the content Array.\n \n @property arrangedContent\n */\n\n arrangedContent: Ember.computed('content', 'sortProperties.@each', function(key, value) {\n var content = get(this, 'content'),\n isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties'),\n self = this;\n\n if (content && isSorted) {\n content = content.slice();\n content.sort(function(item1, item2) {\n return self.orderBy(item1, item2);\n });\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n return Ember.A(content);\n }\n\n return content;\n }),\n\n _contentWillChange: Ember.beforeObserver('content', function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n this._super();\n }),\n\n sortAscendingWillChange: Ember.beforeObserver('sortAscending', function() {\n this._lastSortAscending = get(this, 'sortAscending');\n }),\n\n sortAscendingDidChange: Ember.observer('sortAscending', function() {\n if (get(this, 'sortAscending') !== this._lastSortAscending) {\n var arrangedContent = get(this, 'arrangedContent');\n arrangedContent.reverseObjects();\n }\n }),\n\n contentArrayWillChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted');\n\n if (isSorted) {\n var arrangedContent = get(this, 'arrangedContent');\n var removedObjects = array.slice(idx, idx+removedCount);\n var sortProperties = get(this, 'sortProperties');\n\n forEach(removedObjects, function(item) {\n arrangedContent.removeObject(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n contentArrayDidChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties');\n\n if (isSorted) {\n var addedObjects = array.slice(idx, idx+addedCount);\n\n forEach(addedObjects, function(item) {\n this.insertItemSorted(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n insertItemSorted: function(item) {\n var arrangedContent = get(this, 'arrangedContent');\n var length = get(arrangedContent, 'length');\n\n var idx = this._binarySearch(item, 0, length);\n arrangedContent.insertAt(idx, item);\n },\n\n contentItemSortPropertyDidChange: function(item) {\n var arrangedContent = get(this, 'arrangedContent'),\n oldIndex = arrangedContent.indexOf(item),\n leftItem = arrangedContent.objectAt(oldIndex - 1),\n rightItem = arrangedContent.objectAt(oldIndex + 1),\n leftResult = leftItem && this.orderBy(item, leftItem),\n rightResult = rightItem && this.orderBy(item, rightItem);\n\n if (leftResult < 0 || rightResult > 0) {\n arrangedContent.removeObject(item);\n this.insertItemSorted(item);\n }\n },\n\n _binarySearch: function(item, low, high) {\n var mid, midItem, res, arrangedContent;\n\n if (low === high) {\n return low;\n }\n\n arrangedContent = get(this, 'arrangedContent');\n\n mid = low + Math.floor((high - low) / 2);\n midItem = arrangedContent.objectAt(mid);\n\n res = this.orderBy(midItem, item);\n\n if (res < 0) {\n return this._binarySearch(item, mid+1, high);\n } else if (res > 0) {\n return this._binarySearch(item, low, mid);\n }\n\n return mid;\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/sortable");minispade.register('ember-runtime/mixins/target_action_support', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n`Ember.TargetActionSupport` is a mixin that can be included in a class\nto add a `triggerAction` method with semantics similar to the Handlebars\n`{{action}}` helper. In normal Ember usage, the `{{action}}` helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in View objects.\n\nSee also `Ember.ViewTargetActionSupport`, which has\nview-aware defaults for target and actionContext.\n\n@class TargetActionSupport\n@namespace Ember\n@extends Ember.Mixin\n*/\nEmber.TargetActionSupport = Ember.Mixin.create({\n target: null,\n action: null,\n actionContext: null,\n\n targetObject: Ember.computed(function() {\n var target = get(this, 'target');\n\n if (Ember.typeOf(target) === \"string\") {\n var value = get(this, target);\n if (value === undefined) { value = get(Ember.lookup, target); }\n return value;\n } else {\n return target;\n }\n }).property('target'),\n\n actionContextObject: Ember.computed(function() {\n var actionContext = get(this, 'actionContext');\n\n if (Ember.typeOf(actionContext) === \"string\") {\n var value = get(this, actionContext);\n if (value === undefined) { value = get(Ember.lookup, actionContext); }\n return value;\n } else {\n return actionContext;\n }\n }).property('actionContext'),\n\n /**\n Send an \"action\" with an \"actionContext\" to a \"target\". The action, actionContext\n and target will be retrieved from properties of the object. For example:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n action: 'save',\n actionContext: Ember.computed.alias('context'),\n click: function() {\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `target`, `action`, and `actionContext` can be provided as properties of\n an optional object argument to `triggerAction` as well.\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n click: function() {\n this.triggerAction({\n action: 'save',\n target: this.get('controller'),\n actionContext: this.get('context'),\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `actionContext` defaults to the object you mixing `TargetActionSupport` into.\n But `target` and `action` must be specified either as properties or with the argument\n to `triggerAction`, or a combination:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n click: function() {\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with a reference to `this`,\n // to the current controller\n }\n });\n ```\n\n @method triggerAction\n @param opts {Hash} (optional, with the optional keys action, target and/or actionContext)\n @return {Boolean} true if the action was sent successfully and did not return false\n */\n triggerAction: function(opts) {\n opts = opts || {};\n var action = opts.action || get(this, 'action'),\n target = opts.target || get(this, 'targetObject'),\n actionContext = opts.actionContext;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n return ret.concat(options);\n }\n\n if (typeof actionContext === 'undefined') {\n actionContext = get(this, 'actionContextObject') || this;\n }\n\n if (target && action) {\n var ret;\n\n if (target.send) {\n ret = target.send.apply(target, args(actionContext, action));\n } else {\n Ember.assert(\"The action '\" + action + \"' did not exist on \" + target, typeof target[action] === 'function');\n ret = target[action].apply(target, args(actionContext));\n }\n\n if (ret !== false) ret = true;\n\n return ret;\n } else {\n return false;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/target_action_support");minispade.register('ember-runtime/system', "(function() {minispade.require('ember-runtime/system/tracked_array');\nminispade.require('ember-runtime/system/subarray');\nminispade.require('ember-runtime/system/container');\nminispade.require('ember-runtime/system/application');\nminispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/system/each_proxy');\nminispade.require('ember-runtime/system/namespace');\nminispade.require('ember-runtime/system/native_array');\nminispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/set');\nminispade.require('ember-runtime/system/string');\nminispade.require('ember-runtime/system/deferred');\nminispade.require('ember-runtime/system/lazy_load');\n\n})();\n//@ sourceURL=ember-runtime/system");minispade.register('ember-runtime/system/application', "(function() {minispade.require('ember-runtime/system/namespace');\n\nEmber.Application = Ember.Namespace.extend();\n\n})();\n//@ sourceURL=ember-runtime/system/application");minispade.register('ember-runtime/system/array_proxy', "(function() {minispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\";\nvar EMPTY = [];\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n An ArrayProxy wraps any other object that implements `Ember.Array` and/or\n `Ember.MutableArray,` forwarding all requests. This makes it very useful for\n a number of binding use cases or other cases where being able to swap\n out the underlying array is useful.\n\n A simple example of usage:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });\n\n ap.get('firstObject'); // 'dog'\n ap.set('content', ['amoeba', 'paramecium']);\n ap.get('firstObject'); // 'amoeba'\n ```\n\n This class can also be useful as a layer to transform the contents of\n an array, as they are accessed. This can be done by overriding\n `objectAtContent`:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({\n content: Ember.A(pets),\n objectAtContent: function(idx) {\n return this.get('content').objectAt(idx).toUpperCase();\n }\n });\n\n ap.get('firstObject'); // . 'DOG'\n ```\n\n @class ArrayProxy\n @namespace Ember\n @extends Ember.Object\n @uses Ember.MutableArray\n*/\nEmber.ArrayProxy = Ember.Object.extend(Ember.MutableArray,/** @scope Ember.ArrayProxy.prototype */ {\n\n /**\n The content array. Must be an object that implements `Ember.Array` and/or\n `Ember.MutableArray.`\n\n @property content\n @type Ember.Array\n */\n content: null,\n\n /**\n The array that the proxy pretends to be. In the default `ArrayProxy`\n implementation, this and `content` are the same. Subclasses of `ArrayProxy`\n can override this property to provide things like sorting and filtering.\n\n @property arrangedContent\n */\n arrangedContent: Ember.computed.alias('content'),\n\n /**\n Should actually retrieve the object at the specified index from the\n content. You can override this method in subclasses to transform the\n content item to something new.\n\n This method will only be called if content is non-`null`.\n\n @method objectAtContent\n @param {Number} idx The index to retrieve.\n @return {Object} the value or undefined if none found\n */\n objectAtContent: function(idx) {\n return get(this, 'arrangedContent').objectAt(idx);\n },\n\n /**\n Should actually replace the specified objects on the content array.\n You can override this method in subclasses to transform the content item\n into something new.\n\n This method will only be called if content is non-`null`.\n\n @method replaceContent\n @param {Number} idx The starting index\n @param {Number} amt The number of items to remove from the content.\n @param {Array} objects Optional array of objects to insert or null if no\n objects.\n @return {void}\n */\n replaceContent: function(idx, amt, objects) {\n get(this, 'content').replace(idx, amt, objects);\n },\n\n /**\n @private\n\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @method _contentWillChange\n */\n _contentWillChange: Ember.beforeObserver('content', function() {\n this._teardownContent();\n }),\n\n _teardownContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n contentArrayWillChange: Ember.K,\n contentArrayDidChange: Ember.K,\n\n /**\n @private\n\n Invoked when the content property changes. Notifies observers that the\n entire array content has changed.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer('content', function() {\n var content = get(this, 'content');\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", content !== this);\n\n this._setupContent();\n }),\n\n _setupContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n _arrangedContentWillChange: Ember.beforeObserver('arrangedContent', function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n this.arrangedContentArrayWillChange(this, 0, len, undefined);\n this.arrangedContentWillChange(this);\n\n this._teardownArrangedContent(arrangedContent);\n }),\n\n _arrangedContentDidChange: Ember.observer('arrangedContent', function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", arrangedContent !== this);\n\n this._setupArrangedContent();\n\n this.arrangedContentDidChange(this);\n this.arrangedContentArrayDidChange(this, 0, undefined, len);\n }),\n\n _setupArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.addArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n _teardownArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.removeArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n arrangedContentWillChange: Ember.K,\n arrangedContentDidChange: Ember.K,\n\n objectAt: function(idx) {\n return get(this, 'content') && this.objectAtContent(idx);\n },\n\n length: Ember.computed(function() {\n var arrangedContent = get(this, 'arrangedContent');\n return arrangedContent ? get(arrangedContent, 'length') : 0;\n // No dependencies since Enumerable notifies length of change\n }),\n\n _replace: function(idx, amt, objects) {\n var content = get(this, 'content');\n Ember.assert('The content property of '+ this.constructor + ' should be set before modifying it', content);\n if (content) this.replaceContent(idx, amt, objects);\n return this;\n },\n\n replace: function() {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n this._replace.apply(this, arguments);\n } else {\n throw new Ember.Error(\"Using replace on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n _insertAt: function(idx, object) {\n if (idx > get(this, 'content.length')) throw new Ember.Error(OUT_OF_RANGE_EXCEPTION);\n this._replace(idx, 0, [object]);\n return this;\n },\n\n insertAt: function(idx, object) {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n return this._insertAt(idx, object);\n } else {\n throw new Ember.Error(\"Using insertAt on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n var content = get(this, 'content'),\n arrangedContent = get(this, 'arrangedContent'),\n indices = [], i;\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Ember.Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n if (len === undefined) len = 1;\n\n // Get a list of indices in original content to remove\n for (i=start; i<start+len; i++) {\n // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent\n indices.push(content.indexOf(arrangedContent.objectAt(i)));\n }\n\n // Replace in reverse order since indices will change\n indices.sort(function(a,b) { return b - a; });\n\n Ember.beginPropertyChanges();\n for (i=0; i<indices.length; i++) {\n this._replace(indices[i], 1, EMPTY);\n }\n Ember.endPropertyChanges();\n }\n\n return this ;\n },\n\n pushObject: function(obj) {\n this._insertAt(get(this, 'content.length'), obj) ;\n return obj ;\n },\n\n pushObjects: function(objects) {\n if (!(Ember.Enumerable.detect(objects) || Ember.isArray(objects))) {\n throw new TypeError(\"Must pass Ember.Enumerable to Ember.MutableArray#pushObjects\");\n }\n this._replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this._replace(0, len, objects);\n return this;\n },\n\n unshiftObject: function(obj) {\n this._insertAt(0, obj) ;\n return obj ;\n },\n\n unshiftObjects: function(objects) {\n this._replace(0, 0, objects);\n return this;\n },\n\n slice: function() {\n var arr = this.toArray();\n return arr.slice.apply(arr, arguments);\n },\n\n arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentWillChange(idx, removedCnt, addedCnt);\n },\n\n arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentDidChange(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n this._setupContent();\n this._setupArrangedContent();\n },\n\n willDestroy: function() {\n this._teardownArrangedContent();\n this._teardownContent();\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/system/array_proxy");minispade.register('ember-runtime/system/container', "(function() {Ember.Container = requireModule('container');\nEmber.Container.set = Ember.set;\n\n})();\n//@ sourceURL=ember-runtime/system/container");minispade.register('ember-runtime/system/core_object', "(function() {minispade.require('ember-runtime/system/namespace');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n// NOTE: this object should never be included directly. Instead use `Ember.Object`.\n// We only define this separately so that `Ember.Set` can depend on it.\n\n\nvar set = Ember.set, get = Ember.get,\n o_create = Ember.create,\n o_defineProperty = Ember.platform.defineProperty,\n GUID_KEY = Ember.GUID_KEY,\n guidFor = Ember.guidFor,\n generateGuid = Ember.generateGuid,\n meta = Ember.meta,\n rewatch = Ember.rewatch,\n finishChains = Ember.finishChains,\n sendEvent = Ember.sendEvent,\n destroy = Ember.destroy,\n schedule = Ember.run.schedule,\n Mixin = Ember.Mixin,\n applyMixin = Mixin._apply,\n finishPartial = Mixin.finishPartial,\n reopen = Mixin.prototype.reopen,\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n indexOf = Ember.EnumerableUtils.indexOf;\n\nvar undefinedDescriptor = {\n configurable: true,\n writable: true,\n enumerable: false,\n value: undefined\n};\n\nfunction makeCtor() {\n\n // Note: avoid accessing any properties on the object since it makes the\n // method a lot faster. This is glue code so we want it to be as fast as\n // possible.\n\n var wasApplied = false, initMixins, initProperties;\n\n var Class = function() {\n if (!wasApplied) {\n Class.proto(); // prepare prototype...\n }\n o_defineProperty(this, GUID_KEY, undefinedDescriptor);\n o_defineProperty(this, '_super', undefinedDescriptor);\n var m = meta(this), proto = m.proto;\n m.proto = this;\n if (initMixins) {\n // capture locally so we can clear the closed over variable\n var mixins = initMixins;\n initMixins = null;\n this.reopen.apply(this, mixins);\n }\n if (initProperties) {\n // capture locally so we can clear the closed over variable\n var props = initProperties;\n initProperties = null;\n\n var concatenatedProperties = this.concatenatedProperties;\n\n for (var i = 0, l = props.length; i < l; i++) {\n var properties = props[i];\n\n Ember.assert(\"Ember.Object.create no longer supports mixing in other definitions, use createWithMixins instead.\", !(properties instanceof Ember.Mixin));\n\n if (properties === null || typeof properties !== 'object') {\n Ember.assert(\"Ember.Object.create only accepts objects.\");\n continue;\n }\n\n var keyNames = Ember.keys(properties);\n for (var j = 0, ll = keyNames.length; j < ll; j++) {\n var keyName = keyNames[j];\n if (!properties.hasOwnProperty(keyName)) { continue; }\n\n var value = properties[keyName],\n IS_BINDING = Ember.IS_BINDING;\n\n if (IS_BINDING.test(keyName)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[keyName] = value;\n }\n\n var desc = m.descs[keyName];\n\n Ember.assert(\"Ember.Object.create no longer supports defining computed properties.\", !(value instanceof Ember.ComputedProperty));\n Ember.assert(\"Ember.Object.create no longer supports defining methods that call _super.\", !(typeof value === 'function' && value.toString().indexOf('._super') !== -1));\n Ember.assert(\"`actions` must be provided at extend time, not at create time, when Ember.ActionHandler is used (i.e. views, controllers & routes).\", !((keyName === 'actions') && Ember.ActionHandler.detect(this)));\n\n if (concatenatedProperties && indexOf(concatenatedProperties, keyName) >= 0) {\n var baseValue = this[keyName];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n value = baseValue.concat(value);\n } else {\n value = Ember.makeArray(baseValue).concat(value);\n }\n } else {\n value = Ember.makeArray(value);\n }\n }\n\n if (desc) {\n desc.set(this, keyName, value);\n } else {\n if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) {\n this.setUnknownProperty(keyName, value);\n } else if (MANDATORY_SETTER) {\n Ember.defineProperty(this, keyName, null, value); // setup mandatory setter\n } else {\n this[keyName] = value;\n }\n }\n }\n }\n }\n finishPartial(this, m);\n this.init.apply(this, arguments);\n m.proto = proto;\n finishChains(this);\n sendEvent(this, \"init\");\n };\n\n Class.toString = Mixin.prototype.toString;\n Class.willReopen = function() {\n if (wasApplied) {\n Class.PrototypeMixin = Mixin.create(Class.PrototypeMixin);\n }\n\n wasApplied = false;\n };\n Class._initMixins = function(args) { initMixins = args; };\n Class._initProperties = function(args) { initProperties = args; };\n\n Class.proto = function() {\n var superclass = Class.superclass;\n if (superclass) { superclass.proto(); }\n\n if (!wasApplied) {\n wasApplied = true;\n Class.PrototypeMixin.applyPartial(Class.prototype);\n rewatch(Class.prototype);\n }\n\n return this.prototype;\n };\n\n return Class;\n\n}\n\n/**\n @class CoreObject\n @namespace Ember\n*/\nvar CoreObject = makeCtor();\nCoreObject.toString = function() { return \"Ember.CoreObject\"; };\n\nCoreObject.PrototypeMixin = Mixin.create({\n reopen: function() {\n applyMixin(this, arguments, true);\n return this;\n },\n\n /**\n An overridable method called when objects are instantiated. By default,\n does nothing unless it is overridden during class definition.\n\n Example:\n\n ```javascript\n App.Person = Ember.Object.extend({\n init: function() {\n this._super();\n alert('Name is ' + this.get('name'));\n }\n });\n\n var steve = App.Person.create({\n name: \"Steve\"\n });\n\n // alerts 'Name is Steve'.\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n @method init\n */\n init: function() {},\n\n /**\n Defines the properties that will be concatenated from the superclass\n (instead of overridden).\n\n By default, when you extend an Ember class a property defined in\n the subclass overrides a property with the same name that is defined\n in the superclass. However, there are some cases where it is preferable\n to build up a property's value by combining the superclass' property\n value with the subclass' value. An example of this in use within Ember\n is the `classNames` property of `Ember.View`.\n\n Here is some sample code showing the difference between a concatenated\n property and a normal one:\n\n ```javascript\n App.BarView = Ember.View.extend({\n someNonConcatenatedProperty: ['bar'],\n classNames: ['bar']\n });\n\n App.FooBarView = App.BarView.extend({\n someNonConcatenatedProperty: ['foo'],\n classNames: ['foo'],\n });\n\n var fooBarView = App.FooBarView.create();\n fooBarView.get('someNonConcatenatedProperty'); // ['foo']\n fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']\n ```\n\n This behavior extends to object creation as well. Continuing the\n above example:\n\n ```javascript\n var view = App.FooBarView.create({\n someNonConcatenatedProperty: ['baz'],\n classNames: ['baz']\n })\n view.get('someNonConcatenatedProperty'); // ['baz']\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n Adding a single property that is not an array will just add it in the array:\n\n ```javascript\n var view = App.FooBarView.create({\n classNames: 'baz'\n })\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n\n Using the `concatenatedProperties` property, we can tell to Ember that mix\n the content of the properties.\n\n In `Ember.View` the `classNameBindings` and `attributeBindings` properties\n are also concatenated, in addition to `classNames`.\n\n This feature is available for you to use throughout the Ember object model,\n although typical app developers are likely to use it infrequently. Since\n it changes expectations about behavior of properties, you should properly\n document its usage in each individual concatenated property (to not\n mislead your users to think they can override the property in a subclass).\n\n @property concatenatedProperties\n @type Array\n @default null\n */\n concatenatedProperties: null,\n\n /**\n Destroyed object property flag.\n\n if this property is `true` the observers and bindings were already\n removed by the effect of calling the `destroy()` method.\n\n @property isDestroyed\n @default false\n */\n isDestroyed: false,\n\n /**\n Destruction scheduled flag. The `destroy()` method has been called.\n\n The object stays intact until the end of the run loop at which point\n the `isDestroyed` flag is set.\n\n @property isDestroying\n @default false\n */\n isDestroying: false,\n\n /**\n Destroys an object by setting the `isDestroyed` flag and removing its\n metadata, which effectively destroys observers and bindings.\n\n If you try to set a property on a destroyed object, an exception will be\n raised.\n\n Note that destruction is scheduled for the end of the run loop and does not\n happen immediately. It will set an isDestroying flag immediately.\n\n @method destroy\n @return {Ember.Object} receiver\n */\n destroy: function() {\n if (this.isDestroying) { return; }\n this.isDestroying = true;\n\n schedule('actions', this, this.willDestroy);\n schedule('destroy', this, this._scheduledDestroy);\n return this;\n },\n\n /**\n Override to implement teardown.\n\n @method willDestroy\n */\n willDestroy: Ember.K,\n\n /**\n @private\n\n Invoked by the run loop to actually destroy the object. This is\n scheduled for execution by the `destroy` method.\n\n @method _scheduledDestroy\n */\n _scheduledDestroy: function() {\n if (this.isDestroyed) { return; }\n destroy(this);\n this.isDestroyed = true;\n },\n\n bind: function(to, from) {\n if (!(from instanceof Ember.Binding)) { from = Ember.Binding.from(from); }\n from.to(to).connect(this);\n return from;\n },\n\n /**\n Returns a string representation which attempts to provide more information\n than Javascript's `toString` typically does, in a generic way for all Ember\n objects.\n\n App.Person = Em.Object.extend()\n person = App.Person.create()\n person.toString() //=> \"<App.Person:ember1024>\"\n\n If the object's class is not defined on an Ember namespace, it will\n indicate it is a subclass of the registered superclass:\n\n Student = App.Person.extend()\n student = Student.create()\n student.toString() //=> \"<(subclass of App.Person):ember1025>\"\n\n If the method `toStringExtension` is defined, its return value will be\n included in the output.\n\n App.Teacher = App.Person.extend({\n toStringExtension: function() {\n return this.get('fullName');\n }\n });\n teacher = App.Teacher.create()\n teacher.toString(); //=> \"<App.Teacher:ember1026:Tom Dale>\"\n\n @method toString\n @return {String} string representation\n */\n toString: function toString() {\n var hasToStringExtension = typeof this.toStringExtension === 'function',\n extension = hasToStringExtension ? \":\" + this.toStringExtension() : '';\n var ret = '<'+this.constructor.toString()+':'+guidFor(this)+extension+'>';\n this.toString = makeToString(ret);\n return ret;\n }\n});\n\nCoreObject.PrototypeMixin.ownerConstructor = CoreObject;\n\nfunction makeToString(ret) {\n return function() { return ret; };\n}\n\nif (Ember.config.overridePrototypeMixin) {\n Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);\n}\n\nCoreObject.__super__ = null;\n\nvar ClassMixin = Mixin.create({\n\n ClassMixin: Ember.required(),\n\n PrototypeMixin: Ember.required(),\n\n isClass: true,\n\n isMethod: false,\n\n /**\n Creates a new subclass.\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n alert(thing);\n }\n });\n ```\n\n This defines a new subclass of Ember.Object: `App.Person`. It contains one method: `say()`.\n\n You can also create a subclass from any existing class by calling its `extend()` method. For example, you might want to create a subclass of Ember's built-in `Ember.View` class:\n\n ```javascript\n App.PersonView = Ember.View.extend({\n tagName: 'li',\n classNameBindings: ['isAdministrator']\n });\n ```\n\n When defining a subclass, you can override methods but still access the implementation of your parent class by calling the special `_super()` method:\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n var name = this.get('name');\n alert(name + ' says: ' + thing);\n }\n });\n\n App.Soldier = App.Person.extend({\n say: function(thing) {\n this._super(thing + \", sir!\");\n },\n march: function(numberOfHours) {\n alert(this.get('name') + ' marches for ' + numberOfHours + ' hours.')\n }\n });\n\n var yehuda = App.Soldier.create({\n name: \"Yehuda Katz\"\n });\n\n yehuda.say(\"Yes\"); // alerts \"Yehuda Katz says: Yes, sir!\"\n ```\n\n The `create()` on line #17 creates an *instance* of the `App.Soldier` class. The `extend()` on line #8 creates a *subclass* of `App.Person`. Any instance of the `App.Person` class will *not* have the `march()` method.\n\n You can also pass `Ember.Mixin` classes to add additional properties to the subclass.\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n alert(this.get('name') + ' says: ' + thing);\n }\n });\n\n App.SingingMixin = Ember.Mixin.create({\n sing: function(thing){\n alert(this.get('name') + ' sings: la la la ' + thing);\n }\n });\n\n App.BroadwayStar = App.Person.extend(App.SingingMixin, {\n dance: function() {\n alert(this.get('name') + ' dances: tap tap tap tap ');\n }\n });\n ```\n\n The `App.BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`.\n\n @method extend\n @static\n\n @param {Ember.Mixin} [mixins]* One or more Ember.Mixin classes\n @param {Object} [arguments]* Object containing values to use within the new class\n */\n extend: function() {\n var Class = makeCtor(), proto;\n Class.ClassMixin = Mixin.create(this.ClassMixin);\n Class.PrototypeMixin = Mixin.create(this.PrototypeMixin);\n\n Class.ClassMixin.ownerConstructor = Class;\n Class.PrototypeMixin.ownerConstructor = Class;\n\n reopen.apply(Class.PrototypeMixin, arguments);\n\n Class.superclass = this;\n Class.__super__ = this.prototype;\n\n proto = Class.prototype = o_create(this.prototype);\n proto.constructor = Class;\n generateGuid(proto);\n meta(proto).proto = proto; // this will disable observers on prototype\n\n Class.ClassMixin.apply(Class);\n return Class;\n },\n\n /**\n Equivalent to doing `extend(arguments).create()`.\n If possible use the normal `create` method instead.\n\n @method createWithMixins\n @static\n @param [arguments]*\n */\n createWithMixins: function() {\n var C = this;\n if (arguments.length>0) { this._initMixins(arguments); }\n return new C();\n },\n\n /**\n Creates an instance of a class. Accepts either no arguments, or an object\n containing values to initialize the newly instantiated object with.\n\n ```javascript\n App.Person = Ember.Object.extend({\n helloWorld: function() {\n alert(\"Hi, my name is \" + this.get('name'));\n }\n });\n\n var tom = App.Person.create({\n name: 'Tom Dale'\n });\n\n tom.helloWorld(); // alerts \"Hi, my name is Tom Dale\".\n ```\n\n `create` will call the `init` function if defined during\n `Ember.AnyObject.extend`\n\n If no arguments are passed to `create`, it will not set values to the new\n instance during initialization:\n\n ```javascript\n var noName = App.Person.create();\n noName.helloWorld(); // alerts undefined\n ```\n\n NOTE: For performance reasons, you cannot declare methods or computed\n properties during `create`. You should instead declare methods and computed\n properties when using `extend` or use the `createWithMixins` shorthand.\n\n @method create\n @static\n @param [arguments]*\n */\n create: function() {\n var C = this;\n if (arguments.length>0) { this._initProperties(arguments); }\n return new C();\n },\n\n /**\n\n Augments a constructor's prototype with additional\n properties and functions:\n\n ```javascript\n MyObject = Ember.Object.extend({\n name: 'an object'\n });\n\n o = MyObject.create();\n o.get('name'); // 'an object'\n\n MyObject.reopen({\n say: function(msg){\n console.log(msg);\n }\n })\n\n o2 = MyObject.create();\n o2.say(\"hello\"); // logs \"hello\"\n\n o.say(\"goodbye\"); // logs \"goodbye\"\n ```\n\n To add functions and properties to the constructor itself,\n see `reopenClass`\n\n @method reopen\n */\n reopen: function() {\n this.willReopen();\n reopen.apply(this.PrototypeMixin, arguments);\n return this;\n },\n\n /**\n Augments a constructor's own properties and functions:\n\n ```javascript\n MyObject = Ember.Object.extend({\n name: 'an object'\n });\n\n\n MyObject.reopenClass({\n canBuild: false\n });\n\n MyObject.canBuild; // false\n o = MyObject.create();\n ```\n\n In other words, this creates static properties and functions for the class. These are only available on the class\n and not on any instance of that class.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name : \"\",\n sayHello : function(){\n alert(\"Hello. My name is \" + this.get('name'));\n }\n });\n\n App.Person.reopenClass({\n species : \"Homo sapiens\",\n createPerson: function(newPersonsName){\n return App.Person.create({\n name:newPersonsName\n });\n }\n });\n\n var tom = App.Person.create({\n name : \"Tom Dale\"\n });\n var yehuda = App.Person.createPerson(\"Yehuda Katz\");\n\n tom.sayHello(); // \"Hello. My name is Tom Dale\"\n yehuda.sayHello(); // \"Hello. My name is Yehuda Katz\"\n alert(App.Person.species); // \"Homo sapiens\"\n ```\n\n Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda`\n variables. They are only valid on `App.Person`.\n\n To add functions and properties to instances of\n a constructor by extending the constructor's prototype\n see `reopen`\n\n @method reopenClass\n */\n reopenClass: function() {\n reopen.apply(this.ClassMixin, arguments);\n applyMixin(this, arguments, false);\n return this;\n },\n\n detect: function(obj) {\n if ('function' !== typeof obj) { return false; }\n while(obj) {\n if (obj===this) { return true; }\n obj = obj.superclass;\n }\n return false;\n },\n\n detectInstance: function(obj) {\n return obj instanceof this;\n },\n\n /**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For\n example, computed property functions may close over variables that are then\n no longer available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```javascript\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n Once you've done this, you can retrieve the values saved to the computed\n property from your class like this:\n\n ```javascript\n MyClass.metaForProperty('person');\n ```\n\n This will return the original hash that was passed to `meta()`.\n\n @method metaForProperty\n @param key {String} property name\n */\n metaForProperty: function(key) {\n var desc = meta(this.proto(), false).descs[key];\n\n Ember.assert(\"metaForProperty() could not find a computed property with key '\"+key+\"'.\", !!desc && desc instanceof Ember.ComputedProperty);\n return desc._meta || {};\n },\n\n /**\n Iterate over each computed property for the class, passing its name\n and any associated metadata (see `metaForProperty`) to the callback.\n\n @method eachComputedProperty\n @param {Function} callback\n @param {Object} binding\n */\n eachComputedProperty: function(callback, binding) {\n var proto = this.proto(),\n descs = meta(proto).descs,\n empty = {},\n property;\n\n for (var name in descs) {\n property = descs[name];\n\n if (property instanceof Ember.ComputedProperty) {\n callback.call(binding || this, name, property._meta || empty);\n }\n }\n }\n\n});\n\nClassMixin.ownerConstructor = CoreObject;\n\nif (Ember.config.overrideClassMixin) {\n Ember.config.overrideClassMixin(ClassMixin);\n}\n\nCoreObject.ClassMixin = ClassMixin;\nClassMixin.apply(CoreObject);\n\nEmber.CoreObject = CoreObject;\n\n})();\n//@ sourceURL=ember-runtime/system/core_object");minispade.register('ember-runtime/system/deferred', "(function() {minispade.require(\"ember-runtime/mixins/deferred\");\nminispade.require(\"ember-runtime/system/object\");\n\nvar DeferredMixin = Ember.DeferredMixin, // mixins/deferred\n get = Ember.get;\n\nvar Deferred = Ember.Object.extend(DeferredMixin);\n\nDeferred.reopenClass({\n promise: function(callback, binding) {\n var deferred = Deferred.create();\n callback.call(binding, deferred);\n return deferred;\n }\n});\n\nEmber.Deferred = Deferred;\n\n})();\n//@ sourceURL=ember-runtime/system/deferred");minispade.register('ember-runtime/system/each_proxy', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/mixins/array');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar set = Ember.set, get = Ember.get, guidFor = Ember.guidFor;\nvar forEach = Ember.EnumerableUtils.forEach,\n indexOf = Ember.ArrayPolyfills.indexOf;\n\nvar EachArray = Ember.Object.extend(Ember.Array, {\n\n init: function(content, keyName, owner) {\n this._super();\n this._keyName = keyName;\n this._owner = owner;\n this._content = content;\n },\n\n objectAt: function(idx) {\n var item = this._content.objectAt(idx);\n return item && get(item, this._keyName);\n },\n\n length: Ember.computed(function() {\n var content = this._content;\n return content ? get(content, 'length') : 0;\n })\n\n});\n\nvar IS_OBSERVER = /^.+:(before|change)$/;\n\nfunction addObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects, guid;\n if (!objects) objects = proxy._objects = {};\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.assert('When using @each to observe the array ' + content + ', the array must return an object', Ember.typeOf(item) === 'instance' || Ember.typeOf(item) === 'object');\n Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n // keep track of the index each item was found at so we can map\n // it back when the obj changes.\n guid = guidFor(item);\n if (!objects[guid]) objects[guid] = [];\n objects[guid].push(loc);\n }\n }\n}\n\nfunction removeObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects;\n if (!objects) objects = proxy._objects = {};\n var indicies, guid;\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n guid = guidFor(item);\n indicies = objects[guid];\n indicies[indexOf.call(indicies, loc)] = null;\n }\n }\n}\n\n/**\n This is the object instance returned when you get the `@each` property on an\n array. It uses the unknownProperty handler to automatically create\n EachArray instances for property names.\n\n @private\n @class EachProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.EachProxy = Ember.Object.extend({\n\n init: function(content) {\n this._super();\n this._content = content;\n content.addArrayObserver(this);\n\n // in case someone is already observing some keys make sure they are\n // added\n forEach(Ember.watchedEvents(this), function(eventName) {\n this.didAddListener(eventName);\n }, this);\n },\n\n /**\n You can directly access mapped properties by simply requesting them.\n The `unknownProperty` handler will generate an EachArray of each item.\n\n @method unknownProperty\n @param keyName {String}\n @param value {*}\n */\n unknownProperty: function(keyName, value) {\n var ret;\n ret = new EachArray(this._content, keyName, this);\n Ember.defineProperty(this, keyName, null, ret);\n this.beginObservingContentKey(keyName);\n return ret;\n },\n\n // ..........................................................\n // ARRAY CHANGES\n // Invokes whenever the content array itself changes.\n\n arrayWillChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = removedCnt>0 ? idx+removedCnt : -1;\n Ember.beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) { removeObserverForContentKey(content, key, this, idx, lim); }\n\n Ember.propertyWillChange(this, key);\n }\n\n Ember.propertyWillChange(this._content, '@each');\n Ember.endPropertyChanges(this);\n },\n\n arrayDidChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, lim;\n\n lim = addedCnt>0 ? idx+addedCnt : -1;\n Ember.changeProperties(function() {\n for(var key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) { addObserverForContentKey(content, key, this, idx, lim); }\n\n Ember.propertyDidChange(this, key);\n }\n\n Ember.propertyDidChange(this._content, '@each');\n }, this);\n },\n\n // ..........................................................\n // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS\n // Start monitoring keys based on who is listening...\n\n didAddListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.beginObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n didRemoveListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.stopObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n // ..........................................................\n // CONTENT KEY OBSERVING\n // Actual watch keys on the source content.\n\n beginObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (!keys) keys = this._keys = {};\n if (!keys[keyName]) {\n keys[keyName] = 1;\n var content = this._content,\n len = get(content, 'length');\n addObserverForContentKey(content, keyName, this, 0, len);\n } else {\n keys[keyName]++;\n }\n },\n\n stopObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {\n var content = this._content,\n len = get(content, 'length');\n removeObserverForContentKey(content, keyName, this, 0, len);\n }\n },\n\n contentKeyWillChange: function(obj, keyName) {\n Ember.propertyWillChange(this, keyName);\n },\n\n contentKeyDidChange: function(obj, keyName) {\n Ember.propertyDidChange(this, keyName);\n }\n\n});\n\n\n\n})();\n//@ sourceURL=ember-runtime/system/each_proxy");minispade.register('ember-runtime/system/lazy_load', "(function() {var forEach = Ember.ArrayPolyfills.forEach;\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar loadHooks = Ember.ENV.EMBER_LOAD_HOOKS || {};\nvar loaded = {};\n\n/**\n\nDetects when a specific package of Ember (e.g. 'Ember.Handlebars')\nhas fully loaded and is available for extension.\n\nThe provided `callback` will be called with the `name` passed\nresolved from a string into the object:\n\n```javascript\nEmber.onLoad('Ember.Handlebars' function(hbars){\n hbars.registerHelper(...);\n});\n```\n\n\n@method onLoad\n@for Ember\n@param name {String} name of hook\n@param callback {Function} callback to be called\n*/\nEmber.onLoad = function(name, callback) {\n var object;\n\n loadHooks[name] = loadHooks[name] || Ember.A();\n loadHooks[name].pushObject(callback);\n\n if (object = loaded[name]) {\n callback(object);\n }\n};\n\n/**\n\nCalled when an Ember.js package (e.g Ember.Handlebars) has finished\nloading. Triggers any callbacks registered for this event.\n\n@method runLoadHooks\n@for Ember\n@param name {String} name of hook\n@param object {Object} object to pass to callbacks\n*/\nEmber.runLoadHooks = function(name, object) {\n loaded[name] = object;\n\n if (loadHooks[name]) {\n forEach.call(loadHooks[name], function(callback) {\n callback(object);\n });\n }\n};\n\n})();\n//@ sourceURL=ember-runtime/system/lazy_load");minispade.register('ember-runtime/system/namespace', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, indexOf = Ember.ArrayPolyfills.indexOf;\n\n/**\n A Namespace is an object usually used to contain other objects or methods\n such as an application or framework. Create a namespace anytime you want\n to define one of these new containers.\n\n # Example Usage\n\n ```javascript\n MyFramework = Ember.Namespace.create({\n VERSION: '1.0.0'\n });\n ```\n\n @class Namespace\n @namespace Ember\n @extends Ember.Object\n*/\nvar Namespace = Ember.Namespace = Ember.Object.extend({\n isNamespace: true,\n\n init: function() {\n Ember.Namespace.NAMESPACES.push(this);\n Ember.Namespace.PROCESSED = false;\n },\n\n toString: function() {\n var name = get(this, 'name');\n if (name) { return name; }\n\n findNamespaces();\n return this[Ember.GUID_KEY+'_name'];\n },\n\n nameClasses: function() {\n processNamespace([this.toString()], this, {});\n },\n\n destroy: function() {\n var namespaces = Ember.Namespace.NAMESPACES;\n Ember.lookup[this.toString()] = undefined;\n namespaces.splice(indexOf.call(namespaces, this), 1);\n this._super();\n }\n});\n\nNamespace.reopenClass({\n NAMESPACES: [Ember],\n NAMESPACES_BY_ID: {},\n PROCESSED: false,\n processAll: processAllNamespaces,\n byName: function(name) {\n if (!Ember.BOOTED) {\n processAllNamespaces();\n }\n\n return NAMESPACES_BY_ID[name];\n }\n});\n\nvar NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;\n\nvar hasOwnProp = ({}).hasOwnProperty,\n guidFor = Ember.guidFor;\n\nfunction processNamespace(paths, root, seen) {\n var idx = paths.length;\n\n NAMESPACES_BY_ID[paths.join('.')] = root;\n\n // Loop over all of the keys in the namespace, looking for classes\n for(var key in root) {\n if (!hasOwnProp.call(root, key)) { continue; }\n var obj = root[key];\n\n // If we are processing the `Ember` namespace, for example, the\n // `paths` will start with `[\"Ember\"]`. Every iteration through\n // the loop will update the **second** element of this list with\n // the key, so processing `Ember.View` will make the Array\n // `['Ember', 'View']`.\n paths[idx] = key;\n\n // If we have found an unprocessed class\n if (obj && obj.toString === classToString) {\n // Replace the class' `toString` with the dot-separated path\n // and set its `NAME_KEY`\n obj.toString = makeToString(paths.join('.'));\n obj[NAME_KEY] = paths.join('.');\n\n // Support nested namespaces\n } else if (obj && obj.isNamespace) {\n // Skip aliased namespaces\n if (seen[guidFor(obj)]) { continue; }\n seen[guidFor(obj)] = true;\n\n // Process the child namespace\n processNamespace(paths, obj, seen);\n }\n }\n\n paths.length = idx; // cut out last item\n}\n\nfunction findNamespaces() {\n var Namespace = Ember.Namespace, lookup = Ember.lookup, obj, isNamespace;\n\n if (Namespace.PROCESSED) { return; }\n\n for (var prop in lookup) {\n // These don't raise exceptions but can cause warnings\n if (prop === \"parent\" || prop === \"top\" || prop === \"frameElement\" || prop === \"webkitStorageInfo\") { continue; }\n\n // get(window.globalStorage, 'isNamespace') would try to read the storage for domain isNamespace and cause exception in Firefox.\n // globalStorage is a storage obsoleted by the WhatWG storage specification. See https://developer.mozilla.org/en/DOM/Storage#globalStorage\n if (prop === \"globalStorage\" && lookup.StorageList && lookup.globalStorage instanceof lookup.StorageList) { continue; }\n // Unfortunately, some versions of IE don't support window.hasOwnProperty\n if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }\n\n // At times we are not allowed to access certain properties for security reasons.\n // There are also times where even if we can access them, we are not allowed to access their properties.\n try {\n obj = Ember.lookup[prop];\n isNamespace = obj && obj.isNamespace;\n } catch (e) {\n continue;\n }\n\n if (isNamespace) {\n Ember.deprecate(\"Namespaces should not begin with lowercase.\", /^[A-Z]/.test(prop));\n obj[NAME_KEY] = prop;\n }\n }\n}\n\nvar NAME_KEY = Ember.NAME_KEY = Ember.GUID_KEY + '_name';\n\nfunction superClassString(mixin) {\n var superclass = mixin.superclass;\n if (superclass) {\n if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }\n else { return superClassString(superclass); }\n } else {\n return;\n }\n}\n\nfunction classToString() {\n if (!Ember.BOOTED && !this[NAME_KEY]) {\n processAllNamespaces();\n }\n\n var ret;\n\n if (this[NAME_KEY]) {\n ret = this[NAME_KEY];\n } else if (this._toString) {\n ret = this._toString; \n } else {\n var str = superClassString(this);\n if (str) {\n ret = \"(subclass of \" + str + \")\";\n } else {\n ret = \"(unknown mixin)\";\n }\n this.toString = makeToString(ret);\n }\n\n return ret;\n}\n\nfunction processAllNamespaces() {\n var unprocessedNamespaces = !Namespace.PROCESSED,\n unprocessedMixins = Ember.anyUnprocessedMixins;\n\n if (unprocessedNamespaces) {\n findNamespaces();\n Namespace.PROCESSED = true;\n }\n\n if (unprocessedNamespaces || unprocessedMixins) {\n var namespaces = Namespace.NAMESPACES, namespace;\n for (var i=0, l=namespaces.length; i<l; i++) {\n namespace = namespaces[i];\n processNamespace([namespace.toString()], namespace, {});\n }\n\n Ember.anyUnprocessedMixins = false;\n }\n}\n\nfunction makeToString(ret) {\n return function() { return ret; };\n}\n\nEmber.Mixin.prototype.toString = classToString;\n\n})();\n//@ sourceURL=ember-runtime/system/namespace");minispade.register('ember-runtime/system/native_array', "(function() {minispade.require('ember-metal/enumerable_utils');\nminispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/mixins/copyable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar get = Ember.get, set = Ember.set, replace = Ember.EnumerableUtils._replace;\n\n// Add Ember.Array to Array.prototype. Remove methods with native\n// implementations and supply some more optimized versions of generic methods\n// because they are so common.\nvar NativeArray = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember.Copyable, {\n\n // because length is a built-in property we need to know to just get the\n // original property.\n get: function(key) {\n if (key==='length') return this.length;\n else if ('number' === typeof key) return this[key];\n else return this._super(key);\n },\n\n objectAt: function(idx) {\n return this[idx];\n },\n\n // primitive for array support.\n replace: function(idx, amt, objects) {\n\n if (this.isFrozen) throw Ember.FROZEN_ERROR;\n\n // if we replaced exactly the same number of items, then pass only the\n // replaced range. Otherwise, pass the full remaining array length\n // since everything has shifted\n var len = objects ? get(objects, 'length') : 0;\n this.arrayContentWillChange(idx, amt, len);\n\n if (len === 0) {\n this.splice(idx, amt);\n } else {\n replace(this, idx, amt, objects);\n }\n\n this.arrayContentDidChange(idx, amt, len);\n return this;\n },\n\n // If you ask for an unknown property, then try to collect the value\n // from member items.\n unknownProperty: function(key, value) {\n var ret;// = this.reducedProperty(key, value) ;\n if ((value !== undefined) && ret === undefined) {\n ret = this[key] = value;\n }\n return ret ;\n },\n\n // If browser did not implement indexOf natively, then override with\n // specialized version\n indexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = 0;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n lastIndexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = len-1;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n copy: function(deep) {\n if (deep) {\n return this.map(function(item) { return Ember.copy(item, true); });\n }\n\n return this.slice();\n }\n});\n\n// Remove any methods implemented natively so we don't override them\nvar ignore = ['length'];\nEmber.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {\n if (Array.prototype[methodName]) ignore.push(methodName);\n});\n\nif (ignore.length>0) {\n NativeArray = NativeArray.without.apply(NativeArray, ignore);\n}\n\n/**\n The NativeArray mixin contains the properties needed to to make the native\n Array support Ember.MutableArray and all of its dependent APIs. Unless you\n have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to\n false, this will be applied automatically. Otherwise you can apply the mixin\n at anytime by calling `Ember.NativeArray.activate`.\n\n @class NativeArray\n @namespace Ember\n @uses Ember.MutableArray\n @uses Ember.Observable\n @uses Ember.Copyable\n*/\nEmber.NativeArray = NativeArray;\n\n/**\n Creates an `Ember.NativeArray` from an Array like object.\n Does not modify the original object. Ember.A is not needed if\n `Ember.EXTEND_PROTOTYPES` is `true` (the default value). However,\n it is recommended that you use Ember.A when creating addons for\n ember or when you can not garentee that `Ember.EXTEND_PROTOTYPES`\n will be `true`.\n\n Example\n\n ```js\n var Pagination = Ember.CollectionView.extend({\n tagName: 'ul',\n classNames: ['pagination'],\n init: function() {\n this._super();\n if (!this.get('content')) {\n this.set('content', Ember.A([]));\n }\n }\n });\n ```\n\n @method A\n @for Ember\n @return {Ember.NativeArray}\n*/\nEmber.A = function(arr) {\n if (arr === undefined) { arr = []; }\n return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);\n};\n\n/**\n Activates the mixin on the Array.prototype if not already applied. Calling\n this method more than once is safe. This will be called when ember is loaded\n unless you have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array`\n set to `false`.\n\n Example\n\n ```js\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n Ember.NativeArray.activate();\n }\n ```\n\n @method activate\n @for Ember.NativeArray\n @static\n @return {void}\n*/\nEmber.NativeArray.activate = function() {\n NativeArray.apply(Array.prototype);\n\n Ember.A = function(arr) { return arr || []; };\n};\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n Ember.NativeArray.activate();\n}\n\n\n})();\n//@ sourceURL=ember-runtime/system/native_array");minispade.register('ember-runtime/system/object', "(function() {minispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/system/core_object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.Object` is the main base class for all Ember objects. It is a subclass\n of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,\n see the documentation for each of these.\n\n @class Object\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.Observable\n*/\nEmber.Object = Ember.CoreObject.extend(Ember.Observable);\nEmber.Object.toString = function() { return \"Ember.Object\"; };\n\n})();\n//@ sourceURL=ember-runtime/system/object");minispade.register('ember-runtime/system/object_proxy', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get,\n set = Ember.set,\n fmt = Ember.String.fmt,\n addBeforeObserver = Ember.addBeforeObserver,\n addObserver = Ember.addObserver,\n removeBeforeObserver = Ember.removeBeforeObserver,\n removeObserver = Ember.removeObserver,\n propertyWillChange = Ember.propertyWillChange,\n propertyDidChange = Ember.propertyDidChange,\n meta = Ember.meta,\n defineProperty = Ember.defineProperty;\n\nfunction contentPropertyWillChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyWillChange(this, key);\n}\n\nfunction contentPropertyDidChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyDidChange(this, key);\n}\n\n/**\n `Ember.ObjectProxy` forwards all properties not defined by the proxy itself\n to a proxied `content` object.\n\n ```javascript\n object = Ember.Object.create({\n name: 'Foo'\n });\n\n proxy = Ember.ObjectProxy.create({\n content: object\n });\n\n // Access and change existing properties\n proxy.get('name') // 'Foo'\n proxy.set('name', 'Bar');\n object.get('name') // 'Bar'\n\n // Create new 'description' property on `object`\n proxy.set('description', 'Foo is a whizboo baz');\n object.get('description') // 'Foo is a whizboo baz'\n ```\n\n While `content` is unset, setting a property to be delegated will throw an\n Error.\n\n ```javascript\n proxy = Ember.ObjectProxy.create({\n content: null,\n flag: null\n });\n proxy.set('flag', true);\n proxy.get('flag'); // true\n proxy.get('foo'); // undefined\n proxy.set('foo', 'data'); // throws Error\n ```\n\n Delegated properties can be bound to and will change when content is updated.\n\n Computed properties on the proxy itself can depend on delegated properties.\n\n ```javascript\n ProxyWithComputedProperty = Ember.ObjectProxy.extend({\n fullName: function () {\n var firstName = this.get('firstName'),\n lastName = this.get('lastName');\n if (firstName && lastName) {\n return firstName + ' ' + lastName;\n }\n return firstName || lastName;\n }.property('firstName', 'lastName')\n });\n\n proxy = ProxyWithComputedProperty.create();\n\n proxy.get('fullName'); // undefined\n proxy.set('content', {\n firstName: 'Tom', lastName: 'Dale'\n }); // triggers property change for fullName on proxy\n\n proxy.get('fullName'); // 'Tom Dale'\n ```\n\n @class ObjectProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.ObjectProxy = Ember.Object.extend(/** @scope Ember.ObjectProxy.prototype */ {\n /**\n The object whose properties will be forwarded.\n\n @property content\n @type Ember.Object\n @default null\n */\n content: null,\n _contentDidChange: Ember.observer('content', function() {\n Ember.assert(\"Can't set ObjectProxy's content to itself\", this.get('content') !== this);\n }),\n\n isTruthy: Ember.computed.bool('content'),\n\n _debugContainerKey: null,\n\n willWatchProperty: function (key) {\n var contentKey = 'content.' + key;\n addBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n addObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n didUnwatchProperty: function (key) {\n var contentKey = 'content.' + key;\n removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n removeObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n unknownProperty: function (key) {\n var content = get(this, 'content');\n if (content) {\n return get(content, key);\n }\n },\n\n setUnknownProperty: function (key, value) {\n var m = meta(this);\n if (m.proto === this) {\n // if marked as prototype then just defineProperty\n // rather than delegate\n defineProperty(this, key, null, value);\n return value;\n }\n\n var content = get(this, 'content');\n Ember.assert(fmt(\"Cannot delegate set('%@', %@) to the 'content' property of object proxy %@: its 'content' is undefined.\", [key, value, this]), content);\n return set(content, key, value);\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/system/object_proxy");minispade.register('ember-runtime/system/set', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/freezable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, isNone = Ember.isNone, fmt = Ember.String.fmt;\n\n/**\n An unordered collection of objects.\n\n A Set works a bit like an array except that its items are not ordered. You\n can create a set to efficiently test for membership for an object. You can\n also iterate through a set just like an array, even accessing objects by\n index, however there is no guarantee as to their order.\n\n All Sets are observable via the Enumerable Observer API - which works\n on any enumerable object including both Sets and Arrays.\n\n ## Creating a Set\n\n You can create a set like you would most objects using\n `new Ember.Set()`. Most new sets you create will be empty, but you can\n also initialize the set with some content by passing an array or other\n enumerable of objects to the constructor.\n\n Finally, you can pass in an existing set and the set will be copied. You\n can also create a copy of a set by calling `Ember.Set#copy()`.\n\n ```javascript\n // creates a new empty set\n var foundNames = new Ember.Set();\n\n // creates a set with four names in it.\n var names = new Ember.Set([\"Charles\", \"Tom\", \"Juan\", \"Alex\"]); // :P\n\n // creates a copy of the names set.\n var namesCopy = new Ember.Set(names);\n\n // same as above.\n var anotherNamesCopy = names.copy();\n ```\n\n ## Adding/Removing Objects\n\n You generally add or remove objects from a set using `add()` or\n `remove()`. You can add any type of object including primitives such as\n numbers, strings, and booleans.\n\n Unlike arrays, objects can only exist one time in a set. If you call `add()`\n on a set with the same object multiple times, the object will only be added\n once. Likewise, calling `remove()` with the same object multiple times will\n remove the object the first time and have no effect on future calls until\n you add the object to the set again.\n\n NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do\n so will be ignored.\n\n In addition to add/remove you can also call `push()`/`pop()`. Push behaves\n just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary\n object, remove it and return it. This is a good way to use a set as a job\n queue when you don't care which order the jobs are executed in.\n\n ## Testing for an Object\n\n To test for an object's presence in a set you simply call\n `Ember.Set#contains()`.\n\n ## Observing changes\n\n When using `Ember.Set`, you can observe the `\"[]\"` property to be\n alerted whenever the content changes. You can also add an enumerable\n observer to the set to be notified of specific objects that are added and\n removed from the set. See [Ember.Enumerable](/api/classes/Ember.Enumerable.html)\n for more information on enumerables.\n\n This is often unhelpful. If you are filtering sets of objects, for instance,\n it is very inefficient to re-filter all of the items each time the set\n changes. It would be better if you could just adjust the filtered set based\n on what was changed on the original set. The same issue applies to merging\n sets, as well.\n\n ## Other Methods\n\n `Ember.Set` primary implements other mixin APIs. For a complete reference\n on the methods you will use with `Ember.Set`, please consult these mixins.\n The most useful ones will be `Ember.Enumerable` and\n `Ember.MutableEnumerable` which implement most of the common iterator\n methods you are used to on Array.\n\n Note that you can also use the `Ember.Copyable` and `Ember.Freezable`\n APIs on `Ember.Set` as well. Once a set is frozen it can no longer be\n modified. The benefit of this is that when you call `frozenCopy()` on it,\n Ember will avoid making copies of the set. This allows you to write\n code that can know with certainty when the underlying set data will or\n will not be modified.\n\n @class Set\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.MutableEnumerable\n @uses Ember.Copyable\n @uses Ember.Freezable\n @since Ember 0.9\n*/\nEmber.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,\n /** @scope Ember.Set.prototype */ {\n\n // ..........................................................\n // IMPLEMENT ENUMERABLE APIS\n //\n\n /**\n This property will change as the number of objects in the set changes.\n\n @property length\n @type number\n @default 0\n */\n length: 0,\n\n /**\n Clears the set. This is useful if you want to reuse an existing set\n without having to recreate it.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.length; // 3\n colors.clear();\n colors.length; // 0\n ```\n\n @method clear\n @return {Ember.Set} An empty Set\n */\n clear: function() {\n if (this.isFrozen) { throw new Ember.Error(Ember.FROZEN_ERROR); }\n\n var len = get(this, 'length');\n if (len === 0) { return this; }\n\n var guid;\n\n this.enumerableContentWillChange(len, 0);\n Ember.propertyWillChange(this, 'firstObject');\n Ember.propertyWillChange(this, 'lastObject');\n\n for (var i=0; i < len; i++) {\n guid = guidFor(this[i]);\n delete this[guid];\n delete this[i];\n }\n\n set(this, 'length', 0);\n\n Ember.propertyDidChange(this, 'firstObject');\n Ember.propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(len, 0);\n\n return this;\n },\n\n /**\n Returns true if the passed object is also an enumerable that contains the\n same objects as the receiver.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"],\n same_colors = new Ember.Set(colors);\n\n same_colors.isEqual(colors); // true\n same_colors.isEqual([\"purple\", \"brown\"]); // false\n ```\n\n @method isEqual\n @param {Ember.Set} obj the other object.\n @return {Boolean}\n */\n isEqual: function(obj) {\n // fail fast\n if (!Ember.Enumerable.detect(obj)) return false;\n\n var loc = get(this, 'length');\n if (get(obj, 'length') !== loc) return false;\n\n while(--loc >= 0) {\n if (!obj.contains(this[loc])) return false;\n }\n\n return true;\n },\n\n /**\n Adds an object to the set. Only non-`null` objects can be added to a set\n and those can only be added once. If the object is already in the set or\n the passed value is null this method will have no effect.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"red\"); // [\"blue\", \"red\"]\n colors.add(null); // [\"blue\", \"red\"]\n colors.add(undefined); // [\"blue\", \"red\"]\n ```\n\n @method add\n @param {Object} obj The object to add.\n @return {Ember.Set} The set itself.\n */\n add: Ember.aliasMethod('addObject'),\n\n /**\n Removes the object from the set if it is found. If you pass a `null` value\n or an object that is already not in the set, this method will have no\n effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.remove(\"red\"); // [\"blue\", \"green\"]\n colors.remove(\"purple\"); // [\"blue\", \"green\"]\n colors.remove(null); // [\"blue\", \"green\"]\n ```\n\n @method remove\n @param {Object} obj The object to remove\n @return {Ember.Set} The set itself.\n */\n remove: Ember.aliasMethod('removeObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.pop(); // \"blue\"\n colors.pop(); // \"green\"\n colors.pop(); // null\n ```\n\n @method pop\n @return {Object} The removed object from the set or null.\n */\n pop: function() {\n if (get(this, 'isFrozen')) throw new Ember.Error(Ember.FROZEN_ERROR);\n var obj = this.length > 0 ? this[this.length-1] : null;\n this.remove(obj);\n return obj;\n },\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.push(\"red\"); // [\"red\"]\n colors.push(\"green\"); // [\"red\", \"green\"]\n colors.push(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method push\n @return {Ember.Set} The set itself.\n */\n push: Ember.aliasMethod('addObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n This is an alias for `Ember.Set.pop()`.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.shift(); // \"blue\"\n colors.shift(); // \"green\"\n colors.shift(); // null\n ```\n\n @method shift\n @return {Object} The removed object from the set or null.\n */\n shift: Ember.aliasMethod('pop'),\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias of `Ember.Set.push()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.unshift(\"red\"); // [\"red\"]\n colors.unshift(\"green\"); // [\"red\", \"green\"]\n colors.unshift(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method unshift\n @return {Ember.Set} The set itself.\n */\n unshift: Ember.aliasMethod('push'),\n\n /**\n Adds each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.addObjects()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.addEach([\"red\", \"green\", \"blue\"]); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method addEach\n @param {Ember.Enumerable} objects the objects to add.\n @return {Ember.Set} The set itself.\n */\n addEach: Ember.aliasMethod('addObjects'),\n\n /**\n Removes each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.removeObjects()`\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.removeEach([\"red\", \"blue\"]); // [\"green\"]\n ```\n\n @method removeEach\n @param {Ember.Enumerable} objects the objects to remove.\n @return {Ember.Set} The set itself.\n */\n removeEach: Ember.aliasMethod('removeObjects'),\n\n // ..........................................................\n // PRIVATE ENUMERABLE SUPPORT\n //\n\n init: function(items) {\n this._super();\n if (items) this.addObjects(items);\n },\n\n // implement Ember.Enumerable\n nextObject: function(idx) {\n return this[idx];\n },\n\n // more optimized version\n firstObject: Ember.computed(function() {\n return this.length > 0 ? this[0] : undefined;\n }),\n\n // more optimized version\n lastObject: Ember.computed(function() {\n return this.length > 0 ? this[this.length-1] : undefined;\n }),\n\n // implements Ember.MutableEnumerable\n addObject: function(obj) {\n if (get(this, 'isFrozen')) throw new Ember.Error(Ember.FROZEN_ERROR);\n if (isNone(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n added ;\n\n if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added\n\n added = [obj];\n\n this.enumerableContentWillChange(null, added);\n Ember.propertyWillChange(this, 'lastObject');\n\n len = get(this, 'length');\n this[guid] = len;\n this[len] = obj;\n set(this, 'length', len+1);\n\n Ember.propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(null, added);\n\n return this;\n },\n\n // implements Ember.MutableEnumerable\n removeObject: function(obj) {\n if (get(this, 'isFrozen')) throw new Ember.Error(Ember.FROZEN_ERROR);\n if (isNone(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n isFirst = idx === 0,\n isLast = idx === len-1,\n last, removed;\n\n\n if (idx>=0 && idx<len && (this[idx] === obj)) {\n removed = [obj];\n\n this.enumerableContentWillChange(removed, null);\n if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }\n if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }\n\n // swap items - basically move the item to the end so it can be removed\n if (idx < len-1) {\n last = this[len-1];\n this[idx] = last;\n this[guidFor(last)] = idx;\n }\n\n delete this[guid];\n delete this[len-1];\n set(this, 'length', len-1);\n\n if (isFirst) { Ember.propertyDidChange(this, 'firstObject'); }\n if (isLast) { Ember.propertyDidChange(this, 'lastObject'); }\n this.enumerableContentDidChange(removed, null);\n }\n\n return this;\n },\n\n // optimized version\n contains: function(obj) {\n return this[guidFor(obj)]>=0;\n },\n\n copy: function() {\n var C = this.constructor, ret = new C(), loc = get(this, 'length');\n set(ret, 'length', loc);\n while(--loc>=0) {\n ret[loc] = this[loc];\n ret[guidFor(this[loc])] = loc;\n }\n return ret;\n },\n\n toString: function() {\n var len = this.length, idx, array = [];\n for(idx = 0; idx < len; idx++) {\n array[idx] = this[idx];\n }\n return fmt(\"Ember.Set<%@>\", [array.join(',')]);\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/system/set");minispade.register('ember-runtime/system/string', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar STRING_DASHERIZE_REGEXP = (/[ _]/g);\nvar STRING_DASHERIZE_CACHE = {};\nvar STRING_DECAMELIZE_REGEXP = (/([a-z\\d])([A-Z])/g);\nvar STRING_CAMELIZE_REGEXP = (/(\\-|_|\\.|\\s)+(.)?/g);\nvar STRING_UNDERSCORE_REGEXP_1 = (/([a-z\\d])([A-Z]+)/g);\nvar STRING_UNDERSCORE_REGEXP_2 = (/\\-|\\s+/g);\n\n/**\n Defines the hash of localized strings for the current language. Used by\n the `Ember.String.loc()` helper. To localize, add string values to this\n hash.\n\n @property STRINGS\n @for Ember\n @type Hash\n*/\nEmber.STRINGS = {};\n\n/**\n Defines string helper methods including string formatting and localization.\n Unless `Ember.EXTEND_PROTOTYPES.String` is `false` these methods will also be\n added to the `String.prototype` as well.\n\n @class String\n @namespace Ember\n @static\n*/\nEmber.String = {\n\n /**\n Apply formatting options to the string. This will look for occurrences\n of \"%@\" in your string and substitute them with the arguments you pass into\n this method. If you want to control the specific order of replacement,\n you can add a number after the key as well to indicate which argument\n you want to insert.\n\n Ordered insertions are most useful when building loc strings where values\n you need to insert may appear in different orders.\n\n ```javascript\n \"Hello %@ %@\".fmt('John', 'Doe'); // \"Hello John Doe\"\n \"Hello %@2, %@1\".fmt('John', 'Doe'); // \"Hello Doe, John\"\n ```\n\n @method fmt\n @param {String} str The string to format\n @param {Array} formats An array of parameters to interpolate into string.\n @return {String} formatted string\n */\n fmt: function(str, formats) {\n // first, replace any ORDERED replacements.\n var idx = 0; // the current index for non-numerical replacements\n return str.replace(/%@([0-9]+)?/g, function(s, argIndex) {\n argIndex = (argIndex) ? parseInt(argIndex, 10) - 1 : idx++;\n s = formats[argIndex];\n return (s === null) ? '(null)' : (s === undefined) ? '' : Ember.inspect(s);\n }) ;\n },\n\n /**\n Formats the passed string, but first looks up the string in the localized\n strings hash. This is a convenient way to localize text. See\n `Ember.String.fmt()` for more information on formatting.\n\n Note that it is traditional but not required to prefix localized string\n keys with an underscore or other character so you can easily identify\n localized strings.\n\n ```javascript\n Ember.STRINGS = {\n '_Hello World': 'Bonjour le monde',\n '_Hello %@ %@': 'Bonjour %@ %@'\n };\n\n Ember.String.loc(\"_Hello World\"); // 'Bonjour le monde';\n Ember.String.loc(\"_Hello %@ %@\", [\"John\", \"Smith\"]); // \"Bonjour John Smith\";\n ```\n\n @method loc\n @param {String} str The string to format\n @param {Array} formats Optional array of parameters to interpolate into string.\n @return {String} formatted string\n */\n loc: function(str, formats) {\n str = Ember.STRINGS[str] || str;\n return Ember.String.fmt(str, formats) ;\n },\n\n /**\n Splits a string into separate units separated by spaces, eliminating any\n empty strings in the process. This is a convenience method for split that\n is mostly useful when applied to the `String.prototype`.\n\n ```javascript\n Ember.String.w(\"alpha beta gamma\").forEach(function(key) {\n console.log(key);\n });\n\n // > alpha\n // > beta\n // > gamma\n ```\n\n @method w\n @param {String} str The string to split\n @return {String} split string\n */\n w: function(str) { return str.split(/\\s+/); },\n\n /**\n Converts a camelized string into all lower case separated by underscores.\n\n ```javascript\n 'innerHTML'.decamelize(); // 'inner_html'\n 'action_name'.decamelize(); // 'action_name'\n 'css-class-name'.decamelize(); // 'css-class-name'\n 'my favorite items'.decamelize(); // 'my favorite items'\n ```\n\n @method decamelize\n @param {String} str The string to decamelize.\n @return {String} the decamelized string.\n */\n decamelize: function(str) {\n return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();\n },\n\n /**\n Replaces underscores, spaces, or camelCase with dashes.\n\n ```javascript\n 'innerHTML'.dasherize(); // 'inner-html'\n 'action_name'.dasherize(); // 'action-name'\n 'css-class-name'.dasherize(); // 'css-class-name'\n 'my favorite items'.dasherize(); // 'my-favorite-items'\n ```\n\n @method dasherize\n @param {String} str The string to dasherize.\n @return {String} the dasherized string.\n */\n dasherize: function(str) {\n var cache = STRING_DASHERIZE_CACHE,\n hit = cache.hasOwnProperty(str),\n ret;\n\n if (hit) {\n return cache[str];\n } else {\n ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');\n cache[str] = ret;\n }\n\n return ret;\n },\n\n /**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.camelize(); // 'innerHTML'\n 'action_name'.camelize(); // 'actionName'\n 'css-class-name'.camelize(); // 'cssClassName'\n 'my favorite items'.camelize(); // 'myFavoriteItems'\n 'My Favorite Items'.camelize(); // 'myFavoriteItems'\n ```\n\n @method camelize\n @param {String} str The string to camelize.\n @return {String} the camelized string.\n */\n camelize: function(str) {\n return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) {\n return chr ? chr.toUpperCase() : '';\n }).replace(/^([A-Z])/, function(match, separator, chr) {\n return match.toLowerCase();\n });\n },\n\n /**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.classify(); // 'InnerHTML'\n 'action_name'.classify(); // 'ActionName'\n 'css-class-name'.classify(); // 'CssClassName'\n 'my favorite items'.classify(); // 'MyFavoriteItems'\n ```\n\n @method classify\n @param {String} str the string to classify\n @return {String} the classified string\n */\n classify: function(str) {\n var parts = str.split(\".\"),\n out = [];\n\n for (var i=0, l=parts.length; i<l; i++) {\n var camelized = Ember.String.camelize(parts[i]);\n out.push(camelized.charAt(0).toUpperCase() + camelized.substr(1));\n }\n\n return out.join(\".\");\n },\n\n /**\n More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n form of a string.\n\n ```javascript\n 'innerHTML'.underscore(); // 'inner_html'\n 'action_name'.underscore(); // 'action_name'\n 'css-class-name'.underscore(); // 'css_class_name'\n 'my favorite items'.underscore(); // 'my_favorite_items'\n ```\n\n @method underscore\n @param {String} str The string to underscore.\n @return {String} the underscored string.\n */\n underscore: function(str) {\n return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').\n replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase();\n },\n\n /**\n Returns the Capitalized form of a string\n\n ```javascript\n 'innerHTML'.capitalize() // 'InnerHTML'\n 'action_name'.capitalize() // 'Action_name'\n 'css-class-name'.capitalize() // 'Css-class-name'\n 'my favorite items'.capitalize() // 'My favorite items'\n ```\n\n @method capitalize\n @param {String} str The string to capitalize.\n @return {String} The capitalized string.\n */\n capitalize: function(str) {\n return str.charAt(0).toUpperCase() + str.substr(1);\n }\n};\n\nif (Ember.FEATURES.isEnabled(\"string-humanize\")) {\n /**\n Returns the Humanized form of a string\n\n Replaces underscores with spaces, and capitializes first character\n of string. Also strips \"_id\" suffixes.\n\n ```javascript\n 'first_name'.humanize() // 'First name'\n 'user_id'.humanize() // 'User'\n ```\n\n @method humanize\n @param {String} str The string to humanize.\n @return {String} The humanized string.\n */\n\n Ember.String.humanize = function(str) {\n return str.replace(/_id$/, '').\n replace(/_/g, ' ').\n replace(/^\\w/g, function(s){\n return s.toUpperCase();\n });\n };\n}\n\n\n})();\n//@ sourceURL=ember-runtime/system/string");minispade.register('ember-runtime/system/subarray', "(function() {var get = Ember.get,\n forEach = Ember.EnumerableUtils.forEach,\n RETAIN = 'r',\n FILTER = 'f';\n\nfunction Operation (type, count) {\n this.type = type;\n this.count = count;\n}\n\n/**\n An `Ember.SubArray` tracks an array in a way similar to, but more specialized\n than, `Ember.TrackedArray`. It is useful for keeping track of the indexes of\n items within a filtered array.\n\n @class SubArray\n @namespace Ember\n*/\nEmber.SubArray = function (length) {\n if (arguments.length < 1) { length = 0; }\n\n if (length > 0) {\n this._operations = [new Operation(RETAIN, length)];\n } else {\n this._operations = [];\n }\n};\n\nEmber.SubArray.prototype = {\n /**\n Track that an item was added to the tracked array.\n\n @method addItem\n\n @param {number} index The index of the item in the tracked array.\n @param {boolean} match `true` iff the item is included in the subarray.\n\n @return {number} The index of the item in the subarray.\n */\n addItem: function(index, match) {\n var returnValue = -1,\n itemType = match ? RETAIN : FILTER,\n self = this;\n\n this._findOperation(index, function(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) {\n var newOperation, splitOperation;\n\n if (itemType === operation.type) {\n ++operation.count;\n } else if (index === rangeStart) {\n // insert to the left of `operation`\n self._operations.splice(operationIndex, 0, new Operation(itemType, 1));\n } else {\n newOperation = new Operation(itemType, 1);\n splitOperation = new Operation(operation.type, rangeEnd - index + 1);\n operation.count = index - rangeStart;\n\n self._operations.splice(operationIndex + 1, 0, newOperation, splitOperation);\n }\n\n if (match) {\n if (operation.type === RETAIN) {\n returnValue = seenInSubArray + (index - rangeStart);\n } else {\n returnValue = seenInSubArray;\n }\n }\n\n self._composeAt(operationIndex);\n }, function(seenInSubArray) {\n self._operations.push(new Operation(itemType, 1));\n\n if (match) {\n returnValue = seenInSubArray;\n }\n\n self._composeAt(self._operations.length-1);\n });\n\n return returnValue;\n },\n\n /**\n Track that an item was removed from the tracked array.\n\n @method removeItem\n\n @param {number} index The index of the item in the tracked array.\n\n @return {number} The index of the item in the subarray, or `-1` if the item\n was not in the subarray.\n */\n removeItem: function(index) {\n var returnValue = -1,\n self = this;\n\n this._findOperation(index, function (operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) {\n if (operation.type === RETAIN) {\n returnValue = seenInSubArray + (index - rangeStart);\n }\n\n if (operation.count > 1) {\n --operation.count;\n } else {\n self._operations.splice(operationIndex, 1);\n self._composeAt(operationIndex);\n }\n }, function() {\n throw new Ember.Error(\"Can't remove an item that has never been added.\");\n });\n\n return returnValue;\n },\n\n\n _findOperation: function (index, foundCallback, notFoundCallback) {\n var operationIndex,\n len,\n operation,\n rangeStart,\n rangeEnd,\n seenInSubArray = 0;\n\n // OPTIMIZE: change to balanced tree\n // find leftmost operation to the right of `index`\n for (operationIndex = rangeStart = 0, len = this._operations.length; operationIndex < len; rangeStart = rangeEnd + 1, ++operationIndex) {\n operation = this._operations[operationIndex];\n rangeEnd = rangeStart + operation.count - 1;\n\n if (index >= rangeStart && index <= rangeEnd) {\n foundCallback(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray);\n return;\n } else if (operation.type === RETAIN) {\n seenInSubArray += operation.count;\n }\n }\n\n notFoundCallback(seenInSubArray);\n },\n\n _composeAt: function(index) {\n var op = this._operations[index],\n otherOp;\n\n if (!op) {\n // Composing out of bounds is a no-op, as when removing the last operation\n // in the list.\n return;\n }\n\n if (index > 0) {\n otherOp = this._operations[index-1];\n if (otherOp.type === op.type) {\n op.count += otherOp.count;\n this._operations.splice(index-1, 1);\n --index;\n }\n }\n\n if (index < this._operations.length-1) {\n otherOp = this._operations[index+1];\n if (otherOp.type === op.type) {\n op.count += otherOp.count;\n this._operations.splice(index+1, 1);\n }\n }\n },\n\n toString: function () {\n var str = \"\";\n forEach(this._operations, function (operation) {\n str += \" \" + operation.type + \":\" + operation.count;\n });\n return str.substring(1);\n }\n};\n\n})();\n//@ sourceURL=ember-runtime/system/subarray");minispade.register('ember-runtime/system/tracked_array', "(function() {var get = Ember.get,\n forEach = Ember.EnumerableUtils.forEach,\n RETAIN = 'r',\n INSERT = 'i',\n DELETE = 'd';\n\n/**\n An `Ember.TrackedArray` tracks array operations. It's useful when you want to\n lazily compute the indexes of items in an array after they've been shifted by\n subsequent operations.\n\n @class TrackedArray\n @namespace Ember\n @param {array} [items=[]] The array to be tracked. This is used just to get\n the initial items for the starting state of retain:n.\n*/\nEmber.TrackedArray = function (items) {\n if (arguments.length < 1) { items = []; }\n\n var length = get(items, 'length');\n\n if (length) {\n this._operations = [new ArrayOperation(RETAIN, length, items)];\n } else {\n this._operations = [];\n }\n};\n\nEmber.TrackedArray.RETAIN = RETAIN;\nEmber.TrackedArray.INSERT = INSERT;\nEmber.TrackedArray.DELETE = DELETE;\n\nEmber.TrackedArray.prototype = {\n\n /**\n Track that `newItems` were added to the tracked array at `index`.\n\n @method addItems\n @param index\n @param newItems\n */\n addItems: function (index, newItems) {\n var count = get(newItems, 'length');\n if (count < 1) { return; }\n\n var match = this._findArrayOperation(index),\n arrayOperation = match.operation,\n arrayOperationIndex = match.index,\n arrayOperationRangeStart = match.rangeStart,\n composeIndex,\n splitIndex,\n splitItems,\n splitArrayOperation,\n newArrayOperation;\n\n newArrayOperation = new ArrayOperation(INSERT, count, newItems);\n\n if (arrayOperation) {\n if (!match.split) {\n // insert left of arrayOperation\n this._operations.splice(arrayOperationIndex, 0, newArrayOperation);\n composeIndex = arrayOperationIndex;\n } else {\n this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation);\n composeIndex = arrayOperationIndex + 1;\n }\n } else {\n // insert at end\n this._operations.push(newArrayOperation);\n composeIndex = arrayOperationIndex;\n }\n\n this._composeInsert(composeIndex);\n },\n\n /**\n Track that `count` items were removed at `index`.\n\n @method removeItems\n @param index\n @param count\n */\n removeItems: function (index, count) {\n if (count < 1) { return; }\n\n var match = this._findArrayOperation(index),\n arrayOperation = match.operation,\n arrayOperationIndex = match.index,\n arrayOperationRangeStart = match.rangeStart,\n newArrayOperation,\n composeIndex;\n\n newArrayOperation = new ArrayOperation(DELETE, count);\n if (!match.split) {\n // insert left of arrayOperation\n this._operations.splice(arrayOperationIndex, 0, newArrayOperation);\n composeIndex = arrayOperationIndex;\n } else {\n this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation);\n composeIndex = arrayOperationIndex + 1;\n }\n\n return this._composeDelete(composeIndex);\n },\n\n /**\n Apply all operations, reducing them to retain:n, for `n`, the number of\n items in the array.\n\n `callback` will be called for each operation and will be passed the following arguments:\n * {array} items The items for the given operation\n * {number} offset The computed offset of the items, ie the index in the\n array of the first item for this operation.\n * {string} operation The type of the operation. One of\n `Ember.TrackedArray.{RETAIN, DELETE, INSERT}`\n\n @method apply\n @param {function} callback\n */\n apply: function (callback) {\n var items = [],\n offset = 0;\n\n forEach(this._operations, function (arrayOperation) {\n callback(arrayOperation.items, offset, arrayOperation.type);\n\n if (arrayOperation.type !== DELETE) {\n offset += arrayOperation.count;\n items = items.concat(arrayOperation.items);\n }\n });\n\n this._operations = [new ArrayOperation(RETAIN, items.length, items)];\n },\n\n /**\n Return an ArrayOperationMatch for the operation that contains the item at `index`.\n\n @method _findArrayOperation\n\n @param {number} index the index of the item whose operation information\n should be returned.\n @private\n */\n _findArrayOperation: function (index) {\n var arrayOperationIndex,\n len,\n split = false,\n arrayOperation,\n arrayOperationRangeStart,\n arrayOperationRangeEnd;\n\n // OPTIMIZE: we could search these faster if we kept a balanced tree.\n // find leftmost arrayOperation to the right of `index`\n for (arrayOperationIndex = arrayOperationRangeStart = 0, len = this._operations.length; arrayOperationIndex < len; ++arrayOperationIndex) {\n arrayOperation = this._operations[arrayOperationIndex];\n\n if (arrayOperation.type === DELETE) { continue; }\n\n arrayOperationRangeEnd = arrayOperationRangeStart + arrayOperation.count - 1;\n\n if (index === arrayOperationRangeStart) {\n break;\n } else if (index > arrayOperationRangeStart && index <= arrayOperationRangeEnd) {\n split = true;\n break;\n } else {\n arrayOperationRangeStart = arrayOperationRangeEnd + 1;\n }\n }\n\n return new ArrayOperationMatch(arrayOperation, arrayOperationIndex, split, arrayOperationRangeStart);\n },\n\n _split: function (arrayOperationIndex, splitIndex, newArrayOperation) {\n var arrayOperation = this._operations[arrayOperationIndex],\n splitItems = arrayOperation.items.slice(splitIndex),\n splitArrayOperation = new ArrayOperation(arrayOperation.type, splitItems.length, splitItems);\n\n // truncate LHS\n arrayOperation.count = splitIndex;\n arrayOperation.items = arrayOperation.items.slice(0, splitIndex);\n\n this._operations.splice(arrayOperationIndex + 1, 0, newArrayOperation, splitArrayOperation);\n },\n\n // see SubArray for a better implementation.\n _composeInsert: function (index) {\n var newArrayOperation = this._operations[index],\n leftArrayOperation = this._operations[index-1], // may be undefined\n rightArrayOperation = this._operations[index+1], // may be undefined\n leftOp = leftArrayOperation && leftArrayOperation.type,\n rightOp = rightArrayOperation && rightArrayOperation.type;\n\n if (leftOp === INSERT) {\n // merge left\n leftArrayOperation.count += newArrayOperation.count;\n leftArrayOperation.items = leftArrayOperation.items.concat(newArrayOperation.items);\n\n if (rightOp === INSERT) {\n // also merge right (we have split an insert with an insert)\n leftArrayOperation.count += rightArrayOperation.count;\n leftArrayOperation.items = leftArrayOperation.items.concat(rightArrayOperation.items);\n this._operations.splice(index, 2);\n } else {\n // only merge left\n this._operations.splice(index, 1);\n }\n } else if (rightOp === INSERT) {\n // merge right\n newArrayOperation.count += rightArrayOperation.count;\n newArrayOperation.items = newArrayOperation.items.concat(rightArrayOperation.items);\n this._operations.splice(index + 1, 1);\n }\n },\n\n _composeDelete: function (index) {\n var arrayOperation = this._operations[index],\n deletesToGo = arrayOperation.count,\n leftArrayOperation = this._operations[index-1], // may be undefined\n leftOp = leftArrayOperation && leftArrayOperation.type,\n nextArrayOperation,\n nextOp,\n nextCount,\n removeNewAndNextOp = false,\n removedItems = [];\n\n if (leftOp === DELETE) {\n arrayOperation = leftArrayOperation;\n index -= 1;\n }\n\n for (var i = index + 1; deletesToGo > 0; ++i) {\n nextArrayOperation = this._operations[i];\n nextOp = nextArrayOperation.type;\n nextCount = nextArrayOperation.count;\n\n if (nextOp === DELETE) {\n arrayOperation.count += nextCount;\n continue;\n }\n\n if (nextCount > deletesToGo) {\n // d:2 {r,i}:5 we reduce the retain or insert, but it stays\n removedItems = removedItems.concat(nextArrayOperation.items.splice(0, deletesToGo));\n nextArrayOperation.count -= deletesToGo;\n\n // In the case where we truncate the last arrayOperation, we don't need to\n // remove it; also the deletesToGo reduction is not the entirety of\n // nextCount\n i -= 1;\n nextCount = deletesToGo;\n\n deletesToGo = 0;\n } else {\n if (nextCount === deletesToGo) {\n // Handle edge case of d:2 i:2 in which case both operations go away\n // during composition.\n removeNewAndNextOp = true;\n }\n removedItems = removedItems.concat(nextArrayOperation.items);\n deletesToGo -= nextCount;\n }\n\n if (nextOp === INSERT) {\n // d:2 i:3 will result in delete going away\n arrayOperation.count -= nextCount;\n }\n }\n\n if (arrayOperation.count > 0) {\n // compose our new delete with possibly several operations to the right of\n // disparate types\n this._operations.splice(index+1, i-1-index);\n } else {\n // The delete operation can go away; it has merely reduced some other\n // operation, as in d:3 i:4; it may also have eliminated that operation,\n // as in d:3 i:3.\n this._operations.splice(index, removeNewAndNextOp ? 2 : 1);\n }\n\n return removedItems;\n },\n\n toString: function () {\n var str = \"\";\n forEach(this._operations, function (operation) {\n str += \" \" + operation.type + \":\" + operation.count;\n });\n return str.substring(1);\n }\n};\n\n/**\n Internal data structure to represent an array operation.\n\n @method ArrayOperation\n @private\n @property {string} type The type of the operation. One of\n `Ember.TrackedArray.{RETAIN, INSERT, DELETE}`\n @property {number} count The number of items in this operation.\n @property {array} items The items of the operation, if included. RETAIN and\n INSERT include their items, DELETE does not.\n*/\nfunction ArrayOperation (operation, count, items) {\n this.type = operation; // RETAIN | INSERT | DELETE\n this.count = count;\n this.items = items;\n}\n\n/**\n Internal data structure used to include information when looking up operations\n by item index.\n\n @method ArrayOperationMatch\n @private\n @property {ArrayOperation} operation\n @property {number} index The index of `operation` in the array of operations.\n @property {boolean} split Whether or not the item index searched for would\n require a split for a new operation type.\n @property {number} rangeStart The index of the first item in the operation,\n with respect to the tracked array. The index of the last item can be computed\n from `rangeStart` and `operation.count`.\n*/\nfunction ArrayOperationMatch(operation, index, split, rangeStart) {\n this.operation = operation;\n this.index = index;\n this.split = split;\n this.rangeStart = rangeStart;\n}\n\n})();\n//@ sourceURL=ember-runtime/system/tracked_array");minispade.register('ember-testing/adapters', "(function() {minispade.require('ember-testing/test');\n\n/**\n @module ember\n @submodule ember-testing\n*/\n\nvar Test = Ember.Test;\n\n/**\n The primary purpose of this class is to create hooks that can be implemented\n by an adapter for various test frameworks.\n\n @class Adapter\n @namespace Ember.Test\n*/\nTest.Adapter = Ember.Object.extend({\n /**\n This callback will be called whenever an async operation is about to start.\n\n Override this to call your framework's methods that handle async\n operations.\n\n @public\n @method asyncStart\n */\n asyncStart: Ember.K,\n\n /**\n This callback will be called whenever an async operation has completed.\n\n @public\n @method asyncEnd\n */\n asyncEnd: Ember.K,\n\n /**\n Override this method with your testing framework's false assertion.\n This function is called whenever an exception occurs causing the testing\n promise to fail.\n\n QUnit example:\n\n ```javascript\n exception: function(error) {\n ok(false, error);\n };\n ```\n\n @public\n @method exception\n @param {String} error The exception to be raised.\n */\n exception: function(error) {\n setTimeout(function() {\n throw error;\n });\n }\n});\n\n/**\n This class implements the methods defined by Ember.Test.Adapter for the\n QUnit testing framework.\n\n @class QUnitAdapter\n @namespace Ember.Test\n @extends Ember.Test.Adapter\n*/\nTest.QUnitAdapter = Test.Adapter.extend({\n asyncStart: function() {\n stop();\n },\n asyncEnd: function() {\n start();\n },\n exception: function(error) {\n ok(false, Ember.inspect(error));\n }\n});\n\n})();\n//@ sourceURL=ember-testing/adapters");minispade.register('ember-testing/helpers', "(function() {minispade.require('ember-testing/test');\n\n/**\n* @module ember\n* @submodule ember-testing\n*/\n\nvar get = Ember.get,\n Test = Ember.Test,\n helper = Test.registerHelper,\n asyncHelper = Test.registerAsyncHelper,\n countAsync = 0;\n\nTest.pendingAjaxRequests = 0;\n\nTest.onInjectHelpers(function() {\n Ember.$(document).ajaxStart(function() {\n Test.pendingAjaxRequests++;\n });\n\n Ember.$(document).ajaxStop(function() {\n Ember.assert(\"An ajaxStop event which would cause the number of pending AJAX requests to be negative has been triggered. This is most likely caused by AJAX events that were started before calling `injectTestHelpers()`.\", Test.pendingAjaxRequests !== 0);\n Test.pendingAjaxRequests--;\n });\n});\n\n\nfunction visit(app, url) {\n app.__container__.lookup('router:main').location.setURL(url);\n Ember.run(app, app.handleURL, url);\n return wait(app);\n}\n\nfunction click(app, selector, context) {\n var $el = findWithAssert(app, selector, context);\n Ember.run($el, 'mousedown');\n\n if ($el.is(':input')) {\n var type = $el.prop('type');\n if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {\n Ember.run($el, function(){\n // Firefox does not trigger the `focusin` event if the window\n // does not have focus. If the document doesn't have focus just\n // use trigger('focusin') instead.\n if (!document.hasFocus || document.hasFocus()) {\n this.focus();\n } else {\n this.trigger('focusin');\n }\n });\n }\n }\n\n Ember.run($el, 'mouseup');\n Ember.run($el, 'click');\n\n return wait(app);\n}\n\nfunction keyEvent(app, selector, context, type, keyCode) {\n var $el;\n if (typeof keyCode === 'undefined') {\n keyCode = type;\n type = context;\n context = null;\n }\n $el = findWithAssert(app, selector, context);\n var event = Ember.$.Event(type, { keyCode: keyCode });\n Ember.run($el, 'trigger', event);\n return wait(app);\n}\n\nfunction fillIn(app, selector, context, text) {\n var $el;\n if (typeof text === 'undefined') {\n text = context;\n context = null;\n }\n $el = findWithAssert(app, selector, context);\n Ember.run(function() {\n $el.val(text).change();\n });\n return wait(app);\n}\n\nfunction findWithAssert(app, selector, context) {\n var $el = find(app, selector, context);\n if ($el.length === 0) {\n throw new Ember.Error(\"Element \" + selector + \" not found.\");\n }\n return $el;\n}\n\nfunction find(app, selector, context) {\n var $el;\n context = context || get(app, 'rootElement');\n $el = app.$(selector, context);\n\n return $el;\n}\n\nfunction andThen(app, callback) {\n return wait(app, callback(app));\n}\n\nfunction wait(app, value) {\n return Test.promise(function(resolve) {\n // If this is the first async promise, kick off the async test\n if (++countAsync === 1) {\n Test.adapter.asyncStart();\n }\n\n // Every 10ms, poll for the async thing to have finished\n var watcher = setInterval(function() {\n // 1. If the router is loading, keep polling\n var routerIsLoading = app.__container__.lookup('router:main').router.isLoading;\n if (routerIsLoading) { return; }\n\n // 2. If there are pending Ajax requests, keep polling\n if (Test.pendingAjaxRequests) { return; }\n\n // 3. If there are scheduled timers or we are inside of a run loop, keep polling\n if (Ember.run.hasScheduledTimers() || Ember.run.currentRunLoop) { return; }\n if (Ember.FEATURES.isEnabled(\"ember-testing-wait-hooks\")) {\n if (Test.waiters && Test.waiters.any(function(waiter) {\n var context = waiter[0];\n var callback = waiter[1];\n return !callback.apply(context);\n })) { return; }\n }\n // Stop polling\n clearInterval(watcher);\n\n // If this is the last async promise, end the async test\n if (--countAsync === 0) {\n Test.adapter.asyncEnd();\n }\n\n // Synchronously resolve the promise\n Ember.run(null, resolve, value);\n }, 10);\n });\n\n}\n\n\n/**\n* Loads a route, sets up any controllers, and renders any templates associated\n* with the route as though a real user had triggered the route change while\n* using your app.\n*\n* Example:\n*\n* ```\n* visit('posts/index').then(function() {\n* // assert something\n* });\n* ```\n*\n* @method visit\n* @param {String} url the name of the route\n* @return {RSVP.Promise}\n*/\nasyncHelper('visit', visit);\n\n/**\n* Clicks an element and triggers any actions triggered by the element's `click`\n* event.\n*\n* Example:\n*\n* ```\n* click('.some-jQuery-selector').then(function() {\n* // assert something\n* });\n* ```\n*\n* @method click\n* @param {String} selector jQuery selector for finding element on the DOM\n* @return {RSVP.Promise}\n*/\nasyncHelper('click', click);\n\n/**\n* Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode\n*\n* Example:\n*\n* ```\n* keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {\n* // assert something\n* });\n* ```\n*\n* @method keyEvent\n* @param {String} selector jQuery selector for finding element on the DOM\n* @param {String} the type of key event, e.g. `keypress`, `keydown`, `keyup`\n* @param {Number} the keyCode of the simulated key event\n* @return {RSVP.Promise}\n*/\nasyncHelper('keyEvent', keyEvent);\n\n/**\n* Fills in an input element with some text.\n*\n* Example:\n*\n* ```\n* fillIn('#email', 'you@example.com').then(function() {\n* // assert something\n* });\n* ```\n*\n* @method fillIn\n* @param {String} selector jQuery selector finding an input element on the DOM\n* to fill text with\n* @param {String} text text to place inside the input element\n* @return {RSVP.Promise}\n*/\nasyncHelper('fillIn', fillIn);\n\n/**\n* Finds an element in the context of the app's container element. A simple alias\n* for `app.$(selector)`.\n*\n* Example:\n*\n* ```\n* var $el = find('.my-selector);\n* ```\n*\n* @method find\n* @param {String} selector jQuery string selector for element lookup\n* @return {Object} jQuery object representing the results of the query\n*/\nhelper('find', find);\n\n/**\n*\n* Like `find`, but throws an error if the element selector returns no results\n*\n* Example:\n*\n* ```\n* var $el = findWithAssert('.doesnt-exist'); // throws error\n* ```\n*\n* @method findWithAssert\n* @param {String} selector jQuery selector string for finding an element within\n* the DOM\n* @return {Object} jQuery object representing the results of the query\n* @throws {Error} throws error if jQuery object returned has a length of 0\n*/\nhelper('findWithAssert', findWithAssert);\n\n/**\n Causes the run loop to process any pending events. This is used to ensure that\n any async operations from other helpers (or your assertions) have been processed.\n\n This is most often used as the return value for the helper functions (see 'click',\n 'fillIn','visit',etc).\n\n Example:\n\n ```\n Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) {\n visit('secured/path/here')\n .fillIn('#username', username)\n .fillIn('#password', username)\n .click('.submit')\n\n return wait();\n });\n\n @method wait\n @param {Object} value The value to be returned.\n @return {RSVP.Promise}\n ```\n*/\nasyncHelper('wait', wait);\nasyncHelper('andThen', andThen);\n\n})();\n//@ sourceURL=ember-testing/helpers");minispade.register('ember-testing', "(function() {minispade.require('ember-application');\nminispade.require('ember-routing');\nminispade.require('ember-testing/test');\nminispade.require('ember-testing/support');\nminispade.require('ember-testing/adapters');\nminispade.require('ember-testing/helpers');\n\n/**\n Ember Testing\n\n @module ember\n @submodule ember-testing\n @requires ember-application\n*/\n\n})();\n//@ sourceURL=ember-testing");minispade.register('ember-testing/support', "(function() {/**\n @module ember\n @submodule ember-testing\n */\n\nvar $ = Ember.$;\n\n/**\n This method creates a checkbox and triggers the click event to fire the\n passed in handler. It is used to correct for a bug in older versions\n of jQuery (e.g 1.8.3).\n\n @private\n @method testCheckboxClick\n*/\nfunction testCheckboxClick(handler) {\n $('<input type=\"checkbox\">')\n .css({ position: 'absolute', left: '-1000px', top: '-1000px' })\n .appendTo('body')\n .on('click', handler)\n .trigger('click')\n .remove();\n}\n\n$(function() {\n /*\n Determine whether a checkbox checked using jQuery's \"click\" method will have\n the correct value for its checked property.\n\n If we determine that the current jQuery version exhibits this behavior,\n patch it to work correctly as in the commit for the actual fix:\n https://github.com/jquery/jquery/commit/1fb2f92.\n */\n testCheckboxClick(function() {\n if (!this.checked && !$.event.special.click) {\n $.event.special.click = {\n // For checkbox, fire native event so checked state will be right\n trigger: function() {\n if ($.nodeName( this, \"input\" ) && this.type === \"checkbox\" && this.click) {\n this.click();\n return false;\n }\n }\n };\n }\n });\n\n // Try again to verify that the patch took effect or blow up.\n testCheckboxClick(function() {\n Ember.warn(\"clicked checkboxes should be checked! the jQuery patch didn't work\", this.checked);\n });\n});\n\n})();\n//@ sourceURL=ember-testing/support");minispade.register('ember-testing/test', "(function() {/**\n @module ember\n @submodule ember-testing\n */\nvar slice = [].slice,\n helpers = {},\n originalMethods = {},\n injectHelpersCallbacks = [],\n Router = requireModule('router');\n\n/**\n This is a container for an assortment of testing related functionality:\n\n * Choose your default test adapter (for your framework of choice).\n * Register/Unregister additional test helpers.\n * Setup callbacks to be fired when the test helpers are injected into\n your application.\n\n @class Test\n @namespace Ember\n*/\nEmber.Test = {\n\n /**\n `registerHelper` is used to register a test helper that will be injected\n when `App.injectTestHelpers` is called.\n\n The helper method will always be called with the current Application as\n the first parameter.\n\n For example:\n ```javascript\n Ember.Test.registerHelper('boot', function(app) {\n Ember.run(app, app.advanceReadiness);\n });\n ```\n\n This helper can later be called without arguments because it will be\n called with `app` as the first parameter.\n\n ```javascript\n App = Ember.Application.create();\n App.injectTestHelpers();\n boot();\n ```\n\n @public\n @method registerHelper\n @param {String} name The name of the helper method to add.\n @param {Function} helperMethod\n @param options {Object}\n */\n registerHelper: function(name, helperMethod) {\n helpers[name] = {\n method: helperMethod,\n meta: { wait: false }\n };\n },\n\n /**\n `registerAsyncHelper` is used to register an async test helper that will be injected\n when `App.injectTestHelpers` is called.\n\n The helper method will always be called with the current Application as\n the first parameter.\n\n For example:\n ```javascript\n Ember.Test.registerAsyncHelper('boot', function(app) {\n Ember.run(app, app.advanceReadiness);\n });\n ```\n\n The advantage of an async helper is that it will not run\n until the last async helper has completed. All async helpers\n after it will wait for it complete before running.\n\n\n For example:\n ```javascript\n Ember.Test.registerAsyncHelper('deletePost', function(app, postId) {\n click('.delete-' + postId);\n });\n\n // ... in your test\n visit('/post/2');\n deletePost(2);\n visit('/post/3');\n deletePost(3);\n ```\n\n @public\n @method registerAsyncHelper\n @param {String} name The name of the helper method to add.\n @param {Function} helperMethod\n */\n registerAsyncHelper: function(name, helperMethod) {\n helpers[name] = {\n method: helperMethod,\n meta: { wait: true }\n };\n },\n\n /**\n Remove a previously added helper method.\n\n Example:\n ```\n Ember.Test.unregisterHelper('wait');\n ```\n\n @public\n @method unregisterHelper\n @param {String} name The helper to remove.\n */\n unregisterHelper: function(name) {\n delete helpers[name];\n if (originalMethods[name]) {\n window[name] = originalMethods[name];\n }\n delete originalMethods[name];\n delete Ember.Test.Promise.prototype[name];\n },\n\n /**\n Used to register callbacks to be fired whenever `App.injectTestHelpers`\n is called.\n\n The callback will receive the current application as an argument.\n\n Example:\n ```\n Ember.Test.onInjectHelpers(function() {\n Ember.$(document).ajaxStart(function() {\n Test.pendingAjaxRequests++;\n });\n\n Ember.$(document).ajaxStop(function() {\n Test.pendingAjaxRequests--;\n });\n });\n ```\n\n @public\n @method onInjectHelpers\n @param {Function} callback The function to be called.\n */\n onInjectHelpers: function(callback) {\n injectHelpersCallbacks.push(callback);\n },\n\n /**\n This returns a thenable tailored for testing. It catches failed\n `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception`\n callback in the last chained then.\n\n This method should be returned by async helpers such as `wait`.\n\n @public\n @method promise\n @param {Function} resolver The function used to resolve the promise.\n */\n promise: function(resolver) {\n return new Ember.Test.Promise(resolver);\n },\n\n /**\n Used to allow ember-testing to communicate with a specific testing\n framework.\n\n You can manually set it before calling `App.setupForTesting()`.\n\n Example:\n ```\n Ember.Test.adapter = MyCustomAdapter.create()\n ```\n\n If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`.\n\n @public\n @property adapter\n @type {Class} The adapter to be used.\n @default Ember.Test.QUnitAdapter\n */\n adapter: null,\n\n /**\n Replacement for `Ember.RSVP.resolve`\n The only difference is this uses\n and instance of `Ember.Test.Promise`\n\n @public\n @method resolve\n @param {Mixed} The value to resolve\n */\n resolve: function(val) {\n return Ember.Test.promise(function(resolve) {\n return resolve(val);\n });\n },\n\n /**\n @public\n\n This allows ember-testing to play nicely with other asynchronous\n events, such as an application that is waiting for a CSS3\n transition or an IndexDB transaction.\n\n For example:\n ```javascript\n Ember.Test.registerWaiter(function() {\n return myPendingTransactions() == 0;\n });\n ```\n The `context` argument allows you to optionally specify the `this`\n with which your callback will be invoked.\n\n For example:\n ```javascript\n Ember.Test.registerWaiter(MyDB, MyDB.hasPendingTransactions);\n ```\n @public\n @method registerWaiter\n @param {Object} context (optional)\n @param {Function} callback\n */\n registerWaiter: function(context, callback) {\n if (arguments.length === 1) {\n callback = context;\n context = null;\n }\n if (!this.waiters) {\n this.waiters = Ember.A();\n }\n this.waiters.push([context, callback]);\n },\n /**\n `unregisterWaiter` is used to unregister a callback that was\n registered with `registerWaiter`.\n\n @public\n @method unregisterWaiter\n @param {Object} context (optional)\n @param {Function} callback\n */\n unregisterWaiter: function(context, callback) {\n var pair;\n if (!this.waiters) { return; }\n if (arguments.length === 1) {\n callback = context;\n context = null;\n }\n pair = [context, callback];\n this.waiters = Ember.A(this.waiters.filter(function(elt) {\n return Ember.compare(elt, pair)!==0;\n }));\n }\n};\n\nfunction helper(app, name) {\n var fn = helpers[name].method,\n meta = helpers[name].meta;\n\n return function() {\n var args = slice.call(arguments),\n lastPromise = Ember.Test.lastPromise;\n\n args.unshift(app);\n\n // some helpers are not async and\n // need to return a value immediately.\n // example: `find`\n if (!meta.wait) {\n return fn.apply(app, args);\n }\n\n if (!lastPromise) {\n // It's the first async helper in current context\n lastPromise = fn.apply(app, args);\n } else {\n // wait for last helper's promise to resolve\n // and then execute\n run(function() {\n lastPromise = Ember.Test.resolve(lastPromise).then(function() {\n return fn.apply(app, args);\n });\n });\n }\n\n return lastPromise;\n };\n}\n\nfunction run(fn) {\n if (!Ember.run.currentRunLoop) {\n Ember.run(fn);\n } else {\n fn();\n }\n}\n\nEmber.Application.reopen({\n /**\n @property testHelpers\n @type {Object}\n @default {}\n */\n testHelpers: {},\n\n /**\n This hook defers the readiness of the application, so that you can start\n the app when your tests are ready to run. It also sets the router's\n location to 'none', so that the window's location will not be modified\n (preventing both accidental leaking of state between tests and interference\n with your testing framework).\n\n Example:\n ```\n App.setupForTesting();\n ```\n\n @method setupForTesting\n */\n setupForTesting: function() {\n Ember.testing = true;\n\n this.deferReadiness();\n\n this.Router.reopen({\n location: 'none'\n });\n\n // if adapter is not manually set default to QUnit\n if (!Ember.Test.adapter) {\n Ember.Test.adapter = Ember.Test.QUnitAdapter.create();\n }\n },\n\n /**\n This injects the test helpers into the window's scope. If a function of the\n same name has already been defined it will be cached (so that it can be reset\n if the helper is removed with `unregisterHelper` or `removeTestHelpers`).\n\n Any callbacks registered with `onInjectHelpers` will be called once the\n helpers have been injected.\n\n Example:\n ```\n App.injectTestHelpers();\n ```\n\n @method injectTestHelpers\n */\n injectTestHelpers: function() {\n this.testHelpers = {};\n for (var name in helpers) {\n originalMethods[name] = window[name];\n this.testHelpers[name] = window[name] = helper(this, name);\n protoWrap(Ember.Test.Promise.prototype, name, helper(this, name), helpers[name].meta.wait);\n }\n\n for(var i = 0, l = injectHelpersCallbacks.length; i < l; i++) {\n injectHelpersCallbacks[i](this);\n }\n\n Ember.RSVP.configure('onerror', onerror);\n },\n\n /**\n This removes all helpers that have been registered, and resets and functions\n that were overridden by the helpers.\n\n Example:\n ```\n App.removeTestHelpers();\n ```\n\n @public\n @method removeTestHelpers\n */\n removeTestHelpers: function() {\n for (var name in helpers) {\n window[name] = originalMethods[name];\n delete this.testHelpers[name];\n delete originalMethods[name];\n }\n Ember.RSVP.configure('onerror', null);\n }\n\n});\n\n// This method is no longer needed\n// But still here for backwards compatibility\n// of helper chaining\nfunction protoWrap(proto, name, callback, isAsync) {\n proto[name] = function() {\n var args = arguments;\n if (isAsync) {\n return callback.apply(this, args);\n } else {\n return this.then(function() {\n return callback.apply(this, args);\n });\n }\n };\n}\n\nEmber.Test.Promise = function() {\n Ember.RSVP.Promise.apply(this, arguments);\n Ember.Test.lastPromise = this;\n};\n\nEmber.Test.Promise.prototype = Ember.create(Ember.RSVP.Promise.prototype);\nEmber.Test.Promise.prototype.constructor = Ember.Test.Promise;\n\n// Patch `then` to isolate async methods\n// specifically `Ember.Test.lastPromise`\nvar originalThen = Ember.RSVP.Promise.prototype.then;\nEmber.Test.Promise.prototype.then = function(onSuccess, onFailure) {\n return originalThen.call(this, function(val) {\n return isolate(onSuccess, val);\n }, onFailure);\n};\n\n// This method isolates nested async methods\n// so that they don't conflict with other last promises.\n//\n// 1. Set `Ember.Test.lastPromise` to null\n// 2. Invoke method\n// 3. Return the last promise created during method\n// 4. Restore `Ember.Test.lastPromise` to original value\nfunction isolate(fn, val) {\n var value, lastPromise;\n\n // Reset lastPromise for nested helpers\n Ember.Test.lastPromise = null;\n\n value = fn.call(null, val);\n\n lastPromise = Ember.Test.lastPromise;\n\n // If the method returned a promise\n // return that promise. If not,\n // return the last async helper's promise\n if ((value && (value instanceof Ember.Test.Promise)) || !lastPromise) {\n return value;\n } else {\n run(function() {\n lastPromise = Ember.Test.resolve(lastPromise).then(function() {\n return value;\n });\n });\n return lastPromise;\n }\n}\n\n\nfunction onerror(error) {\n if (!(error instanceof Router.TransitionAborted)) {\n Ember.Test.adapter.exception(error);\n }\n}\n\n})();\n//@ sourceURL=ember-testing/test");minispade.register('ember-views/core', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar jQuery = this.jQuery || (Ember.imports && Ember.imports.jQuery);\nif (!jQuery && typeof require === 'function') {\n jQuery = require('jquery');\n}\n\nEmber.assert(\"Ember Views require jQuery 1.7, 1.8, 1.9, 1.10, or 2.0\", jQuery && (jQuery().jquery.match(/^((1\\.(7|8|9|10))|2.0)(\\.\\d+)?(pre|rc\\d?)?/) || Ember.ENV.FORCE_JQUERY));\n\n/**\n Alias for jQuery\n\n @method $\n @for Ember\n*/\nEmber.$ = jQuery;\n\n})();\n//@ sourceURL=ember-views/core");minispade.register('ember-views', "(function() {minispade.require(\"ember-runtime\");\nminispade.require(\"container\");\n\n/**\nEmber Views\n\n@module ember\n@submodule ember-views\n@requires ember-runtime\n@main ember-views\n*/\nminispade.require(\"ember-views/core\");\nminispade.require(\"ember-views/system\");\nminispade.require(\"ember-views/views\");\nminispade.require(\"ember-views/mixins\");\n\n})();\n//@ sourceURL=ember-views");minispade.register('ember-views/mixins', "(function() {minispade.require(\"ember-views/mixins/view_target_action_support\");\n\n})();\n//@ sourceURL=ember-views/mixins");minispade.register('ember-views/mixins/view_target_action_support', "(function() {/**\n`Ember.ViewTargetActionSupport` is a mixin that can be included in a\nview class to add a `triggerAction` method with semantics similar to\nthe Handlebars `{{action}}` helper. It provides intelligent defaults\nfor the action's target: the view's controller; and the context that is\nsent with the action: the view's context.\n\nNote: In normal Ember usage, the `{{action}}` helper is usually the best\nchoice. This mixin is most often useful when you are doing more complex\nevent handling in custom View subclasses.\n\nFor example:\n\n```javascript\nApp.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n action: 'save',\n click: function() {\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n});\n```\n\nThe `action` can be provided as properties of an optional object argument\nto `triggerAction` as well.\n\n```javascript\nApp.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n click: function() {\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n});\n```\n\n@class ViewTargetActionSupport\n@namespace Ember\n@extends Ember.TargetActionSupport\n*/\nEmber.ViewTargetActionSupport = Ember.Mixin.create(Ember.TargetActionSupport, {\n /**\n @property target\n */\n target: Ember.computed.alias('controller'),\n /**\n @property actionContext\n */\n actionContext: Ember.computed.alias('context')\n});\n\n})();\n//@ sourceURL=ember-views/mixins/view_target_action_support");minispade.register('ember-views/system', "(function() {minispade.require(\"ember-views/system/jquery_ext\");\nminispade.require(\"ember-views/system/utils\");\nminispade.require(\"ember-views/system/render_buffer\");\nminispade.require(\"ember-views/system/event_dispatcher\");\nminispade.require(\"ember-views/system/ext\");\nminispade.require(\"ember-views/system/controller\");\n\n})();\n//@ sourceURL=ember-views/system");minispade.register('ember-views/system/controller', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n// Original class declaration and documentation in runtime/lib/controllers/controller.js\n// NOTE: It may be possible with YUIDoc to combine docs in two locations\n\n/**\nAdditional methods for the ControllerMixin\n\n@class ControllerMixin\n@namespace Ember\n*/\nEmber.ControllerMixin.reopen({\n target: null,\n namespace: null,\n view: null,\n container: null,\n _childContainers: null,\n\n init: function() {\n this._super();\n set(this, '_childContainers', {});\n },\n\n _modelDidChange: Ember.observer('model', function() {\n var containers = get(this, '_childContainers');\n\n for (var prop in containers) {\n if (!containers.hasOwnProperty(prop)) { continue; }\n containers[prop].destroy();\n }\n\n set(this, '_childContainers', {});\n })\n});\n\n})();\n//@ sourceURL=ember-views/system/controller");minispade.register('ember-views/system/event_dispatcher', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.EventDispatcher` handles delegating browser events to their\n corresponding `Ember.Views.` For example, when you click on a view,\n `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets\n called.\n\n @class EventDispatcher\n @namespace Ember\n @private\n @extends Ember.Object\n*/\nEmber.EventDispatcher = Ember.Object.extend(/** @scope Ember.EventDispatcher.prototype */{\n\n /**\n The set of events names (and associated handler function names) to be setup\n and dispatched by the `EventDispatcher`. Custom events can added to this list at setup\n time, generally via the `Ember.Application.customEvents` hash. Only override this\n default set to prevent the EventDispatcher from listening on some events all together.\n\n This set will be modified by `setup` to also include any events added at that time.\n\n @property events\n @type Object\n */\n events: {\n touchstart : 'touchStart',\n touchmove : 'touchMove',\n touchend : 'touchEnd',\n touchcancel : 'touchCancel',\n keydown : 'keyDown',\n keyup : 'keyUp',\n keypress : 'keyPress',\n mousedown : 'mouseDown',\n mouseup : 'mouseUp',\n contextmenu : 'contextMenu',\n click : 'click',\n dblclick : 'doubleClick',\n mousemove : 'mouseMove',\n focusin : 'focusIn',\n focusout : 'focusOut',\n mouseenter : 'mouseEnter',\n mouseleave : 'mouseLeave',\n submit : 'submit',\n input : 'input',\n change : 'change',\n dragstart : 'dragStart',\n drag : 'drag',\n dragenter : 'dragEnter',\n dragleave : 'dragLeave',\n dragover : 'dragOver',\n drop : 'drop',\n dragend : 'dragEnd'\n },\n\n /**\n @private\n\n The root DOM element to which event listeners should be attached. Event\n listeners will be attached to the document unless this is overridden.\n\n Can be specified as a DOMElement or a selector string.\n\n The default body is a string since this may be evaluated before document.body\n exists in the DOM.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n @private\n\n Sets up event listeners for standard browser events.\n\n This will be called after the browser sends a `DOMContentReady` event. By\n default, it will set up all of the listeners on the document body. If you\n would like to register the listeners on a different element, set the event\n dispatcher's `root` property.\n\n @method setup\n @param addedEvents {Hash}\n */\n setup: function(addedEvents, rootElement) {\n var event, events = get(this, 'events');\n\n Ember.$.extend(events, addedEvents || {});\n\n\n if (!Ember.isNone(rootElement)) {\n set(this, 'rootElement', rootElement);\n }\n\n rootElement = Ember.$(get(this, 'rootElement'));\n\n Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));\n Ember.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length);\n Ember.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length);\n\n rootElement.addClass('ember-application');\n\n Ember.assert('Unable to add \"ember-application\" class to rootElement. Make sure you set rootElement to the body or an element in the body.', rootElement.is('.ember-application'));\n\n for (event in events) {\n if (events.hasOwnProperty(event)) {\n this.setupHandler(rootElement, event, events[event]);\n }\n }\n },\n\n /**\n @private\n\n Registers an event listener on the document. If the given event is\n triggered, the provided event handler will be triggered on the target view.\n\n If the target view does not implement the event handler, or if the handler\n returns `false`, the parent view will be called. The event will continue to\n bubble to each successive parent view until it reaches the top.\n\n For example, to have the `mouseDown` method called on the target view when\n a `mousedown` event is received from the browser, do the following:\n\n ```javascript\n setupHandler('mousedown', 'mouseDown');\n ```\n\n @method setupHandler\n @param {Element} rootElement\n @param {String} event the browser-originated event to listen to\n @param {String} eventName the name of the method to call on the view\n */\n setupHandler: function(rootElement, event, eventName) {\n var self = this;\n\n rootElement.on(event + '.ember', '.ember-view', function(evt, triggeringManager) {\n return Ember.handleErrors(function() {\n var view = Ember.View.views[this.id],\n result = true, manager = null;\n\n manager = self._findNearestEventManager(view,eventName);\n\n if (manager && manager !== triggeringManager) {\n result = self._dispatchEvent(manager, evt, eventName, view);\n } else if (view) {\n result = self._bubbleEvent(view,evt,eventName);\n } else {\n evt.stopPropagation();\n }\n\n return result;\n }, this);\n });\n\n rootElement.on(event + '.ember', '[data-ember-action]', function(evt) {\n return Ember.handleErrors(function() {\n var actionId = Ember.$(evt.currentTarget).attr('data-ember-action'),\n action = Ember.Handlebars.ActionHelper.registeredActions[actionId];\n\n // We have to check for action here since in some cases, jQuery will trigger\n // an event on `removeChild` (i.e. focusout) after we've already torn down the\n // action handlers for the view.\n if (action && action.eventName === eventName) {\n return action.handler(evt);\n }\n }, this);\n });\n },\n\n _findNearestEventManager: function(view, eventName) {\n var manager = null;\n\n while (view) {\n manager = get(view, 'eventManager');\n if (manager && manager[eventName]) { break; }\n\n view = get(view, 'parentView');\n }\n\n return manager;\n },\n\n _dispatchEvent: function(object, evt, eventName, view) {\n var result = true;\n\n var handler = object[eventName];\n if (Ember.typeOf(handler) === 'function') {\n result = Ember.run(function() {\n return handler.call(object, evt, view);\n });\n // Do not preventDefault in eventManagers.\n evt.stopPropagation();\n }\n else {\n result = this._bubbleEvent(view, evt, eventName);\n }\n\n return result;\n },\n\n _bubbleEvent: function(view, evt, eventName) {\n return Ember.run(function() {\n return view.handleEvent(eventName, evt);\n });\n },\n\n destroy: function() {\n var rootElement = get(this, 'rootElement');\n Ember.$(rootElement).off('.ember', '**').removeClass('ember-application');\n return this._super();\n }\n});\n\n})();\n//@ sourceURL=ember-views/system/event_dispatcher");minispade.register('ember-views/system/ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n// Add a new named queue for rendering views that happens\n// after bindings have synced, and a queue for scheduling actions\n// that that should occur after view rendering.\nvar queues = Ember.run.queues,\n indexOf = Ember.ArrayPolyfills.indexOf;\nqueues.splice(indexOf.call(queues, 'actions')+1, 0, 'render', 'afterRender');\n\n})();\n//@ sourceURL=ember-views/system/ext");minispade.register('ember-views/system/jquery_ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\nif (Ember.$) {\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents\n var dragEvents = Ember.String.w('dragstart drag dragenter dragleave dragover drop dragend');\n\n // Copies the `dataTransfer` property from a browser event object onto the\n // jQuery event object for the specified events\n Ember.EnumerableUtils.forEach(dragEvents, function(eventName) {\n Ember.$.event.fixHooks[eventName] = { props: ['dataTransfer'] };\n });\n}\n\n})();\n//@ sourceURL=ember-views/system/jquery_ext");minispade.register('ember-views/system/render_buffer', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar ClassSet = function() {\n this.seen = {};\n this.list = [];\n};\n\nClassSet.prototype = {\n add: function(string) {\n if (string in this.seen) { return; }\n this.seen[string] = true;\n\n this.list.push(string);\n },\n\n toDOM: function() {\n return this.list.join(\" \");\n }\n};\n\nvar BAD_TAG_NAME_TEST_REGEXP = /[^a-zA-Z0-9\\-]/;\nvar BAD_TAG_NAME_REPLACE_REGEXP = /[^a-zA-Z0-9\\-]/g;\n\nfunction stripTagName(tagName) {\n if (!tagName) {\n return tagName;\n }\n\n if (!BAD_TAG_NAME_TEST_REGEXP.test(tagName)) {\n return tagName;\n }\n\n return tagName.replace(BAD_TAG_NAME_REPLACE_REGEXP, '');\n}\n\nvar BAD_CHARS_REGEXP = /&(?!\\w+;)|[<>\"'`]/g;\nvar POSSIBLE_CHARS_REGEXP = /[&<>\"'`]/;\n\nfunction escapeAttribute(value) {\n // Stolen shamelessly from Handlebars\n\n var escape = {\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n \"`\": \"`\"\n };\n\n var escapeChar = function(chr) {\n return escape[chr] || \"&\";\n };\n\n var string = value.toString();\n\n if(!POSSIBLE_CHARS_REGEXP.test(string)) { return string; }\n return string.replace(BAD_CHARS_REGEXP, escapeChar);\n}\n\n// IE 6/7 have bugs arond setting names on inputs during creation.\n// From http://msdn.microsoft.com/en-us/library/ie/ms536389(v=vs.85).aspx:\n// \"To include the NAME attribute at run time on objects created with the createElement method, use the eTag.\"\nvar canSetNameOnInputs = (function() {\n var div = document.createElement('div'),\n el = document.createElement('input');\n\n el.setAttribute('name', 'foo');\n div.appendChild(el);\n\n return !!div.innerHTML.match('foo');\n})();\n\n/**\n `Ember.RenderBuffer` gathers information regarding the a view and generates the\n final representation. `Ember.RenderBuffer` will generate HTML which can be pushed\n to the DOM.\n\n ```javascript\n var buffer = Ember.RenderBuffer('div');\n ```\n\n @class RenderBuffer\n @namespace Ember\n @constructor\n @param {String} tagName tag name (such as 'div' or 'p') used for the buffer\n*/\nEmber.RenderBuffer = function(tagName) {\n return new Ember._RenderBuffer(tagName);\n};\n\nEmber._RenderBuffer = function(tagName) {\n this.tagNames = [tagName || null];\n this.buffer = \"\";\n};\n\nEmber._RenderBuffer.prototype =\n/** @scope Ember.RenderBuffer.prototype */ {\n\n // The root view's element\n _element: null,\n\n _hasElement: true,\n\n /**\n @private\n\n An internal set used to de-dupe class names when `addClass()` is\n used. After each call to `addClass()`, the `classes` property\n will be updated.\n\n @property elementClasses\n @type Array\n @default []\n */\n elementClasses: null,\n\n /**\n Array of class names which will be applied in the class attribute.\n\n You can use `setClasses()` to set this property directly. If you\n use `addClass()`, it will be maintained for you.\n\n @property classes\n @type Array\n @default []\n */\n classes: null,\n\n /**\n The id in of the element, to be applied in the id attribute.\n\n You should not set this property yourself, rather, you should use\n the `id()` method of `Ember.RenderBuffer`.\n\n @property elementId\n @type String\n @default null\n */\n elementId: null,\n\n /**\n A hash keyed on the name of the attribute and whose value will be\n applied to that attribute. For example, if you wanted to apply a\n `data-view=\"Foo.bar\"` property to an element, you would set the\n elementAttributes hash to `{'data-view':'Foo.bar'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `attr()` method of `Ember.RenderBuffer`.\n\n @property elementAttributes\n @type Hash\n @default {}\n */\n elementAttributes: null,\n\n /**\n A hash keyed on the name of the properties and whose value will be\n applied to that property. For example, if you wanted to apply a\n `checked=true` property to an element, you would set the\n elementProperties hash to `{'checked':true}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `prop()` method of `Ember.RenderBuffer`.\n\n @property elementProperties\n @type Hash\n @default {}\n */\n elementProperties: null,\n\n /**\n The tagname of the element an instance of `Ember.RenderBuffer` represents.\n\n Usually, this gets set as the first parameter to `Ember.RenderBuffer`. For\n example, if you wanted to create a `p` tag, then you would call\n\n ```javascript\n Ember.RenderBuffer('p')\n ```\n\n @property elementTag\n @type String\n @default null\n */\n elementTag: null,\n\n /**\n A hash keyed on the name of the style attribute and whose value will\n be applied to that attribute. For example, if you wanted to apply a\n `background-color:black;` style to an element, you would set the\n elementStyle hash to `{'background-color':'black'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `style()` method of `Ember.RenderBuffer`.\n\n @property elementStyle\n @type Hash\n @default {}\n */\n elementStyle: null,\n\n /**\n Nested `RenderBuffers` will set this to their parent `RenderBuffer`\n instance.\n\n @property parentBuffer\n @type Ember._RenderBuffer\n */\n parentBuffer: null,\n\n /**\n Adds a string of HTML to the `RenderBuffer`.\n\n @method push\n @param {String} string HTML to push into the buffer\n @chainable\n */\n push: function(string) {\n this.buffer += string;\n return this;\n },\n\n /**\n Adds a class to the buffer, which will be rendered to the class attribute.\n\n @method addClass\n @param {String} className Class name to add to the buffer\n @chainable\n */\n addClass: function(className) {\n // lazily create elementClasses\n this.elementClasses = (this.elementClasses || new ClassSet());\n this.elementClasses.add(className);\n this.classes = this.elementClasses.list;\n\n return this;\n },\n\n setClasses: function(classNames) {\n this.classes = classNames;\n },\n\n /**\n Sets the elementID to be used for the element.\n\n @method id\n @param {String} id\n @chainable\n */\n id: function(id) {\n this.elementId = id;\n return this;\n },\n\n // duck type attribute functionality like jQuery so a render buffer\n // can be used like a jQuery object in attribute binding scenarios.\n\n /**\n Adds an attribute which will be rendered to the element.\n\n @method attr\n @param {String} name The name of the attribute\n @param {String} value The value to add to the attribute\n @chainable\n @return {Ember.RenderBuffer|String} this or the current attribute value\n */\n attr: function(name, value) {\n var attributes = this.elementAttributes = (this.elementAttributes || {});\n\n if (arguments.length === 1) {\n return attributes[name];\n } else {\n attributes[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an attribute from the list of attributes to render.\n\n @method removeAttr\n @param {String} name The name of the attribute\n @chainable\n */\n removeAttr: function(name) {\n var attributes = this.elementAttributes;\n if (attributes) { delete attributes[name]; }\n\n return this;\n },\n\n /**\n Adds an property which will be rendered to the element.\n\n @method prop\n @param {String} name The name of the property\n @param {String} value The value to add to the property\n @chainable\n @return {Ember.RenderBuffer|String} this or the current property value\n */\n prop: function(name, value) {\n var properties = this.elementProperties = (this.elementProperties || {});\n\n if (arguments.length === 1) {\n return properties[name];\n } else {\n properties[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an property from the list of properties to render.\n\n @method removeProp\n @param {String} name The name of the property\n @chainable\n */\n removeProp: function(name) {\n var properties = this.elementProperties;\n if (properties) { delete properties[name]; }\n\n return this;\n },\n\n /**\n Adds a style to the style attribute which will be rendered to the element.\n\n @method style\n @param {String} name Name of the style\n @param {String} value\n @chainable\n */\n style: function(name, value) {\n this.elementStyle = (this.elementStyle || {});\n\n this.elementStyle[name] = value;\n return this;\n },\n\n begin: function(tagName) {\n this.tagNames.push(tagName || null);\n return this;\n },\n\n pushOpeningTag: function() {\n var tagName = this.currentTagName();\n if (!tagName) { return; }\n\n if (this._hasElement && !this._element && this.buffer.length === 0) {\n this._element = this.generateElement();\n return;\n }\n\n var buffer = this.buffer,\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n attr, prop;\n\n buffer += '<' + stripTagName(tagName);\n\n if (id) {\n buffer += ' id=\"' + escapeAttribute(id) + '\"';\n this.elementId = null;\n }\n if (classes) {\n buffer += ' class=\"' + escapeAttribute(classes.join(' ')) + '\"';\n this.classes = null;\n }\n\n if (style) {\n buffer += ' style=\"';\n\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n buffer += prop + ':' + escapeAttribute(style[prop]) + ';';\n }\n }\n\n buffer += '\"';\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n buffer += ' ' + attr + '=\"' + escapeAttribute(attrs[attr]) + '\"';\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n var value = props[prop];\n if (value || typeof(value) === 'number') {\n if (value === true) {\n buffer += ' ' + prop + '=\"' + prop + '\"';\n } else {\n buffer += ' ' + prop + '=\"' + escapeAttribute(props[prop]) + '\"';\n }\n }\n }\n }\n\n this.elementProperties = null;\n }\n\n buffer += '>';\n this.buffer = buffer;\n },\n\n pushClosingTag: function() {\n var tagName = this.tagNames.pop();\n if (tagName) { this.buffer += '</' + stripTagName(tagName) + '>'; }\n },\n\n currentTagName: function() {\n return this.tagNames[this.tagNames.length-1];\n },\n\n generateElement: function() {\n var tagName = this.tagNames.pop(), // pop since we don't need to close\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n styleBuffer = '', attr, prop, tagString;\n\n if (attrs && attrs.name && !canSetNameOnInputs) {\n // IE allows passing a tag to createElement. See note on `canSetNameOnInputs` above as well.\n tagString = '<'+stripTagName(tagName)+' name=\"'+escapeAttribute(attrs.name)+'\">';\n } else {\n tagString = tagName;\n }\n\n var element = document.createElement(tagString),\n $element = Ember.$(element);\n\n if (id) {\n $element.attr('id', id);\n this.elementId = null;\n }\n if (classes) {\n $element.attr('class', classes.join(' '));\n this.classes = null;\n }\n\n if (style) {\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n styleBuffer += (prop + ':' + style[prop] + ';');\n }\n }\n\n $element.attr('style', styleBuffer);\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n $element.attr(attr, attrs[attr]);\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n $element.prop(prop, props[prop]);\n }\n }\n\n this.elementProperties = null;\n }\n\n return element;\n },\n\n /**\n @method element\n @return {DOMElement} The element corresponding to the generated HTML\n of this buffer\n */\n element: function() {\n var html = this.innerString();\n\n if (html) {\n this._element = Ember.ViewUtils.setInnerHTML(this._element, html);\n }\n\n return this._element;\n },\n\n /**\n Generates the HTML content for this buffer.\n\n @method string\n @return {String} The generated HTML\n */\n string: function() {\n if (this._hasElement && this._element) {\n // Firefox versions < 11 do not have support for element.outerHTML.\n var thisElement = this.element(), outerHTML = thisElement.outerHTML;\n if (typeof outerHTML === 'undefined') {\n return Ember.$('<div/>').append(thisElement).html();\n }\n return outerHTML;\n } else {\n return this.innerString();\n }\n },\n\n innerString: function() {\n return this.buffer;\n }\n};\n\n})();\n//@ sourceURL=ember-views/system/render_buffer");minispade.register('ember-views/system/utils', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n/* BEGIN METAMORPH HELPERS */\n\n// Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n// is a \"zero-scope\" element. This problem can be worked around by making\n// the first node an invisible text node. We, like Modernizr, use ­\n\nvar needsShy = this.document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n})();\n\n// IE 8 (and likely earlier) likes to move whitespace preceeding\n// a script tag to appear after it. This means that we can\n// accidentally remove whitespace when updating a morph.\nvar movesWhitespace = this.document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n})();\n\n// Use this to find children by ID instead of using jQuery\nvar findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n};\n\nvar setInnerHTMLWithoutFix = function(element, html) {\n if (needsShy) {\n html = '­' + html;\n }\n\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n\n if (needsShy) {\n var shyElement = element.firstChild;\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n};\n\n/* END METAMORPH HELPERS */\n\n\nvar innerHTMLTags = {};\nvar canSetInnerHTML = function(tagName) {\n if (innerHTMLTags[tagName] !== undefined) {\n return innerHTMLTags[tagName];\n }\n\n var canSet = true;\n\n // IE 8 and earlier don't allow us to do innerHTML on select\n if (tagName.toLowerCase() === 'select') {\n var el = document.createElement('select');\n setInnerHTMLWithoutFix(el, '<option value=\"test\">Test</option>');\n canSet = el.options.length === 1;\n }\n\n innerHTMLTags[tagName] = canSet;\n\n return canSet;\n};\n\nvar setInnerHTML = function(element, html) {\n var tagName = element.tagName;\n\n if (canSetInnerHTML(tagName)) {\n setInnerHTMLWithoutFix(element, html);\n } else {\n // Firefox versions < 11 do not have support for element.outerHTML.\n var outerHTML = element.outerHTML || new XMLSerializer().serializeToString(element);\n Ember.assert(\"Can't set innerHTML on \"+element.tagName+\" in this browser\", outerHTML);\n\n var startTag = outerHTML.match(new RegExp(\"<\"+tagName+\"([^>]*)>\", 'i'))[0],\n endTag = '</'+tagName+'>';\n\n var wrapper = document.createElement('div');\n setInnerHTMLWithoutFix(wrapper, startTag + html + endTag);\n element = wrapper.firstChild;\n while (element.tagName !== tagName) {\n element = element.nextSibling;\n }\n }\n\n return element;\n};\n\nfunction isSimpleClick(event) {\n var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,\n secondaryClick = event.which > 1; // IE9 may return undefined\n\n return !modifier && !secondaryClick;\n}\n\nEmber.ViewUtils = {\n setInnerHTML: setInnerHTML,\n isSimpleClick: isSimpleClick\n};\n\n})();\n//@ sourceURL=ember-views/system/utils");minispade.register('ember-views/views', "(function() {minispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-views/views/states\");\nminispade.require(\"ember-views/views/container_view\");\nminispade.require(\"ember-views/views/collection_view\");\nminispade.require(\"ember-views/views/component\");\n\n})();\n//@ sourceURL=ember-views/views");minispade.register('ember-views/views/collection_view', "(function() {minispade.require('ember-views/views/container_view');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.CollectionView` is an `Ember.View` descendent responsible for managing\n a collection (an array or array-like object) by maintaining a child view object\n and associated DOM representation for each item in the array and ensuring\n that child views and their associated rendered HTML are updated when items in\n the array are added, removed, or replaced.\n\n ## Setting content\n\n The managed collection of objects is referenced as the `Ember.CollectionView`\n instance's `content` property.\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n content: ['A', 'B','C']\n })\n ```\n\n The view for each item in the collection will have its `content` property set\n to the item.\n\n ## Specifying itemViewClass\n\n By default the view class for each item in the managed collection will be an\n instance of `Ember.View`. You can supply a different class by setting the\n `CollectionView`'s `itemViewClass` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n classNames: ['a-collection'],\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n someItemsView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view a-collection\">\n <div class=\"ember-view\">the letter: A</div>\n <div class=\"ember-view\">the letter: B</div>\n <div class=\"ember-view\">the letter: C</div>\n </div>\n ```\n\n ## Automatic matching of parent/child tagNames\n\n Setting the `tagName` property of a `CollectionView` to any of\n \"ul\", \"ol\", \"table\", \"thead\", \"tbody\", \"tfoot\", \"tr\", or \"select\" will result\n in the item views receiving an appropriately matched `tagName` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n anUndorderedListView = Ember.CollectionView.create({\n tagName: 'ul',\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n anUndorderedListView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <ul class=\"ember-view a-collection\">\n <li class=\"ember-view\">the letter: A</li>\n <li class=\"ember-view\">the letter: B</li>\n <li class=\"ember-view\">the letter: C</li>\n </ul>\n ```\n\n Additional `tagName` pairs can be provided by adding to\n `Ember.CollectionView.CONTAINER_MAP `\n\n ```javascript\n Ember.CollectionView.CONTAINER_MAP['article'] = 'section'\n ```\n\n ## Programatic creation of child views\n\n For cases where additional customization beyond the use of a single\n `itemViewClass` or `tagName` matching is required CollectionView's\n `createChildView` method can be overidden:\n\n ```javascript\n CustomCollectionView = Ember.CollectionView.extend({\n createChildView: function(viewClass, attrs) {\n if (attrs.content.kind == 'album') {\n viewClass = App.AlbumView;\n } else {\n viewClass = App.SongView;\n }\n return this._super(viewClass, attrs);\n }\n });\n ```\n\n ## Empty View\n\n You can provide an `Ember.View` subclass to the `Ember.CollectionView`\n instance as its `emptyView` property. If the `content` property of a\n `CollectionView` is set to `null` or an empty array, an instance of this view\n will be the `CollectionView`s only child.\n\n ```javascript\n aListWithNothing = Ember.CollectionView.create({\n classNames: ['nothing']\n content: null,\n emptyView: Ember.View.extend({\n template: Ember.Handlebars.compile(\"The collection is empty\")\n })\n });\n\n aListWithNothing.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view nothing\">\n <div class=\"ember-view\">\n The collection is empty\n </div>\n </div>\n ```\n\n ## Adding and Removing items\n\n The `childViews` property of a `CollectionView` should not be directly\n manipulated. Instead, add, remove, replace items from its `content` property.\n This will trigger appropriate changes to its rendered HTML.\n\n\n @class CollectionView\n @namespace Ember\n @extends Ember.ContainerView\n @since Ember 0.9\n*/\nEmber.CollectionView = Ember.ContainerView.extend(/** @scope Ember.CollectionView.prototype */ {\n\n /**\n A list of items to be displayed by the `Ember.CollectionView`.\n\n @property content\n @type Ember.Array\n @default null\n */\n content: null,\n\n /**\n @private\n\n This provides metadata about what kind of empty view class this\n collection would like if it is being instantiated from another\n system (like Handlebars)\n\n @property emptyViewClass\n */\n emptyViewClass: Ember.View,\n\n /**\n An optional view to display if content is set to an empty array.\n\n @property emptyView\n @type Ember.View\n @default null\n */\n emptyView: null,\n\n /**\n @property itemViewClass\n @type Ember.View\n @default Ember.View\n */\n itemViewClass: Ember.View,\n\n /**\n Setup a CollectionView\n\n @method init\n */\n init: function() {\n var ret = this._super();\n this._contentDidChange();\n return ret;\n },\n\n /**\n @private\n\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @method _contentWillChange\n */\n _contentWillChange: Ember.beforeObserver('content', function() {\n var content = this.get('content');\n\n if (content) { content.removeArrayObserver(this); }\n var len = content ? get(content, 'length') : 0;\n this.arrayWillChange(content, 0, len);\n }),\n\n /**\n @private\n\n Check to make sure that the content has changed, and if so,\n update the children directly. This is always scheduled\n asynchronously, to allow the element to be created before\n bindings have synchronized and vice versa.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer('content', function() {\n var content = get(this, 'content');\n\n if (content) {\n this._assertArrayLike(content);\n content.addArrayObserver(this);\n }\n\n var len = content ? get(content, 'length') : 0;\n this.arrayDidChange(content, 0, null, len);\n }),\n\n /**\n @private\n\n Ensure that the content implements Ember.Array\n\n @method _assertArrayLike\n */\n _assertArrayLike: function(content) {\n Ember.assert(fmt(\"an Ember.CollectionView's content must implement Ember.Array. You passed %@\", [content]), Ember.Array.detect(content));\n },\n\n /**\n Removes the content and content observers.\n\n @method destroy\n */\n destroy: function() {\n if (!this._super()) { return; }\n\n var content = get(this, 'content');\n if (content) { content.removeArrayObserver(this); }\n\n if (this._createdEmptyView) {\n this._createdEmptyView.destroy();\n }\n\n return this;\n },\n\n /**\n Called when a mutation to the underlying content array will occur.\n\n This method will remove any views that are no longer in the underlying\n content array.\n\n Invokes whenever the content array itself will change.\n\n @method arrayWillChange\n @param {Array} content the managed collection of objects\n @param {Number} start the index at which the changes will occurr\n @param {Number} removed number of object to be removed from content\n */\n arrayWillChange: function(content, start, removedCount) {\n // If the contents were empty before and this template collection has an\n // empty view remove it now.\n var emptyView = get(this, 'emptyView');\n if (emptyView && emptyView instanceof Ember.View) {\n emptyView.removeFromParent();\n }\n\n // Loop through child views that correspond with the removed items.\n // Note that we loop from the end of the array to the beginning because\n // we are mutating it as we go.\n var childViews = this._childViews, childView, idx, len;\n\n len = this._childViews.length;\n\n var removingAll = removedCount === len;\n\n if (removingAll) {\n this.currentState.empty(this);\n this.invokeRecursively(function(view) {\n view.removedFromDOM = true;\n }, false);\n }\n\n for (idx = start + removedCount - 1; idx >= start; idx--) {\n childView = childViews[idx];\n childView.destroy();\n }\n },\n\n /**\n Called when a mutation to the underlying content array occurs.\n\n This method will replay that mutation against the views that compose the\n `Ember.CollectionView`, ensuring that the view reflects the model.\n\n This array observer is added in `contentDidChange`.\n\n @method arrayDidChange\n @param {Array} content the managed collection of objects\n @param {Number} start the index at which the changes occurred\n @param {Number} removed number of object removed from content\n @param {Number} added number of object added to content\n */\n arrayDidChange: function(content, start, removed, added) {\n var addedViews = [], view, item, idx, len, itemViewClass,\n emptyView;\n\n len = content ? get(content, 'length') : 0;\n\n if (len) {\n itemViewClass = get(this, 'itemViewClass');\n\n if ('string' === typeof itemViewClass) {\n itemViewClass = get(itemViewClass) || itemViewClass;\n }\n\n Ember.assert(fmt(\"itemViewClass must be a subclass of Ember.View, not %@\", [itemViewClass]), 'string' === typeof itemViewClass || Ember.View.detect(itemViewClass));\n\n for (idx = start; idx < start+added; idx++) {\n item = content.objectAt(idx);\n\n view = this.createChildView(itemViewClass, {\n content: item,\n contentIndex: idx\n });\n\n addedViews.push(view);\n }\n } else {\n emptyView = get(this, 'emptyView');\n\n if (!emptyView) { return; }\n\n if ('string' === typeof emptyView) {\n emptyView = get(emptyView) || emptyView;\n }\n\n emptyView = this.createChildView(emptyView);\n addedViews.push(emptyView);\n set(this, 'emptyView', emptyView);\n\n if (Ember.CoreView.detect(emptyView)) {\n this._createdEmptyView = emptyView;\n }\n }\n\n this.replace(start, 0, addedViews);\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n The tag name for the view will be set to the tagName of the viewClass\n passed in.\n\n @method createChildView\n @param {Class} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n var itemTagName = get(view, 'tagName');\n\n if (itemTagName === null || itemTagName === undefined) {\n itemTagName = Ember.CollectionView.CONTAINER_MAP[get(this, 'tagName')];\n set(view, 'tagName', itemTagName);\n }\n\n return view;\n }\n});\n\n/**\n A map of parent tags to their default child tags. You can add\n additional parent tags if you want collection views that use\n a particular parent tag to default to a child tag.\n\n @property CONTAINER_MAP\n @type Hash\n @static\n @final\n*/\nEmber.CollectionView.CONTAINER_MAP = {\n ul: 'li',\n ol: 'li',\n table: 'tr',\n thead: 'tr',\n tbody: 'tr',\n tfoot: 'tr',\n tr: 'td',\n select: 'option'\n};\n\n})();\n//@ sourceURL=ember-views/views/collection_view");minispade.register('ember-views/views/component', "(function() {minispade.require(\"ember-views/views/view\");\n\nvar get = Ember.get, set = Ember.set, isNone = Ember.isNone,\n a_slice = Array.prototype.slice;\n\n\n/**\n@module ember\n@submodule ember-views\n*/\n\n/**\n An `Ember.Component` is a view that is completely\n isolated. Property access in its templates go\n to the view object and actions are targeted at\n the view object. There is no access to the\n surrounding context or outer controller; all\n contextual information is passed in.\n\n The easiest way to create an `Ember.Component` is via\n a template. If you name a template\n `components/my-foo`, you will be able to use\n `{{my-foo}}` in other templates, which will make\n an instance of the isolated component.\n\n ```html\n {{app-profile person=currentUser}}\n ```\n\n ```html\n <!-- app-profile template -->\n <h1>{{person.title}}</h1>\n <img {{bind-attr src=person.avatar}}>\n <p class='signature'>{{person.signature}}</p>\n ```\n\n You can also use `yield` inside a template to\n include the **contents** of the custom tag:\n\n ```html\n {{#app-profile person=currentUser}}\n <p>Admin mode</p>\n {{/app-profile}}\n ```\n\n ```html\n <!-- app-profile template -->\n <h1>{{person.title}}</h1>\n {{yield}} <!-- block contents -->\n ```\n\n If you want to customize the component, in order to\n handle events or actions, you implement a subclass\n of `Ember.Component` named after the name of the\n component. Note that `Component` needs to be appended to the name of\n your subclass like `AppProfileComponent`.\n\n For example, you could implement the action\n `hello` for the `app-profile` component:\n\n ```javascript\n App.AppProfileComponent = Ember.Component.extend({\n actions: {\n hello: function(name) {\n console.log(\"Hello\", name);\n }\n }\n });\n ```\n\n And then use it in the component's template:\n\n ```html\n <!-- app-profile template -->\n\n <h1>{{person.title}}</h1>\n {{yield}} <!-- block contents -->\n\n <button {{action 'hello' person.name}}>\n Say Hello to {{person.name}}\n </button>\n ```\n\n Components must have a `-` in their name to avoid\n conflicts with built-in controls that wrap HTML\n elements. This is consistent with the same\n requirement in web components.\n\n @class Component\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Component = Ember.View.extend(Ember.TargetActionSupport, {\n init: function() {\n this._super();\n set(this, 'context', this);\n set(this, 'controller', this);\n },\n\n // during render, isolate keywords\n cloneKeywords: function() {\n return {\n view: this,\n controller: this\n };\n },\n\n _yield: function(context, options) {\n var view = options.data.view,\n parentView = this._parentView,\n template = get(this, 'template');\n\n if (template) {\n Ember.assert(\"A Component must have a parent view in order to yield.\", parentView);\n\n view.appendChild(Ember.View, {\n isVirtual: true,\n tagName: '',\n _contextView: parentView,\n template: template,\n context: get(parentView, 'context'),\n controller: get(parentView, 'controller'),\n templateData: { keywords: parentView.cloneKeywords() }\n });\n }\n },\n\n /**\n If the component is currently inserted into the DOM of a parent view, this\n property will point to the controller of the parent view.\n\n @property targetObject\n @type Ember.Controller\n @default null\n */\n targetObject: Ember.computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n Sends an action to component's controller. A component inherits its\n controller from the context in which it is used.\n\n By default, calling `sendAction()` will send an action with the name\n of the component's `action` property.\n\n For example, if the component had a property `action` with the value\n `\"addItem\"`, calling `sendAction()` would send the `addItem` action\n to the component's controller.\n\n If you provide the `action` argument to `sendAction()`, that key will\n be used to look up the action name.\n\n For example, if the component had a property `playing` with the value\n `didStartPlaying`, calling `sendAction('playing')` would send the\n `didStartPlaying` action to the component's controller.\n\n Whether or not you are using the default action or a named action, if\n the action name is not defined on the component, calling `sendAction()`\n does not have any effect.\n\n For example, if you call `sendAction()` on a component that does not have\n an `action` property defined, no action will be sent to the controller,\n nor will an exception be raised.\n\n You can send a context object with the action by supplying the `context`\n argument. The context will be supplied as the first argument in the\n target's action method. Example:\n\n ```javascript\n App.MyTreeComponent = Ember.Component.extend({\n click: function() {\n this.sendAction('didClickTreeNode', this.get('node'));\n }\n });\n\n App.CategoriesController = Ember.Controller.extend({\n actions: {\n didClickCategory: function(category) {\n //Do something with the node/category that was clicked\n }\n }\n });\n ```\n\n ```handlebars\n {{! categories.hbs}}\n {{my-tree didClickTreeNode='didClickCategory'}}\n ```\n\n @method sendAction\n @param [action] {String} the action to trigger\n @param [context] {*} a context to send with the action\n */\n sendAction: function(action) {\n var actionName,\n contexts = a_slice.call(arguments, 1);\n\n // Send the default action\n if (action === undefined) {\n actionName = get(this, 'action');\n Ember.assert(\"The default action was triggered on the component \" + this.toString() + \", but the action name (\" + actionName + \") was not a string.\", isNone(actionName) || typeof actionName === 'string');\n } else {\n actionName = get(this, action);\n Ember.assert(\"The \" + action + \" action was triggered on the component \" + this.toString() + \", but the action name (\" + actionName + \") was not a string.\", isNone(actionName) || typeof actionName === 'string');\n }\n\n // If no action name for that action could be found, just abort.\n if (actionName === undefined) { return; }\n\n this.triggerAction({\n action: actionName,\n actionContext: contexts\n });\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/component");minispade.register('ember-views/views/container_view', "(function() {minispade.require('ember-views/views/view');\nminispade.require('ember-views/views/states');\nminispade.require('ember-runtime/mixins/mutable_array');\n\nvar states = Ember.View.cloneStates(Ember.View.states);\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar forEach = Ember.EnumerableUtils.forEach;\nvar ViewCollection = Ember._ViewCollection;\n\n/**\n A `ContainerView` is an `Ember.View` subclass that implements `Ember.MutableArray`\n allowing programatic management of its child views.\n\n ## Setting Initial Child Views\n\n The initial array of child views can be set in one of two ways. You can\n provide a `childViews` property at creation time that contains instance of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: [Ember.View.create(), Ember.View.create()]\n });\n ```\n\n You can also provide a list of property names whose values are instances of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', 'bView', 'cView'],\n aView: Ember.View.create(),\n bView: Ember.View.create(),\n cView: Ember.View.create()\n });\n ```\n\n The two strategies can be combined:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', Ember.View.create()],\n aView: Ember.View.create()\n });\n ```\n\n Each child view's rendering will be inserted into the container's rendered\n HTML in the same order as its position in the `childViews` property.\n\n ## Adding and Removing Child Views\n\n The container view implements `Ember.MutableArray` allowing programatic management of its child views.\n\n To remove a view, pass that view into a `removeObject` call on the container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Removing a view\n\n ```javascript\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.removeObject(aContainer.get('bView'));\n aContainer.toArray(); // [aContainer.aView]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n </div>\n ```\n\n Similarly, adding a child view is accomplished by adding `Ember.View` instances to the\n container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Adding a view\n\n ```javascript\n AnotherViewClass = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Another view\")\n });\n\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.pushObject(AnotherViewClass.create());\n aContainer.toArray(); // [aContainer.aView, aContainer.bView, <AnotherViewClass instance>]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n <div class=\"ember-view\">Another view</div>\n </div>\n ```\n\n ## Templates and Layout\n\n A `template`, `templateName`, `defaultTemplate`, `layout`, `layoutName` or\n `defaultLayout` property on a container view will not result in the template\n or layout being rendered. The HTML contents of a `Ember.ContainerView`'s DOM\n representation will only be the rendered HTML of its child views.\n\n @class ContainerView\n @namespace Ember\n @extends Ember.View\n*/\nEmber.ContainerView = Ember.View.extend(Ember.MutableArray, {\n states: states,\n\n init: function() {\n this._super();\n\n var childViews = get(this, 'childViews');\n\n // redefine view's childViews property that was obliterated\n Ember.defineProperty(this, 'childViews', Ember.View.childViewsProperty);\n\n var _childViews = this._childViews;\n\n forEach(childViews, function(viewName, idx) {\n var view;\n\n if ('string' === typeof viewName) {\n view = get(this, viewName);\n view = this.createChildView(view);\n set(this, viewName, view);\n } else {\n view = this.createChildView(viewName);\n }\n\n _childViews[idx] = view;\n }, this);\n\n var currentView = get(this, 'currentView');\n if (currentView) {\n if (!_childViews.length) { _childViews = this._childViews = this._childViews.slice(); }\n _childViews.push(this.createChildView(currentView));\n }\n },\n\n replace: function(idx, removedCount, addedViews) {\n var addedCount = addedViews ? get(addedViews, 'length') : 0;\n var self = this;\n Ember.assert(\"You can't add a child to a container that is already a child of another view\", Ember.A(addedViews).every(function(item) { return !get(item, '_parentView') || get(item, '_parentView') === self; }));\n\n this.arrayContentWillChange(idx, removedCount, addedCount);\n this.childViewsWillChange(this._childViews, idx, removedCount);\n\n if (addedCount === 0) {\n this._childViews.splice(idx, removedCount) ;\n } else {\n var args = [idx, removedCount].concat(addedViews);\n if (addedViews.length && !this._childViews.length) { this._childViews = this._childViews.slice(); }\n this._childViews.splice.apply(this._childViews, args);\n }\n\n this.arrayContentDidChange(idx, removedCount, addedCount);\n this.childViewsDidChange(this._childViews, idx, removedCount, addedCount);\n\n return this;\n },\n\n objectAt: function(idx) {\n return this._childViews[idx];\n },\n\n length: Ember.computed(function () {\n return this._childViews.length;\n }).volatile(),\n\n /**\n @private\n\n Instructs each child view to render to the passed render buffer.\n\n @method render\n @param {Ember.RenderBuffer} buffer the buffer to render to\n */\n render: function(buffer) {\n this.forEachChildView(function(view) {\n view.renderToBuffer(buffer);\n });\n },\n\n instrumentName: 'container',\n\n /**\n @private\n\n When a child view is removed, destroy its element so that\n it is removed from the DOM.\n\n The array observer that triggers this action is set up in the\n `renderToBuffer` method.\n\n @method childViewsWillChange\n @param {Ember.Array} views the child views array before mutation\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n **/\n childViewsWillChange: function(views, start, removed) {\n this.propertyWillChange('childViews');\n\n if (removed > 0) {\n var changedViews = views.slice(start, start+removed);\n // transition to preRender before clearing parentView\n this.currentState.childViewsWillChange(this, views, start, removed);\n this.initializeViews(changedViews, null, null);\n }\n },\n\n removeChild: function(child) {\n this.removeObject(child);\n return this;\n },\n\n /**\n @private\n\n When a child view is added, make sure the DOM gets updated appropriately.\n\n If the view has already rendered an element, we tell the child view to\n create an element and insert it into the DOM. If the enclosing container\n view has already written to a buffer, but not yet converted that buffer\n into an element, we insert the string representation of the child into the\n appropriate place in the buffer.\n\n @method childViewsDidChange\n @param {Ember.Array} views the array of child views afte the mutation has occurred\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n @param {Number} the number of child views added\n */\n childViewsDidChange: function(views, start, removed, added) {\n if (added > 0) {\n var changedViews = views.slice(start, start+added);\n this.initializeViews(changedViews, this, get(this, 'templateData'));\n this.currentState.childViewsDidChange(this, views, start, added);\n }\n this.propertyDidChange('childViews');\n },\n\n initializeViews: function(views, parentView, templateData) {\n forEach(views, function(view) {\n set(view, '_parentView', parentView);\n\n if (!view.container && parentView) {\n set(view, 'container', parentView.container);\n }\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', templateData);\n }\n });\n },\n\n currentView: null,\n\n _currentViewWillChange: Ember.beforeObserver('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n currentView.destroy();\n }\n }),\n\n _currentViewDidChange: Ember.observer('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n Ember.assert(\"You tried to set a current view that already has a parent. Make sure you don't have multiple outlets in the same view.\", !get(currentView, '_parentView'));\n this.pushObject(currentView);\n }\n }),\n\n _ensureChildrenAreInDOM: function () {\n this.currentState.ensureChildrenAreInDOM(this);\n }\n});\n\nEmber.merge(states._default, {\n childViewsWillChange: Ember.K,\n childViewsDidChange: Ember.K,\n ensureChildrenAreInDOM: Ember.K\n});\n\nEmber.merge(states.inBuffer, {\n childViewsDidChange: function(parentView, views, start, added) {\n throw new Ember.Error('You cannot modify child views while in the inBuffer state');\n }\n});\n\nEmber.merge(states.hasElement, {\n childViewsWillChange: function(view, views, start, removed) {\n for (var i=start; i<start+removed; i++) {\n views[i].remove();\n }\n },\n\n childViewsDidChange: function(view, views, start, added) {\n Ember.run.scheduleOnce('render', view, '_ensureChildrenAreInDOM');\n },\n\n ensureChildrenAreInDOM: function(view) {\n var childViews = view._childViews, i, len, childView, previous, buffer, viewCollection = new ViewCollection();\n\n for (i = 0, len = childViews.length; i < len; i++) {\n childView = childViews[i];\n\n if (!buffer) { buffer = Ember.RenderBuffer(); buffer._hasElement = false; }\n\n if (childView.renderToBufferIfNeeded(buffer)) {\n viewCollection.push(childView);\n } else if (viewCollection.length) {\n insertViewCollection(view, viewCollection, previous, buffer);\n buffer = null;\n previous = childView;\n viewCollection.clear();\n } else {\n previous = childView;\n }\n }\n\n if (viewCollection.length) {\n insertViewCollection(view, viewCollection, previous, buffer);\n }\n }\n});\n\nfunction insertViewCollection(view, viewCollection, previous, buffer) {\n viewCollection.triggerRecursively('willInsertElement');\n\n if (previous) {\n previous.domManager.after(previous, buffer.string());\n } else {\n view.domManager.prepend(view, buffer.string());\n }\n\n viewCollection.forEach(function(v) {\n v.transitionTo('inDOM');\n v.propertyDidChange('element');\n v.triggerRecursively('didInsertElement');\n });\n}\n\n\n})();\n//@ sourceURL=ember-views/views/container_view");minispade.register('ember-views/views/states', "(function() {minispade.require(\"ember-views/views/states/default\");\nminispade.require(\"ember-views/views/states/pre_render\");\nminispade.require(\"ember-views/views/states/in_buffer\");\nminispade.require(\"ember-views/views/states/in_dom\");\nminispade.require(\"ember-views/views/states/destroying\");\n\nEmber.View.cloneStates = function(from) {\n var into = {};\n\n into._default = {};\n into.preRender = Ember.create(into._default);\n into.destroying = Ember.create(into._default);\n into.inBuffer = Ember.create(into._default);\n into.hasElement = Ember.create(into._default);\n into.inDOM = Ember.create(into.hasElement);\n\n for (var stateName in from) {\n if (!from.hasOwnProperty(stateName)) { continue; }\n Ember.merge(into[stateName], from[stateName]);\n }\n\n return into;\n};\n\n})();\n//@ sourceURL=ember-views/views/states");minispade.register('ember-views/views/states/default', "(function() {minispade.require('ember-views/views/view');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.View.states._default = {\n // appendChild is only legal while rendering the buffer.\n appendChild: function() {\n throw \"You can't use appendChild outside of the rendering process\";\n },\n\n $: function() {\n return undefined;\n },\n\n getElement: function() {\n return null;\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function() {\n return true; // continue event propagation\n },\n\n destroyElement: function(view) {\n set(view, 'element', null);\n if (view._scheduledInsert) {\n Ember.run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n renderToBufferIfNeeded: function () {\n return false;\n },\n\n rerender: Ember.K,\n invokeObserver: Ember.K\n};\n\n})();\n//@ sourceURL=ember-views/views/states/default");minispade.register('ember-views/views/states/destroying', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar destroyingError = \"You can't call %@ on a view being destroyed\", fmt = Ember.String.fmt;\n\nvar destroying = Ember.View.states.destroying = Ember.create(Ember.View.states._default);\n\nEmber.merge(destroying, {\n appendChild: function() {\n throw fmt(destroyingError, ['appendChild']);\n },\n rerender: function() {\n throw fmt(destroyingError, ['rerender']);\n },\n destroyElement: function() {\n throw fmt(destroyingError, ['destroyElement']);\n },\n empty: function() {\n throw fmt(destroyingError, ['empty']);\n },\n\n setElement: function() {\n throw fmt(destroyingError, [\"set('element', ...)\"]);\n },\n\n renderToBufferIfNeeded: function() {\n return false;\n },\n\n // Since element insertion is scheduled, don't do anything if\n // the view has been destroyed between scheduling and execution\n insertElement: Ember.K\n});\n\n\n})();\n//@ sourceURL=ember-views/views/states/destroying");minispade.register('ember-views/views/states/in_buffer', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar inBuffer = Ember.View.states.inBuffer = Ember.create(Ember.View.states._default);\n\nEmber.merge(inBuffer, {\n $: function(view, sel) {\n // if we don't have an element yet, someone calling this.$() is\n // trying to update an element that isn't in the DOM. Instead,\n // rerender the view to allow the render method to reflect the\n // changes.\n view.rerender();\n return Ember.$();\n },\n\n // when a view is rendered in a buffer, rerendering it simply\n // replaces the existing buffer with a new one\n rerender: function(view) {\n throw new Ember.Error(\"Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.\");\n },\n\n // when a view is rendered in a buffer, appending a child\n // view will render that view and append the resulting\n // buffer into its buffer.\n appendChild: function(view, childView, options) {\n var buffer = view.buffer, _childViews = view._childViews;\n\n childView = view.createChildView(childView, options);\n if (!_childViews.length) { _childViews = view._childViews = _childViews.slice(); }\n _childViews.push(childView);\n\n childView.renderToBuffer(buffer);\n\n view.propertyDidChange('childViews');\n\n return childView;\n },\n\n // when a view is rendered in a buffer, destroying the\n // element will simply destroy the buffer and put the\n // state back into the preRender state.\n destroyElement: function(view) {\n view.clearBuffer();\n var viewCollection = view._notifyWillDestroyElement();\n viewCollection.transitionTo('preRender', false);\n\n return view;\n },\n\n empty: function() {\n Ember.assert(\"Emptying a view in the inBuffer state is not allowed and should not happen under normal circumstances. Most likely there is a bug in your application. This may be due to excessive property change notifications.\");\n },\n\n renderToBufferIfNeeded: function (view, buffer) {\n return false;\n },\n\n // It should be impossible for a rendered view to be scheduled for\n // insertion.\n insertElement: function() {\n throw \"You can't insert an element that has already been rendered\";\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n view.clearBuffer();\n view.transitionTo('hasElement');\n }\n\n return value;\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n});\n\n\n})();\n//@ sourceURL=ember-views/views/states/in_buffer");minispade.register('ember-views/views/states/in_dom', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar hasElement = Ember.View.states.hasElement = Ember.create(Ember.View.states._default);\n\nEmber.merge(hasElement, {\n $: function(view, sel) {\n var elem = get(view, 'element');\n return sel ? Ember.$(sel, elem) : Ember.$(elem);\n },\n\n getElement: function(view) {\n var parent = get(view, 'parentView');\n if (parent) { parent = get(parent, 'element'); }\n if (parent) { return view.findElementInParentElement(parent); }\n return Ember.$(\"#\" + get(view, 'elementId'))[0];\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n throw \"You cannot set an element to a non-null value when the element is already in the DOM.\";\n }\n\n return value;\n },\n\n // once the view has been inserted into the DOM, rerendering is\n // deferred to allow bindings to synchronize.\n rerender: function(view) {\n view.triggerRecursively('willClearRender');\n\n view.clearRenderedChildren();\n\n view.domManager.replace(view);\n return view;\n },\n\n // once the view is already in the DOM, destroying it removes it\n // from the DOM, nukes its element, and puts it back into the\n // preRender state if inDOM.\n\n destroyElement: function(view) {\n view._notifyWillDestroyElement();\n view.domManager.remove(view);\n set(view, 'element', null);\n if (view._scheduledInsert) {\n Ember.run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n empty: function(view) {\n var _childViews = view._childViews, len, idx;\n if (_childViews) {\n len = _childViews.length;\n for (idx = 0; idx < len; idx++) {\n _childViews[idx]._notifyWillDestroyElement();\n }\n }\n view.domManager.empty(view);\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function(view, eventName, evt) {\n if (view.has(eventName)) {\n // Handler should be able to re-dispatch events, so we don't\n // preventDefault or stopPropagation.\n return view.trigger(eventName, evt);\n } else {\n return true; // continue event propagation\n }\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n});\n\nvar inDOM = Ember.View.states.inDOM = Ember.create(hasElement);\n\nEmber.merge(inDOM, {\n enter: function(view) {\n // Register the view for event handling. This hash is used by\n // Ember.EventDispatcher to dispatch incoming events.\n if (!view.isVirtual) {\n Ember.assert(\"Attempted to register a view with an id already in use: \"+view.elementId, !Ember.View.views[view.elementId]);\n Ember.View.views[view.elementId] = view;\n }\n\n view.addBeforeObserver('elementId', function() {\n throw new Ember.Error(\"Changing a view's elementId after creation is not allowed\");\n });\n },\n\n exit: function(view) {\n if (!this.isVirtual) delete Ember.View.views[view.elementId];\n },\n\n insertElement: function(view, fn) {\n throw \"You can't insert an element into the DOM that has already been inserted\";\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/states/in_dom");minispade.register('ember-views/views/states/pre_render', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar preRender = Ember.View.states.preRender = Ember.create(Ember.View.states._default);\n\nEmber.merge(preRender, {\n // a view leaves the preRender state once its element has been\n // created (createElement).\n insertElement: function(view, fn) {\n view.createElement();\n var viewCollection = view.viewHierarchyCollection();\n\n viewCollection.trigger('willInsertElement');\n\n fn.call(view);\n\n // We transition to `inDOM` if the element exists in the DOM\n var element = view.get('element');\n while (element = element.parentNode) {\n if (element === document) {\n viewCollection.transitionTo('inDOM', false);\n viewCollection.trigger('didInsertElement');\n }\n }\n\n },\n\n renderToBufferIfNeeded: function(view, buffer) {\n view.renderToBuffer(buffer);\n return true;\n },\n\n empty: Ember.K,\n\n setElement: function(view, value) {\n if (value !== null) {\n view.transitionTo('hasElement');\n }\n return value;\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/states/pre_render");minispade.register('ember-views/views/view', "(function() {minispade.require(\"ember-views/system/render_buffer\");\n\nvar states = {};\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar guidFor = Ember.guidFor;\nvar a_forEach = Ember.EnumerableUtils.forEach;\nvar a_addObject = Ember.EnumerableUtils.addObject;\nvar meta = Ember.meta;\n\nvar childViewsProperty = Ember.computed(function() {\n var childViews = this._childViews, ret = Ember.A(), view = this;\n\n a_forEach(childViews, function(view) {\n var currentChildViews;\n if (view.isVirtual) {\n if (currentChildViews = get(view, 'childViews')) {\n ret.pushObjects(currentChildViews);\n }\n } else {\n ret.push(view);\n }\n });\n\n ret.replace = function (idx, removedCount, addedViews) {\n if (view instanceof Ember.ContainerView) {\n Ember.deprecate(\"Manipulating an Ember.ContainerView through its childViews property is deprecated. Please use the ContainerView instance itself as an Ember.MutableArray.\");\n return view.replace(idx, removedCount, addedViews);\n }\n throw new Ember.Error(\"childViews is immutable\");\n };\n\n return ret;\n});\n\nEmber.warn(\"The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.\", Ember.ENV.VIEW_PRESERVES_CONTEXT !== false);\n\n/**\n Global hash of shared templates. This will automatically be populated\n by the build tools so that you can store your Handlebars templates in\n separate files that get loaded into JavaScript at buildtime.\n\n @property TEMPLATES\n @for Ember\n @type Hash\n*/\nEmber.TEMPLATES = {};\n\n/**\n `Ember.CoreView` is an abstract class that exists to give view-like behavior\n to both Ember's main view class `Ember.View` and other classes like\n `Ember._SimpleMetamorphView` that don't need the fully functionaltiy of\n `Ember.View`.\n\n Unless you have specific needs for `CoreView`, you will use `Ember.View`\n in your applications.\n\n @class CoreView\n @namespace Ember\n @extends Ember.Object\n @uses Ember.Evented\n*/\n\nEmber.CoreView = Ember.Object.extend(Ember.Evented, Ember.ActionHandler, {\n isView: true,\n\n states: states,\n\n init: function() {\n this._super();\n this.transitionTo('preRender');\n },\n\n /**\n If the view is currently inserted into the DOM of a parent view, this\n property will point to the parent of the view.\n\n @property parentView\n @type Ember.View\n @default null\n */\n parentView: Ember.computed(function() {\n var parent = this._parentView;\n\n if (parent && parent.isVirtual) {\n return get(parent, 'parentView');\n } else {\n return parent;\n }\n }).property('_parentView'),\n\n state: null,\n\n _parentView: null,\n\n // return the current view, not including virtual views\n concreteView: Ember.computed(function() {\n if (!this.isVirtual) { return this; }\n else { return get(this, 'parentView'); }\n }).property('parentView'),\n\n instrumentName: 'core_view',\n\n instrumentDetails: function(hash) {\n hash.object = this.toString();\n },\n\n /**\n @private\n\n Invoked by the view system when this view needs to produce an HTML\n representation. This method will create a new render buffer, if needed,\n then apply any default attributes, such as class names and visibility.\n Finally, the `render()` method is invoked, which is responsible for\n doing the bulk of the rendering.\n\n You should not need to override this method; instead, implement the\n `template` property, or if you need more control, override the `render`\n method.\n\n @method renderToBuffer\n @param {Ember.RenderBuffer} buffer the render buffer. If no buffer is\n passed, a default buffer, using the current view's `tagName`, will\n be used.\n */\n renderToBuffer: function(parentBuffer, bufferOperation) {\n var name = 'render.' + this.instrumentName,\n details = {};\n\n this.instrumentDetails(details);\n\n return Ember.instrument(name, details, function() {\n return this._renderToBuffer(parentBuffer, bufferOperation);\n }, this);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n // If this is the top-most view, start a new buffer. Otherwise,\n // create a new buffer relative to the original using the\n // provided buffer operation (for example, `insertAfter` will\n // insert a new buffer after the \"parent buffer\").\n var tagName = this.tagName;\n\n if (tagName === null || tagName === undefined) {\n tagName = 'div';\n }\n\n var buffer = this.buffer = parentBuffer && parentBuffer.begin(tagName) || Ember.RenderBuffer(tagName);\n this.transitionTo('inBuffer', false);\n\n this.beforeRender(buffer);\n this.render(buffer);\n this.afterRender(buffer);\n\n return buffer;\n },\n\n /**\n @private\n\n Override the default event firing from `Ember.Evented` to\n also call methods with the given name.\n\n @method trigger\n @param name {String}\n */\n trigger: function(name) {\n this._super.apply(this, arguments);\n var method = this[name];\n if (method) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n return method.apply(this, args);\n }\n },\n\n deprecatedSendHandles: function(actionName) {\n return !!this[actionName];\n },\n\n deprecatedSend: function(actionName) {\n var args = [].slice.call(arguments, 1);\n Ember.assert('' + this + \" has the action \" + actionName + \" but it is not a function\", typeof this[actionName] === 'function');\n Ember.deprecate('Action handlers implemented directly on views are deprecated in favor of action handlers on an `actions` object (' + actionName + ' on ' + this + ')', false);\n this[actionName].apply(this, args);\n return;\n },\n\n has: function(name) {\n return Ember.typeOf(this[name]) === 'function' || this._super(name);\n },\n\n destroy: function() {\n var parent = this._parentView;\n\n if (!this._super()) { return; }\n\n // destroy the element -- this will avoid each child view destroying\n // the element over and over again...\n if (!this.removedFromDOM) { this.destroyElement(); }\n\n // remove from parent if found. Don't call removeFromParent,\n // as removeFromParent will try to remove the element from\n // the DOM again.\n if (parent) { parent.removeChild(this); }\n\n this.transitionTo('destroying', false);\n\n return this;\n },\n\n clearRenderedChildren: Ember.K,\n triggerRecursively: Ember.K,\n invokeRecursively: Ember.K,\n transitionTo: Ember.K,\n destroyElement: Ember.K\n});\n\nvar ViewCollection = Ember._ViewCollection = function(initialViews) {\n var views = this.views = initialViews || [];\n this.length = views.length;\n};\n\nViewCollection.prototype = {\n length: 0,\n\n trigger: function(eventName) {\n var views = this.views, view;\n for (var i = 0, l = views.length; i < l; i++) {\n view = views[i];\n if (view.trigger) { view.trigger(eventName); }\n }\n },\n\n triggerRecursively: function(eventName) {\n var views = this.views;\n for (var i = 0, l = views.length; i < l; i++) {\n views[i].triggerRecursively(eventName);\n }\n },\n\n invokeRecursively: function(fn) {\n var views = this.views, view;\n\n for (var i = 0, l = views.length; i < l; i++) {\n view = views[i];\n fn(view);\n }\n },\n\n transitionTo: function(state, children) {\n var views = this.views;\n for (var i = 0, l = views.length; i < l; i++) {\n views[i].transitionTo(state, children);\n }\n },\n\n push: function() {\n this.length += arguments.length;\n var views = this.views;\n return views.push.apply(views, arguments);\n },\n\n objectAt: function(idx) {\n return this.views[idx];\n },\n\n forEach: function(callback) {\n var views = this.views;\n return a_forEach(views, callback);\n },\n\n clear: function() {\n this.length = 0;\n this.views.length = 0;\n }\n};\n\nvar EMPTY_ARRAY = [];\n\n/**\n `Ember.View` is the class in Ember responsible for encapsulating templates of\n HTML content, combining templates with data to render as sections of a page's\n DOM, and registering and responding to user-initiated events.\n\n ## HTML Tag\n\n The default HTML tag name used for a view's DOM representation is `div`. This\n can be customized by setting the `tagName` property. The following view\n class:\n\n ```javascript\n ParagraphView = Ember.View.extend({\n tagName: 'em'\n });\n ```\n\n Would result in instances with the following HTML:\n\n ```html\n <em id=\"ember1\" class=\"ember-view\"></em>\n ```\n\n ## HTML `class` Attribute\n\n The HTML `class` attribute of a view's tag can be set by providing a\n `classNames` property that is set to an array of strings:\n\n ```javascript\n MyView = Ember.View.extend({\n classNames: ['my-class', 'my-other-class']\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view my-class my-other-class\"></div>\n ```\n\n `class` attribute values can also be set by providing a `classNameBindings`\n property set to an array of properties names for the view. The return value\n of these properties will be added as part of the value for the view's `class`\n attribute. These properties can be computed properties:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['propertyA', 'propertyB'],\n propertyA: 'from-a',\n propertyB: function() {\n if (someLogic) { return 'from-b'; }\n }.property()\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view from-a from-b\"></div>\n ```\n\n If the value of a class name binding returns a boolean the property name\n itself will be used as the class name if the property is true. The class name\n will not be added if the value is `false` or `undefined`.\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['hovered'],\n hovered: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view hovered\"></div>\n ```\n\n When using boolean class name bindings you can supply a string value other\n than the property name for use as the `class` HTML attribute by appending the\n preferred value after a \":\" character when defining the binding:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['awesome:so-very-cool'],\n awesome: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view so-very-cool\"></div>\n ```\n\n Boolean value class name bindings whose property names are in a\n camelCase-style format will be converted to a dasherized format:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['isUrgent'],\n isUrgent: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view is-urgent\"></div>\n ```\n\n Class name bindings can also refer to object values that are found by\n traversing a path relative to the view itself:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['messages.empty']\n messages: Ember.Object.create({\n empty: true\n })\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view empty\"></div>\n ```\n\n If you want to add a class name for a property which evaluates to true and\n and a different class name if it evaluates to false, you can pass a binding\n like this:\n\n ```javascript\n // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false\n Ember.View.extend({\n classNameBindings: ['isEnabled:enabled:disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view enabled\"></div>\n ```\n\n When isEnabled is `false`, the resulting HTML reprensentation looks like\n this:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n This syntax offers the convenience to add a class if a property is `false`:\n\n ```javascript\n // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\n Ember.View.extend({\n classNameBindings: ['isEnabled::disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\"></div>\n ```\n\n When the `isEnabled` property on the view is set to `false`, it will result\n in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n Updates to the the value of a class name binding will result in automatic\n update of the HTML `class` attribute in the view's rendered HTML\n representation. If the value becomes `false` or `undefined` the class name\n will be removed.\n\n Both `classNames` and `classNameBindings` are concatenated properties. See\n [Ember.Object](/api/classes/Ember.Object.html) documentation for more\n information about concatenated properties.\n\n ## HTML Attributes\n\n The HTML attribute section of a view's tag can be set by providing an\n `attributeBindings` property set to an array of property names on the view.\n The return value of these properties will be used as the value of the view's\n HTML associated attribute:\n\n ```javascript\n AnchorView = Ember.View.extend({\n tagName: 'a',\n attributeBindings: ['href'],\n href: 'http://google.com'\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n ```\n\n If the return value of an `attributeBindings` monitored property is a boolean\n the property will follow HTML's pattern of repeating the attribute's name as\n its value:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <input id=\"ember1\" class=\"ember-view\" disabled=\"disabled\" />\n ```\n\n `attributeBindings` can refer to computed properties:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: function() {\n if (someLogic) {\n return true;\n } else {\n return false;\n }\n }.property()\n });\n ```\n\n Updates to the the property of an attribute binding will result in automatic\n update of the HTML attribute in the view's rendered HTML representation.\n\n `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html)\n documentation for more information about concatenated properties.\n\n ## Templates\n\n The HTML contents of a view's rendered representation are determined by its\n template. Templates can be any function that accepts an optional context\n parameter and returns a string of HTML that will be inserted within the\n view's tag. Most typically in Ember this function will be a compiled\n `Ember.Handlebars` template.\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('I am the template')\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I am the template</div>\n ```\n\n Within an Ember application is more common to define a Handlebars templates as\n part of a page:\n\n ```html\n <script type='text/x-handlebars' data-template-name='some-template'>\n Hello\n </script>\n ```\n\n And associate it by name using a view's `templateName` property:\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'some-template'\n });\n ```\n\n Using a value for `templateName` that does not have a Handlebars template\n with a matching `data-template-name` attribute will throw an error.\n\n For views classes that may have a template later defined (e.g. as the block\n portion of a `{{view}}` Handlebars helper call in another template or in\n a subclass), you can provide a `defaultTemplate` property set to compiled\n template function. If a template is not later provided for the view instance\n the `defaultTemplate` value will be used:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default'),\n template: null,\n templateName: null\n });\n ```\n\n Will result in instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the default</div>\n ```\n\n If a `template` or `templateName` is provided it will take precedence over\n `defaultTemplate`:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default')\n });\n\n aView = AView.create({\n template: Ember.Handlebars.compile('I was the template, not default')\n });\n ```\n\n Will result in the following HTML representation when rendered:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the template, not default</div>\n ```\n\n ## View Context\n\n The default context of the compiled template is the view's controller:\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('Hello {{excitedGreeting}}')\n });\n\n aController = Ember.Object.create({\n firstName: 'Barry',\n excitedGreeting: function() {\n return this.get(\"content.firstName\") + \"!!!\"\n }.property()\n });\n\n aView = AView.create({\n controller: aController,\n });\n ```\n\n Will result in an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">Hello Barry!!!</div>\n ```\n\n A context can also be explicitly supplied through the view's `context`\n property. If the view has neither `context` nor `controller` properties, the\n `parentView`'s context will be used.\n\n ## Layouts\n\n Views can have a secondary template that wraps their main template. Like\n primary templates, layouts can be any function that accepts an optional\n context parameter and returns a string of HTML that will be inserted inside\n view's tag. Views whose HTML element is self closing (e.g. `<input />`)\n cannot have a layout and this property will be ignored.\n\n Most typically in Ember a layout will be a compiled `Ember.Handlebars`\n template.\n\n A view's layout can be set directly with the `layout` property or reference\n an existing Handlebars template by name with the `layoutName` property.\n\n A template used as a layout must contain a single use of the Handlebars\n `{{yield}}` helper. The HTML contents of a view's rendered `template` will be\n inserted at this location:\n\n ```javascript\n AViewWithLayout = Ember.View.extend({\n layout: Ember.Handlebars.compile(\"<div class='my-decorative-class'>{{yield}}</div>\")\n template: Ember.Handlebars.compile(\"I got wrapped\"),\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div class=\"my-decorative-class\">\n I got wrapped\n </div>\n </div>\n ```\n\n See [Ember.Handlebars.helpers.yield](/api/classes/Ember.Handlebars.helpers.html#method_yield)\n for more information.\n\n ## Responding to Browser Events\n\n Views can respond to user-initiated events in one of three ways: method\n implementation, through an event manager, and through `{{action}}` helper use\n in their template or layout.\n\n ### Method Implementation\n\n Views can respond to user-initiated events by implementing a method that\n matches the event name. A `jQuery.Event` object will be passed as the\n argument to this method.\n\n ```javascript\n AView = Ember.View.extend({\n click: function(event) {\n // will be called when when an instance's\n // rendered element is clicked\n }\n });\n ```\n\n ### Event Managers\n\n Views can define an object as their `eventManager` property. This object can\n then implement methods that match the desired event names. Matching events\n that occur on the view's rendered HTML or the rendered HTML of any of its DOM\n descendants will trigger this method. A `jQuery.Event` object will be passed\n as the first argument to the method and an `Ember.View` object as the\n second. The `Ember.View` will be the view whose rendered HTML was interacted\n with. This may be the view with the `eventManager` property or one of its\n descendent views.\n\n ```javascript\n AView = Ember.View.extend({\n eventManager: Ember.Object.create({\n doubleClick: function(event, view) {\n // will be called when when an instance's\n // rendered element or any rendering\n // of this views's descendent\n // elements is clicked\n }\n })\n });\n ```\n\n An event defined for an event manager takes precedence over events of the\n same name handled through methods on the view.\n\n ```javascript\n AView = Ember.View.extend({\n mouseEnter: function(event) {\n // will never trigger.\n },\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // takes precedence over AView#mouseEnter\n }\n })\n });\n ```\n\n Similarly a view's event manager will take precedence for events of any views\n rendered as a descendent. A method name that matches an event name will not\n be called if the view instance was rendered inside the HTML representation of\n a view that has an `eventManager` property defined that handles events of the\n name. Events not handled by the event manager will still trigger method calls\n on the descendent.\n\n ```javascript\n OuterView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"outer {{#view InnerView}}inner{{/view}} outer\"),\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // view might be instance of either\n // OuterView or InnerView depending on\n // where on the page the user interaction occured\n }\n })\n });\n\n InnerView = Ember.View.extend({\n click: function(event) {\n // will be called if rendered inside\n // an OuterView because OuterView's\n // eventManager doesn't handle click events\n },\n mouseEnter: function(event) {\n // will never be called if rendered inside\n // an OuterView.\n }\n });\n ```\n\n ### Handlebars `{{action}}` Helper\n\n See [Handlebars.helpers.action](/api/classes/Ember.Handlebars.helpers.html#method_action).\n\n ### Event Names\n\n All of the event handling approaches described above respond to the same set\n of events. The names of the built-in events are listed below. (The hash of\n built-in events exists in `Ember.EventDispatcher`.) Additional, custom events\n can be registered by using `Ember.Application.customEvents`.\n\n Touch events:\n\n * `touchStart`\n * `touchMove`\n * `touchEnd`\n * `touchCancel`\n\n Keyboard events\n\n * `keyDown`\n * `keyUp`\n * `keyPress`\n\n Mouse events\n\n * `mouseDown`\n * `mouseUp`\n * `contextMenu`\n * `click`\n * `doubleClick`\n * `mouseMove`\n * `focusIn`\n * `focusOut`\n * `mouseEnter`\n * `mouseLeave`\n\n Form events:\n\n * `submit`\n * `change`\n * `focusIn`\n * `focusOut`\n * `input`\n\n HTML5 drag and drop events:\n\n * `dragStart`\n * `drag`\n * `dragEnter`\n * `dragLeave`\n * `drop`\n * `dragEnd`\n\n ## Handlebars `{{view}}` Helper\n\n Other `Ember.View` instances can be included as part of a view's template by\n using the `{{view}}` Handlebars helper. See [Ember.Handlebars.helpers.view](/api/classes/Ember.Handlebars.helpers.html#method_view)\n for additional information.\n\n @class View\n @namespace Ember\n @extends Ember.CoreView\n*/\nEmber.View = Ember.CoreView.extend(\n/** @scope Ember.View.prototype */ {\n\n concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'],\n\n /**\n @property isView\n @type Boolean\n @default true\n @final\n */\n isView: true,\n\n // ..........................................................\n // TEMPLATE SUPPORT\n //\n\n /**\n The name of the template to lookup if no template is provided.\n\n `Ember.View` will look for a template with this name in this view's\n `templates` object. By default, this will be a global object\n shared in `Ember.TEMPLATES`.\n\n @property templateName\n @type String\n @default null\n */\n templateName: null,\n\n /**\n The name of the layout to lookup if no layout is provided.\n\n `Ember.View` will look for a template with this name in this view's\n `templates` object. By default, this will be a global object\n shared in `Ember.TEMPLATES`.\n\n @property layoutName\n @type String\n @default null\n */\n layoutName: null,\n\n /**\n The hash in which to look for `templateName`.\n\n @property templates\n @type Ember.Object\n @default Ember.TEMPLATES\n */\n templates: Ember.TEMPLATES,\n\n /**\n The template used to render the view. This should be a function that\n accepts an optional context parameter and returns a string of HTML that\n will be inserted into the DOM relative to its parent view.\n\n In general, you should set the `templateName` property instead of setting\n the template yourself.\n\n @property template\n @type Function\n */\n template: Ember.computed(function(key, value) {\n if (value !== undefined) { return value; }\n\n var templateName = get(this, 'templateName'),\n template = this.templateForName(templateName, 'template');\n\n Ember.assert(\"You specified the templateName \" + templateName + \" for \" + this + \", but it did not exist.\", !templateName || template);\n\n return template || get(this, 'defaultTemplate');\n }).property('templateName'),\n\n /**\n The controller managing this view. If this property is set, it will be\n made available for use by the template.\n\n @property controller\n @type Object\n */\n controller: Ember.computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n A view may contain a layout. A layout is a regular template but\n supersedes the `template` property during rendering. It is the\n responsibility of the layout template to retrieve the `template`\n property from the view (or alternatively, call `Handlebars.helpers.yield`,\n `{{yield}}`) to render it in the correct location.\n\n This is useful for a view that has a shared wrapper, but which delegates\n the rendering of the contents of the wrapper to the `template` property\n on a subclass.\n\n @property layout\n @type Function\n */\n layout: Ember.computed(function(key) {\n var layoutName = get(this, 'layoutName'),\n layout = this.templateForName(layoutName, 'layout');\n\n Ember.assert(\"You specified the layoutName \" + layoutName + \" for \" + this + \", but it did not exist.\", !layoutName || layout);\n\n return layout || get(this, 'defaultLayout');\n }).property('layoutName'),\n\n _yield: function(context, options) {\n var template = get(this, 'template');\n if (template) { template(context, options); }\n },\n\n templateForName: function(name, type) {\n if (!name) { return; }\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n // the defaultContainer is deprecated\n var container = this.container || (Ember.Container && Ember.Container.defaultContainer);\n return container && container.lookup('template:' + name);\n },\n\n /**\n The object from which templates should access properties.\n\n This object will be passed to the template function each time the render\n method is called, but it is up to the individual function to decide what\n to do with it.\n\n By default, this will be the view's controller.\n\n @property context\n @type Object\n */\n context: Ember.computed(function(key, value) {\n if (arguments.length === 2) {\n set(this, '_context', value);\n return value;\n } else {\n return get(this, '_context');\n }\n }).volatile(),\n\n /**\n @private\n\n Private copy of the view's template context. This can be set directly\n by Handlebars without triggering the observer that causes the view\n to be re-rendered.\n\n The context of a view is looked up as follows:\n\n 1. Supplied context (usually by Handlebars)\n 2. Specified controller\n 3. `parentView`'s context (for a child of a ContainerView)\n\n The code in Handlebars that overrides the `_context` property first\n checks to see whether the view has a specified controller. This is\n something of a hack and should be revisited.\n\n @property _context\n */\n _context: Ember.computed(function(key) {\n var parentView, controller;\n\n if (controller = get(this, 'controller')) {\n return controller;\n }\n\n parentView = this._parentView;\n if (parentView) {\n return get(parentView, '_context');\n }\n\n return null;\n }),\n\n /**\n @private\n\n If a value that affects template rendering changes, the view should be\n re-rendered to reflect the new value.\n\n @method _contextDidChange\n */\n _contextDidChange: Ember.observer('context', function() {\n this.rerender();\n }),\n\n /**\n If `false`, the view will appear hidden in DOM.\n\n @property isVisible\n @type Boolean\n @default null\n */\n isVisible: true,\n\n /**\n @private\n\n Array of child views. You should never edit this array directly.\n Instead, use `appendChild` and `removeFromParent`.\n\n @property childViews\n @type Array\n @default []\n */\n childViews: childViewsProperty,\n\n _childViews: EMPTY_ARRAY,\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews will change.\n _childViewsWillChange: Ember.beforeObserver('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyWillChange(parentView, 'childViews'); }\n }\n }),\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews did change.\n _childViewsDidChange: Ember.observer('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyDidChange(parentView, 'childViews'); }\n }\n }),\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class.\n\n @property nearestInstanceOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n @deprecated\n */\n nearestInstanceOf: function(klass) {\n Ember.deprecate(\"nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.\");\n var view = get(this, 'parentView');\n\n while (view) {\n if (view instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class or mixin.\n\n @property nearestOfType\n @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself),\n or an instance of Ember.Mixin.\n @return Ember.View\n */\n nearestOfType: function(klass) {\n var view = get(this, 'parentView'),\n isOfType = klass instanceof Ember.Mixin ?\n function(view) { return klass.detect(view); } :\n function(view) { return klass.detect(view.constructor); };\n\n while (view) {\n if (isOfType(view)) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that has a given property.\n\n @property nearestWithProperty\n @param {String} property A property name\n @return Ember.View\n */\n nearestWithProperty: function(property) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (property in view) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor whose parent is an instance of\n `klass`.\n\n @property nearestChildOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n */\n nearestChildOf: function(klass) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (get(view, 'parentView') instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n @private\n\n When the parent view changes, recursively invalidate `controller`\n\n @method _parentViewDidChange\n */\n _parentViewDidChange: Ember.observer('_parentView', function() {\n if (this.isDestroying) { return; }\n\n this.trigger('parentViewDidChange');\n\n if (get(this, 'parentView.controller') && !get(this, 'controller')) {\n this.notifyPropertyChange('controller');\n }\n }),\n\n _controllerDidChange: Ember.observer('controller', function() {\n if (this.isDestroying) { return; }\n\n this.rerender();\n\n this.forEachChildView(function(view) {\n view.propertyDidChange('controller');\n });\n }),\n\n cloneKeywords: function() {\n var templateData = get(this, 'templateData');\n\n var keywords = templateData ? Ember.copy(templateData.keywords) : {};\n set(keywords, 'view', get(this, 'concreteView'));\n set(keywords, '_view', this);\n set(keywords, 'controller', get(this, 'controller'));\n\n return keywords;\n },\n\n /**\n Called on your view when it should push strings of HTML into a\n `Ember.RenderBuffer`. Most users will want to override the `template`\n or `templateName` properties instead of this method.\n\n By default, `Ember.View` will look for a function in the `template`\n property and invoke it with the value of `context`. The value of\n `context` will be the view's controller unless you override it.\n\n @method render\n @param {Ember.RenderBuffer} buffer The render buffer\n */\n render: function(buffer) {\n // If this view has a layout, it is the responsibility of the\n // the layout to render the view's template. Otherwise, render the template\n // directly.\n var template = get(this, 'layout') || get(this, 'template');\n\n if (template) {\n var context = get(this, 'context');\n var keywords = this.cloneKeywords();\n var output;\n\n var data = {\n view: this,\n buffer: buffer,\n isRenderData: true,\n keywords: keywords,\n insideGroup: get(this, 'templateData.insideGroup')\n };\n\n // Invoke the template with the provided template context, which\n // is the view's controller by default. A hash of data is also passed that provides\n // the template with access to the view and render buffer.\n\n Ember.assert('template must be a function. Did you mean to call Ember.Handlebars.compile(\"...\") or specify templateName instead?', typeof template === 'function');\n // The template should write directly to the render buffer instead\n // of returning a string.\n output = template(context, { data: data });\n\n // If the template returned a string instead of writing to the buffer,\n // push the string onto the buffer.\n if (output !== undefined) { buffer.push(output); }\n }\n },\n\n /**\n Renders the view again. This will work regardless of whether the\n view is already in the DOM or not. If the view is in the DOM, the\n rendering process will be deferred to give bindings a chance\n to synchronize.\n\n If children were added during the rendering process using `appendChild`,\n `rerender` will remove them, because they will be added again\n if needed by the next `render`.\n\n In general, if the display of your view changes, you should modify\n the DOM element directly instead of manually calling `rerender`, which can\n be slow.\n\n @method rerender\n */\n rerender: function() {\n return this.currentState.rerender(this);\n },\n\n clearRenderedChildren: function() {\n var lengthBefore = this.lengthBeforeRender,\n lengthAfter = this.lengthAfterRender;\n\n // If there were child views created during the last call to render(),\n // remove them under the assumption that they will be re-created when\n // we re-render.\n\n // VIEW-TODO: Unit test this path.\n var childViews = this._childViews;\n for (var i=lengthAfter-1; i>=lengthBefore; i--) {\n if (childViews[i]) { childViews[i].destroy(); }\n }\n },\n\n /**\n @private\n\n Iterates over the view's `classNameBindings` array, inserts the value\n of the specified property into the `classNames` array, then creates an\n observer to update the view's element if the bound property ever changes\n in the future.\n\n @method _applyClassNameBindings\n */\n _applyClassNameBindings: function(classBindings) {\n var classNames = this.classNames,\n elem, newClass, dasherizedClass;\n\n // Loop through all of the configured bindings. These will be either\n // property names ('isUrgent') or property paths relative to the view\n // ('content.isUrgent')\n a_forEach(classBindings, function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n // Extract just the property name from bindings like 'foo:bar'\n var parsedPath = Ember.View._parsePropertyPath(binding);\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n var observer = function() {\n // Get the current value of the property\n newClass = this._classStringForProperty(binding);\n elem = this.$();\n\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n // Also remove from classNames so that if the view gets rerendered,\n // the class doesn't get added back to the DOM.\n classNames.removeObject(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n };\n\n // Get the class name for the property at its current value\n dasherizedClass = this._classStringForProperty(binding);\n\n if (dasherizedClass) {\n // Ensure that it gets into the classNames array\n // so it is displayed when we render.\n a_addObject(classNames, dasherizedClass);\n\n // Save a reference to the class name so we can remove it\n // if the observer fires. Remember that this variable has\n // been closed over by the observer.\n oldClass = dasherizedClass;\n }\n\n this.registerObserver(this, parsedPath.path, observer);\n // Remove className so when the view is rerendered,\n // the className is added based on binding reevaluation\n this.one('willClearRender', function() {\n if (oldClass) {\n classNames.removeObject(oldClass);\n oldClass = null;\n }\n });\n\n }, this);\n },\n\n /**\n @private\n\n Iterates through the view's attribute bindings, sets up observers for each,\n then applies the current value of the attributes to the passed render buffer.\n\n @method _applyAttributeBindings\n @param {Ember.RenderBuffer} buffer\n */\n _applyAttributeBindings: function(buffer, attributeBindings) {\n var attributeValue, elem;\n\n a_forEach(attributeBindings, function(binding) {\n var split = binding.split(':'),\n property = split[0],\n attributeName = split[1] || property;\n\n // Create an observer to add/remove/change the attribute if the\n // JavaScript property changes.\n var observer = function() {\n elem = this.$();\n\n attributeValue = get(this, property);\n\n Ember.View.applyAttributeBindings(elem, attributeName, attributeValue);\n };\n\n this.registerObserver(this, property, observer);\n\n // Determine the current value and add it to the render buffer\n // if necessary.\n attributeValue = get(this, property);\n Ember.View.applyAttributeBindings(buffer, attributeName, attributeValue);\n }, this);\n },\n\n /**\n @private\n\n Given a property name, returns a dasherized version of that\n property name if the property evaluates to a non-falsy value.\n\n For example, if the view has property `isUrgent` that evaluates to true,\n passing `isUrgent` to this method will return `\"is-urgent\"`.\n\n @method _classStringForProperty\n @param property\n */\n _classStringForProperty: function(property) {\n var parsedPath = Ember.View._parsePropertyPath(property);\n var path = parsedPath.path;\n\n var val = get(this, path);\n if (val === undefined && Ember.isGlobalPath(path)) {\n val = get(Ember.lookup, path);\n }\n\n return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n },\n\n // ..........................................................\n // ELEMENT SUPPORT\n //\n\n /**\n Returns the current DOM element for the view.\n\n @property element\n @type DOMElement\n */\n element: Ember.computed(function(key, value) {\n if (value !== undefined) {\n return this.currentState.setElement(this, value);\n } else {\n return this.currentState.getElement(this);\n }\n }).property('_parentView'),\n\n /**\n Returns a jQuery object for this view's element. If you pass in a selector\n string, this method will return a jQuery object, using the current element\n as its buffer.\n\n For example, calling `view.$('li')` will return a jQuery object containing\n all of the `li` elements inside the DOM element of this view.\n\n @method $\n @param {String} [selector] a jQuery-compatible selector string\n @return {jQuery} the jQuery object for the DOM node\n */\n $: function(sel) {\n return this.currentState.$(this, sel);\n },\n\n mutateChildViews: function(callback) {\n var childViews = this._childViews,\n idx = childViews.length,\n view;\n\n while(--idx >= 0) {\n view = childViews[idx];\n callback(this, view, idx);\n }\n\n return this;\n },\n\n forEachChildView: function(callback) {\n var childViews = this._childViews;\n\n if (!childViews) { return this; }\n\n var len = childViews.length,\n view, idx;\n\n for (idx = 0; idx < len; idx++) {\n view = childViews[idx];\n callback(view);\n }\n\n return this;\n },\n\n /**\n Appends the view's element to the specified parent element.\n\n If the view does not have an HTML representation yet, `createElement()`\n will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing.\n\n This is not typically a function that you will need to call directly when\n building your application. You might consider using `Ember.ContainerView`\n instead. If you do need to use `appendTo`, be sure that the target element\n you are providing is associated with an `Ember.Application` and does not\n have an ancestor element that is associated with an Ember view.\n\n @method appendTo\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} receiver\n */\n appendTo: function(target) {\n // Schedule the DOM element to be created and appended to the given\n // element after bindings have synchronized.\n this._insertElementLater(function() {\n Ember.assert(\"You tried to append to (\" + target + \") but that isn't in the DOM\", Ember.$(target).length > 0);\n Ember.assert(\"You cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n Replaces the content of the specified parent element with this view's\n element. If the view does not have an HTML representation yet,\n `createElement()` will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing\n\n @method replaceIn\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} received\n */\n replaceIn: function(target) {\n Ember.assert(\"You tried to replace in (\" + target + \") but that isn't in the DOM\", Ember.$(target).length > 0);\n Ember.assert(\"You cannot replace an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n\n this._insertElementLater(function() {\n Ember.$(target).empty();\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n @private\n\n Schedules a DOM operation to occur during the next render phase. This\n ensures that all bindings have finished synchronizing before the view is\n rendered.\n\n To use, pass a function that performs a DOM operation.\n\n Before your function is called, this view and all child views will receive\n the `willInsertElement` event. After your function is invoked, this view\n and all of its child views will receive the `didInsertElement` event.\n\n ```javascript\n view._insertElementLater(function() {\n this.createElement();\n this.$().appendTo('body');\n });\n ```\n\n @method _insertElementLater\n @param {Function} fn the function that inserts the element into the DOM\n */\n _insertElementLater: function(fn) {\n this._scheduledInsert = Ember.run.scheduleOnce('render', this, '_insertElement', fn);\n },\n\n _insertElement: function (fn) {\n this._scheduledInsert = null;\n this.currentState.insertElement(this, fn);\n },\n\n /**\n Appends the view's element to the document body. If the view does\n not have an HTML representation yet, `createElement()` will be called\n automatically.\n\n If your application uses the `rootElement` property, you must append\n the view within that element. Rendering views outside of the `rootElement`\n is not supported.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the document body until all bindings have\n finished synchronizing.\n\n @method append\n @return {Ember.View} receiver\n */\n append: function() {\n return this.appendTo(document.body);\n },\n\n /**\n Removes the view's element from the element to which it is attached.\n\n @method remove\n @return {Ember.View} receiver\n */\n remove: function() {\n // What we should really do here is wait until the end of the run loop\n // to determine if the element has been re-appended to a different\n // element.\n // In the interim, we will just re-render if that happens. It is more\n // important than elements get garbage collected.\n if (!this.removedFromDOM) { this.destroyElement(); }\n this.invokeRecursively(function(view) {\n if (view.clearRenderedChildren) { view.clearRenderedChildren(); }\n });\n },\n\n elementId: null,\n\n /**\n Attempts to discover the element in the parent element. The default\n implementation looks for an element with an ID of `elementId` (or the\n view's guid if `elementId` is null). You can override this method to\n provide your own form of lookup. For example, if you want to discover your\n element using a CSS class name instead of an ID.\n\n @method findElementInParentElement\n @param {DOMElement} parentElement The parent's DOM element\n @return {DOMElement} The discovered element\n */\n findElementInParentElement: function(parentElem) {\n var id = \"#\" + this.elementId;\n return Ember.$(id)[0] || Ember.$(id, parentElem)[0];\n },\n\n /**\n Creates a DOM representation of the view and all of its\n child views by recursively calling the `render()` method.\n\n After the element has been created, `didInsertElement` will\n be called on this view and all of its child views.\n\n @method createElement\n @return {Ember.View} receiver\n */\n createElement: function() {\n if (get(this, 'element')) { return this; }\n\n var buffer = this.renderToBuffer();\n set(this, 'element', buffer.element());\n\n return this;\n },\n\n /**\n Called when a view is going to insert an element into the DOM.\n\n @event willInsertElement\n */\n willInsertElement: Ember.K,\n\n /**\n Called when the element of the view has been inserted into the DOM\n or after the view was re-rendered. Override this function to do any\n set up that requires an element in the document body.\n\n @event didInsertElement\n */\n didInsertElement: Ember.K,\n\n /**\n Called when the view is about to rerender, but before anything has\n been torn down. This is a good opportunity to tear down any manual\n observers you have installed based on the DOM state\n\n @event willClearRender\n */\n willClearRender: Ember.K,\n\n /**\n @private\n\n Run this callback on the current view (unless includeSelf is false) and recursively on child views.\n\n @method invokeRecursively\n @param fn {Function}\n @param includeSelf (optional, default true)\n */\n invokeRecursively: function(fn, includeSelf) {\n var childViews = (includeSelf === false) ? this._childViews : [this];\n var currentViews, view, currentChildViews;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n currentChildViews = view._childViews ? view._childViews.slice(0) : null;\n fn(view);\n if (currentChildViews) {\n childViews.push.apply(childViews, currentChildViews);\n }\n }\n }\n },\n\n triggerRecursively: function(eventName) {\n var childViews = [this], currentViews, view, currentChildViews;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n currentChildViews = view._childViews ? view._childViews.slice(0) : null;\n if (view.trigger) { view.trigger(eventName); }\n if (currentChildViews) {\n childViews.push.apply(childViews, currentChildViews);\n }\n\n }\n }\n },\n\n viewHierarchyCollection: function() {\n var currentView, viewCollection = new ViewCollection([this]);\n\n for (var i = 0; i < viewCollection.length; i++) {\n currentView = viewCollection.objectAt(i);\n if (currentView._childViews) {\n viewCollection.push.apply(viewCollection, currentView._childViews);\n }\n }\n\n return viewCollection;\n },\n\n /**\n Destroys any existing element along with the element for any child views\n as well. If the view does not currently have a element, then this method\n will do nothing.\n\n If you implement `willDestroyElement()` on your view, then this method will\n be invoked on your view before your element is destroyed to give you a\n chance to clean up any event handlers, etc.\n\n If you write a `willDestroyElement()` handler, you can assume that your\n `didInsertElement()` handler was called earlier for the same element.\n\n You should not call or override this method yourself, but you may\n want to implement the above callbacks.\n\n @method destroyElement\n @return {Ember.View} receiver\n */\n destroyElement: function() {\n return this.currentState.destroyElement(this);\n },\n\n /**\n Called when the element of the view is going to be destroyed. Override\n this function to do any teardown that requires an element, like removing\n event listeners.\n\n @event willDestroyElement\n */\n willDestroyElement: Ember.K,\n\n /**\n @private\n\n Triggers the `willDestroyElement` event (which invokes the\n `willDestroyElement()` method if it exists) on this view and all child\n views.\n\n Before triggering `willDestroyElement`, it first triggers the\n `willClearRender` event recursively.\n\n @method _notifyWillDestroyElement\n */\n _notifyWillDestroyElement: function() {\n var viewCollection = this.viewHierarchyCollection();\n viewCollection.trigger('willClearRender');\n viewCollection.trigger('willDestroyElement');\n return viewCollection;\n },\n\n /**\n @private\n\n If this view's element changes, we need to invalidate the caches of our\n child views so that we do not retain references to DOM elements that are\n no longer needed.\n\n @method _elementDidChange\n */\n _elementDidChange: Ember.observer('element', function() {\n this.forEachChildView(function(view) {\n delete meta(view).cache.element;\n });\n }),\n\n /**\n Called when the parentView property has changed.\n\n @event parentViewDidChange\n */\n parentViewDidChange: Ember.K,\n\n instrumentName: 'view',\n\n instrumentDetails: function(hash) {\n hash.template = get(this, 'templateName');\n this._super(hash);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n this.lengthBeforeRender = this._childViews.length;\n var buffer = this._super(parentBuffer, bufferOperation);\n this.lengthAfterRender = this._childViews.length;\n\n return buffer;\n },\n\n renderToBufferIfNeeded: function (buffer) {\n return this.currentState.renderToBufferIfNeeded(this, buffer);\n },\n\n beforeRender: function(buffer) {\n this.applyAttributesToBuffer(buffer);\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n },\n\n applyAttributesToBuffer: function(buffer) {\n // Creates observers for all registered class name and attribute bindings,\n // then adds them to the element.\n var classNameBindings = get(this, 'classNameBindings');\n if (classNameBindings.length) {\n this._applyClassNameBindings(classNameBindings);\n }\n\n // Pass the render buffer so the method can apply attributes directly.\n // This isn't needed for class name bindings because they use the\n // existing classNames infrastructure.\n var attributeBindings = get(this, 'attributeBindings');\n if (attributeBindings.length) {\n this._applyAttributeBindings(buffer, attributeBindings);\n }\n\n buffer.setClasses(this.classNames);\n buffer.id(this.elementId);\n\n var role = get(this, 'ariaRole');\n if (role) {\n buffer.attr('role', role);\n }\n\n if (get(this, 'isVisible') === false) {\n buffer.style('display', 'none');\n }\n },\n\n // ..........................................................\n // STANDARD RENDER PROPERTIES\n //\n\n /**\n Tag name for the view's outer element. The tag name is only used when an\n element is first created. If you change the `tagName` for an element, you\n must destroy and recreate the view element.\n\n By default, the render buffer will use a `<div>` tag for views.\n\n @property tagName\n @type String\n @default null\n */\n\n // We leave this null by default so we can tell the difference between\n // the default case and a user-specified tag.\n tagName: null,\n\n /**\n The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.\n\n The full list of valid WAI-ARIA roles is available at:\n [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization)\n\n @property ariaRole\n @type String\n @default null\n */\n ariaRole: null,\n\n /**\n Standard CSS class names to apply to the view's outer element. This\n property automatically inherits any class names defined by the view's\n superclasses as well.\n\n @property classNames\n @type Array\n @default ['ember-view']\n */\n classNames: ['ember-view'],\n\n /**\n A list of properties of the view to apply as class names. If the property\n is a string value, the value of that string will be applied as a class\n name.\n\n ```javascript\n // Applies the 'high' class to the view element\n Ember.View.extend({\n classNameBindings: ['priority']\n priority: 'high'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as a dasherized class name.\n\n ```javascript\n // Applies the 'is-urgent' class to the view element\n Ember.View.extend({\n classNameBindings: ['isUrgent']\n isUrgent: true\n });\n ```\n\n If you would prefer to use a custom value instead of the dasherized\n property name, you can pass a binding like this:\n\n ```javascript\n // Applies the 'urgent' class to the view element\n Ember.View.extend({\n classNameBindings: ['isUrgent:urgent']\n isUrgent: true\n });\n ```\n\n This list of properties is inherited from the view's superclasses as well.\n\n @property classNameBindings\n @type Array\n @default []\n */\n classNameBindings: EMPTY_ARRAY,\n\n /**\n A list of properties of the view to apply as attributes. If the property is\n a string value, the value of that string will be applied as the attribute.\n\n ```javascript\n // Applies the type attribute to the element\n // with the value \"button\", like <div type=\"button\">\n Ember.View.extend({\n attributeBindings: ['type'],\n type: 'button'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as an attribute.\n\n ```javascript\n // Renders something like <div enabled=\"enabled\">\n Ember.View.extend({\n attributeBindings: ['enabled'],\n enabled: true\n });\n ```\n\n @property attributeBindings\n */\n attributeBindings: EMPTY_ARRAY,\n\n // .......................................................\n // CORE DISPLAY METHODS\n //\n\n /**\n @private\n\n Setup a view, but do not finish waking it up.\n - configure `childViews`\n - register the view with the global views hash, which is used for event\n dispatch\n\n @method init\n */\n init: function() {\n this.elementId = this.elementId || guidFor(this);\n\n this._super();\n\n // setup child views. be sure to clone the child views array first\n this._childViews = this._childViews.slice();\n\n Ember.assert(\"Only arrays are allowed for 'classNameBindings'\", Ember.typeOf(this.classNameBindings) === 'array');\n this.classNameBindings = Ember.A(this.classNameBindings.slice());\n\n Ember.assert(\"Only arrays are allowed for 'classNames'\", Ember.typeOf(this.classNames) === 'array');\n this.classNames = Ember.A(this.classNames.slice());\n },\n\n appendChild: function(view, options) {\n return this.currentState.appendChild(this, view, options);\n },\n\n /**\n Removes the child view from the parent view.\n\n @method removeChild\n @param {Ember.View} view\n @return {Ember.View} receiver\n */\n removeChild: function(view) {\n // If we're destroying, the entire subtree will be\n // freed, and the DOM will be handled separately,\n // so no need to mess with childViews.\n if (this.isDestroying) { return; }\n\n // update parent node\n set(view, '_parentView', null);\n\n // remove view from childViews array.\n var childViews = this._childViews;\n\n Ember.EnumerableUtils.removeObject(childViews, view);\n\n this.propertyDidChange('childViews'); // HUH?! what happened to will change?\n\n return this;\n },\n\n /**\n Removes all children from the `parentView`.\n\n @method removeAllChildren\n @return {Ember.View} receiver\n */\n removeAllChildren: function() {\n return this.mutateChildViews(function(parentView, view) {\n parentView.removeChild(view);\n });\n },\n\n destroyAllChildren: function() {\n return this.mutateChildViews(function(parentView, view) {\n view.destroy();\n });\n },\n\n /**\n Removes the view from its `parentView`, if one is found. Otherwise\n does nothing.\n\n @method removeFromParent\n @return {Ember.View} receiver\n */\n removeFromParent: function() {\n var parent = this._parentView;\n\n // Remove DOM element from parent\n this.remove();\n\n if (parent) { parent.removeChild(this); }\n return this;\n },\n\n /**\n You must call `destroy` on a view to destroy the view (and all of its\n child views). This will remove the view from any parent node, then make\n sure that the DOM element managed by the view can be released by the\n memory manager.\n\n @method destroy\n */\n destroy: function() {\n var childViews = this._childViews,\n // get parentView before calling super because it'll be destroyed\n nonVirtualParentView = get(this, 'parentView'),\n viewName = this.viewName,\n childLen, i;\n\n if (!this._super()) { return; }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].removedFromDOM = true;\n }\n\n // remove from non-virtual parent view if viewName was specified\n if (viewName && nonVirtualParentView) {\n nonVirtualParentView.set(viewName, null);\n }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].destroy();\n }\n\n return this;\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n @method createChildView\n @param {Class|String} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n if (!view) {\n throw new TypeError(\"createChildViews first argument must exist\");\n }\n\n if (view.isView && view._parentView === this && view.container === this.container) {\n return view;\n }\n\n attrs = attrs || {};\n attrs._parentView = this;\n\n if (Ember.CoreView.detect(view)) {\n attrs.templateData = attrs.templateData || get(this, 'templateData');\n\n attrs.container = this.container;\n view = view.create(attrs);\n\n // don't set the property on a virtual view, as they are invisible to\n // consumers of the view API\n if (view.viewName) {\n set(get(this, 'concreteView'), view.viewName, view);\n }\n } else if ('string' === typeof view) {\n var fullName = 'view:' + view;\n var View = this.container.lookupFactory(fullName);\n\n Ember.assert(\"Could not find view: '\" + fullName + \"'\", !!View);\n\n attrs.templateData = get(this, 'templateData');\n view = View.create(attrs);\n } else {\n Ember.assert('You must pass instance or subclass of View', view.isView);\n attrs.container = this.container;\n\n if (!get(view, 'templateData')) {\n attrs.templateData = get(this, 'templateData');\n }\n\n Ember.setProperties(view, attrs);\n\n }\n\n return view;\n },\n\n becameVisible: Ember.K,\n becameHidden: Ember.K,\n\n /**\n @private\n\n When the view's `isVisible` property changes, toggle the visibility\n element of the actual DOM element.\n\n @method _isVisibleDidChange\n */\n _isVisibleDidChange: Ember.observer('isVisible', function() {\n var $el = this.$();\n if (!$el) { return; }\n\n var isVisible = get(this, 'isVisible');\n\n $el.toggle(isVisible);\n\n if (this._isAncestorHidden()) { return; }\n\n if (isVisible) {\n this._notifyBecameVisible();\n } else {\n this._notifyBecameHidden();\n }\n }),\n\n _notifyBecameVisible: function() {\n this.trigger('becameVisible');\n\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameVisible();\n }\n });\n },\n\n _notifyBecameHidden: function() {\n this.trigger('becameHidden');\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameHidden();\n }\n });\n },\n\n _isAncestorHidden: function() {\n var parent = get(this, 'parentView');\n\n while (parent) {\n if (get(parent, 'isVisible') === false) { return true; }\n\n parent = get(parent, 'parentView');\n }\n\n return false;\n },\n\n clearBuffer: function() {\n this.invokeRecursively(function(view) {\n view.buffer = null;\n });\n },\n\n transitionTo: function(state, children) {\n var priorState = this.currentState,\n currentState = this.currentState = this.states[state];\n this.state = state;\n\n if (priorState && priorState.exit) { priorState.exit(this); }\n if (currentState.enter) { currentState.enter(this); }\n if (state === 'inDOM') { delete Ember.meta(this).cache.element; }\n\n if (children !== false) {\n this.forEachChildView(function(view) {\n view.transitionTo(state);\n });\n }\n },\n\n // .......................................................\n // EVENT HANDLING\n //\n\n /**\n @private\n\n Handle events from `Ember.EventDispatcher`\n\n @method handleEvent\n @param eventName {String}\n @param evt {Event}\n */\n handleEvent: function(eventName, evt) {\n return this.currentState.handleEvent(this, eventName, evt);\n },\n\n registerObserver: function(root, path, target, observer) {\n if (!observer && 'function' === typeof target) {\n observer = target;\n target = null;\n }\n\n if (!root || typeof root !== 'object') {\n return;\n }\n\n var view = this,\n stateCheckedObserver = function() {\n view.currentState.invokeObserver(this, observer);\n },\n scheduledObserver = function() {\n Ember.run.scheduleOnce('render', this, stateCheckedObserver);\n };\n\n Ember.addObserver(root, path, target, scheduledObserver);\n\n this.one('willClearRender', function() {\n Ember.removeObserver(root, path, target, scheduledObserver);\n });\n }\n\n});\n\n/*\n Describe how the specified actions should behave in the various\n states that a view can exist in. Possible states:\n\n * preRender: when a view is first instantiated, and after its\n element was destroyed, it is in the preRender state\n * inBuffer: once a view has been rendered, but before it has\n been inserted into the DOM, it is in the inBuffer state\n * inDOM: once a view has been inserted into the DOM it is in\n the inDOM state. A view spends the vast majority of its\n existence in this state.\n * destroyed: once a view has been destroyed (using the destroy\n method), it is in this state. No further actions can be invoked\n on a destroyed view.\n*/\n\n // in the destroyed state, everything is illegal\n\n // before rendering has begun, all legal manipulations are noops.\n\n // inside the buffer, legal manipulations are done on the buffer\n\n // once the view has been inserted into the DOM, legal manipulations\n // are done on the DOM element.\n\nfunction notifyMutationListeners() {\n Ember.run.once(Ember.View, 'notifyMutationListeners');\n}\n\nvar DOMManager = {\n prepend: function(view, html) {\n view.$().prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.$().after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.$().html(html);\n notifyMutationListeners();\n },\n\n replace: function(view) {\n var element = get(view, 'element');\n\n set(view, 'element', null);\n\n view._insertElementLater(function() {\n Ember.$(element).replaceWith(get(view, 'element'));\n notifyMutationListeners();\n });\n },\n\n remove: function(view) {\n view.$().remove();\n notifyMutationListeners();\n },\n\n empty: function(view) {\n view.$().empty();\n notifyMutationListeners();\n }\n};\n\nEmber.View.reopen({\n domManager: DOMManager\n});\n\nEmber.View.reopenClass({\n\n /**\n @private\n\n Parse a path and return an object which holds the parsed properties.\n\n For example a path like \"content.isEnabled:enabled:disabled\" will return the\n following object:\n\n ```javascript\n {\n path: \"content.isEnabled\",\n className: \"enabled\",\n falsyClassName: \"disabled\",\n classNames: \":enabled:disabled\"\n }\n ```\n\n @method _parsePropertyPath\n @static\n */\n _parsePropertyPath: function(path) {\n var split = path.split(':'),\n propertyPath = split[0],\n classNames = \"\",\n className,\n falsyClassName;\n\n // check if the property is defined as prop:class or prop:trueClass:falseClass\n if (split.length > 1) {\n className = split[1];\n if (split.length === 3) { falsyClassName = split[2]; }\n\n classNames = ':' + className;\n if (falsyClassName) { classNames += \":\" + falsyClassName; }\n }\n\n return {\n path: propertyPath,\n classNames: classNames,\n className: (className === '') ? undefined : className,\n falsyClassName: falsyClassName\n };\n },\n\n /**\n @private\n\n Get the class name for a given value, based on the path, optional\n `className` and optional `falsyClassName`.\n\n - if a `className` or `falsyClassName` has been specified:\n - if the value is truthy and `className` has been specified,\n `className` is returned\n - if the value is falsy and `falsyClassName` has been specified,\n `falsyClassName` is returned\n - otherwise `null` is returned\n - if the value is `true`, the dasherized last part of the supplied path\n is returned\n - if the value is not `false`, `undefined` or `null`, the `value`\n is returned\n - if none of the above rules apply, `null` is returned\n\n @method _classStringForValue\n @param path\n @param val\n @param className\n @param falsyClassName\n @static\n */\n _classStringForValue: function(path, val, className, falsyClassName) {\n // When using the colon syntax, evaluate the truthiness or falsiness\n // of the value to determine which className to return\n if (className || falsyClassName) {\n if (className && !!val) {\n return className;\n\n } else if (falsyClassName && !val) {\n return falsyClassName;\n\n } else {\n return null;\n }\n\n // If value is a Boolean and true, return the dasherized property\n // name.\n } else if (val === true) {\n // Normalize property path to be suitable for use\n // as a class name. For exaple, content.foo.barBaz\n // becomes bar-baz.\n var parts = path.split('.');\n return Ember.String.dasherize(parts[parts.length-1]);\n\n // If the value is not false, undefined, or null, return the current\n // value of the property.\n } else if (val !== false && val != null) {\n return val;\n\n // Nothing to display. Return null so that the old class is removed\n // but no new class is added.\n } else {\n return null;\n }\n }\n});\n\nvar mutation = Ember.Object.extend(Ember.Evented).create();\n\nEmber.View.addMutationListener = function(callback) {\n mutation.on('change', callback);\n};\n\nEmber.View.removeMutationListener = function(callback) {\n mutation.off('change', callback);\n};\n\nEmber.View.notifyMutationListeners = function() {\n mutation.trigger('change');\n};\n\n/**\n Global views hash\n\n @property views\n @static\n @type Hash\n*/\nEmber.View.views = {};\n\n// If someone overrides the child views computed property when\n// defining their class, we want to be able to process the user's\n// supplied childViews and then restore the original computed property\n// at view initialization time. This happens in Ember.ContainerView's init\n// method.\nEmber.View.childViewsProperty = childViewsProperty;\n\nEmber.View.applyAttributeBindings = function(elem, name, value) {\n var type = Ember.typeOf(value);\n\n // if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js\n if (name !== 'value' && (type === 'string' || (type === 'number' && !isNaN(value)))) {\n if (value !== elem.attr(name)) {\n elem.attr(name, value);\n }\n } else if (name === 'value' || type === 'boolean') {\n // We can't set properties to undefined or null\n if (Ember.isNone(value)) { value = ''; }\n\n if (value !== elem.prop(name)) {\n // value and booleans should always be properties\n elem.prop(name, value);\n }\n } else if (!value) {\n elem.removeAttr(name);\n }\n};\n\nEmber.View.states = states;\n\n})();\n//@ sourceURL=ember-views/views/view");minispade.register('ember', "(function() {minispade.require('ember-application');\n\n/**\nEmber\n\n@module ember\n*/\n\nfunction throwWithMessage(msg) {\n return function() {\n throw new Ember.Error(msg);\n };\n}\n\nfunction generateRemovedClass(className) {\n var msg = \" has been moved into a plugin: https://github.com/emberjs/ember-states\";\n\n return {\n extend: throwWithMessage(className + msg),\n create: throwWithMessage(className + msg)\n };\n}\n\nEmber.StateManager = generateRemovedClass(\"Ember.StateManager\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n \n @class StateManager\n @namespace Ember\n*/\n\nEmber.State = generateRemovedClass(\"Ember.State\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n \n @class State\n @namespace Ember\n*/\n\n})();\n//@ sourceURL=ember");minispade.register('loader', "(function() {var define, requireModule;\n\n(function() {\n var registry = {}, seen = {};\n\n define = function(name, deps, callback) {\n registry[name] = { deps: deps, callback: callback };\n };\n\n requireModule = function(name) {\n if (seen[name]) { return seen[name]; }\n seen[name] = {};\n\n var mod, deps, callback, reified, exports;\n\n mod = registry[name];\n\n if (!mod) {\n throw new Error(\"Module '\" + name + \"' not found.\");\n }\n\n deps = mod.deps;\n callback = mod.callback;\n reified = [];\n\n for (var i=0, l=deps.length; i<l; i++) {\n if (deps[i] === 'exports') {\n reified.push(exports = {});\n } else {\n reified.push(requireModule(deps[i]));\n }\n }\n\n var value = callback.apply(this, reified);\n return seen[name] = exports || value;\n };\n})();\n\n})();\n//@ sourceURL=loader");minispade.register('metamorph', "(function() {define(\"metamorph\",\n [],\n function() {\n \"use strict\";\n // ==========================================================================\n // Project: metamorph\n // Copyright: ©2011 My Company Inc. All rights reserved.\n // ==========================================================================\n\n var K = function() {},\n guid = 0,\n document = this.document,\n disableRange = ('undefined' === typeof ENV ? {} : ENV).DISABLE_RANGE_API,\n\n // Feature-detect the W3C range API, the extended check is for IE9 which only partially supports ranges\n supportsRange = (!disableRange) && document && ('createRange' in document) && (typeof Range !== 'undefined') && Range.prototype.createContextualFragment,\n\n // Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n // is a \"zero-scope\" element. This problem can be worked around by making\n // the first node an invisible text node. We, like Modernizr, use ­\n needsShy = document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n })(),\n\n\n // IE 8 (and likely earlier) likes to move whitespace preceeding\n // a script tag to appear after it. This means that we can\n // accidentally remove whitespace when updating a morph.\n movesWhitespace = document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n })();\n\n // Constructor that supports either Metamorph('foo') or new\n // Metamorph('foo');\n //\n // Takes a string of HTML as the argument.\n\n var Metamorph = function(html) {\n var self;\n\n if (this instanceof Metamorph) {\n self = this;\n } else {\n self = new K();\n }\n\n self.innerHTML = html;\n var myGuid = 'metamorph-'+(guid++);\n self.start = myGuid + '-start';\n self.end = myGuid + '-end';\n\n return self;\n };\n\n K.prototype = Metamorph.prototype;\n\n var rangeFor, htmlFunc, removeFunc, outerHTMLFunc, appendToFunc, afterFunc, prependFunc, startTagFunc, endTagFunc;\n\n outerHTMLFunc = function() {\n return this.startTag() + this.innerHTML + this.endTag();\n };\n\n startTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.start + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n endTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.end + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n // If we have the W3C range API, this process is relatively straight forward.\n if (supportsRange) {\n\n // Get a range for the current morph. Optionally include the starting and\n // ending placeholders.\n rangeFor = function(morph, outerToo) {\n var range = document.createRange();\n var before = document.getElementById(morph.start);\n var after = document.getElementById(morph.end);\n\n if (outerToo) {\n range.setStartBefore(before);\n range.setEndAfter(after);\n } else {\n range.setStartAfter(before);\n range.setEndBefore(after);\n }\n\n return range;\n };\n\n htmlFunc = function(html, outerToo) {\n // get a range for the current metamorph object\n var range = rangeFor(this, outerToo);\n\n // delete the contents of the range, which will be the\n // nodes between the starting and ending placeholder.\n range.deleteContents();\n\n // create a new document fragment for the HTML\n var fragment = range.createContextualFragment(html);\n\n // insert the fragment into the range\n range.insertNode(fragment);\n };\n\n /**\n * @public\n * \n * Remove this object (including starting and ending\n * placeholders).\n *\n * @method remove\n */\n removeFunc = function() {\n // get a range for the current metamorph object including\n // the starting and ending placeholders.\n var range = rangeFor(this, true);\n\n // delete the entire range.\n range.deleteContents();\n };\n\n appendToFunc = function(node) {\n var range = document.createRange();\n range.setStart(node);\n range.collapse(false);\n var frag = range.createContextualFragment(this.outerHTML());\n node.appendChild(frag);\n };\n\n afterFunc = function(html) {\n var range = document.createRange();\n var after = document.getElementById(this.end);\n\n range.setStartAfter(after);\n range.setEndAfter(after);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n prependFunc = function(html) {\n var range = document.createRange();\n var start = document.getElementById(this.start);\n\n range.setStartAfter(start);\n range.setEndAfter(start);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n } else {\n /*\n * This code is mostly taken from jQuery, with one exception. In jQuery's case, we\n * have some HTML and we need to figure out how to convert it into some nodes.\n *\n * In this case, jQuery needs to scan the HTML looking for an opening tag and use\n * that as the key for the wrap map. In our case, we know the parent node, and\n * can use its type as the key for the wrap map.\n **/\n var wrapMap = {\n select: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n fieldset: [ 1, \"<fieldset>\", \"</fieldset>\" ],\n table: [ 1, \"<table>\", \"</table>\" ],\n tbody: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n tr: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n colgroup: [ 2, \"<table><tbody></tbody><colgroup>\", \"</colgroup></table>\" ],\n map: [ 1, \"<map>\", \"</map>\" ],\n _default: [ 0, \"\", \"\" ]\n };\n\n var findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n };\n\n var setInnerHTML = function(element, html) {\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n };\n\n /*\n * Given a parent node and some HTML, generate a set of nodes. Return the first\n * node, which will allow us to traverse the rest using nextSibling.\n *\n * We need to do this because innerHTML in IE does not really parse the nodes.\n */\n var firstNodeFor = function(parentNode, html) {\n var arr = wrapMap[parentNode.tagName.toLowerCase()] || wrapMap._default;\n var depth = arr[0], start = arr[1], end = arr[2];\n\n if (needsShy) { html = '­'+html; }\n\n var element = document.createElement('div');\n\n setInnerHTML(element, start + html + end);\n\n for (var i=0; i<=depth; i++) {\n element = element.firstChild;\n }\n\n // Look for ­ to remove it.\n if (needsShy) {\n var shyElement = element;\n\n // Sometimes we get nameless elements with the shy inside\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n\n // At this point it's the actual unicode character.\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n\n return element;\n };\n\n /*\n * In some cases, Internet Explorer can create an anonymous node in\n * the hierarchy with no tagName. You can create this scenario via:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table>­<script></script><tr><td>hi</td></tr></table>\";\n * div.firstChild.firstChild.tagName //=> \"\"\n *\n * If our script markers are inside such a node, we need to find that\n * node and use *it* as the marker.\n */\n var realNode = function(start) {\n while (start.parentNode.tagName === \"\") {\n start = start.parentNode;\n }\n\n return start;\n };\n\n /*\n * When automatically adding a tbody, Internet Explorer inserts the\n * tbody immediately before the first <tr>. Other browsers create it\n * before the first node, no matter what.\n *\n * This means the the following code:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table><script id='first'></script><tr><td>hi</td></tr><script id='last'></script></table>\n *\n * Generates the following DOM in IE:\n *\n * + div\n * + table\n * - script id='first'\n * + tbody\n * + tr\n * + td\n * - \"hi\"\n * - script id='last'\n *\n * Which means that the two script tags, even though they were\n * inserted at the same point in the hierarchy in the original\n * HTML, now have different parents.\n *\n * This code reparents the first script tag by making it the tbody's\n * first child.\n *\n */\n var fixParentage = function(start, end) {\n if (start.parentNode !== end.parentNode) {\n end.parentNode.insertBefore(start, end.parentNode.firstChild);\n }\n };\n\n htmlFunc = function(html, outerToo) {\n // get the real starting node. see realNode for details.\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n var parentNode = end.parentNode;\n var node, nextSibling, last;\n\n // make sure that the start and end nodes share the same\n // parent. If not, fix it.\n fixParentage(start, end);\n\n // remove all of the nodes after the starting placeholder and\n // before the ending placeholder.\n node = start.nextSibling;\n while (node) {\n nextSibling = node.nextSibling;\n last = node === end;\n\n // if this is the last node, and we want to remove it as well,\n // set the `end` node to the next sibling. This is because\n // for the rest of the function, we insert the new nodes\n // before the end (note that insertBefore(node, null) is\n // the same as appendChild(node)).\n //\n // if we do not want to remove it, just break.\n if (last) {\n if (outerToo) { end = node.nextSibling; } else { break; }\n }\n\n node.parentNode.removeChild(node);\n\n // if this is the last node and we didn't break before\n // (because we wanted to remove the outer nodes), break\n // now.\n if (last) { break; }\n\n node = nextSibling;\n }\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(start.parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, end);\n node = nextSibling;\n }\n };\n\n // remove the nodes in the DOM representing this metamorph.\n //\n // this includes the starting and ending placeholders.\n removeFunc = function() {\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n\n this.html('');\n start.parentNode.removeChild(start);\n end.parentNode.removeChild(end);\n };\n\n appendToFunc = function(parentNode) {\n var node = firstNodeFor(parentNode, this.outerHTML());\n var nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.appendChild(node);\n node = nextSibling;\n }\n };\n\n afterFunc = function(html) {\n // get the real starting node. see realNode for details.\n var end = document.getElementById(this.end);\n var insertBefore = end.nextSibling;\n var parentNode = end.parentNode;\n var nextSibling;\n var node;\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n\n prependFunc = function(html) {\n var start = document.getElementById(this.start);\n var parentNode = start.parentNode;\n var nextSibling;\n var node;\n\n node = firstNodeFor(parentNode, html);\n var insertBefore = start.nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n }\n\n Metamorph.prototype.html = function(html) {\n this.checkRemoved();\n if (html === undefined) { return this.innerHTML; }\n\n htmlFunc.call(this, html);\n\n this.innerHTML = html;\n };\n\n Metamorph.prototype.replaceWith = function(html) {\n this.checkRemoved();\n htmlFunc.call(this, html, true);\n };\n\n Metamorph.prototype.remove = removeFunc;\n Metamorph.prototype.outerHTML = outerHTMLFunc;\n Metamorph.prototype.appendTo = appendToFunc;\n Metamorph.prototype.after = afterFunc;\n Metamorph.prototype.prepend = prependFunc;\n Metamorph.prototype.startTag = startTagFunc;\n Metamorph.prototype.endTag = endTagFunc;\n\n Metamorph.prototype.isRemoved = function() {\n var before = document.getElementById(this.start);\n var after = document.getElementById(this.end);\n\n return !before || !after;\n };\n\n Metamorph.prototype.checkRemoved = function() {\n if (this.isRemoved()) {\n throw new Error(\"Cannot perform operations on a Metamorph that is not in the DOM.\");\n }\n };\n\n return Metamorph;\n });\n\n})();\n//@ sourceURL=metamorph");minispade.register('rsvp', "(function() {define(\"rsvp/all\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n /* global toString */\n\n\n function all(promises) {\n if (Object.prototype.toString.call(promises) !== \"[object Array]\") {\n throw new TypeError('You must pass an array to all.');\n }\n\n return new Promise(function(resolve, reject) {\n var results = [], remaining = promises.length,\n promise;\n\n if (remaining === 0) {\n resolve([]);\n }\n\n function resolver(index) {\n return function(value) {\n resolveAll(index, value);\n };\n }\n\n function resolveAll(index, value) {\n results[index] = value;\n if (--remaining === 0) {\n resolve(results);\n }\n }\n\n for (var i = 0; i < promises.length; i++) {\n promise = promises[i];\n\n if (promise && typeof promise.then === 'function') {\n promise.then(resolver(i), reject);\n } else {\n resolveAll(i, promise);\n }\n }\n });\n }\n\n\n __exports__.all = all;\n });\ndefine(\"rsvp/async\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var browserGlobal = (typeof window !== 'undefined') ? window : {};\n var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n var async;\n var local = (typeof global !== 'undefined') ? global : this;\n\n // old node\n function useNextTick() {\n return function(callback, arg) {\n process.nextTick(function() {\n callback(arg);\n });\n };\n }\n\n // node >= 0.10.x\n function useSetImmediate() {\n return function(callback, arg) {\n /* global setImmediate */\n setImmediate(function(){\n callback(arg);\n });\n };\n }\n\n function useMutationObserver() {\n var queue = [];\n\n var observer = new BrowserMutationObserver(function() {\n var toProcess = queue.slice();\n queue = [];\n\n toProcess.forEach(function(tuple) {\n var callback = tuple[0], arg= tuple[1];\n callback(arg);\n });\n });\n\n var element = document.createElement('div');\n observer.observe(element, { attributes: true });\n\n // Chrome Memory Leak: https://bugs.webkit.org/show_bug.cgi?id=93661\n window.addEventListener('unload', function(){\n observer.disconnect();\n observer = null;\n }, false);\n\n return function(callback, arg) {\n queue.push([callback, arg]);\n element.setAttribute('drainQueue', 'drainQueue');\n };\n }\n\n function useSetTimeout() {\n return function(callback, arg) {\n local.setTimeout(function() {\n callback(arg);\n }, 1);\n };\n }\n\n if (typeof setImmediate === 'function') {\n async = useSetImmediate();\n } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {\n async = useNextTick();\n } else if (BrowserMutationObserver) {\n async = useMutationObserver();\n } else {\n async = useSetTimeout();\n }\n\n\n __exports__.async = async;\n });\ndefine(\"rsvp/config\",\n [\"rsvp/async\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var async = __dependency1__.async;\n\n var config = {};\n config.async = async;\n\n\n __exports__.config = config;\n });\ndefine(\"rsvp/defer\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n function defer() {\n var deferred = {\n // pre-allocate shape\n resolve: undefined,\n reject: undefined,\n promise: undefined\n };\n\n deferred.promise = new Promise(function(resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n\n return deferred;\n }\n\n\n __exports__.defer = defer;\n });\ndefine(\"rsvp/events\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var Event = function(type, options) {\n this.type = type;\n\n for (var option in options) {\n if (!options.hasOwnProperty(option)) { continue; }\n\n this[option] = options[option];\n }\n };\n\n var indexOf = function(callbacks, callback) {\n for (var i=0, l=callbacks.length; i<l; i++) {\n if (callbacks[i][0] === callback) { return i; }\n }\n\n return -1;\n };\n\n var callbacksFor = function(object) {\n var callbacks = object._promiseCallbacks;\n\n if (!callbacks) {\n callbacks = object._promiseCallbacks = {};\n }\n\n return callbacks;\n };\n\n var EventTarget = {\n mixin: function(object) {\n object.on = this.on;\n object.off = this.off;\n object.trigger = this.trigger;\n return object;\n },\n\n on: function(eventNames, callback, binding) {\n var allCallbacks = callbacksFor(this), callbacks, eventName;\n eventNames = eventNames.split(/\\s+/);\n binding = binding || this;\n\n while (eventName = eventNames.shift()) {\n callbacks = allCallbacks[eventName];\n\n if (!callbacks) {\n callbacks = allCallbacks[eventName] = [];\n }\n\n if (indexOf(callbacks, callback) === -1) {\n callbacks.push([callback, binding]);\n }\n }\n },\n\n off: function(eventNames, callback) {\n var allCallbacks = callbacksFor(this), callbacks, eventName, index;\n eventNames = eventNames.split(/\\s+/);\n\n while (eventName = eventNames.shift()) {\n if (!callback) {\n allCallbacks[eventName] = [];\n continue;\n }\n\n callbacks = allCallbacks[eventName];\n\n index = indexOf(callbacks, callback);\n\n if (index !== -1) { callbacks.splice(index, 1); }\n }\n },\n\n trigger: function(eventName, options) {\n var allCallbacks = callbacksFor(this),\n callbacks, callbackTuple, callback, binding, event;\n\n if (callbacks = allCallbacks[eventName]) {\n // Don't cache the callbacks.length since it may grow\n for (var i=0; i<callbacks.length; i++) {\n callbackTuple = callbacks[i];\n callback = callbackTuple[0];\n binding = callbackTuple[1];\n\n if (typeof options !== 'object') {\n options = { detail: options };\n }\n\n event = new Event(eventName, options);\n callback.call(binding, event);\n }\n }\n }\n };\n\n\n __exports__.EventTarget = EventTarget;\n });\ndefine(\"rsvp/hash\",\n [\"rsvp/defer\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var defer = __dependency1__.defer;\n\n function size(object) {\n var s = 0;\n\n for (var prop in object) {\n s++;\n }\n\n return s;\n }\n\n function hash(promises) {\n var results = {}, deferred = defer(), remaining = size(promises);\n\n if (remaining === 0) {\n deferred.resolve({});\n }\n\n var resolver = function(prop) {\n return function(value) {\n resolveAll(prop, value);\n };\n };\n\n var resolveAll = function(prop, value) {\n results[prop] = value;\n if (--remaining === 0) {\n deferred.resolve(results);\n }\n };\n\n var rejectAll = function(error) {\n deferred.reject(error);\n };\n\n for (var prop in promises) {\n if (promises[prop] && typeof promises[prop].then === 'function') {\n promises[prop].then(resolver(prop), rejectAll);\n } else {\n resolveAll(prop, promises[prop]);\n }\n }\n\n return deferred.promise;\n }\n\n\n __exports__.hash = hash;\n });\ndefine(\"rsvp/node\",\n [\"rsvp/promise\",\"rsvp/all\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n var all = __dependency2__.all;\n\n function makeNodeCallbackFor(resolve, reject) {\n return function (error, value) {\n if (error) {\n reject(error);\n } else if (arguments.length > 2) {\n resolve(Array.prototype.slice.call(arguments, 1));\n } else {\n resolve(value);\n }\n };\n }\n\n function denodeify(nodeFunc) {\n return function() {\n var nodeArgs = Array.prototype.slice.call(arguments), resolve, reject;\n var thisArg = this;\n\n var promise = new Promise(function(nodeResolve, nodeReject) {\n resolve = nodeResolve;\n reject = nodeReject;\n });\n\n all(nodeArgs).then(function(nodeArgs) {\n nodeArgs.push(makeNodeCallbackFor(resolve, reject));\n\n try {\n nodeFunc.apply(thisArg, nodeArgs);\n } catch(e) {\n reject(e);\n }\n });\n\n return promise;\n };\n }\n\n\n __exports__.denodeify = denodeify;\n });\ndefine(\"rsvp/promise\",\n [\"rsvp/config\",\"rsvp/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var config = __dependency1__.config;\n var EventTarget = __dependency2__.EventTarget;\n\n function objectOrFunction(x) {\n return isFunction(x) || (typeof x === \"object\" && x !== null);\n }\n\n function isFunction(x){\n return typeof x === \"function\";\n }\n\n var Promise = function(resolver) {\n var promise = this,\n resolved = false;\n\n if (typeof resolver !== 'function') {\n throw new TypeError('You must pass a resolver function as the sole argument to the promise constructor');\n }\n\n if (!(promise instanceof Promise)) {\n return new Promise(resolver);\n }\n\n var resolvePromise = function(value) {\n if (resolved) { return; }\n resolved = true;\n resolve(promise, value);\n };\n\n var rejectPromise = function(value) {\n if (resolved) { return; }\n resolved = true;\n reject(promise, value);\n };\n\n this.on('promise:resolved', function(event) {\n this.trigger('success', { detail: event.detail });\n }, this);\n\n this.on('promise:failed', function(event) {\n this.trigger('error', { detail: event.detail });\n }, this);\n\n this.on('error', onerror);\n\n try {\n resolver(resolvePromise, rejectPromise);\n } catch(e) {\n rejectPromise(e);\n }\n };\n\n function onerror(event) {\n if (config.onerror) {\n config.onerror(event.detail);\n }\n }\n\n var invokeCallback = function(type, promise, callback, event) {\n var hasCallback = isFunction(callback),\n value, error, succeeded, failed;\n\n if (hasCallback) {\n try {\n value = callback(event.detail);\n succeeded = true;\n } catch(e) {\n failed = true;\n error = e;\n }\n } else {\n value = event.detail;\n succeeded = true;\n }\n\n if (handleThenable(promise, value)) {\n return;\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (failed) {\n reject(promise, error);\n } else if (type === 'resolve') {\n resolve(promise, value);\n } else if (type === 'reject') {\n reject(promise, value);\n }\n };\n\n Promise.prototype = {\n constructor: Promise,\n\n isRejected: undefined,\n isFulfilled: undefined,\n rejectedReason: undefined,\n fulfillmentValue: undefined,\n\n then: function(done, fail) {\n this.off('error', onerror);\n\n var thenPromise = new this.constructor(function() {});\n\n if (this.isFulfilled) {\n config.async(function(promise) {\n invokeCallback('resolve', thenPromise, done, { detail: promise.fulfillmentValue });\n }, this);\n }\n\n if (this.isRejected) {\n config.async(function(promise) {\n invokeCallback('reject', thenPromise, fail, { detail: promise.rejectedReason });\n }, this);\n }\n\n this.on('promise:resolved', function(event) {\n invokeCallback('resolve', thenPromise, done, event);\n });\n\n this.on('promise:failed', function(event) {\n invokeCallback('reject', thenPromise, fail, event);\n });\n\n return thenPromise;\n },\n\n fail: function(fail) {\n return this.then(null, fail);\n }\n };\n\n EventTarget.mixin(Promise.prototype);\n\n function resolve(promise, value) {\n if (promise === value) {\n fulfill(promise, value);\n } else if (!handleThenable(promise, value)) {\n fulfill(promise, value);\n }\n }\n\n function handleThenable(promise, value) {\n var then = null,\n resolved;\n\n try {\n if (promise === value) {\n throw new TypeError(\"A promises callback cannot return that same promise.\");\n }\n\n if (objectOrFunction(value)) {\n then = value.then;\n\n if (isFunction(then)) {\n then.call(value, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n if (value !== val) {\n resolve(promise, val);\n } else {\n fulfill(promise, val);\n }\n }, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n reject(promise, val);\n });\n\n return true;\n }\n }\n } catch (error) {\n reject(promise, error);\n return true;\n }\n\n return false;\n }\n\n function fulfill(promise, value) {\n config.async(function() {\n promise.trigger('promise:resolved', { detail: value });\n promise.isFulfilled = true;\n promise.fulfillmentValue = value;\n });\n }\n\n function reject(promise, value) {\n config.async(function() {\n promise.trigger('promise:failed', { detail: value });\n promise.isRejected = true;\n promise.rejectedReason = value;\n });\n }\n\n\n __exports__.Promise = Promise;\n });\ndefine(\"rsvp/reject\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n function reject(reason) {\n return new Promise(function (resolve, reject) {\n reject(reason);\n });\n }\n\n\n __exports__.reject = reject;\n });\ndefine(\"rsvp/resolve\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n function resolve(thenable) {\n return new Promise(function(resolve, reject) {\n resolve(thenable);\n });\n }\n\n\n __exports__.resolve = resolve;\n });\ndefine(\"rsvp/rethrow\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var local = (typeof global === \"undefined\") ? this : global;\n\n function rethrow(reason) {\n local.setTimeout(function() {\n throw reason;\n });\n throw reason;\n }\n\n\n __exports__.rethrow = rethrow;\n });\ndefine(\"rsvp\",\n [\"rsvp/events\",\"rsvp/promise\",\"rsvp/node\",\"rsvp/all\",\"rsvp/hash\",\"rsvp/rethrow\",\"rsvp/defer\",\"rsvp/config\",\"rsvp/resolve\",\"rsvp/reject\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n var EventTarget = __dependency1__.EventTarget;\n var Promise = __dependency2__.Promise;\n var denodeify = __dependency3__.denodeify;\n var all = __dependency4__.all;\n var hash = __dependency5__.hash;\n var rethrow = __dependency6__.rethrow;\n var defer = __dependency7__.defer;\n var config = __dependency8__.config;\n var resolve = __dependency9__.resolve;\n var reject = __dependency10__.reject;\n\n function configure(name, value) {\n config[name] = value;\n }\n\n\n __exports__.Promise = Promise;\n __exports__.EventTarget = EventTarget;\n __exports__.all = all;\n __exports__.hash = hash;\n __exports__.rethrow = rethrow;\n __exports__.defer = defer;\n __exports__.denodeify = denodeify;\n __exports__.configure = configure;\n __exports__.resolve = resolve;\n __exports__.reject = reject;\n });\n})();\n//@ sourceURL=rsvp");
+minispade.register('container', "(function() {/**\n@private\nPublic api for the container is still in flux.\nThe public api, specified on the application namespace should be considered the stable api.\n// @module container\n*/\n\n/*\n Flag to enable/disable model factory injections (disabled by default)\n If model factory injections are enabled, models should not be\n accessed globally (only through `container.lookupFactory('model:modelName'))`);\n*/\nEmber.MODEL_FACTORY_INJECTIONS = false || !!Ember.ENV.MODEL_FACTORY_INJECTIONS;\n\ndefine(\"container\",\n [],\n function() {\n\n // A safe and simple inheriting object.\n function InheritingDict(parent) {\n this.parent = parent;\n this.dict = {};\n }\n\n InheritingDict.prototype = {\n\n /**\n @property parent\n @type InheritingDict\n @default null\n */\n\n parent: null,\n\n /**\n Object used to store the current nodes data.\n\n @property dict\n @type Object\n @default Object\n */\n dict: null,\n\n /**\n Retrieve the value given a key, if the value is present at the current\n level use it, otherwise walk up the parent hierarchy and try again. If\n no matching key is found, return undefined.\n\n @method get\n @return {any}\n */\n get: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return dict[key];\n }\n\n if (this.parent) {\n return this.parent.get(key);\n }\n },\n\n /**\n Set the given value for the given key, at the current level.\n\n @method set\n @param {String} key\n @param {Any} value\n */\n set: function(key, value) {\n this.dict[key] = value;\n },\n\n /**\n Delete the given key\n\n @method remove\n @param {String} key\n */\n remove: function(key) {\n delete this.dict[key];\n },\n\n /**\n Check for the existence of given a key, if the key is present at the current\n level return true, otherwise walk up the parent hierarchy and try again. If\n no matching key is found, return false.\n\n @method has\n @param {String} key\n @return {Boolean}\n */\n has: function(key) {\n var dict = this.dict;\n\n if (dict.hasOwnProperty(key)) {\n return true;\n }\n\n if (this.parent) {\n return this.parent.has(key);\n }\n\n return false;\n },\n\n /**\n Iterate and invoke a callback for each local key-value pair.\n\n @method eachLocal\n @param {Function} callback\n @param {Object} binding\n */\n eachLocal: function(callback, binding) {\n var dict = this.dict;\n\n for (var prop in dict) {\n if (dict.hasOwnProperty(prop)) {\n callback.call(binding, prop, dict[prop]);\n }\n }\n }\n };\n\n\n // A lightweight container that helps to assemble and decouple components.\n // Public api for the container is still in flux.\n // The public api, specified on the application namespace should be considered the stable api.\n function Container(parent) {\n this.parent = parent;\n this.children = [];\n\n this.resolver = parent && parent.resolver || function() {};\n\n this.registry = new InheritingDict(parent && parent.registry);\n this.cache = new InheritingDict(parent && parent.cache);\n this.factoryCache = new InheritingDict(parent && parent.cache);\n this.typeInjections = new InheritingDict(parent && parent.typeInjections);\n this.injections = {};\n\n this.factoryTypeInjections = new InheritingDict(parent && parent.factoryTypeInjections);\n this.factoryInjections = {};\n\n this._options = new InheritingDict(parent && parent._options);\n this._typeOptions = new InheritingDict(parent && parent._typeOptions);\n }\n\n Container.prototype = {\n\n /**\n @property parent\n @type Container\n @default null\n */\n parent: null,\n\n /**\n @property children\n @type Array\n @default []\n */\n children: null,\n\n /**\n @property resolver\n @type function\n */\n resolver: null,\n\n /**\n @property registry\n @type InheritingDict\n */\n registry: null,\n\n /**\n @property cache\n @type InheritingDict\n */\n cache: null,\n\n /**\n @property typeInjections\n @type InheritingDict\n */\n typeInjections: null,\n\n /**\n @property injections\n @type Object\n @default {}\n */\n injections: null,\n\n /**\n @private\n\n @property _options\n @type InheritingDict\n @default null\n */\n _options: null,\n\n /**\n @private\n\n @property _typeOptions\n @type InheritingDict\n */\n _typeOptions: null,\n\n /**\n Returns a new child of the current container. These children are configured\n to correctly inherit from the current container.\n\n @method child\n @return {Container}\n */\n child: function() {\n var container = new Container(this);\n this.children.push(container);\n return container;\n },\n\n /**\n Sets a key-value pair on the current container. If a parent container,\n has the same key, once set on a child, the parent and child will diverge\n as expected.\n\n @method set\n @param {Object} object\n @param {String} key\n @param {any} value\n */\n set: function(object, key, value) {\n object[key] = value;\n },\n\n /**\n Registers a factory for later injection.\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('model:user', Person, {singleton: false });\n container.register('fruit:favorite', Orange);\n container.register('communication:main', Email, {singleton: false});\n ```\n\n @method register\n @param {String} fullName\n @param {Function} factory\n @param {Object} options\n */\n register: function(fullName, factory, options) {\n if (fullName.indexOf(':') === -1) {\n throw new TypeError(\"malformed fullName, expected: `type:name` got: \" + fullName + \"\");\n }\n\n if (factory === undefined) {\n throw new TypeError('Attempting to register an unknown factory: `' + fullName + '`');\n }\n\n var normalizedName = this.normalize(fullName);\n\n if (this.cache.has(normalizedName)) {\n throw new Error('Cannot re-register: `' + fullName +'`, as it has already been looked up.');\n }\n\n this.registry.set(normalizedName, factory);\n this._options.set(normalizedName, options || {});\n },\n\n /**\n Unregister a fullName\n\n ```javascript\n var container = new Container();\n container.register('model:user', User);\n\n container.lookup('model:user') instanceof User //=> true\n\n container.unregister('model:user')\n container.lookup('model:user') === undefined //=> true\n ```\n\n @method unregister\n @param {String} fullName\n */\n unregister: function(fullName) {\n var normalizedName = this.normalize(fullName);\n\n this.registry.remove(normalizedName);\n this.cache.remove(normalizedName);\n this.factoryCache.remove(normalizedName);\n this._options.remove(normalizedName);\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n By default `resolve` will retrieve the factory from\n its container's registry.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n container.resolve('api:twitter') // => Twitter\n ```\n\n Optionally the container can be provided with a custom resolver.\n If provided, `resolve` will first provide the custom resolver\n the oppertunity to resolve the fullName, otherwise it will fallback\n to the registry.\n\n ```javascript\n var container = new Container();\n container.resolver = function(fullName) {\n // lookup via the module system of choice\n };\n\n // the twitter factory is added to the module system\n container.resolve('api:twitter') // => Twitter\n ```\n\n @method resolve\n @param {String} fullName\n @return {Function} fullName's factory\n */\n resolve: function(fullName) {\n return this.resolver(fullName) || this.registry.get(fullName);\n },\n\n /**\n A hook that can be used to describe how the resolver will\n attempt to find the factory.\n\n For example, the default Ember `.describe` returns the full\n class name (including namespace) where Ember's resolver expects\n to find the `fullName`.\n\n @method describe\n */\n describe: function(fullName) {\n return fullName;\n },\n\n /**\n A hook to enable custom fullName normalization behaviour\n\n @method normalize\n @param {String} fullName\n @return {string} normalized fullName\n */\n normalize: function(fullName) {\n return fullName;\n },\n\n /**\n @method makeToString\n\n @param {any} factory\n @param {string} fullName\n @return {function} toString function\n */\n makeToString: function(factory, fullName) {\n return factory.toString();\n },\n\n /**\n Given a fullName return a corresponding instance.\n\n The default behaviour is for lookup to return a singleton instance.\n The singleton is scoped to the container, allowing multiple containers\n to all have their own locally scoped singletons.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter');\n\n twitter instanceof Twitter; // => true\n\n // by default the container will return singletons\n twitter2 = container.lookup('api:twitter');\n twitter instanceof Twitter; // => true\n\n twitter === twitter2; //=> true\n ```\n\n If singletons are not wanted an optional flag can be provided at lookup.\n\n ```javascript\n var container = new Container();\n container.register('api:twitter', Twitter);\n\n var twitter = container.lookup('api:twitter', { singleton: false });\n var twitter2 = container.lookup('api:twitter', { singleton: false });\n\n twitter === twitter2; //=> false\n ```\n\n @method lookup\n @param {String} fullName\n @param {Object} options\n @return {any}\n */\n lookup: function(fullName, options) {\n fullName = this.normalize(fullName);\n\n options = options || {};\n\n if (this.cache.has(fullName) && options.singleton !== false) {\n return this.cache.get(fullName);\n }\n\n var value = instantiate(this, fullName);\n\n if (value === undefined) { return; }\n\n if (isSingleton(this, fullName) && options.singleton !== false) {\n this.cache.set(fullName, value);\n }\n\n return value;\n },\n\n /**\n Given a fullName return the corresponding factory.\n\n @method lookupFactory\n @param {String} fullName\n @return {any}\n */\n lookupFactory: function(fullName) {\n return factoryFor(this, fullName);\n },\n\n /**\n Given a fullName check if the container is aware of its factory\n or singleton instance.\n\n @method has\n @param {String} fullName\n @return {Boolean}\n */\n has: function(fullName) {\n if (this.cache.has(fullName)) {\n return true;\n }\n\n return !!factoryFor(this, fullName);\n },\n\n /**\n Allow registering options for all factories of a type.\n\n ```javascript\n var container = new Container();\n\n // if all of type `connection` must not be singletons\n container.optionsForType('connection', { singleton: false });\n\n container.register('connection:twitter', TwitterConnection);\n container.register('connection:facebook', FacebookConnection);\n\n var twitter = container.lookup('connection:twitter');\n var twitter2 = container.lookup('connection:twitter');\n\n twitter === twitter2; // => false\n\n var facebook = container.lookup('connection:facebook');\n var facebook2 = container.lookup('connection:facebook');\n\n facebook === facebook2; // => false\n ```\n\n @method optionsForType\n @param {String} type\n @param {Object} options\n */\n optionsForType: function(type, options) {\n if (this.parent) { illegalChildOperation('optionsForType'); }\n\n this._typeOptions.set(type, options);\n },\n\n /**\n @method options\n @param {String} type\n @param {Object} options\n */\n options: function(type, options) {\n this.optionsForType(type, options);\n },\n\n /**\n @private\n\n Used only via `injection`.\n\n Provides a specialized form of injection, specifically enabling\n all objects of one type to be injected with a reference to another\n object.\n\n For example, provided each object of type `controller` needed a `router`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.register('router:main', Router);\n container.register('controller:user', UserController);\n container.register('controller:post', PostController);\n\n container.typeInjection('controller', 'router', 'router:main');\n\n var user = container.lookup('controller:user');\n var post = container.lookup('controller:post');\n\n user.router instanceof Router; //=> true\n post.router instanceof Router; //=> true\n\n // both controllers share the same router\n user.router === post.router; //=> true\n ```\n\n @method typeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n typeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('typeInjection'); }\n\n addTypeInjection(this.typeInjections, type, property, fullName);\n },\n\n /**\n Defines injection rules.\n\n These rules are used to inject dependencies onto objects when they\n are instantiated.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('source:main', Source);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another fullName\n // eg. each user model gets a post model\n container.injection('model:user', 'post', 'model:post');\n\n // injecting one fullName on another type\n container.injection('model', 'source', 'source:main');\n\n var user = container.lookup('model:user');\n var post = container.lookup('model:post');\n\n user.source instanceof Source; //=> true\n post.source instanceof Source; //=> true\n\n user.post instanceof Post; //=> true\n\n // and both models share the same source\n user.source === post.source; //=> true\n ```\n\n @method injection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\n */\n injection: function(factoryName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n if (factoryName.indexOf(':') === -1) {\n return this.typeInjection(factoryName, property, injectionName);\n }\n\n addInjection(this.injections, factoryName, property, injectionName);\n },\n\n\n /**\n @private\n\n Used only via `factoryInjection`.\n\n Provides a specialized form of injection, specifically enabling\n all factory of one type to be injected with a reference to another\n object.\n\n For example, provided each factory of type `model` needed a `store`.\n one would do the following:\n\n ```javascript\n var container = new Container();\n\n container.registerFactory('model:user', User);\n container.register('store:main', SomeStore);\n\n container.factoryTypeInjection('model', 'store', 'store:main');\n\n var store = container.lookup('store:main');\n var UserFactory = container.lookupFactory('model:user');\n\n UserFactory.store instanceof SomeStore; //=> true\n ```\n\n @method factoryTypeInjection\n @param {String} type\n @param {String} property\n @param {String} fullName\n */\n factoryTypeInjection: function(type, property, fullName) {\n if (this.parent) { illegalChildOperation('factoryTypeInjection'); }\n\n addTypeInjection(this.factoryTypeInjections, type, property, fullName);\n },\n\n /**\n Defines factory injection rules.\n\n Similar to regular injection rules, but are run against factories, via\n `Container#lookupFactory`.\n\n These rules are used to inject objects onto factories when they\n are looked up.\n\n Two forms of injections are possible:\n\n * Injecting one fullName on another fullName\n * Injecting one fullName on a type\n\n Example:\n\n ```javascript\n var container = new Container();\n\n container.register('store:main', Store);\n container.register('store:secondary', OtherStore);\n container.register('model:user', User);\n container.register('model:post', Post);\n\n // injecting one fullName on another type\n container.factoryInjection('model', 'store', 'store:main');\n\n // injecting one fullName on another fullName\n container.factoryInjection('model:post', 'secondaryStore', 'store:secondary');\n\n var UserFactory = container.lookupFactory('model:user');\n var PostFactory = container.lookupFactory('model:post');\n var store = container.lookup('store:main');\n\n UserFactory.store instanceof Store; //=> true\n UserFactory.secondaryStore instanceof OtherStore; //=> false\n\n PostFactory.store instanceof Store; //=> true\n PostFactory.secondaryStore instanceof OtherStore; //=> true\n\n // and both models share the same source instance\n UserFactory.store === PostFactory.store; //=> true\n ```\n\n @method factoryInjection\n @param {String} factoryName\n @param {String} property\n @param {String} injectionName\n */\n factoryInjection: function(factoryName, property, injectionName) {\n if (this.parent) { illegalChildOperation('injection'); }\n\n if (factoryName.indexOf(':') === -1) {\n return this.factoryTypeInjection(factoryName, property, injectionName);\n }\n\n addInjection(this.factoryInjections, factoryName, property, injectionName);\n },\n\n /**\n A depth first traversal, destroying the container, its descendant containers and all\n their managed objects.\n\n @method destroy\n */\n destroy: function() {\n this.isDestroyed = true;\n\n for (var i=0, l=this.children.length; i<l; i++) {\n this.children[i].destroy();\n }\n\n this.children = [];\n\n eachDestroyable(this, function(item) {\n item.destroy();\n });\n\n this.parent = undefined;\n this.isDestroyed = true;\n },\n\n /**\n @method reset\n */\n reset: function() {\n for (var i=0, l=this.children.length; i<l; i++) {\n resetCache(this.children[i]);\n }\n resetCache(this);\n }\n };\n\n function illegalChildOperation(operation) {\n throw new Error(operation + \" is not currently supported on child containers\");\n }\n\n function isSingleton(container, fullName) {\n var singleton = option(container, fullName, 'singleton');\n\n return singleton !== false;\n }\n\n function buildInjections(container, injections) {\n var hash = {};\n\n if (!injections) { return hash; }\n\n var injection, lookup;\n\n for (var i=0, l=injections.length; i<l; i++) {\n injection = injections[i];\n lookup = container.lookup(injection.fullName);\n\n if (lookup !== undefined) {\n hash[injection.property] = lookup;\n } else {\n throw new Error('Attempting to inject an unknown injection: `' + injection.fullName + '`');\n }\n }\n\n return hash;\n }\n\n function option(container, fullName, optionName) {\n var options = container._options.get(fullName);\n\n if (options && options[optionName] !== undefined) {\n return options[optionName];\n }\n\n var type = fullName.split(\":\")[0];\n options = container._typeOptions.get(type);\n\n if (options) {\n return options[optionName];\n }\n }\n\n function factoryFor(container, fullName) {\n var name = container.normalize(fullName);\n var factory = container.resolve(name);\n var injectedFactory;\n var cache = container.factoryCache;\n var type = fullName.split(\":\")[0];\n\n if (factory === undefined) { return; }\n\n if (cache.has(fullName)) {\n return cache.get(fullName);\n }\n\n if (!factory || typeof factory.extend !== 'function' || (!Ember.MODEL_FACTORY_INJECTIONS && type === 'model')) {\n // TODO: think about a 'safe' merge style extension\n // for now just fallback to create time injection\n return factory;\n } else {\n\n var injections = injectionsFor(container, fullName);\n var factoryInjections = factoryInjectionsFor(container, fullName);\n\n factoryInjections._toString = container.makeToString(factory, fullName);\n\n injectedFactory = factory.extend(injections);\n injectedFactory.reopenClass(factoryInjections);\n\n cache.set(fullName, injectedFactory);\n\n return injectedFactory;\n }\n }\n\n function injectionsFor(container ,fullName) {\n var splitName = fullName.split(\":\"),\n type = splitName[0],\n injections = [];\n\n injections = injections.concat(container.typeInjections.get(type) || []);\n injections = injections.concat(container.injections[fullName] || []);\n\n injections = buildInjections(container, injections);\n injections._debugContainerKey = fullName;\n injections.container = container;\n\n return injections;\n }\n\n function factoryInjectionsFor(container, fullName) {\n var splitName = fullName.split(\":\"),\n type = splitName[0],\n factoryInjections = [];\n\n factoryInjections = factoryInjections.concat(container.factoryTypeInjections.get(type) || []);\n factoryInjections = factoryInjections.concat(container.factoryInjections[fullName] || []);\n\n factoryInjections = buildInjections(container, factoryInjections);\n factoryInjections._debugContainerKey = fullName;\n\n return factoryInjections;\n }\n\n function instantiate(container, fullName) {\n var factory = factoryFor(container, fullName);\n\n if (option(container, fullName, 'instantiate') === false) {\n return factory;\n }\n\n if (factory) {\n if (typeof factory.extend === 'function') {\n // assume the factory was extendable and is already injected\n return factory.create();\n } else {\n // assume the factory was extendable\n // to create time injections\n // TODO: support new'ing for instantiation and merge injections for pure JS Functions\n return factory.create(injectionsFor(container, fullName));\n }\n }\n }\n\n function eachDestroyable(container, callback) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n callback(value);\n });\n }\n\n function resetCache(container) {\n container.cache.eachLocal(function(key, value) {\n if (option(container, key, 'instantiate') === false) { return; }\n value.destroy();\n });\n container.cache.dict = {};\n }\n\n function addTypeInjection(rules, type, property, fullName) {\n var injections = rules.get(type);\n\n if (!injections) {\n injections = [];\n rules.set(type, injections);\n }\n\n injections.push({\n property: property,\n fullName: fullName\n });\n }\n\n function addInjection(rules, factoryName, property, injectionName) {\n var injections = rules[factoryName] = rules[factoryName] || [];\n injections.push({ property: property, fullName: injectionName });\n }\n\n return Container;\n});\n\n})();\n//@ sourceURL=container");minispade.register('ember-application/ext', "(function() {minispade.require('ember-application/ext/controller');\n\n})();\n//@ sourceURL=ember-application/ext");minispade.register('ember-application/ext/controller', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nfunction verifyNeedsDependencies(controller, container, needs) {\n var dependency, i, l;\n\n for (i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency.indexOf(':') === -1) {\n dependency = \"controller:\" + dependency;\n }\n\n // Structure assert to still do verification but not string concat in production\n if (!container.has(dependency)) {\n Ember.assert(Ember.inspect(controller) + \" needs \" + dependency + \" but it does not exist\", false);\n }\n }\n}\n\n/**\n @class ControllerMixin\n @namespace Ember\n*/\nEmber.ControllerMixin.reopen({\n concatenatedProperties: ['needs'],\n\n /**\n An array of other controller objects available inside\n instances of this controller via the `controllers`\n property:\n\n For example, when you define a controller:\n\n ```javascript\n App.CommentsController = Ember.ArrayController.extend({\n needs: ['post']\n });\n ```\n\n The application's single instance of these other\n controllers are accessible by name through the\n `controllers` property:\n\n ```javascript\n this.get('controllers.post'); // instance of App.PostController\n ```\n\n This is only available for singleton controllers.\n\n @property {Array} needs\n @default []\n */\n needs: [],\n\n init: function() {\n var needs = get(this, 'needs'),\n length = get(needs, 'length');\n\n if (length > 0) {\n Ember.assert(' `' + Ember.inspect(this) + ' specifies `needs`, but does not have a container. Please ensure this controller was instantiated with a container.', this.container);\n\n verifyNeedsDependencies(this, this.container, needs);\n\n // if needs then initialize controllers proxy\n get(this, 'controllers');\n }\n\n this._super.apply(this, arguments);\n },\n\n /**\n @method controllerFor\n @see {Ember.Route#controllerFor}\n @deprecated Use `needs` instead\n */\n controllerFor: function(controllerName) {\n Ember.deprecate(\"Controller#controllerFor is deprecated, please use Controller#needs instead\");\n return Ember.controllerFor(get(this, 'container'), controllerName);\n },\n\n /**\n Stores the instances of other controllers available from within\n this controller. Any controller listed by name in the `needs`\n property will be accessible by name through this property.\n\n ```javascript\n App.CommentsController = Ember.ArrayController.extend({\n needs: ['post'],\n postTitle: function(){\n var currentPost = this.get('controllers.post'); // instance of App.PostController\n return currentPost.get('title');\n }.property('controllers.post.title')\n });\n ```\n\n @see {Ember.ControllerMixin#needs}\n @property {Object} controllers\n @default null\n */\n controllers: Ember.computed(function() {\n var controller = this;\n\n return {\n needs: get(controller, 'needs'),\n container: get(controller, 'container'),\n unknownProperty: function(controllerName) {\n var needs = this.needs,\n dependency, i, l;\n for (i=0, l=needs.length; i<l; i++) {\n dependency = needs[i];\n if (dependency === controllerName) {\n return this.container.lookup('controller:' + controllerName);\n }\n }\n\n var errorMessage = Ember.inspect(controller) + '#needs does not include `' + controllerName + '`. To access the ' + controllerName + ' controller from ' + Ember.inspect(controller) + ', ' + Ember.inspect(controller) + ' should have a `needs` property that is an array of the controllers it has access to.';\n throw new ReferenceError(errorMessage);\n }\n };\n }).readOnly()\n});\n\n})();\n//@ sourceURL=ember-application/ext/controller");minispade.register('ember-application', "(function() {minispade.require('ember-views');\nminispade.require('ember-routing');\nminispade.require('ember-application/system');\nminispade.require('ember-application/ext');\n\n/**\nEmber Application\n\n@module ember\n@submodule ember-application\n@requires ember-views, ember-routing\n*/\n\n})();\n//@ sourceURL=ember-application");minispade.register('ember-application/system', "(function() {minispade.require('ember-application/system/dag');\nminispade.require('ember-application/system/resolver');\nminispade.require('ember-application/system/application');\n\n})();\n//@ sourceURL=ember-application/system");minispade.register('ember-application/system/application', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nfunction DeprecatedContainer(container) {\n this._container = container;\n}\n\nDeprecatedContainer.deprecate = function(method) {\n return function() {\n var container = this._container;\n\n Ember.deprecate('Using the defaultContainer is no longer supported. [defaultContainer#' + method + '] see: http://git.io/EKPpnA', false);\n return container[method].apply(container, arguments);\n };\n};\n\nDeprecatedContainer.prototype = {\n _container: null,\n lookup: DeprecatedContainer.deprecate('lookup'),\n resolve: DeprecatedContainer.deprecate('resolve'),\n register: DeprecatedContainer.deprecate('register')\n};\n\n/**\n An instance of `Ember.Application` is the starting point for every Ember\n application. It helps to instantiate, initialize and coordinate the many\n objects that make up your app.\n\n Each Ember app has one and only one `Ember.Application` object. In fact, the\n very first thing you should do in your application is create the instance:\n\n ```javascript\n window.App = Ember.Application.create();\n ```\n\n Typically, the application object is the only global variable. All other\n classes in your app should be properties on the `Ember.Application` instance,\n which highlights its first role: a global namespace.\n\n For example, if you define a view class, it might look like this:\n\n ```javascript\n App.MyView = Ember.View.extend();\n ```\n\n By default, calling `Ember.Application.create()` will automatically initialize\n your application by calling the `Ember.Application.initialize()` method. If\n you need to delay initialization, you can call your app's `deferReadiness()`\n method. When you are ready for your app to be initialized, call its\n `advanceReadiness()` method.\n\n You can define a `ready` method on the `Ember.Application` instance, which\n will be run by Ember when the application is initialized.\n\n Because `Ember.Application` inherits from `Ember.Namespace`, any classes\n you create will have useful string representations when calling `toString()`.\n See the `Ember.Namespace` documentation for more information.\n\n While you can think of your `Ember.Application` as a container that holds the\n other classes in your application, there are several other responsibilities\n going on under-the-hood that you may want to understand.\n\n ### Event Delegation\n\n Ember uses a technique called _event delegation_. This allows the framework\n to set up a global, shared event listener instead of requiring each view to\n do it manually. For example, instead of each view registering its own\n `mousedown` listener on its associated element, Ember sets up a `mousedown`\n listener on the `body`.\n\n If a `mousedown` event occurs, Ember will look at the target of the event and\n start walking up the DOM node tree, finding corresponding views and invoking\n their `mouseDown` method as it goes.\n\n `Ember.Application` has a number of default events that it listens for, as\n well as a mapping from lowercase events to camel-cased view method names. For\n example, the `keypress` event causes the `keyPress` method on the view to be\n called, the `dblclick` event causes `doubleClick` to be called, and so on.\n\n If there is a bubbling browser event that Ember does not listen for by\n default, you can specify custom events and their corresponding view method\n names by setting the application's `customEvents` property:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the paste event\n 'paste: \"paste\"\n }\n });\n ```\n\n By default, the application sets up these event listeners on the document\n body. However, in cases where you are embedding an Ember application inside\n an existing page, you may want it to set up the listeners on an element\n inside the body.\n\n For example, if only events inside a DOM element with the ID of `ember-app`\n should be delegated, set your application's `rootElement` property:\n\n ```javascript\n window.App = Ember.Application.create({\n rootElement: '#ember-app'\n });\n ```\n\n The `rootElement` can be either a DOM element or a jQuery-compatible selector\n string. Note that *views appended to the DOM outside the root element will\n not receive events.* If you specify a custom root element, make sure you only\n append views inside it!\n\n To learn more about the advantages of event delegation and the Ember view\n layer, and a list of the event listeners that are setup by default, visit the\n [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation).\n\n ### Initializers\n\n Libraries on top of Ember can register additional initializers, like so:\n\n ```javascript\n Ember.Application.initializer({\n name: \"store\",\n\n initialize: function(container, application) {\n container.register('store:main', application.Store);\n }\n });\n ```\n\n ### Routing\n\n In addition to creating your application's router, `Ember.Application` is\n also responsible for telling the router when to start routing. Transitions\n between routes can be logged with the `LOG_TRANSITIONS` flag, and more\n detailed intra-transition logging can be logged with\n the `LOG_TRANSITIONS_INTERNAL` flag:\n\n ```javascript\n window.App = Ember.Application.create({\n LOG_TRANSITIONS: true, // basic logging of successful transitions\n LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n });\n ```\n\n By default, the router will begin trying to translate the current URL into\n application state once the browser emits the `DOMContentReady` event. If you\n need to defer routing, you can call the application's `deferReadiness()`\n method. Once routing can begin, call the `advanceReadiness()` method.\n\n If there is any setup required before routing begins, you can implement a\n `ready()` method on your app that will be invoked immediately before routing\n begins.\n ```\n\n @class Application\n @namespace Ember\n @extends Ember.Namespace\n*/\n\nvar Application = Ember.Application = Ember.Namespace.extend(Ember.DeferredMixin, {\n\n /**\n The root DOM element of the Application. This can be specified as an\n element or a\n [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).\n\n This is the element that will be passed to the Application's,\n `eventDispatcher`, which sets up the listeners for event delegation. Every\n view in your application should be a child of the element you specify here.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n The `Ember.EventDispatcher` responsible for delegating events to this\n application's views.\n\n The event dispatcher is created by the application at initialization time\n and sets up event listeners on the DOM element described by the\n application's `rootElement` property.\n\n See the documentation for `Ember.EventDispatcher` for more information.\n\n @property eventDispatcher\n @type Ember.EventDispatcher\n @default null\n */\n eventDispatcher: null,\n\n /**\n The DOM events for which the event dispatcher should listen.\n\n By default, the application's `Ember.EventDispatcher` listens\n for a set of standard DOM events, such as `mousedown` and\n `keyup`, and delegates them to your application's `Ember.View`\n instances.\n\n If you would like additional bubbling events to be delegated to your\n views, set your `Ember.Application`'s `customEvents` property\n to a hash containing the DOM event name as the key and the\n corresponding view method name as the value. For example:\n\n ```javascript\n App = Ember.Application.create({\n customEvents: {\n // add support for the paste event\n 'paste: \"paste\"\n }\n });\n ```\n\n @property customEvents\n @type Object\n @default null\n */\n customEvents: null,\n\n // Start off the number of deferrals at 1. This will be\n // decremented by the Application's own `initialize` method.\n _readinessDeferrals: 1,\n\n init: function() {\n if (!this.$) { this.$ = Ember.$; }\n this.__container__ = this.buildContainer();\n\n this.Router = this.defaultRouter();\n\n this._super();\n\n this.scheduleInitialize();\n\n Ember.libraries.registerCoreLibrary('Handlebars', Ember.Handlebars.VERSION);\n Ember.libraries.registerCoreLibrary('jQuery', Ember.$().jquery);\n\n if ( Ember.LOG_VERSION ) {\n Ember.LOG_VERSION = false; // we only need to see this once per Application#init\n var maxNameLength = Math.max.apply(this, Ember.A(Ember.libraries).mapBy(\"name.length\"));\n\n Ember.debug('-------------------------------');\n Ember.libraries.each(function(name, version) {\n var spaces = new Array(maxNameLength - name.length + 1).join(\" \");\n Ember.debug([name, spaces, ' : ', version].join(\"\"));\n });\n Ember.debug('-------------------------------');\n }\n },\n\n /**\n @private\n\n Build the container for the current application.\n\n Also register a default application view in case the application\n itself does not.\n\n @method buildContainer\n @return {Ember.Container} the configured container\n */\n buildContainer: function() {\n var container = this.__container__ = Application.buildContainer(this);\n\n return container;\n },\n\n /**\n @private\n\n If the application has not opted out of routing and has not explicitly\n defined a router, supply a default router for the application author\n to configure.\n\n This allows application developers to do:\n\n ```javascript\n var App = Ember.Application.create();\n\n App.Router.map(function() {\n this.resource('posts');\n });\n ```\n\n @method defaultRouter\n @return {Ember.Router} the default router\n */\n\n defaultRouter: function() {\n if (this.Router === false) { return; }\n var container = this.__container__;\n\n if (this.Router) {\n container.unregister('router:main');\n container.register('router:main', this.Router);\n }\n\n return container.lookupFactory('router:main');\n },\n\n /**\n @private\n\n Automatically initialize the application once the DOM has\n become ready.\n\n The initialization itself is scheduled on the actions queue\n which ensures that application loading finishes before\n booting.\n\n If you are asynchronously loading code, you should call\n `deferReadiness()` to defer booting, and then call\n `advanceReadiness()` once all of your code has finished\n loading.\n\n @method scheduleInitialize\n */\n scheduleInitialize: function() {\n var self = this;\n\n if (!this.$ || this.$.isReady) {\n Ember.run.schedule('actions', self, '_initialize');\n } else {\n this.$().ready(function() {\n Ember.run(self, '_initialize');\n });\n }\n },\n\n /**\n Use this to defer readiness until some condition is true.\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n App.deferReadiness();\n\n jQuery.getJSON(\"/auth-token\", function(token) {\n App.token = token;\n App.advanceReadiness();\n });\n ```\n\n This allows you to perform asynchronous setup logic and defer\n booting your application until the setup has finished.\n\n However, if the setup requires a loading UI, it might be better\n to use the router for this purpose.\n\n @method deferReadiness\n */\n deferReadiness: function() {\n Ember.assert(\"You must call deferReadiness on an instance of Ember.Application\", this instanceof Ember.Application);\n Ember.assert(\"You cannot defer readiness since the `ready()` hook has already been called.\", this._readinessDeferrals > 0);\n this._readinessDeferrals++;\n },\n\n /**\n Call `advanceReadiness` after any asynchronous setup logic has completed.\n Each call to `deferReadiness` must be matched by a call to `advanceReadiness`\n or the application will never become ready and routing will not begin.\n\n @method advanceReadiness\n @see {Ember.Application#deferReadiness}\n */\n advanceReadiness: function() {\n Ember.assert(\"You must call advanceReadiness on an instance of Ember.Application\", this instanceof Ember.Application);\n this._readinessDeferrals--;\n\n if (this._readinessDeferrals === 0) {\n Ember.run.once(this, this.didBecomeReady);\n }\n },\n\n /**\n registers a factory for later injection\n\n Example:\n\n ```javascript\n App = Ember.Application.create();\n\n App.Person = Ember.Object.extend({});\n App.Orange = Ember.Object.extend({});\n App.Email = Ember.Object.extend({});\n App.Session = Ember.Object.create({});\n\n App.register('model:user', App.Person, {singleton: false });\n App.register('fruit:favorite', App.Orange);\n App.register('communication:main', App.Email, {singleton: false});\n App.register('session', App.Session, {instantiate: false});\n ```\n\n @method register\n @param fullName {String} type:name (e.g., 'model:user')\n @param factory {Function} (e.g., App.Person)\n @param options {String} (optional)\n **/\n register: function() {\n var container = this.__container__;\n container.register.apply(container, arguments);\n },\n /**\n defines an injection or typeInjection\n\n Example:\n\n ```javascript\n App.inject(<full_name or type>, <property name>, <full_name>)\n App.inject('model:user', 'email', 'model:email')\n App.inject('model', 'source', 'source:main')\n ```\n\n @method inject\n @param factoryNameOrType {String}\n @param property {String}\n @param injectionName {String}\n **/\n inject: function() {\n var container = this.__container__;\n container.injection.apply(container, arguments);\n },\n\n /**\n @private\n @deprecated\n\n Calling initialize manually is not supported.\n\n Please see Ember.Application#advanceReadiness and\n Ember.Application#deferReadiness.\n\n @method initialize\n **/\n initialize: function() {\n Ember.deprecate('Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and Ember.Application#deferReadiness');\n },\n /**\n @private\n\n Initialize the application. This happens automatically.\n\n Run any initializers and run the application load hook. These hooks may\n choose to defer readiness. For example, an authentication hook might want\n to defer readiness until the auth token has been retrieved.\n\n @method _initialize\n */\n _initialize: function() {\n if (this.isDestroyed) { return; }\n\n // At this point, the App.Router must already be assigned\n if (this.Router) {\n var container = this.__container__;\n container.unregister('router:main');\n container.register('router:main', this.Router);\n }\n\n this.runInitializers();\n Ember.runLoadHooks('application', this);\n\n // At this point, any initializers or load hooks that would have wanted\n // to defer readiness have fired. In general, advancing readiness here\n // will proceed to didBecomeReady.\n this.advanceReadiness();\n\n return this;\n },\n\n /**\n Reset the application. This is typically used only in tests. It cleans up\n the application in the following order:\n\n 1. Deactivate existing routes\n 2. Destroy all objects in the container\n 3. Create a new application container\n 4. Re-route to the existing url\n\n Typical Example:\n\n ```javascript\n\n var App;\n\n Ember.run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n App.reset();\n }\n });\n\n test(\"first test\", function() {\n // App is freshly reset\n });\n\n test(\"first test\", function() {\n // App is again freshly reset\n });\n ```\n\n Advanced Example:\n\n Occasionally you may want to prevent the app from initializing during\n setup. This could enable extra configuration, or enable asserting prior\n to the app becoming ready.\n\n ```javascript\n\n var App;\n\n Ember.run(function() {\n App = Ember.Application.create();\n });\n\n module(\"acceptance test\", {\n setup: function() {\n Ember.run(function() {\n App.reset();\n App.deferReadiness();\n });\n }\n });\n\n test(\"first test\", function() {\n ok(true, 'something before app is initialized');\n\n Ember.run(function() {\n App.advanceReadiness();\n });\n ok(true, 'something after app is initialized');\n });\n ```\n\n @method reset\n **/\n reset: function() {\n this._readinessDeferrals = 1;\n\n function handleReset() {\n var router = this.__container__.lookup('router:main');\n router.reset();\n\n Ember.run(this.__container__, 'destroy');\n\n this.buildContainer();\n\n Ember.run.schedule('actions', this, function() {\n this._initialize();\n });\n }\n\n Ember.run.join(this, handleReset);\n },\n\n /**\n @private\n @method runInitializers\n */\n runInitializers: function() {\n var initializers = get(this.constructor, 'initializers'),\n container = this.__container__,\n graph = new Ember.DAG(),\n namespace = this,\n name, initializer;\n\n for (name in initializers) {\n initializer = initializers[name];\n graph.addEdges(initializer.name, initializer.initialize, initializer.before, initializer.after);\n }\n\n graph.topsort(function (vertex) {\n var initializer = vertex.value;\n Ember.assert(\"No application initializer named '\"+vertex.name+\"'\", initializer);\n initializer(container, namespace);\n });\n },\n\n /**\n @private\n @method didBecomeReady\n */\n didBecomeReady: function() {\n this.setupEventDispatcher();\n this.ready(); // user hook\n this.startRouting();\n\n if (!Ember.testing) {\n // Eagerly name all classes that are already loaded\n Ember.Namespace.processAll();\n Ember.BOOTED = true;\n }\n\n this.resolve(this);\n },\n\n /**\n @private\n\n Setup up the event dispatcher to receive events on the\n application's `rootElement` with any registered\n `customEvents`.\n\n @method setupEventDispatcher\n */\n setupEventDispatcher: function() {\n var customEvents = get(this, 'customEvents'),\n rootElement = get(this, 'rootElement'),\n dispatcher = this.__container__.lookup('event_dispatcher:main');\n\n set(this, 'eventDispatcher', dispatcher);\n dispatcher.setup(customEvents, rootElement);\n },\n\n /**\n @private\n\n trigger a new call to `route` whenever the URL changes.\n If the application has a router, use it to route to the current URL, and\n\n @method startRouting\n @property router {Ember.Router}\n */\n startRouting: function() {\n var router = this.__container__.lookup('router:main');\n if (!router) { return; }\n\n router.startRouting();\n },\n\n handleURL: function(url) {\n var router = this.__container__.lookup('router:main');\n\n router.handleURL(url);\n },\n\n /**\n Called when the Application has become ready.\n The call will be delayed until the DOM has become ready.\n\n @event ready\n */\n ready: Ember.K,\n\n /**\n @deprecated Use 'Resolver' instead\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n\n @property resolver\n */\n resolver: null,\n\n /**\n Set this to provide an alternate class to `Ember.DefaultResolver`\n\n @property resolver\n */\n Resolver: null,\n\n willDestroy: function() {\n Ember.BOOTED = false;\n\n this.__container__.destroy();\n },\n\n initializer: function(options) {\n this.constructor.initializer(options);\n }\n});\n\nEmber.Application.reopenClass({\n initializers: {},\n initializer: function(initializer) {\n // If this is the first initializer being added to a subclass, we are going to reopen the class\n // to make sure we have a new `initializers` object, which extends from the parent class' using\n // prototypal inheritance. Without this, attempting to add initializers to the subclass would\n // pollute the parent class as well as other subclasses.\n if (this.superclass.initializers !== undefined && this.superclass.initializers === this.initializers) {\n this.reopenClass({\n initializers: Ember.create(this.initializers)\n });\n }\n\n Ember.assert(\"The initializer '\" + initializer.name + \"' has already been registered\", !this.initializers[initializer.name]);\n Ember.assert(\"An initializer cannot be registered with both a before and an after\", !(initializer.before && initializer.after));\n Ember.assert(\"An initializer cannot be registered without an initialize function\", Ember.canInvoke(initializer, 'initialize'));\n\n this.initializers[initializer.name] = initializer;\n },\n\n /**\n @private\n\n This creates a container with the default Ember naming conventions.\n\n It also configures the container:\n\n * registered views are created every time they are looked up (they are\n not singletons)\n * registered templates are not factories; the registered value is\n returned directly.\n * the router receives the application as its `namespace` property\n * all controllers receive the router as their `target` and `controllers`\n properties\n * all controllers receive the application as their `namespace` property\n * the application view receives the application controller as its\n `controller` property\n * the application view receives the application template as its\n `defaultTemplate` property\n\n @method buildContainer\n @static\n @param {Ember.Application} namespace the application to build the\n container for.\n @return {Ember.Container} the built container\n */\n buildContainer: function(namespace) {\n var container = new Ember.Container();\n\n Ember.Container.defaultContainer = new DeprecatedContainer(container);\n\n container.set = Ember.set;\n container.resolver = resolverFor(namespace);\n container.normalize = container.resolver.normalize;\n container.describe = container.resolver.describe;\n container.makeToString = container.resolver.makeToString;\n\n container.optionsForType('component', { singleton: false });\n container.optionsForType('view', { singleton: false });\n container.optionsForType('template', { instantiate: false });\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n container.optionsForType('helper', { instantiate: false });\n }\n\n container.register('application:main', namespace, { instantiate: false });\n\n container.register('controller:basic', Ember.Controller, { instantiate: false });\n container.register('controller:object', Ember.ObjectController, { instantiate: false });\n container.register('controller:array', Ember.ArrayController, { instantiate: false });\n container.register('route:basic', Ember.Route, { instantiate: false });\n container.register('event_dispatcher:main', Ember.EventDispatcher);\n\n container.register('router:main', Ember.Router);\n container.injection('router:main', 'namespace', 'application:main');\n\n container.injection('controller', 'target', 'router:main');\n container.injection('controller', 'namespace', 'application:main');\n\n container.injection('route', 'router', 'router:main');\n\n return container;\n }\n});\n\n/**\n @private\n\n This function defines the default lookup rules for container lookups:\n\n * templates are looked up on `Ember.TEMPLATES`\n * other names are looked up on the application after classifying the name.\n For example, `controller:post` looks up `App.PostController` by default.\n * if the default lookup fails, look for registered classes on the container\n\n This allows the application to register default injections in the container\n that could be overridden by the normal naming convention.\n\n @method resolverFor\n @param {Ember.Namespace} namespace the namespace to look for classes\n @return {*} the resolved value for a given lookup\n*/\nfunction resolverFor(namespace) {\n if (namespace.get('resolver')) {\n Ember.deprecate('Application.resolver is deprecated in favor of Application.Resolver', false);\n }\n\n var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || Ember.DefaultResolver;\n var resolver = ResolverClass.create({\n namespace: namespace\n });\n\n function resolve(fullName) {\n return resolver.resolve(fullName);\n }\n\n resolve.describe = function(fullName) {\n return resolver.lookupDescription(fullName);\n };\n\n resolve.makeToString = function(factory, fullName) {\n return resolver.makeToString(factory, fullName);\n };\n\n resolve.normalize = function(fullName) {\n if (resolver.normalize) {\n return resolver.normalize(fullName);\n } else {\n Ember.deprecate('The Resolver should now provide a \\'normalize\\' function', false);\n return fullName;\n }\n };\n\n return resolve;\n}\n\nEmber.runLoadHooks('Ember.Application', Ember.Application);\n\n})();\n//@ sourceURL=ember-application/system/application");minispade.register('ember-application/system/dag', "(function() {function visit(vertex, fn, visited, path) {\n var name = vertex.name,\n vertices = vertex.incoming,\n names = vertex.incomingNames,\n len = names.length,\n i;\n if (!visited) {\n visited = {};\n }\n if (!path) {\n path = [];\n }\n if (visited.hasOwnProperty(name)) {\n return;\n }\n path.push(name);\n visited[name] = true;\n for (i = 0; i < len; i++) {\n visit(vertices[names[i]], fn, visited, path);\n }\n fn(vertex, path);\n path.pop();\n}\n\nfunction DAG() {\n this.names = [];\n this.vertices = {};\n}\n\nDAG.prototype.add = function(name) {\n if (!name) { return; }\n if (this.vertices.hasOwnProperty(name)) {\n return this.vertices[name];\n }\n var vertex = {\n name: name, incoming: {}, incomingNames: [], hasOutgoing: false, value: null\n };\n this.vertices[name] = vertex;\n this.names.push(name);\n return vertex;\n};\n\nDAG.prototype.map = function(name, value) {\n this.add(name).value = value;\n};\n\nDAG.prototype.addEdge = function(fromName, toName) {\n if (!fromName || !toName || fromName === toName) {\n return;\n }\n var from = this.add(fromName), to = this.add(toName);\n if (to.incoming.hasOwnProperty(fromName)) {\n return;\n }\n function checkCycle(vertex, path) {\n if (vertex.name === toName) {\n throw new Ember.Error(\"cycle detected: \" + toName + \" <- \" + path.join(\" <- \"));\n }\n }\n visit(from, checkCycle);\n from.hasOutgoing = true;\n to.incoming[fromName] = from;\n to.incomingNames.push(fromName);\n};\n\nDAG.prototype.topsort = function(fn) {\n var visited = {},\n vertices = this.vertices,\n names = this.names,\n len = names.length,\n i, vertex;\n for (i = 0; i < len; i++) {\n vertex = vertices[names[i]];\n if (!vertex.hasOutgoing) {\n visit(vertex, fn, visited);\n }\n }\n};\n\nDAG.prototype.addEdges = function(name, value, before, after) {\n var i;\n this.map(name, value);\n if (before) {\n if (typeof before === 'string') {\n this.addEdge(name, before);\n } else {\n for (i = 0; i < before.length; i++) {\n this.addEdge(name, before[i]);\n }\n }\n }\n if (after) {\n if (typeof after === 'string') {\n this.addEdge(after, name);\n } else {\n for (i = 0; i < after.length; i++) {\n this.addEdge(after[i], name);\n }\n }\n }\n};\n\nEmber.DAG = DAG;\n\n})();\n//@ sourceURL=ember-application/system/dag");minispade.register('ember-application/system/resolver', "(function() {/**\n@module ember\n@submodule ember-application\n*/\n\nvar get = Ember.get,\n classify = Ember.String.classify,\n capitalize = Ember.String.capitalize,\n decamelize = Ember.String.decamelize;\n\n/**\n The DefaultResolver defines the default lookup rules to resolve\n container lookups before consulting the container for registered\n items:\n\n* templates are looked up on `Ember.TEMPLATES`\n* other names are looked up on the application after converting\n the name. For example, `controller:post` looks up\n `App.PostController` by default.\n* there are some nuances (see examples below)\n\n ### How Resolving Works\n\n The container calls this object's `resolve` method with the\n `fullName` argument.\n\n It first parses the fullName into an object using `parseName`.\n\n Then it checks for the presence of a type-specific instance\n method of the form `resolve[Type]` and calls it if it exists.\n For example if it was resolving 'template:post', it would call\n the `resolveTemplate` method.\n\n Its last resort is to call the `resolveOther` method.\n\n The methods of this object are designed to be easy to override\n in a subclass. For example, you could enhance how a template\n is resolved like so:\n\n ```javascript\n App = Ember.Application.create({\n Resolver: Ember.DefaultResolver.extend({\n resolveTemplate: function(parsedName) {\n var resolvedTemplate = this._super(parsedName);\n if (resolvedTemplate) { return resolvedTemplate; }\n return Ember.TEMPLATES['not_found'];\n }\n })\n });\n ```\n\n Some examples of how names are resolved:\n\n ```\n 'template:post' //=> Ember.TEMPLATES['post']\n 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline']\n 'template:blogPost' //=> Ember.TEMPLATES['blogPost']\n // OR\n // Ember.TEMPLATES['blog_post']\n 'controller:post' //=> App.PostController\n 'controller:posts.index' //=> App.PostsIndexController\n 'controller:blog/post' //=> Blog.PostController\n 'controller:basic' //=> Ember.Controller\n 'route:post' //=> App.PostRoute\n 'route:posts.index' //=> App.PostsIndexRoute\n 'route:blog/post' //=> Blog.PostRoute\n 'route:basic' //=> Ember.Route\n 'view:post' //=> App.PostView\n 'view:posts.index' //=> App.PostsIndexView\n 'view:blog/post' //=> Blog.PostView\n 'view:basic' //=> Ember.View\n 'foo:post' //=> App.PostFoo\n 'model:post' //=> App.Post\n ```\n\n @class DefaultResolver\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.DefaultResolver = Ember.Object.extend({\n /**\n This will be set to the Application instance when it is\n created.\n\n @property namespace\n */\n namespace: null,\n\n normalize: function(fullName) {\n var split = fullName.split(':', 2),\n type = split[0],\n name = split[1];\n\n Ember.assert(\"Tried to normalize a container name without a colon (:) in it. You probably tried to lookup a name that did not contain a type, a colon, and a name. A proper lookup name would be `view:post`.\", split.length === 2);\n\n if (type !== 'template') {\n var result = name;\n\n if (result.indexOf('.') > -1) {\n result = result.replace(/\\.(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n if (name.indexOf('_') > -1) {\n result = result.replace(/_(.)/g, function(m) { return m.charAt(1).toUpperCase(); });\n }\n\n return type + ':' + result;\n } else {\n return fullName;\n }\n },\n\n\n /**\n This method is called via the container's resolver method.\n It parses the provided `fullName` and then looks up and\n returns the appropriate template or class.\n\n @method resolve\n @param {String} fullName the lookup string\n @return {Object} the resolved factory\n */\n resolve: function(fullName) {\n var parsedName = this.parseName(fullName),\n typeSpecificResolveMethod = this[parsedName.resolveMethodName];\n\n if (!parsedName.name || !parsedName.type) {\n throw new TypeError(\"Invalid fullName: `\" + fullName + \"`, must of of the form `type:name` \");\n }\n\n if (typeSpecificResolveMethod) {\n var resolved = typeSpecificResolveMethod.call(this, parsedName);\n if (resolved) { return resolved; }\n }\n return this.resolveOther(parsedName);\n },\n /**\n Convert the string name of the form \"type:name\" to\n a Javascript object with the parsed aspects of the name\n broken out.\n\n @protected\n @param {String} fullName the lookup string\n @method parseName\n */\n parseName: function(fullName) {\n var nameParts = fullName.split(\":\"),\n type = nameParts[0], fullNameWithoutType = nameParts[1],\n name = fullNameWithoutType,\n namespace = get(this, 'namespace'),\n root = namespace;\n\n if (type !== 'template' && name.indexOf('/') !== -1) {\n var parts = name.split('/');\n name = parts[parts.length - 1];\n var namespaceName = capitalize(parts.slice(0, -1).join('.'));\n root = Ember.Namespace.byName(namespaceName);\n\n Ember.assert('You are looking for a ' + name + ' ' + type + ' in the ' + namespaceName + ' namespace, but the namespace could not be found', root);\n }\n\n return {\n fullName: fullName,\n type: type,\n fullNameWithoutType: fullNameWithoutType,\n name: name,\n root: root,\n resolveMethodName: \"resolve\" + classify(type)\n };\n },\n /**\n Look up the template in Ember.TEMPLATES\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveTemplate\n */\n resolveTemplate: function(parsedName) {\n var templateName = parsedName.fullNameWithoutType.replace(/\\./g, '/');\n\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n\n templateName = decamelize(templateName);\n if (Ember.TEMPLATES[templateName]) {\n return Ember.TEMPLATES[templateName];\n }\n },\n /**\n Given a parseName object (output from `parseName`), apply\n the conventions expected by `Ember.Router`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method useRouterNaming\n */\n useRouterNaming: function(parsedName) {\n parsedName.name = parsedName.name.replace(/\\./g, '_');\n if (parsedName.name === 'basic') {\n parsedName.name = '';\n }\n },\n /**\n Lookup the controller using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveController\n */\n resolveController: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the route using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveRoute\n */\n resolveRoute: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n /**\n Lookup the view using `resolveOther`\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveView\n */\n resolveView: function(parsedName) {\n this.useRouterNaming(parsedName);\n return this.resolveOther(parsedName);\n },\n\n resolveHelper: function(parsedName) {\n return this.resolveOther(parsedName) || Ember.Handlebars.helpers[parsedName.fullNameWithoutType];\n },\n\n /**\n Lookup the model on the Application namespace\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveModel\n */\n resolveModel: function(parsedName) {\n var className = classify(parsedName.name),\n factory = get(parsedName.root, className);\n\n if (factory) { return factory; }\n },\n /**\n Look up the specified object (from parsedName) on the appropriate\n namespace (usually on the Application)\n\n @protected\n @param {Object} parsedName a parseName object with the parsed\n fullName lookup string\n @method resolveOther\n */\n resolveOther: function(parsedName) {\n var className = classify(parsedName.name) + classify(parsedName.type),\n factory = get(parsedName.root, className);\n if (factory) { return factory; }\n },\n\n /**\n Returns a human-readable description for a fullName. Used by the\n Application namespace in assertions to describe the\n precise name of the class that Ember is looking for, rather than\n container keys.\n\n @protected\n @param {String} fullName the lookup string\n @method lookupDescription\n */\n lookupDescription: function(fullName) {\n var parsedName = this.parseName(fullName);\n\n if (parsedName.type === 'template') {\n return \"template at \" + parsedName.fullNameWithoutType.replace(/\\./g, '/');\n }\n\n var description = parsedName.root + \".\" + classify(parsedName.name);\n if (parsedName.type !== 'model') { description += classify(parsedName.type); }\n\n return description;\n },\n\n makeToString: function(factory, fullName) {\n return factory.toString();\n }\n});\n\n})();\n//@ sourceURL=ember-application/system/resolver");minispade.register('ember-debug', "(function() {/*global __fail__*/\n\n/**\nEmber Debug\n\n@module ember\n@submodule ember-debug\n*/\n\n/**\n@class Ember\n*/\n\nif ('undefined' === typeof Ember) {\n Ember = {};\n\n if ('undefined' !== typeof window) {\n window.Em = window.Ember = Em = Ember;\n }\n}\n\nEmber.ENV = 'undefined' === typeof ENV ? {} : ENV;\n\nif (!('MANDATORY_SETTER' in Ember.ENV)) {\n Ember.ENV.MANDATORY_SETTER = true; // default to true for debug dist\n}\n\n/**\n Define an assertion that will throw an exception if the condition is not\n met. Ember build tools will remove any calls to `Ember.assert()` when\n doing a production build. Example:\n\n ```javascript\n // Test for truthiness\n Ember.assert('Must pass a valid object', obj);\n // Fail unconditionally\n Ember.assert('This code path should never be run')\n ```\n\n @method assert\n @param {String} desc A description of the assertion. This will become\n the text of the Error thrown if the assertion fails.\n @param {Boolean} test Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.\n*/\nEmber.assert = function(desc, test) {\n if (!test) {\n Ember.Logger.assert(test, desc);\n }\n\n if (Ember.testing && !test) {\n // when testing, ensure test failures when assertions fail\n throw new Ember.Error(\"Assertion Failed: \" + desc);\n }\n};\n\n\n/**\n Display a warning with the provided message. Ember build tools will\n remove any calls to `Ember.warn()` when doing a production build.\n\n @method warn\n @param {String} message A warning to display.\n @param {Boolean} test An optional boolean. If falsy, the warning\n will be displayed.\n*/\nEmber.warn = function(message, test) {\n if (!test) {\n Ember.Logger.warn(\"WARNING: \"+message);\n if ('trace' in Ember.Logger) Ember.Logger.trace();\n }\n};\n\n/**\n Display a debug notice. Ember build tools will remove any calls to\n `Ember.debug()` when doing a production build.\n\n ```javascript\n Ember.debug(\"I'm a debug notice!\");\n ```\n\n @method debug\n @param {String} message A debug message to display.\n*/\nEmber.debug = function(message) {\n Ember.Logger.debug(\"DEBUG: \"+message);\n};\n\n/**\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only). Ember build tools will remove any calls to\n `Ember.deprecate()` when doing a production build.\n\n @method deprecate\n @param {String} message A description of the deprecation.\n @param {Boolean} test An optional boolean. If falsy, the deprecation\n will be displayed.\n*/\nEmber.deprecate = function(message, test) {\n if (Ember.TESTING_DEPRECATION) { return; }\n\n if (arguments.length === 1) { test = false; }\n if (test) { return; }\n\n if (Ember.ENV.RAISE_ON_DEPRECATION) { throw new Ember.Error(message); }\n\n var error;\n\n // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome\n try { __fail__.fail(); } catch (e) { error = e; }\n\n if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {\n var stack, stackStr = '';\n if (error['arguments']) {\n // Chrome\n stack = error.stack.replace(/^\\s+at\\s+/gm, '').\n replace(/^([^\\(]+?)([\\n$])/gm, '{anonymous}($1)$2').\n replace(/^Object.<anonymous>\\s*\\(([^\\)]+)\\)/gm, '{anonymous}($1)').split('\\n');\n stack.shift();\n } else {\n // Firefox\n stack = error.stack.replace(/(?:\\n@:0)?\\s+$/m, '').\n replace(/^\\(/gm, '{anonymous}(').split('\\n');\n }\n\n stackStr = \"\\n \" + stack.slice(2).join(\"\\n \");\n message = message + stackStr;\n }\n\n Ember.Logger.warn(\"DEPRECATION: \"+message);\n};\n\n\n\n/**\n Alias an old, deprecated method with its new counterpart.\n\n Display a deprecation warning with the provided message and a stack trace\n (Chrome and Firefox only) when the assigned method is called.\n\n Ember build tools will not remove calls to `Ember.deprecateFunc()`, though\n no warnings will be shown in production.\n\n ```javascript\n Ember.oldMethod = Ember.deprecateFunc(\"Please use the new, updated method\", Ember.newMethod);\n ```\n\n @method deprecateFunc\n @param {String} message A description of the deprecation.\n @param {Function} func The new function called to replace its deprecated counterpart.\n @return {Function} a new function that wrapped the original function with a deprecation warning\n*/\nEmber.deprecateFunc = function(message, func) {\n return function() {\n Ember.deprecate(message);\n return func.apply(this, arguments);\n };\n};\n\n\n// Inform the developer about the Ember Inspector if not installed.\nif (!Ember.testing) {\n if (typeof window !== 'undefined' && window.chrome && window.addEventListener) {\n window.addEventListener(\"load\", function() {\n if (document.body && document.body.dataset && !document.body.dataset.emberExtension) {\n Ember.debug('For more advanced debugging, install the Ember Inspector from https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi');\n }\n }, false);\n }\n}\n\n})();\n//@ sourceURL=ember-debug");minispade.register('ember-extension-support/data_adapter', "(function() {/**\n@module ember\n@submodule ember-extension-support\n*/\nminispade.require('ember-application');\n\n/**\n The `DataAdapter` helps a data persistence library\n interface with tools that debug Ember such\n as the Chrome Ember Extension.\n\n This class will be extended by a persistence library\n which will override some of the methods with\n library-specific code.\n\n The methods likely to be overriden are\n `getFilters`, `detect`, `columnsForType`,\n `getRecords`, `getRecordColumnValues`,\n `getRecordKeywords`, `getRecordFilterValues`,\n `getRecordColor`, `observeRecord`\n\n The adapter will need to be registered\n in the application's container as `dataAdapter:main`\n\n Example:\n ```javascript\n Application.initializer({\n name: \"dataAdapter\",\n\n initialize: function(container, application) {\n application.register('dataAdapter:main', DS.DataAdapter);\n }\n });\n ```\n\n @class DataAdapter\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.DataAdapter = Ember.Object.extend({\n init: function() {\n this._super();\n this.releaseMethods = Ember.A();\n },\n\n /**\n The container of the application being debugged.\n This property will be injected\n on creation.\n */\n container: null,\n\n /**\n @private\n\n Number of attributes to send\n as columns. (Enough to make the record\n identifiable).\n */\n attributeLimit: 3,\n\n /**\n @private\n\n Stores all methods that clear observers.\n These methods will be called on destruction.\n */\n releaseMethods: Ember.A(),\n\n /**\n @public\n\n Specifies how records can be filtered.\n Records returned will need to have a `filterValues`\n property with a key for every name in the returned array.\n\n @method getFilters\n @return {Array} List of objects defining filters.\n The object should have a `name` and `desc` property.\n */\n getFilters: function() {\n return Ember.A();\n },\n\n /**\n @public\n\n Fetch the model types and observe them for changes.\n\n @method watchModelTypes\n\n @param {Function} typesAdded Callback to call to add types.\n Takes an array of objects containing wrapped types (returned from `wrapModelType`).\n\n @param {Function} typesUpdated Callback to call when a type has changed.\n Takes an array of objects containing wrapped types.\n\n @return {Function} Method to call to remove all observers\n */\n watchModelTypes: function(typesAdded, typesUpdated) {\n var modelTypes = this.getModelTypes(),\n self = this, typesToSend, releaseMethods = Ember.A();\n\n typesToSend = modelTypes.map(function(type) {\n var wrapped = self.wrapModelType(type);\n releaseMethods.push(self.observeModelType(type, typesUpdated));\n return wrapped;\n });\n\n typesAdded(typesToSend);\n\n var release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n self.releaseMethods.removeObject(release);\n };\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n /**\n @public\n\n Fetch the records of a given type and observe them for changes.\n\n @method watchRecords\n\n @param {Function} recordsAdded Callback to call to add records.\n Takes an array of objects containing wrapped records.\n The object should have the following properties:\n columnValues: {Object} key and value of a table cell\n object: {Object} the actual record object\n\n @param {Function} recordsUpdated Callback to call when a record has changed.\n Takes an array of objects containing wrapped records.\n\n @param {Function} recordsRemoved Callback to call when a record has removed.\n Takes the following parameters:\n index: the array index where the records were removed\n count: the number of records removed\n\n @return {Function} Method to call to remove all observers\n */\n watchRecords: function(type, recordsAdded, recordsUpdated, recordsRemoved) {\n var self = this, releaseMethods = Ember.A(), records = this.getRecords(type), release;\n\n var recordUpdated = function(updatedRecord) {\n recordsUpdated([updatedRecord]);\n };\n\n var recordsToSend = records.map(function(record) {\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n return self.wrapRecord(record);\n });\n\n\n var contentDidChange = function(array, idx, removedCount, addedCount) {\n for (var i = idx; i < idx + addedCount; i++) {\n var record = array.objectAt(i);\n var wrapped = self.wrapRecord(record);\n releaseMethods.push(self.observeRecord(record, recordUpdated));\n recordsAdded([wrapped]);\n }\n\n if (removedCount) {\n recordsRemoved(idx, removedCount);\n }\n };\n\n var observer = { didChange: contentDidChange, willChange: Ember.K };\n records.addArrayObserver(self, observer);\n\n release = function() {\n releaseMethods.forEach(function(fn) { fn(); });\n records.removeArrayObserver(self, observer);\n self.releaseMethods.removeObject(release);\n };\n\n recordsAdded(recordsToSend);\n\n this.releaseMethods.pushObject(release);\n return release;\n },\n\n /**\n @private\n\n Clear all observers before destruction\n */\n willDestroy: function() {\n this._super();\n this.releaseMethods.forEach(function(fn) {\n fn();\n });\n },\n\n /**\n @private\n\n Detect whether a class is a model.\n\n Test that against the model class\n of your persistence library\n\n @method detect\n @param {Class} klass The class to test\n @return boolean Whether the class is a model class or not\n */\n detect: function(klass) {\n return false;\n },\n\n /**\n @private\n\n Get the columns for a given model type.\n\n @method columnsForType\n @param {Class} type The model type\n @return {Array} An array of columns of the following format:\n name: {String} name of the column\n desc: {String} Humanized description (what would show in a table column name)\n */\n columnsForType: function(type) {\n return Ember.A();\n },\n\n /**\n @private\n\n Adds observers to a model type class.\n\n @method observeModelType\n @param {Class} type The model type class\n @param {Function} typesUpdated Called when a type is modified.\n @return {Function} The function to call to remove observers\n */\n\n observeModelType: function(type, typesUpdated) {\n var self = this, records = this.getRecords(type);\n\n var onChange = function() {\n typesUpdated([self.wrapModelType(type)]);\n };\n var observer = {\n didChange: function() {\n Ember.run.scheduleOnce('actions', this, onChange);\n },\n willChange: Ember.K\n };\n\n records.addArrayObserver(this, observer);\n\n var release = function() {\n records.removeArrayObserver(self, observer);\n };\n\n return release;\n },\n\n\n /**\n @private\n\n Wraps a given model type and observes changes to it.\n\n @method wrapModelType\n @param {Class} type A model class\n @param {Function} typesUpdated callback to call when the type changes\n @return {Object} contains the wrapped type and the function to remove observers\n Format:\n type: {Object} the wrapped type\n The wrapped type has the following format:\n name: {String} name of the type\n count: {Integer} number of records available\n columns: {Columns} array of columns to describe the record\n object: {Class} the actual Model type class\n release: {Function} The function to remove observers\n */\n wrapModelType: function(type, typesUpdated) {\n var release, records = this.getRecords(type),\n typeToSend, self = this;\n\n typeToSend = {\n name: type.toString(),\n count: Ember.get(records, 'length'),\n columns: this.columnsForType(type),\n object: type\n };\n\n\n return typeToSend;\n },\n\n\n /**\n @private\n\n Fetches all models defined in the application.\n TODO: Use the resolver instead of looping over namespaces.\n\n @method getModelTypes\n @return {Array} Array of model types\n */\n getModelTypes: function() {\n var namespaces = Ember.A(Ember.Namespace.NAMESPACES), types = Ember.A(), self = this;\n\n namespaces.forEach(function(namespace) {\n for (var key in namespace) {\n if (!namespace.hasOwnProperty(key)) { continue; }\n var klass = namespace[key];\n if (self.detect(klass)) {\n types.push(klass);\n }\n }\n });\n return types;\n },\n\n /**\n @private\n\n Fetches all loaded records for a given type.\n\n @method getRecords\n @return {Array} array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.\n */\n getRecords: function(type) {\n return Ember.A();\n },\n\n /**\n @private\n\n Wraps a record and observers changes to it\n\n @method wrapRecord\n @param {Object} record The record instance\n @return {Object} the wrapped record. Format:\n columnValues: {Array}\n searchKeywords: {Array}\n */\n wrapRecord: function(record) {\n var recordToSend = { object: record }, columnValues = {}, self = this;\n\n recordToSend.columnValues = this.getRecordColumnValues(record);\n recordToSend.searchKeywords = this.getRecordKeywords(record);\n recordToSend.filterValues = this.getRecordFilterValues(record);\n recordToSend.color = this.getRecordColor(record);\n\n return recordToSend;\n },\n\n /**\n @private\n\n Gets the values for each column.\n\n @method getRecordColumnValues\n @return {Object} Keys should match column names defined\n by the model type.\n */\n getRecordColumnValues: function(record) {\n return {};\n },\n\n /**\n @private\n\n Returns keywords to match when searching records.\n\n @method getRecordKeywords\n @return {Array} Relevant keywords for search.\n */\n getRecordKeywords: function(record) {\n return Ember.A();\n },\n\n /**\n @private\n\n Returns the values of filters defined by `getFilters`.\n\n @method getRecordFilterValues\n @param {Object} record The record instance\n @return {Object} The filter values\n */\n getRecordFilterValues: function(record) {\n return {};\n },\n\n /**\n @private\n\n Each record can have a color that represents its state.\n\n @method getRecordColor\n @param {Object} record The record instance\n @return {String} The record's color\n Possible options: black, red, blue, green\n */\n getRecordColor: function(record) {\n return null;\n },\n\n /**\n @private\n\n Observes all relevant properties and re-sends the wrapped record\n when a change occurs.\n\n @method observerRecord\n @param {Object} record The record instance\n @param {Function} recordUpdated The callback to call when a record is updated.\n @return {Function} The function to call to remove all observers.\n */\n observeRecord: function(record, recordUpdated) {\n return function(){};\n }\n\n});\n\n\n})();\n//@ sourceURL=ember-extension-support/data_adapter");minispade.register('ember-extension-support', "(function() {/**\nEmber Extension Support\n\n@module ember\n@submodule ember-extension-support\n@requires ember-application\n*/\nminispade.require('ember-extension-support/data_adapter');\n\n})();\n//@ sourceURL=ember-extension-support");minispade.register('ember-handlebars-compiler', "(function() {/**\n@module ember\n@submodule ember-handlebars-compiler\n*/\n\n// Eliminate dependency on any Ember to simplify precompilation workflow\nvar objectCreate = Object.create || function(parent) {\n function F() {}\n F.prototype = parent;\n return new F();\n};\n\nvar Handlebars = this.Handlebars || (Ember.imports && Ember.imports.Handlebars);\nif (!Handlebars && typeof require === 'function') {\n Handlebars = require('handlebars');\n}\n\nEmber.assert(\"Ember Handlebars requires Handlebars version 1.0.0. Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before you link to Ember.\", Handlebars);\nEmber.assert(\"Ember Handlebars requires Handlebars version 1.0.0, COMPILER_REVISION expected: 4, got: \" + Handlebars.COMPILER_REVISION + \" - Please note: Builds of master may have other COMPILER_REVISION values.\", Handlebars.COMPILER_REVISION === 4);\n\n/**\n Prepares the Handlebars templating library for use inside Ember's view\n system.\n\n The `Ember.Handlebars` object is the standard Handlebars library, extended to\n use Ember's `get()` method instead of direct property access, which allows\n computed properties to be used inside templates.\n\n To create an `Ember.Handlebars` template, call `Ember.Handlebars.compile()`.\n This will return a function that can be used by `Ember.View` for rendering.\n\n @class Handlebars\n @namespace Ember\n*/\nEmber.Handlebars = objectCreate(Handlebars);\n\n/**\n Register a bound helper or custom view helper.\n\n ## Simple bound helper example\n\n ```javascript\n Ember.Handlebars.helper('capitalize', function(value) {\n return value.toUpperCase();\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n For more examples of bound helpers, see documentation for\n `Ember.Handlebars.registerBoundHelper`.\n\n ## Custom view helper example\n\n Assuming a view subclass named `App.CalendarView` were defined, a helper\n for rendering instances of this view could be registered as follows:\n\n ```javascript\n Ember.Handlebars.helper('calendar', App.CalendarView):\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{calendar}}\n ```\n\n Which is functionally equivalent to:\n\n ```handlebars\n {{view App.CalendarView}}\n ```\n\n Options in the helper will be passed to the view in exactly the same\n manner as with the `view` helper.\n\n @method helper\n @for Ember.Handlebars\n @param {String} name\n @param {Function|Ember.View} function or view class constructor\n @param {String} dependentKeys*\n*/\nEmber.Handlebars.helper = function(name, value) {\n Ember.assert(\"You tried to register a component named '\" + name + \"', but component names must include a '-'\", !Ember.Component.detect(value) || name.match(/-/));\n\n if (Ember.View.detect(value)) {\n Ember.Handlebars.registerHelper(name, Ember.Handlebars.makeViewHelper(value));\n } else {\n Ember.Handlebars.registerBoundHelper.apply(null, arguments);\n }\n};\n\n/**\n @private\n\n Returns a helper function that renders the provided ViewClass.\n\n Used internally by Ember.Handlebars.helper and other methods\n involving helper/component registration.\n\n @method helper\n @for Ember.Handlebars\n @param {Function} ViewClass view class constructor\n*/\nEmber.Handlebars.makeViewHelper = function(ViewClass) {\n return function(options) {\n Ember.assert(\"You can only pass attributes (such as name=value) not bare values to a helper for a View\", arguments.length < 2);\n return Ember.Handlebars.helpers.view.call(this, ViewClass, options);\n };\n};\n\n/**\n@class helpers\n@namespace Ember.Handlebars\n*/\nEmber.Handlebars.helpers = objectCreate(Handlebars.helpers);\n\n/**\n Override the the opcode compiler and JavaScript compiler for Handlebars.\n\n @class Compiler\n @namespace Ember.Handlebars\n @private\n @constructor\n*/\nEmber.Handlebars.Compiler = function() {};\n\n// Handlebars.Compiler doesn't exist in runtime-only\nif (Handlebars.Compiler) {\n Ember.Handlebars.Compiler.prototype = objectCreate(Handlebars.Compiler.prototype);\n}\n\nEmber.Handlebars.Compiler.prototype.compiler = Ember.Handlebars.Compiler;\n\n/**\n @class JavaScriptCompiler\n @namespace Ember.Handlebars\n @private\n @constructor\n*/\nEmber.Handlebars.JavaScriptCompiler = function() {};\n\n// Handlebars.JavaScriptCompiler doesn't exist in runtime-only\nif (Handlebars.JavaScriptCompiler) {\n Ember.Handlebars.JavaScriptCompiler.prototype = objectCreate(Handlebars.JavaScriptCompiler.prototype);\n Ember.Handlebars.JavaScriptCompiler.prototype.compiler = Ember.Handlebars.JavaScriptCompiler;\n}\n\n\nEmber.Handlebars.JavaScriptCompiler.prototype.namespace = \"Ember.Handlebars\";\n\nEmber.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {\n return \"''\";\n};\n\n/**\n @private\n\n Override the default buffer for Ember Handlebars. By default, Handlebars\n creates an empty String at the beginning of each invocation and appends to\n it. Ember's Handlebars overrides this to append to a single shared buffer.\n\n @method appendToBuffer\n @param string {String}\n*/\nEmber.Handlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {\n return \"data.buffer.push(\"+string+\");\";\n};\n\n// Hacks ahead:\n// Handlebars presently has a bug where the `blockHelperMissing` hook\n// doesn't get passed the name of the missing helper name, but rather\n// gets passed the value of that missing helper evaluated on the current\n// context, which is most likely `undefined` and totally useless.\n//\n// So we alter the compiled template function to pass the name of the helper\n// instead, as expected.\n//\n// This can go away once the following is closed:\n// https://github.com/wycats/handlebars.js/issues/617\n\nvar DOT_LOOKUP_REGEX = /helpers\\.(.*?)\\)/,\n BRACKET_STRING_LOOKUP_REGEX = /helpers\\['(.*?)'/,\n INVOCATION_SPLITTING_REGEX = /(.*blockHelperMissing\\.call\\(.*)(stack[0-9]+)(,.*)/;\n\nEmber.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation = function(source) {\n var helperInvocation = source[source.length - 1],\n helperName = (DOT_LOOKUP_REGEX.exec(helperInvocation) || BRACKET_STRING_LOOKUP_REGEX.exec(helperInvocation))[1],\n matches = INVOCATION_SPLITTING_REGEX.exec(helperInvocation);\n\n source[source.length - 1] = matches[1] + \"'\" + helperName + \"'\" + matches[3];\n}\nvar stringifyBlockHelperMissing = Ember.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation;\n\nvar originalBlockValue = Ember.Handlebars.JavaScriptCompiler.prototype.blockValue;\nEmber.Handlebars.JavaScriptCompiler.prototype.blockValue = function() {\n originalBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\n};\n\nvar originalAmbiguousBlockValue = Ember.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue;\nEmber.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue = function() {\n originalAmbiguousBlockValue.apply(this, arguments);\n stringifyBlockHelperMissing(this.source);\n};\n\nvar prefix = \"ember\" + (+new Date()), incr = 1;\n\n/**\n @private\n\n Rewrite simple mustaches from `{{foo}}` to `{{bind \"foo\"}}`. This means that\n all simple mustaches in Ember's Handlebars will also set up an observer to\n keep the DOM up to date when the underlying property changes.\n\n @method mustache\n @for Ember.Handlebars.Compiler\n @param mustache\n*/\nEmber.Handlebars.Compiler.prototype.mustache = function(mustache) {\n if (mustache.isHelper && mustache.id.string === 'control') {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"controlID\", new Handlebars.AST.StringNode(prefix + incr++)]);\n } else if (mustache.params.length || mustache.hash) {\n // no changes required\n } else {\n var id = new Handlebars.AST.IdNode([{ part: '_triageMustache' }]);\n\n // Update the mustache node to include a hash value indicating whether the original node\n // was escaped. This will allow us to properly escape values when the underlying value\n // changes and we need to re-render the value.\n if (!mustache.escaped) {\n mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);\n mustache.hash.pairs.push([\"unescaped\", new Handlebars.AST.StringNode(\"true\")]);\n }\n mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);\n }\n\n return Handlebars.Compiler.prototype.mustache.call(this, mustache);\n};\n\n/**\n Used for precompilation of Ember Handlebars templates. This will not be used\n during normal app execution.\n\n @method precompile\n @for Ember.Handlebars\n @static\n @param {String} string The template to precompile\n*/\nEmber.Handlebars.precompile = function(string) {\n var ast = Handlebars.parse(string);\n\n var options = {\n knownHelpers: {\n action: true,\n unbound: true,\n bindAttr: true,\n template: true,\n view: true,\n _triageMustache: true\n },\n data: true,\n stringParams: true\n };\n\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n};\n\n// We don't support this for Handlebars runtime-only\nif (Handlebars.compile) {\n /**\n The entry point for Ember Handlebars. This replaces the default\n `Handlebars.compile` and turns on template-local data and String\n parameters.\n\n @method compile\n @for Ember.Handlebars\n @static\n @param {String} string The template to compile\n @return {Function}\n */\n Ember.Handlebars.compile = function(string) {\n var ast = Handlebars.parse(string);\n var options = { data: true, stringParams: true };\n var environment = new Ember.Handlebars.Compiler().compile(ast, options);\n var templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);\n\n var template = Ember.Handlebars.template(templateSpec);\n template.isMethod = false; //Make sure we don't wrap templates with ._super\n\n return template;\n };\n}\n\n\n})();\n//@ sourceURL=ember-handlebars-compiler");minispade.register('ember-handlebars/component_lookup', "(function() {Ember.ComponentLookup = Ember.Object.extend({\n lookupFactory: function(name, container) {\n\n container = container || this.container;\n\n var fullName = 'component:' + name,\n templateFullName = 'template:components/' + name,\n templateRegistered = container && container.has(templateFullName);\n\n if (templateRegistered) {\n container.injection(fullName, 'layout', templateFullName);\n }\n\n var Component = container.lookupFactory(fullName);\n\n // Only treat as a component if either the component\n // or a template has been registered.\n if (templateRegistered || Component) {\n if (!Component) {\n container.register(fullName, Ember.Component);\n Component = container.lookupFactory(fullName);\n }\n return Component;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/component_lookup");minispade.register('ember-handlebars/controls', "(function() {minispade.require(\"ember-handlebars/controls/checkbox\");\nminispade.require(\"ember-handlebars/controls/text_field\");\nminispade.require(\"ember-handlebars/controls/button\");\nminispade.require(\"ember-handlebars/controls/text_area\");\nminispade.require(\"ember-handlebars/controls/select\");\n\n/**\n@module ember\n@submodule ember-handlebars-compiler\n*/\n\n/**\n\n The `{{input}}` helper inserts an HTML `<input>` tag into the template,\n with a `type` value of either `text` or `checkbox`. If no `type` is provided,\n `text` will be the default value applied. The attributes of `{{input}}`\n match those of the native HTML tag as closely as possible for these two types.\n\n ## Use as text field\n An `{{input}}` with no `type` or a `type` of `text` will render an HTML text input.\n The following HTML attributes can be set via the helper:\n\n* `value`\n* `size`\n* `name`\n* `pattern`\n* `placeholder`\n* `disabled`\n* `maxlength`\n* `tabindex`\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input value=\"http://www.facebook.com\"}}\n ```\n\n\n ```html\n <input type=\"text\" value=\"http://www.facebook.com\"/>\n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n firstName: \"Stanley\",\n entryNotAllowed: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"text\" value=firstName disabled=entryNotAllowed size=\"50\"}}\n ```\n\n\n ```html\n <input type=\"text\" value=\"Stanley\" disabled=\"disabled\" size=\"50\"/>\n ```\n\n ## Extension\n\n Internally, `{{input type=\"text\"}}` creates an instance of `Ember.TextField`, passing\n arguments from the helper to `Ember.TextField`'s `create` method. You can extend the\n capablilties of text inputs in your applications by reopening this class. For example,\n if you are deploying to browsers where the `required` attribute is used, you\n can add this to the `TextField`'s `attributeBindings` property:\n\n ```javascript\n Ember.TextField.reopen({\n attributeBindings: ['required']\n });\n ```\n\n Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n\n ## Use as checkbox\n\n An `{{input}}` with a `type` of `checkbox` will render an HTML checkbox input.\n The following HTML attributes can be set via the helper:\n\n* `checked`\n* `disabled`\n* `tabindex`\n* `indeterminate`\n* `name`\n\n\n When set to a quoted string, these values will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n ## Unbound:\n\n ```handlebars\n {{input type=\"checkbox\" name=\"isAdmin\"}}\n ```\n\n ```html\n <input type=\"checkbox\" name=\"isAdmin\" />\n ```\n\n ## Bound:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n isAdmin: true\n });\n ```\n\n\n ```handlebars\n {{input type=\"checkbox\" checked=isAdmin }}\n ```\n\n\n ```html\n <input type=\"checkbox\" checked=\"checked\" />\n ```\n\n ## Extension\n\n Internally, `{{input type=\"checkbox\"}}` creates an instance of `Ember.Checkbox`, passing\n arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the\n capablilties of checkbox inputs in your applications by reopening this class. For example,\n if you wanted to add a css class to all checkboxes in your application:\n\n ```javascript\n Ember.Checkbox.reopen({\n classNames: ['my-app-checkbox']\n });\n ```\n\n\n @method input\n @for Ember.Handlebars.helpers\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('input', function(options) {\n Ember.assert('You can only pass attributes to the `input` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes,\n inputType = hash.type,\n onEvent = hash.on;\n\n delete hash.type;\n delete hash.on;\n\n if (inputType === 'checkbox') {\n return Ember.Handlebars.helpers.view.call(this, Ember.Checkbox, options);\n } else {\n if (inputType) { hash.type = inputType; }\n hash.onEvent = onEvent || 'enter';\n return Ember.Handlebars.helpers.view.call(this, Ember.TextField, options);\n }\n});\n\n/**\n `{{textarea}}` inserts a new instance of `<textarea>` tag into the template.\n The attributes of `{{textarea}}` match those of the native HTML tags as\n closely as possible.\n\n The following HTML attributes can be set:\n\n * `value`\n * `name`\n * `rows`\n * `cols`\n * `placeholder`\n * `disabled`\n * `maxlength`\n * `tabindex`\n\n When set to a quoted string, these value will be directly applied to the HTML\n element. When left unquoted, these values will be bound to a property on the\n template's current rendering context (most typically a controller instance).\n\n Unbound:\n\n ```handlebars\n {{textarea value=\"Lots of static text that ISN'T bound\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of static text that ISN'T bound\n </textarea>\n ```\n\n Bound:\n\n In the following example, the `writtenWords` property on `App.ApplicationController`\n will be updated live as the user types 'Lots of text that IS bound' into\n the text area of their browser's window.\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\"\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n ```\n\n If you wanted a one way binding between the text area and a div tag\n somewhere else on your screen, you could use `Ember.computed.oneWay`:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n outputWrittenWords: Ember.computed.oneWay(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n\n <div>\n {{outputWrittenWords}}\n </div>\n ```\n\n Would result in the following HTML:\n\n ```html\n <textarea class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n\n <-- the following div will be updated in real time as you type -->\n\n <div>\n Lots of text that IS bound\n </div>\n ```\n\n Finally, this example really shows the power and ease of Ember when two\n properties are bound to eachother via `Ember.computed.alias`. Type into\n either text area box and they'll both stay in sync. Note that\n `Ember.computed.alias` costs more in terms of performance, so only use it when\n your really binding in both directions:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n writtenWords: \"Lots of text that IS bound\",\n twoWayWrittenWords: Ember.computed.alias(\"writtenWords\")\n });\n ```\n\n ```handlebars\n {{textarea value=writtenWords}}\n {{textarea value=twoWayWrittenWords}}\n ```\n\n ```html\n <textarea id=\"ember1\" class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n\n <-- both updated in real time -->\n\n <textarea id=\"ember2\" class=\"ember-text-area\">\n Lots of text that IS bound\n </textarea>\n ```\n\n ## Extension\n\n Internally, `{{textarea}}` creates an instance of `Ember.TextArea`, passing\n arguments from the helper to `Ember.TextArea`'s `create` method. You can\n extend the capabilities of text areas in your application by reopening this\n class. For example, if you are deploying to browsers where the `required`\n attribute is used, you can globally add support for the `required` attribute\n on all {{textarea}}'s' in your app by reopening `Ember.TextArea` or\n `Ember.TextSupport` and adding it to the `attributeBindings` concatenated\n property:\n\n ```javascript\n Ember.TextArea.reopen({\n attributeBindings: ['required']\n });\n ```\n\n Keep in mind when writing `Ember.TextArea` subclasses that `Ember.TextArea`\n itself extends `Ember.Component`, meaning that it does NOT inherit\n the `controller` of the parent view.\n\n See more about [Ember components](api/classes/Ember.Component.html)\n\n @method textarea\n @for Ember.Handlebars.helpers\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('textarea', function(options) {\n Ember.assert('You can only pass attributes to the `textarea` helper, not arguments', arguments.length < 2);\n\n var hash = options.hash,\n types = options.hashTypes;\n\n return Ember.Handlebars.helpers.view.call(this, Ember.TextArea, options);\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls");minispade.register('ember-handlebars/controls/button', "(function() {minispade.require('ember-runtime/mixins/target_action_support');\n\n/*\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n @class Button\n @namespace Ember\n @extends Ember.View\n @uses Ember.TargetActionSupport\n @deprecated\n*/\nEmber.Button = Ember.View.extend(Ember.TargetActionSupport, {\n classNames: ['ember-button'],\n classNameBindings: ['isActive'],\n\n tagName: 'button',\n\n propagateEvents: false,\n\n attributeBindings: ['type', 'disabled', 'href', 'tabindex'],\n\n /*\n @private\n\n Overrides `TargetActionSupport`'s `targetObject` computed\n property to use Handlebars-specific path resolution.\n\n @property targetObject\n */\n targetObject: Ember.computed(function() {\n var target = get(this, 'target'),\n root = get(this, 'context'),\n data = get(this, 'templateData');\n\n if (typeof target !== 'string') { return target; }\n\n return Ember.Handlebars.get(root, target, { data: data });\n }).property('target'),\n\n // Defaults to 'button' if tagName is 'input' or 'button'\n type: Ember.computed(function(key) {\n var tagName = this.tagName;\n if (tagName === 'input' || tagName === 'button') { return 'button'; }\n }),\n\n disabled: false,\n\n // Allow 'a' tags to act like buttons\n href: Ember.computed(function() {\n return this.tagName === 'a' ? '#' : null;\n }),\n\n mouseDown: function() {\n if (!get(this, 'disabled')) {\n set(this, 'isActive', true);\n this._mouseDown = true;\n this._mouseEntered = true;\n }\n return get(this, 'propagateEvents');\n },\n\n mouseLeave: function() {\n if (this._mouseDown) {\n set(this, 'isActive', false);\n this._mouseEntered = false;\n }\n },\n\n mouseEnter: function() {\n if (this._mouseDown) {\n set(this, 'isActive', true);\n this._mouseEntered = true;\n }\n },\n\n mouseUp: function(event) {\n if (get(this, 'isActive')) {\n // Actually invoke the button's target and action.\n // This method comes from the Ember.TargetActionSupport mixin.\n this.triggerAction();\n set(this, 'isActive', false);\n }\n\n this._mouseDown = false;\n this._mouseEntered = false;\n return get(this, 'propagateEvents');\n },\n\n keyDown: function(event) {\n // Handle space or enter\n if (event.keyCode === 13 || event.keyCode === 32) {\n this.mouseDown();\n }\n },\n\n keyUp: function(event) {\n // Handle space or enter\n if (event.keyCode === 13 || event.keyCode === 32) {\n this.mouseUp();\n }\n },\n\n // TODO: Handle proper touch behavior. Including should make inactive when\n // finger moves more than 20x outside of the edge of the button (vs mouse\n // which goes inactive as soon as mouse goes out of edges.)\n\n touchStart: function(touch) {\n return this.mouseDown(touch);\n },\n\n touchEnd: function(touch) {\n return this.mouseUp(touch);\n },\n\n init: function() {\n Ember.deprecate(\"Ember.Button is deprecated and will be removed from future releases. Consider using the `{{action}}` helper.\");\n this._super();\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/button");minispade.register('ember-handlebars/controls/checkbox', "(function() {minispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/ext\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set, get = Ember.get;\n\n/**\n The internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `checkbox`.\n\n See Handlebars.helpers.input for usage details.\n\n ## Direct manipulation of `checked`\n\n The `checked` attribute of an `Ember.Checkbox` object should always be set\n through the Ember object or by interacting with its rendered element\n representation via the mouse, keyboard, or touch. Updating the value of the\n checkbox via jQuery will result in the checked value of the object and its\n element losing synchronization.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class Checkbox\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Checkbox = Ember.View.extend({\n classNames: ['ember-checkbox'],\n\n tagName: 'input',\n\n attributeBindings: ['type', 'checked', 'indeterminate', 'disabled', 'tabindex', 'name'],\n\n type: \"checkbox\",\n checked: false,\n disabled: false,\n indeterminate: false,\n\n init: function() {\n this._super();\n this.on(\"change\", this, this._updateElementValue);\n },\n\n didInsertElement: function() {\n this._super();\n this.get('element').indeterminate = !!this.get('indeterminate');\n },\n\n _updateElementValue: function() {\n set(this, 'checked', this.$().prop('checked'));\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/checkbox");minispade.register('ember-handlebars/controls/select', "(function() {/*jshint eqeqeq:false */\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set,\n get = Ember.get,\n indexOf = Ember.EnumerableUtils.indexOf,\n indexesOf = Ember.EnumerableUtils.indexesOf,\n forEach = Ember.EnumerableUtils.forEach,\n replace = Ember.EnumerableUtils.replace,\n isArray = Ember.isArray,\n precompileTemplate = Ember.Handlebars.compile;\n\nEmber.SelectOption = Ember.View.extend({\n tagName: 'option',\n attributeBindings: ['value', 'selected'],\n\n defaultTemplate: function(context, options) {\n options = { data: options.data, hash: {} };\n Ember.Handlebars.helpers.bind.call(context, \"view.label\", options);\n },\n\n init: function() {\n this.labelPathDidChange();\n this.valuePathDidChange();\n\n this._super();\n },\n\n selected: Ember.computed(function() {\n var content = get(this, 'content'),\n selection = get(this, 'parentView.selection');\n if (get(this, 'parentView.multiple')) {\n return selection && indexOf(selection, content.valueOf()) > -1;\n } else {\n // Primitives get passed through bindings as objects... since\n // `new Number(4) !== 4`, we use `==` below\n return content == selection;\n }\n }).property('content', 'parentView.selection'),\n\n labelPathDidChange: Ember.observer('parentView.optionLabelPath', function() {\n var labelPath = get(this, 'parentView.optionLabelPath');\n\n if (!labelPath) { return; }\n\n Ember.defineProperty(this, 'label', Ember.computed(function() {\n return get(this, labelPath);\n }).property(labelPath));\n }),\n\n valuePathDidChange: Ember.observer('parentView.optionValuePath', function() {\n var valuePath = get(this, 'parentView.optionValuePath');\n\n if (!valuePath) { return; }\n\n Ember.defineProperty(this, 'value', Ember.computed(function() {\n return get(this, valuePath);\n }).property(valuePath));\n })\n});\n\nEmber.SelectOptgroup = Ember.CollectionView.extend({\n tagName: 'optgroup',\n attributeBindings: ['label'],\n\n selectionBinding: 'parentView.selection',\n multipleBinding: 'parentView.multiple',\n optionLabelPathBinding: 'parentView.optionLabelPath',\n optionValuePathBinding: 'parentView.optionValuePath',\n\n itemViewClassBinding: 'parentView.optionView'\n});\n\n/**\n The `Ember.Select` view class renders a\n [select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,\n allowing the user to choose from a list of options.\n\n The text and `value` property of each `<option>` element within the\n `<select>` element are populated from the objects in the `Element.Select`'s\n `content` property. The underlying data object of the selected `<option>` is\n stored in the `Element.Select`'s `value` property.\n\n ## The Content Property (array of strings)\n\n The simplest version of an `Ember.Select` takes an array of strings as its\n `content` property. The string will be used as both the `value` property and\n the inner text of each `<option>` element inside the rendered `<select>`.\n\n Example:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n names: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select content=names}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n You can control which `<option>` is selected through the `Ember.Select`'s\n `value` property:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n selectedName: 'Tom',\n names: [\"Yehuda\", \"Tom\"]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=names\n value=selectedName\n }}\n ```\n\n Would result in the following HTML with the `<option>` for 'Tom' selected:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n A user interacting with the rendered `<select>` to choose \"Yehuda\" would\n update the value of `selectedName` to \"Yehuda\".\n\n ## The Content Property (array of Objects)\n\n An `Ember.Select` can also take an array of JavaScript or Ember objects as\n its `content` property.\n\n When using objects you need to tell the `Ember.Select` which property should\n be accessed on each object to supply the `value` attribute of the `<option>`\n and which property should be used to supply the element text.\n\n The `optionValuePath` option is used to specify the path on each object to\n the desired property for the `value` attribute. The `optionLabelPath`\n specifies the path on each object to the desired property for the\n element's text. Both paths must reference each object itself as `content`:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"}}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\">Tom</option>\n </select>\n ```\n\n The `value` attribute of the selected `<option>` within an `Ember.Select`\n can be bound to a property on another object:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ],\n currentProgrammer: {\n id: 2\n }\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n value=currentProgrammer.id}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `id` of `currentProgrammer`\n to match the `value` property of the newly selected `<option>`.\n\n Alternatively, you can control selection through the underlying objects\n used to render each object by binding the `selection` option. When the selected\n `<option>` is changed, the property path provided to `selection`\n will be updated to match the content object of the rendered `<option>`\n element:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n selectedPerson: null,\n programmers: [\n {firstName: \"Yehuda\", id: 1},\n {firstName: \"Tom\", id: 2}\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n optionValuePath=\"content.id\"\n optionLabelPath=\"content.firstName\"\n selection=selectedPerson}}\n ```\n\n Would result in the following HTML with a selected option:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"1\">Yehuda</option>\n <option value=\"2\" selected=\"selected\">Tom</option>\n </select>\n ```\n\n Interacting with the rendered element by selecting the first option\n ('Yehuda') will update the `selectedPerson` to match the object of\n the newly selected `<option>`. In this case it is the first object\n in the `programmers`\n\n ## Supplying a Prompt\n\n A `null` value for the `Ember.Select`'s `value` or `selection` property\n results in there being no `<option>` with a `selected` attribute:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n selectedProgrammer: null,\n programmers: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ``` handlebars\n {{view Ember.Select\n content=programmers\n value=selectedProgrammer\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n Although `selectedProgrammer` is `null` and no `<option>`\n has a `selected` attribute the rendered HTML will display the\n first item as though it were selected. You can supply a string\n value for the `Ember.Select` to display when there is no selection\n with the `prompt` option:\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n selectedProgrammer: null,\n programmers: [\n \"Yehuda\",\n \"Tom\"\n ]\n });\n ```\n\n ```handlebars\n {{view Ember.Select\n content=programmers\n value=selectedProgrammer\n prompt=\"Please select a name\"\n }}\n ```\n\n Would result in the following HTML:\n\n ```html\n <select class=\"ember-select\">\n <option>Please select a name</option>\n <option value=\"Yehuda\">Yehuda</option>\n <option value=\"Tom\">Tom</option>\n </select>\n ```\n\n @class Select\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Select = Ember.View.extend(\n /** @scope Ember.Select.prototype */ {\n\n tagName: 'select',\n classNames: ['ember-select'],\n defaultTemplate: precompileTemplate('{{#if view.prompt}}<option value=\"\">{{view.prompt}}</option>{{/if}}{{#if view.optionGroupPath}}{{#each view.groupedContent}}{{view view.groupView content=content label=label}}{{/each}}{{else}}{{#each view.content}}{{view view.optionView content=this}}{{/each}}{{/if}}'),\n attributeBindings: ['multiple', 'disabled', 'tabindex', 'name'],\n\n /**\n The `multiple` attribute of the select element. Indicates whether multiple\n options can be selected.\n\n @property multiple\n @type Boolean\n @default false\n */\n multiple: false,\n\n /**\n The `disabled` attribute of the select element. Indicates whether\n the element is disabled from interactions.\n\n @property disabled\n @type Boolean\n @default false\n */\n disabled: false,\n\n /**\n The list of options.\n\n If `optionLabelPath` and `optionValuePath` are not overridden, this should\n be a list of strings, which will serve simultaneously as labels and values.\n\n Otherwise, this should be a list of objects. For instance:\n\n ```javascript\n Ember.Select.create({\n content: Ember.A([\n { id: 1, firstName: 'Yehuda' },\n { id: 2, firstName: 'Tom' }\n ]),\n optionLabelPath: 'content.firstName',\n optionValuePath: 'content.id'\n });\n ```\n\n @property content\n @type Array\n @default null\n */\n content: null,\n\n /**\n When `multiple` is `false`, the element of `content` that is currently\n selected, if any.\n\n When `multiple` is `true`, an array of such elements.\n\n @property selection\n @type Object or Array\n @default null\n */\n selection: null,\n\n /**\n In single selection mode (when `multiple` is `false`), value can be used to\n get the current selection's value or set the selection by it's value.\n\n It is not currently supported in multiple selection mode.\n\n @property value\n @type String\n @default null\n */\n value: Ember.computed(function(key, value) {\n if (arguments.length === 2) { return value; }\n var valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, '');\n return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection');\n }).property('selection'),\n\n /**\n If given, a top-most dummy option will be rendered to serve as a user\n prompt.\n\n @property prompt\n @type String\n @default null\n */\n prompt: null,\n\n /**\n The path of the option labels. See [content](/api/classes/Ember.Select.html#property_content).\n\n @property optionLabelPath\n @type String\n @default 'content'\n */\n optionLabelPath: 'content',\n\n /**\n The path of the option values. See [content](/api/classes/Ember.Select.html#property_content).\n\n @property optionValuePath\n @type String\n @default 'content'\n */\n optionValuePath: 'content',\n\n /**\n The path of the option group.\n When this property is used, `content` should be sorted by `optionGroupPath`.\n\n @property optionGroupPath\n @type String\n @default null\n */\n optionGroupPath: null,\n\n /**\n The view class for optgroup.\n\n @property groupView\n @type Ember.View\n @default Ember.SelectOptgroup\n */\n groupView: Ember.SelectOptgroup,\n\n groupedContent: Ember.computed(function() {\n var groupPath = get(this, 'optionGroupPath');\n var groupedContent = Ember.A();\n var content = get(this, 'content') || [];\n\n forEach(content, function(item) {\n var label = get(item, groupPath);\n\n if (get(groupedContent, 'lastObject.label') !== label) {\n groupedContent.pushObject({\n label: label,\n content: Ember.A()\n });\n }\n\n get(groupedContent, 'lastObject.content').push(item);\n });\n\n return groupedContent;\n }).property('optionGroupPath', 'content.@each'),\n\n /**\n The view class for option.\n\n @property optionView\n @type Ember.View\n @default Ember.SelectOption\n */\n optionView: Ember.SelectOption,\n\n _change: function() {\n if (get(this, 'multiple')) {\n this._changeMultiple();\n } else {\n this._changeSingle();\n }\n },\n\n selectionDidChange: Ember.observer('selection.@each', function() {\n var selection = get(this, 'selection');\n if (get(this, 'multiple')) {\n if (!isArray(selection)) {\n set(this, 'selection', Ember.A([selection]));\n return;\n }\n this._selectionDidChangeMultiple();\n } else {\n this._selectionDidChangeSingle();\n }\n }),\n\n valueDidChange: Ember.observer('value', function() {\n var content = get(this, 'content'),\n value = get(this, 'value'),\n valuePath = get(this, 'optionValuePath').replace(/^content\\.?/, ''),\n selectedValue = (valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection')),\n selection;\n\n if (value !== selectedValue) {\n selection = content ? content.find(function(obj) {\n return value === (valuePath ? get(obj, valuePath) : obj);\n }) : null;\n\n this.set('selection', selection);\n }\n }),\n\n\n _triggerChange: function() {\n var selection = get(this, 'selection');\n var value = get(this, 'value');\n\n if (!Ember.isNone(selection)) { this.selectionDidChange(); }\n if (!Ember.isNone(value)) { this.valueDidChange(); }\n\n this._change();\n },\n\n _changeSingle: function() {\n var selectedIndex = this.$()[0].selectedIndex,\n content = get(this, 'content'),\n prompt = get(this, 'prompt');\n\n if (!content || !get(content, 'length')) { return; }\n if (prompt && selectedIndex === 0) { set(this, 'selection', null); return; }\n\n if (prompt) { selectedIndex -= 1; }\n set(this, 'selection', content.objectAt(selectedIndex));\n },\n\n\n _changeMultiple: function() {\n var options = this.$('option:selected'),\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n content = get(this, 'content'),\n selection = get(this, 'selection');\n\n if (!content) { return; }\n if (options) {\n var selectedIndexes = options.map(function() {\n return this.index - offset;\n }).toArray();\n var newSelection = content.objectsAt(selectedIndexes);\n\n if (isArray(selection)) {\n replace(selection, 0, get(selection, 'length'), newSelection);\n } else {\n set(this, 'selection', newSelection);\n }\n }\n },\n\n _selectionDidChangeSingle: function() {\n var el = this.get('element');\n if (!el) { return; }\n\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectionIndex = content ? indexOf(content, selection) : -1,\n prompt = get(this, 'prompt');\n\n if (prompt) { selectionIndex += 1; }\n if (el) { el.selectedIndex = selectionIndex; }\n },\n\n _selectionDidChangeMultiple: function() {\n var content = get(this, 'content'),\n selection = get(this, 'selection'),\n selectedIndexes = content ? indexesOf(content, selection) : [-1],\n prompt = get(this, 'prompt'),\n offset = prompt ? 1 : 0,\n options = this.$('option'),\n adjusted;\n\n if (options) {\n options.each(function() {\n adjusted = this.index > -1 ? this.index - offset : -1;\n this.selected = indexOf(selectedIndexes, adjusted) > -1;\n });\n }\n },\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._triggerChange);\n this.on(\"change\", this, this._change);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/select");minispade.register('ember-handlebars/controls/text_area', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/controls/text_support\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The internal class used to create textarea element when the `{{textarea}}`\n helper is used.\n\n See [handlebars.helpers.textarea](/api/classes/Ember.Handlebars.helpers.html#method_textarea) for usage details.\n\n ## Layout and LayoutName properties\n\n Because HTML `textarea` elements do not contain inner HTML the `layout` and\n `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextArea\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n*/\nEmber.TextArea = Ember.Component.extend(Ember.TextSupport, {\n classNames: ['ember-text-area'],\n\n tagName: \"textarea\",\n attributeBindings: ['rows', 'cols', 'name'],\n rows: null,\n cols: null,\n\n _updateElementValue: Ember.observer('value', function() {\n // We do this check so cursor position doesn't get affected in IE\n var value = get(this, 'value'),\n $el = this.$();\n if ($el && value !== $el.val()) {\n $el.val(value);\n }\n }),\n\n init: function() {\n this._super();\n this.on(\"didInsertElement\", this, this._updateElementValue);\n }\n\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_area");minispade.register('ember-handlebars/controls/text_field', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-handlebars/controls/text_support\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n\n The internal class used to create text inputs when the `{{input}}`\n helper is used with `type` of `text`.\n\n See [handlebars.helpers.input](/api/classes/Ember.Handlebars.helpers.html#method_input) for usage details.\n\n ## Layout and LayoutName properties\n\n Because HTML `input` elements are self closing `layout` and `layoutName`\n properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s\n layout section for more information.\n\n @class TextField\n @namespace Ember\n @extends Ember.Component\n @uses Ember.TextSupport\n*/\nEmber.TextField = Ember.Component.extend(Ember.TextSupport,\n /** @scope Ember.TextField.prototype */ {\n\n classNames: ['ember-text-field'],\n tagName: \"input\",\n attributeBindings: ['type', 'value', 'size', 'pattern', 'name'],\n\n /**\n The `value` attribute of the input element. As the user inputs text, this\n property is updated live.\n\n @property value\n @type String\n @default \"\"\n */\n value: \"\",\n\n /**\n The `type` attribute of the input element.\n\n @property type\n @type String\n @default \"text\"\n */\n type: \"text\",\n\n /**\n The `size` of the text field in characters.\n\n @property size\n @type String\n @default null\n */\n size: null,\n\n /**\n The `pattern` the pattern attribute of input element.\n\n @property pattern\n @type String\n @default null\n */\n pattern: null\n});\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_field");minispade.register('ember-handlebars/controls/text_support', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Shared mixin used by `Ember.TextField` and `Ember.TextArea`.\n\n @class TextSupport\n @namespace Ember\n @private\n*/\nEmber.TextSupport = Ember.Mixin.create({\n value: \"\",\n\n attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex', 'readonly'],\n placeholder: null,\n disabled: false,\n maxlength: null,\n\n init: function() {\n this._super();\n this.on(\"focusOut\", this, this._elementValueDidChange);\n this.on(\"change\", this, this._elementValueDidChange);\n this.on(\"paste\", this, this._elementValueDidChange);\n this.on(\"cut\", this, this._elementValueDidChange);\n this.on(\"input\", this, this._elementValueDidChange);\n this.on(\"keyUp\", this, this.interpretKeyEvents);\n },\n\n /**\n The action to be sent when the user presses the return key.\n\n This is similar to the `{{action}}` helper, but is fired when\n the user presses the return key when editing a text field, and sends\n the value of the field as the context.\n\n @property action\n @type String\n @default null\n */\n action: null,\n\n /**\n The event that should send the action.\n\n Options are:\n\n * `enter`: the user pressed enter\n * `keyPress`: the user pressed a key\n\n @property onEvent\n @type String\n @default enter\n */\n onEvent: 'enter',\n\n /**\n Whether they `keyUp` event that triggers an `action` to be sent continues\n propagating to other views.\n\n By default, when the user presses the return key on their keyboard and\n the text field has an `action` set, the action will be sent to the view's\n controller and the key event will stop propagating.\n\n If you would like parent views to receive the `keyUp` event even after an\n action has been dispatched, set `bubbles` to true.\n\n @property bubbles\n @type Boolean\n @default false\n */\n bubbles: false,\n\n interpretKeyEvents: function(event) {\n var map = Ember.TextSupport.KEY_EVENTS;\n var method = map[event.keyCode];\n\n this._elementValueDidChange();\n if (method) { return this[method](event); }\n },\n\n _elementValueDidChange: function() {\n set(this, 'value', this.$().val());\n },\n\n /**\n The action to be sent when the user inserts a new line.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 13.\n Uses sendAction to send the `enter` action to the controller.\n\n @method insertNewline\n @param {Event} event\n */\n insertNewline: function(event) {\n sendAction('enter', this, event);\n sendAction('insert-newline', this, event);\n },\n\n /**\n Called when the user hits escape.\n\n Called by the `Ember.TextSupport` mixin on keyUp if keycode matches 27.\n Uses sendAction to send the `escape-press` action to the controller.\n\n @method cancel\n @param {Event} event\n */\n cancel: function(event) {\n sendAction('escape-press', this, event);\n },\n\n /**\n Called when the text area is focused.\n\n @method focusIn\n @param {Event} event\n */\n focusIn: function(event) {\n sendAction('focus-in', this, event);\n },\n\n /**\n Called when the text area is blurred.\n\n @method focusOut\n @param {Event} event\n */\n focusOut: function(event) {\n sendAction('focus-out', this, event);\n },\n\n /**\n The action to be sent when the user presses a key. Enabled by setting\n the `onEvent` property to `keyPress`.\n\n Uses sendAction to send the `keyPress` action to the controller.\n\n @method keyPress\n @param {Event} event\n */\n keyPress: function(event) {\n sendAction('key-press', this, event);\n }\n\n});\n\nEmber.TextSupport.KEY_EVENTS = {\n 13: 'insertNewline',\n 27: 'cancel'\n};\n\n// In principle, this shouldn't be necessary, but the legacy\n// sectionAction semantics for TextField are different from\n// the component semantics so this method normalizes them.\nfunction sendAction(eventName, view, event) {\n var action = get(view, eventName),\n on = get(view, 'onEvent'),\n value = get(view, 'value');\n\n // back-compat support for keyPress as an event name even though\n // it's also a method name that consumes the event (and therefore\n // incompatible with sendAction semantics).\n if (on === eventName || (on === 'keyPress' && eventName === 'key-press')) {\n view.sendAction('action', value);\n }\n\n view.sendAction(eventName, value);\n\n if (action || on === eventName) {\n if(!get(view, 'bubbles')) {\n event.stopPropagation();\n }\n }\n}\n\n})();\n//@ sourceURL=ember-handlebars/controls/text_support");minispade.register('ember-handlebars/ext', "(function() {minispade.require('ember-handlebars-compiler');\n\nvar slice = Array.prototype.slice,\n originalTemplate = Ember.Handlebars.template;\n\n/**\n @private\n\n If a path starts with a reserved keyword, returns the root\n that should be used.\n\n @method normalizePath\n @for Ember\n @param root {Object}\n @param path {String}\n @param data {Hash}\n*/\nvar normalizePath = Ember.Handlebars.normalizePath = function(root, path, data) {\n var keywords = (data && data.keywords) || {},\n keyword, isKeyword;\n\n // Get the first segment of the path. For example, if the\n // path is \"foo.bar.baz\", returns \"foo\".\n keyword = path.split('.', 1)[0];\n\n // Test to see if the first path is a keyword that has been\n // passed along in the view's data hash. If so, we will treat\n // that object as the new root.\n if (keywords.hasOwnProperty(keyword)) {\n // Look up the value in the template's data hash.\n root = keywords[keyword];\n isKeyword = true;\n\n // Handle cases where the entire path is the reserved\n // word. In that case, return the object itself.\n if (path === keyword) {\n path = '';\n } else {\n // Strip the keyword from the path and look up\n // the remainder from the newly found root.\n path = path.substr(keyword.length+1);\n }\n }\n\n return { root: root, path: path, isKeyword: isKeyword };\n};\n\n\n/**\n Lookup both on root and on window. If the path starts with\n a keyword, the corresponding object will be looked up in the\n template's data hash and used to resolve the path.\n\n @method get\n @for Ember.Handlebars\n @param {Object} root The object to look up the property on\n @param {String} path The path to be lookedup\n @param {Object} options The template's option hash\n*/\nvar handlebarsGet = Ember.Handlebars.get = function(root, path, options) {\n var data = options && options.data,\n normalizedPath = normalizePath(root, path, data),\n value;\n\n // In cases where the path begins with a keyword, change the\n // root to the value represented by that keyword, and ensure\n // the path is relative to it.\n root = normalizedPath.root;\n path = normalizedPath.path;\n\n value = Ember.get(root, path);\n\n // If the path starts with a capital letter, look it up on Ember.lookup,\n // which defaults to the `window` object in browsers.\n if (value === undefined && root !== Ember.lookup && Ember.isGlobalPath(path)) {\n value = Ember.get(Ember.lookup, path);\n }\n return value;\n};\n\nEmber.Handlebars.resolveParams = function(context, params, options) {\n var resolvedParams = [], types = options.types, param, type;\n\n for (var i=0, l=params.length; i<l; i++) {\n param = params[i];\n type = types[i];\n\n if (type === 'ID') {\n resolvedParams.push(handlebarsGet(context, param, options));\n } else {\n resolvedParams.push(param);\n }\n }\n\n return resolvedParams;\n};\n\nEmber.Handlebars.resolveHash = function(context, hash, options) {\n var resolvedHash = {}, types = options.hashTypes, type;\n\n for (var key in hash) {\n if (!hash.hasOwnProperty(key)) { continue; }\n\n type = types[key];\n\n if (type === 'ID') {\n resolvedHash[key] = handlebarsGet(context, hash[key], options);\n } else {\n resolvedHash[key] = hash[key];\n }\n }\n\n return resolvedHash;\n};\n\n/**\n @private\n\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('helperMissing', function(path) {\n var error, view = \"\";\n\n var options = arguments[arguments.length - 1];\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n\n var helper = Ember.Handlebars.resolveHelper(options.data.view.container, path);\n\n if (helper) {\n return helper.apply(this, slice.call(arguments, 1));\n }\n }\n\n error = \"%@ Handlebars error: Could not find property '%@' on object %@.\";\n if (options.data) {\n view = options.data.view;\n }\n throw new Ember.Error(Ember.String.fmt(error, [view, path, this]));\n});\n\n/**\n @private\n\n Registers a helper in Handlebars that will be called if no property with the\n given name can be found on the current context object, and no helper with\n that name is registered.\n\n This throws an exception with a more helpful error message so the user can\n track down where the problem is happening.\n\n @method helperMissing\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n*/\nEmber.Handlebars.registerHelper('blockHelperMissing', function(path) {\n\n var options = arguments[arguments.length - 1];\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n\n var helper = Ember.Handlebars.resolveHelper(options.data.view.container, path);\n\n if (helper) {\n return helper.apply(this, slice.call(arguments, 1));\n }\n }\n\n return Handlebars.helpers.blockHelperMissing.apply(this, arguments);\n});\n\n/**\n Register a bound handlebars helper. Bound helpers behave similarly to regular\n handlebars helpers, with the added ability to re-render when the underlying data\n changes.\n\n ## Simple example\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalize', function(value) {\n return value.toUpperCase();\n });\n ```\n\n The above bound helper can be used inside of templates as follows:\n\n ```handlebars\n {{capitalize name}}\n ```\n\n In this case, when the `name` property of the template's context changes,\n the rendered value of the helper will update to reflect this change.\n\n ## Example with options\n\n Like normal handlebars helpers, bound helpers have access to the options\n passed into the helper call.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('repeat', function(value, options) {\n var count = options.hash.count;\n var a = [];\n while(a.length < count) {\n a.push(value);\n }\n return a.join('');\n });\n ```\n\n This helper could be used in a template as follows:\n\n ```handlebars\n {{repeat text count=3}}\n ```\n\n ## Example with bound options\n\n Bound hash options are also supported. Example:\n\n ```handlebars\n {{repeat text countBinding=\"numRepeats\"}}\n ```\n\n In this example, count will be bound to the value of\n the `numRepeats` property on the context. If that property\n changes, the helper will be re-rendered.\n\n ## Example with extra dependencies\n\n The `Ember.Handlebars.registerBoundHelper` method takes a variable length\n third parameter which indicates extra dependencies on the passed in value.\n This allows the handlebars helper to update when these dependencies change.\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('capitalizeName', function(value) {\n return value.get('name').toUpperCase();\n }, 'name');\n ```\n\n ## Example with multiple bound properties\n\n `Ember.Handlebars.registerBoundHelper` supports binding to\n multiple properties, e.g.:\n\n ```javascript\n Ember.Handlebars.registerBoundHelper('concatenate', function() {\n var values = Array.prototype.slice.call(arguments, 0, -1);\n return values.join('||');\n });\n ```\n\n Which allows for template syntax such as `{{concatenate prop1 prop2}}` or\n `{{concatenate prop1 prop2 prop3}}`. If any of the properties change,\n the helpr will re-render. Note that dependency keys cannot be\n using in conjunction with multi-property helpers, since it is ambiguous\n which property the dependent keys would belong to.\n\n ## Use with unbound helper\n\n The `{{unbound}}` helper can be used with bound helper invocations\n to render them in their unbound form, e.g.\n\n ```handlebars\n {{unbound capitalize name}}\n ```\n\n In this example, if the name property changes, the helper\n will not re-render.\n\n ## Use with blocks not supported\n\n Bound helpers do not support use with Handlebars blocks or\n the addition of child views of any kind.\n\n @method registerBoundHelper\n @for Ember.Handlebars\n @param {String} name\n @param {Function} function\n @param {String} dependentKeys*\n*/\nEmber.Handlebars.registerBoundHelper = function(name, fn) {\n var boundHelperArgs = slice.call(arguments, 1),\n boundFn = Ember.Handlebars.makeBoundHelper.apply(this, boundHelperArgs);\n Ember.Handlebars.registerHelper(name, boundFn);\n};\n\n/**\n @private\n\n A (mostly) private helper function to `registerBoundHelper`. Takes the\n provided Handlebars helper function fn and returns it in wrapped\n bound helper form.\n\n The main use case for using this outside of `registerBoundHelper`\n is for registering helpers on the container:\n\n ```js\n var boundHelperFn = Ember.Handlebars.makeBoundHelper(function(word) {\n return word.toUpperCase();\n });\n\n container.register('helper:my-bound-helper', boundHelperFn);\n ```\n\n In the above example, if the helper function hadn't been wrapped in\n `makeBoundHelper`, the registered helper would be unbound.\n\n @method makeBoundHelper\n @for Ember.Handlebars\n @param {Function} function\n @param {String} dependentKeys*\n*/\nEmber.Handlebars.makeBoundHelper = function(fn) {\n var dependentKeys = slice.call(arguments, 1);\n\n function helper() {\n var properties = slice.call(arguments, 0, -1),\n numProperties = properties.length,\n options = arguments[arguments.length - 1],\n normalizedProperties = [],\n types = options.types,\n data = options.data,\n hash = options.hash,\n view = data.view,\n contexts = options.contexts,\n currentContext = (contexts && contexts.length) ? contexts[0] : this,\n prefixPathForDependentKeys = '',\n loc, len, hashOption,\n boundOption, property,\n normalizedValue = Ember._SimpleHandlebarsView.prototype.normalizedValue;\n\n Ember.assert(\"registerBoundHelper-generated helpers do not support use with Handlebars blocks.\", !options.fn);\n\n // Detect bound options (e.g. countBinding=\"otherCount\")\n var boundOptions = hash.boundOptions = {};\n for (hashOption in hash) {\n if (Ember.IS_BINDING.test(hashOption)) {\n // Lop off 'Binding' suffix.\n boundOptions[hashOption.slice(0, -7)] = hash[hashOption];\n }\n }\n\n // Expose property names on data.properties object.\n var watchedProperties = [];\n data.properties = [];\n for (loc = 0; loc < numProperties; ++loc) {\n data.properties.push(properties[loc]);\n if (types[loc] === 'ID') {\n var normalizedProp = normalizePath(currentContext, properties[loc], data);\n normalizedProperties.push(normalizedProp);\n watchedProperties.push(normalizedProp);\n } else {\n normalizedProperties.push(null);\n }\n }\n\n // Handle case when helper invocation is preceded by `unbound`, e.g.\n // {{unbound myHelper foo}}\n if (data.isUnbound) {\n return evaluateUnboundHelper(this, fn, normalizedProperties, options);\n }\n\n var bindView = new Ember._SimpleHandlebarsView(null, null, !options.hash.unescaped, options.data);\n\n // Override SimpleHandlebarsView's method for generating the view's content.\n bindView.normalizedValue = function() {\n var args = [], boundOption;\n\n // Copy over bound hash options.\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n property = normalizePath(currentContext, boundOptions[boundOption], data);\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n hash[boundOption] = normalizedValue.call(bindView);\n }\n\n for (loc = 0; loc < numProperties; ++loc) {\n property = normalizedProperties[loc];\n if (property) {\n bindView.path = property.path;\n bindView.pathRoot = property.root;\n args.push(normalizedValue.call(bindView));\n } else {\n args.push(properties[loc]);\n }\n }\n args.push(options);\n\n // Run the supplied helper function.\n return fn.apply(currentContext, args);\n };\n\n view.appendChild(bindView);\n\n // Assemble list of watched properties that'll re-render this helper.\n for (boundOption in boundOptions) {\n if (boundOptions.hasOwnProperty(boundOption)) {\n watchedProperties.push(normalizePath(currentContext, boundOptions[boundOption], data));\n }\n }\n\n // Observe each property.\n for (loc = 0, len = watchedProperties.length; loc < len; ++loc) {\n property = watchedProperties[loc];\n view.registerObserver(property.root, property.path, bindView, bindView.rerender);\n }\n\n if (types[0] !== 'ID' || normalizedProperties.length === 0) {\n return;\n }\n\n // Add dependent key observers to the first param\n var normalized = normalizedProperties[0],\n pathRoot = normalized.root,\n path = normalized.path;\n\n if(!Ember.isEmpty(path)) {\n prefixPathForDependentKeys = path + '.';\n }\n for (var i=0, l=dependentKeys.length; i<l; i++) {\n view.registerObserver(pathRoot, prefixPathForDependentKeys + dependentKeys[i], bindView, bindView.rerender);\n }\n }\n\n helper._rawFunction = fn;\n return helper;\n};\n\n/**\n @private\n\n Renders the unbound form of an otherwise bound helper function.\n\n @method evaluateUnboundHelper\n @param {Function} fn\n @param {Object} context\n @param {Array} normalizedProperties\n @param {String} options\n*/\nfunction evaluateUnboundHelper(context, fn, normalizedProperties, options) {\n var args = [], hash = options.hash, boundOptions = hash.boundOptions, loc, len, property, boundOption;\n\n for (boundOption in boundOptions) {\n if (!boundOptions.hasOwnProperty(boundOption)) { continue; }\n hash[boundOption] = Ember.Handlebars.get(context, boundOptions[boundOption], options);\n }\n\n for(loc = 0, len = normalizedProperties.length; loc < len; ++loc) {\n property = normalizedProperties[loc];\n args.push(Ember.Handlebars.get(property.root, property.path, options));\n }\n args.push(options);\n return fn.apply(context, args);\n}\n\n/**\n @private\n\n Overrides Handlebars.template so that we can distinguish\n user-created, top-level templates from inner contexts.\n\n @method template\n @for Ember.Handlebars\n @param {String} spec\n*/\nEmber.Handlebars.template = function(spec) {\n var t = originalTemplate(spec);\n t.isTop = true;\n return t;\n};\n\n})();\n//@ sourceURL=ember-handlebars/ext");minispade.register('ember-handlebars/helpers', "(function() {minispade.require(\"ember-handlebars/helpers/shared\");\nminispade.require(\"ember-handlebars/helpers/binding\");\nminispade.require(\"ember-handlebars/helpers/collection\");\nminispade.require(\"ember-handlebars/helpers/view\");\nminispade.require(\"ember-handlebars/helpers/unbound\");\nminispade.require(\"ember-handlebars/helpers/debug\");\nminispade.require(\"ember-handlebars/helpers/each\");\nminispade.require(\"ember-handlebars/helpers/template\");\nminispade.require(\"ember-handlebars/helpers/partial\");\nminispade.require(\"ember-handlebars/helpers/yield\");\nminispade.require(\"ember-handlebars/helpers/loc\");\n\n})();\n//@ sourceURL=ember-handlebars/helpers");minispade.register('ember-handlebars/helpers/binding', "(function() {minispade.require('ember-handlebars/ext');\nminispade.require('ember-handlebars/views/handlebars_bound_view');\nminispade.require('ember-handlebars/views/metamorph_view');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\nvar handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\nvar forEach = Ember.ArrayPolyfills.forEach;\n\nvar EmberHandlebars = Ember.Handlebars, helpers = EmberHandlebars.helpers;\n\nfunction exists(value) {\n return !Ember.isNone(value);\n}\n\n// Binds a property into the DOM. This will create a hook in DOM that the\n// KVO system will look for and update if the property changes.\nfunction bind(property, options, preserveContext, shouldDisplay, valueNormalizer, childProperties) {\n var data = options.data,\n fn = options.fn,\n inverse = options.inverse,\n view = data.view,\n currentContext = this,\n normalized, observer, i;\n\n normalized = normalizePath(currentContext, property, data);\n\n // Set up observers for observable objects\n if ('object' === typeof this) {\n if (data.insideGroup) {\n observer = function() {\n Ember.run.once(view, 'rerender');\n };\n\n var template, context, result = handlebarsGet(currentContext, property, options);\n\n result = valueNormalizer ? valueNormalizer(result) : result;\n\n context = preserveContext ? currentContext : result;\n if (shouldDisplay(result)) {\n template = fn;\n } else if (inverse) {\n template = inverse;\n }\n\n template(context, { data: options.data });\n } else {\n // Create the view that will wrap the output of this template/property\n // and add it to the nearest view's childViews array.\n // See the documentation of Ember._HandlebarsBoundView for more.\n var bindView = view.createChildView(Ember._HandlebarsBoundView, {\n preserveContext: preserveContext,\n shouldDisplayFunc: shouldDisplay,\n valueNormalizerFunc: valueNormalizer,\n displayTemplate: fn,\n inverseTemplate: inverse,\n path: property,\n pathRoot: currentContext,\n previousContext: currentContext,\n isEscaped: !options.hash.unescaped,\n templateData: options.data\n });\n\n view.appendChild(bindView);\n\n observer = function() {\n Ember.run.scheduleOnce('render', bindView, 'rerenderIfNeeded');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n if (childProperties) {\n for (i=0; i<childProperties.length; i++) {\n view.registerObserver(normalized.root, normalized.path+'.'+childProperties[i], observer);\n }\n }\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n data.buffer.push(handlebarsGet(currentContext, property, options));\n }\n}\n\nfunction simpleBind(currentContext, property, options) {\n var data = options.data,\n view = data.view,\n normalized, observer, pathRoot, output;\n\n normalized = normalizePath(currentContext, property, data);\n pathRoot = normalized.root;\n\n // Set up observers for observable objects\n if (pathRoot && ('object' === typeof pathRoot)) {\n if (data.insideGroup) {\n observer = function() {\n Ember.run.once(view, 'rerender');\n };\n\n var result = handlebarsGet(currentContext, property, options);\n if (result === null || result === undefined) { result = \"\"; }\n data.buffer.push(result);\n } else {\n var bindView = new Ember._SimpleHandlebarsView(\n property, currentContext, !options.hash.unescaped, options.data\n );\n\n bindView._parentView = view;\n view.appendChild(bindView);\n\n observer = function() {\n Ember.run.scheduleOnce('render', bindView, 'rerender');\n };\n }\n\n // Observes the given property on the context and\n // tells the Ember._HandlebarsBoundView to re-render. If property\n // is an empty string, we are printing the current context\n // object ({{this}}) so updating it is not our responsibility.\n if (normalized.path !== '') {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n } else {\n // The object is not observable, so just render it out and\n // be done with it.\n output = handlebarsGet(currentContext, property, options);\n data.buffer.push((output === null || typeof output === 'undefined') ? '' : output);\n }\n}\n\n/**\n @private\n\n '_triageMustache' is used internally select between a binding, helper, or component for\n the given context. Until this point, it would be hard to determine if the\n mustache is a property reference or a regular helper reference. This triage\n helper resolves that.\n\n This would not be typically invoked by directly.\n\n @method _triageMustache\n @for Ember.Handlebars.helpers\n @param {String} property Property/helperID to triage\n @param {Object} options hash of template/rendering options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('_triageMustache', function(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the _triageMustache helper\", arguments.length <= 2);\n\n if (helpers[property]) {\n return helpers[property].call(this, options);\n }\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n\n var helper = Ember.Handlebars.resolveHelper(options.data.view.container, property);\n if (helper) {\n return helper.call(this, options);\n }\n }\n\n return helpers.bind.call(this, property, options);\n});\n\nEmber.Handlebars.resolveHelper = function(container, name) {\n\n if (!container || name.indexOf('-') === -1) {\n return;\n }\n\n var helper = container.lookup('helper:' + name);\n if (!helper) {\n var componentLookup = container.lookup('component-lookup:main');\n Ember.assert(\"Could not find 'component-lookup:main' on the provided container, which is necessary for performing component lookups\", componentLookup);\n\n var Component = componentLookup.lookupFactory(name, container);\n if (Component) {\n helper = EmberHandlebars.makeViewHelper(Component);\n container.register('helper:' + name, helper);\n }\n }\n return helper;\n};\n\n/**\n @private\n\n `bind` can be used to display a value, then update that value if it\n changes. For example, if you wanted to print the `title` property of\n `content`:\n\n ```handlebars\n {{bind \"content.title\"}}\n ```\n\n This will return the `title` property as a string, then create a new observer\n at the specified path. If it changes, it will update the value in DOM. Note\n that if you need to support IE7 and IE8 you must modify the model objects\n properties using `Ember.get()` and `Ember.set()` for this to work as it\n relies on Ember's KVO system. For all other browsers this will be handled for\n you automatically.\n\n @method bind\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bind', function(property, options) {\n Ember.assert(\"You cannot pass more than one argument to the bind helper\", arguments.length <= 2);\n\n var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this;\n\n if (!options.fn) {\n return simpleBind(context, property, options);\n }\n\n return bind.call(context, property, options, false, exists);\n});\n\n/**\n @private\n\n Use the `boundIf` helper to create a conditional that re-evaluates\n whenever the truthiness of the bound value changes.\n\n ```handlebars\n {{#boundIf \"content.shouldDisplayTitle\"}}\n {{content.title}}\n {{/boundIf}}\n ```\n\n @method boundIf\n @for Ember.Handlebars.helpers\n @param {String} property Property to bind\n @param {Function} fn Context to provide for rendering\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('boundIf', function(property, fn) {\n var context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : this;\n var func = function(result) {\n var truthy = result && get(result, 'isTruthy');\n if (typeof truthy === 'boolean') { return truthy; }\n\n if (Ember.isArray(result)) {\n return get(result, 'length') !== 0;\n } else {\n return !!result;\n }\n };\n\n return bind.call(context, property, fn, true, func, func, ['isTruthy', 'length']);\n});\n\n/**\n @method with\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('with', function(context, options) {\n if (arguments.length === 4) {\n var keywordName, path, rootPath, normalized;\n\n Ember.assert(\"If you pass more than one argument to the with helper, it must be in the form #with foo as bar\", arguments[1] === \"as\");\n options = arguments[3];\n keywordName = arguments[2];\n path = arguments[0];\n\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n if (Ember.isGlobalPath(path)) {\n Ember.bind(options.data.keywords, keywordName, path);\n } else {\n normalized = normalizePath(this, path, options.data);\n path = normalized.path;\n rootPath = normalized.root;\n\n // This is a workaround for the fact that you cannot bind separate objects\n // together. When we implement that functionality, we should use it here.\n var contextKey = Ember.$.expando + Ember.guidFor(rootPath);\n options.data.keywords[contextKey] = rootPath;\n\n // if the path is '' (\"this\"), just bind directly to the current context\n var contextPath = path ? contextKey + '.' + path : contextKey;\n Ember.bind(options.data.keywords, keywordName, contextPath);\n }\n\n return bind.call(this, path, options, true, exists);\n } else {\n Ember.assert(\"You must pass exactly one argument to the with helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the with helper\", options.fn && options.fn !== Handlebars.VM.noop);\n return helpers.bind.call(options.contexts[0], context, options);\n }\n});\n\n\n/**\n See [boundIf](/api/classes/Ember.Handlebars.helpers.html#method_boundIf)\n\n @method if\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('if', function(context, options) {\n Ember.assert(\"You must pass exactly one argument to the if helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the if helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n return helpers.boundIf.call(options.contexts[0], context, options);\n});\n\n/**\n @method unless\n @for Ember.Handlebars.helpers\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('unless', function(context, options) {\n Ember.assert(\"You must pass exactly one argument to the unless helper\", arguments.length === 2);\n Ember.assert(\"You must pass a block to the unless helper\", options.fn && options.fn !== Handlebars.VM.noop);\n\n var fn = options.fn, inverse = options.inverse;\n\n options.fn = inverse;\n options.inverse = fn;\n\n return helpers.boundIf.call(options.contexts[0], context, options);\n});\n\n/**\n `bind-attr` allows you to create a binding between DOM element attributes and\n Ember objects. For example:\n\n ```handlebars\n <img {{bind-attr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n The above handlebars template will fill the `<img>`'s `src` attribute will\n the value of the property referenced with `\"imageUrl\"` and its `alt`\n attribute with the value of the property referenced with `\"imageTitle\"`.\n\n If the rendering context of this template is the following object:\n\n ```javascript\n {\n imageUrl: 'http://lolcats.info/haz-a-funny',\n imageTitle: 'A humorous image of a cat'\n }\n ```\n\n The resulting HTML output will be:\n\n ```html\n <img src=\"http://lolcats.info/haz-a-funny\" alt=\"A humorous image of a cat\">\n ```\n\n `bind-attr` cannot redeclare existing DOM element attributes. The use of `src`\n in the following `bind-attr` example will be ignored and the hard coded value\n of `src=\"/failwhale.gif\"` will take precedence:\n\n ```handlebars\n <img src=\"/failwhale.gif\" {{bind-attr src=\"imageUrl\" alt=\"imageTitle\"}}>\n ```\n\n ### `bind-attr` and the `class` attribute\n\n `bind-attr` supports a special syntax for handling a number of cases unique\n to the `class` DOM element attribute. The `class` attribute combines\n multiple discrete values into a single attribute as a space-delimited\n list of strings. Each string can be:\n\n * a string return value of an object's property.\n * a boolean return value of an object's property\n * a hard-coded value\n\n A string return value works identically to other uses of `bind-attr`. The\n return value of the property will become the value of the attribute. For\n example, the following view and template:\n\n ```javascript\n AView = Ember.View.extend({\n someProperty: function() {\n return \"aValue\";\n }.property()\n })\n ```\n\n ```handlebars\n <img {{bind-attr class=\"view.someProperty}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"aValue\">\n ```\n\n A boolean return value will insert a specified class name if the property\n returns `true` and remove the class name if the property returns `false`.\n\n A class name is provided via the syntax\n `somePropertyName:class-name-if-true`.\n\n ```javascript\n AView = Ember.View.extend({\n someBool: true\n })\n ```\n\n ```handlebars\n <img {{bind-attr class=\"view.someBool:class-name-if-true\"}}>\n ```\n\n Result in the following rendered output:\n\n ```html\n <img class=\"class-name-if-true\">\n ```\n\n An additional section of the binding can be provided if you want to\n replace the existing class instead of removing it when the boolean\n value changes:\n\n ```handlebars\n <img {{bind-attr class=\"view.someBool:class-name-if-true:class-name-if-false\"}}>\n ```\n\n A hard-coded value can be used by prepending `:` to the desired\n class name: `:class-name-to-always-apply`.\n\n ```handlebars\n <img {{bind-attr class=\":class-name-to-always-apply\"}}>\n ```\n\n Results in the following rendered output:\n\n ```html\n <img class=\"class-name-to-always-apply\">\n ```\n\n All three strategies - string return value, boolean return value, and\n hard-coded value – can be combined in a single declaration:\n\n ```handlebars\n <img {{bind-attr class=\":class-name-to-always-apply view.someBool:class-name-if-true view.someProperty\"}}>\n ```\n\n @method bind-attr\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bind-attr', function(options) {\n\n var attrs = options.hash;\n\n Ember.assert(\"You must specify at least one hash argument to bind-attr\", !!Ember.keys(attrs).length);\n\n var view = options.data.view;\n var ret = [];\n var ctx = this;\n\n // Generate a unique id for this element. This will be added as a\n // data attribute to the element so it can be looked up when\n // the bound property changes.\n var dataId = ++Ember.uuid;\n\n // Handle classes differently, as we can bind multiple classes\n var classBindings = attrs['class'];\n if (classBindings != null) {\n var classResults = EmberHandlebars.bindClasses(this, classBindings, view, dataId, options);\n\n ret.push('class=\"' + Handlebars.Utils.escapeExpression(classResults.join(' ')) + '\"');\n delete attrs['class'];\n }\n\n var attrKeys = Ember.keys(attrs);\n\n // For each attribute passed, create an observer and emit the\n // current value of the property as an attribute.\n forEach.call(attrKeys, function(attr) {\n var path = attrs[attr],\n normalized;\n\n Ember.assert(fmt(\"You must provide an expression as the value of bound attribute. You specified: %@=%@\", [attr, path]), typeof path === 'string');\n\n normalized = normalizePath(ctx, path, options.data);\n\n var value = (path === 'this') ? normalized.root : handlebarsGet(ctx, path, options),\n type = Ember.typeOf(value);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [value]), value === null || value === undefined || type === 'number' || type === 'string' || type === 'boolean');\n\n var observer, invoker;\n\n observer = function observer() {\n var result = handlebarsGet(ctx, path, options);\n\n Ember.assert(fmt(\"Attributes must be numbers, strings or booleans, not %@\", [result]), result === null || result === undefined || typeof result === 'number' || typeof result === 'string' || typeof result === 'boolean');\n\n var elem = view.$(\"[data-bindattr-\" + dataId + \"='\" + dataId + \"']\");\n\n // If we aren't able to find the element, it means the element\n // to which we were bound has been removed from the view.\n // In that case, we can assume the template has been re-rendered\n // and we need to clean up the observer.\n if (!elem || elem.length === 0) {\n Ember.removeObserver(normalized.root, normalized.path, invoker);\n return;\n }\n\n Ember.View.applyAttributeBindings(elem, attr, result);\n };\n\n // Add an observer to the view for when the property changes.\n // When the observer fires, find the element using the\n // unique data id and update the attribute to the new value.\n // Note: don't add observer when path is 'this' or path\n // is whole keyword e.g. {{#each x in list}} ... {{bind-attr attr=\"x\"}}\n if (path !== 'this' && !(normalized.isKeyword && normalized.path === '' )) {\n view.registerObserver(normalized.root, normalized.path, observer);\n }\n\n // if this changes, also change the logic in ember-views/lib/views/view.js\n if ((type === 'string' || (type === 'number' && !isNaN(value)))) {\n ret.push(attr + '=\"' + Handlebars.Utils.escapeExpression(value) + '\"');\n } else if (value && type === 'boolean') {\n // The developer controls the attr name, so it should always be safe\n ret.push(attr + '=\"' + attr + '\"');\n }\n }, this);\n\n // Add the unique identifier\n // NOTE: We use all lower-case since Firefox has problems with mixed case in SVG\n ret.push('data-bindattr-' + dataId + '=\"' + dataId + '\"');\n return new EmberHandlebars.SafeString(ret.join(' '));\n});\n\n/**\n See `bind-attr`\n\n @method bindAttr\n @for Ember.Handlebars.helpers\n @deprecated\n @param {Function} context\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('bindAttr', EmberHandlebars.helpers['bind-attr']);\n\n/**\n @private\n\n Helper that, given a space-separated string of property paths and a context,\n returns an array of class names. Calling this method also has the side\n effect of setting up observers at those property paths, such that if they\n change, the correct class name will be reapplied to the DOM element.\n\n For example, if you pass the string \"fooBar\", it will first look up the\n \"fooBar\" value of the context. If that value is true, it will add the\n \"foo-bar\" class to the current element (i.e., the dasherized form of\n \"fooBar\"). If the value is a string, it will add that string as the class.\n Otherwise, it will not add any new class name.\n\n @method bindClasses\n @for Ember.Handlebars\n @param {Ember.Object} context The context from which to lookup properties\n @param {String} classBindings A string, space-separated, of class bindings\n to use\n @param {Ember.View} view The view in which observers should look for the\n element to update\n @param {Srting} bindAttrId Optional bindAttr id used to lookup elements\n @return {Array} An array of class names to add\n*/\nEmberHandlebars.bindClasses = function(context, classBindings, view, bindAttrId, options) {\n var ret = [], newClass, value, elem;\n\n // Helper method to retrieve the property from the context and\n // determine which class string to return, based on whether it is\n // a Boolean or not.\n var classStringForPath = function(root, parsedPath, options) {\n var val,\n path = parsedPath.path;\n\n if (path === 'this') {\n val = root;\n } else if (path === '') {\n val = true;\n } else {\n val = handlebarsGet(root, path, options);\n }\n\n return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n };\n\n // For each property passed, loop through and setup\n // an observer.\n forEach.call(classBindings.split(' '), function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n\n var observer, invoker;\n\n var parsedPath = Ember.View._parsePropertyPath(binding),\n path = parsedPath.path,\n pathRoot = context,\n normalized;\n\n if (path !== '' && path !== 'this') {\n normalized = normalizePath(context, path, options.data);\n\n pathRoot = normalized.root;\n path = normalized.path;\n }\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n observer = function() {\n // Get the current value of the property\n newClass = classStringForPath(context, parsedPath, options);\n elem = bindAttrId ? view.$(\"[data-bindattr-\" + bindAttrId + \"='\" + bindAttrId + \"']\") : view.$();\n\n // If we can't find the element anymore, a parent template has been\n // re-rendered and we've been nuked. Remove the observer.\n if (!elem || elem.length === 0) {\n Ember.removeObserver(pathRoot, path, invoker);\n } else {\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n }\n };\n\n if (path !== '' && path !== 'this') {\n view.registerObserver(pathRoot, path, observer);\n }\n\n // We've already setup the observer; now we just need to figure out the\n // correct behavior right now on the first pass through.\n value = classStringForPath(context, parsedPath, options);\n\n if (value) {\n ret.push(value);\n\n // Make sure we save the current value so that it can be removed if the\n // observer fires.\n oldClass = value;\n }\n });\n\n return ret;\n};\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/binding");minispade.register('ember-handlebars/helpers/collection', "(function() {/*globals Handlebars */\n\n// TODO: Don't require all of this module\nminispade.require('ember-handlebars');\nminispade.require('ember-handlebars/helpers/view');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, handlebarsGet = Ember.Handlebars.get, fmt = Ember.String.fmt;\n\n/**\n `{{collection}}` is a `Ember.Handlebars` helper for adding instances of\n `Ember.CollectionView` to a template. See [Ember.CollectionView](/api/classes/Ember.CollectionView.html)\n for additional information on how a `CollectionView` functions.\n\n `{{collection}}`'s primary use is as a block helper with a `contentBinding`\n option pointing towards an `Ember.Array`-compatible object. An `Ember.View`\n instance will be created for each item in its `content` property. Each view\n will have its own `content` property set to the appropriate item in the\n collection.\n\n The provided block will be applied as the template for each item's view.\n\n Given an empty `<body>` the following template:\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n And the following application code\n\n ```javascript\n App = Ember.Application.create()\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Hi Dave</div>\n <div class=\"ember-view\">Hi Mary</div>\n <div class=\"ember-view\">Hi Sara</div>\n </div>\n ```\n\n ### Blockless Use\n\n If you provide an `itemViewClass` option that has its own `template` you can\n omit the block.\n\n The following template:\n\n ```handlebars\n {{collection contentBinding=\"App.items\" itemViewClass=\"App.AnItemView\"}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create();\n App.items = [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ];\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{view.content.name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n ### Specifying a CollectionView subclass\n\n By default the `{{collection}}` helper will create an instance of\n `Ember.CollectionView`. You can supply a `Ember.CollectionView` subclass to\n the helper by passing it as the first argument:\n\n ```handlebars\n {{#collection App.MyCustomCollectionClass contentBinding=\"App.items\"}}\n Hi {{view.content.name}}\n {{/collection}}\n ```\n\n ### Forwarded `item.*`-named Options\n\n As with the `{{view}}`, helper options passed to the `{{collection}}` will be\n set on the resulting `Ember.CollectionView` as properties. Additionally,\n options prefixed with `item` will be applied to the views rendered for each\n item (note the camelcasing):\n\n ```handlebars\n {{#collection contentBinding=\"App.items\"\n itemTagName=\"p\"\n itemClassNames=\"greeting\"}}\n Howdy {{view.content.name}}\n {{/collection}}\n ```\n\n Will result in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <p class=\"ember-view greeting\">Howdy Dave</p>\n <p class=\"ember-view greeting\">Howdy Mary</p>\n <p class=\"ember-view greeting\">Howdy Sara</p>\n </div>\n ```\n\n @method collection\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n @deprecated Use `{{each}}` helper instead.\n*/\nEmber.Handlebars.registerHelper('collection', function(path, options) {\n Ember.deprecate(\"Using the {{collection}} helper without specifying a class has been deprecated as the {{each}} helper now supports the same functionality.\", path !== 'collection');\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = undefined;\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 1);\n } else {\n Ember.assert(\"You cannot pass more than one argument to the collection helper\", arguments.length === 2);\n }\n\n var fn = options.fn;\n var data = options.data;\n var inverse = options.inverse;\n var view = options.data.view;\n\n // If passed a path string, convert that into an object.\n // Otherwise, just default to the standard class.\n var collectionClass;\n collectionClass = path ? handlebarsGet(this, path, options) : Ember.CollectionView;\n Ember.assert(fmt(\"%@ #collection: Could not find collection class %@\", [data.view, path]), !!collectionClass);\n\n var hash = options.hash, itemHash = {}, match;\n\n // Extract item view class if provided else default to the standard class\n var collectionPrototype = collectionClass.proto(),\n itemViewClass;\n\n if (hash.itemView) {\n var controller = data.keywords.controller;\n Ember.assert('You specified an itemView, but the current context has no container to look the itemView up in. This probably means that you created a view manually, instead of through the container. Instead, use container.lookup(\"view:viewName\"), which will properly instantiate your view.', controller && controller.container);\n var container = controller.container;\n itemViewClass = container.resolve('view:' + hash.itemView);\n Ember.assert('You specified the itemView ' + hash.itemView + \", but it was not found at \" + container.describe(\"view:\" + hash.itemView) + \" (and it was not registered in the container)\", !!itemViewClass);\n } else if (hash.itemViewClass) {\n itemViewClass = handlebarsGet(collectionPrototype, hash.itemViewClass, options);\n } else {\n itemViewClass = collectionPrototype.itemViewClass;\n }\n\n Ember.assert(fmt(\"%@ #collection: Could not find itemViewClass %@\", [data.view, itemViewClass]), !!itemViewClass);\n\n delete hash.itemViewClass;\n delete hash.itemView;\n\n // Go through options passed to the {{collection}} helper and extract options\n // that configure item views instead of the collection itself.\n for (var prop in hash) {\n if (hash.hasOwnProperty(prop)) {\n match = prop.match(/^item(.)(.*)$/);\n\n if (match && prop !== 'itemController') {\n // Convert itemShouldFoo -> shouldFoo\n itemHash[match[1].toLowerCase() + match[2]] = hash[prop];\n // Delete from hash as this will end up getting passed to the\n // {{view}} helper method.\n delete hash[prop];\n }\n }\n }\n\n if (fn) {\n itemHash.template = fn;\n delete options.fn;\n }\n\n var emptyViewClass;\n if (inverse && inverse !== Handlebars.VM.noop) {\n emptyViewClass = get(collectionPrototype, 'emptyViewClass');\n emptyViewClass = emptyViewClass.extend({\n template: inverse,\n tagName: itemHash.tagName\n });\n } else if (hash.emptyViewClass) {\n emptyViewClass = handlebarsGet(this, hash.emptyViewClass, options);\n }\n if (emptyViewClass) { hash.emptyView = emptyViewClass; }\n\n if (!hash.keyword) {\n itemHash._context = Ember.computed.alias('content');\n }\n\n var viewOptions = Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);\n hash.itemViewClass = itemViewClass.extend(viewOptions);\n\n return Ember.Handlebars.helpers.view.call(this, collectionClass, options);\n});\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/collection");minispade.register('ember-handlebars/helpers/debug', "(function() {/*jshint debug:true*/\nminispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar handlebarsGet = Ember.Handlebars.get, normalizePath = Ember.Handlebars.normalizePath;\n\n/**\n `log` allows you to output the value of a variable in the current rendering\n context.\n\n ```handlebars\n {{log myVariable}}\n ```\n\n @method log\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('log', function(property, options) {\n var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this,\n normalized = normalizePath(context, property, options.data),\n pathRoot = normalized.root,\n path = normalized.path,\n value = (path === 'this') ? pathRoot : handlebarsGet(pathRoot, path, options);\n Ember.Logger.log(value);\n});\n\n/**\n Execute the `debugger` statement in the current context.\n\n ```handlebars\n {{debugger}}\n ```\n\n @method debugger\n @for Ember.Handlebars.helpers\n @param {String} property\n*/\nEmber.Handlebars.registerHelper('debugger', function(options) {\n debugger;\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/debug");minispade.register('ember-handlebars/helpers/each', "(function() {minispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-views/views/collection_view\");\nminispade.require(\"ember-handlebars/views/metamorph_view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, {\n init: function() {\n var itemController = get(this, 'itemController');\n var binding;\n\n if (itemController) {\n var controller = get(this, 'controller.container').lookupFactory('controller:array').create({\n parentController: get(this, 'controller'),\n itemController: itemController,\n target: get(this, 'controller'),\n _eachView: this\n });\n\n this.disableContentObservers(function() {\n set(this, 'content', controller);\n binding = new Ember.Binding('content', '_eachView.dataSource').oneWay();\n binding.connect(controller);\n });\n\n set(this, '_arrayController', controller);\n } else {\n this.disableContentObservers(function() {\n binding = new Ember.Binding('content', 'dataSource').oneWay();\n binding.connect(this);\n });\n }\n\n return this._super();\n },\n\n _assertArrayLike: function(content) {\n Ember.assert(\"The value that #each loops over must be an Array. You passed \" + content.constructor + \", but it should have been an ArrayController\", !Ember.ControllerMixin.detect(content) || (content && content.isGenerated) || content instanceof Ember.ArrayController);\n Ember.assert(\"The value that #each loops over must be an Array. You passed \" + ((Ember.ControllerMixin.detect(content) && content.get('model') !== undefined) ? (\"\" + content.get('model') + \" (wrapped in \" + content + \")\") : (\"\" + content)), Ember.Array.detect(content));\n },\n\n disableContentObservers: function(callback) {\n Ember.removeBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.removeObserver(this, 'content', null, '_contentDidChange');\n\n callback.call(this);\n\n Ember.addBeforeObserver(this, 'content', null, '_contentWillChange');\n Ember.addObserver(this, 'content', null, '_contentDidChange');\n },\n\n itemViewClass: Ember._MetamorphView,\n emptyViewClass: Ember._MetamorphView,\n\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n // At the moment, if a container view subclass wants\n // to insert keywords, it is responsible for cloning\n // the keywords hash. This will be fixed momentarily.\n var keyword = get(this, 'keyword');\n var content = get(view, 'content');\n\n if (keyword) {\n var data = get(view, 'templateData');\n\n data = Ember.copy(data);\n data.keywords = view.cloneKeywords();\n set(view, 'templateData', data);\n\n // In this case, we do not bind, because the `content` of\n // a #each item cannot change.\n data.keywords[keyword] = content;\n }\n\n // If {{#each}} is looping over an array of controllers,\n // point each child view at their respective controller.\n if (content && get(content, 'isController')) {\n set(view, 'controller', content);\n }\n\n return view;\n },\n\n destroy: function() {\n if (!this._super()) { return; }\n\n var arrayController = get(this, '_arrayController');\n\n if (arrayController) {\n arrayController.destroy();\n }\n\n return this;\n }\n});\n\nvar GroupedEach = Ember.Handlebars.GroupedEach = function(context, path, options) {\n var self = this,\n normalized = Ember.Handlebars.normalizePath(context, path, options.data);\n\n this.context = context;\n this.path = path;\n this.options = options;\n this.template = options.fn;\n this.containingView = options.data.view;\n this.normalizedRoot = normalized.root;\n this.normalizedPath = normalized.path;\n this.content = this.lookupContent();\n\n this.addContentObservers();\n this.addArrayObservers();\n\n this.containingView.on('willClearRender', function() {\n self.destroy();\n });\n};\n\nGroupedEach.prototype = {\n contentWillChange: function() {\n this.removeArrayObservers();\n },\n\n contentDidChange: function() {\n this.content = this.lookupContent();\n this.addArrayObservers();\n this.rerenderContainingView();\n },\n\n contentArrayWillChange: Ember.K,\n\n contentArrayDidChange: function() {\n this.rerenderContainingView();\n },\n\n lookupContent: function() {\n return Ember.Handlebars.get(this.normalizedRoot, this.normalizedPath, this.options);\n },\n\n addArrayObservers: function() {\n if (!this.content) { return; }\n\n this.content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n removeArrayObservers: function() {\n if (!this.content) { return; }\n\n this.content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n },\n\n addContentObservers: function() {\n Ember.addBeforeObserver(this.normalizedRoot, this.normalizedPath, this, this.contentWillChange);\n Ember.addObserver(this.normalizedRoot, this.normalizedPath, this, this.contentDidChange);\n },\n\n removeContentObservers: function() {\n Ember.removeBeforeObserver(this.normalizedRoot, this.normalizedPath, this.contentWillChange);\n Ember.removeObserver(this.normalizedRoot, this.normalizedPath, this.contentDidChange);\n },\n\n render: function() {\n if (!this.content) { return; }\n\n var content = this.content,\n contentLength = get(content, 'length'),\n data = this.options.data,\n template = this.template;\n\n data.insideEach = true;\n for (var i = 0; i < contentLength; i++) {\n template(content.objectAt(i), { data: data });\n }\n },\n\n rerenderContainingView: function() {\n var self = this;\n Ember.run.scheduleOnce('render', this, function() {\n // It's possible it's been destroyed after we enqueued a re-render call.\n if (!self.destroyed) {\n self.containingView.rerender();\n }\n });\n },\n\n destroy: function() {\n this.removeContentObservers();\n if (this.content) {\n this.removeArrayObservers();\n }\n this.destroyed = true;\n }\n};\n\n/**\n The `{{#each}}` helper loops over elements in a collection, rendering its\n block once for each item. It is an extension of the base Handlebars `{{#each}}`\n helper:\n\n ```javascript\n Developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}];\n ```\n\n ```handlebars\n {{#each Developers}}\n {{name}}\n {{/each}}\n ```\n\n `{{each}}` supports an alternative syntax with element naming:\n\n ```handlebars\n {{#each person in Developers}}\n {{person.name}}\n {{/each}}\n ```\n\n When looping over objects that do not have properties, `{{this}}` can be used\n to render the object:\n\n ```javascript\n DeveloperNames = ['Yehuda', 'Tom', 'Paul']\n ```\n\n ```handlebars\n {{#each DeveloperNames}}\n {{this}}\n {{/each}}\n ```\n ### {{else}} condition\n `{{#each}}` can have a matching `{{else}}`. The contents of this block will render\n if the collection is empty.\n\n ```\n {{#each person in Developers}}\n {{person.name}}\n {{else}}\n <p>Sorry, nobody is available for this task.</p>\n {{/each}}\n ```\n ### Specifying a View class for items\n If you provide an `itemViewClass` option that references a view class\n with its own `template` you can omit the block.\n\n The following template:\n\n ```handlebars\n {{#view App.MyView }}\n {{each view.items itemViewClass=\"App.AnItemView\"}}\n {{/view}}\n ```\n\n And application code\n\n ```javascript\n App = Ember.Application.create({\n MyView: Ember.View.extend({\n items: [\n Ember.Object.create({name: 'Dave'}),\n Ember.Object.create({name: 'Mary'}),\n Ember.Object.create({name: 'Sara'})\n ]\n })\n });\n\n App.AnItemView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Greetings {{name}}\")\n });\n ```\n\n Will result in the HTML structure below\n\n ```html\n <div class=\"ember-view\">\n <div class=\"ember-view\">Greetings Dave</div>\n <div class=\"ember-view\">Greetings Mary</div>\n <div class=\"ember-view\">Greetings Sara</div>\n </div>\n ```\n\n If an `itemViewClass` is defined on the helper, and therefore the helper is not\n being used as a block, an `emptyViewClass` can also be provided optionally.\n The `emptyViewClass` will match the behavior of the `{{else}}` condition\n described above. That is, the `emptyViewClass` will render if the collection\n is empty.\n\n ### Representing each item with a Controller.\n By default the controller lookup within an `{{#each}}` block will be\n the controller of the template where the `{{#each}}` was used. If each\n item needs to be presented by a custom controller you can provide a\n `itemController` option which references a controller by lookup name.\n Each item in the loop will be wrapped in an instance of this controller\n and the item itself will be set to the `content` property of that controller.\n\n This is useful in cases where properties of model objects need transformation\n or synthesis for display:\n\n ```javascript\n App.DeveloperController = Ember.ObjectController.extend({\n isAvailableForHire: function() {\n return !this.get('content.isEmployed') && this.get('content.isSeekingWork');\n }.property('isEmployed', 'isSeekingWork')\n })\n ```\n\n ```handlebars\n {{#each person in developers itemController=\"developer\"}}\n {{person.name}} {{#if person.isAvailableForHire}}Hire me!{{/if}}\n {{/each}}\n ```\n\n Each itemController will receive a reference to the current controller as\n a `parentController` property.\n\n ### (Experimental) Grouped Each\n\n When used in conjunction with the experimental [group helper](https://github.com/emberjs/group-helper),\n you can inform Handlebars to re-render an entire group of items instead of\n re-rendering them one at a time (in the event that they are changed en masse\n or an item is added/removed).\n\n ```handlebars\n {{#group}}\n {{#each people}}\n {{firstName}} {{lastName}}\n {{/each}}\n {{/group}}\n ```\n\n This can be faster than the normal way that Handlebars re-renders items\n in some cases.\n\n If for some reason you have a group with more than one `#each`, you can make\n one of the collections be updated in normal (non-grouped) fashion by setting\n the option `groupedRows=true` (counter-intuitive, I know).\n\n For example,\n\n ```handlebars\n {{dealershipName}}\n\n {{#group}}\n {{#each dealers}}\n {{firstName}} {{lastName}}\n {{/each}}\n\n {{#each car in cars groupedRows=true}}\n {{car.make}} {{car.model}} {{car.color}}\n {{/each}}\n {{/group}}\n ```\n Any change to `dealershipName` or the `dealers` collection will cause the\n entire group to be re-rendered. However, changes to the `cars` collection\n will be re-rendered individually (as normal).\n\n Note that `group` behavior is also disabled by specifying an `itemViewClass`.\n\n @method each\n @for Ember.Handlebars.helpers\n @param [name] {String} name for item (used with `in`)\n @param [path] {String} path\n @param [options] {Object} Handlebars key/value pairs of options\n @param [options.itemViewClass] {String} a path to a view class used for each item\n @param [options.itemController] {String} name of a controller to be created for each item\n @param [options.groupedRows] {boolean} enable normal item-by-item rendering when inside a `#group` helper\n*/\nEmber.Handlebars.registerHelper('each', function(path, options) {\n if (arguments.length === 4) {\n Ember.assert(\"If you pass more than one argument to the each helper, it must be in the form #each foo in bar\", arguments[1] === \"in\");\n\n var keywordName = arguments[0];\n\n options = arguments[3];\n path = arguments[2];\n if (path === '') { path = \"this\"; }\n\n options.hash.keyword = keywordName;\n }\n\n if (arguments.length === 1) {\n options = path;\n path = 'this';\n }\n\n options.hash.dataSourceBinding = path;\n // Set up emptyView as a metamorph with no tag\n //options.hash.emptyViewClass = Ember._MetamorphView;\n\n if (options.data.insideGroup && !options.hash.groupedRows && !options.hash.itemViewClass) {\n new Ember.Handlebars.GroupedEach(this, path, options).render();\n } else {\n return Ember.Handlebars.helpers.collection.call(this, 'Ember.Handlebars.EachView', options);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/each");minispade.register('ember-handlebars/helpers/loc', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `loc` looks up the string in the localized strings hash.\n This is a convenient way to localize text. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"home\">\n {{loc \"welcome\"}}\n </script>\n ```\n\n Take note that `\"welcome\"` is a string and not an object\n reference.\n\n @method loc\n @for Ember.Handlebars.helpers\n @param {String} str The string to format\n*/\n\nEmber.Handlebars.registerHelper('loc', function(str) {\n return Ember.String.loc(str);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/loc");minispade.register('ember-handlebars/helpers/partial', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `partial` renders a template directly using the current context.\n If needed the context can be set using the `{{#with foo}}` helper.\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"header_bar\">\n {{#with currentUser}}\n {{partial user_info}}\n {{/with}}\n </script>\n ```\n\n The `data-template-name` attribute of a partial template\n is prefixed with an underscore.\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"_user_info\">\n <span>Hello {{username}}!</span>\n </script>\n ```\n\n @method partial\n @for Ember.Handlebars.helpers\n @param {String} partialName the name of the template to render minus the leading underscore\n*/\n\nEmber.Handlebars.registerHelper('partial', function(name, options) {\n var nameParts = name.split(\"/\"),\n lastPart = nameParts[nameParts.length - 1];\n\n nameParts[nameParts.length - 1] = \"_\" + lastPart;\n\n var view = options.data.view,\n underscoredName = nameParts.join(\"/\"),\n template = view.templateForName(underscoredName),\n deprecatedTemplate = !template && view.templateForName(name);\n\n Ember.assert(\"Unable to find partial with name '\"+name+\"'.\", template || deprecatedTemplate);\n\n template = template || deprecatedTemplate;\n\n template(this, { data: options.data });\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/partial");minispade.register('ember-handlebars/helpers/shared', "(function() {Ember.Handlebars.resolvePaths = function(options) {\n var ret = [],\n contexts = options.contexts,\n roots = options.roots,\n data = options.data;\n\n for (var i=0, l=contexts.length; i<l; i++) {\n ret.push( Ember.Handlebars.get(roots[i], contexts[i], { data: data }) );\n }\n\n return ret;\n};\n\n})();\n//@ sourceURL=ember-handlebars/helpers/shared");minispade.register('ember-handlebars/helpers/template', "(function() {minispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n `template` allows you to render a template from inside another template.\n This allows you to re-use the same template in multiple places. For example:\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"logged_in_user\">\n {{#with loggedInUser}}\n Last Login: {{lastLogin}}\n User Info: {{template \"user_info\"}}\n {{/with}}\n </script>\n ```\n\n ```html\n <script type=\"text/x-handlebars\" data-template-name=\"user_info\">\n Name: <em>{{name}}</em>\n Karma: <em>{{karma}}</em>\n </script>\n ```\n\n ```handlebars\n {{#if isUser}}\n {{template \"user_info\"}}\n {{else}}\n {{template \"unlogged_user_info\"}}\n {{/if}}\n ```\n\n This helper looks for templates in the global `Ember.TEMPLATES` hash. If you\n add `<script>` tags to your page with the `data-template-name` attribute set,\n they will be compiled and placed in this hash automatically.\n\n You can also manually register templates by adding them to the hash:\n\n ```javascript\n Ember.TEMPLATES[\"my_cool_template\"] = Ember.Handlebars.compile('<b>{{user}}</b>');\n ```\n\n @deprecated\n @method template\n @for Ember.Handlebars.helpers\n @param {String} templateName the template to render\n*/\n\nEmber.Handlebars.registerHelper('template', function(name, options) {\n Ember.deprecate(\"The `template` helper has been deprecated in favor of the `partial` helper. Please use `partial` instead, which will work the same way.\");\n return Ember.Handlebars.helpers.partial.apply(this, arguments);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/template");minispade.register('ember-handlebars/helpers/unbound', "(function() {/*globals Handlebars */\nminispade.require('ember-handlebars/ext');\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar handlebarsGet = Ember.Handlebars.get;\n\n/**\n `unbound` allows you to output a property without binding. *Important:* The\n output will not be updated if the property changes. Use with caution.\n\n ```handlebars\n <div>{{unbound somePropertyThatDoesntChange}}</div>\n ```\n\n `unbound` can also be used in conjunction with a bound helper to\n render it in its unbound form:\n\n ```handlebars\n <div>{{unbound helperName somePropertyThatDoesntChange}}</div>\n ```\n\n @method unbound\n @for Ember.Handlebars.helpers\n @param {String} property\n @return {String} HTML string\n*/\nEmber.Handlebars.registerHelper('unbound', function(property, fn) {\n var options = arguments[arguments.length - 1], helper, context, out;\n\n if (arguments.length > 2) {\n // Unbound helper call.\n options.data.isUnbound = true;\n helper = Ember.Handlebars.helpers[arguments[0]] || Ember.Handlebars.helperMissing;\n out = helper.apply(this, Array.prototype.slice.call(arguments, 1));\n delete options.data.isUnbound;\n return out;\n }\n\n context = (fn.contexts && fn.contexts.length) ? fn.contexts[0] : this;\n return handlebarsGet(context, property, fn);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/unbound");minispade.register('ember-handlebars/helpers/view', "(function() {/*globals Handlebars */\n\n// TODO: Don't require the entire module\nminispade.require(\"ember-handlebars\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar EmberHandlebars = Ember.Handlebars;\nvar LOWERCASE_A_Z = /^[a-z]/;\nvar VIEW_PREFIX = /^view\\./;\n\nfunction makeBindings(thisContext, options) {\n var hash = options.hash,\n hashType = options.hashTypes;\n\n for (var prop in hash) {\n if (hashType[prop] === 'ID') {\n\n var value = hash[prop];\n\n if (Ember.IS_BINDING.test(prop)) {\n Ember.warn(\"You're attempting to render a view by passing \" + prop + \"=\" + value + \" to a view helper, but this syntax is ambiguous. You should either surround \" + value + \" in quotes or remove `Binding` from \" + prop + \".\");\n } else {\n hash[prop + 'Binding'] = value;\n hashType[prop + 'Binding'] = 'STRING';\n delete hash[prop];\n delete hashType[prop];\n }\n }\n }\n\n if (hash.hasOwnProperty('idBinding')) {\n // id can't be bound, so just perform one-time lookup.\n hash.id = EmberHandlebars.get(thisContext, hash.idBinding, options);\n hashType.id = 'STRING';\n delete hash.idBinding;\n delete hashType.idBinding;\n }\n}\n\nEmberHandlebars.ViewHelper = Ember.Object.create({\n\n propertiesFromHTMLOptions: function(options) {\n var hash = options.hash, data = options.data;\n var extensions = {},\n classes = hash['class'],\n dup = false;\n\n if (hash.id) {\n extensions.elementId = hash.id;\n dup = true;\n }\n\n if (hash.tag) {\n extensions.tagName = hash.tag;\n dup = true;\n }\n\n if (classes) {\n classes = classes.split(' ');\n extensions.classNames = classes;\n dup = true;\n }\n\n if (hash.classBinding) {\n extensions.classNameBindings = hash.classBinding.split(' ');\n dup = true;\n }\n\n if (hash.classNameBindings) {\n if (extensions.classNameBindings === undefined) extensions.classNameBindings = [];\n extensions.classNameBindings = extensions.classNameBindings.concat(hash.classNameBindings.split(' '));\n dup = true;\n }\n\n if (hash.attributeBindings) {\n Ember.assert(\"Setting 'attributeBindings' via Handlebars is not allowed. Please subclass Ember.View and set it there instead.\");\n extensions.attributeBindings = null;\n dup = true;\n }\n\n if (dup) {\n hash = Ember.$.extend({}, hash);\n delete hash.id;\n delete hash.tag;\n delete hash['class'];\n delete hash.classBinding;\n }\n\n // Set the proper context for all bindings passed to the helper. This applies to regular attribute bindings\n // as well as class name bindings. If the bindings are local, make them relative to the current context\n // instead of the view.\n var path;\n\n // Evaluate the context of regular attribute bindings:\n for (var prop in hash) {\n if (!hash.hasOwnProperty(prop)) { continue; }\n\n // Test if the property ends in \"Binding\"\n if (Ember.IS_BINDING.test(prop) && typeof hash[prop] === 'string') {\n path = this.contextualizeBindingPath(hash[prop], data);\n if (path) { hash[prop] = path; }\n }\n }\n\n // Evaluate the context of class name bindings:\n if (extensions.classNameBindings) {\n for (var b in extensions.classNameBindings) {\n var full = extensions.classNameBindings[b];\n if (typeof full === 'string') {\n // Contextualize the path of classNameBinding so this:\n //\n // classNameBinding=\"isGreen:green\"\n //\n // is converted to this:\n //\n // classNameBinding=\"_parentView.context.isGreen:green\"\n var parsedPath = Ember.View._parsePropertyPath(full);\n path = this.contextualizeBindingPath(parsedPath.path, data);\n if (path) { extensions.classNameBindings[b] = path + parsedPath.classNames; }\n }\n }\n }\n\n return Ember.$.extend(hash, extensions);\n },\n\n // Transform bindings from the current context to a context that can be evaluated within the view.\n // Returns null if the path shouldn't be changed.\n //\n // TODO: consider the addition of a prefix that would allow this method to return `path`.\n contextualizeBindingPath: function(path, data) {\n var normalized = Ember.Handlebars.normalizePath(null, path, data);\n if (normalized.isKeyword) {\n return 'templateData.keywords.' + path;\n } else if (Ember.isGlobalPath(path)) {\n return null;\n } else if (path === 'this') {\n return '_parentView.context';\n } else {\n return '_parentView.context.' + path;\n }\n },\n\n helper: function(thisContext, path, options) {\n var data = options.data,\n fn = options.fn,\n newView;\n\n makeBindings(thisContext, options);\n\n if ('string' === typeof path) {\n\n // TODO: this is a lame conditional, this should likely change\n // but something along these lines will likely need to be added\n // as deprecation warnings\n //\n if (options.types[0] === 'STRING' && LOWERCASE_A_Z.test(path) && !VIEW_PREFIX.test(path)) {\n Ember.assert(\"View requires a container\", !!data.view.container);\n newView = data.view.container.lookupFactory('view:' + path);\n } else {\n newView = EmberHandlebars.get(thisContext, path, options);\n }\n\n Ember.assert(\"Unable to find view at path '\" + path + \"'\", !!newView);\n } else {\n newView = path;\n }\n\n Ember.assert(Ember.String.fmt('You must pass a view to the #view helper, not %@ (%@)', [path, newView]), Ember.View.detect(newView) || Ember.View.detectInstance(newView));\n\n var viewOptions = this.propertiesFromHTMLOptions(options, thisContext);\n var currentView = data.view;\n viewOptions.templateData = data;\n var newViewProto = newView.proto ? newView.proto() : newView;\n\n if (fn) {\n Ember.assert(\"You cannot provide a template block if you also specified a templateName\", !get(viewOptions, 'templateName') && !get(newViewProto, 'templateName'));\n viewOptions.template = fn;\n }\n\n // We only want to override the `_context` computed property if there is\n // no specified controller. See View#_context for more information.\n if (!newViewProto.controller && !newViewProto.controllerBinding && !viewOptions.controller && !viewOptions.controllerBinding) {\n viewOptions._context = thisContext;\n }\n\n currentView.appendChild(newView, viewOptions);\n }\n});\n\n/**\n `{{view}}` inserts a new instance of `Ember.View` into a template passing its\n options to the `Ember.View`'s `create` method and using the supplied block as\n the view's own template.\n\n An empty `<body>` and the following template:\n\n ```handlebars\n A span:\n {{#view tagName=\"span\"}}\n hello.\n {{/view}}\n ```\n\n Will result in HTML structure:\n\n ```html\n <body>\n <!-- Note: the handlebars template script\n also results in a rendered Ember.View\n which is the outer <div> here -->\n\n <div class=\"ember-view\">\n A span:\n <span id=\"ember1\" class=\"ember-view\">\n Hello.\n </span>\n </div>\n </body>\n ```\n\n ### `parentView` setting\n\n The `parentView` property of the new `Ember.View` instance created through\n `{{view}}` will be set to the `Ember.View` instance of the template where\n `{{view}}` was called.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile(\"{{#view}} my parent: {{parentView.elementId}} {{/view}}\")\n });\n\n aView.appendTo('body');\n ```\n\n Will result in HTML structure:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view\">\n my parent: ember1\n </div>\n </div>\n ```\n\n ### Setting CSS id and class attributes\n\n The HTML `id` attribute can be set on the `{{view}}`'s resulting element with\n the `id` option. This option will _not_ be passed to `Ember.View.create`.\n\n ```handlebars\n {{#view tagName=\"span\" id=\"a-custom-id\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"a-custom-id\" class=\"ember-view\">\n hello.\n </span>\n </div>\n ```\n\n The HTML `class` attribute can be set on the `{{view}}`'s resulting element\n with the `class` or `classNameBindings` options. The `class` option will\n directly set the CSS `class` attribute and will not be passed to\n `Ember.View.create`. `classNameBindings` will be passed to `create` and use\n `Ember.View`'s class name binding functionality:\n\n ```handlebars\n {{#view tagName=\"span\" class=\"a-custom-class\"}}\n hello.\n {{/view}}\n ```\n\n Results in the following HTML structure:\n\n ```html\n <div class=\"ember-view\">\n <span id=\"ember2\" class=\"ember-view a-custom-class\">\n hello.\n </span>\n </div>\n ```\n\n ### Supplying a different view class\n\n `{{view}}` can take an optional first argument before its supplied options to\n specify a path to a custom view class.\n\n ```handlebars\n {{#view \"MyApp.CustomView\"}}\n hello.\n {{/view}}\n ```\n\n The first argument can also be a relative path accessible from the current\n context.\n\n ```javascript\n MyApp = Ember.Application.create({});\n MyApp.OuterView = Ember.View.extend({\n innerViewClass: Ember.View.extend({\n classNames: ['a-custom-view-class-as-property']\n }),\n template: Ember.Handlebars.compile('{{#view \"view.innerViewClass\"}} hi {{/view}}')\n });\n\n MyApp.OuterView.create().appendTo('body');\n ```\n\n Will result in the following HTML:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div id=\"ember2\" class=\"ember-view a-custom-view-class-as-property\">\n hi\n </div>\n </div>\n ```\n\n ### Blockless use\n\n If you supply a custom `Ember.View` subclass that specifies its own template\n or provide a `templateName` option to `{{view}}` it can be used without\n supplying a block. Attempts to use both a `templateName` option and supply a\n block will throw an error.\n\n ```handlebars\n {{view \"MyApp.ViewWithATemplateDefined\"}}\n ```\n\n ### `viewName` property\n\n You can supply a `viewName` option to `{{view}}`. The `Ember.View` instance\n will be referenced as a property of its parent view by this name.\n\n ```javascript\n aView = Ember.View.create({\n template: Ember.Handlebars.compile('{{#view viewName=\"aChildByName\"}} hi {{/view}}')\n });\n\n aView.appendTo('body');\n aView.get('aChildByName') // the instance of Ember.View created by {{view}} helper\n ```\n\n @method view\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {Hash} options\n @return {String} HTML string\n*/\nEmberHandlebars.registerHelper('view', function(path, options) {\n Ember.assert(\"The view helper only takes a single argument\", arguments.length <= 2);\n\n // If no path is provided, treat path param as options.\n if (path && path.data && path.data.isRenderData) {\n options = path;\n path = \"Ember.View\";\n }\n\n return EmberHandlebars.ViewHelper.helper(this, path, options);\n});\n\n\n})();\n//@ sourceURL=ember-handlebars/helpers/view");minispade.register('ember-handlebars/helpers/yield', "(function() {/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n `{{yield}}` denotes an area of a template that will be rendered inside\n of another template. It has two main uses:\n\n ### Use with `layout`\n When used in a Handlebars template that is assigned to an `Ember.View`\n instance's `layout` property Ember will render the layout template first,\n inserting the view's own rendered output at the `{{yield}}` location.\n\n An empty `<body>` and the following application code:\n\n ```javascript\n AView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n layout: Ember.Handlebars.compile('<div class=\"wrapper\">{{yield}}</div>'),\n template: Ember.Handlebars.compile('<span>I am wrapped</span>')\n });\n\n aView = AView.create();\n aView.appendTo('body');\n ```\n\n Will result in the following HTML output:\n\n ```html\n <body>\n <div class='ember-view a-view-with-layout'>\n <div class=\"wrapper\">\n <span>I am wrapped</span>\n </div>\n </div>\n </body>\n ```\n\n The `yield` helper cannot be used outside of a template assigned to an\n `Ember.View`'s `layout` property and will throw an error if attempted.\n\n ```javascript\n BView = Ember.View.extend({\n classNames: ['a-view-with-layout'],\n template: Ember.Handlebars.compile('{{yield}}')\n });\n\n bView = BView.create();\n bView.appendTo('body');\n\n // throws\n // Uncaught Error: assertion failed:\n // You called yield in a template that was not a layout\n ```\n\n ### Use with Ember.Component\n When designing components `{{yield}}` is used to denote where, inside the component's\n template, an optional block passed to the component should render:\n\n ```handlebars\n <!-- application.hbs -->\n {{#labeled-textfield value=someProperty}}\n First name:\n {{/labeled-textfield}}\n ```\n\n ```handlebars\n <!-- components/labeled-textfield.hbs -->\n <label>\n {{yield}} {{input value=value}}\n </label>\n ```\n\n Result:\n\n ```html\n <label>\n First name: <input type=\"text\" />\n <label>\n ```\n\n @method yield\n @for Ember.Handlebars.helpers\n @param {Hash} options\n @return {String} HTML string\n*/\nEmber.Handlebars.registerHelper('yield', function(options) {\n var view = options.data.view;\n\n while (view && !get(view, 'layout')) {\n if (view._contextView) {\n view = view._contextView;\n } else {\n view = get(view, 'parentView');\n }\n }\n\n Ember.assert(\"You called yield in a template that was not a layout\", !!view);\n\n view._yield(this, options);\n});\n\n})();\n//@ sourceURL=ember-handlebars/helpers/yield");minispade.register('ember-handlebars/loader', "(function() {/*globals Handlebars */\nminispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-handlebars/component_lookup\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\n/**\n @private\n\n Find templates stored in the head tag as script tags and make them available\n to `Ember.CoreView` in the global `Ember.TEMPLATES` object. This will be run\n as as jQuery DOM-ready callback.\n\n Script tags with `text/x-handlebars` will be compiled\n with Ember's Handlebars and are suitable for use as a view's template.\n Those with type `text/x-raw-handlebars` will be compiled with regular\n Handlebars and are suitable for use in views' computed properties.\n\n @method bootstrap\n @for Ember.Handlebars\n @static\n @param ctx\n*/\nEmber.Handlebars.bootstrap = function(ctx) {\n var selectors = 'script[type=\"text/x-handlebars\"], script[type=\"text/x-raw-handlebars\"]';\n\n Ember.$(selectors, ctx)\n .each(function() {\n // Get a reference to the script tag\n var script = Ember.$(this);\n\n var compile = (script.attr('type') === 'text/x-raw-handlebars') ?\n Ember.$.proxy(Handlebars.compile, Handlebars) :\n Ember.$.proxy(Ember.Handlebars.compile, Ember.Handlebars),\n // Get the name of the script, used by Ember.View's templateName property.\n // First look for data-template-name attribute, then fall back to its\n // id if no name is found.\n templateName = script.attr('data-template-name') || script.attr('id') || 'application',\n template = compile(script.html());\n\n // Check if template of same name already exists\n if (Ember.TEMPLATES[templateName] !== undefined) {\n throw new Ember.Error('Template named \"' + templateName + '\" already exists.');\n }\n\n // For templates which have a name, we save them and then remove them from the DOM\n Ember.TEMPLATES[templateName] = template;\n\n // Remove script tag from DOM\n script.remove();\n });\n};\n\nfunction bootstrap() {\n Ember.Handlebars.bootstrap( Ember.$(document) );\n}\n\nfunction registerComponents(container) {\n var templates = Ember.TEMPLATES, match;\n if (!templates) { return; }\n\n for (var prop in templates) {\n if (match = prop.match(/^components\\/(.*)$/)) {\n registerComponent(container, match[1]);\n }\n }\n}\n\n\nfunction registerComponent(container, name) {\n Ember.assert(\"You provided a template named 'components/\" + name + \"', but custom components must include a '-'\", name.match(/-/));\n\n var fullName = 'component:' + name;\n\n container.injection(fullName, 'layout', 'template:components/' + name);\n\n var Component = container.lookupFactory(fullName);\n\n if (!Component) {\n container.register(fullName, Ember.Component);\n Component = container.lookupFactory(fullName);\n }\n\n Ember.Handlebars.helper(name, Component);\n}\n\nfunction registerComponentLookup(container) {\n container.register('component-lookup:main', Ember.ComponentLookup);\n}\n\n/*\n We tie this to application.load to ensure that we've at least\n attempted to bootstrap at the point that the application is loaded.\n\n We also tie this to document ready since we're guaranteed that all\n the inline templates are present at this point.\n\n There's no harm to running this twice, since we remove the templates\n from the DOM after processing.\n*/\n\nEmber.onLoad('Ember.Application', function(Application) {\n Application.initializer({\n name: 'domTemplates',\n initialize: bootstrap\n });\n\n if (Ember.FEATURES.isEnabled('container-renderables')) {\n Application.initializer({\n name: 'registerComponentLookup',\n after: 'domTemplates',\n initialize: registerComponentLookup\n });\n } else {\n Application.initializer({\n name: 'registerComponents',\n after: 'domTemplates',\n initialize: registerComponents\n });\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/loader");minispade.register('ember-handlebars', "(function() {minispade.require(\"ember-runtime\");\nminispade.require(\"ember-handlebars-compiler\");\nminispade.require(\"ember-views\");\nminispade.require(\"ember-handlebars/ext\");\nminispade.require(\"ember-handlebars/string\");\nminispade.require(\"ember-handlebars/helpers\");\nminispade.require(\"ember-handlebars/views\");\nminispade.require(\"ember-handlebars/controls\");\nminispade.require(\"ember-handlebars/loader\");\n\n/**\nEmber Handlebars\n\n@module ember\n@submodule ember-handlebars\n@requires ember-views\n*/\n\nEmber.runLoadHooks('Ember.Handlebars', Ember.Handlebars);\n\n})();\n//@ sourceURL=ember-handlebars");minispade.register('ember-handlebars/string', "(function() {/**\n Mark a string as safe for unescaped output with Handlebars. If you\n return HTML from a Handlebars helper, use this function to\n ensure Handlebars does not escape the HTML.\n\n ```javascript\n Ember.String.htmlSafe('<div>someString</div>')\n ```\n\n @method htmlSafe\n @for Ember.String\n @static\n @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars\n*/\nEmber.String.htmlSafe = function(str) {\n return new Handlebars.SafeString(str);\n};\n\nvar htmlSafe = Ember.String.htmlSafe;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n Mark a string as being safe for unescaped output with Handlebars.\n\n ```javascript\n '<div>someString</div>'.htmlSafe()\n ```\n\n See [Ember.String.htmlSafe](/api/classes/Ember.String.html#method_htmlSafe).\n\n @method htmlSafe\n @for String\n @return {Handlebars.SafeString} a string that will not be html escaped by Handlebars\n */\n String.prototype.htmlSafe = function() {\n return htmlSafe(this);\n };\n}\n\n})();\n//@ sourceURL=ember-handlebars/string");minispade.register('ember-handlebars/views', "(function() {minispade.require(\"ember-handlebars/views/handlebars_bound_view\");\nminispade.require(\"ember-handlebars/views/metamorph_view\");\n\n})();\n//@ sourceURL=ember-handlebars/views");minispade.register('ember-handlebars/views/handlebars_bound_view', "(function() {/*globals Handlebars */\n/*jshint newcap:false*/\nminispade.require(\"metamorph\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar get = Ember.get, set = Ember.set, handlebarsGet = Ember.Handlebars.get;\nvar Metamorph = requireModule('metamorph');\nminispade.require('ember-views/views/view');\nminispade.require('ember-handlebars/views/metamorph_view');\n\nfunction SimpleHandlebarsView(path, pathRoot, isEscaped, templateData) {\n this.path = path;\n this.pathRoot = pathRoot;\n this.isEscaped = isEscaped;\n this.templateData = templateData;\n\n this.morph = Metamorph();\n this.state = 'preRender';\n this.updateId = null;\n this._parentView = null;\n this.buffer = null;\n}\n\nEmber._SimpleHandlebarsView = SimpleHandlebarsView;\n\nSimpleHandlebarsView.prototype = {\n isVirtual: true,\n isView: true,\n\n destroy: function () {\n if (this.updateId) {\n Ember.run.cancel(this.updateId);\n this.updateId = null;\n }\n if (this._parentView) {\n this._parentView.removeChild(this);\n }\n this.morph = null;\n this.state = 'destroyed';\n },\n\n propertyWillChange: Ember.K,\n\n propertyDidChange: Ember.K,\n\n normalizedValue: function() {\n var path = this.path,\n pathRoot = this.pathRoot,\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = this.templateData;\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return result;\n },\n\n renderToBuffer: function(buffer) {\n var string = '';\n\n string += this.morph.startTag();\n string += this.render();\n string += this.morph.endTag();\n\n buffer.push(string);\n },\n\n render: function() {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = this.isEscaped;\n var result = this.normalizedValue();\n\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n return result;\n },\n\n rerender: function() {\n switch(this.state) {\n case 'preRender':\n case 'destroyed':\n break;\n case 'inBuffer':\n throw new Ember.Error(\"Something you did tried to replace an {{expression}} before it was inserted into the DOM.\");\n case 'hasElement':\n case 'inDOM':\n this.updateId = Ember.run.scheduleOnce('render', this, 'update');\n break;\n }\n\n return this;\n },\n\n update: function () {\n this.updateId = null;\n this.morph.html(this.render());\n },\n\n transitionTo: function(state) {\n this.state = state;\n }\n};\n\nvar states = Ember.View.cloneStates(Ember.View.states), merge = Ember.merge;\n\nmerge(states._default, {\n rerenderIfNeeded: Ember.K\n});\n\nmerge(states.inDOM, {\n rerenderIfNeeded: function(view) {\n if (view.normalizedValue() !== view._lastNormalizedValue) {\n view.rerender();\n }\n }\n});\n\n/**\n `Ember._HandlebarsBoundView` is a private view created by the Handlebars\n `{{bind}}` helpers that is used to keep track of bound properties.\n\n Every time a property is bound using a `{{mustache}}`, an anonymous subclass\n of `Ember._HandlebarsBoundView` is created with the appropriate sub-template\n and context set up. When the associated property changes, just the template\n for this view will re-render.\n\n @class _HandlebarsBoundView\n @namespace Ember\n @extends Ember._MetamorphView\n @private\n*/\nEmber._HandlebarsBoundView = Ember._MetamorphView.extend({\n instrumentName: 'boundHandlebars',\n states: states,\n\n /**\n The function used to determine if the `displayTemplate` or\n `inverseTemplate` should be rendered. This should be a function that takes\n a value and returns a Boolean.\n\n @property shouldDisplayFunc\n @type Function\n @default null\n */\n shouldDisplayFunc: null,\n\n /**\n Whether the template rendered by this view gets passed the context object\n of its parent template, or gets passed the value of retrieving `path`\n from the `pathRoot`.\n\n For example, this is true when using the `{{#if}}` helper, because the\n template inside the helper should look up properties relative to the same\n object as outside the block. This would be `false` when used with `{{#with\n foo}}` because the template should receive the object found by evaluating\n `foo`.\n\n @property preserveContext\n @type Boolean\n @default false\n */\n preserveContext: false,\n\n /**\n If `preserveContext` is true, this is the object that will be used\n to render the template.\n\n @property previousContext\n @type Object\n */\n previousContext: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `true`.\n\n @property displayTemplate\n @type Function\n @default null\n */\n displayTemplate: null,\n\n /**\n The template to render when `shouldDisplayFunc` evaluates to `false`.\n\n @property inverseTemplate\n @type Function\n @default null\n */\n inverseTemplate: null,\n\n\n /**\n The path to look up on `pathRoot` that is passed to\n `shouldDisplayFunc` to determine which template to render.\n\n In addition, if `preserveContext` is `false,` the object at this path will\n be passed to the template when rendering.\n\n @property path\n @type String\n @default null\n */\n path: null,\n\n /**\n The object from which the `path` will be looked up. Sometimes this is the\n same as the `previousContext`, but in cases where this view has been\n generated for paths that start with a keyword such as `view` or\n `controller`, the path root will be that resolved object.\n\n @property pathRoot\n @type Object\n */\n pathRoot: null,\n\n normalizedValue: function() {\n var path = get(this, 'path'),\n pathRoot = get(this, 'pathRoot'),\n valueNormalizer = get(this, 'valueNormalizerFunc'),\n result, templateData;\n\n // Use the pathRoot as the result if no path is provided. This\n // happens if the path is `this`, which gets normalized into\n // a `pathRoot` of the current Handlebars context and a path\n // of `''`.\n if (path === '') {\n result = pathRoot;\n } else {\n templateData = get(this, 'templateData');\n result = handlebarsGet(pathRoot, path, { data: templateData });\n }\n\n return valueNormalizer ? valueNormalizer(result) : result;\n },\n\n rerenderIfNeeded: function() {\n this.currentState.rerenderIfNeeded(this);\n },\n\n /**\n Determines which template to invoke, sets up the correct state based on\n that logic, then invokes the default `Ember.View` `render` implementation.\n\n This method will first look up the `path` key on `pathRoot`,\n then pass that value to the `shouldDisplayFunc` function. If that returns\n `true,` the `displayTemplate` function will be rendered to DOM. Otherwise,\n `inverseTemplate`, if specified, will be rendered.\n\n For example, if this `Ember._HandlebarsBoundView` represented the `{{#with\n foo}}` helper, it would look up the `foo` property of its context, and\n `shouldDisplayFunc` would always return true. The object found by looking\n up `foo` would be passed to `displayTemplate`.\n\n @method render\n @param {Ember.RenderBuffer} buffer\n */\n render: function(buffer) {\n // If not invoked via a triple-mustache ({{{foo}}}), escape\n // the content of the template.\n var escape = get(this, 'isEscaped');\n\n var shouldDisplay = get(this, 'shouldDisplayFunc'),\n preserveContext = get(this, 'preserveContext'),\n context = get(this, 'previousContext');\n\n var inverseTemplate = get(this, 'inverseTemplate'),\n displayTemplate = get(this, 'displayTemplate');\n\n var result = this.normalizedValue();\n this._lastNormalizedValue = result;\n\n // First, test the conditional to see if we should\n // render the template or not.\n if (shouldDisplay(result)) {\n set(this, 'template', displayTemplate);\n\n // If we are preserving the context (for example, if this\n // is an #if block, call the template with the same object.\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n // Otherwise, determine if this is a block bind or not.\n // If so, pass the specified object to the template\n if (displayTemplate) {\n set(this, '_context', result);\n } else {\n // This is not a bind block, just push the result of the\n // expression to the render context and return.\n if (result === null || result === undefined) {\n result = \"\";\n } else if (!(result instanceof Handlebars.SafeString)) {\n result = String(result);\n }\n\n if (escape) { result = Handlebars.Utils.escapeExpression(result); }\n buffer.push(result);\n return;\n }\n }\n } else if (inverseTemplate) {\n set(this, 'template', inverseTemplate);\n\n if (preserveContext) {\n set(this, '_context', context);\n } else {\n set(this, '_context', result);\n }\n } else {\n set(this, 'template', function() { return ''; });\n }\n\n return this._super(buffer);\n }\n});\n\n})();\n//@ sourceURL=ember-handlebars/views/handlebars_bound_view");minispade.register('ember-handlebars/views/metamorph_view', "(function() {/*jshint newcap:false*/\nminispade.require(\"metamorph\");\nminispade.require(\"ember-views/views/view\");\n\n/**\n@module ember\n@submodule ember-handlebars\n*/\n\nvar set = Ember.set, get = Ember.get;\nvar Metamorph = requireModule('metamorph');\n\nfunction notifyMutationListeners() {\n Ember.run.once(Ember.View, 'notifyMutationListeners');\n}\n\n// DOMManager should just abstract dom manipulation between jquery and metamorph\nvar DOMManager = {\n remove: function(view) {\n view.morph.remove();\n notifyMutationListeners();\n },\n\n prepend: function(view, html) {\n view.morph.prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.morph.after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.morph.html(html);\n notifyMutationListeners();\n },\n\n // This is messed up.\n replace: function(view) {\n var morph = view.morph;\n\n view.transitionTo('preRender');\n\n Ember.run.schedule('render', this, function() {\n if (view.isDestroying) { return; }\n\n view.clearRenderedChildren();\n var buffer = view.renderToBuffer();\n\n view.invokeRecursively(function(view) {\n view.propertyWillChange('element');\n });\n view.triggerRecursively('willInsertElement');\n\n morph.replaceWith(buffer.string());\n view.transitionTo('inDOM');\n\n view.invokeRecursively(function(view) {\n view.propertyDidChange('element');\n });\n view.triggerRecursively('didInsertElement');\n\n notifyMutationListeners();\n });\n },\n\n empty: function(view) {\n view.morph.html(\"\");\n notifyMutationListeners();\n }\n};\n\n// The `morph` and `outerHTML` properties are internal only\n// and not observable.\n\n/**\n @class _Metamorph\n @namespace Ember\n @private\n*/\nEmber._Metamorph = Ember.Mixin.create({\n isVirtual: true,\n tagName: '',\n\n instrumentName: 'metamorph',\n\n init: function() {\n this._super();\n this.morph = Metamorph();\n Ember.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated. You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName);\n },\n\n beforeRender: function(buffer) {\n buffer.push(this.morph.startTag());\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n buffer.push(this.morph.endTag());\n },\n\n createElement: function() {\n var buffer = this.renderToBuffer();\n this.outerHTML = buffer.string();\n this.clearBuffer();\n },\n\n domManager: DOMManager\n});\n\n/**\n @class _MetamorphView\n @namespace Ember\n @extends Ember.View\n @uses Ember._Metamorph\n @private\n*/\nEmber._MetamorphView = Ember.View.extend(Ember._Metamorph);\n\n/**\n @class _SimpleMetamorphView\n @namespace Ember\n @extends Ember.CoreView\n @uses Ember._Metamorph\n @private\n*/\nEmber._SimpleMetamorphView = Ember.CoreView.extend(Ember._Metamorph);\n\n\n})();\n//@ sourceURL=ember-handlebars/views/metamorph_view");minispade.register('ember-metal/array', "(function() {/*jshint newcap:false*/\n/**\n@module ember-metal\n*/\n\n// NOTE: There is a bug in jshint that doesn't recognize `Object()` without `new`\n// as being ok unless both `newcap:false` and not `use strict`.\n// https://github.com/jshint/jshint/issues/392\n\n// Testing this is not ideal, but we want to use native functions\n// if available, but not to use versions created by libraries like Prototype\nvar isNativeFunc = function(func) {\n // This should probably work in all browsers likely to have ES5 array methods\n return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1;\n};\n\n// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/map\nvar arrayMap = isNativeFunc(Array.prototype.map) ? Array.prototype.map : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var res = new Array(len);\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n res[i] = fun.call(thisp, t[i], i, t);\n }\n }\n\n return res;\n};\n\n// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach\nvar arrayForEach = isNativeFunc(Array.prototype.forEach) ? Array.prototype.forEach : function(fun /*, thisp */) {\n //\"use strict\";\n\n if (this === void 0 || this === null) {\n throw new TypeError();\n }\n\n var t = Object(this);\n var len = t.length >>> 0;\n if (typeof fun !== \"function\") {\n throw new TypeError();\n }\n\n var thisp = arguments[1];\n for (var i = 0; i < len; i++) {\n if (i in t) {\n fun.call(thisp, t[i], i, t);\n }\n }\n};\n\nvar arrayIndexOf = isNativeFunc(Array.prototype.indexOf) ? Array.prototype.indexOf : function (obj, fromIndex) {\n if (fromIndex === null || fromIndex === undefined) { fromIndex = 0; }\n else if (fromIndex < 0) { fromIndex = Math.max(0, this.length + fromIndex); }\n for (var i = fromIndex, j = this.length; i < j; i++) {\n if (this[i] === obj) { return i; }\n }\n return -1;\n};\n\n/**\n Array polyfills to support ES5 features in older browsers.\n\n @namespace Ember\n @property ArrayPolyfills\n*/\nEmber.ArrayPolyfills = {\n map: arrayMap,\n forEach: arrayForEach,\n indexOf: arrayIndexOf\n};\n\nif (Ember.SHIM_ES5) {\n if (!Array.prototype.map) {\n Array.prototype.map = arrayMap;\n }\n\n if (!Array.prototype.forEach) {\n Array.prototype.forEach = arrayForEach;\n }\n\n if (!Array.prototype.indexOf) {\n Array.prototype.indexOf = arrayIndexOf;\n }\n}\n\n})();\n//@ sourceURL=ember-metal/array");minispade.register('ember-metal/binding', "(function() {minispade.require('ember-metal/core'); // Ember.Logger\nminispade.require('ember-metal/property_get'); // get\nminispade.require('ember-metal/property_set'); // set\nminispade.require('ember-metal/utils'); // guidFor, meta\nminispade.require('ember-metal/observer'); // addObserver, removeObserver\nminispade.require('ember-metal/run_loop'); // Ember.run.schedule\nminispade.require('ember-metal/map');\n\n/**\n@module ember-metal\n*/\n\n// ..........................................................\n// CONSTANTS\n//\n\n/**\n Debug parameter you can turn on. This will log all bindings that fire to\n the console. This should be disabled in production code. Note that you\n can also enable this from the console or temporarily.\n\n @property LOG_BINDINGS\n @for Ember\n @type Boolean\n @default false\n*/\nEmber.LOG_BINDINGS = false || !!Ember.ENV.LOG_BINDINGS;\n\nvar get = Ember.get,\n set = Ember.set,\n guidFor = Ember.guidFor,\n IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;\n\n/**\n Returns true if the provided path is global (e.g., `MyApp.fooController.bar`)\n instead of local (`foo.bar.baz`).\n\n @method isGlobalPath\n @for Ember\n @private\n @param {String} path\n @return Boolean\n*/\nvar isGlobalPath = Ember.isGlobalPath = function(path) {\n return IS_GLOBAL.test(path);\n};\n\nfunction getWithGlobals(obj, path) {\n return get(isGlobalPath(path) ? Ember.lookup : obj, path);\n}\n\n// ..........................................................\n// BINDING\n//\n\nvar Binding = function(toPath, fromPath) {\n this._direction = 'fwd';\n this._from = fromPath;\n this._to = toPath;\n this._directionMap = Ember.Map.create();\n};\n\n/**\n@class Binding\n@namespace Ember\n*/\n\nBinding.prototype = {\n /**\n This copies the Binding so it can be connected to another object.\n\n @method copy\n @return {Ember.Binding} `this`\n */\n copy: function () {\n var copy = new Binding(this._to, this._from);\n if (this._oneWay) { copy._oneWay = true; }\n return copy;\n },\n\n // ..........................................................\n // CONFIG\n //\n\n /**\n This will set `from` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method from\n @param {String} path the property path to connect to\n @return {Ember.Binding} `this`\n */\n from: function(path) {\n this._from = path;\n return this;\n },\n\n /**\n This will set the `to` property path to the specified value. It will not\n attempt to resolve this property path to an actual object until you\n connect the binding.\n\n The binding will search for the property path starting at the root object\n you pass when you `connect()` the binding. It follows the same rules as\n `get()` - see that method for more information.\n\n @method to\n @param {String|Tuple} path A property path or tuple\n @return {Ember.Binding} `this`\n */\n to: function(path) {\n this._to = path;\n return this;\n },\n\n /**\n Configures the binding as one way. A one-way binding will relay changes\n on the `from` side to the `to` side, but not the other way around. This\n means that if you change the `to` side directly, the `from` side may have\n a different value.\n\n @method oneWay\n @return {Ember.Binding} `this`\n */\n oneWay: function() {\n this._oneWay = true;\n return this;\n },\n\n /**\n @method toString\n @return {String} string representation of binding\n */\n toString: function() {\n var oneWay = this._oneWay ? '[oneWay]' : '';\n return \"Ember.Binding<\" + guidFor(this) + \">(\" + this._from + \" -> \" + this._to + \")\" + oneWay;\n },\n\n // ..........................................................\n // CONNECT AND SYNC\n //\n\n /**\n Attempts to connect this binding instance so that it can receive and relay\n changes. This method will raise an exception if you have not set the\n from/to properties yet.\n\n @method connect\n @param {Object} obj The root object for this binding.\n @return {Ember.Binding} `this`\n */\n connect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);\n\n var fromPath = this._from, toPath = this._to;\n Ember.trySet(obj, toPath, getWithGlobals(obj, fromPath));\n\n // add an observer on the object to be notified when the binding should be updated\n Ember.addObserver(obj, fromPath, this, this.fromDidChange);\n\n // if the binding is a two-way binding, also set up an observer on the target\n if (!this._oneWay) { Ember.addObserver(obj, toPath, this, this.toDidChange); }\n\n this._readyToSync = true;\n\n return this;\n },\n\n /**\n Disconnects the binding instance. Changes will no longer be relayed. You\n will not usually need to call this method.\n\n @method disconnect\n @param {Object} obj The root object you passed when connecting the binding.\n @return {Ember.Binding} `this`\n */\n disconnect: function(obj) {\n Ember.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);\n\n var twoWay = !this._oneWay;\n\n // remove an observer on the object so we're no longer notified of\n // changes that should update bindings.\n Ember.removeObserver(obj, this._from, this, this.fromDidChange);\n\n // if the binding is two-way, remove the observer from the target as well\n if (twoWay) { Ember.removeObserver(obj, this._to, this, this.toDidChange); }\n\n this._readyToSync = false; // disable scheduled syncs...\n return this;\n },\n\n // ..........................................................\n // PRIVATE\n //\n\n /* called when the from side changes */\n fromDidChange: function(target) {\n this._scheduleSync(target, 'fwd');\n },\n\n /* called when the to side changes */\n toDidChange: function(target) {\n this._scheduleSync(target, 'back');\n },\n\n _scheduleSync: function(obj, dir) {\n var directionMap = this._directionMap;\n var existingDir = directionMap.get(obj);\n\n // if we haven't scheduled the binding yet, schedule it\n if (!existingDir) {\n Ember.run.schedule('sync', this, this._sync, obj);\n directionMap.set(obj, dir);\n }\n\n // If both a 'back' and 'fwd' sync have been scheduled on the same object,\n // default to a 'fwd' sync so that it remains deterministic.\n if (existingDir === 'back' && dir === 'fwd') {\n directionMap.set(obj, 'fwd');\n }\n },\n\n _sync: function(obj) {\n var log = Ember.LOG_BINDINGS;\n\n // don't synchronize destroyed objects or disconnected bindings\n if (obj.isDestroyed || !this._readyToSync) { return; }\n\n // get the direction of the binding for the object we are\n // synchronizing from\n var directionMap = this._directionMap;\n var direction = directionMap.get(obj);\n\n var fromPath = this._from, toPath = this._to;\n\n directionMap.remove(obj);\n\n // if we're synchronizing from the remote object...\n if (direction === 'fwd') {\n var fromValue = getWithGlobals(obj, this._from);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '->', fromValue, obj);\n }\n if (this._oneWay) {\n Ember.trySet(obj, toPath, fromValue);\n } else {\n Ember._suspendObserver(obj, toPath, this, this.toDidChange, function () {\n Ember.trySet(obj, toPath, fromValue);\n });\n }\n // if we're synchronizing *to* the remote object\n } else if (direction === 'back') {\n var toValue = get(obj, this._to);\n if (log) {\n Ember.Logger.log(' ', this.toString(), '<-', toValue, obj);\n }\n Ember._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {\n Ember.trySet(Ember.isGlobalPath(fromPath) ? Ember.lookup : obj, fromPath, toValue);\n });\n }\n }\n\n};\n\nfunction mixinProperties(to, from) {\n for (var key in from) {\n if (from.hasOwnProperty(key)) {\n to[key] = from[key];\n }\n }\n}\n\nmixinProperties(Binding, {\n\n /*\n See `Ember.Binding.from`.\n\n @method from\n @static\n */\n from: function() {\n var C = this, binding = new C();\n return binding.from.apply(binding, arguments);\n },\n\n /*\n See `Ember.Binding.to`.\n\n @method to\n @static\n */\n to: function() {\n var C = this, binding = new C();\n return binding.to.apply(binding, arguments);\n },\n\n /**\n Creates a new Binding instance and makes it apply in a single direction.\n A one-way binding will relay changes on the `from` side object (supplied\n as the `from` argument) the `to` side, but not the other way around.\n This means that if you change the \"to\" side directly, the \"from\" side may have\n a different value.\n\n See `Binding.oneWay`.\n\n @method oneWay\n @param {String} from from path.\n @param {Boolean} [flag] (Optional) passing nothing here will make the\n binding `oneWay`. You can instead pass `false` to disable `oneWay`, making the\n binding two way again.\n @return {Ember.Binding} `this`\n */\n oneWay: function(from, flag) {\n var C = this, binding = new C(null, from);\n return binding.oneWay(flag);\n }\n\n});\n\n/**\n An `Ember.Binding` connects the properties of two objects so that whenever\n the value of one property changes, the other property will be changed also.\n\n ## Automatic Creation of Bindings with `/^*Binding/`-named Properties\n\n You do not usually create Binding objects directly but instead describe\n bindings in your class or object definition using automatic binding\n detection.\n\n Properties ending in a `Binding` suffix will be converted to `Ember.Binding`\n instances. The value of this property should be a string representing a path\n to another object or a custom binding instanced created using Binding helpers\n (see \"One Way Bindings\"):\n\n ```\n valueBinding: \"MyApp.someController.title\"\n ```\n\n This will create a binding from `MyApp.someController.title` to the `value`\n property of your object instance automatically. Now the two values will be\n kept in sync.\n\n ## One Way Bindings\n\n One especially useful binding customization you can use is the `oneWay()`\n helper. This helper tells Ember that you are only interested in\n receiving changes on the object you are binding from. For example, if you\n are binding to a preference and you want to be notified if the preference\n has changed, but your object will not be changing the preference itself, you\n could do:\n\n ```\n bigTitlesBinding: Ember.Binding.oneWay(\"MyApp.preferencesController.bigTitles\")\n ```\n\n This way if the value of `MyApp.preferencesController.bigTitles` changes the\n `bigTitles` property of your object will change also. However, if you\n change the value of your `bigTitles` property, it will not update the\n `preferencesController`.\n\n One way bindings are almost twice as fast to setup and twice as fast to\n execute because the binding only has to worry about changes to one side.\n\n You should consider using one way bindings anytime you have an object that\n may be created frequently and you do not intend to change a property; only\n to monitor it for changes (such as in the example above).\n\n ## Adding Bindings Manually\n\n All of the examples above show you how to configure a custom binding, but the\n result of these customizations will be a binding template, not a fully active\n Binding instance. The binding will actually become active only when you\n instantiate the object the binding belongs to. It is useful however, to\n understand what actually happens when the binding is activated.\n\n For a binding to function it must have at least a `from` property and a `to`\n property. The `from` property path points to the object/key that you want to\n bind from while the `to` path points to the object/key you want to bind to.\n\n When you define a custom binding, you are usually describing the property\n you want to bind from (such as `MyApp.someController.value` in the examples\n above). When your object is created, it will automatically assign the value\n you want to bind `to` based on the name of your binding key. In the\n examples above, during init, Ember objects will effectively call\n something like this on your binding:\n\n ```javascript\n binding = Ember.Binding.from(this.valueBinding).to(\"value\");\n ```\n\n This creates a new binding instance based on the template you provide, and\n sets the to path to the `value` property of the new object. Now that the\n binding is fully configured with a `from` and a `to`, it simply needs to be\n connected to become active. This is done through the `connect()` method:\n\n ```javascript\n binding.connect(this);\n ```\n\n Note that when you connect a binding you pass the object you want it to be\n connected to. This object will be used as the root for both the from and\n to side of the binding when inspecting relative paths. This allows the\n binding to be automatically inherited by subclassed objects as well.\n\n Now that the binding is connected, it will observe both the from and to side\n and relay changes.\n\n If you ever needed to do so (you almost never will, but it is useful to\n understand this anyway), you could manually create an active binding by\n using the `Ember.bind()` helper method. (This is the same method used by\n to setup your bindings on objects):\n\n ```javascript\n Ember.bind(MyApp.anotherObject, \"value\", \"MyApp.someController.value\");\n ```\n\n Both of these code fragments have the same effect as doing the most friendly\n form of binding creation like so:\n\n ```javascript\n MyApp.anotherObject = Ember.Object.create({\n valueBinding: \"MyApp.someController.value\",\n\n // OTHER CODE FOR THIS OBJECT...\n });\n ```\n\n Ember's built in binding creation method makes it easy to automatically\n create bindings for you. You should always use the highest-level APIs\n available, even if you understand how it works underneath.\n\n @class Binding\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Binding = Binding;\n\n\n/**\n Global helper method to create a new binding. Just pass the root object\n along with a `to` and `from` path to create and connect the binding.\n\n @method bind\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n*/\nEmber.bind = function(obj, to, from) {\n return new Ember.Binding(to, from).connect(obj);\n};\n\n/**\n @method oneWay\n @for Ember\n @param {Object} obj The root object of the transform.\n @param {String} to The path to the 'to' side of the binding.\n Must be relative to obj.\n @param {String} from The path to the 'from' side of the binding.\n Must be relative to obj or a global path.\n @return {Ember.Binding} binding instance\n*/\nEmber.oneWay = function(obj, to, from) {\n return new Ember.Binding(to, from).oneWay().connect(obj);\n};\n\n})();\n//@ sourceURL=ember-metal/binding");minispade.register('ember-metal/chains', "(function() {minispade.require('ember-metal/utils');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/watch_key');\n\nvar metaFor = Ember.meta, // utils.js\n get = Ember.get, // property_get.js\n normalizeTuple = Ember.normalizeTuple, // property_get.js\n forEach = Ember.ArrayPolyfills.forEach, // array.js\n warn = Ember.warn,\n watchKey = Ember.watchKey,\n unwatchKey = Ember.unwatchKey,\n FIRST_KEY = /^([^\\.\\*]+)/;\n\nfunction firstKey(path) {\n return path.match(FIRST_KEY)[0];\n}\n\nvar pendingQueue = [];\n\n// attempts to add the pendingQueue chains again. If some of them end up\n// back in the queue and reschedule is true, schedules a timeout to try\n// again.\nEmber.flushPendingChains = function() {\n if (pendingQueue.length === 0) { return; } // nothing to do\n\n var queue = pendingQueue;\n pendingQueue = [];\n\n forEach.call(queue, function(q) { q[0].add(q[1]); });\n\n warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);\n};\n\n\nfunction addChainWatcher(obj, keyName, node) {\n if (!obj || ('object' !== typeof obj)) { return; } // nothing to do\n\n var m = metaFor(obj), nodes = m.chainWatchers;\n\n if (!m.hasOwnProperty('chainWatchers')) {\n nodes = m.chainWatchers = {};\n }\n\n if (!nodes[keyName]) { nodes[keyName] = []; }\n nodes[keyName].push(node);\n watchKey(obj, keyName);\n}\n\nvar removeChainWatcher = Ember.removeChainWatcher = function(obj, keyName, node) {\n if (!obj || 'object' !== typeof obj) { return; } // nothing to do\n\n var m = metaFor(obj, false);\n if (!m.hasOwnProperty('chainWatchers')) { return; } // nothing to do\n\n var nodes = m.chainWatchers;\n\n if (nodes[keyName]) {\n nodes = nodes[keyName];\n for (var i = 0, l = nodes.length; i < l; i++) {\n if (nodes[i] === node) { nodes.splice(i, 1); }\n }\n }\n unwatchKey(obj, keyName);\n};\n\n// A ChainNode watches a single key on an object. If you provide a starting\n// value for the key then the node won't actually watch it. For a root node\n// pass null for parent and key and object for value.\nvar ChainNode = Ember._ChainNode = function(parent, key, value) {\n this._parent = parent;\n this._key = key;\n\n // _watching is true when calling get(this._parent, this._key) will\n // return the value of this node.\n //\n // It is false for the root of a chain (because we have no parent)\n // and for global paths (because the parent node is the object with\n // the observer on it)\n this._watching = value===undefined;\n\n this._value = value;\n this._paths = {};\n if (this._watching) {\n this._object = parent.value();\n if (this._object) { addChainWatcher(this._object, this._key, this); }\n }\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n //\n // TODO: Replace this with an efficient callback that the EachProxy\n // can implement.\n if (this._parent && this._parent._key === '@each') {\n this.value();\n }\n};\n\nvar ChainNodePrototype = ChainNode.prototype;\n\nfunction lazyGet(obj, key) {\n if (!obj) return undefined;\n\n var meta = metaFor(obj, false);\n // check if object meant only to be a prototype\n if (meta.proto === obj) return undefined;\n\n if (key === \"@each\") return get(obj, key);\n\n // if a CP only return cached value\n var desc = meta.descs[key];\n if (desc && desc._cacheable) {\n if (key in meta.cache) {\n return meta.cache[key];\n } else {\n return undefined;\n }\n }\n\n return get(obj, key);\n}\n\nChainNodePrototype.value = function() {\n if (this._value === undefined && this._watching) {\n var obj = this._parent.value();\n this._value = lazyGet(obj, this._key);\n }\n return this._value;\n};\n\nChainNodePrototype.destroy = function() {\n if (this._watching) {\n var obj = this._object;\n if (obj) { removeChainWatcher(obj, this._key, this); }\n this._watching = false; // so future calls do nothing\n }\n};\n\n// copies a top level object only\nChainNodePrototype.copy = function(obj) {\n var ret = new ChainNode(null, null, obj),\n paths = this._paths, path;\n for (path in paths) {\n if (paths[path] <= 0) { continue; } // this check will also catch non-number vals.\n ret.add(path);\n }\n return ret;\n};\n\n// called on the root node of a chain to setup watchers on the specified\n// path.\nChainNodePrototype.add = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n paths[path] = (paths[path] || 0) + 1;\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n\n // the path was a local path\n if (tuple[0] && tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n\n // global path, but object does not exist yet.\n // put into a queue and try to connect later.\n } else if (!tuple[0]) {\n pendingQueue.push([this, path]);\n tuple.length = 0;\n return;\n\n // global path, and object already exists\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.chain(key, path, src);\n};\n\n// called on the root node of a chain to teardown watcher on the specified\n// path\nChainNodePrototype.remove = function(path) {\n var obj, tuple, key, src, paths;\n\n paths = this._paths;\n if (paths[path] > 0) { paths[path]--; }\n\n obj = this.value();\n tuple = normalizeTuple(obj, path);\n if (tuple[0] === obj) {\n path = tuple[1];\n key = firstKey(path);\n path = path.slice(key.length+1);\n } else {\n src = tuple[0];\n key = path.slice(0, 0-(tuple[1].length+1));\n path = tuple[1];\n }\n\n tuple.length = 0;\n this.unchain(key, path);\n};\n\nChainNodePrototype.count = 0;\n\nChainNodePrototype.chain = function(key, path, src) {\n var chains = this._chains, node;\n if (!chains) { chains = this._chains = {}; }\n\n node = chains[key];\n if (!node) { node = chains[key] = new ChainNode(this, key, src); }\n node.count++; // count chains...\n\n // chain rest of path if there is one\n if (path && path.length>0) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.chain(key, path); // NOTE: no src means it will observe changes...\n }\n};\n\nChainNodePrototype.unchain = function(key, path) {\n var chains = this._chains, node = chains[key];\n\n // unchain rest of path first...\n if (path && path.length>1) {\n key = firstKey(path);\n path = path.slice(key.length+1);\n node.unchain(key, path);\n }\n\n // delete node if needed.\n node.count--;\n if (node.count<=0) {\n delete chains[node._key];\n node.destroy();\n }\n\n};\n\nChainNodePrototype.willChange = function(events) {\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].willChange(events);\n }\n }\n\n if (this._parent) { this._parent.chainWillChange(this, this._key, 1, events); }\n};\n\nChainNodePrototype.chainWillChange = function(chain, path, depth, events) {\n if (this._key) { path = this._key + '.' + path; }\n\n if (this._parent) {\n this._parent.chainWillChange(this, path, depth+1, events);\n } else {\n if (depth > 1) {\n events.push(this.value(), path);\n }\n path = 'this.' + path;\n if (this._paths[path] > 0) {\n events.push(this.value(), path);\n }\n }\n};\n\nChainNodePrototype.chainDidChange = function(chain, path, depth, events) {\n if (this._key) { path = this._key + '.' + path; }\n if (this._parent) {\n this._parent.chainDidChange(this, path, depth+1, events);\n } else {\n if (depth > 1) {\n events.push(this.value(), path);\n }\n path = 'this.' + path;\n if (this._paths[path] > 0) {\n events.push(this.value(), path);\n }\n }\n};\n\nChainNodePrototype.didChange = function(events) {\n // invalidate my own value first.\n if (this._watching) {\n var obj = this._parent.value();\n if (obj !== this._object) {\n removeChainWatcher(this._object, this._key, this);\n this._object = obj;\n addChainWatcher(obj, this._key, this);\n }\n this._value = undefined;\n\n // Special-case: the EachProxy relies on immediate evaluation to\n // establish its observers.\n if (this._parent && this._parent._key === '@each')\n this.value();\n }\n\n // then notify chains...\n var chains = this._chains;\n if (chains) {\n for(var key in chains) {\n if (!chains.hasOwnProperty(key)) { continue; }\n chains[key].didChange(events);\n }\n }\n\n // if no events are passed in then we only care about the above wiring update\n if (events === null) { return; }\n\n // and finally tell parent about my path changing...\n if (this._parent) { this._parent.chainDidChange(this, this._key, 1, events); }\n};\n\nEmber.finishChains = function(obj) {\n var m = metaFor(obj, false), chains = m.chains;\n if (chains) {\n if (chains.value() !== obj) {\n m.chains = chains = chains.copy(obj);\n }\n chains.didChange(null);\n }\n};\n\n})();\n//@ sourceURL=ember-metal/chains");minispade.register('ember-metal/computed', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/expand_properties');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/property_set');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/watching');\nminispade.require('ember-metal/property_events');\n\n/**\n@module ember-metal\n*/\n\nEmber.warn(\"The CP_DEFAULT_CACHEABLE flag has been removed and computed properties are always cached by default. Use `volatile` if you don't want caching.\", Ember.ENV.CP_DEFAULT_CACHEABLE !== false);\n\n\nvar get = Ember.get,\n set = Ember.set,\n metaFor = Ember.meta,\n a_slice = [].slice,\n o_create = Ember.create,\n META_KEY = Ember.META_KEY,\n watch = Ember.watch,\n unwatch = Ember.unwatch;\n\nif (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n var expandProperties = Ember.expandProperties;\n}\n\n// ..........................................................\n// DEPENDENT KEYS\n//\n\n// data structure:\n// meta.deps = {\n// 'depKey': {\n// 'keyName': count,\n// }\n// }\n\n/*\n This function returns a map of unique dependencies for a\n given object and key.\n*/\nfunction keysForDep(depsMeta, depKey) {\n var keys = depsMeta[depKey];\n if (!keys) {\n // if there are no dependencies yet for a the given key\n // create a new empty list of dependencies for the key\n keys = depsMeta[depKey] = {};\n } else if (!depsMeta.hasOwnProperty(depKey)) {\n // otherwise if the dependency list is inherited from\n // a superclass, clone the hash\n keys = depsMeta[depKey] = o_create(keys);\n }\n return keys;\n}\n\nfunction metaForDeps(meta) {\n return keysForDep(meta, 'deps');\n}\n\nfunction addDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) + 1;\n // Watch the depKey\n watch(obj, depKey);\n }\n}\n\nfunction removeDependentKeys(desc, obj, keyName, meta) {\n // the descriptor has a list of dependent keys, so\n // add all of its dependent keys.\n var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;\n if (!depKeys) return;\n\n depsMeta = metaForDeps(meta);\n\n for(idx = 0, len = depKeys.length; idx < len; idx++) {\n depKey = depKeys[idx];\n // Lookup keys meta for depKey\n keys = keysForDep(depsMeta, depKey);\n // Increment the number of times depKey depends on keyName.\n keys[keyName] = (keys[keyName] || 0) - 1;\n // Watch the depKey\n unwatch(obj, depKey);\n }\n}\n\n// ..........................................................\n// COMPUTED PROPERTY\n//\n\n/**\n A computed property transforms an objects function into a property.\n\n By default the function backing the computed property will only be called\n once and the result will be cached. You can specify various properties\n that your computed property is dependent on. This will force the cached\n result to be recomputed if the dependencies are modified.\n\n In the following example we declare a computed property (by calling\n `.property()` on the fullName function) and setup the properties\n dependencies (depending on firstName and lastName). The fullName function\n will be called once (regardless of how many times it is accessed) as long\n as it's dependencies have not been changed. Once firstName or lastName are updated\n any future calls (or anything bound) to fullName will incorporate the new\n values.\n\n ```javascript\n Person = Ember.Object.extend({\n // these will be supplied by `create`\n firstName: null,\n lastName: null,\n\n fullName: function() {\n var firstName = this.get('firstName');\n var lastName = this.get('lastName');\n\n return firstName + ' ' + lastName;\n }.property('firstName', 'lastName')\n });\n\n var tom = Person.create({\n firstName: \"Tom\",\n lastName: \"Dale\"\n });\n\n tom.get('fullName') // \"Tom Dale\"\n ```\n\n You can also define what Ember should do when setting a computed property.\n If you try to set a computed property, it will be invoked with the key and\n value you want to set it to. You can also accept the previous value as the\n third parameter.\n\n ```javascript\n\n Person = Ember.Object.extend({\n // these will be supplied by `create`\n firstName: null,\n lastName: null,\n\n fullName: function(key, value, oldValue) {\n // getter\n if (arguments.length === 1) {\n var firstName = this.get('firstName');\n var lastName = this.get('lastName');\n\n return firstName + ' ' + lastName;\n\n // setter\n } else {\n var name = value.split(\" \");\n\n this.set('firstName', name[0]);\n this.set('lastName', name[1]);\n\n return value;\n }\n }.property('firstName', 'lastName')\n });\n\n var person = Person.create();\n person.set('fullName', \"Peter Wagenet\");\n person.get('firstName') // Peter\n person.get('lastName') // Wagenet\n ```\n\n @class ComputedProperty\n @namespace Ember\n @extends Ember.Descriptor\n @constructor\n*/\nfunction ComputedProperty(func, opts) {\n this.func = func;\n\n this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;\n this._dependentKeys = opts && opts.dependentKeys;\n this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly);\n}\n\nEmber.ComputedProperty = ComputedProperty;\nComputedProperty.prototype = new Ember.Descriptor();\n\nvar ComputedPropertyPrototype = ComputedProperty.prototype;\n\n/**\n Properties are cacheable by default. Computed property will automatically\n cache the return value of your function until one of the dependent keys changes.\n\n Call `volatile()` to set it into non-cached mode. When in this mode\n the computed property will not automatically cache the return value.\n\n However, if a property is properly observable, there is no reason to disable\n caching.\n\n @method cacheable\n @param {Boolean} aFlag optional set to `false` to disable caching\n @return {Ember.ComputedProperty} this\n @chainable\n*/\nComputedPropertyPrototype.cacheable = function(aFlag) {\n this._cacheable = aFlag !== false;\n return this;\n};\n\n/**\n Call on a computed property to set it into non-cached mode. When in this\n mode the computed property will not automatically cache the return value.\n\n ```javascript\n MyApp.outsideService = Ember.Object.create({\n value: function() {\n return OutsideService.getValue();\n }.property().volatile()\n });\n ```\n\n @method volatile\n @return {Ember.ComputedProperty} this\n @chainable\n*/\nComputedPropertyPrototype.volatile = function() {\n return this.cacheable(false);\n};\n\n/**\n Call on a computed property to set it into read-only mode. When in this\n mode the computed property will throw an error when set.\n\n ```javascript\n MyApp.person = Ember.Object.create({\n guid: function() {\n return 'guid-guid-guid';\n }.property().readOnly()\n });\n\n MyApp.person.set('guid', 'new-guid'); // will throw an exception\n ```\n\n @method readOnly\n @return {Ember.ComputedProperty} this\n @chainable\n*/\nComputedPropertyPrototype.readOnly = function(readOnly) {\n this._readOnly = readOnly === undefined || !!readOnly;\n return this;\n};\n\n/**\n Sets the dependent keys on this computed property. Pass any number of\n arguments containing key paths that this computed property depends on.\n\n ```javascript\n MyApp.president = Ember.Object.create({\n fullName: Ember.computed(function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember that this computed property depends on firstName\n // and lastName\n }).property('firstName', 'lastName')\n });\n ```\n\n @method property\n @param {String} path* zero or more property paths\n @return {Ember.ComputedProperty} this\n @chainable\n*/\nComputedPropertyPrototype.property = function() {\n var addArg;\n\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n // Slightly odd setup to keep JSHint happy\n addArg = function(arg) { args.push(arg); };\n }\n\n var args = [];\n for (var i = 0, l = arguments.length; i < l; i++) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(arguments[i], addArg);\n } else {\n args.push(arguments[i]);\n }\n }\n this._dependentKeys = args;\n return this;\n};\n\n/**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For example,\n computed property functions may close over variables that are then no longer\n available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n The hash that you pass to the `meta()` function will be saved on the\n computed property descriptor under the `_meta` key. Ember runtime\n exposes a public API for retrieving these values from classes,\n via the `metaForProperty()` function.\n\n @method meta\n @param {Hash} meta\n @chainable\n*/\n\nComputedPropertyPrototype.meta = function(meta) {\n if (arguments.length === 0) {\n return this._meta || {};\n } else {\n this._meta = meta;\n return this;\n }\n};\n\n/* impl descriptor API */\nComputedPropertyPrototype.didChange = function(obj, keyName) {\n // _suspended is set via a CP.set to ensure we don't clear\n // the cached value set by the setter\n if (this._cacheable && this._suspended !== obj) {\n var meta = metaFor(obj);\n if (keyName in meta.cache) {\n delete meta.cache[keyName];\n removeDependentKeys(this, obj, keyName, meta);\n }\n }\n};\n\nfunction finishChains(chainNodes)\n{\n for (var i=0, l=chainNodes.length; i<l; i++) {\n chainNodes[i].didChange(null);\n }\n}\n\n/**\n Access the value of the function backing the computed property.\n If this property has already been cached, return the cached result.\n Otherwise, call the function passing the property name as an argument.\n\n ```javascript\n Person = Ember.Object.extend({\n fullName: function(keyName) {\n // the keyName parameter is 'fullName' in this case.\n\n return this.get('firstName') + ' ' + this.get('lastName');\n }.property('firstName', 'lastName')\n });\n\n\n var tom = Person.create({\n firstName: \"Tom\",\n lastName: \"Dale\"\n });\n\n tom.get('fullName') // \"Tom Dale\"\n ```\n\n @method get\n @param {String} keyName The key being accessed.\n @return {Object} The return value of the function backing the CP.\n*/\nComputedPropertyPrototype.get = function(obj, keyName) {\n var ret, cache, meta, chainNodes;\n if (this._cacheable) {\n meta = metaFor(obj);\n cache = meta.cache;\n if (keyName in cache) { return cache[keyName]; }\n ret = cache[keyName] = this.func.call(obj, keyName);\n chainNodes = meta.chainWatchers && meta.chainWatchers[keyName];\n if (chainNodes) { finishChains(chainNodes); }\n addDependentKeys(this, obj, keyName, meta);\n } else {\n ret = this.func.call(obj, keyName);\n }\n return ret;\n};\n\n/**\n Set the value of a computed property. If the function that backs your\n computed property does not accept arguments then the default action for\n setting would be to define the property on the current object, and set\n the value of the property to the value being set.\n\n Generally speaking if you intend for your computed property to be set\n your backing function should accept either two or three arguments.\n\n @method set\n @param {String} keyName The key being accessed.\n @param {Object} newValue The new value being assigned.\n @param {String} oldValue The old value being replaced.\n @return {Object} The return value of the function backing the CP.\n*/\nComputedPropertyPrototype.set = function(obj, keyName, value) {\n var cacheable = this._cacheable,\n func = this.func,\n meta = metaFor(obj, cacheable),\n watched = meta.watching[keyName],\n oldSuspended = this._suspended,\n hadCachedValue = false,\n cache = meta.cache,\n funcArgLength, cachedValue, ret;\n\n if (this._readOnly) {\n throw new Ember.Error('Cannot Set: ' + keyName + ' on: ' + obj.toString() );\n }\n\n this._suspended = obj;\n\n try {\n\n if (cacheable && cache.hasOwnProperty(keyName)) {\n cachedValue = cache[keyName];\n hadCachedValue = true;\n }\n\n // Check if the CP has been wrapped. If if has, use the\n // length from the wrapped function.\n funcArgLength = (func.wrappedFunction ? func.wrappedFunction.length : func.length);\n\n // For backwards-compatibility with computed properties\n // that check for arguments.length === 2 to determine if\n // they are being get or set, only pass the old cached\n // value if the computed property opts into a third\n // argument.\n if (funcArgLength === 3) {\n ret = func.call(obj, keyName, value, cachedValue);\n } else if (funcArgLength === 2) {\n ret = func.call(obj, keyName, value);\n } else {\n Ember.defineProperty(obj, keyName, null, cachedValue);\n Ember.set(obj, keyName, value);\n return;\n }\n\n if (hadCachedValue && cachedValue === ret) { return; }\n\n if (watched) { Ember.propertyWillChange(obj, keyName); }\n\n if (hadCachedValue) {\n delete cache[keyName];\n }\n\n if (cacheable) {\n if (!hadCachedValue) {\n addDependentKeys(this, obj, keyName, meta);\n }\n cache[keyName] = ret;\n }\n\n if (watched) { Ember.propertyDidChange(obj, keyName); }\n } finally {\n this._suspended = oldSuspended;\n }\n return ret;\n};\n\n/* called before property is overridden */\nComputedPropertyPrototype.teardown = function(obj, keyName) {\n var meta = metaFor(obj);\n\n if (keyName in meta.cache) {\n removeDependentKeys(this, obj, keyName, meta);\n }\n\n if (this._cacheable) { delete meta.cache[keyName]; }\n\n return null; // no value to restore\n};\n\n\n/**\n This helper returns a new property descriptor that wraps the passed\n computed property function. You can use this helper to define properties\n with mixins or via `Ember.defineProperty()`.\n\n The function you pass will be used to both get and set property values.\n The function should accept two parameters, key and value. If value is not\n undefined you should set the value first. In either case return the\n current value of the property.\n @method computed\n @for Ember\n @param {Function} func The computed property function.\n @return {Ember.ComputedProperty} property descriptor instance\n*/\nEmber.computed = function(func) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n func = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Computed Property declared without a property function\");\n }\n\n var cp = new ComputedProperty(func);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n};\n\n/**\n Returns the cached value for a property, if one exists.\n This can be useful for peeking at the value of a computed\n property that is generated lazily, without accidentally causing\n it to be created.\n\n @method cacheFor\n @for Ember\n @param {Object} obj the object whose property you want to check\n @param {String} key the name of the property whose cached value you want\n to return\n @return {*} the cached value\n*/\nEmber.cacheFor = function cacheFor(obj, key) {\n var cache = metaFor(obj, false).cache;\n\n if (cache && key in cache) {\n return cache[key];\n }\n};\n\nfunction getProperties(self, propertyNames) {\n var ret = {};\n for(var i = 0; i < propertyNames.length; i++) {\n ret[propertyNames[i]] = get(self, propertyNames[i]);\n }\n return ret;\n}\n\nfunction registerComputed(name, macro) {\n Ember.computed[name] = function(dependentKey) {\n var args = a_slice.call(arguments);\n return Ember.computed(dependentKey, function() {\n return macro.apply(this, args);\n });\n };\n}\n\nfunction registerComputedWithProperties(name, macro) {\n Ember.computed[name] = function() {\n var properties = a_slice.call(arguments);\n\n var computed = Ember.computed(function() {\n return macro.apply(this, [getProperties(this, properties)]);\n });\n\n return computed.property.apply(computed, properties);\n };\n}\n\n/**\n A computed property that returns true if the value of the dependent\n property is null, an empty string, empty array, or empty function.\n\n Note: When using `Ember.computed.empty` to watch an array make sure to\n use the `array.[]` syntax so the computed can subscribe to transitions\n from empty to non-empty states.\n\n Example\n\n ```javascript\n var ToDoList = Ember.Object.extend({\n done: Ember.computed.empty('todos.[]') // detect array changes\n });\n var todoList = ToDoList.create({todos: ['Unit Test', 'Documentation', 'Release']});\n todoList.get('done'); // false\n todoList.get('todos').clear(); // []\n todoList.get('done'); // true\n ```\n\n @method computed.empty\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which negate\n the original value for property\n*/\nregisterComputed('empty', function(dependentKey) {\n return Ember.isEmpty(get(this, dependentKey));\n});\n\n/**\n A computed property that returns true if the value of the dependent\n property is NOT null, an empty string, empty array, or empty function.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasStuff: Ember.computed.notEmpty('backpack')\n });\n var hampster = Hampster.create({backpack: ['Food', 'Sleeping Bag', 'Tent']});\n hampster.get('hasStuff'); // true\n hampster.get('backpack').clear(); // []\n hampster.get('hasStuff'); // false\n ```\n\n @method computed.notEmpty\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which returns true if\n original value for property is not empty.\n*/\nregisterComputed('notEmpty', function(dependentKey) {\n return !Ember.isEmpty(get(this, dependentKey));\n});\n\n/**\n A computed property that returns true if the value of the dependent\n property is null or undefined. This avoids errors from JSLint complaining\n about use of ==, which can be technically confusing.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n isHungry: Ember.computed.none('food')\n });\n var hampster = Hampster.create();\n hampster.get('isHungry'); // true\n hampster.set('food', 'Banana');\n hampster.get('isHungry'); // false\n hampster.set('food', null);\n hampster.get('isHungry'); // true\n ```\n\n @method computed.none\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which\n returns true if original value for property is null or undefined.\n*/\nregisterComputed('none', function(dependentKey) {\n return Ember.isNone(get(this, dependentKey));\n});\n\n/**\n A computed property that returns the inverse boolean value\n of the original value for the dependent property.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n isAnonymous: Ember.computed.not('loggedIn')\n });\n var user = User.create({loggedIn: false});\n user.get('isAnonymous'); // true\n user.set('loggedIn', true);\n user.get('isAnonymous'); // false\n ```\n\n @method computed.not\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which returns\n inverse of the original value for property\n*/\nregisterComputed('not', function(dependentKey) {\n return !get(this, dependentKey);\n});\n\n/**\n A computed property that converts the provided dependent property\n into a boolean value.\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasBananas: Ember.computed.bool('numBananas')\n });\n var hampster = Hampster.create();\n hampster.get('hasBananas'); // false\n hampster.set('numBananas', 0);\n hampster.get('hasBananas'); // false\n hampster.set('numBananas', 1);\n hampster.get('hasBananas'); // true\n hampster.set('numBananas', null);\n hampster.get('hasBananas'); // false\n ```\n\n @method computed.bool\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which converts\n to boolean the original value for property\n*/\nregisterComputed('bool', function(dependentKey) {\n return !!get(this, dependentKey);\n});\n\n/**\n A computed property which matches the original value for the\n dependent property against a given RegExp, returning `true`\n if they values matches the RegExp and `false` if it does not.\n\n Example\n\n ```javascript\n var User = Ember.Object.extend({\n hasValidEmail: Ember.computed.match('email', /^.+@.+\\..+$/)\n });\n var user = User.create({loggedIn: false});\n user.get('hasValidEmail'); // false\n user.set('email', '');\n user.get('hasValidEmail'); // false\n user.set('email', 'ember_hampster@example.com');\n user.get('hasValidEmail'); // true\n ```\n\n @method computed.match\n @for Ember\n @param {String} dependentKey\n @param {RegExp} regexp\n @return {Ember.ComputedProperty} computed property which match\n the original value for property against a given RegExp\n*/\nregisterComputed('match', function(dependentKey, regexp) {\n var value = get(this, dependentKey);\n return typeof value === 'string' ? !!value.match(regexp) : false;\n});\n\n/**\n A computed property that returns true if the provided dependent property\n is equal to the given value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n napTime: Ember.computed.equal('state', 'sleepy')\n });\n var hampster = Hampster.create();\n hampster.get('napTime'); // false\n hampster.set('state', 'sleepy');\n hampster.get('napTime'); // true\n hampster.set('state', 'hungry');\n hampster.get('napTime'); // false\n ```\n\n @method computed.equal\n @for Ember\n @param {String} dependentKey\n @param {String|Number|Object} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is equal to the given value.\n*/\nregisterComputed('equal', function(dependentKey, value) {\n return get(this, dependentKey) === value;\n});\n\n/**\n A computed property that returns true if the provied dependent property\n is greater than the provided value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasTooManyBananas: Ember.computed.gt('numBananas', 10)\n });\n var hampster = Hampster.create();\n hampster.get('hasTooManyBananas'); // false\n hampster.set('numBananas', 3);\n hampster.get('hasTooManyBananas'); // false\n hampster.set('numBananas', 11);\n hampster.get('hasTooManyBananas'); // true\n ```\n\n @method computed.gt\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is greater then given value.\n*/\nregisterComputed('gt', function(dependentKey, value) {\n return get(this, dependentKey) > value;\n});\n\n/**\n A computed property that returns true if the provided dependent property\n is greater than or equal to the provided value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasTooManyBananas: Ember.computed.gte('numBananas', 10)\n });\n var hampster = Hampster.create();\n hampster.get('hasTooManyBananas'); // false\n hampster.set('numBananas', 3);\n hampster.get('hasTooManyBananas'); // false\n hampster.set('numBananas', 10);\n hampster.get('hasTooManyBananas'); // true\n ```\n\n @method computed.gte\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is greater or equal then given value.\n*/\nregisterComputed('gte', function(dependentKey, value) {\n return get(this, dependentKey) >= value;\n});\n\n/**\n A computed property that returns true if the provided dependent property\n is less than the provided value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n needsMoreBananas: Ember.computed.lt('numBananas', 3)\n });\n var hampster = Hampster.create();\n hampster.get('needsMoreBananas'); // true\n hampster.set('numBananas', 3);\n hampster.get('needsMoreBananas'); // false\n hampster.set('numBananas', 2);\n hampster.get('needsMoreBananas'); // true\n ```\n\n @method computed.lt\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is less then given value.\n*/\nregisterComputed('lt', function(dependentKey, value) {\n return get(this, dependentKey) < value;\n});\n\n/**\n A computed property that returns true if the provided dependent property\n is less than or equal to the provided value.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n needsMoreBananas: Ember.computed.lte('numBananas', 3)\n });\n var hampster = Hampster.create();\n hampster.get('needsMoreBananas'); // true\n hampster.set('numBananas', 5);\n hampster.get('needsMoreBananas'); // false\n hampster.set('numBananas', 3);\n hampster.get('needsMoreBananas'); // true\n ```\n\n @method computed.lte\n @for Ember\n @param {String} dependentKey\n @param {Number} value\n @return {Ember.ComputedProperty} computed property which returns true if\n the original value for property is less or equal then given value.\n*/\nregisterComputed('lte', function(dependentKey, value) {\n return get(this, dependentKey) <= value;\n});\n\n/**\n A computed property that performs a logical `and` on the\n original values for the provided dependent properties.\n\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n readyForCamp: Ember.computed.and('hasTent', 'hasBackpack')\n });\n var hampster = Hampster.create();\n hampster.get('readyForCamp'); // false\n hampster.set('hasTent', true);\n hampster.get('readyForCamp'); // false\n hampster.set('hasBackpack', true);\n hampster.get('readyForCamp'); // true\n ```\n\n @method computed.and\n @for Ember\n @param {String} dependentKey, [dependentKey...]\n @return {Ember.ComputedProperty} computed property which performs\n a logical `and` on the values of all the original values for properties.\n*/\nregisterComputedWithProperties('and', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && !properties[key]) {\n return false;\n }\n }\n return true;\n});\n\n/**\n A computed property which performs a logical `or` on the\n original values for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella')\n });\n var hampster = Hampster.create();\n hampster.get('readyForRain'); // false\n hampster.set('hasJacket', true);\n hampster.get('readyForRain'); // true\n ```\n\n @method computed.or\n @for Ember\n @param {String} dependentKey, [dependentKey...]\n @return {Ember.ComputedProperty} computed property which performs\n a logical `or` on the values of all the original values for properties.\n*/\nregisterComputedWithProperties('or', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n return true;\n }\n }\n return false;\n});\n\n/**\n A computed property that returns the first truthy value\n from a list of dependent properties.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n hasClothes: Ember.computed.any('hat', 'shirt')\n });\n var hampster = Hampster.create();\n hampster.get('hasClothes'); // null\n hampster.set('shirt', 'Hawaiian Shirt');\n hampster.get('hasClothes'); // 'Hawaiian Shirt'\n ```\n\n @method computed.any\n @for Ember\n @param {String} dependentKey, [dependentKey...]\n @return {Ember.ComputedProperty} computed property which returns\n the first truthy value of given list of properties.\n*/\nregisterComputedWithProperties('any', function(properties) {\n for (var key in properties) {\n if (properties.hasOwnProperty(key) && properties[key]) {\n return properties[key];\n }\n }\n return null;\n});\n\n/**\n A computed property that returns the array of values\n for the provided dependent properties.\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n clothes: Ember.computed.map('hat', 'shirt')\n });\n var hampster = Hampster.create();\n hampster.get('clothes'); // [null, null]\n hampster.set('hat', 'Camp Hat');\n hampster.set('shirt', 'Camp Shirt');\n hampster.get('clothes'); // ['Camp Hat', 'Camp Shirt']\n ```\n\n @method computed.map\n @for Ember\n @param {String} dependentKey, [dependentKey...]\n @return {Ember.ComputedProperty} computed property which maps\n values of all passed properties in to an array.\n*/\nregisterComputedWithProperties('collect', function(properties) {\n var res = [];\n for (var key in properties) {\n if (properties.hasOwnProperty(key)) {\n if (Ember.isNone(properties[key])) {\n res.push(null);\n } else {\n res.push(properties[key]);\n }\n }\n }\n return res;\n});\n\n/**\n Creates a new property that is an alias for another property\n on an object. Calls to `get` or `set` this property behave as\n though they were called on the original property.\n\n ```javascript\n Person = Ember.Object.extend({\n name: 'Alex Matchneer',\n nomen: Ember.computed.alias('name')\n });\n\n alex = Person.create();\n alex.get('nomen'); // 'Alex Matchneer'\n alex.get('name'); // 'Alex Matchneer'\n\n alex.set('nomen', '@machty');\n alex.get('name'); // '@machty'\n ```\n @method computed.alias\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates an\n alias to the original value for property.\n*/\nEmber.computed.alias = function(dependentKey) {\n return Ember.computed(dependentKey, function(key, value) {\n if (arguments.length > 1) {\n set(this, dependentKey, value);\n return value;\n } else {\n return get(this, dependentKey);\n }\n });\n};\n\n/**\n Where `computed.alias` aliases `get` and `set`, and allows for bidirectional\n data flow, `computed.oneWay` only provides an aliased `get`. The `set` will\n not mutate the upstream property, rather causes the current property to\n become the value set. This causes the downstream property to permentantly\n diverge from the upstream property.\n\n Example\n\n ```javascript\n User = Ember.Object.extend({\n firstName: null,\n lastName: null,\n nickName: Ember.computed.oneWay('firstName')\n });\n\n user = User.create({\n firstName: 'Teddy',\n lastName: 'Zeenny'\n });\n\n user.get('nickName');\n # 'Teddy'\n\n user.set('nickName', 'TeddyBear');\n # 'TeddyBear'\n\n user.get('firstName');\n # 'Teddy'\n ```\n\n @method computed.oneWay\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computed property which creates a\n one way computed property to the original value for property.\n*/\nEmber.computed.oneWay = function(dependentKey) {\n return Ember.computed(dependentKey, function() {\n return get(this, dependentKey);\n });\n};\n\n\n/**\n A computed property that acts like a standard getter and setter,\n but returns the value at the provided `defaultPath` if the\n property itself has not been set to a value\n\n Example\n\n ```javascript\n var Hampster = Ember.Object.extend({\n wishList: Ember.computed.defaultTo('favoriteFood')\n });\n var hampster = Hampster.create({favoriteFood: 'Banana'});\n hampster.get('wishList'); // 'Banana'\n hampster.set('wishList', 'More Unit Tests');\n hampster.get('wishList'); // 'More Unit Tests'\n hampster.get('favoriteFood'); // 'Banana'\n ```\n\n @method computed.defaultTo\n @for Ember\n @param {String} defaultPath\n @return {Ember.ComputedProperty} computed property which acts like\n a standard getter and setter, but defaults to the value from `defaultPath`.\n*/\nEmber.computed.defaultTo = function(defaultPath) {\n return Ember.computed(function(key, newValue, cachedValue) {\n if (arguments.length === 1) {\n return cachedValue != null ? cachedValue : get(this, defaultPath);\n }\n return newValue != null ? newValue : get(this, defaultPath);\n });\n};\n\n\n\n})();\n//@ sourceURL=ember-metal/computed");minispade.register('ember-metal/core', "(function() {/*globals Em:true ENV */\n\n/**\n@module ember\n@submodule ember-metal\n*/\n\n/**\n All Ember methods and functions are defined inside of this namespace. You\n generally should not add new properties to this namespace as it may be\n overwritten by future versions of Ember.\n\n You can also use the shorthand `Em` instead of `Ember`.\n\n Ember-Runtime is a framework that provides core functions for Ember including\n cross-platform functions, support for property observing and objects. Its\n focus is on small size and performance. You can use this in place of or\n along-side other cross-platform libraries such as jQuery.\n\n The core Runtime framework is based on the jQuery API with a number of\n performance optimizations.\n\n @class Ember\n @static\n @version 1.2.0-beta.3\n*/\n\nif ('undefined' === typeof Ember) {\n // Create core object. Make it act like an instance of Ember.Namespace so that\n // objects assigned to it are given a sane string representation.\n Ember = {};\n}\n\n// Default imports, exports and lookup to the global object;\nvar imports = Ember.imports = Ember.imports || this;\nvar exports = Ember.exports = Ember.exports || this;\nvar lookup = Ember.lookup = Ember.lookup || this;\n\n// aliases needed to keep minifiers from removing the global context\nexports.Em = exports.Ember = Em = Ember;\n\n// Make sure these are set whether Ember was already defined or not\n\nEmber.isNamespace = true;\n\nEmber.toString = function() { return \"Ember\"; };\n\n\n/**\n @property VERSION\n @type String\n @default '1.2.0-beta.3'\n @final\n*/\nEmber.VERSION = '1.2.0-beta.3';\n\n/**\n Standard environmental variables. You can define these in a global `ENV`\n variable before loading Ember to control various configuration\n settings.\n\n @property ENV\n @type Hash\n*/\n\nif ('undefined' === typeof ENV) {\n exports.ENV = {};\n}\n\n// We disable the RANGE API by default for performance reasons\nif ('undefined' === typeof ENV.DISABLE_RANGE_API) {\n ENV.DISABLE_RANGE_API = true;\n}\n\n\nEmber.ENV = Ember.ENV || ENV;\n\nEmber.config = Ember.config || {};\n\n/**\n Hash of enabled Canary features. Add to before creating your application.\n\n You can also define `ENV.FEATURES` if you need to enable features flagged at runtime.\n\n @property FEATURES\n @type Hash\n*/\n\nEmber.FEATURES = Ember.ENV.FEATURES || {};\n\n/**\n Test that a feature is enabled. Parsed by Ember's build tools to leave\n experimental features out of beta/stable builds.\n\n You can define the following configuration options:\n\n * `ENV.ENABLE_ALL_FEATURES` - force all features to be enabled.\n * `ENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly\n enabled/disabled.\n\n @method isEnabled\n @param {string} feature\n*/\n\nEmber.FEATURES.isEnabled = function(feature) {\n var featureValue = Ember.FEATURES[feature];\n\n if (Ember.ENV.ENABLE_ALL_FEATURES) {\n return true;\n } else if (featureValue === true || featureValue === false || featureValue === undefined) {\n return featureValue;\n } else if (Ember.ENV.ENABLE_OPTIONAL_FEATURES) {\n return true;\n } else {\n return false;\n }\n};\n\n// ..........................................................\n// BOOTSTRAP\n//\n\n/**\n Determines whether Ember should enhances some built-in object prototypes to\n provide a more friendly API. If enabled, a few methods will be added to\n `Function`, `String`, and `Array`. `Object.prototype` will not be enhanced,\n which is the one that causes most trouble for people.\n\n In general we recommend leaving this option set to true since it rarely\n conflicts with other code. If you need to turn it off however, you can\n define an `ENV.EXTEND_PROTOTYPES` config to disable it.\n\n @property EXTEND_PROTOTYPES\n @type Boolean\n @default true\n*/\nEmber.EXTEND_PROTOTYPES = Ember.ENV.EXTEND_PROTOTYPES;\n\nif (typeof Ember.EXTEND_PROTOTYPES === 'undefined') {\n Ember.EXTEND_PROTOTYPES = true;\n}\n\n/**\n Determines whether Ember logs a full stack trace during deprecation warnings\n\n @property LOG_STACKTRACE_ON_DEPRECATION\n @type Boolean\n @default true\n*/\nEmber.LOG_STACKTRACE_ON_DEPRECATION = (Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== false);\n\n/**\n Determines whether Ember should add ECMAScript 5 shims to older browsers.\n\n @property SHIM_ES5\n @type Boolean\n @default Ember.EXTEND_PROTOTYPES\n*/\nEmber.SHIM_ES5 = (Ember.ENV.SHIM_ES5 === false) ? false : Ember.EXTEND_PROTOTYPES;\n\n/**\n Determines whether Ember logs info about version of used libraries\n\n @property LOG_VERSION\n @type Boolean\n @default true\n*/\nEmber.LOG_VERSION = (Ember.ENV.LOG_VERSION === false) ? false : true;\n\n/**\n Empty function. Useful for some operations. Always returns `this`.\n\n @method K\n @private\n @return {Object}\n*/\nEmber.K = function() { return this; };\n\n\n// Stub out the methods defined by the ember-debug package in case it's not loaded\n\nif ('undefined' === typeof Ember.assert) { Ember.assert = Ember.K; }\nif ('undefined' === typeof Ember.warn) { Ember.warn = Ember.K; }\nif ('undefined' === typeof Ember.debug) { Ember.debug = Ember.K; }\nif ('undefined' === typeof Ember.deprecate) { Ember.deprecate = Ember.K; }\nif ('undefined' === typeof Ember.deprecateFunc) {\n Ember.deprecateFunc = function(_, func) { return func; };\n}\n\n/**\n Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from\n jQuery master. We'll just bootstrap our own uuid now.\n\n @property uuid\n @type Number\n @private\n*/\nEmber.uuid = 0;\n\n/**\n Merge the contents of two objects together into the first object.\n\n ```javascript\n Ember.merge({first: 'Tom'}, {last: 'Dale'}); // {first: 'Tom', last: 'Dale'}\n var a = {first: 'Yehuda'}, b = {last: 'Katz'};\n Ember.merge(a, b); // a == {first: 'Yehuda', last: 'Katz'}, b == {last: 'Katz'}\n ```\n\n @method merge\n @for Ember\n @param {Object} original The object to merge into\n @param {Object} updates The object to copy properties from\n @return {Object}\n*/\nEmber.merge = function(original, updates) {\n for (var prop in updates) {\n if (!updates.hasOwnProperty(prop)) { continue; }\n original[prop] = updates[prop];\n }\n return original;\n};\n\n/**\n Returns true if the passed value is null or undefined. This avoids errors\n from JSLint complaining about use of ==, which can be technically\n confusing.\n\n ```javascript\n Ember.isNone(); // true\n Ember.isNone(null); // true\n Ember.isNone(undefined); // true\n Ember.isNone(''); // false\n Ember.isNone([]); // false\n Ember.isNone(function() {}); // false\n ```\n\n @method isNone\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n*/\nEmber.isNone = function(obj) {\n return obj === null || obj === undefined;\n};\nEmber.none = Ember.deprecateFunc(\"Ember.none is deprecated. Please use Ember.isNone instead.\", Ember.isNone);\n\n/**\n Verifies that a value is `null` or an empty string, empty array,\n or empty function.\n\n Constrains the rules on `Ember.isNone` by returning false for empty\n string and empty arrays.\n\n ```javascript\n Ember.isEmpty(); // true\n Ember.isEmpty(null); // true\n Ember.isEmpty(undefined); // true\n Ember.isEmpty(''); // true\n Ember.isEmpty([]); // true\n Ember.isEmpty('Adam Hawkins'); // false\n Ember.isEmpty([0,1,2]); // false\n ```\n\n @method isEmpty\n @for Ember\n @param {Object} obj Value to test\n @return {Boolean}\n*/\nEmber.isEmpty = function(obj) {\n return Ember.isNone(obj) || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);\n};\nEmber.empty = Ember.deprecateFunc(\"Ember.empty is deprecated. Please use Ember.isEmpty instead.\", Ember.isEmpty) ;\n\n\n})();\n//@ sourceURL=ember-metal/core");minispade.register('ember-metal/enumerable_utils', "(function() {var map, forEach, indexOf, splice;\nminispade.require('ember-metal/array');\n\nmap = Array.prototype.map || Ember.ArrayPolyfills.map;\nforEach = Array.prototype.forEach || Ember.ArrayPolyfills.forEach;\nindexOf = Array.prototype.indexOf || Ember.ArrayPolyfills.indexOf;\nsplice = Array.prototype.splice;\n\nvar utils = Ember.EnumerableUtils = {\n map: function(obj, callback, thisArg) {\n return obj.map ? obj.map.call(obj, callback, thisArg) : map.call(obj, callback, thisArg);\n },\n\n forEach: function(obj, callback, thisArg) {\n return obj.forEach ? obj.forEach.call(obj, callback, thisArg) : forEach.call(obj, callback, thisArg);\n },\n\n indexOf: function(obj, element, index) {\n return obj.indexOf ? obj.indexOf.call(obj, element, index) : indexOf.call(obj, element, index);\n },\n\n indexesOf: function(obj, elements) {\n return elements === undefined ? [] : utils.map(elements, function(item) {\n return utils.indexOf(obj, item);\n });\n },\n\n addObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index === -1) { array.push(item); }\n },\n\n removeObject: function(array, item) {\n var index = utils.indexOf(array, item);\n if (index !== -1) { array.splice(index, 1); }\n },\n\n _replace: function(array, idx, amt, objects) {\n var args = [].concat(objects), chunk, ret = [],\n // https://code.google.com/p/chromium/issues/detail?id=56588\n size = 60000, start = idx, ends = amt, count;\n\n while (args.length) {\n count = ends > size ? size : ends;\n if (count <= 0) { count = 0; }\n\n chunk = args.splice(0, size);\n chunk = [start, count].concat(chunk);\n\n start += size;\n ends -= count;\n\n ret = ret.concat(splice.apply(array, chunk));\n }\n return ret;\n },\n\n replace: function(array, idx, amt, objects) {\n if (array.replace) {\n return array.replace(idx, amt, objects);\n } else {\n return utils._replace(array, idx, amt, objects);\n }\n },\n\n intersection: function(array1, array2) {\n var intersection = [];\n\n utils.forEach(array1, function(element) {\n if (utils.indexOf(array2, element) >= 0) {\n intersection.push(element);\n }\n });\n\n return intersection;\n }\n};\n\n})();\n//@ sourceURL=ember-metal/enumerable_utils");minispade.register('ember-metal/error', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\n\nvar errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];\n\n/**\n A subclass of the JavaScript Error object for use in Ember.\n\n @class Error\n @namespace Ember\n @extends Error\n @constructor\n*/\nEmber.Error = function() {\n var tmp = Error.apply(this, arguments);\n\n // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n for (var idx = 0; idx < errorProps.length; idx++) {\n this[errorProps[idx]] = tmp[errorProps[idx]];\n }\n};\n\nEmber.Error.prototype = Ember.create(Error.prototype);\n\n// ..........................................................\n// ERROR HANDLING\n//\n\n/**\n A function may be assigned to `Ember.onerror` to be called when Ember\n internals encounter an error. This is useful for specialized error handling\n and reporting code.\n\n ```javascript\n Ember.onerror = function(error) {\n Em.$.ajax('/report-error', 'POST', {\n stack: error.stack,\n otherInformation: 'whatever app state you want to provide'\n });\n };\n ```\n\n @event onerror\n @for Ember\n @param {Exception} error the error object\n*/\nEmber.onerror = null;\n\n/**\n @private\n\n Wrap code block in a try/catch if `Ember.onerror` is set.\n\n @method handleErrors\n @for Ember\n @param {Function} func\n @param [context]\n*/\nEmber.handleErrors = function(func, context) {\n // Unfortunately in some browsers we lose the backtrace if we rethrow the existing error,\n // so in the event that we don't have an `onerror` handler we don't wrap in a try/catch\n if ('function' === typeof Ember.onerror) {\n try {\n return func.call(context || this);\n } catch (error) {\n Ember.onerror(error);\n }\n } else {\n return func.call(context || this);\n }\n};\n\n})();\n//@ sourceURL=ember-metal/error");minispade.register('ember-metal/events', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\n\n/**\n@module ember-metal\n*/\n\nvar o_create = Ember.create,\n metaFor = Ember.meta,\n META_KEY = Ember.META_KEY,\n a_slice = [].slice,\n /* listener flags */\n ONCE = 1, SUSPENDED = 2;\n\n/*\n The event system uses a series of nested hashes to store listeners on an\n object. When a listener is registered, or when an event arrives, these\n hashes are consulted to determine which target and action pair to invoke.\n\n The hashes are stored in the object's meta hash, and look like this:\n\n // Object's meta hash\n {\n listeners: { // variable name: `listenerSet`\n \"foo:changed\": [ // variable name: `actions`\n target, method, flags\n ]\n }\n }\n\n*/\n\nfunction indexOf(array, target, method) {\n var index = -1;\n for (var i = 0, l = array.length; i < l; i += 3) {\n if (target === array[i] && method === array[i+1]) { index = i; break; }\n }\n return index;\n}\n\nfunction actionsFor(obj, eventName) {\n var meta = metaFor(obj, true),\n actions;\n\n if (!meta.listeners) { meta.listeners = {}; }\n\n if (!meta.hasOwnProperty('listeners')) {\n // setup inherited copy of the listeners object\n meta.listeners = o_create(meta.listeners);\n }\n\n actions = meta.listeners[eventName];\n\n // if there are actions, but the eventName doesn't exist in our listeners, then copy them from the prototype\n if (actions && !meta.listeners.hasOwnProperty(eventName)) {\n actions = meta.listeners[eventName] = meta.listeners[eventName].slice();\n } else if (!actions) {\n actions = meta.listeners[eventName] = [];\n }\n\n return actions;\n}\n\nfunction actionsUnion(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n var target = actions[i],\n method = actions[i+1],\n flags = actions[i+2],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex === -1) {\n otherActions.push(target, method, flags);\n }\n }\n}\n\nfunction actionsDiff(obj, eventName, otherActions) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName],\n diffActions = [];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n var target = actions[i],\n method = actions[i+1],\n flags = actions[i+2],\n actionIndex = indexOf(otherActions, target, method);\n\n if (actionIndex !== -1) { continue; }\n\n otherActions.push(target, method, flags);\n diffActions.push(target, method, flags);\n }\n\n return diffActions;\n}\n\n/**\n Add an event listener\n\n @method addListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Boolean} once A flag whether a function should only be called once\n*/\nfunction addListener(obj, eventName, target, method, once) {\n Ember.assert(\"You must pass at least an object and event name to Ember.addListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method),\n flags = 0;\n\n if (once) flags |= ONCE;\n\n if (actionIndex !== -1) { return; }\n\n actions.push(target, method, flags);\n\n if ('function' === typeof obj.didAddListener) {\n obj.didAddListener(eventName, target, method);\n }\n}\n\n/**\n Remove an event listener\n\n Arguments should match those passed to `Ember.addListener`.\n\n @method removeListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n*/\nfunction removeListener(obj, eventName, target, method) {\n Ember.assert(\"You must pass at least an object and event name to Ember.removeListener\", !!obj && !!eventName);\n\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n function _removeListener(target, method) {\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n // action doesn't exist, give up silently\n if (actionIndex === -1) { return; }\n\n actions.splice(actionIndex, 3);\n\n if ('function' === typeof obj.didRemoveListener) {\n obj.didRemoveListener(eventName, target, method);\n }\n }\n\n if (method) {\n _removeListener(target, method);\n } else {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return; }\n for (var i = actions.length - 3; i >= 0; i -= 3) {\n _removeListener(actions[i], actions[i+1]);\n }\n }\n}\n\n/**\n @private\n\n Suspend listener during callback.\n\n This should only be used by the target of the event listener\n when it is taking an action that would cause the event, e.g.\n an object might suspend its property change listener while it is\n setting that property.\n\n @method suspendListener\n @for Ember\n @param obj\n @param {String} eventName\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n*/\nfunction suspendListener(obj, eventName, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var actions = actionsFor(obj, eventName),\n actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n actions[actionIndex+2] |= SUSPENDED; // mark the action as suspended\n }\n\n function tryable() { return callback.call(target); }\n function finalizer() { if (actionIndex !== -1) { actions[actionIndex+2] &= ~SUSPENDED; } }\n\n return Ember.tryFinally(tryable, finalizer);\n}\n\n/**\n @private\n\n Suspends multiple listeners during a callback.\n\n \n @method suspendListeners\n @for Ember\n @param obj\n @param {Array} eventName Array of event names\n @param {Object|Function} targetOrMethod A target object or a function\n @param {Function|String} method A function or the name of a function to be called on `target`\n @param {Function} callback\n*/\nfunction suspendListeners(obj, eventNames, target, method, callback) {\n if (!method && 'function' === typeof target) {\n method = target;\n target = null;\n }\n\n var suspendedActions = [],\n actionsList = [],\n eventName, actions, i, l;\n\n for (i=0, l=eventNames.length; i<l; i++) {\n eventName = eventNames[i];\n actions = actionsFor(obj, eventName);\n var actionIndex = indexOf(actions, target, method);\n\n if (actionIndex !== -1) {\n actions[actionIndex+2] |= SUSPENDED;\n suspendedActions.push(actionIndex);\n actionsList.push(actions);\n }\n }\n\n function tryable() { return callback.call(target); }\n\n function finalizer() {\n for (var i = 0, l = suspendedActions.length; i < l; i++) {\n var actionIndex = suspendedActions[i];\n actionsList[i][actionIndex+2] &= ~SUSPENDED;\n }\n }\n\n return Ember.tryFinally(tryable, finalizer);\n}\n\n/**\n @private\n\n Return a list of currently watched events\n\n @method watchedEvents\n @for Ember\n @param obj\n*/\nfunction watchedEvents(obj) {\n var listeners = obj[META_KEY].listeners, ret = [];\n\n if (listeners) {\n for(var eventName in listeners) {\n if (listeners[eventName]) { ret.push(eventName); }\n }\n }\n return ret;\n}\n\n/**\n Send an event. The execution of suspended listeners\n is skipped, and once listeners are removed. A listener without\n a target is executed on the passed object. If an array of actions\n is not passed, the actions stored on the passed object are invoked.\n \n @method sendEvent\n @for Ember\n @param obj\n @param {String} eventName\n @param {Array} params Optional parameters for each listener.\n @param {Array} actions Optional array of actions (listeners).\n @return true\n*/\nfunction sendEvent(obj, eventName, params, actions) {\n // first give object a chance to handle it\n if (obj !== Ember && 'function' === typeof obj.sendEvent) {\n obj.sendEvent(eventName, params);\n }\n\n if (!actions) {\n var meta = obj[META_KEY];\n actions = meta && meta.listeners && meta.listeners[eventName];\n }\n\n if (!actions) { return; }\n\n for (var i = actions.length - 3; i >= 0; i -= 3) { // looping in reverse for once listeners\n var target = actions[i], method = actions[i+1], flags = actions[i+2];\n if (!method) { continue; }\n if (flags & SUSPENDED) { continue; }\n if (flags & ONCE) { removeListener(obj, eventName, target, method); }\n if (!target) { target = obj; }\n if ('string' === typeof method) { method = target[method]; }\n if (params) {\n method.apply(target, params);\n } else {\n method.call(target);\n }\n }\n return true;\n}\n\n/**\n @private\n @method hasListeners\n @for Ember\n @param obj\n @param {String} eventName\n*/\nfunction hasListeners(obj, eventName) {\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n return !!(actions && actions.length);\n}\n\n/**\n @private\n @method listenersFor\n @for Ember\n @param obj\n @param {String} eventName\n*/\nfunction listenersFor(obj, eventName) {\n var ret = [];\n var meta = obj[META_KEY],\n actions = meta && meta.listeners && meta.listeners[eventName];\n\n if (!actions) { return ret; }\n\n for (var i = 0, l = actions.length; i < l; i += 3) {\n var target = actions[i],\n method = actions[i+1];\n ret.push([target, method]);\n }\n\n return ret;\n}\n\n/**\n Define a property as a function that should be executed when\n a specified event or events are triggered.\n\n var Job = Ember.Object.extend({\n logCompleted: Ember.on('completed', function(){\n console.log('Job completed!');\n })\n });\n var job = Job.create();\n Ember.sendEvent(job, 'completed'); // Logs \"Job completed!\"\n\n @method on\n @for Ember\n @param {String} eventNames*\n @param {Function} func\n @return func\n*/\nEmber.on = function(){\n var func = a_slice.call(arguments, -1)[0],\n events = a_slice.call(arguments, 0, -1);\n func.__ember_listens__ = events;\n return func;\n};\n\nEmber.addListener = addListener;\nEmber.removeListener = removeListener;\nEmber._suspendListener = suspendListener;\nEmber._suspendListeners = suspendListeners;\nEmber.sendEvent = sendEvent;\nEmber.hasListeners = hasListeners;\nEmber.watchedEvents = watchedEvents;\nEmber.listenersFor = listenersFor;\nEmber.listenersDiff = actionsDiff;\nEmber.listenersUnion = actionsUnion;\n\n})();\n//@ sourceURL=ember-metal/events");minispade.register('ember-metal/expand_properties', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/utils');\n\n\n/**\n @module ember-metal\n*/\n\nif (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n var forEach = Ember.EnumerableUtils.forEach,\n IS_BRACE_EXPANSION = /^\\{([^.]*)\\}$/;\n\n /**\n Expands `pattern`, invoking `callback` for each expansion.\n\n The only pattern supported is brace-expansion, anything else will be passed\n once to `callback` directly. Furthermore, brace-expansion is only applied to\n the entire pattern, not to substrings.\n\n Example\n ```js\n function echo(arg){ console.log(arg); }\n\n Ember.expandProperties('foo.bar', echo); //=> 'foo.bar'\n Ember.expandProperties('{foo,bar}', echo); //=> 'foo', 'bar'\n Ember.expandProperties('foo.{bar,baz}', echo); //=> 'foo.{bar,baz}'\n ```\n\n @method\n @private\n @param {string} pattern The property pattern to expand.\n @param {function} callback The callback to invoke. It is invoked once per\n expansion, and is passed the expansion.\n */\n Ember.expandProperties = function (pattern, callback) {\n if (IS_BRACE_EXPANSION.test(pattern)) {\n forEach(pattern.substring(1, pattern.length-1).split(','), callback);\n return;\n }\n\n callback(pattern);\n };\n}\n\n})();\n//@ sourceURL=ember-metal/expand_properties");minispade.register('ember-metal/get_properties', "(function() {minispade.require('ember-metal/property_get');\nminispade.require('ember-metal/utils');\n\nvar get = Ember.get;\n\n/**\n To get multiple properties at once, call `Ember.getProperties`\n with an object followed by a list of strings or an array:\n\n ```javascript\n Ember.getProperties(record, 'firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n Ember.getProperties(record, ['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param obj\n @param {String...|Array} list of keys to get\n @return {Hash}\n*/\nEmber.getProperties = function(obj) {\n var ret = {},\n propertyNames = arguments,\n i = 1;\n\n if (arguments.length === 2 && Ember.typeOf(arguments[1]) === 'array') {\n i = 0;\n propertyNames = arguments[1];\n }\n for(var len = propertyNames.length; i < len; i++) {\n ret[propertyNames[i]] = get(obj, propertyNames[i]);\n }\n return ret;\n};\n\n})();\n//@ sourceURL=ember-metal/get_properties");minispade.register('ember-metal/instrumentation', "(function() {minispade.require('ember-metal/utils'); // Ember.tryCatchFinally\n\n/**\n The purpose of the Ember Instrumentation module is\n to provide efficient, general-purpose instrumentation\n for Ember.\n\n Subscribe to a listener by using `Ember.subscribe`:\n\n ```javascript\n Ember.subscribe(\"render\", {\n before: function(name, timestamp, payload) {\n\n },\n\n after: function(name, timestamp, payload) {\n\n }\n });\n ```\n\n If you return a value from the `before` callback, that same\n value will be passed as a fourth parameter to the `after`\n callback.\n\n Instrument a block of code by using `Ember.instrument`:\n\n ```javascript\n Ember.instrument(\"render.handlebars\", payload, function() {\n // rendering logic\n }, binding);\n ```\n\n Event names passed to `Ember.instrument` are namespaced\n by periods, from more general to more specific. Subscribers\n can listen for events by whatever level of granularity they\n are interested in.\n\n In the above example, the event is `render.handlebars`,\n and the subscriber listened for all events beginning with\n `render`. It would receive callbacks for events named\n `render`, `render.handlebars`, `render.container`, or\n even `render.handlebars.layout`.\n\n @class Instrumentation\n @namespace Ember\n @static\n*/\nEmber.Instrumentation = {};\n\nvar subscribers = [], cache = {};\n\nvar populateListeners = function(name) {\n var listeners = [], subscriber;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n subscriber = subscribers[i];\n if (subscriber.regex.test(name)) {\n listeners.push(subscriber.object);\n }\n }\n\n cache[name] = listeners;\n return listeners;\n};\n\nvar time = (function() {\n var perf = 'undefined' !== typeof window ? window.performance || {} : {};\n var fn = perf.now || perf.mozNow || perf.webkitNow || perf.msNow || perf.oNow;\n // fn.bind will be available in all the browsers that support the advanced window.performance... ;-)\n return fn ? fn.bind(perf) : function() { return +new Date(); };\n})();\n\n/**\n Notifies event's subscribers, calls `before` and `after` hooks.\n\n @method instrument\n @namespace Ember.Instrumentation\n\n @param {String} [name] Namespaced event name.\n @param {Object} payload\n @param {Function} callback Function that you're instrumenting.\n @param {Object} binding Context that instrument function is called with.\n*/\nEmber.Instrumentation.instrument = function(name, payload, callback, binding) {\n var listeners = cache[name], timeName, ret;\n\n if (Ember.STRUCTURED_PROFILE) {\n timeName = name + \": \" + payload.object;\n console.time(timeName);\n }\n\n if (!listeners) {\n listeners = populateListeners(name);\n }\n\n if (listeners.length === 0) {\n ret = callback.call(binding);\n if (Ember.STRUCTURED_PROFILE) { console.timeEnd(timeName); }\n return ret;\n }\n\n var beforeValues = [], listener, i, l;\n\n function tryable() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n }\n\n function catchable(e) {\n payload = payload || {};\n payload.exception = e;\n }\n\n function finalizer() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n\n if (Ember.STRUCTURED_PROFILE) {\n console.timeEnd(timeName);\n }\n }\n\n return Ember.tryCatchFinally(tryable, catchable, finalizer);\n};\n\n/**\n Subscribes to a particular event or instrumented block of code.\n\n @method subscribe\n @namespace Ember.Instrumentation\n\n @param {String} [pattern] Namespaced event name.\n @param {Object} [object] Before and After hooks.\n*/\nEmber.Instrumentation.subscribe = function(pattern, object) {\n var paths = pattern.split(\".\"), path, regex = [];\n\n for (var i=0, l=paths.length; i<l; i++) {\n path = paths[i];\n if (path === \"*\") {\n regex.push(\"[^\\\\.]*\");\n } else {\n regex.push(path);\n }\n }\n\n regex = regex.join(\"\\\\.\");\n regex = regex + \"(\\\\..*)?\";\n\n var subscriber = {\n pattern: pattern,\n regex: new RegExp(\"^\" + regex + \"$\"),\n object: object\n };\n\n subscribers.push(subscriber);\n cache = {};\n\n return subscriber;\n};\n\n/**\n Unsubscribes from a particular event or instrumented block of code.\n\n @method unsubscribe\n @namespace Ember.Instrumentation\n\n @param {Object} [subscriber]\n*/\nEmber.Instrumentation.unsubscribe = function(subscriber) {\n var index;\n\n for (var i=0, l=subscribers.length; i<l; i++) {\n if (subscribers[i] === subscriber) {\n index = i;\n }\n }\n\n subscribers.splice(index, 1);\n cache = {};\n};\n\n/**\n Resets `Ember.Instrumentation` by flushing list of subscribers.\n\n @method reset\n @namespace Ember.Instrumentation\n*/\nEmber.Instrumentation.reset = function() {\n subscribers = [];\n cache = {};\n};\n\nEmber.instrument = Ember.Instrumentation.instrument;\nEmber.subscribe = Ember.Instrumentation.subscribe;\n})();\n//@ sourceURL=ember-metal/instrumentation");minispade.register('ember-metal/libraries', "(function() {// Provides a way to register library versions with ember.\nvar forEach = Ember.EnumerableUtils.forEach,\n indexOf = Ember.EnumerableUtils.indexOf;\n\nEmber.libraries = function() {\n var libraries = [];\n var coreLibIndex = 0;\n\n var getLibrary = function(name) {\n for (var i = 0; i < libraries.length; i++) {\n if (libraries[i].name === name) {\n return libraries[i];\n }\n }\n };\n\n libraries.register = function(name, version) {\n if (!getLibrary(name)) {\n libraries.push({name: name, version: version});\n }\n };\n\n libraries.registerCoreLibrary = function(name, version) {\n if (!getLibrary(name)) {\n libraries.splice(coreLibIndex++, 0, {name: name, version: version});\n }\n };\n\n libraries.deRegister = function(name) {\n var lib = getLibrary(name);\n if (lib) libraries.splice(indexOf(libraries, lib), 1);\n };\n\n libraries.each = function (callback) {\n forEach(libraries, function(lib) {\n callback(lib.name, lib.version);\n });\n };\n\n return libraries;\n}();\n\nEmber.libraries.registerCoreLibrary('Ember', Ember.VERSION);\n\n})();\n//@ sourceURL=ember-metal/libraries");minispade.register('ember-metal/logger', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/error');\n\nfunction consoleMethod(name) {\n var consoleObj;\n if (Ember.imports.console) {\n consoleObj = Ember.imports.console;\n } else if (typeof console !== 'undefined') {\n consoleObj = console;\n }\n\n var method = typeof consoleObj === 'object' ? consoleObj[name] : null;\n\n if (method) {\n // Older IE doesn't support apply, but Chrome needs it\n if (method.apply) {\n return function() {\n method.apply(consoleObj, arguments);\n };\n } else {\n return function() {\n var message = Array.prototype.join.call(arguments, ', ');\n method(message);\n };\n }\n }\n}\n\nfunction assertPolyfill(test, message) {\n if (!test) {\n try {\n // attempt to preserve the stack\n throw new Ember.Error(\"assertion failed: \" + message);\n } catch(error) {\n setTimeout(function() {\n throw error;\n }, 0);\n }\n }\n}\n\n/**\n Inside Ember-Metal, simply uses the methods from `imports.console`.\n Override this to provide more robust logging functionality.\n\n @class Logger\n @namespace Ember\n*/\nEmber.Logger = {\n /**\n Logs the arguments to the console.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n var foo = 1;\n Ember.Logger.log('log value of foo:', foo); // \"log value of foo: 1\" will be printed to the console\n ```\n\n @method log\n @for Ember.Logger\n @param {*} arguments\n */\n log: consoleMethod('log') || Ember.K,\n /**\n Prints the arguments to the console with a warning icon.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n Ember.Logger.warn('Something happened!'); // \"Something happened!\" will be printed to the console with a warning icon.\n ```\n\n @method warn\n @for Ember.Logger\n @param {*} arguments\n */\n warn: consoleMethod('warn') || Ember.K,\n /**\n Prints the arguments to the console with an error icon, red text and a stack race.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n Ember.Logger.error('Danger! Danger!'); // \"Danger! Danger!\" will be printed to the console in red text.\n ```\n\n @method error\n @for Ember.Logger\n @param {*} arguments\n */\n error: consoleMethod('error') || Ember.K,\n /**\n Logs the arguments to the console.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n var foo = 1;\n Ember.Logger.info('log value of foo:', foo); // \"log value of foo: 1\" will be printed to the console\n ```\n\n @method info\n @for Ember.Logger\n @param {*} arguments\n */\n info: consoleMethod('info') || Ember.K,\n /**\n Logs the arguments to the console in blue text.\n You can pass as many arguments as you want and they will be joined together with a space.\n\n ```javascript\n var foo = 1;\n Ember.Logger.debug('log value of foo:', foo); // \"log value of foo: 1\" will be printed to the console\n ```\n\n @method debug\n @for Ember.Logger\n @param {*} arguments\n */\n debug: consoleMethod('debug') || consoleMethod('info') || Ember.K,\n /**\n\n If the value passed into Ember.Logger.assert is not truthy it will throw an error with a stack trace.\n\n ```javascript\n Ember.Logger.assert(true); // undefined\n Ember.Logger.assert(true === false); // Throws an Assertion failed error.\n ```\n\n @method assert\n @for Ember.Logger\n @param {Boolean} bool Value to test\n */\n assert: consoleMethod('assert') || assertPolyfill\n};\n\n\n})();\n//@ sourceURL=ember-metal/logger");minispade.register('ember-metal', "(function() {/**\nEmber Metal\n\n@module ember\n@submodule ember-metal\n*/\nminispade.require('ember-metal/core');\nminispade.require('ember-metal/instrumentation');\nminispade.require('ember-metal/map');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/error');\nminispade.require('ember-metal/logger');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/property_set');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/property_events');\nminispade.require('ember-metal/get_properties');\nminispade.require('ember-metal/set_properties');\nminispade.require('ember-metal/chains');\nminispade.require('ember-metal/computed');\nminispade.require('ember-metal/watching');\nminispade.require('ember-metal/watch_key');\nminispade.require('ember-metal/watch_path');\nminispade.require('ember-metal/events');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/mixin');\nminispade.require('ember-metal/binding');\nminispade.require('ember-metal/run_loop');\nminispade.require('ember-metal/libraries');\n\n})();\n//@ sourceURL=ember-metal");minispade.register('ember-metal/map', "(function() {/**\n@module ember-metal\n*/\n\n/*\n JavaScript (before ES6) does not have a Map implementation. Objects,\n which are often used as dictionaries, may only have Strings as keys.\n\n Because Ember has a way to get a unique identifier for every object\n via `Ember.guidFor`, we can implement a performant Map with arbitrary\n keys. Because it is commonly used in low-level bookkeeping, Map is\n implemented as a pure JavaScript object for performance.\n\n This implementation follows the current iteration of the ES6 proposal for\n maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),\n with two exceptions. First, because we need our implementation to be pleasant\n on older browsers, we do not use the `delete` name (using `remove` instead).\n Second, as we do not have the luxury of in-VM iteration, we implement a\n forEach method for iteration.\n\n Map is mocked out to look like an Ember object, so you can do\n `Ember.Map.create()` for symmetry with other Ember classes.\n*/\nminispade.require('ember-metal/enumerable_utils');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/core');\nminispade.require('ember-metal/property_set');\n\nvar set = Ember.set,\n guidFor = Ember.guidFor,\n indexOf = Ember.ArrayPolyfills.indexOf;\n\nvar copy = function(obj) {\n var output = {};\n\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) { output[prop] = obj[prop]; }\n }\n\n return output;\n};\n\nvar copyMap = function(original, newObject) {\n var keys = original.keys.copy(),\n values = copy(original.values);\n\n newObject.keys = keys;\n newObject.values = values;\n newObject.length = original.length;\n\n return newObject;\n};\n\n/**\n This class is used internally by Ember and Ember Data.\n Please do not use it at this time. We plan to clean it up\n and add many tests soon.\n\n @class OrderedSet\n @namespace Ember\n @constructor\n @private\n*/\nvar OrderedSet = Ember.OrderedSet = function() {\n this.clear();\n};\n\n/**\n @method create\n @static\n @return {Ember.OrderedSet}\n*/\nOrderedSet.create = function() {\n return new OrderedSet();\n};\n\n\nOrderedSet.prototype = {\n /**\n @method clear\n */\n clear: function() {\n this.presenceSet = {};\n this.list = [];\n },\n\n /**\n @method add\n @param obj\n */\n add: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n if (guid in presenceSet) { return; }\n\n presenceSet[guid] = true;\n list.push(obj);\n },\n\n /**\n @method remove\n @param obj\n */\n remove: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet,\n list = this.list;\n\n delete presenceSet[guid];\n\n var index = indexOf.call(list, obj);\n if (index > -1) {\n list.splice(index, 1);\n }\n },\n\n /**\n @method isEmpty\n @return {Boolean}\n */\n isEmpty: function() {\n return this.list.length === 0;\n },\n\n /**\n @method has\n @param obj\n @return {Boolean}\n */\n has: function(obj) {\n var guid = guidFor(obj),\n presenceSet = this.presenceSet;\n\n return guid in presenceSet;\n },\n\n /**\n @method forEach\n @param {Function} fn\n @param self\n */\n forEach: function(fn, self) {\n // allow mutation during iteration\n var list = this.toArray();\n\n for (var i = 0, j = list.length; i < j; i++) {\n fn.call(self, list[i]);\n }\n },\n\n /**\n @method toArray\n @return {Array}\n */\n toArray: function() {\n return this.list.slice();\n },\n\n /**\n @method copy\n @return {Ember.OrderedSet}\n */\n copy: function() {\n var set = new OrderedSet();\n\n set.presenceSet = copy(this.presenceSet);\n set.list = this.toArray();\n\n return set;\n }\n};\n\n/**\n A Map stores values indexed by keys. Unlike JavaScript's\n default Objects, the keys of a Map can be any JavaScript\n object.\n\n Internally, a Map has two data structures:\n\n 1. `keys`: an OrderedSet of all of the existing keys\n 2. `values`: a JavaScript Object indexed by the `Ember.guidFor(key)`\n\n When a key/value pair is added for the first time, we\n add the key to the `keys` OrderedSet, and create or\n replace an entry in `values`. When an entry is deleted,\n we delete its entry in `keys` and `values`.\n\n @class Map\n @namespace Ember\n @private\n @constructor\n*/\nvar Map = Ember.Map = function() {\n this.keys = Ember.OrderedSet.create();\n this.values = {};\n};\n\n/**\n @method create\n @static\n*/\nMap.create = function() {\n return new Map();\n};\n\nMap.prototype = {\n /**\n This property will change as the number of objects in the map changes.\n \n @property length\n @type number\n @default 0\n */\n length: 0,\n \n \n /**\n Retrieve the value associated with a given key.\n\n @method get\n @param {*} key\n @return {*} the value associated with the key, or `undefined`\n */\n get: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values[guid];\n },\n\n /**\n Adds a value to the map. If a value for the given key has already been\n provided, the new value will replace the old value.\n\n @method set\n @param {*} key\n @param {*} value\n */\n set: function(key, value) {\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n keys.add(key);\n values[guid] = value;\n set(this, 'length', keys.list.length);\n },\n\n /**\n Removes a value from the map for an associated key.\n\n @method remove\n @param {*} key\n @return {Boolean} true if an item was removed, false otherwise\n */\n remove: function(key) {\n // don't use ES6 \"delete\" because it will be annoying\n // to use in browsers that are not ES6 friendly;\n var keys = this.keys,\n values = this.values,\n guid = guidFor(key);\n\n if (values.hasOwnProperty(guid)) {\n keys.remove(key);\n delete values[guid];\n set(this, 'length', keys.list.length);\n return true;\n } else {\n return false;\n }\n },\n\n /**\n Check whether a key is present.\n\n @method has\n @param {*} key\n @return {Boolean} true if the item was present, false otherwise\n */\n has: function(key) {\n var values = this.values,\n guid = guidFor(key);\n\n return values.hasOwnProperty(guid);\n },\n\n /**\n Iterate over all the keys and values. Calls the function once\n for each key, passing in the key and value, in that order.\n\n The keys are guaranteed to be iterated over in insertion order.\n\n @method forEach\n @param {Function} callback\n @param {*} self if passed, the `this` value inside the\n callback. By default, `this` is the map.\n */\n forEach: function(callback, self) {\n var keys = this.keys,\n values = this.values;\n\n keys.forEach(function(key) {\n var guid = guidFor(key);\n callback.call(self, key, values[guid]);\n });\n },\n\n /**\n @method copy\n @return {Ember.Map}\n */\n copy: function() {\n return copyMap(this, new Map());\n }\n};\n\n/**\n @class MapWithDefault\n @namespace Ember\n @extends Ember.Map\n @private\n @constructor\n @param [options]\n @param {*} [options.defaultValue]\n*/\nvar MapWithDefault = Ember.MapWithDefault = function(options) {\n Map.call(this);\n this.defaultValue = options.defaultValue;\n};\n\n/**\n @method create\n @static\n @param [options]\n @param {*} [options.defaultValue]\n @return {Ember.MapWithDefault|Ember.Map} If options are passed, returns\n `Ember.MapWithDefault` otherwise returns `Ember.Map`\n*/\nMapWithDefault.create = function(options) {\n if (options) {\n return new MapWithDefault(options);\n } else {\n return new Map();\n }\n};\n\nMapWithDefault.prototype = Ember.create(Map.prototype);\n\n/**\n Retrieve the value associated with a given key.\n\n @method get\n @param {*} key\n @return {*} the value associated with the key, or the default value\n*/\nMapWithDefault.prototype.get = function(key) {\n var hasValue = this.has(key);\n\n if (hasValue) {\n return Map.prototype.get.call(this, key);\n } else {\n var defaultValue = this.defaultValue(key);\n this.set(key, defaultValue);\n return defaultValue;\n }\n};\n\n/**\n @method copy\n @return {Ember.MapWithDefault}\n*/\nMapWithDefault.prototype.copy = function() {\n return copyMap(this, new MapWithDefault({\n defaultValue: this.defaultValue\n }));\n};\n\n})();\n//@ sourceURL=ember-metal/map");minispade.register('ember-metal/mixin', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/computed');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/observer');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/binding');\n\n/**\n@module ember\n@submodule ember-metal\n*/\n\nvar Mixin, REQUIRED, Alias,\n a_map = Ember.ArrayPolyfills.map,\n a_indexOf = Ember.ArrayPolyfills.indexOf,\n a_forEach = Ember.ArrayPolyfills.forEach,\n a_slice = [].slice,\n o_create = Ember.create,\n defineProperty = Ember.defineProperty,\n guidFor = Ember.guidFor;\n\nfunction mixinsMeta(obj) {\n var m = Ember.meta(obj, true), ret = m.mixins;\n if (!ret) {\n ret = m.mixins = {};\n } else if (!m.hasOwnProperty('mixins')) {\n ret = m.mixins = o_create(ret);\n }\n return ret;\n}\n\nfunction initMixin(mixin, args) {\n if (args && args.length > 0) {\n mixin.mixins = a_map.call(args, function(x) {\n if (x instanceof Mixin) { return x; }\n\n // Note: Manually setup a primitive mixin here. This is the only\n // way to actually get a primitive mixin. This way normal creation\n // of mixins will give you combined mixins...\n var mixin = new Mixin();\n mixin.properties = x;\n return mixin;\n });\n }\n return mixin;\n}\n\nfunction isMethod(obj) {\n return 'function' === typeof obj &&\n obj.isMethod !== false &&\n obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;\n}\n\nvar CONTINUE = {};\n\nfunction mixinProperties(mixinsMeta, mixin) {\n var guid;\n\n if (mixin instanceof Mixin) {\n guid = guidFor(mixin);\n if (mixinsMeta[guid]) { return CONTINUE; }\n mixinsMeta[guid] = mixin;\n return mixin.properties;\n } else {\n return mixin; // apply anonymous mixin properties\n }\n}\n\nfunction concatenatedMixinProperties(concatProp, props, values, base) {\n var concats;\n\n // reset before adding each new mixin to pickup concats from previous\n concats = values[concatProp] || base[concatProp];\n if (props[concatProp]) {\n concats = concats ? concats.concat(props[concatProp]) : props[concatProp];\n }\n\n return concats;\n}\n\nfunction giveDescriptorSuper(meta, key, property, values, descs) {\n var superProperty;\n\n // Computed properties override methods, and do not call super to them\n if (values[key] === undefined) {\n // Find the original descriptor in a parent mixin\n superProperty = descs[key];\n }\n\n // If we didn't find the original descriptor in a parent mixin, find\n // it on the original object.\n superProperty = superProperty || meta.descs[key];\n\n if (!superProperty || !(superProperty instanceof Ember.ComputedProperty)) {\n return property;\n }\n\n // Since multiple mixins may inherit from the same parent, we need\n // to clone the computed property so that other mixins do not receive\n // the wrapped version.\n property = o_create(property);\n property.func = Ember.wrap(property.func, superProperty.func);\n\n return property;\n}\n\nfunction giveMethodSuper(obj, key, method, values, descs) {\n var superMethod;\n\n // Methods overwrite computed properties, and do not call super to them.\n if (descs[key] === undefined) {\n // Find the original method in a parent mixin\n superMethod = values[key];\n }\n\n // If we didn't find the original value in a parent mixin, find it in\n // the original object\n superMethod = superMethod || obj[key];\n\n // Only wrap the new method if the original method was a function\n if ('function' !== typeof superMethod) {\n return method;\n }\n\n return Ember.wrap(method, superMethod);\n}\n\nfunction applyConcatenatedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n return baseValue.concat(value);\n } else {\n return Ember.makeArray(baseValue).concat(value);\n }\n } else {\n return Ember.makeArray(value);\n }\n}\n\nfunction applyMergedProperties(obj, key, value, values) {\n var baseValue = values[key] || obj[key];\n\n if (!baseValue) { return value; }\n\n var newBase = Ember.merge({}, baseValue);\n for (var prop in value) {\n if (!value.hasOwnProperty(prop)) { continue; }\n\n var propValue = value[prop];\n if (isMethod(propValue)) {\n // TODO: support for Computed Properties, etc?\n newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {});\n } else {\n newBase[prop] = propValue;\n }\n }\n\n return newBase;\n}\n\nfunction addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) {\n if (value instanceof Ember.Descriptor) {\n if (value === REQUIRED && descs[key]) { return CONTINUE; }\n\n // Wrap descriptor function to implement\n // _super() if needed\n if (value.func) {\n value = giveDescriptorSuper(meta, key, value, values, descs);\n }\n\n descs[key] = value;\n values[key] = undefined;\n } else {\n if ((concats && a_indexOf.call(concats, key) >= 0) ||\n key === 'concatenatedProperties' ||\n key === 'mergedProperties') {\n value = applyConcatenatedProperties(base, key, value, values);\n } else if ((mergings && a_indexOf.call(mergings, key) >= 0)) {\n value = applyMergedProperties(base, key, value, values);\n } else if (isMethod(value)) {\n value = giveMethodSuper(base, key, value, values, descs);\n }\n\n descs[key] = undefined;\n values[key] = value;\n }\n}\n\nfunction mergeMixins(mixins, m, descs, values, base, keys) {\n var mixin, props, key, concats, mergings, meta;\n\n function removeKeys(keyName) {\n delete descs[keyName];\n delete values[keyName];\n }\n\n for(var i=0, l=mixins.length; i<l; i++) {\n mixin = mixins[i];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n props = mixinProperties(m, mixin);\n if (props === CONTINUE) { continue; }\n\n if (props) {\n meta = Ember.meta(base);\n if (base.willMergeMixin) { base.willMergeMixin(props); }\n concats = concatenatedMixinProperties('concatenatedProperties', props, values, base);\n mergings = concatenatedMixinProperties('mergedProperties', props, values, base);\n\n for (key in props) {\n if (!props.hasOwnProperty(key)) { continue; }\n keys.push(key);\n addNormalizedProperty(base, key, props[key], meta, descs, values, concats, mergings);\n }\n\n // manually copy toString() because some JS engines do not enumerate it\n if (props.hasOwnProperty('toString')) { base.toString = props.toString; }\n } else if (mixin.mixins) {\n mergeMixins(mixin.mixins, m, descs, values, base, keys);\n if (mixin._without) { a_forEach.call(mixin._without, removeKeys); }\n }\n }\n}\n\nvar IS_BINDING = Ember.IS_BINDING = /^.+Binding$/;\n\nfunction detectBinding(obj, key, value, m) {\n if (IS_BINDING.test(key)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[key] = value;\n }\n}\n\nfunction connectBindings(obj, m) {\n // TODO Mixin.apply(instance) should disconnect binding if exists\n var bindings = m.bindings, key, binding, to;\n if (bindings) {\n for (key in bindings) {\n binding = bindings[key];\n if (binding) {\n to = key.slice(0, -7); // strip Binding off end\n if (binding instanceof Ember.Binding) {\n binding = binding.copy(); // copy prototypes' instance\n binding.to(to);\n } else { // binding is string path\n binding = new Ember.Binding(to, binding);\n }\n binding.connect(obj);\n obj[key] = binding;\n }\n }\n // mark as applied\n m.bindings = {};\n }\n}\n\nfunction finishPartial(obj, m) {\n connectBindings(obj, m || Ember.meta(obj));\n return obj;\n}\n\nfunction followAlias(obj, desc, m, descs, values) {\n var altKey = desc.methodName, value;\n if (descs[altKey] || values[altKey]) {\n value = values[altKey];\n desc = descs[altKey];\n } else if (m.descs[altKey]) {\n desc = m.descs[altKey];\n value = undefined;\n } else {\n desc = undefined;\n value = obj[altKey];\n }\n\n return { desc: desc, value: value };\n}\n\nfunction updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) {\n var paths = observerOrListener[pathsKey];\n\n if (paths) {\n for (var i=0, l=paths.length; i<l; i++) {\n Ember[updateMethod](obj, paths[i], null, key);\n }\n }\n}\n\nfunction replaceObserversAndListeners(obj, key, observerOrListener) {\n var prev = obj[key];\n\n if ('function' === typeof prev) {\n updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', 'removeBeforeObserver');\n updateObserversAndListeners(obj, key, prev, '__ember_observes__', 'removeObserver');\n updateObserversAndListeners(obj, key, prev, '__ember_listens__', 'removeListener');\n }\n\n if ('function' === typeof observerOrListener) {\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', 'addBeforeObserver');\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', 'addObserver');\n updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', 'addListener');\n }\n}\n\nfunction applyMixin(obj, mixins, partial) {\n var descs = {}, values = {}, m = Ember.meta(obj),\n key, value, desc, keys = [];\n\n // Go through all mixins and hashes passed in, and:\n //\n // * Handle concatenated properties\n // * Handle merged properties\n // * Set up _super wrapping if necessary\n // * Set up computed property descriptors\n // * Copying `toString` in broken browsers\n mergeMixins(mixins, mixinsMeta(obj), descs, values, obj, keys);\n\n for(var i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n if (key === 'constructor' || !values.hasOwnProperty(key)) { continue; }\n\n desc = descs[key];\n value = values[key];\n\n if (desc === REQUIRED) { continue; }\n\n while (desc && desc instanceof Alias) {\n var followed = followAlias(obj, desc, m, descs, values);\n desc = followed.desc;\n value = followed.value;\n }\n\n if (desc === undefined && value === undefined) { continue; }\n\n replaceObserversAndListeners(obj, key, value);\n detectBinding(obj, key, value, m);\n defineProperty(obj, key, desc, value, m);\n }\n\n if (!partial) { // don't apply to prototype\n finishPartial(obj, m);\n }\n\n return obj;\n}\n\n/**\n @method mixin\n @for Ember\n @param obj\n @param mixins*\n @return obj\n*/\nEmber.mixin = function(obj) {\n var args = a_slice.call(arguments, 1);\n applyMixin(obj, args, false);\n return obj;\n};\n\n/**\n The `Ember.Mixin` class allows you to create mixins, whose properties can be\n added to other classes. For instance,\n\n ```javascript\n App.Editable = Ember.Mixin.create({\n edit: function() {\n console.log('starting to edit');\n this.set('isEditing', true);\n },\n isEditing: false\n });\n\n // Mix mixins into classes by passing them as the first arguments to\n // .extend.\n App.CommentView = Ember.View.extend(App.Editable, {\n template: Ember.Handlebars.compile('{{#if view.isEditing}}...{{else}}...{{/if}}')\n });\n\n commentView = App.CommentView.create();\n commentView.edit(); // outputs 'starting to edit'\n ```\n\n Note that Mixins are created with `Ember.Mixin.create`, not\n `Ember.Mixin.extend`.\n\n Note that mixins extend a constructor's prototype so arrays and object literals\n defined as properties will be shared amongst objects that implement the mixin.\n If you want to define an property in a mixin that is not shared, you can define\n it either as a computed property or have it be created on initialization of the object.\n\n ```javascript\n //filters array will be shared amongst any object implementing mixin\n App.Filterable = Ember.Mixin.create({\n filters: Ember.A()\n });\n\n //filters will be a separate array for every object implementing the mixin\n App.Filterable = Ember.Mixin.create({\n filters: Ember.computed(function(){return Ember.A();})\n });\n\n //filters will be created as a separate array during the object's initialization\n App.Filterable = Ember.Mixin.create({\n init: function() {\n this._super();\n this.set(\"filters\", Ember.A());\n }\n });\n ```\n\n @class Mixin\n @namespace Ember\n*/\nEmber.Mixin = function() { return initMixin(this, arguments); };\n\nMixin = Ember.Mixin;\n\nMixin.prototype = {\n properties: null,\n mixins: null,\n ownerConstructor: null\n};\n\nMixin._apply = applyMixin;\n\nMixin.applyPartial = function(obj) {\n var args = a_slice.call(arguments, 1);\n return applyMixin(obj, args, true);\n};\n\nMixin.finishPartial = finishPartial;\n\nEmber.anyUnprocessedMixins = false;\n\n/**\n @method create\n @static\n @param arguments*\n*/\nMixin.create = function() {\n Ember.anyUnprocessedMixins = true;\n var M = this;\n return initMixin(new M(), arguments);\n};\n\nvar MixinPrototype = Mixin.prototype;\n\n/**\n @method reopen\n @param arguments*\n*/\nMixinPrototype.reopen = function() {\n var mixin, tmp;\n\n if (this.properties) {\n mixin = Mixin.create();\n mixin.properties = this.properties;\n delete this.properties;\n this.mixins = [mixin];\n } else if (!this.mixins) {\n this.mixins = [];\n }\n\n var len = arguments.length, mixins = this.mixins, idx;\n\n for(idx=0; idx < len; idx++) {\n mixin = arguments[idx];\n Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');\n\n if (mixin instanceof Mixin) {\n mixins.push(mixin);\n } else {\n tmp = Mixin.create();\n tmp.properties = mixin;\n mixins.push(tmp);\n }\n }\n\n return this;\n};\n\n/**\n @method apply\n @param obj\n @return applied object\n*/\nMixinPrototype.apply = function(obj) {\n return applyMixin(obj, [this], false);\n};\n\nMixinPrototype.applyPartial = function(obj) {\n return applyMixin(obj, [this], true);\n};\n\nfunction _detect(curMixin, targetMixin, seen) {\n var guid = guidFor(curMixin);\n\n if (seen[guid]) { return false; }\n seen[guid] = true;\n\n if (curMixin === targetMixin) { return true; }\n var mixins = curMixin.mixins, loc = mixins ? mixins.length : 0;\n while (--loc >= 0) {\n if (_detect(mixins[loc], targetMixin, seen)) { return true; }\n }\n return false;\n}\n\n/**\n @method detect\n @param obj\n @return {Boolean}\n*/\nMixinPrototype.detect = function(obj) {\n if (!obj) { return false; }\n if (obj instanceof Mixin) { return _detect(obj, this, {}); }\n var mixins = Ember.meta(obj, false).mixins;\n if (mixins) {\n return !!mixins[guidFor(this)];\n }\n return false;\n};\n\nMixinPrototype.without = function() {\n var ret = new Mixin(this);\n ret._without = a_slice.call(arguments);\n return ret;\n};\n\nfunction _keys(ret, mixin, seen) {\n if (seen[guidFor(mixin)]) { return; }\n seen[guidFor(mixin)] = true;\n\n if (mixin.properties) {\n var props = mixin.properties;\n for (var key in props) {\n if (props.hasOwnProperty(key)) { ret[key] = true; }\n }\n } else if (mixin.mixins) {\n a_forEach.call(mixin.mixins, function(x) { _keys(ret, x, seen); });\n }\n}\n\nMixinPrototype.keys = function() {\n var keys = {}, seen = {}, ret = [];\n _keys(keys, this, seen);\n for(var key in keys) {\n if (keys.hasOwnProperty(key)) { ret.push(key); }\n }\n return ret;\n};\n\n// returns the mixins currently applied to the specified object\n// TODO: Make Ember.mixin\nMixin.mixins = function(obj) {\n var mixins = Ember.meta(obj, false).mixins, ret = [];\n\n if (!mixins) { return ret; }\n\n for (var key in mixins) {\n var mixin = mixins[key];\n\n // skip primitive mixins since these are always anonymous\n if (!mixin.properties) { ret.push(mixin); }\n }\n\n return ret;\n};\n\nREQUIRED = new Ember.Descriptor();\nREQUIRED.toString = function() { return '(Required Property)'; };\n\n/**\n Denotes a required property for a mixin\n\n @method required\n @for Ember\n*/\nEmber.required = function() {\n return REQUIRED;\n};\n\nAlias = function(methodName) {\n this.methodName = methodName;\n};\nAlias.prototype = new Ember.Descriptor();\n\n/**\n Makes a property or method available via an additional name.\n\n ```javascript\n App.PaintSample = Ember.Object.extend({\n color: 'red',\n colour: Ember.alias('color'),\n name: function() {\n return \"Zed\";\n },\n moniker: Ember.alias(\"name\")\n });\n\n var paintSample = App.PaintSample.create()\n paintSample.get('colour'); // 'red'\n paintSample.moniker(); // 'Zed'\n ```\n\n @method alias\n @for Ember\n @param {String} methodName name of the method or property to alias\n @return {Ember.Descriptor}\n @deprecated Use `Ember.aliasMethod` or `Ember.computed.alias` instead\n*/\nEmber.alias = function(methodName) {\n Ember.deprecate(\"Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead.\");\n return new Alias(methodName);\n};\n\n/**\n Makes a method available via an additional name.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name: function() {\n return 'Tomhuda Katzdale';\n },\n moniker: Ember.aliasMethod('name')\n });\n\n var goodGuy = App.Person.create()\n ```\n\n @method aliasMethod\n @for Ember\n @param {String} methodName name of the method to alias\n @return {Ember.Descriptor}\n*/\nEmber.aliasMethod = function(methodName) {\n return new Alias(methodName);\n};\n\n// ..........................................................\n// OBSERVER HELPER\n//\n\n/**\n Specify a method that observes property changes.\n\n ```javascript\n Ember.Object.extend({\n valueObserver: Ember.observer('value', function() {\n // Executes whenever the \"value\" property changes\n })\n });\n ```\n\n In the future this method may become asynchronous. If you want to ensure\n synchronous behavior, use `immediateObserver`.\n\n Also available as `Function.prototype.observes` if prototype extensions are\n enabled.\n\n @method observer\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n*/\nEmber.observer = function() {\n var func = a_slice.call(arguments, -1)[0];\n var paths = a_slice.call(arguments, 0, -1);\n\n if (typeof func !== \"function\") {\n // revert to old, soft-deprecated argument ordering\n\n func = arguments[0];\n paths = a_slice.call(arguments, 1);\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Ember.observer called without a function\");\n }\n\n func.__ember_observes__ = paths;\n return func;\n};\n\n/**\n Specify a method that observes property changes.\n\n ```javascript\n Ember.Object.extend({\n valueObserver: Ember.immediateObserver('value', function() {\n // Executes whenever the \"value\" property changes\n })\n });\n ```\n\n In the future, `Ember.observer` may become asynchronous. In this event,\n `Ember.immediateObserver` will maintain the synchronous behavior.\n\n Also available as `Function.prototype.observesImmediately` if prototype extensions are\n enabled.\n\n @method immediateObserver\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n*/\nEmber.immediateObserver = function() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", typeof arg !== \"string\" || arg.indexOf('.') === -1);\n }\n\n return Ember.observer.apply(this, arguments);\n};\n\n/**\n When observers fire, they are called with the arguments `obj`, `keyName`.\n\n Note, `@each.property` observer is called per each add or replace of an element\n and it's not called with a specific enumeration item.\n\n A `beforeObserver` fires before a property changes.\n\n A `beforeObserver` is an alternative form of `.observesBefore()`.\n\n ```javascript\n App.PersonView = Ember.View.extend({\n\n friends: [{ name: 'Tom' }, { name: 'Stefan' }, { name: 'Kris' }],\n\n valueWillChange: Ember.beforeObserver('content.value', function(obj, keyName) {\n this.changingFrom = obj.get(keyName);\n }),\n\n valueDidChange: Ember.observer('content.value', function(obj, keyName) {\n // only run if updating a value already in the DOM\n if (this.get('state') === 'inDOM') {\n var color = obj.get(keyName) > this.changingFrom ? 'green' : 'red';\n // logic\n }\n }),\n\n friendsDidChange: Ember.observer('friends.@each.name', function(obj, keyName) {\n // some logic\n // obj.get(keyName) returns friends array\n })\n });\n ```\n\n Also available as `Function.prototype.observesBefore` if prototype extensions are\n enabled.\n\n @method beforeObserver\n @for Ember\n @param {String} propertyNames*\n @param {Function} func\n @return func\n*/\nEmber.beforeObserver = function() {\n var func = a_slice.call(arguments, -1)[0];\n var paths = a_slice.call(arguments, 0, -1);\n\n if (typeof func !== \"function\") {\n // revert to old, soft-deprecated argument ordering\n\n func = arguments[0];\n paths = a_slice.call(arguments, 1);\n }\n\n if (typeof func !== \"function\") {\n throw new Ember.Error(\"Ember.beforeObserver called without a function\");\n }\n\n func.__ember_observesBefore__ = paths;\n return func;\n};\n\n})();\n//@ sourceURL=ember-metal/mixin");minispade.register('ember-metal/observer', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils'); // Ember.tryFinally\nminispade.require('ember-metal/expand_properties');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/array');\n\n/**\n@module ember-metal\n*/\n\nvar AFTER_OBSERVERS = ':change',\n BEFORE_OBSERVERS = ':before';\n\nif (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n var expandProperties = Ember.expandProperties;\n}\n\nfunction changeEvent(keyName) {\n return keyName+AFTER_OBSERVERS;\n}\n\nfunction beforeEvent(keyName) {\n return keyName+BEFORE_OBSERVERS;\n}\n\n/**\n @method addObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.addObserver = function(obj, _path, target, method) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_path, function (path) {\n Ember.addListener(obj, changeEvent(path), target, method);\n Ember.watch(obj, path);\n });\n } else {\n Ember.addListener(obj, changeEvent(_path), target, method);\n Ember.watch(obj, _path);\n }\n\n return this;\n};\n\nEmber.observersFor = function(obj, path) {\n return Ember.listenersFor(obj, changeEvent(path));\n};\n\n/**\n @method removeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.removeObserver = function(obj, _path, target, method) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_path, function (path) {\n Ember.unwatch(obj, path);\n Ember.removeListener(obj, changeEvent(path), target, method);\n });\n } else {\n Ember.unwatch(obj, _path);\n Ember.removeListener(obj, changeEvent(_path), target, method);\n }\n return this;\n};\n\n/**\n @method addBeforeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.addBeforeObserver = function(obj, _path, target, method) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_path, function (path) {\n Ember.addListener(obj, beforeEvent(path), target, method);\n Ember.watch(obj, path);\n });\n } else {\n Ember.addListener(obj, beforeEvent(_path), target, method);\n Ember.watch(obj, _path);\n }\n return this;\n};\n\n// Suspend observer during callback.\n//\n// This should only be used by the target of the observer\n// while it is setting the observed path.\nEmber._suspendBeforeObserver = function(obj, path, target, method, callback) {\n return Ember._suspendListener(obj, beforeEvent(path), target, method, callback);\n};\n\nEmber._suspendObserver = function(obj, path, target, method, callback) {\n return Ember._suspendListener(obj, changeEvent(path), target, method, callback);\n};\n\nvar map = Ember.ArrayPolyfills.map;\n\nEmber._suspendBeforeObservers = function(obj, paths, target, method, callback) {\n var events = map.call(paths, beforeEvent);\n return Ember._suspendListeners(obj, events, target, method, callback);\n};\n\nEmber._suspendObservers = function(obj, paths, target, method, callback) {\n var events = map.call(paths, changeEvent);\n return Ember._suspendListeners(obj, events, target, method, callback);\n};\n\nEmber.beforeObserversFor = function(obj, path) {\n return Ember.listenersFor(obj, beforeEvent(path));\n};\n\n/**\n @method removeBeforeObserver\n @param obj\n @param {String} path\n @param {Object|Function} targetOrMethod\n @param {Function|String} [method]\n*/\nEmber.removeBeforeObserver = function(obj, _path, target, method) {\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_path, function (path) {\n Ember.unwatch(obj, path);\n Ember.removeListener(obj, beforeEvent(path), target, method);\n });\n } else {\n Ember.unwatch(obj, _path);\n Ember.removeListener(obj, beforeEvent(_path), target, method);\n }\n return this;\n};\n\n})();\n//@ sourceURL=ember-metal/observer");minispade.register('ember-metal/observer_set', "(function() {var guidFor = Ember.guidFor,\n sendEvent = Ember.sendEvent;\n\n/*\n this.observerSet = {\n [senderGuid]: { // variable name: `keySet`\n [keyName]: listIndex\n }\n },\n this.observers = [\n {\n sender: obj,\n keyName: keyName,\n eventName: eventName,\n listeners: [\n [target, method, flags]\n ]\n },\n ...\n ]\n*/\nvar ObserverSet = Ember._ObserverSet = function() {\n this.clear();\n};\n\nObserverSet.prototype.add = function(sender, keyName, eventName) {\n var observerSet = this.observerSet,\n observers = this.observers,\n senderGuid = guidFor(sender),\n keySet = observerSet[senderGuid],\n index;\n\n if (!keySet) {\n observerSet[senderGuid] = keySet = {};\n }\n index = keySet[keyName];\n if (index === undefined) {\n index = observers.push({\n sender: sender,\n keyName: keyName,\n eventName: eventName,\n listeners: []\n }) - 1;\n keySet[keyName] = index;\n }\n return observers[index].listeners;\n};\n\nObserverSet.prototype.flush = function() {\n var observers = this.observers, i, len, observer, sender;\n this.clear();\n for (i=0, len=observers.length; i < len; ++i) {\n observer = observers[i];\n sender = observer.sender;\n if (sender.isDestroying || sender.isDestroyed) { continue; }\n sendEvent(sender, observer.eventName, [sender, observer.keyName], observer.listeners);\n }\n};\n\nObserverSet.prototype.clear = function() {\n this.observerSet = {};\n this.observers = [];\n};\n})();\n//@ sourceURL=ember-metal/observer_set");minispade.register('ember-metal/platform', "(function() {/*globals Node */\nminispade.require('ember-metal/core');\n\n/**\n@module ember-metal\n*/\n\n/**\n Platform specific methods and feature detectors needed by the framework.\n\n @class platform\n @namespace Ember\n @static\n*/\nvar platform = Ember.platform = {};\n\n\n/**\n Identical to `Object.create()`. Implements if not available natively.\n\n @method create\n @for Ember\n*/\nEmber.create = Object.create;\n\n// IE8 has Object.create but it couldn't treat property descriptors.\nif (Ember.create) {\n if (Ember.create({a: 1}, {a: {value: 2}}).a !== 2) {\n Ember.create = null;\n }\n}\n\n// STUB_OBJECT_CREATE allows us to override other libraries that stub\n// Object.create different than we would prefer\nif (!Ember.create || Ember.ENV.STUB_OBJECT_CREATE) {\n var K = function() {};\n\n Ember.create = function(obj, props) {\n K.prototype = obj;\n obj = new K();\n if (props) {\n K.prototype = obj;\n for (var prop in props) {\n K.prototype[prop] = props[prop].value;\n }\n obj = new K();\n }\n K.prototype = null;\n\n return obj;\n };\n\n Ember.create.isSimulated = true;\n}\n\nvar defineProperty = Object.defineProperty;\nvar canRedefineProperties, canDefinePropertyOnDOM;\n\n// Catch IE8 where Object.defineProperty exists but only works on DOM elements\nif (defineProperty) {\n try {\n defineProperty({}, 'a',{get:function() {}});\n } catch (e) {\n defineProperty = null;\n }\n}\n\nif (defineProperty) {\n // Detects a bug in Android <3.2 where you cannot redefine a property using\n // Object.defineProperty once accessors have already been set.\n canRedefineProperties = (function() {\n var obj = {};\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n get: function() { },\n set: function() { }\n });\n\n defineProperty(obj, 'a', {\n configurable: true,\n enumerable: true,\n writable: true,\n value: true\n });\n\n return obj.a === true;\n })();\n\n // This is for Safari 5.0, which supports Object.defineProperty, but not\n // on DOM nodes.\n canDefinePropertyOnDOM = (function() {\n try {\n defineProperty(document.createElement('div'), 'definePropertyOnDOM', {});\n return true;\n } catch(e) { }\n\n return false;\n })();\n\n if (!canRedefineProperties) {\n defineProperty = null;\n } else if (!canDefinePropertyOnDOM) {\n defineProperty = function(obj, keyName, desc) {\n var isNode;\n\n if (typeof Node === \"object\") {\n isNode = obj instanceof Node;\n } else {\n isNode = typeof obj === \"object\" && typeof obj.nodeType === \"number\" && typeof obj.nodeName === \"string\";\n }\n\n if (isNode) {\n // TODO: Should we have a warning here?\n return (obj[keyName] = desc.value);\n } else {\n return Object.defineProperty(obj, keyName, desc);\n }\n };\n }\n}\n\n/**\n@class platform\n@namespace Ember\n*/\n\n/**\n Identical to `Object.defineProperty()`. Implements as much functionality\n as possible if not available natively.\n\n @method defineProperty\n @param {Object} obj The object to modify\n @param {String} keyName property name to modify\n @param {Object} desc descriptor hash\n @return {void}\n*/\nplatform.defineProperty = defineProperty;\n\n/**\n Set to true if the platform supports native getters and setters.\n\n @property hasPropertyAccessors\n @final\n*/\nplatform.hasPropertyAccessors = true;\n\nif (!platform.defineProperty) {\n platform.hasPropertyAccessors = false;\n\n platform.defineProperty = function(obj, keyName, desc) {\n if (!desc.get) { obj[keyName] = desc.value; }\n };\n\n platform.defineProperty.isSimulated = true;\n}\n\nif (Ember.ENV.MANDATORY_SETTER && !platform.hasPropertyAccessors) {\n Ember.ENV.MANDATORY_SETTER = false;\n}\n\n})();\n//@ sourceURL=ember-metal/platform");minispade.register('ember-metal/properties', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/property_get');\n\n/**\n@module ember-metal\n*/\n\nvar META_KEY = Ember.META_KEY,\n metaFor = Ember.meta,\n objectDefineProperty = Ember.platform.defineProperty;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n// ..........................................................\n// DESCRIPTOR\n//\n\n/**\n Objects of this type can implement an interface to respond to requests to\n get and set. The default implementation handles simple properties.\n\n You generally won't need to create or subclass this directly.\n\n @class Descriptor\n @namespace Ember\n @private\n @constructor\n*/\nEmber.Descriptor = function() {};\n\n// ..........................................................\n// DEFINING PROPERTIES API\n//\n\nvar MANDATORY_SETTER_FUNCTION = Ember.MANDATORY_SETTER_FUNCTION = function(value) {\n Ember.assert(\"You must use Ember.set() to access this property (of \" + this + \")\", false);\n};\n\nvar DEFAULT_GETTER_FUNCTION = Ember.DEFAULT_GETTER_FUNCTION = function(name) {\n return function() {\n var meta = this[META_KEY];\n return meta && meta.values[name];\n };\n};\n\n/**\n @private\n\n NOTE: This is a low-level method used by other parts of the API. You almost\n never want to call this method directly. Instead you should use\n `Ember.mixin()` to define new properties.\n\n Defines a property on an object. This method works much like the ES5\n `Object.defineProperty()` method except that it can also accept computed\n properties and other special descriptors.\n\n Normally this method takes only three parameters. However if you pass an\n instance of `Ember.Descriptor` as the third param then you can pass an\n optional value as the fourth parameter. This is often more efficient than\n creating new descriptor hashes for each property.\n\n ## Examples\n\n ```javascript\n // ES5 compatible mode\n Ember.defineProperty(contact, 'firstName', {\n writable: true,\n configurable: false,\n enumerable: true,\n value: 'Charles'\n });\n\n // define a simple property\n Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');\n\n // define a computed property\n Ember.defineProperty(contact, 'fullName', Ember.computed(function() {\n return this.firstName+' '+this.lastName;\n }).property('firstName', 'lastName'));\n ```\n\n @method defineProperty\n @for Ember\n @param {Object} obj the object to define this property on. This may be a prototype.\n @param {String} keyName the name of the property\n @param {Ember.Descriptor} [desc] an instance of `Ember.Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.\n @param {*} [data] something other than a descriptor, that will\n become the explicit value of this property.\n*/\nEmber.defineProperty = function(obj, keyName, desc, data, meta) {\n var descs, existingDesc, watching, value;\n\n if (!meta) meta = metaFor(obj);\n descs = meta.descs;\n existingDesc = meta.descs[keyName];\n watching = meta.watching[keyName] > 0;\n\n if (existingDesc instanceof Ember.Descriptor) {\n existingDesc.teardown(obj, keyName);\n }\n\n if (desc instanceof Ember.Descriptor) {\n value = desc;\n\n descs[keyName] = desc;\n if (MANDATORY_SETTER && watching) {\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: undefined // make enumerable\n });\n } else {\n obj[keyName] = undefined; // make enumerable\n }\n } else {\n descs[keyName] = undefined; // shadow descriptor in proto\n if (desc == null) {\n value = data;\n\n if (MANDATORY_SETTER && watching) {\n meta.values[keyName] = data;\n objectDefineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: MANDATORY_SETTER_FUNCTION,\n get: DEFAULT_GETTER_FUNCTION(keyName)\n });\n } else {\n obj[keyName] = data;\n }\n } else {\n value = desc;\n\n // compatibility with ES5\n objectDefineProperty(obj, keyName, desc);\n }\n }\n\n // if key is being watched, override chains that\n // were initialized with the prototype\n if (watching) { Ember.overrideChains(obj, keyName, meta); }\n\n // The `value` passed to the `didDefineProperty` hook is\n // either the descriptor or data, whichever was passed.\n if (obj.didDefineProperty) { obj.didDefineProperty(obj, keyName, value); }\n\n return this;\n};\n\n\n})();\n//@ sourceURL=ember-metal/properties");minispade.register('ember-metal/property_events', "(function() {minispade.require('ember-metal/utils');\nminispade.require('ember-metal/events');\nminispade.require('ember-metal/observer_set');\n\nvar metaFor = Ember.meta,\n guidFor = Ember.guidFor,\n tryFinally = Ember.tryFinally,\n sendEvent = Ember.sendEvent,\n listenersUnion = Ember.listenersUnion,\n listenersDiff = Ember.listenersDiff,\n ObserverSet = Ember._ObserverSet,\n beforeObserverSet = new ObserverSet(),\n observerSet = new ObserverSet(),\n deferred = 0;\n\n// ..........................................................\n// PROPERTY CHANGES\n//\n\n/**\n This function is called just before an object property is about to change.\n It will notify any before observers and prepare caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyDidChange()` which you should call just\n after the property value changes.\n\n @method propertyWillChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n*/\nfunction propertyWillChange(obj, keyName) {\n var m = metaFor(obj, false),\n watching = m.watching[keyName] > 0 || keyName === 'length',\n proto = m.proto,\n desc = m.descs[keyName];\n\n if (!watching) { return; }\n if (proto === obj) { return; }\n if (desc && desc.willChange) { desc.willChange(obj, keyName); }\n dependentKeysWillChange(obj, keyName, m);\n chainsWillChange(obj, keyName, m);\n notifyBeforeObservers(obj, keyName);\n}\nEmber.propertyWillChange = propertyWillChange;\n\n/**\n This function is called just after an object property has changed.\n It will notify any observers and clear caches among other things.\n\n Normally you will not need to call this method directly but if for some\n reason you can't directly watch a property you can invoke this method\n manually along with `Ember.propertyWillChange()` which you should call just\n before the property value changes.\n\n @method propertyDidChange\n @for Ember\n @param {Object} obj The object with the property that will change\n @param {String} keyName The property key (or path) that will change.\n @return {void}\n*/\nfunction propertyDidChange(obj, keyName) {\n var m = metaFor(obj, false),\n watching = m.watching[keyName] > 0 || keyName === 'length',\n proto = m.proto,\n desc = m.descs[keyName];\n\n if (proto === obj) { return; }\n\n // shouldn't this mean that we're watching this key?\n if (desc && desc.didChange) { desc.didChange(obj, keyName); }\n if (!watching && keyName !== 'length') { return; }\n\n dependentKeysDidChange(obj, keyName, m);\n chainsDidChange(obj, keyName, m, false);\n notifyObservers(obj, keyName);\n}\nEmber.propertyDidChange = propertyDidChange;\n\nvar WILL_SEEN, DID_SEEN;\n\n// called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...)\nfunction dependentKeysWillChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = WILL_SEEN, top = !seen;\n if (top) { seen = WILL_SEEN = {}; }\n iterDeps(propertyWillChange, obj, depKey, seen, meta);\n if (top) { WILL_SEEN = null; }\n}\n\n// called whenever a property has just changed to update dependent keys\nfunction dependentKeysDidChange(obj, depKey, meta) {\n if (obj.isDestroying) { return; }\n\n var seen = DID_SEEN, top = !seen;\n if (top) { seen = DID_SEEN = {}; }\n iterDeps(propertyDidChange, obj, depKey, seen, meta);\n if (top) { DID_SEEN = null; }\n}\n\nfunction iterDeps(method, obj, depKey, seen, meta) {\n var guid = guidFor(obj);\n if (!seen[guid]) seen[guid] = {};\n if (seen[guid][depKey]) return;\n seen[guid][depKey] = true;\n\n var deps = meta.deps;\n deps = deps && deps[depKey];\n if (deps) {\n for(var key in deps) {\n var desc = meta.descs[key];\n if (desc && desc._suspended === obj) continue;\n method(obj, key);\n }\n }\n}\n\nfunction chainsWillChange(obj, keyName, m) {\n if (!(m.hasOwnProperty('chainWatchers') &&\n m.chainWatchers[keyName])) {\n return;\n }\n\n var nodes = m.chainWatchers[keyName],\n events = [],\n i, l;\n\n for(i = 0, l = nodes.length; i < l; i++) {\n nodes[i].willChange(events);\n }\n\n for (i = 0, l = events.length; i < l; i += 2) {\n propertyWillChange(events[i], events[i+1]);\n }\n}\n\nfunction chainsDidChange(obj, keyName, m, suppressEvents) {\n if (!(m.hasOwnProperty('chainWatchers') &&\n m.chainWatchers[keyName])) {\n return;\n }\n\n var nodes = m.chainWatchers[keyName],\n events = suppressEvents ? null : [],\n i, l;\n\n for(i = 0, l = nodes.length; i < l; i++) {\n nodes[i].didChange(events);\n }\n\n if (suppressEvents) {\n return;\n }\n\n for (i = 0, l = events.length; i < l; i += 2) {\n propertyDidChange(events[i], events[i+1]);\n }\n}\n\nEmber.overrideChains = function(obj, keyName, m) {\n chainsDidChange(obj, keyName, m, true);\n};\n\n/**\n @method beginPropertyChanges\n @chainable\n*/\nfunction beginPropertyChanges() {\n deferred++;\n}\n\nEmber.beginPropertyChanges = beginPropertyChanges;\n\n/**\n @method endPropertyChanges\n*/\nfunction endPropertyChanges() {\n deferred--;\n if (deferred<=0) {\n beforeObserverSet.clear();\n observerSet.flush();\n }\n}\n\nEmber.endPropertyChanges = endPropertyChanges;\n\n/**\n Make a series of property changes together in an\n exception-safe way.\n\n ```javascript\n Ember.changeProperties(function() {\n obj1.set('foo', mayBlowUpWhenSet);\n obj2.set('bar', baz);\n });\n ```\n\n @method changeProperties\n @param {Function} callback\n @param [binding]\n*/\nEmber.changeProperties = function(cb, binding) {\n beginPropertyChanges();\n tryFinally(cb, endPropertyChanges, binding);\n};\n\nfunction notifyBeforeObservers(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = keyName + ':before', listeners, diff;\n if (deferred) {\n listeners = beforeObserverSet.add(obj, keyName, eventName);\n diff = listenersDiff(obj, eventName, listeners);\n sendEvent(obj, eventName, [obj, keyName], diff);\n } else {\n sendEvent(obj, eventName, [obj, keyName]);\n }\n}\n\nfunction notifyObservers(obj, keyName) {\n if (obj.isDestroying) { return; }\n\n var eventName = keyName + ':change', listeners;\n if (deferred) {\n listeners = observerSet.add(obj, keyName, eventName);\n listenersUnion(obj, eventName, listeners);\n } else {\n sendEvent(obj, eventName, [obj, keyName]);\n }\n}\n\n})();\n//@ sourceURL=ember-metal/property_events");minispade.register('ember-metal/property_get', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\n\n/**\n@module ember-metal\n*/\n\nvar META_KEY = Ember.META_KEY, get;\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\nvar IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\\.\\*]/;\nvar HAS_THIS = /^this[\\.\\*]/;\nvar FIRST_KEY = /^([^\\.\\*]+)/;\n\n// ..........................................................\n// GET AND SET\n//\n// If we are on a platform that supports accessors we can use those.\n// Otherwise simulate accessors by looking up the property directly on the\n// object.\n\n/**\n Gets the value of a property on an object. If the property is computed,\n the function will be invoked. If the property is not defined but the\n object implements the `unknownProperty` method then that will be invoked.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to retrieve a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to retrieve\n properties if the property might not be defined on the object and you want\n to respect the `unknownProperty` handler. Otherwise you can ignore this\n method.\n\n Note that if the object itself is `undefined`, this method will throw\n an error.\n\n @method get\n @for Ember\n @param {Object} obj The object to retrieve from.\n @param {String} keyName The property key to retrieve\n @return {Object} the property value or `null`.\n*/\nget = function get(obj, keyName) {\n // Helpers that operate with 'this' within an #each\n if (keyName === '') {\n return obj;\n }\n\n if (!keyName && 'string'===typeof obj) {\n keyName = obj;\n obj = null;\n }\n\n Ember.assert(\"Cannot call get with \"+ keyName +\" key.\", !!keyName);\n Ember.assert(\"Cannot call get with '\"+ keyName +\"' on an undefined object.\", obj !== undefined);\n\n if (obj === null || keyName.indexOf('.') !== -1) {\n return getPath(obj, keyName);\n }\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;\n if (desc) {\n return desc.get(obj, keyName);\n } else {\n if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {\n ret = meta.values[keyName];\n } else {\n ret = obj[keyName];\n }\n\n if (ret === undefined &&\n 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {\n return obj.unknownProperty(keyName);\n }\n\n return ret;\n }\n};\n\n// Currently used only by Ember Data tests\nif (Ember.config.overrideAccessors) {\n Ember.get = get;\n Ember.config.overrideAccessors();\n get = Ember.get;\n}\n\n/**\n @private\n\n Normalizes a target/path pair to reflect that actual target/path that should\n be observed, etc. This takes into account passing in global property\n paths (i.e. a path beginning with a captial letter not defined on the\n target) and * separators.\n\n @method normalizeTuple\n @for Ember\n @param {Object} target The current target. May be `null`.\n @param {String} path A path on the target or a global property path.\n @return {Array} a temporary array with the normalized target/path pair.\n*/\nvar normalizeTuple = Ember.normalizeTuple = function(target, path) {\n var hasThis = HAS_THIS.test(path),\n isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),\n key;\n\n if (!target || isGlobal) target = Ember.lookup;\n if (hasThis) path = path.slice(5);\n\n if (target === Ember.lookup) {\n key = path.match(FIRST_KEY)[0];\n target = get(target, key);\n path = path.slice(key.length+1);\n }\n\n // must return some kind of path to be valid else other things will break.\n if (!path || path.length===0) throw new Ember.Error('Invalid Path');\n\n return [ target, path ];\n};\n\nvar getPath = Ember._getPath = function(root, path) {\n var hasThis, parts, tuple, idx, len;\n\n // If there is no root and path is a key name, return that\n // property from the global object.\n // E.g. get('Ember') -> Ember\n if (root === null && path.indexOf('.') === -1) { return get(Ember.lookup, path); }\n\n // detect complicated paths and normalize them\n hasThis = HAS_THIS.test(path);\n\n if (!root || hasThis) {\n tuple = normalizeTuple(root, path);\n root = tuple[0];\n path = tuple[1];\n tuple.length = 0;\n }\n\n parts = path.split(\".\");\n len = parts.length;\n for (idx = 0; root != null && idx < len; idx++) {\n root = get(root, parts[idx], true);\n if (root && root.isDestroyed) { return undefined; }\n }\n return root;\n};\n\nEmber.getWithDefault = function(root, key, defaultValue) {\n var value = get(root, key);\n\n if (value === undefined) { return defaultValue; }\n return value;\n};\n\n\nEmber.get = get;\n\n})();\n//@ sourceURL=ember-metal/property_get");minispade.register('ember-metal/property_set', "(function() {minispade.require('ember-metal/utils'); // META_KEY\nminispade.require('ember-metal/property_get'); // _getPath\nminispade.require('ember-metal/property_events'); // propertyWillChange, propertyDidChange\n\nvar META_KEY = Ember.META_KEY,\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/,\n getPath = Ember._getPath;\n\n/**\n Sets the value of a property on an object, respecting computed properties\n and notifying observers and other listeners of the change. If the\n property is not defined but the object implements the `setUnknownProperty`\n method then that will be invoked as well.\n\n If you plan to run on IE8 and older browsers then you should use this\n method anytime you want to set a property on an object that you don't\n know for sure is private. (Properties beginning with an underscore '_'\n are considered private.)\n\n On all newer browsers, you only need to use this method to set\n properties if the property might not be defined on the object and you want\n to respect the `setUnknownProperty` handler. Otherwise you can ignore this\n method.\n\n @method set\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} keyName The property key to set\n @param {Object} value The value to set\n @return {Object} the passed value.\n*/\nvar set = function set(obj, keyName, value, tolerant) {\n if (typeof obj === 'string') {\n Ember.assert(\"Path '\" + obj + \"' must be global if no obj is given.\", IS_GLOBAL.test(obj));\n value = keyName;\n keyName = obj;\n obj = null;\n }\n\n Ember.assert(\"Cannot call set with \"+ keyName +\" key.\", !!keyName);\n\n if (!obj || keyName.indexOf('.') !== -1) {\n return setPath(obj, keyName, value, tolerant);\n }\n\n Ember.assert(\"You need to provide an object and key to `set`.\", !!obj && keyName !== undefined);\n Ember.assert('calling set on destroyed object', !obj.isDestroyed);\n\n var meta = obj[META_KEY], desc = meta && meta.descs[keyName],\n isUnknown, currentValue;\n if (desc) {\n desc.set(obj, keyName, value);\n } else {\n isUnknown = 'object' === typeof obj && !(keyName in obj);\n\n // setUnknownProperty is called if `obj` is an object,\n // the property does not already exist, and the\n // `setUnknownProperty` method exists on the object\n if (isUnknown && 'function' === typeof obj.setUnknownProperty) {\n obj.setUnknownProperty(keyName, value);\n } else if (meta && meta.watching[keyName] > 0) {\n if (MANDATORY_SETTER) {\n currentValue = meta.values[keyName];\n } else {\n currentValue = obj[keyName];\n }\n // only trigger a change if the value has changed\n if (value !== currentValue) {\n Ember.propertyWillChange(obj, keyName);\n if (MANDATORY_SETTER) {\n if (currentValue === undefined && !(keyName in obj)) {\n Ember.defineProperty(obj, keyName, null, value); // setup mandatory setter\n } else {\n meta.values[keyName] = value;\n }\n } else {\n obj[keyName] = value;\n }\n Ember.propertyDidChange(obj, keyName);\n }\n } else {\n obj[keyName] = value;\n }\n }\n return value;\n};\n\n// Currently used only by Ember Data tests\nif (Ember.config.overrideAccessors) {\n Ember.set = set;\n Ember.config.overrideAccessors();\n set = Ember.set;\n}\n\nfunction setPath(root, path, value, tolerant) {\n var keyName;\n\n // get the last part of the path\n keyName = path.slice(path.lastIndexOf('.') + 1);\n\n // get the first part of the part\n path = path.slice(0, path.length-(keyName.length+1));\n\n // unless the path is this, look up the first part to\n // get the root\n if (path !== 'this') {\n root = getPath(root, path);\n }\n\n if (!keyName || keyName.length === 0) {\n throw new Ember.Error('You passed an empty path');\n }\n\n if (!root) {\n if (tolerant) { return; }\n else { throw new Ember.Error('Object in path '+path+' could not be found or was destroyed.'); }\n }\n\n return set(root, keyName, value);\n}\n\nEmber.set = set;\n\n/**\n Error-tolerant form of `Ember.set`. Will not blow up if any part of the\n chain is `undefined`, `null`, or destroyed.\n\n This is primarily used when syncing bindings, which may try to update after\n an object has been destroyed.\n\n @method trySet\n @for Ember\n @param {Object} obj The object to modify.\n @param {String} path The property path to set\n @param {Object} value The value to set\n*/\nEmber.trySet = function(root, path, value) {\n return set(root, path, value, true);\n};\n\n})();\n//@ sourceURL=ember-metal/property_set");minispade.register('ember-metal/run_loop', "(function() {minispade.require('ember-metal/vendor/backburner');\n\nvar onBegin = function(current) {\n Ember.run.currentRunLoop = current;\n};\n\nvar onEnd = function(current, next) {\n Ember.run.currentRunLoop = next;\n};\n\nvar Backburner = requireModule('backburner').Backburner,\n backburner = new Backburner(['sync', 'actions', 'destroy'], {\n sync: {\n before: Ember.beginPropertyChanges,\n after: Ember.endPropertyChanges\n },\n defaultQueue: 'actions',\n onBegin: onBegin,\n onEnd: onEnd\n }),\n slice = [].slice;\n\n// ..........................................................\n// Ember.run - this is ideally the only public API the dev sees\n//\n\n/**\n Runs the passed target and method inside of a RunLoop, ensuring any\n deferred actions including bindings and views updates are flushed at the\n end.\n\n Normally you should not need to invoke this method yourself. However if\n you are implementing raw event handlers when interfacing with other\n libraries or plugins, you should probably wrap all of your code inside this\n call.\n\n ```javascript\n Ember.run(function() {\n // code to be execute within a RunLoop\n });\n ```\n\n @class run\n @namespace Ember\n @static\n @constructor\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function.\n*/\nEmber.run = function(target, method) {\n var ret;\n\n if (Ember.onerror) {\n try {\n ret = backburner.run.apply(backburner, arguments);\n } catch (e) {\n Ember.onerror(e);\n }\n } else {\n ret = backburner.run.apply(backburner, arguments);\n }\n\n return ret;\n};\n\n/**\n\n If no run-loop is present, it creates a new one. If a run loop is\n present it will queue itself to run on the existing run-loops action\n queue.\n\n Please note: This is not for normal usage, and should be used sparingly.\n\n If invoked when not within a run loop:\n\n ```javascript\n Ember.run.join(function() {\n // creates a new run-loop\n });\n ```\n\n Alternatively, if called within an existing run loop:\n\n ```javascript\n Ember.run(function() {\n // creates a new run-loop\n Ember.run.join(function() {\n // joins with the existing run-loop, and queues for invocation on\n // the existing run-loops action queue.\n });\n });\n ```\n\n @method join\n @namespace Ember\n @param {Object} [target] target of method to call\n @param {Function|String} method Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Any additional arguments you wish to pass to the method.\n @return {Object} return value from invoking the passed function. Please note,\n when called within an existing loop, no return value is possible.\n*/\nEmber.run.join = function(target, method) {\n if (!Ember.run.currentRunLoop) {\n return Ember.run.apply(Ember.run, arguments);\n }\n\n var args = slice.call(arguments);\n args.unshift('actions');\n Ember.run.schedule.apply(Ember.run, args);\n};\n\nEmber.run.backburner = backburner;\n\nvar run = Ember.run;\n\nEmber.run.currentRunLoop = null;\n\nEmber.run.queues = backburner.queueNames;\n\n/**\n Begins a new RunLoop. Any deferred actions invoked after the begin will\n be buffered until you invoke a matching call to `Ember.run.end()`. This is\n a lower-level way to use a RunLoop instead of using `Ember.run()`.\n\n ```javascript\n Ember.run.begin();\n // code to be execute within a RunLoop\n Ember.run.end();\n ```\n\n @method begin\n @return {void}\n*/\nEmber.run.begin = function() {\n backburner.begin();\n};\n\n/**\n Ends a RunLoop. This must be called sometime after you call\n `Ember.run.begin()` to flush any deferred actions. This is a lower-level way\n to use a RunLoop instead of using `Ember.run()`.\n\n ```javascript\n Ember.run.begin();\n // code to be execute within a RunLoop\n Ember.run.end();\n ```\n\n @method end\n @return {void}\n*/\nEmber.run.end = function() {\n backburner.end();\n};\n\n/**\n Array of named queues. This array determines the order in which queues\n are flushed at the end of the RunLoop. You can define your own queues by\n simply adding the queue name to this array. Normally you should not need\n to inspect or modify this property.\n\n @property queues\n @type Array\n @default ['sync', 'actions', 'destroy']\n*/\n\n/**\n Adds the passed target/method and any optional arguments to the named\n queue to be executed at the end of the RunLoop. If you have not already\n started a RunLoop when calling this method one will be started for you\n automatically.\n\n At the end of a RunLoop, any methods scheduled in this way will be invoked.\n Methods will be invoked in an order matching the named queues defined in\n the `Ember.run.queues` property.\n\n ```javascript\n Ember.run.schedule('sync', this, function() {\n // this will be executed in the first RunLoop queue, when bindings are synced\n console.log(\"scheduled on sync queue\");\n });\n\n Ember.run.schedule('actions', this, function() {\n // this will be executed in the 'actions' queue, after bindings have synced.\n console.log(\"scheduled on actions queue\");\n });\n\n // Note the functions will be run in order based on the run queues order. Output would be:\n // scheduled on sync queue\n // scheduled on actions queue\n ```\n\n @method schedule\n @param {String} queue The name of the queue to schedule against.\n Default queues are 'sync' and 'actions'\n @param {Object} [target] target object to use as the context when invoking a method.\n @param {String|Function} method The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.\n @param {Object} [arguments*] Optional arguments to be passed to the queued method.\n @return {void}\n*/\nEmber.run.schedule = function(queue, target, method) {\n checkAutoRun();\n backburner.schedule.apply(backburner, arguments);\n};\n\n// Used by global test teardown\nEmber.run.hasScheduledTimers = function() {\n return backburner.hasTimers();\n};\n\n// Used by global test teardown\nEmber.run.cancelTimers = function () {\n backburner.cancelTimers();\n};\n\n/**\n Immediately flushes any events scheduled in the 'sync' queue. Bindings\n use this queue so this method is a useful way to immediately force all\n bindings in the application to sync.\n\n You should call this method anytime you need any changed state to propagate\n throughout the app immediately without repainting the UI (which happens\n in the later 'render' queue added by the `ember-views` package).\n\n ```javascript\n Ember.run.sync();\n ```\n\n @method sync\n @return {void}\n*/\nEmber.run.sync = function() {\n if (backburner.currentInstance) {\n backburner.currentInstance.queues.sync.flush();\n }\n};\n\n/**\n Invokes the passed target/method and optional arguments after a specified\n period if time. The last parameter of this method must always be a number\n of milliseconds.\n\n You should use this method whenever you need to run some action after a\n period of time instead of using `setTimeout()`. This method will ensure that\n items that expire during the same script execution cycle all execute\n together, which is often more efficient than using a real setTimeout.\n\n ```javascript\n Ember.run.later(myContext, function() {\n // code here will execute within a RunLoop in about 500ms with this == myContext\n }, 500);\n ```\n\n @method later\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait Number of milliseconds to wait.\n @return {String} a string you can use to cancel the timer in\n `Ember.run.cancel` later.\n*/\nEmber.run.later = function(target, method) {\n return backburner.later.apply(backburner, arguments);\n};\n\n/**\n Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling `scheduleOnce` with the \"actions\" queue.\n\n @method once\n @param {Object} [target] The target of the method to invoke.\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.once = function(target, method) {\n checkAutoRun();\n var args = slice.call(arguments);\n args.unshift('actions');\n return backburner.scheduleOnce.apply(backburner, args);\n};\n\n/**\n Schedules a function to run one time in a given queue of the current RunLoop.\n Calling this method with the same queue/target/method combination will have\n no effect (past the initial call).\n\n Note that although you can pass optional arguments these will not be\n considered when looking for duplicates. New arguments will replace previous\n calls.\n\n ```javascript\n Ember.run(function() {\n var sayHi = function() { console.log('hi'); }\n Ember.run.scheduleOnce('afterRender', myContext, sayHi);\n Ember.run.scheduleOnce('afterRender', myContext, sayHi);\n // sayHi will only be executed once, in the afterRender queue of the RunLoop\n });\n ```\n\n Also note that passing an anonymous function to `Ember.run.scheduleOnce` will\n not prevent additional calls with an identical anonymous function from\n scheduling the items multiple times, e.g.:\n\n ```javascript\n function scheduleIt() {\n Ember.run.scheduleOnce('actions', myContext, function() { console.log(\"Closure\"); });\n }\n scheduleIt();\n scheduleIt();\n // \"Closure\" will print twice, even though we're using `Ember.run.scheduleOnce`,\n // because the function we pass to it is anonymous and won't match the\n // previously scheduled operation.\n ```\n\n Available queues, and their order, can be found at `Ember.run.queues`\n\n @method scheduleOnce\n @param {String} [queue] The name of the queue to schedule against. Default queues are 'sync' and 'actions'.\n @param {Object} [target] The target of the method to invoke.\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.scheduleOnce = function(queue, target, method) {\n checkAutoRun();\n return backburner.scheduleOnce.apply(backburner, arguments);\n};\n\n/**\n Schedules an item to run from within a separate run loop, after\n control has been returned to the system. This is equivalent to calling\n `Ember.run.later` with a wait time of 1ms.\n\n ```javascript\n Ember.run.next(myContext, function() {\n // code to be executed in the next run loop, which will be scheduled after the current one\n });\n ```\n\n Multiple operations scheduled with `Ember.run.next` will coalesce\n into the same later run loop, along with any other operations\n scheduled by `Ember.run.later` that expire right around the same\n time that `Ember.run.next` operations will fire.\n\n Note that there are often alternatives to using `Ember.run.next`.\n For instance, if you'd like to schedule an operation to happen\n after all DOM element operations have completed within the current\n run loop, you can make use of the `afterRender` run loop queue (added\n by the `ember-views` package, along with the preceding `render` queue\n where all the DOM element operations happen). Example:\n\n ```javascript\n App.MyCollectionView = Ember.CollectionView.extend({\n didInsertElement: function() {\n Ember.run.scheduleOnce('afterRender', this, 'processChildElements');\n },\n processChildElements: function() {\n // ... do something with collectionView's child view\n // elements after they've finished rendering, which\n // can't be done within the CollectionView's\n // `didInsertElement` hook because that gets run\n // before the child elements have been added to the DOM.\n }\n });\n ```\n\n One benefit of the above approach compared to using `Ember.run.next` is\n that you will be able to perform DOM/CSS operations before unprocessed\n elements are rendered to the screen, which may prevent flickering or\n other artifacts caused by delaying processing until after rendering.\n\n The other major benefit to the above approach is that `Ember.run.next`\n introduces an element of non-determinism, which can make things much\n harder to test, due to its reliance on `setTimeout`; it's much harder\n to guarantee the order of scheduled operations when they are scheduled\n outside of the current run loop, i.e. with `Ember.run.next`.\n\n @method next\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @return {Object} timer\n*/\nEmber.run.next = function() {\n var args = slice.call(arguments);\n args.push(1);\n return backburner.later.apply(backburner, args);\n};\n\n/**\n Cancels a scheduled item. Must be a value returned by `Ember.run.later()`,\n `Ember.run.once()`, or `Ember.run.next()`.\n\n ```javascript\n var runNext = Ember.run.next(myContext, function() {\n // will not be executed\n });\n Ember.run.cancel(runNext);\n\n var runLater = Ember.run.later(myContext, function() {\n // will not be executed\n }, 500);\n Ember.run.cancel(runLater);\n\n var runOnce = Ember.run.once(myContext, function() {\n // will not be executed\n });\n Ember.run.cancel(runOnce);\n ```\n\n @method cancel\n @param {Object} timer Timer object to cancel\n @return {void}\n*/\nEmber.run.cancel = function(timer) {\n return backburner.cancel(timer);\n};\n\n/**\n Delay calling the target method until the debounce period has elapsed\n with no additional debounce calls. If `debounce` is called again before\n the specified time has elapsed, the timer is reset and the entire period\n must pass again before the target method is called.\n\n This method should be used when an event may be called multiple times\n but the action should only be called once when the event is done firing.\n A common example is for scroll events where you only want updates to\n happen once scrolling has ceased.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'debounce'};\n\n Ember.run.debounce(myContext, myFunc, 150);\n\n // less than 150ms passes\n\n Ember.run.debounce(myContext, myFunc, 150);\n\n // 150ms passes\n // myFunc is invoked with context myContext\n // console logs 'debounce ran.' one time.\n ```\n\n @method debounce\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} wait Number of milliseconds to wait.\n @param {Boolean} immediate Trigger the function on the leading instead of the trailing edge of the wait interval.\n @return {void}\n*/\nEmber.run.debounce = function() {\n return backburner.debounce.apply(backburner, arguments);\n};\n\n/**\n Ensure that the target method is never called more frequently than\n the specified spacing period.\n\n ```javascript\n var myFunc = function() { console.log(this.name + ' ran.'); };\n var myContext = {name: 'throttle'};\n\n Ember.run.throttle(myContext, myFunc, 150);\n\n // 50ms passes\n Ember.run.throttle(myContext, myFunc, 150);\n\n // 50ms passes\n Ember.run.throttle(myContext, myFunc, 150);\n\n // 50ms passes\n Ember.run.throttle(myContext, myFunc, 150);\n\n // 150ms passes\n // myFunc is invoked with context myContext\n // console logs 'throttle ran.' twice, 150ms apart.\n ```\n\n @method throttle\n @param {Object} [target] target of method to invoke\n @param {Function|String} method The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.\n @param {Object} [args*] Optional arguments to pass to the timeout.\n @param {Number} spacing Number of milliseconds to space out requests.\n @return {void}\n*/\nEmber.run.throttle = function() {\n return backburner.throttle.apply(backburner, arguments);\n};\n\n// Make sure it's not an autorun during testing\nfunction checkAutoRun() {\n if (!Ember.run.currentRunLoop) {\n Ember.assert(\"You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run\", !Ember.testing);\n }\n}\n\n})();\n//@ sourceURL=ember-metal/run_loop");minispade.register('ember-metal/set_properties', "(function() {minispade.require('ember-metal/property_events');\nminispade.require('ember-metal/property_set');\n\nvar changeProperties = Ember.changeProperties,\n set = Ember.set;\n\n/**\n Set a list of properties on an object. These properties are set inside\n a single `beginPropertyChanges` and `endPropertyChanges` batch, so\n observers will be buffered.\n\n ```javascript\n anObject.setProperties({\n firstName: \"Stanley\",\n lastName: \"Stuart\",\n age: \"21\"\n })\n ```\n\n @method setProperties\n @param self\n @param {Object} hash\n @return self\n*/\nEmber.setProperties = function(self, hash) {\n changeProperties(function() {\n for(var prop in hash) {\n if (hash.hasOwnProperty(prop)) { set(self, prop, hash[prop]); }\n }\n });\n return self;\n};\n\n})();\n//@ sourceURL=ember-metal/set_properties");minispade.register('ember-metal/utils', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/array');\nminispade.require('ember-metal/error');\n\n/**\n@module ember-metal\n*/\n\n/**\n @private\n \n Prefix used for guids through out Ember.\n \n*/\nEmber.GUID_PREFIX = 'ember';\n\n\nvar o_defineProperty = Ember.platform.defineProperty,\n o_create = Ember.create,\n // Used for guid generation...\n GUID_KEY = '__ember'+ (+ new Date()),\n uuid = 0,\n numberCache = [],\n stringCache = {};\n\nvar MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;\n\n/**\n @private\n\n A unique key used to assign guids and other private metadata to objects.\n If you inspect an object in your browser debugger you will often see these.\n They can be safely ignored.\n\n On browsers that support it, these properties are added with enumeration\n disabled so they won't show up when you iterate over your properties.\n\n @property GUID_KEY\n @for Ember\n @type String\n @final\n*/\nEmber.GUID_KEY = GUID_KEY;\n\nvar GUID_DESC = {\n writable: false,\n configurable: false,\n enumerable: false,\n value: null\n};\n\n/**\n @private\n\n Generates a new guid, optionally saving the guid to the object that you\n pass in. You will rarely need to use this method. Instead you should\n call `Ember.guidFor(obj)`, which return an existing guid if available.\n\n @method generateGuid\n @for Ember\n @param {Object} [obj] Object the guid will be used for. If passed in, the guid will\n be saved on the object and reused whenever you pass the same object\n again.\n\n If no object is passed, just generate a new guid.\n @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to\n separate the guid into separate namespaces.\n @return {String} the guid\n*/\nEmber.generateGuid = function generateGuid(obj, prefix) {\n if (!prefix) prefix = Ember.GUID_PREFIX;\n var ret = (prefix + (uuid++));\n if (obj) {\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n }\n return ret;\n};\n\n/**\n @private\n\n Returns a unique id for the object. If the object does not yet have a guid,\n one will be assigned to it. You can call this on any object,\n `Ember.Object`-based or not, but be aware that it will add a `_guid`\n property.\n\n You can also use this method on DOM Element objects.\n\n @method guidFor\n @for Ember\n @param {Object} obj any object, string, number, Element, or primitive\n @return {String} the unique guid for this instance.\n*/\nEmber.guidFor = function guidFor(obj) {\n\n // special cases where we don't want to add a key to object\n if (obj === undefined) return \"(undefined)\";\n if (obj === null) return \"(null)\";\n\n var ret;\n var type = typeof obj;\n\n // Don't allow prototype changes to String etc. to change the guidFor\n switch(type) {\n case 'number':\n ret = numberCache[obj];\n if (!ret) ret = numberCache[obj] = 'nu'+obj;\n return ret;\n\n case 'string':\n ret = stringCache[obj];\n if (!ret) ret = stringCache[obj] = 'st'+(uuid++);\n return ret;\n\n case 'boolean':\n return obj ? '(true)' : '(false)';\n\n default:\n if (obj[GUID_KEY]) return obj[GUID_KEY];\n if (obj === Object) return '(Object)';\n if (obj === Array) return '(Array)';\n ret = 'ember'+(uuid++);\n GUID_DESC.value = ret;\n o_defineProperty(obj, GUID_KEY, GUID_DESC);\n return ret;\n }\n};\n\n// ..........................................................\n// META\n//\n\nvar META_DESC = {\n writable: true,\n configurable: false,\n enumerable: false,\n value: null\n};\n\nvar META_KEY = Ember.GUID_KEY+'_meta';\n\n/**\n The key used to store meta information on object for property observing.\n\n @property META_KEY\n @for Ember\n @private\n @final\n @type String\n*/\nEmber.META_KEY = META_KEY;\n\n// Placeholder for non-writable metas.\nvar EMPTY_META = {\n descs: {},\n watching: {}\n};\n\nif (MANDATORY_SETTER) { EMPTY_META.values = {}; }\n\nEmber.EMPTY_META = EMPTY_META;\n\nif (Object.freeze) Object.freeze(EMPTY_META);\n\nvar isDefinePropertySimulated = Ember.platform.defineProperty.isSimulated;\n\nfunction Meta(obj) {\n this.descs = {};\n this.watching = {};\n this.cache = {};\n this.source = obj;\n}\n\nif (isDefinePropertySimulated) {\n // on platforms that don't support enumerable false\n // make meta fail jQuery.isPlainObject() to hide from\n // jQuery.extend() by having a property that fails\n // hasOwnProperty check.\n Meta.prototype.__preventPlainObject__ = true;\n\n // Without non-enumerable properties, meta objects will be output in JSON\n // unless explicitly suppressed\n Meta.prototype.toJSON = function () { };\n}\n\n/**\n Retrieves the meta hash for an object. If `writable` is true ensures the\n hash is writable for this object as well.\n\n The meta object contains information about computed property descriptors as\n well as any watched properties and other information. You generally will\n not access this information directly but instead work with higher level\n methods that manipulate this hash indirectly.\n\n @method meta\n @for Ember\n @private\n\n @param {Object} obj The object to retrieve meta for\n @param {Boolean} [writable=true] Pass `false` if you do not intend to modify\n the meta hash, allowing the method to avoid making an unnecessary copy.\n @return {Object} the meta hash for an object\n*/\nEmber.meta = function meta(obj, writable) {\n\n var ret = obj[META_KEY];\n if (writable===false) return ret || EMPTY_META;\n\n if (!ret) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = new Meta(obj);\n\n if (MANDATORY_SETTER) { ret.values = {}; }\n\n obj[META_KEY] = ret;\n\n // make sure we don't accidentally try to create constructor like desc\n ret.descs.constructor = null;\n\n } else if (ret.source !== obj) {\n if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);\n\n ret = o_create(ret);\n ret.descs = o_create(ret.descs);\n ret.watching = o_create(ret.watching);\n ret.cache = {};\n ret.source = obj;\n\n if (MANDATORY_SETTER) { ret.values = o_create(ret.values); }\n\n obj[META_KEY] = ret;\n }\n return ret;\n};\n\nEmber.getMeta = function getMeta(obj, property) {\n var meta = Ember.meta(obj, false);\n return meta[property];\n};\n\nEmber.setMeta = function setMeta(obj, property, value) {\n var meta = Ember.meta(obj, true);\n meta[property] = value;\n return value;\n};\n\n/**\n @deprecated\n @private\n\n In order to store defaults for a class, a prototype may need to create\n a default meta object, which will be inherited by any objects instantiated\n from the class's constructor.\n\n However, the properties of that meta object are only shallow-cloned,\n so if a property is a hash (like the event system's `listeners` hash),\n it will by default be shared across all instances of that class.\n\n This method allows extensions to deeply clone a series of nested hashes or\n other complex objects. For instance, the event system might pass\n `['listeners', 'foo:change', 'ember157']` to `prepareMetaPath`, which will\n walk down the keys provided.\n\n For each key, if the key does not exist, it is created. If it already\n exists and it was inherited from its constructor, the constructor's\n key is cloned.\n\n You can also pass false for `writable`, which will simply return\n undefined if `prepareMetaPath` discovers any part of the path that\n shared or undefined.\n\n @method metaPath\n @for Ember\n @param {Object} obj The object whose meta we are examining\n @param {Array} path An array of keys to walk down\n @param {Boolean} writable whether or not to create a new meta\n (or meta property) if one does not already exist or if it's\n shared with its constructor\n*/\nEmber.metaPath = function metaPath(obj, path, writable) {\n Ember.deprecate(\"Ember.metaPath is deprecated and will be removed from future releases.\");\n var meta = Ember.meta(obj, writable), keyName, value;\n\n for (var i=0, l=path.length; i<l; i++) {\n keyName = path[i];\n value = meta[keyName];\n\n if (!value) {\n if (!writable) { return undefined; }\n value = meta[keyName] = { __ember_source__: obj };\n } else if (value.__ember_source__ !== obj) {\n if (!writable) { return undefined; }\n value = meta[keyName] = o_create(value);\n value.__ember_source__ = obj;\n }\n\n meta = value;\n }\n\n return value;\n};\n\n/**\n @private\n\n Wraps the passed function so that `this._super` will point to the superFunc\n when the function is invoked. This is the primitive we use to implement\n calls to super.\n\n @method wrap\n @for Ember\n @param {Function} func The function to call\n @param {Function} superFunc The super function.\n @return {Function} wrapped function.\n*/\nEmber.wrap = function(func, superFunc) {\n function K() {}\n\n function superWrapper() {\n var ret, sup = this._super;\n this._super = superFunc || K;\n ret = func.apply(this, arguments);\n this._super = sup;\n return ret;\n }\n\n superWrapper.wrappedFunction = func;\n superWrapper.__ember_observes__ = func.__ember_observes__;\n superWrapper.__ember_observesBefore__ = func.__ember_observesBefore__;\n superWrapper.__ember_listens__ = func.__ember_listens__;\n\n return superWrapper;\n};\n\n/**\n Returns true if the passed object is an array or Array-like.\n\n Ember Array Protocol:\n\n - the object has an objectAt property\n - the object is a native Array\n - the object is an Object, and has a length property\n\n Unlike `Ember.typeOf` this method returns true even if the passed object is\n not formally array but appears to be array-like (i.e. implements `Ember.Array`)\n\n ```javascript\n Ember.isArray(); // false\n Ember.isArray([]); // true\n Ember.isArray( Ember.ArrayProxy.create({ content: [] }) ); // true\n ```\n\n @method isArray\n @for Ember\n @param {Object} obj The object to test\n @return {Boolean} true if the passed object is an array or Array-like\n*/\nEmber.isArray = function(obj) {\n if (!obj || obj.setInterval) { return false; }\n if (Array.isArray && Array.isArray(obj)) { return true; }\n if (Ember.Array && Ember.Array.detect(obj)) { return true; }\n if ((obj.length !== undefined) && 'object'===typeof obj) { return true; }\n return false;\n};\n\n/**\n Forces the passed object to be part of an array. If the object is already\n an array or array-like, returns the object. Otherwise adds the object to\n an array. If obj is `null` or `undefined`, returns an empty array.\n\n ```javascript\n Ember.makeArray(); // []\n Ember.makeArray(null); // []\n Ember.makeArray(undefined); // []\n Ember.makeArray('lindsay'); // ['lindsay']\n Ember.makeArray([1,2,42]); // [1,2,42]\n\n var controller = Ember.ArrayProxy.create({ content: [] });\n Ember.makeArray(controller) === controller; // true\n ```\n\n @method makeArray\n @for Ember\n @param {Object} obj the object\n @return {Array}\n*/\nEmber.makeArray = function(obj) {\n if (obj === null || obj === undefined) { return []; }\n return Ember.isArray(obj) ? obj : [obj];\n};\n\nfunction canInvoke(obj, methodName) {\n return !!(obj && typeof obj[methodName] === 'function');\n}\n\n/**\n Checks to see if the `methodName` exists on the `obj`.\n\n ```javascript\n var foo = {bar: Ember.K, baz: null};\n Ember.canInvoke(foo, 'bar'); // true\n Ember.canInvoke(foo, 'baz'); // false\n Ember.canInvoke(foo, 'bat'); // false\n ```\n\n @method canInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @return {Boolean}\n*/\nEmber.canInvoke = canInvoke;\n\n/**\n Checks to see if the `methodName` exists on the `obj`,\n and if it does, invokes it with the arguments passed.\n\n ```javascript\n var d = new Date('03/15/2013');\n Ember.tryInvoke(d, 'getTime'); // 1363320000000\n Ember.tryInvoke(d, 'setFullYear', [2014]); // 1394856000000\n Ember.tryInvoke(d, 'noSuchMethod', [2014]); // undefined\n ```\n\n @method tryInvoke\n @for Ember\n @param {Object} obj The object to check for the method\n @param {String} methodName The method name to check for\n @param {Array} [args] The arguments to pass to the method\n @return {*} the return value of the invoked method or undefined if it cannot be invoked\n*/\nEmber.tryInvoke = function(obj, methodName, args) {\n if (canInvoke(obj, methodName)) {\n return obj[methodName].apply(obj, args || []);\n }\n};\n\n// https://github.com/emberjs/ember.js/pull/1617\nvar needsFinallyFix = (function() {\n var count = 0;\n try{\n try { }\n finally {\n count++;\n throw new Error('needsFinallyFixTest');\n }\n } catch (e) {}\n\n return count !== 1;\n})();\n\n/**\n Provides try { } finally { } functionality, while working\n around Safari's double finally bug.\n\n ```javascript\n var tryable = function() {\n someResource.lock();\n runCallback(); // May throw error.\n };\n var finalizer = function() {\n someResource.unlock();\n };\n Ember.tryFinally(tryable, finalizer);\n ```\n\n @method tryFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} finalizer The function to run the finally callback\n @param {Object} [binding] The optional calling object. Defaults to 'this'\n @return {*} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable\n*/\n\nif (needsFinallyFix) {\n Ember.tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e) {\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n} else {\n Ember.tryFinally = function(tryable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n}\n\n/**\n Provides try { } catch finally { } functionality, while working\n around Safari's double finally bug.\n\n ```javascript\n var tryable = function() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n beforeValues[i] = listener.before(name, time(), payload);\n }\n\n return callback.call(binding);\n };\n\n var catchable = function(e) {\n payload = payload || {};\n payload.exception = e;\n };\n\n var finalizer = function() {\n for (i=0, l=listeners.length; i<l; i++) {\n listener = listeners[i];\n listener.after(name, time(), payload, beforeValues[i]);\n }\n };\n Ember.tryCatchFinally(tryable, catchable, finalizer);\n ```\n\n @method tryCatchFinally\n @for Ember\n @param {Function} tryable The function to run the try callback\n @param {Function} catchable The function to run the catchable callback\n @param {Function} finalizer The function to run the finally callback\n @param {Object} [binding] The optional calling object. Defaults to 'this'\n @return {*} The return value is the that of the finalizer,\n unless that value is undefined, in which case it is the return value\n of the tryable.\n*/\nif (needsFinallyFix) {\n Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult, finalError;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n try {\n finalResult = finalizer.call(binding);\n } catch (e) {\n finalError = e;\n }\n }\n\n if (finalError) { throw finalError; }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n} else {\n Ember.tryCatchFinally = function(tryable, catchable, finalizer, binding) {\n var result, finalResult;\n\n binding = binding || this;\n\n try {\n result = tryable.call(binding);\n } catch(error) {\n result = catchable.call(binding, error);\n } finally {\n finalResult = finalizer.call(binding);\n }\n\n return (finalResult === undefined) ? result : finalResult;\n };\n}\n\n// ........................................\n// TYPING & ARRAY MESSAGING\n//\n\nvar TYPE_MAP = {};\nvar t = \"Boolean Number String Function Array Date RegExp Object\".split(\" \");\nEmber.ArrayPolyfills.forEach.call(t, function(name) {\n TYPE_MAP[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\nvar toString = Object.prototype.toString;\n\n/**\n Returns a consistent type for the passed item.\n\n Use this instead of the built-in `typeof` to get the type of an item.\n It will return the same result across all browsers and includes a bit\n more detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive |\n | 'number' | Number primitive |\n | 'boolean' | Boolean primitive |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'class' | An Ember class (created using Ember.Object.extend()) |\n | 'instance' | An Ember object instance |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object not inheriting from Ember.Object |\n\n Examples:\n\n ```javascript\n Ember.typeOf(); // 'undefined'\n Ember.typeOf(null); // 'null'\n Ember.typeOf(undefined); // 'undefined'\n Ember.typeOf('michael'); // 'string'\n Ember.typeOf(101); // 'number'\n Ember.typeOf(true); // 'boolean'\n Ember.typeOf(Ember.makeArray); // 'function'\n Ember.typeOf([1,2,90]); // 'array'\n Ember.typeOf(Ember.Object.extend()); // 'class'\n Ember.typeOf(Ember.Object.create()); // 'instance'\n Ember.typeOf(new Error('teamocil')); // 'error'\n\n // \"normal\" JavaScript object\n Ember.typeOf({a: 'b'}); // 'object'\n ```\n\n @method typeOf\n @for Ember\n @param {Object} item the item to check\n @return {String} the type\n*/\nEmber.typeOf = function(item) {\n var ret;\n\n ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object';\n\n if (ret === 'function') {\n if (Ember.Object && Ember.Object.detect(item)) ret = 'class';\n } else if (ret === 'object') {\n if (item instanceof Error) ret = 'error';\n else if (Ember.Object && item instanceof Ember.Object) ret = 'instance';\n else ret = 'object';\n }\n\n return ret;\n};\n\n})();\n//@ sourceURL=ember-metal/utils");minispade.register('ember-metal/vendor/backburner', "(function() {define(\"backburner/queue\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n function Queue(daq, name, options) {\n this.daq = daq;\n this.name = name;\n this.options = options;\n this._queue = [];\n }\n\n Queue.prototype = {\n daq: null,\n name: null,\n options: null,\n _queue: null,\n\n push: function(target, method, args, stack) {\n var queue = this._queue;\n queue.push(target, method, args, stack);\n return {queue: this, target: target, method: method};\n },\n\n pushUnique: function(target, method, args, stack) {\n var queue = this._queue, currentTarget, currentMethod, i, l;\n\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === target && currentMethod === method) {\n queue[i+2] = args; // replace args\n queue[i+3] = stack; // replace stack\n return {queue: this, target: target, method: method}; // TODO: test this code path\n }\n }\n\n this._queue.push(target, method, args, stack);\n return {queue: this, target: target, method: method};\n },\n\n // TODO: remove me, only being used for Ember.run.sync\n flush: function() {\n var queue = this._queue,\n options = this.options,\n before = options && options.before,\n after = options && options.after,\n target, method, args, stack, i, l = queue.length;\n\n if (l && before) { before(); }\n for (i = 0; i < l; i += 4) {\n target = queue[i];\n method = queue[i+1];\n args = queue[i+2];\n stack = queue[i+3]; // Debugging assistance\n\n // TODO: error handling\n if (args && args.length > 0) {\n method.apply(target, args);\n } else {\n method.call(target);\n }\n }\n if (l && after) { after(); }\n\n // check if new items have been added\n if (queue.length > l) {\n this._queue = queue.slice(l);\n this.flush();\n } else {\n this._queue.length = 0;\n }\n },\n\n cancel: function(actionToCancel) {\n var queue = this._queue, currentTarget, currentMethod, i, l;\n\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === actionToCancel.target && currentMethod === actionToCancel.method) {\n queue.splice(i, 4);\n return true;\n }\n }\n\n // if not found in current queue\n // could be in the queue that is being flushed\n queue = this._queueBeingFlushed;\n if (!queue) {\n return;\n }\n for (i = 0, l = queue.length; i < l; i += 4) {\n currentTarget = queue[i];\n currentMethod = queue[i+1];\n\n if (currentTarget === actionToCancel.target && currentMethod === actionToCancel.method) {\n // don't mess with array during flush\n // just nullify the method\n queue[i+1] = null;\n return true;\n }\n }\n }\n };\n\n\n __exports__.Queue = Queue;\n });\n\ndefine(\"backburner/deferred_action_queues\",\n [\"backburner/queue\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Queue = __dependency1__.Queue;\n\n function DeferredActionQueues(queueNames, options) {\n var queues = this.queues = {};\n this.queueNames = queueNames = queueNames || [];\n\n var queueName;\n for (var i = 0, l = queueNames.length; i < l; i++) {\n queueName = queueNames[i];\n queues[queueName] = new Queue(this, queueName, options[queueName]);\n }\n }\n\n DeferredActionQueues.prototype = {\n queueNames: null,\n queues: null,\n\n schedule: function(queueName, target, method, args, onceFlag, stack) {\n var queues = this.queues,\n queue = queues[queueName];\n\n if (!queue) { throw new Error(\"You attempted to schedule an action in a queue (\" + queueName + \") that doesn't exist\"); }\n\n if (onceFlag) {\n return queue.pushUnique(target, method, args, stack);\n } else {\n return queue.push(target, method, args, stack);\n }\n },\n\n flush: function() {\n var queues = this.queues,\n queueNames = this.queueNames,\n queueName, queue, queueItems, priorQueueNameIndex,\n queueNameIndex = 0, numberOfQueues = queueNames.length;\n\n outerloop:\n while (queueNameIndex < numberOfQueues) {\n queueName = queueNames[queueNameIndex];\n queue = queues[queueName];\n queueItems = queue._queueBeingFlushed = queue._queue.slice();\n queue._queue = [];\n\n var options = queue.options,\n before = options && options.before,\n after = options && options.after,\n target, method, args, stack,\n queueIndex = 0, numberOfQueueItems = queueItems.length;\n\n if (numberOfQueueItems && before) { before(); }\n while (queueIndex < numberOfQueueItems) {\n target = queueItems[queueIndex];\n method = queueItems[queueIndex+1];\n args = queueItems[queueIndex+2];\n stack = queueItems[queueIndex+3]; // Debugging assistance\n\n if (typeof method === 'string') { method = target[method]; }\n\n // method could have been nullified / canceled during flush\n if (method) {\n // TODO: error handling\n if (args && args.length > 0) {\n method.apply(target, args);\n } else {\n method.call(target);\n }\n }\n\n queueIndex += 4;\n }\n queue._queueBeingFlushed = null;\n if (numberOfQueueItems && after) { after(); }\n\n if ((priorQueueNameIndex = indexOfPriorQueueWithActions(this, queueNameIndex)) !== -1) {\n queueNameIndex = priorQueueNameIndex;\n continue outerloop;\n }\n\n queueNameIndex++;\n }\n }\n };\n\n function indexOfPriorQueueWithActions(daq, currentQueueIndex) {\n var queueName, queue;\n\n for (var i = 0, l = currentQueueIndex; i <= l; i++) {\n queueName = daq.queueNames[i];\n queue = daq.queues[queueName];\n if (queue._queue.length) { return i; }\n }\n\n return -1;\n }\n\n\n __exports__.DeferredActionQueues = DeferredActionQueues;\n });\n\ndefine(\"backburner\",\n [\"backburner/deferred_action_queues\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var DeferredActionQueues = __dependency1__.DeferredActionQueues;\n\n var slice = [].slice,\n pop = [].pop,\n throttlers = [],\n debouncees = [],\n timers = [],\n autorun, laterTimer, laterTimerExpiresAt,\n global = this,\n NUMBER = /\\d+/;\n\n function isCoercableNumber(number) {\n return typeof number === 'number' || NUMBER.test(number);\n }\n\n function Backburner(queueNames, options) {\n this.queueNames = queueNames;\n this.options = options || {};\n if (!this.options.defaultQueue) {\n this.options.defaultQueue = queueNames[0];\n }\n this.instanceStack = [];\n }\n\n Backburner.prototype = {\n queueNames: null,\n options: null,\n currentInstance: null,\n instanceStack: null,\n\n begin: function() {\n var onBegin = this.options && this.options.onBegin,\n previousInstance = this.currentInstance;\n\n if (previousInstance) {\n this.instanceStack.push(previousInstance);\n }\n\n this.currentInstance = new DeferredActionQueues(this.queueNames, this.options);\n if (onBegin) {\n onBegin(this.currentInstance, previousInstance);\n }\n },\n\n end: function() {\n var onEnd = this.options && this.options.onEnd,\n currentInstance = this.currentInstance,\n nextInstance = null;\n\n try {\n currentInstance.flush();\n } finally {\n this.currentInstance = null;\n\n if (this.instanceStack.length) {\n nextInstance = this.instanceStack.pop();\n this.currentInstance = nextInstance;\n }\n\n if (onEnd) {\n onEnd(currentInstance, nextInstance);\n }\n }\n },\n\n run: function(target, method /*, args */) {\n var ret;\n this.begin();\n\n if (!method) {\n method = target;\n target = null;\n }\n\n if (typeof method === 'string') {\n method = target[method];\n }\n\n // Prevent Safari double-finally.\n var finallyAlreadyCalled = false;\n try {\n if (arguments.length > 2) {\n ret = method.apply(target, slice.call(arguments, 2));\n } else {\n ret = method.call(target);\n }\n } finally {\n if (!finallyAlreadyCalled) {\n finallyAlreadyCalled = true;\n this.end();\n }\n }\n return ret;\n },\n\n defer: function(queueName, target, method /* , args */) {\n if (!method) {\n method = target;\n target = null;\n }\n\n if (typeof method === 'string') {\n method = target[method];\n }\n\n var stack = this.DEBUG ? new Error().stack : undefined,\n args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;\n if (!this.currentInstance) { createAutorun(this); }\n return this.currentInstance.schedule(queueName, target, method, args, false, stack);\n },\n\n deferOnce: function(queueName, target, method /* , args */) {\n if (!method) {\n method = target;\n target = null;\n }\n\n if (typeof method === 'string') {\n method = target[method];\n }\n\n var stack = this.DEBUG ? new Error().stack : undefined,\n args = arguments.length > 3 ? slice.call(arguments, 3) : undefined;\n if (!this.currentInstance) { createAutorun(this); }\n return this.currentInstance.schedule(queueName, target, method, args, true, stack);\n },\n\n setTimeout: function() {\n var args = slice.call(arguments);\n var length = args.length;\n var method, wait, target;\n var self = this;\n var methodOrTarget, methodOrWait, methodOrArgs;\n\n if (length === 0) {\n return;\n } else if (length === 1) {\n method = args.shift();\n wait = 0;\n } else if (length === 2) {\n methodOrTarget = args[0];\n methodOrWait = args[1];\n\n if (typeof methodOrWait === 'function' || typeof methodOrTarget[methodOrWait] === 'function') {\n target = args.shift();\n method = args.shift();\n wait = 0;\n } else if (isCoercableNumber(methodOrWait)) {\n method = args.shift();\n wait = args.shift();\n } else {\n method = args.shift();\n wait = 0;\n }\n } else {\n var last = args[args.length - 1];\n\n if (isCoercableNumber(last)) {\n wait = args.pop();\n }\n\n methodOrTarget = args[0];\n methodOrArgs = args[1];\n\n if (typeof methodOrArgs === 'function' || (typeof methodOrArgs === 'string' &&\n methodOrTarget !== null &&\n methodOrArgs in methodOrTarget)) {\n target = args.shift();\n method = args.shift();\n } else {\n method = args.shift();\n }\n }\n\n var executeAt = (+new Date()) + parseInt(wait, 10);\n\n if (typeof method === 'string') {\n method = target[method];\n }\n\n function fn() {\n method.apply(target, args);\n }\n\n // find position to insert - TODO: binary search\n var i, l;\n for (i = 0, l = timers.length; i < l; i += 2) {\n if (executeAt < timers[i]) { break; }\n }\n\n timers.splice(i, 0, executeAt, fn);\n\n if (laterTimer && laterTimerExpiresAt < executeAt) { return fn; }\n\n if (laterTimer) {\n clearTimeout(laterTimer);\n laterTimer = null;\n }\n laterTimer = global.setTimeout(function() {\n executeTimers(self);\n laterTimer = null;\n laterTimerExpiresAt = null;\n }, wait);\n laterTimerExpiresAt = executeAt;\n\n return fn;\n },\n\n throttle: function(target, method /* , args, wait */) {\n var self = this,\n args = arguments,\n wait = parseInt(pop.call(args), 10),\n throttler;\n\n for (var i = 0, l = throttlers.length; i < l; i++) {\n throttler = throttlers[i];\n if (throttler[0] === target && throttler[1] === method) { return; } // do nothing\n }\n\n var timer = global.setTimeout(function() {\n self.run.apply(self, args);\n\n // remove throttler\n var index = -1;\n for (var i = 0, l = throttlers.length; i < l; i++) {\n throttler = throttlers[i];\n if (throttler[0] === target && throttler[1] === method) {\n index = i;\n break;\n }\n }\n\n if (index > -1) { throttlers.splice(index, 1); }\n }, wait);\n\n throttlers.push([target, method, timer]);\n },\n\n debounce: function(target, method /* , args, wait, [immediate] */) {\n var self = this,\n args = arguments,\n immediate = pop.call(args),\n wait,\n index,\n debouncee;\n\n if (typeof immediate === \"number\" || typeof immediate === \"string\") {\n wait = immediate;\n immediate = false;\n } else {\n wait = pop.call(args);\n }\n\n wait = parseInt(wait, 10);\n // Remove debouncee\n index = findDebouncee(target, method);\n\n if (index !== -1) {\n debouncee = debouncees[index];\n debouncees.splice(index, 1);\n clearTimeout(debouncee[2]);\n }\n\n var timer = global.setTimeout(function() {\n if (!immediate) {\n self.run.apply(self, args);\n }\n index = findDebouncee(target, method);\n if (index) {\n debouncees.splice(index, 1);\n }\n }, wait);\n\n if (immediate && index === -1) {\n self.run.apply(self, args);\n }\n\n debouncees.push([target, method, timer]);\n },\n\n cancelTimers: function() {\n var i, len;\n\n for (i = 0, len = throttlers.length; i < len; i++) {\n clearTimeout(throttlers[i][2]);\n }\n throttlers = [];\n\n for (i = 0, len = debouncees.length; i < len; i++) {\n clearTimeout(debouncees[i][2]);\n }\n debouncees = [];\n\n if (laterTimer) {\n clearTimeout(laterTimer);\n laterTimer = null;\n }\n timers = [];\n\n if (autorun) {\n clearTimeout(autorun);\n autorun = null;\n }\n },\n\n hasTimers: function() {\n return !!timers.length || autorun;\n },\n\n cancel: function(timer) {\n if (timer && typeof timer === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce\n return timer.queue.cancel(timer);\n } else if (typeof timer === 'function') { // we're cancelling a setTimeout\n for (var i = 0, l = timers.length; i < l; i += 2) {\n if (timers[i + 1] === timer) {\n timers.splice(i, 2); // remove the two elements\n return true;\n }\n }\n } else {\n return; // timer was null or not a timer\n }\n }\n };\n\n Backburner.prototype.schedule = Backburner.prototype.defer;\n Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce;\n Backburner.prototype.later = Backburner.prototype.setTimeout;\n\n function createAutorun(backburner) {\n backburner.begin();\n autorun = global.setTimeout(function() {\n autorun = null;\n backburner.end();\n });\n }\n\n function executeTimers(self) {\n var now = +new Date(),\n time, fns, i, l;\n\n self.run(function() {\n // TODO: binary search\n for (i = 0, l = timers.length; i < l; i += 2) {\n time = timers[i];\n if (time > now) { break; }\n }\n\n fns = timers.splice(0, i);\n\n for (i = 1, l = fns.length; i < l; i += 2) {\n self.schedule(self.options.defaultQueue, null, fns[i]);\n }\n });\n\n if (timers.length) {\n laterTimer = global.setTimeout(function() {\n executeTimers(self);\n laterTimer = null;\n laterTimerExpiresAt = null;\n }, timers[0] - now);\n laterTimerExpiresAt = timers[0];\n }\n }\n\n function findDebouncee(target, method) {\n var debouncee,\n index = -1;\n\n for (var i = 0, l = debouncees.length; i < l; i++) {\n debouncee = debouncees[i];\n if (debouncee[0] === target && debouncee[1] === method) {\n index = i;\n break;\n }\n }\n\n return index;\n }\n\n\n __exports__.Backburner = Backburner;\n });\n\n})();\n//@ sourceURL=ember-metal/vendor/backburner");minispade.register('ember-metal/watch_key', "(function() {minispade.require('ember-metal/utils');\nminispade.require('ember-metal/platform');\n\nvar metaFor = Ember.meta, // utils.js\n typeOf = Ember.typeOf, // utils.js\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n o_defineProperty = Ember.platform.defineProperty;\n\nEmber.watchKey = function(obj, keyName) {\n // can't watch length on Array - it is special...\n if (keyName === 'length' && typeOf(obj) === 'array') { return; }\n\n var m = metaFor(obj), watching = m.watching;\n\n // activate watching first time\n if (!watching[keyName]) {\n watching[keyName] = 1;\n\n if ('function' === typeof obj.willWatchProperty) {\n obj.willWatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n m.values[keyName] = obj[keyName];\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n set: Ember.MANDATORY_SETTER_FUNCTION,\n get: Ember.DEFAULT_GETTER_FUNCTION(keyName)\n });\n }\n } else {\n watching[keyName] = (watching[keyName] || 0) + 1;\n }\n};\n\n\nEmber.unwatchKey = function(obj, keyName) {\n var m = metaFor(obj), watching = m.watching;\n\n if (watching[keyName] === 1) {\n watching[keyName] = 0;\n\n if ('function' === typeof obj.didUnwatchProperty) {\n obj.didUnwatchProperty(keyName);\n }\n\n if (MANDATORY_SETTER && keyName in obj) {\n o_defineProperty(obj, keyName, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: m.values[keyName]\n });\n delete m.values[keyName];\n }\n } else if (watching[keyName] > 1) {\n watching[keyName]--;\n }\n};\n\n})();\n//@ sourceURL=ember-metal/watch_key");minispade.register('ember-metal/watch_path', "(function() {minispade.require('ember-metal/utils');\nminispade.require('ember-metal/chains');\n\nvar metaFor = Ember.meta, // utils.js\n typeOf = Ember.typeOf, // utils.js\n ChainNode = Ember._ChainNode; // chains.js\n\n// get the chains for the current object. If the current object has\n// chains inherited from the proto they will be cloned and reconfigured for\n// the current object.\nfunction chainsFor(obj) {\n var m = metaFor(obj), ret = m.chains;\n if (!ret) {\n ret = m.chains = new ChainNode(null, null, obj);\n } else if (ret.value() !== obj) {\n ret = m.chains = ret.copy(obj);\n }\n return ret;\n}\n\nEmber.watchPath = function(obj, keyPath) {\n // can't watch length on Array - it is special...\n if (keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n var m = metaFor(obj), watching = m.watching;\n\n if (!watching[keyPath]) { // activate watching first time\n watching[keyPath] = 1;\n chainsFor(obj).add(keyPath);\n } else {\n watching[keyPath] = (watching[keyPath] || 0) + 1;\n }\n};\n\nEmber.unwatchPath = function(obj, keyPath) {\n var m = metaFor(obj), watching = m.watching;\n\n if (watching[keyPath] === 1) {\n watching[keyPath] = 0;\n chainsFor(obj).remove(keyPath);\n } else if (watching[keyPath] > 1) {\n watching[keyPath]--;\n }\n};\n})();\n//@ sourceURL=ember-metal/watch_path");minispade.register('ember-metal/watching', "(function() {minispade.require('ember-metal/core');\nminispade.require('ember-metal/platform');\nminispade.require('ember-metal/utils');\nminispade.require('ember-metal/expand_properties');\nminispade.require('ember-metal/property_get');\nminispade.require('ember-metal/properties');\nminispade.require('ember-metal/watch_key');\nminispade.require('ember-metal/watch_path');\n\n/**\n@module ember-metal\n*/\n\nvar metaFor = Ember.meta, // utils.js\n GUID_KEY = Ember.GUID_KEY, // utils.js\n META_KEY = Ember.META_KEY, // utils.js\n removeChainWatcher = Ember.removeChainWatcher,\n watchKey = Ember.watchKey, // watch_key.js\n unwatchKey = Ember.unwatchKey,\n watchPath = Ember.watchPath, // watch_path.js\n unwatchPath = Ember.unwatchPath,\n typeOf = Ember.typeOf, // utils.js\n generateGuid = Ember.generateGuid,\n IS_PATH = /[\\.\\*]/;\n\nif (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n var expandProperties = Ember.expandProperties;\n}\n\n// returns true if the passed path is just a keyName\nfunction isKeyName(path) {\n return path==='*' || !IS_PATH.test(path);\n}\n\n/**\n @private\n\n Starts watching a property on an object. Whenever the property changes,\n invokes `Ember.propertyWillChange` and `Ember.propertyDidChange`. This is the\n primitive used by observers and dependent keys; usually you will never call\n this method directly but instead use higher level methods like\n `Ember.addObserver()`\n\n @method watch\n @for Ember\n @param obj\n @param {String} keyName\n*/\nEmber.watch = function(obj, _keyPath) {\n // can't watch length on Array - it is special...\n if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_keyPath, function (keyPath) {\n if (isKeyName(keyPath)) {\n watchKey(obj, keyPath);\n } else {\n watchPath(obj, keyPath);\n }\n });\n } else {\n if (isKeyName(_keyPath)) {\n watchKey(obj, _keyPath);\n } else {\n watchPath(obj, _keyPath);\n }\n }\n};\n\nEmber.isWatching = function isWatching(obj, key) {\n var meta = obj[META_KEY];\n return (meta && meta.watching[key]) > 0;\n};\n\nEmber.watch.flushPending = Ember.flushPendingChains;\n\nEmber.unwatch = function(obj, _keyPath) {\n // can't watch length on Array - it is special...\n if (_keyPath === 'length' && typeOf(obj) === 'array') { return; }\n\n if (Ember.FEATURES.isEnabled('propertyBraceExpansion')) {\n expandProperties(_keyPath, function (keyPath) {\n if (isKeyName(keyPath)) {\n unwatchKey(obj, keyPath);\n } else {\n unwatchPath(obj, keyPath);\n }\n });\n } else {\n if (isKeyName(_keyPath)) {\n unwatchKey(obj, _keyPath);\n } else {\n unwatchPath(obj, _keyPath);\n }\n }\n};\n\n/**\n @private\n\n Call on an object when you first beget it from another object. This will\n setup any chained watchers on the object instance as needed. This method is\n safe to call multiple times.\n\n @method rewatch\n @for Ember\n @param obj\n*/\nEmber.rewatch = function(obj) {\n var m = metaFor(obj, false), chains = m.chains;\n\n // make sure the object has its own guid.\n if (GUID_KEY in obj && !obj.hasOwnProperty(GUID_KEY)) {\n generateGuid(obj);\n }\n\n // make sure any chained watchers update.\n if (chains && chains.value() !== obj) {\n m.chains = chains.copy(obj);\n }\n};\n\nvar NODE_STACK = [];\n\n/**\n Tears down the meta on an object so that it can be garbage collected.\n Multiple calls will have no effect.\n\n @method destroy\n @for Ember\n @param {Object} obj the object to destroy\n @return {void}\n*/\nEmber.destroy = function (obj) {\n var meta = obj[META_KEY], node, nodes, key, nodeObject;\n if (meta) {\n obj[META_KEY] = null;\n // remove chainWatchers to remove circular references that would prevent GC\n node = meta.chains;\n if (node) {\n NODE_STACK.push(node);\n // process tree\n while (NODE_STACK.length > 0) {\n node = NODE_STACK.pop();\n // push children\n nodes = node._chains;\n if (nodes) {\n for (key in nodes) {\n if (nodes.hasOwnProperty(key)) {\n NODE_STACK.push(nodes[key]);\n }\n }\n }\n // remove chainWatcher in node object\n if (node._watching) {\n nodeObject = node._object;\n if (nodeObject) {\n removeChainWatcher(nodeObject, node._key, node);\n }\n }\n }\n }\n }\n};\n\n})();\n//@ sourceURL=ember-metal/watching");minispade.register('ember-routing/ext', "(function() {minispade.require('ember-routing/ext/controller');\nminispade.require('ember-routing/ext/view');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\n// Add a new named queue after the 'actions' queue (where RSVP promises\n// resolve), which is used in router transitions to prevent unnecessary\n// loading state entry if all context promises resolve on the \n// 'actions' queue first.\n\nvar queues = Ember.run.queues,\n indexOf = Ember.ArrayPolyfills.indexOf;\nqueues.splice(indexOf.call(queues, 'actions') + 1, 0, 'routerTransitions');\n\n})();\n//@ sourceURL=ember-routing/ext");minispade.register('ember-routing/ext/controller', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.ControllerMixin.reopen({\n /**\n Transition the application into another route. The route may\n be either a single route or route path:\n\n ```javascript\n aController.transitionToRoute('blogPosts');\n aController.transitionToRoute('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n aController.transitionToRoute('blogPost', aPost);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n \n aController.transitionToRoute('blogComment', aPost, aComment);\n ```\n\n See also 'replaceRoute'.\n\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n @for Ember.ControllerMixin\n @method transitionToRoute\n */\n transitionToRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.transitionToRoute || target.transitionTo;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method transitionTo\n */\n transitionTo: function() {\n Ember.deprecate(\"transitionTo is deprecated. Please use transitionToRoute.\");\n return this.transitionToRoute.apply(this, arguments);\n },\n\n /**\n Transition into another route while replacing the current URL, if possible.\n This will replace the current history entry instead of adding a new one. \n Beside that, it is identical to `transitionToRoute` in all other respects.\n\n ```javascript\n aController.replaceRoute('blogPosts');\n aController.replaceRoute('blogPosts.recentEntries');\n ```\n\n Optionally supply a model for the route in question. The model\n will be serialized into the URL using the `serialize` hook of\n the route:\n\n ```javascript\n aController.replaceRoute('blogPost', aPost);\n ```\n\n Multiple models will be applied last to first recursively up the\n resource tree.\n\n ```javascript\n\n this.resource('blogPost', {path:':blogPostId'}, function(){\n this.resource('blogComment', {path: ':blogCommentId'});\n });\n \n aController.replaceRoute('blogComment', aPost, aComment);\n ```\n\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n @for Ember.ControllerMixin\n @method replaceRoute\n */\n replaceRoute: function() {\n // target may be either another controller or a router\n var target = get(this, 'target'),\n method = target.replaceRoute || target.replaceWith;\n return method.apply(target, arguments);\n },\n\n /**\n @deprecated\n @for Ember.ControllerMixin\n @method replaceWith\n */\n replaceWith: function() {\n Ember.deprecate(\"replaceWith is deprecated. Please use replaceRoute.\");\n return this.replaceRoute.apply(this, arguments);\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/controller");minispade.register('ember-routing/ext/view', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.View.reopen({\n\n /**\n Sets the private `_outlets` object on the view.\n\n @method init\n */\n init: function() {\n set(this, '_outlets', {});\n this._super();\n },\n\n /**\n Manually fill any of a view's `{{outlet}}` areas with the\n supplied view.\n\n Example\n\n ```javascript\n var MyView = Ember.View.extend({\n template: Ember.Handlebars.compile('Child view: {{outlet \"main\"}} ')\n });\n var myView = MyView.create();\n myView.appendTo('body');\n // The html for myView now looks like:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n\n myView.connectOutlet('main', Ember.View.extend({\n template: Ember.Handlebars.compile('<h1>Foo</h1> ')\n }));\n // The html for myView now looks like:\n // <div id=\"ember228\" class=\"ember-view\">Child view:\n // <div id=\"ember234\" class=\"ember-view\"><h1>Foo</h1> </div>\n // </div>\n ```\n @method connectOutlet\n @param {String} outletName A unique name for the outlet\n @param {Object} view An Ember.View\n */\n connectOutlet: function(outletName, view) {\n if (this._pendingDisconnections) {\n delete this._pendingDisconnections[outletName];\n }\n\n if (this._hasEquivalentView(outletName, view)) {\n view.destroy();\n return;\n }\n\n var outlets = get(this, '_outlets'),\n container = get(this, 'container'),\n router = container && container.lookup('router:main'),\n renderedName = get(view, 'renderedName');\n\n set(outlets, outletName, view);\n\n if (router && renderedName) {\n router._connectActiveView(renderedName, view);\n }\n },\n\n /**\n @private\n\n Determines if the view has already been created by checking if\n the view has the same constructor, template, and context as the\n view in the `_outlets` object.\n\n @method _hasEquivalentView\n @param {String} outletName The name of the outlet we are checking\n @param {Object} view An Ember.View\n @return {Boolean}\n */\n _hasEquivalentView: function(outletName, view) {\n var existingView = get(this, '_outlets.'+outletName);\n return existingView &&\n existingView.constructor === view.constructor &&\n existingView.get('template') === view.get('template') &&\n existingView.get('context') === view.get('context');\n },\n\n /**\n Removes an outlet from the view.\n\n Example\n\n ```javascript\n var MyView = Ember.View.extend({\n template: Ember.Handlebars.compile('Child view: {{outlet \"main\"}} ')\n });\n var myView = MyView.create();\n myView.appendTo('body');\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n\n myView.connectOutlet('main', Ember.View.extend({\n template: Ember.Handlebars.compile('<h1>Foo</h1> ')\n }));\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view:\n // <div id=\"ember234\" class=\"ember-view\"><h1>Foo</h1> </div>\n // </div>\n\n myView.disconnectOutlet('main');\n // myView's html:\n // <div id=\"ember228\" class=\"ember-view\">Child view: </div>\n ```\n\n @method disconnectOutlet\n @param {String} outletName The name of the outlet to be removed\n */\n disconnectOutlet: function(outletName) {\n if (!this._pendingDisconnections) {\n this._pendingDisconnections = {};\n }\n this._pendingDisconnections[outletName] = true;\n Ember.run.once(this, '_finishDisconnections');\n },\n\n /**\n @private\n\n Gets an outlet that is pending disconnection and then\n nullifys the object on the `_outlet` object.\n\n @method _finishDisconnections\n */\n _finishDisconnections: function() {\n var outlets = get(this, '_outlets');\n var pendingDisconnections = this._pendingDisconnections;\n this._pendingDisconnections = null;\n\n for (var outletName in pendingDisconnections) {\n set(outlets, outletName, null);\n }\n }\n});\n\n})();\n//@ sourceURL=ember-routing/ext/view");minispade.register('ember-routing/helpers', "(function() {minispade.require('ember-routing/helpers/shared');\nminispade.require('ember-routing/helpers/link_to');\nminispade.require('ember-routing/helpers/outlet');\nminispade.require('ember-routing/helpers/render');\nminispade.require('ember-routing/helpers/action');\nminispade.require('ember-routing/helpers/control');\n\n})();\n//@ sourceURL=ember-routing/helpers");minispade.register('ember-routing/helpers/action', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\nminispade.require('ember-handlebars/ext');\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n var EmberHandlebars = Ember.Handlebars,\n handlebarsGet = EmberHandlebars.get,\n SafeString = EmberHandlebars.SafeString,\n forEach = Ember.ArrayPolyfills.forEach,\n get = Ember.get,\n a_slice = Array.prototype.slice;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n var types = options.options.types.slice(1),\n data = options.options.data;\n\n return ret.concat(resolveParams(options.context, options.params, { types: types, data: data }));\n }\n\n var ActionHelper = EmberHandlebars.ActionHelper = {\n registeredActions: {}\n };\n\n var keys = [\"alt\", \"shift\", \"meta\", \"ctrl\"];\n\n var isAllowedClick = function(event, allowedKeys) {\n if (typeof allowedKeys === \"undefined\") {\n return isSimpleClick(event);\n }\n\n if (allowedKeys.indexOf(\"any\") >= 0) {\n return true;\n }\n\n var allowed = true;\n\n forEach.call(keys, function(key) {\n if (event[key + \"Key\"] && allowedKeys.indexOf(key) === -1) {\n allowed = false;\n }\n });\n\n return allowed;\n };\n\n ActionHelper.registerAction = function(actionName, options, allowedKeys) {\n var actionId = (++Ember.uuid).toString();\n\n ActionHelper.registeredActions[actionId] = {\n eventName: options.eventName,\n handler: function(event) {\n if (!isAllowedClick(event, allowedKeys)) { return true; }\n\n event.preventDefault();\n\n if (options.bubbles === false) {\n event.stopPropagation();\n }\n\n var target = options.target;\n\n if (target.target) {\n target = handlebarsGet(target.root, target.target, target.options);\n } else {\n target = target.root;\n }\n\n Ember.run(function() {\n if (target.send) {\n target.send.apply(target, args(options.parameters, actionName));\n } else {\n Ember.assert(\"The action '\" + actionName + \"' did not exist on \" + target, typeof target[actionName] === 'function');\n target[actionName].apply(target, args(options.parameters));\n }\n });\n }\n };\n\n options.view.on('willClearRender', function() {\n delete ActionHelper.registeredActions[actionId];\n });\n\n return actionId;\n };\n\n /**\n The `{{action}}` helper registers an HTML element within a template for DOM\n event handling and forwards that interaction to the templates's controller\n or supplied `target` option (see 'Specifying a Target').\n\n If the controller does not implement the event, the event is sent\n to the current route, and it bubbles up the route hierarchy from there.\n\n User interaction with that element will invoke the supplied action name on\n the appropriate target.\n\n Given the following application Handlebars template on the page\n\n ```handlebars\n <div {{action 'anActionName'}}>\n click me\n </div>\n ```\n\n And application code\n\n ```javascript\n App.ApplicationController = Ember.Controller.extend({\n actions: {\n anActionName: function() {\n \n } \n }\n });\n ```\n\n Will result in the following rendered HTML\n\n ```html\n <div class=\"ember-view\">\n <div data-ember-action=\"1\">\n click me\n </div>\n </div>\n ```\n\n Clicking \"click me\" will trigger the `anActionName` action of the\n `App.ApplicationController`. In this case, no additional parameters will be passed.\n\n If you provide additional parameters to the helper:\n\n ```handlebars\n <button {{action 'edit' post}}>Edit</button>\n ```\n\n Those parameters will be passed along as arguments to the JavaScript\n function implementing the action.\n\n ### Event Propagation\n\n Events triggered through the action helper will automatically have\n `.preventDefault()` called on them. You do not need to do so in your event\n handlers.\n\n To also disable bubbling, pass `bubbles=false` to the helper:\n\n ```handlebars\n <button {{action 'edit' post bubbles=false}}>Edit</button>\n ```\n\n If you need the default handler to trigger you should either register your\n own event handler, or use event methods on your view class. See [Ember.View](/api/classes/Ember.View.html)\n 'Responding to Browser Events' for more information.\n\n ### Specifying DOM event type\n\n By default the `{{action}}` helper registers for DOM `click` events. You can\n supply an `on` option to the helper to specify a different DOM event name:\n\n ```handlebars\n <div {{action \"anActionName\" on=\"doubleClick\"}}>\n click me\n </div>\n ```\n\n See `Ember.View` 'Responding to Browser Events' for a list of\n acceptable DOM event names.\n\n NOTE: Because `{{action}}` depends on Ember's event dispatch system it will\n only function if an `Ember.EventDispatcher` instance is available. An\n `Ember.EventDispatcher` instance will be created when a new `Ember.Application`\n is created. Having an instance of `Ember.Application` will satisfy this\n requirement.\n\n ### Specifying whitelisted modifier keys\n\n By default the `{{action}}` helper will ignore click event with pressed modifier\n keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.\n\n ```handlebars\n <div {{action \"anActionName\" allowedKeys=\"alt\"}}>\n click me\n </div>\n ```\n\n This way the `{{action}}` will fire when clicking with the alt key pressed down.\n\n Alternatively, supply \"any\" to the `allowedKeys` option to accept any combination of modifier keys.\n\n ```handlebars\n <div {{action \"anActionName\" allowedKeys=\"any\"}}>\n click me with any key pressed\n </div>\n ```\n\n ### Specifying a Target\n\n There are several possible target objects for `{{action}}` helpers:\n\n In a typical Ember application, where views are managed through use of the\n `{{outlet}}` helper, actions will bubble to the current controller, then\n to the current route, and then up the route hierarchy.\n\n Alternatively, a `target` option can be provided to the helper to change\n which object will receive the method call. This option must be a path\n to an object, accessible in the current context:\n\n ```handlebars\n {{! the application template }}\n <div {{action \"anActionName\" target=view}}>\n click me\n </div>\n ```\n\n ```javascript\n App.ApplicationView = Ember.View.extend({\n actions: {\n anActionName: function(){}\n }\n });\n\n ```\n\n ### Additional Parameters\n\n You may specify additional parameters to the `{{action}}` helper. These\n parameters are passed along as the arguments to the JavaScript function\n implementing the action.\n\n ```handlebars\n {{#each person in people}}\n <div {{action \"edit\" person}}>\n click me\n </div>\n {{/each}}\n ```\n\n Clicking \"click me\" will trigger the `edit` method on the current controller\n with the value of `person` as a parameter.\n\n @method action\n @for Ember.Handlebars.helpers\n @param {String} actionName\n @param {Object} [context]*\n @param {Hash} options\n */\n EmberHandlebars.registerHelper('action', function(actionName) {\n var options = arguments[arguments.length - 1],\n contexts = a_slice.call(arguments, 1, -1);\n\n var hash = options.hash,\n controller;\n\n // create a hash to pass along to registerAction\n var action = {\n eventName: hash.on || \"click\"\n };\n\n action.parameters = {\n context: this,\n options: options,\n params: contexts\n };\n\n action.view = options.data.view;\n\n var root, target;\n\n if (hash.target) {\n root = this;\n target = hash.target;\n } else if (controller = options.data.keywords.controller) {\n root = controller;\n }\n\n action.target = { root: root, target: target, options: options };\n action.bubbles = hash.bubbles;\n\n var actionId = ActionHelper.registerAction(actionName, action, hash.allowedKeys);\n return new SafeString('data-ember-action=\"' + actionId + '\"');\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/action");minispade.register('ember-routing/helpers/control', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nif (Ember.ENV.EXPERIMENTAL_CONTROL_HELPER) {\n var get = Ember.get, set = Ember.set;\n\n /**\n `{{control}}` works like render, except it uses a new controller instance for every call, instead of reusing the singleton controller.\n\n The control helper is currently under development and is considered experimental.\n To enable it, set `ENV.EXPERIMENTAL_CONTROL_HELPER = true` before requiring Ember.\n\n For example if you had this `author` template.\n\n ```handlebars\n<div class=\"author\">\n Written by {{firstName}} {{lastName}}.\n Total Posts: {{postCount}}\n</div>\n ```\n\n You could render it inside the `post` template using the `control` helper.\n\n ```handlebars\n<div class=\"post\">\n <h1>{{title}}</h1>\n <div>{{body}}</div>\n {{control \"author\" author}}\n</div>\n ```\n\n @method control\n @for Ember.Handlebars.helpers\n @param {String} path\n @param {String} modelPath\n @param {Hash} options\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('control', function(path, modelPath, options) {\n if (arguments.length === 2) {\n options = modelPath;\n modelPath = undefined;\n }\n\n var model;\n\n if (modelPath) {\n model = Ember.Handlebars.get(this, modelPath, options);\n }\n\n var controller = options.data.keywords.controller,\n view = options.data.keywords.view,\n children = get(controller, '_childContainers'),\n controlID = options.hash.controlID,\n container, subContainer;\n\n if (children.hasOwnProperty(controlID)) {\n subContainer = children[controlID];\n } else {\n container = get(controller, 'container'),\n subContainer = container.child();\n children[controlID] = subContainer;\n }\n\n var normalizedPath = path.replace(/\\//g, '.');\n\n var childView = subContainer.lookup('view:' + normalizedPath) || subContainer.lookup('view:default'),\n childController = subContainer.lookup('controller:' + normalizedPath),\n childTemplate = subContainer.lookup('template:' + path);\n\n Ember.assert(\"Could not find controller for path: \" + normalizedPath, childController);\n Ember.assert(\"Could not find view for path: \" + normalizedPath, childView);\n\n set(childController, 'target', controller);\n set(childController, 'model', model);\n\n options.hash.template = childTemplate;\n options.hash.controller = childController;\n\n function observer() {\n var model = Ember.Handlebars.get(this, modelPath, options);\n set(childController, 'model', model);\n childView.rerender();\n }\n\n if (modelPath) {\n Ember.addObserver(this, modelPath, observer);\n childView.one('willDestroyElement', this, function() {\n Ember.removeObserver(this, modelPath, observer);\n });\n }\n\n Ember.Handlebars.helpers.view.call(this, childView, options);\n });\n}\n\n})();\n//@ sourceURL=ember-routing/helpers/control");minispade.register('ember-routing/helpers/link_to', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n var resolveParams = Ember.Router.resolveParams,\n resolvePaths = Ember.Router.resolvePaths,\n isSimpleClick = Ember.ViewUtils.isSimpleClick;\n\n function fullRouteName(router, name) {\n if (!router.hasRoute(name)) {\n name = name + '.index';\n }\n\n return name;\n }\n\n function getResolvedPaths(options) {\n\n var types = options.options.types,\n data = options.options.data;\n\n return resolvePaths(options.context, options.params, { types: types, data: data });\n }\n\n /**\n `Ember.LinkView` renders an element whose `click` event triggers a\n transition of the application's instance of `Ember.Router` to\n a supplied route by name.\n\n Instances of `LinkView` will most likely be created through\n the `link-to` Handlebars helper, but properties of this class\n can be overridden to customize application-wide behavior.\n\n @class LinkView\n @namespace Ember\n @extends Ember.View\n @see {Handlebars.helpers.link-to}\n **/\n var LinkView = Ember.LinkView = Ember.View.extend({\n tagName: 'a',\n currentWhen: null,\n\n /**\n Sets the `title` attribute of the `LinkView`'s HTML element.\n\n @property title\n @default null\n **/\n title: null,\n\n /**\n Sets the `rel` attribute of the `LinkView`'s HTML element.\n\n @property rel\n @default null\n **/\n rel: null,\n\n /**\n The CSS class to apply to `LinkView`'s element when its `active`\n property is `true`.\n\n @property activeClass\n @type String\n @default active\n **/\n activeClass: 'active',\n\n /**\n The CSS class to apply to `LinkView`'s element when its `loading`\n property is `true`.\n\n @property loadingClass\n @type String\n @default loading\n **/\n loadingClass: 'loading',\n\n /**\n The CSS class to apply to a `LinkView`'s element when its `disabled`\n property is `true`.\n\n @property disabledClass\n @type String\n @default disabled\n **/\n disabledClass: 'disabled',\n _isDisabled: false,\n\n /**\n Determines whether the `LinkView` will trigger routing via\n the `replaceWith` routing strategy.\n\n @property replace\n @type Boolean\n @default false\n **/\n replace: false,\n\n /**\n By default the `{{link-to}}` helper will bind to the `href` and\n `title` attributes. It's discourage that you override these defaults,\n however you can push onto the array if needed.\n\n @property attributeBindings\n @type Array | String\n @default ['href', 'title', 'rel']\n **/\n attributeBindings: ['href', 'title', 'rel'],\n\n /**\n By default the `{{link-to}}` helper will bind to the `active`, `loading`, and\n `disabled` classes. It is discouraged to override these directly.\n\n @property classNameBindings\n @type Array\n @default ['active', 'loading', 'disabled']\n **/\n classNameBindings: ['active', 'loading', 'disabled'],\n\n /**\n By default the `{{link-to}}` helper responds to the `click` event. You\n can override this globally by setting this property to your custom\n event name.\n\n This is particularly useful on mobile when one wants to avoid the 300ms\n click delay using some sort of custom `tap` event.\n\n @property eventName\n @type String\n @default click\n */\n eventName: 'click',\n\n // this is doc'ed here so it shows up in the events\n // section of the API documentation, which is where\n // people will likely go looking for it.\n /**\n Triggers the `LinkView`'s routing behavior. If\n `eventName` is changed to a value other than `click`\n the routing behavior will trigger on that custom event\n instead.\n\n @event click\n **/\n\n /**\n An overridable method called when LinkView objects are instantiated.\n\n Example:\n\n ```javascript\n App.MyLinkView = Ember.LinkView.extend({\n init: function() {\n this._super();\n Ember.Logger.log('Event is ' + this.get('eventName'));\n }\n });\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n @method init\n */\n init: function() {\n this._super.apply(this, arguments);\n\n // Map desired event name to invoke function\n var eventName = get(this, 'eventName');\n this.on(eventName, this, this._invoke);\n\n var helperParameters = this.parameters,\n templateContext = helperParameters.context,\n paths = getResolvedPaths(helperParameters),\n length = paths.length,\n path, i, normalizedPath;\n\n if (Ember.FEATURES.isEnabled('link-to-non-block')) {\n var linkTextPath = helperParameters.options.linkTextPath;\n if (linkTextPath) {\n normalizedPath = Ember.Handlebars.normalizePath(templateContext, linkTextPath, helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this.rerender);\n }\n }\n\n for(i=0; i < length; i++) {\n path = paths[i];\n if (null === path) {\n // A literal value was provided, not a path, so nothing to observe.\n continue;\n }\n\n normalizedPath = Ember.Handlebars.normalizePath(templateContext, path, helperParameters.options.data);\n this.registerObserver(normalizedPath.root, normalizedPath.path, this, this._paramsChanged);\n }\n\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n var queryParams = get(this, '_potentialQueryParams') || [];\n\n for(i=0; i < queryParams.length; i++) {\n this.registerObserver(this, queryParams[i], this, this._queryParamsChanged);\n }\n }\n },\n\n /**\n @private\n\n This method is invoked by observers installed during `init` that fire\n whenever the params change\n @method _paramsChanged\n */\n _paramsChanged: function() {\n this.notifyPropertyChange('resolvedParams');\n },\n\n\n /**\n @private\n\n This method is invoked by observers installed during `init` that fire\n whenever the query params change\n */\n _queryParamsChanged: function (object, path) {\n this.notifyPropertyChange('queryParams');\n },\n\n\n /**\n @private\n\n Even though this isn't a virtual view, we want to treat it as if it is\n so that you can access the parent with {{view.prop}}\n\n @method concreteView\n **/\n concreteView: Ember.computed(function() {\n return get(this, 'parentView');\n }).property('parentView'),\n\n /**\n\n Accessed as a classname binding to apply the `LinkView`'s `disabledClass`\n CSS `class` to the element when the link is disabled.\n\n When `true` interactions with the element will not trigger route changes.\n @property disabled\n */\n disabled: Ember.computed(function(key, value) {\n if (value !== undefined) { this.set('_isDisabled', value); }\n\n return value ? get(this, 'disabledClass') : false;\n }),\n\n /**\n Accessed as a classname binding to apply the `LinkView`'s `activeClass`\n CSS `class` to the element when the link is active.\n\n A `LinkView` is considered active when its `currentWhen` property is `true`\n or the application's current route is the route the `LinkView` would trigger\n transitions into.\n\n @property active\n **/\n active: Ember.computed(function() {\n if (get(this, 'loading')) { return false; }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs'),\n contexts = routeArgs.slice(1),\n resolvedParams = get(this, 'resolvedParams'),\n currentWhen = this.currentWhen || resolvedParams[0],\n currentWithIndex = currentWhen + '.index',\n isActive = router.isActive.apply(router, [currentWhen].concat(contexts)) ||\n router.isActive.apply(router, [currentWithIndex].concat(contexts));\n\n if (isActive) { return get(this, 'activeClass'); }\n }).property('resolvedParams', 'routeArgs', 'router.url'),\n\n /**\n Accessed as a classname binding to apply the `LinkView`'s `loadingClass`\n CSS `class` to the element when the link is loading.\n\n A `LinkView` is considered loading when it has at least one\n parameter whose value is currently null or undefined. During\n this time, clicking the link will perform no transition and\n emit a warning that the link is still in a loading state.\n\n @property loading\n **/\n loading: Ember.computed(function() {\n if (!get(this, 'routeArgs')) { return get(this, 'loadingClass'); }\n }).property('routeArgs'),\n\n /**\n @private\n\n Returns the application's main router from the container.\n\n @property router\n **/\n router: Ember.computed(function() {\n return get(this, 'controller').container.lookup('router:main');\n }),\n\n /**\n @private\n\n Event handler that invokes the link, activating the associated route.\n\n @method _invoke\n @param {Event} event\n */\n _invoke: function(event) {\n if (!isSimpleClick(event)) { return true; }\n\n event.preventDefault();\n if (this.bubbles === false) { event.stopPropagation(); }\n\n if (get(this, '_isDisabled')) { return false; }\n\n if (get(this, 'loading')) {\n Ember.Logger.warn(\"This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.\");\n return false;\n }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs');\n\n if (get(this, 'replace')) {\n router.replaceWith.apply(router, routeArgs);\n } else {\n router.transitionTo.apply(router, routeArgs);\n }\n },\n\n /**\n @private\n\n Computed property that returns the resolved parameters.\n\n @property\n @return {Array}\n */\n resolvedParams: Ember.computed(function() {\n var parameters = this.parameters,\n options = parameters.options,\n types = options.types,\n data = options.data;\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n if (parameters.params.length === 0) {\n var appController = this.container.lookup('controller:application');\n return [get(appController, 'currentRouteName')];\n } else {\n return resolveParams(parameters.context, parameters.params, { types: types, data: data });\n }\n }\n\n // Original implementation if query params not enabled\n return resolveParams(parameters.context, parameters.params, { types: types, data: data });\n }).property(),\n\n /**\n @private\n\n Computed property that returns the current route name and\n any dynamic segments.\n\n @property\n @return {Array} An array with the route name and any dynamic segments\n */\n routeArgs: Ember.computed(function() {\n var resolvedParams = get(this, 'resolvedParams').slice(0),\n router = get(this, 'router'),\n namedRoute = resolvedParams[0];\n\n if (!namedRoute) { return; }\n\n namedRoute = fullRouteName(router, namedRoute);\n resolvedParams[0] = namedRoute;\n\n Ember.assert(fmt(\"The attempt to link-to route '%@' failed. The router did not find '%@' in its possible routes: '%@'\", [namedRoute, namedRoute, Ember.keys(router.router.recognizer.names).join(\"', '\")]), router.hasRoute(namedRoute));\n\n for (var i = 1, len = resolvedParams.length; i < len; ++i) {\n var param = resolvedParams[i];\n if (param === null || typeof param === 'undefined') {\n // If contexts aren't present, consider the linkView unloaded.\n return;\n }\n }\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n var queryParams = get(this, 'queryParams');\n\n if (queryParams || queryParams === false) { resolvedParams.push({queryParams: queryParams}); }\n }\n\n return resolvedParams;\n }).property('resolvedParams', 'queryParams', 'router.url'),\n\n\n _potentialQueryParams: Ember.computed(function () {\n var namedRoute = get(this, 'resolvedParams')[0];\n if (!namedRoute) { return null; }\n var router = get(this, 'router');\n\n namedRoute = fullRouteName(router, namedRoute);\n\n return router.router.queryParamsForHandler(namedRoute);\n }).property('resolvedParams'),\n\n queryParams: Ember.computed(function () {\n var self = this,\n queryParams = null,\n allowedQueryParams = get(this, '_potentialQueryParams');\n\n if (!allowedQueryParams) { return null; }\n allowedQueryParams.forEach(function (param) {\n var value = get(self, param);\n if (typeof value !== 'undefined') {\n queryParams = queryParams || {};\n queryParams[param] = value;\n }\n });\n\n\n return queryParams;\n }).property('_potentialQueryParams.[]'),\n\n /**\n Sets the element's `href` attribute to the url for\n the `LinkView`'s targeted route.\n\n If the `LinkView`'s `tagName` is changed to a value other\n than `a`, this property will be ignored.\n\n @property href\n **/\n href: Ember.computed(function() {\n if (get(this, 'tagName') !== 'a') { return; }\n\n var router = get(this, 'router'),\n routeArgs = get(this, 'routeArgs');\n\n return routeArgs ? router.generate.apply(router, routeArgs) : get(this, 'loadingHref');\n }).property('routeArgs'),\n\n /**\n The default href value to use while a link-to is loading.\n Only applies when tagName is 'a'\n\n @property loadingHref\n @type String\n @default #\n */\n loadingHref: '#'\n });\n\n LinkView.toString = function() { return \"LinkView\"; };\n\n /**\n The `{{link-to}}` helper renders a link to the supplied\n `routeName` passing an optionally supplied model to the\n route as its `model` context of the route. The block\n for `{{link-to}}` becomes the innerHTML of the rendered\n element:\n\n ```handlebars\n {{#link-to 'photoGallery'}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos\">\n Great Hamster Photos\n </a>\n ```\n\n ### Supplying a tagName\n By default `{{link-to}}` renders an `<a>` element. This can\n be overridden for a single use of `{{link-to}}` by supplying\n a `tagName` option:\n\n ```handlebars\n {{#link-to 'photoGallery' tagName=\"li\"}}\n Great Hamster Photos\n {{/link-to}}\n ```\n\n ```html\n <li>\n Great Hamster Photos\n </li>\n ```\n\n To override this option for your entire application, see\n \"Overriding Application-wide Defaults\".\n \n ### Disabling the `link-to` helper\n By default `{{link-to}}` is enabled. \n any passed value to `disabled` helper property will disable the `link-to` helper.\n \n static use: the `disabled` option:\n \n ```handlebars\n {{#link-to 'photoGallery' disabled=true}}\n Great Hamster Photos\n {{/link-to}}\n ```\n \n dynamic use: the `disabledWhen` option:\n \n ```handlebars\n {{#link-to 'photoGallery' disabledWhen=controller.someProperty}}\n Great Hamster Photos\n {{/link-to}}\n ```\n \n any passed value to `disabled` will disable it except `undefined`.\n to ensure that only `true` disable the `link-to` helper you can\n override the global behaviour of `Ember.LinkView`.\n \n ```javascript \n Ember.LinkView.reopen({\n disabled: Ember.computed(function(key, value) {\n if (value !== undefined) { \n this.set('_isDisabled', value === true); \n }\n return value === true ? get(this, 'disabledClass') : false;\n })\n });\n ```\n \n see \"Overriding Application-wide Defaults\" for more.\n \n ### Handling `href`\n `{{link-to}}` will use your application's Router to\n fill the element's `href` property with a url that\n matches the path to the supplied `routeName` for your\n routers's configured `Location` scheme, which defaults\n to Ember.HashLocation.\n\n ### Handling current route\n `{{link-to}}` will apply a CSS class name of 'active'\n when the application's current route matches\n the supplied routeName. For example, if the application's\n current route is 'photoGallery.recent' the following\n use of `{{link-to}}`:\n\n ```handlebars\n {{#link-to 'photoGallery.recent'}}\n Great Hamster Photos from the last week\n {{/link-to}}\n ```\n\n will result in\n\n ```html\n <a href=\"/hamster-photos/this-week\" class=\"active\">\n Great Hamster Photos\n </a>\n ```\n\n The CSS class name used for active classes can be customized\n for a single use of `{{link-to}}` by passing an `activeClass`\n option:\n\n ```handlebars\n {{#link-to 'photoGallery.recent' activeClass=\"current-url\"}}\n Great Hamster Photos from the last week\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/this-week\" class=\"current-url\">\n Great Hamster Photos\n </a>\n ```\n\n To override this option for your entire application, see\n \"Overriding Application-wide Defaults\".\n\n ### Supplying a model\n An optional model argument can be used for routes whose\n paths contain dynamic segments. This argument will become\n the model context of the linked route:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n });\n ```\n\n ```handlebars\n {{#link-to 'photoGallery' aPhoto}}\n {{aPhoto.title}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42\">\n Tomster\n </a>\n ```\n\n ### Supplying multiple models\n For deep-linking to route paths that contain multiple\n dynamic segments, multiple model arguments can be used.\n As the router transitions through the route path, each\n supplied model argument will become the context for the\n route with the dynamic segments:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"}, function() {\n this.route(\"comment\", {path: \"comments/:comment_id\"});\n });\n });\n ```\n This argument will become the model context of the linked route:\n\n ```handlebars\n {{#link-to 'photoGallery.comment' aPhoto comment}}\n {{comment.body}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42/comment/718\">\n A+++ would snuggle again.\n </a>\n ```\n\n ### Supplying an explicit dynamic segment value\n If you don't have a model object available to pass to `{{link-to}}`,\n an optional string or integer argument can be passed for routes whose\n paths contain dynamic segments. This argument will become the value\n of the dynamic segment:\n\n ```javascript\n App.Router.map(function() {\n this.resource(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n });\n ```\n\n ```handlebars\n {{#link-to 'photoGallery' aPhotoId}}\n {{aPhoto.title}}\n {{/link-to}}\n ```\n\n ```html\n <a href=\"/hamster-photos/42\">\n Tomster\n </a>\n ```\n\n When transitioning into the linked route, the `model` hook will\n be triggered with parameters including this passed identifier.\n\n ### Overriding attributes\n You can override any given property of the Ember.LinkView\n that is generated by the `{{link-to}}` helper by passing\n key/value pairs, like so:\n\n ```handlebars\n {{#link-to aPhoto tagName='li' title='Following this link will change your life' classNames=['pic', 'sweet']}}\n Uh-mazing!\n {{/link-to}}\n ```\n\n See [Ember.LinkView](/api/classes/Ember.LinkView.html) for a\n complete list of overrideable properties. Be sure to also\n check out inherited properties of `LinkView`.\n\n ### Overriding Application-wide Defaults\n ``{{link-to}}`` creates an instance of Ember.LinkView\n for rendering. To override options for your entire\n application, reopen Ember.LinkView and supply the\n desired values:\n\n ``` javascript\n Ember.LinkView.reopen({\n activeClass: \"is-active\",\n tagName: 'li'\n })\n ```\n\n It is also possible to override the default event in\n this manner:\n\n ``` javascript\n Ember.LinkView.reopen({\n eventName: 'customEventName'\n });\n ```\n\n @method link-to\n @for Ember.Handlebars.helpers\n @param {String} routeName\n @param {Object} [context]*\n @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkView\n @return {String} HTML string\n @see {Ember.LinkView}\n */\n Ember.Handlebars.registerHelper('link-to', function(name) {\n var options = [].slice.call(arguments, -1)[0],\n params = [].slice.call(arguments, 0, -1),\n hash = options.hash;\n\n hash.disabledBinding = hash.disabledWhen;\n\n if (Ember.FEATURES.isEnabled('link-to-non-block')) {\n if (!options.fn) {\n var linkTitle = params.shift();\n var linkType = options.types.shift();\n var context = this;\n if (linkType === 'ID') {\n options.linkTextPath = linkTitle;\n options.fn = function() {\n return Ember.Handlebars.get(context, linkTitle, options);\n };\n } else {\n options.fn = function() {\n return linkTitle;\n };\n }\n }\n }\n\n hash.parameters = {\n context: this,\n options: options,\n params: params\n };\n\n return Ember.Handlebars.helpers.view.call(this, LinkView, options);\n });\n\n /**\n See [link-to](/api/classes/Ember.Handlebars.helpers.html#method_link-to)\n\n @method linkTo\n @for Ember.Handlebars.helpers\n @deprecated\n @param {String} routeName\n @param {Object} [context]*\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('linkTo', Ember.Handlebars.helpers['link-to']);\n});\n\n\n\n})();\n//@ sourceURL=ember-routing/helpers/link_to");minispade.register('ember-routing/helpers/outlet', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n /**\n @module ember\n @submodule ember-routing\n */\n\n Handlebars.OutletView = Ember.ContainerView.extend(Ember._Metamorph);\n\n /**\n The `outlet` helper is a placeholder that the router will fill in with\n the appropriate template based on the current state of the application.\n\n ``` handlebars\n {{outlet}}\n ```\n\n By default, a template based on Ember's naming conventions will be rendered\n into the `outlet` (e.g. `App.PostsRoute` will render the `posts` template).\n\n You can render a different template by using the `render()` method in the\n route's `renderTemplate` hook. The following will render the `favoritePost`\n template into the `outlet`.\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost');\n }\n });\n ```\n\n You can create custom named outlets for more control.\n\n ``` handlebars\n {{outlet 'favoritePost'}}\n {{outlet 'posts'}}\n ```\n\n Then you can define what template is rendered into each outlet in your\n route.\n\n\n ``` javascript\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function() {\n this.render('favoritePost', { outlet: 'favoritePost' });\n this.render('posts', { outlet: 'posts' });\n }\n });\n ```\n\n You can specify the view class that the outlet uses to contain and manage the\n templates rendered into it.\n\n ``` handlebars\n {{outlet viewClass=App.SectionContainer}}\n ```\n\n ``` javascript\n App.SectionContainer = Ember.ContainerView.extend({\n tagName: 'section',\n classNames: ['special']\n });\n ```\n\n @method outlet\n @for Ember.Handlebars.helpers\n @param {String} property the property on the controller\n that holds the view for this outlet\n @return {String} HTML string\n */\n Handlebars.registerHelper('outlet', function(property, options) {\n var outletSource, outletContainerClass;\n\n if (property && property.data && property.data.isRenderData) {\n options = property;\n property = 'main';\n }\n\n outletSource = options.data.view;\n while (!outletSource.get('template.isTop')) {\n outletSource = outletSource.get('_parentView');\n }\n\n outletContainerClass = options.hash.viewClass || Handlebars.OutletView;\n\n options.data.view.set('outletSource', outletSource);\n options.hash.currentViewBinding = '_view.outletSource._outlets.' + property;\n\n return Handlebars.helpers.view.call(this, outletContainerClass, options);\n });\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/outlet");minispade.register('ember-routing/helpers/render', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nminispade.require('ember-handlebars/helpers/view');\n\nEmber.onLoad('Ember.Handlebars', function(Handlebars) {\n\n /**\n Calling ``{{render}}`` from within a template will insert another\n template that matches the provided name. The inserted template will\n access its properties on its own controller (rather than the controller\n of the parent template).\n\n If a view class with the same name exists, the view class also will be used.\n\n Note: A given controller may only be used *once* in your app in this manner.\n A singleton instance of the controller will be created for you.\n\n Example:\n\n ```javascript\n App.NavigationController = Ember.Controller.extend({\n who: \"world\"\n });\n ```\n\n ```handlebars\n <!-- navigation.hbs -->\n Hello, {{who}}.\n ```\n\n ```handelbars\n <!-- application.hbs -->\n <h1>My great app</h1>\n {{render navigation}}\n ```\n\n ```html\n <h1>My great app</h1>\n <div class='ember-view'>\n Hello, world.\n </div>\n ```\n\n Optionally you may provide a second argument: a property path\n that will be bound to the `model` property of the controller.\n\n If a `model` property path is specified, then a new instance of the\n controller will be created and `{{render}}` can be used multiple times\n with the same name.\n\n For example if you had this `author` template.\n\n ```handlebars\n<div class=\"author\">\n Written by {{firstName}} {{lastName}}.\n Total Posts: {{postCount}}\n</div>\n ```\n\n You could render it inside the `post` template using the `render` helper.\n\n ```handlebars\n<div class=\"post\">\n <h1>{{title}}</h1>\n <div>{{body}}</div>\n {{render \"author\" author}}\n</div>\n ```\n\n @method render\n @for Ember.Handlebars.helpers\n @param {String} name\n @param {Object?} contextString\n @param {Hash} options\n @return {String} HTML string\n */\n Ember.Handlebars.registerHelper('render', function(name, contextString, options) {\n Ember.assert(\"You must pass a template to render\", arguments.length >= 2);\n var contextProvided = arguments.length === 3,\n container, router, controller, view, context, lookupOptions;\n\n if (arguments.length === 2) {\n options = contextString;\n contextString = undefined;\n }\n\n if (typeof contextString === 'string') {\n context = Ember.Handlebars.get(options.contexts[1], contextString, options);\n lookupOptions = { singleton: false };\n }\n\n name = name.replace(/\\//g, '.');\n container = options.data.keywords.controller.container;\n router = container.lookup('router:main');\n\n Ember.assert(\"You can only use the {{render}} helper once without a model object as its second argument, as in {{render \\\"post\\\" post}}.\", contextProvided || !router || !router._lookupActiveView(name));\n\n view = container.lookup('view:' + name) || container.lookup('view:default');\n\n var controllerName = options.hash.controller;\n\n // Look up the controller by name, if provided.\n if (controllerName) {\n controller = container.lookup('controller:' + controllerName, lookupOptions);\n Ember.assert(\"The controller name you supplied '\" + controllerName + \"' did not resolve to a controller.\", !!controller);\n } else {\n controller = container.lookup('controller:' + name, lookupOptions) ||\n Ember.generateController(container, name, context);\n }\n\n if (controller && contextProvided) {\n controller.set('model', context);\n }\n\n var root = options.contexts[1];\n\n if (root) {\n view.registerObserver(root, contextString, function() {\n controller.set('model', Ember.Handlebars.get(root, contextString, options));\n });\n }\n\n controller.set('target', options.data.keywords.controller);\n\n options.hash.viewName = Ember.String.camelize(name);\n options.hash.template = container.lookup('template:' + name);\n options.hash.controller = controller;\n\n if (router && !context) {\n router._connectActiveView(name, view);\n }\n\n Ember.Handlebars.helpers.view.call(this, view, options);\n });\n\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/render");minispade.register('ember-routing/helpers/shared', "(function() {minispade.require('ember-routing/system/router');\n\nEmber.onLoad('Ember.Handlebars', function() {\n var handlebarsResolve = Ember.Handlebars.resolveParams,\n map = Ember.ArrayPolyfills.map,\n get = Ember.get,\n handlebarsGet = Ember.Handlebars.get;\n\n function resolveParams(context, params, options) {\n return map.call(resolvePaths(context, params, options), function(path, i) {\n if (null === path) {\n // Param was string/number, not a path, so just return raw string/number.\n return params[i];\n } else {\n return handlebarsGet(context, path, options);\n }\n });\n }\n\n function resolvePaths(context, params, options) {\n var resolved = handlebarsResolve(context, params, options),\n types = options.types;\n\n return map.call(resolved, function(object, i) {\n if (types[i] === 'ID') {\n return unwrap(object, params[i]);\n } else {\n return null;\n }\n });\n\n function unwrap(object, path) {\n if (path === 'controller') { return path; }\n\n if (Ember.ControllerMixin.detect(object)) {\n return unwrap(get(object, 'model'), path ? path + '.model' : 'model');\n } else {\n return path;\n }\n }\n }\n\n Ember.Router.resolveParams = resolveParams;\n Ember.Router.resolvePaths = resolvePaths;\n});\n\n})();\n//@ sourceURL=ember-routing/helpers/shared");minispade.register('ember-routing/location', "(function() {minispade.require('ember-views');\nminispade.require('ember-routing/location/api');\nminispade.require('ember-routing/location/none_location');\nminispade.require('ember-routing/location/hash_location');\nminispade.require('ember-routing/location/history_location');\n\n})();\n//@ sourceURL=ember-routing/location");minispade.register('ember-routing/location/api', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/*\n This file implements the `location` API used by Ember's router.\n\n That API is:\n\n getURL: returns the current URL\n setURL(path): sets the current URL\n replaceURL(path): replace the current URL (optional)\n onUpdateURL(callback): triggers the callback when the URL changes\n formatURL(url): formats `url` to be placed into `href` attribute\n\n Calling setURL or replaceURL will not trigger onUpdateURL callbacks.\n\n TODO: This should perhaps be moved so that it's visible in the doc output.\n*/\n\n/**\n Ember.Location returns an instance of the correct implementation of\n the `location` API.\n\n You can pass it a `implementation` ('hash', 'history', 'none') to force a\n particular implementation.\n\n @class Location\n @namespace Ember\n @static\n*/\nEmber.Location = {\n /**\n Create an instance of a an implementation of the `location` API. Requires\n an options object with an `implementation` property.\n\n Example\n\n ```javascript\n var hashLocation = Ember.Location.create({implementation: 'hash'});\n var historyLocation = Ember.Location.create({implementation: 'history'});\n var noneLocation = Ember.Location.create({implementation: 'none'});\n ```\n\n @method create\n @param {Object} options\n @return {Object} an instance of an implementation of the `location` API\n */\n create: function(options) {\n var implementation = options && options.implementation;\n Ember.assert(\"Ember.Location.create: you must specify a 'implementation' option\", !!implementation);\n\n var implementationClass = this.implementations[implementation];\n Ember.assert(\"Ember.Location.create: \" + implementation + \" is not a valid implementation\", !!implementationClass);\n\n return implementationClass.create.apply(implementationClass, arguments);\n },\n\n /**\n Registers a class that implements the `location` API with an implementation\n name. This implementation name can then be specified by the location property on\n the application's router class.\n\n Example\n\n ```javascript\n Ember.Location.registerImplementation('history', Ember.HistoryLocation);\n\n App.Router.reopen({\n location: 'history'\n });\n ```\n\n @method registerImplementation\n @param {String} name\n @param {Object} implementation of the `location` API\n */\n registerImplementation: function(name, implementation) {\n this.implementations[name] = implementation;\n },\n\n implementations: {}\n};\n\n})();\n//@ sourceURL=ember-routing/location/api");minispade.register('ember-routing/location/hash_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.HashLocation implements the location API using the browser's\n hash. At present, it relies on a hashchange event existing in the\n browser.\n\n @class HashLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HashLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n },\n\n /**\n @private\n\n Returns the current `location.hash`, minus the '#' at the front.\n\n @method getURL\n */\n getURL: function() {\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n // location.hash is not used because it is inconsistently\n // URL-decoded between browsers.\n var href = get(this, 'location').href,\n hashIndex = href.indexOf('#');\n\n if ( hashIndex === -1 ) {\n return \"\";\n } else {\n return href.substr(hashIndex + 1);\n }\n }\n // Default implementation without feature flag enabled\n return get(this, 'location').hash.substr(1);\n },\n\n /**\n @private\n\n Set the `location.hash` and remembers what was set. This prevents\n `onUpdateURL` callbacks from triggering when the hash was set by\n `HashLocation`.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n get(this, 'location').hash = path;\n set(this, 'lastSetURL', path);\n },\n\n /**\n @private\n\n Uses location.replace to update the url without a page reload\n or history modification.\n\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n get(this, 'location').replace('#' + path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the hash changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var self = this;\n var guid = Ember.guidFor(this);\n\n Ember.$(window).on('hashchange.ember-location-'+guid, function() {\n Ember.run(function() {\n var path = location.hash.substr(1);\n if (get(self, 'lastSetURL') === path) { return; }\n\n set(self, 'lastSetURL', null);\n\n callback(path);\n });\n });\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n */\n formatURL: function(url) {\n return '#'+url;\n },\n\n /**\n @private\n\n Cleans up the HashLocation event listener.\n\n @method willDestroy\n */\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).off('hashchange.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('hash', Ember.HashLocation);\n\n})();\n//@ sourceURL=ember-routing/location/hash_location");minispade.register('ember-routing/location/history_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar popstateFired = false;\nvar supportsHistoryState = window.history && 'state' in window.history;\n\n/**\n Ember.HistoryLocation implements the location API using the browser's\n history.pushState API.\n\n @class HistoryLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.HistoryLocation = Ember.Object.extend({\n\n init: function() {\n set(this, 'location', get(this, 'location') || window.location);\n this.initState();\n },\n\n /**\n @private\n\n Used to set state on first call to setURL\n\n @method initState\n */\n initState: function() {\n set(this, 'history', get(this, 'history') || window.history);\n this.replaceState(this.formatURL(this.getURL()));\n },\n\n /**\n Will be pre-pended to path upon state change\n\n @property rootURL\n @default '/'\n */\n rootURL: '/',\n\n /**\n @private\n\n Returns the current `location.pathname` without rootURL\n\n @method getURL\n @return url {String}\n */\n getURL: function() {\n var rootURL = get(this, 'rootURL'),\n location = get(this, 'location'),\n path = location.pathname;\n\n rootURL = rootURL.replace(/\\/$/, '');\n var url = path.replace(rootURL, '');\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n var search = location.search || '';\n url += search;\n }\n\n return url;\n },\n\n /**\n @private\n\n Uses `history.pushState` to update the url without a page reload.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n var state = this.getState();\n path = this.formatURL(path);\n\n if (state && state.path !== path) {\n this.pushState(path);\n }\n },\n\n /**\n @private\n\n Uses `history.replaceState` to update the url without a page reload\n or history modification.\n\n @method replaceURL\n @param path {String}\n */\n replaceURL: function(path) {\n var state = this.getState();\n path = this.formatURL(path);\n\n if (state && state.path !== path) {\n this.replaceState(path);\n }\n },\n\n /**\n @private\n\n Get the current `history.state`\n Polyfill checks for native browser support and falls back to retrieving\n from a private _historyState variable\n\n @method getState\n @return state {Object}\n */\n getState: function() {\n return supportsHistoryState ? get(this, 'history').state : this._historyState;\n },\n\n /**\n @private\n\n Pushes a new state\n\n @method pushState\n @param path {String}\n */\n pushState: function(path) {\n var state = { path: path };\n\n get(this, 'history').pushState(state, null, path);\n\n // store state if browser doesn't support `history.state`\n if (!supportsHistoryState) {\n this._historyState = state;\n }\n\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n @private\n\n Replaces the current state\n\n @method replaceState\n @param path {String}\n */\n replaceState: function(path) {\n var state = { path: path };\n\n get(this, 'history').replaceState(state, null, path);\n\n // store state if browser doesn't support `history.state`\n if (!supportsHistoryState) {\n this._historyState = state;\n }\n\n // used for webkit workaround\n this._previousURL = this.getURL();\n },\n\n /**\n @private\n\n Register a callback to be invoked whenever the browser\n history changes, including using forward and back buttons.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n var guid = Ember.guidFor(this),\n self = this;\n\n Ember.$(window).on('popstate.ember-location-'+guid, function(e) {\n // Ignore initial page load popstate event in Chrome\n if (!popstateFired) {\n popstateFired = true;\n if (self.getURL() === self._previousURL) { return; }\n }\n callback(self.getURL());\n });\n },\n\n /**\n @private\n\n Used when using `{{action}}` helper. The url is always appended to the rootURL.\n\n @method formatURL\n @param url {String}\n @return formatted url {String}\n */\n formatURL: function(url) {\n var rootURL = get(this, 'rootURL');\n\n if (url !== '') {\n rootURL = rootURL.replace(/\\/$/, '');\n }\n\n return rootURL + url;\n },\n\n /**\n @private\n\n Cleans up the HistoryLocation event listener.\n\n @method willDestroy\n */\n willDestroy: function() {\n var guid = Ember.guidFor(this);\n\n Ember.$(window).off('popstate.ember-location-'+guid);\n }\n});\n\nEmber.Location.registerImplementation('history', Ember.HistoryLocation);\n\n})();\n//@ sourceURL=ember-routing/location/history_location");minispade.register('ember-routing/location/none_location', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Ember.NoneLocation does not interact with the browser. It is useful for\n testing, or when you need to manage state with your Router, but temporarily\n don't want it to muck with the URL (for example when you embed your\n application in a larger page).\n\n @class NoneLocation\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.NoneLocation = Ember.Object.extend({\n path: '',\n\n /**\n @private\n\n Returns the current path.\n\n @method getURL\n @return {String} path\n */\n getURL: function() {\n return get(this, 'path');\n },\n\n /**\n @private\n\n Set the path and remembers what was set. Using this method\n to change the path will not invoke the `updateURL` callback.\n\n @method setURL\n @param path {String}\n */\n setURL: function(path) {\n set(this, 'path', path);\n },\n\n /**\n @private\n\n Register a callback to be invoked when the path changes. These\n callbacks will execute when the user presses the back or forward\n button, but not after `setURL` is invoked.\n\n @method onUpdateURL\n @param callback {Function}\n */\n onUpdateURL: function(callback) {\n this.updateCallback = callback;\n },\n\n /**\n @private\n\n Sets the path and calls the `updateURL` callback.\n\n @method handleURL\n @param callback {Function}\n */\n handleURL: function(url) {\n set(this, 'path', url);\n this.updateCallback(url);\n },\n\n /**\n @private\n\n Given a URL, formats it to be placed into the page as part\n of an element's `href` attribute.\n\n This is used, for example, when using the {{action}} helper\n to generate a URL based on an event.\n\n @method formatURL\n @param url {String}\n @return {String} url\n */\n formatURL: function(url) {\n // The return value is not overly meaningful, but we do not want to throw\n // errors when test code renders templates containing {{action href=true}}\n // helpers.\n return url;\n }\n});\n\nEmber.Location.registerImplementation('none', Ember.NoneLocation);\n\n})();\n//@ sourceURL=ember-routing/location/none_location");minispade.register('ember-routing', "(function() {minispade.require('ember-runtime');\nminispade.require('ember-views');\nminispade.require('ember-handlebars');\nminispade.require('ember-routing/vendor/route-recognizer');\nminispade.require('ember-routing/vendor/router');\nminispade.require('ember-routing/system');\nminispade.require('ember-routing/helpers');\nminispade.require('ember-routing/ext');\nminispade.require('ember-routing/location');\n\n/**\nEmber Routing\n\n@module ember\n@submodule ember-routing\n@requires ember-views\n*/\n\n})();\n//@ sourceURL=ember-routing");minispade.register('ember-routing/system', "(function() {minispade.require('ember-routing/system/dsl');\nminispade.require('ember-routing/system/controller_for');\nminispade.require('ember-routing/system/router');\nminispade.require('ember-routing/system/route');\n\n})();\n//@ sourceURL=ember-routing/system");minispade.register('ember-routing/system/controller_for', "(function() {var get = Ember.get;\n\n/**\n@module ember\n@submodule ember-routing\n*/\n\n/**\n \n Finds a controller instance.\n\n @for Ember\n @method controllerFor\n @private\n*/\nEmber.controllerFor = function(container, controllerName, lookupOptions) {\n return container.lookup('controller:' + controllerName, lookupOptions);\n};\n\n/**\n Generates a controller automatically if none was provided.\n The type of generated controller depends on the context.\n You can customize your generated controllers by defining\n `App.ObjectController` and `App.ArrayController`\n \n @for Ember\n @method generateController\n @private\n*/\nEmber.generateController = function(container, controllerName, context) {\n var ControllerFactory, fullName, instance, name, factoryName, controllerType;\n\n if (context && Ember.isArray(context)) {\n controllerType = 'array';\n } else if (context) {\n controllerType = 'object';\n } else {\n controllerType = 'basic';\n }\n\n factoryName = 'controller:' + controllerType;\n\n ControllerFactory = container.lookupFactory(factoryName).extend({\n isGenerated: true,\n toString: function() {\n return \"(generated \" + controllerName + \" controller)\";\n }\n });\n\n fullName = 'controller:' + controllerName;\n\n container.register(fullName, ControllerFactory);\n\n instance = container.lookup(fullName);\n\n if (get(instance, 'namespace.LOG_ACTIVE_GENERATION')) {\n Ember.Logger.info(\"generated -> \" + fullName, { fullName: fullName });\n }\n\n return instance;\n};\n\n})();\n//@ sourceURL=ember-routing/system/controller_for");minispade.register('ember-routing/system/dsl', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nfunction DSL(name) {\n this.parent = name;\n this.matches = [];\n}\n\nDSL.prototype = {\n resource: function(name, options, callback) {\n if (arguments.length === 2 && typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n if (arguments.length === 1) {\n options = {};\n }\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (callback) {\n var dsl = new DSL(name);\n route(dsl, 'loading');\n route(dsl, 'error', { path: \"/_unused_dummy_error_path_route_\" + name + \"/:error\" });\n callback.call(dsl);\n this.push(options.path, name, dsl.generate(), options.queryParams);\n } else {\n this.push(options.path, name, null, options.queryParams);\n }\n\n },\n\n push: function(url, name, callback, queryParams) {\n var parts = name.split('.');\n if (url === \"\" || url === \"/\" || parts[parts.length-1] === \"index\") { this.explicitIndex = true; }\n\n this.matches.push([url, name, callback, queryParams]);\n },\n\n route: function(name, options) {\n route(this, name, options);\n },\n\n generate: function() {\n var dslMatches = this.matches;\n\n if (!this.explicitIndex) {\n this.route(\"index\", { path: \"/\" });\n }\n\n return function(match) {\n for (var i=0, l=dslMatches.length; i<l; i++) {\n var dslMatch = dslMatches[i];\n var matchObj = match(dslMatch[0]).to(dslMatch[1], dslMatch[2]);\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n if(dslMatch[3]) {\n matchObj.withQueryParams.apply(matchObj, dslMatch[3]);\n }\n }\n }\n };\n }\n};\n\nfunction route(dsl, name, options) {\n Ember.assert(\"You must use `this.resource` to nest\", typeof options !== 'function');\n\n options = options || {};\n\n if (typeof options.path !== 'string') {\n options.path = \"/\" + name;\n }\n\n if (dsl.parent && dsl.parent !== 'application') {\n name = dsl.parent + \".\" + name;\n }\n\n dsl.push(options.path, name, null, options.queryParams);\n}\n\nDSL.map = function(callback) {\n var dsl = new DSL();\n callback.call(dsl);\n return dsl;\n};\n\nEmber.RouterDSL = DSL;\n\n})();\n//@ sourceURL=ember-routing/system/dsl");minispade.register('ember-routing/system/route', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar get = Ember.get, set = Ember.set,\n getProperties = Ember.getProperties,\n classify = Ember.String.classify,\n fmt = Ember.String.fmt,\n a_forEach = Ember.EnumerableUtils.forEach,\n a_replace = Ember.EnumerableUtils.replace;\n\n\n/**\n The `Ember.Route` class is used to define individual routes. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Route\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.Route = Ember.Object.extend(Ember.ActionHandler, {\n\n /**\n @private\n\n @method exit\n */\n exit: function() {\n this.deactivate();\n this.teardownViews();\n },\n\n /**\n @private\n\n @method enter\n */\n enter: function() {\n this.activate();\n },\n\n /**\n The collection of functions, keyed by name, available on this route as\n action targets.\n\n These functions will be invoked when a matching `{{action}}` is triggered\n from within a template and the application's current route is this route.\n\n Actions can also be invoked from other parts of your application via `Route#send`\n or `Controller#send`.\n\n The `actions` hash will inherit action handlers from\n the `actions` hash defined on extended Route parent classes\n or mixins rather than just replace the entire hash, e.g.:\n\n ```js\n App.CanDisplayBanner = Ember.Mixin.create({\n actions: {\n displayBanner: function(msg) {\n // ...\n }\n }\n });\n\n App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, {\n actions: {\n playMusic: function() {\n // ...\n }\n }\n });\n\n // `WelcomeRoute`, when active, will be able to respond\n // to both actions, since the actions hash is merged rather\n // then replaced when extending mixins / parent classes.\n this.send('displayBanner');\n this.send('playMusic');\n ```\n\n Within a route's action handler, the value of the `this` context\n is the Route object:\n\n ```js\n App.SongRoute = Ember.Route.extend({\n actions: {\n myAction: function() {\n this.controllerFor(\"song\");\n this.transitionTo(\"other.route\");\n ...\n }\n }\n });\n ```\n\n It is also possible to call `this._super()` from within an\n action handler if it overrides a handler defined on a parent\n class or mixin:\n\n Take for example the following routes:\n\n ```js\n App.DebugRoute = Ember.Mixin.create({\n actions: {\n debugRouteInformation: function() {\n console.debug(\"trololo\");\n }\n }\n });\n\n App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, {\n actions: {\n debugRouteInformation: function() {\n // also call the debugRouteInformation of mixed in App.DebugRoute\n this._super();\n\n // show additional annoyance\n window.alert(...);\n }\n }\n });\n ```\n\n ## Bubbling\n\n By default, an action will stop bubbling once a handler defined\n on the `actions` hash handles it. To continue bubbling the action,\n you must return `true` from the handler:\n\n ```js\n App.Router.map(function() {\n this.resource(\"album\", function() {\n this.route(\"song\");\n });\n });\n\n App.AlbumRoute = Ember.Route.extend({\n actions: {\n startPlaying: function() {\n }\n }\n });\n\n App.AlbumSongRoute = Ember.Route.extend({\n actions: {\n startPlaying: function() {\n // ...\n\n if (actionShouldAlsoBeTriggeredOnParentRoute) {\n return true;\n }\n }\n }\n });\n ```\n\n ## Built-in actions\n\n There are a few built-in actions pertaining to transitions that you\n can use to customize transition behavior: `willTransition` and\n `error`.\n\n ### `willTransition`\n\n The `willTransition` action is fired at the beginning of any\n attempted transition with a `Transition` object as the sole\n argument. This action can be used for aborting, redirecting,\n or decorating the transition from the currently active routes.\n\n A good example is preventing navigation when a form is\n half-filled out:\n\n ```js\n App.ContactFormRoute = Ember.Route.extend({\n actions: {\n willTransition: function(transition) {\n if (this.controller.get('userHasEnteredData')) {\n this.controller.displayNavigationConfirm();\n transition.abort();\n }\n }\n }\n });\n ```\n\n You can also redirect elsewhere by calling\n `this.transitionTo('elsewhere')` from within `willTransition`.\n Note that `willTransition` will not be fired for the\n redirecting `transitionTo`, since `willTransition` doesn't\n fire when there is already a transition underway. If you want\n subsequent `willTransition` actions to fire for the redirecting\n transition, you must first explicitly call\n `transition.abort()`.\n\n ### `error`\n\n When attempting to transition into a route, any of the hooks\n may throw an error, or return a promise that rejects, at which\n point an `error` action will be fired on the partially-entered\n routes, allowing for per-route error handling logic, or shared\n error handling logic defined on a parent route.\n\n Here is an example of an error handler that will be invoked\n for rejected promises / thrown errors from the various hooks\n on the route, as well as any unhandled errors from child\n routes:\n\n ```js\n App.AdminRoute = Ember.Route.extend({\n beforeModel: function() {\n throw \"bad things!\";\n // ...or, equivalently:\n return Ember.RSVP.reject(\"bad things!\");\n },\n\n actions: {\n error: function(error, transition) {\n // Assuming we got here due to the error in `beforeModel`,\n // we can expect that error === \"bad things!\",\n // but a promise model rejecting would also\n // call this hook, as would any errors encountered\n // in `afterModel`.\n\n // The `error` hook is also provided the failed\n // `transition`, which can be stored and later\n // `.retry()`d if desired.\n\n this.transitionTo('login');\n }\n }\n });\n ```\n\n `error` actions that bubble up all the way to `ApplicationRoute`\n will fire a default error handler that logs the error. You can\n specify your own global default error handler by overriding the\n `error` handler on `ApplicationRoute`:\n\n ```js\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n error: function(error, transition) {\n this.controllerFor('banner').displayError(error.message);\n }\n }\n });\n ```\n\n @see {Ember.Route#send}\n @see {Handlebars.helpers.action}\n\n @property actions\n @type Hash\n @default null\n */\n actions: null,\n\n /**\n @deprecated\n\n Please use `actions` instead.\n @method events\n */\n events: null,\n\n mergedProperties: ['events'],\n\n /**\n This hook is executed when the router completely exits this route. It is\n not executed when the model for the route changes.\n\n @method deactivate\n */\n deactivate: Ember.K,\n\n /**\n This hook is executed when the router enters the route. It is not executed\n when the model for the route changes.\n\n @method activate\n */\n activate: Ember.K,\n\n /**\n Transition into another route. Optionally supply model(s) for the\n route in question. If multiple models are supplied they will be applied\n last to first recursively up the resource tree (see Multiple Models Example\n below). The model(s) will be serialized into the URL using the appropriate\n route's `serialize` hook. See also 'replaceWith'.\n\n Simple Transition Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.route(\"secret\");\n this.route(\"fourOhFour\", { path: \"*:\"});\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n moveToSecret: function(context){\n if (authorized()){\n this.transitionTo('secret', context);\n }\n this.transitionTo('fourOhFour');\n }\n }\n });\n ```\n\n Multiple Models Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.resource('breakfast', {path:':breakfastId'}, function(){\n this.resource('cereal', {path: ':cerealId'});\n });\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n moveToChocolateCereal: function(){\n var cereal = { cerealId: \"ChocolateYumminess\"},\n breakfast = {breakfastId: \"CerealAndMilk\"};\n\n this.transitionTo('cereal', breakfast, cereal);\n }\n }\n });\n\n @method transitionTo\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n */\n transitionTo: function(name, context) {\n var router = this.router;\n return router.transitionTo.apply(router, arguments);\n },\n\n /**\n Perform a synchronous transition into another route with out attempting\n to resolve promises, update the URL, or abort any currently active\n asynchronous transitions (i.e. regular transitions caused by\n `transitionTo` or URL changes).\n\n This method is handy for performing intermediate transitions on the\n way to a final destination route, and is called internally by the\n default implementations of the `error` and `loading` handlers.\n\n @method intermediateTransitionTo\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n */\n intermediateTransitionTo: function() {\n var router = this.router;\n router.intermediateTransitionTo.apply(router, arguments);\n },\n\n /**\n Transition into another route while replacing the current URL, if possible.\n This will replace the current history entry instead of adding a new one.\n Beside that, it is identical to `transitionTo` in all other respects. See\n 'transitionTo' for additional information regarding multiple models.\n\n Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n this.route(\"secret\");\n });\n\n App.SecretRoute = Ember.Route.extend({\n afterModel: function() {\n if (!authorized()){\n this.replaceWith('index');\n }\n }\n });\n ```\n\n @method replaceWith\n @param {String} name the name of the route\n @param {...Object} models the model(s) to be used while transitioning\n to the route.\n */\n replaceWith: function() {\n var router = this.router;\n return router.replaceWith.apply(router, arguments);\n },\n\n /**\n Sends an action to the router, which will delegate it to the currently\n active route hierarchy per the bubbling rules explained under `actions`.\n\n Example\n\n ```javascript\n App.Router.map(function() {\n this.route(\"index\");\n });\n\n App.ApplicationRoute = Ember.Route.extend({\n actions: {\n track: function(arg) {\n console.log(arg, 'was clicked');\n }\n }\n });\n\n App.IndexRoute = Ember.Route.extend({\n actions: {\n trackIfDebug: function(arg) {\n if (debug) {\n this.send('track', arg);\n }\n }\n }\n });\n ```\n\n @method send\n @param {String} name the name of the action to trigger\n @param {...*} args\n */\n send: function() {\n return this.router.send.apply(this.router, arguments);\n },\n\n /**\n @private\n\n This hook is the entry point for router.js\n\n @method setup\n */\n setup: function(context, queryParams) {\n var controllerName = this.controllerName || this.routeName,\n controller = this.controllerFor(controllerName, true);\n if (!controller) {\n controller = this.generateController(controllerName, context);\n }\n\n // Assign the route's controller so that it can more easily be\n // referenced in action handlers\n this.controller = controller;\n\n var args = [controller, context];\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n args.push(queryParams);\n }\n\n if (this.setupControllers) {\n Ember.deprecate(\"Ember.Route.setupControllers is deprecated. Please use Ember.Route.setupController(controller, model) instead.\");\n this.setupControllers(controller, context);\n } else {\n this.setupController.apply(this, args);\n }\n\n if (this.renderTemplates) {\n Ember.deprecate(\"Ember.Route.renderTemplates is deprecated. Please use Ember.Route.renderTemplate(controller, model) instead.\");\n this.renderTemplates(context);\n } else {\n this.renderTemplate.apply(this, args);\n }\n },\n\n /**\n A hook you can implement to optionally redirect to another route.\n\n If you call `this.transitionTo` from inside of this hook, this route\n will not be entered in favor of the other hook.\n\n Note that this hook is called by the default implementation of\n `afterModel`, so if you override `afterModel`, you must either\n explicitly call `redirect` or just put your redirecting\n `this.transitionTo()` call within `afterModel`.\n\n @method redirect\n @param {Object} model the model for this route\n */\n redirect: Ember.K,\n\n /**\n This hook is the first of the route entry validation hooks\n called when an attempt is made to transition into a route\n or one of its children. It is called before `model` and\n `afterModel`, and is appropriate for cases when:\n\n 1) A decision can be made to redirect elsewhere without\n needing to resolve the model first.\n 2) Any async operations need to occur first before the\n model is attempted to be resolved.\n\n This hook is provided the current `transition` attempt\n as a parameter, which can be used to `.abort()` the transition,\n save it for a later `.retry()`, or retrieve values set\n on it from a previous hook. You can also just call\n `this.transitionTo` to another route to implicitly\n abort the `transition`.\n\n You can return a promise from this hook to pause the\n transition until the promise resolves (or rejects). This could\n be useful, for instance, for retrieving async code from\n the server that is required to enter a route.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n beforeModel: function(transition) {\n if (!App.Post) {\n return Ember.$.getScript('/models/post.js');\n }\n }\n });\n ```\n\n If `App.Post` doesn't exist in the above example,\n `beforeModel` will use jQuery's `getScript`, which\n returns a promise that resolves after the server has\n successfully retrieved and executed the code from the\n server. Note that if an error were to occur, it would\n be passed to the `error` hook on `Ember.Route`, but\n it's also possible to handle errors specific to\n `beforeModel` right from within the hook (to distinguish\n from the shared error handling behavior of the `error`\n hook):\n\n ```js\n App.PostRoute = Ember.Route.extend({\n beforeModel: function(transition) {\n if (!App.Post) {\n var self = this;\n return Ember.$.getScript('post.js').then(null, function(e) {\n self.transitionTo('help');\n\n // Note that the above transitionTo will implicitly\n // halt the transition. If you were to return\n // nothing from this promise reject handler,\n // according to promise semantics, that would\n // convert the reject into a resolve and the\n // transition would continue. To propagate the\n // error so that it'd be handled by the `error`\n // hook, you would have to either\n return Ember.RSVP.reject(e);\n // or\n throw e;\n });\n }\n }\n });\n ```\n\n @method beforeModel\n @param {Transition} transition\n @param {Object} queryParams the active query params for this route\n @return {Promise} if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.\n */\n beforeModel: Ember.K,\n\n /**\n This hook is called after this route's model has resolved.\n It follows identical async/promise semantics to `beforeModel`\n but is provided the route's resolved model in addition to\n the `transition`, and is therefore suited to performing\n logic that can only take place after the model has already\n resolved.\n\n ```js\n App.PostsRoute = Ember.Route.extend({\n afterModel: function(posts, transition) {\n if (posts.length === 1) {\n this.transitionTo('post.show', posts[0]);\n }\n }\n });\n ```\n\n Refer to documentation for `beforeModel` for a description\n of transition-pausing semantics when a promise is returned\n from this hook.\n\n @method afterModel\n @param {Object} resolvedModel the value returned from `model`,\n or its resolved value if it was a promise\n @param {Transition} transition\n @param {Object} queryParams the active query params for this handler\n @return {Promise} if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.\n */\n afterModel: function(resolvedModel, transition, queryParams) {\n this.redirect(resolvedModel, transition);\n },\n\n\n /**\n @private\n\n Called when the context is changed by router.js.\n\n @method contextDidChange\n */\n contextDidChange: function() {\n this.currentModel = this.context;\n },\n\n /**\n A hook you can implement to convert the URL into the model for\n this route.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n The model for the `post` route is `App.Post.find(params.post_id)`.\n\n By default, if your route has a dynamic segment ending in `_id`:\n\n * The model class is determined from the segment (`post_id`'s\n class is `App.Post`)\n * The find method is called on the model class with the value of\n the dynamic segment.\n\n Note that for routes with dynamic segments, this hook is only\n executed when entered via the URL. If the route is entered\n through a transition (e.g. when using the `linkTo` Handlebars\n helper), then a model context is already provided and this hook\n is not called. Routes without dynamic segments will always\n execute the model hook.\n\n This hook follows the asynchronous/promise semantics\n described in the documentation for `beforeModel`. In particular,\n if a promise returned from `model` fails, the error will be\n handled by the `error` hook on `Ember.Route`.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n return App.Post.find(params.post_id);\n }\n });\n ```\n\n @method model\n @param {Object} params the parameters extracted from the URL\n @param {Transition} transition\n @param {Object} queryParams the query params for this route\n @return {Object|Promise} the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.\n */\n model: function(params, transition) {\n var match, name, sawParams, value;\n\n for (var prop in params) {\n if (match = prop.match(/^(.*)_id$/)) {\n name = match[1];\n value = params[prop];\n }\n sawParams = true;\n }\n\n if (!name && sawParams) { return params; }\n else if (!name) { return; }\n\n return this.findModel(name, value);\n },\n\n /**\n\n @method findModel\n @param {String} type the model type\n @param {Object} value the value passed to find\n */\n findModel: function(){\n var store = get(this, 'store');\n return store.find.apply(store, arguments);\n },\n\n /**\n Store property provides a hook for data persistence libraries to inject themselves.\n\n By default, this store property provides the exact same functionality previously\n in the model hook.\n\n Currently, the required interface is:\n\n `store.find(modelName, findArguments)`\n\n @method store\n @param {Object} store\n */\n store: Ember.computed(function(){\n var container = this.container;\n var routeName = this.routeName;\n var namespace = get(this, 'router.namespace');\n\n return {\n find: function(name, value) {\n var modelClass = container.lookupFactory('model:' + name);\n\n Ember.assert(\"You used the dynamic segment \" + name + \"_id in your route \"+ routeName + \", but \" + namespace + \".\" + classify(name) + \" did not exist and you did not override your route's `model` hook.\", modelClass);\n\n return modelClass.find(value);\n }\n };\n }),\n\n /**\n A hook you can implement to convert the route's model into parameters\n for the URL.\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = Ember.Route.extend({\n model: function(params) {\n // the server returns `{ id: 12 }`\n return jQuery.getJSON(\"/posts/\" + params.post_id);\n },\n\n serialize: function(model) {\n // this will make the URL `/posts/12`\n return { post_id: model.id };\n }\n });\n ```\n\n The default `serialize` method will insert the model's `id` into the\n route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.\n If the route has multiple dynamic segments or does not contain '_id', `serialize`\n will return `Ember.getProperties(model, params)`\n\n This method is called when `transitionTo` is called with a context\n in order to populate the URL.\n\n @method serialize\n @param {Object} model the route's model\n @param {Array} params an Array of parameter names for the current\n route (in the example, `['post_id']`.\n @return {Object} the serialized parameters\n */\n serialize: function(model, params) {\n if (params.length < 1) { return; }\n\n var name = params[0], object = {};\n\n if (/_id$/.test(name) && params.length === 1) {\n object[name] = get(model, \"id\");\n } else {\n object = getProperties(model, params);\n }\n\n return object;\n },\n\n /**\n A hook you can use to setup the controller for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook.\n\n By default, the `setupController` hook sets the `content` property of\n the controller to the `model`.\n\n This means that your template will get a proxy for the model as its\n context, and you can act as though the model itself was the context.\n\n The provided controller will be one resolved based on the name\n of this route.\n\n If no explicit controller is defined, Ember will automatically create\n an appropriate controller for the model.\n\n * if the model is an `Ember.Array` (including record arrays from Ember\n Data), the controller is an `Ember.ArrayController`.\n * otherwise, the controller is an `Ember.ObjectController`.\n\n As an example, consider the router:\n\n ```js\n App.Router.map(function() {\n this.resource('post', {path: '/posts/:post_id'});\n });\n ```\n\n For the `post` route, a controller named `App.PostController` would\n be used if it is defined. If it is not defined, an `Ember.ObjectController`\n instance would be used.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, model) {\n controller.set('model', model);\n }\n });\n ```\n\n @method setupController\n @param {Controller} controller instance\n @param {Object} model\n */\n setupController: function(controller, context) {\n if (controller && (context !== undefined)) {\n set(controller, 'model', context);\n }\n },\n\n /**\n Returns the controller for a particular route or name.\n\n The controller instance must already have been created, either through entering the\n associated route or using `generateController`.\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.controllerFor('posts').set('currentPost', post);\n }\n });\n ```\n\n @method controllerFor\n @param {String} name the name of the route or controller\n @return {Ember.Controller}\n */\n controllerFor: function(name, _skipAssert) {\n var container = this.container,\n route = container.lookup('route:'+name),\n controller;\n\n if (route && route.controllerName) {\n name = route.controllerName;\n }\n\n controller = container.lookup('controller:' + name);\n\n // NOTE: We're specifically checking that skipAssert is true, because according\n // to the old API the second parameter was model. We do not want people who\n // passed a model to skip the assertion.\n Ember.assert(\"The controller named '\"+name+\"' could not be found. Make sure that this route exists and has already been entered at least once. If you are accessing a controller not associated with a route, make sure the controller class is explicitly defined.\", controller || _skipAssert === true);\n\n return controller;\n },\n\n /**\n Generates a controller for a route.\n\n If the optional model is passed then the controller type is determined automatically,\n e.g., an ArrayController for arrays.\n\n Example\n\n ```js\n App.PostRoute = Ember.Route.extend({\n setupController: function(controller, post) {\n this._super(controller, post);\n this.generateController('posts', post);\n }\n });\n ```\n\n @method generateController\n @param {String} name the name of the controller\n @param {Object} model the model to infer the type of the controller (optional)\n */\n generateController: function(name, model) {\n var container = this.container;\n\n model = model || this.modelFor(name);\n\n return Ember.generateController(container, name, model);\n },\n\n /**\n Returns the current model for a given route.\n\n This is the object returned by the `model` hook of the route\n in question.\n\n Example\n\n ```js\n App.Router.map(function() {\n this.resource('post', { path: '/post/:post_id' }, function() {\n this.resource('comments');\n });\n });\n\n App.CommentsRoute = Ember.Route.extend({\n afterModel: function() {\n this.set('post', this.modelFor('post'));\n }\n });\n ```\n\n @method modelFor\n @param {String} name the name of the route\n @return {Object} the model object\n */\n modelFor: function(name) {\n\n var route = this.container.lookup('route:' + name),\n transition = this.router.router.activeTransition;\n\n // If we are mid-transition, we want to try and look up\n // resolved parent contexts on the current transitionEvent.\n if (transition) {\n var modelLookupName = (route && route.routeName) || name;\n if (transition.resolvedModels.hasOwnProperty(modelLookupName)) {\n return transition.resolvedModels[modelLookupName];\n }\n }\n\n return route && route.currentModel;\n },\n\n /**\n A hook you can use to render the template for the current route.\n\n This method is called with the controller for the current route and the\n model supplied by the `model` hook. By default, it renders the route's\n template, configured with the controller for the route.\n\n This method can be overridden to set up and render additional or\n alternative templates.\n\n ```js\n App.PostsRoute = Ember.Route.extend({\n renderTemplate: function(controller, model) {\n var favController = this.controllerFor('favoritePost');\n\n // Render the `favoritePost` template into\n // the outlet `posts`, and display the `favoritePost`\n // controller.\n this.render('favoritePost', {\n outlet: 'posts',\n controller: favController\n });\n }\n });\n ```\n\n @method renderTemplate\n @param {Object} controller the route's controller\n @param {Object} model the route's model\n */\n renderTemplate: function(controller, model) {\n this.render();\n },\n\n /**\n Renders a template into an outlet.\n\n This method has a number of defaults, based on the name of the\n route specified in the router.\n\n For example:\n\n ```js\n App.Router.map(function() {\n this.route('index');\n this.resource('post', {path: '/posts/:post_id'});\n });\n\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render();\n }\n });\n ```\n\n The name of the `PostRoute`, as defined by the router, is `post`.\n\n By default, render will:\n\n * render the `post` template\n * with the `post` view (`PostView`) for event handling, if one exists\n * and the `post` controller (`PostController`), if one exists\n * into the `main` outlet of the `application` template\n\n You can override this behavior:\n\n ```js\n App.PostRoute = App.Route.extend({\n renderTemplate: function() {\n this.render('myPost', { // the template to render\n into: 'index', // the template to render into\n outlet: 'detail', // the name of the outlet in that template\n controller: 'blogPost' // the controller to use for the template\n });\n }\n });\n ```\n\n Remember that the controller's `content` will be the route's model. In\n this case, the default model will be `App.Post.find(params.post_id)`.\n\n @method render\n @param {String} name the name of the template to render\n @param {Object} options the options\n */\n render: function(name, options) {\n Ember.assert(\"The name in the given arguments is undefined\", arguments.length > 0 ? !Ember.isNone(arguments[0]) : true);\n\n var namePassed = !!name;\n\n if (typeof name === 'object' && !options) {\n options = name;\n name = this.routeName;\n }\n\n options = options || {};\n name = name ? name.replace(/\\//g, '.') : this.routeName;\n var viewName = options.view || this.viewName || name;\n var templateName = this.templateName || name;\n\n var container = this.container,\n view = container.lookup('view:' + viewName),\n template = view ? view.get('template') : null;\n\n if (!template) {\n template = container.lookup('template:' + templateName);\n }\n\n if (!view && !template) {\n Ember.assert(\"Could not find \\\"\" + name + \"\\\" template or view.\", !namePassed);\n if (get(this.router, 'namespace.LOG_VIEW_LOOKUPS')) {\n Ember.Logger.info(\"Could not find \\\"\" + name + \"\\\" template or view. Nothing will be rendered\", { fullName: 'template:' + name });\n }\n return;\n }\n\n options = normalizeOptions(this, name, template, options);\n view = setupView(view, container, options);\n\n if (options.outlet === 'main') { this.lastRenderedTemplate = name; }\n\n appendView(this, view, options);\n },\n\n /**\n Disconnects a view that has been rendered into an outlet.\n\n You may pass any or all of the following options to `disconnectOutlet`:\n\n * `outlet`: the name of the outlet to clear (default: 'main')\n * `parentView`: the name of the view containing the outlet to clear\n (default: the view rendered by the parent route)\n\n Example:\n\n ```js\n App.ApplicationRoute = App.Route.extend({\n actions: {\n showModal: function(evt) {\n this.render(evt.modalName, {\n outlet: 'modal',\n into: 'application'\n });\n },\n hideModal: function(evt) {\n this.disconnectOutlet({\n outlet: 'modal',\n parentView: 'application'\n });\n }\n }\n });\n ```\n\n @method disconnectOutlet\n @param {Object} options the options\n */\n disconnectOutlet: function(options) {\n options = options || {};\n options.parentView = options.parentView ? options.parentView.replace(/\\//g, '.') : parentTemplate(this);\n options.outlet = options.outlet || 'main';\n\n var parentView = this.router._lookupActiveView(options.parentView);\n parentView.disconnectOutlet(options.outlet);\n },\n\n willDestroy: function() {\n this.teardownViews();\n },\n\n /**\n @private\n\n @method teardownViews\n */\n teardownViews: function() {\n // Tear down the top level view\n if (this.teardownTopLevelView) { this.teardownTopLevelView(); }\n\n // Tear down any outlets rendered with 'into'\n var teardownOutletViews = this.teardownOutletViews || [];\n a_forEach(teardownOutletViews, function(teardownOutletView) {\n teardownOutletView();\n });\n\n delete this.teardownTopLevelView;\n delete this.teardownOutletViews;\n delete this.lastRenderedTemplate;\n }\n});\n\nfunction parentRoute(route) {\n var handlerInfos = route.router.router.targetHandlerInfos;\n\n if (!handlerInfos) { return; }\n\n var parent, current;\n\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n current = handlerInfos[i].handler;\n if (current === route) { return parent; }\n parent = current;\n }\n}\n\nfunction parentTemplate(route) {\n var parent = parentRoute(route), template;\n\n if (!parent) { return; }\n\n if (template = parent.lastRenderedTemplate) {\n return template;\n } else {\n return parentTemplate(parent);\n }\n}\n\nfunction normalizeOptions(route, name, template, options) {\n options = options || {};\n options.into = options.into ? options.into.replace(/\\//g, '.') : parentTemplate(route);\n options.outlet = options.outlet || 'main';\n options.name = name;\n options.template = template;\n options.LOG_VIEW_LOOKUPS = get(route.router, 'namespace.LOG_VIEW_LOOKUPS');\n\n Ember.assert(\"An outlet (\"+options.outlet+\") was specified but was not found.\", options.outlet === 'main' || options.into);\n\n var controller = options.controller, namedController;\n\n if (options.controller) {\n controller = options.controller;\n } else if (namedController = route.container.lookup('controller:' + name)) {\n controller = namedController;\n } else {\n controller = route.controllerName || route.routeName;\n }\n\n if (typeof controller === 'string') {\n controller = route.container.lookup('controller:' + controller);\n }\n\n options.controller = controller;\n\n return options;\n}\n\nfunction setupView(view, container, options) {\n if (view) {\n if (options.LOG_VIEW_LOOKUPS) {\n Ember.Logger.info(\"Rendering \" + options.name + \" with \" + view, { fullName: 'view:' + options.name });\n }\n } else {\n var defaultView = options.into ? 'view:default' : 'view:toplevel';\n view = container.lookup(defaultView);\n if (options.LOG_VIEW_LOOKUPS) {\n Ember.Logger.info(\"Rendering \" + options.name + \" with default view \" + view, { fullName: 'view:' + options.name });\n }\n }\n\n if (!get(view, 'templateName')) {\n set(view, 'template', options.template);\n\n set(view, '_debugTemplateName', options.name);\n }\n\n set(view, 'renderedName', options.name);\n set(view, 'controller', options.controller);\n\n return view;\n}\n\nfunction appendView(route, view, options) {\n if (options.into) {\n var parentView = route.router._lookupActiveView(options.into);\n var teardownOutletView = generateOutletTeardown(parentView, options.outlet);\n if (!route.teardownOutletViews) { route.teardownOutletViews = []; }\n a_replace(route.teardownOutletViews, 0, 0, [teardownOutletView]);\n parentView.connectOutlet(options.outlet, view);\n } else {\n var rootElement = get(route, 'router.namespace.rootElement');\n // tear down view if one is already rendered\n if (route.teardownTopLevelView) {\n route.teardownTopLevelView();\n }\n route.router._connectActiveView(options.name, view);\n route.teardownTopLevelView = generateTopLevelTeardown(view);\n view.appendTo(rootElement);\n }\n}\n\nfunction generateTopLevelTeardown(view) {\n return function() { view.destroy(); };\n}\n\nfunction generateOutletTeardown(parentView, outlet) {\n return function() { parentView.disconnectOutlet(outlet); };\n}\n\n\n\n})();\n//@ sourceURL=ember-routing/system/route");minispade.register('ember-routing/system/router', "(function() {/**\n@module ember\n@submodule ember-routing\n*/\n\nvar Router = requireModule(\"router\")['default'];\nvar get = Ember.get, set = Ember.set;\nvar defineProperty = Ember.defineProperty;\n\nvar DefaultView = Ember._MetamorphView;\nminispade.require(\"ember-routing/system/dsl\");\n\n/**\n The `Ember.Router` class manages the application state and URLs. Refer to\n the [routing guide](http://emberjs.com/guides/routing/) for documentation.\n\n @class Router\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.Router = Ember.Object.extend(Ember.Evented, {\n location: 'hash',\n\n init: function() {\n this.router = this.constructor.router || this.constructor.map(Ember.K);\n this._activeViews = {};\n this._setupLocation();\n },\n\n url: Ember.computed(function() {\n return get(this, 'location').getURL();\n }),\n\n startRouting: function() {\n this.router = this.router || this.constructor.map(Ember.K);\n\n var router = this.router,\n location = get(this, 'location'),\n container = this.container,\n self = this;\n\n this._setupRouter(router, location);\n\n container.register('view:default', DefaultView);\n container.register('view:toplevel', Ember.View.extend());\n\n location.onUpdateURL(function(url) {\n self.handleURL(url);\n });\n\n this.handleURL(location.getURL());\n },\n\n didTransition: function(infos) {\n updatePaths(this);\n\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n this._cancelLoadingEvent();\n } else {\n exitLegacyLoadingRoute(this);\n }\n\n this.notifyPropertyChange('url');\n\n if (Ember.FEATURES.isEnabled(\"ember-routing-didTransition-hook\")) {\n // Put this in the runloop so url will be accurate. Seems\n // less surprising than didTransition being out of sync.\n Ember.run.once(this, this.trigger, 'didTransition');\n }\n\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Transitioned into '\" + Ember.Router._routePath(infos) + \"'\");\n }\n },\n\n handleURL: function(url) {\n return this._doTransition('handleURL', [url]);\n },\n\n transitionTo: function() {\n return this._doTransition('transitionTo', arguments);\n },\n\n intermediateTransitionTo: function() {\n this.router.intermediateTransitionTo.apply(this.router, arguments);\n\n updatePaths(this);\n\n var infos = this.router.currentHandlerInfos;\n if (get(this, 'namespace').LOG_TRANSITIONS) {\n Ember.Logger.log(\"Intermediate-transitioned into '\" + Ember.Router._routePath(infos) + \"'\");\n }\n },\n\n replaceWith: function() {\n return this._doTransition('replaceWith', arguments);\n },\n\n generate: function() {\n var url = this.router.generate.apply(this.router, arguments);\n return this.location.formatURL(url);\n },\n\n isActive: function(routeName) {\n var router = this.router;\n return router.isActive.apply(router, arguments);\n },\n\n send: function(name, context) {\n this.router.trigger.apply(this.router, arguments);\n },\n\n hasRoute: function(route) {\n return this.router.hasRoute(route);\n },\n\n /**\n @private\n\n Resets the state of the router by clearing the current route\n handlers and deactivating them.\n\n @method reset\n */\n reset: function() {\n this.router.reset();\n },\n\n _lookupActiveView: function(templateName) {\n var active = this._activeViews[templateName];\n return active && active[0];\n },\n\n _connectActiveView: function(templateName, view) {\n var existing = this._activeViews[templateName];\n\n if (existing) {\n existing[0].off('willDestroyElement', this, existing[1]);\n }\n\n var disconnect = function() {\n delete this._activeViews[templateName];\n };\n\n this._activeViews[templateName] = [view, disconnect];\n view.one('willDestroyElement', this, disconnect);\n },\n\n _setupLocation: function() {\n var location = get(this, 'location'),\n rootURL = get(this, 'rootURL'),\n options = {};\n\n if (typeof rootURL === 'string') {\n options.rootURL = rootURL;\n }\n\n if ('string' === typeof location) {\n options.implementation = location;\n location = set(this, 'location', Ember.Location.create(options));\n }\n },\n\n _getHandlerFunction: function() {\n var seen = {}, container = this.container,\n DefaultRoute = container.lookupFactory('route:basic'),\n self = this;\n\n return function(name) {\n var routeName = 'route:' + name,\n handler = container.lookup(routeName);\n\n if (seen[name]) { return handler; }\n\n seen[name] = true;\n\n if (!handler) {\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n } else {\n if (name === 'loading') { return {}; }\n }\n\n container.register(routeName, DefaultRoute.extend());\n handler = container.lookup(routeName);\n\n if (get(self, 'namespace.LOG_ACTIVE_GENERATION')) {\n Ember.Logger.info(\"generated -> \" + routeName, { fullName: routeName });\n }\n }\n\n handler.routeName = name;\n return handler;\n };\n },\n\n _setupRouter: function(router, location) {\n var lastURL, emberRouter = this;\n\n router.getHandler = this._getHandlerFunction();\n\n var doUpdateURL = function() {\n location.setURL(lastURL);\n };\n\n router.updateURL = function(path) {\n lastURL = path;\n Ember.run.once(doUpdateURL);\n };\n\n if (location.replaceURL) {\n var doReplaceURL = function() {\n location.replaceURL(lastURL);\n };\n\n router.replaceURL = function(path) {\n lastURL = path;\n Ember.run.once(doReplaceURL);\n };\n }\n\n router.didTransition = function(infos) {\n emberRouter.didTransition(infos);\n };\n },\n\n _doTransition: function(method, args) {\n // Normalize blank route to root URL.\n args = [].slice.call(args);\n args[0] = args[0] || '/';\n\n var passedName = args[0], name, self = this,\n isQueryParamsOnly = false;\n\n if (Ember.FEATURES.isEnabled(\"query-params\")) {\n isQueryParamsOnly = (args.length === 1 && args[0].hasOwnProperty('queryParams'));\n }\n\n if (!isQueryParamsOnly && passedName.charAt(0) === '/') {\n name = passedName;\n } else if (!isQueryParamsOnly) {\n if (!this.router.hasRoute(passedName)) {\n name = args[0] = passedName + '.index';\n } else {\n name = passedName;\n }\n\n Ember.assert(\"The route \" + passedName + \" was not found\", this.router.hasRoute(name));\n }\n\n var transitionPromise = this.router[method].apply(this.router, args);\n\n // Don't schedule loading state entry if user has already aborted the transition.\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n } else {\n scheduleLegacyLoadingRouteEntry(this);\n }\n\n transitionPromise.then(null, function(error) {\n if (error.name === \"UnrecognizedURLError\") {\n Ember.assert(\"The URL '\" + error.message + \"' did not match any routes in your application\");\n }\n });\n\n // We want to return the configurable promise object\n // so that callers of this function can use `.method()` on it,\n // which obviously doesn't exist for normal RSVP promises.\n return transitionPromise;\n },\n\n _scheduleLoadingEvent: function(transition, originRoute) {\n this._cancelLoadingEvent();\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n this._loadingStateTimer = Ember.run.scheduleOnce('routerTransitions', this, '_fireLoadingEvent', transition, originRoute);\n }\n },\n\n _fireLoadingEvent: function(transition, originRoute) {\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n if (!this.router.activeTransition) {\n // Don't fire an event if we've since moved on from\n // the transition that put us in a loading state.\n return;\n }\n\n transition.trigger(true, 'loading', transition, originRoute);\n } else {\n enterLegacyLoadingRoute(this);\n }\n },\n\n _cancelLoadingEvent: function () {\n if (this._loadingStateTimer) {\n Ember.run.cancel(this._loadingStateTimer);\n }\n this._loadingStateTimer = null;\n }\n});\n\n/**\n @private\n\n Helper function for iterating root-ward, starting\n from (but not including) the provided `originRoute`.\n\n Returns true if the last callback fired requested\n to bubble upward.\n */\nfunction forEachRouteAbove(originRoute, transition, callback) {\n var handlerInfos = transition.handlerInfos,\n originRouteFound = false;\n\n for (var i = handlerInfos.length - 1; i >= 0; --i) {\n var handlerInfo = handlerInfos[i],\n route = handlerInfo.handler;\n\n if (!originRouteFound) {\n if (originRoute === route) {\n originRouteFound = true;\n }\n continue;\n }\n\n if (callback(route, handlerInfos[i + 1].handler) !== true) {\n return false;\n }\n }\n return true;\n}\n\n// These get invoked when an action bubbles above ApplicationRoute\n// and are not meant to be overridable.\nvar defaultActionHandlers = {\n\n willResolveModel: function(transition, originRoute) {\n originRoute.router._scheduleLoadingEvent(transition, originRoute);\n },\n\n error: function(error, transition, originRoute) {\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n\n // Attempt to find an appropriate error substate to enter.\n var router = originRoute.router;\n\n var tryTopLevel = forEachRouteAbove(originRoute, transition, function(route, childRoute) {\n var childErrorRouteName = findChildRouteName(route, childRoute, 'error');\n if (childErrorRouteName) {\n router.intermediateTransitionTo(childErrorRouteName, error);\n return;\n }\n return true;\n });\n\n if (tryTopLevel) {\n // Check for top-level error state to enter.\n if (routeHasBeenDefined(originRoute.router, 'application_error')) {\n router.intermediateTransitionTo('application_error', error);\n return;\n }\n } else {\n // Don't fire an assertion if we found an error substate.\n return;\n }\n }\n\n Ember.Logger.assert(false, 'Error while loading route: ' + Ember.inspect(error));\n },\n\n loading: function(transition, originRoute) {\n if (Ember.FEATURES.isEnabled(\"ember-routing-loading-error-substates\")) {\n\n // Attempt to find an appropriate loading substate to enter.\n var router = originRoute.router;\n\n var tryTopLevel = forEachRouteAbove(originRoute, transition, function(route, childRoute) {\n var childLoadingRouteName = findChildRouteName(route, childRoute, 'loading');\n\n if (childLoadingRouteName) {\n router.intermediateTransitionTo(childLoadingRouteName);\n return;\n }\n\n // Don't bubble above pivot route.\n if (transition.pivotHandler !== route) {\n return true;\n }\n });\n\n if (tryTopLevel) {\n // Check for top-level loading state to enter.\n if (routeHasBeenDefined(originRoute.router, 'application_loading')) {\n router.intermediateTransitionTo('application_loading');\n return;\n }\n }\n }\n }\n};\n\nfunction findChildRouteName(parentRoute, originatingChildRoute, name) {\n var router = parentRoute.router,\n childName,\n targetChildRouteName = originatingChildRoute.routeName.split('.').pop(),\n namespace = parentRoute.routeName === 'application' ? '' : parentRoute.routeName + '.';\n\n childName = namespace + name;\n if (routeHasBeenDefined(router, childName)) {\n return childName;\n }\n}\n\nfunction routeHasBeenDefined(router, name) {\n var container = router.container;\n return router.hasRoute(name) &&\n (container.has('template:' + name) || container.has('route:' + name));\n}\n\nfunction triggerEvent(handlerInfos, ignoreFailure, args) {\n var name = args.shift();\n\n if (!handlerInfos) {\n if (ignoreFailure) { return; }\n throw new Ember.Error(\"Can't trigger action '\" + name + \"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.\");\n }\n\n var eventWasHandled = false;\n\n for (var i = handlerInfos.length - 1; i >= 0; i--) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler._actions && handler._actions[name]) {\n if (handler._actions[name].apply(handler, args) === true) {\n eventWasHandled = true;\n } else {\n return;\n }\n }\n }\n\n if (defaultActionHandlers[name]) {\n defaultActionHandlers[name].apply(null, args);\n return;\n }\n\n if (!eventWasHandled && !ignoreFailure) {\n throw new Ember.Error(\"Nothing handled the action '\" + name + \"'.\");\n }\n}\n\nfunction updatePaths(router) {\n var appController = router.container.lookup('controller:application');\n\n if (!appController) {\n // appController might not exist when top-level loading/error\n // substates have been entered since ApplicationRoute hasn't\n // actually been entered at that point.\n return;\n }\n\n var infos = router.router.currentHandlerInfos,\n path = Ember.Router._routePath(infos);\n\n if (!('currentPath' in appController)) {\n defineProperty(appController, 'currentPath');\n }\n\n set(appController, 'currentPath', path);\n\n if (!('currentRouteName' in appController)) {\n defineProperty(appController, 'currentRouteName');\n }\n\n set(appController, 'currentRouteName', infos[infos.length - 1].name);\n}\n\nfunction scheduleLegacyLoadingRouteEntry(router) {\n cancelLegacyLoadingRouteEntry(router);\n if (router.router.activeTransition) {\n router._legacyLoadingStateTimer = Ember.run.scheduleOnce('routerTransitions', null, enterLegacyLoadingRoute, router);\n }\n}\n\nfunction enterLegacyLoadingRoute(router) {\n var loadingRoute = router.router.getHandler('loading');\n if (loadingRoute && !loadingRoute._loadingStateActive) {\n if (loadingRoute.enter) { loadingRoute.enter(); }\n if (loadingRoute.setup) { loadingRoute.setup(); }\n loadingRoute._loadingStateActive = true;\n }\n}\n\nfunction cancelLegacyLoadingRouteEntry(router) {\n if (router._legacyLoadingStateTimer) {\n Ember.run.cancel(router._legacyLoadingStateTimer);\n }\n router._legacyLoadingStateTimer = null;\n}\n\nfunction exitLegacyLoadingRoute(router) {\n\n cancelLegacyLoadingRouteEntry(router);\n\n var loadingRoute = router.router.getHandler('loading');\n\n if (loadingRoute && loadingRoute._loadingStateActive) {\n if (loadingRoute.exit) { loadingRoute.exit(); }\n loadingRoute._loadingStateActive = false;\n }\n}\n\nEmber.Router.reopenClass({\n router: null,\n map: function(callback) {\n var router = this.router;\n if (!router) {\n router = new Router();\n router.callbacks = [];\n router.triggerEvent = triggerEvent;\n this.reopenClass({ router: router });\n }\n\n if (get(this, 'namespace.LOG_TRANSITIONS_INTERNAL')) {\n router.log = Ember.Logger.debug;\n }\n\n var dsl = Ember.RouterDSL.map(function() {\n this.resource('application', { path: \"/\" }, function() {\n for (var i=0; i < router.callbacks.length; i++) {\n router.callbacks[i].call(this);\n }\n callback.call(this);\n });\n });\n\n router.callbacks.push(callback);\n router.map(dsl.generate());\n return router;\n },\n\n _routePath: function(handlerInfos) {\n var path = [];\n\n for (var i=1, l=handlerInfos.length; i<l; i++) {\n var name = handlerInfos[i].name,\n nameParts = name.split(\".\");\n\n path.push(nameParts[nameParts.length - 1]);\n }\n\n return path.join(\".\");\n }\n});\n\nRouter.Transition.prototype.send = Router.Transition.prototype.trigger;\n\n\n\n})();\n//@ sourceURL=ember-routing/system/router");minispade.register('ember-routing/vendor/route-recognizer', "(function() {define(\"route-recognizer\",\n [],\n function() {\n \"use strict\";\n var specials = [\n '/', '.', '*', '+', '?', '|',\n '(', ')', '[', ']', '{', '}', '\\\\'\n ];\n\n var escapeRegex = new RegExp('(\\\\' + specials.join('|\\\\') + ')', 'g');\n\n // A Segment represents a segment in the original route description.\n // Each Segment type provides an `eachChar` and `regex` method.\n //\n // The `eachChar` method invokes the callback with one or more character\n // specifications. A character specification consumes one or more input\n // characters.\n //\n // The `regex` method returns a regex fragment for the segment. If the\n // segment is a dynamic of star segment, the regex fragment also includes\n // a capture.\n //\n // A character specification contains:\n //\n // * `validChars`: a String with a list of all valid characters, or\n // * `invalidChars`: a String with a list of all invalid characters\n // * `repeat`: true if the character specification can repeat\n\n function StaticSegment(string) { this.string = string; }\n StaticSegment.prototype = {\n eachChar: function(callback) {\n var string = this.string, char;\n\n for (var i=0, l=string.length; i<l; i++) {\n char = string.charAt(i);\n callback({ validChars: char });\n }\n },\n\n regex: function() {\n return this.string.replace(escapeRegex, '\\\\$1');\n },\n\n generate: function() {\n return this.string;\n }\n };\n\n function DynamicSegment(name) { this.name = name; }\n DynamicSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"/\", repeat: true });\n },\n\n regex: function() {\n return \"([^/]+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function StarSegment(name) { this.name = name; }\n StarSegment.prototype = {\n eachChar: function(callback) {\n callback({ invalidChars: \"\", repeat: true });\n },\n\n regex: function() {\n return \"(.+)\";\n },\n\n generate: function(params) {\n return params[this.name];\n }\n };\n\n function EpsilonSegment() {}\n EpsilonSegment.prototype = {\n eachChar: function() {},\n regex: function() { return \"\"; },\n generate: function() { return \"\"; }\n };\n\n function parse(route, names, types) {\n // normalize route as not starting with a \"/\". Recognition will\n // also normalize.\n if (route.charAt(0) === \"/\") { route = route.substr(1); }\n\n var segments = route.split(\"/\"), results = [];\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i], match;\n\n if (match = segment.match(/^:([^\\/]+)$/)) {\n results.push(new DynamicSegment(match[1]));\n names.push(match[1]);\n types.dynamics++;\n } else if (match = segment.match(/^\\*([^\\/]+)$/)) {\n results.push(new StarSegment(match[1]));\n names.push(match[1]);\n types.stars++;\n } else if(segment === \"\") {\n results.push(new EpsilonSegment());\n } else {\n results.push(new StaticSegment(segment));\n types.statics++;\n }\n }\n\n return results;\n }\n\n // A State has a character specification and (`charSpec`) and a list of possible\n // subsequent states (`nextStates`).\n //\n // If a State is an accepting state, it will also have several additional\n // properties:\n //\n // * `regex`: A regular expression that is used to extract parameters from paths\n // that reached this accepting state.\n // * `handlers`: Information on how to convert the list of captures into calls\n // to registered handlers with the specified parameters\n // * `types`: How many static, dynamic or star segments in this route. Used to\n // decide which route to use if multiple registered routes match a path.\n //\n // Currently, State is implemented naively by looping over `nextStates` and\n // comparing a character specification against a character. A more efficient\n // implementation would use a hash of keys pointing at one or more next states.\n\n function State(charSpec) {\n this.charSpec = charSpec;\n this.nextStates = [];\n }\n\n State.prototype = {\n get: function(charSpec) {\n var nextStates = this.nextStates;\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n var child = nextStates[i];\n\n var isEqual = child.charSpec.validChars === charSpec.validChars;\n isEqual = isEqual && child.charSpec.invalidChars === charSpec.invalidChars;\n\n if (isEqual) { return child; }\n }\n },\n\n put: function(charSpec) {\n var state;\n\n // If the character specification already exists in a child of the current\n // state, just return that state.\n if (state = this.get(charSpec)) { return state; }\n\n // Make a new state for the character spec\n state = new State(charSpec);\n\n // Insert the new state as a child of the current state\n this.nextStates.push(state);\n\n // If this character specification repeats, insert the new state as a child\n // of itself. Note that this will not trigger an infinite loop because each\n // transition during recognition consumes a character.\n if (charSpec.repeat) {\n state.nextStates.push(state);\n }\n\n // Return the new state\n return state;\n },\n\n // Find a list of child states matching the next character\n match: function(char) {\n // DEBUG \"Processing `\" + char + \"`:\"\n var nextStates = this.nextStates,\n child, charSpec, chars;\n\n // DEBUG \" \" + debugState(this)\n var returned = [];\n\n for (var i=0, l=nextStates.length; i<l; i++) {\n child = nextStates[i];\n\n charSpec = child.charSpec;\n\n if (typeof (chars = charSpec.validChars) !== 'undefined') {\n if (chars.indexOf(char) !== -1) { returned.push(child); }\n } else if (typeof (chars = charSpec.invalidChars) !== 'undefined') {\n if (chars.indexOf(char) === -1) { returned.push(child); }\n }\n }\n\n return returned;\n }\n\n /** IF DEBUG\n , debug: function() {\n var charSpec = this.charSpec,\n debug = \"[\",\n chars = charSpec.validChars || charSpec.invalidChars;\n\n if (charSpec.invalidChars) { debug += \"^\"; }\n debug += chars;\n debug += \"]\";\n\n if (charSpec.repeat) { debug += \"+\"; }\n\n return debug;\n }\n END IF **/\n };\n\n /** IF DEBUG\n function debug(log) {\n console.log(log);\n }\n\n function debugState(state) {\n return state.nextStates.map(function(n) {\n if (n.nextStates.length === 0) { return \"( \" + n.debug() + \" [accepting] )\"; }\n return \"( \" + n.debug() + \" <then> \" + n.nextStates.map(function(s) { return s.debug() }).join(\" or \") + \" )\";\n }).join(\", \")\n }\n END IF **/\n\n // This is a somewhat naive strategy, but should work in a lot of cases\n // A better strategy would properly resolve /posts/:id/new and /posts/edit/:id\n function sortSolutions(states) {\n return states.sort(function(a, b) {\n if (a.types.stars !== b.types.stars) { return a.types.stars - b.types.stars; }\n if (a.types.dynamics !== b.types.dynamics) { return a.types.dynamics - b.types.dynamics; }\n if (a.types.statics !== b.types.statics) { return b.types.statics - a.types.statics; }\n\n return 0;\n });\n }\n\n function recognizeChar(states, char) {\n var nextStates = [];\n\n for (var i=0, l=states.length; i<l; i++) {\n var state = states[i];\n\n nextStates = nextStates.concat(state.match(char));\n }\n\n return nextStates;\n }\n\n function findHandler(state, path, queryParams) {\n var handlers = state.handlers, regex = state.regex;\n var captures = path.match(regex), currentCapture = 1;\n var result = [];\n\n for (var i=0, l=handlers.length; i<l; i++) {\n var handler = handlers[i], names = handler.names, params = {},\n watchedQueryParams = handler.queryParams || [],\n activeQueryParams = {},\n j, m;\n\n for (j=0, m=names.length; j<m; j++) {\n params[names[j]] = captures[currentCapture++];\n }\n for (j=0, m=watchedQueryParams.length; j < m; j++) {\n var key = watchedQueryParams[j];\n if(queryParams[key]){\n activeQueryParams[key] = queryParams[key];\n }\n }\n var currentResult = { handler: handler.handler, params: params, isDynamic: !!names.length };\n if(watchedQueryParams && watchedQueryParams.length > 0) {\n currentResult.queryParams = activeQueryParams;\n }\n result.push(currentResult);\n }\n\n return result;\n }\n\n function addSegment(currentState, segment) {\n segment.eachChar(function(char) {\n var state;\n\n currentState = currentState.put(char);\n });\n\n return currentState;\n }\n\n // The main interface\n\n var RouteRecognizer = function() {\n this.rootState = new State();\n this.names = {};\n };\n\n\n RouteRecognizer.prototype = {\n add: function(routes, options) {\n var currentState = this.rootState, regex = \"^\",\n types = { statics: 0, dynamics: 0, stars: 0 },\n handlers = [], allSegments = [], name;\n\n var isEmpty = true;\n\n for (var i=0, l=routes.length; i<l; i++) {\n var route = routes[i], names = [];\n\n var segments = parse(route.path, names, types);\n\n allSegments = allSegments.concat(segments);\n\n for (var j=0, m=segments.length; j<m; j++) {\n var segment = segments[j];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n isEmpty = false;\n\n // Add a \"/\" for the new segment\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n\n // Add a representation of the segment to the NFA and regex\n currentState = addSegment(currentState, segment);\n regex += segment.regex();\n }\n\n var handler = { handler: route.handler, names: names };\n if(route.queryParams) {\n handler.queryParams = route.queryParams;\n }\n handlers.push(handler);\n }\n\n if (isEmpty) {\n currentState = currentState.put({ validChars: \"/\" });\n regex += \"/\";\n }\n\n currentState.handlers = handlers;\n currentState.regex = new RegExp(regex + \"$\");\n currentState.types = types;\n\n if (name = options && options.as) {\n this.names[name] = {\n segments: allSegments,\n handlers: handlers\n };\n }\n },\n\n handlersFor: function(name) {\n var route = this.names[name], result = [];\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n for (var i=0, l=route.handlers.length; i<l; i++) {\n result.push(route.handlers[i]);\n }\n\n return result;\n },\n\n hasRoute: function(name) {\n return !!this.names[name];\n },\n\n generate: function(name, params) {\n var route = this.names[name], output = \"\";\n if (!route) { throw new Error(\"There is no route named \" + name); }\n\n var segments = route.segments;\n\n for (var i=0, l=segments.length; i<l; i++) {\n var segment = segments[i];\n\n if (segment instanceof EpsilonSegment) { continue; }\n\n output += \"/\";\n output += segment.generate(params);\n }\n\n if (output.charAt(0) !== '/') { output = '/' + output; }\n\n if (params && params.queryParams) {\n output += this.generateQueryString(params.queryParams, route.handlers);\n }\n\n return output;\n },\n\n generateQueryString: function(params, handlers) {\n var pairs = [], allowedParams = [];\n for(var i=0; i < handlers.length; i++) {\n var currentParamList = handlers[i].queryParams;\n if(currentParamList) {\n allowedParams.push.apply(allowedParams, currentParamList);\n }\n }\n for(var key in params) {\n if (params.hasOwnProperty(key)) {\n if(allowedParams.indexOf(key) === -1) {\n throw 'Query param \"' + key + '\" is not specified as a valid param for this route';\n }\n var value = params[key];\n var pair = encodeURIComponent(key);\n if(value !== true) {\n pair += \"=\" + encodeURIComponent(value);\n }\n pairs.push(pair);\n }\n }\n\n if (pairs.length === 0) { return ''; }\n\n return \"?\" + pairs.join(\"&\");\n },\n\n parseQueryString: function(queryString) {\n var pairs = queryString.split(\"&\"), queryParams = {};\n for(var i=0; i < pairs.length; i++) {\n var pair = pairs[i].split('='),\n key = decodeURIComponent(pair[0]),\n value = pair[1] ? decodeURIComponent(pair[1]) : true;\n queryParams[key] = value;\n }\n return queryParams;\n },\n\n recognize: function(path) {\n var states = [ this.rootState ],\n pathLen, i, l, queryStart, queryParams = {};\n\n queryStart = path.indexOf('?');\n if (queryStart !== -1) {\n var queryString = path.substr(queryStart + 1, path.length);\n path = path.substr(0, queryStart);\n queryParams = this.parseQueryString(queryString);\n }\n\n // DEBUG GROUP path\n\n if (path.charAt(0) !== \"/\") { path = \"/\" + path; }\n\n pathLen = path.length;\n if (pathLen > 1 && path.charAt(pathLen - 1) === \"/\") {\n path = path.substr(0, pathLen - 1);\n }\n\n for (i=0, l=path.length; i<l; i++) {\n states = recognizeChar(states, path.charAt(i));\n if (!states.length) { break; }\n }\n\n // END DEBUG GROUP\n\n var solutions = [];\n for (i=0, l=states.length; i<l; i++) {\n if (states[i].handlers) { solutions.push(states[i]); }\n }\n\n states = sortSolutions(solutions);\n\n var state = solutions[0];\n\n if (state && state.handlers) {\n return findHandler(state, path, queryParams);\n }\n }\n };\n\n function Target(path, matcher, delegate) {\n this.path = path;\n this.matcher = matcher;\n this.delegate = delegate;\n }\n\n Target.prototype = {\n to: function(target, callback) {\n var delegate = this.delegate;\n\n if (delegate && delegate.willAddRoute) {\n target = delegate.willAddRoute(this.matcher.target, target);\n }\n\n this.matcher.add(this.path, target);\n\n if (callback) {\n if (callback.length === 0) { throw new Error(\"You must have an argument in the function passed to `to`\"); }\n this.matcher.addChild(this.path, target, callback, this.delegate);\n }\n return this;\n },\n\n withQueryParams: function() {\n if (arguments.length === 0) { throw new Error(\"you must provide arguments to the withQueryParams method\"); }\n for (var i = 0; i < arguments.length; i++) {\n if (typeof arguments[i] !== \"string\") {\n throw new Error('you should call withQueryParams with a list of strings, e.g. withQueryParams(\"foo\", \"bar\")');\n }\n }\n var queryParams = [].slice.call(arguments);\n this.matcher.addQueryParams(this.path, queryParams);\n }\n };\n\n function Matcher(target) {\n this.routes = {};\n this.children = {};\n this.queryParams = {};\n this.target = target;\n }\n\n Matcher.prototype = {\n add: function(path, handler) {\n this.routes[path] = handler;\n },\n\n addQueryParams: function(path, params) {\n this.queryParams[path] = params;\n },\n\n addChild: function(path, target, callback, delegate) {\n var matcher = new Matcher(target);\n this.children[path] = matcher;\n\n var match = generateMatch(path, matcher, delegate);\n\n if (delegate && delegate.contextEntered) {\n delegate.contextEntered(target, match);\n }\n\n callback(match);\n }\n };\n\n function generateMatch(startingPath, matcher, delegate) {\n return function(path, nestedCallback) {\n var fullPath = startingPath + path;\n\n if (nestedCallback) {\n nestedCallback(generateMatch(fullPath, matcher, delegate));\n } else {\n return new Target(startingPath + path, matcher, delegate);\n }\n };\n }\n\n function addRoute(routeArray, path, handler, queryParams) {\n var len = 0;\n for (var i=0, l=routeArray.length; i<l; i++) {\n len += routeArray[i].path.length;\n }\n\n path = path.substr(len);\n var route = { path: path, handler: handler };\n if(queryParams) { route.queryParams = queryParams; }\n routeArray.push(route);\n }\n\n function eachRoute(baseRoute, matcher, callback, binding) {\n var routes = matcher.routes;\n var queryParams = matcher.queryParams;\n\n for (var path in routes) {\n if (routes.hasOwnProperty(path)) {\n var routeArray = baseRoute.slice();\n addRoute(routeArray, path, routes[path], queryParams[path]);\n\n if (matcher.children[path]) {\n eachRoute(routeArray, matcher.children[path], callback, binding);\n } else {\n callback.call(binding, routeArray);\n }\n }\n }\n }\n\n RouteRecognizer.prototype.map = function(callback, addRouteCallback) {\n var matcher = new Matcher();\n\n callback(generateMatch(\"\", matcher, this.delegate));\n\n eachRoute([], matcher, function(route) {\n if (addRouteCallback) { addRouteCallback(this, route); }\n else { this.add(route); }\n }, this);\n };\n return RouteRecognizer;\n });\n\n})();\n//@ sourceURL=ember-routing/vendor/route-recognizer");minispade.register('ember-routing/vendor/router', "(function() {define(\"router\",\n [\"route-recognizer\",\"rsvp\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n /**\n @private\n\n This file references several internal structures:\n\n ## `RecognizedHandler`\n\n * `{String} handler`: A handler name\n * `{Object} params`: A hash of recognized parameters\n\n ## `HandlerInfo`\n\n * `{Boolean} isDynamic`: whether a handler has any dynamic segments\n * `{String} name`: the name of a handler\n * `{Object} handler`: a handler object\n * `{Object} context`: the active context for the handler\n */\n\n var RouteRecognizer = __dependency1__;\n var RSVP = __dependency2__;\n\n var slice = Array.prototype.slice;\n\n\n\n /**\n @private\n\n A Transition is a thennable (a promise-like object) that represents\n an attempt to transition to another route. It can be aborted, either\n explicitly via `abort` or by attempting another transition while a\n previous one is still underway. An aborted transition can also\n be `retry()`d later.\n */\n\n function Transition(router, promise) {\n this.router = router;\n this.promise = promise;\n this.data = {};\n this.resolvedModels = {};\n this.providedModels = {};\n this.providedModelsArray = [];\n this.sequence = ++Transition.currentSequence;\n this.params = {};\n }\n\n Transition.currentSequence = 0;\n\n Transition.prototype = {\n targetName: null,\n urlMethod: 'update',\n providedModels: null,\n resolvedModels: null,\n params: null,\n pivotHandler: null,\n resolveIndex: 0,\n handlerInfos: null,\n\n isActive: true,\n\n /**\n The Transition's internal promise. Calling `.then` on this property\n is that same as calling `.then` on the Transition object itself, but\n this property is exposed for when you want to pass around a\n Transition's promise, but not the Transition object itself, since\n Transition object can be externally `abort`ed, while the promise\n cannot.\n */\n promise: null,\n\n /**\n Custom state can be stored on a Transition's `data` object.\n This can be useful for decorating a Transition within an earlier\n hook and shared with a later hook. Properties set on `data` will\n be copied to new transitions generated by calling `retry` on this\n transition.\n */\n data: null,\n\n /**\n A standard promise hook that resolves if the transition\n succeeds and rejects if it fails/redirects/aborts.\n\n Forwards to the internal `promise` property which you can\n use in situations where you want to pass around a thennable,\n but not the Transition itself.\n\n @param {Function} success\n @param {Function} failure\n */\n then: function(success, failure) {\n return this.promise.then(success, failure);\n },\n\n /**\n Aborts the Transition. Note you can also implicitly abort a transition\n by initiating another transition while a previous one is underway.\n */\n abort: function() {\n if (this.isAborted) { return this; }\n log(this.router, this.sequence, this.targetName + \": transition was aborted\");\n this.isAborted = true;\n this.isActive = false;\n this.router.activeTransition = null;\n return this;\n },\n\n /**\n Retries a previously-aborted transition (making sure to abort the\n transition if it's still active). Returns a new transition that\n represents the new attempt to transition.\n */\n retry: function() {\n this.abort();\n var recogHandlers = this.router.recognizer.handlersFor(this.targetName),\n handlerInfos = generateHandlerInfosWithQueryParams(this.router, recogHandlers, this.queryParams),\n newTransition = performTransition(this.router, handlerInfos, this.providedModelsArray, this.params, this.queryParams, this.data);\n\n return newTransition;\n },\n\n /**\n Sets the URL-changing method to be employed at the end of a\n successful transition. By default, a new Transition will just\n use `updateURL`, but passing 'replace' to this method will\n cause the URL to update using 'replaceWith' instead. Omitting\n a parameter will disable the URL change, allowing for transitions\n that don't update the URL at completion (this is also used for\n handleURL, since the URL has already changed before the\n transition took place).\n\n @param {String} method the type of URL-changing method to use\n at the end of a transition. Accepted values are 'replace',\n falsy values, or any other non-falsy value (which is\n interpreted as an updateURL transition).\n\n @return {Transition} this transition\n */\n method: function(method) {\n this.urlMethod = method;\n return this;\n },\n\n /**\n Fires an event on the current list of resolved/resolving\n handlers within this transition. Useful for firing events\n on route hierarchies that haven't fully been entered yet.\n\n @param {Boolean} ignoreFailure the name of the event to fire\n @param {String} name the name of the event to fire\n */\n trigger: function(ignoreFailure) {\n var args = slice.call(arguments);\n if (typeof ignoreFailure === 'boolean') {\n args.shift();\n } else {\n // Throw errors on unhandled trigger events by default\n ignoreFailure = false;\n }\n trigger(this.router, this.handlerInfos.slice(0, this.resolveIndex + 1), ignoreFailure, args);\n },\n\n toString: function() {\n return \"Transition (sequence \" + this.sequence + \")\";\n }\n };\n\n function Router() {\n this.recognizer = new RouteRecognizer();\n }\n\n // TODO: separate into module?\n Router.Transition = Transition;\n\n __exports__['default'] = Router;\n\n\n /**\n Promise reject reasons passed to promise rejection\n handlers for failed transitions.\n */\n Router.UnrecognizedURLError = function(message) {\n this.message = (message || \"UnrecognizedURLError\");\n this.name = \"UnrecognizedURLError\";\n };\n\n Router.TransitionAborted = function(message) {\n this.message = (message || \"TransitionAborted\");\n this.name = \"TransitionAborted\";\n };\n\n function errorTransition(router, reason) {\n return new Transition(router, RSVP.reject(reason));\n }\n\n\n Router.prototype = {\n /**\n The main entry point into the router. The API is essentially\n the same as the `map` method in `route-recognizer`.\n\n This method extracts the String handler at the last `.to()`\n call and uses it as the name of the whole route.\n\n @param {Function} callback\n */\n map: function(callback) {\n this.recognizer.delegate = this.delegate;\n\n this.recognizer.map(callback, function(recognizer, route) {\n var lastHandler = route[route.length - 1].handler;\n var args = [route, { as: lastHandler }];\n recognizer.add.apply(recognizer, args);\n });\n },\n\n hasRoute: function(route) {\n return this.recognizer.hasRoute(route);\n },\n\n /**\n Clears the current and target route handlers and triggers exit\n on each of them starting at the leaf and traversing up through\n its ancestors.\n */\n reset: function() {\n eachHandler(this.currentHandlerInfos || [], function(handlerInfo) {\n var handler = handlerInfo.handler;\n if (handler.exit) {\n handler.exit();\n }\n });\n this.currentHandlerInfos = null;\n this.targetHandlerInfos = null;\n },\n\n activeTransition: null,\n\n /**\n var handler = handlerInfo.handler;\n The entry point for handling a change to the URL (usually\n via the back and forward button).\n\n Returns an Array of handlers and the parameters associated\n with those parameters.\n\n @param {String} url a URL to process\n\n @return {Array} an Array of `[handler, parameter]` tuples\n */\n handleURL: function(url) {\n // Perform a URL-based transition, but don't change\n // the URL afterward, since it already happened.\n var args = slice.call(arguments);\n if (url.charAt(0) !== '/') { args[0] = '/' + url; }\n return doTransition(this, args).method(null);\n },\n\n /**\n Hook point for updating the URL.\n\n @param {String} url a URL to update to\n */\n updateURL: function() {\n throw new Error(\"updateURL is not implemented\");\n },\n\n /**\n Hook point for replacing the current URL, i.e. with replaceState\n\n By default this behaves the same as `updateURL`\n\n @param {String} url a URL to update to\n */\n replaceURL: function(url) {\n this.updateURL(url);\n },\n\n /**\n Transition into the specified named route.\n\n If necessary, trigger the exit callback on any handlers\n that are no longer represented by the target route.\n\n @param {String} name the name of the route\n */\n transitionTo: function(name) {\n return doTransition(this, arguments);\n },\n\n intermediateTransitionTo: function(name) {\n doTransition(this, arguments, true);\n },\n\n /**\n Identical to `transitionTo` except that the current URL will be replaced\n if possible.\n\n This method is intended primarily for use with `replaceState`.\n\n @param {String} name the name of the route\n */\n replaceWith: function(name) {\n return doTransition(this, arguments).method('replace');\n },\n\n /**\n @private\n\n This method takes a handler name and a list of contexts and returns\n a serialized parameter hash suitable to pass to `recognizer.generate()`.\n\n @param {String} handlerName\n @param {Array[Object]} contexts\n @return {Object} a serialized parameter hash\n */\n\n paramsForHandler: function(handlerName, contexts) {\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1));\n return paramsForHandler(this, handlerName, partitionedArgs[0], partitionedArgs[1]);\n },\n\n /**\n This method takes a handler name and returns a list of query params\n that are valid to pass to the handler or its parents\n\n @param {String} handlerName\n @return {Array[String]} a list of query parameters\n */\n queryParamsForHandler: function (handlerName) {\n return queryParamsForHandler(this, handlerName);\n },\n\n /**\n Take a named route and context objects and generate a\n URL.\n\n @param {String} name the name of the route to generate\n a URL for\n @param {...Object} objects a list of objects to serialize\n\n @return {String} a URL\n */\n generate: function(handlerName) {\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1)),\n suppliedParams = partitionedArgs[0],\n queryParams = partitionedArgs[1];\n\n var params = paramsForHandler(this, handlerName, suppliedParams, queryParams),\n validQueryParams = queryParamsForHandler(this, handlerName);\n\n var missingParams = [];\n\n for (var key in queryParams) {\n if (queryParams.hasOwnProperty(key) && !~validQueryParams.indexOf(key)) {\n missingParams.push(key);\n }\n }\n\n if (missingParams.length > 0) {\n var err = 'You supplied the params ';\n err += missingParams.map(function(param) {\n return '\"' + param + \"=\" + queryParams[param] + '\"';\n }).join(' and ');\n\n err += ' which are not valid for the \"' + handlerName + '\" handler or its parents';\n\n throw new Error(err);\n }\n\n return this.recognizer.generate(handlerName, params);\n },\n\n isActive: function(handlerName) {\n var partitionedArgs = extractQueryParams(slice.call(arguments, 1)),\n contexts = partitionedArgs[0],\n queryParams = partitionedArgs[1],\n activeQueryParams = {},\n effectiveQueryParams = {};\n\n var targetHandlerInfos = this.targetHandlerInfos,\n found = false, names, object, handlerInfo, handlerObj;\n\n if (!targetHandlerInfos) { return false; }\n\n var recogHandlers = this.recognizer.handlersFor(targetHandlerInfos[targetHandlerInfos.length - 1].name);\n for (var i=targetHandlerInfos.length-1; i>=0; i--) {\n handlerInfo = targetHandlerInfos[i];\n if (handlerInfo.name === handlerName) { found = true; }\n\n if (found) {\n var recogHandler = recogHandlers[i];\n\n merge(activeQueryParams, handlerInfo.queryParams);\n if (queryParams !== false) {\n merge(effectiveQueryParams, handlerInfo.queryParams);\n mergeSomeKeys(effectiveQueryParams, queryParams, recogHandler.queryParams);\n }\n\n if (handlerInfo.isDynamic && contexts.length > 0) {\n object = contexts.pop();\n\n if (isParam(object)) {\n var name = recogHandler.names[0];\n if (\"\" + object !== this.currentParams[name]) { return false; }\n } else if (handlerInfo.context !== object) {\n return false;\n }\n }\n }\n }\n\n\n return contexts.length === 0 && found && queryParamsEqual(activeQueryParams, effectiveQueryParams);\n },\n\n trigger: function(name) {\n var args = slice.call(arguments);\n trigger(this, this.currentHandlerInfos, false, args);\n },\n\n /**\n Hook point for logging transition status updates.\n\n @param {String} message The message to log.\n */\n log: null\n };\n\n /**\n @private\n\n Used internally for both URL and named transition to determine\n a shared pivot parent route and other data necessary to perform\n a transition.\n */\n function getMatchPoint(router, handlers, objects, inputParams, queryParams) {\n\n var matchPoint = handlers.length,\n providedModels = {}, i,\n currentHandlerInfos = router.currentHandlerInfos || [],\n params = {},\n oldParams = router.currentParams || {},\n activeTransition = router.activeTransition,\n handlerParams = {},\n obj;\n\n objects = slice.call(objects);\n merge(params, inputParams);\n\n for (i = handlers.length - 1; i >= 0; i--) {\n var handlerObj = handlers[i],\n handlerName = handlerObj.handler,\n oldHandlerInfo = currentHandlerInfos[i],\n hasChanged = false;\n\n // Check if handler names have changed.\n if (!oldHandlerInfo || oldHandlerInfo.name !== handlerObj.handler) { hasChanged = true; }\n\n if (handlerObj.isDynamic) {\n // URL transition.\n\n if (obj = getMatchPointObject(objects, handlerName, activeTransition, true, params)) {\n hasChanged = true;\n providedModels[handlerName] = obj;\n } else {\n handlerParams[handlerName] = {};\n for (var prop in handlerObj.params) {\n if (!handlerObj.params.hasOwnProperty(prop)) { continue; }\n var newParam = handlerObj.params[prop];\n if (oldParams[prop] !== newParam) { hasChanged = true; }\n handlerParams[handlerName][prop] = params[prop] = newParam;\n }\n }\n } else if (handlerObj.hasOwnProperty('names')) {\n // Named transition.\n\n if (objects.length) { hasChanged = true; }\n\n if (obj = getMatchPointObject(objects, handlerName, activeTransition, handlerObj.names[0], params)) {\n providedModels[handlerName] = obj;\n } else {\n var names = handlerObj.names;\n handlerParams[handlerName] = {};\n for (var j = 0, len = names.length; j < len; ++j) {\n var name = names[j];\n handlerParams[handlerName][name] = params[name] = params[name] || oldParams[name];\n }\n }\n }\n\n // If there is an old handler, see if query params are the same. If there isn't an old handler,\n // hasChanged will already be true here\n if(oldHandlerInfo && !queryParamsEqual(oldHandlerInfo.queryParams, handlerObj.queryParams)) {\n hasChanged = true;\n }\n\n if (hasChanged) { matchPoint = i; }\n }\n\n if (objects.length > 0) {\n throw new Error(\"More context objects were passed than there are dynamic segments for the route: \" + handlers[handlers.length - 1].handler);\n }\n\n var pivotHandlerInfo = currentHandlerInfos[matchPoint - 1],\n pivotHandler = pivotHandlerInfo && pivotHandlerInfo.handler;\n\n return { matchPoint: matchPoint, providedModels: providedModels, params: params, handlerParams: handlerParams, pivotHandler: pivotHandler };\n }\n\n function getMatchPointObject(objects, handlerName, activeTransition, paramName, params) {\n\n if (objects.length && paramName) {\n\n var object = objects.pop();\n\n // If provided object is string or number, treat as param.\n if (isParam(object)) {\n params[paramName] = object.toString();\n } else {\n return object;\n }\n } else if (activeTransition) {\n // Use model from previous transition attempt, preferably the resolved one.\n return activeTransition.resolvedModels[handlerName] ||\n (paramName && activeTransition.providedModels[handlerName]);\n }\n }\n\n function isParam(object) {\n return (typeof object === \"string\" || object instanceof String || typeof object === \"number\" || object instanceof Number);\n }\n\n\n\n /**\n @private\n\n This method takes a handler name and returns a list of query params\n that are valid to pass to the handler or its parents\n\n @param {Router} router\n @param {String} handlerName\n @return {Array[String]} a list of query parameters\n */\n function queryParamsForHandler(router, handlerName) {\n var handlers = router.recognizer.handlersFor(handlerName),\n queryParams = [];\n\n for (var i = 0; i < handlers.length; i++) {\n queryParams.push.apply(queryParams, handlers[i].queryParams || []);\n }\n\n return queryParams;\n }\n /**\n @private\n\n This method takes a handler name and a list of contexts and returns\n a serialized parameter hash suitable to pass to `recognizer.generate()`.\n\n @param {Router} router\n @param {String} handlerName\n @param {Array[Object]} objects\n @return {Object} a serialized parameter hash\n */\n function paramsForHandler(router, handlerName, objects, queryParams) {\n\n var handlers = router.recognizer.handlersFor(handlerName),\n params = {},\n handlerInfos = generateHandlerInfosWithQueryParams(router, handlers, queryParams),\n matchPoint = getMatchPoint(router, handlerInfos, objects).matchPoint,\n mergedQueryParams = {},\n object, handlerObj, handler, names, i;\n\n params.queryParams = {};\n\n for (i=0; i<handlers.length; i++) {\n handlerObj = handlers[i];\n handler = router.getHandler(handlerObj.handler);\n names = handlerObj.names;\n\n // If it's a dynamic segment\n if (names.length) {\n // If we have objects, use them\n if (i >= matchPoint) {\n object = objects.shift();\n // Otherwise use existing context\n } else {\n object = handler.context;\n }\n\n // Serialize to generate params\n merge(params, serialize(handler, object, names));\n }\n if (queryParams !== false) {\n mergeSomeKeys(params.queryParams, router.currentQueryParams, handlerObj.queryParams);\n mergeSomeKeys(params.queryParams, queryParams, handlerObj.queryParams);\n }\n }\n\n if (queryParamsEqual(params.queryParams, {})) { delete params.queryParams; }\n return params;\n }\n\n function merge(hash, other) {\n for (var prop in other) {\n if (other.hasOwnProperty(prop)) { hash[prop] = other[prop]; }\n }\n }\n\n function mergeSomeKeys(hash, other, keys) {\n if (!other || !keys) { return; }\n for(var i = 0; i < keys.length; i++) {\n var key = keys[i], value;\n if(other.hasOwnProperty(key)) {\n value = other[key];\n if(value === null || value === false || typeof value === \"undefined\") {\n delete hash[key];\n } else {\n hash[key] = other[key];\n }\n }\n }\n }\n\n /**\n @private\n */\n\n function generateHandlerInfosWithQueryParams(router, handlers, queryParams) {\n var handlerInfos = [];\n\n for (var i = 0; i < handlers.length; i++) {\n var handler = handlers[i],\n handlerInfo = { handler: handler.handler, names: handler.names, context: handler.context, isDynamic: handler.isDynamic },\n activeQueryParams = {};\n\n if (queryParams !== false) {\n mergeSomeKeys(activeQueryParams, router.currentQueryParams, handler.queryParams);\n mergeSomeKeys(activeQueryParams, queryParams, handler.queryParams);\n }\n\n if (handler.queryParams && handler.queryParams.length > 0) {\n handlerInfo.queryParams = activeQueryParams;\n }\n\n handlerInfos.push(handlerInfo);\n }\n\n return handlerInfos;\n }\n\n /**\n @private\n */\n function createQueryParamTransition(router, queryParams, isIntermediate) {\n var currentHandlers = router.currentHandlerInfos,\n currentHandler = currentHandlers[currentHandlers.length - 1],\n name = currentHandler.name;\n\n log(router, \"Attempting query param transition\");\n\n return createNamedTransition(router, [name, queryParams], isIntermediate);\n }\n\n /**\n @private\n */\n function createNamedTransition(router, args, isIntermediate) {\n var partitionedArgs = extractQueryParams(args),\n pureArgs = partitionedArgs[0],\n queryParams = partitionedArgs[1],\n handlers = router.recognizer.handlersFor(pureArgs[0]),\n handlerInfos = generateHandlerInfosWithQueryParams(router, handlers, queryParams);\n\n\n log(router, \"Attempting transition to \" + pureArgs[0]);\n\n return performTransition(router,\n handlerInfos,\n slice.call(pureArgs, 1),\n router.currentParams,\n queryParams,\n null,\n isIntermediate);\n }\n\n /**\n @private\n */\n function createURLTransition(router, url, isIntermediate) {\n var results = router.recognizer.recognize(url),\n currentHandlerInfos = router.currentHandlerInfos,\n queryParams = {},\n i, len;\n\n log(router, \"Attempting URL transition to \" + url);\n\n if (results) {\n // Make sure this route is actually accessible by URL.\n for (i = 0, len = results.length; i < len; ++i) {\n\n if (router.getHandler(results[i].handler).inaccessibleByURL) {\n results = null;\n break;\n }\n }\n }\n\n if (!results) {\n return errorTransition(router, new Router.UnrecognizedURLError(url));\n }\n\n for(i = 0, len = results.length; i < len; i++) {\n merge(queryParams, results[i].queryParams);\n }\n\n return performTransition(router, results, [], {}, queryParams, null, isIntermediate);\n }\n\n\n /**\n @private\n\n Takes an Array of `HandlerInfo`s, figures out which ones are\n exiting, entering, or changing contexts, and calls the\n proper handler hooks.\n\n For example, consider the following tree of handlers. Each handler is\n followed by the URL segment it handles.\n\n ```\n |~index (\"/\")\n | |~posts (\"/posts\")\n | | |-showPost (\"/:id\")\n | | |-newPost (\"/new\")\n | | |-editPost (\"/edit\")\n | |~about (\"/about/:id\")\n ```\n\n Consider the following transitions:\n\n 1. A URL transition to `/posts/1`.\n 1. Triggers the `*model` callbacks on the\n `index`, `posts`, and `showPost` handlers\n 2. Triggers the `enter` callback on the same\n 3. Triggers the `setup` callback on the same\n 2. A direct transition to `newPost`\n 1. Triggers the `exit` callback on `showPost`\n 2. Triggers the `enter` callback on `newPost`\n 3. Triggers the `setup` callback on `newPost`\n 3. A direct transition to `about` with a specified\n context object\n 1. Triggers the `exit` callback on `newPost`\n and `posts`\n 2. Triggers the `serialize` callback on `about`\n 3. Triggers the `enter` callback on `about`\n 4. Triggers the `setup` callback on `about`\n\n @param {Transition} transition\n @param {Array[HandlerInfo]} handlerInfos\n */\n function setupContexts(transition, handlerInfos) {\n var router = transition.router,\n partition = partitionHandlers(router.currentHandlerInfos || [], handlerInfos);\n\n router.targetHandlerInfos = handlerInfos;\n\n eachHandler(partition.exited, function(handlerInfo) {\n var handler = handlerInfo.handler;\n delete handler.context;\n if (handler.exit) { handler.exit(); }\n });\n\n var currentHandlerInfos = partition.unchanged.slice();\n router.currentHandlerInfos = currentHandlerInfos;\n\n eachHandler(partition.updatedContext, function(handlerInfo) {\n handlerEnteredOrUpdated(transition, currentHandlerInfos, handlerInfo, false);\n });\n\n eachHandler(partition.entered, function(handlerInfo) {\n handlerEnteredOrUpdated(transition, currentHandlerInfos, handlerInfo, true);\n });\n }\n\n /**\n @private\n\n Helper method used by setupContexts. Handles errors or redirects\n that may happen in enter/setup.\n */\n function handlerEnteredOrUpdated(transition, currentHandlerInfos, handlerInfo, enter) {\n var handler = handlerInfo.handler,\n context = handlerInfo.context;\n\n try {\n if (enter && handler.enter) { handler.enter(); }\n checkAbort(transition);\n\n setContext(handler, context);\n setQueryParams(handler, handlerInfo.queryParams);\n\n if (handler.setup) { handler.setup(context, handlerInfo.queryParams); }\n checkAbort(transition);\n } catch(e) {\n if (!(e instanceof Router.TransitionAborted)) {\n // Trigger the `error` event starting from this failed handler.\n transition.trigger(true, 'error', e, transition, handler);\n }\n\n // Propagate the error so that the transition promise will reject.\n throw e;\n }\n\n currentHandlerInfos.push(handlerInfo);\n }\n\n\n /**\n @private\n\n Iterates over an array of `HandlerInfo`s, passing the handler\n and context into the callback.\n\n @param {Array[HandlerInfo]} handlerInfos\n @param {Function(Object, Object)} callback\n */\n function eachHandler(handlerInfos, callback) {\n for (var i=0, l=handlerInfos.length; i<l; i++) {\n callback(handlerInfos[i]);\n }\n }\n\n /**\n @private\n\n determines if two queryparam objects are the same or not\n **/\n function queryParamsEqual(a, b) {\n a = a || {};\n b = b || {};\n var checkedKeys = [], key;\n for(key in a) {\n if (!a.hasOwnProperty(key)) { continue; }\n if(b[key] !== a[key]) { return false; }\n checkedKeys.push(key);\n }\n for(key in b) {\n if (!b.hasOwnProperty(key)) { continue; }\n if (~checkedKeys.indexOf(key)) { continue; }\n // b has a key not in a\n return false;\n }\n return true;\n }\n\n /**\n @private\n\n This function is called when transitioning from one URL to\n another to determine which handlers are no longer active,\n which handlers are newly active, and which handlers remain\n active but have their context changed.\n\n Take a list of old handlers and new handlers and partition\n them into four buckets:\n\n * unchanged: the handler was active in both the old and\n new URL, and its context remains the same\n * updated context: the handler was active in both the\n old and new URL, but its context changed. The handler's\n `setup` method, if any, will be called with the new\n context.\n * exited: the handler was active in the old URL, but is\n no longer active.\n * entered: the handler was not active in the old URL, but\n is now active.\n\n The PartitionedHandlers structure has four fields:\n\n * `updatedContext`: a list of `HandlerInfo` objects that\n represent handlers that remain active but have a changed\n context\n * `entered`: a list of `HandlerInfo` objects that represent\n handlers that are newly active\n * `exited`: a list of `HandlerInfo` objects that are no\n longer active.\n * `unchanged`: a list of `HanderInfo` objects that remain active.\n\n @param {Array[HandlerInfo]} oldHandlers a list of the handler\n information for the previous URL (or `[]` if this is the\n first handled transition)\n @param {Array[HandlerInfo]} newHandlers a list of the handler\n information for the new URL\n\n @return {Partition}\n */\n function partitionHandlers(oldHandlers, newHandlers) {\n var handlers = {\n updatedContext: [],\n exited: [],\n entered: [],\n unchanged: []\n };\n\n var handlerChanged, contextChanged, queryParamsChanged, i, l;\n\n for (i=0, l=newHandlers.length; i<l; i++) {\n var oldHandler = oldHandlers[i], newHandler = newHandlers[i];\n\n if (!oldHandler || oldHandler.handler !== newHandler.handler) {\n handlerChanged = true;\n } else if (!queryParamsEqual(oldHandler.queryParams, newHandler.queryParams)) {\n queryParamsChanged = true;\n }\n\n if (handlerChanged) {\n handlers.entered.push(newHandler);\n if (oldHandler) { handlers.exited.unshift(oldHandler); }\n } else if (contextChanged || oldHandler.context !== newHandler.context || queryParamsChanged) {\n contextChanged = true;\n handlers.updatedContext.push(newHandler);\n } else {\n handlers.unchanged.push(oldHandler);\n }\n }\n\n for (i=newHandlers.length, l=oldHandlers.length; i<l; i++) {\n handlers.exited.unshift(oldHandlers[i]);\n }\n\n return handlers;\n }\n\n function trigger(router, handlerInfos, ignoreFailure, args) {\n if (router.triggerEvent) {\n router.triggerEvent(handlerInfos, ignoreFailure, args);\n return;\n }\n\n var name = args.shift();\n\n if (!handlerInfos) {\n if (ignoreFailure) { return; }\n throw new Error(\"Could not trigger event '\" + name + \"'. There are no active handlers\");\n }\n\n var eventWasHandled = false;\n\n for (var i=handlerInfos.length-1; i>=0; i--) {\n var handlerInfo = handlerInfos[i],\n handler = handlerInfo.handler;\n\n if (handler.events && handler.events[name]) {\n if (handler.events[name].apply(handler, args) === true) {\n eventWasHandled = true;\n } else {\n return;\n }\n }\n }\n\n if (!eventWasHandled && !ignoreFailure) {\n throw new Error(\"Nothing handled the event '\" + name + \"'.\");\n }\n }\n\n function setContext(handler, context) {\n handler.context = context;\n if (handler.contextDidChange) { handler.contextDidChange(); }\n }\n\n function setQueryParams(handler, queryParams) {\n handler.queryParams = queryParams;\n if (handler.queryParamsDidChange) { handler.queryParamsDidChange(); }\n }\n\n\n /**\n @private\n\n Extracts query params from the end of an array\n **/\n\n function extractQueryParams(array) {\n var len = (array && array.length), head, queryParams;\n\n if(len && len > 0 && array[len - 1] && array[len - 1].hasOwnProperty('queryParams')) {\n queryParams = array[len - 1].queryParams;\n head = slice.call(array, 0, len - 1);\n return [head, queryParams];\n } else {\n return [array, null];\n }\n }\n\n function performIntermediateTransition(router, recogHandlers, matchPointResults) {\n\n var handlerInfos = generateHandlerInfos(router, recogHandlers);\n for (var i = 0; i < handlerInfos.length; ++i) {\n var handlerInfo = handlerInfos[i];\n handlerInfo.context = matchPointResults.providedModels[handlerInfo.name];\n }\n\n var stubbedTransition = {\n router: router,\n isAborted: false\n };\n\n setupContexts(stubbedTransition, handlerInfos);\n }\n\n /**\n @private\n\n Creates, begins, and returns a Transition.\n */\n function performTransition(router, recogHandlers, providedModelsArray, params, queryParams, data, isIntermediate) {\n\n var matchPointResults = getMatchPoint(router, recogHandlers, providedModelsArray, params, queryParams),\n targetName = recogHandlers[recogHandlers.length - 1].handler,\n wasTransitioning = false,\n currentHandlerInfos = router.currentHandlerInfos;\n\n if (isIntermediate) {\n return performIntermediateTransition(router, recogHandlers, matchPointResults);\n }\n\n // Check if there's already a transition underway.\n if (router.activeTransition) {\n if (transitionsIdentical(router.activeTransition, targetName, providedModelsArray, queryParams)) {\n return router.activeTransition;\n }\n router.activeTransition.abort();\n wasTransitioning = true;\n }\n\n var deferred = RSVP.defer(),\n transition = new Transition(router, deferred.promise);\n\n transition.targetName = targetName;\n transition.providedModels = matchPointResults.providedModels;\n transition.providedModelsArray = providedModelsArray;\n transition.params = matchPointResults.params;\n transition.data = data || {};\n transition.queryParams = queryParams;\n transition.pivotHandler = matchPointResults.pivotHandler;\n router.activeTransition = transition;\n\n var handlerInfos = generateHandlerInfos(router, recogHandlers);\n transition.handlerInfos = handlerInfos;\n\n // Fire 'willTransition' event on current handlers, but don't fire it\n // if a transition was already underway.\n if (!wasTransitioning) {\n trigger(router, currentHandlerInfos, true, ['willTransition', transition]);\n }\n\n log(router, transition.sequence, \"Beginning validation for transition to \" + transition.targetName);\n validateEntry(transition, matchPointResults.matchPoint, matchPointResults.handlerParams)\n .then(transitionSuccess, transitionFailure);\n\n return transition;\n\n function transitionSuccess() {\n checkAbort(transition);\n\n try {\n finalizeTransition(transition, handlerInfos);\n\n // currentHandlerInfos was updated in finalizeTransition\n trigger(router, router.currentHandlerInfos, true, ['didTransition']);\n\n if (router.didTransition) {\n router.didTransition(handlerInfos);\n }\n\n log(router, transition.sequence, \"TRANSITION COMPLETE.\");\n\n // Resolve with the final handler.\n transition.isActive = false;\n deferred.resolve(handlerInfos[handlerInfos.length - 1].handler);\n } catch(e) {\n deferred.reject(e);\n }\n\n // Don't nullify if another transition is underway (meaning\n // there was a transition initiated with enter/setup).\n if (!transition.isAborted) {\n router.activeTransition = null;\n }\n }\n\n function transitionFailure(reason) {\n deferred.reject(reason);\n }\n }\n\n /**\n @private\n\n Accepts handlers in Recognizer format, either returned from\n recognize() or handlersFor(), and returns unified\n `HandlerInfo`s.\n */\n function generateHandlerInfos(router, recogHandlers) {\n var handlerInfos = [];\n for (var i = 0, len = recogHandlers.length; i < len; ++i) {\n var handlerObj = recogHandlers[i],\n isDynamic = handlerObj.isDynamic || (handlerObj.names && handlerObj.names.length);\n\n var handlerInfo = {\n isDynamic: !!isDynamic,\n name: handlerObj.handler,\n handler: router.getHandler(handlerObj.handler)\n };\n if(handlerObj.queryParams) {\n handlerInfo.queryParams = handlerObj.queryParams;\n }\n handlerInfos.push(handlerInfo);\n }\n return handlerInfos;\n }\n\n /**\n @private\n */\n function transitionsIdentical(oldTransition, targetName, providedModelsArray, queryParams) {\n\n if (oldTransition.targetName !== targetName) { return false; }\n\n var oldModels = oldTransition.providedModelsArray;\n if (oldModels.length !== providedModelsArray.length) { return false; }\n\n for (var i = 0, len = oldModels.length; i < len; ++i) {\n if (oldModels[i] !== providedModelsArray[i]) { return false; }\n }\n\n if(!queryParamsEqual(oldTransition.queryParams, queryParams)) {\n return false;\n }\n\n return true;\n }\n\n /**\n @private\n\n Updates the URL (if necessary) and calls `setupContexts`\n to update the router's array of `currentHandlerInfos`.\n */\n function finalizeTransition(transition, handlerInfos) {\n\n log(transition.router, transition.sequence, \"Validation succeeded, finalizing transition;\");\n\n var router = transition.router,\n seq = transition.sequence,\n handlerName = handlerInfos[handlerInfos.length - 1].name,\n urlMethod = transition.urlMethod,\n i;\n\n // Collect params for URL.\n var objects = [], providedModels = transition.providedModelsArray.slice();\n for (i = handlerInfos.length - 1; i>=0; --i) {\n var handlerInfo = handlerInfos[i];\n if (handlerInfo.isDynamic) {\n var providedModel = providedModels.pop();\n objects.unshift(isParam(providedModel) ? providedModel.toString() : handlerInfo.context);\n }\n\n if (handlerInfo.handler.inaccessibleByURL) {\n urlMethod = null;\n }\n }\n\n var newQueryParams = {};\n for (i = handlerInfos.length - 1; i>=0; --i) {\n merge(newQueryParams, handlerInfos[i].queryParams);\n }\n router.currentQueryParams = newQueryParams;\n\n\n var params = paramsForHandler(router, handlerName, objects, transition.queryParams);\n\n router.currentParams = params;\n\n if (urlMethod) {\n var url = router.recognizer.generate(handlerName, params);\n\n if (urlMethod === 'replace') {\n router.replaceURL(url);\n } else {\n // Assume everything else is just a URL update for now.\n router.updateURL(url);\n }\n }\n\n setupContexts(transition, handlerInfos);\n }\n\n /**\n @private\n\n Internal function used to construct the chain of promises used\n to validate a transition. Wraps calls to `beforeModel`, `model`,\n and `afterModel` in promises, and checks for redirects/aborts\n between each.\n */\n function validateEntry(transition, matchPoint, handlerParams) {\n\n var handlerInfos = transition.handlerInfos,\n index = transition.resolveIndex;\n\n if (index === handlerInfos.length) {\n // No more contexts to resolve.\n return RSVP.resolve(transition.resolvedModels);\n }\n\n var router = transition.router,\n handlerInfo = handlerInfos[index],\n handler = handlerInfo.handler,\n handlerName = handlerInfo.name,\n seq = transition.sequence;\n\n if (index < matchPoint) {\n log(router, seq, handlerName + \": using context from already-active handler\");\n\n // We're before the match point, so don't run any hooks,\n // just use the already resolved context from the handler.\n transition.resolvedModels[handlerInfo.name] =\n transition.providedModels[handlerInfo.name] ||\n handlerInfo.handler.context;\n return proceed();\n }\n\n transition.trigger(true, 'willResolveModel', transition, handler);\n\n return RSVP.resolve().then(handleAbort)\n .then(beforeModel)\n .then(handleAbort)\n .then(model)\n .then(handleAbort)\n .then(afterModel)\n .then(handleAbort)\n .then(null, handleError)\n .then(proceed);\n\n function handleAbort(result) {\n if (transition.isAborted) {\n log(transition.router, transition.sequence, \"detected abort.\");\n return RSVP.reject(new Router.TransitionAborted());\n }\n\n return result;\n }\n\n function handleError(reason) {\n if (reason instanceof Router.TransitionAborted || transition.isAborted) {\n // if the transition was aborted and *no additional* error was thrown,\n // reject with the Router.TransitionAborted instance\n return RSVP.reject(reason);\n }\n\n // otherwise, we're here because of a different error\n transition.abort();\n\n log(router, seq, handlerName + \": handling error: \" + reason);\n\n // An error was thrown / promise rejected, so fire an\n // `error` event from this handler info up to root.\n transition.trigger(true, 'error', reason, transition, handlerInfo.handler);\n\n // Propagate the original error.\n return RSVP.reject(reason);\n }\n\n function beforeModel() {\n\n log(router, seq, handlerName + \": calling beforeModel hook\");\n\n var args;\n\n if (handlerInfo.queryParams) {\n args = [handlerInfo.queryParams, transition];\n } else {\n args = [transition];\n }\n\n var p = handler.beforeModel && handler.beforeModel.apply(handler, args);\n return (p instanceof Transition) ? null : p;\n }\n\n function model() {\n log(router, seq, handlerName + \": resolving model\");\n var p = getModel(handlerInfo, transition, handlerParams[handlerName], index >= matchPoint);\n return (p instanceof Transition) ? null : p;\n }\n\n function afterModel(context) {\n\n log(router, seq, handlerName + \": calling afterModel hook\");\n\n // Pass the context and resolved parent contexts to afterModel, but we don't\n // want to use the value returned from `afterModel` in any way, but rather\n // always resolve with the original `context` object.\n\n transition.resolvedModels[handlerInfo.name] = context;\n\n var args;\n\n if (handlerInfo.queryParams) {\n args = [context, handlerInfo.queryParams, transition];\n } else {\n args = [context, transition];\n }\n\n var p = handler.afterModel && handler.afterModel.apply(handler, args);\n return (p instanceof Transition) ? null : p;\n }\n\n function proceed() {\n log(router, seq, handlerName + \": validation succeeded, proceeding\");\n\n handlerInfo.context = transition.resolvedModels[handlerInfo.name];\n transition.resolveIndex++;\n return validateEntry(transition, matchPoint, handlerParams);\n }\n }\n\n /**\n @private\n\n Throws a TransitionAborted if the provided transition has been aborted.\n */\n function checkAbort(transition) {\n if (transition.isAborted) {\n log(transition.router, transition.sequence, \"detected abort.\");\n throw new Router.TransitionAborted();\n }\n }\n\n /**\n @private\n\n Encapsulates the logic for whether to call `model` on a route,\n or use one of the models provided to `transitionTo`.\n */\n function getModel(handlerInfo, transition, handlerParams, needsUpdate) {\n var handler = handlerInfo.handler,\n handlerName = handlerInfo.name, args;\n\n if (!needsUpdate && handler.hasOwnProperty('context')) {\n return handler.context;\n }\n\n if (transition.providedModels.hasOwnProperty(handlerName)) {\n var providedModel = transition.providedModels[handlerName];\n return typeof providedModel === 'function' ? providedModel() : providedModel;\n }\n\n if (handlerInfo.queryParams) {\n args = [handlerParams || {}, handlerInfo.queryParams, transition];\n } else {\n args = [handlerParams || {}, transition, handlerInfo.queryParams];\n }\n\n return handler.model && handler.model.apply(handler, args);\n }\n\n /**\n @private\n */\n function log(router, sequence, msg) {\n\n if (!router.log) { return; }\n\n if (arguments.length === 3) {\n router.log(\"Transition #\" + sequence + \": \" + msg);\n } else {\n msg = sequence;\n router.log(msg);\n }\n }\n\n /**\n @private\n\n Begins and returns a Transition based on the provided\n arguments. Accepts arguments in the form of both URL\n transitions and named transitions.\n\n @param {Router} router\n @param {Array[Object]} args arguments passed to transitionTo,\n replaceWith, or handleURL\n */\n function doTransition(router, args, isIntermediate) {\n // Normalize blank transitions to root URL transitions.\n var name = args[0] || '/';\n\n if(args.length === 1 && args[0].hasOwnProperty('queryParams')) {\n return createQueryParamTransition(router, args[0], isIntermediate);\n } else if (name.charAt(0) === '/') {\n return createURLTransition(router, name, isIntermediate);\n } else {\n return createNamedTransition(router, slice.call(args), isIntermediate);\n }\n }\n\n /**\n @private\n\n Serializes a handler using its custom `serialize` method or\n by a default that looks up the expected property name from\n the dynamic segment.\n\n @param {Object} handler a router handler\n @param {Object} model the model to be serialized for this handler\n @param {Array[Object]} names the names array attached to an\n handler object returned from router.recognizer.handlersFor()\n */\n function serialize(handler, model, names) {\n\n var object = {};\n if (isParam(model)) {\n object[names[0]] = model;\n return object;\n }\n\n // Use custom serialize if it exists.\n if (handler.serialize) {\n return handler.serialize(model, names);\n }\n\n if (names.length !== 1) { return; }\n\n var name = names[0];\n\n if (/_id$/.test(name)) {\n object[name] = model.id;\n } else {\n object[name] = model;\n }\n return object;\n }\n });\n\n})();\n//@ sourceURL=ember-routing/vendor/router");minispade.register('ember-runtime/computed/array_computed', "(function() {minispade.require('ember-metal/computed');\nminispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/computed/reduce_computed');\n\nvar ReduceComputedProperty = Ember.ReduceComputedProperty,\n a_slice = [].slice,\n o_create = Ember.create,\n forEach = Ember.EnumerableUtils.forEach;\n\nfunction ArrayComputedProperty() {\n var cp = this;\n\n ReduceComputedProperty.apply(this, arguments);\n\n this.func = (function(reduceFunc) {\n return function (propertyName) {\n if (!cp._hasInstanceMeta(this, propertyName)) {\n // When we recompute an array computed property, we need already\n // retrieved arrays to be updated; we can't simply empty the cache and\n // hope the array is re-retrieved.\n forEach(cp._dependentKeys, function(dependentKey) {\n Ember.addObserver(this, dependentKey, function() {\n cp.recomputeOnce.call(this, propertyName);\n });\n }, this);\n }\n\n return reduceFunc.apply(this, arguments);\n };\n })(this.func);\n\n return this;\n}\nEmber.ArrayComputedProperty = ArrayComputedProperty;\nArrayComputedProperty.prototype = o_create(ReduceComputedProperty.prototype);\nArrayComputedProperty.prototype.initialValue = function () {\n return Ember.A();\n};\nArrayComputedProperty.prototype.resetValue = function (array) {\n array.clear();\n return array;\n};\n\n/**\n Creates a computed property which operates on dependent arrays and\n is updated with \"one at a time\" semantics. When items are added or\n removed from the dependent array(s) an array computed only operates\n on the change instead of re-evaluating the entire array. This should\n return an array, if you'd like to use \"one at a time\" semantics and\n compute some value other then an array look at\n `Ember.reduceComputed`.\n\n If there are more than one arguments the first arguments are\n considered to be dependent property keys. The last argument is\n required to be an options object. The options object can have the\n following three properties.\n\n `initialize` - An optional initialize function. Typically this will be used\n to set up state on the instanceMeta object.\n\n `removedItem` - A function that is called each time an element is\n removed from the array.\n\n `addedItem` - A function that is called each time an element is\n added to the array.\n\n\n The `initialize` function has the following signature:\n\n ```javascript\n function (array, changeMeta, instanceMeta)\n ```\n\n `array` - The initial value of the arrayComputed, an empty array.\n\n `changeMeta` - An object which contains meta information about the\n computed. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n\n The `removedItem` and `addedItem` functions both have the following signature:\n\n ```javascript\n function (accumulatedValue, item, changeMeta, instanceMeta)\n ```\n\n `accumulatedValue` - The value returned from the last time\n `removedItem` or `addedItem` was called or an empty array.\n\n `item` - the element added or removed from the array\n\n `changeMeta` - An object which contains meta information about the\n change. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n - `index` the index of the added or removed item\n - `item` the added or removed item: this is exactly the same as\n the second arg\n - `arrayChanged` the array that triggered the change. Can be\n useful when depending on multiple arrays.\n\n For property changes triggered on an item property change (when\n depKey is something like `someArray.@each.someProperty`),\n `changeMeta` will also contain the following property:\n\n - `previousValues` an object whose keys are the properties that changed on\n the item, and whose values are the item's previous values.\n\n `previousValues` is important Ember coalesces item property changes via\n Ember.run.once. This means that by the time removedItem gets called, item has\n the new values, but you may need the previous value (eg for sorting &\n filtering).\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n The `removedItem` and `addedItem` functions should return the accumulated\n value. It is acceptable to not return anything (ie return undefined)\n to invalidate the computation. This is generally not a good idea for\n arrayComputed but it's used in eg max and min.\n\n Example\n\n ```javascript\n Ember.computed.map = function(dependentKey, callback) {\n var options = {\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var mapped = callback(item);\n array.insertAt(changeMeta.index, mapped);\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n array.removeAt(changeMeta.index, 1);\n return array;\n }\n };\n\n return Ember.arrayComputed(dependentKey, options);\n };\n ```\n\n @method arrayComputed\n @for Ember\n @param {String} [dependentKeys*]\n @param {Object} options\n @return {Ember.ComputedProperty}\n*/\nEmber.arrayComputed = function (options) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n options = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof options !== \"object\") {\n throw new Ember.Error(\"Array Computed Property declared without an options hash\");\n }\n\n var cp = new ArrayComputedProperty(options);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n};\n\n})();\n//@ sourceURL=ember-runtime/computed/array_computed");minispade.register('ember-runtime/computed/reduce_computed', "(function() {minispade.require('ember-metal/computed');\nminispade.require('ember-runtime/mixins/array');\n\nvar e_get = Ember.get,\n set = Ember.set,\n guidFor = Ember.guidFor,\n metaFor = Ember.meta,\n propertyWillChange = Ember.propertyWillChange,\n propertyDidChange = Ember.propertyDidChange,\n addBeforeObserver = Ember.addBeforeObserver,\n removeBeforeObserver = Ember.removeBeforeObserver,\n addObserver = Ember.addObserver,\n removeObserver = Ember.removeObserver,\n ComputedProperty = Ember.ComputedProperty,\n a_slice = [].slice,\n o_create = Ember.create,\n forEach = Ember.EnumerableUtils.forEach,\n // Here we explicitly don't allow `@each.foo`; it would require some special\n // testing, but there's no particular reason why it should be disallowed.\n eachPropertyPattern = /^(.*)\\.@each\\.(.*)/,\n doubleEachPropertyPattern = /(.*\\.@each){2,}/;\n\nfunction get(obj, key) {\n if (Ember.FEATURES.isEnabled('reduceComputedSelf')) {\n if (key === '@this') {\n return obj;\n }\n }\n\n return e_get(obj, key);\n}\n\n/*\n Tracks changes to dependent arrays, as well as to properties of items in\n dependent arrays.\n\n @class DependentArraysObserver\n*/\nfunction DependentArraysObserver(callbacks, cp, instanceMeta, context, propertyName, sugarMeta) {\n // user specified callbacks for `addedItem` and `removedItem`\n this.callbacks = callbacks;\n\n // the computed property: remember these are shared across instances\n this.cp = cp;\n\n // the ReduceComputedPropertyInstanceMeta this DependentArraysObserver is\n // associated with\n this.instanceMeta = instanceMeta;\n\n // A map of array guids to dependentKeys, for the given context. We track\n // this because we want to set up the computed property potentially before the\n // dependent array even exists, but when the array observer fires, we lack\n // enough context to know what to update: we can recover that context by\n // getting the dependentKey.\n this.dependentKeysByGuid = {};\n\n // a map of dependent array guids -> Ember.TrackedArray instances. We use\n // this to lazily recompute indexes for item property observers.\n this.trackedArraysByGuid = {};\n\n // We suspend observers to ignore replacements from `reset` when totally\n // recomputing. Unfortunately we cannot properly suspend the observers\n // because we only have the key; instead we make the observers no-ops\n this.suspended = false;\n\n // This is used to coalesce item changes from property observers.\n this.changedItems = {};\n}\n\nfunction ItemPropertyObserverContext (dependentArray, index, trackedArray) {\n Ember.assert(\"Internal error: trackedArray is null or undefined\", trackedArray);\n\n this.dependentArray = dependentArray;\n this.index = index;\n this.item = dependentArray.objectAt(index);\n this.trackedArray = trackedArray;\n this.beforeObserver = null;\n this.observer = null;\n\n this.destroyed = false;\n}\n\nDependentArraysObserver.prototype = {\n setValue: function (newValue) {\n this.instanceMeta.setValue(newValue, true);\n },\n getValue: function () {\n return this.instanceMeta.getValue();\n },\n\n setupObservers: function (dependentArray, dependentKey) {\n Ember.assert(\"dependent array must be an `Ember.Array`\", Ember.Array.detect(dependentArray));\n\n this.dependentKeysByGuid[guidFor(dependentArray)] = dependentKey;\n\n dependentArray.addArrayObserver(this, {\n willChange: 'dependentArrayWillChange',\n didChange: 'dependentArrayDidChange'\n });\n\n if (this.cp._itemPropertyKeys[dependentKey]) {\n this.setupPropertyObservers(dependentKey, this.cp._itemPropertyKeys[dependentKey]);\n }\n },\n\n teardownObservers: function (dependentArray, dependentKey) {\n var itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || [];\n\n delete this.dependentKeysByGuid[guidFor(dependentArray)];\n\n this.teardownPropertyObservers(dependentKey, itemPropertyKeys);\n\n dependentArray.removeArrayObserver(this, {\n willChange: 'dependentArrayWillChange',\n didChange: 'dependentArrayDidChange'\n });\n },\n\n suspendArrayObservers: function (callback, binding) {\n var oldSuspended = this.suspended;\n this.suspended = true;\n callback.call(binding);\n this.suspended = oldSuspended;\n },\n\n setupPropertyObservers: function (dependentKey, itemPropertyKeys) {\n var dependentArray = get(this.instanceMeta.context, dependentKey),\n length = get(dependentArray, 'length'),\n observerContexts = new Array(length);\n\n this.resetTransformations(dependentKey, observerContexts);\n\n forEach(dependentArray, function (item, index) {\n var observerContext = this.createPropertyObserverContext(dependentArray, index, this.trackedArraysByGuid[dependentKey]);\n observerContexts[index] = observerContext;\n\n forEach(itemPropertyKeys, function (propertyKey) {\n addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver);\n addObserver(item, propertyKey, this, observerContext.observer);\n }, this);\n }, this);\n },\n\n teardownPropertyObservers: function (dependentKey, itemPropertyKeys) {\n var dependentArrayObserver = this,\n trackedArray = this.trackedArraysByGuid[dependentKey],\n beforeObserver,\n observer,\n item;\n\n if (!trackedArray) { return; }\n\n trackedArray.apply(function (observerContexts, offset, operation) {\n if (operation === Ember.TrackedArray.DELETE) { return; }\n\n forEach(observerContexts, function (observerContext) {\n observerContext.destroyed = true;\n beforeObserver = observerContext.beforeObserver;\n observer = observerContext.observer;\n item = observerContext.item;\n\n forEach(itemPropertyKeys, function (propertyKey) {\n removeBeforeObserver(item, propertyKey, dependentArrayObserver, beforeObserver);\n removeObserver(item, propertyKey, dependentArrayObserver, observer);\n });\n });\n });\n },\n\n createPropertyObserverContext: function (dependentArray, index, trackedArray) {\n var observerContext = new ItemPropertyObserverContext(dependentArray, index, trackedArray);\n\n this.createPropertyObserver(observerContext);\n\n return observerContext;\n },\n\n createPropertyObserver: function (observerContext) {\n var dependentArrayObserver = this;\n\n observerContext.beforeObserver = function (obj, keyName) {\n return dependentArrayObserver.itemPropertyWillChange(obj, keyName, observerContext.dependentArray, observerContext);\n };\n observerContext.observer = function (obj, keyName) {\n return dependentArrayObserver.itemPropertyDidChange(obj, keyName, observerContext.dependentArray, observerContext);\n };\n },\n\n resetTransformations: function (dependentKey, observerContexts) {\n this.trackedArraysByGuid[dependentKey] = new Ember.TrackedArray(observerContexts);\n },\n\n trackAdd: function (dependentKey, index, newItems) {\n var trackedArray = this.trackedArraysByGuid[dependentKey];\n if (trackedArray) {\n trackedArray.addItems(index, newItems);\n }\n },\n\n trackRemove: function (dependentKey, index, removedCount) {\n var trackedArray = this.trackedArraysByGuid[dependentKey];\n\n if (trackedArray) {\n return trackedArray.removeItems(index, removedCount);\n }\n\n return [];\n },\n\n updateIndexes: function (trackedArray, array) {\n var length = get(array, 'length');\n // OPTIMIZE: we could stop updating once we hit the object whose observer\n // fired; ie partially apply the transformations\n trackedArray.apply(function (observerContexts, offset, operation) {\n // we don't even have observer contexts for removed items, even if we did,\n // they no longer have any index in the array\n if (operation === Ember.TrackedArray.DELETE) { return; }\n if (operation === Ember.TrackedArray.RETAIN && observerContexts.length === length && offset === 0) {\n // If we update many items we don't want to walk the array each time: we\n // only need to update the indexes at most once per run loop.\n return;\n }\n\n forEach(observerContexts, function (context, index) {\n context.index = index + offset;\n });\n });\n },\n\n dependentArrayWillChange: function (dependentArray, index, removedCount, addedCount) {\n if (this.suspended) { return; }\n\n var removedItem = this.callbacks.removedItem,\n changeMeta,\n guid = guidFor(dependentArray),\n dependentKey = this.dependentKeysByGuid[guid],\n itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || [],\n length = get(dependentArray, 'length'),\n normalizedIndex = normalizeIndex(index, length, 0),\n normalizedRemoveCount = normalizeRemoveCount(normalizedIndex, length, removedCount),\n item,\n itemIndex,\n sliceIndex,\n observerContexts;\n\n observerContexts = this.trackRemove(dependentKey, normalizedIndex, normalizedRemoveCount);\n\n function removeObservers(propertyKey) {\n observerContexts[sliceIndex].destroyed = true;\n removeBeforeObserver(item, propertyKey, this, observerContexts[sliceIndex].beforeObserver);\n removeObserver(item, propertyKey, this, observerContexts[sliceIndex].observer);\n }\n\n for (sliceIndex = normalizedRemoveCount - 1; sliceIndex >= 0; --sliceIndex) {\n itemIndex = normalizedIndex + sliceIndex;\n if (itemIndex >= length) { break; }\n\n item = dependentArray.objectAt(itemIndex);\n\n forEach(itemPropertyKeys, removeObservers, this);\n\n changeMeta = createChangeMeta(dependentArray, item, itemIndex, this.instanceMeta.propertyName, this.cp);\n this.setValue( removedItem.call(\n this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta));\n }\n },\n\n dependentArrayDidChange: function (dependentArray, index, removedCount, addedCount) {\n if (this.suspended) { return; }\n\n var addedItem = this.callbacks.addedItem,\n guid = guidFor(dependentArray),\n dependentKey = this.dependentKeysByGuid[guid],\n observerContexts = new Array(addedCount),\n itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey],\n length = get(dependentArray, 'length'),\n normalizedIndex = normalizeIndex(index, length, addedCount),\n changeMeta,\n observerContext;\n\n forEach(dependentArray.slice(normalizedIndex, normalizedIndex + addedCount), function (item, sliceIndex) {\n if (itemPropertyKeys) {\n observerContext =\n observerContexts[sliceIndex] =\n this.createPropertyObserverContext(dependentArray, normalizedIndex + sliceIndex, this.trackedArraysByGuid[dependentKey]);\n forEach(itemPropertyKeys, function (propertyKey) {\n addBeforeObserver(item, propertyKey, this, observerContext.beforeObserver);\n addObserver(item, propertyKey, this, observerContext.observer);\n }, this);\n }\n\n changeMeta = createChangeMeta(dependentArray, item, normalizedIndex + sliceIndex, this.instanceMeta.propertyName, this.cp);\n this.setValue( addedItem.call(\n this.instanceMeta.context, this.getValue(), item, changeMeta, this.instanceMeta.sugarMeta));\n }, this);\n\n this.trackAdd(dependentKey, normalizedIndex, observerContexts);\n },\n\n itemPropertyWillChange: function (obj, keyName, array, observerContext) {\n var guid = guidFor(obj);\n\n if (!this.changedItems[guid]) {\n this.changedItems[guid] = {\n array: array,\n observerContext: observerContext,\n obj: obj,\n previousValues: {}\n };\n }\n\n this.changedItems[guid].previousValues[keyName] = get(obj, keyName);\n },\n\n itemPropertyDidChange: function(obj, keyName, array, observerContext) {\n this.flushChanges();\n },\n\n flushChanges: function() {\n var changedItems = this.changedItems, key, c, changeMeta;\n\n for (key in changedItems) {\n c = changedItems[key];\n if (c.observerContext.destroyed) { continue; }\n\n this.updateIndexes(c.observerContext.trackedArray, c.observerContext.dependentArray);\n\n changeMeta = createChangeMeta(c.array, c.obj, c.observerContext.index, this.instanceMeta.propertyName, this.cp, c.previousValues);\n this.setValue(\n this.callbacks.removedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta));\n this.setValue(\n this.callbacks.addedItem.call(this.instanceMeta.context, this.getValue(), c.obj, changeMeta, this.instanceMeta.sugarMeta));\n }\n this.changedItems = {};\n }\n};\n\nfunction normalizeIndex(index, length, newItemsOffset) {\n if (index < 0) {\n return Math.max(0, length + index);\n } else if (index < length) {\n return index;\n } else /* index > length */ {\n return Math.min(length - newItemsOffset, index);\n }\n}\n\nfunction normalizeRemoveCount(index, length, removedCount) {\n return Math.min(removedCount, length - index);\n}\n\nfunction createChangeMeta(dependentArray, item, index, propertyName, property, previousValues) {\n var meta = {\n arrayChanged: dependentArray,\n index: index,\n item: item,\n propertyName: propertyName,\n property: property\n };\n\n if (previousValues) {\n // previous values only available for item property changes\n meta.previousValues = previousValues;\n }\n\n return meta;\n}\n\nfunction addItems (dependentArray, callbacks, cp, propertyName, meta) {\n forEach(dependentArray, function (item, index) {\n meta.setValue( callbacks.addedItem.call(\n this, meta.getValue(), item, createChangeMeta(dependentArray, item, index, propertyName, cp), meta.sugarMeta));\n }, this);\n}\n\nfunction reset(cp, propertyName) {\n var callbacks = cp._callbacks(),\n meta;\n\n if (cp._hasInstanceMeta(this, propertyName)) {\n meta = cp._instanceMeta(this, propertyName);\n meta.setValue(cp.resetValue(meta.getValue()));\n } else {\n meta = cp._instanceMeta(this, propertyName);\n }\n\n if (cp.options.initialize) {\n cp.options.initialize.call(this, meta.getValue(), { property: cp, propertyName: propertyName }, meta.sugarMeta);\n }\n}\n\nfunction ReduceComputedPropertyInstanceMeta(context, propertyName, initialValue) {\n this.context = context;\n this.propertyName = propertyName;\n this.cache = metaFor(context).cache;\n\n this.dependentArrays = {};\n this.sugarMeta = {};\n\n this.initialValue = initialValue;\n}\n\nReduceComputedPropertyInstanceMeta.prototype = {\n getValue: function () {\n if (this.propertyName in this.cache) {\n return this.cache[this.propertyName];\n } else {\n return this.initialValue;\n }\n },\n\n setValue: function(newValue, triggerObservers) {\n // This lets sugars force a recomputation, handy for very simple\n // implementations of eg max.\n if (newValue !== undefined) {\n var fireObservers = triggerObservers && (newValue !== this.cache[this.propertyName]);\n\n if (fireObservers) {\n propertyWillChange(this.context, this.propertyName);\n }\n\n this.cache[this.propertyName] = newValue;\n\n if (fireObservers) {\n propertyDidChange(this.context, this.propertyName);\n }\n } else {\n delete this.cache[this.propertyName];\n }\n }\n};\n\n/**\n A computed property whose dependent keys are arrays and which is updated with\n \"one at a time\" semantics.\n\n @class ReduceComputedProperty\n @namespace Ember\n @extends Ember.ComputedProperty\n @constructor\n*/\nfunction ReduceComputedProperty(options) {\n var cp = this;\n\n this.options = options;\n this._instanceMetas = {};\n\n this._dependentKeys = null;\n // A map of dependentKey -> [itemProperty, ...] that tracks what properties of\n // items in the array we must track to update this property.\n this._itemPropertyKeys = {};\n this._previousItemPropertyKeys = {};\n\n this.readOnly();\n this.cacheable();\n\n this.recomputeOnce = function(propertyName) {\n // What we really want to do is coalesce by <cp, propertyName>.\n // We need a form of `scheduleOnce` that accepts an arbitrary token to\n // coalesce by, in addition to the target and method.\n Ember.run.once(this, recompute, propertyName);\n };\n var recompute = function(propertyName) {\n var dependentKeys = cp._dependentKeys,\n meta = cp._instanceMeta(this, propertyName),\n callbacks = cp._callbacks();\n\n reset.call(this, cp, propertyName);\n\n meta.dependentArraysObserver.suspendArrayObservers(function () {\n forEach(cp._dependentKeys, function (dependentKey) {\n var dependentArray = get(this, dependentKey),\n previousDependentArray = meta.dependentArrays[dependentKey];\n\n if (dependentArray === previousDependentArray) {\n // The array may be the same, but our item property keys may have\n // changed, so we set them up again. We can't easily tell if they've\n // changed: the array may be the same object, but with different\n // contents.\n if (cp._previousItemPropertyKeys[dependentKey]) {\n delete cp._previousItemPropertyKeys[dependentKey];\n meta.dependentArraysObserver.setupPropertyObservers(dependentKey, cp._itemPropertyKeys[dependentKey]);\n }\n } else {\n meta.dependentArrays[dependentKey] = dependentArray;\n\n if (previousDependentArray) {\n meta.dependentArraysObserver.teardownObservers(previousDependentArray, dependentKey);\n }\n\n if (dependentArray) {\n meta.dependentArraysObserver.setupObservers(dependentArray, dependentKey);\n }\n }\n }, this);\n }, this);\n\n forEach(cp._dependentKeys, function(dependentKey) {\n var dependentArray = get(this, dependentKey);\n if (dependentArray) {\n addItems.call(this, dependentArray, callbacks, cp, propertyName, meta);\n }\n }, this);\n };\n\n this.func = function (propertyName) {\n Ember.assert(\"Computed reduce values require at least one dependent key\", cp._dependentKeys);\n\n recompute.call(this, propertyName);\n\n return cp._instanceMeta(this, propertyName).getValue();\n };\n}\n\nEmber.ReduceComputedProperty = ReduceComputedProperty;\nReduceComputedProperty.prototype = o_create(ComputedProperty.prototype);\n\nfunction defaultCallback(computedValue) {\n return computedValue;\n}\n\nReduceComputedProperty.prototype._callbacks = function () {\n if (!this.callbacks) {\n var options = this.options;\n this.callbacks = {\n removedItem: options.removedItem || defaultCallback,\n addedItem: options.addedItem || defaultCallback\n };\n }\n return this.callbacks;\n};\n\nReduceComputedProperty.prototype._hasInstanceMeta = function (context, propertyName) {\n var guid = guidFor(context),\n key = guid + ':' + propertyName;\n\n return !!this._instanceMetas[key];\n};\n\nReduceComputedProperty.prototype._instanceMeta = function (context, propertyName) {\n var guid = guidFor(context),\n key = guid + ':' + propertyName,\n meta = this._instanceMetas[key];\n\n if (!meta) {\n meta = this._instanceMetas[key] = new ReduceComputedPropertyInstanceMeta(context, propertyName, this.initialValue());\n meta.dependentArraysObserver = new DependentArraysObserver(this._callbacks(), this, meta, context, propertyName, meta.sugarMeta);\n }\n\n return meta;\n};\n\nReduceComputedProperty.prototype.initialValue = function () {\n if (typeof this.options.initialValue === 'function') {\n return this.options.initialValue();\n }\n else {\n return this.options.initialValue;\n }\n};\n\nReduceComputedProperty.prototype.resetValue = function (value) {\n return this.initialValue();\n};\n\nReduceComputedProperty.prototype.itemPropertyKey = function (dependentArrayKey, itemPropertyKey) {\n this._itemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey] || [];\n this._itemPropertyKeys[dependentArrayKey].push(itemPropertyKey);\n};\n\nReduceComputedProperty.prototype.clearItemPropertyKeys = function (dependentArrayKey) {\n if (this._itemPropertyKeys[dependentArrayKey]) {\n this._previousItemPropertyKeys[dependentArrayKey] = this._itemPropertyKeys[dependentArrayKey];\n this._itemPropertyKeys[dependentArrayKey] = [];\n }\n};\n\nReduceComputedProperty.prototype.property = function () {\n var cp = this,\n args = a_slice.call(arguments),\n propertyArgs = new Ember.Set(),\n match,\n dependentArrayKey,\n itemPropertyKey;\n\n forEach(a_slice.call(arguments), function (dependentKey) {\n if (doubleEachPropertyPattern.test(dependentKey)) {\n throw new Ember.Error(\"Nested @each properties not supported: \" + dependentKey);\n } else if (match = eachPropertyPattern.exec(dependentKey)) {\n dependentArrayKey = match[1];\n itemPropertyKey = match[2];\n cp.itemPropertyKey(dependentArrayKey, itemPropertyKey);\n propertyArgs.add(dependentArrayKey);\n } else {\n propertyArgs.add(dependentKey);\n }\n });\n\n return ComputedProperty.prototype.property.apply(this, propertyArgs.toArray());\n};\n\n/**\n Creates a computed property which operates on dependent arrays and\n is updated with \"one at a time\" semantics. When items are added or\n removed from the dependent array(s) a reduce computed only operates\n on the change instead of re-evaluating the entire array.\n\n If there are more than one arguments the first arguments are\n considered to be dependent property keys. The last argument is\n required to be an options object. The options object can have the\n following four properties:\n\n `initialValue` - A value or function that will be used as the initial\n value for the computed. If this property is a function the result of calling\n the function will be used as the initial value. This property is required.\n\n `initialize` - An optional initialize function. Typically this will be used\n to set up state on the instanceMeta object.\n\n `removedItem` - A function that is called each time an element is removed\n from the array.\n\n `addedItem` - A function that is called each time an element is added to\n the array.\n\n\n The `initialize` function has the following signature:\n\n ```javascript\n function (initialValue, changeMeta, instanceMeta)\n ```\n\n `initialValue` - The value of the `initialValue` property from the\n options object.\n\n `changeMeta` - An object which contains meta information about the\n computed. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n\n The `removedItem` and `addedItem` functions both have the following signature:\n\n ```javascript\n function (accumulatedValue, item, changeMeta, instanceMeta)\n ```\n\n `accumulatedValue` - The value returned from the last time\n `removedItem` or `addedItem` was called or `initialValue`.\n\n `item` - the element added or removed from the array\n\n `changeMeta` - An object which contains meta information about the\n change. It contains the following properties:\n\n - `property` the computed property\n - `propertyName` the name of the property on the object\n - `index` the index of the added or removed item\n - `item` the added or removed item: this is exactly the same as\n the second arg\n - `arrayChanged` the array that triggered the change. Can be\n useful when depending on multiple arrays.\n\n For property changes triggered on an item property change (when\n depKey is something like `someArray.@each.someProperty`),\n `changeMeta` will also contain the following property:\n\n - `previousValues` an object whose keys are the properties that changed on\n the item, and whose values are the item's previous values.\n\n `previousValues` is important Ember coalesces item property changes via\n Ember.run.once. This means that by the time removedItem gets called, item has\n the new values, but you may need the previous value (eg for sorting &\n filtering).\n\n `instanceMeta` - An object that can be used to store meta\n information needed for calculating your computed. For example a\n unique computed might use this to store the number of times a given\n element is found in the dependent array.\n\n The `removedItem` and `addedItem` functions should return the accumulated\n value. It is acceptable to not return anything (ie return undefined)\n to invalidate the computation. This is generally not a good idea for\n arrayComputed but it's used in eg max and min.\n\n Note that observers will be fired if either of these functions return a value\n that differs from the accumulated value. When returning an object that\n mutates in response to array changes, for example an array that maps\n everything from some other array (see `Ember.computed.map`), it is usually\n important that the *same* array be returned to avoid accidentally triggering observers.\n\n Example\n\n ```javascript\n Ember.computed.max = function (dependentKey) {\n return Ember.reduceComputed.call(null, dependentKey, {\n initialValue: -Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.max(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item < accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n };\n ```\n\n Dependent keys may refer to `@this` to observe changes to the object itself,\n which must be array-like, rather than a property of the object. This is\n mostly useful for array proxies, to ensure objects are retrieved via\n `objectAtContent`. This is how you could sort items by properties defined on an item controller.\n\n Example\n\n ```javascript\n App.PeopleController = Ember.ArrayController.extend({\n itemController: 'person',\n\n sortedPeople: Ember.computed.sort('@this.@each.reversedName', function(personA, personB) {\n // `reversedName` isn't defined on Person, but we have access to it via\n // the item controller App.PersonController. If we'd used\n // `content.@each.reversedName` above, we would be getting the objects\n // directly and not have access to `reversedName`.\n //\n var reversedNameA = get(personA, 'reversedName'),\n reversedNameB = get(personB, 'reversedName');\n\n return Ember.compare(reversedNameA, reversedNameB);\n })\n });\n\n App.PersonController = Ember.ObjectController.extend({\n reversedName: function () {\n return reverse(get(this, 'name'));\n }.property('name')\n })\n ```\n\n @method reduceComputed\n @for Ember\n @param {String} [dependentKeys*]\n @param {Object} options\n @return {Ember.ComputedProperty}\n*/\nEmber.reduceComputed = function (options) {\n var args;\n\n if (arguments.length > 1) {\n args = a_slice.call(arguments, 0, -1);\n options = a_slice.call(arguments, -1)[0];\n }\n\n if (typeof options !== \"object\") {\n throw new Ember.Error(\"Reduce Computed Property declared without an options hash\");\n }\n\n if (!('initialValue' in options)) {\n throw new Ember.Error(\"Reduce Computed Property declared without an initial value\");\n }\n\n var cp = new ReduceComputedProperty(options);\n\n if (args) {\n cp.property.apply(cp, args);\n }\n\n return cp;\n};\n\n})();\n//@ sourceURL=ember-runtime/computed/reduce_computed");minispade.register('ember-runtime/computed/reduce_computed_macros', "(function() {minispade.require('ember-runtime/computed/array_computed');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get,\n set = Ember.set,\n guidFor = Ember.guidFor,\n merge = Ember.merge,\n a_slice = [].slice,\n forEach = Ember.EnumerableUtils.forEach,\n map = Ember.EnumerableUtils.map;\n\n/**\n A computed property that calculates the maximum value in the\n dependent array. This will return `-Infinity` when the dependent\n array is empty.\n\n Example\n\n ```javascript\n App.Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age'),\n maxChildAge: Ember.computed.max('childAges')\n });\n\n var lordByron = App.Person.create({children: []});\n lordByron.get('maxChildAge'); // -Infinity\n lordByron.get('children').pushObject({name: 'Augusta Ada Byron', age: 7});\n lordByron.get('maxChildAge'); // 7\n lordByron.get('children').pushObjects([{name: 'Allegra Byron', age: 5}, {name: 'Elizabeth Medora Leigh', age: 8}]);\n lordByron.get('maxChildAge'); // 8\n ```\n\n @method computed.max\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the largest value in the dependentKey's array\n*/\nEmber.computed.max = function (dependentKey) {\n return Ember.reduceComputed.call(null, dependentKey, {\n initialValue: -Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.max(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item < accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n};\n\n/**\n A computed property that calculates the minimum value in the\n dependent array. This will return `Infinity` when the dependent\n array is empty.\n\n Example\n\n ```javascript\n App.Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age'),\n minChildAge: Ember.computed.min('childAges')\n });\n\n var lordByron = App.Person.create({children: []});\n lordByron.get('minChildAge'); // Infinity\n lordByron.get('children').pushObject({name: 'Augusta Ada Byron', age: 7});\n lordByron.get('minChildAge'); // 7\n lordByron.get('children').pushObjects([{name: 'Allegra Byron', age: 5}, {name: 'Elizabeth Medora Leigh', age: 8}]);\n lordByron.get('minChildAge'); // 5\n ```\n\n @method computed.min\n @for Ember\n @param {String} dependentKey\n @return {Ember.ComputedProperty} computes the smallest value in the dependentKey's array\n*/\nEmber.computed.min = function (dependentKey) {\n return Ember.reduceComputed.call(null, dependentKey, {\n initialValue: Infinity,\n\n addedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n return Math.min(accumulatedValue, item);\n },\n\n removedItem: function (accumulatedValue, item, changeMeta, instanceMeta) {\n if (item > accumulatedValue) {\n return accumulatedValue;\n }\n }\n });\n};\n\n/**\n Returns an array mapped via the callback\n\n The callback method you provide should have the following signature:\n\n ```javascript\n function(item);\n ```\n\n - `item` is the current item in the iteration.\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n excitingChores: Ember.computed.map('chores', function(chore) {\n return chore.toUpperCase() + '!';\n })\n });\n\n var hampster = App.Hampster.create({chores: ['cook', 'clean', 'write more unit tests']});\n hampster.get('excitingChores'); // ['COOK!', 'CLEAN!', 'WRITE MORE UNIT TESTS!']\n ```\n\n @method computed.map\n @for Ember\n @param {String} dependentKey\n @param {Function} callback\n @return {Ember.ComputedProperty} an array mapped via the callback\n*/\nEmber.computed.map = function(dependentKey, callback) {\n var options = {\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var mapped = callback.call(this, item);\n array.insertAt(changeMeta.index, mapped);\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n array.removeAt(changeMeta.index, 1);\n return array;\n }\n };\n\n return Ember.arrayComputed(dependentKey, options);\n};\n\n/**\n Returns an array mapped to the specified key.\n\n Example\n\n ```javascript\n App.Person = Ember.Object.extend({\n childAges: Ember.computed.mapBy('children', 'age')\n });\n\n var lordByron = App.Person.create({children: []});\n lordByron.get('childAges'); // []\n lordByron.get('children').pushObject({name: 'Augusta Ada Byron', age: 7});\n lordByron.get('childAges'); // [7]\n lordByron.get('children').pushObjects([{name: 'Allegra Byron', age: 5}, {name: 'Elizabeth Medora Leigh', age: 8}]);\n lordByron.get('childAges'); // [7, 5, 8]\n ```\n\n @method computed.mapBy\n @for Ember\n @param {String} dependentKey\n @param {String} propertyKey\n @return {Ember.ComputedProperty} an array mapped to the specified key\n*/\nEmber.computed.mapBy = function(dependentKey, propertyKey) {\n var callback = function(item) { return get(item, propertyKey); };\n return Ember.computed.map(dependentKey + '.@each.' + propertyKey, callback);\n};\n\n/**\n @method computed.mapProperty\n @for Ember\n @deprecated Use `Ember.computed.mapBy` instead\n @param dependentKey\n @param propertyKey\n*/\nEmber.computed.mapProperty = Ember.computed.mapBy;\n\n/**\n Filters the array by the callback.\n\n The callback method you provide should have the following signature:\n\n ```javascript\n function(item);\n ```\n\n - `item` is the current item in the iteration.\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n remainingChores: Ember.computed.filter('chores', function(chore) {\n return !chore.done;\n })\n });\n\n var hampster = App.Hampster.create({chores: [\n {name: 'cook', done: true},\n {name: 'clean', done: true},\n {name: 'write more unit tests', done: false}\n ]});\n hampster.get('remainingChores'); // [{name: 'write more unit tests', done: false}]\n ```\n\n @method computed.filter\n @for Ember\n @param {String} dependentKey\n @param {Function} callback\n @return {Ember.ComputedProperty} the filtered array\n*/\nEmber.computed.filter = function(dependentKey, callback) {\n var options = {\n initialize: function (array, changeMeta, instanceMeta) {\n instanceMeta.filteredArrayIndexes = new Ember.SubArray();\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var match = !!callback.call(this, item),\n filterIndex = instanceMeta.filteredArrayIndexes.addItem(changeMeta.index, match);\n\n if (match) {\n array.insertAt(filterIndex, item);\n }\n\n return array;\n },\n\n removedItem: function(array, item, changeMeta, instanceMeta) {\n var filterIndex = instanceMeta.filteredArrayIndexes.removeItem(changeMeta.index);\n\n if (filterIndex > -1) {\n array.removeAt(filterIndex);\n }\n\n return array;\n }\n };\n\n return Ember.arrayComputed(dependentKey, options);\n};\n\n/**\n Filters the array by the property and value\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n remainingChores: Ember.computed.filterBy('chores', 'done', false)\n });\n\n var hampster = App.Hampster.create({chores: [\n {name: 'cook', done: true},\n {name: 'clean', done: true},\n {name: 'write more unit tests', done: false}\n ]});\n hampster.get('remainingChores'); // [{name: 'write more unit tests', done: false}]\n ```\n\n @method computed.filterBy\n @for Ember\n @param {String} dependentKey\n @param {String} propertyKey\n @param {String} value\n @return {Ember.ComputedProperty} the filtered array\n*/\nEmber.computed.filterBy = function(dependentKey, propertyKey, value) {\n var callback;\n\n if (arguments.length === 2) {\n callback = function(item) {\n return get(item, propertyKey);\n };\n } else {\n callback = function(item) {\n return get(item, propertyKey) === value;\n };\n }\n\n return Ember.computed.filter(dependentKey + '.@each.' + propertyKey, callback);\n};\n\n/**\n @method computed.filterProperty\n @for Ember\n @param dependentKey\n @param propertyKey\n @param value\n @deprecated Use `Ember.computed.filterBy` instead\n*/\nEmber.computed.filterProperty = Ember.computed.filterBy;\n\n/**\n A computed property which returns a new array with all the unique\n elements from one or more dependent arrays.\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n uniqueFruits: Ember.computed.uniq('fruits')\n });\n\n var hampster = App.Hampster.create({fruits: [\n 'banana',\n 'grape',\n 'kale',\n 'banana'\n ]});\n hampster.get('uniqueFruits'); // ['banana', 'grape', 'kale']\n ```\n\n @method computed.uniq\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n unique elements from the dependent array\n*/\nEmber.computed.uniq = function() {\n var args = a_slice.call(arguments);\n args.push({\n initialize: function(array, changeMeta, instanceMeta) {\n instanceMeta.itemCounts = {};\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var guid = guidFor(item);\n\n if (!instanceMeta.itemCounts[guid]) {\n instanceMeta.itemCounts[guid] = 1;\n } else {\n ++instanceMeta.itemCounts[guid];\n }\n array.addObject(item);\n return array;\n },\n removedItem: function(array, item, _, instanceMeta) {\n var guid = guidFor(item),\n itemCounts = instanceMeta.itemCounts;\n\n if (--itemCounts[guid] === 0) {\n array.removeObject(item);\n }\n return array;\n }\n });\n return Ember.arrayComputed.apply(null, args);\n};\n\n/**\n Alias for [Ember.computed.uniq](/api/#method_computed_uniq).\n\n @method computed.union\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n unique elements from the dependent array\n*/\nEmber.computed.union = Ember.computed.uniq;\n\n/**\n A computed property which returns a new array with all the duplicated\n elements from two or more dependeny arrays.\n\n Example\n\n ```javascript\n var obj = Ember.Object.createWithMixins({\n adaFriends: ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n charlesFriends: ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock'],\n friendsInCommon: Ember.computed.intersect('adaFriends', 'charlesFriends')\n });\n\n obj.get('friendsInCommon'); // ['William King', 'Mary Somerville']\n ```\n\n @method computed.intersect\n @for Ember\n @param {String} propertyKey*\n @return {Ember.ComputedProperty} computes a new array with all the\n duplicated elements from the dependent arrays\n*/\nEmber.computed.intersect = function () {\n var getDependentKeyGuids = function (changeMeta) {\n return map(changeMeta.property._dependentKeys, function (dependentKey) {\n return guidFor(dependentKey);\n });\n };\n\n var args = a_slice.call(arguments);\n args.push({\n initialize: function (array, changeMeta, instanceMeta) {\n instanceMeta.itemCounts = {};\n },\n\n addedItem: function(array, item, changeMeta, instanceMeta) {\n var itemGuid = guidFor(item),\n dependentGuids = getDependentKeyGuids(changeMeta),\n dependentGuid = guidFor(changeMeta.arrayChanged),\n numberOfDependentArrays = changeMeta.property._dependentKeys.length,\n itemCounts = instanceMeta.itemCounts;\n\n if (!itemCounts[itemGuid]) { itemCounts[itemGuid] = {}; }\n if (itemCounts[itemGuid][dependentGuid] === undefined) { itemCounts[itemGuid][dependentGuid] = 0; }\n\n if (++itemCounts[itemGuid][dependentGuid] === 1 &&\n numberOfDependentArrays === Ember.keys(itemCounts[itemGuid]).length) {\n\n array.addObject(item);\n }\n return array;\n },\n removedItem: function(array, item, changeMeta, instanceMeta) {\n var itemGuid = guidFor(item),\n dependentGuids = getDependentKeyGuids(changeMeta),\n dependentGuid = guidFor(changeMeta.arrayChanged),\n numberOfDependentArrays = changeMeta.property._dependentKeys.length,\n numberOfArraysItemAppearsIn,\n itemCounts = instanceMeta.itemCounts;\n\n if (itemCounts[itemGuid][dependentGuid] === undefined) { itemCounts[itemGuid][dependentGuid] = 0; }\n if (--itemCounts[itemGuid][dependentGuid] === 0) {\n delete itemCounts[itemGuid][dependentGuid];\n numberOfArraysItemAppearsIn = Ember.keys(itemCounts[itemGuid]).length;\n\n if (numberOfArraysItemAppearsIn === 0) {\n delete itemCounts[itemGuid];\n }\n array.removeObject(item);\n }\n return array;\n }\n });\n return Ember.arrayComputed.apply(null, args);\n};\n\n/**\n A computed property which returns a new array with all the\n properties from the first dependent array that are not in the second\n dependent array.\n\n Example\n\n ```javascript\n App.Hampster = Ember.Object.extend({\n likes: ['banana', 'grape', 'kale'],\n wants: Ember.computed.setDiff('likes', 'fruits')\n });\n\n var hampster = App.Hampster.create({fruits: [\n 'grape',\n 'kale',\n ]});\n hampster.get('wants'); // ['banana']\n ```\n\n @method computed.setDiff\n @for Ember\n @param {String} setAProperty\n @param {String} setBProperty\n @return {Ember.ComputedProperty} computes a new array with all the\n items from the first dependent array that are not in the second\n dependent array\n*/\nEmber.computed.setDiff = function (setAProperty, setBProperty) {\n if (arguments.length !== 2) {\n throw new Ember.Error(\"setDiff requires exactly two dependent arrays.\");\n }\n return Ember.arrayComputed.call(null, setAProperty, setBProperty, {\n addedItem: function (array, item, changeMeta, instanceMeta) {\n var setA = get(this, setAProperty),\n setB = get(this, setBProperty);\n\n if (changeMeta.arrayChanged === setA) {\n if (!setB.contains(item)) {\n array.addObject(item);\n }\n } else {\n array.removeObject(item);\n }\n return array;\n },\n\n removedItem: function (array, item, changeMeta, instanceMeta) {\n var setA = get(this, setAProperty),\n setB = get(this, setBProperty);\n\n if (changeMeta.arrayChanged === setB) {\n if (setA.contains(item)) {\n array.addObject(item);\n }\n } else {\n array.removeObject(item);\n }\n return array;\n }\n });\n};\n\nfunction binarySearch(array, item, low, high) {\n var mid, midItem, res, guidMid, guidItem;\n\n if (arguments.length < 4) { high = get(array, 'length'); }\n if (arguments.length < 3) { low = 0; }\n\n if (low === high) {\n return low;\n }\n\n mid = low + Math.floor((high - low) / 2);\n midItem = array.objectAt(mid);\n\n guidMid = _guidFor(midItem);\n guidItem = _guidFor(item);\n\n if (guidMid === guidItem) {\n return mid;\n }\n\n res = this.order(midItem, item);\n if (res === 0) {\n res = guidMid < guidItem ? -1 : 1;\n }\n\n\n if (res < 0) {\n return this.binarySearch(array, item, mid+1, high);\n } else if (res > 0) {\n return this.binarySearch(array, item, low, mid);\n }\n\n return mid;\n\n function _guidFor(item) {\n if (Ember.ObjectProxy.detectInstance(item)) {\n return guidFor(get(item, 'content'));\n }\n return guidFor(item);\n }\n}\n\n/**\n A computed property which returns a new array with all the\n properties from the first dependent array sorted based on a property\n or sort function.\n\n The callback method you provide should have the following signature:\n\n ```javascript\n function(itemA, itemB);\n ```\n\n - `itemA` the first item to compare.\n - `itemB` the second item to compare.\n\n This function should return `-1` when `itemA` should come before\n `itemB`. It should return `1` when `itemA` should come after\n `itemB`. If the `itemA` and `itemB` are equal this function should return `0`.\n\n Example\n\n ```javascript\n var ToDoList = Ember.Object.extend({\n todosSorting: ['name'],\n sortedTodos: Ember.computed.sort('todos', 'todosSorting'),\n priorityTodos: Ember.computed.sort('todos', function(a, b){\n if (a.priority > b.priority) {\n return 1;\n } else if (a.priority < b.priority) {\n return -1;\n }\n return 0;\n }),\n });\n var todoList = ToDoList.create({todos: [\n {name: 'Unit Test', priority: 2},\n {name: 'Documentation', priority: 3},\n {name: 'Release', priority: 1}\n ]});\n\n todoList.get('sortedTodos'); // [{name:'Documentation', priority:3}, {name:'Release', priority:1}, {name:'Unit Test', priority:2}]\n todoList.get('priorityTodos'); // [{name:'Release', priority:1}, {name:'Unit Test', priority:2}, {name:'Documentation', priority:3}]\n ```\n\n @method computed.sort\n @for Ember\n @param {String} dependentKey\n @param {String or Function} sortDefinition a dependent key to an\n array of sort properties or a function to use when sorting\n @return {Ember.ComputedProperty} computes a new sorted array based\n on the sort property array or callback function\n*/\nEmber.computed.sort = function (itemsKey, sortDefinition) {\n Ember.assert(\"Ember.computed.sort requires two arguments: an array key to sort and either a sort properties key or sort function\", arguments.length === 2);\n\n var initFn, sortPropertiesKey;\n\n if (typeof sortDefinition === 'function') {\n initFn = function (array, changeMeta, instanceMeta) {\n instanceMeta.order = sortDefinition;\n instanceMeta.binarySearch = binarySearch;\n };\n } else {\n sortPropertiesKey = sortDefinition;\n initFn = function (array, changeMeta, instanceMeta) {\n function setupSortProperties() {\n var sortPropertyDefinitions = get(this, sortPropertiesKey),\n sortProperty,\n sortProperties = instanceMeta.sortProperties = [],\n sortPropertyAscending = instanceMeta.sortPropertyAscending = {},\n idx,\n asc;\n\n Ember.assert(\"Cannot sort: '\" + sortPropertiesKey + \"' is not an array.\", Ember.isArray(sortPropertyDefinitions));\n\n changeMeta.property.clearItemPropertyKeys(itemsKey);\n\n forEach(sortPropertyDefinitions, function (sortPropertyDefinition) {\n if ((idx = sortPropertyDefinition.indexOf(':')) !== -1) {\n sortProperty = sortPropertyDefinition.substring(0, idx);\n asc = sortPropertyDefinition.substring(idx+1).toLowerCase() !== 'desc';\n } else {\n sortProperty = sortPropertyDefinition;\n asc = true;\n }\n\n sortProperties.push(sortProperty);\n sortPropertyAscending[sortProperty] = asc;\n changeMeta.property.itemPropertyKey(itemsKey, sortProperty);\n });\n\n sortPropertyDefinitions.addObserver('@each', this, updateSortPropertiesOnce);\n }\n\n function updateSortPropertiesOnce() {\n Ember.run.once(this, updateSortProperties, changeMeta.propertyName);\n }\n\n function updateSortProperties(propertyName) {\n setupSortProperties.call(this);\n changeMeta.property.recomputeOnce.call(this, propertyName);\n }\n\n Ember.addObserver(this, sortPropertiesKey, updateSortPropertiesOnce);\n\n setupSortProperties.call(this);\n\n\n instanceMeta.order = function (itemA, itemB) {\n var sortProperty, result, asc;\n for (var i = 0; i < this.sortProperties.length; ++i) {\n sortProperty = this.sortProperties[i];\n result = Ember.compare(get(itemA, sortProperty), get(itemB, sortProperty));\n\n if (result !== 0) {\n asc = this.sortPropertyAscending[sortProperty];\n return asc ? result : (-1 * result);\n }\n }\n\n return 0;\n };\n\n instanceMeta.binarySearch = binarySearch;\n };\n }\n\n return Ember.arrayComputed.call(null, itemsKey, {\n initialize: initFn,\n\n addedItem: function (array, item, changeMeta, instanceMeta) {\n var index = instanceMeta.binarySearch(array, item);\n array.insertAt(index, item);\n return array;\n },\n\n removedItem: function (array, item, changeMeta, instanceMeta) {\n var proxyProperties, index, searchItem;\n\n if (changeMeta.previousValues) {\n proxyProperties = merge({ content: item }, changeMeta.previousValues);\n\n searchItem = Ember.ObjectProxy.create(proxyProperties);\n } else {\n searchItem = item;\n }\n\n index = instanceMeta.binarySearch(array, searchItem);\n array.removeAt(index);\n return array;\n }\n });\n};\n\n})();\n//@ sourceURL=ember-runtime/computed/reduce_computed_macros");minispade.register('ember-runtime/controllers', "(function() {minispade.require('ember-runtime/controllers/array_controller');\nminispade.require('ember-runtime/controllers/object_controller');\nminispade.require('ember-runtime/controllers/controller');\n\n})();\n//@ sourceURL=ember-runtime/controllers");minispade.register('ember-runtime/controllers/array_controller', "(function() {minispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/controllers/controller');\nminispade.require('ember-runtime/mixins/sortable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach,\n replace = Ember.EnumerableUtils.replace;\n\n/**\n `Ember.ArrayController` provides a way for you to publish a collection of\n objects so that you can easily bind to the collection from a Handlebars\n `#each` helper, an `Ember.CollectionView`, or other controllers.\n\n The advantage of using an `ArrayController` is that you only have to set up\n your view bindings once; to change what's displayed, simply swap out the\n `content` property on the controller.\n\n For example, imagine you wanted to display a list of items fetched via an XHR\n request. Create an `Ember.ArrayController` and set its `content` property:\n\n ```javascript\n MyApp.listController = Ember.ArrayController.create();\n\n $.get('people.json', function(data) {\n MyApp.listController.set('content', data);\n });\n ```\n\n Then, create a view that binds to your new controller:\n\n ```handlebars\n {{#each MyApp.listController}}\n {{firstName}} {{lastName}}\n {{/each}}\n ```\n\n Although you are binding to the controller, the behavior of this controller\n is to pass through any methods or properties to the underlying array. This\n capability comes from `Ember.ArrayProxy`, which this class inherits from.\n\n Sometimes you want to display computed properties within the body of an\n `#each` helper that depend on the underlying items in `content`, but are not\n present on those items. To do this, set `itemController` to the name of a\n controller (probably an `ObjectController`) that will wrap each individual item.\n\n For example:\n\n ```handlebars\n {{#each post in controller}}\n <li>{{title}} ({{titleLength}} characters)</li>\n {{/each}}\n ```\n\n ```javascript\n App.PostsController = Ember.ArrayController.extend({\n itemController: 'post'\n });\n\n App.PostController = Ember.ObjectController.extend({\n // the `title` property will be proxied to the underlying post.\n\n titleLength: function() {\n return this.get('title').length;\n }.property('title')\n });\n ```\n\n In some cases it is helpful to return a different `itemController` depending\n on the particular item. Subclasses can do this by overriding\n `lookupItemController`.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n The itemController instances will have a `parentController` property set to\n either the the `parentController` property of the `ArrayController`\n or to the `ArrayController` instance itself.\n\n @class ArrayController\n @namespace Ember\n @extends Ember.ArrayProxy\n @uses Ember.SortableMixin\n @uses Ember.ControllerMixin\n*/\n\nEmber.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,\n Ember.SortableMixin, {\n\n /**\n The controller used to wrap items, if any.\n\n @property itemController\n @type String\n @default null\n */\n itemController: null,\n\n /**\n Return the name of the controller to wrap items, or `null` if items should\n be returned directly. The default implementation simply returns the\n `itemController` property, but subclasses can override this method to return\n different controllers for different objects.\n\n For example:\n\n ```javascript\n App.MyArrayController = Ember.ArrayController.extend({\n lookupItemController: function( object ) {\n if (object.get('isSpecial')) {\n return \"special\"; // use App.SpecialController\n } else {\n return \"regular\"; // use App.RegularController\n }\n }\n });\n ```\n\n @method lookupItemController\n @param {Object} object\n @return {String}\n */\n lookupItemController: function(object) {\n return get(this, 'itemController');\n },\n\n objectAtContent: function(idx) {\n var length = get(this, 'length'),\n arrangedContent = get(this,'arrangedContent'),\n object = arrangedContent && arrangedContent.objectAt(idx);\n\n if (idx >= 0 && idx < length) {\n var controllerClass = this.lookupItemController(object);\n if (controllerClass) {\n return this.controllerAt(idx, object, controllerClass);\n }\n }\n\n // When `controllerClass` is falsy, we have not opted in to using item\n // controllers, so return the object directly.\n\n // When the index is out of range, we want to return the \"out of range\"\n // value, whatever that might be. Rather than make assumptions\n // (e.g. guessing `null` or `undefined`) we defer this to `arrangedContent`.\n return object;\n },\n\n arrangedContentDidChange: function() {\n this._super();\n this._resetSubControllers();\n },\n\n arrayContentDidChange: function(idx, removedCnt, addedCnt) {\n var subControllers = get(this, '_subControllers'),\n subControllersToRemove = subControllers.slice(idx, idx+removedCnt);\n\n forEach(subControllersToRemove, function(subController) {\n if (subController) { subController.destroy(); }\n });\n\n replace(subControllers, idx, removedCnt, new Array(addedCnt));\n\n // The shadow array of subcontrollers must be updated before we trigger\n // observers, otherwise observers will get the wrong subcontainer when\n // calling `objectAt`\n this._super(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n\n this.set('_subControllers', Ember.A());\n },\n\n content: Ember.computed(function () {\n return Ember.A();\n }),\n\n controllerAt: function(idx, object, controllerClass) {\n var container = get(this, 'container'),\n subControllers = get(this, '_subControllers'),\n subController = subControllers[idx],\n factory, fullName;\n\n if (subController) { return subController; }\n\n fullName = \"controller:\" + controllerClass;\n\n if (!container.has(fullName)) {\n throw new Ember.Error('Could not resolve itemController: \"' + controllerClass + '\"');\n }\n\n subController = container.lookupFactory(fullName).create({\n target: this,\n parentController: get(this, 'parentController') || this,\n content: object\n });\n\n subControllers[idx] = subController;\n\n return subController;\n },\n\n _subControllers: null,\n\n _resetSubControllers: function() {\n var subControllers = get(this, '_subControllers');\n if (subControllers) {\n forEach(subControllers, function(subController) {\n if (subController) { subController.destroy(); }\n });\n }\n\n this.set('_subControllers', Ember.A());\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/controllers/array_controller");minispade.register('ember-runtime/controllers/controller', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/string');\n\nvar get = Ember.get;\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ControllerMixin` provides a standard interface for all classes that\n compose Ember's controller layer: `Ember.Controller`,\n `Ember.ArrayController`, and `Ember.ObjectController`.\n\n @class ControllerMixin\n @namespace Ember\n*/\nEmber.ControllerMixin = Ember.Mixin.create(Ember.ActionHandler, {\n /* ducktype as a controller */\n isController: true,\n\n /**\n The object to which actions from the view should be sent.\n\n For example, when a Handlebars template uses the `{{action}}` helper,\n it will attempt to send the action to the view's controller's `target`.\n\n By default, a controller's `target` is set to the router after it is\n instantiated by `Ember.Application#initialize`.\n\n @property target\n @default null\n */\n target: null,\n\n container: null,\n\n parentController: null,\n\n store: null,\n\n model: Ember.computed.alias('content'),\n\n deprecatedSendHandles: function(actionName) {\n return !!this[actionName];\n },\n\n deprecatedSend: function(actionName) {\n var args = [].slice.call(arguments, 1);\n Ember.assert('' + this + \" has the action \" + actionName + \" but it is not a function\", typeof this[actionName] === 'function');\n Ember.deprecate('Action handlers implemented directly on controllers are deprecated in favor of action handlers on an `actions` object (' + actionName + ' on ' + this + ')', false);\n this[actionName].apply(this, args);\n return;\n }\n});\n\n/**\n @class Controller\n @namespace Ember\n @extends Ember.Object\n @uses Ember.ControllerMixin\n*/\nEmber.Controller = Ember.Object.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/controller");minispade.register('ember-runtime/controllers/object_controller', "(function() {minispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/controllers/controller');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.ObjectController` is part of Ember's Controller layer. It is intended\n to wrap a single object, proxying unhandled attempts to `get` and `set` to the underlying\n content object, and to forward unhandled action attempts to its `target`.\n\n `Ember.ObjectController` derives this functionality from its superclass\n `Ember.ObjectProxy` and the `Ember.ControllerMixin` mixin.\n\n @class ObjectController\n @namespace Ember\n @extends Ember.ObjectProxy\n @uses Ember.ControllerMixin\n**/\nEmber.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin);\n\n})();\n//@ sourceURL=ember-runtime/controllers/object_controller");minispade.register('ember-runtime/core', "(function() {/*globals ENV */\nminispade.require('ember-metal');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar indexOf = Ember.EnumerableUtils.indexOf;\n\n/**\n This will compare two javascript values of possibly different types.\n It will tell you which one is greater than the other by returning:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n The order is calculated based on `Ember.ORDER_DEFINITION`, if types are different.\n In case they have the same type an appropriate comparison for this type is made.\n\n ```javascript\n Ember.compare('hello', 'hello'); // 0\n Ember.compare('abc', 'dfg'); // -1\n Ember.compare(2, 1); // 1\n ```\n\n @method compare\n @for Ember\n @param {Object} v First value to compare\n @param {Object} w Second value to compare\n @return {Number} -1 if v < w, 0 if v = w and 1 if v > w.\n*/\nEmber.compare = function compare(v, w) {\n if (v === w) { return 0; }\n\n var type1 = Ember.typeOf(v);\n var type2 = Ember.typeOf(w);\n\n var Comparable = Ember.Comparable;\n if (Comparable) {\n if (type1==='instance' && Comparable.detect(v.constructor)) {\n return v.constructor.compare(v, w);\n }\n\n if (type2 === 'instance' && Comparable.detect(w.constructor)) {\n return 1-w.constructor.compare(w, v);\n }\n }\n\n // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION,\n // do so now.\n var mapping = Ember.ORDER_DEFINITION_MAPPING;\n if (!mapping) {\n var order = Ember.ORDER_DEFINITION;\n mapping = Ember.ORDER_DEFINITION_MAPPING = {};\n var idx, len;\n for (idx = 0, len = order.length; idx < len; ++idx) {\n mapping[order[idx]] = idx;\n }\n\n // We no longer need Ember.ORDER_DEFINITION.\n delete Ember.ORDER_DEFINITION;\n }\n\n var type1Index = mapping[type1];\n var type2Index = mapping[type2];\n\n if (type1Index < type2Index) { return -1; }\n if (type1Index > type2Index) { return 1; }\n\n // types are equal - so we have to check values now\n switch (type1) {\n case 'boolean':\n case 'number':\n if (v < w) { return -1; }\n if (v > w) { return 1; }\n return 0;\n\n case 'string':\n var comp = v.localeCompare(w);\n if (comp < 0) { return -1; }\n if (comp > 0) { return 1; }\n return 0;\n\n case 'array':\n var vLen = v.length;\n var wLen = w.length;\n var l = Math.min(vLen, wLen);\n var r = 0;\n var i = 0;\n while (r === 0 && i < l) {\n r = compare(v[i],w[i]);\n i++;\n }\n if (r !== 0) { return r; }\n\n // all elements are equal now\n // shorter array should be ordered first\n if (vLen < wLen) { return -1; }\n if (vLen > wLen) { return 1; }\n // arrays are equal now\n return 0;\n\n case 'instance':\n if (Ember.Comparable && Ember.Comparable.detect(v)) {\n return v.compare(v, w);\n }\n return 0;\n\n case 'date':\n var vNum = v.getTime();\n var wNum = w.getTime();\n if (vNum < wNum) { return -1; }\n if (vNum > wNum) { return 1; }\n return 0;\n\n default:\n return 0;\n }\n};\n\nfunction _copy(obj, deep, seen, copies) {\n var ret, loc, key;\n\n // primitive data types are immutable, just return them.\n if ('object' !== typeof obj || obj===null) return obj;\n\n // avoid cyclical loops\n if (deep && (loc=indexOf(seen, obj))>=0) return copies[loc];\n\n Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof Ember.Object) || (Ember.Copyable && Ember.Copyable.detect(obj)));\n\n // IMPORTANT: this specific test will detect a native array only. Any other\n // object will need to implement Copyable.\n if (Ember.typeOf(obj) === 'array') {\n ret = obj.slice();\n if (deep) {\n loc = ret.length;\n while(--loc>=0) ret[loc] = _copy(ret[loc], deep, seen, copies);\n }\n } else if (Ember.Copyable && Ember.Copyable.detect(obj)) {\n ret = obj.copy(deep, seen, copies);\n } else {\n ret = {};\n for(key in obj) {\n if (!obj.hasOwnProperty(key)) continue;\n\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') continue;\n\n ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];\n }\n }\n\n if (deep) {\n seen.push(obj);\n copies.push(ret);\n }\n\n return ret;\n}\n\n/**\n Creates a clone of the passed object. This function can take just about\n any type of object and create a clone of it, including primitive values\n (which are not actually cloned because they are immutable).\n\n If the passed object implements the `clone()` method, then this function\n will simply call that method and return the result.\n\n @method copy\n @for Ember\n @param {Object} obj The object to clone\n @param {Boolean} deep If true, a deep copy of the object is made\n @return {Object} The cloned object\n*/\nEmber.copy = function(obj, deep) {\n // fast paths\n if ('object' !== typeof obj || obj===null) return obj; // can't copy primitives\n if (Ember.Copyable && Ember.Copyable.detect(obj)) return obj.copy(deep);\n return _copy(obj, deep, deep ? [] : null, deep ? [] : null);\n};\n\n/**\n Convenience method to inspect an object. This method will attempt to\n convert the object into a useful string description.\n\n It is a pretty simple implementation. If you want something more robust,\n use something like JSDump: https://github.com/NV/jsDump\n\n @method inspect\n @for Ember\n @param {Object} obj The object you want to inspect.\n @return {String} A description of the object\n*/\nEmber.inspect = function(obj) {\n var type = Ember.typeOf(obj);\n if (type === 'array') {\n return '[' + obj + ']';\n }\n if (type !== 'object') {\n return obj + '';\n }\n\n var v, ret = [];\n for(var key in obj) {\n if (obj.hasOwnProperty(key)) {\n v = obj[key];\n if (v === 'toString') { continue; } // ignore useless items\n if (Ember.typeOf(v) === 'function') { v = \"function() { ... }\"; }\n ret.push(key + \": \" + v);\n }\n }\n return \"{\" + ret.join(\", \") + \"}\";\n};\n\n/**\n Compares two objects, returning true if they are logically equal. This is\n a deeper comparison than a simple triple equal. For sets it will compare the\n internal objects. For any other object that implements `isEqual()` it will\n respect that method.\n\n ```javascript\n Ember.isEqual('hello', 'hello'); // true\n Ember.isEqual(1, 2); // false\n Ember.isEqual([4,2], [4,2]); // false\n ```\n\n @method isEqual\n @for Ember\n @param {Object} a first object to compare\n @param {Object} b second object to compare\n @return {Boolean}\n*/\nEmber.isEqual = function(a, b) {\n if (a && 'function'===typeof a.isEqual) return a.isEqual(b);\n return a === b;\n};\n\n// Used by Ember.compare\nEmber.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [\n 'undefined',\n 'null',\n 'boolean',\n 'number',\n 'string',\n 'array',\n 'object',\n 'instance',\n 'function',\n 'class',\n 'date'\n];\n\n/**\n Returns all of the keys defined on an object or hash. This is useful\n when inspecting objects for debugging. On browsers that support it, this\n uses the native `Object.keys` implementation.\n\n @method keys\n @for Ember\n @param {Object} obj\n @return {Array} Array containing keys of obj\n*/\nEmber.keys = Object.keys;\n\nif (!Ember.keys || Ember.create.isSimulated) {\n var prototypeProperties = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'valueOf',\n 'toLocaleString',\n 'toString'\n ],\n pushPropertyName = function(obj, array, key) {\n // Prevents browsers that don't respect non-enumerability from\n // copying internal Ember properties\n if (key.substring(0,2) === '__') return;\n if (key === '_super') return;\n if (indexOf(array, key) >= 0) return;\n if (!obj.hasOwnProperty(key)) return;\n\n array.push(key);\n };\n\n Ember.keys = function(obj) {\n var ret = [], key;\n for (key in obj) {\n pushPropertyName(obj, ret, key);\n }\n\n // IE8 doesn't enumerate property that named the same as prototype properties.\n for (var i = 0, l = prototypeProperties.length; i < l; i++) {\n key = prototypeProperties[i];\n\n pushPropertyName(obj, ret, key);\n }\n\n return ret;\n };\n}\n\n})();\n//@ sourceURL=ember-runtime/core");minispade.register('ember-runtime/ext', "(function() {minispade.require('ember-runtime/ext/ember');\nminispade.require('ember-runtime/ext/string');\nminispade.require('ember-runtime/ext/function');\n\n})();\n//@ sourceURL=ember-runtime/ext");minispade.register('ember-runtime/ext/ember', "(function() {/**\n Expose RSVP implementation\n \n Documentation can be found here: https://github.com/tildeio/rsvp.js/blob/master/README.md\n\n @class RSVP\n @namespace Ember\n @constructor\n*/\nEmber.RSVP = requireModule('rsvp');\n\n})();\n//@ sourceURL=ember-runtime/ext/ember");minispade.register('ember-runtime/ext/function', "(function() {minispade.require('ember-runtime/core');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar a_slice = Array.prototype.slice;\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Function) {\n\n /**\n The `property` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n `true`, which is the default.\n\n Computed properties allow you to treat a function like a property:\n\n ```javascript\n MyApp.President = Ember.Object.extend({\n firstName: '',\n lastName: '',\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Call this flag to mark the function as a property\n }.property()\n });\n\n var president = MyApp.President.create({\n firstName: \"Barack\",\n lastName: \"Obama\"\n });\n\n president.get('fullName'); // \"Barack Obama\"\n ```\n\n Treating a function like a property is useful because they can work with\n bindings, just like any other property.\n\n Many computed properties have dependencies on other properties. For\n example, in the above example, the `fullName` property depends on\n `firstName` and `lastName` to determine its value. You can tell Ember\n about these dependencies like this:\n\n ```javascript\n MyApp.President = Ember.Object.extend({\n firstName: '',\n lastName: '',\n\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n\n // Tell Ember.js that this computed property depends on firstName\n // and lastName\n }.property('firstName', 'lastName')\n });\n ```\n\n Make sure you list these dependencies so Ember knows when to update\n bindings that connect to a computed property. Changing a dependency\n will not immediately trigger an update of the computed property, but\n will instead clear the cache so that it is updated when the next `get`\n is called on the property.\n\n See [Ember.ComputedProperty](/api/classes/Ember.ComputedProperty.html), [Ember.computed](/api/#method_computed).\n\n @method property\n @for Function\n */\n Function.prototype.property = function() {\n var ret = Ember.computed(this);\n return ret.property.apply(ret, arguments);\n };\n\n /**\n The `observes` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n In the future this method may become asynchronous. If you want to ensure\n synchronous behavior, use `observesImmediately`.\n\n See `Ember.observer`.\n\n @method observes\n @for Function\n */\n Function.prototype.observes = function() {\n this.__ember_observes__ = a_slice.call(arguments);\n return this;\n };\n\n /**\n The `observesImmediately` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can observe property changes simply by adding the `observesImmediately`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes immediately after the \"value\" property changes\n }.observesImmediately('value')\n });\n ```\n\n In the future, `observes` may become asynchronous. In this event,\n `observesImmediately` will maintain the synchronous behavior.\n\n See `Ember.immediateObserver`.\n\n @method observesImmediately\n @for Function\n */\n Function.prototype.observesImmediately = function() {\n for (var i=0, l=arguments.length; i<l; i++) {\n var arg = arguments[i];\n Ember.assert(\"Immediate observers must observe internal properties only, not properties on other objects.\", arg.indexOf('.') === -1);\n }\n\n return this.observes.apply(this, arguments);\n };\n\n /**\n The `observesBefore` extension of Javascript's Function prototype is\n available when `Ember.EXTEND_PROTOTYPES` or\n `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.\n\n You can get notified when a property change is about to happen by\n by adding the `observesBefore` call to the end of your method\n declarations in classes that you write. For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property is about to change\n }.observesBefore('value')\n });\n ```\n\n See `Ember.beforeObserver`.\n\n @method observesBefore\n @for Function\n */\n Function.prototype.observesBefore = function() {\n this.__ember_observesBefore__ = a_slice.call(arguments);\n return this;\n };\n\n /**\n The `on` extension of Javascript's Function prototype is available\n when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is\n true, which is the default.\n\n You can listen for events simply by adding the `on` call to the end of\n your method declarations in classes or mixins that you write. For example:\n\n ```javascript\n Ember.Mixin.create({\n doSomethingWithElement: function() {\n // Executes whenever the \"didInsertElement\" event fires\n }.on('didInsertElement')\n });\n ```\n\n See `Ember.on`.\n\n @method on\n @for Function\n */\n Function.prototype.on = function() {\n var events = a_slice.call(arguments);\n this.__ember_listens__ = events;\n return this;\n };\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/function");minispade.register('ember-runtime/ext/string', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar fmt = Ember.String.fmt,\n w = Ember.String.w,\n loc = Ember.String.loc,\n camelize = Ember.String.camelize,\n decamelize = Ember.String.decamelize,\n dasherize = Ember.String.dasherize,\n underscore = Ember.String.underscore,\n capitalize = Ember.String.capitalize,\n classify = Ember.String.classify;\n\nif (Ember.FEATURES.isEnabled(\"string-humanize\")) {\n var humanize = Ember.String.humanize;\n}\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {\n\n /**\n See [Ember.String.fmt](/api/classes/Ember.String.html#method_fmt).\n\n @method fmt\n @for String\n */\n String.prototype.fmt = function() {\n return fmt(this, arguments);\n };\n\n /**\n See [Ember.String.w](/api/classes/Ember.String.html#method_w).\n\n @method w\n @for String\n */\n String.prototype.w = function() {\n return w(this);\n };\n\n /**\n See [Ember.String.loc](/api/classes/Ember.String.html#method_loc).\n\n @method loc\n @for String\n */\n String.prototype.loc = function() {\n return loc(this, arguments);\n };\n\n /**\n See [Ember.String.camelize](/api/classes/Ember.String.html#method_camelize).\n\n @method camelize\n @for String\n */\n String.prototype.camelize = function() {\n return camelize(this);\n };\n\n /**\n See [Ember.String.decamelize](/api/classes/Ember.String.html#method_decamelize).\n\n @method decamelize\n @for String\n */\n String.prototype.decamelize = function() {\n return decamelize(this);\n };\n\n /**\n See [Ember.String.dasherize](/api/classes/Ember.String.html#method_dasherize).\n\n @method dasherize\n @for String\n */\n String.prototype.dasherize = function() {\n return dasherize(this);\n };\n\n /**\n See [Ember.String.underscore](/api/classes/Ember.String.html#method_underscore).\n\n @method underscore\n @for String\n */\n String.prototype.underscore = function() {\n return underscore(this);\n };\n\n /**\n See [Ember.String.classify](/api/classes/Ember.String.html#method_classify).\n\n @method classify\n @for String\n */\n String.prototype.classify = function() {\n return classify(this);\n };\n\n /**\n See [Ember.String.capitalize](/api/classes/Ember.String.html#method_capitalize).\n\n @method capitalize\n @for String\n */\n String.prototype.capitalize = function() {\n return capitalize(this);\n };\n\n if (Ember.FEATURES.isEnabled(\"string-humanize\")) {\n /**\n See [Ember.String.humanize](/api/classes/Ember.String.html#method_humanize).\n\n @method humanize\n @for String\n */\n String.prototype.humanize = function() {\n return humanize(this);\n };\n }\n\n}\n\n\n})();\n//@ sourceURL=ember-runtime/ext/string");minispade.register('ember-runtime', "(function() {/**\nEmber Runtime\n\n@module ember\n@submodule ember-runtime\n@requires ember-metal\n*/\nminispade.require('container');\nminispade.require('ember-metal');\nminispade.require('ember-runtime/core');\nminispade.require('ember-runtime/computed/reduce_computed_macros');\nminispade.require('ember-runtime/ext');\nminispade.require('ember-runtime/mixins');\nminispade.require('ember-runtime/system');\nminispade.require('ember-runtime/controllers');\n\n})();\n//@ sourceURL=ember-runtime");minispade.register('ember-runtime/mixins', "(function() {minispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/comparable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/enumerable');\nminispade.require('ember-runtime/mixins/freezable');\nminispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/mixins/target_action_support');\nminispade.require('ember-runtime/mixins/evented');\nminispade.require('ember-runtime/mixins/deferred');\nminispade.require('ember-runtime/mixins/action_handler');\nminispade.require('ember-runtime/mixins/promise_proxy');\n\n})();\n//@ sourceURL=ember-runtime/mixins");minispade.register('ember-runtime/mixins/action_handler', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, typeOf = Ember.typeOf;\n\n/**\n The `Ember.ActionHandler` mixin implements support for moving an `actions`\n property to an `_actions` property at extend time, and adding `_actions`\n to the object's mergedProperties list.\n\n `Ember.ActionHandler` is used internally by Ember in `Ember.View`,\n `Ember.Controller`, and `Ember.Route`.\n\n @class ActionHandler\n @namespace Ember\n*/\nEmber.ActionHandler = Ember.Mixin.create({\n mergedProperties: ['_actions'],\n\n /**\n @private\n\n Moves `actions` to `_actions` at extend time. Note that this currently\n modifies the mixin themselves, which is technically dubious but\n is practically of little consequence. This may change in the future.\n\n @method willMergeMixin\n */\n willMergeMixin: function(props) {\n var hashName;\n\n if (!props._actions) {\n if (typeOf(props.actions) === 'object') {\n hashName = 'actions';\n } else if (typeOf(props.events) === 'object') {\n Ember.deprecate('Action handlers contained in an `events` object are deprecated in favor of putting them in an `actions` object', false);\n hashName = 'events';\n }\n\n if (hashName) {\n props._actions = Ember.merge(props._actions || {}, props[hashName]);\n }\n\n delete props[hashName];\n }\n },\n\n send: function(actionName) {\n var args = [].slice.call(arguments, 1), target;\n\n if (this._actions && this._actions[actionName]) {\n if (this._actions[actionName].apply(this, args) === true) {\n // handler returned true, so this action will bubble\n } else {\n return;\n }\n } else if (this.deprecatedSend && this.deprecatedSendHandles && this.deprecatedSendHandles(actionName)) {\n if (this.deprecatedSend.apply(this, [].slice.call(arguments)) === true) {\n // handler return true, so this action will bubble\n } else {\n return;\n }\n }\n\n if (target = get(this, 'target')) {\n Ember.assert(\"The `target` for \" + this + \" (\" + target + \") does not have a `send` method\", typeof target.send === 'function');\n target.send.apply(target, arguments);\n }\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/action_handler");minispade.register('ember-runtime/mixins/array', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set, isNone = Ember.isNone, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;\n\n// ..........................................................\n// ARRAY\n//\n/**\n This module implements Observer-friendly Array-like behavior. This mixin is\n picked up by the Array class as well as other controllers, etc. that want to\n appear to be arrays.\n\n Unlike `Ember.Enumerable,` this mixin defines methods specifically for\n collections that provide index-ordered access to their contents. When you\n are designing code that needs to accept any kind of Array-like object, you\n should use these methods instead of Array primitives because these will\n properly notify observers of changes to the array.\n\n Although these methods are efficient, they do add a layer of indirection to\n your application so it is a good idea to use them only when you need the\n flexibility of using both true JavaScript arrays and \"virtual\" arrays such\n as controllers and collections.\n\n You can use the methods defined in this module to access and modify array\n contents in a KVO-friendly way. You can also be notified whenever the\n membership of an array changes by changing the syntax of the property to\n `.observes('*myProperty.[]')`.\n\n To support `Ember.Array` in your own class, you must override two\n primitives to use it: `replace()` and `objectAt()`.\n\n Note that the Ember.Array mixin also incorporates the `Ember.Enumerable`\n mixin. All `Ember.Array`-like objects are also enumerable.\n\n @class Array\n @namespace Ember\n @uses Ember.Enumerable\n @since Ember 0.9.0\n*/\nEmber.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.prototype */ {\n\n /**\n Your array must support the `length` property. Your replace methods should\n set this property whenever it changes.\n\n @property {Number} length\n */\n length: Ember.required(),\n\n /**\n Returns the object at the given `index`. If the given `index` is negative\n or is greater or equal than the array length, returns `undefined`.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n If your object supports retrieving the value of an array item using `get()`\n (i.e. `myArray.get(0)`), then you do not need to implement this method\n yourself.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectAt(0); // \"a\"\n arr.objectAt(3); // \"d\"\n arr.objectAt(-1); // undefined\n arr.objectAt(4); // undefined\n arr.objectAt(5); // undefined\n ```\n\n @method objectAt\n @param {Number} idx The index of the item to return.\n @return {*} item at index or undefined\n */\n objectAt: function(idx) {\n if ((idx < 0) || (idx>=get(this, 'length'))) return undefined ;\n return get(this, idx);\n },\n\n /**\n This returns the objects at the specified indexes, using `objectAt`.\n\n ```javascript\n var arr = ['a', 'b', 'c', 'd'];\n arr.objectsAt([0, 1, 2]); // [\"a\", \"b\", \"c\"]\n arr.objectsAt([2, 3, 4]); // [\"c\", \"d\", undefined]\n ```\n\n @method objectsAt\n @param {Array} indexes An array of indexes of items to return.\n @return {Array}\n */\n objectsAt: function(indexes) {\n var self = this;\n return map(indexes, function(idx) { return self.objectAt(idx); });\n },\n\n // overrides Ember.Enumerable version\n nextObject: function(idx) {\n return this.objectAt(idx);\n },\n\n /**\n This is the handler for the special array content property. If you get\n this property, it will return this. If you set this property it a new\n array, it will replace the current content.\n\n This property overrides the default property defined in `Ember.Enumerable`.\n\n @property []\n @return this\n */\n '[]': Ember.computed(function(key, value) {\n if (value !== undefined) this.replace(0, get(this, 'length'), value) ;\n return this ;\n }),\n\n firstObject: Ember.computed(function() {\n return this.objectAt(0);\n }),\n\n lastObject: Ember.computed(function() {\n return this.objectAt(get(this, 'length')-1);\n }),\n\n // optimized version from Enumerable\n contains: function(obj) {\n return this.indexOf(obj) >= 0;\n },\n\n // Add any extra methods to Ember.Array that are native to the built-in Array.\n /**\n Returns a new array that is a slice of the receiver. This implementation\n uses the observable array methods to retrieve the objects for the new\n slice.\n\n ```javascript\n var arr = ['red', 'green', 'blue'];\n arr.slice(0); // ['red', 'green', 'blue']\n arr.slice(0, 2); // ['red', 'green']\n arr.slice(1, 100); // ['green', 'blue']\n ```\n\n @method slice\n @param {Integer} beginIndex (Optional) index to begin slicing from.\n @param {Integer} endIndex (Optional) index to end the slice at.\n @return {Array} New array with specified slice\n */\n slice: function(beginIndex, endIndex) {\n var ret = Ember.A();\n var length = get(this, 'length') ;\n if (isNone(beginIndex)) beginIndex = 0 ;\n if (isNone(endIndex) || (endIndex > length)) endIndex = length ;\n\n if (beginIndex < 0) beginIndex = length + beginIndex;\n if (endIndex < 0) endIndex = length + endIndex;\n\n while(beginIndex < endIndex) {\n ret[ret.length] = this.objectAt(beginIndex++) ;\n }\n return ret ;\n },\n\n /**\n Returns the index of the given object's first occurrence.\n If no `startAt` argument is given, the starting location to\n search is 0. If it's negative, will count backward from\n the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.indexOf(\"a\"); // 0\n arr.indexOf(\"z\"); // -1\n arr.indexOf(\"a\", 2); // 4\n arr.indexOf(\"a\", -1); // 4\n arr.indexOf(\"b\", 3); // -1\n arr.indexOf(\"a\", 100); // -1\n ```\n\n @method indexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n indexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined) startAt = 0;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this.objectAt(idx) === object) return idx ;\n }\n return -1;\n },\n\n /**\n Returns the index of the given object's last occurrence.\n If no `startAt` argument is given, the search starts from\n the last position. If it's negative, will count backward\n from the end of the array. Returns -1 if no match is found.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\", \"d\", \"a\"];\n arr.lastIndexOf(\"a\"); // 4\n arr.lastIndexOf(\"z\"); // -1\n arr.lastIndexOf(\"a\", 2); // 0\n arr.lastIndexOf(\"a\", -1); // 4\n arr.lastIndexOf(\"b\", 3); // 1\n arr.lastIndexOf(\"a\", 100); // 4\n ```\n\n @method lastIndexOf\n @param {Object} object the item to search for\n @param {Number} startAt optional starting location to search, default 0\n @return {Number} index or -1 if not found\n */\n lastIndexOf: function(object, startAt) {\n var idx, len = get(this, 'length');\n\n if (startAt === undefined || startAt >= len) startAt = len-1;\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this.objectAt(idx) === object) return idx ;\n }\n return -1;\n },\n\n // ..........................................................\n // ARRAY OBSERVERS\n //\n\n /**\n Adds an array observer to the receiving array. The array observer object\n normally must implement two methods:\n\n * `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be\n called just before the array is modified.\n * `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be\n called just after the array is modified.\n\n Both callbacks will be passed the observed object, starting index of the\n change as well a a count of the items to be removed and added. You can use\n these callbacks to optionally inspect the array during the change, clear\n caches, or do any other bookkeeping necessary.\n\n In addition to passing a target, you can also include an options hash\n which you can use to override the method names that will be invoked on the\n target.\n\n @method addArrayObserver\n @param {Object} target The observer object.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n addArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.addListener(this, '@array:before', target, willChange);\n Ember.addListener(this, '@array:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Removes an array observer from the object if the observer is current\n registered. Calling this method multiple times with the same object will\n have no effect.\n\n @method removeArrayObserver\n @param {Object} target The object observing the array.\n @param {Hash} opts Optional hash of configuration options including\n `willChange` and `didChange` option.\n @return {Ember.Array} receiver\n */\n removeArrayObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'arrayWillChange',\n didChange = (opts && opts.didChange) || 'arrayDidChange';\n\n var hasObservers = get(this, 'hasArrayObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');\n Ember.removeListener(this, '@array:before', target, willChange);\n Ember.removeListener(this, '@array:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property Boolean\n */\n hasArrayObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@array:change') || Ember.hasListeners(this, '@array:before');\n }),\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just before the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentWillChange\n @param {Number} startIdx The starting index in the array that will change.\n @param {Number} removeAmt The number of items that will be removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that will be added. If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentWillChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n // Make sure the @each proxy is set up if anyone is observing @each\n if (Ember.isWatching(this, '@each')) { get(this, '@each'); }\n\n Ember.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);\n\n var removing, lim;\n if (startIdx>=0 && removeAmt>=0 && get(this, 'hasEnumerableObservers')) {\n removing = [];\n lim = startIdx+removeAmt;\n for(var idx=startIdx;idx<lim;idx++) removing.push(this.objectAt(idx));\n } else {\n removing = removeAmt;\n }\n\n this.enumerableContentWillChange(removing, addAmt);\n\n return this;\n },\n\n /**\n If you are implementing an object that supports `Ember.Array`, call this\n method just after the array content changes to notify any observers and\n invalidate any related properties. Pass the starting index of the change\n as well as a delta of the amounts to change.\n\n @method arrayContentDidChange\n @param {Number} startIdx The starting index in the array that did change.\n @param {Number} removeAmt The number of items that were removed. If you\n pass `null` assumes 0\n @param {Number} addAmt The number of items that were added. If you\n pass `null` assumes 0.\n @return {Ember.Array} receiver\n */\n arrayContentDidChange: function(startIdx, removeAmt, addAmt) {\n\n // if no args are passed assume everything changes\n if (startIdx===undefined) {\n startIdx = 0;\n removeAmt = addAmt = -1;\n } else {\n if (removeAmt === undefined) removeAmt=-1;\n if (addAmt === undefined) addAmt=-1;\n }\n\n var adding, lim;\n if (startIdx>=0 && addAmt>=0 && get(this, 'hasEnumerableObservers')) {\n adding = [];\n lim = startIdx+addAmt;\n for(var idx=startIdx;idx<lim;idx++) adding.push(this.objectAt(idx));\n } else {\n adding = addAmt;\n }\n\n this.enumerableContentDidChange(removeAmt, adding);\n Ember.sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]);\n\n var length = get(this, 'length'),\n cachedFirst = cacheFor(this, 'firstObject'),\n cachedLast = cacheFor(this, 'lastObject');\n if (this.objectAt(0) !== cachedFirst) {\n Ember.propertyWillChange(this, 'firstObject');\n Ember.propertyDidChange(this, 'firstObject');\n }\n if (this.objectAt(length-1) !== cachedLast) {\n Ember.propertyWillChange(this, 'lastObject');\n Ember.propertyDidChange(this, 'lastObject');\n }\n\n return this;\n },\n\n // ..........................................................\n // ENUMERATED PROPERTIES\n //\n\n /**\n Returns a special object that can be used to observe individual properties\n on the array. Just get an equivalent property on this object and it will\n return an enumerable that maps automatically to the named key on the\n member objects.\n\n If you merely want to watch for any items being added or removed to the array,\n use the `[]` property instead of `@each`.\n\n @property @each\n */\n '@each': Ember.computed(function() {\n if (!this.__each) this.__each = new Ember.EachProxy(this);\n return this.__each;\n })\n\n}) ;\n\n})();\n//@ sourceURL=ember-runtime/mixins/array");minispade.register('ember-runtime/mixins/comparable', "(function() {minispade.require('ember-runtime/core');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n/**\n Implements some standard methods for comparing objects. Add this mixin to\n any class you create that can compare its instances.\n\n You should implement the `compare()` method.\n\n @class Comparable\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Comparable = Ember.Mixin.create( /** @scope Ember.Comparable.prototype */{\n\n /**\n Override to return the result of the comparison of the two parameters. The\n compare method should return:\n\n - `-1` if `a < b`\n - `0` if `a == b`\n - `1` if `a > b`\n\n Default implementation raises an exception.\n\n @method compare\n @param a {Object} the first object to compare\n @param b {Object} the second object to compare\n @return {Integer} the result of the comparison\n */\n compare: Ember.required(Function)\n\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/comparable");minispade.register('ember-runtime/mixins/copyable', "(function() {minispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n Implements some standard methods for copying an object. Add this mixin to\n any object you create that can create a copy of itself. This mixin is\n added automatically to the built-in array.\n\n You should generally implement the `copy()` method to return a copy of the\n receiver.\n\n Note that `frozenCopy()` will only work if you also implement\n `Ember.Freezable`.\n\n @class Copyable\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Copyable = Ember.Mixin.create(/** @scope Ember.Copyable.prototype */ {\n\n /**\n Override to return a copy of the receiver. Default implementation raises\n an exception.\n\n @method copy\n @param {Boolean} deep if `true`, a deep copy of the object should be made\n @return {Object} copy of receiver\n */\n copy: Ember.required(Function),\n\n /**\n If the object implements `Ember.Freezable`, then this will return a new\n copy if the object is not frozen and the receiver if the object is frozen.\n\n Raises an exception if you try to call this method on a object that does\n not support freezing.\n\n You should use this method whenever you want a copy of a freezable object\n since a freezable object can simply return itself without actually\n consuming more memory.\n\n @method frozenCopy\n @return {Object} copy of receiver or receiver\n */\n frozenCopy: function() {\n if (Ember.Freezable && Ember.Freezable.detect(this)) {\n return get(this, 'isFrozen') ? this : this.copy().freeze();\n } else {\n throw new Ember.Error(Ember.String.fmt(\"%@ does not support freezing\", [this]));\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/copyable");minispade.register('ember-runtime/mixins/deferred', "(function() {var RSVP = requireModule(\"rsvp\");\n\nRSVP.configure('async', function(callback, promise) {\n Ember.run.schedule('actions', promise, callback, promise);\n});\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get;\n\n/**\n @class Deferred\n @namespace Ember\n */\nEmber.DeferredMixin = Ember.Mixin.create({\n /**\n Add handlers to be called when the Deferred object is resolved or rejected.\n\n @method then\n @param {Function} resolve a callback function to be called when done\n @param {Function} reject a callback function to be called when failed\n */\n then: function(resolve, reject) {\n var deferred, promise, entity;\n\n entity = this;\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n function fulfillmentHandler(fulfillment) {\n if (fulfillment === promise) {\n return resolve(entity);\n } else {\n return resolve(fulfillment);\n }\n }\n\n return promise.then(resolve && fulfillmentHandler, reject);\n },\n\n /**\n Resolve a Deferred object and call any `doneCallbacks` with the given args.\n\n @method resolve\n */\n resolve: function(value) {\n var deferred, promise;\n\n deferred = get(this, '_deferred');\n promise = deferred.promise;\n\n if (value === this) {\n deferred.resolve(promise);\n } else {\n deferred.resolve(value);\n }\n },\n\n /**\n Reject a Deferred object and call any `failCallbacks` with the given args.\n\n @method reject\n */\n reject: function(value) {\n get(this, '_deferred').reject(value);\n },\n\n _deferred: Ember.computed(function() {\n return RSVP.defer();\n })\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/deferred");minispade.register('ember-runtime/mixins/enumerable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\nvar a_slice = Array.prototype.slice;\nvar a_indexOf = Ember.EnumerableUtils.indexOf;\n\nvar contexts = [];\n\nfunction popCtx() {\n return contexts.length===0 ? {} : contexts.pop();\n}\n\nfunction pushCtx(ctx) {\n contexts.push(ctx);\n return null;\n}\n\nfunction iter(key, value) {\n var valueProvided = arguments.length === 2;\n\n function i(item) {\n var cur = get(item, key);\n return valueProvided ? value===cur : !!cur;\n }\n return i ;\n}\n\n/**\n This mixin defines the common interface implemented by enumerable objects\n in Ember. Most of these methods follow the standard Array iteration\n API defined up to JavaScript 1.8 (excluding language-specific features that\n cannot be emulated in older versions of JavaScript).\n\n This mixin is applied automatically to the Array class on page load, so you\n can use any of these methods on simple arrays. If Array already implements\n one of these methods, the mixin will not override them.\n\n ## Writing Your Own Enumerable\n\n To make your own custom class enumerable, you need two items:\n\n 1. You must have a length property. This property should change whenever\n the number of items in your enumerable object changes. If you using this\n with an `Ember.Object` subclass, you should be sure to change the length\n property using `set().`\n\n 2. If you must implement `nextObject().` See documentation.\n\n Once you have these two methods implement, apply the `Ember.Enumerable` mixin\n to your class and you will be able to enumerate the contents of your object\n like any other collection.\n\n ## Using Ember Enumeration with Other Libraries\n\n Many other libraries provide some kind of iterator or enumeration like\n facility. This is often where the most common API conflicts occur.\n Ember's API is designed to be as friendly as possible with other\n libraries by implementing only methods that mostly correspond to the\n JavaScript 1.8 API.\n\n @class Enumerable\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Enumerable = Ember.Mixin.create({\n\n /**\n Implement this method to make your class enumerable.\n\n This method will be call repeatedly during enumeration. The index value\n will always begin with 0 and increment monotonically. You don't have to\n rely on the index value to determine what object to return, but you should\n always check the value and start from the beginning when you see the\n requested index is 0.\n\n The `previousObject` is the object that was returned from the last call\n to `nextObject` for the current iteration. This is a useful way to\n manage iteration if you are tracing a linked list, for example.\n\n Finally the context parameter will always contain a hash you can use as\n a \"scratchpad\" to maintain any other state you need in order to iterate\n properly. The context object is reused and is not reset between\n iterations so make sure you setup the context with a fresh state whenever\n the index parameter is 0.\n\n Generally iterators will continue to call `nextObject` until the index\n reaches the your current length-1. If you run out of data before this\n time for some reason, you should simply return undefined.\n\n The default implementation of this method simply looks up the index.\n This works great on any Array-like objects.\n\n @method nextObject\n @param {Number} index the current index of the iteration\n @param {Object} previousObject the value returned by the last call to\n `nextObject`.\n @param {Object} context a context object you can use to maintain state.\n @return {Object} the next object in the iteration or undefined\n */\n nextObject: Ember.required(Function),\n\n /**\n Helper method returns the first object from a collection. This is usually\n used by bindings and other parts of the framework to extract a single\n object if the enumerable contains only one item.\n\n If you override this method, you should implement it so that it will\n always return the same value each time it is called. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('firstObject'); // \"a\"\n\n var arr = [];\n arr.get('firstObject'); // undefined\n ```\n\n @property firstObject\n @return {Object} the object or undefined\n */\n firstObject: Ember.computed(function() {\n if (get(this, 'length')===0) return undefined ;\n\n // handle generic enumerables\n var context = popCtx(), ret;\n ret = this.nextObject(0, null, context);\n pushCtx(context);\n return ret ;\n }).property('[]'),\n\n /**\n Helper method returns the last object from a collection. If your enumerable\n contains only one object, this method should always return that object.\n If your enumerable is empty, this method should return `undefined`.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.get('lastObject'); // \"c\"\n\n var arr = [];\n arr.get('lastObject'); // undefined\n ```\n\n @property lastObject\n @return {Object} the last object or undefined\n */\n lastObject: Ember.computed(function() {\n var len = get(this, 'length');\n if (len===0) return undefined ;\n var context = popCtx(), idx=0, cur, last = null;\n do {\n last = cur;\n cur = this.nextObject(idx++, last, context);\n } while (cur !== undefined);\n pushCtx(context);\n return last;\n }).property('[]'),\n\n /**\n Returns `true` if the passed object can be found in the receiver. The\n default version will iterate through the enumerable until the object\n is found. You may want to override this with a more efficient version.\n\n ```javascript\n var arr = [\"a\", \"b\", \"c\"];\n arr.contains(\"a\"); // true\n arr.contains(\"z\"); // false\n ```\n\n @method contains\n @param {Object} obj The object to search for.\n @return {Boolean} `true` if object is found in enumerable.\n */\n contains: function(obj) {\n return this.find(function(item) { return item===obj; }) !== undefined;\n },\n\n /**\n Iterates through the enumerable, calling the passed function on each\n item. This method corresponds to the `forEach()` method defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method forEach\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} receiver\n */\n forEach: function(callback, target) {\n if (typeof callback !== \"function\") throw new TypeError() ;\n var len = get(this, 'length'), last = null, context = popCtx();\n\n if (target === undefined) target = null;\n\n for(var idx=0;idx<len;idx++) {\n var next = this.nextObject(idx, last, context) ;\n callback.call(target, next, idx, this);\n last = next ;\n }\n last = null ;\n context = pushCtx(context);\n return this ;\n },\n\n /**\n Alias for `mapBy`\n\n @method getEach\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n getEach: function(key) {\n return this.mapBy(key);\n },\n\n /**\n Sets the value on the named property for each member. This is more\n efficient than using other methods defined on this helper. If the object\n implements Ember.Observable, the value will be changed to `set(),` otherwise\n it will be set directly. `null` objects are skipped.\n\n @method setEach\n @param {String} key The key to set\n @param {Object} value The object to set\n @return {Object} receiver\n */\n setEach: function(key, value) {\n return this.forEach(function(item) {\n set(item, key, value);\n });\n },\n\n /**\n Maps all of the items in the enumeration to another value, returning\n a new array. This method corresponds to `map()` defined in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the mapped value.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method map\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} The mapped array.\n */\n map: function(callback, target) {\n var ret = Ember.A();\n this.forEach(function(x, idx, i) {\n ret[idx] = callback.call(target, x, idx,i);\n });\n return ret ;\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapBy\n @param {String} key name of the property\n @return {Array} The mapped array.\n */\n mapBy: function(key) {\n return this.map(function(next) {\n return get(next, key);\n });\n },\n\n /**\n Similar to map, this specialized function returns the value of the named\n property on all items in the enumeration.\n\n @method mapProperty\n @param {String} key name of the property\n @return {Array} The mapped array.\n @deprecated Use `mapBy` instead\n */\n\n mapProperty: Ember.aliasMethod('mapBy'),\n\n /**\n Returns an array with all of the items in the enumeration that the passed\n function returns true for. This method corresponds to `filter()` defined in\n JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method filter\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A filtered array.\n */\n filter: function(callback, target) {\n var ret = Ember.A();\n this.forEach(function(x, idx, i) {\n if (callback.call(target, x, idx, i)) ret.push(x);\n });\n return ret ;\n },\n\n /**\n Returns an array with all of the items in the enumeration where the passed\n function returns false for. This method is the inverse of filter().\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n function(item, index, enumerable);\n\n - *item* is the current item in the iteration.\n - *index* is the current index in the iteration\n - *enumerable* is the enumerable object itself.\n\n It should return the a falsey value to include the item in the results.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as \"this\" on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method reject\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Array} A rejected array.\n */\n reject: function(callback, target) {\n return this.filter(function() {\n return !(callback.apply(target, arguments));\n });\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} filtered array\n */\n filterBy: function(key, value) {\n return this.filter(iter.apply(this, arguments));\n },\n\n /**\n Returns an array with just the items with the matched property. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n @method filterProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} filtered array\n @deprecated Use `filterBy` instead\n */\n filterProperty: Ember.aliasMethod('filterBy'),\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n */\n rejectBy: function(key, value) {\n var exactValue = function(item) { return get(item, key) === value; },\n hasValue = function(item) { return !!get(item, key); },\n use = (arguments.length === 2 ? exactValue : hasValue);\n\n return this.reject(use);\n },\n\n /**\n Returns an array with the items that do not have truthy values for\n key. You can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to false.\n\n @method rejectProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Array} rejected array\n @deprecated Use `rejectBy` instead\n */\n rejectProperty: Ember.aliasMethod('rejectBy'),\n\n /**\n Returns the first item in the array for which the callback returns true.\n This method works similar to the `filter()` method defined in JavaScript 1.6\n except that it will stop working on the array once a match is found.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n @method find\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Object} Found item or `undefined`.\n */\n find: function(callback, target) {\n var len = get(this, 'length') ;\n if (target === undefined) target = null;\n\n var last = null, next, found = false, ret ;\n var context = popCtx();\n for(var idx=0;idx<len && !found;idx++) {\n next = this.nextObject(idx, last, context) ;\n if (found = callback.call(target, next, idx, this)) ret = next ;\n last = next ;\n }\n next = last = null ;\n context = pushCtx(context);\n return ret ;\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n */\n findBy: function(key, value) {\n return this.find(iter.apply(this, arguments));\n },\n\n /**\n Returns the first item with a property matching the passed value. You\n can pass an optional second argument with the target value. Otherwise\n this will match any property that evaluates to `true`.\n\n This method works much like the more generic `find()` method.\n\n @method findProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Object} found item or `undefined`\n @deprecated Use `findBy` instead\n */\n findProperty: Ember.aliasMethod('findBy'),\n\n /**\n Returns `true` if the passed function returns true for every item in the\n enumeration. This corresponds with the `every()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` or `false`.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Example Usage:\n\n ```javascript\n if (people.every(isEngineer)) { Paychecks.addBigBonus(); }\n ```\n\n @method every\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean}\n */\n every: function(callback, target) {\n return !this.find(function(x, idx, i) {\n return !callback.call(target, x, idx, i);\n });\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for all items in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method everyBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean}\n */\n everyBy: function(key, value) {\n return this.every(iter.apply(this, arguments));\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for all items in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method everyProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean}\n @deprecated Use `everyBy` instead\n */\n everyProperty: Ember.aliasMethod('everyBy'),\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.any(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method any\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean} `true` if the passed function returns `true` for any item\n */\n any: function(callback, target) {\n return !!this.find(function(x, idx, i) {\n return !!callback.call(target, x, idx, i);\n });\n },\n\n /**\n Returns `true` if the passed function returns true for any item in the\n enumeration. This corresponds with the `some()` method in JavaScript 1.6.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(item, index, enumerable);\n ```\n\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n It should return the `true` to include the item in the results, `false`\n otherwise.\n\n Note that in addition to a callback, you can also pass an optional target\n object that will be set as `this` on the context. This is a good way\n to give your iterator function access to the current object.\n\n Usage Example:\n\n ```javascript\n if (people.some(isManager)) { Paychecks.addBiggerBonus(); }\n ```\n\n @method some\n @param {Function} callback The callback to execute\n @param {Object} [target] The target object to use\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `any` instead\n */\n some: Ember.aliasMethod('any'),\n\n /**\n Returns `true` if the passed property resolves to `true` for any item in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method anyBy\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n */\n anyBy: function(key, value) {\n return this.any(iter.apply(this, arguments));\n },\n\n /**\n Returns `true` if the passed property resolves to `true` for any item in\n the enumerable. This method is often simpler/faster than using a callback.\n\n @method someProperty\n @param {String} key the property to test\n @param {String} [value] optional value to test against.\n @return {Boolean} `true` if the passed function returns `true` for any item\n @deprecated Use `anyBy` instead\n */\n someProperty: Ember.aliasMethod('anyBy'),\n\n /**\n This will combine the values of the enumerator into a single value. It\n is a useful way to collect a summary value from an enumeration. This\n corresponds to the `reduce()` method defined in JavaScript 1.8.\n\n The callback method you provide should have the following signature (all\n parameters are optional):\n\n ```javascript\n function(previousValue, item, index, enumerable);\n ```\n\n - `previousValue` is the value returned by the last call to the iterator.\n - `item` is the current item in the iteration.\n - `index` is the current index in the iteration.\n - `enumerable` is the enumerable object itself.\n\n Return the new cumulative value.\n\n In addition to the callback you can also pass an `initialValue`. An error\n will be raised if you do not pass an initial value and the enumerator is\n empty.\n\n Note that unlike the other methods, this method does not allow you to\n pass a target object to set as this for the callback. It's part of the\n spec. Sorry.\n\n @method reduce\n @param {Function} callback The callback to execute\n @param {Object} initialValue Initial value for the reduce\n @param {String} reducerProperty internal use only.\n @return {Object} The reduced value.\n */\n reduce: function(callback, initialValue, reducerProperty) {\n if (typeof callback !== \"function\") { throw new TypeError(); }\n\n var ret = initialValue;\n\n this.forEach(function(item, i) {\n ret = callback.call(null, ret, item, i, this, reducerProperty);\n }, this);\n\n return ret;\n },\n\n /**\n Invokes the named method on every object in the receiver that\n implements it. This method corresponds to the implementation in\n Prototype 1.6.\n\n @method invoke\n @param {String} methodName the name of the method\n @param {Object...} args optional arguments to pass as well.\n @return {Array} return values from calling invoke.\n */\n invoke: function(methodName) {\n var args, ret = Ember.A();\n if (arguments.length>1) args = a_slice.call(arguments, 1);\n\n this.forEach(function(x, idx) {\n var method = x && x[methodName];\n if ('function' === typeof method) {\n ret[idx] = args ? method.apply(x, args) : method.call(x);\n }\n }, this);\n\n return ret;\n },\n\n /**\n Simply converts the enumerable into a genuine array. The order is not\n guaranteed. Corresponds to the method implemented by Prototype.\n\n @method toArray\n @return {Array} the enumerable as an array.\n */\n toArray: function() {\n var ret = Ember.A();\n this.forEach(function(o, idx) { ret[idx] = o; });\n return ret ;\n },\n\n /**\n Returns a copy of the array with all null and undefined elements removed.\n\n ```javascript\n var arr = [\"a\", null, \"c\", undefined];\n arr.compact(); // [\"a\", \"c\"]\n ```\n\n @method compact\n @return {Array} the array without null and undefined elements.\n */\n compact: function() {\n return this.filter(function(value) { return value != null; });\n },\n\n /**\n Returns a new enumerable that excludes the passed value. The default\n implementation returns an array regardless of the receiver type unless\n the receiver does not contain the value.\n\n ```javascript\n var arr = [\"a\", \"b\", \"a\", \"c\"];\n arr.without(\"a\"); // [\"b\", \"c\"]\n ```\n\n @method without\n @param {Object} value\n @return {Ember.Enumerable}\n */\n without: function(value) {\n if (!this.contains(value)) return this; // nothing to do\n var ret = Ember.A();\n this.forEach(function(k) {\n if (k !== value) ret[ret.length] = k;\n }) ;\n return ret ;\n },\n\n /**\n Returns a new enumerable that contains only unique values. The default\n implementation returns an array regardless of the receiver type.\n\n ```javascript\n var arr = [\"a\", \"a\", \"b\", \"b\"];\n arr.uniq(); // [\"a\", \"b\"]\n ```\n\n @method uniq\n @return {Ember.Enumerable}\n */\n uniq: function() {\n var ret = Ember.A();\n this.forEach(function(k) {\n if (a_indexOf(ret, k)<0) ret.push(k);\n });\n return ret;\n },\n\n /**\n This property will trigger anytime the enumerable's content changes.\n You can observe this property to be notified of changes to the enumerables\n content.\n\n For plain enumerables, this property is read only. `Ember.Array` overrides\n this method.\n\n @property []\n @type Ember.Array\n @return this\n */\n '[]': Ember.computed(function(key, value) {\n return this;\n }),\n\n // ..........................................................\n // ENUMERABLE OBSERVERS\n //\n\n /**\n Registers an enumerable observer. Must implement `Ember.EnumerableObserver`\n mixin.\n\n @method addEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n addEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (!hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.addListener(this, '@enumerable:before', target, willChange);\n Ember.addListener(this, '@enumerable:change', target, didChange);\n if (!hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Removes a registered enumerable observer.\n\n @method removeEnumerableObserver\n @param {Object} target\n @param {Hash} [opts]\n @return this\n */\n removeEnumerableObserver: function(target, opts) {\n var willChange = (opts && opts.willChange) || 'enumerableWillChange',\n didChange = (opts && opts.didChange) || 'enumerableDidChange';\n\n var hasObservers = get(this, 'hasEnumerableObservers');\n if (hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');\n Ember.removeListener(this, '@enumerable:before', target, willChange);\n Ember.removeListener(this, '@enumerable:change', target, didChange);\n if (hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');\n return this;\n },\n\n /**\n Becomes true whenever the array currently has observers watching changes\n on the array.\n\n @property hasEnumerableObservers\n @type Boolean\n */\n hasEnumerableObservers: Ember.computed(function() {\n return Ember.hasListeners(this, '@enumerable:change') || Ember.hasListeners(this, '@enumerable:before');\n }),\n\n\n /**\n Invoke this method just before the contents of your enumerable will\n change. You can either omit the parameters completely or pass the objects\n to be removed or added if available or just a count.\n\n @method enumerableContentWillChange\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to be\n added or the number of items to be added.\n @chainable\n */\n enumerableContentWillChange: function(removing, adding) {\n\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding,'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.propertyWillChange(this, '[]');\n if (hasDelta) Ember.propertyWillChange(this, 'length');\n Ember.sendEvent(this, '@enumerable:before', [this, removing, adding]);\n\n return this;\n },\n\n /**\n Invoke this method when the contents of your enumerable has changed.\n This will notify any observers watching for content changes. If your are\n implementing an ordered enumerable (such as an array), also pass the\n start and end values where the content changed so that it can be used to\n notify range observers.\n\n @method enumerableContentDidChange\n @param {Number} [start] optional start offset for the content change.\n For unordered enumerables, you should always pass -1.\n @param {Ember.Enumerable|Number} removing An enumerable of the objects to\n be removed or the number of items to be removed.\n @param {Ember.Enumerable|Number} adding An enumerable of the objects to\n be added or the number of items to be added.\n @chainable\n */\n enumerableContentDidChange: function(removing, adding) {\n var removeCnt, addCnt, hasDelta;\n\n if ('number' === typeof removing) removeCnt = removing;\n else if (removing) removeCnt = get(removing, 'length');\n else removeCnt = removing = -1;\n\n if ('number' === typeof adding) addCnt = adding;\n else if (adding) addCnt = get(adding, 'length');\n else addCnt = adding = -1;\n\n hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;\n\n if (removing === -1) removing = null;\n if (adding === -1) adding = null;\n\n Ember.sendEvent(this, '@enumerable:change', [this, removing, adding]);\n if (hasDelta) Ember.propertyDidChange(this, 'length');\n Ember.propertyDidChange(this, '[]');\n\n return this ;\n }\n\n});\n\nif (Ember.FEATURES.isEnabled(\"ember-runtime-sortBy\")) {\n Ember.Enumerable.reopen({\n /**\n Converts the enumerable into an array and sorts by the keys\n specified in the argument.\n\n You may provide multiple arguments to sort by multiple properties.\n\n @method sortBy\n @param {String} property name(s) to sort on\n @return {Array} The sorted array.\n */\n sortBy: function() {\n var sortKeys = arguments;\n return this.toArray().sort(function(a, b){\n for(var i = 0; i < sortKeys.length; i++) {\n var key = sortKeys[i],\n propA = get(a, key),\n propB = get(b, key);\n // return 1 or -1 else continue to the next sortKey\n var compareValue = Ember.compare(propA, propB);\n if (compareValue) { return compareValue; }\n }\n return 0;\n });\n }\n });\n}\n\n})();\n//@ sourceURL=ember-runtime/mixins/enumerable");minispade.register('ember-runtime/mixins/evented', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n This mixin allows for Ember objects to subscribe to and emit events.\n\n ```javascript\n App.Person = Ember.Object.extend(Ember.Evented, {\n greet: function() {\n // ...\n this.trigger('greet');\n }\n });\n\n var person = App.Person.create();\n\n person.on('greet', function() {\n console.log('Our person has greeted');\n });\n\n person.greet();\n\n // outputs: 'Our person has greeted'\n ```\n\n You can also chain multiple event subscriptions:\n\n ```javascript\n person.on('greet', function() {\n console.log('Our person has greeted');\n }).one('greet', function() {\n console.log('Offer one-time special');\n }).off('event', this, forgetThis);\n ```\n\n @class Evented\n @namespace Ember\n */\nEmber.Evented = Ember.Mixin.create({\n\n /**\n Subscribes to a named event with given function.\n\n ```javascript\n person.on('didLoad', function() {\n // fired once the person has loaded\n });\n ```\n\n An optional target can be passed in as the 2nd argument that will\n be set as the \"this\" for the callback. This is a good way to give your\n function access to the object triggering the event. When the target\n parameter is used the callback becomes the third argument.\n\n @method on\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n on: function(name, target, method) {\n Ember.addListener(this, name, target, method);\n return this;\n },\n\n /**\n Subscribes a function to a named event and then cancels the subscription\n after the first time the event is triggered. It is good to use ``one`` when\n you only care about the first time an event has taken place.\n\n This function takes an optional 2nd argument that will become the \"this\"\n value for the callback. If this argument is passed then the 3rd argument\n becomes the function.\n\n @method one\n @param {String} name The name of the event\n @param {Object} [target] The \"this\" binding for the callback\n @param {Function} method The callback to execute\n @return this\n */\n one: function(name, target, method) {\n if (!method) {\n method = target;\n target = null;\n }\n\n Ember.addListener(this, name, target, method, true);\n return this;\n },\n\n /**\n Triggers a named event for the object. Any additional arguments\n will be passed as parameters to the functions that are subscribed to the\n event.\n\n ```javascript\n person.on('didEat', function(food) {\n console.log('person ate some ' + food);\n });\n\n person.trigger('didEat', 'broccoli');\n\n // outputs: person ate some broccoli\n ```\n @method trigger\n @param {String} name The name of the event\n @param {Object...} args Optional arguments to pass on\n */\n trigger: function(name) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n Ember.sendEvent(this, name, args);\n },\n\n /**\n Cancels subscription for given name, target, and method.\n\n @method off\n @param {String} name The name of the event\n @param {Object} target The target of the subscription\n @param {Function} method The function of the subscription\n @return this\n */\n off: function(name, target, method) {\n Ember.removeListener(this, name, target, method);\n return this;\n },\n\n /**\n Checks to see if object has any subscriptions for named event.\n\n @method has\n @param {String} name The name of the event\n @return {Boolean} does the object have a subscription for event\n */\n has: function(name) {\n return Ember.hasListeners(this, name);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/evented");minispade.register('ember-runtime/mixins/freezable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n The `Ember.Freezable` mixin implements some basic methods for marking an\n object as frozen. Once an object is frozen it should be read only. No changes\n may be made the internal state of the object.\n\n ## Enforcement\n\n To fully support freezing in your subclass, you must include this mixin and\n override any method that might alter any property on the object to instead\n raise an exception. You can check the state of an object by checking the\n `isFrozen` property.\n\n Although future versions of JavaScript may support language-level freezing\n object objects, that is not the case today. Even if an object is freezable,\n it is still technically possible to modify the object, even though it could\n break other parts of your application that do not expect a frozen object to\n change. It is, therefore, very important that you always respect the\n `isFrozen` property on all freezable objects.\n\n ## Example Usage\n\n The example below shows a simple object that implement the `Ember.Freezable`\n protocol.\n\n ```javascript\n Contact = Ember.Object.extend(Ember.Freezable, {\n firstName: null,\n lastName: null,\n\n // swaps the names\n swapNames: function() {\n if (this.get('isFrozen')) throw Ember.FROZEN_ERROR;\n var tmp = this.get('firstName');\n this.set('firstName', this.get('lastName'));\n this.set('lastName', tmp);\n return this;\n }\n\n });\n\n c = Context.create({ firstName: \"John\", lastName: \"Doe\" });\n c.swapNames(); // returns c\n c.freeze();\n c.swapNames(); // EXCEPTION\n ```\n\n ## Copying\n\n Usually the `Ember.Freezable` protocol is implemented in cooperation with the\n `Ember.Copyable` protocol, which defines a `frozenCopy()` method that will\n return a frozen object, if the object implements this method as well.\n\n @class Freezable\n @namespace Ember\n @since Ember 0.9\n*/\nEmber.Freezable = Ember.Mixin.create(/** @scope Ember.Freezable.prototype */ {\n\n /**\n Set to `true` when the object is frozen. Use this property to detect\n whether your object is frozen or not.\n\n @property isFrozen\n @type Boolean\n */\n isFrozen: false,\n\n /**\n Freezes the object. Once this method has been called the object should\n no longer allow any properties to be edited.\n\n @method freeze\n @return {Object} receiver\n */\n freeze: function() {\n if (get(this, 'isFrozen')) return this;\n set(this, 'isFrozen', true);\n return this;\n }\n\n});\n\nEmber.FROZEN_ERROR = \"Frozen object cannot be modified.\";\n\n})();\n//@ sourceURL=ember-runtime/mixins/freezable");minispade.register('ember-runtime/mixins/mutable_array', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\nminispade.require('ember-runtime/mixins/array');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\n\n// ..........................................................\n// CONSTANTS\n//\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\" ;\nvar EMPTY = [];\n\n// ..........................................................\n// HELPERS\n//\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n This mixin defines the API for modifying array-like objects. These methods\n can be applied only to a collection that keeps its items in an ordered set.\n\n Note that an Array can change even if it does not implement this mixin.\n For example, one might implement a SparseArray that cannot be directly\n modified, but if its underlying enumerable changes, it will change also.\n\n @class MutableArray\n @namespace Ember\n @uses Ember.Array\n @uses Ember.MutableEnumerable\n*/\nEmber.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,/** @scope Ember.MutableArray.prototype */ {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n This is one of the primitives you must implement to support `Ember.Array`.\n You should replace amt objects started at idx with the objects in the\n passed array. You should also call `this.enumerableContentDidChange()`\n\n @method replace\n @param {Number} idx Starting index in the array to replace. If\n idx >= length, then append to the end of the array.\n @param {Number} amt Number of elements that should be removed from\n the array, starting at *idx*.\n @param {Array} objects An array of zero or more objects that should be\n inserted into the array at *idx*\n */\n replace: Ember.required(),\n\n /**\n Remove all elements from self. This is useful if you\n want to reuse an existing array without having to recreate it.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n color.length(); // 3\n colors.clear(); // []\n colors.length(); // 0\n ```\n\n @method clear\n @return {Ember.Array} An empty Array.\n */\n clear: function () {\n var len = get(this, 'length');\n if (len === 0) return this;\n this.replace(0, len, EMPTY);\n return this;\n },\n\n /**\n This will use the primitive `replace()` method to insert an object at the\n specified index.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.insertAt(2, \"yellow\"); // [\"red\", \"green\", \"yellow\", \"blue\"]\n colors.insertAt(5, \"orange\"); // Error: Index out of range\n ```\n\n @method insertAt\n @param {Number} idx index of insert the object at.\n @param {Object} object object to insert\n @return this\n */\n insertAt: function(idx, object) {\n if (idx > get(this, 'length')) throw new Ember.Error(OUT_OF_RANGE_EXCEPTION) ;\n this.replace(idx, 0, [object]) ;\n return this ;\n },\n\n /**\n Remove an object at the specified index using the `replace()` primitive\n method. You can pass either a single index, or a start and a length.\n\n If you pass a start and length that is beyond the\n length this method will throw an `OUT_OF_RANGE_EXCEPTION`\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\", \"yellow\", \"orange\"];\n colors.removeAt(0); // [\"green\", \"blue\", \"yellow\", \"orange\"]\n colors.removeAt(2, 2); // [\"green\", \"blue\"]\n colors.removeAt(4, 2); // Error: Index out of range\n ```\n\n @method removeAt\n @param {Number} start index, start of range\n @param {Number} len length of passing range\n @return {Object} receiver\n */\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Ember.Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n // fast case\n if (len === undefined) len = 1;\n this.replace(start, len, EMPTY);\n }\n\n return this ;\n },\n\n /**\n Push the object onto the end of the array. Works just like `push()` but it\n is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObject(\"black\"); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObject([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", [\"yellow\", \"orange\"]]\n ```\n\n @method pushObject\n @param {*} obj object to push\n @return {*} the same obj passed as param\n */\n pushObject: function(obj) {\n this.insertAt(get(this, 'length'), obj) ;\n return obj ;\n },\n\n /**\n Add the objects in the passed numerable to the end of the array. Defers\n notifying observers of the change until all objects are added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.pushObjects([\"black\"]); // [\"red\", \"green\", \"blue\", \"black\"]\n colors.pushObjects([\"yellow\", \"orange\"]); // [\"red\", \"green\", \"blue\", \"black\", \"yellow\", \"orange\"]\n ```\n\n @method pushObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n pushObjects: function(objects) {\n if (!(Ember.Enumerable.detect(objects) || Ember.isArray(objects))) {\n throw new TypeError(\"Must pass Ember.Enumerable to Ember.MutableArray#pushObjects\");\n }\n this.replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n /**\n Pop object from array or nil if none are left. Works just like `pop()` but\n it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.popObject(); // \"blue\"\n console.log(colors); // [\"red\", \"green\"]\n ```\n\n @method popObject\n @return object\n */\n popObject: function() {\n var len = get(this, 'length') ;\n if (len === 0) return null ;\n\n var ret = this.objectAt(len-1) ;\n this.removeAt(len-1, 1) ;\n return ret ;\n },\n\n /**\n Shift an object from start of array or nil if none are left. Works just\n like `shift()` but it is KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.shiftObject(); // \"red\"\n console.log(colors); // [\"green\", \"blue\"]\n ```\n\n @method shiftObject\n @return object\n */\n shiftObject: function() {\n if (get(this, 'length') === 0) return null ;\n var ret = this.objectAt(0) ;\n this.removeAt(0) ;\n return ret ;\n },\n\n /**\n Unshift an object to start of array. Works just like `unshift()` but it is\n KVO-compliant.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObject(\"yellow\"); // [\"yellow\", \"red\", \"green\", \"blue\"]\n colors.unshiftObject([\"black\", \"white\"]); // [[\"black\", \"white\"], \"yellow\", \"red\", \"green\", \"blue\"]\n ```\n\n @method unshiftObject\n @param {*} obj object to unshift\n @return {*} the same obj passed as param\n */\n unshiftObject: function(obj) {\n this.insertAt(0, obj) ;\n return obj ;\n },\n\n /**\n Adds the named objects to the beginning of the array. Defers notifying\n observers until all objects have been added.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.unshiftObjects([\"black\", \"white\"]); // [\"black\", \"white\", \"red\", \"green\", \"blue\"]\n colors.unshiftObjects(\"yellow\"); // Type Error: 'undefined' is not a function\n ```\n\n @method unshiftObjects\n @param {Ember.Enumerable} objects the objects to add\n @return {Ember.Array} receiver\n */\n unshiftObjects: function(objects) {\n this.replace(0, 0, objects);\n return this;\n },\n\n /**\n Reverse objects in the array. Works just like `reverse()` but it is\n KVO-compliant.\n\n @method reverseObjects\n @return {Ember.Array} receiver\n */\n reverseObjects: function() {\n var len = get(this, 'length');\n if (len === 0) return this;\n var objects = this.toArray().reverse();\n this.replace(0, len, objects);\n return this;\n },\n\n /**\n Replace all the the receiver's content with content of the argument.\n If argument is an empty array receiver will be cleared.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"];\n colors.setObjects([\"black\", \"white\"]); // [\"black\", \"white\"]\n colors.setObjects([]); // []\n ```\n\n @method setObjects\n @param {Ember.Array} objects array whose content will be used for replacing\n the content of the receiver\n @return {Ember.Array} receiver with the new content\n */\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this.replace(0, len, objects);\n return this;\n },\n\n // ..........................................................\n // IMPLEMENT Ember.MutableEnumerable\n //\n\n removeObject: function(obj) {\n var loc = get(this, 'length') || 0;\n while(--loc >= 0) {\n var curObject = this.objectAt(loc) ;\n if (curObject === obj) this.removeAt(loc) ;\n }\n return this ;\n },\n\n addObject: function(obj) {\n if (!this.contains(obj)) this.pushObject(obj);\n return this ;\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_array");minispade.register('ember-runtime/mixins/mutable_enumerable', "(function() {minispade.require('ember-runtime/mixins/enumerable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar forEach = Ember.EnumerableUtils.forEach;\n\n/**\n This mixin defines the API for modifying generic enumerables. These methods\n can be applied to an object regardless of whether it is ordered or\n unordered.\n\n Note that an Enumerable can change even if it does not implement this mixin.\n For example, a MappedEnumerable cannot be directly modified but if its\n underlying enumerable changes, it will change also.\n\n ## Adding Objects\n\n To add an object to an enumerable, use the `addObject()` method. This\n method will only add the object to the enumerable if the object is not\n already present and is of a type supported by the enumerable.\n\n ```javascript\n set.addObject(contact);\n ```\n\n ## Removing Objects\n\n To remove an object from an enumerable, use the `removeObject()` method. This\n will only remove the object if it is present in the enumerable, otherwise\n this method has no effect.\n\n ```javascript\n set.removeObject(contact);\n ```\n\n ## Implementing In Your Own Code\n\n If you are implementing an object and want to support this API, just include\n this mixin in your class and implement the required methods. In your unit\n tests, be sure to apply the Ember.MutableEnumerableTests to your object.\n\n @class MutableEnumerable\n @namespace Ember\n @uses Ember.Enumerable\n*/\nEmber.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable, {\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to add the passed object to the receiver if the object is not\n already present in the collection. If the object is present, this method\n has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method addObject\n @param {Object} object The object to add to the enumerable.\n @return {Object} the passed object\n */\n addObject: Ember.required(Function),\n\n /**\n Adds each object in the passed enumerable to the receiver.\n\n @method addObjects\n @param {Ember.Enumerable} objects the objects to add.\n @return {Object} receiver\n */\n addObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.addObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n },\n\n /**\n __Required.__ You must implement this method to apply this mixin.\n\n Attempts to remove the passed object from the receiver collection if the\n object is present in the collection. If the object is not present,\n this method has no effect.\n\n If the passed object is of a type not supported by the receiver,\n then this method should raise an exception.\n\n @method removeObject\n @param {Object} object The object to remove from the enumerable.\n @return {Object} the passed object\n */\n removeObject: Ember.required(Function),\n\n\n /**\n Removes each object in the passed enumerable from the receiver.\n\n @method removeObjects\n @param {Ember.Enumerable} objects the objects to remove\n @return {Object} receiver\n */\n removeObjects: function(objects) {\n Ember.beginPropertyChanges(this);\n forEach(objects, function(obj) { this.removeObject(obj); }, this);\n Ember.endPropertyChanges(this);\n return this;\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/mutable_enumerable");minispade.register('ember-runtime/mixins/observable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get,\n set = Ember.set,\n slice = Array.prototype.slice,\n getProperties = Ember.getProperties;\n\n/**\n ## Overview\n\n This mixin provides properties and property observing functionality, core\n features of the Ember object model.\n\n Properties and observers allow one object to observe changes to a\n property on another object. This is one of the fundamental ways that\n models, controllers and views communicate with each other in an Ember\n application.\n\n Any object that has this mixin applied can be used in observer\n operations. That includes `Ember.Object` and most objects you will\n interact with as you write your Ember application.\n\n Note that you will not generally apply this mixin to classes yourself,\n but you will use the features provided by this module frequently, so it\n is important to understand how to use it.\n\n ## Using `get()` and `set()`\n\n Because of Ember's support for bindings and observers, you will always\n access properties using the get method, and set properties using the\n set method. This allows the observing objects to be notified and\n computed properties to be handled properly.\n\n More documentation about `get` and `set` are below.\n\n ## Observing Property Changes\n\n You typically observe property changes simply by adding the `observes`\n call to the end of your method declarations in classes that you write.\n For example:\n\n ```javascript\n Ember.Object.extend({\n valueObserver: function() {\n // Executes whenever the \"value\" property changes\n }.observes('value')\n });\n ```\n\n Although this is the most common way to add an observer, this capability\n is actually built into the `Ember.Object` class on top of two methods\n defined in this mixin: `addObserver` and `removeObserver`. You can use\n these two methods to add and remove observers yourself if you need to\n do so at runtime.\n\n To add an observer for a property, call:\n\n ```javascript\n object.addObserver('propertyKey', targetObject, targetAction)\n ```\n\n This will call the `targetAction` method on the `targetObject` whenever\n the value of the `propertyKey` changes.\n\n Note that if `propertyKey` is a computed property, the observer will be\n called when any of the property dependencies are changed, even if the\n resulting value of the computed property is unchanged. This is necessary\n because computed properties are not computed until `get` is called.\n\n @class Observable\n @namespace Ember\n*/\nEmber.Observable = Ember.Mixin.create({\n\n /**\n Retrieves the value of a property from the object.\n\n This method is usually similar to using `object[keyName]` or `object.keyName`,\n however it supports both computed properties and the unknownProperty\n handler.\n\n Because `get` unifies the syntax for accessing all these kinds\n of properties, it can make many refactorings easier, such as replacing a\n simple property with a computed property, or vice versa.\n\n ### Computed Properties\n\n Computed properties are methods defined with the `property` modifier\n declared at the end, such as:\n\n ```javascript\n fullName: function() {\n return this.get('firstName') + ' ' + this.get('lastName');\n }.property('firstName', 'lastName')\n ```\n\n When you call `get` on a computed property, the function will be\n called and the return value will be returned instead of the function\n itself.\n\n ### Unknown Properties\n\n Likewise, if you try to call `get` on a property whose value is\n `undefined`, the `unknownProperty()` method will be called on the object.\n If this method returns any value other than `undefined`, it will be returned\n instead. This allows you to implement \"virtual\" properties that are\n not defined upfront.\n\n @method get\n @param {String} keyName The property to retrieve\n @return {Object} The property value or undefined.\n */\n get: function(keyName) {\n return get(this, keyName);\n },\n\n /**\n To get multiple properties at once, call `getProperties`\n with a list of strings or an array:\n\n ```javascript\n record.getProperties('firstName', 'lastName', 'zipCode'); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n is equivalent to:\n\n ```javascript\n record.getProperties(['firstName', 'lastName', 'zipCode']); // { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n ```\n\n @method getProperties\n @param {String...|Array} list of keys to get\n @return {Hash}\n */\n getProperties: function() {\n return getProperties.apply(null, [this].concat(slice.call(arguments)));\n },\n\n /**\n Sets the provided key or path to the value.\n\n This method is generally very similar to calling `object[key] = value` or\n `object.key = value`, except that it provides support for computed\n properties, the `setUnknownProperty()` method and property observers.\n\n ### Computed Properties\n\n If you try to set a value on a key that has a computed property handler\n defined (see the `get()` method for an example), then `set()` will call\n that method, passing both the value and key instead of simply changing\n the value itself. This is useful for those times when you need to\n implement a property that is composed of one or more member\n properties.\n\n ### Unknown Properties\n\n If you try to set a value on a key that is undefined in the target\n object, then the `setUnknownProperty()` handler will be called instead. This\n gives you an opportunity to implement complex \"virtual\" properties that\n are not predefined on the object. If `setUnknownProperty()` returns\n undefined, then `set()` will simply set the value on the object.\n\n ### Property Observers\n\n In addition to changing the property, `set()` will also register a property\n change with the object. Unless you have placed this call inside of a\n `beginPropertyChanges()` and `endPropertyChanges(),` any \"local\" observers\n (i.e. observer methods declared on the same object), will be called\n immediately. Any \"remote\" observers (i.e. observer methods declared on\n another object) will be placed in a queue and called at a later time in a\n coalesced manner.\n\n ### Chaining\n\n In addition to property changes, `set()` returns the value of the object\n itself so you can do chaining like this:\n\n ```javascript\n record.set('firstName', 'Charles').set('lastName', 'Jolley');\n ```\n\n @method set\n @param {String} keyName The property to set\n @param {Object} value The value to set or `null`.\n @return {Ember.Observable}\n */\n set: function(keyName, value) {\n set(this, keyName, value);\n return this;\n },\n\n /**\n To set multiple properties at once, call `setProperties`\n with a Hash:\n\n ```javascript\n record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });\n ```\n\n @method setProperties\n @param {Hash} hash the hash of keys and values to set\n @return {Ember.Observable}\n */\n setProperties: function(hash) {\n return Ember.setProperties(this, hash);\n },\n\n /**\n Begins a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call this\n method at the beginning of the changes to begin deferring change\n notifications. When you are done making changes, call\n `endPropertyChanges()` to deliver the deferred change notifications and end\n deferring.\n\n @method beginPropertyChanges\n @return {Ember.Observable}\n */\n beginPropertyChanges: function() {\n Ember.beginPropertyChanges();\n return this;\n },\n\n /**\n Ends a grouping of property changes.\n\n You can use this method to group property changes so that notifications\n will not be sent until the changes are finished. If you plan to make a\n large number of changes to an object at one time, you should call\n `beginPropertyChanges()` at the beginning of the changes to defer change\n notifications. When you are done making changes, call this method to\n deliver the deferred change notifications and end deferring.\n\n @method endPropertyChanges\n @return {Ember.Observable}\n */\n endPropertyChanges: function() {\n Ember.endPropertyChanges();\n return this;\n },\n\n /**\n Notify the observer system that a property is about to change.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyDidChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyWillChange\n @param {String} keyName The property key that is about to change.\n @return {Ember.Observable}\n */\n propertyWillChange: function(keyName) {\n Ember.propertyWillChange(this, keyName);\n return this;\n },\n\n /**\n Notify the observer system that a property has just changed.\n\n Sometimes you need to change a value directly or indirectly without\n actually calling `get()` or `set()` on it. In this case, you can use this\n method and `propertyWillChange()` instead. Calling these two methods\n together will notify all observers that the property has potentially\n changed value.\n\n Note that you must always call `propertyWillChange` and `propertyDidChange`\n as a pair. If you do not, it may get the property change groups out of\n order and cause notifications to be delivered more often than you would\n like.\n\n @method propertyDidChange\n @param {String} keyName The property key that has just changed.\n @return {Ember.Observable}\n */\n propertyDidChange: function(keyName) {\n Ember.propertyDidChange(this, keyName);\n return this;\n },\n\n /**\n Convenience method to call `propertyWillChange` and `propertyDidChange` in\n succession.\n\n @method notifyPropertyChange\n @param {String} keyName The property key to be notified about.\n @return {Ember.Observable}\n */\n notifyPropertyChange: function(keyName) {\n this.propertyWillChange(keyName);\n this.propertyDidChange(keyName);\n return this;\n },\n\n addBeforeObserver: function(key, target, method) {\n Ember.addBeforeObserver(this, key, target, method);\n },\n\n /**\n Adds an observer on a property.\n\n This is the core method used to register an observer for a property.\n\n Once you call this method, any time the key's value is set, your observer\n will be notified. Note that the observers are triggered any time the\n value is set, regardless of whether it has actually changed. Your\n observer should be prepared to handle that.\n\n You can also pass an optional context parameter to this method. The\n context will be passed to your observer method whenever it is triggered.\n Note that if you add the same target/method pair on a key multiple times\n with different context parameters, your observer will only be called once\n with the last context you passed.\n\n ### Observer Methods\n\n Observer methods you pass should generally have the following signature if\n you do not pass a `context` parameter:\n\n ```javascript\n fooDidChange: function(sender, key, value, rev) { };\n ```\n\n The sender is the object that changed. The key is the property that\n changes. The value property is currently reserved and unused. The rev\n is the last property revision of the object when it changed, which you can\n use to detect if the key value has really changed or not.\n\n If you pass a `context` parameter, the context will be passed before the\n revision like so:\n\n ```javascript\n fooDidChange: function(sender, key, value, context, rev) { };\n ```\n\n Usually you will not need the value, context or revision parameters at\n the end. In this case, it is common to write observer methods that take\n only a sender and key value as parameters or, if you aren't interested in\n any of these values, to write an observer that has no parameters at all.\n\n @method addObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Object} self\n */\n addObserver: function(key, target, method) {\n Ember.addObserver(this, key, target, method);\n },\n\n /**\n Remove an observer you have previously registered on this object. Pass\n the same key, target, and method you passed to `addObserver()` and your\n target will no longer receive notifications.\n\n @method removeObserver\n @param {String} key The key to observer\n @param {Object} target The target object to invoke\n @param {String|Function} method The method to invoke.\n @return {Ember.Observable} receiver\n */\n removeObserver: function(key, target, method) {\n Ember.removeObserver(this, key, target, method);\n },\n\n /**\n Returns `true` if the object currently has observers registered for a\n particular key. You can use this method to potentially defer performing\n an expensive action until someone begins observing a particular property\n on the object.\n\n @method hasObserverFor\n @param {String} key Key to check\n @return {Boolean}\n */\n hasObserverFor: function(key) {\n return Ember.hasListeners(this, key+':change');\n },\n\n /**\n Retrieves the value of a property, or a default value in the case that the\n property returns `undefined`.\n\n ```javascript\n person.getWithDefault('lastName', 'Doe');\n ```\n\n @method getWithDefault\n @param {String} keyName The name of the property to retrieve\n @param {Object} defaultValue The value to return if the property value is undefined\n @return {Object} The property value or the defaultValue.\n */\n getWithDefault: function(keyName, defaultValue) {\n return Ember.getWithDefault(this, keyName, defaultValue);\n },\n\n /**\n Set the value of a property to the current value plus some amount.\n\n ```javascript\n person.incrementProperty('age');\n team.incrementProperty('score', 2);\n ```\n\n @method incrementProperty\n @param {String} keyName The name of the property to increment\n @param {Number} increment The amount to increment by. Defaults to 1\n @return {Number} The new property value\n */\n incrementProperty: function(keyName, increment) {\n if (Ember.isNone(increment)) { increment = 1; }\n Ember.assert(\"Must pass a numeric value to incrementProperty\", (!isNaN(parseFloat(increment)) && isFinite(increment)));\n set(this, keyName, (get(this, keyName) || 0) + increment);\n return get(this, keyName);\n },\n\n /**\n Set the value of a property to the current value minus some amount.\n\n ```javascript\n player.decrementProperty('lives');\n orc.decrementProperty('health', 5);\n ```\n\n @method decrementProperty\n @param {String} keyName The name of the property to decrement\n @param {Number} decrement The amount to decrement by. Defaults to 1\n @return {Number} The new property value\n */\n decrementProperty: function(keyName, decrement) {\n if (Ember.isNone(decrement)) { decrement = 1; }\n Ember.assert(\"Must pass a numeric value to decrementProperty\", (!isNaN(parseFloat(decrement)) && isFinite(decrement)));\n set(this, keyName, (get(this, keyName) || 0) - decrement);\n return get(this, keyName);\n },\n\n /**\n Set the value of a boolean property to the opposite of it's\n current value.\n\n ```javascript\n starship.toggleProperty('warpDriveEngaged');\n ```\n\n @method toggleProperty\n @param {String} keyName The name of the property to toggle\n @return {Object} The new property value\n */\n toggleProperty: function(keyName) {\n set(this, keyName, !get(this, keyName));\n return get(this, keyName);\n },\n\n /**\n Returns the cached value of a computed property, if it exists.\n This allows you to inspect the value of a computed property\n without accidentally invoking it if it is intended to be\n generated lazily.\n\n @method cacheFor\n @param {String} keyName\n @return {Object} The cached value of the computed property, if any\n */\n cacheFor: function(keyName) {\n return Ember.cacheFor(this, keyName);\n },\n\n // intended for debugging purposes\n observersForKey: function(keyName) {\n return Ember.observersFor(this, keyName);\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/observable");minispade.register('ember-runtime/mixins/promise_proxy', "(function() {var set = Ember.set, get = Ember.get,\n resolve = Ember.RSVP.resolve,\n rethrow = Ember.RSVP.rethrow,\n not = Ember.computed.not,\n or = Ember.computed.or;\n\n/**\n @module ember\n @submodule ember-runtime\n */\n\nfunction installPromise(proxy, promise) {\n promise.then(function(value) {\n set(proxy, 'isFulfilled', true);\n set(proxy, 'content', value);\n\n return value;\n }, function(reason) {\n set(proxy, 'isRejected', true);\n set(proxy, 'reason', reason);\n }).fail(rethrow);\n}\n\n/**\n A low level mixin making ObjectProxy, ObjectController or ArrayController's promise aware.\n\n ```javascript\n var ObjectPromiseController = Ember.ObjectController.extend(Ember.PromiseProxyMixin);\n\n var controller = ObjectPromiseController.create({\n promise: $.getJSON('/some/remote/data.json')\n });\n\n controller.then(function(json){\n // the json\n }, function(reason) {\n // the reason why you have no json\n });\n ```\n\n the controller has bindable attributes which\n track the promises life cycle\n\n ```javascript\n controller.get('isPending') //=> true\n controller.get('isSettled') //=> false\n controller.get('isRejected') //=> false\n controller.get('isFulfilled') //=> false\n ```\n\n When the the $.getJSON completes, and the promise is fulfilled\n with json, the life cycle attributes will update accordingly.\n\n ```javascript\n controller.get('isPending') //=> false\n controller.get('isSettled') //=> true\n controller.get('isRejected') //=> false\n controller.get('isFulfilled') //=> true\n ```\n\n As the controller is an ObjectController, and the json now its content,\n all the json properties will be available directly from the controller.\n\n ```javascript\n // Assuming the following json:\n {\n firstName: 'Stefan',\n lastName: 'Penner'\n }\n\n // both properties will accessible on the controller\n controller.get('firstName') //=> 'Stefan'\n controller.get('lastName') //=> 'Penner'\n ```\n\n If the controller is backing a template, the attributes are \n bindable from within that template\n\n ```handlebars\n {{#if isPending}}\n loading...\n {{else}}\n firstName: {{firstName}}\n lastName: {{lastName}}\n {{/if}}\n ```\n @class Ember.PromiseProxyMixin\n*/\nEmber.PromiseProxyMixin = Ember.Mixin.create({\n reason: null,\n isPending: not('isSettled').readOnly(),\n isSettled: or('isRejected', 'isFulfilled').readOnly(),\n isRejected: false,\n isFulfilled: false,\n\n promise: Ember.computed(function(key, promise) {\n if (arguments.length === 2) {\n promise = resolve(promise);\n installPromise(this, promise);\n return promise;\n } else {\n throw new Ember.Error(\"PromiseProxy's promise must be set\");\n }\n }),\n\n then: function(fulfill, reject) {\n return get(this, 'promise').then(fulfill, reject);\n }\n});\n\n\n})();\n//@ sourceURL=ember-runtime/mixins/promise_proxy");minispade.register('ember-runtime/mixins/sortable', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach;\n\n/**\n `Ember.SortableMixin` provides a standard interface for array proxies\n to specify a sort order and maintain this sorting when objects are added,\n removed, or updated without changing the implicit order of their underlying\n content array:\n\n ```javascript\n songs = [\n {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'},\n {trackNumber: 2, title: 'Back in the U.S.S.R.'},\n {trackNumber: 3, title: 'Glass Onion'},\n ];\n\n songsController = Ember.ArrayController.create({\n content: songs,\n sortProperties: ['trackNumber'],\n sortAscending: true\n });\n\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.addObject({trackNumber: 1, title: 'Dear Prudence'});\n songsController.get('firstObject'); // {trackNumber: 1, title: 'Dear Prudence'}\n ```\n\n If you add or remove the properties to sort by or change the sort direction the content\n sort order will be automatically updated.\n\n ```javascript\n songsController.set('sortProperties', ['title']);\n songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}\n\n songsController.toggleProperty('sortAscending');\n songsController.get('firstObject'); // {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'}\n ```\n\n SortableMixin works by sorting the arrangedContent array, which is the array that\n arrayProxy displays. Due to the fact that the underlying 'content' array is not changed, that\n array will not display the sorted list:\n\n ```javascript\n songsController.get('content').get('firstObject'); // Returns the unsorted original content\n songsController.get('firstObject'); // Returns the sorted content.\n ``` \n \n Although the sorted content can also be accessed through the arrangedContent property,\n it is preferable to use the proxied class and not the arrangedContent array directly.\n\n @class SortableMixin\n @namespace Ember\n @uses Ember.MutableEnumerable\n*/\nEmber.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable, {\n\n /**\n Specifies which properties dictate the arrangedContent's sort order.\n\n When specifying multiple properties the sorting will use properties\n from the `sortProperties` array prioritized from first to last.\n\n @property {Array} sortProperties\n */\n sortProperties: null,\n\n /**\n Specifies the arrangedContent's sort direction\n\n @property {Boolean} sortAscending\n */\n sortAscending: true,\n\n /**\n The function used to compare two values. You can override this if you\n want to do custom comparisons. Functions must be of the type expected by\n Array#sort, i.e.\n return 0 if the two parameters are equal,\n return a negative value if the first parameter is smaller than the second or\n return a positive value otherwise:\n\n ```javascript\n function(x,y) { // These are assumed to be integers\n if (x === y)\n return 0;\n return x < y ? -1 : 1;\n }\n ```\n\n @property sortFunction\n @type {Function}\n @default Ember.compare\n */\n sortFunction: Ember.compare,\n\n orderBy: function(item1, item2) {\n var result = 0,\n sortProperties = get(this, 'sortProperties'),\n sortAscending = get(this, 'sortAscending'),\n sortFunction = get(this, 'sortFunction');\n\n Ember.assert(\"you need to define `sortProperties`\", !!sortProperties);\n\n forEach(sortProperties, function(propertyName) {\n if (result === 0) {\n result = sortFunction(get(item1, propertyName), get(item2, propertyName));\n if ((result !== 0) && !sortAscending) {\n result = (-1) * result;\n }\n }\n });\n\n return result;\n },\n\n destroy: function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super();\n },\n\n isSorted: Ember.computed.bool('sortProperties'),\n\n /**\n Overrides the default arrangedContent from arrayProxy in order to sort by sortFunction.\n Also sets up observers for each sortProperty on each item in the content Array.\n \n @property arrangedContent\n */\n\n arrangedContent: Ember.computed('content', 'sortProperties.@each', function(key, value) {\n var content = get(this, 'content'),\n isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties'),\n self = this;\n\n if (content && isSorted) {\n content = content.slice();\n content.sort(function(item1, item2) {\n return self.orderBy(item1, item2);\n });\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n return Ember.A(content);\n }\n\n return content;\n }),\n\n _contentWillChange: Ember.beforeObserver('content', function() {\n var content = get(this, 'content'),\n sortProperties = get(this, 'sortProperties');\n\n if (content && sortProperties) {\n forEach(content, function(item) {\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n this._super();\n }),\n\n sortAscendingWillChange: Ember.beforeObserver('sortAscending', function() {\n this._lastSortAscending = get(this, 'sortAscending');\n }),\n\n sortAscendingDidChange: Ember.observer('sortAscending', function() {\n if (get(this, 'sortAscending') !== this._lastSortAscending) {\n var arrangedContent = get(this, 'arrangedContent');\n arrangedContent.reverseObjects();\n }\n }),\n\n contentArrayWillChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted');\n\n if (isSorted) {\n var arrangedContent = get(this, 'arrangedContent');\n var removedObjects = array.slice(idx, idx+removedCount);\n var sortProperties = get(this, 'sortProperties');\n\n forEach(removedObjects, function(item) {\n arrangedContent.removeObject(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n contentArrayDidChange: function(array, idx, removedCount, addedCount) {\n var isSorted = get(this, 'isSorted'),\n sortProperties = get(this, 'sortProperties');\n\n if (isSorted) {\n var addedObjects = array.slice(idx, idx+addedCount);\n\n forEach(addedObjects, function(item) {\n this.insertItemSorted(item);\n\n forEach(sortProperties, function(sortProperty) {\n Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');\n }, this);\n }, this);\n }\n\n return this._super(array, idx, removedCount, addedCount);\n },\n\n insertItemSorted: function(item) {\n var arrangedContent = get(this, 'arrangedContent');\n var length = get(arrangedContent, 'length');\n\n var idx = this._binarySearch(item, 0, length);\n arrangedContent.insertAt(idx, item);\n },\n\n contentItemSortPropertyDidChange: function(item) {\n var arrangedContent = get(this, 'arrangedContent'),\n oldIndex = arrangedContent.indexOf(item),\n leftItem = arrangedContent.objectAt(oldIndex - 1),\n rightItem = arrangedContent.objectAt(oldIndex + 1),\n leftResult = leftItem && this.orderBy(item, leftItem),\n rightResult = rightItem && this.orderBy(item, rightItem);\n\n if (leftResult < 0 || rightResult > 0) {\n arrangedContent.removeObject(item);\n this.insertItemSorted(item);\n }\n },\n\n _binarySearch: function(item, low, high) {\n var mid, midItem, res, arrangedContent;\n\n if (low === high) {\n return low;\n }\n\n arrangedContent = get(this, 'arrangedContent');\n\n mid = low + Math.floor((high - low) / 2);\n midItem = arrangedContent.objectAt(mid);\n\n res = this.orderBy(midItem, item);\n\n if (res < 0) {\n return this._binarySearch(item, mid+1, high);\n } else if (res > 0) {\n return this._binarySearch(item, low, mid);\n }\n\n return mid;\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/sortable");minispade.register('ember-runtime/mixins/target_action_support', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n`Ember.TargetActionSupport` is a mixin that can be included in a class\nto add a `triggerAction` method with semantics similar to the Handlebars\n`{{action}}` helper. In normal Ember usage, the `{{action}}` helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in View objects.\n\nSee also `Ember.ViewTargetActionSupport`, which has\nview-aware defaults for target and actionContext.\n\n@class TargetActionSupport\n@namespace Ember\n@extends Ember.Mixin\n*/\nEmber.TargetActionSupport = Ember.Mixin.create({\n target: null,\n action: null,\n actionContext: null,\n\n targetObject: Ember.computed(function() {\n var target = get(this, 'target');\n\n if (Ember.typeOf(target) === \"string\") {\n var value = get(this, target);\n if (value === undefined) { value = get(Ember.lookup, target); }\n return value;\n } else {\n return target;\n }\n }).property('target'),\n\n actionContextObject: Ember.computed(function() {\n var actionContext = get(this, 'actionContext');\n\n if (Ember.typeOf(actionContext) === \"string\") {\n var value = get(this, actionContext);\n if (value === undefined) { value = get(Ember.lookup, actionContext); }\n return value;\n } else {\n return actionContext;\n }\n }).property('actionContext'),\n\n /**\n Send an \"action\" with an \"actionContext\" to a \"target\". The action, actionContext\n and target will be retrieved from properties of the object. For example:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n action: 'save',\n actionContext: Ember.computed.alias('context'),\n click: function() {\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `target`, `action`, and `actionContext` can be provided as properties of\n an optional object argument to `triggerAction` as well.\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n click: function() {\n this.triggerAction({\n action: 'save',\n target: this.get('controller'),\n actionContext: this.get('context'),\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n });\n ```\n\n The `actionContext` defaults to the object you mixing `TargetActionSupport` into.\n But `target` and `action` must be specified either as properties or with the argument\n to `triggerAction`, or a combination:\n\n ```javascript\n App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n target: Ember.computed.alias('controller'),\n click: function() {\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with a reference to `this`,\n // to the current controller\n }\n });\n ```\n\n @method triggerAction\n @param opts {Hash} (optional, with the optional keys action, target and/or actionContext)\n @return {Boolean} true if the action was sent successfully and did not return false\n */\n triggerAction: function(opts) {\n opts = opts || {};\n var action = opts.action || get(this, 'action'),\n target = opts.target || get(this, 'targetObject'),\n actionContext = opts.actionContext;\n\n function args(options, actionName) {\n var ret = [];\n if (actionName) { ret.push(actionName); }\n\n return ret.concat(options);\n }\n\n if (typeof actionContext === 'undefined') {\n actionContext = get(this, 'actionContextObject') || this;\n }\n\n if (target && action) {\n var ret;\n\n if (target.send) {\n ret = target.send.apply(target, args(actionContext, action));\n } else {\n Ember.assert(\"The action '\" + action + \"' did not exist on \" + target, typeof target[action] === 'function');\n ret = target[action].apply(target, args(actionContext));\n }\n\n if (ret !== false) ret = true;\n\n return ret;\n } else {\n return false;\n }\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/mixins/target_action_support");minispade.register('ember-runtime/system', "(function() {minispade.require('ember-runtime/system/tracked_array');\nminispade.require('ember-runtime/system/subarray');\nminispade.require('ember-runtime/system/container');\nminispade.require('ember-runtime/system/application');\nminispade.require('ember-runtime/system/array_proxy');\nminispade.require('ember-runtime/system/object_proxy');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/system/each_proxy');\nminispade.require('ember-runtime/system/namespace');\nminispade.require('ember-runtime/system/native_array');\nminispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/system/set');\nminispade.require('ember-runtime/system/string');\nminispade.require('ember-runtime/system/deferred');\nminispade.require('ember-runtime/system/lazy_load');\n\n})();\n//@ sourceURL=ember-runtime/system");minispade.register('ember-runtime/system/application', "(function() {minispade.require('ember-runtime/system/namespace');\n\nEmber.Application = Ember.Namespace.extend();\n\n})();\n//@ sourceURL=ember-runtime/system/application");minispade.register('ember-runtime/system/array_proxy', "(function() {minispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar OUT_OF_RANGE_EXCEPTION = \"Index out of range\";\nvar EMPTY = [];\n\nvar get = Ember.get, set = Ember.set;\n\n/**\n An ArrayProxy wraps any other object that implements `Ember.Array` and/or\n `Ember.MutableArray,` forwarding all requests. This makes it very useful for\n a number of binding use cases or other cases where being able to swap\n out the underlying array is useful.\n\n A simple example of usage:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });\n\n ap.get('firstObject'); // 'dog'\n ap.set('content', ['amoeba', 'paramecium']);\n ap.get('firstObject'); // 'amoeba'\n ```\n\n This class can also be useful as a layer to transform the contents of\n an array, as they are accessed. This can be done by overriding\n `objectAtContent`:\n\n ```javascript\n var pets = ['dog', 'cat', 'fish'];\n var ap = Ember.ArrayProxy.create({\n content: Ember.A(pets),\n objectAtContent: function(idx) {\n return this.get('content').objectAt(idx).toUpperCase();\n }\n });\n\n ap.get('firstObject'); // . 'DOG'\n ```\n\n @class ArrayProxy\n @namespace Ember\n @extends Ember.Object\n @uses Ember.MutableArray\n*/\nEmber.ArrayProxy = Ember.Object.extend(Ember.MutableArray,/** @scope Ember.ArrayProxy.prototype */ {\n\n /**\n The content array. Must be an object that implements `Ember.Array` and/or\n `Ember.MutableArray.`\n\n @property content\n @type Ember.Array\n */\n content: null,\n\n /**\n The array that the proxy pretends to be. In the default `ArrayProxy`\n implementation, this and `content` are the same. Subclasses of `ArrayProxy`\n can override this property to provide things like sorting and filtering.\n\n @property arrangedContent\n */\n arrangedContent: Ember.computed.alias('content'),\n\n /**\n Should actually retrieve the object at the specified index from the\n content. You can override this method in subclasses to transform the\n content item to something new.\n\n This method will only be called if content is non-`null`.\n\n @method objectAtContent\n @param {Number} idx The index to retrieve.\n @return {Object} the value or undefined if none found\n */\n objectAtContent: function(idx) {\n return get(this, 'arrangedContent').objectAt(idx);\n },\n\n /**\n Should actually replace the specified objects on the content array.\n You can override this method in subclasses to transform the content item\n into something new.\n\n This method will only be called if content is non-`null`.\n\n @method replaceContent\n @param {Number} idx The starting index\n @param {Number} amt The number of items to remove from the content.\n @param {Array} objects Optional array of objects to insert or null if no\n objects.\n @return {void}\n */\n replaceContent: function(idx, amt, objects) {\n get(this, 'content').replace(idx, amt, objects);\n },\n\n /**\n @private\n\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @method _contentWillChange\n */\n _contentWillChange: Ember.beforeObserver('content', function() {\n this._teardownContent();\n }),\n\n _teardownContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.removeArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n contentArrayWillChange: Ember.K,\n contentArrayDidChange: Ember.K,\n\n /**\n @private\n\n Invoked when the content property changes. Notifies observers that the\n entire array content has changed.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer('content', function() {\n var content = get(this, 'content');\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", content !== this);\n\n this._setupContent();\n }),\n\n _setupContent: function() {\n var content = get(this, 'content');\n\n if (content) {\n content.addArrayObserver(this, {\n willChange: 'contentArrayWillChange',\n didChange: 'contentArrayDidChange'\n });\n }\n },\n\n _arrangedContentWillChange: Ember.beforeObserver('arrangedContent', function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n this.arrangedContentArrayWillChange(this, 0, len, undefined);\n this.arrangedContentWillChange(this);\n\n this._teardownArrangedContent(arrangedContent);\n }),\n\n _arrangedContentDidChange: Ember.observer('arrangedContent', function() {\n var arrangedContent = get(this, 'arrangedContent'),\n len = arrangedContent ? get(arrangedContent, 'length') : 0;\n\n Ember.assert(\"Can't set ArrayProxy's content to itself\", arrangedContent !== this);\n\n this._setupArrangedContent();\n\n this.arrangedContentDidChange(this);\n this.arrangedContentArrayDidChange(this, 0, undefined, len);\n }),\n\n _setupArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.addArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n _teardownArrangedContent: function() {\n var arrangedContent = get(this, 'arrangedContent');\n\n if (arrangedContent) {\n arrangedContent.removeArrayObserver(this, {\n willChange: 'arrangedContentArrayWillChange',\n didChange: 'arrangedContentArrayDidChange'\n });\n }\n },\n\n arrangedContentWillChange: Ember.K,\n arrangedContentDidChange: Ember.K,\n\n objectAt: function(idx) {\n return get(this, 'content') && this.objectAtContent(idx);\n },\n\n length: Ember.computed(function() {\n var arrangedContent = get(this, 'arrangedContent');\n return arrangedContent ? get(arrangedContent, 'length') : 0;\n // No dependencies since Enumerable notifies length of change\n }),\n\n _replace: function(idx, amt, objects) {\n var content = get(this, 'content');\n Ember.assert('The content property of '+ this.constructor + ' should be set before modifying it', content);\n if (content) this.replaceContent(idx, amt, objects);\n return this;\n },\n\n replace: function() {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n this._replace.apply(this, arguments);\n } else {\n throw new Ember.Error(\"Using replace on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n _insertAt: function(idx, object) {\n if (idx > get(this, 'content.length')) throw new Ember.Error(OUT_OF_RANGE_EXCEPTION);\n this._replace(idx, 0, [object]);\n return this;\n },\n\n insertAt: function(idx, object) {\n if (get(this, 'arrangedContent') === get(this, 'content')) {\n return this._insertAt(idx, object);\n } else {\n throw new Ember.Error(\"Using insertAt on an arranged ArrayProxy is not allowed.\");\n }\n },\n\n removeAt: function(start, len) {\n if ('number' === typeof start) {\n var content = get(this, 'content'),\n arrangedContent = get(this, 'arrangedContent'),\n indices = [], i;\n\n if ((start < 0) || (start >= get(this, 'length'))) {\n throw new Ember.Error(OUT_OF_RANGE_EXCEPTION);\n }\n\n if (len === undefined) len = 1;\n\n // Get a list of indices in original content to remove\n for (i=start; i<start+len; i++) {\n // Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent\n indices.push(content.indexOf(arrangedContent.objectAt(i)));\n }\n\n // Replace in reverse order since indices will change\n indices.sort(function(a,b) { return b - a; });\n\n Ember.beginPropertyChanges();\n for (i=0; i<indices.length; i++) {\n this._replace(indices[i], 1, EMPTY);\n }\n Ember.endPropertyChanges();\n }\n\n return this ;\n },\n\n pushObject: function(obj) {\n this._insertAt(get(this, 'content.length'), obj) ;\n return obj ;\n },\n\n pushObjects: function(objects) {\n if (!(Ember.Enumerable.detect(objects) || Ember.isArray(objects))) {\n throw new TypeError(\"Must pass Ember.Enumerable to Ember.MutableArray#pushObjects\");\n }\n this._replace(get(this, 'length'), 0, objects);\n return this;\n },\n\n setObjects: function(objects) {\n if (objects.length === 0) return this.clear();\n\n var len = get(this, 'length');\n this._replace(0, len, objects);\n return this;\n },\n\n unshiftObject: function(obj) {\n this._insertAt(0, obj) ;\n return obj ;\n },\n\n unshiftObjects: function(objects) {\n this._replace(0, 0, objects);\n return this;\n },\n\n slice: function() {\n var arr = this.toArray();\n return arr.slice.apply(arr, arguments);\n },\n\n arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentWillChange(idx, removedCnt, addedCnt);\n },\n\n arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {\n this.arrayContentDidChange(idx, removedCnt, addedCnt);\n },\n\n init: function() {\n this._super();\n this._setupContent();\n this._setupArrangedContent();\n },\n\n willDestroy: function() {\n this._teardownArrangedContent();\n this._teardownContent();\n }\n});\n\n})();\n//@ sourceURL=ember-runtime/system/array_proxy");minispade.register('ember-runtime/system/container', "(function() {Ember.Container = requireModule('container');\nEmber.Container.set = Ember.set;\n\n})();\n//@ sourceURL=ember-runtime/system/container");minispade.register('ember-runtime/system/core_object', "(function() {minispade.require('ember-runtime/system/namespace');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\n// NOTE: this object should never be included directly. Instead use `Ember.Object`.\n// We only define this separately so that `Ember.Set` can depend on it.\n\n\nvar set = Ember.set, get = Ember.get,\n o_create = Ember.create,\n o_defineProperty = Ember.platform.defineProperty,\n GUID_KEY = Ember.GUID_KEY,\n guidFor = Ember.guidFor,\n generateGuid = Ember.generateGuid,\n meta = Ember.meta,\n rewatch = Ember.rewatch,\n finishChains = Ember.finishChains,\n sendEvent = Ember.sendEvent,\n destroy = Ember.destroy,\n schedule = Ember.run.schedule,\n Mixin = Ember.Mixin,\n applyMixin = Mixin._apply,\n finishPartial = Mixin.finishPartial,\n reopen = Mixin.prototype.reopen,\n MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,\n indexOf = Ember.EnumerableUtils.indexOf;\n\nvar undefinedDescriptor = {\n configurable: true,\n writable: true,\n enumerable: false,\n value: undefined\n};\n\nfunction makeCtor() {\n\n // Note: avoid accessing any properties on the object since it makes the\n // method a lot faster. This is glue code so we want it to be as fast as\n // possible.\n\n var wasApplied = false, initMixins, initProperties;\n\n var Class = function() {\n if (!wasApplied) {\n Class.proto(); // prepare prototype...\n }\n o_defineProperty(this, GUID_KEY, undefinedDescriptor);\n o_defineProperty(this, '_super', undefinedDescriptor);\n var m = meta(this), proto = m.proto;\n m.proto = this;\n if (initMixins) {\n // capture locally so we can clear the closed over variable\n var mixins = initMixins;\n initMixins = null;\n this.reopen.apply(this, mixins);\n }\n if (initProperties) {\n // capture locally so we can clear the closed over variable\n var props = initProperties;\n initProperties = null;\n\n var concatenatedProperties = this.concatenatedProperties;\n\n for (var i = 0, l = props.length; i < l; i++) {\n var properties = props[i];\n\n Ember.assert(\"Ember.Object.create no longer supports mixing in other definitions, use createWithMixins instead.\", !(properties instanceof Ember.Mixin));\n\n if (properties === null || typeof properties !== 'object') {\n Ember.assert(\"Ember.Object.create only accepts objects.\");\n continue;\n }\n\n var keyNames = Ember.keys(properties);\n for (var j = 0, ll = keyNames.length; j < ll; j++) {\n var keyName = keyNames[j];\n if (!properties.hasOwnProperty(keyName)) { continue; }\n\n var value = properties[keyName],\n IS_BINDING = Ember.IS_BINDING;\n\n if (IS_BINDING.test(keyName)) {\n var bindings = m.bindings;\n if (!bindings) {\n bindings = m.bindings = {};\n } else if (!m.hasOwnProperty('bindings')) {\n bindings = m.bindings = o_create(m.bindings);\n }\n bindings[keyName] = value;\n }\n\n var desc = m.descs[keyName];\n\n Ember.assert(\"Ember.Object.create no longer supports defining computed properties.\", !(value instanceof Ember.ComputedProperty));\n Ember.assert(\"Ember.Object.create no longer supports defining methods that call _super.\", !(typeof value === 'function' && value.toString().indexOf('._super') !== -1));\n Ember.assert(\"`actions` must be provided at extend time, not at create time, when Ember.ActionHandler is used (i.e. views, controllers & routes).\", !((keyName === 'actions') && Ember.ActionHandler.detect(this)));\n\n if (concatenatedProperties && indexOf(concatenatedProperties, keyName) >= 0) {\n var baseValue = this[keyName];\n\n if (baseValue) {\n if ('function' === typeof baseValue.concat) {\n value = baseValue.concat(value);\n } else {\n value = Ember.makeArray(baseValue).concat(value);\n }\n } else {\n value = Ember.makeArray(value);\n }\n }\n\n if (desc) {\n desc.set(this, keyName, value);\n } else {\n if (typeof this.setUnknownProperty === 'function' && !(keyName in this)) {\n this.setUnknownProperty(keyName, value);\n } else if (MANDATORY_SETTER) {\n Ember.defineProperty(this, keyName, null, value); // setup mandatory setter\n } else {\n this[keyName] = value;\n }\n }\n }\n }\n }\n finishPartial(this, m);\n this.init.apply(this, arguments);\n m.proto = proto;\n finishChains(this);\n sendEvent(this, \"init\");\n };\n\n Class.toString = Mixin.prototype.toString;\n Class.willReopen = function() {\n if (wasApplied) {\n Class.PrototypeMixin = Mixin.create(Class.PrototypeMixin);\n }\n\n wasApplied = false;\n };\n Class._initMixins = function(args) { initMixins = args; };\n Class._initProperties = function(args) { initProperties = args; };\n\n Class.proto = function() {\n var superclass = Class.superclass;\n if (superclass) { superclass.proto(); }\n\n if (!wasApplied) {\n wasApplied = true;\n Class.PrototypeMixin.applyPartial(Class.prototype);\n rewatch(Class.prototype);\n }\n\n return this.prototype;\n };\n\n return Class;\n\n}\n\n/**\n @class CoreObject\n @namespace Ember\n*/\nvar CoreObject = makeCtor();\nCoreObject.toString = function() { return \"Ember.CoreObject\"; };\n\nCoreObject.PrototypeMixin = Mixin.create({\n reopen: function() {\n applyMixin(this, arguments, true);\n return this;\n },\n\n /**\n An overridable method called when objects are instantiated. By default,\n does nothing unless it is overridden during class definition.\n\n Example:\n\n ```javascript\n App.Person = Ember.Object.extend({\n init: function() {\n alert('Name is ' + this.get('name'));\n }\n });\n\n var steve = App.Person.create({\n name: \"Steve\"\n });\n\n // alerts 'Name is Steve'.\n ```\n\n NOTE: If you do override `init` for a framework class like `Ember.View` or\n `Ember.ArrayController`, be sure to call `this._super()` in your\n `init` declaration! If you don't, Ember may not have an opportunity to\n do important setup work, and you'll see strange behavior in your\n application.\n\n @method init\n */\n init: function() {},\n\n /**\n Defines the properties that will be concatenated from the superclass\n (instead of overridden).\n\n By default, when you extend an Ember class a property defined in\n the subclass overrides a property with the same name that is defined\n in the superclass. However, there are some cases where it is preferable\n to build up a property's value by combining the superclass' property\n value with the subclass' value. An example of this in use within Ember\n is the `classNames` property of `Ember.View`.\n\n Here is some sample code showing the difference between a concatenated\n property and a normal one:\n\n ```javascript\n App.BarView = Ember.View.extend({\n someNonConcatenatedProperty: ['bar'],\n classNames: ['bar']\n });\n\n App.FooBarView = App.BarView.extend({\n someNonConcatenatedProperty: ['foo'],\n classNames: ['foo'],\n });\n\n var fooBarView = App.FooBarView.create();\n fooBarView.get('someNonConcatenatedProperty'); // ['foo']\n fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']\n ```\n\n This behavior extends to object creation as well. Continuing the\n above example:\n\n ```javascript\n var view = App.FooBarView.create({\n someNonConcatenatedProperty: ['baz'],\n classNames: ['baz']\n })\n view.get('someNonConcatenatedProperty'); // ['baz']\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n Adding a single property that is not an array will just add it in the array:\n\n ```javascript\n var view = App.FooBarView.create({\n classNames: 'baz'\n })\n view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']\n ```\n\n Using the `concatenatedProperties` property, we can tell to Ember that mix\n the content of the properties.\n\n In `Ember.View` the `classNameBindings` and `attributeBindings` properties\n are also concatenated, in addition to `classNames`.\n\n This feature is available for you to use throughout the Ember object model,\n although typical app developers are likely to use it infrequently. Since\n it changes expectations about behavior of properties, you should properly\n document its usage in each individual concatenated property (to not\n mislead your users to think they can override the property in a subclass).\n\n @property concatenatedProperties\n @type Array\n @default null\n */\n concatenatedProperties: null,\n\n /**\n Destroyed object property flag.\n\n if this property is `true` the observers and bindings were already\n removed by the effect of calling the `destroy()` method.\n\n @property isDestroyed\n @default false\n */\n isDestroyed: false,\n\n /**\n Destruction scheduled flag. The `destroy()` method has been called.\n\n The object stays intact until the end of the run loop at which point\n the `isDestroyed` flag is set.\n\n @property isDestroying\n @default false\n */\n isDestroying: false,\n\n /**\n Destroys an object by setting the `isDestroyed` flag and removing its\n metadata, which effectively destroys observers and bindings.\n\n If you try to set a property on a destroyed object, an exception will be\n raised.\n\n Note that destruction is scheduled for the end of the run loop and does not\n happen immediately. It will set an isDestroying flag immediately.\n\n @method destroy\n @return {Ember.Object} receiver\n */\n destroy: function() {\n if (this.isDestroying) { return; }\n this.isDestroying = true;\n\n schedule('actions', this, this.willDestroy);\n schedule('destroy', this, this._scheduledDestroy);\n return this;\n },\n\n /**\n Override to implement teardown.\n\n @method willDestroy\n */\n willDestroy: Ember.K,\n\n /**\n @private\n\n Invoked by the run loop to actually destroy the object. This is\n scheduled for execution by the `destroy` method.\n\n @method _scheduledDestroy\n */\n _scheduledDestroy: function() {\n if (this.isDestroyed) { return; }\n destroy(this);\n this.isDestroyed = true;\n },\n\n bind: function(to, from) {\n if (!(from instanceof Ember.Binding)) { from = Ember.Binding.from(from); }\n from.to(to).connect(this);\n return from;\n },\n\n /**\n Returns a string representation which attempts to provide more information\n than Javascript's `toString` typically does, in a generic way for all Ember\n objects.\n\n App.Person = Em.Object.extend()\n person = App.Person.create()\n person.toString() //=> \"<App.Person:ember1024>\"\n\n If the object's class is not defined on an Ember namespace, it will\n indicate it is a subclass of the registered superclass:\n\n Student = App.Person.extend()\n student = Student.create()\n student.toString() //=> \"<(subclass of App.Person):ember1025>\"\n\n If the method `toStringExtension` is defined, its return value will be\n included in the output.\n\n App.Teacher = App.Person.extend({\n toStringExtension: function() {\n return this.get('fullName');\n }\n });\n teacher = App.Teacher.create()\n teacher.toString(); //=> \"<App.Teacher:ember1026:Tom Dale>\"\n\n @method toString\n @return {String} string representation\n */\n toString: function toString() {\n var hasToStringExtension = typeof this.toStringExtension === 'function',\n extension = hasToStringExtension ? \":\" + this.toStringExtension() : '';\n var ret = '<'+this.constructor.toString()+':'+guidFor(this)+extension+'>';\n this.toString = makeToString(ret);\n return ret;\n }\n});\n\nCoreObject.PrototypeMixin.ownerConstructor = CoreObject;\n\nfunction makeToString(ret) {\n return function() { return ret; };\n}\n\nif (Ember.config.overridePrototypeMixin) {\n Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);\n}\n\nCoreObject.__super__ = null;\n\nvar ClassMixin = Mixin.create({\n\n ClassMixin: Ember.required(),\n\n PrototypeMixin: Ember.required(),\n\n isClass: true,\n\n isMethod: false,\n\n /**\n Creates a new subclass.\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n alert(thing);\n }\n });\n ```\n\n This defines a new subclass of Ember.Object: `App.Person`. It contains one method: `say()`.\n\n You can also create a subclass from any existing class by calling its `extend()` method. For example, you might want to create a subclass of Ember's built-in `Ember.View` class:\n\n ```javascript\n App.PersonView = Ember.View.extend({\n tagName: 'li',\n classNameBindings: ['isAdministrator']\n });\n ```\n\n When defining a subclass, you can override methods but still access the implementation of your parent class by calling the special `_super()` method:\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n var name = this.get('name');\n alert(name + ' says: ' + thing);\n }\n });\n\n App.Soldier = App.Person.extend({\n say: function(thing) {\n this._super(thing + \", sir!\");\n },\n march: function(numberOfHours) {\n alert(this.get('name') + ' marches for ' + numberOfHours + ' hours.')\n }\n });\n\n var yehuda = App.Soldier.create({\n name: \"Yehuda Katz\"\n });\n\n yehuda.say(\"Yes\"); // alerts \"Yehuda Katz says: Yes, sir!\"\n ```\n\n The `create()` on line #17 creates an *instance* of the `App.Soldier` class. The `extend()` on line #8 creates a *subclass* of `App.Person`. Any instance of the `App.Person` class will *not* have the `march()` method.\n\n You can also pass `Ember.Mixin` classes to add additional properties to the subclass.\n\n ```javascript\n App.Person = Ember.Object.extend({\n say: function(thing) {\n alert(this.get('name') + ' says: ' + thing);\n }\n });\n\n App.SingingMixin = Ember.Mixin.create({\n sing: function(thing){\n alert(this.get('name') + ' sings: la la la ' + thing);\n }\n });\n\n App.BroadwayStar = App.Person.extend(App.SingingMixin, {\n dance: function() {\n alert(this.get('name') + ' dances: tap tap tap tap ');\n }\n });\n ```\n\n The `App.BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`.\n\n @method extend\n @static\n\n @param {Ember.Mixin} [mixins]* One or more Ember.Mixin classes\n @param {Object} [arguments]* Object containing values to use within the new class\n */\n extend: function() {\n var Class = makeCtor(), proto;\n Class.ClassMixin = Mixin.create(this.ClassMixin);\n Class.PrototypeMixin = Mixin.create(this.PrototypeMixin);\n\n Class.ClassMixin.ownerConstructor = Class;\n Class.PrototypeMixin.ownerConstructor = Class;\n\n reopen.apply(Class.PrototypeMixin, arguments);\n\n Class.superclass = this;\n Class.__super__ = this.prototype;\n\n proto = Class.prototype = o_create(this.prototype);\n proto.constructor = Class;\n generateGuid(proto);\n meta(proto).proto = proto; // this will disable observers on prototype\n\n Class.ClassMixin.apply(Class);\n return Class;\n },\n\n /**\n Equivalent to doing `extend(arguments).create()`.\n If possible use the normal `create` method instead.\n\n @method createWithMixins\n @static\n @param [arguments]*\n */\n createWithMixins: function() {\n var C = this;\n if (arguments.length>0) { this._initMixins(arguments); }\n return new C();\n },\n\n /**\n Creates an instance of a class. Accepts either no arguments, or an object\n containing values to initialize the newly instantiated object with.\n\n ```javascript\n App.Person = Ember.Object.extend({\n helloWorld: function() {\n alert(\"Hi, my name is \" + this.get('name'));\n }\n });\n\n var tom = App.Person.create({\n name: 'Tom Dale'\n });\n\n tom.helloWorld(); // alerts \"Hi, my name is Tom Dale\".\n ```\n\n `create` will call the `init` function if defined during\n `Ember.AnyObject.extend`\n\n If no arguments are passed to `create`, it will not set values to the new\n instance during initialization:\n\n ```javascript\n var noName = App.Person.create();\n noName.helloWorld(); // alerts undefined\n ```\n\n NOTE: For performance reasons, you cannot declare methods or computed\n properties during `create`. You should instead declare methods and computed\n properties when using `extend` or use the `createWithMixins` shorthand.\n\n @method create\n @static\n @param [arguments]*\n */\n create: function() {\n var C = this;\n if (arguments.length>0) { this._initProperties(arguments); }\n return new C();\n },\n\n /**\n\n Augments a constructor's prototype with additional\n properties and functions:\n\n ```javascript\n MyObject = Ember.Object.extend({\n name: 'an object'\n });\n\n o = MyObject.create();\n o.get('name'); // 'an object'\n\n MyObject.reopen({\n say: function(msg){\n console.log(msg);\n }\n })\n\n o2 = MyObject.create();\n o2.say(\"hello\"); // logs \"hello\"\n\n o.say(\"goodbye\"); // logs \"goodbye\"\n ```\n\n To add functions and properties to the constructor itself,\n see `reopenClass`\n\n @method reopen\n */\n reopen: function() {\n this.willReopen();\n reopen.apply(this.PrototypeMixin, arguments);\n return this;\n },\n\n /**\n Augments a constructor's own properties and functions:\n\n ```javascript\n MyObject = Ember.Object.extend({\n name: 'an object'\n });\n\n\n MyObject.reopenClass({\n canBuild: false\n });\n\n MyObject.canBuild; // false\n o = MyObject.create();\n ```\n\n In other words, this creates static properties and functions for the class. These are only available on the class\n and not on any instance of that class.\n\n ```javascript\n App.Person = Ember.Object.extend({\n name : \"\",\n sayHello : function(){\n alert(\"Hello. My name is \" + this.get('name'));\n }\n });\n\n App.Person.reopenClass({\n species : \"Homo sapiens\",\n createPerson: function(newPersonsName){\n return App.Person.create({\n name:newPersonsName\n });\n }\n });\n\n var tom = App.Person.create({\n name : \"Tom Dale\"\n });\n var yehuda = App.Person.createPerson(\"Yehuda Katz\");\n\n tom.sayHello(); // \"Hello. My name is Tom Dale\"\n yehuda.sayHello(); // \"Hello. My name is Yehuda Katz\"\n alert(App.Person.species); // \"Homo sapiens\"\n ```\n\n Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda`\n variables. They are only valid on `App.Person`.\n\n To add functions and properties to instances of\n a constructor by extending the constructor's prototype\n see `reopen`\n\n @method reopenClass\n */\n reopenClass: function() {\n reopen.apply(this.ClassMixin, arguments);\n applyMixin(this, arguments, false);\n return this;\n },\n\n detect: function(obj) {\n if ('function' !== typeof obj) { return false; }\n while(obj) {\n if (obj===this) { return true; }\n obj = obj.superclass;\n }\n return false;\n },\n\n detectInstance: function(obj) {\n return obj instanceof this;\n },\n\n /**\n In some cases, you may want to annotate computed properties with additional\n metadata about how they function or what values they operate on. For\n example, computed property functions may close over variables that are then\n no longer available for introspection.\n\n You can pass a hash of these values to a computed property like this:\n\n ```javascript\n person: function() {\n var personId = this.get('personId');\n return App.Person.create({ id: personId });\n }.property().meta({ type: App.Person })\n ```\n\n Once you've done this, you can retrieve the values saved to the computed\n property from your class like this:\n\n ```javascript\n MyClass.metaForProperty('person');\n ```\n\n This will return the original hash that was passed to `meta()`.\n\n @method metaForProperty\n @param key {String} property name\n */\n metaForProperty: function(key) {\n var desc = meta(this.proto(), false).descs[key];\n\n Ember.assert(\"metaForProperty() could not find a computed property with key '\"+key+\"'.\", !!desc && desc instanceof Ember.ComputedProperty);\n return desc._meta || {};\n },\n\n /**\n Iterate over each computed property for the class, passing its name\n and any associated metadata (see `metaForProperty`) to the callback.\n\n @method eachComputedProperty\n @param {Function} callback\n @param {Object} binding\n */\n eachComputedProperty: function(callback, binding) {\n var proto = this.proto(),\n descs = meta(proto).descs,\n empty = {},\n property;\n\n for (var name in descs) {\n property = descs[name];\n\n if (property instanceof Ember.ComputedProperty) {\n callback.call(binding || this, name, property._meta || empty);\n }\n }\n }\n\n});\n\nClassMixin.ownerConstructor = CoreObject;\n\nif (Ember.config.overrideClassMixin) {\n Ember.config.overrideClassMixin(ClassMixin);\n}\n\nCoreObject.ClassMixin = ClassMixin;\nClassMixin.apply(CoreObject);\n\nEmber.CoreObject = CoreObject;\n\n})();\n//@ sourceURL=ember-runtime/system/core_object");minispade.register('ember-runtime/system/deferred', "(function() {minispade.require(\"ember-runtime/mixins/deferred\");\nminispade.require(\"ember-runtime/system/object\");\n\nvar DeferredMixin = Ember.DeferredMixin, // mixins/deferred\n get = Ember.get;\n\nvar Deferred = Ember.Object.extend(DeferredMixin);\n\nDeferred.reopenClass({\n promise: function(callback, binding) {\n var deferred = Deferred.create();\n callback.call(binding, deferred);\n return deferred;\n }\n});\n\nEmber.Deferred = Deferred;\n\n})();\n//@ sourceURL=ember-runtime/system/deferred");minispade.register('ember-runtime/system/each_proxy', "(function() {minispade.require('ember-runtime/system/object');\nminispade.require('ember-runtime/mixins/array');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar set = Ember.set, get = Ember.get, guidFor = Ember.guidFor;\nvar forEach = Ember.EnumerableUtils.forEach,\n indexOf = Ember.ArrayPolyfills.indexOf;\n\nvar EachArray = Ember.Object.extend(Ember.Array, {\n\n init: function(content, keyName, owner) {\n this._super();\n this._keyName = keyName;\n this._owner = owner;\n this._content = content;\n },\n\n objectAt: function(idx) {\n var item = this._content.objectAt(idx);\n return item && get(item, this._keyName);\n },\n\n length: Ember.computed(function() {\n var content = this._content;\n return content ? get(content, 'length') : 0;\n })\n\n});\n\nvar IS_OBSERVER = /^.+:(before|change)$/;\n\nfunction addObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects, guid;\n if (!objects) objects = proxy._objects = {};\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.assert('When using @each to observe the array ' + content + ', the array must return an object', Ember.typeOf(item) === 'instance' || Ember.typeOf(item) === 'object');\n Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n // keep track of the index each item was found at so we can map\n // it back when the obj changes.\n guid = guidFor(item);\n if (!objects[guid]) objects[guid] = [];\n objects[guid].push(loc);\n }\n }\n}\n\nfunction removeObserverForContentKey(content, keyName, proxy, idx, loc) {\n var objects = proxy._objects;\n if (!objects) objects = proxy._objects = {};\n var indicies, guid;\n\n while(--loc>=idx) {\n var item = content.objectAt(loc);\n if (item) {\n Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');\n Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');\n\n guid = guidFor(item);\n indicies = objects[guid];\n indicies[indexOf.call(indicies, loc)] = null;\n }\n }\n}\n\n/**\n This is the object instance returned when you get the `@each` property on an\n array. It uses the unknownProperty handler to automatically create\n EachArray instances for property names.\n\n @private\n @class EachProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.EachProxy = Ember.Object.extend({\n\n init: function(content) {\n this._super();\n this._content = content;\n content.addArrayObserver(this);\n\n // in case someone is already observing some keys make sure they are\n // added\n forEach(Ember.watchedEvents(this), function(eventName) {\n this.didAddListener(eventName);\n }, this);\n },\n\n /**\n You can directly access mapped properties by simply requesting them.\n The `unknownProperty` handler will generate an EachArray of each item.\n\n @method unknownProperty\n @param keyName {String}\n @param value {*}\n */\n unknownProperty: function(keyName, value) {\n var ret;\n ret = new EachArray(this._content, keyName, this);\n Ember.defineProperty(this, keyName, null, ret);\n this.beginObservingContentKey(keyName);\n return ret;\n },\n\n // ..........................................................\n // ARRAY CHANGES\n // Invokes whenever the content array itself changes.\n\n arrayWillChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, key, lim;\n\n lim = removedCnt>0 ? idx+removedCnt : -1;\n Ember.beginPropertyChanges(this);\n\n for(key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) { removeObserverForContentKey(content, key, this, idx, lim); }\n\n Ember.propertyWillChange(this, key);\n }\n\n Ember.propertyWillChange(this._content, '@each');\n Ember.endPropertyChanges(this);\n },\n\n arrayDidChange: function(content, idx, removedCnt, addedCnt) {\n var keys = this._keys, lim;\n\n lim = addedCnt>0 ? idx+addedCnt : -1;\n Ember.changeProperties(function() {\n for(var key in keys) {\n if (!keys.hasOwnProperty(key)) { continue; }\n\n if (lim>0) { addObserverForContentKey(content, key, this, idx, lim); }\n\n Ember.propertyDidChange(this, key);\n }\n\n Ember.propertyDidChange(this._content, '@each');\n }, this);\n },\n\n // ..........................................................\n // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS\n // Start monitoring keys based on who is listening...\n\n didAddListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.beginObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n didRemoveListener: function(eventName) {\n if (IS_OBSERVER.test(eventName)) {\n this.stopObservingContentKey(eventName.slice(0, -7));\n }\n },\n\n // ..........................................................\n // CONTENT KEY OBSERVING\n // Actual watch keys on the source content.\n\n beginObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (!keys) keys = this._keys = {};\n if (!keys[keyName]) {\n keys[keyName] = 1;\n var content = this._content,\n len = get(content, 'length');\n addObserverForContentKey(content, keyName, this, 0, len);\n } else {\n keys[keyName]++;\n }\n },\n\n stopObservingContentKey: function(keyName) {\n var keys = this._keys;\n if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {\n var content = this._content,\n len = get(content, 'length');\n removeObserverForContentKey(content, keyName, this, 0, len);\n }\n },\n\n contentKeyWillChange: function(obj, keyName) {\n Ember.propertyWillChange(this, keyName);\n },\n\n contentKeyDidChange: function(obj, keyName) {\n Ember.propertyDidChange(this, keyName);\n }\n\n});\n\n\n\n})();\n//@ sourceURL=ember-runtime/system/each_proxy");minispade.register('ember-runtime/system/lazy_load', "(function() {var forEach = Ember.ArrayPolyfills.forEach;\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar loadHooks = Ember.ENV.EMBER_LOAD_HOOKS || {};\nvar loaded = {};\n\n/**\n\nDetects when a specific package of Ember (e.g. 'Ember.Handlebars')\nhas fully loaded and is available for extension.\n\nThe provided `callback` will be called with the `name` passed\nresolved from a string into the object:\n\n```javascript\nEmber.onLoad('Ember.Handlebars' function(hbars){\n hbars.registerHelper(...);\n});\n```\n\n\n@method onLoad\n@for Ember\n@param name {String} name of hook\n@param callback {Function} callback to be called\n*/\nEmber.onLoad = function(name, callback) {\n var object;\n\n loadHooks[name] = loadHooks[name] || Ember.A();\n loadHooks[name].pushObject(callback);\n\n if (object = loaded[name]) {\n callback(object);\n }\n};\n\n/**\n\nCalled when an Ember.js package (e.g Ember.Handlebars) has finished\nloading. Triggers any callbacks registered for this event.\n\n@method runLoadHooks\n@for Ember\n@param name {String} name of hook\n@param object {Object} object to pass to callbacks\n*/\nEmber.runLoadHooks = function(name, object) {\n loaded[name] = object;\n\n if (loadHooks[name]) {\n forEach.call(loadHooks[name], function(callback) {\n callback(object);\n });\n }\n};\n\n})();\n//@ sourceURL=ember-runtime/system/lazy_load");minispade.register('ember-runtime/system/namespace', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, indexOf = Ember.ArrayPolyfills.indexOf;\n\n/**\n A Namespace is an object usually used to contain other objects or methods\n such as an application or framework. Create a namespace anytime you want\n to define one of these new containers.\n\n # Example Usage\n\n ```javascript\n MyFramework = Ember.Namespace.create({\n VERSION: '1.0.0'\n });\n ```\n\n @class Namespace\n @namespace Ember\n @extends Ember.Object\n*/\nvar Namespace = Ember.Namespace = Ember.Object.extend({\n isNamespace: true,\n\n init: function() {\n Ember.Namespace.NAMESPACES.push(this);\n Ember.Namespace.PROCESSED = false;\n },\n\n toString: function() {\n var name = get(this, 'name');\n if (name) { return name; }\n\n findNamespaces();\n return this[Ember.GUID_KEY+'_name'];\n },\n\n nameClasses: function() {\n processNamespace([this.toString()], this, {});\n },\n\n destroy: function() {\n var namespaces = Ember.Namespace.NAMESPACES;\n Ember.lookup[this.toString()] = undefined;\n namespaces.splice(indexOf.call(namespaces, this), 1);\n this._super();\n }\n});\n\nNamespace.reopenClass({\n NAMESPACES: [Ember],\n NAMESPACES_BY_ID: {},\n PROCESSED: false,\n processAll: processAllNamespaces,\n byName: function(name) {\n if (!Ember.BOOTED) {\n processAllNamespaces();\n }\n\n return NAMESPACES_BY_ID[name];\n }\n});\n\nvar NAMESPACES_BY_ID = Namespace.NAMESPACES_BY_ID;\n\nvar hasOwnProp = ({}).hasOwnProperty,\n guidFor = Ember.guidFor;\n\nfunction processNamespace(paths, root, seen) {\n var idx = paths.length;\n\n NAMESPACES_BY_ID[paths.join('.')] = root;\n\n // Loop over all of the keys in the namespace, looking for classes\n for(var key in root) {\n if (!hasOwnProp.call(root, key)) { continue; }\n var obj = root[key];\n\n // If we are processing the `Ember` namespace, for example, the\n // `paths` will start with `[\"Ember\"]`. Every iteration through\n // the loop will update the **second** element of this list with\n // the key, so processing `Ember.View` will make the Array\n // `['Ember', 'View']`.\n paths[idx] = key;\n\n // If we have found an unprocessed class\n if (obj && obj.toString === classToString) {\n // Replace the class' `toString` with the dot-separated path\n // and set its `NAME_KEY`\n obj.toString = makeToString(paths.join('.'));\n obj[NAME_KEY] = paths.join('.');\n\n // Support nested namespaces\n } else if (obj && obj.isNamespace) {\n // Skip aliased namespaces\n if (seen[guidFor(obj)]) { continue; }\n seen[guidFor(obj)] = true;\n\n // Process the child namespace\n processNamespace(paths, obj, seen);\n }\n }\n\n paths.length = idx; // cut out last item\n}\n\nfunction findNamespaces() {\n var Namespace = Ember.Namespace, lookup = Ember.lookup, obj, isNamespace;\n\n if (Namespace.PROCESSED) { return; }\n\n for (var prop in lookup) {\n // These don't raise exceptions but can cause warnings\n if (prop === \"parent\" || prop === \"top\" || prop === \"frameElement\" || prop === \"webkitStorageInfo\") { continue; }\n\n // get(window.globalStorage, 'isNamespace') would try to read the storage for domain isNamespace and cause exception in Firefox.\n // globalStorage is a storage obsoleted by the WhatWG storage specification. See https://developer.mozilla.org/en/DOM/Storage#globalStorage\n if (prop === \"globalStorage\" && lookup.StorageList && lookup.globalStorage instanceof lookup.StorageList) { continue; }\n // Unfortunately, some versions of IE don't support window.hasOwnProperty\n if (lookup.hasOwnProperty && !lookup.hasOwnProperty(prop)) { continue; }\n\n // At times we are not allowed to access certain properties for security reasons.\n // There are also times where even if we can access them, we are not allowed to access their properties.\n try {\n obj = Ember.lookup[prop];\n isNamespace = obj && obj.isNamespace;\n } catch (e) {\n continue;\n }\n\n if (isNamespace) {\n Ember.deprecate(\"Namespaces should not begin with lowercase.\", /^[A-Z]/.test(prop));\n obj[NAME_KEY] = prop;\n }\n }\n}\n\nvar NAME_KEY = Ember.NAME_KEY = Ember.GUID_KEY + '_name';\n\nfunction superClassString(mixin) {\n var superclass = mixin.superclass;\n if (superclass) {\n if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }\n else { return superClassString(superclass); }\n } else {\n return;\n }\n}\n\nfunction classToString() {\n if (!Ember.BOOTED && !this[NAME_KEY]) {\n processAllNamespaces();\n }\n\n var ret;\n\n if (this[NAME_KEY]) {\n ret = this[NAME_KEY];\n } else if (this._toString) {\n ret = this._toString; \n } else {\n var str = superClassString(this);\n if (str) {\n ret = \"(subclass of \" + str + \")\";\n } else {\n ret = \"(unknown mixin)\";\n }\n this.toString = makeToString(ret);\n }\n\n return ret;\n}\n\nfunction processAllNamespaces() {\n var unprocessedNamespaces = !Namespace.PROCESSED,\n unprocessedMixins = Ember.anyUnprocessedMixins;\n\n if (unprocessedNamespaces) {\n findNamespaces();\n Namespace.PROCESSED = true;\n }\n\n if (unprocessedNamespaces || unprocessedMixins) {\n var namespaces = Namespace.NAMESPACES, namespace;\n for (var i=0, l=namespaces.length; i<l; i++) {\n namespace = namespaces[i];\n processNamespace([namespace.toString()], namespace, {});\n }\n\n Ember.anyUnprocessedMixins = false;\n }\n}\n\nfunction makeToString(ret) {\n return function() { return ret; };\n}\n\nEmber.Mixin.prototype.toString = classToString;\n\n})();\n//@ sourceURL=ember-runtime/system/namespace");minispade.register('ember-runtime/system/native_array', "(function() {minispade.require('ember-metal/enumerable_utils');\nminispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/mixins/mutable_array');\nminispade.require('ember-runtime/mixins/copyable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n\nvar get = Ember.get, set = Ember.set, replace = Ember.EnumerableUtils._replace;\n\n// Add Ember.Array to Array.prototype. Remove methods with native\n// implementations and supply some more optimized versions of generic methods\n// because they are so common.\nvar NativeArray = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember.Copyable, {\n\n // because length is a built-in property we need to know to just get the\n // original property.\n get: function(key) {\n if (key==='length') return this.length;\n else if ('number' === typeof key) return this[key];\n else return this._super(key);\n },\n\n objectAt: function(idx) {\n return this[idx];\n },\n\n // primitive for array support.\n replace: function(idx, amt, objects) {\n\n if (this.isFrozen) throw Ember.FROZEN_ERROR;\n\n // if we replaced exactly the same number of items, then pass only the\n // replaced range. Otherwise, pass the full remaining array length\n // since everything has shifted\n var len = objects ? get(objects, 'length') : 0;\n this.arrayContentWillChange(idx, amt, len);\n\n if (len === 0) {\n this.splice(idx, amt);\n } else {\n replace(this, idx, amt, objects);\n }\n\n this.arrayContentDidChange(idx, amt, len);\n return this;\n },\n\n // If you ask for an unknown property, then try to collect the value\n // from member items.\n unknownProperty: function(key, value) {\n var ret;// = this.reducedProperty(key, value) ;\n if ((value !== undefined) && ret === undefined) {\n ret = this[key] = value;\n }\n return ret ;\n },\n\n // If browser did not implement indexOf natively, then override with\n // specialized version\n indexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = 0;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx<len;idx++) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n lastIndexOf: function(object, startAt) {\n var idx, len = this.length;\n\n if (startAt === undefined) startAt = len-1;\n else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);\n if (startAt < 0) startAt += len;\n\n for(idx=startAt;idx>=0;idx--) {\n if (this[idx] === object) return idx ;\n }\n return -1;\n },\n\n copy: function(deep) {\n if (deep) {\n return this.map(function(item) { return Ember.copy(item, true); });\n }\n\n return this.slice();\n }\n});\n\n// Remove any methods implemented natively so we don't override them\nvar ignore = ['length'];\nEmber.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {\n if (Array.prototype[methodName]) ignore.push(methodName);\n});\n\nif (ignore.length>0) {\n NativeArray = NativeArray.without.apply(NativeArray, ignore);\n}\n\n/**\n The NativeArray mixin contains the properties needed to to make the native\n Array support Ember.MutableArray and all of its dependent APIs. Unless you\n have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to\n false, this will be applied automatically. Otherwise you can apply the mixin\n at anytime by calling `Ember.NativeArray.activate`.\n\n @class NativeArray\n @namespace Ember\n @uses Ember.MutableArray\n @uses Ember.Observable\n @uses Ember.Copyable\n*/\nEmber.NativeArray = NativeArray;\n\n/**\n Creates an `Ember.NativeArray` from an Array like object.\n Does not modify the original object. Ember.A is not needed if\n `Ember.EXTEND_PROTOTYPES` is `true` (the default value). However,\n it is recommended that you use Ember.A when creating addons for\n ember or when you can not guarantee that `Ember.EXTEND_PROTOTYPES`\n will be `true`.\n\n Example\n\n ```js\n var Pagination = Ember.CollectionView.extend({\n tagName: 'ul',\n classNames: ['pagination'],\n init: function() {\n this._super();\n if (!this.get('content')) {\n this.set('content', Ember.A([]));\n }\n }\n });\n ```\n\n @method A\n @for Ember\n @return {Ember.NativeArray}\n*/\nEmber.A = function(arr) {\n if (arr === undefined) { arr = []; }\n return Ember.Array.detect(arr) ? arr : Ember.NativeArray.apply(arr);\n};\n\n/**\n Activates the mixin on the Array.prototype if not already applied. Calling\n this method more than once is safe. This will be called when ember is loaded\n unless you have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array`\n set to `false`.\n\n Example\n\n ```js\n if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n Ember.NativeArray.activate();\n }\n ```\n\n @method activate\n @for Ember.NativeArray\n @static\n @return {void}\n*/\nEmber.NativeArray.activate = function() {\n NativeArray.apply(Array.prototype);\n\n Ember.A = function(arr) { return arr || []; };\n};\n\nif (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.Array) {\n Ember.NativeArray.activate();\n}\n\n\n})();\n//@ sourceURL=ember-runtime/system/native_array");minispade.register('ember-runtime/system/object', "(function() {minispade.require('ember-runtime/mixins/observable');\nminispade.require('ember-runtime/system/core_object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\n/**\n `Ember.Object` is the main base class for all Ember objects. It is a subclass\n of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,\n see the documentation for each of these.\n\n @class Object\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.Observable\n*/\nEmber.Object = Ember.CoreObject.extend(Ember.Observable);\nEmber.Object.toString = function() { return \"Ember.Object\"; };\n\n})();\n//@ sourceURL=ember-runtime/system/object");minispade.register('ember-runtime/system/object_proxy', "(function() {minispade.require('ember-runtime/system/object');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get,\n set = Ember.set,\n fmt = Ember.String.fmt,\n addBeforeObserver = Ember.addBeforeObserver,\n addObserver = Ember.addObserver,\n removeBeforeObserver = Ember.removeBeforeObserver,\n removeObserver = Ember.removeObserver,\n propertyWillChange = Ember.propertyWillChange,\n propertyDidChange = Ember.propertyDidChange,\n meta = Ember.meta,\n defineProperty = Ember.defineProperty;\n\nfunction contentPropertyWillChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyWillChange(this, key);\n}\n\nfunction contentPropertyDidChange(content, contentKey) {\n var key = contentKey.slice(8); // remove \"content.\"\n if (key in this) { return; } // if shadowed in proxy\n propertyDidChange(this, key);\n}\n\n/**\n `Ember.ObjectProxy` forwards all properties not defined by the proxy itself\n to a proxied `content` object.\n\n ```javascript\n object = Ember.Object.create({\n name: 'Foo'\n });\n\n proxy = Ember.ObjectProxy.create({\n content: object\n });\n\n // Access and change existing properties\n proxy.get('name') // 'Foo'\n proxy.set('name', 'Bar');\n object.get('name') // 'Bar'\n\n // Create new 'description' property on `object`\n proxy.set('description', 'Foo is a whizboo baz');\n object.get('description') // 'Foo is a whizboo baz'\n ```\n\n While `content` is unset, setting a property to be delegated will throw an\n Error.\n\n ```javascript\n proxy = Ember.ObjectProxy.create({\n content: null,\n flag: null\n });\n proxy.set('flag', true);\n proxy.get('flag'); // true\n proxy.get('foo'); // undefined\n proxy.set('foo', 'data'); // throws Error\n ```\n\n Delegated properties can be bound to and will change when content is updated.\n\n Computed properties on the proxy itself can depend on delegated properties.\n\n ```javascript\n ProxyWithComputedProperty = Ember.ObjectProxy.extend({\n fullName: function () {\n var firstName = this.get('firstName'),\n lastName = this.get('lastName');\n if (firstName && lastName) {\n return firstName + ' ' + lastName;\n }\n return firstName || lastName;\n }.property('firstName', 'lastName')\n });\n\n proxy = ProxyWithComputedProperty.create();\n\n proxy.get('fullName'); // undefined\n proxy.set('content', {\n firstName: 'Tom', lastName: 'Dale'\n }); // triggers property change for fullName on proxy\n\n proxy.get('fullName'); // 'Tom Dale'\n ```\n\n @class ObjectProxy\n @namespace Ember\n @extends Ember.Object\n*/\nEmber.ObjectProxy = Ember.Object.extend(/** @scope Ember.ObjectProxy.prototype */ {\n /**\n The object whose properties will be forwarded.\n\n @property content\n @type Ember.Object\n @default null\n */\n content: null,\n _contentDidChange: Ember.observer('content', function() {\n Ember.assert(\"Can't set ObjectProxy's content to itself\", this.get('content') !== this);\n }),\n\n isTruthy: Ember.computed.bool('content'),\n\n _debugContainerKey: null,\n\n willWatchProperty: function (key) {\n var contentKey = 'content.' + key;\n addBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n addObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n didUnwatchProperty: function (key) {\n var contentKey = 'content.' + key;\n removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);\n removeObserver(this, contentKey, null, contentPropertyDidChange);\n },\n\n unknownProperty: function (key) {\n var content = get(this, 'content');\n if (content) {\n return get(content, key);\n }\n },\n\n setUnknownProperty: function (key, value) {\n var m = meta(this);\n if (m.proto === this) {\n // if marked as prototype then just defineProperty\n // rather than delegate\n defineProperty(this, key, null, value);\n return value;\n }\n\n var content = get(this, 'content');\n Ember.assert(fmt(\"Cannot delegate set('%@', %@) to the 'content' property of object proxy %@: its 'content' is undefined.\", [key, value, this]), content);\n return set(content, key, value);\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/system/object_proxy");minispade.register('ember-runtime/system/set', "(function() {minispade.require('ember-runtime/core');\nminispade.require('ember-runtime/system/core_object');\nminispade.require('ember-runtime/mixins/mutable_enumerable');\nminispade.require('ember-runtime/mixins/copyable');\nminispade.require('ember-runtime/mixins/freezable');\n\n/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, isNone = Ember.isNone, fmt = Ember.String.fmt;\n\n/**\n An unordered collection of objects.\n\n A Set works a bit like an array except that its items are not ordered. You\n can create a set to efficiently test for membership for an object. You can\n also iterate through a set just like an array, even accessing objects by\n index, however there is no guarantee as to their order.\n\n All Sets are observable via the Enumerable Observer API - which works\n on any enumerable object including both Sets and Arrays.\n\n ## Creating a Set\n\n You can create a set like you would most objects using\n `new Ember.Set()`. Most new sets you create will be empty, but you can\n also initialize the set with some content by passing an array or other\n enumerable of objects to the constructor.\n\n Finally, you can pass in an existing set and the set will be copied. You\n can also create a copy of a set by calling `Ember.Set#copy()`.\n\n ```javascript\n // creates a new empty set\n var foundNames = new Ember.Set();\n\n // creates a set with four names in it.\n var names = new Ember.Set([\"Charles\", \"Tom\", \"Juan\", \"Alex\"]); // :P\n\n // creates a copy of the names set.\n var namesCopy = new Ember.Set(names);\n\n // same as above.\n var anotherNamesCopy = names.copy();\n ```\n\n ## Adding/Removing Objects\n\n You generally add or remove objects from a set using `add()` or\n `remove()`. You can add any type of object including primitives such as\n numbers, strings, and booleans.\n\n Unlike arrays, objects can only exist one time in a set. If you call `add()`\n on a set with the same object multiple times, the object will only be added\n once. Likewise, calling `remove()` with the same object multiple times will\n remove the object the first time and have no effect on future calls until\n you add the object to the set again.\n\n NOTE: You cannot add/remove `null` or `undefined` to a set. Any attempt to do\n so will be ignored.\n\n In addition to add/remove you can also call `push()`/`pop()`. Push behaves\n just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary\n object, remove it and return it. This is a good way to use a set as a job\n queue when you don't care which order the jobs are executed in.\n\n ## Testing for an Object\n\n To test for an object's presence in a set you simply call\n `Ember.Set#contains()`.\n\n ## Observing changes\n\n When using `Ember.Set`, you can observe the `\"[]\"` property to be\n alerted whenever the content changes. You can also add an enumerable\n observer to the set to be notified of specific objects that are added and\n removed from the set. See [Ember.Enumerable](/api/classes/Ember.Enumerable.html)\n for more information on enumerables.\n\n This is often unhelpful. If you are filtering sets of objects, for instance,\n it is very inefficient to re-filter all of the items each time the set\n changes. It would be better if you could just adjust the filtered set based\n on what was changed on the original set. The same issue applies to merging\n sets, as well.\n\n ## Other Methods\n\n `Ember.Set` primary implements other mixin APIs. For a complete reference\n on the methods you will use with `Ember.Set`, please consult these mixins.\n The most useful ones will be `Ember.Enumerable` and\n `Ember.MutableEnumerable` which implement most of the common iterator\n methods you are used to on Array.\n\n Note that you can also use the `Ember.Copyable` and `Ember.Freezable`\n APIs on `Ember.Set` as well. Once a set is frozen it can no longer be\n modified. The benefit of this is that when you call `frozenCopy()` on it,\n Ember will avoid making copies of the set. This allows you to write\n code that can know with certainty when the underlying set data will or\n will not be modified.\n\n @class Set\n @namespace Ember\n @extends Ember.CoreObject\n @uses Ember.MutableEnumerable\n @uses Ember.Copyable\n @uses Ember.Freezable\n @since Ember 0.9\n*/\nEmber.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,\n /** @scope Ember.Set.prototype */ {\n\n // ..........................................................\n // IMPLEMENT ENUMERABLE APIS\n //\n\n /**\n This property will change as the number of objects in the set changes.\n\n @property length\n @type number\n @default 0\n */\n length: 0,\n\n /**\n Clears the set. This is useful if you want to reuse an existing set\n without having to recreate it.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.length; // 3\n colors.clear();\n colors.length; // 0\n ```\n\n @method clear\n @return {Ember.Set} An empty Set\n */\n clear: function() {\n if (this.isFrozen) { throw new Ember.Error(Ember.FROZEN_ERROR); }\n\n var len = get(this, 'length');\n if (len === 0) { return this; }\n\n var guid;\n\n this.enumerableContentWillChange(len, 0);\n Ember.propertyWillChange(this, 'firstObject');\n Ember.propertyWillChange(this, 'lastObject');\n\n for (var i=0; i < len; i++) {\n guid = guidFor(this[i]);\n delete this[guid];\n delete this[i];\n }\n\n set(this, 'length', 0);\n\n Ember.propertyDidChange(this, 'firstObject');\n Ember.propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(len, 0);\n\n return this;\n },\n\n /**\n Returns true if the passed object is also an enumerable that contains the\n same objects as the receiver.\n\n ```javascript\n var colors = [\"red\", \"green\", \"blue\"],\n same_colors = new Ember.Set(colors);\n\n same_colors.isEqual(colors); // true\n same_colors.isEqual([\"purple\", \"brown\"]); // false\n ```\n\n @method isEqual\n @param {Ember.Set} obj the other object.\n @return {Boolean}\n */\n isEqual: function(obj) {\n // fail fast\n if (!Ember.Enumerable.detect(obj)) return false;\n\n var loc = get(this, 'length');\n if (get(obj, 'length') !== loc) return false;\n\n while(--loc >= 0) {\n if (!obj.contains(this[loc])) return false;\n }\n\n return true;\n },\n\n /**\n Adds an object to the set. Only non-`null` objects can be added to a set\n and those can only be added once. If the object is already in the set or\n the passed value is null this method will have no effect.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"blue\"); // [\"blue\"]\n colors.add(\"red\"); // [\"blue\", \"red\"]\n colors.add(null); // [\"blue\", \"red\"]\n colors.add(undefined); // [\"blue\", \"red\"]\n ```\n\n @method add\n @param {Object} obj The object to add.\n @return {Ember.Set} The set itself.\n */\n add: Ember.aliasMethod('addObject'),\n\n /**\n Removes the object from the set if it is found. If you pass a `null` value\n or an object that is already not in the set, this method will have no\n effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.remove(\"red\"); // [\"blue\", \"green\"]\n colors.remove(\"purple\"); // [\"blue\", \"green\"]\n colors.remove(null); // [\"blue\", \"green\"]\n ```\n\n @method remove\n @param {Object} obj The object to remove\n @return {Ember.Set} The set itself.\n */\n remove: Ember.aliasMethod('removeObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.pop(); // \"blue\"\n colors.pop(); // \"green\"\n colors.pop(); // null\n ```\n\n @method pop\n @return {Object} The removed object from the set or null.\n */\n pop: function() {\n if (get(this, 'isFrozen')) throw new Ember.Error(Ember.FROZEN_ERROR);\n var obj = this.length > 0 ? this[this.length-1] : null;\n this.remove(obj);\n return obj;\n },\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias for `Ember.MutableEnumerable.addObject()`.\n\n ```javascript\n var colors = new Ember.Set();\n colors.push(\"red\"); // [\"red\"]\n colors.push(\"green\"); // [\"red\", \"green\"]\n colors.push(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method push\n @return {Ember.Set} The set itself.\n */\n push: Ember.aliasMethod('addObject'),\n\n /**\n Removes the last element from the set and returns it, or `null` if it's empty.\n\n This is an alias for `Ember.Set.pop()`.\n\n ```javascript\n var colors = new Ember.Set([\"green\", \"blue\"]);\n colors.shift(); // \"blue\"\n colors.shift(); // \"green\"\n colors.shift(); // null\n ```\n\n @method shift\n @return {Object} The removed object from the set or null.\n */\n shift: Ember.aliasMethod('pop'),\n\n /**\n Inserts the given object on to the end of the set. It returns\n the set itself.\n\n This is an alias of `Ember.Set.push()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.unshift(\"red\"); // [\"red\"]\n colors.unshift(\"green\"); // [\"red\", \"green\"]\n colors.unshift(\"blue\"); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method unshift\n @return {Ember.Set} The set itself.\n */\n unshift: Ember.aliasMethod('push'),\n\n /**\n Adds each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.addObjects()`\n\n ```javascript\n var colors = new Ember.Set();\n colors.addEach([\"red\", \"green\", \"blue\"]); // [\"red\", \"green\", \"blue\"]\n ```\n\n @method addEach\n @param {Ember.Enumerable} objects the objects to add.\n @return {Ember.Set} The set itself.\n */\n addEach: Ember.aliasMethod('addObjects'),\n\n /**\n Removes each object in the passed enumerable to the set.\n\n This is an alias of `Ember.MutableEnumerable.removeObjects()`\n\n ```javascript\n var colors = new Ember.Set([\"red\", \"green\", \"blue\"]);\n colors.removeEach([\"red\", \"blue\"]); // [\"green\"]\n ```\n\n @method removeEach\n @param {Ember.Enumerable} objects the objects to remove.\n @return {Ember.Set} The set itself.\n */\n removeEach: Ember.aliasMethod('removeObjects'),\n\n // ..........................................................\n // PRIVATE ENUMERABLE SUPPORT\n //\n\n init: function(items) {\n this._super();\n if (items) this.addObjects(items);\n },\n\n // implement Ember.Enumerable\n nextObject: function(idx) {\n return this[idx];\n },\n\n // more optimized version\n firstObject: Ember.computed(function() {\n return this.length > 0 ? this[0] : undefined;\n }),\n\n // more optimized version\n lastObject: Ember.computed(function() {\n return this.length > 0 ? this[this.length-1] : undefined;\n }),\n\n // implements Ember.MutableEnumerable\n addObject: function(obj) {\n if (get(this, 'isFrozen')) throw new Ember.Error(Ember.FROZEN_ERROR);\n if (isNone(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n added ;\n\n if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added\n\n added = [obj];\n\n this.enumerableContentWillChange(null, added);\n Ember.propertyWillChange(this, 'lastObject');\n\n len = get(this, 'length');\n this[guid] = len;\n this[len] = obj;\n set(this, 'length', len+1);\n\n Ember.propertyDidChange(this, 'lastObject');\n this.enumerableContentDidChange(null, added);\n\n return this;\n },\n\n // implements Ember.MutableEnumerable\n removeObject: function(obj) {\n if (get(this, 'isFrozen')) throw new Ember.Error(Ember.FROZEN_ERROR);\n if (isNone(obj)) return this; // nothing to do\n\n var guid = guidFor(obj),\n idx = this[guid],\n len = get(this, 'length'),\n isFirst = idx === 0,\n isLast = idx === len-1,\n last, removed;\n\n\n if (idx>=0 && idx<len && (this[idx] === obj)) {\n removed = [obj];\n\n this.enumerableContentWillChange(removed, null);\n if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }\n if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }\n\n // swap items - basically move the item to the end so it can be removed\n if (idx < len-1) {\n last = this[len-1];\n this[idx] = last;\n this[guidFor(last)] = idx;\n }\n\n delete this[guid];\n delete this[len-1];\n set(this, 'length', len-1);\n\n if (isFirst) { Ember.propertyDidChange(this, 'firstObject'); }\n if (isLast) { Ember.propertyDidChange(this, 'lastObject'); }\n this.enumerableContentDidChange(removed, null);\n }\n\n return this;\n },\n\n // optimized version\n contains: function(obj) {\n return this[guidFor(obj)]>=0;\n },\n\n copy: function() {\n var C = this.constructor, ret = new C(), loc = get(this, 'length');\n set(ret, 'length', loc);\n while(--loc>=0) {\n ret[loc] = this[loc];\n ret[guidFor(this[loc])] = loc;\n }\n return ret;\n },\n\n toString: function() {\n var len = this.length, idx, array = [];\n for(idx = 0; idx < len; idx++) {\n array[idx] = this[idx];\n }\n return fmt(\"Ember.Set<%@>\", [array.join(',')]);\n }\n\n});\n\n})();\n//@ sourceURL=ember-runtime/system/set");minispade.register('ember-runtime/system/string', "(function() {/**\n@module ember\n@submodule ember-runtime\n*/\n\nvar STRING_DASHERIZE_REGEXP = (/[ _]/g);\nvar STRING_DASHERIZE_CACHE = {};\nvar STRING_DECAMELIZE_REGEXP = (/([a-z\\d])([A-Z])/g);\nvar STRING_CAMELIZE_REGEXP = (/(\\-|_|\\.|\\s)+(.)?/g);\nvar STRING_UNDERSCORE_REGEXP_1 = (/([a-z\\d])([A-Z]+)/g);\nvar STRING_UNDERSCORE_REGEXP_2 = (/\\-|\\s+/g);\n\n/**\n Defines the hash of localized strings for the current language. Used by\n the `Ember.String.loc()` helper. To localize, add string values to this\n hash.\n\n @property STRINGS\n @for Ember\n @type Hash\n*/\nEmber.STRINGS = {};\n\n/**\n Defines string helper methods including string formatting and localization.\n Unless `Ember.EXTEND_PROTOTYPES.String` is `false` these methods will also be\n added to the `String.prototype` as well.\n\n @class String\n @namespace Ember\n @static\n*/\nEmber.String = {\n\n /**\n Apply formatting options to the string. This will look for occurrences\n of \"%@\" in your string and substitute them with the arguments you pass into\n this method. If you want to control the specific order of replacement,\n you can add a number after the key as well to indicate which argument\n you want to insert.\n\n Ordered insertions are most useful when building loc strings where values\n you need to insert may appear in different orders.\n\n ```javascript\n \"Hello %@ %@\".fmt('John', 'Doe'); // \"Hello John Doe\"\n \"Hello %@2, %@1\".fmt('John', 'Doe'); // \"Hello Doe, John\"\n ```\n\n @method fmt\n @param {String} str The string to format\n @param {Array} formats An array of parameters to interpolate into string.\n @return {String} formatted string\n */\n fmt: function(str, formats) {\n // first, replace any ORDERED replacements.\n var idx = 0; // the current index for non-numerical replacements\n return str.replace(/%@([0-9]+)?/g, function(s, argIndex) {\n argIndex = (argIndex) ? parseInt(argIndex, 10) - 1 : idx++;\n s = formats[argIndex];\n return (s === null) ? '(null)' : (s === undefined) ? '' : Ember.inspect(s);\n }) ;\n },\n\n /**\n Formats the passed string, but first looks up the string in the localized\n strings hash. This is a convenient way to localize text. See\n `Ember.String.fmt()` for more information on formatting.\n\n Note that it is traditional but not required to prefix localized string\n keys with an underscore or other character so you can easily identify\n localized strings.\n\n ```javascript\n Ember.STRINGS = {\n '_Hello World': 'Bonjour le monde',\n '_Hello %@ %@': 'Bonjour %@ %@'\n };\n\n Ember.String.loc(\"_Hello World\"); // 'Bonjour le monde';\n Ember.String.loc(\"_Hello %@ %@\", [\"John\", \"Smith\"]); // \"Bonjour John Smith\";\n ```\n\n @method loc\n @param {String} str The string to format\n @param {Array} formats Optional array of parameters to interpolate into string.\n @return {String} formatted string\n */\n loc: function(str, formats) {\n str = Ember.STRINGS[str] || str;\n return Ember.String.fmt(str, formats) ;\n },\n\n /**\n Splits a string into separate units separated by spaces, eliminating any\n empty strings in the process. This is a convenience method for split that\n is mostly useful when applied to the `String.prototype`.\n\n ```javascript\n Ember.String.w(\"alpha beta gamma\").forEach(function(key) {\n console.log(key);\n });\n\n // > alpha\n // > beta\n // > gamma\n ```\n\n @method w\n @param {String} str The string to split\n @return {String} split string\n */\n w: function(str) { return str.split(/\\s+/); },\n\n /**\n Converts a camelized string into all lower case separated by underscores.\n\n ```javascript\n 'innerHTML'.decamelize(); // 'inner_html'\n 'action_name'.decamelize(); // 'action_name'\n 'css-class-name'.decamelize(); // 'css-class-name'\n 'my favorite items'.decamelize(); // 'my favorite items'\n ```\n\n @method decamelize\n @param {String} str The string to decamelize.\n @return {String} the decamelized string.\n */\n decamelize: function(str) {\n return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();\n },\n\n /**\n Replaces underscores, spaces, or camelCase with dashes.\n\n ```javascript\n 'innerHTML'.dasherize(); // 'inner-html'\n 'action_name'.dasherize(); // 'action-name'\n 'css-class-name'.dasherize(); // 'css-class-name'\n 'my favorite items'.dasherize(); // 'my-favorite-items'\n ```\n\n @method dasherize\n @param {String} str The string to dasherize.\n @return {String} the dasherized string.\n */\n dasherize: function(str) {\n var cache = STRING_DASHERIZE_CACHE,\n hit = cache.hasOwnProperty(str),\n ret;\n\n if (hit) {\n return cache[str];\n } else {\n ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');\n cache[str] = ret;\n }\n\n return ret;\n },\n\n /**\n Returns the lowerCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.camelize(); // 'innerHTML'\n 'action_name'.camelize(); // 'actionName'\n 'css-class-name'.camelize(); // 'cssClassName'\n 'my favorite items'.camelize(); // 'myFavoriteItems'\n 'My Favorite Items'.camelize(); // 'myFavoriteItems'\n ```\n\n @method camelize\n @param {String} str The string to camelize.\n @return {String} the camelized string.\n */\n camelize: function(str) {\n return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) {\n return chr ? chr.toUpperCase() : '';\n }).replace(/^([A-Z])/, function(match, separator, chr) {\n return match.toLowerCase();\n });\n },\n\n /**\n Returns the UpperCamelCase form of a string.\n\n ```javascript\n 'innerHTML'.classify(); // 'InnerHTML'\n 'action_name'.classify(); // 'ActionName'\n 'css-class-name'.classify(); // 'CssClassName'\n 'my favorite items'.classify(); // 'MyFavoriteItems'\n ```\n\n @method classify\n @param {String} str the string to classify\n @return {String} the classified string\n */\n classify: function(str) {\n var parts = str.split(\".\"),\n out = [];\n\n for (var i=0, l=parts.length; i<l; i++) {\n var camelized = Ember.String.camelize(parts[i]);\n out.push(camelized.charAt(0).toUpperCase() + camelized.substr(1));\n }\n\n return out.join(\".\");\n },\n\n /**\n More general than decamelize. Returns the lower\\_case\\_and\\_underscored\n form of a string.\n\n ```javascript\n 'innerHTML'.underscore(); // 'inner_html'\n 'action_name'.underscore(); // 'action_name'\n 'css-class-name'.underscore(); // 'css_class_name'\n 'my favorite items'.underscore(); // 'my_favorite_items'\n ```\n\n @method underscore\n @param {String} str The string to underscore.\n @return {String} the underscored string.\n */\n underscore: function(str) {\n return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').\n replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase();\n },\n\n /**\n Returns the Capitalized form of a string\n\n ```javascript\n 'innerHTML'.capitalize() // 'InnerHTML'\n 'action_name'.capitalize() // 'Action_name'\n 'css-class-name'.capitalize() // 'Css-class-name'\n 'my favorite items'.capitalize() // 'My favorite items'\n ```\n\n @method capitalize\n @param {String} str The string to capitalize.\n @return {String} The capitalized string.\n */\n capitalize: function(str) {\n return str.charAt(0).toUpperCase() + str.substr(1);\n }\n};\n\nif (Ember.FEATURES.isEnabled(\"string-humanize\")) {\n /**\n Returns the Humanized form of a string\n\n Replaces underscores with spaces, and capitializes first character\n of string. Also strips \"_id\" suffixes.\n\n ```javascript\n 'first_name'.humanize() // 'First name'\n 'user_id'.humanize() // 'User'\n ```\n\n @method humanize\n @param {String} str The string to humanize.\n @return {String} The humanized string.\n */\n\n Ember.String.humanize = function(str) {\n return str.replace(/_id$/, '').\n replace(/_/g, ' ').\n replace(/^\\w/g, function(s){\n return s.toUpperCase();\n });\n };\n}\n\n\n})();\n//@ sourceURL=ember-runtime/system/string");minispade.register('ember-runtime/system/subarray', "(function() {var get = Ember.get,\n forEach = Ember.EnumerableUtils.forEach,\n RETAIN = 'r',\n FILTER = 'f';\n\nfunction Operation (type, count) {\n this.type = type;\n this.count = count;\n}\n\n/**\n An `Ember.SubArray` tracks an array in a way similar to, but more specialized\n than, `Ember.TrackedArray`. It is useful for keeping track of the indexes of\n items within a filtered array.\n\n @class SubArray\n @namespace Ember\n*/\nEmber.SubArray = function (length) {\n if (arguments.length < 1) { length = 0; }\n\n if (length > 0) {\n this._operations = [new Operation(RETAIN, length)];\n } else {\n this._operations = [];\n }\n};\n\nEmber.SubArray.prototype = {\n /**\n Track that an item was added to the tracked array.\n\n @method addItem\n\n @param {number} index The index of the item in the tracked array.\n @param {boolean} match `true` iff the item is included in the subarray.\n\n @return {number} The index of the item in the subarray.\n */\n addItem: function(index, match) {\n var returnValue = -1,\n itemType = match ? RETAIN : FILTER,\n self = this;\n\n this._findOperation(index, function(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) {\n var newOperation, splitOperation;\n\n if (itemType === operation.type) {\n ++operation.count;\n } else if (index === rangeStart) {\n // insert to the left of `operation`\n self._operations.splice(operationIndex, 0, new Operation(itemType, 1));\n } else {\n newOperation = new Operation(itemType, 1);\n splitOperation = new Operation(operation.type, rangeEnd - index + 1);\n operation.count = index - rangeStart;\n\n self._operations.splice(operationIndex + 1, 0, newOperation, splitOperation);\n }\n\n if (match) {\n if (operation.type === RETAIN) {\n returnValue = seenInSubArray + (index - rangeStart);\n } else {\n returnValue = seenInSubArray;\n }\n }\n\n self._composeAt(operationIndex);\n }, function(seenInSubArray) {\n self._operations.push(new Operation(itemType, 1));\n\n if (match) {\n returnValue = seenInSubArray;\n }\n\n self._composeAt(self._operations.length-1);\n });\n\n return returnValue;\n },\n\n /**\n Track that an item was removed from the tracked array.\n\n @method removeItem\n\n @param {number} index The index of the item in the tracked array.\n\n @return {number} The index of the item in the subarray, or `-1` if the item\n was not in the subarray.\n */\n removeItem: function(index) {\n var returnValue = -1,\n self = this;\n\n this._findOperation(index, function (operation, operationIndex, rangeStart, rangeEnd, seenInSubArray) {\n if (operation.type === RETAIN) {\n returnValue = seenInSubArray + (index - rangeStart);\n }\n\n if (operation.count > 1) {\n --operation.count;\n } else {\n self._operations.splice(operationIndex, 1);\n self._composeAt(operationIndex);\n }\n }, function() {\n throw new Ember.Error(\"Can't remove an item that has never been added.\");\n });\n\n return returnValue;\n },\n\n\n _findOperation: function (index, foundCallback, notFoundCallback) {\n var operationIndex,\n len,\n operation,\n rangeStart,\n rangeEnd,\n seenInSubArray = 0;\n\n // OPTIMIZE: change to balanced tree\n // find leftmost operation to the right of `index`\n for (operationIndex = rangeStart = 0, len = this._operations.length; operationIndex < len; rangeStart = rangeEnd + 1, ++operationIndex) {\n operation = this._operations[operationIndex];\n rangeEnd = rangeStart + operation.count - 1;\n\n if (index >= rangeStart && index <= rangeEnd) {\n foundCallback(operation, operationIndex, rangeStart, rangeEnd, seenInSubArray);\n return;\n } else if (operation.type === RETAIN) {\n seenInSubArray += operation.count;\n }\n }\n\n notFoundCallback(seenInSubArray);\n },\n\n _composeAt: function(index) {\n var op = this._operations[index],\n otherOp;\n\n if (!op) {\n // Composing out of bounds is a no-op, as when removing the last operation\n // in the list.\n return;\n }\n\n if (index > 0) {\n otherOp = this._operations[index-1];\n if (otherOp.type === op.type) {\n op.count += otherOp.count;\n this._operations.splice(index-1, 1);\n --index;\n }\n }\n\n if (index < this._operations.length-1) {\n otherOp = this._operations[index+1];\n if (otherOp.type === op.type) {\n op.count += otherOp.count;\n this._operations.splice(index+1, 1);\n }\n }\n },\n\n toString: function () {\n var str = \"\";\n forEach(this._operations, function (operation) {\n str += \" \" + operation.type + \":\" + operation.count;\n });\n return str.substring(1);\n }\n};\n\n})();\n//@ sourceURL=ember-runtime/system/subarray");minispade.register('ember-runtime/system/tracked_array', "(function() {var get = Ember.get,\n forEach = Ember.EnumerableUtils.forEach,\n RETAIN = 'r',\n INSERT = 'i',\n DELETE = 'd';\n\n/**\n An `Ember.TrackedArray` tracks array operations. It's useful when you want to\n lazily compute the indexes of items in an array after they've been shifted by\n subsequent operations.\n\n @class TrackedArray\n @namespace Ember\n @param {array} [items=[]] The array to be tracked. This is used just to get\n the initial items for the starting state of retain:n.\n*/\nEmber.TrackedArray = function (items) {\n if (arguments.length < 1) { items = []; }\n\n var length = get(items, 'length');\n\n if (length) {\n this._operations = [new ArrayOperation(RETAIN, length, items)];\n } else {\n this._operations = [];\n }\n};\n\nEmber.TrackedArray.RETAIN = RETAIN;\nEmber.TrackedArray.INSERT = INSERT;\nEmber.TrackedArray.DELETE = DELETE;\n\nEmber.TrackedArray.prototype = {\n\n /**\n Track that `newItems` were added to the tracked array at `index`.\n\n @method addItems\n @param index\n @param newItems\n */\n addItems: function (index, newItems) {\n var count = get(newItems, 'length');\n if (count < 1) { return; }\n\n var match = this._findArrayOperation(index),\n arrayOperation = match.operation,\n arrayOperationIndex = match.index,\n arrayOperationRangeStart = match.rangeStart,\n composeIndex,\n splitIndex,\n splitItems,\n splitArrayOperation,\n newArrayOperation;\n\n newArrayOperation = new ArrayOperation(INSERT, count, newItems);\n\n if (arrayOperation) {\n if (!match.split) {\n // insert left of arrayOperation\n this._operations.splice(arrayOperationIndex, 0, newArrayOperation);\n composeIndex = arrayOperationIndex;\n } else {\n this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation);\n composeIndex = arrayOperationIndex + 1;\n }\n } else {\n // insert at end\n this._operations.push(newArrayOperation);\n composeIndex = arrayOperationIndex;\n }\n\n this._composeInsert(composeIndex);\n },\n\n /**\n Track that `count` items were removed at `index`.\n\n @method removeItems\n @param index\n @param count\n */\n removeItems: function (index, count) {\n if (count < 1) { return; }\n\n var match = this._findArrayOperation(index),\n arrayOperation = match.operation,\n arrayOperationIndex = match.index,\n arrayOperationRangeStart = match.rangeStart,\n newArrayOperation,\n composeIndex;\n\n newArrayOperation = new ArrayOperation(DELETE, count);\n if (!match.split) {\n // insert left of arrayOperation\n this._operations.splice(arrayOperationIndex, 0, newArrayOperation);\n composeIndex = arrayOperationIndex;\n } else {\n this._split(arrayOperationIndex, index - arrayOperationRangeStart, newArrayOperation);\n composeIndex = arrayOperationIndex + 1;\n }\n\n return this._composeDelete(composeIndex);\n },\n\n /**\n Apply all operations, reducing them to retain:n, for `n`, the number of\n items in the array.\n\n `callback` will be called for each operation and will be passed the following arguments:\n * {array} items The items for the given operation\n * {number} offset The computed offset of the items, ie the index in the\n array of the first item for this operation.\n * {string} operation The type of the operation. One of\n `Ember.TrackedArray.{RETAIN, DELETE, INSERT}`\n\n @method apply\n @param {function} callback\n */\n apply: function (callback) {\n var items = [],\n offset = 0;\n\n forEach(this._operations, function (arrayOperation) {\n callback(arrayOperation.items, offset, arrayOperation.type);\n\n if (arrayOperation.type !== DELETE) {\n offset += arrayOperation.count;\n items = items.concat(arrayOperation.items);\n }\n });\n\n this._operations = [new ArrayOperation(RETAIN, items.length, items)];\n },\n\n /**\n Return an ArrayOperationMatch for the operation that contains the item at `index`.\n\n @method _findArrayOperation\n\n @param {number} index the index of the item whose operation information\n should be returned.\n @private\n */\n _findArrayOperation: function (index) {\n var arrayOperationIndex,\n len,\n split = false,\n arrayOperation,\n arrayOperationRangeStart,\n arrayOperationRangeEnd;\n\n // OPTIMIZE: we could search these faster if we kept a balanced tree.\n // find leftmost arrayOperation to the right of `index`\n for (arrayOperationIndex = arrayOperationRangeStart = 0, len = this._operations.length; arrayOperationIndex < len; ++arrayOperationIndex) {\n arrayOperation = this._operations[arrayOperationIndex];\n\n if (arrayOperation.type === DELETE) { continue; }\n\n arrayOperationRangeEnd = arrayOperationRangeStart + arrayOperation.count - 1;\n\n if (index === arrayOperationRangeStart) {\n break;\n } else if (index > arrayOperationRangeStart && index <= arrayOperationRangeEnd) {\n split = true;\n break;\n } else {\n arrayOperationRangeStart = arrayOperationRangeEnd + 1;\n }\n }\n\n return new ArrayOperationMatch(arrayOperation, arrayOperationIndex, split, arrayOperationRangeStart);\n },\n\n _split: function (arrayOperationIndex, splitIndex, newArrayOperation) {\n var arrayOperation = this._operations[arrayOperationIndex],\n splitItems = arrayOperation.items.slice(splitIndex),\n splitArrayOperation = new ArrayOperation(arrayOperation.type, splitItems.length, splitItems);\n\n // truncate LHS\n arrayOperation.count = splitIndex;\n arrayOperation.items = arrayOperation.items.slice(0, splitIndex);\n\n this._operations.splice(arrayOperationIndex + 1, 0, newArrayOperation, splitArrayOperation);\n },\n\n // see SubArray for a better implementation.\n _composeInsert: function (index) {\n var newArrayOperation = this._operations[index],\n leftArrayOperation = this._operations[index-1], // may be undefined\n rightArrayOperation = this._operations[index+1], // may be undefined\n leftOp = leftArrayOperation && leftArrayOperation.type,\n rightOp = rightArrayOperation && rightArrayOperation.type;\n\n if (leftOp === INSERT) {\n // merge left\n leftArrayOperation.count += newArrayOperation.count;\n leftArrayOperation.items = leftArrayOperation.items.concat(newArrayOperation.items);\n\n if (rightOp === INSERT) {\n // also merge right (we have split an insert with an insert)\n leftArrayOperation.count += rightArrayOperation.count;\n leftArrayOperation.items = leftArrayOperation.items.concat(rightArrayOperation.items);\n this._operations.splice(index, 2);\n } else {\n // only merge left\n this._operations.splice(index, 1);\n }\n } else if (rightOp === INSERT) {\n // merge right\n newArrayOperation.count += rightArrayOperation.count;\n newArrayOperation.items = newArrayOperation.items.concat(rightArrayOperation.items);\n this._operations.splice(index + 1, 1);\n }\n },\n\n _composeDelete: function (index) {\n var arrayOperation = this._operations[index],\n deletesToGo = arrayOperation.count,\n leftArrayOperation = this._operations[index-1], // may be undefined\n leftOp = leftArrayOperation && leftArrayOperation.type,\n nextArrayOperation,\n nextOp,\n nextCount,\n removeNewAndNextOp = false,\n removedItems = [];\n\n if (leftOp === DELETE) {\n arrayOperation = leftArrayOperation;\n index -= 1;\n }\n\n for (var i = index + 1; deletesToGo > 0; ++i) {\n nextArrayOperation = this._operations[i];\n nextOp = nextArrayOperation.type;\n nextCount = nextArrayOperation.count;\n\n if (nextOp === DELETE) {\n arrayOperation.count += nextCount;\n continue;\n }\n\n if (nextCount > deletesToGo) {\n // d:2 {r,i}:5 we reduce the retain or insert, but it stays\n removedItems = removedItems.concat(nextArrayOperation.items.splice(0, deletesToGo));\n nextArrayOperation.count -= deletesToGo;\n\n // In the case where we truncate the last arrayOperation, we don't need to\n // remove it; also the deletesToGo reduction is not the entirety of\n // nextCount\n i -= 1;\n nextCount = deletesToGo;\n\n deletesToGo = 0;\n } else {\n if (nextCount === deletesToGo) {\n // Handle edge case of d:2 i:2 in which case both operations go away\n // during composition.\n removeNewAndNextOp = true;\n }\n removedItems = removedItems.concat(nextArrayOperation.items);\n deletesToGo -= nextCount;\n }\n\n if (nextOp === INSERT) {\n // d:2 i:3 will result in delete going away\n arrayOperation.count -= nextCount;\n }\n }\n\n if (arrayOperation.count > 0) {\n // compose our new delete with possibly several operations to the right of\n // disparate types\n this._operations.splice(index+1, i-1-index);\n } else {\n // The delete operation can go away; it has merely reduced some other\n // operation, as in d:3 i:4; it may also have eliminated that operation,\n // as in d:3 i:3.\n this._operations.splice(index, removeNewAndNextOp ? 2 : 1);\n }\n\n return removedItems;\n },\n\n toString: function () {\n var str = \"\";\n forEach(this._operations, function (operation) {\n str += \" \" + operation.type + \":\" + operation.count;\n });\n return str.substring(1);\n }\n};\n\n/**\n Internal data structure to represent an array operation.\n\n @method ArrayOperation\n @private\n @property {string} type The type of the operation. One of\n `Ember.TrackedArray.{RETAIN, INSERT, DELETE}`\n @property {number} count The number of items in this operation.\n @property {array} items The items of the operation, if included. RETAIN and\n INSERT include their items, DELETE does not.\n*/\nfunction ArrayOperation (operation, count, items) {\n this.type = operation; // RETAIN | INSERT | DELETE\n this.count = count;\n this.items = items;\n}\n\n/**\n Internal data structure used to include information when looking up operations\n by item index.\n\n @method ArrayOperationMatch\n @private\n @property {ArrayOperation} operation\n @property {number} index The index of `operation` in the array of operations.\n @property {boolean} split Whether or not the item index searched for would\n require a split for a new operation type.\n @property {number} rangeStart The index of the first item in the operation,\n with respect to the tracked array. The index of the last item can be computed\n from `rangeStart` and `operation.count`.\n*/\nfunction ArrayOperationMatch(operation, index, split, rangeStart) {\n this.operation = operation;\n this.index = index;\n this.split = split;\n this.rangeStart = rangeStart;\n}\n\n})();\n//@ sourceURL=ember-runtime/system/tracked_array");minispade.register('ember-testing/adapters', "(function() {minispade.require('ember-testing/test');\n\n/**\n @module ember\n @submodule ember-testing\n*/\n\nvar Test = Ember.Test;\n\n/**\n The primary purpose of this class is to create hooks that can be implemented\n by an adapter for various test frameworks.\n\n @class Adapter\n @namespace Ember.Test\n*/\nTest.Adapter = Ember.Object.extend({\n /**\n This callback will be called whenever an async operation is about to start.\n\n Override this to call your framework's methods that handle async\n operations.\n\n @public\n @method asyncStart\n */\n asyncStart: Ember.K,\n\n /**\n This callback will be called whenever an async operation has completed.\n\n @public\n @method asyncEnd\n */\n asyncEnd: Ember.K,\n\n /**\n Override this method with your testing framework's false assertion.\n This function is called whenever an exception occurs causing the testing\n promise to fail.\n\n QUnit example:\n\n ```javascript\n exception: function(error) {\n ok(false, error);\n };\n ```\n\n @public\n @method exception\n @param {String} error The exception to be raised.\n */\n exception: function(error) {\n setTimeout(function() {\n throw error;\n });\n }\n});\n\n/**\n This class implements the methods defined by Ember.Test.Adapter for the\n QUnit testing framework.\n\n @class QUnitAdapter\n @namespace Ember.Test\n @extends Ember.Test.Adapter\n*/\nTest.QUnitAdapter = Test.Adapter.extend({\n asyncStart: function() {\n stop();\n },\n asyncEnd: function() {\n start();\n },\n exception: function(error) {\n ok(false, Ember.inspect(error));\n }\n});\n\n})();\n//@ sourceURL=ember-testing/adapters");minispade.register('ember-testing/helpers', "(function() {minispade.require('ember-testing/test');\n\n/**\n* @module ember\n* @submodule ember-testing\n*/\n\nvar get = Ember.get,\n Test = Ember.Test,\n helper = Test.registerHelper,\n asyncHelper = Test.registerAsyncHelper,\n countAsync = 0;\n\nTest.pendingAjaxRequests = 0;\n\nTest.onInjectHelpers(function() {\n Ember.$(document).ajaxStart(function() {\n Test.pendingAjaxRequests++;\n });\n\n Ember.$(document).ajaxStop(function() {\n Ember.assert(\"An ajaxStop event which would cause the number of pending AJAX requests to be negative has been triggered. This is most likely caused by AJAX events that were started before calling `injectTestHelpers()`.\", Test.pendingAjaxRequests !== 0);\n Test.pendingAjaxRequests--;\n });\n});\n\n\nfunction visit(app, url) {\n app.__container__.lookup('router:main').location.setURL(url);\n Ember.run(app, app.handleURL, url);\n return wait(app);\n}\n\nfunction click(app, selector, context) {\n var $el = findWithAssert(app, selector, context);\n Ember.run($el, 'mousedown');\n\n if ($el.is(':input')) {\n var type = $el.prop('type');\n if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {\n Ember.run($el, function(){\n // Firefox does not trigger the `focusin` event if the window\n // does not have focus. If the document doesn't have focus just\n // use trigger('focusin') instead.\n if (!document.hasFocus || document.hasFocus()) {\n this.focus();\n } else {\n this.trigger('focusin');\n }\n });\n }\n }\n\n Ember.run($el, 'mouseup');\n Ember.run($el, 'click');\n\n return wait(app);\n}\n\nfunction keyEvent(app, selector, context, type, keyCode) {\n var $el;\n if (typeof keyCode === 'undefined') {\n keyCode = type;\n type = context;\n context = null;\n }\n $el = findWithAssert(app, selector, context);\n var event = Ember.$.Event(type, { keyCode: keyCode });\n Ember.run($el, 'trigger', event);\n return wait(app);\n}\n\nfunction fillIn(app, selector, context, text) {\n var $el;\n if (typeof text === 'undefined') {\n text = context;\n context = null;\n }\n $el = findWithAssert(app, selector, context);\n Ember.run(function() {\n $el.val(text).change();\n });\n return wait(app);\n}\n\nfunction findWithAssert(app, selector, context) {\n var $el = find(app, selector, context);\n if ($el.length === 0) {\n throw new Ember.Error(\"Element \" + selector + \" not found.\");\n }\n return $el;\n}\n\nfunction find(app, selector, context) {\n var $el;\n context = context || get(app, 'rootElement');\n $el = app.$(selector, context);\n\n return $el;\n}\n\nfunction andThen(app, callback) {\n return wait(app, callback(app));\n}\n\nfunction wait(app, value) {\n return Test.promise(function(resolve) {\n // If this is the first async promise, kick off the async test\n if (++countAsync === 1) {\n Test.adapter.asyncStart();\n }\n\n // Every 10ms, poll for the async thing to have finished\n var watcher = setInterval(function() {\n // 1. If the router is loading, keep polling\n var routerIsLoading = app.__container__.lookup('router:main').router.isLoading;\n if (routerIsLoading) { return; }\n\n // 2. If there are pending Ajax requests, keep polling\n if (Test.pendingAjaxRequests) { return; }\n\n // 3. If there are scheduled timers or we are inside of a run loop, keep polling\n if (Ember.run.hasScheduledTimers() || Ember.run.currentRunLoop) { return; }\n if (Ember.FEATURES.isEnabled(\"ember-testing-wait-hooks\")) {\n if (Test.waiters && Test.waiters.any(function(waiter) {\n var context = waiter[0];\n var callback = waiter[1];\n return !callback.apply(context);\n })) { return; }\n }\n // Stop polling\n clearInterval(watcher);\n\n // If this is the last async promise, end the async test\n if (--countAsync === 0) {\n Test.adapter.asyncEnd();\n }\n\n // Synchronously resolve the promise\n Ember.run(null, resolve, value);\n }, 10);\n });\n\n}\n\n\n/**\n* Loads a route, sets up any controllers, and renders any templates associated\n* with the route as though a real user had triggered the route change while\n* using your app.\n*\n* Example:\n*\n* ```\n* visit('posts/index').then(function() {\n* // assert something\n* });\n* ```\n*\n* @method visit\n* @param {String} url the name of the route\n* @return {RSVP.Promise}\n*/\nasyncHelper('visit', visit);\n\n/**\n* Clicks an element and triggers any actions triggered by the element's `click`\n* event.\n*\n* Example:\n*\n* ```\n* click('.some-jQuery-selector').then(function() {\n* // assert something\n* });\n* ```\n*\n* @method click\n* @param {String} selector jQuery selector for finding element on the DOM\n* @return {RSVP.Promise}\n*/\nasyncHelper('click', click);\n\n/**\n* Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode\n*\n* Example:\n*\n* ```\n* keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() {\n* // assert something\n* });\n* ```\n*\n* @method keyEvent\n* @param {String} selector jQuery selector for finding element on the DOM\n* @param {String} the type of key event, e.g. `keypress`, `keydown`, `keyup`\n* @param {Number} the keyCode of the simulated key event\n* @return {RSVP.Promise}\n*/\nasyncHelper('keyEvent', keyEvent);\n\n/**\n* Fills in an input element with some text.\n*\n* Example:\n*\n* ```\n* fillIn('#email', 'you@example.com').then(function() {\n* // assert something\n* });\n* ```\n*\n* @method fillIn\n* @param {String} selector jQuery selector finding an input element on the DOM\n* to fill text with\n* @param {String} text text to place inside the input element\n* @return {RSVP.Promise}\n*/\nasyncHelper('fillIn', fillIn);\n\n/**\n* Finds an element in the context of the app's container element. A simple alias\n* for `app.$(selector)`.\n*\n* Example:\n*\n* ```\n* var $el = find('.my-selector);\n* ```\n*\n* @method find\n* @param {String} selector jQuery string selector for element lookup\n* @return {Object} jQuery object representing the results of the query\n*/\nhelper('find', find);\n\n/**\n*\n* Like `find`, but throws an error if the element selector returns no results\n*\n* Example:\n*\n* ```\n* var $el = findWithAssert('.doesnt-exist'); // throws error\n* ```\n*\n* @method findWithAssert\n* @param {String} selector jQuery selector string for finding an element within\n* the DOM\n* @return {Object} jQuery object representing the results of the query\n* @throws {Error} throws error if jQuery object returned has a length of 0\n*/\nhelper('findWithAssert', findWithAssert);\n\n/**\n Causes the run loop to process any pending events. This is used to ensure that\n any async operations from other helpers (or your assertions) have been processed.\n\n This is most often used as the return value for the helper functions (see 'click',\n 'fillIn','visit',etc).\n\n Example:\n\n ```\n Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) {\n visit('secured/path/here')\n .fillIn('#username', username)\n .fillIn('#password', username)\n .click('.submit')\n\n return wait();\n });\n\n @method wait\n @param {Object} value The value to be returned.\n @return {RSVP.Promise}\n ```\n*/\nasyncHelper('wait', wait);\nasyncHelper('andThen', andThen);\n\n})();\n//@ sourceURL=ember-testing/helpers");minispade.register('ember-testing', "(function() {minispade.require('ember-application');\nminispade.require('ember-routing');\nminispade.require('ember-testing/test');\nminispade.require('ember-testing/support');\nminispade.require('ember-testing/adapters');\nminispade.require('ember-testing/helpers');\n\n/**\n Ember Testing\n\n @module ember\n @submodule ember-testing\n @requires ember-application\n*/\n\n})();\n//@ sourceURL=ember-testing");minispade.register('ember-testing/support', "(function() {/**\n @module ember\n @submodule ember-testing\n */\n\nvar $ = Ember.$;\n\n/**\n This method creates a checkbox and triggers the click event to fire the\n passed in handler. It is used to correct for a bug in older versions\n of jQuery (e.g 1.8.3).\n\n @private\n @method testCheckboxClick\n*/\nfunction testCheckboxClick(handler) {\n $('<input type=\"checkbox\">')\n .css({ position: 'absolute', left: '-1000px', top: '-1000px' })\n .appendTo('body')\n .on('click', handler)\n .trigger('click')\n .remove();\n}\n\n$(function() {\n /*\n Determine whether a checkbox checked using jQuery's \"click\" method will have\n the correct value for its checked property.\n\n If we determine that the current jQuery version exhibits this behavior,\n patch it to work correctly as in the commit for the actual fix:\n https://github.com/jquery/jquery/commit/1fb2f92.\n */\n testCheckboxClick(function() {\n if (!this.checked && !$.event.special.click) {\n $.event.special.click = {\n // For checkbox, fire native event so checked state will be right\n trigger: function() {\n if ($.nodeName( this, \"input\" ) && this.type === \"checkbox\" && this.click) {\n this.click();\n return false;\n }\n }\n };\n }\n });\n\n // Try again to verify that the patch took effect or blow up.\n testCheckboxClick(function() {\n Ember.warn(\"clicked checkboxes should be checked! the jQuery patch didn't work\", this.checked);\n });\n});\n\n})();\n//@ sourceURL=ember-testing/support");minispade.register('ember-testing/test', "(function() {/**\n @module ember\n @submodule ember-testing\n */\nvar slice = [].slice,\n helpers = {},\n originalMethods = {},\n injectHelpersCallbacks = [],\n Router = requireModule('router');\n\n/**\n This is a container for an assortment of testing related functionality:\n\n * Choose your default test adapter (for your framework of choice).\n * Register/Unregister additional test helpers.\n * Setup callbacks to be fired when the test helpers are injected into\n your application.\n\n @class Test\n @namespace Ember\n*/\nEmber.Test = {\n\n /**\n `registerHelper` is used to register a test helper that will be injected\n when `App.injectTestHelpers` is called.\n\n The helper method will always be called with the current Application as\n the first parameter.\n\n For example:\n ```javascript\n Ember.Test.registerHelper('boot', function(app) {\n Ember.run(app, app.advanceReadiness);\n });\n ```\n\n This helper can later be called without arguments because it will be\n called with `app` as the first parameter.\n\n ```javascript\n App = Ember.Application.create();\n App.injectTestHelpers();\n boot();\n ```\n\n @public\n @method registerHelper\n @param {String} name The name of the helper method to add.\n @param {Function} helperMethod\n @param options {Object}\n */\n registerHelper: function(name, helperMethod) {\n helpers[name] = {\n method: helperMethod,\n meta: { wait: false }\n };\n },\n\n /**\n `registerAsyncHelper` is used to register an async test helper that will be injected\n when `App.injectTestHelpers` is called.\n\n The helper method will always be called with the current Application as\n the first parameter.\n\n For example:\n ```javascript\n Ember.Test.registerAsyncHelper('boot', function(app) {\n Ember.run(app, app.advanceReadiness);\n });\n ```\n\n The advantage of an async helper is that it will not run\n until the last async helper has completed. All async helpers\n after it will wait for it complete before running.\n\n\n For example:\n ```javascript\n Ember.Test.registerAsyncHelper('deletePost', function(app, postId) {\n click('.delete-' + postId);\n });\n\n // ... in your test\n visit('/post/2');\n deletePost(2);\n visit('/post/3');\n deletePost(3);\n ```\n\n @public\n @method registerAsyncHelper\n @param {String} name The name of the helper method to add.\n @param {Function} helperMethod\n */\n registerAsyncHelper: function(name, helperMethod) {\n helpers[name] = {\n method: helperMethod,\n meta: { wait: true }\n };\n },\n\n /**\n Remove a previously added helper method.\n\n Example:\n ```\n Ember.Test.unregisterHelper('wait');\n ```\n\n @public\n @method unregisterHelper\n @param {String} name The helper to remove.\n */\n unregisterHelper: function(name) {\n delete helpers[name];\n if (originalMethods[name]) {\n window[name] = originalMethods[name];\n }\n delete originalMethods[name];\n delete Ember.Test.Promise.prototype[name];\n },\n\n /**\n Used to register callbacks to be fired whenever `App.injectTestHelpers`\n is called.\n\n The callback will receive the current application as an argument.\n\n Example:\n ```\n Ember.Test.onInjectHelpers(function() {\n Ember.$(document).ajaxStart(function() {\n Test.pendingAjaxRequests++;\n });\n\n Ember.$(document).ajaxStop(function() {\n Test.pendingAjaxRequests--;\n });\n });\n ```\n\n @public\n @method onInjectHelpers\n @param {Function} callback The function to be called.\n */\n onInjectHelpers: function(callback) {\n injectHelpersCallbacks.push(callback);\n },\n\n /**\n This returns a thenable tailored for testing. It catches failed\n `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception`\n callback in the last chained then.\n\n This method should be returned by async helpers such as `wait`.\n\n @public\n @method promise\n @param {Function} resolver The function used to resolve the promise.\n */\n promise: function(resolver) {\n return new Ember.Test.Promise(resolver);\n },\n\n /**\n Used to allow ember-testing to communicate with a specific testing\n framework.\n\n You can manually set it before calling `App.setupForTesting()`.\n\n Example:\n ```\n Ember.Test.adapter = MyCustomAdapter.create()\n ```\n\n If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`.\n\n @public\n @property adapter\n @type {Class} The adapter to be used.\n @default Ember.Test.QUnitAdapter\n */\n adapter: null,\n\n /**\n Replacement for `Ember.RSVP.resolve`\n The only difference is this uses\n and instance of `Ember.Test.Promise`\n\n @public\n @method resolve\n @param {Mixed} The value to resolve\n */\n resolve: function(val) {\n return Ember.Test.promise(function(resolve) {\n return resolve(val);\n });\n },\n\n /**\n @public\n\n This allows ember-testing to play nicely with other asynchronous\n events, such as an application that is waiting for a CSS3\n transition or an IndexDB transaction.\n\n For example:\n ```javascript\n Ember.Test.registerWaiter(function() {\n return myPendingTransactions() == 0;\n });\n ```\n The `context` argument allows you to optionally specify the `this`\n with which your callback will be invoked.\n\n For example:\n ```javascript\n Ember.Test.registerWaiter(MyDB, MyDB.hasPendingTransactions);\n ```\n @public\n @method registerWaiter\n @param {Object} context (optional)\n @param {Function} callback\n */\n registerWaiter: function(context, callback) {\n if (arguments.length === 1) {\n callback = context;\n context = null;\n }\n if (!this.waiters) {\n this.waiters = Ember.A();\n }\n this.waiters.push([context, callback]);\n },\n /**\n `unregisterWaiter` is used to unregister a callback that was\n registered with `registerWaiter`.\n\n @public\n @method unregisterWaiter\n @param {Object} context (optional)\n @param {Function} callback\n */\n unregisterWaiter: function(context, callback) {\n var pair;\n if (!this.waiters) { return; }\n if (arguments.length === 1) {\n callback = context;\n context = null;\n }\n pair = [context, callback];\n this.waiters = Ember.A(this.waiters.filter(function(elt) {\n return Ember.compare(elt, pair)!==0;\n }));\n }\n};\n\nfunction helper(app, name) {\n var fn = helpers[name].method,\n meta = helpers[name].meta;\n\n return function() {\n var args = slice.call(arguments),\n lastPromise = Ember.Test.lastPromise;\n\n args.unshift(app);\n\n // some helpers are not async and\n // need to return a value immediately.\n // example: `find`\n if (!meta.wait) {\n return fn.apply(app, args);\n }\n\n if (!lastPromise) {\n // It's the first async helper in current context\n lastPromise = fn.apply(app, args);\n } else {\n // wait for last helper's promise to resolve\n // and then execute\n run(function() {\n lastPromise = Ember.Test.resolve(lastPromise).then(function() {\n return fn.apply(app, args);\n });\n });\n }\n\n return lastPromise;\n };\n}\n\nfunction run(fn) {\n if (!Ember.run.currentRunLoop) {\n Ember.run(fn);\n } else {\n fn();\n }\n}\n\nEmber.Application.reopen({\n /**\n @property testHelpers\n @type {Object}\n @default {}\n */\n testHelpers: {},\n\n /**\n This hook defers the readiness of the application, so that you can start\n the app when your tests are ready to run. It also sets the router's\n location to 'none', so that the window's location will not be modified\n (preventing both accidental leaking of state between tests and interference\n with your testing framework).\n\n Example:\n ```\n App.setupForTesting();\n ```\n\n @method setupForTesting\n */\n setupForTesting: function() {\n Ember.testing = true;\n\n this.deferReadiness();\n\n this.Router.reopen({\n location: 'none'\n });\n\n // if adapter is not manually set default to QUnit\n if (!Ember.Test.adapter) {\n Ember.Test.adapter = Ember.Test.QUnitAdapter.create();\n }\n },\n\n /**\n This injects the test helpers into the window's scope. If a function of the\n same name has already been defined it will be cached (so that it can be reset\n if the helper is removed with `unregisterHelper` or `removeTestHelpers`).\n\n Any callbacks registered with `onInjectHelpers` will be called once the\n helpers have been injected.\n\n Example:\n ```\n App.injectTestHelpers();\n ```\n\n @method injectTestHelpers\n */\n injectTestHelpers: function() {\n this.testHelpers = {};\n for (var name in helpers) {\n originalMethods[name] = window[name];\n this.testHelpers[name] = window[name] = helper(this, name);\n protoWrap(Ember.Test.Promise.prototype, name, helper(this, name), helpers[name].meta.wait);\n }\n\n for(var i = 0, l = injectHelpersCallbacks.length; i < l; i++) {\n injectHelpersCallbacks[i](this);\n }\n\n Ember.RSVP.configure('onerror', onerror);\n },\n\n /**\n This removes all helpers that have been registered, and resets and functions\n that were overridden by the helpers.\n\n Example:\n ```\n App.removeTestHelpers();\n ```\n\n @public\n @method removeTestHelpers\n */\n removeTestHelpers: function() {\n for (var name in helpers) {\n window[name] = originalMethods[name];\n delete this.testHelpers[name];\n delete originalMethods[name];\n }\n Ember.RSVP.configure('onerror', null);\n }\n\n});\n\n// This method is no longer needed\n// But still here for backwards compatibility\n// of helper chaining\nfunction protoWrap(proto, name, callback, isAsync) {\n proto[name] = function() {\n var args = arguments;\n if (isAsync) {\n return callback.apply(this, args);\n } else {\n return this.then(function() {\n return callback.apply(this, args);\n });\n }\n };\n}\n\nEmber.Test.Promise = function() {\n Ember.RSVP.Promise.apply(this, arguments);\n Ember.Test.lastPromise = this;\n};\n\nEmber.Test.Promise.prototype = Ember.create(Ember.RSVP.Promise.prototype);\nEmber.Test.Promise.prototype.constructor = Ember.Test.Promise;\n\n// Patch `then` to isolate async methods\n// specifically `Ember.Test.lastPromise`\nvar originalThen = Ember.RSVP.Promise.prototype.then;\nEmber.Test.Promise.prototype.then = function(onSuccess, onFailure) {\n return originalThen.call(this, function(val) {\n return isolate(onSuccess, val);\n }, onFailure);\n};\n\n// This method isolates nested async methods\n// so that they don't conflict with other last promises.\n//\n// 1. Set `Ember.Test.lastPromise` to null\n// 2. Invoke method\n// 3. Return the last promise created during method\n// 4. Restore `Ember.Test.lastPromise` to original value\nfunction isolate(fn, val) {\n var value, lastPromise;\n\n // Reset lastPromise for nested helpers\n Ember.Test.lastPromise = null;\n\n value = fn.call(null, val);\n\n lastPromise = Ember.Test.lastPromise;\n\n // If the method returned a promise\n // return that promise. If not,\n // return the last async helper's promise\n if ((value && (value instanceof Ember.Test.Promise)) || !lastPromise) {\n return value;\n } else {\n run(function() {\n lastPromise = Ember.Test.resolve(lastPromise).then(function() {\n return value;\n });\n });\n return lastPromise;\n }\n}\n\n\nfunction onerror(error) {\n if (!(error instanceof Router.TransitionAborted)) {\n Ember.Test.adapter.exception(error);\n }\n}\n\n})();\n//@ sourceURL=ember-testing/test");minispade.register('ember-views/core', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar jQuery = this.jQuery || (Ember.imports && Ember.imports.jQuery);\nif (!jQuery && typeof require === 'function') {\n jQuery = require('jquery');\n}\n\nEmber.assert(\"Ember Views require jQuery 1.7, 1.8, 1.9, 1.10, or 2.0\", jQuery && (jQuery().jquery.match(/^((1\\.(7|8|9|10))|2.0)(\\.\\d+)?(pre|rc\\d?)?/) || Ember.ENV.FORCE_JQUERY));\n\n/**\n Alias for jQuery\n\n @method $\n @for Ember\n*/\nEmber.$ = jQuery;\n\n})();\n//@ sourceURL=ember-views/core");minispade.register('ember-views', "(function() {minispade.require(\"ember-runtime\");\nminispade.require(\"container\");\n\n/**\nEmber Views\n\n@module ember\n@submodule ember-views\n@requires ember-runtime\n@main ember-views\n*/\nminispade.require(\"ember-views/core\");\nminispade.require(\"ember-views/system\");\nminispade.require(\"ember-views/views\");\nminispade.require(\"ember-views/mixins\");\n\n})();\n//@ sourceURL=ember-views");minispade.register('ember-views/mixins', "(function() {minispade.require(\"ember-views/mixins/view_target_action_support\");\n\n})();\n//@ sourceURL=ember-views/mixins");minispade.register('ember-views/mixins/view_target_action_support', "(function() {/**\n`Ember.ViewTargetActionSupport` is a mixin that can be included in a\nview class to add a `triggerAction` method with semantics similar to\nthe Handlebars `{{action}}` helper. It provides intelligent defaults\nfor the action's target: the view's controller; and the context that is\nsent with the action: the view's context.\n\nNote: In normal Ember usage, the `{{action}}` helper is usually the best\nchoice. This mixin is most often useful when you are doing more complex\nevent handling in custom View subclasses.\n\nFor example:\n\n```javascript\nApp.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n action: 'save',\n click: function() {\n this.triggerAction(); // Sends the `save` action, along with the current context\n // to the current controller\n }\n});\n```\n\nThe `action` can be provided as properties of an optional object argument\nto `triggerAction` as well.\n\n```javascript\nApp.SaveButtonView = Ember.View.extend(Ember.ViewTargetActionSupport, {\n click: function() {\n this.triggerAction({\n action: 'save'\n }); // Sends the `save` action, along with the current context\n // to the current controller\n }\n});\n```\n\n@class ViewTargetActionSupport\n@namespace Ember\n@extends Ember.TargetActionSupport\n*/\nEmber.ViewTargetActionSupport = Ember.Mixin.create(Ember.TargetActionSupport, {\n /**\n @property target\n */\n target: Ember.computed.alias('controller'),\n /**\n @property actionContext\n */\n actionContext: Ember.computed.alias('context')\n});\n\n})();\n//@ sourceURL=ember-views/mixins/view_target_action_support");minispade.register('ember-views/system', "(function() {minispade.require(\"ember-views/system/jquery_ext\");\nminispade.require(\"ember-views/system/utils\");\nminispade.require(\"ember-views/system/render_buffer\");\nminispade.require(\"ember-views/system/event_dispatcher\");\nminispade.require(\"ember-views/system/ext\");\nminispade.require(\"ember-views/system/controller\");\n\n})();\n//@ sourceURL=ember-views/system");minispade.register('ember-views/system/controller', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\n// Original class declaration and documentation in runtime/lib/controllers/controller.js\n// NOTE: It may be possible with YUIDoc to combine docs in two locations\n\n/**\nAdditional methods for the ControllerMixin\n\n@class ControllerMixin\n@namespace Ember\n*/\nEmber.ControllerMixin.reopen({\n target: null,\n namespace: null,\n view: null,\n container: null,\n _childContainers: null,\n\n init: function() {\n this._super();\n set(this, '_childContainers', {});\n },\n\n _modelDidChange: Ember.observer('model', function() {\n var containers = get(this, '_childContainers');\n\n for (var prop in containers) {\n if (!containers.hasOwnProperty(prop)) { continue; }\n containers[prop].destroy();\n }\n\n set(this, '_childContainers', {});\n })\n});\n\n})();\n//@ sourceURL=ember-views/system/controller");minispade.register('ember-views/system/event_dispatcher', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.EventDispatcher` handles delegating browser events to their\n corresponding `Ember.Views.` For example, when you click on a view,\n `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets\n called.\n\n @class EventDispatcher\n @namespace Ember\n @private\n @extends Ember.Object\n*/\nEmber.EventDispatcher = Ember.Object.extend(/** @scope Ember.EventDispatcher.prototype */{\n\n /**\n The set of events names (and associated handler function names) to be setup\n and dispatched by the `EventDispatcher`. Custom events can added to this list at setup\n time, generally via the `Ember.Application.customEvents` hash. Only override this\n default set to prevent the EventDispatcher from listening on some events all together.\n\n This set will be modified by `setup` to also include any events added at that time.\n\n @property events\n @type Object\n */\n events: {\n touchstart : 'touchStart',\n touchmove : 'touchMove',\n touchend : 'touchEnd',\n touchcancel : 'touchCancel',\n keydown : 'keyDown',\n keyup : 'keyUp',\n keypress : 'keyPress',\n mousedown : 'mouseDown',\n mouseup : 'mouseUp',\n contextmenu : 'contextMenu',\n click : 'click',\n dblclick : 'doubleClick',\n mousemove : 'mouseMove',\n focusin : 'focusIn',\n focusout : 'focusOut',\n mouseenter : 'mouseEnter',\n mouseleave : 'mouseLeave',\n submit : 'submit',\n input : 'input',\n change : 'change',\n dragstart : 'dragStart',\n drag : 'drag',\n dragenter : 'dragEnter',\n dragleave : 'dragLeave',\n dragover : 'dragOver',\n drop : 'drop',\n dragend : 'dragEnd'\n },\n\n /**\n @private\n\n The root DOM element to which event listeners should be attached. Event\n listeners will be attached to the document unless this is overridden.\n\n Can be specified as a DOMElement or a selector string.\n\n The default body is a string since this may be evaluated before document.body\n exists in the DOM.\n\n @property rootElement\n @type DOMElement\n @default 'body'\n */\n rootElement: 'body',\n\n /**\n @private\n\n Sets up event listeners for standard browser events.\n\n This will be called after the browser sends a `DOMContentReady` event. By\n default, it will set up all of the listeners on the document body. If you\n would like to register the listeners on a different element, set the event\n dispatcher's `root` property.\n\n @method setup\n @param addedEvents {Hash}\n */\n setup: function(addedEvents, rootElement) {\n var event, events = get(this, 'events');\n\n Ember.$.extend(events, addedEvents || {});\n\n\n if (!Ember.isNone(rootElement)) {\n set(this, 'rootElement', rootElement);\n }\n\n rootElement = Ember.$(get(this, 'rootElement'));\n\n Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));\n Ember.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length);\n Ember.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length);\n\n rootElement.addClass('ember-application');\n\n Ember.assert('Unable to add \"ember-application\" class to rootElement. Make sure you set rootElement to the body or an element in the body.', rootElement.is('.ember-application'));\n\n for (event in events) {\n if (events.hasOwnProperty(event)) {\n this.setupHandler(rootElement, event, events[event]);\n }\n }\n },\n\n /**\n @private\n\n Registers an event listener on the document. If the given event is\n triggered, the provided event handler will be triggered on the target view.\n\n If the target view does not implement the event handler, or if the handler\n returns `false`, the parent view will be called. The event will continue to\n bubble to each successive parent view until it reaches the top.\n\n For example, to have the `mouseDown` method called on the target view when\n a `mousedown` event is received from the browser, do the following:\n\n ```javascript\n setupHandler('mousedown', 'mouseDown');\n ```\n\n @method setupHandler\n @param {Element} rootElement\n @param {String} event the browser-originated event to listen to\n @param {String} eventName the name of the method to call on the view\n */\n setupHandler: function(rootElement, event, eventName) {\n var self = this;\n\n rootElement.on(event + '.ember', '.ember-view', function(evt, triggeringManager) {\n return Ember.handleErrors(function() {\n var view = Ember.View.views[this.id],\n result = true, manager = null;\n\n manager = self._findNearestEventManager(view,eventName);\n\n if (manager && manager !== triggeringManager) {\n result = self._dispatchEvent(manager, evt, eventName, view);\n } else if (view) {\n result = self._bubbleEvent(view,evt,eventName);\n } else {\n evt.stopPropagation();\n }\n\n return result;\n }, this);\n });\n\n rootElement.on(event + '.ember', '[data-ember-action]', function(evt) {\n return Ember.handleErrors(function() {\n var actionId = Ember.$(evt.currentTarget).attr('data-ember-action'),\n action = Ember.Handlebars.ActionHelper.registeredActions[actionId];\n\n // We have to check for action here since in some cases, jQuery will trigger\n // an event on `removeChild` (i.e. focusout) after we've already torn down the\n // action handlers for the view.\n if (action && action.eventName === eventName) {\n return action.handler(evt);\n }\n }, this);\n });\n },\n\n _findNearestEventManager: function(view, eventName) {\n var manager = null;\n\n while (view) {\n manager = get(view, 'eventManager');\n if (manager && manager[eventName]) { break; }\n\n view = get(view, 'parentView');\n }\n\n return manager;\n },\n\n _dispatchEvent: function(object, evt, eventName, view) {\n var result = true;\n\n var handler = object[eventName];\n if (Ember.typeOf(handler) === 'function') {\n result = Ember.run(function() {\n return handler.call(object, evt, view);\n });\n // Do not preventDefault in eventManagers.\n evt.stopPropagation();\n }\n else {\n result = this._bubbleEvent(view, evt, eventName);\n }\n\n return result;\n },\n\n _bubbleEvent: function(view, evt, eventName) {\n return Ember.run(function() {\n return view.handleEvent(eventName, evt);\n });\n },\n\n destroy: function() {\n var rootElement = get(this, 'rootElement');\n Ember.$(rootElement).off('.ember', '**').removeClass('ember-application');\n return this._super();\n }\n});\n\n})();\n//@ sourceURL=ember-views/system/event_dispatcher");minispade.register('ember-views/system/ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n// Add a new named queue for rendering views that happens\n// after bindings have synced, and a queue for scheduling actions\n// that that should occur after view rendering.\nvar queues = Ember.run.queues,\n indexOf = Ember.ArrayPolyfills.indexOf;\nqueues.splice(indexOf.call(queues, 'actions')+1, 0, 'render', 'afterRender');\n\n})();\n//@ sourceURL=ember-views/system/ext");minispade.register('ember-views/system/jquery_ext', "(function() {/**\n@module ember\n@submodule ember-views\n*/\nif (Ember.$) {\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents\n var dragEvents = Ember.String.w('dragstart drag dragenter dragleave dragover drop dragend');\n\n // Copies the `dataTransfer` property from a browser event object onto the\n // jQuery event object for the specified events\n Ember.EnumerableUtils.forEach(dragEvents, function(eventName) {\n Ember.$.event.fixHooks[eventName] = { props: ['dataTransfer'] };\n });\n}\n\n})();\n//@ sourceURL=ember-views/system/jquery_ext");minispade.register('ember-views/system/render_buffer', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar ClassSet = function() {\n this.seen = {};\n this.list = [];\n};\n\nClassSet.prototype = {\n add: function(string) {\n if (string in this.seen) { return; }\n this.seen[string] = true;\n\n this.list.push(string);\n },\n\n toDOM: function() {\n return this.list.join(\" \");\n }\n};\n\nvar BAD_TAG_NAME_TEST_REGEXP = /[^a-zA-Z0-9\\-]/;\nvar BAD_TAG_NAME_REPLACE_REGEXP = /[^a-zA-Z0-9\\-]/g;\n\nfunction stripTagName(tagName) {\n if (!tagName) {\n return tagName;\n }\n\n if (!BAD_TAG_NAME_TEST_REGEXP.test(tagName)) {\n return tagName;\n }\n\n return tagName.replace(BAD_TAG_NAME_REPLACE_REGEXP, '');\n}\n\nvar BAD_CHARS_REGEXP = /&(?!\\w+;)|[<>\"'`]/g;\nvar POSSIBLE_CHARS_REGEXP = /[&<>\"'`]/;\n\nfunction escapeAttribute(value) {\n // Stolen shamelessly from Handlebars\n\n var escape = {\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\",\n \"`\": \"`\"\n };\n\n var escapeChar = function(chr) {\n return escape[chr] || \"&\";\n };\n\n var string = value.toString();\n\n if(!POSSIBLE_CHARS_REGEXP.test(string)) { return string; }\n return string.replace(BAD_CHARS_REGEXP, escapeChar);\n}\n\n// IE 6/7 have bugs arond setting names on inputs during creation.\n// From http://msdn.microsoft.com/en-us/library/ie/ms536389(v=vs.85).aspx:\n// \"To include the NAME attribute at run time on objects created with the createElement method, use the eTag.\"\nvar canSetNameOnInputs = (function() {\n var div = document.createElement('div'),\n el = document.createElement('input');\n\n el.setAttribute('name', 'foo');\n div.appendChild(el);\n\n return !!div.innerHTML.match('foo');\n})();\n\n/**\n `Ember.RenderBuffer` gathers information regarding the a view and generates the\n final representation. `Ember.RenderBuffer` will generate HTML which can be pushed\n to the DOM.\n\n ```javascript\n var buffer = Ember.RenderBuffer('div');\n ```\n\n @class RenderBuffer\n @namespace Ember\n @constructor\n @param {String} tagName tag name (such as 'div' or 'p') used for the buffer\n*/\nEmber.RenderBuffer = function(tagName) {\n return new Ember._RenderBuffer(tagName);\n};\n\nEmber._RenderBuffer = function(tagName) {\n this.tagNames = [tagName || null];\n this.buffer = \"\";\n};\n\nEmber._RenderBuffer.prototype =\n/** @scope Ember.RenderBuffer.prototype */ {\n\n // The root view's element\n _element: null,\n\n _hasElement: true,\n\n /**\n @private\n\n An internal set used to de-dupe class names when `addClass()` is\n used. After each call to `addClass()`, the `classes` property\n will be updated.\n\n @property elementClasses\n @type Array\n @default []\n */\n elementClasses: null,\n\n /**\n Array of class names which will be applied in the class attribute.\n\n You can use `setClasses()` to set this property directly. If you\n use `addClass()`, it will be maintained for you.\n\n @property classes\n @type Array\n @default []\n */\n classes: null,\n\n /**\n The id in of the element, to be applied in the id attribute.\n\n You should not set this property yourself, rather, you should use\n the `id()` method of `Ember.RenderBuffer`.\n\n @property elementId\n @type String\n @default null\n */\n elementId: null,\n\n /**\n A hash keyed on the name of the attribute and whose value will be\n applied to that attribute. For example, if you wanted to apply a\n `data-view=\"Foo.bar\"` property to an element, you would set the\n elementAttributes hash to `{'data-view':'Foo.bar'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `attr()` method of `Ember.RenderBuffer`.\n\n @property elementAttributes\n @type Hash\n @default {}\n */\n elementAttributes: null,\n\n /**\n A hash keyed on the name of the properties and whose value will be\n applied to that property. For example, if you wanted to apply a\n `checked=true` property to an element, you would set the\n elementProperties hash to `{'checked':true}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `prop()` method of `Ember.RenderBuffer`.\n\n @property elementProperties\n @type Hash\n @default {}\n */\n elementProperties: null,\n\n /**\n The tagname of the element an instance of `Ember.RenderBuffer` represents.\n\n Usually, this gets set as the first parameter to `Ember.RenderBuffer`. For\n example, if you wanted to create a `p` tag, then you would call\n\n ```javascript\n Ember.RenderBuffer('p')\n ```\n\n @property elementTag\n @type String\n @default null\n */\n elementTag: null,\n\n /**\n A hash keyed on the name of the style attribute and whose value will\n be applied to that attribute. For example, if you wanted to apply a\n `background-color:black;` style to an element, you would set the\n elementStyle hash to `{'background-color':'black'}`.\n\n You should not maintain this hash yourself, rather, you should use\n the `style()` method of `Ember.RenderBuffer`.\n\n @property elementStyle\n @type Hash\n @default {}\n */\n elementStyle: null,\n\n /**\n Nested `RenderBuffers` will set this to their parent `RenderBuffer`\n instance.\n\n @property parentBuffer\n @type Ember._RenderBuffer\n */\n parentBuffer: null,\n\n /**\n Adds a string of HTML to the `RenderBuffer`.\n\n @method push\n @param {String} string HTML to push into the buffer\n @chainable\n */\n push: function(string) {\n this.buffer += string;\n return this;\n },\n\n /**\n Adds a class to the buffer, which will be rendered to the class attribute.\n\n @method addClass\n @param {String} className Class name to add to the buffer\n @chainable\n */\n addClass: function(className) {\n // lazily create elementClasses\n this.elementClasses = (this.elementClasses || new ClassSet());\n this.elementClasses.add(className);\n this.classes = this.elementClasses.list;\n\n return this;\n },\n\n setClasses: function(classNames) {\n this.classes = classNames;\n },\n\n /**\n Sets the elementID to be used for the element.\n\n @method id\n @param {String} id\n @chainable\n */\n id: function(id) {\n this.elementId = id;\n return this;\n },\n\n // duck type attribute functionality like jQuery so a render buffer\n // can be used like a jQuery object in attribute binding scenarios.\n\n /**\n Adds an attribute which will be rendered to the element.\n\n @method attr\n @param {String} name The name of the attribute\n @param {String} value The value to add to the attribute\n @chainable\n @return {Ember.RenderBuffer|String} this or the current attribute value\n */\n attr: function(name, value) {\n var attributes = this.elementAttributes = (this.elementAttributes || {});\n\n if (arguments.length === 1) {\n return attributes[name];\n } else {\n attributes[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an attribute from the list of attributes to render.\n\n @method removeAttr\n @param {String} name The name of the attribute\n @chainable\n */\n removeAttr: function(name) {\n var attributes = this.elementAttributes;\n if (attributes) { delete attributes[name]; }\n\n return this;\n },\n\n /**\n Adds an property which will be rendered to the element.\n\n @method prop\n @param {String} name The name of the property\n @param {String} value The value to add to the property\n @chainable\n @return {Ember.RenderBuffer|String} this or the current property value\n */\n prop: function(name, value) {\n var properties = this.elementProperties = (this.elementProperties || {});\n\n if (arguments.length === 1) {\n return properties[name];\n } else {\n properties[name] = value;\n }\n\n return this;\n },\n\n /**\n Remove an property from the list of properties to render.\n\n @method removeProp\n @param {String} name The name of the property\n @chainable\n */\n removeProp: function(name) {\n var properties = this.elementProperties;\n if (properties) { delete properties[name]; }\n\n return this;\n },\n\n /**\n Adds a style to the style attribute which will be rendered to the element.\n\n @method style\n @param {String} name Name of the style\n @param {String} value\n @chainable\n */\n style: function(name, value) {\n this.elementStyle = (this.elementStyle || {});\n\n this.elementStyle[name] = value;\n return this;\n },\n\n begin: function(tagName) {\n this.tagNames.push(tagName || null);\n return this;\n },\n\n pushOpeningTag: function() {\n var tagName = this.currentTagName();\n if (!tagName) { return; }\n\n if (this._hasElement && !this._element && this.buffer.length === 0) {\n this._element = this.generateElement();\n return;\n }\n\n var buffer = this.buffer,\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n attr, prop;\n\n buffer += '<' + stripTagName(tagName);\n\n if (id) {\n buffer += ' id=\"' + escapeAttribute(id) + '\"';\n this.elementId = null;\n }\n if (classes) {\n buffer += ' class=\"' + escapeAttribute(classes.join(' ')) + '\"';\n this.classes = null;\n }\n\n if (style) {\n buffer += ' style=\"';\n\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n buffer += prop + ':' + escapeAttribute(style[prop]) + ';';\n }\n }\n\n buffer += '\"';\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n buffer += ' ' + attr + '=\"' + escapeAttribute(attrs[attr]) + '\"';\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n var value = props[prop];\n if (value || typeof(value) === 'number') {\n if (value === true) {\n buffer += ' ' + prop + '=\"' + prop + '\"';\n } else {\n buffer += ' ' + prop + '=\"' + escapeAttribute(props[prop]) + '\"';\n }\n }\n }\n }\n\n this.elementProperties = null;\n }\n\n buffer += '>';\n this.buffer = buffer;\n },\n\n pushClosingTag: function() {\n var tagName = this.tagNames.pop();\n if (tagName) { this.buffer += '</' + stripTagName(tagName) + '>'; }\n },\n\n currentTagName: function() {\n return this.tagNames[this.tagNames.length-1];\n },\n\n generateElement: function() {\n var tagName = this.tagNames.pop(), // pop since we don't need to close\n id = this.elementId,\n classes = this.classes,\n attrs = this.elementAttributes,\n props = this.elementProperties,\n style = this.elementStyle,\n styleBuffer = '', attr, prop, tagString;\n\n if (attrs && attrs.name && !canSetNameOnInputs) {\n // IE allows passing a tag to createElement. See note on `canSetNameOnInputs` above as well.\n tagString = '<'+stripTagName(tagName)+' name=\"'+escapeAttribute(attrs.name)+'\">';\n } else {\n tagString = tagName;\n }\n\n var element = document.createElement(tagString),\n $element = Ember.$(element);\n\n if (id) {\n $element.attr('id', id);\n this.elementId = null;\n }\n if (classes) {\n $element.attr('class', classes.join(' '));\n this.classes = null;\n }\n\n if (style) {\n for (prop in style) {\n if (style.hasOwnProperty(prop)) {\n styleBuffer += (prop + ':' + style[prop] + ';');\n }\n }\n\n $element.attr('style', styleBuffer);\n\n this.elementStyle = null;\n }\n\n if (attrs) {\n for (attr in attrs) {\n if (attrs.hasOwnProperty(attr)) {\n $element.attr(attr, attrs[attr]);\n }\n }\n\n this.elementAttributes = null;\n }\n\n if (props) {\n for (prop in props) {\n if (props.hasOwnProperty(prop)) {\n $element.prop(prop, props[prop]);\n }\n }\n\n this.elementProperties = null;\n }\n\n return element;\n },\n\n /**\n @method element\n @return {DOMElement} The element corresponding to the generated HTML\n of this buffer\n */\n element: function() {\n var html = this.innerString();\n\n if (html) {\n this._element = Ember.ViewUtils.setInnerHTML(this._element, html);\n }\n\n return this._element;\n },\n\n /**\n Generates the HTML content for this buffer.\n\n @method string\n @return {String} The generated HTML\n */\n string: function() {\n if (this._hasElement && this._element) {\n // Firefox versions < 11 do not have support for element.outerHTML.\n var thisElement = this.element(), outerHTML = thisElement.outerHTML;\n if (typeof outerHTML === 'undefined') {\n return Ember.$('<div/>').append(thisElement).html();\n }\n return outerHTML;\n } else {\n return this.innerString();\n }\n },\n\n innerString: function() {\n return this.buffer;\n }\n};\n\n})();\n//@ sourceURL=ember-views/system/render_buffer");minispade.register('ember-views/system/utils', "(function() {/**\n@module ember\n@submodule ember-views\n*/\n\n/* BEGIN METAMORPH HELPERS */\n\n// Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n// is a \"zero-scope\" element. This problem can be worked around by making\n// the first node an invisible text node. We, like Modernizr, use ­\n\nvar needsShy = this.document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n})();\n\n// IE 8 (and likely earlier) likes to move whitespace preceeding\n// a script tag to appear after it. This means that we can\n// accidentally remove whitespace when updating a morph.\nvar movesWhitespace = this.document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n})();\n\n// Use this to find children by ID instead of using jQuery\nvar findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n};\n\nvar setInnerHTMLWithoutFix = function(element, html) {\n if (needsShy) {\n html = '­' + html;\n }\n\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n\n if (needsShy) {\n var shyElement = element.firstChild;\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n};\n\n/* END METAMORPH HELPERS */\n\n\nvar innerHTMLTags = {};\nvar canSetInnerHTML = function(tagName) {\n if (innerHTMLTags[tagName] !== undefined) {\n return innerHTMLTags[tagName];\n }\n\n var canSet = true;\n\n // IE 8 and earlier don't allow us to do innerHTML on select\n if (tagName.toLowerCase() === 'select') {\n var el = document.createElement('select');\n setInnerHTMLWithoutFix(el, '<option value=\"test\">Test</option>');\n canSet = el.options.length === 1;\n }\n\n innerHTMLTags[tagName] = canSet;\n\n return canSet;\n};\n\nvar setInnerHTML = function(element, html) {\n var tagName = element.tagName;\n\n if (canSetInnerHTML(tagName)) {\n setInnerHTMLWithoutFix(element, html);\n } else {\n // Firefox versions < 11 do not have support for element.outerHTML.\n var outerHTML = element.outerHTML || new XMLSerializer().serializeToString(element);\n Ember.assert(\"Can't set innerHTML on \"+element.tagName+\" in this browser\", outerHTML);\n\n var startTag = outerHTML.match(new RegExp(\"<\"+tagName+\"([^>]*)>\", 'i'))[0],\n endTag = '</'+tagName+'>';\n\n var wrapper = document.createElement('div');\n setInnerHTMLWithoutFix(wrapper, startTag + html + endTag);\n element = wrapper.firstChild;\n while (element.tagName !== tagName) {\n element = element.nextSibling;\n }\n }\n\n return element;\n};\n\nfunction isSimpleClick(event) {\n var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,\n secondaryClick = event.which > 1; // IE9 may return undefined\n\n return !modifier && !secondaryClick;\n}\n\nEmber.ViewUtils = {\n setInnerHTML: setInnerHTML,\n isSimpleClick: isSimpleClick\n};\n\n})();\n//@ sourceURL=ember-views/system/utils");minispade.register('ember-views/views', "(function() {minispade.require(\"ember-views/views/view\");\nminispade.require(\"ember-views/views/states\");\nminispade.require(\"ember-views/views/container_view\");\nminispade.require(\"ember-views/views/collection_view\");\nminispade.require(\"ember-views/views/component\");\n\n})();\n//@ sourceURL=ember-views/views");minispade.register('ember-views/views/collection_view', "(function() {minispade.require('ember-views/views/container_view');\nminispade.require('ember-runtime/system/string');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;\n\n/**\n `Ember.CollectionView` is an `Ember.View` descendent responsible for managing\n a collection (an array or array-like object) by maintaining a child view object\n and associated DOM representation for each item in the array and ensuring\n that child views and their associated rendered HTML are updated when items in\n the array are added, removed, or replaced.\n\n ## Setting content\n\n The managed collection of objects is referenced as the `Ember.CollectionView`\n instance's `content` property.\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n content: ['A', 'B','C']\n })\n ```\n\n The view for each item in the collection will have its `content` property set\n to the item.\n\n ## Specifying itemViewClass\n\n By default the view class for each item in the managed collection will be an\n instance of `Ember.View`. You can supply a different class by setting the\n `CollectionView`'s `itemViewClass` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n someItemsView = Ember.CollectionView.create({\n classNames: ['a-collection'],\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n someItemsView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view a-collection\">\n <div class=\"ember-view\">the letter: A</div>\n <div class=\"ember-view\">the letter: B</div>\n <div class=\"ember-view\">the letter: C</div>\n </div>\n ```\n\n ## Automatic matching of parent/child tagNames\n\n Setting the `tagName` property of a `CollectionView` to any of\n \"ul\", \"ol\", \"table\", \"thead\", \"tbody\", \"tfoot\", \"tr\", or \"select\" will result\n in the item views receiving an appropriately matched `tagName` property.\n\n Given an empty `<body>` and the following code:\n\n ```javascript\n anUndorderedListView = Ember.CollectionView.create({\n tagName: 'ul',\n content: ['A','B','C'],\n itemViewClass: Ember.View.extend({\n template: Ember.Handlebars.compile(\"the letter: {{view.content}}\")\n })\n });\n\n anUndorderedListView.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <ul class=\"ember-view a-collection\">\n <li class=\"ember-view\">the letter: A</li>\n <li class=\"ember-view\">the letter: B</li>\n <li class=\"ember-view\">the letter: C</li>\n </ul>\n ```\n\n Additional `tagName` pairs can be provided by adding to\n `Ember.CollectionView.CONTAINER_MAP `\n\n ```javascript\n Ember.CollectionView.CONTAINER_MAP['article'] = 'section'\n ```\n\n ## Programatic creation of child views\n\n For cases where additional customization beyond the use of a single\n `itemViewClass` or `tagName` matching is required CollectionView's\n `createChildView` method can be overidden:\n\n ```javascript\n CustomCollectionView = Ember.CollectionView.extend({\n createChildView: function(viewClass, attrs) {\n if (attrs.content.kind == 'album') {\n viewClass = App.AlbumView;\n } else {\n viewClass = App.SongView;\n }\n return this._super(viewClass, attrs);\n }\n });\n ```\n\n ## Empty View\n\n You can provide an `Ember.View` subclass to the `Ember.CollectionView`\n instance as its `emptyView` property. If the `content` property of a\n `CollectionView` is set to `null` or an empty array, an instance of this view\n will be the `CollectionView`s only child.\n\n ```javascript\n aListWithNothing = Ember.CollectionView.create({\n classNames: ['nothing']\n content: null,\n emptyView: Ember.View.extend({\n template: Ember.Handlebars.compile(\"The collection is empty\")\n })\n });\n\n aListWithNothing.appendTo('body');\n ```\n\n Will result in the following HTML structure\n\n ```html\n <div class=\"ember-view nothing\">\n <div class=\"ember-view\">\n The collection is empty\n </div>\n </div>\n ```\n\n ## Adding and Removing items\n\n The `childViews` property of a `CollectionView` should not be directly\n manipulated. Instead, add, remove, replace items from its `content` property.\n This will trigger appropriate changes to its rendered HTML.\n\n\n @class CollectionView\n @namespace Ember\n @extends Ember.ContainerView\n @since Ember 0.9\n*/\nEmber.CollectionView = Ember.ContainerView.extend(/** @scope Ember.CollectionView.prototype */ {\n\n /**\n A list of items to be displayed by the `Ember.CollectionView`.\n\n @property content\n @type Ember.Array\n @default null\n */\n content: null,\n\n /**\n @private\n\n This provides metadata about what kind of empty view class this\n collection would like if it is being instantiated from another\n system (like Handlebars)\n\n @property emptyViewClass\n */\n emptyViewClass: Ember.View,\n\n /**\n An optional view to display if content is set to an empty array.\n\n @property emptyView\n @type Ember.View\n @default null\n */\n emptyView: null,\n\n /**\n @property itemViewClass\n @type Ember.View\n @default Ember.View\n */\n itemViewClass: Ember.View,\n\n /**\n Setup a CollectionView\n\n @method init\n */\n init: function() {\n var ret = this._super();\n this._contentDidChange();\n return ret;\n },\n\n /**\n @private\n\n Invoked when the content property is about to change. Notifies observers that the\n entire array content will change.\n\n @method _contentWillChange\n */\n _contentWillChange: Ember.beforeObserver('content', function() {\n var content = this.get('content');\n\n if (content) { content.removeArrayObserver(this); }\n var len = content ? get(content, 'length') : 0;\n this.arrayWillChange(content, 0, len);\n }),\n\n /**\n @private\n\n Check to make sure that the content has changed, and if so,\n update the children directly. This is always scheduled\n asynchronously, to allow the element to be created before\n bindings have synchronized and vice versa.\n\n @method _contentDidChange\n */\n _contentDidChange: Ember.observer('content', function() {\n var content = get(this, 'content');\n\n if (content) {\n this._assertArrayLike(content);\n content.addArrayObserver(this);\n }\n\n var len = content ? get(content, 'length') : 0;\n this.arrayDidChange(content, 0, null, len);\n }),\n\n /**\n @private\n\n Ensure that the content implements Ember.Array\n\n @method _assertArrayLike\n */\n _assertArrayLike: function(content) {\n Ember.assert(fmt(\"an Ember.CollectionView's content must implement Ember.Array. You passed %@\", [content]), Ember.Array.detect(content));\n },\n\n /**\n Removes the content and content observers.\n\n @method destroy\n */\n destroy: function() {\n if (!this._super()) { return; }\n\n var content = get(this, 'content');\n if (content) { content.removeArrayObserver(this); }\n\n if (this._createdEmptyView) {\n this._createdEmptyView.destroy();\n }\n\n return this;\n },\n\n /**\n Called when a mutation to the underlying content array will occur.\n\n This method will remove any views that are no longer in the underlying\n content array.\n\n Invokes whenever the content array itself will change.\n\n @method arrayWillChange\n @param {Array} content the managed collection of objects\n @param {Number} start the index at which the changes will occurr\n @param {Number} removed number of object to be removed from content\n */\n arrayWillChange: function(content, start, removedCount) {\n // If the contents were empty before and this template collection has an\n // empty view remove it now.\n var emptyView = get(this, 'emptyView');\n if (emptyView && emptyView instanceof Ember.View) {\n emptyView.removeFromParent();\n }\n\n // Loop through child views that correspond with the removed items.\n // Note that we loop from the end of the array to the beginning because\n // we are mutating it as we go.\n var childViews = this._childViews, childView, idx, len;\n\n len = this._childViews.length;\n\n var removingAll = removedCount === len;\n\n if (removingAll) {\n this.currentState.empty(this);\n this.invokeRecursively(function(view) {\n view.removedFromDOM = true;\n }, false);\n }\n\n for (idx = start + removedCount - 1; idx >= start; idx--) {\n childView = childViews[idx];\n childView.destroy();\n }\n },\n\n /**\n Called when a mutation to the underlying content array occurs.\n\n This method will replay that mutation against the views that compose the\n `Ember.CollectionView`, ensuring that the view reflects the model.\n\n This array observer is added in `contentDidChange`.\n\n @method arrayDidChange\n @param {Array} content the managed collection of objects\n @param {Number} start the index at which the changes occurred\n @param {Number} removed number of object removed from content\n @param {Number} added number of object added to content\n */\n arrayDidChange: function(content, start, removed, added) {\n var addedViews = [], view, item, idx, len, itemViewClass,\n emptyView;\n\n len = content ? get(content, 'length') : 0;\n\n if (len) {\n itemViewClass = get(this, 'itemViewClass');\n\n if ('string' === typeof itemViewClass) {\n itemViewClass = get(itemViewClass) || itemViewClass;\n }\n\n Ember.assert(fmt(\"itemViewClass must be a subclass of Ember.View, not %@\", [itemViewClass]), 'string' === typeof itemViewClass || Ember.View.detect(itemViewClass));\n\n for (idx = start; idx < start+added; idx++) {\n item = content.objectAt(idx);\n\n view = this.createChildView(itemViewClass, {\n content: item,\n contentIndex: idx\n });\n\n addedViews.push(view);\n }\n } else {\n emptyView = get(this, 'emptyView');\n\n if (!emptyView) { return; }\n\n if ('string' === typeof emptyView) {\n emptyView = get(emptyView) || emptyView;\n }\n\n emptyView = this.createChildView(emptyView);\n addedViews.push(emptyView);\n set(this, 'emptyView', emptyView);\n\n if (Ember.CoreView.detect(emptyView)) {\n this._createdEmptyView = emptyView;\n }\n }\n\n this.replace(start, 0, addedViews);\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n The tag name for the view will be set to the tagName of the viewClass\n passed in.\n\n @method createChildView\n @param {Class} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n view = this._super(view, attrs);\n\n var itemTagName = get(view, 'tagName');\n\n if (itemTagName === null || itemTagName === undefined) {\n itemTagName = Ember.CollectionView.CONTAINER_MAP[get(this, 'tagName')];\n set(view, 'tagName', itemTagName);\n }\n\n return view;\n }\n});\n\n/**\n A map of parent tags to their default child tags. You can add\n additional parent tags if you want collection views that use\n a particular parent tag to default to a child tag.\n\n @property CONTAINER_MAP\n @type Hash\n @static\n @final\n*/\nEmber.CollectionView.CONTAINER_MAP = {\n ul: 'li',\n ol: 'li',\n table: 'tr',\n thead: 'tr',\n tbody: 'tr',\n tfoot: 'tr',\n tr: 'td',\n select: 'option'\n};\n\n})();\n//@ sourceURL=ember-views/views/collection_view");minispade.register('ember-views/views/component', "(function() {minispade.require(\"ember-views/views/view\");\n\nvar get = Ember.get, set = Ember.set, isNone = Ember.isNone,\n a_slice = Array.prototype.slice;\n\n\n/**\n@module ember\n@submodule ember-views\n*/\n\n/**\n An `Ember.Component` is a view that is completely\n isolated. Property access in its templates go\n to the view object and actions are targeted at\n the view object. There is no access to the\n surrounding context or outer controller; all\n contextual information is passed in.\n\n The easiest way to create an `Ember.Component` is via\n a template. If you name a template\n `components/my-foo`, you will be able to use\n `{{my-foo}}` in other templates, which will make\n an instance of the isolated component.\n\n ```html\n {{app-profile person=currentUser}}\n ```\n\n ```html\n <!-- app-profile template -->\n <h1>{{person.title}}</h1>\n <img {{bind-attr src=person.avatar}}>\n <p class='signature'>{{person.signature}}</p>\n ```\n\n You can also use `yield` inside a template to\n include the **contents** of the custom tag:\n\n ```html\n {{#app-profile person=currentUser}}\n <p>Admin mode</p>\n {{/app-profile}}\n ```\n\n ```html\n <!-- app-profile template -->\n <h1>{{person.title}}</h1>\n {{yield}} <!-- block contents -->\n ```\n\n If you want to customize the component, in order to\n handle events or actions, you implement a subclass\n of `Ember.Component` named after the name of the\n component. Note that `Component` needs to be appended to the name of\n your subclass like `AppProfileComponent`.\n\n For example, you could implement the action\n `hello` for the `app-profile` component:\n\n ```javascript\n App.AppProfileComponent = Ember.Component.extend({\n actions: {\n hello: function(name) {\n console.log(\"Hello\", name);\n }\n }\n });\n ```\n\n And then use it in the component's template:\n\n ```html\n <!-- app-profile template -->\n\n <h1>{{person.title}}</h1>\n {{yield}} <!-- block contents -->\n\n <button {{action 'hello' person.name}}>\n Say Hello to {{person.name}}\n </button>\n ```\n\n Components must have a `-` in their name to avoid\n conflicts with built-in controls that wrap HTML\n elements. This is consistent with the same\n requirement in web components.\n\n @class Component\n @namespace Ember\n @extends Ember.View\n*/\nEmber.Component = Ember.View.extend(Ember.TargetActionSupport, {\n init: function() {\n this._super();\n set(this, 'context', this);\n set(this, 'controller', this);\n },\n\n // during render, isolate keywords\n cloneKeywords: function() {\n return {\n view: this,\n controller: this\n };\n },\n\n _yield: function(context, options) {\n var view = options.data.view,\n parentView = this._parentView,\n template = get(this, 'template');\n\n if (template) {\n Ember.assert(\"A Component must have a parent view in order to yield.\", parentView);\n\n view.appendChild(Ember.View, {\n isVirtual: true,\n tagName: '',\n _contextView: parentView,\n template: template,\n context: get(parentView, 'context'),\n controller: get(parentView, 'controller'),\n templateData: { keywords: parentView.cloneKeywords() }\n });\n }\n },\n\n /**\n If the component is currently inserted into the DOM of a parent view, this\n property will point to the controller of the parent view.\n\n @property targetObject\n @type Ember.Controller\n @default null\n */\n targetObject: Ember.computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n Sends an action to component's controller. A component inherits its\n controller from the context in which it is used.\n\n By default, calling `sendAction()` will send an action with the name\n of the component's `action` property.\n\n For example, if the component had a property `action` with the value\n `\"addItem\"`, calling `sendAction()` would send the `addItem` action\n to the component's controller.\n\n If you provide the `action` argument to `sendAction()`, that key will\n be used to look up the action name.\n\n For example, if the component had a property `playing` with the value\n `didStartPlaying`, calling `sendAction('playing')` would send the\n `didStartPlaying` action to the component's controller.\n\n Whether or not you are using the default action or a named action, if\n the action name is not defined on the component, calling `sendAction()`\n does not have any effect.\n\n For example, if you call `sendAction()` on a component that does not have\n an `action` property defined, no action will be sent to the controller,\n nor will an exception be raised.\n\n You can send a context object with the action by supplying the `context`\n argument. The context will be supplied as the first argument in the\n target's action method. Example:\n\n ```javascript\n App.MyTreeComponent = Ember.Component.extend({\n click: function() {\n this.sendAction('didClickTreeNode', this.get('node'));\n }\n });\n\n App.CategoriesController = Ember.Controller.extend({\n actions: {\n didClickCategory: function(category) {\n //Do something with the node/category that was clicked\n }\n }\n });\n ```\n\n ```handlebars\n {{! categories.hbs}}\n {{my-tree didClickTreeNode='didClickCategory'}}\n ```\n\n @method sendAction\n @param [action] {String} the action to trigger\n @param [context] {*} a context to send with the action\n */\n sendAction: function(action) {\n var actionName,\n contexts = a_slice.call(arguments, 1);\n\n // Send the default action\n if (action === undefined) {\n actionName = get(this, 'action');\n Ember.assert(\"The default action was triggered on the component \" + this.toString() + \", but the action name (\" + actionName + \") was not a string.\", isNone(actionName) || typeof actionName === 'string');\n } else {\n actionName = get(this, action);\n Ember.assert(\"The \" + action + \" action was triggered on the component \" + this.toString() + \", but the action name (\" + actionName + \") was not a string.\", isNone(actionName) || typeof actionName === 'string');\n }\n\n // If no action name for that action could be found, just abort.\n if (actionName === undefined) { return; }\n\n this.triggerAction({\n action: actionName,\n actionContext: contexts\n });\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/component");minispade.register('ember-views/views/container_view', "(function() {minispade.require('ember-views/views/view');\nminispade.require('ember-views/views/states');\nminispade.require('ember-runtime/mixins/mutable_array');\n\nvar states = Ember.View.cloneStates(Ember.View.states);\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar forEach = Ember.EnumerableUtils.forEach;\nvar ViewCollection = Ember._ViewCollection;\n\n/**\n A `ContainerView` is an `Ember.View` subclass that implements `Ember.MutableArray`\n allowing programatic management of its child views.\n\n ## Setting Initial Child Views\n\n The initial array of child views can be set in one of two ways. You can\n provide a `childViews` property at creation time that contains instance of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: [Ember.View.create(), Ember.View.create()]\n });\n ```\n\n You can also provide a list of property names whose values are instances of\n `Ember.View`:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', 'bView', 'cView'],\n aView: Ember.View.create(),\n bView: Ember.View.create(),\n cView: Ember.View.create()\n });\n ```\n\n The two strategies can be combined:\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n childViews: ['aView', Ember.View.create()],\n aView: Ember.View.create()\n });\n ```\n\n Each child view's rendering will be inserted into the container's rendered\n HTML in the same order as its position in the `childViews` property.\n\n ## Adding and Removing Child Views\n\n The container view implements `Ember.MutableArray` allowing programatic management of its child views.\n\n To remove a view, pass that view into a `removeObject` call on the container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Removing a view\n\n ```javascript\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.removeObject(aContainer.get('bView'));\n aContainer.toArray(); // [aContainer.aView]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n </div>\n ```\n\n Similarly, adding a child view is accomplished by adding `Ember.View` instances to the\n container view.\n\n Given an empty `<body>` the following code\n\n ```javascript\n aContainer = Ember.ContainerView.create({\n classNames: ['the-container'],\n childViews: ['aView', 'bView'],\n aView: Ember.View.create({\n template: Ember.Handlebars.compile(\"A\")\n }),\n bView: Ember.View.create({\n template: Ember.Handlebars.compile(\"B\")\n })\n });\n\n aContainer.appendTo('body');\n ```\n\n Results in the HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n </div>\n ```\n\n Adding a view\n\n ```javascript\n AnotherViewClass = Ember.View.extend({\n template: Ember.Handlebars.compile(\"Another view\")\n });\n\n aContainer.toArray(); // [aContainer.aView, aContainer.bView]\n aContainer.pushObject(AnotherViewClass.create());\n aContainer.toArray(); // [aContainer.aView, aContainer.bView, <AnotherViewClass instance>]\n ```\n\n Will result in the following HTML\n\n ```html\n <div class=\"ember-view the-container\">\n <div class=\"ember-view\">A</div>\n <div class=\"ember-view\">B</div>\n <div class=\"ember-view\">Another view</div>\n </div>\n ```\n\n ## Templates and Layout\n\n A `template`, `templateName`, `defaultTemplate`, `layout`, `layoutName` or\n `defaultLayout` property on a container view will not result in the template\n or layout being rendered. The HTML contents of a `Ember.ContainerView`'s DOM\n representation will only be the rendered HTML of its child views.\n\n @class ContainerView\n @namespace Ember\n @extends Ember.View\n*/\nEmber.ContainerView = Ember.View.extend(Ember.MutableArray, {\n states: states,\n\n init: function() {\n this._super();\n\n var childViews = get(this, 'childViews');\n\n // redefine view's childViews property that was obliterated\n Ember.defineProperty(this, 'childViews', Ember.View.childViewsProperty);\n\n var _childViews = this._childViews;\n\n forEach(childViews, function(viewName, idx) {\n var view;\n\n if ('string' === typeof viewName) {\n view = get(this, viewName);\n view = this.createChildView(view);\n set(this, viewName, view);\n } else {\n view = this.createChildView(viewName);\n }\n\n _childViews[idx] = view;\n }, this);\n\n var currentView = get(this, 'currentView');\n if (currentView) {\n if (!_childViews.length) { _childViews = this._childViews = this._childViews.slice(); }\n _childViews.push(this.createChildView(currentView));\n }\n },\n\n replace: function(idx, removedCount, addedViews) {\n var addedCount = addedViews ? get(addedViews, 'length') : 0;\n var self = this;\n Ember.assert(\"You can't add a child to a container that is already a child of another view\", Ember.A(addedViews).every(function(item) { return !get(item, '_parentView') || get(item, '_parentView') === self; }));\n\n this.arrayContentWillChange(idx, removedCount, addedCount);\n this.childViewsWillChange(this._childViews, idx, removedCount);\n\n if (addedCount === 0) {\n this._childViews.splice(idx, removedCount) ;\n } else {\n var args = [idx, removedCount].concat(addedViews);\n if (addedViews.length && !this._childViews.length) { this._childViews = this._childViews.slice(); }\n this._childViews.splice.apply(this._childViews, args);\n }\n\n this.arrayContentDidChange(idx, removedCount, addedCount);\n this.childViewsDidChange(this._childViews, idx, removedCount, addedCount);\n\n return this;\n },\n\n objectAt: function(idx) {\n return this._childViews[idx];\n },\n\n length: Ember.computed(function () {\n return this._childViews.length;\n }).volatile(),\n\n /**\n @private\n\n Instructs each child view to render to the passed render buffer.\n\n @method render\n @param {Ember.RenderBuffer} buffer the buffer to render to\n */\n render: function(buffer) {\n this.forEachChildView(function(view) {\n view.renderToBuffer(buffer);\n });\n },\n\n instrumentName: 'container',\n\n /**\n @private\n\n When a child view is removed, destroy its element so that\n it is removed from the DOM.\n\n The array observer that triggers this action is set up in the\n `renderToBuffer` method.\n\n @method childViewsWillChange\n @param {Ember.Array} views the child views array before mutation\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n **/\n childViewsWillChange: function(views, start, removed) {\n this.propertyWillChange('childViews');\n\n if (removed > 0) {\n var changedViews = views.slice(start, start+removed);\n // transition to preRender before clearing parentView\n this.currentState.childViewsWillChange(this, views, start, removed);\n this.initializeViews(changedViews, null, null);\n }\n },\n\n removeChild: function(child) {\n this.removeObject(child);\n return this;\n },\n\n /**\n @private\n\n When a child view is added, make sure the DOM gets updated appropriately.\n\n If the view has already rendered an element, we tell the child view to\n create an element and insert it into the DOM. If the enclosing container\n view has already written to a buffer, but not yet converted that buffer\n into an element, we insert the string representation of the child into the\n appropriate place in the buffer.\n\n @method childViewsDidChange\n @param {Ember.Array} views the array of child views afte the mutation has occurred\n @param {Number} start the start position of the mutation\n @param {Number} removed the number of child views removed\n @param {Number} the number of child views added\n */\n childViewsDidChange: function(views, start, removed, added) {\n if (added > 0) {\n var changedViews = views.slice(start, start+added);\n this.initializeViews(changedViews, this, get(this, 'templateData'));\n this.currentState.childViewsDidChange(this, views, start, added);\n }\n this.propertyDidChange('childViews');\n },\n\n initializeViews: function(views, parentView, templateData) {\n forEach(views, function(view) {\n set(view, '_parentView', parentView);\n\n if (!view.container && parentView) {\n set(view, 'container', parentView.container);\n }\n\n if (!get(view, 'templateData')) {\n set(view, 'templateData', templateData);\n }\n });\n },\n\n currentView: null,\n\n _currentViewWillChange: Ember.beforeObserver('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n currentView.destroy();\n }\n }),\n\n _currentViewDidChange: Ember.observer('currentView', function() {\n var currentView = get(this, 'currentView');\n if (currentView) {\n Ember.assert(\"You tried to set a current view that already has a parent. Make sure you don't have multiple outlets in the same view.\", !get(currentView, '_parentView'));\n this.pushObject(currentView);\n }\n }),\n\n _ensureChildrenAreInDOM: function () {\n this.currentState.ensureChildrenAreInDOM(this);\n }\n});\n\nEmber.merge(states._default, {\n childViewsWillChange: Ember.K,\n childViewsDidChange: Ember.K,\n ensureChildrenAreInDOM: Ember.K\n});\n\nEmber.merge(states.inBuffer, {\n childViewsDidChange: function(parentView, views, start, added) {\n throw new Ember.Error('You cannot modify child views while in the inBuffer state');\n }\n});\n\nEmber.merge(states.hasElement, {\n childViewsWillChange: function(view, views, start, removed) {\n for (var i=start; i<start+removed; i++) {\n views[i].remove();\n }\n },\n\n childViewsDidChange: function(view, views, start, added) {\n Ember.run.scheduleOnce('render', view, '_ensureChildrenAreInDOM');\n },\n\n ensureChildrenAreInDOM: function(view) {\n var childViews = view._childViews, i, len, childView, previous, buffer, viewCollection = new ViewCollection();\n\n for (i = 0, len = childViews.length; i < len; i++) {\n childView = childViews[i];\n\n if (!buffer) { buffer = Ember.RenderBuffer(); buffer._hasElement = false; }\n\n if (childView.renderToBufferIfNeeded(buffer)) {\n viewCollection.push(childView);\n } else if (viewCollection.length) {\n insertViewCollection(view, viewCollection, previous, buffer);\n buffer = null;\n previous = childView;\n viewCollection.clear();\n } else {\n previous = childView;\n }\n }\n\n if (viewCollection.length) {\n insertViewCollection(view, viewCollection, previous, buffer);\n }\n }\n});\n\nfunction insertViewCollection(view, viewCollection, previous, buffer) {\n viewCollection.triggerRecursively('willInsertElement');\n\n if (previous) {\n previous.domManager.after(previous, buffer.string());\n } else {\n view.domManager.prepend(view, buffer.string());\n }\n\n viewCollection.forEach(function(v) {\n v.transitionTo('inDOM');\n v.propertyDidChange('element');\n v.triggerRecursively('didInsertElement');\n });\n}\n\n\n})();\n//@ sourceURL=ember-views/views/container_view");minispade.register('ember-views/views/states', "(function() {minispade.require(\"ember-views/views/states/default\");\nminispade.require(\"ember-views/views/states/pre_render\");\nminispade.require(\"ember-views/views/states/in_buffer\");\nminispade.require(\"ember-views/views/states/in_dom\");\nminispade.require(\"ember-views/views/states/destroying\");\n\nEmber.View.cloneStates = function(from) {\n var into = {};\n\n into._default = {};\n into.preRender = Ember.create(into._default);\n into.destroying = Ember.create(into._default);\n into.inBuffer = Ember.create(into._default);\n into.hasElement = Ember.create(into._default);\n into.inDOM = Ember.create(into.hasElement);\n\n for (var stateName in from) {\n if (!from.hasOwnProperty(stateName)) { continue; }\n Ember.merge(into[stateName], from[stateName]);\n }\n\n return into;\n};\n\n})();\n//@ sourceURL=ember-views/views/states");minispade.register('ember-views/views/states/default', "(function() {minispade.require('ember-views/views/view');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nEmber.View.states._default = {\n // appendChild is only legal while rendering the buffer.\n appendChild: function() {\n throw \"You can't use appendChild outside of the rendering process\";\n },\n\n $: function() {\n return undefined;\n },\n\n getElement: function() {\n return null;\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function() {\n return true; // continue event propagation\n },\n\n destroyElement: function(view) {\n set(view, 'element', null);\n if (view._scheduledInsert) {\n Ember.run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n renderToBufferIfNeeded: function () {\n return false;\n },\n\n rerender: Ember.K,\n invokeObserver: Ember.K\n};\n\n})();\n//@ sourceURL=ember-views/views/states/default");minispade.register('ember-views/views/states/destroying', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar destroyingError = \"You can't call %@ on a view being destroyed\", fmt = Ember.String.fmt;\n\nvar destroying = Ember.View.states.destroying = Ember.create(Ember.View.states._default);\n\nEmber.merge(destroying, {\n appendChild: function() {\n throw fmt(destroyingError, ['appendChild']);\n },\n rerender: function() {\n throw fmt(destroyingError, ['rerender']);\n },\n destroyElement: function() {\n throw fmt(destroyingError, ['destroyElement']);\n },\n empty: function() {\n throw fmt(destroyingError, ['empty']);\n },\n\n setElement: function() {\n throw fmt(destroyingError, [\"set('element', ...)\"]);\n },\n\n renderToBufferIfNeeded: function() {\n return false;\n },\n\n // Since element insertion is scheduled, don't do anything if\n // the view has been destroyed between scheduling and execution\n insertElement: Ember.K\n});\n\n\n})();\n//@ sourceURL=ember-views/views/states/destroying");minispade.register('ember-views/views/states/in_buffer', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar inBuffer = Ember.View.states.inBuffer = Ember.create(Ember.View.states._default);\n\nEmber.merge(inBuffer, {\n $: function(view, sel) {\n // if we don't have an element yet, someone calling this.$() is\n // trying to update an element that isn't in the DOM. Instead,\n // rerender the view to allow the render method to reflect the\n // changes.\n view.rerender();\n return Ember.$();\n },\n\n // when a view is rendered in a buffer, rerendering it simply\n // replaces the existing buffer with a new one\n rerender: function(view) {\n throw new Ember.Error(\"Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.\");\n },\n\n // when a view is rendered in a buffer, appending a child\n // view will render that view and append the resulting\n // buffer into its buffer.\n appendChild: function(view, childView, options) {\n var buffer = view.buffer, _childViews = view._childViews;\n\n childView = view.createChildView(childView, options);\n if (!_childViews.length) { _childViews = view._childViews = _childViews.slice(); }\n _childViews.push(childView);\n\n childView.renderToBuffer(buffer);\n\n view.propertyDidChange('childViews');\n\n return childView;\n },\n\n // when a view is rendered in a buffer, destroying the\n // element will simply destroy the buffer and put the\n // state back into the preRender state.\n destroyElement: function(view) {\n view.clearBuffer();\n var viewCollection = view._notifyWillDestroyElement();\n viewCollection.transitionTo('preRender', false);\n\n return view;\n },\n\n empty: function() {\n Ember.assert(\"Emptying a view in the inBuffer state is not allowed and should not happen under normal circumstances. Most likely there is a bug in your application. This may be due to excessive property change notifications.\");\n },\n\n renderToBufferIfNeeded: function (view, buffer) {\n return false;\n },\n\n // It should be impossible for a rendered view to be scheduled for\n // insertion.\n insertElement: function() {\n throw \"You can't insert an element that has already been rendered\";\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n view.clearBuffer();\n view.transitionTo('hasElement');\n }\n\n return value;\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n});\n\n\n})();\n//@ sourceURL=ember-views/views/states/in_buffer");minispade.register('ember-views/views/states/in_dom', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\n\nvar hasElement = Ember.View.states.hasElement = Ember.create(Ember.View.states._default);\n\nEmber.merge(hasElement, {\n $: function(view, sel) {\n var elem = get(view, 'element');\n return sel ? Ember.$(sel, elem) : Ember.$(elem);\n },\n\n getElement: function(view) {\n var parent = get(view, 'parentView');\n if (parent) { parent = get(parent, 'element'); }\n if (parent) { return view.findElementInParentElement(parent); }\n return Ember.$(\"#\" + get(view, 'elementId'))[0];\n },\n\n setElement: function(view, value) {\n if (value === null) {\n view.transitionTo('preRender');\n } else {\n throw \"You cannot set an element to a non-null value when the element is already in the DOM.\";\n }\n\n return value;\n },\n\n // once the view has been inserted into the DOM, rerendering is\n // deferred to allow bindings to synchronize.\n rerender: function(view) {\n view.triggerRecursively('willClearRender');\n\n view.clearRenderedChildren();\n\n view.domManager.replace(view);\n return view;\n },\n\n // once the view is already in the DOM, destroying it removes it\n // from the DOM, nukes its element, and puts it back into the\n // preRender state if inDOM.\n\n destroyElement: function(view) {\n view._notifyWillDestroyElement();\n view.domManager.remove(view);\n set(view, 'element', null);\n if (view._scheduledInsert) {\n Ember.run.cancel(view._scheduledInsert);\n view._scheduledInsert = null;\n }\n return view;\n },\n\n empty: function(view) {\n var _childViews = view._childViews, len, idx;\n if (_childViews) {\n len = _childViews.length;\n for (idx = 0; idx < len; idx++) {\n _childViews[idx]._notifyWillDestroyElement();\n }\n }\n view.domManager.empty(view);\n },\n\n // Handle events from `Ember.EventDispatcher`\n handleEvent: function(view, eventName, evt) {\n if (view.has(eventName)) {\n // Handler should be able to re-dispatch events, so we don't\n // preventDefault or stopPropagation.\n return view.trigger(eventName, evt);\n } else {\n return true; // continue event propagation\n }\n },\n\n invokeObserver: function(target, observer) {\n observer.call(target);\n }\n});\n\nvar inDOM = Ember.View.states.inDOM = Ember.create(hasElement);\n\nEmber.merge(inDOM, {\n enter: function(view) {\n // Register the view for event handling. This hash is used by\n // Ember.EventDispatcher to dispatch incoming events.\n if (!view.isVirtual) {\n Ember.assert(\"Attempted to register a view with an id already in use: \"+view.elementId, !Ember.View.views[view.elementId]);\n Ember.View.views[view.elementId] = view;\n }\n\n view.addBeforeObserver('elementId', function() {\n throw new Ember.Error(\"Changing a view's elementId after creation is not allowed\");\n });\n },\n\n exit: function(view) {\n if (!this.isVirtual) delete Ember.View.views[view.elementId];\n },\n\n insertElement: function(view, fn) {\n throw \"You can't insert an element into the DOM that has already been inserted\";\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/states/in_dom");minispade.register('ember-views/views/states/pre_render', "(function() {minispade.require('ember-views/views/states/default');\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar preRender = Ember.View.states.preRender = Ember.create(Ember.View.states._default);\n\nEmber.merge(preRender, {\n // a view leaves the preRender state once its element has been\n // created (createElement).\n insertElement: function(view, fn) {\n view.createElement();\n var viewCollection = view.viewHierarchyCollection();\n\n viewCollection.trigger('willInsertElement');\n\n fn.call(view);\n\n // We transition to `inDOM` if the element exists in the DOM\n var element = view.get('element');\n while (element = element.parentNode) {\n if (element === document) {\n viewCollection.transitionTo('inDOM', false);\n viewCollection.trigger('didInsertElement');\n }\n }\n\n },\n\n renderToBufferIfNeeded: function(view, buffer) {\n view.renderToBuffer(buffer);\n return true;\n },\n\n empty: Ember.K,\n\n setElement: function(view, value) {\n if (value !== null) {\n view.transitionTo('hasElement');\n }\n return value;\n }\n});\n\n})();\n//@ sourceURL=ember-views/views/states/pre_render");minispade.register('ember-views/views/view', "(function() {minispade.require(\"ember-views/system/render_buffer\");\n\nvar states = {};\n\n/**\n@module ember\n@submodule ember-views\n*/\n\nvar get = Ember.get, set = Ember.set;\nvar guidFor = Ember.guidFor;\nvar a_forEach = Ember.EnumerableUtils.forEach;\nvar a_addObject = Ember.EnumerableUtils.addObject;\nvar meta = Ember.meta;\n\nvar childViewsProperty = Ember.computed(function() {\n var childViews = this._childViews, ret = Ember.A(), view = this;\n\n a_forEach(childViews, function(view) {\n var currentChildViews;\n if (view.isVirtual) {\n if (currentChildViews = get(view, 'childViews')) {\n ret.pushObjects(currentChildViews);\n }\n } else {\n ret.push(view);\n }\n });\n\n ret.replace = function (idx, removedCount, addedViews) {\n if (view instanceof Ember.ContainerView) {\n Ember.deprecate(\"Manipulating an Ember.ContainerView through its childViews property is deprecated. Please use the ContainerView instance itself as an Ember.MutableArray.\");\n return view.replace(idx, removedCount, addedViews);\n }\n throw new Ember.Error(\"childViews is immutable\");\n };\n\n return ret;\n});\n\nEmber.warn(\"The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.\", Ember.ENV.VIEW_PRESERVES_CONTEXT !== false);\n\n/**\n Global hash of shared templates. This will automatically be populated\n by the build tools so that you can store your Handlebars templates in\n separate files that get loaded into JavaScript at buildtime.\n\n @property TEMPLATES\n @for Ember\n @type Hash\n*/\nEmber.TEMPLATES = {};\n\n/**\n `Ember.CoreView` is an abstract class that exists to give view-like behavior\n to both Ember's main view class `Ember.View` and other classes like\n `Ember._SimpleMetamorphView` that don't need the fully functionaltiy of\n `Ember.View`.\n\n Unless you have specific needs for `CoreView`, you will use `Ember.View`\n in your applications.\n\n @class CoreView\n @namespace Ember\n @extends Ember.Object\n @uses Ember.Evented\n*/\n\nEmber.CoreView = Ember.Object.extend(Ember.Evented, Ember.ActionHandler, {\n isView: true,\n\n states: states,\n\n init: function() {\n this._super();\n this.transitionTo('preRender');\n },\n\n /**\n If the view is currently inserted into the DOM of a parent view, this\n property will point to the parent of the view.\n\n @property parentView\n @type Ember.View\n @default null\n */\n parentView: Ember.computed(function() {\n var parent = this._parentView;\n\n if (parent && parent.isVirtual) {\n return get(parent, 'parentView');\n } else {\n return parent;\n }\n }).property('_parentView'),\n\n state: null,\n\n _parentView: null,\n\n // return the current view, not including virtual views\n concreteView: Ember.computed(function() {\n if (!this.isVirtual) { return this; }\n else { return get(this, 'parentView'); }\n }).property('parentView'),\n\n instrumentName: 'core_view',\n\n instrumentDetails: function(hash) {\n hash.object = this.toString();\n },\n\n /**\n @private\n\n Invoked by the view system when this view needs to produce an HTML\n representation. This method will create a new render buffer, if needed,\n then apply any default attributes, such as class names and visibility.\n Finally, the `render()` method is invoked, which is responsible for\n doing the bulk of the rendering.\n\n You should not need to override this method; instead, implement the\n `template` property, or if you need more control, override the `render`\n method.\n\n @method renderToBuffer\n @param {Ember.RenderBuffer} buffer the render buffer. If no buffer is\n passed, a default buffer, using the current view's `tagName`, will\n be used.\n */\n renderToBuffer: function(parentBuffer, bufferOperation) {\n var name = 'render.' + this.instrumentName,\n details = {};\n\n this.instrumentDetails(details);\n\n return Ember.instrument(name, details, function() {\n return this._renderToBuffer(parentBuffer, bufferOperation);\n }, this);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n // If this is the top-most view, start a new buffer. Otherwise,\n // create a new buffer relative to the original using the\n // provided buffer operation (for example, `insertAfter` will\n // insert a new buffer after the \"parent buffer\").\n var tagName = this.tagName;\n\n if (tagName === null || tagName === undefined) {\n tagName = 'div';\n }\n\n var buffer = this.buffer = parentBuffer && parentBuffer.begin(tagName) || Ember.RenderBuffer(tagName);\n this.transitionTo('inBuffer', false);\n\n this.beforeRender(buffer);\n this.render(buffer);\n this.afterRender(buffer);\n\n return buffer;\n },\n\n /**\n @private\n\n Override the default event firing from `Ember.Evented` to\n also call methods with the given name.\n\n @method trigger\n @param name {String}\n */\n trigger: function(name) {\n this._super.apply(this, arguments);\n var method = this[name];\n if (method) {\n var args = [], i, l;\n for (i = 1, l = arguments.length; i < l; i++) {\n args.push(arguments[i]);\n }\n return method.apply(this, args);\n }\n },\n\n deprecatedSendHandles: function(actionName) {\n return !!this[actionName];\n },\n\n deprecatedSend: function(actionName) {\n var args = [].slice.call(arguments, 1);\n Ember.assert('' + this + \" has the action \" + actionName + \" but it is not a function\", typeof this[actionName] === 'function');\n Ember.deprecate('Action handlers implemented directly on views are deprecated in favor of action handlers on an `actions` object (' + actionName + ' on ' + this + ')', false);\n this[actionName].apply(this, args);\n return;\n },\n\n has: function(name) {\n return Ember.typeOf(this[name]) === 'function' || this._super(name);\n },\n\n destroy: function() {\n var parent = this._parentView;\n\n if (!this._super()) { return; }\n\n // destroy the element -- this will avoid each child view destroying\n // the element over and over again...\n if (!this.removedFromDOM) { this.destroyElement(); }\n\n // remove from parent if found. Don't call removeFromParent,\n // as removeFromParent will try to remove the element from\n // the DOM again.\n if (parent) { parent.removeChild(this); }\n\n this.transitionTo('destroying', false);\n\n return this;\n },\n\n clearRenderedChildren: Ember.K,\n triggerRecursively: Ember.K,\n invokeRecursively: Ember.K,\n transitionTo: Ember.K,\n destroyElement: Ember.K\n});\n\nvar ViewCollection = Ember._ViewCollection = function(initialViews) {\n var views = this.views = initialViews || [];\n this.length = views.length;\n};\n\nViewCollection.prototype = {\n length: 0,\n\n trigger: function(eventName) {\n var views = this.views, view;\n for (var i = 0, l = views.length; i < l; i++) {\n view = views[i];\n if (view.trigger) { view.trigger(eventName); }\n }\n },\n\n triggerRecursively: function(eventName) {\n var views = this.views;\n for (var i = 0, l = views.length; i < l; i++) {\n views[i].triggerRecursively(eventName);\n }\n },\n\n invokeRecursively: function(fn) {\n var views = this.views, view;\n\n for (var i = 0, l = views.length; i < l; i++) {\n view = views[i];\n fn(view);\n }\n },\n\n transitionTo: function(state, children) {\n var views = this.views;\n for (var i = 0, l = views.length; i < l; i++) {\n views[i].transitionTo(state, children);\n }\n },\n\n push: function() {\n this.length += arguments.length;\n var views = this.views;\n return views.push.apply(views, arguments);\n },\n\n objectAt: function(idx) {\n return this.views[idx];\n },\n\n forEach: function(callback) {\n var views = this.views;\n return a_forEach(views, callback);\n },\n\n clear: function() {\n this.length = 0;\n this.views.length = 0;\n }\n};\n\nvar EMPTY_ARRAY = [];\n\n/**\n `Ember.View` is the class in Ember responsible for encapsulating templates of\n HTML content, combining templates with data to render as sections of a page's\n DOM, and registering and responding to user-initiated events.\n\n ## HTML Tag\n\n The default HTML tag name used for a view's DOM representation is `div`. This\n can be customized by setting the `tagName` property. The following view\n class:\n\n ```javascript\n ParagraphView = Ember.View.extend({\n tagName: 'em'\n });\n ```\n\n Would result in instances with the following HTML:\n\n ```html\n <em id=\"ember1\" class=\"ember-view\"></em>\n ```\n\n ## HTML `class` Attribute\n\n The HTML `class` attribute of a view's tag can be set by providing a\n `classNames` property that is set to an array of strings:\n\n ```javascript\n MyView = Ember.View.extend({\n classNames: ['my-class', 'my-other-class']\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view my-class my-other-class\"></div>\n ```\n\n `class` attribute values can also be set by providing a `classNameBindings`\n property set to an array of properties names for the view. The return value\n of these properties will be added as part of the value for the view's `class`\n attribute. These properties can be computed properties:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['propertyA', 'propertyB'],\n propertyA: 'from-a',\n propertyB: function() {\n if (someLogic) { return 'from-b'; }\n }.property()\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view from-a from-b\"></div>\n ```\n\n If the value of a class name binding returns a boolean the property name\n itself will be used as the class name if the property is true. The class name\n will not be added if the value is `false` or `undefined`.\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['hovered'],\n hovered: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view hovered\"></div>\n ```\n\n When using boolean class name bindings you can supply a string value other\n than the property name for use as the `class` HTML attribute by appending the\n preferred value after a \":\" character when defining the binding:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['awesome:so-very-cool'],\n awesome: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view so-very-cool\"></div>\n ```\n\n Boolean value class name bindings whose property names are in a\n camelCase-style format will be converted to a dasherized format:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['isUrgent'],\n isUrgent: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view is-urgent\"></div>\n ```\n\n Class name bindings can also refer to object values that are found by\n traversing a path relative to the view itself:\n\n ```javascript\n MyView = Ember.View.extend({\n classNameBindings: ['messages.empty']\n messages: Ember.Object.create({\n empty: true\n })\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view empty\"></div>\n ```\n\n If you want to add a class name for a property which evaluates to true and\n and a different class name if it evaluates to false, you can pass a binding\n like this:\n\n ```javascript\n // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false\n Ember.View.extend({\n classNameBindings: ['isEnabled:enabled:disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view enabled\"></div>\n ```\n\n When isEnabled is `false`, the resulting HTML reprensentation looks like\n this:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n This syntax offers the convenience to add a class if a property is `false`:\n\n ```javascript\n // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\n Ember.View.extend({\n classNameBindings: ['isEnabled::disabled']\n isEnabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\"></div>\n ```\n\n When the `isEnabled` property on the view is set to `false`, it will result\n in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view disabled\"></div>\n ```\n\n Updates to the the value of a class name binding will result in automatic\n update of the HTML `class` attribute in the view's rendered HTML\n representation. If the value becomes `false` or `undefined` the class name\n will be removed.\n\n Both `classNames` and `classNameBindings` are concatenated properties. See\n [Ember.Object](/api/classes/Ember.Object.html) documentation for more\n information about concatenated properties.\n\n ## HTML Attributes\n\n The HTML attribute section of a view's tag can be set by providing an\n `attributeBindings` property set to an array of property names on the view.\n The return value of these properties will be used as the value of the view's\n HTML associated attribute:\n\n ```javascript\n AnchorView = Ember.View.extend({\n tagName: 'a',\n attributeBindings: ['href'],\n href: 'http://google.com'\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n ```\n\n If the return value of an `attributeBindings` monitored property is a boolean\n the property will follow HTML's pattern of repeating the attribute's name as\n its value:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: true\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <input id=\"ember1\" class=\"ember-view\" disabled=\"disabled\" />\n ```\n\n `attributeBindings` can refer to computed properties:\n\n ```javascript\n MyTextInput = Ember.View.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n disabled: function() {\n if (someLogic) {\n return true;\n } else {\n return false;\n }\n }.property()\n });\n ```\n\n Updates to the the property of an attribute binding will result in automatic\n update of the HTML attribute in the view's rendered HTML representation.\n\n `attributeBindings` is a concatenated property. See [Ember.Object](/api/classes/Ember.Object.html)\n documentation for more information about concatenated properties.\n\n ## Templates\n\n The HTML contents of a view's rendered representation are determined by its\n template. Templates can be any function that accepts an optional context\n parameter and returns a string of HTML that will be inserted within the\n view's tag. Most typically in Ember this function will be a compiled\n `Ember.Handlebars` template.\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('I am the template')\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I am the template</div>\n ```\n\n Within an Ember application is more common to define a Handlebars templates as\n part of a page:\n\n ```html\n <script type='text/x-handlebars' data-template-name='some-template'>\n Hello\n </script>\n ```\n\n And associate it by name using a view's `templateName` property:\n\n ```javascript\n AView = Ember.View.extend({\n templateName: 'some-template'\n });\n ```\n\n Using a value for `templateName` that does not have a Handlebars template\n with a matching `data-template-name` attribute will throw an error.\n\n For views classes that may have a template later defined (e.g. as the block\n portion of a `{{view}}` Handlebars helper call in another template or in\n a subclass), you can provide a `defaultTemplate` property set to compiled\n template function. If a template is not later provided for the view instance\n the `defaultTemplate` value will be used:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default'),\n template: null,\n templateName: null\n });\n ```\n\n Will result in instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the default</div>\n ```\n\n If a `template` or `templateName` is provided it will take precedence over\n `defaultTemplate`:\n\n ```javascript\n AView = Ember.View.extend({\n defaultTemplate: Ember.Handlebars.compile('I was the default')\n });\n\n aView = AView.create({\n template: Ember.Handlebars.compile('I was the template, not default')\n });\n ```\n\n Will result in the following HTML representation when rendered:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">I was the template, not default</div>\n ```\n\n ## View Context\n\n The default context of the compiled template is the view's controller:\n\n ```javascript\n AView = Ember.View.extend({\n template: Ember.Handlebars.compile('Hello {{excitedGreeting}}')\n });\n\n aController = Ember.Object.create({\n firstName: 'Barry',\n excitedGreeting: function() {\n return this.get(\"content.firstName\") + \"!!!\"\n }.property()\n });\n\n aView = AView.create({\n controller: aController,\n });\n ```\n\n Will result in an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">Hello Barry!!!</div>\n ```\n\n A context can also be explicitly supplied through the view's `context`\n property. If the view has neither `context` nor `controller` properties, the\n `parentView`'s context will be used.\n\n ## Layouts\n\n Views can have a secondary template that wraps their main template. Like\n primary templates, layouts can be any function that accepts an optional\n context parameter and returns a string of HTML that will be inserted inside\n view's tag. Views whose HTML element is self closing (e.g. `<input />`)\n cannot have a layout and this property will be ignored.\n\n Most typically in Ember a layout will be a compiled `Ember.Handlebars`\n template.\n\n A view's layout can be set directly with the `layout` property or reference\n an existing Handlebars template by name with the `layoutName` property.\n\n A template used as a layout must contain a single use of the Handlebars\n `{{yield}}` helper. The HTML contents of a view's rendered `template` will be\n inserted at this location:\n\n ```javascript\n AViewWithLayout = Ember.View.extend({\n layout: Ember.Handlebars.compile(\"<div class='my-decorative-class'>{{yield}}</div>\")\n template: Ember.Handlebars.compile(\"I got wrapped\"),\n });\n ```\n\n Will result in view instances with an HTML representation of:\n\n ```html\n <div id=\"ember1\" class=\"ember-view\">\n <div class=\"my-decorative-class\">\n I got wrapped\n </div>\n </div>\n ```\n\n See [Ember.Handlebars.helpers.yield](/api/classes/Ember.Handlebars.helpers.html#method_yield)\n for more information.\n\n ## Responding to Browser Events\n\n Views can respond to user-initiated events in one of three ways: method\n implementation, through an event manager, and through `{{action}}` helper use\n in their template or layout.\n\n ### Method Implementation\n\n Views can respond to user-initiated events by implementing a method that\n matches the event name. A `jQuery.Event` object will be passed as the\n argument to this method.\n\n ```javascript\n AView = Ember.View.extend({\n click: function(event) {\n // will be called when when an instance's\n // rendered element is clicked\n }\n });\n ```\n\n ### Event Managers\n\n Views can define an object as their `eventManager` property. This object can\n then implement methods that match the desired event names. Matching events\n that occur on the view's rendered HTML or the rendered HTML of any of its DOM\n descendants will trigger this method. A `jQuery.Event` object will be passed\n as the first argument to the method and an `Ember.View` object as the\n second. The `Ember.View` will be the view whose rendered HTML was interacted\n with. This may be the view with the `eventManager` property or one of its\n descendent views.\n\n ```javascript\n AView = Ember.View.extend({\n eventManager: Ember.Object.create({\n doubleClick: function(event, view) {\n // will be called when when an instance's\n // rendered element or any rendering\n // of this views's descendent\n // elements is clicked\n }\n })\n });\n ```\n\n An event defined for an event manager takes precedence over events of the\n same name handled through methods on the view.\n\n ```javascript\n AView = Ember.View.extend({\n mouseEnter: function(event) {\n // will never trigger.\n },\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // takes precedence over AView#mouseEnter\n }\n })\n });\n ```\n\n Similarly a view's event manager will take precedence for events of any views\n rendered as a descendent. A method name that matches an event name will not\n be called if the view instance was rendered inside the HTML representation of\n a view that has an `eventManager` property defined that handles events of the\n name. Events not handled by the event manager will still trigger method calls\n on the descendent.\n\n ```javascript\n OuterView = Ember.View.extend({\n template: Ember.Handlebars.compile(\"outer {{#view InnerView}}inner{{/view}} outer\"),\n eventManager: Ember.Object.create({\n mouseEnter: function(event, view) {\n // view might be instance of either\n // OuterView or InnerView depending on\n // where on the page the user interaction occured\n }\n })\n });\n\n InnerView = Ember.View.extend({\n click: function(event) {\n // will be called if rendered inside\n // an OuterView because OuterView's\n // eventManager doesn't handle click events\n },\n mouseEnter: function(event) {\n // will never be called if rendered inside\n // an OuterView.\n }\n });\n ```\n\n ### Handlebars `{{action}}` Helper\n\n See [Handlebars.helpers.action](/api/classes/Ember.Handlebars.helpers.html#method_action).\n\n ### Event Names\n\n All of the event handling approaches described above respond to the same set\n of events. The names of the built-in events are listed below. (The hash of\n built-in events exists in `Ember.EventDispatcher`.) Additional, custom events\n can be registered by using `Ember.Application.customEvents`.\n\n Touch events:\n\n * `touchStart`\n * `touchMove`\n * `touchEnd`\n * `touchCancel`\n\n Keyboard events\n\n * `keyDown`\n * `keyUp`\n * `keyPress`\n\n Mouse events\n\n * `mouseDown`\n * `mouseUp`\n * `contextMenu`\n * `click`\n * `doubleClick`\n * `mouseMove`\n * `focusIn`\n * `focusOut`\n * `mouseEnter`\n * `mouseLeave`\n\n Form events:\n\n * `submit`\n * `change`\n * `focusIn`\n * `focusOut`\n * `input`\n\n HTML5 drag and drop events:\n\n * `dragStart`\n * `drag`\n * `dragEnter`\n * `dragLeave`\n * `drop`\n * `dragEnd`\n\n ## Handlebars `{{view}}` Helper\n\n Other `Ember.View` instances can be included as part of a view's template by\n using the `{{view}}` Handlebars helper. See [Ember.Handlebars.helpers.view](/api/classes/Ember.Handlebars.helpers.html#method_view)\n for additional information.\n\n @class View\n @namespace Ember\n @extends Ember.CoreView\n*/\nEmber.View = Ember.CoreView.extend(\n/** @scope Ember.View.prototype */ {\n\n concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'],\n\n /**\n @property isView\n @type Boolean\n @default true\n @final\n */\n isView: true,\n\n // ..........................................................\n // TEMPLATE SUPPORT\n //\n\n /**\n The name of the template to lookup if no template is provided.\n\n By default `Ember.View` will lookup a template with this name in\n `Ember.TEMPLATES` (a shared global object).\n\n @property templateName\n @type String\n @default null\n */\n templateName: null,\n\n /**\n The name of the layout to lookup if no layout is provided.\n\n By default `Ember.View` will lookup a template with this name in\n `Ember.TEMPLATES` (a shared global object).\n\n @property layoutName\n @type String\n @default null\n */\n layoutName: null,\n\n /**\n The template used to render the view. This should be a function that\n accepts an optional context parameter and returns a string of HTML that\n will be inserted into the DOM relative to its parent view.\n\n In general, you should set the `templateName` property instead of setting\n the template yourself.\n\n @property template\n @type Function\n */\n template: Ember.computed(function(key, value) {\n if (value !== undefined) { return value; }\n\n var templateName = get(this, 'templateName'),\n template = this.templateForName(templateName, 'template');\n\n Ember.assert(\"You specified the templateName \" + templateName + \" for \" + this + \", but it did not exist.\", !templateName || template);\n\n return template || get(this, 'defaultTemplate');\n }).property('templateName'),\n\n /**\n The controller managing this view. If this property is set, it will be\n made available for use by the template.\n\n @property controller\n @type Object\n */\n controller: Ember.computed(function(key) {\n var parentView = get(this, '_parentView');\n return parentView ? get(parentView, 'controller') : null;\n }).property('_parentView'),\n\n /**\n A view may contain a layout. A layout is a regular template but\n supersedes the `template` property during rendering. It is the\n responsibility of the layout template to retrieve the `template`\n property from the view (or alternatively, call `Handlebars.helpers.yield`,\n `{{yield}}`) to render it in the correct location.\n\n This is useful for a view that has a shared wrapper, but which delegates\n the rendering of the contents of the wrapper to the `template` property\n on a subclass.\n\n @property layout\n @type Function\n */\n layout: Ember.computed(function(key) {\n var layoutName = get(this, 'layoutName'),\n layout = this.templateForName(layoutName, 'layout');\n\n Ember.assert(\"You specified the layoutName \" + layoutName + \" for \" + this + \", but it did not exist.\", !layoutName || layout);\n\n return layout || get(this, 'defaultLayout');\n }).property('layoutName'),\n\n _yield: function(context, options) {\n var template = get(this, 'template');\n if (template) { template(context, options); }\n },\n\n templateForName: function(name, type) {\n if (!name) { return; }\n Ember.assert(\"templateNames are not allowed to contain periods: \"+name, name.indexOf('.') === -1);\n\n // the defaultContainer is deprecated\n var container = this.container || (Ember.Container && Ember.Container.defaultContainer);\n return container && container.lookup('template:' + name);\n },\n\n /**\n The object from which templates should access properties.\n\n This object will be passed to the template function each time the render\n method is called, but it is up to the individual function to decide what\n to do with it.\n\n By default, this will be the view's controller.\n\n @property context\n @type Object\n */\n context: Ember.computed(function(key, value) {\n if (arguments.length === 2) {\n set(this, '_context', value);\n return value;\n } else {\n return get(this, '_context');\n }\n }).volatile(),\n\n /**\n @private\n\n Private copy of the view's template context. This can be set directly\n by Handlebars without triggering the observer that causes the view\n to be re-rendered.\n\n The context of a view is looked up as follows:\n\n 1. Supplied context (usually by Handlebars)\n 2. Specified controller\n 3. `parentView`'s context (for a child of a ContainerView)\n\n The code in Handlebars that overrides the `_context` property first\n checks to see whether the view has a specified controller. This is\n something of a hack and should be revisited.\n\n @property _context\n */\n _context: Ember.computed(function(key) {\n var parentView, controller;\n\n if (controller = get(this, 'controller')) {\n return controller;\n }\n\n parentView = this._parentView;\n if (parentView) {\n return get(parentView, '_context');\n }\n\n return null;\n }),\n\n /**\n @private\n\n If a value that affects template rendering changes, the view should be\n re-rendered to reflect the new value.\n\n @method _contextDidChange\n */\n _contextDidChange: Ember.observer('context', function() {\n this.rerender();\n }),\n\n /**\n If `false`, the view will appear hidden in DOM.\n\n @property isVisible\n @type Boolean\n @default null\n */\n isVisible: true,\n\n /**\n @private\n\n Array of child views. You should never edit this array directly.\n Instead, use `appendChild` and `removeFromParent`.\n\n @property childViews\n @type Array\n @default []\n */\n childViews: childViewsProperty,\n\n _childViews: EMPTY_ARRAY,\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews will change.\n _childViewsWillChange: Ember.beforeObserver('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyWillChange(parentView, 'childViews'); }\n }\n }),\n\n // When it's a virtual view, we need to notify the parent that their\n // childViews did change.\n _childViewsDidChange: Ember.observer('childViews', function() {\n if (this.isVirtual) {\n var parentView = get(this, 'parentView');\n if (parentView) { Ember.propertyDidChange(parentView, 'childViews'); }\n }\n }),\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class.\n\n @property nearestInstanceOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n @deprecated\n */\n nearestInstanceOf: function(klass) {\n Ember.deprecate(\"nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.\");\n var view = get(this, 'parentView');\n\n while (view) {\n if (view instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that is an instance of the provided\n class or mixin.\n\n @property nearestOfType\n @param {Class,Mixin} klass Subclass of Ember.View (or Ember.View itself),\n or an instance of Ember.Mixin.\n @return Ember.View\n */\n nearestOfType: function(klass) {\n var view = get(this, 'parentView'),\n isOfType = klass instanceof Ember.Mixin ?\n function(view) { return klass.detect(view); } :\n function(view) { return klass.detect(view.constructor); };\n\n while (view) {\n if (isOfType(view)) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor that has a given property.\n\n @property nearestWithProperty\n @param {String} property A property name\n @return Ember.View\n */\n nearestWithProperty: function(property) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (property in view) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n Return the nearest ancestor whose parent is an instance of\n `klass`.\n\n @property nearestChildOf\n @param {Class} klass Subclass of Ember.View (or Ember.View itself)\n @return Ember.View\n */\n nearestChildOf: function(klass) {\n var view = get(this, 'parentView');\n\n while (view) {\n if (get(view, 'parentView') instanceof klass) { return view; }\n view = get(view, 'parentView');\n }\n },\n\n /**\n @private\n\n When the parent view changes, recursively invalidate `controller`\n\n @method _parentViewDidChange\n */\n _parentViewDidChange: Ember.observer('_parentView', function() {\n if (this.isDestroying) { return; }\n\n this.trigger('parentViewDidChange');\n\n if (get(this, 'parentView.controller') && !get(this, 'controller')) {\n this.notifyPropertyChange('controller');\n }\n }),\n\n _controllerDidChange: Ember.observer('controller', function() {\n if (this.isDestroying) { return; }\n\n this.rerender();\n\n this.forEachChildView(function(view) {\n view.propertyDidChange('controller');\n });\n }),\n\n cloneKeywords: function() {\n var templateData = get(this, 'templateData');\n\n var keywords = templateData ? Ember.copy(templateData.keywords) : {};\n set(keywords, 'view', get(this, 'concreteView'));\n set(keywords, '_view', this);\n set(keywords, 'controller', get(this, 'controller'));\n\n return keywords;\n },\n\n /**\n Called on your view when it should push strings of HTML into a\n `Ember.RenderBuffer`. Most users will want to override the `template`\n or `templateName` properties instead of this method.\n\n By default, `Ember.View` will look for a function in the `template`\n property and invoke it with the value of `context`. The value of\n `context` will be the view's controller unless you override it.\n\n @method render\n @param {Ember.RenderBuffer} buffer The render buffer\n */\n render: function(buffer) {\n // If this view has a layout, it is the responsibility of the\n // the layout to render the view's template. Otherwise, render the template\n // directly.\n var template = get(this, 'layout') || get(this, 'template');\n\n if (template) {\n var context = get(this, 'context');\n var keywords = this.cloneKeywords();\n var output;\n\n var data = {\n view: this,\n buffer: buffer,\n isRenderData: true,\n keywords: keywords,\n insideGroup: get(this, 'templateData.insideGroup')\n };\n\n // Invoke the template with the provided template context, which\n // is the view's controller by default. A hash of data is also passed that provides\n // the template with access to the view and render buffer.\n\n Ember.assert('template must be a function. Did you mean to call Ember.Handlebars.compile(\"...\") or specify templateName instead?', typeof template === 'function');\n // The template should write directly to the render buffer instead\n // of returning a string.\n output = template(context, { data: data });\n\n // If the template returned a string instead of writing to the buffer,\n // push the string onto the buffer.\n if (output !== undefined) { buffer.push(output); }\n }\n },\n\n /**\n Renders the view again. This will work regardless of whether the\n view is already in the DOM or not. If the view is in the DOM, the\n rendering process will be deferred to give bindings a chance\n to synchronize.\n\n If children were added during the rendering process using `appendChild`,\n `rerender` will remove them, because they will be added again\n if needed by the next `render`.\n\n In general, if the display of your view changes, you should modify\n the DOM element directly instead of manually calling `rerender`, which can\n be slow.\n\n @method rerender\n */\n rerender: function() {\n return this.currentState.rerender(this);\n },\n\n clearRenderedChildren: function() {\n var lengthBefore = this.lengthBeforeRender,\n lengthAfter = this.lengthAfterRender;\n\n // If there were child views created during the last call to render(),\n // remove them under the assumption that they will be re-created when\n // we re-render.\n\n // VIEW-TODO: Unit test this path.\n var childViews = this._childViews;\n for (var i=lengthAfter-1; i>=lengthBefore; i--) {\n if (childViews[i]) { childViews[i].destroy(); }\n }\n },\n\n /**\n @private\n\n Iterates over the view's `classNameBindings` array, inserts the value\n of the specified property into the `classNames` array, then creates an\n observer to update the view's element if the bound property ever changes\n in the future.\n\n @method _applyClassNameBindings\n */\n _applyClassNameBindings: function(classBindings) {\n var classNames = this.classNames,\n elem, newClass, dasherizedClass;\n\n // Loop through all of the configured bindings. These will be either\n // property names ('isUrgent') or property paths relative to the view\n // ('content.isUrgent')\n a_forEach(classBindings, function(binding) {\n\n // Variable in which the old class value is saved. The observer function\n // closes over this variable, so it knows which string to remove when\n // the property changes.\n var oldClass;\n // Extract just the property name from bindings like 'foo:bar'\n var parsedPath = Ember.View._parsePropertyPath(binding);\n\n // Set up an observer on the context. If the property changes, toggle the\n // class name.\n var observer = function() {\n // Get the current value of the property\n newClass = this._classStringForProperty(binding);\n elem = this.$();\n\n // If we had previously added a class to the element, remove it.\n if (oldClass) {\n elem.removeClass(oldClass);\n // Also remove from classNames so that if the view gets rerendered,\n // the class doesn't get added back to the DOM.\n classNames.removeObject(oldClass);\n }\n\n // If necessary, add a new class. Make sure we keep track of it so\n // it can be removed in the future.\n if (newClass) {\n elem.addClass(newClass);\n oldClass = newClass;\n } else {\n oldClass = null;\n }\n };\n\n // Get the class name for the property at its current value\n dasherizedClass = this._classStringForProperty(binding);\n\n if (dasherizedClass) {\n // Ensure that it gets into the classNames array\n // so it is displayed when we render.\n a_addObject(classNames, dasherizedClass);\n\n // Save a reference to the class name so we can remove it\n // if the observer fires. Remember that this variable has\n // been closed over by the observer.\n oldClass = dasherizedClass;\n }\n\n this.registerObserver(this, parsedPath.path, observer);\n // Remove className so when the view is rerendered,\n // the className is added based on binding reevaluation\n this.one('willClearRender', function() {\n if (oldClass) {\n classNames.removeObject(oldClass);\n oldClass = null;\n }\n });\n\n }, this);\n },\n\n /**\n @private\n\n Iterates through the view's attribute bindings, sets up observers for each,\n then applies the current value of the attributes to the passed render buffer.\n\n @method _applyAttributeBindings\n @param {Ember.RenderBuffer} buffer\n */\n _applyAttributeBindings: function(buffer, attributeBindings) {\n var attributeValue, elem;\n\n a_forEach(attributeBindings, function(binding) {\n var split = binding.split(':'),\n property = split[0],\n attributeName = split[1] || property;\n\n // Create an observer to add/remove/change the attribute if the\n // JavaScript property changes.\n var observer = function() {\n elem = this.$();\n\n attributeValue = get(this, property);\n\n Ember.View.applyAttributeBindings(elem, attributeName, attributeValue);\n };\n\n this.registerObserver(this, property, observer);\n\n // Determine the current value and add it to the render buffer\n // if necessary.\n attributeValue = get(this, property);\n Ember.View.applyAttributeBindings(buffer, attributeName, attributeValue);\n }, this);\n },\n\n /**\n @private\n\n Given a property name, returns a dasherized version of that\n property name if the property evaluates to a non-falsy value.\n\n For example, if the view has property `isUrgent` that evaluates to true,\n passing `isUrgent` to this method will return `\"is-urgent\"`.\n\n @method _classStringForProperty\n @param property\n */\n _classStringForProperty: function(property) {\n var parsedPath = Ember.View._parsePropertyPath(property);\n var path = parsedPath.path;\n\n var val = get(this, path);\n if (val === undefined && Ember.isGlobalPath(path)) {\n val = get(Ember.lookup, path);\n }\n\n return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);\n },\n\n // ..........................................................\n // ELEMENT SUPPORT\n //\n\n /**\n Returns the current DOM element for the view.\n\n @property element\n @type DOMElement\n */\n element: Ember.computed(function(key, value) {\n if (value !== undefined) {\n return this.currentState.setElement(this, value);\n } else {\n return this.currentState.getElement(this);\n }\n }).property('_parentView'),\n\n /**\n Returns a jQuery object for this view's element. If you pass in a selector\n string, this method will return a jQuery object, using the current element\n as its buffer.\n\n For example, calling `view.$('li')` will return a jQuery object containing\n all of the `li` elements inside the DOM element of this view.\n\n @method $\n @param {String} [selector] a jQuery-compatible selector string\n @return {jQuery} the jQuery object for the DOM node\n */\n $: function(sel) {\n return this.currentState.$(this, sel);\n },\n\n mutateChildViews: function(callback) {\n var childViews = this._childViews,\n idx = childViews.length,\n view;\n\n while(--idx >= 0) {\n view = childViews[idx];\n callback(this, view, idx);\n }\n\n return this;\n },\n\n forEachChildView: function(callback) {\n var childViews = this._childViews;\n\n if (!childViews) { return this; }\n\n var len = childViews.length,\n view, idx;\n\n for (idx = 0; idx < len; idx++) {\n view = childViews[idx];\n callback(view);\n }\n\n return this;\n },\n\n /**\n Appends the view's element to the specified parent element.\n\n If the view does not have an HTML representation yet, `createElement()`\n will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing.\n\n This is not typically a function that you will need to call directly when\n building your application. You might consider using `Ember.ContainerView`\n instead. If you do need to use `appendTo`, be sure that the target element\n you are providing is associated with an `Ember.Application` and does not\n have an ancestor element that is associated with an Ember view.\n\n @method appendTo\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} receiver\n */\n appendTo: function(target) {\n // Schedule the DOM element to be created and appended to the given\n // element after bindings have synchronized.\n this._insertElementLater(function() {\n Ember.assert(\"You tried to append to (\" + target + \") but that isn't in the DOM\", Ember.$(target).length > 0);\n Ember.assert(\"You cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n Replaces the content of the specified parent element with this view's\n element. If the view does not have an HTML representation yet,\n `createElement()` will be called automatically.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the given element until all bindings have\n finished synchronizing\n\n @method replaceIn\n @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object\n @return {Ember.View} received\n */\n replaceIn: function(target) {\n Ember.assert(\"You tried to replace in (\" + target + \") but that isn't in the DOM\", Ember.$(target).length > 0);\n Ember.assert(\"You cannot replace an existing Ember.View. Consider using Ember.ContainerView instead.\", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));\n\n this._insertElementLater(function() {\n Ember.$(target).empty();\n this.$().appendTo(target);\n });\n\n return this;\n },\n\n /**\n @private\n\n Schedules a DOM operation to occur during the next render phase. This\n ensures that all bindings have finished synchronizing before the view is\n rendered.\n\n To use, pass a function that performs a DOM operation.\n\n Before your function is called, this view and all child views will receive\n the `willInsertElement` event. After your function is invoked, this view\n and all of its child views will receive the `didInsertElement` event.\n\n ```javascript\n view._insertElementLater(function() {\n this.createElement();\n this.$().appendTo('body');\n });\n ```\n\n @method _insertElementLater\n @param {Function} fn the function that inserts the element into the DOM\n */\n _insertElementLater: function(fn) {\n this._scheduledInsert = Ember.run.scheduleOnce('render', this, '_insertElement', fn);\n },\n\n _insertElement: function (fn) {\n this._scheduledInsert = null;\n this.currentState.insertElement(this, fn);\n },\n\n /**\n Appends the view's element to the document body. If the view does\n not have an HTML representation yet, `createElement()` will be called\n automatically.\n\n If your application uses the `rootElement` property, you must append\n the view within that element. Rendering views outside of the `rootElement`\n is not supported.\n\n Note that this method just schedules the view to be appended; the DOM\n element will not be appended to the document body until all bindings have\n finished synchronizing.\n\n @method append\n @return {Ember.View} receiver\n */\n append: function() {\n return this.appendTo(document.body);\n },\n\n /**\n Removes the view's element from the element to which it is attached.\n\n @method remove\n @return {Ember.View} receiver\n */\n remove: function() {\n // What we should really do here is wait until the end of the run loop\n // to determine if the element has been re-appended to a different\n // element.\n // In the interim, we will just re-render if that happens. It is more\n // important than elements get garbage collected.\n if (!this.removedFromDOM) { this.destroyElement(); }\n this.invokeRecursively(function(view) {\n if (view.clearRenderedChildren) { view.clearRenderedChildren(); }\n });\n },\n\n elementId: null,\n\n /**\n Attempts to discover the element in the parent element. The default\n implementation looks for an element with an ID of `elementId` (or the\n view's guid if `elementId` is null). You can override this method to\n provide your own form of lookup. For example, if you want to discover your\n element using a CSS class name instead of an ID.\n\n @method findElementInParentElement\n @param {DOMElement} parentElement The parent's DOM element\n @return {DOMElement} The discovered element\n */\n findElementInParentElement: function(parentElem) {\n var id = \"#\" + this.elementId;\n return Ember.$(id)[0] || Ember.$(id, parentElem)[0];\n },\n\n /**\n Creates a DOM representation of the view and all of its\n child views by recursively calling the `render()` method.\n\n After the element has been created, `didInsertElement` will\n be called on this view and all of its child views.\n\n @method createElement\n @return {Ember.View} receiver\n */\n createElement: function() {\n if (get(this, 'element')) { return this; }\n\n var buffer = this.renderToBuffer();\n set(this, 'element', buffer.element());\n\n return this;\n },\n\n /**\n Called when a view is going to insert an element into the DOM.\n\n @event willInsertElement\n */\n willInsertElement: Ember.K,\n\n /**\n Called when the element of the view has been inserted into the DOM\n or after the view was re-rendered. Override this function to do any\n set up that requires an element in the document body.\n\n @event didInsertElement\n */\n didInsertElement: Ember.K,\n\n /**\n Called when the view is about to rerender, but before anything has\n been torn down. This is a good opportunity to tear down any manual\n observers you have installed based on the DOM state\n\n @event willClearRender\n */\n willClearRender: Ember.K,\n\n /**\n @private\n\n Run this callback on the current view (unless includeSelf is false) and recursively on child views.\n\n @method invokeRecursively\n @param fn {Function}\n @param includeSelf (optional, default true)\n */\n invokeRecursively: function(fn, includeSelf) {\n var childViews = (includeSelf === false) ? this._childViews : [this];\n var currentViews, view, currentChildViews;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n currentChildViews = view._childViews ? view._childViews.slice(0) : null;\n fn(view);\n if (currentChildViews) {\n childViews.push.apply(childViews, currentChildViews);\n }\n }\n }\n },\n\n triggerRecursively: function(eventName) {\n var childViews = [this], currentViews, view, currentChildViews;\n\n while (childViews.length) {\n currentViews = childViews.slice();\n childViews = [];\n\n for (var i=0, l=currentViews.length; i<l; i++) {\n view = currentViews[i];\n currentChildViews = view._childViews ? view._childViews.slice(0) : null;\n if (view.trigger) { view.trigger(eventName); }\n if (currentChildViews) {\n childViews.push.apply(childViews, currentChildViews);\n }\n\n }\n }\n },\n\n viewHierarchyCollection: function() {\n var currentView, viewCollection = new ViewCollection([this]);\n\n for (var i = 0; i < viewCollection.length; i++) {\n currentView = viewCollection.objectAt(i);\n if (currentView._childViews) {\n viewCollection.push.apply(viewCollection, currentView._childViews);\n }\n }\n\n return viewCollection;\n },\n\n /**\n Destroys any existing element along with the element for any child views\n as well. If the view does not currently have a element, then this method\n will do nothing.\n\n If you implement `willDestroyElement()` on your view, then this method will\n be invoked on your view before your element is destroyed to give you a\n chance to clean up any event handlers, etc.\n\n If you write a `willDestroyElement()` handler, you can assume that your\n `didInsertElement()` handler was called earlier for the same element.\n\n You should not call or override this method yourself, but you may\n want to implement the above callbacks.\n\n @method destroyElement\n @return {Ember.View} receiver\n */\n destroyElement: function() {\n return this.currentState.destroyElement(this);\n },\n\n /**\n Called when the element of the view is going to be destroyed. Override\n this function to do any teardown that requires an element, like removing\n event listeners.\n\n @event willDestroyElement\n */\n willDestroyElement: Ember.K,\n\n /**\n @private\n\n Triggers the `willDestroyElement` event (which invokes the\n `willDestroyElement()` method if it exists) on this view and all child\n views.\n\n Before triggering `willDestroyElement`, it first triggers the\n `willClearRender` event recursively.\n\n @method _notifyWillDestroyElement\n */\n _notifyWillDestroyElement: function() {\n var viewCollection = this.viewHierarchyCollection();\n viewCollection.trigger('willClearRender');\n viewCollection.trigger('willDestroyElement');\n return viewCollection;\n },\n\n /**\n @private\n\n If this view's element changes, we need to invalidate the caches of our\n child views so that we do not retain references to DOM elements that are\n no longer needed.\n\n @method _elementDidChange\n */\n _elementDidChange: Ember.observer('element', function() {\n this.forEachChildView(function(view) {\n delete meta(view).cache.element;\n });\n }),\n\n /**\n Called when the parentView property has changed.\n\n @event parentViewDidChange\n */\n parentViewDidChange: Ember.K,\n\n instrumentName: 'view',\n\n instrumentDetails: function(hash) {\n hash.template = get(this, 'templateName');\n this._super(hash);\n },\n\n _renderToBuffer: function(parentBuffer, bufferOperation) {\n this.lengthBeforeRender = this._childViews.length;\n var buffer = this._super(parentBuffer, bufferOperation);\n this.lengthAfterRender = this._childViews.length;\n\n return buffer;\n },\n\n renderToBufferIfNeeded: function (buffer) {\n return this.currentState.renderToBufferIfNeeded(this, buffer);\n },\n\n beforeRender: function(buffer) {\n this.applyAttributesToBuffer(buffer);\n buffer.pushOpeningTag();\n },\n\n afterRender: function(buffer) {\n buffer.pushClosingTag();\n },\n\n applyAttributesToBuffer: function(buffer) {\n // Creates observers for all registered class name and attribute bindings,\n // then adds them to the element.\n var classNameBindings = get(this, 'classNameBindings');\n if (classNameBindings.length) {\n this._applyClassNameBindings(classNameBindings);\n }\n\n // Pass the render buffer so the method can apply attributes directly.\n // This isn't needed for class name bindings because they use the\n // existing classNames infrastructure.\n var attributeBindings = get(this, 'attributeBindings');\n if (attributeBindings.length) {\n this._applyAttributeBindings(buffer, attributeBindings);\n }\n\n buffer.setClasses(this.classNames);\n buffer.id(this.elementId);\n\n var role = get(this, 'ariaRole');\n if (role) {\n buffer.attr('role', role);\n }\n\n if (get(this, 'isVisible') === false) {\n buffer.style('display', 'none');\n }\n },\n\n // ..........................................................\n // STANDARD RENDER PROPERTIES\n //\n\n /**\n Tag name for the view's outer element. The tag name is only used when an\n element is first created. If you change the `tagName` for an element, you\n must destroy and recreate the view element.\n\n By default, the render buffer will use a `<div>` tag for views.\n\n @property tagName\n @type String\n @default null\n */\n\n // We leave this null by default so we can tell the difference between\n // the default case and a user-specified tag.\n tagName: null,\n\n /**\n The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.\n\n The full list of valid WAI-ARIA roles is available at:\n [http://www.w3.org/TR/wai-aria/roles#roles_categorization](http://www.w3.org/TR/wai-aria/roles#roles_categorization)\n\n @property ariaRole\n @type String\n @default null\n */\n ariaRole: null,\n\n /**\n Standard CSS class names to apply to the view's outer element. This\n property automatically inherits any class names defined by the view's\n superclasses as well.\n\n @property classNames\n @type Array\n @default ['ember-view']\n */\n classNames: ['ember-view'],\n\n /**\n A list of properties of the view to apply as class names. If the property\n is a string value, the value of that string will be applied as a class\n name.\n\n ```javascript\n // Applies the 'high' class to the view element\n Ember.View.extend({\n classNameBindings: ['priority']\n priority: 'high'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as a dasherized class name.\n\n ```javascript\n // Applies the 'is-urgent' class to the view element\n Ember.View.extend({\n classNameBindings: ['isUrgent']\n isUrgent: true\n });\n ```\n\n If you would prefer to use a custom value instead of the dasherized\n property name, you can pass a binding like this:\n\n ```javascript\n // Applies the 'urgent' class to the view element\n Ember.View.extend({\n classNameBindings: ['isUrgent:urgent']\n isUrgent: true\n });\n ```\n\n This list of properties is inherited from the view's superclasses as well.\n\n @property classNameBindings\n @type Array\n @default []\n */\n classNameBindings: EMPTY_ARRAY,\n\n /**\n A list of properties of the view to apply as attributes. If the property is\n a string value, the value of that string will be applied as the attribute.\n\n ```javascript\n // Applies the type attribute to the element\n // with the value \"button\", like <div type=\"button\">\n Ember.View.extend({\n attributeBindings: ['type'],\n type: 'button'\n });\n ```\n\n If the value of the property is a Boolean, the name of that property is\n added as an attribute.\n\n ```javascript\n // Renders something like <div enabled=\"enabled\">\n Ember.View.extend({\n attributeBindings: ['enabled'],\n enabled: true\n });\n ```\n\n @property attributeBindings\n */\n attributeBindings: EMPTY_ARRAY,\n\n // .......................................................\n // CORE DISPLAY METHODS\n //\n\n /**\n @private\n\n Setup a view, but do not finish waking it up.\n - configure `childViews`\n - register the view with the global views hash, which is used for event\n dispatch\n\n @method init\n */\n init: function() {\n this.elementId = this.elementId || guidFor(this);\n\n this._super();\n\n // setup child views. be sure to clone the child views array first\n this._childViews = this._childViews.slice();\n\n Ember.assert(\"Only arrays are allowed for 'classNameBindings'\", Ember.typeOf(this.classNameBindings) === 'array');\n this.classNameBindings = Ember.A(this.classNameBindings.slice());\n\n Ember.assert(\"Only arrays are allowed for 'classNames'\", Ember.typeOf(this.classNames) === 'array');\n this.classNames = Ember.A(this.classNames.slice());\n },\n\n appendChild: function(view, options) {\n return this.currentState.appendChild(this, view, options);\n },\n\n /**\n Removes the child view from the parent view.\n\n @method removeChild\n @param {Ember.View} view\n @return {Ember.View} receiver\n */\n removeChild: function(view) {\n // If we're destroying, the entire subtree will be\n // freed, and the DOM will be handled separately,\n // so no need to mess with childViews.\n if (this.isDestroying) { return; }\n\n // update parent node\n set(view, '_parentView', null);\n\n // remove view from childViews array.\n var childViews = this._childViews;\n\n Ember.EnumerableUtils.removeObject(childViews, view);\n\n this.propertyDidChange('childViews'); // HUH?! what happened to will change?\n\n return this;\n },\n\n /**\n Removes all children from the `parentView`.\n\n @method removeAllChildren\n @return {Ember.View} receiver\n */\n removeAllChildren: function() {\n return this.mutateChildViews(function(parentView, view) {\n parentView.removeChild(view);\n });\n },\n\n destroyAllChildren: function() {\n return this.mutateChildViews(function(parentView, view) {\n view.destroy();\n });\n },\n\n /**\n Removes the view from its `parentView`, if one is found. Otherwise\n does nothing.\n\n @method removeFromParent\n @return {Ember.View} receiver\n */\n removeFromParent: function() {\n var parent = this._parentView;\n\n // Remove DOM element from parent\n this.remove();\n\n if (parent) { parent.removeChild(this); }\n return this;\n },\n\n /**\n You must call `destroy` on a view to destroy the view (and all of its\n child views). This will remove the view from any parent node, then make\n sure that the DOM element managed by the view can be released by the\n memory manager.\n\n @method destroy\n */\n destroy: function() {\n var childViews = this._childViews,\n // get parentView before calling super because it'll be destroyed\n nonVirtualParentView = get(this, 'parentView'),\n viewName = this.viewName,\n childLen, i;\n\n if (!this._super()) { return; }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].removedFromDOM = true;\n }\n\n // remove from non-virtual parent view if viewName was specified\n if (viewName && nonVirtualParentView) {\n nonVirtualParentView.set(viewName, null);\n }\n\n childLen = childViews.length;\n for (i=childLen-1; i>=0; i--) {\n childViews[i].destroy();\n }\n\n return this;\n },\n\n /**\n Instantiates a view to be added to the childViews array during view\n initialization. You generally will not call this method directly unless\n you are overriding `createChildViews()`. Note that this method will\n automatically configure the correct settings on the new view instance to\n act as a child of the parent.\n\n @method createChildView\n @param {Class|String} viewClass\n @param {Hash} [attrs] Attributes to add\n @return {Ember.View} new instance\n */\n createChildView: function(view, attrs) {\n if (!view) {\n throw new TypeError(\"createChildViews first argument must exist\");\n }\n\n if (view.isView && view._parentView === this && view.container === this.container) {\n return view;\n }\n\n attrs = attrs || {};\n attrs._parentView = this;\n\n if (Ember.CoreView.detect(view)) {\n attrs.templateData = attrs.templateData || get(this, 'templateData');\n\n attrs.container = this.container;\n view = view.create(attrs);\n\n // don't set the property on a virtual view, as they are invisible to\n // consumers of the view API\n if (view.viewName) {\n set(get(this, 'concreteView'), view.viewName, view);\n }\n } else if ('string' === typeof view) {\n var fullName = 'view:' + view;\n var View = this.container.lookupFactory(fullName);\n\n Ember.assert(\"Could not find view: '\" + fullName + \"'\", !!View);\n\n attrs.templateData = get(this, 'templateData');\n view = View.create(attrs);\n } else {\n Ember.assert('You must pass instance or subclass of View', view.isView);\n attrs.container = this.container;\n\n if (!get(view, 'templateData')) {\n attrs.templateData = get(this, 'templateData');\n }\n\n Ember.setProperties(view, attrs);\n\n }\n\n return view;\n },\n\n becameVisible: Ember.K,\n becameHidden: Ember.K,\n\n /**\n @private\n\n When the view's `isVisible` property changes, toggle the visibility\n element of the actual DOM element.\n\n @method _isVisibleDidChange\n */\n _isVisibleDidChange: Ember.observer('isVisible', function() {\n var $el = this.$();\n if (!$el) { return; }\n\n var isVisible = get(this, 'isVisible');\n\n $el.toggle(isVisible);\n\n if (this._isAncestorHidden()) { return; }\n\n if (isVisible) {\n this._notifyBecameVisible();\n } else {\n this._notifyBecameHidden();\n }\n }),\n\n _notifyBecameVisible: function() {\n this.trigger('becameVisible');\n\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameVisible();\n }\n });\n },\n\n _notifyBecameHidden: function() {\n this.trigger('becameHidden');\n this.forEachChildView(function(view) {\n var isVisible = get(view, 'isVisible');\n\n if (isVisible || isVisible === null) {\n view._notifyBecameHidden();\n }\n });\n },\n\n _isAncestorHidden: function() {\n var parent = get(this, 'parentView');\n\n while (parent) {\n if (get(parent, 'isVisible') === false) { return true; }\n\n parent = get(parent, 'parentView');\n }\n\n return false;\n },\n\n clearBuffer: function() {\n this.invokeRecursively(function(view) {\n view.buffer = null;\n });\n },\n\n transitionTo: function(state, children) {\n var priorState = this.currentState,\n currentState = this.currentState = this.states[state];\n this.state = state;\n\n if (priorState && priorState.exit) { priorState.exit(this); }\n if (currentState.enter) { currentState.enter(this); }\n if (state === 'inDOM') { delete Ember.meta(this).cache.element; }\n\n if (children !== false) {\n this.forEachChildView(function(view) {\n view.transitionTo(state);\n });\n }\n },\n\n // .......................................................\n // EVENT HANDLING\n //\n\n /**\n @private\n\n Handle events from `Ember.EventDispatcher`\n\n @method handleEvent\n @param eventName {String}\n @param evt {Event}\n */\n handleEvent: function(eventName, evt) {\n return this.currentState.handleEvent(this, eventName, evt);\n },\n\n registerObserver: function(root, path, target, observer) {\n if (!observer && 'function' === typeof target) {\n observer = target;\n target = null;\n }\n\n if (!root || typeof root !== 'object') {\n return;\n }\n\n var view = this,\n stateCheckedObserver = function() {\n view.currentState.invokeObserver(this, observer);\n },\n scheduledObserver = function() {\n Ember.run.scheduleOnce('render', this, stateCheckedObserver);\n };\n\n Ember.addObserver(root, path, target, scheduledObserver);\n\n this.one('willClearRender', function() {\n Ember.removeObserver(root, path, target, scheduledObserver);\n });\n }\n\n});\n\n/*\n Describe how the specified actions should behave in the various\n states that a view can exist in. Possible states:\n\n * preRender: when a view is first instantiated, and after its\n element was destroyed, it is in the preRender state\n * inBuffer: once a view has been rendered, but before it has\n been inserted into the DOM, it is in the inBuffer state\n * inDOM: once a view has been inserted into the DOM it is in\n the inDOM state. A view spends the vast majority of its\n existence in this state.\n * destroyed: once a view has been destroyed (using the destroy\n method), it is in this state. No further actions can be invoked\n on a destroyed view.\n*/\n\n // in the destroyed state, everything is illegal\n\n // before rendering has begun, all legal manipulations are noops.\n\n // inside the buffer, legal manipulations are done on the buffer\n\n // once the view has been inserted into the DOM, legal manipulations\n // are done on the DOM element.\n\nfunction notifyMutationListeners() {\n Ember.run.once(Ember.View, 'notifyMutationListeners');\n}\n\nvar DOMManager = {\n prepend: function(view, html) {\n view.$().prepend(html);\n notifyMutationListeners();\n },\n\n after: function(view, html) {\n view.$().after(html);\n notifyMutationListeners();\n },\n\n html: function(view, html) {\n view.$().html(html);\n notifyMutationListeners();\n },\n\n replace: function(view) {\n var element = get(view, 'element');\n\n set(view, 'element', null);\n\n view._insertElementLater(function() {\n Ember.$(element).replaceWith(get(view, 'element'));\n notifyMutationListeners();\n });\n },\n\n remove: function(view) {\n view.$().remove();\n notifyMutationListeners();\n },\n\n empty: function(view) {\n view.$().empty();\n notifyMutationListeners();\n }\n};\n\nEmber.View.reopen({\n domManager: DOMManager\n});\n\nEmber.View.reopenClass({\n\n /**\n @private\n\n Parse a path and return an object which holds the parsed properties.\n\n For example a path like \"content.isEnabled:enabled:disabled\" will return the\n following object:\n\n ```javascript\n {\n path: \"content.isEnabled\",\n className: \"enabled\",\n falsyClassName: \"disabled\",\n classNames: \":enabled:disabled\"\n }\n ```\n\n @method _parsePropertyPath\n @static\n */\n _parsePropertyPath: function(path) {\n var split = path.split(':'),\n propertyPath = split[0],\n classNames = \"\",\n className,\n falsyClassName;\n\n // check if the property is defined as prop:class or prop:trueClass:falseClass\n if (split.length > 1) {\n className = split[1];\n if (split.length === 3) { falsyClassName = split[2]; }\n\n classNames = ':' + className;\n if (falsyClassName) { classNames += \":\" + falsyClassName; }\n }\n\n return {\n path: propertyPath,\n classNames: classNames,\n className: (className === '') ? undefined : className,\n falsyClassName: falsyClassName\n };\n },\n\n /**\n @private\n\n Get the class name for a given value, based on the path, optional\n `className` and optional `falsyClassName`.\n\n - if a `className` or `falsyClassName` has been specified:\n - if the value is truthy and `className` has been specified,\n `className` is returned\n - if the value is falsy and `falsyClassName` has been specified,\n `falsyClassName` is returned\n - otherwise `null` is returned\n - if the value is `true`, the dasherized last part of the supplied path\n is returned\n - if the value is not `false`, `undefined` or `null`, the `value`\n is returned\n - if none of the above rules apply, `null` is returned\n\n @method _classStringForValue\n @param path\n @param val\n @param className\n @param falsyClassName\n @static\n */\n _classStringForValue: function(path, val, className, falsyClassName) {\n // When using the colon syntax, evaluate the truthiness or falsiness\n // of the value to determine which className to return\n if (className || falsyClassName) {\n if (className && !!val) {\n return className;\n\n } else if (falsyClassName && !val) {\n return falsyClassName;\n\n } else {\n return null;\n }\n\n // If value is a Boolean and true, return the dasherized property\n // name.\n } else if (val === true) {\n // Normalize property path to be suitable for use\n // as a class name. For exaple, content.foo.barBaz\n // becomes bar-baz.\n var parts = path.split('.');\n return Ember.String.dasherize(parts[parts.length-1]);\n\n // If the value is not false, undefined, or null, return the current\n // value of the property.\n } else if (val !== false && val != null) {\n return val;\n\n // Nothing to display. Return null so that the old class is removed\n // but no new class is added.\n } else {\n return null;\n }\n }\n});\n\nvar mutation = Ember.Object.extend(Ember.Evented).create();\n\nEmber.View.addMutationListener = function(callback) {\n mutation.on('change', callback);\n};\n\nEmber.View.removeMutationListener = function(callback) {\n mutation.off('change', callback);\n};\n\nEmber.View.notifyMutationListeners = function() {\n mutation.trigger('change');\n};\n\n/**\n Global views hash\n\n @property views\n @static\n @type Hash\n*/\nEmber.View.views = {};\n\n// If someone overrides the child views computed property when\n// defining their class, we want to be able to process the user's\n// supplied childViews and then restore the original computed property\n// at view initialization time. This happens in Ember.ContainerView's init\n// method.\nEmber.View.childViewsProperty = childViewsProperty;\n\nEmber.View.applyAttributeBindings = function(elem, name, value) {\n var type = Ember.typeOf(value);\n\n // if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js\n if (name !== 'value' && (type === 'string' || (type === 'number' && !isNaN(value)))) {\n if (value !== elem.attr(name)) {\n elem.attr(name, value);\n }\n } else if (name === 'value' || type === 'boolean') {\n // We can't set properties to undefined or null\n if (Ember.isNone(value)) { value = ''; }\n\n if (value !== elem.prop(name)) {\n // value and booleans should always be properties\n elem.prop(name, value);\n }\n } else if (!value) {\n elem.removeAttr(name);\n }\n};\n\nEmber.View.states = states;\n\n})();\n//@ sourceURL=ember-views/views/view");minispade.register('ember', "(function() {minispade.require('ember-application');\n\n/**\nEmber\n\n@module ember\n*/\n\nfunction throwWithMessage(msg) {\n return function() {\n throw new Ember.Error(msg);\n };\n}\n\nfunction generateRemovedClass(className) {\n var msg = \" has been moved into a plugin: https://github.com/emberjs/ember-states\";\n\n return {\n extend: throwWithMessage(className + msg),\n create: throwWithMessage(className + msg)\n };\n}\n\nEmber.StateManager = generateRemovedClass(\"Ember.StateManager\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n \n @class StateManager\n @namespace Ember\n*/\n\nEmber.State = generateRemovedClass(\"Ember.State\");\n\n/**\n This was exported to ember-states plugin for v 1.0.0 release. See: https://github.com/emberjs/ember-states\n \n @class State\n @namespace Ember\n*/\n\n})();\n//@ sourceURL=ember");minispade.register('loader', "(function() {var define, requireModule;\n\n(function() {\n var registry = {}, seen = {};\n\n define = function(name, deps, callback) {\n registry[name] = { deps: deps, callback: callback };\n };\n\n requireModule = function(name) {\n if (seen[name]) { return seen[name]; }\n seen[name] = {};\n\n var mod, deps, callback, reified, exports;\n\n mod = registry[name];\n\n if (!mod) {\n throw new Error(\"Module '\" + name + \"' not found.\");\n }\n\n deps = mod.deps;\n callback = mod.callback;\n reified = [];\n\n for (var i=0, l=deps.length; i<l; i++) {\n if (deps[i] === 'exports') {\n reified.push(exports = {});\n } else {\n reified.push(requireModule(deps[i]));\n }\n }\n\n var value = callback.apply(this, reified);\n return seen[name] = exports || value;\n };\n})();\n\n})();\n//@ sourceURL=loader");minispade.register('metamorph', "(function() {define(\"metamorph\",\n [],\n function() {\n \"use strict\";\n // ==========================================================================\n // Project: metamorph\n // Copyright: ©2011 My Company Inc. All rights reserved.\n // ==========================================================================\n\n var K = function() {},\n guid = 0,\n document = this.document,\n disableRange = ('undefined' === typeof ENV ? {} : ENV).DISABLE_RANGE_API,\n\n // Feature-detect the W3C range API, the extended check is for IE9 which only partially supports ranges\n supportsRange = (!disableRange) && document && ('createRange' in document) && (typeof Range !== 'undefined') && Range.prototype.createContextualFragment,\n\n // Internet Explorer prior to 9 does not allow setting innerHTML if the first element\n // is a \"zero-scope\" element. This problem can be worked around by making\n // the first node an invisible text node. We, like Modernizr, use ­\n needsShy = document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"<div></div>\";\n testEl.firstChild.innerHTML = \"<script></script>\";\n return testEl.firstChild.innerHTML === '';\n })(),\n\n\n // IE 8 (and likely earlier) likes to move whitespace preceeding\n // a script tag to appear after it. This means that we can\n // accidentally remove whitespace when updating a morph.\n movesWhitespace = document && (function() {\n var testEl = document.createElement('div');\n testEl.innerHTML = \"Test: <script type='text/x-placeholder'></script>Value\";\n return testEl.childNodes[0].nodeValue === 'Test:' &&\n testEl.childNodes[2].nodeValue === ' Value';\n })();\n\n // Constructor that supports either Metamorph('foo') or new\n // Metamorph('foo');\n //\n // Takes a string of HTML as the argument.\n\n var Metamorph = function(html) {\n var self;\n\n if (this instanceof Metamorph) {\n self = this;\n } else {\n self = new K();\n }\n\n self.innerHTML = html;\n var myGuid = 'metamorph-'+(guid++);\n self.start = myGuid + '-start';\n self.end = myGuid + '-end';\n\n return self;\n };\n\n K.prototype = Metamorph.prototype;\n\n var rangeFor, htmlFunc, removeFunc, outerHTMLFunc, appendToFunc, afterFunc, prependFunc, startTagFunc, endTagFunc;\n\n outerHTMLFunc = function() {\n return this.startTag() + this.innerHTML + this.endTag();\n };\n\n startTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.start + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n endTagFunc = function() {\n /*\n * We replace chevron by its hex code in order to prevent escaping problems.\n * Check this thread for more explaination:\n * http://stackoverflow.com/questions/8231048/why-use-x3c-instead-of-when-generating-html-from-javascript\n */\n return \"<script id='\" + this.end + \"' type='text/x-placeholder'>\\x3C/script>\";\n };\n\n // If we have the W3C range API, this process is relatively straight forward.\n if (supportsRange) {\n\n // Get a range for the current morph. Optionally include the starting and\n // ending placeholders.\n rangeFor = function(morph, outerToo) {\n var range = document.createRange();\n var before = document.getElementById(morph.start);\n var after = document.getElementById(morph.end);\n\n if (outerToo) {\n range.setStartBefore(before);\n range.setEndAfter(after);\n } else {\n range.setStartAfter(before);\n range.setEndBefore(after);\n }\n\n return range;\n };\n\n htmlFunc = function(html, outerToo) {\n // get a range for the current metamorph object\n var range = rangeFor(this, outerToo);\n\n // delete the contents of the range, which will be the\n // nodes between the starting and ending placeholder.\n range.deleteContents();\n\n // create a new document fragment for the HTML\n var fragment = range.createContextualFragment(html);\n\n // insert the fragment into the range\n range.insertNode(fragment);\n };\n\n /**\n * @public\n * \n * Remove this object (including starting and ending\n * placeholders).\n *\n * @method remove\n */\n removeFunc = function() {\n // get a range for the current metamorph object including\n // the starting and ending placeholders.\n var range = rangeFor(this, true);\n\n // delete the entire range.\n range.deleteContents();\n };\n\n appendToFunc = function(node) {\n var range = document.createRange();\n range.setStart(node);\n range.collapse(false);\n var frag = range.createContextualFragment(this.outerHTML());\n node.appendChild(frag);\n };\n\n afterFunc = function(html) {\n var range = document.createRange();\n var after = document.getElementById(this.end);\n\n range.setStartAfter(after);\n range.setEndAfter(after);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n prependFunc = function(html) {\n var range = document.createRange();\n var start = document.getElementById(this.start);\n\n range.setStartAfter(start);\n range.setEndAfter(start);\n\n var fragment = range.createContextualFragment(html);\n range.insertNode(fragment);\n };\n\n } else {\n /*\n * This code is mostly taken from jQuery, with one exception. In jQuery's case, we\n * have some HTML and we need to figure out how to convert it into some nodes.\n *\n * In this case, jQuery needs to scan the HTML looking for an opening tag and use\n * that as the key for the wrap map. In our case, we know the parent node, and\n * can use its type as the key for the wrap map.\n **/\n var wrapMap = {\n select: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n fieldset: [ 1, \"<fieldset>\", \"</fieldset>\" ],\n table: [ 1, \"<table>\", \"</table>\" ],\n tbody: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n tr: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n colgroup: [ 2, \"<table><tbody></tbody><colgroup>\", \"</colgroup></table>\" ],\n map: [ 1, \"<map>\", \"</map>\" ],\n _default: [ 0, \"\", \"\" ]\n };\n\n var findChildById = function(element, id) {\n if (element.getAttribute('id') === id) { return element; }\n\n var len = element.childNodes.length, idx, node, found;\n for (idx=0; idx<len; idx++) {\n node = element.childNodes[idx];\n found = node.nodeType === 1 && findChildById(node, id);\n if (found) { return found; }\n }\n };\n\n var setInnerHTML = function(element, html) {\n var matches = [];\n if (movesWhitespace) {\n // Right now we only check for script tags with ids with the\n // goal of targeting morphs.\n html = html.replace(/(\\s+)(<script id='([^']+)')/g, function(match, spaces, tag, id) {\n matches.push([id, spaces]);\n return tag;\n });\n }\n\n element.innerHTML = html;\n\n // If we have to do any whitespace adjustments do them now\n if (matches.length > 0) {\n var len = matches.length, idx;\n for (idx=0; idx<len; idx++) {\n var script = findChildById(element, matches[idx][0]),\n node = document.createTextNode(matches[idx][1]);\n script.parentNode.insertBefore(node, script);\n }\n }\n };\n\n /*\n * Given a parent node and some HTML, generate a set of nodes. Return the first\n * node, which will allow us to traverse the rest using nextSibling.\n *\n * We need to do this because innerHTML in IE does not really parse the nodes.\n */\n var firstNodeFor = function(parentNode, html) {\n var arr = wrapMap[parentNode.tagName.toLowerCase()] || wrapMap._default;\n var depth = arr[0], start = arr[1], end = arr[2];\n\n if (needsShy) { html = '­'+html; }\n\n var element = document.createElement('div');\n\n setInnerHTML(element, start + html + end);\n\n for (var i=0; i<=depth; i++) {\n element = element.firstChild;\n }\n\n // Look for ­ to remove it.\n if (needsShy) {\n var shyElement = element;\n\n // Sometimes we get nameless elements with the shy inside\n while (shyElement.nodeType === 1 && !shyElement.nodeName) {\n shyElement = shyElement.firstChild;\n }\n\n // At this point it's the actual unicode character.\n if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === \"\\u00AD\") {\n shyElement.nodeValue = shyElement.nodeValue.slice(1);\n }\n }\n\n return element;\n };\n\n /*\n * In some cases, Internet Explorer can create an anonymous node in\n * the hierarchy with no tagName. You can create this scenario via:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table>­<script></script><tr><td>hi</td></tr></table>\";\n * div.firstChild.firstChild.tagName //=> \"\"\n *\n * If our script markers are inside such a node, we need to find that\n * node and use *it* as the marker.\n */\n var realNode = function(start) {\n while (start.parentNode.tagName === \"\") {\n start = start.parentNode;\n }\n\n return start;\n };\n\n /*\n * When automatically adding a tbody, Internet Explorer inserts the\n * tbody immediately before the first <tr>. Other browsers create it\n * before the first node, no matter what.\n *\n * This means the the following code:\n *\n * div = document.createElement(\"div\");\n * div.innerHTML = \"<table><script id='first'></script><tr><td>hi</td></tr><script id='last'></script></table>\n *\n * Generates the following DOM in IE:\n *\n * + div\n * + table\n * - script id='first'\n * + tbody\n * + tr\n * + td\n * - \"hi\"\n * - script id='last'\n *\n * Which means that the two script tags, even though they were\n * inserted at the same point in the hierarchy in the original\n * HTML, now have different parents.\n *\n * This code reparents the first script tag by making it the tbody's\n * first child.\n *\n */\n var fixParentage = function(start, end) {\n if (start.parentNode !== end.parentNode) {\n end.parentNode.insertBefore(start, end.parentNode.firstChild);\n }\n };\n\n htmlFunc = function(html, outerToo) {\n // get the real starting node. see realNode for details.\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n var parentNode = end.parentNode;\n var node, nextSibling, last;\n\n // make sure that the start and end nodes share the same\n // parent. If not, fix it.\n fixParentage(start, end);\n\n // remove all of the nodes after the starting placeholder and\n // before the ending placeholder.\n node = start.nextSibling;\n while (node) {\n nextSibling = node.nextSibling;\n last = node === end;\n\n // if this is the last node, and we want to remove it as well,\n // set the `end` node to the next sibling. This is because\n // for the rest of the function, we insert the new nodes\n // before the end (note that insertBefore(node, null) is\n // the same as appendChild(node)).\n //\n // if we do not want to remove it, just break.\n if (last) {\n if (outerToo) { end = node.nextSibling; } else { break; }\n }\n\n node.parentNode.removeChild(node);\n\n // if this is the last node and we didn't break before\n // (because we wanted to remove the outer nodes), break\n // now.\n if (last) { break; }\n\n node = nextSibling;\n }\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(start.parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, end);\n node = nextSibling;\n }\n };\n\n // remove the nodes in the DOM representing this metamorph.\n //\n // this includes the starting and ending placeholders.\n removeFunc = function() {\n var start = realNode(document.getElementById(this.start));\n var end = document.getElementById(this.end);\n\n this.html('');\n start.parentNode.removeChild(start);\n end.parentNode.removeChild(end);\n };\n\n appendToFunc = function(parentNode) {\n var node = firstNodeFor(parentNode, this.outerHTML());\n var nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.appendChild(node);\n node = nextSibling;\n }\n };\n\n afterFunc = function(html) {\n // get the real starting node. see realNode for details.\n var end = document.getElementById(this.end);\n var insertBefore = end.nextSibling;\n var parentNode = end.parentNode;\n var nextSibling;\n var node;\n\n // get the first node for the HTML string, even in cases like\n // tables and lists where a simple innerHTML on a div would\n // swallow some of the content.\n node = firstNodeFor(parentNode, html);\n\n // copy the nodes for the HTML between the starting and ending\n // placeholder.\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n\n prependFunc = function(html) {\n var start = document.getElementById(this.start);\n var parentNode = start.parentNode;\n var nextSibling;\n var node;\n\n node = firstNodeFor(parentNode, html);\n var insertBefore = start.nextSibling;\n\n while (node) {\n nextSibling = node.nextSibling;\n parentNode.insertBefore(node, insertBefore);\n node = nextSibling;\n }\n };\n }\n\n Metamorph.prototype.html = function(html) {\n this.checkRemoved();\n if (html === undefined) { return this.innerHTML; }\n\n htmlFunc.call(this, html);\n\n this.innerHTML = html;\n };\n\n Metamorph.prototype.replaceWith = function(html) {\n this.checkRemoved();\n htmlFunc.call(this, html, true);\n };\n\n Metamorph.prototype.remove = removeFunc;\n Metamorph.prototype.outerHTML = outerHTMLFunc;\n Metamorph.prototype.appendTo = appendToFunc;\n Metamorph.prototype.after = afterFunc;\n Metamorph.prototype.prepend = prependFunc;\n Metamorph.prototype.startTag = startTagFunc;\n Metamorph.prototype.endTag = endTagFunc;\n\n Metamorph.prototype.isRemoved = function() {\n var before = document.getElementById(this.start);\n var after = document.getElementById(this.end);\n\n return !before || !after;\n };\n\n Metamorph.prototype.checkRemoved = function() {\n if (this.isRemoved()) {\n throw new Error(\"Cannot perform operations on a Metamorph that is not in the DOM.\");\n }\n };\n\n return Metamorph;\n });\n\n})();\n//@ sourceURL=metamorph");minispade.register('rsvp', "(function() {define(\"rsvp/all\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n /* global toString */\n\n\n function all(promises) {\n if (Object.prototype.toString.call(promises) !== \"[object Array]\") {\n throw new TypeError('You must pass an array to all.');\n }\n\n return new Promise(function(resolve, reject) {\n var results = [], remaining = promises.length,\n promise;\n\n if (remaining === 0) {\n resolve([]);\n }\n\n function resolver(index) {\n return function(value) {\n resolveAll(index, value);\n };\n }\n\n function resolveAll(index, value) {\n results[index] = value;\n if (--remaining === 0) {\n resolve(results);\n }\n }\n\n for (var i = 0; i < promises.length; i++) {\n promise = promises[i];\n\n if (promise && typeof promise.then === 'function') {\n promise.then(resolver(i), reject);\n } else {\n resolveAll(i, promise);\n }\n }\n });\n }\n\n\n __exports__.all = all;\n });\ndefine(\"rsvp/async\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var browserGlobal = (typeof window !== 'undefined') ? window : {};\n var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n var async;\n var local = (typeof global !== 'undefined') ? global : this;\n\n // old node\n function useNextTick() {\n return function(callback, arg) {\n process.nextTick(function() {\n callback(arg);\n });\n };\n }\n\n // node >= 0.10.x\n function useSetImmediate() {\n return function(callback, arg) {\n /* global setImmediate */\n setImmediate(function(){\n callback(arg);\n });\n };\n }\n\n function useMutationObserver() {\n var queue = [];\n\n var observer = new BrowserMutationObserver(function() {\n var toProcess = queue.slice();\n queue = [];\n\n toProcess.forEach(function(tuple) {\n var callback = tuple[0], arg= tuple[1];\n callback(arg);\n });\n });\n\n var element = document.createElement('div');\n observer.observe(element, { attributes: true });\n\n // Chrome Memory Leak: https://bugs.webkit.org/show_bug.cgi?id=93661\n window.addEventListener('unload', function(){\n observer.disconnect();\n observer = null;\n }, false);\n\n return function(callback, arg) {\n queue.push([callback, arg]);\n element.setAttribute('drainQueue', 'drainQueue');\n };\n }\n\n function useSetTimeout() {\n return function(callback, arg) {\n local.setTimeout(function() {\n callback(arg);\n }, 1);\n };\n }\n\n if (typeof setImmediate === 'function') {\n async = useSetImmediate();\n } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {\n async = useNextTick();\n } else if (BrowserMutationObserver) {\n async = useMutationObserver();\n } else {\n async = useSetTimeout();\n }\n\n\n __exports__.async = async;\n });\ndefine(\"rsvp/config\",\n [\"rsvp/async\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var async = __dependency1__.async;\n\n var config = {};\n config.async = async;\n\n\n __exports__.config = config;\n });\ndefine(\"rsvp/defer\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n function defer() {\n var deferred = {\n // pre-allocate shape\n resolve: undefined,\n reject: undefined,\n promise: undefined\n };\n\n deferred.promise = new Promise(function(resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n\n return deferred;\n }\n\n\n __exports__.defer = defer;\n });\ndefine(\"rsvp/events\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var Event = function(type, options) {\n this.type = type;\n\n for (var option in options) {\n if (!options.hasOwnProperty(option)) { continue; }\n\n this[option] = options[option];\n }\n };\n\n var indexOf = function(callbacks, callback) {\n for (var i=0, l=callbacks.length; i<l; i++) {\n if (callbacks[i][0] === callback) { return i; }\n }\n\n return -1;\n };\n\n var callbacksFor = function(object) {\n var callbacks = object._promiseCallbacks;\n\n if (!callbacks) {\n callbacks = object._promiseCallbacks = {};\n }\n\n return callbacks;\n };\n\n var EventTarget = {\n mixin: function(object) {\n object.on = this.on;\n object.off = this.off;\n object.trigger = this.trigger;\n return object;\n },\n\n on: function(eventNames, callback, binding) {\n var allCallbacks = callbacksFor(this), callbacks, eventName;\n eventNames = eventNames.split(/\\s+/);\n binding = binding || this;\n\n while (eventName = eventNames.shift()) {\n callbacks = allCallbacks[eventName];\n\n if (!callbacks) {\n callbacks = allCallbacks[eventName] = [];\n }\n\n if (indexOf(callbacks, callback) === -1) {\n callbacks.push([callback, binding]);\n }\n }\n },\n\n off: function(eventNames, callback) {\n var allCallbacks = callbacksFor(this), callbacks, eventName, index;\n eventNames = eventNames.split(/\\s+/);\n\n while (eventName = eventNames.shift()) {\n if (!callback) {\n allCallbacks[eventName] = [];\n continue;\n }\n\n callbacks = allCallbacks[eventName];\n\n index = indexOf(callbacks, callback);\n\n if (index !== -1) { callbacks.splice(index, 1); }\n }\n },\n\n trigger: function(eventName, options) {\n var allCallbacks = callbacksFor(this),\n callbacks, callbackTuple, callback, binding, event;\n\n if (callbacks = allCallbacks[eventName]) {\n // Don't cache the callbacks.length since it may grow\n for (var i=0; i<callbacks.length; i++) {\n callbackTuple = callbacks[i];\n callback = callbackTuple[0];\n binding = callbackTuple[1];\n\n if (typeof options !== 'object') {\n options = { detail: options };\n }\n\n event = new Event(eventName, options);\n callback.call(binding, event);\n }\n }\n }\n };\n\n\n __exports__.EventTarget = EventTarget;\n });\ndefine(\"rsvp/hash\",\n [\"rsvp/defer\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var defer = __dependency1__.defer;\n\n function size(object) {\n var s = 0;\n\n for (var prop in object) {\n s++;\n }\n\n return s;\n }\n\n function hash(promises) {\n var results = {}, deferred = defer(), remaining = size(promises);\n\n if (remaining === 0) {\n deferred.resolve({});\n }\n\n var resolver = function(prop) {\n return function(value) {\n resolveAll(prop, value);\n };\n };\n\n var resolveAll = function(prop, value) {\n results[prop] = value;\n if (--remaining === 0) {\n deferred.resolve(results);\n }\n };\n\n var rejectAll = function(error) {\n deferred.reject(error);\n };\n\n for (var prop in promises) {\n if (promises[prop] && typeof promises[prop].then === 'function') {\n promises[prop].then(resolver(prop), rejectAll);\n } else {\n resolveAll(prop, promises[prop]);\n }\n }\n\n return deferred.promise;\n }\n\n\n __exports__.hash = hash;\n });\ndefine(\"rsvp/node\",\n [\"rsvp/promise\",\"rsvp/all\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n var all = __dependency2__.all;\n\n function makeNodeCallbackFor(resolve, reject) {\n return function (error, value) {\n if (error) {\n reject(error);\n } else if (arguments.length > 2) {\n resolve(Array.prototype.slice.call(arguments, 1));\n } else {\n resolve(value);\n }\n };\n }\n\n function denodeify(nodeFunc) {\n return function() {\n var nodeArgs = Array.prototype.slice.call(arguments), resolve, reject;\n var thisArg = this;\n\n var promise = new Promise(function(nodeResolve, nodeReject) {\n resolve = nodeResolve;\n reject = nodeReject;\n });\n\n all(nodeArgs).then(function(nodeArgs) {\n nodeArgs.push(makeNodeCallbackFor(resolve, reject));\n\n try {\n nodeFunc.apply(thisArg, nodeArgs);\n } catch(e) {\n reject(e);\n }\n });\n\n return promise;\n };\n }\n\n\n __exports__.denodeify = denodeify;\n });\ndefine(\"rsvp/promise\",\n [\"rsvp/config\",\"rsvp/events\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var config = __dependency1__.config;\n var EventTarget = __dependency2__.EventTarget;\n\n function objectOrFunction(x) {\n return isFunction(x) || (typeof x === \"object\" && x !== null);\n }\n\n function isFunction(x){\n return typeof x === \"function\";\n }\n\n var Promise = function(resolver) {\n var promise = this,\n resolved = false;\n\n if (typeof resolver !== 'function') {\n throw new TypeError('You must pass a resolver function as the sole argument to the promise constructor');\n }\n\n if (!(promise instanceof Promise)) {\n return new Promise(resolver);\n }\n\n var resolvePromise = function(value) {\n if (resolved) { return; }\n resolved = true;\n resolve(promise, value);\n };\n\n var rejectPromise = function(value) {\n if (resolved) { return; }\n resolved = true;\n reject(promise, value);\n };\n\n this.on('promise:resolved', function(event) {\n this.trigger('success', { detail: event.detail });\n }, this);\n\n this.on('promise:failed', function(event) {\n this.trigger('error', { detail: event.detail });\n }, this);\n\n this.on('error', onerror);\n\n try {\n resolver(resolvePromise, rejectPromise);\n } catch(e) {\n rejectPromise(e);\n }\n };\n\n function onerror(event) {\n if (config.onerror) {\n config.onerror(event.detail);\n }\n }\n\n var invokeCallback = function(type, promise, callback, event) {\n var hasCallback = isFunction(callback),\n value, error, succeeded, failed;\n\n if (hasCallback) {\n try {\n value = callback(event.detail);\n succeeded = true;\n } catch(e) {\n failed = true;\n error = e;\n }\n } else {\n value = event.detail;\n succeeded = true;\n }\n\n if (handleThenable(promise, value)) {\n return;\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (failed) {\n reject(promise, error);\n } else if (type === 'resolve') {\n resolve(promise, value);\n } else if (type === 'reject') {\n reject(promise, value);\n }\n };\n\n Promise.prototype = {\n constructor: Promise,\n\n isRejected: undefined,\n isFulfilled: undefined,\n rejectedReason: undefined,\n fulfillmentValue: undefined,\n\n then: function(done, fail) {\n this.off('error', onerror);\n\n var thenPromise = new this.constructor(function() {});\n\n if (this.isFulfilled) {\n config.async(function(promise) {\n invokeCallback('resolve', thenPromise, done, { detail: promise.fulfillmentValue });\n }, this);\n }\n\n if (this.isRejected) {\n config.async(function(promise) {\n invokeCallback('reject', thenPromise, fail, { detail: promise.rejectedReason });\n }, this);\n }\n\n this.on('promise:resolved', function(event) {\n invokeCallback('resolve', thenPromise, done, event);\n });\n\n this.on('promise:failed', function(event) {\n invokeCallback('reject', thenPromise, fail, event);\n });\n\n return thenPromise;\n },\n\n fail: function(fail) {\n return this.then(null, fail);\n }\n };\n\n EventTarget.mixin(Promise.prototype);\n\n function resolve(promise, value) {\n if (promise === value) {\n fulfill(promise, value);\n } else if (!handleThenable(promise, value)) {\n fulfill(promise, value);\n }\n }\n\n function handleThenable(promise, value) {\n var then = null,\n resolved;\n\n try {\n if (promise === value) {\n throw new TypeError(\"A promises callback cannot return that same promise.\");\n }\n\n if (objectOrFunction(value)) {\n then = value.then;\n\n if (isFunction(then)) {\n then.call(value, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n if (value !== val) {\n resolve(promise, val);\n } else {\n fulfill(promise, val);\n }\n }, function(val) {\n if (resolved) { return true; }\n resolved = true;\n\n reject(promise, val);\n });\n\n return true;\n }\n }\n } catch (error) {\n reject(promise, error);\n return true;\n }\n\n return false;\n }\n\n function fulfill(promise, value) {\n config.async(function() {\n promise.trigger('promise:resolved', { detail: value });\n promise.isFulfilled = true;\n promise.fulfillmentValue = value;\n });\n }\n\n function reject(promise, value) {\n config.async(function() {\n promise.trigger('promise:failed', { detail: value });\n promise.isRejected = true;\n promise.rejectedReason = value;\n });\n }\n\n\n __exports__.Promise = Promise;\n });\ndefine(\"rsvp/reject\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n function reject(reason) {\n return new Promise(function (resolve, reject) {\n reject(reason);\n });\n }\n\n\n __exports__.reject = reject;\n });\ndefine(\"rsvp/resolve\",\n [\"rsvp/promise\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Promise = __dependency1__.Promise;\n\n function resolve(thenable) {\n return new Promise(function(resolve, reject) {\n resolve(thenable);\n });\n }\n\n\n __exports__.resolve = resolve;\n });\ndefine(\"rsvp/rethrow\",\n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var local = (typeof global === \"undefined\") ? this : global;\n\n function rethrow(reason) {\n local.setTimeout(function() {\n throw reason;\n });\n throw reason;\n }\n\n\n __exports__.rethrow = rethrow;\n });\ndefine(\"rsvp\",\n [\"rsvp/events\",\"rsvp/promise\",\"rsvp/node\",\"rsvp/all\",\"rsvp/hash\",\"rsvp/rethrow\",\"rsvp/defer\",\"rsvp/config\",\"rsvp/resolve\",\"rsvp/reject\",\"exports\"],\n function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {\n \"use strict\";\n var EventTarget = __dependency1__.EventTarget;\n var Promise = __dependency2__.Promise;\n var denodeify = __dependency3__.denodeify;\n var all = __dependency4__.all;\n var hash = __dependency5__.hash;\n var rethrow = __dependency6__.rethrow;\n var defer = __dependency7__.defer;\n var config = __dependency8__.config;\n var resolve = __dependency9__.resolve;\n var reject = __dependency10__.reject;\n\n function configure(name, value) {\n config[name] = value;\n }\n\n\n __exports__.Promise = Promise;\n __exports__.EventTarget = EventTarget;\n __exports__.all = all;\n __exports__.hash = hash;\n __exports__.rethrow = rethrow;\n __exports__.defer = defer;\n __exports__.denodeify = denodeify;\n __exports__.configure = configure;\n __exports__.resolve = resolve;\n __exports__.reject = reject;\n });\n})();\n//@ sourceURL=rsvp");
\ No newline at end of file