text: webpackJsonp([1],{"33I7":function(s,e){},IxGP:function(s,e){},NHnr:function(s,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=t("7+uW"),n=t("gRE1"),i=t.n(n),o=t("fZjL"),c=t.n(o),d=t("Sazm"),l=t.n(d).a.initializeApp({apiKey:"AIzaSyDB4jxgWYruSRGEz8MMte030FK8DWqm_rk",databaseURL:"https://todo-a1b8c.firebaseio.com/",storageBucket:"todo-a1b8c"}),r={render:function(){var s=this,e=s.$createElement,t=s._self._c||e;return t("div",{staticClass:"task-list"},s._l(s.assignees,function(e,a){return t("div",{staticClass:"inbox"},[s._v("\n    Tasks For: "+s._s(e)+" "),s.loggedIn?t("span",{staticClass:"fa fa-trash",on:{click:function(t){s.deleteList(e)}}}):s._e(),s._v(" "),s._l(s.tasks[a],function(n,i){return t("div",{staticClass:"item"},[t("span",[t("input",{attrs:{type:"checkbox"},domProps:{checked:n.complete},on:{click:function(t){s.completeTask(e,s.taskKeys[a][i])}}}),s._v(" "),t("span",{class:{task__complete:n.complete}},[s._v(" "+s._s(n.task)+" ")])]),s._v(" "),s.loggedIn?t("div",{staticClass:"fa fa-minus-circle",on:{click:function(t){s.deleteItem(e,s.taskKeys[a][i])}}}):s._e()])})],2)}))},staticRenderFns:[]};var p={render:function(){var s=this,e=s.$createElement,t=s._self._c||e;return s.loggedIn?t("div",{staticClass:"admin"},[t("div",{staticClass:"control-panel"},[t("div",{staticClass:"control-panel__title",on:{click:s.sendAssignee}},[t("button",{staticClass:"assignee-add"},[s._v("\n                Add Assignee\n            ")])]),s._v(" "),t("div",{staticClass:"control-panel__input"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.assignee,expression:"assignee"}],attrs:{type:"text"},domProps:{value:s.assignee},on:{input:function(e){e.target.composing||(s.assignee=e.target.value)}}})])]),s._v(" "),s._l(s.assignees,function(e){return t("div",{staticClass:"control-panel"},[t("div",{staticClass:"control-panel__title"},[t("button",{staticClass:"add_task",on:{click:function(t){s.sendTaskToAssignee(e)}}},[s._v("\n                Add Task For: "+s._s(e)+"\n            ")])]),s._v(" "),t("div",{staticClass:"control-panel__input"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.task,expression:"task"}],attrs:{type:"text"},domProps:{value:s.task},on:{input:function(e){e.target.composing||(s.task=e.target.value)}}})])])})],2):s._e()},staticRenderFns:[]};var u={name:"App",components:{toDo:t("VU/8")({name:"toDo",props:["assignees","tasks","taskKeys","database","loggedIn"],data:function(){return{}},methods:{completeTask:function(s,e){var t=this,a={};this.$props.database.ref("/"+s+"/tasks/"+e+"/complete").once("value").then(function(n){n.val()?a["/"+s+"/tasks/"+e+"/complete"]=!1:a["/"+s+"/tasks/"+e+"/complete"]=!0,t.$props.database.ref().update(a)})},deleteItem:function(s,e){this.$props.database.ref("/"+s+"/tasks/"+e+"/").remove()},deleteList:function(s){this.$props.database.ref("/"+s+"/").remove()}},mounted:function(){}},r,!1,function(s){t("33I7")},null,null).exports,admin:t("VU/8")({name:"admin",props:["assignees","assigneeKeys","database","loggedIn"],data:function(){return{assignee:"",task:""}},methods:{sendAssignee:function(){this.assignee.length>0&&this.$props.database.ref("/"+this.assignee).set(this.assignee)},sendTaskToAssignee:function(s){this.$props.database.ref("/"+s+"/tasks").push({task:this.task,complete:!1}),this.task=""}},mounted:function(){}},p,!1,function(s){t("z3rf")},"data-v-2540f4cb",null).exports},data:function(){return{assigneeKeys:[],database:l.database(),dbRoot:l.database().ref("/"),assignees:null,tasks:[],taskKeys:[],adminInput:!1,password:"",loggedIn:!1}},methods:{checkAdminAccess:function(){"212ericson"===this.password.toLowerCase()&&(this.loggedIn=!0)},openAdminOrLogOut:function(){this.loggedIn?this.loggedIn=!1:this.adminInput=!this.adminInput}},mounted:function(){var s=this;this.dbRoot.on("value",function(e){s.assignees=e.val()?c()(e.val()):[],s.taskKeys=[],s.tasks=[],s.assigneeKeys=[],e.forEach(function(e){var t=e.val().tasks?i()(e.val().tasks):[],a=e.val().tasks?c()(e.val().tasks):[];s.taskKeys.push(a),s.tasks.push(t),s.assigneeKeys.push(e.key)})})}},g={render:function(){var s=this,e=s.$createElement,t=s._self._c||e;return t("div",{attrs:{id:"app"}},[t("button",{staticClass:"admin-access-button",on:{click:s.openAdminOrLogOut}},[s.loggedIn?s._e():t("span",[s._v("Admin")]),s._v(" "),s.loggedIn?t("span",[s._v(" Logout ")]):s._e()]),s._v(" "),s.loggedIn?s._e():t("div",{staticClass:"admin-controls"},[s.adminInput?t("input",{directives:[{name:"model",rawName:"v-model",value:s.password,expression:"password"}],attrs:{placeholder:"password",type:"password"},domProps:{value:s.password},on:{input:function(e){e.target.composing||(s.password=e.target.value)}}}):s._e(),s._v(" "),s.adminInput?t("button",{on:{click:s.checkAdminAccess}},[s._v("Submit")]):s._e()]),s._v(" "),t("admin",{attrs:{assignees:s.assignees,assigneeKeys:s.assigneeKeys,database:s.database,loggedIn:s.loggedIn}}),s._v(" "),t("toDo",{attrs:{assignees:s.assignees,tasks:s.tasks,taskKeys:s.taskKeys,database:s.database,loggedIn:s.loggedIn}})],1)},staticRenderFns:[]};var m=t("VU/8")(u,g,!1,function(s){t("IxGP")},null,null).exports;a.a.config.productionTip=!1,new a.a({el:"#app",components:{App:m},template:"<App/>"})},z3rf:function(s,e){}},["NHnr"]);
  //# sourceMappingURL=app.c52979cb1fb1300dc120.js.map