@osovitny/anatoly 3.20.16 → 3.20.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, Component, Output, Input, Inject, Pipe, NgModule, Directive, ChangeDetectionStrategy, ViewChild, ViewEncapsulation, HostListener, HostBinding, provideAppInitializer, inject, APP_INITIALIZER } from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Output, Input, Inject, Pipe, NgModule, Directive, ChangeDetectionStrategy, ViewChild, ViewEncapsulation, HostListener, HostBinding, APP_INITIALIZER, provideAppInitializer, inject } from '@angular/core';
3
3
  import { BehaviorSubject, forkJoin, Subject, filter, takeUntil, map as map$1, catchError, of, merge, timer, fromEvent, firstValueFrom, lastValueFrom } from 'rxjs';
4
4
  import { map, tap, mergeMap } from 'rxjs/operators';
5
5
  import * as i1 from '@angular/common/http';
6
- import { HttpResponse, HttpClient, provideHttpClient, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
6
+ import { HttpResponse, HttpClient, HTTP_INTERCEPTORS, HttpClientModule, provideHttpClient } from '@angular/common/http';
7
7
  import * as i1$1 from '@angular/common';
8
8
  import { DOCUMENT, CommonModule } from '@angular/common';
9
9
  import { format, formatDistance, formatDistanceToNow } from 'date-fns';
@@ -105,18 +105,17 @@ const AppContextStorageKeys = {
105
105
  </file>
106
106
  */
107
107
  //App
108
- //VadimOS: old approach
109
- /*
110
- export const AppCoreSettings = JSON.parse(
111
- ((document.getElementById('appCoreSettings')) as HTMLInputElement).getAttribute('data-appcoresettings')
112
- );
113
- */
114
108
  function getAppCoreSettings() {
115
109
  const json = sessionStorage.getItem(SessionStorageKeys.appCoreSettings);
116
110
  return json ? JSON.parse(json) : null;
117
111
  }
118
112
  function resetAppCoreSettings() {
119
113
  AppCoreSettings = getAppCoreSettings();
114
+ let isDevMode = `${AppCoreSettings?.isDevMode}`;
115
+ AppVersion = `${AppCoreSettings?.version}`;
116
+ IsDevMode = (isDevMode && (isDevMode == 'True' || isDevMode == 'true'));
117
+ IsProdMode = !IsDevMode;
118
+ ClientApps = AppCoreSettings?.clientApps;
120
119
  }
121
120
  function formatUrl(url) {
122
121
  let newUrl = url;
@@ -130,15 +129,14 @@ function formatUrl(url) {
130
129
  }
131
130
  return newUrl;
132
131
  }
133
- let AppCoreSettings = getAppCoreSettings();
134
- //WebApp
135
- let isDevMode = `${AppCoreSettings?.isDevMode}`;
136
- const AppVersion = `${AppCoreSettings?.version}`;
137
- const IsDevMode = (isDevMode && (isDevMode == 'True' || isDevMode == 'true'));
138
- const IsProdMode = !IsDevMode;
139
- const ClientApps = AppCoreSettings?.clientApps;
132
+ let AppCoreSettings;
133
+ let AppVersion;
134
+ let IsDevMode = true;
135
+ let IsProdMode = !IsDevMode;
136
+ let ClientApps;
140
137
  const AppName = g_AppName;
141
138
  const ApiUrl = g_ApiUrl;
139
+ resetAppCoreSettings();
142
140
 
143
141
  /*
144
142
  <file>
@@ -2558,6 +2556,7 @@ class LoadingService extends BehaviorSubject {
2558
2556
  Authors:
2559
2557
  Vadim Osovitny vadim.osovitny@osovitny.com
2560
2558
  Anatoly Osovitny anatoly.osovitny@osovitny.com
2559
+ Leon Malyan leon.malyan@osovitny.com
2561
2560
 
2562
2561
  Created:
2563
2562
  25 March 2020
@@ -10226,40 +10225,6 @@ class SafeHtmlPipe {
10226
10225
  </file>
10227
10226
  */
10228
10227
 
10229
- class AppService extends ApiServiceBase {
10230
- constructor(http) {
10231
- super(http);
10232
- this.http = http;
10233
- this.baseUrl = `${ApiUrl}/app`;
10234
- }
10235
- loadAppInitializerSettings() {
10236
- //Logging
10237
- let stopwatch = new Stopwatch("@osovitny/anatoly. AppService: loadAppInitializerSettings");
10238
- stopwatch.start();
10239
- return this.get('loadAppInitializerSettings').pipe(map$1(data => {
10240
- //Logging
10241
- stopwatch.stop();
10242
- stopwatch.printElapsedAsMilliseconds();
10243
- if (data) {
10244
- let appCoreSettings = JSON.stringify(data.core);
10245
- let appMSALSettings = JSON.stringify(data.msal);
10246
- appCoreSettings = appCoreSettings.replace(/--APPNAME--/g, g_AppName);
10247
- sessionStorage.setItem(SessionStorageKeys.appCoreSettings, appCoreSettings);
10248
- sessionStorage.setItem(SessionStorageKeys.appMSALSettings, appMSALSettings);
10249
- resetAppCoreSettings();
10250
- }
10251
- }));
10252
- }
10253
- static { this.ɵfac = function AppService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AppService)(i0.ɵɵinject(i1.HttpClient)); }; }
10254
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AppService, factory: AppService.ɵfac, providedIn: 'root' }); }
10255
- }
10256
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppService, [{
10257
- type: Injectable,
10258
- args: [{
10259
- providedIn: 'root'
10260
- }]
10261
- }], () => [{ type: i1.HttpClient }], null); })();
10262
-
10263
10228
  /*
10264
10229
  <file>
10265
10230
  Project:
@@ -10276,30 +10241,18 @@ class AppService extends ApiServiceBase {
10276
10241
  </file>
10277
10242
  */
10278
10243
  //Node
10279
- let InjectorInstance;
10244
+ let InjectorInstance$1;
10280
10245
  class AnatolyCoreModule {
10281
10246
  constructor(injector) {
10282
10247
  this.injector = injector;
10283
- InjectorInstance = this.injector;
10248
+ InjectorInstance$1 = this.injector;
10284
10249
  }
10285
10250
  static { this.ɵfac = function AnatolyCoreModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AnatolyCoreModule)(i0.ɵɵinject(i0.Injector)); }; }
10286
10251
  static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyCoreModule }); }
10287
10252
  static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
10288
- provideHttpClient(),
10289
- provideAppInitializer(() => {
10290
- const appService = inject(AppService);
10291
- return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
10292
- //Localization
10293
- const translate = InjectorInstance.get(TranslateService);
10294
- const localizationService = InjectorInstance.get(LocalizationService);
10295
- const lang = localizationService.configureSettings(translate);
10296
- translate.use(lang);
10297
- })));
10298
- }),
10299
10253
  //Guards
10300
10254
  StarterGuard,
10301
10255
  //Services
10302
- AppService,
10303
10256
  BrowserService,
10304
10257
  DigitalMarketingService,
10305
10258
  GoogleAnalyticsService,
@@ -10332,21 +10285,9 @@ class AnatolyCoreModule {
10332
10285
  LocalizationModule
10333
10286
  ],
10334
10287
  providers: [
10335
- provideHttpClient(),
10336
- provideAppInitializer(() => {
10337
- const appService = inject(AppService);
10338
- return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
10339
- //Localization
10340
- const translate = InjectorInstance.get(TranslateService);
10341
- const localizationService = InjectorInstance.get(LocalizationService);
10342
- const lang = localizationService.configureSettings(translate);
10343
- translate.use(lang);
10344
- })));
10345
- }),
10346
10288
  //Guards
10347
10289
  StarterGuard,
10348
10290
  //Services
10349
- AppService,
10350
10291
  BrowserService,
10351
10292
  DigitalMarketingService,
10352
10293
  GoogleAnalyticsService,
@@ -11283,6 +11224,40 @@ class AnatolyBillingModule {
11283
11224
  KendoModule,
11284
11225
  AnatolyUIModule], exports: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PaypalSubscribeButtonComponent, PayPalComponent, StripeDialog] }); })();
11285
11226
 
11227
+ class AppService extends ApiServiceBase {
11228
+ constructor(http) {
11229
+ super(http);
11230
+ this.http = http;
11231
+ this.baseUrl = `${ApiUrl}/app`;
11232
+ }
11233
+ loadAppInitializerSettings() {
11234
+ //Logging
11235
+ let stopwatch = new Stopwatch("@osovitny/anatoly. AppService: loadAppInitializerSettings");
11236
+ stopwatch.start();
11237
+ return this.get('loadAppInitializerSettings').pipe(map$1(data => {
11238
+ //Logging
11239
+ stopwatch.stop();
11240
+ stopwatch.printElapsedAsMilliseconds();
11241
+ if (data) {
11242
+ let appCoreSettings = JSON.stringify(data.core);
11243
+ let appMSALSettings = JSON.stringify(data.msal);
11244
+ appCoreSettings = appCoreSettings.replace(/--APPNAME--/g, g_AppName);
11245
+ sessionStorage.setItem(SessionStorageKeys.appCoreSettings, appCoreSettings);
11246
+ sessionStorage.setItem(SessionStorageKeys.appMSALSettings, appMSALSettings);
11247
+ resetAppCoreSettings();
11248
+ }
11249
+ }));
11250
+ }
11251
+ static { this.ɵfac = function AppService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AppService)(i0.ɵɵinject(i1.HttpClient)); }; }
11252
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AppService, factory: AppService.ɵfac, providedIn: 'root' }); }
11253
+ }
11254
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppService, [{
11255
+ type: Injectable,
11256
+ args: [{
11257
+ providedIn: 'root'
11258
+ }]
11259
+ }], () => [{ type: i1.HttpClient }], null); })();
11260
+
11286
11261
  /*
11287
11262
  <file>
11288
11263
  Project:
@@ -11298,10 +11273,28 @@ class AnatolyBillingModule {
11298
11273
  </file>
11299
11274
  */
11300
11275
  //Node
11276
+ let InjectorInstance;
11301
11277
  class AnatolyModule {
11302
- static { this.ɵfac = function AnatolyModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AnatolyModule)(); }; }
11278
+ constructor(injector) {
11279
+ this.injector = injector;
11280
+ InjectorInstance = this.injector;
11281
+ }
11282
+ static { this.ɵfac = function AnatolyModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AnatolyModule)(i0.ɵɵinject(i0.Injector)); }; }
11303
11283
  static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyModule }); }
11304
- static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
11284
+ static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
11285
+ provideHttpClient(),
11286
+ provideAppInitializer(() => {
11287
+ const appService = inject(AppService);
11288
+ return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
11289
+ //Localization
11290
+ const translate = InjectorInstance.get(TranslateService);
11291
+ const localizationService = InjectorInstance.get(LocalizationService);
11292
+ const lang = localizationService.configureSettings(translate);
11293
+ translate.use(lang);
11294
+ })));
11295
+ }),
11296
+ AppService
11297
+ ], imports: [CommonModule,
11305
11298
  AnatolyCoreModule,
11306
11299
  AnatolyDataModule,
11307
11300
  AnatolyIAMModule,
@@ -11325,9 +11318,23 @@ class AnatolyModule {
11325
11318
  AnatolyDataModule,
11326
11319
  AnatolyIAMModule,
11327
11320
  AnatolyUIModule
11321
+ ],
11322
+ providers: [
11323
+ provideHttpClient(),
11324
+ provideAppInitializer(() => {
11325
+ const appService = inject(AppService);
11326
+ return lastValueFrom(appService.loadAppInitializerSettings().pipe(map$1(() => {
11327
+ //Localization
11328
+ const translate = InjectorInstance.get(TranslateService);
11329
+ const localizationService = InjectorInstance.get(LocalizationService);
11330
+ const lang = localizationService.configureSettings(translate);
11331
+ translate.use(lang);
11332
+ })));
11333
+ }),
11334
+ AppService
11328
11335
  ]
11329
11336
  }]
11330
- }], null, null); })();
11337
+ }], () => [{ type: i0.Injector }], null); })();
11331
11338
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyModule, { imports: [CommonModule,
11332
11339
  AnatolyCoreModule,
11333
11340
  AnatolyDataModule,
@@ -11346,5 +11353,5 @@ class AnatolyModule {
11346
11353
  * Generated bundle index. Do not edit.
11347
11354
  */
11348
11355
 
11349
- export { AReplacerDirective, AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppSettings, AppVersion, AppsGoServiceBase, AuthService, AuthenticationGuard, BillingService, BillingUtils, BraintreeDialog, BrowserService, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, ClientApps, CompanyComponent, ComponentBase, ContactUsDialog, ContactUsForm, ControlPanelComponent, Convert, Copy2ClipboardComponent, CoreApiService, CountryDropdownlist, CurrenciesApiService, CurrenciesStorageService, DOM, DataPagerComponent, DataViewType, DateConvert, DefaultEditorOptions, DialogBase, DigitalMarketingService, DiscountCodeStatus, DiscountCodeType, EditComponentBase, EditPageBase, EmailsApiService, EnumEditComponentBase, FeatureWillBeReadyComponent, FileSizePipe, FormValidationSummaryComponent, GABillingEvents, GAEvents, GlobalErrorHandler, GoServiceBase, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, HtmlEditorComponentBase, IdleService, ImageReplacerDirective, InjectorInstance, IsDevMode, IsProdMode, ItemValidationSummaryComponent, L10nUtils, LanguageDropdownlist, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationModule, LocalizationService, LocalizePipe, LoggingService, MSALUtils, Mode, ModerationStatus, ModerationStatusDropdownlist, NativeElementDirective, NoMobileSupportComponent, NodataComponent, NotificationService, OrderSummaryComponent, PageBase, PageSpinnerComponent, PagedPageBase, PayPalComponent, PayPalScriptService, PaymentMethod, PaymentMethodsComponent, PaymentOptionsComponent, PaymentStage, PaymentType, PaymentsApiService, PaymentsService, PaypalButtonComponent, PaypalSubscribeButtonComponent, PromoCodesApiService, PublishStatus, PublishStatusDropdownlist, QSUtils, ReplaceTextPipe, SafeHtmlPipe, ScriptService, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, formatUrl, getAppCoreSettings, getAppSettingsById, getAppSettingsByName, getCurrentApp, getLocalizationInjector, initializeMsalFactory, is, resetAppCoreSettings, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
11356
+ export { AReplacerDirective, AddressComponent, AdminGuard, Alerts, AnatolyBillingModule, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppSettings, AppVersion, AppsGoServiceBase, AuthService, AuthenticationGuard, BillingService, BillingUtils, BraintreeDialog, BrowserService, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, ClientApps, CompanyComponent, ComponentBase, ContactUsDialog, ContactUsForm, ControlPanelComponent, Convert, Copy2ClipboardComponent, CoreApiService, CountryDropdownlist, CurrenciesApiService, CurrenciesStorageService, DOM, DataPagerComponent, DataViewType, DateConvert, DefaultEditorOptions, DialogBase, DigitalMarketingService, DiscountCodeStatus, DiscountCodeType, EditComponentBase, EditPageBase, EmailsApiService, EnumEditComponentBase, FeatureWillBeReadyComponent, FileSizePipe, FormValidationSummaryComponent, GABillingEvents, GAEvents, GlobalErrorHandler, GoServiceBase, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, HtmlEditorComponentBase, IdleService, ImageReplacerDirective, InjectorInstance$1 as InjectorInstance, IsDevMode, IsProdMode, ItemValidationSummaryComponent, L10nUtils, LanguageDropdownlist, ListBase, LoadingComponent, LoadingService, LocalStorageService, LocalizationModule, LocalizationService, LocalizePipe, LoggingService, MSALUtils, Mode, ModerationStatus, ModerationStatusDropdownlist, NativeElementDirective, NoMobileSupportComponent, NodataComponent, NotificationService, OrderSummaryComponent, PageBase, PageSpinnerComponent, PagedPageBase, PayPalComponent, PayPalScriptService, PaymentMethod, PaymentMethodsComponent, PaymentOptionsComponent, PaymentStage, PaymentType, PaymentsApiService, PaymentsService, PaypalButtonComponent, PaypalSubscribeButtonComponent, PromoCodesApiService, PublishStatus, PublishStatusDropdownlist, QSUtils, ReplaceTextPipe, SafeHtmlPipe, ScriptService, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterGuard, StarterService, Stopwatch, StripeDialog, Subs, SubscribePlanButtonComponent, SubscriptionProvider, SubscriptionsApiService, TimezoneDropdownlist, TransactionsApiService, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, YouAgreeToOurTermsComponent, dateFormats, dateTimeFormats, formatUrl, getAppCoreSettings, getAppSettingsById, getAppSettingsByName, getCurrentApp, getLocalizationInjector, initializeMsalFactory, is, resetAppCoreSettings, throwIfAlreadyLoaded, timeFormats, translateLoaderFactory };
11350
11357
  //# sourceMappingURL=osovitny-anatoly.mjs.map