text: webpackJsonp([1],[function(e,t,n){n(2),e.exports=n(1)},function(e,t,n){!function(e){var t=t||{};e.ENTER_KEY=13,e.ESC_KEY=27,e.app=t;{var r=n(7),i=n(8),o=n(4);new r}t.todoRouter=new i,o.history.start()}(window)},function(e,t,n){var r,i=function(){return r.indexOf(n.h())>=0},o=function a(){e.hot.check(!0,function(t,r){return t?void(e.hot.status()in{abort:1,fail:1}?(console.warn("[HMR] Cannot apply update. Need to do a full reload!"),console.warn("[HMR] "+t.stack||t.message),window.location.reload()):console.warn("[HMR] Update failed: "+t.stack||t.message)):r?(i()||a(),n(9)(r,r),void(i()&&console.log("[HMR] App is up to date."))):(console.warn("[HMR] Cannot find update. Need to do a full reload!"),console.warn("[HMR] (Probably because of restarting the webpack-dev-server)"),void window.location.reload())})},s=window.addEventListener?function(e,t){window.addEventListener(e,t,!1)}:function(e,t){window.attachEvent("on"+e,t)};s("message",function(t){"string"==typeof t.data&&0===t.data.indexOf("webpackHotUpdate")&&(r=t.data,i()||"idle"!==e.hot.status()||(console.log("[HMR] Checking for updates on the server..."),o()))}),console.log("[HMR] Waiting for update signal from WDS...")},,,,,function(e,t,n){var r=n(4),i=n(10),o=n(11),s=n(12),a=n(6);app.todos=new o;var u=r.View.extend({el:"#todoapp",events:{"keypress #new-todo":"createOnEnter","click #toggle-all":"toggleAllComplete"},initialize:function(){this.allCheckbox=this.$("#toggle-all")[0],this.$input=this.$("#new-todo"),this.$footer=this.$("#footer"),this.$main=this.$("#main"),this.$list=this.$("#todo-list"),this.listenTo(app.todos,"add reset remove",this.render),this.listenTo(app.todos,"change:completed",this.toggleCheck),app.footerView=new s({collection:app.todos}),app.todoListView=new i({collection:app.todos}),app.todos.fetch({reset:!0})},render:function(){this.renderMain(),this.renderFooter()},renderMain:function(){app.todos.length?(this.$list.append(app.todoListView.el),this.$main.show(),this.toggleCheck()):this.$main.hide()},renderFooter:function(){app.todos.length?(this.$footer.append(app.footerView.el),this.$footer.show()):this.$footer.hide()},createOnEnter:function(e){var t=this.$input.val().trim();e.which===ENTER_KEY&&t&&(app.todos.create(this.newTodoAttrs(t)),this.$input.val(""))},newTodoAttrs:function(e){return{title:e,order:app.todos.nextOrder(),completed:!1}},toggleAllComplete:function(){var e=this.allCheckbox.checked;a.invoke(app.todos.where({completed:!e}),"save",{completed:e})},toggleCheck:function(){var e=app.todos.where({completed:!1}).length;this.allCheckbox.checked=!e}});e.exports=u},function(e,t,n){var r=n(4),i=r.Router.extend({routes:{"*filter":"setFilter"},setFilter:function(e){app.TODO_FILTER=e||"",app.todos.trigger("filter",e)}});e.exports=i},function(e,t,n){e.exports=function(e,t){var n=e.filter(function(e){return t&&t.indexOf(e)<0});n.length>0&&(console.warn("[HMR] The following modules couldn't be hot updated: (They would need a full reload!)"),n.forEach(function(e){console.warn("[HMR]  - "+e)})),t&&0!==t.length?(console.log("[HMR] Updated modules:"),t.forEach(function(e){console.log("[HMR]  - "+e)})):console.log("[HMR] Nothing hot updated.")}},function(e,t,n){var r=n(4),i=n(13),o=r.View.extend({tagName:"ul",initialize:function(){this.listenTo(this.collection,{add:this.addOne,reset:this.addAll,"change:completed":this.filterOne,filter:this.filterAll,destroy:this.render})},render:function(){},addOne:function(e){var t=new i({model:e});this.$el.append(t.el)},addAll:function(){this.$el.html(""),this.collection.each(this.addOne,this)},filterOne:function(e){e.trigger("visible")},filterAll:function(){this.collection.each(this.filterOne,this)}});e.exports=o},function(e,t,n){var r=n(4);r.localStorage=n(5);var i=n(14),o=r.Collection.extend({model:i,localStorage:new r.LocalStorage("todos-backbone"),comparator:"order",remaining:function(){return this.where({completed:!1})},completed:function(){return this.where({completed:!0})},nextOrder:function(){return this.length?this.last().get("order")+1:1}});e.exports=o},function(e,t,n){var r=n(4),i=n(6),o=n(16),s=r.View.extend({template:o,events:{"click #clear-completed":"clearCompleted"},initialize:function(){this.listenTo(this.collection,"add remove reset change:completed",this.render),this.listenTo(this.collection,"filter",this.setSelectedTab)},render:function(){var e=this.collection.where({completed:!1}).length,t=this.collection.where({completed:!0}).length,n=this.template({remaining:e,completed:t});this.$el.html(n),this.setSelectedTab()},setSelectedTab:function(e){this.$("#filters li a").removeClass("selected").filter('[href="#/'+(e||"")+'"]').addClass("selected")},clearCompleted:function(){i.invoke(this.collection.completed(),"destroy")}});e.exports=s},function(e,t,n){var r=n(4),i=n(3),o=n(17),s=r.View.extend({tagName:"li",template:o,events:{"click .toggle":"toggleCompleted","dblclick label":"edit","click .destroy":"clear","keypress .edit":"updateOnEnter","keydown .edit":"revertOnEscape","blur .edit":"close"},initialize:function(){this.listenTo(this.model,{change:this.render,destroy:this.remove,visible:this.toggleVisible}),this.render()},render:function(){if(void 0===this.model.changed.id){var e=this.template(this.model.toJSON());return this.$el.html(e),this.$el.toggleClass("completed",this.model.get("completed")),this.toggleVisible(),this.$input=this.$(".edit"),this}},toggleVisible:function(){this.$el.toggleClass("hidden",this._isHidden())},_isHidden:function(){return this.model.get("completed")?"active"==app.TODO_FILTER:"completed"==app.TODO_FILTER},toggleCompleted:function(){this.model.toggleCompleted()},clear:function(){this.model.destroy()},edit:function(){this.$el.addClass("editing"),this.$input.focus()},updateOnEnter:function(e){var t=this.$input.val(),n=i.trim(t);e.which===ENTER_KEY&&(n?(this.model.save({title:n}),t!==n?this.model.trigger("change"):""):this.clear(),this.close())},revertOnEscape:function(e){e.which===ESC_KEY&&(this.$el.val(this.model.get("title")),this.close())},close:function(){this.$el.removeClass("editing")}});e.exports=s},function(e,t,n){var r=n(4),i=r.Model.extend({defaults:{title:"",completed:!1},toggleCompleted:function(){this.save({completed:!this.get("completed")})}});e.exports=i},,function(module,exports,__webpack_require__){module.exports=function(obj){obj||(obj={});{var __t,__p="";Array.prototype.join}with(obj)__p+='<span id="todo-count"><strong>'+(null==(__t=remaining)?"":__t)+"</strong> "+(null==(__t=1===remaining?"item":"items")?"":__t)+' left</span>\n<ul id="filters">\n    <li>\n        <a class="selected" href="#/">All</a>\n    </li>\n    <li>\n        <a href="#/active">Active</a>\n    </li>\n    <li>\n        <a href="#/completed">Completed</a>\n    </li>\n</ul>\n',completed&&(__p+='\n<button id="clear-completed">Clear completed ('+(null==(__t=completed)?"":__t)+")</button>\n");return __p}},function(module,exports,__webpack_require__){(function(_){module.exports=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<div class="view">\n    <input class="toggle" type="checkbox" '+(null==(__t=completed?"checked":"")?"":__t)+">\n    <label>"+__e(title)+'</label>\n    <button class="destroy"></button>\n</div>\n<input class="edit" value="'+__e(title)+'">';return __p}}).call(exports,__webpack_require__(6))}]);