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