monkey-front-core 0.0.36 → 0.0.37

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 (257) hide show
  1. package/README.md +24 -24
  2. package/esm2020/lib/components/closed-to-maintenance/closed-to-maintenance.component.mjs +29 -0
  3. package/{esm2015/lib/components/closed-to-maintenance/closed-to-maintenance.module.js → esm2020/lib/components/closed-to-maintenance/closed-to-maintenance.module.mjs} +5 -5
  4. package/{esm2015/lib/components/closed-to-maintenance/index.js → esm2020/lib/components/closed-to-maintenance/index.mjs} +1 -1
  5. package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +0 -0
  6. package/{esm2015/lib/components/progress-bar/index.js → esm2020/lib/components/progress-bar/index.mjs} +1 -1
  7. package/esm2020/lib/components/progress-bar/progress-bar.component.mjs +23 -0
  8. package/{esm2015/lib/components/progress-bar/progress-bar.module.js → esm2020/lib/components/progress-bar/progress-bar.module.mjs} +5 -5
  9. package/esm2020/lib/components/progress-bar/progress-bar.service.mjs +50 -0
  10. package/{esm2015/lib/components/version-changed/index.js → esm2020/lib/components/version-changed/index.mjs} +1 -1
  11. package/esm2020/lib/components/version-changed/version-changed.component.mjs +24 -0
  12. package/{esm2015/lib/components/version-changed/version-changed.module.js → esm2020/lib/components/version-changed/version-changed.module.mjs} +5 -5
  13. package/esm2020/lib/core/decorators/index.mjs +5 -0
  14. package/esm2020/lib/core/decorators/monkeyecx-charts-decorators.mjs +40 -0
  15. package/esm2020/lib/core/decorators/monkeyecx-decorators.mjs +111 -0
  16. package/esm2020/lib/core/decorators/monkeyecx-download-decorators.mjs +26 -0
  17. package/esm2020/lib/core/decorators/monkeyecx-upload-decorators.mjs +26 -0
  18. package/{esm2015/lib/core/directives/index.js → esm2020/lib/core/directives/index.mjs} +1 -1
  19. package/{esm2015/lib/core/directives/monkeyecx-directives-module.js → esm2020/lib/core/directives/monkeyecx-directives-module.mjs} +10 -10
  20. package/esm2020/lib/core/directives/monkeyecx-drag-drop.mjs +57 -0
  21. package/esm2020/lib/core/directives/monkeyecx-feature-directive.mjs +68 -0
  22. package/{esm2015/lib/core/directives/monkeyecx-format-currency.js → esm2020/lib/core/directives/monkeyecx-format-currency.mjs} +4 -4
  23. package/esm2020/lib/core/directives/monkeyecx-format-upper.mjs +67 -0
  24. package/{esm2015/lib/core/directives/monkeyecx-only-alpha-numeric-directive.js → esm2020/lib/core/directives/monkeyecx-only-alpha-numeric-directive.mjs} +4 -4
  25. package/{esm2015/lib/core/directives/monkeyecx-only-number-directive.js → esm2020/lib/core/directives/monkeyecx-only-number-directive.mjs} +4 -4
  26. package/esm2020/lib/core/directives/monkeyecx-security-directive.mjs +69 -0
  27. package/esm2020/lib/core/directives/monkeyecx-tooltip-directive.mjs +123 -0
  28. package/{esm2015/lib/core/index.js → esm2020/lib/core/index.mjs} +1 -1
  29. package/{esm2015/lib/core/interceptors/index.js → esm2020/lib/core/interceptors/index.mjs} +1 -1
  30. package/esm2020/lib/core/interceptors/monkeyecx-http-config-error.interceptor.mjs +39 -0
  31. package/esm2020/lib/core/interceptors/monkeyecx-http-config-header.interceptor.mjs +32 -0
  32. package/{esm2015/lib/core/interceptors/monkeyecx-http-config-interceptor.module.js → esm2020/lib/core/interceptors/monkeyecx-http-config-interceptor.module.mjs} +5 -5
  33. package/esm2020/lib/core/interceptors/monkeyecx-http-config-loading-in-progress.interceptor.mjs +43 -0
  34. package/esm2020/lib/core/interceptors/monkeyecx-http-config-queue.interceptor.mjs +37 -0
  35. package/{esm2015/lib/core/interfaces/index.js → esm2020/lib/core/interfaces/index.mjs} +1 -1
  36. package/esm2020/lib/core/interfaces/monkeyecx-auth-credentials.mjs +2 -0
  37. package/{esm2015/lib/core/interfaces/monkeyecx-company.js → esm2020/lib/core/interfaces/monkeyecx-company.mjs} +1 -1
  38. package/esm2020/lib/core/interfaces/monkeyecx-config-boostrap.mjs +2 -0
  39. package/esm2020/lib/core/interfaces/monkeyecx-config.mjs +2 -0
  40. package/{esm2015/lib/core/interfaces/monkeyecx-error-response.js → esm2020/lib/core/interfaces/monkeyecx-error-response.mjs} +1 -1
  41. package/{esm2015/lib/core/interfaces/monkeyecx-handled-error-response.js → esm2020/lib/core/interfaces/monkeyecx-handled-error-response.mjs} +1 -1
  42. package/{esm2015/lib/core/interfaces/monkeyecx-header-credentials.js → esm2020/lib/core/interfaces/monkeyecx-header-credentials.mjs} +1 -1
  43. package/{esm2015/lib/core/interfaces/monkeyecx-intercom-options.js → esm2020/lib/core/interfaces/monkeyecx-intercom-options.mjs} +1 -1
  44. package/esm2020/lib/core/interfaces/monkeyecx-me-credentials.mjs +2 -0
  45. package/esm2020/lib/core/interfaces/monkeyecx-navigation.mjs +2 -0
  46. package/{esm2015/lib/core/interfaces/monkeyecx-program.js → esm2020/lib/core/interfaces/monkeyecx-program.mjs} +1 -1
  47. package/{esm2015/lib/core/interfaces/monkeyecx-releases.js → esm2020/lib/core/interfaces/monkeyecx-releases.mjs} +1 -1
  48. package/{esm2015/lib/core/interfaces/monkeyecx-request-in-progress.js → esm2020/lib/core/interfaces/monkeyecx-request-in-progress.mjs} +1 -1
  49. package/esm2020/lib/core/interfaces/monkeyecx-request-paged.mjs +2 -0
  50. package/{esm2015/lib/core/interfaces/monkeyecx-response-paged.js → esm2020/lib/core/interfaces/monkeyecx-response-paged.mjs} +1 -1
  51. package/esm2020/lib/core/interfaces/monkeyecx-service-credentials.mjs +2 -0
  52. package/esm2020/lib/core/interfaces/monkeyecx-token-credentials.mjs +2 -0
  53. package/{esm2015/lib/core/interfaces/monkeyecx-translate-options.js → esm2020/lib/core/interfaces/monkeyecx-translate-options.mjs} +1 -1
  54. package/{esm2015/lib/core/interfaces/request-download/index.js → esm2020/lib/core/interfaces/request-download/index.mjs} +1 -1
  55. package/esm2020/lib/core/interfaces/request-download/monkeyecx-request-download.mjs +2 -0
  56. package/{esm2015/lib/core/interfaces/request-download/monkeyecx-request-downloaded.js → esm2020/lib/core/interfaces/request-download/monkeyecx-request-downloaded.mjs} +1 -1
  57. package/{esm2015/lib/core/interfaces/request-download/monkeyecx-request-item-download.js → esm2020/lib/core/interfaces/request-download/monkeyecx-request-item-download.mjs} +1 -1
  58. package/{esm2015/lib/core/interfaces/request-queue/index.js → esm2020/lib/core/interfaces/request-queue/index.mjs} +1 -1
  59. package/{esm2015/lib/core/interfaces/request-queue/monkeyecx-request-item-queue.js → esm2020/lib/core/interfaces/request-queue/monkeyecx-request-item-queue.mjs} +1 -1
  60. package/{esm2015/lib/core/interfaces/request-queue/monkeyecx-request-progress-queue.js → esm2020/lib/core/interfaces/request-queue/monkeyecx-request-progress-queue.mjs} +1 -1
  61. package/esm2020/lib/core/interfaces/request-queue/monkeyecx-request-queue.mjs +2 -0
  62. package/{esm2015/lib/core/interfaces/request-upload/index.js → esm2020/lib/core/interfaces/request-upload/index.mjs} +1 -1
  63. package/{esm2015/lib/core/interfaces/request-upload/monkeyecx-request-item-upload.js → esm2020/lib/core/interfaces/request-upload/monkeyecx-request-item-upload.mjs} +1 -1
  64. package/{esm2015/lib/core/interfaces/request-upload/monkeyecx-request-upload.js → esm2020/lib/core/interfaces/request-upload/monkeyecx-request-upload.mjs} +1 -1
  65. package/{esm2015/lib/core/interfaces/schedules/index.js → esm2020/lib/core/interfaces/schedules/index.mjs} +1 -1
  66. package/esm2020/lib/core/interfaces/schedules/monkeyecx-request-schedule.mjs +2 -0
  67. package/{esm2015/lib/core/model/index.js → esm2020/lib/core/model/index.mjs} +1 -1
  68. package/{esm2015/lib/core/model/monkeyecx-model.js → esm2020/lib/core/model/monkeyecx-model.mjs} +1 -1
  69. package/esm2020/lib/core/pipes/index.mjs +16 -0
  70. package/esm2020/lib/core/pipes/monkeyecx-display-first-name.mjs +19 -0
  71. package/esm2020/lib/core/pipes/monkeyecx-format-address.mjs +20 -0
  72. package/esm2020/lib/core/pipes/monkeyecx-format-currency.mjs +27 -0
  73. package/esm2020/lib/core/pipes/monkeyecx-format-date-timelapse.mjs +31 -0
  74. package/esm2020/lib/core/pipes/monkeyecx-format-date.mjs +29 -0
  75. package/esm2020/lib/core/pipes/monkeyecx-format-document.mjs +19 -0
  76. package/esm2020/lib/core/pipes/monkeyecx-format-number.mjs +20 -0
  77. package/esm2020/lib/core/pipes/monkeyecx-format-phone.mjs +42 -0
  78. package/esm2020/lib/core/pipes/monkeyecx-format-size.mjs +20 -0
  79. package/esm2020/lib/core/pipes/monkeyecx-format-type-document.mjs +19 -0
  80. package/esm2020/lib/core/pipes/monkeyecx-format-value.mjs +19 -0
  81. package/esm2020/lib/core/pipes/monkeyecx-format-zipcode.mjs +19 -0
  82. package/esm2020/lib/core/pipes/monkeyecx-pipes.module.mjs +87 -0
  83. package/esm2020/lib/core/pipes/monkeyecx-text-truncate.mjs +23 -0
  84. package/{esm2015/lib/core/pipes/monkeyecx-truncate-qtd.js → esm2020/lib/core/pipes/monkeyecx-truncate-qtd.mjs} +4 -4
  85. package/{esm2015/lib/core/services/auth/index.js → esm2020/lib/core/services/auth/index.mjs} +1 -1
  86. package/{esm2015/lib/core/services/auth/monkeyecx-auth-guard-login.service.js → esm2020/lib/core/services/auth/monkeyecx-auth-guard-login.service.mjs} +4 -4
  87. package/{esm2015/lib/core/services/auth/monkeyecx-auth-guard.service.js → esm2020/lib/core/services/auth/monkeyecx-auth-guard.service.mjs} +4 -4
  88. package/esm2020/lib/core/services/auth/monkeyecx-authentication.service.mjs +61 -0
  89. package/{esm2015/lib/core/services/commons/index.js → esm2020/lib/core/services/commons/index.mjs} +1 -1
  90. package/esm2020/lib/core/services/commons/monkeyecx-commons.service.mjs +269 -0
  91. package/{esm2015/lib/core/services/config/monkeyecx-config.module.js → esm2020/lib/core/services/config/monkeyecx-config.module.mjs} +5 -5
  92. package/esm2020/lib/core/services/config/monkeyecx-config.service.mjs +108 -0
  93. package/esm2020/lib/core/services/config/monkeyecx-error-config.service.mjs +85 -0
  94. package/esm2020/lib/core/services/config/monkeyecx-feature-toggle.service.mjs +65 -0
  95. package/esm2020/lib/core/services/config/monkeyecx-i18n-config.service.mjs +66 -0
  96. package/esm2020/lib/core/services/config/monkeyecx-logs-config.service.mjs +34 -0
  97. package/{esm2015/lib/core/services/config/monkeyecx-maintenance-config.service.js → esm2020/lib/core/services/config/monkeyecx-maintenance-config.service.mjs} +5 -5
  98. package/esm2020/lib/core/services/config/monkeyecx-security-console-config.service.mjs +42 -0
  99. package/esm2020/lib/core/services/config/monkeyecx-service-worker-config.service.mjs +53 -0
  100. package/{esm2015/lib/core/services/error/index.js → esm2020/lib/core/services/error/index.mjs} +1 -1
  101. package/{esm2015/lib/core/services/error/monkeyecx-error-handling.module.js → esm2020/lib/core/services/error/monkeyecx-error-handling.module.mjs} +5 -5
  102. package/esm2020/lib/core/services/error/monkeyecx-error-handling.service.mjs +41 -0
  103. package/esm2020/lib/core/services/error/monkeyecx-http-error-handling.service.mjs +128 -0
  104. package/{esm2015/lib/core/services/error/monkeyecx-others-errors-handling.service.js → esm2020/lib/core/services/error/monkeyecx-others-errors-handling.service.mjs} +4 -4
  105. package/esm2020/lib/core/services/index.mjs +24 -0
  106. package/{esm2015/lib/core/services/logged/index.js → esm2020/lib/core/services/logged/index.mjs} +1 -1
  107. package/{esm2015/lib/core/services/logged/monkeyecx-logged-handling.service.js → esm2020/lib/core/services/logged/monkeyecx-logged-handling.service.mjs} +4 -4
  108. package/esm2020/lib/core/services/monkeyecx-handling.service.mjs +50 -0
  109. package/esm2020/lib/core/services/monkeyecx-service.service.mjs +104 -0
  110. package/{esm2015/lib/core/services/request-download/index.js → esm2020/lib/core/services/request-download/index.mjs} +1 -1
  111. package/esm2020/lib/core/services/request-download/monkeyecx-request-download-handling.service.mjs +93 -0
  112. package/esm2020/lib/core/services/request-download/monkeyecx-request-downloaded-handling.service.mjs +61 -0
  113. package/{esm2015/lib/core/services/request-paged/index.js → esm2020/lib/core/services/request-paged/index.mjs} +1 -1
  114. package/esm2020/lib/core/services/request-paged/monkeyecx-request-request-paged-handling.mjs +30 -0
  115. package/{esm2015/lib/core/services/request-queue/index.js → esm2020/lib/core/services/request-queue/index.mjs} +1 -1
  116. package/esm2020/lib/core/services/request-queue/monkeyecx-request-queue-handling.service.mjs +114 -0
  117. package/esm2020/lib/core/services/request-queue/monkeyecx-request-queue-modal-handling.service.mjs +119 -0
  118. package/{esm2015/lib/core/services/routes/index.js → esm2020/lib/core/services/routes/index.mjs} +1 -1
  119. package/{esm2015/lib/core/services/routes/monkeyecx-dicovery-params.service.js → esm2020/lib/core/services/routes/monkeyecx-dicovery-params.service.mjs} +6 -6
  120. package/{esm2015/lib/core/services/schedules/index.js → esm2020/lib/core/services/schedules/index.mjs} +1 -1
  121. package/esm2020/lib/core/services/schedules/monkeyecx-request-schedule.service.mjs +127 -0
  122. package/{esm2015/lib/core/services/storage/index.js → esm2020/lib/core/services/storage/index.mjs} +1 -1
  123. package/{esm2015/lib/core/services/storage/monkeyecx-cookie-storage.service.js → esm2020/lib/core/services/storage/monkeyecx-cookie-storage.service.mjs} +5 -5
  124. package/esm2020/lib/core/services/storage/monkeyecx-token-storage.service.mjs +122 -0
  125. package/{esm2015/lib/core/specification-search/index.js → esm2020/lib/core/specification-search/index.mjs} +1 -1
  126. package/esm2020/lib/core/specification-search/monkeyecx-specification-search.mjs +97 -0
  127. package/esm2020/lib/core/utils/decorators-utils.mjs +40 -0
  128. package/{esm2015/lib/core/utils/index.js → esm2020/lib/core/utils/index.mjs} +1 -1
  129. package/{esm2015/lib/core/utils/statics.js → esm2020/lib/core/utils/statics.mjs} +1 -1
  130. package/esm2020/lib/core/utils/utils.mjs +218 -0
  131. package/esm2020/lib/core/utils/validate-utils.mjs +204 -0
  132. package/esm2020/lib/core/utils/validators.mjs +193 -0
  133. package/esm2020/lib/monkey-front-core.module.mjs +62 -0
  134. package/{esm2015/monkey-front-core.js → esm2020/monkey-front-core.mjs} +0 -0
  135. package/{esm2015/public-api.js → esm2020/public-api.mjs} +1 -1
  136. package/fesm2015/{monkey-front-core.js → monkey-front-core.mjs} +704 -516
  137. package/fesm2015/monkey-front-core.mjs.map +1 -0
  138. package/fesm2020/monkey-front-core.mjs +4217 -0
  139. package/fesm2020/monkey-front-core.mjs.map +1 -0
  140. package/lib/components/closed-to-maintenance/closed-to-maintenance.component.d.ts +2 -2
  141. package/lib/components/progress-bar/progress-bar.service.d.ts +1 -1
  142. package/lib/components/version-changed/version-changed.component.d.ts +1 -1
  143. package/lib/core/decorators/index.d.ts +1 -0
  144. package/lib/core/decorators/monkeyecx-charts-decorators.d.ts +1 -0
  145. package/lib/core/directives/monkeyecx-directives-module.d.ts +1 -1
  146. package/lib/core/directives/monkeyecx-feature-directive.d.ts +4 -4
  147. package/lib/core/directives/monkeyecx-format-upper.d.ts +2 -2
  148. package/lib/core/directives/monkeyecx-security-directive.d.ts +1 -1
  149. package/lib/core/directives/monkeyecx-tooltip-directive.d.ts +5 -5
  150. package/lib/core/interfaces/monkeyecx-service-credentials.d.ts +2 -1
  151. package/lib/core/interfaces/request-download/monkeyecx-request-download.d.ts +1 -1
  152. package/lib/core/interfaces/request-download/monkeyecx-request-item-download.d.ts +1 -1
  153. package/lib/core/interfaces/request-queue/monkeyecx-request-queue.d.ts +1 -1
  154. package/lib/core/interfaces/request-upload/monkeyecx-request-item-upload.d.ts +1 -1
  155. package/lib/core/interfaces/request-upload/monkeyecx-request-upload.d.ts +1 -1
  156. package/lib/core/model/monkeyecx-model.d.ts +1 -1
  157. package/lib/core/pipes/index.d.ts +3 -0
  158. package/lib/core/pipes/monkeyecx-display-first-name.d.ts +0 -1
  159. package/lib/core/pipes/monkeyecx-format-address.d.ts +14 -0
  160. package/lib/core/pipes/monkeyecx-format-currency.d.ts +1 -3
  161. package/lib/core/pipes/monkeyecx-format-date-timelapse.d.ts +1 -2
  162. package/lib/core/pipes/monkeyecx-format-date.d.ts +7 -0
  163. package/lib/core/pipes/monkeyecx-format-document.d.ts +0 -1
  164. package/lib/core/pipes/monkeyecx-format-number.d.ts +3 -4
  165. package/lib/core/pipes/monkeyecx-format-phone.d.ts +7 -0
  166. package/lib/core/pipes/monkeyecx-format-size.d.ts +0 -1
  167. package/lib/core/pipes/monkeyecx-format-type-document.d.ts +3 -4
  168. package/lib/core/pipes/monkeyecx-format-value.d.ts +0 -1
  169. package/lib/core/pipes/monkeyecx-format-zipcode.d.ts +0 -1
  170. package/lib/core/pipes/monkeyecx-pipes.module.d.ts +14 -11
  171. package/lib/core/pipes/monkeyecx-text-truncate.d.ts +0 -1
  172. package/lib/core/services/auth/monkeyecx-authentication.service.d.ts +6 -6
  173. package/lib/core/services/commons/monkeyecx-commons.service.d.ts +27 -27
  174. package/lib/core/services/config/monkeyecx-config.service.d.ts +1 -1
  175. package/lib/core/services/config/monkeyecx-i18n-config.service.d.ts +0 -1
  176. package/lib/core/services/config/monkeyecx-maintenance-config.service.d.ts +1 -1
  177. package/lib/core/services/index.d.ts +13 -3
  178. package/lib/core/services/monkeyecx-handling.service.d.ts +8 -5
  179. package/lib/core/services/request-paged/monkeyecx-request-request-paged-handling.d.ts +1 -1
  180. package/lib/core/services/request-queue/monkeyecx-request-queue-handling.service.d.ts +2 -2
  181. package/lib/core/services/schedules/monkeyecx-request-schedule.service.d.ts +2 -2
  182. package/lib/core/utils/validate-utils.d.ts +13 -13
  183. package/monkey-front-core-0.0.37.tgz +0 -0
  184. package/package.json +22 -9
  185. package/bundles/monkey-front-core.umd.js +0 -4638
  186. package/bundles/monkey-front-core.umd.js.map +0 -1
  187. package/esm2015/lib/components/closed-to-maintenance/closed-to-maintenance.component.js +0 -32
  188. package/esm2015/lib/components/progress-bar/progress-bar.component.js +0 -28
  189. package/esm2015/lib/components/progress-bar/progress-bar.service.js +0 -49
  190. package/esm2015/lib/components/version-changed/version-changed.component.js +0 -25
  191. package/esm2015/lib/core/decorators/index.js +0 -4
  192. package/esm2015/lib/core/decorators/monkeyecx-decorators.js +0 -108
  193. package/esm2015/lib/core/decorators/monkeyecx-download-decorators.js +0 -24
  194. package/esm2015/lib/core/decorators/monkeyecx-upload-decorators.js +0 -24
  195. package/esm2015/lib/core/directives/monkeyecx-drag-drop.js +0 -57
  196. package/esm2015/lib/core/directives/monkeyecx-feature-directive.js +0 -66
  197. package/esm2015/lib/core/directives/monkeyecx-format-upper.js +0 -67
  198. package/esm2015/lib/core/directives/monkeyecx-security-directive.js +0 -67
  199. package/esm2015/lib/core/directives/monkeyecx-tooltip-directive.js +0 -120
  200. package/esm2015/lib/core/interceptors/monkeyecx-http-config-error.interceptor.js +0 -39
  201. package/esm2015/lib/core/interceptors/monkeyecx-http-config-header.interceptor.js +0 -32
  202. package/esm2015/lib/core/interceptors/monkeyecx-http-config-loading-in-progress.interceptor.js +0 -41
  203. package/esm2015/lib/core/interceptors/monkeyecx-http-config-queue.interceptor.js +0 -37
  204. package/esm2015/lib/core/interfaces/monkeyecx-auth-credentials.js +0 -2
  205. package/esm2015/lib/core/interfaces/monkeyecx-config-boostrap.js +0 -2
  206. package/esm2015/lib/core/interfaces/monkeyecx-config.js +0 -2
  207. package/esm2015/lib/core/interfaces/monkeyecx-me-credentials.js +0 -2
  208. package/esm2015/lib/core/interfaces/monkeyecx-navigation.js +0 -2
  209. package/esm2015/lib/core/interfaces/monkeyecx-request-paged.js +0 -2
  210. package/esm2015/lib/core/interfaces/monkeyecx-service-credentials.js +0 -2
  211. package/esm2015/lib/core/interfaces/monkeyecx-token-credentials.js +0 -2
  212. package/esm2015/lib/core/interfaces/request-download/monkeyecx-request-download.js +0 -2
  213. package/esm2015/lib/core/interfaces/request-queue/monkeyecx-request-queue.js +0 -2
  214. package/esm2015/lib/core/interfaces/schedules/monkeyecx-request-schedule.js +0 -2
  215. package/esm2015/lib/core/pipes/index.js +0 -13
  216. package/esm2015/lib/core/pipes/monkeyecx-display-first-name.js +0 -22
  217. package/esm2015/lib/core/pipes/monkeyecx-format-currency.js +0 -30
  218. package/esm2015/lib/core/pipes/monkeyecx-format-date-timelapse.js +0 -37
  219. package/esm2015/lib/core/pipes/monkeyecx-format-document.js +0 -22
  220. package/esm2015/lib/core/pipes/monkeyecx-format-number.js +0 -23
  221. package/esm2015/lib/core/pipes/monkeyecx-format-size.js +0 -23
  222. package/esm2015/lib/core/pipes/monkeyecx-format-type-document.js +0 -22
  223. package/esm2015/lib/core/pipes/monkeyecx-format-value.js +0 -22
  224. package/esm2015/lib/core/pipes/monkeyecx-format-zipcode.js +0 -22
  225. package/esm2015/lib/core/pipes/monkeyecx-pipes.module.js +0 -72
  226. package/esm2015/lib/core/pipes/monkeyecx-text-truncate.js +0 -26
  227. package/esm2015/lib/core/services/auth/monkeyecx-authentication.service.js +0 -61
  228. package/esm2015/lib/core/services/commons/monkeyecx-commons.service.js +0 -242
  229. package/esm2015/lib/core/services/config/index.js +0 -9
  230. package/esm2015/lib/core/services/config/monkeyecx-config.service.js +0 -104
  231. package/esm2015/lib/core/services/config/monkeyecx-error-config.service.js +0 -85
  232. package/esm2015/lib/core/services/config/monkeyecx-feature-toggle.service.js +0 -65
  233. package/esm2015/lib/core/services/config/monkeyecx-i18n-config.service.js +0 -72
  234. package/esm2015/lib/core/services/config/monkeyecx-logs-config.service.js +0 -34
  235. package/esm2015/lib/core/services/config/monkeyecx-security-console-config.service.js +0 -42
  236. package/esm2015/lib/core/services/config/monkeyecx-service-worker-config.service.js +0 -54
  237. package/esm2015/lib/core/services/error/monkeyecx-error-handling.service.js +0 -39
  238. package/esm2015/lib/core/services/error/monkeyecx-http-error-handling.service.js +0 -131
  239. package/esm2015/lib/core/services/index.js +0 -14
  240. package/esm2015/lib/core/services/monkeyecx-handling.service.js +0 -44
  241. package/esm2015/lib/core/services/monkeyecx-service.service.js +0 -102
  242. package/esm2015/lib/core/services/request-download/monkeyecx-request-download-handling.service.js +0 -81
  243. package/esm2015/lib/core/services/request-download/monkeyecx-request-downloaded-handling.service.js +0 -55
  244. package/esm2015/lib/core/services/request-paged/monkeyecx-request-request-paged-handling.js +0 -30
  245. package/esm2015/lib/core/services/request-queue/monkeyecx-request-queue-handling.service.js +0 -97
  246. package/esm2015/lib/core/services/request-queue/monkeyecx-request-queue-modal-handling.service.js +0 -106
  247. package/esm2015/lib/core/services/schedules/monkeyecx-request-schedule.service.js +0 -99
  248. package/esm2015/lib/core/services/storage/monkeyecx-token-storage.service.js +0 -117
  249. package/esm2015/lib/core/specification-search/monkeyecx-specification-search.js +0 -97
  250. package/esm2015/lib/core/utils/decorators-utils.js +0 -37
  251. package/esm2015/lib/core/utils/utils.js +0 -219
  252. package/esm2015/lib/core/utils/validate-utils.js +0 -204
  253. package/esm2015/lib/core/utils/validators.js +0 -193
  254. package/esm2015/lib/monkey-front-core.module.js +0 -60
  255. package/fesm2015/monkey-front-core.js.map +0 -1
  256. package/lib/core/services/config/index.d.ts +0 -8
  257. package/monkey-front-core-0.0.36.tgz +0 -0
@@ -1,4638 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('monkey-style-guide'), require('@ngx-translate/core'), require('moment'), require('@angular/common'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('@angular/forms'), require('@angular/common/http'), require('@angular/common/locales/global/pt'), require('ngx-cookie-service'), require('@datadog/browser-rum'), require('@angular/service-worker'), require('launchdarkly-js-client-sdk')) :
3
- typeof define === 'function' && define.amd ? define('monkey-front-core', ['exports', '@angular/core', 'monkey-style-guide', '@ngx-translate/core', 'moment', '@angular/common', '@angular/router', 'rxjs', 'rxjs/operators', '@angular/forms', '@angular/common/http', '@angular/common/locales/global/pt', 'ngx-cookie-service', '@datadog/browser-rum', '@angular/service-worker', 'launchdarkly-js-client-sdk'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["monkey-front-core"] = {}, global.ng.core, global["monkey-style-guide"], global["@ngx-translate/core"], global.moment, global.ng.common, global.ng.router, global.rxjs, global.rxjs.operators, global.ng.forms, global.ng.common.http, global.ng.common.locales.global.pt, global["ngx-cookie-service"], global["@datadog/browser-rum"], global.ng.serviceWorker, global["launchdarkly-js-client-sdk"]));
5
- })(this, (function (exports, i0, i1, i1$1, moment_, i1$2, i1$3, rxjs, operators, forms, i1$4, localePTBR, i1$5, browserRum, i1$6, launchdarklyJsClientSdk) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () { return e[k]; }
19
- });
20
- }
21
- });
22
- }
23
- n["default"] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
29
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
30
- var moment___namespace = /*#__PURE__*/_interopNamespace(moment_);
31
- var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
32
- var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
33
- var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$4);
34
- var localePTBR__default = /*#__PURE__*/_interopDefaultLegacy(localePTBR);
35
- var i1__namespace$5 = /*#__PURE__*/_interopNamespace(i1$5);
36
- var i1__namespace$6 = /*#__PURE__*/_interopNamespace(i1$6);
37
-
38
- /* eslint-disable comma-dangle */
39
- /* eslint-disable max-len */
40
- /* eslint-disable no-useless-escape */
41
- /* eslint-disable no-plusplus */
42
- /* eslint-disable no-cond-assign */
43
- /* eslint-disable eqeqeq */
44
- /* eslint-disable no-redeclare */
45
- /* eslint-disable vars-on-top */
46
- /* eslint-disable no-var */
47
- /* eslint-disable block-scoped-var */
48
- var MonkeyEcxUtils = /** @class */ (function () {
49
- function MonkeyEcxUtils() {
50
- }
51
- MonkeyEcxUtils.persistNullEmptyUndefined = function (tp) {
52
- return tp !== null && tp !== undefined && tp !== '';
53
- };
54
- MonkeyEcxUtils.getDocumentType = function (doc, country) {
55
- if (!doc)
56
- return '';
57
- if (country === 'cl')
58
- return 'RUT';
59
- return doc.length <= 11 ? 'CPF' : 'CNPJ';
60
- };
61
- MonkeyEcxUtils.getDocumentMask = function (type) {
62
- if (type === 'CPF')
63
- return '000.000.000-00';
64
- return '00.000.000/0000-00';
65
- };
66
- MonkeyEcxUtils.formatDocumentWithMask = function (doc, withType, country) {
67
- if (!doc)
68
- return doc;
69
- var formated = '';
70
- if (country === 'cl') {
71
- formated = doc.replace(/^(\d{1,2})(\d{3})(\d{3})(\w{1})$/, '$1.$2.$3-$4');
72
- return "" + formated;
73
- }
74
- if (doc.length === 14) {
75
- formated = doc
76
- .replace(/^(\d{2})(\d)/, '$1.$2')
77
- .replace(/^(\d{2})\.(\d{3})(\d)/, '$1.$2.$3')
78
- .replace(/\.(\d{3})(\d)/, '.$1/$2')
79
- .replace(/(\d{4})(\d)/, '$1-$2');
80
- }
81
- else {
82
- formated = doc
83
- .replace(/^(\d{3})(\d)/, '$1.$2')
84
- .replace(/^(\d{3})\.(\d{3})(\d)/, '$1.$2.$3')
85
- .replace(/\.(\d{3})(\d)/, '.$1-$2');
86
- }
87
- return (withType ? this.getDocumentType(doc) + ":" : '') + " " + formated;
88
- };
89
- MonkeyEcxUtils.cutFirstLastName = function (value, tp) {
90
- if (tp === void 0) { tp = 'first'; }
91
- var _a, _b;
92
- var split = (_a = value === null || value === void 0 ? void 0 : value.trim()) === null || _a === void 0 ? void 0 : _a.split(' ');
93
- if (tp === 'first')
94
- return split[0];
95
- return (_b = split === null || split === void 0 ? void 0 : split.splice(1, split.length)) === null || _b === void 0 ? void 0 : _b.join(' ');
96
- };
97
- MonkeyEcxUtils.isCPFCNPJValid = function (document) {
98
- document = document.replace(/[^\d]/g, '');
99
- if (document.length === 11) {
100
- var base = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
101
- for (var i = 0, n = 0; i < 9; n += document[i] * base[i++])
102
- ;
103
- if (document[9] != ((n %= 11) <= 1 ? 0 : 11 - n)) {
104
- return false;
105
- }
106
- base = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
107
- for (var i = 0, n = 0; i <= 9; n += document[i] * base[i++])
108
- ;
109
- if (document[10] != ((n %= 11) <= 1 ? 0 : 11 - n)) {
110
- return false;
111
- }
112
- return true;
113
- }
114
- if (document.length === 14 || /0{14}/.test(document)) {
115
- var base = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
116
- for (var i = 0, n = 0; i < 12; n += document[i] * base[++i])
117
- ;
118
- if (document[12] != ((n %= 11) < 2 ? 0 : 11 - n)) {
119
- return false;
120
- }
121
- for (var i = 0, n = 0; i <= 12; n += document[i] * base[i++])
122
- ;
123
- if (document[13] != ((n %= 11) < 2 ? 0 : 11 - n)) {
124
- return false;
125
- }
126
- return true;
127
- }
128
- return false;
129
- };
130
- MonkeyEcxUtils.isValidRUT = function (document) {
131
- if (!document || document.trim().length < 3)
132
- return false;
133
- var documentHandled = document.replace(/[^0-9kK]/g, '');
134
- if (documentHandled.length < 3)
135
- return false;
136
- var calcDv = function (rut) {
137
- var value = "" + rut;
138
- var sum = 0;
139
- var mult = 2;
140
- for (var i = 1; i <= value.length; i++) {
141
- var index = mult * Number(value.charAt(value.length - i));
142
- sum += index;
143
- if (mult < 7) {
144
- mult += 1;
145
- }
146
- else {
147
- mult = 2;
148
- }
149
- }
150
- var dvEsperado = 11 - (sum % 11);
151
- if (dvEsperado === 10)
152
- return 'K';
153
- if (dvEsperado === 11)
154
- return '0';
155
- return "" + dvEsperado;
156
- };
157
- var num = documentHandled.slice(0, -1);
158
- var dgv = documentHandled.slice(-1).toUpperCase();
159
- var dvCalc = calcDv(num);
160
- return dvCalc === dgv;
161
- };
162
- MonkeyEcxUtils.isValidUrl = function (txt) {
163
- var regex = new RegExp(/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)+[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,10}(:[0-9]{1,5})?(\/.*)?$/gm);
164
- return regex.test(txt);
165
- };
166
- MonkeyEcxUtils.isValidZipCode = function (zipCode) {
167
- return ("" + this.handleOnlyNumbers(zipCode)).length === 8;
168
- };
169
- MonkeyEcxUtils.getRandomString = function (len, charSet) {
170
- charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
171
- var randomString = new Array(len)
172
- .fill('1')
173
- .map(function () {
174
- return charSet.charAt(Math.floor(Math.random() * charSet.length));
175
- })
176
- .join('');
177
- return randomString;
178
- };
179
- MonkeyEcxUtils.handleOnlyNumbers = function (value) {
180
- if (!value)
181
- return null;
182
- return value.replace(new RegExp(/[^0-9]/g), '');
183
- };
184
- MonkeyEcxUtils.handleOnlyAlphaNumeric = function (value) {
185
- if (!value)
186
- return '';
187
- return value.replace(new RegExp(/[^0-9A-Za-z]/, 'g'), '');
188
- };
189
- MonkeyEcxUtils.capitalize = function (value) {
190
- return "" + value.charAt(0).toUpperCase() + value.slice(1);
191
- };
192
- MonkeyEcxUtils.formatZipCode = function (zipCode) {
193
- if (!zipCode)
194
- return zipCode;
195
- var formated = zipCode
196
- .replace(/^(\d{5})(\d)/, '$1-$2')
197
- .replace(/\.(\d{3})(\d)/, '.$1-$2');
198
- return "" + formated;
199
- };
200
- MonkeyEcxUtils.formatFileSize = function (size) {
201
- var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
202
- var l = 0;
203
- while (size >= 1024 && ++l) {
204
- size /= 1024;
205
- }
206
- return size.toFixed(size < 10 && l > 0 ? 1 : 0) + " " + units[l];
207
- };
208
- MonkeyEcxUtils.sufflue = function (data) {
209
- for (var i = data.length - 1; i > 0; i--) {
210
- var j = Math.floor(Math.random() * i);
211
- var temp = data[i];
212
- data[i] = data[j];
213
- data[j] = temp;
214
- }
215
- return data;
216
- };
217
- MonkeyEcxUtils.handleBlobFile = function (theBlob, fileName, fileType) {
218
- function blobToFile(theBlob, fileName) {
219
- var b = theBlob;
220
- b.lastModifiedDate = new Date();
221
- b.name = fileName;
222
- return b;
223
- }
224
- var file;
225
- if (!navigator.msSaveBlob) {
226
- file = new File([theBlob], fileName, {
227
- type: fileType,
228
- });
229
- }
230
- else {
231
- file = new Blob([theBlob], {
232
- type: fileType,
233
- });
234
- file = blobToFile(file, fileName);
235
- }
236
- return file;
237
- };
238
- MonkeyEcxUtils.truncate = function (text, maxLength) {
239
- if (maxLength === void 0) { maxLength = 25; }
240
- var midChar = '...';
241
- if (!text)
242
- return midChar;
243
- if (text && text.length <= maxLength)
244
- return text;
245
- var left = Math.ceil(maxLength / 2);
246
- var right = text.length - left + 1;
247
- return text.substr(0, left) + " " + midChar + " " + text.substring(right);
248
- };
249
- MonkeyEcxUtils.isLocalhost = function () {
250
- var href = (window === null || window === void 0 ? void 0 : window.location).href;
251
- if (!href)
252
- return false;
253
- return (href === null || href === void 0 ? void 0 : href.search('localhost')) >= 0;
254
- };
255
- MonkeyEcxUtils.isSameOrigin = function (frontend) {
256
- var initialPath = window.location.origin;
257
- return (initialPath || '') === frontend;
258
- };
259
- return MonkeyEcxUtils;
260
- }());
261
-
262
- var moment$2 = moment___namespace;
263
- var MonkeyEcxFormatDateTimelapsePipe = /** @class */ (function () {
264
- function MonkeyEcxFormatDateTimelapsePipe() {
265
- // not todo
266
- }
267
- MonkeyEcxFormatDateTimelapsePipe.prototype.transform = function (date, showTime, useUtc, format) {
268
- if (showTime === void 0) { showTime = false; }
269
- if (useUtc === void 0) { useUtc = true; }
270
- var _a;
271
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(date))
272
- return '';
273
- if (!format) {
274
- format = '- HH:mm';
275
- }
276
- var stillUtc = moment$2.utc(date).toDate();
277
- if (!useUtc)
278
- stillUtc = moment$2(date).toDate();
279
- if (((_a = date.toString()) === null || _a === void 0 ? void 0 : _a.indexOf(':')) <= -1) {
280
- stillUtc = date;
281
- showTime = false;
282
- }
283
- var formatFrom = "YYYY/MM/DD" + (showTime ? " " + format : '');
284
- var formatTo = "DD/MM/YYYY" + (showTime ? " " + format : '');
285
- return "" + moment$2(stillUtc, formatFrom).format(formatTo);
286
- };
287
- return MonkeyEcxFormatDateTimelapsePipe;
288
- }());
289
- MonkeyEcxFormatDateTimelapsePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatDateTimelapsePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
290
- MonkeyEcxFormatDateTimelapsePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatDateTimelapsePipe, name: "monkeyecxFormatDateTimelapse" });
291
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatDateTimelapsePipe, decorators: [{
292
- type: i0.Pipe,
293
- args: [{
294
- name: 'monkeyecxFormatDateTimelapse'
295
- }]
296
- }], ctorParameters: function () { return []; } });
297
-
298
- var ClosedToMaintenanceComponent = /** @class */ (function () {
299
- function ClosedToMaintenanceComponent() {
300
- this._configBoostrap = null;
301
- }
302
- ClosedToMaintenanceComponent.prototype.ngOnInit = function () {
303
- this._configBoostrap = this.config.data;
304
- };
305
- ClosedToMaintenanceComponent.prototype.onClose = function () {
306
- document.location.reload();
307
- };
308
- return ClosedToMaintenanceComponent;
309
- }());
310
- ClosedToMaintenanceComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ClosedToMaintenanceComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
311
- ClosedToMaintenanceComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ClosedToMaintenanceComponent, selector: "monkeyecx-closed-to-maintenance", inputs: { config: "config", modalRef: "modalRef" }, ngImport: i0__namespace, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\">\r\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\r\n <span class=\"h2\">\r\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.TITLE' | translate }}\r\n </span>\r\n <span class=\"information-title mt-4\">\r\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-1' | translate }}\r\n </span>\r\n <span class=\"information-title mt-4\">\r\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-2' | translate }}\r\n </span>\r\n <span class=\"information mt-3\">\r\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-3' | translate }}\r\n {{ _configBoostrap?.maintenance?.endDate | monkeyecxFormatDateTimelapse: true }}\r\n </span>\r\n <span class=\"information-title mt-4\">\r\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.INFORMATION-4' | translate }}\r\n </span>\r\n </div>\r\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\r\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\r\n {{ 'SCREENS.CLOSED-TO-MAINTENANCE.BUTTONS.UPDATE-MAINTENANCE' | translate }}\r\n </monkey-button>\r\n </div>\r\n</monkey-modal>", styles: ["monkeyecx-closed-to-maintenance .body{padding:24px;width:100%}monkeyecx-closed-to-maintenance .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53}monkeyecx-closed-to-maintenance .information{font-style:normal;font-weight:normal;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-closed-to-maintenance .browser-name{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-closed-to-maintenance .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-closed-to-maintenance monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"], components: [{ type: i1__namespace.MonkeyModalComponent, selector: "monkey-modal", inputs: ["config", "modalRef", "onHandleConfirm"] }, { type: i1__namespace.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], pipes: { "translate": i1__namespace$1.TranslatePipe, "monkeyecxFormatDateTimelapse": MonkeyEcxFormatDateTimelapsePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
312
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ClosedToMaintenanceComponent, decorators: [{
313
- type: i0.Component,
314
- args: [{
315
- selector: 'monkeyecx-closed-to-maintenance',
316
- templateUrl: './closed-to-maintenance.component.html',
317
- styleUrls: ['./closed-to-maintenance.component.scss'],
318
- encapsulation: i0.ViewEncapsulation.None
319
- }]
320
- }], propDecorators: { config: [{
321
- type: i0.Input
322
- }], modalRef: [{
323
- type: i0.Input
324
- }] } });
325
-
326
- var MonkeyEcxFormatNumber = /** @class */ (function () {
327
- function MonkeyEcxFormatNumber() {
328
- // not to do
329
- }
330
- MonkeyEcxFormatNumber.prototype.transform = function (number) {
331
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(number))
332
- return '';
333
- return i1$2.formatNumber(Number(number), 'ptbr');
334
- };
335
- return MonkeyEcxFormatNumber;
336
- }());
337
- MonkeyEcxFormatNumber.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatNumber, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
338
- MonkeyEcxFormatNumber.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatNumber, name: "monkeyecxFormatNumber" });
339
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatNumber, decorators: [{
340
- type: i0.Pipe,
341
- args: [{
342
- name: 'monkeyecxFormatNumber'
343
- }]
344
- }], ctorParameters: function () { return []; } });
345
-
346
- var MonkeyEcxFormatValue = /** @class */ (function () {
347
- function MonkeyEcxFormatValue() {
348
- // not to do
349
- }
350
- MonkeyEcxFormatValue.prototype.transform = function (number) {
351
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(number))
352
- return '';
353
- return number;
354
- };
355
- return MonkeyEcxFormatValue;
356
- }());
357
- MonkeyEcxFormatValue.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatValue, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
358
- MonkeyEcxFormatValue.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatValue, name: "monkeyecxFormatValue" });
359
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatValue, decorators: [{
360
- type: i0.Pipe,
361
- args: [{
362
- name: 'monkeyecxFormatValue'
363
- }]
364
- }], ctorParameters: function () { return []; } });
365
-
366
- var MonkeyEcxFormatDocumentPipe = /** @class */ (function () {
367
- function MonkeyEcxFormatDocumentPipe() {
368
- // not to do
369
- }
370
- MonkeyEcxFormatDocumentPipe.prototype.transform = function (document, withType) {
371
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(document))
372
- return '';
373
- return MonkeyEcxUtils.formatDocumentWithMask(document, withType);
374
- };
375
- return MonkeyEcxFormatDocumentPipe;
376
- }());
377
- MonkeyEcxFormatDocumentPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatDocumentPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
378
- MonkeyEcxFormatDocumentPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatDocumentPipe, name: "monkeyecxFormatDocument" });
379
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatDocumentPipe, decorators: [{
380
- type: i0.Pipe,
381
- args: [{
382
- name: 'monkeyecxFormatDocument'
383
- }]
384
- }], ctorParameters: function () { return []; } });
385
-
386
- var MonkeyEcxDisplayFirstNamePipe = /** @class */ (function () {
387
- function MonkeyEcxDisplayFirstNamePipe() {
388
- // not to do
389
- }
390
- MonkeyEcxDisplayFirstNamePipe.prototype.transform = function (name) {
391
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(name))
392
- return '';
393
- return MonkeyEcxUtils.cutFirstLastName(name);
394
- };
395
- return MonkeyEcxDisplayFirstNamePipe;
396
- }());
397
- MonkeyEcxDisplayFirstNamePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDisplayFirstNamePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
398
- MonkeyEcxDisplayFirstNamePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDisplayFirstNamePipe, name: "monkeyecxDisplayFirstName" });
399
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDisplayFirstNamePipe, decorators: [{
400
- type: i0.Pipe,
401
- args: [{
402
- name: 'monkeyecxDisplayFirstName'
403
- }]
404
- }], ctorParameters: function () { return []; } });
405
-
406
- var MonkeyEcxFormatSizePipe = /** @class */ (function () {
407
- function MonkeyEcxFormatSizePipe() {
408
- // not to do
409
- }
410
- MonkeyEcxFormatSizePipe.prototype.transform = function (size) {
411
- if (!size)
412
- return '0 B';
413
- var sizeNum = Number(size);
414
- return MonkeyEcxUtils.formatFileSize(sizeNum);
415
- };
416
- return MonkeyEcxFormatSizePipe;
417
- }());
418
- MonkeyEcxFormatSizePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatSizePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
419
- MonkeyEcxFormatSizePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatSizePipe, name: "monkeyecxFormatSize" });
420
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatSizePipe, decorators: [{
421
- type: i0.Pipe,
422
- args: [{
423
- name: 'monkeyecxFormatSize'
424
- }]
425
- }], ctorParameters: function () { return []; } });
426
-
427
- var MonkeyEcxFormatCurrencyPipe = /** @class */ (function () {
428
- function MonkeyEcxFormatCurrencyPipe(injector, currencyPipe) {
429
- var _this = this;
430
- this.injector = injector;
431
- this.currencyPipe = currencyPipe;
432
- this.currencyCode = 'BRL';
433
- this.currentLocale = 'pt-BR';
434
- var translateService = this.injector.get(i1$1.TranslateService);
435
- translateService.get('MONKEY-CURRENCY-CODE').subscribe(function (_) {
436
- _this.currencyCode = _;
437
- _this.currentLocale = translateService.getDefaultLang();
438
- });
439
- }
440
- MonkeyEcxFormatCurrencyPipe.prototype.transform = function (value) {
441
- var _a = this, currencyCode = _a.currencyCode, currentLocale = _a.currentLocale;
442
- return this.currencyPipe.transform(value, currencyCode, 'symbol', '', currentLocale);
443
- };
444
- return MonkeyEcxFormatCurrencyPipe;
445
- }());
446
- MonkeyEcxFormatCurrencyPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatCurrencyPipe, deps: [{ token: i0__namespace.Injector }, { token: i1__namespace$2.CurrencyPipe }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
447
- MonkeyEcxFormatCurrencyPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatCurrencyPipe, name: "monkeyecxFormatCurrency" });
448
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatCurrencyPipe, decorators: [{
449
- type: i0.Pipe,
450
- args: [{
451
- name: 'monkeyecxFormatCurrency'
452
- }]
453
- }], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: i1__namespace$2.CurrencyPipe }]; } });
454
-
455
- var MonkeyEcxFormatZipCodePipe = /** @class */ (function () {
456
- function MonkeyEcxFormatZipCodePipe() {
457
- // not to do
458
- }
459
- MonkeyEcxFormatZipCodePipe.prototype.transform = function (zipCode) {
460
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(zipCode))
461
- return '';
462
- return MonkeyEcxUtils.formatZipCode(zipCode);
463
- };
464
- return MonkeyEcxFormatZipCodePipe;
465
- }());
466
- MonkeyEcxFormatZipCodePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatZipCodePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
467
- MonkeyEcxFormatZipCodePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatZipCodePipe, name: "monkeyecxFormatZipCode" });
468
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatZipCodePipe, decorators: [{
469
- type: i0.Pipe,
470
- args: [{
471
- name: 'monkeyecxFormatZipCode'
472
- }]
473
- }], ctorParameters: function () { return []; } });
474
-
475
- var MonkeyEcxTextTruncatePipe = /** @class */ (function () {
476
- function MonkeyEcxTextTruncatePipe() {
477
- // not to do
478
- }
479
- MonkeyEcxTextTruncatePipe.prototype.transform = function (text, maxLength) {
480
- if (maxLength === void 0) { maxLength = 25; }
481
- var midChar = '...';
482
- if (!text)
483
- return midChar;
484
- if (text && text.length <= maxLength)
485
- return text;
486
- var left = Math.ceil(maxLength / 2);
487
- var right = text.length - left + 1;
488
- return text.substr(0, left) + " " + midChar + " " + text.substring(right);
489
- };
490
- return MonkeyEcxTextTruncatePipe;
491
- }());
492
- MonkeyEcxTextTruncatePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTextTruncatePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
493
- MonkeyEcxTextTruncatePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTextTruncatePipe, name: "monkeyecxTextTruncate" });
494
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTextTruncatePipe, decorators: [{
495
- type: i0.Pipe,
496
- args: [{
497
- name: 'monkeyecxTextTruncate'
498
- }]
499
- }], ctorParameters: function () { return []; } });
500
-
501
- var MonkeyEcxDocumentTypePipe = /** @class */ (function () {
502
- function MonkeyEcxDocumentTypePipe() {
503
- // not to do
504
- }
505
- MonkeyEcxDocumentTypePipe.prototype.transform = function (document) {
506
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(document))
507
- return '';
508
- return MonkeyEcxUtils.getDocumentType(document);
509
- };
510
- return MonkeyEcxDocumentTypePipe;
511
- }());
512
- MonkeyEcxDocumentTypePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDocumentTypePipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
513
- MonkeyEcxDocumentTypePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDocumentTypePipe, name: "monkeyecxDocumentType" });
514
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDocumentTypePipe, decorators: [{
515
- type: i0.Pipe,
516
- args: [{
517
- name: 'monkeyecxDocumentType'
518
- }]
519
- }], ctorParameters: function () { return []; } });
520
-
521
- var MonkeyEcxTruncateQtdPipe = /** @class */ (function () {
522
- function MonkeyEcxTruncateQtdPipe() {
523
- }
524
- MonkeyEcxTruncateQtdPipe.prototype.transform = function (number, threshold) {
525
- return "" + (number > threshold ? threshold + "+" : number);
526
- };
527
- return MonkeyEcxTruncateQtdPipe;
528
- }());
529
- MonkeyEcxTruncateQtdPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTruncateQtdPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
530
- MonkeyEcxTruncateQtdPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTruncateQtdPipe, name: "monkeyecxTruncateQtd" });
531
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTruncateQtdPipe, decorators: [{
532
- type: i0.Pipe,
533
- args: [{
534
- name: 'monkeyecxTruncateQtd'
535
- }]
536
- }] });
537
-
538
- var MonkeyEcxPipesModule = /** @class */ (function () {
539
- function MonkeyEcxPipesModule() {
540
- }
541
- return MonkeyEcxPipesModule;
542
- }());
543
- MonkeyEcxPipesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxPipesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
544
- MonkeyEcxPipesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxPipesModule, declarations: [MonkeyEcxFormatDocumentPipe,
545
- MonkeyEcxFormatDateTimelapsePipe,
546
- MonkeyEcxDisplayFirstNamePipe,
547
- MonkeyEcxFormatSizePipe,
548
- MonkeyEcxFormatCurrencyPipe,
549
- MonkeyEcxFormatZipCodePipe,
550
- MonkeyEcxFormatNumber,
551
- MonkeyEcxFormatValue,
552
- MonkeyEcxTextTruncatePipe,
553
- MonkeyEcxTruncateQtdPipe,
554
- MonkeyEcxDocumentTypePipe], exports: [MonkeyEcxFormatDocumentPipe,
555
- MonkeyEcxFormatDateTimelapsePipe,
556
- MonkeyEcxDisplayFirstNamePipe,
557
- MonkeyEcxFormatSizePipe,
558
- MonkeyEcxFormatCurrencyPipe,
559
- MonkeyEcxFormatZipCodePipe,
560
- MonkeyEcxFormatNumber,
561
- MonkeyEcxFormatValue,
562
- MonkeyEcxTextTruncatePipe,
563
- MonkeyEcxTruncateQtdPipe,
564
- MonkeyEcxDocumentTypePipe] });
565
- MonkeyEcxPipesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxPipesModule, providers: [i1$2.CurrencyPipe] });
566
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxPipesModule, decorators: [{
567
- type: i0.NgModule,
568
- args: [{
569
- declarations: [
570
- MonkeyEcxFormatDocumentPipe,
571
- MonkeyEcxFormatDateTimelapsePipe,
572
- MonkeyEcxDisplayFirstNamePipe,
573
- MonkeyEcxFormatSizePipe,
574
- MonkeyEcxFormatCurrencyPipe,
575
- MonkeyEcxFormatZipCodePipe,
576
- MonkeyEcxFormatNumber,
577
- MonkeyEcxFormatValue,
578
- MonkeyEcxTextTruncatePipe,
579
- MonkeyEcxTruncateQtdPipe,
580
- MonkeyEcxDocumentTypePipe
581
- ],
582
- exports: [
583
- MonkeyEcxFormatDocumentPipe,
584
- MonkeyEcxFormatDateTimelapsePipe,
585
- MonkeyEcxDisplayFirstNamePipe,
586
- MonkeyEcxFormatSizePipe,
587
- MonkeyEcxFormatCurrencyPipe,
588
- MonkeyEcxFormatZipCodePipe,
589
- MonkeyEcxFormatNumber,
590
- MonkeyEcxFormatValue,
591
- MonkeyEcxTextTruncatePipe,
592
- MonkeyEcxTruncateQtdPipe,
593
- MonkeyEcxDocumentTypePipe
594
- ],
595
- providers: [i1$2.CurrencyPipe]
596
- }]
597
- }] });
598
-
599
- var ClosedToMaintenanceModule = /** @class */ (function () {
600
- function ClosedToMaintenanceModule() {
601
- }
602
- return ClosedToMaintenanceModule;
603
- }());
604
- ClosedToMaintenanceModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ClosedToMaintenanceModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
605
- ClosedToMaintenanceModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ClosedToMaintenanceModule, declarations: [ClosedToMaintenanceComponent], imports: [i1$2.CommonModule,
606
- i1.MonkeyButtonModule,
607
- i1.MonkeyIconModule,
608
- i1.MonkeyInputModule,
609
- i1.MonkeyModalModule,
610
- MonkeyEcxPipesModule, i1__namespace$1.TranslateModule], exports: [ClosedToMaintenanceComponent] });
611
- ClosedToMaintenanceModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ClosedToMaintenanceModule, imports: [[
612
- i1$2.CommonModule,
613
- i1.MonkeyButtonModule,
614
- i1.MonkeyIconModule,
615
- i1.MonkeyInputModule,
616
- i1.MonkeyModalModule,
617
- MonkeyEcxPipesModule,
618
- i1$1.TranslateModule.forChild()
619
- ]] });
620
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ClosedToMaintenanceModule, decorators: [{
621
- type: i0.NgModule,
622
- args: [{
623
- declarations: [ClosedToMaintenanceComponent],
624
- imports: [
625
- i1$2.CommonModule,
626
- i1.MonkeyButtonModule,
627
- i1.MonkeyIconModule,
628
- i1.MonkeyInputModule,
629
- i1.MonkeyModalModule,
630
- MonkeyEcxPipesModule,
631
- i1$1.TranslateModule.forChild()
632
- ],
633
- exports: [ClosedToMaintenanceComponent]
634
- }]
635
- }] });
636
-
637
- var MonkeyEcxProgressBarService = /** @class */ (function () {
638
- function MonkeyEcxProgressBarService(router) {
639
- this.router = router;
640
- this.init();
641
- }
642
- MonkeyEcxProgressBarService.prototype.init = function () {
643
- var _this = this;
644
- this.visible = new rxjs.BehaviorSubject(false);
645
- this.router.events
646
- .pipe(operators.filter(function (event) {
647
- return event instanceof i1$3.NavigationStart;
648
- }))
649
- .subscribe(function () {
650
- _this.show();
651
- });
652
- this.router.events
653
- .pipe(operators.filter(function (event) {
654
- return (event instanceof i1$3.NavigationEnd ||
655
- event instanceof i1$3.NavigationError ||
656
- event instanceof i1$3.NavigationCancel);
657
- }))
658
- .subscribe(function () {
659
- _this.hide();
660
- });
661
- };
662
- MonkeyEcxProgressBarService.prototype.show = function () {
663
- this.visible.next(true);
664
- };
665
- MonkeyEcxProgressBarService.prototype.hide = function () {
666
- this.visible.next(false);
667
- };
668
- MonkeyEcxProgressBarService.prototype.visibleConfig = function () {
669
- return this.visible.asObservable();
670
- };
671
- return MonkeyEcxProgressBarService;
672
- }());
673
- MonkeyEcxProgressBarService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxProgressBarService, deps: [{ token: i1__namespace$3.Router }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
674
- MonkeyEcxProgressBarService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxProgressBarService, providedIn: 'root' });
675
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxProgressBarService, decorators: [{
676
- type: i0.Injectable,
677
- args: [{
678
- providedIn: 'root'
679
- }]
680
- }], ctorParameters: function () { return [{ type: i1__namespace$3.Router }]; } });
681
-
682
- var MonkeyEcxProgressBarComponent = /** @class */ (function () {
683
- function MonkeyEcxProgressBarComponent(progressBarService) {
684
- this.progressBarService = progressBarService;
685
- this.visible = false;
686
- //not to do
687
- }
688
- MonkeyEcxProgressBarComponent.prototype.ngOnInit = function () {
689
- var _this = this;
690
- this.progressBarService.visibleConfig().subscribe(function (visible) {
691
- _this.visible = visible;
692
- });
693
- };
694
- return MonkeyEcxProgressBarComponent;
695
- }());
696
- MonkeyEcxProgressBarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxProgressBarComponent, deps: [{ token: MonkeyEcxProgressBarService }], target: i0__namespace.ɵɵFactoryTarget.Component });
697
- MonkeyEcxProgressBarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: MonkeyEcxProgressBarComponent, selector: "monkeyecx-progress-bar", ngImport: i0__namespace, template: "<ng-container *ngIf=\"visible\">\r\n <progress class=\"monkey-progress monkey-progress__theme\"></progress>\r\n</ng-container>\r\n", styles: ["monkeyecx-progress-bar{position:absolute;width:100%;margin-top:-9.5px;z-index:99998}\n"], directives: [{ type: i1__namespace$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0__namespace.ViewEncapsulation.None });
698
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxProgressBarComponent, decorators: [{
699
- type: i0.Component,
700
- args: [{
701
- selector: 'monkeyecx-progress-bar',
702
- templateUrl: './progress-bar.component.html',
703
- styleUrls: ['./progress-bar.component.scss'],
704
- encapsulation: i0.ViewEncapsulation.None
705
- }]
706
- }], ctorParameters: function () { return [{ type: MonkeyEcxProgressBarService }]; } });
707
-
708
- var MonkeyEcxProgressBarModule = /** @class */ (function () {
709
- function MonkeyEcxProgressBarModule() {
710
- }
711
- return MonkeyEcxProgressBarModule;
712
- }());
713
- MonkeyEcxProgressBarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxProgressBarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
714
- MonkeyEcxProgressBarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxProgressBarModule, declarations: [MonkeyEcxProgressBarComponent], imports: [i1$2.CommonModule], exports: [MonkeyEcxProgressBarComponent] });
715
- MonkeyEcxProgressBarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxProgressBarModule, imports: [[i1$2.CommonModule]] });
716
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxProgressBarModule, decorators: [{
717
- type: i0.NgModule,
718
- args: [{
719
- declarations: [MonkeyEcxProgressBarComponent],
720
- imports: [i1$2.CommonModule],
721
- exports: [MonkeyEcxProgressBarComponent]
722
- }]
723
- }] });
724
-
725
- var VersionChangedComponent = /** @class */ (function () {
726
- function VersionChangedComponent() {
727
- }
728
- VersionChangedComponent.prototype.onClose = function () {
729
- document.location.reload();
730
- };
731
- return VersionChangedComponent;
732
- }());
733
- VersionChangedComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: VersionChangedComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
734
- VersionChangedComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: VersionChangedComponent, selector: "monkeyecx-version-changed", inputs: { config: "config", modalRef: "modalRef" }, ngImport: i0__namespace, template: "<monkey-modal [config]=\"config\" [modalRef]=\"modalRef\">\r\n <div class=\"d-flex flex-column justify-content-center align-items-center\">\r\n <span class=\"h2\">\r\n {{ 'SCREENS.VERSION-CHANGED.TITLE' | translate }}\r\n </span>\r\n <span class=\"information-title mt-4\">\r\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-1' | translate }}\r\n </span>\r\n <span class=\"information mt-3\">\r\n {{ 'SCREENS.VERSION-CHANGED.INFORMATION-2' | translate }}\r\n </span>\r\n </div>\r\n <div class=\"d-flex flex-column justify-content-center align-items-center mt-5\">\r\n <monkey-button type=\"primary\" color=\"theme\" (click)=\"onClose()\">\r\n {{ 'SCREENS.VERSION-CHANGED.BUTTONS.UPDATE-VERSION' | translate }}\r\n </monkey-button>\r\n </div>\r\n</monkey-modal>", styles: ["monkeyecx-version-changed .body{padding:24px;width:100%}monkeyecx-version-changed .information-title{font-style:normal;font-weight:600;font-size:25px;line-height:32px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .information{font-style:normal;font-weight:normal;font-size:20px;line-height:24px;display:flex;align-items:center;text-align:center;color:#4b4a53;max-width:600px}monkeyecx-version-changed .browser-name{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;text-align:center;color:#9c9ca6}monkeyecx-version-changed .option{text-decoration:none;padding:4px;background:#eee;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:16px}monkeyecx-version-changed monkey-modal mecx-monkey-modal .body{margin-bottom:0!important}\n"], components: [{ type: i1__namespace.MonkeyModalComponent, selector: "monkey-modal", inputs: ["config", "modalRef", "onHandleConfirm"] }, { type: i1__namespace.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], pipes: { "translate": i1__namespace$1.TranslatePipe }, encapsulation: i0__namespace.ViewEncapsulation.None });
735
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: VersionChangedComponent, decorators: [{
736
- type: i0.Component,
737
- args: [{
738
- selector: 'monkeyecx-version-changed',
739
- templateUrl: './version-changed.component.html',
740
- styleUrls: ['./version-changed.component.scss'],
741
- encapsulation: i0.ViewEncapsulation.None
742
- }]
743
- }], propDecorators: { config: [{
744
- type: i0.Input
745
- }], modalRef: [{
746
- type: i0.Input
747
- }] } });
748
-
749
- var VersionChangedModule = /** @class */ (function () {
750
- function VersionChangedModule() {
751
- }
752
- return VersionChangedModule;
753
- }());
754
- VersionChangedModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: VersionChangedModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
755
- VersionChangedModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: VersionChangedModule, declarations: [VersionChangedComponent], imports: [i1$2.CommonModule,
756
- i1.MonkeyButtonModule,
757
- i1.MonkeyIconModule,
758
- i1.MonkeyInputModule,
759
- i1.MonkeyModalModule, i1__namespace$1.TranslateModule], exports: [VersionChangedComponent] });
760
- VersionChangedModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: VersionChangedModule, imports: [[
761
- i1$2.CommonModule,
762
- i1.MonkeyButtonModule,
763
- i1.MonkeyIconModule,
764
- i1.MonkeyInputModule,
765
- i1.MonkeyModalModule,
766
- i1$1.TranslateModule.forChild()
767
- ]] });
768
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: VersionChangedModule, decorators: [{
769
- type: i0.NgModule,
770
- args: [{
771
- declarations: [VersionChangedComponent],
772
- imports: [
773
- i1$2.CommonModule,
774
- i1.MonkeyButtonModule,
775
- i1.MonkeyIconModule,
776
- i1.MonkeyInputModule,
777
- i1.MonkeyModalModule,
778
- i1$1.TranslateModule.forChild()
779
- ],
780
- exports: [VersionChangedComponent]
781
- }]
782
- }] });
783
-
784
- /*! *****************************************************************************
785
- Copyright (c) Microsoft Corporation.
786
-
787
- Permission to use, copy, modify, and/or distribute this software for any
788
- purpose with or without fee is hereby granted.
789
-
790
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
791
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
792
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
793
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
794
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
795
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
796
- PERFORMANCE OF THIS SOFTWARE.
797
- ***************************************************************************** */
798
- /* global Reflect, Promise */
799
- var extendStatics = function (d, b) {
800
- extendStatics = Object.setPrototypeOf ||
801
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
802
- function (d, b) { for (var p in b)
803
- if (Object.prototype.hasOwnProperty.call(b, p))
804
- d[p] = b[p]; };
805
- return extendStatics(d, b);
806
- };
807
- function __extends(d, b) {
808
- if (typeof b !== "function" && b !== null)
809
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
810
- extendStatics(d, b);
811
- function __() { this.constructor = d; }
812
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
813
- }
814
- var __assign = function () {
815
- __assign = Object.assign || function __assign(t) {
816
- for (var s, i = 1, n = arguments.length; i < n; i++) {
817
- s = arguments[i];
818
- for (var p in s)
819
- if (Object.prototype.hasOwnProperty.call(s, p))
820
- t[p] = s[p];
821
- }
822
- return t;
823
- };
824
- return __assign.apply(this, arguments);
825
- };
826
- function __rest(s, e) {
827
- var t = {};
828
- for (var p in s)
829
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
830
- t[p] = s[p];
831
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
832
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
833
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
834
- t[p[i]] = s[p[i]];
835
- }
836
- return t;
837
- }
838
- function __decorate(decorators, target, key, desc) {
839
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
840
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
841
- r = Reflect.decorate(decorators, target, key, desc);
842
- else
843
- for (var i = decorators.length - 1; i >= 0; i--)
844
- if (d = decorators[i])
845
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
846
- return c > 3 && r && Object.defineProperty(target, key, r), r;
847
- }
848
- function __param(paramIndex, decorator) {
849
- return function (target, key) { decorator(target, key, paramIndex); };
850
- }
851
- function __metadata(metadataKey, metadataValue) {
852
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
853
- return Reflect.metadata(metadataKey, metadataValue);
854
- }
855
- function __awaiter(thisArg, _arguments, P, generator) {
856
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
857
- return new (P || (P = Promise))(function (resolve, reject) {
858
- function fulfilled(value) { try {
859
- step(generator.next(value));
860
- }
861
- catch (e) {
862
- reject(e);
863
- } }
864
- function rejected(value) { try {
865
- step(generator["throw"](value));
866
- }
867
- catch (e) {
868
- reject(e);
869
- } }
870
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
871
- step((generator = generator.apply(thisArg, _arguments || [])).next());
872
- });
873
- }
874
- function __generator(thisArg, body) {
875
- var _ = { label: 0, sent: function () { if (t[0] & 1)
876
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
877
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
878
- function verb(n) { return function (v) { return step([n, v]); }; }
879
- function step(op) {
880
- if (f)
881
- throw new TypeError("Generator is already executing.");
882
- while (_)
883
- try {
884
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
885
- return t;
886
- if (y = 0, t)
887
- op = [op[0] & 2, t.value];
888
- switch (op[0]) {
889
- case 0:
890
- case 1:
891
- t = op;
892
- break;
893
- case 4:
894
- _.label++;
895
- return { value: op[1], done: false };
896
- case 5:
897
- _.label++;
898
- y = op[1];
899
- op = [0];
900
- continue;
901
- case 7:
902
- op = _.ops.pop();
903
- _.trys.pop();
904
- continue;
905
- default:
906
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
907
- _ = 0;
908
- continue;
909
- }
910
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
911
- _.label = op[1];
912
- break;
913
- }
914
- if (op[0] === 6 && _.label < t[1]) {
915
- _.label = t[1];
916
- t = op;
917
- break;
918
- }
919
- if (t && _.label < t[2]) {
920
- _.label = t[2];
921
- _.ops.push(op);
922
- break;
923
- }
924
- if (t[2])
925
- _.ops.pop();
926
- _.trys.pop();
927
- continue;
928
- }
929
- op = body.call(thisArg, _);
930
- }
931
- catch (e) {
932
- op = [6, e];
933
- y = 0;
934
- }
935
- finally {
936
- f = t = 0;
937
- }
938
- if (op[0] & 5)
939
- throw op[1];
940
- return { value: op[0] ? op[1] : void 0, done: true };
941
- }
942
- }
943
- var __createBinding = Object.create ? (function (o, m, k, k2) {
944
- if (k2 === undefined)
945
- k2 = k;
946
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
947
- }) : (function (o, m, k, k2) {
948
- if (k2 === undefined)
949
- k2 = k;
950
- o[k2] = m[k];
951
- });
952
- function __exportStar(m, o) {
953
- for (var p in m)
954
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
955
- __createBinding(o, m, p);
956
- }
957
- function __values(o) {
958
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
959
- if (m)
960
- return m.call(o);
961
- if (o && typeof o.length === "number")
962
- return {
963
- next: function () {
964
- if (o && i >= o.length)
965
- o = void 0;
966
- return { value: o && o[i++], done: !o };
967
- }
968
- };
969
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
970
- }
971
- function __read(o, n) {
972
- var m = typeof Symbol === "function" && o[Symbol.iterator];
973
- if (!m)
974
- return o;
975
- var i = m.call(o), r, ar = [], e;
976
- try {
977
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
978
- ar.push(r.value);
979
- }
980
- catch (error) {
981
- e = { error: error };
982
- }
983
- finally {
984
- try {
985
- if (r && !r.done && (m = i["return"]))
986
- m.call(i);
987
- }
988
- finally {
989
- if (e)
990
- throw e.error;
991
- }
992
- }
993
- return ar;
994
- }
995
- /** @deprecated */
996
- function __spread() {
997
- for (var ar = [], i = 0; i < arguments.length; i++)
998
- ar = ar.concat(__read(arguments[i]));
999
- return ar;
1000
- }
1001
- /** @deprecated */
1002
- function __spreadArrays() {
1003
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
1004
- s += arguments[i].length;
1005
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
1006
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
1007
- r[k] = a[j];
1008
- return r;
1009
- }
1010
- function __spreadArray(to, from, pack) {
1011
- if (pack || arguments.length === 2)
1012
- for (var i = 0, l = from.length, ar; i < l; i++) {
1013
- if (ar || !(i in from)) {
1014
- if (!ar)
1015
- ar = Array.prototype.slice.call(from, 0, i);
1016
- ar[i] = from[i];
1017
- }
1018
- }
1019
- return to.concat(ar || Array.prototype.slice.call(from));
1020
- }
1021
- function __await(v) {
1022
- return this instanceof __await ? (this.v = v, this) : new __await(v);
1023
- }
1024
- function __asyncGenerator(thisArg, _arguments, generator) {
1025
- if (!Symbol.asyncIterator)
1026
- throw new TypeError("Symbol.asyncIterator is not defined.");
1027
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
1028
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
1029
- function verb(n) { if (g[n])
1030
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
1031
- function resume(n, v) { try {
1032
- step(g[n](v));
1033
- }
1034
- catch (e) {
1035
- settle(q[0][3], e);
1036
- } }
1037
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
1038
- function fulfill(value) { resume("next", value); }
1039
- function reject(value) { resume("throw", value); }
1040
- function settle(f, v) { if (f(v), q.shift(), q.length)
1041
- resume(q[0][0], q[0][1]); }
1042
- }
1043
- function __asyncDelegator(o) {
1044
- var i, p;
1045
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
1046
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
1047
- }
1048
- function __asyncValues(o) {
1049
- if (!Symbol.asyncIterator)
1050
- throw new TypeError("Symbol.asyncIterator is not defined.");
1051
- var m = o[Symbol.asyncIterator], i;
1052
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
1053
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
1054
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
1055
- }
1056
- function __makeTemplateObject(cooked, raw) {
1057
- if (Object.defineProperty) {
1058
- Object.defineProperty(cooked, "raw", { value: raw });
1059
- }
1060
- else {
1061
- cooked.raw = raw;
1062
- }
1063
- return cooked;
1064
- }
1065
- ;
1066
- var __setModuleDefault = Object.create ? (function (o, v) {
1067
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1068
- }) : function (o, v) {
1069
- o["default"] = v;
1070
- };
1071
- function __importStar(mod) {
1072
- if (mod && mod.__esModule)
1073
- return mod;
1074
- var result = {};
1075
- if (mod != null)
1076
- for (var k in mod)
1077
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
1078
- __createBinding(result, mod, k);
1079
- __setModuleDefault(result, mod);
1080
- return result;
1081
- }
1082
- function __importDefault(mod) {
1083
- return (mod && mod.__esModule) ? mod : { default: mod };
1084
- }
1085
- function __classPrivateFieldGet(receiver, state, kind, f) {
1086
- if (kind === "a" && !f)
1087
- throw new TypeError("Private accessor was defined without a getter");
1088
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1089
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
1090
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1091
- }
1092
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
1093
- if (kind === "m")
1094
- throw new TypeError("Private method is not writable");
1095
- if (kind === "a" && !f)
1096
- throw new TypeError("Private accessor was defined without a setter");
1097
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1098
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
1099
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1100
- }
1101
-
1102
- /* eslint-disable max-classes-per-file */
1103
- var moment$1 = moment___namespace;
1104
- var DateValidator = /** @class */ (function () {
1105
- function DateValidator() {
1106
- }
1107
- DateValidator.do = function (control) {
1108
- if (!control.parent || !control)
1109
- return null;
1110
- if (control && control.value) {
1111
- var dateFormat = 'MM-DD-YYYY';
1112
- if (!moment$1(moment$1(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true).isValid()) {
1113
- return {
1114
- invalidDate: true
1115
- };
1116
- }
1117
- }
1118
- return null;
1119
- };
1120
- return DateValidator;
1121
- }());
1122
- var DocumentValidator = /** @class */ (function () {
1123
- function DocumentValidator() {
1124
- }
1125
- DocumentValidator.do = function (control) {
1126
- if (!control.parent || !control)
1127
- return null;
1128
- if (control && control.value) {
1129
- if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
1130
- return {
1131
- invalidCpfCnpj: true
1132
- };
1133
- }
1134
- }
1135
- return null;
1136
- };
1137
- return DocumentValidator;
1138
- }());
1139
- var DocumentRutValidator = /** @class */ (function () {
1140
- function DocumentRutValidator() {
1141
- }
1142
- DocumentRutValidator.do = function (control) {
1143
- if (!control.parent || !control)
1144
- return null;
1145
- if (control && control.value) {
1146
- if (!MonkeyEcxUtils.isValidRUT(control.value)) {
1147
- return {
1148
- invalidRut: true
1149
- };
1150
- }
1151
- }
1152
- return null;
1153
- };
1154
- return DocumentRutValidator;
1155
- }());
1156
- var ZipCodeValidator = /** @class */ (function () {
1157
- function ZipCodeValidator() {
1158
- }
1159
- ZipCodeValidator.do = function (control) {
1160
- if (!control.parent || !control)
1161
- return null;
1162
- if (control && control.value) {
1163
- if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
1164
- return {
1165
- invalidZipCode: true
1166
- };
1167
- }
1168
- }
1169
- return null;
1170
- };
1171
- return ZipCodeValidator;
1172
- }());
1173
- var ComboValidator = /** @class */ (function () {
1174
- function ComboValidator() {
1175
- }
1176
- ComboValidator.do = function (control) {
1177
- if (!control.parent || !control)
1178
- return null;
1179
- if (control && control.value !== '0')
1180
- return null;
1181
- return {
1182
- invalidCombo: true
1183
- };
1184
- };
1185
- return ComboValidator;
1186
- }());
1187
- var isTrueValidator = /** @class */ (function () {
1188
- function isTrueValidator() {
1189
- }
1190
- isTrueValidator.do = function (control) {
1191
- if (!control.parent || !control)
1192
- return null;
1193
- if (control && control.value !== false)
1194
- return null;
1195
- return {
1196
- invalidTrue: true
1197
- };
1198
- };
1199
- return isTrueValidator;
1200
- }());
1201
- var PasswordMatchValidation = /** @class */ (function () {
1202
- function PasswordMatchValidation() {
1203
- }
1204
- PasswordMatchValidation.do = function (control) {
1205
- if (!control.parent || !control)
1206
- return null;
1207
- var parent = control.parent;
1208
- var password = parent.get('password').value;
1209
- var passwordConfirm = parent.get('passwordConfirm').value;
1210
- if (!password || !passwordConfirm)
1211
- return null;
1212
- if (password === passwordConfirm)
1213
- return null;
1214
- return {
1215
- passwordsNotMatching: true
1216
- };
1217
- };
1218
- return PasswordMatchValidation;
1219
- }());
1220
- var UrlValidator = /** @class */ (function () {
1221
- function UrlValidator() {
1222
- }
1223
- UrlValidator.do = function (control) {
1224
- if (!control.parent || !control)
1225
- return null;
1226
- if (control && control.value) {
1227
- if (!MonkeyEcxUtils.isValidUrl(control.value)) {
1228
- return {
1229
- invalidUrl: true
1230
- };
1231
- }
1232
- }
1233
- return null;
1234
- };
1235
- return UrlValidator;
1236
- }());
1237
- var CustomDatesStartValidator = /** @class */ (function () {
1238
- function CustomDatesStartValidator() {
1239
- }
1240
- CustomDatesStartValidator.do = function (control) {
1241
- if (!control.parent || !control)
1242
- return null;
1243
- var parent = control.parent;
1244
- var valueStart = parent.get('dateStart').value;
1245
- var valueEnd = parent.get('dateEnd').value;
1246
- var dateStart;
1247
- var dateEnd;
1248
- if (valueStart) {
1249
- dateStart = new Date(valueStart);
1250
- }
1251
- if (valueEnd) {
1252
- dateEnd = new Date(valueEnd);
1253
- }
1254
- if (!dateStart || !dateEnd)
1255
- return null;
1256
- if (dateStart > dateEnd) {
1257
- return {
1258
- dateStartMustBeLessThanAnd: true
1259
- };
1260
- }
1261
- return null;
1262
- };
1263
- return CustomDatesStartValidator;
1264
- }());
1265
- var CustomDatesEndValidator = /** @class */ (function () {
1266
- function CustomDatesEndValidator() {
1267
- }
1268
- CustomDatesEndValidator.do = function (control) {
1269
- if (!control.parent || !control)
1270
- return null;
1271
- var parent = control.parent;
1272
- var valueStart = parent.get('dateStart').value;
1273
- var valueEnd = parent.get('dateEnd').value;
1274
- var dateStart;
1275
- var dateEnd;
1276
- if (valueStart) {
1277
- dateStart = new Date(valueStart);
1278
- }
1279
- if (valueEnd) {
1280
- dateEnd = new Date(valueEnd);
1281
- }
1282
- if (!dateEnd || !dateStart)
1283
- return null;
1284
- if (dateEnd < dateStart) {
1285
- return {
1286
- dateEndMustBeGreaterThanStart: true
1287
- };
1288
- }
1289
- return null;
1290
- };
1291
- return CustomDatesEndValidator;
1292
- }());
1293
- var UnlockRegisterBuyerValidator = /** @class */ (function () {
1294
- function UnlockRegisterBuyerValidator() {
1295
- }
1296
- UnlockRegisterBuyerValidator.do = function (control) {
1297
- if (!control.parent || !control)
1298
- return null;
1299
- if (control && control.value !== '#MONKEYBUYER') {
1300
- return {
1301
- invalidUnlockRegister: true
1302
- };
1303
- }
1304
- return null;
1305
- };
1306
- return UnlockRegisterBuyerValidator;
1307
- }());
1308
- var UnlockRegisterSponsorValidator = /** @class */ (function () {
1309
- function UnlockRegisterSponsorValidator() {
1310
- }
1311
- UnlockRegisterSponsorValidator.do = function (control) {
1312
- if (!control.parent || !control)
1313
- return null;
1314
- if (control && control.value !== '#MONKEYSPONSOR') {
1315
- return {
1316
- invalidUnlockRegister: true
1317
- };
1318
- }
1319
- return null;
1320
- };
1321
- return UnlockRegisterSponsorValidator;
1322
- }());
1323
- var DateRangeValidator = /** @class */ (function () {
1324
- function DateRangeValidator() {
1325
- }
1326
- DateRangeValidator.do = function (control) {
1327
- if (!control.parent || !control) {
1328
- return null;
1329
- }
1330
- var dates = control.parent.get('dates').value;
1331
- if (dates &&
1332
- (!MonkeyEcxUtils.persistNullEmptyUndefined(dates.startDate) ||
1333
- !MonkeyEcxUtils.persistNullEmptyUndefined(dates.endDate))) {
1334
- return {
1335
- invalidDateRange: true
1336
- };
1337
- }
1338
- return null;
1339
- };
1340
- return DateRangeValidator;
1341
- }());
1342
-
1343
- var validateUtils = /*#__PURE__*/Object.freeze({
1344
- __proto__: null,
1345
- DateValidator: DateValidator,
1346
- DocumentValidator: DocumentValidator,
1347
- DocumentRutValidator: DocumentRutValidator,
1348
- ZipCodeValidator: ZipCodeValidator,
1349
- ComboValidator: ComboValidator,
1350
- isTrueValidator: isTrueValidator,
1351
- PasswordMatchValidation: PasswordMatchValidation,
1352
- UrlValidator: UrlValidator,
1353
- CustomDatesStartValidator: CustomDatesStartValidator,
1354
- CustomDatesEndValidator: CustomDatesEndValidator,
1355
- UnlockRegisterBuyerValidator: UnlockRegisterBuyerValidator,
1356
- UnlockRegisterSponsorValidator: UnlockRegisterSponsorValidator,
1357
- DateRangeValidator: DateRangeValidator
1358
- });
1359
-
1360
- /* eslint-disable no-unused-vars */
1361
- /* eslint-disable no-shadow */
1362
- var MonkeyEcxQueueEvents;
1363
- (function (MonkeyEcxQueueEvents) {
1364
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["OnGoing"] = 0] = "OnGoing";
1365
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["Finished"] = 1] = "Finished";
1366
- MonkeyEcxQueueEvents[MonkeyEcxQueueEvents["FinishedWithError"] = 2] = "FinishedWithError";
1367
- })(MonkeyEcxQueueEvents || (MonkeyEcxQueueEvents = {}));
1368
- var MonkeyEcxDownloadEvents;
1369
- (function (MonkeyEcxDownloadEvents) {
1370
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["OnGoing"] = 0] = "OnGoing";
1371
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["Finished"] = 1] = "Finished";
1372
- MonkeyEcxDownloadEvents[MonkeyEcxDownloadEvents["FinishedWithError"] = 2] = "FinishedWithError";
1373
- })(MonkeyEcxDownloadEvents || (MonkeyEcxDownloadEvents = {}));
1374
- var MonkeyEcxUploadEvents;
1375
- (function (MonkeyEcxUploadEvents) {
1376
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["OnGoing"] = 0] = "OnGoing";
1377
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["Finished"] = 1] = "Finished";
1378
- MonkeyEcxUploadEvents[MonkeyEcxUploadEvents["FinishedWithError"] = 2] = "FinishedWithError";
1379
- })(MonkeyEcxUploadEvents || (MonkeyEcxUploadEvents = {}));
1380
- // TODO pegar do json de config
1381
- var ApiEndPointsTokenNotMandatory;
1382
- (function (ApiEndPointsTokenNotMandatory) {
1383
- ApiEndPointsTokenNotMandatory["Assets"] = "assets/";
1384
- ApiEndPointsTokenNotMandatory["MonkeyEcx"] = "/monkeyecx";
1385
- ApiEndPointsTokenNotMandatory["ViaCep"] = "viacep.com.br/";
1386
- })(ApiEndPointsTokenNotMandatory || (ApiEndPointsTokenNotMandatory = {}));
1387
- // TODO pegar do json de config
1388
- var ApiEndPointsHeaderNotMandatory;
1389
- (function (ApiEndPointsHeaderNotMandatory) {
1390
- ApiEndPointsHeaderNotMandatory["Assets"] = "/assets";
1391
- ApiEndPointsHeaderNotMandatory["PayablesUpload"] = "payables-upload";
1392
- ApiEndPointsHeaderNotMandatory["PictureUser"] = "/user-pictures";
1393
- ApiEndPointsHeaderNotMandatory["Documents"] = "documents/";
1394
- ApiEndPointsHeaderNotMandatory["BuyerTaxFile"] = "/buyer-tax-file";
1395
- ApiEndPointsHeaderNotMandatory["ViaCep"] = "viacep.com.br/";
1396
- })(ApiEndPointsHeaderNotMandatory || (ApiEndPointsHeaderNotMandatory = {}));
1397
-
1398
- var statics = /*#__PURE__*/Object.freeze({
1399
- __proto__: null,
1400
- get MonkeyEcxQueueEvents () { return MonkeyEcxQueueEvents; },
1401
- get MonkeyEcxDownloadEvents () { return MonkeyEcxDownloadEvents; },
1402
- get MonkeyEcxUploadEvents () { return MonkeyEcxUploadEvents; },
1403
- get ApiEndPointsTokenNotMandatory () { return ApiEndPointsTokenNotMandatory; },
1404
- get ApiEndPointsHeaderNotMandatory () { return ApiEndPointsHeaderNotMandatory; }
1405
- });
1406
-
1407
- function buildQueuePropertys(queue) {
1408
- var params = {
1409
- item: Object.assign(Object.assign({}, queue), { id: MonkeyEcxUtils.getRandomString(40) }),
1410
- status: MonkeyEcxQueueEvents.OnGoing
1411
- };
1412
- return params;
1413
- }
1414
- function buildDownloadPropertys(name, description, size) {
1415
- var params = {
1416
- item: {
1417
- name: name,
1418
- description: description,
1419
- id: "" + MonkeyEcxUtils.getRandomString(40),
1420
- size: size,
1421
- createdAt: new Date()
1422
- },
1423
- status: MonkeyEcxQueueEvents.OnGoing
1424
- };
1425
- return params;
1426
- }
1427
- function buildUploadPropertys(name, description) {
1428
- var params = {
1429
- item: {
1430
- name: name,
1431
- description: description,
1432
- id: "" + MonkeyEcxUtils.getRandomString(40)
1433
- },
1434
- status: MonkeyEcxUploadEvents.OnGoing
1435
- };
1436
- return params;
1437
- }
1438
- function hasMonkeyEcxServiceAndHandlingProperties(context) {
1439
- return Object.prototype.hasOwnProperty.call(context, 'monkeyecxService');
1440
- }
1441
-
1442
- var decoratorsUtils = /*#__PURE__*/Object.freeze({
1443
- __proto__: null,
1444
- buildQueuePropertys: buildQueuePropertys,
1445
- buildDownloadPropertys: buildDownloadPropertys,
1446
- buildUploadPropertys: buildUploadPropertys,
1447
- hasMonkeyEcxServiceAndHandlingProperties: hasMonkeyEcxServiceAndHandlingProperties
1448
- });
1449
-
1450
- var moment = moment___namespace;
1451
- var EMAIL_REGEXP = /^[\w-.]+@([\w-]+\.)+[\w-]{1,64}$/;
1452
- function isEmptyInputValue(value) {
1453
- return value == null || value.length === 0;
1454
- }
1455
- function emailValidator(control) {
1456
- if (!control.parent || !control || isEmptyInputValue(control.value)) {
1457
- return null;
1458
- }
1459
- var test = EMAIL_REGEXP.test(control.value);
1460
- if (test)
1461
- return null;
1462
- return {
1463
- email: true
1464
- };
1465
- }
1466
- function dateRangeValidator(control) {
1467
- if (!control.parent || !control || isEmptyInputValue(control.value)) {
1468
- return null;
1469
- }
1470
- var dates = control.parent.get('dates').value;
1471
- if (dates &&
1472
- (!MonkeyEcxUtils.persistNullEmptyUndefined(dates === null || dates === void 0 ? void 0 : dates.startDate) ||
1473
- !MonkeyEcxUtils.persistNullEmptyUndefined(dates === null || dates === void 0 ? void 0 : dates.endDate))) {
1474
- return {
1475
- dateRange: true
1476
- };
1477
- }
1478
- return null;
1479
- }
1480
- function registerValidator(control, type) {
1481
- if (!control.parent || !control || isEmptyInputValue(control.value)) {
1482
- return null;
1483
- }
1484
- if (control && control.value !== ("#MONKEY" + type).toUpperCase()) {
1485
- return {
1486
- invalidUnlockRegister: true
1487
- };
1488
- }
1489
- return null;
1490
- }
1491
- function dateStartEndValidator(control) {
1492
- if (!control.parent || !control) {
1493
- return null;
1494
- }
1495
- var parent = control.parent;
1496
- var valueStart = parent.get('dateStart').value;
1497
- var valueEnd = parent.get('dateEnd').value;
1498
- var dateStart;
1499
- var dateEnd;
1500
- if (valueStart) {
1501
- dateStart = new Date(valueStart);
1502
- }
1503
- if (valueEnd) {
1504
- dateEnd = new Date(valueEnd);
1505
- }
1506
- if (!dateEnd || !dateStart)
1507
- return null;
1508
- if (dateStart > dateEnd) {
1509
- return {
1510
- dateStartMustBeLessThanAnd: true
1511
- };
1512
- }
1513
- return null;
1514
- }
1515
- function urlValidator(control) {
1516
- if (!control.parent || !control || isEmptyInputValue(control.value))
1517
- return null;
1518
- if (!MonkeyEcxUtils.isValidUrl(control.value)) {
1519
- return {
1520
- url: true
1521
- };
1522
- }
1523
- return null;
1524
- }
1525
- function passwordConfirmValidator(control) {
1526
- if (!control.parent || !control || isEmptyInputValue(control.value))
1527
- return null;
1528
- var parent = control.parent;
1529
- var password = parent.get('password').value;
1530
- var passwordConfirm = parent.get('passwordConfirm').value;
1531
- if (!password || !passwordConfirm)
1532
- return null;
1533
- if (password === passwordConfirm)
1534
- return null;
1535
- return {
1536
- passwordsNotMatching: true
1537
- };
1538
- }
1539
- function trueValidator(control) {
1540
- if (!control.parent || !control)
1541
- return null;
1542
- if (control && control.value !== false)
1543
- return null;
1544
- return {
1545
- invalidTrue: true
1546
- };
1547
- }
1548
- function comboValidator(control) {
1549
- if (!control.parent || !control)
1550
- return null;
1551
- if (control && control.value !== '0')
1552
- return null;
1553
- return {
1554
- invalidCombo: true
1555
- };
1556
- }
1557
- function zipCodeValidator(control) {
1558
- if (!control.parent || !control || isEmptyInputValue(control.value))
1559
- return null;
1560
- if (control && control.value) {
1561
- if (!MonkeyEcxUtils.isValidZipCode(control.value)) {
1562
- return {
1563
- invalidZipCode: true
1564
- };
1565
- }
1566
- }
1567
- return null;
1568
- }
1569
- function documentValidator(control, country) {
1570
- if (!control.parent || !control || isEmptyInputValue(control.value))
1571
- return null;
1572
- if (country === 'BR') {
1573
- if (!MonkeyEcxUtils.isCPFCNPJValid(control.value)) {
1574
- return {
1575
- invalidCpfCnpj: true
1576
- };
1577
- }
1578
- }
1579
- else if (country === 'CL') {
1580
- if (!MonkeyEcxUtils.isValidRUT(control.value)) {
1581
- return {
1582
- invalidCpfCnpj: true
1583
- };
1584
- }
1585
- }
1586
- return null;
1587
- }
1588
- function dateValidator(control) {
1589
- if (!control.parent || !control || isEmptyInputValue(control.value))
1590
- return null;
1591
- var dateFormat = 'MM-DD-YYYY';
1592
- if (!moment(moment(control.value).format(dateFormat), ['DD/MM/YYYY', 'MM-DD-YYYY', 'YYYY-MM-DD'], true).isValid()) {
1593
- return {
1594
- invalidDate: true
1595
- };
1596
- }
1597
- return null;
1598
- }
1599
- var Validators = /** @class */ (function () {
1600
- function Validators() {
1601
- }
1602
- Validators.email = function (control) {
1603
- return emailValidator(control);
1604
- };
1605
- Validators.dateRange = function (control) {
1606
- return dateRangeValidator(control);
1607
- };
1608
- Validators.unlockSponsorRegister = function (control) {
1609
- return registerValidator(control, 'sponsor');
1610
- };
1611
- Validators.unlockBuyerRegister = function (control) {
1612
- return registerValidator(control, 'buyer');
1613
- };
1614
- Validators.dateStartEnd = function (control) {
1615
- return dateStartEndValidator(control);
1616
- };
1617
- Validators.url = function (control) {
1618
- return urlValidator(control);
1619
- };
1620
- Validators.passwordConfirm = function (control) {
1621
- return passwordConfirmValidator(control);
1622
- };
1623
- Validators.true = function (control) {
1624
- return trueValidator(control);
1625
- };
1626
- Validators.combo = function (control) {
1627
- return comboValidator(control);
1628
- };
1629
- Validators.zipCode = function (control) {
1630
- return zipCodeValidator(control);
1631
- };
1632
- Validators.documentBR = function (control) {
1633
- return documentValidator(control, 'BR');
1634
- };
1635
- Validators.documentCL = function (control) {
1636
- return documentValidator(control, 'CL');
1637
- };
1638
- Validators.date = function (control) {
1639
- return dateValidator(control);
1640
- };
1641
- return Validators;
1642
- }());
1643
-
1644
- /* eslint-disable object-curly-newline */
1645
-
1646
- function MonkeyEcxCoreServiceConstructor() {
1647
- return function (target) {
1648
- Object.entries(target.prototype).forEach(function (_a) {
1649
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
1650
- var method = target.prototype[key];
1651
- if (key !== 'constructor') {
1652
- target.prototype[key] = function () {
1653
- var args = [];
1654
- for (var _i = 0; _i < arguments.length; _i++) {
1655
- args[_i] = arguments[_i];
1656
- }
1657
- var context = this;
1658
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1659
- context.monkeyecxService.monkeyecxHandlingService.clearAll();
1660
- }
1661
- var result = method.apply(context, args);
1662
- return result;
1663
- };
1664
- }
1665
- });
1666
- return target;
1667
- };
1668
- }
1669
- function MonkeyEcxCoreLog(tp) {
1670
- return function (target, propertyName, propertyDescriptor) {
1671
- var method = propertyDescriptor.value;
1672
- propertyDescriptor.value = function () {
1673
- var args = [];
1674
- for (var _i = 0; _i < arguments.length; _i++) {
1675
- args[_i] = arguments[_i];
1676
- }
1677
- var params = args
1678
- .map(function (a) {
1679
- return JSON.stringify(a);
1680
- })
1681
- .join();
1682
- var result = method.apply(this, args);
1683
- var r = JSON.stringify(result);
1684
- console.log("Call: " + propertyName + "(" + params + ") => " + r);
1685
- return result;
1686
- };
1687
- return propertyDescriptor;
1688
- };
1689
- }
1690
- function MonkeyEcxCoreClearDecorators() {
1691
- return function (target, propertyName, propertyDescriptor) {
1692
- var method = propertyDescriptor.value;
1693
- propertyDescriptor.value = function () {
1694
- var args = [];
1695
- for (var _i = 0; _i < arguments.length; _i++) {
1696
- args[_i] = arguments[_i];
1697
- }
1698
- var context = this;
1699
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1700
- context.monkeyecxService.monkeyecxHandlingService.clearAll();
1701
- }
1702
- var result = method.apply(context, args);
1703
- return result;
1704
- };
1705
- return propertyDescriptor;
1706
- };
1707
- }
1708
- function MonkeyEcxCoreService(params) {
1709
- return function (target, propertyName, propertyDescriptor) {
1710
- var method = propertyDescriptor.value;
1711
- propertyDescriptor.value = function () {
1712
- var args = [];
1713
- for (var _i = 0; _i < arguments.length; _i++) {
1714
- args[_i] = arguments[_i];
1715
- }
1716
- var context = this;
1717
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1718
- context.monkeyecxService.monkeyecxHandlingService.clearAll();
1719
- context.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxServiceCredentials(params);
1720
- }
1721
- var result = method.apply(context, args);
1722
- return result;
1723
- };
1724
- return propertyDescriptor;
1725
- };
1726
- }
1727
- function MonkeyEcxCoreServicePaged(params) {
1728
- return function (target, propertyName, propertyDescriptor) {
1729
- var method = propertyDescriptor.value;
1730
- propertyDescriptor.value = function () {
1731
- var args = [];
1732
- for (var _i = 0; _i < arguments.length; _i++) {
1733
- args[_i] = arguments[_i];
1734
- }
1735
- var context = this;
1736
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1737
- var credentials = context.monkeyecxService.monkeyecxHandlingService.getMonkeyEcxServiceCredentials();
1738
- var requestPaged = null;
1739
- if (credentials) {
1740
- requestPaged = credentials.requestPaged;
1741
- }
1742
- context.monkeyecxService.monkeyecxHandlingService.clearAll();
1743
- context.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxServiceCredentials(Object.assign(Object.assign({}, params), (requestPaged || null)));
1744
- }
1745
- var result = method.apply(context, args);
1746
- return result;
1747
- };
1748
- return propertyDescriptor;
1749
- };
1750
- }
1751
- function MonkeyEcxCoreServiceQueue(name, description, params) {
1752
- return function (target, propertyName, propertyDescriptor) {
1753
- var method = propertyDescriptor.value;
1754
- propertyDescriptor.value = function () {
1755
- var args = [];
1756
- for (var _i = 0; _i < arguments.length; _i++) {
1757
- args[_i] = arguments[_i];
1758
- }
1759
- var context = this;
1760
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1761
- if (MonkeyEcxUtils.persistNullEmptyUndefined(params)) {
1762
- context.monkeyecxService.monkeyecxHandlingService.clearAll();
1763
- context.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxServiceCredentials(params);
1764
- }
1765
- context.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxRequestQueue(buildQueuePropertys({
1766
- name: name,
1767
- description: description
1768
- }));
1769
- }
1770
- var result = method.apply(context, args);
1771
- return result;
1772
- };
1773
- return propertyDescriptor;
1774
- };
1775
- }
1776
-
1777
- /* eslint-disable space-before-function-paren */
1778
- function MonkeyEcxServiceDownload(name, description, params) {
1779
- return function (target, propertyName, propertyDescriptor) {
1780
- var method = propertyDescriptor.value;
1781
- propertyDescriptor.value = function () {
1782
- var args = [];
1783
- for (var _i = 0; _i < arguments.length; _i++) {
1784
- args[_i] = arguments[_i];
1785
- }
1786
- var context = this;
1787
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1788
- if (i1.MonkeyUtils.persistNullEmptyUndefined(params)) {
1789
- context.monkeyecxService.monkeyecxHandlingService.clearAll();
1790
- context.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxServiceCredentials(params);
1791
- }
1792
- context.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxRequestDownload(Object.assign({}, buildDownloadPropertys(name, description)));
1793
- }
1794
- var result = method.apply(context, args);
1795
- return result;
1796
- };
1797
- return propertyDescriptor;
1798
- };
1799
- }
1800
-
1801
- /* eslint-disable space-before-function-paren */
1802
- function MonkeyEcxServiceUpload(name, description, params) {
1803
- return function (target, propertyName, propertyDescriptor) {
1804
- var method = propertyDescriptor.value;
1805
- propertyDescriptor.value = function () {
1806
- var args = [];
1807
- for (var _i = 0; _i < arguments.length; _i++) {
1808
- args[_i] = arguments[_i];
1809
- }
1810
- var context = this;
1811
- if (hasMonkeyEcxServiceAndHandlingProperties(context)) {
1812
- if (i1.MonkeyUtils.persistNullEmptyUndefined(params)) {
1813
- context.monkeyecxService.monkeyecxHandlingService.clearAll();
1814
- context.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxServiceCredentials(params);
1815
- }
1816
- context.monkeyecxService.monkeyecxHandlingService.setMonkeyEcxRequestUpload(Object.assign({}, buildUploadPropertys(name, description)));
1817
- }
1818
- var result = method.apply(context, args);
1819
- return result;
1820
- };
1821
- return propertyDescriptor;
1822
- };
1823
- }
1824
-
1825
- var MonkeyEcxDragDropDirective = /** @class */ (function () {
1826
- function MonkeyEcxDragDropDirective() {
1827
- this.onFileDropped = new i0.EventEmitter();
1828
- this.background = '#f5fcff';
1829
- this.opacity = '1';
1830
- }
1831
- MonkeyEcxDragDropDirective.prototype.onDragOver = function (evt) {
1832
- evt.preventDefault();
1833
- evt.stopPropagation();
1834
- this.background = '#9ecbec';
1835
- this.opacity = '0.8';
1836
- };
1837
- MonkeyEcxDragDropDirective.prototype.onDragLeave = function (evt) {
1838
- evt.preventDefault();
1839
- evt.stopPropagation();
1840
- this.background = '#f5fcff';
1841
- this.opacity = '1';
1842
- };
1843
- MonkeyEcxDragDropDirective.prototype.ondrop = function (evt) {
1844
- evt.preventDefault();
1845
- evt.stopPropagation();
1846
- this.background = '#f5fcff';
1847
- this.opacity = '1';
1848
- var files = evt.dataTransfer.files;
1849
- if (files.length > 0) {
1850
- this.onFileDropped.emit(files);
1851
- }
1852
- };
1853
- return MonkeyEcxDragDropDirective;
1854
- }());
1855
- MonkeyEcxDragDropDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDragDropDirective, deps: [], target: i0__namespace.ɵɵFactoryTarget.Directive });
1856
- MonkeyEcxDragDropDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: MonkeyEcxDragDropDirective, selector: "[monkeyecxDragDrop]", outputs: { onFileDropped: "onFileDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "ondrop($event)" }, properties: { "style.background-color": "this.background", "style.opacity": "this.opacity" } }, ngImport: i0__namespace });
1857
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDragDropDirective, decorators: [{
1858
- type: i0.Directive,
1859
- args: [{
1860
- selector: '[monkeyecxDragDrop]'
1861
- }]
1862
- }], propDecorators: { onFileDropped: [{
1863
- type: i0.Output
1864
- }], background: [{
1865
- type: i0.HostBinding,
1866
- args: ['style.background-color']
1867
- }], opacity: [{
1868
- type: i0.HostBinding,
1869
- args: ['style.opacity']
1870
- }], onDragOver: [{
1871
- type: i0.HostListener,
1872
- args: ['dragover', ['$event']]
1873
- }], onDragLeave: [{
1874
- type: i0.HostListener,
1875
- args: ['dragleave', ['$event']]
1876
- }], ondrop: [{
1877
- type: i0.HostListener,
1878
- args: ['drop', ['$event']]
1879
- }] } });
1880
-
1881
- var MonkeyEcxFormatCurrency = /** @class */ (function () {
1882
- function MonkeyEcxFormatCurrency(elementRef, injector) {
1883
- var _this = this;
1884
- this.elementRef = elementRef;
1885
- this.injector = injector;
1886
- this.currencyCode = 'BRL';
1887
- this.currentLocale = 'pt-BR';
1888
- this.el = this.elementRef.nativeElement;
1889
- this.currency = this.injector.get(i1$2.CurrencyPipe);
1890
- var translateService = this.injector.get(i1$1.TranslateService);
1891
- translateService.get('MONKEY-CURRENCY-CODE').subscribe(function (_) {
1892
- _this.currencyCode = _;
1893
- _this.currentLocale = translateService.getDefaultLang();
1894
- });
1895
- }
1896
- MonkeyEcxFormatCurrency.prototype.handle = function (value) {
1897
- var _a = this, currencyCode = _a.currencyCode, currentLocale = _a.currentLocale;
1898
- var newValue = MonkeyEcxUtils.handleOnlyNumbers(value);
1899
- return this.currency.transform(newValue / 100, currencyCode, 'symbol', '', currentLocale);
1900
- };
1901
- MonkeyEcxFormatCurrency.prototype.ngOnInit = function () {
1902
- this.el.value = this.handle(this.el.value);
1903
- };
1904
- MonkeyEcxFormatCurrency.prototype.onInput = function (value) {
1905
- this.el.value = this.handle(value);
1906
- };
1907
- return MonkeyEcxFormatCurrency;
1908
- }());
1909
- MonkeyEcxFormatCurrency.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatCurrency, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1910
- MonkeyEcxFormatCurrency.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: MonkeyEcxFormatCurrency, selector: "[monkeyecxFormatCurrency]", host: { listeners: { "input": "onInput($event.target.value)" } }, providers: [i1$2.CurrencyPipe], ngImport: i0__namespace });
1911
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatCurrency, decorators: [{
1912
- type: i0.Directive,
1913
- args: [{
1914
- selector: '[monkeyecxFormatCurrency]',
1915
- providers: [i1$2.CurrencyPipe]
1916
- }]
1917
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Injector }]; }, propDecorators: { onInput: [{
1918
- type: i0.HostListener,
1919
- args: ['input', ['$event.target.value']]
1920
- }] } });
1921
-
1922
- var MonkeyEcxFormatUpper = /** @class */ (function () {
1923
- function MonkeyEcxFormatUpper(_el, _renderer) {
1924
- this._el = _el;
1925
- this._renderer = _renderer;
1926
- // not to do
1927
- }
1928
- MonkeyEcxFormatUpper.prototype.onKeyDown = function (evt) {
1929
- var value = this._el.nativeElement.value.toUpperCase();
1930
- this._renderer.setProperty(this._el.nativeElement, 'value', value);
1931
- this._onChange(value);
1932
- evt.preventDefault();
1933
- };
1934
- MonkeyEcxFormatUpper.prototype.onBlur = function () {
1935
- this._touched();
1936
- };
1937
- MonkeyEcxFormatUpper.prototype.writeValue = function (value) {
1938
- this._renderer.setProperty(this._el.nativeElement, 'value', value);
1939
- };
1940
- MonkeyEcxFormatUpper.prototype.registerOnChange = function (fn) {
1941
- this._onChange = fn;
1942
- };
1943
- MonkeyEcxFormatUpper.prototype.registerOnTouched = function (fn) {
1944
- this._touched = fn;
1945
- };
1946
- MonkeyEcxFormatUpper.prototype.setDisabledState = function (isDisabled) {
1947
- this._renderer.setProperty(this._el.nativeElement, 'disabled', isDisabled);
1948
- };
1949
- return MonkeyEcxFormatUpper;
1950
- }());
1951
- MonkeyEcxFormatUpper.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatUpper, deps: [{ token: i0__namespace.ElementRef, self: true }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1952
- MonkeyEcxFormatUpper.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: MonkeyEcxFormatUpper, selector: "[monkeyecxFormatUpper]", host: { listeners: { "keyup": "onKeyDown($event)", "blur": "onBlur($event)" } }, providers: [
1953
- {
1954
- provide: forms.NG_VALUE_ACCESSOR,
1955
- useExisting: i0.forwardRef(function () {
1956
- // eslint-disable-next-line no-use-before-define
1957
- return MonkeyEcxFormatUpper;
1958
- }),
1959
- multi: true
1960
- }
1961
- ], ngImport: i0__namespace });
1962
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFormatUpper, decorators: [{
1963
- type: i0.Directive,
1964
- args: [{
1965
- selector: '[monkeyecxFormatUpper]',
1966
- providers: [
1967
- {
1968
- provide: forms.NG_VALUE_ACCESSOR,
1969
- useExisting: i0.forwardRef(function () {
1970
- // eslint-disable-next-line no-use-before-define
1971
- return MonkeyEcxFormatUpper;
1972
- }),
1973
- multi: true
1974
- }
1975
- ]
1976
- }]
1977
- }], ctorParameters: function () {
1978
- return [{ type: i0__namespace.ElementRef, decorators: [{
1979
- type: i0.Self
1980
- }] }, { type: i0__namespace.Renderer2 }];
1981
- }, propDecorators: { onKeyDown: [{
1982
- type: i0.HostListener,
1983
- args: ['keyup', ['$event']]
1984
- }], onBlur: [{
1985
- type: i0.HostListener,
1986
- args: ['blur', ['$event']]
1987
- }] } });
1988
-
1989
- var MonkeyEcxOnlyAlphaNumericDirective = /** @class */ (function () {
1990
- function MonkeyEcxOnlyAlphaNumericDirective(elementRef) {
1991
- this.elementRef = elementRef;
1992
- // not to do
1993
- }
1994
- MonkeyEcxOnlyAlphaNumericDirective.prototype.onInputChange = function (event) {
1995
- var initalValue = this.elementRef.nativeElement.value;
1996
- this.elementRef.nativeElement.value = MonkeyEcxUtils.handleOnlyAlphaNumeric(initalValue);
1997
- if (initalValue !== this.elementRef.nativeElement.value) {
1998
- event.stopPropagation();
1999
- }
2000
- };
2001
- return MonkeyEcxOnlyAlphaNumericDirective;
2002
- }());
2003
- MonkeyEcxOnlyAlphaNumericDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxOnlyAlphaNumericDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2004
- MonkeyEcxOnlyAlphaNumericDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: MonkeyEcxOnlyAlphaNumericDirective, selector: "[monkeyecxOnlyAlphaNumeric]", host: { listeners: { "input": "onInputChange($event)" } }, ngImport: i0__namespace });
2005
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxOnlyAlphaNumericDirective, decorators: [{
2006
- type: i0.Directive,
2007
- args: [{
2008
- selector: '[monkeyecxOnlyAlphaNumeric]'
2009
- }]
2010
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { onInputChange: [{
2011
- type: i0.HostListener,
2012
- args: ['input', ['$event']]
2013
- }] } });
2014
-
2015
- var MonkeyEcxOnlyNumbersDirective = /** @class */ (function () {
2016
- function MonkeyEcxOnlyNumbersDirective(elementRef) {
2017
- this.elementRef = elementRef;
2018
- // not to do
2019
- }
2020
- MonkeyEcxOnlyNumbersDirective.prototype.onInputChange = function (event) {
2021
- var initalValue = this.elementRef.nativeElement.value;
2022
- this.elementRef.nativeElement.value = MonkeyEcxUtils.handleOnlyNumbers(initalValue);
2023
- if (initalValue !== this.elementRef.nativeElement.value) {
2024
- event.stopPropagation();
2025
- }
2026
- };
2027
- return MonkeyEcxOnlyNumbersDirective;
2028
- }());
2029
- MonkeyEcxOnlyNumbersDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxOnlyNumbersDirective, deps: [{ token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2030
- MonkeyEcxOnlyNumbersDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: MonkeyEcxOnlyNumbersDirective, selector: "[monkeyecxOnlyNumbers]", host: { listeners: { "input": "onInputChange($event)" } }, ngImport: i0__namespace });
2031
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxOnlyNumbersDirective, decorators: [{
2032
- type: i0.Directive,
2033
- args: [{
2034
- selector: '[monkeyecxOnlyNumbers]'
2035
- }]
2036
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }]; }, propDecorators: { onInputChange: [{
2037
- type: i0.HostListener,
2038
- args: ['input', ['$event']]
2039
- }] } });
2040
-
2041
- var MonkeyEcxRequestPagedHandling = /** @class */ (function () {
2042
- function MonkeyEcxRequestPagedHandling(_url, _pagedParams) {
2043
- this.url = _url;
2044
- this.pagedParams = _pagedParams || {
2045
- page: {}
2046
- };
2047
- }
2048
- MonkeyEcxRequestPagedHandling.prototype.handlePagedValuesFromApi = function (url) {
2049
- if (url.search('\\?') < 0)
2050
- return url;
2051
- var params = url.substr(url.search('\\?') + 1, url.length);
2052
- url = url.substr(0, url.search('\\?'));
2053
- return url + "?" + new i1$4.HttpParams({
2054
- fromString: params
2055
- }).delete('size').delete('page').toString();
2056
- };
2057
- MonkeyEcxRequestPagedHandling.prototype.getUrlParams = function (url) {
2058
- var pagedParams = this.pagedParams;
2059
- var _a = pagedParams === null || pagedParams === void 0 ? void 0 : pagedParams.page, number = _a.number, size = _a.size;
2060
- var hasInitialQueryParams = url.search('\\?') > 0;
2061
- return (!hasInitialQueryParams ? '?' : '&') + "page=" + (number || 0) + "&size=" + (size || 20);
2062
- };
2063
- MonkeyEcxRequestPagedHandling.prototype.getRequestWithPagedParams = function () {
2064
- var url = this.url;
2065
- var handled = this.handlePagedValuesFromApi(url);
2066
- return "" + handled + this.getUrlParams(handled);
2067
- };
2068
- return MonkeyEcxRequestPagedHandling;
2069
- }());
2070
-
2071
- var MonkeyEcxCommonsService = /** @class */ (function () {
2072
- function MonkeyEcxCommonsService(monkeyecxService, tokenStorage, otherArgs) {
2073
- this.monkeyecxService = monkeyecxService;
2074
- this.tokenStorage = tokenStorage;
2075
- this.otherArgs = otherArgs;
2076
- this.flagValidator = true;
2077
- this.__requestPaged = null;
2078
- this.__onSearchChanged$ = new rxjs.BehaviorSubject(null);
2079
- this.__onDataChanged$ = new rxjs.BehaviorSubject(null);
2080
- this.__onLoadingInProgress$ = new rxjs.BehaviorSubject(false);
2081
- this.__onDataDeleted$ = new rxjs.BehaviorSubject(null);
2082
- this.__onErrorChanged$ = new rxjs.BehaviorSubject(null);
2083
- this.__onGovernmentIdDataChanged$ = new rxjs.BehaviorSubject(null);
2084
- this.__onZipCodeDataChanged$ = new rxjs.BehaviorSubject(null);
2085
- this.__oni18nDataChanged$ = new rxjs.BehaviorSubject(null);
2086
- this.__onDoSearch$ = new rxjs.BehaviorSubject(null);
2087
- this.__onDoPagination$ = new rxjs.BehaviorSubject(null);
2088
- this.handleInit();
2089
- }
2090
- MonkeyEcxCommonsService.prototype.handleInit = function () {
2091
- var _this = this;
2092
- var _a, _b, _c;
2093
- if (this.tokenStorage) {
2094
- this.__tokenCredentials = this.tokenStorage.getToken();
2095
- }
2096
- if ((_a = this.otherArgs) === null || _a === void 0 ? void 0 : _a.router) {
2097
- var clearOnChangeRoute_1 = ((_c = (_b = this.otherArgs) === null || _b === void 0 ? void 0 : _b.schedule) === null || _c === void 0 ? void 0 : _c.options).clearOnChangeRoute;
2098
- this.otherArgs.router.events
2099
- .pipe(operators.filter(function (event) {
2100
- return event instanceof i1$3.NavigationStart;
2101
- }), operators.take(1))
2102
- .subscribe(function () {
2103
- var _a, _b, _c;
2104
- if (_this.__schedule && clearOnChangeRoute_1) {
2105
- (_c = (_b = (_a = _this.otherArgs) === null || _a === void 0 ? void 0 : _a.schedule) === null || _b === void 0 ? void 0 : _b.service) === null || _c === void 0 ? void 0 : _c.removeSchedule(_this.__schedule);
2106
- _this.__schedule = null;
2107
- }
2108
- });
2109
- }
2110
- };
2111
- MonkeyEcxCommonsService.prototype.getRole = function () {
2112
- var __tokenCredentials = this.__tokenCredentials;
2113
- if (!__tokenCredentials)
2114
- return '';
2115
- if ((__tokenCredentials === null || __tokenCredentials === void 0 ? void 0 : __tokenCredentials.programAdmin) === 'true') {
2116
- return 'PROGRAM_ADMIN';
2117
- }
2118
- return (__tokenCredentials === null || __tokenCredentials === void 0 ? void 0 : __tokenCredentials.role) || '';
2119
- };
2120
- MonkeyEcxCommonsService.prototype.allowedSecurityAccess = function (args) {
2121
- if (!args)
2122
- return true;
2123
- var roles = args === null || args === void 0 ? void 0 : args.roles;
2124
- var byExclusion = args === null || args === void 0 ? void 0 : args.byExclusion;
2125
- var found = roles === null || roles === void 0 ? void 0 : roles.indexOf(this.getRole());
2126
- var ret = false;
2127
- if (byExclusion) {
2128
- ret = true;
2129
- if (found > -1) {
2130
- ret = false;
2131
- }
2132
- }
2133
- else {
2134
- ret = false;
2135
- if (found > -1) {
2136
- ret = true;
2137
- }
2138
- }
2139
- if (!roles || roles.length === 0 || this.getRole() === 'PROGRAM_ADMIN') {
2140
- ret = true;
2141
- }
2142
- return ret;
2143
- };
2144
- MonkeyEcxCommonsService.prototype.navigateToErrorPage = function (statusCode, router) {
2145
- var routes = {
2146
- 403: 'forbidden',
2147
- 404: 'not-found',
2148
- 500: 'service-problems',
2149
- 503: 'service-problems'
2150
- };
2151
- if (!router) {
2152
- // eslint-disable-next-line no-console
2153
- console.error('Router must be declared');
2154
- }
2155
- else {
2156
- router.navigate([("/app/pages/" + routes[statusCode]).toLowerCase()], {
2157
- skipLocationChange: true
2158
- });
2159
- }
2160
- };
2161
- MonkeyEcxCommonsService.prototype.setPage = function (requestPaged) {
2162
- this.__requestPaged = Object.assign(Object.assign({}, this.__requestPaged), requestPaged);
2163
- return this;
2164
- };
2165
- MonkeyEcxCommonsService.prototype.nextPage = function () {
2166
- if (!this.__requestPaged)
2167
- return false;
2168
- var page = this.__requestPaged.page;
2169
- var number = page.number, totalPages = page.totalPages;
2170
- if (number < totalPages) {
2171
- this.__requestPaged = Object.assign(Object.assign({}, this.__requestPaged), { page: Object.assign(Object.assign({}, page), { number: number + 1 }) });
2172
- return true;
2173
- }
2174
- return false;
2175
- };
2176
- MonkeyEcxCommonsService.prototype.getEmbeddedData = function (data, field) {
2177
- var _embedded = data._embedded;
2178
- return _embedded ? _embedded[field] : null;
2179
- };
2180
- MonkeyEcxCommonsService.prototype.getNormalizedUrl = function (url) {
2181
- var __requestPaged = this.__requestPaged;
2182
- return new MonkeyEcxRequestPagedHandling(url, __requestPaged).getRequestWithPagedParams();
2183
- };
2184
- MonkeyEcxCommonsService.prototype.clear = function (clearData) {
2185
- var _a, _b, _c;
2186
- if (clearData) {
2187
- this.__data = null;
2188
- this.__requestPaged = null;
2189
- this.__params = null;
2190
- this.__page = null;
2191
- if (this.__schedule) {
2192
- var queue = this.__schedule.queue;
2193
- if (queue) {
2194
- this.otherArgs.queue.service.removeQueueItem(queue);
2195
- }
2196
- (_c = (_b = (_a = this.otherArgs) === null || _a === void 0 ? void 0 : _a.schedule) === null || _b === void 0 ? void 0 : _b.service) === null || _c === void 0 ? void 0 : _c.removeSchedule(this.__schedule);
2197
- this.__schedule = null;
2198
- }
2199
- }
2200
- this.__error = null;
2201
- this.__handledError = null;
2202
- this.flagValidator = false;
2203
- };
2204
- MonkeyEcxCommonsService.prototype.resolve = function (route, state, otherArgs) {
2205
- var _this = this;
2206
- var _a, _b, _c;
2207
- this.__data = null;
2208
- this.__page = null;
2209
- this.__requestPaged = null;
2210
- this.flagValidator = true;
2211
- if (this.tokenStorage) {
2212
- this.__tokenCredentials = this.tokenStorage.getToken();
2213
- }
2214
- if (this.allowedSecurityAccess(otherArgs === null || otherArgs === void 0 ? void 0 : otherArgs.security)) {
2215
- Object.entries(this).forEach(function (_d) {
2216
- var _e = __read(_d, 2), key = _e[0], value = _e[1];
2217
- if (value instanceof rxjs.BehaviorSubject) {
2218
- _this[key] = new rxjs.BehaviorSubject(null);
2219
- }
2220
- });
2221
- if (this.__schedule) {
2222
- (_c = (_b = (_a = this.otherArgs) === null || _a === void 0 ? void 0 : _a.schedule) === null || _b === void 0 ? void 0 : _b.service) === null || _c === void 0 ? void 0 : _c.removeSchedule(this.__schedule);
2223
- this.__schedule = null;
2224
- }
2225
- var __requestPaged = this.__requestPaged;
2226
- if (!__requestPaged) {
2227
- this.setPage({
2228
- page: {
2229
- number: 0,
2230
- size: 10
2231
- }
2232
- });
2233
- }
2234
- if (otherArgs === null || otherArgs === void 0 ? void 0 : otherArgs.callbackPagination) {
2235
- this.__onDoPagination$.subscribe(function () {
2236
- if (!_this.__onLoadingInProgress$.value) {
2237
- var hasMorePages = _this.setPage({
2238
- page: Object.assign({}, _this.__page)
2239
- }).nextPage();
2240
- if (hasMorePages && (otherArgs === null || otherArgs === void 0 ? void 0 : otherArgs.callbackPagination)) {
2241
- otherArgs.callbackPagination();
2242
- }
2243
- }
2244
- });
2245
- }
2246
- if (otherArgs === null || otherArgs === void 0 ? void 0 : otherArgs.translateOptions) {
2247
- var _d = otherArgs.translateOptions, service = _d.service, keys = _d.keys;
2248
- this.geti18n(service, keys);
2249
- }
2250
- if (otherArgs === null || otherArgs === void 0 ? void 0 : otherArgs.feature) {
2251
- var _e = otherArgs.feature, flag_1 = _e.flag, service_1 = _e.service;
2252
- service_1.onFlags
2253
- .pipe(operators.takeWhile(function () {
2254
- return _this.flagValidator;
2255
- }))
2256
- .subscribe(function (val) {
2257
- if (val) {
2258
- var hasFlag = service_1.getFlag(flag_1);
2259
- if (MonkeyEcxUtils.persistNullEmptyUndefined(hasFlag)) {
2260
- if (!hasFlag) {
2261
- _this.navigateToErrorPage(404, otherArgs.router);
2262
- return;
2263
- }
2264
- }
2265
- otherArgs === null || otherArgs === void 0 ? void 0 : otherArgs.callbackMain();
2266
- }
2267
- });
2268
- }
2269
- else {
2270
- otherArgs === null || otherArgs === void 0 ? void 0 : otherArgs.callbackMain();
2271
- }
2272
- }
2273
- else {
2274
- this.navigateToErrorPage(403, otherArgs.router);
2275
- }
2276
- };
2277
- MonkeyEcxCommonsService.prototype.getHTTPHeaderApplicationPDF = function () {
2278
- return {
2279
- observe: 'response',
2280
- responseType: 'blob'
2281
- };
2282
- };
2283
- MonkeyEcxCommonsService.prototype.genericMethod = function (link, data, callback) {
2284
- var href = link.href, type = link.type;
2285
- this.monkeyecxService[type.toLowerCase()]("" + href, data).subscribe(function (resp) {
2286
- if (callback)
2287
- callback();
2288
- }, function (err) {
2289
- rxjs.throwError(err);
2290
- });
2291
- };
2292
- MonkeyEcxCommonsService.prototype.geti18n = function (translateService, keys) {
2293
- var _this = this;
2294
- translateService
2295
- .getStreamOnTranslationChange(keys)
2296
- .subscribe(function (translations) {
2297
- _this.__i18n = translations;
2298
- _this.__oni18nDataChanged$.next(null);
2299
- });
2300
- };
2301
- return MonkeyEcxCommonsService;
2302
- }());
2303
- __decorate([
2304
- MonkeyEcxCoreService({
2305
- requestInProgress: {
2306
- showProgress: true
2307
- }
2308
- })
2309
- ], MonkeyEcxCommonsService.prototype, "genericMethod", null);
2310
-
2311
- /* eslint-disable max-len */
2312
- var MonkeyEcxHandlingService = /** @class */ (function () {
2313
- function MonkeyEcxHandlingService() {
2314
- }
2315
- MonkeyEcxHandlingService.prototype.clearAll = function () {
2316
- this.monkeyecxServiceCredentials = null;
2317
- this.monkeyecxRequestQueue = null;
2318
- this.monkeyecxRequestDownload = null;
2319
- this.monkeyecxRequestUpload = null;
2320
- };
2321
- MonkeyEcxHandlingService.prototype.setMonkeyEcxServiceCredentials = function (param) {
2322
- this.monkeyecxServiceCredentials = param;
2323
- };
2324
- MonkeyEcxHandlingService.prototype.getMonkeyEcxServiceCredentials = function () {
2325
- return this.monkeyecxServiceCredentials;
2326
- };
2327
- MonkeyEcxHandlingService.prototype.setMonkeyEcxRequestQueue = function (queue) {
2328
- this.monkeyecxRequestQueue = queue;
2329
- };
2330
- MonkeyEcxHandlingService.prototype.getMonkeyEcxRequestQueue = function () {
2331
- return this.monkeyecxRequestQueue;
2332
- };
2333
- MonkeyEcxHandlingService.prototype.setMonkeyEcxRequestDownload = function (download) {
2334
- this.monkeyecxRequestDownload = download;
2335
- };
2336
- MonkeyEcxHandlingService.prototype.getMonkeyEcxRequestDownload = function () {
2337
- return this.monkeyecxRequestDownload;
2338
- };
2339
- MonkeyEcxHandlingService.prototype.setMonkeyEcxRequestUpload = function (upload) {
2340
- this.monkeyecxRequestUpload = upload;
2341
- };
2342
- MonkeyEcxHandlingService.prototype.getMonkeyEcxRequestUpload = function () {
2343
- return this.monkeyecxRequestUpload;
2344
- };
2345
- return MonkeyEcxHandlingService;
2346
- }());
2347
- MonkeyEcxHandlingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHandlingService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2348
- MonkeyEcxHandlingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHandlingService, providedIn: 'root' });
2349
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHandlingService, decorators: [{
2350
- type: i0.Injectable,
2351
- args: [{
2352
- providedIn: 'root'
2353
- }]
2354
- }] });
2355
-
2356
- var MonkeyEcxService = /** @class */ (function () {
2357
- function MonkeyEcxService(http, monkeyecxHandlingService) {
2358
- this.http = http;
2359
- this.monkeyecxHandlingService = monkeyecxHandlingService;
2360
- // not to do
2361
- }
2362
- MonkeyEcxService.prototype.handlelize = function (params) {
2363
- var e_1, _a;
2364
- if (!params) {
2365
- return params;
2366
- }
2367
- try {
2368
- // eslint-disable-next-line no-restricted-syntax
2369
- for (var _b = __values([
2370
- 'createdAt',
2371
- 'createUserId',
2372
- 'updatedAt',
2373
- 'lastUserId',
2374
- '_links',
2375
- 'governmentIdType',
2376
- 'governmentIdMask',
2377
- 'screenType',
2378
- 'screenTab'
2379
- ]), _c = _b.next(); !_c.done; _c = _b.next()) {
2380
- var field = _c.value;
2381
- delete params[field];
2382
- }
2383
- }
2384
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2385
- finally {
2386
- try {
2387
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2388
- }
2389
- finally { if (e_1) throw e_1.error; }
2390
- }
2391
- return params;
2392
- };
2393
- MonkeyEcxService.prototype.get = function (url, options) {
2394
- return this.http.get(url, options);
2395
- };
2396
- MonkeyEcxService.prototype.post = function (url, params, options) {
2397
- return this.http.post(url, params, options);
2398
- };
2399
- MonkeyEcxService.prototype.put = function (url, params) {
2400
- return this.http.put(url, this.handlelize(Object.assign({}, params)));
2401
- };
2402
- MonkeyEcxService.prototype.delete = function (url, params) {
2403
- return this.http.delete(url, params);
2404
- };
2405
- MonkeyEcxService.prototype.download = function (url, options, filename) {
2406
- this.http.get(url, options).subscribe(function (resp) {
2407
- var headers = resp.headers, body = resp.body;
2408
- var contentType = headers.get('Content-Type');
2409
- var contentDisposition = headers.get('Content-Disposition');
2410
- if (contentDisposition) {
2411
- filename = contentDisposition
2412
- .split(';')[1]
2413
- .split('filename')[1]
2414
- .split('=')[1]
2415
- .trim()
2416
- .replace(new RegExp(/"/g), '');
2417
- }
2418
- var blob = new Blob([body], {
2419
- type: "" + contentType
2420
- });
2421
- return {
2422
- filename: filename,
2423
- blob: blob
2424
- };
2425
- }, function (err) {
2426
- rxjs.throwError(err);
2427
- });
2428
- };
2429
- MonkeyEcxService.prototype.downloadOb = function (url, options, filename) {
2430
- return this.http.get(url, options).pipe(operators.map(function (resp) {
2431
- var headers = resp.headers, body = resp.body;
2432
- var contentType = headers.get('Content-Type');
2433
- var contentDisposition = headers.get('Content-Disposition');
2434
- if (contentDisposition) {
2435
- filename = contentDisposition
2436
- .split(';')[1]
2437
- .split('filename')[1]
2438
- .split('=')[1]
2439
- .trim()
2440
- .replace(new RegExp(/"/g), '');
2441
- }
2442
- var blob = new Blob([body], {
2443
- type: "" + contentType
2444
- });
2445
- return {
2446
- filename: filename,
2447
- blob: blob
2448
- };
2449
- }), operators.catchError(function (err) {
2450
- return rxjs.throwError(err);
2451
- }));
2452
- };
2453
- return MonkeyEcxService;
2454
- }());
2455
- MonkeyEcxService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxService, deps: [{ token: i1__namespace$4.HttpClient }, { token: MonkeyEcxHandlingService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2456
- MonkeyEcxService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxService, providedIn: 'root' });
2457
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxService, decorators: [{
2458
- type: i0.Injectable,
2459
- args: [{
2460
- providedIn: 'root'
2461
- }]
2462
- }], ctorParameters: function () { return [{ type: i1__namespace$4.HttpClient }, { type: MonkeyEcxHandlingService }]; } });
2463
-
2464
- /* eslint-disable object-curly-newline */
2465
- var MonkeyEcxCookieStorageService = /** @class */ (function () {
2466
- function MonkeyEcxCookieStorageService(cookieService) {
2467
- this.cookieService = cookieService;
2468
- // not to do
2469
- }
2470
- MonkeyEcxCookieStorageService.prototype.setCookie = function (name, value) {
2471
- this.removeCookie(name);
2472
- this.cookieService.set(name, value, null, '/', '', true, 'None');
2473
- };
2474
- MonkeyEcxCookieStorageService.prototype.getCookie = function (name) {
2475
- return this.cookieService.get(name);
2476
- };
2477
- MonkeyEcxCookieStorageService.prototype.removeCookie = function (name) {
2478
- this.cookieService.delete(name, '/');
2479
- };
2480
- return MonkeyEcxCookieStorageService;
2481
- }());
2482
- MonkeyEcxCookieStorageService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxCookieStorageService, deps: [{ token: i1__namespace$5.CookieService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2483
- MonkeyEcxCookieStorageService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxCookieStorageService, providedIn: 'root' });
2484
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxCookieStorageService, decorators: [{
2485
- type: i0.Injectable,
2486
- args: [{
2487
- providedIn: 'root'
2488
- }]
2489
- }], ctorParameters: function () { return [{ type: i1__namespace$5.CookieService }]; } });
2490
-
2491
- var window$1;
2492
- var text = {
2493
- i18n: {
2494
- title: 'We have an quick update for you',
2495
- message: 'Click anywhere here to reload your locale'
2496
- },
2497
- theme: {
2498
- title: 'We have an quick update for you',
2499
- message: 'Click anywhere here to reload your theme'
2500
- }
2501
- };
2502
- var MonkeyEcxErrorConfigService = /** @class */ (function () {
2503
- function MonkeyEcxErrorConfigService() {
2504
- // not to do
2505
- }
2506
- MonkeyEcxErrorConfigService.prototype.enableSupport = function () {
2507
- window$1.zE('webWidget', 'updateSettings', {
2508
- webWidget: {
2509
- color: {
2510
- theme: '#0273E8',
2511
- launcherText: '#fff',
2512
- header: '#0273E8',
2513
- button: '#0273E8'
2514
- },
2515
- zIndex: 99,
2516
- offset: {
2517
- horizontal: '1px',
2518
- vertical: '20px'
2519
- },
2520
- mobile: {
2521
- labelVisible: true
2522
- },
2523
- launcher: {
2524
- mobile: {
2525
- labelVisible: true
2526
- }
2527
- }
2528
- }
2529
- });
2530
- window$1.zE('webWidget', 'setLocale', 'en-US');
2531
- window$1.zE('webWidget', 'show');
2532
- };
2533
- MonkeyEcxErrorConfigService.prototype.apply = function (type) {
2534
- var _a = text[type], title = _a.title, message = _a.message;
2535
- var element = document.createElement('div');
2536
- element.id = 'monkeyecx-information';
2537
- var elementImg = document.createElement('img');
2538
- elementImg.width = 128;
2539
- elementImg.src = 'assets/images/monkey.svg';
2540
- elementImg.style.marginBottom = '50px';
2541
- var elementTitle = document.createElement('span');
2542
- elementTitle.id = 'title';
2543
- elementTitle.innerText = title;
2544
- elementTitle.style.marginBottom = '20px';
2545
- var elementMessage = document.createElement('span');
2546
- elementMessage.id = 'message';
2547
- elementMessage.innerText = message;
2548
- elementMessage.style.marginBottom = '20px';
2549
- var elementChat = document.createElement('span');
2550
- elementChat.id = 'message';
2551
- elementChat.innerText =
2552
- "If you're having trouble to update, please use the support icon bellow";
2553
- element.appendChild(elementImg);
2554
- element.appendChild(elementTitle);
2555
- element.appendChild(elementMessage);
2556
- element.appendChild(elementChat);
2557
- element.addEventListener('click', function () {
2558
- document.location.reload();
2559
- });
2560
- document.body.appendChild(element);
2561
- document.body.getElementsByTagName('app-root')[0].remove();
2562
- this.enableSupport();
2563
- };
2564
- return MonkeyEcxErrorConfigService;
2565
- }());
2566
- MonkeyEcxErrorConfigService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorConfigService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2567
- MonkeyEcxErrorConfigService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorConfigService, providedIn: 'root' });
2568
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorConfigService, decorators: [{
2569
- type: i0.Injectable,
2570
- args: [{
2571
- providedIn: 'root'
2572
- }]
2573
- }], ctorParameters: function () { return []; } });
2574
-
2575
- var MonkeyEcxi18nConfigService = /** @class */ (function (_super) {
2576
- __extends(MonkeyEcxi18nConfigService, _super);
2577
- function MonkeyEcxi18nConfigService(monkeyecxService, translateService, monkeyecxCookieStorageService, monkeyecxErrorConfigService) {
2578
- var _this = _super.call(this, monkeyecxService) || this;
2579
- _this.translateService = translateService;
2580
- _this.monkeyecxCookieStorageService = monkeyecxCookieStorageService;
2581
- _this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
2582
- _this.translateService.addLangs(['pt-BR', 'en-US']);
2583
- _this.translateService.setDefaultLang('pt-BR');
2584
- _this.translateService.use('pt-BR');
2585
- _this.applyLocal();
2586
- return _this;
2587
- }
2588
- MonkeyEcxi18nConfigService.prototype.applyLocal = function () {
2589
- i1$2.registerLocaleData(localePTBR__default["default"], 'pt-PT');
2590
- };
2591
- MonkeyEcxi18nConfigService.prototype.apply = function (params, environment, change) {
2592
- var _this = this;
2593
- if (change === void 0) { change = false; }
2594
- var _a = this, monkeyecxService = _a.monkeyecxService, monkeyecxCookieStorageService = _a.monkeyecxCookieStorageService, monkeyecxErrorConfigService = _a.monkeyecxErrorConfigService;
2595
- var i18n = params.i18n;
2596
- var cookie = monkeyecxCookieStorageService.getCookie('monkey-app-locale');
2597
- if (cookie && !change) {
2598
- i18n = JSON.parse(atob(cookie));
2599
- }
2600
- else {
2601
- monkeyecxCookieStorageService.setCookie('monkey-app-locale', btoa(JSON.stringify(i18n)));
2602
- if (!cookie)
2603
- change = true;
2604
- }
2605
- monkeyecxService.get(environment.localAssets + "/i18n/" + i18n.lang + ".json").subscribe(function (config) {
2606
- var lang = config.lang, data = config.data;
2607
- _this.translateService.setTranslation(lang, data, true);
2608
- _this.translateService.use(lang);
2609
- if (change)
2610
- document.location.reload();
2611
- }, function (err) {
2612
- console.error("i18n " + i18n.lang + " not found!");
2613
- monkeyecxErrorConfigService.apply('i18n');
2614
- rxjs.throwError(err);
2615
- });
2616
- };
2617
- return MonkeyEcxi18nConfigService;
2618
- }(MonkeyEcxCommonsService));
2619
- MonkeyEcxi18nConfigService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxi18nConfigService, deps: [{ token: MonkeyEcxService }, { token: i1__namespace$1.TranslateService }, { token: MonkeyEcxCookieStorageService }, { token: MonkeyEcxErrorConfigService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2620
- MonkeyEcxi18nConfigService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxi18nConfigService, providedIn: 'root' });
2621
- __decorate([
2622
- MonkeyEcxCoreService({
2623
- httpResponse: {
2624
- httpCodeIgnore: [404]
2625
- },
2626
- requestInProgress: {
2627
- showProgress: false
2628
- }
2629
- })
2630
- ], MonkeyEcxi18nConfigService.prototype, "apply", null);
2631
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxi18nConfigService, decorators: [{
2632
- type: i0.Injectable,
2633
- args: [{
2634
- providedIn: 'root'
2635
- }]
2636
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: i1__namespace$1.TranslateService }, { type: MonkeyEcxCookieStorageService }, { type: MonkeyEcxErrorConfigService }]; }, propDecorators: { apply: [] } });
2637
-
2638
- var MonkeyEcxLogsConfigService = /** @class */ (function () {
2639
- function MonkeyEcxLogsConfigService() {
2640
- }
2641
- MonkeyEcxLogsConfigService.prototype.apply = function (params, configBoostrap, environment, identifyCode) {
2642
- var program = params.program, logs = params.logs;
2643
- if ((logs === null || logs === void 0 ? void 0 : logs.enabled) && environment.environment !== 'dev') {
2644
- browserRum.datadogRum.init({
2645
- applicationId: environment === null || environment === void 0 ? void 0 : environment.dataDogApplicationId,
2646
- clientToken: environment === null || environment === void 0 ? void 0 : environment.dataDogClientToken,
2647
- service: program.token,
2648
- site: 'datadoghq.com',
2649
- sampleRate: 100,
2650
- replaySampleRate: 100,
2651
- env: "monkey-front-" + identifyCode + "-" + environment.environment,
2652
- version: configBoostrap === null || configBoostrap === void 0 ? void 0 : configBoostrap.version,
2653
- trackInteractions: true,
2654
- trackSessionAcrossSubdomains: true,
2655
- useSecureSessionCookie: true,
2656
- useCrossSiteSessionCookie: true
2657
- });
2658
- browserRum.datadogRum.startSessionReplayRecording();
2659
- }
2660
- };
2661
- return MonkeyEcxLogsConfigService;
2662
- }());
2663
- MonkeyEcxLogsConfigService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxLogsConfigService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2664
- MonkeyEcxLogsConfigService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxLogsConfigService, providedIn: 'root' });
2665
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxLogsConfigService, decorators: [{
2666
- type: i0.Injectable,
2667
- args: [{
2668
- providedIn: 'root'
2669
- }]
2670
- }] });
2671
-
2672
- var MonkeyEcxServiceWorkerConfigService = /** @class */ (function () {
2673
- function MonkeyEcxServiceWorkerConfigService(appRef, updates, modalService) {
2674
- this.appRef = appRef;
2675
- this.updates = updates;
2676
- this.modalService = modalService;
2677
- // not to do
2678
- }
2679
- MonkeyEcxServiceWorkerConfigService.prototype.handleValidation = function (config) {
2680
- var _a;
2681
- var _b = this, updates = _b.updates, modalService = _b.modalService;
2682
- (_a = updates === null || updates === void 0 ? void 0 : updates.available) === null || _a === void 0 ? void 0 : _a.subscribe(function () {
2683
- if (!config.showNewVersion || config.maintenance.closed) {
2684
- document.location.reload();
2685
- }
2686
- else {
2687
- modalService.open(VersionChangedComponent, {
2688
- color: 'theme',
2689
- size: 'md'
2690
- });
2691
- }
2692
- });
2693
- };
2694
- MonkeyEcxServiceWorkerConfigService.prototype.verify = function () {
2695
- var _b = this, appRef = _b.appRef, updates = _b.updates;
2696
- var appIsStable$ = appRef.isStable
2697
- .pipe(operators.first(function (isStable) { return isStable === true; }));
2698
- var everyHour$ = rxjs.interval(1 * 60 * 60 * 1000);
2699
- var everyHourOnceAppIsStable$ = rxjs.concat(appIsStable$, everyHour$);
2700
- everyHourOnceAppIsStable$.subscribe(function () {
2701
- updates.checkForUpdate();
2702
- });
2703
- updates.checkForUpdate();
2704
- };
2705
- MonkeyEcxServiceWorkerConfigService.prototype.apply = function (config) {
2706
- this.handleValidation(config);
2707
- this.verify();
2708
- };
2709
- return MonkeyEcxServiceWorkerConfigService;
2710
- }());
2711
- MonkeyEcxServiceWorkerConfigService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxServiceWorkerConfigService, deps: [{ token: i0__namespace.ApplicationRef }, { token: i1__namespace$6.SwUpdate }, { token: i1__namespace.MonkeyStyleGuideModalService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2712
- MonkeyEcxServiceWorkerConfigService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxServiceWorkerConfigService, providedIn: 'root' });
2713
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxServiceWorkerConfigService, decorators: [{
2714
- type: i0.Injectable,
2715
- args: [{
2716
- providedIn: 'root'
2717
- }]
2718
- }], ctorParameters: function () { return [{ type: i0__namespace.ApplicationRef }, { type: i1__namespace$6.SwUpdate }, { type: i1__namespace.MonkeyStyleGuideModalService }]; } });
2719
-
2720
- var MonkeyEcxSecurityConsoleConfigService = /** @class */ (function (_super) {
2721
- __extends(MonkeyEcxSecurityConsoleConfigService, _super);
2722
- function MonkeyEcxSecurityConsoleConfigService(translateService) {
2723
- var _this = _super.call(this) || this;
2724
- _this.translateService = translateService;
2725
- _this.geti18n(_this.translateService, 'SERVICES.WARNING.CONSOLE');
2726
- return _this;
2727
- }
2728
- MonkeyEcxSecurityConsoleConfigService.prototype.handleValidation = function () {
2729
- var _this = this;
2730
- this.__oni18nDataChanged$.subscribe(function () {
2731
- var __i18n = _this.__i18n;
2732
- var title = __i18n === null || __i18n === void 0 ? void 0 : __i18n.TITLE;
2733
- var message = __i18n === null || __i18n === void 0 ? void 0 : __i18n.MESSAGE;
2734
- if (title) {
2735
- console.log("%c" + title, 'background: #f2f061; color: #ff0000; font-size: x-large');
2736
- console.log("%c" + message, 'font-size: x-large');
2737
- console.log('%c __ __ _ ______ \n ' +
2738
- '| \\/ | ___ _ __ | | _____ _ _\\ \\ \\ \\ \n ' +
2739
- "| |\\/| |/ _ \\| '_ \\| |/ / _ \\ | | |\\ \\ \\ \\ \n " +
2740
- '| | | | (_) | | | | < __/ |_| |/ / / / \n ' +
2741
- '|_| |_|\\___/|_| |_|_|\\_\\___|\\__, /_/_/_/ \n ' +
2742
- ' |___/ \n ' +
2743
- 'Join us: https://monkeyecx.gupy.io', 'background: #1976d2; color: #fff');
2744
- }
2745
- });
2746
- };
2747
- MonkeyEcxSecurityConsoleConfigService.prototype.apply = function () {
2748
- this.handleValidation();
2749
- };
2750
- return MonkeyEcxSecurityConsoleConfigService;
2751
- }(MonkeyEcxCommonsService));
2752
- MonkeyEcxSecurityConsoleConfigService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxSecurityConsoleConfigService, deps: [{ token: i1__namespace$1.TranslateService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2753
- MonkeyEcxSecurityConsoleConfigService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxSecurityConsoleConfigService, providedIn: 'root' });
2754
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxSecurityConsoleConfigService, decorators: [{
2755
- type: i0.Injectable,
2756
- args: [{
2757
- providedIn: 'root'
2758
- }]
2759
- }], ctorParameters: function () { return [{ type: i1__namespace$1.TranslateService }]; } });
2760
-
2761
- var MonkeyEcxMaintenanceConfigService = /** @class */ (function () {
2762
- function MonkeyEcxMaintenanceConfigService(modalService, router) {
2763
- this.modalService = modalService;
2764
- this.router = router;
2765
- // not to do
2766
- }
2767
- MonkeyEcxMaintenanceConfigService.prototype.handleValidation = function (config) {
2768
- var _this = this;
2769
- if (config.maintenance.closed) {
2770
- localStorage.clear();
2771
- this.router.navigate(['']);
2772
- setTimeout(function () {
2773
- _this.modalService.open(ClosedToMaintenanceComponent, {
2774
- color: 'theme',
2775
- size: 'md',
2776
- data: config
2777
- });
2778
- }, 200);
2779
- }
2780
- };
2781
- MonkeyEcxMaintenanceConfigService.prototype.apply = function (config) {
2782
- this.handleValidation(config);
2783
- };
2784
- return MonkeyEcxMaintenanceConfigService;
2785
- }());
2786
- MonkeyEcxMaintenanceConfigService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxMaintenanceConfigService, deps: [{ token: i1__namespace.MonkeyStyleGuideModalService }, { token: i1__namespace$3.Router }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2787
- MonkeyEcxMaintenanceConfigService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxMaintenanceConfigService, providedIn: 'root' });
2788
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxMaintenanceConfigService, decorators: [{
2789
- type: i0.Injectable,
2790
- args: [{
2791
- providedIn: 'root'
2792
- }]
2793
- }], ctorParameters: function () { return [{ type: i1__namespace.MonkeyStyleGuideModalService }, { type: i1__namespace$3.Router }]; } });
2794
-
2795
- var MonkeyEcxFeatureToggleService = /** @class */ (function () {
2796
- function MonkeyEcxFeatureToggleService() {
2797
- this.flagSubject$ = new rxjs.BehaviorSubject(null);
2798
- // not to do
2799
- }
2800
- MonkeyEcxFeatureToggleService.prototype.getAllFlags = function () {
2801
- this.flags = this.ldClient.allFlags();
2802
- this.flagSubject$.next(true);
2803
- };
2804
- MonkeyEcxFeatureToggleService.prototype.identify = function (config, environment) {
2805
- var _a;
2806
- if (config) {
2807
- var email = 'monkey@monkey.exchange';
2808
- var user = {
2809
- email: email,
2810
- key: ((_a = config.program) === null || _a === void 0 ? void 0 : _a.token) + "#" + email
2811
- };
2812
- if (!this.ldClient) {
2813
- this.ldClient = launchdarklyJsClientSdk.initialize(environment.launchDarklyClientSideID, user, {
2814
- streaming: true,
2815
- disableSyncEventPost: true,
2816
- sendEvents: false,
2817
- diagnosticOptOut: true
2818
- });
2819
- this.ldClient.on('change', this.getAllFlags.bind(this));
2820
- this.ldClient.on('ready', this.getAllFlags.bind(this));
2821
- }
2822
- else {
2823
- this.ldClient.identify(user, null, this.getAllFlags);
2824
- }
2825
- }
2826
- };
2827
- MonkeyEcxFeatureToggleService.prototype.apply = function (configSubject$, environment) {
2828
- var _this = this;
2829
- if (environment.launchDarklyClientSideID) {
2830
- configSubject$.subscribe(function (config) {
2831
- _this.identify(config, environment);
2832
- });
2833
- }
2834
- else {
2835
- this.flagSubject$.next(true);
2836
- }
2837
- };
2838
- Object.defineProperty(MonkeyEcxFeatureToggleService.prototype, "onFlags", {
2839
- get: function () {
2840
- return this.flagSubject$.asObservable();
2841
- },
2842
- enumerable: false,
2843
- configurable: true
2844
- });
2845
- MonkeyEcxFeatureToggleService.prototype.getFlag = function (flag) {
2846
- var _a;
2847
- var flagValue = (_a = this.flags) === null || _a === void 0 ? void 0 : _a[flag];
2848
- return i1.MonkeyUtils.persistNullEmptyUndefined(flagValue) ? flagValue : null;
2849
- };
2850
- return MonkeyEcxFeatureToggleService;
2851
- }());
2852
- MonkeyEcxFeatureToggleService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFeatureToggleService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2853
- MonkeyEcxFeatureToggleService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFeatureToggleService, providedIn: 'root' });
2854
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxFeatureToggleService, decorators: [{
2855
- type: i0.Injectable,
2856
- args: [{
2857
- providedIn: 'root'
2858
- }]
2859
- }], ctorParameters: function () { return []; } });
2860
-
2861
- var MonkeyEcxConfigService = /** @class */ (function (_super) {
2862
- __extends(MonkeyEcxConfigService, _super);
2863
- function MonkeyEcxConfigService(monkeyecxService, monkeyecxi18nConfigService, monkeyecxLogsConfigService, monkeyStyleGuideSettingsService, monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService, monkeyecxErrorConfigService, monkeyEcxFeatureToggleService) {
2864
- var _this = _super.call(this, monkeyecxService) || this;
2865
- _this.monkeyecxi18nConfigService = monkeyecxi18nConfigService;
2866
- _this.monkeyecxLogsConfigService = monkeyecxLogsConfigService;
2867
- _this.monkeyStyleGuideSettingsService = monkeyStyleGuideSettingsService;
2868
- _this.monkeyecxServiceWorkerConfigService = monkeyecxServiceWorkerConfigService;
2869
- _this.monkeyecxSecurityConsoleConfigService = monkeyecxSecurityConsoleConfigService;
2870
- _this.monkeyecxMaintenanceConfigService = monkeyecxMaintenanceConfigService;
2871
- _this.monkeyecxErrorConfigService = monkeyecxErrorConfigService;
2872
- _this.monkeyEcxFeatureToggleService = monkeyEcxFeatureToggleService;
2873
- _this.configSubject$ = new rxjs.BehaviorSubject(null);
2874
- _this.configBoostrapSubject$ = new rxjs.BehaviorSubject(null);
2875
- return _this;
2876
- }
2877
- MonkeyEcxConfigService.prototype.internalValidations = function () {
2878
- var args = [];
2879
- for (var _i = 0; _i < arguments.length; _i++) {
2880
- args[_i] = arguments[_i];
2881
- }
2882
- var _a = this, monkeyecxServiceWorkerConfigService = _a.monkeyecxServiceWorkerConfigService, monkeyecxSecurityConsoleConfigService = _a.monkeyecxSecurityConsoleConfigService, monkeyecxMaintenanceConfigService = _a.monkeyecxMaintenanceConfigService;
2883
- var configBoostrap = args[0];
2884
- var callback = args[1];
2885
- monkeyecxSecurityConsoleConfigService.apply();
2886
- monkeyecxServiceWorkerConfigService.apply(configBoostrap);
2887
- monkeyecxMaintenanceConfigService.apply(configBoostrap);
2888
- callback(configBoostrap);
2889
- };
2890
- MonkeyEcxConfigService.prototype.getWhiteLabelSettings = function (monkeyecxCode, configBoostrap, callback, environment, identifyCode) {
2891
- var _this = this;
2892
- if (configBoostrap === void 0) { configBoostrap = null; }
2893
- var _a = this, monkeyecxService = _a.monkeyecxService, monkeyecxi18nConfigService = _a.monkeyecxi18nConfigService, configSubject$ = _a.configSubject$, monkeyStyleGuideSettingsService = _a.monkeyStyleGuideSettingsService, monkeyecxLogsConfigService = _a.monkeyecxLogsConfigService, monkeyecxErrorConfigService = _a.monkeyecxErrorConfigService, monkeyEcxFeatureToggleService = _a.monkeyEcxFeatureToggleService, internalValidations = _a.internalValidations;
2894
- var url = "" + environment.urlAssets;
2895
- monkeyecxService.get(url + "/" + monkeyecxCode.toLowerCase() + "/white-label.json").subscribe(function (config) {
2896
- monkeyecxi18nConfigService.apply(config, environment);
2897
- monkeyecxLogsConfigService.apply(config, configBoostrap, environment, identifyCode);
2898
- monkeyEcxFeatureToggleService.apply(configSubject$, environment);
2899
- monkeyStyleGuideSettingsService.boostrap(url + "/" + monkeyecxCode.toLowerCase() + "/monkey-style-guide-settings.json", internalValidations.bind(_this, configBoostrap, callback, environment));
2900
- configSubject$.next(config);
2901
- }, function (err) {
2902
- monkeyecxErrorConfigService.apply('theme');
2903
- console.error('Program Configuration not found!');
2904
- rxjs.throwError(err);
2905
- });
2906
- };
2907
- MonkeyEcxConfigService.prototype.init = function (callback, environment, identifyCode, monkeyecxCode) {
2908
- var _this = this;
2909
- var _a = this, monkeyecxService = _a.monkeyecxService, configBoostrapSubject$ = _a.configBoostrapSubject$, monkeyecxErrorConfigService = _a.monkeyecxErrorConfigService;
2910
- monkeyecxService
2911
- .get(environment.boostrapAssets + "?t=" + i1.MonkeyUtils.getRandomString(30), {
2912
- observe: 'response'
2913
- })
2914
- .subscribe(function (resp) {
2915
- var headers = resp.headers, body = resp.body;
2916
- var monkeyCode = headers.get('monkey-code') || monkeyecxCode;
2917
- if (monkeyCode) {
2918
- _this.getWhiteLabelSettings(monkeyCode, body, callback, environment, identifyCode);
2919
- configBoostrapSubject$.next(body);
2920
- }
2921
- else {
2922
- monkeyecxErrorConfigService.apply('theme');
2923
- console.error("Boostrap " + monkeyCode + " Configuration not found!");
2924
- }
2925
- }, function (err) {
2926
- monkeyecxErrorConfigService.apply('theme');
2927
- console.error('Boostrap Configuration not found!');
2928
- rxjs.throwError(err);
2929
- });
2930
- };
2931
- MonkeyEcxConfigService.prototype.config = function () {
2932
- return this.configSubject$.asObservable();
2933
- };
2934
- MonkeyEcxConfigService.prototype.boostrapConfig = function () {
2935
- return this.configBoostrapSubject$.asObservable();
2936
- };
2937
- return MonkeyEcxConfigService;
2938
- }(MonkeyEcxCommonsService));
2939
- MonkeyEcxConfigService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxConfigService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxi18nConfigService }, { token: MonkeyEcxLogsConfigService }, { token: i1__namespace.MonkeyStyleGuideSettingsService }, { token: MonkeyEcxServiceWorkerConfigService }, { token: MonkeyEcxSecurityConsoleConfigService }, { token: MonkeyEcxMaintenanceConfigService }, { token: MonkeyEcxErrorConfigService }, { token: MonkeyEcxFeatureToggleService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
2940
- MonkeyEcxConfigService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxConfigService, providedIn: 'root' });
2941
- __decorate([
2942
- MonkeyEcxCoreService({
2943
- httpResponse: {
2944
- httpCodeIgnore: [404]
2945
- },
2946
- requestInProgress: {
2947
- showProgress: false
2948
- }
2949
- })
2950
- ], MonkeyEcxConfigService.prototype, "init", null);
2951
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxConfigService, decorators: [{
2952
- type: i0.Injectable,
2953
- args: [{
2954
- providedIn: 'root'
2955
- }]
2956
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxi18nConfigService }, { type: MonkeyEcxLogsConfigService }, { type: i1__namespace.MonkeyStyleGuideSettingsService }, { type: MonkeyEcxServiceWorkerConfigService }, { type: MonkeyEcxSecurityConsoleConfigService }, { type: MonkeyEcxMaintenanceConfigService }, { type: MonkeyEcxErrorConfigService }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { init: [] } });
2957
-
2958
- var MonkeyEcxTokenStorageService = /** @class */ (function () {
2959
- function MonkeyEcxTokenStorageService(monkeyecxConfigService) {
2960
- var _this = this;
2961
- this.monkeyecxConfigService = monkeyecxConfigService;
2962
- this.config = null;
2963
- this.token = {
2964
- username: '',
2965
- program: '',
2966
- accessToken: '',
2967
- refreshToken: '',
2968
- companyId: '',
2969
- governmentId: '',
2970
- companyTypeUrl: '',
2971
- companyType: '',
2972
- programAdmin: false,
2973
- programType: '',
2974
- role: '',
2975
- _clearIgnore: {
2976
- ignore: ['username', 'program']
2977
- }
2978
- };
2979
- this.token$ = new rxjs.BehaviorSubject(null);
2980
- this.me$ = new rxjs.BehaviorSubject(null);
2981
- this.monkeyecxConfigService.config().subscribe(function (_) {
2982
- _this.config = _;
2983
- });
2984
- }
2985
- MonkeyEcxTokenStorageService.prototype.setAllTokens = function (token) {
2986
- var token$ = this.token$;
2987
- Object.entries(token).forEach(function (_a) {
2988
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
2989
- if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
2990
- localStorage.setItem(key, value);
2991
- }
2992
- });
2993
- token$.next(token);
2994
- };
2995
- MonkeyEcxTokenStorageService.prototype.getAllTokens = function () {
2996
- var token = this.token;
2997
- var handledToken = Object.assign({}, token);
2998
- Object.entries(token).forEach(function (_a) {
2999
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
3000
- handledToken[key] = localStorage.getItem(key);
3001
- });
3002
- return handledToken;
3003
- };
3004
- MonkeyEcxTokenStorageService.prototype.setAllMe = function (me) {
3005
- var me$ = this.me$;
3006
- var previousMe = JSON.parse(localStorage.getItem('me'));
3007
- Object.entries(me).forEach(function (_a) {
3008
- var _b;
3009
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
3010
- if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
3011
- previousMe = Object.assign(Object.assign({}, previousMe), (_b = {}, _b[key] = value, _b));
3012
- }
3013
- });
3014
- localStorage.setItem('me', JSON.stringify(previousMe));
3015
- me$.next(previousMe);
3016
- };
3017
- MonkeyEcxTokenStorageService.prototype.getAllMe = function () {
3018
- var me = localStorage.getItem('me');
3019
- return JSON.parse(me);
3020
- };
3021
- MonkeyEcxTokenStorageService.prototype.tokenHasChanged = function () {
3022
- return this.token$.asObservable();
3023
- };
3024
- MonkeyEcxTokenStorageService.prototype.meHasChanged = function () {
3025
- return this.me$.asObservable() || null;
3026
- };
3027
- MonkeyEcxTokenStorageService.prototype.getToken = function () {
3028
- return this.getAllTokens();
3029
- };
3030
- MonkeyEcxTokenStorageService.prototype.getMe = function () {
3031
- return this.getAllMe();
3032
- };
3033
- MonkeyEcxTokenStorageService.prototype.setToken = function (token) {
3034
- this.setAllTokens(token);
3035
- };
3036
- MonkeyEcxTokenStorageService.prototype.setMe = function (me) {
3037
- this.setAllMe(me);
3038
- };
3039
- MonkeyEcxTokenStorageService.prototype.clear = function (force) {
3040
- var token = this.token;
3041
- try {
3042
- Object.entries(token).forEach(function (_a) {
3043
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
3044
- if (token._clearIgnore.ignore.filter(function (val) {
3045
- return val === key;
3046
- }).length <= 0 ||
3047
- force === true) {
3048
- localStorage.removeItem(key);
3049
- }
3050
- });
3051
- localStorage.removeItem('me');
3052
- }
3053
- catch (error) {
3054
- return rxjs.of(false);
3055
- }
3056
- return rxjs.of(true);
3057
- };
3058
- /**
3059
- * @param fields (the name of fields you want to clear. ie: ['companyId', 'role', ...])
3060
- */
3061
- MonkeyEcxTokenStorageService.prototype.clearCredentials = function (fields) {
3062
- if (fields === void 0) { fields = ['companyId', 'governmentId', 'companyType', 'programAdmin', 'role']; }
3063
- fields === null || fields === void 0 ? void 0 : fields.forEach(function (key) {
3064
- localStorage.removeItem(key);
3065
- });
3066
- };
3067
- return MonkeyEcxTokenStorageService;
3068
- }());
3069
- MonkeyEcxTokenStorageService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTokenStorageService, deps: [{ token: MonkeyEcxConfigService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3070
- MonkeyEcxTokenStorageService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTokenStorageService, providedIn: 'root' });
3071
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTokenStorageService, decorators: [{
3072
- type: i0.Injectable,
3073
- args: [{
3074
- providedIn: 'root'
3075
- }]
3076
- }], ctorParameters: function () { return [{ type: MonkeyEcxConfigService }]; } });
3077
-
3078
- var MonkeyEcxSecurityDirective = /** @class */ (function () {
3079
- function MonkeyEcxSecurityDirective(elementRef, tokenStorageService, cdr) {
3080
- this.elementRef = elementRef;
3081
- this.tokenStorageService = tokenStorageService;
3082
- this.cdr = cdr;
3083
- this.byExclusion = false;
3084
- // not to do
3085
- }
3086
- MonkeyEcxSecurityDirective.prototype.getRole = function () {
3087
- var tokenCredentials = this.tokenCredentials;
3088
- if (!tokenCredentials)
3089
- return '';
3090
- if ((tokenCredentials === null || tokenCredentials === void 0 ? void 0 : tokenCredentials.programAdmin) === 'true') {
3091
- return 'PROGRAM_ADMIN';
3092
- }
3093
- return (tokenCredentials === null || tokenCredentials === void 0 ? void 0 : tokenCredentials.role) || '';
3094
- };
3095
- MonkeyEcxSecurityDirective.prototype.handleAccess = function () {
3096
- var _a = this, roles = _a.roles, byExclusion = _a.byExclusion;
3097
- var display = 'none';
3098
- var found = roles === null || roles === void 0 ? void 0 : roles.indexOf(this.getRole());
3099
- if (byExclusion) {
3100
- display = 'block';
3101
- if (found > -1) {
3102
- display = 'none';
3103
- }
3104
- }
3105
- else {
3106
- display = 'none';
3107
- if (found > -1) {
3108
- display = 'block';
3109
- }
3110
- }
3111
- if (!roles || roles.length === 0 || (this.getRole() === 'PROGRAM_ADMIN'))
3112
- display = 'block';
3113
- this.elementRef.nativeElement.style.display = display;
3114
- this.cdr.detectChanges();
3115
- };
3116
- MonkeyEcxSecurityDirective.prototype.ngOnInit = function () {
3117
- var _this = this;
3118
- this.elementRef.nativeElement.style.display = 'none';
3119
- this.cdr.detectChanges();
3120
- this.tokenStorageService.tokenHasChanged().subscribe(function () {
3121
- _this.tokenCredentials = _this.tokenStorageService.getToken();
3122
- _this.handleAccess();
3123
- });
3124
- this.tokenCredentials = this.tokenStorageService.getToken();
3125
- this.handleAccess();
3126
- };
3127
- return MonkeyEcxSecurityDirective;
3128
- }());
3129
- MonkeyEcxSecurityDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxSecurityDirective, deps: [{ token: i0__namespace.ElementRef }, { token: MonkeyEcxTokenStorageService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
3130
- MonkeyEcxSecurityDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: MonkeyEcxSecurityDirective, selector: "[monkeyecxSecurity]", inputs: { roles: ["securityRoles", "roles"], byExclusion: ["securityByExclusion", "byExclusion"] }, ngImport: i0__namespace });
3131
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxSecurityDirective, decorators: [{
3132
- type: i0.Directive,
3133
- args: [{
3134
- selector: '[monkeyecxSecurity]'
3135
- }]
3136
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: MonkeyEcxTokenStorageService }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { roles: [{
3137
- type: i0.Input,
3138
- args: ['securityRoles']
3139
- }], byExclusion: [{
3140
- type: i0.Input,
3141
- args: ['securityByExclusion']
3142
- }] } });
3143
-
3144
- var MonkeyEcxTooltipDirective = /** @class */ (function () {
3145
- function MonkeyEcxTooltipDirective(el, renderer) {
3146
- this.el = el;
3147
- this.renderer = renderer;
3148
- this.enableToShow = true;
3149
- this.offset = 10;
3150
- // not to do
3151
- }
3152
- MonkeyEcxTooltipDirective.prototype.onMouseEnter = function () {
3153
- if (!this.tooltip) {
3154
- this.show();
3155
- }
3156
- };
3157
- MonkeyEcxTooltipDirective.prototype.onMouseLeave = function () {
3158
- if (this.tooltip) {
3159
- this.hide();
3160
- }
3161
- };
3162
- MonkeyEcxTooltipDirective.prototype.clickout = function () {
3163
- if (this.tooltip) {
3164
- this.hide();
3165
- }
3166
- };
3167
- MonkeyEcxTooltipDirective.prototype.show = function () {
3168
- var _this = this;
3169
- if (this.enableToShow) {
3170
- this.create();
3171
- this.setPosition();
3172
- this.renderer.addClass(this.tooltip, 'monkeyecx-tooltip-show');
3173
- setTimeout(function () {
3174
- _this.hide();
3175
- }, 5000);
3176
- }
3177
- };
3178
- MonkeyEcxTooltipDirective.prototype.hide = function () {
3179
- if (!this.tooltip)
3180
- return;
3181
- this.renderer.removeClass(this.tooltip, 'monkeyecx-tooltip-show');
3182
- this.renderer.removeChild(document.body, this.tooltip);
3183
- this.tooltip = null;
3184
- };
3185
- MonkeyEcxTooltipDirective.prototype.create = function () {
3186
- var tooltipElement = document.createElement('div');
3187
- this.tooltip = this.renderer.createElement('span');
3188
- if (this.tooltipTitle) {
3189
- var tooltipTitleElement = document.createElement('span');
3190
- tooltipTitleElement.innerText = "" + this.tooltipTitle;
3191
- tooltipTitleElement.className = 'monkeyecx-tooltip-title';
3192
- tooltipElement.appendChild(tooltipTitleElement);
3193
- }
3194
- if (this.tooltipText) {
3195
- var tooltipTextElement = document.createElement('span');
3196
- tooltipTextElement.innerText = "" + this.tooltipText;
3197
- tooltipTextElement.className = 'monkeyecx-tooltip-description';
3198
- tooltipElement.appendChild(tooltipTextElement);
3199
- }
3200
- this.renderer.appendChild(this.tooltip, tooltipElement);
3201
- this.renderer.appendChild(document.body, this.tooltip);
3202
- this.renderer.addClass(this.tooltip, 'monkeyecx-tooltip');
3203
- this.renderer.addClass(this.tooltip, "monkeyecx-tooltip-" + this.tooltipPosition);
3204
- this.renderer.setStyle(this.tooltip, '-webkit-transition', "opacity " + this.tooltipDelay + "ms");
3205
- this.renderer.setStyle(this.tooltip, '-moz-transition', "opacity " + this.tooltipDelay + "ms");
3206
- this.renderer.setStyle(this.tooltip, '-o-transition', "opacity " + this.tooltipDelay + "ms");
3207
- this.renderer.setStyle(this.tooltip, 'transition', "opacity " + this.tooltipDelay + "ms");
3208
- };
3209
- MonkeyEcxTooltipDirective.prototype.setPosition = function () {
3210
- var hostPos = this.el.nativeElement.getBoundingClientRect();
3211
- var tooltipPos = this.tooltip.getBoundingClientRect();
3212
- var scrollPos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
3213
- var top;
3214
- var left;
3215
- if (this.tooltipPosition === 'top') {
3216
- top = hostPos.top - tooltipPos.height - this.offset;
3217
- left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
3218
- }
3219
- if (this.tooltipPosition === 'bottom') {
3220
- top = hostPos.bottom + this.offset;
3221
- left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
3222
- }
3223
- if (this.tooltipPosition === 'left') {
3224
- top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
3225
- left = hostPos.left - tooltipPos.width - this.offset;
3226
- }
3227
- if (this.tooltipPosition === 'right') {
3228
- top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
3229
- left = hostPos.right + this.offset;
3230
- }
3231
- this.renderer.setStyle(this.tooltip, 'top', top + scrollPos + "px");
3232
- this.renderer.setStyle(this.tooltip, 'left', left + "px");
3233
- };
3234
- return MonkeyEcxTooltipDirective;
3235
- }());
3236
- MonkeyEcxTooltipDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTooltipDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
3237
- MonkeyEcxTooltipDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: MonkeyEcxTooltipDirective, selector: "[monkeyecxTooltip]", inputs: { tooltipDelay: "tooltipDelay", tooltipPosition: "tooltipPosition", tooltipText: "tooltipText", tooltipTitle: "tooltipTitle", enableToShow: "enableToShow" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "click": "clickout()" } }, ngImport: i0__namespace });
3238
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxTooltipDirective, decorators: [{
3239
- type: i0.Directive,
3240
- args: [{
3241
- selector: '[monkeyecxTooltip]'
3242
- }]
3243
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Renderer2 }]; }, propDecorators: { tooltipDelay: [{
3244
- type: i0.Input
3245
- }], tooltipPosition: [{
3246
- type: i0.Input
3247
- }], tooltipText: [{
3248
- type: i0.Input
3249
- }], tooltipTitle: [{
3250
- type: i0.Input
3251
- }], enableToShow: [{
3252
- type: i0.Input
3253
- }], onMouseEnter: [{
3254
- type: i0.HostListener,
3255
- args: ['mouseenter']
3256
- }], onMouseLeave: [{
3257
- type: i0.HostListener,
3258
- args: ['mouseleave']
3259
- }], clickout: [{
3260
- type: i0.HostListener,
3261
- args: ['click']
3262
- }] } });
3263
-
3264
- var MonkeyFeatureDirective = /** @class */ (function () {
3265
- function MonkeyFeatureDirective(cdr, elementRef, monkeyecxFeatureToggleService) {
3266
- this.cdr = cdr;
3267
- this.elementRef = elementRef;
3268
- this.monkeyecxFeatureToggleService = monkeyecxFeatureToggleService;
3269
- this.unsubscribeAll = new rxjs.Subject();
3270
- // not to do
3271
- }
3272
- MonkeyFeatureDirective.prototype.getFeature = function (feature) {
3273
- var monkeyecxFeatureToggleService = this.monkeyecxFeatureToggleService;
3274
- if (!monkeyecxFeatureToggleService) {
3275
- return false;
3276
- }
3277
- return monkeyecxFeatureToggleService.getFlag(feature);
3278
- };
3279
- MonkeyFeatureDirective.prototype.handleDisplay = function () {
3280
- var flag = this.getFeature(this.feature);
3281
- var display = 'none';
3282
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(flag)) {
3283
- return;
3284
- }
3285
- if (flag) {
3286
- display = 'block';
3287
- }
3288
- if (display === 'none') {
3289
- this.elementRef.nativeElement.remove();
3290
- }
3291
- this.elementRef.nativeElement.style.display = display;
3292
- this.cdr.detectChanges();
3293
- };
3294
- MonkeyFeatureDirective.prototype.ngOnDestroy = function () {
3295
- this.unsubscribeAll.next();
3296
- this.unsubscribeAll.complete();
3297
- };
3298
- MonkeyFeatureDirective.prototype.ngOnInit = function () {
3299
- var _this = this;
3300
- if (!this.feature)
3301
- return;
3302
- this.elementRef.nativeElement.style.display = 'none';
3303
- this.cdr.detectChanges();
3304
- this.monkeyecxFeatureToggleService.onFlags
3305
- .pipe(operators.takeUntil(this.unsubscribeAll))
3306
- .subscribe(function (val) {
3307
- if (val) {
3308
- _this.handleDisplay();
3309
- }
3310
- });
3311
- };
3312
- return MonkeyFeatureDirective;
3313
- }());
3314
- MonkeyFeatureDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyFeatureDirective, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ElementRef }, { token: MonkeyEcxFeatureToggleService }], target: i0__namespace.ɵɵFactoryTarget.Directive });
3315
- MonkeyFeatureDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.15", type: MonkeyFeatureDirective, selector: "[monkeyecxFeature]", inputs: { feature: ["featureName", "feature"] }, ngImport: i0__namespace });
3316
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyFeatureDirective, decorators: [{
3317
- type: i0.Directive,
3318
- args: [{
3319
- selector: '[monkeyecxFeature]'
3320
- }]
3321
- }], ctorParameters: function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.ElementRef }, { type: MonkeyEcxFeatureToggleService }]; }, propDecorators: { feature: [{
3322
- type: i0.Input,
3323
- args: ['featureName']
3324
- }] } });
3325
-
3326
- var MonkeyEcxDirectivesModule = /** @class */ (function () {
3327
- function MonkeyEcxDirectivesModule() {
3328
- }
3329
- return MonkeyEcxDirectivesModule;
3330
- }());
3331
- MonkeyEcxDirectivesModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDirectivesModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3332
- MonkeyEcxDirectivesModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDirectivesModule, declarations: [MonkeyEcxDragDropDirective,
3333
- MonkeyEcxFormatCurrency,
3334
- MonkeyFeatureDirective,
3335
- MonkeyEcxFormatUpper,
3336
- MonkeyEcxOnlyAlphaNumericDirective,
3337
- MonkeyEcxOnlyNumbersDirective,
3338
- MonkeyEcxSecurityDirective,
3339
- MonkeyEcxTooltipDirective], exports: [MonkeyEcxDragDropDirective,
3340
- MonkeyEcxFormatCurrency,
3341
- MonkeyFeatureDirective,
3342
- MonkeyEcxFormatUpper,
3343
- MonkeyEcxOnlyAlphaNumericDirective,
3344
- MonkeyEcxOnlyNumbersDirective,
3345
- MonkeyEcxSecurityDirective,
3346
- MonkeyEcxTooltipDirective] });
3347
- MonkeyEcxDirectivesModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDirectivesModule });
3348
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDirectivesModule, decorators: [{
3349
- type: i0.NgModule,
3350
- args: [{
3351
- declarations: [
3352
- MonkeyEcxDragDropDirective,
3353
- MonkeyEcxFormatCurrency,
3354
- MonkeyFeatureDirective,
3355
- MonkeyEcxFormatUpper,
3356
- MonkeyEcxOnlyAlphaNumericDirective,
3357
- MonkeyEcxOnlyNumbersDirective,
3358
- MonkeyEcxSecurityDirective,
3359
- MonkeyEcxTooltipDirective
3360
- ],
3361
- exports: [
3362
- MonkeyEcxDragDropDirective,
3363
- MonkeyEcxFormatCurrency,
3364
- MonkeyFeatureDirective,
3365
- MonkeyEcxFormatUpper,
3366
- MonkeyEcxOnlyAlphaNumericDirective,
3367
- MonkeyEcxOnlyNumbersDirective,
3368
- MonkeyEcxSecurityDirective,
3369
- MonkeyEcxTooltipDirective
3370
- ]
3371
- }]
3372
- }] });
3373
-
3374
- /* eslint-disable no-console */
3375
- var MonkeyEcxAuthenticationService = /** @class */ (function () {
3376
- function MonkeyEcxAuthenticationService() {
3377
- this.hadAtLeastOneLogin = function () {
3378
- console.error('hadAtLeastOneLogin needs to be declared!');
3379
- return null;
3380
- };
3381
- this.redirectApp = function () {
3382
- console.error('redirectApp needs to be declared!');
3383
- return null;
3384
- };
3385
- this.redirectLoginWelcomeBack = function () {
3386
- console.error('redirectLoginWelcomeBack needs to be declared!');
3387
- return null;
3388
- };
3389
- this.isAuthorized = function () {
3390
- console.error('isAuthorized needs to be declared!');
3391
- return false;
3392
- };
3393
- this.getRequestWithHeaders = function (request) {
3394
- console.error('getRequestWithHeaders needs to be declared!');
3395
- return null;
3396
- };
3397
- this.getRequestWithHeadersOb = function (request) {
3398
- console.error('getRequestWithHeadersOb needs to be declared!');
3399
- return null;
3400
- };
3401
- this.refreshShouldHappen = function (response) {
3402
- console.error('refreshShouldHappen needs to be declared!');
3403
- return false;
3404
- };
3405
- this.refreshToken = function () {
3406
- console.error('refreshToken needs to be declared!');
3407
- return null;
3408
- };
3409
- // not to do
3410
- }
3411
- MonkeyEcxAuthenticationService.prototype.init = function (args) {
3412
- this.hadAtLeastOneLogin = (args === null || args === void 0 ? void 0 : args.hadAtLeastOneLogin) || this.hadAtLeastOneLogin.bind(this);
3413
- this.redirectApp = (args === null || args === void 0 ? void 0 : args.redirectApp) || this.redirectApp.bind(this);
3414
- this.redirectLoginWelcomeBack = (args === null || args === void 0 ? void 0 : args.redirectLoginWelcomeBack) ||
3415
- this.redirectLoginWelcomeBack.bind(this);
3416
- this.isAuthorized = (args === null || args === void 0 ? void 0 : args.isAuthorized) || this.isAuthorized.bind(this);
3417
- this.getRequestWithHeaders = (args === null || args === void 0 ? void 0 : args.getRequestWithHeaders) ||
3418
- this.getRequestWithHeaders.bind(this);
3419
- this.getRequestWithHeadersOb = args === null || args === void 0 ? void 0 : args.getRequestWithHeadersOb.bind(this);
3420
- this.refreshShouldHappen = (args === null || args === void 0 ? void 0 : args.refreshShouldHappen) || this.refreshShouldHappen.bind(this);
3421
- this.refreshToken = (args === null || args === void 0 ? void 0 : args.refreshToken) || this.refreshToken.bind(this);
3422
- };
3423
- return MonkeyEcxAuthenticationService;
3424
- }());
3425
- MonkeyEcxAuthenticationService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxAuthenticationService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3426
- MonkeyEcxAuthenticationService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxAuthenticationService, providedIn: 'root' });
3427
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxAuthenticationService, decorators: [{
3428
- type: i0.Injectable,
3429
- args: [{
3430
- providedIn: 'root'
3431
- }]
3432
- }], ctorParameters: function () { return []; } });
3433
-
3434
- var MonkeyEcxAuthGuardLogin = /** @class */ (function () {
3435
- function MonkeyEcxAuthGuardLogin(monkeyecxAuthenticationService) {
3436
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3437
- // not to do
3438
- }
3439
- MonkeyEcxAuthGuardLogin.prototype.canActivate = function () {
3440
- if (this.monkeyecxAuthenticationService.isAuthorized()) {
3441
- this.monkeyecxAuthenticationService.redirectApp();
3442
- return false;
3443
- }
3444
- if (this.monkeyecxAuthenticationService.hadAtLeastOneLogin()) {
3445
- this.monkeyecxAuthenticationService.redirectLoginWelcomeBack();
3446
- return false;
3447
- }
3448
- return true;
3449
- };
3450
- return MonkeyEcxAuthGuardLogin;
3451
- }());
3452
- MonkeyEcxAuthGuardLogin.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxAuthGuardLogin, deps: [{ token: MonkeyEcxAuthenticationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3453
- MonkeyEcxAuthGuardLogin.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxAuthGuardLogin, providedIn: 'root' });
3454
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxAuthGuardLogin, decorators: [{
3455
- type: i0.Injectable,
3456
- args: [{
3457
- providedIn: 'root'
3458
- }]
3459
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }]; } });
3460
-
3461
- var MonkeyEcxAuthGuard = /** @class */ (function () {
3462
- function MonkeyEcxAuthGuard(monkeyecxAuthenticationService) {
3463
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3464
- // not to do
3465
- }
3466
- MonkeyEcxAuthGuard.prototype.canActivate = function () {
3467
- var monkeyecxAuthenticationService = this.monkeyecxAuthenticationService;
3468
- if (monkeyecxAuthenticationService.isAuthorized()) {
3469
- return true;
3470
- }
3471
- monkeyecxAuthenticationService.redirectLoginWelcomeBack();
3472
- return false;
3473
- };
3474
- return MonkeyEcxAuthGuard;
3475
- }());
3476
- MonkeyEcxAuthGuard.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxAuthGuard, deps: [{ token: MonkeyEcxAuthenticationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3477
- MonkeyEcxAuthGuard.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxAuthGuard, providedIn: 'root' });
3478
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxAuthGuard, decorators: [{
3479
- type: i0.Injectable,
3480
- args: [{
3481
- providedIn: 'root'
3482
- }]
3483
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }]; } });
3484
-
3485
- var MonkeyEcxHttpErrorHandlingService = /** @class */ (function (_super) {
3486
- __extends(MonkeyEcxHttpErrorHandlingService, _super);
3487
- function MonkeyEcxHttpErrorHandlingService(monkeyecxService, tokenStorage, monkeyecxAuthenticationService, router, snackbarService, translateService) {
3488
- var _this = _super.call(this, monkeyecxService, tokenStorage) || this;
3489
- _this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3490
- _this.router = router;
3491
- _this.snackbarService = snackbarService;
3492
- _this.translateService = translateService;
3493
- _super.prototype.resolve.call(_this, null, null);
3494
- _this.geti18n(_this.translateService, 'SERVICES.WARNING');
3495
- return _this;
3496
- }
3497
- MonkeyEcxHttpErrorHandlingService.prototype.isHttpCodeIgnoreMessage = function (tp, httpCode) {
3498
- var _a, _b;
3499
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(tp) && !(tp === null || tp === void 0 ? void 0 : tp.httpResponse)) {
3500
- return false;
3501
- }
3502
- var found = ((_b = (_a = tp === null || tp === void 0 ? void 0 : tp.httpResponse) === null || _a === void 0 ? void 0 : _a.httpCodeIgnore) === null || _b === void 0 ? void 0 : _b.indexOf(httpCode)) > -1;
3503
- return found;
3504
- };
3505
- MonkeyEcxHttpErrorHandlingService.prototype.isHttpCodeIgnoreRedirect = function (tp, httpCode) {
3506
- var _a, _b;
3507
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(tp) && !(tp === null || tp === void 0 ? void 0 : tp.httpResponse)) {
3508
- return false;
3509
- }
3510
- var found = ((_b = (_a = tp === null || tp === void 0 ? void 0 : tp.httpResponse) === null || _a === void 0 ? void 0 : _a.httpCodeIgnoreRedirect) === null || _b === void 0 ? void 0 : _b.indexOf(httpCode)) > -1;
3511
- return found;
3512
- };
3513
- MonkeyEcxHttpErrorHandlingService.prototype.getMessageType = function (status) {
3514
- if (status === 409 || status === 400) {
3515
- return 'warning';
3516
- }
3517
- return 'error';
3518
- };
3519
- MonkeyEcxHttpErrorHandlingService.prototype.showMessage = function (message, error, mkc) {
3520
- var _a;
3521
- var snackbarService = this.snackbarService;
3522
- if (!this.isHttpCodeIgnoreMessage(mkc, error.status)) {
3523
- snackbarService.show({
3524
- title: (_a = this.__i18n) === null || _a === void 0 ? void 0 : _a.TITLE,
3525
- message: message,
3526
- type: this.getMessageType(error.status),
3527
- duration: 4000,
3528
- horizontalPosition: 'center',
3529
- verticalPosition: 'top'
3530
- });
3531
- }
3532
- };
3533
- MonkeyEcxHttpErrorHandlingService.prototype.handleMessage = function (error, mkc) {
3534
- var _this = this;
3535
- var _a;
3536
- // eslint-disable-next-line camelcase
3537
- var _c = error.error, notifications = _c.notifications, error_description = _c.error_description, message = _c.message;
3538
- var customMessage = '';
3539
- if (message) {
3540
- customMessage = message;
3541
- }
3542
- // eslint-disable-next-line camelcase
3543
- if (error_description) {
3544
- // eslint-disable-next-line camelcase
3545
- customMessage = error_description;
3546
- }
3547
- if (notifications) {
3548
- customMessage = notifications;
3549
- }
3550
- if (!customMessage) {
3551
- if (error.error instanceof Blob) {
3552
- var blob = new Blob([error.error], {
3553
- type: 'application/json'
3554
- });
3555
- var reader = new FileReader();
3556
- reader.addEventListener('loadend', function (e) {
3557
- var text = e.target.result;
3558
- var jsonResp = JSON.parse(text);
3559
- customMessage = jsonResp.notifications;
3560
- _this.showMessage(customMessage, error, mkc);
3561
- });
3562
- reader.readAsText(blob);
3563
- }
3564
- else {
3565
- this.showMessage((_a = this.__i18n['ERROR-HANDLING']) === null || _a === void 0 ? void 0 : _a.ERROR, error, mkc);
3566
- }
3567
- }
3568
- else {
3569
- this.showMessage(customMessage, error, mkc);
3570
- }
3571
- };
3572
- MonkeyEcxHttpErrorHandlingService.prototype.handleError = function (error, mkc) {
3573
- var _this = this;
3574
- var router = this.router;
3575
- var status = error.status;
3576
- var routes = {
3577
- 403: 'forbidden',
3578
- 500: 'service-problems',
3579
- 503: 'service-problems'
3580
- };
3581
- var found = routes[status];
3582
- var timeout = 0;
3583
- if (found && !this.isHttpCodeIgnoreRedirect(mkc, error.status)) {
3584
- var route = ("/app/pages/" + found).toLowerCase();
3585
- timeout = 800;
3586
- router.navigate([route]);
3587
- }
3588
- setTimeout(function () {
3589
- _this.handleMessage(error, mkc);
3590
- }, timeout);
3591
- };
3592
- MonkeyEcxHttpErrorHandlingService.prototype.handleErrorRefreshToken = function (error, mkc) {
3593
- if (error.status === 401 || error.status === 400) {
3594
- i0.NgZone.call(this.monkeyecxAuthenticationService.redirectLoginWelcomeBack());
3595
- }
3596
- else if (!this.isHttpCodeIgnoreMessage(mkc, error.status)) {
3597
- this.handleMessage(error, mkc);
3598
- }
3599
- };
3600
- return MonkeyEcxHttpErrorHandlingService;
3601
- }(MonkeyEcxCommonsService));
3602
- MonkeyEcxHttpErrorHandlingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpErrorHandlingService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxTokenStorageService }, { token: MonkeyEcxAuthenticationService }, { token: i1__namespace$3.Router }, { token: i1__namespace.MonkeyStyleGuideSnackbarService }, { token: i1__namespace$1.TranslateService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3603
- MonkeyEcxHttpErrorHandlingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpErrorHandlingService, providedIn: 'root' });
3604
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpErrorHandlingService, decorators: [{
3605
- type: i0.Injectable,
3606
- args: [{
3607
- providedIn: 'root'
3608
- }]
3609
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxTokenStorageService }, { type: MonkeyEcxAuthenticationService }, { type: i1__namespace$3.Router }, { type: i1__namespace.MonkeyStyleGuideSnackbarService }, { type: i1__namespace$1.TranslateService }]; } });
3610
-
3611
- var MonkeyEcxOthersErrorsHandlingService = /** @class */ (function () {
3612
- function MonkeyEcxOthersErrorsHandlingService(modalService) {
3613
- this.modalService = modalService;
3614
- // not to do
3615
- }
3616
- MonkeyEcxOthersErrorsHandlingService.prototype.handleError = function (error) {
3617
- var modalService = this.modalService;
3618
- var message = error.message;
3619
- if (new RegExp(/Loading chunk [\d]+ failed/).test(message)) {
3620
- modalService.open(VersionChangedComponent, {
3621
- color: 'theme',
3622
- size: 'md'
3623
- });
3624
- }
3625
- };
3626
- return MonkeyEcxOthersErrorsHandlingService;
3627
- }());
3628
- MonkeyEcxOthersErrorsHandlingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxOthersErrorsHandlingService, deps: [{ token: i1__namespace.MonkeyStyleGuideModalService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3629
- MonkeyEcxOthersErrorsHandlingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxOthersErrorsHandlingService, providedIn: 'root' });
3630
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxOthersErrorsHandlingService, decorators: [{
3631
- type: i0.Injectable,
3632
- args: [{
3633
- providedIn: 'root'
3634
- }]
3635
- }], ctorParameters: function () { return [{ type: i1__namespace.MonkeyStyleGuideModalService }]; } });
3636
-
3637
- var MonkeyEcxErrorHandlingService = /** @class */ (function () {
3638
- function MonkeyEcxErrorHandlingService(injector) {
3639
- this.injector = injector;
3640
- // not to do
3641
- }
3642
- MonkeyEcxErrorHandlingService.prototype.handleError = function (error, type) {
3643
- var injector = this.injector;
3644
- var handlingService = injector.get(MonkeyEcxHandlingService);
3645
- var httpErrorHandlingService = injector.get(MonkeyEcxHttpErrorHandlingService);
3646
- var othersErrorsHandlingService = injector.get(MonkeyEcxOthersErrorsHandlingService);
3647
- if (error instanceof i1$4.HttpErrorResponse) {
3648
- var sCredentials = handlingService.getMonkeyEcxServiceCredentials();
3649
- if (MonkeyEcxUtils.persistNullEmptyUndefined(type) && type === 'refresh_token') {
3650
- httpErrorHandlingService.handleErrorRefreshToken(error, sCredentials);
3651
- }
3652
- else
3653
- httpErrorHandlingService.handleError(error, sCredentials);
3654
- }
3655
- else {
3656
- othersErrorsHandlingService.handleError(error);
3657
- }
3658
- };
3659
- return MonkeyEcxErrorHandlingService;
3660
- }());
3661
- MonkeyEcxErrorHandlingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorHandlingService, deps: [{ token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3662
- MonkeyEcxErrorHandlingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorHandlingService, providedIn: 'root' });
3663
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorHandlingService, decorators: [{
3664
- type: i0.Injectable,
3665
- args: [{
3666
- providedIn: 'root'
3667
- }]
3668
- }], ctorParameters: function () { return [{ type: i0__namespace.Injector }]; } });
3669
-
3670
- var MonkeyEcxErrorHandlingModule = /** @class */ (function () {
3671
- function MonkeyEcxErrorHandlingModule() {
3672
- }
3673
- MonkeyEcxErrorHandlingModule.forRoot = function () {
3674
- return {
3675
- ngModule: MonkeyEcxErrorHandlingModule,
3676
- providers: [
3677
- {
3678
- provide: i0.ErrorHandler,
3679
- useClass: MonkeyEcxErrorHandlingService
3680
- }
3681
- ]
3682
- };
3683
- };
3684
- return MonkeyEcxErrorHandlingModule;
3685
- }());
3686
- MonkeyEcxErrorHandlingModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorHandlingModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3687
- MonkeyEcxErrorHandlingModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorHandlingModule, imports: [i1$2.CommonModule] });
3688
- MonkeyEcxErrorHandlingModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorHandlingModule, imports: [[i1$2.CommonModule]] });
3689
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxErrorHandlingModule, decorators: [{
3690
- type: i0.NgModule,
3691
- args: [{
3692
- imports: [i1$2.CommonModule]
3693
- }]
3694
- }] });
3695
-
3696
- var MonkeyEcxHttpConfigErrorInterceptor = /** @class */ (function () {
3697
- function MonkeyEcxHttpConfigErrorInterceptor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
3698
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3699
- this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
3700
- // no to do
3701
- }
3702
- MonkeyEcxHttpConfigErrorInterceptor.prototype.intercept = function (request, next) {
3703
- var _this = this;
3704
- return next.handle(request).pipe(operators.map(function (event) {
3705
- return event;
3706
- }), operators.catchError(function (error) {
3707
- if (_this.monkeyecxAuthenticationService.refreshShouldHappen(error)) {
3708
- return _this.monkeyecxAuthenticationService.refreshToken().pipe(operators.take(1), operators.map(function () {
3709
- return _this.monkeyecxAuthenticationService.getRequestWithHeaders(request);
3710
- }), operators.mergeMap(function (resp) {
3711
- return next.handle(resp).pipe(operators.catchError(function (error) {
3712
- _this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
3713
- return rxjs.throwError(null);
3714
- }));
3715
- }), operators.catchError(function (error) {
3716
- _this.monkeyecxErrorHandlingService.handleError(error, 'refresh_token');
3717
- return rxjs.throwError(null);
3718
- }));
3719
- }
3720
- return rxjs.throwError(error);
3721
- }));
3722
- };
3723
- return MonkeyEcxHttpConfigErrorInterceptor;
3724
- }());
3725
- MonkeyEcxHttpConfigErrorInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigErrorInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3726
- MonkeyEcxHttpConfigErrorInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigErrorInterceptor });
3727
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigErrorInterceptor, decorators: [{
3728
- type: i0.Injectable
3729
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
3730
-
3731
- var MonkeyEcxHttpConfigHeaderInterceptor = /** @class */ (function () {
3732
- function MonkeyEcxHttpConfigHeaderInterceptor(monkeyecxAuthenticationService, monkeyecxErrorHandlingService) {
3733
- this.monkeyecxAuthenticationService = monkeyecxAuthenticationService;
3734
- this.monkeyecxErrorHandlingService = monkeyecxErrorHandlingService;
3735
- // not to do
3736
- }
3737
- MonkeyEcxHttpConfigHeaderInterceptor.prototype.intercept = function (request, next) {
3738
- var _this = this;
3739
- return this.monkeyecxAuthenticationService.getRequestWithHeadersOb(request).pipe(operators.take(1), operators.map(function (event) {
3740
- return event;
3741
- }), operators.mergeMap(function (resp) {
3742
- request = request.clone({
3743
- setHeaders: resp
3744
- });
3745
- return next.handle(request);
3746
- }), operators.catchError(function (error) {
3747
- _this.monkeyecxErrorHandlingService.handleError(error);
3748
- return rxjs.throwError(error);
3749
- }));
3750
- };
3751
- return MonkeyEcxHttpConfigHeaderInterceptor;
3752
- }());
3753
- MonkeyEcxHttpConfigHeaderInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigHeaderInterceptor, deps: [{ token: MonkeyEcxAuthenticationService }, { token: MonkeyEcxErrorHandlingService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3754
- MonkeyEcxHttpConfigHeaderInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigHeaderInterceptor });
3755
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigHeaderInterceptor, decorators: [{
3756
- type: i0.Injectable
3757
- }], ctorParameters: function () { return [{ type: MonkeyEcxAuthenticationService }, { type: MonkeyEcxErrorHandlingService }]; } });
3758
-
3759
- var MonkeyEcxRequestQueueHandlingService = /** @class */ (function () {
3760
- function MonkeyEcxRequestQueueHandlingService() {
3761
- this.queue = [];
3762
- this.newQueue = new rxjs.BehaviorSubject(false);
3763
- this.queues$ = new rxjs.BehaviorSubject([]);
3764
- }
3765
- MonkeyEcxRequestQueueHandlingService.prototype.addToQueue = function (q) {
3766
- this.queue.push(q);
3767
- this.queues$.next(this.queue);
3768
- this.newQueue.next(true);
3769
- };
3770
- MonkeyEcxRequestQueueHandlingService.prototype.markQueueItemAsFinish = function (q, status, action) {
3771
- var saved = __spreadArray([], __read(this.queue));
3772
- this.queue = __spreadArray([], __read(saved.map(function (val) {
3773
- var valSaved = Object.assign({}, val);
3774
- if (val.status === MonkeyEcxQueueEvents.OnGoing) {
3775
- if (valSaved.item.id === q.item.id) {
3776
- return Object.assign(Object.assign({}, valSaved), { status: status || MonkeyEcxQueueEvents.Finished, action: action });
3777
- }
3778
- }
3779
- return valSaved;
3780
- })));
3781
- this.queues$.next(this.queue);
3782
- };
3783
- MonkeyEcxRequestQueueHandlingService.prototype.updateQueue = function (q, progress) {
3784
- var saved = __spreadArray([], __read(this.queue));
3785
- this.queue = __spreadArray([], __read(saved.map(function (val) {
3786
- var valSaved = Object.assign({}, val);
3787
- var total = progress.total, loaded = progress.loaded;
3788
- var currentPecentage = Math.floor((loaded / total) * 100);
3789
- var totalPercentage = 100;
3790
- if (valSaved.item.id === q.item.id) {
3791
- return Object.assign(Object.assign({}, valSaved), { progress: {
3792
- loaded: loaded,
3793
- total: total,
3794
- currentPercentage: currentPecentage,
3795
- totalPercentage: totalPercentage
3796
- } });
3797
- }
3798
- return valSaved;
3799
- })));
3800
- this.queues$.next(this.queue);
3801
- };
3802
- MonkeyEcxRequestQueueHandlingService.prototype.deleteQueue = function (q) {
3803
- var saved = __spreadArray([], __read(this.queue));
3804
- this.queue = __spreadArray([], __read(saved.map(function (val) {
3805
- var valSaved = Object.assign({}, val);
3806
- if (valSaved.item.id === q.item.id) {
3807
- return null;
3808
- }
3809
- return valSaved;
3810
- }))).filter(function (_) {
3811
- return _;
3812
- });
3813
- this.queues$.next(this.queue);
3814
- };
3815
- MonkeyEcxRequestQueueHandlingService.prototype.setQueue = function (q) {
3816
- this.addToQueue(q);
3817
- };
3818
- MonkeyEcxRequestQueueHandlingService.prototype.getQueue = function () {
3819
- return this.queues$.asObservable();
3820
- };
3821
- MonkeyEcxRequestQueueHandlingService.prototype.finishQueueItem = function (q, action, status) {
3822
- this.markQueueItemAsFinish(q, status, action);
3823
- };
3824
- MonkeyEcxRequestQueueHandlingService.prototype.removeQueueItem = function (q) {
3825
- this.deleteQueue(q);
3826
- };
3827
- MonkeyEcxRequestQueueHandlingService.prototype.updateQueueItem = function (q, progress) {
3828
- this.updateQueue(q, progress);
3829
- };
3830
- MonkeyEcxRequestQueueHandlingService.prototype.hasNewQueue = function () {
3831
- return this.newQueue.pipe(operators.map(function (_) {
3832
- return _;
3833
- }));
3834
- };
3835
- return MonkeyEcxRequestQueueHandlingService;
3836
- }());
3837
- MonkeyEcxRequestQueueHandlingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestQueueHandlingService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3838
- MonkeyEcxRequestQueueHandlingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestQueueHandlingService, providedIn: 'root' });
3839
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestQueueHandlingService, decorators: [{
3840
- type: i0.Injectable,
3841
- args: [{
3842
- providedIn: 'root'
3843
- }]
3844
- }], ctorParameters: function () { return []; } });
3845
-
3846
- var MonkeyEcxRequestQueueModalHandlingService = /** @class */ (function () {
3847
- function MonkeyEcxRequestQueueModalHandlingService() {
3848
- this.queue = [];
3849
- this.newQueue$ = new rxjs.BehaviorSubject(false);
3850
- this.allQueueFinished$ = new rxjs.BehaviorSubject(false);
3851
- this.queues$ = new rxjs.BehaviorSubject([]);
3852
- }
3853
- MonkeyEcxRequestQueueModalHandlingService.prototype.addToQueue = function (q) {
3854
- this.queue.push(q);
3855
- this.queues$.next(this.queue);
3856
- this.newQueue$.next(true);
3857
- };
3858
- MonkeyEcxRequestQueueModalHandlingService.prototype.markQueueItemAsFinish = function (q, status, action) {
3859
- var saved = __spreadArray([], __read(this.queue));
3860
- this.queue = __spreadArray([], __read(saved.map(function (val) {
3861
- var valSaved = Object.assign({}, val);
3862
- if (val.status === MonkeyEcxQueueEvents.OnGoing) {
3863
- if (valSaved.item.id === q.item.id) {
3864
- return Object.assign(Object.assign({}, valSaved), { status: status || MonkeyEcxQueueEvents.Finished, action: action });
3865
- }
3866
- }
3867
- return valSaved;
3868
- })));
3869
- this.queues$.next(this.queue);
3870
- };
3871
- MonkeyEcxRequestQueueModalHandlingService.prototype.updateQueue = function (q, progress) {
3872
- var saved = __spreadArray([], __read(this.queue));
3873
- this.queue = __spreadArray([], __read(saved.map(function (val) {
3874
- var valSaved = Object.assign({}, val);
3875
- var total = progress.total, loaded = progress.loaded;
3876
- var currentPecentage = Math.floor((loaded / total) * 100);
3877
- var totalPercentage = 100;
3878
- if (valSaved.item.id === q.item.id) {
3879
- return Object.assign(Object.assign({}, valSaved), { progress: {
3880
- loaded: loaded,
3881
- total: total,
3882
- currentPercentage: currentPecentage,
3883
- totalPercentage: totalPercentage
3884
- } });
3885
- }
3886
- return valSaved;
3887
- })));
3888
- this.queues$.next(this.queue);
3889
- };
3890
- MonkeyEcxRequestQueueModalHandlingService.prototype.deleteQueue = function (q) {
3891
- var saved = __spreadArray([], __read(this.queue));
3892
- this.queue = __spreadArray([], __read(saved.map(function (val) {
3893
- var valSaved = Object.assign({}, val);
3894
- if (valSaved.item.id === q.item.id) {
3895
- return null;
3896
- }
3897
- return valSaved;
3898
- }))).filter(function (_) {
3899
- return _;
3900
- });
3901
- this.queues$.next(this.queue);
3902
- if (this.queue.length <= 0) {
3903
- this.allQueueFinished$.next(true);
3904
- }
3905
- };
3906
- MonkeyEcxRequestQueueModalHandlingService.prototype.setQueue = function (q) {
3907
- this.addToQueue(q);
3908
- };
3909
- MonkeyEcxRequestQueueModalHandlingService.prototype.getQueue = function () {
3910
- return this.queues$.asObservable();
3911
- };
3912
- MonkeyEcxRequestQueueModalHandlingService.prototype.finishQueueItem = function (q, action, status) {
3913
- this.markQueueItemAsFinish(q, status, action);
3914
- };
3915
- MonkeyEcxRequestQueueModalHandlingService.prototype.removeQueueItem = function (q) {
3916
- this.deleteQueue(q);
3917
- };
3918
- MonkeyEcxRequestQueueModalHandlingService.prototype.updateQueueItem = function (q, progress) {
3919
- this.updateQueue(q, progress);
3920
- };
3921
- MonkeyEcxRequestQueueModalHandlingService.prototype.hasNewQueue = function () {
3922
- return this.newQueue$.pipe(operators.map(function (_) {
3923
- return _;
3924
- }));
3925
- };
3926
- MonkeyEcxRequestQueueModalHandlingService.prototype.hasAllQueueFinished = function () {
3927
- return this.allQueueFinished$.pipe(operators.map(function (_) {
3928
- return _;
3929
- }));
3930
- };
3931
- return MonkeyEcxRequestQueueModalHandlingService;
3932
- }());
3933
- MonkeyEcxRequestQueueModalHandlingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestQueueModalHandlingService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3934
- MonkeyEcxRequestQueueModalHandlingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestQueueModalHandlingService, providedIn: 'root' });
3935
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestQueueModalHandlingService, decorators: [{
3936
- type: i0.Injectable,
3937
- args: [{
3938
- providedIn: 'root'
3939
- }]
3940
- }], ctorParameters: function () { return []; } });
3941
-
3942
- /* eslint-disable max-len */
3943
- var MonkeyEcxHttpConfigQueueInterceptor = /** @class */ (function () {
3944
- function MonkeyEcxHttpConfigQueueInterceptor(injector, monkeyecxRequestQueueHandlingService) {
3945
- this.injector = injector;
3946
- this.monkeyecxRequestQueueHandlingService = monkeyecxRequestQueueHandlingService;
3947
- // not to do
3948
- }
3949
- MonkeyEcxHttpConfigQueueInterceptor.prototype.intercept = function (request, next) {
3950
- var _this = this;
3951
- var _a = this, injector = _a.injector, isQueueProperty = _a.isQueueProperty;
3952
- var monkeyecxHandlingService = injector.get(MonkeyEcxHandlingService);
3953
- var monkeyecxRequestQueue = monkeyecxHandlingService.getMonkeyEcxRequestQueue();
3954
- if (isQueueProperty(monkeyecxRequestQueue)) {
3955
- this.monkeyecxRequestQueueHandlingService.setQueue(monkeyecxRequestQueue);
3956
- }
3957
- return next.handle(request).pipe(operators.finalize(function () {
3958
- if (isQueueProperty(monkeyecxRequestQueue)) {
3959
- _this.monkeyecxRequestQueueHandlingService.finishQueueItem(monkeyecxRequestQueue);
3960
- }
3961
- }));
3962
- };
3963
- MonkeyEcxHttpConfigQueueInterceptor.prototype.isQueueProperty = function (mrq) {
3964
- return (MonkeyEcxUtils.persistNullEmptyUndefined(mrq) &&
3965
- MonkeyEcxUtils.persistNullEmptyUndefined(mrq.item.name));
3966
- };
3967
- return MonkeyEcxHttpConfigQueueInterceptor;
3968
- }());
3969
- MonkeyEcxHttpConfigQueueInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigQueueInterceptor, deps: [{ token: i0__namespace.Injector }, { token: MonkeyEcxRequestQueueHandlingService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3970
- MonkeyEcxHttpConfigQueueInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigQueueInterceptor });
3971
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigQueueInterceptor, decorators: [{
3972
- type: i0.Injectable
3973
- }], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: MonkeyEcxRequestQueueHandlingService }]; } });
3974
-
3975
- /* eslint-disable max-len */
3976
- var MonkeyEcxHttpConfigLoadingInProgressInterceptor = /** @class */ (function () {
3977
- function MonkeyEcxHttpConfigLoadingInProgressInterceptor(injector) {
3978
- this.injector = injector;
3979
- // no to do
3980
- }
3981
- MonkeyEcxHttpConfigLoadingInProgressInterceptor.prototype.intercept = function (request, next) {
3982
- var _a = this, injector = _a.injector, isLoadingInProgressProperty = _a.isLoadingInProgressProperty;
3983
- var handlingService = injector.get(MonkeyEcxHandlingService);
3984
- var progressBarService = injector.get(MonkeyEcxProgressBarService);
3985
- var inProgress = handlingService.getMonkeyEcxServiceCredentials()
3986
- ? handlingService.getMonkeyEcxServiceCredentials().requestInProgress
3987
- : null;
3988
- if (isLoadingInProgressProperty(inProgress)) {
3989
- progressBarService.show();
3990
- }
3991
- return next.handle(request).pipe(operators.finalize(function () {
3992
- if (isLoadingInProgressProperty(inProgress)) {
3993
- progressBarService.hide();
3994
- }
3995
- }));
3996
- };
3997
- MonkeyEcxHttpConfigLoadingInProgressInterceptor.prototype.isLoadingInProgressProperty = function (mlp) {
3998
- return MonkeyEcxUtils.persistNullEmptyUndefined(mlp) &&
3999
- MonkeyEcxUtils.persistNullEmptyUndefined(mlp.showProgress)
4000
- ? mlp.showProgress
4001
- : true;
4002
- };
4003
- return MonkeyEcxHttpConfigLoadingInProgressInterceptor;
4004
- }());
4005
- MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, deps: [{ token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4006
- MonkeyEcxHttpConfigLoadingInProgressInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor });
4007
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigLoadingInProgressInterceptor, decorators: [{
4008
- type: i0.Injectable
4009
- }], ctorParameters: function () { return [{ type: i0__namespace.Injector }]; } });
4010
-
4011
- var MonkeyEcxHttpConfigInterceptorModule = /** @class */ (function () {
4012
- function MonkeyEcxHttpConfigInterceptorModule() {
4013
- }
4014
- MonkeyEcxHttpConfigInterceptorModule.forRoot = function () {
4015
- return {
4016
- ngModule: MonkeyEcxHttpConfigInterceptorModule,
4017
- providers: [
4018
- {
4019
- provide: i1$4.HTTP_INTERCEPTORS,
4020
- useClass: MonkeyEcxHttpConfigHeaderInterceptor,
4021
- multi: true
4022
- },
4023
- {
4024
- provide: i1$4.HTTP_INTERCEPTORS,
4025
- useClass: MonkeyEcxHttpConfigErrorInterceptor,
4026
- multi: true
4027
- },
4028
- {
4029
- provide: i1$4.HTTP_INTERCEPTORS,
4030
- useClass: MonkeyEcxHttpConfigQueueInterceptor,
4031
- multi: true
4032
- },
4033
- {
4034
- provide: i1$4.HTTP_INTERCEPTORS,
4035
- useClass: MonkeyEcxHttpConfigLoadingInProgressInterceptor,
4036
- multi: true
4037
- }
4038
- ]
4039
- };
4040
- };
4041
- return MonkeyEcxHttpConfigInterceptorModule;
4042
- }());
4043
- MonkeyEcxHttpConfigInterceptorModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigInterceptorModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
4044
- MonkeyEcxHttpConfigInterceptorModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigInterceptorModule, imports: [i1$2.CommonModule] });
4045
- MonkeyEcxHttpConfigInterceptorModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigInterceptorModule, imports: [[i1$2.CommonModule]] });
4046
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxHttpConfigInterceptorModule, decorators: [{
4047
- type: i0.NgModule,
4048
- args: [{
4049
- imports: [i1$2.CommonModule]
4050
- }]
4051
- }] });
4052
-
4053
- var MonkeyEcxModel = /** @class */ (function () {
4054
- function MonkeyEcxModel() {
4055
- }
4056
- MonkeyEcxModel.prototype.getAction = function (type) {
4057
- var _links = this._links;
4058
- if (!_links)
4059
- return null;
4060
- var link = _links[type.toLowerCase()];
4061
- return link;
4062
- };
4063
- return MonkeyEcxModel;
4064
- }());
4065
-
4066
- /* eslint-disable indent */
4067
- var MonkeyEcxConfigModule = /** @class */ (function () {
4068
- function MonkeyEcxConfigModule(parentModule) {
4069
- if (parentModule) {
4070
- throw new Error('MonkeyEcxConfigModule is already loaded. Import it in the AppModule only!');
4071
- }
4072
- }
4073
- MonkeyEcxConfigModule.forRoot = function () {
4074
- return {
4075
- ngModule: MonkeyEcxConfigModule,
4076
- providers: [MonkeyEcxConfigService]
4077
- };
4078
- };
4079
- return MonkeyEcxConfigModule;
4080
- }());
4081
- MonkeyEcxConfigModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxConfigModule, deps: [{ token: MonkeyEcxConfigModule, optional: true, skipSelf: true }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
4082
- MonkeyEcxConfigModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxConfigModule });
4083
- MonkeyEcxConfigModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxConfigModule });
4084
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxConfigModule, decorators: [{
4085
- type: i0.NgModule
4086
- }], ctorParameters: function () {
4087
- return [{ type: MonkeyEcxConfigModule, decorators: [{
4088
- type: i0.Optional
4089
- }, {
4090
- type: i0.SkipSelf
4091
- }] }];
4092
- } });
4093
-
4094
- var MonkeyEcxLoggedHandlingService = /** @class */ (function () {
4095
- function MonkeyEcxLoggedHandlingService() {
4096
- this.schedules = [];
4097
- // not to do
4098
- }
4099
- MonkeyEcxLoggedHandlingService.prototype.destroySchedule = function () {
4100
- this.schedules.forEach(function (sch) {
4101
- clearInterval(sch.interval);
4102
- });
4103
- this.schedules = [];
4104
- };
4105
- MonkeyEcxLoggedHandlingService.prototype.addSchedule = function (sch) {
4106
- this.schedules = sch;
4107
- };
4108
- MonkeyEcxLoggedHandlingService.prototype.destroy = function () {
4109
- this.destroySchedule();
4110
- };
4111
- return MonkeyEcxLoggedHandlingService;
4112
- }());
4113
- MonkeyEcxLoggedHandlingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxLoggedHandlingService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4114
- MonkeyEcxLoggedHandlingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxLoggedHandlingService, providedIn: 'root' });
4115
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxLoggedHandlingService, decorators: [{
4116
- type: i0.Injectable,
4117
- args: [{
4118
- providedIn: 'root'
4119
- }]
4120
- }], ctorParameters: function () { return []; } });
4121
-
4122
- var MonkeyEcxRequestDownloadHandlingService = /** @class */ (function () {
4123
- function MonkeyEcxRequestDownloadHandlingService() {
4124
- this.download = [];
4125
- this.download$ = new rxjs.BehaviorSubject([]);
4126
- }
4127
- MonkeyEcxRequestDownloadHandlingService.prototype.addTo = function (q) {
4128
- this.download.push(q);
4129
- this.download$.next(this.download);
4130
- };
4131
- MonkeyEcxRequestDownloadHandlingService.prototype.markItemAsFinish = function (q, status) {
4132
- var saved = __spreadArray([], __read(this.download));
4133
- this.download = __spreadArray([], __read(saved
4134
- .map(function (val) {
4135
- if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
4136
- var valSaved = Object.assign({}, val);
4137
- if (valSaved.item.id === q.item.id) {
4138
- return Object.assign(Object.assign({}, valSaved), { status: status || MonkeyEcxDownloadEvents.Finished });
4139
- }
4140
- return valSaved;
4141
- }
4142
- return null;
4143
- })
4144
- .filter(function (_) {
4145
- return _;
4146
- })));
4147
- this.download = this.download.filter(function (_) {
4148
- return _.status === MonkeyEcxDownloadEvents.OnGoing;
4149
- });
4150
- this.download$.next(this.download);
4151
- };
4152
- MonkeyEcxRequestDownloadHandlingService.prototype.updateItem = function (q, loaded, total) {
4153
- var saved = __spreadArray([], __read(this.download));
4154
- this.download = __spreadArray([], __read(saved.map(function (val) {
4155
- var valSaved = Object.assign({}, val);
4156
- var currentPecentage = Math.floor((loaded / total) * 100);
4157
- var totalPercentage = 100;
4158
- if (valSaved.item.id === q.item.id) {
4159
- return Object.assign(Object.assign({}, valSaved), { loaded: loaded,
4160
- total: total, currentPercentage: currentPecentage, totalPercentage: totalPercentage });
4161
- }
4162
- return valSaved;
4163
- })));
4164
- this.download$.next(this.download);
4165
- };
4166
- MonkeyEcxRequestDownloadHandlingService.prototype.set = function (q) {
4167
- this.addTo(q);
4168
- };
4169
- MonkeyEcxRequestDownloadHandlingService.prototype.get = function () {
4170
- return this.download$.asObservable();
4171
- };
4172
- MonkeyEcxRequestDownloadHandlingService.prototype.update = function (q, loaded, total) {
4173
- this.updateItem(q, loaded, total);
4174
- };
4175
- MonkeyEcxRequestDownloadHandlingService.prototype.finishItem = function (q, status) {
4176
- this.markItemAsFinish(q, status);
4177
- };
4178
- MonkeyEcxRequestDownloadHandlingService.prototype.hasDownloadOnGoing = function () {
4179
- var found = this.download.find(function (_) {
4180
- return _.status === MonkeyEcxDownloadEvents.OnGoing;
4181
- });
4182
- return MonkeyEcxUtils.persistNullEmptyUndefined(found);
4183
- };
4184
- return MonkeyEcxRequestDownloadHandlingService;
4185
- }());
4186
- MonkeyEcxRequestDownloadHandlingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestDownloadHandlingService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4187
- MonkeyEcxRequestDownloadHandlingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestDownloadHandlingService, providedIn: 'root' });
4188
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestDownloadHandlingService, decorators: [{
4189
- type: i0.Injectable,
4190
- args: [{
4191
- providedIn: 'root'
4192
- }]
4193
- }], ctorParameters: function () { return []; } });
4194
-
4195
- var MonkeyEcxRequestDownloadedHandlingService = /** @class */ (function () {
4196
- function MonkeyEcxRequestDownloadedHandlingService() {
4197
- this.downloaded = [];
4198
- this.downloaded$ = new rxjs.BehaviorSubject([]);
4199
- }
4200
- MonkeyEcxRequestDownloadedHandlingService.prototype.addTo = function (q) {
4201
- this.downloaded.push(q);
4202
- this.downloaded$.next(this.downloaded);
4203
- };
4204
- MonkeyEcxRequestDownloadedHandlingService.prototype.markItemAsFinish = function (q, status) {
4205
- var saved = __spreadArray([], __read(this.downloaded));
4206
- this.downloaded = __spreadArray([], __read(saved.map(function (val) {
4207
- if (val.status === MonkeyEcxDownloadEvents.OnGoing) {
4208
- var valSaved = Object.assign({}, val);
4209
- if (valSaved.item.id === q.item.id) {
4210
- return Object.assign(Object.assign({}, valSaved), { status: status || MonkeyEcxDownloadEvents.Finished, action: q.action });
4211
- }
4212
- return valSaved;
4213
- }
4214
- return val;
4215
- })));
4216
- this.downloaded$.next(this.downloaded);
4217
- };
4218
- MonkeyEcxRequestDownloadedHandlingService.prototype.set = function (q) {
4219
- this.addTo(q);
4220
- };
4221
- MonkeyEcxRequestDownloadedHandlingService.prototype.get = function () {
4222
- return this.downloaded$.asObservable();
4223
- };
4224
- MonkeyEcxRequestDownloadedHandlingService.prototype.finishItem = function (q, status) {
4225
- this.markItemAsFinish(q, status);
4226
- };
4227
- MonkeyEcxRequestDownloadedHandlingService.prototype.hasDownloadOnGoing = function () {
4228
- var found = this.downloaded.find(function (_) {
4229
- return _.status === MonkeyEcxDownloadEvents.OnGoing;
4230
- });
4231
- return MonkeyEcxUtils.persistNullEmptyUndefined(found);
4232
- };
4233
- return MonkeyEcxRequestDownloadedHandlingService;
4234
- }());
4235
- MonkeyEcxRequestDownloadedHandlingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestDownloadedHandlingService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4236
- MonkeyEcxRequestDownloadedHandlingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestDownloadedHandlingService, providedIn: 'root' });
4237
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestDownloadedHandlingService, decorators: [{
4238
- type: i0.Injectable,
4239
- args: [{
4240
- providedIn: 'root'
4241
- }]
4242
- }], ctorParameters: function () { return []; } });
4243
-
4244
- var MonkeyEcxDiscoveryParamsService = /** @class */ (function () {
4245
- function MonkeyEcxDiscoveryParamsService(router) {
4246
- this.router = router;
4247
- // not to do
4248
- }
4249
- MonkeyEcxDiscoveryParamsService.prototype.getLastChild = function (route) {
4250
- if (route.firstChild) {
4251
- return this.getLastChild(route.firstChild);
4252
- }
4253
- return route;
4254
- };
4255
- MonkeyEcxDiscoveryParamsService.prototype.setData = function (field, value) {
4256
- var root = this.router.routerState.snapshot.root;
4257
- var route = this.getLastChild(root);
4258
- route.data[field] = value;
4259
- };
4260
- MonkeyEcxDiscoveryParamsService.prototype.getData = function (field) {
4261
- var root = this.router.routerState.snapshot.root;
4262
- var route = this.getLastChild(root);
4263
- var found = MonkeyEcxUtils.persistNullEmptyUndefined(route) ? route.data[field] : null;
4264
- return found;
4265
- };
4266
- MonkeyEcxDiscoveryParamsService.prototype.getDataFromCurrentNavigation = function (field) {
4267
- var navigation = this.router.getCurrentNavigation();
4268
- var state = null;
4269
- if (MonkeyEcxUtils.persistNullEmptyUndefined(navigation)) {
4270
- state = navigation.extras.state;
4271
- }
4272
- return state ? state[field] : null;
4273
- };
4274
- MonkeyEcxDiscoveryParamsService.prototype.getParam = function (param) {
4275
- var root = this.router.routerState.snapshot.root;
4276
- var route = this.getLastChild(root);
4277
- var found = MonkeyEcxUtils.persistNullEmptyUndefined(route)
4278
- ? route.paramMap.get(param)
4279
- : '';
4280
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(found))
4281
- found = this.getData(param);
4282
- return found;
4283
- };
4284
- return MonkeyEcxDiscoveryParamsService;
4285
- }());
4286
- MonkeyEcxDiscoveryParamsService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDiscoveryParamsService, deps: [{ token: i1__namespace$3.Router }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4287
- MonkeyEcxDiscoveryParamsService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDiscoveryParamsService, providedIn: 'root' });
4288
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxDiscoveryParamsService, decorators: [{
4289
- type: i0.Injectable,
4290
- args: [{
4291
- providedIn: 'root'
4292
- }]
4293
- }], ctorParameters: function () { return [{ type: i1__namespace$3.Router }]; } });
4294
-
4295
- var MonkeyEcxRequestScheduleService = /** @class */ (function () {
4296
- function MonkeyEcxRequestScheduleService(monkeyecxService, monkeyecxLoggedHandlingService) {
4297
- this.monkeyecxService = monkeyecxService;
4298
- this.monkeyecxLoggedHandlingService = monkeyecxLoggedHandlingService;
4299
- this.schedule = [];
4300
- // not to do
4301
- }
4302
- MonkeyEcxRequestScheduleService.prototype.addToSchedule = function (q) {
4303
- this.schedule.push(q);
4304
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4305
- };
4306
- MonkeyEcxRequestScheduleService.prototype.removeFromSchedule = function (q) {
4307
- clearInterval(q.interval);
4308
- var saved = __spreadArray([], __read(this.schedule));
4309
- this.schedule = __spreadArray([], __read(saved.map(function (sch) {
4310
- var savedLocal = Object.assign({}, sch);
4311
- if (sch.id === q.id) {
4312
- return null;
4313
- }
4314
- return savedLocal;
4315
- }))).filter(function (_) {
4316
- return _;
4317
- });
4318
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4319
- };
4320
- MonkeyEcxRequestScheduleService.prototype.removeFromScheduleById = function (id) {
4321
- var q = this.getScheduleById(id);
4322
- clearInterval(q.interval);
4323
- var saved = __spreadArray([], __read(this.schedule));
4324
- this.schedule = __spreadArray([], __read(saved.map(function (sch) {
4325
- var savedLocal = Object.assign({}, sch);
4326
- if (sch.id === q.id) {
4327
- return null;
4328
- }
4329
- return savedLocal;
4330
- }))).filter(function (_) {
4331
- return _;
4332
- });
4333
- this.monkeyecxLoggedHandlingService.addSchedule(this.schedule);
4334
- };
4335
- MonkeyEcxRequestScheduleService.prototype.doCall = function (sch) {
4336
- var _this = this;
4337
- var url = sch.url, method = sch.method, params = sch.params, data = sch.data, action = sch.action;
4338
- this.monkeyecxService[method.toLowerCase()]("" + url, params).subscribe(function (resp) {
4339
- action(Object.assign(Object.assign({}, data), resp), sch);
4340
- }, function () {
4341
- _this.removeFromSchedule(sch);
4342
- });
4343
- };
4344
- MonkeyEcxRequestScheduleService.prototype.setSchedule = function (q, delay) {
4345
- var _this = this;
4346
- if (delay === void 0) { delay = 3000; }
4347
- var interval = setInterval(function () {
4348
- _this.doCall(Object.assign(Object.assign({}, q), { interval: interval }));
4349
- }, delay);
4350
- var sch = Object.assign(Object.assign({}, q), { id: "" + MonkeyEcxUtils.getRandomString(40), interval: interval });
4351
- this.addToSchedule(sch);
4352
- return sch;
4353
- };
4354
- MonkeyEcxRequestScheduleService.prototype.removeSchedule = function (q) {
4355
- this.removeFromSchedule(q);
4356
- };
4357
- MonkeyEcxRequestScheduleService.prototype.removeScheduleById = function (id) {
4358
- this.removeFromScheduleById(id);
4359
- };
4360
- MonkeyEcxRequestScheduleService.prototype.getScheduleById = function (id) {
4361
- var q = this.schedule.find(function (sch) {
4362
- return sch.id === id;
4363
- });
4364
- return q;
4365
- };
4366
- return MonkeyEcxRequestScheduleService;
4367
- }());
4368
- MonkeyEcxRequestScheduleService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestScheduleService, deps: [{ token: MonkeyEcxService }, { token: MonkeyEcxLoggedHandlingService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
4369
- MonkeyEcxRequestScheduleService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestScheduleService, providedIn: 'root' });
4370
- __decorate([
4371
- MonkeyEcxCoreService({
4372
- httpResponse: {
4373
- httpCodeIgnore: [400, 403, 404, 500, 503]
4374
- },
4375
- requestInProgress: {
4376
- showProgress: false
4377
- }
4378
- })
4379
- ], MonkeyEcxRequestScheduleService.prototype, "doCall", null);
4380
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyEcxRequestScheduleService, decorators: [{
4381
- type: i0.Injectable,
4382
- args: [{
4383
- providedIn: 'root'
4384
- }]
4385
- }], ctorParameters: function () { return [{ type: MonkeyEcxService }, { type: MonkeyEcxLoggedHandlingService }]; }, propDecorators: { doCall: [] } });
4386
-
4387
- /* eslint-disable no-unused-vars */
4388
- exports.OpSearch = void 0;
4389
- (function (OpSearch) {
4390
- OpSearch["LIKE"] = ":*:value*";
4391
- OpSearch["BETWEEN"] = ":first AND :last";
4392
- OpSearch["OR"] = "OR";
4393
- OpSearch["AND"] = "AND";
4394
- OpSearch["GT"] = ">:value";
4395
- OpSearch["LT"] = "<:value";
4396
- OpSearch["EQUAL"] = "::value";
4397
- })(exports.OpSearch || (exports.OpSearch = {}));
4398
- var MonkeyEcxSpecificationSearch = /** @class */ (function () {
4399
- function MonkeyEcxSpecificationSearch() {
4400
- // not to do
4401
- }
4402
- MonkeyEcxSpecificationSearch.prototype.handleValue = function (value) {
4403
- return Object.entries(value).map(function (_c) {
4404
- var _d = __read(_c, 2), key = _d[0], value1 = _d[1];
4405
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(value1)) {
4406
- return null;
4407
- }
4408
- if (Array.isArray(value1)) {
4409
- if (key === exports.OpSearch.BETWEEN) {
4410
- return ("" + key).replace(':first', value1[0]).replace(':last', value1[1]);
4411
- }
4412
- }
4413
- return ("" + key).replace(':value', value1.toString());
4414
- })[0];
4415
- };
4416
- MonkeyEcxSpecificationSearch.prototype.queryVisitor = function (value) {
4417
- var _this = this;
4418
- var okay = Object.entries(value).map(function (_c) {
4419
- var _d = __read(_c, 2), key1 = _d[0], value1 = _d[1];
4420
- if (key1 === exports.OpSearch.OR || key1 === exports.OpSearch.AND) {
4421
- var join = value1
4422
- .map(function (_) {
4423
- return Object.entries(_).map(function (_c) {
4424
- var _d = __read(_c, 2), key2 = _d[0], value2 = _d[1];
4425
- if (value2 instanceof Object) {
4426
- value2 = _this.handleValue(value2);
4427
- }
4428
- return _this.criteriaParser(key2, value2);
4429
- })[0];
4430
- })
4431
- .filter(function (_) {
4432
- return _;
4433
- })
4434
- .join(" " + key1 + " ");
4435
- return "" + (join ? "(" + join + ")" : '');
4436
- }
4437
- if (value1 instanceof Object) {
4438
- value1 = _this.handleValue(value1);
4439
- }
4440
- return _this.criteriaParser(key1, value1);
4441
- });
4442
- return okay
4443
- .filter(function (_) {
4444
- return _;
4445
- })
4446
- .join(' AND ');
4447
- };
4448
- MonkeyEcxSpecificationSearch.prototype.criteriaParser = function (key, value) {
4449
- if (!MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
4450
- return '';
4451
- }
4452
- if (value instanceof Object) {
4453
- return this.queryVisitor(value);
4454
- }
4455
- return "" + key + value;
4456
- };
4457
- MonkeyEcxSpecificationSearch.prototype.build = function (spec) {
4458
- try {
4459
- return this.queryVisitor(spec);
4460
- }
4461
- catch (e) {
4462
- throw new Error("MonkeyEcxSpecificationSearch Error " + e);
4463
- }
4464
- };
4465
- MonkeyEcxSpecificationSearch.prototype.buildMoreThanOne = function (field, op) {
4466
- if (op === void 0) { op = exports.OpSearch.EQUAL; }
4467
- var _a, _b;
4468
- try {
4469
- if (!this[field])
4470
- return [];
4471
- var filters = (_b = (_a = this[field]) === null || _a === void 0 ? void 0 : _a.split(',')) === null || _b === void 0 ? void 0 : _b.map(function (filter) {
4472
- var _c, _d;
4473
- if (!filter)
4474
- return null;
4475
- return _c = {},
4476
- _c[field] = (_d = {},
4477
- _d[op] = "" + filter,
4478
- _d),
4479
- _c;
4480
- }).filter(function (val) { return val; });
4481
- return filters || [];
4482
- }
4483
- catch (e) {
4484
- throw new Error("MonkeyEcxSpecificationSearch Error " + e);
4485
- }
4486
- };
4487
- return MonkeyEcxSpecificationSearch;
4488
- }());
4489
-
4490
- var MonkeyFrontCoreModuleModule = /** @class */ (function () {
4491
- function MonkeyFrontCoreModuleModule() {
4492
- }
4493
- return MonkeyFrontCoreModuleModule;
4494
- }());
4495
- MonkeyFrontCoreModuleModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyFrontCoreModuleModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
4496
- MonkeyFrontCoreModuleModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyFrontCoreModuleModule, imports: [i1$2.CommonModule,
4497
- i1$4.HttpClientModule, i1__namespace$1.TranslateModule, MonkeyEcxConfigModule, MonkeyEcxHttpConfigInterceptorModule, MonkeyEcxErrorHandlingModule, i1.MonkeyStyleGuideModule, i1__namespace$6.ServiceWorkerModule, ClosedToMaintenanceModule,
4498
- VersionChangedModule] });
4499
- MonkeyFrontCoreModuleModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyFrontCoreModuleModule, providers: [
4500
- i1.MonkeyStyleGuideModalService,
4501
- i1.MonkeyStyleGuideSettingsService,
4502
- i1.MonkeyStyleGuideSnackbarService
4503
- ], imports: [[
4504
- i1$2.CommonModule,
4505
- i1$4.HttpClientModule,
4506
- i1$1.TranslateModule.forRoot(),
4507
- MonkeyEcxConfigModule.forRoot(),
4508
- MonkeyEcxHttpConfigInterceptorModule.forRoot(),
4509
- MonkeyEcxErrorHandlingModule.forRoot(),
4510
- i1.MonkeyStyleGuideModule,
4511
- i1$6.ServiceWorkerModule.register('ngsw-worker.js'),
4512
- ClosedToMaintenanceModule,
4513
- VersionChangedModule
4514
- ]] });
4515
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: MonkeyFrontCoreModuleModule, decorators: [{
4516
- type: i0.NgModule,
4517
- args: [{
4518
- imports: [
4519
- i1$2.CommonModule,
4520
- i1$4.HttpClientModule,
4521
- i1$1.TranslateModule.forRoot(),
4522
- MonkeyEcxConfigModule.forRoot(),
4523
- MonkeyEcxHttpConfigInterceptorModule.forRoot(),
4524
- MonkeyEcxErrorHandlingModule.forRoot(),
4525
- i1.MonkeyStyleGuideModule,
4526
- i1$6.ServiceWorkerModule.register('ngsw-worker.js'),
4527
- ClosedToMaintenanceModule,
4528
- VersionChangedModule
4529
- ],
4530
- providers: [
4531
- i1.MonkeyStyleGuideModalService,
4532
- i1.MonkeyStyleGuideSettingsService,
4533
- i1.MonkeyStyleGuideSnackbarService
4534
- ]
4535
- }]
4536
- }] });
4537
-
4538
- /*
4539
- * Public API Surface of monkey-front-core
4540
- */
4541
-
4542
- /**
4543
- * Generated bundle index. Do not edit.
4544
- */
4545
-
4546
- exports.ClosedToMaintenanceComponent = ClosedToMaintenanceComponent;
4547
- exports.ClosedToMaintenanceModule = ClosedToMaintenanceModule;
4548
- exports.DecoratorsUtils = decoratorsUtils;
4549
- exports.MonkeyEcxAuthGuard = MonkeyEcxAuthGuard;
4550
- exports.MonkeyEcxAuthGuardLogin = MonkeyEcxAuthGuardLogin;
4551
- exports.MonkeyEcxAuthenticationService = MonkeyEcxAuthenticationService;
4552
- exports.MonkeyEcxCommonsService = MonkeyEcxCommonsService;
4553
- exports.MonkeyEcxConfigModule = MonkeyEcxConfigModule;
4554
- exports.MonkeyEcxConfigService = MonkeyEcxConfigService;
4555
- exports.MonkeyEcxCookieStorageService = MonkeyEcxCookieStorageService;
4556
- exports.MonkeyEcxCoreClearDecorators = MonkeyEcxCoreClearDecorators;
4557
- exports.MonkeyEcxCoreLog = MonkeyEcxCoreLog;
4558
- exports.MonkeyEcxCoreService = MonkeyEcxCoreService;
4559
- exports.MonkeyEcxCoreServiceConstructor = MonkeyEcxCoreServiceConstructor;
4560
- exports.MonkeyEcxCoreServicePaged = MonkeyEcxCoreServicePaged;
4561
- exports.MonkeyEcxCoreServiceQueue = MonkeyEcxCoreServiceQueue;
4562
- exports.MonkeyEcxDirectivesModule = MonkeyEcxDirectivesModule;
4563
- exports.MonkeyEcxDiscoveryParamsService = MonkeyEcxDiscoveryParamsService;
4564
- exports.MonkeyEcxDisplayFirstNamePipe = MonkeyEcxDisplayFirstNamePipe;
4565
- exports.MonkeyEcxDocumentTypePipe = MonkeyEcxDocumentTypePipe;
4566
- exports.MonkeyEcxDragDropDirective = MonkeyEcxDragDropDirective;
4567
- exports.MonkeyEcxErrorHandlingModule = MonkeyEcxErrorHandlingModule;
4568
- exports.MonkeyEcxErrorHandlingService = MonkeyEcxErrorHandlingService;
4569
- exports.MonkeyEcxFeatureToggleService = MonkeyEcxFeatureToggleService;
4570
- exports.MonkeyEcxFormatCurrency = MonkeyEcxFormatCurrency;
4571
- exports.MonkeyEcxFormatCurrencyPipe = MonkeyEcxFormatCurrencyPipe;
4572
- exports.MonkeyEcxFormatDateTimelapsePipe = MonkeyEcxFormatDateTimelapsePipe;
4573
- exports.MonkeyEcxFormatDocumentPipe = MonkeyEcxFormatDocumentPipe;
4574
- exports.MonkeyEcxFormatNumber = MonkeyEcxFormatNumber;
4575
- exports.MonkeyEcxFormatSizePipe = MonkeyEcxFormatSizePipe;
4576
- exports.MonkeyEcxFormatUpper = MonkeyEcxFormatUpper;
4577
- exports.MonkeyEcxFormatValue = MonkeyEcxFormatValue;
4578
- exports.MonkeyEcxFormatZipCodePipe = MonkeyEcxFormatZipCodePipe;
4579
- exports.MonkeyEcxHandlingService = MonkeyEcxHandlingService;
4580
- exports.MonkeyEcxHttpConfigErrorInterceptor = MonkeyEcxHttpConfigErrorInterceptor;
4581
- exports.MonkeyEcxHttpConfigHeaderInterceptor = MonkeyEcxHttpConfigHeaderInterceptor;
4582
- exports.MonkeyEcxHttpConfigInterceptorModule = MonkeyEcxHttpConfigInterceptorModule;
4583
- exports.MonkeyEcxHttpConfigLoadingInProgressInterceptor = MonkeyEcxHttpConfigLoadingInProgressInterceptor;
4584
- exports.MonkeyEcxHttpConfigQueueInterceptor = MonkeyEcxHttpConfigQueueInterceptor;
4585
- exports.MonkeyEcxHttpErrorHandlingService = MonkeyEcxHttpErrorHandlingService;
4586
- exports.MonkeyEcxLoggedHandlingService = MonkeyEcxLoggedHandlingService;
4587
- exports.MonkeyEcxLogsConfigService = MonkeyEcxLogsConfigService;
4588
- exports.MonkeyEcxMaintenanceConfigService = MonkeyEcxMaintenanceConfigService;
4589
- exports.MonkeyEcxModel = MonkeyEcxModel;
4590
- exports.MonkeyEcxOnlyAlphaNumericDirective = MonkeyEcxOnlyAlphaNumericDirective;
4591
- exports.MonkeyEcxOnlyNumbersDirective = MonkeyEcxOnlyNumbersDirective;
4592
- exports.MonkeyEcxOthersErrorsHandlingService = MonkeyEcxOthersErrorsHandlingService;
4593
- exports.MonkeyEcxPipesModule = MonkeyEcxPipesModule;
4594
- exports.MonkeyEcxProgressBarComponent = MonkeyEcxProgressBarComponent;
4595
- exports.MonkeyEcxProgressBarModule = MonkeyEcxProgressBarModule;
4596
- exports.MonkeyEcxProgressBarService = MonkeyEcxProgressBarService;
4597
- exports.MonkeyEcxRequestDownloadHandlingService = MonkeyEcxRequestDownloadHandlingService;
4598
- exports.MonkeyEcxRequestDownloadedHandlingService = MonkeyEcxRequestDownloadedHandlingService;
4599
- exports.MonkeyEcxRequestPagedHandling = MonkeyEcxRequestPagedHandling;
4600
- exports.MonkeyEcxRequestQueueHandlingService = MonkeyEcxRequestQueueHandlingService;
4601
- exports.MonkeyEcxRequestQueueModalHandlingService = MonkeyEcxRequestQueueModalHandlingService;
4602
- exports.MonkeyEcxRequestScheduleService = MonkeyEcxRequestScheduleService;
4603
- exports.MonkeyEcxSecurityConsoleConfigService = MonkeyEcxSecurityConsoleConfigService;
4604
- exports.MonkeyEcxSecurityDirective = MonkeyEcxSecurityDirective;
4605
- exports.MonkeyEcxService = MonkeyEcxService;
4606
- exports.MonkeyEcxServiceDownload = MonkeyEcxServiceDownload;
4607
- exports.MonkeyEcxServiceUpload = MonkeyEcxServiceUpload;
4608
- exports.MonkeyEcxServiceWorkerConfigService = MonkeyEcxServiceWorkerConfigService;
4609
- exports.MonkeyEcxSpecificationSearch = MonkeyEcxSpecificationSearch;
4610
- exports.MonkeyEcxTextTruncatePipe = MonkeyEcxTextTruncatePipe;
4611
- exports.MonkeyEcxTokenStorageService = MonkeyEcxTokenStorageService;
4612
- exports.MonkeyEcxTooltipDirective = MonkeyEcxTooltipDirective;
4613
- exports.MonkeyEcxTruncateQtdPipe = MonkeyEcxTruncateQtdPipe;
4614
- exports.MonkeyEcxUtils = MonkeyEcxUtils;
4615
- exports.MonkeyEcxi18nConfigService = MonkeyEcxi18nConfigService;
4616
- exports.MonkeyFeatureDirective = MonkeyFeatureDirective;
4617
- exports.MonkeyFrontCoreModuleModule = MonkeyFrontCoreModuleModule;
4618
- exports.Statics = statics;
4619
- exports.ValidateUtils = validateUtils;
4620
- exports.Validators = Validators;
4621
- exports.VersionChangedComponent = VersionChangedComponent;
4622
- exports.VersionChangedModule = VersionChangedModule;
4623
- exports.comboValidator = comboValidator;
4624
- exports.dateRangeValidator = dateRangeValidator;
4625
- exports.dateStartEndValidator = dateStartEndValidator;
4626
- exports.dateValidator = dateValidator;
4627
- exports.documentValidator = documentValidator;
4628
- exports.emailValidator = emailValidator;
4629
- exports.passwordConfirmValidator = passwordConfirmValidator;
4630
- exports.registerValidator = registerValidator;
4631
- exports.trueValidator = trueValidator;
4632
- exports.urlValidator = urlValidator;
4633
- exports.zipCodeValidator = zipCodeValidator;
4634
-
4635
- Object.defineProperty(exports, '__esModule', { value: true });
4636
-
4637
- }));
4638
- //# sourceMappingURL=monkey-front-core.umd.js.map