text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e632f"],{9871:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("v-main",[i("v-card",{attrs:{flat:""}},[i("v-toolbar",{attrs:{flat:""}},[i("v-app-bar-nav-icon",{on:{click:function(t){e.toggle=!e.toggle}}}),i("AppBar",{model:{value:e.toggle,callback:function(t){e.toggle=t},expression:"toggle"}}),i("v-img",{staticClass:"shrink",attrs:{src:a("3c81"),contain:"",height:"50px"}}),i("v-toolbar-title",{staticClass:"grey--text text--darken-4"},[e._v(" Admin-Videos ")]),i("v-spacer"),i("v-btn",{attrs:{large:"",icon:""},on:{click:function(t){e.button="Save",e.clearForm(),e.videodialog=!0}}},[i("v-icon",{attrs:{large:""}},[e._v("mdi-plus")])],1)],1),i("v-container",[i("v-row",e._l(e.videosData,(function(t){return i("v-col",{key:t.id,attrs:{cols:"6",md:"3",sm:"4",xs:"6"}},[i("v-card",{staticClass:"ma-6",attrs:{height:e.$vuetify.breakpoint.xs||e.$vuetify.breakpoint.sm?180:300,width:e.$vuetify.breakpoint.xs||e.$vuetify.breakpoint.sm?150:300}},[i("iframe",{attrs:{height:"75%",width:"100%",src:"https://www.youtube-nocookie.com/embed/"+t.url,frameborder:"0",gesture:"media",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:""}}),i("v-card-title",{staticClass:"ml-3 pa-0 text-lg-h6 text-subtitle-2"},[e._v(" "+e._s(t.name)+" ")]),i("v-card-title",{staticClass:"ml-2 pa-0"},[i("v-chip",{attrs:{small:"",outlined:"",color:"deep-purple accent-4"}},[e._v(e._s(new Date(t.date).toISOString().substring(0,10)))]),i("v-btn",{attrs:{icon:""},on:{click:function(a){return a.stopPropagation(),e.editForm(t)}}},[i("v-icon",{attrs:{elevation:"6",color:"primary"}},[e._v(" mdi-pencil ")])],1),i("v-btn",{attrs:{icon:""},on:{click:function(a){return a.stopPropagation(),e.deleteEntity(t)}}},[i("v-icon",{attrs:{elevation:"6",color:"error"}},[e._v(" mdi-delete ")])],1)],1)],1)],1)})),1)],1)],1),i("v-dialog",{attrs:{persistent:"","max-width":"600px"},model:{value:e.videodialog,callback:function(t){e.videodialog=t},expression:"videodialog"}},[i("v-card",[i("v-card-title",[i("span",{staticClass:"headline"},[e._v(e._s(e.bindinfo.module)+" ")])]),i("v-form",{ref:"notiform",attrs:{"lazy-validation":""},model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[i("v-card-text",[i("v-text-field",{attrs:{label:"Video Name",outlined:"",required:""},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}}),i("v-text-field",{attrs:{label:"Video Description",outlined:"",required:""},model:{value:e.description,callback:function(t){e.description=t},expression:"description"}}),i("v-text-field",{attrs:{label:"Video Link",outlined:"",required:""},model:{value:e.link,callback:function(t){e.link=t},expression:"link"}}),i("v-menu",{attrs:{"close-on-content-click":!1,"nudge-right":40,transition:"scale-transition","offset-y":"","min-width":"290px"},scopedSlots:e._u([{key:"activator",fn:function(t){var a=t.on,n=t.attrs;return[i("v-text-field",e._g(e._b({attrs:{outlined:"",label:"Video Created Date","prepend-icon":"mdi-calendar",readonly:""},model:{value:e.date,callback:function(t){e.date=t},expression:"date"}},"v-text-field",n,!1),a))]}}]),model:{value:e.datemenu,callback:function(t){e.datemenu=t},expression:"datemenu"}},[i("v-date-picker",{on:{input:function(t){e.datemenu=!1}},model:{value:e.date,callback:function(t){e.date=t},expression:"date"}})],1)],1)],1),i("v-card-actions",[i("v-spacer"),i("v-btn",{attrs:{color:"blue darken-1",text:""},on:{click:function(t){"Save"==e.button?e.saveEntity():e.updateEntity()}}},[e._v(" "+e._s(e.button)+" ")]),i("v-btn",{attrs:{color:"blue darken-1",text:""},on:{click:function(t){e.videodialog=!1}}},[e._v(" Close ")])],1)],1)],1),i("confirmDialog",{ref:"confirm"})],1)},n=[],o=(a("a4d3"),a("e01a"),a("b0c0"),a("d3b7"),a("9911"),a("96cf"),a("1da1")),r=a("dd38"),c={name:"AdminVideos",data:function(){return{toggle:!1,button:"",name:"",link:"",date:"",apiURL:"/api/v1/notifications?module=videos",videoURL:"/api/v1/notifications",description:"",datemenu:"",videodialog:!1,videosData:[],valid:!0}},components:{AppBar:r["a"],confirmDialog:function(){return a.e("chunk-2d0e6171").then(a.bind(null,"96ec"))}},props:{bindinfo:Object},created:function(){this.fetchData()},methods:{clearForm:function(){this.name="",this.description="",this.link="",this.date=""},fetchData:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.axios.get(e.apiURL).then((function(t){e.videosData=t.data["data"]})).catch((function(e){console.log(e)}));case 1:case"end":return t.stop()}}),t)})))()},saveEntity:function(){var e=this;this.$refs.confirm.open("Save","Are you sure?",{color:"green"}).then((function(t){t&&e.axios.post(e.apiURL,{name:e.name,url:e.link,description:e.description,date:new Date(e.date).getTime()}).then((function(t){200==t.data.response_status.response_code&&(e.clearForm(),e.videodialog=!1,e.fetchData())}))}))},editForm:function(e){this.id=e.id,this.name=e.name,this.description=e.description,this.link=e.url,this.date=new Date(e.date).toISOString().substring(0,10),this.button="Update",this.videodialog=!0},updateEntity:function(){var e=this;this.$refs.confirm.open("Update","Are you sure?",{color:"blue"}).then((function(t){t&&e.axios.put(e.videoURL+"/"+e.id,{name:e.name,url:e.link,date:new Date(e.date).getTime(),description:e.description}).then((function(t){200==t.data.response_status.response_code&&(e.fetchData(),e.clearForm(),e.videodialog=!1)}))}))},deleteEntity:function(e){var t=this;this.$refs.confirm.open("Delete","Are you sure?",{color:"red"}).then((function(a){a&&t.axios.delete(t.videoURL+"/"+e.id).then((function(e){t.id=null,200==e.data.response_status.response_code&&t.fetchData()}))}))}}},l=c,s=a("2877"),d=a("6544"),u=a.n(d),p=a("5bc1"),v=a("8336"),f=a("b0af"),m=a("99d9"),b=a("cc20"),h=a("62ad"),g=a("a523"),k=a("2e4b"),x=a("169a"),V=a("4bd4"),w=a("132d"),_=a("adda"),y=a("f6c4"),D=a("e449"),C=a("0fd9"),A=a("2fa4"),R=a("8654"),S=a("71d9"),F=a("2a7f"),T=Object(s["a"])(l,i,n,!1,null,null,null);t["default"]=T.exports;u()(T,{VAppBarNavIcon:p["a"],VBtn:v["a"],VCard:f["a"],VCardActions:m["a"],VCardText:m["b"],VCardTitle:m["c"],VChip:b["a"],VCol:h["a"],VContainer:g["a"],VDatePicker:k["a"],VDialog:x["a"],VForm:V["a"],VIcon:w["a"],VImg:_["a"],VMain:y["a"],VMenu:D["a"],VRow:C["a"],VSpacer:A["a"],VTextField:R["a"],VToolbar:S["a"],VToolbarTitle:F["b"]})}}]);
  //# sourceMappingURL=chunk-2d0e632f.dd40410f.js.map