@eui/core 19.0.0-next.8 → 19.0.0-rc.1

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 (114) hide show
  1. package/docs/classes/ActivatedRouteAction.html +10 -2
  2. package/docs/classes/AddApiQueueItemAction.html +10 -2
  3. package/docs/classes/AddAppLoadedConfigModulesAction.html +10 -2
  4. package/docs/classes/ApiQueueServiceMock.html +27 -3
  5. package/docs/classes/EmptyApiQueueAction.html +10 -2
  6. package/docs/classes/InitStoreAction.html +10 -2
  7. package/docs/classes/RemoveApiQueueItemAction.html +10 -2
  8. package/docs/classes/UpdateAppConnectionAction.html +10 -2
  9. package/docs/classes/UpdateAppStatusAction.html +10 -2
  10. package/docs/classes/UpdateAppVersionAction.html +10 -2
  11. package/docs/classes/UpdateCurrentModuleAction.html +10 -2
  12. package/docs/classes/UpdateI18nStateAction.html +10 -2
  13. package/docs/classes/UpdateLocaleStateAction.html +10 -2
  14. package/docs/classes/UpdateNotificationsListAction.html +10 -2
  15. package/docs/classes/UpdateUserDashboardAction.html +10 -2
  16. package/docs/classes/UpdateUserDetailsAction.html +10 -2
  17. package/docs/classes/UpdateUserPreferencesAction.html +10 -2
  18. package/docs/classes/UpdateUserRightsAction.html +10 -2
  19. package/docs/classes/UpdateUserStateAction.html +10 -2
  20. package/docs/dependencies.html +32 -52
  21. package/docs/index.html +2 -2
  22. package/docs/injectables/ApiQueueService.html +18 -2
  23. package/docs/injectables/EuiAppShellService.html +9 -1
  24. package/docs/injectables/GlobalErrorHandler.html +1 -1
  25. package/docs/injectables/I18nService.html +193 -17
  26. package/docs/injectables/I18nServiceMock.html +37 -1
  27. package/docs/injectables/LocaleService.html +119 -44
  28. package/docs/injectables/LocaleServiceMock.html +8 -41
  29. package/docs/injectables/StoreService.html +273 -65
  30. package/docs/injectables/StoreServiceMock.html +8 -30
  31. package/docs/injectables/UserService.html +97 -21
  32. package/docs/injectables/UserServiceMock.html +36 -0
  33. package/docs/interceptors/AddLangParamInterceptor.html +2 -2
  34. package/docs/interceptors/CachePreventionInterceptor.html +2 -2
  35. package/docs/interceptors/CorsSecurityInterceptor.html +2 -2
  36. package/docs/interceptors/CsrfPreventionInterceptor.html +2 -2
  37. package/docs/interceptors/EuLoginSessionTimeoutHandlingInterceptor.html +2 -2
  38. package/docs/interceptors/HttpErrorHandlerInterceptor.html +4 -4
  39. package/docs/interceptors/UxRequestErrorModelInterceptor.html +4 -4
  40. package/docs/interfaces/Action.html +270 -0
  41. package/docs/interfaces/ActionReducer.html +269 -0
  42. package/docs/interfaces/MemoizedSelector.html +407 -0
  43. package/docs/interfaces/MemoizedSelectorWithProps.html +414 -0
  44. package/docs/interfaces/TranslationKeys.html +223 -0
  45. package/docs/js/menu-wc.js +33 -21
  46. package/docs/js/menu-wc_es5.js +1 -1
  47. package/docs/js/search/search_index.js +2 -2
  48. package/docs/miscellaneous/enumerations.html +35 -10
  49. package/docs/miscellaneous/functions.html +937 -60
  50. package/docs/miscellaneous/typealiases.html +232 -13
  51. package/docs/miscellaneous/variables.html +283 -163
  52. package/fesm2022/eui-core.mjs +666 -487
  53. package/fesm2022/eui-core.mjs.map +1 -1
  54. package/lib/eui-core.module.d.ts.map +1 -1
  55. package/lib/services/app/eui-init-app.d.ts +10 -1
  56. package/lib/services/app/eui-init-app.d.ts.map +1 -1
  57. package/lib/services/app/eui-pre-init-app.d.ts.map +1 -1
  58. package/lib/services/app/eui-startup.d.ts.map +1 -1
  59. package/lib/services/app/index.d.ts +1 -0
  60. package/lib/services/app/index.d.ts.map +1 -1
  61. package/lib/services/config/defaults.d.ts.map +1 -1
  62. package/lib/services/eui-app-shell.service.d.ts +1 -1
  63. package/lib/services/eui-app-shell.service.d.ts.map +1 -1
  64. package/lib/services/i18n/i18n.loader.d.ts +10 -1
  65. package/lib/services/i18n/i18n.loader.d.ts.map +1 -1
  66. package/lib/services/i18n/i18n.service.d.ts +32 -8
  67. package/lib/services/i18n/i18n.service.d.ts.map +1 -1
  68. package/lib/services/locale/locale.service.d.ts +18 -32
  69. package/lib/services/locale/locale.service.d.ts.map +1 -1
  70. package/lib/services/locale/locale.service.mock.d.ts +1 -1
  71. package/lib/services/locale/locale.service.mock.d.ts.map +1 -1
  72. package/lib/services/permission/permission.service.d.ts.map +1 -1
  73. package/lib/services/queue/api-queue.service.d.ts +18 -3
  74. package/lib/services/queue/api-queue.service.d.ts.map +1 -1
  75. package/lib/services/queue/api-queue.service.mock.d.ts +2 -2
  76. package/lib/services/queue/api-queue.service.mock.d.ts.map +1 -1
  77. package/lib/services/store/actions/app.actions.d.ts +37 -1
  78. package/lib/services/store/actions/app.actions.d.ts.map +1 -1
  79. package/lib/services/store/actions/i18n.actions.d.ts +10 -1
  80. package/lib/services/store/actions/i18n.actions.d.ts.map +1 -1
  81. package/lib/services/store/actions/locale.actions.d.ts +10 -1
  82. package/lib/services/store/actions/locale.actions.d.ts.map +1 -1
  83. package/lib/services/store/actions/notifications.actions.d.ts +10 -1
  84. package/lib/services/store/actions/notifications.actions.d.ts.map +1 -1
  85. package/lib/services/store/actions/user.actions.d.ts +22 -1
  86. package/lib/services/store/actions/user.actions.d.ts.map +1 -1
  87. package/lib/services/store/index.d.ts +0 -1
  88. package/lib/services/store/index.d.ts.map +1 -1
  89. package/lib/services/store/ngrx_kit.d.ts +54 -0
  90. package/lib/services/store/ngrx_kit.d.ts.map +1 -0
  91. package/lib/services/store/reducers/app.reducers.d.ts +4 -1
  92. package/lib/services/store/reducers/app.reducers.d.ts.map +1 -1
  93. package/lib/services/store/reducers/core.reducers.d.ts +4 -1
  94. package/lib/services/store/reducers/core.reducers.d.ts.map +1 -1
  95. package/lib/services/store/reducers/i18n.reducers.d.ts +4 -1
  96. package/lib/services/store/reducers/i18n.reducers.d.ts.map +1 -1
  97. package/lib/services/store/reducers/locale.reducers.d.ts +4 -1
  98. package/lib/services/store/reducers/locale.reducers.d.ts.map +1 -1
  99. package/lib/services/store/reducers/meta.reducers.d.ts +5 -1
  100. package/lib/services/store/reducers/meta.reducers.d.ts.map +1 -1
  101. package/lib/services/store/reducers/notifications.reducers.d.ts +4 -1
  102. package/lib/services/store/reducers/notifications.reducers.d.ts.map +1 -1
  103. package/lib/services/store/reducers/user.reducers.d.ts +4 -1
  104. package/lib/services/store/reducers/user.reducers.d.ts.map +1 -1
  105. package/lib/services/store/store.service.d.ts +40 -12
  106. package/lib/services/store/store.service.d.ts.map +1 -1
  107. package/lib/services/user/user.service.d.ts +32 -6
  108. package/lib/services/user/user.service.d.ts.map +1 -1
  109. package/package.json +2 -2
  110. package/docs/injectables/CoreAppEffects.html +0 -468
  111. package/lib/services/store/effects/app.effects.d.ts +0 -21
  112. package/lib/services/store/effects/app.effects.d.ts.map +0 -1
  113. package/lib/services/store/effects/index.d.ts +0 -4
  114. package/lib/services/store/effects/index.d.ts.map +0 -1
@@ -1,32 +1,32 @@
1
1
  import * as i1 from '@eui/base';
2
- import { ConsoleAppender, LogLevel, initialAppState, initialUserState, initialNotificationsState, initialI18nState, initialLocaleState, Logger, LoggerMock, xhr, getApiQueue, getApiQueueItem, mergeAll, getI18nLoaderConfig, EuiLazyService, getI18nServiceConfigFromBase, getI18nState, getLastAddedModule, getBrowserDefaultLanguage, EuiEuLanguages, getActiveLang, EuiService, getUserRights, getUserState, getLocaleServiceConfigFromBase, getLocaleState, transformToUxHttpResponse } from '@eui/base';
2
+ import { LogLevel, ConsoleAppender, initialAppState, initialUserState, initialNotificationsState, initialI18nState, initialLocaleState, Logger, LoggerMock, initialCoreState, xhr, mergeAll, getI18nLoaderConfig, EuiLazyService, getI18nServiceConfigFromBase, getBrowserDefaultLanguage, EuiEuLanguages, EuiService, getUserState, getLocaleServiceConfigFromBase, transformToUxHttpResponse } from '@eui/base';
3
3
  export * from '@eui/base';
4
4
  import * as i0 from '@angular/core';
5
- import { InjectionToken, Injectable, PLATFORM_ID, Inject, inject, Injector, NgModule, Optional, APP_INITIALIZER, SkipSelf, ErrorHandler, LOCALE_ID } from '@angular/core';
5
+ import { InjectionToken, inject, PLATFORM_ID, Injectable, Inject, Injector, NgModule, signal, computed, runInInjectionContext, Optional, SkipSelf, provideAppInitializer, ErrorHandler, LOCALE_ID } from '@angular/core';
6
6
  import * as extendProxy from 'extend';
7
- import * as i1$1 from '@ngrx/effects';
8
- import { createEffect, ofType } from '@ngrx/effects';
9
- import { merge, fromEvent, of, throwError, forkJoin, from, BehaviorSubject, defer, firstValueFrom, Subject } from 'rxjs';
10
- import { map, mergeMap, tap, debounceTime, distinctUntilChanged, take, switchMap, catchError, concatMap, filter, takeUntil } from 'rxjs/operators';
11
7
  import { isPlatformBrowser, LOCATION_INITIALIZED, DOCUMENT, isPlatformServer, getLocaleId, registerLocaleData } from '@angular/common';
12
- import * as i1$2 from '@ngx-translate/core';
13
- import { TranslateLoader } from '@ngx-translate/core';
14
- import * as i1$3 from '@ngrx/store';
15
- import { createSelector } from '@ngrx/store';
16
- import { MAT_DATE_LOCALE, DateAdapter } from '@angular/material/core';
8
+ import { filter, debounceTime, distinctUntilChanged, tap, take, map, switchMap, catchError, concatMap, takeUntil } from 'rxjs/operators';
9
+ import { toObservable } from '@angular/core/rxjs-interop';
10
+ import { isEqual } from 'lodash';
11
+ import { of, forkJoin, from, Subject, BehaviorSubject, defer, firstValueFrom } from 'rxjs';
12
+ import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
17
13
  import { MomentDateAdapter } from '@angular/material-moment-adapter';
18
- import * as i1$5 from '@angular/common/http';
14
+ import * as i1$2 from '@angular/common/http';
19
15
  import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
20
- import * as i1$4 from '@angular/router';
16
+ import * as i1$1 from '@angular/router';
21
17
  import { NavigationEnd } from '@angular/router';
18
+ import { createSelector } from 'reselect';
19
+ import * as i1$3 from '@ngx-translate/core';
20
+ import { TranslateLoader } from '@ngx-translate/core';
22
21
  import { By } from '@angular/platform-browser';
23
22
  import { FormGroup, FormArray } from '@angular/forms';
24
23
  import { DomPortalOutlet, ComponentPortal, PortalInjector } from '@angular/cdk/portal';
25
- import isEqual from 'lodash-es/isEqual';
24
+ import isEqual$1 from 'lodash-es/isEqual';
26
25
  import get from 'lodash-es/get';
27
26
  import * as lf from 'localforage';
28
27
  import localeFr from '@angular/common/locales/fr';
29
28
  import localeEl from '@angular/common/locales/el';
29
+ import { of as of$1 } from 'rxjs/internal/observable/of';
30
30
 
31
31
  /** default log configuration */
32
32
  const DEFAULT_LOG_CONFIG = {
@@ -43,10 +43,7 @@ const DEFAULT_I18N_SERVICE_CONFIG = {
43
43
  };
44
44
  const DEFAULT_I18N_LOADER_CONFIG = {};
45
45
  const DEFAULT_LOCALE_SERVICE_CONFIG = {
46
- available: ['en'],
47
- registered: ['en'],
48
46
  bindWithTranslate: false,
49
- affectGlobalLocale: false,
50
47
  };
51
48
  const DEFAULT_HTTP_ERROR_HANDLER_CONFIG = {
52
49
  routes: [],
@@ -161,6 +158,9 @@ function mergeAppJsonConfigToAppConfig(euiAppConfig, envAppJsonConfig, merge, is
161
158
  return Object.assign({}, euiAppConfig, envAppJsonConfig, deepMerged);
162
159
  }
163
160
 
161
+ /**
162
+ * @deprecated it will be removed in the next major version
163
+ */
164
164
  var CoreAppActionTypes;
165
165
  (function (CoreAppActionTypes) {
166
166
  CoreAppActionTypes["INIT_STORE"] = "[App] Init store";
@@ -174,60 +174,90 @@ var CoreAppActionTypes;
174
174
  CoreAppActionTypes["REMOVE_API_QUEUE_ITEM"] = "[App] Remove API queue item";
175
175
  CoreAppActionTypes["EMPTY_API_QUEUE"] = "[App] empty API queue";
176
176
  })(CoreAppActionTypes || (CoreAppActionTypes = {}));
177
+ /**
178
+ * @deprecated it will be removed in the next major version
179
+ */
177
180
  class InitStoreAction {
178
181
  constructor(payload) {
179
182
  this.payload = payload;
180
183
  this.type = CoreAppActionTypes.INIT_STORE;
181
184
  }
182
185
  }
186
+ /**
187
+ * @deprecated it will be removed in the next major version
188
+ */
183
189
  class UpdateAppVersionAction {
184
190
  constructor(payload) {
185
191
  this.payload = payload;
186
192
  this.type = CoreAppActionTypes.UPDATE_APP_VERSION;
187
193
  }
188
194
  }
195
+ /**
196
+ * @deprecated it will be removed in the next major version
197
+ */
189
198
  class UpdateAppConnectionAction {
190
199
  constructor(payload) {
191
200
  this.payload = payload;
192
201
  this.type = CoreAppActionTypes.UPDATE_APP_CONNECTION;
193
202
  }
194
203
  }
204
+ /**
205
+ * @deprecated it will be removed in the next major version
206
+ */
195
207
  class AddAppLoadedConfigModulesAction {
196
208
  constructor(payload) {
197
209
  this.payload = payload;
198
210
  this.type = CoreAppActionTypes.ADD_APP_LOADED_CONFIG_MODULES;
199
211
  }
200
212
  }
213
+ /**
214
+ * @deprecated it will be removed in the next major version
215
+ */
201
216
  class UpdateAppStatusAction {
202
217
  constructor(payload) {
203
218
  this.payload = payload;
204
219
  this.type = CoreAppActionTypes.UPDATE_APP_STATUS;
205
220
  }
206
221
  }
222
+ /**
223
+ * @deprecated it will be removed in the next major version
224
+ */
207
225
  class UpdateCurrentModuleAction {
208
226
  constructor(payload) {
209
227
  this.payload = payload;
210
228
  this.type = CoreAppActionTypes.UPDATE_CURRENT_MODULE;
211
229
  }
212
230
  }
231
+ /**
232
+ * @deprecated it will be removed in the next major version
233
+ */
213
234
  class ActivatedRouteAction {
214
235
  constructor(payload) {
215
236
  this.payload = payload;
216
237
  this.type = CoreAppActionTypes.ACTIVATED_ROUTE;
217
238
  }
218
239
  }
240
+ /**
241
+ * @deprecated it will be removed in the next major version
242
+ */
219
243
  class AddApiQueueItemAction {
220
244
  constructor(payload) {
221
245
  this.payload = payload;
222
246
  this.type = CoreAppActionTypes.ADD_API_QUEUE_ITEM;
223
247
  }
224
248
  }
249
+ /**
250
+ * @deprecated it will be removed in the next major version
251
+ */
225
252
  class RemoveApiQueueItemAction {
226
253
  constructor(payload) {
227
254
  this.payload = payload;
228
255
  this.type = CoreAppActionTypes.REMOVE_API_QUEUE_ITEM;
229
256
  }
230
257
  }
258
+ /**
259
+ * @deprecated it will be removed in the next major version
260
+ */
231
261
  class EmptyApiQueueAction {
232
262
  // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
233
263
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -237,10 +267,16 @@ class EmptyApiQueueAction {
237
267
  }
238
268
  }
239
269
 
270
+ /**
271
+ * @deprecated it will be removed in the next major version
272
+ */
240
273
  var CoreI18nActionTypes;
241
274
  (function (CoreI18nActionTypes) {
242
275
  CoreI18nActionTypes["UPDATE_I18N_STATE"] = "[I18n] Update I18n State";
243
276
  })(CoreI18nActionTypes || (CoreI18nActionTypes = {}));
277
+ /**
278
+ * @deprecated it will be removed in the next major version
279
+ */
244
280
  class UpdateI18nStateAction {
245
281
  constructor(payload) {
246
282
  this.payload = payload;
@@ -248,6 +284,9 @@ class UpdateI18nStateAction {
248
284
  }
249
285
  }
250
286
 
287
+ /**
288
+ * @deprecated it will be removed in the next major version
289
+ */
251
290
  var CoreUserActionTypes;
252
291
  (function (CoreUserActionTypes) {
253
292
  CoreUserActionTypes["UPDATE_USER_STATE"] = "[User] Update User state";
@@ -256,30 +295,45 @@ var CoreUserActionTypes;
256
295
  CoreUserActionTypes["UPDATE_USER_RIGHTS"] = "[User] Update rights";
257
296
  CoreUserActionTypes["UPDATE_USER_DASHBOARD"] = "[User] Update dashboard";
258
297
  })(CoreUserActionTypes || (CoreUserActionTypes = {}));
298
+ /**
299
+ * @deprecated it will be removed in the next major version
300
+ */
259
301
  class UpdateUserStateAction {
260
302
  constructor(payload) {
261
303
  this.payload = payload;
262
304
  this.type = CoreUserActionTypes.UPDATE_USER_STATE;
263
305
  }
264
306
  }
307
+ /**
308
+ * @deprecated it will be removed in the next major version
309
+ */
265
310
  class UpdateUserDetailsAction {
266
311
  constructor(payload) {
267
312
  this.payload = payload;
268
313
  this.type = CoreUserActionTypes.UPDATE_USER_DETAILS;
269
314
  }
270
315
  }
316
+ /**
317
+ * @deprecated it will be removed in the next major version
318
+ */
271
319
  class UpdateUserPreferencesAction {
272
320
  constructor(payload) {
273
321
  this.payload = payload;
274
322
  this.type = CoreUserActionTypes.UPDATE_USER_PREFERENCES;
275
323
  }
276
324
  }
325
+ /**
326
+ * @deprecated it will be removed in the next major version
327
+ */
277
328
  class UpdateUserRightsAction {
278
329
  constructor(payload) {
279
330
  this.payload = payload;
280
331
  this.type = CoreUserActionTypes.UPDATE_USER_RIGHTS;
281
332
  }
282
333
  }
334
+ /**
335
+ * @deprecated it will be removed in the next major version
336
+ */
283
337
  class UpdateUserDashboardAction {
284
338
  constructor(payload) {
285
339
  this.payload = payload;
@@ -287,10 +341,16 @@ class UpdateUserDashboardAction {
287
341
  }
288
342
  }
289
343
 
344
+ /**
345
+ * @deprecated it will be removed in the next major version
346
+ */
290
347
  var CoreNotificationsActionTypes;
291
348
  (function (CoreNotificationsActionTypes) {
292
349
  CoreNotificationsActionTypes["UPDATE_NOTIFICATIONS_LIST"] = "[Notif] Update list";
293
350
  })(CoreNotificationsActionTypes || (CoreNotificationsActionTypes = {}));
351
+ /**
352
+ * @deprecated it will be removed in the next major version
353
+ */
294
354
  class UpdateNotificationsListAction {
295
355
  // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
296
356
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -300,10 +360,16 @@ class UpdateNotificationsListAction {
300
360
  }
301
361
  }
302
362
 
363
+ /**
364
+ * @deprecated it will be removed in the next major version
365
+ */
303
366
  var CoreLocaleActionTypes;
304
367
  (function (CoreLocaleActionTypes) {
305
368
  CoreLocaleActionTypes["UPDATE_LOCALE_STATE"] = "[Locale] Update Locale State";
306
369
  })(CoreLocaleActionTypes || (CoreLocaleActionTypes = {}));
370
+ /**
371
+ * @deprecated it will be removed in the next major version
372
+ */
307
373
  class UpdateLocaleStateAction {
308
374
  constructor(payload) {
309
375
  this.payload = payload;
@@ -311,150 +377,8 @@ class UpdateLocaleStateAction {
311
377
  }
312
378
  }
313
379
 
314
- class EuiGrowlService {
315
- constructor() {
316
- this.growlMessages = [];
317
- this.isGrowlSticky = false;
318
- this.isCloseAllSticky = false;
319
- this.growlLife = 3000;
320
- this.growlPosition = 'bottom-right';
321
- this.growlCallback = null;
322
- }
323
- /**
324
- * displays a growl UxMessage item, isSticky
325
- */
326
- growl(msg, isSticky, isMultiple, life, position, callback) {
327
- if (msg.severity !== 'info' && msg.severity !== 'warning' && msg.severity !== 'success' && msg.severity !== 'danger') {
328
- throw new Error('EuiGrowlService.growl() ERROR : message severity must be either : success, warning, info, danger');
329
- }
330
- else {
331
- if (isMultiple === undefined || !isMultiple) {
332
- this.growlMessages = [];
333
- }
334
- this.growlMessages = this.growlMessages.concat(msg);
335
- msg.life = life || msg.life;
336
- msg.sticky = isSticky || msg.sticky;
337
- if (life === undefined || isNaN(life)) {
338
- if (msg.severity === 'danger') {
339
- isSticky = true;
340
- }
341
- else {
342
- this.growlLife = 3000;
343
- }
344
- }
345
- else {
346
- this.growlLife = life;
347
- }
348
- if (isSticky) {
349
- this.isGrowlSticky = isSticky;
350
- }
351
- else {
352
- this.isGrowlSticky = false;
353
- }
354
- if (position) {
355
- this.growlPosition = position;
356
- }
357
- if (callback) {
358
- this.growlCallback = callback;
359
- }
360
- }
361
- }
362
- clearGrowl() {
363
- this.growlMessages = [];
364
- }
365
- growlSuccess(msg, position) {
366
- this.growl({ severity: 'success', summary: 'SUCCESS', detail: msg }, false, false, undefined, position);
367
- }
368
- growlError(msg, position) {
369
- this.growl({ severity: 'danger', summary: 'ERROR', detail: msg }, false, false, undefined, position);
370
- }
371
- growlWarning(msg, position) {
372
- this.growl({ severity: 'warning', summary: 'WARNING', detail: msg }, false, false, undefined, position);
373
- }
374
- growlInfo(msg, position) {
375
- this.growl({ severity: 'info', summary: 'INFO', detail: msg }, false, false, undefined, position);
376
- }
377
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiGrowlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
378
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiGrowlService, providedIn: 'root' }); }
379
- }
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiGrowlService, decorators: [{
381
- type: Injectable,
382
- args: [{
383
- providedIn: 'root',
384
- }]
385
- }] });
386
-
387
- class CoreAppEffects {
388
- constructor(actions,
389
- // TODO: remove on eUI 14
390
- showConnectionStatus, translateService, asService, platformId) {
391
- this.actions = actions;
392
- this.showConnectionStatus = showConnectionStatus;
393
- this.translateService = translateService;
394
- this.asService = asService;
395
- this.platformId = platformId;
396
- this.getAppConnectionInformation = createEffect(() => {
397
- if (isPlatformBrowser(this.platformId)) {
398
- return merge(fromEvent(window, 'online').pipe(map(() => true)), fromEvent(window, 'offline').pipe(map(() => false))).pipe(map((connected) => new UpdateAppConnectionAction(connected)));
399
- }
400
- else {
401
- return of(new UpdateAppConnectionAction(false));
402
- }
403
- });
404
- this.activatedRoute = createEffect(() => this.actions.pipe(ofType(CoreAppActionTypes.ACTIVATED_ROUTE), map((action) => action.payload), mergeMap((route) => {
405
- // extract the module name, if defined
406
- const module = route.snapshot.data['module'] || 'undefined';
407
- return [new UpdateCurrentModuleAction(module)];
408
- })));
409
- this.updateAppConnection = createEffect(() => this.actions.pipe(ofType(CoreAppActionTypes.UPDATE_APP_CONNECTION), map((action) => action.payload), tap((connected) => {
410
- // check if feature is enabled
411
- const isFeatureEnabled = this.showConnectionStatus?.enabled;
412
- // extract lifespan if any
413
- const lifespan = this.showConnectionStatus?.messageBox?.lifespan || 0;
414
- // if the user needs to be informed about the connection status
415
- if (isFeatureEnabled) {
416
- if (connected) {
417
- this.translateService.get('eui.CONNECTED').subscribe((translation) => {
418
- this.asService.growl({ severity: 'success', summary: 'MESSAGE', detail: translation, life: lifespan }, lifespan < 1, false);
419
- });
420
- }
421
- else {
422
- this.translateService.get('eui.NOTCONNECTED').subscribe((translation) => {
423
- this.asService.growl({ severity: 'danger', summary: 'ERROR', detail: translation, life: lifespan }, lifespan < 1, false);
424
- });
425
- }
426
- }
427
- })), { dispatch: false });
428
- }
429
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CoreAppEffects, deps: [{ token: i1$1.Actions }, { token: SHOW_CONNECTION_STATUS_TOKEN }, { token: i1$2.TranslateService }, { token: EuiGrowlService }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
430
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CoreAppEffects }); }
431
- }
432
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CoreAppEffects, decorators: [{
433
- type: Injectable
434
- }], ctorParameters: () => [{ type: i1$1.Actions }, { type: undefined, decorators: [{
435
- type: Inject,
436
- args: [SHOW_CONNECTION_STATUS_TOKEN]
437
- }] }, { type: i1$2.TranslateService }, { type: EuiGrowlService }, { type: undefined, decorators: [{
438
- type: Inject,
439
- args: [PLATFORM_ID]
440
- }] }] });
441
-
442
- const CoreModuleEffects = [CoreAppEffects];
443
-
444
380
  const updateAppVersion = (state, action) => ({ ...state, version: action.payload });
445
381
  const updateAppConnection = (state, action) => ({ ...state, connected: action.payload });
446
- const AddAppLoadedConfigModules = (state, action) => ({
447
- ...state,
448
- loadedConfigModules: {
449
- lastAddedModule: action.payload.moduleName,
450
- modulesConfig: {
451
- ...state.loadedConfigModules.modulesConfig,
452
- [action.payload.moduleName]: {
453
- ...action.payload.moduleConfig,
454
- },
455
- },
456
- },
457
- });
458
382
  const updateAppStatus = (state, action) => ({ ...state, status: action.payload });
459
383
  const updateCurrentModule = (state, action) => Object.assign({}, state, { currentModule: action.payload });
460
384
  const addApiQueueItem = (state, action) => {
@@ -480,13 +404,15 @@ Object.assign({}, state, { apiQueue: {} });
480
404
  const actionToReducerMap$4 = {
481
405
  [CoreAppActionTypes.UPDATE_APP_VERSION]: updateAppVersion,
482
406
  [CoreAppActionTypes.UPDATE_APP_CONNECTION]: updateAppConnection,
483
- [CoreAppActionTypes.ADD_APP_LOADED_CONFIG_MODULES]: AddAppLoadedConfigModules,
484
407
  [CoreAppActionTypes.UPDATE_APP_STATUS]: updateAppStatus,
485
408
  [CoreAppActionTypes.UPDATE_CURRENT_MODULE]: updateCurrentModule,
486
409
  [CoreAppActionTypes.ADD_API_QUEUE_ITEM]: addApiQueueItem,
487
410
  [CoreAppActionTypes.REMOVE_API_QUEUE_ITEM]: removeApiQueueItem,
488
411
  [CoreAppActionTypes.EMPTY_API_QUEUE]: emptyApiQueue,
489
412
  };
413
+ /**
414
+ * @deprecated it will be removed in the next major version
415
+ */
490
416
  const coreAppReducers = (state = initialAppState, action) => {
491
417
  if (actionToReducerMap$4[action.type]) {
492
418
  return actionToReducerMap$4[action.type](state, action);
@@ -529,6 +455,9 @@ const actionToReducerMap$3 = {
529
455
  [CoreUserActionTypes.UPDATE_USER_RIGHTS]: updateUserRights,
530
456
  [CoreUserActionTypes.UPDATE_USER_DASHBOARD]: updateUserDashboard,
531
457
  };
458
+ /**
459
+ * @deprecated it will be removed in the next major version
460
+ */
532
461
  const coreUserReducers = (state = initialUserState, action) => {
533
462
  if (actionToReducerMap$3[action.type]) {
534
463
  return actionToReducerMap$3[action.type](state, action);
@@ -540,6 +469,9 @@ const updateNotificationsList = (state, action) => Object.assign({}, state, { li
540
469
  const actionToReducerMap$2 = {
541
470
  [CoreNotificationsActionTypes.UPDATE_NOTIFICATIONS_LIST]: updateNotificationsList,
542
471
  };
472
+ /**
473
+ * @deprecated it will be removed in the next major version
474
+ */
543
475
  const coreNotificationsReducers = (state = initialNotificationsState, action) => {
544
476
  if (actionToReducerMap$2[action.type]) {
545
477
  return actionToReducerMap$2[action.type](state, action);
@@ -547,13 +479,22 @@ const coreNotificationsReducers = (state = initialNotificationsState, action) =>
547
479
  return state;
548
480
  };
549
481
 
482
+ /**
483
+ * @deprecated it will be removed in the next major version
484
+ */
550
485
  const updateI18nState = (state, action) => ({
551
486
  ...state,
552
487
  ...action.payload,
553
488
  });
489
+ /**
490
+ * @deprecated it will be removed in the next major version
491
+ */
554
492
  const actionToReducerMap$1 = {
555
493
  [CoreI18nActionTypes.UPDATE_I18N_STATE]: updateI18nState,
556
494
  };
495
+ /**
496
+ * @deprecated it will be removed in the next major version
497
+ */
557
498
  const corI18nReducers = (state = initialI18nState, action) => {
558
499
  if (actionToReducerMap$1[action.type]) {
559
500
  return actionToReducerMap$1[action.type](state, action);
@@ -561,13 +502,22 @@ const corI18nReducers = (state = initialI18nState, action) => {
561
502
  return state;
562
503
  };
563
504
 
505
+ /**
506
+ * @deprecated it will be removed in the next major version
507
+ */
564
508
  const updateLocaleState = (state, action) => ({
565
509
  ...state,
566
510
  ...action.payload,
567
511
  });
512
+ /**
513
+ * @deprecated it will be removed in the next major version
514
+ */
568
515
  const actionToReducerMap = {
569
516
  [CoreLocaleActionTypes.UPDATE_LOCALE_STATE]: updateLocaleState,
570
517
  };
518
+ /**
519
+ * @deprecated it will be removed in the next major version
520
+ */
571
521
  const coreLocaleReducers = (state = initialLocaleState, action) => {
572
522
  if (actionToReducerMap[action.type]) {
573
523
  return actionToReducerMap[action.type](state, action);
@@ -575,6 +525,9 @@ const coreLocaleReducers = (state = initialLocaleState, action) => {
575
525
  return state;
576
526
  };
577
527
 
528
+ /**
529
+ * @deprecated it will be removed in the next major version
530
+ */
578
531
  // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
579
532
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
580
533
  const coreReducers = Object.assign({}, {
@@ -586,6 +539,7 @@ const coreReducers = Object.assign({}, {
586
539
  });
587
540
 
588
541
  const extend = extendProxy.default || extendProxy;
542
+ // eslint-disable-next-line
589
543
  function localStorageSync(reducer, platformId) {
590
544
  if (platformId) {
591
545
  return (reducer) => {
@@ -597,6 +551,7 @@ function localStorageSync(reducer, platformId) {
597
551
  return cb(reducer, isPlatformBrowser(platformId) ? localStorage : null);
598
552
  }
599
553
  }
554
+ // eslint-disable-next-line
600
555
  function sessionStorageSync(reducer, platformId) {
601
556
  if (platformId) {
602
557
  return (reducer) => {
@@ -613,6 +568,7 @@ const disallowedKeys = ['loadedConfigModules', 'connect', 'currentModule', 'stat
613
568
  /**
614
569
  * filters the AppState by removing those keys from the state and return a new state Object
615
570
  * @param app the AppState
571
+ * @deprecated it will be removed in the next major version
616
572
  */
617
573
  const filterAppState = (app) => {
618
574
  // in case app is undefined or null it should return empty object
@@ -631,6 +587,7 @@ const filterAppState = (app) => {
631
587
  /**
632
588
  *
633
589
  * @param storage Type of storage to load the state from
590
+ * @deprecated it will be removed in the next major version
634
591
  */
635
592
  const loadState = (storage = localStorage) => {
636
593
  if (!storage) {
@@ -715,10 +672,10 @@ class LogService extends Logger {
715
672
  }
716
673
  return logger;
717
674
  }
718
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LogService, deps: [{ token: BASE_LOGGER_NAME_TOKEN }, { token: LOG_LEVEL_TOKEN }, { token: LOG_APPENDERS_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
719
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LogService }); }
675
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LogService, deps: [{ token: BASE_LOGGER_NAME_TOKEN }, { token: LOG_LEVEL_TOKEN }, { token: LOG_APPENDERS_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
676
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LogService }); }
720
677
  }
721
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LogService, decorators: [{
678
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LogService, decorators: [{
722
679
  type: Injectable
723
680
  }], ctorParameters: () => [{ type: undefined, decorators: [{
724
681
  type: Inject,
@@ -815,11 +772,11 @@ class LogModule {
815
772
  ],
816
773
  };
817
774
  }
818
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
819
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LogModule }); }
820
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LogModule }); }
775
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
776
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: LogModule }); }
777
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LogModule }); }
821
778
  }
822
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LogModule, decorators: [{
779
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LogModule, decorators: [{
823
780
  type: NgModule
824
781
  }] });
825
782
 
@@ -832,75 +789,99 @@ var BrowserStorageType;
832
789
  // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
833
790
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
834
791
  class StoreService {
835
- constructor(store, logService, platformId) {
836
- this.store = store;
792
+ constructor(logService, platformId) {
837
793
  this.logService = logService;
838
794
  this.platformId = platformId;
839
795
  /**
840
796
  * autoSave handlers to call before saving in local Storage
841
797
  */
842
798
  this._autoSaveHandlers = {};
799
+ this.isHandlingAutoSave = false;
800
+ this.injector = inject(Injector);
843
801
  if (isPlatformBrowser(this.platformId)) {
844
802
  this._storage = localStorage;
845
803
  }
804
+ this.state = signal({});
805
+ toObservable(this.state)
806
+ .pipe(filter(() => this.isHandlingAutoSave), debounceTime(1000), distinctUntilChanged())
807
+ .subscribe((state) => {
808
+ this.saveState(state);
809
+ });
846
810
  }
847
- // use init with just version info, to update to user state, UserService.updateState
848
- // initializeStore(version?: string, userDetails?: BaseUserDetails) {
849
- // this.dispatch(new InitStoreAction({ version, userDetails }));
850
- // }
851
811
  init(version, storageType) {
852
812
  if (isPlatformBrowser(this.platformId)) {
853
- this.dispatch(new InitStoreAction({ version }));
813
+ // This action must be dispatched from an app initializer
814
+ // We load the state from a storage and compare the version and userId with the provided ones.
815
+ // If they are the same, we merge the local state into the initial state.
816
+ // If there is a mismatch, we don't merge the local state, but update only the initial state.
854
817
  this._storage = storageType === BrowserStorageType.session ? sessionStorage : localStorage;
818
+ // load the state from the localStorage
819
+ let localState = loadState(this._storage);
820
+ localState = { ...localState, app: { ...localState?.app, version } };
821
+ this.updateState(this.deepMerge(localState, { ...initialCoreState }));
855
822
  }
856
823
  }
824
+ /**
825
+ * Add an autoSave handler for a specific state slice
826
+ * @param stateSlice
827
+ * @param handler
828
+ * @deprecated it will be removed in the next major version
829
+ */
857
830
  addAutoSaveHandler(stateSlice, handler) {
858
- if (!this.store) {
859
- if (this.logService) {
860
- this.logService.warn('StoreService.addAutoSaveHandler() not available without NGRX');
861
- }
862
- return;
863
- }
864
831
  this._autoSaveHandlers[stateSlice] = handler;
865
832
  }
866
833
  handleAutoSave() {
867
- if (!this.store) {
868
- return;
869
- }
870
- this.store.pipe(debounceTime(1000), distinctUntilChanged()).subscribe((state) => {
871
- this.saveState(state);
872
- });
834
+ this.isHandlingAutoSave = true;
873
835
  }
874
836
  /**
875
837
  * Proxy to NGRX store.dispatch()
876
838
  * that allows to intercept if the store is present
839
+ *
840
+ * @deprecated it will be removed in the next version support of NGRX will cease
877
841
  */
878
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
879
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
880
842
  dispatch(action) {
881
- if (this.store) {
882
- return this.store.dispatch(action);
883
- }
843
+ console.warn('eUI does not PROXY to NGRX store.dispatch() anymore');
884
844
  }
885
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
886
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
887
- dispatchAction(state, actionKey, reducer) {
888
- if (this.store) {
889
- this.store.addReducer(actionKey, reducer);
890
- return this.store.dispatch({ type: actionKey, payload: state });
845
+ updateState(state, reducer) {
846
+ if (reducer) {
847
+ this.state.update(currentState => {
848
+ const newState = reducer(currentState, state);
849
+ return {
850
+ ...newState,
851
+ };
852
+ });
853
+ }
854
+ else {
855
+ this.state.update(currentState => this.deepMerge(currentState, { ...state }));
891
856
  }
892
857
  }
893
- /**
894
- * Proxy to NGRX store.select()
895
- * that allows to intercept if the store is present
896
- */
897
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
898
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
899
- select(key) {
900
- if (!this.store) {
901
- return throwError(() => new Error('NGRX Store not configured'));
858
+ select(keyOrMapFn) {
859
+ let computedState = computed(() => this.state());
860
+ if (keyOrMapFn) {
861
+ switch (typeof keyOrMapFn) {
862
+ case 'function':
863
+ computedState = computed(() => {
864
+ const state = this.state();
865
+ return keyOrMapFn(state);
866
+ });
867
+ break;
868
+ case 'string':
869
+ computedState = computed(() => {
870
+ const state = this.state();
871
+ if (!keyOrMapFn) {
872
+ return state;
873
+ }
874
+ const keys = keyOrMapFn.split('.');
875
+ // Traverse the object based on the dot notation
876
+ return keys.reduce((acc, currKey) => {
877
+ return acc && acc[currKey] !== undefined ? acc[currKey] : undefined;
878
+ }, state);
879
+ });
880
+ break;
881
+ }
902
882
  }
903
- return this.store.select(key);
883
+ // Use `runInInjectionContext` to ensure `toObservable` is within Angular injection context
884
+ return runInInjectionContext(this.injector, () => toObservable(computedState).pipe(distinctUntilChanged((x, y) => isEqual(x, y))));
904
885
  }
905
886
  /**
906
887
  * filters and save the state with the Browser storage
@@ -926,17 +907,46 @@ class StoreService {
926
907
  // Ignore write errors.
927
908
  }
928
909
  }
929
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: StoreService, deps: [{ token: i1$3.Store, optional: true }, { token: LogService, optional: true }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
930
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: StoreService, providedIn: 'root' }); }
910
+ /**
911
+ * deep merge two objects
912
+ * @param target the object that will be merged into
913
+ * @param source the object that will be merged from
914
+ */
915
+ deepMerge(target, source) {
916
+ const output = Object.assign({}, target);
917
+ if (this.isObject(target) && this.isObject(source)) {
918
+ Object.keys(source).forEach(key => {
919
+ if (this.isObject(source[key])) {
920
+ if (!(key in target)) {
921
+ Object.assign(output, { [key]: source[key] });
922
+ }
923
+ else {
924
+ output[key] = this.deepMerge(target[key], source[key]);
925
+ }
926
+ }
927
+ else {
928
+ Object.assign(output, { [key]: source[key] });
929
+ }
930
+ });
931
+ }
932
+ return output;
933
+ }
934
+ /**
935
+ * checks if the given item is an object
936
+ * @param item the item that will be checked
937
+ */
938
+ isObject(item) {
939
+ return item && typeof item === 'object' && !Array.isArray(item);
940
+ }
941
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: StoreService, deps: [{ token: LogService, optional: true }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
942
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: StoreService, providedIn: 'root' }); }
931
943
  }
932
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: StoreService, decorators: [{
944
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: StoreService, decorators: [{
933
945
  type: Injectable,
934
946
  args: [{
935
947
  providedIn: 'root',
936
948
  }]
937
- }], ctorParameters: () => [{ type: i1$3.Store, decorators: [{
938
- type: Optional
939
- }] }, { type: LogService, decorators: [{
949
+ }], ctorParameters: () => [{ type: LogService, decorators: [{
940
950
  type: Optional
941
951
  }] }, { type: undefined, decorators: [{
942
952
  type: Inject,
@@ -946,7 +956,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ng
946
956
  const PLATFORM_BROWSER_ID = 'browser';
947
957
  class StoreServiceMock extends StoreService {
948
958
  constructor() {
949
- super(null, null, PLATFORM_BROWSER_ID);
959
+ super(null, PLATFORM_BROWSER_ID);
950
960
  }
951
961
  init() { }
952
962
  addAutoSaveHandler() { }
@@ -955,39 +965,13 @@ class StoreServiceMock extends StoreService {
955
965
  select() {
956
966
  return of({});
957
967
  }
958
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: StoreServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
959
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: StoreServiceMock }); }
968
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: StoreServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
969
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: StoreServiceMock }); }
960
970
  }
961
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: StoreServiceMock, decorators: [{
971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: StoreServiceMock, decorators: [{
962
972
  type: Injectable
963
973
  }], ctorParameters: () => [] });
964
974
 
965
- const euiInitApp = (injector) => () => new Promise((resolve) => {
966
- const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
967
- locationInitialized.then(() => {
968
- const appConfig = injector.get(CONFIG_TOKEN);
969
- // necessary config parameters
970
- let appVersion;
971
- if (appConfig && appConfig.versions && appConfig.versions.app) {
972
- appVersion = appConfig.versions.app;
973
- }
974
- else {
975
- appVersion = '0.0.0';
976
- }
977
- let storageType;
978
- if (appConfig && appConfig['saveStateStorage']) {
979
- storageType = appConfig['saveStateStorage'];
980
- }
981
- else {
982
- storageType = BrowserStorageType.local;
983
- }
984
- const storeService = injector.get(StoreService);
985
- storeService.init(appVersion, storageType);
986
- storeService.handleAutoSave();
987
- resolve(null);
988
- });
989
- });
990
-
991
975
  function getCoreProviders() {
992
976
  return [
993
977
  // core config
@@ -1001,7 +985,6 @@ function getCoreProviders() {
1001
985
  { provide: SHOW_CONNECTION_STATUS_TOKEN, useFactory: getShowConnectionStatus, deps: [GLOBAL_CONFIG_TOKEN] },
1002
986
  { provide: LogService, useFactory: euiLogServiceFactory, deps: [Injector, BASE_NAME_TOKEN, ROOT_LOG_CONFIG_TOKEN] },
1003
987
  { provide: HTTP_ERROR_HANDLER_CONFIG_TOKEN, useFactory: getHttpErrorHandlingConfig, deps: [CONFIG_TOKEN] },
1004
- { provide: APP_INITIALIZER, useFactory: euiInitApp, multi: true, deps: [Injector] },
1005
988
  ];
1006
989
  }
1007
990
  function getDependencyProviders() {
@@ -1021,6 +1004,21 @@ function getCoreChildProviders(moduleName) {
1021
1004
  ];
1022
1005
  }
1023
1006
 
1007
+ const AddAppLoadedConfigModules = (state, action) => ({
1008
+ ...state,
1009
+ app: {
1010
+ ...state.app,
1011
+ loadedConfigModules: {
1012
+ lastAddedModule: action.moduleName,
1013
+ modulesConfig: {
1014
+ ...state.app.loadedConfigModules.modulesConfig,
1015
+ [action.moduleName]: {
1016
+ ...action.moduleConfig,
1017
+ },
1018
+ },
1019
+ },
1020
+ },
1021
+ });
1024
1022
  const CORE_ROOT_GUARD = new InjectionToken('Internal Theme ForRoot Guard');
1025
1023
  class CoreModule {
1026
1024
  /**
@@ -1058,14 +1056,14 @@ class CoreModule {
1058
1056
  const storeService = injector.get(StoreService);
1059
1057
  const moduleName = injector.get(MODULE_NAME_TOKEN);
1060
1058
  const moduleConfig = injector.get(MODULE_CONFIG_TOKEN);
1061
- storeService.dispatch(new AddAppLoadedConfigModulesAction({ moduleName, moduleConfig }));
1059
+ storeService.updateState({ moduleName, moduleConfig }, AddAppLoadedConfigModules);
1062
1060
  }
1063
1061
  }
1064
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CoreModule, deps: [{ token: CORE_ROOT_GUARD, optional: true }, { token: CoreModule, optional: true, skipSelf: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
1065
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CoreModule }); }
1066
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CoreModule }); }
1062
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CoreModule, deps: [{ token: CORE_ROOT_GUARD, optional: true }, { token: CoreModule, optional: true, skipSelf: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
1063
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: CoreModule }); }
1064
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CoreModule }); }
1067
1065
  }
1068
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CoreModule, decorators: [{
1066
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CoreModule, decorators: [{
1069
1067
  type: NgModule
1070
1068
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1071
1069
  type: Optional
@@ -1098,8 +1096,7 @@ async function preInitApp(envConfig) {
1098
1096
  const envDynamicConfig = envConfig && envConfig.envDynamicConfig;
1099
1097
  if (envDynamicConfig) {
1100
1098
  // load the local configuration file, if defined
1101
- const euiAppJsonConfig = await loadEuiDynamicEnvironmentConfig(envDynamicConfig.uri, envDynamicConfig.configTimeout || 2000);
1102
- envConfig.loadedEnvDynamicConfig = euiAppJsonConfig;
1099
+ envConfig.loadedEnvDynamicConfig = await loadEuiDynamicEnvironmentConfig(envDynamicConfig.uri, envDynamicConfig.configTimeout || 2000);
1103
1100
  return envConfig;
1104
1101
  }
1105
1102
  return envConfig;
@@ -1130,6 +1127,70 @@ async function loadEuiDynamicEnvironmentConfig(url, timeout) {
1130
1127
  return null;
1131
1128
  }
1132
1129
 
1130
+ const init = () => {
1131
+ const locationInitialized = inject(LOCATION_INITIALIZED, { optional: true }) || Promise.resolve(null);
1132
+ const appConfig = inject(CONFIG_TOKEN);
1133
+ const storeService = inject(StoreService);
1134
+ return new Promise(resolve => {
1135
+ locationInitialized.then(() => {
1136
+ // necessary config parameters
1137
+ let appVersion;
1138
+ if (appConfig && appConfig.versions && appConfig.versions.app) {
1139
+ appVersion = appConfig.versions.app;
1140
+ }
1141
+ else {
1142
+ appVersion = '0.0.0';
1143
+ }
1144
+ let storageType;
1145
+ if (appConfig && appConfig['saveStateStorage']) {
1146
+ storageType = appConfig['saveStateStorage'];
1147
+ }
1148
+ else {
1149
+ storageType = BrowserStorageType.local;
1150
+ }
1151
+ storeService.init(appVersion, storageType);
1152
+ storeService.handleAutoSave();
1153
+ resolve(null);
1154
+ });
1155
+ });
1156
+ };
1157
+ /**
1158
+ * Initializes the app with the necessary configurations. Use this in combination with `provideAppInitializer(euiInitApp_Env)`
1159
+ */
1160
+ function provideEuiInitializer() {
1161
+ return provideAppInitializer(init);
1162
+ }
1163
+ /**
1164
+ * Initializes the app with the necessary configurations
1165
+ * @param injector
1166
+ * @deprecated Use `provideEuiInitializer()` instead. Beware that this should be declared as Environment providers.
1167
+ */
1168
+ const euiInitApp = (injector) => () => new Promise((resolve) => {
1169
+ const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
1170
+ locationInitialized.then(() => {
1171
+ const appConfig = injector.get(CONFIG_TOKEN);
1172
+ // necessary config parameters
1173
+ let appVersion;
1174
+ if (appConfig && appConfig.versions && appConfig.versions.app) {
1175
+ appVersion = appConfig.versions.app;
1176
+ }
1177
+ else {
1178
+ appVersion = '0.0.0';
1179
+ }
1180
+ let storageType;
1181
+ if (appConfig && appConfig['saveStateStorage']) {
1182
+ storageType = appConfig['saveStateStorage'];
1183
+ }
1184
+ else {
1185
+ storageType = BrowserStorageType.local;
1186
+ }
1187
+ const storeService = injector.get(StoreService);
1188
+ storeService.init(appVersion, storageType);
1189
+ storeService.handleAutoSave();
1190
+ resolve(null);
1191
+ });
1192
+ });
1193
+
1133
1194
  const errorCodes = {
1134
1195
  ERR_GENERIC: 'ERR_GENERIC',
1135
1196
  };
@@ -1187,10 +1248,10 @@ class GlobalErrorHandler extends ErrorHandler {
1187
1248
  // throw error;
1188
1249
  super.handleError(error);
1189
1250
  }
1190
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: GlobalErrorHandler, deps: [{ token: LogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1191
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: GlobalErrorHandler, providedIn: 'root' }); }
1251
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GlobalErrorHandler, deps: [{ token: LogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1252
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GlobalErrorHandler, providedIn: 'root' }); }
1192
1253
  }
1193
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: GlobalErrorHandler, decorators: [{
1254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: GlobalErrorHandler, decorators: [{
1194
1255
  type: Injectable,
1195
1256
  args: [{
1196
1257
  providedIn: 'root',
@@ -1242,15 +1303,88 @@ class HttpErrorHandlerInterceptor {
1242
1303
  // return the first matching route, if any
1243
1304
  return routes.length > 0 ? routes[0] : null;
1244
1305
  }
1245
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: HttpErrorHandlerInterceptor, deps: [{ token: HTTP_ERROR_HANDLER_CONFIG_TOKEN }, { token: i0.Injector }, { token: i1$4.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
1246
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: HttpErrorHandlerInterceptor }); }
1306
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: HttpErrorHandlerInterceptor, deps: [{ token: HTTP_ERROR_HANDLER_CONFIG_TOKEN }, { token: i0.Injector }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
1307
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: HttpErrorHandlerInterceptor }); }
1247
1308
  }
1248
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: HttpErrorHandlerInterceptor, decorators: [{
1309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: HttpErrorHandlerInterceptor, decorators: [{
1249
1310
  type: Injectable
1250
1311
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1251
1312
  type: Inject,
1252
1313
  args: [HTTP_ERROR_HANDLER_CONFIG_TOKEN]
1253
- }] }, { type: i0.Injector }, { type: i1$4.Router }] });
1314
+ }] }, { type: i0.Injector }, { type: i1$1.Router }] });
1315
+
1316
+ class EuiGrowlService {
1317
+ constructor() {
1318
+ this.growlMessages = [];
1319
+ this.isGrowlSticky = false;
1320
+ this.isCloseAllSticky = false;
1321
+ this.growlLife = 3000;
1322
+ this.growlPosition = 'bottom-right';
1323
+ this.growlCallback = null;
1324
+ }
1325
+ /**
1326
+ * displays a growl UxMessage item, isSticky
1327
+ */
1328
+ growl(msg, isSticky, isMultiple, life, position, callback) {
1329
+ if (msg.severity !== 'info' && msg.severity !== 'warning' && msg.severity !== 'success' && msg.severity !== 'danger') {
1330
+ throw new Error('EuiGrowlService.growl() ERROR : message severity must be either : success, warning, info, danger');
1331
+ }
1332
+ else {
1333
+ if (isMultiple === undefined || !isMultiple) {
1334
+ this.growlMessages = [];
1335
+ }
1336
+ this.growlMessages = this.growlMessages.concat(msg);
1337
+ msg.life = life || msg.life;
1338
+ msg.sticky = isSticky || msg.sticky;
1339
+ if (life === undefined || isNaN(life)) {
1340
+ if (msg.severity === 'danger') {
1341
+ isSticky = true;
1342
+ }
1343
+ else {
1344
+ this.growlLife = 3000;
1345
+ }
1346
+ }
1347
+ else {
1348
+ this.growlLife = life;
1349
+ }
1350
+ if (isSticky) {
1351
+ this.isGrowlSticky = isSticky;
1352
+ }
1353
+ else {
1354
+ this.isGrowlSticky = false;
1355
+ }
1356
+ if (position) {
1357
+ this.growlPosition = position;
1358
+ }
1359
+ if (callback) {
1360
+ this.growlCallback = callback;
1361
+ }
1362
+ }
1363
+ }
1364
+ clearGrowl() {
1365
+ this.growlMessages = [];
1366
+ }
1367
+ growlSuccess(msg, position) {
1368
+ this.growl({ severity: 'success', summary: 'SUCCESS', detail: msg }, false, false, undefined, position);
1369
+ }
1370
+ growlError(msg, position) {
1371
+ this.growl({ severity: 'danger', summary: 'ERROR', detail: msg }, false, false, undefined, position);
1372
+ }
1373
+ growlWarning(msg, position) {
1374
+ this.growl({ severity: 'warning', summary: 'WARNING', detail: msg }, false, false, undefined, position);
1375
+ }
1376
+ growlInfo(msg, position) {
1377
+ this.growl({ severity: 'info', summary: 'INFO', detail: msg }, false, false, undefined, position);
1378
+ }
1379
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiGrowlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1380
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiGrowlService, providedIn: 'root' }); }
1381
+ }
1382
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiGrowlService, decorators: [{
1383
+ type: Injectable,
1384
+ args: [{
1385
+ providedIn: 'root',
1386
+ }]
1387
+ }] });
1254
1388
 
1255
1389
  function AlertHttpErrorCallbackFn(error) {
1256
1390
  alert(error.statusText);
@@ -1306,9 +1440,39 @@ class ApiQueueService {
1306
1440
  this.store = store;
1307
1441
  this.http = http;
1308
1442
  this.logService = logService;
1443
+ /**
1444
+ * A state reducer that adds an item to the API queue.
1445
+ * @param state
1446
+ * @param action
1447
+ */
1448
+ this.addApiQueueItem = (state, action) => {
1449
+ // apply the timestamp to the queue item
1450
+ action.item.timestamp = new Date().getTime();
1451
+ // update the queue
1452
+ const apiQueue = Object.assign({}, state.app?.apiQueue, { [action.id]: action.item });
1453
+ return Object.assign({}, state, { app: { ...state.app, apiQueue } });
1454
+ };
1455
+ /**
1456
+ * A state reducer that removes an item from the API queue.
1457
+ * @param state
1458
+ * @param action
1459
+ */
1460
+ this.removeApiQueueItem = (state, action) => {
1461
+ // remove the specified id from the list of item ids and recreate the apiQueue from the remaining ids
1462
+ const apiQueue = Object.keys(state.app.apiQueue)
1463
+ .filter((id) => id !== action.payload)
1464
+ .reduce((queue, key) => {
1465
+ queue[key] = state.app.apiQueue[key];
1466
+ return queue;
1467
+ }, {});
1468
+ return Object.assign({}, state, { app: { ...state.app, apiQueue } });
1469
+ };
1309
1470
  if (logService) {
1310
1471
  this.logger = logService.getLogger('core.ApiQueueService');
1311
1472
  }
1473
+ this.getAppState = (state) => state.app;
1474
+ this.getApiQueue = createSelector(this.getAppState, (state) => state.apiQueue);
1475
+ this.getApiQueueItem = (itemId) => createSelector(this.getAppState, (state) => state.apiQueue[itemId]);
1312
1476
  }
1313
1477
  /**
1314
1478
  * Adds an item to the queue by dispatching an action to the store.
@@ -1337,7 +1501,7 @@ class ApiQueueService {
1337
1501
  if (allowedMethods.indexOf(item.method) < 0) {
1338
1502
  throw new Error(`[ApiQueue] method "${item.method}" is not allowed`);
1339
1503
  }
1340
- this.store.dispatch(new AddApiQueueItemAction({ id, item }));
1504
+ this.store.updateState({ id, item }, this.addApiQueueItem);
1341
1505
  }
1342
1506
  /**
1343
1507
  * Retrieves the current state of the API queue and converts it into an array of Observables.
@@ -1361,7 +1525,7 @@ class ApiQueueService {
1361
1525
  * });
1362
1526
  */
1363
1527
  getQueue() {
1364
- return this.store.select(getApiQueue).pipe(take(1), map((queue) => {
1528
+ return this.store.select(this.getApiQueue).pipe(take(1), map((queue) => {
1365
1529
  const queueArray = queue && Object.values(queue);
1366
1530
  if (!queueArray || queueArray.length < 1) {
1367
1531
  this.logger?.warn('No items in the queue exist.');
@@ -1395,7 +1559,7 @@ class ApiQueueService {
1395
1559
  * });
1396
1560
  */
1397
1561
  getQueueItem(id) {
1398
- return this.store.select(getApiQueueItem(id)).pipe(take(1), map((queue) => {
1562
+ return this.store.select(this.getApiQueueItem(id)).pipe(take(1), map((queue) => {
1399
1563
  if (!queue) {
1400
1564
  this.logger?.warn(`Queue item with id "${id}" does not exist`);
1401
1565
  return null;
@@ -1422,7 +1586,7 @@ class ApiQueueService {
1422
1586
  * // The item with ID 'item123' will be dispatched for removal from the queue.
1423
1587
  */
1424
1588
  removeQueueItem(id) {
1425
- this.store.dispatch(new RemoveApiQueueItemAction(id));
1589
+ this.store.updateState({ payload: id }, this.removeApiQueueItem);
1426
1590
  }
1427
1591
  /**
1428
1592
  * Clears all items from the API queue.
@@ -1440,7 +1604,7 @@ class ApiQueueService {
1440
1604
  * // This will dispatch an action to empty the entire API queue.
1441
1605
  */
1442
1606
  removeAllQueueItem() {
1443
- this.store.dispatch(new EmptyApiQueueAction(null));
1607
+ this.store.updateState({ app: { apiQueue: {} } });
1444
1608
  }
1445
1609
  /**
1446
1610
  * Processes an item from the API queue identified by its ID.
@@ -1462,10 +1626,8 @@ class ApiQueueService {
1462
1626
  * }
1463
1627
  * });
1464
1628
  */
1465
- // TODO: Replace `any` with a more specific type or make the method generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1466
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1467
1629
  processQueueItem(id) {
1468
- return this.store.select(getApiQueueItem(id)).pipe(take(1), switchMap((queue) => {
1630
+ return this.store.select(this.getApiQueueItem(id)).pipe(take(1), switchMap((queue) => {
1469
1631
  if (!queue) {
1470
1632
  this.logger?.warn(`Queue item with id "${id}" does not exist`);
1471
1633
  return of(null);
@@ -1493,10 +1655,8 @@ class ApiQueueService {
1493
1655
  * // Handle the array of responses or errors
1494
1656
  * });
1495
1657
  */
1496
- // TODO: Refine the return type to be more specific or implement generics, https://www.typescriptlang.org/docs/handbook/2/generics.html
1497
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1498
1658
  processAllQueueItems(continueOnError = true) {
1499
- return this.store.select(getApiQueue).pipe(map((queue) => Object.entries(queue).map(([key, value]) => this.buildHttpRequest(key, value).pipe(catchError((error) => {
1659
+ return this.store.select(this.getApiQueue).pipe(map((queue) => Object.entries(queue).map(([key, value]) => this.buildHttpRequest(key, value).pipe(catchError((error) => {
1500
1660
  this.logger?.error(`Queue Item with id ${key} failed.`, error.message, error.stack);
1501
1661
  if (!continueOnError) {
1502
1662
  throw error;
@@ -1525,10 +1685,8 @@ class ApiQueueService {
1525
1685
  * // Handle each response in the order of queue processing
1526
1686
  * });
1527
1687
  */
1528
- // TODO: Refine the return type for more specific or implement generics, https://www.typescriptlang.org/docs/handbook/2/generics.html
1529
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1530
1688
  processAllQueueItemsSequential(ascending = true) {
1531
- return this.store.select(getApiQueue).pipe(switchMap((queue) => from(Object.entries(queue)
1689
+ return this.store.select(this.getApiQueue).pipe(switchMap((queue) => from(Object.entries(queue)
1532
1690
  .sort((a, b) => (ascending ? this.sortOnTimestamp(a, b) : this.sortOnTimestamp(b, a)))
1533
1691
  .map(([id, item]) => this.buildHttpRequest(id, item)))
1534
1692
  .pipe(concatMap(x => x))));
@@ -1577,21 +1735,18 @@ class ApiQueueService {
1577
1735
  *
1578
1736
  * @template T - The expected type of the HTTP response. Defaults to `any`.
1579
1737
  */
1580
- // TODO: add type for T and deprecate old function
1581
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1582
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1583
1738
  buildHttpRequest(id, item) {
1584
1739
  return this.http[item.method.toLowerCase()](item.uri, item.payload).pipe(tap(() => this.removeQueueItem(id)));
1585
1740
  }
1586
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ApiQueueService, deps: [{ token: StoreService }, { token: i1$5.HttpClient }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
1587
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ApiQueueService, providedIn: 'root' }); }
1741
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ApiQueueService, deps: [{ token: StoreService }, { token: i1$2.HttpClient }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
1742
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ApiQueueService, providedIn: 'root' }); }
1588
1743
  }
1589
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: ApiQueueService, decorators: [{
1744
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ApiQueueService, decorators: [{
1590
1745
  type: Injectable,
1591
1746
  args: [{
1592
1747
  providedIn: 'root',
1593
1748
  }]
1594
- }], ctorParameters: () => [{ type: StoreService }, { type: i1$5.HttpClient }, { type: LogService, decorators: [{
1749
+ }], ctorParameters: () => [{ type: StoreService }, { type: i1$2.HttpClient }, { type: LogService, decorators: [{
1595
1750
  type: Optional
1596
1751
  }] }] });
1597
1752
 
@@ -1606,15 +1761,11 @@ class ApiQueueServiceMock extends ApiQueueService {
1606
1761
  return of({ uri: id, method: 'GET' });
1607
1762
  }
1608
1763
  removeAllQueueItem() { }
1609
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1610
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1611
1764
  processAllQueueItems() {
1612
1765
  return of({});
1613
1766
  }
1614
1767
  addQueueItem() { }
1615
1768
  removeQueueItem() { }
1616
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1617
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1618
1769
  processQueueItem() {
1619
1770
  return of({});
1620
1771
  }
@@ -1804,20 +1955,13 @@ class I18nLoader {
1804
1955
  * @param lang the resource language to load
1805
1956
  * @returns Observable<any>
1806
1957
  */
1807
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1808
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1809
1958
  loadResource(resource, lang) {
1810
1959
  // the path to the resource
1811
1960
  const path = resource.getPath(lang);
1812
1961
  // load the translations from the path
1813
1962
  return this.http.get(path).pipe(
1814
1963
  // preprocess the translations using the resource compiler
1815
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1816
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1817
- map((translations) => resource.compileTranslations(translations, lang)),
1818
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1819
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1820
- map((translations) => {
1964
+ map((translations) => resource.compileTranslations(translations, lang)), map((translations) => {
1821
1965
  // resource loaded properly, send a info message
1822
1966
  this.logger?.info(`I18n resource loaded from path ${path}`);
1823
1967
  // return the translations
@@ -1838,12 +1982,12 @@ class I18nLoader {
1838
1982
  }
1839
1983
  return undefined;
1840
1984
  }
1841
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: I18nLoader, deps: [{ token: i1$5.HttpClient }, { token: LogService, optional: true }, { token: CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
1842
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: I18nLoader }); }
1985
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: I18nLoader, deps: [{ token: i1$2.HttpClient }, { token: LogService, optional: true }, { token: CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
1986
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: I18nLoader }); }
1843
1987
  }
1844
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: I18nLoader, decorators: [{
1988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: I18nLoader, decorators: [{
1845
1989
  type: Injectable
1846
- }], ctorParameters: () => [{ type: i1$5.HttpClient }, { type: LogService, decorators: [{
1990
+ }], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: LogService, decorators: [{
1847
1991
  type: Optional
1848
1992
  }] }, { type: undefined, decorators: [{
1849
1993
  type: Inject,
@@ -1856,7 +2000,9 @@ const translateConfig = {
1856
2000
  },
1857
2001
  };
1858
2002
 
2003
+ const getLastAddedModule = (state) => state.app.loadedConfigModules.lastAddedModule;
1859
2004
  class I18nService extends EuiLazyService {
2005
+ static { this.DEFAULT_STATE = { activeLang: 'en' }; }
1860
2006
  constructor(baseGlobalConfig, translateService, logService, store, document) {
1861
2007
  super({ activeLang: 'en' });
1862
2008
  this.baseGlobalConfig = baseGlobalConfig;
@@ -1864,29 +2010,58 @@ class I18nService extends EuiLazyService {
1864
2010
  this.logService = logService;
1865
2011
  this.store = store;
1866
2012
  this.document = document;
2013
+ /**
2014
+ * a single signal holding the state - initial state is null
2015
+ */
2016
+ this.state = signal(I18nService.DEFAULT_STATE);
2017
+ this.injector = inject(Injector);
2018
+ this.subNotifier = new Subject();
1867
2019
  this.config = getI18nServiceConfigFromBase(this.baseGlobalConfig);
1868
2020
  this.onModuleLoad = new BehaviorSubject({ ready: false, name: null });
1869
2021
  }
2022
+ ngOnDestroy() {
2023
+ this.subNotifier.next(void 0);
2024
+ this.subNotifier.complete();
2025
+ }
1870
2026
  getState(keyOrMapFn) {
1871
- let selector = getI18nState;
1872
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1873
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1874
- const dotNotationToObject = (obj, key) => key.split('.').reduce((slice, i) => slice[i], obj);
2027
+ let computedState = computed(() => this.state());
1875
2028
  if (keyOrMapFn) {
1876
2029
  switch (typeof keyOrMapFn) {
1877
2030
  case 'function':
1878
- selector = createSelector(getI18nState, keyOrMapFn);
2031
+ computedState = computed(() => {
2032
+ const state = this.state();
2033
+ return keyOrMapFn(state);
2034
+ });
1879
2035
  break;
1880
2036
  case 'string':
1881
- selector = createSelector(getI18nState, (state) => dotNotationToObject(state, keyOrMapFn));
2037
+ computedState = computed(() => {
2038
+ const state = this.state();
2039
+ if (!keyOrMapFn) {
2040
+ return state;
2041
+ }
2042
+ const keys = keyOrMapFn.split('.');
2043
+ // Traverse the object based on the dot notation
2044
+ return keys.reduce((acc, currKey) => {
2045
+ return acc && acc[currKey] !== undefined ? acc[currKey] : undefined;
2046
+ }, state);
2047
+ });
1882
2048
  break;
1883
2049
  }
1884
2050
  }
1885
- return this.store.select(selector);
2051
+ // Use `runInInjectionContext` to ensure `toObservable` is within Angular injection context
2052
+ return runInInjectionContext(this.injector, () => toObservable(computedState).pipe(takeUntil(this.subNotifier), distinctUntilChanged((x, y) => isEqual(x, y))));
1886
2053
  }
1887
- updateState(langState) {
1888
- this.updateHTMLDOMLang(langState.activeLang);
1889
- this.store.dispatch(new UpdateI18nStateAction(langState));
2054
+ updateState(state, reducer) {
2055
+ if (state.activeLang) {
2056
+ this.updateHTMLDOMLang(state.activeLang);
2057
+ }
2058
+ this.state.update(currentState => super.deepMerge(currentState, { ...state }));
2059
+ }
2060
+ /**
2061
+ * This method is used to get the state as readonly signal.
2062
+ */
2063
+ getSignal() {
2064
+ return this.state.asReadonly();
1890
2065
  }
1891
2066
  init(langState) {
1892
2067
  const initLang = langState && langState.activeLang ? langState.activeLang : this.preparedDefaultLanguage();
@@ -1901,6 +2076,15 @@ class I18nService extends EuiLazyService {
1901
2076
  }
1902
2077
  return of({ success: false, error: 'Initial active lang should be string' });
1903
2078
  }
2079
+ /**
2080
+ * A pipe function that could serve as a wrapper of another observable
2081
+ * e.g. ngx-translate i18n.onReady('my_module').pipe(switchMap(()=>translate.get('eui.KEY')));
2082
+ * WARNING: onReady will emit only once for a loaded Module, going to another and then going back will not result
2083
+ * into another emission.
2084
+ *
2085
+ * @param moduleName the name of the module that has been given through the eUI globalConfig. In case non provided
2086
+ * fetch module name from the state.
2087
+ */
1904
2088
  onReady(moduleName) {
1905
2089
  return this.onModuleLoad.pipe(switchMap((evt) => moduleName
1906
2090
  ? of(evt)
@@ -1975,13 +2159,13 @@ class I18nService extends EuiLazyService {
1975
2159
  return this.config.defaultLanguage;
1976
2160
  }
1977
2161
  /**
1978
- * @param default_language if given default language to override default language coming from the
2162
+ * @param initLanguage if given default language to override default language coming from the
1979
2163
  * configuration token.
1980
2164
  */
1981
2165
  setup(initLanguage) {
1982
2166
  // use the default config as a reference base
1983
2167
  this.config = Object.assign({}, DEFAULT_I18N_SERVICE_CONFIG, this.config);
1984
- // configure the translate config service
2168
+ // configure the translation config service
1985
2169
  if (this.config.languages) {
1986
2170
  this.translateService.addLangs(EuiEuLanguages.getLanguageCodes(this.config.languages));
1987
2171
  if (this.logService) {
@@ -2006,7 +2190,9 @@ class I18nService extends EuiLazyService {
2006
2190
  }), catchError((error) => of({ success: false, error })));
2007
2191
  }
2008
2192
  bindActiveLangStateToTranslateService() {
2009
- this.store.select(getActiveLang).subscribe((lang) => {
2193
+ this.getState((s) => s.activeLang)
2194
+ .pipe(takeUntil(this.subNotifier))
2195
+ .subscribe((lang) => {
2010
2196
  if (lang !== null && this.translateService.currentLang !== lang) {
2011
2197
  this.use(lang);
2012
2198
  }
@@ -2050,10 +2236,10 @@ class I18nService extends EuiLazyService {
2050
2236
  updateHTMLDOMLang(lang) {
2051
2237
  this.document.documentElement.lang = lang;
2052
2238
  }
2053
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: I18nService, deps: [{ token: GLOBAL_CONFIG_TOKEN }, { token: i1$2.TranslateService }, { token: LogService, optional: true }, { token: StoreService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
2054
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: I18nService, providedIn: 'root' }); }
2239
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: I18nService, deps: [{ token: GLOBAL_CONFIG_TOKEN }, { token: i1$3.TranslateService }, { token: LogService, optional: true }, { token: StoreService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
2240
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: I18nService, providedIn: 'root' }); }
2055
2241
  }
2056
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: I18nService, decorators: [{
2242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: I18nService, decorators: [{
2057
2243
  type: Injectable,
2058
2244
  args: [{
2059
2245
  providedIn: 'root',
@@ -2061,7 +2247,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ng
2061
2247
  }], ctorParameters: () => [{ type: undefined, decorators: [{
2062
2248
  type: Inject,
2063
2249
  args: [GLOBAL_CONFIG_TOKEN]
2064
- }] }, { type: i1$2.TranslateService }, { type: LogService, decorators: [{
2250
+ }] }, { type: i1$3.TranslateService }, { type: LogService, decorators: [{
2065
2251
  type: Optional
2066
2252
  }] }, { type: StoreService }, { type: Document, decorators: [{
2067
2253
  type: Inject,
@@ -2540,6 +2726,8 @@ class EuiPermissionService extends EuiService {
2540
2726
  * });
2541
2727
  */
2542
2728
  getState() {
2729
+ const getUserState = (state) => state.user;
2730
+ const getUserRights = createSelector(getUserState, (state) => state.rights);
2543
2731
  return this.store.select(getUserRights);
2544
2732
  }
2545
2733
  /**
@@ -2560,7 +2748,7 @@ class EuiPermissionService extends EuiService {
2560
2748
  * permissionService.updateState(newUserRights);
2561
2749
  */
2562
2750
  updateState(rights) {
2563
- this.store.dispatch(new UpdateUserRightsAction(rights || []));
2751
+ this.store.updateState({ user: { rights: rights || [] } });
2564
2752
  }
2565
2753
  /**
2566
2754
  * Checks if the user has the specified attribute permission.
@@ -2654,10 +2842,10 @@ class EuiPermissionService extends EuiService {
2654
2842
  }
2655
2843
  return rights.every((right) => this.userRights.find((uRight) => uRight.id === right.id));
2656
2844
  }
2657
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiPermissionService, deps: [{ token: LogService, optional: true }, { token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2658
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiPermissionService, providedIn: 'root' }); }
2845
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiPermissionService, deps: [{ token: LogService, optional: true }, { token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2846
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiPermissionService, providedIn: 'root' }); }
2659
2847
  }
2660
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiPermissionService, decorators: [{
2848
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiPermissionService, decorators: [{
2661
2849
  type: Injectable,
2662
2850
  args: [{
2663
2851
  providedIn: 'root',
@@ -2717,10 +2905,10 @@ class EuiDynamicMenuService {
2717
2905
  return true;
2718
2906
  });
2719
2907
  }
2720
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiDynamicMenuService, deps: [{ token: EuiPermissionService }, { token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2721
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiDynamicMenuService, providedIn: 'root' }); }
2908
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiDynamicMenuService, deps: [{ token: EuiPermissionService }, { token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2909
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiDynamicMenuService, providedIn: 'root' }); }
2722
2910
  }
2723
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiDynamicMenuService, decorators: [{
2911
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiDynamicMenuService, decorators: [{
2724
2912
  type: Injectable,
2725
2913
  args: [{
2726
2914
  providedIn: 'root',
@@ -2785,10 +2973,10 @@ class EuiDynamicComponentService {
2785
2973
  injectorTokens.set(DYNAMIC_COMPONENT_CONFIG, data);
2786
2974
  return new PortalInjector(this.injector, injectorTokens);
2787
2975
  }
2788
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiDynamicComponentService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
2789
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiDynamicComponentService }); }
2976
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiDynamicComponentService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
2977
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiDynamicComponentService }); }
2790
2978
  }
2791
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiDynamicComponentService, decorators: [{
2979
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiDynamicComponentService, decorators: [{
2792
2980
  type: Injectable
2793
2981
  }], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.Injector }, { type: i0.ApplicationRef }] });
2794
2982
 
@@ -2989,7 +3177,7 @@ class EuiAppShellService {
2989
3177
  key
2990
3178
  ? this.state$.pipe(map((state) => get(state, key)),
2991
3179
  // filter((state) => state),
2992
- distinctUntilChanged((x, y) => isEqual(x, y)))
3180
+ distinctUntilChanged((x, y) => isEqual$1(x, y)))
2993
3181
  : this.state$);
2994
3182
  }
2995
3183
  sidebarToggle() {
@@ -3156,13 +3344,12 @@ class EuiAppShellService {
3156
3344
  const body = res;
3157
3345
  return body || {};
3158
3346
  }
3159
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3160
3347
  handleError(error) {
3161
3348
  console.error('An error occurred', error);
3162
3349
  return Promise.reject(error.message || error);
3163
3350
  }
3164
3351
  bindActiveLanguageToAppShellState() {
3165
- this.storeService.select(getActiveLang).subscribe((activeLang) => {
3352
+ this.i18nService.getState((s) => s.activeLang).subscribe((activeLang) => {
3166
3353
  if (activeLang !== this.state.activeLanguage) {
3167
3354
  this.setState({
3168
3355
  ...this.state,
@@ -3171,10 +3358,10 @@ class EuiAppShellService {
3171
3358
  }
3172
3359
  });
3173
3360
  }
3174
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiAppShellService, deps: [{ token: GLOBAL_CONFIG_TOKEN, optional: true }, { token: i1$5.HttpClient }, { token: PLATFORM_ID }, { token: DOCUMENT }, { token: i1$4.Router }, { token: StoreService }, { token: I18nService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3175
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiAppShellService, providedIn: 'root' }); }
3361
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiAppShellService, deps: [{ token: GLOBAL_CONFIG_TOKEN, optional: true }, { token: i1$2.HttpClient }, { token: PLATFORM_ID }, { token: DOCUMENT }, { token: i1$1.Router }, { token: StoreService }, { token: I18nService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3362
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiAppShellService, providedIn: 'root' }); }
3176
3363
  }
3177
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiAppShellService, decorators: [{
3364
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiAppShellService, decorators: [{
3178
3365
  type: Injectable,
3179
3366
  args: [{
3180
3367
  providedIn: 'root',
@@ -3184,13 +3371,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ng
3184
3371
  }, {
3185
3372
  type: Inject,
3186
3373
  args: [GLOBAL_CONFIG_TOKEN]
3187
- }] }, { type: i1$5.HttpClient }, { type: undefined, decorators: [{
3374
+ }] }, { type: i1$2.HttpClient }, { type: undefined, decorators: [{
3188
3375
  type: Inject,
3189
3376
  args: [PLATFORM_ID]
3190
3377
  }] }, { type: Document, decorators: [{
3191
3378
  type: Inject,
3192
3379
  args: [DOCUMENT]
3193
- }] }, { type: i1$4.Router }, { type: StoreService }, { type: I18nService, decorators: [{
3380
+ }] }, { type: i1$1.Router }, { type: StoreService }, { type: I18nService, decorators: [{
3194
3381
  type: Optional
3195
3382
  }] }] });
3196
3383
 
@@ -3901,10 +4088,10 @@ class EuiTimezoneService {
3901
4088
  getTimezone(tz) {
3902
4089
  return EUI_TIMEZONES.find((item) => item.name === tz);
3903
4090
  }
3904
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiTimezoneService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3905
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiTimezoneService }); }
4091
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiTimezoneService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4092
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiTimezoneService }); }
3906
4093
  }
3907
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiTimezoneService, decorators: [{
4094
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiTimezoneService, decorators: [{
3908
4095
  type: Injectable
3909
4096
  }] });
3910
4097
 
@@ -4091,10 +4278,10 @@ class EuiThemeService {
4091
4278
  }
4092
4279
  }
4093
4280
  }
4094
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiThemeService, deps: [{ token: DOCUMENT }, { token: GLOBAL_CONFIG_TOKEN, optional: true }, { token: EuiAppShellService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4095
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiThemeService, providedIn: 'root' }); }
4281
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiThemeService, deps: [{ token: DOCUMENT }, { token: GLOBAL_CONFIG_TOKEN, optional: true }, { token: EuiAppShellService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4282
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiThemeService, providedIn: 'root' }); }
4096
4283
  }
4097
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiThemeService, decorators: [{
4284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiThemeService, decorators: [{
4098
4285
  type: Injectable,
4099
4286
  args: [{
4100
4287
  providedIn: 'root',
@@ -4243,10 +4430,10 @@ class LocalStorageService extends StorageService {
4243
4430
  }
4244
4431
  }
4245
4432
  }
4246
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocalStorageService, deps: [{ token: LogService, optional: true }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
4247
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocalStorageService }); }
4433
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocalStorageService, deps: [{ token: LogService, optional: true }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
4434
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocalStorageService }); }
4248
4435
  }
4249
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocalStorageService, decorators: [{
4436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocalStorageService, decorators: [{
4250
4437
  type: Injectable
4251
4438
  }], ctorParameters: () => [{ type: LogService, decorators: [{
4252
4439
  type: Optional
@@ -4321,10 +4508,10 @@ class SessionStorageService extends StorageService {
4321
4508
  }
4322
4509
  }
4323
4510
  }
4324
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: SessionStorageService, deps: [{ token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4325
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: SessionStorageService }); }
4511
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SessionStorageService, deps: [{ token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4512
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SessionStorageService }); }
4326
4513
  }
4327
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: SessionStorageService, decorators: [{
4514
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: SessionStorageService, decorators: [{
4328
4515
  type: Injectable
4329
4516
  }], ctorParameters: () => [{ type: LogService, decorators: [{
4330
4517
  type: Optional
@@ -4427,10 +4614,10 @@ class LocalForageService extends AsyncStorageService {
4427
4614
  },
4428
4615
  }));
4429
4616
  }
4430
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocalForageService, deps: [{ token: LOCAL_FORAGE_SERVICE_CONFIG_TOKEN, optional: true }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4431
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocalForageService }); }
4617
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocalForageService, deps: [{ token: LOCAL_FORAGE_SERVICE_CONFIG_TOKEN, optional: true }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4618
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocalForageService }); }
4432
4619
  }
4433
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocalForageService, decorators: [{
4620
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocalForageService, decorators: [{
4434
4621
  type: Injectable
4435
4622
  }], ctorParameters: () => [{ type: undefined, decorators: [{
4436
4623
  type: Inject,
@@ -4456,8 +4643,9 @@ const LOCALE_ID_MAPPER = new InjectionToken('localeIdMapper');
4456
4643
  * @extends EuiService<T | LocaleState>
4457
4644
  */
4458
4645
  class LocaleService extends EuiService {
4646
+ static { this.DEFAULT_STATE = { id: 'en-US' }; }
4459
4647
  constructor(store, baseGlobalConfig, locale_id, localeMapper, i18n, log) {
4460
- super({ id: getLocaleId(locale_id) });
4648
+ super({ id: locale_id || Intl.DateTimeFormat().resolvedOptions().locale });
4461
4649
  this.store = store;
4462
4650
  this.baseGlobalConfig = baseGlobalConfig;
4463
4651
  this.locale_id = locale_id;
@@ -4465,6 +4653,11 @@ class LocaleService extends EuiService {
4465
4653
  this.i18n = i18n;
4466
4654
  this.log = log;
4467
4655
  this.subNotifier = new Subject();
4656
+ /**
4657
+ * a single signal holding the state - initial state is null
4658
+ */
4659
+ this.state = signal(LocaleService.DEFAULT_STATE);
4660
+ this.injector = inject(Injector);
4468
4661
  if (log) {
4469
4662
  this.logger = log.getLogger('core.LocaleService');
4470
4663
  }
@@ -4481,46 +4674,55 @@ class LocaleService extends EuiService {
4481
4674
  /**
4482
4675
  * @param {((state: T) => K) | string} [keyOrMapFn] - Either a mapping function or a string key.
4483
4676
  * If a string is provided, it uses dot notation to access nested properties.
4484
- * @returns {Observable<K>} - An observable that emits the selected or transformed state.
4677
+ * @returns {Observable<Partial<K>>} - An observable that emits the selected or transformed state.
4485
4678
  *
4486
4679
  * If no parameter is provided, the method returns the entire state.
4487
4680
  * @param keyOrMapFn
4488
4681
  */
4489
4682
  getState(keyOrMapFn) {
4490
- let selector = getLocaleState;
4491
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4492
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4493
- const dotNotationToObject = (obj, key) => key.split('.').reduce((slice, i) => slice[i], obj);
4683
+ let computedState = computed(() => this.state());
4494
4684
  if (keyOrMapFn) {
4495
4685
  switch (typeof keyOrMapFn) {
4496
4686
  case 'function':
4497
- selector = createSelector(getLocaleState, keyOrMapFn);
4687
+ computedState = computed(() => {
4688
+ const state = this.state();
4689
+ return keyOrMapFn(state);
4690
+ });
4498
4691
  break;
4499
4692
  case 'string':
4500
- selector = createSelector(getLocaleState, (state) => dotNotationToObject(state, keyOrMapFn));
4693
+ computedState = computed(() => {
4694
+ const state = this.state();
4695
+ if (!keyOrMapFn) {
4696
+ return state;
4697
+ }
4698
+ const keys = keyOrMapFn.split('.');
4699
+ // Traverse the object based on the dot notation
4700
+ return keys.reduce((acc, currKey) => {
4701
+ return acc && acc[currKey] !== undefined ? acc[currKey] : undefined;
4702
+ }, state);
4703
+ });
4501
4704
  break;
4502
4705
  }
4503
4706
  }
4504
- return this.store.select(selector).pipe(takeUntil(this.subNotifier),
4505
- // in case service didn't init fallback to LOCALE_ID token value
4506
- map((state) => (state ? state : this.stateInstance ? this.stateInstance : this.locale_id)));
4707
+ // Use `runInInjectionContext` to ensure `toObservable` is within Angular injection context
4708
+ return runInInjectionContext(this.injector, () => toObservable(computedState).pipe(distinctUntilChanged((x, y) => isEqual(x, y))));
4507
4709
  }
4508
4710
  /**
4509
4711
  * Initializes the LocaleService with necessary configurations and state.
4510
4712
  * Binds language changes to the state and dynamically loads the appropriate locales.
4511
4713
  *
4512
- * @param {LocaleState | undefined} [state] - Optional initial state for the locale service.
4714
+ * @param {LocaleState} [state] - Optional initial state for the locale service.
4513
4715
  * @returns {Observable<EuiServiceStatus>} - Observable emitting the status of the initialization.
4514
4716
  */
4515
4717
  init(state) {
4516
4718
  super.initEuiService();
4719
+ state = state || { id: this.currentLocale };
4517
4720
  // bind language changes to locale changes
4518
4721
  if (this.config?.bindWithTranslate) {
4519
4722
  this.bindTranslateServiceLangChangeToState();
4520
4723
  }
4521
- // dynamically load locale based on provided configuration
4522
- const availableLocales = state?.available || this.config?.available || this.getBrowserLocales() || [this.currentLocale];
4523
- return this.loadLocale(availableLocales).pipe(takeUntil(this.subNotifier), tap(() => this.updateState(state || { id: this.currentLocale })));
4724
+ return of({ success: true })
4725
+ .pipe(tap(() => this.updateState(state)));
4524
4726
  }
4525
4727
  /**
4526
4728
  * Updates the locale state within the application. If the new state is not available,
@@ -4530,30 +4732,30 @@ class LocaleService extends EuiService {
4530
4732
  * @throws Will throw an error if the locale for the given state id is not available.
4531
4733
  */
4532
4734
  updateState(state) {
4533
- try {
4534
- const id = this.localeMapper(state.id);
4535
- this.store.dispatch(new UpdateLocaleStateAction({ ...state, id }));
4536
- // update global TOKEN ID based on configuration
4537
- if (this.config.affectGlobalLocale) {
4538
- this.locale_id = id;
4735
+ if (state?.id) {
4736
+ // check if locale is available otherwise throw error
4737
+ try {
4738
+ const id = this.localeMapper(state.id);
4739
+ this.state.update(currentState => super.deepMerge(currentState, { ...state, id }));
4539
4740
  }
4540
- }
4541
- catch (e) {
4542
- const message = `Locale for '${state.id}' is not available.
4543
- Please use addLocale('${state.id}') first`;
4544
- if (this.log) {
4545
- this.logger.info(message, e);
4741
+ catch (e) {
4742
+ const message = `Locale for '${state.id}' is not available.\n` +
4743
+ `Please use addLocale('${state.id}') first`;
4744
+ if (this.log) {
4745
+ this.logger.info(message, e);
4746
+ }
4747
+ throw new Error(message);
4546
4748
  }
4547
- throw new Error(message);
4749
+ }
4750
+ else {
4751
+ this.state.update(currentState => this.deepMerge(currentState, { ...state }));
4548
4752
  }
4549
4753
  }
4550
4754
  /**
4551
- * @deprecated eui does not offer a way to dynamically add locale it will be removed in future versions
4552
- *
4553
- * @param id
4755
+ * This method is used to get the state as readonly signal.
4554
4756
  */
4555
- addLocale(id) {
4556
- return this.loadLocale(id);
4757
+ getSignal() {
4758
+ return this.state.asReadonly();
4557
4759
  }
4558
4760
  /**
4559
4761
  * Retrieves the previous locale used in the application.
@@ -4571,19 +4773,6 @@ class LocaleService extends EuiService {
4571
4773
  get currentLocale() {
4572
4774
  return this.stateInstance?.id;
4573
4775
  }
4574
- /**
4575
- * @deprecated eui does not offer a way to dynamically add locale it will be removed in future versions
4576
- *
4577
- * Dynamically loads and registers locale data based on the given locale identifiers.
4578
- *
4579
- * @param {string[] | string} locale - An array of locale identifiers or a single locale identifier.
4580
- * @returns {Observable<EuiServiceStatus>} - Observable emitting the status of the loading process.
4581
- * @private
4582
- */
4583
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
4584
- loadLocale(locale) {
4585
- return of({ success: true });
4586
- }
4587
4776
  /**
4588
4777
  * Listens for language changes and dynamically sets the locale accordingly.
4589
4778
  *
@@ -4593,58 +4782,29 @@ class LocaleService extends EuiService {
4593
4782
  if (this.i18n) {
4594
4783
  this.i18n.onStateChange
4595
4784
  .pipe(takeUntil(this.subNotifier),
4596
- // filter out null values
4597
- filter((state) => state?.activeLang !== null && state?.activeLang !== undefined),
4598
- // BEWARE: filter is based on convention that locale id sliced(2) will match activeLang e.g. en-US => en
4599
- // Also, if activeLang is 'en' and locale is 'en-GB' it will not trigger locale change
4600
- filter((state) => state.activeLang.toLowerCase() !== this.stateInstance?.id.slice(0, 2).toLowerCase()),
4785
+ // Only processes state changes when the language actually changes
4786
+ // Example: With activeLang='en', ignores changes between 'en-US' and 'en-GB'
4787
+ // Checks: activeLang exists, has 2+ chars, and differs from current locale's primary language
4788
+ filter((state) => state?.activeLang !== null &&
4789
+ state?.activeLang !== undefined &&
4790
+ state?.activeLang.length > 1 &&
4791
+ state.activeLang.toLowerCase() !== this.stateInstance?.id.slice(0, 2).toLowerCase()),
4601
4792
  // to check if registration of locale otherwise register it
4602
- switchMap((value) => of(value).pipe(
4603
- // getLocaleId may throw Error(`Missing locale data for the locale "${locale}".`);
4604
- switchMap((i18state) => {
4605
- // check if activeLang is null or undefined
4606
- if (!i18state.activeLang) {
4607
- return throwError('Has i18nService initialized? If not make sure i18nService.init().subscribe(..)');
4608
- }
4609
- return of(this.localeMapper(i18state.activeLang));
4610
- }), catchError((error) => {
4611
- if (this.log) {
4612
- this.logger.debug(error);
4613
- }
4614
- return this.loadLocale(value?.activeLang).pipe(filter((s) => s.success), map(() => this.localeMapper(value?.activeLang)), catchError((e) => {
4615
- if (this.log) {
4616
- this.logger.debug('Something went terribly really wrong during locale loading', e.err.message);
4617
- }
4618
- return of(e);
4619
- }));
4620
- }))),
4793
+ map((state) => this.localeMapper(state.activeLang)),
4621
4794
  // update the "available" array attribute with newly registered
4622
4795
  switchMap((id) => this.getState().pipe(take(1), map((state) => {
4623
4796
  const available = state['available'] ? state['available'] : [];
4624
4797
  return { ...state, id, available: Array.from(new Set([...available, id])) };
4625
4798
  }))))
4626
4799
  .subscribe((state) => {
4627
- this.updateState(state);
4800
+ return this.updateState(state);
4628
4801
  });
4629
4802
  }
4630
4803
  }
4631
- /**
4632
- * Retrieves an array of locale identifiers supported by the browser.
4633
- *
4634
- * @returns {string[] | undefined} - An array of browser locale identifiers or undefined if not available.
4635
- * @private
4636
- */
4637
- getBrowserLocales() {
4638
- const browserLocales = navigator.languages === undefined ? [navigator.language] : navigator.languages;
4639
- if (!browserLocales) {
4640
- return undefined;
4641
- }
4642
- return browserLocales.map((locale) => locale.trim());
4643
- }
4644
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocaleService, deps: [{ token: StoreService }, { token: GLOBAL_CONFIG_TOKEN }, { token: LOCALE_ID }, { token: LOCALE_ID_MAPPER, optional: true }, { token: I18nService, optional: true }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4645
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocaleService, providedIn: 'root' }); }
4804
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocaleService, deps: [{ token: StoreService }, { token: GLOBAL_CONFIG_TOKEN }, { token: LOCALE_ID }, { token: LOCALE_ID_MAPPER, optional: true }, { token: I18nService, optional: true }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4805
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocaleService, providedIn: 'root' }); }
4646
4806
  }
4647
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocaleService, decorators: [{
4807
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocaleService, decorators: [{
4648
4808
  type: Injectable,
4649
4809
  args: [{
4650
4810
  providedIn: 'root',
@@ -4668,7 +4828,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ng
4668
4828
 
4669
4829
  class LocaleServiceMock extends LocaleService {
4670
4830
  constructor(locale_id) {
4671
- super(null, { locale: { available: [] } }, locale_id, null, null, null);
4831
+ super(null, { locale: {} }, locale_id, null, null, null);
4672
4832
  this.locale_id = locale_id;
4673
4833
  this.DEFAULT_LOCALE = 'en';
4674
4834
  this.stateSubject = new BehaviorSubject({ id: this.DEFAULT_LOCALE });
@@ -4690,10 +4850,10 @@ class LocaleServiceMock extends LocaleService {
4690
4850
  this.DEFAULT_LOCALE = state.id || 'en';
4691
4851
  return of({ success: true });
4692
4852
  }
4693
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocaleServiceMock, deps: [{ token: LOCALE_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4694
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocaleServiceMock }); }
4853
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocaleServiceMock, deps: [{ token: LOCALE_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4854
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocaleServiceMock }); }
4695
4855
  }
4696
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: LocaleServiceMock, decorators: [{
4856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LocaleServiceMock, decorators: [{
4697
4857
  type: Injectable
4698
4858
  }], ctorParameters: () => [{ type: undefined, decorators: [{
4699
4859
  type: Optional
@@ -4987,10 +5147,10 @@ class EuiLoaderService {
4987
5147
  this.loadStyle(dependency);
4988
5148
  }
4989
5149
  }
4990
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4991
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiLoaderService, providedIn: 'root' }); }
5150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5151
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiLoaderService, providedIn: 'root' }); }
4992
5152
  }
4993
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuiLoaderService, decorators: [{
5153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuiLoaderService, decorators: [{
4994
5154
  type: Injectable,
4995
5155
  args: [{
4996
5156
  providedIn: 'root',
@@ -4998,53 +5158,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ng
4998
5158
  }] });
4999
5159
 
5000
5160
  class UserService extends EuiService {
5161
+ static { this.DEFAULT_STATE = { userId: 'annonymous' }; }
5001
5162
  constructor(store) {
5002
- super({ userId: 'annonymous' });
5163
+ super(UserService.DEFAULT_STATE);
5003
5164
  this.store = store;
5165
+ /**
5166
+ * a single signal holding the state - initial state is null
5167
+ */
5168
+ this.state = signal(UserService.DEFAULT_STATE);
5169
+ this.injector = inject(Injector);
5004
5170
  }
5005
- init(userState) {
5171
+ init(state) {
5006
5172
  super.initEuiService();
5007
- if (Object.prototype.hasOwnProperty.call(userState, 'userId')) {
5008
- this.updateState(userState);
5009
- return of({ success: true });
5173
+ if (Object.prototype.hasOwnProperty.call(state, 'userId')) {
5174
+ this.updateState(state);
5175
+ return of$1({ success: true });
5010
5176
  }
5011
- return of({ success: false, error: 'Init object should be instance of BaseUserState' });
5177
+ return of$1({ success: false, error: 'Init object should be instance of BaseUserState' });
5012
5178
  }
5013
5179
  getState(keyOrMapFn) {
5014
- let selector = getUserState;
5015
- const dotNotationToObject = (obj, key) => key.split('.').reduce((slice, i) => slice[i], obj);
5180
+ let computedState = computed(() => this.state());
5016
5181
  if (keyOrMapFn) {
5017
5182
  switch (typeof keyOrMapFn) {
5018
5183
  case 'function':
5019
- selector = createSelector(getUserState, keyOrMapFn);
5184
+ computedState = computed(() => {
5185
+ const state = this.state();
5186
+ return keyOrMapFn(state);
5187
+ });
5020
5188
  break;
5021
5189
  case 'string':
5022
- selector = createSelector(getUserState, (state) => dotNotationToObject(state, keyOrMapFn));
5190
+ computedState = computed(() => {
5191
+ const state = this.state();
5192
+ const keys = keyOrMapFn.split('.');
5193
+ // Traverse the object based on the dot notation
5194
+ return keys.reduce((acc, currKey) => {
5195
+ return acc && acc[currKey] !== undefined ? acc[currKey] : undefined;
5196
+ }, state);
5197
+ });
5023
5198
  break;
5024
5199
  }
5025
5200
  }
5026
- return this.store.select(selector);
5201
+ // Use `runInInjectionContext` to ensure `toObservable` is within Angular injection context
5202
+ return runInInjectionContext(this.injector, () => toObservable(computedState).pipe(distinctUntilChanged((x, y) => isEqual(x, y))));
5027
5203
  }
5028
- updateState(userState, reducer) {
5029
- // if (typeof pathOrReducer === 'string') {
5030
- // let dotNotationToObject = (obj, key) => key.split('.').reduce((obj, i) => obj[i], obj);
5031
- //
5032
- // const customReducer = (state: UserState, action: UpdateUserDetailsAction): UserState => {
5033
- // return Object.assign({}, dotNotationToObject(state, pathOrReducer), action.payload);
5034
- // };
5035
- // this.store.dispatchAction(userState, 'user', customReducer);
5036
- // }
5204
+ updateState(state, reducer) {
5037
5205
  if (reducer) {
5038
- this.store.dispatchAction(userState, 'user', reducer);
5206
+ this.state.update(currentState => {
5207
+ const newState = reducer(currentState, state);
5208
+ return {
5209
+ ...newState,
5210
+ };
5211
+ });
5039
5212
  }
5040
5213
  else {
5041
- this.store.dispatch(new UpdateUserStateAction(userState));
5214
+ this.state.update(currentState => this.deepMerge(currentState, { ...state }));
5042
5215
  }
5043
5216
  }
5044
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UserService, deps: [{ token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
5045
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UserService, providedIn: 'root' }); }
5217
+ /**
5218
+ * This method is used to get the signal of the service.
5219
+ */
5220
+ getSignal() {
5221
+ return this.state.asReadonly();
5222
+ }
5223
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UserService, deps: [{ token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
5224
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UserService, providedIn: 'root' }); }
5046
5225
  }
5047
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UserService, decorators: [{
5226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UserService, decorators: [{
5048
5227
  type: Injectable,
5049
5228
  args: [{
5050
5229
  providedIn: 'root',
@@ -5064,10 +5243,10 @@ class UserServiceMock extends UserService {
5064
5243
  updateState(userState, reducer) {
5065
5244
  /* empty */
5066
5245
  }
5067
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UserServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5068
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UserServiceMock }); }
5246
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UserServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5247
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UserServiceMock }); }
5069
5248
  }
5070
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UserServiceMock, decorators: [{
5249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UserServiceMock, decorators: [{
5071
5250
  type: Injectable
5072
5251
  }], ctorParameters: () => [] });
5073
5252
 
@@ -5096,12 +5275,12 @@ class AddLangParamInterceptor {
5096
5275
  params: req.params.set(langParam, langValue),
5097
5276
  }));
5098
5277
  }
5099
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: AddLangParamInterceptor, deps: [{ token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
5100
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: AddLangParamInterceptor }); }
5278
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AddLangParamInterceptor, deps: [{ token: i1$3.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
5279
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AddLangParamInterceptor }); }
5101
5280
  }
5102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: AddLangParamInterceptor, decorators: [{
5281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AddLangParamInterceptor, decorators: [{
5103
5282
  type: Injectable
5104
- }], ctorParameters: () => [{ type: i1$2.TranslateService }] });
5283
+ }], ctorParameters: () => [{ type: i1$3.TranslateService }] });
5105
5284
 
5106
5285
  class CachePreventionInterceptor {
5107
5286
  intercept(req, next) {
@@ -5115,10 +5294,10 @@ class CachePreventionInterceptor {
5115
5294
  headers: req.headers.set('Cache-Control', 'No-Cache'),
5116
5295
  }));
5117
5296
  }
5118
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CachePreventionInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5119
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CachePreventionInterceptor }); }
5297
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CachePreventionInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5298
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CachePreventionInterceptor }); }
5120
5299
  }
5121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CachePreventionInterceptor, decorators: [{
5300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CachePreventionInterceptor, decorators: [{
5122
5301
  type: Injectable
5123
5302
  }] });
5124
5303
 
@@ -5128,10 +5307,10 @@ class CorsSecurityInterceptor {
5128
5307
  withCredentials: true,
5129
5308
  }));
5130
5309
  }
5131
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CorsSecurityInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5132
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CorsSecurityInterceptor }); }
5310
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CorsSecurityInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5311
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CorsSecurityInterceptor }); }
5133
5312
  }
5134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CorsSecurityInterceptor, decorators: [{
5313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CorsSecurityInterceptor, decorators: [{
5135
5314
  type: Injectable
5136
5315
  }] });
5137
5316
 
@@ -5141,10 +5320,10 @@ class CsrfPreventionInterceptor {
5141
5320
  headers: request.headers.set('X-Requested-With', 'XMLHttpRequest'),
5142
5321
  }));
5143
5322
  }
5144
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CsrfPreventionInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5145
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CsrfPreventionInterceptor }); }
5323
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CsrfPreventionInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5324
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CsrfPreventionInterceptor }); }
5146
5325
  }
5147
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: CsrfPreventionInterceptor, decorators: [{
5326
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: CsrfPreventionInterceptor, decorators: [{
5148
5327
  type: Injectable
5149
5328
  }] });
5150
5329
 
@@ -5211,10 +5390,10 @@ class EuLoginSessionTimeoutHandlingInterceptor {
5211
5390
  reauthenticate() {
5212
5391
  document.location.reload();
5213
5392
  }
5214
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5215
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor }); }
5393
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5394
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor }); }
5216
5395
  }
5217
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor, decorators: [{
5396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor, decorators: [{
5218
5397
  type: Injectable
5219
5398
  }] });
5220
5399
 
@@ -5238,10 +5417,10 @@ class UxRequestErrorModelInterceptor {
5238
5417
  return of(err);
5239
5418
  }));
5240
5419
  }
5241
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UxRequestErrorModelInterceptor, deps: [{ token: UX_ERROR_MAPPING_HANDLER_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
5242
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UxRequestErrorModelInterceptor }); }
5420
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UxRequestErrorModelInterceptor, deps: [{ token: UX_ERROR_MAPPING_HANDLER_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
5421
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UxRequestErrorModelInterceptor }); }
5243
5422
  }
5244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ngImport: i0, type: UxRequestErrorModelInterceptor, decorators: [{
5423
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: UxRequestErrorModelInterceptor, decorators: [{
5245
5424
  type: Injectable
5246
5425
  }], ctorParameters: () => [{ type: undefined, decorators: [{
5247
5426
  type: Inject,
@@ -5254,5 +5433,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.1", ng
5254
5433
  * Generated bundle index. Do not edit.
5255
5434
  */
5256
5435
 
5257
- export { ActivatedRouteAction, AddApiQueueItemAction, AddAppLoadedConfigModulesAction, AddLangParamInterceptor, AlertHttpErrorCallbackFn, ApiQueueService, ApiQueueServiceMock, AsyncStorageService, AsyncStorageServiceMock, BASE_LOGGER_NAME_TOKEN, BASE_NAME_TOKEN, BrowserStorageType, CONFIG_TOKEN, CORE_ROOT_GUARD, CachePreventionInterceptor, ConsoleHttpErrorCallbackFn, CoreAppActionTypes, CoreAppEffects, CoreI18nActionTypes, CoreLocaleActionTypes, CoreModule, CoreModuleEffects, CoreNotificationsActionTypes, CoreUserActionTypes, CorsSecurityInterceptor, CsrfPreventionInterceptor, CssUtils, DYNAMIC_COMPONENT_CONFIG, EUI_CONFIG_TOKEN, EUI_COUNTRIES, EUI_TIMEZONES, EmptyApiQueueAction, ErrorSubClass, EuLoginSessionTimeoutHandlingInterceptor, EuiAppShellService, EuiCoreRootGuardClass, EuiDynamicComponentService, EuiDynamicMenuService, EuiError, EuiGrowlService, EuiLoaderService, EuiPermissionService, EuiTheme, EuiThemeService, EuiTimezoneService, GLOBAL_CONFIG_TOKEN, GlobalErrorHandler, GrowlHttpErrorCallbackFn, HTTP_ERROR_HANDLER_CONFIG_TOKEN, HttpErrorHandlerInterceptor, I18nLoader, I18nResourceImpl, I18nService, InitStoreAction, LANG_PARAM_KEY, LOCALE_ID_MAPPER, LOCAL_FORAGE_SERVICE_CONFIG_TOKEN, LOG_APPENDERS_TOKEN, LOG_LEVEL_TOKEN, LocalForageService, LocalStorageService, LocaleService, LocaleServiceMock, LogHttpErrorCallbackFn, LogModule, LogService, LogServiceMock, MODULE_CONFIG_TOKEN, MODULE_NAME_TOKEN, PLATFORM_BROWSER_ID, ROOT_LOG_CONFIG_TOKEN, RemoveApiQueueItemAction, SHOW_CONNECTION_STATUS_TOKEN, SessionStorageService, Status, StorageService, StorageServiceMock, StoreService, StoreServiceMock, UX_ERROR_MAPPING_HANDLER_TOKEN, UpdateAppConnectionAction, UpdateAppStatusAction, UpdateAppVersionAction, UpdateCurrentModuleAction, UpdateI18nStateAction, UpdateLocaleStateAction, UpdateNotificationsListAction, UpdateUserDashboardAction, UpdateUserDetailsAction, UpdateUserPreferencesAction, UpdateUserRightsAction, UpdateUserStateAction, UserService, UserServiceMock, UxRequestErrorModelInterceptor, closestMatchingParent, consumeEvent, corI18nReducers, coreAppReducers, coreLocaleReducers, coreNotificationsReducers, coreUserReducers, createEuiCoreRootGuard, diffDays, diffDaysFromToday, errorCodes, euiCoreRootGuardClass, formatNumber, getGlobalConfig, getHttpErrorHandlingConfig, getModuleConfig, getRootLogConfig, getShowConnectionStatus, getViewElement, handleError, isDefined, loadEuiDynamicEnvironmentConfig, loadState, localForage, localStorageSync, markControlsTouched, markFormGroupTouched, mergeAppHandlerConfigToAppConfig, mergeAppJsonConfigToAppConfig, offset, parentOffsetEl, position, preInitApp, prepareEuiAppConfigToken, coreReducers as reducers, sessionStorageSync, translateConfig, uniqueId, validateEmail };
5436
+ export { ActivatedRouteAction, AddApiQueueItemAction, AddAppLoadedConfigModulesAction, AddLangParamInterceptor, AlertHttpErrorCallbackFn, ApiQueueService, ApiQueueServiceMock, AsyncStorageService, AsyncStorageServiceMock, BASE_LOGGER_NAME_TOKEN, BASE_NAME_TOKEN, BrowserStorageType, CONFIG_TOKEN, CORE_ROOT_GUARD, CachePreventionInterceptor, ConsoleHttpErrorCallbackFn, CoreAppActionTypes, CoreI18nActionTypes, CoreLocaleActionTypes, CoreModule, CoreNotificationsActionTypes, CoreUserActionTypes, CorsSecurityInterceptor, CsrfPreventionInterceptor, CssUtils, DYNAMIC_COMPONENT_CONFIG, EUI_CONFIG_TOKEN, EUI_COUNTRIES, EUI_TIMEZONES, EmptyApiQueueAction, ErrorSubClass, EuLoginSessionTimeoutHandlingInterceptor, EuiAppShellService, EuiCoreRootGuardClass, EuiDynamicComponentService, EuiDynamicMenuService, EuiError, EuiGrowlService, EuiLoaderService, EuiPermissionService, EuiTheme, EuiThemeService, EuiTimezoneService, GLOBAL_CONFIG_TOKEN, GlobalErrorHandler, GrowlHttpErrorCallbackFn, HTTP_ERROR_HANDLER_CONFIG_TOKEN, HttpErrorHandlerInterceptor, I18nLoader, I18nResourceImpl, I18nService, InitStoreAction, LANG_PARAM_KEY, LOCALE_ID_MAPPER, LOCAL_FORAGE_SERVICE_CONFIG_TOKEN, LOG_APPENDERS_TOKEN, LOG_LEVEL_TOKEN, LocalForageService, LocalStorageService, LocaleService, LocaleServiceMock, LogHttpErrorCallbackFn, LogModule, LogService, LogServiceMock, MODULE_CONFIG_TOKEN, MODULE_NAME_TOKEN, PLATFORM_BROWSER_ID, ROOT_LOG_CONFIG_TOKEN, RemoveApiQueueItemAction, SHOW_CONNECTION_STATUS_TOKEN, SessionStorageService, Status, StorageService, StorageServiceMock, StoreService, StoreServiceMock, UX_ERROR_MAPPING_HANDLER_TOKEN, UpdateAppConnectionAction, UpdateAppStatusAction, UpdateAppVersionAction, UpdateCurrentModuleAction, UpdateI18nStateAction, UpdateLocaleStateAction, UpdateNotificationsListAction, UpdateUserDashboardAction, UpdateUserDetailsAction, UpdateUserPreferencesAction, UpdateUserRightsAction, UpdateUserStateAction, UserService, UserServiceMock, UxRequestErrorModelInterceptor, closestMatchingParent, consumeEvent, corI18nReducers, coreAppReducers, coreLocaleReducers, coreNotificationsReducers, coreUserReducers, createEuiCoreRootGuard, diffDays, diffDaysFromToday, errorCodes, euiCoreRootGuardClass, euiInitApp, formatNumber, getGlobalConfig, getHttpErrorHandlingConfig, getModuleConfig, getRootLogConfig, getShowConnectionStatus, getViewElement, handleError, isDefined, loadEuiDynamicEnvironmentConfig, loadState, localForage, localStorageSync, markControlsTouched, markFormGroupTouched, mergeAppHandlerConfigToAppConfig, mergeAppJsonConfigToAppConfig, offset, parentOffsetEl, position, preInitApp, prepareEuiAppConfigToken, provideEuiInitializer, coreReducers as reducers, sessionStorageSync, translateConfig, uniqueId, validateEmail };
5258
5437
  //# sourceMappingURL=eui-core.mjs.map