(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5c90787c"],{"06cf":function(t,e,n){var a=n("83ab"),r=n("d1e7"),o=n("5c6c"),i=n("fc6a"),c=n("c04e"),s=n("5135"),u=n("0cfb"),f=Object.getOwnPropertyDescriptor;e.f=a?f:function(t,e){if(t=i(t),e=c(e,!0),u)try{return f(t,e)}catch(n){}if(s(t,e))return o(!r.f.call(t,e),t[e])}},"0867":function(t,e,n){"use strict";n("8872")},"0cfb":function(t,e,n){var a=n("83ab"),r=n("d039"),o=n("cc12");t.exports=!a&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"13d5":function(t,e,n){"use strict";var a=n("23e7"),r=n("d58f").left,o=n("a640"),i=n("2d00"),c=n("605d"),s=o("reduce"),u=!c&&i>79&&i<83;a({target:"Array",proto:!0,forced:!s||u},{reduce:function(t){return r(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"1c0b":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"23cb":function(t,e,n){var a=n("a691"),r=Math.max,o=Math.min;t.exports=function(t,e){var n=a(t);return n<0?r(n+e,0):o(n,e)}},"23e7":function(t,e,n){var a=n("da84"),r=n("06cf").f,o=n("9112"),i=n("6eeb"),c=n("ce4e"),s=n("e893"),u=n("94ca");t.exports=function(t,e){var n,f,l,p,d,g,h=t.target,m=t.global,v=t.stat;if(f=m?a:v?a[h]||c(h,{}):(a[h]||{}).prototype,f)for(l in e){if(d=e[l],t.noTargetGet?(g=r(f,l),p=g&&g.value):p=f[l],n=u(m?l:h+(v?".":"#")+l,t.forced),!n&&void 0!==p){if(typeof d===typeof p)continue;s(d,p)}(t.sham||p&&p.sham)&&o(d,"sham",!0),i(f,l,d,t)}}},"241c":function(t,e,n){var a=n("ca84"),r=n("7839"),o=r.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return a(t,o)}},"2d00":function(t,e,n){var a,r,o=n("da84"),i=n("342f"),c=o.process,s=c&&c.versions,u=s&&s.v8;u?(a=u.split("."),r=a[0]<4?1:a[0]+a[1]):i&&(a=i.match(/Edge\/(\d+)/),(!a||a[1]>=74)&&(a=i.match(/Chrome\/(\d+)/),a&&(r=a[1]))),t.exports=r&&+r},"342f":function(t,e,n){var a=n("d066");t.exports=a("navigator","userAgent")||""},"428f":function(t,e,n){var a=n("da84");t.exports=a},"44ad":function(t,e,n){var a=n("d039"),r=n("c6b6"),o="".split;t.exports=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==r(t)?o.call(t,""):Object(t)}:Object},"4d64":function(t,e,n){var a=n("fc6a"),r=n("50c4"),o=n("23cb"),i=function(t){return function(e,n,i){var c,s=a(e),u=r(s.length),f=o(i,u);if(t&&n!=n){while(u>f)if(c=s[f++],c!=c)return!0}else for(;u>f;f++)if((t||f in s)&&s[f]===n)return t||f||0;return!t&&-1}};t.exports={includes:i(!0),indexOf:i(!1)}},"50c4":function(t,e,n){var a=n("a691"),r=Math.min;t.exports=function(t){return t>0?r(a(t),9007199254740991):0}},5135:function(t,e,n){var a=n("7b0b"),r={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return r.call(a(t),e)}},5692:function(t,e,n){var a=n("c430"),r=n("c6cd");(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.2",mode:a?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,n){var a=n("d066"),r=n("241c"),o=n("7418"),i=n("825a");t.exports=a("Reflect","ownKeys")||function(t){var e=r.f(i(t)),n=o.f;return n?e.concat(n(t)):e}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"605d":function(t,e,n){var a=n("c6b6"),r=n("da84");t.exports="process"==a(r.process)},"69f3":function(t,e,n){var a,r,o,i=n("7f9a"),c=n("da84"),s=n("861d"),u=n("9112"),f=n("5135"),l=n("c6cd"),p=n("f772"),d=n("d012"),g="Object already initialized",h=c.WeakMap,m=function(t){return o(t)?r(t):a(t,{})},v=function(t){return function(e){var n;if(!s(e)||(n=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}};if(i||l.state){var y=l.state||(l.state=new h),x=y.get,b=y.has,w=y.set;a=function(t,e){if(b.call(y,t))throw new TypeError(g);return e.facade=t,w.call(y,t,e),e},r=function(t){return x.call(y,t)||{}},o=function(t){return b.call(y,t)}}else{var S=p("state");d[S]=!0,a=function(t,e){if(f(t,S))throw new TypeError(g);return e.facade=t,u(t,S,e),e},r=function(t){return f(t,S)?t[S]:{}},o=function(t){return f(t,S)}}t.exports={set:a,get:r,has:o,enforce:m,getterFor:v}},"6eeb":function(t,e,n){var a=n("da84"),r=n("9112"),o=n("5135"),i=n("ce4e"),c=n("8925"),s=n("69f3"),u=s.get,f=s.enforce,l=String(String).split("String");(t.exports=function(t,e,n,c){var s,u=!!c&&!!c.unsafe,p=!!c&&!!c.enumerable,d=!!c&&!!c.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||r(n,"name",e),s=f(n),s.source||(s.source=l.join("string"==typeof e?e:""))),t!==a?(u?!d&&t[e]&&(p=!0):delete t[e],p?t[e]=n:r(t,e,n)):p?t[e]=n:i(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||c(this)}))},7418:function(t,e){e.f=Object.getOwnPropertySymbols},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,n){var a=n("1d80");t.exports=function(t){return Object(a(t))}},"7f9a":function(t,e,n){var a=n("da84"),r=n("8925"),o=a.WeakMap;t.exports="function"===typeof o&&/native code/.test(r(o))},"825a":function(t,e,n){var a=n("861d");t.exports=function(t){if(!a(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,e,n){var a=n("d039");t.exports=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"861d":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8872:function(t,e,n){},8925:function(t,e,n){var a=n("c6cd"),r=Function.toString;"function"!=typeof a.inspectSource&&(a.inspectSource=function(t){return r.call(t)}),t.exports=a.inspectSource},"90e3":function(t,e){var n=0,a=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+a).toString(36)}},9112:function(t,e,n){var a=n("83ab"),r=n("9bf2"),o=n("5c6c");t.exports=a?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},"94ca":function(t,e,n){var a=n("d039"),r=/#|\.prototype\./,o=function(t,e){var n=c[i(t)];return n==u||n!=s&&("function"==typeof e?a(e):!!e)},i=o.normalize=function(t){return String(t).replace(r,".").toLowerCase()},c=o.data={},s=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},"9bf2":function(t,e,n){var a=n("83ab"),r=n("0cfb"),o=n("825a"),i=n("c04e"),c=Object.defineProperty;e.f=a?c:function(t,e,n){if(o(t),e=i(e,!0),o(n),r)try{return c(t,e,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},a640:function(t,e,n){"use strict";var a=n("d039");t.exports=function(t,e){var n=[][t];return!!n&&a((function(){n.call(null,e||function(){throw 1},1)}))}},a691:function(t,e){var n=Math.ceil,a=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?a:n)(t)}},c04e:function(t,e,n){var a=n("861d");t.exports=function(t,e){if(!a(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!a(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!a(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!a(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},c6cd:function(t,e,n){var a=n("da84"),r=n("ce4e"),o="__core-js_shared__",i=a[o]||r(o,{});t.exports=i},c6dc:function(t,e,n){t.exports=n.p+"img/no_data.c758a49e.png"},ca84:function(t,e,n){var a=n("5135"),r=n("fc6a"),o=n("4d64").indexOf,i=n("d012");t.exports=function(t,e){var n,c=r(t),s=0,u=[];for(n in c)!a(i,n)&&a(c,n)&&u.push(n);while(e.length>s)a(c,n=e[s++])&&(~o(u,n)||u.push(n));return u}},cc12:function(t,e,n){var a=n("da84"),r=n("861d"),o=a.document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},ce4e:function(t,e,n){var a=n("da84"),r=n("9112");t.exports=function(t,e){try{r(a,t,e)}catch(n){a[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var a=n("428f"),r=n("da84"),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(a[t])||o(r[t]):a[t]&&a[t][e]||r[t]&&r[t][e]}},d1e7:function(t,e,n){"use strict";var a={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!a.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:a},d58f:function(t,e,n){var a=n("1c0b"),r=n("7b0b"),o=n("44ad"),i=n("50c4"),c=function(t){return function(e,n,c,s){a(n);var u=r(e),f=o(u),l=i(u.length),p=t?l-1:0,d=t?-1:1;if(c<2)while(1){if(p in f){s=f[p],p+=d;break}if(p+=d,t?p<0:l<=p)throw TypeError("Reduce of empty array with no initial value")}for(;t?p>=0:l>p;p+=d)p in f&&(s=n(s,f[p],p,u));return s}};t.exports={left:c(!1),right:c(!0)}},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},e893:function(t,e,n){var a=n("5135"),r=n("56ef"),o=n("06cf"),i=n("9bf2");t.exports=function(t,e){for(var n=r(e),c=i.f,s=o.f,u=0;u<n.length;u++){var f=n[u];a(t,f)||c(t,f,s(e,f))}}},f772:function(t,e,n){var a=n("5692"),r=n("90e3"),o=a("keys");t.exports=function(t){return o[t]||(o[t]=r(t))}},faf1:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"px-10"},[a("div",[a("a-row",{staticClass:"px-15",staticStyle:{"margin-top":"0px"},attrs:{gutter:24}},[a("a-col",{attrs:{span:24,md:24,lg:24,xl:24}},[a("h5",[t._v("Notifications")])]),a("a-col",{staticClass:"mb-24",attrs:{span:24,md:24,lg:24,xl:24}},t._l(t.filterItems,(function(e){return a("a-badge",{key:e.uuid,staticStyle:{"font-size":"14px !important",margin:"2px 3px",padding:"5px"},attrs:{count:e.name+"    "+e.icon,"number-style":t.pagination.filter==e.uuid?{backgroundColor:"#734EBF !important",color:"#FFFFFF",paddingTop:"5px",paddingRight:"18px",paddingLeft:"18px",height:"32px",fontSize:"14px"}:{border:"1px solid #734EBF !important",color:"#734EBF",backgroundColor:"transparent !important",paddingTop:"5px",paddingRight:"18px",paddingLeft:"18px",height:"32px",fontSize:"14px"}},on:{click:function(n){return t.onSelectFilterItem(e.uuid)}}})})),1),a("a-col",{staticClass:"mb-24 text-right",attrs:{span:24,md:24,lg:24,xl:24}},[a("a-pagination",{staticClass:"btn btn-silabu",attrs:{type:"success",total:t.pagination.total,pageSize:t.pagination.perPage,"show-less-items":""},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1)],1),t.loadingData?t._e():a("div",[a("a-row",{staticClass:"mt-20",attrs:{gutter:24}},t._l(t.notifications,(function(e,n){return a("a-col",{key:n,staticClass:"mb-24",staticStyle:{height:"100%"},attrs:{span:24,md:24,lg:24,xl:24}},[a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{span:24}},[a("h6",{staticClass:"mb-20"},[t._v(t._s(n==t.todayDate?"Today":n))])]),t._l(e,(function(e){return a("a-col",{key:e.uuid,staticClass:"mb-24",staticStyle:{height:"100%"},attrs:{span:24,xs:24,sm:24,md:24,lg:12,xl:6}},[a("a-card",{staticClass:" px-5 h-100",on:{click:function(n){return t.handleNotificationClicked(e)}}},[a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{span:24,md:24,lg:24,xl:24}},[a("a-row",{attrs:{gutter:24}},[a("a-col",{staticClass:"text-center",attrs:{span:6,sm:24,md:24,lg:6,xl:6}},[null!=e.creator?a("a-avatar",{staticClass:"mt-5",attrs:{size:50,src:null!=e.creator.profile?e.creator.profile:"",alt:"Han Solo"}},[t._v(t._s(null!=e.creator.profile?"":""+e.creator.firstName[0]+e.creator.lastName[0]))]):t._e(),null==e.creator?a("a-avatar",{staticClass:"mt-5",attrs:{size:50},scopedSlots:t._u([{key:"icon",fn:function(){return[a("font-awesome-icon",{staticClass:"ml-auto mr-auto mt-auto mb-auto",attrs:{icon:"fa-regular fa-bell"}})]},proxy:!0}],null,!0)}):t._e()],1),a("a-col",{attrs:{span:18,sm:24,md:24,lg:18,xl:18}},[a("a-row",{staticClass:"mt-5",attrs:{gutter:24}},[a("a-col",{attrs:{span:24,md:24,lg:24,xl:24}},[a("h6",{staticClass:"mb-0 pb-0",staticStyle:{"font-weight":"600","font-size":"16px"}},[t._v(t._s(e.title))])])],1),a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{span:24,md:24,lg:24,xl:24}},[a("p",[t._v(t._s(e.content))])])],1),a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{span:14,md:14,lg:14,xl:12}},[a("small",[t._v(t._s(t.formatName(e.creator.firstName)+" "+t.formatName(e.creator.lastName))+" ")])]),a("a-col",{staticClass:"text-right",attrs:{span:10,md:10,lg:10,xl:12}},[a("label",{staticStyle:{"font-size":"12px"}},[t._v(t._s(""+t.$Moment(e.createdAt).format("hh:mm A"))+" ")])])],1),a("a-row",{attrs:{gutter:24}},[a("a-col",{attrs:{span:24,md:24,lg:24,xl:24}})],1)],1)],1)],1)],1)],1)],1)}))],2)],1)})),1)],1),t.loadingData?a("div",[a("a-row",{staticStyle:{"min-height":"60vh"},attrs:{type:"flex",gutter:[24,24],justify:"space-around",align:"middle"}},[a("a-col",{staticClass:"text-center  justify-items-center",attrs:{span:24,md:12,lg:12,xl:{span:6,offset:0}}},[a("a-spin",{staticClass:"text-primary",attrs:{size:"large"}})],1)],1)],1):t._e(),t.loadingData||0!==Object.keys(t.notificationList).length?t._e():a("div",[a("a-row",{staticClass:"px-20",staticStyle:{"min-height":"50vh"},attrs:{type:"flex",gutter:[24,24],justify:"space-around",align:"middle"}},[a("a-col",{staticClass:"text-center  justify-items-center",attrs:{span:24,md:12,lg:12,xl:{span:6,offset:0}}},[a("img",{attrs:{src:n("c6dc"),alt:"",width:"70%"}}),a("h6",{staticClass:"mt-5",staticStyle:{"font-weight":"600",color:"#8C8C8C"}},[t._v("No notifications found")])])],1)],1)],1)])},r=[],o=(n("13d5"),n("56cd")),i={components:{},data(){return{loadingData:!1,message:"",currentPage:1,pagination:{search:"",filter:"today",perPage:10,currentPage:1,totalPages:1,perPageOptions:[10,20,30,50],total:0},notifications:[],notificationList:[],form:this.$form.createForm(this,{name:"topic_login"}),isRepeatable:!1,filterItems:[{uuid:"today",name:"Today ",icon:" "},{uuid:"yesterday",name:"Yesterday ",icon:" "},{uuid:"week",name:"This Week ",icon:" "},{uuid:"month",name:"This Month ",icon:" "}],repeatitions:[{uuid:1,name:"Daily"},{uuid:7,name:"Weekly"},{uuid:30,name:"Monthly"},{uuid:365,name:"Yearly"}],userDetails:{},todayDate:this.$Moment(new Date).format("DD MMM YYYY")}},mounted(){let t=[{title:"Notifications",url:"/notifications",isActive:!0}];this.$root.$refs.Breadcrumbs.initializeBreadCrumbs(t)},created(){this.getNotifications()},watch:{currentPage:{handler(){this.pagination.currentPage=this.currentPage,this.getNotifications()}},deep:!0},methods:{formatName(t){let e=t.length>30?`${t[0].toUpperCase()}${t.substring(1,25).toLowerCase()}...`:`${t[0].toUpperCase()}${t.substring(1).toLowerCase()}`;return e},filterByExpiration(t){let e=new Date;this.$Moment(e.toISOString()).format("DD-MM-YYYY");return t.filter(t=>this.$Moment(t.startDate)>=this.$Moment())},handleNotificationClicked(t){if(t.title.toLowerCase().includes("new message")){let e=t.data.clazz;this.$router.push("/my-classes/view/"+e)}},onSelectFilterItem(t){this.pagination.filter=t,this.pagination.currentPage=1,this.getNotifications()},async getNotifications(){this.loadingData=!0;const{currentPage:t,perPage:e,filter:n}=this.pagination;let a;a=`${this.$BACKEND_URL}/notifications/mine?orderBy=createdAt&order=ASC&populate=true&page=${t}&size=${e}`,this.$AXIOS.get(a).then(async t=>{200==t.status&&(this.notificationList=t.data.data,this.pagination.totalPages=null!=t.data.pagination?t.data.pagination.totalPages:1,this.pagination.total=null!=t.data.pagination?t.data.pagination.totalItems:0,this.pagination.currentPage=null!=t.data.pagination?t.data.pagination.currentPage:1,this.currentPage=null!=t.data.pagination?t.data.pagination.currentPage:1,this.notifications=await this.filterByExpiration(t.data.data).reduce((t,e)=>{const n=this.$Moment(e.createdAt).format("DD MMM YYYY");return t[n]||(t[n]=[]),t[n].push(e),t},{}),this.readNotifications()),this.loadingData=!1}).catch(async t=>{this.loadingData=!1,t.response&&401==t.response.status&&(await localStorage.setItem("user_token",null),await localStorage.setItem("user_details",null),await localStorage.setItem("institution_details",null),this.$router.push("/sign-in"))})},formatDateToUTC(t,e){return new Date(this.$Moment(t).format("YYYY"),this.$Moment(t).format("MM")-1,this.$Moment(t).format("DD"),this.$Moment(e).format("HH"),this.$Moment(e).format("mm"),this.$Moment(e).format("ss"),0).toISOString()},readNotifications(){let t=this.$BACKEND_URL+"/notifications/read";this.$AXIOS.post(t,{}).then(t=>{t.status>=200&&t.status}).catch(t=>{})},notify(t,e){o["a"][e]({message:t,description:"",placement:"topRight",duration:3})}}},c=i,s=(n("0867"),n("2877")),u=Object(s["a"])(c,a,r,!1,null,"6104251d",null);e["default"]=u.exports},fc6a:function(t,e,n){var a=n("44ad"),r=n("1d80");t.exports=function(t){return a(r(t))}}}]);
//# sourceMappingURL=chunk-5c90787c.a7755be6.js.map