kwikid-agent-dashboard 0.0.21 → 0.0.22

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.
@@ -1,201 +1,39 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, ViewChildren, EventEmitter, Component, Input, Output, HostListener, ViewChild, Pipe, Inject, NgModule } from '@angular/core';
3
- import * as i5 from '@angular/google-maps';
2
+ import { Injectable, ViewChildren, EventEmitter, Component, Input, Output, HostListener, Pipe, Inject, ViewChild, NgModule } from '@angular/core';
4
3
  import { MapInfoWindow, GoogleMapsModule } from '@angular/google-maps';
5
- import * as i11 from '@taiga-ui/core';
4
+ import * as i10 from '@taiga-ui/core';
6
5
  import { TuiDialogService, TuiRootModule, TuiDialogModule, TuiDropdownModule, TuiGroupModule, TuiSvgModule } from '@taiga-ui/core';
7
- import { of } from 'rxjs';
8
- import { map, catchError } from 'rxjs/operators';
9
6
  import { __awaiter } from 'tslib';
7
+ import * as L from 'leaflet';
8
+ import 'leaflet-routing-machine';
9
+ import { checkObjectPathExists, getObjectValueFromPath, isEmptyValue } from 'kwikid-toolkit';
10
10
  import * as i3$1 from '@angular/common/http';
11
11
  import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
12
12
  import * as i2 from 'kwikui';
13
13
  import { KwikUIButtonModule, KwikUIInputModule, KwikUIInputDateModule, KwikUIInputDateRangeModule, KwikUIInputSelectModule, KwikUITableModule, KwikUITablePaginationModule } from 'kwikui';
14
- import { getObjectValueFromPath, isEmptyValue } from 'kwikid-toolkit';
15
- import * as i6 from '@angular/common';
14
+ import * as i5 from '@angular/common';
16
15
  import { CommonModule } from '@angular/common';
17
16
  import * as i5$1 from '@angular/forms';
18
17
  import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
19
- import * as i10 from '@taiga-ui/cdk';
18
+ import * as i9 from '@taiga-ui/cdk';
20
19
  import { TuiDayRange, TuiDay, TuiActiveZoneModule } from '@taiga-ui/cdk';
21
20
  import * as i3 from '@angular/cdk/scrolling';
22
21
  import { ScrollingModule } from '@angular/cdk/scrolling';
23
- import * as i8 from 'kwikid-forms';
22
+ import * as i7 from 'kwikid-forms';
24
23
  import { KwikIDFormViewModule } from 'kwikid-forms';
25
24
  import { TuiSidebarModule } from '@taiga-ui/addon-mobile';
26
25
 
27
- class MapService {
28
- constructor(mapDirectionsService) {
29
- this.mapDirectionsService = mapDirectionsService;
30
- this.markers = [];
31
- this.directionsRenderOption = {};
32
- }
33
- getMarkers() {
34
- return this.markers;
35
- }
36
- setMarkers(markers) {
37
- this.markers = markers;
38
- }
39
- initMap() {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- this.myPosition = yield this.getPosition();
42
- this.map = {
43
- zoom: 10,
44
- center: this.myPosition,
45
- streetViewControl: false,
46
- mapTypeControl: false,
47
- fullscreenControl: false,
48
- zoomControl: false
49
- };
50
- });
51
- }
52
- plotMarkers(customers) {
53
- this.markers = [];
54
- let path = [];
55
- this.markers.push(this.myPosition);
56
- const request = {
57
- origin: this.myPosition,
58
- destination: this.myPosition,
59
- waypoints: path,
60
- optimizeWaypoints: true,
61
- travelMode: google.maps.TravelMode.DRIVING
62
- };
63
- this.directionsRenderOption = {
64
- suppressMarkers: true
65
- };
66
- this.directionsResults$ = this.mapDirectionsService
67
- .route(request)
68
- .pipe(map((response) => response.result));
69
- this.directionsResults$.subscribe((val) => {
70
- customers = this.sortList(val.routes[0].waypoint_order, customers);
71
- customers.map((customer) => {
72
- path.push({
73
- location: this.getLatLng(customer.task_details.customer_details.location),
74
- stopover: true
75
- });
76
- this.markers.push(this.getLatLng(customer.task_details.customer_details.location));
77
- });
78
- });
79
- return this.directionsResults$;
80
- }
81
- getPosition() {
82
- return new Promise((resolve, reject) => {
83
- navigator.geolocation.watchPosition((resp) => {
84
- resolve({
85
- lng: resp.coords.longitude,
86
- lat: resp.coords.latitude
87
- });
88
- }, (err) => {
89
- reject(err);
90
- });
91
- });
92
- }
93
- getLatLng(data) {
94
- let url = data.split('@');
95
- let lat_long_match = url[1].split(',');
96
- let lat = Number(lat_long_match[0]);
97
- let long = Number(lat_long_match[1]);
98
- return { lat: lat, lng: long };
99
- }
100
- sortList(order, customersData) {
101
- let c = [];
102
- for (let i = 0; i < customersData.length; i++) {
103
- let customer = customersData[order[i]];
104
- c.push(customer);
105
- }
106
- return c;
107
- }
108
- }
109
- /** @nocollapse */ MapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, deps: [{ token: i5.MapDirectionsService }], target: i0.ɵɵFactoryTarget.Injectable });
110
- /** @nocollapse */ MapService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, providedIn: 'root' });
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, decorators: [{
112
- type: Injectable,
113
- args: [{
114
- providedIn: 'root'
115
- }]
116
- }], ctorParameters: function () { return [{ type: i5.MapDirectionsService }]; }, propDecorators: { directionsRenders: [{
117
- type: ViewChildren,
118
- args: ['directionsRender']
119
- }] } });
120
-
121
- class UserService {
26
+ class AgentService {
122
27
  constructor() {
123
28
  this.isListOpen = true;
124
29
  this.showMapview = false;
125
- this.addTaskFormConfig = {
30
+ this.addTaskForm = {
126
31
  key: 'ADD_TASK',
127
32
  title: 'Add Task',
128
33
  fields: [
129
34
  {
130
35
  key: 'name',
131
36
  label: 'Customer Name',
132
- disabled: false,
133
- messages: [],
134
- default: {
135
- value: {
136
- is_found: false,
137
- value: '',
138
- sources: [
139
- {
140
- key: 'OBJECT',
141
- props: {
142
- object: {
143
- key: 'ALL_FORMS_DATA',
144
- path: '$.ADD_TASK.name'
145
- }
146
- },
147
- value: '',
148
- validation: {
149
- is_valid: false,
150
- triggers: ['ON_INIT'],
151
- rules: [
152
- {
153
- id: '1',
154
- key: 'VALUE_CHECK',
155
- props: {
156
- value: {
157
- source: {
158
- key: 'OBJECT',
159
- props: {
160
- object: {
161
- key: 'ALL_FORMS_DATA',
162
- path: '$.ADD_TASK.name'
163
- }
164
- }
165
- }
166
- },
167
- pattern: {
168
- key: 'IS_NOT_EMPTY'
169
- }
170
- }
171
- }
172
- ],
173
- actions: [
174
- {
175
- id: '1',
176
- key: 'SET_FIELD_DEFAULT_VALUE',
177
- condition: '1',
178
- props: {
179
- fieldKey: 'name',
180
- value: {
181
- source: {
182
- key: 'OBJECT',
183
- props: {
184
- object: {
185
- key: 'ALL_FORMS_DATA',
186
- path: '$.ADD_TASK.name'
187
- }
188
- }
189
- }
190
- }
191
- }
192
- }
193
- ]
194
- }
195
- }
196
- ]
197
- }
198
- },
199
37
  validators: {
200
38
  required: true
201
39
  },
@@ -209,73 +47,6 @@ class UserService {
209
47
  {
210
48
  key: 'phone',
211
49
  label: 'Phone Number',
212
- disabled: false,
213
- messages: [],
214
- default: {
215
- value: {
216
- is_found: false,
217
- value: '',
218
- sources: [
219
- {
220
- key: 'OBJECT',
221
- props: {
222
- object: {
223
- key: 'ALL_FORMS_DATA',
224
- path: '$.ADD_TASK.phone'
225
- }
226
- },
227
- value: '',
228
- validation: {
229
- is_valid: false,
230
- triggers: ['ON_INIT'],
231
- rules: [
232
- {
233
- id: '1',
234
- key: 'VALUE_CHECK',
235
- props: {
236
- value: {
237
- source: {
238
- key: 'OBJECT',
239
- props: {
240
- object: {
241
- key: 'ALL_FORMS_DATA',
242
- path: '$.ADD_TASK.phone'
243
- }
244
- }
245
- }
246
- },
247
- pattern: {
248
- key: 'IS_NOT_EMPTY'
249
- }
250
- }
251
- }
252
- ],
253
- actions: [
254
- {
255
- id: '1',
256
- key: 'SET_FIELD_DEFAULT_VALUE',
257
- condition: '1',
258
- props: {
259
- fieldKey: 'phone',
260
- value: {
261
- source: {
262
- key: 'OBJECT',
263
- props: {
264
- object: {
265
- key: 'ALL_FORMS_DATA',
266
- path: '$.ADD_TASK.phone'
267
- }
268
- }
269
- }
270
- }
271
- }
272
- }
273
- ]
274
- }
275
- }
276
- ]
277
- }
278
- },
279
50
  validators: {
280
51
  required: true
281
52
  },
@@ -291,73 +62,6 @@ class UserService {
291
62
  {
292
63
  key: 'address',
293
64
  label: 'Address',
294
- disabled: false,
295
- messages: [],
296
- default: {
297
- value: {
298
- is_found: false,
299
- value: '',
300
- sources: [
301
- {
302
- key: 'OBJECT',
303
- props: {
304
- object: {
305
- key: 'ALL_FORMS_DATA',
306
- path: '$.ADD_TASK.address'
307
- }
308
- },
309
- value: '',
310
- validation: {
311
- is_valid: false,
312
- triggers: ['ON_INIT'],
313
- rules: [
314
- {
315
- id: '1',
316
- key: 'VALUE_CHECK',
317
- props: {
318
- value: {
319
- source: {
320
- key: 'OBJECT',
321
- props: {
322
- object: {
323
- key: 'ALL_FORMS_DATA',
324
- path: '$.ADD_TASK.address'
325
- }
326
- }
327
- }
328
- },
329
- pattern: {
330
- key: 'IS_NOT_EMPTY'
331
- }
332
- }
333
- }
334
- ],
335
- actions: [
336
- {
337
- id: '1',
338
- key: 'SET_FIELD_DEFAULT_VALUE',
339
- condition: '1',
340
- props: {
341
- fieldKey: 'address',
342
- value: {
343
- source: {
344
- key: 'OBJECT',
345
- props: {
346
- object: {
347
- key: 'ALL_FORMS_DATA',
348
- path: '$.ADD_TASK.address'
349
- }
350
- }
351
- }
352
- }
353
- }
354
- }
355
- ]
356
- }
357
- }
358
- ]
359
- }
360
- },
361
65
  validators: {
362
66
  required: true
363
67
  },
@@ -371,73 +75,6 @@ class UserService {
371
75
  {
372
76
  key: 'city',
373
77
  label: 'City',
374
- disabled: false,
375
- messages: [],
376
- default: {
377
- value: {
378
- is_found: false,
379
- value: '',
380
- sources: [
381
- {
382
- key: 'OBJECT',
383
- props: {
384
- object: {
385
- key: 'ALL_FORMS_DATA',
386
- path: '$.ADD_TASK.city'
387
- }
388
- },
389
- value: '',
390
- validation: {
391
- is_valid: false,
392
- triggers: ['ON_INIT'],
393
- rules: [
394
- {
395
- id: '1',
396
- key: 'VALUE_CHECK',
397
- props: {
398
- value: {
399
- source: {
400
- key: 'OBJECT',
401
- props: {
402
- object: {
403
- key: 'ALL_FORMS_DATA',
404
- path: '$.ADD_TASK.city'
405
- }
406
- }
407
- }
408
- },
409
- pattern: {
410
- key: 'IS_NOT_EMPTY'
411
- }
412
- }
413
- }
414
- ],
415
- actions: [
416
- {
417
- id: '1',
418
- key: 'SET_FIELD_DEFAULT_VALUE',
419
- condition: '1',
420
- props: {
421
- fieldKey: 'city',
422
- value: {
423
- source: {
424
- key: 'OBJECT',
425
- props: {
426
- object: {
427
- key: 'ALL_FORMS_DATA',
428
- path: '$.ADD_TASK.city'
429
- }
430
- }
431
- }
432
- }
433
- }
434
- }
435
- ]
436
- }
437
- }
438
- ]
439
- }
440
- },
441
78
  validators: {
442
79
  required: true
443
80
  },
@@ -451,73 +88,6 @@ class UserService {
451
88
  {
452
89
  key: 'location',
453
90
  label: 'Location URL',
454
- disabled: false,
455
- messages: [],
456
- default: {
457
- value: {
458
- is_found: false,
459
- value: '',
460
- sources: [
461
- {
462
- key: 'OBJECT',
463
- props: {
464
- object: {
465
- key: 'ALL_FORMS_DATA',
466
- path: '$.ADD_TASK.location'
467
- }
468
- },
469
- value: '',
470
- validation: {
471
- is_valid: false,
472
- triggers: ['ON_INIT'],
473
- rules: [
474
- {
475
- id: '1',
476
- key: 'VALUE_CHECK',
477
- props: {
478
- value: {
479
- source: {
480
- key: 'OBJECT',
481
- props: {
482
- object: {
483
- key: 'ALL_FORMS_DATA',
484
- path: '$.ADD_TASK.location'
485
- }
486
- }
487
- }
488
- },
489
- pattern: {
490
- key: 'IS_NOT_EMPTY'
491
- }
492
- }
493
- }
494
- ],
495
- actions: [
496
- {
497
- id: '1',
498
- key: 'SET_FIELD_DEFAULT_VALUE',
499
- condition: '1',
500
- props: {
501
- fieldKey: 'location',
502
- value: {
503
- source: {
504
- key: 'OBJECT',
505
- props: {
506
- object: {
507
- key: 'ALL_FORMS_DATA',
508
- path: '$.ADD_TASK.location'
509
- }
510
- }
511
- }
512
- }
513
- }
514
- }
515
- ]
516
- }
517
- }
518
- ]
519
- }
520
- },
521
91
  validators: {
522
92
  required: true
523
93
  },
@@ -553,25 +123,271 @@ class UserService {
553
123
  };
554
124
  }
555
125
  ngOnInit() { }
556
- setAgentConfig(agentConfig) {
557
- this.agentConfig = agentConfig;
126
+ setAgentConfig(config) {
127
+ this.config = config;
558
128
  }
559
129
  toggleMapview() {
560
130
  this.showMapview = !this.showMapview;
561
131
  }
562
132
  }
563
- /** @nocollapse */ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
564
- /** @nocollapse */ UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UserService, providedIn: 'root' });
565
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: UserService, decorators: [{
133
+ /** @nocollapse */ AgentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
134
+ /** @nocollapse */ AgentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, providedIn: 'root' });
135
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, decorators: [{
566
136
  type: Injectable,
567
137
  args: [{
568
138
  providedIn: 'root'
569
139
  }]
570
140
  }], ctorParameters: function () { return []; } });
571
141
 
142
+ class MapService {
143
+ constructor(agentService) {
144
+ this.agentService = agentService;
145
+ this.allMarkers = [];
146
+ }
147
+ // To Initialize Map
148
+ initMap() {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ this.myPosition = yield this.getPosition();
151
+ this.map = L.map('map', {
152
+ center: [this.myPosition.lat, this.myPosition.lng],
153
+ zoom: 13
154
+ });
155
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(this.map);
156
+ });
157
+ }
158
+ // To Add Marker in Map
159
+ addMarker({ lat, lng, title, color }) {
160
+ L.marker([lat, lng], {
161
+ icon: L.icon({
162
+ iconUrl: color == 'red' ? 'assets/map-marker-0.png' : 'assets/map-marker-1.png'
163
+ })
164
+ })
165
+ .addTo(this.map)
166
+ .bindPopup(title);
167
+ }
168
+ // To Plot Directions for All Tasks
169
+ plotDirectionsForAllTasks(tasks) {
170
+ if (this.map) {
171
+ this.allMarkers = [];
172
+ // Create Agent Marker & Plot It.
173
+ const myMarker = {
174
+ lat: this.myPosition.lat,
175
+ lng: this.myPosition.lng,
176
+ title: 0,
177
+ color: 'red'
178
+ };
179
+ this.addMarker(myMarker);
180
+ this.allMarkers.push(myMarker);
181
+ // Create Markers for all Tasks
182
+ tasks.map((task, index) => {
183
+ const marker = this.getLatLng(this.getLocation(task), index);
184
+ this.allMarkers.push(marker);
185
+ });
186
+ // Run Algorithm to get optimized Routes
187
+ const startingPoint = this.allMarkers[0];
188
+ const unvisitedWaypoints = this.allMarkers.slice(1);
189
+ const optimizedRoute = this.nearestNeighborAlgorithm(startingPoint, unvisitedWaypoints);
190
+ // Sort All Markers as per optimized routes
191
+ this.allMarkers = this.sortTasksAsPerDistance(optimizedRoute, this.allMarkers, true);
192
+ // Sort All Tasks as per optimized routes
193
+ tasks = this.sortTasksAsPerDistance(optimizedRoute.slice(1), tasks, false);
194
+ // Plot Markers for All Tasks
195
+ tasks.map((task, index) => {
196
+ const marker = this.getLatLng(this.getLocation(task), index);
197
+ this.addMarker(marker);
198
+ });
199
+ // Set Styles for all Task Routes
200
+ const styles = [
201
+ { color: 'blue', opacity: 1, weight: 8 },
202
+ { color: 'white', opacity: 0.6, weight: 12 }
203
+ ];
204
+ // Set Routes for all Tasks
205
+ this.allTasksRoutes = this.setRoutes(this.allMarkers, styles);
206
+ this.fitMapBounds();
207
+ }
208
+ return tasks;
209
+ }
210
+ // To plot Direction for selected Task
211
+ plotDirectionsForSelectedTask(index) {
212
+ if (index !== null) {
213
+ // Remove Previously Selected Task Route
214
+ if (this.selectedTaskRoutes) {
215
+ this.map.removeControl(this.selectedTaskRoutes);
216
+ }
217
+ // Remove All Tasks Routes
218
+ if (this.allTasksRoutes) {
219
+ this.map.removeControl(this.allTasksRoutes);
220
+ }
221
+ const taskMarker = this.allMarkers[index + 1];
222
+ // If Location is Available in Task Details
223
+ if (taskMarker.color != 'red') {
224
+ const markers = [this.allMarkers[0], taskMarker];
225
+ const styles = [
226
+ { color: 'green', opacity: 1, weight: 8 },
227
+ { color: 'white', opacity: 0.4, weight: 12 }
228
+ ];
229
+ this.selectedTaskRoutes = this.setRoutes(markers, styles);
230
+ this.setSelectedTaskDistanceAndTime();
231
+ }
232
+ else {
233
+ alert('No Location Available');
234
+ }
235
+ }
236
+ // Set All Tasks Routes Again & Remove Selected Tasks route
237
+ else {
238
+ if (this.selectedTaskRoutes) {
239
+ this.map.removeControl(this.selectedTaskRoutes);
240
+ }
241
+ this.map.addControl(this.allTasksRoutes);
242
+ this.selectedTaskRoutes = undefined;
243
+ }
244
+ this.fitMapBounds();
245
+ }
246
+ // Get Distance & Time of Selected Task
247
+ getSelectedTaskDistanceAndTime() {
248
+ return this.selectedTaskDistanceAndTime;
249
+ }
250
+ // Set Distance & Time of Selected Task
251
+ setSelectedTaskDistanceAndTime() {
252
+ this.selectedTaskRoutes.on('routesfound', function (e) {
253
+ let routes = e.routes;
254
+ let summary = routes[0].summary;
255
+ const distance = summary.totalDistance / 1000;
256
+ const time = Math.round((summary.totalTime % 3600) / 60);
257
+ this.selectedTaskDistanceAndTime = {
258
+ distance: distance,
259
+ time: time
260
+ };
261
+ });
262
+ }
263
+ // To sort Task as per nearest distance
264
+ sortTasksAsPerDistance(order, tasks, isMarker) {
265
+ let sortedTasks = [];
266
+ for (let i = 0; i < tasks.length; i++) {
267
+ const title = isMarker ? order[i].title : order[i].title - 1;
268
+ let task = tasks[title];
269
+ sortedTasks.push(task);
270
+ }
271
+ return sortedTasks;
272
+ }
273
+ // To set routes in the maps
274
+ setRoutes(markers, styles) {
275
+ return L.Routing.control({
276
+ waypoints: markers,
277
+ lineOptions: {
278
+ styles: styles
279
+ },
280
+ createMarker: function () {
281
+ return null;
282
+ },
283
+ routeWhileDragging: true
284
+ }).addTo(this.map);
285
+ }
286
+ // To set view point on the map
287
+ fitMapBounds() {
288
+ const markerLatLngs = this.allMarkers.map((marker) => L.latLng(marker.lat, marker.lng));
289
+ this.map.fitBounds(markerLatLngs);
290
+ }
291
+ // To get Current Position
292
+ getPosition() {
293
+ return new Promise((resolve, reject) => {
294
+ navigator.geolocation.watchPosition((resp) => {
295
+ resolve({
296
+ lng: resp.coords.longitude,
297
+ lat: resp.coords.latitude
298
+ });
299
+ }, (err) => {
300
+ reject(err);
301
+ });
302
+ });
303
+ }
304
+ // To extract Location from the Task Details
305
+ getLocation(task) {
306
+ var _a, _b, _c, _d, _e, _f;
307
+ if (checkObjectPathExists(this.agentService.config, 'dashboard.taskLocationPath')) {
308
+ const location = getObjectValueFromPath(task, this.agentService.config.dashboard.taskLocationPath);
309
+ return location;
310
+ }
311
+ else {
312
+ return ((_d = (_c = (_b = (_a = task === null || task === void 0 ? void 0 : task.extras) === null || _a === void 0 ? void 0 : _a.task_details) === null || _b === void 0 ? void 0 : _b.customer_details) === null || _c === void 0 ? void 0 : _c.location) !== null && _d !== void 0 ? _d : (_f = (_e = task === null || task === void 0 ? void 0 : task.task_details) === null || _e === void 0 ? void 0 : _e.customer_details) === null || _f === void 0 ? void 0 : _f.location);
313
+ }
314
+ }
315
+ // To get Latitude & Longitude from Task Location
316
+ getLatLng(data, index) {
317
+ try {
318
+ const url = data.split('@');
319
+ const lat_long_match = url[1].split(',');
320
+ const lat = Number(lat_long_match[0]);
321
+ const long = Number(lat_long_match[1]);
322
+ return { lat: lat, lng: long, title: index + 1, color: 'blue' };
323
+ }
324
+ catch (_a) {
325
+ // If could not find Google Maps Location URL in Task
326
+ return {
327
+ lat: this.myPosition.lat,
328
+ lng: this.myPosition.lng,
329
+ title: index + 1,
330
+ color: 'red'
331
+ };
332
+ }
333
+ }
334
+ // To Calculate Distance between two markers
335
+ calculateDistance(point1, point2) {
336
+ const lat1 = point1.lat;
337
+ const lng1 = point1.lng;
338
+ const lat2 = point2.lat;
339
+ const lng2 = point2.lng;
340
+ const R = 6371; // Earth radius in kilometers
341
+ const dLat = (lat2 - lat1) * (Math.PI / 180);
342
+ const dLng = (lng2 - lng1) * (Math.PI / 180);
343
+ const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
344
+ Math.cos((lat1 * Math.PI) / 180) *
345
+ Math.cos((lat2 * Math.PI) / 180) *
346
+ Math.sin(dLng / 2) *
347
+ Math.sin(dLng / 2);
348
+ const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
349
+ const distance = R * c;
350
+ return distance;
351
+ }
352
+ // To calculate nearest distance from marker
353
+ nearestNeighborAlgorithm(startingPoint, unvisitedPoints) {
354
+ let currentPoint = startingPoint;
355
+ const path = [currentPoint];
356
+ const visitedPoints = new Set([currentPoint]);
357
+ while (unvisitedPoints.length > 0) {
358
+ let nearestPoint = null;
359
+ let minDistance = Number.POSITIVE_INFINITY;
360
+ for (const point of unvisitedPoints) {
361
+ const distance = this.calculateDistance(currentPoint, point);
362
+ if (distance < minDistance) {
363
+ minDistance = distance;
364
+ nearestPoint = point;
365
+ }
366
+ }
367
+ path.push(nearestPoint);
368
+ visitedPoints.add(nearestPoint);
369
+ currentPoint = nearestPoint;
370
+ unvisitedPoints = unvisitedPoints.filter((point) => !visitedPoints.has(point));
371
+ }
372
+ return path;
373
+ }
374
+ }
375
+ /** @nocollapse */ MapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, deps: [{ token: AgentService }], target: i0.ɵɵFactoryTarget.Injectable });
376
+ /** @nocollapse */ MapService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, providedIn: 'root' });
377
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, decorators: [{
378
+ type: Injectable,
379
+ args: [{
380
+ providedIn: 'root'
381
+ }]
382
+ }], ctorParameters: function () { return [{ type: AgentService }]; }, propDecorators: { directionsRenders: [{
383
+ type: ViewChildren,
384
+ args: ['directionsRender']
385
+ }] } });
386
+
572
387
  class CustomerDetailsComponent {
573
- constructor(userService) {
574
- this.userService = userService;
388
+ constructor(agentService, mapService) {
389
+ this.agentService = agentService;
390
+ this.mapService = mapService;
575
391
  this.customer = {
576
392
  agent_id: 'sparkcpaital_dev_agent_1',
577
393
  client_name: 'sparkcpaital_dev',
@@ -608,7 +424,17 @@ class CustomerDetailsComponent {
608
424
  ngOnInit() {
609
425
  var _a, _b, _c;
610
426
  this.viewTaskDetails =
611
- (_c = (_b = (_a = this.agentConfig) === null || _a === void 0 ? void 0 : _a.dashboardConfig) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
427
+ (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
428
+ }
429
+ getTaskCreationTime(task) {
430
+ var _a;
431
+ if (checkObjectPathExists(this.agentService.config, 'dashboard.taskCreationTimePath')) {
432
+ const time = getObjectValueFromPath(task, this.agentService.config.dashboard.taskCreationTimePath);
433
+ return this.convertEpochToDate(time);
434
+ }
435
+ else {
436
+ return this.convertEpochToDate((_a = task === null || task === void 0 ? void 0 : task.task_creation_time) !== null && _a !== void 0 ? _a : task === null || task === void 0 ? void 0 : task.start_time);
437
+ }
612
438
  }
613
439
  convertToTitleCase(inputString) {
614
440
  inputString = inputString.replace('$.task_details.customer_details.', '');
@@ -632,18 +458,19 @@ class CustomerDetailsComponent {
632
458
  goToMaps(location) {
633
459
  window.open(`${location}`, '_blank');
634
460
  }
635
- goToNextStep(e) {
461
+ handleOnClickNext(e) {
636
462
  this.nextStep.emit(e);
637
463
  }
638
464
  close() {
639
- this.userService.showTaskDetails = undefined;
465
+ this.agentService.isShowTaskDetails = undefined;
466
+ this.mapService.plotDirectionsForSelectedTask(null);
640
467
  }
641
468
  handleOnClickRemoveTask(task) {
642
469
  this.removeTask.emit(task);
643
470
  }
644
471
  }
645
- /** @nocollapse */ CustomerDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerDetailsComponent, deps: [{ token: UserService }], target: i0.ɵɵFactoryTarget.Component });
646
- /** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerDetailsComponent, selector: "customer-details", inputs: { customer: "customer", agentConfig: "agentConfig" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, ngImport: i0, template: "<div class=\"customer-details-wrapper\">\n <div class=\"customer-details-heading\">Task Details</div>\n <div class=\"customer-details-body\">\n <div class=\"customer-details-user-id\">\n {{\n agentConfig?.dashboardConfig?.taskIdentifier\n ? getTaskDetails(agentConfig?.dashboardConfig?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n\n <div class=\"customer-details-table\">\n <div\n class=\"customer-details-table-data\"\n *ngFor=\"let taskData of viewTaskDetails\"\n >\n <div class=\"customer-details-table-detail-value\">\n {{ getTaskDetails(taskData) }}\n </div>\n </div>\n </div>\n\n <div class=\"customer-details-date\">\n Task Created on: {{ convertEpochToDate(customer.task_creation_time) }}\n </div>\n\n <div class=\"customer-details-actions\">\n <div class=\"customer-details-task-buttons\">\n <kwikui-button\n *ngIf=\"agentConfig.dashboardConfig?.allowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"agentConfig.dashboardConfig?.showCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'SHARE_JOURNEY_LINK' })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-details-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToMaps(customer?.task_details?.customer_details?.location)\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showStartJourneyButton &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showStartJourneyButton &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'START_JOURNEY' })\n \"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-details-wrapper{display:flex;flex-direction:column;align-items:stretch;overflow:hidden;grid-gap:.5rem;gap:.5rem;padding:1.5rem;height:100%;width:100%}.customer-details-wrapper .customer-details-heading{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:1rem 0;font-size:1.5rem;font-weight:600}.customer-details-wrapper .customer-details-body{display:flex;flex-direction:column;grid-gap:1.25rem;gap:1.25rem}.customer-details-wrapper .customer-details-body .customer-details-user-id{font-size:1.25rem;font-weight:500;padding:.5rem 0}.customer-details-wrapper .customer-details-body .customer-details-table{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:column}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-name{font-weight:500}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-value{word-wrap:break-word}.customer-details-wrapper .customer-details-body .customer-details-date{padding-top:1rem}.customer-details-wrapper .customer-details-body .customer-details-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:1rem 0}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons .customer-share-link{font-size:.7rem}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
472
+ /** @nocollapse */ CustomerDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerDetailsComponent, deps: [{ token: AgentService }, { token: MapService }], target: i0.ɵɵFactoryTarget.Component });
473
+ /** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerDetailsComponent, selector: "customer-details", inputs: { customer: "customer", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, ngImport: i0, template: "<div class=\"customer-details-wrapper\">\n <div class=\"customer-details-heading\">Task Details</div>\n <div class=\"customer-details-body\">\n <div class=\"customer-details-user-id\">\n {{\n config?.dashboard?.taskIdentifier\n ? getTaskDetails(config?.dashboard?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n\n <div class=\"customer-details-table\">\n <div\n class=\"customer-details-table-data\"\n *ngFor=\"let taskData of viewTaskDetails\"\n >\n <div class=\"customer-details-table-detail-value\">\n {{ getTaskDetails(taskData) }}\n </div>\n </div>\n </div>\n\n <div class=\"customer-details-date\">\n Task Created on: {{ getTaskCreationTime(customer) }}\n </div>\n\n <div class=\"customer-details-actions\">\n <div class=\"customer-details-task-buttons\">\n <kwikui-button\n *ngIf=\"config.dashboard?.isAllowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"config.dashboard?.isShowCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'SHARE_JOURNEY_LINK' })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-details-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isShowMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToMaps(customer?.task_details?.customer_details?.location)\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'START_JOURNEY' })\n \"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-details-wrapper{display:flex;flex-direction:column;align-items:stretch;overflow:hidden;grid-gap:.5rem;gap:.5rem;padding:1.5rem;height:100%;width:100%}.customer-details-wrapper .customer-details-heading{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:1rem 0;font-size:1.5rem;font-weight:600}.customer-details-wrapper .customer-details-body{display:flex;flex-direction:column;grid-gap:1.25rem;gap:1.25rem}.customer-details-wrapper .customer-details-body .customer-details-user-id{font-size:1.25rem;font-weight:500;padding:.5rem 0}.customer-details-wrapper .customer-details-body .customer-details-table{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:column}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-name{font-weight:500}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-value{word-wrap:break-word}.customer-details-wrapper .customer-details-body .customer-details-date{padding-top:1rem}.customer-details-wrapper .customer-details-body .customer-details-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:1rem 0}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons .customer-share-link{font-size:.7rem}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
647
474
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerDetailsComponent, decorators: [{
648
475
  type: Component,
649
476
  args: [{
@@ -651,9 +478,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
651
478
  templateUrl: './customer-details.component.html',
652
479
  styleUrls: ['./customer-details.component.scss']
653
480
  }]
654
- }], ctorParameters: function () { return [{ type: UserService }]; }, propDecorators: { customer: [{
481
+ }], ctorParameters: function () { return [{ type: AgentService }, { type: MapService }]; }, propDecorators: { customer: [{
655
482
  type: Input
656
- }], agentConfig: [{
483
+ }], config: [{
657
484
  type: Input
658
485
  }], nextStep: [{
659
486
  type: Output
@@ -679,188 +506,6 @@ const VStatus = [
679
506
  EStatus.COMPLETE
680
507
  ];
681
508
 
682
- class InfoWindowService {
683
- constructor(mapService) {
684
- this.mapService = mapService;
685
- this.config = {
686
- fields: {
687
- name: {
688
- label: 'Name',
689
- value: 'name',
690
- display: 'value',
691
- style: {
692
- fontSize: '1rem',
693
- fontWeight: 600
694
- }
695
- },
696
- phone: {
697
- label: 'Call',
698
- value: 'phone',
699
- display: 'label',
700
- style: {
701
- fontSize: '0.8rem',
702
- padding: '0.1rem 0',
703
- textAlign: 'justify'
704
- },
705
- icon: 'https://cdn-icons-png.flaticon.com/512/60/60720.png'
706
- },
707
- address: {
708
- label: 'Directions',
709
- value: 'address',
710
- display: 'label',
711
- style: {
712
- fontSize: '0.8rem',
713
- padding: '0.1rem 0'
714
- },
715
- icon: 'https://cdn-icons-png.flaticon.com/512/62/62516.png'
716
- }
717
- }
718
- };
719
- this.mainInfoWindowStyle = {
720
- display: 'flex',
721
- 'flex-direction': 'column',
722
- 'justify-content': 'center',
723
- 'align-items': 'stretch',
724
- gap: '0.5rem',
725
- padding: '0.5rem'
726
- };
727
- this.fieldDivStyle = {
728
- gap: ' 0.5rem',
729
- display: 'flex',
730
- 'flex-direction': 'row'
731
- };
732
- }
733
- getOpenMarker() {
734
- return this.openMarker;
735
- }
736
- setOpenMarker(value) {
737
- this.openMarker = value;
738
- }
739
- /**
740
- * @description
741
- * Wrapper method to show Customer Info Window
742
- *
743
- * @function showInfo
744
- * @func showInfo
745
- * @method showInfo
746
- */
747
- showCustomerInformation(customer, marker) {
748
- let map = this.mapService.map;
749
- let contentString = this.createInfoContent(customer);
750
- let infowindow = new google.maps.InfoWindow({
751
- content: contentString
752
- });
753
- this.addEventListeners(customer, infowindow);
754
- this.closeLastOpenedInfoWindow();
755
- infowindow.open(map, marker);
756
- this.lastInfoWindowOpened = infowindow;
757
- this.mapService.map = Object.assign(Object.assign({}, this.mapService.map), { center: marker.getPosition });
758
- // map.setCenter(marker.getPosition());
759
- return { infowindow: infowindow };
760
- }
761
- addEventListeners(customer, infowindow) {
762
- // chnage -
763
- let addressLink = `http://maps.google.com/?q=${customer.extras.loc[0]}, ${customer.extras.loc[1]}`;
764
- google.maps.event.addListener(infowindow, 'domready', function () {
765
- document.getElementById('Call').addEventListener('click', function (e) {
766
- window.open(`tel:${customer.extras.phone}`, '_self');
767
- });
768
- document
769
- .getElementById('Directions')
770
- .addEventListener('click', function (e) {
771
- window.open(`${addressLink}`, '_blank');
772
- });
773
- document
774
- .getElementsByClassName('gm-ui-hover-effect')[0]
775
- .setAttribute('style', ' background: none;\
776
- display: block; \
777
- border: 0px; \
778
- margin: 0px; \
779
- padding: 0px; \
780
- text-transform: none; \
781
- appearance: none; \
782
- position: absolute; \
783
- cursor: pointer; \
784
- user-select: none; \
785
- top: 0px; \
786
- right: 0px; \
787
- width: 30px; \
788
- height: 30px; \
789
- ');
790
- });
791
- }
792
- /**
793
- * @description
794
- * Wrapper method to close Last Info Window
795
- *
796
- * @function closeLastOpenedInfoWindow
797
- * @func closeLastOpenedInfoWindow
798
- * @method closeLastOpenedInfoWindow
799
- */
800
- closeLastOpenedInfoWindow() {
801
- if (this.lastInfoWindowOpened) {
802
- this.lastInfoWindowOpened.close();
803
- }
804
- }
805
- /**
806
- * @description
807
- * Closes the previously opened info window.
808
- *
809
- * @function infoData
810
- * @func infoData
811
- * @method infoData
812
- */
813
- createInfoContent(customer) {
814
- let content = "<div style='padding:4px; font-family: Manrope;' >";
815
- content += this.createFields(customer, this.config.fields);
816
- content += '</div>';
817
- return content;
818
- }
819
- /**
820
- * @description
821
- * Wrapper method to create Fields Container
822
- *
823
- * @function createFields
824
- * @func createFields
825
- * @method createFields
826
- */
827
- createFields(customer, fields) {
828
- let _div = document.createElement('div');
829
- for (const property in this.mainInfoWindowStyle)
830
- _div.style[property] = this.mainInfoWindowStyle[property];
831
- for (let key of Object.keys(fields)) {
832
- let field = fields[key];
833
- let _fieldDiv = document.createElement('div');
834
- _fieldDiv.setAttribute('id', field.label);
835
- for (const property in this.fieldDivStyle)
836
- _fieldDiv.style[property] = this.fieldDivStyle[property];
837
- for (const property in field.style)
838
- _fieldDiv.style[property] = field.style[property];
839
- let string = field.display == 'label' ? field.label : customer.extras[field.value];
840
- if (field.icon) {
841
- let _icon = document.createElement('img');
842
- _icon.src = field.icon;
843
- _icon.style.width = field.style.fontSize;
844
- _icon.style.height = field.style.fontSize;
845
- _fieldDiv.appendChild(_icon);
846
- }
847
- let _fieldText = document.createElement('div');
848
- _fieldText.innerHTML = string;
849
- _fieldDiv.appendChild(_fieldText);
850
- _div.appendChild(_fieldDiv);
851
- }
852
- return _div.outerHTML;
853
- }
854
- }
855
- /** @nocollapse */ InfoWindowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InfoWindowService, deps: [{ token: MapService }], target: i0.ɵɵFactoryTarget.Injectable });
856
- /** @nocollapse */ InfoWindowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InfoWindowService, providedIn: 'root' });
857
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: InfoWindowService, decorators: [{
858
- type: Injectable,
859
- args: [{
860
- providedIn: 'root'
861
- }]
862
- }], ctorParameters: function () { return [{ type: MapService }]; } });
863
-
864
509
  class StatusPillComponent {
865
510
  ngOnInit() {
866
511
  if (isEmptyValue(this.status)) {
@@ -873,7 +518,7 @@ class StatusPillComponent {
873
518
  }
874
519
  }
875
520
  /** @nocollapse */ StatusPillComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: StatusPillComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
876
- /** @nocollapse */ StatusPillComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0, template: "<div [ngClass]=\"getStatusPillClass(status)\">{{status}}</div>\n", styles: [".status-pill{background-color:#555;padding:.1rem .5rem;border-radius:1rem;font-size:.7rem;color:#fff}.complete{background-color:var(--tui-positive)}.rejected{background-color:var(--tui-negative)}.auditing{background-color:var(--tui-primary)}.on-going{background-color:var(--tui-primary)}.after-audit{background-color:var(--tui-warning-fill);color:#222}\n"], directives: [{ type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
521
+ /** @nocollapse */ StatusPillComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0, template: "<div [ngClass]=\"getStatusPillClass(status)\">{{status}}</div>\n", styles: [".status-pill{background-color:#555;padding:.1rem .5rem;border-radius:1rem;font-size:.7rem;color:#fff}.complete{background-color:var(--tui-positive)}.rejected{background-color:var(--tui-negative)}.auditing{background-color:var(--tui-primary)}.on-going{background-color:var(--tui-primary)}.after-audit{background-color:var(--tui-warning-fill);color:#222}\n"], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
877
522
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: StatusPillComponent, decorators: [{
878
523
  type: Component,
879
524
  args: [{
@@ -886,41 +531,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
886
531
  }] } });
887
532
 
888
533
  class CustomerTileComponent {
889
- /**
890
- * @description
891
- *
892
- * @constructor
893
- */
894
- constructor(mapService, infoWindowService, userService, hostElement) {
534
+ constructor(mapService, agentService, hostElement) {
895
535
  this.mapService = mapService;
896
- this.infoWindowService = infoWindowService;
897
- this.userService = userService;
536
+ this.agentService = agentService;
898
537
  this.hostElement = hostElement;
899
- /**
900
- * @description
901
- * Determines Customer Data
902
- *
903
- * @default
904
- * `{}`
905
- */
906
538
  this.customer = {};
907
- /**
908
- * @description
909
- * Determines Index of Customer Data in Customer List
910
- *
911
- * @default
912
- *
913
- */
914
539
  this.index = undefined;
915
540
  this.isMobileView = false;
916
541
  this.viewTaskDetails = [];
917
- /**
918
- * @description
919
- * Emitter to emit next Step
920
- *
921
- * @emits KwikIDAgentDashboardComponent#nextStep
922
- * @fires KwikIDAgentDashboardComponent#nextStep
923
- */
924
542
  this.nextStep = new EventEmitter();
925
543
  this.removeTask = new EventEmitter();
926
544
  }
@@ -932,74 +550,43 @@ class CustomerTileComponent {
932
550
  this.isMobileView = false;
933
551
  }
934
552
  }
935
- /**
936
- * @description
937
- * To set Google Maps API on script
938
- *
939
- * @ngOnInit
940
- */
941
553
  ngOnInit() {
942
554
  var _a, _b, _c;
943
555
  this.viewTaskDetails =
944
- (_c = (_b = (_a = this.agentConfig) === null || _a === void 0 ? void 0 : _a.dashboardConfig) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
556
+ (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
945
557
  }
946
558
  getTaskDetails(taskData) {
947
559
  return getObjectValueFromPath(this.customer, taskData);
948
560
  }
949
561
  openDetails() {
950
- if (this.userService.showTaskDetails !== this.index) {
951
- this.userService.showTaskDetails = this.index;
952
- }
953
- else {
954
- this.userService.showTaskDetails = undefined;
955
- }
956
- }
957
- tileClick() {
958
- this.openDetails();
959
- if (this.index == this.infoWindowService.getOpenMarker()) {
960
- this.infoWindowService.setOpenMarker(null);
961
- //this.infoWindowService.lastInfoWindowOpened.close();
562
+ if (this.agentService.isShowTaskDetails !== this.index) {
563
+ this.agentService.isShowTaskDetails = this.index;
564
+ this.mapService.plotDirectionsForSelectedTask(this.index);
962
565
  }
963
566
  else {
964
- this.showDetails(this.customer, this.index);
567
+ this.agentService.isShowTaskDetails = undefined;
568
+ this.mapService.plotDirectionsForSelectedTask(null);
965
569
  }
966
570
  }
967
- /**
968
- * @description
969
- * Wrapper method to show Customer Info Window
970
- *
971
- * @function showDetails
972
- * @func showDetails
973
- * @method showDetails
974
- */
975
- showDetails(customer, index) {
976
- let markers = this.mapService.getMarkers();
977
- let marker = markers[index + 1];
978
- // let { infowindow } = this.infoWindowService.showCustomerInformation(
979
- // customer,
980
- // marker
981
- // );
982
- this.infoWindowService.setOpenMarker(index);
983
- }
984
571
  getClass() {
985
- let string = "customer-tile-wrapper";
986
- if (this.userService.showTaskDetails == this.index) {
987
- string += " customer-tile-active";
572
+ let string = 'customer-tile-wrapper';
573
+ if (this.agentService.isShowTaskDetails == this.index) {
574
+ string += ' customer-tile-active';
988
575
  }
989
576
  return string;
990
577
  }
991
578
  goToMaps(location) {
992
579
  window.open(`${location}`, '_blank');
993
580
  }
994
- goToNextStep(e) {
581
+ handleOnClickNext(e) {
995
582
  this.nextStep.emit(e);
996
583
  }
997
584
  handleOnClickRemoveTask(task) {
998
585
  this.removeTask.emit(task);
999
586
  }
1000
587
  }
1001
- /** @nocollapse */ CustomerTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, deps: [{ token: MapService }, { token: InfoWindowService }, { token: UserService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1002
- /** @nocollapse */ CustomerTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index", agentConfig: "agentConfig" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true }], ngImport: i0, template: "<div [ngClass]=\"getClass()\">\n <div class=\"customer-tile-primary-container\">\n <div class=\"customer-tile-primary-container-data\">\n <div class=\"customer-tile-primary-container-userid\">\n {{\n agentConfig?.dashboardConfig?.taskIdentifier\n ? getTaskDetails(agentConfig?.dashboardConfig?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n <status-pill\n *ngIf=\"agentConfig?.dashboardConfig?.showTaskStatus\"\n [status]=\"customer.session_status\"\n ></status-pill>\n </div>\n <kwikui-button\n *ngIf=\"!userService.isMobileView && !userService.showMapview\"\n [icon]=\"\n userService.showTaskDetails == index\n ? 'tuiIconChevronLeftLarge'\n : 'tuiIconChevronRightLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"userService.isMobileView || userService.showMapview\"\n [icon]=\"\n userService.showTaskDetails == index\n ? 'tuiIconChevronUpLarge'\n : 'tuiIconChevronDownLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n </div>\n <div\n [ngClass]=\"\n index == userService.showTaskDetails &&\n (userService.isMobileView || userService.showMapview)\n ? 'customer-tile-secondary-container'\n : 'data-collasped'\n \"\n >\n <div class=\"customer-tile-secondary-container-data\">\n <div\n *ngFor=\"let taskData of viewTaskDetails\"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n {{ getTaskDetails(taskData) }}\n </div>\n </div>\n <div class=\"customer-tile-secondary-container-actions\">\n <div class=\"customer-tile-secondary-container-task-buttons\">\n <kwikui-button\n *ngIf=\"agentConfig.dashboardConfig?.allowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"agentConfig.dashboardConfig?.showCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'SHARE_JOURNEY_LINK' })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-tile-secondary-container-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToMaps(customer.task_details.customer_details.location)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showStartJourneyButton &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n agentConfig.dashboardConfig?.showStartJourneyButton &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToNextStep({ customer: customer, stepType: 'START_JOURNEY' })\n \"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-tile-wrapper{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto;grid-gap:.5rem;gap:.5rem;padding:1rem;border-bottom:.5px solid #ddd}.customer-tile-wrapper .customer-tile-primary-container{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;width:100%;height:100%}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data{padding-left:.2rem;grid-gap:.6rem;gap:.6rem;display:flex;flex-direction:row;flex-wrap:wrap;align-content:stretch;justify-content:space-evenly;align-items:center}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data .customer-tile-primary-container-userid{font-weight:500;font-size:1.1rem;line-height:1rem}.customer-tile-wrapper .customer-tile-secondary-container{width:100%;height:100%;display:flex;flex-direction:column;overflow:auto;grid-gap:.5rem;gap:.5rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data{padding:.4rem .2rem;display:flex;flex-direction:column;font-size:.7rem;grid-gap:.3rem;gap:.3rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data .customer-tile-secondary-container-custom-details{width:100%;height:100%;line-height:.9rem;word-wrap:break-word}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons .customer-share-link{font-size:.7rem}.customer-tile-wrapper .data-collasped{display:none}.customer-tile-active{background-color:#dcedfd}\n"], components: [{ type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
588
+ /** @nocollapse */ CustomerTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
589
+ /** @nocollapse */ CustomerTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, ngImport: i0, template: "<div [ngClass]=\"getClass()\">\n <div class=\"customer-tile-primary-container\">\n <div class=\"customer-tile-primary-container-data\">\n <div class=\"customer-tile-primary-container-userid\">\n {{\n config?.dashboard?.taskIdentifier\n ? getTaskDetails(config?.dashboard?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n <status-pill\n *ngIf=\"config?.dashboard?.isShowTaskStatus\"\n [status]=\"customer.session_status\"\n ></status-pill>\n </div>\n <kwikui-button\n *ngIf=\"!agentService.isMobileView && !agentService.showMapview\"\n [icon]=\"\n agentService.isShowTaskDetails == index\n ? 'tuiIconChevronLeftLarge'\n : 'tuiIconChevronRightLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"agentService.isMobileView || agentService.showMapview\"\n [icon]=\"\n agentService.isShowTaskDetails == index\n ? 'tuiIconChevronUpLarge'\n : 'tuiIconChevronDownLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n </div>\n <div\n [ngClass]=\"\n index == agentService.isShowTaskDetails &&\n (agentService.isMobileView || agentService.showMapview)\n ? 'customer-tile-secondary-container'\n : 'data-collasped'\n \"\n >\n <div class=\"customer-tile-secondary-container-data\">\n <div\n *ngFor=\"let taskData of viewTaskDetails\"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n {{ getTaskDetails(taskData) }}\n </div>\n <div\n *ngIf=\"\n agentService.config?.dashboard?.isShowMaps &&\n agentService.config?.dashboard?.isShowDistanceAndTime &&\n mapService.getSelectedTaskDistanceAndTime()\n \"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n Distance: {{ mapService.getSelectedTaskDistanceAndTime()?.distance }} |\n Time: {{ mapService.getSelectedTaskDistanceAndTime()?.time }}\n </div>\n </div>\n <div class=\"customer-tile-secondary-container-actions\">\n <div class=\"customer-tile-secondary-container-task-buttons\">\n <kwikui-button\n *ngIf=\"config.dashboard?.isAllowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"config.dashboard?.isShowCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n handleOnClickNext({\n customer: customer,\n stepType: 'SHARE_JOURNEY_LINK'\n })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-tile-secondary-container-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isShowMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToMaps(customer.task_details.customer_details.location)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'START_JOURNEY' })\n \"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-tile-wrapper{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto;grid-gap:.5rem;gap:.5rem;padding:1rem;border-bottom:.5px solid #ddd}.customer-tile-wrapper .customer-tile-primary-container{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;width:100%;height:100%}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data{padding-left:.2rem;grid-gap:.6rem;gap:.6rem;display:flex;flex-direction:row;flex-wrap:wrap;align-content:stretch;justify-content:space-evenly;align-items:center}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data .customer-tile-primary-container-userid{font-weight:500;font-size:1.1rem;line-height:1rem}.customer-tile-wrapper .customer-tile-secondary-container{width:100%;height:100%;display:flex;flex-direction:column;overflow:auto;grid-gap:.5rem;gap:.5rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data{padding:.4rem .2rem;display:flex;flex-direction:column;font-size:.7rem;grid-gap:.3rem;gap:.3rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data .customer-tile-secondary-container-custom-details{width:100%;height:100%;line-height:.9rem;word-wrap:break-word}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons .customer-share-link{font-size:.7rem}.customer-tile-wrapper .data-collasped{display:none}.customer-tile-active{background-color:#dcedfd}\n"], components: [{ type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1003
590
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, decorators: [{
1004
591
  type: Component,
1005
592
  args: [{
@@ -1007,22 +594,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1007
594
  templateUrl: './customer-tile.component.html',
1008
595
  styleUrls: ['./customer-tile.component.scss']
1009
596
  }]
1010
- }], ctorParameters: function () { return [{ type: MapService }, { type: InfoWindowService }, { type: UserService }, { type: i0.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
597
+ }], ctorParameters: function () { return [{ type: MapService }, { type: AgentService }, { type: i0.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
1011
598
  type: HostListener,
1012
599
  args: ['window:resize', ['$event']]
1013
600
  }], customer: [{
1014
601
  type: Input
1015
602
  }], index: [{
1016
603
  type: Input
1017
- }], agentConfig: [{
604
+ }], config: [{
1018
605
  type: Input
1019
606
  }], nextStep: [{
1020
607
  type: Output
1021
608
  }], removeTask: [{
1022
609
  type: Output
1023
- }], infoWindow: [{
1024
- type: ViewChild,
1025
- args: [MapInfoWindow]
1026
610
  }] } });
1027
611
 
1028
612
  class Ng2SearchPipe {
@@ -1107,7 +691,7 @@ class CustomerListComponent {
1107
691
  ngOnInit() { }
1108
692
  ngAfterViewInit() {
1109
693
  setTimeout(() => __awaiter(this, void 0, void 0, function* () {
1110
- if (this.agentConfig.dashboardConfig.showMaps) {
694
+ if (this.config.dashboard.isShowMaps) {
1111
695
  yield this.mapService.initMap();
1112
696
  this.filteredData = yield this.plotMarkers(this.customers);
1113
697
  }
@@ -1117,14 +701,16 @@ class CustomerListComponent {
1117
701
  }), 1000);
1118
702
  }
1119
703
  ngOnChanges() {
1120
- if (this.agentConfig.dashboardConfig.showMaps) {
1121
- this.filteredData = this.plotMarkers(this.customers);
1122
- }
1123
- else {
1124
- this.filteredData = this.customers;
1125
- }
704
+ return __awaiter(this, void 0, void 0, function* () {
705
+ if (this.config.dashboard.isShowMaps) {
706
+ this.filteredData = yield this.plotMarkers(this.customers);
707
+ }
708
+ else {
709
+ this.filteredData = this.customers;
710
+ }
711
+ });
1126
712
  }
1127
- goToNextStep(e) {
713
+ handleOnClickNext(e) {
1128
714
  this.nextStep.emit(e);
1129
715
  }
1130
716
  getDate(d) {
@@ -1141,16 +727,15 @@ class CustomerListComponent {
1141
727
  }
1142
728
  plotMarkers(customers) {
1143
729
  var _a;
1144
- if (!((_a = this.agentConfig.dashboardConfig) === null || _a === void 0 ? void 0 : _a.showHistory)) {
1145
- customers = customers.filter((customer) => {
1146
- return customer.status !== EStatus.COMPLETE;
1147
- });
1148
- }
1149
- let directionsResults$ = this.mapService.plotMarkers(customers);
1150
- directionsResults$.subscribe((val) => {
1151
- this.filteredData = this.mapService.sortList(val.routes[0].waypoint_order, customers);
730
+ return __awaiter(this, void 0, void 0, function* () {
731
+ if (!((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.isPlotCompletedTaskMarkers)) {
732
+ customers = customers.filter((customer) => {
733
+ return customer.status !== EStatus.COMPLETE;
734
+ });
735
+ }
736
+ customers = yield this.mapService.plotDirectionsForAllTasks(customers);
737
+ return customers;
1152
738
  });
1153
- return customers;
1154
739
  }
1155
740
  getTuiDate(event) {
1156
741
  let year = event.year;
@@ -1179,7 +764,7 @@ class CustomerListComponent {
1179
764
  }
1180
765
  }
1181
766
  /** @nocollapse */ CustomerListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, deps: [{ token: MapService }], target: i0.ɵɵFactoryTarget.Component });
1182
- /** @nocollapse */ CustomerListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerListComponent, selector: "customer-list", inputs: { customers: "customers", agentConfig: "agentConfig" }, outputs: { nextStep: "nextStep", removeTask: "removeTask", filterTaskList: "filterTaskList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"customer-list-wrapper\">\n <div class=\"customer-list-filter\" [formGroup]=\"formGroup\">\n <kwikui-input-date-range\n *ngIf=\"agentConfig?.dashboardConfig?.showDateFilter\"\n [label]=\"'Date Range'\"\n [id]=\"'dateRange'\"\n [size]=\"'m'\"\n [maxLength]=\"maxLength\"\n [formControlName]=\"'dateRange'\"\n [formControl]=\"dateRangeFormControl\"\n (getKeyValue)=\"onDateRangeChange($event)\"\n ></kwikui-input-date-range>\n <kwikui-input\n *ngIf=\"agentConfig?.dashboardConfig?.showSearchFilter\"\n [label]=\"'Search'\"\n [id]=\"'search'\"\n icon=\"tuiIconSearch\"\n size=\"m\"\n placeholder=\"Search Any Task\"\n [formControlName]=\"'search'\"\n [formControl]=\"searchFormControl\"\n (getKeyValue)=\"onSearchFilter($event)\"\n ></kwikui-input>\n </div>\n\n <div class=\"customer-task-list\">\n <cdk-virtual-scroll-viewport itemSize=\"1\" class=\"customer-task-list-scroll\">\n <div\n *cdkVirtualFor=\"\n let customer of filteredData | filter: searchText;\n index as index\n \"\n >\n <customer-tile\n class=\"example-item\"\n [customer]=\"customer\"\n [agentConfig]=\"agentConfig\"\n [index]=\"index\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-tile>\n </div>\n </cdk-virtual-scroll-viewport>\n </div>\n\n <div class=\"customer-list-empty\" *ngIf=\"filteredData.length === 0\">\n {{agentConfig?.dashboardConfig?.emptyTaskListMessage ?? '0 Tasks for the given Date.'}}\n </div>\n</div>\n", styles: [".customer-list-wrapper{width:100%;height:100%;display:flex;flex-direction:column}.customer-list-filter{height:-moz-fit-content;height:fit-content;width:100%;display:flex;flex-direction:column;padding:1rem;grid-gap:.8rem;gap:.8rem;border-bottom:.5px solid #ddd}.customer-list-empty{height:100%;width:100%;margin-top:.5rem;font-size:1rem;text-align:center}.customer-task-list{height:100%}.customer-task-list-scroll{height:100%;width:100%}.cdk-virtual-scroll-spacer{height:0!important}.example-item{height:50px}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i2.KwikUIInputDateRangeComponent, selector: "kwikui-input-date-range", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxLength", "min", "minLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { type: CustomerTileComponent, selector: "customer-tile", inputs: ["customer", "index", "agentConfig"], outputs: ["nextStep", "removeTask"] }], directives: [{ type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe } });
767
+ /** @nocollapse */ CustomerListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerListComponent, selector: "customer-list", inputs: { customers: "customers", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask", filterTaskList: "filterTaskList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"customer-list-wrapper\">\n <div class=\"customer-list-filter\" [formGroup]=\"formGroup\">\n <kwikui-input-date-range\n *ngIf=\"config?.dashboard?.isShowDateFilter\"\n [label]=\"'Date Range'\"\n [id]=\"'dateRange'\"\n [size]=\"'m'\"\n [maxLength]=\"maxLength\"\n [formControlName]=\"'dateRange'\"\n [formControl]=\"dateRangeFormControl\"\n (getKeyValue)=\"onDateRangeChange($event)\"\n ></kwikui-input-date-range>\n <kwikui-input\n *ngIf=\"config?.dashboard?.isAllowSearchFilter\"\n [label]=\"'Search'\"\n [id]=\"'search'\"\n icon=\"tuiIconSearch\"\n size=\"m\"\n placeholder=\"Search Any Task\"\n [formControlName]=\"'search'\"\n [formControl]=\"searchFormControl\"\n (getKeyValue)=\"onSearchFilter($event)\"\n ></kwikui-input>\n </div>\n\n <div class=\"customer-task-list\">\n <cdk-virtual-scroll-viewport itemSize=\"1\" class=\"customer-task-list-scroll\">\n <div\n *cdkVirtualFor=\"\n let customer of filteredData | filter: searchText;\n index as index\n \"\n >\n <customer-tile\n class=\"example-item\"\n [customer]=\"customer\"\n [config]=\"config\"\n [index]=\"index\"\n (nextStep)=\"handleOnClickNext($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-tile>\n </div>\n </cdk-virtual-scroll-viewport>\n </div>\n\n <div class=\"customer-list-empty\" *ngIf=\"filteredData.length === 0\">\n {{config?.dashboard?.emptyTaskListMessage ?? '0 Tasks for the given Date.'}}\n </div>\n</div>\n", styles: [".customer-list-wrapper{width:100%;height:100%;display:flex;flex-direction:column}.customer-list-filter{height:-moz-fit-content;height:fit-content;width:100%;display:flex;flex-direction:column;padding:1rem;grid-gap:.8rem;gap:.8rem;border-bottom:.5px solid #ddd}.customer-list-empty{height:100%;width:100%;margin-top:.5rem;font-size:1rem;text-align:center}.customer-task-list{height:100%}.customer-task-list-scroll{height:100%;width:100%}.cdk-virtual-scroll-spacer{height:0!important}.example-item{height:50px}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i2.KwikUIInputDateRangeComponent, selector: "kwikui-input-date-range", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxLength", "min", "minLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { type: CustomerTileComponent, selector: "customer-tile", inputs: ["customer", "index", "config"], outputs: ["nextStep", "removeTask"] }], directives: [{ type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe } });
1183
768
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, decorators: [{
1184
769
  type: Component,
1185
770
  args: [{
@@ -1189,7 +774,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1189
774
  }]
1190
775
  }], ctorParameters: function () { return [{ type: MapService }]; }, propDecorators: { customers: [{
1191
776
  type: Input
1192
- }], agentConfig: [{
777
+ }], config: [{
1193
778
  type: Input
1194
779
  }], nextStep: [{
1195
780
  type: Output
@@ -1200,52 +785,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1200
785
  }] } });
1201
786
 
1202
787
  class KwikIDAgentDashboardComponent {
1203
- constructor(mapService, userService, httpClient, hostElement, dialogService) {
788
+ constructor(mapService, agentService, httpClient, hostElement, dialogService) {
1204
789
  this.mapService = mapService;
1205
- this.userService = userService;
790
+ this.agentService = agentService;
1206
791
  this.httpClient = httpClient;
1207
792
  this.hostElement = hostElement;
1208
793
  this.dialogService = dialogService;
1209
- this.agentConfig = {};
794
+ this.config = {};
1210
795
  this.taskList = [];
1211
796
  this.nextStep = new EventEmitter();
1212
797
  this.addTask = new EventEmitter();
1213
798
  this.removeTask = new EventEmitter();
1214
799
  this.filterTaskList = new EventEmitter();
1215
800
  this.loading = true;
1216
- this.options = {
1217
- stops: ['calc(5rem + 74vw)', 'calc(9rem + 74vw)']
1218
- };
1219
801
  this.open = false;
1220
802
  this.allFormsData = {};
1221
803
  this.String = String;
1222
- this.apiLoaded = httpClient
1223
- .jsonp('https://maps.googleapis.com/maps/api/js?key=AIzaSyA63JY0ja6ZGIR796vJqZARc0c2j8Vgpik&v=3.exp&libraries=geometry,drawing,places', 'callback')
1224
- .pipe(map(() => true), catchError(() => of(false)));
1225
804
  }
1226
805
  windowResizeWatcher() {
1227
806
  if (this.hostElement.nativeElement.offsetWidth < 600) {
1228
807
  this.isMobileView = true;
1229
- this.userService.isMobileView = true;
808
+ this.agentService.isMobileView = true;
1230
809
  }
1231
810
  else {
1232
811
  this.isMobileView = false;
1233
- this.userService.isMobileView = false;
812
+ this.agentService.isMobileView = false;
1234
813
  }
1235
814
  }
1236
815
  ngOnInit() {
1237
816
  var _a, _b, _c, _d, _e, _f;
1238
- this.userService.agentConfig = this.agentConfig;
1239
- this.userService.showMapview =
1240
- (_c = (_b = (_a = this.agentConfig) === null || _a === void 0 ? void 0 : _a.dashboardConfig) === null || _b === void 0 ? void 0 : _b.showMaps) !== null && _c !== void 0 ? _c : false;
1241
- this.userService.addTaskFormConfig =
1242
- (_f = (_e = (_d = this.agentConfig) === null || _d === void 0 ? void 0 : _d.dashboardConfig) === null || _e === void 0 ? void 0 : _e.addTaskFormConfig) !== null && _f !== void 0 ? _f : this.userService.addTaskFormConfig;
817
+ this.agentService.config = this.config;
818
+ this.agentService.showMapview =
819
+ (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.isShowMaps) !== null && _c !== void 0 ? _c : false;
820
+ this.agentService.addTaskForm =
821
+ (_f = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.dashboard) === null || _e === void 0 ? void 0 : _e.addTaskForm) !== null && _f !== void 0 ? _f : this.agentService.addTaskForm;
1243
822
  this.loading = false;
1244
823
  setTimeout(() => {
1245
824
  this.windowResizeWatcher();
1246
825
  }, 1000);
1247
826
  }
1248
- goToNextStep(e) {
827
+ handleOnClickNext(e) {
1249
828
  this.nextStep.emit(e);
1250
829
  }
1251
830
  handleOnClickAddTask(task) {
@@ -1284,8 +863,8 @@ class KwikIDAgentDashboardComponent {
1284
863
  }
1285
864
  handleOnClickViewForms(e) { }
1286
865
  }
1287
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: UserService }, { token: i3$1.HttpClient }, { token: i0.ElementRef }, { token: TuiDialogService }], target: i0.ɵɵFactoryTarget.Component });
1288
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponent, selector: "kwikid-agent-dashboard", inputs: { agentConfig: "agentConfig", taskList: "taskList" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask", filterTaskList: "filterTaskList" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true }], ngImport: i0, template: "<div class=\"kwikid-agent-dashboard\" *ngIf=\"!loading\">\n <div class=\"wrapper\">\n <div class=\"dashboard-header\">\n <img\n *ngIf=\"\n userService.agentConfig.clientLogo &&\n userService.agentConfig?.dashboardConfig?.showClientLogo\n \"\n [src]=\"userService.agentConfig.clientLogo\"\n class=\"dashboard-header-client-logo\"\n />\n <div\n *ngIf=\"\n !userService.agentConfig.clientLogo ||\n !userService.agentConfig?.dashboardConfig?.showClientLogo\n \"\n class=\"dashboard-header-client-name\"\n >\n <kwikui-button\n [icon]=\"'tuiIconLink'\"\n appearance=\"mono\"\n size=\"m\"\n ></kwikui-button>\n\n {{ userService.agentConfig.clientName }}\n </div>\n <div>\n <kwikui-button\n *ngIf=\"userService.agentConfig?.dashboardConfig?.allowAddTask\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconAddRowLarge'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"showDialog(template)\"\n ></kwikui-button>\n <span (tuiActiveZoneChange)=\"onActiveZone($event)\">\n <kwikui-button\n [icon]=\"'tuiIconSettingsLarge'\"\n (onClick)=\"onClick()\"\n appearance=\"mono\"\n size=\"m\"\n [tuiDropdown]=\"dropdownContent\"\n [tuiDropdownManual]=\"open\"\n (tuiObscured)=\"onObscured($event)\"\n ></kwikui-button>\n <ng-template #dropdownContent>\n <div class=\"menu-dropdown\">\n <div class=\"menu-dropdown-header\">\n <div class=\"menu-dropdown-header-agent-name\">\n {{ userService.agentConfig.agentName }}\n </div>\n <div class=\"menu-dropdown-header-agent-id\">\n Agent ID: {{ userService.agentConfig.agentId }}\n </div>\n </div>\n <hr />\n <div\n class=\"menu-dropdown-body\"\n tuiGroup\n [collapsed]=\"true\"\n [rounded]=\"false\"\n [orientation]=\"'vertical'\"\n [size]=\"'m'\"\n >\n <kwikui-button\n *ngIf=\"this.agentConfig.dashboardConfig.showMaps\"\n id=\"\"\n label=\"{{\n userService.showMapview ? 'Hide Maps' : 'Show Maps'\n }}\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n icon=\"{{\n userService.showMapview ? 'tuiIconEyeOff' : 'tuiIconEye'\n }}\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"padding: 0rem !important\"\n (onClick)=\"userService.toggleMapview()\"\n ></kwikui-button>\n <kwikui-button\n id=\"\"\n label=\"Refresh\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconRefreshCw'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"refresh()\"\n ></kwikui-button>\n </div>\n <div class=\"menu-dropdown-footer\">\n <kwikui-button\n id=\"\"\n label=\"Logout\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconLogOut'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"goToNextStep({ stepType: 'LOGOUT' })\"\n ></kwikui-button>\n </div>\n </div>\n </ng-template>\n </span>\n </div>\n </div>\n\n <div class=\"dashboard-body\">\n <div\n *ngIf=\"apiLoaded | async\"\n [class]=\"userService.showMapview ? 'map' : 'map-hidden'\"\n >\n <google-map height=\"100%\" width=\"100%\" [options]=\"this.mapService.map\">\n <map-marker\n #marker=\"mapMarker\"\n *ngFor=\"\n let markerPosition of this.mapService.markers;\n let index = index\n \"\n [position]=\"markerPosition\"\n [label]=\"{ text: String(index), color: '#FFF' }\"\n (mapClick)=\"openInfoWindow(marker)\"\n ></map-marker>\n <map-directions-renderer\n *ngIf=\"\n this.mapService.directionsResults$ | async as directionsResults\n \"\n [directions]=\"directionsResults\"\n [options]=\"this.mapService.directionsRenderOption\"\n ></map-directions-renderer>\n <map-info-window>Info Window content</map-info-window>\n </google-map>\n </div>\n <div\n class=\"task-details\"\n *ngIf=\"\n !userService.isMobileView && userService.showTaskDetails != undefined && !userService.showMapview\n \"\n >\n <customer-details\n [customer]=\"taskList[userService.showTaskDetails]\"\n [agentConfig]=\"agentConfig\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-details>\n </div>\n <div\n class=\"no-task-details\"\n *ngIf=\"\n !userService.isMobileView &&\n userService.showTaskDetails == undefined &&\n !userService.showMapview\n \"\n >\n <img src=\"assets/No-Results.jpg\" class=\"no-task-img\" alt=\"No Task\"/>\n <div class=\"\">Select a Task to view it's details.</div>\n </div>\n <div class=\"customer-list\">\n <customer-list\n [customers]=\"taskList\"\n [agentConfig]=\"agentConfig\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n (filterTaskList)=\"handleOnFilterTaskList($event)\"\n ></customer-list>\n </div>\n </div>\n </div>\n</div>\n<div class=\"kwikid-agent-dashboard-loader\" *ngIf=\"loading\">\n <span class=\"loader\"></span>\n</div>\n\n<ng-template #template let-observer>\n <div class=\"add-task-header\">\n <h2>Add Task</h2>\n <kwikui-button\n icon=\"tuiIconX\"\n id=\"\"\n styles=\"\"\n type=\"button\"\n appearance=\"mono\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"observer.complete()\"\n ></kwikui-button>\n </div>\n <kwikid-form-view\n [formConfig]=\"userService.addTaskFormConfig\"\n [allFormsData]=\"allFormsData\"\n [isMobileView]=\"true\"\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event)\"\n ></kwikid-form-view>\n</ng-template>\n", styles: [".kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%;position:relative}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-logo{max-height:50px;padding-left:1rem}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{width:100%;height:100%;background-color:#fafafa;overflow:hidden}@media screen and (min-width: 600px){.kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:row-reverse;align-content:center;justify-content:flex-end;align-items:stretch;padding:1.5rem;grid-gap:1.5rem;gap:1.5rem;overflow:auto;background-color:#fafafa}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .task-details{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;grid-gap:.5rem;gap:.5rem;overflow:hidden;color:#555}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details .no-task-img{height:100px;width:100px}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{min-width:300px;max-width:400px;width:100%;height:100%;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}}.menu{position:absolute;transition:\"0.15s linear 0s\"}.kwikid-agent-dashboard-loader{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;z-index:100}.kwikid-agent-dashboard-loader .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:#fff #fff transparent;box-sizing:border-box;animation:rotation 1s linear infinite}.kwikid-agent-dashboard-loader .loader:after{content:\"\";box-sizing:border-box;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border:3px solid;border-color:transparent var(--tui-primary) var(--tui-primary);width:24px;height:24px;border-radius:50%;animation:rotationBack .5s linear infinite;transform-origin:center center}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.kwikid-agent-dashboard-loader .t-loader{display:none!important}.add-task-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:.5rem 0 1rem 1rem}:host{width:100%;height:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}.menu-dropdown{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;grid-gap:.5rem;gap:.5rem;padding:1rem 1.5rem}.menu-dropdown .menu-dropdown-header{display:flex;flex-direction:column;align-content:flex-start;justify-content:space-between;align-items:flex-start;grid-gap:1rem;gap:1rem}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-name{font-size:1.2rem;font-weight:600}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-id{font-size:.8rem;font-weight:600}.menu-dropdown .menu-dropdown-buttons ::ng-deep .t-wrapper{padding:0!important}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: i5.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { type: CustomerDetailsComponent, selector: "customer-details", inputs: ["customer", "agentConfig"], outputs: ["nextStep", "removeTask"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers", "agentConfig"], outputs: ["nextStep", "removeTask", "filterTaskList"] }, { type: i8.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["allFormsData", "apiCallResponse", "buttonClickResponse", "formConfig", "formData", "isMobileView", "popupFormCallback", "userConfig"], outputs: ["getLogs", "getUnsavedDataState", "onActionShowPopupForm", "onClickApiCall", "onClickFormFieldButton", "onClickGoBack", "onClickSaveForm", "onClickViewForms"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i11.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i11.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i11.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i11.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i11.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.MapMarker, selector: "map-marker", inputs: ["title", "position", "label", "clickable", "options", "icon", "visible"], outputs: ["animationChanged", "mapClick", "clickableChanged", "cursorChanged", "mapDblclick", "mapDrag", "mapDragend", "draggableChanged", "mapDragstart", "flatChanged", "iconChanged", "mapMousedown", "mapMouseout", "mapMouseover", "mapMouseup", "positionChanged", "mapRightclick", "shapeChanged", "titleChanged", "visibleChanged", "zindexChanged"], exportAs: ["mapMarker"] }, { type: i5.MapDirectionsRenderer, selector: "map-directions-renderer", inputs: ["directions", "options"], outputs: ["directionsChanged"], exportAs: ["mapDirectionsRenderer"] }, { type: i5.MapInfoWindow, selector: "map-info-window", inputs: ["options", "position"], outputs: ["closeclick", "contentChanged", "domready", "positionChanged", "zindexChanged"], exportAs: ["mapInfoWindow"] }], pipes: { "async": i6.AsyncPipe } });
866
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i3$1.HttpClient }, { token: i0.ElementRef }, { token: TuiDialogService }], target: i0.ɵɵFactoryTarget.Component });
867
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponent, selector: "kwikid-agent-dashboard", inputs: { config: "config", taskList: "taskList" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask", filterTaskList: "filterTaskList" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true }, { propertyName: "mapElement", first: true, predicate: ["map"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"kwikid-agent-dashboard\" *ngIf=\"!loading\">\n <div class=\"wrapper\">\n <header>\n <img\n *ngIf=\"\n agentService.config?.clientLogo &&\n agentService.config?.dashboard?.isShowClientLogo\n \"\n [src]=\"agentService.config.clientLogo\"\n class=\"client-logo\"\n />\n <div\n *ngIf=\"\n !agentService.config.clientLogo ||\n !agentService.config?.dashboard?.isShowClientLogo\n \"\n class=\"client-name\"\n >\n <kwikui-button\n [icon]=\"'tuiIconLink'\"\n appearance=\"mono\"\n size=\"m\"\n ></kwikui-button>\n\n {{ agentService.config.clientName }}\n </div>\n <div>\n <kwikui-button\n *ngIf=\"agentService.config?.dashboard?.isAllowAddTask\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconAddRowLarge'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"showDialog(template)\"\n ></kwikui-button>\n <kwikui-button\n appearance=\"mono\"\n class=\"menu-dropdown-buttons\"\n [icon]=\"'tuiIconRefreshCwLarge'\"\n size=\"m\"\n type=\"button\"\n (onClick)=\"refresh()\"\n ></kwikui-button>\n <span (tuiActiveZoneChange)=\"onActiveZone($event)\">\n <kwikui-button\n [icon]=\"'tuiIconSettingsLarge'\"\n (onClick)=\"onClick()\"\n appearance=\"mono\"\n size=\"m\"\n [tuiDropdown]=\"dropdownContent\"\n [tuiDropdownManual]=\"open\"\n (tuiObscured)=\"onObscured($event)\"\n ></kwikui-button>\n <ng-template #dropdownContent>\n <div class=\"menu-dropdown\">\n <div class=\"menu-dropdown-header\">\n <div class=\"menu-dropdown-header-agent-name\">\n {{ agentService.config.agentName }}\n </div>\n <div class=\"menu-dropdown-header-agent-id\">\n Agent ID: {{ agentService.config.agentId }}\n </div>\n </div>\n <hr />\n <div\n class=\"menu-dropdown-body\"\n tuiGroup\n [collapsed]=\"true\"\n [rounded]=\"false\"\n [orientation]=\"'vertical'\"\n [size]=\"'m'\"\n >\n <kwikui-button\n *ngIf=\"this.config.dashboard.isShowMaps\"\n id=\"\"\n label=\"{{\n agentService.showMapview ? 'Hide Maps' : 'Show Maps'\n }}\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n icon=\"{{\n agentService.showMapview ? 'tuiIconEyeOff' : 'tuiIconEye'\n }}\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"padding: 0rem !important\"\n (onClick)=\"agentService.toggleMapview()\"\n ></kwikui-button>\n </div>\n <div class=\"menu-dropdown-footer\">\n <kwikui-button\n id=\"\"\n label=\"Logout\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconLogOut'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"handleOnClickNext({ stepType: 'LOGOUT' })\"\n ></kwikui-button>\n </div>\n </div>\n </ng-template>\n </span>\n </div>\n </header>\n\n <div class=\"dashboard-body\">\n <div [class]=\"agentService.showMapview ? 'map' : 'map-hidden'\">\n <div id=\"map\" style=\"height: 100%\"></div>\n </div>\n\n <div\n class=\"task-details\"\n *ngIf=\"\n !agentService.isMobileView &&\n agentService.isShowTaskDetails != undefined &&\n !agentService.showMapview\n \"\n >\n <customer-details\n [customer]=\"taskList[agentService.isShowTaskDetails]\"\n [config]=\"config\"\n (nextStep)=\"handleOnClickNext($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-details>\n </div>\n\n <div\n class=\"no-task-details\"\n *ngIf=\"\n !agentService.isMobileView &&\n agentService.isShowTaskDetails == undefined &&\n !agentService.showMapview\n \"\n >\n <img src=\"assets/No-Results.jpg\" class=\"no-task-img\" alt=\"No Task\" />\n <div class=\"\">Select a Task to view it's details.</div>\n </div>\n\n <div class=\"customer-list\">\n <customer-list\n [customers]=\"taskList\"\n [config]=\"config\"\n (nextStep)=\"handleOnClickNext($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n (filterTaskList)=\"handleOnFilterTaskList($event)\"\n ></customer-list>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"kwikid-agent-dashboard-loader\" *ngIf=\"loading\">\n <span class=\"loader\"></span>\n</div>\n\n<ng-template #template let-observer>\n <div class=\"add-task-header\">\n <h2>Add Task</h2>\n <kwikui-button\n icon=\"tuiIconX\"\n id=\"\"\n styles=\"\"\n type=\"button\"\n appearance=\"mono\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"observer.complete()\"\n ></kwikui-button>\n </div>\n <kwikid-form-view\n [allFormsData]=\"allFormsData\"\n [formConfig]=\"agentService.addTaskForm\"\n [isMobileView]=\"true\"\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event)\"\n ></kwikid-form-view>\n</ng-template>\n", styles: [".kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%;position:relative}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:4rem;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper header .client-logo{height:100%;padding-left:1rem}.kwikid-agent-dashboard .wrapper header .client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{width:100%;height:100%;background-color:#fafafa;overflow:hidden}@media screen and (min-width: 600px){.kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:4rem;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper header .client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:row-reverse;align-content:center;justify-content:flex-end;align-items:stretch;padding:1.5rem;grid-gap:1.5rem;gap:1.5rem;overflow:auto;background-color:#fafafa}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .task-details{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;grid-gap:.5rem;gap:.5rem;overflow:hidden;color:#555}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details .no-task-img{height:100px;width:100px}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{min-width:300px;max-width:400px;width:100%;height:100%;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}}.menu{position:absolute;transition:\"0.15s linear 0s\"}.kwikid-agent-dashboard-loader{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;z-index:100}.kwikid-agent-dashboard-loader .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:#fff #fff transparent;box-sizing:border-box;animation:rotation 1s linear infinite}.kwikid-agent-dashboard-loader .loader:after{content:\"\";box-sizing:border-box;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border:3px solid;border-color:transparent var(--tui-primary) var(--tui-primary);width:24px;height:24px;border-radius:50%;animation:rotationBack .5s linear infinite;transform-origin:center center}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.kwikid-agent-dashboard-loader .t-loader{display:none!important}.add-task-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:.5rem 0 1rem 1rem}:host{width:100%;height:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}.menu-dropdown{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;grid-gap:.5rem;gap:.5rem;padding:1rem 1.5rem}.menu-dropdown .menu-dropdown-header{display:flex;flex-direction:column;align-content:flex-start;justify-content:space-between;align-items:flex-start;grid-gap:1rem;gap:1rem}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-name{font-size:1.2rem;font-weight:600}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-id{font-size:.8rem;font-weight:600}.menu-dropdown .menu-dropdown-buttons ::ng-deep .t-wrapper{padding:0!important}\n"], components: [{ type: i2.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: CustomerDetailsComponent, selector: "customer-details", inputs: ["customer", "config"], outputs: ["nextStep", "removeTask"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers", "config"], outputs: ["nextStep", "removeTask", "filterTaskList"] }, { type: i7.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["allFormsData", "apiCallResponse", "buttonClickResponse", "formConfig", "formData", "isMobileView", "popupFormCallback", "userConfig"], outputs: ["getLogs", "getUnsavedDataState", "onActionShowPopupForm", "onClickApiCall", "onClickFormFieldButton", "onClickGoBack", "onClickSaveForm", "onClickViewForms"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i10.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i10.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i10.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i10.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i10.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }] });
1289
868
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, decorators: [{
1290
869
  type: Component,
1291
870
  args: [{
@@ -1293,13 +872,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1293
872
  templateUrl: './kwikid-agent-dashboard.component.html',
1294
873
  styleUrls: ['./kwikid-agent-dashboard.component.scss']
1295
874
  }]
1296
- }], ctorParameters: function () { return [{ type: MapService }, { type: UserService }, { type: i3$1.HttpClient }, { type: i0.ElementRef }, { type: i11.TuiDialogService, decorators: [{
875
+ }], ctorParameters: function () { return [{ type: MapService }, { type: AgentService }, { type: i3$1.HttpClient }, { type: i0.ElementRef }, { type: i10.TuiDialogService, decorators: [{
1297
876
  type: Inject,
1298
877
  args: [TuiDialogService]
1299
878
  }] }]; }, propDecorators: { windowResizeWatcher: [{
1300
879
  type: HostListener,
1301
880
  args: ['window:resize', ['$event']]
1302
- }], agentConfig: [{
881
+ }], config: [{
1303
882
  type: Input
1304
883
  }], taskList: [{
1305
884
  type: Input
@@ -1314,6 +893,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1314
893
  }], infoWindow: [{
1315
894
  type: ViewChild,
1316
895
  args: [MapInfoWindow, { static: false }]
896
+ }], mapElement: [{
897
+ type: ViewChild,
898
+ args: ['map', { static: true }]
1317
899
  }] } });
1318
900
 
1319
901
  class KwikIDAgentDashboardModule {