@eui/core 17.0.0-next.8 → 17.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 (332) hide show
  1. package/assets/i18n-eui/bg.json +1 -0
  2. package/assets/i18n-eui/cs.json +1 -0
  3. package/assets/i18n-eui/da.json +1 -0
  4. package/assets/i18n-eui/de.json +1 -0
  5. package/assets/i18n-eui/el.json +1 -0
  6. package/assets/i18n-eui/en.json +1 -0
  7. package/assets/i18n-eui/es.json +1 -0
  8. package/assets/i18n-eui/et.json +1 -0
  9. package/assets/i18n-eui/fi.json +1 -0
  10. package/assets/i18n-eui/fr.json +1 -0
  11. package/assets/i18n-eui/ga.json +1 -0
  12. package/assets/i18n-eui/hr.json +1 -0
  13. package/assets/i18n-eui/hu.json +1 -1
  14. package/assets/i18n-eui/it.json +1 -0
  15. package/assets/i18n-eui/lt.json +1 -1
  16. package/assets/i18n-eui/lv.json +1 -0
  17. package/assets/i18n-eui/mt.json +1 -0
  18. package/assets/i18n-eui/nl.json +1 -0
  19. package/assets/i18n-eui/pl.json +1 -0
  20. package/assets/i18n-eui/pt.json +1 -0
  21. package/assets/i18n-eui/ro.json +1 -1
  22. package/assets/i18n-eui/sk.json +1 -0
  23. package/assets/i18n-eui/sl.json +1 -0
  24. package/assets/i18n-eui/sv.json +1 -0
  25. package/docs/classes/ActivatedRouteAction.html +282 -0
  26. package/docs/classes/AddApiQueueItemAction.html +282 -0
  27. package/docs/classes/AddAppLoadedConfigModulesAction.html +282 -0
  28. package/docs/classes/ApiQueueServiceMock.html +545 -0
  29. package/docs/classes/AsyncStorageService.html +923 -0
  30. package/docs/classes/AsyncStorageServiceMock.html +427 -0
  31. package/docs/classes/EmptyApiQueueAction.html +282 -0
  32. package/docs/classes/ErrorSubClass.html +357 -0
  33. package/docs/classes/EuiCoreRootGuardClass.html +167 -0
  34. package/docs/classes/EuiError.html +363 -0
  35. package/docs/classes/I18nResourceImpl.html +506 -0
  36. package/docs/classes/InitStoreAction.html +282 -0
  37. package/docs/classes/LogServiceMock.html +223 -0
  38. package/docs/classes/OpenIdConnectServiceMock.html +223 -0
  39. package/docs/classes/RemoveApiQueueItemAction.html +282 -0
  40. package/docs/classes/RouterMock.html +482 -0
  41. package/docs/classes/StorageService.html +630 -0
  42. package/docs/classes/StorageServiceMock.html +316 -0
  43. package/docs/classes/StoreMock.html +391 -0
  44. package/docs/classes/TranslateServiceMock.html +907 -0
  45. package/docs/classes/UpdateAppConnectionAction.html +282 -0
  46. package/docs/classes/UpdateAppStatusAction.html +282 -0
  47. package/docs/classes/UpdateAppVersionAction.html +282 -0
  48. package/docs/classes/UpdateCurrentModuleAction.html +282 -0
  49. package/docs/classes/UpdateI18nStateAction.html +282 -0
  50. package/docs/classes/UpdateLocaleStateAction.html +282 -0
  51. package/docs/classes/UpdateNotificationsListAction.html +282 -0
  52. package/docs/classes/UpdateUserDashboardAction.html +282 -0
  53. package/docs/classes/UpdateUserDetailsAction.html +282 -0
  54. package/docs/classes/UpdateUserPreferencesAction.html +282 -0
  55. package/docs/classes/UpdateUserRightsAction.html +282 -0
  56. package/docs/classes/UpdateUserStateAction.html +282 -0
  57. package/docs/dependencies.html +337 -0
  58. package/docs/directives/TranslateMockDirective.html +266 -0
  59. package/docs/fonts/ionicons.eot +0 -0
  60. package/docs/fonts/ionicons.svg +2090 -0
  61. package/docs/fonts/ionicons.ttf +0 -0
  62. package/docs/fonts/ionicons.woff +0 -0
  63. package/docs/fonts/ionicons.woff2 +0 -0
  64. package/docs/fonts/roboto-v15-latin-300.eot +0 -0
  65. package/docs/fonts/roboto-v15-latin-300.svg +314 -0
  66. package/docs/fonts/roboto-v15-latin-300.ttf +0 -0
  67. package/docs/fonts/roboto-v15-latin-300.woff +0 -0
  68. package/docs/fonts/roboto-v15-latin-300.woff2 +0 -0
  69. package/docs/fonts/roboto-v15-latin-700.eot +0 -0
  70. package/docs/fonts/roboto-v15-latin-700.svg +310 -0
  71. package/docs/fonts/roboto-v15-latin-700.ttf +0 -0
  72. package/docs/fonts/roboto-v15-latin-700.woff +0 -0
  73. package/docs/fonts/roboto-v15-latin-700.woff2 +0 -0
  74. package/docs/fonts/roboto-v15-latin-italic.eot +0 -0
  75. package/docs/fonts/roboto-v15-latin-italic.svg +323 -0
  76. package/docs/fonts/roboto-v15-latin-italic.ttf +0 -0
  77. package/docs/fonts/roboto-v15-latin-italic.woff +0 -0
  78. package/docs/fonts/roboto-v15-latin-italic.woff2 +0 -0
  79. package/docs/fonts/roboto-v15-latin-regular.eot +0 -0
  80. package/docs/fonts/roboto-v15-latin-regular.svg +308 -0
  81. package/docs/fonts/roboto-v15-latin-regular.ttf +0 -0
  82. package/docs/fonts/roboto-v15-latin-regular.woff +0 -0
  83. package/docs/fonts/roboto-v15-latin-regular.woff2 +0 -0
  84. package/docs/images/compodoc-vectorise-inverted.png +0 -0
  85. package/docs/images/compodoc-vectorise-inverted.svg +201 -0
  86. package/docs/images/compodoc-vectorise.png +0 -0
  87. package/docs/images/compodoc-vectorise.svg +201 -0
  88. package/docs/images/favicon.ico +0 -0
  89. package/docs/index.html +171 -0
  90. package/docs/injectables/ApiQueueService.html +784 -0
  91. package/docs/injectables/CoreAppEffects.html +390 -0
  92. package/docs/injectables/EuiAppShellService.html +2822 -0
  93. package/docs/injectables/EuiDynamicComponentService.html +433 -0
  94. package/docs/injectables/EuiDynamicMenuService.html +377 -0
  95. package/docs/injectables/EuiGrowlService.html +821 -0
  96. package/docs/injectables/EuiPermissionService.html +642 -0
  97. package/docs/injectables/EuiTimezoneService.html +378 -0
  98. package/docs/injectables/GlobalErrorHandler.html +291 -0
  99. package/docs/injectables/I18nLoader.html +589 -0
  100. package/docs/injectables/I18nService.html +991 -0
  101. package/docs/injectables/I18nServiceMock.html +626 -0
  102. package/docs/injectables/LocalForageService.html +761 -0
  103. package/docs/injectables/LocalStorageService.html +548 -0
  104. package/docs/injectables/LocaleService.html +753 -0
  105. package/docs/injectables/LocaleServiceMock.html +453 -0
  106. package/docs/injectables/LogService.html +351 -0
  107. package/docs/injectables/OpenIdConnectService.html +225 -0
  108. package/docs/injectables/SessionStorageService.html +548 -0
  109. package/docs/injectables/StoreService.html +641 -0
  110. package/docs/injectables/StoreServiceMock.html +455 -0
  111. package/docs/injectables/UserService.html +738 -0
  112. package/docs/injectables/UserServiceMock.html +708 -0
  113. package/docs/interceptors/AddLangParamInterceptor.html +311 -0
  114. package/docs/interceptors/CachePreventionInterceptor.html +260 -0
  115. package/docs/interceptors/CorsSecurityInterceptor.html +260 -0
  116. package/docs/interceptors/CsrfPreventionInterceptor.html +260 -0
  117. package/docs/interceptors/EuLoginSessionTimeoutHandlingInterceptor.html +260 -0
  118. package/docs/interceptors/HttpErrorHandlerInterceptor.html +319 -0
  119. package/docs/interceptors/OpenIdConnectInterceptor.html +345 -0
  120. package/docs/interceptors/UxRequestErrorModelInterceptor.html +295 -0
  121. package/docs/interfaces/EuiTimeZone.html +247 -0
  122. package/docs/interfaces/LoadedResources.html +292 -0
  123. package/docs/interfaces/LoadedResourcesError.html +247 -0
  124. package/docs/interfaces/ModuleLoadEvent.html +292 -0
  125. package/docs/interfaces/OpenIdConnectUserDetails.html +439 -0
  126. package/docs/interfaces/ResourceError.html +298 -0
  127. package/docs/interfaces/UIState.html +1810 -0
  128. package/docs/js/compodoc.js +14 -0
  129. package/docs/js/lazy-load-graphs.js +44 -0
  130. package/docs/js/libs/EventDispatcher.js +5 -0
  131. package/docs/js/libs/bootstrap-native.js +1 -0
  132. package/docs/js/libs/clipboard.min.js +7 -0
  133. package/docs/js/libs/custom-elements-es5-adapter.js +15 -0
  134. package/docs/js/libs/custom-elements.min.js +38 -0
  135. package/docs/js/libs/d3.v3.min.js +2 -0
  136. package/docs/js/libs/deep-iterator.js +2 -0
  137. package/docs/js/libs/es6-shim.min.js +11 -0
  138. package/docs/js/libs/htmlparser.js +23 -0
  139. package/docs/js/libs/innersvg.js +9 -0
  140. package/docs/js/libs/lit-html.js +1 -0
  141. package/docs/js/libs/prism.js +46 -0
  142. package/docs/js/libs/promise.min.js +6 -0
  143. package/docs/js/libs/svg-pan-zoom.min.js +3 -0
  144. package/docs/js/libs/tablesort.min.js +6 -0
  145. package/docs/js/libs/tablesort.number.min.js +6 -0
  146. package/docs/js/libs/vis.min.js +47 -0
  147. package/docs/js/libs/zepto.min.js +2 -0
  148. package/docs/js/menu-wc.js +377 -0
  149. package/docs/js/menu-wc_es5.js +42 -0
  150. package/docs/js/menu.js +325 -0
  151. package/docs/js/routes.js +301 -0
  152. package/docs/js/search/lunr.min.js +6 -0
  153. package/docs/js/search/search-lunr.js +67 -0
  154. package/docs/js/search/search.js +268 -0
  155. package/docs/js/search/search_index.js +4 -0
  156. package/docs/js/sourceCode.js +58 -0
  157. package/docs/js/svg-pan-zoom.controls.js +53 -0
  158. package/docs/js/tabs.js +21 -0
  159. package/docs/js/tree.js +147 -0
  160. package/docs/license.html +379 -0
  161. package/docs/miscellaneous/enumerations.html +418 -0
  162. package/docs/miscellaneous/functions.html +1796 -0
  163. package/docs/miscellaneous/typealiases.html +258 -0
  164. package/docs/miscellaneous/variables.html +3967 -0
  165. package/docs/modules/CoreModule.html +254 -0
  166. package/docs/modules/I18nModule.html +198 -0
  167. package/docs/modules/LogModule.html +301 -0
  168. package/docs/modules/TranslateMockModule.html +176 -0
  169. package/docs/modules.html +168 -0
  170. package/docs/pipes/TranslateMockPipe.html +225 -0
  171. package/docs/properties.html +124 -0
  172. package/docs/styles/bootstrap-card.css +219 -0
  173. package/docs/styles/bootstrap.min.css +6 -0
  174. package/docs/styles/compodoc.css +1121 -0
  175. package/docs/styles/dark.css +121 -0
  176. package/docs/styles/ionicons.min.css +11 -0
  177. package/docs/styles/laravel.css +113 -0
  178. package/docs/styles/material.css +131 -0
  179. package/docs/styles/original.css +51 -0
  180. package/docs/styles/postmark.css +238 -0
  181. package/docs/styles/prism.css +301 -0
  182. package/docs/styles/readthedocs.css +117 -0
  183. package/docs/styles/reset.css +129 -0
  184. package/docs/styles/stripe.css +106 -0
  185. package/docs/styles/style.css +7 -0
  186. package/docs/styles/tablesort.css +33 -0
  187. package/docs/styles/vagrant.css +130 -0
  188. package/esm2022/lib/eui-core.module.mjs +7 -7
  189. package/esm2022/lib/helpers/date-helpers.mjs +1 -1
  190. package/esm2022/lib/helpers/dom-helpers.mjs +10 -8
  191. package/esm2022/lib/helpers/event-helpers.mjs +1 -1
  192. package/esm2022/lib/helpers/form-helpers.mjs +1 -1
  193. package/esm2022/lib/helpers/format-helpers.mjs +6 -5
  194. package/esm2022/lib/helpers/http-helpers.mjs +3 -5
  195. package/esm2022/lib/interceptors/add-lang-param.interceptor.mjs +4 -4
  196. package/esm2022/lib/interceptors/cache-prevention.interceptor.mjs +4 -4
  197. package/esm2022/lib/interceptors/cors-security.interceptor.mjs +4 -4
  198. package/esm2022/lib/interceptors/csrf-prevention.interceptor.mjs +4 -4
  199. package/esm2022/lib/interceptors/eu-login-session-timeout-handling.interceptor.mjs +13 -6
  200. package/esm2022/lib/interceptors/openid/openid-connect.interceptor.mjs +37 -8
  201. package/esm2022/lib/interceptors/openid/openid-connect.service.mjs +6 -4
  202. package/esm2022/lib/interceptors/ux-request-error-model.interceptor.mjs +10 -5
  203. package/esm2022/lib/services/app/eui-init-app.mjs +2 -2
  204. package/esm2022/lib/services/app/eui-pre-init-app.mjs +1 -1
  205. package/esm2022/lib/services/app/factories/log.mjs +1 -1
  206. package/esm2022/lib/services/config/tokens.mjs +3 -1
  207. package/esm2022/lib/services/dynamic-component/dynamic-component.service.mjs +9 -4
  208. package/esm2022/lib/services/dynamic-menu/dynamic-menu.service.mjs +8 -5
  209. package/esm2022/lib/services/errors/eui.error.mjs +5 -1
  210. package/esm2022/lib/services/errors/global-error-handler.mjs +7 -5
  211. package/esm2022/lib/services/errors/http-error-handler-callback-functions.mjs +2 -2
  212. package/esm2022/lib/services/errors/http-error-handler.interceptor.mjs +24 -17
  213. package/esm2022/lib/services/eui-app-shell.service.mjs +123 -15
  214. package/esm2022/lib/services/eui-timezone.service.mjs +4 -4
  215. package/esm2022/lib/services/growl/eui-growl.service.mjs +4 -4
  216. package/esm2022/lib/services/i18n/i18n.loader.mjs +16 -5
  217. package/esm2022/lib/services/i18n/i18n.resource.mjs +8 -3
  218. package/esm2022/lib/services/i18n/i18n.service.mjs +17 -19
  219. package/esm2022/lib/services/i18n/index.mjs +2 -2
  220. package/esm2022/lib/services/locale/locale.service.mjs +7 -5
  221. package/esm2022/lib/services/locale/locale.service.mock.mjs +4 -4
  222. package/esm2022/lib/services/log/log.module.mjs +5 -5
  223. package/esm2022/lib/services/log/log.service.mjs +4 -4
  224. package/esm2022/lib/services/log/log.service.mock.mjs +1 -1
  225. package/esm2022/lib/services/permission/permission.service.mjs +5 -5
  226. package/esm2022/lib/services/queue/api-queue.service.mjs +20 -8
  227. package/esm2022/lib/services/queue/api-queue.service.mock.mjs +5 -1
  228. package/esm2022/lib/services/storage/async-storage.service.mjs +1 -1
  229. package/esm2022/lib/services/storage/async-storage.service.mock.mjs +9 -1
  230. package/esm2022/lib/services/storage/local-forage.service.mjs +43 -18
  231. package/esm2022/lib/services/storage/local-storage.service.mjs +8 -4
  232. package/esm2022/lib/services/storage/session-storage.service.mjs +8 -4
  233. package/esm2022/lib/services/storage/storage.service.mjs +1 -1
  234. package/esm2022/lib/services/storage/storage.service.mock.mjs +1 -1
  235. package/esm2022/lib/services/store/actions/app.actions.mjs +3 -1
  236. package/esm2022/lib/services/store/actions/notifications.actions.mjs +3 -1
  237. package/esm2022/lib/services/store/actions/user.actions.mjs +3 -1
  238. package/esm2022/lib/services/store/effects/app.effects.mjs +4 -4
  239. package/esm2022/lib/services/store/reducers/app.reducers.mjs +2 -3
  240. package/esm2022/lib/services/store/reducers/core.reducers.mjs +3 -1
  241. package/esm2022/lib/services/store/reducers/i18n.reducers.mjs +2 -2
  242. package/esm2022/lib/services/store/reducers/locale.reducers.mjs +1 -1
  243. package/esm2022/lib/services/store/reducers/meta.reducers.mjs +4 -2
  244. package/esm2022/lib/services/store/reducers/notifications.reducers.mjs +2 -2
  245. package/esm2022/lib/services/store/reducers/user.reducers.mjs +2 -2
  246. package/esm2022/lib/services/store/store.service.mjs +14 -6
  247. package/esm2022/lib/services/store/store.service.mock.mjs +4 -4
  248. package/esm2022/lib/services/user/user.service.mjs +13 -7
  249. package/esm2022/lib/services/user/user.service.mock.mjs +11 -17
  250. package/fesm2022/eui-core.mjs +825 -591
  251. package/fesm2022/eui-core.mjs.map +1 -1
  252. package/lib/eui-core.module.d.ts +1 -1
  253. package/lib/eui-core.module.d.ts.map +1 -1
  254. package/lib/helpers/date-helpers.d.ts.map +1 -1
  255. package/lib/helpers/dom-helpers.d.ts +9 -7
  256. package/lib/helpers/dom-helpers.d.ts.map +1 -1
  257. package/lib/helpers/event-helpers.d.ts.map +1 -1
  258. package/lib/helpers/form-helpers.d.ts.map +1 -1
  259. package/lib/helpers/format-helpers.d.ts.map +1 -1
  260. package/lib/helpers/http-helpers.d.ts +2 -1
  261. package/lib/helpers/http-helpers.d.ts.map +1 -1
  262. package/lib/interceptors/add-lang-param.interceptor.d.ts +1 -1
  263. package/lib/interceptors/add-lang-param.interceptor.d.ts.map +1 -1
  264. package/lib/interceptors/cache-prevention.interceptor.d.ts +1 -1
  265. package/lib/interceptors/cache-prevention.interceptor.d.ts.map +1 -1
  266. package/lib/interceptors/cors-security.interceptor.d.ts +1 -1
  267. package/lib/interceptors/cors-security.interceptor.d.ts.map +1 -1
  268. package/lib/interceptors/csrf-prevention.interceptor.d.ts +1 -1
  269. package/lib/interceptors/csrf-prevention.interceptor.d.ts.map +1 -1
  270. package/lib/interceptors/eu-login-session-timeout-handling.interceptor.d.ts +1 -1
  271. package/lib/interceptors/eu-login-session-timeout-handling.interceptor.d.ts.map +1 -1
  272. package/lib/interceptors/openid/openid-connect.interceptor.d.ts.map +1 -1
  273. package/lib/interceptors/openid/openid-connect.service.d.ts.map +1 -1
  274. package/lib/interceptors/ux-request-error-model.interceptor.d.ts.map +1 -1
  275. package/lib/services/app/eui-init-app.d.ts +1 -1
  276. package/lib/services/app/eui-init-app.d.ts.map +1 -1
  277. package/lib/services/config/tokens.d.ts +2 -2
  278. package/lib/services/config/tokens.d.ts.map +1 -1
  279. package/lib/services/dynamic-component/dynamic-component.service.d.ts +3 -7
  280. package/lib/services/dynamic-component/dynamic-component.service.d.ts.map +1 -1
  281. package/lib/services/dynamic-menu/dynamic-menu.service.d.ts +6 -6
  282. package/lib/services/dynamic-menu/dynamic-menu.service.d.ts.map +1 -1
  283. package/lib/services/errors/eui.error.d.ts.map +1 -1
  284. package/lib/services/errors/global-error-handler.d.ts +1 -1
  285. package/lib/services/errors/global-error-handler.d.ts.map +1 -1
  286. package/lib/services/errors/http-error-handler-callback-functions.d.ts.map +1 -1
  287. package/lib/services/errors/http-error-handler.interceptor.d.ts.map +1 -1
  288. package/lib/services/eui-app-shell.service.d.ts +39 -10
  289. package/lib/services/eui-app-shell.service.d.ts.map +1 -1
  290. package/lib/services/i18n/i18n.loader.d.ts.map +1 -1
  291. package/lib/services/i18n/i18n.resource.d.ts +1 -1
  292. package/lib/services/i18n/i18n.resource.d.ts.map +1 -1
  293. package/lib/services/i18n/i18n.service.d.ts +4 -4
  294. package/lib/services/i18n/i18n.service.d.ts.map +1 -1
  295. package/lib/services/i18n/index.d.ts +0 -1
  296. package/lib/services/i18n/index.d.ts.map +1 -1
  297. package/lib/services/locale/locale.service.d.ts.map +1 -1
  298. package/lib/services/log/log.service.d.ts.map +1 -1
  299. package/lib/services/log/log.service.mock.d.ts.map +1 -1
  300. package/lib/services/permission/permission.service.d.ts.map +1 -1
  301. package/lib/services/queue/api-queue.service.d.ts +2 -2
  302. package/lib/services/queue/api-queue.service.d.ts.map +1 -1
  303. package/lib/services/queue/api-queue.service.mock.d.ts.map +1 -1
  304. package/lib/services/storage/async-storage.service.d.ts.map +1 -1
  305. package/lib/services/storage/async-storage.service.mock.d.ts.map +1 -1
  306. package/lib/services/storage/local-forage.service.d.ts +1 -1
  307. package/lib/services/storage/local-forage.service.d.ts.map +1 -1
  308. package/lib/services/storage/local-storage.service.d.ts.map +1 -1
  309. package/lib/services/storage/session-storage.service.d.ts.map +1 -1
  310. package/lib/services/storage/storage.service.d.ts.map +1 -1
  311. package/lib/services/storage/storage.service.mock.d.ts +1 -1
  312. package/lib/services/storage/storage.service.mock.d.ts.map +1 -1
  313. package/lib/services/store/actions/app.actions.d.ts.map +1 -1
  314. package/lib/services/store/actions/notifications.actions.d.ts.map +1 -1
  315. package/lib/services/store/actions/user.actions.d.ts.map +1 -1
  316. package/lib/services/store/reducers/app.reducers.d.ts.map +1 -1
  317. package/lib/services/store/reducers/core.reducers.d.ts.map +1 -1
  318. package/lib/services/store/reducers/meta.reducers.d.ts +2 -2
  319. package/lib/services/store/reducers/meta.reducers.d.ts.map +1 -1
  320. package/lib/services/store/reducers/user.reducers.d.ts.map +1 -1
  321. package/lib/services/store/store.service.d.ts +8 -8
  322. package/lib/services/store/store.service.d.ts.map +1 -1
  323. package/lib/services/store/store.service.mock.d.ts +2 -1
  324. package/lib/services/store/store.service.mock.d.ts.map +1 -1
  325. package/lib/services/user/user.service.d.ts +3 -3
  326. package/lib/services/user/user.service.d.ts.map +1 -1
  327. package/lib/services/user/user.service.mock.d.ts +10 -12
  328. package/lib/services/user/user.service.mock.d.ts.map +1 -1
  329. package/package.json +2 -2
  330. package/esm2022/lib/services/i18n/i18n.service.mock.mjs +0 -38
  331. package/lib/services/i18n/i18n.service.mock.d.ts +0 -20
  332. package/lib/services/i18n/i18n.service.mock.d.ts.map +0 -1
@@ -1,20 +1,20 @@
1
1
  import * as i1 from '@eui/base';
2
- import { LogLevel, ConsoleAppender, Logger, LoggerMock, initialAppState, initialUserState, initialNotificationsState, initialI18nState, initialLocaleState, 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, xhr, getApiQueue, getApiQueueItem, mergeAll, getI18nLoaderConfig, EuiLazyService, getI18nServiceConfigFromBase, getI18nState, getLastAddedModule, getBrowserDefaultLanguage, EuiEuLanguages, getActiveLang, EuiService, getUserRights, getUserState, getLocaleServiceConfigFromBase, getLocaleState, transformToUxHttpResponse } from '@eui/base';
3
3
  export * from '@eui/base';
4
4
  import * as i0 from '@angular/core';
5
- import { InjectionToken, Injectable, Inject, Injector, NgModule, Optional, APP_INITIALIZER, SkipSelf, ErrorHandler, EventEmitter, PLATFORM_ID, LOCALE_ID } from '@angular/core';
5
+ import { InjectionToken, Injectable, Inject, Injector, NgModule, Optional, APP_INITIALIZER, SkipSelf, ErrorHandler, PLATFORM_ID, 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 { fromEvent, merge, throwError, of, forkJoin, BehaviorSubject, defer, firstValueFrom, from, Subject, Observable } from 'rxjs';
10
+ import { map, mapTo, mergeMap, tap, debounceTime, distinctUntilChanged, take, switchMap, catchError, concatMap, filter, takeUntil, finalize } from 'rxjs/operators';
11
+ import * as i1$2 from '@ngx-translate/core';
12
+ import { TranslateLoader } from '@ngx-translate/core';
13
+ import * as i1$3 from '@ngrx/store';
14
+ import { createSelector } from '@ngrx/store';
7
15
  import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
8
16
  import { MomentDateAdapter } from '@angular/material-moment-adapter';
9
17
  import { LOCATION_INITIALIZED, DOCUMENT, isPlatformBrowser, getLocaleId, registerLocaleData } from '@angular/common';
10
- import { throwError, merge, fromEvent, of, forkJoin, BehaviorSubject, defer, from, Subject, Observable } from 'rxjs';
11
- import { debounceTime, distinctUntilChanged, mapTo, map, mergeMap, tap, take, switchMap, catchError, concatMap, filter, takeUntil, finalize } from 'rxjs/operators';
12
- import * as i1$1 from '@ngrx/store';
13
- import { createSelector } from '@ngrx/store';
14
- import * as i1$2 from '@ngrx/effects';
15
- import { createEffect, ofType } from '@ngrx/effects';
16
- import * as i1$3 from '@ngx-translate/core';
17
- import { TranslateLoader } from '@ngx-translate/core';
18
18
  import * as i1$5 from '@angular/common/http';
19
19
  import { HttpErrorResponse, HttpResponse, HttpHeaders, HttpEventType } from '@angular/common/http';
20
20
  import * as i1$4 from '@angular/router';
@@ -95,6 +95,8 @@ const DEFAULT_EUI_CONFIG = {
95
95
  },
96
96
  };
97
97
 
98
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
99
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
98
100
  const extend$1 = extendProxy.default || extendProxy;
99
101
  const EUI_CONFIG_TOKEN = new InjectionToken('EuiConfig');
100
102
  const MODULE_NAME_TOKEN = new InjectionToken('moduleName');
@@ -166,106 +168,6 @@ function mergeAppJsonConfigToAppConfig(euiAppConfig, envAppJsonConfig, merge, is
166
168
  return Object.assign({}, euiAppConfig, envAppJsonConfig, deepMerged);
167
169
  }
168
170
 
169
- const BASE_LOGGER_NAME_TOKEN = new InjectionToken('BASE_LOGGER_NAME');
170
- const LOG_LEVEL_TOKEN = new InjectionToken('LOG_LEVEL');
171
- const LOG_APPENDERS_TOKEN = new InjectionToken('LOG_APPENDERS');
172
- /**
173
- * Log service, responsible for getting or creating loggers. It itself acts as a base logger
174
- */
175
- class LogService extends Logger {
176
- constructor(name, level, appenders) {
177
- super(name, level, appenders);
178
- this.name = name;
179
- this.level = level;
180
- this.appenders = appenders;
181
- /** the list of persistent loggers */
182
- this.loggers = {};
183
- }
184
- /**
185
- * Gets a logger by name. If the logger does not exist, it is created
186
- *
187
- * @param loggerName logger name
188
- * @param persist optional parameter. Set it to true if you want to reuse the logger. By default, it is set to false
189
- * @returns the logger
190
- */
191
- getLogger(loggerName, persist = false) {
192
- // create the logger, if necessary
193
- const logger = (persist && this.loggers[loggerName]) || new Logger(loggerName, this.level, this.appenders);
194
- // if the logger is persistent, add it to the list of persistent loggers
195
- if (persist) {
196
- this.loggers[loggerName] = logger;
197
- }
198
- return logger;
199
- }
200
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LogService, deps: [{ token: BASE_LOGGER_NAME_TOKEN }, { token: LOG_LEVEL_TOKEN }, { token: LOG_APPENDERS_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
201
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LogService }); }
202
- }
203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LogService, decorators: [{
204
- type: Injectable
205
- }], ctorParameters: () => [{ type: undefined, decorators: [{
206
- type: Inject,
207
- args: [BASE_LOGGER_NAME_TOKEN]
208
- }] }, { type: i1.LogLevel, decorators: [{
209
- type: Inject,
210
- args: [LOG_LEVEL_TOKEN]
211
- }] }, { type: undefined, decorators: [{
212
- type: Inject,
213
- args: [LOG_APPENDERS_TOKEN]
214
- }] }] });
215
-
216
- const LOG_INSTANCES = {};
217
- /**
218
- * Helper function to check if the log config is defined.
219
- * Does not check only for empty object, because the config can have other (non-log) parameters
220
- * @params config log configuration
221
- * @returns true/false
222
- */
223
- function isLogConfigDefined(config) {
224
- return config && ('baseLoggerName' in config || 'logLevel' in config || 'logAppenders' in config);
225
- }
226
- /**
227
- * Helper function to provide a list of log appenders from a log configuration
228
- *
229
- * @params config log configuration
230
- * @returns an array of log appenders
231
- */
232
- function getLogAppendersConfig(config = DEFAULT_LOG_CONFIG, injector = null) {
233
- config = Object.assign({}, DEFAULT_LOG_CONFIG, config);
234
- config.logAppenders = config.logAppenders || [];
235
- config.logAppenders = Array.isArray(config.logAppenders) ? config.logAppenders : [config.logAppenders];
236
- return config.logAppenders.map((logAppender) => {
237
- const appenderType = typeof logAppender === 'object' ? logAppender.type : logAppender;
238
- const appenderParams = typeof logAppender === 'object' ? logAppender : undefined;
239
- return new appenderType(appenderParams, injector);
240
- });
241
- }
242
- /**
243
- * Helper function to provide an instance of LogService from a configuration
244
- *
245
- * @params config log configuration
246
- * @returns an instance of log service
247
- */
248
- function logServiceFactory(config = DEFAULT_LOG_CONFIG, injector = null) {
249
- // add the default values to config
250
- config = Object.assign({}, DEFAULT_LOG_CONFIG, config);
251
- // extract parameters from config
252
- const logLevel = config.logLevel;
253
- const logAppenders = getLogAppendersConfig(config, injector);
254
- // return an instance of LogService
255
- return new LogService(config.baseLoggerName, logLevel, logAppenders);
256
- }
257
- function euiLogServiceFactory(injector, rootBaseLoggerName, rootConfig, childBaseLoggerName = null, childConfig = {}) {
258
- // determine if the configuration is for non-root modules
259
- const forChild = isLogConfigDefined(childConfig);
260
- const baseLoggerName = forChild ? childBaseLoggerName : rootBaseLoggerName;
261
- // create the proper configuration
262
- const config = Object.assign({ baseLoggerName }, forChild ? Object.assign({}, rootConfig, childConfig) : rootConfig);
263
- // re-use the log service or create a new instance
264
- const logService = LOG_INSTANCES[baseLoggerName] || logServiceFactory(config, injector);
265
- LOG_INSTANCES[baseLoggerName] = logService;
266
- return logService;
267
- }
268
-
269
171
  var CoreAppActionTypes;
270
172
  (function (CoreAppActionTypes) {
271
173
  CoreAppActionTypes["INIT_STORE"] = "[App] Init store";
@@ -329,218 +231,17 @@ class AddApiQueueItemAction {
329
231
  }
330
232
  class RemoveApiQueueItemAction {
331
233
  constructor(payload) {
332
- this.payload = payload;
333
- this.type = CoreAppActionTypes.REMOVE_API_QUEUE_ITEM;
334
- }
335
- }
336
- class EmptyApiQueueAction {
337
- constructor(payload) {
338
- this.payload = payload;
339
- this.type = CoreAppActionTypes.EMPTY_API_QUEUE;
340
- }
341
- }
342
-
343
- class LogServiceMock extends LoggerMock {
344
- getLogger() {
345
- return new LoggerMock();
346
- }
347
- }
348
-
349
- const LOG_MODULE_CONFIG_TOKEN = new InjectionToken('LOG_CONFIG');
350
- /**
351
- * Log Module
352
- */
353
- class LogModule {
354
- /** method called in your root module to provide the LogService */
355
- static forRoot(config = DEFAULT_LOG_CONFIG) {
356
- return {
357
- ngModule: LogModule,
358
- providers: [
359
- { provide: LOG_MODULE_CONFIG_TOKEN, useValue: config },
360
- { provide: LogService, useFactory: logServiceFactory, deps: [LOG_MODULE_CONFIG_TOKEN, Injector] },
361
- ],
362
- };
363
- }
364
- /** method called in your other (non root, lazy loaded) modules to import a different instance of LogService */
365
- static forChild(config = DEFAULT_LOG_CONFIG) {
366
- return {
367
- ngModule: LogModule,
368
- providers: [
369
- { provide: LOG_MODULE_CONFIG_TOKEN, useValue: config },
370
- { provide: LogService, useFactory: logServiceFactory, deps: [LOG_MODULE_CONFIG_TOKEN, Injector] },
371
- ],
372
- };
373
- }
374
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
375
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.0-next.7", ngImport: i0, type: LogModule }); }
376
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LogModule }); }
377
- }
378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LogModule, decorators: [{
379
- type: NgModule
380
- }] });
381
-
382
- var BrowserStorageType;
383
- (function (BrowserStorageType) {
384
- BrowserStorageType[BrowserStorageType["local"] = 0] = "local";
385
- BrowserStorageType[BrowserStorageType["session"] = 1] = "session";
386
- })(BrowserStorageType || (BrowserStorageType = {}));
387
- // todo should stay here but all the store directory should be moved upper level
388
- class StoreService {
389
- constructor(store, logService) {
390
- this.store = store;
391
- this.logService = logService;
392
- /**
393
- * autoSave handlers to call before saving in local Storage
394
- */
395
- this._autoSaveHandlers = {};
396
- /** storage instance e.g. localStorage, sessionStorage */
397
- this._storage = localStorage;
398
- }
399
- // use init with just version info, to update to user state, UserService.updateState
400
- // initializeStore(version?: string, userDetails?: BaseUserDetails) {
401
- // this.dispatch(new InitStoreAction({ version, userDetails }));
402
- // }
403
- init(version, storageType) {
404
- this.dispatch(new InitStoreAction({ version }));
405
- this._storage = storageType === BrowserStorageType.session ? sessionStorage : localStorage;
406
- }
407
- addAutoSaveHandler(stateSlice, handler) {
408
- if (!this.store) {
409
- if (this.logService) {
410
- this.logService.warn('StoreService.addAutoSaveHandler() not available without NGRX');
411
- }
412
- return;
413
- }
414
- this._autoSaveHandlers[stateSlice] = handler;
415
- }
416
- handleAutoSave() {
417
- if (!this.store) {
418
- return;
419
- }
420
- this.store.pipe(debounceTime(1000), distinctUntilChanged()).subscribe((state) => {
421
- this.saveState(state);
422
- });
423
- }
424
- /**
425
- * Proxy to NGRX store.dispatch()
426
- * that allows to intercept if the store is present
427
- */
428
- dispatch(action) {
429
- if (this.store) {
430
- return this.store.dispatch(action);
431
- }
432
- }
433
- dispatchAction(state, actionKey, reducer) {
434
- if (this.store) {
435
- this.store.addReducer(actionKey, reducer);
436
- return this.store.dispatch({ type: actionKey, payload: state });
437
- }
438
- }
439
- /**
440
- * Proxy to NGRX store.select()
441
- * that allows to intercept if the store is present
442
- */
443
- select(key) {
444
- if (!this.store) {
445
- return throwError(() => new Error('NGRX Store not configured'));
446
- }
447
- return this.store.select(key);
448
- }
449
- /**
450
- * filters and save the state with the Browser storage
451
- * @param state type of CoreState
452
- */
453
- saveState(state) {
454
- let stateToSave = {
455
- app: state.app,
456
- };
457
- if (state.user) {
458
- const { userId, preferences } = state.user;
459
- stateToSave.user = { userId, preferences };
460
- }
461
- Object.keys(this._autoSaveHandlers).forEach((sliceState) => {
462
- const handler = this._autoSaveHandlers[sliceState];
463
- stateToSave = Object.assign(stateToSave, { [sliceState]: handler(state[sliceState]) });
464
- });
465
- try {
466
- const serializedState = JSON.stringify(stateToSave);
467
- this._storage.setItem('state', serializedState);
468
- }
469
- catch (err) {
470
- // Ignore write errors.
471
- }
472
- }
473
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: StoreService, deps: [{ token: i1$1.Store, optional: true }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
474
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: StoreService, providedIn: 'root' }); }
475
- }
476
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: StoreService, decorators: [{
477
- type: Injectable,
478
- args: [{
479
- providedIn: 'root',
480
- }]
481
- }], ctorParameters: () => [{ type: i1$1.Store, decorators: [{
482
- type: Optional
483
- }] }, { type: LogService, decorators: [{
484
- type: Optional
485
- }] }] });
486
-
487
- const euiInitApp = (injector) => () => new Promise((resolve) => {
488
- const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
489
- locationInitialized.then(() => {
490
- const appConfig = injector.get(CONFIG_TOKEN);
491
- // necessary config parameters
492
- let appVersion;
493
- if (appConfig && appConfig.versions && appConfig.versions.app) {
494
- appVersion = appConfig.versions.app;
495
- }
496
- else {
497
- appVersion = '0.0.0';
498
- }
499
- let storageType;
500
- if (appConfig && appConfig.saveStateStorage) {
501
- storageType = appConfig.saveStateStorage;
502
- }
503
- else {
504
- storageType = BrowserStorageType.local;
505
- }
506
- const storeService = injector.get(StoreService);
507
- storeService.init(appVersion, storageType);
508
- storeService.handleAutoSave();
509
- resolve(null);
510
- });
511
- });
512
-
513
- function getCoreProviders() {
514
- return [
515
- // core config
516
- ...getDependencyProviders(),
517
- { provide: BASE_NAME_TOKEN, useValue: 'eui-core' },
518
- // app config
519
- { provide: CONFIG_TOKEN, useFactory: prepareEuiAppConfigToken, deps: [EUI_CONFIG_TOKEN] },
520
- // global config
521
- { provide: GLOBAL_CONFIG_TOKEN, useFactory: getGlobalConfig, deps: [CONFIG_TOKEN] },
522
- { provide: ROOT_LOG_CONFIG_TOKEN, useFactory: getRootLogConfig, deps: [CONFIG_TOKEN] },
523
- { provide: SHOW_CONNECTION_STATUS_TOKEN, useFactory: getShowConnectionStatus, deps: [GLOBAL_CONFIG_TOKEN] },
524
- { provide: LogService, useFactory: euiLogServiceFactory, deps: [Injector, BASE_NAME_TOKEN, ROOT_LOG_CONFIG_TOKEN] },
525
- { provide: HTTP_ERROR_HANDLER_CONFIG_TOKEN, useFactory: getHttpErrorHandlingConfig, deps: [CONFIG_TOKEN] },
526
- { provide: APP_INITIALIZER, useFactory: euiInitApp, multi: true, deps: [Injector] },
527
- ];
528
- }
529
- function getDependencyProviders() {
530
- return [{ provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] }];
234
+ this.payload = payload;
235
+ this.type = CoreAppActionTypes.REMOVE_API_QUEUE_ITEM;
236
+ }
531
237
  }
532
- function getCoreChildProviders(moduleName) {
533
- return [
534
- // module config
535
- { provide: MODULE_NAME_TOKEN, useValue: moduleName },
536
- { provide: MODULE_CONFIG_TOKEN, useFactory: getModuleConfig, deps: [CONFIG_TOKEN, MODULE_NAME_TOKEN] },
537
- // log config
538
- {
539
- provide: LogService,
540
- useFactory: euiLogServiceFactory,
541
- deps: [Injector, BASE_NAME_TOKEN, ROOT_LOG_CONFIG_TOKEN, MODULE_NAME_TOKEN, MODULE_CONFIG_TOKEN],
542
- },
543
- ];
238
+ class EmptyApiQueueAction {
239
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
240
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
241
+ constructor(payload) {
242
+ this.payload = payload;
243
+ this.type = CoreAppActionTypes.EMPTY_API_QUEUE;
244
+ }
544
245
  }
545
246
 
546
247
  var CoreI18nActionTypes;
@@ -587,6 +288,8 @@ class UpdateUserRightsAction {
587
288
  }
588
289
  }
589
290
  class UpdateUserDashboardAction {
291
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
292
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
590
293
  constructor(payload) {
591
294
  this.payload = payload;
592
295
  this.type = CoreUserActionTypes.UPDATE_USER_DASHBOARD;
@@ -598,6 +301,8 @@ var CoreNotificationsActionTypes;
598
301
  CoreNotificationsActionTypes["UPDATE_NOTIFICATIONS_LIST"] = "[Notif] Update list";
599
302
  })(CoreNotificationsActionTypes || (CoreNotificationsActionTypes = {}));
600
303
  class UpdateNotificationsListAction {
304
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
305
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
601
306
  constructor(payload) {
602
307
  this.payload = payload;
603
308
  this.type = CoreNotificationsActionTypes.UPDATE_NOTIFICATIONS_LIST;
@@ -682,10 +387,10 @@ class EuiGrowlService {
682
387
  growlInfo(msg, position) {
683
388
  this.growl({ severity: 'info', summary: 'INFO', detail: msg }, false, false, undefined, position);
684
389
  }
685
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiGrowlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
686
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiGrowlService, providedIn: 'root' }); }
390
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiGrowlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
391
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiGrowlService, providedIn: 'root' }); }
687
392
  }
688
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiGrowlService, decorators: [{
393
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiGrowlService, decorators: [{
689
394
  type: Injectable,
690
395
  args: [{
691
396
  providedIn: 'root',
@@ -727,15 +432,15 @@ class CoreAppEffects {
727
432
  }
728
433
  })), { dispatch: false });
729
434
  }
730
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CoreAppEffects, deps: [{ token: i1$2.Actions }, { token: SHOW_CONNECTION_STATUS_TOKEN }, { token: i1$3.TranslateService }, { token: EuiGrowlService }], target: i0.ɵɵFactoryTarget.Injectable }); }
731
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CoreAppEffects }); }
435
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CoreAppEffects, deps: [{ token: i1$1.Actions }, { token: SHOW_CONNECTION_STATUS_TOKEN }, { token: i1$2.TranslateService }, { token: EuiGrowlService }], target: i0.ɵɵFactoryTarget.Injectable }); }
436
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CoreAppEffects }); }
732
437
  }
733
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CoreAppEffects, decorators: [{
438
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CoreAppEffects, decorators: [{
734
439
  type: Injectable
735
- }], ctorParameters: () => [{ type: i1$2.Actions }, { type: undefined, decorators: [{
440
+ }], ctorParameters: () => [{ type: i1$1.Actions }, { type: undefined, decorators: [{
736
441
  type: Inject,
737
442
  args: [SHOW_CONNECTION_STATUS_TOKEN]
738
- }] }, { type: i1$3.TranslateService }, { type: EuiGrowlService }] });
443
+ }] }, { type: i1$2.TranslateService }, { type: EuiGrowlService }] });
739
444
 
740
445
  const CoreModuleEffects = [CoreAppEffects];
741
446
 
@@ -772,7 +477,6 @@ const removeApiQueueItem = (state, action) => {
772
477
  }, {});
773
478
  return Object.assign({}, state, { apiQueue });
774
479
  };
775
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
776
480
  const emptyApiQueue = (state, action) =>
777
481
  // remove all items in the Api Queue
778
482
  Object.assign({}, state, { apiQueue: {} });
@@ -874,6 +578,8 @@ const coreLocaleReducers = (state = initialLocaleState, action) => {
874
578
  return state;
875
579
  };
876
580
 
581
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
582
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
877
583
  const coreReducers = Object.assign({}, {
878
584
  app: coreAppReducers,
879
585
  user: coreUserReducers,
@@ -882,6 +588,8 @@ const coreReducers = Object.assign({}, {
882
588
  locale: coreLocaleReducers,
883
589
  });
884
590
 
591
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
592
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
885
593
  const extend = extendProxy.default || extendProxy;
886
594
  /**
887
595
  * Utility meta-reducer to load the state from the local storage
@@ -908,66 +616,318 @@ const filterAppState = (app) => {
908
616
  if (!app) {
909
617
  return {};
910
618
  }
911
- return (Object.keys(app)
912
- // select keys that are present in the allowed list
913
- .filter((key) => !disallowedKeys.includes(key))
914
- // build a new object with only the allowed properties
915
- .reduce((obj, key) => {
916
- obj[key] = app[key];
917
- return obj;
918
- }, {}));
919
- };
920
- /**
921
- *
922
- * @param storageType
923
- */
924
- const loadState = (storage = localStorage) => {
925
- try {
926
- // by default falls back to localStorage
927
- const serializedState = storage.getItem('state');
928
- if (serializedState === null) {
929
- return undefined;
619
+ return (Object.keys(app)
620
+ // select keys that are present in the allowed list
621
+ .filter((key) => !disallowedKeys.includes(key))
622
+ // build a new object with only the allowed properties
623
+ .reduce((obj, key) => {
624
+ obj[key] = app[key];
625
+ return obj;
626
+ }, {}));
627
+ };
628
+ /**
629
+ *
630
+ * @param storage Type of storage to load the state from
631
+ */
632
+ const loadState = (storage = localStorage) => {
633
+ try {
634
+ // by default falls back to localStorage
635
+ const serializedState = storage.getItem('state');
636
+ if (serializedState === null) {
637
+ return undefined;
638
+ }
639
+ // deserialize state
640
+ let state = JSON.parse(serializedState);
641
+ // filter AppState and replace
642
+ state = { ...state, app: filterAppState(state?.app) };
643
+ return state;
644
+ }
645
+ catch (err) {
646
+ return undefined;
647
+ }
648
+ };
649
+ const cb = (reducer, storage) => (state, action) => {
650
+ if (action.type === CoreAppActionTypes.INIT_STORE) {
651
+ // This action must be dispatched from an app initializer
652
+ // We load the state from a storage and compare the version and userId with the provided ones.
653
+ // If they are the same, we merge the local state into the initial state.
654
+ // If there is a mismatch, we don't merge the local state, but update only the initial state.
655
+ // load the state from the localStorage
656
+ const localState = loadState(storage);
657
+ // extract the details about user and app version from the action payload
658
+ const payload = action.payload;
659
+ const payloadVersion = payload?.version;
660
+ if (localState) {
661
+ // TODO: Why all these checks here? What is the purpose of this code?
662
+ // extract the details about user and app version from the storage state
663
+ const localVersion = localState?.app?.version;
664
+ // const localUserId = localState.user && localState.user.userId;
665
+ const isVersionOK = !localVersion || !payloadVersion || localVersion === payloadVersion;
666
+ // const isUserIdOK = (localUserId === payloadUserId);
667
+ // update the entire state with deep merge of states, if the version and user are the same
668
+ if (isVersionOK) {
669
+ state = extend(true, {}, state, localState);
670
+ }
671
+ }
672
+ // update the app version, if defined
673
+ if (payloadVersion) {
674
+ state = { ...state, app: { ...state?.app, version: payloadVersion } };
675
+ }
676
+ }
677
+ return reducer(state, action);
678
+ };
679
+
680
+ const BASE_LOGGER_NAME_TOKEN = new InjectionToken('BASE_LOGGER_NAME');
681
+ const LOG_LEVEL_TOKEN = new InjectionToken('LOG_LEVEL');
682
+ const LOG_APPENDERS_TOKEN = new InjectionToken('LOG_APPENDERS');
683
+ /**
684
+ * Log service, responsible for getting or creating loggers. It itself acts as a base logger
685
+ */
686
+ class LogService extends Logger {
687
+ constructor(name, level, appenders) {
688
+ super(name, level, appenders);
689
+ this.name = name;
690
+ this.level = level;
691
+ this.appenders = appenders;
692
+ /** the list of persistent loggers */
693
+ this.loggers = {};
694
+ }
695
+ /**
696
+ * Gets a logger by name. If the logger does not exist, it is created
697
+ *
698
+ * @param loggerName logger name
699
+ * @param persist optional parameter. Set it to true if you want to reuse the logger. By default, it is set to false
700
+ * @returns the logger
701
+ */
702
+ getLogger(loggerName, persist = false) {
703
+ // create the logger, if necessary
704
+ const logger = (persist && this.loggers[loggerName]) || new Logger(loggerName, this.level, this.appenders);
705
+ // if the logger is persistent, add it to the list of persistent loggers
706
+ if (persist) {
707
+ this.loggers[loggerName] = logger;
708
+ }
709
+ return logger;
710
+ }
711
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LogService, deps: [{ token: BASE_LOGGER_NAME_TOKEN }, { token: LOG_LEVEL_TOKEN }, { token: LOG_APPENDERS_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
712
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LogService }); }
713
+ }
714
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LogService, decorators: [{
715
+ type: Injectable
716
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
717
+ type: Inject,
718
+ args: [BASE_LOGGER_NAME_TOKEN]
719
+ }] }, { type: i1.LogLevel, decorators: [{
720
+ type: Inject,
721
+ args: [LOG_LEVEL_TOKEN]
722
+ }] }, { type: undefined, decorators: [{
723
+ type: Inject,
724
+ args: [LOG_APPENDERS_TOKEN]
725
+ }] }] });
726
+
727
+ class LogServiceMock extends LoggerMock {
728
+ getLogger() {
729
+ return new LoggerMock();
730
+ }
731
+ }
732
+
733
+ const LOG_INSTANCES = {};
734
+ /**
735
+ * Helper function to check if the log config is defined.
736
+ * Does not check only for empty object, because the config can have other (non-log) parameters
737
+ * @params config log configuration
738
+ * @returns true/false
739
+ */
740
+ function isLogConfigDefined(config) {
741
+ return config && ('baseLoggerName' in config || 'logLevel' in config || 'logAppenders' in config);
742
+ }
743
+ /**
744
+ * Helper function to provide a list of log appenders from a log configuration
745
+ *
746
+ * @params config log configuration
747
+ * @returns an array of log appenders
748
+ */
749
+ function getLogAppendersConfig(config = DEFAULT_LOG_CONFIG, injector = null) {
750
+ config = Object.assign({}, DEFAULT_LOG_CONFIG, config);
751
+ config.logAppenders = config.logAppenders || [];
752
+ config.logAppenders = Array.isArray(config.logAppenders) ? config.logAppenders : [config.logAppenders];
753
+ return config.logAppenders.map((logAppender) => {
754
+ const appenderType = typeof logAppender === 'object' ? logAppender.type : logAppender;
755
+ const appenderParams = typeof logAppender === 'object' ? logAppender : undefined;
756
+ return new appenderType(appenderParams, injector);
757
+ });
758
+ }
759
+ /**
760
+ * Helper function to provide an instance of LogService from a configuration
761
+ *
762
+ * @params config log configuration
763
+ * @returns an instance of log service
764
+ */
765
+ function logServiceFactory(config = DEFAULT_LOG_CONFIG, injector = null) {
766
+ // add the default values to config
767
+ config = Object.assign({}, DEFAULT_LOG_CONFIG, config);
768
+ // extract parameters from config
769
+ const logLevel = config.logLevel;
770
+ const logAppenders = getLogAppendersConfig(config, injector);
771
+ // return an instance of LogService
772
+ return new LogService(config.baseLoggerName, logLevel, logAppenders);
773
+ }
774
+ function euiLogServiceFactory(injector, rootBaseLoggerName, rootConfig, childBaseLoggerName = null, childConfig = {}) {
775
+ // determine if the configuration is for non-root modules
776
+ const forChild = isLogConfigDefined(childConfig);
777
+ const baseLoggerName = forChild ? childBaseLoggerName : rootBaseLoggerName;
778
+ // create the proper configuration
779
+ const config = Object.assign({ baseLoggerName }, forChild ? Object.assign({}, rootConfig, childConfig) : rootConfig);
780
+ // re-use the log service or create a new instance
781
+ const logService = LOG_INSTANCES[baseLoggerName] || logServiceFactory(config, injector);
782
+ LOG_INSTANCES[baseLoggerName] = logService;
783
+ return logService;
784
+ }
785
+
786
+ const LOG_MODULE_CONFIG_TOKEN = new InjectionToken('LOG_CONFIG');
787
+ /**
788
+ * Log Module
789
+ */
790
+ class LogModule {
791
+ /** method called in your root module to provide the LogService */
792
+ static forRoot(config = DEFAULT_LOG_CONFIG) {
793
+ return {
794
+ ngModule: LogModule,
795
+ providers: [
796
+ { provide: LOG_MODULE_CONFIG_TOKEN, useValue: config },
797
+ { provide: LogService, useFactory: logServiceFactory, deps: [LOG_MODULE_CONFIG_TOKEN, Injector] },
798
+ ],
799
+ };
800
+ }
801
+ /** method called in your other (non root, lazy loaded) modules to import a different instance of LogService */
802
+ static forChild(config = DEFAULT_LOG_CONFIG) {
803
+ return {
804
+ ngModule: LogModule,
805
+ providers: [
806
+ { provide: LOG_MODULE_CONFIG_TOKEN, useValue: config },
807
+ { provide: LogService, useFactory: logServiceFactory, deps: [LOG_MODULE_CONFIG_TOKEN, Injector] },
808
+ ],
809
+ };
810
+ }
811
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
812
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.1", ngImport: i0, type: LogModule }); }
813
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LogModule }); }
814
+ }
815
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LogModule, decorators: [{
816
+ type: NgModule
817
+ }] });
818
+
819
+ var BrowserStorageType;
820
+ (function (BrowserStorageType) {
821
+ BrowserStorageType[BrowserStorageType["local"] = 0] = "local";
822
+ BrowserStorageType[BrowserStorageType["session"] = 1] = "session";
823
+ })(BrowserStorageType || (BrowserStorageType = {}));
824
+ // todo should stay here but all the store directory should be moved upper level
825
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
826
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
827
+ class StoreService {
828
+ constructor(store, logService) {
829
+ this.store = store;
830
+ this.logService = logService;
831
+ /**
832
+ * autoSave handlers to call before saving in local Storage
833
+ */
834
+ this._autoSaveHandlers = {};
835
+ /** storage instance e.g. localStorage, sessionStorage */
836
+ this._storage = localStorage;
837
+ }
838
+ // use init with just version info, to update to user state, UserService.updateState
839
+ // initializeStore(version?: string, userDetails?: BaseUserDetails) {
840
+ // this.dispatch(new InitStoreAction({ version, userDetails }));
841
+ // }
842
+ init(version, storageType) {
843
+ this.dispatch(new InitStoreAction({ version }));
844
+ this._storage = storageType === BrowserStorageType.session ? sessionStorage : localStorage;
845
+ }
846
+ addAutoSaveHandler(stateSlice, handler) {
847
+ if (!this.store) {
848
+ if (this.logService) {
849
+ this.logService.warn('StoreService.addAutoSaveHandler() not available without NGRX');
850
+ }
851
+ return;
852
+ }
853
+ this._autoSaveHandlers[stateSlice] = handler;
854
+ }
855
+ handleAutoSave() {
856
+ if (!this.store) {
857
+ return;
858
+ }
859
+ this.store.pipe(debounceTime(1000), distinctUntilChanged()).subscribe((state) => {
860
+ this.saveState(state);
861
+ });
862
+ }
863
+ /**
864
+ * Proxy to NGRX store.dispatch()
865
+ * that allows to intercept if the store is present
866
+ */
867
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
868
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
869
+ dispatch(action) {
870
+ if (this.store) {
871
+ return this.store.dispatch(action);
872
+ }
873
+ }
874
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
875
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
876
+ dispatchAction(state, actionKey, reducer) {
877
+ if (this.store) {
878
+ this.store.addReducer(actionKey, reducer);
879
+ return this.store.dispatch({ type: actionKey, payload: state });
930
880
  }
931
- // deserialize state
932
- let state = JSON.parse(serializedState);
933
- // filter AppState and replace
934
- state = { ...state, app: filterAppState(state?.app) };
935
- return state;
936
881
  }
937
- catch (err) {
938
- return undefined;
882
+ /**
883
+ * Proxy to NGRX store.select()
884
+ * that allows to intercept if the store is present
885
+ */
886
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
887
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
888
+ select(key) {
889
+ if (!this.store) {
890
+ return throwError(() => new Error('NGRX Store not configured'));
891
+ }
892
+ return this.store.select(key);
939
893
  }
940
- };
941
- const cb = (reducer, storage) => (state, action) => {
942
- if (action.type === CoreAppActionTypes.INIT_STORE) {
943
- // This action must be dispatched from an app initializer
944
- // We load the state from a storage and compare the version and userId with the provided ones.
945
- // If they are the same, we merge the local state into the initial state.
946
- // If there is a mismatch, we don't merge the local state, but update only the initial state.
947
- // load the state from the localStorage
948
- const localState = loadState(storage);
949
- // extract the details about user and app version from the action payload
950
- const payload = action.payload;
951
- const payloadVersion = payload?.version;
952
- if (localState) {
953
- // TODO: Why all these checks here? What is the purpose of this code?
954
- // extract the details about user and app version from the storage state
955
- const localVersion = localState?.app?.version;
956
- // const localUserId = localState.user && localState.user.userId;
957
- const isVersionOK = !localVersion || !payloadVersion || localVersion === payloadVersion;
958
- // const isUserIdOK = (localUserId === payloadUserId);
959
- // update the entire state with deep merge of states, if the version and user are the same
960
- if (isVersionOK) {
961
- state = extend(true, {}, state, localState);
962
- }
894
+ /**
895
+ * filters and save the state with the Browser storage
896
+ * @param state type of CoreState
897
+ */
898
+ saveState(state) {
899
+ let stateToSave = {
900
+ app: state.app,
901
+ };
902
+ if (state.user) {
903
+ const { userId, preferences } = state.user;
904
+ stateToSave.user = { userId, preferences };
963
905
  }
964
- // update the app version, if defined
965
- if (payloadVersion) {
966
- state = { ...state, app: { ...state?.app, version: payloadVersion } };
906
+ Object.keys(this._autoSaveHandlers).forEach((sliceState) => {
907
+ const handler = this._autoSaveHandlers[sliceState];
908
+ stateToSave = Object.assign(stateToSave, { [sliceState]: handler(state[sliceState]) });
909
+ });
910
+ try {
911
+ const serializedState = JSON.stringify(stateToSave);
912
+ this._storage.setItem('state', serializedState);
913
+ }
914
+ catch (err) {
915
+ // Ignore write errors.
967
916
  }
968
917
  }
969
- return reducer(state, action);
970
- };
918
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: StoreService, deps: [{ token: i1$3.Store, optional: true }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
919
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: StoreService, providedIn: 'root' }); }
920
+ }
921
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: StoreService, decorators: [{
922
+ type: Injectable,
923
+ args: [{
924
+ providedIn: 'root',
925
+ }]
926
+ }], ctorParameters: () => [{ type: i1$3.Store, decorators: [{
927
+ type: Optional
928
+ }] }, { type: LogService, decorators: [{
929
+ type: Optional
930
+ }] }] });
971
931
 
972
932
  class StoreServiceMock extends StoreService {
973
933
  constructor() {
@@ -980,13 +940,72 @@ class StoreServiceMock extends StoreService {
980
940
  select() {
981
941
  return of({});
982
942
  }
983
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: StoreServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
984
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: StoreServiceMock }); }
943
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: StoreServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
944
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: StoreServiceMock }); }
985
945
  }
986
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: StoreServiceMock, decorators: [{
946
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: StoreServiceMock, decorators: [{
987
947
  type: Injectable
988
948
  }], ctorParameters: () => [] });
989
949
 
950
+ const euiInitApp = (injector) => () => new Promise((resolve) => {
951
+ const locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
952
+ locationInitialized.then(() => {
953
+ const appConfig = injector.get(CONFIG_TOKEN);
954
+ // necessary config parameters
955
+ let appVersion;
956
+ if (appConfig && appConfig.versions && appConfig.versions.app) {
957
+ appVersion = appConfig.versions.app;
958
+ }
959
+ else {
960
+ appVersion = '0.0.0';
961
+ }
962
+ let storageType;
963
+ if (appConfig && appConfig.saveStateStorage) {
964
+ storageType = appConfig.saveStateStorage;
965
+ }
966
+ else {
967
+ storageType = BrowserStorageType.local;
968
+ }
969
+ const storeService = injector.get(StoreService);
970
+ storeService.init(appVersion, storageType);
971
+ storeService.handleAutoSave();
972
+ resolve(null);
973
+ });
974
+ });
975
+
976
+ function getCoreProviders() {
977
+ return [
978
+ // core config
979
+ ...getDependencyProviders(),
980
+ { provide: BASE_NAME_TOKEN, useValue: 'eui-core' },
981
+ // app config
982
+ { provide: CONFIG_TOKEN, useFactory: prepareEuiAppConfigToken, deps: [EUI_CONFIG_TOKEN] },
983
+ // global config
984
+ { provide: GLOBAL_CONFIG_TOKEN, useFactory: getGlobalConfig, deps: [CONFIG_TOKEN] },
985
+ { provide: ROOT_LOG_CONFIG_TOKEN, useFactory: getRootLogConfig, deps: [CONFIG_TOKEN] },
986
+ { provide: SHOW_CONNECTION_STATUS_TOKEN, useFactory: getShowConnectionStatus, deps: [GLOBAL_CONFIG_TOKEN] },
987
+ { provide: LogService, useFactory: euiLogServiceFactory, deps: [Injector, BASE_NAME_TOKEN, ROOT_LOG_CONFIG_TOKEN] },
988
+ { provide: HTTP_ERROR_HANDLER_CONFIG_TOKEN, useFactory: getHttpErrorHandlingConfig, deps: [CONFIG_TOKEN] },
989
+ { provide: APP_INITIALIZER, useFactory: euiInitApp, multi: true, deps: [Injector] },
990
+ ];
991
+ }
992
+ function getDependencyProviders() {
993
+ return [{ provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] }];
994
+ }
995
+ function getCoreChildProviders(moduleName) {
996
+ return [
997
+ // module config
998
+ { provide: MODULE_NAME_TOKEN, useValue: moduleName },
999
+ { provide: MODULE_CONFIG_TOKEN, useFactory: getModuleConfig, deps: [CONFIG_TOKEN, MODULE_NAME_TOKEN] },
1000
+ // log config
1001
+ {
1002
+ provide: LogService,
1003
+ useFactory: euiLogServiceFactory,
1004
+ deps: [Injector, BASE_NAME_TOKEN, ROOT_LOG_CONFIG_TOKEN, MODULE_NAME_TOKEN, MODULE_CONFIG_TOKEN],
1005
+ },
1006
+ ];
1007
+ }
1008
+
990
1009
  const CORE_ROOT_GUARD = new InjectionToken('Internal Theme ForRoot Guard');
991
1010
  class CoreModule {
992
1011
  /**
@@ -1027,11 +1046,11 @@ class CoreModule {
1027
1046
  storeService.dispatch(new AddAppLoadedConfigModulesAction({ moduleName, moduleConfig }));
1028
1047
  }
1029
1048
  }
1030
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CoreModule, deps: [{ token: CORE_ROOT_GUARD, optional: true }, { token: CoreModule, optional: true, skipSelf: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
1031
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.0-next.7", ngImport: i0, type: CoreModule }); }
1032
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CoreModule }); }
1049
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.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 }); }
1050
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.1", ngImport: i0, type: CoreModule }); }
1051
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CoreModule }); }
1033
1052
  }
1034
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CoreModule, decorators: [{
1053
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CoreModule, decorators: [{
1035
1054
  type: NgModule,
1036
1055
  args: [{
1037
1056
  imports: [
@@ -1050,7 +1069,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7",
1050
1069
  }] }, { type: i0.Injector }] });
1051
1070
  const createEuiCoreRootGuard = (core) => {
1052
1071
  if (core) {
1053
- throw new TypeError(`CoreModule.forRoot() called twice. Feature modules should use ThemeModule.forChild() instead.`);
1072
+ throw new TypeError('CoreModule.forRoot() called twice. Feature modules should use ThemeModule.forChild() instead.');
1054
1073
  }
1055
1074
  return 'guarded';
1056
1075
  };
@@ -1110,6 +1129,8 @@ const messages = {
1110
1129
  // Intermediate "hacky" subclass taken from
1111
1130
  // https://www.bennadel.com/blog/3226-experimenting-with-error-sub-classing-using-es5-and-typescript-2-1-5.htm
1112
1131
  class ErrorSubClass {
1132
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1133
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1113
1134
  constructor(code, msg, args) {
1114
1135
  if (!msg && code && code in messages) {
1115
1136
  if (typeof messages[code] === 'function') {
@@ -1135,6 +1156,8 @@ class ErrorSubClass {
1135
1156
  // This replaces the "extends" on the Class
1136
1157
  // ErrorSubClass.prototype = <any>Object.create(Error.prototype);
1137
1158
  class EuiError extends ErrorSubClass {
1159
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1160
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1138
1161
  constructor(code = errorCodes.ERR_GENERIC, msg, args) {
1139
1162
  super(code, msg, args);
1140
1163
  this.name = 'EuiError';
@@ -1146,16 +1169,18 @@ class GlobalErrorHandler extends ErrorHandler {
1146
1169
  super();
1147
1170
  this.logService = logService;
1148
1171
  }
1172
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1173
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1149
1174
  handleError(error) {
1150
1175
  // log error
1151
1176
  this.logService.error(error.message || error.toString());
1152
1177
  // throw error;
1153
1178
  super.handleError(error);
1154
1179
  }
1155
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: GlobalErrorHandler, deps: [{ token: LogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1156
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: GlobalErrorHandler, providedIn: 'root' }); }
1180
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: GlobalErrorHandler, deps: [{ token: LogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1181
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: GlobalErrorHandler, providedIn: 'root' }); }
1157
1182
  }
1158
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: GlobalErrorHandler, decorators: [{
1183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: GlobalErrorHandler, decorators: [{
1159
1184
  type: Injectable,
1160
1185
  args: [{
1161
1186
  providedIn: 'root',
@@ -1168,21 +1193,28 @@ class HttpErrorHandlerInterceptor {
1168
1193
  this.injector = injector;
1169
1194
  this.router = router;
1170
1195
  }
1196
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1197
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1171
1198
  intercept(req, next) {
1172
- return next.handle(req).pipe(tap(() => { }, (error) => {
1173
- // in case of http error
1174
- if (error instanceof HttpErrorResponse) {
1175
- const routeConfig = this.getRouteConfig(error);
1176
- const rule = routeConfig && (routeConfig[error.status] || routeConfig.default);
1177
- if (typeof rule === 'string') {
1178
- // perform a redirect
1179
- this.router.navigate([rule]);
1180
- }
1181
- else if (typeof rule === 'function') {
1182
- // callback function
1183
- rule.call(null, error, this.injector);
1199
+ return next.handle(req).pipe(tap({
1200
+ next: () => { },
1201
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1202
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1203
+ error: (error) => {
1204
+ // in case of http error
1205
+ if (error instanceof HttpErrorResponse) {
1206
+ const routeConfig = this.getRouteConfig(error);
1207
+ const rule = routeConfig && (routeConfig[error.status] || routeConfig.default);
1208
+ if (typeof rule === 'string') {
1209
+ // perform a redirect
1210
+ this.router.navigate([rule]);
1211
+ }
1212
+ else if (typeof rule === 'function') {
1213
+ // callback function
1214
+ rule.call(null, error, this.injector);
1215
+ }
1184
1216
  }
1185
- }
1217
+ },
1186
1218
  }));
1187
1219
  }
1188
1220
  /**
@@ -1200,10 +1232,10 @@ class HttpErrorHandlerInterceptor {
1200
1232
  // return the first matching route, if any
1201
1233
  return routes.length > 0 ? routes[0] : null;
1202
1234
  }
1203
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: HttpErrorHandlerInterceptor, deps: [{ token: HTTP_ERROR_HANDLER_CONFIG_TOKEN }, { token: i0.Injector }, { token: i1$4.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
1204
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: HttpErrorHandlerInterceptor }); }
1235
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: HttpErrorHandlerInterceptor, deps: [{ token: HTTP_ERROR_HANDLER_CONFIG_TOKEN }, { token: i0.Injector }, { token: i1$4.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
1236
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: HttpErrorHandlerInterceptor }); }
1205
1237
  }
1206
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: HttpErrorHandlerInterceptor, decorators: [{
1238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: HttpErrorHandlerInterceptor, decorators: [{
1207
1239
  type: Injectable
1208
1240
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1209
1241
  type: Inject,
@@ -1289,6 +1321,8 @@ class ApiQueueService {
1289
1321
  * @param id - id of the item inside the queue
1290
1322
  * @return An Observable of type any
1291
1323
  */
1324
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1325
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1292
1326
  processQueueItem(id) {
1293
1327
  return this.store.select(getApiQueueItem(id)).pipe(take(1), switchMap((queue) => {
1294
1328
  if (!queue) {
@@ -1303,6 +1337,8 @@ class ApiQueueService {
1303
1337
  * @param [continueOnError=true] - in case of an item request fails continue with the rest in queue
1304
1338
  * @return An Observable with an array which contains all responses from all items in queue.
1305
1339
  */
1340
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1341
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1306
1342
  processAllQueueItems(continueOnError = true) {
1307
1343
  return this.store.select(getApiQueue).pipe(map((queue) => Object.entries(queue).map(([key, value]) => this.buildHttpRequest(key, value).pipe(catchError((error) => {
1308
1344
  this.logService.error(`Queue Item with id ${key} failed.`, error.message, error.stack);
@@ -1310,7 +1346,10 @@ class ApiQueueService {
1310
1346
  throw error;
1311
1347
  }
1312
1348
  return of(error);
1313
- })))), switchMap((obsQueue) => forkJoin(Array.from(obsQueue))));
1349
+ })))),
1350
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1351
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1352
+ switchMap((obsQueue) => forkJoin(Array.from(obsQueue))));
1314
1353
  }
1315
1354
  /**
1316
1355
  * Process all items in queue after it order them based on their timestamp. Beware that order
@@ -1318,6 +1357,8 @@ class ApiQueueService {
1318
1357
  * or Http response follows order.
1319
1358
  * @param [ascending=true] - sets the order of queue items based on timestamp
1320
1359
  */
1360
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1361
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1321
1362
  processAllQueueItemsSequential(ascending = true) {
1322
1363
  return this.store.select(getApiQueue).pipe(concatMap((queue) => Object.entries(queue)
1323
1364
  .sort((a, b) => (ascending ? this.sortOnTimestamp(a, b) : this.sortOnTimestamp(b, a)))
@@ -1340,13 +1381,16 @@ class ApiQueueService {
1340
1381
  * @param item - the item of the queue that matches the id.
1341
1382
  * @return An Observable of HttpClient Request
1342
1383
  */
1384
+ // TODO: add type for T and deprecate old function
1385
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1386
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1343
1387
  buildHttpRequest(id, item) {
1344
1388
  return this.http[item.method.toLowerCase()](item.uri, item.payload).pipe(tap(() => this.removeQueueItem(id)));
1345
1389
  }
1346
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: ApiQueueService, deps: [{ token: StoreService }, { token: i1$5.HttpClient }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1347
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: ApiQueueService, providedIn: 'root' }); }
1390
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ApiQueueService, deps: [{ token: StoreService }, { token: i1$5.HttpClient }, { token: LogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1391
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ApiQueueService, providedIn: 'root' }); }
1348
1392
  }
1349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: ApiQueueService, decorators: [{
1393
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ApiQueueService, decorators: [{
1350
1394
  type: Injectable,
1351
1395
  args: [{
1352
1396
  providedIn: 'root',
@@ -1364,11 +1408,15 @@ class ApiQueueServiceMock extends ApiQueueService {
1364
1408
  return of({ uri: id, method: 'GET' });
1365
1409
  }
1366
1410
  removeAllQueueItem() { }
1411
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1412
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1367
1413
  processAllQueueItems() {
1368
1414
  return of({});
1369
1415
  }
1370
1416
  addQueueItem() { }
1371
1417
  removeQueueItem() { }
1418
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1419
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1372
1420
  processQueueItem() {
1373
1421
  return of({});
1374
1422
  }
@@ -1380,9 +1428,12 @@ class I18nResourceImpl {
1380
1428
  *
1381
1429
  * @param prefix the prefix of the resource
1382
1430
  * @param suffix the suffix of the resource, optional parameter
1383
- * @param compileTranslations compiler function, optional parameter
1431
+ * @param compileTranslationsFn compiler function, optional parameter
1384
1432
  */
1385
- constructor(prefix, suffix = '', compileTranslationsFn = (translations) => translations) {
1433
+ constructor(prefix, suffix = '',
1434
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1435
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-function-return-type
1436
+ compileTranslationsFn = (translations) => translations) {
1386
1437
  this.prefix = prefix;
1387
1438
  this.suffix = suffix;
1388
1439
  this.compileTranslationsFn = compileTranslationsFn;
@@ -1394,6 +1445,8 @@ class I18nResourceImpl {
1394
1445
  * @param lang the translations language
1395
1446
  * @returns the pre-processed translations
1396
1447
  */
1448
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1449
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1397
1450
  compileTranslations(translations, lang) {
1398
1451
  return this.compileTranslationsFn(translations, lang);
1399
1452
  }
@@ -1435,6 +1488,8 @@ class I18nLoader {
1435
1488
  * @param lang
1436
1489
  * @returns Observable<any>
1437
1490
  */
1491
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1492
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1438
1493
  getTranslation(lang) {
1439
1494
  return this.loadResources(this.resources, lang).pipe(map((loadedResources) => {
1440
1495
  this.failedResources = loadedResources.hasError ? loadedResources.errors : [];
@@ -1470,6 +1525,8 @@ class I18nLoader {
1470
1525
  * @param lang the resource language to load
1471
1526
  * @returns Observable<any>
1472
1527
  */
1528
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1529
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1473
1530
  loadResources(resources, lang) {
1474
1531
  // if there are resources to load
1475
1532
  if (Array.isArray(resources) && resources.length > 0) {
@@ -1555,13 +1612,20 @@ class I18nLoader {
1555
1612
  * @param lang the resource language to load
1556
1613
  * @returns Observable<any>
1557
1614
  */
1615
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1616
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1558
1617
  loadResource(resource, lang) {
1559
1618
  // the path to the resource
1560
1619
  const path = resource.getPath(lang);
1561
1620
  // load the translations from the path
1562
1621
  return this.http.get(path).pipe(
1563
1622
  // preprocess the translations using the resource compiler
1564
- map((translations) => resource.compileTranslations(translations, lang)), map((translations) => {
1623
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1624
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1625
+ map((translations) => resource.compileTranslations(translations, lang)),
1626
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1627
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1628
+ map((translations) => {
1565
1629
  // resource loaded properly, send a info message
1566
1630
  if (this.logService) {
1567
1631
  this.logService.info(`I18n resource loaded from path ${path}`);
@@ -1586,10 +1650,10 @@ class I18nLoader {
1586
1650
  }
1587
1651
  return undefined;
1588
1652
  }
1589
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: I18nLoader, deps: [{ token: i1$5.HttpClient }, { token: LogService, optional: true }, { token: CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
1590
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: I18nLoader }); }
1653
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: I18nLoader, deps: [{ token: i1$5.HttpClient }, { token: LogService, optional: true }, { token: CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
1654
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: I18nLoader }); }
1591
1655
  }
1592
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: I18nLoader, decorators: [{
1656
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: I18nLoader, decorators: [{
1593
1657
  type: Injectable
1594
1658
  }], ctorParameters: () => [{ type: i1$5.HttpClient }, { type: LogService, decorators: [{
1595
1659
  type: Optional
@@ -1617,7 +1681,9 @@ class I18nService extends EuiLazyService {
1617
1681
  }
1618
1682
  getState(keyOrMapFn) {
1619
1683
  let selector = getI18nState;
1620
- let dotNotationToObject = (obj, key) => key.split('.').reduce((slice, i) => slice[i], obj);
1684
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1685
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1686
+ const dotNotationToObject = (obj, key) => key.split('.').reduce((slice, i) => slice[i], obj);
1621
1687
  if (keyOrMapFn) {
1622
1688
  switch (typeof keyOrMapFn) {
1623
1689
  case 'function':
@@ -1647,15 +1713,6 @@ class I18nService extends EuiLazyService {
1647
1713
  }
1648
1714
  return of({ success: false, error: 'Initial active lang should be string' });
1649
1715
  }
1650
- /**
1651
- * A pipe function that could serve as a wrapper of another observable
1652
- * e.g. ngx-translate i18n.onReady('my_module').pipe(switchMap(()=>translate.get('eui.KEY')));
1653
- * WARNING: onReady will emit only once for a loaded Module, going to another and then going back will not result
1654
- * into another emission.
1655
- *
1656
- * @param moduleName the name of the module that has been given through the eUI globalConfig. In case non provided
1657
- * fetch module name from the state.
1658
- */
1659
1716
  onReady(moduleName) {
1660
1717
  return this.onModuleLoad.pipe(switchMap((evt) => moduleName
1661
1718
  ? of(evt)
@@ -1678,6 +1735,7 @@ class I18nService extends EuiLazyService {
1678
1735
  * Add resources based of a config loader
1679
1736
  *
1680
1737
  * @param config I18nLoaderConfig
1738
+ * @param moduleName
1681
1739
  * @return Promise<EuiServiceStatus> an EuiServiceStatus when translation has fully loaded
1682
1740
  */
1683
1741
  addResources(config, moduleName) {
@@ -1685,6 +1743,8 @@ class I18nService extends EuiLazyService {
1685
1743
  this.onModuleLoad.next({ ready: false, name: moduleName });
1686
1744
  const loader = this.translateService.currentLoader;
1687
1745
  if (loader instanceof I18nLoader) {
1746
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1747
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1688
1748
  const langSubscription = [];
1689
1749
  const i18nLoader = loader;
1690
1750
  // add the resources to the loader
@@ -1694,10 +1754,10 @@ class I18nService extends EuiLazyService {
1694
1754
  // add the new set of translations to the current language
1695
1755
  this.translateService.setTranslation(this.translateService.currentLang, loadedResources.translations, true);
1696
1756
  })));
1697
- // if the current language is different than the DEFAULT language
1757
+ // if the current language is different from the DEFAULT language
1698
1758
  const defaultLang = this.config.defaultLanguage || this.translateService.defaultLang;
1699
1759
  if (this.translateService.currentLang !== defaultLang) {
1700
- // manually load the resources for the default language and add them to the translate service
1760
+ // manually load the resources for the default language and add them to the translation service
1701
1761
  langSubscription.push(i18nLoader.loadResources(resources, defaultLang).pipe(take(1), tap((loadedResources) => {
1702
1762
  this.translateService.setTranslation(defaultLang, loadedResources.translations, true);
1703
1763
  })));
@@ -1789,6 +1849,8 @@ class I18nService extends EuiLazyService {
1789
1849
  * @returns Observable that returns an object contain the object translation for given language after language
1790
1850
  * fully loaded.
1791
1851
  */
1852
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1853
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1792
1854
  use(lang) {
1793
1855
  return this.translateService.use(lang);
1794
1856
  }
@@ -1800,10 +1862,10 @@ class I18nService extends EuiLazyService {
1800
1862
  updateHTMLDOMLang(lang) {
1801
1863
  this.document.documentElement.lang = lang;
1802
1864
  }
1803
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", 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 }); }
1804
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: I18nService, providedIn: 'root' }); }
1865
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.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 }); }
1866
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: I18nService, providedIn: 'root' }); }
1805
1867
  }
1806
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: I18nService, decorators: [{
1868
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: I18nService, decorators: [{
1807
1869
  type: Injectable,
1808
1870
  args: [{
1809
1871
  providedIn: 'root',
@@ -1811,46 +1873,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7",
1811
1873
  }], ctorParameters: () => [{ type: undefined, decorators: [{
1812
1874
  type: Inject,
1813
1875
  args: [GLOBAL_CONFIG_TOKEN]
1814
- }] }, { type: i1$3.TranslateService }, { type: LogService, decorators: [{
1876
+ }] }, { type: i1$2.TranslateService }, { type: LogService, decorators: [{
1815
1877
  type: Optional
1816
1878
  }] }, { type: StoreService }, { type: Document, decorators: [{
1817
1879
  type: Inject,
1818
1880
  args: [DOCUMENT]
1819
1881
  }] }] });
1820
1882
 
1821
- class I18nServiceMock extends I18nService {
1822
- constructor() {
1823
- super(null, null, null, null, null);
1824
- this.DEFAULT_LANGUAGE = 'en';
1825
- }
1826
- get onLangChange() {
1827
- return new EventEmitter();
1828
- }
1829
- addResources() {
1830
- return of({ success: true });
1831
- }
1832
- get currentLanguage() {
1833
- return this.DEFAULT_LANGUAGE;
1834
- }
1835
- getState() {
1836
- return of({ activeLang: this.DEFAULT_LANGUAGE });
1837
- }
1838
- updateState(i18nState) {
1839
- this.DEFAULT_LANGUAGE = i18nState.activeLang || 'en';
1840
- }
1841
- init(i18nState) {
1842
- this.DEFAULT_LANGUAGE = i18nState.activeLang || 'en';
1843
- return of({ success: true });
1844
- }
1845
- lazyLoadInit() {
1846
- return of({ success: true });
1847
- }
1848
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: I18nServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1849
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: I18nServiceMock }); }
1850
- }
1851
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: I18nServiceMock, decorators: [{
1852
- type: Injectable
1853
- }], ctorParameters: () => [] });
1883
+ // export * from './i18n.service.mock';
1854
1884
 
1855
1885
  const diffDays = (dateStart, dateEnd) => Math.round((dateEnd.getTime() - dateStart.getTime()) / 1000 / 60 / 60 / 24);
1856
1886
  const diffDaysFromToday = (date) => diffDays(new Date(), date);
@@ -1860,15 +1890,15 @@ const diffDaysFromToday = (date) => diffDays(new Date(), date);
1860
1890
  * http://api.jquery.com/position/
1861
1891
  */
1862
1892
  const position = (nativeEl) => {
1863
- let elBCR = offset(nativeEl);
1893
+ const elBCR = offset(nativeEl);
1864
1894
  let offsetParentBCR = { top: 0, left: 0 };
1865
- let offsetParentEl = parentOffsetEl(nativeEl);
1895
+ const offsetParentEl = parentOffsetEl(nativeEl);
1866
1896
  if (offsetParentEl !== document) {
1867
1897
  offsetParentBCR = offset(offsetParentEl);
1868
1898
  offsetParentBCR.top += offsetParentEl.clientTop - offsetParentEl.scrollTop;
1869
1899
  offsetParentBCR.left += offsetParentEl.clientLeft - offsetParentEl.scrollLeft;
1870
1900
  }
1871
- let boundingClientRect = nativeEl.getBoundingClientRect();
1901
+ const boundingClientRect = nativeEl.getBoundingClientRect();
1872
1902
  return {
1873
1903
  width: boundingClientRect.width || nativeEl.offsetWidth,
1874
1904
  height: boundingClientRect.height || nativeEl.offsetHeight,
@@ -1881,7 +1911,7 @@ const position = (nativeEl) => {
1881
1911
  * http://api.jquery.com/offset/
1882
1912
  */
1883
1913
  const offset = (nativeEl) => {
1884
- let boundingClientRect = nativeEl.getBoundingClientRect();
1914
+ const boundingClientRect = nativeEl.getBoundingClientRect();
1885
1915
  return {
1886
1916
  width: boundingClientRect.width || nativeEl.offsetWidth,
1887
1917
  height: boundingClientRect.height || nativeEl.offsetHeight,
@@ -1890,6 +1920,8 @@ const offset = (nativeEl) => {
1890
1920
  };
1891
1921
  };
1892
1922
  // PRIVATE FUNCTIONS
1923
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
1924
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1893
1925
  const getStyle = (nativeEl, cssProp) => {
1894
1926
  // IE
1895
1927
  if (nativeEl.currentStyle) {
@@ -1917,8 +1949,8 @@ const parentOffsetEl = (nativeEl) => {
1917
1949
  return offsetParent || document;
1918
1950
  };
1919
1951
  const getViewElement = (fixture, componentClass, klass) => {
1920
- let de, el, domElement;
1921
- de = fixture.debugElement.query(By.css(componentClass));
1952
+ let el, domElement;
1953
+ const de = fixture.debugElement.query(By.css(componentClass));
1922
1954
  if (de) {
1923
1955
  el = de.nativeElement;
1924
1956
  if (el && klass) {
@@ -1928,7 +1960,7 @@ const getViewElement = (fixture, componentClass, klass) => {
1928
1960
  }
1929
1961
  }
1930
1962
  }
1931
- return { de, el, domElement };
1963
+ return { de, el, domElement: domElement };
1932
1964
  };
1933
1965
  const closestMatchingParent = (target, className) => {
1934
1966
  let element = target;
@@ -2014,11 +2046,11 @@ const formatNumber = (value, fractionSize = 2, inDecimalSeparator = ',', inThous
2014
2046
  }
2015
2047
  if (typeof value === 'string') {
2016
2048
  // get all non characters
2017
- let nonChars = value.match(/[^0-9]+/g) || [];
2049
+ const nonChars = value.match(/[^0-9]+/g) || [];
2018
2050
  // get all unique chars
2019
- let uniqueChars = nonChars.reduce((acc, e) => acc.set(e, (acc.get(e) || 0) + 1), new Map());
2051
+ const uniqueChars = nonChars.reduce((acc, e) => acc.set(e, (acc.get(e) || 0) + 1), new Map());
2020
2052
  // get separators
2021
- let separators = Array.from(uniqueChars.keys());
2053
+ const separators = Array.from(uniqueChars.keys());
2022
2054
  // sense where decimal separator and where thousand separator is
2023
2055
  if (separators.length > 1) {
2024
2056
  // left detected separator will be thousand and second will be decimal
@@ -2044,12 +2076,13 @@ const formatNumber = (value, fractionSize = 2, inDecimalSeparator = ',', inThous
2044
2076
  return value.replace(/\B(?=(\d{3})+(?!\d))/g, inThousandSeparator);
2045
2077
  }
2046
2078
  // do the replacement of separators and parseInt
2047
- // Beware! Always replace thousand separator first and then decimal
2079
+ // Beware! Always replace a thousand separator first and then decimal
2048
2080
  value = value.split(thousandsSeparator).join('').replace(decimalSeparator, '.');
2049
2081
  }
2050
2082
  decimalSeparator = inDecimalSeparator;
2051
2083
  thousandsSeparator = inThousandSeparator;
2052
2084
  const maxFraction = '0'.repeat(fractionSize);
2085
+ // eslint-disable-next-line prefer-const
2053
2086
  let [integer, fraction = maxFraction] = (value || '0').toString().split('.');
2054
2087
  fraction = fractionSize > 0 ? (fraction + maxFraction).substring(0, fractionSize) : '';
2055
2088
  // this rule makes sense only in number in case fraction is all zero
@@ -2058,9 +2091,8 @@ const formatNumber = (value, fractionSize = 2, inDecimalSeparator = ',', inThous
2058
2091
  };
2059
2092
 
2060
2093
  const handleError = (error) => {
2061
- let errMsg = error.message ? error.message : error.status ? `${error.status} - ${error.statusText}` : 'Server error';
2062
- // console.error(errMsg);
2063
- return throwError(errMsg);
2094
+ const errMsg = error.message ? error.message : error.status ? `${error.status} - ${error.statusText}` : 'Server error';
2095
+ throw new Error(errMsg);
2064
2096
  };
2065
2097
 
2066
2098
  /**
@@ -2156,14 +2188,14 @@ class EuiPermissionService extends EuiService {
2156
2188
  */
2157
2189
  haveAllRights(rights) {
2158
2190
  if (!isDefined(rights)) {
2159
- throw Error(`The rights should be an array but instead it's not defined!`);
2191
+ throw Error('The rights should be an array but instead it\'s not defined!');
2160
2192
  }
2161
2193
  return rights.every((right) => this.userRights.find((uRight) => uRight.id === right.id));
2162
2194
  }
2163
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiPermissionService, deps: [{ token: LogService, optional: true }, { token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2164
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiPermissionService, providedIn: 'root' }); }
2195
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiPermissionService, deps: [{ token: LogService, optional: true }, { token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2196
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiPermissionService, providedIn: 'root' }); }
2165
2197
  }
2166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiPermissionService, decorators: [{
2198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiPermissionService, decorators: [{
2167
2199
  type: Injectable,
2168
2200
  args: [{
2169
2201
  providedIn: 'root',
@@ -2172,6 +2204,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7",
2172
2204
  type: Optional
2173
2205
  }] }, { type: StoreService }] });
2174
2206
 
2207
+ // TODO: Type of LINK should be UxLink or something relevant. Do we need that service anymore?
2208
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
2209
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2175
2210
  class EuiDynamicMenuService {
2176
2211
  // TODO: it should be moved euiservice, or it should be static
2177
2212
  // TODO: can we moved that service inside the module of the component that's using it?
@@ -2223,16 +2258,17 @@ class EuiDynamicMenuService {
2223
2258
  return true;
2224
2259
  });
2225
2260
  }
2226
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiDynamicMenuService, deps: [{ token: EuiPermissionService }, { token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2227
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiDynamicMenuService, providedIn: 'root' }); }
2261
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiDynamicMenuService, deps: [{ token: EuiPermissionService }, { token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
2262
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiDynamicMenuService, providedIn: 'root' }); }
2228
2263
  }
2229
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiDynamicMenuService, decorators: [{
2264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiDynamicMenuService, decorators: [{
2230
2265
  type: Injectable,
2231
2266
  args: [{
2232
2267
  providedIn: 'root',
2233
2268
  }]
2234
2269
  }], ctorParameters: () => [{ type: EuiPermissionService }, { type: StoreService }] });
2235
2270
 
2271
+ // TODO: Do we need that service anymore? Can we remove it?
2236
2272
  const DYNAMIC_COMPONENT_CONFIG = new InjectionToken('DYNAMIC_COMPONENT_CONFIG');
2237
2273
  class EuiDynamicComponentService {
2238
2274
  constructor(componentFactoryResolver, injector, appRef) {
@@ -2246,6 +2282,8 @@ class EuiDynamicComponentService {
2246
2282
  * @param el The element reference for the component to be injected
2247
2283
  * @param config The data to be passed (config) for the DYNAMIC_COMPONENT_CONFIG token
2248
2284
  */
2285
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
2286
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2249
2287
  add(component, el, config) {
2250
2288
  // TODO: take a look and replace deprecated componentFactoryResolver https://github.com/angular/components/issues/24334
2251
2289
  // Create a portalHost from a DOM element
@@ -2281,15 +2319,17 @@ class EuiDynamicComponentService {
2281
2319
  * creates a custom injector to be used when providing custom injection tokens to components inside a portal
2282
2320
  * @param data to be used by DYNAMIC_COMPONENT_CONFIG token
2283
2321
  */
2322
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
2323
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2284
2324
  createInjector(data) {
2285
2325
  const injectorTokens = new WeakMap();
2286
2326
  injectorTokens.set(DYNAMIC_COMPONENT_CONFIG, data);
2287
2327
  return new PortalInjector(this.injector, injectorTokens);
2288
2328
  }
2289
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiDynamicComponentService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
2290
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiDynamicComponentService }); }
2329
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiDynamicComponentService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
2330
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiDynamicComponentService }); }
2291
2331
  }
2292
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiDynamicComponentService, decorators: [{
2332
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiDynamicComponentService, decorators: [{
2293
2333
  type: Injectable
2294
2334
  }], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.Injector }, { type: i0.ApplicationRef }] });
2295
2335
 
@@ -2298,9 +2338,6 @@ const initialState = {
2298
2338
  appShortName: '',
2299
2339
  appSubTitle: '',
2300
2340
  appBaseFontSize: '',
2301
- userInfos: null,
2302
- userSubInfos: null,
2303
- impersonatedUserInfos: null,
2304
2341
  isSidebarOpen: true,
2305
2342
  isSidebarHover: false,
2306
2343
  isSidebarActive: false,
@@ -2355,6 +2392,8 @@ class EuiAppShellService {
2355
2392
  get breakpoint$() {
2356
2393
  return this._breakpoint$.asObservable();
2357
2394
  }
2395
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
2396
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2358
2397
  get breakpoints$() {
2359
2398
  return this._breakpoints$.asObservable();
2360
2399
  }
@@ -2437,6 +2476,14 @@ class EuiAppShellService {
2437
2476
  this.router = router;
2438
2477
  this.storeService = storeService;
2439
2478
  this.i18nService = i18nService;
2479
+ /**
2480
+ * @deprecated don't remove as it's used for external legacy project under v17 (csdr-eui-legacy) to support MWP transition
2481
+ */
2482
+ this.openModalId = new BehaviorSubject('');
2483
+ /**
2484
+ * @deprecated don't remove as it's used for external legacy project under v17 (csdr-eui-legacy) to support MWP transition
2485
+ */
2486
+ this.activeModals = [];
2440
2487
  this.cssVars = [];
2441
2488
  let stateWithConfig = initialState;
2442
2489
  const languages = config?.i18n?.i18nService?.languages || initialState.languages;
@@ -2461,7 +2508,7 @@ class EuiAppShellService {
2461
2508
  }
2462
2509
  }
2463
2510
  setState(nextState, updateI18 = true) {
2464
- let breakpoint, breakpoints, wrapperClasses;
2511
+ let breakpoint, breakpoints;
2465
2512
  let combinedLinks;
2466
2513
  const state = this.state;
2467
2514
  // check if window width has been updated from previous state
@@ -2477,7 +2524,7 @@ class EuiAppShellService {
2477
2524
  breakpoints = state.breakpoints;
2478
2525
  }
2479
2526
  // finally get the wrapper classes when both the state and breakpoint are known
2480
- wrapperClasses = this.getWrapperClasses(nextState, breakpoint);
2527
+ const wrapperClasses = this.getWrapperClasses(nextState, breakpoint);
2481
2528
  // check if the menuLinks or sidebarLinks have changed from previous state
2482
2529
  if (this.state.menuLinks !== nextState.menuLinks || this.state.sidebarLinks !== nextState.sidebarLinks) {
2483
2530
  combinedLinks = [...nextState.menuLinks, ...nextState.sidebarLinks];
@@ -2504,6 +2551,8 @@ class EuiAppShellService {
2504
2551
  *
2505
2552
  * @param key can be 'key' or 'key.sub.sub'
2506
2553
  */
2554
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
2555
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2507
2556
  getState(key) {
2508
2557
  return defer(() =>
2509
2558
  // check if key exists
@@ -2685,8 +2734,8 @@ class EuiAppShellService {
2685
2734
  * Example for 50% width: calc(var(--eui-app-vw, 1vw) * 50);
2686
2735
  */
2687
2736
  setAppViewportCssVars() {
2688
- let vh = window.innerHeight * 0.01;
2689
- let vw = window.innerWidth * 0.01;
2737
+ const vh = window.innerHeight * 0.01;
2738
+ const vw = window.innerWidth * 0.01;
2690
2739
  this._setCssVarValue('--eui-app-vh', `${vh}px`);
2691
2740
  this._setCssVarValue('--eui-app-vw', `${vw}px`);
2692
2741
  }
@@ -2706,6 +2755,103 @@ class EuiAppShellService {
2706
2755
  }, false);
2707
2756
  this._setCssVarValue('--eui-base-font-size', newsize);
2708
2757
  }
2758
+ /**
2759
+ * @deprecated don't remove as it's used for external legacy project under v17 (csdr-eui-legacy) to support MWP transition
2760
+ */
2761
+ openModal(modalId) {
2762
+ document.body.classList.add('modal-open');
2763
+ if (!modalId) {
2764
+ modalId = 'single_modal';
2765
+ }
2766
+ this.activeModals.push({
2767
+ id: modalId,
2768
+ isOpen: true,
2769
+ });
2770
+ setTimeout(() => {
2771
+ const el = document.getElementById(modalId + '-close-button');
2772
+ if (el) {
2773
+ el.focus();
2774
+ }
2775
+ }, 100);
2776
+ }
2777
+ /**
2778
+ * @deprecated don't remove as it's used for external legacy project under v17 (csdr-eui-legacy) to support MWP transition
2779
+ */
2780
+ openMessageBox(messageBoxId) {
2781
+ if (!messageBoxId) {
2782
+ messageBoxId = 'messagebox_modal';
2783
+ }
2784
+ this.openModal(messageBoxId);
2785
+ }
2786
+ /**
2787
+ * @deprecated don't remove as it's used for external legacy project under v17 (csdr-eui-legacy) to support MWP transition
2788
+ */
2789
+ closeMessageBox(messageBoxId) {
2790
+ if (!messageBoxId) {
2791
+ messageBoxId = 'messagebox_modal';
2792
+ }
2793
+ this.closeModal(messageBoxId);
2794
+ }
2795
+ /**
2796
+ * @deprecated don't remove as it's used for external legacy project under v17 (csdr-eui-legacy) to support MWP transition
2797
+ */
2798
+ isModalOpen(modalId) {
2799
+ if (!modalId) {
2800
+ modalId = 'single_modal';
2801
+ }
2802
+ if (this.activeModals.length) {
2803
+ const modalIndex = this.findModalIndex(modalId);
2804
+ if (modalIndex !== -1) {
2805
+ return this.activeModals[modalIndex].isOpen;
2806
+ }
2807
+ }
2808
+ return false;
2809
+ }
2810
+ /**
2811
+ * @deprecated don't remove as it's used for external legacy project under v17 (csdr-eui-legacy) to support MWP transition
2812
+ */
2813
+ closeModal(modalId) {
2814
+ if (!modalId) {
2815
+ modalId = 'single_modal';
2816
+ }
2817
+ /**
2818
+ * Make sure we find the modal before splicing the activeModals array
2819
+ */
2820
+ const index = this.findModalIndex(modalId);
2821
+ if (index >= 0) {
2822
+ this.activeModals.splice(index, 1);
2823
+ }
2824
+ if (this.activeModals && this.activeModals.length <= 0) {
2825
+ document.body.classList.remove('modal-open');
2826
+ }
2827
+ else {
2828
+ // If there is still another (parent) modal dialog open, ensure it is focused upon to be able to close is with the ESC key:
2829
+ const lastModalId = this.activeModals[this.activeModals.length - 1].id;
2830
+ if (lastModalId) {
2831
+ setTimeout(() => {
2832
+ const el = document.getElementById(lastModalId + '-close-button');
2833
+ if (el) {
2834
+ el.focus();
2835
+ }
2836
+ }, 100);
2837
+ }
2838
+ }
2839
+ }
2840
+ /**
2841
+ * @deprecated don't remove as it's used for external legacy project under v17 (csdr-eui-legacy) to support MWP transition
2842
+ */
2843
+ findModalIndex(modalId) {
2844
+ let index = -1;
2845
+ if (this.activeModals.length) {
2846
+ for (let i = 0; i < this.activeModals.length; i++) {
2847
+ if (this.activeModals[i].id === modalId) {
2848
+ index = i;
2849
+ break;
2850
+ }
2851
+ }
2852
+ }
2853
+ return index;
2854
+ }
2709
2855
  // ---------------
2710
2856
  // private getters
2711
2857
  // ---------------
@@ -2721,7 +2867,7 @@ class EuiAppShellService {
2721
2867
  document.documentElement.style.setProperty(varName, varValue);
2722
2868
  }
2723
2869
  getWrapperClasses(state, breakpoint) {
2724
- let classes = [];
2870
+ const classes = [];
2725
2871
  classes.push(breakpoint);
2726
2872
  if (state.hasSidebar) {
2727
2873
  if (state.isSidebarOpen && (state.isSidebarActive || state.isSidebarInnerActive)) {
@@ -2814,12 +2960,14 @@ class EuiAppShellService {
2814
2960
  };
2815
2961
  }
2816
2962
  getJson(url) {
2817
- return this.http.get(url).toPromise().then(this.extractData).catch(this.handleError);
2963
+ return firstValueFrom(this.http.get(url)).then(this.extractData).catch(this.handleError);
2818
2964
  }
2819
2965
  extractData(res) {
2820
2966
  const body = res;
2821
2967
  return body || {};
2822
2968
  }
2969
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
2970
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2823
2971
  handleError(error) {
2824
2972
  console.error('An error occurred', error);
2825
2973
  return Promise.reject(error.message || error);
@@ -2834,10 +2982,10 @@ class EuiAppShellService {
2834
2982
  }
2835
2983
  });
2836
2984
  }
2837
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiAppShellService, deps: [{ token: GLOBAL_CONFIG_TOKEN, optional: true }, { token: i1$5.HttpClient }, { token: PLATFORM_ID }, { token: i1$4.Router }, { token: StoreService }, { token: I18nService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2838
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiAppShellService, providedIn: 'root' }); }
2985
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiAppShellService, deps: [{ token: GLOBAL_CONFIG_TOKEN, optional: true }, { token: i1$5.HttpClient }, { token: PLATFORM_ID }, { token: i1$4.Router }, { token: StoreService }, { token: I18nService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2986
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiAppShellService, providedIn: 'root' }); }
2839
2987
  }
2840
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiAppShellService, decorators: [{
2988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiAppShellService, decorators: [{
2841
2989
  type: Injectable,
2842
2990
  args: [{
2843
2991
  providedIn: 'root',
@@ -3561,10 +3709,10 @@ class EuiTimezoneService {
3561
3709
  getTimezone(tz) {
3562
3710
  return EUI_TIMEZONES.find((item) => item.name === tz);
3563
3711
  }
3564
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiTimezoneService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3565
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiTimezoneService }); }
3712
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiTimezoneService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3713
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiTimezoneService }); }
3566
3714
  }
3567
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuiTimezoneService, decorators: [{
3715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuiTimezoneService, decorators: [{
3568
3716
  type: Injectable
3569
3717
  }] });
3570
3718
 
@@ -3602,18 +3750,26 @@ class AsyncStorageService extends StorageService {
3602
3750
  }
3603
3751
 
3604
3752
  class AsyncStorageServiceMock extends AsyncStorageService {
3753
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3754
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3605
3755
  ready() {
3606
3756
  return of({});
3607
3757
  }
3608
3758
  name() {
3609
3759
  return null;
3610
3760
  }
3761
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3762
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3611
3763
  get() {
3612
3764
  return of({});
3613
3765
  }
3766
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3767
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3614
3768
  set() {
3615
3769
  return of({});
3616
3770
  }
3771
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3772
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3617
3773
  remove() {
3618
3774
  return of({});
3619
3775
  }
@@ -3641,6 +3797,8 @@ class LocalStorageService extends StorageService {
3641
3797
  * @param key the associated key
3642
3798
  * @returns the value or undefined, if case of error
3643
3799
  */
3800
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3801
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3644
3802
  get(key) {
3645
3803
  try {
3646
3804
  const serialized = localStorage.getItem(key);
@@ -3658,6 +3816,8 @@ class LocalStorageService extends StorageService {
3658
3816
  * @param key the associated key
3659
3817
  * @param value the value to set
3660
3818
  */
3819
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3820
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3661
3821
  set(key, value) {
3662
3822
  try {
3663
3823
  const serialized = JSON.stringify(value);
@@ -3683,10 +3843,10 @@ class LocalStorageService extends StorageService {
3683
3843
  }
3684
3844
  }
3685
3845
  }
3686
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocalStorageService, deps: [{ token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3687
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocalStorageService }); }
3846
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocalStorageService, deps: [{ token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3847
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocalStorageService }); }
3688
3848
  }
3689
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocalStorageService, decorators: [{
3849
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocalStorageService, decorators: [{
3690
3850
  type: Injectable
3691
3851
  }], ctorParameters: () => [{ type: LogService, decorators: [{
3692
3852
  type: Optional
@@ -3712,6 +3872,8 @@ class SessionStorageService extends StorageService {
3712
3872
  * @param key the associated key
3713
3873
  * @returns the value or undefined, if case of error
3714
3874
  */
3875
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3876
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3715
3877
  get(key) {
3716
3878
  try {
3717
3879
  const serialized = sessionStorage.getItem(key);
@@ -3729,6 +3891,8 @@ class SessionStorageService extends StorageService {
3729
3891
  * @param key the associated key
3730
3892
  * @param value the value to set
3731
3893
  */
3894
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3895
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3732
3896
  set(key, value) {
3733
3897
  try {
3734
3898
  const serialized = JSON.stringify(value);
@@ -3754,17 +3918,21 @@ class SessionStorageService extends StorageService {
3754
3918
  }
3755
3919
  }
3756
3920
  }
3757
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: SessionStorageService, deps: [{ token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3758
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: SessionStorageService }); }
3921
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: SessionStorageService, deps: [{ token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3922
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: SessionStorageService }); }
3759
3923
  }
3760
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: SessionStorageService, decorators: [{
3924
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: SessionStorageService, decorators: [{
3761
3925
  type: Injectable
3762
3926
  }], ctorParameters: () => [{ type: LogService, decorators: [{
3763
3927
  type: Optional
3764
3928
  }] }] });
3765
3929
 
3766
3930
  /** @internal */
3931
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3932
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3767
3933
  const localForage = 'defineDriver' in lf ? lf : lf['default'];
3934
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3935
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3768
3936
  const LOCAL_FORAGE_SERVICE_CONFIG_TOKEN = new InjectionToken('LOCAL_FORAGE_SERVICE_CONFIG');
3769
3937
  /**
3770
3938
  * localforage service, using the localForage javascript library
@@ -3772,7 +3940,10 @@ const LOCAL_FORAGE_SERVICE_CONFIG_TOKEN = new InjectionToken('LOCAL_FORAGE_SERVI
3772
3940
  */
3773
3941
  class LocalForageService extends AsyncStorageService {
3774
3942
  static { this.NAME = 'LocalForageService'; }
3775
- constructor(config, log) {
3943
+ constructor(
3944
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3945
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3946
+ config, log) {
3776
3947
  super();
3777
3948
  this.config = config;
3778
3949
  this.log = log;
@@ -3791,11 +3962,16 @@ class LocalForageService extends AsyncStorageService {
3791
3962
  * reflects the readiness of the storage
3792
3963
  * @returns one time emission Observable<void>
3793
3964
  */
3965
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3966
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3794
3967
  ready() {
3795
- return from(localForage.ready()).pipe(take(1), tap(() => { }, (err) => {
3796
- if (this.log) {
3797
- this.log.error(this.name(), 'ready', err);
3798
- }
3968
+ return from(localForage.ready()).pipe(take(1), tap({
3969
+ next: () => { },
3970
+ error: (err) => {
3971
+ if (this.log) {
3972
+ this.log.error(this.name(), 'ready', err);
3973
+ }
3974
+ },
3799
3975
  }));
3800
3976
  }
3801
3977
  /**
@@ -3803,6 +3979,8 @@ class LocalForageService extends AsyncStorageService {
3803
3979
  * @param key the associated key
3804
3980
  * @returns one time emission Observable of value
3805
3981
  */
3982
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3983
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3806
3984
  get(key) {
3807
3985
  return from(localForage.getItem(key)).pipe(take(1), tap(() => { }, (err) => {
3808
3986
  if (this.log) {
@@ -3816,11 +3994,17 @@ class LocalForageService extends AsyncStorageService {
3816
3994
  * @param value the value to set
3817
3995
  * @returns one time emission Observable
3818
3996
  */
3997
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
3998
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3819
3999
  set(key, value) {
3820
- return from(localForage.setItem(key, value)).pipe(take(1), tap(() => { }, (err) => {
3821
- if (this.log) {
3822
- this.log.error(this.name(), 'set', err);
3823
- }
4000
+ return from(localForage.setItem(key, value)).pipe(take(1), tap({
4001
+ next: () => {
4002
+ },
4003
+ error: (err) => {
4004
+ if (this.log) {
4005
+ this.log.error(this.name(), 'set', err);
4006
+ }
4007
+ },
3824
4008
  }));
3825
4009
  }
3826
4010
  /**
@@ -3828,17 +4012,22 @@ class LocalForageService extends AsyncStorageService {
3828
4012
  * @param key the associated key
3829
4013
  * @returns one time emission Observable
3830
4014
  */
4015
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4016
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3831
4017
  remove(key) {
3832
- return from(localForage.removeItem(key)).pipe(take(1), tap(() => { }, (err) => {
3833
- if (this.log) {
3834
- this.log.error(this.name(), 'remove', err);
3835
- }
4018
+ return from(localForage.removeItem(key)).pipe(take(1), tap({
4019
+ next: () => { },
4020
+ error: (err) => {
4021
+ if (this.log) {
4022
+ this.log.error(this.name(), 'remove', err);
4023
+ }
4024
+ },
3836
4025
  }));
3837
4026
  }
3838
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocalForageService, deps: [{ token: LOCAL_FORAGE_SERVICE_CONFIG_TOKEN, optional: true }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3839
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocalForageService }); }
4027
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocalForageService, deps: [{ token: LOCAL_FORAGE_SERVICE_CONFIG_TOKEN, optional: true }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4028
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocalForageService }); }
3840
4029
  }
3841
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocalForageService, decorators: [{
4030
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocalForageService, decorators: [{
3842
4031
  type: Injectable
3843
4032
  }], ctorParameters: () => [{ type: undefined, decorators: [{
3844
4033
  type: Inject,
@@ -3886,7 +4075,9 @@ class LocaleService extends EuiService {
3886
4075
  }
3887
4076
  getState(keyOrMapFn) {
3888
4077
  let selector = getLocaleState;
3889
- let dotNotationToObject = (obj, key) => key.split('.').reduce((slice, i) => slice[i], obj);
4078
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4079
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4080
+ const dotNotationToObject = (obj, key) => key.split('.').reduce((slice, i) => slice[i], obj);
3890
4081
  if (keyOrMapFn) {
3891
4082
  switch (typeof keyOrMapFn) {
3892
4083
  case 'function':
@@ -4045,10 +4236,10 @@ class LocaleService extends EuiService {
4045
4236
  }
4046
4237
  });
4047
4238
  }
4048
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", 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 }); }
4049
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocaleService, providedIn: 'root' }); }
4239
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.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 }); }
4240
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocaleService, providedIn: 'root' }); }
4050
4241
  }
4051
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocaleService, decorators: [{
4242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocaleService, decorators: [{
4052
4243
  type: Injectable,
4053
4244
  args: [{
4054
4245
  providedIn: 'root',
@@ -4094,10 +4285,10 @@ class LocaleServiceMock extends LocaleService {
4094
4285
  this.DEFAULT_LOCALE = state.id || 'en';
4095
4286
  return of({ success: true });
4096
4287
  }
4097
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocaleServiceMock, deps: [{ token: LOCALE_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4098
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocaleServiceMock }); }
4288
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocaleServiceMock, deps: [{ token: LOCALE_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4289
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocaleServiceMock }); }
4099
4290
  }
4100
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: LocaleServiceMock, decorators: [{
4291
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: LocaleServiceMock, decorators: [{
4101
4292
  type: Injectable
4102
4293
  }], ctorParameters: () => [{ type: undefined, decorators: [{
4103
4294
  type: Optional
@@ -4124,7 +4315,9 @@ class UserService extends EuiService {
4124
4315
  }
4125
4316
  getState(keyOrMapFn) {
4126
4317
  let selector = getUserState;
4127
- let dotNotationToObject = (obj, key) => key.split('.').reduce((slice, i) => slice[i], obj);
4318
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4319
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4320
+ const dotNotationToObject = (obj, key) => key.split('.').reduce((slice, i) => slice[i], obj);
4128
4321
  if (keyOrMapFn) {
4129
4322
  switch (typeof keyOrMapFn) {
4130
4323
  case 'function':
@@ -4137,6 +4330,8 @@ class UserService extends EuiService {
4137
4330
  }
4138
4331
  return this.store.select(selector);
4139
4332
  }
4333
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4334
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4140
4335
  updateState(userState, reducer) {
4141
4336
  // if (typeof pathOrReducer === 'string') {
4142
4337
  // let dotNotationToObject = (obj, key) => key.split('.').reduce((obj, i) => obj[i], obj);
@@ -4150,13 +4345,15 @@ class UserService extends EuiService {
4150
4345
  this.store.dispatchAction(userState, 'user', reducer);
4151
4346
  }
4152
4347
  else {
4348
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4349
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4153
4350
  this.store.dispatch(new UpdateUserStateAction(userState));
4154
4351
  }
4155
4352
  }
4156
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: UserService, deps: [{ token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4157
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: UserService, providedIn: 'root' }); }
4353
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UserService, deps: [{ token: StoreService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4354
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UserService, providedIn: 'root' }); }
4158
4355
  }
4159
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: UserService, decorators: [{
4356
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UserService, decorators: [{
4160
4357
  type: Injectable,
4161
4358
  args: [{
4162
4359
  providedIn: 'root',
@@ -4167,27 +4364,21 @@ class UserServiceMock extends UserService {
4167
4364
  constructor() {
4168
4365
  super(null);
4169
4366
  }
4170
- loadUserDetails() {
4171
- return of({ userId: 'anonymous' });
4172
- }
4173
- observePreferencesUpdate() { }
4174
- loadUserPreferences() {
4175
- return of({});
4176
- }
4177
- saveUserPreferences() {
4178
- return of({});
4367
+ init(userState) {
4368
+ return of({ success: true });
4179
4369
  }
4180
- mergeUserPreferences() { }
4181
- userPreferences() {
4370
+ getState(keyOrMapFn) {
4182
4371
  return of({});
4183
4372
  }
4184
- getUserId() {
4185
- return of('anonymous');
4373
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4374
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4375
+ updateState(userState, reducer) {
4376
+ /* empty */
4186
4377
  }
4187
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: UserServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4188
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: UserServiceMock }); }
4378
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UserServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4379
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UserServiceMock }); }
4189
4380
  }
4190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: UserServiceMock, decorators: [{
4381
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UserServiceMock, decorators: [{
4191
4382
  type: Injectable
4192
4383
  }], ctorParameters: () => [] });
4193
4384
 
@@ -4216,12 +4407,12 @@ class AddLangParamInterceptor {
4216
4407
  params: req.params.set(langParam, langValue),
4217
4408
  }));
4218
4409
  }
4219
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: AddLangParamInterceptor, deps: [{ token: i1$3.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4220
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: AddLangParamInterceptor }); }
4410
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: AddLangParamInterceptor, deps: [{ token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4411
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: AddLangParamInterceptor }); }
4221
4412
  }
4222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: AddLangParamInterceptor, decorators: [{
4413
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: AddLangParamInterceptor, decorators: [{
4223
4414
  type: Injectable
4224
- }], ctorParameters: () => [{ type: i1$3.TranslateService }] });
4415
+ }], ctorParameters: () => [{ type: i1$2.TranslateService }] });
4225
4416
 
4226
4417
  class CachePreventionInterceptor {
4227
4418
  intercept(req, next) {
@@ -4235,10 +4426,10 @@ class CachePreventionInterceptor {
4235
4426
  headers: req.headers.set('Cache-Control', 'No-Cache'),
4236
4427
  }));
4237
4428
  }
4238
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CachePreventionInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4239
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CachePreventionInterceptor }); }
4429
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CachePreventionInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4430
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CachePreventionInterceptor }); }
4240
4431
  }
4241
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CachePreventionInterceptor, decorators: [{
4432
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CachePreventionInterceptor, decorators: [{
4242
4433
  type: Injectable
4243
4434
  }] });
4244
4435
 
@@ -4248,10 +4439,10 @@ class CorsSecurityInterceptor {
4248
4439
  withCredentials: true,
4249
4440
  }));
4250
4441
  }
4251
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CorsSecurityInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4252
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CorsSecurityInterceptor }); }
4442
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CorsSecurityInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4443
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CorsSecurityInterceptor }); }
4253
4444
  }
4254
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CorsSecurityInterceptor, decorators: [{
4445
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CorsSecurityInterceptor, decorators: [{
4255
4446
  type: Injectable
4256
4447
  }] });
4257
4448
 
@@ -4261,10 +4452,10 @@ class CsrfPreventionInterceptor {
4261
4452
  headers: request.headers.set('X-Requested-With', 'XMLHttpRequest'),
4262
4453
  }));
4263
4454
  }
4264
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CsrfPreventionInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4265
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CsrfPreventionInterceptor }); }
4455
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CsrfPreventionInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4456
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CsrfPreventionInterceptor }); }
4266
4457
  }
4267
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: CsrfPreventionInterceptor, decorators: [{
4458
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: CsrfPreventionInterceptor, decorators: [{
4268
4459
  type: Injectable
4269
4460
  }] });
4270
4461
 
@@ -4280,17 +4471,24 @@ class EuLoginSessionTimeoutHandlingInterceptor {
4280
4471
  this.checkRequestErrorForEULoginSessionTimeout(request, error);
4281
4472
  }));
4282
4473
  }
4474
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4475
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4283
4476
  checkRequestSuccessForEULoginSessionTimeout(request, event) {
4284
4477
  if (event instanceof HttpResponse) {
4478
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4479
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4285
4480
  if (this.isSsoResponse(event.body)) {
4286
4481
  this.reauthenticate();
4287
4482
  }
4288
4483
  }
4289
4484
  }
4290
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
4485
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4486
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4291
4487
  checkRequestErrorForEULoginSessionTimeout(request, response) {
4292
- // intentionally blank; meant for overriding
4488
+ /* intentionally blank; meant for overriding */
4293
4489
  }
4490
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4491
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4294
4492
  isSsoResponse(body) {
4295
4493
  if (body) {
4296
4494
  if (typeof body !== 'string') {
@@ -4329,10 +4527,10 @@ class EuLoginSessionTimeoutHandlingInterceptor {
4329
4527
  reauthenticate() {
4330
4528
  document.location.reload();
4331
4529
  }
4332
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4333
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor }); }
4530
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4531
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor }); }
4334
4532
  }
4335
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor, decorators: [{
4533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: EuLoginSessionTimeoutHandlingInterceptor, decorators: [{
4336
4534
  type: Injectable
4337
4535
  }] });
4338
4536
 
@@ -4341,8 +4539,13 @@ class UxRequestErrorModelInterceptor {
4341
4539
  constructor(errorMappingHandler) {
4342
4540
  this.errorMappingHandler = errorMappingHandler;
4343
4541
  }
4542
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4543
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4344
4544
  intercept(req, next) {
4345
- return next.handle(req).pipe(catchError((err) => {
4545
+ return next.handle(req).pipe(
4546
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4547
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4548
+ catchError((err) => {
4346
4549
  if (this.errorMappingHandler) {
4347
4550
  if (err instanceof HttpErrorResponse) {
4348
4551
  err = transformToUxHttpResponse(err, this.errorMappingHandler);
@@ -4351,10 +4554,10 @@ class UxRequestErrorModelInterceptor {
4351
4554
  return of(err);
4352
4555
  }));
4353
4556
  }
4354
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: UxRequestErrorModelInterceptor, deps: [{ token: UX_ERROR_MAPPING_HANDLER_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
4355
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: UxRequestErrorModelInterceptor }); }
4557
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UxRequestErrorModelInterceptor, deps: [{ token: UX_ERROR_MAPPING_HANDLER_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
4558
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UxRequestErrorModelInterceptor }); }
4356
4559
  }
4357
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: UxRequestErrorModelInterceptor, decorators: [{
4560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: UxRequestErrorModelInterceptor, decorators: [{
4358
4561
  type: Injectable
4359
4562
  }], ctorParameters: () => [{ type: undefined, decorators: [{
4360
4563
  type: Inject,
@@ -4370,14 +4573,25 @@ class OpenIdConnectInterceptor {
4370
4573
  console.error('Please include the script openid-login.js in your index.html file.', 'For more details, please consult the documentation regarding the Http Interceptors and OpenID Connect configuration.');
4371
4574
  }
4372
4575
  }
4373
- intercept(request, next, retryCount = 0, retryCallback) {
4576
+ intercept(
4577
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4578
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4579
+ request, next, retryCount = 0,
4580
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4581
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4582
+ retryCallback) {
4374
4583
  if (typeof OpenIdConnect !== 'undefined') {
4375
4584
  let authorizedRequest = retryCallback;
4376
4585
  if (!authorizedRequest) {
4586
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4587
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4377
4588
  authorizedRequest = new Subject();
4378
4589
  }
4379
4590
  let subscription = null;
4380
- OpenIdConnect.getAuthorizationHeaders(request.urlWithParams, (headers) => {
4591
+ OpenIdConnect.getAuthorizationHeaders(request.urlWithParams,
4592
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4593
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4594
+ (headers) => {
4381
4595
  let newRequest = request;
4382
4596
  if (headers) {
4383
4597
  let newHeaders = request.headers;
@@ -4402,6 +4616,8 @@ class OpenIdConnectInterceptor {
4402
4616
  subscription = next
4403
4617
  .handle(newRequest)
4404
4618
  .pipe(catchError((response) => this.handleErrorResponse(response, request, next, retryCount, authorizedRequest, subscription)))
4619
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4620
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4405
4621
  .subscribe((httpEvent) => {
4406
4622
  if (httpEvent) {
4407
4623
  authorizedRequest.next(httpEvent);
@@ -4414,6 +4630,8 @@ class OpenIdConnectInterceptor {
4414
4630
  }
4415
4631
  });
4416
4632
  }, (errorResponse) => {
4633
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4634
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4417
4635
  const errorProperties = {
4418
4636
  error: errorResponse,
4419
4637
  };
@@ -4434,7 +4652,13 @@ class OpenIdConnectInterceptor {
4434
4652
  return next.handle(request);
4435
4653
  }
4436
4654
  }
4437
- handleErrorResponse(response, originalRequest, next, retryCount = 0, retryCallback, subscription) {
4655
+ handleErrorResponse(response,
4656
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4657
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4658
+ originalRequest, next, retryCount = 0,
4659
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4660
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4661
+ retryCallback, subscription) {
4438
4662
  if (response) {
4439
4663
  if (response.error && response.error.error === 'invalid_request') {
4440
4664
  // The ID token is invalid or incorrect; retrieve another one:
@@ -4467,7 +4691,13 @@ class OpenIdConnectInterceptor {
4467
4691
  }
4468
4692
  return throwError(response);
4469
4693
  }
4470
- retryRequest(originalRequest, response, next, retryCount = 0, retryCallback, subscription) {
4694
+ retryRequest(
4695
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4696
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4697
+ originalRequest, response, next, retryCount = 0,
4698
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4699
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4700
+ retryCallback, subscription) {
4471
4701
  if (retryCount < this.maximumRequestRetries()) {
4472
4702
  this.intercept(originalRequest, next, retryCount + 1, retryCallback);
4473
4703
  }
@@ -4484,6 +4714,8 @@ class OpenIdConnectInterceptor {
4484
4714
  retryCallback.complete();
4485
4715
  }
4486
4716
  }
4717
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4718
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4487
4719
  return of(null);
4488
4720
  }
4489
4721
  apiGatewayTokenExpired(response) {
@@ -4503,10 +4735,10 @@ class OpenIdConnectInterceptor {
4503
4735
  return this.defaultMaximumRequestRetries;
4504
4736
  }
4505
4737
  }
4506
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: OpenIdConnectInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4507
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: OpenIdConnectInterceptor }); }
4738
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: OpenIdConnectInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4739
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: OpenIdConnectInterceptor }); }
4508
4740
  }
4509
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: OpenIdConnectInterceptor, decorators: [{
4741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: OpenIdConnectInterceptor, decorators: [{
4510
4742
  type: Injectable
4511
4743
  }], ctorParameters: () => [] });
4512
4744
 
@@ -4514,6 +4746,8 @@ class OpenIdConnectService {
4514
4746
  constructor() {
4515
4747
  this.userDetails = new Observable((observer) => {
4516
4748
  if (typeof ApiGateway !== 'undefined') {
4749
+ // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
4750
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4517
4751
  ApiGateway.getUser((user) => {
4518
4752
  if (user) {
4519
4753
  observer.next({
@@ -4553,10 +4787,10 @@ class OpenIdConnectService {
4553
4787
  getUserDetails() {
4554
4788
  return this.userDetails;
4555
4789
  }
4556
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: OpenIdConnectService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4557
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: OpenIdConnectService, providedIn: 'root' }); }
4790
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: OpenIdConnectService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4791
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: OpenIdConnectService, providedIn: 'root' }); }
4558
4792
  }
4559
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.7", ngImport: i0, type: OpenIdConnectService, decorators: [{
4793
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: OpenIdConnectService, decorators: [{
4560
4794
  type: Injectable,
4561
4795
  args: [{
4562
4796
  providedIn: 'root',
@@ -4575,5 +4809,5 @@ class OpenIdConnectServiceMock extends OpenIdConnectService {
4575
4809
  * Generated bundle index. Do not edit.
4576
4810
  */
4577
4811
 
4578
- 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, DYNAMIC_COMPONENT_CONFIG, EUI_CONFIG_TOKEN, EUI_COUNTRIES, EUI_TIMEZONES, EmptyApiQueueAction, ErrorSubClass, EuLoginSessionTimeoutHandlingInterceptor, EuiAppShellService, EuiCoreRootGuardClass, EuiDynamicComponentService, EuiDynamicMenuService, EuiError, EuiGrowlService, EuiPermissionService, EuiTimezoneService, GLOBAL_CONFIG_TOKEN, GlobalErrorHandler, GrowlHttpErrorCallbackFn, HTTP_ERROR_HANDLER_CONFIG_TOKEN, HttpErrorHandlerInterceptor, I18nLoader, I18nResourceImpl, I18nService, I18nServiceMock, 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, OpenIdConnectInterceptor, OpenIdConnectService, OpenIdConnectServiceMock, ROOT_LOG_CONFIG_TOKEN, RemoveApiQueueItemAction, SHOW_CONNECTION_STATUS_TOKEN, SessionStorageService, 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, position, preInitApp, prepareEuiAppConfigToken, coreReducers as reducers, sessionStorageSync, translateConfig, uniqueId, validateEmail };
4812
+ 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, DYNAMIC_COMPONENT_CONFIG, EUI_CONFIG_TOKEN, EUI_COUNTRIES, EUI_TIMEZONES, EmptyApiQueueAction, ErrorSubClass, EuLoginSessionTimeoutHandlingInterceptor, EuiAppShellService, EuiCoreRootGuardClass, EuiDynamicComponentService, EuiDynamicMenuService, EuiError, EuiGrowlService, EuiPermissionService, 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, OpenIdConnectInterceptor, OpenIdConnectService, OpenIdConnectServiceMock, ROOT_LOG_CONFIG_TOKEN, RemoveApiQueueItemAction, SHOW_CONNECTION_STATUS_TOKEN, SessionStorageService, 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, position, preInitApp, prepareEuiAppConfigToken, coreReducers as reducers, sessionStorageSync, translateConfig, uniqueId, validateEmail };
4579
4813
  //# sourceMappingURL=eui-core.mjs.map