principal-dashboard-lib-v2 0.0.35 → 0.0.36

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.
Files changed (81) hide show
  1. package/bundles/principal-dashboard-lib-v2.umd.js +3406 -0
  2. package/bundles/principal-dashboard-lib-v2.umd.js.map +1 -0
  3. package/bundles/principal-dashboard-lib-v2.umd.min.js +2 -0
  4. package/bundles/principal-dashboard-lib-v2.umd.min.js.map +1 -0
  5. package/esm2015/lib/chartheader/chartheader.component.js +49 -0
  6. package/esm2015/lib/chartview/chartview.component.js +403 -0
  7. package/esm2015/lib/detailedview/detailedview.component.js +180 -0
  8. package/esm2015/lib/exceldata.service.js +651 -0
  9. package/esm2015/lib/full-table-view/full-table-view.component.js +196 -0
  10. package/esm2015/lib/header/header.component.js +187 -0
  11. package/esm2015/lib/principal-dashboard-lib-v2.component.js +36 -0
  12. package/esm2015/lib/principal-dashboard-lib-v2.module.js +37 -0
  13. package/esm2015/lib/principal-dashboard-lib-v2.service.js +832 -0
  14. package/esm2015/lib/small-table-view/small-table-view.component.js +244 -0
  15. package/esm2015/lib/tableview/tableview.component.js +220 -0
  16. package/esm2015/principal-dashboard-lib-v2.js +13 -0
  17. package/esm2015/public-api.js +7 -0
  18. package/fesm2015/principal-dashboard-lib-v2.js +3015 -0
  19. package/fesm2015/principal-dashboard-lib-v2.js.map +1 -0
  20. package/lib/chartheader/chartheader.component.d.ts +17 -0
  21. package/lib/chartview/chartview.component.d.ts +62 -0
  22. package/lib/detailedview/detailedview.component.d.ts +20 -0
  23. package/lib/exceldata.service.d.ts +18 -0
  24. package/lib/full-table-view/full-table-view.component.d.ts +21 -0
  25. package/lib/header/header.component.d.ts +41 -0
  26. package/lib/principal-dashboard-lib-v2.component.d.ts +11 -0
  27. package/lib/principal-dashboard-lib-v2.module.d.ts +2 -0
  28. package/lib/principal-dashboard-lib-v2.service.d.ts +52 -0
  29. package/lib/small-table-view/small-table-view.component.d.ts +25 -0
  30. package/lib/tableview/tableview.component.d.ts +30 -0
  31. package/package.json +10 -2
  32. package/principal-dashboard-lib-v2.d.ts +12 -0
  33. package/principal-dashboard-lib-v2.metadata.json +1 -0
  34. package/{src/public-api.ts → public-api.d.ts} +0 -4
  35. package/karma.conf.js +0 -44
  36. package/ng-package.json +0 -7
  37. package/src/lib/chartheader/chartheader.component.html +0 -13
  38. package/src/lib/chartheader/chartheader.component.scss +0 -66
  39. package/src/lib/chartheader/chartheader.component.spec.ts +0 -25
  40. package/src/lib/chartheader/chartheader.component.ts +0 -51
  41. package/src/lib/chartview/chartview.component -Backup.ts +0 -1096
  42. package/src/lib/chartview/chartview.component.html +0 -60
  43. package/src/lib/chartview/chartview.component.scss +0 -136
  44. package/src/lib/chartview/chartview.component.spec.ts +0 -25
  45. package/src/lib/chartview/chartview.component.ts +0 -470
  46. package/src/lib/detailedview/detailedview.component.html +0 -7
  47. package/src/lib/detailedview/detailedview.component.scss +0 -55
  48. package/src/lib/detailedview/detailedview.component.spec.ts +0 -25
  49. package/src/lib/detailedview/detailedview.component.ts +0 -199
  50. package/src/lib/exceldata.service.spec.ts +0 -16
  51. package/src/lib/exceldata.service.ts +0 -672
  52. package/src/lib/full-table-view/full-table-view.component.html +0 -49
  53. package/src/lib/full-table-view/full-table-view.component.scss +0 -51
  54. package/src/lib/full-table-view/full-table-view.component.spec.ts +0 -25
  55. package/src/lib/full-table-view/full-table-view.component.ts +0 -219
  56. package/src/lib/header/header.component -backup.ts +0 -120
  57. package/src/lib/header/header.component.html +0 -20
  58. package/src/lib/header/header.component.scss +0 -133
  59. package/src/lib/header/header.component.spec.ts +0 -25
  60. package/src/lib/header/header.component.ts +0 -205
  61. package/src/lib/principal-dashboard-lib-v2.component.html +0 -18
  62. package/src/lib/principal-dashboard-lib-v2.component.scss +0 -17
  63. package/src/lib/principal-dashboard-lib-v2.component.spec.ts +0 -25
  64. package/src/lib/principal-dashboard-lib-v2.component.ts +0 -32
  65. package/src/lib/principal-dashboard-lib-v2.module.ts +0 -37
  66. package/src/lib/principal-dashboard-lib-v2.service - Copy.ts +0 -585
  67. package/src/lib/principal-dashboard-lib-v2.service.spec.ts +0 -16
  68. package/src/lib/principal-dashboard-lib-v2.service.ts +0 -913
  69. package/src/lib/small-table-view/small-table-view.component.html +0 -53
  70. package/src/lib/small-table-view/small-table-view.component.scss +0 -65
  71. package/src/lib/small-table-view/small-table-view.component.spec.ts +0 -25
  72. package/src/lib/small-table-view/small-table-view.component.ts +0 -292
  73. package/src/lib/tableview/tableview.component.html +0 -27
  74. package/src/lib/tableview/tableview.component.scss +0 -31
  75. package/src/lib/tableview/tableview.component.spec.ts +0 -25
  76. package/src/lib/tableview/tableview.component.ts +0 -267
  77. package/src/test.ts +0 -26
  78. package/tsconfig.lib.json +0 -25
  79. package/tsconfig.lib.prod.json +0 -10
  80. package/tsconfig.spec.json +0 -17
  81. package/tslint.json +0 -17
@@ -0,0 +1,3406 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('angular-google-charts'), require('file-saver'), require('xlsx'), require('@angular/common'), require('ng2-datepicker')) :
3
+ typeof define === 'function' && define.amd ? define('principal-dashboard-lib-v2', ['exports', '@angular/core', 'rxjs', 'angular-google-charts', 'file-saver', 'xlsx', '@angular/common', 'ng2-datepicker'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['principal-dashboard-lib-v2'] = {}, global.ng.core, global.rxjs, global.angularGoogleCharts, global.FileSaver, global.XLSX, global.ng.common, global.ng2Datepicker));
5
+ }(this, (function (exports, i0, rxjs, angularGoogleCharts, FileSaver, XLSX, common, ng2Datepicker) { 'use strict';
6
+
7
+ var PrincipalDashboardLibV2Service = /** @class */ (function () {
8
+ function PrincipalDashboardLibV2Service() {
9
+ this.isResoureMetaDataReady = new rxjs.ReplaySubject();
10
+ this.isResoureMetaDataReady$ = this.isResoureMetaDataReady.asObservable();
11
+ this.isUserReqiuredDataReady = new rxjs.ReplaySubject();
12
+ this.isUserReqiuredDataReady$ = this.isUserReqiuredDataReady.asObservable();
13
+ this.mychartType = '';
14
+ this.dataType = '';
15
+ this.userAllData = '';
16
+ this.userMetadata = { userDetails: [], resourceDetails: [] };
17
+ this.resoureMetadata = new Array();
18
+ this.userDetailObject = {};
19
+ this.userlist = false;
20
+ //for change chart Type
21
+ this.chartType = new rxjs.BehaviorSubject(this.mychartType);
22
+ this.chartType$ = this.chartType.asObservable();
23
+ //for change userWise To classRoom wise or vice versa
24
+ this.isUserWise_data = new rxjs.BehaviorSubject(true);
25
+ this.isUserWise_data$ = this.isUserWise_data.asObservable();
26
+ // for all user and current user information
27
+ this.isAllUsers = new rxjs.BehaviorSubject(this.userlist);
28
+ this.isAllUsers$ = this.isAllUsers.asObservable();
29
+ //for get details of selected user
30
+ this.detailedviewData = new rxjs.BehaviorSubject(this.userMetadata);
31
+ this.detailedviewData$ = this.detailedviewData.asObservable();
32
+ this.openSmallTable = new rxjs.BehaviorSubject(false);
33
+ this.openSmallTable$ = this.openSmallTable.asObservable();
34
+ }
35
+ PrincipalDashboardLibV2Service.prototype.genarateResourseReqiuredData = function (data) {
36
+ this.isResoureMetaDataReady.next(false);
37
+ var resourceMetadataMatrix = new Array();
38
+ if (data && data !== null) {
39
+ var resouseID = void 0;
40
+ var title = void 0;
41
+ var subject = void 0;
42
+ var grade = void 0;
43
+ var chapter = void 0;
44
+ var teachingPoint = void 0;
45
+ var type = void 0;
46
+ var resourceMetadata = data.resourcesMetadata.resourceMetadata;
47
+ if (resourceMetadata != undefined && resourceMetadata.length > 0) {
48
+ for (var i = 0; i < resourceMetadata.length; i++) {
49
+ //----------//resouseID
50
+ resouseID = resourceMetadata[i].resourceId;
51
+ //----------//subject
52
+ if (resourceMetadata[i].subject != undefined) {
53
+ if (resourceMetadata[i].subject.title != undefined) {
54
+ subject = resourceMetadata[i].subject.title;
55
+ }
56
+ else {
57
+ subject = '';
58
+ }
59
+ }
60
+ else {
61
+ subject = '';
62
+ }
63
+ //----------//grade
64
+ if (resourceMetadata[i].grade != undefined) {
65
+ if (resourceMetadata[i].grade.title != undefined) {
66
+ grade = resourceMetadata[i].grade.title;
67
+ }
68
+ else {
69
+ grade = '';
70
+ }
71
+ }
72
+ else {
73
+ grade = '';
74
+ }
75
+ //----------//chapter
76
+ //console.log('LOOKCHP',resourceMetadata[i].chapter)
77
+ if (resourceMetadata[i].chapter != undefined) {
78
+ if (resourceMetadata[i].chapter.title != undefined) {
79
+ chapter = resourceMetadata[i].chapter.title;
80
+ }
81
+ else {
82
+ chapter = '';
83
+ }
84
+ }
85
+ else {
86
+ chapter = '';
87
+ }
88
+ //----------//teachingPoint
89
+ //console.log('LOOKTP',resourceMetadata[i].teachingPoint)
90
+ if (resourceMetadata[i].teachingPoint != undefined) {
91
+ if (resourceMetadata[i].teachingPoint.title != undefined) {
92
+ teachingPoint = resourceMetadata[i].teachingPoint.title;
93
+ }
94
+ else {
95
+ //teachingPoint = '<span style="color:lightgray;">--</span>';
96
+ teachingPoint = '';
97
+ }
98
+ }
99
+ else {
100
+ //teachingPoint = '<span style="color:lightgray;">--</span>';
101
+ teachingPoint = '';
102
+ }
103
+ //----------//type
104
+ if (resourceMetadata[i].type != undefined) {
105
+ type = this.getDisplaytypeValue(resourceMetadata[i].type);
106
+ }
107
+ else {
108
+ type = '';
109
+ }
110
+ //----------//title
111
+ if (resourceMetadata[i].title != undefined) {
112
+ title = resourceMetadata[i].title;
113
+ }
114
+ else {
115
+ title = '';
116
+ }
117
+ var resourceMetauserConsoleData = {
118
+ resouseID: resouseID,
119
+ subject: subject,
120
+ grade: grade,
121
+ chapter: chapter,
122
+ teachingPoint: teachingPoint,
123
+ type: type,
124
+ title: title
125
+ };
126
+ resourceMetadataMatrix.push(resourceMetauserConsoleData);
127
+ this.resoureMetaData = resourceMetadataMatrix;
128
+ this.isResoureMetaDataReady.next(true);
129
+ }
130
+ }
131
+ }
132
+ // this.resoureMetaData = resourceMetadataMatrix;
133
+ return resourceMetadataMatrix;
134
+ };
135
+ PrincipalDashboardLibV2Service.prototype.getName = function (user) {
136
+ if (/School Admin/gm.exec(user.role)) {
137
+ return "Support Admin";
138
+ }
139
+ return user.fullName;
140
+ };
141
+ PrincipalDashboardLibV2Service.prototype.genarateUserReqiuredData = function (data) {
142
+ this.isUserReqiuredDataReady.next(false);
143
+ var usersMetadataMatrix = new Array();
144
+ var usermetadataMatrixUpdated = new Array();
145
+ var schoolTerminalMatrix = new Array();
146
+ var userConsoleMatrix = new Array();
147
+ if (data && data !== null) {
148
+ var userConsole = data.usersConsole.userConsole;
149
+ var usersMetadata = data.usersMetadata.userMetadata;
150
+ var schoolTerminal = data.schoolTerminals.schoolTerminal;
151
+ if (usersMetadata != null && usersMetadata.length > 0) {
152
+ for (var i_1 = 0; i_1 < usersMetadata.length; i_1++) {
153
+ var userId = void 0;
154
+ var userName = void 0;
155
+ var userSubjects = void 0;
156
+ var listOfUser = {};
157
+ if (usersMetadata[i_1].userId != "") {
158
+ userId = usersMetadata[i_1].userId;
159
+ //console.log("--chartDataUserWise-->>",usersMetadata[i].terminalIP)
160
+ if (usersMetadata[i_1].fullName !== undefined) {
161
+ userName = this.getName(usersMetadata[i_1]); // get name of user w.r.t. ID
162
+ }
163
+ else {
164
+ userName = '';
165
+ }
166
+ if (usersMetadata[i_1].userSubjects !== undefined) {
167
+ userSubjects = usersMetadata[i_1].userSubjects; // get name of user w.r.t. ID
168
+ }
169
+ else {
170
+ userSubjects = '';
171
+ }
172
+ listOfUser = {
173
+ userId: userId,
174
+ userName: userName,
175
+ userSubjects: userSubjects
176
+ };
177
+ usersMetadataMatrix.push(listOfUser); // array of all users
178
+ }
179
+ }
180
+ }
181
+ for (var i = 0; i < usersMetadataMatrix.length; i++) {
182
+ //console.log('usersMetadataMatrix-->', usersMetadataMatrix[i].userName)
183
+ usersMetadataMatrix.forEach(function (element) {
184
+ //console.log('element.userName-->>', element.userName)
185
+ if (usersMetadataMatrix[i].userName === element.userName) {
186
+ usermetadataMatrixUpdated.push(usersMetadataMatrix[i]); //array of same name users
187
+ usersMetadataMatrix.splice(i, 1); //delete the same name users from usermetadataMatrix
188
+ }
189
+ });
190
+ }
191
+ for (var i = 0; i < usermetadataMatrixUpdated.length; i++) {
192
+ // const randomNumber = document.createElement('span');
193
+ // randomNumber.innerHTML = i.toString();
194
+ //usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName + " --- " + i;
195
+ usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName;
196
+ usersMetadataMatrix.push(usermetadataMatrixUpdated[i]); //adding same name users in usermetadataMatrix with some random charators
197
+ this.usersMetaData = usersMetadataMatrix;
198
+ }
199
+ if (schoolTerminal != null && schoolTerminal.length > 0) {
200
+ for (var i = 0; i < schoolTerminal.length; i++) {
201
+ var schoolId = void 0;
202
+ var terminalKey = void 0;
203
+ var terminalType = void 0;
204
+ var location = void 0;
205
+ var schoolTerminalData = {};
206
+ //----------//schoolId
207
+ if (schoolTerminal[i].schoolId !== undefined) {
208
+ schoolId = schoolTerminal[i].schoolId; // get name of user w.r.t. ID
209
+ }
210
+ else {
211
+ schoolId = '';
212
+ }
213
+ //----------//terminalKey
214
+ if (schoolTerminal[i].terminalKey !== undefined) {
215
+ terminalKey = schoolTerminal[i].terminalKey; // get name of user w.r.t. ID
216
+ }
217
+ else {
218
+ terminalKey = '';
219
+ }
220
+ //----------//terminalType
221
+ if (schoolTerminal[i].terminalType !== undefined) {
222
+ terminalType = schoolTerminal[i].terminalType; // get name of user w.r.t. ID
223
+ }
224
+ else {
225
+ terminalType = '';
226
+ }
227
+ //----------//location
228
+ if (schoolTerminal[i].metadata !== undefined) {
229
+ var metadataJSON = JSON.parse(schoolTerminal[i].metadata);
230
+ location = metadataJSON.location; // get name of user w.r.t. ID
231
+ //console.log("metadataJSON",location);
232
+ }
233
+ else {
234
+ location = '';
235
+ }
236
+ schoolTerminalData = {
237
+ schoolId: schoolId,
238
+ terminalKey: terminalKey,
239
+ terminalType: terminalType,
240
+ location: location
241
+ };
242
+ //console.log('ccc--',schoolTerminalData)
243
+ schoolTerminalMatrix.push(schoolTerminalData);
244
+ this.schoolTerminalData = schoolTerminalMatrix;
245
+ }
246
+ }
247
+ if (userConsole != null && userConsole.length > 0) {
248
+ var _loop_1 = function (index) {
249
+ var userId = void 0;
250
+ var startTime = void 0;
251
+ var endTime = void 0;
252
+ var duration = void 0;
253
+ var selectedDate = void 0;
254
+ var terminalIP = void 0;
255
+ var userConsoleResources = void 0;
256
+ var resourceMetadataIDS = void 0;
257
+ var resourceMetauserConsoleData = [];
258
+ var resourceDurationFromConsole = [];
259
+ var userName = void 0;
260
+ var userSubjects = void 0;
261
+ var terminalLocation = void 0;
262
+ var launchedFrom = [];
263
+ //console.log('myuserConsole', userConsole[index])
264
+ //----------//user iD
265
+ if (userConsole[index].userId !== undefined) {
266
+ userId = userConsole[index].userId; // get name of user w.r.t. ID
267
+ }
268
+ else {
269
+ userId = '';
270
+ }
271
+ //----------// startTime
272
+ if (userConsole[index].startTime !== undefined) {
273
+ startTime = userConsole[index].startTime; // get name of user w.r.t. ID
274
+ }
275
+ else {
276
+ startTime = '';
277
+ }
278
+ //----------// endTime
279
+ if (userConsole[index].endTime !== undefined) {
280
+ endTime = userConsole[index].endTime; // get name of user w.r.t. ID
281
+ this_1.myEndTime = endTime;
282
+ }
283
+ else {
284
+ endTime = '';
285
+ }
286
+ //----------// Date
287
+ if (userConsole[index].selectedDate !== undefined) {
288
+ selectedDate = userConsole[index].selectedDate; // get name of user w.r.t. ID
289
+ }
290
+ else {
291
+ selectedDate = '';
292
+ }
293
+ //----------// Duration
294
+ if (userConsole[index].duration !== undefined) {
295
+ duration = userConsole[index].duration; // get name of user w.r.t. ID
296
+ }
297
+ else {
298
+ duration = '';
299
+ }
300
+ //----------// terminalIP
301
+ if (userConsole[index].terminalIP !== undefined) {
302
+ terminalIP = userConsole[index].terminalIP; // get name of user w.r.t. ID
303
+ }
304
+ else {
305
+ terminalIP = '';
306
+ }
307
+ //----------// userConsoleResources
308
+ if (userConsole[index].userConsoleResources !== undefined) {
309
+ userConsoleResources = userConsole[index].userConsoleResources; // get name of user w.r.t. ID
310
+ }
311
+ else {
312
+ userConsoleResources = null;
313
+ }
314
+ if (userConsoleResources != null) {
315
+ if (userConsoleResources.userConsoleResource !== undefined) {
316
+ userConsoleResources.userConsoleResource.forEach(function (item) {
317
+ //console.log("lookingFor: ",item)
318
+ resourceMetauserConsoleData.push(item.resourceId); // get name of user w.r.t. ID
319
+ resourceDurationFromConsole.push(item.duration);
320
+ if (item.launchedFrom) {
321
+ launchedFrom.push(item.launchedFrom);
322
+ }
323
+ //
324
+ });
325
+ // resourceMetauserConsoleData = userConsoleResources.userConsoleResource[index]resourceId; // get name of user w.r.t. ID
326
+ }
327
+ else {
328
+ //console.log("lookingFor: ELSE ")
329
+ resourceMetauserConsoleData = [];
330
+ resourceDurationFromConsole = [];
331
+ launchedFrom = [];
332
+ }
333
+ }
334
+ //----------// userName and userSubjects
335
+ for (var i_2 = 0; i_2 < usersMetadataMatrix.length; i_2++) {
336
+ if (userId === usersMetadataMatrix[i_2].userId) {
337
+ userName = usersMetadataMatrix[i_2].userName;
338
+ userSubjects = usersMetadataMatrix[i_2].userSubjects;
339
+ }
340
+ }
341
+ //----------// terminalIP and terminalLocation
342
+ for (var i_3 = 0; i_3 < schoolTerminalMatrix.length; i_3++) {
343
+ //console.log("schoolTerminalMatrix[i]",schoolTerminalMatrix[i]);
344
+ //console.log("schoolTerminalMatrix[i].terminalKey",terminalIP,schoolTerminalMatrix[i].terminalKey);
345
+ if (terminalIP === schoolTerminalMatrix[i_3].terminalKey) {
346
+ terminalLocation = schoolTerminalMatrix[i_3].location;
347
+ break;
348
+ }
349
+ else {
350
+ terminalLocation = '';
351
+ }
352
+ }
353
+ if (terminalLocation === undefined || terminalLocation === 'undefined') {
354
+ terminalLocation = '';
355
+ }
356
+ // console.log('userName--',userName)
357
+ var userData = {
358
+ userId: userId,
359
+ userName: userName,
360
+ startTime: new Date(startTime),
361
+ endTime: new Date(endTime),
362
+ terminalIP: terminalIP,
363
+ resourceMetauserConsoleData: resourceMetauserConsoleData,
364
+ resourceDurationFromConsole: resourceDurationFromConsole,
365
+ launchedFrom: launchedFrom,
366
+ duration: duration,
367
+ terminalLocation: terminalLocation,
368
+ userSubjects: userSubjects
369
+ };
370
+ userConsoleMatrix.push(userData);
371
+ this_1.userConsoleData = userConsoleMatrix;
372
+ this_1.isUserReqiuredDataReady.next(true);
373
+ };
374
+ var this_1 = this;
375
+ for (var index = 0; index < userConsole.length; index++) {
376
+ _loop_1(index);
377
+ }
378
+ }
379
+ }
380
+ // console.log(usersMetadataMatrix,schoolTerminalMatrix,userConsoleMatrix);
381
+ return {
382
+ usersMetadata: usersMetadataMatrix,
383
+ schoolTerminalData: schoolTerminalMatrix,
384
+ userConsoleData: userConsoleMatrix
385
+ };
386
+ };
387
+ PrincipalDashboardLibV2Service.prototype.userWiseChartData = function () {
388
+ var dataTableforChart = new Array();
389
+ dataTableforChart = [];
390
+ if (this.userConsoleData) {
391
+ if (this.userConsoleData.length > 0) {
392
+ for (var i = 0; i < this.userConsoleData.length; i++) {
393
+ //console.log("chartDataUserWiseNew-->>",this.userConsoleData)
394
+ //console.log("chartDataUserWiseNew-->>",this.userConsoleData.userName)
395
+ if (typeof this.userConsoleData[i].userName === undefined) {
396
+ this.userConsoleData[i].userName = (Math.floor(Math.random() * 100)).toString();
397
+ }
398
+ if (this.userConsoleData[i].userName === undefined) {
399
+ this.userConsoleData[i].userName = "-";
400
+ //console.log('pakad',this.userConsoleData[i].userName = "-", this.userConsoleData[i].userId)
401
+ //this.userConsoleData.splice(i, 1);
402
+ }
403
+ /*
404
+ if(this.userConsoleData[i].userName === "-"){
405
+ this.userConsoleData.splice(i, 1); // 2nd parameter means remove one item only
406
+ }*/
407
+ //if(this.userConsoleData[i].userName !== undefined || this.userConsoleData[i].userName !== '-' || this.userConsoleData[i].userName !== '--')
408
+ {
409
+ var userData = [this.userConsoleData[i].userName, this.userConsoleData[i].startTime, this.userConsoleData[i].endTime];
410
+ dataTableforChart.push(userData);
411
+ }
412
+ //console.log("chartDataUserWiseNewNew-->>",userData)
413
+ }
414
+ }
415
+ }
416
+ return dataTableforChart;
417
+ };
418
+ PrincipalDashboardLibV2Service.prototype.classRoomWiseChartData = function () {
419
+ var dataTableforChart = new Array();
420
+ dataTableforChart = [];
421
+ if (this.userConsoleData) {
422
+ for (var i = 0; i < this.userConsoleData.length; i++) {
423
+ //console.log('bbb-->',this.userConsoleData[i].terminalLocation)
424
+ var roomName = this.userConsoleData[i].terminalLocation;
425
+ if (roomName === "") {
426
+ //roomName = "No Name"
427
+ }
428
+ var location = roomName + " - " + this.userConsoleData[i].terminalIP;
429
+ //console.log('bbblocation-->',location)
430
+ var userData = [location, this.userConsoleData[i].startTime, this.userConsoleData[i].endTime];
431
+ dataTableforChart.push(userData);
432
+ }
433
+ }
434
+ //console.log("this.classRoomWiseChartData",dataTableforChart);
435
+ return dataTableforChart;
436
+ };
437
+ PrincipalDashboardLibV2Service.prototype.newGetCurrentClassroomData = function () {
438
+ var dataTableforChart = new Array();
439
+ dataTableforChart = [];
440
+ if (this.userConsoleData) {
441
+ for (var i = 0; i < this.userConsoleData.length; i++) {
442
+ //console.log('bbb-->',this.userConsoleData[i].terminalLocation)
443
+ var roomName = this.userConsoleData[i].terminalLocation;
444
+ var location = roomName + " - " + this.userConsoleData[i].terminalIP;
445
+ //console.log('bbblocation-->',location)
446
+ //let userData = [location];
447
+ dataTableforChart.push(location);
448
+ }
449
+ }
450
+ //console.log("this.classRoomWiseChartData",dataTableforChart);
451
+ dataTableforChart = this.uniq(dataTableforChart);
452
+ return dataTableforChart;
453
+ };
454
+ PrincipalDashboardLibV2Service.prototype.uniq = function (a) {
455
+ return Array.from(new Set(a));
456
+ };
457
+ PrincipalDashboardLibV2Service.prototype.allUserChartData = function () {
458
+ var dataTableforChart = new Array();
459
+ dataTableforChart = [];
460
+ var AlluserDetailsForTableChart = new Array();
461
+ AlluserDetailsForTableChart = [];
462
+ if (this.userConsoleData && this.usersMetaData) {
463
+ var inActiveuserName = void 0;
464
+ var userSubjects = void 0;
465
+ var myID = void 0;
466
+ var AlluserDetails_1 = new Array();
467
+ for (var index = 0; index < this.userConsoleData.length; index++) {
468
+ AlluserDetails_1.push(this.userConsoleData[index]);
469
+ AlluserDetailsForTableChart.push(this.userConsoleData[index]);
470
+ }
471
+ for (var i = 0; i < this.usersMetaData.length; i++) {
472
+ myID = this.usersMetaData[i].userId;
473
+ inActiveuserName = this.usersMetaData[i].userName;
474
+ //if(inActiveuserName === undefined)
475
+ {
476
+ //console.log("alluser-1->>",inActiveuserName);
477
+ }
478
+ userSubjects = this.usersMetaData[i].userSubjects;
479
+ var myChartRowuserConsoleData = {
480
+ userId: myID,
481
+ userName: inActiveuserName,
482
+ startTime: new Date(this.myEndTime),
483
+ endTime: new Date(this.myEndTime),
484
+ terminalIP: "",
485
+ resourceMetauserConsoleData: [],
486
+ duration: "0",
487
+ terminalLocation: "",
488
+ userSubjects: userSubjects
489
+ };
490
+ //AlluserDetails.push(myChartRowuserConsoleData);
491
+ var myTableRowuserConsoleData = {
492
+ userId: myID,
493
+ userName: inActiveuserName,
494
+ startTime: "",
495
+ endTime: "",
496
+ terminalIP: "",
497
+ resourceMetauserConsoleData: [],
498
+ duration: 0,
499
+ terminalLocation: "",
500
+ userSubjects: userSubjects
501
+ };
502
+ //console.log("alluser-2->>",inActiveuserName);
503
+ AlluserDetailsForTableChart.push(myTableRowuserConsoleData);
504
+ AlluserDetails_1.push(myChartRowuserConsoleData);
505
+ }
506
+ setTimeout(function () {
507
+ var _loop_2 = function (i) {
508
+ //console.log("alluser-3->>",AlluserDetails[i]);
509
+ if (AlluserDetails_1[i].userName == undefined) {
510
+ //AlluserDetails[i].userName = "--"
511
+ AlluserDetails_1.splice(i, 1); // 2nd parameter means remove one item only
512
+ }
513
+ //if(AlluserDetails[i].userName !== undefined || AlluserDetails[i].userName !== '-' || AlluserDetails[i].userName !== '--')
514
+ {
515
+ if (AlluserDetails_1[i].userName === "--") {
516
+ AlluserDetails_1.splice(i, 1); // 2nd parameter means remove one item only
517
+ }
518
+ setTimeout(function () {
519
+ var userData = [AlluserDetails_1[i].userName, AlluserDetails_1[i].startTime, AlluserDetails_1[i].endTime];
520
+ dataTableforChart.push(userData);
521
+ }, 300);
522
+ }
523
+ };
524
+ for (var i = 0; i < AlluserDetails_1.length; i++) {
525
+ _loop_2(i);
526
+ }
527
+ }, 50);
528
+ /*
529
+ for(let i = 0; i < AlluserDetails.length; i++){
530
+ console.log("alluser-3->>",AlluserDetails[i].userName);
531
+ if(AlluserDetails[i].userName === undefined){
532
+ AlluserDetails[i].userName = "(-)"
533
+ }
534
+
535
+ let userData = [AlluserDetails[i].userName,AlluserDetails[i].startTime,AlluserDetails[i].endTime];
536
+ dataTableforChart.push(userData);
537
+ }*/
538
+ }
539
+ return { forChartData: dataTableforChart, fordurationTable: AlluserDetailsForTableChart };
540
+ };
541
+ PrincipalDashboardLibV2Service.prototype.allRoomsData = function () {
542
+ var dataTableforChart = new Array();
543
+ dataTableforChart = [];
544
+ var allRoomsDetails = new Array();
545
+ allRoomsDetails = [];
546
+ if (this.userConsoleData && this.schoolTerminalData) {
547
+ var myChartRowData = {};
548
+ var inActiveClassRoom = void 0;
549
+ for (var i = 0; i < this.userConsoleData.length; i++) {
550
+ allRoomsDetails.push(this.userConsoleData[i]);
551
+ //console.log("bbb allRoom-->",this.userConsoleData[i])
552
+ var roomName = this.userConsoleData[i].terminalLocation;
553
+ var roomIP = this.userConsoleData[i].terminalIP;
554
+ if (roomName === "" || roomName === undefined) {
555
+ roomName = "No Name";
556
+ }
557
+ var location = roomName + " - " + roomIP;
558
+ //console.log('bbbbRoom',location)
559
+ // let userData = [this.userConsoleData[i].terminalIP,this.userConsoleData[i].startTime,this.userConsoleData[i].endTime];
560
+ var userData = [location, this.userConsoleData[i].startTime, this.userConsoleData[i].endTime];
561
+ dataTableforChart.push(userData);
562
+ }
563
+ var inactiveRoonName = void 0;
564
+ for (var i = 0; i < this.schoolTerminalData.length; i++) {
565
+ //console.log("schoolTerminalData",this.schoolTerminalData);
566
+ inActiveClassRoom = this.schoolTerminalData[i].location + ' - ' + this.schoolTerminalData[i].terminalKey;
567
+ //inactiveRoonName = this.schoolTerminalData[i].location;
568
+ myChartRowData = {
569
+ userId: "",
570
+ userName: "",
571
+ startTime: new Date(this.myEndTime),
572
+ endTime: new Date(this.myEndTime),
573
+ terminalIP: inActiveClassRoom,
574
+ resourceMetauserConsoleData: [],
575
+ duration: 0,
576
+ terminalLocation: "",
577
+ userSubjects: ""
578
+ };
579
+ allRoomsDetails.push(myChartRowData);
580
+ var myChartRowuserConsoleData = [inActiveClassRoom, new Date(this.myEndTime), new Date(this.myEndTime)];
581
+ dataTableforChart.push(myChartRowuserConsoleData);
582
+ }
583
+ }
584
+ return { forChartData: dataTableforChart, fordurationTable: allRoomsDetails };
585
+ };
586
+ PrincipalDashboardLibV2Service.prototype.dataForTableView = function (userConsoleMatrix, resourceMetadataMatrix) {
587
+ var currentDate;
588
+ var resourceMatrixForTableChart = new Array();
589
+ var resourceMatrixForExcel = new Array();
590
+ resourceMatrixForTableChart = [];
591
+ resourceMatrixForExcel = [];
592
+ for (var i = 0; i < userConsoleMatrix.length; i++) {
593
+ var startTime = void 0;
594
+ var endTime = void 0;
595
+ var duration = void 0;
596
+ var terminalIP = void 0;
597
+ var subject = void 0;
598
+ var grade = void 0;
599
+ var chapter = void 0;
600
+ var topicName = void 0;
601
+ var AssestDetail = void 0;
602
+ var resourceType = void 0;
603
+ var resourceTitle = void 0;
604
+ var teachingPoint = void 0;
605
+ var location = void 0;
606
+ var teacherName = void 0;
607
+ var teacherSubject = void 0;
608
+ var resourceMetadataIDs = void 0;
609
+ var resourceMetadataIDsDuration = void 0;
610
+ var resourceArrayForExcel = new Array();
611
+ var resourceArrayForTableChart = new Array();
612
+ var userConsoleDataMatrix = new Array();
613
+ var launchedFrom = void 0;
614
+ resourceArrayForTableChart = [];
615
+ userConsoleDataMatrix = [];
616
+ //----------------- for subject and Name
617
+ teacherSubject = userConsoleMatrix[i].userSubjects;
618
+ teacherName = userConsoleMatrix[i].userName;
619
+ //----------------- for start Time and EndTime
620
+ if ((userConsoleMatrix[i].startTime != undefined && userConsoleMatrix[i].startTime != "") && (userConsoleMatrix[i].endTime != undefined && userConsoleMatrix[i].endTime != "")) {
621
+ startTime = userConsoleMatrix[i].startTime.toLocaleTimeString('en-US', { hour12: true });
622
+ endTime = userConsoleMatrix[i].endTime.toLocaleTimeString('en-US', { hour12: true });
623
+ currentDate = userConsoleMatrix[i].startTime.getDate() + '/' + (userConsoleMatrix[i].startTime.getMonth() + 1) + '/' + userConsoleMatrix[i].startTime.getFullYear();
624
+ }
625
+ //----------------- for duration
626
+ duration = Math.floor(userConsoleMatrix[i].duration);
627
+ //----------------- for Terminal loaction and terminal IP
628
+ location = userConsoleMatrix[i].terminalLocation;
629
+ terminalIP = userConsoleMatrix[i].terminalIP;
630
+ var roomDetail = location + ' ' + terminalIP;
631
+ resourceMetadataIDs = userConsoleMatrix[i].resourceMetauserConsoleData;
632
+ resourceMetadataIDsDuration = userConsoleMatrix[i].resourceDurationFromConsole;
633
+ //console.log('mlaunchedFrom-->> ',(typeof userConsoleMatrix[i].launchedFrom));
634
+ //console.log('mlaunchedFrom-->> ',( userConsoleMatrix[i].launchedFrom));
635
+ var launchDataArr = Array(userConsoleMatrix[i].launchedFrom);
636
+ //console.log('mlaunchedFrom len-->> ', launchDataArr);
637
+ launchedFrom = launchDataArr;
638
+ if (resourceMetadataIDs.length === 0) {
639
+ subject = undefined;
640
+ grade = undefined;
641
+ chapter = undefined;
642
+ topicName = undefined;
643
+ teachingPoint = undefined;
644
+ AssestDetail = undefined;
645
+ resourceTitle = undefined;
646
+ resourceType = undefined;
647
+ resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingPoint, AssestDetail, launchedFrom];
648
+ resourceMatrixForTableChart.push(resourceArrayForTableChart);
649
+ }
650
+ else {
651
+ //resourceMetadataMatrix = [resouseID,subject,grade,chapter,teachingPoint,type,title]
652
+ for (var k = 0; k < resourceMetadataIDs.length; k++) {
653
+ for (var i_4 = 0; i_4 < resourceMetadataMatrix.length; i_4++) {
654
+ if (resourceMetadataIDs[k] === resourceMetadataMatrix[i_4].resouseID) {
655
+ subject = resourceMetadataMatrix[i_4].subject;
656
+ grade = resourceMetadataMatrix[i_4].grade;
657
+ chapter = resourceMetadataMatrix[i_4].chapter;
658
+ topicName = resourceMetadataMatrix[i_4].topicName;
659
+ teachingPoint = resourceMetadataMatrix[i_4].teachingPoint;
660
+ if (resourceMetadataMatrix[i_4].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i_4].title.toLowerCase() === 'question') {
661
+ AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + ' : ' + this.convertSeconds(resourceMetadataIDsDuration[k]);
662
+ }
663
+ else {
664
+ AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type) + " : " + resourceMetadataMatrix[i_4].title + ' : ' + this.convertSeconds(resourceMetadataIDsDuration[k]);
665
+ }
666
+ //AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + " : " + resourceMetadataMatrix[i].title + ' : ' + resourceMetadataIDsDuration[k];
667
+ resourceArrayForTableChart = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, roomDetail, subject, grade, chapter, teachingPoint, AssestDetail, launchedFrom];
668
+ resourceMatrixForTableChart.push(resourceArrayForTableChart);
669
+ teacherName = undefined;
670
+ teacherSubject = undefined;
671
+ currentDate = undefined;
672
+ startTime = undefined;
673
+ endTime = undefined;
674
+ duration = undefined;
675
+ roomDetail = undefined;
676
+ }
677
+ }
678
+ }
679
+ }
680
+ }
681
+ return resourceMatrixForTableChart;
682
+ };
683
+ PrincipalDashboardLibV2Service.prototype.dataForDetailedView = function (userConsoleMatrix, resourceMetadataMatrix, rowLabel) {
684
+ var detailedView_UserDataMatrix = new Array();
685
+ detailedView_UserDataMatrix = [];
686
+ var detailedView_ResourceDataMatrix = new Array();
687
+ detailedView_ResourceDataMatrix = [];
688
+ var startTime;
689
+ var endTime;
690
+ var duration;
691
+ var terminalIP;
692
+ var subject;
693
+ var grade;
694
+ var chapter;
695
+ var AssestDetail;
696
+ var teachingPoint;
697
+ var location;
698
+ var teacherName;
699
+ var teacherSubject;
700
+ var currentDate;
701
+ var resourceMetadataIDs;
702
+ var resourceMetadataIDsduration;
703
+ var resourceArrayForTableChart = new Array();
704
+ resourceArrayForTableChart = [];
705
+ //----------------- for subject and Name
706
+ teacherSubject = userConsoleMatrix[rowLabel].userSubjects;
707
+ teacherName = userConsoleMatrix[rowLabel].userName;
708
+ //----------------- for start Time and EndTime
709
+ if ((userConsoleMatrix[rowLabel].startTime != undefined && userConsoleMatrix[rowLabel].startTime != "") && (userConsoleMatrix[rowLabel].endTime != undefined && userConsoleMatrix[rowLabel].endTime != "")) {
710
+ startTime = userConsoleMatrix[rowLabel].startTime.toLocaleTimeString('en-US', { hour12: true });
711
+ endTime = userConsoleMatrix[rowLabel].endTime.toLocaleTimeString('en-US', { hour12: true });
712
+ currentDate = userConsoleMatrix[rowLabel].startTime.getDate() + '/' + userConsoleMatrix[rowLabel].startTime.getMonth() + '/' + userConsoleMatrix[rowLabel].startTime.getFullYear();
713
+ }
714
+ //----------------- for duration
715
+ duration = Math.floor(userConsoleMatrix[rowLabel].duration);
716
+ //----------------- for Terminal loaction and terminal IP
717
+ location = userConsoleMatrix[rowLabel].terminalLocation;
718
+ terminalIP = userConsoleMatrix[rowLabel].terminalIP;
719
+ var roomDetail = location + ' ' + terminalIP;
720
+ resourceMetadataIDs = userConsoleMatrix[rowLabel].resourceMetauserConsoleData;
721
+ resourceMetadataIDsduration = userConsoleMatrix[rowLabel].resourceDurationFromConsole;
722
+ detailedView_UserDataMatrix = [teacherName, startTime, teacherSubject, endTime, roomDetail];
723
+ if (resourceMetadataIDs.length == 0) {
724
+ subject = undefined;
725
+ grade = undefined;
726
+ chapter = undefined;
727
+ teachingPoint = undefined;
728
+ AssestDetail = undefined;
729
+ }
730
+ else {
731
+ for (var k = 0; k < resourceMetadataIDs.length; k++) {
732
+ for (var i = 0; i < resourceMetadataMatrix.length; i++) {
733
+ if (resourceMetadataIDs[k] === resourceMetadataMatrix[i].resouseID) {
734
+ subject = resourceMetadataMatrix[i].subject;
735
+ grade = resourceMetadataMatrix[i].grade;
736
+ chapter = resourceMetadataMatrix[i].chapter;
737
+ teachingPoint = resourceMetadataMatrix[i].teachingPoint;
738
+ if (resourceMetadataMatrix[i].title.toLowerCase() === 'whiteboard' || resourceMetadataMatrix[i].title.toLowerCase() === 'question') {
739
+ AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
740
+ }
741
+ else {
742
+ AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
743
+ }
744
+ //AssestDetail = this.getDisplaytypeValue(resourceMetadataMatrix[i].type) + ": " + resourceMetadataMatrix[i].title + ": " + this.convertSeconds(resourceMetadataIDsduration[k]);
745
+ resourceArrayForTableChart = [subject, grade, chapter, teachingPoint, AssestDetail];
746
+ detailedView_ResourceDataMatrix.push(resourceArrayForTableChart);
747
+ }
748
+ }
749
+ }
750
+ }
751
+ return { userDetails: detailedView_UserDataMatrix, resourceDetails: detailedView_ResourceDataMatrix };
752
+ };
753
+ // To GET DISPLAY TYPE
754
+ PrincipalDashboardLibV2Service.prototype.getDisplaytypeValue = function (key) {
755
+ var assetTypeConfig = [
756
+ {
757
+ type: "asset_media",
758
+ display: "Media"
759
+ },
760
+ {
761
+ type: "asset_print",
762
+ display: "Print"
763
+ },
764
+ {
765
+ type: "quiz",
766
+ display: "Quiz"
767
+ },
768
+ {
769
+ type: "question",
770
+ display: "Question"
771
+ },
772
+ {
773
+ type: "chapter",
774
+ display: "Chapter"
775
+ },
776
+ {
777
+ type: "tp",
778
+ display: "Topic"
779
+ },
780
+ {
781
+ type: "whiteboard",
782
+ display: "Whiteboard"
783
+ },
784
+ {
785
+ type: "widget",
786
+ display: "Widget"
787
+ },
788
+ {
789
+ type: "casset_media",
790
+ display: "cMedia"
791
+ },
792
+ {
793
+ type: "casset_print",
794
+ display: "cPrint"
795
+ },
796
+ {
797
+ type: "cquiz",
798
+ display: "cQuiz"
799
+ },
800
+ {
801
+ type: "cquestion",
802
+ display: "cQuestion"
803
+ },
804
+ {
805
+ type: "image",
806
+ display: "Image"
807
+ },
808
+ {
809
+ type: "video",
810
+ display: "Video"
811
+ },
812
+ {
813
+ type: "tools",
814
+ display: "Tools"
815
+ },
816
+ {
817
+ type: "feature",
818
+ display: "Feature"
819
+ },
820
+ ];
821
+ var displayValue = key;
822
+ assetTypeConfig.forEach(function (value) {
823
+ if (value.type === key) {
824
+ displayValue = value.display;
825
+ }
826
+ });
827
+ return displayValue;
828
+ };
829
+ PrincipalDashboardLibV2Service.prototype.convertSeconds = function (seconds) {
830
+ var minutes = Math.floor(seconds / 60);
831
+ var remainingSeconds = seconds % 60;
832
+ return minutes + "m " + remainingSeconds + "s";
833
+ };
834
+ return PrincipalDashboardLibV2Service;
835
+ }());
836
+ PrincipalDashboardLibV2Service.ɵprov = i0.ɵɵdefineInjectable({ factory: function PrincipalDashboardLibV2Service_Factory() { return new PrincipalDashboardLibV2Service(); }, token: PrincipalDashboardLibV2Service, providedIn: "root" });
837
+ PrincipalDashboardLibV2Service.decorators = [
838
+ { type: i0.Injectable, args: [{
839
+ providedIn: 'root'
840
+ },] }
841
+ ];
842
+ PrincipalDashboardLibV2Service.ctorParameters = function () { return []; };
843
+
844
+ var PrincipalDashboardLibV2Component = /** @class */ (function () {
845
+ function PrincipalDashboardLibV2Component() {
846
+ this.userSelectedDate = new i0.EventEmitter();
847
+ this.messageForUser = "Loding...";
848
+ }
849
+ Object.defineProperty(PrincipalDashboardLibV2Component.prototype, "responseStatus", {
850
+ set: function (res) {
851
+ this.setMessageForUser(res);
852
+ // console.log(" @Input() set responseStatus(res: any) >>>>>>>>>>>>.",res);
853
+ },
854
+ enumerable: false,
855
+ configurable: true
856
+ });
857
+ PrincipalDashboardLibV2Component.prototype.ngOnInit = function () {
858
+ // console.log(" IN --> 7 data",this.data);
859
+ };
860
+ PrincipalDashboardLibV2Component.prototype.setMessageForUser = function (res) {
861
+ this.messageForUser = res;
862
+ };
863
+ PrincipalDashboardLibV2Component.prototype.onUserSelectDate = function (e) {
864
+ // console.log(" IN --> 1");
865
+ this.data = null;
866
+ this.userSelectedDate.emit(e);
867
+ };
868
+ return PrincipalDashboardLibV2Component;
869
+ }());
870
+ PrincipalDashboardLibV2Component.decorators = [
871
+ { type: i0.Component, args: [{
872
+ selector: 'lib-principal-dashboard-lib-v2',
873
+ template: "<div id=\"reprtModule\">\n <div id=\"pd-mainDiv\" class=\"pd-mainContainer\">\n <lib-header [data]=\"data\" (userSelectedDate)=\"onUserSelectDate($event)\">\n </lib-header>\n <lib-chartheader></lib-chartheader>\n \n <div id=\"pd-preloader\" class=\"pd-preloaderDiv\" *ngIf=\"responseStatus !== 'true' && !data\">\n {{messageForUser}} \n </div>\n <lib-chartview *ngIf=\"data\" [data]=\"data\"></lib-chartview>\n <!-- <lib-tableview *ngIf=\"data\" [data]=\"data\"></lib-tableview> -->\n <lib-full-table-view *ngIf=\"data\" [data]=\"data\"></lib-full-table-view>\n <!-- <lib-detailedview *ngIf=\"data\" [data]=\"data\"></lib-detailedview> -->\n <lib-small-table-view *ngIf=\"data\" [data]=\"data\"></lib-small-table-view>\n \n </div>\n</div>\n ",
874
+ styles: [".pd-mainContainer{width:100%;height:100%}.pd-mainContainer .pd-preloaderDiv{text-align:center;line-height:27;position:absolute;width:100%;height:87%;z-index:2}.bs-datepicker-head{background-color:#000!important}"]
875
+ },] }
876
+ ];
877
+ PrincipalDashboardLibV2Component.ctorParameters = function () { return []; };
878
+ PrincipalDashboardLibV2Component.propDecorators = {
879
+ data: [{ type: i0.Input }],
880
+ responseStatus: [{ type: i0.Input }],
881
+ userSelectedDate: [{ type: i0.Output }]
882
+ };
883
+
884
+ var ChartheaderComponent = /** @class */ (function () {
885
+ function ChartheaderComponent(pdService) {
886
+ this.pdService = pdService;
887
+ //variables
888
+ this.mytype = angularGoogleCharts.ChartType.Timeline;
889
+ this.datadisplaytype = 'UserWise';
890
+ this.isUserWise = true;
891
+ this.isChartView = true;
892
+ }
893
+ ChartheaderComponent.prototype.ngOnInit = function () {
894
+ this.libVersion = "0.0.36";
895
+ // this.myIcon = document.getElementById('myIconImg');
896
+ // this.changeChatType()
897
+ };
898
+ ChartheaderComponent.prototype.changeChatType = function () {
899
+ if (this.mytype == angularGoogleCharts.ChartType.Timeline) {
900
+ this.isChartView = false;
901
+ this.mytype = angularGoogleCharts.ChartType.Table;
902
+ this.pdService.chartType.next(this.mytype);
903
+ }
904
+ else {
905
+ this.isChartView = true;
906
+ this.mytype = angularGoogleCharts.ChartType.Timeline;
907
+ this.pdService.chartType.next(this.mytype);
908
+ }
909
+ };
910
+ ChartheaderComponent.prototype.changeDataTypeClassRoom = function () {
911
+ this.isUserWise = false;
912
+ this.pdService.isUserWise_data.next(false);
913
+ };
914
+ ChartheaderComponent.prototype.changeDataTypeUser = function () {
915
+ this.isUserWise = true;
916
+ this.pdService.isUserWise_data.next(true);
917
+ };
918
+ return ChartheaderComponent;
919
+ }());
920
+ ChartheaderComponent.decorators = [
921
+ { type: i0.Component, args: [{
922
+ selector: 'lib-chartheader',
923
+ template: "\n<div id=\"pd-chartheader\">\n <div id=\"pd-chatTypeBtnDiv\" class=\"pd-tabIconBtn\" [ngClass]=\" isChartView ? 'tableIconImg' : 'chartIconImg'\" (click)=\"changeChatType()\">\n </div>\n \n <div id=\"pd-userWisechatTypeBtn\" class=\"userWiseBtn\" [ngStyle]=\"{ color: isUserWise ? '#ffffff' : '#000000' , backgroundColor: isUserWise ? '#000000' : '#c4c4c4'}\"\n (click)=\"changeDataTypeUser()\">User wise</div>\n <div id=\"pd-classRoomWiseBtn\" class=\"classWiseBtn\" [ngStyle]=\"{ color: isUserWise ? '#000000' : '#ffffff' , backgroundColor: isUserWise ? '#c4c4c4' : '#000000'}\"\n (click)=\"changeDataTypeClassRoom()\">Classroom wise</div>\n\n \n <div class=\"libVersionDiv\">v{{libVersion}}</div>\n</div>",
924
+ 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,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAzCAYAAADPX7uaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkZDQzc3REFDMkQ2MTFFMkIzNDhCNTE1RDg3OUE1QTciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkZDQzc3REJDMkQ2MTFFMkIzNDhCNTE1RDg3OUE1QTciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRkNDNzdEOEMyRDYxMUUyQjM0OEI1MTVEODc5QTVBNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoyRkNDNzdEOUMyRDYxMUUyQjM0OEI1MTVEODc5QTVBNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PnXBGHQAAAblSURBVHja3FrLbxtFGP9mdh0/m0DSPFvnEKAHkBCNShEHWlB5nEigqgRcokogLlwR/AHcEDf4BxBXToEDV0JfqlAgQiJIVVtKuaQmzcOO7fgxw3yzO/Z4vC/DurU70mhm19/Ofr/v981vZndNIFohMFyFhxnYEYGSgACQAQLHo9oGASEefTKAWcCNPtfOmX1fxr2AUuOYhGTAwwDNPSoz7IgO3otBaoDWq35+kFKdGYD1agaC+zGuA7aMlnpkwMNm3Atw02iZybjtkdpEA2u5NrYRhEEEroNtuNVM9daxF+M624mJ/BNHnj679HEimV4ilOYHeg1j7G79sLL6+4+rX2zfvVn0mf9d4maCto/OPzX6zCvLn1944+yFN8+cgumJxwZ68d7a3s1/t/bzR99a1szm2vef3Lv9x66P8HkqdivNT7z42rv2SOr8+2+dG3jQWNBH9FX4/PaTL5x7R5uuXThpkLAls2MXv/z0A2nDOR+KigV9TmZGLxqi3KFJts/6LYGLOT01PpprDTgs5XHhs/B90oNthZHbHozrrHOmRRJLLpcbSLClUqktcm1/fZdfv3W8tUnhBvDkGIXTH87B0QWMKgFKCHDqXkScikfUHYFoozo22qqCfXds7tzMbZ0qG6ZMuGyVK3ieMQa7t+uw8XWhw0cDuOfSa4dsV+XgWPUVMZM8AodQlgpBETxWywGFLbXEpfK808cAoS22FnUAtwLiApSZxWSKOaCaXPYZHjdBtky1eE5c2xA/ZFMTAmihw0et77vFtkPXRoNxda64XwZqg2QcwUngCqxNOgJCXeDSjjoBIkQDzh1ADott4IwpwLx9rPWbzSaM8nGT5UiaFAocPIDLHKIaCOoAaQEkzhRQ51utBOyy7x7LsblLBYdWQIiaPu45OS5XyqNcI95g4wDeleoqZyynUhcwsk9UyrvpbVmKZYNxqqc6cfaTmObUbd2NJ2G8LR7INgag4USIEBUsbqa3p789A+9KdXG3cr0Ehb/uyXnWEjXaFrfOPoFUMgm1eq2lZ0ro9DnOuWKcQMJOQKV66GZbW+DMPsYlnxpzhS/mVDeBN2scXp1/D54/eRpS6ZT36w3NvlYXqvvrBjx38iTYmAIhpVwuw+bmJiwuLors0PJaWw1Ur9Gowy/rG7DBvoofOOOdqW5DEhZyz8Lri+elk0EPaFxcOzZ+BNLFo/Dy6TOwt10U/tPA+2WzWRir/QRnT70Eu//sC/CW74PZ6HgO9m4yMSVIZ6rzWFK9M4JUOM7EBCxW9qB0UArNFjtFoVI/gEqlArul+y6LAddYDag2ylCtVmHvYMfXHsdOZhNQa1Zl7DsZhz6Km0i9dDodegPlOLaZTKZzA+MxpiqWmBa92Mcubl7AMbqpVAqSQrRC30u7zqHtxMREKJBazRHBRCIRyZ4/KFXHmyEb169fB9uOsg3gcHBwAFeuXIm05240GnLfffXq1UgipWziV3UPxvF4ampKpmJYqQtVLxQKMDs7KwMWVlALdnZ2pH2YHmCQbt261cUy7wfjqn/s2DHJTFAqou3MzAzcuHED8vm8DECQPRZM7zt37kj7ra2tQHE7fvy4zIy+MG4uZ3q0sQYBweuQcXQEW6xBLKIdjqnsse9nr8b2FDfej52bNtfDUh2v60XV9RKm6ji2/lv8jMvHwG5Vx6UMlTrsJrqqj4yMhNqaqh5m763qfXhIUaqOKo2qHiW6qOpra2uRmMZHTdSOS5cuhS5LD3Q5UwPPz89L1sNSF+chqvTCwkKoquN9UNWLxaK0DxsbNQCF8L+kOo3KuKpq0MnJydA3nmg/PT0t0xxbZDPsDamyx+UyyB7HnpubawXH9LNvLyJ0p6KoNLZRHMJxFZtB9mrMvr2ICFL1fu7VUT96se+Dqvvv1bEG3UR3rFdVR+BBqq7G7p+4GW83kDkUqWvXrvW0V0eV7kXVL1++HHmvrqu78jn2VEenVlZWBu6DQhyp3vFV0dzArK+vD+SXFJ8NTNfnYS/g5h9lWJC4DXLR/GXg/UcgX8bZIwScRWWcLS0tFeR8BtgZZuACx9/Yrq6ujvoxztvX8P3l5eWK6KfVZqDeaMKQIe94t4GYhPKnday2R4rrpfrZNz8c/l8/xkdzctGt1WvypiMWdY4bTfe9EZPHI0nHt/v7pThSrGrqn8m4zvaOvofP3fttNg4CDreMYz87t83Gw/usjgWxCdZbKW8yrgo+8uC2KRXlQSZCUVu4VESW4mCcueNti3rCHLfjm7iICn4aScKjWQ4F4xmTcRWJP2NmWpVMj/blOPc2GvMtZff6L6vfP5YH5Y+7/o8V3S33Oe/7v3QYErBRgwB+czxMlIa1+IrkvwIMANKaPx47pbRTAAAAAElFTkSuQmCC\")}.chartIconImg{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAzCAYAAADPX7uaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDk0MUYxOEJDQzFFMTFFMkIxOUNERTUyRTI5MjFDNEYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDk0MUYxOENDQzFFMTFFMkIxOUNERTUyRTI5MjFDNEYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpEOTQxRjE4OUNDMUUxMUUyQjE5Q0RFNTJFMjkyMUM0RiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpEOTQxRjE4QUNDMUUxMUUyQjE5Q0RFNTJFMjkyMUM0RiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PpdyrHsAAAZISURBVHja3FpLbBtFGP5nd/1I/CCOm0AqUqRCKwQHJB6qgIioVBUnEkCV4MAhUgsHuCU8Du0hCXAAoRwAwYEeQJW4AAcCiuBSiebI4wDiIR4qEKQooYkdx3b83OGftXczO96x1/HGWXeiiXd2Znf/b77/NbNLwF0h0FuFthqguQRKmkwA8RE46nZsMyDE4Zj4UAuocEy5c+KxlHEnoIrQJi004CBAU4eqC+MID96JQUUAzVf+vJ9UXRcA81WcCCpjnAesCr+KgwYcNONOgKvCry4yrjmoNuHAqvUxmjAJfgTOg63Uq6jqVtuJcZ7tQHL01tgd4xMvBEJ9E0RRRn0dw3R9pVzcWfz568U3N1b+3JbYf4NzE0Frh44ci995cvKNM4+Mn3n0oXvhxuSAr4P32kZ69PMr3z7/iare9MuVL15av/prWuL4HD22pebH7z/9lBYMP3H2sVO+B80Kk5HJijI/ftuJU09y5tqAU2nm2EKRG6befvmcMYZS2hOVFSZzqD8+JThlm0/SJPHbAI42PTwYj1o37JWSQJlR9iEHtk2MVHNgnGed6txMshKLxXw5EdlsdtfJ7conDb+yOG4lKVQAHo1GYXZ21leg5+fnbTIKwB1Dr9YiXQVd141qlmq1avxOT0/7AvTCwgJUKhWbjNyxNMXWWsZGgXF+AlZXV10J9/HYFFS38xBAAnAa4cH3zsPhB+7qGPTIyEgNDSEyxttelvLIO7bp0rU0DOd0OEbisAFlqJRK3icvvIxeABdVXSyKorTexVBVI5sk9T92jZvrWsklazeTt2NVZ0VFQEzN3BcEjeOJQjoGLj7Xc1UXgfPHTHhXwAnnYikTunPGRZk8B65Tuaq7ZdxyqZQw1AZo1VB/74DbVJ16our2h/BAeeDr2Txm/7vjIsEgRIMB+64BqU2Cug/A7W3w3rnxKsoLf987lyDDHhgI4V1VePGe2+HC+Am7I6TMxhVPbFy0d8+dmyyBEYEHNLxV/BAukQ4DGRjAmJ3i+ond1hW1Y8ZF9rvu1W2GjA8kODFErwDRGtVZoYrh1U1V38ptwoeX37Jtkpw9PQORcKxj1e8cuN7cuYkOjBoJYi1sWf2kBoyP46wvW8zAp99chEACIDmYgNQ/OXj65HMQV9tf+/My0v1m3NlOCesw7M7st7y64dzY+VqfpgWMHQGtHxc/yTBsrxVwQrQ92X9Xw5ldQM6OERgP3BYhMJCbcVypRwRaZSzVtN3M6kr5ImTW07ZnDR4ZcpWteRTO5IxLY7jJNLFv29P6HztvVuC0gdY1gp3/6avv4KNn34UgihgO90GOFOD1lQ+6yLhOXXlJGwLirKo6YWszKs9yuHkiGBKjpA+SJAY3D90CPxR+d23jTOZ9X6Q4AlBA/kqPSE6Txi6mHVVU2yqtQLMXoPsSx+lelqWkUU4j2uFJJ8YJNMWF86gcgHMTGG+ZeFTxocUyQLCRWubYKDizQZtgJ9YOUhcTmPY3ImgNfJvgZJ2mGXR9I6KtJR+mogTjMGHpqzAOe4ytJ1VEwWxbZZcq0NiFSRBeE1b78T85WFU3c3VR5a9lcwY8SstA0+uQPTps9e2ktzFz1+A3yEBer8JRZgqGVeC98bCUwtVddQuK+RJeX3tWpVCGAi3BJl7zR/oqpLdS0sxxL6rObyWbb0WDWHGJBeGHz53//tVnJhORcMi6YGxszHfby3Nzc7C8vGy1c4UiXHj/s9Tli6/djc0C1iLb+oPdt6h626oeiURgZmbGV8ATiYQnqm57qygmMEtLS+DHIklgqMxtahK/an06QT3YXu524eTVwflDICnj+nUEXHfLuD4xMfEfO5EFSPUycMTxL/tdXFyMyxinu9fQzOTk5A4e95nJQLlShR5Dzrd2GCbM5/t4rJqDivOl8MqlL4udyjEYjxrZR6lcMh4aVJVau1JP8ahutIOhmmybmawXKlYQ/Z/IOM92yloXYImu/zjiBQHFNaEtG2eGTG94H+GxMGzIuqXyIuNm+RtrkiUxAODFPrCZb4ZdsuQF43r9fhtYj4v3tb0Tx1nJ17O267EUkfF+kXFzJv7ymGmz9Lc5Pu9lbsMxb3l2p29ZZV8s++XD3WYLWwDnD3sb+mXfpUOPgHU7CSCz8VZOqVeL1En+L8AAjJTPo0iRABoAAAAASUVORK5CYII=\")}"]
925
+ },] }
926
+ ];
927
+ ChartheaderComponent.ctorParameters = function () { return [
928
+ { type: PrincipalDashboardLibV2Service }
929
+ ]; };
930
+
931
+ /*! *****************************************************************************
932
+ Copyright (c) Microsoft Corporation.
933
+
934
+ Permission to use, copy, modify, and/or distribute this software for any
935
+ purpose with or without fee is hereby granted.
936
+
937
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
938
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
939
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
940
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
941
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
942
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
943
+ PERFORMANCE OF THIS SOFTWARE.
944
+ ***************************************************************************** */
945
+ /* global Reflect, Promise */
946
+ var extendStatics = function (d, b) {
947
+ extendStatics = Object.setPrototypeOf ||
948
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
949
+ function (d, b) { for (var p in b)
950
+ if (Object.prototype.hasOwnProperty.call(b, p))
951
+ d[p] = b[p]; };
952
+ return extendStatics(d, b);
953
+ };
954
+ function __extends(d, b) {
955
+ if (typeof b !== "function" && b !== null)
956
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
957
+ extendStatics(d, b);
958
+ function __() { this.constructor = d; }
959
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
960
+ }
961
+ var __assign = function () {
962
+ __assign = Object.assign || function __assign(t) {
963
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
964
+ s = arguments[i];
965
+ for (var p in s)
966
+ if (Object.prototype.hasOwnProperty.call(s, p))
967
+ t[p] = s[p];
968
+ }
969
+ return t;
970
+ };
971
+ return __assign.apply(this, arguments);
972
+ };
973
+ function __rest(s, e) {
974
+ var t = {};
975
+ for (var p in s)
976
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
977
+ t[p] = s[p];
978
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
979
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
980
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
981
+ t[p[i]] = s[p[i]];
982
+ }
983
+ return t;
984
+ }
985
+ function __decorate(decorators, target, key, desc) {
986
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
987
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
988
+ r = Reflect.decorate(decorators, target, key, desc);
989
+ else
990
+ for (var i = decorators.length - 1; i >= 0; i--)
991
+ if (d = decorators[i])
992
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
993
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
994
+ }
995
+ function __param(paramIndex, decorator) {
996
+ return function (target, key) { decorator(target, key, paramIndex); };
997
+ }
998
+ function __metadata(metadataKey, metadataValue) {
999
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
1000
+ return Reflect.metadata(metadataKey, metadataValue);
1001
+ }
1002
+ function __awaiter(thisArg, _arguments, P, generator) {
1003
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1004
+ return new (P || (P = Promise))(function (resolve, reject) {
1005
+ function fulfilled(value) { try {
1006
+ step(generator.next(value));
1007
+ }
1008
+ catch (e) {
1009
+ reject(e);
1010
+ } }
1011
+ function rejected(value) { try {
1012
+ step(generator["throw"](value));
1013
+ }
1014
+ catch (e) {
1015
+ reject(e);
1016
+ } }
1017
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1018
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1019
+ });
1020
+ }
1021
+ function __generator(thisArg, body) {
1022
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
1023
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
1024
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
1025
+ function verb(n) { return function (v) { return step([n, v]); }; }
1026
+ function step(op) {
1027
+ if (f)
1028
+ throw new TypeError("Generator is already executing.");
1029
+ while (_)
1030
+ try {
1031
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
1032
+ return t;
1033
+ if (y = 0, t)
1034
+ op = [op[0] & 2, t.value];
1035
+ switch (op[0]) {
1036
+ case 0:
1037
+ case 1:
1038
+ t = op;
1039
+ break;
1040
+ case 4:
1041
+ _.label++;
1042
+ return { value: op[1], done: false };
1043
+ case 5:
1044
+ _.label++;
1045
+ y = op[1];
1046
+ op = [0];
1047
+ continue;
1048
+ case 7:
1049
+ op = _.ops.pop();
1050
+ _.trys.pop();
1051
+ continue;
1052
+ default:
1053
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
1054
+ _ = 0;
1055
+ continue;
1056
+ }
1057
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
1058
+ _.label = op[1];
1059
+ break;
1060
+ }
1061
+ if (op[0] === 6 && _.label < t[1]) {
1062
+ _.label = t[1];
1063
+ t = op;
1064
+ break;
1065
+ }
1066
+ if (t && _.label < t[2]) {
1067
+ _.label = t[2];
1068
+ _.ops.push(op);
1069
+ break;
1070
+ }
1071
+ if (t[2])
1072
+ _.ops.pop();
1073
+ _.trys.pop();
1074
+ continue;
1075
+ }
1076
+ op = body.call(thisArg, _);
1077
+ }
1078
+ catch (e) {
1079
+ op = [6, e];
1080
+ y = 0;
1081
+ }
1082
+ finally {
1083
+ f = t = 0;
1084
+ }
1085
+ if (op[0] & 5)
1086
+ throw op[1];
1087
+ return { value: op[0] ? op[1] : void 0, done: true };
1088
+ }
1089
+ }
1090
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
1091
+ if (k2 === undefined)
1092
+ k2 = k;
1093
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
1094
+ }) : (function (o, m, k, k2) {
1095
+ if (k2 === undefined)
1096
+ k2 = k;
1097
+ o[k2] = m[k];
1098
+ });
1099
+ function __exportStar(m, o) {
1100
+ for (var p in m)
1101
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
1102
+ __createBinding(o, m, p);
1103
+ }
1104
+ function __values(o) {
1105
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
1106
+ if (m)
1107
+ return m.call(o);
1108
+ if (o && typeof o.length === "number")
1109
+ return {
1110
+ next: function () {
1111
+ if (o && i >= o.length)
1112
+ o = void 0;
1113
+ return { value: o && o[i++], done: !o };
1114
+ }
1115
+ };
1116
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
1117
+ }
1118
+ function __read(o, n) {
1119
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
1120
+ if (!m)
1121
+ return o;
1122
+ var i = m.call(o), r, ar = [], e;
1123
+ try {
1124
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
1125
+ ar.push(r.value);
1126
+ }
1127
+ catch (error) {
1128
+ e = { error: error };
1129
+ }
1130
+ finally {
1131
+ try {
1132
+ if (r && !r.done && (m = i["return"]))
1133
+ m.call(i);
1134
+ }
1135
+ finally {
1136
+ if (e)
1137
+ throw e.error;
1138
+ }
1139
+ }
1140
+ return ar;
1141
+ }
1142
+ /** @deprecated */
1143
+ function __spread() {
1144
+ for (var ar = [], i = 0; i < arguments.length; i++)
1145
+ ar = ar.concat(__read(arguments[i]));
1146
+ return ar;
1147
+ }
1148
+ /** @deprecated */
1149
+ function __spreadArrays() {
1150
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
1151
+ s += arguments[i].length;
1152
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
1153
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1154
+ r[k] = a[j];
1155
+ return r;
1156
+ }
1157
+ function __spreadArray(to, from, pack) {
1158
+ if (pack || arguments.length === 2)
1159
+ for (var i = 0, l = from.length, ar; i < l; i++) {
1160
+ if (ar || !(i in from)) {
1161
+ if (!ar)
1162
+ ar = Array.prototype.slice.call(from, 0, i);
1163
+ ar[i] = from[i];
1164
+ }
1165
+ }
1166
+ return to.concat(ar || from);
1167
+ }
1168
+ function __await(v) {
1169
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
1170
+ }
1171
+ function __asyncGenerator(thisArg, _arguments, generator) {
1172
+ if (!Symbol.asyncIterator)
1173
+ throw new TypeError("Symbol.asyncIterator is not defined.");
1174
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
1175
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
1176
+ function verb(n) { if (g[n])
1177
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
1178
+ function resume(n, v) { try {
1179
+ step(g[n](v));
1180
+ }
1181
+ catch (e) {
1182
+ settle(q[0][3], e);
1183
+ } }
1184
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1185
+ function fulfill(value) { resume("next", value); }
1186
+ function reject(value) { resume("throw", value); }
1187
+ function settle(f, v) { if (f(v), q.shift(), q.length)
1188
+ resume(q[0][0], q[0][1]); }
1189
+ }
1190
+ function __asyncDelegator(o) {
1191
+ var i, p;
1192
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
1193
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
1194
+ }
1195
+ function __asyncValues(o) {
1196
+ if (!Symbol.asyncIterator)
1197
+ throw new TypeError("Symbol.asyncIterator is not defined.");
1198
+ var m = o[Symbol.asyncIterator], i;
1199
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
1200
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
1201
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
1202
+ }
1203
+ function __makeTemplateObject(cooked, raw) {
1204
+ if (Object.defineProperty) {
1205
+ Object.defineProperty(cooked, "raw", { value: raw });
1206
+ }
1207
+ else {
1208
+ cooked.raw = raw;
1209
+ }
1210
+ return cooked;
1211
+ }
1212
+ ;
1213
+ var __setModuleDefault = Object.create ? (function (o, v) {
1214
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1215
+ }) : function (o, v) {
1216
+ o["default"] = v;
1217
+ };
1218
+ function __importStar(mod) {
1219
+ if (mod && mod.__esModule)
1220
+ return mod;
1221
+ var result = {};
1222
+ if (mod != null)
1223
+ for (var k in mod)
1224
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
1225
+ __createBinding(result, mod, k);
1226
+ __setModuleDefault(result, mod);
1227
+ return result;
1228
+ }
1229
+ function __importDefault(mod) {
1230
+ return (mod && mod.__esModule) ? mod : { default: mod };
1231
+ }
1232
+ function __classPrivateFieldGet(receiver, state, kind, f) {
1233
+ if (kind === "a" && !f)
1234
+ throw new TypeError("Private accessor was defined without a getter");
1235
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1236
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
1237
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1238
+ }
1239
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
1240
+ if (kind === "m")
1241
+ throw new TypeError("Private method is not writable");
1242
+ if (kind === "a" && !f)
1243
+ throw new TypeError("Private accessor was defined without a setter");
1244
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1245
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
1246
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1247
+ }
1248
+
1249
+ var ChartviewComponent = /** @class */ (function () {
1250
+ function ChartviewComponent(pdService) {
1251
+ this.pdService = pdService;
1252
+ this.totalUsers = 0;
1253
+ this.eligibleUsers = 0;
1254
+ this.currentUsers = 0;
1255
+ this.myChartType = angularGoogleCharts.ChartType.Timeline;
1256
+ this.myChartwidth = window.innerWidth * 0.88;
1257
+ this.myChartHeight = window.innerHeight;
1258
+ this.currentList = "Current Users";
1259
+ this.allList = "All Users";
1260
+ this.isAllUsers = false;
1261
+ this.isUserWise = false;
1262
+ this.myChartDataMatrix = new Array();
1263
+ this.totalChartDataMatrix = new Array();
1264
+ }
1265
+ Object.defineProperty(ChartviewComponent.prototype, "data", {
1266
+ set: function (res) {
1267
+ if (res !== null) {
1268
+ this.loadChart(res);
1269
+ }
1270
+ },
1271
+ enumerable: false,
1272
+ configurable: true
1273
+ });
1274
+ ChartviewComponent.prototype.ngOnInit = function () { };
1275
+ ChartviewComponent.prototype.loadChart = function (response) {
1276
+ var _this = this;
1277
+ //console.log(' INloadChart -->', response);
1278
+ this.totalUsers = 0;
1279
+ this.eligibleUsers = 0;
1280
+ this.currentUsers = 0;
1281
+ this.myChartType = angularGoogleCharts.ChartType.Timeline;
1282
+ this.myChartwidth = window.innerWidth * 0.88;
1283
+ this.myChartHeight = window.innerHeight;
1284
+ this.currentList = "Current Users";
1285
+ this.allList = "All Users";
1286
+ this.isAllUsers = false;
1287
+ this.isUserWise = false;
1288
+ this.myChartDataMatrix = [];
1289
+ this.totalChartDataMatrix = [];
1290
+ this.chartview = document.getElementById('pd-chartview');
1291
+ this.myDataList = document.getElementById('pd-xmlData');
1292
+ // let parse = new DOMParser();
1293
+ if (response) {
1294
+ this.myXmlData = JSON.parse(response);
1295
+ }
1296
+ if (this.myXmlData) {
1297
+ this.currentdataList = this.pdService.genarateUserReqiuredData(this.myXmlData);
1298
+ this.alluserList = this.pdService.allUserChartData();
1299
+ this.resourceDataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
1300
+ this.totalUsers = this.currentdataList.usersMetadata.length;
1301
+ this.eligibleUsers = this.findEligibleUserCount();
1302
+ this.installedClassrooms = this.findInstalledClassrooms();
1303
+ this.currentRooms = this.findCurrentClassrooms();
1304
+ this.findCurrentUserCount();
1305
+ }
1306
+ this.pdService.chartType.subscribe(function (data) {
1307
+ if (data) {
1308
+ _this.updateChartType(data);
1309
+ }
1310
+ });
1311
+ this.pdService.isUserWise_data.subscribe(function (data) {
1312
+ _this.updateDataType(data);
1313
+ });
1314
+ window.addEventListener('resize', this.onResizeWindow.bind(this));
1315
+ };
1316
+ ChartviewComponent.prototype.onResizeWindow = function (event) {
1317
+ this.myChartwidth = window.innerWidth * 0.88; //set an appropriate factor
1318
+ };
1319
+ ChartviewComponent.prototype.myChartReady = function () {
1320
+ this.createDivforTotalDurartion();
1321
+ this.setHeightofDivforTotalDurartion();
1322
+ // this.removeBlankEntryBar();
1323
+ };
1324
+ ChartviewComponent.prototype.updateChartType = function (dataType) {
1325
+ if (this.chartview != null && this.chartview != undefined) {
1326
+ if (dataType == angularGoogleCharts.ChartType.Table) {
1327
+ this.chartview.style.display = 'none';
1328
+ }
1329
+ else {
1330
+ this.chartview.style.display = 'block';
1331
+ }
1332
+ }
1333
+ };
1334
+ ChartviewComponent.prototype.updateDataType = function (dataType) {
1335
+ this.isUserWise = dataType;
1336
+ if (this.myXmlData) {
1337
+ if (this.isUserWise) {
1338
+ this.currentList = "Current Users";
1339
+ this.allList = "All Users";
1340
+ if (this.isAllUsers) {
1341
+ this.userWiseAllData();
1342
+ }
1343
+ else {
1344
+ this.userWiseCurrentData();
1345
+ }
1346
+ }
1347
+ else {
1348
+ this.allList = "All Rooms";
1349
+ this.currentList = "Current Rooms";
1350
+ if (this.isAllUsers) {
1351
+ this.classRoomWiseAllData();
1352
+ }
1353
+ else {
1354
+ this.classRoomWiseCurrentData();
1355
+ }
1356
+ }
1357
+ }
1358
+ };
1359
+ ChartviewComponent.prototype.updateChart = function () {
1360
+ var _this = this;
1361
+ var labels = document.getElementById('labels');
1362
+ while (labels.firstChild) {
1363
+ labels.removeChild(labels.lastChild);
1364
+ }
1365
+ this.chartDataTable = this.myChartDataMatrix;
1366
+ //const filteredData = this.myChartDataMatrix.filter(node => node[0] !== "-");
1367
+ /*
1368
+ if(filteredData.length>0){
1369
+ this.chartDataTable = filteredData;
1370
+ }else{
1371
+ this.chartDataTable = this.myChartDataMatrix;
1372
+ }*/
1373
+ //console.log("this.myChartDataMatrix",this.myChartDataMatrix);
1374
+ (this.myChartOptions = {
1375
+ tooltip: {
1376
+ trigger: 'none',
1377
+ },
1378
+ colors: ['#ff7f0e', '#2ca02c', '#8c564b', '#d62728', '#bcbd22', '#17becf'],
1379
+ timeline: {
1380
+ colorByRowLabel: true,
1381
+ barLabelStyle: {
1382
+ fontSize: 7,
1383
+ },
1384
+ },
1385
+ hAxis: {
1386
+ format: 'HH:mm a',
1387
+ },
1388
+ });
1389
+ setTimeout(function () {
1390
+ _this.myChartHeight = _this.AllrowHeight + 100; //to set perfect height of chart
1391
+ }, 1000);
1392
+ };
1393
+ ChartviewComponent.prototype.filterUserHasDash = function (callee) {
1394
+ var leftData = this.myChartDataMatrix;
1395
+ var rightData = this.currentdataList.userConsoleData;
1396
+ var updatedChartData = leftData.filter(function (row) { return row[0] !== "-"; });
1397
+ // Filter out objects in rightData where the userName is "-"
1398
+ var updatedRightData = rightData.filter(function (item) { return item.userName !== "-"; });
1399
+ return {
1400
+ updatedChartData: updatedChartData,
1401
+ updatedRightData: updatedRightData
1402
+ };
1403
+ };
1404
+ ChartviewComponent.prototype.calulateTotalDuration = function (detailViewMatrix) {
1405
+ //
1406
+ //const filteredData = detailViewMatrix.filter(item => item.userName !== "-" && item.userName !== "--");
1407
+ //detailViewMatrix = filteredData;
1408
+ var id_durationArray;
1409
+ var id_durationMatrix = new Array();
1410
+ id_durationMatrix = [];
1411
+ this.totalChartDataMatrix = [];
1412
+ if (this.isUserWise) {
1413
+ for (var i = 0; i < detailViewMatrix.length; i++) {
1414
+ id_durationArray = {
1415
+ name: detailViewMatrix[i].userName,
1416
+ value: parseInt(detailViewMatrix[i].duration),
1417
+ };
1418
+ id_durationMatrix.push(id_durationArray);
1419
+ }
1420
+ }
1421
+ else {
1422
+ for (var i = 0; i < detailViewMatrix.length; i++) {
1423
+ // console.log("detailViewMatrix[i]",detailViewMatrix[i]);
1424
+ id_durationArray = {
1425
+ name: detailViewMatrix[i].terminalIP,
1426
+ value: parseInt(detailViewMatrix[i].duration),
1427
+ };
1428
+ id_durationMatrix.push(id_durationArray);
1429
+ }
1430
+ }
1431
+ var obj = {};
1432
+ id_durationMatrix = __spread(new Set(id_durationMatrix));
1433
+ id_durationMatrix.forEach(function (item) {
1434
+ if (obj[item.name]) {
1435
+ obj[item.name].value = obj[item.name].value + item.value;
1436
+ }
1437
+ else {
1438
+ obj[item.name] = item;
1439
+ }
1440
+ });
1441
+ var valuesArr = Object.values(obj);
1442
+ var myArray = new Array();
1443
+ myArray = [];
1444
+ valuesArr.forEach(function (item) {
1445
+ myArray.push(item.value);
1446
+ });
1447
+ for (var i = 0; i < myArray.length; i++) {
1448
+ var totaldurationPerRow = [this.timeConvert(myArray[i]).toString() + ' hrs'];
1449
+ // let totalChartRowDataArray = [totaldurationPerRow];
1450
+ this.totalChartDataMatrix.push(totaldurationPerRow);
1451
+ }
1452
+ };
1453
+ ChartviewComponent.prototype.timeConvert = function (n) {
1454
+ var num = Math.floor(n);
1455
+ var hours = num / 60;
1456
+ var rhours = Math.floor(hours);
1457
+ var minutes = (hours - rhours) * 60;
1458
+ var rminutes = Math.round(minutes);
1459
+ return rhours + ':' + rminutes;
1460
+ };
1461
+ ChartviewComponent.prototype.removeBlankEntryBar = function () {
1462
+ var chartDiv = document.getElementById('myTimeLine');
1463
+ var el = chartDiv.getElementsByTagName("rect"); //get all the descendant rect element inside the container
1464
+ var width = 100000000; //set a large initial value to width
1465
+ var elToRem = []; //element would be added to this array for removal
1466
+ for (var i = 0; i < el.length; i++) { //looping over all the rect element of container
1467
+ var cwidth = parseInt(el[i].getAttribute("width")); //getting the width of ith element
1468
+ if (cwidth < width) { //if current element width is less than previous width then this is min. width and ith element should be removed
1469
+ elToRem = [el[i]];
1470
+ width = cwidth; //setting the width with min width
1471
+ }
1472
+ else if (cwidth == width) { //if current element width is equal to previous width then more that one element would be removed
1473
+ elToRem.push(el[i]);
1474
+ }
1475
+ }
1476
+ for (var i = 0; i < elToRem.length; i++) {
1477
+ // now iterate JUST the elements to remove
1478
+ elToRem[i].setAttribute("fill", "none");
1479
+ }
1480
+ };
1481
+ ChartviewComponent.prototype.createDivforTotalDurartion = function () {
1482
+ var rowLabels = [];
1483
+ this.rowElements = [];
1484
+ var labels = document.getElementById('labels');
1485
+ while (labels.firstChild) {
1486
+ labels.removeChild(labels.lastChild);
1487
+ }
1488
+ for (var i = 0; i < this.totalChartDataMatrix.length; i++) {
1489
+ var team = this.totalChartDataMatrix[i][0];
1490
+ rowLabels.push(team);
1491
+ var label = labels.appendChild(document.createElement('div'));
1492
+ label.style['border-bottom'] = '1px solid #b7b7b7';
1493
+ label.style['font-family'] = 'Arial';
1494
+ label.style['font-size'] = '13px';
1495
+ label.style['text-align'] = 'left';
1496
+ label.style['padding-left'] = '8px';
1497
+ label.style['padding-right'] = '8px';
1498
+ label.style.position = 'inherit';
1499
+ if (i % 2) {
1500
+ label.style['background-color'] = '#e6e6e6';
1501
+ }
1502
+ else {
1503
+ label.style['background-color'] = '#ffffff';
1504
+ }
1505
+ label.innerHTML = team;
1506
+ this.rowElements.push(label);
1507
+ }
1508
+ };
1509
+ ChartviewComponent.prototype.setHeightofDivforTotalDurartion = function () {
1510
+ this.AllrowHeight = 0;
1511
+ var chartDiv = document.getElementById('myTimeLine');
1512
+ var rows = chartDiv.getElementsByTagName('rect');
1513
+ var rowIndex = -1;
1514
+ for (var i = 0; i < rows.length; i++) {
1515
+ rowIndex++;
1516
+ if (rowIndex < this.rowElements.length) {
1517
+ var rowHeight = parseFloat(rows[i].getAttribute('height')) + 'px';
1518
+ this.AllrowHeight += parseFloat(rows[i].getAttribute('height'));
1519
+ var currentCell = this.rowElements[rowIndex];
1520
+ if (currentCell) {
1521
+ currentCell.style.height = rowHeight;
1522
+ currentCell.style.lineHeight = rowHeight;
1523
+ }
1524
+ }
1525
+ }
1526
+ };
1527
+ ChartviewComponent.prototype.onSelectRowData = function (event) {
1528
+ var _a = event.selection[0], row = _a.row, column = _a.column;
1529
+ if (this.isAllUsers) {
1530
+ this.selectedUserData = this.pdService.dataForDetailedView(this.alluserList.fordurationTable, this.resourceDataList, row);
1531
+ }
1532
+ else {
1533
+ this.selectedUserData = this.pdService.dataForDetailedView(this.currentdataList.userConsoleData, this.resourceDataList, row);
1534
+ }
1535
+ var smallData = [{ 'a': this.currentdataList, 'b': row }];
1536
+ // console.log("this.selectedUserData",this.selectedUserData);
1537
+ this.pdService.detailedviewData.next(this.selectedUserData);
1538
+ this.updateChart();
1539
+ this.pdService.openSmallTable.next(this.selectedUserData);
1540
+ // alluserList
1541
+ };
1542
+ ChartviewComponent.prototype.showAllUser = function () {
1543
+ this.pdService.isAllUsers.next(true);
1544
+ this.isAllUsers = true;
1545
+ if (this.isUserWise) {
1546
+ this.userWiseAllData();
1547
+ }
1548
+ else {
1549
+ this.classRoomWiseAllData();
1550
+ }
1551
+ };
1552
+ ChartviewComponent.prototype.showCurrentUser = function () {
1553
+ this.isAllUsers = false;
1554
+ this.pdService.isAllUsers.next(false);
1555
+ if (this.isUserWise) {
1556
+ this.userWiseCurrentData();
1557
+ }
1558
+ else {
1559
+ this.classRoomWiseCurrentData();
1560
+ }
1561
+ };
1562
+ ChartviewComponent.prototype.userWiseCurrentData = function () {
1563
+ var chartDataUserWise = this.pdService.userWiseChartData();
1564
+ // console.log("chartDataUserWise",chartDataUserWise);
1565
+ if (chartDataUserWise.length > 0) {
1566
+ this.myChartDataMatrix = chartDataUserWise;
1567
+ this.updateChart();
1568
+ if (this.currentdataList.userConsoleData.length > 0) {
1569
+ this.calulateTotalDuration(this.currentdataList.userConsoleData);
1570
+ }
1571
+ }
1572
+ };
1573
+ ChartviewComponent.prototype.userWiseAllData = function () {
1574
+ var chartDataUserWise = this.alluserList.forChartData;
1575
+ if (chartDataUserWise.length > 0) {
1576
+ this.myChartDataMatrix = chartDataUserWise;
1577
+ this.updateChart();
1578
+ this.calulateTotalDuration(this.alluserList.fordurationTable);
1579
+ }
1580
+ };
1581
+ ChartviewComponent.prototype.classRoomWiseCurrentData = function () {
1582
+ var classRoomdata = this.pdService.classRoomWiseChartData();
1583
+ console.log("classRoomdata", classRoomdata);
1584
+ if (classRoomdata && classRoomdata.length > 0) {
1585
+ this.myChartDataMatrix = classRoomdata;
1586
+ console.log("myChartDataMatrix", this.myChartDataMatrix);
1587
+ this.updateChart();
1588
+ if (this.currentdataList.userConsoleData.length > 0) {
1589
+ this.calulateTotalDuration(this.currentdataList.userConsoleData);
1590
+ }
1591
+ }
1592
+ };
1593
+ ChartviewComponent.prototype.classRoomWiseAllData = function () {
1594
+ var allclassRoomList = this.pdService.allRoomsData();
1595
+ if (allclassRoomList.forChartData && allclassRoomList.forChartData.length > 0) {
1596
+ this.myChartDataMatrix = allclassRoomList.forChartData;
1597
+ this.updateChart();
1598
+ }
1599
+ if (allclassRoomList.fordurationTable && allclassRoomList.fordurationTable.length > 0) {
1600
+ this.calulateTotalDuration(allclassRoomList.fordurationTable);
1601
+ }
1602
+ };
1603
+ ChartviewComponent.prototype.findCurrentUserCount = function () {
1604
+ var userConsoleData = this.currentdataList.userConsoleData;
1605
+ var userNameArray = new Array();
1606
+ for (var index = 0; index < userConsoleData.length; index++) {
1607
+ var element = userConsoleData[index].userName;
1608
+ userNameArray.push(element);
1609
+ }
1610
+ var uniqueUserName = __spread(new Set(userNameArray));
1611
+ this.currentUsers = uniqueUserName.length;
1612
+ };
1613
+ ChartviewComponent.prototype.findCurrentClassrooms = function () {
1614
+ //console.log("findCurrentClassrooms", this.currentdataList.schoolTerminalData)
1615
+ var classRoomdata = this.pdService.newGetCurrentClassroomData();
1616
+ // console.log("findCurrentClassrooms",classRoomdata);
1617
+ return classRoomdata.length;
1618
+ };
1619
+ ChartviewComponent.prototype.findInstalledClassrooms = function () {
1620
+ var count = 0;
1621
+ // console.log("findInstalledClassrooms", this.currentdataList.schoolTerminalData)
1622
+ return this.currentdataList.schoolTerminalData.length;
1623
+ };
1624
+ ChartviewComponent.prototype.findEligibleUserCount = function () {
1625
+ // console.log("findEligibleUserCount", this.currentdataList)
1626
+ var count = 0;
1627
+ var userMetaData = this.currentdataList.usersMetadata;
1628
+ for (var index = 0; index < userMetaData.length; index++) {
1629
+ var element = userMetaData[index].userSubjects;
1630
+ if (element !== "") {
1631
+ // console.log("findEligibleUserCount", element)
1632
+ count = count + 1;
1633
+ }
1634
+ }
1635
+ return count;
1636
+ };
1637
+ ChartviewComponent.prototype.ngOnDestroy = function () {
1638
+ // console.log('ngOnDestroy >>');
1639
+ };
1640
+ return ChartviewComponent;
1641
+ }());
1642
+ ChartviewComponent.decorators = [
1643
+ { type: i0.Component, args: [{
1644
+ selector: 'lib-chartview',
1645
+ template: "<div id=\"pd-chartview-main-container\" class=\"pd-chartview-main-container\">\n <div id=\"userSummary\">\n <table class=\"summaryTable\">\n <tbody>\n <tr>\n <td id=\"totalUsers\" class=\"chartview-navigationbar\">\n Total users: {{totalUsers}}\n </td>\n <td id=\"eligibleUsers\" class=\"chartview-navigationbar\">\n Eligible users: {{eligibleUsers}}\n </td>\n <td id=\"currentUsers\" class=\"chartview-navigationbar\">\n Current users: {{currentUsers}}\n </td>\n <td id=\"totalRooms\" class=\"chartview-navigationbar\">\n Installed Classrooms: {{installedClassrooms}}\n </td>\n <td id=\"currentRooms\" class=\"chartview-navigationbar\">\n Current Classrooms: {{currentRooms}}\n </td>\n <!-- <td\n id=\"currentRooms\"\n \n >\n <span id=\"totalUsers_list\" class=\"activeAll\">User List</span>\n </td> -->\n </tr>\n </tbody>\n </table>\n </div>\n <div id=\"pd-messageDivContainer\" class='pd-messageDivContainer'>\n <div id=\"pd-messageDiv\" class='pd-messageDiv'>Click the bars to view details of content accessed by a teacher.</div>\n <div id=\"pd-toggleContainer\" class=\"pd-toggleContainer\">\n \n <div id=\"pd-currentUserBtn\" class=\"pd-currentUserBtn-div pd-commonStyleBtn\" (click)=\"showCurrentUser()\" [ngStyle]=\"{ color: isAllUsers ? '#000000' : '#ffffff' , backgroundColor: isAllUsers ? '#c4c4c4' : '#000000'}\">\n {{currentList}}</div>\n <div id=\"pd-allUserBtn\" class=\"pd-allUserBtn-div pd-commonStyleBtn\" (click)=\"showAllUser()\" [ngStyle]=\"{ color: isAllUsers ? '#ffffff' : '#000000' , backgroundColor: isAllUsers ? '#000000' : '#c4c4c4'}\">\n {{allList}}</div>\n </div>\n </div>\n <div id=\"pd-chartview\" class=\"pd-chartview\">\n <div id=\"myChartDiv\">\n <div id=\"myTimeLine\">\n <google-chart\n [type]=\"myChartType\"\n [data]=\"chartDataTable\"\n [options]=\"myChartOptions\"\n [width]=\"myChartwidth\"\n [height]=\"myChartHeight\"\n (select)=\"onSelectRowData($event)\"\n (ready)=\"myChartReady()\"\n > \n </google-chart>\n \n </div>\n <div class=\"inline babloo\" id=\"labels\"></div> \n \n \n </div>\n</div>\n",
1646
+ 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}"]
1647
+ },] }
1648
+ ];
1649
+ ChartviewComponent.ctorParameters = function () { return [
1650
+ { type: PrincipalDashboardLibV2Service }
1651
+ ]; };
1652
+ ChartviewComponent.propDecorators = {
1653
+ data: [{ type: i0.Input }]
1654
+ };
1655
+
1656
+ var DetailedviewComponent = /** @class */ (function () {
1657
+ function DetailedviewComponent(pdService) {
1658
+ this.pdService = pdService;
1659
+ this.userMetadataHeadingArray = [
1660
+ 'Name:',
1661
+ 'Start Time:',
1662
+ 'Subject:',
1663
+ 'End Time:',
1664
+ 'Room Details:',
1665
+ ];
1666
+ this.resourseMetadataHeadingArray = [
1667
+ 'Subject',
1668
+ 'Class',
1669
+ 'Chapter Name',
1670
+ 'Topic Name',
1671
+ 'Assets Details',
1672
+ ];
1673
+ }
1674
+ DetailedviewComponent.prototype.ngOnInit = function () {
1675
+ var _this = this;
1676
+ this.deatilViewContainer = document.getElementById('pd-deatilViewContainer');
1677
+ this.deatilViewTable = document.getElementById('pd-deatilViewTable');
1678
+ this.closeButton = document.getElementById('pd-closeButton');
1679
+ this.pdService.detailedviewData.subscribe(function (data) {
1680
+ if (data) {
1681
+ if (data.userDetails.length > 0) {
1682
+ _this.createTable(data.userDetails);
1683
+ }
1684
+ if (data.resourceDetails.length > 0) {
1685
+ data.resourceDetails = _this.replaceLabelChapterAndTopic(data.resourceDetails);
1686
+ _this.createResourcesTable(data.resourceDetails);
1687
+ //console.log("11dec resourceDetails",data.resourceDetails);
1688
+ }
1689
+ }
1690
+ });
1691
+ this.deatilViewContainer.style.display = 'none';
1692
+ };
1693
+ DetailedviewComponent.prototype.replaceLabelChapterAndTopic = function (data) {
1694
+ var htmlStr = "<span style='font-style: italic;color: #3F51B5;'>(seen)</span>";
1695
+ return data.map(function (row) {
1696
+ return row.map(function (cell) {
1697
+ if (cell.includes("Topic:")) {
1698
+ return cell.replace(/Topic: .*/, "Topic " + htmlStr);
1699
+ }
1700
+ if (cell.includes("Chapter:")) {
1701
+ return cell.replace(/Chapter: .*/, "Chapter " + htmlStr);
1702
+ }
1703
+ return cell;
1704
+ });
1705
+ });
1706
+ };
1707
+ DetailedviewComponent.prototype.replaceLabelChapterAndTopic1 = function (data) {
1708
+ var htmlStr = "<span style='font-style: italic;color: #3F51B5;'>(selected)</span>";
1709
+ return data.map(function (row) {
1710
+ return row.map(function (cell) {
1711
+ if (cell.includes("Topic: :")) {
1712
+ return cell.replace(/Topic: :.*$/, "Topic " + htmlStr);
1713
+ }
1714
+ if (cell.includes("Chapter:")) {
1715
+ return cell.replace(/Chapter: .*$/, "Chapter " + htmlStr);
1716
+ }
1717
+ return cell;
1718
+ });
1719
+ });
1720
+ };
1721
+ DetailedviewComponent.prototype.createTable = function (userMetadata) {
1722
+ this.deatilViewContainer.style.display = 'block';
1723
+ while (this.deatilViewTable.firstChild) {
1724
+ this.deatilViewTable.removeChild(this.deatilViewTable.lastChild);
1725
+ }
1726
+ var labelArray = new Array();
1727
+ var cnt = 0;
1728
+ for (var i = 0; i < userMetadata.length; i++) {
1729
+ var label = document.createElement('label');
1730
+ label.appendChild(document.createTextNode(this.userMetadataHeadingArray[i]));
1731
+ if (label.textContent === 'undefined' || label.textContent === undefined) {
1732
+ label.textContent = '';
1733
+ }
1734
+ labelArray.push(label);
1735
+ var data = document.createElement('label');
1736
+ data.appendChild(document.createTextNode(userMetadata[i]));
1737
+ if (data.textContent === 'undefined' || data.textContent === undefined) {
1738
+ data.textContent = '';
1739
+ }
1740
+ labelArray.push(data);
1741
+ }
1742
+ var tbl = document.createElement('table');
1743
+ tbl.id = "userDataTable";
1744
+ tbl.className = "table table-bordered";
1745
+ var tblBody = document.createElement('tbody');
1746
+ for (var j = 0; j < userMetadata.length / 2; j++) {
1747
+ var row = document.createElement('tr');
1748
+ var cell = void 0;
1749
+ for (var i = 0; i < 4; i++) {
1750
+ if (i % 2 == 0) {
1751
+ cell = document.createElement('th');
1752
+ cell.style['font-weight'] = "bold";
1753
+ // cell.style.background ="#e0e0e0";
1754
+ }
1755
+ else {
1756
+ cell = document.createElement('td');
1757
+ }
1758
+ if (cnt < labelArray.length) {
1759
+ cell.appendChild(labelArray[cnt]);
1760
+ row.appendChild(cell);
1761
+ //console.log('11dec', cell);
1762
+ }
1763
+ cnt++;
1764
+ }
1765
+ tblBody.appendChild(row);
1766
+ tbl.appendChild(tblBody);
1767
+ this.deatilViewTable.appendChild(tbl);
1768
+ }
1769
+ };
1770
+ DetailedviewComponent.prototype.createResourcesTable = function (resoureMetadata) {
1771
+ var labelArray = new Array();
1772
+ var cnt = 0;
1773
+ for (var i = 0; i < this.resourseMetadataHeadingArray.length; i++) {
1774
+ var label = document.createElement('label');
1775
+ label.appendChild(document.createTextNode(this.resourseMetadataHeadingArray[i]));
1776
+ if (label.textContent === 'undefined' || label.textContent === undefined) {
1777
+ label.textContent = '';
1778
+ }
1779
+ labelArray.push(label);
1780
+ }
1781
+ for (var i = 0; i < resoureMetadata.length; i++) {
1782
+ for (var j = 0; j < 5; j++) {
1783
+ var label = document.createElement('label');
1784
+ //label.appendChild(document.createTextNode(resoureMetadata[i][j]));
1785
+ label.innerHTML = resoureMetadata[i][j];
1786
+ if (label.textContent === 'undefined' || label.textContent === undefined) {
1787
+ label.textContent = '';
1788
+ }
1789
+ labelArray.push(label);
1790
+ }
1791
+ }
1792
+ var tbl = document.createElement('table');
1793
+ tbl.className = "table table-bordered";
1794
+ tbl.id = "resoureMetadataTable";
1795
+ var tblBody = document.createElement('tbody');
1796
+ for (var j = 0; j <= resoureMetadata.length; j++) {
1797
+ var row = document.createElement('tr');
1798
+ var cell = void 0;
1799
+ for (var i = 0; i < 5; i++) {
1800
+ if (j == 0) {
1801
+ cell = document.createElement('th');
1802
+ cell.style['font-weight'] = 'bold';
1803
+ // cell.style.background ="#e0e0e0";
1804
+ }
1805
+ else {
1806
+ cell = document.createElement('td');
1807
+ }
1808
+ if (cnt < labelArray.length) {
1809
+ cell.appendChild(labelArray[cnt]);
1810
+ row.appendChild(cell);
1811
+ //console.log('11dec', cell);
1812
+ }
1813
+ cnt++;
1814
+ }
1815
+ tblBody.appendChild(row);
1816
+ tbl.appendChild(tblBody);
1817
+ this.deatilViewTable.appendChild(tbl);
1818
+ }
1819
+ };
1820
+ DetailedviewComponent.prototype.onCloseBtnClick = function () {
1821
+ this.deatilViewContainer.style.display = 'none';
1822
+ };
1823
+ return DetailedviewComponent;
1824
+ }());
1825
+ DetailedviewComponent.decorators = [
1826
+ { type: i0.Component, args: [{
1827
+ selector: 'lib-detailedview',
1828
+ template: "<div id=\"pd-deatilViewContainer\">\n <div class=\"pd-detailview-header\">\n <div class=\"pd-detailview-title\">Details</div>\n <div id=\"pd-closeButton\" (click)=\"onCloseBtnClick()\">+</div>\n </div>\n <div id=\"pd-deatilViewTable\"></div>\n</div>\n",
1829
+ 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}"]
1830
+ },] }
1831
+ ];
1832
+ DetailedviewComponent.ctorParameters = function () { return [
1833
+ { type: PrincipalDashboardLibV2Service }
1834
+ ]; };
1835
+
1836
+ var EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
1837
+ var EXCEL_EXTENSION = '.xlsx';
1838
+ var ExceldataService = /** @class */ (function () {
1839
+ function ExceldataService() {
1840
+ this.resourceTypes = new Array();
1841
+ this.tabName = [{ "name": "School" }, { "name": "User Summary" }, { "name": "Terminal Summary" }, { "name": "Usage Details" }];
1842
+ }
1843
+ ExceldataService.prototype.exportAsExcelFile = function (json, excelFileName) {
1844
+ var excelBuffer;
1845
+ var myobj = { Sheets: {}, SheetNames: [] };
1846
+ for (var i = 0; i < json.length; i++) {
1847
+ var worksheet = XLSX.utils.json_to_sheet(json[i]);
1848
+ myobj.Sheets[this.tabName[i].name] = worksheet;
1849
+ myobj.SheetNames.push(this.tabName[i].name);
1850
+ }
1851
+ var workbook = myobj;
1852
+ excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
1853
+ this.saveAsExcelFile(excelBuffer, excelFileName);
1854
+ };
1855
+ ExceldataService.prototype.saveAsExcelFile = function (buffer, fileName) {
1856
+ var data = new Blob([buffer], {
1857
+ type: EXCEL_TYPE
1858
+ });
1859
+ FileSaver.saveAs(data, fileName + EXCEL_EXTENSION);
1860
+ };
1861
+ //_____FOR EXCEL CONVERTOR END
1862
+ ExceldataService.prototype.genarateResourseReqiuredData_Excel = function (data) {
1863
+ var resouseID;
1864
+ var title;
1865
+ var subject;
1866
+ var grade;
1867
+ var chapter;
1868
+ var teachingpoint;
1869
+ var type;
1870
+ var resourceMetadataMatrix = new Array();
1871
+ var resourceMetadata = data.resourcesMetadata.resourceMetadata;
1872
+ if (resourceMetadata != undefined && resourceMetadata.length > 0) {
1873
+ for (var i = 0; i < resourceMetadata.length; i++) {
1874
+ //----------//resouseID
1875
+ resouseID = resourceMetadata[i].resourceId;
1876
+ //----------//subject
1877
+ if (resourceMetadata[i].subject != undefined) {
1878
+ if (resourceMetadata[i].subject.title != undefined) {
1879
+ subject = resourceMetadata[i].subject.title;
1880
+ }
1881
+ else {
1882
+ subject = '';
1883
+ }
1884
+ }
1885
+ else {
1886
+ subject = '';
1887
+ }
1888
+ //----------//grade
1889
+ if (resourceMetadata[i].grade != undefined) {
1890
+ if (resourceMetadata[i].grade.title != undefined) {
1891
+ grade = resourceMetadata[i].grade.title;
1892
+ }
1893
+ else {
1894
+ grade = '';
1895
+ }
1896
+ }
1897
+ else {
1898
+ grade = '';
1899
+ }
1900
+ //----------//chapter
1901
+ if (resourceMetadata[i].chapter != undefined) {
1902
+ if (resourceMetadata[i].chapter.title != undefined) {
1903
+ chapter = resourceMetadata[i].chapter.title;
1904
+ }
1905
+ else {
1906
+ chapter = '';
1907
+ }
1908
+ }
1909
+ else {
1910
+ chapter = '';
1911
+ }
1912
+ //----------//teachingpoint
1913
+ if (resourceMetadata[i].teachingpoint != undefined) {
1914
+ if (resourceMetadata[i].teachingpoint.title != undefined) {
1915
+ teachingpoint = resourceMetadata[i].teachingpoint.title;
1916
+ }
1917
+ else {
1918
+ teachingpoint = '';
1919
+ }
1920
+ }
1921
+ else {
1922
+ teachingpoint = '';
1923
+ }
1924
+ //----------//type
1925
+ if (resourceMetadata[i].type != undefined) {
1926
+ type = this.getDisplaytypeValue(resourceMetadata[i].type);
1927
+ }
1928
+ else {
1929
+ type = '';
1930
+ }
1931
+ //----------//title
1932
+ if (resourceMetadata[i].title != undefined) {
1933
+ title = resourceMetadata[i].title;
1934
+ }
1935
+ else {
1936
+ title = '';
1937
+ }
1938
+ var resourceMetauserConsoleData = {
1939
+ resouseID: resouseID,
1940
+ subject: subject,
1941
+ grade: grade,
1942
+ chapter: chapter,
1943
+ teachingpoint: teachingpoint,
1944
+ type: type,
1945
+ title: title
1946
+ };
1947
+ resourceMetadataMatrix.push(resourceMetauserConsoleData);
1948
+ this.resourceTypes.push(type);
1949
+ }
1950
+ }
1951
+ this.resourceTypes = __spread(new Set(this.resourceTypes));
1952
+ return resourceMetadataMatrix;
1953
+ };
1954
+ ExceldataService.prototype.getName = function (user) {
1955
+ if (/School Admin/gm.exec(user.role)) {
1956
+ return "Support Admin";
1957
+ }
1958
+ return user.fullName;
1959
+ };
1960
+ ExceldataService.prototype.genarateUserReqiuredData_Excel = function (data) {
1961
+ var userConsole = data.usersConsole.userConsole;
1962
+ var usersMetadata = data.usersMetadata.userMetadata;
1963
+ var schoolTerminal = data.schoolTerminals.schoolTerminal;
1964
+ var usersMetadataMatrix = new Array();
1965
+ var usermetadataMatrixUpdated = new Array();
1966
+ var schoolTerminalMatrix = new Array();
1967
+ var userConsoleMatrix = new Array();
1968
+ if (usersMetadata != null && usersMetadata.length > 0) {
1969
+ for (var i_1 = 0; i_1 < usersMetadata.length; i_1++) {
1970
+ var userId = void 0;
1971
+ var userName = void 0;
1972
+ var userSubjects = void 0;
1973
+ var listOfUser = {};
1974
+ if (usersMetadata[i_1].userId != "") {
1975
+ userId = usersMetadata[i_1].userId;
1976
+ if (usersMetadata[i_1].fullName !== undefined) {
1977
+ userName = this.getName(usersMetadata[i_1]); // get name of user w.r.t. ID
1978
+ }
1979
+ else {
1980
+ userName = '';
1981
+ }
1982
+ if (usersMetadata[i_1].userSubjects !== undefined) {
1983
+ userSubjects = usersMetadata[i_1].userSubjects; // get name of user w.r.t. ID
1984
+ }
1985
+ else {
1986
+ userSubjects = '';
1987
+ }
1988
+ listOfUser = {
1989
+ userId: userId,
1990
+ userName: userName,
1991
+ userSubjects: userSubjects
1992
+ };
1993
+ usersMetadataMatrix.push(listOfUser); // array of all users
1994
+ }
1995
+ }
1996
+ }
1997
+ for (var i = 0; i < usersMetadataMatrix.length; i++) {
1998
+ usersMetadataMatrix.forEach(function (element) {
1999
+ if (usersMetadataMatrix[i].userName === element.userName) {
2000
+ usermetadataMatrixUpdated.push(usersMetadataMatrix[i]); //array of same name users
2001
+ usersMetadataMatrix.splice(i, 1); //delete the same name users from usermetadataMatrix
2002
+ }
2003
+ });
2004
+ }
2005
+ for (var i = 0; i < usermetadataMatrixUpdated.length; i++) {
2006
+ usermetadataMatrixUpdated[i].userName = usermetadataMatrixUpdated[i].userName + " " + i;
2007
+ usersMetadataMatrix.push(usermetadataMatrixUpdated[i]); //adding same name users in usermetadataMatrix with some random charators
2008
+ }
2009
+ if (schoolTerminal != null && schoolTerminal.length > 0) {
2010
+ for (var i = 0; i < schoolTerminal.length; i++) {
2011
+ var schoolId = void 0;
2012
+ var terminalKey = void 0;
2013
+ var terminalType = void 0;
2014
+ var location = void 0;
2015
+ var schoolTerminalData = {};
2016
+ //----------//schoolId
2017
+ if (schoolTerminal[i].schoolId !== undefined) {
2018
+ schoolId = schoolTerminal[i].schoolId; // get name of user w.r.t. ID
2019
+ }
2020
+ else {
2021
+ schoolId = '';
2022
+ }
2023
+ //----------//terminalKey
2024
+ if (schoolTerminal[i].terminalKey !== undefined) {
2025
+ terminalKey = schoolTerminal[i].terminalKey; // get name of user w.r.t. ID
2026
+ }
2027
+ else {
2028
+ terminalKey = '';
2029
+ }
2030
+ //----------//terminalType
2031
+ if (schoolTerminal[i].terminalType !== undefined) {
2032
+ terminalType = schoolTerminal[i].terminalType; // get name of user w.r.t. ID
2033
+ }
2034
+ else {
2035
+ terminalType = '';
2036
+ }
2037
+ //----------//location
2038
+ if (schoolTerminal[i].metadata !== undefined) {
2039
+ location = schoolTerminal[i].metadata; // get name of user w.r.t. ID
2040
+ }
2041
+ else {
2042
+ location = '';
2043
+ }
2044
+ schoolTerminalData = {
2045
+ schoolId: schoolId,
2046
+ terminalKey: terminalKey,
2047
+ terminalType: terminalType,
2048
+ location: location
2049
+ };
2050
+ schoolTerminalMatrix.push(schoolTerminalData);
2051
+ }
2052
+ }
2053
+ if (userConsole != null && userConsole.length > 0) {
2054
+ var _loop_1 = function (index) {
2055
+ var userId = void 0;
2056
+ var startTime = void 0;
2057
+ var endTime = void 0;
2058
+ var duration = void 0;
2059
+ var selectedDate = void 0;
2060
+ var terminalIP = void 0;
2061
+ var userConsoleResources = void 0;
2062
+ var resourceMetadataIDS = void 0;
2063
+ var resourceMetauserConsoleData = [];
2064
+ var resourceDurationFromConsole = [];
2065
+ var userName = void 0;
2066
+ var userSubjects = void 0;
2067
+ var terminalLocation = void 0;
2068
+ //----------//user iD
2069
+ if (userConsole[index].userId !== undefined) {
2070
+ userId = userConsole[index].userId; // get name of user w.r.t. ID
2071
+ }
2072
+ else {
2073
+ userId = '';
2074
+ }
2075
+ //----------// startTime
2076
+ if (userConsole[index].startTime !== undefined) {
2077
+ startTime = userConsole[index].startTime; // get name of user w.r.t. ID
2078
+ }
2079
+ else {
2080
+ startTime = '';
2081
+ }
2082
+ //----------// endTime
2083
+ if (userConsole[index].endTime !== undefined) {
2084
+ endTime = userConsole[index].endTime; // get name of user w.r.t. ID
2085
+ this_1.myEndTime = endTime;
2086
+ }
2087
+ else {
2088
+ endTime = '';
2089
+ }
2090
+ //----------// Date
2091
+ if (userConsole[index].selectedDate !== undefined) {
2092
+ selectedDate = userConsole[index].selectedDate; // get name of user w.r.t. ID
2093
+ }
2094
+ else {
2095
+ selectedDate = '';
2096
+ }
2097
+ //----------// Duration
2098
+ if (userConsole[index].duration !== undefined) {
2099
+ duration = userConsole[index].duration; // get name of user w.r.t. ID
2100
+ }
2101
+ else {
2102
+ duration = '';
2103
+ }
2104
+ //----------// terminalIP
2105
+ if (userConsole[index].terminalIP !== undefined) {
2106
+ terminalIP = userConsole[index].terminalIP; // get name of user w.r.t. ID
2107
+ }
2108
+ else {
2109
+ terminalIP = '';
2110
+ }
2111
+ //----------// userConsoleResources
2112
+ if (userConsole[index].userConsoleResources !== undefined) {
2113
+ userConsoleResources = userConsole[index].userConsoleResources; // get name of user w.r.t. ID
2114
+ }
2115
+ else {
2116
+ userConsoleResources = null;
2117
+ }
2118
+ if (userConsoleResources != null) {
2119
+ if (userConsoleResources.userConsoleResource !== undefined) {
2120
+ // satyajit resource wise duration added
2121
+ userConsoleResources.userConsoleResource.forEach(function (item) {
2122
+ resourceMetauserConsoleData.push(item.resourceId); // get name of user w.r.t. ID
2123
+ resourceDurationFromConsole.push(item.duration);
2124
+ });
2125
+ // resourceMetauserConsoleData = userConsoleResources.userConsoleResource; // get name of user w.r.t. ID
2126
+ }
2127
+ else {
2128
+ resourceMetauserConsoleData = [];
2129
+ resourceDurationFromConsole = [];
2130
+ }
2131
+ }
2132
+ //----------// userName and userSubjects
2133
+ for (var i_2 = 0; i_2 < usersMetadataMatrix.length; i_2++) {
2134
+ if (userId === usersMetadataMatrix[i_2].userId) {
2135
+ userName = usersMetadataMatrix[i_2].userName;
2136
+ userSubjects = usersMetadataMatrix[i_2].userSubjects;
2137
+ }
2138
+ }
2139
+ //----------// terminalIP and terminalLocation
2140
+ for (var i_3 = 0; i_3 < schoolTerminalMatrix.length; i_3++) {
2141
+ if (terminalIP === schoolTerminalMatrix[i_3].terminalKey) {
2142
+ terminalLocation = schoolTerminalMatrix[i_3].location;
2143
+ }
2144
+ }
2145
+ var userData = {
2146
+ userId: userId,
2147
+ userName: userName,
2148
+ startTime: new Date(startTime),
2149
+ endTime: new Date(endTime),
2150
+ terminalIP: terminalIP,
2151
+ resourceMetauserConsoleData: resourceMetauserConsoleData,
2152
+ duration: duration,
2153
+ terminalLocation: terminalLocation,
2154
+ userSubjects: userSubjects,
2155
+ resourceDurationFromConsole: resourceDurationFromConsole
2156
+ };
2157
+ userConsoleMatrix.push(userData);
2158
+ };
2159
+ var this_1 = this;
2160
+ for (var index = 0; index < userConsole.length; index++) {
2161
+ _loop_1(index);
2162
+ }
2163
+ }
2164
+ return { usersMetadata: usersMetadataMatrix, schoolTerminalData: schoolTerminalMatrix, userConsoleData: userConsoleMatrix };
2165
+ };
2166
+ ExceldataService.prototype.deatilData_Excel = function (userConsoleMatrix, resourceMetadataMatrix) {
2167
+ // console.log("resourceMetadataMatrix",resourceMetadataMatrix);
2168
+ var currentDate;
2169
+ var resourceMatrixForExcel = new Array();
2170
+ resourceMatrixForExcel = [];
2171
+ for (var i = 0; i < userConsoleMatrix.length; i++) {
2172
+ var userID = void 0;
2173
+ var startTime = void 0;
2174
+ var endTime = void 0;
2175
+ var duration = void 0;
2176
+ var terminalIP = void 0;
2177
+ var subject = void 0;
2178
+ var grade = void 0;
2179
+ var chapter = void 0;
2180
+ var resourceType = void 0;
2181
+ var resourceTitle = void 0;
2182
+ var teachingpoint = void 0;
2183
+ var location = void 0;
2184
+ var teacherName = void 0;
2185
+ var teacherSubject = void 0;
2186
+ var resourceMetadataIDs = void 0;
2187
+ var resourceMetadataIDsDuration = void 0;
2188
+ var resourceArrayForExcel = new Array();
2189
+ userID = userConsoleMatrix[i].userId;
2190
+ //----------------- for subject and Name
2191
+ teacherSubject = userConsoleMatrix[i].userSubjects;
2192
+ teacherName = userConsoleMatrix[i].userName;
2193
+ //----------------- for start Time and EndTime
2194
+ if ((userConsoleMatrix[i].startTime != undefined && userConsoleMatrix[i].startTime != "") && (userConsoleMatrix[i].endTime != undefined && userConsoleMatrix[i].endTime != "")) {
2195
+ startTime = userConsoleMatrix[i].startTime.toLocaleTimeString('en-US', { hour12: true });
2196
+ endTime = userConsoleMatrix[i].endTime.toLocaleTimeString('en-US', { hour12: true });
2197
+ currentDate = userConsoleMatrix[i].startTime.getDate() + '/' + (userConsoleMatrix[i].startTime.getMonth() + 1) + '/' + userConsoleMatrix[i].startTime.getFullYear();
2198
+ }
2199
+ //----------------- for duration
2200
+ duration = Math.floor(userConsoleMatrix[i].duration);
2201
+ //----------------- for Terminal loaction and terminal IP
2202
+ location = userConsoleMatrix[i].terminalLocation;
2203
+ terminalIP = userConsoleMatrix[i].terminalIP;
2204
+ var roomDetail = location + ' ' + terminalIP;
2205
+ var locationName = location;
2206
+ var terminalIPAddress = terminalIP;
2207
+ resourceMetadataIDs = userConsoleMatrix[i].resourceMetauserConsoleData;
2208
+ resourceMetadataIDsDuration = userConsoleMatrix[i].resourceDurationFromConsole;
2209
+ if (resourceMetadataIDs.length == 0) {
2210
+ subject = '';
2211
+ grade = '';
2212
+ chapter = '';
2213
+ teachingpoint = '';
2214
+ resourceTitle = '';
2215
+ resourceType = '';
2216
+ resourceArrayForExcel = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, locationName, terminalIPAddress, subject, grade, chapter, teachingpoint, resourceTitle, resourceType, userID];
2217
+ resourceMatrixForExcel.push(resourceArrayForExcel);
2218
+ }
2219
+ else {
2220
+ for (var k = 0; k < resourceMetadataIDs.length; k++) {
2221
+ for (var i_4 = 0; i_4 < resourceMetadataMatrix.length; i_4++) {
2222
+ // resouseID:resouseID,
2223
+ // subject:subject,
2224
+ // grade:grade,
2225
+ // chapter:chapter,
2226
+ // teachingpoint:teachingpoint,
2227
+ // type:type,
2228
+ // title:title
2229
+ if (resourceMetadataIDs[k] === resourceMetadataMatrix[i_4].resouseID) {
2230
+ subject = resourceMetadataMatrix[i_4].subject;
2231
+ grade = resourceMetadataMatrix[i_4].grade;
2232
+ chapter = resourceMetadataMatrix[i_4].chapter;
2233
+ teachingpoint = resourceMetadataMatrix[i_4].teachingpoint;
2234
+ resourceTitle = resourceMetadataMatrix[i_4].title;
2235
+ resourceType = this.getDisplaytypeValue(resourceMetadataMatrix[i_4].type);
2236
+ // FOR EXCEL
2237
+ resourceArrayForExcel = [teacherName, teacherSubject, currentDate, startTime, endTime, duration, locationName, terminalIPAddress, subject, grade, chapter, teachingpoint, resourceTitle, resourceType, userID, resourceMetadataIDsDuration[k]];
2238
+ resourceMatrixForExcel.push(resourceArrayForExcel);
2239
+ teacherName = '';
2240
+ teacherSubject = '';
2241
+ currentDate = '';
2242
+ startTime = '';
2243
+ endTime = '';
2244
+ locationName = '';
2245
+ terminalIPAddress = '';
2246
+ duration = '';
2247
+ }
2248
+ }
2249
+ }
2250
+ }
2251
+ }
2252
+ return resourceMatrixForExcel;
2253
+ };
2254
+ ExceldataService.prototype.deatilUsage_Excel = function (resourceMatrixForExcel) {
2255
+ var userList = [];
2256
+ // console.log("resourceMatrixForExcel>>>>>>>>>>>>>>>>>>>",resourceMatrixForExcel);
2257
+ if (resourceMatrixForExcel.length > 0) {
2258
+ for (var i = 0; i < resourceMatrixForExcel.length; i++) {
2259
+ var data = {
2260
+ // Sr_No: i+1,
2261
+ Name: resourceMatrixForExcel[i][0],
2262
+ Subjects: resourceMatrixForExcel[i][1],
2263
+ Date: resourceMatrixForExcel[i][2],
2264
+ startTime: resourceMatrixForExcel[i][3],
2265
+ endTime: resourceMatrixForExcel[i][4],
2266
+ "duration(mins)": resourceMatrixForExcel[i][5],
2267
+ location: resourceMatrixForExcel[i][6],
2268
+ IP: resourceMatrixForExcel[i][7],
2269
+ subjectTitle: resourceMatrixForExcel[i][8],
2270
+ gradeTitle: resourceMatrixForExcel[i][9],
2271
+ Chapter: resourceMatrixForExcel[i][10],
2272
+ tpTitle: resourceMatrixForExcel[i][11],
2273
+ resourceTitle: resourceMatrixForExcel[i][12],
2274
+ resourceType: resourceMatrixForExcel[i][13],
2275
+ 'resourceDuration(sec)': resourceMatrixForExcel[i][15],
2276
+ };
2277
+ userList.push(data);
2278
+ }
2279
+ }
2280
+ // console.log("userList",userList);
2281
+ return userList;
2282
+ };
2283
+ ExceldataService.prototype.userSummary_Excel = function (data, resourceMatrixForExcel) {
2284
+ // console.log("resourceMatrixForExcel",resourceMatrixForExcel)
2285
+ var userMetadataList = data.usersMetadata.userMetadata;
2286
+ var resourcelist = new Array();
2287
+ var resourceTypeList = new Array();
2288
+ var userObjectList = new Array();
2289
+ var classRooms = new Array();
2290
+ var datesAccess = new Array();
2291
+ var grades = new Array();
2292
+ var subjectTought = new Array();
2293
+ // let unique_resourceTypeList = [];
2294
+ var duration = 0;
2295
+ for (var i = 0; i < userMetadataList.length; i++) {
2296
+ resourcelist = [];
2297
+ resourceTypeList = [];
2298
+ classRooms = [];
2299
+ datesAccess = [];
2300
+ grades = [];
2301
+ subjectTought = [];
2302
+ duration = 0;
2303
+ // console.log("userMetadataList[i]",userMetadataList);
2304
+ // console.log("resourceMatrixForExcel[i]",[...new Set(resourceMatrixForExcel)]);
2305
+ for (var j = 0; j < resourceMatrixForExcel.length; j++) {
2306
+ if (userMetadataList[i].userId === resourceMatrixForExcel[j][14]) {
2307
+ if (resourceMatrixForExcel[j][12] != '') {
2308
+ resourcelist.push(resourceMatrixForExcel[j][12]);
2309
+ }
2310
+ if (resourceMatrixForExcel[j][13] != '') {
2311
+ resourceTypeList.push(resourceMatrixForExcel[j][13]);
2312
+ }
2313
+ if (resourceMatrixForExcel[j][5] != '') {
2314
+ duration = duration + resourceMatrixForExcel[j][5];
2315
+ }
2316
+ classRooms.push(resourceMatrixForExcel[j][6]);
2317
+ datesAccess.push(resourceMatrixForExcel[j][2]);
2318
+ grades.push(resourceMatrixForExcel[j][9]);
2319
+ subjectTought.push(resourceMatrixForExcel[j][8]);
2320
+ }
2321
+ }
2322
+ var ClassRooms = void 0;
2323
+ var DatesAccess = void 0;
2324
+ var Grades = void 0;
2325
+ var SubjectTought = void 0;
2326
+ var dayAccess = void 0;
2327
+ if (classRooms.length > 0) {
2328
+ ClassRooms = __spread(new Set(classRooms))[0];
2329
+ }
2330
+ else {
2331
+ ClassRooms = '';
2332
+ }
2333
+ if (datesAccess.length > 0) {
2334
+ dayAccess = __spread(new Set(datesAccess)).length;
2335
+ }
2336
+ else {
2337
+ dayAccess = '';
2338
+ }
2339
+ if (datesAccess.length > 0) {
2340
+ DatesAccess = __spread(new Set(datesAccess))[0];
2341
+ }
2342
+ else {
2343
+ DatesAccess = '';
2344
+ }
2345
+ if (grades.length > 0) {
2346
+ Grades = __spread(new Set(grades))[0];
2347
+ }
2348
+ else {
2349
+ Grades = '';
2350
+ }
2351
+ if (subjectTought.length > 0) {
2352
+ SubjectTought = __spread(new Set(subjectTought))[0];
2353
+ }
2354
+ else {
2355
+ SubjectTought = '';
2356
+ }
2357
+ // if(resourceTypeList.length>0){
2358
+ // unique_resourceTypeList = [...new Set(resourceTypeList)];
2359
+ // }
2360
+ // console.log("this.resourceTypes",this.resourceTypes)
2361
+ var user = {
2362
+ Name: this.getName(userMetadataList[i]),
2363
+ Subjects: userMetadataList[i].userSubjects,
2364
+ duration: duration,
2365
+ ClassRooms: ClassRooms,
2366
+ DatesAccess: DatesAccess,
2367
+ DayAccess: dayAccess,
2368
+ Grades: Grades,
2369
+ SubjectTought: SubjectTought,
2370
+ AseestUsed: resourcelist,
2371
+ AssetType: resourceTypeList
2372
+ };
2373
+ userObjectList.push(user);
2374
+ }
2375
+ // console.log("userObjectList",userObjectList)
2376
+ var userSummaryList = new Array();
2377
+ var _loop_2 = function (i) {
2378
+ var Assetcounts = [];
2379
+ //find count of present asset type
2380
+ var presentAsset = userObjectList[i].AssetType;
2381
+ presentAsset = __spread(new Set(presentAsset));
2382
+ // console.log("presentAsset",presentAsset)
2383
+ //find count of present asset count
2384
+ var sampleArray = userObjectList[i].AssetType;
2385
+ sampleArray.forEach(function (x) { Assetcounts[x] = (Assetcounts[x] || 0) + 1; });
2386
+ // find missing assets
2387
+ var missingAssets = this_2.resourceTypes.filter(function (n) { return !presentAsset.includes(n); });
2388
+ // adding missing asset with count 0 in list
2389
+ missingAssets.forEach(function (element) {
2390
+ Assetcounts[element] = 0;
2391
+ });
2392
+ // console.log(Assetcounts);
2393
+ var asset_media = {
2394
+ // Sr_No: i+1,
2395
+ Name: userObjectList[i].Name,
2396
+ Subjects_taught: userObjectList[i].Subjects,
2397
+ " Duration(mins)": userObjectList[i].duration,
2398
+ ClassRooms: userObjectList[i].ClassRooms,
2399
+ DaysAccsessed: userObjectList[i].DayAccess,
2400
+ DatesAccess: userObjectList[i].DatesAccess,
2401
+ Grades: userObjectList[i].Grades,
2402
+ Subjects: userObjectList[i].SubjectTought
2403
+ };
2404
+ var returnedTarget = Object.assign(asset_media, Assetcounts);
2405
+ userSummaryList.push(returnedTarget);
2406
+ };
2407
+ var this_2 = this;
2408
+ for (var i = 0; i < userObjectList.length; i++) {
2409
+ _loop_2(i);
2410
+ }
2411
+ // console.log("userSummaryList",userSummaryList);
2412
+ return userSummaryList;
2413
+ };
2414
+ // To GET DISPLAY TYPE
2415
+ ExceldataService.prototype.getDisplaytypeValue = function (key) {
2416
+ var assetTypeConfig = [
2417
+ {
2418
+ type: "asset_media",
2419
+ display: "Media"
2420
+ },
2421
+ {
2422
+ type: "asset_print",
2423
+ display: "Print"
2424
+ },
2425
+ {
2426
+ type: "quiz",
2427
+ display: "Quiz"
2428
+ },
2429
+ {
2430
+ type: "question",
2431
+ display: "Question"
2432
+ },
2433
+ {
2434
+ type: "chapter",
2435
+ display: "Chapter"
2436
+ },
2437
+ {
2438
+ type: "tp",
2439
+ display: "Topic"
2440
+ },
2441
+ {
2442
+ type: "whiteboard",
2443
+ display: "Whiteboard"
2444
+ },
2445
+ {
2446
+ type: "widget",
2447
+ display: "Widget"
2448
+ },
2449
+ {
2450
+ type: "casset_media",
2451
+ display: "cMedia"
2452
+ },
2453
+ {
2454
+ type: "casset_print",
2455
+ display: "cPrint"
2456
+ },
2457
+ {
2458
+ type: "cquiz",
2459
+ display: "cQuiz"
2460
+ },
2461
+ {
2462
+ type: "cquestion",
2463
+ display: "cQuestion"
2464
+ },
2465
+ {
2466
+ type: "image",
2467
+ display: "Image"
2468
+ },
2469
+ {
2470
+ type: "video",
2471
+ display: "Video"
2472
+ },
2473
+ ];
2474
+ var displayValue = key;
2475
+ assetTypeConfig.forEach(function (value) {
2476
+ if (value.type === key) {
2477
+ displayValue = value.display;
2478
+ }
2479
+ });
2480
+ return displayValue;
2481
+ };
2482
+ return ExceldataService;
2483
+ }());
2484
+ ExceldataService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ExceldataService_Factory() { return new ExceldataService(); }, token: ExceldataService, providedIn: "root" });
2485
+ ExceldataService.decorators = [
2486
+ { type: i0.Injectable, args: [{
2487
+ providedIn: 'root'
2488
+ },] }
2489
+ ];
2490
+ ExceldataService.ctorParameters = function () { return []; };
2491
+
2492
+ var HeaderComponent = /** @class */ (function () {
2493
+ function HeaderComponent(excelService, pdService) {
2494
+ this.excelService = excelService;
2495
+ this.pdService = pdService;
2496
+ this.userSelectedDate = new i0.EventEmitter();
2497
+ this.refreshTimer = 0;
2498
+ //for datepicker
2499
+ this.title = 'datepicker';
2500
+ this.date = new Date();
2501
+ this.options = {
2502
+ inputClass: 'input',
2503
+ calendarClass: 'datepicker-default',
2504
+ scrollBarColor: '#010001',
2505
+ format: 'dd/LL/yyyy',
2506
+ maxDate: new Date()
2507
+ // for demo purpose
2508
+ };
2509
+ }
2510
+ Object.defineProperty(HeaderComponent.prototype, "data", {
2511
+ set: function (res) {
2512
+ if (res !== null) {
2513
+ this.loadData(res);
2514
+ }
2515
+ },
2516
+ enumerable: false,
2517
+ configurable: true
2518
+ });
2519
+ HeaderComponent.prototype.ngOnInit = function () {
2520
+ this.urlParams = new URLSearchParams(window.location.search);
2521
+ this.isDemo = this.urlParams.get('demo') === '1';
2522
+ this.getDefaultDate();
2523
+ this.startTimer();
2524
+ };
2525
+ HeaderComponent.prototype.getDefaultDate = function () {
2526
+ var selectedDate = this.isDemo ? new Date('2025-05-21T00:00:00') : new Date();
2527
+ this.getDateFormat(selectedDate);
2528
+ this.todayDate = this.calenderCurrentDate;
2529
+ console.log('this.isDemo', this.isDemo);
2530
+ if (this.isDemo) {
2531
+ this.mydata = null;
2532
+ this.refreshChart();
2533
+ this.pdService.openSmallTable.next(false);
2534
+ }
2535
+ };
2536
+ HeaderComponent.prototype.dateSelected = function (e) {
2537
+ var selectedDate = this.isDemo ? new Date('2025-05-21T00:00:00') : new Date(e);
2538
+ console.log("Selected Date:", selectedDate);
2539
+ this.getDateFormat(selectedDate);
2540
+ //const fixedDate = new Date('2025-05-21T00:00:00'); // Static date
2541
+ //console.log("Overriding selected date with fixed date:", fixedDate);
2542
+ //this.getDateFormat(fixedDate);
2543
+ this.mydata = null;
2544
+ this.refreshChart();
2545
+ this.pdService.openSmallTable.next(false);
2546
+ };
2547
+ HeaderComponent.prototype.getDateFormat = function (date) {
2548
+ var day = date.getDate();
2549
+ var month = date.getMonth() + 1;
2550
+ var year = date.getFullYear();
2551
+ var m;
2552
+ var d;
2553
+ if (month < 10) {
2554
+ m = "0" + month;
2555
+ }
2556
+ else {
2557
+ m = month;
2558
+ }
2559
+ if (day < 10) {
2560
+ d = "0" + day;
2561
+ }
2562
+ else {
2563
+ d = day;
2564
+ }
2565
+ var today = year + "-" + m + "-" + d;
2566
+ this.currentDate = today;
2567
+ this.calenderCurrentDate = today.split("-").reverse().join("-");
2568
+ };
2569
+ // selectDate(e: any) {
2570
+ // this.calenderEvent = e;
2571
+ // let today = e.target.value;
2572
+ // // console.log("e.target.value", e.target.value);
2573
+ // today = today.split("-").reverse().join("-");
2574
+ // this.calenderCurrentDate = today;
2575
+ // this.mydata = null;
2576
+ // this.refreshChart();
2577
+ // // this.userSelectedDate.emit(this.calenderCurrentDate);
2578
+ // ;
2579
+ // console.log(" IN --> 5");
2580
+ // }
2581
+ HeaderComponent.prototype.refreshChart = function () {
2582
+ this.stopTimer();
2583
+ this.refreshTimer = 0;
2584
+ if (this.calenderCurrentDate === this.todayDate) {
2585
+ this.countDown();
2586
+ }
2587
+ this.userSelectedDate.emit(this.calenderCurrentDate);
2588
+ };
2589
+ HeaderComponent.prototype.startTimer = function () {
2590
+ this.countDown();
2591
+ };
2592
+ HeaderComponent.prototype.stopTimer = function () {
2593
+ this.clearTimer();
2594
+ this.message = "";
2595
+ };
2596
+ HeaderComponent.prototype.clearTimer = function () {
2597
+ this.refreshTimer = 0;
2598
+ window.clearInterval(this.intervalId);
2599
+ };
2600
+ HeaderComponent.prototype.countDown = function () {
2601
+ var _this = this;
2602
+ //console.log("countDown")
2603
+ this.clearTimer();
2604
+ this.intervalId = window.setInterval(function () {
2605
+ _this.refreshTimer -= 1;
2606
+ if (_this.refreshTimer === 0) {
2607
+ _this.refreshChart();
2608
+ _this.message = '';
2609
+ }
2610
+ else {
2611
+ if (_this.refreshTimer < 0) {
2612
+ _this.refreshTimer = 300;
2613
+ } // reset
2614
+ _this.message = "" + _this.refreshTimer;
2615
+ }
2616
+ }, 1000);
2617
+ };
2618
+ HeaderComponent.prototype.timeConvert = function (n) {
2619
+ var num = n;
2620
+ var hours = num / 60;
2621
+ var rhours = Math.floor(hours);
2622
+ var minutes = (hours - rhours) * 60;
2623
+ var rminutes = Math.round(minutes);
2624
+ return rhours + ':' + rminutes;
2625
+ };
2626
+ // currentdataList: any;
2627
+ // currentResoursedataList:any;
2628
+ HeaderComponent.prototype.loadData = function (response) {
2629
+ if (response) {
2630
+ this.mydata = JSON.parse(response);
2631
+ if (this.mydata) {
2632
+ //get current data list
2633
+ var genarateUserReqiuredData = this.excelService.genarateUserReqiuredData_Excel(this.mydata);
2634
+ var currentdataList = genarateUserReqiuredData.userConsoleData;
2635
+ // resoureMetadata list
2636
+ var currentResoursedataList = this.excelService.genarateResourseReqiuredData_Excel(this.mydata);
2637
+ var deatilData = this.excelService.deatilData_Excel(currentdataList, currentResoursedataList);
2638
+ var userDetails_data = this.excelService.deatilUsage_Excel(deatilData);
2639
+ var UserSummary = this.excelService.userSummary_Excel(this.mydata, deatilData);
2640
+ var schoolDetails = this.mydata.schoolMetadata.school;
2641
+ var userDetails = userDetails_data;
2642
+ var terminalDetails = this.mydata.schoolTerminals.schoolTerminal;
2643
+ // console.log("schoolDetails",schoolDetails);
2644
+ // console.log("UserSummary",UserSummary);
2645
+ // console.log("terminalDetails",terminalDetails);
2646
+ // console.log("userDetails",userDetails);
2647
+ this.dataList = [
2648
+ [schoolDetails],
2649
+ UserSummary,
2650
+ terminalDetails,
2651
+ userDetails
2652
+ ];
2653
+ }
2654
+ }
2655
+ };
2656
+ HeaderComponent.prototype.exportReport = function () {
2657
+ if (this.mydata) {
2658
+ this.excelService.exportAsExcelFile(this.dataList, 'UsageReport-' + this.calenderCurrentDate);
2659
+ }
2660
+ };
2661
+ HeaderComponent.prototype.ngOnDestroy = function () {
2662
+ this.clearTimer();
2663
+ };
2664
+ return HeaderComponent;
2665
+ }());
2666
+ HeaderComponent.decorators = [
2667
+ { type: i0.Component, args: [{
2668
+ selector: 'lib-header',
2669
+ template: "<div id=\"pd_header\" class=\"pd_header\">\n \n <div *ngIf=\"message && mydata && (this.todayDate === this.calenderCurrentDate)\" id=\"pd_refeshView\" class=\"pd_refesh_bar\">\n <div class=\"timer_msg\"> This page will be refreshed in</div>\n <div class=\"timer_value\"> {{timeConvert(message)}} min</div>\n <div id=\"pd_refeshBtn\" (click)=\"refreshChart()\"> Refresh </div>\n </div>\n\n <div id=\"pd_exportBtn\" class=\"pd_exportButton\" *ngIf=\"mydata\"\n [ngClass]=\"{'pd_exportButton_shiftRight': this.todayDate != this.calenderCurrentDate}\" (click)=\"exportReport()\"> \n <span class=\"pd_exportButton_text\">Download Report</span>\n <div class=\"pd_download_icon\"></div>\n </div>\n \n <div class=\"pd_header_calendar\">\n <!-- <input type=\"Date\" [max]=\"currentDate\" [value]=\"currentDate\" id=\"myCalendar\" (input)=\"selectDate($event)\" /> -->\n <ngx-datepicker [(ngModel)]=\"date\" [options]=\"options\" (ngModelChange)=\"dateSelected($event)\"></ngx-datepicker>\n </div>\n <div class=\"pd_header_content\" >Realtime usage data</div>\n</div>\n",
2670
+ 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:#4285f9;font-size:10pt;font-weight:400;transition:right .5s;border-radius:5px;color:#fff;font-weight:700}.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}"]
2671
+ },] }
2672
+ ];
2673
+ HeaderComponent.ctorParameters = function () { return [
2674
+ { type: ExceldataService },
2675
+ { type: PrincipalDashboardLibV2Service }
2676
+ ]; };
2677
+ HeaderComponent.propDecorators = {
2678
+ data: [{ type: i0.Input }],
2679
+ userSelectedDate: [{ type: i0.Output }]
2680
+ };
2681
+
2682
+ var TableviewComponent = /** @class */ (function () {
2683
+ function TableviewComponent(pdService) {
2684
+ this.pdService = pdService;
2685
+ this.myChartType = angularGoogleCharts.ChartType.Table;
2686
+ this.isUserWise = true;
2687
+ }
2688
+ Object.defineProperty(TableviewComponent.prototype, "data", {
2689
+ set: function (res) {
2690
+ if (res !== null) {
2691
+ this.loadTable(res);
2692
+ }
2693
+ },
2694
+ enumerable: false,
2695
+ configurable: true
2696
+ });
2697
+ TableviewComponent.prototype.ngOnInit = function () {
2698
+ };
2699
+ TableviewComponent.prototype.loadTable = function (response) {
2700
+ var _this = this;
2701
+ console.log('mresponse: ', response);
2702
+ // let parse = new DOMParser();
2703
+ // this.myXmlData = parse.parseFromString(response, 'application/xml');
2704
+ if (response) {
2705
+ this.myXmlData = JSON.parse(response);
2706
+ if (this.myXmlData) {
2707
+ // get current data list
2708
+ //console.log("AAA myXmlData-->>",this.myXmlData)
2709
+ var genarateUserReqiuredData = this.pdService.genarateUserReqiuredData(this.myXmlData);
2710
+ this.currentdataList = genarateUserReqiuredData.userConsoleData;
2711
+ // get all user list
2712
+ var fetchAlluserList = this.pdService.allUserChartData();
2713
+ this.alluserList = fetchAlluserList.fordurationTable;
2714
+ // resoureMetadata list
2715
+ this.currentResoursedataList = this.pdService.genarateResourseReqiuredData(this.myXmlData);
2716
+ //console.log("AAA genarateUserReqiuredData-->>",genarateUserReqiuredData)
2717
+ //console.log("AAA this.currentResoursedataList-->>",this.currentResoursedataList)
2718
+ }
2719
+ }
2720
+ this.tableViewDiv = document.getElementById('tableViewDiv');
2721
+ this.tableRow = document.getElementById('tableRow');
2722
+ this.tblBody = document.getElementById('tblBody');
2723
+ this.tableViewDiv.style.display = 'none';
2724
+ this.pdService.chartType.subscribe(function (data) {
2725
+ if (data) {
2726
+ _this.updateChartType(data);
2727
+ }
2728
+ });
2729
+ this.pdService.isUserWise_data.subscribe(function (data) {
2730
+ _this.updateDataType(data);
2731
+ });
2732
+ this.pdService.isAllUsers.subscribe(function (data) {
2733
+ if (data) {
2734
+ _this.showAllUser();
2735
+ }
2736
+ else {
2737
+ _this.showCurrentDataUser();
2738
+ }
2739
+ });
2740
+ };
2741
+ TableviewComponent.prototype.findAndSimplifyNestedArray = function (data) {
2742
+ //console.log('this.tableViewData',data)
2743
+ for (var i = 0; i < data.length; i++) {
2744
+ if (Array.isArray(data[i])) {
2745
+ var nestedArray = data[i];
2746
+ if (nestedArray.every(function (item) { return Array.isArray(item) && item.every(function (val) { return val === item[0]; }); })) {
2747
+ data[i] = [[nestedArray[0][0]]];
2748
+ }
2749
+ return data[i];
2750
+ }
2751
+ }
2752
+ return "No nested array found.";
2753
+ };
2754
+ TableviewComponent.prototype.showCurrentDataUser = function () {
2755
+ this.tableViewData = this.pdService.dataForTableView(this.currentdataList, this.currentResoursedataList);
2756
+ this.tableViewData = this.replaceTopicAndChapter(this.tableViewData);
2757
+ //this.tableViewData = this.findAndSimplifyNestedArray(this.tableViewData);
2758
+ var newTableViewData;
2759
+ for (var i = 0; i < this.tableViewData.length; i++) {
2760
+ newTableViewData = this.findAndSimplifyNestedArray(this.tableViewData[i]);
2761
+ newTableViewData[newTableViewData.length - 1] = newTableViewData[newTableViewData.length - 1][0];
2762
+ }
2763
+ var anotherTableViewData;
2764
+ for (var j = 0; j < this.tableViewData.length; j++) {
2765
+ anotherTableViewData = this.mergerSourceWithRoomData(this.tableViewData[j]);
2766
+ }
2767
+ if (this.tableViewData) {
2768
+ //this.ueserWiseTableView(this.tableViewData);
2769
+ this.ueserWiseTableView(this.tableViewData);
2770
+ }
2771
+ //console.log('AAA mlaunchedFromm tableViewData', this.tableViewData)
2772
+ };
2773
+ TableviewComponent.prototype.replaceTopicAndChapter = function (data) {
2774
+ var htmlStr = "<span style='font-style: italic;color: #3F51B5;'>(seen)</span>";
2775
+ return data.map(function (row) {
2776
+ if (Array.isArray(row)) {
2777
+ return row.map(function (item) {
2778
+ if (typeof item === 'string') {
2779
+ //item = item.replace(/Topic :\s*(.+?)\s*:\s*0m 0s/, 'Topic: $1 ' + htmlStr);
2780
+ //item = item.replace(/Chapter :\s*(.+?)\s*:\s*0m 0s/, 'Chapter: $1 ' + htmlStr);
2781
+ item = item.replace(/Topic :\s*(.+?)\s*:\s*\d+m \d+s/, 'Topic: $1 ' + htmlStr);
2782
+ item = item.replace(/Chapter :\s*(.+?)\s*:\s*\d+m \d+s/, 'Chapter: $1 ' + htmlStr);
2783
+ }
2784
+ return item;
2785
+ });
2786
+ }
2787
+ return row;
2788
+ });
2789
+ };
2790
+ TableviewComponent.prototype.mergerSourceWithRoomData = function (tableViewData) {
2791
+ var lastIndexValue = tableViewData[tableViewData.length - 1].join(' ');
2792
+ // Merge last index value into the 6th index
2793
+ //console.log('lastIndexValue',lastIndexValue)
2794
+ if (lastIndexValue === 'ce6') {
2795
+ //lastIndexValue = '<span style="color:black;"><i class="fa fa-windows" aria-hidden="true"></i></span>';
2796
+ lastIndexValue = '<span style="color:black;"></span>';
2797
+ }
2798
+ else if (lastIndexValue === 'ce6-a') {
2799
+ lastIndexValue = '<span style="color:#1b60d1;font-weight:bold;font-size:14px;"><i class="fa fa-android" aria-hidden="true"></i></span>';
2800
+ }
2801
+ else if (lastIndexValue === 'c') {
2802
+ lastIndexValue = '<span style="color:#1b60d1;font-weight:bold;font-size:14px; display:flex;"><i style="margin-top:-1px;" class="fa fa-android" aria-hidden="true"></i><i style="margin-left:5px;" class="fa fa-desktop" aria-hidden="true"></i></span>';
2803
+ }
2804
+ //tableViewData[6] = tableViewData[6] + '\n' + lastIndexValue;
2805
+ //tableViewData[6] = '<div style="display: flex;flex-direction: row;align-content: center;justify-content: flex-start;align-items: center;">'+lastIndexValue + '&nbsp;&nbsp;' + '<span style="font-size:11px !important;color:gray;font-weight:600;">'+tableViewData[6]+'</span></div>';
2806
+ tableViewData[6] = '<div style="display: flex;flex-direction: row;align-content: center;justify-content: flex-start;align-items: center;">' + '<span style="font-size:11px !important;color:gray;font-weight:600;">' + tableViewData[6] + '</span>' + '<span style="color:transparent">-</span>' + lastIndexValue + '</div>';
2807
+ // Optional: remove the last element (if no longer needed)
2808
+ tableViewData.pop();
2809
+ };
2810
+ TableviewComponent.prototype.showAllUser = function () {
2811
+ this.tableViewData = this.pdService.dataForTableView(this.alluserList, this.currentResoursedataList);
2812
+ console.log('11decc tableViewDataBBB', this.replaceTopicAndChapter(this.tableViewData));
2813
+ this.tableViewData = this.replaceTopicAndChapter(this.tableViewData);
2814
+ //console.log('AAA userConsoleMatrix tableViewData', this.tableViewData)
2815
+ var newTableViewData;
2816
+ for (var i = 0; i < this.tableViewData.length; i++) {
2817
+ newTableViewData = this.findAndSimplifyNestedArray(this.tableViewData[i]);
2818
+ if (newTableViewData[newTableViewData.length - 1]) {
2819
+ newTableViewData[newTableViewData.length - 1] = newTableViewData[newTableViewData.length - 1][0];
2820
+ }
2821
+ }
2822
+ var anotherTableViewData;
2823
+ for (var j = 0; j < this.tableViewData.length; j++) {
2824
+ anotherTableViewData = this.mergerSourceWithRoomData(this.tableViewData[j]);
2825
+ }
2826
+ if (this.tableViewData) {
2827
+ this.ueserWiseTableView(this.tableViewData);
2828
+ }
2829
+ };
2830
+ TableviewComponent.prototype.updateDataType = function (dataType) {
2831
+ this.isUserWise = dataType;
2832
+ };
2833
+ TableviewComponent.prototype.updateChartType = function (dataType) {
2834
+ this.myChartType = dataType;
2835
+ if (this.myChartType == angularGoogleCharts.ChartType.Timeline) {
2836
+ this.tableViewDiv.style.display = 'none';
2837
+ }
2838
+ else {
2839
+ this.tableViewDiv.style.display = 'block';
2840
+ }
2841
+ };
2842
+ TableviewComponent.prototype.ueserWiseTableView = function (resoureMetadata) {
2843
+ //console.log('AAA resoureMetadata', resoureMetadata);
2844
+ // this.deleterow("tableRow");
2845
+ document.getElementById("tblBody").innerHTML = "";
2846
+ var labelArray = new Array();
2847
+ var cnt = 0;
2848
+ for (var i = 0; i < resoureMetadata.length; i++) {
2849
+ for (var j = 0; j < 12; j++) {
2850
+ //let label = document.createElement('label');
2851
+ //label.appendChild(document.createTextNode(resoureMetadata[i][j]));
2852
+ var label = document.createElement('div');
2853
+ label.innerHTML = (resoureMetadata[i][j]);
2854
+ //console.log('11dec label.textContent',label.textContent)
2855
+ if (label.textContent === 'undefined' ||
2856
+ label.textContent === undefined ||
2857
+ label.textContent === 'undefined\nce6-a' ||
2858
+ label.textContent === 'undefined\nce6' ||
2859
+ label.textContent === 'undefined\n' ||
2860
+ label.textContent === 'undefined\nAndroid' ||
2861
+ label.textContent === 'undefined\nWeb' ||
2862
+ label.textContent === 'undefined\n' ||
2863
+ label.textContent === '\nundefined' ||
2864
+ label.textContent === ' undefined' ||
2865
+ label.textContent === 'undefined-' ||
2866
+ label.textContent === 'undefined-c' ||
2867
+ label.textContent === 'undefined- ') {
2868
+ label.textContent = '';
2869
+ }
2870
+ labelArray.push(label);
2871
+ }
2872
+ }
2873
+ //console.log("labelArray",labelArray);
2874
+ for (var j = 0; j <= resoureMetadata.length; j++) {
2875
+ var row = document.createElement('tr');
2876
+ var cell = void 0;
2877
+ for (var i = 0; i < 12; i++) {
2878
+ cell = document.createElement('td');
2879
+ if (cnt < labelArray.length) {
2880
+ cell.appendChild(labelArray[cnt]);
2881
+ row.appendChild(cell);
2882
+ }
2883
+ cnt++;
2884
+ }
2885
+ this.tblBody.appendChild(row);
2886
+ // this.tableRow.appendChild(this.tblBody);
2887
+ }
2888
+ };
2889
+ return TableviewComponent;
2890
+ }());
2891
+ TableviewComponent.decorators = [
2892
+ { type: i0.Component, args: [{
2893
+ selector: 'lib-tableview',
2894
+ template: "\n <div id=\"tableViewDiv\" class=\"pd-tableViewDiv\">\n \n <table class=\"table table-bordered\" id=\"tableRow\">\n <thead class=\"table-head\">\n <tr class=\"table-headerRow\">\n <th scope=\"col\">Teacher Name</th>\n <th scope=\"col\">Subjects</th>\n <th scope=\"col\">Date</th>\n <th scope=\"col\">Start Time</th>\n <th scope=\"col\">End Time</th>\n <th scope=\"col\">Duration (mins)</th>\n <th scope=\"col\">Room</th>\n <th scope=\"col\">Subject</th>\n <th scope=\"col\">Topic of Class</th>\n <th scope=\"col\">Chapter Name</th>\n <th scope=\"col\">Topic Name</th>\n <th scope=\"col\">Assets Details</th>\n \n </tr>\n </thead>\n <tbody id=\"tblBody\">\n \n </tbody>\n </table>\n </div>\n \n",
2895
+ styles: [".pd-tableViewDiv{width:100%;height:744px;overflow:scroll}.pd-tableViewDiv #tableRow{font-size:small;width:100%;margin-left:24px;margin-top:10px}.pd-tableViewDiv .table-headerRow{font-weight:700}.pd-tableViewDiv .table-head{position:sticky;top:0;background:#fff}.roomCell{display:flex;flex-direction:row;align-content:center;justify-content:flex-start;align-items:center}"]
2896
+ },] }
2897
+ ];
2898
+ TableviewComponent.ctorParameters = function () { return [
2899
+ { type: PrincipalDashboardLibV2Service }
2900
+ ]; };
2901
+ TableviewComponent.propDecorators = {
2902
+ data: [{ type: i0.Input }]
2903
+ };
2904
+
2905
+ var FullTableViewComponent = /** @class */ (function () {
2906
+ function FullTableViewComponent(pdService) {
2907
+ this.pdService = pdService;
2908
+ this.currentUserArray = [];
2909
+ this.remaningUsers = [];
2910
+ this.allUsers = [];
2911
+ this.usersCheckboxChecked = false;
2912
+ this.isDisplay = false;
2913
+ }
2914
+ Object.defineProperty(FullTableViewComponent.prototype, "data", {
2915
+ set: function (res) {
2916
+ if (res !== null) {
2917
+ console.log('newtable', JSON.parse(res));
2918
+ this.jsonResponse = JSON.parse(res);
2919
+ }
2920
+ },
2921
+ enumerable: false,
2922
+ configurable: true
2923
+ });
2924
+ FullTableViewComponent.prototype.ngOnInit = function () {
2925
+ var _this = this;
2926
+ this.loadUserData();
2927
+ this.pdService.chartType.subscribe(function (data) {
2928
+ if (data) {
2929
+ console.log('newTable', data);
2930
+ _this.isDisplay = data === "Table";
2931
+ }
2932
+ });
2933
+ };
2934
+ FullTableViewComponent.prototype.loadUserData = function () {
2935
+ var _this = this;
2936
+ var json = this.jsonResponse;
2937
+ var usersConsole = json.usersConsole.userConsole;
2938
+ var usersMetadata = json.usersMetadata.userMetadata;
2939
+ var resourcesMetadata = json.resourcesMetadata.resourceMetadata;
2940
+ usersConsole.forEach(function (user) {
2941
+ var _a;
2942
+ var userDetails = usersMetadata.find(function (userMeta) { return userMeta.userId === user.userId; });
2943
+ if (user === null || user === void 0 ? void 0 : user.userConsoleResources) {
2944
+ var userConsoleResource = (_a = user.userConsoleResources) === null || _a === void 0 ? void 0 : _a.userConsoleResource;
2945
+ if (userConsoleResource && userConsoleResource.length > 0) {
2946
+ userConsoleResource.forEach(function (userResource, userIndex) {
2947
+ var _a, _b, _c, _d, _e, _f;
2948
+ var resourceId = userResource.resourceId;
2949
+ var resourceDetails = resourcesMetadata.find(function (resource) { return resource.resourceId === resourceId &&
2950
+ userResource.type === resource.type; });
2951
+ // console.log('userResource.type',userResource.type)
2952
+ var prefix = _this.getDisplayTypeValue(userResource.type);
2953
+ var title = (resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title) || '';
2954
+ var tp = (_a = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.teachingPoint) === null || _a === void 0 ? void 0 : _a.title;
2955
+ var subject = (_b = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.subject) === null || _b === void 0 ? void 0 : _b.title;
2956
+ var chapter = (_c = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.chapter) === null || _c === void 0 ? void 0 : _c.title;
2957
+ var grade = (_d = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.grade) === null || _d === void 0 ? void 0 : _d.title;
2958
+ var startTime = new Date(user === null || user === void 0 ? void 0 : user.startTime);
2959
+ var endTime = new Date(user === null || user === void 0 ? void 0 : user.endTime);
2960
+ var totalDuration = _this.formatTime(Math.round((endTime.getTime() - startTime.getTime()) / 1000));
2961
+ var duration = parseInt((userResource === null || userResource === void 0 ? void 0 : userResource.duration) || '0');
2962
+ //duration = duration === 0 ? "<span style='colore:red;'>(Seen)</span>" : this.formatTime(duration);
2963
+ if (((_e = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _e === void 0 ? void 0 : _e.includes('question')) || ((_f = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _f === void 0 ? void 0 : _f.includes('cquestion'))) {
2964
+ duration = 0;
2965
+ }
2966
+ else {
2967
+ duration = duration === 0 ? "<span class='seenTag' style='color:blue;'>(Seen)</span>" : _this.formatTime(duration);
2968
+ }
2969
+ var finalAssetTitle = prefix + " : " + title + " : " + duration;
2970
+ if (title === '') {
2971
+ finalAssetTitle = prefix + " : " + duration;
2972
+ }
2973
+ // console.log('chapterTitlte', chapter)
2974
+ _this.currentUserArray.push({
2975
+ userId: user.userId,
2976
+ teacherName: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.fullName : '',
2977
+ subjects: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.userSubjects : '',
2978
+ date: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.selectedDate : '',
2979
+ startTime: userIndex === 0 ? _this.formatDate(startTime) : '',
2980
+ endtime: userIndex === 0 ? _this.formatDate(endTime) : '',
2981
+ totalDuration: userIndex === 0 ? totalDuration : '',
2982
+ room: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.terminalIP : '',
2983
+ tp: tp,
2984
+ subject: subject,
2985
+ chapter: chapter,
2986
+ grade: grade,
2987
+ details: finalAssetTitle,
2988
+ });
2989
+ });
2990
+ }
2991
+ }
2992
+ });
2993
+ var currentUserIds = this.currentUserArray
2994
+ .map(function (x) { return x.userId; })
2995
+ .filter(function (x, i, a) { return a.indexOf(x) === i; });
2996
+ this.remaningUsers = usersMetadata
2997
+ .filter(function (user) { return !currentUserIds.includes(user.userId); })
2998
+ .map(function (user) {
2999
+ return {
3000
+ userId: user.userId,
3001
+ teacherName: user === null || user === void 0 ? void 0 : user.fullName,
3002
+ subjects: user === null || user === void 0 ? void 0 : user.userSubjects,
3003
+ date: '',
3004
+ startTime: '',
3005
+ endtime: '',
3006
+ totalDuration: '0s',
3007
+ room: '',
3008
+ tp: '',
3009
+ subject: '',
3010
+ chapter: '',
3011
+ grade: '',
3012
+ details: '',
3013
+ };
3014
+ });
3015
+ this.allUsers = __spread(this.currentUserArray, this.remaningUsers);
3016
+ this.loadTable(this.currentUserArray);
3017
+ };
3018
+ FullTableViewComponent.prototype.getDisplayTypeValue = function (key) {
3019
+ var assetTypeConfig = [
3020
+ { type: 'asset_media', display: 'Media' },
3021
+ { type: 'asset_print', display: 'Print' },
3022
+ { type: 'quiz', display: 'Quiz' },
3023
+ { type: 'question', display: 'Question' },
3024
+ { type: 'chapter', display: 'Chapter' },
3025
+ { type: 'tp', display: 'Topic' },
3026
+ { type: 'whiteboard', display: 'Whiteboard' },
3027
+ { type: 'widget', display: 'Widget' },
3028
+ { type: 'casset_media', display: 'cMedia' },
3029
+ { type: 'casset_print', display: 'cPrint' },
3030
+ { type: 'cquiz', display: 'cQuiz' },
3031
+ { type: 'cquestion', display: 'cQuestion' },
3032
+ { type: 'image', display: 'Image' },
3033
+ { type: 'video', display: 'Video' },
3034
+ { type: 'tools', display: 'Tools' },
3035
+ { type: 'feature', display: 'Feature' },
3036
+ { type: 'ebook', display: 'Ebook' }
3037
+ ];
3038
+ var asset = assetTypeConfig.find(function (value) { return value.type === key; });
3039
+ return asset ? asset.display : key;
3040
+ };
3041
+ FullTableViewComponent.prototype.formatDate = function (now) {
3042
+ var hours = now.getHours();
3043
+ var minutes = now.getMinutes();
3044
+ var seconds = now.getSeconds();
3045
+ var ampm = hours >= 12 ? 'PM' : 'AM';
3046
+ hours = hours % 12 || 12;
3047
+ return hours.toString().padStart(2, '0') + ":" + minutes
3048
+ .toString()
3049
+ .padStart(2, '0') + ":" + seconds.toString().padStart(2, '0') + " " + ampm;
3050
+ };
3051
+ FullTableViewComponent.prototype.formatTime = function (seconds) {
3052
+ var days = Math.floor(seconds / 86400);
3053
+ var hours = Math.floor((seconds % 86400) / 3600);
3054
+ var minutes = Math.floor((seconds % 3600) / 60);
3055
+ var secs = seconds % 60;
3056
+ if (seconds < 60)
3057
+ return secs + "s";
3058
+ if (seconds < 3600)
3059
+ return minutes + "m " + secs + "s";
3060
+ if (seconds < 86400)
3061
+ return hours + "h " + minutes + "m " + secs + "s";
3062
+ return days + "d " + hours + "h " + minutes + "m " + secs + "s";
3063
+ };
3064
+ FullTableViewComponent.prototype.loadTable = function (data) {
3065
+ /*
3066
+ const tableBody = document.querySelector("#teacherTable tbody");
3067
+
3068
+ data.forEach((item) => {
3069
+ const row = document.createElement("tr");
3070
+ for (const key in item) {
3071
+ const cell = document.createElement("td");
3072
+ cell.textContent = item[key];
3073
+ if (key !== "userId") {
3074
+ row.appendChild(cell);
3075
+ }
3076
+ }
3077
+ tableBody.appendChild(row);
3078
+ });*/
3079
+ };
3080
+ FullTableViewComponent.prototype.toggleUsers = function () {
3081
+ this.usersCheckboxChecked = !this.usersCheckboxChecked;
3082
+ this.loadTable(this.usersCheckboxChecked
3083
+ ? this.allUsers
3084
+ : this.currentUserArray);
3085
+ };
3086
+ FullTableViewComponent.prototype.getMockJson = function () {
3087
+ // Replace with actual data fetching logic
3088
+ return {};
3089
+ };
3090
+ return FullTableViewComponent;
3091
+ }());
3092
+ FullTableViewComponent.decorators = [
3093
+ { type: i0.Component, args: [{
3094
+ selector: 'lib-full-table-view',
3095
+ template: "\n<div class=\"tableViewList\" *ngIf=\"isDisplay\">\n <!-- <label for=\"usersCheckbox\">All</label>\n <input\n type=\"checkbox\"\n id=\"usersCheckbox\"\n [checked]=\"usersCheckboxChecked\"\n (change)=\"toggleUsers()\"\n /> -->\n <div class=\"tableArea\">\n \n <table id=\"teacherTable\">\n <thead class=\"tablehead\">\n <tr>\n <th>Teacher Name</th>\n <th>Subjects</th>\n <th>Date</th>\n <th>Start Time</th>\n <th>End Time</th>\n <th>Total Duration</th>\n <th>Room</th>\n <th>Topic</th>\n <th>Subject</th>\n <th>Chapter</th>\n <th>Grade</th>\n <th>Details</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let user of currentUserArray\">\n <td>{{ user.teacherName }}</td>\n <td>{{ user.subjects }}</td>\n <td>{{ user.date }}</td>\n <td>{{ user.startTime }}</td>\n <td>{{ user.endtime }}</td>\n <td>{{ user.totalDuration }}</td>\n <td>{{ user.room }}</td>\n <td>{{ user.tp }}</td>\n <td>{{ user.subject }}</td>\n <td>{{ user.chapter }}</td>\n <td>{{ user.grade }}</td>\n <td><div [innerHTML]=\"user.details\"></div></td>\n </tr>\n </tbody>\n </table>\n </div>\n \n</div>\n ",
3096
+ styles: ["body{font-family:Arial,sans-serif;margin:20px}.tablehead{position:sticky;top:0;background:#fff}table{width:100%;border-collapse:collapse}td,th{border:1px solid #ddd;padding:8px;text-align:left}th{background-color:#f4f4f4;font-weight:700}tr:nth-child(2n){background-color:#f9f9f9}tr:hover{background-color:#f1f1f1}.tableViewList{position:absolute;margin-top:20px}.tableArea{height:700px;overflow:scroll;font-size:12px;margin:20px 5px 5px}.seenTag{color:#00f}"]
3097
+ },] }
3098
+ ];
3099
+ FullTableViewComponent.ctorParameters = function () { return [
3100
+ { type: PrincipalDashboardLibV2Service }
3101
+ ]; };
3102
+ FullTableViewComponent.propDecorators = {
3103
+ data: [{ type: i0.Input }]
3104
+ };
3105
+
3106
+ var SmallTableViewComponent = /** @class */ (function () {
3107
+ function SmallTableViewComponent(pdService) {
3108
+ this.pdService = pdService;
3109
+ this.currentTimeFrameUserArray = [];
3110
+ this.currentUserArray = [];
3111
+ this.remaningUsers = [];
3112
+ this.allUsers = [];
3113
+ this.usersCheckboxChecked = false;
3114
+ this.isDisplay = false;
3115
+ }
3116
+ Object.defineProperty(SmallTableViewComponent.prototype, "data", {
3117
+ set: function (res) {
3118
+ if (res !== null) {
3119
+ //console.log('smallTable',JSON.parse(res));
3120
+ this.jsonResponse = JSON.parse(res);
3121
+ }
3122
+ },
3123
+ enumerable: false,
3124
+ configurable: true
3125
+ });
3126
+ SmallTableViewComponent.prototype.ngOnInit = function () {
3127
+ var _this = this;
3128
+ this.pdService.openSmallTable$.subscribe(function (data) {
3129
+ if (data) {
3130
+ _this.isDisplay = true;
3131
+ var userid = _this.findUserIdByName(data['userDetails'][0]);
3132
+ var startTime = data['userDetails'][1];
3133
+ var endTime = data['userDetails'][3];
3134
+ _this.loadUserData(userid, startTime, endTime);
3135
+ }
3136
+ else {
3137
+ _this.isDisplay = false;
3138
+ }
3139
+ });
3140
+ this.pdService.chartType.subscribe(function (data) {
3141
+ _this.isDisplay = false;
3142
+ });
3143
+ };
3144
+ SmallTableViewComponent.prototype.findUserIdByName = function (name) {
3145
+ var json = this.jsonResponse;
3146
+ var user = json.usersMetadata.userMetadata.find(function (user) { return user.fullName === name; });
3147
+ return user ? user.userId : null;
3148
+ };
3149
+ SmallTableViewComponent.prototype.loadUserData = function (userId, inputStartTime, inputEndTime) {
3150
+ var _this = this;
3151
+ this.currentUserArray = [];
3152
+ this.allUsers = [];
3153
+ this.currentTimeFrameUserArray = [];
3154
+ var json = this.jsonResponse;
3155
+ var usersConsole = json.usersConsole.userConsole;
3156
+ var usersMetadata = json.usersMetadata.userMetadata;
3157
+ var resourcesMetadata = json.resourcesMetadata.resourceMetadata;
3158
+ var filteredUsersConsole = userId
3159
+ ? usersConsole.filter(function (user) { return user.userId === userId; })
3160
+ : usersConsole;
3161
+ filteredUsersConsole.forEach(function (user) {
3162
+ var _a;
3163
+ var userDetails = usersMetadata.find(function (userMeta) { return userMeta.userId === user.userId; });
3164
+ if (user === null || user === void 0 ? void 0 : user.userConsoleResources) {
3165
+ var userConsoleResource = (_a = user.userConsoleResources) === null || _a === void 0 ? void 0 : _a.userConsoleResource;
3166
+ if (userConsoleResource && userConsoleResource.length > 0) {
3167
+ userConsoleResource.forEach(function (userResource, userIndex) {
3168
+ var _a, _b, _c, _d, _e, _f;
3169
+ var resourceId = userResource.resourceId;
3170
+ var resourceDetails = resourcesMetadata.find(function (resource) { return resource.resourceId === resourceId &&
3171
+ userResource.type === resource.type; });
3172
+ var prefix = _this.getDisplayTypeValue(userResource.type);
3173
+ var title = (resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.title) || '';
3174
+ var tp = _this.decodeHtmlEntities((_a = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.teachingPoint) === null || _a === void 0 ? void 0 : _a.title);
3175
+ var subject = _this.decodeHtmlEntities((_b = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.subject) === null || _b === void 0 ? void 0 : _b.title);
3176
+ var chapter = _this.decodeHtmlEntities((_c = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.chapter) === null || _c === void 0 ? void 0 : _c.title);
3177
+ var grade = _this.decodeHtmlEntities((_d = resourceDetails === null || resourceDetails === void 0 ? void 0 : resourceDetails.grade) === null || _d === void 0 ? void 0 : _d.title);
3178
+ var startTime = new Date(user === null || user === void 0 ? void 0 : user.startTime);
3179
+ var endTime = new Date(user === null || user === void 0 ? void 0 : user.endTime);
3180
+ var totalDuration = _this.formatTime(Math.round((endTime.getTime() - startTime.getTime()) / 1000));
3181
+ var duration = parseInt((userResource === null || userResource === void 0 ? void 0 : userResource.duration) || '0');
3182
+ //duration = duration === 0 ? "<span class='dddd'>(Seen)</span>" : this.formatTime(duration);
3183
+ if (((_e = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _e === void 0 ? void 0 : _e.includes('question')) || ((_f = userResource === null || userResource === void 0 ? void 0 : userResource.type) === null || _f === void 0 ? void 0 : _f.includes('cquestion'))) {
3184
+ duration = 0;
3185
+ }
3186
+ else {
3187
+ duration = duration === 0 ? "<span class='dddd'>(Seen)</span>" : _this.formatTime(duration);
3188
+ }
3189
+ var finalAssetTitle = prefix + " : " + title + " : " + duration;
3190
+ if (title === '') {
3191
+ finalAssetTitle = prefix + " : " + duration;
3192
+ }
3193
+ _this.currentUserArray.push({
3194
+ userId: user.userId,
3195
+ teacherName: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.fullName : '',
3196
+ subjects: userIndex === 0 ? userDetails === null || userDetails === void 0 ? void 0 : userDetails.userSubjects : '',
3197
+ date: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.selectedDate : '',
3198
+ startTime: userIndex === 0 ? _this.formatDate(startTime) : _this.formatDate(startTime),
3199
+ endtime: userIndex === 0 ? _this.formatDate(endTime) : _this.formatDate(endTime),
3200
+ totalDuration: userIndex === 0 ? totalDuration : '',
3201
+ room: userIndex === 0 ? user === null || user === void 0 ? void 0 : user.terminalIP : '',
3202
+ tp: tp,
3203
+ subject: subject,
3204
+ chapter: chapter,
3205
+ grade: grade,
3206
+ details: finalAssetTitle,
3207
+ });
3208
+ });
3209
+ }
3210
+ }
3211
+ });
3212
+ var currentUserIds = this.currentUserArray
3213
+ .map(function (x) { return x.userId; })
3214
+ .filter(function (x, i, a) { return a.indexOf(x) === i; });
3215
+ this.remaningUsers = usersMetadata
3216
+ .filter(function (user) { return !currentUserIds.includes(user.userId); })
3217
+ .map(function (user) {
3218
+ return {
3219
+ userId: user.userId,
3220
+ teacherName: user === null || user === void 0 ? void 0 : user.fullName,
3221
+ subjects: user === null || user === void 0 ? void 0 : user.userSubjects,
3222
+ date: '',
3223
+ startTime: '',
3224
+ endtime: '',
3225
+ totalDuration: '0s',
3226
+ room: '',
3227
+ tp: '',
3228
+ subject: '',
3229
+ chapter: '',
3230
+ grade: '',
3231
+ details: '',
3232
+ };
3233
+ });
3234
+ this.allUsers = __spread(this.currentUserArray, this.remaningUsers);
3235
+ this.currentTimeFrameUserArray = this.filterDataByCriteria(this.currentUserArray, userId, inputStartTime, inputEndTime);
3236
+ console.log('smallData', this.currentTimeFrameUserArray);
3237
+ };
3238
+ SmallTableViewComponent.prototype.filterDataByCriteria = function (userData, inputUserId, inputStartTime, inputEndTime) {
3239
+ var parseTime = function (timeString) {
3240
+ if (!timeString)
3241
+ return null;
3242
+ var _g = __read(timeString.split(' '), 2), time = _g[0], meridian = _g[1];
3243
+ var _h = __read(time.split(':').map(Number), 3), hours = _h[0], minutes = _h[1], seconds = _h[2];
3244
+ var isPM = meridian === 'PM';
3245
+ return new Date(0, 0, 0, isPM && hours < 12 ? hours + 12 : hours, minutes, seconds);
3246
+ };
3247
+ var startTime = parseTime(inputStartTime);
3248
+ var endTime = parseTime(inputEndTime);
3249
+ var filteredData = userData.filter(function (entry) {
3250
+ if (entry.userId !== inputUserId)
3251
+ return false;
3252
+ if (!entry.startTime || !entry.endtime)
3253
+ return false;
3254
+ var entryStart = parseTime(entry.startTime);
3255
+ var entryEnd = parseTime(entry.endtime);
3256
+ return entryStart && entryEnd && entryStart >= startTime && entryEnd <= endTime;
3257
+ });
3258
+ return filteredData.map(function (entry, index) { return (Object.assign(Object.assign({}, entry), { subsequentCount: index })); });
3259
+ };
3260
+ // Converts entities like &#8242; or &amp; into their characters so they render as text
3261
+ SmallTableViewComponent.prototype.decodeHtmlEntities = function (value) {
3262
+ if (!value)
3263
+ return value;
3264
+ var textarea = document.createElement('textarea');
3265
+ textarea.innerHTML = value;
3266
+ return textarea.value;
3267
+ };
3268
+ SmallTableViewComponent.prototype.getDisplayTypeValue = function (key) {
3269
+ var assetTypeConfig = [
3270
+ { type: 'asset_media', display: 'Media' },
3271
+ { type: 'asset_print', display: 'Print' },
3272
+ { type: 'quiz', display: 'Quiz' },
3273
+ { type: 'question', display: 'Question' },
3274
+ { type: 'chapter', display: 'Chapter' },
3275
+ { type: 'tp', display: 'Topic' },
3276
+ { type: 'whiteboard', display: 'Whiteboard' },
3277
+ { type: 'widget', display: 'Widget' },
3278
+ { type: 'casset_media', display: 'cMedia' },
3279
+ { type: 'casset_print', display: 'cPrint' },
3280
+ { type: 'cquiz', display: 'cQuiz' },
3281
+ { type: 'cquestion', display: 'cQuestion' },
3282
+ { type: 'image', display: 'Image' },
3283
+ { type: 'video', display: 'Video' },
3284
+ { type: 'tools', display: 'Tools' },
3285
+ { type: 'feature', display: 'Feature' },
3286
+ ];
3287
+ var asset = assetTypeConfig.find(function (value) { return value.type === key; });
3288
+ return asset ? asset.display : key;
3289
+ };
3290
+ SmallTableViewComponent.prototype.formatDate = function (now) {
3291
+ var hours = now.getHours();
3292
+ var minutes = now.getMinutes();
3293
+ var seconds = now.getSeconds();
3294
+ var ampm = hours >= 12 ? 'PM' : 'AM';
3295
+ hours = hours % 12 || 12;
3296
+ return hours.toString().padStart(2, '0') + ":" + minutes
3297
+ .toString()
3298
+ .padStart(2, '0') + ":" + seconds.toString().padStart(2, '0') + " " + ampm;
3299
+ };
3300
+ SmallTableViewComponent.prototype.formatTime = function (seconds) {
3301
+ var days = Math.floor(seconds / 86400);
3302
+ var hours = Math.floor((seconds % 86400) / 3600);
3303
+ var minutes = Math.floor((seconds % 3600) / 60);
3304
+ var secs = seconds % 60;
3305
+ if (seconds < 60)
3306
+ return secs + "s";
3307
+ if (seconds < 3600)
3308
+ return minutes + "m " + secs + "s";
3309
+ if (seconds < 86400)
3310
+ return hours + "h " + minutes + "m " + secs + "s";
3311
+ return days + "d " + hours + "h " + minutes + "m " + secs + "s";
3312
+ };
3313
+ SmallTableViewComponent.prototype.loadTable = function (data) {
3314
+ /*
3315
+ const tableBody = document.querySelector("#teacherTable tbody");
3316
+
3317
+ data.forEach((item) => {
3318
+ const row = document.createElement("tr");
3319
+ for (const key in item) {
3320
+ const cell = document.createElement("td");
3321
+ cell.textContent = item[key];
3322
+ if (key !== "userId") {
3323
+ row.appendChild(cell);
3324
+ }
3325
+ }
3326
+ tableBody.appendChild(row);
3327
+ });*/
3328
+ };
3329
+ SmallTableViewComponent.prototype.toggleUsers = function () {
3330
+ this.usersCheckboxChecked = !this.usersCheckboxChecked;
3331
+ this.loadTable(this.usersCheckboxChecked
3332
+ ? this.allUsers
3333
+ : this.currentUserArray);
3334
+ };
3335
+ SmallTableViewComponent.prototype.onCloseBtnClick = function () {
3336
+ this.isDisplay = false;
3337
+ //this.pdService.openSmallTable.next(false);
3338
+ };
3339
+ return SmallTableViewComponent;
3340
+ }());
3341
+ SmallTableViewComponent.decorators = [
3342
+ { type: i0.Component, args: [{
3343
+ selector: 'lib-small-table-view',
3344
+ template: "<div id=\"pd-deatilViewContainer\" *ngIf=\"isDisplay\">\n <div class=\"pd-detailview-header\">\n <div class=\"pd-detailview-title\">Details</div>\n <div id=\"pd-closeButton\" (click)=\"onCloseBtnClick()\">+</div>\n </div>\n\n <div class=\"newTablesContainer\">\n\n <table id=\"userDataTable\" class=\"table table-bordered\">\n <tbody>\n <tr>\n <th style=\"font-weight: bold;\"><label>Name:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.teacherName || '' }}</label></td>\n <th style=\"font-weight: bold;\"><label>Start Time:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.startTime || '' }}</label></td>\n </tr>\n <tr>\n <th style=\"font-weight: bold;\"><label>Subject:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.subject || '' }}</label></td>\n <th style=\"font-weight: bold;\"><label>End Time:</label></th>\n <td><label>{{ currentTimeFrameUserArray[0]?.endtime || '' }}</label></td>\n </tr>\n <tr>\n <th style=\"font-weight: bold;\"><label>Room Details:</label></th>\n <td><label> {{ currentTimeFrameUserArray[0]?.room || '' }}</label></td>\n </tr>\n </tbody>\n </table>\n \n \n\n <table class=\"table table-bordered\" id=\"resoureMetadataTable\">\n <tbody>\n <tr>\n <th style=\"font-weight: bold;\"><label>Subject</label></th>\n <th style=\"font-weight: bold;\"><label>Class</label></th>\n <th style=\"font-weight: bold;\"><label>Chapter Name</label></th>\n <th style=\"font-weight: bold;\"><label>Topic Name</label></th>\n <th style=\"font-weight: bold;\"><label>Assets Details</label></th>\n </tr>\n <tr *ngFor=\"let item of currentTimeFrameUserArray\">\n <td><label>{{ item.subject || '' }}</label></td>\n <td><label>{{ item.grade || '' }}</label></td>\n <td><label>{{ item.chapter || '' }}</label></td>\n <td [innerHTML]=\"item.tp || ''\"></td> <!-- Use innerHTML to handle HTML content -->\n <td [innerHTML]=\"item.details || ''\"></td> <!-- Assets Details column -->\n </tr>\n </tbody>\n </table>\n\n \n </div> \n </div>",
3345
+ 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}.newTablesContainer{overflow:scroll;height:310px;padding:3px;background:#fff;margin-bottom:2px}.dddd{color:#00f!important}"]
3346
+ },] }
3347
+ ];
3348
+ SmallTableViewComponent.ctorParameters = function () { return [
3349
+ { type: PrincipalDashboardLibV2Service }
3350
+ ]; };
3351
+ SmallTableViewComponent.propDecorators = {
3352
+ data: [{ type: i0.Input }]
3353
+ };
3354
+
3355
+ var PrincipalDashboardLibV2Module = /** @class */ (function () {
3356
+ function PrincipalDashboardLibV2Module() {
3357
+ }
3358
+ return PrincipalDashboardLibV2Module;
3359
+ }());
3360
+ PrincipalDashboardLibV2Module.decorators = [
3361
+ { type: i0.NgModule, args: [{
3362
+ declarations: [
3363
+ ChartheaderComponent,
3364
+ ChartviewComponent,
3365
+ DetailedviewComponent,
3366
+ HeaderComponent,
3367
+ TableviewComponent,
3368
+ PrincipalDashboardLibV2Component,
3369
+ FullTableViewComponent,
3370
+ SmallTableViewComponent
3371
+ ],
3372
+ imports: [
3373
+ common.CommonModule,
3374
+ angularGoogleCharts.GoogleChartsModule,
3375
+ ng2Datepicker.DatepickerModule
3376
+ ],
3377
+ exports: [
3378
+ PrincipalDashboardLibV2Component
3379
+ ]
3380
+ },] }
3381
+ ];
3382
+
3383
+ /*
3384
+ * Public API Surface of principal-dashboard-lib-v2
3385
+ */
3386
+
3387
+ /**
3388
+ * Generated bundle index. Do not edit.
3389
+ */
3390
+
3391
+ exports.PrincipalDashboardLibV2Component = PrincipalDashboardLibV2Component;
3392
+ exports.PrincipalDashboardLibV2Module = PrincipalDashboardLibV2Module;
3393
+ exports.PrincipalDashboardLibV2Service = PrincipalDashboardLibV2Service;
3394
+ exports.ɵa = ChartheaderComponent;
3395
+ exports.ɵb = ChartviewComponent;
3396
+ exports.ɵc = DetailedviewComponent;
3397
+ exports.ɵd = HeaderComponent;
3398
+ exports.ɵe = ExceldataService;
3399
+ exports.ɵf = TableviewComponent;
3400
+ exports.ɵg = FullTableViewComponent;
3401
+ exports.ɵh = SmallTableViewComponent;
3402
+
3403
+ Object.defineProperty(exports, '__esModule', { value: true });
3404
+
3405
+ })));
3406
+ //# sourceMappingURL=principal-dashboard-lib-v2.umd.js.map