principal-dashboard-lib-v2 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/principal-dashboard-lib-v2.umd.js +4 -2
- package/bundles/principal-dashboard-lib-v2.umd.js.map +1 -1
- package/bundles/principal-dashboard-lib-v2.umd.min.js +1 -1
- package/bundles/principal-dashboard-lib-v2.umd.min.js.map +1 -1
- package/esm2015/lib/chartheader/chartheader.component.js +2 -2
- package/esm2015/lib/principal-dashboard-lib-v2.service.js +4 -2
- package/fesm2015/principal-dashboard-lib-v2.js +4 -2
- package/fesm2015/principal-dashboard-lib-v2.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("angular-google-charts"),require("file-saver"),require("xlsx"),require("@angular/common"),require("ng2-datepicker")):"function"==typeof define&&define.amd?define("principal-dashboard-lib-v2",["exports","@angular/core","rxjs","angular-google-charts","file-saver","xlsx","@angular/common","ng2-datepicker"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["principal-dashboard-lib-v2"]={},e.ng.core,e.rxjs,e.angularGoogleCharts,e.FileSaver,e.XLSX,e.ng.common,e.ng2Datepicker)}(this,(function(e,t,a,r,i,s,n,o){"use strict";var l=function(){function e(){this.isResoureMetaDataReady=new a.ReplaySubject,this.isResoureMetaDataReady$=this.isResoureMetaDataReady.asObservable(),this.isUserReqiuredDataReady=new a.ReplaySubject,this.isUserReqiuredDataReady$=this.isUserReqiuredDataReady.asObservable(),this.mychartType="",this.dataType="",this.userAllData="",this.userMetadata={userDetails:[],resourceDetails:[]},this.resoureMetadata=new Array,this.userDetailObject={},this.userlist=!1,this.chartType=new a.BehaviorSubject(this.mychartType),this.chartType$=this.chartType.asObservable(),this.isUserWise_data=new a.BehaviorSubject(!0),this.isUserWise_data$=this.isUserWise_data.asObservable(),this.isAllUsers=new a.BehaviorSubject(this.userlist),this.isAllUsers$=this.isAllUsers.asObservable(),this.detailedviewData=new a.BehaviorSubject(this.userMetadata),this.detailedviewData$=this.detailedviewData.asObservable()}return e.prototype.genarateResourseReqiuredData=function(e){this.isResoureMetaDataReady.next(!1);var t=new Array;if(e&&null!==e){var a=e.resourcesMetadata.resourceMetadata;if(null!=a&&a.length>0)for(var r=0;r<a.length;r++){var i={resouseID:a[r].resourceId,subject:null!=a[r].subject&&null!=a[r].subject.title?a[r].subject.title:"",grade:null!=a[r].grade&&null!=a[r].grade.title?a[r].grade.title:"",chapter:null!=a[r].chapter&&null!=a[r].chapter.title?a[r].chapter.title:"",teachingpoint:null!=a[r].teachingpoint&&null!=a[r].teachingpoint.title?a[r].teachingpoint.title:"",type:null!=a[r].type?this.getDisplaytypeValue(a[r].type):"",title:null!=a[r].title?a[r].title:""};t.push(i),this.resoureMetaData=t,this.isResoureMetaDataReady.next(!0)}}return t},e.prototype.genarateUserReqiuredData=function(e){this.isUserReqiuredDataReady.next(!1);var t=new Array,a=new Array,r=new Array,i=new Array;if(e&&null!==e){var s=e.usersConsole.userConsole,n=e.usersMetadata.userMetadata,o=e.schoolTerminals.schoolTerminal;if(null!=n&&n.length>0)for(var l=0;l<n.length;l++){var d=void 0,h=void 0,c=void 0,p={};""!=n[l].userId&&(p={userId:d=n[l].userId,userName:h=void 0!==n[l].fullName?n[l].fullName:"",userSubjects:c=void 0!==n[l].userSubjects?n[l].userSubjects:""},t.push(p))}for(var u=0;u<t.length;u++)t.forEach((function(e){t[u].userName===e.userName&&(a.push(t[u]),t.splice(u,1))}));for(u=0;u<a.length;u++)a[u].userName=a[u].userName+" "+u,t.push(a[u]),this.usersMetaData=t;if(null!=o&&o.length>0)for(u=0;u<o.length;u++){var m,y=void 0,v=void 0,g=void 0,f=void 0;if(y=void 0!==o[u].schoolId?o[u].schoolId:"",v=void 0!==o[u].terminalKey?o[u].terminalKey:"",g=void 0!==o[u].terminalType?o[u].terminalType:"",void 0!==o[u].metadata)f=JSON.parse(o[u].metadata).location,console.log("metadataJSON",f);else f="";m={schoolId:y,terminalKey:v,terminalType:g,location:f},r.push(m),this.schoolTerminalData=r}if(null!=s&&s.length>0)for(var b=0;b<s.length;b++){d=void 0;var D=void 0,w=void 0,C=void 0,x=void 0,T=void 0,A=new Array,U=(h=void 0,c=void 0,void 0);d=void 0!==s[b].userId?s[b].userId:"",D=void 0!==s[b].startTime?s[b].startTime:"",void 0!==s[b].endTime?(w=s[b].endTime,this.myEndTime=w):w="",void 0!==s[b].selectedDate?s[b].selectedDate:"",C=void 0!==s[b].duration?s[b].duration:"",x=void 0!==s[b].terminalIP?s[b].terminalIP:"",null!=(T=void 0!==s[b].userConsoleResources?s[b].userConsoleResources:null)&&(A=void 0!==T.userConsoleResource?T.userConsoleResource:[]);for(var S=0;S<t.length;S++)d===t[S].userId&&(h=t[S].userName,c=t[S].userSubjects);for(var M=0;M<r.length;M++)console.log("schoolTerminalMatrix[i].terminalKey",x,r[M].terminalKey),U=x===r[M].terminalKey?r[M].location:"location";var R={userId:d,userName:h,startTime:new Date(D),endTime:new Date(w),terminalIP:x,resourceMetauserConsoleData:A,duration:C,terminalLocation:U,userSubjects:c};i.push(R),this.userConsoleData=i,this.isUserReqiuredDataReady.next(!0)}}return{usersMetadata:t,schoolTerminalData:r,userConsoleData:i}},e.prototype.userWiseChartData=function(){var e=new Array;if(e=[],this.userConsoleData&&this.userConsoleData.length>0)for(var t=0;t<this.userConsoleData.length;t++){var a=[this.userConsoleData[t].userName,this.userConsoleData[t].startTime,this.userConsoleData[t].endTime];e.push(a)}return e},e.prototype.classRoomWiseChartData=function(){var e=new Array;if(e=[],this.userConsoleData){console.log("this.userConsoleData",this.userConsoleData);for(var t=0;t<this.userConsoleData.length;t++){var a=[this.userConsoleData[t].terminalLocation,this.userConsoleData[t].startTime,this.userConsoleData[t].endTime];e.push(a)}}return e},e.prototype.allUserChartData=function(){var e=new Array;e=[];var t=new Array;if(t=[],this.userConsoleData&&this.usersMetaData){for(var a=void 0,r=void 0,i=void 0,s=new Array,n=0;n<this.userConsoleData.length;n++)s.push(this.userConsoleData[n]),t.push(this.userConsoleData[n]);for(var o=0;o<this.usersMetaData.length;o++){i=this.usersMetaData[o].userId,a=this.usersMetaData[o].userName,r=this.usersMetaData[o].userSubjects;var l={userId:i,userName:a,startTime:new Date(this.myEndTime),endTime:new Date(this.myEndTime),terminalIP:"",resourceMetauserConsoleData:[],duration:"0",terminalLocation:"",userSubjects:r};s.push(l);var d={userId:i,userName:a,startTime:"",endTime:"",terminalIP:"",resourceMetauserConsoleData:[],duration:0,terminalLocation:"",userSubjects:r};t.push(d)}for(o=0;o<s.length;o++){var h=[s[o].userName,s[o].startTime,s[o].endTime];e.push(h)}}return{forChartData:e,fordurationTable:t}},e.prototype.allRoomsData=function(){var e=new Array;e=[];var t=new Array;if(t=[],this.userConsoleData&&this.schoolTerminalData){for(var a={},r=void 0,i=0;i<this.userConsoleData.length;i++){t.push(this.userConsoleData[i]);var s=[this.userConsoleData[i].terminalLocation,this.userConsoleData[i].startTime,this.userConsoleData[i].endTime];e.push(s)}for(i=0;i<this.schoolTerminalData.length;i++){r=this.schoolTerminalData[i].location,a={userId:"",userName:"",startTime:new Date(this.myEndTime),endTime:new Date(this.myEndTime),terminalIP:"",resourceMetauserConsoleData:[],duration:0,terminalLocation:r,userSubjects:""},t.push(a);var n=[r,new Date(this.myEndTime),new Date(this.myEndTime)];e.push(n)}}return{forChartData:e,fordurationTable:t}},e.prototype.dataForTableView=function(e,t){var a,r=new Array;new Array;r=[];for(var i=0;i<e.length;i++){var s,n=void 0,o=void 0,l=void 0,d=void 0,h=void 0,c=(new Array,new Array);new Array;c=[],[],h=e[i].userSubjects,d=e[i].userName,null!=e[i].startTime&&""!=e[i].startTime&&null!=e[i].endTime&&""!=e[i].endTime&&(n=e[i].startTime.toLocaleTimeString("en-US",{hour12:!0}),o=e[i].endTime.toLocaleTimeString("en-US",{hour12:!0}),a=e[i].startTime.getDate()+"/"+(e[i].startTime.getMonth()+1)+"/"+e[i].startTime.getFullYear()),l=Math.floor(e[i].duration);var p=e[i].terminalLocation+" "+e[i].terminalIP;if(0==(s=e[i].resourceMetauserConsoleData).length)void 0,void 0,c=[d,h,a,n,o,l,p,void 0,void 0,void 0,void 0,void 0],r.push(c);else for(var u=0;u<s.length;u++)for(var m=0;m<t.length;m++)s[u]===t[m].resouseID&&(c=[d,h,a,n,o,l,p,t[m].subject,t[m].grade,t[m].chapter,t[m].teachingpoint,this.getDisplaytypeValue(t[m].type)+": "+t[m].title],r.push(c),d=void 0,h=void 0,a=void 0,n=void 0,o=void 0,l=void 0,p=void 0)}return r},e.prototype.dataForDetailedView=function(e,t,a){var r=new Array;var i,s,n,o,l,d=new Array;d=[];var h=new Array;if(h=[],o=e[a].userSubjects,n=e[a].userName,null!=e[a].startTime&&""!=e[a].startTime&&null!=e[a].endTime&&""!=e[a].endTime&&(i=e[a].startTime.toLocaleTimeString("en-US",{hour12:!0}),s=e[a].endTime.toLocaleTimeString("en-US",{hour12:!0}),e[a].startTime.getDate()+"/"+e[a].startTime.getMonth()+"/"+e[a].startTime.getFullYear()),Math.floor(e[a].duration),r=[n,i,o,s,e[a].terminalLocation+" "+e[a].terminalIP],0==(l=e[a].resourceMetauserConsoleData).length)void 0,void 0,void 0,void 0,void 0;else for(var c=0;c<l.length;c++)for(var p=0;p<t.length;p++)l[c]===t[p].resouseID&&(h=[t[p].subject,t[p].grade,t[p].chapter,t[p].teachingpoint,t[p].type+": "+t[p].title],d.push(h));return{userDetails:r,resourceDetails:d}},e.prototype.getDisplaytypeValue=function(e){var t=e;return[{type:"asset_media",display:"Media"},{type:"asset_print",display:"Print"},{type:"quiz",display:"Quiz"},{type:"question",display:"Question"},{type:"chapter",display:"Chapter"},{type:"tp",display:"Topic"},{type:"whiteboard",display:"Whiteboard"},{type:"widget",display:"Widget"},{type:"casset_media",display:"cMedia"},{type:"casset_print",display:"cPrint"},{type:"cquiz",display:"cQuiz"},{type:"cquestion",display:"cQuestion"},{type:"image",display:"Image"},{type:"video",display:"Video"}].forEach((function(a){a.type===e&&(t=a.display)})),t},e}();l.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new l},token:l,providedIn:"root"}),l.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],l.ctorParameters=function(){return[]};var d=function(){function e(){this.userSelectedDate=new t.EventEmitter,this.messageForUser="Loding..."}return Object.defineProperty(e.prototype,"responseStatus",{set:function(e){this.setMessageForUser(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.setMessageForUser=function(e){this.messageForUser=e},e.prototype.onUserSelectDate=function(e){this.data=null,this.userSelectedDate.emit(e)},e}();d.decorators=[{type:t.Component,args:[{selector:"lib-principal-dashboard-lib-v2",template:'<div id="reprtModule">\r\n <div id="pd-mainDiv" class="pd-mainContainer">\r\n <lib-header [data]="data" (userSelectedDate)="onUserSelectDate($event)">\r\n </lib-header>\r\n <lib-chartheader></lib-chartheader>\r\n \r\n <div id="pd-preloader" class="pd-preloaderDiv" *ngIf="responseStatus !== \'true\' && !data">\r\n {{messageForUser}}\r\n </div>\r\n <lib-chartview *ngIf="data" [data]="data"></lib-chartview>\r\n <lib-tableview *ngIf="data" [data]="data"></lib-tableview>\r\n <lib-detailedview *ngIf="data" [data]="data"></lib-detailedview>\r\n \r\n </div>\r\n</div>\r\n ',styles:[".pd-mainContainer{width:100%;height:100%}.pd-mainContainer .pd-preloaderDiv{text-align:center;line-height:27;position:absolute;width:100%;height:87%;top:33px;z-index:2}.bs-datepicker-head{background-color:#000!important}"]}]}],d.ctorParameters=function(){return[]},d.propDecorators={data:[{type:t.Input}],responseStatus:[{type:t.Input}],userSelectedDate:[{type:t.Output}]};var h=function(){function e(e){this.pdService=e,this.mytype=r.ChartType.Timeline,this.datadisplaytype="UserWise",this.isUserWise=!0,this.isChartView=!0}return e.prototype.ngOnInit=function(){this.libVersion="0.0.20"},e.prototype.changeChatType=function(){this.mytype==r.ChartType.Timeline?(this.isChartView=!1,this.mytype=r.ChartType.Table,this.pdService.chartType.next(this.mytype)):(this.isChartView=!0,this.mytype=r.ChartType.Timeline,this.pdService.chartType.next(this.mytype))},e.prototype.changeDataTypeClassRoom=function(){this.isUserWise=!1,this.pdService.isUserWise_data.next(!1)},e.prototype.changeDataTypeUser=function(){this.isUserWise=!0,this.pdService.isUserWise_data.next(!0)},e}();h.decorators=[{type:t.Component,args:[{selector:"lib-chartheader",template:'\r\n<div id="pd-chartheader">\r\n <div id="pd-chatTypeBtnDiv" class="pd-tabIconBtn" [ngClass]=" isChartView ? \'tableIconImg\' : \'chartIconImg\'" (click)="changeChatType()">\r\n </div>\r\n \r\n <div id="pd-userWisechatTypeBtn" class="userWiseBtn" [ngStyle]="{ color: isUserWise ? \'#ffffff\' : \'#000000\' , backgroundColor: isUserWise ? \'#000000\' : \'#c4c4c4\'}"\r\n (click)="changeDataTypeUser()">User wise</div>\r\n <div id="pd-classRoomWiseBtn" class="classWiseBtn" [ngStyle]="{ color: isUserWise ? \'#000000\' : \'#ffffff\' , backgroundColor: isUserWise ? \'#c4c4c4\' : \'#000000\'}"\r\n (click)="changeDataTypeClassRoom()">Classroom wise</div>\r\n\r\n \r\n <div class="libVersionDiv">v{{libVersion}}</div>\r\n</div>',styles:['#pd-chartheader{font-size:12pt;font-weight:400;color:#5c5c5c;z-index:1;width:100%;height:40px;position:relative;margin:10 auto;text-align:center;background-color:#e0e0e0}#pd-chartheader #pd-classRoomWiseBtn,#pd-chartheader #pd-userWisechatTypeBtn{background:-moz-linear-gradient(center top,#45a1da 5%,#1172ae 100%);display:inline-block;padding:0 20px;cursor:pointer;margin:5px 0 0;width:160px;height:30px;line-height:30px}#pd-chartheader .libVersionDiv{position:absolute;font-size:12px;color:#343a40;margin-top:-21px;font-weight:700;margin-left:71px}.userWiseBtn{border-radius:6px 0 0 6px}.classWiseBtn{border-radius:0 6px 6px 0}.pd-tabIconBtn{cursor:pointer;position:absolute;left:10px;top:-17px;width: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i3BJl7zR/oqpLdS0sxxL6rObyWbb0WDWHGJBeGHz53//tVnJhORcMi6YGxszHfby3Nzc7C8vGy1c4UiXHj/s9Tli6/djc0C1iLb+oPdt6h626oeiURgZmbGV8ATiYQnqm57qygmMEtLS+DHIklgqMxtahK/an06QT3YXu524eTVwflDICnj+nUEXHfLuD4xMfEfO5EFSPUycMTxL/tdXFyMyxinu9fQzOTk5A4e95nJQLlShR5Dzrd2GCbM5/t4rJqDivOl8MqlL4udyjEYjxrZR6lcMh4aVJVau1JP8ahutIOhmmybmawXKlYQ/Z/IOM92yloXYImu/zjiBQHFNaEtG2eGTG94H+GxMGzIuqXyIuNm+RtrkiUxAODFPrCZb4ZdsuQF43r9fhtYj4v3tb0Tx1nJ17O267EUkfF+kXFzJv7ymGmz9Lc5Pu9lbsMxb3l2p29ZZV8s++XD3WYLWwDnD3sb+mXfpUOPgHU7CSCz8VZOqVeL1En+L8AAjJTPo0iRABoAAAAASUVORK5CYII=")}']}]}],h.ctorParameters=function(){return[{type:l}]};Object.create;function c(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,i,s=a.call(e),n=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)n.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}return n}function p(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}Object.create;var u=function(){function e(e){this.pdService=e,this.totalUsers=0,this.eligibleUsers=0,this.currentUsers=0,this.myChartType=r.ChartType.Timeline,this.myChartwidth=.88*window.innerWidth,this.myChartHeight=window.innerHeight,this.currentList="Current Users",this.allList="All Users",this.isAllUsers=!1,this.isUserWise=!1,this.myChartDataMatrix=new Array,this.totalChartDataMatrix=new Array}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadChart(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.loadChart=function(e){var t=this;this.totalUsers=0,this.eligibleUsers=0,this.currentUsers=0,this.myChartType=r.ChartType.Timeline,this.myChartwidth=.88*window.innerWidth,this.myChartHeight=window.innerHeight,this.currentList="Current Users",this.allList="All Users",this.isAllUsers=!1,this.isUserWise=!1,this.myChartDataMatrix=[],this.totalChartDataMatrix=[],this.chartview=document.getElementById("pd-chartview"),this.myDataList=document.getElementById("pd-xmlData"),e&&(this.myXmlData=JSON.parse(e)),this.myXmlData&&(this.currentdataList=this.pdService.genarateUserReqiuredData(this.myXmlData),this.alluserList=this.pdService.allUserChartData(),this.resourceDataList=this.pdService.genarateResourseReqiuredData(this.myXmlData),this.totalUsers=this.currentdataList.usersMetadata.length,this.findCurrentUserCount()),this.pdService.chartType.subscribe((function(e){e&&t.updateChartType(e)})),this.pdService.isUserWise_data.subscribe((function(e){t.updateDataType(e)})),window.addEventListener("resize",this.onResizeWindow.bind(this))},e.prototype.onResizeWindow=function(e){this.myChartwidth=.88*window.innerWidth},e.prototype.myChartReady=function(){this.createDivforTotalDurartion(),this.setHeightofDivforTotalDurartion()},e.prototype.updateChartType=function(e){null!=this.chartview&&null!=this.chartview&&(e==r.ChartType.Table?this.chartview.style.display="none":this.chartview.style.display="block")},e.prototype.updateDataType=function(e){this.isUserWise=e,this.myXmlData&&(this.isUserWise?(this.currentList="Current Users",this.allList="All Users",this.isAllUsers?this.userWiseAllData():this.userWiseCurrentData()):(this.allList="All Rooms",this.currentList="Current Rooms",this.isAllUsers?this.classRoomWiseAllData():this.classRoomWiseCurrentData()))},e.prototype.updateChart=function(){for(var e=this,t=document.getElementById("labels");t.firstChild;)t.removeChild(t.lastChild);this.chartDataTable=this.myChartDataMatrix,console.log("this.myChartDataMatrix",this.myChartDataMatrix),this.myChartOptions={tooltip:{trigger:"none"},colors:["#ff7f0e","#2ca02c","#8c564b","#d62728","#bcbd22","#17becf"],timeline:{colorByRowLabel:!0,barLabelStyle:{fontSize:7}},hAxis:{format:"HH:mm a"}},setTimeout((function(){e.myChartHeight=e.AllrowHeight+100}),1e3)},e.prototype.calulateTotalDuration=function(e){var t,a=new Array;if(a=[],this.totalChartDataMatrix=[],this.isUserWise)for(var r=0;r<e.length;r++)t={name:e[r].userName,value:parseInt(e[r].duration)},a.push(t);else for(r=0;r<e.length;r++)t={name:e[r].terminalLocation,value:parseInt(e[r].duration)},a.push(t);var i={};(a=p(new Set(a))).forEach((function(e){i[e.name]?i[e.name].value=i[e.name].value+e.value:i[e.name]=e}));var s=Object.values(i),n=new Array;n=[],s.forEach((function(e){n.push(e.value)}));for(r=0;r<n.length;r++){var o=[this.timeConvert(n[r]).toString()+" hrs"];this.totalChartDataMatrix.push(o)}},e.prototype.timeConvert=function(e){var t=Math.floor(e)/60,a=Math.floor(t),r=60*(t-a);return a+":"+Math.round(r)},e.prototype.removeBlankEntryBar=function(){for(var e=document.getElementById("myTimeLine").getElementsByTagName("rect"),t=1e8,a=[],r=0;r<e.length;r++){var i=parseInt(e[r].getAttribute("width"));i<t?(a=[e[r]],t=i):i==t&&a.push(e[r])}for(r=0;r<a.length;r++)a[r].setAttribute("fill","none")},e.prototype.createDivforTotalDurartion=function(){var e=[];this.rowElements=[];for(var t=document.getElementById("labels");t.firstChild;)t.removeChild(t.lastChild);for(var a=0;a<this.totalChartDataMatrix.length;a++){var r=this.totalChartDataMatrix[a][0];e.push(r);var i=t.appendChild(document.createElement("div"));i.style["border-bottom"]="1px solid #b7b7b7",i.style["font-family"]="Arial",i.style["font-size"]="13px",i.style["text-align"]="left",i.style["padding-left"]="8px",i.style["padding-right"]="8px",i.style.position="inherit",i.style["background-color"]=a%2?"#e6e6e6":"#ffffff",i.innerHTML=r,this.rowElements.push(i)}},e.prototype.setHeightofDivforTotalDurartion=function(){this.AllrowHeight=0;for(var e=document.getElementById("myTimeLine").getElementsByTagName("rect"),t=-1,a=0;a<e.length;a++)if(++t<this.rowElements.length){var r=parseFloat(e[a].getAttribute("height"))+"px";this.AllrowHeight+=parseFloat(e[a].getAttribute("height"));var i=this.rowElements[t];i&&(i.style.height=r,i.style.lineHeight=r)}},e.prototype.onSelectRowData=function(e){var t=e.selection[0],a=t.row;t.column;this.isAllUsers?this.selectedUserData=this.pdService.dataForDetailedView(this.alluserList.fordurationTable,this.resourceDataList,a):this.selectedUserData=this.pdService.dataForDetailedView(this.currentdataList.userConsoleData,this.resourceDataList,a),this.pdService.detailedviewData.next(this.selectedUserData),this.updateChart()},e.prototype.showAllUser=function(){this.pdService.isAllUsers.next(!0),this.isAllUsers=!0,this.isUserWise?this.userWiseAllData():this.classRoomWiseAllData()},e.prototype.showCurrentUser=function(){this.isAllUsers=!1,this.pdService.isAllUsers.next(!1),this.isUserWise?this.userWiseCurrentData():this.classRoomWiseCurrentData()},e.prototype.userWiseCurrentData=function(){var e=this.pdService.userWiseChartData();e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.currentdataList.userConsoleData.length>0&&this.calulateTotalDuration(this.currentdataList.userConsoleData))},e.prototype.userWiseAllData=function(){var e=this.alluserList.forChartData;e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.calulateTotalDuration(this.alluserList.fordurationTable))},e.prototype.classRoomWiseCurrentData=function(){var e=this.pdService.classRoomWiseChartData();e&&e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.currentdataList.userConsoleData.length>0&&this.calulateTotalDuration(this.currentdataList.userConsoleData))},e.prototype.classRoomWiseAllData=function(){var e=this.pdService.allRoomsData();e.forChartData&&e.forChartData.length>0&&(this.myChartDataMatrix=e.forChartData,this.updateChart()),e.fordurationTable&&e.fordurationTable.length>0&&this.calulateTotalDuration(e.fordurationTable)},e.prototype.findCurrentUserCount=function(){for(var e=this.currentdataList.userConsoleData,t=new Array,a=0;a<e.length;a++){var r=e[a].userName;t.push(r)}var i=p(new Set(t));this.currentUsers=i.length},e.prototype.ngOnDestroy=function(){},e}();u.decorators=[{type:t.Component,args:[{selector:"lib-chartview",template:'<div id="pd-chartview-main-container" class="pd-chartview-main-container">\r\n <div id="userSummary">\r\n <table class="summaryTable">\r\n <tbody>\r\n <tr>\r\n <td id="totalUsers" class="chartview-navigationbar">\r\n Total users: {{totalUsers}}\r\n </td>\r\n <td id="eligibleUsers" class="chartview-navigationbar">\r\n Eligible users: {{eligibleUsers}}\r\n </td>\r\n <td id="currentUsers" class="chartview-navigationbar">\r\n Current users: {{currentUsers}}\r\n </td>\r\n <td id="totalRooms" class="chartview-navigationbar">\r\n Installed Classrooms: {{installedClassrooms}}\r\n </td>\r\n <td id="currentRooms" class="chartview-navigationbar">\r\n Current Classrooms: {{currentRooms}}\r\n </td>\r\n \x3c!-- <td\r\n id="currentRooms"\r\n \r\n >\r\n <span id="totalUsers_list" class="activeAll">User List</span>\r\n </td> --\x3e\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n <div id="pd-messageDivContainer" class=\'pd-messageDivContainer\'>\r\n <div id="pd-messageDiv" class=\'pd-messageDiv\'>Click the bars to view details of content accessed by a teacher.</div>\r\n <div id="pd-toggleContainer" class="pd-toggleContainer">\r\n \r\n <div id="pd-currentUserBtn" class="pd-currentUserBtn-div pd-commonStyleBtn" (click)="showCurrentUser()" [ngStyle]="{ color: isAllUsers ? \'#000000\' : \'#ffffff\' , backgroundColor: isAllUsers ? \'#c4c4c4\' : \'#000000\'}">\r\n {{currentList}}</div>\r\n <div id="pd-allUserBtn" class="pd-allUserBtn-div pd-commonStyleBtn" (click)="showAllUser()" [ngStyle]="{ color: isAllUsers ? \'#ffffff\' : \'#000000\' , backgroundColor: isAllUsers ? \'#000000\' : \'#c4c4c4\'}">\r\n {{allList}}</div>\r\n </div>\r\n </div>\r\n <div id="pd-chartview" class="pd-chartview">\r\n <div id="myChartDiv">\r\n <div id="myTimeLine">\r\n <google-chart\r\n [type]="myChartType"\r\n [data]="chartDataTable"\r\n [options]="myChartOptions"\r\n [width]="myChartwidth"\r\n [height]="myChartHeight"\r\n (select)="onSelectRowData($event)"\r\n (ready)="myChartReady()"\r\n > \r\n </google-chart>\r\n \r\n </div>\r\n <div class="inline" id="labels"></div> \r\n \r\n \r\n </div>\r\n</div>\r\n',styles:[".pd-chartview-main-container .pd-chartview{display:block;overflow:scroll;width:100%;height:484px;font-family:Tahoma;font-size:12pt;font-weight:400;color:#666;margin:10 auto;text-align:center;padding-top:1px}.pd-chartview-main-container #userSummary{background:#e0e0e0;margin-top:1px}.pd-chartview-main-container #roomSummary,.pd-chartview-main-container #userSummary{position:relative;width:100%;text-align:center;padding-top:6px;padding-bottom:6px;font-size:13px}.pd-chartview-main-container .pd-messageDivContainer{margin-top:1px}.pd-chartview-main-container .pd-messageDivContainer .pd-messageDiv{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:absolute;margin-left:5px;font-size:13px}.pd-chartview-main-container .pd-messageDivContainer .pd-toggleContainer{line-height:30px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;float:right;margin:5px 0}.pd-chartview-main-container .pd-messageDivContainer .pd-allUserBtn-div{border-radius:0 5px 5px 0}.pd-chartview-main-container .pd-messageDivContainer .pd-currentUserBtn-div{border-radius:5px 0 0 5px}.pd-chartview-main-container .pd-messageDivContainer .pd-commonStyleBtn{display:inline-block;cursor:pointer;font-size:12px;width:92px;text-align:center}.pd-chartview-main-container .summaryTable{width:100%;border-collapse:collapse;border-spacing:2px;border-color:grey}.pd-chartview-main-container .activeAll{cursor:pointer;background:none!important;border-radius:13px;border:none;width:64px;height:18px!important;line-height:18px!important;color:#45a1da;margin-right:0!important;padding:1px 5px;vertical-align:sub}.pd-chartview-main-container #myTimeLine{width:89%;height:60%;margin-left:5px;overflow-x:scroll;overflow-y:hidden;float:left}.pd-chartview-main-container #myTimeLine2{width:71px;position:relative;overflow-x:hidden;overflow-y:hidden}.pd-chartview-main-container #myChartDiv{width:100%}.pd-chartview-main-container .chartview-navigationbar{border-collapse:collapse;border-right:1px solid #999;text-align:center}.pd-chartview-main-container #labels{border-right:1px solid #b7b7b7;border-top:1px solid #b7b7b7;width:10%;float:left;font-size:1.2vw;overflow-x:hidden;overflow-y:hidden}.inline{vertical-align:top;position:relative}"]}]}],u.ctorParameters=function(){return[{type:l}]},u.propDecorators={data:[{type:t.Input}]};var m=function(){function e(e){this.pdService=e,this.userMetadataHeadingArray=["Name:","Start Time:","Subject:","End Time:","Room Details:"],this.resourseMetadataHeadingArray=["Subject","Class","Chapter Name","Topic Name","Assets Details"]}return e.prototype.ngOnInit=function(){var e=this;this.deatilViewContainer=document.getElementById("pd-deatilViewContainer"),this.deatilViewTable=document.getElementById("pd-deatilViewTable"),this.closeButton=document.getElementById("pd-closeButton"),this.pdService.detailedviewData.subscribe((function(t){t&&(t.userDetails.length>0&&e.createTable(t.userDetails),t.resourceDetails.length>0&&e.createResourcesTable(t.resourceDetails))})),this.deatilViewContainer.style.display="none"},e.prototype.createTable=function(e){for(this.deatilViewContainer.style.display="block";this.deatilViewTable.firstChild;)this.deatilViewTable.removeChild(this.deatilViewTable.lastChild);for(var t=new Array,a=0,r=0;r<e.length;r++){var i=document.createElement("label");i.appendChild(document.createTextNode(this.userMetadataHeadingArray[r])),"undefined"!==i.textContent&&void 0!==i.textContent||(i.textContent=""),t.push(i);var s=document.createElement("label");s.appendChild(document.createTextNode(e[r])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}var n=document.createElement("table");n.id="userDataTable",n.className="table table-bordered";for(var o=document.createElement("tbody"),l=0;l<e.length/2;l++){var d=document.createElement("tr"),h=void 0;for(r=0;r<4;r++)r%2==0?(h=document.createElement("th")).style["font-weight"]="bold":h=document.createElement("td"),a<t.length&&(h.appendChild(t[a]),d.appendChild(h)),a++;o.appendChild(d),n.appendChild(o),this.deatilViewTable.appendChild(n)}},e.prototype.createResourcesTable=function(e){for(var t=new Array,a=0,r=0;r<this.resourseMetadataHeadingArray.length;r++){(s=document.createElement("label")).appendChild(document.createTextNode(this.resourseMetadataHeadingArray[r])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}for(r=0;r<e.length;r++)for(var i=0;i<5;i++){var s;(s=document.createElement("label")).appendChild(document.createTextNode(e[r][i])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}var n=document.createElement("table");n.className="table table-bordered",n.id="resoureMetadataTable";var o=document.createElement("tbody");for(i=0;i<=e.length;i++){var l=document.createElement("tr"),d=void 0;for(r=0;r<5;r++)0==i?(d=document.createElement("th")).style["font-weight"]="bold":d=document.createElement("td"),a<t.length&&(d.appendChild(t[a]),l.appendChild(d)),a++;o.appendChild(l),n.appendChild(o),this.deatilViewTable.appendChild(n)}},e.prototype.onCloseBtnClick=function(){this.deatilViewContainer.style.display="none"},e}();m.decorators=[{type:t.Component,args:[{selector:"lib-detailedview",template:'<div id="pd-deatilViewContainer">\r\n <div class="pd-detailview-header">\r\n <div class="pd-detailview-title">Details</div>\r\n <div id="pd-closeButton" (click)="onCloseBtnClick()">+</div>\r\n </div>\r\n <div id="pd-deatilViewTable"></div>\r\n</div>\r\n',styles:["#pd-deatilViewContainer{position:absolute;background:#fff;box-shadow:0 0 17px #818181;font-size:12px;width:50%;max-height:350px;top:140px;left:230px}#pd-deatilViewContainer .pd-detailview-header{position:relative;width:100%;height:35px;background-color:#e6e6e6}#pd-deatilViewContainer .pd-detailview-title{position:absolute;margin-left:5px;font-size:20px;line-height:35px}#pd-deatilViewContainer #pd-closeButton{width:24px;position:absolute;float:right;right:0;cursor:pointer;height:24px;background:#000;border-radius:12px;color:#fff;line-height:22px;text-align:center;font-size:26px;transform:rotate(45deg);margin:5px}#pd-deatilViewContainer #pd-deatilViewTable{overflow:scroll;scroll-behavior:smooth;height:auto;margin:5px;max-height:300px}"]}]}],m.ctorParameters=function(){return[{type:l}]};var y=function(){function e(){this.resourceTypes=new Array,this.tabName=[{name:"School"},{name:"User Summary"},{name:"Terminal Summary"},{name:"Usage Details"}]}return e.prototype.exportAsExcelFile=function(e,t){for(var a,r={Sheets:{},SheetNames:[]},i=0;i<e.length;i++){var n=s.utils.json_to_sheet(e[i]);r.Sheets[this.tabName[i].name]=n,r.SheetNames.push(this.tabName[i].name)}var o=r;a=s.write(o,{bookType:"xlsx",type:"array"}),this.saveAsExcelFile(a,t)},e.prototype.saveAsExcelFile=function(e,t){var a=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"});i.saveAs(a,t+".xlsx")},e.prototype.genarateResourseReqiuredData_Excel=function(e){var t,a=new Array,r=e.resourcesMetadata.resourceMetadata;if(null!=r&&r.length>0)for(var i=0;i<r.length;i++){var s={resouseID:r[i].resourceId,subject:null!=r[i].subject&&null!=r[i].subject.title?r[i].subject.title:"",grade:null!=r[i].grade&&null!=r[i].grade.title?r[i].grade.title:"",chapter:null!=r[i].chapter&&null!=r[i].chapter.title?r[i].chapter.title:"",teachingpoint:null!=r[i].teachingpoint&&null!=r[i].teachingpoint.title?r[i].teachingpoint.title:"",type:t=null!=r[i].type?this.getDisplaytypeValue(r[i].type):"",title:null!=r[i].title?r[i].title:""};a.push(s),this.resourceTypes.push(t)}return this.resourceTypes=p(new Set(this.resourceTypes)),a},e.prototype.genarateUserReqiuredData_Excel=function(e){var t=e.usersConsole.userConsole,a=e.usersMetadata.userMetadata,r=e.schoolTerminals.schoolTerminal,i=new Array,s=new Array,n=new Array,o=new Array;if(null!=a&&a.length>0)for(var l=0;l<a.length;l++){var d=void 0,h=void 0,c=void 0,p={};""!=a[l].userId&&(p={userId:d=a[l].userId,userName:h=void 0!==a[l].fullName?a[l].fullName:"",userSubjects:c=void 0!==a[l].userSubjects?a[l].userSubjects:""},i.push(p))}for(var u=0;u<i.length;u++)i.forEach((function(e){i[u].userName===e.userName&&(s.push(i[u]),i.splice(u,1))}));for(u=0;u<s.length;u++)s[u].userName=s[u].userName+" "+u,i.push(s[u]);if(null!=r&&r.length>0)for(u=0;u<r.length;u++){var m;m={schoolId:void 0!==r[u].schoolId?r[u].schoolId:"",terminalKey:void 0!==r[u].terminalKey?r[u].terminalKey:"",terminalType:void 0!==r[u].terminalType?r[u].terminalType:"",location:void 0!==r[u].metadata?r[u].metadata:""},n.push(m)}if(null!=t&&t.length>0)for(var y=0;y<t.length;y++){d=void 0;var v=void 0,g=void 0,f=void 0,b=void 0,D=void 0,w=new Array,C=(h=void 0,c=void 0,void 0);d=void 0!==t[y].userId?t[y].userId:"",v=void 0!==t[y].startTime?t[y].startTime:"",void 0!==t[y].endTime?(g=t[y].endTime,this.myEndTime=g):g="",void 0!==t[y].selectedDate?t[y].selectedDate:"",f=void 0!==t[y].duration?t[y].duration:"",b=void 0!==t[y].terminalIP?t[y].terminalIP:"",null!=(D=void 0!==t[y].userConsoleResources?t[y].userConsoleResources:null)&&(w=void 0!==D.userConsoleResource?D.userConsoleResource:[]);for(var x=0;x<i.length;x++)d===i[x].userId&&(h=i[x].userName,c=i[x].userSubjects);for(var T=0;T<n.length;T++)b===n[T].terminalKey&&(C=n[T].location);var A={userId:d,userName:h,startTime:new Date(v),endTime:new Date(g),terminalIP:b,resourceMetauserConsoleData:w,duration:f,terminalLocation:C,userSubjects:c};o.push(A)}return{usersMetadata:i,schoolTerminalData:n,userConsoleData:o}},e.prototype.deatilData_Excel=function(e,t){var a,r=new Array;r=[];for(var i=0;i<e.length;i++){var s,n,o,l,d=void 0,h=void 0,c=void 0,p=void 0,u=void 0,m=new Array;s=e[i].userId,u=e[i].userSubjects,p=e[i].userName,null!=e[i].startTime&&""!=e[i].startTime&&null!=e[i].endTime&&""!=e[i].endTime&&(d=e[i].startTime.toLocaleTimeString("en-US",{hour12:!0}),h=e[i].endTime.toLocaleTimeString("en-US",{hour12:!0}),a=e[i].startTime.getDate()+"/"+(e[i].startTime.getMonth()+1)+"/"+e[i].startTime.getFullYear()),c=Math.floor(e[i].duration);o=e[i].terminalLocation,n=e[i].terminalIP;var y=o,v=n;if(0==(l=e[i].resourceMetauserConsoleData).length)m=[p,u,a,d,h,c,y,v,"","","","","","",s],r.push(m);else for(var g=0;g<l.length;g++)for(var f=0;f<t.length;f++)l[g]===t[f].resouseID&&(m=[p,u,a,d,h,c,y,v,t[f].subject,t[f].grade,t[f].chapter,t[f].teachingpoint,t[f].title,this.getDisplaytypeValue(t[f].type),s],r.push(m),p="",u="",a="",d="",h="",y="",v="",c="")}return r},e.prototype.deatilUsage_Excel=function(e){var t=[];if(e.length>0)for(var a=0;a<e.length;a++){var r={Name:e[a][0],Subjects:e[a][1],Date:e[a][2],startTime:e[a][3],endTime:e[a][4],"duration(mins)":e[a][5],location:e[a][6],IP:e[a][7],subjectTitle:e[a][8],gradeTitle:e[a][9],Chapter:e[a][10],tpTitle:e[a][11],resourceTitle:e[a][12],resourceType:e[a][13]};t.push(r)}return t},e.prototype.userSummary_Excel=function(e,t){for(var a=e.usersMetadata.userMetadata,r=new Array,i=new Array,s=new Array,n=new Array,o=new Array,l=new Array,d=new Array,h=0,c=0;c<a.length;c++){r=[],i=[],n=[],o=[],l=[],d=[],h=0;for(var u=0;u<t.length;u++)a[c].userId===t[u][14]&&(""!=t[u][12]&&r.push(t[u][12]),""!=t[u][13]&&i.push(t[u][13]),""!=t[u][5]&&(h+=t[u][5]),n.push(t[u][6]),o.push(t[u][2]),l.push(t[u][9]),d.push(t[u][8]));var m=void 0,y=void 0,v=void 0,g=void 0,f=void 0;m=n.length>0?p(new Set(n))[0]:"",f=o.length>0?p(new Set(o)).length:"",y=o.length>0?p(new Set(o))[0]:"",v=l.length>0?p(new Set(l))[0]:"",g=d.length>0?p(new Set(d))[0]:"";var b={Name:a[c].fullName,Subjects:a[c].userSubjects,duration:h,ClassRooms:m,DatesAccess:y,DayAccess:f,Grades:v,SubjectTought:g,AseestUsed:r,AssetType:i};s.push(b)}var D=new Array,w=function(e){var t=[],a=s[e].AssetType;a=p(new Set(a)),s[e].AssetType.forEach((function(e){t[e]=(t[e]||0)+1})),C.resourceTypes.filter((function(e){return!a.includes(e)})).forEach((function(e){t[e]=0}));var r={Name:s[e].Name,Subjects_taught:s[e].Subjects," Duration(mins)":s[e].duration,ClassRooms:s[e].ClassRooms,DaysAccsessed:s[e].DayAccess,DatesAccess:s[e].DatesAccess,Grades:s[e].Grades,Subjects:s[e].SubjectTought},i=Object.assign(r,t);D.push(i)},C=this;for(c=0;c<s.length;c++)w(c);return D},e.prototype.getDisplaytypeValue=function(e){var t=e;return[{type:"asset_media",display:"Media"},{type:"asset_print",display:"Print"},{type:"quiz",display:"Quiz"},{type:"question",display:"Question"},{type:"chapter",display:"Chapter"},{type:"tp",display:"Topic"},{type:"whiteboard",display:"Whiteboard"},{type:"widget",display:"Widget"},{type:"casset_media",display:"cMedia"},{type:"casset_print",display:"cPrint"},{type:"cquiz",display:"cQuiz"},{type:"cquestion",display:"cQuestion"},{type:"image",display:"Image"},{type:"video",display:"Video"}].forEach((function(a){a.type===e&&(t=a.display)})),t},e}();y.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new y},token:y,providedIn:"root"}),y.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],y.ctorParameters=function(){return[]};var v=function(){function e(e,a){this.excelService=e,this.pdService=a,this.userSelectedDate=new t.EventEmitter,this.refreshTimer=0,this.title="datepicker",this.date=new Date,this.options={inputClass:"input",calendarClass:"datepicker-default",scrollBarColor:"#010001",format:"dd/LL/yyyy",maxDate:new Date}}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadData(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.getDefaultDate(),this.startTimer()},e.prototype.getDefaultDate=function(){var e=new Date;this.getDateFormat(e),this.todayDate=this.calenderCurrentDate},e.prototype.dateSelected=function(e){this.getDateFormat(e),this.mydata=null,this.refreshChart()},e.prototype.getDateFormat=function(e){var t,a=e.getDate(),r=e.getMonth()+1;t=r<10?"0"+r:r;var i=e.getFullYear()+"-"+t+"-"+(a<10?"0"+a:a);this.currentDate=i,this.calenderCurrentDate=i.split("-").reverse().join("-")},e.prototype.refreshChart=function(){this.stopTimer(),this.refreshTimer=0,this.calenderCurrentDate===this.todayDate&&this.countDown(),this.userSelectedDate.emit(this.calenderCurrentDate)},e.prototype.startTimer=function(){this.countDown()},e.prototype.stopTimer=function(){this.clearTimer(),this.message=""},e.prototype.clearTimer=function(){this.refreshTimer=0,window.clearInterval(this.intervalId)},e.prototype.countDown=function(){var e=this;console.log("countDown"),this.clearTimer(),this.intervalId=window.setInterval((function(){e.refreshTimer-=1,0===e.refreshTimer?(e.refreshChart(),e.message=""):(e.refreshTimer<0&&(e.refreshTimer=300),e.message=""+e.refreshTimer)}),1e3)},e.prototype.timeConvert=function(e){var t=e/60,a=Math.floor(t),r=60*(t-a);return a+":"+Math.round(r)},e.prototype.loadData=function(e){if(e&&(this.mydata=JSON.parse(e),this.mydata)){var t=this.excelService.genarateUserReqiuredData_Excel(this.mydata).userConsoleData,a=this.excelService.genarateResourseReqiuredData_Excel(this.mydata),r=this.excelService.deatilData_Excel(t,a),i=this.excelService.deatilUsage_Excel(r),s=this.excelService.userSummary_Excel(this.mydata,r),n=this.mydata.schoolMetadata.school,o=i,l=this.mydata.schoolTerminals.schoolTerminal;this.dataList=[[n],s,l,o]}},e.prototype.exportReport=function(){this.mydata&&this.excelService.exportAsExcelFile(this.dataList,"UsageReport-"+this.calenderCurrentDate)},e.prototype.ngOnDestroy=function(){this.clearTimer()},e}();v.decorators=[{type:t.Component,args:[{selector:"lib-header",template:'<div id="pd_header" class="pd_header">\r\n \r\n <div *ngIf="message && mydata && (this.todayDate === this.calenderCurrentDate)" id="pd_refeshView" class="pd_refesh_bar">\r\n <div class="timer_msg"> This page will be refreshed in</div>\r\n <div class="timer_value"> {{timeConvert(message)}} min</div>\r\n <div id="pd_refeshBtn" (click)="refreshChart()"> Refresh </div>\r\n </div>\r\n\r\n <div id="pd_exportBtn" class="pd_exportButton" *ngIf="mydata"\r\n [ngClass]="{\'pd_exportButton_shiftRight\': this.todayDate != this.calenderCurrentDate}" (click)="exportReport()"> \r\n <span class="pd_exportButton_text">Export usage report</span>\r\n <div class="pd_download_icon"></div>\r\n </div>\r\n \r\n <div class="pd_header_calendar">\r\n \x3c!-- <input type="Date" [max]="currentDate" [value]="currentDate" id="myCalendar" (input)="selectDate($event)" /> --\x3e\r\n <ngx-datepicker [(ngModel)]="date" [options]="options" (ngModelChange)="dateSelected($event)"></ngx-datepicker>\r\n </div>\r\n <div class="pd_header_content" >Realtime usage data</div>\r\n</div>\r\n',styles:['.pd_header{width:100%;background-color:#e0e0e0;height:50px;border-bottom:2px solid #fff}.pd_header_calendar{position:absolute;width:150px;margin:5px 5px 5px 17px}.pd_header_content{position:relative;width:350px;margin:0 auto;color:#000;text-align:center;font-size:30px;line-height:50px;pointer-events:none}.pd_exportButton{position:absolute;display:inline-block;right:144px;padding:0 16px;cursor:pointer;margin:9px 0 0;height:30px;width:160px;line-height:30px;background-color:#c4c4c4;font-size:10pt;font-weight:400;transition:right .5s}.pd_exportButton_shiftRight{right:10px}.pd_download_icon{position:absolute;width:16px;height:16px;background-size:100% 100%;top:8px;background-repeat:no-repeat;display:inline-block;right:5px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAAY0lEQVRIiWNgGOqAkQS1/8nRy0SCBWSBUQtGLRjiFpQzQDIXDKMDZLl6ch2Abgk2TLbhxFhCseH4LKGa4dgsIdpwZhIsOMoAKUEPMjAwNJLktFGADyDXStgyE8Vm07yoGPoAAH1UItbw1O5lAAAAAElFTkSuQmCC")}.pd_exportButton_text{position:relative;display:inline-block;width:130px}.pd_refesh_bar{position:absolute;color:#000;width:120px;height:78px;right:15px;top:4px;z-index:2;background-color:#fff;float:right;text-align:center;font-size:12px;border-radius:.25rem;border:1px solid #a09898;box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-animation:refreshViewAnimate .6s;animation:refreshViewAnimate .6s}@-webkit-keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}@keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}.timer_msg{position:absolute;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:14px;top:2px}.timer_value{font-weight:700;font-size:15px}#pd_refeshBtn,.timer_value{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;top:28px}#pd_refeshBtn{background-color:#2172f6;cursor:pointer;width:60px;margin:0 auto;border-radius:3px;color:#fff;height:22px;line-height:20px}#pd_refeshBtn:hover{opacity:.6}::ng-deep.bs-datepicker{margin-left:200px}.bs-datepicker-body table td span.selected,.theme-default .bs-datepicker-body table td.selected span,.theme-default .bs-datepicker-body table td[class*=select-] span:after,.theme-default .bs-datepicker-body table td span[class*=select-]:after{background-color:#000}.bs-datepicker-head{background-color:#000!important}']}]}],v.ctorParameters=function(){return[{type:y},{type:l}]},v.propDecorators={data:[{type:t.Input}],userSelectedDate:[{type:t.Output}]};var g=function(){function e(e){this.pdService=e,this.myChartType=r.ChartType.Table,this.isUserWise=!0}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadTable(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.loadTable=function(e){var t=this;if(e&&(this.myXmlData=JSON.parse(e),this.myXmlData)){var a=this.pdService.genarateUserReqiuredData(this.myXmlData);this.currentdataList=a.userConsoleData;var r=this.pdService.allUserChartData();this.alluserList=r.fordurationTable,this.currentResoursedataList=this.pdService.genarateResourseReqiuredData(this.myXmlData)}this.tableViewDiv=document.getElementById("tableViewDiv"),this.tableRow=document.getElementById("tableRow"),this.tblBody=document.getElementById("tblBody"),this.tableViewDiv.style.display="none",this.pdService.chartType.subscribe((function(e){e&&t.updateChartType(e)})),this.pdService.isUserWise_data.subscribe((function(e){t.updateDataType(e)})),this.pdService.isAllUsers.subscribe((function(e){e?t.showAllUser():t.showCurrentDataUser()}))},e.prototype.showCurrentDataUser=function(){this.tableViewData=this.pdService.dataForTableView(this.currentdataList,this.currentResoursedataList),this.tableViewData&&this.ueserWiseTableView(this.tableViewData)},e.prototype.showAllUser=function(){this.tableViewData=this.pdService.dataForTableView(this.alluserList,this.currentResoursedataList),this.tableViewData&&this.ueserWiseTableView(this.tableViewData)},e.prototype.updateDataType=function(e){this.isUserWise=e},e.prototype.updateChartType=function(e){this.myChartType=e,this.myChartType==r.ChartType.Timeline?this.tableViewDiv.style.display="none":this.tableViewDiv.style.display="block"},e.prototype.ueserWiseTableView=function(e){document.getElementById("tblBody").innerHTML="";for(var t=new Array,a=0,r=0;r<e.length;r++)for(var i=0;i<12;i++){var s=document.createElement("label");s.appendChild(document.createTextNode(e[r][i])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}for(i=0;i<=e.length;i++){var n=document.createElement("tr"),o=void 0;for(r=0;r<12;r++)o=document.createElement("td"),a<t.length&&(o.appendChild(t[a]),n.appendChild(o)),a++;this.tblBody.appendChild(n)}},e}();g.decorators=[{type:t.Component,args:[{selector:"lib-tableview",template:'\r\n <div id="tableViewDiv" class="pd-tableViewDiv">\r\n \r\n <table class="table table-bordered" id="tableRow">\r\n <thead>\r\n <tr class="table-headerRow">\r\n <th scope="col">Teacher Name</th>\r\n <th scope="col">Subjects</th>\r\n <th scope="col">Date</th>\r\n <th scope="col">Start Time</th>\r\n <th scope="col">End Time</th>\r\n <th scope="col">Duration (mins)</th>\r\n <th scope="col">Room</th>\r\n <th scope="col">Subject</th>\r\n <th scope="col">Topic of Class</th>\r\n <th scope="col">Chapter Name</th>\r\n <th scope="col">Topic Name</th>\r\n <th scope="col">Assets Details</th>\r\n </tr>\r\n </thead>\r\n <tbody id="tblBody">\r\n \r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n',styles:[".pd-tableViewDiv{width:100%;height:484px;overflow:scroll}.pd-tableViewDiv #tableRow{font-size:small;width:100%;margin-left:24px;margin-top:10px}.pd-tableViewDiv .table-headerRow{font-weight:700}"]}]}],g.ctorParameters=function(){return[{type:l}]},g.propDecorators={data:[{type:t.Input}]};var f=function(){};f.decorators=[{type:t.NgModule,args:[{declarations:[h,u,m,v,g,d],imports:[n.CommonModule,r.GoogleChartsModule,o.DatepickerModule],exports:[d]}]}],e.PrincipalDashboardLibV2Component=d,e.PrincipalDashboardLibV2Module=f,e.PrincipalDashboardLibV2Service=l,e.ɵa=h,e.ɵb=u,e.ɵc=m,e.ɵd=v,e.ɵe=y,e.ɵf=g,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("angular-google-charts"),require("file-saver"),require("xlsx"),require("@angular/common"),require("ng2-datepicker")):"function"==typeof define&&define.amd?define("principal-dashboard-lib-v2",["exports","@angular/core","rxjs","angular-google-charts","file-saver","xlsx","@angular/common","ng2-datepicker"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["principal-dashboard-lib-v2"]={},e.ng.core,e.rxjs,e.angularGoogleCharts,e.FileSaver,e.XLSX,e.ng.common,e.ng2Datepicker)}(this,(function(e,t,a,r,i,s,n,o){"use strict";var l=function(){function e(){this.isResoureMetaDataReady=new a.ReplaySubject,this.isResoureMetaDataReady$=this.isResoureMetaDataReady.asObservable(),this.isUserReqiuredDataReady=new a.ReplaySubject,this.isUserReqiuredDataReady$=this.isUserReqiuredDataReady.asObservable(),this.mychartType="",this.dataType="",this.userAllData="",this.userMetadata={userDetails:[],resourceDetails:[]},this.resoureMetadata=new Array,this.userDetailObject={},this.userlist=!1,this.chartType=new a.BehaviorSubject(this.mychartType),this.chartType$=this.chartType.asObservable(),this.isUserWise_data=new a.BehaviorSubject(!0),this.isUserWise_data$=this.isUserWise_data.asObservable(),this.isAllUsers=new a.BehaviorSubject(this.userlist),this.isAllUsers$=this.isAllUsers.asObservable(),this.detailedviewData=new a.BehaviorSubject(this.userMetadata),this.detailedviewData$=this.detailedviewData.asObservable()}return e.prototype.genarateResourseReqiuredData=function(e){this.isResoureMetaDataReady.next(!1);var t=new Array;if(e&&null!==e){var a=e.resourcesMetadata.resourceMetadata;if(null!=a&&a.length>0)for(var r=0;r<a.length;r++){var i={resouseID:a[r].resourceId,subject:null!=a[r].subject&&null!=a[r].subject.title?a[r].subject.title:"",grade:null!=a[r].grade&&null!=a[r].grade.title?a[r].grade.title:"",chapter:null!=a[r].chapter&&null!=a[r].chapter.title?a[r].chapter.title:"",teachingpoint:null!=a[r].teachingpoint&&null!=a[r].teachingpoint.title?a[r].teachingpoint.title:"",type:null!=a[r].type?this.getDisplaytypeValue(a[r].type):"",title:null!=a[r].title?a[r].title:""};t.push(i),this.resoureMetaData=t,this.isResoureMetaDataReady.next(!0)}}return t},e.prototype.genarateUserReqiuredData=function(e){this.isUserReqiuredDataReady.next(!1);var t=new Array,a=new Array,r=new Array,i=new Array;if(e&&null!==e){var s=e.usersConsole.userConsole,n=e.usersMetadata.userMetadata,o=e.schoolTerminals.schoolTerminal;if(null!=n&&n.length>0)for(var l=0;l<n.length;l++){var d=void 0,h=void 0,c=void 0,p={};""!=n[l].userId&&(p={userId:d=n[l].userId,userName:h=void 0!==n[l].fullName?n[l].fullName:"",userSubjects:c=void 0!==n[l].userSubjects?n[l].userSubjects:""},t.push(p))}for(var u=0;u<t.length;u++)t.forEach((function(e){t[u].userName===e.userName&&(a.push(t[u]),t.splice(u,1))}));for(u=0;u<a.length;u++)a[u].userName=a[u].userName+" "+u,t.push(a[u]),this.usersMetaData=t;if(null!=o&&o.length>0)for(u=0;u<o.length;u++){var m,y=void 0,v=void 0,g=void 0,f=void 0;if(y=void 0!==o[u].schoolId?o[u].schoolId:"",v=void 0!==o[u].terminalKey?o[u].terminalKey:"",g=void 0!==o[u].terminalType?o[u].terminalType:"",void 0!==o[u].metadata)f=JSON.parse(o[u].metadata).location,console.log("metadataJSON",f);else f="";m={schoolId:y,terminalKey:v,terminalType:g,location:f},r.push(m),this.schoolTerminalData=r}if(null!=s&&s.length>0)for(var b=0;b<s.length;b++){d=void 0;var D=void 0,w=void 0,C=void 0,x=void 0,T=void 0,A=new Array,U=(h=void 0,c=void 0,void 0);d=void 0!==s[b].userId?s[b].userId:"",D=void 0!==s[b].startTime?s[b].startTime:"",void 0!==s[b].endTime?(w=s[b].endTime,this.myEndTime=w):w="",void 0!==s[b].selectedDate?s[b].selectedDate:"",C=void 0!==s[b].duration?s[b].duration:"",x=void 0!==s[b].terminalIP?s[b].terminalIP:"",null!=(T=void 0!==s[b].userConsoleResources?s[b].userConsoleResources:null)&&(A=void 0!==T.userConsoleResource?T.userConsoleResource:[]);for(var S=0;S<t.length;S++)d===t[S].userId&&(h=t[S].userName,c=t[S].userSubjects);for(var M=0;M<r.length;M++){if(console.log("schoolTerminalMatrix[i]",r[M]),console.log("schoolTerminalMatrix[i].terminalKey",x,r[M].terminalKey),x===r[M].terminalKey){U=r[M].location;break}U="location"}var R={userId:d,userName:h,startTime:new Date(D),endTime:new Date(w),terminalIP:x,resourceMetauserConsoleData:A,duration:C,terminalLocation:U,userSubjects:c};i.push(R),this.userConsoleData=i,this.isUserReqiuredDataReady.next(!0)}}return{usersMetadata:t,schoolTerminalData:r,userConsoleData:i}},e.prototype.userWiseChartData=function(){var e=new Array;if(e=[],this.userConsoleData&&this.userConsoleData.length>0)for(var t=0;t<this.userConsoleData.length;t++){var a=[this.userConsoleData[t].userName,this.userConsoleData[t].startTime,this.userConsoleData[t].endTime];e.push(a)}return e},e.prototype.classRoomWiseChartData=function(){var e=new Array;if(e=[],this.userConsoleData){console.log("this.userConsoleData",this.userConsoleData);for(var t=0;t<this.userConsoleData.length;t++){var a=[this.userConsoleData[t].terminalIP,this.userConsoleData[t].startTime,this.userConsoleData[t].endTime];e.push(a)}}return e},e.prototype.allUserChartData=function(){var e=new Array;e=[];var t=new Array;if(t=[],this.userConsoleData&&this.usersMetaData){for(var a=void 0,r=void 0,i=void 0,s=new Array,n=0;n<this.userConsoleData.length;n++)s.push(this.userConsoleData[n]),t.push(this.userConsoleData[n]);for(var o=0;o<this.usersMetaData.length;o++){i=this.usersMetaData[o].userId,a=this.usersMetaData[o].userName,r=this.usersMetaData[o].userSubjects;var l={userId:i,userName:a,startTime:new Date(this.myEndTime),endTime:new Date(this.myEndTime),terminalIP:"",resourceMetauserConsoleData:[],duration:"0",terminalLocation:"",userSubjects:r};s.push(l);var d={userId:i,userName:a,startTime:"",endTime:"",terminalIP:"",resourceMetauserConsoleData:[],duration:0,terminalLocation:"",userSubjects:r};t.push(d)}for(o=0;o<s.length;o++){var h=[s[o].userName,s[o].startTime,s[o].endTime];e.push(h)}}return{forChartData:e,fordurationTable:t}},e.prototype.allRoomsData=function(){var e=new Array;e=[];var t=new Array;if(t=[],this.userConsoleData&&this.schoolTerminalData){for(var a={},r=void 0,i=0;i<this.userConsoleData.length;i++){t.push(this.userConsoleData[i]);var s=[this.userConsoleData[i].terminalLocation,this.userConsoleData[i].startTime,this.userConsoleData[i].endTime];e.push(s)}for(i=0;i<this.schoolTerminalData.length;i++){r=this.schoolTerminalData[i].location,a={userId:"",userName:"",startTime:new Date(this.myEndTime),endTime:new Date(this.myEndTime),terminalIP:"",resourceMetauserConsoleData:[],duration:0,terminalLocation:r,userSubjects:""},t.push(a);var n=[r,new Date(this.myEndTime),new Date(this.myEndTime)];e.push(n)}}return{forChartData:e,fordurationTable:t}},e.prototype.dataForTableView=function(e,t){var a,r=new Array;new Array;r=[];for(var i=0;i<e.length;i++){var s,n=void 0,o=void 0,l=void 0,d=void 0,h=void 0,c=(new Array,new Array);new Array;c=[],[],h=e[i].userSubjects,d=e[i].userName,null!=e[i].startTime&&""!=e[i].startTime&&null!=e[i].endTime&&""!=e[i].endTime&&(n=e[i].startTime.toLocaleTimeString("en-US",{hour12:!0}),o=e[i].endTime.toLocaleTimeString("en-US",{hour12:!0}),a=e[i].startTime.getDate()+"/"+(e[i].startTime.getMonth()+1)+"/"+e[i].startTime.getFullYear()),l=Math.floor(e[i].duration);var p=e[i].terminalLocation+" "+e[i].terminalIP;if(0==(s=e[i].resourceMetauserConsoleData).length)void 0,void 0,c=[d,h,a,n,o,l,p,void 0,void 0,void 0,void 0,void 0],r.push(c);else for(var u=0;u<s.length;u++)for(var m=0;m<t.length;m++)s[u]===t[m].resouseID&&(c=[d,h,a,n,o,l,p,t[m].subject,t[m].grade,t[m].chapter,t[m].teachingpoint,this.getDisplaytypeValue(t[m].type)+": "+t[m].title],r.push(c),d=void 0,h=void 0,a=void 0,n=void 0,o=void 0,l=void 0,p=void 0)}return r},e.prototype.dataForDetailedView=function(e,t,a){var r=new Array;var i,s,n,o,l,d=new Array;d=[];var h=new Array;if(h=[],o=e[a].userSubjects,n=e[a].userName,null!=e[a].startTime&&""!=e[a].startTime&&null!=e[a].endTime&&""!=e[a].endTime&&(i=e[a].startTime.toLocaleTimeString("en-US",{hour12:!0}),s=e[a].endTime.toLocaleTimeString("en-US",{hour12:!0}),e[a].startTime.getDate()+"/"+e[a].startTime.getMonth()+"/"+e[a].startTime.getFullYear()),Math.floor(e[a].duration),r=[n,i,o,s,e[a].terminalLocation+" "+e[a].terminalIP],0==(l=e[a].resourceMetauserConsoleData).length)void 0,void 0,void 0,void 0,void 0;else for(var c=0;c<l.length;c++)for(var p=0;p<t.length;p++)l[c]===t[p].resouseID&&(h=[t[p].subject,t[p].grade,t[p].chapter,t[p].teachingpoint,t[p].type+": "+t[p].title],d.push(h));return{userDetails:r,resourceDetails:d}},e.prototype.getDisplaytypeValue=function(e){var t=e;return[{type:"asset_media",display:"Media"},{type:"asset_print",display:"Print"},{type:"quiz",display:"Quiz"},{type:"question",display:"Question"},{type:"chapter",display:"Chapter"},{type:"tp",display:"Topic"},{type:"whiteboard",display:"Whiteboard"},{type:"widget",display:"Widget"},{type:"casset_media",display:"cMedia"},{type:"casset_print",display:"cPrint"},{type:"cquiz",display:"cQuiz"},{type:"cquestion",display:"cQuestion"},{type:"image",display:"Image"},{type:"video",display:"Video"}].forEach((function(a){a.type===e&&(t=a.display)})),t},e}();l.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new l},token:l,providedIn:"root"}),l.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],l.ctorParameters=function(){return[]};var d=function(){function e(){this.userSelectedDate=new t.EventEmitter,this.messageForUser="Loding..."}return Object.defineProperty(e.prototype,"responseStatus",{set:function(e){this.setMessageForUser(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.setMessageForUser=function(e){this.messageForUser=e},e.prototype.onUserSelectDate=function(e){this.data=null,this.userSelectedDate.emit(e)},e}();d.decorators=[{type:t.Component,args:[{selector:"lib-principal-dashboard-lib-v2",template:'<div id="reprtModule">\r\n <div id="pd-mainDiv" class="pd-mainContainer">\r\n <lib-header [data]="data" (userSelectedDate)="onUserSelectDate($event)">\r\n </lib-header>\r\n <lib-chartheader></lib-chartheader>\r\n \r\n <div id="pd-preloader" class="pd-preloaderDiv" *ngIf="responseStatus !== \'true\' && !data">\r\n {{messageForUser}}\r\n </div>\r\n <lib-chartview *ngIf="data" [data]="data"></lib-chartview>\r\n <lib-tableview *ngIf="data" [data]="data"></lib-tableview>\r\n <lib-detailedview *ngIf="data" [data]="data"></lib-detailedview>\r\n \r\n </div>\r\n</div>\r\n ',styles:[".pd-mainContainer{width:100%;height:100%}.pd-mainContainer .pd-preloaderDiv{text-align:center;line-height:27;position:absolute;width:100%;height:87%;top:33px;z-index:2}.bs-datepicker-head{background-color:#000!important}"]}]}],d.ctorParameters=function(){return[]},d.propDecorators={data:[{type:t.Input}],responseStatus:[{type:t.Input}],userSelectedDate:[{type:t.Output}]};var h=function(){function e(e){this.pdService=e,this.mytype=r.ChartType.Timeline,this.datadisplaytype="UserWise",this.isUserWise=!0,this.isChartView=!0}return e.prototype.ngOnInit=function(){this.libVersion="0.0.13"},e.prototype.changeChatType=function(){this.mytype==r.ChartType.Timeline?(this.isChartView=!1,this.mytype=r.ChartType.Table,this.pdService.chartType.next(this.mytype)):(this.isChartView=!0,this.mytype=r.ChartType.Timeline,this.pdService.chartType.next(this.mytype))},e.prototype.changeDataTypeClassRoom=function(){this.isUserWise=!1,this.pdService.isUserWise_data.next(!1)},e.prototype.changeDataTypeUser=function(){this.isUserWise=!0,this.pdService.isUserWise_data.next(!0)},e}();h.decorators=[{type:t.Component,args:[{selector:"lib-chartheader",template:'\r\n<div id="pd-chartheader">\r\n <div id="pd-chatTypeBtnDiv" class="pd-tabIconBtn" [ngClass]=" isChartView ? \'tableIconImg\' : \'chartIconImg\'" (click)="changeChatType()">\r\n </div>\r\n \r\n <div id="pd-userWisechatTypeBtn" class="userWiseBtn" [ngStyle]="{ color: isUserWise ? \'#ffffff\' : \'#000000\' , backgroundColor: isUserWise ? \'#000000\' : \'#c4c4c4\'}"\r\n (click)="changeDataTypeUser()">User wise</div>\r\n <div id="pd-classRoomWiseBtn" class="classWiseBtn" [ngStyle]="{ color: isUserWise ? \'#000000\' : \'#ffffff\' , backgroundColor: isUserWise ? \'#c4c4c4\' : \'#000000\'}"\r\n (click)="changeDataTypeClassRoom()">Classroom wise</div>\r\n\r\n \r\n <div class="libVersionDiv">v{{libVersion}}</div>\r\n</div>',styles:['#pd-chartheader{font-size:12pt;font-weight:400;color:#5c5c5c;z-index:1;width:100%;height:40px;position:relative;margin:10 auto;text-align:center;background-color:#e0e0e0}#pd-chartheader #pd-classRoomWiseBtn,#pd-chartheader #pd-userWisechatTypeBtn{background:-moz-linear-gradient(center top,#45a1da 5%,#1172ae 100%);display:inline-block;padding:0 20px;cursor:pointer;margin:5px 0 0;width:160px;height:30px;line-height:30px}#pd-chartheader .libVersionDiv{position:absolute;font-size:12px;color:#343a40;margin-top:-21px;font-weight:700;margin-left:71px}.userWiseBtn{border-radius:6px 0 0 6px}.classWiseBtn{border-radius:0 6px 6px 0}.pd-tabIconBtn{cursor:pointer;position:absolute;left:10px;top:-17px;width:62px;height:52px;background-repeat:no-repeat}.tableIconImg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAzCAYAAADPX7uaAAAAGXRFWHRTb2Z0d2F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URgZmbGV8ATiYQnqm57qygmMEtLS+DHIklgqMxtahK/an06QT3YXu524eTVwflDICnj+nUEXHfLuD4xMfEfO5EFSPUycMTxL/tdXFyMyxinu9fQzOTk5A4e95nJQLlShR5Dzrd2GCbM5/t4rJqDivOl8MqlL4udyjEYjxrZR6lcMh4aVJVau1JP8ahutIOhmmybmawXKlYQ/Z/IOM92yloXYImu/zjiBQHFNaEtG2eGTG94H+GxMGzIuqXyIuNm+RtrkiUxAODFPrCZb4ZdsuQF43r9fhtYj4v3tb0Tx1nJ17O267EUkfF+kXFzJv7ymGmz9Lc5Pu9lbsMxb3l2p29ZZV8s++XD3WYLWwDnD3sb+mXfpUOPgHU7CSCz8VZOqVeL1En+L8AAjJTPo0iRABoAAAAASUVORK5CYII=")}']}]}],h.ctorParameters=function(){return[{type:l}]};Object.create;function c(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,i,s=a.call(e),n=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)n.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}return n}function p(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}Object.create;var u=function(){function e(e){this.pdService=e,this.totalUsers=0,this.eligibleUsers=0,this.currentUsers=0,this.myChartType=r.ChartType.Timeline,this.myChartwidth=.88*window.innerWidth,this.myChartHeight=window.innerHeight,this.currentList="Current Users",this.allList="All Users",this.isAllUsers=!1,this.isUserWise=!1,this.myChartDataMatrix=new Array,this.totalChartDataMatrix=new Array}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadChart(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.loadChart=function(e){var t=this;this.totalUsers=0,this.eligibleUsers=0,this.currentUsers=0,this.myChartType=r.ChartType.Timeline,this.myChartwidth=.88*window.innerWidth,this.myChartHeight=window.innerHeight,this.currentList="Current Users",this.allList="All Users",this.isAllUsers=!1,this.isUserWise=!1,this.myChartDataMatrix=[],this.totalChartDataMatrix=[],this.chartview=document.getElementById("pd-chartview"),this.myDataList=document.getElementById("pd-xmlData"),e&&(this.myXmlData=JSON.parse(e)),this.myXmlData&&(this.currentdataList=this.pdService.genarateUserReqiuredData(this.myXmlData),this.alluserList=this.pdService.allUserChartData(),this.resourceDataList=this.pdService.genarateResourseReqiuredData(this.myXmlData),this.totalUsers=this.currentdataList.usersMetadata.length,this.findCurrentUserCount()),this.pdService.chartType.subscribe((function(e){e&&t.updateChartType(e)})),this.pdService.isUserWise_data.subscribe((function(e){t.updateDataType(e)})),window.addEventListener("resize",this.onResizeWindow.bind(this))},e.prototype.onResizeWindow=function(e){this.myChartwidth=.88*window.innerWidth},e.prototype.myChartReady=function(){this.createDivforTotalDurartion(),this.setHeightofDivforTotalDurartion()},e.prototype.updateChartType=function(e){null!=this.chartview&&null!=this.chartview&&(e==r.ChartType.Table?this.chartview.style.display="none":this.chartview.style.display="block")},e.prototype.updateDataType=function(e){this.isUserWise=e,this.myXmlData&&(this.isUserWise?(this.currentList="Current Users",this.allList="All Users",this.isAllUsers?this.userWiseAllData():this.userWiseCurrentData()):(this.allList="All Rooms",this.currentList="Current Rooms",this.isAllUsers?this.classRoomWiseAllData():this.classRoomWiseCurrentData()))},e.prototype.updateChart=function(){for(var e=this,t=document.getElementById("labels");t.firstChild;)t.removeChild(t.lastChild);this.chartDataTable=this.myChartDataMatrix,console.log("this.myChartDataMatrix",this.myChartDataMatrix),this.myChartOptions={tooltip:{trigger:"none"},colors:["#ff7f0e","#2ca02c","#8c564b","#d62728","#bcbd22","#17becf"],timeline:{colorByRowLabel:!0,barLabelStyle:{fontSize:7}},hAxis:{format:"HH:mm a"}},setTimeout((function(){e.myChartHeight=e.AllrowHeight+100}),1e3)},e.prototype.calulateTotalDuration=function(e){var t,a=new Array;if(a=[],this.totalChartDataMatrix=[],this.isUserWise)for(var r=0;r<e.length;r++)t={name:e[r].userName,value:parseInt(e[r].duration)},a.push(t);else for(r=0;r<e.length;r++)t={name:e[r].terminalLocation,value:parseInt(e[r].duration)},a.push(t);var i={};(a=p(new Set(a))).forEach((function(e){i[e.name]?i[e.name].value=i[e.name].value+e.value:i[e.name]=e}));var s=Object.values(i),n=new Array;n=[],s.forEach((function(e){n.push(e.value)}));for(r=0;r<n.length;r++){var o=[this.timeConvert(n[r]).toString()+" hrs"];this.totalChartDataMatrix.push(o)}},e.prototype.timeConvert=function(e){var t=Math.floor(e)/60,a=Math.floor(t),r=60*(t-a);return a+":"+Math.round(r)},e.prototype.removeBlankEntryBar=function(){for(var e=document.getElementById("myTimeLine").getElementsByTagName("rect"),t=1e8,a=[],r=0;r<e.length;r++){var i=parseInt(e[r].getAttribute("width"));i<t?(a=[e[r]],t=i):i==t&&a.push(e[r])}for(r=0;r<a.length;r++)a[r].setAttribute("fill","none")},e.prototype.createDivforTotalDurartion=function(){var e=[];this.rowElements=[];for(var t=document.getElementById("labels");t.firstChild;)t.removeChild(t.lastChild);for(var a=0;a<this.totalChartDataMatrix.length;a++){var r=this.totalChartDataMatrix[a][0];e.push(r);var i=t.appendChild(document.createElement("div"));i.style["border-bottom"]="1px solid #b7b7b7",i.style["font-family"]="Arial",i.style["font-size"]="13px",i.style["text-align"]="left",i.style["padding-left"]="8px",i.style["padding-right"]="8px",i.style.position="inherit",i.style["background-color"]=a%2?"#e6e6e6":"#ffffff",i.innerHTML=r,this.rowElements.push(i)}},e.prototype.setHeightofDivforTotalDurartion=function(){this.AllrowHeight=0;for(var e=document.getElementById("myTimeLine").getElementsByTagName("rect"),t=-1,a=0;a<e.length;a++)if(++t<this.rowElements.length){var r=parseFloat(e[a].getAttribute("height"))+"px";this.AllrowHeight+=parseFloat(e[a].getAttribute("height"));var i=this.rowElements[t];i&&(i.style.height=r,i.style.lineHeight=r)}},e.prototype.onSelectRowData=function(e){var t=e.selection[0],a=t.row;t.column;this.isAllUsers?this.selectedUserData=this.pdService.dataForDetailedView(this.alluserList.fordurationTable,this.resourceDataList,a):this.selectedUserData=this.pdService.dataForDetailedView(this.currentdataList.userConsoleData,this.resourceDataList,a),this.pdService.detailedviewData.next(this.selectedUserData),this.updateChart()},e.prototype.showAllUser=function(){this.pdService.isAllUsers.next(!0),this.isAllUsers=!0,this.isUserWise?this.userWiseAllData():this.classRoomWiseAllData()},e.prototype.showCurrentUser=function(){this.isAllUsers=!1,this.pdService.isAllUsers.next(!1),this.isUserWise?this.userWiseCurrentData():this.classRoomWiseCurrentData()},e.prototype.userWiseCurrentData=function(){var e=this.pdService.userWiseChartData();e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.currentdataList.userConsoleData.length>0&&this.calulateTotalDuration(this.currentdataList.userConsoleData))},e.prototype.userWiseAllData=function(){var e=this.alluserList.forChartData;e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.calulateTotalDuration(this.alluserList.fordurationTable))},e.prototype.classRoomWiseCurrentData=function(){var e=this.pdService.classRoomWiseChartData();e&&e.length>0&&(this.myChartDataMatrix=e,this.updateChart(),this.currentdataList.userConsoleData.length>0&&this.calulateTotalDuration(this.currentdataList.userConsoleData))},e.prototype.classRoomWiseAllData=function(){var e=this.pdService.allRoomsData();e.forChartData&&e.forChartData.length>0&&(this.myChartDataMatrix=e.forChartData,this.updateChart()),e.fordurationTable&&e.fordurationTable.length>0&&this.calulateTotalDuration(e.fordurationTable)},e.prototype.findCurrentUserCount=function(){for(var e=this.currentdataList.userConsoleData,t=new Array,a=0;a<e.length;a++){var r=e[a].userName;t.push(r)}var i=p(new Set(t));this.currentUsers=i.length},e.prototype.ngOnDestroy=function(){},e}();u.decorators=[{type:t.Component,args:[{selector:"lib-chartview",template:'<div id="pd-chartview-main-container" class="pd-chartview-main-container">\r\n <div id="userSummary">\r\n <table class="summaryTable">\r\n <tbody>\r\n <tr>\r\n <td id="totalUsers" class="chartview-navigationbar">\r\n Total users: {{totalUsers}}\r\n </td>\r\n <td id="eligibleUsers" class="chartview-navigationbar">\r\n Eligible users: {{eligibleUsers}}\r\n </td>\r\n <td id="currentUsers" class="chartview-navigationbar">\r\n Current users: {{currentUsers}}\r\n </td>\r\n <td id="totalRooms" class="chartview-navigationbar">\r\n Installed Classrooms: {{installedClassrooms}}\r\n </td>\r\n <td id="currentRooms" class="chartview-navigationbar">\r\n Current Classrooms: {{currentRooms}}\r\n </td>\r\n \x3c!-- <td\r\n id="currentRooms"\r\n \r\n >\r\n <span id="totalUsers_list" class="activeAll">User List</span>\r\n </td> --\x3e\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n <div id="pd-messageDivContainer" class=\'pd-messageDivContainer\'>\r\n <div id="pd-messageDiv" class=\'pd-messageDiv\'>Click the bars to view details of content accessed by a teacher.</div>\r\n <div id="pd-toggleContainer" class="pd-toggleContainer">\r\n \r\n <div id="pd-currentUserBtn" class="pd-currentUserBtn-div pd-commonStyleBtn" (click)="showCurrentUser()" [ngStyle]="{ color: isAllUsers ? \'#000000\' : \'#ffffff\' , backgroundColor: isAllUsers ? \'#c4c4c4\' : \'#000000\'}">\r\n {{currentList}}</div>\r\n <div id="pd-allUserBtn" class="pd-allUserBtn-div pd-commonStyleBtn" (click)="showAllUser()" [ngStyle]="{ color: isAllUsers ? \'#ffffff\' : \'#000000\' , backgroundColor: isAllUsers ? \'#000000\' : \'#c4c4c4\'}">\r\n {{allList}}</div>\r\n </div>\r\n </div>\r\n <div id="pd-chartview" class="pd-chartview">\r\n <div id="myChartDiv">\r\n <div id="myTimeLine">\r\n <google-chart\r\n [type]="myChartType"\r\n [data]="chartDataTable"\r\n [options]="myChartOptions"\r\n [width]="myChartwidth"\r\n [height]="myChartHeight"\r\n (select)="onSelectRowData($event)"\r\n (ready)="myChartReady()"\r\n > \r\n </google-chart>\r\n \r\n </div>\r\n <div class="inline" id="labels"></div> \r\n \r\n \r\n </div>\r\n</div>\r\n',styles:[".pd-chartview-main-container .pd-chartview{display:block;overflow:scroll;width:100%;height:484px;font-family:Tahoma;font-size:12pt;font-weight:400;color:#666;margin:10 auto;text-align:center;padding-top:1px}.pd-chartview-main-container #userSummary{background:#e0e0e0;margin-top:1px}.pd-chartview-main-container #roomSummary,.pd-chartview-main-container #userSummary{position:relative;width:100%;text-align:center;padding-top:6px;padding-bottom:6px;font-size:13px}.pd-chartview-main-container .pd-messageDivContainer{margin-top:1px}.pd-chartview-main-container .pd-messageDivContainer .pd-messageDiv{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:absolute;margin-left:5px;font-size:13px}.pd-chartview-main-container .pd-messageDivContainer .pd-toggleContainer{line-height:30px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;float:right;margin:5px 0}.pd-chartview-main-container .pd-messageDivContainer .pd-allUserBtn-div{border-radius:0 5px 5px 0}.pd-chartview-main-container .pd-messageDivContainer .pd-currentUserBtn-div{border-radius:5px 0 0 5px}.pd-chartview-main-container .pd-messageDivContainer .pd-commonStyleBtn{display:inline-block;cursor:pointer;font-size:12px;width:92px;text-align:center}.pd-chartview-main-container .summaryTable{width:100%;border-collapse:collapse;border-spacing:2px;border-color:grey}.pd-chartview-main-container .activeAll{cursor:pointer;background:none!important;border-radius:13px;border:none;width:64px;height:18px!important;line-height:18px!important;color:#45a1da;margin-right:0!important;padding:1px 5px;vertical-align:sub}.pd-chartview-main-container #myTimeLine{width:89%;height:60%;margin-left:5px;overflow-x:scroll;overflow-y:hidden;float:left}.pd-chartview-main-container #myTimeLine2{width:71px;position:relative;overflow-x:hidden;overflow-y:hidden}.pd-chartview-main-container #myChartDiv{width:100%}.pd-chartview-main-container .chartview-navigationbar{border-collapse:collapse;border-right:1px solid #999;text-align:center}.pd-chartview-main-container #labels{border-right:1px solid #b7b7b7;border-top:1px solid #b7b7b7;width:10%;float:left;font-size:1.2vw;overflow-x:hidden;overflow-y:hidden}.inline{vertical-align:top;position:relative}"]}]}],u.ctorParameters=function(){return[{type:l}]},u.propDecorators={data:[{type:t.Input}]};var m=function(){function e(e){this.pdService=e,this.userMetadataHeadingArray=["Name:","Start Time:","Subject:","End Time:","Room Details:"],this.resourseMetadataHeadingArray=["Subject","Class","Chapter Name","Topic Name","Assets Details"]}return e.prototype.ngOnInit=function(){var e=this;this.deatilViewContainer=document.getElementById("pd-deatilViewContainer"),this.deatilViewTable=document.getElementById("pd-deatilViewTable"),this.closeButton=document.getElementById("pd-closeButton"),this.pdService.detailedviewData.subscribe((function(t){t&&(t.userDetails.length>0&&e.createTable(t.userDetails),t.resourceDetails.length>0&&e.createResourcesTable(t.resourceDetails))})),this.deatilViewContainer.style.display="none"},e.prototype.createTable=function(e){for(this.deatilViewContainer.style.display="block";this.deatilViewTable.firstChild;)this.deatilViewTable.removeChild(this.deatilViewTable.lastChild);for(var t=new Array,a=0,r=0;r<e.length;r++){var i=document.createElement("label");i.appendChild(document.createTextNode(this.userMetadataHeadingArray[r])),"undefined"!==i.textContent&&void 0!==i.textContent||(i.textContent=""),t.push(i);var s=document.createElement("label");s.appendChild(document.createTextNode(e[r])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}var n=document.createElement("table");n.id="userDataTable",n.className="table table-bordered";for(var o=document.createElement("tbody"),l=0;l<e.length/2;l++){var d=document.createElement("tr"),h=void 0;for(r=0;r<4;r++)r%2==0?(h=document.createElement("th")).style["font-weight"]="bold":h=document.createElement("td"),a<t.length&&(h.appendChild(t[a]),d.appendChild(h)),a++;o.appendChild(d),n.appendChild(o),this.deatilViewTable.appendChild(n)}},e.prototype.createResourcesTable=function(e){for(var t=new Array,a=0,r=0;r<this.resourseMetadataHeadingArray.length;r++){(s=document.createElement("label")).appendChild(document.createTextNode(this.resourseMetadataHeadingArray[r])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}for(r=0;r<e.length;r++)for(var i=0;i<5;i++){var s;(s=document.createElement("label")).appendChild(document.createTextNode(e[r][i])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}var n=document.createElement("table");n.className="table table-bordered",n.id="resoureMetadataTable";var o=document.createElement("tbody");for(i=0;i<=e.length;i++){var l=document.createElement("tr"),d=void 0;for(r=0;r<5;r++)0==i?(d=document.createElement("th")).style["font-weight"]="bold":d=document.createElement("td"),a<t.length&&(d.appendChild(t[a]),l.appendChild(d)),a++;o.appendChild(l),n.appendChild(o),this.deatilViewTable.appendChild(n)}},e.prototype.onCloseBtnClick=function(){this.deatilViewContainer.style.display="none"},e}();m.decorators=[{type:t.Component,args:[{selector:"lib-detailedview",template:'<div id="pd-deatilViewContainer">\r\n <div class="pd-detailview-header">\r\n <div class="pd-detailview-title">Details</div>\r\n <div id="pd-closeButton" (click)="onCloseBtnClick()">+</div>\r\n </div>\r\n <div id="pd-deatilViewTable"></div>\r\n</div>\r\n',styles:["#pd-deatilViewContainer{position:absolute;background:#fff;box-shadow:0 0 17px #818181;font-size:12px;width:50%;max-height:350px;top:140px;left:230px}#pd-deatilViewContainer .pd-detailview-header{position:relative;width:100%;height:35px;background-color:#e6e6e6}#pd-deatilViewContainer .pd-detailview-title{position:absolute;margin-left:5px;font-size:20px;line-height:35px}#pd-deatilViewContainer #pd-closeButton{width:24px;position:absolute;float:right;right:0;cursor:pointer;height:24px;background:#000;border-radius:12px;color:#fff;line-height:22px;text-align:center;font-size:26px;transform:rotate(45deg);margin:5px}#pd-deatilViewContainer #pd-deatilViewTable{overflow:scroll;scroll-behavior:smooth;height:auto;margin:5px;max-height:300px}"]}]}],m.ctorParameters=function(){return[{type:l}]};var y=function(){function e(){this.resourceTypes=new Array,this.tabName=[{name:"School"},{name:"User Summary"},{name:"Terminal Summary"},{name:"Usage Details"}]}return e.prototype.exportAsExcelFile=function(e,t){for(var a,r={Sheets:{},SheetNames:[]},i=0;i<e.length;i++){var n=s.utils.json_to_sheet(e[i]);r.Sheets[this.tabName[i].name]=n,r.SheetNames.push(this.tabName[i].name)}var o=r;a=s.write(o,{bookType:"xlsx",type:"array"}),this.saveAsExcelFile(a,t)},e.prototype.saveAsExcelFile=function(e,t){var a=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"});i.saveAs(a,t+".xlsx")},e.prototype.genarateResourseReqiuredData_Excel=function(e){var t,a=new Array,r=e.resourcesMetadata.resourceMetadata;if(null!=r&&r.length>0)for(var i=0;i<r.length;i++){var s={resouseID:r[i].resourceId,subject:null!=r[i].subject&&null!=r[i].subject.title?r[i].subject.title:"",grade:null!=r[i].grade&&null!=r[i].grade.title?r[i].grade.title:"",chapter:null!=r[i].chapter&&null!=r[i].chapter.title?r[i].chapter.title:"",teachingpoint:null!=r[i].teachingpoint&&null!=r[i].teachingpoint.title?r[i].teachingpoint.title:"",type:t=null!=r[i].type?this.getDisplaytypeValue(r[i].type):"",title:null!=r[i].title?r[i].title:""};a.push(s),this.resourceTypes.push(t)}return this.resourceTypes=p(new Set(this.resourceTypes)),a},e.prototype.genarateUserReqiuredData_Excel=function(e){var t=e.usersConsole.userConsole,a=e.usersMetadata.userMetadata,r=e.schoolTerminals.schoolTerminal,i=new Array,s=new Array,n=new Array,o=new Array;if(null!=a&&a.length>0)for(var l=0;l<a.length;l++){var d=void 0,h=void 0,c=void 0,p={};""!=a[l].userId&&(p={userId:d=a[l].userId,userName:h=void 0!==a[l].fullName?a[l].fullName:"",userSubjects:c=void 0!==a[l].userSubjects?a[l].userSubjects:""},i.push(p))}for(var u=0;u<i.length;u++)i.forEach((function(e){i[u].userName===e.userName&&(s.push(i[u]),i.splice(u,1))}));for(u=0;u<s.length;u++)s[u].userName=s[u].userName+" "+u,i.push(s[u]);if(null!=r&&r.length>0)for(u=0;u<r.length;u++){var m;m={schoolId:void 0!==r[u].schoolId?r[u].schoolId:"",terminalKey:void 0!==r[u].terminalKey?r[u].terminalKey:"",terminalType:void 0!==r[u].terminalType?r[u].terminalType:"",location:void 0!==r[u].metadata?r[u].metadata:""},n.push(m)}if(null!=t&&t.length>0)for(var y=0;y<t.length;y++){d=void 0;var v=void 0,g=void 0,f=void 0,b=void 0,D=void 0,w=new Array,C=(h=void 0,c=void 0,void 0);d=void 0!==t[y].userId?t[y].userId:"",v=void 0!==t[y].startTime?t[y].startTime:"",void 0!==t[y].endTime?(g=t[y].endTime,this.myEndTime=g):g="",void 0!==t[y].selectedDate?t[y].selectedDate:"",f=void 0!==t[y].duration?t[y].duration:"",b=void 0!==t[y].terminalIP?t[y].terminalIP:"",null!=(D=void 0!==t[y].userConsoleResources?t[y].userConsoleResources:null)&&(w=void 0!==D.userConsoleResource?D.userConsoleResource:[]);for(var x=0;x<i.length;x++)d===i[x].userId&&(h=i[x].userName,c=i[x].userSubjects);for(var T=0;T<n.length;T++)b===n[T].terminalKey&&(C=n[T].location);var A={userId:d,userName:h,startTime:new Date(v),endTime:new Date(g),terminalIP:b,resourceMetauserConsoleData:w,duration:f,terminalLocation:C,userSubjects:c};o.push(A)}return{usersMetadata:i,schoolTerminalData:n,userConsoleData:o}},e.prototype.deatilData_Excel=function(e,t){var a,r=new Array;r=[];for(var i=0;i<e.length;i++){var s,n,o,l,d=void 0,h=void 0,c=void 0,p=void 0,u=void 0,m=new Array;s=e[i].userId,u=e[i].userSubjects,p=e[i].userName,null!=e[i].startTime&&""!=e[i].startTime&&null!=e[i].endTime&&""!=e[i].endTime&&(d=e[i].startTime.toLocaleTimeString("en-US",{hour12:!0}),h=e[i].endTime.toLocaleTimeString("en-US",{hour12:!0}),a=e[i].startTime.getDate()+"/"+(e[i].startTime.getMonth()+1)+"/"+e[i].startTime.getFullYear()),c=Math.floor(e[i].duration);o=e[i].terminalLocation,n=e[i].terminalIP;var y=o,v=n;if(0==(l=e[i].resourceMetauserConsoleData).length)m=[p,u,a,d,h,c,y,v,"","","","","","",s],r.push(m);else for(var g=0;g<l.length;g++)for(var f=0;f<t.length;f++)l[g]===t[f].resouseID&&(m=[p,u,a,d,h,c,y,v,t[f].subject,t[f].grade,t[f].chapter,t[f].teachingpoint,t[f].title,this.getDisplaytypeValue(t[f].type),s],r.push(m),p="",u="",a="",d="",h="",y="",v="",c="")}return r},e.prototype.deatilUsage_Excel=function(e){var t=[];if(e.length>0)for(var a=0;a<e.length;a++){var r={Name:e[a][0],Subjects:e[a][1],Date:e[a][2],startTime:e[a][3],endTime:e[a][4],"duration(mins)":e[a][5],location:e[a][6],IP:e[a][7],subjectTitle:e[a][8],gradeTitle:e[a][9],Chapter:e[a][10],tpTitle:e[a][11],resourceTitle:e[a][12],resourceType:e[a][13]};t.push(r)}return t},e.prototype.userSummary_Excel=function(e,t){for(var a=e.usersMetadata.userMetadata,r=new Array,i=new Array,s=new Array,n=new Array,o=new Array,l=new Array,d=new Array,h=0,c=0;c<a.length;c++){r=[],i=[],n=[],o=[],l=[],d=[],h=0;for(var u=0;u<t.length;u++)a[c].userId===t[u][14]&&(""!=t[u][12]&&r.push(t[u][12]),""!=t[u][13]&&i.push(t[u][13]),""!=t[u][5]&&(h+=t[u][5]),n.push(t[u][6]),o.push(t[u][2]),l.push(t[u][9]),d.push(t[u][8]));var m=void 0,y=void 0,v=void 0,g=void 0,f=void 0;m=n.length>0?p(new Set(n))[0]:"",f=o.length>0?p(new Set(o)).length:"",y=o.length>0?p(new Set(o))[0]:"",v=l.length>0?p(new Set(l))[0]:"",g=d.length>0?p(new Set(d))[0]:"";var b={Name:a[c].fullName,Subjects:a[c].userSubjects,duration:h,ClassRooms:m,DatesAccess:y,DayAccess:f,Grades:v,SubjectTought:g,AseestUsed:r,AssetType:i};s.push(b)}var D=new Array,w=function(e){var t=[],a=s[e].AssetType;a=p(new Set(a)),s[e].AssetType.forEach((function(e){t[e]=(t[e]||0)+1})),C.resourceTypes.filter((function(e){return!a.includes(e)})).forEach((function(e){t[e]=0}));var r={Name:s[e].Name,Subjects_taught:s[e].Subjects," Duration(mins)":s[e].duration,ClassRooms:s[e].ClassRooms,DaysAccsessed:s[e].DayAccess,DatesAccess:s[e].DatesAccess,Grades:s[e].Grades,Subjects:s[e].SubjectTought},i=Object.assign(r,t);D.push(i)},C=this;for(c=0;c<s.length;c++)w(c);return D},e.prototype.getDisplaytypeValue=function(e){var t=e;return[{type:"asset_media",display:"Media"},{type:"asset_print",display:"Print"},{type:"quiz",display:"Quiz"},{type:"question",display:"Question"},{type:"chapter",display:"Chapter"},{type:"tp",display:"Topic"},{type:"whiteboard",display:"Whiteboard"},{type:"widget",display:"Widget"},{type:"casset_media",display:"cMedia"},{type:"casset_print",display:"cPrint"},{type:"cquiz",display:"cQuiz"},{type:"cquestion",display:"cQuestion"},{type:"image",display:"Image"},{type:"video",display:"Video"}].forEach((function(a){a.type===e&&(t=a.display)})),t},e}();y.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new y},token:y,providedIn:"root"}),y.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],y.ctorParameters=function(){return[]};var v=function(){function e(e,a){this.excelService=e,this.pdService=a,this.userSelectedDate=new t.EventEmitter,this.refreshTimer=0,this.title="datepicker",this.date=new Date,this.options={inputClass:"input",calendarClass:"datepicker-default",scrollBarColor:"#010001",format:"dd/LL/yyyy",maxDate:new Date}}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadData(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.getDefaultDate(),this.startTimer()},e.prototype.getDefaultDate=function(){var e=new Date;this.getDateFormat(e),this.todayDate=this.calenderCurrentDate},e.prototype.dateSelected=function(e){this.getDateFormat(e),this.mydata=null,this.refreshChart()},e.prototype.getDateFormat=function(e){var t,a=e.getDate(),r=e.getMonth()+1;t=r<10?"0"+r:r;var i=e.getFullYear()+"-"+t+"-"+(a<10?"0"+a:a);this.currentDate=i,this.calenderCurrentDate=i.split("-").reverse().join("-")},e.prototype.refreshChart=function(){this.stopTimer(),this.refreshTimer=0,this.calenderCurrentDate===this.todayDate&&this.countDown(),this.userSelectedDate.emit(this.calenderCurrentDate)},e.prototype.startTimer=function(){this.countDown()},e.prototype.stopTimer=function(){this.clearTimer(),this.message=""},e.prototype.clearTimer=function(){this.refreshTimer=0,window.clearInterval(this.intervalId)},e.prototype.countDown=function(){var e=this;console.log("countDown"),this.clearTimer(),this.intervalId=window.setInterval((function(){e.refreshTimer-=1,0===e.refreshTimer?(e.refreshChart(),e.message=""):(e.refreshTimer<0&&(e.refreshTimer=300),e.message=""+e.refreshTimer)}),1e3)},e.prototype.timeConvert=function(e){var t=e/60,a=Math.floor(t),r=60*(t-a);return a+":"+Math.round(r)},e.prototype.loadData=function(e){if(e&&(this.mydata=JSON.parse(e),this.mydata)){var t=this.excelService.genarateUserReqiuredData_Excel(this.mydata).userConsoleData,a=this.excelService.genarateResourseReqiuredData_Excel(this.mydata),r=this.excelService.deatilData_Excel(t,a),i=this.excelService.deatilUsage_Excel(r),s=this.excelService.userSummary_Excel(this.mydata,r),n=this.mydata.schoolMetadata.school,o=i,l=this.mydata.schoolTerminals.schoolTerminal;this.dataList=[[n],s,l,o]}},e.prototype.exportReport=function(){this.mydata&&this.excelService.exportAsExcelFile(this.dataList,"UsageReport-"+this.calenderCurrentDate)},e.prototype.ngOnDestroy=function(){this.clearTimer()},e}();v.decorators=[{type:t.Component,args:[{selector:"lib-header",template:'<div id="pd_header" class="pd_header">\r\n \r\n <div *ngIf="message && mydata && (this.todayDate === this.calenderCurrentDate)" id="pd_refeshView" class="pd_refesh_bar">\r\n <div class="timer_msg"> This page will be refreshed in</div>\r\n <div class="timer_value"> {{timeConvert(message)}} min</div>\r\n <div id="pd_refeshBtn" (click)="refreshChart()"> Refresh </div>\r\n </div>\r\n\r\n <div id="pd_exportBtn" class="pd_exportButton" *ngIf="mydata"\r\n [ngClass]="{\'pd_exportButton_shiftRight\': this.todayDate != this.calenderCurrentDate}" (click)="exportReport()"> \r\n <span class="pd_exportButton_text">Export usage report</span>\r\n <div class="pd_download_icon"></div>\r\n </div>\r\n \r\n <div class="pd_header_calendar">\r\n \x3c!-- <input type="Date" [max]="currentDate" [value]="currentDate" id="myCalendar" (input)="selectDate($event)" /> --\x3e\r\n <ngx-datepicker [(ngModel)]="date" [options]="options" (ngModelChange)="dateSelected($event)"></ngx-datepicker>\r\n </div>\r\n <div class="pd_header_content" >Realtime usage data</div>\r\n</div>\r\n',styles:['.pd_header{width:100%;background-color:#e0e0e0;height:50px;border-bottom:2px solid #fff}.pd_header_calendar{position:absolute;width:150px;margin:5px 5px 5px 17px}.pd_header_content{position:relative;width:350px;margin:0 auto;color:#000;text-align:center;font-size:30px;line-height:50px;pointer-events:none}.pd_exportButton{position:absolute;display:inline-block;right:144px;padding:0 16px;cursor:pointer;margin:9px 0 0;height:30px;width:160px;line-height:30px;background-color:#c4c4c4;font-size:10pt;font-weight:400;transition:right .5s}.pd_exportButton_shiftRight{right:10px}.pd_download_icon{position:absolute;width:16px;height:16px;background-size:100% 100%;top:8px;background-repeat:no-repeat;display:inline-block;right:5px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAAY0lEQVRIiWNgGOqAkQS1/8nRy0SCBWSBUQtGLRjiFpQzQDIXDKMDZLl6ch2Abgk2TLbhxFhCseH4LKGa4dgsIdpwZhIsOMoAKUEPMjAwNJLktFGADyDXStgyE8Vm07yoGPoAAH1UItbw1O5lAAAAAElFTkSuQmCC")}.pd_exportButton_text{position:relative;display:inline-block;width:130px}.pd_refesh_bar{position:absolute;color:#000;width:120px;height:78px;right:15px;top:4px;z-index:2;background-color:#fff;float:right;text-align:center;font-size:12px;border-radius:.25rem;border:1px solid #a09898;box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.75);-webkit-animation:refreshViewAnimate .6s;animation:refreshViewAnimate .6s}@-webkit-keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}@keyframes refreshViewAnimate{0%{opacity:.5;top:-32px}to{opacity:1;top:4px}}.timer_msg{position:absolute;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:14px;top:2px}.timer_value{font-weight:700;font-size:15px}#pd_refeshBtn,.timer_value{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;top:28px}#pd_refeshBtn{background-color:#2172f6;cursor:pointer;width:60px;margin:0 auto;border-radius:3px;color:#fff;height:22px;line-height:20px}#pd_refeshBtn:hover{opacity:.6}::ng-deep.bs-datepicker{margin-left:200px}.bs-datepicker-body table td span.selected,.theme-default .bs-datepicker-body table td.selected span,.theme-default .bs-datepicker-body table td[class*=select-] span:after,.theme-default .bs-datepicker-body table td span[class*=select-]:after{background-color:#000}.bs-datepicker-head{background-color:#000!important}']}]}],v.ctorParameters=function(){return[{type:y},{type:l}]},v.propDecorators={data:[{type:t.Input}],userSelectedDate:[{type:t.Output}]};var g=function(){function e(e){this.pdService=e,this.myChartType=r.ChartType.Table,this.isUserWise=!0}return Object.defineProperty(e.prototype,"data",{set:function(e){null!==e&&this.loadTable(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){},e.prototype.loadTable=function(e){var t=this;if(e&&(this.myXmlData=JSON.parse(e),this.myXmlData)){var a=this.pdService.genarateUserReqiuredData(this.myXmlData);this.currentdataList=a.userConsoleData;var r=this.pdService.allUserChartData();this.alluserList=r.fordurationTable,this.currentResoursedataList=this.pdService.genarateResourseReqiuredData(this.myXmlData)}this.tableViewDiv=document.getElementById("tableViewDiv"),this.tableRow=document.getElementById("tableRow"),this.tblBody=document.getElementById("tblBody"),this.tableViewDiv.style.display="none",this.pdService.chartType.subscribe((function(e){e&&t.updateChartType(e)})),this.pdService.isUserWise_data.subscribe((function(e){t.updateDataType(e)})),this.pdService.isAllUsers.subscribe((function(e){e?t.showAllUser():t.showCurrentDataUser()}))},e.prototype.showCurrentDataUser=function(){this.tableViewData=this.pdService.dataForTableView(this.currentdataList,this.currentResoursedataList),this.tableViewData&&this.ueserWiseTableView(this.tableViewData)},e.prototype.showAllUser=function(){this.tableViewData=this.pdService.dataForTableView(this.alluserList,this.currentResoursedataList),this.tableViewData&&this.ueserWiseTableView(this.tableViewData)},e.prototype.updateDataType=function(e){this.isUserWise=e},e.prototype.updateChartType=function(e){this.myChartType=e,this.myChartType==r.ChartType.Timeline?this.tableViewDiv.style.display="none":this.tableViewDiv.style.display="block"},e.prototype.ueserWiseTableView=function(e){document.getElementById("tblBody").innerHTML="";for(var t=new Array,a=0,r=0;r<e.length;r++)for(var i=0;i<12;i++){var s=document.createElement("label");s.appendChild(document.createTextNode(e[r][i])),"undefined"!==s.textContent&&void 0!==s.textContent||(s.textContent=""),t.push(s)}for(i=0;i<=e.length;i++){var n=document.createElement("tr"),o=void 0;for(r=0;r<12;r++)o=document.createElement("td"),a<t.length&&(o.appendChild(t[a]),n.appendChild(o)),a++;this.tblBody.appendChild(n)}},e}();g.decorators=[{type:t.Component,args:[{selector:"lib-tableview",template:'\r\n <div id="tableViewDiv" class="pd-tableViewDiv">\r\n \r\n <table class="table table-bordered" id="tableRow">\r\n <thead>\r\n <tr class="table-headerRow">\r\n <th scope="col">Teacher Name</th>\r\n <th scope="col">Subjects</th>\r\n <th scope="col">Date</th>\r\n <th scope="col">Start Time</th>\r\n <th scope="col">End Time</th>\r\n <th scope="col">Duration (mins)</th>\r\n <th scope="col">Room</th>\r\n <th scope="col">Subject</th>\r\n <th scope="col">Topic of Class</th>\r\n <th scope="col">Chapter Name</th>\r\n <th scope="col">Topic Name</th>\r\n <th scope="col">Assets Details</th>\r\n </tr>\r\n </thead>\r\n <tbody id="tblBody">\r\n \r\n </tbody>\r\n </table>\r\n </div>\r\n \r\n',styles:[".pd-tableViewDiv{width:100%;height:484px;overflow:scroll}.pd-tableViewDiv #tableRow{font-size:small;width:100%;margin-left:24px;margin-top:10px}.pd-tableViewDiv .table-headerRow{font-weight:700}"]}]}],g.ctorParameters=function(){return[{type:l}]},g.propDecorators={data:[{type:t.Input}]};var f=function(){};f.decorators=[{type:t.NgModule,args:[{declarations:[h,u,m,v,g,d],imports:[n.CommonModule,r.GoogleChartsModule,o.DatepickerModule],exports:[d]}]}],e.PrincipalDashboardLibV2Component=d,e.PrincipalDashboardLibV2Module=f,e.PrincipalDashboardLibV2Service=l,e.ɵa=h,e.ɵb=u,e.ɵc=m,e.ɵd=v,e.ɵe=y,e.ɵf=g,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=principal-dashboard-lib-v2.umd.min.js.map
|