@igo2/core 17.0.0-next.0 → 17.0.0-next.11

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 (322) hide show
  1. package/activity/index.d.ts +5 -0
  2. package/{lib/activity/index.d.ts → activity/public_api.d.ts} +1 -0
  3. package/{lib/analytics/shared → analytics}/analytics.interface.d.ts +1 -1
  4. package/{lib/analytics/shared → analytics}/analytics.service.d.ts +1 -1
  5. package/analytics/index.d.ts +5 -0
  6. package/{lib/config → config}/config.interface.d.ts +2 -3
  7. package/{lib/config → config}/config.module.d.ts +3 -0
  8. package/config/config.provider.d.ts +6 -0
  9. package/{lib/config → config}/config.service.d.ts +1 -1
  10. package/config/index.d.ts +5 -0
  11. package/{lib/config/index.d.ts → config/public_api.d.ts} +2 -0
  12. package/environment/environment.interface.d.ts +16 -0
  13. package/environment/index.d.ts +5 -0
  14. package/esm2022/activity/activity.interceptor.mjs +32 -0
  15. package/esm2022/activity/activity.module.mjs +30 -0
  16. package/esm2022/activity/activity.service.mjs +32 -0
  17. package/esm2022/activity/igo2-core-activity.mjs +5 -0
  18. package/esm2022/activity/public_api.mjs +4 -0
  19. package/esm2022/analytics/analytics.interface.mjs +2 -0
  20. package/esm2022/analytics/analytics.service.mjs +87 -0
  21. package/esm2022/analytics/igo2-core-analytics.mjs +5 -0
  22. package/esm2022/analytics/public_api.mjs +3 -0
  23. package/esm2022/config/config-deprecated.mjs +27 -0
  24. package/esm2022/config/config.interface.mjs +2 -0
  25. package/esm2022/config/config.module.mjs +26 -0
  26. package/esm2022/config/config.provider.mjs +21 -0
  27. package/esm2022/config/config.service.mjs +98 -0
  28. package/esm2022/config/igo2-core-config.mjs +5 -0
  29. package/esm2022/config/public_api.mjs +6 -0
  30. package/esm2022/config/version.mjs +5 -0
  31. package/esm2022/environment/environment.interface.mjs +2 -0
  32. package/esm2022/environment/igo2-core-environment.mjs +5 -0
  33. package/esm2022/environment/public_api.mjs +2 -0
  34. package/esm2022/gesture/gesture.module.mjs +29 -0
  35. package/esm2022/gesture/gesture.provider.mjs +16 -0
  36. package/esm2022/gesture/igo2-core-gesture.mjs +5 -0
  37. package/esm2022/gesture/public_api.mjs +3 -0
  38. package/esm2022/language/igo2-core-language.mjs +5 -0
  39. package/esm2022/language/language.module.mjs +15 -0
  40. package/esm2022/language/public_api.mjs +3 -0
  41. package/esm2022/language/shared/index.mjs +7 -0
  42. package/esm2022/language/shared/language-mock.provider.mjs +13 -0
  43. package/esm2022/language/shared/language.interface.mjs +3 -0
  44. package/esm2022/language/shared/language.loader.mjs +38 -0
  45. package/esm2022/language/shared/language.provider.mjs +47 -0
  46. package/esm2022/language/shared/language.service.mjs +38 -0
  47. package/esm2022/language/shared/missing-translation.guard.mjs +16 -0
  48. package/esm2022/lib/core.module.mjs +21 -47
  49. package/esm2022/media/igo2-core-media.mjs +5 -0
  50. package/esm2022/media/media.enum.mjs +12 -0
  51. package/esm2022/media/media.service.mjs +82 -0
  52. package/esm2022/media/public_api.mjs +3 -0
  53. package/esm2022/message/igo2-core-message.mjs +5 -0
  54. package/esm2022/message/message.module.mjs +26 -0
  55. package/esm2022/message/public_api.mjs +3 -0
  56. package/esm2022/message/shared/index.mjs +5 -0
  57. package/esm2022/message/shared/message.enum.mjs +10 -0
  58. package/esm2022/message/shared/message.interface.mjs +2 -0
  59. package/esm2022/message/shared/message.provider.mjs +22 -0
  60. package/esm2022/message/shared/message.service.mjs +225 -0
  61. package/esm2022/monitoring/__mocks__/index.mjs +2 -0
  62. package/esm2022/monitoring/__mocks__/monitoring-mock.mjs +7 -0
  63. package/esm2022/monitoring/igo2-core-monitoring.mjs +5 -0
  64. package/esm2022/monitoring/monitoring.provider.mjs +20 -0
  65. package/esm2022/monitoring/public_api.mjs +5 -0
  66. package/esm2022/monitoring/sentry/index.mjs +4 -0
  67. package/esm2022/monitoring/sentry/sentry.interface.mjs +2 -0
  68. package/esm2022/monitoring/sentry/sentry.mjs +29 -0
  69. package/esm2022/monitoring/sentry/sentry.provider.mjs +31 -0
  70. package/esm2022/monitoring/sentry/sentry.utils.mjs +14 -0
  71. package/esm2022/monitoring/shared/any-monitoring.interface.mjs +2 -0
  72. package/esm2022/monitoring/shared/index.mjs +3 -0
  73. package/esm2022/monitoring/shared/monitoring.interface.mjs +2 -0
  74. package/esm2022/network/igo2-core-network.mjs +5 -0
  75. package/esm2022/network/network.interfaces.mjs +2 -0
  76. package/esm2022/network/network.service.mjs +66 -0
  77. package/esm2022/network/public_api.mjs +3 -0
  78. package/esm2022/public_api.mjs +3 -26
  79. package/esm2022/regex/igo2-core-regex.mjs +5 -0
  80. package/esm2022/regex/public_api.mjs +3 -0
  81. package/esm2022/regex/regex.interface.mjs +2 -0
  82. package/esm2022/regex/regex.service.mjs +30 -0
  83. package/esm2022/request/error.interceptor.mjs +72 -0
  84. package/esm2022/request/error.module.mjs +39 -0
  85. package/esm2022/request/igo2-core-request.mjs +5 -0
  86. package/esm2022/request/logging.interceptor.mjs +29 -0
  87. package/esm2022/request/logging.module.mjs +30 -0
  88. package/esm2022/request/public_api.mjs +5 -0
  89. package/esm2022/route/igo2-core-route.mjs +5 -0
  90. package/esm2022/route/public_api.mjs +3 -0
  91. package/esm2022/route/route.interface.mjs +2 -0
  92. package/esm2022/route/route.service.mjs +75 -0
  93. package/esm2022/storage/igo2-core-storage.mjs +5 -0
  94. package/esm2022/storage/public_api.mjs +4 -0
  95. package/esm2022/storage/storage.interface.mjs +13 -0
  96. package/esm2022/storage/storage.mjs +76 -0
  97. package/esm2022/storage/storage.service.mjs +21 -0
  98. package/esm2022/user/igo2-core-user.mjs +5 -0
  99. package/esm2022/user/public_api.mjs +2 -0
  100. package/esm2022/user/user.interface.mjs +2 -0
  101. package/fesm2022/igo2-core-activity.mjs +94 -0
  102. package/fesm2022/igo2-core-activity.mjs.map +1 -0
  103. package/fesm2022/igo2-core-analytics.mjs +93 -0
  104. package/fesm2022/igo2-core-analytics.mjs.map +1 -0
  105. package/fesm2022/igo2-core-config.mjs +177 -0
  106. package/fesm2022/igo2-core-config.mjs.map +1 -0
  107. package/fesm2022/igo2-core-environment.mjs +4 -0
  108. package/fesm2022/igo2-core-environment.mjs.map +1 -0
  109. package/fesm2022/igo2-core-gesture.mjs +48 -0
  110. package/fesm2022/igo2-core-gesture.mjs.map +1 -0
  111. package/fesm2022/igo2-core-language.mjs +164 -0
  112. package/fesm2022/igo2-core-language.mjs.map +1 -0
  113. package/fesm2022/igo2-core-media.mjs +100 -0
  114. package/fesm2022/igo2-core-media.mjs.map +1 -0
  115. package/fesm2022/igo2-core-message.mjs +282 -0
  116. package/fesm2022/igo2-core-message.mjs.map +1 -0
  117. package/fesm2022/igo2-core-monitoring.mjs +101 -0
  118. package/fesm2022/igo2-core-monitoring.mjs.map +1 -0
  119. package/fesm2022/igo2-core-network.mjs +72 -0
  120. package/fesm2022/igo2-core-network.mjs.map +1 -0
  121. package/fesm2022/igo2-core-regex.mjs +36 -0
  122. package/fesm2022/igo2-core-regex.mjs.map +1 -0
  123. package/fesm2022/igo2-core-request.mjs +164 -0
  124. package/fesm2022/igo2-core-request.mjs.map +1 -0
  125. package/fesm2022/igo2-core-route.mjs +81 -0
  126. package/fesm2022/igo2-core-route.mjs.map +1 -0
  127. package/fesm2022/igo2-core-storage.mjs +114 -0
  128. package/fesm2022/igo2-core-storage.mjs.map +1 -0
  129. package/fesm2022/igo2-core-user.mjs +4 -0
  130. package/fesm2022/igo2-core-user.mjs.map +1 -0
  131. package/fesm2022/igo2-core.mjs +24 -1549
  132. package/fesm2022/igo2-core.mjs.map +1 -1
  133. package/gesture/index.d.ts +5 -0
  134. package/gesture/public_api.d.ts +2 -0
  135. package/language/index.d.ts +5 -0
  136. package/language/public_api.d.ts +2 -0
  137. package/language/shared/language-mock.provider.d.ts +2 -0
  138. package/{lib/language → language}/shared/language.loader.d.ts +1 -1
  139. package/{lib/language → language}/shared/language.provider.d.ts +1 -1
  140. package/lib/core.module.d.ts +8 -11
  141. package/locale/en.core.json +28 -28
  142. package/locale/en.json +1 -1
  143. package/locale/fr.core.json +28 -28
  144. package/locale/fr.json +1 -1
  145. package/media/index.d.ts +5 -0
  146. package/message/index.d.ts +5 -0
  147. package/{lib/message → message}/message.module.d.ts +4 -3
  148. package/message/public_api.d.ts +2 -0
  149. package/{lib/message → message}/shared/index.d.ts +1 -0
  150. package/message/shared/message.provider.d.ts +2 -0
  151. package/{lib/message → message}/shared/message.service.d.ts +2 -2
  152. package/{src/lib/message → message/src}/message.theming.scss +26 -26
  153. package/monitoring/__mocks__/index.d.ts +1 -0
  154. package/monitoring/__mocks__/monitoring-mock.d.ts +4 -0
  155. package/monitoring/index.d.ts +5 -0
  156. package/{lib/monitoring/index.d.ts → monitoring/public_api.d.ts} +1 -0
  157. package/{lib/monitoring → monitoring}/sentry/sentry.utils.d.ts +1 -1
  158. package/network/index.d.ts +5 -0
  159. package/{lib/network → network}/network.service.d.ts +1 -1
  160. package/package.json +94 -2
  161. package/public_api.d.ts +1 -25
  162. package/regex/index.d.ts +5 -0
  163. package/{lib/regex → regex}/regex.service.d.ts +1 -1
  164. package/{lib/request → request}/error.interceptor.d.ts +1 -1
  165. package/request/index.d.ts +5 -0
  166. package/{lib/request/index.d.ts → request/public_api.d.ts} +2 -0
  167. package/route/index.d.ts +5 -0
  168. package/route/public_api.d.ts +2 -0
  169. package/src/core-theme.scss +5 -5
  170. package/src/index.scss +6 -6
  171. package/src/packages.import.scss +5 -5
  172. package/src/style/all-style.scss +3 -3
  173. package/src/style/layout.scss +163 -163
  174. package/src/style/partial/core-utils.scss +5 -5
  175. package/src/style/partial/core.variables.scss +5 -5
  176. package/src/style/partial/media.scss +80 -80
  177. package/src/style/style.scss +19 -19
  178. package/src/theming/all-theme.scss +15 -15
  179. package/src/theming/material-theme-override.scss +39 -39
  180. package/src/theming/prebuilt-themes/blue-theme.scss +27 -27
  181. package/src/theming/prebuilt-themes/bluedark-theme.scss +60 -60
  182. package/src/theming/prebuilt-themes/bluedq-theme.scss +60 -60
  183. package/src/theming/prebuilt-themes/bluegrey-theme.scss +26 -26
  184. package/src/theming/prebuilt-themes/dark-theme.scss +26 -26
  185. package/src/theming/prebuilt-themes/deeppurple-theme.scss +26 -26
  186. package/src/theming/prebuilt-themes/indigo-theme.scss +26 -26
  187. package/src/theming/prebuilt-themes/orange-theme.scss +26 -26
  188. package/src/theming/prebuilt-themes/teal-theme.scss +26 -26
  189. package/src/theming/typography.scss +28 -28
  190. package/src/theming/utils/_foreground.scss +22 -22
  191. package/storage/index.d.ts +5 -0
  192. package/{lib/storage → storage}/storage.d.ts +1 -1
  193. package/{lib/storage → storage}/storage.service.d.ts +1 -1
  194. package/style/all-style.css +2 -1
  195. package/theming/prebuilt-themes/blue-theme.css +71 -68
  196. package/theming/prebuilt-themes/bluedark-theme.css +71 -68
  197. package/theming/prebuilt-themes/bluedq-theme.css +75 -72
  198. package/theming/prebuilt-themes/bluegrey-theme.css +71 -68
  199. package/theming/prebuilt-themes/dark-theme.css +71 -68
  200. package/theming/prebuilt-themes/deeppurple-theme.css +71 -68
  201. package/theming/prebuilt-themes/indigo-theme.css +71 -68
  202. package/theming/prebuilt-themes/orange-theme.css +79 -76
  203. package/theming/prebuilt-themes/teal-theme.css +71 -68
  204. package/user/index.d.ts +5 -0
  205. package/esm2022/lib/activity/activity.interceptor.mjs +0 -32
  206. package/esm2022/lib/activity/activity.module.mjs +0 -30
  207. package/esm2022/lib/activity/activity.service.mjs +0 -32
  208. package/esm2022/lib/activity/index.mjs +0 -3
  209. package/esm2022/lib/analytics/index.mjs +0 -2
  210. package/esm2022/lib/analytics/shared/analytics.interface.mjs +0 -2
  211. package/esm2022/lib/analytics/shared/analytics.service.mjs +0 -87
  212. package/esm2022/lib/analytics/shared/index.mjs +0 -3
  213. package/esm2022/lib/compression/compressedData.interface.mjs +0 -2
  214. package/esm2022/lib/compression/compression.service.mjs +0 -142
  215. package/esm2022/lib/compression/index.mjs +0 -3
  216. package/esm2022/lib/config/config-deprecated.mjs +0 -27
  217. package/esm2022/lib/config/config.interface.mjs +0 -2
  218. package/esm2022/lib/config/config.module.mjs +0 -23
  219. package/esm2022/lib/config/config.provider.mjs +0 -21
  220. package/esm2022/lib/config/config.service.mjs +0 -97
  221. package/esm2022/lib/config/index.mjs +0 -4
  222. package/esm2022/lib/config/version.mjs +0 -5
  223. package/esm2022/lib/environment/environment.interface.mjs +0 -2
  224. package/esm2022/lib/environment/index.mjs +0 -2
  225. package/esm2022/lib/gesture/gesture.module.mjs +0 -29
  226. package/esm2022/lib/gesture/gesture.provider.mjs +0 -16
  227. package/esm2022/lib/language/index.mjs +0 -2
  228. package/esm2022/lib/language/language.module.mjs +0 -15
  229. package/esm2022/lib/language/shared/index.mjs +0 -7
  230. package/esm2022/lib/language/shared/language-mock.provider.mjs +0 -5
  231. package/esm2022/lib/language/shared/language.interface.mjs +0 -3
  232. package/esm2022/lib/language/shared/language.loader.mjs +0 -38
  233. package/esm2022/lib/language/shared/language.provider.mjs +0 -41
  234. package/esm2022/lib/language/shared/language.service.mjs +0 -38
  235. package/esm2022/lib/language/shared/missing-translation.guard.mjs +0 -16
  236. package/esm2022/lib/media/index.mjs +0 -3
  237. package/esm2022/lib/media/media.enum.mjs +0 -12
  238. package/esm2022/lib/media/media.service.mjs +0 -82
  239. package/esm2022/lib/message/index.mjs +0 -2
  240. package/esm2022/lib/message/message.module.mjs +0 -59
  241. package/esm2022/lib/message/shared/index.mjs +0 -4
  242. package/esm2022/lib/message/shared/message.enum.mjs +0 -10
  243. package/esm2022/lib/message/shared/message.interface.mjs +0 -2
  244. package/esm2022/lib/message/shared/message.service.mjs +0 -225
  245. package/esm2022/lib/monitoring/index.mjs +0 -4
  246. package/esm2022/lib/monitoring/monitoring.provider.mjs +0 -20
  247. package/esm2022/lib/monitoring/sentry/index.mjs +0 -4
  248. package/esm2022/lib/monitoring/sentry/sentry.interface.mjs +0 -2
  249. package/esm2022/lib/monitoring/sentry/sentry.mjs +0 -29
  250. package/esm2022/lib/monitoring/sentry/sentry.provider.mjs +0 -31
  251. package/esm2022/lib/monitoring/sentry/sentry.utils.mjs +0 -14
  252. package/esm2022/lib/monitoring/shared/any-monitoring.interface.mjs +0 -2
  253. package/esm2022/lib/monitoring/shared/index.mjs +0 -3
  254. package/esm2022/lib/monitoring/shared/monitoring.interface.mjs +0 -2
  255. package/esm2022/lib/network/index.mjs +0 -3
  256. package/esm2022/lib/network/network.interfaces.mjs +0 -2
  257. package/esm2022/lib/network/network.service.mjs +0 -66
  258. package/esm2022/lib/regex/index.mjs +0 -3
  259. package/esm2022/lib/regex/regex.interface.mjs +0 -2
  260. package/esm2022/lib/regex/regex.service.mjs +0 -30
  261. package/esm2022/lib/request/error.interceptor.mjs +0 -72
  262. package/esm2022/lib/request/error.module.mjs +0 -39
  263. package/esm2022/lib/request/index.mjs +0 -3
  264. package/esm2022/lib/request/logging.interceptor.mjs +0 -29
  265. package/esm2022/lib/request/logging.module.mjs +0 -30
  266. package/esm2022/lib/route/route.interface.mjs +0 -2
  267. package/esm2022/lib/route/route.service.mjs +0 -75
  268. package/esm2022/lib/storage/index.mjs +0 -4
  269. package/esm2022/lib/storage/storage.interface.mjs +0 -13
  270. package/esm2022/lib/storage/storage.mjs +0 -76
  271. package/esm2022/lib/storage/storage.service.mjs +0 -21
  272. package/esm2022/lib/user/index.mjs +0 -2
  273. package/esm2022/lib/user/user.interface.mjs +0 -2
  274. package/lib/analytics/index.d.ts +0 -1
  275. package/lib/compression/compressedData.interface.d.ts +0 -5
  276. package/lib/compression/compression.service.d.ts +0 -15
  277. package/lib/compression/index.d.ts +0 -2
  278. package/lib/config/config.provider.d.ts +0 -23
  279. package/lib/environment/environment.interface.d.ts +0 -18
  280. package/lib/language/index.d.ts +0 -1
  281. package/lib/language/shared/language-mock.provider.d.ts +0 -2
  282. package/lib/message/index.d.ts +0 -1
  283. package/{lib/activity → activity}/activity.interceptor.d.ts +0 -0
  284. package/{lib/activity → activity}/activity.module.d.ts +0 -0
  285. package/{lib/activity → activity}/activity.service.d.ts +0 -0
  286. package/{lib/analytics/shared/index.d.ts → analytics/public_api.d.ts} +1 -1
  287. /package/{lib/config → config}/config-deprecated.d.ts +0 -0
  288. /package/{lib/config → config}/version.d.ts +0 -0
  289. /package/{lib/environment/index.d.ts → environment/public_api.d.ts} +0 -0
  290. /package/{lib/gesture → gesture}/gesture.module.d.ts +0 -0
  291. /package/{lib/gesture → gesture}/gesture.provider.d.ts +0 -0
  292. /package/{lib/language → language}/language.module.d.ts +0 -0
  293. /package/{lib/language → language}/shared/index.d.ts +0 -0
  294. /package/{lib/language → language}/shared/language.interface.d.ts +0 -0
  295. /package/{lib/language → language}/shared/language.service.d.ts +0 -0
  296. /package/{lib/language → language}/shared/missing-translation.guard.d.ts +0 -0
  297. /package/{lib/media → media}/media.enum.d.ts +0 -0
  298. /package/{lib/media → media}/media.service.d.ts +0 -0
  299. /package/{lib/media/index.d.ts → media/public_api.d.ts} +0 -0
  300. /package/{lib/message → message}/shared/message.enum.d.ts +0 -0
  301. /package/{lib/message → message}/shared/message.interface.d.ts +0 -0
  302. /package/{lib/monitoring → monitoring}/monitoring.provider.d.ts +0 -0
  303. /package/{lib/monitoring → monitoring}/sentry/index.d.ts +0 -0
  304. /package/{lib/monitoring → monitoring}/sentry/sentry.d.ts +0 -0
  305. /package/{lib/monitoring → monitoring}/sentry/sentry.interface.d.ts +0 -0
  306. /package/{lib/monitoring → monitoring}/sentry/sentry.provider.d.ts +0 -0
  307. /package/{lib/monitoring → monitoring}/shared/any-monitoring.interface.d.ts +0 -0
  308. /package/{lib/monitoring → monitoring}/shared/index.d.ts +0 -0
  309. /package/{lib/monitoring → monitoring}/shared/monitoring.interface.d.ts +0 -0
  310. /package/{lib/network → network}/network.interfaces.d.ts +0 -0
  311. /package/{lib/network/index.d.ts → network/public_api.d.ts} +0 -0
  312. /package/{lib/regex/index.d.ts → regex/public_api.d.ts} +0 -0
  313. /package/{lib/regex → regex}/regex.interface.d.ts +0 -0
  314. /package/{lib/request → request}/error.module.d.ts +0 -0
  315. /package/{lib/request → request}/logging.interceptor.d.ts +0 -0
  316. /package/{lib/request → request}/logging.module.d.ts +0 -0
  317. /package/{lib/route → route}/route.interface.d.ts +0 -0
  318. /package/{lib/route → route}/route.service.d.ts +0 -0
  319. /package/{lib/storage/index.d.ts → storage/public_api.d.ts} +0 -0
  320. /package/{lib/storage → storage}/storage.interface.d.ts +0 -0
  321. /package/{lib/user/index.d.ts → user/public_api.d.ts} +0 -0
  322. /package/{lib/user → user}/user.interface.d.ts +0 -0
@@ -1,780 +1,16 @@
1
1
  import { CommonModule } from '@angular/common';
2
- import * as i1 from '@angular/common/http';
3
- import { HTTP_INTERCEPTORS, HttpClient, HttpBackend, HttpErrorResponse, HttpClientModule, HttpResponse } from '@angular/common/http';
2
+ import { HttpClientModule } from '@angular/common/http';
4
3
  import * as i0 from '@angular/core';
5
- import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, makeEnvironmentProviders, importProvidersFrom, Injector, Inject, Optional, SkipSelf, ErrorHandler, EventEmitter } from '@angular/core';
6
- import * as i1$3 from '@angular/material/icon';
7
- import * as i2 from '@angular/platform-browser';
8
- import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
9
- import * as i6 from 'ngx-indexed-db';
4
+ import { NgModule } from '@angular/core';
5
+ import * as i1 from '@igo2/core/activity';
6
+ import { IgoActivityModule } from '@igo2/core/activity';
7
+ import { provideConfig } from '@igo2/core/config';
8
+ import { provideTranslation, IgoLanguageModule } from '@igo2/core/language';
9
+ import { provideMessage } from '@igo2/core/message';
10
+ import * as i2 from '@igo2/core/request';
11
+ import { IgoErrorModule } from '@igo2/core/request';
12
+ import * as i3 from 'ngx-indexed-db';
10
13
  import { NgxIndexedDBModule } from 'ngx-indexed-db';
11
- import { finalize, catchError, debounceTime, first as first$1, tap as tap$1, startWith } from 'rxjs/operators';
12
- import { uuid, ObjectUtils } from '@igo2/utils';
13
- import { BehaviorSubject, throwError, first, switchMap, forkJoin, map, tap, combineLatest, Observable, fromEvent } from 'rxjs';
14
- import * as i1$1 from '@ngx-translate/core';
15
- import { TranslateModule, MissingTranslationHandler, TranslateLoader } from '@ngx-translate/core';
16
- import * as i1$2 from 'ngx-toastr';
17
- import { ToastrModule, ToastrService } from 'ngx-toastr';
18
- import * as i1$4 from '@angular/router';
19
- import { Router } from '@angular/router';
20
- import * as i1$5 from '@angular/cdk/layout';
21
- import { Breakpoints } from '@angular/cdk/layout';
22
- import { setUser, createErrorHandler, getCurrentHub, BrowserTracing, instrumentAngularRouting, Replay, init, TraceService } from '@sentry/angular-ivy';
23
-
24
- class ActivityService {
25
- counter$ = new BehaviorSubject(0);
26
- ids = [];
27
- constructor() { }
28
- register() {
29
- const id = uuid();
30
- this.ids.push(id);
31
- this.counter$.next(this.ids.length);
32
- return id;
33
- }
34
- unregister(id) {
35
- const index = this.ids.indexOf(id);
36
- if (index === -1) {
37
- return;
38
- }
39
- this.ids.splice(index, 1);
40
- this.counter$.next(this.ids.length);
41
- }
42
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ActivityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
43
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ActivityService, providedIn: 'root' });
44
- }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ActivityService, decorators: [{
46
- type: Injectable,
47
- args: [{
48
- providedIn: 'root'
49
- }]
50
- }], ctorParameters: () => [] });
51
-
52
- class ActivityInterceptor {
53
- activityService;
54
- constructor(activityService) {
55
- this.activityService = activityService;
56
- }
57
- intercept(req, next) {
58
- const activity = req.headers.get('activityInterceptor');
59
- if (activity) {
60
- const actReq = req.clone({
61
- headers: req.headers.delete('activityInterceptor')
62
- });
63
- if (activity === 'false') {
64
- return next.handle(actReq);
65
- }
66
- }
67
- const id = this.activityService.register();
68
- return next.handle(req).pipe(finalize(() => {
69
- this.activityService.unregister(id);
70
- }));
71
- }
72
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ActivityInterceptor, deps: [{ token: ActivityService }], target: i0.ɵɵFactoryTarget.Injectable });
73
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ActivityInterceptor });
74
- }
75
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ActivityInterceptor, decorators: [{
76
- type: Injectable
77
- }], ctorParameters: () => [{ type: ActivityService }] });
78
-
79
- class IgoActivityModule {
80
- static forRoot() {
81
- return {
82
- ngModule: IgoActivityModule,
83
- providers: [
84
- {
85
- provide: HTTP_INTERCEPTORS,
86
- useClass: ActivityInterceptor,
87
- multi: true
88
- }
89
- ]
90
- };
91
- }
92
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoActivityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
93
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.1", ngImport: i0, type: IgoActivityModule });
94
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoActivityModule });
95
- }
96
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoActivityModule, decorators: [{
97
- type: NgModule,
98
- args: [{
99
- imports: [],
100
- declarations: [],
101
- exports: []
102
- }]
103
- }] });
104
-
105
- const CONFIG_DEPRECATED = {
106
- showMenuButton: {
107
- alternativeKey: 'menu.button.visible',
108
- mayBeRemoveIn: new Date('2024-06-06')
109
- },
110
- menuButtonReverseColor: {
111
- alternativeKey: 'menu.button.useThemeColor',
112
- mayBeRemoveIn: new Date('2024-06-06')
113
- },
114
- importWithStyle: {
115
- alternativeKey: 'importExport.importWithStyle',
116
- mayBeRemoveIn: new Date('2024-06-06')
117
- },
118
- hasGeolocateButton: {
119
- alternativeKey: 'geolocate.button.visible',
120
- mayBeRemoveIn: new Date('2024-06-06')
121
- }
122
- };
123
- const ALTERNATE_CONFIG_FROM_DEPRECATION = new Map(Object.entries(CONFIG_DEPRECATED)
124
- .filter(([_, options]) => options.alternativeKey)
125
- .map(([key, options]) => [
126
- options.alternativeKey,
127
- {
128
- deprecatedKey: key
129
- }
130
- ]));
131
-
132
- const version = {
133
- lib: '17.0.0-next.0',
134
- releaseDate: 1708377796344
135
- };
136
-
137
- class ConfigService {
138
- config;
139
- httpClient;
140
- configDeprecated = new Map(Object.entries(CONFIG_DEPRECATED));
141
- _isLoaded$ = new BehaviorSubject(null);
142
- isLoaded$ = this._isLoaded$.asObservable();
143
- constructor(handler) {
144
- this.httpClient = new HttpClient(handler);
145
- }
146
- /**
147
- * Use to get the all config file (merge from environnement.ts and config.json)
148
- */
149
- getConfigs() {
150
- Array.from(this.configDeprecated.keys()).map((deprecatedKey) => {
151
- const deprecatedValue = ObjectUtils.resolve(this.config, deprecatedKey);
152
- if (deprecatedValue !== undefined) {
153
- this.handleDeprecatedConfig(deprecatedKey);
154
- }
155
- });
156
- return this.config;
157
- }
158
- /**
159
- * Use to get the data found in config file
160
- */
161
- getConfig(key, defaultValue) {
162
- let value = ObjectUtils.resolve(this.config, key);
163
- const isDeprecated = this.configDeprecated.get(key);
164
- if (isDeprecated && value !== undefined) {
165
- this.handleDeprecatedConfig(key);
166
- }
167
- else if (value === undefined) {
168
- value = this.handleDeprecationPossibility(key);
169
- }
170
- return value ?? defaultValue;
171
- }
172
- handleDeprecatedConfig(key) {
173
- const options = this.configDeprecated.get(key);
174
- let message = `This config (${key}) is deprecated and will be removed shortly`;
175
- if (options.alternativeKey) {
176
- message += ` You should use this key (${options.alternativeKey}) as an alternate solution`;
177
- }
178
- const currentDate = new Date();
179
- currentDate >= options.mayBeRemoveIn
180
- ? console.error(message)
181
- : console.warn(message);
182
- }
183
- handleDeprecationPossibility(key) {
184
- const options = ALTERNATE_CONFIG_FROM_DEPRECATION.get(key);
185
- if (!options) {
186
- return;
187
- }
188
- return this.getConfig(options.deprecatedKey);
189
- }
190
- /**
191
- * This method loads "[path]" to get all config's variables
192
- */
193
- load(options) {
194
- const baseConfig = options.default;
195
- if (!options.path) {
196
- this.config = baseConfig;
197
- this._isLoaded$.next(true);
198
- return true;
199
- }
200
- return new Promise((resolve, _reject) => {
201
- this.httpClient
202
- .get(options.path)
203
- .pipe(catchError((error) => {
204
- console.log(`Configuration file ${options.path} could not be read`);
205
- resolve(true);
206
- return throwError(error.error || 'Server error');
207
- }))
208
- .subscribe((configResponse) => {
209
- this.config = ObjectUtils.mergeDeep(ObjectUtils.mergeDeep({ version }, baseConfig), configResponse);
210
- this._isLoaded$.next(true);
211
- resolve(true);
212
- });
213
- });
214
- }
215
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ConfigService, deps: [{ token: i1.HttpBackend }], target: i0.ɵɵFactoryTarget.Injectable });
216
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ConfigService, providedIn: 'root' });
217
- }
218
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ConfigService, decorators: [{
219
- type: Injectable,
220
- args: [{
221
- providedIn: 'root'
222
- }]
223
- }], ctorParameters: () => [{ type: i1.HttpBackend }] });
224
-
225
- let CONFIG_OPTIONS = new InjectionToken('configOptions');
226
- function provideConfigOptions(options) {
227
- return {
228
- provide: CONFIG_OPTIONS,
229
- useValue: options
230
- };
231
- }
232
- function configFactory(configService, options) {
233
- return () => configService.load(options);
234
- }
235
- function provideConfigLoader() {
236
- return {
237
- provide: APP_INITIALIZER,
238
- useFactory: configFactory,
239
- multi: true,
240
- deps: [ConfigService, CONFIG_OPTIONS]
241
- };
242
- }
243
-
244
- class IgoConfigModule {
245
- static forRoot() {
246
- return {
247
- ngModule: IgoConfigModule,
248
- providers: [provideConfigOptions({}), provideConfigLoader()]
249
- };
250
- }
251
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoConfigModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
252
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.1", ngImport: i0, type: IgoConfigModule });
253
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoConfigModule });
254
- }
255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoConfigModule, decorators: [{
256
- type: NgModule,
257
- args: [{
258
- imports: [],
259
- declarations: [],
260
- exports: []
261
- }]
262
- }] });
263
-
264
- class LanguageLoaderBase {
265
- }
266
-
267
- class LanguageLoader {
268
- configService;
269
- prefix;
270
- suffix;
271
- httpClient;
272
- _isLoaded$ = new BehaviorSubject(null);
273
- isLoaded$ = this._isLoaded$.asObservable();
274
- constructor(handler, configService, prefix, suffix = '.json') {
275
- this.configService = configService;
276
- this.prefix = prefix;
277
- this.suffix = suffix;
278
- this.httpClient = new HttpClient(handler);
279
- }
280
- getTranslation(lang) {
281
- const igoLocale$ = this.httpClient.get(`locale/libs_locale/${lang}.json`);
282
- return this.configService.isLoaded$.pipe(first((isLoaded) => isLoaded), switchMap(() => {
283
- if (this.configService && !this.prefix) {
284
- const prefix = this.configService.getConfig('language.prefix');
285
- this.prefix = !prefix || Array.isArray(prefix) ? prefix : [prefix];
286
- }
287
- if (!this.prefix || this.prefix.length === 0) {
288
- this._isLoaded$.next(true);
289
- return igoLocale$;
290
- }
291
- const appLocale$ = this.prefix.map((prefix) => this.httpClient.get(`${prefix}${lang}${this.suffix}`));
292
- const locale$ = forkJoin([igoLocale$, ...appLocale$]);
293
- return locale$.pipe(map((translations) => {
294
- return translations.reduce((acc, current) => ObjectUtils.mergeDeep(acc, current), {});
295
- }), tap(() => {
296
- this._isLoaded$.next(true);
297
- }));
298
- }));
299
- }
300
- }
301
-
302
- class LanguageService {
303
- translate;
304
- language;
305
- language$ = new BehaviorSubject(undefined);
306
- constructor(translate) {
307
- this.translate = translate;
308
- this.language = this.translate.getBrowserLang();
309
- const lang = this.getLanguage();
310
- this.translate.setDefaultLang(lang);
311
- this.language$.next(lang);
312
- }
313
- getLanguage() {
314
- return this.language.match(/en|fr/) ? this.language : 'en';
315
- }
316
- setLanguage(language) {
317
- this.language = language.match(/en|fr/) ? language : 'en';
318
- combineLatest([
319
- this.translate.use(this.language),
320
- this.translate.reloadLang(this.language)
321
- ]).subscribe(() => {
322
- this.language$.next(this.language);
323
- });
324
- }
325
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: LanguageService, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
326
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: LanguageService, providedIn: 'root' });
327
- }
328
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: LanguageService, decorators: [{
329
- type: Injectable,
330
- args: [{
331
- providedIn: 'root'
332
- }]
333
- }], ctorParameters: () => [{ type: i1$1.TranslateService }] });
334
-
335
- class IgoMissingTranslationHandler {
336
- handle(params) {
337
- if (!params.translateService.langs.length) {
338
- const error = 'Translations are not yet loaded. \
339
- Check that the LanguageService is injected.';
340
- throw new Error(error);
341
- }
342
- if (params.key.substr(0, 4) === 'igo.') {
343
- throw new Error(`The Key "${params.key}" is missing in locale file.`);
344
- }
345
- else {
346
- return params.key;
347
- }
348
- }
349
- }
350
-
351
- /**
352
- * Make sure you only call this method in the root module of your application, most of the time called AppModule.
353
- */
354
- function provideRootTranslation(loader) {
355
- return makeEnvironmentProviders([
356
- importProvidersFrom(TranslateModule.forRoot(setTranslationConfig(loader))),
357
- {
358
- provide: APP_INITIALIZER,
359
- useFactory: (languageService) => () => {
360
- return languageService.translate.currentLoader.isLoaded$?.pipe(first((isLoaded) => isLoaded === true));
361
- },
362
- deps: [LanguageService],
363
- multi: true
364
- }
365
- ]);
366
- }
367
- const setTranslationConfig = (loader) => ({
368
- defaultLanguage: 'fr',
369
- loader: loader ?? DEFAULT_LANGUAGE_LOADER,
370
- missingTranslationHandler: {
371
- provide: MissingTranslationHandler,
372
- useClass: IgoMissingTranslationHandler
373
- }
374
- });
375
- const DEFAULT_LANGUAGE_LOADER = {
376
- provide: TranslateLoader,
377
- useFactory: defaultLanguageLoader,
378
- deps: [HttpBackend, ConfigService]
379
- };
380
- function defaultLanguageLoader(http, config) {
381
- return new LanguageLoader(http, config, undefined, undefined);
382
- }
383
-
384
- function provideMockRootTranslation(loader) {
385
- return TranslateModule.forRoot();
386
- }
387
-
388
- class IgoLanguageModule {
389
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoLanguageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
390
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.1", ngImport: i0, type: IgoLanguageModule, exports: [TranslateModule] });
391
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoLanguageModule, imports: [TranslateModule] });
392
- }
393
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoLanguageModule, decorators: [{
394
- type: NgModule,
395
- args: [{
396
- exports: [TranslateModule]
397
- }]
398
- }] });
399
-
400
- class IgoMessageModule {
401
- static forRoot() {
402
- return {
403
- ngModule: IgoMessageModule,
404
- providers: []
405
- };
406
- }
407
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoMessageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
408
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.1", ngImport: i0, type: IgoMessageModule, imports: [CommonModule, i1$2.ToastrModule] });
409
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoMessageModule, imports: [CommonModule,
410
- ToastrModule.forRoot({
411
- positionClass: 'toast-bottom-right',
412
- timeOut: 10000,
413
- extendedTimeOut: 10000,
414
- titleClass: 'mat-subtitle-2',
415
- messageClass: 'toast-message',
416
- closeButton: true,
417
- progressBar: true,
418
- enableHtml: true,
419
- tapToDismiss: true,
420
- maxOpened: 4,
421
- preventDuplicates: true,
422
- resetTimeoutOnDuplicate: true,
423
- countDuplicates: false,
424
- includeTitleDuplicates: true
425
- })] });
426
- }
427
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoMessageModule, decorators: [{
428
- type: NgModule,
429
- args: [{
430
- imports: [
431
- CommonModule,
432
- ToastrModule.forRoot({
433
- positionClass: 'toast-bottom-right',
434
- timeOut: 10000,
435
- extendedTimeOut: 10000,
436
- titleClass: 'mat-subtitle-2',
437
- messageClass: 'toast-message',
438
- closeButton: true,
439
- progressBar: true,
440
- enableHtml: true,
441
- tapToDismiss: true,
442
- maxOpened: 4,
443
- preventDuplicates: true,
444
- resetTimeoutOnDuplicate: true,
445
- countDuplicates: false,
446
- includeTitleDuplicates: true
447
- })
448
- ],
449
- declarations: [],
450
- exports: []
451
- }]
452
- }] });
453
-
454
- var MessageType;
455
- (function (MessageType) {
456
- MessageType["ERROR"] = "error";
457
- MessageType["ALERT"] = "warning";
458
- MessageType["WARNING"] = "warning";
459
- MessageType["INFO"] = "info";
460
- MessageType["SUCCESS"] = "success";
461
- MessageType["SHOW"] = "show";
462
- })(MessageType || (MessageType = {}));
463
-
464
- class MessageService {
465
- injector;
466
- configService;
467
- languageService;
468
- messages$ = new BehaviorSubject([]);
469
- options;
470
- activeMessageTranslations = [];
471
- constructor(injector, configService, languageService) {
472
- this.injector = injector;
473
- this.configService = configService;
474
- this.languageService = languageService;
475
- this.options = this.configService.getConfig('message');
476
- this.languageService.language$.pipe(debounceTime(500)).subscribe((r) => {
477
- if (this.toastr.toasts.length === 0) {
478
- this.activeMessageTranslations = [];
479
- }
480
- this.toastr.toasts.map((toast) => {
481
- const activeMessageTranslation = this.activeMessageTranslations.find((amt) => amt.id === toast.toastId);
482
- if (activeMessageTranslation) {
483
- const translatedTextInterpolateParams = {
484
- ...activeMessageTranslation.textInterpolateParams
485
- };
486
- const translatedTitleInterpolateParams = {
487
- ...activeMessageTranslation.titleInterpolateParams
488
- };
489
- if (activeMessageTranslation.textInterpolateParams) {
490
- Object.keys(activeMessageTranslation.textInterpolateParams).map((k) => {
491
- if (k) {
492
- translatedTextInterpolateParams[k] =
493
- this.languageService.translate.instant(activeMessageTranslation.textInterpolateParams[k]);
494
- }
495
- });
496
- }
497
- if (activeMessageTranslation.titleInterpolateParams) {
498
- Object.keys(activeMessageTranslation.titleInterpolateParams).map((k) => {
499
- if (k) {
500
- translatedTitleInterpolateParams[k] =
501
- this.languageService.translate.instant(activeMessageTranslation.titleInterpolateParams[k]);
502
- }
503
- });
504
- }
505
- forkJoin([
506
- this.languageService.translate.get(activeMessageTranslation.textKey, translatedTextInterpolateParams),
507
- this.languageService.translate.get(activeMessageTranslation.titleKey, translatedTitleInterpolateParams)
508
- ])
509
- .pipe(first$1())
510
- .subscribe((res) => {
511
- toast.toastRef.componentInstance.message = res[0];
512
- toast.toastRef.componentInstance.title = res[1];
513
- });
514
- }
515
- });
516
- });
517
- }
518
- get toastr() {
519
- return this.injector.get(ToastrService);
520
- }
521
- showError(httpError) {
522
- httpError.error.caught = true;
523
- return this.error(httpError.error.message, httpError.error.title);
524
- }
525
- message(message) {
526
- const messageType = message.type;
527
- this.toastr.toastrConfig.iconClasses[messageType] = `toast-${messageType}`;
528
- this.messages$.next(this.messages$.value.concat([message]));
529
- message.options = message.options || {};
530
- const currentDate = new Date();
531
- message.options.from = message.options.from
532
- ? message.options.from
533
- : new Date('1 jan 1900');
534
- message.options.to = message.options.to
535
- ? message.options.to
536
- : new Date('1 jan 3000');
537
- if (typeof message.options.from === 'string') {
538
- message.options.from = new Date(Date.parse(message.options.from.replace(/-/g, ' ')));
539
- }
540
- if (typeof message.options.to === 'string') {
541
- message.options.to = new Date(Date.parse(message.options.to.replace(/-/g, ' ')));
542
- }
543
- if (currentDate > message.options.from &&
544
- currentDate < message.options.to) {
545
- if (message.showIcon === false) {
546
- this.toastr.toastrConfig.iconClasses[messageType] =
547
- `toast-${messageType} toast-no-icon`;
548
- }
549
- message = this.handleTemplate(message);
550
- if (message.text) {
551
- let messageShown;
552
- switch (message.type) {
553
- case MessageType.SUCCESS:
554
- messageShown = this.success(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
555
- break;
556
- case MessageType.ERROR:
557
- messageShown = this.error(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
558
- break;
559
- case MessageType.INFO:
560
- messageShown = this.info(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
561
- break;
562
- case MessageType.SHOW:
563
- messageShown = this.show(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
564
- break;
565
- case MessageType.ALERT:
566
- case MessageType.WARNING:
567
- messageShown = this.alert(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
568
- break;
569
- default:
570
- messageShown = this.info(message.text, message.title, message.options, message.textInterpolateParams, message.titleInterpolateParams);
571
- break;
572
- }
573
- message.options.id = messageShown.toastId;
574
- }
575
- }
576
- }
577
- success(text, title = 'igo.core.message.success', options = {}, textInterpolateParams, titleInterpolateParams) {
578
- return this.handleNgxToastr('success', text, title, options, textInterpolateParams, titleInterpolateParams);
579
- }
580
- error(text, title = 'igo.core.message.error', options = {}, textInterpolateParams, titleInterpolateParams) {
581
- return this.handleNgxToastr('error', text, title, options, textInterpolateParams, titleInterpolateParams);
582
- }
583
- info(text, title = 'igo.core.message.info', options = {}, textInterpolateParams, titleInterpolateParams) {
584
- return this.handleNgxToastr('info', text, title, options, textInterpolateParams, titleInterpolateParams);
585
- }
586
- alert(text, title = 'igo.core.message.alert', options = {}, textInterpolateParams, titleInterpolateParams) {
587
- return this.handleNgxToastr('alert', text, title, options, textInterpolateParams, titleInterpolateParams);
588
- }
589
- show(text, title = 'igo.core.message.info', options = {}, textInterpolateParams, titleInterpolateParams) {
590
- return this.handleNgxToastr('show', text, title, options, textInterpolateParams, titleInterpolateParams);
591
- }
592
- handleNgxToastr(type, text, title, options = {}, textInterpolateParams, titleInterpolateParams) {
593
- const translatedTextInterpolateParams = { ...textInterpolateParams };
594
- const translatedTitlenterpolateParams = { ...titleInterpolateParams };
595
- if (textInterpolateParams) {
596
- Object.keys(textInterpolateParams).map((k) => {
597
- const value = textInterpolateParams[k];
598
- if (value) {
599
- translatedTextInterpolateParams[k] =
600
- typeof value === 'string'
601
- ? this.languageService.translate.instant(value)
602
- : value;
603
- }
604
- });
605
- }
606
- if (titleInterpolateParams) {
607
- Object.keys(titleInterpolateParams).map((k) => {
608
- if (k) {
609
- const value = titleInterpolateParams[k];
610
- translatedTitlenterpolateParams[k] =
611
- typeof value === 'string'
612
- ? this.languageService.translate.instant(value)
613
- : value;
614
- }
615
- });
616
- }
617
- const message = this.languageService.translate.instant(text, translatedTextInterpolateParams);
618
- const translatedTitle = this.languageService.translate.instant(title, translatedTitlenterpolateParams);
619
- let activeToast;
620
- switch (type) {
621
- case 'success':
622
- activeToast = this.toastr.success(message, translatedTitle, options);
623
- break;
624
- case 'error':
625
- activeToast = this.toastr.error(message, translatedTitle, options);
626
- break;
627
- case 'show':
628
- case 'info':
629
- activeToast = this.toastr.info(message, translatedTitle, options);
630
- break;
631
- case 'alert':
632
- activeToast = this.toastr.warning(message, translatedTitle, options);
633
- break;
634
- }
635
- this.activeMessageTranslations.push({
636
- id: activeToast.toastId,
637
- titleKey: title,
638
- textKey: text,
639
- textInterpolateParams,
640
- titleInterpolateParams
641
- });
642
- return activeToast;
643
- }
644
- remove(id) {
645
- this.toastr.remove(id);
646
- }
647
- removeAllAreNotError() {
648
- for (const mess of this.messages$.value) {
649
- if (mess.type !== MessageType.ERROR) {
650
- this.remove(mess.options.id);
651
- }
652
- }
653
- }
654
- handleTemplate(message) {
655
- if (!this.options?.template || message.html) {
656
- return message;
657
- }
658
- let html = this.options?.template;
659
- html = html.replace('${text}', message.text);
660
- html = html.replace('${title}', message.title);
661
- message.html = undefined;
662
- message.text = html;
663
- message.title = undefined;
664
- return message;
665
- }
666
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MessageService, deps: [{ token: Injector }, { token: ConfigService }, { token: LanguageService }], target: i0.ɵɵFactoryTarget.Injectable });
667
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MessageService, providedIn: 'root' });
668
- }
669
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MessageService, decorators: [{
670
- type: Injectable,
671
- args: [{
672
- providedIn: 'root'
673
- }]
674
- }], ctorParameters: () => [{ type: i0.Injector, decorators: [{
675
- type: Inject,
676
- args: [Injector]
677
- }] }, { type: ConfigService }, { type: LanguageService }] });
678
-
679
- class ErrorInterceptor {
680
- messageService;
681
- constructor(messageService) {
682
- this.messageService = messageService;
683
- }
684
- intercept(originalReq, next) {
685
- const interceptError = originalReq.headers.get('interceptError');
686
- const req = originalReq.clone({
687
- headers: originalReq.headers.delete('interceptError')
688
- });
689
- if (interceptError === 'false') {
690
- return next.handle(req);
691
- }
692
- const errorContainer = { httpError: undefined };
693
- return next.handle(req).pipe(catchError((error) => this.handleError(error, errorContainer)), finalize(() => {
694
- const httpError = errorContainer.httpError;
695
- if (!httpError) {
696
- return;
697
- }
698
- if (httpError.error.toDisplay) {
699
- this.handleCaughtError(httpError);
700
- }
701
- else if (!httpError.error.caught) {
702
- this.handleUncaughtError(httpError);
703
- }
704
- }));
705
- }
706
- handleError(httpError, errorContainer) {
707
- if (httpError instanceof HttpErrorResponse) {
708
- const errorObj = httpError.error === 'object' ? httpError.error : {};
709
- errorObj.message = httpError.error?.message || httpError.statusText;
710
- errorObj.caught = false;
711
- httpError = new HttpErrorResponse({
712
- error: errorObj,
713
- headers: httpError.headers,
714
- status: httpError.status,
715
- statusText: httpError.statusText,
716
- url: httpError.url
717
- });
718
- }
719
- errorContainer.httpError = httpError;
720
- return throwError(httpError);
721
- }
722
- handleCaughtError(httpError) {
723
- httpError.error.caught = true;
724
- this.messageService.error(httpError.error.message, httpError.error.title, {
725
- progressBar: false
726
- });
727
- }
728
- handleUncaughtError(httpError) {
729
- httpError.error.caught = true;
730
- this.messageService.error('igo.core.errors.uncaught.message', 'igo.core.errors.uncaught.title', {
731
- progressBar: false
732
- });
733
- }
734
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ErrorInterceptor, deps: [{ token: MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
735
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ErrorInterceptor, providedIn: 'root' });
736
- }
737
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ErrorInterceptor, decorators: [{
738
- type: Injectable,
739
- args: [{
740
- providedIn: 'root'
741
- }]
742
- }], ctorParameters: () => [{ type: MessageService }] });
743
-
744
- class IgoErrorModule {
745
- static forRoot() {
746
- return {
747
- ngModule: IgoErrorModule,
748
- providers: [
749
- {
750
- provide: HTTP_INTERCEPTORS,
751
- useClass: ErrorInterceptor,
752
- multi: true
753
- }
754
- ]
755
- };
756
- }
757
- constructor(parentModule) {
758
- if (parentModule) {
759
- throw new Error('IgoErrorModule is already loaded. Import it in the AppModule only');
760
- }
761
- }
762
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoErrorModule, deps: [{ token: IgoErrorModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
763
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.1", ngImport: i0, type: IgoErrorModule });
764
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoErrorModule });
765
- }
766
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoErrorModule, decorators: [{
767
- type: NgModule,
768
- args: [{
769
- imports: [],
770
- declarations: [],
771
- exports: []
772
- }]
773
- }], ctorParameters: () => [{ type: IgoErrorModule, decorators: [{
774
- type: Optional
775
- }, {
776
- type: SkipSelf
777
- }] }] });
778
14
 
779
15
  const dbConfig = {
780
16
  name: 'igo2DB',
@@ -806,808 +42,47 @@ const dbConfig = {
806
42
  ]
807
43
  };
808
44
  class IgoCoreModule {
809
- static forRoot() {
45
+ static forRoot(options = {}) {
810
46
  return {
811
47
  ngModule: IgoCoreModule,
812
- providers: []
48
+ providers: [provideConfig(options), provideTranslation()]
813
49
  };
814
50
  }
815
- constructor(matIconRegistry, domSanitizer) {
816
- matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/igo2/core/icons/mdi.svg'));
817
- }
818
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoCoreModule, deps: [{ token: i1$3.MatIconRegistry }, { token: i2.DomSanitizer }], target: i0.ɵɵFactoryTarget.NgModule });
819
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.1", ngImport: i0, type: IgoCoreModule, imports: [CommonModule,
820
- HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoMessageModule, i6.NgxIndexedDBModule], exports: [IgoActivityModule,
821
- IgoConfigModule,
822
- IgoErrorModule,
823
- IgoLanguageModule,
824
- IgoMessageModule] });
825
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoCoreModule, providers: [provideRootTranslation()], imports: [CommonModule,
51
+ constructor() { }
52
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: IgoCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
53
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.9", ngImport: i0, type: IgoCoreModule, imports: [CommonModule,
54
+ HttpClientModule, i1.IgoActivityModule, i2.IgoErrorModule, i3.NgxIndexedDBModule], exports: [IgoActivityModule, IgoErrorModule, IgoLanguageModule] });
55
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: IgoCoreModule, providers: [provideMessage()], imports: [CommonModule,
826
56
  HttpClientModule,
827
57
  IgoActivityModule.forRoot(),
828
- IgoConfigModule.forRoot(),
829
58
  IgoErrorModule.forRoot(),
830
- IgoMessageModule,
831
- NgxIndexedDBModule.forRoot(dbConfig), IgoActivityModule,
832
- IgoConfigModule,
833
- IgoErrorModule,
834
- IgoLanguageModule,
835
- IgoMessageModule] });
59
+ NgxIndexedDBModule.forRoot(dbConfig), IgoActivityModule, IgoErrorModule, IgoLanguageModule] });
836
60
  }
837
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoCoreModule, decorators: [{
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: IgoCoreModule, decorators: [{
838
62
  type: NgModule,
839
63
  args: [{
840
64
  imports: [
841
65
  CommonModule,
842
66
  HttpClientModule,
843
67
  IgoActivityModule.forRoot(),
844
- IgoConfigModule.forRoot(),
845
68
  IgoErrorModule.forRoot(),
846
- IgoMessageModule,
847
69
  NgxIndexedDBModule.forRoot(dbConfig)
848
70
  ],
849
- providers: [provideRootTranslation()],
850
- declarations: [],
851
- exports: [
852
- IgoActivityModule,
853
- IgoConfigModule,
854
- IgoErrorModule,
855
- IgoLanguageModule,
856
- IgoMessageModule
857
- ]
858
- }]
859
- }], ctorParameters: () => [{ type: i1$3.MatIconRegistry }, { type: i2.DomSanitizer }] });
860
-
861
- class IgoGestureConfig extends HammerGestureConfig {
862
- buildHammer(element) {
863
- const mc = super.buildHammer(element);
864
- mc.set({ touchAction: 'pan-y' });
865
- return mc;
866
- }
867
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoGestureConfig, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
868
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoGestureConfig });
869
- }
870
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoGestureConfig, decorators: [{
871
- type: Injectable
872
- }] });
873
-
874
- class IgoGestureModule {
875
- static forRoot() {
876
- return {
877
- ngModule: IgoGestureModule,
878
- providers: [
879
- {
880
- provide: HAMMER_GESTURE_CONFIG,
881
- useClass: IgoGestureConfig
882
- }
883
- ]
884
- };
885
- }
886
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoGestureModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
887
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.1", ngImport: i0, type: IgoGestureModule, imports: [HammerModule] });
888
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoGestureModule, imports: [HammerModule] });
889
- }
890
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoGestureModule, decorators: [{
891
- type: NgModule,
892
- args: [{
893
- imports: [HammerModule],
894
- declarations: [],
895
- exports: []
896
- }]
897
- }] });
898
-
899
- class LoggingInterceptor {
900
- intercept(req, next) {
901
- const started = Date.now();
902
- let ok;
903
- // extend server response observable with logging
904
- return next.handle(req).pipe(tap$1(
905
- // Succeeds when there is a response; ignore other events
906
- (event) => (ok = event instanceof HttpResponse ? 'succeeded' : ''),
907
- // Operation failed; error is an HttpErrorResponse
908
- (error) => (ok = 'failed')),
909
- // Log when response observable either completes or errors
910
- finalize(() => {
911
- const elapsed = Date.now() - started;
912
- const msg = `${req.method} "${req.urlWithParams}"
913
- ${ok} in ${elapsed} ms.`;
914
- console.log(msg);
915
- }));
916
- }
917
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: LoggingInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
918
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: LoggingInterceptor });
919
- }
920
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: LoggingInterceptor, decorators: [{
921
- type: Injectable
922
- }] });
923
-
924
- class IgoLoggingModule {
925
- static forRoot() {
926
- return {
927
- ngModule: IgoLoggingModule,
928
- providers: [
929
- {
930
- provide: HTTP_INTERCEPTORS,
931
- useClass: LoggingInterceptor,
932
- multi: true
933
- }
934
- ]
935
- };
936
- }
937
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoLoggingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
938
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.1", ngImport: i0, type: IgoLoggingModule });
939
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoLoggingModule });
940
- }
941
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IgoLoggingModule, decorators: [{
942
- type: NgModule,
943
- args: [{
944
- imports: [],
71
+ providers: [provideMessage()],
945
72
  declarations: [],
946
- exports: []
947
- }]
948
- }] });
949
-
950
- let ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
951
- function provideRouteServiceOptions(options) {
952
- return {
953
- provide: ROUTE_SERVICE_OPTIONS,
954
- useValue: options
955
- };
956
- }
957
- class RouteService {
958
- router;
959
- route;
960
- options;
961
- constructor(router, route, options) {
962
- this.router = router;
963
- this.route = route;
964
- const defaultOptions = {
965
- centerKey: 'center',
966
- zoomKey: 'zoom',
967
- projectionKey: 'projection',
968
- contextKey: 'context',
969
- searchKey: 'search',
970
- visibleOnLayersKey: 'visiblelayers',
971
- visibleOffLayersKey: 'invisiblelayers',
972
- directionsCoordKey: 'routing',
973
- directionsOptionsKey: 'routingOptions',
974
- toolKey: 'tool',
975
- wmsUrlKey: 'wmsUrl',
976
- wmsLayersKey: 'wmsLayers',
977
- wmtsUrlKey: 'wmtsUrl',
978
- wmtsLayersKey: 'wmtsLayers',
979
- arcgisUrlKey: 'arcgisUrl',
980
- arcgisLayersKey: 'arcgisLayers',
981
- iarcgisUrlKey: 'iarcgisUrl',
982
- iarcgisLayersKey: 'iarcgisLayers',
983
- tarcgisUrlKey: 'tarcgisUrl',
984
- tarcgisLayersKey: 'tarcgisLayers',
985
- vectorKey: 'vector'
986
- };
987
- this.options = Object.assign({}, defaultOptions, options);
988
- }
989
- get queryParams() {
990
- let url = decodeURIComponent(location.search);
991
- if (url.includes('¢er=')) {
992
- url = url.replace('¢er', '&center');
993
- const queryParams = url
994
- .slice(1)
995
- .split('&')
996
- .map((p) => p.split('='))
997
- .reduce((obj, pair) => {
998
- const [key, value] = pair.map(decodeURIComponent);
999
- obj[key] = value;
1000
- return obj;
1001
- }, {});
1002
- this.router.navigate([], { queryParams });
1003
- }
1004
- return this.route.queryParams;
1005
- }
1006
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RouteService, deps: [{ token: i1$4.Router }, { token: i1$4.ActivatedRoute }, { token: ROUTE_SERVICE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1007
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RouteService, providedIn: 'root' });
1008
- }
1009
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RouteService, decorators: [{
1010
- type: Injectable,
1011
- args: [{
1012
- providedIn: 'root'
1013
- }]
1014
- }], ctorParameters: () => [{ type: i1$4.Router }, { type: i1$4.ActivatedRoute }, { type: undefined, decorators: [{
1015
- type: Inject,
1016
- args: [ROUTE_SERVICE_OPTIONS]
1017
- }, {
1018
- type: Optional
1019
- }] }] });
1020
-
1021
- class AnalyticsService {
1022
- config;
1023
- options;
1024
- get paq() {
1025
- return (window._paq = window._paq || []);
1026
- }
1027
- constructor(config) {
1028
- this.config = config;
1029
- this.options = this.config.getConfig('analytics') || {};
1030
- if (this.options.provider === 'matomo') {
1031
- this.initMatomo();
1032
- }
1033
- }
1034
- initMatomo() {
1035
- if (!this.options.url || !this.options.id) {
1036
- return;
1037
- }
1038
- const url = this.options.url.substr(-1) === '/'
1039
- ? this.options.url + 'matomo'
1040
- : this.options.url;
1041
- // this.paq.push(['trackPageView']);
1042
- // this.paq.push(['enableLinkTracking']);
1043
- (() => {
1044
- this.paq.push(['setTrackerUrl', url + '.php']);
1045
- this.paq.push(['setSiteId', this.options.id]);
1046
- const g = document.createElement('script');
1047
- const s = document.getElementsByTagName('script')[0];
1048
- g.type = 'text/javascript';
1049
- g.async = true;
1050
- g.defer = true;
1051
- g.src = url + '.js';
1052
- s.parentNode.insertBefore(g, s);
1053
- })();
1054
- }
1055
- /**
1056
- * Pass `null` to unset the user.
1057
- */
1058
- setUser(user, profils) {
1059
- if (this.options.provider === 'matomo') {
1060
- if (!user) {
1061
- this.paq.push(['resetUserId']);
1062
- this.paq.push(['deleteCustomVariable', 1, 'user']);
1063
- this.paq.push(['deleteCustomVariable', 2, 'name']);
1064
- this.paq.push(['deleteCustomVariable', 3, 'profils']);
1065
- }
1066
- else {
1067
- this.paq.push(['setUserId', user.id]);
1068
- const name = `${user.firstName} ${user.lastName}`;
1069
- this.paq.push(['setCustomVariable', 1, 'user', user.sourceId, 'visit']);
1070
- this.paq.push(['setCustomVariable', 2, 'name', name, 'visit']);
1071
- this.paq.push(['setCustomVariable', 3, 'profils', profils, 'visit']);
1072
- }
1073
- this.paq.push(['trackPageView']);
1074
- this.paq.push(['enableLinkTracking']);
1075
- }
1076
- }
1077
- trackSearch(term, nbResults) {
1078
- if (this.options.provider === 'matomo') {
1079
- this.paq.push(['trackSiteSearch', term, false, nbResults]);
1080
- }
1081
- }
1082
- trackEvent(category, action, name) {
1083
- if (this.options.provider === 'matomo') {
1084
- this.paq.push(['trackEvent', category, action, name]);
1085
- }
1086
- }
1087
- /**
1088
- * Function that tracks layers added to the map
1089
- */
1090
- trackLayer(category, action, parameters) {
1091
- if (this.options.provider === 'matomo')
1092
- this.paq.push(['trackEvent', category, action, parameters]);
1093
- }
1094
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: AnalyticsService, deps: [{ token: ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
1095
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: AnalyticsService, providedIn: 'root' });
1096
- }
1097
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: AnalyticsService, decorators: [{
1098
- type: Injectable,
1099
- args: [{
1100
- providedIn: 'root'
1101
- }]
1102
- }], ctorParameters: () => [{ type: ConfigService }] });
1103
-
1104
- var Media;
1105
- (function (Media) {
1106
- Media["Mobile"] = "mobile";
1107
- Media["Tablet"] = "tablet";
1108
- Media["Desktop"] = "desktop";
1109
- })(Media || (Media = {}));
1110
- var MediaOrientation;
1111
- (function (MediaOrientation) {
1112
- MediaOrientation["Portrait"] = "portrait";
1113
- MediaOrientation["Landscape"] = "landscape";
1114
- })(MediaOrientation || (MediaOrientation = {}));
1115
-
1116
- class MediaService {
1117
- media$ = new BehaviorSubject(undefined);
1118
- orientation$ = new BehaviorSubject(undefined);
1119
- constructor(breakpointObserver) {
1120
- breakpointObserver
1121
- .observe([Breakpoints.HandsetLandscape])
1122
- .subscribe((res) => {
1123
- if (res.matches) {
1124
- this.media$.next(Media.Mobile);
1125
- this.orientation$.next(MediaOrientation.Landscape);
1126
- }
1127
- });
1128
- breakpointObserver
1129
- .observe([Breakpoints.HandsetPortrait])
1130
- .subscribe((res) => {
1131
- if (res.matches) {
1132
- this.media$.next(Media.Mobile);
1133
- this.orientation$.next(MediaOrientation.Portrait);
1134
- }
1135
- });
1136
- breakpointObserver
1137
- .observe([Breakpoints.TabletLandscape])
1138
- .subscribe((res) => {
1139
- if (res.matches) {
1140
- this.media$.next(Media.Tablet);
1141
- this.orientation$.next(MediaOrientation.Landscape);
1142
- }
1143
- });
1144
- breakpointObserver
1145
- .observe([Breakpoints.TabletPortrait])
1146
- .subscribe((res) => {
1147
- if (res.matches) {
1148
- this.media$.next(Media.Tablet);
1149
- this.orientation$.next(MediaOrientation.Portrait);
1150
- }
1151
- });
1152
- breakpointObserver.observe([Breakpoints.WebLandscape]).subscribe((res) => {
1153
- if (res.matches) {
1154
- this.media$.next(Media.Desktop);
1155
- this.orientation$.next(MediaOrientation.Landscape);
1156
- }
1157
- });
1158
- breakpointObserver.observe([Breakpoints.WebPortrait]).subscribe((res) => {
1159
- if (res.matches) {
1160
- this.media$.next(Media.Desktop);
1161
- this.orientation$.next(MediaOrientation.Portrait);
1162
- }
1163
- });
1164
- }
1165
- getMedia() {
1166
- return this.media$.value;
1167
- }
1168
- getOrientation() {
1169
- return this.orientation$.value;
1170
- }
1171
- isTouchScreen() {
1172
- return 'ontouchstart' in document.documentElement ? true : false;
1173
- }
1174
- isMobile() {
1175
- const media = this.getMedia();
1176
- return media === 'mobile';
1177
- }
1178
- isDesktop() {
1179
- const media = this.getMedia();
1180
- return media === 'desktop';
1181
- }
1182
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MediaService, deps: [{ token: i1$5.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable });
1183
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MediaService, providedIn: 'root' });
1184
- }
1185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: MediaService, decorators: [{
1186
- type: Injectable,
1187
- args: [{
1188
- providedIn: 'root'
1189
- }]
1190
- }], ctorParameters: () => [{ type: i1$5.BreakpointObserver }] });
1191
-
1192
- const isTracingEnabled = (options) => options.enableTracing ||
1193
- !!options.tracesSampleRate ||
1194
- !!options.tracesSampler;
1195
- const identifySentryUser = (user) => {
1196
- setUser(user
1197
- ? {
1198
- id: user.id,
1199
- username: `${user.firstName} ${user.lastName}`,
1200
- email: user.email
1201
- }
1202
- : null);
1203
- };
1204
-
1205
- const createSentryErrorHandler = (options) => {
1206
- return createErrorHandler({
1207
- logErrors: options.logErrors,
1208
- ...(options.errorHandlerOptions ?? {})
1209
- });
1210
- };
1211
- const initSentry = (options) => {
1212
- const client = getCurrentHub().getClient();
1213
- if (client) {
1214
- return;
1215
- }
1216
- const tracingEnabled = isTracingEnabled(options);
1217
- const baseConfig = {
1218
- dsn: options.dsn,
1219
- environment: options.environment,
1220
- release: options.release,
1221
- integrations: [
1222
- tracingEnabled &&
1223
- new BrowserTracing({
1224
- routingInstrumentation: instrumentAngularRouting
1225
- }),
1226
- options.enableReplay && new Replay()
1227
- ].filter(Boolean)
1228
- };
1229
- init(baseConfig);
1230
- };
1231
-
1232
- const provideSentryMonitoring = (options) => {
1233
- const isEnabled = options.enabled !== undefined ? options.enabled : true;
1234
- if (!isEnabled) {
1235
- return [];
1236
- }
1237
- initSentry(options);
1238
- const tracingEnabled = isTracingEnabled(options);
1239
- return [
1240
- {
1241
- provide: ErrorHandler,
1242
- useFactory: () => createSentryErrorHandler(options)
1243
- },
1244
- tracingEnabled && {
1245
- provide: TraceService,
1246
- deps: [Router]
1247
- },
1248
- // Force instantiate TraceService to avoid require it in any constructor.
1249
- tracingEnabled && {
1250
- provide: APP_INITIALIZER,
1251
- useFactory: () => () => { },
1252
- deps: [TraceService],
1253
- multi: true
1254
- }
1255
- ].filter(Boolean);
1256
- };
1257
-
1258
- const MONITORING_OPTIONS = new InjectionToken('monitoring.options');
1259
- function provideMonitoring(options) {
1260
- if (!options) {
1261
- return [];
1262
- }
1263
- const providers = [
1264
- { provide: MONITORING_OPTIONS, useValue: options }
1265
- ];
1266
- switch (options.provider) {
1267
- case 'sentry':
1268
- providers.push(...provideSentryMonitoring(options));
1269
- break;
1270
- default:
1271
- break;
1272
- }
1273
- return providers;
1274
- }
1275
-
1276
- var StorageScope;
1277
- (function (StorageScope) {
1278
- StorageScope["SESSION"] = "Session";
1279
- StorageScope["LOCAL"] = "Local";
1280
- })(StorageScope || (StorageScope = {}));
1281
- var StorageServiceEventEnum;
1282
- (function (StorageServiceEventEnum) {
1283
- StorageServiceEventEnum["ADDED"] = "Added";
1284
- StorageServiceEventEnum["MODIFIED"] = "Modified";
1285
- StorageServiceEventEnum["REMOVED"] = "Removed";
1286
- StorageServiceEventEnum["CLEARED"] = "Cleared";
1287
- })(StorageServiceEventEnum || (StorageServiceEventEnum = {}));
1288
-
1289
- class BaseStorage {
1290
- options;
1291
- storageChange$ = new BehaviorSubject(undefined);
1292
- constructor(config) {
1293
- this.options = config.getConfig('storage') || { key: 'igo' };
1294
- }
1295
- /**
1296
- * Use to get the data found in storage file
1297
- */
1298
- get(key, scope) {
1299
- let value;
1300
- if (!scope || scope === StorageScope.SESSION) {
1301
- value = sessionStorage.getItem(`${this.options.key}.${key}`);
1302
- }
1303
- if (scope === StorageScope.LOCAL || (!value && !scope)) {
1304
- value = localStorage.getItem(`${this.options.key}.${key}`);
1305
- }
1306
- if (value) {
1307
- try {
1308
- value = JSON.parse(value);
1309
- }
1310
- catch {
1311
- value = value;
1312
- }
1313
- }
1314
- return value;
1315
- }
1316
- set(key, value, scope = StorageScope.LOCAL) {
1317
- const previousValue = this.get(key, scope);
1318
- if (scope === StorageScope.SESSION) {
1319
- sessionStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
1320
- }
1321
- else {
1322
- localStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
1323
- }
1324
- const currentValue = this.get(key, scope);
1325
- if (currentValue !== previousValue) {
1326
- this.storageChange$.next({
1327
- key,
1328
- scope,
1329
- event: previousValue !== undefined
1330
- ? StorageServiceEventEnum.MODIFIED
1331
- : StorageServiceEventEnum.ADDED,
1332
- previousValue,
1333
- currentValue
1334
- });
1335
- }
1336
- }
1337
- remove(key, scope = StorageScope.LOCAL) {
1338
- const previousValue = this.get(key, scope);
1339
- if (scope === StorageScope.SESSION) {
1340
- sessionStorage.removeItem(`${this.options.key}.${key}`);
1341
- }
1342
- else {
1343
- localStorage.removeItem(`${this.options.key}.${key}`);
1344
- }
1345
- this.storageChange$.next({
1346
- key,
1347
- scope,
1348
- event: StorageServiceEventEnum.REMOVED,
1349
- previousValue
1350
- });
1351
- }
1352
- clear(scope = StorageScope.LOCAL) {
1353
- if (scope === StorageScope.SESSION) {
1354
- sessionStorage.clear();
1355
- }
1356
- else {
1357
- localStorage.clear();
1358
- }
1359
- this.storageChange$.next({ scope, event: StorageServiceEventEnum.CLEARED });
1360
- }
1361
- }
1362
-
1363
- class StorageService extends BaseStorage {
1364
- config;
1365
- constructor(config) {
1366
- super(config);
1367
- this.config = config;
1368
- }
1369
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: StorageService, deps: [{ token: ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
1370
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: StorageService, providedIn: 'root' });
1371
- }
1372
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: StorageService, decorators: [{
1373
- type: Injectable,
1374
- args: [{
1375
- providedIn: 'root'
1376
- }]
1377
- }], ctorParameters: () => [{ type: ConfigService }] });
1378
-
1379
- function getNumber(v, endposition, length) {
1380
- /* tslint:disable:no-bitwise*/
1381
- const mask = (1 << length) - 1;
1382
- return (v >> endposition) & mask;
1383
- /* tslint:enable:no-bitwise*/
1384
- }
1385
- class CompressionService {
1386
- base64Index = new Map();
1387
- indexBase64 = new Map();
1388
- constructor() {
1389
- this.generateBase64Index();
1390
- }
1391
- generateBase64Index() {
1392
- // https://fr.wikipedia.org/wiki/Base64
1393
- // A-Z => [0, 25]
1394
- for (let i = 0; i < 26; i++) {
1395
- this.base64Index.set(String.fromCharCode('A'.charCodeAt(0) + i), i);
1396
- this.indexBase64.set(i, String.fromCharCode('A'.charCodeAt(0) + i));
1397
- }
1398
- // a-z => [26, 51]
1399
- for (let i = 0; i < 26; i++) {
1400
- this.base64Index.set(String.fromCharCode('a'.charCodeAt(0) + i), i + 26);
1401
- this.indexBase64.set(i + 26, String.fromCharCode('a'.charCodeAt(0) + i));
1402
- }
1403
- // 0-9 => [52, 61]
1404
- for (let i = 0; i < 10; i++) {
1405
- this.base64Index.set(String.fromCharCode('0'.charCodeAt(0) + i), i + 52);
1406
- this.indexBase64.set(i + 52, String.fromCharCode('0'.charCodeAt(0) + i));
1407
- }
1408
- // + / => [62, 63]
1409
- this.base64Index.set('+', 62);
1410
- this.base64Index.set('/', 63);
1411
- this.indexBase64.set(62, '+');
1412
- this.indexBase64.set(63, '/');
1413
- }
1414
- compressBlob(blob) {
1415
- if (!blob) {
1416
- return;
1417
- }
1418
- const observable = new Observable((observer) => {
1419
- const reader = new FileReader();
1420
- reader.readAsDataURL(blob);
1421
- reader.onload = () => {
1422
- const base64 = reader.result.valueOf();
1423
- const text64 = base64.substr(base64.indexOf(',') + 1);
1424
- const compressed = this.compressStringBase64(text64);
1425
- const compressedData = {
1426
- length: text64.length,
1427
- type: blob.type,
1428
- object: compressed
1429
- };
1430
- observer.next(compressedData);
1431
- };
1432
- });
1433
- return observable;
1434
- }
1435
- decompressBlob(compressedData) {
1436
- /* tslint:disable:no-bitwise*/
1437
- const object = compressedData.object;
1438
- const length = compressedData.length;
1439
- const decompressed = this.decompressStringBase64(object, length);
1440
- const byteCharacters = atob(decompressed);
1441
- const byteNumbers = new Array(byteCharacters.length);
1442
- for (let i = 0; i < byteCharacters.length; i++) {
1443
- byteNumbers[i] = byteCharacters.charCodeAt(i);
1444
- }
1445
- const byteArray = new Uint8Array(byteNumbers);
1446
- const blob = new Blob([byteArray], { type: compressedData.type });
1447
- /* tslint:enable:no-bitwise*/
1448
- return blob;
1449
- }
1450
- compressStringBase64(s) {
1451
- /* tslint:disable:no-bitwise*/
1452
- let out = '';
1453
- let bits = 16;
1454
- let chr = 0;
1455
- let rem = 0;
1456
- for (const c of s) {
1457
- const value = this.base64Index.get(c);
1458
- if (bits > 6) {
1459
- bits -= 6;
1460
- chr += value << bits;
1461
- }
1462
- else {
1463
- rem = 6 - bits;
1464
- chr += value >> rem;
1465
- out += String.fromCharCode(chr);
1466
- chr = value << (16 - rem);
1467
- bits = 16 - rem;
1468
- }
1469
- }
1470
- if (s.length % 8 !== 0) {
1471
- out += String.fromCharCode(chr);
1472
- }
1473
- /* tslint:enable:no-bitwise*/
1474
- return String.fromCharCode(9731) + out;
1475
- }
1476
- decompressStringBase64(c, length) {
1477
- /* tslint:disable:no-bitwise*/
1478
- if (!c) {
1479
- return;
1480
- }
1481
- if (c.charCodeAt(0) !== 9731) {
1482
- return c;
1483
- }
1484
- let chr = 0;
1485
- let rem = 0;
1486
- let bits = 16;
1487
- let out = '';
1488
- let j = 1;
1489
- let value = c.charCodeAt(j);
1490
- for (let i = 0; i < length; i++) {
1491
- if (bits > 6) {
1492
- bits -= 6;
1493
- chr = getNumber(value, bits, 6);
1494
- out += this.indexBase64.get(chr);
1495
- }
1496
- else {
1497
- rem = 6 - bits;
1498
- chr = getNumber(value, 0, bits) << rem;
1499
- value = c.charCodeAt(++j);
1500
- chr += getNumber(value, 16 - rem, rem);
1501
- out += this.indexBase64.get(chr);
1502
- bits = 16 - rem;
1503
- }
1504
- }
1505
- return out;
1506
- /* tslint:enable:no-bitwise*/
1507
- }
1508
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: CompressionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1509
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: CompressionService, providedIn: 'root' });
1510
- }
1511
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: CompressionService, decorators: [{
1512
- type: Injectable,
1513
- args: [{
1514
- providedIn: 'root'
73
+ exports: [IgoActivityModule, IgoErrorModule, IgoLanguageModule]
1515
74
  }]
1516
75
  }], ctorParameters: () => [] });
1517
76
 
1518
- class NetworkService {
1519
- messageService;
1520
- injector;
1521
- stateChangeEventEmitter = new EventEmitter();
1522
- onlineSubscription;
1523
- offlineSubscription;
1524
- previousMessageId;
1525
- state = {
1526
- connection: window.navigator.onLine
1527
- };
1528
- constructor(messageService, injector) {
1529
- this.messageService = messageService;
1530
- this.injector = injector;
1531
- this.checkNetworkState();
1532
- }
1533
- checkNetworkState() {
1534
- this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {
1535
- if (this.previousMessageId) {
1536
- this.messageService.remove(this.previousMessageId);
1537
- }
1538
- const messageObj = this.messageService.info('igo.core.network.online.message', 'igo.core.network.online.title');
1539
- this.previousMessageId = messageObj.toastId;
1540
- this.state.connection = true;
1541
- this.emitEvent();
1542
- });
1543
- this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {
1544
- if (this.previousMessageId) {
1545
- this.messageService.remove(this.previousMessageId);
1546
- }
1547
- const messageObj = this.messageService.info('igo.core.network.offline.message', 'igo.core.network.offline.title');
1548
- this.previousMessageId = messageObj.toastId;
1549
- this.state.connection = false;
1550
- this.emitEvent();
1551
- });
1552
- }
1553
- emitEvent() {
1554
- this.stateChangeEventEmitter.emit(this.state);
1555
- }
1556
- ngOnDestroy() {
1557
- try {
1558
- this.offlineSubscription.unsubscribe();
1559
- this.onlineSubscription.unsubscribe();
1560
- }
1561
- catch (e) { }
1562
- }
1563
- currentState(reportState = true) {
1564
- return reportState
1565
- ? this.stateChangeEventEmitter.pipe(debounceTime(300), startWith(this.state))
1566
- : this.stateChangeEventEmitter.pipe(debounceTime(300));
1567
- }
1568
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: NetworkService, deps: [{ token: MessageService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
1569
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: NetworkService, providedIn: 'root' });
1570
- }
1571
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: NetworkService, decorators: [{
1572
- type: Injectable,
1573
- args: [{
1574
- providedIn: 'root'
1575
- }]
1576
- }], ctorParameters: () => [{ type: MessageService }, { type: i0.Injector }] });
1577
-
1578
- class RegexService {
1579
- config;
1580
- options;
1581
- constructor(config) {
1582
- this.config = config;
1583
- this.options = this.config.getConfig('regex');
1584
- }
1585
- getAll() {
1586
- return this.options;
1587
- }
1588
- get(key) {
1589
- if (this.options) {
1590
- return this.options[key];
1591
- }
1592
- return;
1593
- }
1594
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RegexService, deps: [{ token: ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
1595
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RegexService, providedIn: 'root' });
1596
- }
1597
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RegexService, decorators: [{
1598
- type: Injectable,
1599
- args: [{
1600
- providedIn: 'root'
1601
- }]
1602
- }], ctorParameters: () => [{ type: ConfigService }] });
1603
-
1604
77
  /*
1605
78
  * Public API Surface of core
1606
79
  */
80
+ /** @deprecated */
81
+ // export * from '@igo2/core/language';
1607
82
 
1608
83
  /**
1609
84
  * Generated bundle index. Do not edit.
1610
85
  */
1611
86
 
1612
- export { ActivityInterceptor, ActivityService, AnalyticsService, BaseStorage, CONFIG_OPTIONS, CompressionService, ConfigService, DEFAULT_LANGUAGE_LOADER, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageLoaderBase, LanguageService, LoggingInterceptor, MONITORING_OPTIONS, Media, MediaOrientation, MediaService, MessageService, MessageType, NetworkService, ROUTE_SERVICE_OPTIONS, RegexService, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, identifySentryUser, isTracingEnabled, provideConfigLoader, provideConfigOptions, provideMockRootTranslation, provideMonitoring, provideRootTranslation, provideRouteServiceOptions, provideSentryMonitoring, setTranslationConfig, version };
87
+ export { IgoCoreModule };
1613
88
  //# sourceMappingURL=igo2-core.mjs.map