@osovitny/anatoly 2.1.14 → 2.14.2

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 (168) hide show
  1. package/assets/styles/alerts.less +182 -0
  2. package/assets/styles/spinner.less +64 -0
  3. package/assets/styles/toastr.less +192 -0
  4. package/{esm2015/lib/core/consts/settings.js → esm2020/lib/core/consts/settings.mjs} +2 -2
  5. package/{esm2015/lib/core/convert.js → esm2020/lib/core/convert.mjs} +2 -2
  6. package/esm2020/lib/core/core.module.mjs +72 -0
  7. package/esm2020/lib/core/go/base-go.service.mjs +41 -0
  8. package/{esm2015/lib/core/guards/once-import.guard.js → esm2020/lib/core/guards/once-import.guard.mjs} +2 -2
  9. package/{esm2015/lib/core/guid.js → esm2020/lib/core/guid.mjs} +2 -2
  10. package/esm2020/lib/core/interceptors/httpInterceptor.mjs +108 -0
  11. package/esm2020/lib/core/localization/localization.module.mjs +47 -0
  12. package/esm2020/lib/core/localization/localization.service.mjs +185 -0
  13. package/esm2020/lib/core/localization/localizationSettings.module.mjs +88 -0
  14. package/esm2020/lib/core/localization/localize.pipe.mjs +78 -0
  15. package/{esm2015/lib/core/localization/utils.js → esm2020/lib/core/localization/utils.mjs} +2 -2
  16. package/esm2020/lib/core/logging/globalErrorHandler.mjs +44 -0
  17. package/esm2020/lib/core/logging/logging.service.mjs +39 -0
  18. package/{esm2015/lib/core/notifications/alerts.js → esm2020/lib/core/notifications/alerts.mjs} +2 -2
  19. package/{esm2015/lib/core/notifications/interfaces/notification.js → esm2020/lib/core/notifications/interfaces/notification.mjs} +2 -2
  20. package/esm2020/lib/core/notifications/services/notification-service.mjs +228 -0
  21. package/esm2020/lib/core/services/appcontext.service.mjs +118 -0
  22. package/esm2020/lib/core/services/dm.service.mjs +72 -0
  23. package/esm2020/lib/core/services/google-analytics.service.mjs +54 -0
  24. package/{esm2015/lib/core/services/idle.service.js → esm2020/lib/core/services/idle.service.mjs} +10 -8
  25. package/{esm2015/lib/core/services/loading.service.js → esm2020/lib/core/services/loading.service.mjs} +10 -9
  26. package/esm2020/lib/core/services/web-storage.service.mjs +69 -0
  27. package/{esm2015/lib/core/subs.js → esm2020/lib/core/subs.mjs} +2 -2
  28. package/esm2020/lib/core/utils.mjs +82 -0
  29. package/esm2020/lib/data/base/base-api.service.mjs +89 -0
  30. package/esm2020/lib/data/base/grid/base-grid-edit.service.mjs +77 -0
  31. package/esm2020/lib/data/base/grid/base-grid-read.service.mjs +62 -0
  32. package/{esm2015/lib/data/consts.js → esm2020/lib/data/consts.mjs} +2 -2
  33. package/esm2020/lib/data/data.module.mjs +51 -0
  34. package/esm2020/lib/data/services/billing-api.service.mjs +65 -0
  35. package/esm2020/lib/data/services/emails-api.service.mjs +42 -0
  36. package/esm2020/lib/data/services/notifications/notifications-api-service.mjs +43 -0
  37. package/esm2020/lib/ui/components/base-edit.component.mjs +143 -0
  38. package/esm2020/lib/ui/components/base.component.mjs +47 -0
  39. package/esm2020/lib/ui/components/base.dialog.mjs +49 -0
  40. package/esm2020/lib/ui/components/billing/buyaccess-button.component.mjs +69 -0
  41. package/esm2020/lib/ui/components/billing/subscribe-plan-button.component.mjs +63 -0
  42. package/esm2020/lib/ui/components/billing/upgrade-plan-button.component.mjs +52 -0
  43. package/esm2020/lib/ui/components/content-header/content-header.component.mjs +37 -0
  44. package/esm2020/lib/ui/components/html-editor/base-html-editor.component.mjs +111 -0
  45. package/esm2020/lib/ui/components/html-editor/forms-html-editor.component.mjs +48 -0
  46. package/esm2020/lib/ui/components/html-editor/html-editor.component.mjs +52 -0
  47. package/{esm2015/lib/ui/components/html-editor/html-editor.defaultoptions.js → esm2020/lib/ui/components/html-editor/html-editor.defaultoptions.mjs} +2 -2
  48. package/esm2020/lib/ui/components/identity/signin-button.component.mjs +32 -0
  49. package/esm2020/lib/ui/components/identity/signout-button.component.mjs +32 -0
  50. package/esm2020/lib/ui/components/identity/signup-button.component.mjs +31 -0
  51. package/esm2020/lib/ui/components/loading/loading.component.mjs +49 -0
  52. package/esm2020/lib/ui/components/spinner/spinner.component.mjs +74 -0
  53. package/esm2020/lib/ui/directives/native-element.directive.mjs +41 -0
  54. package/esm2020/lib/ui/forms/contact-us/contact-us.mjs +120 -0
  55. package/esm2020/lib/ui/pipes/filesize.pipe.mjs +45 -0
  56. package/esm2020/lib/ui/pipes/replace-text.pipe.mjs +40 -0
  57. package/esm2020/lib/ui/pipes/safeHtml.pipe.mjs +37 -0
  58. package/esm2020/lib/ui/ui.module.mjs +167 -0
  59. package/esm2020/lib/ui/validation/form-validation-summary.component.mjs +67 -0
  60. package/esm2020/lib/ui/validation/item-validation-summary.component.mjs +40 -0
  61. package/esm2020/lib/ui/validation/validation-summary.component.mjs +128 -0
  62. package/esm2020/public-api.mjs +68 -0
  63. package/fesm2015/osovitny-anatoly.mjs +3650 -0
  64. package/fesm2015/osovitny-anatoly.mjs.map +1 -0
  65. package/fesm2020/osovitny-anatoly.mjs +3658 -0
  66. package/fesm2020/osovitny-anatoly.mjs.map +1 -0
  67. package/{osovitny-anatoly.d.ts → index.d.ts} +1 -0
  68. package/lib/core/core.module.d.ts +5 -0
  69. package/lib/core/go/base-go.service.d.ts +3 -0
  70. package/lib/core/interceptors/httpInterceptor.d.ts +3 -0
  71. package/lib/core/localization/localization.module.d.ts +6 -0
  72. package/lib/core/localization/localization.service.d.ts +3 -0
  73. package/lib/core/localization/localizationSettings.module.d.ts +5 -0
  74. package/lib/core/localization/localize.pipe.d.ts +3 -0
  75. package/lib/core/logging/globalErrorHandler.d.ts +3 -0
  76. package/lib/core/logging/logging.service.d.ts +3 -0
  77. package/lib/core/notifications/services/notification-service.d.ts +3 -0
  78. package/lib/core/services/appcontext.service.d.ts +3 -0
  79. package/lib/core/services/dm.service.d.ts +3 -0
  80. package/lib/core/services/google-analytics.service.d.ts +3 -0
  81. package/lib/core/services/idle.service.d.ts +3 -0
  82. package/lib/core/services/loading.service.d.ts +3 -0
  83. package/lib/core/services/web-storage.service.d.ts +5 -0
  84. package/lib/data/base/base-api.service.d.ts +3 -0
  85. package/lib/data/base/grid/base-grid-edit.service.d.ts +3 -0
  86. package/lib/data/base/grid/base-grid-read.service.d.ts +3 -0
  87. package/lib/data/data.module.d.ts +5 -0
  88. package/lib/data/services/billing-api.service.d.ts +3 -0
  89. package/lib/data/services/emails-api.service.d.ts +10 -0
  90. package/lib/data/services/notifications/notifications-api-service.d.ts +3 -0
  91. package/lib/ui/components/base-edit.component.d.ts +5 -2
  92. package/lib/ui/components/base.component.d.ts +4 -1
  93. package/lib/ui/components/base.dialog.d.ts +3 -0
  94. package/lib/ui/components/billing/buyaccess-button.component.d.ts +5 -2
  95. package/lib/ui/components/billing/subscribe-plan-button.component.d.ts +4 -1
  96. package/lib/ui/components/billing/upgrade-plan-button.component.d.ts +4 -1
  97. package/lib/ui/components/content-header/content-header.component.d.ts +3 -0
  98. package/lib/ui/components/html-editor/base-html-editor.component.d.ts +3 -0
  99. package/lib/ui/components/html-editor/forms-html-editor.component.d.ts +3 -0
  100. package/lib/ui/components/html-editor/html-editor.component.d.ts +3 -0
  101. package/lib/ui/components/identity/signin-button.component.d.ts +3 -0
  102. package/lib/ui/components/identity/signout-button.component.d.ts +3 -0
  103. package/lib/ui/components/identity/signup-button.component.d.ts +3 -0
  104. package/lib/ui/components/loading/loading.component.d.ts +4 -1
  105. package/lib/ui/components/spinner/spinner.component.d.ts +3 -0
  106. package/lib/ui/directives/native-element.directive.d.ts +3 -0
  107. package/lib/ui/forms/contact-us/contact-us.d.ts +33 -0
  108. package/lib/ui/pipes/filesize.pipe.d.ts +3 -0
  109. package/lib/ui/pipes/replace-text.pipe.d.ts +3 -0
  110. package/lib/ui/pipes/safeHtml.pipe.d.ts +3 -0
  111. package/lib/ui/ui.module.d.ts +26 -0
  112. package/lib/ui/validation/form-validation-summary.component.d.ts +3 -0
  113. package/lib/ui/validation/item-validation-summary.component.d.ts +3 -0
  114. package/lib/ui/validation/validation-summary.component.d.ts +3 -0
  115. package/package.json +23 -11
  116. package/public-api.d.ts +3 -2
  117. package/bundles/osovitny-anatoly.umd.js +0 -3700
  118. package/bundles/osovitny-anatoly.umd.js.map +0 -1
  119. package/esm2015/lib/core/core.module.js +0 -58
  120. package/esm2015/lib/core/go/base-go.service.js +0 -42
  121. package/esm2015/lib/core/interceptors/httpInterceptor.js +0 -109
  122. package/esm2015/lib/core/localization/localization.module.js +0 -41
  123. package/esm2015/lib/core/localization/localization.service.js +0 -187
  124. package/esm2015/lib/core/localization/localizationSettings.module.js +0 -78
  125. package/esm2015/lib/core/localization/localize.pipe.js +0 -78
  126. package/esm2015/lib/core/logging/globalErrorHandler.js +0 -44
  127. package/esm2015/lib/core/logging/logging.service.js +0 -38
  128. package/esm2015/lib/core/notifications/services/notification-service.js +0 -230
  129. package/esm2015/lib/core/services/appcontext.service.js +0 -119
  130. package/esm2015/lib/core/services/dm.service.js +0 -74
  131. package/esm2015/lib/core/services/google-analytics.service.js +0 -53
  132. package/esm2015/lib/core/services/web-storage.service.js +0 -66
  133. package/esm2015/lib/core/utils.js +0 -81
  134. package/esm2015/lib/data/base/base-api.service.js +0 -89
  135. package/esm2015/lib/data/base/grid/base-grid-edit.service.js +0 -77
  136. package/esm2015/lib/data/base/grid/base-grid-read.service.js +0 -62
  137. package/esm2015/lib/data/data.module.js +0 -43
  138. package/esm2015/lib/data/services/billing-api.service.js +0 -65
  139. package/esm2015/lib/data/services/notifications/notifications-api-service.js +0 -45
  140. package/esm2015/lib/ui/components/base-edit.component.js +0 -142
  141. package/esm2015/lib/ui/components/base.component.js +0 -43
  142. package/esm2015/lib/ui/components/base.dialog.js +0 -47
  143. package/esm2015/lib/ui/components/billing/buyaccess-button.component.js +0 -71
  144. package/esm2015/lib/ui/components/billing/subscribe-plan-button.component.js +0 -63
  145. package/esm2015/lib/ui/components/billing/upgrade-plan-button.component.js +0 -54
  146. package/esm2015/lib/ui/components/content-header/content-header.component.js +0 -37
  147. package/esm2015/lib/ui/components/html-editor/base-html-editor.component.js +0 -108
  148. package/esm2015/lib/ui/components/html-editor/forms-html-editor.component.js +0 -44
  149. package/esm2015/lib/ui/components/html-editor/html-editor.component.js +0 -51
  150. package/esm2015/lib/ui/components/identity/signin-button.component.js +0 -33
  151. package/esm2015/lib/ui/components/identity/signout-button.component.js +0 -33
  152. package/esm2015/lib/ui/components/identity/signup-button.component.js +0 -31
  153. package/esm2015/lib/ui/components/loading/loading.component.js +0 -49
  154. package/esm2015/lib/ui/components/spinner/spinner.component.js +0 -73
  155. package/esm2015/lib/ui/directives/native-element.directive.js +0 -41
  156. package/esm2015/lib/ui/pipes/filesize.pipe.js +0 -41
  157. package/esm2015/lib/ui/pipes/replace-text.pipe.js +0 -36
  158. package/esm2015/lib/ui/pipes/safeHtml.pipe.js +0 -36
  159. package/esm2015/lib/ui/ui.module.js +0 -105
  160. package/esm2015/lib/ui/validation/form-validation-summary.component.js +0 -64
  161. package/esm2015/lib/ui/validation/item-validation-summary.component.js +0 -38
  162. package/esm2015/lib/ui/validation/validation-summary.component.js +0 -126
  163. package/esm2015/public-api.js +0 -62
  164. package/fesm2015/osovitny-anatoly.js +0 -3434
  165. package/fesm2015/osovitny-anatoly.js.map +0 -1
  166. package/osovitny-anatoly.metadata.json +0 -1
  167. /package/{esm2015/lib/core/consts/urls.js → esm2020/lib/core/consts/urls.mjs} +0 -0
  168. /package/{esm2015/osovitny-anatoly.js → esm2020/osovitny-anatoly.mjs} +0 -0
@@ -0,0 +1,3650 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Pipe, APP_INITIALIZER, Injector, NgModule, Inject, Component, Input, Directive, ViewEncapsulation, EventEmitter, Output, ViewChild, Optional, SkipSelf } from '@angular/core';
3
+ import * as i1 from '@angular/router';
4
+ import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError } from '@angular/router';
5
+ import * as i1$3 from '@angular/common/http';
6
+ import { HttpResponse, HttpClient } from '@angular/common/http';
7
+ import { tap, map } from 'rxjs/operators';
8
+ import { BehaviorSubject, Subject, timer, merge, fromEvent } from 'rxjs';
9
+ import { isValid, format, formatDistance, formatDistanceToNow } from 'date-fns';
10
+ import { utcToZonedTime } from 'date-fns-tz';
11
+ import enUS from 'date-fns/locale/en-US';
12
+ import * as i1$1 from '@ngx-translate/core';
13
+ import { TranslateModule, TranslateLoader, TranslateService } from '@ngx-translate/core';
14
+ import * as i1$6 from '@angular/common';
15
+ import { LOCATION_INITIALIZED, DOCUMENT, CommonModule } from '@angular/common';
16
+ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
17
+ import Swal from 'sweetalert2';
18
+ import { v4 } from 'uuid';
19
+ import * as i1$2 from 'ngx-toastr';
20
+ import * as i1$4 from '@angular/platform-browser';
21
+ import { Utils as Utils$1 } from '@core/utils';
22
+ import { Subs as Subs$1 } from '@core/subs';
23
+ import * as i1$7 from '@angular/forms';
24
+ import { FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
25
+ import { Alerts as Alerts$1 } from '@core/notifications/alerts';
26
+ import * as i1$5 from '@core/services/appcontext.service';
27
+ import * as i2 from '@data/services/billing-api.service';
28
+ import { AppCoreSettings as AppCoreSettings$1 } from '@core/consts/settings';
29
+ import * as i1$8 from 'angular-froala-wysiwyg';
30
+ import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
31
+ import * as i1$9 from '@core/services/loading.service';
32
+ import { BaseEditComponent as BaseEditComponent$1 } from '@ui/components/base-edit.component';
33
+ import * as i3 from '@data/services/emails-api.service';
34
+ import * as i4 from '@core/notifications/services/notification-service';
35
+ import * as i6 from 'ngx-captcha';
36
+ import { NgxCaptchaModule } from 'ngx-captcha';
37
+ import { throwIfAlreadyLoaded as throwIfAlreadyLoaded$1 } from '@core/guards/once-import.guard';
38
+ import { BaseApiService as BaseApiService$1 } from '@data/base/base-api.service';
39
+
40
+ /*
41
+ <file>
42
+ Project:
43
+ @osovitny/anatoly
44
+
45
+ Authors:
46
+ Vadim Osovitny
47
+ Anatoly Osovitny
48
+
49
+ Created:
50
+ 26 Jun 2020
51
+
52
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
53
+ </file>
54
+ */
55
+ const ContextInitState = JSON.parse((document.getElementById('contextInitState')).getAttribute('data-contextinitstate'));
56
+ const AppCoreSettings = JSON.parse((document.getElementById('appCoreSettings')).getAttribute('data-appcoresettings'));
57
+
58
+ /*
59
+ <file>
60
+ Project:
61
+ MICE
62
+
63
+ Authors:
64
+ Vadim Osovitny vaosovitny@deloitte.com
65
+
66
+ Created:
67
+ 5 May 2020
68
+
69
+ Copyright (c) 2020 Deloitte Tax. All rights reserved.
70
+ </file>
71
+ */
72
+ const Urls = {
73
+ // SignalR Notifications
74
+ notificationsSocketUrl: '/hubs/notifications'
75
+ };
76
+
77
+ /*
78
+ <file>
79
+ Project:
80
+ @osovitny/anatoly
81
+
82
+ Authors:
83
+ Vadim Osovitny
84
+ Anatoly Osovitny
85
+
86
+ Created:
87
+ 17 Jun 2018
88
+
89
+ Version:
90
+ 1.0
91
+
92
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
93
+ </file>
94
+ */
95
+ class BaseGoService {
96
+ constructor(route, router) {
97
+ this.route = route;
98
+ this.router = router;
99
+ this.route = route;
100
+ this.router = router;
101
+ }
102
+ locationReload() {
103
+ window.location.reload();
104
+ }
105
+ homeReload() {
106
+ window.location.href = "/";
107
+ }
108
+ }
109
+ BaseGoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGoService, deps: [{ token: i1.ActivatedRoute }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
110
+ BaseGoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGoService });
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGoService, decorators: [{
112
+ type: Injectable
113
+ }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i1.Router }]; } });
114
+
115
+ /*
116
+ <file>
117
+ Project:
118
+ @osovitny/anatoly
119
+
120
+ Authors:
121
+ Vadim Osovitny
122
+ Anatoly Osovitny
123
+
124
+ Created:
125
+ 26 Jun 2020
126
+
127
+ Version:
128
+ 1.0
129
+
130
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
131
+ </file>
132
+ */
133
+ function throwIfAlreadyLoaded(parentModule, moduleName) {
134
+ if (parentModule) {
135
+ throw new Error(`${moduleName} has already been loaded. Import ${moduleName} modules in the AppModule only.`);
136
+ }
137
+ }
138
+
139
+ /*
140
+ <file>
141
+ Project:
142
+ @osovitny/anatoly
143
+
144
+ Authors:
145
+ Vadim Osovitny
146
+ Anatoly Osovitny
147
+
148
+ Created:
149
+ 26 Jun 2020
150
+
151
+ Version:
152
+ 1.0
153
+
154
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
155
+ </file>
156
+ */
157
+ class LoadingService extends BehaviorSubject {
158
+ constructor() {
159
+ super(false);
160
+ this.counter = 0;
161
+ //Public
162
+ this.isFreezed = false;
163
+ }
164
+ show() {
165
+ this.counter++;
166
+ let that = this;
167
+ setTimeout(() => {
168
+ if (that.counter > 0) {
169
+ that.next(true);
170
+ }
171
+ }, 500);
172
+ }
173
+ hide() {
174
+ if (this.counter <= 0) {
175
+ return;
176
+ }
177
+ this.counter--;
178
+ if (this.counter == 0) {
179
+ this.next(false);
180
+ }
181
+ }
182
+ freeze(timeout = 1000) {
183
+ this.isFreezed = true;
184
+ let that = this;
185
+ setTimeout(() => {
186
+ this.isFreezed = false;
187
+ }, timeout);
188
+ }
189
+ reset() {
190
+ if (this.counter > 0) {
191
+ this.next(false);
192
+ }
193
+ this.counter = 0;
194
+ }
195
+ }
196
+ LoadingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
197
+ LoadingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingService, providedIn: "root" });
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingService, decorators: [{
199
+ type: Injectable,
200
+ args: [{
201
+ providedIn: "root",
202
+ }]
203
+ }], ctorParameters: function () { return []; } });
204
+
205
+ /*
206
+ <file>
207
+ Project:
208
+ @osovitny/anatoly
209
+
210
+ Authors:
211
+ Vadim Osovitny
212
+ Anatoly Osovitny
213
+
214
+ Created:
215
+ 26 Jun 2020
216
+
217
+ Version:
218
+ 1.0
219
+
220
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
221
+ </file>
222
+ */
223
+ class LoggingService {
224
+ constructor() { }
225
+ logError(error) {
226
+ console.error(error);
227
+ }
228
+ logInformation(info) {
229
+ console.info(info);
230
+ }
231
+ }
232
+ LoggingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoggingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
233
+ LoggingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoggingService, providedIn: "root" });
234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoggingService, decorators: [{
235
+ type: Injectable,
236
+ args: [{
237
+ providedIn: "root",
238
+ }]
239
+ }], ctorParameters: function () { return []; } });
240
+
241
+ /*
242
+ <file>
243
+ Project:
244
+ @osovitny/anatoly
245
+
246
+ Authors:
247
+ Vadim Osovitny
248
+ Anatoly Osovitny
249
+
250
+ Created:
251
+ 25 March 2020
252
+
253
+ Version:
254
+ 1.0
255
+
256
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
257
+ </file>
258
+ */
259
+ class AnatolyHttpInterceptor {
260
+ constructor(loadingService, loggingService) {
261
+ this.loadingService = loadingService;
262
+ this.loggingService = loggingService;
263
+ this.longRunningExceptionsList = [];
264
+ this.autoCDNSASTokenUrls = ['chunks', 'resources'];
265
+ this.externalSiteUrls = ['azurewebsites.net'];
266
+ }
267
+ intercept(req, next) {
268
+ const isCDNEnabled = AppCoreSettings.IsCDNEnabled;
269
+ const cdnSasToken = AppCoreSettings.CDNSASToken;
270
+ const isLoadingFreezed = this.loadingService.isFreezed;
271
+ const authorizationTokenRequired = true;
272
+ const url = req.url.toLowerCase();
273
+ const originalUrl = req.url;
274
+ let isExternalSite = false;
275
+ let loadingRequired = !isLoadingFreezed;
276
+ if (!isLoadingFreezed) {
277
+ for (const i of this.longRunningExceptionsList) {
278
+ if (url.indexOf(this.longRunningExceptionsList[i]) >= 0) {
279
+ loadingRequired = false;
280
+ break;
281
+ }
282
+ }
283
+ }
284
+ if (isCDNEnabled) {
285
+ for (const i of this.autoCDNSASTokenUrls) {
286
+ if (url.indexOf(this.autoCDNSASTokenUrls[i]) >= 0) {
287
+ req = req.clone({ url: originalUrl + cdnSasToken });
288
+ break;
289
+ }
290
+ }
291
+ }
292
+ for (const i of this.externalSiteUrls) {
293
+ if (url.indexOf(this.externalSiteUrls[i]) >= 0) {
294
+ isExternalSite = true;
295
+ break;
296
+ }
297
+ }
298
+ // VadimOS: IE11-fix
299
+ if (url.indexOf('/api/') > -1) {
300
+ let newUrl = '';
301
+ const t = new Date().getTime().toString();
302
+ if (url.indexOf('?') > -1) {
303
+ newUrl = originalUrl + '&t=' + t;
304
+ }
305
+ else {
306
+ newUrl = originalUrl + '?t=' + t;
307
+ }
308
+ req = req.clone({ url: newUrl });
309
+ }
310
+ req = req.clone({ headers: req.headers.set('Accept', 'application/json') });
311
+ req = req.clone({ headers: req.headers.set('Accept', 'application/text') });
312
+ this.onRequestStart(loadingRequired);
313
+ return next.handle(req).pipe(tap((event) => {
314
+ if (event instanceof HttpResponse) {
315
+ this.onRequestEnd(loadingRequired);
316
+ }
317
+ }, (err) => {
318
+ this.onRequestEnd(loadingRequired);
319
+ this.loggingService.logError(err);
320
+ }));
321
+ }
322
+ onRequestStart(loadingRequired) {
323
+ if (loadingRequired) {
324
+ this.loadingService.show();
325
+ }
326
+ }
327
+ onRequestEnd(loadingRequired) {
328
+ if (loadingRequired) {
329
+ this.loadingService.hide();
330
+ }
331
+ }
332
+ }
333
+ AnatolyHttpInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyHttpInterceptor, deps: [{ token: LoadingService }, { token: LoggingService }], target: i0.ɵɵFactoryTarget.Injectable });
334
+ AnatolyHttpInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyHttpInterceptor });
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyHttpInterceptor, decorators: [{
336
+ type: Injectable
337
+ }], ctorParameters: function () { return [{ type: LoadingService }, { type: LoggingService }]; } });
338
+
339
+ /*
340
+ <file>
341
+ Project:
342
+ @osovitny/anatoly
343
+
344
+ Authors:
345
+ Vadim Osovitny
346
+ Anatoly Osovitny
347
+
348
+ Created:
349
+ 29 June 2020
350
+
351
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
352
+ </file>
353
+ */
354
+ class Convert {
355
+ static toLocalizedDateTime(value) {
356
+ if (value) {
357
+ return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
358
+ }
359
+ return null;
360
+ }
361
+ static enumToString(enumeration, value) {
362
+ for (var k in enumeration)
363
+ if (enumeration[k] == value)
364
+ return k;
365
+ return null;
366
+ }
367
+ static enumToArray(enumeration, notIncludes) {
368
+ const notIncludeFiler = (value) => {
369
+ if (isNaN(Number(value))) {
370
+ return false;
371
+ }
372
+ if (notIncludes) {
373
+ for (var i in notIncludes) {
374
+ if (notIncludes[i] == value)
375
+ return false;
376
+ }
377
+ }
378
+ return true;
379
+ };
380
+ return Object.keys(enumeration)
381
+ .filter(notIncludeFiler)
382
+ .map(key => ({
383
+ value: key,
384
+ text: enumeration[key]
385
+ }));
386
+ }
387
+ static stringToArray(str, separator = ',') {
388
+ if (str) {
389
+ return str.split(separator).filter(element => element);
390
+ }
391
+ return [];
392
+ }
393
+ static stringToIntArray(str, separator = ',') {
394
+ if (str) {
395
+ return str.split(separator).filter(element => element).map(value => parseInt(value));
396
+ }
397
+ return [];
398
+ }
399
+ }
400
+
401
+ /*
402
+ <file>
403
+ Project:
404
+ @osovitny/anatoly
405
+
406
+ Authors:
407
+ Vadim Osovitny
408
+ Anatoly Osovitny
409
+
410
+ Created:
411
+ 05 May 2020
412
+
413
+ Version:
414
+ 1.0
415
+
416
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
417
+ </file>
418
+ */
419
+ class LocalizationService {
420
+ constructor(translate) {
421
+ this.translate = translate;
422
+ this.setSupportedLanguages(['en']);
423
+ }
424
+ format(str, args) {
425
+ return str.replace(/{(\d+)}/g, function (match, number) {
426
+ return typeof args[number] != 'undefined'
427
+ ? args[number]
428
+ : match;
429
+ });
430
+ }
431
+ ;
432
+ configureTranslationSettings(translate) {
433
+ const languageToSet = 'en';
434
+ this.dateFnsLocale = { locale: enUS };
435
+ translate.setDefaultLang(languageToSet);
436
+ return languageToSet;
437
+ }
438
+ getBrowserLanguage() {
439
+ return this.translate.getBrowserLang();
440
+ }
441
+ getDatefnsLocale() {
442
+ let dfnLocale;
443
+ switch (this.getBrowserLanguage()) {
444
+ case 'en':
445
+ dfnLocale = { locale: enUS };
446
+ break;
447
+ default:
448
+ dfnLocale = { locale: enUS };
449
+ }
450
+ return dfnLocale;
451
+ }
452
+ setDefaultLanguage(lang) {
453
+ this.translate.setDefaultLang(lang);
454
+ }
455
+ setSupportedLanguages(languages) {
456
+ this.translate.addLangs(languages);
457
+ }
458
+ updateLanguage(language) {
459
+ this.translate.use(language);
460
+ }
461
+ getLocalizedValue(key, params) {
462
+ const value = this.translate.instant(key);
463
+ if (!params || params.length === 0) {
464
+ return value;
465
+ }
466
+ return this.format(value, params);
467
+ }
468
+ getLocalizedDate(key) {
469
+ if (isValid(new Date(key))) {
470
+ return format(new Date(key), 'dd.MM.yyyy', this.dateFnsLocale);
471
+ }
472
+ return "Invalid Date";
473
+ }
474
+ getLocalizedDateTime(key) {
475
+ let dateValue = new Date(key);
476
+ if (isValid(dateValue)) {
477
+ let localDate = Convert.toLocalizedDateTime(dateValue);
478
+ return format(localDate, 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
479
+ }
480
+ return "Invalid Date";
481
+ }
482
+ getLocalizedDistanceInWords(endedDate, startedDate) {
483
+ if (isValid(new Date(endedDate)) && isValid(new Date(startedDate))) {
484
+ return formatDistance(new Date(endedDate), new Date(startedDate), this.dateFnsLocale);
485
+ }
486
+ return "Invalid Date";
487
+ }
488
+ getLocalizedDistanceToNowInWords(date) {
489
+ if (isValid(new Date(date))) {
490
+ return formatDistanceToNow(new Date(date), this.dateFnsLocale);
491
+ }
492
+ return "Invalid Date";
493
+ }
494
+ //UTC Operations --------------------------------------------------------------
495
+ getUTCToLocalizedDate(key) {
496
+ let browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
497
+ if (key) {
498
+ if (key.indexOf("T") == -1) {
499
+ key = key.replace(" ", "T");
500
+ }
501
+ if (key.indexOf("Z") == -1) {
502
+ key = key + "Z";
503
+ }
504
+ }
505
+ if (browserTimeZone) {
506
+ let localDateTime = utcToZonedTime(key, browserTimeZone);
507
+ return format(localDateTime, 'dd.MM.yyyy', this.dateFnsLocale);
508
+ }
509
+ else {
510
+ return format(new Date(key), 'dd.MM.yyyy', this.dateFnsLocale);
511
+ }
512
+ }
513
+ getUTCToLocalizedDateTime(key) {
514
+ let browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
515
+ if (key) {
516
+ if (key.indexOf("T") == -1) {
517
+ key = key.replace(" ", "T");
518
+ }
519
+ if (key.indexOf("Z") == -1) {
520
+ key = key + "Z";
521
+ }
522
+ }
523
+ if (browserTimeZone) {
524
+ let localDateTime = utcToZonedTime(key, browserTimeZone);
525
+ return format(localDateTime, 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
526
+ }
527
+ else {
528
+ return format(new Date(key), 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
529
+ }
530
+ }
531
+ //https://date-fns.org/v1.30.1/docs/distanceInWords
532
+ getUTCToLocalizedDistanceToNowInWords(date) {
533
+ date = this.safeUtcToZonedTime(date);
534
+ if (isValid(new Date(date))) {
535
+ return formatDistanceToNow(new Date(date), this.dateFnsLocale);
536
+ }
537
+ return "Invalid Date";
538
+ }
539
+ safeUtcToZonedTime(date) {
540
+ let result = date;
541
+ try {
542
+ if (date) {
543
+ if (date.indexOf("T") == -1) {
544
+ date = date.replace(" ", "T");
545
+ }
546
+ if (date.indexOf("Z") == -1) {
547
+ date = date + "Z";
548
+ }
549
+ }
550
+ let browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
551
+ if (browserTimeZone) {
552
+ result = utcToZonedTime(date, browserTimeZone).toString();
553
+ }
554
+ else {
555
+ result = new Date(date).toString();
556
+ }
557
+ }
558
+ catch (_a) {
559
+ if (date) {
560
+ console.log("UTC to Local conversion failed for :" + date.toString());
561
+ }
562
+ }
563
+ return result;
564
+ }
565
+ }
566
+ LocalizationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationService, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
567
+ LocalizationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationService, providedIn: 'root' });
568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationService, decorators: [{
569
+ type: Injectable,
570
+ args: [{
571
+ providedIn: 'root'
572
+ }]
573
+ }], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; } });
574
+
575
+ /*
576
+ <file>
577
+ Project:
578
+ @osovitny/anatoly
579
+
580
+ Authors:
581
+ Vadim Osovitny
582
+ Anatoly Osovitny
583
+
584
+ Created:
585
+ 10 May 2020
586
+
587
+ Version:
588
+ 1.0
589
+
590
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
591
+ </file>
592
+ */
593
+ class LocalizePipe {
594
+ constructor(localizeService) {
595
+ this.localizeService = localizeService;
596
+ }
597
+ transform(inputData, type, param2) {
598
+ if (!inputData) {
599
+ return;
600
+ }
601
+ if (!type) {
602
+ type = 'tr';
603
+ }
604
+ //Translate
605
+ if (type === 'tr') {
606
+ return this.localizeService.getLocalizedValue(inputData);
607
+ }
608
+ //Date
609
+ if (type === 'd') {
610
+ return this.localizeService.getLocalizedDate(inputData);
611
+ }
612
+ //DateTime
613
+ if (type === 'dt') {
614
+ return this.localizeService.getLocalizedDateTime(inputData);
615
+ }
616
+ //DistanceInWords
617
+ if (type === 'dis') {
618
+ return this.localizeService.getLocalizedDistanceInWords(inputData, param2);
619
+ }
620
+ //DistanceToNowInWords
621
+ if (type === 'dis2now') {
622
+ return this.localizeService.getLocalizedDistanceToNowInWords(inputData);
623
+ }
624
+ //UTC Operations --------------------------------------------------------------
625
+ //UTC Date
626
+ if (type === 'u2d') {
627
+ return this.localizeService.getUTCToLocalizedDate(inputData);
628
+ }
629
+ //UTC DateTime
630
+ if (type === 'u2dt') {
631
+ return this.localizeService.getUTCToLocalizedDateTime(inputData);
632
+ }
633
+ //UTC DistanceToNowInWords
634
+ if (type === 'u2dis2now') {
635
+ return this.localizeService.getUTCToLocalizedDistanceToNowInWords(inputData);
636
+ }
637
+ return inputData;
638
+ }
639
+ }
640
+ LocalizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizePipe, deps: [{ token: LocalizationService }], target: i0.ɵɵFactoryTarget.Pipe });
641
+ LocalizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: LocalizePipe, name: "localize" });
642
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizePipe, decorators: [{
643
+ type: Pipe,
644
+ args: [{
645
+ name: 'localize'
646
+ }]
647
+ }], ctorParameters: function () { return [{ type: LocalizationService }]; } });
648
+
649
+ /*
650
+ <file>
651
+ Project:
652
+ @osovitny/anatoly
653
+
654
+ Authors:
655
+ Vadim Osovitny
656
+ Anatoly Osovitny
657
+
658
+ Created:
659
+ 05 May 2020
660
+
661
+ Version:
662
+ 1.0
663
+
664
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
665
+ </file>
666
+ */
667
+ function customTranslateLoaderFactory(http) {
668
+ return new TranslateHttpLoader(http, AppCoreSettings.resourcesUrl + "/", '.json');
669
+ }
670
+ function localizationInitializerFactory(translate, localizationService, injector) {
671
+ return () => new Promise((resolve) => {
672
+ let locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
673
+ locationInitialized.then(() => {
674
+ let languageToSet = localizationService.configureTranslationSettings(translate);
675
+ translate.use(languageToSet).subscribe(() => {
676
+ }, () => {
677
+ resolve(null);
678
+ }, () => {
679
+ resolve(null);
680
+ });
681
+ });
682
+ });
683
+ }
684
+ const TranslateModuleAtRoot = TranslateModule.forRoot({
685
+ loader: {
686
+ provide: TranslateLoader,
687
+ useFactory: customTranslateLoaderFactory,
688
+ deps: [HttpClient]
689
+ }
690
+ });
691
+ let LocalizationInjectorInstance;
692
+ class LocalizationSettingsModule {
693
+ constructor(injector) {
694
+ this.injector = injector;
695
+ LocalizationInjectorInstance = this.injector;
696
+ }
697
+ }
698
+ LocalizationSettingsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationSettingsModule, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule });
699
+ LocalizationSettingsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: LocalizationSettingsModule, imports: [i1$1.TranslateModule] });
700
+ LocalizationSettingsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationSettingsModule, providers: [
701
+ {
702
+ provide: APP_INITIALIZER,
703
+ useFactory: localizationInitializerFactory,
704
+ deps: [TranslateService, LocalizationService, Injector],
705
+ multi: true
706
+ }
707
+ ], imports: [TranslateModuleAtRoot] });
708
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationSettingsModule, decorators: [{
709
+ type: NgModule,
710
+ args: [{
711
+ imports: [
712
+ TranslateModuleAtRoot
713
+ ],
714
+ providers: [
715
+ {
716
+ provide: APP_INITIALIZER,
717
+ useFactory: localizationInitializerFactory,
718
+ deps: [TranslateService, LocalizationService, Injector],
719
+ multi: true
720
+ }
721
+ ],
722
+ exports: []
723
+ }]
724
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
725
+
726
+ /*
727
+ <file>
728
+ Project:
729
+ @osovitny/anatoly
730
+
731
+ Authors:
732
+ Vadim Osovitny
733
+ Anatoly Osovitny
734
+
735
+ Created:
736
+ 12 May 2020
737
+
738
+ Version:
739
+ 1.0
740
+
741
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
742
+ </file>
743
+ */
744
+ class LocalizationModule {
745
+ }
746
+ LocalizationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
747
+ LocalizationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: LocalizationModule, declarations: [LocalizePipe], imports: [TranslateModule], exports: [TranslateModule,
748
+ LocalizePipe] });
749
+ LocalizationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationModule, imports: [TranslateModule, TranslateModule] });
750
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationModule, decorators: [{
751
+ type: NgModule,
752
+ args: [{
753
+ imports: [
754
+ TranslateModule
755
+ ],
756
+ exports: [
757
+ TranslateModule,
758
+ LocalizePipe
759
+ ],
760
+ declarations: [
761
+ LocalizePipe
762
+ ],
763
+ providers: []
764
+ }]
765
+ }] });
766
+
767
+ /*
768
+ <file>
769
+ Project:
770
+ @osovitny/anatoly
771
+
772
+ Authors:
773
+ Vadim Osovitny
774
+ Anatoly Osovitny
775
+
776
+ Created:
777
+ 26 Jun 2020
778
+
779
+ Version:
780
+ 1.0
781
+
782
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
783
+ </file>
784
+ */
785
+ class GlobalErrorHandler {
786
+ constructor(injector) {
787
+ this.injector = injector;
788
+ }
789
+ handleError(error) {
790
+ const loggingService = this.injector.get(LoggingService);
791
+ loggingService.logError(error);
792
+ // IMPORTANT: Rethrow the error otherwise it gets swallowed
793
+ throw error;
794
+ }
795
+ }
796
+ GlobalErrorHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GlobalErrorHandler, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
797
+ GlobalErrorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GlobalErrorHandler });
798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GlobalErrorHandler, decorators: [{
799
+ type: Injectable
800
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
801
+
802
+ /*
803
+ <file>
804
+ Project:
805
+ @osovitny/anatoly
806
+
807
+ Authors:
808
+ Vadim Osovitny
809
+ Anatoly Osovitny
810
+
811
+ Created:
812
+ 2 July 2020
813
+
814
+ Version:
815
+ 1.0
816
+
817
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
818
+ </file>
819
+ */
820
+ class L10nUtils {
821
+ // @dynamic
822
+ static get localizationService() {
823
+ const ns = LocalizationInjectorInstance.get(LocalizationService);
824
+ return ns;
825
+ }
826
+ static getLocalizedValue(key, params, defaultKey) {
827
+ // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
828
+ // defaultKey definition:
829
+ // if key is empty and defaultKey is defined => get localization for defaultKey
830
+ // Example: cancel()
831
+ if (!key && defaultKey) {
832
+ return this.localizationService.getLocalizedValue(defaultKey);
833
+ }
834
+ // VadimOS:
835
+ // if key is not empty value MUST be in localization table, othewise we will return key
836
+ if (key) {
837
+ const value = this.localizationService.getLocalizedValue(key, params);
838
+ return value;
839
+ }
840
+ return key;
841
+ }
842
+ }
843
+
844
+ /*
845
+ <file>
846
+ Project:
847
+ @osovitny/anatoly
848
+
849
+ Authors:
850
+ Vadim Osovitny
851
+ Anatoly Osovitny
852
+
853
+ Created:
854
+ 3 March 2020
855
+
856
+ Version:
857
+ 1.0
858
+
859
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
860
+ </file>
861
+ */
862
+ class Alerts {
863
+ static success(text, params, title, successAction) {
864
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
865
+ title = L10nUtils.getLocalizedValue(title, null, 'Success');
866
+ Swal.fire({
867
+ text,
868
+ title,
869
+ icon: 'success',
870
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
871
+ })
872
+ .then(() => {
873
+ if (successAction) {
874
+ successAction();
875
+ }
876
+ });
877
+ }
878
+ static info(text, params, title) {
879
+ text = L10nUtils.getLocalizedValue(text, params);
880
+ title = L10nUtils.getLocalizedValue(title, null, 'Info');
881
+ Swal.fire({
882
+ text,
883
+ title,
884
+ icon: 'info',
885
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
886
+ });
887
+ }
888
+ static warning(text, params, title) {
889
+ text = L10nUtils.getLocalizedValue(text, params);
890
+ title = L10nUtils.getLocalizedValue(title, null, 'Warning');
891
+ Swal.fire({
892
+ text,
893
+ title,
894
+ icon: 'warning',
895
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
896
+ });
897
+ }
898
+ static error(text, params, title) {
899
+ text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
900
+ title = L10nUtils.getLocalizedValue(title, null, 'Error');
901
+ Swal.fire({
902
+ text,
903
+ title,
904
+ icon: 'error',
905
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
906
+ });
907
+ }
908
+ static cancel(text, params, title) {
909
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
910
+ title = L10nUtils.getLocalizedValue(title, null, 'Cancelled');
911
+ Swal.fire({
912
+ text,
913
+ title,
914
+ icon: 'info'
915
+ });
916
+ }
917
+ static notImplemented() {
918
+ this.warning('Not Implemented Yet');
919
+ }
920
+ ;
921
+ static areYouSure(text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
922
+ text = L10nUtils.getLocalizedValue(text);
923
+ title = L10nUtils.getLocalizedValue(title, null, 'AreYouSure');
924
+ confirmButtonText = L10nUtils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
925
+ cancelButtonText = L10nUtils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
926
+ Swal.fire({
927
+ text,
928
+ title,
929
+ icon: 'warning',
930
+ confirmButtonText,
931
+ cancelButtonText,
932
+ showCancelButton: true
933
+ })
934
+ .then((result) => {
935
+ if (result.value) {
936
+ if (successAction) {
937
+ successAction();
938
+ }
939
+ }
940
+ // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
941
+ else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
942
+ if (cancelAction) {
943
+ cancelAction();
944
+ }
945
+ }
946
+ });
947
+ }
948
+ ;
949
+ }
950
+
951
+ /*
952
+ <file>
953
+ Project:
954
+ @osovitny/anatoly
955
+
956
+ Authors:
957
+ Vadim Osovitny
958
+ Anatoly Osovitny
959
+
960
+ Created:
961
+ 26 Jun 2020
962
+
963
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
964
+ </file>
965
+ */
966
+ class Guid {
967
+ static newGuid() {
968
+ return v4();
969
+ }
970
+ }
971
+
972
+ /*
973
+ <file>
974
+ Project:
975
+ @osovitny/anatoly
976
+
977
+ Authors:
978
+ Vadim Osovitny
979
+ Anatoly Osovitny
980
+
981
+ Created:
982
+ 2 Jun 2020
983
+
984
+ Version:
985
+ 1.0
986
+
987
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
988
+ </file>
989
+ */
990
+ // SignalR
991
+ // import * as signalR from '@microsoft/signalr';
992
+ // import { NotificationsApiService } from '../../../data/services/notifications/notifications-api-service';
993
+ class NotificationService {
994
+ constructor(toastrService) {
995
+ this.toastrService = toastrService;
996
+ // SignalR
997
+ // private hubConnection: signalR.HubConnection;
998
+ // private socketUrl: string;
999
+ // Notifications
1000
+ this._sessionNotifications = new BehaviorSubject([]);
1001
+ this._serverNotifications = new BehaviorSubject([]);
1002
+ // Public
1003
+ this.sessionNotifications$ = this._sessionNotifications.asObservable();
1004
+ this.serverNotifications$ = this._serverNotifications.asObservable();
1005
+ // this.onInit();
1006
+ }
1007
+ /*
1008
+ onInit() {
1009
+ if (AppCoreSettings.AzureAD) {
1010
+ this.authService.getAuthToken().subscribe((token: string) => {
1011
+ this.startSignalRConnection(token);
1012
+ });
1013
+
1014
+ return;
1015
+ }
1016
+
1017
+ this.startSignalRConnection();
1018
+ }
1019
+
1020
+ ngOnDestroy() {
1021
+ this.stopSignalRConnection();
1022
+ }
1023
+
1024
+ // SignalR
1025
+ private startSignalRConnection(accessToken?) {
1026
+ const cskii = AppCoreSettings.selectedClientID;
1027
+ // tslint:disable-next-line:variable-name
1028
+ const cskii_upn = AppCoreSettings.CSKII_UPN;
1029
+ // tslint:disable-next-line:variable-name
1030
+ const cli_sessionguid = AppCoreSettings.CLI_SessionGUID;
1031
+
1032
+ const url = this.socketUrl + '?cskii=' + cskii + '&cskii_upn=' + cskii_upn + '&cli_sessionguid=' + cli_sessionguid;
1033
+
1034
+ if (accessToken) {
1035
+ this.hubConnection = new signalR.HubConnectionBuilder()
1036
+ .withUrl(url, {
1037
+ skipNegotiation: false,
1038
+ transport: signalR.HttpTransportType.WebSockets,
1039
+ accessTokenFactory: () => accessToken
1040
+ })
1041
+ .withAutomaticReconnect()
1042
+ .configureLogging(signalR.LogLevel.Debug)
1043
+ .build();
1044
+ }
1045
+ else {
1046
+ this.hubConnection = new signalR.HubConnectionBuilder()
1047
+ .withUrl(this.socketUrl, {
1048
+ skipNegotiation: true,
1049
+ transport: signalR.HttpTransportType.WebSockets
1050
+ })
1051
+ .withAutomaticReconnect()
1052
+ .configureLogging(signalR.LogLevel.Debug)
1053
+ .build();
1054
+ }
1055
+
1056
+ this.hubConnection
1057
+ .start()
1058
+ .then(() => this.signalRConnection_onSuccess())
1059
+ .catch(err => {
1060
+ console.error('Connection failed to SignalR Notification Hub')
1061
+ })
1062
+ }
1063
+
1064
+ private signalRConnection_onSuccess() {
1065
+ this.addReceiveMessageDataListener();
1066
+
1067
+ this.notificationsApiService.retrieveNotifications().subscribe(data => {
1068
+ this.serverNotifications = data;
1069
+ });
1070
+ }
1071
+
1072
+ stopSignalRConnection() {
1073
+ if (this.hubConnection) {
1074
+ this.hubConnection.stop();
1075
+ this.hubConnection = null;
1076
+ }
1077
+ }
1078
+
1079
+ private addReceiveMessageDataListener = () => {
1080
+ this.hubConnection.on('ReceiveMessage', (message) => {
1081
+ if (message) {
1082
+ if (message.type === 'error') {
1083
+ this.error(message.text, null, null, false);
1084
+ }
1085
+ else {
1086
+ this.success(message.text, null, null, false);
1087
+ }
1088
+
1089
+ const notification = {
1090
+ id: message.id,
1091
+ isNew: message.isNew,
1092
+ isSession: true,
1093
+ text: message.text,
1094
+ type: message.type,
1095
+ createdDate: message.createdDate
1096
+ };
1097
+
1098
+ this.addSessionNotificationToList(notification);
1099
+ }
1100
+ });
1101
+ }
1102
+ */
1103
+ addSessionNotification(text, type) {
1104
+ const id = Guid.newGuid();
1105
+ const notification = { id, isNew: true, isSession: true, text, type, createdDate: new Date(Date.now()).toISOString() };
1106
+ this.addSessionNotificationToList(notification);
1107
+ }
1108
+ addSessionNotificationToList(notification) {
1109
+ this.sessionNotifications = [
1110
+ notification,
1111
+ ...this.sessionNotifications,
1112
+ ];
1113
+ }
1114
+ // Public API
1115
+ removeNotification(id, isSession) {
1116
+ if (isSession) {
1117
+ this.sessionNotifications = this.sessionNotifications.filter(notifications => notifications.id !== id);
1118
+ }
1119
+ else {
1120
+ this.serverNotifications = this.serverNotifications.filter(notifications => notifications.id !== id);
1121
+ }
1122
+ }
1123
+ success(text, params, title, createSessionNotification = true) {
1124
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
1125
+ title = L10nUtils.getLocalizedValue(title);
1126
+ this.toastrService.success(text, title, {
1127
+ timeOut: 3000,
1128
+ progressBar: true
1129
+ });
1130
+ if (createSessionNotification) {
1131
+ this.addSessionNotification(text, 'success');
1132
+ }
1133
+ }
1134
+ info(text, params, title) {
1135
+ text = L10nUtils.getLocalizedValue(text, params);
1136
+ title = L10nUtils.getLocalizedValue(title);
1137
+ this.toastrService.info(text, title, {
1138
+ timeOut: 3000,
1139
+ progressBar: true
1140
+ });
1141
+ }
1142
+ warning(text, params, title) {
1143
+ text = L10nUtils.getLocalizedValue(text, params);
1144
+ title = L10nUtils.getLocalizedValue(title);
1145
+ this.toastrService.warning(text, title, {
1146
+ timeOut: 3000,
1147
+ progressBar: true
1148
+ });
1149
+ }
1150
+ error(text, params, title, createSessionNotification = true) {
1151
+ text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
1152
+ title = L10nUtils.getLocalizedValue(title);
1153
+ this.toastrService.error(text, title, {
1154
+ timeOut: 3000,
1155
+ progressBar: true
1156
+ });
1157
+ if (createSessionNotification) {
1158
+ this.addSessionNotification(text, 'error');
1159
+ }
1160
+ }
1161
+ cancel(text, params, title) {
1162
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
1163
+ title = L10nUtils.getLocalizedValue(title);
1164
+ this.toastrService.info(text, title, {
1165
+ timeOut: 3000,
1166
+ progressBar: true
1167
+ });
1168
+ }
1169
+ // SessionNotifications
1170
+ get sessionNotifications() {
1171
+ return this._sessionNotifications.getValue();
1172
+ }
1173
+ set sessionNotifications(val) {
1174
+ this._sessionNotifications.next(val);
1175
+ }
1176
+ // ServerNotifications
1177
+ get serverNotifications() {
1178
+ return this._serverNotifications.getValue();
1179
+ }
1180
+ set serverNotifications(val) {
1181
+ this._serverNotifications.next(val);
1182
+ }
1183
+ }
1184
+ NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationService, deps: [{ token: i1$2.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable });
1185
+ NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationService, providedIn: 'root' });
1186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationService, decorators: [{
1187
+ type: Injectable,
1188
+ args: [{ providedIn: 'root' }]
1189
+ }], ctorParameters: function () { return [{ type: i1$2.ToastrService }]; } });
1190
+
1191
+ /*
1192
+ <file>
1193
+ Project:
1194
+ @osovitny/anatoly
1195
+
1196
+ Authors:
1197
+ Vadim Osovitny
1198
+ Anatoly Osovitny
1199
+
1200
+ Created:
1201
+ 13 Nov 2017
1202
+
1203
+ Version:
1204
+ 1.0
1205
+
1206
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1207
+ </file>
1208
+ */
1209
+ class BaseApiService {
1210
+ constructor(http) {
1211
+ this.http = http;
1212
+ }
1213
+ serializeParams(data) {
1214
+ return data ? ('?' + $.param(data)) : '';
1215
+ }
1216
+ //api
1217
+ get(action, data, responseType) {
1218
+ if (!responseType) {
1219
+ responseType = 'json';
1220
+ }
1221
+ var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1222
+ return this.http.get(url, { responseType: responseType }).pipe(map(res => res));
1223
+ }
1224
+ post(action, data, responseType) {
1225
+ if (!responseType) {
1226
+ responseType = 'text';
1227
+ }
1228
+ var url = `${this.baseUrl}/${action}`;
1229
+ return this.http.post(url, data, { responseType: responseType });
1230
+ }
1231
+ postQS(action, data, responseType) {
1232
+ if (!responseType) {
1233
+ responseType = 'text';
1234
+ }
1235
+ var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1236
+ return this.http.post(url, null, { responseType: responseType });
1237
+ }
1238
+ delete(action, data, responseType) {
1239
+ if (!responseType) {
1240
+ responseType = 'text';
1241
+ }
1242
+ var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1243
+ return this.http.delete(url, { responseType: responseType });
1244
+ }
1245
+ //gets
1246
+ getExternalTextFile(url) {
1247
+ return this.http.get(url);
1248
+ }
1249
+ getExternalJsonFile(url) {
1250
+ return this.http.get(url);
1251
+ }
1252
+ getJsonFile(fileName) {
1253
+ const jsonsUrl = AppCoreSettings.jsonsUrl;
1254
+ const jsonVersion = AppCoreSettings.jsonVersion;
1255
+ const isCDNEnabled = AppCoreSettings.isCDNEnabled;
1256
+ const cdnSasToken = AppCoreSettings.cdnSasToken;
1257
+ let url = "";
1258
+ if (isCDNEnabled) {
1259
+ url = jsonsUrl + "/" + fileName + cdnSasToken;
1260
+ }
1261
+ else {
1262
+ url = jsonsUrl + "/" + fileName + '?' + jsonVersion;
1263
+ }
1264
+ return this.http.get(url).pipe(map(res => res));
1265
+ }
1266
+ }
1267
+ BaseApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1268
+ BaseApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseApiService });
1269
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseApiService, decorators: [{
1270
+ type: Injectable
1271
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
1272
+
1273
+ /*
1274
+ <file>
1275
+ Project:
1276
+ @osovitny/anatoly
1277
+
1278
+ Authors:
1279
+ Vadim Osovitny
1280
+ Anatoly Osovitny
1281
+
1282
+ Created:
1283
+ 26 Jun 2020
1284
+
1285
+ Version:
1286
+ 1.0
1287
+
1288
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1289
+ </file>
1290
+ */
1291
+ class WebStorageService {
1292
+ constructor(storage) {
1293
+ this.storage =
1294
+ storage === 'local' || storage === 'localStorage'
1295
+ ? localStorage
1296
+ : sessionStorage;
1297
+ }
1298
+ setItem(key, value) {
1299
+ this.storage.setItem(key, value);
1300
+ }
1301
+ setObject(key, value) {
1302
+ this.storage.setItem(key, JSON.stringify(value));
1303
+ }
1304
+ getItem(key) {
1305
+ return this.storage.getItem(key);
1306
+ }
1307
+ getObject(key) {
1308
+ let value = this.storage.getItem(key);
1309
+ if (!value) {
1310
+ return null;
1311
+ }
1312
+ return JSON.parse(value);
1313
+ }
1314
+ remove(key) {
1315
+ this.storage.removeItem(key);
1316
+ }
1317
+ }
1318
+ class LocalStorageService extends WebStorageService {
1319
+ constructor() {
1320
+ super('localStorage');
1321
+ }
1322
+ }
1323
+ LocalStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1324
+ LocalStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalStorageService });
1325
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalStorageService, decorators: [{
1326
+ type: Injectable
1327
+ }], ctorParameters: function () { return []; } });
1328
+ class SessionStorageService extends WebStorageService {
1329
+ constructor() {
1330
+ super('sessionStorage');
1331
+ }
1332
+ }
1333
+ SessionStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SessionStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1334
+ SessionStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SessionStorageService });
1335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SessionStorageService, decorators: [{
1336
+ type: Injectable
1337
+ }], ctorParameters: function () { return []; } });
1338
+
1339
+ /*
1340
+ <file>
1341
+ Project:
1342
+ @osovitny/anatoly
1343
+
1344
+ Authors:
1345
+ Vadim Osovitny
1346
+ Anatoly Osovitny
1347
+
1348
+ Created:
1349
+ 13 Nov 2017
1350
+
1351
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1352
+ </file>
1353
+ */
1354
+ class AppContextService extends BaseApiService {
1355
+ constructor(http, sessionStorage) {
1356
+ super(http);
1357
+ this.http = http;
1358
+ this.sessionStorage = sessionStorage;
1359
+ //Consts
1360
+ this.storageKeyName = 'appContext';
1361
+ this.subscription = null;
1362
+ this.successes = [];
1363
+ this.baseUrl = '/api/appContext';
1364
+ }
1365
+ //Session
1366
+ getCurrentFromSession() {
1367
+ return this.sessionStorage.getObject(this.storageKeyName);
1368
+ }
1369
+ setCurrentFromSession(value) {
1370
+ this.sessionStorage.setObject(this.storageKeyName, value);
1371
+ }
1372
+ updateCurrentIfExpired() {
1373
+ let context = this.getCurrentFromSession();
1374
+ if (!context) {
1375
+ return;
1376
+ }
1377
+ let lu = context.lastRequested;
1378
+ if (lu) {
1379
+ let now = new Date();
1380
+ let lastRequested = new Date(context.lastRequested);
1381
+ let in2Mins = new Date(lastRequested.getFullYear(), lastRequested.getMonth(), lastRequested.getDate(), lastRequested.getHours(), lastRequested.getMinutes() + 2, 0, 0);
1382
+ if (in2Mins.getTime() < now.getTime()) {
1383
+ this.updateCurrent();
1384
+ }
1385
+ }
1386
+ }
1387
+ dataReceived(data) {
1388
+ this.current = data;
1389
+ for (let i = 0; i < this.successes.length; i++) {
1390
+ let success = this.successes[i];
1391
+ if (success) {
1392
+ success(data);
1393
+ }
1394
+ }
1395
+ this.successes = [];
1396
+ this.subscription.unsubscribe();
1397
+ this.subscription = null;
1398
+ }
1399
+ //Public
1400
+ getCurrent(success = null, getCachedIfExist = true) {
1401
+ let context = this.getCurrentFromSession();
1402
+ if (getCachedIfExist && context != null) {
1403
+ if (success) {
1404
+ success(context);
1405
+ }
1406
+ return;
1407
+ }
1408
+ if (success) {
1409
+ this.successes.push(success);
1410
+ }
1411
+ if (this.subscription != null) {
1412
+ return;
1413
+ }
1414
+ let now = new Date();
1415
+ console.log('Requesting a new AppContext at ' + now);
1416
+ this.subscription = this.get('getCurrentContext', null).subscribe((data) => {
1417
+ this.dataReceived(data);
1418
+ }, (e) => {
1419
+ });
1420
+ }
1421
+ updateCurrent(success = null) {
1422
+ this.getCurrent(success, false);
1423
+ }
1424
+ clearCurrent() {
1425
+ this.sessionStorage.remove(this.storageKeyName);
1426
+ }
1427
+ isUserSignedIn() {
1428
+ return ContextInitState.isUserSignedIn;
1429
+ }
1430
+ isUserAdmin() {
1431
+ return ContextInitState.isUserAdmin;
1432
+ }
1433
+ //Properties
1434
+ //current
1435
+ get current() {
1436
+ this.updateCurrentIfExpired();
1437
+ return this.getCurrentFromSession();
1438
+ }
1439
+ set current(value) {
1440
+ this.setCurrentFromSession(value);
1441
+ }
1442
+ }
1443
+ AppContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AppContextService, deps: [{ token: i1$3.HttpClient }, { token: SessionStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
1444
+ AppContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AppContextService });
1445
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AppContextService, decorators: [{
1446
+ type: Injectable
1447
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: SessionStorageService }]; } });
1448
+
1449
+ /*
1450
+ <file>
1451
+ Project:
1452
+ @osovitny/anatoly
1453
+
1454
+ Authors:
1455
+ Vadim Osovitny
1456
+ Anatoly Osovitny
1457
+
1458
+ Created:
1459
+ 26 Jun 2020
1460
+
1461
+ Version:
1462
+ 1.0
1463
+
1464
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1465
+ </file>
1466
+ */
1467
+ class IdleService {
1468
+ constructor() {
1469
+ this.expired$ = new Subject();
1470
+ }
1471
+ //Private
1472
+ resetTimeCounters(timeOutSeconds) {
1473
+ this.timeOutSeconds = timeOutSeconds;
1474
+ this.timeOutMilliSeconds = timeOutSeconds * 1000;
1475
+ this.startDate = new Date();
1476
+ }
1477
+ startTimer() {
1478
+ this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe((res) => {
1479
+ let nowDate = new Date();
1480
+ let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
1481
+ if (nowDate.getTime() >= exiredDate.getTime()) {
1482
+ //console.log("nowDate: " + nowDate);
1483
+ //console.log("exiredDate: " + exiredDate);
1484
+ this.expired$.next(true);
1485
+ }
1486
+ });
1487
+ }
1488
+ resetTimer() {
1489
+ this.startDate = new Date();
1490
+ }
1491
+ //Public
1492
+ startWatching(timeOutSeconds) {
1493
+ this.idle$ = merge(fromEvent(document, 'mousemove'), fromEvent(document, 'click'), fromEvent(document, 'mousedown'), fromEvent(document, 'keypress'), fromEvent(document, 'DOMMouseScroll'), fromEvent(document, 'mousewheel'), fromEvent(document, 'touchmove'), fromEvent(document, 'MSPointerMove'), fromEvent(window, 'mousemove'), fromEvent(window, 'resize'));
1494
+ this.resetTimeCounters(timeOutSeconds);
1495
+ this.idleSubscription = this.idle$.subscribe((res) => {
1496
+ this.resetTimer();
1497
+ });
1498
+ this.startTimer();
1499
+ return this.expired$;
1500
+ }
1501
+ stopWatching() {
1502
+ this.timer$.unsubscribe();
1503
+ this.idleSubscription.unsubscribe();
1504
+ }
1505
+ restartIdleTimer(timeOutSeconds) {
1506
+ this.timer$.unsubscribe();
1507
+ this.resetTimeCounters(timeOutSeconds);
1508
+ this.startTimer();
1509
+ }
1510
+ }
1511
+ IdleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IdleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1512
+ IdleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IdleService, providedIn: 'root' });
1513
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IdleService, decorators: [{
1514
+ type: Injectable,
1515
+ args: [{
1516
+ providedIn: 'root'
1517
+ }]
1518
+ }] });
1519
+
1520
+ /*
1521
+ <file>
1522
+ Project:
1523
+ @osovitny/anatoly
1524
+
1525
+ Authors:
1526
+ Vadim Osovitny
1527
+ Anatoly Osovitny
1528
+
1529
+ Created:
1530
+ 29 Щсе 2020
1531
+
1532
+ Version:
1533
+ 1.0
1534
+
1535
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1536
+ </file>
1537
+ */
1538
+ class DigitalMarketingService {
1539
+ constructor(title, meta, dom) {
1540
+ this.title = title;
1541
+ this.meta = meta;
1542
+ this.dom = dom;
1543
+ }
1544
+ updateTitle(title) {
1545
+ this.title.setTitle(title);
1546
+ }
1547
+ updateDescription(desc) {
1548
+ this.meta.updateTag({ name: 'description', content: desc });
1549
+ }
1550
+ updateKeywords(keywords) {
1551
+ this.meta.updateTag({ name: 'keywords', content: keywords });
1552
+ }
1553
+ updateMetaTags(meta) {
1554
+ meta.forEach(m => this.meta.updateTag(m));
1555
+ }
1556
+ setCanonicalUrl(url) {
1557
+ const canUrl = url === undefined ? this.dom.URL : url;
1558
+ const link = this.dom.createElement('link');
1559
+ link.setAttribute('rel', 'canonical');
1560
+ this.dom.head.appendChild(link);
1561
+ link.setAttribute('href', canUrl);
1562
+ }
1563
+ updateCanonicalUrl(url) {
1564
+ const canUrl = url === undefined ? this.dom.URL : url;
1565
+ const head = this.dom.getElementsByTagName('head')[0];
1566
+ let link = this.dom.querySelector(`link[rel='canonical']`) || null;
1567
+ if (link == null) {
1568
+ link = this.dom.createElement('link');
1569
+ head.appendChild(link);
1570
+ }
1571
+ link.setAttribute('rel', 'canonical');
1572
+ link.setAttribute('href', canUrl);
1573
+ }
1574
+ }
1575
+ DigitalMarketingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DigitalMarketingService, deps: [{ token: i1$4.Title }, { token: i1$4.Meta }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1576
+ DigitalMarketingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DigitalMarketingService, providedIn: 'root' });
1577
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DigitalMarketingService, decorators: [{
1578
+ type: Injectable,
1579
+ args: [{
1580
+ providedIn: 'root'
1581
+ }]
1582
+ }], ctorParameters: function () {
1583
+ return [{ type: i1$4.Title }, { type: i1$4.Meta }, { type: undefined, decorators: [{
1584
+ type: Inject,
1585
+ args: [DOCUMENT]
1586
+ }] }];
1587
+ } });
1588
+
1589
+ /*
1590
+ <file>
1591
+ Project:
1592
+ @osovitny/anatoly
1593
+
1594
+ Authors:
1595
+ Vadim Osovitny
1596
+ Anatoly Osovitny
1597
+
1598
+ Created:
1599
+ 29 Nov 2020
1600
+
1601
+ Version:
1602
+ 1.0
1603
+
1604
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1605
+ </file>
1606
+ */
1607
+ class GoogleAnalyticsService {
1608
+ constructor(router) {
1609
+ this.router = router;
1610
+ /*
1611
+ https://yashints.dev/blog/2019/02/12/angular-ga-tagmanager
1612
+ https://developers.google.com/analytics/devguides/collection/gtagjs/pages
1613
+ https://developers.google.com/analytics/devguides/collection/upgrade/analyticsjs
1614
+ */
1615
+ }
1616
+ subscribe() {
1617
+ this.subscription = this.router.events.subscribe(event => {
1618
+ if (event instanceof NavigationEnd) {
1619
+ if (window.ga) {
1620
+ window.ga('set', 'page', event.urlAfterRedirects);
1621
+ window.ga('send', 'pageview');
1622
+ }
1623
+ }
1624
+ });
1625
+ }
1626
+ unsubscribe() {
1627
+ if (this.subscription) {
1628
+ this.subscription.unsubscribe();
1629
+ }
1630
+ }
1631
+ }
1632
+ GoogleAnalyticsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GoogleAnalyticsService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
1633
+ GoogleAnalyticsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GoogleAnalyticsService });
1634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GoogleAnalyticsService, decorators: [{
1635
+ type: Injectable
1636
+ }], ctorParameters: function () { return [{ type: i1.Router }]; } });
1637
+
1638
+ /*
1639
+ <file>
1640
+ Project:
1641
+ @osovitny/anatoly
1642
+
1643
+ Authors:
1644
+ Vadim Osovitny
1645
+ Anatoly Osovitny
1646
+
1647
+ Created:
1648
+ 26 Jun 2020
1649
+
1650
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1651
+ </file>
1652
+ */
1653
+ class Subs {
1654
+ constructor() {
1655
+ this.subs = [];
1656
+ }
1657
+ add(...subscriptions) {
1658
+ this.subs = this.subs.concat(subscriptions);
1659
+ }
1660
+ set sink(subscription) {
1661
+ this.subs.push(subscription);
1662
+ }
1663
+ unsubscribe() {
1664
+ this.subs.forEach((sub) => sub && sub.unsubscribe());
1665
+ this.subs = [];
1666
+ }
1667
+ }
1668
+
1669
+ /*
1670
+ <file>
1671
+ Project:
1672
+ @osovitny/anatoly
1673
+
1674
+ Authors:
1675
+ Vadim Osovitny
1676
+ Anatoly Osovitny
1677
+
1678
+ Created:
1679
+ 19 March 2020
1680
+
1681
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1682
+ </file>
1683
+ */
1684
+ class Utils {
1685
+ static getValueByNameInQS(name) {
1686
+ return Utils.getValueByName(location.search, name);
1687
+ }
1688
+ static getValueByName(url, name) {
1689
+ name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1690
+ // tslint:disable-next-line:one-variable-per-declaration
1691
+ const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
1692
+ return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
1693
+ }
1694
+ static copyToClipBoard(event, val) {
1695
+ event.preventDefault();
1696
+ const selBox = document.createElement('textarea');
1697
+ selBox.style.position = 'fixed';
1698
+ selBox.style.left = '0';
1699
+ selBox.style.top = '0';
1700
+ selBox.style.opacity = '0';
1701
+ selBox.value = val;
1702
+ document.body.appendChild(selBox);
1703
+ selBox.focus();
1704
+ selBox.select();
1705
+ document.execCommand('copy');
1706
+ document.body.removeChild(selBox);
1707
+ }
1708
+ static downloadFile(name, url) {
1709
+ const link = document.createElement('a');
1710
+ link.download = name;
1711
+ link.href = url;
1712
+ link.click();
1713
+ }
1714
+ static downloadBlobFile(value, fileName) {
1715
+ const nav = window.navigator;
1716
+ if (nav.msSaveOrOpenBlob) {
1717
+ nav.msSaveOrOpenBlob(value, fileName);
1718
+ }
1719
+ else {
1720
+ const downloadURL = window.URL.createObjectURL(value);
1721
+ Utils.downloadFile(fileName, downloadURL);
1722
+ }
1723
+ }
1724
+ /*
1725
+ Author:
1726
+ https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
1727
+ */
1728
+ static slugify(text, prefix = '', postfix = '') {
1729
+ const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;';
1730
+ const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------';
1731
+ const p = new RegExp(a.split('').join('|'), 'g');
1732
+ /*
1733
+ https://css-tricks.com/snippets/javascript/strip-html-tags-in-javascript/
1734
+ https://stackoverflow.com/questions/822452/strip-html-from-text-javascript
1735
+ */
1736
+ text = text.replace(/(<([^>]+)>)/gi, '');
1737
+ let result = text
1738
+ .toString()
1739
+ .toLowerCase()
1740
+ .replace(/\s+/g, '-') // Replace spaces with -
1741
+ .replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
1742
+ .replace(/&/g, '-and-') // Replace & with 'and'
1743
+ .replace(/[^\w\-]+/g, '') // Remove all non-word characters
1744
+ .replace(/\-\-+/g, '-') // Replace multiple - with single -
1745
+ .replace(/^-+/, '') // Trim - from start of text
1746
+ .replace(/-+$/, ''); // Trim - from end of text
1747
+ return prefix + result + postfix;
1748
+ }
1749
+ }
1750
+
1751
+ /*
1752
+ <file>
1753
+ Project:
1754
+ @osovitny/anatoly
1755
+
1756
+ Authors:
1757
+ Vadim Osovitny
1758
+ Anatoly Osovitny
1759
+
1760
+ Created:
1761
+ 29 Apr 2018
1762
+
1763
+ Version:
1764
+ 1.0
1765
+
1766
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1767
+ </file>
1768
+ */
1769
+ class BaseGridReadService extends BehaviorSubject {
1770
+ constructor(http) {
1771
+ super([]);
1772
+ this.http = http;
1773
+ this.data = [];
1774
+ }
1775
+ serializeParams(data) {
1776
+ return data ? ('?' + $.param(data)) : '';
1777
+ }
1778
+ read(params, success, error) {
1779
+ if (this.data.length) {
1780
+ return super.next(this.data);
1781
+ }
1782
+ var url = this.baseReadUrl;
1783
+ if (typeof params === 'undefined') {
1784
+ params = this.savedReadParams;
1785
+ }
1786
+ if (params) {
1787
+ url = this.baseReadUrl + `${this.serializeParams(params)}`;
1788
+ this.savedReadParams = params;
1789
+ }
1790
+ this.http.get(url).pipe(map(res => res)).subscribe(data => {
1791
+ super.next(data);
1792
+ if (success)
1793
+ success();
1794
+ }, e => {
1795
+ if (error)
1796
+ error(e);
1797
+ });
1798
+ }
1799
+ }
1800
+ BaseGridReadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridReadService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1801
+ BaseGridReadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridReadService });
1802
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridReadService, decorators: [{
1803
+ type: Injectable
1804
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
1805
+
1806
+ /*
1807
+ <file>
1808
+ Project:
1809
+ @osovitny/anatoly
1810
+
1811
+ Authors:
1812
+ Vadim Osovitny
1813
+ Anatoly Osovitny
1814
+
1815
+ Created:
1816
+ 29 Apr 2018
1817
+
1818
+ Version:
1819
+ 1.0
1820
+
1821
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1822
+ </file>
1823
+ */
1824
+ class BaseGridEditService extends BaseGridReadService {
1825
+ constructor(http) {
1826
+ super(http);
1827
+ this.http = http;
1828
+ }
1829
+ reset() {
1830
+ this.data = [];
1831
+ }
1832
+ resetItem(dataItem) {
1833
+ if (!dataItem) {
1834
+ return;
1835
+ }
1836
+ //find orignal data item
1837
+ const originalDataItem = this.data.find(item => item.Id === dataItem.Id);
1838
+ //revert changes
1839
+ Object.assign(originalDataItem, dataItem);
1840
+ super.next(this.data);
1841
+ }
1842
+ save(data, isNew, sucess) {
1843
+ const action = isNew ? 'add' : 'update';
1844
+ this.reset();
1845
+ this.post(action, data).subscribe(() => {
1846
+ }, () => {
1847
+ this.read();
1848
+ }, () => {
1849
+ this.read();
1850
+ if (sucess)
1851
+ sucess();
1852
+ });
1853
+ }
1854
+ delete(data, sucess) {
1855
+ this.reset();
1856
+ const url = `${this.baseUrl}/delete${this.serializeParams(data)}`;
1857
+ return this.http.delete(url).subscribe(() => {
1858
+ this.read();
1859
+ if (sucess)
1860
+ sucess();
1861
+ }, () => {
1862
+ this.read();
1863
+ });
1864
+ }
1865
+ post(action, data) {
1866
+ const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1867
+ return this.http.post(url, data).pipe(map(res => res));
1868
+ }
1869
+ }
1870
+ BaseGridEditService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridEditService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1871
+ BaseGridEditService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridEditService });
1872
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridEditService, decorators: [{
1873
+ type: Injectable
1874
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
1875
+
1876
+ /*
1877
+ <file>
1878
+ Project:
1879
+ @osovitny/anatoly
1880
+
1881
+ Authors:
1882
+ Vadim Osovitny
1883
+ Anatoly Osovitny
1884
+
1885
+ Created:
1886
+ 30 April 2020
1887
+
1888
+ Version:
1889
+ 1.0
1890
+
1891
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1892
+ </file>
1893
+ */
1894
+ const consts = {
1895
+ billingApiPath: 'api/billing',
1896
+ // Notifications API
1897
+ notificationsApiPath: 'api/notifications',
1898
+ };
1899
+
1900
+ /*
1901
+ <file>
1902
+ Project:
1903
+ @osovitny/anatoly
1904
+
1905
+ Authors:
1906
+ Vadim Osovitny
1907
+ Anatoly Osovitny
1908
+
1909
+ Created:
1910
+ 30 April 2020
1911
+
1912
+ Version:
1913
+ 1.0
1914
+
1915
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1916
+ </file>
1917
+ */
1918
+ class NotificationsApiService extends BaseApiService {
1919
+ constructor(http) {
1920
+ super(http);
1921
+ this.http = http;
1922
+ this.baseUrl = consts.notificationsApiPath;
1923
+ }
1924
+ retrieveNotifications() {
1925
+ return this.get('retrieveNotifications');
1926
+ }
1927
+ }
1928
+ NotificationsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationsApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1929
+ NotificationsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationsApiService, providedIn: 'root' });
1930
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationsApiService, decorators: [{
1931
+ type: Injectable,
1932
+ args: [{
1933
+ providedIn: 'root'
1934
+ }]
1935
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
1936
+
1937
+ /*
1938
+ <file>
1939
+ Project:
1940
+ @osovitny/anatoly
1941
+
1942
+ Authors:
1943
+ Vadim Osovitny
1944
+ Anatoly Osovitny
1945
+
1946
+ Created:
1947
+ 12 Nov 2017
1948
+
1949
+ Version:
1950
+ 1.0
1951
+
1952
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1953
+ </file>
1954
+ */
1955
+ class BillingApiService extends BaseApiService {
1956
+ constructor(http) {
1957
+ super(http);
1958
+ this.http = http;
1959
+ this.baseUrl = consts.billingApiPath;
1960
+ }
1961
+ requestNewSubscription(requestedPlan, success, error) {
1962
+ this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe((data) => {
1963
+ if (success)
1964
+ success();
1965
+ }, (e) => {
1966
+ if (error)
1967
+ error();
1968
+ });
1969
+ }
1970
+ cancelRequestedSubscription(success, error) {
1971
+ this.postQS("cancelRequestedSubscription", null).subscribe((data) => {
1972
+ if (success)
1973
+ success();
1974
+ }, (e) => {
1975
+ if (error)
1976
+ error();
1977
+ });
1978
+ }
1979
+ buyAccess(requestedPlan, success, error) {
1980
+ this.postQS("buyAccess", { requestedPlan: requestedPlan }).subscribe((data) => {
1981
+ if (success)
1982
+ success();
1983
+ }, (e) => {
1984
+ if (error)
1985
+ error();
1986
+ });
1987
+ }
1988
+ }
1989
+ BillingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1990
+ BillingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService });
1991
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService, decorators: [{
1992
+ type: Injectable
1993
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
1994
+
1995
+ /*
1996
+ <file>
1997
+ Project:
1998
+ @osovitny/anatoly
1999
+
2000
+ Authors:
2001
+ Vadim Osovitny
2002
+ Anatoly Osovitny
2003
+
2004
+ Created:
2005
+ 28 Aug 2018
2006
+
2007
+ Version:
2008
+ 1.0
2009
+
2010
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2011
+ </file>
2012
+ */
2013
+ class BaseComponent {
2014
+ constructor() {
2015
+ this.subs = new Subs$1();
2016
+ }
2017
+ getQSId() {
2018
+ var id = Utils$1.getValueByNameInQS("id");
2019
+ if (typeof id === "undefined" || id == "")
2020
+ return null;
2021
+ return id;
2022
+ }
2023
+ ngOnDestroy() {
2024
+ this.subs.unsubscribe();
2025
+ }
2026
+ }
2027
+ BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2028
+ BaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BaseComponent, selector: "ng-component", ngImport: i0, template: '', isInline: true });
2029
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseComponent, decorators: [{
2030
+ type: Component,
2031
+ args: [{
2032
+ template: ''
2033
+ }]
2034
+ }] });
2035
+
2036
+ /*
2037
+ <file>
2038
+ Project:
2039
+ @osovitny/anatoly
2040
+
2041
+ Authors:
2042
+ Vadim Osovitny
2043
+ Anatoly Osovitny
2044
+
2045
+ Created:
2046
+ 20 Nov 2017
2047
+
2048
+ Version:
2049
+ 1.0
2050
+
2051
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2052
+ </file>
2053
+ */
2054
+ class BaseEditComponent extends BaseComponent {
2055
+ constructor() {
2056
+ super();
2057
+ this.formSubmitted = false;
2058
+ }
2059
+ isActionAdding() {
2060
+ var id = Utils$1.getValueByNameInQS("id");
2061
+ if (typeof id === "undefined" || id == "")
2062
+ return true;
2063
+ return false;
2064
+ }
2065
+ getEntityId() {
2066
+ return this.getQSId();
2067
+ }
2068
+ isControlValid(name, frmGroup = null) {
2069
+ return !this.isControlInvalid(name, frmGroup);
2070
+ }
2071
+ isControlInvalid(name, frmGroup = null) {
2072
+ if (typeof name === "undefined" || name == "") {
2073
+ return false;
2074
+ }
2075
+ let fg = frmGroup ? frmGroup : this.formGroup;
2076
+ if (!fg) {
2077
+ return false;
2078
+ }
2079
+ if (fg.get(name)) {
2080
+ return ((this.formSubmitted && fg.get(name).invalid) ||
2081
+ (fg.get(name).touched && fg.get(name).invalid));
2082
+ }
2083
+ return false;
2084
+ }
2085
+ //FormGroup functions
2086
+ getFormValue(name, frmGroup = null) {
2087
+ let fg = frmGroup ? frmGroup : this.formGroup;
2088
+ return fg.controls[name].value;
2089
+ }
2090
+ setFormValue(name, value, frmGroup = null) {
2091
+ let fg = frmGroup ? frmGroup : this.formGroup;
2092
+ fg.controls[name].setValue(value);
2093
+ }
2094
+ getFormGroupValue(groupName, name, frmGroup = null) {
2095
+ let fg = frmGroup ? frmGroup : this.formGroup;
2096
+ return fg.controls[groupName].get(name).value;
2097
+ }
2098
+ setFormGroupValue(groupName, name, value, frmGroup = null) {
2099
+ let fg = frmGroup ? frmGroup : this.formGroup;
2100
+ fg.controls[groupName].get(name).setValue(value);
2101
+ }
2102
+ /**
2103
+ * Add control to form group
2104
+ * @param name
2105
+ * @param formControl
2106
+ * @param formGroup
2107
+ */
2108
+ addControl(name, formControl, frmGroup = null) {
2109
+ let fg = frmGroup ? frmGroup : this.formGroup;
2110
+ fg.addControl(name, formControl);
2111
+ }
2112
+ /**
2113
+ * Removes control from form group
2114
+ * @param name
2115
+ * @param formGroup
2116
+ */
2117
+ removeControl(name, frmGroup = null) {
2118
+ let fg = frmGroup ? frmGroup : this.formGroup;
2119
+ if (fg.get(name)) {
2120
+ fg.removeControl(name);
2121
+ }
2122
+ }
2123
+ /**
2124
+ * return new form control
2125
+ * @param formState
2126
+ * @param validatorOrOpts
2127
+ * @param asyncValidator
2128
+ */
2129
+ createFormControl(formState, validatorOrOpts, asyncValidator) {
2130
+ return new FormControl(formState, validatorOrOpts, asyncValidator);
2131
+ }
2132
+ /**
2133
+ * Set error to control
2134
+ * @param controlName formControl name
2135
+ * @param err error expect {erroname: boolean} format
2136
+ * @param formGroup Specific form group. default it will apply on this.formGroup property
2137
+ */
2138
+ setControlError(controlName, err, frmGroup = null) {
2139
+ var _a;
2140
+ let fg = frmGroup ? frmGroup : this.formGroup;
2141
+ (_a = fg.get(controlName)) === null || _a === void 0 ? void 0 : _a.setErrors(err);
2142
+ }
2143
+ /**
2144
+ * Set {invalid: true} for the specified form
2145
+ * @param controlName form control name
2146
+ * @param formGroup
2147
+ */
2148
+ setInValidError(controlName, frmGroup = null) {
2149
+ var _a;
2150
+ let fg = frmGroup ? frmGroup : this.formGroup;
2151
+ (_a = fg.get(controlName)) === null || _a === void 0 ? void 0 : _a.setErrors({ invalid: true });
2152
+ }
2153
+ /**
2154
+ * returns formgroup controls.
2155
+ * main use case is used in html pages
2156
+ */
2157
+ get fc() {
2158
+ return this.formGroup.controls;
2159
+ }
2160
+ }
2161
+ BaseEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2162
+ BaseEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BaseEditComponent, selector: "ng-component", inputs: { formGroup: "formGroup", formSubmitted: "formSubmitted" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
2163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseEditComponent, decorators: [{
2164
+ type: Component,
2165
+ args: [{
2166
+ template: ''
2167
+ }]
2168
+ }], ctorParameters: function () { return []; }, propDecorators: { formGroup: [{
2169
+ type: Input
2170
+ }], formSubmitted: [{
2171
+ type: Input
2172
+ }] } });
2173
+
2174
+ /*
2175
+ <file>
2176
+ Project:
2177
+ @osovitny/anatoly
2178
+
2179
+ Authors:
2180
+ Vadim Osovitny
2181
+ Anatoly Osovitny
2182
+
2183
+ Created:
2184
+ 24 Jan 2022
2185
+
2186
+ Version:
2187
+ 1.0
2188
+
2189
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2190
+ </file>
2191
+ */
2192
+ class BaseDialog extends BaseEditComponent {
2193
+ constructor() {
2194
+ super();
2195
+ this._opened = false;
2196
+ }
2197
+ get opened() {
2198
+ return this._opened;
2199
+ }
2200
+ open() {
2201
+ this._opened = true;
2202
+ }
2203
+ close() {
2204
+ this._opened = false;
2205
+ }
2206
+ }
2207
+ BaseDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
2208
+ BaseDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BaseDialog, selector: "ng-component", inputs: { opened: "opened" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
2209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseDialog, decorators: [{
2210
+ type: Component,
2211
+ args: [{
2212
+ template: ''
2213
+ }]
2214
+ }], ctorParameters: function () { return []; }, propDecorators: { opened: [{
2215
+ type: Input
2216
+ }] } });
2217
+
2218
+ /*
2219
+ <file>
2220
+ Project:
2221
+ @osovitny/anatoly
2222
+
2223
+ Authors:
2224
+ Vadim Osovitny
2225
+ Anatoly Osovitny
2226
+
2227
+ Created:
2228
+ 4 Jul 2018
2229
+
2230
+ Version:
2231
+ 1.0
2232
+
2233
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2234
+ </file>
2235
+ */
2236
+ class SignUpButtonComponent {
2237
+ }
2238
+ SignUpButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignUpButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2239
+ SignUpButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: { classbtn: "classbtn" }, ngImport: i0, template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n" });
2240
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignUpButtonComponent, decorators: [{
2241
+ type: Component,
2242
+ args: [{ selector: "anatoly-signup-button", template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n" }]
2243
+ }], propDecorators: { classbtn: [{
2244
+ type: Input
2245
+ }] } });
2246
+
2247
+ /*
2248
+ <file>
2249
+ Project:
2250
+ @osovitny/anatoly
2251
+
2252
+ Authors:
2253
+ Vadim Osovitny
2254
+ Anatoly Osovitny
2255
+
2256
+ Created:
2257
+ 14 Aug 2018
2258
+
2259
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2260
+ </file>
2261
+ */
2262
+ class BuyAccessButtonComponent {
2263
+ constructor(appContext, api) {
2264
+ this.appContext = appContext;
2265
+ this.api = api;
2266
+ this.contextUpdated = false;
2267
+ this.isUserSignedIn = false;
2268
+ this.currentPlan = 0;
2269
+ this.currentPlanTitle = '';
2270
+ }
2271
+ ngOnInit() {
2272
+ if (!this.appContext.isUserSignedIn()) {
2273
+ this.contextUpdated = true;
2274
+ return;
2275
+ }
2276
+ this.appContext.getCurrent((current) => {
2277
+ this.isUserSignedIn = current.isUserSignedIn;
2278
+ if (this.isUserSignedIn) {
2279
+ this.currentPlan = current.account.billingPlan;
2280
+ this.currentPlanTitle = current.account.billingPlanAsString;
2281
+ }
2282
+ this.contextUpdated = true;
2283
+ });
2284
+ }
2285
+ onBuyPlan() {
2286
+ const text = `Requested plan: ${this.plantitle} `;
2287
+ const that = this;
2288
+ Alerts$1.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', () => {
2289
+ that.api.buyAccess(that.plan, () => {
2290
+ Alerts$1.success('Access Granted', null, null, () => {
2291
+ window.location.reload();
2292
+ });
2293
+ });
2294
+ });
2295
+ }
2296
+ }
2297
+ BuyAccessButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BuyAccessButtonComponent, deps: [{ token: i1$5.AppContextService }, { token: i2.BillingApiService }], target: i0.ɵɵFactoryTarget.Component });
2298
+ BuyAccessButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BuyAccessButtonComponent, selector: "anatoly-buyaccess-button", inputs: { plan: "plan", plantitle: "plantitle" }, ngImport: i0, template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: ["classbtn"] }] });
2299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BuyAccessButtonComponent, decorators: [{
2300
+ type: Component,
2301
+ args: [{ selector: 'anatoly-buyaccess-button', template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n" }]
2302
+ }], ctorParameters: function () { return [{ type: i1$5.AppContextService }, { type: i2.BillingApiService }]; }, propDecorators: { plan: [{
2303
+ type: Input
2304
+ }], plantitle: [{
2305
+ type: Input
2306
+ }] } });
2307
+
2308
+ /*
2309
+ <file>
2310
+ Project:
2311
+ @osovitny/anatoly
2312
+
2313
+ Authors:
2314
+ Vadim Osovitny
2315
+ Anatoly Osovitny
2316
+
2317
+ Created:
2318
+ 12 Nov 2017
2319
+
2320
+ Version:
2321
+ 1.0
2322
+
2323
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2324
+ </file>
2325
+ */
2326
+ class UpgradePlanButtonComponent {
2327
+ constructor(api) {
2328
+ this.api = api;
2329
+ }
2330
+ onUpgradePlan() {
2331
+ const text = `Current plan: ${this.currentplantitle} New plan: ${this.requestedplantitle}`;
2332
+ const that = this;
2333
+ Alerts$1.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', () => {
2334
+ that.api.requestNewSubscription(that.requestedplan, () => {
2335
+ Alerts$1.success('Your request for changing plan has been sent.', null, null, () => {
2336
+ window.location.reload();
2337
+ });
2338
+ });
2339
+ });
2340
+ }
2341
+ }
2342
+ UpgradePlanButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UpgradePlanButtonComponent, deps: [{ token: i2.BillingApiService }], target: i0.ɵɵFactoryTarget.Component });
2343
+ UpgradePlanButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: UpgradePlanButtonComponent, selector: "anatoly-upgrade-plan-button", inputs: { currentplantitle: "currentplantitle", requestedplan: "requestedplan", requestedplantitle: "requestedplantitle" }, ngImport: i0, template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n" });
2344
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UpgradePlanButtonComponent, decorators: [{
2345
+ type: Component,
2346
+ args: [{ selector: 'anatoly-upgrade-plan-button', template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n" }]
2347
+ }], ctorParameters: function () { return [{ type: i2.BillingApiService }]; }, propDecorators: { currentplantitle: [{
2348
+ type: Input
2349
+ }], requestedplan: [{
2350
+ type: Input
2351
+ }], requestedplantitle: [{
2352
+ type: Input
2353
+ }] } });
2354
+
2355
+ /*
2356
+ <file>
2357
+ Project:
2358
+ @osovitny/anatoly
2359
+
2360
+ Authors:
2361
+ Vadim Osovitny
2362
+ Anatoly Osovitny
2363
+
2364
+ Created:
2365
+ 1 Jun 2018
2366
+
2367
+ Version:
2368
+ 1.0
2369
+
2370
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2371
+ </file>
2372
+ */
2373
+ class SubscribePlanButtonComponent {
2374
+ constructor(appcontext) {
2375
+ this.appcontext = appcontext;
2376
+ this.contextUpdated = false;
2377
+ this.isUserSignedIn = false;
2378
+ this.currentPlan = 0;
2379
+ this.currentPlanTitle = "";
2380
+ this.requestedPlan = 0;
2381
+ this.requestedPlanTitle = "";
2382
+ }
2383
+ ngOnInit() {
2384
+ if (!this.appcontext.isUserSignedIn()) {
2385
+ this.contextUpdated = true;
2386
+ return;
2387
+ }
2388
+ this.appcontext.getCurrent((current) => {
2389
+ this.isUserSignedIn = current.isUserSignedIn;
2390
+ if (this.isUserSignedIn) {
2391
+ this.currentPlan = current.account.billingPlan;
2392
+ this.currentPlanTitle = current.account.billingPlanAsString;
2393
+ this.requestedPlan = current.account.requestedBillingPlan;
2394
+ this.requestedPlanTitle = current.account.requestedBillingPlanAsString;
2395
+ }
2396
+ this.contextUpdated = true;
2397
+ });
2398
+ }
2399
+ }
2400
+ SubscribePlanButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubscribePlanButtonComponent, deps: [{ token: i1$5.AppContextService }], target: i0.ɵɵFactoryTarget.Component });
2401
+ SubscribePlanButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SubscribePlanButtonComponent, selector: "anatoly-subscribe-plan-button", inputs: { plan: "plan", plantitle: "plantitle" }, ngImport: i0, template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: UpgradePlanButtonComponent, selector: "anatoly-upgrade-plan-button", inputs: ["currentplantitle", "requestedplan", "requestedplantitle"] }, { kind: "component", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: ["classbtn"] }] });
2402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubscribePlanButtonComponent, decorators: [{
2403
+ type: Component,
2404
+ args: [{ selector: "anatoly-subscribe-plan-button", template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n" }]
2405
+ }], ctorParameters: function () { return [{ type: i1$5.AppContextService }]; }, propDecorators: { plan: [{
2406
+ type: Input
2407
+ }], plantitle: [{
2408
+ type: Input
2409
+ }] } });
2410
+
2411
+ /*
2412
+ <file>
2413
+ Project:
2414
+ @osovitny/anatoly
2415
+
2416
+ Authors:
2417
+ Vadim Osovitny
2418
+ Anatoly Osovitny
2419
+
2420
+ Created:
2421
+ 23 Apr 2018
2422
+
2423
+ Version:
2424
+ 1.0
2425
+
2426
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2427
+ </file>
2428
+ */
2429
+ class ContentHeaderComponent {
2430
+ ngOnInit() {
2431
+ if (this.title == null) {
2432
+ this.title = "";
2433
+ }
2434
+ }
2435
+ }
2436
+ ContentHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ContentHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2437
+ ContentHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ContentHeaderComponent, selector: "anatoly-content-header", inputs: { title: "title" }, ngImport: i0, template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n" });
2438
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ContentHeaderComponent, decorators: [{
2439
+ type: Component,
2440
+ args: [{ selector: "anatoly-content-header", template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n" }]
2441
+ }], propDecorators: { title: [{
2442
+ type: Input
2443
+ }] } });
2444
+
2445
+ /*
2446
+ <file>
2447
+ Project:
2448
+ @osovitny/anatoly
2449
+
2450
+ Authors:
2451
+ Vadim Osovitny
2452
+ Anatoly Osovitny
2453
+
2454
+ Created:
2455
+ 12 Dec 2017
2456
+
2457
+ Version:
2458
+ 1.0
2459
+
2460
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2461
+ </file>
2462
+ */
2463
+ const DefaultEditorOptions = {
2464
+ placeholderText: "Edit Your Content Here",
2465
+ charCounterCount: true,
2466
+ heightMin: 100,
2467
+ toolbarInline: false,
2468
+ toolbarButtons: {
2469
+ moreText: {
2470
+ buttons: [
2471
+ "bold",
2472
+ "italic",
2473
+ "underline",
2474
+ "strikeThrough",
2475
+ "subscript",
2476
+ "superscript",
2477
+ "fontFamily",
2478
+ "fontSize",
2479
+ "textColor",
2480
+ "backgroundColor",
2481
+ "inlineClass",
2482
+ "inlineStyle",
2483
+ ],
2484
+ },
2485
+ moreParagraph: {
2486
+ buttons: [
2487
+ "alignLeft",
2488
+ "alignCenter",
2489
+ "formatOLSimple",
2490
+ "alignRight",
2491
+ "alignJustify",
2492
+ "formatOL",
2493
+ "formatUL",
2494
+ "paragraphFormat",
2495
+ "paragraphStyle",
2496
+ "lineHeight",
2497
+ "outdent",
2498
+ "indent",
2499
+ "quote",
2500
+ ],
2501
+ },
2502
+ moreRich: {
2503
+ buttons: [
2504
+ "insertLink",
2505
+ "insertImage",
2506
+ "insertTable",
2507
+ "emoticons",
2508
+ "fontAwesome",
2509
+ "specialCharacters",
2510
+ "embedly",
2511
+ ],
2512
+ },
2513
+ moreMisc: {
2514
+ buttons: [
2515
+ "selectAll",
2516
+ "clearFormatting",
2517
+ "html",
2518
+ "undo",
2519
+ "redo",
2520
+ "fullscreen",
2521
+ ],
2522
+ align: "right",
2523
+ },
2524
+ },
2525
+ /*
2526
+ Upload:
2527
+ https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
2528
+ */
2529
+ imageUploadURL: "/api/htmlEditor/uploadImage",
2530
+ imageAllowedTypes: ["jpeg", "jpg", "png"],
2531
+ imageUploadParams: { uploadType: "", uploadParentId: "" },
2532
+ };
2533
+
2534
+ /*
2535
+ <file>
2536
+ Project:
2537
+ @osovitny/anatoly
2538
+
2539
+ Authors:
2540
+ Vadim Osovitny
2541
+ Anatoly Osovitny
2542
+
2543
+ Created:
2544
+ 12 Dec 2017
2545
+
2546
+ Version:
2547
+ 1.0
2548
+
2549
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2550
+ </file>
2551
+ */
2552
+ class BaseHtmlEditorComponent extends BaseEditComponent {
2553
+ constructor() {
2554
+ super();
2555
+ this.froalaEditorInitialized = false;
2556
+ this.afterInitializedActions = [];
2557
+ // Inputs
2558
+ this.editorLabelText = "Html";
2559
+ this.editorOptions = {};
2560
+ }
2561
+ ngOnInit() {
2562
+ let opt = this.editorOptions;
2563
+ if (typeof this.editorOptions == "string") {
2564
+ opt = JSON.parse(this.editorOptions);
2565
+ }
2566
+ let newOptions = $.extend({}, DefaultEditorOptions, opt);
2567
+ const key = AppCoreSettings$1.froalaEditorKey;
2568
+ if (key) {
2569
+ newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
2570
+ }
2571
+ if (newOptions.events && newOptions.events.initialized) {
2572
+ newOptions.events.initialized.overridden = false;
2573
+ }
2574
+ this.options = newOptions;
2575
+ }
2576
+ ngAfterViewInit() {
2577
+ const that = this;
2578
+ setTimeout(function () {
2579
+ that.froalaEditorInitialized = true;
2580
+ that.onInitialized();
2581
+ }, 300);
2582
+ }
2583
+ onInitialized() {
2584
+ let actions = this.afterInitializedActions;
2585
+ // Clear actions
2586
+ this.afterInitializedActions = [];
2587
+ if (actions) {
2588
+ for (let i = 0; i < actions.length; i++) {
2589
+ actions[i]();
2590
+ }
2591
+ }
2592
+ }
2593
+ getEditor() {
2594
+ if (this.froalaEditor)
2595
+ return this.froalaEditor.getEditor();
2596
+ return null;
2597
+ }
2598
+ // Public Funcs
2599
+ doAfterInitialized(action) {
2600
+ const that = this;
2601
+ if (!this.froalaEditorInitialized) {
2602
+ this.afterInitializedActions.push(() => {
2603
+ action(that);
2604
+ });
2605
+ }
2606
+ else {
2607
+ action(that);
2608
+ }
2609
+ }
2610
+ initializeControl(control) {
2611
+ this.froalaEditor = control;
2612
+ this.froalaEditor.initialize();
2613
+ }
2614
+ setUploadParams(uploadType, uploadParentId) {
2615
+ this.doAfterInitialized(function (that) {
2616
+ const editor = that.getEditor();
2617
+ if (typeof editor == "undefined" || editor == null) {
2618
+ return;
2619
+ }
2620
+ editor.opts.imageUploadParams.uploadType = uploadType;
2621
+ editor.opts.imageUploadParams.uploadParentId = uploadParentId;
2622
+ });
2623
+ }
2624
+ }
2625
+ BaseHtmlEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseHtmlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2626
+ BaseHtmlEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BaseHtmlEditorComponent, selector: "ng-component", inputs: { editorLabelText: "editorLabelText", editorOptions: "editorOptions" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
2627
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseHtmlEditorComponent, decorators: [{
2628
+ type: Component,
2629
+ args: [{
2630
+ template: "",
2631
+ }]
2632
+ }], ctorParameters: function () { return []; }, propDecorators: { editorLabelText: [{
2633
+ type: Input
2634
+ }], editorOptions: [{
2635
+ type: Input
2636
+ }] } });
2637
+
2638
+ /*
2639
+ <file>
2640
+ Project:
2641
+ @osovitny/anatoly
2642
+
2643
+ Authors:
2644
+ Vadim Osovitny
2645
+ Anatoly Osovitny
2646
+
2647
+ Created:
2648
+ 28 Jun 2020
2649
+
2650
+ Version:
2651
+ 1.0
2652
+
2653
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2654
+ </file>
2655
+ */
2656
+ class NativeElementDirective {
2657
+ constructor(el, control) {
2658
+ this.el = el;
2659
+ this.control = control;
2660
+ }
2661
+ ngOnInit() {
2662
+ // sets the localization key to the control
2663
+ this.control.control.nativeElement = this.el.nativeElement;
2664
+ }
2665
+ }
2666
+ NativeElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NativeElementDirective, deps: [{ token: i0.ElementRef }, { token: i1$7.NgControl }], target: i0.ɵɵFactoryTarget.Directive });
2667
+ NativeElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: NativeElementDirective, selector: "[formControl], [formControlName]", ngImport: i0 });
2668
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NativeElementDirective, decorators: [{
2669
+ type: Directive,
2670
+ args: [{
2671
+ selector: '[formControl], [formControlName]'
2672
+ }]
2673
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$7.NgControl }]; } });
2674
+
2675
+ /*
2676
+ <file>
2677
+ Project:
2678
+ @osovitny/anatoly
2679
+
2680
+ Authors:
2681
+ Vadim Osovitny
2682
+ Anatoly Osovitny
2683
+
2684
+ Created:
2685
+ 8 Dec 2017
2686
+
2687
+ Version:
2688
+ 1.0
2689
+
2690
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2691
+ </file>
2692
+ */
2693
+ class ValidationSummaryComponent extends BaseEditComponent {
2694
+ constructor() {
2695
+ super();
2696
+ }
2697
+ getFormValidationMessages() {
2698
+ let messages = [];
2699
+ Object.keys(this.formGroup.controls).forEach((k) => {
2700
+ var control = this.formGroup.controls[k];
2701
+ if (control.controls != null) {
2702
+ Object.keys(control.controls).forEach((k) => {
2703
+ var child = control.controls[k];
2704
+ this.getValidationMessages(child, this.getControlName(child, k)).forEach((m) => messages.push(m));
2705
+ });
2706
+ }
2707
+ else {
2708
+ this.getValidationMessages(control, this.getControlName(control, k)).forEach((m) => messages.push(m));
2709
+ }
2710
+ });
2711
+ return messages;
2712
+ }
2713
+ getValidationMessages(state, thingName) {
2714
+ let thing = state.path || thingName;
2715
+ let messages = [];
2716
+ if (state.errors) {
2717
+ for (let errorName in state.errors) {
2718
+ if (state.errors.hasOwnProperty(errorName)) {
2719
+ switch (errorName) {
2720
+ case "required":
2721
+ messages.push(`${thing} is required`);
2722
+ break;
2723
+ case "minlength":
2724
+ messages.push(`${thing} must be at least ${state.errors["minlength"].requiredLength} characters`);
2725
+ break;
2726
+ case "pattern":
2727
+ messages.push(`${thing} contains illegal characters`);
2728
+ break;
2729
+ case "format":
2730
+ messages.push(`${thing} format mismatch`);
2731
+ break;
2732
+ case "maxlength":
2733
+ messages.push(`${thing} must have maximum ${state.errors["maxlength"].requiredLength} characters`);
2734
+ break;
2735
+ case "specialcharacters":
2736
+ messages.push(`${thing} contains special characters`);
2737
+ break;
2738
+ }
2739
+ }
2740
+ }
2741
+ }
2742
+ return messages;
2743
+ }
2744
+ /**
2745
+ * Get Control Name
2746
+ * @param control
2747
+ * @param thingName
2748
+ */
2749
+ getControlName(control, thingName) {
2750
+ let value = this.getControlTitle(control);
2751
+ return value ? value : thingName;
2752
+ }
2753
+ /**
2754
+ * Retrieve tilte of control
2755
+ * @param control
2756
+ */
2757
+ getControlTitle(control) {
2758
+ if (control === null || control === void 0 ? void 0 : control.nativeElement) {
2759
+ let controlTitle = this.getTitleAttribute(control.nativeElement);
2760
+ if (controlTitle) {
2761
+ return controlTitle;
2762
+ }
2763
+ }
2764
+ return undefined;
2765
+ }
2766
+ /**
2767
+ * Return title attribute of form control
2768
+ */
2769
+ getTitleAttribute(nativeElement) {
2770
+ var _a, _b, _c, _d, _e, _f;
2771
+ let title;
2772
+ switch (nativeElement.tagName) {
2773
+ // For Kendo time and date picker element title is assigned to the 4th child control.
2774
+ case "KENDO-TIMEPICKER":
2775
+ case "KENDO-DATEPICKER":
2776
+ title =
2777
+ (_d = (_c = (_b = (_a = nativeElement.children[0]) === null || _a === void 0 ? void 0 : _a.children[0]) === null || _b === void 0 ? void 0 : _b.children[0]) === null || _c === void 0 ? void 0 : _c.children[0]) === null || _d === void 0 ? void 0 : _d.getAttribute("title");
2778
+ break;
2779
+ // For Kendo numaric element title is assigned to the 2nd child control.
2780
+ case "KENDO-NUMERICTEXTBOX":
2781
+ title = (_f = (_e = nativeElement.children[0]) === null || _e === void 0 ? void 0 : _e.children[0]) === null || _f === void 0 ? void 0 : _f.getAttribute("title");
2782
+ break;
2783
+ default:
2784
+ title = nativeElement.getAttribute("title");
2785
+ break;
2786
+ }
2787
+ return title;
2788
+ }
2789
+ }
2790
+ ValidationSummaryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ValidationSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2791
+ ValidationSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ValidationSummaryComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "", isInline: true });
2792
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ValidationSummaryComponent, decorators: [{
2793
+ type: Component,
2794
+ args: [{
2795
+ template: "",
2796
+ }]
2797
+ }], ctorParameters: function () { return []; } });
2798
+
2799
+ /*
2800
+ <file>
2801
+ Project:
2802
+ @osovitny/anatoly
2803
+
2804
+ Authors:
2805
+ Vadim Osovitny
2806
+ Anatoly Osovitny
2807
+
2808
+ Created:
2809
+ 6 Dec 2017
2810
+
2811
+ Version:
2812
+ 1.0
2813
+
2814
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2815
+ </file>
2816
+ */
2817
+ class ItemValidationSummaryComponent extends ValidationSummaryComponent {
2818
+ constructor() {
2819
+ super();
2820
+ }
2821
+ }
2822
+ ItemValidationSummaryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ItemValidationSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2823
+ ItemValidationSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: { controlName: "controlName", controlTitle: "controlTitle" }, usesInheritance: true, ngImport: i0, template: "<ul class=\"list-unstyled\" *ngIf=\"isControlInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n\r\n", dependencies: [{ kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2824
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ItemValidationSummaryComponent, decorators: [{
2825
+ type: Component,
2826
+ args: [{ selector: "anatoly-item-validation-summary", template: "<ul class=\"list-unstyled\" *ngIf=\"isControlInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n\r\n" }]
2827
+ }], ctorParameters: function () { return []; }, propDecorators: { controlName: [{
2828
+ type: Input
2829
+ }], controlTitle: [{
2830
+ type: Input
2831
+ }] } });
2832
+
2833
+ /*
2834
+ <file>
2835
+ Project:
2836
+ @osovitny/anatoly
2837
+
2838
+ Authors:
2839
+ Vadim Osovitny
2840
+ Anatoly Osovitny
2841
+
2842
+ Created:
2843
+ 12 Dec 2017
2844
+
2845
+ Version:
2846
+ 1.0
2847
+
2848
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2849
+ </file>
2850
+ */
2851
+ class FormsHtmlEditorComponent extends BaseHtmlEditorComponent {
2852
+ constructor() {
2853
+ super();
2854
+ this.editorFormKey = "html";
2855
+ }
2856
+ setFormValueAfterInitialized(name, value) {
2857
+ this.doAfterInitialized(function (that) {
2858
+ that.setFormValue(name, value);
2859
+ });
2860
+ }
2861
+ }
2862
+ FormsHtmlEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FormsHtmlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2863
+ FormsHtmlEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: FormsHtmlEditorComponent, selector: "anatoly-forms-html-editor", inputs: { editorFormKey: "editorFormKey" }, usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isControlInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [controlName]=\"editorFormKey\"\r\n [controlTitle]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$7.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: i1$7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$7.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$8.FroalaEditorDirective, selector: "[froalaEditor]", inputs: ["froalaEditor", "froalaModel"], outputs: ["froalaModelChange", "froalaInit"], exportAs: ["froalaEditor"] }, { kind: "directive", type: NativeElementDirective, selector: "[formControl], [formControlName]" }, { kind: "component", type: ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: ["controlName", "controlTitle"] }] });
2864
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FormsHtmlEditorComponent, decorators: [{
2865
+ type: Component,
2866
+ args: [{ selector: "anatoly-forms-html-editor", template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isControlInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [controlName]=\"editorFormKey\"\r\n [controlTitle]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n" }]
2867
+ }], ctorParameters: function () { return []; }, propDecorators: { editorFormKey: [{
2868
+ type: Input
2869
+ }] } });
2870
+
2871
+ /*
2872
+ <file>
2873
+ Project:
2874
+ @osovitny/anatoly
2875
+
2876
+ Authors:
2877
+ Vadim Osovitny
2878
+ Anatoly Osovitny
2879
+
2880
+ Created:
2881
+ 12 Dec 2017
2882
+
2883
+ Version:
2884
+ 1.0
2885
+
2886
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2887
+ </file>
2888
+ */
2889
+ class HtmlEditorComponent extends BaseHtmlEditorComponent {
2890
+ constructor() {
2891
+ super();
2892
+ }
2893
+ setHtml(content) {
2894
+ this.doAfterInitialized(function (that) {
2895
+ var editor = that.getEditor();
2896
+ if (typeof editor == "undefined" || editor == null) {
2897
+ return;
2898
+ }
2899
+ editor.html.set(content);
2900
+ });
2901
+ }
2902
+ getHtml() {
2903
+ var editor = this.getEditor();
2904
+ if (typeof editor == "undefined" || editor == null) {
2905
+ return;
2906
+ }
2907
+ return editor.html.get(false);
2908
+ }
2909
+ }
2910
+ HtmlEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: HtmlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2911
+ HtmlEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: HtmlEditorComponent, selector: "anatoly-html-editor", usesInheritance: true, ngImport: i0, template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>", dependencies: [{ kind: "directive", type: i1$8.FroalaEditorDirective, selector: "[froalaEditor]", inputs: ["froalaEditor", "froalaModel"], outputs: ["froalaModelChange", "froalaInit"], exportAs: ["froalaEditor"] }] });
2912
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: HtmlEditorComponent, decorators: [{
2913
+ type: Component,
2914
+ args: [{ selector: "anatoly-html-editor", template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>" }]
2915
+ }], ctorParameters: function () { return []; } });
2916
+
2917
+ /*
2918
+ <file>
2919
+ Project:
2920
+ @osovitny/anatoly
2921
+
2922
+ Authors:
2923
+ Vadim Osovitny
2924
+ Anatoly Osovitny
2925
+
2926
+ Created:
2927
+ 4 Jul 2018
2928
+
2929
+ Version:
2930
+ 1.0
2931
+
2932
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2933
+ </file>
2934
+ */
2935
+ class SignInButtonComponent {
2936
+ constructor() { }
2937
+ }
2938
+ SignInButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignInButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2939
+ SignInButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SignInButtonComponent, selector: "anatoly-signin-button", inputs: { classbtn: "classbtn" }, ngImport: i0, template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n" });
2940
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignInButtonComponent, decorators: [{
2941
+ type: Component,
2942
+ args: [{ selector: "anatoly-signin-button", template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n" }]
2943
+ }], ctorParameters: function () { return []; }, propDecorators: { classbtn: [{
2944
+ type: Input
2945
+ }] } });
2946
+
2947
+ /*
2948
+ <file>
2949
+ Project:
2950
+ @osovitny/anatoly
2951
+
2952
+ Authors:
2953
+ Vadim Osovitny
2954
+ Anatoly Osovitny
2955
+
2956
+ Created:
2957
+ 4 Jul 2018
2958
+
2959
+ Version:
2960
+ 1.0
2961
+
2962
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2963
+ </file>
2964
+ */
2965
+ class SignOutButtonComponent {
2966
+ constructor() { }
2967
+ }
2968
+ SignOutButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignOutButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2969
+ SignOutButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SignOutButtonComponent, selector: "anatoly-signout-button", inputs: { classbtn: "classbtn" }, ngImport: i0, template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n" });
2970
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignOutButtonComponent, decorators: [{
2971
+ type: Component,
2972
+ args: [{ selector: "anatoly-signout-button", template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n" }]
2973
+ }], ctorParameters: function () { return []; }, propDecorators: { classbtn: [{
2974
+ type: Input
2975
+ }] } });
2976
+
2977
+ /*
2978
+ <file>
2979
+ Project:
2980
+ @osovitny/anatoly
2981
+
2982
+ Authors:
2983
+ Vadim Osovitny
2984
+ Anatoly Osovitny
2985
+
2986
+ Created:
2987
+ 9 May 2020
2988
+
2989
+ Version:
2990
+ 1.0
2991
+
2992
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2993
+ </file>
2994
+ */
2995
+ class LoadingComponent {
2996
+ constructor(loadingService) {
2997
+ this.loadingService = loadingService;
2998
+ // Private
2999
+ this.subs = new Subs$1();
3000
+ // Public
3001
+ this.show = false;
3002
+ }
3003
+ ngOnInit() {
3004
+ this.subs.sink = this.loadingService.subscribe((state) => {
3005
+ this.show = state;
3006
+ });
3007
+ }
3008
+ ngOnDestroy() {
3009
+ this.subs.unsubscribe();
3010
+ }
3011
+ }
3012
+ LoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingComponent, deps: [{ token: i1$9.LoadingService }], target: i0.ɵɵFactoryTarget.Component });
3013
+ LoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: LoadingComponent, selector: "anatoly-loading", ngImport: i0, template: "<div *ngIf=\"show\">\r\n <span id=\"pnlLoading\" class=\"k-icon k-i-loading\"></span>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
3014
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingComponent, decorators: [{
3015
+ type: Component,
3016
+ args: [{ selector: 'anatoly-loading', template: "<div *ngIf=\"show\">\r\n <span id=\"pnlLoading\" class=\"k-icon k-i-loading\"></span>\r\n</div>\r\n" }]
3017
+ }], ctorParameters: function () { return [{ type: i1$9.LoadingService }]; } });
3018
+
3019
+ /*
3020
+ <file>
3021
+ Project:
3022
+ @osovitny/anatoly
3023
+
3024
+ Authors:
3025
+ Vadim Osovitny
3026
+ Anatoly Osovitny
3027
+
3028
+ Created:
3029
+ 16 May 2020
3030
+
3031
+ Version:
3032
+ 1.0
3033
+
3034
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3035
+ </file>
3036
+ */
3037
+ const SpinnerSpinKit = {
3038
+ spinnerLine: 'spinner-line-material',
3039
+ // ToDo
3040
+ ChasingDots: 'spinner-chasing-dots',
3041
+ CubeGrid: 'spinner-cube-grid',
3042
+ DoubleBounce: 'spinner-double-bounce',
3043
+ RotatingPlane: 'spinner-rotationg-plane',
3044
+ SpinnerPulse: 'spinner-spinner-pulse',
3045
+ ThreeBounce: 'spinner-three-bounce',
3046
+ WanderingCubes: 'spinner-wandering-cubes',
3047
+ Wave: 'spinner-wave'
3048
+ };
3049
+ class SpinnerComponent {
3050
+ constructor(router, document) {
3051
+ this.router = router;
3052
+ this.document = document;
3053
+ this.isSpinnerVisible = true;
3054
+ this.spinnerSpinKit = SpinnerSpinKit;
3055
+ this.backgroundColor = '#007CB0';
3056
+ this.spinner = SpinnerSpinKit.spinnerLine;
3057
+ this.router.events.subscribe(event => {
3058
+ if (event instanceof NavigationStart) {
3059
+ this.isSpinnerVisible = true;
3060
+ }
3061
+ else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
3062
+ this.isSpinnerVisible = false;
3063
+ }
3064
+ }, () => {
3065
+ this.isSpinnerVisible = false;
3066
+ });
3067
+ }
3068
+ ngOnDestroy() {
3069
+ this.isSpinnerVisible = false;
3070
+ }
3071
+ }
3072
+ SpinnerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SpinnerComponent, deps: [{ token: i1.Router }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
3073
+ SpinnerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SpinnerComponent, selector: "spinner", inputs: { backgroundColor: "backgroundColor", spinner: "spinner" }, ngImport: i0, template: "<div id=\"spinner-loader\" *ngIf=\"isSpinnerVisible\">\r\n <div class=\"loader-bg\">\r\n <div class=\"spinner-line-material\" [class.colored]=\"!backgroundColor\" *ngIf=\"spinner === spinnerSpinKit.spinnerLine\">\r\n <div class=\"spinner-child spinner-bounce1\" [style.background-color]='backgroundColor'></div>\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
3074
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SpinnerComponent, decorators: [{
3075
+ type: Component,
3076
+ args: [{ selector: 'spinner', encapsulation: ViewEncapsulation.None, template: "<div id=\"spinner-loader\" *ngIf=\"isSpinnerVisible\">\r\n <div class=\"loader-bg\">\r\n <div class=\"spinner-line-material\" [class.colored]=\"!backgroundColor\" *ngIf=\"spinner === spinnerSpinKit.spinnerLine\">\r\n <div class=\"spinner-child spinner-bounce1\" [style.background-color]='backgroundColor'></div>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
3077
+ }], ctorParameters: function () {
3078
+ return [{ type: i1.Router }, { type: Document, decorators: [{
3079
+ type: Inject,
3080
+ args: [DOCUMENT]
3081
+ }] }];
3082
+ }, propDecorators: { backgroundColor: [{
3083
+ type: Input
3084
+ }], spinner: [{
3085
+ type: Input
3086
+ }] } });
3087
+
3088
+ /*
3089
+ <file>
3090
+ Project:
3091
+ @osovitny/anatoly
3092
+
3093
+ Authors:
3094
+ Vadim Osovitny
3095
+ Anatoly Osovitny
3096
+
3097
+ Created:
3098
+ 7 Dec 2017
3099
+
3100
+ Version:
3101
+ 1.0
3102
+
3103
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3104
+ </file>
3105
+ */
3106
+ class FormValidationSummaryComponent extends ValidationSummaryComponent {
3107
+ constructor() {
3108
+ super();
3109
+ this.visible = false;
3110
+ this.customerrors = [];
3111
+ /*
3112
+ 0 - only FormValidation messages
3113
+ 1 - only Custom messages
3114
+ 2 - all
3115
+ */
3116
+ this.viewtype = 0;
3117
+ }
3118
+ getErrors() {
3119
+ if (this.viewtype == 1) {
3120
+ return this.customerrors;
3121
+ }
3122
+ let formValidationMessages = this.getFormValidationMessages();
3123
+ if (this.viewtype == 0) {
3124
+ return formValidationMessages;
3125
+ }
3126
+ var messages = [];
3127
+ if (formValidationMessages.length > 0) {
3128
+ messages.push(...formValidationMessages);
3129
+ }
3130
+ if (this.customerrors.length > 0) {
3131
+ messages.push(...this.customerrors);
3132
+ }
3133
+ return messages;
3134
+ }
3135
+ }
3136
+ FormValidationSummaryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FormValidationSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3137
+ FormValidationSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: FormValidationSummaryComponent, selector: "anatoly-form-validation-summary", inputs: { visible: "visible", customerrors: "customerrors", viewtype: "viewtype" }, usesInheritance: true, ngImport: i0, template: "<div class=\"callout callout-danger\" *ngIf=\"visible\">\r\n <h6 class=\"box-title\">There are problems with the form</h6>\r\n <ul>\r\n <li *ngFor=\"let error of getErrors()\"><span>{{error}}</span></li>\r\n </ul>\r\n</div>\r\n\r\n", dependencies: [{ kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
3138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FormValidationSummaryComponent, decorators: [{
3139
+ type: Component,
3140
+ args: [{ selector: "anatoly-form-validation-summary", template: "<div class=\"callout callout-danger\" *ngIf=\"visible\">\r\n <h6 class=\"box-title\">There are problems with the form</h6>\r\n <ul>\r\n <li *ngFor=\"let error of getErrors()\"><span>{{error}}</span></li>\r\n </ul>\r\n</div>\r\n\r\n" }]
3141
+ }], ctorParameters: function () { return []; }, propDecorators: { visible: [{
3142
+ type: Input
3143
+ }], customerrors: [{
3144
+ type: Input
3145
+ }], viewtype: [{
3146
+ type: Input
3147
+ }] } });
3148
+
3149
+ /*
3150
+ <file>
3151
+ Project:
3152
+ @osovitny/anatoly
3153
+
3154
+ Authors:
3155
+ Vadim Osovitny
3156
+ Anatoly Osovitny
3157
+
3158
+ Created:
3159
+ 29 June 2020
3160
+
3161
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3162
+ </file>
3163
+ */
3164
+ class ContactUsForm extends BaseEditComponent$1 {
3165
+ constructor(fb, appContext, api, notificationService) {
3166
+ super();
3167
+ this.fb = fb;
3168
+ this.appContext = appContext;
3169
+ this.api = api;
3170
+ this.notificationService = notificationService;
3171
+ this.isUserSignedIn = false;
3172
+ this.topicList = [
3173
+ { value: 'Billing & Pricing' },
3174
+ { value: 'Legal & Privacy' },
3175
+ { value: 'Repor abuse' },
3176
+ { value: 'Technical Support' },
3177
+ { value: 'Other' }
3178
+ ];
3179
+ //Inputs
3180
+ this.showActionButtons = true;
3181
+ //Outputs
3182
+ this.submit = new EventEmitter();
3183
+ }
3184
+ ngOnInit() {
3185
+ this.createFormGroup();
3186
+ this.init();
3187
+ }
3188
+ createFormGroup() {
3189
+ this.formGroup = this.fb.group({
3190
+ captcha: new FormControl(null, [Validators.required]),
3191
+ name: new FormControl('', [Validators.required]),
3192
+ email: new FormControl('', [Validators.required]),
3193
+ topic: new FormControl('', [Validators.required]),
3194
+ subject: new FormControl('', [Validators.required]),
3195
+ message: new FormControl('', [Validators.required])
3196
+ });
3197
+ }
3198
+ init() {
3199
+ this.appContext.getCurrent(context => {
3200
+ this.isUserSignedIn = context.isUserSignedIn;
3201
+ this.siteKey = context.reCaptchaSiteKey;
3202
+ this.selectedTopic = this.topicList[3].value;
3203
+ this.setFormValue('topic', this.selectedTopic);
3204
+ if (this.isUserSignedIn) {
3205
+ this.setFormValue('name', context.user.displayNameOrFullName);
3206
+ this.setFormValue('email', context.user.email);
3207
+ }
3208
+ }, false);
3209
+ }
3210
+ isValid() {
3211
+ return this.formGroup.valid;
3212
+ }
3213
+ contactUs() {
3214
+ this.formSubmitted = true;
3215
+ if (!this.isValid())
3216
+ return;
3217
+ const captcha = this.getFormValue('captcha');
3218
+ const name = this.getFormValue('name');
3219
+ const email = this.getFormValue('email');
3220
+ const topic = this.selectedTopic;
3221
+ const subject = this.getFormValue('subject');
3222
+ const message = this.getFormValue('message');
3223
+ this.api.sendContactUs(captcha, name, email, topic, subject, message, () => {
3224
+ this.formSubmitted = false;
3225
+ this.notificationService.success('Message has been sent successfully');
3226
+ this.formGroup.reset();
3227
+ this.recaptcha.resetCaptcha();
3228
+ this.submit.emit();
3229
+ }, () => {
3230
+ this.notificationService.error();
3231
+ });
3232
+ }
3233
+ //Events
3234
+ onSubmit() {
3235
+ this.contactUs();
3236
+ }
3237
+ onTopicChange(event) {
3238
+ this.selectedTopic = event.target.value;
3239
+ }
3240
+ }
3241
+ ContactUsForm.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ContactUsForm, deps: [{ token: i1$7.FormBuilder }, { token: i1$5.AppContextService }, { token: i3.EmailsApiService }, { token: i4.NotificationService }], target: i0.ɵɵFactoryTarget.Component });
3242
+ ContactUsForm.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ContactUsForm, selector: "anatoly-forms-contactus-form", inputs: { showActionButtons: "showActionButtons" }, outputs: { submit: "submit" }, viewQueries: [{ propertyName: "recaptcha", first: true, predicate: ["recaptcha"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<form (ngSubmit)='onSubmit()' [formGroup]='formGroup' novalidate>\r\n <anatoly-form-validation-summary [formGroup]='formGroup'\r\n [visible]='formSubmitted && formGroup.invalid'></anatoly-form-validation-summary>\r\n\r\n <div class='contact-us'>\r\n <div class=\"row\">\r\n <div class='form-fields col-6'>\r\n <p>What can we help you with?</p>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('topic') }\" class='form-topic'>\r\n <div class='form-select-wrapper'>\r\n <label class='assistive-text'>Topic *</label>\r\n <select (change)='onTopicChange($event)' class='form-select' formControlName='topic'>\r\n <option *ngFor='let topic of topicList' [value]='topic.value'>{{ topic.value }} </option>\r\n </select>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='topic'\r\n controlTitle='topic'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('name') }\" class='form-name'>\r\n <label class='assistive-text'>Name *</label>\r\n <input class='form-control' formControlName='name' placeholder='Name *' type='text'>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='name'\r\n controlTitle='name'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('email') }\" class='form-email'>\r\n <label class='assistive-text'>E-mail * </label>\r\n <input class='form-control' formControlName='email' placeholder='E-mail *' type='text' />\r\n <p *ngIf='!isUserSignedIn'>Please indicate the email used for your MailEx login if you already have an account</p>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='email'\r\n controlTitle='email'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('subject') }\" class='form-subject'>\r\n <label class='assistive-text'>Subject *</label>\r\n <input class='form-control' formControlName='subject' placeholder='Subject *' type='text' />\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='subject'\r\n controlTitle='subject'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n </div>\r\n <div class='col-6'>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('message') }\" class='form-message'>\r\n <label class='assistive-text'>Message *</label>\r\n <textarea formControlName='message' name='message' placeholder='Message *' rows='4'\r\n type='text'></textarea>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='message'\r\n controlTitle='message'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row form-footer\">\r\n <div class=\"col-6\">\r\n <div style='transform:scale(0.8);transform-origin:0;'>\r\n <ngx-recaptcha2 #recaptcha [siteKey]='siteKey' formControlName='captcha'></ngx-recaptcha2>\r\n </div>\r\n </div>\r\n <div class=\"col-6\">\r\n <button *ngIf='showActionButtons'\r\n [class.btn-primary]='!formGroup.invalid'\r\n class='btn btn-success float-right m-t-20'\r\n type='submit'>\r\n Submit\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</form>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$7.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$7.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$7.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: i1$7.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$7.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i6.ReCaptcha2Component, selector: "ngx-recaptcha2", inputs: ["theme", "size", "hl"] }, { kind: "directive", type: NativeElementDirective, selector: "[formControl], [formControlName]" }, { kind: "component", type: FormValidationSummaryComponent, selector: "anatoly-form-validation-summary", inputs: ["visible", "customerrors", "viewtype"] }, { kind: "component", type: ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: ["controlName", "controlTitle"] }] });
3243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ContactUsForm, decorators: [{
3244
+ type: Component,
3245
+ args: [{ selector: 'anatoly-forms-contactus-form', template: "<form (ngSubmit)='onSubmit()' [formGroup]='formGroup' novalidate>\r\n <anatoly-form-validation-summary [formGroup]='formGroup'\r\n [visible]='formSubmitted && formGroup.invalid'></anatoly-form-validation-summary>\r\n\r\n <div class='contact-us'>\r\n <div class=\"row\">\r\n <div class='form-fields col-6'>\r\n <p>What can we help you with?</p>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('topic') }\" class='form-topic'>\r\n <div class='form-select-wrapper'>\r\n <label class='assistive-text'>Topic *</label>\r\n <select (change)='onTopicChange($event)' class='form-select' formControlName='topic'>\r\n <option *ngFor='let topic of topicList' [value]='topic.value'>{{ topic.value }} </option>\r\n </select>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='topic'\r\n controlTitle='topic'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('name') }\" class='form-name'>\r\n <label class='assistive-text'>Name *</label>\r\n <input class='form-control' formControlName='name' placeholder='Name *' type='text'>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='name'\r\n controlTitle='name'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('email') }\" class='form-email'>\r\n <label class='assistive-text'>E-mail * </label>\r\n <input class='form-control' formControlName='email' placeholder='E-mail *' type='text' />\r\n <p *ngIf='!isUserSignedIn'>Please indicate the email used for your MailEx login if you already have an account</p>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='email'\r\n controlTitle='email'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('subject') }\" class='form-subject'>\r\n <label class='assistive-text'>Subject *</label>\r\n <input class='form-control' formControlName='subject' placeholder='Subject *' type='text' />\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='subject'\r\n controlTitle='subject'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n </div>\r\n <div class='col-6'>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('message') }\" class='form-message'>\r\n <label class='assistive-text'>Message *</label>\r\n <textarea formControlName='message' name='message' placeholder='Message *' rows='4'\r\n type='text'></textarea>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='message'\r\n controlTitle='message'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row form-footer\">\r\n <div class=\"col-6\">\r\n <div style='transform:scale(0.8);transform-origin:0;'>\r\n <ngx-recaptcha2 #recaptcha [siteKey]='siteKey' formControlName='captcha'></ngx-recaptcha2>\r\n </div>\r\n </div>\r\n <div class=\"col-6\">\r\n <button *ngIf='showActionButtons'\r\n [class.btn-primary]='!formGroup.invalid'\r\n class='btn btn-success float-right m-t-20'\r\n type='submit'>\r\n Submit\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</form>\r\n" }]
3246
+ }], ctorParameters: function () { return [{ type: i1$7.FormBuilder }, { type: i1$5.AppContextService }, { type: i3.EmailsApiService }, { type: i4.NotificationService }]; }, propDecorators: { showActionButtons: [{
3247
+ type: Input
3248
+ }], submit: [{
3249
+ type: Output
3250
+ }], recaptcha: [{
3251
+ type: ViewChild,
3252
+ args: ['recaptcha']
3253
+ }] } });
3254
+
3255
+ /*
3256
+ <file>
3257
+ Project:
3258
+ @osovitny/anatoly
3259
+
3260
+ Authors:
3261
+ Vadim Osovitny
3262
+ Anatoly Osovitny
3263
+
3264
+ Created:
3265
+ 26 Jun 2020
3266
+
3267
+ Version:
3268
+ 1.0
3269
+
3270
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3271
+ </file>
3272
+ */
3273
+ class ReplaceTextPipe {
3274
+ transform(inputData, search, replacement) {
3275
+ if (inputData) {
3276
+ return inputData.replace(new RegExp(search, "g"), replacement);
3277
+ }
3278
+ else {
3279
+ return inputData;
3280
+ }
3281
+ }
3282
+ }
3283
+ ReplaceTextPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ReplaceTextPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3284
+ ReplaceTextPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ReplaceTextPipe, name: "replaceText" });
3285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ReplaceTextPipe, decorators: [{
3286
+ type: Pipe,
3287
+ args: [{
3288
+ name: "replaceText",
3289
+ }]
3290
+ }] });
3291
+
3292
+ /*
3293
+ <file>
3294
+ Project:
3295
+ @osovitny/anatoly
3296
+
3297
+ Authors:
3298
+ Vadim Osovitny
3299
+ Anatoly Osovitny
3300
+
3301
+ Created:
3302
+ 26 Jun 2020
3303
+
3304
+ Version:
3305
+ 1.0
3306
+
3307
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3308
+ </file>
3309
+ */
3310
+ class FileSizePipe {
3311
+ constructor() {
3312
+ this.units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
3313
+ }
3314
+ transform(bytes = 0, precision = 0) {
3315
+ if (isNaN(parseFloat(String(bytes))) || !isFinite(bytes))
3316
+ return '';
3317
+ let unit = 0;
3318
+ while (bytes >= 1024) {
3319
+ bytes /= 1024;
3320
+ unit++;
3321
+ }
3322
+ return bytes.toFixed(+precision) + ' ' + this.units[unit];
3323
+ }
3324
+ }
3325
+ FileSizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3326
+ FileSizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: FileSizePipe, name: "filesize" });
3327
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FileSizePipe, decorators: [{
3328
+ type: Pipe,
3329
+ args: [{
3330
+ name: 'filesize',
3331
+ }]
3332
+ }] });
3333
+
3334
+ /*
3335
+ <file>
3336
+ Project:
3337
+ @osovitny/anatoly
3338
+
3339
+ Authors:
3340
+ Vadim Osovitny
3341
+ Anatoly Osovitny
3342
+
3343
+ Created:
3344
+ 27 Oct 2019
3345
+
3346
+ Version:
3347
+ 1.0
3348
+
3349
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3350
+ </file>
3351
+ */
3352
+ class SafeHtmlPipe {
3353
+ constructor(sanitized) {
3354
+ this.sanitized = sanitized;
3355
+ }
3356
+ transform(value) {
3357
+ return this.sanitized.bypassSecurityTrustHtml(value);
3358
+ }
3359
+ }
3360
+ SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$4.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
3361
+ SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
3362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SafeHtmlPipe, decorators: [{
3363
+ type: Pipe,
3364
+ args: [{ name: 'safeHtml' }]
3365
+ }], ctorParameters: function () { return [{ type: i1$4.DomSanitizer }]; } });
3366
+
3367
+ /*
3368
+ <file>
3369
+ Project:
3370
+ @osovitny/anatoly
3371
+
3372
+ Authors:
3373
+ Vadim Osovitny
3374
+ Anatoly Osovitny
3375
+
3376
+ Created:
3377
+ 29 June 2020
3378
+
3379
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3380
+ </file>
3381
+ */
3382
+ let InjectorInstance;
3383
+ class AnatolyCoreModule {
3384
+ constructor(injector, parentModule) {
3385
+ this.injector = injector;
3386
+ throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
3387
+ InjectorInstance = this.injector;
3388
+ }
3389
+ }
3390
+ AnatolyCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyCoreModule, deps: [{ token: i0.Injector }, { token: AnatolyCoreModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
3391
+ AnatolyCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyCoreModule, imports: [CommonModule] });
3392
+ AnatolyCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyCoreModule, providers: [
3393
+ LoggingService,
3394
+ NotificationService,
3395
+ AppContextService,
3396
+ LoadingService,
3397
+ DigitalMarketingService,
3398
+ GoogleAnalyticsService,
3399
+ LocalStorageService,
3400
+ SessionStorageService
3401
+ ], imports: [CommonModule] });
3402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyCoreModule, decorators: [{
3403
+ type: NgModule,
3404
+ args: [{
3405
+ imports: [CommonModule],
3406
+ exports: [],
3407
+ providers: [
3408
+ LoggingService,
3409
+ NotificationService,
3410
+ AppContextService,
3411
+ LoadingService,
3412
+ DigitalMarketingService,
3413
+ GoogleAnalyticsService,
3414
+ LocalStorageService,
3415
+ SessionStorageService
3416
+ ],
3417
+ }]
3418
+ }], ctorParameters: function () {
3419
+ return [{ type: i0.Injector }, { type: AnatolyCoreModule, decorators: [{
3420
+ type: Optional
3421
+ }, {
3422
+ type: SkipSelf
3423
+ }] }];
3424
+ } });
3425
+
3426
+ /*
3427
+ <file>
3428
+ Project:
3429
+ @osovitny/anatoly
3430
+
3431
+ Authors:
3432
+ Vadim Osovitny
3433
+ Anatoly Osovitny
3434
+
3435
+ Created:
3436
+ 16 Jun 2022
3437
+
3438
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3439
+ </file>
3440
+ */
3441
+ class EmailsApiService extends BaseApiService$1 {
3442
+ constructor(http) {
3443
+ super(http);
3444
+ this.http = http;
3445
+ }
3446
+ sendContactUs(captcha, name, email, topic, subject, message, success, error) {
3447
+ return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe(data => {
3448
+ if (success)
3449
+ success(data);
3450
+ }, e => {
3451
+ if (error)
3452
+ error(e);
3453
+ });
3454
+ }
3455
+ }
3456
+ EmailsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EmailsApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3457
+ EmailsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EmailsApiService });
3458
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EmailsApiService, decorators: [{
3459
+ type: Injectable
3460
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
3461
+
3462
+ /*
3463
+ <file>
3464
+ Project:
3465
+ @osovitny/anatoly
3466
+
3467
+ Authors:
3468
+ Vadim Osovitny
3469
+ Anatoly Osovitny
3470
+
3471
+ Created:
3472
+ 4 Mar 2020
3473
+
3474
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3475
+ </file>
3476
+ */
3477
+ class AnatolyDataModule {
3478
+ constructor(parentModule) {
3479
+ throwIfAlreadyLoaded$1(parentModule, 'AnatolyDataModule');
3480
+ }
3481
+ }
3482
+ AnatolyDataModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, deps: [{ token: AnatolyDataModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
3483
+ AnatolyDataModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, imports: [CommonModule] });
3484
+ AnatolyDataModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, providers: [
3485
+ BillingApiService,
3486
+ EmailsApiService
3487
+ ], imports: [CommonModule] });
3488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, decorators: [{
3489
+ type: NgModule,
3490
+ args: [{
3491
+ imports: [
3492
+ CommonModule
3493
+ ],
3494
+ providers: [
3495
+ BillingApiService,
3496
+ EmailsApiService
3497
+ ]
3498
+ }]
3499
+ }], ctorParameters: function () {
3500
+ return [{ type: AnatolyDataModule, decorators: [{
3501
+ type: Optional
3502
+ }, {
3503
+ type: SkipSelf
3504
+ }] }];
3505
+ } });
3506
+
3507
+ /*
3508
+ <file>
3509
+ Project:
3510
+ @osovitny/anatoly
3511
+
3512
+ Authors:
3513
+ Vadim Osovitny
3514
+ Anatoly Osovitny
3515
+
3516
+ Created:
3517
+ 26 Jun 2020
3518
+
3519
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3520
+ </file>
3521
+ */
3522
+ const FroalaEditorModuleWithProviders = FroalaEditorModule.forRoot();
3523
+ const FroalaViewModuleWithProviders = FroalaViewModule.forRoot();
3524
+ class AnatolyUIModule {
3525
+ }
3526
+ AnatolyUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3527
+ AnatolyUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, declarations: [SubscribePlanButtonComponent,
3528
+ UpgradePlanButtonComponent,
3529
+ BuyAccessButtonComponent,
3530
+ SignInButtonComponent,
3531
+ SignUpButtonComponent,
3532
+ SignOutButtonComponent,
3533
+ ContentHeaderComponent,
3534
+ SpinnerComponent,
3535
+ LoadingComponent,
3536
+ HtmlEditorComponent,
3537
+ FormsHtmlEditorComponent,
3538
+ //Directives
3539
+ NativeElementDirective,
3540
+ //Forms
3541
+ ContactUsForm,
3542
+ //Pipes
3543
+ SafeHtmlPipe,
3544
+ ReplaceTextPipe,
3545
+ FileSizePipe,
3546
+ //Validation
3547
+ FormValidationSummaryComponent,
3548
+ ItemValidationSummaryComponent], imports: [CommonModule,
3549
+ ReactiveFormsModule,
3550
+ FormsModule,
3551
+ NgxCaptchaModule, i1$8.FroalaEditorModule, i1$8.FroalaViewModule], exports: [SubscribePlanButtonComponent,
3552
+ UpgradePlanButtonComponent,
3553
+ BuyAccessButtonComponent,
3554
+ SignInButtonComponent,
3555
+ SignUpButtonComponent,
3556
+ SignOutButtonComponent,
3557
+ ContentHeaderComponent,
3558
+ SpinnerComponent,
3559
+ LoadingComponent,
3560
+ HtmlEditorComponent,
3561
+ FormsHtmlEditorComponent,
3562
+ //Directives
3563
+ NativeElementDirective,
3564
+ //Forms
3565
+ ContactUsForm,
3566
+ //Pipes
3567
+ SafeHtmlPipe,
3568
+ ReplaceTextPipe,
3569
+ FileSizePipe,
3570
+ //Validation
3571
+ FormValidationSummaryComponent,
3572
+ ItemValidationSummaryComponent] });
3573
+ AnatolyUIModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, imports: [CommonModule,
3574
+ ReactiveFormsModule,
3575
+ FormsModule,
3576
+ NgxCaptchaModule,
3577
+ FroalaEditorModuleWithProviders,
3578
+ FroalaViewModuleWithProviders] });
3579
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, decorators: [{
3580
+ type: NgModule,
3581
+ args: [{
3582
+ imports: [
3583
+ CommonModule,
3584
+ ReactiveFormsModule,
3585
+ FormsModule,
3586
+ NgxCaptchaModule,
3587
+ FroalaEditorModuleWithProviders,
3588
+ FroalaViewModuleWithProviders,
3589
+ ],
3590
+ exports: [
3591
+ SubscribePlanButtonComponent,
3592
+ UpgradePlanButtonComponent,
3593
+ BuyAccessButtonComponent,
3594
+ SignInButtonComponent,
3595
+ SignUpButtonComponent,
3596
+ SignOutButtonComponent,
3597
+ ContentHeaderComponent,
3598
+ SpinnerComponent,
3599
+ LoadingComponent,
3600
+ HtmlEditorComponent,
3601
+ FormsHtmlEditorComponent,
3602
+ //Directives
3603
+ NativeElementDirective,
3604
+ //Forms
3605
+ ContactUsForm,
3606
+ //Pipes
3607
+ SafeHtmlPipe,
3608
+ ReplaceTextPipe,
3609
+ FileSizePipe,
3610
+ //Validation
3611
+ FormValidationSummaryComponent,
3612
+ ItemValidationSummaryComponent,
3613
+ ],
3614
+ declarations: [
3615
+ SubscribePlanButtonComponent,
3616
+ UpgradePlanButtonComponent,
3617
+ BuyAccessButtonComponent,
3618
+ SignInButtonComponent,
3619
+ SignUpButtonComponent,
3620
+ SignOutButtonComponent,
3621
+ ContentHeaderComponent,
3622
+ SpinnerComponent,
3623
+ LoadingComponent,
3624
+ HtmlEditorComponent,
3625
+ FormsHtmlEditorComponent,
3626
+ //Directives
3627
+ NativeElementDirective,
3628
+ //Forms
3629
+ ContactUsForm,
3630
+ //Pipes
3631
+ SafeHtmlPipe,
3632
+ ReplaceTextPipe,
3633
+ FileSizePipe,
3634
+ //Validation
3635
+ FormValidationSummaryComponent,
3636
+ ItemValidationSummaryComponent,
3637
+ ]
3638
+ }]
3639
+ }] });
3640
+
3641
+ /*
3642
+ * Public API Surface of anatoly-lib
3643
+ */
3644
+
3645
+ /**
3646
+ * Generated bundle index. Do not edit.
3647
+ */
3648
+
3649
+ export { Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BillingApiService, BuyAccessButtonComponent, ContactUsForm, ContentHeaderComponent, ContextInitState, Convert, DefaultEditorOptions, DigitalMarketingService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, GoogleAnalyticsService, Guid, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NotificationService, NotificationsApiService, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, SpinnerComponent, Subs, SubscribePlanButtonComponent, TranslateModuleAtRoot, UpgradePlanButtonComponent, Urls, Utils, ValidationSummaryComponent, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
3650
+ //# sourceMappingURL=osovitny-anatoly.mjs.map