"use strict"
define("todomvc/app",["exports","ember","todomvc/resolver","ember-load-initializers","todomvc/config/environment"],function(e,t,o,n,l){var i=void 0
t.default.MODEL_FACTORY_INJECTIONS=!0,i=t.default.Application.extend({modulePrefix:l.default.modulePrefix,podModulePrefix:l.default.podModulePrefix,Resolver:o.default}),(0,n.default)(i,l.default.modulePrefix),e.default=i}),define("todomvc/components/todo-item",["exports","ember"],function(e,t){e.default=t.default.Component.extend({repo:t.default.inject.service(),tagName:"li",editing:!1,classNameBindings:["todo.completed","editing"],actions:{startEditing:function(){this.get("onStartEdit")(),this.set("editing",!0),t.default.run.scheduleOnce("afterRender",this,"focusInput")},doneEditing:function(e){this.get("editing")&&(t.default.isBlank(e)?this.send("removeTodo"):(this.set("todo.title",e.trim()),this.set("editing",!1),this.get("onEndEdit")()))},handleKeydown:function(e){13===e.keyCode?e.target.blur():27===e.keyCode&&this.set("editing",!1)},toggleCompleted:function(e){var o=this.get("todo")
t.default.set(o,"completed",e.target.checked),this.get("repo").persist()},removeTodo:function(){this.get("repo").delete(this.get("todo"))}},focusInput:function(){this.element.querySelector("input.edit").focus()}})}),define("todomvc/components/todo-list",["exports","ember"],function(e,t){e.default=t.default.Component.extend({repo:t.default.inject.service(),tagName:"section",elementId:"main",canToggle:!0,allCompleted:t.default.computed("todos.@each.completed",function(){return this.get("todos").isEvery("completed")}),actions:{enableToggle:function(){this.set("canToggle",!0)},disableToggle:function(){this.set("canToggle",!1)},toggleAll:function(){var e=this.get("allCompleted")
this.get("todos").forEach(function(o){return t.default.set(o,"completed",!e)}),this.get("repo").persist()}}})}),define("todomvc/controllers/active",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({todos:t.default.computed.filterBy("model","completed",!1)})}),define("todomvc/controllers/application",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({repo:t.default.inject.service(),remaining:t.default.computed.filterBy("model","completed",!1),completed:t.default.computed.filterBy("model","completed"),actions:{createTodo:function(e){13!==e.keyCode||t.default.isBlank(e.target.value)||(this.get("repo").add({title:e.target.value.trim(),completed:!1}),e.target.value="")},clearCompleted:function(){this.get("model").removeObjects(this.get("completed")),this.get("repo").persist()}}})}),define("todomvc/controllers/completed",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({todos:t.default.computed.filterBy("model","completed",!0)})}),define("todomvc/helpers/app-version",["exports","ember","todomvc/config/environment","ember-cli-app-version/utils/regexp"],function(e,t,o,n){function l(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1]
return t.hideSha?i.match(n.versionRegExp)[0]:t.hideVersion?i.match(n.shaRegExp)[0]:i}e.appVersion=l
var i=o.default.APP.version
e.default=t.default.Helper.helper(l)}),define("todomvc/helpers/gt",["exports","ember"],function(e,t){function o(e){var t=n(e,2)
return t[0]>t[1]}var n=function(){function e(e,t){var o=[],n=!0,l=!1,i=void 0
try{for(var a,d=e[Symbol.iterator]();!(n=(a=d.next()).done)&&(o.push(a.value),!t||o.length!==t);n=!0);}catch(e){l=!0,i=e}finally{try{!n&&d.return&&d.return()}finally{if(l)throw i}}return o}return function(t,o){if(Array.isArray(t))return t
if(Symbol.iterator in Object(t))return e(t,o)
throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()
e.gt=o,e.default=t.default.Helper.helper(o)}),define("todomvc/helpers/pluralize",["exports","ember","ember-inflector"],function(e,t,o){function n(e){var t=l(e,2),n=t[0]
return 1===t[1]?n:(0,o.pluralize)(n)}var l=function(){function e(e,t){var o=[],n=!0,l=!1,i=void 0
try{for(var a,d=e[Symbol.iterator]();!(n=(a=d.next()).done)&&(o.push(a.value),!t||o.length!==t);n=!0);}catch(e){l=!0,i=e}finally{try{!n&&d.return&&d.return()}finally{if(l)throw i}}return o}return function(t,o){if(Array.isArray(t))return t
if(Symbol.iterator in Object(t))return e(t,o)
throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()
e.pluralizeHelper=n,e.default=t.default.Helper.helper(n)}),define("todomvc/helpers/singularize",["exports","ember-inflector/lib/helpers/singularize"],function(e,t){e.default=t.default}),define("todomvc/initializers/app-version",["exports","ember-cli-app-version/initializer-factory","todomvc/config/environment"],function(e,t,o){var n=o.default.APP,l=n.name,i=n.version
e.default={name:"App Version",initialize:(0,t.default)(l,i)}}),define("todomvc/initializers/container-debug-adapter",["exports","ember-resolver/container-debug-adapter"],function(e,t){e.default={name:"container-debug-adapter",initialize:function(){var e=arguments[1]||arguments[0]
e.register("container-debug-adapter:main",t.default),e.inject("container-debug-adapter:main","namespace","application:main")}}}),define("todomvc/initializers/export-application-global",["exports","ember","todomvc/config/environment"],function(e,t,o){function n(){var e=arguments[1]||arguments[0]
if(!1!==o.default.exportApplicationGlobal){var n
if("undefined"!=typeof window)n=window
else if("undefined"!=typeof global)n=global
else{if("undefined"==typeof self)return
n=self}var l,i=o.default.exportApplicationGlobal
l="string"==typeof i?i:t.default.String.classify(o.default.modulePrefix),n[l]||(n[l]=e,e.reopen({willDestroy:function(){this._super.apply(this,arguments),delete n[l]}}))}}e.initialize=n,e.default={name:"export-application-global",initialize:n}}),define("todomvc/resolver",["exports","ember-resolver"],function(e,t){e.default=t.default}),define("todomvc/router",["exports","ember","todomvc/config/environment"],function(e,t,o){var n=t.default.Router.extend({location:o.default.locationType,rootURL:o.default.rootURL})
n.map(function(){this.route("active"),this.route("completed")}),e.default=n}),define("todomvc/routes/application",["exports","ember"],function(e,t){e.default=t.default.Route.extend({repo:t.default.inject.service(),model:function(){return this.get("repo").findAll()}})}),define("todomvc/services/ajax",["exports","ember-ajax/services/ajax"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("todomvc/services/memory",["exports"],function(e){(function(e){var t={},o={}
t.length=0,t.getItem=function(e){return o[e]||null},t.setItem=function(e,n){void 0===n?t.removeItem(e):(o.hasOwnProperty(e)||t.length++,o[e]=""+n)},t.removeItem=function(e){o.hasOwnProperty(e)&&(delete o[e],t.length--)},t.key=function(e){return Object.keys(o)[e]||null},t.clear=function(){o={},t.length=0},e.localStorageMemory=t})(window)}),define("todomvc/services/repo",["exports","ember","todomvc/services/memory"],function(e,t,o){e.default=t.default.Service.extend({lastId:0,data:null,findAll:function(){return this.get("data")||this.set("data",JSON.parse(window.localStorageMemory.getItem("todos")||"[]"))},add:function(e){var t=Object.assign({id:this.incrementProperty("lastId")},e)
return this.get("data").pushObject(t),this.persist(),t},delete:function(e){this.get("data").removeObject(e),this.persist()},persist:function(){window.localStorageMemory.setItem("todos",JSON.stringify(this.get("data")))}})}),define("todomvc/templates/active",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"aAsc4Lt8",block:'{"statements":[[1,[33,["todo-list"],null,[["todos"],[[28,["todos"]]]]],false]],"locals":[],"named":[],"yields":[],"hasPartials":false}',meta:{moduleName:"todomvc/templates/active.hbs"}})}),define("todomvc/templates/application",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"BYnyz5ON",block:'{"statements":[[11,"section",[]],[15,"id","todoapp"],[13],[0,"\\n  "],[11,"header",[]],[15,"id","header"],[13],[0,"\\n    "],[11,"h1",[]],[13],[0,"todos"],[14],[0,"\\n    "],[11,"input",[]],[15,"type","text"],[15,"id","new-todo"],[16,"onkeydown",[33,["action"],[[28,[null]],"createTodo"],null],null],[15,"placeholder","What needs to be done?"],[15,"autofocus",""],[13],[14],[0,"\\n  "],[14],[0,"\\n    "],[1,[26,["outlet"]],false],[0,"\\n"],[6,["if"],[[33,["gt"],[[28,["model","length"]],0],null]],null,{"statements":[[0,"      "],[11,"footer",[]],[15,"id","footer"],[13],[0,"\\n        "],[11,"span",[]],[15,"id","todo-count"],[13],[11,"strong",[]],[13],[1,[28,["remaining","length"]],false],[14],[0," "],[1,[33,["pluralize"],["item",[28,["remaining","length"]]],null],false],[0," left"],[14],[0,"\\n        "],[11,"ul",[]],[15,"id","filters"],[13],[0,"\\n          "],[11,"li",[]],[13],[6,["link-to"],["index"],[["activeClass"],["selected"]],{"statements":[[0,"All"]],"locals":[]},null],[14],[0,"\\n          "],[11,"li",[]],[13],[6,["link-to"],["active"],[["activeClass"],["selected"]],{"statements":[[0,"Active"]],"locals":[]},null],[14],[0,"\\n          "],[11,"li",[]],[13],[6,["link-to"],["completed"],[["activeClass"],["selected"]],{"statements":[[0,"Completed"]],"locals":[]},null],[14],[0,"\\n        "],[14],[0,"\\n"],[6,["if"],[[28,["completed","length"]]],null,{"statements":[[0,"          "],[11,"button",[]],[15,"id","clear-completed"],[16,"onclick",[33,["action"],[[28,[null]],"clearCompleted"],null],null],[13],[0,"Clear completed"],[14],[0,"\\n"]],"locals":[]},null],[0,"      "],[14],[0,"\\n"]],"locals":[]},null],[14],[0,"\\n"],[11,"footer",[]],[15,"id","info"],[13],[0,"\\n  "],[11,"p",[]],[13],[0,"Double-click to edit a todo"],[14],[0,"\\n  "],[11,"p",[]],[13],[0,"\\n    Created by\\n    "],[11,"a",[]],[15,"href","http://github.com/cibernox"],[13],[0,"Miguel Camba"],[14],[0,",\\n    "],[11,"a",[]],[15,"href","http://github.com/addyosmani"],[13],[0,"Addy Osmani"],[14],[0,"\\n  "],[14],[0,"\\n  "],[11,"p",[]],[13],[0,"Part of "],[11,"a",[]],[15,"href","http://todomvc.com"],[13],[0,"TodoMVC"],[14],[14],[0,"\\n"],[14]],"locals":[],"named":[],"yields":[],"hasPartials":false}',meta:{moduleName:"todomvc/templates/application.hbs"}})}),define("todomvc/templates/completed",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"F4la9wtb",block:'{"statements":[[1,[33,["todo-list"],null,[["todos"],[[28,["todos"]]]]],false]],"locals":[],"named":[],"yields":[],"hasPartials":false}',meta:{moduleName:"todomvc/templates/completed.hbs"}})}),define("todomvc/templates/components/todo-item",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"dQ3+cK5E",block:'{"statements":[[11,"div",[]],[15,"class","view"],[13],[0,"\\n  "],[11,"input",[]],[15,"type","checkbox"],[15,"class","toggle"],[16,"checked",[28,["todo","completed"]],null],[16,"onchange",[33,["action"],[[28,[null]],"toggleCompleted"],null],null],[13],[14],[0,"\\n  "],[11,"label",[]],[16,"ondblclick",[33,["action"],[[28,[null]],"startEditing"],null],null],[13],[1,[28,["todo","title"]],false],[14],[0,"\\n  "],[11,"button",[]],[16,"onclick",[33,["action"],[[28,[null]],"removeTodo"],null],null],[15,"class","destroy"],[13],[14],[0,"\\n"],[14],[0,"\\n"],[11,"input",[]],[15,"type","text"],[15,"class","edit"],[16,"value",[28,["todo","title"]],null],[16,"onblur",[33,["action"],[[28,[null]],"doneEditing"],[["value"],["target.value"]]],null],[16,"onkeydown",[33,["action"],[[28,[null]],"handleKeydown"],null],null],[15,"autofocus",""],[13],[14]],"locals":[],"named":[],"yields":[],"hasPartials":false}',meta:{moduleName:"todomvc/templates/components/todo-item.hbs"}})}),define("todomvc/templates/components/todo-list",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"XGmWWD63",block:'{"statements":[[6,["if"],[[28,["todos","length"]]],null,{"statements":[[6,["if"],[[28,["canToggle"]]],null,{"statements":[[0,"    "],[11,"input",[]],[15,"type","checkbox"],[15,"id","toggle-all"],[16,"checked",[26,["allCompleted"]],null],[16,"onchange",[33,["action"],[[28,[null]],"toggleAll"],null],null],[13],[14],[0,"\\n"]],"locals":[]},null],[0,"  "],[11,"ul",[]],[15,"id","todo-list"],[15,"class","todo-list"],[13],[0,"\\n"],[6,["each"],[[28,["todos"]]],null,{"statements":[[0,"      "],[1,[33,["todo-item"],null,[["todo","onStartEdit","onEndEdit"],[[28,["todo"]],[33,["action"],[[28,[null]],"disableToggle"],null],[33,["action"],[[28,[null]],"enableToggle"],null]]]],false],[0,"\\n"]],"locals":["todo"]},null],[0,"  "],[14],[0,"\\n"]],"locals":[]},null]],"locals":[],"named":[],"yields":[],"hasPartials":false}',meta:{moduleName:"todomvc/templates/components/todo-list.hbs"}})}),define("todomvc/templates/index",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"hBadNIpo",block:'{"statements":[[6,["if"],[[28,["model","length"]]],null,{"statements":[[0,"  "],[1,[33,["todo-list"],null,[["todos"],[[28,["model"]]]]],false],[0,"\\n"]],"locals":[]},null]],"locals":[],"named":[],"yields":[],"hasPartials":false}',meta:{moduleName:"todomvc/templates/index.hbs"}})}),define("todomvc/config/environment",["ember"],function(e){try{var t="todomvc/config/environment",o=document.querySelector('meta[name="'+t+'"]').getAttribute("content"),n=JSON.parse(unescape(o)),l={default:n}
return Object.defineProperty(l,"__esModule",{value:!0}),l}catch(e){throw new Error('Could not read config from meta tag with name "'+t+'".')}}),runningTests||require("todomvc/app").default.create({name:"todomvc",version:"0.0.0+164d27e2"})
