kwikid-agent-dashboard 0.0.21 → 0.0.23

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,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/google-maps'), require('@taiga-ui/core'), require('rxjs'), require('rxjs/operators'), require('@angular/common/http'), require('kwikui'), require('kwikid-toolkit'), require('@angular/common'), require('@angular/forms'), require('@taiga-ui/cdk'), require('@angular/cdk/scrolling'), require('kwikid-forms'), require('@taiga-ui/addon-mobile')) :
3
- typeof define === 'function' && define.amd ? define('kwikid-agent-dashboard', ['exports', '@angular/core', '@angular/google-maps', '@taiga-ui/core', 'rxjs', 'rxjs/operators', '@angular/common/http', 'kwikui', 'kwikid-toolkit', '@angular/common', '@angular/forms', '@taiga-ui/cdk', '@angular/cdk/scrolling', 'kwikid-forms', '@taiga-ui/addon-mobile'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-agent-dashboard"] = {}, global.ng.core, global.ng.googleMaps, global["@taiga-ui/core"], global.rxjs, global.rxjs.operators, global.ng.common.http, global.i2, global.kwikidToolkit, global.ng.common, global.ng.forms, global["@taiga-ui/cdk"], global.ng.cdk.scrolling, global.i8, global["@taiga-ui/addon-mobile"]));
5
- })(this, (function (exports, i0, i5, i11, rxjs, operators, i3$1, i2, kwikidToolkit, i6, i5$1, i10, i3, i8, addonMobile) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/google-maps'), require('@taiga-ui/core'), require('leaflet'), require('leaflet-routing-machine'), require('kwikid-toolkit'), require('@angular/common/http'), require('kwikui'), require('@angular/common'), require('@angular/forms'), require('@taiga-ui/cdk'), require('@angular/cdk/scrolling'), require('kwikid-forms'), require('@taiga-ui/addon-mobile')) :
3
+ typeof define === 'function' && define.amd ? define('kwikid-agent-dashboard', ['exports', '@angular/core', '@angular/google-maps', '@taiga-ui/core', 'leaflet', 'leaflet-routing-machine', 'kwikid-toolkit', '@angular/common/http', 'kwikui', '@angular/common', '@angular/forms', '@taiga-ui/cdk', '@angular/cdk/scrolling', 'kwikid-forms', '@taiga-ui/addon-mobile'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-agent-dashboard"] = {}, global.ng.core, global.ng.googleMaps, global["@taiga-ui/core"], global.L, null, global.kwikidToolkit, global.ng.common.http, global.i2, global.ng.common, global.ng.forms, global["@taiga-ui/cdk"], global.ng.cdk.scrolling, global.i7, global["@taiga-ui/addon-mobile"]));
5
+ })(this, (function (exports, i0, googleMaps, i10, L, leafletRoutingMachine, kwikidToolkit, i3$1, i2, i5, i5$1, i9, i3, i7, addonMobile) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -23,15 +23,15 @@
23
23
  }
24
24
 
25
25
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
- var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
27
- var i11__namespace = /*#__PURE__*/_interopNamespace(i11);
26
+ var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
27
+ var L__namespace = /*#__PURE__*/_interopNamespace(L);
28
28
  var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
29
29
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
30
- var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
30
+ var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
31
31
  var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
32
- var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
32
+ var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
33
33
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
34
- var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
34
+ var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
35
35
 
36
36
  /******************************************************************************
37
37
  Copyright (c) Microsoft Corporation.
@@ -497,190 +497,17 @@
497
497
  __disposeResources: __disposeResources,
498
498
  };
499
499
 
500
- var MapService = /** @class */ (function () {
501
- function MapService(mapDirectionsService) {
502
- this.mapDirectionsService = mapDirectionsService;
503
- this.markers = [];
504
- this.directionsRenderOption = {};
505
- }
506
- MapService.prototype.getMarkers = function () {
507
- return this.markers;
508
- };
509
- MapService.prototype.setMarkers = function (markers) {
510
- this.markers = markers;
511
- };
512
- MapService.prototype.initMap = function () {
513
- return __awaiter(this, void 0, void 0, function () {
514
- var _a;
515
- return __generator(this, function (_b) {
516
- switch (_b.label) {
517
- case 0:
518
- _a = this;
519
- return [4 /*yield*/, this.getPosition()];
520
- case 1:
521
- _a.myPosition = _b.sent();
522
- this.map = {
523
- zoom: 10,
524
- center: this.myPosition,
525
- streetViewControl: false,
526
- mapTypeControl: false,
527
- fullscreenControl: false,
528
- zoomControl: false
529
- };
530
- return [2 /*return*/];
531
- }
532
- });
533
- });
534
- };
535
- MapService.prototype.plotMarkers = function (customers) {
536
- var _this = this;
537
- this.markers = [];
538
- var path = [];
539
- this.markers.push(this.myPosition);
540
- var request = {
541
- origin: this.myPosition,
542
- destination: this.myPosition,
543
- waypoints: path,
544
- optimizeWaypoints: true,
545
- travelMode: google.maps.TravelMode.DRIVING
546
- };
547
- this.directionsRenderOption = {
548
- suppressMarkers: true
549
- };
550
- this.directionsResults$ = this.mapDirectionsService
551
- .route(request)
552
- .pipe(operators.map(function (response) { return response.result; }));
553
- this.directionsResults$.subscribe(function (val) {
554
- customers = _this.sortList(val.routes[0].waypoint_order, customers);
555
- customers.map(function (customer) {
556
- path.push({
557
- location: _this.getLatLng(customer.task_details.customer_details.location),
558
- stopover: true
559
- });
560
- _this.markers.push(_this.getLatLng(customer.task_details.customer_details.location));
561
- });
562
- });
563
- return this.directionsResults$;
564
- };
565
- MapService.prototype.getPosition = function () {
566
- return new Promise(function (resolve, reject) {
567
- navigator.geolocation.watchPosition(function (resp) {
568
- resolve({
569
- lng: resp.coords.longitude,
570
- lat: resp.coords.latitude
571
- });
572
- }, function (err) {
573
- reject(err);
574
- });
575
- });
576
- };
577
- MapService.prototype.getLatLng = function (data) {
578
- var url = data.split('@');
579
- var lat_long_match = url[1].split(',');
580
- var lat = Number(lat_long_match[0]);
581
- var long = Number(lat_long_match[1]);
582
- return { lat: lat, lng: long };
583
- };
584
- MapService.prototype.sortList = function (order, customersData) {
585
- var c = [];
586
- for (var i = 0; i < customersData.length; i++) {
587
- var customer = customersData[order[i]];
588
- c.push(customer);
589
- }
590
- return c;
591
- };
592
- return MapService;
593
- }());
594
- /** @nocollapse */ MapService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, deps: [{ token: i5__namespace.MapDirectionsService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
595
- /** @nocollapse */ MapService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, providedIn: 'root' });
596
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, decorators: [{
597
- type: i0.Injectable,
598
- args: [{
599
- providedIn: 'root'
600
- }]
601
- }], ctorParameters: function () { return [{ type: i5__namespace.MapDirectionsService }]; }, propDecorators: { directionsRenders: [{
602
- type: i0.ViewChildren,
603
- args: ['directionsRender']
604
- }] } });
605
-
606
- var UserService = /** @class */ (function () {
607
- function UserService() {
500
+ var AgentService = /** @class */ (function () {
501
+ function AgentService() {
608
502
  this.isListOpen = true;
609
503
  this.showMapview = false;
610
- this.addTaskFormConfig = {
504
+ this.addTaskForm = {
611
505
  key: 'ADD_TASK',
612
506
  title: 'Add Task',
613
507
  fields: [
614
508
  {
615
509
  key: 'name',
616
510
  label: 'Customer Name',
617
- disabled: false,
618
- messages: [],
619
- default: {
620
- value: {
621
- is_found: false,
622
- value: '',
623
- sources: [
624
- {
625
- key: 'OBJECT',
626
- props: {
627
- object: {
628
- key: 'ALL_FORMS_DATA',
629
- path: '$.ADD_TASK.name'
630
- }
631
- },
632
- value: '',
633
- validation: {
634
- is_valid: false,
635
- triggers: ['ON_INIT'],
636
- rules: [
637
- {
638
- id: '1',
639
- key: 'VALUE_CHECK',
640
- props: {
641
- value: {
642
- source: {
643
- key: 'OBJECT',
644
- props: {
645
- object: {
646
- key: 'ALL_FORMS_DATA',
647
- path: '$.ADD_TASK.name'
648
- }
649
- }
650
- }
651
- },
652
- pattern: {
653
- key: 'IS_NOT_EMPTY'
654
- }
655
- }
656
- }
657
- ],
658
- actions: [
659
- {
660
- id: '1',
661
- key: 'SET_FIELD_DEFAULT_VALUE',
662
- condition: '1',
663
- props: {
664
- fieldKey: 'name',
665
- value: {
666
- source: {
667
- key: 'OBJECT',
668
- props: {
669
- object: {
670
- key: 'ALL_FORMS_DATA',
671
- path: '$.ADD_TASK.name'
672
- }
673
- }
674
- }
675
- }
676
- }
677
- }
678
- ]
679
- }
680
- }
681
- ]
682
- }
683
- },
684
511
  validators: {
685
512
  required: true
686
513
  },
@@ -694,73 +521,6 @@
694
521
  {
695
522
  key: 'phone',
696
523
  label: 'Phone Number',
697
- disabled: false,
698
- messages: [],
699
- default: {
700
- value: {
701
- is_found: false,
702
- value: '',
703
- sources: [
704
- {
705
- key: 'OBJECT',
706
- props: {
707
- object: {
708
- key: 'ALL_FORMS_DATA',
709
- path: '$.ADD_TASK.phone'
710
- }
711
- },
712
- value: '',
713
- validation: {
714
- is_valid: false,
715
- triggers: ['ON_INIT'],
716
- rules: [
717
- {
718
- id: '1',
719
- key: 'VALUE_CHECK',
720
- props: {
721
- value: {
722
- source: {
723
- key: 'OBJECT',
724
- props: {
725
- object: {
726
- key: 'ALL_FORMS_DATA',
727
- path: '$.ADD_TASK.phone'
728
- }
729
- }
730
- }
731
- },
732
- pattern: {
733
- key: 'IS_NOT_EMPTY'
734
- }
735
- }
736
- }
737
- ],
738
- actions: [
739
- {
740
- id: '1',
741
- key: 'SET_FIELD_DEFAULT_VALUE',
742
- condition: '1',
743
- props: {
744
- fieldKey: 'phone',
745
- value: {
746
- source: {
747
- key: 'OBJECT',
748
- props: {
749
- object: {
750
- key: 'ALL_FORMS_DATA',
751
- path: '$.ADD_TASK.phone'
752
- }
753
- }
754
- }
755
- }
756
- }
757
- }
758
- ]
759
- }
760
- }
761
- ]
762
- }
763
- },
764
524
  validators: {
765
525
  required: true
766
526
  },
@@ -776,73 +536,6 @@
776
536
  {
777
537
  key: 'address',
778
538
  label: 'Address',
779
- disabled: false,
780
- messages: [],
781
- default: {
782
- value: {
783
- is_found: false,
784
- value: '',
785
- sources: [
786
- {
787
- key: 'OBJECT',
788
- props: {
789
- object: {
790
- key: 'ALL_FORMS_DATA',
791
- path: '$.ADD_TASK.address'
792
- }
793
- },
794
- value: '',
795
- validation: {
796
- is_valid: false,
797
- triggers: ['ON_INIT'],
798
- rules: [
799
- {
800
- id: '1',
801
- key: 'VALUE_CHECK',
802
- props: {
803
- value: {
804
- source: {
805
- key: 'OBJECT',
806
- props: {
807
- object: {
808
- key: 'ALL_FORMS_DATA',
809
- path: '$.ADD_TASK.address'
810
- }
811
- }
812
- }
813
- },
814
- pattern: {
815
- key: 'IS_NOT_EMPTY'
816
- }
817
- }
818
- }
819
- ],
820
- actions: [
821
- {
822
- id: '1',
823
- key: 'SET_FIELD_DEFAULT_VALUE',
824
- condition: '1',
825
- props: {
826
- fieldKey: 'address',
827
- value: {
828
- source: {
829
- key: 'OBJECT',
830
- props: {
831
- object: {
832
- key: 'ALL_FORMS_DATA',
833
- path: '$.ADD_TASK.address'
834
- }
835
- }
836
- }
837
- }
838
- }
839
- }
840
- ]
841
- }
842
- }
843
- ]
844
- }
845
- },
846
539
  validators: {
847
540
  required: true
848
541
  },
@@ -856,73 +549,6 @@
856
549
  {
857
550
  key: 'city',
858
551
  label: 'City',
859
- disabled: false,
860
- messages: [],
861
- default: {
862
- value: {
863
- is_found: false,
864
- value: '',
865
- sources: [
866
- {
867
- key: 'OBJECT',
868
- props: {
869
- object: {
870
- key: 'ALL_FORMS_DATA',
871
- path: '$.ADD_TASK.city'
872
- }
873
- },
874
- value: '',
875
- validation: {
876
- is_valid: false,
877
- triggers: ['ON_INIT'],
878
- rules: [
879
- {
880
- id: '1',
881
- key: 'VALUE_CHECK',
882
- props: {
883
- value: {
884
- source: {
885
- key: 'OBJECT',
886
- props: {
887
- object: {
888
- key: 'ALL_FORMS_DATA',
889
- path: '$.ADD_TASK.city'
890
- }
891
- }
892
- }
893
- },
894
- pattern: {
895
- key: 'IS_NOT_EMPTY'
896
- }
897
- }
898
- }
899
- ],
900
- actions: [
901
- {
902
- id: '1',
903
- key: 'SET_FIELD_DEFAULT_VALUE',
904
- condition: '1',
905
- props: {
906
- fieldKey: 'city',
907
- value: {
908
- source: {
909
- key: 'OBJECT',
910
- props: {
911
- object: {
912
- key: 'ALL_FORMS_DATA',
913
- path: '$.ADD_TASK.city'
914
- }
915
- }
916
- }
917
- }
918
- }
919
- }
920
- ]
921
- }
922
- }
923
- ]
924
- }
925
- },
926
552
  validators: {
927
553
  required: true
928
554
  },
@@ -936,73 +562,6 @@
936
562
  {
937
563
  key: 'location',
938
564
  label: 'Location URL',
939
- disabled: false,
940
- messages: [],
941
- default: {
942
- value: {
943
- is_found: false,
944
- value: '',
945
- sources: [
946
- {
947
- key: 'OBJECT',
948
- props: {
949
- object: {
950
- key: 'ALL_FORMS_DATA',
951
- path: '$.ADD_TASK.location'
952
- }
953
- },
954
- value: '',
955
- validation: {
956
- is_valid: false,
957
- triggers: ['ON_INIT'],
958
- rules: [
959
- {
960
- id: '1',
961
- key: 'VALUE_CHECK',
962
- props: {
963
- value: {
964
- source: {
965
- key: 'OBJECT',
966
- props: {
967
- object: {
968
- key: 'ALL_FORMS_DATA',
969
- path: '$.ADD_TASK.location'
970
- }
971
- }
972
- }
973
- },
974
- pattern: {
975
- key: 'IS_NOT_EMPTY'
976
- }
977
- }
978
- }
979
- ],
980
- actions: [
981
- {
982
- id: '1',
983
- key: 'SET_FIELD_DEFAULT_VALUE',
984
- condition: '1',
985
- props: {
986
- fieldKey: 'location',
987
- value: {
988
- source: {
989
- key: 'OBJECT',
990
- props: {
991
- object: {
992
- key: 'ALL_FORMS_DATA',
993
- path: '$.ADD_TASK.location'
994
- }
995
- }
996
- }
997
- }
998
- }
999
- }
1000
- ]
1001
- }
1002
- }
1003
- ]
1004
- }
1005
- },
1006
565
  validators: {
1007
566
  required: true
1008
567
  },
@@ -1022,6 +581,9 @@
1022
581
  },
1023
582
  steps: {
1024
583
  hidden: true
584
+ },
585
+ logo: {
586
+ hidden: true
1025
587
  }
1026
588
  },
1027
589
  footer: {
@@ -1037,27 +599,299 @@
1037
599
  }
1038
600
  };
1039
601
  }
1040
- UserService.prototype.ngOnInit = function () { };
1041
- UserService.prototype.setAgentConfig = function (agentConfig) {
1042
- this.agentConfig = agentConfig;
602
+ AgentService.prototype.ngOnInit = function () { };
603
+ AgentService.prototype.setAgentConfig = function (config) {
604
+ this.config = config;
1043
605
  };
1044
- UserService.prototype.toggleMapview = function () {
606
+ AgentService.prototype.toggleMapview = function () {
1045
607
  this.showMapview = !this.showMapview;
1046
608
  };
1047
- return UserService;
609
+ return AgentService;
1048
610
  }());
1049
- /** @nocollapse */ UserService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: UserService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1050
- /** @nocollapse */ UserService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: UserService, providedIn: 'root' });
1051
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: UserService, decorators: [{
611
+ /** @nocollapse */ AgentService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AgentService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
612
+ /** @nocollapse */ AgentService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AgentService, providedIn: 'root' });
613
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AgentService, decorators: [{
1052
614
  type: i0.Injectable,
1053
615
  args: [{
1054
616
  providedIn: 'root'
1055
617
  }]
1056
618
  }], ctorParameters: function () { return []; } });
1057
619
 
620
+ var MapService = /** @class */ (function () {
621
+ function MapService(agentService) {
622
+ this.agentService = agentService;
623
+ this.allMarkers = [];
624
+ }
625
+ // To Initialize Map
626
+ MapService.prototype.initMap = function () {
627
+ return __awaiter(this, void 0, void 0, function () {
628
+ var _g;
629
+ return __generator(this, function (_h) {
630
+ switch (_h.label) {
631
+ case 0:
632
+ _g = this;
633
+ return [4 /*yield*/, this.getPosition()];
634
+ case 1:
635
+ _g.myPosition = _h.sent();
636
+ this.map = L__namespace.map('map', {
637
+ center: [this.myPosition.lat, this.myPosition.lng],
638
+ zoom: 13
639
+ });
640
+ L__namespace.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(this.map);
641
+ return [2 /*return*/];
642
+ }
643
+ });
644
+ });
645
+ };
646
+ // To Add Marker in Map
647
+ MapService.prototype.addMarker = function (_g) {
648
+ var lat = _g.lat, lng = _g.lng, title = _g.title, color = _g.color;
649
+ L__namespace.marker([lat, lng], {
650
+ icon: L__namespace.icon({
651
+ iconUrl: color == 'red'
652
+ ? 'https://kwikid.s3.ap-south-1.amazonaws.com/CONFIG/USER/assets/map-marker-0.png'
653
+ : 'https://kwikid.s3.ap-south-1.amazonaws.com/CONFIG/USER/assets/map-marker-1.png'
654
+ })
655
+ })
656
+ .addTo(this.map)
657
+ .bindPopup(title);
658
+ };
659
+ // To Plot Directions for All Tasks
660
+ MapService.prototype.plotDirectionsForAllTasks = function (tasks) {
661
+ var _this = this;
662
+ if (this.map) {
663
+ this.allMarkers = [];
664
+ // Create Agent Marker & Plot It.
665
+ var myMarker = {
666
+ lat: this.myPosition.lat,
667
+ lng: this.myPosition.lng,
668
+ title: 0,
669
+ color: 'red'
670
+ };
671
+ this.addMarker(myMarker);
672
+ this.allMarkers.push(myMarker);
673
+ // Create Markers for all Tasks
674
+ tasks.map(function (task, index) {
675
+ var marker = _this.getLatLng(_this.getLocation(task), index);
676
+ _this.allMarkers.push(marker);
677
+ });
678
+ // Run Algorithm to get optimized Routes
679
+ var startingPoint = this.allMarkers[0];
680
+ var unvisitedWaypoints = this.allMarkers.slice(1);
681
+ var optimizedRoute = this.nearestNeighborAlgorithm(startingPoint, unvisitedWaypoints);
682
+ // Sort All Markers as per optimized routes
683
+ this.allMarkers = this.sortTasksAsPerDistance(optimizedRoute, this.allMarkers, true);
684
+ // Sort All Tasks as per optimized routes
685
+ tasks = this.sortTasksAsPerDistance(optimizedRoute.slice(1), tasks, false);
686
+ // Plot Markers for All Tasks
687
+ tasks.map(function (task, index) {
688
+ var marker = _this.getLatLng(_this.getLocation(task), index);
689
+ _this.addMarker(marker);
690
+ });
691
+ // Set Styles for all Task Routes
692
+ var styles = [
693
+ { color: 'blue', opacity: 1, weight: 8 },
694
+ { color: 'white', opacity: 0.6, weight: 12 }
695
+ ];
696
+ // Set Routes for all Tasks
697
+ this.allTasksRoutes = this.setRoutes(this.allMarkers, styles);
698
+ this.fitMapBounds();
699
+ }
700
+ return tasks;
701
+ };
702
+ // To plot Direction for selected Task
703
+ MapService.prototype.plotDirectionsForSelectedTask = function (index) {
704
+ if (index !== null) {
705
+ // Remove Previously Selected Task Route
706
+ if (this.selectedTaskRoutes) {
707
+ this.map.removeControl(this.selectedTaskRoutes);
708
+ }
709
+ // Remove All Tasks Routes
710
+ if (this.allTasksRoutes) {
711
+ this.map.removeControl(this.allTasksRoutes);
712
+ }
713
+ var taskMarker = this.allMarkers[index + 1];
714
+ // If Location is Available in Task Details
715
+ if (taskMarker.color != 'red') {
716
+ var markers = [this.allMarkers[0], taskMarker];
717
+ var styles = [
718
+ { color: 'green', opacity: 1, weight: 8 },
719
+ { color: 'white', opacity: 0.4, weight: 12 }
720
+ ];
721
+ this.selectedTaskRoutes = this.setRoutes(markers, styles);
722
+ this.setSelectedTaskDistanceAndTime();
723
+ }
724
+ else {
725
+ alert('No Location Available');
726
+ }
727
+ }
728
+ // Set All Tasks Routes Again & Remove Selected Tasks route
729
+ else {
730
+ if (this.selectedTaskRoutes) {
731
+ this.map.removeControl(this.selectedTaskRoutes);
732
+ }
733
+ this.map.addControl(this.allTasksRoutes);
734
+ this.selectedTaskRoutes = undefined;
735
+ }
736
+ this.fitMapBounds();
737
+ };
738
+ // Get Distance & Time of Selected Task
739
+ MapService.prototype.getSelectedTaskDistanceAndTime = function () {
740
+ return this.selectedTaskDistanceAndTime;
741
+ };
742
+ // Set Distance & Time of Selected Task
743
+ MapService.prototype.setSelectedTaskDistanceAndTime = function () {
744
+ this.selectedTaskRoutes.on('routesfound', function (e) {
745
+ var routes = e.routes;
746
+ var summary = routes[0].summary;
747
+ var distance = summary.totalDistance / 1000;
748
+ var time = Math.round((summary.totalTime % 3600) / 60);
749
+ this.selectedTaskDistanceAndTime = {
750
+ distance: distance,
751
+ time: time
752
+ };
753
+ });
754
+ };
755
+ // To sort Task as per nearest distance
756
+ MapService.prototype.sortTasksAsPerDistance = function (order, tasks, isMarker) {
757
+ var sortedTasks = [];
758
+ for (var i = 0; i < tasks.length; i++) {
759
+ var title = isMarker ? order[i].title : order[i].title - 1;
760
+ var task = tasks[title];
761
+ sortedTasks.push(task);
762
+ }
763
+ return sortedTasks;
764
+ };
765
+ // To set routes in the maps
766
+ MapService.prototype.setRoutes = function (markers, styles) {
767
+ return L__namespace.Routing.control({
768
+ waypoints: markers,
769
+ lineOptions: {
770
+ styles: styles
771
+ },
772
+ createMarker: function () {
773
+ return null;
774
+ },
775
+ routeWhileDragging: true
776
+ }).addTo(this.map);
777
+ };
778
+ // To set view point on the map
779
+ MapService.prototype.fitMapBounds = function () {
780
+ var markerLatLngs = this.allMarkers.map(function (marker) { return L__namespace.latLng(marker.lat, marker.lng); });
781
+ this.map.fitBounds(markerLatLngs);
782
+ };
783
+ // To get Current Position
784
+ MapService.prototype.getPosition = function () {
785
+ return new Promise(function (resolve, reject) {
786
+ navigator.geolocation.watchPosition(function (resp) {
787
+ resolve({
788
+ lng: resp.coords.longitude,
789
+ lat: resp.coords.latitude
790
+ });
791
+ }, function (err) {
792
+ reject(err);
793
+ });
794
+ });
795
+ };
796
+ // To extract Location from the Task Details
797
+ MapService.prototype.getLocation = function (task) {
798
+ var _a, _b, _c, _d, _e, _f;
799
+ if (kwikidToolkit.checkObjectPathExists(this.agentService.config, 'dashboard.taskLocationPath')) {
800
+ var location = kwikidToolkit.getObjectValueFromPath(task, this.agentService.config.dashboard.taskLocationPath);
801
+ return location;
802
+ }
803
+ else {
804
+ 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);
805
+ }
806
+ };
807
+ // To get Latitude & Longitude from Task Location
808
+ MapService.prototype.getLatLng = function (data, index) {
809
+ try {
810
+ var url = data.split('@');
811
+ var lat_long_match = url[1].split(',');
812
+ var lat = Number(lat_long_match[0]);
813
+ var long = Number(lat_long_match[1]);
814
+ return { lat: lat, lng: long, title: index + 1, color: 'blue' };
815
+ }
816
+ catch (_a) {
817
+ // If could not find Google Maps Location URL in Task
818
+ return {
819
+ lat: this.myPosition.lat,
820
+ lng: this.myPosition.lng,
821
+ title: index + 1,
822
+ color: 'red'
823
+ };
824
+ }
825
+ };
826
+ // To Calculate Distance between two markers
827
+ MapService.prototype.calculateDistance = function (point1, point2) {
828
+ var lat1 = point1.lat;
829
+ var lng1 = point1.lng;
830
+ var lat2 = point2.lat;
831
+ var lng2 = point2.lng;
832
+ var R = 6371; // Earth radius in kilometers
833
+ var dLat = (lat2 - lat1) * (Math.PI / 180);
834
+ var dLng = (lng2 - lng1) * (Math.PI / 180);
835
+ var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
836
+ Math.cos((lat1 * Math.PI) / 180) *
837
+ Math.cos((lat2 * Math.PI) / 180) *
838
+ Math.sin(dLng / 2) *
839
+ Math.sin(dLng / 2);
840
+ var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
841
+ var distance = R * c;
842
+ return distance;
843
+ };
844
+ // To calculate nearest distance from marker
845
+ MapService.prototype.nearestNeighborAlgorithm = function (startingPoint, unvisitedPoints) {
846
+ var e_1, _g;
847
+ var currentPoint = startingPoint;
848
+ var path = [currentPoint];
849
+ var visitedPoints = new Set([currentPoint]);
850
+ while (unvisitedPoints.length > 0) {
851
+ var nearestPoint = null;
852
+ var minDistance = Number.POSITIVE_INFINITY;
853
+ try {
854
+ for (var unvisitedPoints_1 = (e_1 = void 0, __values(unvisitedPoints)), unvisitedPoints_1_1 = unvisitedPoints_1.next(); !unvisitedPoints_1_1.done; unvisitedPoints_1_1 = unvisitedPoints_1.next()) {
855
+ var point = unvisitedPoints_1_1.value;
856
+ var distance = this.calculateDistance(currentPoint, point);
857
+ if (distance < minDistance) {
858
+ minDistance = distance;
859
+ nearestPoint = point;
860
+ }
861
+ }
862
+ }
863
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
864
+ finally {
865
+ try {
866
+ if (unvisitedPoints_1_1 && !unvisitedPoints_1_1.done && (_g = unvisitedPoints_1.return)) _g.call(unvisitedPoints_1);
867
+ }
868
+ finally { if (e_1) throw e_1.error; }
869
+ }
870
+ path.push(nearestPoint);
871
+ visitedPoints.add(nearestPoint);
872
+ currentPoint = nearestPoint;
873
+ unvisitedPoints = unvisitedPoints.filter(function (point) { return !visitedPoints.has(point); });
874
+ }
875
+ return path;
876
+ };
877
+ return MapService;
878
+ }());
879
+ /** @nocollapse */ MapService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, deps: [{ token: AgentService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
880
+ /** @nocollapse */ MapService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, providedIn: 'root' });
881
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, decorators: [{
882
+ type: i0.Injectable,
883
+ args: [{
884
+ providedIn: 'root'
885
+ }]
886
+ }], ctorParameters: function () { return [{ type: AgentService }]; }, propDecorators: { directionsRenders: [{
887
+ type: i0.ViewChildren,
888
+ args: ['directionsRender']
889
+ }] } });
890
+
1058
891
  var CustomerDetailsComponent = /** @class */ (function () {
1059
- function CustomerDetailsComponent(userService) {
1060
- this.userService = userService;
892
+ function CustomerDetailsComponent(agentService, mapService) {
893
+ this.agentService = agentService;
894
+ this.mapService = mapService;
1061
895
  this.customer = {
1062
896
  agent_id: 'sparkcpaital_dev_agent_1',
1063
897
  client_name: 'sparkcpaital_dev',
@@ -1094,7 +928,17 @@
1094
928
  CustomerDetailsComponent.prototype.ngOnInit = function () {
1095
929
  var _a, _b, _c;
1096
930
  this.viewTaskDetails =
1097
- (_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;
931
+ (_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;
932
+ };
933
+ CustomerDetailsComponent.prototype.getTaskCreationTime = function (task) {
934
+ var _a;
935
+ if (kwikidToolkit.checkObjectPathExists(this.agentService.config, 'dashboard.taskCreationTimePath')) {
936
+ var time = kwikidToolkit.getObjectValueFromPath(task, this.agentService.config.dashboard.taskCreationTimePath);
937
+ return this.convertEpochToDate(time);
938
+ }
939
+ else {
940
+ 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);
941
+ }
1098
942
  };
1099
943
  CustomerDetailsComponent.prototype.convertToTitleCase = function (inputString) {
1100
944
  inputString = inputString.replace('$.task_details.customer_details.', '');
@@ -1118,19 +962,20 @@
1118
962
  CustomerDetailsComponent.prototype.goToMaps = function (location) {
1119
963
  window.open("" + location, '_blank');
1120
964
  };
1121
- CustomerDetailsComponent.prototype.goToNextStep = function (e) {
965
+ CustomerDetailsComponent.prototype.handleOnClickNext = function (e) {
1122
966
  this.nextStep.emit(e);
1123
967
  };
1124
968
  CustomerDetailsComponent.prototype.close = function () {
1125
- this.userService.showTaskDetails = undefined;
969
+ this.agentService.isShowTaskDetails = undefined;
970
+ this.mapService.plotDirectionsForSelectedTask(null);
1126
971
  };
1127
972
  CustomerDetailsComponent.prototype.handleOnClickRemoveTask = function (task) {
1128
973
  this.removeTask.emit(task);
1129
974
  };
1130
975
  return CustomerDetailsComponent;
1131
976
  }());
1132
- /** @nocollapse */ CustomerDetailsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, deps: [{ token: UserService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1133
- /** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
977
+ /** @nocollapse */ CustomerDetailsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, deps: [{ token: AgentService }, { token: MapService }], target: i0__namespace.ɵɵFactoryTarget.Component });
978
+ /** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1134
979
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, decorators: [{
1135
980
  type: i0.Component,
1136
981
  args: [{
@@ -1138,9 +983,9 @@
1138
983
  templateUrl: './customer-details.component.html',
1139
984
  styleUrls: ['./customer-details.component.scss']
1140
985
  }]
1141
- }], ctorParameters: function () { return [{ type: UserService }]; }, propDecorators: { customer: [{
986
+ }], ctorParameters: function () { return [{ type: AgentService }, { type: MapService }]; }, propDecorators: { customer: [{
1142
987
  type: i0.Input
1143
- }], agentConfig: [{
988
+ }], config: [{
1144
989
  type: i0.Input
1145
990
  }], nextStep: [{
1146
991
  type: i0.Output
@@ -1166,200 +1011,6 @@
1166
1011
  EStatus.COMPLETE
1167
1012
  ];
1168
1013
 
1169
- var InfoWindowService = /** @class */ (function () {
1170
- function InfoWindowService(mapService) {
1171
- this.mapService = mapService;
1172
- this.config = {
1173
- fields: {
1174
- name: {
1175
- label: 'Name',
1176
- value: 'name',
1177
- display: 'value',
1178
- style: {
1179
- fontSize: '1rem',
1180
- fontWeight: 600
1181
- }
1182
- },
1183
- phone: {
1184
- label: 'Call',
1185
- value: 'phone',
1186
- display: 'label',
1187
- style: {
1188
- fontSize: '0.8rem',
1189
- padding: '0.1rem 0',
1190
- textAlign: 'justify'
1191
- },
1192
- icon: 'https://cdn-icons-png.flaticon.com/512/60/60720.png'
1193
- },
1194
- address: {
1195
- label: 'Directions',
1196
- value: 'address',
1197
- display: 'label',
1198
- style: {
1199
- fontSize: '0.8rem',
1200
- padding: '0.1rem 0'
1201
- },
1202
- icon: 'https://cdn-icons-png.flaticon.com/512/62/62516.png'
1203
- }
1204
- }
1205
- };
1206
- this.mainInfoWindowStyle = {
1207
- display: 'flex',
1208
- 'flex-direction': 'column',
1209
- 'justify-content': 'center',
1210
- 'align-items': 'stretch',
1211
- gap: '0.5rem',
1212
- padding: '0.5rem'
1213
- };
1214
- this.fieldDivStyle = {
1215
- gap: ' 0.5rem',
1216
- display: 'flex',
1217
- 'flex-direction': 'row'
1218
- };
1219
- }
1220
- InfoWindowService.prototype.getOpenMarker = function () {
1221
- return this.openMarker;
1222
- };
1223
- InfoWindowService.prototype.setOpenMarker = function (value) {
1224
- this.openMarker = value;
1225
- };
1226
- /**
1227
- * @description
1228
- * Wrapper method to show Customer Info Window
1229
- *
1230
- * @function showInfo
1231
- * @func showInfo
1232
- * @method showInfo
1233
- */
1234
- InfoWindowService.prototype.showCustomerInformation = function (customer, marker) {
1235
- var map = this.mapService.map;
1236
- var contentString = this.createInfoContent(customer);
1237
- var infowindow = new google.maps.InfoWindow({
1238
- content: contentString
1239
- });
1240
- this.addEventListeners(customer, infowindow);
1241
- this.closeLastOpenedInfoWindow();
1242
- infowindow.open(map, marker);
1243
- this.lastInfoWindowOpened = infowindow;
1244
- this.mapService.map = Object.assign(Object.assign({}, this.mapService.map), { center: marker.getPosition });
1245
- // map.setCenter(marker.getPosition());
1246
- return { infowindow: infowindow };
1247
- };
1248
- InfoWindowService.prototype.addEventListeners = function (customer, infowindow) {
1249
- // chnage -
1250
- var addressLink = "http://maps.google.com/?q=" + customer.extras.loc[0] + ", " + customer.extras.loc[1];
1251
- google.maps.event.addListener(infowindow, 'domready', function () {
1252
- document.getElementById('Call').addEventListener('click', function (e) {
1253
- window.open("tel:" + customer.extras.phone, '_self');
1254
- });
1255
- document
1256
- .getElementById('Directions')
1257
- .addEventListener('click', function (e) {
1258
- window.open("" + addressLink, '_blank');
1259
- });
1260
- document
1261
- .getElementsByClassName('gm-ui-hover-effect')[0]
1262
- .setAttribute('style', ' background: none;\
1263
- display: block; \
1264
- border: 0px; \
1265
- margin: 0px; \
1266
- padding: 0px; \
1267
- text-transform: none; \
1268
- appearance: none; \
1269
- position: absolute; \
1270
- cursor: pointer; \
1271
- user-select: none; \
1272
- top: 0px; \
1273
- right: 0px; \
1274
- width: 30px; \
1275
- height: 30px; \
1276
- ');
1277
- });
1278
- };
1279
- /**
1280
- * @description
1281
- * Wrapper method to close Last Info Window
1282
- *
1283
- * @function closeLastOpenedInfoWindow
1284
- * @func closeLastOpenedInfoWindow
1285
- * @method closeLastOpenedInfoWindow
1286
- */
1287
- InfoWindowService.prototype.closeLastOpenedInfoWindow = function () {
1288
- if (this.lastInfoWindowOpened) {
1289
- this.lastInfoWindowOpened.close();
1290
- }
1291
- };
1292
- /**
1293
- * @description
1294
- * Closes the previously opened info window.
1295
- *
1296
- * @function infoData
1297
- * @func infoData
1298
- * @method infoData
1299
- */
1300
- InfoWindowService.prototype.createInfoContent = function (customer) {
1301
- var content = "<div style='padding:4px; font-family: Manrope;' >";
1302
- content += this.createFields(customer, this.config.fields);
1303
- content += '</div>';
1304
- return content;
1305
- };
1306
- /**
1307
- * @description
1308
- * Wrapper method to create Fields Container
1309
- *
1310
- * @function createFields
1311
- * @func createFields
1312
- * @method createFields
1313
- */
1314
- InfoWindowService.prototype.createFields = function (customer, fields) {
1315
- var e_1, _a;
1316
- var _div = document.createElement('div');
1317
- for (var property in this.mainInfoWindowStyle)
1318
- _div.style[property] = this.mainInfoWindowStyle[property];
1319
- try {
1320
- for (var _b = __values(Object.keys(fields)), _c = _b.next(); !_c.done; _c = _b.next()) {
1321
- var key = _c.value;
1322
- var field = fields[key];
1323
- var _fieldDiv = document.createElement('div');
1324
- _fieldDiv.setAttribute('id', field.label);
1325
- for (var property in this.fieldDivStyle)
1326
- _fieldDiv.style[property] = this.fieldDivStyle[property];
1327
- for (var property in field.style)
1328
- _fieldDiv.style[property] = field.style[property];
1329
- var string = field.display == 'label' ? field.label : customer.extras[field.value];
1330
- if (field.icon) {
1331
- var _icon = document.createElement('img');
1332
- _icon.src = field.icon;
1333
- _icon.style.width = field.style.fontSize;
1334
- _icon.style.height = field.style.fontSize;
1335
- _fieldDiv.appendChild(_icon);
1336
- }
1337
- var _fieldText = document.createElement('div');
1338
- _fieldText.innerHTML = string;
1339
- _fieldDiv.appendChild(_fieldText);
1340
- _div.appendChild(_fieldDiv);
1341
- }
1342
- }
1343
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1344
- finally {
1345
- try {
1346
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1347
- }
1348
- finally { if (e_1) throw e_1.error; }
1349
- }
1350
- return _div.outerHTML;
1351
- };
1352
- return InfoWindowService;
1353
- }());
1354
- /** @nocollapse */ InfoWindowService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: InfoWindowService, deps: [{ token: MapService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1355
- /** @nocollapse */ InfoWindowService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: InfoWindowService, providedIn: 'root' });
1356
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: InfoWindowService, decorators: [{
1357
- type: i0.Injectable,
1358
- args: [{
1359
- providedIn: 'root'
1360
- }]
1361
- }], ctorParameters: function () { return [{ type: MapService }]; } });
1362
-
1363
1014
  var StatusPillComponent = /** @class */ (function () {
1364
1015
  function StatusPillComponent() {
1365
1016
  }
@@ -1375,7 +1026,7 @@
1375
1026
  return StatusPillComponent;
1376
1027
  }());
1377
1028
  /** @nocollapse */ StatusPillComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StatusPillComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1378
- /** @nocollapse */ StatusPillComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0__namespace, 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__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1029
+ /** @nocollapse */ StatusPillComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0__namespace, 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__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1379
1030
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StatusPillComponent, decorators: [{
1380
1031
  type: i0.Component,
1381
1032
  args: [{
@@ -1388,41 +1039,14 @@
1388
1039
  }] } });
1389
1040
 
1390
1041
  var CustomerTileComponent = /** @class */ (function () {
1391
- /**
1392
- * @description
1393
- *
1394
- * @constructor
1395
- */
1396
- function CustomerTileComponent(mapService, infoWindowService, userService, hostElement) {
1042
+ function CustomerTileComponent(mapService, agentService, hostElement) {
1397
1043
  this.mapService = mapService;
1398
- this.infoWindowService = infoWindowService;
1399
- this.userService = userService;
1044
+ this.agentService = agentService;
1400
1045
  this.hostElement = hostElement;
1401
- /**
1402
- * @description
1403
- * Determines Customer Data
1404
- *
1405
- * @default
1406
- * `{}`
1407
- */
1408
1046
  this.customer = {};
1409
- /**
1410
- * @description
1411
- * Determines Index of Customer Data in Customer List
1412
- *
1413
- * @default
1414
- *
1415
- */
1416
1047
  this.index = undefined;
1417
1048
  this.isMobileView = false;
1418
1049
  this.viewTaskDetails = [];
1419
- /**
1420
- * @description
1421
- * Emitter to emit next Step
1422
- *
1423
- * @emits KwikIDAgentDashboardComponent#nextStep
1424
- * @fires KwikIDAgentDashboardComponent#nextStep
1425
- */
1426
1050
  this.nextStep = new i0.EventEmitter();
1427
1051
  this.removeTask = new i0.EventEmitter();
1428
1052
  }
@@ -1434,66 +1058,35 @@
1434
1058
  this.isMobileView = false;
1435
1059
  }
1436
1060
  };
1437
- /**
1438
- * @description
1439
- * To set Google Maps API on script
1440
- *
1441
- * @ngOnInit
1442
- */
1443
1061
  CustomerTileComponent.prototype.ngOnInit = function () {
1444
1062
  var _a, _b, _c;
1445
1063
  this.viewTaskDetails =
1446
- (_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;
1064
+ (_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;
1447
1065
  };
1448
1066
  CustomerTileComponent.prototype.getTaskDetails = function (taskData) {
1449
1067
  return kwikidToolkit.getObjectValueFromPath(this.customer, taskData);
1450
1068
  };
1451
1069
  CustomerTileComponent.prototype.openDetails = function () {
1452
- if (this.userService.showTaskDetails !== this.index) {
1453
- this.userService.showTaskDetails = this.index;
1070
+ if (this.agentService.isShowTaskDetails !== this.index) {
1071
+ this.agentService.isShowTaskDetails = this.index;
1072
+ this.mapService.plotDirectionsForSelectedTask(this.index);
1454
1073
  }
1455
1074
  else {
1456
- this.userService.showTaskDetails = undefined;
1075
+ this.agentService.isShowTaskDetails = undefined;
1076
+ this.mapService.plotDirectionsForSelectedTask(null);
1457
1077
  }
1458
1078
  };
1459
- CustomerTileComponent.prototype.tileClick = function () {
1460
- this.openDetails();
1461
- if (this.index == this.infoWindowService.getOpenMarker()) {
1462
- this.infoWindowService.setOpenMarker(null);
1463
- //this.infoWindowService.lastInfoWindowOpened.close();
1464
- }
1465
- else {
1466
- this.showDetails(this.customer, this.index);
1467
- }
1468
- };
1469
- /**
1470
- * @description
1471
- * Wrapper method to show Customer Info Window
1472
- *
1473
- * @function showDetails
1474
- * @func showDetails
1475
- * @method showDetails
1476
- */
1477
- CustomerTileComponent.prototype.showDetails = function (customer, index) {
1478
- var markers = this.mapService.getMarkers();
1479
- var marker = markers[index + 1];
1480
- // let { infowindow } = this.infoWindowService.showCustomerInformation(
1481
- // customer,
1482
- // marker
1483
- // );
1484
- this.infoWindowService.setOpenMarker(index);
1485
- };
1486
1079
  CustomerTileComponent.prototype.getClass = function () {
1487
- var string = "customer-tile-wrapper";
1488
- if (this.userService.showTaskDetails == this.index) {
1489
- string += " customer-tile-active";
1080
+ var string = 'customer-tile-wrapper';
1081
+ if (this.agentService.isShowTaskDetails == this.index) {
1082
+ string += ' customer-tile-active';
1490
1083
  }
1491
1084
  return string;
1492
1085
  };
1493
1086
  CustomerTileComponent.prototype.goToMaps = function (location) {
1494
1087
  window.open("" + location, '_blank');
1495
1088
  };
1496
- CustomerTileComponent.prototype.goToNextStep = function (e) {
1089
+ CustomerTileComponent.prototype.handleOnClickNext = function (e) {
1497
1090
  this.nextStep.emit(e);
1498
1091
  };
1499
1092
  CustomerTileComponent.prototype.handleOnClickRemoveTask = function (task) {
@@ -1501,8 +1094,8 @@
1501
1094
  };
1502
1095
  return CustomerTileComponent;
1503
1096
  }());
1504
- /** @nocollapse */ CustomerTileComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, deps: [{ token: MapService }, { token: InfoWindowService }, { token: UserService }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1505
- /** @nocollapse */ CustomerTileComponent.ɵcmp = i0__namespace.ɵɵ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: i5.MapInfoWindow, descendants: true }], ngImport: i0__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1097
+ /** @nocollapse */ CustomerTileComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
1098
+ /** @nocollapse */ CustomerTileComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1506
1099
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, decorators: [{
1507
1100
  type: i0.Component,
1508
1101
  args: [{
@@ -1510,22 +1103,19 @@
1510
1103
  templateUrl: './customer-tile.component.html',
1511
1104
  styleUrls: ['./customer-tile.component.scss']
1512
1105
  }]
1513
- }], ctorParameters: function () { return [{ type: MapService }, { type: InfoWindowService }, { type: UserService }, { type: i0__namespace.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
1106
+ }], ctorParameters: function () { return [{ type: MapService }, { type: AgentService }, { type: i0__namespace.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
1514
1107
  type: i0.HostListener,
1515
1108
  args: ['window:resize', ['$event']]
1516
1109
  }], customer: [{
1517
1110
  type: i0.Input
1518
1111
  }], index: [{
1519
1112
  type: i0.Input
1520
- }], agentConfig: [{
1113
+ }], config: [{
1521
1114
  type: i0.Input
1522
1115
  }], nextStep: [{
1523
1116
  type: i0.Output
1524
1117
  }], removeTask: [{
1525
1118
  type: i0.Output
1526
- }], infoWindow: [{
1527
- type: i0.ViewChild,
1528
- args: [i5.MapInfoWindow]
1529
1119
  }] } });
1530
1120
 
1531
1121
  var Ng2SearchPipe = /** @class */ (function () {
@@ -1604,7 +1194,7 @@
1604
1194
  this.fromDate = this.getDate(null);
1605
1195
  this.toDate = this.getDate(null);
1606
1196
  this.dateRangeFormControl = new i5$1.FormControl({
1607
- value: new i10.TuiDayRange(new i10.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()), new i10.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())),
1197
+ value: new i9.TuiDayRange(new i9.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()), new i9.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())),
1608
1198
  disabled: false
1609
1199
  });
1610
1200
  this.formGroup.addControl('dateRange', this.dateRangeFormControl);
@@ -1619,7 +1209,7 @@
1619
1209
  return __generator(this, function (_c) {
1620
1210
  switch (_c.label) {
1621
1211
  case 0:
1622
- if (!this.agentConfig.dashboardConfig.showMaps) return [3 /*break*/, 3];
1212
+ if (!this.config.dashboard.isShowMaps) return [3 /*break*/, 3];
1623
1213
  return [4 /*yield*/, this.mapService.initMap()];
1624
1214
  case 1:
1625
1215
  _c.sent();
@@ -1637,14 +1227,26 @@
1637
1227
  }); }, 1000);
1638
1228
  };
1639
1229
  CustomerListComponent.prototype.ngOnChanges = function () {
1640
- if (this.agentConfig.dashboardConfig.showMaps) {
1641
- this.filteredData = this.plotMarkers(this.customers);
1642
- }
1643
- else {
1644
- this.filteredData = this.customers;
1645
- }
1230
+ return __awaiter(this, void 0, void 0, function () {
1231
+ var _b;
1232
+ return __generator(this, function (_c) {
1233
+ switch (_c.label) {
1234
+ case 0:
1235
+ if (!this.config.dashboard.isShowMaps) return [3 /*break*/, 2];
1236
+ _b = this;
1237
+ return [4 /*yield*/, this.plotMarkers(this.customers)];
1238
+ case 1:
1239
+ _b.filteredData = _c.sent();
1240
+ return [3 /*break*/, 3];
1241
+ case 2:
1242
+ this.filteredData = this.customers;
1243
+ _c.label = 3;
1244
+ case 3: return [2 /*return*/];
1245
+ }
1246
+ });
1247
+ });
1646
1248
  };
1647
- CustomerListComponent.prototype.goToNextStep = function (e) {
1249
+ CustomerListComponent.prototype.handleOnClickNext = function (e) {
1648
1250
  this.nextStep.emit(e);
1649
1251
  };
1650
1252
  CustomerListComponent.prototype.getDate = function (d) {
@@ -1660,18 +1262,23 @@
1660
1262
  return today;
1661
1263
  };
1662
1264
  CustomerListComponent.prototype.plotMarkers = function (customers) {
1663
- var _this = this;
1664
1265
  var _a;
1665
- if (!((_a = this.agentConfig.dashboardConfig) === null || _a === void 0 ? void 0 : _a.showHistory)) {
1666
- customers = customers.filter(function (customer) {
1667
- return customer.status !== EStatus.COMPLETE;
1266
+ return __awaiter(this, void 0, void 0, function () {
1267
+ return __generator(this, function (_b) {
1268
+ switch (_b.label) {
1269
+ case 0:
1270
+ if (!((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.isPlotCompletedTaskMarkers)) {
1271
+ customers = customers.filter(function (customer) {
1272
+ return customer.status !== EStatus.COMPLETE;
1273
+ });
1274
+ }
1275
+ return [4 /*yield*/, this.mapService.plotDirectionsForAllTasks(customers)];
1276
+ case 1:
1277
+ customers = _b.sent();
1278
+ return [2 /*return*/, customers];
1279
+ }
1668
1280
  });
1669
- }
1670
- var directionsResults$ = this.mapService.plotMarkers(customers);
1671
- directionsResults$.subscribe(function (val) {
1672
- _this.filteredData = _this.mapService.sortList(val.routes[0].waypoint_order, customers);
1673
1281
  });
1674
- return customers;
1675
1282
  };
1676
1283
  CustomerListComponent.prototype.getTuiDate = function (event) {
1677
1284
  var year = event.year;
@@ -1701,7 +1308,7 @@
1701
1308
  return CustomerListComponent;
1702
1309
  }());
1703
1310
  /** @nocollapse */ CustomerListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerListComponent, deps: [{ token: MapService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1704
- /** @nocollapse */ CustomerListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.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__namespace.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__namespace.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__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5__namespace$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3__namespace.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe } });
1311
+ /** @nocollapse */ CustomerListComponent.ɵcmp = i0__namespace.ɵɵ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__namespace, 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__namespace.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__namespace.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__namespace.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__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5__namespace$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3__namespace.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe } });
1705
1312
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerListComponent, decorators: [{
1706
1313
  type: i0.Component,
1707
1314
  args: [{
@@ -1711,7 +1318,7 @@
1711
1318
  }]
1712
1319
  }], ctorParameters: function () { return [{ type: MapService }]; }, propDecorators: { customers: [{
1713
1320
  type: i0.Input
1714
- }], agentConfig: [{
1321
+ }], config: [{
1715
1322
  type: i0.Input
1716
1323
  }], nextStep: [{
1717
1324
  type: i0.Output
@@ -1722,53 +1329,47 @@
1722
1329
  }] } });
1723
1330
 
1724
1331
  var KwikIDAgentDashboardComponent = /** @class */ (function () {
1725
- function KwikIDAgentDashboardComponent(mapService, userService, httpClient, hostElement, dialogService) {
1332
+ function KwikIDAgentDashboardComponent(mapService, agentService, httpClient, hostElement, dialogService) {
1726
1333
  this.mapService = mapService;
1727
- this.userService = userService;
1334
+ this.agentService = agentService;
1728
1335
  this.httpClient = httpClient;
1729
1336
  this.hostElement = hostElement;
1730
1337
  this.dialogService = dialogService;
1731
- this.agentConfig = {};
1338
+ this.config = {};
1732
1339
  this.taskList = [];
1733
1340
  this.nextStep = new i0.EventEmitter();
1734
1341
  this.addTask = new i0.EventEmitter();
1735
1342
  this.removeTask = new i0.EventEmitter();
1736
1343
  this.filterTaskList = new i0.EventEmitter();
1737
1344
  this.loading = true;
1738
- this.options = {
1739
- stops: ['calc(5rem + 74vw)', 'calc(9rem + 74vw)']
1740
- };
1741
1345
  this.open = false;
1742
1346
  this.allFormsData = {};
1743
1347
  this.String = String;
1744
- this.apiLoaded = httpClient
1745
- .jsonp('https://maps.googleapis.com/maps/api/js?key=AIzaSyA63JY0ja6ZGIR796vJqZARc0c2j8Vgpik&v=3.exp&libraries=geometry,drawing,places', 'callback')
1746
- .pipe(operators.map(function () { return true; }), operators.catchError(function () { return rxjs.of(false); }));
1747
1348
  }
1748
1349
  KwikIDAgentDashboardComponent.prototype.windowResizeWatcher = function () {
1749
1350
  if (this.hostElement.nativeElement.offsetWidth < 600) {
1750
1351
  this.isMobileView = true;
1751
- this.userService.isMobileView = true;
1352
+ this.agentService.isMobileView = true;
1752
1353
  }
1753
1354
  else {
1754
1355
  this.isMobileView = false;
1755
- this.userService.isMobileView = false;
1356
+ this.agentService.isMobileView = false;
1756
1357
  }
1757
1358
  };
1758
1359
  KwikIDAgentDashboardComponent.prototype.ngOnInit = function () {
1759
1360
  var _this = this;
1760
1361
  var _a, _b, _c, _d, _e, _f;
1761
- this.userService.agentConfig = this.agentConfig;
1762
- this.userService.showMapview =
1763
- (_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;
1764
- this.userService.addTaskFormConfig =
1765
- (_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;
1362
+ this.agentService.config = this.config;
1363
+ this.agentService.showMapview =
1364
+ (_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;
1365
+ this.agentService.addTaskForm =
1366
+ (_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;
1766
1367
  this.loading = false;
1767
1368
  setTimeout(function () {
1768
1369
  _this.windowResizeWatcher();
1769
1370
  }, 1000);
1770
1371
  };
1771
- KwikIDAgentDashboardComponent.prototype.goToNextStep = function (e) {
1372
+ KwikIDAgentDashboardComponent.prototype.handleOnClickNext = function (e) {
1772
1373
  this.nextStep.emit(e);
1773
1374
  };
1774
1375
  KwikIDAgentDashboardComponent.prototype.handleOnClickAddTask = function (task) {
@@ -1808,8 +1409,8 @@
1808
1409
  KwikIDAgentDashboardComponent.prototype.handleOnClickViewForms = function (e) { };
1809
1410
  return KwikIDAgentDashboardComponent;
1810
1411
  }());
1811
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: UserService }, { token: i3__namespace$1.HttpClient }, { token: i0__namespace.ElementRef }, { token: i11.TuiDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1812
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0__namespace.ɵɵ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: i5.MapInfoWindow, descendants: true }], ngImport: i0__namespace, 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__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: i5__namespace.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__namespace.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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i11__namespace.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i11__namespace.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i11__namespace.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i11__namespace.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i11__namespace.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.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__namespace.MapDirectionsRenderer, selector: "map-directions-renderer", inputs: ["directions", "options"], outputs: ["directionsChanged"], exportAs: ["mapDirectionsRenderer"] }, { type: i5__namespace.MapInfoWindow, selector: "map-info-window", inputs: ["options", "position"], outputs: ["closeclick", "contentChanged", "domready", "positionChanged", "zindexChanged"], exportAs: ["mapInfoWindow"] }], pipes: { "async": i6__namespace.AsyncPipe } });
1412
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i3__namespace$1.HttpClient }, { token: i0__namespace.ElementRef }, { token: i10.TuiDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1413
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0__namespace.ɵɵ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: googleMaps.MapInfoWindow, descendants: true }, { propertyName: "mapElement", first: true, predicate: ["map"], descendants: true, static: true }], ngImport: i0__namespace, 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__namespace.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__namespace.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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9__namespace.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i10__namespace.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i10__namespace.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i10__namespace.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i10__namespace.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i10__namespace.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }] });
1813
1414
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardComponent, decorators: [{
1814
1415
  type: i0.Component,
1815
1416
  args: [{
@@ -1818,14 +1419,14 @@
1818
1419
  styleUrls: ['./kwikid-agent-dashboard.component.scss']
1819
1420
  }]
1820
1421
  }], ctorParameters: function () {
1821
- return [{ type: MapService }, { type: UserService }, { type: i3__namespace$1.HttpClient }, { type: i0__namespace.ElementRef }, { type: i11__namespace.TuiDialogService, decorators: [{
1422
+ return [{ type: MapService }, { type: AgentService }, { type: i3__namespace$1.HttpClient }, { type: i0__namespace.ElementRef }, { type: i10__namespace.TuiDialogService, decorators: [{
1822
1423
  type: i0.Inject,
1823
- args: [i11.TuiDialogService]
1424
+ args: [i10.TuiDialogService]
1824
1425
  }] }];
1825
1426
  }, propDecorators: { windowResizeWatcher: [{
1826
1427
  type: i0.HostListener,
1827
1428
  args: ['window:resize', ['$event']]
1828
- }], agentConfig: [{
1429
+ }], config: [{
1829
1430
  type: i0.Input
1830
1431
  }], taskList: [{
1831
1432
  type: i0.Input
@@ -1839,7 +1440,10 @@
1839
1440
  type: i0.Output
1840
1441
  }], infoWindow: [{
1841
1442
  type: i0.ViewChild,
1842
- args: [i5.MapInfoWindow, { static: false }]
1443
+ args: [googleMaps.MapInfoWindow, { static: false }]
1444
+ }], mapElement: [{
1445
+ type: i0.ViewChild,
1446
+ args: ['map', { static: true }]
1843
1447
  }] } });
1844
1448
 
1845
1449
  var KwikIDAgentDashboardModule = /** @class */ (function () {
@@ -1853,7 +1457,7 @@
1853
1457
  CustomerTileComponent,
1854
1458
  Ng2SearchPipe,
1855
1459
  StatusPillComponent,
1856
- CustomerDetailsComponent], imports: [i6.CommonModule,
1460
+ CustomerDetailsComponent], imports: [i5.CommonModule,
1857
1461
  i3$1.HttpClientModule,
1858
1462
  i5$1.FormsModule,
1859
1463
  i5$1.ReactiveFormsModule,
@@ -1864,20 +1468,20 @@
1864
1468
  i2.KwikUIInputSelectModule,
1865
1469
  i2.KwikUITableModule,
1866
1470
  i2.KwikUITablePaginationModule,
1867
- i8.KwikIDFormViewModule,
1868
- i11.TuiRootModule,
1869
- i11.TuiDialogModule,
1870
- i11.TuiDropdownModule,
1471
+ i7.KwikIDFormViewModule,
1472
+ i10.TuiRootModule,
1473
+ i10.TuiDialogModule,
1474
+ i10.TuiDropdownModule,
1871
1475
  addonMobile.TuiSidebarModule,
1872
- i10.TuiActiveZoneModule,
1873
- i11.TuiGroupModule,
1874
- i11.TuiSvgModule,
1476
+ i9.TuiActiveZoneModule,
1477
+ i10.TuiGroupModule,
1478
+ i10.TuiSvgModule,
1875
1479
  i3.ScrollingModule,
1876
- i5.GoogleMapsModule,
1480
+ googleMaps.GoogleMapsModule,
1877
1481
  i3$1.HttpClientModule,
1878
1482
  i3$1.HttpClientJsonpModule], exports: [KwikIDAgentDashboardComponent] });
1879
1483
  /** @nocollapse */ KwikIDAgentDashboardModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardModule, imports: [[
1880
- i6.CommonModule,
1484
+ i5.CommonModule,
1881
1485
  i3$1.HttpClientModule,
1882
1486
  i5$1.FormsModule,
1883
1487
  i5$1.ReactiveFormsModule,
@@ -1888,16 +1492,16 @@
1888
1492
  i2.KwikUIInputSelectModule,
1889
1493
  i2.KwikUITableModule,
1890
1494
  i2.KwikUITablePaginationModule,
1891
- i8.KwikIDFormViewModule,
1892
- i11.TuiRootModule,
1893
- i11.TuiDialogModule,
1894
- i11.TuiDropdownModule,
1495
+ i7.KwikIDFormViewModule,
1496
+ i10.TuiRootModule,
1497
+ i10.TuiDialogModule,
1498
+ i10.TuiDropdownModule,
1895
1499
  addonMobile.TuiSidebarModule,
1896
- i10.TuiActiveZoneModule,
1897
- i11.TuiGroupModule,
1898
- i11.TuiSvgModule,
1500
+ i9.TuiActiveZoneModule,
1501
+ i10.TuiGroupModule,
1502
+ i10.TuiSvgModule,
1899
1503
  i3.ScrollingModule,
1900
- i5.GoogleMapsModule,
1504
+ googleMaps.GoogleMapsModule,
1901
1505
  i3$1.HttpClientModule,
1902
1506
  i3$1.HttpClientJsonpModule
1903
1507
  ]] });
@@ -1913,7 +1517,7 @@
1913
1517
  CustomerDetailsComponent
1914
1518
  ],
1915
1519
  imports: [
1916
- i6.CommonModule,
1520
+ i5.CommonModule,
1917
1521
  i3$1.HttpClientModule,
1918
1522
  i5$1.FormsModule,
1919
1523
  i5$1.ReactiveFormsModule,
@@ -1924,16 +1528,16 @@
1924
1528
  i2.KwikUIInputSelectModule,
1925
1529
  i2.KwikUITableModule,
1926
1530
  i2.KwikUITablePaginationModule,
1927
- i8.KwikIDFormViewModule,
1928
- i11.TuiRootModule,
1929
- i11.TuiDialogModule,
1930
- i11.TuiDropdownModule,
1531
+ i7.KwikIDFormViewModule,
1532
+ i10.TuiRootModule,
1533
+ i10.TuiDialogModule,
1534
+ i10.TuiDropdownModule,
1931
1535
  addonMobile.TuiSidebarModule,
1932
- i10.TuiActiveZoneModule,
1933
- i11.TuiGroupModule,
1934
- i11.TuiSvgModule,
1536
+ i9.TuiActiveZoneModule,
1537
+ i10.TuiGroupModule,
1538
+ i10.TuiSvgModule,
1935
1539
  i3.ScrollingModule,
1936
- i5.GoogleMapsModule,
1540
+ googleMaps.GoogleMapsModule,
1937
1541
  i3$1.HttpClientModule,
1938
1542
  i3$1.HttpClientJsonpModule
1939
1543
  ],