@transcommerce/cwm-shared 1.1.17 → 1.1.20

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 (117) hide show
  1. package/fesm2022/transcommerce-cwm-shared.mjs +969 -894
  2. package/fesm2022/transcommerce-cwm-shared.mjs.map +1 -1
  3. package/index.d.ts +1 -0
  4. package/lib/components/external-navigation/external-navigation.component.d.ts +18 -0
  5. package/lib/components/external-navigation/external-navigation.component.d.ts.map +1 -0
  6. package/lib/components/navigate-to-route/navigate-to-route.component.d.ts +14 -0
  7. package/lib/components/navigate-to-route/navigate-to-route.component.d.ts.map +1 -0
  8. package/lib/components/page-not-found/page-not-found.component.d.ts +6 -0
  9. package/lib/components/page-not-found/page-not-found.component.d.ts.map +1 -0
  10. package/lib/factories/msal-interceptor-config.factory.d.ts +1 -0
  11. package/lib/factories/msal-interceptor-config.factory.d.ts.map +1 -0
  12. package/lib/factories/msal.guard.config.factory.d.ts +1 -0
  13. package/lib/factories/msal.guard.config.factory.d.ts.map +1 -0
  14. package/lib/factories/msal.instance.factory.d.ts +1 -0
  15. package/lib/factories/msal.instance.factory.d.ts.map +1 -0
  16. package/lib/helpers/async-utils.d.ts +1 -0
  17. package/lib/helpers/async-utils.d.ts.map +1 -0
  18. package/lib/helpers/db-keys.d.ts +1 -0
  19. package/lib/helpers/db-keys.d.ts.map +1 -0
  20. package/lib/helpers/jwt.d.ts +1 -0
  21. package/lib/helpers/jwt.d.ts.map +1 -0
  22. package/lib/helpers/time-span-overflow-error.d.ts +1 -0
  23. package/lib/helpers/time-span-overflow-error.d.ts.map +1 -0
  24. package/lib/helpers/time-span.d.ts +1 -0
  25. package/lib/helpers/time-span.d.ts.map +1 -0
  26. package/lib/helpers/utilities.d.ts +1 -0
  27. package/lib/helpers/utilities.d.ts.map +1 -0
  28. package/lib/models/add-subscription-request.d.ts +1 -0
  29. package/lib/models/add-subscription-request.d.ts.map +1 -0
  30. package/lib/models/cannabinoid-information.d.ts +1 -0
  31. package/lib/models/cannabinoid-information.d.ts.map +1 -0
  32. package/lib/models/card-types.d.ts +1 -0
  33. package/lib/models/card-types.d.ts.map +1 -0
  34. package/lib/models/category.d.ts +1 -0
  35. package/lib/models/category.d.ts.map +1 -0
  36. package/lib/models/color.d.ts +1 -0
  37. package/lib/models/color.d.ts.map +1 -0
  38. package/lib/models/config/api-config.d.ts +1 -0
  39. package/lib/models/config/api-config.d.ts.map +1 -0
  40. package/lib/models/config/auth-config.d.ts +1 -0
  41. package/lib/models/config/auth-config.d.ts.map +1 -0
  42. package/lib/models/config/carousel-config.d.ts +1 -0
  43. package/lib/models/config/carousel-config.d.ts.map +1 -0
  44. package/lib/models/config/configuration.d.ts +1 -0
  45. package/lib/models/config/configuration.d.ts.map +1 -0
  46. package/lib/models/config/display-config.d.ts +1 -0
  47. package/lib/models/config/display-config.d.ts.map +1 -0
  48. package/lib/models/config/menu-board-config.d.ts +1 -0
  49. package/lib/models/config/menu-board-config.d.ts.map +1 -0
  50. package/lib/models/credit-card.d.ts +1 -0
  51. package/lib/models/credit-card.d.ts.map +1 -0
  52. package/lib/models/customer.d.ts +1 -0
  53. package/lib/models/customer.d.ts.map +1 -0
  54. package/lib/models/flowhub-product.d.ts +1 -0
  55. package/lib/models/flowhub-product.d.ts.map +1 -0
  56. package/lib/models/font.d.ts +1 -0
  57. package/lib/models/font.d.ts.map +1 -0
  58. package/lib/models/image.d.ts +1 -0
  59. package/lib/models/image.d.ts.map +1 -0
  60. package/lib/models/inventory-api-response.d.ts +1 -0
  61. package/lib/models/inventory-api-response.d.ts.map +1 -0
  62. package/lib/models/justifications.d.ts +1 -0
  63. package/lib/models/justifications.d.ts.map +1 -0
  64. package/lib/models/log-levels.d.ts +1 -0
  65. package/lib/models/log-levels.d.ts.map +1 -0
  66. package/lib/models/logging-verbosity.d.ts +1 -0
  67. package/lib/models/logging-verbosity.d.ts.map +1 -0
  68. package/lib/models/model-map.d.ts +1 -0
  69. package/lib/models/model-map.d.ts.map +1 -0
  70. package/lib/models/named-colors.d.ts +1 -0
  71. package/lib/models/named-colors.d.ts.map +1 -0
  72. package/lib/models/on-element-style.d.ts +1 -0
  73. package/lib/models/on-element-style.d.ts.map +1 -0
  74. package/lib/models/product.d.ts +1 -0
  75. package/lib/models/product.d.ts.map +1 -0
  76. package/lib/models/profile.d.ts +1 -0
  77. package/lib/models/profile.d.ts.map +1 -0
  78. package/lib/models/slide.d.ts +1 -0
  79. package/lib/models/slide.d.ts.map +1 -0
  80. package/lib/models/subscription.d.ts +1 -0
  81. package/lib/models/subscription.d.ts.map +1 -0
  82. package/lib/models/user-types.d.ts +1 -0
  83. package/lib/models/user-types.d.ts.map +1 -0
  84. package/lib/models/weight-tier-information.d.ts +1 -0
  85. package/lib/models/weight-tier-information.d.ts.map +1 -0
  86. package/lib/models/window.d.ts +1 -0
  87. package/lib/models/window.d.ts.map +1 -0
  88. package/lib/modules/cwm-shared.module.d.ts +10 -5
  89. package/lib/modules/cwm-shared.module.d.ts.map +1 -0
  90. package/lib/pipes/safe-html.pipe.d.ts +1 -0
  91. package/lib/pipes/safe-html.pipe.d.ts.map +1 -0
  92. package/lib/services/auth.service.d.ts +1 -0
  93. package/lib/services/auth.service.d.ts.map +1 -0
  94. package/lib/services/base-api.service.d.ts +1 -0
  95. package/lib/services/base-api.service.d.ts.map +1 -0
  96. package/lib/services/config.service.d.ts +1 -0
  97. package/lib/services/config.service.d.ts.map +1 -0
  98. package/lib/services/customer-api.service.d.ts +1 -0
  99. package/lib/services/customer-api.service.d.ts.map +1 -0
  100. package/lib/services/ibase-api.service.d.ts +1 -0
  101. package/lib/services/ibase-api.service.d.ts.map +1 -0
  102. package/lib/services/inventory-api.service.d.ts +6 -1
  103. package/lib/services/inventory-api.service.d.ts.map +1 -0
  104. package/lib/services/local-storage.service.d.ts +1 -0
  105. package/lib/services/local-storage.service.d.ts.map +1 -0
  106. package/lib/services/log.service.d.ts +1 -0
  107. package/lib/services/log.service.d.ts.map +1 -0
  108. package/lib/services/mocks/{mock-location-config.d.ts → mock-config.d.ts} +1 -0
  109. package/lib/services/mocks/mock-config.d.ts.map +1 -0
  110. package/lib/services/mocks/mock-inventory-api-response.d.ts +1 -0
  111. package/lib/services/mocks/mock-inventory-api-response.d.ts.map +1 -0
  112. package/lib/services/mocks/mock-profile.d.ts +1 -0
  113. package/lib/services/mocks/mock-profile.d.ts.map +1 -0
  114. package/package.json +2 -2
  115. package/public-api.d.ts +7 -1
  116. package/public-api.d.ts.map +1 -0
  117. package/transcommerce-cwm-shared.d.ts.map +1 -0
@@ -1,15 +1,117 @@
1
- import { InteractionType, PublicClientApplication } from '@azure/msal-browser';
2
1
  import * as i0 from '@angular/core';
3
- import { Injectable, Pipe, NgModule } from '@angular/core';
4
- import * as i2 from '@angular/common/http';
5
- import { HttpResponseBase, HttpResponse, HttpErrorResponse, HttpHeaders, HttpStatusCode, HTTP_INTERCEPTORS } from '@angular/common/http';
6
- import { Subject, firstValueFrom } from 'rxjs';
2
+ import { Component, Injectable, Pipe, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/router';
4
+ import * as i2 from '@angular/forms';
5
+ import { FormsModule } from '@angular/forms';
6
+ import { InteractionType, PublicClientApplication } from '@azure/msal-browser';
7
+ import * as i2$1 from '@angular/common/http';
8
+ import { HttpResponseBase, HttpResponse, HttpErrorResponse, HttpHeaders, HttpStatusCode } from '@angular/common/http';
9
+ import { CommonModule } from '@angular/common';
10
+ export * from '@angular/common';
11
+ import { MsalModule } from '@azure/msal-angular';
12
+ export * from '@azure/msal-angular';
13
+ import * as i1$1 from '@angular/platform-browser';
14
+ import { BrowserModule } from '@angular/platform-browser';
7
15
  import { AppConfigurationClient } from '@azure/app-configuration';
16
+ import { firstValueFrom, Subject } from 'rxjs';
8
17
  import { keys, countBy } from 'lodash';
9
- import * as i1 from '@angular/platform-browser';
10
- import { BrowserModule } from '@angular/platform-browser';
11
- import { CommonModule } from '@angular/common';
12
- import { MsalModule, MsalService, MSAL_INSTANCE, MSAL_INTERCEPTOR_CONFIG, MsalInterceptor } from '@azure/msal-angular';
18
+
19
+ class ExternalNavigationComponent {
20
+ router;
21
+ route = "";
22
+ constructor(router) {
23
+ this.router = router;
24
+ }
25
+ ngAfterViewInit() {
26
+ document.getElementById("txtRoute")?.focus();
27
+ }
28
+ navigateToRoute() {
29
+ const route = this.route.trim();
30
+ const router = this.router;
31
+ setTimeout(() => { router.navigate([route]).then(); }, 1000);
32
+ }
33
+ navigate() {
34
+ this.router.navigate([this.route], { skipLocationChange: true }).then();
35
+ }
36
+ navigateByUrl() {
37
+ this.router.navigateByUrl(this.route, { skipLocationChange: true }).then();
38
+ }
39
+ navigateToExternalUrl() {
40
+ window.open(this.route, '_blank');
41
+ }
42
+ navigateToExternalHref() {
43
+ window.location.href = this.route;
44
+ }
45
+ onKeyPress($event) {
46
+ if ($event.key == 'Enter') {
47
+ this.navigateToExternalUrl();
48
+ }
49
+ }
50
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ExternalNavigationComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
51
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: ExternalNavigationComponent, isStandalone: false, selector: "cwm-external-navigation", ngImport: i0, template: `<div class="container">
52
+ <h3>Enter the destination route, URL, or Href you want and press the button that uses the navigation method of your choosing:</h3>
53
+ <input id="txtRoute" type="text" [(ngModel)]="route" placeholder="Enter the destination route, URL, or Href..."
54
+ (keydown)="onKeyPress($event)"/>
55
+ <button (click)="navigateToRoute()">Navigate to route</button>
56
+ <button (click)="navigate()">Navigate</button>
57
+ <button (click)="navigateByUrl()">Navigate by URL</button>
58
+ <button (click)="navigateToExternalUrl()">Navigate to external URL</button>
59
+ <button (click)="navigateToExternalHref()">Navigate to external Href</button>
60
+ </div>`, isInline: true, dependencies: [{ kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
61
+ }
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ExternalNavigationComponent, decorators: [{
63
+ type: Component,
64
+ args: [{
65
+ selector: 'cwm-external-navigation',
66
+ standalone: false,
67
+ template: `<div class="container">
68
+ <h3>Enter the destination route, URL, or Href you want and press the button that uses the navigation method of your choosing:</h3>
69
+ <input id="txtRoute" type="text" [(ngModel)]="route" placeholder="Enter the destination route, URL, or Href..."
70
+ (keydown)="onKeyPress($event)"/>
71
+ <button (click)="navigateToRoute()">Navigate to route</button>
72
+ <button (click)="navigate()">Navigate</button>
73
+ <button (click)="navigateByUrl()">Navigate by URL</button>
74
+ <button (click)="navigateToExternalUrl()">Navigate to external URL</button>
75
+ <button (click)="navigateToExternalHref()">Navigate to external Href</button>
76
+ </div>`
77
+ }]
78
+ }], ctorParameters: () => [{ type: i1.Router }] });
79
+
80
+ class NavigateToRouteComponent {
81
+ router;
82
+ route = '';
83
+ constructor(router) {
84
+ this.router = router;
85
+ }
86
+ ngAfterViewInit() {
87
+ document.getElementById("txtRoute")?.focus();
88
+ }
89
+ navigateToRoute() {
90
+ const route = this.route.trim();
91
+ const router = this.router;
92
+ setTimeout(() => { router.navigate([route]); }, 1000);
93
+ }
94
+ onKeyPress($event) {
95
+ if ($event.key == 'Enter') {
96
+ this.navigateToRoute();
97
+ }
98
+ }
99
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: NavigateToRouteComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
100
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: NavigateToRouteComponent, isStandalone: false, selector: "cwm-navigate-to-route", ngImport: i0, template: "<div class=\"container\">\n <h2>Enter the route you want to navigate to:</h2>\n <input id=\"txtRoute\" type=\"text\" [(ngModel)]=\"route\" placeholder=\"Enter Route...\"\n (keydown)=\"onKeyPress($event)\"/>\n <button (click)=\"navigateToRoute()\">Navigate</button>\n</div>\n``\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
101
+ }
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: NavigateToRouteComponent, decorators: [{
103
+ type: Component,
104
+ args: [{ selector: 'cwm-navigate-to-route', standalone: false, template: "<div class=\"container\">\n <h2>Enter the route you want to navigate to:</h2>\n <input id=\"txtRoute\" type=\"text\" [(ngModel)]=\"route\" placeholder=\"Enter Route...\"\n (keydown)=\"onKeyPress($event)\"/>\n <button (click)=\"navigateToRoute()\">Navigate</button>\n</div>\n``\n", styles: [":host{display:block}\n"] }]
105
+ }], ctorParameters: () => [{ type: i1.Router }] });
106
+
107
+ class PageNotFoundComponent {
108
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: PageNotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
109
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: PageNotFoundComponent, isStandalone: false, selector: "cwm-page-not-found", ngImport: i0, template: "<p>\n Page Not Found\n</p>\n", styles: [""] });
110
+ }
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: PageNotFoundComponent, decorators: [{
112
+ type: Component,
113
+ args: [{ selector: 'cwm-page-not-found', standalone: false, template: "<p>\n Page Not Found\n</p>\n" }]
114
+ }] });
13
115
 
14
116
  function MSALGuardConfigFactory() {
15
117
  return {
@@ -949,572 +1051,184 @@ class Product {
949
1051
  }
950
1052
  }
951
1053
 
952
- /**
953
- * Provides a wrapper for accessing the web storage API and synchronizing session storage across tabs/windows.
954
- */
955
- class LocalStorageService {
956
- static syncListenerInitialized = false;
957
- syncKeys = [];
958
- initEvent = new Subject();
959
- reservedKeys = [
960
- 'sync_keys',
961
- 'addToSyncKeys',
962
- 'removeFromSyncKeys',
963
- 'getSessionStorage',
964
- 'setSessionStorage',
965
- 'addToSessionStorage',
966
- 'removeFromSessionStorage',
967
- 'clearAllSessionsStorage'
968
- ];
969
- InitializeStorageSyncListener() {
970
- if (LocalStorageService.syncListenerInitialized == true) {
971
- return;
972
- }
973
- LocalStorageService.syncListenerInitialized = true;
974
- window.addEventListener('storage', this.sessionStorageTransferHandler, false);
975
- this.syncSessionStorage();
976
- }
977
- deInitializeStorageSyncListener() {
978
- window.removeEventListener('storage', this.sessionStorageTransferHandler, false);
979
- LocalStorageService.syncListenerInitialized = false;
980
- }
981
- clearAllStorage() {
982
- this.clearAllSessionsStorage();
983
- this.clearLocalStorage();
984
- }
985
- clearAllSessionsStorage() {
986
- this.clearInstanceSessionStorage();
987
- localStorage.removeItem(DbKeys.SYNC_KEYS);
988
- localStorage.setItem('clearAllSessionsStorage', '_dummy');
989
- localStorage.removeItem('clearAllSessionsStorage');
990
- }
991
- clearInstanceSessionStorage() {
992
- sessionStorage.clear();
993
- this.syncKeys = [];
994
- }
995
- clearLocalStorage() {
996
- localStorage.clear();
997
- }
998
- saveSessionData(data, key = DbKeys.USER_DATA) {
999
- this.testForInvalidKeys(key);
1000
- this.removeFromSyncKeys(key);
1001
- localStorage.removeItem(key);
1002
- this.sessionStorageSetItem(key, data);
1003
- }
1004
- saveSyncedSessionData(data, key = DbKeys.USER_DATA) {
1005
- this.testForInvalidKeys(key);
1006
- localStorage.removeItem(key);
1007
- this.addToSessionStorage(data, key);
1008
- }
1009
- savePermanentData(data, key = DbKeys.USER_DATA) {
1010
- this.testForInvalidKeys(key);
1011
- this.removeFromSessionStorage(key);
1012
- this.localStorageSetItem(key, data);
1013
- }
1014
- moveDataToSessionStorage(key = DbKeys.USER_DATA) {
1015
- this.testForInvalidKeys(key);
1016
- const data = this.getData(key);
1017
- if (data == null) {
1018
- return;
1019
- }
1020
- this.saveSessionData(data, key);
1021
- }
1022
- moveDataToSyncedSessionStorage(key = DbKeys.USER_DATA) {
1023
- this.testForInvalidKeys(key);
1024
- const data = this.getData(key);
1025
- if (data == null) {
1026
- return;
1027
- }
1028
- this.saveSyncedSessionData(data, key);
1029
- }
1030
- moveDataToPermanentStorage(key = DbKeys.USER_DATA) {
1031
- this.testForInvalidKeys(key);
1032
- const data = this.getData(key);
1033
- if (data == null) {
1034
- return;
1035
- }
1036
- this.savePermanentData(data, key);
1037
- }
1038
- exists(key = DbKeys.USER_DATA) {
1039
- let data = sessionStorage.getItem(key);
1040
- if (data == null) {
1041
- data = localStorage.getItem(key);
1042
- }
1043
- return data != null;
1044
- }
1045
- getData(key = DbKeys.USER_DATA) {
1046
- this.testForInvalidKeys(key);
1047
- let data = this.sessionStorageGetItem(key);
1048
- if (data == '') {
1049
- data = this.localStorageGetItem(key);
1050
- }
1051
- return data;
1052
- }
1053
- getDataObject(key = DbKeys.USER_DATA, isDateType = false) {
1054
- let data = this.getData(key);
1055
- if (data != null) {
1056
- if (isDateType) {
1057
- data = new Date(data);
1058
- }
1059
- return data;
1060
- }
1061
- else {
1062
- return data;
1063
- }
1064
- }
1065
- deleteData(key = DbKeys.USER_DATA) {
1066
- this.testForInvalidKeys(key);
1067
- this.removeFromSessionStorage(key);
1068
- localStorage.removeItem(key);
1054
+ class SafeHtmlPipe {
1055
+ sanitizer;
1056
+ constructor(sanitizer) {
1057
+ this.sanitizer = sanitizer;
1069
1058
  }
1070
- getInitEvent() {
1071
- return this.initEvent.asObservable();
1059
+ transform(value) {
1060
+ return this.sanitizer.bypassSecurityTrustHtml(value);
1072
1061
  }
1073
- sessionStorageTransferHandler = (event) => {
1074
- if (!event.newValue) {
1075
- return;
1076
- }
1077
- if (event.key == 'getSessionStorage') {
1078
- if (sessionStorage.length) {
1079
- this.localStorageSetItem('setSessionStorage', sessionStorage);
1080
- localStorage.removeItem('setSessionStorage');
1081
- }
1082
- }
1083
- else if (event.key == 'setSessionStorage') {
1084
- if (!this.syncKeys.length) {
1085
- this.loadSyncKeys();
1086
- }
1087
- const data = JSON.parse(event.newValue);
1088
- // console.info("Set => Key: Transfer setSessionStorage" + ", data: " + JSON.stringify(data));
1089
- for (const key in data) {
1090
- if (this.syncKeysContains(key)) {
1091
- this.sessionStorageSetItem(key, JSON.parse(data[key]));
1062
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1063
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: SafeHtmlPipe, isStandalone: false, name: "safeHtml" });
1064
+ }
1065
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SafeHtmlPipe, decorators: [{
1066
+ type: Pipe,
1067
+ args: [{
1068
+ name: 'safeHtml',
1069
+ standalone: false
1070
+ }]
1071
+ }], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
1072
+
1073
+ class CwmSharedModule {
1074
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CwmSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1075
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: CwmSharedModule, declarations: [ExternalNavigationComponent,
1076
+ NavigateToRouteComponent,
1077
+ PageNotFoundComponent,
1078
+ SafeHtmlPipe], imports: [CommonModule,
1079
+ MsalModule,
1080
+ BrowserModule,
1081
+ FormsModule], exports: [CommonModule,
1082
+ MsalModule,
1083
+ ExternalNavigationComponent,
1084
+ NavigateToRouteComponent,
1085
+ PageNotFoundComponent,
1086
+ SafeHtmlPipe] });
1087
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CwmSharedModule, imports: [CommonModule,
1088
+ MsalModule,
1089
+ BrowserModule,
1090
+ FormsModule, CommonModule,
1091
+ MsalModule] });
1092
+ }
1093
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CwmSharedModule, decorators: [{
1094
+ type: NgModule,
1095
+ args: [{
1096
+ declarations: [
1097
+ ExternalNavigationComponent,
1098
+ NavigateToRouteComponent,
1099
+ PageNotFoundComponent,
1100
+ SafeHtmlPipe
1101
+ ],
1102
+ imports: [
1103
+ CommonModule,
1104
+ MsalModule,
1105
+ BrowserModule,
1106
+ FormsModule
1107
+ ],
1108
+ exports: [
1109
+ CommonModule,
1110
+ MsalModule,
1111
+ ExternalNavigationComponent,
1112
+ NavigateToRouteComponent,
1113
+ PageNotFoundComponent,
1114
+ SafeHtmlPipe
1115
+ ]
1116
+ }]
1117
+ }] });
1118
+
1119
+ const MockInventoryApiResponse = {
1120
+ "status": 200,
1121
+ "data": [
1122
+ {
1123
+ "brand": "Portland Cannabis Market",
1124
+ "cannabinoidInformation": [
1125
+ {
1126
+ "lowerRange": 0,
1127
+ "name": "cbd",
1128
+ "unitOfMeasure": "%",
1129
+ "unitOfMeasureToGramsMultiplier": null,
1130
+ "upperRange": 0
1131
+ },
1132
+ {
1133
+ "lowerRange": 25.25,
1134
+ "name": "thc",
1135
+ "unitOfMeasure": "%",
1136
+ "unitOfMeasureToGramsMultiplier": null,
1137
+ "upperRange": 25.25
1092
1138
  }
1093
- }
1094
- this.onInit();
1095
- }
1096
- else if (event.key == 'addToSessionStorage') {
1097
- const data = JSON.parse(event.newValue);
1098
- // console.warn("Set => Key: Transfer addToSessionStorage" + ", data: " + JSON.stringify(data));
1099
- this.addToSessionStorageHelper(data.data, data.key);
1100
- }
1101
- else if (event.key == 'removeFromSessionStorage') {
1102
- this.removeFromSessionStorageHelper(event.newValue);
1103
- }
1104
- else if (event.key == 'clearAllSessionsStorage' && sessionStorage.length) {
1105
- this.clearInstanceSessionStorage();
1106
- }
1107
- else if (event.key == 'addToSyncKeys') {
1108
- this.addToSyncKeysHelper(event.newValue);
1109
- }
1110
- else if (event.key == 'removeFromSyncKeys') {
1111
- this.removeFromSyncKeysHelper(event.newValue);
1112
- }
1113
- };
1114
- syncSessionStorage() {
1115
- localStorage.setItem('getSessionStorage', '_dummy');
1116
- localStorage.removeItem('getSessionStorage');
1117
- }
1118
- addToSessionStorage(data, key) {
1119
- this.addToSessionStorageHelper(data, key);
1120
- this.addToSyncKeysBackup(key);
1121
- this.localStorageSetItem('addToSessionStorage', { key, data });
1122
- localStorage.removeItem('addToSessionStorage');
1123
- }
1124
- addToSessionStorageHelper(data, key) {
1125
- this.addToSyncKeysHelper(key);
1126
- this.sessionStorageSetItem(key, data);
1127
- }
1128
- removeFromSessionStorage(keyToRemove) {
1129
- this.removeFromSessionStorageHelper(keyToRemove);
1130
- this.removeFromSyncKeysBackup(keyToRemove);
1131
- localStorage.setItem('removeFromSessionStorage', keyToRemove);
1132
- localStorage.removeItem('removeFromSessionStorage');
1133
- }
1134
- removeFromSessionStorageHelper(keyToRemove) {
1135
- sessionStorage.removeItem(keyToRemove);
1136
- this.removeFromSyncKeysHelper(keyToRemove);
1137
- }
1138
- testForInvalidKeys(key) {
1139
- if (!key) {
1140
- throw new Error('key cannot be empty');
1141
- }
1142
- if (this.reservedKeys.some(x => x == key)) {
1143
- throw new Error(`The storage key "${key}" is reserved and cannot be used. Please use a different key`);
1144
- }
1145
- }
1146
- syncKeysContains(key) {
1147
- if (Array.isArray(this.syncKeys))
1148
- return this.syncKeys.some(x => x == key);
1149
- else
1150
- return false;
1151
- }
1152
- loadSyncKeys() {
1153
- if (this.syncKeys.length) {
1154
- return;
1155
- }
1156
- this.syncKeys = this.getSyncKeysFromStorage();
1157
- }
1158
- getSyncKeysFromStorage(defaultValue = []) {
1159
- const data = this.localStorageGetItem(DbKeys.SYNC_KEYS);
1160
- if (data == null) {
1161
- return defaultValue;
1162
- }
1163
- else {
1164
- return data;
1165
- }
1166
- }
1167
- addToSyncKeys(key) {
1168
- this.addToSyncKeysHelper(key);
1169
- this.addToSyncKeysBackup(key);
1170
- localStorage.setItem('addToSyncKeys', key);
1171
- localStorage.removeItem('addToSyncKeys');
1172
- }
1173
- addToSyncKeysBackup(key) {
1174
- const storedSyncKeys = this.getSyncKeysFromStorage();
1175
- if (!storedSyncKeys.some(x => x == key)) {
1176
- storedSyncKeys.push(key);
1177
- this.localStorageSetItem(DbKeys.SYNC_KEYS, storedSyncKeys);
1178
- }
1179
- }
1180
- removeFromSyncKeysBackup(key) {
1181
- const storedSyncKeys = this.getSyncKeysFromStorage();
1182
- const index = storedSyncKeys.indexOf(key);
1183
- if (index > -1) {
1184
- storedSyncKeys.splice(index, 1);
1185
- this.localStorageSetItem(DbKeys.SYNC_KEYS, storedSyncKeys);
1186
- }
1187
- }
1188
- addToSyncKeysHelper(key) {
1189
- if (!this.syncKeysContains(key)) {
1190
- this.syncKeys.push(key);
1191
- }
1192
- }
1193
- removeFromSyncKeys(key) {
1194
- this.removeFromSyncKeysHelper(key);
1195
- this.removeFromSyncKeysBackup(key);
1196
- localStorage.setItem('removeFromSyncKeys', key);
1197
- localStorage.removeItem('removeFromSyncKeys');
1198
- }
1199
- removeFromSyncKeysHelper(key) {
1200
- const index = this.syncKeys.indexOf(key);
1201
- if (index > -1) {
1202
- this.syncKeys.splice(index, 1);
1203
- }
1204
- }
1205
- localStorageSetItem(key, data) {
1206
- localStorage.setItem(key, JSON.stringify(data));
1207
- }
1208
- sessionStorageSetItem(key, data) {
1209
- sessionStorage.setItem(key, JSON.stringify(data));
1210
- }
1211
- localStorageGetItem(key) {
1212
- return Utilities.JsonTryParse(localStorage.getItem(key) ?? '');
1213
- }
1214
- sessionStorageGetItem(key) {
1215
- return Utilities.JsonTryParse(sessionStorage.getItem(key) ?? '');
1216
- }
1217
- onInit() {
1218
- setTimeout(() => {
1219
- //this.initEvent.next();
1220
- this.initEvent.complete();
1221
- });
1222
- }
1223
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1224
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LocalStorageService, providedIn: 'root' });
1225
- }
1226
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LocalStorageService, decorators: [{
1227
- type: Injectable,
1228
- args: [{
1229
- providedIn: 'root'
1230
- }]
1231
- }] });
1232
-
1233
- const MockConfig = {
1234
- "authConfig": {
1235
- "logLevel": "Info",
1236
- "configConnectString": "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=tyjA;Secret=1FgL95lHkXViZX4Qf2GcRqn26mhTYDVYany8ToXpTnO68AzrdUUEJQQJ99AHAC8vTInIcYexAAACAZACsteF",
1237
- "clientId": "af1486e0-a27f-4c8d-8503-0752d90ce72d",
1238
- "tenantId": "445012c4-563a-4795-84d0-f7473a3197e0",
1239
- "authority": "https://login.microsoft.com/445012c4-563a-4795-84d0-f7473a3197e0",
1240
- "scopes": "openid,email,profile",
1241
- "menu_uri": "http://localhost:4200/",
1242
- "redirect_uri": "https://www.cheapweedmenu.com",
1243
- "logout_redirect_uri": "https://www.cheapweedmenu.com",
1244
- "prompt": "login"
1245
- },
1246
- "apiConfig": {
1247
- "apiBaseUrl": "https://cheap-weed-menus-webapi.azurewebsites.net",
1248
- "addCustomerApiRoute": "/AddCustomer",
1249
- "addSubscriptionApiRoute": "/subscription",
1250
- "getInventoryApiRoute": "/inventory",
1251
- "apiKey": "8b66d117-5d23-4b81-8c2f-52142c67d0cd",
1252
- "clientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
1253
- "locationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae"
1254
- },
1255
- "menuBoardConfig": {
1256
- "amountToScroll": 1,
1257
- "autoScrollTimeout": 20,
1258
- "dataAgeThreshold": 300000
1259
- },
1260
- "footerCarouselConfig": {
1261
- "slidesToShow": 3,
1262
- "slidesToScroll": 1,
1263
- "dots": false,
1264
- "infinite": true,
1265
- "autoplay": true,
1266
- "autoplaySpeed": 10000,
1267
- "speed": 500,
1268
- "arrows": false
1269
- },
1270
- "footerCarouselSlideConfig": [
1271
- {
1272
- "image": "../../../images/sunday.png",
1273
- "title": "CBD Sunday",
1274
- "description": "20% off all CBD products & house pre-rolls",
1275
- "highlighted": false,
1276
- "textColor": "white",
1277
- "backgroundColor": "black"
1278
- },
1279
- {
1280
- "image": "../../../images/new-monday.jpg",
1281
- "title": "Edible Monday",
1282
- "description": "10% off edibles",
1283
- "highlighted": false,
1284
- "textColor": "white",
1285
- "backgroundColor": "black"
1286
- },
1287
- {
1288
- "image": "../../../images/tuesday.png",
1289
- "title": "Doobie Tuesday",
1290
- "description": "10% off all pre-rolls & packs<",
1291
- "highlighted": false,
1292
- "textColor": "black",
1293
- "backgroundColor": "white"
1294
- },
1295
- {
1296
- "image": "../../../images/wednesday.png",
1297
- "title": "Weed Crush Wednesday",
1298
- "description": "10% off all jar bud",
1299
- "highlighted": false,
1300
- "textColor": "black",
1301
- "backgroundColor": "white"
1302
- },
1303
- {
1304
- "image": "../../../images/thursday.png",
1305
- "title": "Thirsty Thursday",
1306
- "description": "10% off Tinctures, RSO & cartridges",
1307
- "highlighted": false,
1308
- "textColor": "black",
1309
- "backgroundColor": "white"
1139
+ ],
1140
+ "category": "Flower",
1141
+ "clientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
1142
+ "createdAt": "2024-05-06T21:41:03Z",
1143
+ "currencyCode": "USD",
1144
+ "customCategoryName": null,
1145
+ "erpId": null,
1146
+ "erpName": null,
1147
+ "expirationDate": null,
1148
+ "inventoryUnitOfMeasure": "grams",
1149
+ "inventoryUnitOfMeasureToGramsMultiplier": 1,
1150
+ "invoiceNumber": null,
1151
+ "isMixAndMatch": false,
1152
+ "isSoldByWeight": true,
1153
+ "isStackable": true,
1154
+ "locationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae",
1155
+ "locationName": "Portland Pot Shop",
1156
+ "manifestId": null,
1157
+ "nutrients": null,
1158
+ "parentproductId": "88caa95f-8a25-4960-ae1f-0894d86e8f02",
1159
+ "parentproductName": "Royal Hindu Truffle by Upper Rogue Terraces",
1160
+ "postTaxPriceInPennies": 800,
1161
+ "preTaxPriceInPennies": 667,
1162
+ "priceInMinorUnits": 667,
1163
+ "productDescription": "",
1164
+ "productId": "df363dba-1cd3-402e-b6c3-b3697abed6ee",
1165
+ "productName": "Royal Hindu Truffle by Upper Rogue Terraces",
1166
+ "productPictureURL": null,
1167
+ "productUnitOfMeasure": "grams",
1168
+ "productUnitOfMeasureToGramsMultiplier": 1,
1169
+ "productUpdatedAt": "2024-06-30T02:42:59.621977Z",
1170
+ "productWeight": null,
1171
+ "purchaseCategory": "rec",
1172
+ "quantity": 146.89,
1173
+ "regulatoryId": "1A4010300000D4A000001042",
1174
+ "sku": "zddCdpqRvw",
1175
+ "speciesName": "Indica",
1176
+ "supplierName": "Portland Cannabis Market",
1177
+ "terpenes": null,
1178
+ "type": null,
1179
+ "variantId": "b0ed44e0-68df-44f3-a34a-f05bb5bd8ae0",
1180
+ "variantName": "",
1181
+ "weightTierInformation": [
1182
+ {
1183
+ "gramAmount": 1,
1184
+ "name": "Grams",
1185
+ "pricePerUnitInMinorUnits": 667
1186
+ },
1187
+ {
1188
+ "gramAmount": 3.5,
1189
+ "name": "Eighth",
1190
+ "pricePerUnitInMinorUnits": 2167
1191
+ },
1192
+ {
1193
+ "gramAmount": 7,
1194
+ "name": "Quarter",
1195
+ "pricePerUnitInMinorUnits": 3833
1196
+ },
1197
+ {
1198
+ "gramAmount": 14,
1199
+ "name": "Half-Ounce",
1200
+ "pricePerUnitInMinorUnits": 7000
1201
+ },
1202
+ {
1203
+ "gramAmount": 28,
1204
+ "name": "Ounce",
1205
+ "pricePerUnitInMinorUnits": 12917
1206
+ }
1207
+ ],
1208
+ costInMinorUnits: 0
1310
1209
  },
1311
1210
  {
1312
- "image": "../../../images/friday.png",
1313
- "title": "Fire Friday",
1314
- "description": "10% off all jar bud",
1315
- "highlighted": false,
1316
- "textColor": "black",
1317
- "backgroundColor": "white"
1318
- },
1319
- {
1320
- "image": "../../../images/saturday.png",
1321
- "title": "Shatterday Saturday",
1322
- "description": "10% off all concentrate",
1323
- "highlighted": false,
1324
- "textColor": "white",
1325
- "backgroundColor": "black"
1326
- }
1327
- ]
1328
- };
1329
-
1330
- /*
1331
- The LogService is really just a wrapper around the existing console logging functionality
1332
- The three main reasons for using this service are:
1333
- 1. The abstraction layer will allow us to pick a different logging endpoint if needed
1334
- 2. This service allows you to specify what level verbosity you want this service tp log with
1335
- 3. Has logic to log method entry and exit points automagically
1336
- */
1337
- class LogService {
1338
- logLevel = 'Info';
1339
- _className = "";
1340
- get className() { return this._className; }
1341
- set className(value) {
1342
- this._className = value;
1343
- this.methodName = "constructor()";
1344
- }
1345
- _methodName = "";
1346
- get methodName() { return this._methodName; }
1347
- set methodName(value) {
1348
- if (value === "" && this.logLevel != 'None') {
1349
- this.info("End of method");
1350
- console.groupEnd();
1351
- console.timeEnd(this.targetName);
1352
- this._methodName = value;
1353
- }
1354
- else if (this.logLevel != 'None') {
1355
- this._methodName = value;
1356
- console.group(this.targetName);
1357
- console.time(this.targetName);
1358
- this.info("Start of method");
1359
- }
1360
- }
1361
- get targetName() {
1362
- if (this.methodName === "")
1363
- return this.className;
1364
- else
1365
- return this.className + "." + this.methodName;
1366
- }
1367
- get prefix() {
1368
- return Date.now().toLocaleString() + " " + this.targetName + "> ";
1369
- }
1370
- log(message, ...optionalParams) {
1371
- if (this.logLevel != 'None') {
1372
- if (this.targetName != this.className)
1373
- console.timeLog(this.targetName, this.prefix + " " + message, optionalParams);
1374
- else
1375
- console.log(this.prefix + " " + message, optionalParams);
1376
- }
1377
- }
1378
- info(message, ...optionalParams) {
1379
- if (this.logLevel === 'Debug' || this.logLevel === 'Info') {
1380
- if (this.targetName != this.className)
1381
- console.timeLog(this.targetName, this.prefix + " " + message, optionalParams);
1382
- else
1383
- console.info(this.prefix + " " + message, optionalParams);
1384
- }
1385
- }
1386
- warn(message, ...optionalParams) {
1387
- if (this.logLevel === 'Warn' || this.logLevel === 'Debug' || this.logLevel === 'Info') {
1388
- if (this.targetName != this.className) {
1389
- console.timeEnd(this.targetName);
1390
- console.time(this.targetName);
1391
- }
1392
- console.warn(this.prefix + " " + message, optionalParams);
1393
- }
1394
- }
1395
- error(message, ...optionalParams) {
1396
- if (this.logLevel != 'None') {
1397
- if (this.targetName != this.className) {
1398
- console.timeEnd(this.targetName);
1399
- console.time(this.targetName);
1400
- }
1401
- console.error(this.prefix + " " + message, optionalParams);
1402
- }
1403
- }
1404
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1405
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LogService, providedIn: 'root' });
1406
- }
1407
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LogService, decorators: [{
1408
- type: Injectable,
1409
- args: [{
1410
- providedIn: 'root'
1411
- }]
1412
- }] });
1413
-
1414
- class ConfigService {
1415
- logService;
1416
- mockData = false;
1417
- configClient;
1418
- configConnectString;
1419
- _configCache;
1420
- get configCache() {
1421
- return this._configCache;
1422
- }
1423
- set configCache(value) {
1424
- this._configCache = value;
1425
- }
1426
- constructor(logService) {
1427
- this.logService = logService;
1428
- this.logService.className = "ConfigService";
1429
- this.configConnectString = "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=tyjA;Secret=1FgL95lHkXViZX4Qf2GcRqn26mhTYDVYany8ToXpTnO68AzrdUUEJQQJ99AHAC8vTInIcYexAAACAZACsteF";
1430
- this.configClient = new AppConfigurationClient(this.configConnectString);
1431
- this.logService.log("Config Client", this.configClient);
1432
- this.logService.methodName = "";
1433
- }
1434
- async getConfigurationSettingAsync(key, label) {
1435
- this.logService.methodName = "getConfigurationSettingAsync()";
1436
- const setting = await this.configClient.getConfigurationSetting({ key: key, label: label.replace(".", "") });
1437
- this.logService.log("Configuration Setting Key/Value", key, setting.value);
1438
- return setting.value;
1439
- }
1440
- async setConfigurationSettingAsync(templateName, label, setting, contentType = "Text") {
1441
- this.logService.className = "ConfigService";
1442
- this.logService.methodName = "setConfigurationSettingAsync()";
1443
- const configurationSetting = {
1444
- key: templateName,
1445
- label: label,
1446
- value: setting,
1447
- contentType: contentType,
1448
- };
1449
- this.logService.log("Setting", configurationSetting);
1450
- await this.configClient.setConfigurationSetting(configurationSetting);
1451
- this.logService.methodName = "";
1452
- }
1453
- async getConfigAsync(company) {
1454
- this.logService.className = "ConfigService";
1455
- this.logService.methodName = "getConfigAsync()";
1456
- if (this.configCache == undefined) {
1457
- this.logService.log("configCache == undefined");
1458
- // If we want to use Mock data then load the Mock data into the cache
1459
- if (this.mockData) {
1460
- this.configCache = MockConfig;
1461
- }
1462
- else {
1463
- const jsonConfig = await this.getConfigurationSettingAsync("App.Config.Json", company) ?? "{ }";
1464
- this.configCache = JSON.parse(jsonConfig);
1465
- }
1466
- }
1467
- this.logService.log("Config Cache", this.configCache);
1468
- const config = this.configCache;
1469
- this.logService.methodName = "";
1470
- return config;
1471
- }
1472
- async saveConfigAsync(config, company) {
1473
- this.logService.className = "ConfigService";
1474
- this.logService.methodName = "saveConfigAsync()";
1475
- // Update configuration cache
1476
- this.configCache = config;
1477
- this.logService.log("Updated Config Cache", this.configCache);
1478
- if (this.mockData) {
1479
- return;
1480
- }
1481
- await this.setConfigurationSettingAsync("App.Config.Json", company, config, "JSON");
1482
- this.logService.methodName = "";
1483
- }
1484
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConfigService, deps: [{ token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
1485
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConfigService, providedIn: 'root' });
1486
- }
1487
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConfigService, decorators: [{
1488
- type: Injectable,
1489
- args: [{
1490
- providedIn: 'root'
1491
- }]
1492
- }], ctorParameters: () => [{ type: LogService }] });
1493
-
1494
- const MockInventoryApiResponse = {
1495
- "status": 200,
1496
- "data": [
1497
- {
1498
- "brand": "Portland Cannabis Market",
1211
+ "brand": "Garden First",
1499
1212
  "cannabinoidInformation": [
1500
1213
  {
1501
- "lowerRange": 0,
1502
- "name": "cbd",
1214
+ "lowerRange": 25.5,
1215
+ "name": "thc",
1503
1216
  "unitOfMeasure": "%",
1504
1217
  "unitOfMeasureToGramsMultiplier": null,
1505
- "upperRange": 0
1218
+ "upperRange": 25.5
1506
1219
  },
1507
1220
  {
1508
- "lowerRange": 25.25,
1509
- "name": "thc",
1221
+ "lowerRange": 0.1,
1222
+ "name": "cbd",
1510
1223
  "unitOfMeasure": "%",
1511
1224
  "unitOfMeasureToGramsMultiplier": null,
1512
- "upperRange": 25.25
1225
+ "upperRange": 0.1
1513
1226
  }
1514
1227
  ],
1515
1228
  "category": "Flower",
1516
1229
  "clientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
1517
- "createdAt": "2024-05-06T21:41:03Z",
1230
+ "costInMinorUnits": 374,
1231
+ "createdAt": "2024-06-14T21:25:49Z",
1518
1232
  "currencyCode": "USD",
1519
1233
  "customCategoryName": null,
1520
1234
  "erpId": null,
@@ -1523,172 +1237,83 @@ const MockInventoryApiResponse = {
1523
1237
  "inventoryUnitOfMeasure": "grams",
1524
1238
  "inventoryUnitOfMeasureToGramsMultiplier": 1,
1525
1239
  "invoiceNumber": null,
1526
- "isMixAndMatch": false,
1240
+ "isMixAndMatch": true,
1527
1241
  "isSoldByWeight": true,
1528
1242
  "isStackable": true,
1529
1243
  "locationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae",
1530
1244
  "locationName": "Portland Pot Shop",
1531
1245
  "manifestId": null,
1532
1246
  "nutrients": null,
1533
- "parentproductId": "88caa95f-8a25-4960-ae1f-0894d86e8f02",
1534
- "parentproductName": "Royal Hindu Truffle by Upper Rogue Terraces",
1535
- "postTaxPriceInPennies": 800,
1536
- "preTaxPriceInPennies": 667,
1537
- "priceInMinorUnits": 667,
1247
+ "parentproductId": "798c79ac-7b88-425d-bd2f-c8684fdac27f",
1248
+ "parentproductName": "Donny Burger by Garden First",
1249
+ "postTaxPriceInPennies": 1200,
1250
+ "preTaxPriceInPennies": 1000,
1251
+ "priceInMinorUnits": 1000,
1538
1252
  "productDescription": "",
1539
- "productId": "df363dba-1cd3-402e-b6c3-b3697abed6ee",
1540
- "productName": "Royal Hindu Truffle by Upper Rogue Terraces",
1253
+ "productId": "db3b1fdc-f0b3-4936-afae-c0a828abfbaf",
1254
+ "productName": "Donny Burger by Garden First",
1541
1255
  "productPictureURL": null,
1542
1256
  "productUnitOfMeasure": "grams",
1543
1257
  "productUnitOfMeasureToGramsMultiplier": 1,
1544
- "productUpdatedAt": "2024-06-30T02:42:59.621977Z",
1258
+ "productUpdatedAt": "2024-06-30T02:42:36.303028Z",
1545
1259
  "productWeight": null,
1546
1260
  "purchaseCategory": "rec",
1547
- "quantity": 146.89,
1548
- "regulatoryId": "1A4010300000D4A000001042",
1549
- "sku": "zddCdpqRvw",
1261
+ "quantity": 95.8,
1262
+ "regulatoryId": "1A4010300016ECD000037910",
1263
+ "sku": "FSS0cRLR6G",
1550
1264
  "speciesName": "Indica",
1551
- "supplierName": "Portland Cannabis Market",
1265
+ "supplierName": "Hunter Distributing",
1552
1266
  "terpenes": null,
1553
1267
  "type": null,
1554
- "variantId": "b0ed44e0-68df-44f3-a34a-f05bb5bd8ae0",
1268
+ "variantId": "c3beca27-92a6-413a-938f-f8cf699d1b86",
1555
1269
  "variantName": "",
1556
1270
  "weightTierInformation": [
1557
1271
  {
1558
1272
  "gramAmount": 1,
1559
1273
  "name": "Grams",
1560
- "pricePerUnitInMinorUnits": 667
1274
+ "pricePerUnitInMinorUnits": 1000
1561
1275
  },
1562
1276
  {
1563
1277
  "gramAmount": 3.5,
1564
1278
  "name": "Eighth",
1565
- "pricePerUnitInMinorUnits": 2167
1279
+ "pricePerUnitInMinorUnits": 3083
1566
1280
  },
1567
1281
  {
1568
1282
  "gramAmount": 7,
1569
1283
  "name": "Quarter",
1570
- "pricePerUnitInMinorUnits": 3833
1284
+ "pricePerUnitInMinorUnits": 5417
1571
1285
  },
1572
1286
  {
1573
1287
  "gramAmount": 14,
1574
1288
  "name": "Half-Ounce",
1575
- "pricePerUnitInMinorUnits": 7000
1289
+ "pricePerUnitInMinorUnits": 10000
1576
1290
  },
1577
1291
  {
1578
1292
  "gramAmount": 28,
1579
1293
  "name": "Ounce",
1580
- "pricePerUnitInMinorUnits": 12917
1294
+ "pricePerUnitInMinorUnits": 18750
1581
1295
  }
1582
- ],
1583
- costInMinorUnits: 0
1296
+ ]
1584
1297
  },
1585
1298
  {
1586
- "brand": "Garden First",
1299
+ "brand": "Portland Pot Shop",
1587
1300
  "cannabinoidInformation": [
1588
1301
  {
1589
- "lowerRange": 25.5,
1302
+ "lowerRange": 35.41,
1590
1303
  "name": "thc",
1591
1304
  "unitOfMeasure": "%",
1592
1305
  "unitOfMeasureToGramsMultiplier": null,
1593
- "upperRange": 25.5
1306
+ "upperRange": 35.41
1594
1307
  },
1595
1308
  {
1596
- "lowerRange": 0.1,
1309
+ "lowerRange": 0.13,
1597
1310
  "name": "cbd",
1598
1311
  "unitOfMeasure": "%",
1599
1312
  "unitOfMeasureToGramsMultiplier": null,
1600
- "upperRange": 0.1
1313
+ "upperRange": 0.13
1601
1314
  }
1602
1315
  ],
1603
- "category": "Flower",
1604
- "clientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
1605
- "costInMinorUnits": 374,
1606
- "createdAt": "2024-06-14T21:25:49Z",
1607
- "currencyCode": "USD",
1608
- "customCategoryName": null,
1609
- "erpId": null,
1610
- "erpName": null,
1611
- "expirationDate": null,
1612
- "inventoryUnitOfMeasure": "grams",
1613
- "inventoryUnitOfMeasureToGramsMultiplier": 1,
1614
- "invoiceNumber": null,
1615
- "isMixAndMatch": true,
1616
- "isSoldByWeight": true,
1617
- "isStackable": true,
1618
- "locationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae",
1619
- "locationName": "Portland Pot Shop",
1620
- "manifestId": null,
1621
- "nutrients": null,
1622
- "parentproductId": "798c79ac-7b88-425d-bd2f-c8684fdac27f",
1623
- "parentproductName": "Donny Burger by Garden First",
1624
- "postTaxPriceInPennies": 1200,
1625
- "preTaxPriceInPennies": 1000,
1626
- "priceInMinorUnits": 1000,
1627
- "productDescription": "",
1628
- "productId": "db3b1fdc-f0b3-4936-afae-c0a828abfbaf",
1629
- "productName": "Donny Burger by Garden First",
1630
- "productPictureURL": null,
1631
- "productUnitOfMeasure": "grams",
1632
- "productUnitOfMeasureToGramsMultiplier": 1,
1633
- "productUpdatedAt": "2024-06-30T02:42:36.303028Z",
1634
- "productWeight": null,
1635
- "purchaseCategory": "rec",
1636
- "quantity": 95.8,
1637
- "regulatoryId": "1A4010300016ECD000037910",
1638
- "sku": "FSS0cRLR6G",
1639
- "speciesName": "Indica",
1640
- "supplierName": "Hunter Distributing",
1641
- "terpenes": null,
1642
- "type": null,
1643
- "variantId": "c3beca27-92a6-413a-938f-f8cf699d1b86",
1644
- "variantName": "",
1645
- "weightTierInformation": [
1646
- {
1647
- "gramAmount": 1,
1648
- "name": "Grams",
1649
- "pricePerUnitInMinorUnits": 1000
1650
- },
1651
- {
1652
- "gramAmount": 3.5,
1653
- "name": "Eighth",
1654
- "pricePerUnitInMinorUnits": 3083
1655
- },
1656
- {
1657
- "gramAmount": 7,
1658
- "name": "Quarter",
1659
- "pricePerUnitInMinorUnits": 5417
1660
- },
1661
- {
1662
- "gramAmount": 14,
1663
- "name": "Half-Ounce",
1664
- "pricePerUnitInMinorUnits": 10000
1665
- },
1666
- {
1667
- "gramAmount": 28,
1668
- "name": "Ounce",
1669
- "pricePerUnitInMinorUnits": 18750
1670
- }
1671
- ]
1672
- },
1673
- {
1674
- "brand": "Portland Pot Shop",
1675
- "cannabinoidInformation": [
1676
- {
1677
- "lowerRange": 35.41,
1678
- "name": "thc",
1679
- "unitOfMeasure": "%",
1680
- "unitOfMeasureToGramsMultiplier": null,
1681
- "upperRange": 35.41
1682
- },
1683
- {
1684
- "lowerRange": 0.13,
1685
- "name": "cbd",
1686
- "unitOfMeasure": "%",
1687
- "unitOfMeasureToGramsMultiplier": null,
1688
- "upperRange": 0.13
1689
- }
1690
- ],
1691
- "category": "Pre-Roll",
1316
+ "category": "Pre-Roll",
1692
1317
  "clientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
1693
1318
  "costInMinorUnits": 55,
1694
1319
  "createdAt": "2024-06-10T21:55:43Z",
@@ -27234,256 +26859,706 @@ const MockInventoryApiResponse = {
27234
26859
  "variantName": "",
27235
26860
  "weightTierInformation": null
27236
26861
  }
27237
- ]
27238
- };
27239
-
27240
- class BaseApiService {
27241
- configService;
27242
- httpClient;
27243
- logService;
27244
- config;
27245
- get apiBaseUrl() {
27246
- if (this.config)
27247
- return this.config.apiBaseUrl;
27248
- else
27249
- return Utilities.baseUrl();
26862
+ ]
26863
+ };
26864
+
26865
+ const MockConfig = {
26866
+ "authConfig": {
26867
+ "logLevel": "Info",
26868
+ "configConnectString": "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=tyjA;Secret=1FgL95lHkXViZX4Qf2GcRqn26mhTYDVYany8ToXpTnO68AzrdUUEJQQJ99AHAC8vTInIcYexAAACAZACsteF",
26869
+ "clientId": "af1486e0-a27f-4c8d-8503-0752d90ce72d",
26870
+ "tenantId": "445012c4-563a-4795-84d0-f7473a3197e0",
26871
+ "authority": "https://login.microsoft.com/445012c4-563a-4795-84d0-f7473a3197e0",
26872
+ "scopes": "openid,email,profile",
26873
+ "menu_uri": "http://localhost:4200/",
26874
+ "redirect_uri": "https://www.cheapweedmenu.com",
26875
+ "logout_redirect_uri": "https://www.cheapweedmenu.com",
26876
+ "prompt": "login"
26877
+ },
26878
+ "apiConfig": {
26879
+ "apiBaseUrl": "https://cheap-weed-menus-webapi.azurewebsites.net",
26880
+ "addCustomerApiRoute": "/AddCustomer",
26881
+ "addSubscriptionApiRoute": "/subscription",
26882
+ "getInventoryApiRoute": "/inventory",
26883
+ "apiKey": "8b66d117-5d23-4b81-8c2f-52142c67d0cd",
26884
+ "clientId": "5dd15878-aa4c-4adf-8650-b931f32a7b67",
26885
+ "locationId": "10f19fc5-31d0-4d76-bad4-ad593c9803ae"
26886
+ },
26887
+ "menuBoardConfig": {
26888
+ "amountToScroll": 1,
26889
+ "autoScrollTimeout": 20,
26890
+ "dataAgeThreshold": 300000
26891
+ },
26892
+ "footerCarouselConfig": {
26893
+ "slidesToShow": 3,
26894
+ "slidesToScroll": 1,
26895
+ "dots": false,
26896
+ "infinite": true,
26897
+ "autoplay": true,
26898
+ "autoplaySpeed": 10000,
26899
+ "speed": 500,
26900
+ "arrows": false
26901
+ },
26902
+ "footerCarouselSlideConfig": [
26903
+ {
26904
+ "image": "../../../images/sunday.png",
26905
+ "title": "CBD Sunday",
26906
+ "description": "20% off all CBD products & house pre-rolls",
26907
+ "highlighted": false,
26908
+ "textColor": "white",
26909
+ "backgroundColor": "black"
26910
+ },
26911
+ {
26912
+ "image": "../../../images/new-monday.jpg",
26913
+ "title": "Edible Monday",
26914
+ "description": "10% off edibles",
26915
+ "highlighted": false,
26916
+ "textColor": "white",
26917
+ "backgroundColor": "black"
26918
+ },
26919
+ {
26920
+ "image": "../../../images/tuesday.png",
26921
+ "title": "Doobie Tuesday",
26922
+ "description": "10% off all pre-rolls & packs<",
26923
+ "highlighted": false,
26924
+ "textColor": "black",
26925
+ "backgroundColor": "white"
26926
+ },
26927
+ {
26928
+ "image": "../../../images/wednesday.png",
26929
+ "title": "Weed Crush Wednesday",
26930
+ "description": "10% off all jar bud",
26931
+ "highlighted": false,
26932
+ "textColor": "black",
26933
+ "backgroundColor": "white"
26934
+ },
26935
+ {
26936
+ "image": "../../../images/thursday.png",
26937
+ "title": "Thirsty Thursday",
26938
+ "description": "10% off Tinctures, RSO & cartridges",
26939
+ "highlighted": false,
26940
+ "textColor": "black",
26941
+ "backgroundColor": "white"
26942
+ },
26943
+ {
26944
+ "image": "../../../images/friday.png",
26945
+ "title": "Fire Friday",
26946
+ "description": "10% off all jar bud",
26947
+ "highlighted": false,
26948
+ "textColor": "black",
26949
+ "backgroundColor": "white"
26950
+ },
26951
+ {
26952
+ "image": "../../../images/saturday.png",
26953
+ "title": "Shatterday Saturday",
26954
+ "description": "10% off all concentrate",
26955
+ "highlighted": false,
26956
+ "textColor": "white",
26957
+ "backgroundColor": "black"
26958
+ }
26959
+ ]
26960
+ };
26961
+
26962
+ const MockProfile = {
26963
+ companyName: "The Portland Pot Shop",
26964
+ businessPhones: ["503.555.1212"],
26965
+ displayName: "PPS User",
26966
+ givenName: "PPS Menu User",
26967
+ id: "",
26968
+ jobTitle: "Menu",
26969
+ mail: "portlandpotshop@google.com",
26970
+ mobilePhone: "503.555.1212",
26971
+ officeLocation: "autoscroll",
26972
+ photoUrl: "",
26973
+ preferredLanguage: "en-us",
26974
+ surname: "Pot Shop",
26975
+ userPrincipalName: "portlandpotshop"
26976
+ };
26977
+
26978
+ class AuthService {
26979
+ constructor() {
26980
+ }
26981
+ static getAuthConfig() {
26982
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26983
+ const wind = window;
26984
+ return wind.authConfig;
26985
+ }
26986
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
26987
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthService, providedIn: 'root' });
26988
+ }
26989
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthService, decorators: [{
26990
+ type: Injectable,
26991
+ args: [{
26992
+ providedIn: 'root'
26993
+ }]
26994
+ }], ctorParameters: () => [] });
26995
+
26996
+ /*
26997
+ The LogService is really just a wrapper around the existing console logging functionality
26998
+ The three main reasons for using this service are:
26999
+ 1. The abstraction layer will allow us to pick a different logging endpoint if needed
27000
+ 2. This service allows you to specify what level verbosity you want this service tp log with
27001
+ 3. Has logic to log method entry and exit points automagically
27002
+ */
27003
+ class LogService {
27004
+ logLevel = 'Info';
27005
+ _className = "";
27006
+ get className() { return this._className; }
27007
+ set className(value) {
27008
+ this._className = value;
27009
+ this.methodName = "constructor()";
27010
+ }
27011
+ _methodName = "";
27012
+ get methodName() { return this._methodName; }
27013
+ set methodName(value) {
27014
+ if (value === "" && this.logLevel != 'None') {
27015
+ this.info("End of method");
27016
+ console.groupEnd();
27017
+ console.timeEnd(this.targetName);
27018
+ this._methodName = value;
27019
+ }
27020
+ else if (this.logLevel != 'None') {
27021
+ this._methodName = value;
27022
+ console.group(this.targetName);
27023
+ console.time(this.targetName);
27024
+ this.info("Start of method");
27025
+ }
27026
+ }
27027
+ get targetName() {
27028
+ if (this.methodName === "")
27029
+ return this.className;
27030
+ else
27031
+ return this.className + "." + this.methodName;
27032
+ }
27033
+ get prefix() {
27034
+ return Date.now().toLocaleString() + " " + this.targetName + "> ";
27035
+ }
27036
+ log(message, ...optionalParams) {
27037
+ if (this.logLevel != 'None') {
27038
+ if (this.targetName != this.className)
27039
+ console.timeLog(this.targetName, this.prefix + " " + message, optionalParams);
27040
+ else
27041
+ console.log(this.prefix + " " + message, optionalParams);
27042
+ }
27043
+ }
27044
+ info(message, ...optionalParams) {
27045
+ if (this.logLevel === 'Debug' || this.logLevel === 'Info') {
27046
+ if (this.targetName != this.className)
27047
+ console.timeLog(this.targetName, this.prefix + " " + message, optionalParams);
27048
+ else
27049
+ console.info(this.prefix + " " + message, optionalParams);
27050
+ }
27051
+ }
27052
+ warn(message, ...optionalParams) {
27053
+ if (this.logLevel === 'Warn' || this.logLevel === 'Debug' || this.logLevel === 'Info') {
27054
+ if (this.targetName != this.className) {
27055
+ console.timeEnd(this.targetName);
27056
+ console.time(this.targetName);
27057
+ }
27058
+ console.warn(this.prefix + " " + message, optionalParams);
27059
+ }
27060
+ }
27061
+ error(message, ...optionalParams) {
27062
+ if (this.logLevel != 'None') {
27063
+ if (this.targetName != this.className) {
27064
+ console.timeEnd(this.targetName);
27065
+ console.time(this.targetName);
27066
+ }
27067
+ console.error(this.prefix + " " + message, optionalParams);
27068
+ }
27069
+ }
27070
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27071
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LogService, providedIn: 'root' });
27072
+ }
27073
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LogService, decorators: [{
27074
+ type: Injectable,
27075
+ args: [{
27076
+ providedIn: 'root'
27077
+ }]
27078
+ }] });
27079
+
27080
+ class ConfigService {
27081
+ logService;
27082
+ mockData = false;
27083
+ configClient;
27084
+ configConnectString;
27085
+ _configCache;
27086
+ get configCache() {
27087
+ return this._configCache;
27088
+ }
27089
+ set configCache(value) {
27090
+ this._configCache = value;
27091
+ }
27092
+ constructor(logService) {
27093
+ this.logService = logService;
27094
+ this.logService.className = "ConfigService";
27095
+ this.configConnectString = "Endpoint=https://cheap-weed-menus-appconfig.azconfig.io;Id=tyjA;Secret=1FgL95lHkXViZX4Qf2GcRqn26mhTYDVYany8ToXpTnO68AzrdUUEJQQJ99AHAC8vTInIcYexAAACAZACsteF";
27096
+ this.configClient = new AppConfigurationClient(this.configConnectString);
27097
+ this.logService.log("Config Client", this.configClient);
27098
+ this.logService.methodName = "";
27099
+ }
27100
+ async getConfigurationSettingAsync(key, label) {
27101
+ this.logService.methodName = "getConfigurationSettingAsync()";
27102
+ const setting = await this.configClient.getConfigurationSetting({ key: key, label: label.replace(".", "") });
27103
+ this.logService.log("Configuration Setting Key/Value", key, setting.value);
27104
+ return setting.value;
27105
+ }
27106
+ async setConfigurationSettingAsync(templateName, label, setting, contentType = "Text") {
27107
+ this.logService.className = "ConfigService";
27108
+ this.logService.methodName = "setConfigurationSettingAsync()";
27109
+ const configurationSetting = {
27110
+ key: templateName,
27111
+ label: label,
27112
+ value: setting,
27113
+ contentType: contentType,
27114
+ };
27115
+ this.logService.log("Setting", configurationSetting);
27116
+ await this.configClient.setConfigurationSetting(configurationSetting);
27117
+ this.logService.methodName = "";
27118
+ }
27119
+ async getConfigAsync(company) {
27120
+ this.logService.className = "ConfigService";
27121
+ this.logService.methodName = "getConfigAsync()";
27122
+ if (this.configCache == undefined) {
27123
+ this.logService.log("configCache == undefined");
27124
+ // If we want to use Mock data then load the Mock data into the cache
27125
+ if (this.mockData) {
27126
+ this.configCache = MockConfig;
27127
+ }
27128
+ else {
27129
+ const jsonConfig = await this.getConfigurationSettingAsync("App.Config.Json", company) ?? "{ }";
27130
+ this.configCache = JSON.parse(jsonConfig);
27131
+ }
27132
+ }
27133
+ this.logService.log("Config Cache", this.configCache);
27134
+ const config = this.configCache;
27135
+ this.logService.methodName = "";
27136
+ return config;
27137
+ }
27138
+ async saveConfigAsync(config, company) {
27139
+ this.logService.className = "ConfigService";
27140
+ this.logService.methodName = "saveConfigAsync()";
27141
+ // Update configuration cache
27142
+ this.configCache = config;
27143
+ this.logService.log("Updated Config Cache", this.configCache);
27144
+ if (this.mockData) {
27145
+ return;
27146
+ }
27147
+ await this.setConfigurationSettingAsync("App.Config.Json", company, config, "JSON");
27148
+ this.logService.methodName = "";
27149
+ }
27150
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConfigService, deps: [{ token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
27151
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConfigService, providedIn: 'root' });
27152
+ }
27153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ConfigService, decorators: [{
27154
+ type: Injectable,
27155
+ args: [{
27156
+ providedIn: 'root'
27157
+ }]
27158
+ }], ctorParameters: () => [{ type: LogService }] });
27159
+
27160
+ class BaseApiService {
27161
+ configService;
27162
+ httpClient;
27163
+ logService;
27164
+ config;
27165
+ get apiBaseUrl() {
27166
+ if (this.config)
27167
+ return this.config.apiBaseUrl;
27168
+ else
27169
+ return Utilities.baseUrl();
27170
+ }
27171
+ get apiFullUrl() {
27172
+ return this.apiBaseUrl;
27173
+ }
27174
+ constructor(configService, httpClient, logService) {
27175
+ this.configService = configService;
27176
+ this.httpClient = httpClient;
27177
+ this.logService = logService;
27178
+ }
27179
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BaseApiService, deps: [{ token: ConfigService }, { token: i2$1.HttpClient }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
27180
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BaseApiService, providedIn: 'root' });
27181
+ }
27182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BaseApiService, decorators: [{
27183
+ type: Injectable,
27184
+ args: [{
27185
+ providedIn: 'root'
27186
+ }]
27187
+ }], ctorParameters: () => [{ type: ConfigService }, { type: i2$1.HttpClient }, { type: LogService }] });
27188
+
27189
+ class CustomerApiService extends BaseApiService {
27190
+ get apiFullUrl() {
27191
+ return this.apiBaseUrl + this.config?.addCustomerApiRoute;
27192
+ }
27193
+ async getCustomerAsync(customerId) { return; }
27194
+ async getCustomersAsync() { return; }
27195
+ async setCustomerAsync(companyName, customer) {
27196
+ this.config = (await this.configService.getConfigAsync(companyName)).apiConfig;
27197
+ return;
27198
+ }
27199
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CustomerApiService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
27200
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CustomerApiService, providedIn: 'root' });
27201
+ }
27202
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CustomerApiService, decorators: [{
27203
+ type: Injectable,
27204
+ args: [{
27205
+ providedIn: 'root'
27206
+ }]
27207
+ }] });
27208
+
27209
+ class InventoryApiService extends BaseApiService {
27210
+ demoData = false;
27211
+ constructor(configService, httpClient, logService) {
27212
+ super(configService, httpClient, logService);
27213
+ logService.className = "InventoryApiService";
27214
+ }
27215
+ get httpHeaders() {
27216
+ return new HttpHeaders()
27217
+ .set('key', this.config?.apiKey)
27218
+ .set('clientId', this.config?.clientId)
27219
+ .set('locationId', this.config?.locationId);
27220
+ }
27221
+ get apiFullUrl() {
27222
+ return this.apiBaseUrl + this.config?.getInventoryApiRoute;
27223
+ }
27224
+ async getProductsAsync(companyName = "Cheap Weed Menus") {
27225
+ this.logService.methodName = "getProductsAsync()";
27226
+ var response;
27227
+ this.logService.log("Fetching Products for Company", companyName);
27228
+ if (this.demoData) {
27229
+ this.config = MockConfig.apiConfig;
27230
+ response = Promise.resolve(MockInventoryApiResponse);
27231
+ this.logService.log("Mock Data Returned", response);
27232
+ }
27233
+ else {
27234
+ this.config = (await this.configService.getConfigAsync(companyName)).apiConfig;
27235
+ response = firstValueFrom(this.httpClient.get(this.apiFullUrl, { headers: this.httpHeaders }));
27236
+ this.logService.log("Inventory API Response", response);
27237
+ }
27238
+ this.logService.methodName = "";
27239
+ return response;
27240
+ }
27241
+ async getCategoriesAsync(companyName) {
27242
+ { }
27243
+ const productApiResponse = await this.getProductsAsync(companyName);
27244
+ return keys(countBy(productApiResponse.data, (product) => product.category));
27245
+ }
27246
+ async getProductsByAllCategories(companyName) {
27247
+ const productApiResponse = await this.getProductsAsync(companyName);
27248
+ if (productApiResponse.status != HttpStatusCode.Ok) {
27249
+ throw new Error(`ProductApiResponse status: ${productApiResponse.status}`);
27250
+ }
27251
+ const allProducts = productApiResponse.data.map((value) => Product.FromFlowhubProduct(value))
27252
+ .sort((a, b) => a.category.localeCompare(b.category));
27253
+ const allCategories = keys(countBy(allProducts, (product) => product.category))
27254
+ .map((category) => Category.MapFromString(category));
27255
+ const productsByAllCategories = [];
27256
+ allCategories.sort().forEach(category => productsByAllCategories.push({
27257
+ key: category.name,
27258
+ value: allProducts.filter((product) => product.category === category.name &&
27259
+ product.quantity > 0).sort()
27260
+ }));
27261
+ return productsByAllCategories;
27262
+ }
27263
+ ;
27264
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InventoryApiService, deps: [{ token: ConfigService }, { token: i2$1.HttpClient }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
27265
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InventoryApiService, providedIn: 'root' });
27266
+ }
27267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InventoryApiService, decorators: [{
27268
+ type: Injectable,
27269
+ args: [{
27270
+ providedIn: 'root'
27271
+ }]
27272
+ }], ctorParameters: () => [{ type: ConfigService }, { type: i2$1.HttpClient }, { type: LogService }] });
27273
+
27274
+ /**
27275
+ * Provides a wrapper for accessing the web storage API and synchronizing session storage across tabs/windows.
27276
+ */
27277
+ class LocalStorageService {
27278
+ static syncListenerInitialized = false;
27279
+ syncKeys = [];
27280
+ initEvent = new Subject();
27281
+ reservedKeys = [
27282
+ 'sync_keys',
27283
+ 'addToSyncKeys',
27284
+ 'removeFromSyncKeys',
27285
+ 'getSessionStorage',
27286
+ 'setSessionStorage',
27287
+ 'addToSessionStorage',
27288
+ 'removeFromSessionStorage',
27289
+ 'clearAllSessionsStorage'
27290
+ ];
27291
+ InitializeStorageSyncListener() {
27292
+ if (LocalStorageService.syncListenerInitialized == true) {
27293
+ return;
27294
+ }
27295
+ LocalStorageService.syncListenerInitialized = true;
27296
+ window.addEventListener('storage', this.sessionStorageTransferHandler, false);
27297
+ this.syncSessionStorage();
27298
+ }
27299
+ deInitializeStorageSyncListener() {
27300
+ window.removeEventListener('storage', this.sessionStorageTransferHandler, false);
27301
+ LocalStorageService.syncListenerInitialized = false;
27302
+ }
27303
+ clearAllStorage() {
27304
+ this.clearAllSessionsStorage();
27305
+ this.clearLocalStorage();
27306
+ }
27307
+ clearAllSessionsStorage() {
27308
+ this.clearInstanceSessionStorage();
27309
+ localStorage.removeItem(DbKeys.SYNC_KEYS);
27310
+ localStorage.setItem('clearAllSessionsStorage', '_dummy');
27311
+ localStorage.removeItem('clearAllSessionsStorage');
27312
+ }
27313
+ clearInstanceSessionStorage() {
27314
+ sessionStorage.clear();
27315
+ this.syncKeys = [];
27316
+ }
27317
+ clearLocalStorage() {
27318
+ localStorage.clear();
27319
+ }
27320
+ saveSessionData(data, key = DbKeys.USER_DATA) {
27321
+ this.testForInvalidKeys(key);
27322
+ this.removeFromSyncKeys(key);
27323
+ localStorage.removeItem(key);
27324
+ this.sessionStorageSetItem(key, data);
27325
+ }
27326
+ saveSyncedSessionData(data, key = DbKeys.USER_DATA) {
27327
+ this.testForInvalidKeys(key);
27328
+ localStorage.removeItem(key);
27329
+ this.addToSessionStorage(data, key);
27330
+ }
27331
+ savePermanentData(data, key = DbKeys.USER_DATA) {
27332
+ this.testForInvalidKeys(key);
27333
+ this.removeFromSessionStorage(key);
27334
+ this.localStorageSetItem(key, data);
27335
+ }
27336
+ moveDataToSessionStorage(key = DbKeys.USER_DATA) {
27337
+ this.testForInvalidKeys(key);
27338
+ const data = this.getData(key);
27339
+ if (data == null) {
27340
+ return;
27341
+ }
27342
+ this.saveSessionData(data, key);
27343
+ }
27344
+ moveDataToSyncedSessionStorage(key = DbKeys.USER_DATA) {
27345
+ this.testForInvalidKeys(key);
27346
+ const data = this.getData(key);
27347
+ if (data == null) {
27348
+ return;
27349
+ }
27350
+ this.saveSyncedSessionData(data, key);
27351
+ }
27352
+ moveDataToPermanentStorage(key = DbKeys.USER_DATA) {
27353
+ this.testForInvalidKeys(key);
27354
+ const data = this.getData(key);
27355
+ if (data == null) {
27356
+ return;
27357
+ }
27358
+ this.savePermanentData(data, key);
27359
+ }
27360
+ exists(key = DbKeys.USER_DATA) {
27361
+ let data = sessionStorage.getItem(key);
27362
+ if (data == null) {
27363
+ data = localStorage.getItem(key);
27364
+ }
27365
+ return data != null;
27366
+ }
27367
+ getData(key = DbKeys.USER_DATA) {
27368
+ this.testForInvalidKeys(key);
27369
+ let data = this.sessionStorageGetItem(key);
27370
+ if (data == '') {
27371
+ data = this.localStorageGetItem(key);
27372
+ }
27373
+ return data;
27374
+ }
27375
+ getDataObject(key = DbKeys.USER_DATA, isDateType = false) {
27376
+ let data = this.getData(key);
27377
+ if (data != null) {
27378
+ if (isDateType) {
27379
+ data = new Date(data);
27380
+ }
27381
+ return data;
27382
+ }
27383
+ else {
27384
+ return data;
27385
+ }
27386
+ }
27387
+ deleteData(key = DbKeys.USER_DATA) {
27388
+ this.testForInvalidKeys(key);
27389
+ this.removeFromSessionStorage(key);
27390
+ localStorage.removeItem(key);
27391
+ }
27392
+ getInitEvent() {
27393
+ return this.initEvent.asObservable();
27394
+ }
27395
+ sessionStorageTransferHandler = (event) => {
27396
+ if (!event.newValue) {
27397
+ return;
27398
+ }
27399
+ if (event.key == 'getSessionStorage') {
27400
+ if (sessionStorage.length) {
27401
+ this.localStorageSetItem('setSessionStorage', sessionStorage);
27402
+ localStorage.removeItem('setSessionStorage');
27403
+ }
27404
+ }
27405
+ else if (event.key == 'setSessionStorage') {
27406
+ if (!this.syncKeys.length) {
27407
+ this.loadSyncKeys();
27408
+ }
27409
+ const data = JSON.parse(event.newValue);
27410
+ // console.info("Set => Key: Transfer setSessionStorage" + ", data: " + JSON.stringify(data));
27411
+ for (const key in data) {
27412
+ if (this.syncKeysContains(key)) {
27413
+ this.sessionStorageSetItem(key, JSON.parse(data[key]));
27414
+ }
27415
+ }
27416
+ this.onInit();
27417
+ }
27418
+ else if (event.key == 'addToSessionStorage') {
27419
+ const data = JSON.parse(event.newValue);
27420
+ // console.warn("Set => Key: Transfer addToSessionStorage" + ", data: " + JSON.stringify(data));
27421
+ this.addToSessionStorageHelper(data.data, data.key);
27422
+ }
27423
+ else if (event.key == 'removeFromSessionStorage') {
27424
+ this.removeFromSessionStorageHelper(event.newValue);
27425
+ }
27426
+ else if (event.key == 'clearAllSessionsStorage' && sessionStorage.length) {
27427
+ this.clearInstanceSessionStorage();
27428
+ }
27429
+ else if (event.key == 'addToSyncKeys') {
27430
+ this.addToSyncKeysHelper(event.newValue);
27431
+ }
27432
+ else if (event.key == 'removeFromSyncKeys') {
27433
+ this.removeFromSyncKeysHelper(event.newValue);
27434
+ }
27435
+ };
27436
+ syncSessionStorage() {
27437
+ localStorage.setItem('getSessionStorage', '_dummy');
27438
+ localStorage.removeItem('getSessionStorage');
27250
27439
  }
27251
- get apiFullUrl() {
27252
- return this.apiBaseUrl;
27440
+ addToSessionStorage(data, key) {
27441
+ this.addToSessionStorageHelper(data, key);
27442
+ this.addToSyncKeysBackup(key);
27443
+ this.localStorageSetItem('addToSessionStorage', { key, data });
27444
+ localStorage.removeItem('addToSessionStorage');
27253
27445
  }
27254
- constructor(configService, httpClient, logService) {
27255
- this.configService = configService;
27256
- this.httpClient = httpClient;
27257
- this.logService = logService;
27446
+ addToSessionStorageHelper(data, key) {
27447
+ this.addToSyncKeysHelper(key);
27448
+ this.sessionStorageSetItem(key, data);
27258
27449
  }
27259
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BaseApiService, deps: [{ token: ConfigService }, { token: i2.HttpClient }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable });
27260
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BaseApiService });
27261
- }
27262
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BaseApiService, decorators: [{
27263
- type: Injectable
27264
- }], ctorParameters: () => [{ type: ConfigService }, { type: i2.HttpClient }, { type: LogService }] });
27265
-
27266
- class InventoryApiService extends BaseApiService {
27267
- demoData = false;
27268
- get httpHeaders() {
27269
- return new HttpHeaders()
27270
- .set('key', this.config?.apiKey)
27271
- .set('clientId', this.config?.clientId)
27272
- .set('locationId', this.config?.locationId);
27450
+ removeFromSessionStorage(keyToRemove) {
27451
+ this.removeFromSessionStorageHelper(keyToRemove);
27452
+ this.removeFromSyncKeysBackup(keyToRemove);
27453
+ localStorage.setItem('removeFromSessionStorage', keyToRemove);
27454
+ localStorage.removeItem('removeFromSessionStorage');
27273
27455
  }
27274
- get apiFullUrl() {
27275
- return this.apiBaseUrl + this.config?.getInventoryApiRoute;
27456
+ removeFromSessionStorageHelper(keyToRemove) {
27457
+ sessionStorage.removeItem(keyToRemove);
27458
+ this.removeFromSyncKeysHelper(keyToRemove);
27276
27459
  }
27277
- async getProductsAsync(companyName) {
27278
- this.config = (await this.configService.getConfigAsync(companyName)).apiConfig;
27279
- if (this.demoData) {
27280
- return Promise.resolve(MockInventoryApiResponse);
27460
+ testForInvalidKeys(key) {
27461
+ if (!key) {
27462
+ throw new Error('key cannot be empty');
27463
+ }
27464
+ if (this.reservedKeys.some(x => x == key)) {
27465
+ throw new Error(`The storage key "${key}" is reserved and cannot be used. Please use a different key`);
27466
+ }
27467
+ }
27468
+ syncKeysContains(key) {
27469
+ if (Array.isArray(this.syncKeys))
27470
+ return this.syncKeys.some(x => x == key);
27471
+ else
27472
+ return false;
27473
+ }
27474
+ loadSyncKeys() {
27475
+ if (this.syncKeys.length) {
27476
+ return;
27477
+ }
27478
+ this.syncKeys = this.getSyncKeysFromStorage();
27479
+ }
27480
+ getSyncKeysFromStorage(defaultValue = []) {
27481
+ const data = this.localStorageGetItem(DbKeys.SYNC_KEYS);
27482
+ if (data == null) {
27483
+ return defaultValue;
27281
27484
  }
27282
27485
  else {
27283
- return firstValueFrom(this.httpClient.get(this.apiFullUrl, { headers: this.httpHeaders }));
27486
+ return data;
27284
27487
  }
27285
27488
  }
27286
- async getCategoriesAsync(companyName) {
27287
- { }
27288
- const productApiResponse = await this.getProductsAsync(companyName);
27289
- return keys(countBy(productApiResponse.data, (product) => product.category));
27489
+ addToSyncKeys(key) {
27490
+ this.addToSyncKeysHelper(key);
27491
+ this.addToSyncKeysBackup(key);
27492
+ localStorage.setItem('addToSyncKeys', key);
27493
+ localStorage.removeItem('addToSyncKeys');
27290
27494
  }
27291
- async getProductsByAllCategories(companyName) {
27292
- const productApiResponse = await this.getProductsAsync(companyName);
27293
- if (productApiResponse.status != HttpStatusCode.Ok) {
27294
- throw new Error(`ProductApiResponse status: ${productApiResponse.status}`);
27495
+ addToSyncKeysBackup(key) {
27496
+ const storedSyncKeys = this.getSyncKeysFromStorage();
27497
+ if (!storedSyncKeys.some(x => x == key)) {
27498
+ storedSyncKeys.push(key);
27499
+ this.localStorageSetItem(DbKeys.SYNC_KEYS, storedSyncKeys);
27295
27500
  }
27296
- const allProducts = productApiResponse.data.map((value) => Product.FromFlowhubProduct(value))
27297
- .sort((a, b) => a.category.localeCompare(b.category));
27298
- const allCategories = keys(countBy(allProducts, (product) => product.category))
27299
- .map((category) => Category.MapFromString(category));
27300
- const productsByAllCategories = [];
27301
- allCategories.sort().forEach(category => productsByAllCategories.push({
27302
- key: category.name,
27303
- value: allProducts.filter((product) => product.category === category.name &&
27304
- product.quantity > 0).sort()
27305
- }));
27306
- return productsByAllCategories;
27307
27501
  }
27308
- ;
27309
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InventoryApiService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
27310
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InventoryApiService });
27311
- }
27312
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: InventoryApiService, decorators: [{
27313
- type: Injectable
27314
- }] });
27315
-
27316
- class AuthService {
27317
- constructor() {
27502
+ removeFromSyncKeysBackup(key) {
27503
+ const storedSyncKeys = this.getSyncKeysFromStorage();
27504
+ const index = storedSyncKeys.indexOf(key);
27505
+ if (index > -1) {
27506
+ storedSyncKeys.splice(index, 1);
27507
+ this.localStorageSetItem(DbKeys.SYNC_KEYS, storedSyncKeys);
27508
+ }
27318
27509
  }
27319
- static getAuthConfig() {
27320
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
27321
- const wind = window;
27322
- return wind.authConfig;
27510
+ addToSyncKeysHelper(key) {
27511
+ if (!this.syncKeysContains(key)) {
27512
+ this.syncKeys.push(key);
27513
+ }
27323
27514
  }
27324
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27325
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthService, providedIn: 'root' });
27326
- }
27327
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AuthService, decorators: [{
27328
- type: Injectable,
27329
- args: [{
27330
- providedIn: 'root'
27331
- }]
27332
- }], ctorParameters: () => [] });
27333
-
27334
- class CustomerApiService extends BaseApiService {
27335
- get apiFullUrl() {
27336
- return this.apiBaseUrl + this.config?.addCustomerApiRoute;
27515
+ removeFromSyncKeys(key) {
27516
+ this.removeFromSyncKeysHelper(key);
27517
+ this.removeFromSyncKeysBackup(key);
27518
+ localStorage.setItem('removeFromSyncKeys', key);
27519
+ localStorage.removeItem('removeFromSyncKeys');
27337
27520
  }
27338
- async getCustomerAsync(customerId) { return; }
27339
- async getCustomersAsync() { return; }
27340
- async setCustomerAsync(companyName, customer) {
27341
- this.config = (await this.configService.getConfigAsync(companyName)).apiConfig;
27342
- return;
27521
+ removeFromSyncKeysHelper(key) {
27522
+ const index = this.syncKeys.indexOf(key);
27523
+ if (index > -1) {
27524
+ this.syncKeys.splice(index, 1);
27525
+ }
27343
27526
  }
27344
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CustomerApiService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
27345
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CustomerApiService, providedIn: 'root' });
27346
- }
27347
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CustomerApiService, decorators: [{
27348
- type: Injectable,
27349
- args: [{
27350
- providedIn: 'root'
27351
- }]
27352
- }] });
27353
-
27354
- class SafeHtmlPipe {
27355
- sanitizer;
27356
- constructor(sanitizer) {
27357
- this.sanitizer = sanitizer;
27527
+ localStorageSetItem(key, data) {
27528
+ localStorage.setItem(key, JSON.stringify(data));
27358
27529
  }
27359
- transform(value) {
27360
- return this.sanitizer.bypassSecurityTrustHtml(value);
27530
+ sessionStorageSetItem(key, data) {
27531
+ sessionStorage.setItem(key, JSON.stringify(data));
27361
27532
  }
27362
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
27363
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: SafeHtmlPipe, isStandalone: false, name: "safeHtml" });
27364
- }
27365
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SafeHtmlPipe, decorators: [{
27366
- type: Pipe,
27367
- args: [{
27368
- name: 'safeHtml',
27369
- standalone: false
27370
- }]
27371
- }], ctorParameters: () => [{ type: i1.DomSanitizer }] });
27372
-
27373
- // Services - providers
27374
- const isIE = window.navigator.userAgent.indexOf('MSIE ') > -1 || window.navigator.userAgent.indexOf('Trident/') > -1;
27375
- const baseUrl = Utilities.baseUrl();
27376
- const apiUri = "api://" + window.location.hostname;
27377
- const authConfig = AuthService.getAuthConfig();
27378
- class CwmSharedModule {
27379
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CwmSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
27380
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: CwmSharedModule, declarations: [
27381
- //ExternalNavigationComponent,
27382
- //NavigateToRouteComponent,
27383
- SafeHtmlPipe], imports: [CommonModule,
27384
- BrowserModule,
27385
- MsalModule] });
27386
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CwmSharedModule, providers: [
27387
- CustomerApiService,
27388
- LogService,
27389
- LocalStorageService,
27390
- ConfigService,
27391
- InventoryApiService,
27392
- MsalService,
27393
- {
27394
- provide: MSAL_INSTANCE,
27395
- useFactory: MSALInstanceFactory
27396
- },
27397
- {
27398
- provide: MSAL_INTERCEPTOR_CONFIG,
27399
- useFactory: MSALInterceptorConfigFactory
27400
- },
27401
- {
27402
- provide: HTTP_INTERCEPTORS,
27403
- useClass: MsalInterceptor,
27404
- multi: true
27405
- }
27406
- ], imports: [CommonModule,
27407
- BrowserModule,
27408
- MsalModule] });
27533
+ localStorageGetItem(key) {
27534
+ return Utilities.JsonTryParse(localStorage.getItem(key) ?? '');
27535
+ }
27536
+ sessionStorageGetItem(key) {
27537
+ return Utilities.JsonTryParse(sessionStorage.getItem(key) ?? '');
27538
+ }
27539
+ onInit() {
27540
+ setTimeout(() => {
27541
+ //this.initEvent.next();
27542
+ this.initEvent.complete();
27543
+ });
27544
+ }
27545
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27546
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LocalStorageService, providedIn: 'root' });
27409
27547
  }
27410
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CwmSharedModule, decorators: [{
27411
- type: NgModule,
27548
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LocalStorageService, decorators: [{
27549
+ type: Injectable,
27412
27550
  args: [{
27413
- declarations: [
27414
- //ExternalNavigationComponent,
27415
- //NavigateToRouteComponent,
27416
- SafeHtmlPipe,
27417
- ],
27418
- imports: [
27419
- CommonModule,
27420
- BrowserModule,
27421
- MsalModule,
27422
- /*
27423
- AppRoutingModule,
27424
- RouterModule,
27425
- AvatarModule,
27426
- BrowserModule,
27427
- BrowserAnimationsModule,
27428
- NoopAnimationsModule,
27429
- SlickCarouselModule,
27430
- FormsModule,
27431
- ReactiveFormsModule,
27432
- MsalModule*/
27433
- ],
27434
- providers: [
27435
- CustomerApiService,
27436
- LogService,
27437
- LocalStorageService,
27438
- ConfigService,
27439
- InventoryApiService,
27440
- MsalService,
27441
- {
27442
- provide: MSAL_INSTANCE,
27443
- useFactory: MSALInstanceFactory
27444
- },
27445
- {
27446
- provide: MSAL_INTERCEPTOR_CONFIG,
27447
- useFactory: MSALInterceptorConfigFactory
27448
- },
27449
- {
27450
- provide: HTTP_INTERCEPTORS,
27451
- useClass: MsalInterceptor,
27452
- multi: true
27453
- }
27454
- ]
27551
+ providedIn: 'root'
27455
27552
  }]
27456
27553
  }] });
27457
27554
 
27458
- const MockProfile = {
27459
- companyName: "The Portland Pot Shop",
27460
- businessPhones: ["503.555.1212"],
27461
- displayName: "PPS User",
27462
- givenName: "PPS Menu User",
27463
- id: "",
27464
- jobTitle: "Menu",
27465
- mail: "portlandpotshop@google.com",
27466
- mobilePhone: "503.555.1212",
27467
- officeLocation: "autoscroll",
27468
- photoUrl: "",
27469
- preferredLanguage: "en-us",
27470
- surname: "Pot Shop",
27471
- userPrincipalName: "portlandpotshop"
27472
- };
27473
-
27474
27555
  // ================================================
27475
27556
  // Export every type you want this module to expose
27476
27557
  // ================================================
27477
- // Components
27478
- //export * from './lib/components/external-navigation/external-navigation.component'
27479
- //export * from './lib/components/navigate-to-route/navigate-to-route.component'
27480
- //export * from './lib/components/page-not-found/page-not-found.component'
27481
- //export * from './lib/components/route-based-templates/route-based-templates.component'
27482
- // Factories
27483
27558
 
27484
27559
  /**
27485
27560
  * Generated bundle index. Do not edit.
27486
27561
  */
27487
27562
 
27488
- export { AuthService, BaseApiService, CardTypes, Category, ConfigService, Customer, CustomerApiService, CwmSharedModule, DbKeys, InventoryApiService, Justifications, LocalStorageService, LogService, LoggingVerbosity, MSALGuardConfigFactory, MSALInstanceFactory, MSALInterceptorConfigFactory, MockConfig, MockInventoryApiResponse, MockProfile, NamedColors, OnElementStyle, Product, Profile, SafeHtmlPipe, TimeSpan, TimeSpanOverflowError, UserTypes, Utilities, decodeToken, doWithLock, isTokenValid, waitFor };
27563
+ export { AuthService, BaseApiService, CardTypes, Category, ConfigService, Customer, CustomerApiService, CwmSharedModule, DbKeys, ExternalNavigationComponent, InventoryApiService, Justifications, LocalStorageService, LogService, LoggingVerbosity, MSALGuardConfigFactory, MSALInstanceFactory, MSALInterceptorConfigFactory, MockConfig, MockInventoryApiResponse, MockProfile, NamedColors, NavigateToRouteComponent, OnElementStyle, PageNotFoundComponent, Product, Profile, SafeHtmlPipe, TimeSpan, TimeSpanOverflowError, UserTypes, Utilities, decodeToken, doWithLock, isTokenValid, waitFor };
27489
27564
  //# sourceMappingURL=transcommerce-cwm-shared.mjs.map