(function(e){function t(t){for(var n,r,o=t[0],c=t[1],d=t[2],u=0,p=[];u=0&&this.media.splice(t,1),T.a.toast({html:"Item deleted!",classes:"green"})},setFile:function(e){var t=e.target.files||e.dataTransfer.files;(t||t.length)&&(this.file=t[0])},addAttachment:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.uploading){t.next=2;break}return t.abrupt("return");case 2:if(""!=e.caption){t.next=5;break}return T.a.toast({html:"Caption cannot be empty!",classes:"red"}),t.abrupt("return");case 5:if("video"!=e.mediaType||""!=e.videoURL){t.next=8;break}return T.a.toast({html:"Video url cannot be empty!",classes:"red"}),t.abrupt("return");case 8:if("image"!=e.mediaType||null!=e.file){t.next=11;break}return T.a.toast({html:"Select file",classes:"red"}),t.abrupt("return");case 11:return e.uploading=!0,a=new FormData,"image"==e.mediaType&&a.append("file",e.file,e.file.name),a.append("type",e.mediaType),a.append("group","media"),a.append("caption",e.caption),a.append("url",e.videoURL),t.next=20,e.$store.dispatch("addAttachment",a);case 20:n=t.sent,n.status?(T.a.toast({html:"Media uploaded successfully!",classes:"green"}),e.media.unshift(n.data)):T.a.toast({html:n.error_message,classes:"red"}),e.mediaType="image",e.caption="",e.file=null,e.videoURL="",e.$refs.filepath&&(e.$refs.filepath.value=""),e.uploading=!1;case 28:case"end":return t.stop()}}),t)})))()}}},de=ce,le=(a("1590"),Object(u["a"])(de,L,z,!1,null,"5e706ee3",null)),ue=le.exports,pe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("form",{staticClass:"card",on:{submit:function(t){return t.preventDefault(),e.addProject(t)}}},[a("h4",{staticClass:"add-project"},[e._v("New Project")]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.title,expression:"title"}],staticClass:"validate",attrs:{id:"title",type:"text",required:""},domProps:{value:e.title},on:{input:function(t){t.target.composing||(e.title=t.target.value)}}}),a("label",{attrs:{for:"title"}},[e._v("Title")])]),a("div",{staticClass:"input-field"},[a("div",{staticClass:"input-field"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.description,expression:"description"}],staticClass:"materialize-textarea",attrs:{id:"description",required:""},domProps:{value:e.description},on:{input:function(t){t.target.composing||(e.description=t.target.value)}}}),a("label",{attrs:{for:"description"}},[e._v("Description")])])]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.currency,expression:"currency"}],staticClass:"validate",attrs:{id:"currency",type:"text",required:""},domProps:{value:e.currency},on:{input:function(t){t.target.composing||(e.currency=t.target.value)}}}),a("label",{attrs:{for:"currency"}},[e._v("Currency")])]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.fundsRequired,expression:"fundsRequired"}],staticClass:"validate",attrs:{id:"funds_required",type:"number",required:""},domProps:{value:e.fundsRequired},on:{input:function(t){t.target.composing||(e.fundsRequired=t.target.value)}}}),a("label",{attrs:{for:"funds_required"}},[e._v("Funds Required")])]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.fundsRaised,expression:"fundsRaised"}],staticClass:"validate",attrs:{id:"funds_raised",type:"number"},domProps:{value:e.fundsRaised},on:{input:function(t){t.target.composing||(e.fundsRaised=t.target.value)}}}),a("label",{attrs:{for:"funds_raised"}},[e._v("Funds Raised")])]),a("div",{staticClass:"file-field input-field"},[a("div",{staticClass:"btn btn-small blue"},[e._m(0),a("input",{staticClass:"validate",attrs:{type:"file",required:""},on:{change:e.setFile}})]),a("div",{staticClass:"file-path-wrapper"},[a("input",{ref:"filepath",staticClass:"file-path validate",attrs:{type:"text"}})])]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.videoURL,expression:"videoURL"}],staticClass:"validate",attrs:{id:"video-url",type:"text"},domProps:{value:e.videoURL},on:{input:function(t){t.target.composing||(e.videoURL=t.target.value)}}}),a("label",{attrs:{for:"video-url"}},[e._v("Video Url")])]),a("button",{staticClass:"btn btn-primary blue",attrs:{type:"submit",disabled:e.uploading}},[e.uploading?a("span",[e._v("Adding...")]):a("span",[e._v("Add")])])]),a("h4",{staticClass:"exisiting-project"},[e._v("Existing Projects")]),e.loading||0!=e.projects.length?e._e():a("div",[e._v("No Project Found.")]),e.loading?a("div",[a("Loader")],1):a("div",{staticClass:"project-wrapper"},e._l(e.projects,(function(t){return a("ProjectItem",{key:t.id,attrs:{item:t},on:{removeProject:e.removeProject}})})),1)])},me=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("span",[a("i",{staticClass:"material-icons"},[e._v("file_upload")])])}],fe=(a("4de4"),a("a4d3"),a("e01a"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"wrapper"},[e.visible?a("Modal",{attrs:{actions:e.actions,content:"Are you sure you want to delete the project?",header:"Warning"}}):e._e(),e.editing?e._e():a("div",{staticClass:"preview"},[a("div",{staticClass:"head"},[a("h4",[e._v(e._s(e.item.project.title))]),a("div",{staticClass:"action"},[a("i",{staticClass:"material-icons red-text",on:{click:function(t){e.visible=!0}}},[e._v("delete")]),a("i",{staticClass:"material-icons grey-text",on:{click:e.enterEditMode}},[e._v("edit")])])]),a("div",{staticClass:"media"},[a("img",{attrs:{src:e.getImage()}}),e.item.attachments.filter((function(e){return"video"==e.type})).length?a("div",[a("iframe",{attrs:{src:e.getVideo()}})]):e._e()]),a("p",[e._v(e._s(e.item.project.description))]),a("p",[e._v(" Funds: "+e._s(e.item.project.funds_raised)+" / "+e._s(e.item.project.funds_required)+" ")]),a("p",[e._v("Currency: "+e._s(e.item.project.currency))])]),e.editing?a("form",{staticClass:"card",on:{submit:function(t){return t.preventDefault(),e.editProject(t)}}},[a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.title,expression:"title"}],staticClass:"validate",attrs:{id:"title",type:"text",required:""},domProps:{value:e.title},on:{input:function(t){t.target.composing||(e.title=t.target.value)}}}),a("label",{staticClass:"active",attrs:{for:"title"}},[e._v("Title")])]),a("div",{staticClass:"input-field"},[a("div",{staticClass:"input-field"},[a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.description,expression:"description"}],staticClass:"materialize-textarea",attrs:{id:"description",required:""},domProps:{value:e.description},on:{input:function(t){t.target.composing||(e.description=t.target.value)}}}),a("label",{staticClass:"active",attrs:{for:"description"}},[e._v("Description")])])]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.currency,expression:"currency"}],staticClass:"validate",attrs:{id:"currency",type:"text",required:""},domProps:{value:e.currency},on:{input:function(t){t.target.composing||(e.currency=t.target.value)}}}),a("label",{staticClass:"active",attrs:{for:"currency"}},[e._v("Currency")])]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.fundsRequired,expression:"fundsRequired"}],staticClass:"validate",attrs:{id:"funds_required",type:"number",required:""},domProps:{value:e.fundsRequired},on:{input:function(t){t.target.composing||(e.fundsRequired=t.target.value)}}}),a("label",{staticClass:"active",attrs:{for:"funds_required"}},[e._v("Funds Required")])]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.fundsRaised,expression:"fundsRaised"}],staticClass:"validate",attrs:{id:"funds_raised",type:"number"},domProps:{value:e.fundsRaised},on:{input:function(t){t.target.composing||(e.fundsRaised=t.target.value)}}}),a("label",{staticClass:"active",attrs:{for:"funds_raised"}},[e._v("Funds Raised")])]),a("button",{staticClass:"btn btn-primary blue",attrs:{type:"submit",disabled:e.saving}},[e.saving?a("span",[e._v("Saving...")]):a("span",[e._v("Save")])]),a("a",{staticClass:"btn btn-flat",on:{click:function(t){e.editing=!1}}},[e._v("Cancel")])]):e._e()],1)}),ve=[],he={name:"ProjectItem",components:{Modal:ne},props:{item:Object},data:function(){var e=this;return{title:"",description:"",fundsRaised:"",fundsRequired:"",currency:"",visible:!1,editing:!1,saving:!1,actions:{Yes:function(){var t=Object(V["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return M.toast({html:"Deleting...",classes:"blue",displayLength:99999}),t.next=3,e.$store.dispatch("deleteProject",e.item.project.id);case 3:a=t.sent,M.Toast.dismissAll(),a.status?e.$emit("removeProject",e.item.project.id):M.toast({html:a.error_message,classes:"red"}),e.visible=!1;case 7:case"end":return t.stop()}}),t)})));function a(){return t.apply(this,arguments)}return a}(),No:function(){e.visible=!1}}}},mounted:function(){},methods:{editProject:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.saving){t.next=2;break}return t.abrupt("return");case 2:if(""!=e.title&&""!=e.description&&""!=e.currency){t.next=5;break}return M.toast({html:"Fields cannot be empty",classes:"red"}),t.abrupt("return");case 5:return e.saving=!0,a={title:e.title,description:e.description,currency:e.currency,funds_required:parseFloat(e.fundsRequired),funds_raised:parseFloat(e.fundsRaised),id:e.item.project.id,created:e.item.project.created},t.next=9,e.$store.dispatch("editProject",a);case 9:n=t.sent,n.status?(e.item.project.title=e.title,e.item.project.description=e.description,e.item.project.currency=e.currency,e.item.project.funds_raised=e.fundsRaised,e.item.project.funds_required=e.fundsRequired):M.toast({html:n.error_message,classes:"red"}),e.saving=!1,e.editing=!1;case 13:case"end":return t.stop()}}),t)})))()},enterEditMode:function(){this.title=this.item.project.title,this.description=this.item.project.description,this.fundsRaised=this.item.project.funds_raised,this.fundsRequired=this.item.project.funds_required,this.currency=this.item.project.currency,this.editing=!0},getImage:function(){var e=this.item.attachments.filter((function(e){return"image"==e.type}));return e?e[0].url:""},getVideo:function(){var e=this.item.attachments.filter((function(e){return"video"==e.type}));if(e)return e[0].url}}},ge=he,be=(a("b8fa"),Object(u["a"])(ge,fe,ve,!1,null,"534addb8",null)),_e=be.exports,je={name:"Project",components:{Loader:K,ProjectItem:_e},data:function(){return{title:"",description:"",currency:"",fundsRequired:"",fundsRaised:"",videoURL:"",file:null,uploading:!1,loading:!0,projects:[]}},mounted:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("getProjects");case 2:a=t.sent,a.status?e.projects=a.data:T.a.toast({html:a.error_message,classes:"red"}),e.loading=!1;case 5:case"end":return t.stop()}}),t)})))()},methods:{removeProject:function(e){var t=-1;this.projects.filter((function(a,n){a.project.id==e&&(t=n)})),t>=0&&this.projects.splice(t,1)},setFile:function(e){var t=e.target.files||e.dataTransfer.files;(t||t.length)&&(this.file=t[0])},addProject:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.uploading){t.next=2;break}return t.abrupt("return");case 2:if(null!=e.file){t.next=5;break}return T.a.toast({html:"Upload image",classes:"red"}),t.abrupt("return");case 5:if(""!=e.title&&""!=e.description){t.next=8;break}return T.a.toast({html:"Title or description cannot be empty",classes:"red"}),t.abrupt("return");case 8:return e.uploading=!0,a=new FormData,a.append("file",e.file,e.file.name),a.append("title",e.title),a.append("description",e.description),a.append("funds_raised",e.fundsRaised?e.fundsRaised:0),a.append("funds_required",e.fundsRequired),a.append("currency",e.currency),a.append("video_url",e.videoURL),t.next=19,e.$store.dispatch("addProject",a);case 19:n=t.sent,n.status?(T.a.toast({html:"Project Added successfully!",classes:"green"}),e.projects.unshift(n.data)):T.a.toast({html:n.error_message,classes:"red"}),e.title="",e.description="",e.fundsRaised="",e.fundsRequired="",e.currency="",e.videoURL="",e.file=null,e.videoURL="",e.$refs.filepath&&(e.$refs.filepath.value=""),e.uploading=!1;case 31:case"end":return t.stop()}}),t)})))()}}},ye=je,we=(a("92fe"),Object(u["a"])(ye,pe,me,!1,null,"99234f38",null)),Ce=we.exports,xe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("form",{staticClass:"card",on:{submit:function(t){return t.preventDefault(),e.addAttachment(t)}}},[a("h4",{staticClass:"add-media"},[e._v("Add Newsletter")]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.caption,expression:"caption"}],staticClass:"validate",attrs:{id:"caption",type:"text",required:""},domProps:{value:e.caption},on:{input:function(t){t.target.composing||(e.caption=t.target.value)}}}),a("label",{attrs:{for:"caption"}},[e._v("Caption")])]),a("div",{staticClass:"file-field input-field"},[a("div",{staticClass:"btn btn-small blue"},[e._m(0),a("input",{staticClass:"validate",attrs:{type:"file",required:"",accept:"application/pdf"},on:{change:e.setFile}})]),a("div",{staticClass:"file-path-wrapper"},[a("input",{ref:"filepath",staticClass:"file-path validate",attrs:{type:"text"}})])]),a("button",{staticClass:"btn btn-primary blue",attrs:{type:"submit",disabled:e.uploading}},[e.uploading?a("span",[e._v("Uploading...")]):a("span",[e._v("Upload")])])]),a("h4",{staticClass:"exisiting-media"},[e._v("Existing Newsletter")]),e.loading||0!=e.media.length?e._e():a("div",[e._v("No Newsletter Found.")]),e.loading?a("div",[a("Loader")],1):a("div",{staticClass:"media-wrapper"},e._l(e.media,(function(t){return a("div",{key:t.id,staticClass:"media-item"},[a("embed",{attrs:{src:t.url,type:"application/pdf"}}),a("div",{staticClass:"body"},[a("span",[e._v(e._s(t.caption))]),a("i",{staticClass:"material-icons red-text",on:{click:function(a){return e.confirm(t.id)}}},[e._v("delete")])])])})),0),e.visible?a("Modal",{attrs:{actions:e.actions,content:"Are you sure you want to delete the item?",header:"Warning"}}):e._e()],1)},ke=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("span",[a("i",{staticClass:"material-icons"},[e._v("file_upload")])])}],Re={name:"Media",components:{Loader:K,Modal:ne},data:function(){var e=this;return{uploading:!1,caption:"",file:null,loading:!0,media:[],visible:!1,selectedMediaID:"",actions:{Yes:function(){var t=Object(V["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return T.a.toast({html:"Deleting...",classes:"blue",displayLength:99999}),t.next=3,e.$store.dispatch("deleteAttachment",e.selectedMediaID);case 3:a=t.sent,T.a.Toast.dismissAll(),a.status?(n=-1,e.media.forEach((function(t,a){t.id==e.selectedMediaID&&(n=a)})),n>=0&&e.media.splice(n,1),e.selectedMediaID="",T.a.toast({html:"Item deleted!",classes:"green"})):T.a.toast({html:a.error_message,classes:"red"}),e.visible=!1;case 7:case"end":return t.stop()}}),t)})));function a(){return t.apply(this,arguments)}return a}(),No:function(){e.visible=!1}}}},mounted:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("getAttachments","newsletter");case 2:a=t.sent,a.status?e.media=a.data?a.data:[]:T.a.toast({html:a.error_message,classes:"red"}),e.loading=!1;case 5:case"end":return t.stop()}}),t)})))()},methods:{confirm:function(e){this.selectedMediaID=e,this.visible=!0},setFile:function(e){var t=e.target.files||e.dataTransfer.files;(t||t.length)&&(this.file=t[0])},addAttachment:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.uploading){t.next=2;break}return t.abrupt("return");case 2:if(""!=e.caption){t.next=5;break}return T.a.toast({html:"Caption cannot be empty!",classes:"red"}),t.abrupt("return");case 5:if(null!=e.file){t.next=8;break}return T.a.toast({html:"Select file",classes:"red"}),t.abrupt("return");case 8:return e.uploading=!0,a=new FormData,a.append("file",e.file,e.file.name),a.append("type","pdf"),a.append("group","newsletter"),a.append("caption",e.caption),t.next=16,e.$store.dispatch("addAttachment",a);case 16:n=t.sent,n.status?(T.a.toast({html:"Newsletter uploaded successfully!",classes:"green"}),e.media.unshift(n.data)):T.a.toast({html:n.error_message,classes:"red"}),e.caption="",e.file=null,e.$refs.filepath&&(e.$refs.filepath.value=""),e.uploading=!1;case 22:case"end":return t.stop()}}),t)})))()}}},Te=Re,Oe=(a("6485"),Object(u["a"])(Te,xe,ke,!1,null,"8fc2722c",null)),Pe=Oe.exports,Se=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("form",{staticClass:"card",on:{submit:function(t){return t.preventDefault(),e.addAttachment(t)}}},[a("h4",{staticClass:"add-media"},[e._v("Add Financials")]),a("div",{staticClass:"media-type"},[e._v(" Media Type: "),a("p",[a("label",[a("input",{directives:[{name:"model",rawName:"v-model",value:e.mediaType,expression:"mediaType"}],staticClass:"with-gap",attrs:{name:"media-type",type:"radio",value:"pdf"},domProps:{checked:e._q(e.mediaType,"pdf")},on:{change:function(t){e.mediaType="pdf"}}}),a("span",[e._v("PDF")])])]),a("p",[a("label",[a("input",{directives:[{name:"model",rawName:"v-model",value:e.mediaType,expression:"mediaType"}],staticClass:"with-gap",attrs:{name:"media-type",type:"radio",value:"image"},domProps:{checked:e._q(e.mediaType,"image")},on:{change:function(t){e.mediaType="image"}}}),a("span",[e._v("Image")])])])]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.caption,expression:"caption"}],staticClass:"validate",attrs:{id:"caption",type:"text",required:""},domProps:{value:e.caption},on:{input:function(t){t.target.composing||(e.caption=t.target.value)}}}),a("label",{attrs:{for:"caption"}},[e._v("Caption")])]),a("div",{staticClass:"file-field input-field"},[a("div",{staticClass:"btn btn-small blue"},[e._m(0),a("input",{staticClass:"validate",attrs:{type:"file",required:""},on:{change:e.setFile}})]),a("div",{staticClass:"file-path-wrapper"},[a("input",{ref:"filepath",staticClass:"file-path validate",attrs:{type:"text"}})])]),a("button",{staticClass:"btn btn-primary blue",attrs:{type:"submit",disabled:e.uploading}},[e.uploading?a("span",[e._v("Uploading...")]):a("span",[e._v("Upload")])])]),a("h2",[e._v("Financials")]),a("a-table",{attrs:{columns:e.columns,"row-key":function(e){return e.id},"data-source":e.data,pagination:!1,loading:e.loading},scopedSlots:e._u([{key:"action",fn:function(t,n){return a("span",{},[a("a-button",{on:{click:function(t){return e.showModal(n)}}},[a("a-icon",{attrs:{type:"form"}})],1)],1)}}])}),a("a-modal",{attrs:{visible:e.visible,footer:null},on:{ok:e.handleOk,cancel:e.handleCancel}},[a("div",{staticClass:"input-wrapper"},[a("p",[e._v("Caption")]),a("a-input",{model:{value:e.record.caption,callback:function(t){e.$set(e.record,"caption",t)},expression:"record.caption"}}),a("div",{staticClass:"media-type"},[e._v(" Media Type: "),a("p",[a("label",[a("input",{directives:[{name:"model",rawName:"v-model",value:e.mediaType,expression:"mediaType"}],staticClass:"with-gap",attrs:{name:"media-type",type:"radio",value:"pdf"},domProps:{checked:e._q(e.mediaType,"pdf")},on:{change:function(t){e.mediaType="pdf"}}}),a("span",[e._v("PDF")])])]),a("p",[a("label",[a("input",{directives:[{name:"model",rawName:"v-model",value:e.mediaType,expression:"mediaType"}],staticClass:"with-gap",attrs:{name:"media-type",type:"radio",value:"image"},domProps:{checked:e._q(e.mediaType,"image")},on:{change:function(t){e.mediaType="image"}}}),a("span",[e._v("Image")])])])]),a("div",{staticClass:"file-field input-field"},[a("div",{staticClass:"btn btn-small blue"},[a("span",[a("i",{staticClass:"material-icons"},[e._v("file_upload")])]),a("input",{staticClass:"validate",attrs:{type:"file"},on:{change:e.setFile}})]),a("div",{staticClass:"file-path-wrapper"},[a("input",{ref:"filepathmodal",staticClass:"file-path validate",attrs:{type:"text"}})])]),a("div",[a("a-button",{staticStyle:{"margin-right":"8px"},attrs:{type:"primary"},on:{click:e.save}},[e._v("Save")]),a("a-button",{attrs:{type:"secondary"},on:{click:e.showFile}},[e._v("Financial file URL")])],1)],1)])],1)},Me=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("span",[a("i",{staticClass:"material-icons"},[e._v("file_upload")])])}],$e=(a("5cc6"),a("9a8c"),a("a975"),a("735e"),a("c1ac"),a("d139"),a("3a7b"),a("d5d6"),a("82f8"),a("e91f"),a("60bd"),a("5f96"),a("3280"),a("3fcc"),a("ca91"),a("25a1"),a("cd26"),a("3c5d"),a("2954"),a("649e"),a("219c"),a("170b"),a("b39a"),a("72f7"),a("3ca3"),a("ddb0"),a("2b3d"),a("99af"),[{title:"S.No",dataIndex:"sno"},{title:"Name",dataIndex:"caption"},{title:"Action",dataIndex:"action",scopedSlots:{customRender:"action"}}]),Ee={name:"Financials",components:{},data:function(){return{uploading:!1,caption:"",file:null,mediaType:"pdf",data:[],loading:!1,columns:$e,visible:!1,record:{}}},mounted:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.fetch();case 1:case"end":return t.stop()}}),t)})))()},methods:{fetch:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.next=3,e.$store.dispatch("getAttachments","financial");case 3:a=t.sent,e.loading=!1,e.data=a.data,e.data.forEach((function(e,t){e.sno=t+1}));case 7:case"end":return t.stop()}}),t)})))()},showModal:function(e){this.record=e,this.mediaType=this.record.type,this.visible=!0},showFile:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a,n,i,s,r,o,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={name:"admin",email:"admin",reason:"admin views",file:e.record.id,type:e.record.type},t.next=3,e.$store.dispatch("getFinancial",a);case 3:n=t.sent,"pdf"==e.record.type?(i=new Uint8Array(n),s=new Blob([i],{type:"application/pdf"}),r=document.createElement("a"),r=URL.createObjectURL(s),e.$store.commit("SET_STATEMENT",{file:r,type:"pdf"})):(o=btoa(new Uint8Array(n.data).reduce((function(e,t){return e+String.fromCharCode(t)}),"")),c="data:".concat(n.headers["content-type"].toLowerCase(),";base64,").concat(o),e.$store.commit("SET_STATEMENT",{file:c,type:"image"})),e.name="",e.email="",e.file="",e.reason="",e.$router.push("/statement");case 10:case"end":return t.stop()}}),t)})))()},handleOk:function(){this.visible=!1},handleCancel:function(){this.visible=!1},setFile:function(e){var t=e.target.files||e.dataTransfer.files;(t||t.length)&&(this.file=t[0])},addAttachment:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.uploading){t.next=2;break}return t.abrupt("return");case 2:if(""!=e.caption){t.next=5;break}return M.toast({html:"Caption cannot be empty!",classes:"red"}),t.abrupt("return");case 5:if(null!=e.file){t.next=8;break}return M.toast({html:"Select file",classes:"red"}),t.abrupt("return");case 8:return e.uploading=!0,a=new FormData,a.append("file",e.file,e.file.name),a.append("type",e.mediaType),a.append("group","financial"),a.append("protected","1"),a.append("caption",e.caption),t.next=17,e.$store.dispatch("addAttachment",a);case 17:n=t.sent,n.status?(M.toast({html:"Financials uploaded successfully!",classes:"green"}),e.fetch()):M.toast({html:n.error_message,classes:"red"}),e.caption="",e.file=null,e.$refs.filepath&&(e.$refs.filepath.value=""),e.uploading=!1;case 23:case"end":return t.stop()}}),t)})))()},save:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a,n,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(null!=e.file){t.next=8;break}return t.next=3,e.$store.dispatch("updateAttachmentCaption",e.record);case 3:a=t.sent,a.status||M.toast({html:a.error_message,classes:"red"}),e.visible=!1,t.next=20;break;case 8:return n=new FormData,n.append("file",e.file,e.file.name),n.append("protected","1"),n.append("caption",e.record.caption),n.append("id",e.record.id),t.next=15,e.$store.dispatch("updateAttachmentFile",n);case 15:i=t.sent,e.file=null,e.$refs.filepath&&(e.$refs.filepathmodal.value=""),i.status||M.toast({html:i.error_message,classes:"red"}),e.visible=!1;case 20:case"end":return t.stop()}}),t)})))()}}},qe=Ee,Ne=(a("60e0"),Object(u["a"])(qe,Se,Me,!1,null,"b4fbc474",null)),Fe=Ne.exports,De=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("h2",[e._v("Donations")]),a("div",{staticStyle:{display:"flex","align-items":"center","margin-bottom":"24px"}},[a("a-date-picker",{staticStyle:{"margin-right":"16px"},attrs:{"show-time":"",format:"YYYY-MM-DD",placeholder:"Start date"},on:{change:e.updateStartDate}}),a("a-date-picker",{staticStyle:{"margin-right":"16px"},attrs:{"show-time":"",format:"YYYY-MM-DD",placeholder:"End date"},on:{change:e.updateEndDate}}),a("a-button",{attrs:{type:"primary",loading:e.preparing,disabled:e.preparing||""==e.start||""==e.end},on:{click:e.downloadCSV}},[a("a-icon",{attrs:{type:"download"}}),e._v(" Download CSV ")],1)],1),a("a-table",{attrs:{columns:e.columns,"row-key":function(e){return e.id},"data-source":e.data,pagination:e.pagination,loading:e.loading},on:{change:e.handleTableChange},scopedSlots:e._u([{key:"created",fn:function(t){return a("span",{},[e._v(e._s(e.getTime(t)))])}},{key:"tx_status",fn:function(t){return a("span",{},[e._v(e._s(t))])}},{key:"action",fn:function(t,n){return a("span",{},[a("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.showModal(n)}}},[e._v(" View ")])],1)}}])}),a("a-modal",{attrs:{visible:e.visible,footer:null},on:{ok:e.handleOk,cancel:e.handleCancel}},[a("p",[e._v("Name: "+e._s(this.record.name))]),a("p",[e._v("Email: "+e._s(this.record.email))]),a("p",[e._v("Phone: "+e._s(this.record.phone))]),a("p",[e._v("Pan: "+e._s(this.record.pan))]),a("p",[e._v("Amount: "+e._s(this.record.amount))]),a("p",[e._v("Address: "+e._s(this.record.address))]),a("p",[e._v("City: "+e._s(this.record.city))]),a("p",[e._v("State: "+e._s(this.record.state))]),a("p",[e._v("Pin Code: "+e._s(this.record.pincode))]),a("p",[e._v("Reason: "+e._s(this.record.item_name))]),a("p",[e._v("Cashfree Txn Status: "+e._s(this.record.tx_status))]),a("p",[e._v("Cashfree Payment Mode: "+e._s(this.record.payment_mode))]),a("p",[e._v("Cashfree Txn Message: "+e._s(this.record.tx_message))]),a("p",[e._v("Cashfree Txn Time: "+e._s(this.record.tx_time))]),a("p",[e._v("Created Date: "+e._s(this.getTime(e.record.created)))])])],1)},Ae=[],Ue=a("369b"),Ie=a.n(Ue),Le=[{title:"S.No",dataIndex:"sno"},{title:"Name",dataIndex:"name"},{title:"Email",dataIndex:"email"},{title:"Phone",dataIndex:"phone"},{title:"Amount",dataIndex:"amount"},{title:"Status",dataIndex:"tx_status",scopedSlots:{customRender:"tx_status"}},{title:"Date",dataIndex:"created",scopedSlots:{customRender:"created"}},{title:"Action",dataIndex:"action",scopedSlots:{customRender:"action"}}],ze={name:"Donations",components:{},data:function(){return{data:[],pagination:{current:1,pageSize:20,total:9999},loading:!1,columns:Le,record:{},visible:!1,start:"",end:"",preparing:!1}},mounted:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("getOrdersCount");case 2:if(a=t.sent,a.status){t.next=6;break}return e.$notification["error"]({message:"Error",description:a.error_message}),t.abrupt("return");case 6:e.pagination.total=a.data,e.fetch({limit:e.pagination.pageSize,offset:0});case 8:case"end":return t.stop()}}),t)})))()},methods:{downloadCSV:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a,n,i,s,r,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(""!=e.end&&""!=e.start&&!e.preparing){t.next=2;break}return t.abrupt("return");case 2:return e.preparing=!0,t.next=5,e.$store.dispatch("getOrdersPaginated",{start:e.start,end:e.end});case 5:if(a=t.sent,a.status){t.next=10;break}return e.preparing=!1,e.$notification["error"]({message:"Error",description:a.error_message}),t.abrupt("return");case 10:a.data||(a.data=[]),n=[],a.data.forEach((function(t,a){var i={Sno:a+1,Reason:t.item_name,Name:t.name,Amount:t.amount,Address:t.address,City:t.city,State:t.state,"Pin Code":t.pincode,"PAN Card":t.pan.toUpperCase(),Email:t.email,"Phone No":t.phone,"Cashfree Reference Id":t.id,"Cashfree Txn Status":t.tx_status,"Cashfree Payment Mode":t.payment_mode,"Cashfree Txn Message":t.tx_message,"Cashfree Txn Time":t.tx_time,"Created Date":e.getTime(t.created)};n.push(i)})),i=Ie.a.unparse(n),s=new Blob([i],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(s),r.setAttribute("href",o),r.setAttribute("download","Donations.csv"),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),e.preparing=!1;case 24:case"end":return t.stop()}}),t)})))()},updateStartDate:function(e,t){this.start=this.getISODateString(new Date(t))},updateEndDate:function(e,t){this.end=this.getLastISODateString(new Date(t))},getISODateString:function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+".000Z"},getLastISODateString:function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T23:59:59.000Z"},handleTableChange:function(e){var t=Object(r["a"])({},this.pagination);t.current=e.current,this.pagination=t,this.fetch({limit:e.pageSize,offset:(e.current-1)*e.pageSize})},fetch:function(){var e=arguments,t=this;return Object(V["a"])(regeneratorRuntime.mark((function a(){var n,i;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.length>0&&void 0!==e[0]?e[0]:{},t.loading=!0,a.next=4,t.$store.dispatch("getOrdersPaginated",n);case 4:i=a.sent,t.loading=!1,t.data=i.data,t.data.forEach((function(e,a){e.sno=(t.pagination.current-1)*t.pagination.pageSize+a+1}));case 8:case"end":return a.stop()}}),a)})))()},getTime:function(e){var t=new Date(e),a=t.getDate()+"-"+(t.getMonth()+1)+"-"+t.getFullYear(),n=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds();return a+" "+n},showModal:function(e){this.record=e,this.visible=!0},handleOk:function(){this.visible=!1},handleCancel:function(){this.visible=!1}}},Ve=ze,Ye=Object(u["a"])(Ve,De,Ae,!1,null,"25ba6eec",null),He=Ye.exports,Be=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("h4",{staticClass:"exisiting-project"},[e._v("Crowd Funding")]),e.loading||0!=e.projects.length?e._e():a("div",[e._v("No data")]),e.loading?a("div",[a("Loader")],1):a("div",{staticClass:"project-wrapper"},e._l(e.projects,(function(t){return a("div",{key:t.project.id},[a("form",{staticClass:"card",on:{submit:function(a){return a.preventDefault(),e.update(t)}}},[a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.project.funds_required,expression:"item.project.funds_required"}],staticClass:"validate",attrs:{id:"funds_required",type:"number",required:""},domProps:{value:t.project.funds_required},on:{input:function(a){a.target.composing||e.$set(t.project,"funds_required",a.target.value)}}}),a("label",{staticClass:"active",attrs:{for:"funds_required"}},[e._v("Funds Required")])]),a("div",{staticClass:"input-field"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.project.funds_raised,expression:"item.project.funds_raised"}],staticClass:"validate",attrs:{id:"funds_raised",type:"number"},domProps:{value:t.project.funds_raised},on:{input:function(a){a.target.composing||e.$set(t.project,"funds_raised",a.target.value)}}}),a("label",{staticClass:"active",attrs:{for:"funds_raised"}},[e._v("Funds Raised")])]),a("button",{staticClass:"btn btn-primary blue",attrs:{type:"submit",disabled:e.saving}},[e.saving?a("span",[e._v("Saving...")]):a("span",[e._v("Save")])])])])})),0)])},We=[],Je={name:"Project",components:{Loader:K},data:function(){return{loading:!0,projects:[],saving:!1}},mounted:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("getProjects","1");case 2:a=t.sent,a.status?e.projects=a.data?a.data:[]:T.a.toast({html:a.error_message,classes:"red"}),e.loading=!1;case 5:case"end":return t.stop()}}),t)})))()},methods:{update:function(e){var t=this;return Object(V["a"])(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(!t.saving){a.next=2;break}return a.abrupt("return");case 2:return t.saving=!0,e.project.funds_raised=parseFloat(e.project.funds_raised),e.project.funds_required=parseFloat(e.project.funds_required),a.next=7,t.$store.dispatch("editProject",e.project);case 7:n=a.sent,t.saving=!1,n.status?T.a.toast({html:"Amount updated",classes:"green"}):T.a.toast({html:n.error_message,classes:"red"});case 10:case"end":return a.stop()}}),a)})))()}}},Ke=Je,Ze=(a("2325"),Object(u["a"])(Ke,Be,We,!1,null,"99ca4cd4",null)),Ge=Ze.exports,Qe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("h2",[e._v("Financial Views")]),a("a-table",{attrs:{columns:e.columns,"row-key":function(e){return e.id},"data-source":e.data,pagination:e.pagination,loading:e.loading},on:{change:e.handleTableChange},scopedSlots:e._u([{key:"created",fn:function(t){return a("span",{},[e._v(e._s(e.getTime(t)))])}}])})],1)},Xe=[],et=[{title:"S.No",dataIndex:"sno"},{title:"Name",dataIndex:"name"},{title:"Email",dataIndex:"email"},{title:"Reason",dataIndex:"reason"},{title:"File",dataIndex:"filename"},{title:"Date",dataIndex:"created",scopedSlots:{customRender:"created"}}],tt={name:"FinancialViews",components:{},data:function(){return{data:[],pagination:{current:1,pageSize:20,total:9999},loading:!1,columns:et}},mounted:function(){var e=this;return Object(V["a"])(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$store.dispatch("getFinancialViewsCount");case 2:a=t.sent,a.status||e.$notification["error"]({message:"Error",description:a.error_message}),e.pagination.total=a.data,e.fetch({limit:e.pagination.pageSize,offset:0});case 6:case"end":return t.stop()}}),t)})))()},methods:{handleTableChange:function(e){var t=Object(r["a"])({},this.pagination);t.current=e.current,this.pagination=t,this.fetch({limit:e.pageSize,offset:(e.current-1)*e.pageSize})},fetch:function(){var e=arguments,t=this;return Object(V["a"])(regeneratorRuntime.mark((function a(){var n,i;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=e.length>0&&void 0!==e[0]?e[0]:{},t.loading=!0,a.next=4,t.$store.dispatch("getFinancialViewsPaginated",n);case 4:i=a.sent,t.loading=!1,t.data=i.data,t.data.forEach((function(e,a){e.sno=(t.pagination.current-1)*t.pagination.pageSize+a+1}));case 8:case"end":return a.stop()}}),a)})))()},getTime:function(e){var t=new Date(e),a=t.getDate()+"-"+(t.getMonth()+1)+"-"+t.getFullYear(),n=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds();return a+" "+n}}},at=tt,nt=Object(u["a"])(at,Qe,Xe,!1,null,"e08ac94a",null),it=nt.exports,st=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"statement"},["pdf"==e.statement.type?a("iframe",{attrs:{src:e.statement.file,type:"application/pdf"}}):e._e(),e.statement.file?a("img",{attrs:{src:e.statement.file}}):e._e()])},rt=[],ot={name:"Statement",components:{},mounted:function(){},data:function(){return{}},methods:{},computed:Object(r["a"])({},Object(O["b"])(["statement"]))},ct=ot,dt=(a("db2c"),Object(u["a"])(ct,st,rt,!1,null,"0e5cdde6",null)),lt=dt.exports;n["a"].use(q["a"]);var ut=[{path:"/",name:"Home",component:I},{path:"/media",name:"Media",component:ue},{path:"/projects",name:"Projects",component:Ce},{path:"/newsletter",name:"Newsletter",component:Pe},{path:"/financials",name:"Financials",component:Fe},{path:"/financial-views",name:"FinancialViews",component:it},{path:"/donations",name:"Donations",component:He},{path:"/crowd-funding",name:"Crowdfunding",component:Ge},{path:"/statement",name:"Statement",component:lt}],pt=new q["a"]({mode:"history",base:"/",routes:ut}),mt=pt,ft=a("8468"),vt=a("bc3a"),ht=a.n(vt);n["a"].use(O["a"]);var gt=ht.a.create(),bt=new O["a"].Store({state:{http:gt,baseURL:"",token:"",loggedIn:!1,statement:null},mutations:{SET_TOKEN:function(e,t){e.http.defaults.headers.common["token"]=t,e.token=t,e.loggedIn=!0},SET_BASE_URL:function(e,t){e.baseURL=t,e.http.defaults.baseURL=e.baseURL},SET_STATEMENT:function(e,t){e.statement=t}},actions:{login:function(e,t){var a=e.commit;return new Promise((function(e){gt.post("auth/login",t).then((function(t){t.data.data&&t.data.data.token&&a("SET_TOKEN",t.data.data.token),e(t.data)}))}))},getAttachments:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.get("attachments?filter="+t).then((function(t){e(t.data)}))}))},deleteAttachment:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.delete("attachments/"+t).then((function(t){e(t.data)}))}))},addAttachment:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.post("attachments",t).then((function(t){e(t.data)}))}))},updateAttachmentFile:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.put("attachments/"+t.get("id")+"/file",t).then((function(t){e(t.data)}))}))},getProjects:function(e,t){return Object(ft["a"])(e),t||(t=0),new Promise((function(e){gt.get("projects?crowdfunding="+t).then((function(t){e(t.data)}))}))},addProject:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.post("projects",t).then((function(t){e(t.data)}))}))},deleteProject:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.delete("projects/"+t).then((function(t){e(t.data)}))}))},editProject:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.put("projects",t).then((function(t){e(t.data)}))}))},getFinancial:function(e,t){return Object(ft["a"])(e),new Promise((function(e){"pdf"==t.type?gt.post("financials/",t,{responseType:"arraybuffer"}).then((function(t){e(t.data)})):gt.post("financials/",t,{responseType:"arraybuffer"}).then((function(t){e(t)}))}))},getOrders:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.get("orders?cursor=",t).then((function(t){e(t.data)}))}))},getOrdersPaginated:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.get("orders",{params:t}).then((function(t){e(t.data)}))}))},getOrdersCount:function(e){return Object(ft["a"])(e),new Promise((function(e){gt.get("orders/count").then((function(t){e(t.data)}))}))},getFinancialViewsPaginated:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.get("financials/views",{params:t}).then((function(t){e(t.data)}))}))},getFinancialViewsCount:function(e){return Object(ft["a"])(e),new Promise((function(e){gt.get("financials/count").then((function(t){e(t.data)}))}))},updateAttachmentCaption:function(e,t){return Object(ft["a"])(e),new Promise((function(e){gt.put("attachments/"+t.id+"/caption/"+t.caption).then((function(t){e(t.data)}))}))}},getters:{loggedIn:function(e){return e.loggedIn},statement:function(e){return e.statement}},modules:{}}),_t=(a("8266"),a("619b"),a("f23d"));a("202f");n["a"].config.productionTip=!1,n["a"].use(_t["a"]),new n["a"]({router:mt,store:bt,render:function(e){return e(E)}}).$mount("#app")},"57fc":function(e,t,a){},"5c0b":function(e,t,a){"use strict";a("9c0c")},"60e0":function(e,t,a){"use strict";a("ce1a")},6485:function(e,t,a){"use strict";a("e65e")},8518:function(e,t,a){},"92fe":function(e,t,a){"use strict";a("c9a1")},"931e":function(e,t,a){},"9c0c":function(e,t,a){},ab9f:function(e,t,a){},b8fa:function(e,t,a){"use strict";a("57fc")},c9a1:function(e,t,a){},ce1a:function(e,t,a){},cf63:function(e,t,a){},d4b4:function(e,t,a){},db2c:function(e,t,a){"use strict";a("f653")},e65e:function(e,t,a){},ed14:function(e,t,a){"use strict";a("4652")},f653:function(e,t,a){}});