@aggdirect/coolmap 2.9.8 → 2.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/esm2022/aggdirect-coolmap.mjs +5 -0
  2. package/esm2022/lib/component/add-route/add-route.component.mjs +433 -0
  3. package/esm2022/lib/component/job-code/job-code.component.mjs +181 -0
  4. package/esm2022/lib/component/map/map.component.mjs +39 -0
  5. package/esm2022/lib/component/nav/layout/add-route-nav/add-route-nav.component.mjs +151 -0
  6. package/esm2022/lib/component/nav/layout/job-code-nav/job-code-nav.component.mjs +156 -0
  7. package/esm2022/lib/component/nav/nav.component.mjs +54 -0
  8. package/esm2022/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.mjs +77 -0
  9. package/esm2022/lib/component/route-jobcode-list/route-jobcode-list.component.mjs +319 -0
  10. package/esm2022/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.mjs +19 -0
  11. package/esm2022/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.mjs +37 -0
  12. package/esm2022/lib/component/shared/dialog/dialog.component.mjs +31 -0
  13. package/esm2022/lib/component/shared/estimation-display/estimation-display.component.mjs +18 -0
  14. package/esm2022/lib/component/shared/job-route-list/job-route-list.component.mjs +79 -0
  15. package/esm2022/lib/component/shared/jobcode-overview/jobcode-overview.component.mjs +24 -0
  16. package/esm2022/lib/component/shared/jobcode-status/jobcode-status.component.mjs +15 -0
  17. package/esm2022/lib/component/shared/route-info-card/route-info-card.component.mjs +62 -0
  18. package/esm2022/lib/component/shared/searchoptiongroup/searchoptiongroup.component.mjs +25 -0
  19. package/esm2022/lib/coolmap.module.mjs +193 -0
  20. package/esm2022/public-api.mjs +19 -0
  21. package/fesm2022/aggdirect-coolmap.mjs +1784 -0
  22. package/fesm2022/aggdirect-coolmap.mjs.map +1 -0
  23. package/index.d.ts +5 -0
  24. package/lib/component/add-route/add-route.component.d.ts +73 -0
  25. package/lib/component/job-code/job-code.component.d.ts +41 -0
  26. package/lib/component/map/map.component.d.ts +15 -0
  27. package/lib/component/nav/layout/add-route-nav/add-route-nav.component.d.ts +49 -0
  28. package/lib/component/nav/layout/job-code-nav/job-code-nav.component.d.ts +42 -0
  29. package/lib/component/nav/nav.component.d.ts +31 -0
  30. package/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.d.ts +20 -0
  31. package/lib/component/route-jobcode-list/route-jobcode-list.component.d.ts +42 -0
  32. package/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.d.ts +9 -0
  33. package/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.d.ts +12 -0
  34. package/lib/component/shared/dialog/dialog.component.d.ts +13 -0
  35. package/lib/component/shared/estimation-display/estimation-display.component.d.ts +8 -0
  36. package/lib/component/shared/job-route-list/job-route-list.component.d.ts +26 -0
  37. package/lib/component/shared/jobcode-overview/jobcode-overview.component.d.ts +10 -0
  38. package/lib/component/shared/jobcode-status/jobcode-status.component.d.ts +7 -0
  39. package/lib/component/shared/route-info-card/route-info-card.component.d.ts +32 -0
  40. package/lib/component/shared/searchoptiongroup/searchoptiongroup.component.d.ts +14 -0
  41. package/lib/coolmap.module.d.ts +46 -0
  42. package/package.json +22 -5
  43. package/{src/public-api.ts → public-api.d.ts} +0 -8
  44. package/karma.conf.js +0 -44
  45. package/ng-package.json +0 -7
  46. package/src/assets/mixin.scss +0 -28
  47. package/src/assets/palette.scss +0 -24
  48. package/src/assets/variable.scss +0 -15
  49. package/src/lib/component/add-route/add-route.component.html +0 -172
  50. package/src/lib/component/add-route/add-route.component.scss +0 -243
  51. package/src/lib/component/add-route/add-route.component.spec.ts +0 -23
  52. package/src/lib/component/add-route/add-route.component.ts +0 -394
  53. package/src/lib/component/job-code/job-code.component.html +0 -79
  54. package/src/lib/component/job-code/job-code.component.scss +0 -396
  55. package/src/lib/component/job-code/job-code.component.ts +0 -146
  56. package/src/lib/component/map/map.component.css +0 -0
  57. package/src/lib/component/map/map.component.html +0 -4
  58. package/src/lib/component/map/map.component.spec.ts +0 -23
  59. package/src/lib/component/map/map.component.ts +0 -34
  60. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.html +0 -46
  61. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.scss +0 -18
  62. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.spec.ts +0 -23
  63. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.ts +0 -130
  64. package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.html +0 -48
  65. package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.scss +0 -24
  66. package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.ts +0 -143
  67. package/src/lib/component/nav/nav.component.html +0 -19
  68. package/src/lib/component/nav/nav.component.scss +0 -67
  69. package/src/lib/component/nav/nav.component.ts +0 -38
  70. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.html +0 -56
  71. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.scss +0 -168
  72. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.spec.ts +0 -23
  73. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ts +0 -43
  74. package/src/lib/component/route-jobcode-list/route-jobcode-list.component.html +0 -73
  75. package/src/lib/component/route-jobcode-list/route-jobcode-list.component.scss +0 -227
  76. package/src/lib/component/route-jobcode-list/route-jobcode-list.component.ts +0 -233
  77. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.html +0 -7
  78. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.scss +0 -10
  79. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.spec.ts +0 -23
  80. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.ts +0 -15
  81. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.html +0 -28
  82. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.scss +0 -172
  83. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.spec.ts +0 -23
  84. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.ts +0 -20
  85. package/src/lib/component/shared/dialog/dialog.component.html +0 -7
  86. package/src/lib/component/shared/dialog/dialog.component.scss +0 -30
  87. package/src/lib/component/shared/dialog/dialog.component.ts +0 -18
  88. package/src/lib/component/shared/estimation-display/estimation-display.component.html +0 -7
  89. package/src/lib/component/shared/estimation-display/estimation-display.component.scss +0 -7
  90. package/src/lib/component/shared/estimation-display/estimation-display.component.ts +0 -13
  91. package/src/lib/component/shared/job-route-list/job-route-list.component.html +0 -46
  92. package/src/lib/component/shared/job-route-list/job-route-list.component.scss +0 -15
  93. package/src/lib/component/shared/job-route-list/job-route-list.component.spec.ts +0 -23
  94. package/src/lib/component/shared/job-route-list/job-route-list.component.ts +0 -54
  95. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.html +0 -11
  96. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.scss +0 -13
  97. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.spec.ts +0 -23
  98. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.ts +0 -19
  99. package/src/lib/component/shared/jobcode-status/jobcode-status.component.html +0 -5
  100. package/src/lib/component/shared/jobcode-status/jobcode-status.component.scss +0 -40
  101. package/src/lib/component/shared/jobcode-status/jobcode-status.component.spec.ts +0 -23
  102. package/src/lib/component/shared/jobcode-status/jobcode-status.component.ts +0 -11
  103. package/src/lib/component/shared/route-info-card/route-info-card.component.html +0 -19
  104. package/src/lib/component/shared/route-info-card/route-info-card.component.scss +0 -50
  105. package/src/lib/component/shared/route-info-card/route-info-card.component.spec.ts +0 -23
  106. package/src/lib/component/shared/route-info-card/route-info-card.component.ts +0 -74
  107. package/src/lib/component/shared/searchoptiongroup/searchoptiongroup.component.css +0 -3
  108. package/src/lib/component/shared/searchoptiongroup/searchoptiongroup.component.html +0 -6
  109. package/src/lib/component/shared/searchoptiongroup/searchoptiongroup.component.spec.ts +0 -23
  110. package/src/lib/component/shared/searchoptiongroup/searchoptiongroup.component.ts +0 -21
  111. package/src/lib/coolmap.module.ts +0 -120
  112. package/src/test.ts +0 -27
  113. package/tsconfig.lib.json +0 -15
  114. package/tsconfig.lib.prod.json +0 -10
  115. package/tsconfig.spec.json +0 -17
@@ -0,0 +1,1784 @@
1
+ import * as i0 from '@angular/core';
2
+ import { ViewChild, Component, EventEmitter, Output, Input, Inject, inject, ChangeDetectorRef, NgModule } from '@angular/core';
3
+ import { Subject, takeUntil, startWith, map, fromEvent, distinctUntilChanged, debounceTime, pairwise, filter } from 'rxjs';
4
+ import * as i1 from '@aggdirect/coolmap-services';
5
+ import { DriversmsCardKey, DriverSmsCardEnum, JobCodeOverviewData, JobCodeOverviewEnum, EstinationData, EstinationEnum } from '@aggdirect/coolmap-services';
6
+ import * as i2 from '@angular/common';
7
+ import { CommonModule } from '@angular/common';
8
+ import * as i3 from '@angular/material/progress-bar';
9
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
10
+ import * as i3$1 from '@angular/material/tooltip';
11
+ import { MatTooltipModule } from '@angular/material/tooltip';
12
+ import * as i10 from '@angular/material/button';
13
+ import { MatButtonModule } from '@angular/material/button';
14
+ import { MatSidenavModule } from '@angular/material/sidenav';
15
+ import { MatSnackBarModule } from '@angular/material/snack-bar';
16
+ import * as i3$3 from '@angular/cdk/drag-drop';
17
+ import { DragDropModule } from '@angular/cdk/drag-drop';
18
+ import * as i3$2 from '@angular/forms';
19
+ import { FormControl, Validators, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
20
+ import * as i4 from '@angular/material/input';
21
+ import { MatInputModule } from '@angular/material/input';
22
+ import * as i8$2 from '@angular/material/select';
23
+ import { MatSelectModule } from '@angular/material/select';
24
+ import * as i7 from '@angular/material/icon';
25
+ import { MatIconModule } from '@angular/material/icon';
26
+ import * as i8$1 from '@angular/material/autocomplete';
27
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
28
+ import * as i5 from '@angular/material/form-field';
29
+ import { MatFormFieldModule } from '@angular/material/form-field';
30
+ import * as i7$1 from '@angular/material/progress-spinner';
31
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
32
+ import * as i9 from '@angular/material/chips';
33
+ import { MatChipsModule } from '@angular/material/chips';
34
+ import * as i1$1 from '@angular/material/dialog';
35
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
36
+ import * as i6 from '@angular/material/core';
37
+ import { MatNativeDateModule, MatPseudoCheckboxModule } from '@angular/material/core';
38
+ import { SelectionModel } from '@angular/cdk/collections';
39
+ import * as i8 from '@angular/cdk/scrolling';
40
+ import { ScrollingModule } from '@angular/cdk/scrolling';
41
+ import * as i10$1 from '@angular/material/datepicker';
42
+ import { MatDatepickerModule } from '@angular/material/datepicker';
43
+ import * as i2$1 from '@angular/material/radio';
44
+ import { MatRadioModule } from '@angular/material/radio';
45
+
46
+ class MapComponent {
47
+ coolmapService;
48
+ mapDiv;
49
+ enableProgress = true;
50
+ destroyer$ = new Subject();
51
+ constructor(coolmapService) {
52
+ this.coolmapService = coolmapService;
53
+ }
54
+ ngAfterViewInit() {
55
+ this.coolmapService.reintiatecoolmap.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
56
+ this.enableProgress = true;
57
+ if (res) {
58
+ this.coolmapService.initiateMapForAddRoute(this.mapDiv.nativeElement).then((res) => {
59
+ this.enableProgress = false;
60
+ });
61
+ }
62
+ });
63
+ }
64
+ ngOnDestroy() {
65
+ this.destroyer$.next(true);
66
+ this.destroyer$.unsubscribe();
67
+ }
68
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MapComponent, deps: [{ token: i1.CoolmapService }], target: i0.ɵɵFactoryTarget.Component });
69
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MapComponent, selector: "app-map", viewQueries: [{ propertyName: "mapDiv", first: true, predicate: ["map"], descendants: true, static: true }], ngImport: i0, template: "<div>\n <mat-progress-bar *ngIf=\"enableProgress\" mode=\"indeterminate\"></mat-progress-bar>\n <div #map class=\"coolmap\" style=\"height: 100vh;\"></div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
70
+ }
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MapComponent, decorators: [{
72
+ type: Component,
73
+ args: [{ selector: 'app-map', template: "<div>\n <mat-progress-bar *ngIf=\"enableProgress\" mode=\"indeterminate\"></mat-progress-bar>\n <div #map class=\"coolmap\" style=\"height: 100vh;\"></div>\n</div>\n" }]
74
+ }], ctorParameters: () => [{ type: i1.CoolmapService }], propDecorators: { mapDiv: [{
75
+ type: ViewChild,
76
+ args: ['map', { static: true }]
77
+ }] } });
78
+
79
+ class NavComponent {
80
+ utils;
81
+ coolMap;
82
+ drawer = new EventEmitter();
83
+ changeNav = new EventEmitter();
84
+ navValue = 'Jobcode';
85
+ isnavChange = true;
86
+ paddinForJobCode = { top: 0, bottom: 250, left: 500, right: 400 };
87
+ paddinForViewRoute = { top: 0, bottom: 400, left: 400, right: 0 };
88
+ destroyer$ = new Subject();
89
+ constructor(utils, coolMap) {
90
+ this.utils = utils;
91
+ this.coolMap = coolMap;
92
+ this.utils.navChangeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => { this.isnavChange = res; });
93
+ this.coolMap.setPadding(this.paddinForJobCode);
94
+ }
95
+ openDrawer() { this.drawer.emit(true); }
96
+ chnageNav(name) {
97
+ if (this.isnavChange) {
98
+ this.changeNav.emit(name);
99
+ this.navValue = name;
100
+ this.coolMap.clearBound();
101
+ if (name === 'Addroute') {
102
+ this.coolMap.setPadding(this.paddinForViewRoute);
103
+ }
104
+ else {
105
+ this.coolMap.setPadding(this.paddinForJobCode);
106
+ }
107
+ this.utils.clearOptions();
108
+ }
109
+ }
110
+ ngOnDestroy() {
111
+ this.destroyer$.next(true);
112
+ this.destroyer$.unsubscribe();
113
+ }
114
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NavComponent, deps: [{ token: i1.UtilsService }, { token: i1.CoolmapService }], target: i0.ɵɵFactoryTarget.Component });
115
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: NavComponent, selector: "app-nav", outputs: { drawer: "drawer", changeNav: "changeNav" }, ngImport: i0, template: "<div class=\"nav\">\n <button (click)=\"openDrawer()\" class=\"toggle\">\n <img src=\"assets/images/toggle.svg\" alt=\"\" />\n </button>\n\n <ul class=\"m-100\">\n <li [ngClass]=\"{'active': navValue === 'Jobcode'}\">\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Job Code\" aria-label=\"Job-code\" (click)=\"chnageNav('Jobcode')\">\n <img src=\"assets/images/job-code.svg\" alt=\"\" />\n </a>\n </li>\n\n <li [ngClass]=\"{'active': navValue === 'Addroute', 'disabled': !isnavChange }\">\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"View Route\" aria-label=\"View-route\" (click)=\"chnageNav('Addroute')\">\n <img src=\"assets/images/route.svg\" alt=\"\" />\n </a>\n </li>\n </ul>\n</div>\n", styles: [".nav{background:#e8e8e8;height:100vh;padding:15px 0;display:flex;align-items:center;flex-direction:column}.nav button{background:#fff;border-radius:15px;padding:5px 6px}.nav button img{width:28px}.nav ul{display:flex;flex-direction:column;align-items:center}.nav ul li{margin:10px 0;padding:0 5px;border-right:2px solid #e8e8e8}.nav ul li:hover{border-right:2px solid #326ad3;padding:0 5px}.nav ul li.disabled a{pointer-events:none;opacity:.5}.nav ul li.disabled:hover{border-right:2px solid #e8e8e8}.nav ul li a{padding:0!important;display:flex;border-radius:15px;min-width:42px;box-shadow:none;align-items:center;height:42px;line-height:10px}.nav ul li a img{width:27px}.nav ul li a:hover{background:#fff}.nav ul li a:hover img{filter:invert(.2) sepia(1) saturate(8) hue-rotate(180deg)}.nav ul li.active{border-right:2px solid #326ad3}.nav ul li.active a{background:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i10.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", exportAs: ["matButton", "matAnchor"] }] });
116
+ }
117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NavComponent, decorators: [{
118
+ type: Component,
119
+ args: [{ selector: 'app-nav', template: "<div class=\"nav\">\n <button (click)=\"openDrawer()\" class=\"toggle\">\n <img src=\"assets/images/toggle.svg\" alt=\"\" />\n </button>\n\n <ul class=\"m-100\">\n <li [ngClass]=\"{'active': navValue === 'Jobcode'}\">\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Job Code\" aria-label=\"Job-code\" (click)=\"chnageNav('Jobcode')\">\n <img src=\"assets/images/job-code.svg\" alt=\"\" />\n </a>\n </li>\n\n <li [ngClass]=\"{'active': navValue === 'Addroute', 'disabled': !isnavChange }\">\n <a mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"View Route\" aria-label=\"View-route\" (click)=\"chnageNav('Addroute')\">\n <img src=\"assets/images/route.svg\" alt=\"\" />\n </a>\n </li>\n </ul>\n</div>\n", styles: [".nav{background:#e8e8e8;height:100vh;padding:15px 0;display:flex;align-items:center;flex-direction:column}.nav button{background:#fff;border-radius:15px;padding:5px 6px}.nav button img{width:28px}.nav ul{display:flex;flex-direction:column;align-items:center}.nav ul li{margin:10px 0;padding:0 5px;border-right:2px solid #e8e8e8}.nav ul li:hover{border-right:2px solid #326ad3;padding:0 5px}.nav ul li.disabled a{pointer-events:none;opacity:.5}.nav ul li.disabled:hover{border-right:2px solid #e8e8e8}.nav ul li a{padding:0!important;display:flex;border-radius:15px;min-width:42px;box-shadow:none;align-items:center;height:42px;line-height:10px}.nav ul li a img{width:27px}.nav ul li a:hover{background:#fff}.nav ul li a:hover img{filter:invert(.2) sepia(1) saturate(8) hue-rotate(180deg)}.nav ul li.active{border-right:2px solid #326ad3}.nav ul li.active a{background:#fff}\n"] }]
120
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapService }], propDecorators: { drawer: [{
121
+ type: Output
122
+ }], changeNav: [{
123
+ type: Output
124
+ }] } });
125
+
126
+ class ViewRouteListCardComponent {
127
+ utils;
128
+ config;
129
+ route;
130
+ emitrouteevent;
131
+ constructor(utils, config) {
132
+ this.utils = utils;
133
+ this.config = config;
134
+ }
135
+ detailsDict(event, route) {
136
+ if (event === 'click')
137
+ this.utils.setdictValue('route-detailsv2', JSON.stringify(route));
138
+ route['type'] = 'editroute';
139
+ route['prevent'] = true;
140
+ this.emitrouteevent.emit(route);
141
+ this.utils.routeDetailsUtility.next({ event, route });
142
+ }
143
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ViewRouteListCardComponent, deps: [{ token: i1.UtilsService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
144
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ViewRouteListCardComponent, selector: "app-view-route-list-card", inputs: { route: "route", emitrouteevent: "emitrouteevent" }, ngImport: i0, template: "<div class=\"routebox\">\n <span>\n <mat-icon>directions</mat-icon>\n <h2 [ngClass]=\"{'routeheading': route['route_name']}\">\n {{route['route_name']}}\n </h2>\n </span>\n <h3><ng-container *ngIf=\"config?.repository === 'coolmap'\">{{route['customer_name']}}</ng-container></h3>\n\n <div class=\"pickdropprt\">\n <div class=\"pickprt\">\n <b>\n <h4>{{route['pickup_location']?.split('|')[1] ? route['pickup_location'].split('|')[1] : route['pickup_location']}}</h4>\n </b>\n </div>\n <div class=\"dropprt\">\n <b>\n <h4>{{route['delivery_location']?.split('|')[1] ? route['delivery_location'].split('|')[1] : route['delivery_location']}}</h4>\n </b>\n </div>\n </div>\n <div class=\"infoicon\" (click)=\"detailsDict('click', route)\" (mouseover)=\"detailsDict(true, route)\"\n (mouseleave)=\"detailsDict(false, route)\">\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"status routestatus\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\n</div>\n\n", styles: [".routebox span{display:flex;align-items:center}.routebox span h2{margin-left:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;margin-bottom:5px;margin-top:5px;font-size:.95rem}.routebox h3{font-size:.85rem;color:#767676;font-weight:400;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:325px;margin-bottom:10px}.routebox .pickdropprt{font-size:.8125rem}.routebox .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:6px}.routebox .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .pickprt b{position:relative;font-weight:400}.routebox .pickdropprt .pickprt b:after{background:#000;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.routebox .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden}@media (min-width: 1600px){.routebox .pickdropprt .pickprt h4{max-width:265px}}.routebox .pickdropprt .pickprt h4:before{background:green;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.routebox .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .dropprt b{position:relative;font-weight:400}.routebox .pickdropprt .dropprt b:after{background:#000;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.routebox .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden}.routebox .pickdropprt .dropprt h4:before{background:red;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .infoicon{position:absolute;right:10px;top:11px}.routebox .infoicon img{width:20px;height:20px}.routebox .status{position:absolute;border-radius:30px;top:12px;right:40px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;padding:3px 10px}.routebox .status.routestatus{right:36px;width:20px;height:20px;text-align:center;line-height:20px;padding:0 0 0 1px}.routebox .status.routestatus:first-letter{font-size:.8rem}@media (min-width: 1600px){.routebox .status.routestatus{padding:0;line-height:22px}}.routebox .status.Ton{background:#ff7272}.routebox .status.Load{background:#a3c52e}.routebox .status.Hourly{background:#ae23d1}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
145
+ }
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ViewRouteListCardComponent, decorators: [{
147
+ type: Component,
148
+ args: [{ selector: 'app-view-route-list-card', template: "<div class=\"routebox\">\n <span>\n <mat-icon>directions</mat-icon>\n <h2 [ngClass]=\"{'routeheading': route['route_name']}\">\n {{route['route_name']}}\n </h2>\n </span>\n <h3><ng-container *ngIf=\"config?.repository === 'coolmap'\">{{route['customer_name']}}</ng-container></h3>\n\n <div class=\"pickdropprt\">\n <div class=\"pickprt\">\n <b>\n <h4>{{route['pickup_location']?.split('|')[1] ? route['pickup_location'].split('|')[1] : route['pickup_location']}}</h4>\n </b>\n </div>\n <div class=\"dropprt\">\n <b>\n <h4>{{route['delivery_location']?.split('|')[1] ? route['delivery_location'].split('|')[1] : route['delivery_location']}}</h4>\n </b>\n </div>\n </div>\n <div class=\"infoicon\" (click)=\"detailsDict('click', route)\" (mouseover)=\"detailsDict(true, route)\"\n (mouseleave)=\"detailsDict(false, route)\">\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"status routestatus\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\n</div>\n\n", styles: [".routebox span{display:flex;align-items:center}.routebox span h2{margin-left:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;margin-bottom:5px;margin-top:5px;font-size:.95rem}.routebox h3{font-size:.85rem;color:#767676;font-weight:400;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:325px;margin-bottom:10px}.routebox .pickdropprt{font-size:.8125rem}.routebox .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:6px}.routebox .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .pickprt b{position:relative;font-weight:400}.routebox .pickdropprt .pickprt b:after{background:#000;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.routebox .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden}@media (min-width: 1600px){.routebox .pickdropprt .pickprt h4{max-width:265px}}.routebox .pickdropprt .pickprt h4:before{background:green;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.routebox .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.routebox .pickdropprt .dropprt b{position:relative;font-weight:400}.routebox .pickdropprt .dropprt b:after{background:#000;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.routebox .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;font-weight:400;overflow:hidden}.routebox .pickdropprt .dropprt h4:before{background:red;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.routebox .infoicon{position:absolute;right:10px;top:11px}.routebox .infoicon img{width:20px;height:20px}.routebox .status{position:absolute;border-radius:30px;top:12px;right:40px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;padding:3px 10px}.routebox .status.routestatus{right:36px;width:20px;height:20px;text-align:center;line-height:20px;padding:0 0 0 1px}.routebox .status.routestatus:first-letter{font-size:.8rem}@media (min-width: 1600px){.routebox .status.routestatus{padding:0;line-height:22px}}.routebox .status.Ton{background:#ff7272}.routebox .status.Load{background:#a3c52e}.routebox .status.Hourly{background:#ae23d1}\n"] }]
149
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapConfigModel, decorators: [{
150
+ type: Inject,
151
+ args: ['memberData']
152
+ }] }], propDecorators: { route: [{
153
+ type: Input
154
+ }], emitrouteevent: [{
155
+ type: Input
156
+ }] } });
157
+
158
+ class SmsCardDetailsOverviewComponent {
159
+ jobValue;
160
+ label = DriversmsCardKey;
161
+ overViewEnum = DriverSmsCardEnum;
162
+ constructor() { }
163
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SmsCardDetailsOverviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
164
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SmsCardDetailsOverviewComponent, selector: "app-sms-card-details-overview", inputs: { jobValue: "jobValue" }, ngImport: i0, template: "<ng-container *ngFor=\"let item of label\">\n <span>\n <label>{{overViewEnum[item]}}</label>\n <ng-container *ngIf=\"item !== 'values'\">{{jobValue[item] ? jobValue[item] : 'N/A'}}</ng-container>\n <ng-container *ngIf=\"item === 'values'\">{{jobValue[item]['Done'] + jobValue[item]['Ongoing'] + jobValue[item]['Open']}}</ng-container>\n </span>\n</ng-container>\n", styles: ["span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}span label{font-weight:600;width:37%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
165
+ }
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SmsCardDetailsOverviewComponent, decorators: [{
167
+ type: Component,
168
+ args: [{ selector: 'app-sms-card-details-overview', template: "<ng-container *ngFor=\"let item of label\">\n <span>\n <label>{{overViewEnum[item]}}</label>\n <ng-container *ngIf=\"item !== 'values'\">{{jobValue[item] ? jobValue[item] : 'N/A'}}</ng-container>\n <ng-container *ngIf=\"item === 'values'\">{{jobValue[item]['Done'] + jobValue[item]['Ongoing'] + jobValue[item]['Open']}}</ng-container>\n </span>\n</ng-container>\n", styles: ["span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}span label{font-weight:600;width:37%}\n"] }]
169
+ }], ctorParameters: () => [], propDecorators: { jobValue: [{
170
+ type: Input
171
+ }] } });
172
+
173
+ class JobCodeListCardComponent {
174
+ utils;
175
+ config;
176
+ route;
177
+ routeSeletion = new EventEmitter();
178
+ toggleDrivermenu = new EventEmitter();
179
+ emitJobdetails;
180
+ preventCloseDetails;
181
+ constructor(utils, config) {
182
+ this.utils = utils;
183
+ this.config = config;
184
+ }
185
+ selectRoute(route) { this.routeSeletion.emit(route); }
186
+ toggleDriverlist(mouseevntType, route, isHoverOut) {
187
+ const data = { mouseevntType, route, isHoverOut };
188
+ this.toggleDrivermenu.emit(data);
189
+ if (mouseevntType === 'click')
190
+ this.utils.setdictValue('driver-details', JSON.stringify(this.route));
191
+ }
192
+ toggleJobCodeDetails(mouseEventType, route) {
193
+ if (mouseEventType) {
194
+ route['type'] = 'jobcode';
195
+ this.emitJobdetails.emitroute.emit(route);
196
+ }
197
+ else if (!mouseEventType && this.preventCloseDetails) {
198
+ route = this.utils.getdictValue('route-details');
199
+ route['type'] = 'jobcode';
200
+ this.emitJobdetails.emitroute.emit(route);
201
+ }
202
+ else if (!mouseEventType && !this.preventCloseDetails)
203
+ this.emitJobdetails.clearJobDetailsFromList.emit(true);
204
+ }
205
+ calculateStatusPercentage(type, route) {
206
+ const total = route['Done'] + route['Ongoing'] + route['Open'];
207
+ if (type === 'done') {
208
+ return Math.round((100 * route['Done']) / total);
209
+ }
210
+ else if (type === 'ongoing') {
211
+ return Math.round((100 * route['Ongoing']) / total);
212
+ }
213
+ else if (type === 'open') {
214
+ return Math.round((100 * route['Open']) / total);
215
+ }
216
+ else {
217
+ return null;
218
+ }
219
+ }
220
+ setRouteItem() {
221
+ this.utils.preVentJobdetailclose.next(true);
222
+ this.utils.setdictValue('route-details', JSON.stringify(this.route));
223
+ }
224
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobCodeListCardComponent, deps: [{ token: i1.UtilsService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
225
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: JobCodeListCardComponent, selector: "app-job-code-list-card", inputs: { route: "route", emitJobdetails: "emitJobdetails", preventCloseDetails: "preventCloseDetails" }, outputs: { routeSeletion: "routeSeletion", toggleDrivermenu: "toggleDrivermenu" }, ngImport: i0, template: "<div class=\"innerbox\">\n <div class=\"inputarea\">\n <input type=\"checkbox\" name=\"selectroute\" [checked]=\"route['isSelected']\" (change)=\"$event ? selectRoute(route) : null\" />\n <label>&nbsp;</label>\n <div class=\"border\"></div>\n </div>\n <div class=\"job_intro\">\n <div class=\"heading\">\n <h2>\n {{route['order_number'] ? route['order_number'] : ''}}\n </h2>\n |\n <span>\n {{route['customer_name']}}\n </span>\n |\n <span>\n {{route['project']}}\n </span>\n </div>\n <div class=\"destinationprt\">\n <span style=\"padding-left: 0;\">\n {{route['pickup_location']}}\n </span>\n <b>></b>\n <span>\n {{route['delivery_location']}}\n </span>\n </div>\n <div class=\"mat_cat\">\n <span>\n {{route['material']}}\n </span>\n </div>\n\n <div class=\"statusbar\">\n <div class=\"status_percent\">\n <span class=\"done\" [style]=\"'width:'+calculateStatusPercentage('done',route['values'])+'%'\"></span>\n <span class=\"ongoing\" [style]=\"'width:'+calculateStatusPercentage('ongoing', route['values'])+'%'\"> </span>\n <span class=\"open\" [style]=\"'width:'+calculateStatusPercentage('open', route['values'])+'%'\"> </span>\n </div>\n </div>\n </div>\n <div class=\"statusarea\">\n <div class=\"statusunit\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\n <div class=\"driver_icon\" *ngIf=\"config.repository !== 'customer'\" (mouseover)=\"toggleDriverlist(true, route)\" (mouseout)=\"toggleDriverlist(false, route, true)\"\n mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Click on icon to show the driver list\" matTooltipPosition=\"above\"\n (click)=\"toggleDriverlist('click', route)\">\n <img src=\"assets/images/driver_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"infoicon\" (click)=\"setRouteItem()\" (mouseover)=\"toggleJobCodeDetails(true, route)\"\n (mouseout)=\"toggleJobCodeDetails(false, route)\">\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n </div>\n</div>\n", styles: [".innerbox{display:flex;justify-content:space-between}.innerbox .inputarea{display:flex;align-items:center}.innerbox .inputarea input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.innerbox .inputarea label{width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.innerbox .inputarea .border{position:absolute;width:100%;height:100%;left:0;right:0;top:-1px;border-radius:15px}.innerbox .inputarea input:checked~.border{border-left:3px solid #39c471;border-right:1px solid #39c471;border-top:1px solid #39c471;border-bottom:1px solid #39c471}.innerbox .inputarea h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:214px;padding-left:16px;margin-bottom:5px;margin-top:0}.innerbox .job_intro{width:90%}.innerbox .job_intro .heading{display:flex;font-size:.8rem}.innerbox .job_intro .heading h2{margin:0 4px 0 0;font-size:.8rem}.innerbox .job_intro .heading span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100px;padding:0 3px;display:block}.innerbox .job_intro .destinationprt{display:flex;margin-top:10px;font-size:.8rem}.innerbox .job_intro .destinationprt span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:132px;padding:0 5px;display:block}.innerbox .job_intro .mat_cat{margin-top:10px;font-size:.8rem}.innerbox .job_intro .statusbar{width:100%;position:relative;height:5px;margin-top:10px}.innerbox .job_intro .statusbar .status_percent{position:absolute;left:0;display:flex;width:100%;height:100%}.innerbox .job_intro .statusbar .status_percent span{display:block}.innerbox .job_intro .statusbar .status_percent .done{background:green}.innerbox .job_intro .statusbar .status_percent .ongoing{background:#fc0}.innerbox .job_intro .statusbar .status_percent .open{background:#bfbfbf}.innerbox .statusarea{display:flex;flex-direction:column;align-items:center;width:10%}.innerbox .statusarea .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px}.innerbox .statusarea .statusunit:first-letter{font-size:.8rem}.innerbox .statusarea .statusunit.routestatus{right:10px}.innerbox .statusarea .statusunit.Ton{background:#39c471}.innerbox .statusarea .statusunit.Load{background:#326ad3}.innerbox .statusarea .statusunit.Hourly{background:#ffad56}.innerbox .statusarea .driver_icon,.innerbox .statusarea .infoicon{z-index:9999}.innerbox .statusarea .driver_icon img,.innerbox .statusarea .infoicon img{width:20px;height:20px}.innerbox .statusarea .driver_icon{margin:5px 0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
226
+ }
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobCodeListCardComponent, decorators: [{
228
+ type: Component,
229
+ args: [{ selector: 'app-job-code-list-card', template: "<div class=\"innerbox\">\n <div class=\"inputarea\">\n <input type=\"checkbox\" name=\"selectroute\" [checked]=\"route['isSelected']\" (change)=\"$event ? selectRoute(route) : null\" />\n <label>&nbsp;</label>\n <div class=\"border\"></div>\n </div>\n <div class=\"job_intro\">\n <div class=\"heading\">\n <h2>\n {{route['order_number'] ? route['order_number'] : ''}}\n </h2>\n |\n <span>\n {{route['customer_name']}}\n </span>\n |\n <span>\n {{route['project']}}\n </span>\n </div>\n <div class=\"destinationprt\">\n <span style=\"padding-left: 0;\">\n {{route['pickup_location']}}\n </span>\n <b>></b>\n <span>\n {{route['delivery_location']}}\n </span>\n </div>\n <div class=\"mat_cat\">\n <span>\n {{route['material']}}\n </span>\n </div>\n\n <div class=\"statusbar\">\n <div class=\"status_percent\">\n <span class=\"done\" [style]=\"'width:'+calculateStatusPercentage('done',route['values'])+'%'\"></span>\n <span class=\"ongoing\" [style]=\"'width:'+calculateStatusPercentage('ongoing', route['values'])+'%'\"> </span>\n <span class=\"open\" [style]=\"'width:'+calculateStatusPercentage('open', route['values'])+'%'\"> </span>\n </div>\n </div>\n </div>\n <div class=\"statusarea\">\n <div class=\"statusunit\" [ngClass]=\"route['unit']\">{{route['unit']}}</div>\n <div class=\"driver_icon\" *ngIf=\"config.repository !== 'customer'\" (mouseover)=\"toggleDriverlist(true, route)\" (mouseout)=\"toggleDriverlist(false, route, true)\"\n mat-raised-button #tooltip=\"matTooltip\" matTooltip=\"Click on icon to show the driver list\" matTooltipPosition=\"above\"\n (click)=\"toggleDriverlist('click', route)\">\n <img src=\"assets/images/driver_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"infoicon\" (click)=\"setRouteItem()\" (mouseover)=\"toggleJobCodeDetails(true, route)\"\n (mouseout)=\"toggleJobCodeDetails(false, route)\">\n <img src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n </div>\n</div>\n", styles: [".innerbox{display:flex;justify-content:space-between}.innerbox .inputarea{display:flex;align-items:center}.innerbox .inputarea input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.innerbox .inputarea label{width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.innerbox .inputarea .border{position:absolute;width:100%;height:100%;left:0;right:0;top:-1px;border-radius:15px}.innerbox .inputarea input:checked~.border{border-left:3px solid #39c471;border-right:1px solid #39c471;border-top:1px solid #39c471;border-bottom:1px solid #39c471}.innerbox .inputarea h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:214px;padding-left:16px;margin-bottom:5px;margin-top:0}.innerbox .job_intro{width:90%}.innerbox .job_intro .heading{display:flex;font-size:.8rem}.innerbox .job_intro .heading h2{margin:0 4px 0 0;font-size:.8rem}.innerbox .job_intro .heading span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100px;padding:0 3px;display:block}.innerbox .job_intro .destinationprt{display:flex;margin-top:10px;font-size:.8rem}.innerbox .job_intro .destinationprt span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:132px;padding:0 5px;display:block}.innerbox .job_intro .mat_cat{margin-top:10px;font-size:.8rem}.innerbox .job_intro .statusbar{width:100%;position:relative;height:5px;margin-top:10px}.innerbox .job_intro .statusbar .status_percent{position:absolute;left:0;display:flex;width:100%;height:100%}.innerbox .job_intro .statusbar .status_percent span{display:block}.innerbox .job_intro .statusbar .status_percent .done{background:green}.innerbox .job_intro .statusbar .status_percent .ongoing{background:#fc0}.innerbox .job_intro .statusbar .status_percent .open{background:#bfbfbf}.innerbox .statusarea{display:flex;flex-direction:column;align-items:center;width:10%}.innerbox .statusarea .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px}.innerbox .statusarea .statusunit:first-letter{font-size:.8rem}.innerbox .statusarea .statusunit.routestatus{right:10px}.innerbox .statusarea .statusunit.Ton{background:#39c471}.innerbox .statusarea .statusunit.Load{background:#326ad3}.innerbox .statusarea .statusunit.Hourly{background:#ffad56}.innerbox .statusarea .driver_icon,.innerbox .statusarea .infoicon{z-index:9999}.innerbox .statusarea .driver_icon img,.innerbox .statusarea .infoicon img{width:20px;height:20px}.innerbox .statusarea .driver_icon{margin:5px 0}\n"] }]
230
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapConfigModel, decorators: [{
231
+ type: Inject,
232
+ args: ['memberData']
233
+ }] }], propDecorators: { route: [{
234
+ type: Input
235
+ }], routeSeletion: [{
236
+ type: Output
237
+ }], toggleDrivermenu: [{
238
+ type: Output
239
+ }], emitJobdetails: [{
240
+ type: Input
241
+ }], preventCloseDetails: [{
242
+ type: Input
243
+ }] } });
244
+
245
+ class RouteJobCodeListComponent {
246
+ coolMap;
247
+ utils;
248
+ loader = true;
249
+ type = '';
250
+ data = [];
251
+ currentNav = '';
252
+ emitroute = new EventEmitter();
253
+ showAllRoute = new EventEmitter();
254
+ preventMouseout = false;
255
+ filterList = this.data;
256
+ searchTerm;
257
+ isDriverList = false;
258
+ selectedRoute = new SelectionModel(true, []);
259
+ driverList;
260
+ preventListSelect = false;
261
+ clearJobDetailsFromList = new EventEmitter();
262
+ preventDetailsClose = false;
263
+ messageLoader = false;
264
+ driverMessage = new FormControl('', [Validators.maxLength(256)]);
265
+ clearListSeletion;
266
+ isSmsList = false;
267
+ constructor(coolMap, utils) {
268
+ this.coolMap = coolMap;
269
+ this.utils = utils;
270
+ this.driverList = [];
271
+ }
272
+ ngOnInit() {
273
+ this.utils.getpreVentJobdetailclose.subscribe(res => { this.preventDetailsClose = res; });
274
+ this.utils.removeMapEntityUtility.subscribe((res) => { this.passRoute(res); });
275
+ }
276
+ passRoute(job) {
277
+ this.data.forEach((each) => { if (each['route_id'] !== job['route_id']) {
278
+ each['isActive'] = false;
279
+ }
280
+ else {
281
+ each['isActive'] = true;
282
+ } });
283
+ if (this.type == 'addroute')
284
+ this.filterList.forEach(ele => this.coolMap.filterRoute(ele['route_id'], 'none'));
285
+ }
286
+ selectRoute(route) {
287
+ if (!this.preventListSelect) {
288
+ this.preventListSelect = true;
289
+ this.selectedRoute.toggle(route);
290
+ this.clearJobDetailsFromList.emit(true);
291
+ this.utils.preVentJobdetailclose.next(false);
292
+ this.filterList.forEach(ele => this.coolMap.filterRoute(ele['job_id'], 'none'));
293
+ this.clearList();
294
+ this.selectedRoute.selected.forEach((ele, index) => {
295
+ this.coolMap.filterRoute(ele['job_id'], 'visible', ((this.selectedRoute.selected.length - 1) === index)).then(() => {
296
+ this.preventListSelect = false;
297
+ });
298
+ });
299
+ if (!this.selectedRoute.selected.length) {
300
+ this.preventListSelect = false;
301
+ this.data.forEach(ele => this.coolMap.filterRoute(ele['job_id'], 'visible'));
302
+ }
303
+ ;
304
+ }
305
+ }
306
+ checkroutes(route) {
307
+ const selectedRoute = this.selectedRoute.selected;
308
+ this.filterList = this.filterList.map(ele => { ele['isSelected'] = false; return ele; });
309
+ if (selectedRoute.length > 0) {
310
+ selectedRoute.forEach(ele => {
311
+ if (route['order_number'] === ele['order_number']) {
312
+ ele['isSelected'] = true;
313
+ }
314
+ });
315
+ }
316
+ return route;
317
+ }
318
+ ngOnChanges(changes) {
319
+ setTimeout(() => {
320
+ if (this.currentNav === 'Addroute' && (this.data.length < this.filterList.length)) {
321
+ const index = this.filterList.findIndex(ele => ele.isActive);
322
+ if (index > 0)
323
+ this.filterList[index].isActive = false;
324
+ this.data.forEach((ele, indexForData) => {
325
+ const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
326
+ this.coolMap.plotRoute(ele, id, this.type, false, (indexForData === (this.data.length - 1))).then((res) => {
327
+ });
328
+ });
329
+ }
330
+ }, 500);
331
+ if (changes['data'] && changes['data']['currentValue']) {
332
+ this.filterList = changes['data']['currentValue'];
333
+ if (this.searchTerm) {
334
+ if (this.searchTerm.length > 0) {
335
+ this.data = this.utils.getSearchResults(changes['data']['currentValue'], this.searchTerm);
336
+ this.filterList = this.data;
337
+ }
338
+ else {
339
+ this.filterList = changes['data']['currentValue'];
340
+ }
341
+ }
342
+ if (this.type === 'jobcode') {
343
+ this.loader = true;
344
+ this.clearList();
345
+ if (this.filterList.length === 0)
346
+ this.loader = false;
347
+ }
348
+ if (this.type !== 'jobcode') {
349
+ if (changes['data']['previousValue'] && this.currentNav === 'addForm') {
350
+ const activeRoute = changes['data']['previousValue'].find((ele) => ele.isActive);
351
+ if (activeRoute) {
352
+ this.filterList.map((item) => {
353
+ if (item.route_id === activeRoute.route_id) {
354
+ item.isActive = true;
355
+ }
356
+ });
357
+ }
358
+ }
359
+ }
360
+ if (changes['data']['previousValue'] && this.currentNav !== 'addForm') {
361
+ this.coolMap.removeJobFromMap(changes['data']['previousValue']);
362
+ this.selectedRoute.clear();
363
+ }
364
+ ;
365
+ if (this.currentNav !== 'addForm') {
366
+ changes['data']['currentValue'].forEach((ele, indexForData) => {
367
+ const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
368
+ this.coolMap.plotRoute(ele, id, this.type, false, (indexForData === (this.data.length - 1))).then((res) => {
369
+ if (indexForData === (this.data.length - 1)) {
370
+ this.loader = false;
371
+ this.utils.preventnavChange.next(true);
372
+ }
373
+ });
374
+ });
375
+ }
376
+ }
377
+ if (changes['searchTerm']) {
378
+ if (this.filterList) {
379
+ this.data = this.filterList;
380
+ this.clearList();
381
+ if (changes['searchTerm']['currentValue'].length > 0) {
382
+ this.coolMap.removeRouteAndMarker(1);
383
+ this.data = this.utils.getSearchResults(this.data, changes['searchTerm']['currentValue']);
384
+ }
385
+ else {
386
+ this.data = this.filterList;
387
+ }
388
+ setTimeout(() => {
389
+ this.coolMap.clearBoundWithCordinates();
390
+ if (this.currentNav !== 'addForm' && !this.selectedRoute['selected'].length) {
391
+ this.coolMap.removeRouteAndMarker(1);
392
+ this.toggleFilterRoute(this.filterList);
393
+ }
394
+ }, 500);
395
+ if (this.currentNav !== 'addForm' && this.selectedRoute['selected'].length) {
396
+ if (this.data && this.data.length > 0) {
397
+ this.clearList();
398
+ this.clearJobDetailsFromList.emit(true);
399
+ this.coolMap.removeJobFromMap(this.selectedRoute.selected);
400
+ setTimeout(() => {
401
+ this.data.forEach((ele, indexForData) => {
402
+ this.coolMap.plotRoute(ele, ele['job_id'], this.type, false, (indexForData === (this.data.length - 1))).then(() => {
403
+ if (indexForData === (this.data.length - 1)) {
404
+ this.loader = false;
405
+ this.utils.preventnavChange.next(true);
406
+ }
407
+ if (this.selectedRoute['selected'].length && this.selectedRoute['selected'][0]['job_id'] === ele['job_id']) {
408
+ this.selectedRoute.clear();
409
+ }
410
+ });
411
+ });
412
+ }, 500);
413
+ }
414
+ }
415
+ }
416
+ }
417
+ }
418
+ showRoute() {
419
+ this.utils.preventnavChange.next(false);
420
+ this.loader = true;
421
+ this.clearList();
422
+ this.showAllRoute.emit(true);
423
+ if (this.filterList && this.filterList.length > 0) {
424
+ this.coolMap.removeJobFromMap(this.selectedRoute.selected);
425
+ setTimeout(() => {
426
+ this.filterList.forEach((ele, indexForData) => {
427
+ this.coolMap.plotRoute(ele, ele['job_id'], this.type, false, (indexForData === this.filterList.length - 1)).then(() => {
428
+ if (indexForData === this.filterList.length - 1) {
429
+ this.loader = false;
430
+ this.utils.preventnavChange.next(true);
431
+ }
432
+ if (this.selectedRoute['selected'].length && this.selectedRoute['selected'][0]['job_id'] === ele['job_id']) {
433
+ this.selectedRoute.clear();
434
+ }
435
+ });
436
+ });
437
+ }, 500);
438
+ }
439
+ }
440
+ toggleDrivermenu(event) {
441
+ const mouseevntType = event.mouseevntType;
442
+ let route = event.route;
443
+ const isHoverOut = event.isHoverOut;
444
+ if (typeof (mouseevntType) === 'string') {
445
+ if (this.preventMouseout) {
446
+ this.isDriverList = !this.isDriverList;
447
+ }
448
+ ;
449
+ this.preventMouseout = true;
450
+ }
451
+ if (typeof (mouseevntType) === 'boolean' && !mouseevntType && !this.preventMouseout) {
452
+ this.isDriverList = mouseevntType;
453
+ }
454
+ ;
455
+ if (typeof (mouseevntType) === 'boolean' && mouseevntType && !this.preventMouseout) {
456
+ this.isDriverList = mouseevntType;
457
+ }
458
+ ;
459
+ if (this.preventMouseout && !this.isDriverList)
460
+ this.preventMouseout = false;
461
+ if (isHoverOut) {
462
+ if (this.preventMouseout) {
463
+ route = this.utils.getdictValue('driver-details');
464
+ this.driverList = route;
465
+ }
466
+ if (!this.preventMouseout) {
467
+ this.driverList = route;
468
+ }
469
+ }
470
+ else {
471
+ this.driverList = route;
472
+ }
473
+ }
474
+ visiblesection(value) { if (this.type === value) {
475
+ return true;
476
+ }
477
+ else
478
+ return false; }
479
+ toggleFilterRoute(filterList) {
480
+ filterList.forEach((ele) => {
481
+ const filterItem = (this.type === 'jobcode') ? 'job_id' : 'route_id';
482
+ const index = this.data.findIndex((ele1) => { return (ele1[`${filterItem}`] === ele[`${filterItem}`]); });
483
+ const id = (ele['job_id'] ? ele['job_id'] : ele['route_id']);
484
+ if (id && index < 0)
485
+ this.coolMap.filterRoute(id, 'none');
486
+ if (id && index >= 0) {
487
+ this.data[index].isActive = false;
488
+ this.coolMap.filterRoute(id, 'visible');
489
+ this.coolMap.extendBound(ele['path'], (index === (this.data.length - 1)));
490
+ }
491
+ ;
492
+ });
493
+ }
494
+ clearList() {
495
+ this.isDriverList = false;
496
+ this.driverList = null;
497
+ this.preventMouseout = false;
498
+ this.isSmsList = false;
499
+ }
500
+ sendMessage() {
501
+ this.messageLoader = true;
502
+ if (this.driverMessage.valid) {
503
+ const data = {
504
+ order_number: this.driverList['order_number'],
505
+ date: this.driverList['date'],
506
+ message: this.driverMessage.value,
507
+ };
508
+ this.utils.postdata('jobs_report_chat', data).subscribe((res) => {
509
+ if (res['data']['status'] === 'Success.') {
510
+ this.messageLoader = false;
511
+ this.driverMessage.reset();
512
+ this.utils.openSnackBar('Message Sent', 'success');
513
+ }
514
+ else {
515
+ this.messageLoader = false;
516
+ this.utils.openSnackBar('Message not sent', 'error');
517
+ }
518
+ }, err => { if (err) {
519
+ this.messageLoader = false;
520
+ } });
521
+ }
522
+ }
523
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RouteJobCodeListComponent, deps: [{ token: i1.CoolmapService }, { token: i1.UtilsService }], target: i0.ɵɵFactoryTarget.Component });
524
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: RouteJobCodeListComponent, selector: "app-route-jobcode-list", inputs: { loader: "loader", type: "type", data: "data", currentNav: "currentNav", searchTerm: "searchTerm", clearListSeletion: "clearListSeletion" }, outputs: { emitroute: "emitroute", showAllRoute: "showAllRoute", clearJobDetailsFromList: "clearJobDetailsFromList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"scrollprt addroutelist\" [class.viewroute]=\"visiblesection('addroute')\"\n [class.jobList]=\"visiblesection('jobcode')\">\n <button (click)=\"showRoute()\" [disabled]=\"loader\" *ngIf=\"selectedRoute.selected.length\" class=\"show_routebtn\">Show all\n route</button>\n <cdk-virtual-scroll-viewport itemSize=\"50\" [class.jobscroll]=\"visiblesection('jobcode')\" class=\"example-viewport\">\n <mat-spinner *ngIf=\"loader\"></mat-spinner>\n <ul *ngIf=\"!loader && data.length > 0\">\n <li [class.active]=\"route['isActive'] && visiblesection('addroute')\" *ngFor=\"let route of data\">\n <app-job-code-list-card *ngIf=\"visiblesection('jobcode')\" \n (toggleDrivermenu)=\"toggleDrivermenu($event)\"\n (routeSeletion)=\"selectRoute($event)\" \n [preventCloseDetails]=\"preventDetailsClose\" \n [emitJobdetails]=\"{emitroute, clearJobDetailsFromList}\" \n [route]=\"checkroutes(route)\">\n </app-job-code-list-card>\n <app-view-route-list-card *ngIf=\"visiblesection('addroute')\"\n [emitrouteevent]=\"emitroute\" \n [route]=\"route\">\n </app-view-route-list-card>\n </li>\n </ul>\n <p *ngIf=\"!loader && data.length === 0\">{{visiblesection('addroute') ? 'No Route found' : 'No Job code found.'}}</p>\n </cdk-virtual-scroll-viewport>\n</div>\n\n<div class=\"driver_list\" *ngIf=\"isDriverList\">\n <div class=\"driver_headingprt\">\n <h2>Driver List</h2>\n <button *ngIf=\"driverList.driver_list?.length > 0\" (click)=\"isSmsList = true\">SMS</button>\n <div class=\"closebtn\" (click)=\"isDriverList = false; preventMouseout = false; isSmsList = false\">\n <mat-icon>clear</mat-icon>\n </div>\n </div>\n <ul class=\"driverList\" *ngIf=\"driverList && driverList.driver_list\">\n <li *ngFor=\"let driver of driverList?.driver_list\">\n <img src=\"assets/images/driver_icon.png\" [alt]=\"driver['driver_name']\" />\n <div class=\"driver_detail\">\n <b>{{driver['driver_name']}}</b> <span>{{driver['trucking_company']}}</span>\n <div class=\"cont_del\">\n <small>Driver contact: <b>{{driver['driver_phone'] ? driver['driver_phone'] : 'N/A'}}</b></small>\n <small>Company contact: <b>{{driver['trucking_company_phone'] ? driver['trucking_company_phone'] : 'N/A'}}</b></small>\n </div>\n </div>\n </li>\n <p *ngIf=\"driverList.driver_list?.length === 0\" style=\"font-weight:700; text-align:center;\">\n No Driver found\n </p>\n </ul>\n <div class=\"smslist\" *ngIf=\"isSmsList\">\n <div class=\"heading\">\n <h2>SMS All Drivers</h2>\n <div class=\"closebtn\" (click)=\"isSmsList = false\">\n <mat-icon>clear</mat-icon>\n </div>\n </div>\n <div class=\"detailprt\">\n <app-sms-card-details-overview [jobValue]=\"driverList\"></app-sms-card-details-overview>\n <div class=\"form_input\">\n <mat-form-field class=\"example-full-width\">\n <textarea matInput placeholder=\"Text here...\" autocomplete=\"nope\" column=\"10\"\n [formControl]=\"driverMessage\"></textarea>\n <mat-hint>{{driverMessage.value?.length}} / 256</mat-hint>\n </mat-form-field>\n <button *ngIf=\"!messageLoader\" [disabled]=\"!driverMessage.value || driverMessage.invalid\" (click)=\"sendMessage()\">\n Send SMS\n </button>\n </div>\n </div>\n <div class=\"loader\">\n <mat-spinner *ngIf=\"messageLoader\"></mat-spinner>\n </div>\n </div>\n</div>\n", styles: [".driver_iconprt{position:absolute;right:10px;top:12px;z-index:9999}.driver_iconprt img{width:25px;height:25px}.driver_list{background:#fff;position:fixed;width:300px;top:10px;left:360px;border-top-left-radius:20px;border-top-right-radius:20px}.driver_list .driver_headingprt{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.driver_list .driver_headingprt button{background:none;border:1px solid #ccc;border-radius:10px;padding:5px 20px}.driver_list .driver_headingprt button:hover{background:#326ad3;color:#fff}.driver_list h2{font-size:20px}.driver_list .driverList{height:300px;overflow:auto}.driver_list .driverList li{display:flex;padding:10px;align-items:flex-start;cursor:pointer;border-bottom:1px solid white;background:#eee}.driver_list .driverList li img{width:35px;height:35px;border-radius:100%;margin-right:10px}.driver_list .driverList li .driver_detail{width:calc(100% - 45px);display:flex;flex-direction:column;justify-content:flex-start}.driver_list .driverList li .driver_detail b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:135px;font-size:.9rem}.driver_list .driverList li .driver_detail span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;font-size:.8rem}.driver_list:after{height:10px;background:#fff;border-bottom-right-radius:20px;border-bottom-left-radius:20px;content:\"\";position:absolute;bottom:-9px;width:100%}.smslist{background:#fff;position:absolute;width:480px;top:0;left:105%;border-radius:20px;padding-bottom:20px}.smslist .heading{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.smslist .detailprt{padding:0 15px}.smslist .detailprt span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}.smslist .detailprt span label{font-weight:600;width:37%}.smslist .detailprt .form_input{display:flex;flex-direction:column;font-size:.8rem}.smslist .detailprt .form_input button{background:#326ad3;padding:10px 18px;color:#fff;font-size:.8125rem;border-radius:30px;display:flex;align-self:flex-end}.closebtn{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5}.show_routebtn{font-size:.9rem;margin-bottom:20px;padding:6px 11px;position:absolute;top:8px;right:10px;background-color:transparent;color:#3f51b5;border:1px solid #3f51b5;border-radius:10px;box-shadow:none}.show_routebtn:hover{background-color:#3f51b5;color:#fff}.cont_del{margin-top:10px}.cont_del small{display:block}.jobList ul{margin:0 .93em 0 0;width:100%}.jobList ul li{position:relative;background:#fbfbfb;padding:10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left:3px solid #fbfbfb;cursor:pointer;height:inherit;width:15.62em}.viewroute ul{width:100%}.viewroute ul li{position:relative;background:#fbfbfb;padding:7px 10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left:3px solid #fbfbfb;cursor:pointer;width:15.62em}.viewroute ul li.active{border:1px solid #39c471;border-left:3px solid #39c471}.loader{position:absolute;height:100%;top:0;left:0;width:100%;display:flex;align-items:center;justify-content:center;pointer-events:none}.example-viewport{height:74vh}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i7$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "directive", type: i8.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "component", type: i8.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: ViewRouteListCardComponent, selector: "app-view-route-list-card", inputs: ["route", "emitrouteevent"] }, { kind: "component", type: SmsCardDetailsOverviewComponent, selector: "app-sms-card-details-overview", inputs: ["jobValue"] }, { kind: "component", type: JobCodeListCardComponent, selector: "app-job-code-list-card", inputs: ["route", "emitJobdetails", "preventCloseDetails"], outputs: ["routeSeletion", "toggleDrivermenu"] }] });
525
+ }
526
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RouteJobCodeListComponent, decorators: [{
527
+ type: Component,
528
+ args: [{ selector: 'app-route-jobcode-list', template: "<div class=\"scrollprt addroutelist\" [class.viewroute]=\"visiblesection('addroute')\"\n [class.jobList]=\"visiblesection('jobcode')\">\n <button (click)=\"showRoute()\" [disabled]=\"loader\" *ngIf=\"selectedRoute.selected.length\" class=\"show_routebtn\">Show all\n route</button>\n <cdk-virtual-scroll-viewport itemSize=\"50\" [class.jobscroll]=\"visiblesection('jobcode')\" class=\"example-viewport\">\n <mat-spinner *ngIf=\"loader\"></mat-spinner>\n <ul *ngIf=\"!loader && data.length > 0\">\n <li [class.active]=\"route['isActive'] && visiblesection('addroute')\" *ngFor=\"let route of data\">\n <app-job-code-list-card *ngIf=\"visiblesection('jobcode')\" \n (toggleDrivermenu)=\"toggleDrivermenu($event)\"\n (routeSeletion)=\"selectRoute($event)\" \n [preventCloseDetails]=\"preventDetailsClose\" \n [emitJobdetails]=\"{emitroute, clearJobDetailsFromList}\" \n [route]=\"checkroutes(route)\">\n </app-job-code-list-card>\n <app-view-route-list-card *ngIf=\"visiblesection('addroute')\"\n [emitrouteevent]=\"emitroute\" \n [route]=\"route\">\n </app-view-route-list-card>\n </li>\n </ul>\n <p *ngIf=\"!loader && data.length === 0\">{{visiblesection('addroute') ? 'No Route found' : 'No Job code found.'}}</p>\n </cdk-virtual-scroll-viewport>\n</div>\n\n<div class=\"driver_list\" *ngIf=\"isDriverList\">\n <div class=\"driver_headingprt\">\n <h2>Driver List</h2>\n <button *ngIf=\"driverList.driver_list?.length > 0\" (click)=\"isSmsList = true\">SMS</button>\n <div class=\"closebtn\" (click)=\"isDriverList = false; preventMouseout = false; isSmsList = false\">\n <mat-icon>clear</mat-icon>\n </div>\n </div>\n <ul class=\"driverList\" *ngIf=\"driverList && driverList.driver_list\">\n <li *ngFor=\"let driver of driverList?.driver_list\">\n <img src=\"assets/images/driver_icon.png\" [alt]=\"driver['driver_name']\" />\n <div class=\"driver_detail\">\n <b>{{driver['driver_name']}}</b> <span>{{driver['trucking_company']}}</span>\n <div class=\"cont_del\">\n <small>Driver contact: <b>{{driver['driver_phone'] ? driver['driver_phone'] : 'N/A'}}</b></small>\n <small>Company contact: <b>{{driver['trucking_company_phone'] ? driver['trucking_company_phone'] : 'N/A'}}</b></small>\n </div>\n </div>\n </li>\n <p *ngIf=\"driverList.driver_list?.length === 0\" style=\"font-weight:700; text-align:center;\">\n No Driver found\n </p>\n </ul>\n <div class=\"smslist\" *ngIf=\"isSmsList\">\n <div class=\"heading\">\n <h2>SMS All Drivers</h2>\n <div class=\"closebtn\" (click)=\"isSmsList = false\">\n <mat-icon>clear</mat-icon>\n </div>\n </div>\n <div class=\"detailprt\">\n <app-sms-card-details-overview [jobValue]=\"driverList\"></app-sms-card-details-overview>\n <div class=\"form_input\">\n <mat-form-field class=\"example-full-width\">\n <textarea matInput placeholder=\"Text here...\" autocomplete=\"nope\" column=\"10\"\n [formControl]=\"driverMessage\"></textarea>\n <mat-hint>{{driverMessage.value?.length}} / 256</mat-hint>\n </mat-form-field>\n <button *ngIf=\"!messageLoader\" [disabled]=\"!driverMessage.value || driverMessage.invalid\" (click)=\"sendMessage()\">\n Send SMS\n </button>\n </div>\n </div>\n <div class=\"loader\">\n <mat-spinner *ngIf=\"messageLoader\"></mat-spinner>\n </div>\n </div>\n</div>\n", styles: [".driver_iconprt{position:absolute;right:10px;top:12px;z-index:9999}.driver_iconprt img{width:25px;height:25px}.driver_list{background:#fff;position:fixed;width:300px;top:10px;left:360px;border-top-left-radius:20px;border-top-right-radius:20px}.driver_list .driver_headingprt{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.driver_list .driver_headingprt button{background:none;border:1px solid #ccc;border-radius:10px;padding:5px 20px}.driver_list .driver_headingprt button:hover{background:#326ad3;color:#fff}.driver_list h2{font-size:20px}.driver_list .driverList{height:300px;overflow:auto}.driver_list .driverList li{display:flex;padding:10px;align-items:flex-start;cursor:pointer;border-bottom:1px solid white;background:#eee}.driver_list .driverList li img{width:35px;height:35px;border-radius:100%;margin-right:10px}.driver_list .driverList li .driver_detail{width:calc(100% - 45px);display:flex;flex-direction:column;justify-content:flex-start}.driver_list .driverList li .driver_detail b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:135px;font-size:.9rem}.driver_list .driverList li .driver_detail span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;font-size:.8rem}.driver_list:after{height:10px;background:#fff;border-bottom-right-radius:20px;border-bottom-left-radius:20px;content:\"\";position:absolute;bottom:-9px;width:100%}.smslist{background:#fff;position:absolute;width:480px;top:0;left:105%;border-radius:20px;padding-bottom:20px}.smslist .heading{display:flex;justify-content:space-between;align-items:center;padding:0 15px}.smslist .detailprt{padding:0 15px}.smslist .detailprt span{display:flex;margin-bottom:12px;font-size:.8rem;align-items:center}.smslist .detailprt span label{font-weight:600;width:37%}.smslist .detailprt .form_input{display:flex;flex-direction:column;font-size:.8rem}.smslist .detailprt .form_input button{background:#326ad3;padding:10px 18px;color:#fff;font-size:.8125rem;border-radius:30px;display:flex;align-self:flex-end}.closebtn{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5}.show_routebtn{font-size:.9rem;margin-bottom:20px;padding:6px 11px;position:absolute;top:8px;right:10px;background-color:transparent;color:#3f51b5;border:1px solid #3f51b5;border-radius:10px;box-shadow:none}.show_routebtn:hover{background-color:#3f51b5;color:#fff}.cont_del{margin-top:10px}.cont_del small{display:block}.jobList ul{margin:0 .93em 0 0;width:100%}.jobList ul li{position:relative;background:#fbfbfb;padding:10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left:3px solid #fbfbfb;cursor:pointer;height:inherit;width:15.62em}.viewroute ul{width:100%}.viewroute ul li{position:relative;background:#fbfbfb;padding:7px 10px;border-radius:15px;margin-bottom:5px;border:1px solid #fbfbfb;border-left:3px solid #fbfbfb;cursor:pointer;width:15.62em}.viewroute ul li.active{border:1px solid #39c471;border-left:3px solid #39c471}.loader{position:absolute;height:100%;top:0;left:0;width:100%;display:flex;align-items:center;justify-content:center;pointer-events:none}.example-viewport{height:74vh}\n"] }]
529
+ }], ctorParameters: () => [{ type: i1.CoolmapService }, { type: i1.UtilsService }], propDecorators: { loader: [{
530
+ type: Input
531
+ }], type: [{
532
+ type: Input
533
+ }], data: [{
534
+ type: Input
535
+ }], currentNav: [{
536
+ type: Input
537
+ }], emitroute: [{
538
+ type: Output
539
+ }], showAllRoute: [{
540
+ type: Output
541
+ }], searchTerm: [{
542
+ type: Input
543
+ }], clearJobDetailsFromList: [{
544
+ type: Output
545
+ }], clearListSeletion: [{
546
+ type: Input
547
+ }] } });
548
+
549
+ class AddRouteNavComponent {
550
+ utils;
551
+ config;
552
+ filterForm = new FormGroup({ search: new FormControl() });
553
+ filteredOptions;
554
+ filters = [];
555
+ loaderVal = false;
556
+ routes = [];
557
+ changeNav = new EventEmitter();
558
+ navValue = '';
559
+ addemit = new EventEmitter();
560
+ updateRouteList = false;
561
+ customerRepoDetails;
562
+ destroyer$ = new Subject();
563
+ preventListUpdate = false;
564
+ unitList;
565
+ materialsList;
566
+ constructor(utils, config) {
567
+ this.utils = utils;
568
+ this.config = config;
569
+ this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''), map(value => this.utils.filter(value, this.filters)));
570
+ }
571
+ showAddForm() { this.changeNav.emit('addForm'); this.addemit.emit(''); }
572
+ filterSearch(e) {
573
+ this.changeNav.emit({ type: 'Addroute' });
574
+ this.preventListUpdate = true;
575
+ this.filterForm.controls.search.setValue(null);
576
+ this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }];
577
+ }
578
+ removeFromFilter(filter) {
579
+ this.changeNav.emit({ type: 'Addroute' });
580
+ const index = this.filters.indexOf(filter);
581
+ if (index >= 0) {
582
+ this.filters = [];
583
+ }
584
+ }
585
+ ngAfterViewInit() {
586
+ this.checkAndCallRouteList();
587
+ }
588
+ ngOnChanges(changes) {
589
+ if (changes['updateRouteList'] && changes['updateRouteList']['currentValue'])
590
+ this.checkAndCallRouteList();
591
+ if (changes['navValue'] && (changes['navValue']['previousValue'] === 'addForm') && !this.preventListUpdate)
592
+ this.checkAndCallRouteList();
593
+ }
594
+ getRoute(event) { if (event['type'] === 'editroute') {
595
+ this.addemit.emit(event);
596
+ } }
597
+ checkAndCallRouteList() {
598
+ if (this.config.repository === 'customer') {
599
+ this.utils.fetchUnitsList().then((res) => {
600
+ this.unitList = res;
601
+ this.utils.fetchMaterialsListForCustomer().then((res) => {
602
+ this.materialsList = res;
603
+ this.getRouteListForCustomer();
604
+ });
605
+ });
606
+ }
607
+ else {
608
+ this.getRouteListForCoolMap();
609
+ }
610
+ }
611
+ getUnitName(data) {
612
+ let unitName = '';
613
+ this.unitList.map((res) => {
614
+ if (res.id === data.unit_id) {
615
+ unitName = res.type;
616
+ }
617
+ });
618
+ return unitName;
619
+ }
620
+ getMaterialName(data) {
621
+ let materialName = '';
622
+ this.materialsList.map((res) => {
623
+ if (res.sub_material_id === data.materials_id) {
624
+ materialName = res.label;
625
+ }
626
+ });
627
+ return materialName;
628
+ }
629
+ getRouteListForCoolMap() {
630
+ this.utils.getData('routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res) => {
631
+ if (res) {
632
+ this.filters = [];
633
+ this.routes = res['data'];
634
+ this.preventListUpdate = false;
635
+ this.utils.clearOptions();
636
+ this.routes.forEach((ele) => { this.utils.makeOptions(ele); });
637
+ }
638
+ });
639
+ }
640
+ getRouteListForCustomer() {
641
+ const dataset = {
642
+ customer_id: this.customerRepoDetails.customer.id
643
+ };
644
+ this.utils.postdata('routes/all', dataset).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
645
+ if (res) {
646
+ this.filters = [];
647
+ this.routes = res['data'];
648
+ this.preventListUpdate = false;
649
+ this.utils.clearOptions();
650
+ this.routes.map((ele) => {
651
+ ele.unit = this.getUnitName(ele);
652
+ ele.material = this.getMaterialName(ele).split('|')[0].trim();
653
+ this.utils.makeOptions(ele);
654
+ });
655
+ }
656
+ });
657
+ }
658
+ resetSearch() { this.changeNav.emit('Addroute'); }
659
+ ngOnDestroy() {
660
+ this.destroyer$.next(true);
661
+ this.destroyer$.unsubscribe();
662
+ }
663
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddRouteNavComponent, deps: [{ token: i1.UtilsService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
664
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: AddRouteNavComponent, selector: "app-add-route-nav", inputs: { navValue: "navValue", updateRouteList: "updateRouteList", customerRepoDetails: "customerRepoDetails" }, outputs: { changeNav: "changeNav", addemit: "addemit" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"nav_body\">\n <div class=\"logo\">\n <img src=\"assets/images/logo.png\" alt=\"logo\" />\n </div>\n <div class=\"heading m-20\">\n <h1>View Route</h1>\n <button mat-raised-button (click)=\"showAddForm()\">\n <mat-icon>add_circle_outline</mat-icon> Add route\n </button>\n </div>\n\n <div class=\"search-panel\">\n <div class=\"w-100\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\n [disabled]=\"loaderVal\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button matSuffix mat-icon-button aria-label=\"Clear\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\"\n (click)=\"filterForm.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" class=\"whole_width\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </form>\n <div class=\"chip-list\">\n <mat-chip-grid #chipList aria-label=\"Filter selection\">\n @for (filter of filters; track filter) {\n <mat-chip-row class=\"chip-grid\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n </div>\n </div>\n </div>\n <app-route-jobcode-list [type]=\"'addroute'\" [currentNav]=\"navValue\" [searchTerm]=\"filters\" [data]=\"routes\" [loader]=\"loaderVal\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\n</div>\n", styles: [".chip-grid{width:auto;height:auto}:host ::ng-deep .mdc-evolution-chip-set__chips{max-width:100%}:host ::ng-deep .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,:host ::ng-deep .mat-mdc-standard-chip .mdc-evolution-chip__action--primary,:host ::ng-deep .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}:host ::ng-deep .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i9.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i9.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i9.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i9.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: i10.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i10.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: RouteJobCodeListComponent, selector: "app-route-jobcode-list", inputs: ["loader", "type", "data", "currentNav", "searchTerm", "clearListSeletion"], outputs: ["emitroute", "showAllRoute", "clearJobDetailsFromList"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }] });
665
+ }
666
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddRouteNavComponent, decorators: [{
667
+ type: Component,
668
+ args: [{ selector: 'app-add-route-nav', template: "<div class=\"nav_body\">\n <div class=\"logo\">\n <img src=\"assets/images/logo.png\" alt=\"logo\" />\n </div>\n <div class=\"heading m-20\">\n <h1>View Route</h1>\n <button mat-raised-button (click)=\"showAddForm()\">\n <mat-icon>add_circle_outline</mat-icon> Add route\n </button>\n </div>\n\n <div class=\"search-panel\">\n <div class=\"w-100\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\n [disabled]=\"loaderVal\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button matSuffix mat-icon-button aria-label=\"Clear\" *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\"\n (click)=\"filterForm.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" class=\"whole_width\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </form>\n <div class=\"chip-list\">\n <mat-chip-grid #chipList aria-label=\"Filter selection\">\n @for (filter of filters; track filter) {\n <mat-chip-row class=\"chip-grid\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n </div>\n </div>\n </div>\n <app-route-jobcode-list [type]=\"'addroute'\" [currentNav]=\"navValue\" [searchTerm]=\"filters\" [data]=\"routes\" [loader]=\"loaderVal\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\n</div>\n", styles: [".chip-grid{width:auto;height:auto}:host ::ng-deep .mdc-evolution-chip-set__chips{max-width:100%}:host ::ng-deep .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,:host ::ng-deep .mat-mdc-standard-chip .mdc-evolution-chip__action--primary,:host ::ng-deep .mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:hidden}:host ::ng-deep .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding:auto}\n"] }]
669
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapConfigModel, decorators: [{
670
+ type: Inject,
671
+ args: ['memberData']
672
+ }] }], propDecorators: { changeNav: [{
673
+ type: Output
674
+ }], navValue: [{
675
+ type: Input
676
+ }], addemit: [{
677
+ type: Output
678
+ }], updateRouteList: [{
679
+ type: Input
680
+ }], customerRepoDetails: [{
681
+ type: Input
682
+ }] } });
683
+
684
+ class JobCodeNavComponent {
685
+ utils;
686
+ config;
687
+ filterForm = new FormGroup({ search: new FormControl() });
688
+ listData = [];
689
+ loaderVal = false;
690
+ dateValue = new Date();
691
+ jobemit = new EventEmitter();
692
+ value = '';
693
+ filteredOptions;
694
+ filters = [];
695
+ clearJobDetails = new EventEmitter();
696
+ destroyer$ = new Subject();
697
+ customerRepoDetails;
698
+ selectedDate;
699
+ constructor(utils, config) {
700
+ this.utils = utils;
701
+ this.config = config;
702
+ this.selectedDate = this.utils.getDateFormat(new Date());
703
+ utils.navChangeObserve.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
704
+ if (res) {
705
+ this.loaderVal = false;
706
+ }
707
+ else
708
+ this.loaderVal = true;
709
+ });
710
+ }
711
+ ngOnChanges(changes) {
712
+ if (changes['customerRepoDetails'] &&
713
+ changes['customerRepoDetails']['currentValue']) {
714
+ this.loadData(this.selectedDate);
715
+ this.filters = [];
716
+ this.utils.clearViewRouteforJobCode.next(true);
717
+ }
718
+ }
719
+ loadData(value) {
720
+ this.selectedDate = value;
721
+ this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''), map((value) => this.utils.filter(value, this.filters)));
722
+ this.utils.preventnavChange.next(false);
723
+ this.loaderVal = true;
724
+ let dataSet;
725
+ if (this.config.repository === 'customer') {
726
+ dataSet = {
727
+ date: value,
728
+ customer_id: this.customerRepoDetails.customer.id,
729
+ project_id: this.customerRepoDetails.projectId,
730
+ };
731
+ }
732
+ else {
733
+ dataSet = { date: value };
734
+ }
735
+ this.utils
736
+ .postdata('jobs_report_v2', dataSet)
737
+ .pipe(takeUntil(this.destroyer$))
738
+ .subscribe((res) => {
739
+ console.log(`res`, res);
740
+ if (typeof res['data'] !== 'string') {
741
+ if (res['data'].length > 0) {
742
+ this.listData = res['data'].map((ele) => {
743
+ ele['date'] = value;
744
+ return ele;
745
+ });
746
+ }
747
+ console.log(`this.config.repository`, this.config.repository);
748
+ if (this.config.repository === 'customer') {
749
+ let projectName = 'Contaminated Soil';
750
+ projectName = projectName.toLowerCase();
751
+ console.log(`projectName`, projectName);
752
+ this.listData = this.listData.filter(ele => {
753
+ const project = 'Key Bridge Demo - North Approach';
754
+ let adjustedProject = project.replace(/\s+|\/-\/+/g, "_");
755
+ console.log(`adjustedProject`, adjustedProject, 'Key_Bridge_Demo___North_Approach');
756
+ console.log(`adjustedProject === projectName`, adjustedProject === 'Key_Bridge_Demo___North_Approach');
757
+ return adjustedProject === projectName;
758
+ });
759
+ console.log(`this.listdata`, this.listData);
760
+ }
761
+ this.listData.forEach((ele) => {
762
+ this.utils.makeOptions(ele);
763
+ });
764
+ }
765
+ else
766
+ this.listData = [];
767
+ this.clearJobDetails.emit(true);
768
+ this.utils.clearViewRouteforJobCode.next(true);
769
+ this.filters = [];
770
+ if (typeof res['data'] === 'string')
771
+ this.utils.preventnavChange.next(true);
772
+ }, (err) => {
773
+ if (err)
774
+ this.utils.preventnavChange.next(true);
775
+ });
776
+ }
777
+ getRoute(job) {
778
+ if (job['type'] === 'jobcode') {
779
+ this.jobemit.emit(job);
780
+ }
781
+ }
782
+ getDate(ev) {
783
+ this.loadData(this.utils.getDateFormat(ev.value));
784
+ }
785
+ filterSearch(e) {
786
+ this.filterForm.controls.search.setValue(null);
787
+ this.filterForm.controls.search.updateValueAndValidity();
788
+ this.filters = [
789
+ {
790
+ name: e.source.value.label,
791
+ type: e.source.value.type,
792
+ value: e.source.value,
793
+ },
794
+ ];
795
+ }
796
+ removeFromFilter(filter) {
797
+ const index = this.filters.indexOf(filter);
798
+ if (index >= 0) {
799
+ this.filters = [];
800
+ }
801
+ }
802
+ ngOnDestroy() {
803
+ this.destroyer$.next(true);
804
+ this.destroyer$.unsubscribe();
805
+ }
806
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobCodeNavComponent, deps: [{ token: i1.UtilsService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
807
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: JobCodeNavComponent, selector: "app-job-code-nav", inputs: { customerRepoDetails: "customerRepoDetails" }, outputs: { jobemit: "jobemit", clearJobDetails: "clearJobDetails" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"nav_body\">\n <div class=\"search-panel\">\n <div class=\"datepicker\">\n <mat-form-field>\n <mat-label>Choose a date</mat-label>\n <input readonly matInput (click)=\"picker.open()\" [disabled]=\"loaderVal\" [(ngModel)]=\"dateValue\" [matDatepicker]=\"picker\" (dateChange)=\"getDate($event)\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n <div class=\"search\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\n [disabled]=\"loaderVal\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button\n matSuffix \n mat-icon-button \n aria-label=\"Clear\" \n *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\" (click)=\"filterForm.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" class=\"whole_width\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </form>\n </div>\n\n <div class=\"chip-list\">\n <mat-chip-grid #chipList aria-label=\"Filter selection\">\n @for (filter of filters; track filter) {\n <mat-chip-row class=\"chip-grid\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n </div>\n </div>\n <app-route-jobcode-list [type]=\"'jobcode'\" [searchTerm]=\"filters\" [data]=\"listData\" [loader]=\"loaderVal\" (clearJobDetailsFromList)=\"clearJobDetails.emit(true)\" (showAllRoute)=\"filters = []; clearJobDetails.emit(true)\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\n</div>\n", styles: [".search-panel .datepicker,.search-panel .search{width:47%}.chip-grid{width:auto;height:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i9.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i9.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i9.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i9.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: i10$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i10$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i10$1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i10.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: RouteJobCodeListComponent, selector: "app-route-jobcode-list", inputs: ["loader", "type", "data", "currentNav", "searchTerm", "clearListSeletion"], outputs: ["emitroute", "showAllRoute", "clearJobDetailsFromList"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }] });
808
+ }
809
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobCodeNavComponent, decorators: [{
810
+ type: Component,
811
+ args: [{ selector: 'app-job-code-nav', template: "<div class=\"nav_body\">\n <div class=\"search-panel\">\n <div class=\"datepicker\">\n <mat-form-field>\n <mat-label>Choose a date</mat-label>\n <input readonly matInput (click)=\"picker.open()\" [disabled]=\"loaderVal\" [(ngModel)]=\"dateValue\" [matDatepicker]=\"picker\" (dateChange)=\"getDate($event)\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n </mat-form-field>\n </div>\n <div class=\"search\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\" [class.disabled]=\"loaderVal\">\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\"\n [disabled]=\"loaderVal\" placeholder=\"Search\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button\n matSuffix \n mat-icon-button \n aria-label=\"Clear\" \n *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\" (click)=\"filterForm.reset()\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" class=\"whole_width\">\n <mat-option *ngFor=\"let option of filteredOptions | async\" (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\">\n {{option.type | titlecase }}: {{option['label']}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </form>\n </div>\n\n <div class=\"chip-list\">\n <mat-chip-grid #chipList aria-label=\"Filter selection\">\n @for (filter of filters; track filter) {\n <mat-chip-row class=\"chip-grid\" (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n </div>\n </div>\n <app-route-jobcode-list [type]=\"'jobcode'\" [searchTerm]=\"filters\" [data]=\"listData\" [loader]=\"loaderVal\" (clearJobDetailsFromList)=\"clearJobDetails.emit(true)\" (showAllRoute)=\"filters = []; clearJobDetails.emit(true)\" (emitroute)=\"getRoute($event)\"></app-route-jobcode-list>\n</div>\n", styles: [".search-panel .datepicker,.search-panel .search{width:47%}.chip-grid{width:auto;height:auto}\n"] }]
812
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapConfigModel, decorators: [{
813
+ type: Inject,
814
+ args: ['memberData']
815
+ }] }], propDecorators: { jobemit: [{
816
+ type: Output
817
+ }], clearJobDetails: [{
818
+ type: Output
819
+ }], customerRepoDetails: [{
820
+ type: Input
821
+ }] } });
822
+
823
+ class JobRouteListComponent {
824
+ utils;
825
+ coolMap;
826
+ changeNav = new EventEmitter();
827
+ filteredOptions;
828
+ preventListUpdate;
829
+ filterForm = new FormGroup({ search: new FormControl() });
830
+ filters;
831
+ routes;
832
+ selectedRoute;
833
+ changeRoutes = new EventEmitter();
834
+ changeSelectedRoute = new EventEmitter();
835
+ masterRoutes;
836
+ constructor(utils, coolMap) {
837
+ this.utils = utils;
838
+ this.coolMap = coolMap;
839
+ this.filters = [];
840
+ this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''), map(value => this.utils.filter(value, this.filters)));
841
+ }
842
+ filterSearch(e) {
843
+ this.changeNav.emit({ type: 'Addroute' });
844
+ this.preventListUpdate = true;
845
+ this.filterForm.controls.search.setValue(null);
846
+ this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }];
847
+ const filteredRoutes = this.utils.getSearchResults(this.masterRoutes, [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }]);
848
+ this.changeRoutes.emit(filteredRoutes);
849
+ this.selectedRoute.selected.forEach((item) => {
850
+ const routeData = filteredRoutes.find(x => x.route_id === item.route_id);
851
+ if (!routeData) {
852
+ this.selectedRoute.toggle(item);
853
+ this.changeSelectedRoute.emit(this.selectedRoute);
854
+ this.coolMap.removeRouteAndMarker(item['route_id']).then((res) => {
855
+ this.coolMap.extendReBound();
856
+ });
857
+ }
858
+ });
859
+ }
860
+ removeFromFilter(filter) {
861
+ this.changeNav.emit({ type: 'Addroute' });
862
+ const index = this.filters.indexOf(filter);
863
+ if (index >= 0) {
864
+ this.filters = [];
865
+ this.changeRoutes.emit(this.masterRoutes);
866
+ }
867
+ }
868
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobRouteListComponent, deps: [{ token: i1.UtilsService }, { token: i1.CoolmapService }], target: i0.ɵɵFactoryTarget.Component });
869
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: JobRouteListComponent, selector: "app-job-route-list", inputs: { routes: "routes", selectedRoute: "selectedRoute", masterRoutes: "masterRoutes" }, outputs: { changeNav: "changeNav", changeRoutes: "changeRoutes", changeSelectedRoute: "changeSelectedRoute" }, ngImport: i0, template: "<div class=\"searchprt\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\">\n <mat-label>Search</mat-label>\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button\n matSuffix\n mat-icon-button\n aria-label=\"Clear\"\n (click)=\"filterForm.reset()\"\n *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete\n autoActiveFirstOption\n #auto=\"matAutocomplete\"\n class=\"autocomplete\"\n >\n <ng-container *ngFor=\"let option of filteredOptions | async\">\n @if (option.type !== 'material') {\n <mat-option\n (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\"\n >\n {{ option.type | titlecase }}: {{ option[\"label\"] }}\n </mat-option>\n }\n </ng-container>\n </mat-autocomplete>\n </mat-form-field>\n</form>\n</div>\n<div class=\"chip-list\">\n <mat-chip-grid #chipList aria-label=\"Filter selection\">\n @for (filter of filters; track filter) {\n <mat-chip-row (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n</div>\n", styles: [".searchprt{padding-right:20px}::ng-deep .searchprt .mdc-button{min-width:auto}::ng-deep .autocomplete .mat-mdc-option .mdc-list-item__primary-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis;font-size:.8rem;white-space:nowrap}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i9.MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "directive", type: i9.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { kind: "directive", type: i9.MatChipRemove, selector: "[matChipRemove]" }, { kind: "component", type: i9.MatChipRow, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: ["editable"], outputs: ["edited"] }, { kind: "component", type: i10.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }] });
870
+ }
871
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobRouteListComponent, decorators: [{
872
+ type: Component,
873
+ args: [{ selector: 'app-job-route-list', template: "<div class=\"searchprt\">\n <form [formGroup]=\"filterForm\">\n <mat-form-field class=\"full-width\">\n <mat-label>Search</mat-label>\n <input matInput [matChipInputFor]=\"chipList\" formControlName=\"search\" [matAutocomplete]=\"auto\">\n <mat-icon matSuffix *ngIf=\"!utils.conveySearchIcon(filterForm.value.search)\">search</mat-icon>\n <button\n matSuffix\n mat-icon-button\n aria-label=\"Clear\"\n (click)=\"filterForm.reset()\"\n *ngIf=\"utils.conveySearchIcon(filterForm.value.search)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n <mat-autocomplete\n autoActiveFirstOption\n #auto=\"matAutocomplete\"\n class=\"autocomplete\"\n >\n <ng-container *ngFor=\"let option of filteredOptions | async\">\n @if (option.type !== 'material') {\n <mat-option\n (onSelectionChange)=\"filterSearch($event)\"\n [value]=\"option\"\n >\n {{ option.type | titlecase }}: {{ option[\"label\"] }}\n </mat-option>\n }\n </ng-container>\n </mat-autocomplete>\n </mat-form-field>\n</form>\n</div>\n<div class=\"chip-list\">\n <mat-chip-grid #chipList aria-label=\"Filter selection\">\n @for (filter of filters; track filter) {\n <mat-chip-row (removed)=\"removeFromFilter(filter)\">\n {{filter.type | titlecase }}: {{filter.name}}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n</div>\n", styles: [".searchprt{padding-right:20px}::ng-deep .searchprt .mdc-button{min-width:auto}::ng-deep .autocomplete .mat-mdc-option .mdc-list-item__primary-text{display:inline-block;flex-grow:1;overflow:hidden;text-overflow:ellipsis;font-size:.8rem;white-space:nowrap}\n"] }]
874
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapService }], propDecorators: { changeNav: [{
875
+ type: Output
876
+ }], routes: [{
877
+ type: Input
878
+ }], selectedRoute: [{
879
+ type: Input
880
+ }], changeRoutes: [{
881
+ type: Output
882
+ }], changeSelectedRoute: [{
883
+ type: Output
884
+ }], masterRoutes: [{
885
+ type: Input
886
+ }] } });
887
+
888
+ class JobcodeStatusComponent {
889
+ jobValue;
890
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobcodeStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
891
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: JobcodeStatusComponent, selector: "app-jobcode-status", inputs: { jobValue: "jobValue" }, ngImport: i0, template: "<div class=\"statusprt\" *ngIf=\"jobValue['values']\">\n <span class=\"done\"> Done - {{jobValue['values']['Done']}} </span>\n <span class=\"ongoing\"> Ongoing - {{jobValue['values']['Ongoing']}} </span>\n <span class=\"open\"> Open - {{jobValue['values']['Open']}} </span>\n</div>\n", styles: [".statusprt span{padding:5px 10px;font-size:.9rem;margin-left:0;margin-right:5px}.statusprt span.done{border:2px solid #0b843c;color:#0b843c}.statusprt span.done:hover{background:#0b843c;color:#fff}.statusprt span.ongoing{border:2px solid #eecb27;color:#eecb27}.statusprt span.ongoing:hover{background:#eecb27;color:#fff}.statusprt span.open{border:2px solid #12afcb;color:#12afcb}.statusprt span.open:hover{background:#12afcb;color:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
892
+ }
893
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobcodeStatusComponent, decorators: [{
894
+ type: Component,
895
+ args: [{ selector: 'app-jobcode-status', template: "<div class=\"statusprt\" *ngIf=\"jobValue['values']\">\n <span class=\"done\"> Done - {{jobValue['values']['Done']}} </span>\n <span class=\"ongoing\"> Ongoing - {{jobValue['values']['Ongoing']}} </span>\n <span class=\"open\"> Open - {{jobValue['values']['Open']}} </span>\n</div>\n", styles: [".statusprt span{padding:5px 10px;font-size:.9rem;margin-left:0;margin-right:5px}.statusprt span.done{border:2px solid #0b843c;color:#0b843c}.statusprt span.done:hover{background:#0b843c;color:#fff}.statusprt span.ongoing{border:2px solid #eecb27;color:#eecb27}.statusprt span.ongoing:hover{background:#eecb27;color:#fff}.statusprt span.open{border:2px solid #12afcb;color:#12afcb}.statusprt span.open:hover{background:#12afcb;color:#fff}\n"] }]
896
+ }], propDecorators: { jobValue: [{
897
+ type: Input
898
+ }] } });
899
+
900
+ class JobcodeOverviewComponent {
901
+ jobValue;
902
+ label = JobCodeOverviewData;
903
+ overViewEnum = JobCodeOverviewEnum;
904
+ constructor() { }
905
+ makeValueObject(item) {
906
+ let obj;
907
+ obj = { label: this.overViewEnum[item], value: this.jobValue[item] };
908
+ return obj;
909
+ }
910
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobcodeOverviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
911
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: JobcodeOverviewComponent, selector: "app-jobcode-overview", inputs: { jobValue: "jobValue" }, ngImport: i0, template: "<div class=\"detail_view m-20\">\n <div class=\"destination\">\n <div class=\"duration\">\n <p class=\"pickprt\"><b>{{makeValueObject('pickup_location')['label']}}:</b> {{makeValueObject('pickup_location')['value']}}</p>\n <p class=\"dropprt\"><b>{{makeValueObject('delivery_location')['label']}}:</b> {{makeValueObject('delivery_location')['value']}}</p>\n </div>\n <ng-container *ngFor=\"let item of label\">\n <span *ngIf=\"item !== 'pickup_location' && item !== 'delivery_location'\" (mousedown)=\"$event.stopPropagation()\"><b>{{makeValueObject(item)['label']}}:</b> {{makeValueObject(item)['value']}}</span>\n </ng-container>\n </div>\n\n", styles: [".detail_view .destination .duration{padding:10px}.detail_view .destination span{padding:5px 0}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
912
+ }
913
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobcodeOverviewComponent, decorators: [{
914
+ type: Component,
915
+ args: [{ selector: 'app-jobcode-overview', template: "<div class=\"detail_view m-20\">\n <div class=\"destination\">\n <div class=\"duration\">\n <p class=\"pickprt\"><b>{{makeValueObject('pickup_location')['label']}}:</b> {{makeValueObject('pickup_location')['value']}}</p>\n <p class=\"dropprt\"><b>{{makeValueObject('delivery_location')['label']}}:</b> {{makeValueObject('delivery_location')['value']}}</p>\n </div>\n <ng-container *ngFor=\"let item of label\">\n <span *ngIf=\"item !== 'pickup_location' && item !== 'delivery_location'\" (mousedown)=\"$event.stopPropagation()\"><b>{{makeValueObject(item)['label']}}:</b> {{makeValueObject(item)['value']}}</span>\n </ng-container>\n </div>\n\n", styles: [".detail_view .destination .duration{padding:10px}.detail_view .destination span{padding:5px 0}\n"] }]
916
+ }], ctorParameters: () => [], propDecorators: { jobValue: [{
917
+ type: Input
918
+ }] } });
919
+
920
+ const CardKeysValue = [
921
+ 'route_name',
922
+ 'customer_name',
923
+ 'unit',
924
+ 'estimated_distance',
925
+ 'estimated_time',
926
+ 'trucker_pay_estimate',
927
+ 'customer_price_estimate',
928
+ 'note',
929
+ 'pickup_location',
930
+ 'delivery_location',
931
+ ];
932
+ var CardElements;
933
+ (function (CardElements) {
934
+ CardElements["route_name"] = "Name";
935
+ CardElements["customer_name"] = "Customer";
936
+ CardElements["unit"] = "Type";
937
+ CardElements["estimated_distance"] = "Distance";
938
+ CardElements["estimated_time"] = "Travel Time";
939
+ CardElements["trucker_pay_estimate"] = "Trucker Pay Estimate";
940
+ CardElements["customer_price_estimate"] = "Customer Price Estimate";
941
+ CardElements["note"] = "Notes";
942
+ CardElements["pickup_location"] = "Pickup";
943
+ CardElements["delivery_location"] = "Delivery";
944
+ })(CardElements || (CardElements = {}));
945
+ class RouteInfoCardComponent {
946
+ cdr;
947
+ popupData;
948
+ propData;
949
+ cardKeysElement = CardKeysValue;
950
+ constructor(cdr) {
951
+ this.cdr = cdr;
952
+ }
953
+ ngAfterViewInit() {
954
+ if (this.propData['repository'] === 'customer') {
955
+ this.cardKeysElement = this.cardKeysElement.filter(ele => ele !== 'trucker_pay_estimate');
956
+ this.cdr.detectChanges();
957
+ }
958
+ }
959
+ createLabel(itemName) {
960
+ let obj;
961
+ obj = { label: CardElements[itemName], value: this.popupData[itemName] };
962
+ if (itemName === 'trucker_pay_estimate' || itemName === 'customer_price_estimate') {
963
+ obj['value'] = obj['value'] ? '$' + obj['value'] : '';
964
+ }
965
+ return obj;
966
+ }
967
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RouteInfoCardComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
968
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: RouteInfoCardComponent, selector: "lib-route-info-card", inputs: { popupData: "popupData", propData: "propData" }, ngImport: i0, template: "<div [class]=\"propData['className']\">\n <div class=\"destination\">\n <div class=\"duration\">\n <p class=\"pickprt\"><b>Pickup:</b>{{\n createLabel('pickup_location')['value']?.split('|')[1] ?\n createLabel('pickup_location')['value']?.split('|')[1] :\n createLabel('pickup_location')['value']\n }}</p>\n <p class=\"dropprt\"><b>Delivery:</b>{{\n createLabel('delivery_location')['value']?.split('|')[1] ? \n createLabel('delivery_location')['value']?.split('|')[1] :\n createLabel('delivery_location')['value']\n }}</p>\n </div>\n <ng-container *ngFor=\"let item of cardKeysElement\">\n <span *ngIf=\"item !== 'pickup_location' && item !== 'delivery_location'\" [class.notes]=\"item === 'note'\"><b>{{createLabel(item)['label']}}:</b> {{createLabel(item)['value']}}</span>\n </ng-container>\n </div>\n</div>\n", styles: [".routeCard span{padding:5px 0}.routeCard span.notes{max-height:200px;overflow:auto;white-space:pre-wrap;word-break:break-all}.routeCard .duration{padding:10px}.listRoutecard .duration{background:#444343;border:1px solid #918e8e;padding:10px;color:#fff}.listRoutecard .duration b{color:#fff}.listRoutecard .pickprt:before,.listRoutecard .dropprt:before{background:#fff}.listRoutecard .pickprt b:before,.listRoutecard .dropprt b:before{background:#fff}.listRoutecard span{line-height:20px;color:#fff;padding:3px 0}.listRoutecard span b{color:#fff}.listRoutecard span.notes{max-height:200px;overflow:auto;white-space:pre-wrap;word-break:break-all}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
969
+ }
970
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RouteInfoCardComponent, decorators: [{
971
+ type: Component,
972
+ args: [{ selector: 'lib-route-info-card', template: "<div [class]=\"propData['className']\">\n <div class=\"destination\">\n <div class=\"duration\">\n <p class=\"pickprt\"><b>Pickup:</b>{{\n createLabel('pickup_location')['value']?.split('|')[1] ?\n createLabel('pickup_location')['value']?.split('|')[1] :\n createLabel('pickup_location')['value']\n }}</p>\n <p class=\"dropprt\"><b>Delivery:</b>{{\n createLabel('delivery_location')['value']?.split('|')[1] ? \n createLabel('delivery_location')['value']?.split('|')[1] :\n createLabel('delivery_location')['value']\n }}</p>\n </div>\n <ng-container *ngFor=\"let item of cardKeysElement\">\n <span *ngIf=\"item !== 'pickup_location' && item !== 'delivery_location'\" [class.notes]=\"item === 'note'\"><b>{{createLabel(item)['label']}}:</b> {{createLabel(item)['value']}}</span>\n </ng-container>\n </div>\n</div>\n", styles: [".routeCard span{padding:5px 0}.routeCard span.notes{max-height:200px;overflow:auto;white-space:pre-wrap;word-break:break-all}.routeCard .duration{padding:10px}.listRoutecard .duration{background:#444343;border:1px solid #918e8e;padding:10px;color:#fff}.listRoutecard .duration b{color:#fff}.listRoutecard .pickprt:before,.listRoutecard .dropprt:before{background:#fff}.listRoutecard .pickprt b:before,.listRoutecard .dropprt b:before{background:#fff}.listRoutecard span{line-height:20px;color:#fff;padding:3px 0}.listRoutecard span b{color:#fff}.listRoutecard span.notes{max-height:200px;overflow:auto;white-space:pre-wrap;word-break:break-all}\n"] }]
973
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { popupData: [{
974
+ type: Input
975
+ }], propData: [{
976
+ type: Input
977
+ }] } });
978
+
979
+ class JobCodeComponent {
980
+ utils;
981
+ coolMap;
982
+ config;
983
+ jobdetail;
984
+ customerRepoDetails;
985
+ isVisible = false;
986
+ routes = [];
987
+ selectedRoute = new SelectionModel(true, []);
988
+ clearJobDetails = new EventEmitter();
989
+ openShareRoute = new EventEmitter();
990
+ isOverlapRouteSection = false;
991
+ destroyer$ = new Subject();
992
+ detailsCardEnable;
993
+ preventMouseout = false;
994
+ routeCardDetail;
995
+ preventListUpdate;
996
+ masterRoutes;
997
+ unitList;
998
+ materialsList;
999
+ constructor(utils, coolMap, config) {
1000
+ this.utils = utils;
1001
+ this.coolMap = coolMap;
1002
+ this.config = config;
1003
+ this.utils.clearViewRouteforJobCodeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => {
1004
+ if (res)
1005
+ this.coolMap.removeJobFromMap(this.selectedRoute.selected);
1006
+ this.selectedRoute.clear();
1007
+ });
1008
+ }
1009
+ ngOnInit() { this.checkAndCallRouteList(); }
1010
+ checkAndCallRouteList() {
1011
+ this.utils.clearOptions();
1012
+ if (this.config.repository === 'customer') {
1013
+ this.utils.fetchUnitsList().then((res) => {
1014
+ this.unitList = res;
1015
+ this.utils.fetchMaterialsListForCustomer().then((res) => {
1016
+ this.materialsList = res;
1017
+ this.getRouteListForCustomer();
1018
+ });
1019
+ });
1020
+ }
1021
+ else {
1022
+ this.getRouteListForCoolMap();
1023
+ }
1024
+ }
1025
+ getUnitName(data) {
1026
+ let unitName = '';
1027
+ this.unitList.map((res) => {
1028
+ if (res.id === data.unit_id) {
1029
+ unitName = res.type;
1030
+ }
1031
+ });
1032
+ return unitName;
1033
+ }
1034
+ getRouteListForCoolMap() {
1035
+ this.utils.getData('routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1036
+ if (res) {
1037
+ this.routes = res.data;
1038
+ this.masterRoutes = res.data;
1039
+ this.preventListUpdate = false;
1040
+ this.routes.forEach((ele) => { this.utils.makeOptions(ele); });
1041
+ }
1042
+ });
1043
+ }
1044
+ getRouteListForCustomer() {
1045
+ const dataset = {
1046
+ customer_id: this.customerRepoDetails.customer.id
1047
+ };
1048
+ this.utils.postdata('routes/all', dataset).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1049
+ if (res) {
1050
+ this.routes = res.data;
1051
+ this.preventListUpdate = false;
1052
+ this.routes.map((ele) => {
1053
+ ele.unit = this.getUnitName(ele);
1054
+ this.utils.makeOptions(ele);
1055
+ });
1056
+ this.masterRoutes = this.routes;
1057
+ }
1058
+ });
1059
+ }
1060
+ toggleSidemenu() {
1061
+ this.isVisible = !this.isVisible;
1062
+ this.detailsCardEnable = false;
1063
+ this.preventMouseout = false;
1064
+ }
1065
+ clearJob() { this.clearJobDetails.emit(true); this.utils.preVentJobdetailclose.next(false); }
1066
+ selectRoute(event) {
1067
+ const i = this.selectedRoute.selected.findIndex(ele => ele['order_number'] === event['order_number']);
1068
+ this.selectedRoute.toggle(event);
1069
+ if (!this.selectedRoute.isSelected(event) && event['route_id']) {
1070
+ this.coolMap.removeRouteAndMarker(event['route_id']).then((res) => {
1071
+ this.coolMap.extendReBound();
1072
+ });
1073
+ }
1074
+ else {
1075
+ this.coolMap.plotRoute(event, event['route_id'], 'jobrouteList', false, true);
1076
+ }
1077
+ }
1078
+ masterToggle() {
1079
+ if (this.routes.length === this.selectedRoute.selected.length) {
1080
+ this.selectedRoute.clear();
1081
+ this.routes.forEach(row => {
1082
+ this.coolMap.removeRouteAndMarker(row['route_id']).then((res) => { this.coolMap.extendReBound(); });
1083
+ });
1084
+ }
1085
+ else {
1086
+ this.routes.forEach(row => {
1087
+ this.selectedRoute.select(row);
1088
+ this.coolMap.plotRoute(row, row['route_id'], 'jobrouteList', false, true);
1089
+ });
1090
+ }
1091
+ }
1092
+ togglerouteDetails(eventType, route, mouseOut) {
1093
+ if (typeof (eventType) === 'string') {
1094
+ this.preventMouseout = true;
1095
+ this.utils.setdictValue('route-details', JSON.stringify(route));
1096
+ }
1097
+ if (typeof (eventType) === 'boolean' && eventType && !this.preventMouseout) {
1098
+ this.detailsCardEnable = eventType;
1099
+ }
1100
+ ;
1101
+ if (typeof (eventType) === 'boolean' && !eventType && !this.preventMouseout) {
1102
+ this.detailsCardEnable = eventType;
1103
+ }
1104
+ ;
1105
+ if (this.preventMouseout && !this.detailsCardEnable)
1106
+ this.preventMouseout = false;
1107
+ if (mouseOut) {
1108
+ if (this.preventMouseout) {
1109
+ route = this.utils.getdictValue('route-details');
1110
+ this.routeCardDetail = route;
1111
+ }
1112
+ if (!this.preventMouseout) {
1113
+ this.routeCardDetail = route;
1114
+ }
1115
+ }
1116
+ else {
1117
+ this.routeCardDetail = route;
1118
+ }
1119
+ this.routeCardDetail['created_at'] = this.utils.getDateFormat(new Date(this.routeCardDetail['created_at']), '/');
1120
+ }
1121
+ openShareRouteModal(data) {
1122
+ this.openShareRoute.emit(data);
1123
+ }
1124
+ ngOnDestroy() {
1125
+ this.destroyer$.next(true);
1126
+ this.destroyer$.unsubscribe();
1127
+ }
1128
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobCodeComponent, deps: [{ token: i1.UtilsService }, { token: i1.CoolmapService }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
1129
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: JobCodeComponent, selector: "app-job-code", inputs: { jobdetail: "jobdetail", customerRepoDetails: "customerRepoDetails" }, outputs: { clearJobDetails: "clearJobDetails", openShareRoute: "openShareRoute" }, ngImport: i0, template: "<div class=\"jobcode_detailprt\" (click)=\"isOverlapRouteSection = false\" *ngIf=\"jobdetail\" [ngClass]=\"{'overlap': !isOverlapRouteSection}\" cdkDrag>\n <span class=\"close\"><mat-icon (click)=\"clearJob()\">clear</mat-icon></span>\n <div class=\"job_details_area\">\n <div class=\"detailnameprt\">\n <app-jobcode-status [jobValue]=\"jobdetail\"></app-jobcode-status>\n </div>\n <app-jobcode-overview [jobValue]=\"jobdetail\"></app-jobcode-overview>\n </div>\n</div>\n\n<div class=\"route_listprt\" (click)=\"isOverlapRouteSection = true\" [ngClass]=\"{ 'show': isVisible, 'overlap': isOverlapRouteSection}\">\n <div class=\"listing_toggle\" (click)=\"toggleSidemenu()\">\n <img src=\"assets/images/route.svg\" alt=\"\" />\n </div>\n\n <div class=\"listing_box\">\n <div class=\"closebtn\" (click)=\"toggleSidemenu()\">\n <mat-icon>clear</mat-icon>\n </div>\n\n <div class=\"btnprt\">\n <h2> List of Routes </h2>\n <button (click)=\"masterToggle()\">{{routes && routes.length > 0 && routes.length === selectedRoute.selected.length ? 'Uncheck' : 'Check'}} All</button>\n </div>\n\n <app-job-route-list [routes]=\"routes\" [masterRoutes]=\"masterRoutes\" [selectedRoute]=\"selectedRoute\" (changeRoutes)=\"routes = $event\" (changeSelectedRoute)=\"selectedRoute = $event\"></app-job-route-list>\n <cdk-virtual-scroll-viewport itemSize=\"50\" class=\"routeList-viewport\">\n <ul *ngIf=\"routes['length'] > 0\">\n <li *ngFor=\"let list of routes\">\n <div class=\"iconprt\">\n <span>\n <input type=\"checkbox\" [checked]=\"selectedRoute.isSelected(list)\"\n (change)=\"$event ? selectRoute(list) : null\" /><label>&nbsp;</label>\n <div class=\"border\"></div>\n </span>\n <div class=\"statusunit\" [ngClass]=\"list['unit']\">{{list['unit']}}</div>\n <div class=\"infoicon\">\n <img (mouseenter)=\"togglerouteDetails(true, list)\" (mouseout)=\"togglerouteDetails(false, list, true)\"\n (click)=\"togglerouteDetails('click', list)\" src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"infoicon\" *ngIf=\"config.repository === 'customer'\">\n <img src=\"assets/images/share_icon.png\" (click)=\"openShareRouteModal(list)\" [alt]=\"\" />\n </div>\n </div>\n <div class=\"pickprtbox\">\n <h2> {{list['route_name']}} </h2>\n <h3><ng-container *ngIf=\"config?.repository === 'coolmap'\">{{list['customer_name']}} </ng-container></h3>\n <div class=\"pickdropprt\">\n <div class=\"pickprt\">\n <b>\n <h4>{{list['pickup_location']?.split('|')[1] ? list['pickup_location'].split('|')[1] : list['pickup_location']}}</h4>\n </b>\n </div>\n <div class=\"dropprt\">\n <b>\n <h4>{{list['delivery_location']?.split('|')[1] ? list['delivery_location'].split('|')[1] : list['delivery_location']}}</h4>\n </b>\n </div>\n </div>\n </div>\n </li>\n </ul>\n <p style=\"color: #fff;\" *ngIf=\"routes.length === 0\">No Route found</p>\n </cdk-virtual-scroll-viewport>\n\n </div>\n\n <div class=\"route_detail\" *ngIf=\"detailsCardEnable\">\n <div class=\"closebtnroutedetail\" (click)=\"detailsCardEnable = false; preventMouseout = false\">\n <mat-icon>clear</mat-icon>\n </div>\n <lib-route-info-card [propData]=\"{className: 'listRoutecard', repository: config['repository']}\" [popupData]=\"routeCardDetail\"></lib-route-info-card>\n <div class=\"createTxt\">\n <small>\n Created by {{routeCardDetail?.created_by_name}} on {{routeCardDetail?.created_at}}\n </small>\n </div>\n </div>\n</div>\n", styles: [".jobcode_detailprt{position:absolute;left:20em;bottom:10px;background:#fff;padding:15px 20px;border-radius:20px;max-width:350px;z-index:999;box-shadow:0 0 5px #0000001a}.jobcode_detailprt .close{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#fff;position:absolute;top:-11px;left:-11px}@keyframes autoslide{to{transform:translate(calc(90vw - 100%))}0%{transform:translate(0)}}.route_listprt .listing_toggle{background:#fff;border-radius:15px;padding:5px;position:absolute;right:10px;top:20px;cursor:pointer}.route_listprt .listing_toggle img{width:28px}.route_listprt .listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px #ffffff14;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0;opacity:0}.route_listprt .listing_box .closebtn{display:none}.route_listprt .listing_box ul{padding:0 20px 0 0}.route_listprt .listing_box ul li{background:#4a4a4a;padding:10px 15px;border-radius:15px;display:flex;margin-bottom:10px;position:relative;height:inherit}@media (min-width: 1600px){.route_listprt .listing_box ul li{padding:6px 15px;margin-bottom:5px}}.route_listprt .listing_box ul li .iconprt{display:flex;flex-direction:column}.route_listprt .listing_box ul li .iconprt span{display:flex;align-items:center;margin-bottom:32px}.route_listprt .listing_box ul li .iconprt span input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.route_listprt .listing_box ul li .iconprt span label{width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.route_listprt .listing_box ul li .iconprt span .border{position:absolute;width:100%;height:100%;left:0;right:0;top:0;border-radius:15px}.route_listprt .listing_box ul li .iconprt span input:checked~.border{border-left:1px solid white;border-right:1px solid white;border-top:1px solid white;border-bottom:1px solid white}.route_listprt .listing_box ul li .iconprt span h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;padding-left:16px;font-size:.9rem;margin-bottom:0;font-weight:400;margin-top:0}.route_listprt .listing_box ul li .iconprt .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px;margin-bottom:7px}.route_listprt .listing_box ul li .iconprt .statusunit:first-letter{font-size:.8rem}.route_listprt .listing_box ul li .iconprt .statusunit.Ton{background:#ff7272}.route_listprt .listing_box ul li .iconprt .statusunit.Load{background:#a3c52e}.route_listprt .listing_box ul li .iconprt .statusunit.Hourly{background:#ae23d1}@media (min-width: 1600px){.route_listprt .listing_box ul li .iconprt .statusunit{line-height:21px}}.route_listprt .listing_box ul li .iconprt .infoicon{z-index:5;cursor:pointer}.route_listprt .listing_box ul li .iconprt .infoicon img{width:20px;height:20px}.route_listprt .listing_box ul li .pickprtbox{margin-left:10px}.route_listprt .listing_box ul li .pickprtbox h2{font-size:.9rem;margin:7px 0 5px;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden}.route_listprt .listing_box ul li h3{font-size:.8rem;color:#979797;font-weight:600;margin-top:0;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden;margin-bottom:5px}.route_listprt .listing_box ul li .pickdropprt{font-size:.75rem}.route_listprt .listing_box ul li .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .pickprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .pickprt b:after{background:#bcbcbc;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .pickprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt .listing_box ul li .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.route_listprt .listing_box ul li .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .dropprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .dropprt b:after{background:#bcbcbc;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.route_listprt .listing_box ul li .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .dropprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt.show .listing_box{width:300px;max-width:300px;-webkit-box-flex:0;flex:0 0 350px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}.route_listprt.show .listing_box h2{color:#fff;white-space:nowrap}.route_listprt.show .listing_box .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px #ffffff14;display:block}.btnprt{display:flex;justify-content:space-between;align-items:center;padding-right:20px}.btnprt h2{margin:0}.btnprt button{font-size:15px;padding:8px 20px;background-color:#326ad3;color:#fff;border:none;border-radius:10px;box-shadow:none;outline:none}.hidden{display:none}.route_detail{background:#282828;position:absolute;width:260px;top:50%;transform:translateY(-50%);right:310px;border-radius:20px;padding:10px;box-shadow:0 0 5px #ffffff36}.createTxt small{color:#fff;font-size:.7rem}.closebtnroutedetail{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5;position:absolute;top:-7px;left:-11px}.routeList-viewport{height:944px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i8.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "component", type: i8.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "component", type: JobRouteListComponent, selector: "app-job-route-list", inputs: ["routes", "selectedRoute", "masterRoutes"], outputs: ["changeNav", "changeRoutes", "changeSelectedRoute"] }, { kind: "component", type: JobcodeStatusComponent, selector: "app-jobcode-status", inputs: ["jobValue"] }, { kind: "component", type: JobcodeOverviewComponent, selector: "app-jobcode-overview", inputs: ["jobValue"] }, { kind: "component", type: RouteInfoCardComponent, selector: "lib-route-info-card", inputs: ["popupData", "propData"] }] });
1130
+ }
1131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: JobCodeComponent, decorators: [{
1132
+ type: Component,
1133
+ args: [{ selector: 'app-job-code', template: "<div class=\"jobcode_detailprt\" (click)=\"isOverlapRouteSection = false\" *ngIf=\"jobdetail\" [ngClass]=\"{'overlap': !isOverlapRouteSection}\" cdkDrag>\n <span class=\"close\"><mat-icon (click)=\"clearJob()\">clear</mat-icon></span>\n <div class=\"job_details_area\">\n <div class=\"detailnameprt\">\n <app-jobcode-status [jobValue]=\"jobdetail\"></app-jobcode-status>\n </div>\n <app-jobcode-overview [jobValue]=\"jobdetail\"></app-jobcode-overview>\n </div>\n</div>\n\n<div class=\"route_listprt\" (click)=\"isOverlapRouteSection = true\" [ngClass]=\"{ 'show': isVisible, 'overlap': isOverlapRouteSection}\">\n <div class=\"listing_toggle\" (click)=\"toggleSidemenu()\">\n <img src=\"assets/images/route.svg\" alt=\"\" />\n </div>\n\n <div class=\"listing_box\">\n <div class=\"closebtn\" (click)=\"toggleSidemenu()\">\n <mat-icon>clear</mat-icon>\n </div>\n\n <div class=\"btnprt\">\n <h2> List of Routes </h2>\n <button (click)=\"masterToggle()\">{{routes && routes.length > 0 && routes.length === selectedRoute.selected.length ? 'Uncheck' : 'Check'}} All</button>\n </div>\n\n <app-job-route-list [routes]=\"routes\" [masterRoutes]=\"masterRoutes\" [selectedRoute]=\"selectedRoute\" (changeRoutes)=\"routes = $event\" (changeSelectedRoute)=\"selectedRoute = $event\"></app-job-route-list>\n <cdk-virtual-scroll-viewport itemSize=\"50\" class=\"routeList-viewport\">\n <ul *ngIf=\"routes['length'] > 0\">\n <li *ngFor=\"let list of routes\">\n <div class=\"iconprt\">\n <span>\n <input type=\"checkbox\" [checked]=\"selectedRoute.isSelected(list)\"\n (change)=\"$event ? selectRoute(list) : null\" /><label>&nbsp;</label>\n <div class=\"border\"></div>\n </span>\n <div class=\"statusunit\" [ngClass]=\"list['unit']\">{{list['unit']}}</div>\n <div class=\"infoicon\">\n <img (mouseenter)=\"togglerouteDetails(true, list)\" (mouseout)=\"togglerouteDetails(false, list, true)\"\n (click)=\"togglerouteDetails('click', list)\" src=\"assets/images/info_icon.png\" [alt]=\"\" />\n </div>\n <div class=\"infoicon\" *ngIf=\"config.repository === 'customer'\">\n <img src=\"assets/images/share_icon.png\" (click)=\"openShareRouteModal(list)\" [alt]=\"\" />\n </div>\n </div>\n <div class=\"pickprtbox\">\n <h2> {{list['route_name']}} </h2>\n <h3><ng-container *ngIf=\"config?.repository === 'coolmap'\">{{list['customer_name']}} </ng-container></h3>\n <div class=\"pickdropprt\">\n <div class=\"pickprt\">\n <b>\n <h4>{{list['pickup_location']?.split('|')[1] ? list['pickup_location'].split('|')[1] : list['pickup_location']}}</h4>\n </b>\n </div>\n <div class=\"dropprt\">\n <b>\n <h4>{{list['delivery_location']?.split('|')[1] ? list['delivery_location'].split('|')[1] : list['delivery_location']}}</h4>\n </b>\n </div>\n </div>\n </div>\n </li>\n </ul>\n <p style=\"color: #fff;\" *ngIf=\"routes.length === 0\">No Route found</p>\n </cdk-virtual-scroll-viewport>\n\n </div>\n\n <div class=\"route_detail\" *ngIf=\"detailsCardEnable\">\n <div class=\"closebtnroutedetail\" (click)=\"detailsCardEnable = false; preventMouseout = false\">\n <mat-icon>clear</mat-icon>\n </div>\n <lib-route-info-card [propData]=\"{className: 'listRoutecard', repository: config['repository']}\" [popupData]=\"routeCardDetail\"></lib-route-info-card>\n <div class=\"createTxt\">\n <small>\n Created by {{routeCardDetail?.created_by_name}} on {{routeCardDetail?.created_at}}\n </small>\n </div>\n </div>\n</div>\n", styles: [".jobcode_detailprt{position:absolute;left:20em;bottom:10px;background:#fff;padding:15px 20px;border-radius:20px;max-width:350px;z-index:999;box-shadow:0 0 5px #0000001a}.jobcode_detailprt .close{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#fff;position:absolute;top:-11px;left:-11px}@keyframes autoslide{to{transform:translate(calc(90vw - 100%))}0%{transform:translate(0)}}.route_listprt .listing_toggle{background:#fff;border-radius:15px;padding:5px;position:absolute;right:10px;top:20px;cursor:pointer}.route_listprt .listing_toggle img{width:28px}.route_listprt .listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px #ffffff14;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0;opacity:0}.route_listprt .listing_box .closebtn{display:none}.route_listprt .listing_box ul{padding:0 20px 0 0}.route_listprt .listing_box ul li{background:#4a4a4a;padding:10px 15px;border-radius:15px;display:flex;margin-bottom:10px;position:relative;height:inherit}@media (min-width: 1600px){.route_listprt .listing_box ul li{padding:6px 15px;margin-bottom:5px}}.route_listprt .listing_box ul li .iconprt{display:flex;flex-direction:column}.route_listprt .listing_box ul li .iconprt span{display:flex;align-items:center;margin-bottom:32px}.route_listprt .listing_box ul li .iconprt span input[type=checkbox]{width:100%;height:100%;margin-right:10px;opacity:0;position:absolute;left:0;margin-left:0;top:0;z-index:3;cursor:pointer}.route_listprt .listing_box ul li .iconprt span label{width:100%;position:relative;z-index:2;font-size:12px;color:#878787;height:100%;position:absolute;top:0;left:0}.route_listprt .listing_box ul li .iconprt span .border{position:absolute;width:100%;height:100%;left:0;right:0;top:0;border-radius:15px}.route_listprt .listing_box ul li .iconprt span input:checked~.border{border-left:1px solid white;border-right:1px solid white;border-top:1px solid white;border-bottom:1px solid white}.route_listprt .listing_box ul li .iconprt span h2{margin-left:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;padding-left:16px;font-size:.9rem;margin-bottom:0;font-weight:400;margin-top:0}.route_listprt .listing_box ul li .iconprt .statusunit{border-radius:30px;font-size:0;color:#fff;text-transform:capitalize;font-weight:500;width:20px;height:20px;text-align:center;line-height:20px;margin-bottom:7px}.route_listprt .listing_box ul li .iconprt .statusunit:first-letter{font-size:.8rem}.route_listprt .listing_box ul li .iconprt .statusunit.Ton{background:#ff7272}.route_listprt .listing_box ul li .iconprt .statusunit.Load{background:#a3c52e}.route_listprt .listing_box ul li .iconprt .statusunit.Hourly{background:#ae23d1}@media (min-width: 1600px){.route_listprt .listing_box ul li .iconprt .statusunit{line-height:21px}}.route_listprt .listing_box ul li .iconprt .infoicon{z-index:5;cursor:pointer}.route_listprt .listing_box ul li .iconprt .infoicon img{width:20px;height:20px}.route_listprt .listing_box ul li .pickprtbox{margin-left:10px}.route_listprt .listing_box ul li .pickprtbox h2{font-size:.9rem;margin:7px 0 5px;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden}.route_listprt .listing_box ul li h3{font-size:.8rem;color:#979797;font-weight:600;margin-top:0;white-space:nowrap;text-overflow:ellipsis;max-width:195px;overflow:hidden;margin-bottom:5px}.route_listprt .listing_box ul li .pickdropprt{font-size:.75rem}.route_listprt .listing_box ul li .pickdropprt .pickprt{position:relative;display:flex;align-items:center;padding-bottom:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .pickprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .pickprt b:after{background:#bcbcbc;width:1px;height:100%;left:3px;content:\"\";position:absolute;top:10px}.route_listprt .listing_box ul li .pickdropprt .pickprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .pickprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt .listing_box ul li .pickdropprt .dropprt{position:relative;padding-bottom:10px;display:flex;align-items:center}.route_listprt .listing_box ul li .pickdropprt .dropprt span{padding-left:0;padding-right:20px;display:block}.route_listprt .listing_box ul li .pickdropprt .dropprt b{position:relative}.route_listprt .listing_box ul li .pickdropprt .dropprt b:after{background:#bcbcbc;width:1px;height:12px;left:3px;content:\"\";position:absolute;top:-7px}.route_listprt .listing_box ul li .pickdropprt .dropprt h4{position:relative;padding-left:15px;margin:0;line-height:18px;color:#bcbcbc;font-weight:400;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.route_listprt .listing_box ul li .pickdropprt .dropprt h4:before{background:#bcbcbc;top:4px;left:0;position:absolute;content:\"\";width:7px;height:7px;border-radius:100%}.route_listprt.show .listing_box{width:300px;max-width:300px;-webkit-box-flex:0;flex:0 0 350px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}.route_listprt.show .listing_box h2{color:#fff;white-space:nowrap}.route_listprt.show .listing_box .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px #ffffff14;display:block}.btnprt{display:flex;justify-content:space-between;align-items:center;padding-right:20px}.btnprt h2{margin:0}.btnprt button{font-size:15px;padding:8px 20px;background-color:#326ad3;color:#fff;border:none;border-radius:10px;box-shadow:none;outline:none}.hidden{display:none}.route_detail{background:#282828;position:absolute;width:260px;top:50%;transform:translateY(-50%);right:310px;border-radius:20px;padding:10px;box-shadow:0 0 5px #ffffff36}.createTxt small{color:#fff;font-size:.7rem}.closebtnroutedetail{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#f5f5f5;position:absolute;top:-7px;left:-11px}.routeList-viewport{height:944px}\n"] }]
1134
+ }], ctorParameters: () => [{ type: i1.UtilsService }, { type: i1.CoolmapService }, { type: i1.CoolmapConfigModel, decorators: [{
1135
+ type: Inject,
1136
+ args: ['memberData']
1137
+ }] }], propDecorators: { jobdetail: [{
1138
+ type: Input
1139
+ }], customerRepoDetails: [{
1140
+ type: Input
1141
+ }], clearJobDetails: [{
1142
+ type: Output
1143
+ }], openShareRoute: [{
1144
+ type: Output
1145
+ }] } });
1146
+
1147
+ class DialogComponent {
1148
+ dialogRef;
1149
+ data;
1150
+ body = 'Are you sure you want to delete?';
1151
+ positive = 'Delete';
1152
+ negative = 'Cancel';
1153
+ constructor(dialogRef, data) {
1154
+ this.dialogRef = dialogRef;
1155
+ this.data = data;
1156
+ ['body', 'positive', 'negative'].map(elem => {
1157
+ if (this.data[elem] !== undefined) {
1158
+ this[elem] = this.data[elem];
1159
+ }
1160
+ });
1161
+ }
1162
+ onClose(result) { this.dialogRef.close(result); }
1163
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
1164
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: DialogComponent, selector: "app-dialog", ngImport: i0, template: "<div class=\"dialogbox\">\n <h2>{{body}}</h2>\n <div class=\"twobtnprt\">\n <button class=\"delbtn\" (click)=\"onClose(true)\">{{positive}}</button>\n <button class=\"closebtn\" (click)=\"onClose(false)\">{{negative}}</button>\n </div>\n</div>\n", styles: [".dialogbox{display:flex;flex-direction:column}.dialogbox h2{font-size:1.5rem}.dialogbox .twobtnprt{display:flex;justify-content:center;margin-top:10px}.closebtn{background:#000;color:#fff;border-radius:30px;padding:10px 18px;margin:0 10px;font-size:1rem}.delbtn{background:red;color:#fff;border-radius:30px;padding:10px 18px;margin:0 10px;font-size:1rem}\n"] });
1165
+ }
1166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DialogComponent, decorators: [{
1167
+ type: Component,
1168
+ args: [{ selector: 'app-dialog', template: "<div class=\"dialogbox\">\n <h2>{{body}}</h2>\n <div class=\"twobtnprt\">\n <button class=\"delbtn\" (click)=\"onClose(true)\">{{positive}}</button>\n <button class=\"closebtn\" (click)=\"onClose(false)\">{{negative}}</button>\n </div>\n</div>\n", styles: [".dialogbox{display:flex;flex-direction:column}.dialogbox h2{font-size:1.5rem}.dialogbox .twobtnprt{display:flex;justify-content:center;margin-top:10px}.closebtn{background:#000;color:#fff;border-radius:30px;padding:10px 18px;margin:0 10px;font-size:1rem}.delbtn{background:red;color:#fff;border-radius:30px;padding:10px 18px;margin:0 10px;font-size:1rem}\n"] }]
1169
+ }], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1170
+ type: Inject,
1171
+ args: [MAT_DIALOG_DATA]
1172
+ }] }] });
1173
+
1174
+ class EstimationDisplayComponent {
1175
+ value;
1176
+ label = EstinationData;
1177
+ Estinationlabel = EstinationEnum;
1178
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EstimationDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1179
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: EstimationDisplayComponent, selector: "app-estimation-display", inputs: { value: "value" }, ngImport: i0, template: "<div class=\"d-flex\">\n <ng-container *ngFor=\"let item of label\">\n <span *ngIf=\"value[item]\" class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Estimation of {{Estinationlabel[item]}} - <b>{{value[item]}}</b>\n </span>\n </ng-container>\n</div>\n", styles: [".estimate{margin-right:20px;font-size:.7rem}@media (min-width: 1600px){.estimate{font-size:.95rem}}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1180
+ }
1181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EstimationDisplayComponent, decorators: [{
1182
+ type: Component,
1183
+ args: [{ selector: 'app-estimation-display', template: "<div class=\"d-flex\">\n <ng-container *ngFor=\"let item of label\">\n <span *ngIf=\"value[item]\" class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Estimation of {{Estinationlabel[item]}} - <b>{{value[item]}}</b>\n </span>\n </ng-container>\n</div>\n", styles: [".estimate{margin-right:20px;font-size:.7rem}@media (min-width: 1600px){.estimate{font-size:.95rem}}\n"] }]
1184
+ }], propDecorators: { value: [{
1185
+ type: Input
1186
+ }] } });
1187
+
1188
+ class SearchoptiongroupComponent {
1189
+ searchConfig;
1190
+ onUpdatePickUpSearchOption = new EventEmitter();
1191
+ get searchOption() {
1192
+ return this.searchConfig.form.get(this.searchConfig.controlname);
1193
+ }
1194
+ changeSearchOption(value) {
1195
+ this.onUpdatePickUpSearchOption.emit(value);
1196
+ }
1197
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchoptiongroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1198
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchoptiongroupComponent, selector: "lib-searchoptiongroup", inputs: { searchConfig: "searchConfig" }, outputs: { onUpdatePickUpSearchOption: "onUpdatePickUpSearchOption" }, ngImport: i0, template: "<div class=\"selected_prt\">\n <mat-radio-group aria-label=\"Select an option\" [formControl]=\"searchOption\" (change)=\"changeSearchOption($event)\">\n <mat-radio-button value=\"system\">System Search</mat-radio-button>\n <mat-radio-button value=\"google\">Google Search</mat-radio-button>\n </mat-radio-group>\n</div>", styles: [".selected_prt{margin:0}\n"], dependencies: [{ kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i2$1.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color"], outputs: ["change"], exportAs: ["matRadioButton"] }] });
1199
+ }
1200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchoptiongroupComponent, decorators: [{
1201
+ type: Component,
1202
+ args: [{ selector: 'lib-searchoptiongroup', template: "<div class=\"selected_prt\">\n <mat-radio-group aria-label=\"Select an option\" [formControl]=\"searchOption\" (change)=\"changeSearchOption($event)\">\n <mat-radio-button value=\"system\">System Search</mat-radio-button>\n <mat-radio-button value=\"google\">Google Search</mat-radio-button>\n </mat-radio-group>\n</div>", styles: [".selected_prt{margin:0}\n"] }]
1203
+ }], propDecorators: { searchConfig: [{
1204
+ type: Input
1205
+ }], onUpdatePickUpSearchOption: [{
1206
+ type: Output
1207
+ }] } });
1208
+
1209
+ class AddRouteComponent {
1210
+ coolMapService;
1211
+ utils;
1212
+ dialog;
1213
+ config;
1214
+ filterPickup;
1215
+ filterDelivery;
1216
+ pickup_system_location;
1217
+ delivery_system_location;
1218
+ changeNav = new EventEmitter();
1219
+ updateRouteList = new EventEmitter();
1220
+ pickupOptions;
1221
+ deliveryOptions;
1222
+ requestParmsForRouteDetails = { pickup_lat_lng: '', delivery_lat_lng: '' };
1223
+ customersList = [];
1224
+ unitsList = [];
1225
+ addRouteForm;
1226
+ routeData;
1227
+ customerRepoDetails;
1228
+ routeId;
1229
+ preventSave = false;
1230
+ preventInitialSave = false;
1231
+ customersList$;
1232
+ routeDetails;
1233
+ destroyer$ = new Subject();
1234
+ popupDetails;
1235
+ enablePopUp = false;
1236
+ prevantPopupClose = false;
1237
+ enableForm = false;
1238
+ locationList;
1239
+ cdr = inject(ChangeDetectorRef);
1240
+ get isSystemPickup() {
1241
+ return this.addRouteForm.get('pickUpSearchOption')?.value === 'system';
1242
+ }
1243
+ get isSystemDelivery() {
1244
+ return this.addRouteForm.get('deliverySearchOtption')?.value === 'system';
1245
+ }
1246
+ constructor(coolMapService, utils, dialog, config) {
1247
+ this.coolMapService = coolMapService;
1248
+ this.utils = utils;
1249
+ this.dialog = dialog;
1250
+ this.config = config;
1251
+ this.utils.fetchUnitsList().then((res) => {
1252
+ this.unitsList = res;
1253
+ });
1254
+ this.formInit();
1255
+ this.utils.getrouteDetailsUtility.subscribe(res => {
1256
+ if (res) {
1257
+ if (res['event'] !== 'click' && !this.prevantPopupClose) {
1258
+ this.enablePopUp = res['event'];
1259
+ }
1260
+ else if (this.enablePopUp && !this.prevantPopupClose) {
1261
+ this.prevantPopupClose = true;
1262
+ }
1263
+ if (res['event'] !== 'click' && !res['event'] && this.prevantPopupClose) {
1264
+ this.popupDetails = this.utils.getdictValue('route-detailsv2');
1265
+ }
1266
+ else {
1267
+ this.popupDetails = res['route'];
1268
+ }
1269
+ if (this.enablePopUp)
1270
+ this.popupDetails['created_at'] = this.utils.getDateFormat(new Date(this.popupDetails['created_at']), '/');
1271
+ }
1272
+ });
1273
+ }
1274
+ filterCustomerList() {
1275
+ this.customersList$ = this.addRouteForm.controls['customer_name'].valueChanges.pipe(startWith(''), map(value => this._filter((value || ''), this.customersList, 'customer_name')));
1276
+ }
1277
+ _filter(value, list, prop) {
1278
+ const filterValue = value.toLowerCase();
1279
+ return list.filter((option) => option[prop].toLowerCase().includes(filterValue));
1280
+ }
1281
+ ngOnChanges(changes) {
1282
+ if (changes['routeData'] && !changes['routeData']['currentValue'])
1283
+ this.inIt(null);
1284
+ }
1285
+ openDialog() {
1286
+ const dialogRef = this.dialog.open(DialogComponent, {
1287
+ data: { body: 'Are you sure you want to delete this route?' },
1288
+ });
1289
+ dialogRef.afterClosed().subscribe(res => { if (res) {
1290
+ this.deleteRoute();
1291
+ } });
1292
+ }
1293
+ editEvent() {
1294
+ this.prevantPopupClose = false;
1295
+ this.enableForm = true;
1296
+ this.enablePopUp = false;
1297
+ this.popupDetails['prevent'] = false;
1298
+ this.utils.removeMapEntity.next(this.popupDetails);
1299
+ this.inIt(this.popupDetails);
1300
+ }
1301
+ inIt(changes) {
1302
+ if (changes) {
1303
+ if (!changes['prevent']) {
1304
+ this.preventSave = false;
1305
+ this.formControlValue();
1306
+ this.patchFormValue(changes).then(() => {
1307
+ this.checkAndFetchRouteInformation(true);
1308
+ });
1309
+ }
1310
+ }
1311
+ if (!changes) {
1312
+ this.enableForm = true;
1313
+ this.preventSave = true;
1314
+ this.patchFormValue().then(() => {
1315
+ this.checkAndFetchRouteInformation();
1316
+ });
1317
+ }
1318
+ }
1319
+ ngOnInit() {
1320
+ this.formControlValue();
1321
+ if (this.config.repository === 'customer') {
1322
+ this.addRouteForm.patchValue({
1323
+ customer_id: this.customerRepoDetails.customer.id,
1324
+ customer_name: this.customerRepoDetails.customer.name,
1325
+ });
1326
+ }
1327
+ else {
1328
+ this.utils.fetchCustomersList().then((res) => {
1329
+ this.customersList = res;
1330
+ this.filterCustomerList();
1331
+ this.addRouteForm.controls['customer_name'].enable();
1332
+ });
1333
+ if (this.config.repository === 'coolmap') {
1334
+ this.utils.fetchLocationlist().then((res) => {
1335
+ this.locationList = res;
1336
+ this.pickupOptions = this.createAddressFilter('pickup_location', this.locationList, 'formatted_address');
1337
+ this.deliveryOptions = this.createAddressFilter('delivery_location', this.locationList, 'formatted_address');
1338
+ });
1339
+ }
1340
+ }
1341
+ }
1342
+ formPickUpFilter() {
1343
+ fromEvent(this.filterPickup.nativeElement, 'keyup')
1344
+ .pipe(distinctUntilChanged(), debounceTime(150), takeUntil(this.destroyer$))
1345
+ .subscribe(() => {
1346
+ this.utils
1347
+ .autocomplete(this.filterPickup)
1348
+ .then((res) => {
1349
+ if (res) {
1350
+ this.patchAddressValue(res, 'pickup');
1351
+ }
1352
+ });
1353
+ });
1354
+ }
1355
+ formDeliveryFilter() {
1356
+ fromEvent(this.filterDelivery.nativeElement, 'keyup')
1357
+ .pipe(distinctUntilChanged(), debounceTime(150))
1358
+ .pipe(takeUntil(this.destroyer$))
1359
+ .subscribe(() => {
1360
+ this.utils.autocomplete(this.filterDelivery).then((res) => {
1361
+ if (res) {
1362
+ this.patchAddressValue(res, 'delivery');
1363
+ }
1364
+ });
1365
+ });
1366
+ }
1367
+ createAddressFilter(control, list, prop) {
1368
+ return this.addRouteForm.get(control).valueChanges.pipe(startWith(''), map(value => value === '' ? list : this._filter((value || ''), this.locationList, prop)));
1369
+ }
1370
+ ngAfterViewInit() {
1371
+ this.formPickUpFilter();
1372
+ this.formDeliveryFilter();
1373
+ }
1374
+ patchAddressValue(data, type) {
1375
+ setTimeout(() => {
1376
+ this.addRouteForm.patchValue({
1377
+ [type + '_location']: data['formatted_address'],
1378
+ [type + '_lat_lng']: `${data['lat']},${data['lng']}`
1379
+ });
1380
+ this.addRouteForm.updateValueAndValidity();
1381
+ if (type === 'pickup')
1382
+ this.coolMapService.clearBoundWithCordinates();
1383
+ this.checkAndFetchRouteInformation();
1384
+ }, 100);
1385
+ }
1386
+ updateDeliveryField() {
1387
+ this.addRouteForm.patchValue({
1388
+ delivery_location: null,
1389
+ delivery_lat_lng: null
1390
+ });
1391
+ }
1392
+ updatePickUpField() {
1393
+ this.addRouteForm.patchValue({
1394
+ pickup_location: null,
1395
+ pickup_lat_lng: null
1396
+ });
1397
+ }
1398
+ formControlValue() {
1399
+ this.addRouteForm.get('pickup_location')?.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1400
+ const rawFormvalue = this.addRouteForm.getRawValue();
1401
+ if ((rawFormvalue.pickup_location && res) !== rawFormvalue.pickup_location) {
1402
+ this.addRouteForm.patchValue({ pickup_lat_lng: '' });
1403
+ this.addRouteForm.controls['pickup_lat_lng'].markAsTouched();
1404
+ }
1405
+ });
1406
+ this.addRouteForm.get('delivery_location')?.valueChanges.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1407
+ const rawFormvalue = this.addRouteForm.getRawValue();
1408
+ if ((rawFormvalue.delivery_location && res) !== rawFormvalue.delivery_location) {
1409
+ this.addRouteForm.patchValue({ delivery_lat_lng: '' });
1410
+ this.addRouteForm.controls['delivery_lat_lng'].markAsTouched();
1411
+ }
1412
+ });
1413
+ }
1414
+ formInit() {
1415
+ this.addRouteForm = new FormGroup({
1416
+ route_name: new FormControl('', [Validators.required]),
1417
+ customer_name: new FormControl({ value: '', disabled: true }, [Validators.required]),
1418
+ customer_id: new FormControl(''),
1419
+ unit_id: new FormControl('', [Validators.required]),
1420
+ path: new FormControl('', [Validators.required]),
1421
+ pickup_location: new FormControl('', [Validators.required]),
1422
+ pickup_lat_lng: new FormControl('', [Validators.required]),
1423
+ delivery_location: new FormControl('', [Validators.required]),
1424
+ delivery_lat_lng: new FormControl('', [Validators.required]),
1425
+ estimated_distance: new FormControl('', [Validators.required]),
1426
+ estimated_time: new FormControl('', [Validators.required]),
1427
+ note: new FormControl('', [Validators.maxLength(2048)]),
1428
+ trucker_pay_estimate: new FormControl(null),
1429
+ customer_price_estimate: new FormControl(null),
1430
+ pickUpSearchOption: new FormControl(''),
1431
+ deliverySearchOtption: new FormControl(''),
1432
+ });
1433
+ }
1434
+ async patchFormValue(data) {
1435
+ this.addRouteForm.reset();
1436
+ const isCustomerRepo = this.config.repository === 'customer';
1437
+ this.addRouteForm.patchValue(data);
1438
+ if (isCustomerRepo) {
1439
+ this.addRouteForm.patchValue({
1440
+ customer_id: this.customerRepoDetails.customer.id,
1441
+ customer_name: this.customerRepoDetails.customer.name,
1442
+ });
1443
+ }
1444
+ else {
1445
+ this.addRouteForm.patchValue({
1446
+ pickUpSearchOption: (!data || data.is_system_pickup) ? 'system' : 'google',
1447
+ deliverySearchOtption: (!data || data.is_system_delivery) ? 'system' : 'google',
1448
+ });
1449
+ }
1450
+ this.routeId = data?.route_id;
1451
+ this.routeDetails = data
1452
+ ? {
1453
+ pickup_location: data.pickup_location,
1454
+ delivery_location: data.delivery_location,
1455
+ }
1456
+ : null;
1457
+ this.addRouteForm.valueChanges
1458
+ .pipe(takeUntil(this.destroyer$), pairwise(), filter(([prev, curr]) => {
1459
+ return (prev.pickUpSearchOption === curr.pickUpSearchOption) &&
1460
+ prev.deliverySearchOtption === curr.deliverySearchOtption;
1461
+ })).subscribe(() => {
1462
+ if (this.preventInitialSave) {
1463
+ this.preventInitialSave = false;
1464
+ }
1465
+ });
1466
+ this.filterCustomerList();
1467
+ await true;
1468
+ }
1469
+ patchLocation(data, key) {
1470
+ const location = this.locationList.find((location) => (this.getFormatedAddress(location)?.trim() === data[key].trim()));
1471
+ if (location) {
1472
+ this.addRouteForm.patchValue({
1473
+ [key]: `${location.name} | ${data[key]}`,
1474
+ });
1475
+ }
1476
+ else {
1477
+ this.addRouteForm.patchValue({
1478
+ [key]: data[key],
1479
+ });
1480
+ }
1481
+ }
1482
+ getFormatedAddress(object) {
1483
+ return `${object.street} ${object.city}, ${object.state} ${object.zip}`;
1484
+ }
1485
+ checkAndFetchRouteInformation(isinitial) {
1486
+ if (this.addRouteForm.value?.delivery_lat_lng?.length > 0 && this.addRouteForm.value?.pickup_lat_lng?.length > 0 && this.addRouteForm.value.unit_id) {
1487
+ let unit = this.unitsList.find((x) => x.id === this.addRouteForm.value.unit_id);
1488
+ const param = {
1489
+ delivery_lat_lng: this.addRouteForm.value.delivery_lat_lng,
1490
+ pickup_lat_lng: this.addRouteForm.value.pickup_lat_lng,
1491
+ unit: unit?.type
1492
+ };
1493
+ this.utils.postdata('calculate/routes/estimation', param).pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1494
+ if (res && res['path']) {
1495
+ this.addRouteForm.patchValue({
1496
+ estimated_distance: res['dist'],
1497
+ estimated_time: res['time'],
1498
+ path: res['path'],
1499
+ trucker_pay_estimate: res['trucker_haul_cost'],
1500
+ customer_price_estimate: res['customer_price_estimate']
1501
+ });
1502
+ let path = res['path'].split(';');
1503
+ path = path.map((ele) => { return ele = this.formateLatLong(ele); });
1504
+ res['path'] = path;
1505
+ const element = {
1506
+ type: 'FeatureCollection',
1507
+ features: [{ type: 'Feature', properties: {}, geometry: { type: 'LineString', coordinates: res['path'] } }]
1508
+ };
1509
+ this.coolMapService.removeRouteAndMarker(1).then(() => {
1510
+ const unit = this.unitsList.find((x) => x.id === this.addRouteForm.value.unit_id);
1511
+ const rawFormvalue = this.addRouteForm.getRawValue();
1512
+ this.coolMapService.loadMapProperty(element, 1, unit?.type, {
1513
+ pickup_location: rawFormvalue.pickup_location,
1514
+ delivery_location: rawFormvalue.delivery_location,
1515
+ route_name: rawFormvalue.route_name,
1516
+ unit: unit?.type
1517
+ }).then((res) => { this.preventSave = true; });
1518
+ });
1519
+ }
1520
+ else {
1521
+ this.coolMapService.removeRouteAndMarker(1);
1522
+ this.preventSave = true;
1523
+ this.utils.openSnackBar((res['status']
1524
+ ? res['status'] :
1525
+ 'Somthing went wrong, Please try different address.'), 'error');
1526
+ }
1527
+ if (this.routeId && isinitial)
1528
+ this.preventInitialSave = true;
1529
+ });
1530
+ }
1531
+ else {
1532
+ this.coolMapService.removeRouteAndMarker(1);
1533
+ }
1534
+ }
1535
+ formateLatLong(latlong) { return latlong ? latlong.split(',').map(x => +x).reverse() : null; }
1536
+ saveRoute() {
1537
+ if (this.addRouteForm.valid) {
1538
+ this.preventSave = false;
1539
+ const data = this.addRouteForm.getRawValue();
1540
+ if (this.config.repository === 'coolmap') {
1541
+ data.is_system_delivery = data.deliverySearchOtption === 'system' ? 1 : 0;
1542
+ data.is_system_pickup = data.pickUpSearchOption === 'system' ? 1 : 0;
1543
+ }
1544
+ delete data.pickUpSearchOption;
1545
+ delete data.deliverySearchOtption;
1546
+ const url = this.routeId ? this.utils.postdata('update/routes', data) : this.utils.postdata('add/routes', data);
1547
+ if (this.routeId)
1548
+ data['id'] = this.routeId;
1549
+ url.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
1550
+ if (res.success) {
1551
+ this.updateRouteList.emit(true);
1552
+ this.utils.openSnackBar(res.message, 'success');
1553
+ this.preventInitialSave = true;
1554
+ this.preventSave = true;
1555
+ if (!this.routeId)
1556
+ this.changeNav.next('Addroute');
1557
+ }
1558
+ else {
1559
+ this.utils.openSnackBar(res.message, 'error');
1560
+ this.preventSave = true;
1561
+ }
1562
+ }, (err) => { if (err) {
1563
+ this.preventSave = true;
1564
+ } });
1565
+ }
1566
+ else {
1567
+ this.addRouteForm.markAllAsTouched();
1568
+ }
1569
+ }
1570
+ deleteRoute() {
1571
+ this.preventSave = false;
1572
+ this.utils.postdata('delete/routes', { uuid: this.routeId }).subscribe(res => {
1573
+ if (res['data']['success']) {
1574
+ this.utils.openSnackBar(res['data']['message'], 'success');
1575
+ this.updateRouteList.emit(true);
1576
+ this.changeNav.next('Addroute');
1577
+ this.preventInitialSave = true;
1578
+ this.preventSave = true;
1579
+ }
1580
+ else {
1581
+ this.utils.openSnackBar('Somthing went wrong', 'error');
1582
+ this.preventSave = true;
1583
+ }
1584
+ }, (err) => { this.preventSave = true; });
1585
+ }
1586
+ ngOnDestroy() {
1587
+ this.destroyer$.next(true);
1588
+ this.destroyer$.unsubscribe();
1589
+ }
1590
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddRouteComponent, deps: [{ token: i1.CoolmapService }, { token: i1.UtilsService }, { token: i1$1.MatDialog }, { token: 'memberData' }], target: i0.ɵɵFactoryTarget.Component });
1591
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: AddRouteComponent, selector: "app-add-route", inputs: { routeData: "routeData", customerRepoDetails: "customerRepoDetails" }, outputs: { changeNav: "changeNav", updateRouteList: "updateRouteList" }, viewQueries: [{ propertyName: "filterPickup", first: true, predicate: ["filterPickup"], descendants: true }, { propertyName: "filterDelivery", first: true, predicate: ["filterDelivery"], descendants: true }, { propertyName: "pickup_system_location", first: true, predicate: ["pickup_system_location"], descendants: true }, { propertyName: "delivery_system_location", first: true, predicate: ["delivery_system_location"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"addroutebox\">\n <div class=\"routedetailbox\" *ngIf=\"enablePopUp\">\n <div class=\"closebtnroutedetail\">\n <mat-icon (click)=\"prevantPopupClose = false; enablePopUp = false;\">clear</mat-icon>\n </div>\n <lib-route-info-card [propData]=\"{className: 'routeCard', repository: config['repository']}\" [popupData]=\"popupDetails\"></lib-route-info-card>\n <div class=\"createTxt\">\n <small>\n Created by {{popupDetails['created_by_name']}} on {{popupDetails['created_at']}}\n </small>\n <button class=\"editbtn\" (click)=\"editEvent()\">Edit</button>\n </div>\n </div>\n <div class=\"add_add_route_box\" cdkDrag [style.visibility]=\"!enableForm ? 'hidden' : 'visible'\">\n <div class=\"topheadingprt\">\n <h2> {{routeId? 'EDIT' : 'ADD'}} ROUTE </h2>\n <div class=\"buttonprt\">\n <button *ngIf=\"routeId\" class=\"delbtn\" (click)=\"openDialog()\">Delete</button>\n <button mat-raised-button type=\"submit\" class=\"closebtn\" (click)=\"changeNav.next('Addroute')\">Close</button>\n </div>\n </div>\n <form [formGroup]=\"addRouteForm\">\n <div class=\"route_form_area\">\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Route Name</mat-label>\n <input matInput formControlName=\"route_name\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\">\n <mat-error *ngIf=\"addRouteForm.controls['route_name'].hasError('required')\">\n Route Name is required\n </mat-error>\n </mat-form-field>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Customer name</mat-label>\n <input type=\"text\" placeholder=\"Customer Name\" matInput formControlName=\"customer_name\" [matAutocomplete]=\"auto\" (mousedown)=\"$event.stopPropagation()\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let customer of customersList$ | async\" [value]=\"customer['customer_name']\">\n {{customer['customer_name']}}\n </mat-option>\n </mat-autocomplete>\n <mat-error *ngIf=\"addRouteForm.controls['customer_name'].hasError('required')\">\n Customer name is required.\n </mat-error>\n </mat-form-field>\n </div>\n <div class=\"col-6\">\n <div class=\"wrap-box\">\n @if (config.repository === 'coolmap') {\n <lib-searchoptiongroup\n [searchConfig]=\"{form: addRouteForm, controlname: 'pickUpSearchOption'}\"\n (onUpdatePickUpSearchOption)=\"updatePickUpField()\"/>\n }\n <div class=\"col-12\">\n <mat-form-field [style.display]=\"isSystemPickup ? 'block' : 'none'\">\n <mat-label>Pickup</mat-label>\n <input type=\"text\"\n placeholder=\"Search...\" matInput formControlName=\"pickup_location\"\n (mousedown)=\"$event.stopPropagation()\" [matAutocomplete]=\"autopickUpList\"\n id=\"pickup_system_location\">\n <mat-autocomplete #autopickUpList=\"matAutocomplete\" class=\"list_panel\">\n <mat-option *ngFor=\"let name of pickupOptions | async\"\n (onSelectionChange)=\"patchAddressValue(name, 'pickup')\">\n {{ name.formatted_address }}\n </mat-option>\n </mat-autocomplete>\n <mat-error\n *ngIf=\"addRouteForm.controls['pickup_lat_lng'].touched && addRouteForm.controls['pickup_lat_lng'].hasError('required')\">\n Please select pickup location from the list.\n </mat-error>\n </mat-form-field>\n <mat-form-field [style.display]=\"isSystemPickup ? 'none' : 'block'\">\n <mat-label>Pickup</mat-label>\n <input type=\"text\"\n placeholder=\"Search...\" matInput \n formControlName=\"pickup_location\"\n (mousedown)=\"$event.stopPropagation()\"\n #filterPickup id=\"pickup_google_location\">\n <mat-error\n *ngIf=\"addRouteForm.controls['pickup_lat_lng'].touched && addRouteForm.controls['pickup_lat_lng'].hasError('required')\">\n Please select pickup location from the list.\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n </div>\n <div class=\"col-6\">\n <div class=\"wrap-box\">\n @if (config.repository === 'coolmap') {\n <lib-searchoptiongroup \n [searchConfig]=\"{form: addRouteForm, controlname: 'deliverySearchOtption'}\"\n (onUpdatePickUpSearchOption)=\"updateDeliveryField()\"/>\n }\n <div class=\"col-12\">\n <mat-form-field [style.display]=\"isSystemDelivery ? 'none' : 'block'\">\n <mat-label>Delivery</mat-label>\n <div>\n <input type=\"text\"\n placeholder=\"Search...\"\n matInput #filterDelivery\n formControlName=\"delivery_location\"\n (mousedown)=\"$event.stopPropagation()\"\n id=\"delivery_google_location\">\n </div>\n <mat-error *ngIf=\"addRouteForm.controls['delivery_lat_lng'].touched && addRouteForm.controls['delivery_lat_lng'].hasError('required')\">\n Please select delivery location from the list.\n </mat-error>\n </mat-form-field>\n <mat-form-field [style.display]=\"isSystemDelivery ? 'block' : 'none'\">\n <mat-label>Delivery</mat-label>\n <div>\n <input type=\"text\" placeholder=\"Search...\" matInput formControlName=\"delivery_location\"\n (mousedown)=\"$event.stopPropagation()\" [matAutocomplete]=\"autoDeliveryList\"\n id=\"delivery_system_location\">\n <mat-autocomplete #autoDeliveryList=\"matAutocomplete\" class=\"list_panel\">\n <mat-option *ngFor=\"let name of deliveryOptions | async\"\n (onSelectionChange)=\"patchAddressValue(name, 'delivery')\">\n {{ name.formatted_address }}\n </mat-option>\n </mat-autocomplete>\n </div>\n <mat-error *ngIf=\"addRouteForm.controls['delivery_lat_lng'].touched && addRouteForm.controls['delivery_lat_lng'].hasError('required')\">\n Please select delivery location from the list.\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Notes</mat-label>\n <textarea style=\"height: 18px; resize: none;\" matInput name=\"\" id=\"\" cols=\"30\" rows=\"10\" formControlName=\"note\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\"></textarea>\n <mat-error *ngIf=\"addRouteForm.controls['note'].hasError('maxlength')\">\n Notes should be within 2048 characters.\n </mat-error>\n </mat-form-field>\n </div>\n\n <div class=\"col-6 d-flex\">\n <div class=\"inputbox m-0\">\n <mat-form-field>\n <mat-label>Unit type</mat-label>\n <mat-select formControlName=\"unit_id\" (selectionChange)=\"checkAndFetchRouteInformation()\" (mousedown)=\"$event.stopPropagation()\">\n <mat-option *ngFor=\"let unit of unitsList\" [value]=\"unit?.id\"> {{unit?.type}} </mat-option>\n </mat-select>\n <mat-error *ngIf=\"addRouteForm.controls['unit_id'].hasError('required')\">\n Unit is required\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n <div class=\"col-6\">\n <app-estimation-display *ngIf=\"addRouteForm?.value?.pickup_lat_lng && addRouteForm?.value?.delivery_lat_lng\" [value]=\"addRouteForm['value']\"></app-estimation-display>\n </div>\n <div class=\"col-6\" *ngIf=\"addRouteForm['value']['trucker_pay_estimate'] && addRouteForm['value']['customer_price_estimate']\">\n <span *ngIf=\"config['repository'] !== 'customer'\" class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Trucker Pay Estimate - <b>{{'$'+ addRouteForm['value']['trucker_pay_estimate']}}</b>\n </span>\n <span class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Customer Price Estimate - <b>{{'$'+ addRouteForm['value']['customer_price_estimate']}}</b>\n </span>\n </div>\n <button mat-raised-button type=\"submit\" (click)=\"saveRoute()\" *ngIf=\"preventSave\"\n [disabled]=\"addRouteForm.invalid && preventSave || preventInitialSave\">{{routeId? 'Update' : 'Save'}}\n </button>\n <div class=\"loader\">\n <mat-spinner *ngIf=\"!preventSave\"></mat-spinner>\n </div>\n </div>\n </form>\n </div>\n</div>\n", styles: [".addroutebox{width:calc(100% - 340px);position:absolute;left:320px;bottom:10px;display:flex;justify-content:space-between;align-items:flex-start}.addroutebox .routedetailbox{max-width:300px;padding:10px;background-color:#fff;border-radius:20px;margin-right:20px}@media (min-width: 1600px){.addroutebox .routedetailbox{max-width:280px}}.addroutebox .editbtn{background:#326ad3;padding:10px 25px;color:#fff;font-size:.8125rem;border-radius:30px;float:right}.add_add_route_box{background:#fff;padding:10px 20px;border-radius:20px;box-shadow:2px 4px 4px 2px #00000024;width:100%;position:relative;cursor:move}.add_add_route_box .route_form_area{display:flex;flex-wrap:wrap;justify-content:space-between}.add_add_route_box .route_form_area .col-6{width:48%;margin-top:10px;justify-content:space-between}.add_add_route_box .route_form_area .col-6 .inputbox{width:47%}.add_add_route_box .route_form_area .col-6 span{font-size:.875rem}.add_add_route_box .route_form_area button{background:#326ad3;padding:0 18px;color:#fff;font-size:.8125rem;border-radius:30px;position:absolute;right:18px;top:20px;height:35px}.closebtn{background:#000;color:#fff;border-radius:30px;padding:0 18px;margin-left:10px;height:35px}.delbtn{background:red;color:#fff;border-radius:30px;padding:10px 18px}.add_route_listingpart .listing_toggle{background:#fff;border-radius:15px;padding:8px 10px;position:absolute;right:10px;top:30px;cursor:pointer}.listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px #ffffff14;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0 40px;opacity:0}.listing_box .closebtn{display:none}.show .listing_box{width:250px;max-width:250px;-webkit-box-flex:0;flex:0 0 250px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}@media (min-width: 1600px){.show .listing_box{width:320px;max-width:320px;-webkit-box-flex:0;flex:0 0 320px}}.show .listing_box h2{color:#fff;white-space:nowrap}.show .listing_box ul{padding:0 20px 0 0}.show .listing_box ul li{background:#4a4a4a;padding:15px;border-radius:15px;display:flex;margin-bottom:15px}.show .listing_box ul li .companayIcon{width:40px;height:40px;border-radius:10px;background:#fff;margin-right:10px;display:flex;justify-content:center;align-items:center}.show .listing_box ul li .company_cont{width:calc(100% - 50px)}.show .listing_box ul li .company_cont h3{color:#fff;font-size:15px;font-weight:400;margin:0;text-overflow:ellipsis;max-width:129px;-webkit-box-orient:vertical;white-space:nowrap;overflow:hidden}@media (min-width: 1600px){.show .listing_box ul li .company_cont h3{max-width:170px}}.show .listing_box ul li .company_cont p{color:#bcbcbc;font-size:12px;margin:5px 0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:16px}.show .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px #ffffff14;display:block}.loader{position:absolute;width:95%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:none}.buttonprt{margin-right:83px}.closebtnroutedetail{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#fff;position:absolute;top:-11px;left:-11px}.routenotes{max-height:170px;overflow:auto}.estimate{margin-right:20px;font-size:.7rem}@media (min-width: 1600px){.estimate{font-size:.95rem}}.wrap-box{background:#f3f3f3;padding:10px 20px;border-radius:15px;border:1px solid #dadada;margin-bottom:20px}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i3$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i8$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i8$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i7$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i10.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: EstimationDisplayComponent, selector: "app-estimation-display", inputs: ["value"] }, { kind: "component", type: RouteInfoCardComponent, selector: "lib-route-info-card", inputs: ["popupData", "propData"] }, { kind: "component", type: SearchoptiongroupComponent, selector: "lib-searchoptiongroup", inputs: ["searchConfig"], outputs: ["onUpdatePickUpSearchOption"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] });
1592
+ }
1593
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddRouteComponent, decorators: [{
1594
+ type: Component,
1595
+ args: [{ selector: 'app-add-route', template: "<div class=\"addroutebox\">\n <div class=\"routedetailbox\" *ngIf=\"enablePopUp\">\n <div class=\"closebtnroutedetail\">\n <mat-icon (click)=\"prevantPopupClose = false; enablePopUp = false;\">clear</mat-icon>\n </div>\n <lib-route-info-card [propData]=\"{className: 'routeCard', repository: config['repository']}\" [popupData]=\"popupDetails\"></lib-route-info-card>\n <div class=\"createTxt\">\n <small>\n Created by {{popupDetails['created_by_name']}} on {{popupDetails['created_at']}}\n </small>\n <button class=\"editbtn\" (click)=\"editEvent()\">Edit</button>\n </div>\n </div>\n <div class=\"add_add_route_box\" cdkDrag [style.visibility]=\"!enableForm ? 'hidden' : 'visible'\">\n <div class=\"topheadingprt\">\n <h2> {{routeId? 'EDIT' : 'ADD'}} ROUTE </h2>\n <div class=\"buttonprt\">\n <button *ngIf=\"routeId\" class=\"delbtn\" (click)=\"openDialog()\">Delete</button>\n <button mat-raised-button type=\"submit\" class=\"closebtn\" (click)=\"changeNav.next('Addroute')\">Close</button>\n </div>\n </div>\n <form [formGroup]=\"addRouteForm\">\n <div class=\"route_form_area\">\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Route Name</mat-label>\n <input matInput formControlName=\"route_name\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\">\n <mat-error *ngIf=\"addRouteForm.controls['route_name'].hasError('required')\">\n Route Name is required\n </mat-error>\n </mat-form-field>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Customer name</mat-label>\n <input type=\"text\" placeholder=\"Customer Name\" matInput formControlName=\"customer_name\" [matAutocomplete]=\"auto\" (mousedown)=\"$event.stopPropagation()\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let customer of customersList$ | async\" [value]=\"customer['customer_name']\">\n {{customer['customer_name']}}\n </mat-option>\n </mat-autocomplete>\n <mat-error *ngIf=\"addRouteForm.controls['customer_name'].hasError('required')\">\n Customer name is required.\n </mat-error>\n </mat-form-field>\n </div>\n <div class=\"col-6\">\n <div class=\"wrap-box\">\n @if (config.repository === 'coolmap') {\n <lib-searchoptiongroup\n [searchConfig]=\"{form: addRouteForm, controlname: 'pickUpSearchOption'}\"\n (onUpdatePickUpSearchOption)=\"updatePickUpField()\"/>\n }\n <div class=\"col-12\">\n <mat-form-field [style.display]=\"isSystemPickup ? 'block' : 'none'\">\n <mat-label>Pickup</mat-label>\n <input type=\"text\"\n placeholder=\"Search...\" matInput formControlName=\"pickup_location\"\n (mousedown)=\"$event.stopPropagation()\" [matAutocomplete]=\"autopickUpList\"\n id=\"pickup_system_location\">\n <mat-autocomplete #autopickUpList=\"matAutocomplete\" class=\"list_panel\">\n <mat-option *ngFor=\"let name of pickupOptions | async\"\n (onSelectionChange)=\"patchAddressValue(name, 'pickup')\">\n {{ name.formatted_address }}\n </mat-option>\n </mat-autocomplete>\n <mat-error\n *ngIf=\"addRouteForm.controls['pickup_lat_lng'].touched && addRouteForm.controls['pickup_lat_lng'].hasError('required')\">\n Please select pickup location from the list.\n </mat-error>\n </mat-form-field>\n <mat-form-field [style.display]=\"isSystemPickup ? 'none' : 'block'\">\n <mat-label>Pickup</mat-label>\n <input type=\"text\"\n placeholder=\"Search...\" matInput \n formControlName=\"pickup_location\"\n (mousedown)=\"$event.stopPropagation()\"\n #filterPickup id=\"pickup_google_location\">\n <mat-error\n *ngIf=\"addRouteForm.controls['pickup_lat_lng'].touched && addRouteForm.controls['pickup_lat_lng'].hasError('required')\">\n Please select pickup location from the list.\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n </div>\n <div class=\"col-6\">\n <div class=\"wrap-box\">\n @if (config.repository === 'coolmap') {\n <lib-searchoptiongroup \n [searchConfig]=\"{form: addRouteForm, controlname: 'deliverySearchOtption'}\"\n (onUpdatePickUpSearchOption)=\"updateDeliveryField()\"/>\n }\n <div class=\"col-12\">\n <mat-form-field [style.display]=\"isSystemDelivery ? 'none' : 'block'\">\n <mat-label>Delivery</mat-label>\n <div>\n <input type=\"text\"\n placeholder=\"Search...\"\n matInput #filterDelivery\n formControlName=\"delivery_location\"\n (mousedown)=\"$event.stopPropagation()\"\n id=\"delivery_google_location\">\n </div>\n <mat-error *ngIf=\"addRouteForm.controls['delivery_lat_lng'].touched && addRouteForm.controls['delivery_lat_lng'].hasError('required')\">\n Please select delivery location from the list.\n </mat-error>\n </mat-form-field>\n <mat-form-field [style.display]=\"isSystemDelivery ? 'block' : 'none'\">\n <mat-label>Delivery</mat-label>\n <div>\n <input type=\"text\" placeholder=\"Search...\" matInput formControlName=\"delivery_location\"\n (mousedown)=\"$event.stopPropagation()\" [matAutocomplete]=\"autoDeliveryList\"\n id=\"delivery_system_location\">\n <mat-autocomplete #autoDeliveryList=\"matAutocomplete\" class=\"list_panel\">\n <mat-option *ngFor=\"let name of deliveryOptions | async\"\n (onSelectionChange)=\"patchAddressValue(name, 'delivery')\">\n {{ name.formatted_address }}\n </mat-option>\n </mat-autocomplete>\n </div>\n <mat-error *ngIf=\"addRouteForm.controls['delivery_lat_lng'].touched && addRouteForm.controls['delivery_lat_lng'].hasError('required')\">\n Please select delivery location from the list.\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n </div>\n <div class=\"col-6\">\n <mat-form-field>\n <mat-label>Notes</mat-label>\n <textarea style=\"height: 18px; resize: none;\" matInput name=\"\" id=\"\" cols=\"30\" rows=\"10\" formControlName=\"note\" autocomplete=\"nope\" (mousedown)=\"$event.stopPropagation()\"></textarea>\n <mat-error *ngIf=\"addRouteForm.controls['note'].hasError('maxlength')\">\n Notes should be within 2048 characters.\n </mat-error>\n </mat-form-field>\n </div>\n\n <div class=\"col-6 d-flex\">\n <div class=\"inputbox m-0\">\n <mat-form-field>\n <mat-label>Unit type</mat-label>\n <mat-select formControlName=\"unit_id\" (selectionChange)=\"checkAndFetchRouteInformation()\" (mousedown)=\"$event.stopPropagation()\">\n <mat-option *ngFor=\"let unit of unitsList\" [value]=\"unit?.id\"> {{unit?.type}} </mat-option>\n </mat-select>\n <mat-error *ngIf=\"addRouteForm.controls['unit_id'].hasError('required')\">\n Unit is required\n </mat-error>\n </mat-form-field>\n </div>\n </div>\n <div class=\"col-6\">\n <app-estimation-display *ngIf=\"addRouteForm?.value?.pickup_lat_lng && addRouteForm?.value?.delivery_lat_lng\" [value]=\"addRouteForm['value']\"></app-estimation-display>\n </div>\n <div class=\"col-6\" *ngIf=\"addRouteForm['value']['trucker_pay_estimate'] && addRouteForm['value']['customer_price_estimate']\">\n <span *ngIf=\"config['repository'] !== 'customer'\" class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Trucker Pay Estimate - <b>{{'$'+ addRouteForm['value']['trucker_pay_estimate']}}</b>\n </span>\n <span class=\"estimate\" (mousedown)=\"$event.stopPropagation()\">\n Customer Price Estimate - <b>{{'$'+ addRouteForm['value']['customer_price_estimate']}}</b>\n </span>\n </div>\n <button mat-raised-button type=\"submit\" (click)=\"saveRoute()\" *ngIf=\"preventSave\"\n [disabled]=\"addRouteForm.invalid && preventSave || preventInitialSave\">{{routeId? 'Update' : 'Save'}}\n </button>\n <div class=\"loader\">\n <mat-spinner *ngIf=\"!preventSave\"></mat-spinner>\n </div>\n </div>\n </form>\n </div>\n</div>\n", styles: [".addroutebox{width:calc(100% - 340px);position:absolute;left:320px;bottom:10px;display:flex;justify-content:space-between;align-items:flex-start}.addroutebox .routedetailbox{max-width:300px;padding:10px;background-color:#fff;border-radius:20px;margin-right:20px}@media (min-width: 1600px){.addroutebox .routedetailbox{max-width:280px}}.addroutebox .editbtn{background:#326ad3;padding:10px 25px;color:#fff;font-size:.8125rem;border-radius:30px;float:right}.add_add_route_box{background:#fff;padding:10px 20px;border-radius:20px;box-shadow:2px 4px 4px 2px #00000024;width:100%;position:relative;cursor:move}.add_add_route_box .route_form_area{display:flex;flex-wrap:wrap;justify-content:space-between}.add_add_route_box .route_form_area .col-6{width:48%;margin-top:10px;justify-content:space-between}.add_add_route_box .route_form_area .col-6 .inputbox{width:47%}.add_add_route_box .route_form_area .col-6 span{font-size:.875rem}.add_add_route_box .route_form_area button{background:#326ad3;padding:0 18px;color:#fff;font-size:.8125rem;border-radius:30px;position:absolute;right:18px;top:20px;height:35px}.closebtn{background:#000;color:#fff;border-radius:30px;padding:0 18px;margin-left:10px;height:35px}.delbtn{background:red;color:#fff;border-radius:30px;padding:10px 18px}.add_route_listingpart .listing_toggle{background:#fff;border-radius:15px;padding:8px 10px;position:absolute;right:10px;top:30px;cursor:pointer}.listing_box{background:#282828;height:100vh;position:fixed;right:0;top:0;z-index:1111;box-shadow:-3px 0 5px #ffffff14;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;width:0;border-radius:40px 0 0 40px;opacity:0}.listing_box .closebtn{display:none}.show .listing_box{width:250px;max-width:250px;-webkit-box-flex:0;flex:0 0 250px;transition:.5s;-webkit-transition:.5s;-moz-transition:.5s;padding:40px 0 40px 20px;opacity:1}@media (min-width: 1600px){.show .listing_box{width:320px;max-width:320px;-webkit-box-flex:0;flex:0 0 320px}}.show .listing_box h2{color:#fff;white-space:nowrap}.show .listing_box ul{padding:0 20px 0 0}.show .listing_box ul li{background:#4a4a4a;padding:15px;border-radius:15px;display:flex;margin-bottom:15px}.show .listing_box ul li .companayIcon{width:40px;height:40px;border-radius:10px;background:#fff;margin-right:10px;display:flex;justify-content:center;align-items:center}.show .listing_box ul li .company_cont{width:calc(100% - 50px)}.show .listing_box ul li .company_cont h3{color:#fff;font-size:15px;font-weight:400;margin:0;text-overflow:ellipsis;max-width:129px;-webkit-box-orient:vertical;white-space:nowrap;overflow:hidden}@media (min-width: 1600px){.show .listing_box ul li .company_cont h3{max-width:170px}}.show .listing_box ul li .company_cont p{color:#bcbcbc;font-size:12px;margin:5px 0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:16px}.show .closebtn{position:absolute;left:-33px;top:50px;background:#282828;color:#fff;padding:8px;border-top-left-radius:15px;border-bottom-left-radius:15px;cursor:pointer;box-shadow:-4px 2px 5px #ffffff14;display:block}.loader{position:absolute;width:95%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:none}.buttonprt{margin-right:83px}.closebtnroutedetail{box-shadow:0 0 5px #0000001c;border-radius:100%;width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer;background:#fff;position:absolute;top:-11px;left:-11px}.routenotes{max-height:170px;overflow:auto}.estimate{margin-right:20px;font-size:.7rem}@media (min-width: 1600px){.estimate{font-size:.95rem}}.wrap-box{background:#f3f3f3;padding:10px 20px;border-radius:15px;border:1px solid #dadada;margin-bottom:20px}\n"] }]
1596
+ }], ctorParameters: () => [{ type: i1.CoolmapService }, { type: i1.UtilsService }, { type: i1$1.MatDialog }, { type: i1.CoolmapConfigModel, decorators: [{
1597
+ type: Inject,
1598
+ args: ['memberData']
1599
+ }] }], propDecorators: { filterPickup: [{
1600
+ type: ViewChild,
1601
+ args: ['filterPickup']
1602
+ }], filterDelivery: [{
1603
+ type: ViewChild,
1604
+ args: ['filterDelivery']
1605
+ }], pickup_system_location: [{
1606
+ type: ViewChild,
1607
+ args: ['pickup_system_location']
1608
+ }], delivery_system_location: [{
1609
+ type: ViewChild,
1610
+ args: ['delivery_system_location']
1611
+ }], changeNav: [{
1612
+ type: Output
1613
+ }], updateRouteList: [{
1614
+ type: Output
1615
+ }], routeData: [{
1616
+ type: Input
1617
+ }], customerRepoDetails: [{
1618
+ type: Input
1619
+ }] } });
1620
+
1621
+ class CoolmapModule {
1622
+ static forRoot(memberData) {
1623
+ return {
1624
+ ngModule: CoolmapModule,
1625
+ providers: [{ provide: 'memberData', useValue: memberData }]
1626
+ };
1627
+ }
1628
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoolmapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1629
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: CoolmapModule, declarations: [MapComponent,
1630
+ NavComponent,
1631
+ AddRouteNavComponent,
1632
+ JobCodeNavComponent,
1633
+ RouteJobCodeListComponent,
1634
+ ViewRouteListCardComponent,
1635
+ SmsCardDetailsOverviewComponent,
1636
+ JobCodeListCardComponent,
1637
+ JobCodeComponent,
1638
+ JobRouteListComponent,
1639
+ JobcodeStatusComponent,
1640
+ JobcodeOverviewComponent,
1641
+ DialogComponent,
1642
+ AddRouteComponent,
1643
+ EstimationDisplayComponent,
1644
+ RouteInfoCardComponent,
1645
+ SearchoptiongroupComponent], imports: [CommonModule,
1646
+ MatSnackBarModule,
1647
+ MatSidenavModule,
1648
+ DragDropModule,
1649
+ FormsModule,
1650
+ MatInputModule,
1651
+ MatSelectModule,
1652
+ MatIconModule,
1653
+ ReactiveFormsModule,
1654
+ MatAutocompleteModule,
1655
+ MatFormFieldModule,
1656
+ MatProgressSpinnerModule,
1657
+ MatChipsModule,
1658
+ MatDialogModule,
1659
+ MatTooltipModule,
1660
+ MatDatepickerModule,
1661
+ MatNativeDateModule,
1662
+ MatPseudoCheckboxModule,
1663
+ MatButtonModule,
1664
+ MatProgressBarModule,
1665
+ ScrollingModule,
1666
+ MatRadioModule], exports: [MapComponent,
1667
+ NavComponent,
1668
+ AddRouteNavComponent,
1669
+ JobCodeNavComponent,
1670
+ RouteJobCodeListComponent,
1671
+ ViewRouteListCardComponent,
1672
+ SmsCardDetailsOverviewComponent,
1673
+ JobCodeListCardComponent,
1674
+ JobCodeComponent,
1675
+ JobRouteListComponent,
1676
+ JobcodeStatusComponent,
1677
+ JobcodeOverviewComponent,
1678
+ DialogComponent,
1679
+ AddRouteComponent] });
1680
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoolmapModule, imports: [CommonModule,
1681
+ MatSnackBarModule,
1682
+ MatSidenavModule,
1683
+ DragDropModule,
1684
+ FormsModule,
1685
+ MatInputModule,
1686
+ MatSelectModule,
1687
+ MatIconModule,
1688
+ ReactiveFormsModule,
1689
+ MatAutocompleteModule,
1690
+ MatFormFieldModule,
1691
+ MatProgressSpinnerModule,
1692
+ MatChipsModule,
1693
+ MatDialogModule,
1694
+ MatTooltipModule,
1695
+ MatDatepickerModule,
1696
+ MatNativeDateModule,
1697
+ MatPseudoCheckboxModule,
1698
+ MatButtonModule,
1699
+ MatProgressBarModule,
1700
+ ScrollingModule,
1701
+ MatRadioModule] });
1702
+ }
1703
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoolmapModule, decorators: [{
1704
+ type: NgModule,
1705
+ args: [{
1706
+ declarations: [
1707
+ MapComponent,
1708
+ NavComponent,
1709
+ AddRouteNavComponent,
1710
+ JobCodeNavComponent,
1711
+ RouteJobCodeListComponent,
1712
+ ViewRouteListCardComponent,
1713
+ SmsCardDetailsOverviewComponent,
1714
+ JobCodeListCardComponent,
1715
+ JobCodeComponent,
1716
+ JobRouteListComponent,
1717
+ JobcodeStatusComponent,
1718
+ JobcodeOverviewComponent,
1719
+ DialogComponent,
1720
+ AddRouteComponent,
1721
+ EstimationDisplayComponent,
1722
+ RouteInfoCardComponent,
1723
+ SearchoptiongroupComponent
1724
+ ],
1725
+ imports: [
1726
+ CommonModule,
1727
+ MatSnackBarModule,
1728
+ MatSidenavModule,
1729
+ DragDropModule,
1730
+ FormsModule,
1731
+ MatInputModule,
1732
+ MatSelectModule,
1733
+ MatIconModule,
1734
+ ReactiveFormsModule,
1735
+ MatAutocompleteModule,
1736
+ MatFormFieldModule,
1737
+ MatProgressSpinnerModule,
1738
+ MatChipsModule,
1739
+ MatDialogModule,
1740
+ MatTooltipModule,
1741
+ MatDatepickerModule,
1742
+ MatNativeDateModule,
1743
+ MatPseudoCheckboxModule,
1744
+ MatButtonModule,
1745
+ MatProgressBarModule,
1746
+ ScrollingModule,
1747
+ MatRadioModule
1748
+ ],
1749
+ exports: [
1750
+ MapComponent,
1751
+ NavComponent,
1752
+ AddRouteNavComponent,
1753
+ JobCodeNavComponent,
1754
+ RouteJobCodeListComponent,
1755
+ ViewRouteListCardComponent,
1756
+ SmsCardDetailsOverviewComponent,
1757
+ JobCodeListCardComponent,
1758
+ JobCodeComponent,
1759
+ JobRouteListComponent,
1760
+ JobcodeStatusComponent,
1761
+ JobcodeOverviewComponent,
1762
+ DialogComponent,
1763
+ AddRouteComponent
1764
+ ],
1765
+ // TODO: entryComponents is no longer supported. Find out if this breaks something
1766
+ // entryComponents: [
1767
+ // DialogComponent,
1768
+ // JobCodeComponent,
1769
+ // AddRouteComponent
1770
+ // ],
1771
+ providers: []
1772
+ }]
1773
+ }] });
1774
+
1775
+ /*
1776
+ * Public API Surface of coolmap
1777
+ */
1778
+
1779
+ /**
1780
+ * Generated bundle index. Do not edit.
1781
+ */
1782
+
1783
+ export { AddRouteComponent, AddRouteNavComponent, CoolmapModule, DialogComponent, JobCodeComponent, JobCodeListCardComponent, JobCodeNavComponent, JobRouteListComponent, JobcodeOverviewComponent, JobcodeStatusComponent, MapComponent, NavComponent, RouteJobCodeListComponent, SmsCardDetailsOverviewComponent, ViewRouteListCardComponent };
1784
+ //# sourceMappingURL=aggdirect-coolmap.mjs.map