@gloww/gloww 0.9.0-beta.10

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 (308) hide show
  1. package/README.md +24 -0
  2. package/compute-version.js +117 -0
  3. package/esm2020/gloww-gloww.mjs +5 -0
  4. package/esm2020/lib/Components/code-editor/code-editor.component.mjs +59 -0
  5. package/esm2020/lib/Components/confirmation/confirmation.component.mjs +43 -0
  6. package/esm2020/lib/Components/display-objects/display-objects.component.mjs +499 -0
  7. package/esm2020/lib/Components/display-objects-configuration.mjs +2 -0
  8. package/esm2020/lib/Components/download-progress/download-progress.component.mjs +119 -0
  9. package/esm2020/lib/Components/folders/file-edit/file-edit.component.mjs +71 -0
  10. package/esm2020/lib/Components/folders/folders/folders.component.mjs +180 -0
  11. package/esm2020/lib/Components/header/header.component.mjs +14 -0
  12. package/esm2020/lib/Components/html-editor/html-editor.component.mjs +175 -0
  13. package/esm2020/lib/Components/menu-list-item/menu-list-item.component.mjs +101 -0
  14. package/esm2020/lib/Components/prompt/prompt.component.mjs +52 -0
  15. package/esm2020/lib/Components/result-table/result-table.component.mjs +21 -0
  16. package/esm2020/lib/Components/search-form/search-form.component.mjs +14 -0
  17. package/esm2020/lib/Components/secure-a/secure-a.component.mjs +31 -0
  18. package/esm2020/lib/Components/secure-img/secure-img.component.mjs +45 -0
  19. package/esm2020/lib/Components/upload-doc/upload-doc.component.mjs +95 -0
  20. package/esm2020/lib/Components/upload-file/upload-file.component.mjs +138 -0
  21. package/esm2020/lib/Directives/file-sink.directive.mjs +52 -0
  22. package/esm2020/lib/Models/nav-item.mjs +2 -0
  23. package/esm2020/lib/Pipes/html-format.pipe.mjs +23 -0
  24. package/esm2020/lib/Pipes/retry-with-delay.mjs +12 -0
  25. package/esm2020/lib/Pipes/safe-html.pipe.mjs +22 -0
  26. package/esm2020/lib/Pipes/secure.pipe.mjs +34 -0
  27. package/esm2020/lib/Services/dialog.service.mjs +29 -0
  28. package/esm2020/lib/Services/folder-service-config.mjs +21 -0
  29. package/esm2020/lib/Services/folder.service.mjs +50 -0
  30. package/esm2020/lib/Services/gloww.service.mjs +66 -0
  31. package/esm2020/lib/Services/nav.service.mjs +28 -0
  32. package/esm2020/lib/Services/version-check.service.mjs +81 -0
  33. package/esm2020/lib/Services/voice-recognition.service.mjs +55 -0
  34. package/esm2020/lib/gloww-security/Components/change-password-dlg/change-password-dlg.component.mjs +67 -0
  35. package/esm2020/lib/gloww-security/Components/login/login.component.mjs +173 -0
  36. package/esm2020/lib/gloww-security/Components/social-network/social-network.component.mjs +46 -0
  37. package/esm2020/lib/gloww-security/Components/social-network-dlg/social-network-dlg.component.mjs +52 -0
  38. package/esm2020/lib/gloww-security/Components/user-menu/user-menu.component.mjs +73 -0
  39. package/esm2020/lib/gloww-security/Helpers/administrator.guard.mjs +27 -0
  40. package/esm2020/lib/gloww-security/Helpers/auth.guard.mjs +57 -0
  41. package/esm2020/lib/gloww-security/Helpers/error.interceptor.mjs +29 -0
  42. package/esm2020/lib/gloww-security/Helpers/index.mjs +5 -0
  43. package/esm2020/lib/gloww-security/Helpers/jwt.interceptor.mjs +31 -0
  44. package/esm2020/lib/gloww-security/Helpers/staging.interceptor.mjs +24 -0
  45. package/esm2020/lib/gloww-security/Models/oauthassociation.mjs +6 -0
  46. package/esm2020/lib/gloww-security/Models/user.mjs +3 -0
  47. package/esm2020/lib/gloww-security/Services/authentication-service-config.mjs +25 -0
  48. package/esm2020/lib/gloww-security/Services/authentication.service.mjs +205 -0
  49. package/esm2020/lib/gloww-security/Services/gloww-security.service.mjs +14 -0
  50. package/esm2020/lib/gloww-security/gloww-security.module.mjs +171 -0
  51. package/esm2020/lib/gloww.module.mjs +220 -0
  52. package/esm2020/lib/injection-token.mjs +3 -0
  53. package/esm2020/public-api.mjs +32 -0
  54. package/fesm2015/gloww-gloww.mjs +3104 -0
  55. package/fesm2015/gloww-gloww.mjs.map +1 -0
  56. package/fesm2020/gloww-gloww.mjs +3065 -0
  57. package/fesm2020/gloww-gloww.mjs.map +1 -0
  58. package/gloww-assets/.gitkeep +0 -0
  59. package/gloww-assets/7SS_logo.svg +1 -0
  60. package/gloww-assets/7SS_wobl.svg +1 -0
  61. package/gloww-assets/7stars.png +0 -0
  62. package/gloww-assets/gloww.svg +316 -0
  63. package/gloww-assets/images/google_signin_buttons/Google_signin_button.sketch +0 -0
  64. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_dark_disabled_hdpi.9.png +0 -0
  65. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_dark_focus_hdpi.9.png +0 -0
  66. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_dark_normal_hdpi.9.png +0 -0
  67. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_dark_pressed_hdpi.9.png +0 -0
  68. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_light_disabled_hdpi.9.png +0 -0
  69. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_light_focus_hdpi.9.png +0 -0
  70. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_light_normal_hdpi.9.png +0 -0
  71. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_light_pressed_hdpi.9.png +0 -0
  72. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_dark_disabled_hdpi.9.png +0 -0
  73. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_dark_focus_hdpi.9.png +0 -0
  74. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_dark_normal_hdpi.9.png +0 -0
  75. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_dark_pressed_hdpi.9.png +0 -0
  76. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_light_disabled_hdpi.9.png +0 -0
  77. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_light_focus_hdpi.9.png +0 -0
  78. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_light_normal_hdpi.9.png +0 -0
  79. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_light_pressed_hdpi.9.png +0 -0
  80. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_dark_disabled_ldpi.9.png +0 -0
  81. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_dark_focus_ldpi.9.png +0 -0
  82. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_dark_normal_ldpi.9.png +0 -0
  83. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_dark_pressed_ldpi.9.png +0 -0
  84. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_light_disabled_ldpi.9.png +0 -0
  85. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_light_focus_ldpi.9.png +0 -0
  86. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_light_normal_ldpi.9.png +0 -0
  87. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_light_pressed_ldpi.9.png +0 -0
  88. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_dark_disabled_ldpi.9.png +0 -0
  89. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_dark_focus_ldpi.9.png +0 -0
  90. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_dark_normal_ldpi.9.png +0 -0
  91. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_dark_pressed_ldpi.9.png +0 -0
  92. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_light_disabled_ldpi.9.png +0 -0
  93. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_light_focus_ldpi.9.png +0 -0
  94. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_light_normal_ldpi.9.png +0 -0
  95. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_light_pressed_ldpi.9.png +0 -0
  96. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_dark_disabled_mdpi.9.png +0 -0
  97. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_dark_focus_mdpi.9.png +0 -0
  98. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_dark_normal_mdpi.9.png +0 -0
  99. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_dark_pressed_mdpi.9.png +0 -0
  100. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_light_disabled_mdpi.9.png +0 -0
  101. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_light_focus_mdpi.9.png +0 -0
  102. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_light_normal_mdpi.9.png +0 -0
  103. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_light_pressed_mdpi.9.png +0 -0
  104. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_dark_disabled_mdpi.9.png +0 -0
  105. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_dark_focus_mdpi.9.png +0 -0
  106. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_dark_normal_mdpi.9.png +0 -0
  107. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_dark_pressed_mdpi.9.png +0 -0
  108. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_light_disabled_mdpi.9.png +0 -0
  109. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_light_focus_mdpi.9.png +0 -0
  110. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_light_normal_mdpi.9.png +0 -0
  111. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_light_pressed_mdpi.9.png +0 -0
  112. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_dark_disabled_tvdpi.9.png +0 -0
  113. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_dark_focus_tvdpi.9.png +0 -0
  114. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_dark_normal_tvdpi.9.png +0 -0
  115. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_dark_pressed_tvdpi.9.png +0 -0
  116. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_light_disabled_tvdpi.9.png +0 -0
  117. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_light_focus_tvdpi.9.png +0 -0
  118. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_light_normal_tvdpi.9.png +0 -0
  119. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_light_pressed_tvdpi.9.png +0 -0
  120. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_dark_disabled_tvdpi.9.png +0 -0
  121. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_dark_focus_tvdpi.9.png +0 -0
  122. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_dark_normal_tvdpi.9.png +0 -0
  123. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_dark_pressed_tvdpi.9.png +0 -0
  124. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_light_disabled_tvdpi.9.png +0 -0
  125. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_light_focus_tvdpi.9.png +0 -0
  126. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_light_normal_tvdpi.9.png +0 -0
  127. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_light_pressed_tvdpi.9.png +0 -0
  128. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_dark_disabled_xhdpi.9.png +0 -0
  129. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_dark_focus_xhdpi.9.png +0 -0
  130. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_dark_normal_xhdpi.9.png +0 -0
  131. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_dark_pressed_xhdpi.9.png +0 -0
  132. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_light_disabled_xhdpi.9.png +0 -0
  133. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_light_focus_xhdpi.9.png +0 -0
  134. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_light_normal_xhdpi.9.png +0 -0
  135. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_light_pressed_xhdpi.9.png +0 -0
  136. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_dark_disabled_xhdpi.9.png +0 -0
  137. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_dark_focus_xhdpi.9.png +0 -0
  138. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_dark_normal_xhdpi.9.png +0 -0
  139. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_dark_pressed_xhdpi.9.png +0 -0
  140. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_light_disabled_xhdpi.9.png +0 -0
  141. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_light_focus_xhdpi.9.png +0 -0
  142. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_light_normal_xhdpi.9.png +0 -0
  143. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_light_pressed_xhdpi.9.png +0 -0
  144. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_dark_disabled_xxhdpi.9.png +0 -0
  145. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_dark_focus_xxhdpi.9.png +0 -0
  146. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_dark_normal_xxhdpi.9.png +0 -0
  147. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_dark_pressed_xxhdpi.9.png +0 -0
  148. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_light_disabled_xxhdpi.9.png +0 -0
  149. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_light_focus_xxhdpi.9.png +0 -0
  150. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_light_normal_xxhdpi.9.png +0 -0
  151. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_light_pressed_xxhdpi.9.png +0 -0
  152. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_dark_disabled_xxhdpi.9.png +0 -0
  153. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_dark_focus_xxhdpi.9.png +0 -0
  154. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_dark_normal_xxhdpi.9.png +0 -0
  155. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_dark_pressed_xxhdpi.9.png +0 -0
  156. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_light_disabled_xxhdpi.9.png +0 -0
  157. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_light_focus_xxhdpi.9.png +0 -0
  158. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_light_normal_xxhdpi.9.png +0 -0
  159. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_light_pressed_xxhdpi.9.png +0 -0
  160. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_dark_disabled_xxxhdpi.9.png +0 -0
  161. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_dark_focus_xxxhdpi.9.png +0 -0
  162. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_dark_normal_xxxhdpi.9.png +0 -0
  163. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_dark_pressed_xxxhdpi.9.png +0 -0
  164. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_light_disabled_xxxhdpi.9.png +0 -0
  165. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_light_focus_xxxhdpi.9.png +0 -0
  166. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_light_normal_xxxhdpi.9.png +0 -0
  167. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_light_pressed_xxxhdpi.9.png +0 -0
  168. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_dark_disabled_xxxhdpi.9.png +0 -0
  169. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_dark_focus_xxxhdpi.9.png +0 -0
  170. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_dark_normal_xxxhdpi.9.png +0 -0
  171. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_dark_pressed_xxxhdpi.9.png +0 -0
  172. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_light_disabled_xxxhdpi.9.png +0 -0
  173. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_light_focus_xxxhdpi.9.png +0 -0
  174. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_light_normal_xxxhdpi.9.png +0 -0
  175. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_light_pressed_xxxhdpi.9.png +0 -0
  176. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_dark_disabled_ios.png +0 -0
  177. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_dark_focus_ios.png +0 -0
  178. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_dark_normal_ios.png +0 -0
  179. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_dark_pressed_ios.png +0 -0
  180. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_light_disabled_ios.png +0 -0
  181. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_light_focus_ios.png +0 -0
  182. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_light_normal_ios.png +0 -0
  183. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_light_pressed_ios.png +0 -0
  184. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_dark_disabled_ios.png +0 -0
  185. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_dark_focus_ios.png +0 -0
  186. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_dark_normal_ios.png +0 -0
  187. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_dark_pressed_ios.png +0 -0
  188. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_light_disabled_ios.png +0 -0
  189. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_light_focus_ios.png +0 -0
  190. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_light_normal_ios.png +0 -0
  191. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_light_pressed_ios.png +0 -0
  192. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_dark_disabled_ios@2x.png +0 -0
  193. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_dark_focus_ios@2x.png +0 -0
  194. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_dark_normal_ios@2x.png +0 -0
  195. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_dark_pressed_ios@2x.png +0 -0
  196. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_light_disabled_ios@2x.png +0 -0
  197. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_light_focus_ios@2x.png +0 -0
  198. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_light_normal_ios@2x.png +0 -0
  199. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_light_pressed_ios@2x.png +0 -0
  200. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_dark_disabled_ios@2x.png +0 -0
  201. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_dark_focus_ios@2x.png +0 -0
  202. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_dark_normal_ios@2x.png +0 -0
  203. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_dark_pressed_ios@2x.png +0 -0
  204. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_light_disabled_ios@2x.png +0 -0
  205. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_light_focus_ios@2x.png +0 -0
  206. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_light_normal_ios@2x.png +0 -0
  207. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_light_pressed_ios@2x.png +0 -0
  208. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_dark_disabled_ios@3x.png +0 -0
  209. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_dark_focus_ios@3x.png +0 -0
  210. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_dark_normal_ios@3x.png +0 -0
  211. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_dark_pressed_ios@3x.png +0 -0
  212. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_light_disabled_ios@3x.png +0 -0
  213. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_light_focus_ios@3x.png +0 -0
  214. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_light_normal_ios@3x.png +0 -0
  215. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_light_pressed_ios@3x.png +0 -0
  216. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_dark_disabled_ios@3x.png +0 -0
  217. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_dark_focus_ios@3x.png +0 -0
  218. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_dark_normal_ios@3x.png +0 -0
  219. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_dark_pressed_ios@3x.png +0 -0
  220. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_light_disabled_ios@3x.png +0 -0
  221. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_light_focus_ios@3x.png +0 -0
  222. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_light_normal_ios@3x.png +0 -0
  223. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_light_pressed_ios@3x.png +0 -0
  224. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_dark_disabled_web.png +0 -0
  225. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_dark_focus_web.png +0 -0
  226. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_dark_normal_web.png +0 -0
  227. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_dark_pressed_web.png +0 -0
  228. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_light_disabled_web.png +0 -0
  229. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_light_focus_web.png +0 -0
  230. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_light_normal_web.png +0 -0
  231. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_light_pressed_web.png +0 -0
  232. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_dark_disabled_web@2x.png +0 -0
  233. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_dark_focus_web@2x.png +0 -0
  234. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_dark_normal_web@2x.png +0 -0
  235. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_dark_pressed_web@2x.png +0 -0
  236. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_light_disabled_web@2x.png +0 -0
  237. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_light_focus_web@2x.png +0 -0
  238. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_light_normal_web@2x.png +0 -0
  239. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_light_pressed_web@2x.png +0 -0
  240. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_disabled_ios.eps +814 -0
  241. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_disabled_ios.svg +24 -0
  242. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_focus_ios.eps +1866 -0
  243. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_focus_ios.svg +51 -0
  244. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_normal_ios.eps +1031 -0
  245. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_normal_ios.svg +50 -0
  246. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_pressed_ios.eps +1031 -0
  247. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_pressed_ios.svg +50 -0
  248. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_disabled_ios.eps +814 -0
  249. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_disabled_ios.svg +24 -0
  250. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_focus_ios.eps +1837 -0
  251. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_focus_ios.svg +44 -0
  252. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_normal_ios.eps +1002 -0
  253. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_normal_ios.svg +43 -0
  254. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_pressed_ios.eps +1002 -0
  255. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_pressed_ios.svg +43 -0
  256. package/gloww-assets/swagger.svg +1 -0
  257. package/gloww-gloww.d.ts +5 -0
  258. package/lib/Components/code-editor/code-editor.component.d.ts +16 -0
  259. package/lib/Components/confirmation/confirmation.component.d.ts +20 -0
  260. package/lib/Components/display-objects/display-objects.component.d.ts +93 -0
  261. package/lib/Components/display-objects-configuration.d.ts +5 -0
  262. package/lib/Components/download-progress/download-progress.component.d.ts +30 -0
  263. package/lib/Components/folders/file-edit/file-edit.component.d.ts +31 -0
  264. package/lib/Components/folders/folders/folders.component.d.ts +33 -0
  265. package/lib/Components/header/header.component.d.ts +8 -0
  266. package/lib/Components/html-editor/html-editor.component.d.ts +36 -0
  267. package/lib/Components/menu-list-item/menu-list-item.component.d.ts +22 -0
  268. package/lib/Components/prompt/prompt.component.d.ts +25 -0
  269. package/lib/Components/result-table/result-table.component.d.ts +11 -0
  270. package/lib/Components/search-form/search-form.component.d.ts +8 -0
  271. package/lib/Components/secure-a/secure-a.component.d.ts +13 -0
  272. package/lib/Components/secure-img/secure-img.component.d.ts +17 -0
  273. package/lib/Components/upload-doc/upload-doc.component.d.ts +19 -0
  274. package/lib/Components/upload-file/upload-file.component.d.ts +34 -0
  275. package/lib/Directives/file-sink.directive.d.ts +11 -0
  276. package/lib/Models/nav-item.d.ts +8 -0
  277. package/lib/Pipes/html-format.pipe.d.ts +10 -0
  278. package/lib/Pipes/retry-with-delay.d.ts +2 -0
  279. package/lib/Pipes/safe-html.pipe.d.ts +10 -0
  280. package/lib/Pipes/secure.pipe.d.ts +13 -0
  281. package/lib/Services/dialog.service.d.ts +11 -0
  282. package/lib/Services/folder-service-config.d.ts +7 -0
  283. package/lib/Services/folder.service.d.ts +19 -0
  284. package/lib/Services/gloww.service.d.ts +23 -0
  285. package/lib/Services/nav.service.d.ts +13 -0
  286. package/lib/Services/version-check.service.d.ts +30 -0
  287. package/lib/Services/voice-recognition.service.d.ts +14 -0
  288. package/lib/gloww-security/Components/change-password-dlg/change-password-dlg.component.d.ts +19 -0
  289. package/lib/gloww-security/Components/login/login.component.d.ts +43 -0
  290. package/lib/gloww-security/Components/social-network/social-network.component.d.ts +25 -0
  291. package/lib/gloww-security/Components/social-network-dlg/social-network-dlg.component.d.ts +21 -0
  292. package/lib/gloww-security/Components/user-menu/user-menu.component.d.ts +24 -0
  293. package/lib/gloww-security/Helpers/administrator.guard.d.ts +14 -0
  294. package/lib/gloww-security/Helpers/auth.guard.d.ts +14 -0
  295. package/lib/gloww-security/Helpers/error.interceptor.d.ts +11 -0
  296. package/lib/gloww-security/Helpers/index.d.ts +4 -0
  297. package/lib/gloww-security/Helpers/jwt.interceptor.d.ts +11 -0
  298. package/lib/gloww-security/Helpers/staging.interceptor.d.ts +9 -0
  299. package/lib/gloww-security/Models/oauthassociation.d.ts +7 -0
  300. package/lib/gloww-security/Models/user.d.ts +9 -0
  301. package/lib/gloww-security/Services/authentication-service-config.d.ts +17 -0
  302. package/lib/gloww-security/Services/authentication.service.d.ts +40 -0
  303. package/lib/gloww-security/Services/gloww-security.service.d.ts +6 -0
  304. package/lib/gloww-security/gloww-security.module.d.ts +35 -0
  305. package/lib/gloww.module.d.ts +59 -0
  306. package/lib/injection-token.d.ts +2 -0
  307. package/package.json +40 -0
  308. package/public-api.d.ts +28 -0
@@ -0,0 +1,3065 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Injectable, Pipe, Component, Inject, Input, EventEmitter, Directive, HostBinding, Output, HostListener, ViewChild, ContentChildren, PLATFORM_ID, Optional, ContentChild, NgModule, SecurityContext } from '@angular/core';
3
+ import { Subject, BehaviorSubject, of, combineLatest, forkJoin, throwError } from 'rxjs';
4
+ import * as i1 from '@angular/common/http';
5
+ import { HttpClient, HttpParams, HttpEventType, HTTP_INTERCEPTORS, HttpClientModule, HttpResponse } from '@angular/common/http';
6
+ import * as i3 from '@angular/common';
7
+ import { Location, PlatformLocation, isPlatformBrowser, CommonModule } from '@angular/common';
8
+ import * as i1$2 from '@angular/material/dialog';
9
+ import { MAT_DIALOG_DATA, MatDialogConfig, MatDialogModule } from '@angular/material/dialog';
10
+ import * as i5 from '@angular/material/button';
11
+ import { MatButtonModule } from '@angular/material/button';
12
+ import * as i1$1 from '@angular/platform-browser';
13
+ import { BrowserModule } from '@angular/platform-browser';
14
+ import * as i2 from '@angular/router';
15
+ import { NavigationEnd, RouterModule } from '@angular/router';
16
+ import * as i5$3 from '@gloww/angular-editor';
17
+ import { AngularEditorModule } from '@gloww/angular-editor';
18
+ import { switchMap, map, tap, filter, catchError, take, mergeMap, retryWhen, scan, delay, first } from 'rxjs/operators';
19
+ import * as i15 from '@angular/material/sort';
20
+ import { MatSort, MatSortModule } from '@angular/material/sort';
21
+ import * as i13 from '@angular/material/paginator';
22
+ import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
23
+ import * as i12 from '@angular/material/table';
24
+ import { MatColumnDef, MatTableDataSource, MatTable, MatTableModule } from '@angular/material/table';
25
+ import * as i14 from '@angular/material/progress-spinner';
26
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
27
+ import * as i5$1 from '@angular/material/card';
28
+ import { MatCardModule } from '@angular/material/card';
29
+ import * as i11 from '@angular/material/icon';
30
+ import { MatIconModule } from '@angular/material/icon';
31
+ import * as i5$2 from '@angular/material/input';
32
+ import { MatInputModule } from '@angular/material/input';
33
+ import * as i1$4 from '@ctrl/ngx-codemirror';
34
+ import { CodemirrorModule } from '@ctrl/ngx-codemirror';
35
+ import * as i1$3 from '@angular/forms';
36
+ import { NG_VALUE_ACCESSOR, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
37
+ import * as i2$1 from '@angular/material/progress-bar';
38
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
39
+ import * as i7 from '@angular/material/form-field';
40
+ import { MatFormFieldModule } from '@angular/material/form-field';
41
+ import * as i8 from '@angular/material/select';
42
+ import { MatSelectModule } from '@angular/material/select';
43
+ import * as i9 from '@angular/material/core';
44
+ import { trigger, state, style, transition, animate } from '@angular/animations';
45
+ import * as i9$1 from '@angular/flex-layout/flex';
46
+ import * as i4 from '@angular/flex-layout/extended';
47
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
48
+ import { FlexLayoutModule } from '@angular/flex-layout';
49
+ import { MatToolbarModule } from '@angular/material/toolbar';
50
+ import { MatSidenavModule } from '@angular/material/sidenav';
51
+ import jwt_decode from 'jwt-decode';
52
+ import * as FileSaver from 'file-saver';
53
+ import * as JSZip from 'jszip';
54
+
55
+ const API_SERVER_URL = new InjectionToken('ApiServerUrl.config');
56
+ const GLOWW_APPLI = new InjectionToken('GlowwAppli.config');
57
+ // @Injectable({
58
+ // providedIn: 'root'
59
+ // })
60
+ class GlowwService {
61
+ constructor(_injector) {
62
+ this._injector = _injector;
63
+ this.InternalBasePath = '???';
64
+ this.basePathChange = new Subject();
65
+ this.baseUrl = '/';
66
+ this.location = _injector.get(Location);
67
+ this.http = _injector.get(HttpClient);
68
+ this.platformLocation = _injector.get(PlatformLocation);
69
+ try {
70
+ this.ApiServerUrl = _injector.get(API_SERVER_URL);
71
+ }
72
+ catch { }
73
+ try {
74
+ this.BasePath = _injector.get(GLOWW_APPLI);
75
+ }
76
+ catch { }
77
+ this.BasePath = this.BasePath ?? 'GlowwApi';
78
+ //@Optional() @Inject(API_SERVER_URL) apiServerUrl: string, @Optional() @Inject(GLOWW_APPLI) glowwAppli: string
79
+ this.baseHref = this.platformLocation.getBaseHrefFromDOM();
80
+ this.InternalBasePath = this.BasePath;
81
+ if (this.ApiServerUrl) {
82
+ this.baseUrl = this.ApiServerUrl;
83
+ if (!this.baseUrl.endsWith('/')) {
84
+ this.baseUrl += '/';
85
+ }
86
+ }
87
+ }
88
+ get basePath() {
89
+ return this.InternalBasePath;
90
+ }
91
+ set basePath(value) {
92
+ //alert(`setBasePath ${value}`)
93
+ var oldUrl = this.location.path();
94
+ var newUrl = oldUrl.replace(`/${this.InternalBasePath}/`, `/${value}/`);
95
+ //alert(`GlowwService setBasePath (${this.InternalBasePath},${value}) ${oldUrl} -> ${newUrl}`);
96
+ if (oldUrl !== newUrl) {
97
+ this.location.go(newUrl);
98
+ this.basePathChange.next(newUrl);
99
+ }
100
+ this.InternalBasePath = value;
101
+ }
102
+ getParams(obj) {
103
+ let params = new HttpParams();
104
+ if (!obj) {
105
+ return params;
106
+ }
107
+ Object.keys(obj).forEach(p => {
108
+ if (obj[p]) {
109
+ params = params.append(p.toString(), obj[p].toString());
110
+ }
111
+ });
112
+ return params;
113
+ }
114
+ }
115
+
116
+ class VersionCheckService {
117
+ constructor(http) {
118
+ this.http = http;
119
+ // this will be replaced by actual hash post-build.js
120
+ this.currentHash = '{{POST_BUILD_ENTERS_HASH_HERE}}';
121
+ }
122
+ /**
123
+ * Checks in every set frequency the version of frontend application
124
+ * @param url the url to test (default : /version.json)
125
+ * @param frequency - in milliseconds, defaults to 1 minutes
126
+ * @param callback - function to call when the version is different, default askReloadApplication
127
+ */
128
+ initVersionCheck(url = '/version.json', frequency = 1000 * 60, callback = this.askReloadApplication) {
129
+ this.callback = callback;
130
+ this.url = url;
131
+ this.checkVersion();
132
+ setInterval(() => {
133
+ this.checkVersion();
134
+ }, frequency);
135
+ }
136
+ askReloadApplication() {
137
+ console.log('askReload');
138
+ // ENTER YOUR CODE TO DO SOMETHING UPON VERSION CHANGE
139
+ if (confirm('Une nouvelle version est disponible sur le serveur. Il est nécessaire de recharger l\'application. Veuillez confirmer le rechargement de l\'application')) {
140
+ this.reloadApplication();
141
+ }
142
+ }
143
+ reloadApplication() {
144
+ console.log('reload');
145
+ let search = location.search;
146
+ if (search) {
147
+ search += '&';
148
+ }
149
+ search += '___t=' + new Date().getTime();
150
+ console.log(`Search ${search}`);
151
+ location.search = search;
152
+ }
153
+ checkVersion() {
154
+ // timestamp these requests to invalidate caches
155
+ this.http.get(this.url + '?t=' + new Date().getTime())
156
+ // .first()
157
+ .subscribe((response) => {
158
+ console.log('get version ok');
159
+ const hash = response.hash;
160
+ const hashChanged = this.hasHashChanged(this.currentHash, hash);
161
+ console.log(`HASH : Current : ${this.currentHash}, New : ${hash}, Changed ${hashChanged}`);
162
+ // If new version, do something
163
+ if (hashChanged) {
164
+ this.callback();
165
+ }
166
+ // store the new hash so we wouldn't trigger versionChange again
167
+ // only necessary in case you did not force refresh
168
+ this.currentHash = hash;
169
+ }, (err) => {
170
+ console.error(err, 'Could not get version');
171
+ });
172
+ }
173
+ /**
174
+ * Checks if hash has changed.
175
+ * This file has the JS hash, if it is a different one than in the version.json
176
+ * we are dealing with version change
177
+ * @param currentHash currenthash
178
+ * @param newHash newhash
179
+ * @returns the currenthash and newhash are different
180
+ */
181
+ hasHashChanged(currentHash, newHash) {
182
+ return currentHash !== newHash;
183
+ }
184
+ }
185
+ VersionCheckService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VersionCheckService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
186
+ VersionCheckService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VersionCheckService, providedIn: 'root' });
187
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VersionCheckService, decorators: [{
188
+ type: Injectable,
189
+ args: [{
190
+ providedIn: 'root'
191
+ }]
192
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
193
+
194
+ class SafeHtmlPipe {
195
+ constructor(sanitizer) {
196
+ this.sanitizer = sanitizer;
197
+ }
198
+ transform(style) {
199
+ return this.sanitizer.bypassSecurityTrustHtml(style);
200
+ // return this.sanitizer.bypassSecurityTrustStyle(style);
201
+ // return this.sanitizer.bypassSecurityTrustXxx(style); - see docs
202
+ }
203
+ }
204
+ SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
205
+ SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SafeHtmlPipe, decorators: [{
207
+ type: Pipe,
208
+ args: [{
209
+ name: 'safeHtml'
210
+ }]
211
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; } });
212
+
213
+ class ConfirmationComponent {
214
+ constructor(dialogRef, data) {
215
+ this.dialogRef = dialogRef;
216
+ this.data = data;
217
+ // Update view with given values
218
+ this.title = data.title;
219
+ this.message = data.message;
220
+ this.mode = data.mode ?? 'confirmation';
221
+ }
222
+ onConfirm() {
223
+ // Close the dialog, return true
224
+ this.dialogRef.close(true);
225
+ }
226
+ onDismiss() {
227
+ // Close the dialog, return false
228
+ this.dialogRef.close(false);
229
+ }
230
+ }
231
+ ConfirmationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ConfirmationComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
232
+ ConfirmationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: ConfirmationComponent, selector: "glw-confirmation", ngImport: i0, template: "<h1 mat-dialog-title>\r\n {{title}}\r\n</h1>\r\n\r\n<div mat-dialog-content>\r\n <p [innerHTML]=\"message | safeHtml\"></p>\r\n</div>\r\n\r\n<mat-dialog-actions *ngIf=\"mode==='confirmation'\">\r\n <button mat-button (click)=\"onDismiss()\">No</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"onConfirm()\">Yes</button>\r\n</mat-dialog-actions>\r\n<mat-dialog-actions *ngIf=\"mode==='alert'\">\r\n <button mat-raised-button color=\"primary\" (click)=\"onConfirm()\">OK</button>\r\n</mat-dialog-actions>\r\n", styles: [""], components: [{ type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], pipes: { "safeHtml": SafeHtmlPipe } });
233
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ConfirmationComponent, decorators: [{
234
+ type: Component,
235
+ args: [{ selector: 'glw-confirmation', template: "<h1 mat-dialog-title>\r\n {{title}}\r\n</h1>\r\n\r\n<div mat-dialog-content>\r\n <p [innerHTML]=\"message | safeHtml\"></p>\r\n</div>\r\n\r\n<mat-dialog-actions *ngIf=\"mode==='confirmation'\">\r\n <button mat-button (click)=\"onDismiss()\">No</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"onConfirm()\">Yes</button>\r\n</mat-dialog-actions>\r\n<mat-dialog-actions *ngIf=\"mode==='alert'\">\r\n <button mat-raised-button color=\"primary\" (click)=\"onConfirm()\">OK</button>\r\n</mat-dialog-actions>\r\n", styles: [""] }]
236
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: ConfirmationModel, decorators: [{
237
+ type: Inject,
238
+ args: [MAT_DIALOG_DATA]
239
+ }] }]; } });
240
+ // tslint:disable-next-line: max-classes-per-file
241
+ class ConfirmationModel {
242
+ constructor(title, message, mode) {
243
+ this.title = title;
244
+ this.message = message;
245
+ this.mode = mode;
246
+ }
247
+ }
248
+
249
+ class DialogService {
250
+ constructor(dialog) {
251
+ this.dialog = dialog;
252
+ }
253
+ createConfirmationDialog(title, message, mode) {
254
+ const dialogData = new ConfirmationModel(title, message, mode);
255
+ return this.dialog.open(ConfirmationComponent, {
256
+ maxWidth: '80%',
257
+ data: dialogData,
258
+ disableClose: true
259
+ });
260
+ }
261
+ openConfirmationDialog(title, message, mode) {
262
+ return this.createConfirmationDialog(title, message, mode).afterClosed();
263
+ }
264
+ }
265
+ DialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DialogService, deps: [{ token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
266
+ DialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DialogService, providedIn: 'root' });
267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DialogService, decorators: [{
268
+ type: Injectable,
269
+ args: [{
270
+ providedIn: 'root'
271
+ }]
272
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialog }]; } });
273
+
274
+ class NavService {
275
+ constructor(router) {
276
+ this.router = router;
277
+ this.currentUrl = new BehaviorSubject(undefined);
278
+ this.router.events.subscribe((event) => {
279
+ if (event instanceof NavigationEnd) {
280
+ this.currentUrl.next(event.urlAfterRedirects);
281
+ }
282
+ });
283
+ }
284
+ closeNav() {
285
+ this.appDrawer.close();
286
+ }
287
+ openNav() {
288
+ this.appDrawer.open();
289
+ }
290
+ }
291
+ NavService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NavService, deps: [{ token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
292
+ NavService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NavService });
293
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NavService, decorators: [{
294
+ type: Injectable
295
+ }], ctorParameters: function () { return [{ type: i2.Router }]; } });
296
+
297
+ class VoiceRecognitionService {
298
+ constructor() {
299
+ this.recognition = new webkitSpeechRecognition();
300
+ this.isStoppedSpeechRecog = false;
301
+ this.text = '';
302
+ }
303
+ init() {
304
+ this.recognition.interimResults = true;
305
+ this.recognition.lang = 'fr-be';
306
+ this.recognition.addEventListener('result', (e) => {
307
+ const transcript = Array.from(e.results)
308
+ .map((result) => result[0])
309
+ .map((result) => result.transcript)
310
+ .join('');
311
+ this.tempWords = transcript;
312
+ console.log(transcript);
313
+ });
314
+ }
315
+ start() {
316
+ this.isStoppedSpeechRecog = false;
317
+ this.recognition.start();
318
+ console.log("Speech recognition started");
319
+ this.recognition.addEventListener('end', (condition) => {
320
+ if (this.isStoppedSpeechRecog) {
321
+ this.recognition.stop();
322
+ console.log("End speech recognition");
323
+ }
324
+ else {
325
+ this.wordConcat();
326
+ this.recognition.start();
327
+ }
328
+ });
329
+ }
330
+ stop() {
331
+ this.isStoppedSpeechRecog = true;
332
+ this.wordConcat();
333
+ this.recognition.stop();
334
+ console.log("End speech recognition");
335
+ }
336
+ wordConcat() {
337
+ this.text = this.text + ' ' + this.tempWords + '.';
338
+ this.tempWords = '';
339
+ }
340
+ }
341
+ VoiceRecognitionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VoiceRecognitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
342
+ VoiceRecognitionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VoiceRecognitionService, providedIn: 'root' });
343
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VoiceRecognitionService, decorators: [{
344
+ type: Injectable,
345
+ args: [{
346
+ providedIn: 'root'
347
+ }]
348
+ }], ctorParameters: function () { return []; } });
349
+
350
+ class SecureImgComponent {
351
+ // we need HttpClient to load the image
352
+ constructor(httpClient, domSanitizer) {
353
+ this.httpClient = httpClient;
354
+ this.domSanitizer = domSanitizer;
355
+ this.src$ = new BehaviorSubject(this.src);
356
+ // this stream will contain the actual url that our img tag will load
357
+ // everytime the src changes, the previous call would be canceled and the
358
+ // new resource would be loaded
359
+ this.dataUrl$ = this.src$.pipe(switchMap(url => this.loadImage(url)));
360
+ }
361
+ ngOnChanges() {
362
+ this.src$.next(this.src);
363
+ }
364
+ loadImage(url) {
365
+ return this.httpClient
366
+ // load the image as a blob
367
+ .get(url, { responseType: 'blob' })
368
+ // create an object url of that blob that we can use in the src attribute
369
+ .pipe(map(e => this.domSanitizer.bypassSecurityTrustUrl(URL.createObjectURL(e))));
370
+ }
371
+ }
372
+ SecureImgComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecureImgComponent, deps: [{ token: i1.HttpClient }, { token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
373
+ SecureImgComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SecureImgComponent, selector: "secure-img", inputs: { src: "src" }, usesOnChanges: true, ngImport: i0, template: `
374
+ <img [src]="dataUrl$ | async" style="object-fit: contain;"/>
375
+ `, isInline: true, pipes: { "async": i3.AsyncPipe } });
376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecureImgComponent, decorators: [{
377
+ type: Component,
378
+ args: [{
379
+ selector: 'secure-img',
380
+ template: `
381
+ <img [src]="dataUrl$ | async" style="object-fit: contain;"/>
382
+ `
383
+ }]
384
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i1$1.DomSanitizer }]; }, propDecorators: { src: [{
385
+ type: Input
386
+ }] } });
387
+
388
+ class FileSinkDirective {
389
+ constructor() {
390
+ this.fileDropped = new EventEmitter();
391
+ }
392
+ // Dragover listener
393
+ onDragOver(evt) {
394
+ evt.preventDefault();
395
+ evt.stopPropagation();
396
+ this.fileOver = true;
397
+ }
398
+ // Dragleave listener
399
+ onDragLeave(evt) {
400
+ evt.preventDefault();
401
+ evt.stopPropagation();
402
+ this.fileOver = false;
403
+ }
404
+ // Drop listener
405
+ ondrop(evt) {
406
+ evt.preventDefault();
407
+ evt.stopPropagation();
408
+ this.fileOver = false;
409
+ let files = evt.dataTransfer.files;
410
+ if (files.length > 0) {
411
+ this.fileDropped.emit(files);
412
+ }
413
+ }
414
+ }
415
+ FileSinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileSinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
416
+ FileSinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FileSinkDirective, selector: "[glowwFileSink]", outputs: { fileDropped: "fileDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "ondrop($event)" }, properties: { "class.fileover": "this.fileOver" } }, ngImport: i0 });
417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileSinkDirective, decorators: [{
418
+ type: Directive,
419
+ args: [{
420
+ selector: '[glowwFileSink]'
421
+ }]
422
+ }], propDecorators: { fileOver: [{
423
+ type: HostBinding,
424
+ args: ['class.fileover']
425
+ }], fileDropped: [{
426
+ type: Output
427
+ }], onDragOver: [{
428
+ type: HostListener,
429
+ args: ['dragover', ['$event']]
430
+ }], onDragLeave: [{
431
+ type: HostListener,
432
+ args: ['dragleave', ['$event']]
433
+ }], ondrop: [{
434
+ type: HostListener,
435
+ args: ['drop', ['$event']]
436
+ }] } });
437
+
438
+ class UploadFileComponent {
439
+ constructor() {
440
+ this.multiple = false;
441
+ this.allowAltFileName = false;
442
+ this.acceptMime = '*/*';
443
+ this.onChange = () => { };
444
+ this.onTouched = () => { };
445
+ this.files = [];
446
+ }
447
+ ngAfterViewInit() {
448
+ const fileUpload = this.fileUpload.nativeElement;
449
+ fileUpload.onchange = () => {
450
+ if (!this.multiple) {
451
+ this.files = [];
452
+ //if (this.allowAltFileName) { this.fileNames.clear(); }
453
+ }
454
+ for (const file of fileUpload.files) {
455
+ this.files.push({ data: file, inProgress: false, progress: 0, fileName: file.name, size: file.size, altFileName: '', status: '' });
456
+ //if (this.allowAltFileName) { this.fileNames.push(this.FileName(file.name)); }
457
+ }
458
+ this.onChange(this.files);
459
+ this.onTouched();
460
+ };
461
+ }
462
+ get value() {
463
+ return this.files;
464
+ //return this._value;
465
+ }
466
+ set value(val) {
467
+ this.files = val;
468
+ this.onChange(val);
469
+ this.onTouched();
470
+ }
471
+ writeValue(obj) {
472
+ this.value = obj;
473
+ }
474
+ registerOnChange(fn) {
475
+ this.onChange = fn;
476
+ }
477
+ registerOnTouched(fn) {
478
+ this.onTouched = fn;
479
+ }
480
+ setDisabledState(isDisabled) {
481
+ //throw new Error('Method not implemented.');
482
+ }
483
+ SelectFiles() {
484
+ this.fileUpload.nativeElement.click();
485
+ }
486
+ ChangeAltName(i, $event) {
487
+ this.files[i].altFileName = $event.target.value;
488
+ this.onChange(this.files);
489
+ this.onTouched();
490
+ }
491
+ onFileDropped($event) {
492
+ this.prepareFilesList($event);
493
+ }
494
+ prepareFilesList(files) {
495
+ if (files.length > 1 && !this.multiple) {
496
+ alert("You can only drop an only file at once");
497
+ return;
498
+ }
499
+ if (this.files && this.files.length > 0 && !this.multiple) {
500
+ if (confirm("Do you want to replace current file ?")) {
501
+ this.files = [];
502
+ }
503
+ else {
504
+ return;
505
+ }
506
+ }
507
+ if (!this.files)
508
+ this.files = [];
509
+ for (const file of files) {
510
+ this.files.push({ data: file, inProgress: false, progress: 0, fileName: file.name, size: file.size, altFileName: '', status: '' });
511
+ }
512
+ this.onChange(this.files);
513
+ this.onTouched();
514
+ }
515
+ /**
516
+ * format bytes
517
+ * @param bytes (File size in bytes)
518
+ * @param decimals (Decimals point)
519
+ */
520
+ formatBytes(bytes, decimals = 2) {
521
+ if (bytes === 0) {
522
+ return "0 Bytes";
523
+ }
524
+ const k = 1024;
525
+ const dm = decimals <= 0 ? 0 : decimals;
526
+ const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
527
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
528
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
529
+ }
530
+ deleteFile(index) {
531
+ if (this.files[index].progress && this.files[index].progress < 100) {
532
+ console.log("Upload in progress.");
533
+ return;
534
+ }
535
+ this.files.splice(index, 1);
536
+ this.onChange(this.files);
537
+ this.onTouched();
538
+ }
539
+ }
540
+ UploadFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UploadFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
541
+ UploadFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: UploadFileComponent, selector: "gloww-upload-file", inputs: { multiple: "multiple", allowAltFileName: "allowAltFileName", acceptMime: "acceptMime" }, providers: [
542
+ {
543
+ provide: NG_VALUE_ACCESSOR,
544
+ multi: true,
545
+ useExisting: UploadFileComponent
546
+ }
547
+ ], viewQueries: [{ propertyName: "fileUpload", first: true, predicate: ["fileUpload"], descendants: true }], ngImport: i0, template: "<mat-card glowwFileSink (fileDropped)=\"onFileDropped($event)\" style=\"height:calc(100% - 40px)\">\r\n <mat-card-content style=\"min-height:100px;height:calc(100% - 60px)\">\r\n <div class=\"files-list\" *ngIf=\"files && files.length\" style=\"height:calc(100% - 60px)\">\r\n <div class=\"single-file\" *ngFor=\"let file of files; let i = index\" [ngClass]=\"file.status\">\r\n <i class=\"fa-thin fa-file fa-lg\"></i>\r\n <div class=\"info\">\r\n <h4 class=\"name\">\r\n {{ file?.fileName }}\r\n </h4>\r\n <p class=\"size\">\r\n {{ formatBytes(file?.size) }}\r\n </p>\r\n <mat-progress-bar [value]=\"file.progress\"></mat-progress-bar>\r\n </div>\r\n <i class=\"fa-thin fa-trash fa-lg\" (click)=\"deleteFile(i)\"></i>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!files || !files.length\" style=\"height:calc(100% - 60px)\">No file(s) selected</div>\r\n <input type=\"file\" #fileUpload id=\"fileUpload\" name=\"fileUpload\" [accept]=\"acceptMime\" style=\"display:none;\" [multiple]=\"multiple\" />\r\n </mat-card-content>\r\n <mat-card-actions style=\"text-align:center\">\r\n <button mat-raised-button color=\"accent\" (click)=\"SelectFiles()\">\r\n <i class=\"fal fa-file-upload\"></i> <span *ngIf=\"!multiple\">Select file or Drop a file</span>\r\n <span *ngIf=\"multiple\">Select file(s) or drop file(s)</span>\r\n </button>\r\n </mat-card-actions>\r\n</mat-card>", styles: ["ul{list-style:none;padding-left:0}ul li{padding-bottom:10px}.fileover{-webkit-animation:shake 1s;animation:shake 1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.files-list{margin-top:1.5rem}.files-list .single-file{padding:.5rem;justify-content:space-between;align-items:center;border:dashed 1px #979797;margin-bottom:1rem;display:flex;flex-grow:1}.files-list .single-file img.delete{margin-left:.5rem;cursor:pointer;align-self:flex-end}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0;margin-bottom:.25rem}.files-list .single-file .info{width:100%}.Done{background-color:green}.Error{background-color:red}@-webkit-keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}@keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}\n"], components: [{ type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i2$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: FileSinkDirective, selector: "[glowwFileSink]", outputs: ["fileDropped"] }, { type: i5$1.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }] });
548
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UploadFileComponent, decorators: [{
549
+ type: Component,
550
+ args: [{ selector: 'gloww-upload-file', providers: [
551
+ {
552
+ provide: NG_VALUE_ACCESSOR,
553
+ multi: true,
554
+ useExisting: UploadFileComponent
555
+ }
556
+ ], template: "<mat-card glowwFileSink (fileDropped)=\"onFileDropped($event)\" style=\"height:calc(100% - 40px)\">\r\n <mat-card-content style=\"min-height:100px;height:calc(100% - 60px)\">\r\n <div class=\"files-list\" *ngIf=\"files && files.length\" style=\"height:calc(100% - 60px)\">\r\n <div class=\"single-file\" *ngFor=\"let file of files; let i = index\" [ngClass]=\"file.status\">\r\n <i class=\"fa-thin fa-file fa-lg\"></i>\r\n <div class=\"info\">\r\n <h4 class=\"name\">\r\n {{ file?.fileName }}\r\n </h4>\r\n <p class=\"size\">\r\n {{ formatBytes(file?.size) }}\r\n </p>\r\n <mat-progress-bar [value]=\"file.progress\"></mat-progress-bar>\r\n </div>\r\n <i class=\"fa-thin fa-trash fa-lg\" (click)=\"deleteFile(i)\"></i>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!files || !files.length\" style=\"height:calc(100% - 60px)\">No file(s) selected</div>\r\n <input type=\"file\" #fileUpload id=\"fileUpload\" name=\"fileUpload\" [accept]=\"acceptMime\" style=\"display:none;\" [multiple]=\"multiple\" />\r\n </mat-card-content>\r\n <mat-card-actions style=\"text-align:center\">\r\n <button mat-raised-button color=\"accent\" (click)=\"SelectFiles()\">\r\n <i class=\"fal fa-file-upload\"></i> <span *ngIf=\"!multiple\">Select file or Drop a file</span>\r\n <span *ngIf=\"multiple\">Select file(s) or drop file(s)</span>\r\n </button>\r\n </mat-card-actions>\r\n</mat-card>", styles: ["ul{list-style:none;padding-left:0}ul li{padding-bottom:10px}.fileover{-webkit-animation:shake 1s;animation:shake 1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.files-list{margin-top:1.5rem}.files-list .single-file{padding:.5rem;justify-content:space-between;align-items:center;border:dashed 1px #979797;margin-bottom:1rem;display:flex;flex-grow:1}.files-list .single-file img.delete{margin-left:.5rem;cursor:pointer;align-self:flex-end}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0;margin-bottom:.25rem}.files-list .single-file .info{width:100%}.Done{background-color:green}.Error{background-color:red}@-webkit-keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}@keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}\n"] }]
557
+ }], ctorParameters: function () { return []; }, propDecorators: { fileUpload: [{
558
+ type: ViewChild,
559
+ args: ['fileUpload']
560
+ }], multiple: [{
561
+ type: Input
562
+ }], allowAltFileName: [{
563
+ type: Input
564
+ }], acceptMime: [{
565
+ type: Input
566
+ }] } });
567
+
568
+ class UploadDocComponent {
569
+ constructor(dialogRef, data, formBuilder) {
570
+ this.dialogRef = dialogRef;
571
+ this.data = data;
572
+ this.formBuilder = formBuilder;
573
+ this.multiple = false;
574
+ this.allowAltFileName = false;
575
+ this.acceptMime = '*/*';
576
+ this.files = [];
577
+ if (data && data.acceptMime) {
578
+ this.acceptMime = data.acceptMime;
579
+ }
580
+ if (data && data.multiple) {
581
+ this.multiple = data.multiple;
582
+ }
583
+ if (data && data.allowAltFileName) {
584
+ this.allowAltFileName = data.allowAltFileName;
585
+ }
586
+ if (data && data.callback) {
587
+ this.callback = data.callback;
588
+ }
589
+ }
590
+ /*
591
+ get fileNames(): FormArray {
592
+ return this.form.get("fileNames") as FormArray
593
+ }
594
+
595
+ FileName(fn: string): FormGroup {
596
+ return this.formBuilder.group({
597
+ fileName: fn
598
+ })
599
+ }
600
+
601
+ ngOnInit() {
602
+ }
603
+
604
+ onClick() {
605
+ const fileUpload = this.fileUpload.nativeElement; fileUpload.onchange = () => {
606
+ if (this.multiple) {
607
+ this.files = [];
608
+ if (this.allowAltFileName) { this.fileNames.clear(); }
609
+ }
610
+ for (const file of fileUpload.files) {
611
+ this.files.push({ data: file, inProgress: false, progress: 0, fileName: file.name });
612
+ if (this.allowAltFileName) { this.fileNames.push(this.FileName(file.name)); }
613
+ }
614
+ };
615
+ fileUpload.click();
616
+ }
617
+
618
+ private uploadFiles() {
619
+ this.fileUpload.nativeElement.value = '';
620
+ this.files.forEach(file => {
621
+ alert('upload file');
622
+ // this.uploadFile(file);
623
+ });
624
+ }
625
+ */
626
+ cancel() {
627
+ this.dialogRef.close();
628
+ }
629
+ save() {
630
+ console.log("save UploadDoc");
631
+ console.log(`this.files.length ${this.files.length}`);
632
+ /*if (this.allowAltFileName) {
633
+ for (let i = 0; i < this.files.length; i++) {
634
+ // Comment to be sure new version
635
+ this.files[i].name = this.fileNames.value[i].fileName;
636
+ }
637
+ }*/
638
+ if (this.callback) {
639
+ this.callback(this.files).subscribe(res => this.dialogRef.close(this.files));
640
+ }
641
+ else {
642
+ this.dialogRef.close(this.files);
643
+ }
644
+ }
645
+ }
646
+ UploadDocComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UploadDocComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i1$3.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
647
+ UploadDocComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: UploadDocComponent, selector: "gloww-upload-doc", ngImport: i0, template: "<h2 mat-dialog-title>\r\n Association d'un nouveau document</h2>\r\n\r\n<mat-dialog-content>\r\n\r\n <gloww-upload-file [(ngModel)]=\"files\" [acceptMime]=\"acceptMime\" [multiple]=\"multiple\" [allowAltFileName]=\"allowAltFileName\"></gloww-upload-file>\r\n\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"cancel()\">Close</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"save()\">Save</button>\r\n</mat-dialog-actions>\r\n", styles: ["ul{list-style:none;padding-left:0}ul li{padding-bottom:10px}\n"], components: [{ type: UploadFileComponent, selector: "gloww-upload-file", inputs: ["multiple", "allowAltFileName", "acceptMime"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
648
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UploadDocComponent, decorators: [{
649
+ type: Component,
650
+ args: [{ selector: 'gloww-upload-doc', template: "<h2 mat-dialog-title>\r\n Association d'un nouveau document</h2>\r\n\r\n<mat-dialog-content>\r\n\r\n <gloww-upload-file [(ngModel)]=\"files\" [acceptMime]=\"acceptMime\" [multiple]=\"multiple\" [allowAltFileName]=\"allowAltFileName\"></gloww-upload-file>\r\n\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"cancel()\">Close</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"save()\">Save</button>\r\n</mat-dialog-actions>\r\n", styles: ["ul{list-style:none;padding-left:0}ul li{padding-bottom:10px}\n"] }]
651
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
652
+ type: Inject,
653
+ args: [MAT_DIALOG_DATA]
654
+ }] }, { type: i1$3.FormBuilder }]; } });
655
+
656
+ class SearchFormComponent {
657
+ constructor() { }
658
+ ngOnInit() {
659
+ }
660
+ }
661
+ SearchFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SearchFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
662
+ SearchFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SearchFormComponent, selector: "glw-search-form", ngImport: i0, template: "<ng-content></ng-content>", styles: [""] });
663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SearchFormComponent, decorators: [{
664
+ type: Component,
665
+ args: [{ selector: 'glw-search-form', template: "<ng-content></ng-content>", styles: [""] }]
666
+ }], ctorParameters: function () { return []; } });
667
+
668
+ class HeaderComponent {
669
+ constructor() { }
670
+ ngOnInit() {
671
+ }
672
+ }
673
+ HeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
674
+ HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: HeaderComponent, selector: "glw-header", ngImport: i0, template: "<ng-content></ng-content>", styles: [""] });
675
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HeaderComponent, decorators: [{
676
+ type: Component,
677
+ args: [{ selector: 'glw-header', template: "<ng-content></ng-content>", styles: [""] }]
678
+ }], ctorParameters: function () { return []; } });
679
+
680
+ class ResultTableComponent {
681
+ constructor() { }
682
+ ngAfterContentInit() {
683
+ console.log(this.columnDefs.length);
684
+ }
685
+ ngOnInit() {
686
+ }
687
+ }
688
+ ResultTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ResultTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
689
+ ResultTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: ResultTableComponent, selector: "glw-result-table", queries: [{ propertyName: "columnDefs", predicate: MatColumnDef }], ngImport: i0, template: "<ng-content></ng-content>", styles: [""] });
690
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ResultTableComponent, decorators: [{
691
+ type: Component,
692
+ args: [{ selector: 'glw-result-table', template: "<ng-content></ng-content>", styles: [""] }]
693
+ }], ctorParameters: function () { return []; }, propDecorators: { columnDefs: [{
694
+ type: ContentChildren,
695
+ args: [MatColumnDef]
696
+ }] } });
697
+
698
+ class Oauthassociation {
699
+ toString() {
700
+ return this.provider;
701
+ }
702
+ }
703
+
704
+ class AuthenticationServiceConfig {
705
+ constructor() {
706
+ this.currentUserVariableName = 'currentuser';
707
+ this.authenticationUrl = `/admin/authusers/authenticate`;
708
+ this.changePasswordUrl = `/admin/authusers/changePassword`;
709
+ this.askResetPasswordCodeUrl = `/admin/authusers/askResetPasswordCode`;
710
+ this.resetPassworUrl = `/admin/authusers/resetPassword`;
711
+ this.environment = '__GlowwSecurity__';
712
+ this.showDomain = false;
713
+ this.askGSM = false;
714
+ this.googleClientId = '';
715
+ this.facebookClientId = '';
716
+ this.amazonClientId = '';
717
+ this.microsoftClientId = '';
718
+ }
719
+ }
720
+ AuthenticationServiceConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationServiceConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
721
+ AuthenticationServiceConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationServiceConfig, providedIn: 'root' });
722
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationServiceConfig, decorators: [{
723
+ type: Injectable,
724
+ args: [{ providedIn: 'root' }]
725
+ }] });
726
+
727
+ class AuthenticationService {
728
+ constructor(http, platformId, config) {
729
+ this.http = http;
730
+ this.platformId = platformId;
731
+ this.hasLocalStorage = false;
732
+ this.hasLocalStorage = isPlatformBrowser(this.platformId);
733
+ if (config && config.currentUserVariableName) {
734
+ this.currentUserVariableName = config.currentUserVariableName;
735
+ }
736
+ else {
737
+ this.currentUserVariableName = 'currentUser';
738
+ }
739
+ if (config && config.authenticationUrl) {
740
+ this.authenticationUrl = config.authenticationUrl;
741
+ }
742
+ else {
743
+ this.authenticationUrl = `/admin/authusers/authenticate`;
744
+ }
745
+ if (config && config.changePasswordUrl) {
746
+ this.changePasswordUrl = config.changePasswordUrl;
747
+ }
748
+ else {
749
+ this.changePasswordUrl = this.authenticationUrl.replace('authenticate', 'changePassword');
750
+ }
751
+ if (config && config.askResetPasswordCodeUrl) {
752
+ this.askResetPasswordCodeUrl = config.askResetPasswordCodeUrl;
753
+ }
754
+ else {
755
+ this.askResetPasswordCodeUrl = this.authenticationUrl.replace('authenticate', 'askResetPasswordCode');
756
+ }
757
+ if (config && config.resetPassworUrl) {
758
+ this.resetPasswordUrl = config.resetPassworUrl;
759
+ }
760
+ else {
761
+ this.resetPasswordUrl = this.authenticationUrl.replace('authenticate', 'resetPassword');
762
+ }
763
+ this.OAuthGetProvidersUrl = this.authenticationUrl.replace('authenticate', 'OAuthGetProviders');
764
+ this.OAuthAskCodeUrl = this.authenticationUrl.replace('authenticate', 'OAuthAskCode');
765
+ this.OAuthAssociationUrl = this.authenticationUrl.replace('authenticate', 'OAuthAssociation');
766
+ this.OAuthGetAssociationsUrl = this.authenticationUrl.replace('authenticate', 'OAuthGetAssociations');
767
+ this.OAuthDeleteAssociationUrl = this.authenticationUrl.replace('authenticate', 'OAuthDeleteAssociation');
768
+ if (config && config.environment) {
769
+ this.environment = config.environment;
770
+ }
771
+ if (config && config.showDomain) {
772
+ this.showdomain = config.showDomain;
773
+ }
774
+ if (this.hasLocalStorage) { // Angular Universal
775
+ this.currentUserSubject = new BehaviorSubject(JSON.parse(localStorage.getItem(this.currentUserVariableName)));
776
+ this.currentUser = this.currentUserSubject.asObservable();
777
+ }
778
+ }
779
+ get currentUserValue() {
780
+ if (!this.currentUserSubject) {
781
+ return null;
782
+ } // Angular Universsal
783
+ return this.currentUserSubject.value;
784
+ }
785
+ get isConnected() {
786
+ if (!this.currentUserSubject) {
787
+ return null;
788
+ } // Angular Universsal
789
+ return this.currentUserSubject.value !== null;
790
+ }
791
+ login(domain, username, password) {
792
+ const formData = new FormData();
793
+ if (this.showdomain) {
794
+ formData.set('domain', domain);
795
+ }
796
+ formData.set('environment', this.environment);
797
+ formData.set('username', username);
798
+ formData.set('password', password);
799
+ return this.http.post(this.authenticationUrl, formData, { observe: 'response' })
800
+ .pipe(map(resp => {
801
+ // store user details and jwt token in local storage to keep user logged in between page refreshes
802
+ const user = resp.body;
803
+ if (this.hasLocalStorage) {
804
+ localStorage.setItem(this.currentUserVariableName, JSON.stringify(user));
805
+ }
806
+ this.currentUserSubject.next(user);
807
+ return user;
808
+ }));
809
+ }
810
+ changePassword(domain, username, oldpassword, newpassword) {
811
+ const params = new HttpParams({
812
+ fromObject: {
813
+ domain: this.currentUserValue.domain ?? '',
814
+ username: this.currentUserValue.username,
815
+ newpassword,
816
+ oldpassword,
817
+ environment: this.environment
818
+ }
819
+ });
820
+ return this.http.get(this.changePasswordUrl, { params });
821
+ }
822
+ logout() {
823
+ // remove user from local storage to log user out
824
+ if (this.hasLocalStorage) {
825
+ localStorage.removeItem(this.currentUserVariableName);
826
+ }
827
+ this.currentUserSubject.next(null);
828
+ }
829
+ askResetPasswordCode(domain, firstname, lastname, email, gsm) {
830
+ const params = new HttpParams({
831
+ fromObject: {
832
+ domain: '',
833
+ firstname,
834
+ lastname,
835
+ email,
836
+ gsm,
837
+ environment: this.environment
838
+ }
839
+ });
840
+ return this.http.get(this.askResetPasswordCodeUrl, { params });
841
+ }
842
+ resetPassword(email, code, password) {
843
+ const params = new HttpParams({
844
+ fromObject: {
845
+ email,
846
+ code,
847
+ password,
848
+ environment: this.environment
849
+ }
850
+ });
851
+ return this.http.get(this.resetPasswordUrl, { params });
852
+ }
853
+ getOAuthProviders() {
854
+ return this.http.get(this.OAuthGetProvidersUrl);
855
+ }
856
+ OAuthAskCode(environment, login, idOauth, provider, name, value) {
857
+ const params = new HttpParams({
858
+ fromObject: {
859
+ environment,
860
+ login,
861
+ idOauth,
862
+ provider,
863
+ name,
864
+ value
865
+ }
866
+ });
867
+ return this.http.get(this.OAuthAskCodeUrl, { params });
868
+ }
869
+ OAuthAssociation(environment, code, idOauth, provider, name, value) {
870
+ const params = new HttpParams({
871
+ fromObject: {
872
+ environment,
873
+ code,
874
+ idOauth,
875
+ provider,
876
+ name,
877
+ value
878
+ }
879
+ });
880
+ return this.http.get(this.OAuthAssociationUrl, { params }).pipe(map(resp => {
881
+ // store user details and jwt token in local storage to keep user logged in between page refreshes
882
+ console.log("OAuthAuthentication");
883
+ console.log(resp);
884
+ const user = resp;
885
+ if (this.hasLocalStorage) {
886
+ localStorage.setItem(this.currentUserVariableName, JSON.stringify(user));
887
+ }
888
+ this.currentUserSubject.next(user);
889
+ return user;
890
+ }));
891
+ }
892
+ getOAuthAssociations() {
893
+ const params = new HttpParams({
894
+ fromObject: {
895
+ environment: this.environment
896
+ }
897
+ });
898
+ return this.http.get(this.OAuthGetAssociationsUrl, { params }).pipe(tap((value) => console.log(value)), map((value) => value.map(item => Object.assign(new Oauthassociation(), item))), tap((value) => console.log(value)));
899
+ }
900
+ OAuthDeleteAssociation(provider, idOAuth) {
901
+ const params = new HttpParams({
902
+ fromObject: {
903
+ environment: this.environment,
904
+ provider,
905
+ idOAuth
906
+ }
907
+ });
908
+ return this.http.get(this.OAuthDeleteAssociationUrl, { params });
909
+ }
910
+ }
911
+ AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationService, deps: [{ token: i1.HttpClient }, { token: PLATFORM_ID }, { token: AuthenticationServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
912
+ AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationService, providedIn: 'root' });
913
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationService, decorators: [{
914
+ type: Injectable,
915
+ args: [{ providedIn: 'root' }]
916
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
917
+ type: Inject,
918
+ args: [PLATFORM_ID]
919
+ }] }, { type: AuthenticationServiceConfig, decorators: [{
920
+ type: Optional
921
+ }] }]; } });
922
+
923
+ ;
924
+ class DisplayObjectsComponent {
925
+ constructor(changeDetectorRef, dialog, router, location, authenticationService, formBuilder, route) {
926
+ this.changeDetectorRef = changeDetectorRef;
927
+ this.dialog = dialog;
928
+ this.router = router;
929
+ this.location = location;
930
+ this.authenticationService = authenticationService;
931
+ this.formBuilder = formBuilder;
932
+ this.route = route;
933
+ this.canDisplayObj = false;
934
+ this.canEdit = true;
935
+ this.canDelete = true;
936
+ this.canAdd = true;
937
+ this.mandatoryParams = {};
938
+ this.actions = [];
939
+ this.dialogConfig = {};
940
+ this.columnsToDisplay = [];
941
+ this.displayform = true;
942
+ this.displayresult = false;
943
+ this.queryParams = {};
944
+ const component = this;
945
+ this.currentUser = this.authenticationService.currentUserValue.UserInfo;
946
+ this.form2 = this.formBuilder.group({
947
+ _MaxRow_: [null]
948
+ });
949
+ }
950
+ ngOnChanges(changes) {
951
+ }
952
+ ngAfterViewInit() {
953
+ if (!this.searchRequest) {
954
+ this.searchRequest = this.glowwService[`search${this.objectName}`];
955
+ }
956
+ if (!this.postRequest) {
957
+ this.postRequest = this.glowwService[`post${this.objectName}`];
958
+ }
959
+ if (!this.deleteRequest) {
960
+ this.deleteRequest = this.glowwService[`delete${this.objectName}`];
961
+ }
962
+ if (!this.putRequest) {
963
+ this.putRequest = this.glowwService[`put${this.objectName}`];
964
+ }
965
+ if (this.maxrows?.length > 0) {
966
+ this.form.addControl("_MaxRow_", new FormControl(null));
967
+ }
968
+ }
969
+ ngAfterContentInit() {
970
+ console.log(`INIT : fromLayout:${this.formLayout}-displayform:${this.displayform}`);
971
+ if (!this.formLayout && this.resultLayout) {
972
+ this.displayform = false;
973
+ this.displayresult = true;
974
+ }
975
+ this.glowwService.basePathChange.subscribe(newUrl => {
976
+ console.log(`basePathChange : fromLayout:${this.formLayout}-displayform:${this.displayform}`);
977
+ if (!this.formLayout && this.resultLayout) {
978
+ this.displayform = false;
979
+ this.displayresult = true;
980
+ }
981
+ if (!this.displayform) {
982
+ this.Search();
983
+ }
984
+ });
985
+ }
986
+ ngOnInit() {
987
+ }
988
+ Init(data) {
989
+ if ((data && Object.keys(data).length > 0) || this.displayresult) {
990
+ this.Search(data);
991
+ }
992
+ }
993
+ Search(data) {
994
+ this.data = data;
995
+ this.displayresult = true;
996
+ this.displayform = false;
997
+ this.resultException = null;
998
+ if (data) {
999
+ Object.keys(data).forEach(name => {
1000
+ this.queryParams[name] = data[name];
1001
+ });
1002
+ }
1003
+ Object.keys(this.route.snapshot.params).forEach(name => {
1004
+ this.queryParams[name] = this.route.snapshot.params[name];
1005
+ });
1006
+ if (this.mandatoryParams) {
1007
+ Object.keys(this.mandatoryParams).forEach(name => {
1008
+ this.queryParams[name] = this.queryParams[name];
1009
+ });
1010
+ }
1011
+ this.searchRequest.call(this.glowwService, this.queryParams).subscribe(r => {
1012
+ this.dataSource = new MatTableDataSource(r);
1013
+ this.changeDetectorRef.detectChanges();
1014
+ this.UpdateTable();
1015
+ }, error => {
1016
+ this.displayresult = false;
1017
+ this.displayform = true;
1018
+ this.resultException = error;
1019
+ });
1020
+ }
1021
+ clean(obj) {
1022
+ for (const propName in obj) {
1023
+ if (obj[propName] === null || obj[propName] === undefined) {
1024
+ delete obj[propName];
1025
+ }
1026
+ }
1027
+ }
1028
+ onSearch() {
1029
+ this.queryParams = {};
1030
+ Object.keys(this.form.value).forEach(name => {
1031
+ const val = this.form.value[name];
1032
+ if (val) {
1033
+ if (val.constructor.name === 'Moment') {
1034
+ this.queryParams[name] = val.toISOString();
1035
+ }
1036
+ else {
1037
+ this.queryParams[name] = val;
1038
+ }
1039
+ }
1040
+ });
1041
+ if (this.form2.value._MaxRow_) {
1042
+ this.queryParams._MaxRow_ = this.form2.value._MaxRow_;
1043
+ }
1044
+ this.clean(this.queryParams);
1045
+ const params = new HttpParams({ fromObject: this.queryParams });
1046
+ const currentstate = this.location.getState();
1047
+ this.location.replaceState(this.router.url, params.toString());
1048
+ this.Search();
1049
+ }
1050
+ UpdateDataSource(r) {
1051
+ this.dataSource = new MatTableDataSource(r);
1052
+ this.changeDetectorRef.detectChanges();
1053
+ this.UpdateTable();
1054
+ }
1055
+ UpdateTable() {
1056
+ if (this.dataSource) {
1057
+ if (!this.table) {
1058
+ console.log('!this.table');
1059
+ return;
1060
+ }
1061
+ this.resultLayout.columnDefs.forEach(columnDef => this.table.addColumnDef(columnDef));
1062
+ this.dataSource.paginator = this.paginator;
1063
+ this.dataSource.sort = this.sort;
1064
+ this.columnsToDisplay = this.columns();
1065
+ }
1066
+ }
1067
+ canDisplayObjThis(obj, action) {
1068
+ try {
1069
+ if (!this.displayObjLink) {
1070
+ return false;
1071
+ }
1072
+ if (typeof this.canDisplayObj === 'boolean') {
1073
+ return this.canDisplayObj;
1074
+ }
1075
+ return this.canDisplayObj(this.currentUser, obj, action);
1076
+ }
1077
+ catch (ex) {
1078
+ console.log(ex);
1079
+ return true;
1080
+ }
1081
+ }
1082
+ canAddThis() {
1083
+ try {
1084
+ if (!this.canAdd) {
1085
+ return false;
1086
+ }
1087
+ if (typeof this.canAdd === 'boolean') {
1088
+ return this.canAdd;
1089
+ }
1090
+ return this.canAdd(this.currentUser);
1091
+ }
1092
+ catch (ex) {
1093
+ console.log(ex);
1094
+ return true;
1095
+ }
1096
+ }
1097
+ canEditThis(obj) {
1098
+ try {
1099
+ if (!this.canEdit) {
1100
+ return false;
1101
+ }
1102
+ if (typeof this.canEdit === 'boolean') {
1103
+ return this.canEdit;
1104
+ }
1105
+ return this.canEdit(this.currentUser, obj);
1106
+ }
1107
+ catch (ex) {
1108
+ console.log(ex);
1109
+ return true;
1110
+ }
1111
+ }
1112
+ canDeleteThis(obj) {
1113
+ try {
1114
+ if (!this.canDelete) {
1115
+ return false;
1116
+ }
1117
+ if (typeof this.canDelete === 'boolean') {
1118
+ return this.canDelete;
1119
+ }
1120
+ return this.canDelete(this.currentUser, obj);
1121
+ }
1122
+ catch (ex) {
1123
+ console.log(ex);
1124
+ return false;
1125
+ }
1126
+ }
1127
+ displayObjLinkThis(obj, action) {
1128
+ if (!this.displayObjLink) {
1129
+ return null;
1130
+ }
1131
+ return this.displayObjLink(obj, action);
1132
+ }
1133
+ isString(value) {
1134
+ return typeof value === 'string' || value instanceof String;
1135
+ }
1136
+ getPrimaryKey(obj) {
1137
+ let res = [];
1138
+ if (this.isString(this.primaryKey)) {
1139
+ console.log("string");
1140
+ res.push(obj[this.primaryKey]);
1141
+ }
1142
+ else {
1143
+ console.log("string[]");
1144
+ this.primaryKey.forEach(key => res.push(obj[key]));
1145
+ }
1146
+ return res;
1147
+ }
1148
+ _saveObj(obj) {
1149
+ var subject = new Subject();
1150
+ this.postRequest.call(this.glowwService, obj).subscribe(data => {
1151
+ const tmp = this.dataSource.data;
1152
+ tmp.push(data);
1153
+ this.dataSource.data = tmp;
1154
+ subject.next(data);
1155
+ }, error => {
1156
+ alert(`Unable to add Object ${error.status} ${error.statusText}\n${error.Message}\n${error.error}`);
1157
+ subject.error(error);
1158
+ });
1159
+ return subject;
1160
+ }
1161
+ _saveFile(fileField, obj, file) {
1162
+ const formData = new FormData();
1163
+ formData.append('file', file.data);
1164
+ return this.glowwService[`post${this.objectName}${fileField}`].call(this.glowwService, this.getPrimaryKey(obj), formData).pipe(tap((event) => {
1165
+ switch (event.type) {
1166
+ case HttpEventType.UploadProgress:
1167
+ file.progress = Math.round(event.loaded * 100 / (event.total ?? 1));
1168
+ file.inProgress = file.progress !== 100;
1169
+ break;
1170
+ case HttpEventType.Response:
1171
+ file.progress = 100;
1172
+ file.status = "Done";
1173
+ file.inProgress = false;
1174
+ break;
1175
+ }
1176
+ }), filter((event) => {
1177
+ console.log(`filter ${event.type}`);
1178
+ return event.type === HttpEventType.Response;
1179
+ }), map((event) => {
1180
+ console.log(`map ${event.type}`);
1181
+ return event.body;
1182
+ }), catchError((error) => {
1183
+ file.inProgress = false;
1184
+ file.status = "Error";
1185
+ console.log(`${file.data.name} upload failed.`);
1186
+ //subject.error(error);
1187
+ return of(`${file.data.name} upload failed.`);
1188
+ }));
1189
+ }
1190
+ AddObj() {
1191
+ const dialogConfig = new MatDialogConfig();
1192
+ dialogConfig.disableClose = true;
1193
+ dialogConfig.autoFocus = true;
1194
+ dialogConfig.closeOnNavigation = false;
1195
+ if (this.dialogConfig) {
1196
+ Object.keys(this.dialogConfig).forEach(name => {
1197
+ dialogConfig[name] = this.dialogConfig[name];
1198
+ });
1199
+ }
1200
+ let args = {};
1201
+ Object.keys(this.route.snapshot?.params).forEach(key => {
1202
+ args[key] = this.route.snapshot?.params[key];
1203
+ dialogConfig.data = args;
1204
+ });
1205
+ const dlg = this.dialog.open(this.Editor, dialogConfig);
1206
+ dlg.componentInstance.callback = (data => {
1207
+ let datacopy = { ...data };
1208
+ const fileFields = this.Editor.fileFields;
1209
+ if (fileFields?.length == 1) {
1210
+ // Un seul champ, il peut être multiple
1211
+ const fileField = fileFields[0];
1212
+ const files = datacopy[fileField];
1213
+ delete datacopy[fileField];
1214
+ const allobs = {};
1215
+ files.forEach(file => {
1216
+ if (file.statut !== 'Done' && file.statut !== 'Error') {
1217
+ const obs = this._saveObj(datacopy).pipe(switchMap(newdata => this._saveFile(fileField, newdata, file)));
1218
+ allobs[file.name] = obs;
1219
+ }
1220
+ });
1221
+ return combineLatest(allobs).pipe(take(1));
1222
+ }
1223
+ else if (fileFields?.length > 1) {
1224
+ // Plusieurs champs file, il ne peut y avoir qu'une seul fichier par champ.
1225
+ const fields = {};
1226
+ fileFields.forEach(ff => {
1227
+ fields[ff] = datacopy[ff];
1228
+ delete datacopy[ff];
1229
+ return this._saveObj(datacopy).pipe(mergeMap(newdata => {
1230
+ var allobs = [];
1231
+ Object.entries(fields).forEach(([fileField, files]) => {
1232
+ if (files.length > 0) {
1233
+ allobs.push(this._saveFile(fileField, newdata, files[0]));
1234
+ }
1235
+ });
1236
+ return forkJoin(allobs); // TODO : PAS TERMINE... JAMAIS UTILISE...
1237
+ }));
1238
+ });
1239
+ }
1240
+ else {
1241
+ // Form sans fichier
1242
+ return this._saveObj(data);
1243
+ }
1244
+ });
1245
+ }
1246
+ DeleteObj(obj) {
1247
+ if (confirm('Are you sure you want to delete this objet ? ')) {
1248
+ this.deleteRequest.apply(this.glowwService, this.getPrimaryKey(obj)).subscribe(p => {
1249
+ const i = this.dataSource.data.indexOf(obj);
1250
+ const tmp = this.dataSource.data;
1251
+ tmp.splice(i, 1);
1252
+ this.dataSource.data = tmp;
1253
+ }, error => {
1254
+ alert(`Unable to delete Object ${error.status} ${error.statusText}\n${error.Message}\n${error.error}`);
1255
+ });
1256
+ }
1257
+ }
1258
+ _updateObj(current, newData) {
1259
+ let args = this.getPrimaryKey(current);
1260
+ args.push(newData);
1261
+ var subject = new Subject();
1262
+ this.putRequest.apply(this.glowwService, args).subscribe(data => {
1263
+ const i = this.dataSource.data.indexOf(current);
1264
+ const tmp = this.dataSource.data;
1265
+ tmp[i] = data;
1266
+ this.dataSource.data = tmp;
1267
+ subject.next(data);
1268
+ }, error => {
1269
+ alert(`Unable to update Object ${error.status} ${error.statusText}\n${error.Message}\n${error.error}`);
1270
+ subject.error(error);
1271
+ });
1272
+ return subject;
1273
+ }
1274
+ EditObj(obj) {
1275
+ const dialogConfig = new MatDialogConfig();
1276
+ dialogConfig.disableClose = true;
1277
+ dialogConfig.autoFocus = true;
1278
+ dialogConfig.closeOnNavigation = false;
1279
+ if (this.dialogConfig) {
1280
+ Object.keys(this.dialogConfig).forEach(name => {
1281
+ dialogConfig[name] = this.dialogConfig[name];
1282
+ });
1283
+ }
1284
+ dialogConfig.data = obj;
1285
+ const dlg = this.dialog.open(this.Editor, dialogConfig);
1286
+ dlg.componentInstance.callback = (data => {
1287
+ let datacopy = { ...data };
1288
+ const fileFields = this.Editor.fileFields;
1289
+ if (fileFields?.length == 1) {
1290
+ // Un seul champ, il peut être multiple
1291
+ const fileField = fileFields[0];
1292
+ const files = datacopy[fileField];
1293
+ delete datacopy[fileField];
1294
+ const allobs = {};
1295
+ files.forEach(file => {
1296
+ if (file.statut !== 'Done' && file.statut !== 'Error') {
1297
+ const obs = this._updateObj(obj, datacopy).pipe(switchMap(newdata => this._saveFile(fileField, newdata, file)));
1298
+ allobs[file.name] = obs;
1299
+ }
1300
+ });
1301
+ return combineLatest(allobs).pipe(take(1));
1302
+ }
1303
+ else if (fileFields?.length > 1) {
1304
+ // Plusieurs champs file, il ne peut y avoir qu'une seul fichier par champ.
1305
+ const fields = {};
1306
+ fileFields.forEach(ff => {
1307
+ fields[ff] = datacopy[ff];
1308
+ delete datacopy[ff];
1309
+ return this._updateObj(obj, datacopy).pipe(mergeMap(newdata => {
1310
+ var allobs = [];
1311
+ Object.entries(fields).forEach(([fileField, files]) => {
1312
+ if (files.length > 0) {
1313
+ allobs.push(this._saveFile(fileField, newdata, files[0]));
1314
+ }
1315
+ });
1316
+ return forkJoin(allobs); // TODO : PAS TERMINE... JAMAIS UTILISE...
1317
+ }));
1318
+ });
1319
+ }
1320
+ else {
1321
+ // Form sans fichier
1322
+ return this._updateObj(obj, data);
1323
+ }
1324
+ });
1325
+ }
1326
+ }
1327
+ DisplayObjectsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DisplayObjectsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.MatDialog }, { token: i2.Router }, { token: i3.Location }, { token: AuthenticationService }, { token: i1$3.FormBuilder }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
1328
+ DisplayObjectsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DisplayObjectsComponent, selector: "glw-display-objects", inputs: { configuration: "configuration", displayObjLink: "displayObjLink", canDisplayObj: "canDisplayObj", canEdit: "canEdit", canDelete: "canDelete", canAdd: "canAdd", form: "form", Editor: "Editor", searchRequest: "searchRequest", postRequest: "postRequest", deleteRequest: "deleteRequest", putRequest: "putRequest", columns: "columns", glowwService: "glowwService", objectName: "objectName", primaryKey: "primaryKey", maxrows: "maxrows", mandatoryParams: "mandatoryParams", actions: "actions", dialogConfig: "dialogConfig", fileFields: "fileFields" }, queries: [{ propertyName: "header", first: true, predicate: HeaderComponent, descendants: true }, { propertyName: "formLayout", first: true, predicate: SearchFormComponent, descendants: true }, { propertyName: "resultLayout", first: true, predicate: ResultTableComponent, descendants: true }], viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div>\r\n <ng-content select=\"glw-header\"></ng-content>\r\n</div>\r\n\r\n<div *ngIf=\"displayform\">\r\n <mat-card>\r\n <mat-card-content>\r\n <mat-error *ngIf=\"resultException\">\r\n Unable to query : {{resultException}}\r\n </mat-error>\r\n <ng-content select=\"glw-search-form\"></ng-content>\r\n <div *ngIf=\"maxrows\" [formGroup]=\"form2\">\r\n <br />\r\n <mat-form-field>\r\n <mat-select placeholder=\"MaxRow\" formControlName=\"_MaxRow_\">\r\n <mat-option *ngFor=\"let maxrow of maxrows\" [value]=\"maxrow\">\r\n <span *ngIf=\"maxrow\">{{maxrow}} objects</span>\r\n <span *ngIf=\"!maxrow\"> Default</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-stroked-button color=\"accent\" (click)=\"onSearch()\">\r\n <mat-icon>search</mat-icon>\r\n Search\r\n </button>\r\n </mat-card-actions>\r\n </mat-card>\r\n</div>\r\n\r\n<div *ngIf=\"displayresult\">\r\n <div class=\"mat-elevation-z8\" *ngIf=\"dataSource; else Spinner\">\r\n <table mat-table [dataSource]=\"dataSource\" matSort>\r\n <ng-container matColumnDef=\"action\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <i class=\"fal fa-plus\" (click)=\"AddObj()\" *ngIf=\"canAddThis()\">\r\n </i>\r\n </th>\r\n <td mat-cell *matCellDef=\"let obj\">\r\n <i class=\"fal fa-eye\" [routerLink]=\"displayObjLinkThis(obj)\" *ngIf=\"canDisplayObjThis(obj)\">\r\n </i>\r\n <ng-container *ngFor=\"let action of actions\">\r\n <i [ngClass]=\"action.icon\" [routerLink]=\"action.routerLinkFct(obj)\" *ngIf=\"action.icon.icon && (!action.display || action.display(obj, action.name))\">\r\n </i>\r\n <i [ngClass]=\"action.icon\" [routerLink]=\"action.routerLinkFct(obj)\" *ngIf=\"!action.icon.icon && (!action.display || action.display(obj, action.name))\"></i>\r\n </ng-container>\r\n <i class=\"fal fa-trash-alt\" (click)=\"DeleteObj(obj)\" *ngIf=\"canDeleteThis(obj)\">\r\n </i>\r\n <i class=\"fal fa-pencil\" (click)=\"EditObj(obj)\" *ngIf=\"canEditThis(obj)\">\r\n </i>\r\n </td>\r\n </ng-container>\r\n <ng-content select=\"glw-result-table\"></ng-content>\r\n <tr mat-header-row *matHeaderRowDef=\"columnsToDisplay\"></tr>\r\n <tr mat-row *matRowDef=\"let myRowData; columns: columnsToDisplay\"></tr>\r\n </table>\r\n <mat-paginator pageSize=\"10\"></mat-paginator>\r\n </div>\r\n <ng-template #Spinner>\r\n <mat-spinner></mat-spinner>\r\n </ng-template>\r\n</div>\r\n", styles: ["table{width:100%}i{cursor:pointer;padding:5px}\n"], components: [{ type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i8.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i9.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i11.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i12.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i12.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i12.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: i13.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { type: i14.MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i7.MatError, selector: "mat-error", inputs: ["id"] }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i15.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i12.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i12.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i12.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i12.MatCellDef, selector: "[matCellDef]" }, { type: i12.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i2.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i12.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i12.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }] });
1329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DisplayObjectsComponent, decorators: [{
1330
+ type: Component,
1331
+ args: [{ selector: 'glw-display-objects', template: "<div>\r\n <ng-content select=\"glw-header\"></ng-content>\r\n</div>\r\n\r\n<div *ngIf=\"displayform\">\r\n <mat-card>\r\n <mat-card-content>\r\n <mat-error *ngIf=\"resultException\">\r\n Unable to query : {{resultException}}\r\n </mat-error>\r\n <ng-content select=\"glw-search-form\"></ng-content>\r\n <div *ngIf=\"maxrows\" [formGroup]=\"form2\">\r\n <br />\r\n <mat-form-field>\r\n <mat-select placeholder=\"MaxRow\" formControlName=\"_MaxRow_\">\r\n <mat-option *ngFor=\"let maxrow of maxrows\" [value]=\"maxrow\">\r\n <span *ngIf=\"maxrow\">{{maxrow}} objects</span>\r\n <span *ngIf=\"!maxrow\"> Default</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-stroked-button color=\"accent\" (click)=\"onSearch()\">\r\n <mat-icon>search</mat-icon>\r\n Search\r\n </button>\r\n </mat-card-actions>\r\n </mat-card>\r\n</div>\r\n\r\n<div *ngIf=\"displayresult\">\r\n <div class=\"mat-elevation-z8\" *ngIf=\"dataSource; else Spinner\">\r\n <table mat-table [dataSource]=\"dataSource\" matSort>\r\n <ng-container matColumnDef=\"action\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <i class=\"fal fa-plus\" (click)=\"AddObj()\" *ngIf=\"canAddThis()\">\r\n </i>\r\n </th>\r\n <td mat-cell *matCellDef=\"let obj\">\r\n <i class=\"fal fa-eye\" [routerLink]=\"displayObjLinkThis(obj)\" *ngIf=\"canDisplayObjThis(obj)\">\r\n </i>\r\n <ng-container *ngFor=\"let action of actions\">\r\n <i [ngClass]=\"action.icon\" [routerLink]=\"action.routerLinkFct(obj)\" *ngIf=\"action.icon.icon && (!action.display || action.display(obj, action.name))\">\r\n </i>\r\n <i [ngClass]=\"action.icon\" [routerLink]=\"action.routerLinkFct(obj)\" *ngIf=\"!action.icon.icon && (!action.display || action.display(obj, action.name))\"></i>\r\n </ng-container>\r\n <i class=\"fal fa-trash-alt\" (click)=\"DeleteObj(obj)\" *ngIf=\"canDeleteThis(obj)\">\r\n </i>\r\n <i class=\"fal fa-pencil\" (click)=\"EditObj(obj)\" *ngIf=\"canEditThis(obj)\">\r\n </i>\r\n </td>\r\n </ng-container>\r\n <ng-content select=\"glw-result-table\"></ng-content>\r\n <tr mat-header-row *matHeaderRowDef=\"columnsToDisplay\"></tr>\r\n <tr mat-row *matRowDef=\"let myRowData; columns: columnsToDisplay\"></tr>\r\n </table>\r\n <mat-paginator pageSize=\"10\"></mat-paginator>\r\n </div>\r\n <ng-template #Spinner>\r\n <mat-spinner></mat-spinner>\r\n </ng-template>\r\n</div>\r\n", styles: ["table{width:100%}i{cursor:pointer;padding:5px}\n"] }]
1332
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$2.MatDialog }, { type: i2.Router }, { type: i3.Location }, { type: AuthenticationService }, { type: i1$3.FormBuilder }, { type: i2.ActivatedRoute }]; }, propDecorators: { header: [{
1333
+ type: ContentChild,
1334
+ args: [HeaderComponent]
1335
+ }], formLayout: [{
1336
+ type: ContentChild,
1337
+ args: [SearchFormComponent]
1338
+ }], resultLayout: [{
1339
+ type: ContentChild,
1340
+ args: [ResultTableComponent]
1341
+ }], table: [{
1342
+ type: ViewChild,
1343
+ args: [MatTable, { static: false }]
1344
+ }], paginator: [{
1345
+ type: ViewChild,
1346
+ args: [MatPaginator, { static: false }]
1347
+ }], sort: [{
1348
+ type: ViewChild,
1349
+ args: [MatSort, { static: false }]
1350
+ }], configuration: [{
1351
+ type: Input
1352
+ }], displayObjLink: [{
1353
+ type: Input
1354
+ }], canDisplayObj: [{
1355
+ type: Input
1356
+ }], canEdit: [{
1357
+ type: Input
1358
+ }], canDelete: [{
1359
+ type: Input
1360
+ }], canAdd: [{
1361
+ type: Input
1362
+ }], form: [{
1363
+ type: Input
1364
+ }], Editor: [{
1365
+ type: Input
1366
+ }], searchRequest: [{
1367
+ type: Input
1368
+ }], postRequest: [{
1369
+ type: Input
1370
+ }], deleteRequest: [{
1371
+ type: Input
1372
+ }], putRequest: [{
1373
+ type: Input
1374
+ }], columns: [{
1375
+ type: Input
1376
+ }], glowwService: [{
1377
+ type: Input
1378
+ }], objectName: [{
1379
+ type: Input
1380
+ }], primaryKey: [{
1381
+ type: Input
1382
+ }], maxrows: [{
1383
+ type: Input
1384
+ }], mandatoryParams: [{
1385
+ type: Input
1386
+ }], actions: [{
1387
+ type: Input
1388
+ }], dialogConfig: [{
1389
+ type: Input
1390
+ }], fileFields: [{
1391
+ type: Input
1392
+ }] } });
1393
+
1394
+ class PromptComponent {
1395
+ constructor(dialogRef, data, formBuilder) {
1396
+ this.dialogRef = dialogRef;
1397
+ this.data = data;
1398
+ this.formBuilder = formBuilder;
1399
+ // Update view with given values
1400
+ this.title = data.title;
1401
+ this.message = data.message;
1402
+ this.form = this.formBuilder.group({
1403
+ prompt: [data.initialValue, data.required ? Validators.required : null],
1404
+ });
1405
+ }
1406
+ ngOnInit() {
1407
+ }
1408
+ onCancel() {
1409
+ // Close the dialog, return true
1410
+ this.dialogRef.close(false);
1411
+ }
1412
+ onOK() {
1413
+ // Close the dialog, return false
1414
+ this.dialogRef.close(this.form.value.prompt);
1415
+ }
1416
+ }
1417
+ PromptComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PromptComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i1$3.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
1418
+ PromptComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: PromptComponent, selector: "gloww-prompt", ngImport: i0, template: "<h1 mat-dialog-title>\r\n {{title}}\r\n</h1>\r\n\r\n<div mat-dialog-content [formGroup]=\"form\">\r\n <p [innerHTML]=\"message | safeHtml\"></p>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Prompt\" formControlName=\"prompt\" style=\"width: calc(100% - 32px);\">\r\n </mat-form-field>\r\n</div>\r\n\r\n<mat-dialog-actions>\r\n <button mat-button (click)=\"onCancel()\">Cancel</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"onOK()\">Yes</button>\r\n</mat-dialog-actions>\r\n", styles: [""], components: [{ type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], pipes: { "safeHtml": SafeHtmlPipe } });
1419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PromptComponent, decorators: [{
1420
+ type: Component,
1421
+ args: [{ selector: 'gloww-prompt', template: "<h1 mat-dialog-title>\r\n {{title}}\r\n</h1>\r\n\r\n<div mat-dialog-content [formGroup]=\"form\">\r\n <p [innerHTML]=\"message | safeHtml\"></p>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Prompt\" formControlName=\"prompt\" style=\"width: calc(100% - 32px);\">\r\n </mat-form-field>\r\n</div>\r\n\r\n<mat-dialog-actions>\r\n <button mat-button (click)=\"onCancel()\">Cancel</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"onOK()\">Yes</button>\r\n</mat-dialog-actions>\r\n", styles: [""] }]
1422
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: PromptModel, decorators: [{
1423
+ type: Inject,
1424
+ args: [MAT_DIALOG_DATA]
1425
+ }] }, { type: i1$3.FormBuilder }]; } });
1426
+ // tslint:disable-next-line: max-classes-per-file
1427
+ class PromptModel {
1428
+ constructor(title, message, initialValue, required) {
1429
+ this.title = title;
1430
+ this.message = message;
1431
+ this.initialValue = initialValue;
1432
+ this.required = required;
1433
+ }
1434
+ }
1435
+
1436
+ function retryWithDelay(delay$1, count = 1) {
1437
+ return (input) => input.pipe(retryWhen((errors) => errors.pipe(scan((acc, error) => ({ count: acc.count + 1, error }), {
1438
+ count: 0,
1439
+ error: undefined,
1440
+ }), tap((current) => {
1441
+ if (current.count > count) {
1442
+ throw current.error;
1443
+ }
1444
+ }), delay(delay$1))));
1445
+ }
1446
+
1447
+ class SecurePipe {
1448
+ constructor(http, domSanitizer) {
1449
+ this.http = http;
1450
+ this.domSanitizer = domSanitizer;
1451
+ }
1452
+ transform(url, delayVal, retryVal) {
1453
+ if (!delayVal) {
1454
+ delayVal = 5000;
1455
+ }
1456
+ if (!retryVal) {
1457
+ retryVal = 0;
1458
+ }
1459
+ return this.http
1460
+ // load the image as a blob
1461
+ .get(url, { responseType: 'blob' })
1462
+ // create an object url of that blob that we can use in the src attribute
1463
+ .pipe(map(e => this.domSanitizer.bypassSecurityTrustUrl(URL.createObjectURL(e))), retryWithDelay(delayVal, retryVal));
1464
+ }
1465
+ }
1466
+ SecurePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecurePipe, deps: [{ token: i1.HttpClient }, { token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1467
+ SecurePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecurePipe, name: "secure" });
1468
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecurePipe, decorators: [{
1469
+ type: Pipe,
1470
+ args: [{
1471
+ name: 'secure'
1472
+ }]
1473
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i1$1.DomSanitizer }]; } });
1474
+
1475
+ class MenuListItemComponent {
1476
+ constructor(navService, router) {
1477
+ this.navService = navService;
1478
+ this.router = router;
1479
+ this._expanded = false;
1480
+ this.ariaExpanded = this.expanded;
1481
+ if (this.depth === undefined) {
1482
+ this.depth = 0;
1483
+ }
1484
+ }
1485
+ get expanded() {
1486
+ return this._expanded;
1487
+ }
1488
+ set expanded(value) {
1489
+ console.log("change expanded");
1490
+ this._expanded = value;
1491
+ }
1492
+ ngOnInit() {
1493
+ /*
1494
+ this.navService.currentUrl.subscribe((url: string) => {
1495
+ let route = this.item.route as string;
1496
+ if (typeof this.item.route === 'function') {
1497
+ const routefct: () => (string | string[]) = this.item.route;
1498
+ route = routefct.call(this);
1499
+ }
1500
+
1501
+
1502
+ if (this.item.route && url) {
1503
+ // console.log(`Checking '/${this.item.route}' against '${url}'`);
1504
+ //this.expanded = url.indexOf(`/${route}`) === 0;
1505
+ //this.ariaExpanded = this.expanded;
1506
+ // console.log(`${this.item.route} is expanded: ${this.expanded}`);
1507
+ }
1508
+ });
1509
+ */
1510
+ }
1511
+ onItemSelected(item) {
1512
+ /*if (!item.children || !item.children.length) {
1513
+ if (typeof item.route === 'function') {
1514
+ const routefct: () => string = item.route;
1515
+ this.router.navigate([routefct.call(this)]);
1516
+ } else {
1517
+ const route: string = item.route;
1518
+ this.router.navigate([route]);
1519
+ }
1520
+ this.navService.closeNav();
1521
+ }*/
1522
+ if (item.children && item.children.length) {
1523
+ this.expanded = !this.expanded;
1524
+ }
1525
+ }
1526
+ isActive(item) {
1527
+ let route = this.item.route;
1528
+ if (typeof this.item.route === 'function') {
1529
+ const routefct = this.item.route;
1530
+ route = routefct.call(this);
1531
+ return route ? this.router.isActive(route, true) : false;
1532
+ }
1533
+ }
1534
+ routerLink(item) {
1535
+ let route = this.item.route;
1536
+ if (typeof this.item.route === 'function') {
1537
+ const routefct = this.item.route;
1538
+ route = routefct.call(this);
1539
+ }
1540
+ return route;
1541
+ }
1542
+ }
1543
+ MenuListItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MenuListItemComponent, deps: [{ token: NavService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component });
1544
+ MenuListItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: MenuListItemComponent, selector: "gloww-menu-list-item", inputs: { item: "item", depth: "depth" }, host: { properties: { "attr.aria-expanded": "this.ariaExpanded" } }, ngImport: i0, template: "<div class=\"thisMenu\" (click)=\"onItemSelected(item)\">\r\n <a mat-list-item [ngStyle]=\"{'padding-left': (depth * 12) + 'px'}\" [routerLink]=\"routerLink(item)\" [ngClass]=\"{'active': isActive(item), 'expanded': expanded}\" class=\"menu-list-item\">\r\n <mat-icon class=\"routeIcon\"><i [ngClass]=\"item.icon\" [ngStyle]=\"item.iconStyle\"></i></mat-icon> {{item.displayName}}\r\n </a>\r\n <span fxFlex *ngIf=\"item.children && item.children.length\">\r\n <span fxFlex></span>\r\n <mat-icon [@indicatorRotate]=\"expanded ? 'expanded': 'collapsed'\" class=\"expandIcon\">\r\n expand_more\r\n </mat-icon>\r\n </span>\r\n</div>\r\n<div *ngIf=\"expanded\">\r\n <gloww-menu-list-item *ngFor=\"let child of item.children\" [item]=\"child\" [depth]=\"depth+1\">\r\n </gloww-menu-list-item>\r\n</div>\r\n", styles: [".thisMenu{display:flex;flex-direction:row;justify-content:space-between;align-items:center;outline:none;width:calc(100% - 20px);margin:10px}.thisMenu .mat-list-item.active{background-color:#e8eaf6}.thisMenu:hover>.mat-list-item:not(.expanded),.thisMenu:focus>.mat-list-item:not(.expanded){background-color:#c5cae9!important}.mat-list-item{padding:8px 0;display:flex;width:auto}.mat-list-item .routeIcon{margin-right:40px}.routeIcon{margin-right:20px}.expandIcon{cursor:pointer}\n"], components: [{ type: i11.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: MenuListItemComponent, selector: "gloww-menu-list-item", inputs: ["item", "depth"] }], directives: [{ type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], animations: [
1545
+ trigger('indicatorRotate', [
1546
+ state('collapsed', style({ transform: 'rotate(0deg)' })),
1547
+ state('expanded', style({ transform: 'rotate(180deg)' })),
1548
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
1549
+ ])
1550
+ ] });
1551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MenuListItemComponent, decorators: [{
1552
+ type: Component,
1553
+ args: [{ selector: 'gloww-menu-list-item', animations: [
1554
+ trigger('indicatorRotate', [
1555
+ state('collapsed', style({ transform: 'rotate(0deg)' })),
1556
+ state('expanded', style({ transform: 'rotate(180deg)' })),
1557
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
1558
+ ])
1559
+ ], template: "<div class=\"thisMenu\" (click)=\"onItemSelected(item)\">\r\n <a mat-list-item [ngStyle]=\"{'padding-left': (depth * 12) + 'px'}\" [routerLink]=\"routerLink(item)\" [ngClass]=\"{'active': isActive(item), 'expanded': expanded}\" class=\"menu-list-item\">\r\n <mat-icon class=\"routeIcon\"><i [ngClass]=\"item.icon\" [ngStyle]=\"item.iconStyle\"></i></mat-icon> {{item.displayName}}\r\n </a>\r\n <span fxFlex *ngIf=\"item.children && item.children.length\">\r\n <span fxFlex></span>\r\n <mat-icon [@indicatorRotate]=\"expanded ? 'expanded': 'collapsed'\" class=\"expandIcon\">\r\n expand_more\r\n </mat-icon>\r\n </span>\r\n</div>\r\n<div *ngIf=\"expanded\">\r\n <gloww-menu-list-item *ngFor=\"let child of item.children\" [item]=\"child\" [depth]=\"depth+1\">\r\n </gloww-menu-list-item>\r\n</div>\r\n", styles: [".thisMenu{display:flex;flex-direction:row;justify-content:space-between;align-items:center;outline:none;width:calc(100% - 20px);margin:10px}.thisMenu .mat-list-item.active{background-color:#e8eaf6}.thisMenu:hover>.mat-list-item:not(.expanded),.thisMenu:focus>.mat-list-item:not(.expanded){background-color:#c5cae9!important}.mat-list-item{padding:8px 0;display:flex;width:auto}.mat-list-item .routeIcon{margin-right:40px}.routeIcon{margin-right:20px}.expandIcon{cursor:pointer}\n"] }]
1560
+ }], ctorParameters: function () { return [{ type: NavService }, { type: i2.Router }]; }, propDecorators: { ariaExpanded: [{
1561
+ type: HostBinding,
1562
+ args: ['attr.aria-expanded']
1563
+ }], item: [{
1564
+ type: Input
1565
+ }], depth: [{
1566
+ type: Input
1567
+ }] } });
1568
+
1569
+ class CodeEditorComponent {
1570
+ constructor() {
1571
+ this._value = null;
1572
+ this.onChange = () => { };
1573
+ this.onTouched = () => { };
1574
+ }
1575
+ get value() {
1576
+ return this._value;
1577
+ }
1578
+ set value(val) {
1579
+ this._value = val;
1580
+ this.onChange(val);
1581
+ this.onTouched();
1582
+ }
1583
+ writeValue(obj) {
1584
+ if (typeof (obj) === 'object') {
1585
+ this.value = JSON.stringify(obj);
1586
+ }
1587
+ else {
1588
+ this.value = obj;
1589
+ }
1590
+ }
1591
+ registerOnChange(fn) {
1592
+ this.onChange = fn;
1593
+ }
1594
+ registerOnTouched(fn) {
1595
+ this.onTouched = fn;
1596
+ }
1597
+ setDisabledState(isDisabled) {
1598
+ //throw new Error('Method not implemented.');
1599
+ }
1600
+ }
1601
+ CodeEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CodeEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1602
+ CodeEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: CodeEditorComponent, selector: "gloww-code-editor", inputs: { _value: ["value", "_value"] }, providers: [
1603
+ {
1604
+ provide: NG_VALUE_ACCESSOR,
1605
+ multi: true,
1606
+ useExisting: CodeEditorComponent
1607
+ }
1608
+ ], ngImport: i0, template: "<ngx-codemirror [(ngModel)]=\"value\" [options]=\"{lineNumbers: true,theme: 'eclipse', indentWithTabs:true,indentUnit: 4,matchBrackets: true, mode: 'text/typescript', fixedGutter:false}\">\r\n</ngx-codemirror>\r\n", styles: [".cm-tab{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);background-position:right;background-repeat:no-repeat}\n"], components: [{ type: i1$4.CodemirrorComponent, selector: "ngx-codemirror", inputs: ["className", "name", "autoFocus", "options", "preserveScrollPosition"], outputs: ["cursorActivity", "focusChange", "scroll", "drop"] }], directives: [{ type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1609
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CodeEditorComponent, decorators: [{
1610
+ type: Component,
1611
+ args: [{ selector: 'gloww-code-editor', providers: [
1612
+ {
1613
+ provide: NG_VALUE_ACCESSOR,
1614
+ multi: true,
1615
+ useExisting: CodeEditorComponent
1616
+ }
1617
+ ], template: "<ngx-codemirror [(ngModel)]=\"value\" [options]=\"{lineNumbers: true,theme: 'eclipse', indentWithTabs:true,indentUnit: 4,matchBrackets: true, mode: 'text/typescript', fixedGutter:false}\">\r\n</ngx-codemirror>\r\n", styles: [".cm-tab{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);background-position:right;background-repeat:no-repeat}\n"] }]
1618
+ }], ctorParameters: function () { return []; }, propDecorators: { _value: [{
1619
+ type: Input,
1620
+ args: ['value']
1621
+ }] } });
1622
+
1623
+ class HtmlFormatPipe {
1624
+ constructor(_sanitizer) {
1625
+ this._sanitizer = _sanitizer;
1626
+ }
1627
+ transform(value, ...args) {
1628
+ const newval = value.replace(/(^\s*\w|\.\s\w)/g, m => m.toUpperCase()).replace(/\s\./ig, '').replace(/\s*Nouvelle ligne\s*.\s*/ig, '<br/>').trim();
1629
+ if (!this._sanitizer)
1630
+ return newval;
1631
+ return this._sanitizer.bypassSecurityTrustHtml(newval);
1632
+ }
1633
+ }
1634
+ HtmlFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlFormatPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1635
+ HtmlFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlFormatPipe, name: "htmlFormat" });
1636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlFormatPipe, decorators: [{
1637
+ type: Pipe,
1638
+ args: [{
1639
+ name: 'htmlFormat'
1640
+ }]
1641
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; } });
1642
+
1643
+ class SocialNetworkComponent {
1644
+ // oAuthAssociations: string[];
1645
+ // oAuthProviders: string[];
1646
+ constructor(authenticationService) {
1647
+ this.authenticationService = authenticationService;
1648
+ this.callback = new EventEmitter();
1649
+ this.icons = {
1650
+ Google: "fa-brands fa-google",
1651
+ LinkedIN: "fa-brands fa-linkedin",
1652
+ Facebook: "fa-brands fa-facebook",
1653
+ Github: "fa-brands fa-github",
1654
+ Amazon: "fa-brands fa-amazon",
1655
+ Apple: "fa-brands fa-apple",
1656
+ Microsoft: "fa-brands fa-microsoft",
1657
+ Twitter: "fa-brands fa-twitter",
1658
+ VK: "fa-brands fa-vk",
1659
+ };
1660
+ // this.authenticationService.getOAuthProviders().subscribe(oap => this.oAuthProviders = oap);
1661
+ // this.authenticationService.getOAuthAssociations().subscribe(oap => this.oAuthAssociations = oap);
1662
+ }
1663
+ ngOnInit() {
1664
+ }
1665
+ execute(provider) {
1666
+ this.callback.emit(provider);
1667
+ }
1668
+ writeobj(provider) {
1669
+ console.log(provider);
1670
+ }
1671
+ }
1672
+ SocialNetworkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SocialNetworkComponent, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
1673
+ SocialNetworkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SocialNetworkComponent, selector: "gloww-social-network", inputs: { oAuthProviders: "oAuthProviders" }, outputs: { callback: "callback" }, ngImport: i0, template: "<div class=\"SocialNetwork\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" *ngIf=\"oAuthProviders\">\r\n <ng-container *ngFor=\"let provider of oAuthProviders\">\r\n <a (click)=\"execute(provider)\">\r\n <i [ngClass]=\"icons[provider.toString()]\"></i>\r\n </a>\r\n </ng-container>\r\n</div>\r\n", styles: [""], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i9$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }] });
1674
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SocialNetworkComponent, decorators: [{
1675
+ type: Component,
1676
+ args: [{ selector: 'gloww-social-network', template: "<div class=\"SocialNetwork\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" *ngIf=\"oAuthProviders\">\r\n <ng-container *ngFor=\"let provider of oAuthProviders\">\r\n <a (click)=\"execute(provider)\">\r\n <i [ngClass]=\"icons[provider.toString()]\"></i>\r\n </a>\r\n </ng-container>\r\n</div>\r\n", styles: [""] }]
1677
+ }], ctorParameters: function () { return [{ type: AuthenticationService }]; }, propDecorators: { oAuthProviders: [{
1678
+ type: Input
1679
+ }], callback: [{
1680
+ type: Output
1681
+ }] } });
1682
+
1683
+ class LoginComponent {
1684
+ constructor(formBuilder, route, router, authenticationService, config) {
1685
+ this.formBuilder = formBuilder;
1686
+ this.route = route;
1687
+ this.router = router;
1688
+ this.authenticationService = authenticationService;
1689
+ this.loading = false;
1690
+ this.submitted = false;
1691
+ this.error = '';
1692
+ this.showDomain = false;
1693
+ this.state = 1;
1694
+ // redirect to home if already logged in
1695
+ if (this.authenticationService.currentUserValue) {
1696
+ this.router.navigate(['/']);
1697
+ }
1698
+ this.config = config;
1699
+ if (config && config.showDomain) {
1700
+ this.showDomain = config.showDomain;
1701
+ }
1702
+ this.authenticationService.getOAuthProviders().subscribe(oap => this.oAuthProviders = oap);
1703
+ }
1704
+ MatchPassword(fg) {
1705
+ if (!fg) {
1706
+ return;
1707
+ }
1708
+ return fg.get('newpassword')?.value === fg.get('confirmationPassword')?.value;
1709
+ }
1710
+ ngOnInit() {
1711
+ const grp = {
1712
+ username: ['', Validators.required],
1713
+ password: ['', Validators.required]
1714
+ };
1715
+ const lostPwd = {
1716
+ email: ['', Validators.required],
1717
+ gsm: [''],
1718
+ firstname: ['', Validators.required],
1719
+ lastname: ['', Validators.required]
1720
+ };
1721
+ const resetPwd = {
1722
+ email: ['', Validators.required],
1723
+ code: ['', Validators.required],
1724
+ newPassword: ['', Validators.required],
1725
+ confirmationPassword: ['', Validators.required]
1726
+ };
1727
+ if (this.showDomain) {
1728
+ grp.domain = [''];
1729
+ }
1730
+ this.loginForm = this.formBuilder.group(grp);
1731
+ this.lostPasswordForm = this.formBuilder.group(lostPwd);
1732
+ this.resetPasswordForm = this.formBuilder.group(resetPwd, { validator: this.MatchPassword });
1733
+ // get return url from route parameters or default to '/'
1734
+ this.returnUrl = this.route.snapshot.queryParams.returnUrl; //|| window.location.search;
1735
+ this.application = this.route.snapshot.queryParams.application; //|| window.location.pathname;
1736
+ console.log(`returnUrl : ${this.returnUrl}`);
1737
+ console.log(`application : ${this.application}`);
1738
+ this.idOauth = this.route.snapshot.queryParams.idOauth;
1739
+ this.provider = this.route.snapshot.queryParams.provider;
1740
+ this.name = this.route.snapshot.queryParams.name;
1741
+ this.value = this.route.snapshot.queryParams.value;
1742
+ if (this.idOauth) {
1743
+ this.state = 4;
1744
+ }
1745
+ }
1746
+ // convenience getter for easy access to form fields
1747
+ get f() { return this.loginForm.controls; }
1748
+ resetError() {
1749
+ this.error = "";
1750
+ }
1751
+ onConnect() {
1752
+ this.submitted = true;
1753
+ this.error = "";
1754
+ // stop here if form is invalid
1755
+ if (this.loginForm.invalid) {
1756
+ return;
1757
+ }
1758
+ this.loading = true;
1759
+ let domain = '';
1760
+ if (this.showDomain) {
1761
+ domain = this.f.domain.value;
1762
+ }
1763
+ this.authenticationService.login(domain, this.f.username.value, this.f.password.value)
1764
+ .pipe(first())
1765
+ .subscribe(data => {
1766
+ console.log(`navigate to ${this.returnUrl}`);
1767
+ this.router.navigate([this.returnUrl]);
1768
+ }, error => {
1769
+ if (error.error?.Code) {
1770
+ switch (error.error?.Code) {
1771
+ case 'BADAUTH':
1772
+ this.error = 'Utilisateur inconnu ou mauvais mot de passe. Veuillez vérifier vos identifiants.';
1773
+ break;
1774
+ case 'WEAKPASSWORD':
1775
+ this.error = 'Le mot de passe que vous avez utilisez est trop faible. S\'il s\'agit effectivement de votre mot de passe, veuillez le réinitialiser au moyen de la fonctionnalité "Mot de passe oublié". ';
1776
+ break;
1777
+ case 'BLACKLISTEDIP':
1778
+ this.error = `Trop de tentatives de connexion à partir de cette adresse IP(${error.error?.Params?.IP}).Vous ne pouvez plus vous connecter à partir de ce poste.`;
1779
+ break;
1780
+ case 'TOOMANYFROMIP':
1781
+ this.error = `Trop de tentatives de connexion, à partir de cette adresse IP(${error.error?.Params?.IP}).Vous ne pouvez pas réessayer pendant ${error.error?.Params?.nbrMinutes} minutes.`;
1782
+ break;
1783
+ case 'TOOMANYFORUSERNAME':
1784
+ this.error = `Trop de tentatives de connexion pour cet utilisateur(${error.error?.Params?.Username}).Vous ne pouvez pas réessayer pendant ${error.error?.Params?.nbrMinutes} minutes.`;
1785
+ break;
1786
+ }
1787
+ if (!this.error)
1788
+ this.error = error.error.Message;
1789
+ }
1790
+ else {
1791
+ this.error = 'Impossible de se connecter. ';
1792
+ }
1793
+ this.loading = false;
1794
+ });
1795
+ }
1796
+ onAskResetPasswordCode() {
1797
+ let gsm = this.lostPasswordForm.value.gsm;
1798
+ if (!this.config?.askGSM) {
1799
+ gsm = '--noGSM--';
1800
+ }
1801
+ this.authenticationService
1802
+ .askResetPasswordCode('', this.lostPasswordForm.value.firstname, this.lostPasswordForm.value.lastname, this.lostPasswordForm.value.email, gsm)
1803
+ .subscribe(d => { }, error => { });
1804
+ this.state = 3;
1805
+ }
1806
+ onResetPassword() {
1807
+ this.authenticationService
1808
+ .resetPassword(this.resetPasswordForm.value.email, this.resetPasswordForm.value.code, this.resetPasswordForm.value.newPassword)
1809
+ .subscribe(d => { }, error => { });
1810
+ this.state = 1;
1811
+ }
1812
+ OAuthSignIn(provider) {
1813
+ const url = `${window.location.origin}/admin/AuthUsers/OAuth/${provider}/${this.config.environment}?returnUrl=${encodeURI(this.returnUrl)}&application=${encodeURI(this.application)}&loginUrl=${encodeURI(window.location.pathname)}&currentUserVariableName=${this.authenticationService.currentUserVariableName}`;
1814
+ window.location.href = url;
1815
+ }
1816
+ onOAuthAskCode() {
1817
+ this.authenticationService
1818
+ .OAuthAskCode(this.authenticationService.environment, this.resetPasswordForm.value.email, this.idOauth, this.provider, this.name, this.value)
1819
+ .subscribe(d => {
1820
+ this.state = 5;
1821
+ }, error => { });
1822
+ }
1823
+ onOAuthAssociation() {
1824
+ this.authenticationService
1825
+ .OAuthAssociation(this.authenticationService.environment, this.resetPasswordForm.value.code, this.idOauth, this.provider, this.name, this.value)
1826
+ .subscribe(user => {
1827
+ console.log(user);
1828
+ window.location.href = this.returnUrl;
1829
+ }, error => { });
1830
+ }
1831
+ }
1832
+ LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LoginComponent, deps: [{ token: i1$3.FormBuilder }, { token: i2.ActivatedRoute }, { token: i2.Router }, { token: AuthenticationService }, { token: AuthenticationServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1833
+ LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: LoginComponent, selector: "gloww-login", ngImport: i0, template: "<div class=\"login-wrapper\" fxLayout=\"row\" fxLayoutAlign=\"center center\" style=\"height:100%\">\r\n\r\n <mat-card>\r\n <mat-card-header>\r\n <mat-card-title>Connexion</mat-card-title>\r\n </mat-card-header>\r\n\r\n <form class=\"example-form\" [formGroup]=\"loginForm\" (ngSubmit)=\"onConnect()\" *ngIf=\"state==1\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" *ngIf=\"showDomain\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Domain\" formControlName=\"domain\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Username\" formControlName=\"username\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Password\" formControlName=\"password\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\" fxLayoutGap=\"20px\">\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Me Connecter</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=2; resetError();\">Mot de passe\r\n oubli\u00E9</button>\r\n </div>\r\n <br />\r\n <gloww-social-network (callback)=\"OAuthSignIn($event)\" [oAuthProviders]=\"oAuthProviders\"></gloww-social-network>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"lostPasswordForm\" (ngSubmit)=\"onAskResetPasswordCode()\" *ngIf=\"state==2\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" *ngIf=\"showDomain\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Domain\" formControlName=\"domain\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Pr\u00E9nom\" formControlName=\"firstname\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Nom\" formControlName=\"lastname\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\" *ngIf=\"config?.askGSM\">\r\n <input matInput placeholder=\"Mobile\" formControlName=\"gsm\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Demande de\r\n r\u00E9initialisation</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=3\">J'ai un\r\n code</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onResetPassword()\" *ngIf=\"state==3\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Code\" formControlName=\"code\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Password\" formControlName=\"newPassword\" type=\"password\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Confirmation\" formControlName=\"confirmationPassword\" type=\"password\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">R\u00E9initialiser</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=1\">J'ai retrouv\u00E9 mon mot de\r\n passe</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onOAuthAskCode()\" *ngIf=\"state==4\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span fxFlex=\"100%\">Entrez l'adresse associ\u00E9e \u00E0 votre compte. Vous recevrez un code par email.</span>\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Obtenir code</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onOAuthAssociation()\" *ngIf=\"state==5\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span fxFlex=\"100%\">Faites un copier/coller du code re\u00E7u par mail</span>\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Code\" formControlName=\"code\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Associer</button>\r\n </form>\r\n </mat-card>\r\n</div>", styles: ["html,body{height:100%;margin:0;padding:0}body{background-image:url(https://lh4.googleusercontent.com/-XplyTa1Za-I/VMSgIyAYkHI/AAAAAAAADxM/oL-rD6VP4ts/w1184-h666/Android-Lollipop-wallpapers-Google-Now-Wallpaper-2.png);background-position:center;background-size:cover;background-repeat:no-repeat;min-height:100vh;font-family:Roboto,sans-serif}.app-header{justify-content:space-between;position:fixed;top:0;left:0;right:0;z-index:2;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.positronx{text-decoration:none;color:#fff}.box{position:relative;top:0;opacity:1;float:left;padding:60px 50px 40px;width:100%;background:#fff;border-radius:10px;transform:scale(1);-webkit-transform:scale(1);-ms-transform:scale(1);z-index:5;max-width:330px}.box.back{transform:scale(.95);-webkit-transform:scale(.95);-ms-transform:scale(.95);top:-20px;opacity:.8;z-index:-1}.box:before{content:\"\";width:100%;height:30px;border-radius:10px;position:absolute;top:-10px;background:rgba(255,255,255,.6);left:0;transform:scale(.95);-webkit-transform:scale(.95);-ms-transform:scale(.95);z-index:-1}.login-wrapper{height:100%}.login-wrapper mat-card-header{text-align:center;width:100%;display:block;font-weight:700}.login-wrapper mat-card-header mat-card-title{font-size:30px;margin:0}.login-wrapper .mat-card{padding:40px 70px 50px}.login-wrapper .mat-stroked-button{border:1px solid currentColor;background:#FFF7FA}.login-wrapper .mat-form-field-appearance-legacy .mat-form-field-infix{padding:.8375em 0}.SocialNetwork a{margin:10px}.SocialNetwork a i{border:1;padding:10px}\n"], components: [{ type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i5$1.MatCardHeader, selector: "mat-card-header" }, { type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: SocialNetworkComponent, selector: "gloww-social-network", inputs: ["oAuthProviders"], outputs: ["callback"] }], directives: [{ type: i9$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i9$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i5$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$1.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i9$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i9$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }] });
1834
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LoginComponent, decorators: [{
1835
+ type: Component,
1836
+ args: [{ selector: 'gloww-login', template: "<div class=\"login-wrapper\" fxLayout=\"row\" fxLayoutAlign=\"center center\" style=\"height:100%\">\r\n\r\n <mat-card>\r\n <mat-card-header>\r\n <mat-card-title>Connexion</mat-card-title>\r\n </mat-card-header>\r\n\r\n <form class=\"example-form\" [formGroup]=\"loginForm\" (ngSubmit)=\"onConnect()\" *ngIf=\"state==1\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" *ngIf=\"showDomain\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Domain\" formControlName=\"domain\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Username\" formControlName=\"username\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Password\" formControlName=\"password\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\" fxLayoutGap=\"20px\">\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Me Connecter</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=2; resetError();\">Mot de passe\r\n oubli\u00E9</button>\r\n </div>\r\n <br />\r\n <gloww-social-network (callback)=\"OAuthSignIn($event)\" [oAuthProviders]=\"oAuthProviders\"></gloww-social-network>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"lostPasswordForm\" (ngSubmit)=\"onAskResetPasswordCode()\" *ngIf=\"state==2\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" *ngIf=\"showDomain\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Domain\" formControlName=\"domain\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Pr\u00E9nom\" formControlName=\"firstname\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Nom\" formControlName=\"lastname\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\" *ngIf=\"config?.askGSM\">\r\n <input matInput placeholder=\"Mobile\" formControlName=\"gsm\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Demande de\r\n r\u00E9initialisation</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=3\">J'ai un\r\n code</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onResetPassword()\" *ngIf=\"state==3\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Code\" formControlName=\"code\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Password\" formControlName=\"newPassword\" type=\"password\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Confirmation\" formControlName=\"confirmationPassword\" type=\"password\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">R\u00E9initialiser</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=1\">J'ai retrouv\u00E9 mon mot de\r\n passe</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onOAuthAskCode()\" *ngIf=\"state==4\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span fxFlex=\"100%\">Entrez l'adresse associ\u00E9e \u00E0 votre compte. Vous recevrez un code par email.</span>\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Obtenir code</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onOAuthAssociation()\" *ngIf=\"state==5\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span fxFlex=\"100%\">Faites un copier/coller du code re\u00E7u par mail</span>\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Code\" formControlName=\"code\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Associer</button>\r\n </form>\r\n </mat-card>\r\n</div>", styles: ["html,body{height:100%;margin:0;padding:0}body{background-image:url(https://lh4.googleusercontent.com/-XplyTa1Za-I/VMSgIyAYkHI/AAAAAAAADxM/oL-rD6VP4ts/w1184-h666/Android-Lollipop-wallpapers-Google-Now-Wallpaper-2.png);background-position:center;background-size:cover;background-repeat:no-repeat;min-height:100vh;font-family:Roboto,sans-serif}.app-header{justify-content:space-between;position:fixed;top:0;left:0;right:0;z-index:2;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.positronx{text-decoration:none;color:#fff}.box{position:relative;top:0;opacity:1;float:left;padding:60px 50px 40px;width:100%;background:#fff;border-radius:10px;transform:scale(1);-webkit-transform:scale(1);-ms-transform:scale(1);z-index:5;max-width:330px}.box.back{transform:scale(.95);-webkit-transform:scale(.95);-ms-transform:scale(.95);top:-20px;opacity:.8;z-index:-1}.box:before{content:\"\";width:100%;height:30px;border-radius:10px;position:absolute;top:-10px;background:rgba(255,255,255,.6);left:0;transform:scale(.95);-webkit-transform:scale(.95);-ms-transform:scale(.95);z-index:-1}.login-wrapper{height:100%}.login-wrapper mat-card-header{text-align:center;width:100%;display:block;font-weight:700}.login-wrapper mat-card-header mat-card-title{font-size:30px;margin:0}.login-wrapper .mat-card{padding:40px 70px 50px}.login-wrapper .mat-stroked-button{border:1px solid currentColor;background:#FFF7FA}.login-wrapper .mat-form-field-appearance-legacy .mat-form-field-infix{padding:.8375em 0}.SocialNetwork a{margin:10px}.SocialNetwork a i{border:1;padding:10px}\n"] }]
1837
+ }], ctorParameters: function () { return [{ type: i1$3.FormBuilder }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: AuthenticationService }, { type: AuthenticationServiceConfig, decorators: [{
1838
+ type: Optional
1839
+ }] }]; } });
1840
+
1841
+ class JwtInterceptor {
1842
+ constructor(authenticationService) {
1843
+ this.authenticationService = authenticationService;
1844
+ }
1845
+ intercept(request, next) {
1846
+ // add authorization header with jwt token if available
1847
+ try {
1848
+ const currentUser = this.authenticationService.currentUserValue;
1849
+ if (currentUser && currentUser.Token) {
1850
+ request = request.clone({
1851
+ setHeaders: {
1852
+ Authorization: `Bearer ${currentUser.Token}`
1853
+ }
1854
+ });
1855
+ }
1856
+ }
1857
+ catch (e) {
1858
+ console.log(`jwt interceptor ${e}`);
1859
+ }
1860
+ return next.handle(request);
1861
+ }
1862
+ }
1863
+ JwtInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: JwtInterceptor, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
1864
+ JwtInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: JwtInterceptor });
1865
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: JwtInterceptor, decorators: [{
1866
+ type: Injectable
1867
+ }], ctorParameters: function () { return [{ type: AuthenticationService }]; } });
1868
+
1869
+ class ErrorInterceptor {
1870
+ constructor(authenticationService) {
1871
+ this.authenticationService = authenticationService;
1872
+ }
1873
+ intercept(request, next) {
1874
+ return next.handle(request).pipe(catchError(err => {
1875
+ if (err.status === 401) {
1876
+ // auto logout if 401 response returned from api
1877
+ this.authenticationService.logout();
1878
+ location.reload();
1879
+ }
1880
+ const error = err.error ? (err.error.message || err.StatusText) : err.statusText;
1881
+ if (console)
1882
+ console.log(err);
1883
+ return throwError(err);
1884
+ }));
1885
+ }
1886
+ }
1887
+ ErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ErrorInterceptor, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
1888
+ ErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ErrorInterceptor });
1889
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ErrorInterceptor, decorators: [{
1890
+ type: Injectable
1891
+ }], ctorParameters: function () { return [{ type: AuthenticationService }]; } });
1892
+
1893
+ class ChangePasswordDlgComponent {
1894
+ constructor(formBuilder, dialogRef, authenticationService) {
1895
+ this.formBuilder = formBuilder;
1896
+ this.dialogRef = dialogRef;
1897
+ this.authenticationService = authenticationService;
1898
+ this.form = this.formBuilder.group({
1899
+ oldpassword: ['', Validators.required],
1900
+ newpassword: ['', Validators.required],
1901
+ confirmationpassword: ['', Validators.required]
1902
+ }, { validator: c => c.get('newpassword').value === c.get('confirmationpassword').value });
1903
+ }
1904
+ ngOnInit() {
1905
+ }
1906
+ resetError() {
1907
+ this.error = '';
1908
+ }
1909
+ onSubmit() {
1910
+ this.resetError();
1911
+ if (this.form.invalid) {
1912
+ return;
1913
+ }
1914
+ const user = this.authenticationService.currentUserValue;
1915
+ this.authenticationService.changePassword('', user.username, this.form.value.oldpassword, this.form.value.newpassword).subscribe(r => this.dialogRef.close(true), error => {
1916
+ switch (error.error?.Code) {
1917
+ case 'COMPLEXITY':
1918
+ this.error = 'Le mot de passe souhaitez n\'est pas suffisamment complexe. Veuillez utiliser un mot de passe long (8 caractères minimum) combinant des majuscules, minuscules, chiffres et caractères spéciaux.';
1919
+ break;
1920
+ case 'BADAUTH':
1921
+ this.error = 'Utilisateur inconnu ou mauvais mot de passe. Veuillez vérifier vos identifiants.';
1922
+ break;
1923
+ case 'WEAKPASSWORD':
1924
+ this.error = 'Le mot de passe que vous avez utilisez est trop faible. S\'il s\'agit effectivement de votre mot de passe, veuillez le réinitialiser au moyen de la fonctionnalité "Mot de passe oublié". ';
1925
+ break;
1926
+ case 'BLACKLISTEDIP':
1927
+ this.error = `Trop de tentatives de connexion à partir de cette adresse IP (${error.error?.Params?.IP}). Vous ne pouvez plus vous connecter à partir de ce poste.`;
1928
+ break;
1929
+ case 'TOOMANYFROMIP':
1930
+ this.error = `Trop de tentatives de connexion, à partir de cette adresse IP (${error.error?.Params?.IP}). Vous ne pouvez pas réessayer pendant ${error.error?.Params?.nbrMinutes} minutes.`;
1931
+ break;
1932
+ case 'TOOMANYFORUSERNAME':
1933
+ this.error = `Trop de tentatives de connexion pour cet utilisateur (${error.error?.Params?.Username}). Vous ne pouvez pas réessayer pendant ${error.error?.Params?.nbrMinutes} minutes.`;
1934
+ break;
1935
+ }
1936
+ this.error = error.error.Message;
1937
+ });
1938
+ }
1939
+ cancel() {
1940
+ this.dialogRef.close();
1941
+ }
1942
+ }
1943
+ ChangePasswordDlgComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ChangePasswordDlgComponent, deps: [{ token: i1$3.FormBuilder }, { token: i1$2.MatDialogRef }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
1944
+ ChangePasswordDlgComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: ChangePasswordDlgComponent, selector: "gloww-change-password-dlg", ngImport: i0, template: "<h2 mat-dialog-title>Change Password</h2>\r\n<form class=\"example-form\" [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <mat-dialog-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <div style=\"color:red; font-weight:bold;\" fxFlex=\"100%\">{{error}}</div>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"Old Password\" formControlName=\"oldpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"New Password\" formControlName=\"newpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"Confirmation\" formControlName=\"confirmationpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" type=\"submit\" [disabled]=\"form.invalid\">Change\r\n Password</button>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" (click)=\"cancel()\">Cancel</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [""], components: [{ type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i9$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i9$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
1945
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ChangePasswordDlgComponent, decorators: [{
1946
+ type: Component,
1947
+ args: [{ selector: 'gloww-change-password-dlg', template: "<h2 mat-dialog-title>Change Password</h2>\r\n<form class=\"example-form\" [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <mat-dialog-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <div style=\"color:red; font-weight:bold;\" fxFlex=\"100%\">{{error}}</div>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"Old Password\" formControlName=\"oldpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"New Password\" formControlName=\"newpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"Confirmation\" formControlName=\"confirmationpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" type=\"submit\" [disabled]=\"form.invalid\">Change\r\n Password</button>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" (click)=\"cancel()\">Cancel</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [""] }]
1948
+ }], ctorParameters: function () { return [{ type: i1$3.FormBuilder }, { type: i1$2.MatDialogRef }, { type: AuthenticationService }]; } });
1949
+
1950
+ class SocialNetworkDlgComponent {
1951
+ constructor(dialogRef, authenticationService, dialog, config) {
1952
+ this.dialogRef = dialogRef;
1953
+ this.authenticationService = authenticationService;
1954
+ this.dialog = dialog;
1955
+ this.config = config;
1956
+ this.authenticationService.getOAuthProviders().subscribe(oap => this.oAuthProviders = oap);
1957
+ this.authenticationService.getOAuthAssociations().subscribe(oap => {
1958
+ this.oAuthAssociations = oap; //oap.map(item => Object.assign(new Oauthassociation(), item));
1959
+ });
1960
+ }
1961
+ ngOnInit() {
1962
+ }
1963
+ OK() {
1964
+ this.dialogRef.close();
1965
+ }
1966
+ OAuthAddAssociation(provider) {
1967
+ const url = `${window.location.origin}/admin/AuthUsers/OAuth/${provider}/${this.config.environment}`;
1968
+ window.location.href = url;
1969
+ }
1970
+ OAuthDeleteAssociation(association) {
1971
+ this.authenticationService.OAuthDeleteAssociation(association.provider, association.idOAuth).subscribe(result => {
1972
+ alert("Association supprimée");
1973
+ const index = this.oAuthAssociations.indexOf(association, 0);
1974
+ if (index >= 0) {
1975
+ this.oAuthAssociations.splice(index, 1);
1976
+ }
1977
+ else {
1978
+ alert("unable to delete item");
1979
+ }
1980
+ //this.oAuthAssociations.find(a => a === association
1981
+ }, error => {
1982
+ alert('Impossible d\'effacer l\'association');
1983
+ });
1984
+ }
1985
+ }
1986
+ SocialNetworkDlgComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SocialNetworkDlgComponent, deps: [{ token: i1$2.MatDialogRef }, { token: AuthenticationService }, { token: i1$2.MatDialog }, { token: AuthenticationServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1987
+ SocialNetworkDlgComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SocialNetworkDlgComponent, selector: "gloww-social-network-dlg", ngImport: i0, template: "<h2 mat-dialog-title>Gestion des identifications par r\u00E9seaux sociaux</h2>\r\n<mat-dialog-content>\r\n <h3>Associations \u00E9tablies</h3>\r\n <p>Choisissez l'association que vous souhaitez supprimer</p>\r\n <gloww-social-network (callback)=\"OAuthDeleteAssociation($event)\" [oAuthProviders]=\"oAuthAssociations\"></gloww-social-network>\r\n <h3>Nouvelle association</h3>\r\n <p>Choisissez le provider</p>\r\n <gloww-social-network (callback)=\"OAuthAddAssociation($event)\" [oAuthProviders]=\"oAuthProviders\"></gloww-social-network>\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" (click)=\"OK() \">OK</button>\r\n</mat-dialog-actions>", styles: [""], components: [{ type: SocialNetworkComponent, selector: "gloww-social-network", inputs: ["oAuthProviders"], outputs: ["callback"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
1988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SocialNetworkDlgComponent, decorators: [{
1989
+ type: Component,
1990
+ args: [{ selector: 'gloww-social-network-dlg', template: "<h2 mat-dialog-title>Gestion des identifications par r\u00E9seaux sociaux</h2>\r\n<mat-dialog-content>\r\n <h3>Associations \u00E9tablies</h3>\r\n <p>Choisissez l'association que vous souhaitez supprimer</p>\r\n <gloww-social-network (callback)=\"OAuthDeleteAssociation($event)\" [oAuthProviders]=\"oAuthAssociations\"></gloww-social-network>\r\n <h3>Nouvelle association</h3>\r\n <p>Choisissez le provider</p>\r\n <gloww-social-network (callback)=\"OAuthAddAssociation($event)\" [oAuthProviders]=\"oAuthProviders\"></gloww-social-network>\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" (click)=\"OK() \">OK</button>\r\n</mat-dialog-actions>", styles: [""] }]
1991
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: AuthenticationService }, { type: i1$2.MatDialog }, { type: AuthenticationServiceConfig, decorators: [{
1992
+ type: Optional
1993
+ }] }]; } });
1994
+
1995
+ class UserMenuComponent {
1996
+ constructor(authenticationService, dialog, router) {
1997
+ this.authenticationService = authenticationService;
1998
+ this.dialog = dialog;
1999
+ this.router = router;
2000
+ this.size = '1x';
2001
+ this.imageUser = null;
2002
+ this.loginpage = '';
2003
+ this.showMenuUser = false;
2004
+ this.connected = false;
2005
+ const person = this.authenticationService.currentUserValue;
2006
+ if (person && person.UserInfo) {
2007
+ this.connected = true;
2008
+ if (person.UserInfo.Picture) {
2009
+ this.imageUser = '/' + authenticationService.environment + '/' + person.UserInfo.Picture;
2010
+ }
2011
+ }
2012
+ this.authenticationService.getOAuthProviders().subscribe(oap => this.oAuthProviders = oap);
2013
+ }
2014
+ ngOnInit() {
2015
+ }
2016
+ Logout() {
2017
+ this.showMenuUser = false;
2018
+ this.authenticationService.logout();
2019
+ this.router.navigate(['/']);
2020
+ }
2021
+ ChangePassword() {
2022
+ this.showMenuUser = true;
2023
+ const dialogConfig = new MatDialogConfig();
2024
+ dialogConfig.disableClose = true;
2025
+ dialogConfig.autoFocus = true;
2026
+ dialogConfig.closeOnNavigation = false;
2027
+ this.dialog.open(ChangePasswordDlgComponent, dialogConfig).afterClosed().subscribe(result => {
2028
+ if (result) {
2029
+ alert('Password Changed');
2030
+ }
2031
+ });
2032
+ }
2033
+ toggleMenuUser() {
2034
+ this.showMenuUser = !this.showMenuUser;
2035
+ }
2036
+ Configuration() {
2037
+ const dialogConfig = new MatDialogConfig();
2038
+ dialogConfig.disableClose = true;
2039
+ dialogConfig.autoFocus = true;
2040
+ dialogConfig.closeOnNavigation = false;
2041
+ this.dialog.open(SocialNetworkDlgComponent, dialogConfig).afterClosed().subscribe(result => {
2042
+ });
2043
+ }
2044
+ }
2045
+ UserMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UserMenuComponent, deps: [{ token: AuthenticationService }, { token: i1$2.MatDialog }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component });
2046
+ UserMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: UserMenuComponent, selector: "gloww-user-menu", inputs: { size: "size", imageUser: "imageUser", loginpage: "loginpage" }, ngImport: i0, template: "<div *ngIf=\"connected\">\r\n <span (click)=\"toggleMenuUser()\">\r\n <img [src]=\"imageUser\" style=\"height:40px;float:left; padding-left:20px\" *ngIf=\"imageUser\" />\r\n <i [ngClass]=\"'fal fa-user '+size\" *ngIf=\"!imageUser\" style=\"float:left; padding-left:10px\">\r\n <!--[size]=\"size\"-->\r\n </i>\r\n </span>\r\n <div class=\"menuUser\" *ngIf=\"showMenuUser\">\r\n <ul class=\"menuSec\" style=\"border: solid lightgrey;\">\r\n <li (click)=\"ChangePassword()\">\r\n <i class=\"fal fa-key-skeleton\"></i>Change Password\r\n </li>\r\n <li (click)=\"Configuration()\" *ngIf=\"oAuthProviders && oAuthProviders.length\">\r\n <i class=\"fal fa-tools\"></i>Configuration\r\n </li>\r\n <li (click)=\"Logout()\">\r\n <i class=\"fal fa-sign-out\"></i>D\u00E9connexion\r\n </li>\r\n </ul>\r\n </div>\r\n</div>\r\n<div *ngIf=\"!connected && loginpage\">\r\n <span style=\"height:40px;float:left; padding-left:20px\" [routerLink]=\"loginpage\">Connexion</span>\r\n</div>\r\n", styles: [".menuUser{position:relative}.menuUser ul{text-align:left;position:absolute;top:30px;left:-115px;width:150px;padding:10px;z-index:20;background-color:#fff;font-size:13px;color:#000}.menuUser ul li{height:30px;list-style-type:none}.menuUser ul li i{padding-right:10px;height:30px}ul.menuSec li{cursor:pointer}\n"], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i2.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }] });
2047
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UserMenuComponent, decorators: [{
2048
+ type: Component,
2049
+ args: [{ selector: 'gloww-user-menu', template: "<div *ngIf=\"connected\">\r\n <span (click)=\"toggleMenuUser()\">\r\n <img [src]=\"imageUser\" style=\"height:40px;float:left; padding-left:20px\" *ngIf=\"imageUser\" />\r\n <i [ngClass]=\"'fal fa-user '+size\" *ngIf=\"!imageUser\" style=\"float:left; padding-left:10px\">\r\n <!--[size]=\"size\"-->\r\n </i>\r\n </span>\r\n <div class=\"menuUser\" *ngIf=\"showMenuUser\">\r\n <ul class=\"menuSec\" style=\"border: solid lightgrey;\">\r\n <li (click)=\"ChangePassword()\">\r\n <i class=\"fal fa-key-skeleton\"></i>Change Password\r\n </li>\r\n <li (click)=\"Configuration()\" *ngIf=\"oAuthProviders && oAuthProviders.length\">\r\n <i class=\"fal fa-tools\"></i>Configuration\r\n </li>\r\n <li (click)=\"Logout()\">\r\n <i class=\"fal fa-sign-out\"></i>D\u00E9connexion\r\n </li>\r\n </ul>\r\n </div>\r\n</div>\r\n<div *ngIf=\"!connected && loginpage\">\r\n <span style=\"height:40px;float:left; padding-left:20px\" [routerLink]=\"loginpage\">Connexion</span>\r\n</div>\r\n", styles: [".menuUser{position:relative}.menuUser ul{text-align:left;position:absolute;top:30px;left:-115px;width:150px;padding:10px;z-index:20;background-color:#fff;font-size:13px;color:#000}.menuUser ul li{height:30px;list-style-type:none}.menuUser ul li i{padding-right:10px;height:30px}ul.menuSec li{cursor:pointer}\n"] }]
2050
+ }], ctorParameters: function () { return [{ type: AuthenticationService }, { type: i1$2.MatDialog }, { type: i2.Router }]; }, propDecorators: { size: [{
2051
+ type: Input
2052
+ }], imageUser: [{
2053
+ type: Input
2054
+ }], loginpage: [{
2055
+ type: Input
2056
+ }] } });
2057
+
2058
+ class StagingInterceptor {
2059
+ constructor() { }
2060
+ intercept(request, next) {
2061
+ // add authorization header with jwt token if available
2062
+ try {
2063
+ if (!request.url.match(/version\.json(\?|$)/ig)) {
2064
+ console.log(`Replace ${request.url}`);
2065
+ return next.handle(request.clone({ url: request.url.replace("__Staging", "") }));
2066
+ }
2067
+ }
2068
+ catch (e) {
2069
+ console.log(`staging interceptor ${e}`);
2070
+ }
2071
+ return next.handle(request);
2072
+ }
2073
+ }
2074
+ StagingInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StagingInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2075
+ StagingInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StagingInterceptor });
2076
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StagingInterceptor, decorators: [{
2077
+ type: Injectable
2078
+ }], ctorParameters: function () { return []; } });
2079
+
2080
+ class AuthGuard {
2081
+ constructor(router, authenticationService, platformLocation
2082
+ //@Inject(APP_BASE_HREF) baseHref: string
2083
+ ) {
2084
+ this.router = router;
2085
+ this.authenticationService = authenticationService;
2086
+ this.platformLocation = platformLocation;
2087
+ this.baseHref = null;
2088
+ this.baseHref = platformLocation.getBaseHrefFromDOM();
2089
+ }
2090
+ canActivate(route, state) {
2091
+ const currentUser = this.authenticationService.currentUserValue;
2092
+ if (currentUser) {
2093
+ // logged in so return true
2094
+ const jwtToken = jwt_decode(currentUser.Token);
2095
+ if (Date.now() < jwtToken.exp * 1000) {
2096
+ return true;
2097
+ }
2098
+ else {
2099
+ this.authenticationService.logout();
2100
+ }
2101
+ }
2102
+ const vd = window.location.pathname;
2103
+ if (vd.endsWith("/login")) {
2104
+ return true;
2105
+ }
2106
+ console.log(window.location);
2107
+ console.log(route);
2108
+ console.log(state);
2109
+ console.log(state.url);
2110
+ console.log(window.location.search);
2111
+ console.log(window.location.pathname);
2112
+ const returnUrl = window.location.pathname.substr(this.baseHref.length);
2113
+ //let application = window.location.pathname.substr(0, window.location.pathname.length - state.url.length);
2114
+ /*if (state.url === '/') {
2115
+ application = window.location.pathname.endsWith("/") ? application.substr(0, window.location.pathname.length - 1) : window.location.pathname;
2116
+ }
2117
+ if (!application) { application = '/'; }
2118
+ console.log(application);*/
2119
+ // not logged in so redirect to login page with the return url
2120
+ this.router.navigate(['/login'], { queryParams: { returnUrl: `${returnUrl}${window.location.search}`, application: `${this.baseHref}` } });
2121
+ return false;
2122
+ }
2123
+ }
2124
+ AuthGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthGuard, deps: [{ token: i2.Router }, { token: AuthenticationService }, { token: i3.PlatformLocation }], target: i0.ɵɵFactoryTarget.Injectable });
2125
+ AuthGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthGuard, providedIn: 'root' });
2126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthGuard, decorators: [{
2127
+ type: Injectable,
2128
+ args: [{ providedIn: 'root' }]
2129
+ }], ctorParameters: function () { return [{ type: i2.Router }, { type: AuthenticationService }, { type: i3.PlatformLocation }]; } });
2130
+
2131
+ class AdministratorGuard {
2132
+ constructor(router, authenticationService, platformLocation
2133
+ //@Inject(APP_BASE_HREF) baseHref: string
2134
+ ) {
2135
+ this.router = router;
2136
+ this.authenticationService = authenticationService;
2137
+ this.platformLocation = platformLocation;
2138
+ }
2139
+ canActivate(route, state) {
2140
+ const currentUser = this.authenticationService.currentUserValue.UserInfo;
2141
+ return currentUser.IsAdministrator || currentUser.isAdministrator;
2142
+ }
2143
+ }
2144
+ AdministratorGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AdministratorGuard, deps: [{ token: i2.Router }, { token: AuthenticationService }, { token: i3.PlatformLocation }], target: i0.ɵɵFactoryTarget.Injectable });
2145
+ AdministratorGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AdministratorGuard, providedIn: 'root' });
2146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AdministratorGuard, decorators: [{
2147
+ type: Injectable,
2148
+ args: [{
2149
+ providedIn: 'root'
2150
+ }]
2151
+ }], ctorParameters: function () { return [{ type: i2.Router }, { type: AuthenticationService }, { type: i3.PlatformLocation }]; } });
2152
+
2153
+ class GlowwSecurityModule {
2154
+ static forRoot(authenticationServiceConfig) {
2155
+ /*
2156
+ var socialLoginProviders = {
2157
+ provide: 'SocialAuthServiceConfig',
2158
+ useValue: {
2159
+ autoLogin: false,
2160
+ providers: [
2161
+ ],
2162
+ onError: (err) => {
2163
+ console.error(err);
2164
+ }
2165
+ } as SocialAuthServiceConfig,
2166
+ };
2167
+
2168
+ if (authenticationServiceConfig.googleClientId) {
2169
+ socialLoginProviders.useValue.providers.push(
2170
+ {
2171
+ id: GoogleLoginProvider.PROVIDER_ID,
2172
+ provider: new GoogleLoginProvider(
2173
+ authenticationServiceConfig.googleClientId
2174
+ )
2175
+ }
2176
+ )
2177
+ }
2178
+ if (authenticationServiceConfig.facebookClientId) {
2179
+ socialLoginProviders.useValue.providers.push(
2180
+ {
2181
+ id: FacebookLoginProvider.PROVIDER_ID,
2182
+ provider: new FacebookLoginProvider(
2183
+ authenticationServiceConfig.facebookClientId
2184
+ )
2185
+ }
2186
+ )
2187
+ }
2188
+ if (authenticationServiceConfig.amazonClientId) {
2189
+ socialLoginProviders.useValue.providers.push(
2190
+ {
2191
+ id: AmazonLoginProvider.PROVIDER_ID,
2192
+ provider: new AmazonLoginProvider(
2193
+ authenticationServiceConfig.amazonClientId
2194
+ )
2195
+ }
2196
+ )
2197
+ }
2198
+ if (authenticationServiceConfig.microsoftClientId) {
2199
+ socialLoginProviders.useValue.providers.push(
2200
+ {
2201
+ id: MicrosoftLoginProvider.PROVIDER_ID,
2202
+ provider: new MicrosoftLoginProvider(
2203
+ authenticationServiceConfig.microsoftClientId
2204
+ )
2205
+ }
2206
+ )
2207
+ }
2208
+ */
2209
+ return {
2210
+ ngModule: GlowwSecurityModule,
2211
+ providers: [
2212
+ AuthenticationService,
2213
+ AuthenticationServiceConfig,
2214
+ { provide: AuthenticationServiceConfig, useValue: authenticationServiceConfig },
2215
+ { provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true },
2216
+ { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
2217
+ //{ provide: HTTP_INTERCEPTORS, useClass: StagingInterceptor, multi: true },
2218
+ //socialLoginProviders
2219
+ ]
2220
+ };
2221
+ }
2222
+ }
2223
+ GlowwSecurityModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2224
+ GlowwSecurityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityModule, declarations: [LoginComponent,
2225
+ ChangePasswordDlgComponent,
2226
+ UserMenuComponent,
2227
+ SocialNetworkDlgComponent,
2228
+ SocialNetworkComponent], imports: [CommonModule,
2229
+ FormsModule,
2230
+ ReactiveFormsModule,
2231
+ BrowserModule,
2232
+ BrowserAnimationsModule,
2233
+ FlexLayoutModule,
2234
+ MatToolbarModule,
2235
+ MatButtonModule,
2236
+ MatSidenavModule,
2237
+ MatInputModule,
2238
+ MatFormFieldModule,
2239
+ MatCardModule,
2240
+ MatDialogModule,
2241
+ HttpClientModule,
2242
+ RouterModule], exports: [LoginComponent, RouterModule, UserMenuComponent] });
2243
+ GlowwSecurityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityModule, providers: [], imports: [[
2244
+ CommonModule,
2245
+ FormsModule,
2246
+ ReactiveFormsModule,
2247
+ BrowserModule,
2248
+ BrowserAnimationsModule,
2249
+ FlexLayoutModule,
2250
+ MatToolbarModule,
2251
+ MatButtonModule,
2252
+ MatSidenavModule,
2253
+ MatInputModule,
2254
+ MatFormFieldModule,
2255
+ MatCardModule,
2256
+ MatDialogModule,
2257
+ HttpClientModule,
2258
+ RouterModule,
2259
+ ], RouterModule] });
2260
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityModule, decorators: [{
2261
+ type: NgModule,
2262
+ args: [{
2263
+ declarations: [
2264
+ LoginComponent,
2265
+ ChangePasswordDlgComponent,
2266
+ UserMenuComponent,
2267
+ SocialNetworkDlgComponent,
2268
+ SocialNetworkComponent,
2269
+ ],
2270
+ imports: [
2271
+ CommonModule,
2272
+ FormsModule,
2273
+ ReactiveFormsModule,
2274
+ BrowserModule,
2275
+ BrowserAnimationsModule,
2276
+ FlexLayoutModule,
2277
+ MatToolbarModule,
2278
+ MatButtonModule,
2279
+ MatSidenavModule,
2280
+ MatInputModule,
2281
+ MatFormFieldModule,
2282
+ MatCardModule,
2283
+ MatDialogModule,
2284
+ HttpClientModule,
2285
+ RouterModule,
2286
+ ],
2287
+ providers: [],
2288
+ exports: [LoginComponent, RouterModule, UserMenuComponent]
2289
+ }]
2290
+ }] });
2291
+
2292
+ class HtmlEditorComponent {
2293
+ constructor(sanitizer, authenticationService, voiceRecognitionService, dialog) {
2294
+ this.sanitizer = sanitizer;
2295
+ this.authenticationService = authenticationService;
2296
+ this.voiceRecognitionService = voiceRecognitionService;
2297
+ this.dialog = dialog;
2298
+ //@Input() formControlName: string = "";
2299
+ this.placeHolder = "";
2300
+ this._value = null;
2301
+ this.onChange = () => { };
2302
+ this.onTouched = () => { };
2303
+ this.allowedStyles = ['text-align'];
2304
+ this.allowedTags = ['p', 'span', 'div', 'hr', 'br', 'b', 'i', 'u', 'sup', 'sub', 'strike', 'ol', 'ul', 'li'];
2305
+ this.editorConfig = {
2306
+ editable: true,
2307
+ spellcheck: true,
2308
+ height: 'auto',
2309
+ minHeight: '75px',
2310
+ maxHeight: 'auto',
2311
+ width: 'auto',
2312
+ minWidth: '0',
2313
+ translate: 'yes',
2314
+ enableToolbar: true,
2315
+ showToolbar: true,
2316
+ placeholder: 'Enter text here...',
2317
+ defaultParagraphSeparator: 'p',
2318
+ defaultFontName: '',
2319
+ defaultFontSize: '3',
2320
+ fonts: [
2321
+ { class: 'arial', name: 'Arial' }
2322
+ ],
2323
+ customClasses: [
2324
+ {
2325
+ name: 'quote',
2326
+ class: 'quote',
2327
+ }
2328
+ ],
2329
+ uploadUrl: 'v1/image',
2330
+ uploadWithCredentials: false,
2331
+ sanitize: (html) => this.sanitize(html),
2332
+ toolbarPosition: 'top',
2333
+ toolbarHiddenButtons: [
2334
+ ['insertImage', 'insertVideo', 'customClasses', 'heading', 'heading',
2335
+ 'fontName',
2336
+ 'fontSize',
2337
+ 'textColor',
2338
+ 'backgroundColor', !this.isAdministrator() ? 'toggleEditorMode' : '']
2339
+ ],
2340
+ additionalButtons: [
2341
+ {
2342
+ title: 'Speech Recognition',
2343
+ click: (tb, event) => {
2344
+ this.tb = tb;
2345
+ tb.focus();
2346
+ this.voiceRecognitionService.start();
2347
+ this.voiceRecognitionService.text = "";
2348
+ this.dialogRef = this.dialog.open(this.voiceRecognitionTemplate, {
2349
+ width: '550px'
2350
+ });
2351
+ },
2352
+ icon: 'fas fa-comment-plus'
2353
+ }
2354
+ ]
2355
+ };
2356
+ this.voiceRecognitionService.init();
2357
+ }
2358
+ cancel() {
2359
+ this.voiceRecognitionService.stop();
2360
+ this.tb = undefined;
2361
+ this.dialogRef?.close();
2362
+ }
2363
+ paste() {
2364
+ this.tb?.insertHtml(new HtmlFormatPipe().transform(this.voiceRecognitionService.text));
2365
+ this.voiceRecognitionService.stop();
2366
+ this.tb = undefined;
2367
+ this.dialogRef?.close();
2368
+ }
2369
+ get value() {
2370
+ return this._value;
2371
+ }
2372
+ set value(val) {
2373
+ this._value = val;
2374
+ this.onChange(val);
2375
+ this.onTouched();
2376
+ }
2377
+ writeValue(obj) {
2378
+ if (obj) {
2379
+ this.value = obj;
2380
+ }
2381
+ }
2382
+ registerOnChange(fn) {
2383
+ this.onChange = fn;
2384
+ }
2385
+ registerOnTouched(fn) {
2386
+ this.onTouched = fn;
2387
+ }
2388
+ sanitize(html) {
2389
+ let itres = this.sanitizer.sanitize(SecurityContext.STYLE, html)?.replace(new RegExp('\\</?[a-z]+:[a-z]+\\>', 'gi'), '').replace(/class="Mso[a-z]+"/ig, '');
2390
+ const matchTags = itres?.match(/<\s*\/?(?<tag>[a-z0-9]+)\s*[^>]*>/ig);
2391
+ matchTags?.forEach(m => {
2392
+ const matchTag = m.match(/<\s*\/?(?<tag>[a-z0-9]+)\s*[^>]*>/i);
2393
+ if (matchTag?.groups && this.allowedTags.indexOf(matchTag?.groups['tag']) < 0) {
2394
+ itres = itres?.replace(m, '');
2395
+ }
2396
+ });
2397
+ while (true) {
2398
+ const matchStyle = itres?.match(/style\s*=\s*"(?<style>[^"]+)"/i);
2399
+ if (!matchStyle || !matchStyle?.groups) {
2400
+ break;
2401
+ }
2402
+ const styles = matchStyle?.groups['style']?.replace(/&quot;/ig, '"');
2403
+ const smatches = styles.match(/(?<name>[^;:]+)\s*:\s*(?<value>[^;]+);*/ig);
2404
+ const newStyles = [];
2405
+ smatches?.forEach((v, i, a) => {
2406
+ const ssmatches = v.match(/(?<name>[^;:]+)\s*:\s*(?<value>[^;]+);*/i);
2407
+ if (ssmatches?.groups) {
2408
+ const name = ssmatches?.groups['name'];
2409
+ if (this.allowedStyles.indexOf(name) >= 0) {
2410
+ newStyles.push(v);
2411
+ }
2412
+ const value = ssmatches.groups['value'];
2413
+ console.log(`${name}=${value}`);
2414
+ }
2415
+ });
2416
+ let attr = '';
2417
+ if (newStyles.length) {
2418
+ attr = `stylenew="${newStyles.join(';')}"`;
2419
+ }
2420
+ itres = itres?.replace(matchStyle[0], attr);
2421
+ }
2422
+ return itres?.replace(/stylenew=/ig, 'style=') ?? "";
2423
+ }
2424
+ isAdministrator() {
2425
+ const currentUser = this.authenticationService.currentUserValue.UserInfo;
2426
+ return currentUser.IsAdministrator === 1 || currentUser.isAdministrator === 1;
2427
+ }
2428
+ }
2429
+ HtmlEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlEditorComponent, deps: [{ token: i1$1.DomSanitizer }, { token: AuthenticationService }, { token: VoiceRecognitionService }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2430
+ HtmlEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: HtmlEditorComponent, selector: "gloww-html-editor", inputs: { placeHolder: "placeHolder", _value: ["value", "_value"] }, providers: [
2431
+ {
2432
+ provide: NG_VALUE_ACCESSOR,
2433
+ multi: true,
2434
+ useExisting: HtmlEditorComponent
2435
+ }
2436
+ ], viewQueries: [{ propertyName: "voiceRecognitionTemplate", first: true, predicate: ["voiceRecognitionDlg"], descendants: true }], ngImport: i0, template: "<div>\r\n <angular-editor [(ngModel)]=\"value\" [config]=\"editorConfig\" [placeholder]=\"placeHolder\"></angular-editor>\r\n</div>\r\n<ng-template #voiceRecognitionDlg>\r\n <mat-dialog-content>\r\n <div>La reconnaissance vocale est activ\u00E9e. Veuillez dicter le texte \u00E0 ins\u00E9rer.</div>\r\n <div [innerHTML]=\"voiceRecognitionService.text | htmlFormat\" style=\"width:500px;height:300px;border:1px solid; border-color: blue;\"></div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions>\r\n <button class=\"mat-raised-button\" (click)=\"cancel()\">Close</button>\r\n <button class=\"mat-raised-button mat-primary\" (click)=\"paste()\">Paste</button>\r\n </mat-dialog-actions>\r\n</ng-template>\r\n", styles: [""], components: [{ type: i5$3.AngularEditorComponent, selector: "angular-editor", inputs: ["id", "config", "placeholder", "tabIndex"], outputs: ["html", "viewMode", "blur", "focus"] }], directives: [{ type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], pipes: { "htmlFormat": HtmlFormatPipe } });
2437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlEditorComponent, decorators: [{
2438
+ type: Component,
2439
+ args: [{ selector: 'gloww-html-editor', providers: [
2440
+ {
2441
+ provide: NG_VALUE_ACCESSOR,
2442
+ multi: true,
2443
+ useExisting: HtmlEditorComponent
2444
+ }
2445
+ ], template: "<div>\r\n <angular-editor [(ngModel)]=\"value\" [config]=\"editorConfig\" [placeholder]=\"placeHolder\"></angular-editor>\r\n</div>\r\n<ng-template #voiceRecognitionDlg>\r\n <mat-dialog-content>\r\n <div>La reconnaissance vocale est activ\u00E9e. Veuillez dicter le texte \u00E0 ins\u00E9rer.</div>\r\n <div [innerHTML]=\"voiceRecognitionService.text | htmlFormat\" style=\"width:500px;height:300px;border:1px solid; border-color: blue;\"></div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions>\r\n <button class=\"mat-raised-button\" (click)=\"cancel()\">Close</button>\r\n <button class=\"mat-raised-button mat-primary\" (click)=\"paste()\">Paste</button>\r\n </mat-dialog-actions>\r\n</ng-template>\r\n", styles: [""] }]
2446
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }, { type: AuthenticationService }, { type: VoiceRecognitionService }, { type: i1$2.MatDialog }]; }, propDecorators: { voiceRecognitionTemplate: [{
2447
+ type: ViewChild,
2448
+ args: ['voiceRecognitionDlg']
2449
+ }], placeHolder: [{
2450
+ type: Input
2451
+ }], _value: [{
2452
+ type: Input,
2453
+ args: ['value']
2454
+ }] } });
2455
+
2456
+ class FileEditComponent {
2457
+ constructor(formBuilder, dialogRef, definition) {
2458
+ this.formBuilder = formBuilder;
2459
+ this.dialogRef = dialogRef;
2460
+ this.modes = {
2461
+ ".txt": "null",
2462
+ ".cs": "clike",
2463
+ ".js": "javascript",
2464
+ ".json": { name: "javascript", json: true },
2465
+ ".css": "css",
2466
+ ".scss": "scss",
2467
+ ".htm": "html",
2468
+ ".html": "html",
2469
+ ".xml": "xml"
2470
+ };
2471
+ this.form = this.formBuilder.group({
2472
+ path: [null, Validators.required],
2473
+ content: [null]
2474
+ });
2475
+ if (definition) {
2476
+ this.form.patchValue(definition);
2477
+ try {
2478
+ this.ext = definition.path.match(/\.(txt|js|json|ts|cs|css|scss|xml|html|htm)$/ig)[0];
2479
+ }
2480
+ catch {
2481
+ this.ext = null;
2482
+ }
2483
+ }
2484
+ }
2485
+ getMode() {
2486
+ try {
2487
+ if (this.ext && this.modes[this.ext]) {
2488
+ return this.modes[this.ext];
2489
+ }
2490
+ else {
2491
+ return "null";
2492
+ }
2493
+ }
2494
+ catch {
2495
+ return "null";
2496
+ }
2497
+ }
2498
+ ngOnInit() {
2499
+ }
2500
+ cancel() {
2501
+ this.dialogRef.close();
2502
+ }
2503
+ save() {
2504
+ this.dialogRef.close(this.form.value);
2505
+ }
2506
+ }
2507
+ FileEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileEditComponent, deps: [{ token: i1$3.FormBuilder }, { token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2508
+ FileEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: FileEditComponent, selector: "gloww-file-edit", ngImport: i0, template: "<h2 mat-dialog-title>Ajout/Edition d'un fichier</h2>\r\n\r\n<mat-dialog-content [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput [readonly]=\"true\" placeholder=\"Path\" formControlName=\"path\" style=\"width: calc(100% - 32px);\">\r\n </mat-form-field>\r\n <br />\r\n <ngx-codemirror formControlName=\"content\" [options]=\"{\r\n lineNumbers: true,\r\n theme: 'eclipse',\r\n\t\t\t\tindentWithTabs:true,\r\n\t\t\t\tindentUnit: 4,\r\n mode: getMode()\r\n }\"></ngx-codemirror>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"cancel()\">Close</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"save()\">Save</button>\r\n</mat-dialog-actions>\r\n", styles: [".cm-tab{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);background-position:right;background-repeat:no-repeat}\n"], components: [{ type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i1$4.CodemirrorComponent, selector: "ngx-codemirror", inputs: ["className", "name", "autoFocus", "options", "preserveScrollPosition"], outputs: ["cursorActivity", "focusChange", "scroll", "drop"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
2509
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileEditComponent, decorators: [{
2510
+ type: Component,
2511
+ args: [{ selector: 'gloww-file-edit', template: "<h2 mat-dialog-title>Ajout/Edition d'un fichier</h2>\r\n\r\n<mat-dialog-content [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput [readonly]=\"true\" placeholder=\"Path\" formControlName=\"path\" style=\"width: calc(100% - 32px);\">\r\n </mat-form-field>\r\n <br />\r\n <ngx-codemirror formControlName=\"content\" [options]=\"{\r\n lineNumbers: true,\r\n theme: 'eclipse',\r\n\t\t\t\tindentWithTabs:true,\r\n\t\t\t\tindentUnit: 4,\r\n mode: getMode()\r\n }\"></ngx-codemirror>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"cancel()\">Close</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"save()\">Save</button>\r\n</mat-dialog-actions>\r\n", styles: [".cm-tab{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);background-position:right;background-repeat:no-repeat}\n"] }]
2512
+ }], ctorParameters: function () { return [{ type: i1$3.FormBuilder }, { type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
2513
+ type: Inject,
2514
+ args: [MAT_DIALOG_DATA]
2515
+ }] }]; } });
2516
+
2517
+ class FolderServiceConfig {
2518
+ constructor() {
2519
+ this.apiPath = '/';
2520
+ }
2521
+ static Create(t) {
2522
+ const res = new FolderServiceConfig();
2523
+ if (t) {
2524
+ Object.assign(res, t);
2525
+ }
2526
+ return res;
2527
+ }
2528
+ }
2529
+ FolderServiceConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderServiceConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2530
+ FolderServiceConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderServiceConfig, providedIn: 'root' });
2531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderServiceConfig, decorators: [{
2532
+ type: Injectable,
2533
+ args: [{ providedIn: 'root' }]
2534
+ }] });
2535
+
2536
+ class FolderService {
2537
+ constructor(http, folderServiceConfig, apiServerUrl) {
2538
+ this.http = http;
2539
+ this.folderServiceConfig = folderServiceConfig;
2540
+ console.log(`folderServiceConfig ${folderServiceConfig.apiPath}`);
2541
+ console.log(`apiServierUrl ${apiServerUrl}`);
2542
+ }
2543
+ getDirectoryContent(path) {
2544
+ return this.http.get(`${this.folderServiceConfig.apiPath}Directories/${path ?? ""}`);
2545
+ }
2546
+ postDirectoryContent(path) {
2547
+ const formData = new FormData();
2548
+ return this.http.post(`${this.folderServiceConfig.apiPath}Directories/${path}`, formData, {});
2549
+ }
2550
+ getFileContent(path) {
2551
+ return this.http.get(`${this.folderServiceConfig.apiPath}Files/${(path ?? "").replace(/[\/\\]/g, '%2F')}`, {
2552
+ responseType: 'text'
2553
+ });
2554
+ }
2555
+ getFileContentBlob(path) {
2556
+ return this.http.get(`${this.folderServiceConfig.apiPath}Files/${(path ?? "").replace(/[\/\\]/g, '%2F')}`, {
2557
+ responseType: 'blob'
2558
+ });
2559
+ }
2560
+ postFileContent(path, formData) {
2561
+ return this.http.post(`${this.folderServiceConfig.apiPath}Files/${(path ?? "").replace(/[\/\\]/g, '%2F')}`, formData, {
2562
+ reportProgress: true,
2563
+ observe: 'events'
2564
+ });
2565
+ }
2566
+ }
2567
+ FolderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderService, deps: [{ token: i1.HttpClient }, { token: FolderServiceConfig }, { token: API_SERVER_URL, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
2568
+ FolderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderService, providedIn: 'root' });
2569
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderService, decorators: [{
2570
+ type: Injectable,
2571
+ args: [{
2572
+ providedIn: 'root'
2573
+ }]
2574
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: FolderServiceConfig }, { type: undefined, decorators: [{
2575
+ type: Optional
2576
+ }, {
2577
+ type: Inject,
2578
+ args: [API_SERVER_URL]
2579
+ }] }]; } });
2580
+
2581
+ class FoldersComponent {
2582
+ constructor(folderService, router, route, dialog) {
2583
+ //flowService.getDirectoryContent(route.snapshot.params.id).subscribe(r => this.directoryContent = r);
2584
+ this.folderService = folderService;
2585
+ this.router = router;
2586
+ this.route = route;
2587
+ this.dialog = dialog;
2588
+ this.router.events.subscribe((event) => {
2589
+ if (event instanceof NavigationEnd) {
2590
+ const urlParts = event.url.split('/');
2591
+ this.currentDir = urlParts.slice(2).join("/");
2592
+ this.directoryContent = null;
2593
+ folderService.getDirectoryContent(this.currentDir).subscribe(r => this.directoryContent = r);
2594
+ }
2595
+ });
2596
+ }
2597
+ ngOnInit() {
2598
+ }
2599
+ addFolder() {
2600
+ const dialogConfig = new MatDialogConfig();
2601
+ dialogConfig.disableClose = true;
2602
+ dialogConfig.autoFocus = true;
2603
+ dialogConfig.closeOnNavigation = false;
2604
+ dialogConfig.data = new PromptModel("New Folder", "Please give the name of the folder to create", "", true);
2605
+ this.dialog.open(PromptComponent, dialogConfig).afterClosed().subscribe(folder => {
2606
+ if (folder) {
2607
+ this.folderService.postDirectoryContent(this.currentDir + '/' + folder).subscribe(c => {
2608
+ this.router.navigate(this.getRouterLink(folder)),
2609
+ error => alert(error);
2610
+ });
2611
+ }
2612
+ });
2613
+ }
2614
+ addFile() {
2615
+ const dialogConfig = new MatDialogConfig();
2616
+ dialogConfig.disableClose = true;
2617
+ dialogConfig.autoFocus = true;
2618
+ dialogConfig.closeOnNavigation = false;
2619
+ dialogConfig.data = new PromptModel("New File", "Please give the name of the text file to create", "", true);
2620
+ this.dialog.open(PromptComponent, dialogConfig).afterClosed().subscribe(fileName => {
2621
+ if (fileName) {
2622
+ this.Edit(fileName);
2623
+ this.directoryContent = null;
2624
+ this.folderService.getDirectoryContent(this.currentDir).subscribe(r => this.directoryContent = r);
2625
+ }
2626
+ });
2627
+ }
2628
+ addFileUpload() {
2629
+ const dialogConfig = new MatDialogConfig();
2630
+ dialogConfig.disableClose = true;
2631
+ dialogConfig.autoFocus = true;
2632
+ dialogConfig.closeOnNavigation = false;
2633
+ dialogConfig.data = { acceptMime: 'image/*', multiple: true, allowAltFileName: true };
2634
+ this.dialog.open(UploadDocComponent, dialogConfig).afterClosed().subscribe(files => {
2635
+ if (files) {
2636
+ files.forEach(file => {
2637
+ const formData = new FormData();
2638
+ formData.append('file', file.data);
2639
+ this.UploadFile(this.currentDir + "/" + file.fileName, formData);
2640
+ this.directoryContent = null;
2641
+ this.folderService.getDirectoryContent(this.currentDir).subscribe(r => this.directoryContent = r);
2642
+ });
2643
+ }
2644
+ });
2645
+ }
2646
+ getRouterLink(directory) {
2647
+ if (!this.currentDir) {
2648
+ return ['/folders', directory];
2649
+ }
2650
+ if (!directory) {
2651
+ let res = ['/folders', ...this.currentDir.split("/")];
2652
+ res.pop();
2653
+ return res;
2654
+ }
2655
+ return ['/folders', ...this.currentDir.split("/"), directory];
2656
+ }
2657
+ getHref(f) {
2658
+ if (!this.currentDir) {
2659
+ return ['/FlowMgmt', 'folders', f].join('/');
2660
+ }
2661
+ return ['/FlowMgmt', 'folders', ...this.currentDir.split("/"), f].join('/');
2662
+ }
2663
+ dataURItoBlob(content) {
2664
+ const byteString = content;
2665
+ const arrayBuffer = new ArrayBuffer(byteString.length);
2666
+ const int8Array = new Uint8Array(arrayBuffer);
2667
+ for (let i = 0; i < byteString.length; i++) {
2668
+ int8Array[i] = byteString.charCodeAt(i);
2669
+ }
2670
+ const blob = new Blob([int8Array], { type: 'text/plain' });
2671
+ return blob;
2672
+ }
2673
+ isEditable(filename) {
2674
+ return filename.match(/\.(txt|js|json|ts|cs|css|scss|xml|html|htm|exp|sh|pwsh)$/ig) != null;
2675
+ }
2676
+ UploadFile(fileName, formData) {
2677
+ this.folderService.postFileContent(fileName, formData).pipe(map(event => {
2678
+ switch (event.type) {
2679
+ case HttpEventType.UploadProgress:
2680
+ //file.progress = Math.round(event.loaded * 100 / event.total);
2681
+ break;
2682
+ case HttpEventType.Response:
2683
+ return event.body;
2684
+ }
2685
+ }), catchError((error) => {
2686
+ //file.inProgress = false;
2687
+ return of(`${fileName} upload failed.`);
2688
+ })).subscribe((event) => {
2689
+ if (typeof (event) === 'object') {
2690
+ //obj.Logo = event.Logo;
2691
+ }
2692
+ });
2693
+ }
2694
+ Edit(fileName) {
2695
+ const dialogConfig = new MatDialogConfig();
2696
+ dialogConfig.disableClose = true;
2697
+ dialogConfig.autoFocus = true;
2698
+ dialogConfig.closeOnNavigation = false;
2699
+ let content;
2700
+ this.folderService.getFileContent(this.currentDir + '/' + fileName).subscribe(c => {
2701
+ dialogConfig.data = { path: this.currentDir + '/' + fileName, content: c };
2702
+ this.dialog.open(FileEditComponent, dialogConfig).afterClosed().subscribe(data => {
2703
+ if (data) {
2704
+ const formData = new FormData();
2705
+ const imageName = fileName;
2706
+ const imageBlob = this.dataURItoBlob(data.content);
2707
+ const file = new File([imageBlob], imageName, { type: 'text/plain' });
2708
+ formData.append('file', file);
2709
+ this.UploadFile(this.currentDir + '/' + fileName, formData);
2710
+ //file.inProgress = true;
2711
+ }
2712
+ });
2713
+ });
2714
+ }
2715
+ /*
2716
+ this.http.get(`${environment.apiUrl}`, {
2717
+ responseType: 'arraybuffer', headers: headers
2718
+ }
2719
+ ).subscribe(response => this.downLoadFile(response, "application/ms-excel"));*/
2720
+ downloadFile(fileName) {
2721
+ this.folderService.getFileContentBlob(this.currentDir + '/' + fileName).subscribe(blob => {
2722
+ this.downLoadFile2(blob, blob.type);
2723
+ });
2724
+ }
2725
+ /**
2726
+ * Method is use to download file.
2727
+ * @param data - Array Buffer data
2728
+ * @param type - type of the document.
2729
+ */
2730
+ downLoadFile2(data, type) {
2731
+ let blob = new Blob([data], { type: type });
2732
+ let url = window.URL.createObjectURL(blob);
2733
+ let pwa = window.open(url);
2734
+ if (!pwa || pwa.closed || typeof pwa.closed == 'undefined') {
2735
+ alert('Please disable your Pop-up blocker and try again.');
2736
+ }
2737
+ }
2738
+ }
2739
+ FoldersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FoldersComponent, deps: [{ token: FolderService }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2740
+ FoldersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: FoldersComponent, selector: "gloww-folders", ngImport: i0, template: "<h1>\r\n <i class=\"fal fa-folder\" size=\"40px\"></i> /{{currentDir}}\r\n <i class=\"fal fa-level-up\" [routerLink]=\"getRouterLink()\" *ngIf=\"currentDir\"></i>\r\n</h1>\r\n<div *ngIf=\"directoryContent else Spinner\">\r\n <i class=\"fal fa-folder-plus\" (click)=\"addFolder()\" size=\"30px\"></i>\r\n <ul>\r\n <li *ngFor=\"let d of directoryContent.directories\">\r\n <i class=\"fal fa-folder\"></i><a [routerLink]=\"getRouterLink(d)\">{{d}}</a>\r\n </li>\r\n </ul>\r\n <i class=\"fal fa-file-plus\" (click)=\"addFile()\" size=\"30px\"></i>\r\n <i class=\"fal fa-file-upload\" (click)=\"addFileUpload()\" size=\"30px\"></i>\r\n <ul>\r\n <li *ngFor=\"let f of directoryContent.files\">\r\n <a (click)=\"Edit(f)\" href=\"javascript:void(0);\" *ngIf=\"isEditable(f); else notEditable\">\r\n <i class=\"fal fa-file\"></i> {{f}}\r\n </a>\r\n <ng-template #notEditable>\r\n <i class=\"fal fa-file fa-disabled\"></i> <a (click)=\"downloadFile(f)\" target=\"_blank\" href=\"javascript:void(0);\">{{f}}</a>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n</div>\r\n<ng-template #Spinner>\r\n <mat-spinner></mat-spinner>\r\n</ng-template>", styles: ["ul{list-style:none}.fa-disabled{opacity:.6;cursor:not-allowed}i{margin:5px;height:20px}\n"], components: [{ type: i14.MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }] });
2741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FoldersComponent, decorators: [{
2742
+ type: Component,
2743
+ args: [{ selector: 'gloww-folders', template: "<h1>\r\n <i class=\"fal fa-folder\" size=\"40px\"></i> /{{currentDir}}\r\n <i class=\"fal fa-level-up\" [routerLink]=\"getRouterLink()\" *ngIf=\"currentDir\"></i>\r\n</h1>\r\n<div *ngIf=\"directoryContent else Spinner\">\r\n <i class=\"fal fa-folder-plus\" (click)=\"addFolder()\" size=\"30px\"></i>\r\n <ul>\r\n <li *ngFor=\"let d of directoryContent.directories\">\r\n <i class=\"fal fa-folder\"></i><a [routerLink]=\"getRouterLink(d)\">{{d}}</a>\r\n </li>\r\n </ul>\r\n <i class=\"fal fa-file-plus\" (click)=\"addFile()\" size=\"30px\"></i>\r\n <i class=\"fal fa-file-upload\" (click)=\"addFileUpload()\" size=\"30px\"></i>\r\n <ul>\r\n <li *ngFor=\"let f of directoryContent.files\">\r\n <a (click)=\"Edit(f)\" href=\"javascript:void(0);\" *ngIf=\"isEditable(f); else notEditable\">\r\n <i class=\"fal fa-file\"></i> {{f}}\r\n </a>\r\n <ng-template #notEditable>\r\n <i class=\"fal fa-file fa-disabled\"></i> <a (click)=\"downloadFile(f)\" target=\"_blank\" href=\"javascript:void(0);\">{{f}}</a>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n</div>\r\n<ng-template #Spinner>\r\n <mat-spinner></mat-spinner>\r\n</ng-template>", styles: ["ul{list-style:none}.fa-disabled{opacity:.6;cursor:not-allowed}i{margin:5px;height:20px}\n"] }]
2744
+ }], ctorParameters: function () { return [{ type: FolderService }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i1$2.MatDialog }]; } });
2745
+
2746
+ class DownloadProgressComponent {
2747
+ constructor(dialogRef, arg, httpClient) {
2748
+ this.dialogRef = dialogRef;
2749
+ this.httpClient = httpClient;
2750
+ this.done = -1;
2751
+ this.name = arg.name;
2752
+ this.files = arg.files;
2753
+ this.current = [];
2754
+ this.message = "Donwload des fichiers";
2755
+ this.percent = -1;
2756
+ }
2757
+ ngOnInit() {
2758
+ if (this.name) {
2759
+ this.downloadZip();
2760
+ }
2761
+ else {
2762
+ this.download();
2763
+ }
2764
+ }
2765
+ async getFile(url, callback) {
2766
+ const httpOptions = {
2767
+ observe: "events",
2768
+ reportProgress: true,
2769
+ responseType: "blob" //as 'json'
2770
+ };
2771
+ const res = await this.httpClient.get(url, httpOptions).pipe(map((event) => {
2772
+ console.log(event);
2773
+ /*if (event.type === HttpEventType.DownloadProgress) {
2774
+ console.log(`download progress ${(event as HttpEventType.DownloadProgress).valueOf}`);
2775
+ }
2776
+ if (event.type === HttpEventType.Response) {
2777
+ console.log("donwload completed");
2778
+ }*/
2779
+ if (event.type === 3) {
2780
+ callback(url, event.loaded, event.total);
2781
+ }
2782
+ if (event instanceof HttpResponse) {
2783
+ callback(url, -1, -1);
2784
+ }
2785
+ return event;
2786
+ }), filter((event) => event instanceof HttpResponse)).toPromise().catch((err) => {
2787
+ const error = err.error;
2788
+ return error;
2789
+ });
2790
+ return res.body;
2791
+ }
2792
+ callback(url, loaded, total) {
2793
+ const index = this.current.findIndex(c => c.url === url);
2794
+ if (total === -1) {
2795
+ this.done += 1;
2796
+ this.current.splice(index, 1);
2797
+ }
2798
+ else {
2799
+ if (index === -1) {
2800
+ this.current.push({ url, loaded, total });
2801
+ }
2802
+ else {
2803
+ this.current[index].loaded = loaded;
2804
+ }
2805
+ }
2806
+ }
2807
+ callback_zip(metadata) {
2808
+ this.percent = metadata.percent;
2809
+ }
2810
+ async downloadZip() {
2811
+ const zip = new JSZip();
2812
+ // tslint:disable-next-line:prefer-for-of
2813
+ this.done = 0;
2814
+ await Promise.all(this.files.map(async (file) => {
2815
+ let fileData;
2816
+ fileData = await this.getFile(file.url, this.callback.bind(this));
2817
+ const b = new Blob([fileData], { type: '' + fileData.type + '' });
2818
+ zip.file(file.name, b);
2819
+ }));
2820
+ this.message = "Génération du fichier Zip";
2821
+ this.done = -1;
2822
+ await zip.generateAsync({ type: 'blob' }, this.callback_zip.bind(this)).then((content) => {
2823
+ if (content) {
2824
+ FileSaver.saveAs(content, this.name);
2825
+ }
2826
+ });
2827
+ this.dialogRef.close();
2828
+ }
2829
+ async download() {
2830
+ const zip = new JSZip();
2831
+ // tslint:disable-next-line:prefer-for-of
2832
+ this.done = 0;
2833
+ await Promise.all(this.files.map(async (file) => {
2834
+ let fileData;
2835
+ fileData = await this.getFile(file.url, this.callback.bind(this));
2836
+ const b = new Blob([fileData], { type: '' + fileData.type + '' });
2837
+ FileSaver.saveAs(b, file.name);
2838
+ }));
2839
+ this.message = "Génération du fichier Zip";
2840
+ this.done = -1;
2841
+ this.dialogRef.close();
2842
+ }
2843
+ }
2844
+ DownloadProgressComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DownloadProgressComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Component });
2845
+ DownloadProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DownloadProgressComponent, selector: "gloww-download-progress", ngImport: i0, template: "<h2 mat-dialog-title>Progression Donwload</h2>\r\n\r\n<mat-dialog-content>\r\n <H3>{{message}}</H3>\r\n <mat-progress-bar [value]=\"percent\" *ngIf=\"percent>0\"></mat-progress-bar>\r\n <div *ngIf=\"done>=0\">\r\n <mat-progress-bar [value]=\"done*100/files.length\"></mat-progress-bar> {{done}}/{{files.length}}\r\n <br />\r\n <ul>\r\n <li *ngFor=\" let file of current; index as i\">\r\n <span id=\"file-label\">{{file.url}}</span>\r\n <mat-progress-bar [value]=\"file.loaded*100/file.total\"></mat-progress-bar>\r\n </li>\r\n </ul>\r\n </div>\r\n</mat-dialog-content>\r\n\r\n\r\n<mat-dialog-actions>\r\n <!--<button class=\"mat-raised-button\" (click)=\"cancel()\">Close</button>\r\n\t<button class=\"mat-raised-button mat-primary\" (click)=\"save()\">Save</button>-->\r\n</mat-dialog-actions>", styles: [""], components: [{ type: i2$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
2846
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DownloadProgressComponent, decorators: [{
2847
+ type: Component,
2848
+ args: [{ selector: 'gloww-download-progress', template: "<h2 mat-dialog-title>Progression Donwload</h2>\r\n\r\n<mat-dialog-content>\r\n <H3>{{message}}</H3>\r\n <mat-progress-bar [value]=\"percent\" *ngIf=\"percent>0\"></mat-progress-bar>\r\n <div *ngIf=\"done>=0\">\r\n <mat-progress-bar [value]=\"done*100/files.length\"></mat-progress-bar> {{done}}/{{files.length}}\r\n <br />\r\n <ul>\r\n <li *ngFor=\" let file of current; index as i\">\r\n <span id=\"file-label\">{{file.url}}</span>\r\n <mat-progress-bar [value]=\"file.loaded*100/file.total\"></mat-progress-bar>\r\n </li>\r\n </ul>\r\n </div>\r\n</mat-dialog-content>\r\n\r\n\r\n<mat-dialog-actions>\r\n <!--<button class=\"mat-raised-button\" (click)=\"cancel()\">Close</button>\r\n\t<button class=\"mat-raised-button mat-primary\" (click)=\"save()\">Save</button>-->\r\n</mat-dialog-actions>", styles: [""] }]
2849
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
2850
+ type: Inject,
2851
+ args: [MAT_DIALOG_DATA]
2852
+ }] }, { type: i1.HttpClient }]; } });
2853
+
2854
+ class SecureAComponent {
2855
+ constructor(dialog) {
2856
+ this.dialog = dialog;
2857
+ }
2858
+ ngOnInit() {
2859
+ }
2860
+ click() {
2861
+ const dialogConfig = new MatDialogConfig();
2862
+ dialogConfig.disableClose = true;
2863
+ dialogConfig.autoFocus = true;
2864
+ dialogConfig.closeOnNavigation = false;
2865
+ dialogConfig.data = { files: [{ url: this.href, name: this.name }] };
2866
+ this.dialog.open(DownloadProgressComponent, dialogConfig).afterClosed().subscribe();
2867
+ }
2868
+ }
2869
+ SecureAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecureAComponent, deps: [{ token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2870
+ SecureAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SecureAComponent, selector: "gloww-secure-a", inputs: { href: "href", name: "name" }, ngImport: i0, template: "<a (click)=\"click()\" href=\"javascript:void(0);\">\r\n <ng-content></ng-content>\r\n</a>", styles: [""] });
2871
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecureAComponent, decorators: [{
2872
+ type: Component,
2873
+ args: [{ selector: 'gloww-secure-a', template: "<a (click)=\"click()\" href=\"javascript:void(0);\">\r\n <ng-content></ng-content>\r\n</a>", styles: [""] }]
2874
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialog }]; }, propDecorators: { href: [{
2875
+ type: Input
2876
+ }], name: [{
2877
+ type: Input
2878
+ }] } });
2879
+
2880
+ class GlowwModule {
2881
+ static forRoot(folderServiceConfig) {
2882
+ console.log(`forRoot ${folderServiceConfig}`);
2883
+ return {
2884
+ ngModule: GlowwModule,
2885
+ providers: [
2886
+ VersionCheckService,
2887
+ NavService,
2888
+ VoiceRecognitionService,
2889
+ {
2890
+ provide: FolderServiceConfig,
2891
+ useValue: folderServiceConfig
2892
+ }
2893
+ ]
2894
+ };
2895
+ }
2896
+ }
2897
+ GlowwModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2898
+ GlowwModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwModule, declarations: [UploadDocComponent,
2899
+ SafeHtmlPipe,
2900
+ DisplayObjectsComponent,
2901
+ HeaderComponent,
2902
+ ResultTableComponent,
2903
+ SearchFormComponent,
2904
+ ConfirmationComponent,
2905
+ PromptComponent,
2906
+ SecurePipe,
2907
+ SecureImgComponent,
2908
+ MenuListItemComponent,
2909
+ CodeEditorComponent,
2910
+ HtmlEditorComponent,
2911
+ HtmlFormatPipe,
2912
+ UploadFileComponent,
2913
+ FileSinkDirective,
2914
+ FileEditComponent,
2915
+ FoldersComponent,
2916
+ DownloadProgressComponent,
2917
+ SecureAComponent], imports: [CommonModule,
2918
+ BrowserModule,
2919
+ RouterModule,
2920
+ FormsModule,
2921
+ ReactiveFormsModule,
2922
+ MatDialogModule,
2923
+ MatInputModule,
2924
+ MatIconModule,
2925
+ MatButtonModule,
2926
+ MatCardModule,
2927
+ MatProgressSpinnerModule,
2928
+ MatProgressBarModule,
2929
+ MatTableModule,
2930
+ MatSelectModule,
2931
+ MatPaginatorModule,
2932
+ MatSortModule,
2933
+ MatProgressSpinnerModule,
2934
+ CodemirrorModule,
2935
+ AngularEditorModule], exports: [SafeHtmlPipe,
2936
+ UploadDocComponent,
2937
+ UploadFileComponent,
2938
+ DisplayObjectsComponent,
2939
+ HeaderComponent,
2940
+ ResultTableComponent,
2941
+ SearchFormComponent,
2942
+ ConfirmationComponent,
2943
+ PromptComponent,
2944
+ SecurePipe,
2945
+ SecureImgComponent,
2946
+ MenuListItemComponent,
2947
+ CodeEditorComponent,
2948
+ HtmlEditorComponent,
2949
+ HtmlFormatPipe,
2950
+ FoldersComponent,
2951
+ DownloadProgressComponent,
2952
+ SecureAComponent] });
2953
+ GlowwModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwModule, providers: [], imports: [[
2954
+ CommonModule,
2955
+ BrowserModule,
2956
+ RouterModule,
2957
+ FormsModule,
2958
+ ReactiveFormsModule,
2959
+ MatDialogModule,
2960
+ MatInputModule,
2961
+ MatIconModule,
2962
+ MatButtonModule,
2963
+ MatCardModule,
2964
+ MatProgressSpinnerModule,
2965
+ MatProgressBarModule,
2966
+ MatTableModule,
2967
+ MatSelectModule,
2968
+ MatPaginatorModule,
2969
+ MatSortModule,
2970
+ MatProgressSpinnerModule,
2971
+ CodemirrorModule,
2972
+ AngularEditorModule
2973
+ ]] });
2974
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwModule, decorators: [{
2975
+ type: NgModule,
2976
+ args: [{
2977
+ declarations: [
2978
+ UploadDocComponent,
2979
+ SafeHtmlPipe,
2980
+ DisplayObjectsComponent,
2981
+ HeaderComponent,
2982
+ ResultTableComponent,
2983
+ SearchFormComponent,
2984
+ ConfirmationComponent,
2985
+ PromptComponent,
2986
+ SecurePipe,
2987
+ SecureImgComponent,
2988
+ MenuListItemComponent,
2989
+ CodeEditorComponent,
2990
+ HtmlEditorComponent,
2991
+ HtmlFormatPipe,
2992
+ UploadFileComponent,
2993
+ FileSinkDirective,
2994
+ FileEditComponent,
2995
+ FoldersComponent,
2996
+ DownloadProgressComponent,
2997
+ SecureAComponent,
2998
+ ],
2999
+ imports: [
3000
+ CommonModule,
3001
+ BrowserModule,
3002
+ RouterModule,
3003
+ FormsModule,
3004
+ ReactiveFormsModule,
3005
+ MatDialogModule,
3006
+ MatInputModule,
3007
+ MatIconModule,
3008
+ MatButtonModule,
3009
+ MatCardModule,
3010
+ MatProgressSpinnerModule,
3011
+ MatProgressBarModule,
3012
+ MatTableModule,
3013
+ MatSelectModule,
3014
+ MatPaginatorModule,
3015
+ MatSortModule,
3016
+ MatProgressSpinnerModule,
3017
+ CodemirrorModule,
3018
+ AngularEditorModule
3019
+ ],
3020
+ providers: [],
3021
+ exports: [
3022
+ SafeHtmlPipe,
3023
+ UploadDocComponent,
3024
+ UploadFileComponent,
3025
+ DisplayObjectsComponent,
3026
+ HeaderComponent,
3027
+ ResultTableComponent,
3028
+ SearchFormComponent,
3029
+ ConfirmationComponent,
3030
+ PromptComponent,
3031
+ SecurePipe,
3032
+ SecureImgComponent,
3033
+ MenuListItemComponent,
3034
+ CodeEditorComponent,
3035
+ HtmlEditorComponent,
3036
+ HtmlFormatPipe,
3037
+ FoldersComponent,
3038
+ DownloadProgressComponent,
3039
+ SecureAComponent
3040
+ ]
3041
+ }]
3042
+ }] });
3043
+
3044
+ class GlowwSecurityService {
3045
+ constructor() { }
3046
+ }
3047
+ GlowwSecurityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3048
+ GlowwSecurityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityService, providedIn: 'root' });
3049
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityService, decorators: [{
3050
+ type: Injectable,
3051
+ args: [{
3052
+ providedIn: 'root'
3053
+ }]
3054
+ }], ctorParameters: function () { return []; } });
3055
+
3056
+ /*
3057
+ * Public API Surface of gloww
3058
+ */
3059
+
3060
+ /**
3061
+ * Generated bundle index. Do not edit.
3062
+ */
3063
+
3064
+ export { API_SERVER_URL, AdministratorGuard, AuthGuard, AuthenticationService, AuthenticationServiceConfig, ChangePasswordDlgComponent, CodeEditorComponent, ConfirmationComponent, ConfirmationModel, DialogService, DisplayObjectsComponent, DownloadProgressComponent, ErrorInterceptor, FolderServiceConfig, FoldersComponent, GLOWW_APPLI, GlowwModule, GlowwSecurityModule, GlowwSecurityService, GlowwService, HeaderComponent, HtmlEditorComponent, HtmlFormatPipe, JwtInterceptor, LoginComponent, MenuListItemComponent, NavService, PromptComponent, PromptModel, ResultTableComponent, SafeHtmlPipe, SearchFormComponent, SecureAComponent, SecureImgComponent, SecurePipe, StagingInterceptor, UploadDocComponent, UploadFileComponent, UserMenuComponent, VersionCheckService, VoiceRecognitionService };
3065
+ //# sourceMappingURL=gloww-gloww.mjs.map