@c8y/ngx-components 1023.14.2 → 1023.14.33

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 (251) hide show
  1. package/ai/index.d.ts +4 -2
  2. package/ai/index.d.ts.map +1 -1
  3. package/auth-configuration/index.d.ts +6 -3
  4. package/auth-configuration/index.d.ts.map +1 -1
  5. package/context-dashboard/index.d.ts +1 -0
  6. package/context-dashboard/index.d.ts.map +1 -1
  7. package/datapoint-explorer/view/index.d.ts +2 -1
  8. package/datapoint-explorer/view/index.d.ts.map +1 -1
  9. package/datapoint-library/details/index.d.ts.map +1 -1
  10. package/datapoint-selector/index.d.ts +6 -3
  11. package/datapoint-selector/index.d.ts.map +1 -1
  12. package/device-grid/index.d.ts.map +1 -1
  13. package/echart/index.d.ts +1 -0
  14. package/echart/index.d.ts.map +1 -1
  15. package/echart/models/index.d.ts +1 -0
  16. package/echart/models/index.d.ts.map +1 -1
  17. package/fesm2022/c8y-ngx-components-actility-device-registration.mjs +16 -16
  18. package/fesm2022/c8y-ngx-components-advanced-software-management.mjs +7 -7
  19. package/fesm2022/c8y-ngx-components-ai-agent-chat.mjs +9 -9
  20. package/fesm2022/c8y-ngx-components-ai-ai-chat.mjs +12 -12
  21. package/fesm2022/c8y-ngx-components-ai.mjs +11 -9
  22. package/fesm2022/c8y-ngx-components-ai.mjs.map +1 -1
  23. package/fesm2022/c8y-ngx-components-alarm-event-selector.mjs +34 -34
  24. package/fesm2022/c8y-ngx-components-alarms-cockpit.mjs +4 -4
  25. package/fesm2022/c8y-ngx-components-alarms.mjs +76 -76
  26. package/fesm2022/c8y-ngx-components-api.mjs +7 -7
  27. package/fesm2022/c8y-ngx-components-app-logs.mjs +10 -10
  28. package/fesm2022/c8y-ngx-components-asset-properties.mjs +39 -39
  29. package/fesm2022/{c8y-ngx-components-asset-property-grid.component-B1q7kXRu.mjs → c8y-ngx-components-asset-property-grid.component-CDjsn5j9.mjs} +13 -13
  30. package/fesm2022/{c8y-ngx-components-asset-property-grid.component-B1q7kXRu.mjs.map → c8y-ngx-components-asset-property-grid.component-CDjsn5j9.mjs.map} +1 -1
  31. package/fesm2022/c8y-ngx-components-assets-navigator.mjs +32 -32
  32. package/fesm2022/c8y-ngx-components-auth-configuration.mjs +244 -170
  33. package/fesm2022/c8y-ngx-components-auth-configuration.mjs.map +1 -1
  34. package/fesm2022/c8y-ngx-components-binary-file-download.mjs +7 -7
  35. package/fesm2022/c8y-ngx-components-bookmarks.mjs +13 -13
  36. package/fesm2022/c8y-ngx-components-branding-base-branding.mjs +4 -4
  37. package/fesm2022/c8y-ngx-components-branding-dark-theme.mjs +7 -7
  38. package/fesm2022/c8y-ngx-components-branding-extra-css-branding-editor.mjs +7 -7
  39. package/fesm2022/c8y-ngx-components-branding-plain-branding-editor-lazy.mjs +3 -3
  40. package/fesm2022/c8y-ngx-components-branding-plain-branding-editor.mjs +7 -7
  41. package/fesm2022/c8y-ngx-components-branding-shared-data.mjs +15 -15
  42. package/fesm2022/c8y-ngx-components-branding-shared-lazy-add-branding-modal.mjs +6 -6
  43. package/fesm2022/c8y-ngx-components-branding-shared-lazy.mjs +36 -36
  44. package/fesm2022/c8y-ngx-components-branding-shared.mjs +13 -13
  45. package/fesm2022/c8y-ngx-components-child-devices.mjs +13 -13
  46. package/fesm2022/c8y-ngx-components-cockpit-config.mjs +40 -40
  47. package/fesm2022/{c8y-ngx-components-computed-asset-properties-alarm-count-config.component-Bl18pHcM.mjs → c8y-ngx-components-computed-asset-properties-alarm-count-config.component-SA0syLy7.mjs} +4 -4
  48. package/fesm2022/{c8y-ngx-components-computed-asset-properties-alarm-count-config.component-Bl18pHcM.mjs.map → c8y-ngx-components-computed-asset-properties-alarm-count-config.component-SA0syLy7.mjs.map} +1 -1
  49. package/fesm2022/{c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-C5QMFdX1.mjs → c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-BOmgJI14.mjs} +4 -4
  50. package/fesm2022/{c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-C5QMFdX1.mjs.map → c8y-ngx-components-computed-asset-properties-configuration-snapshot-config.component-BOmgJI14.mjs.map} +1 -1
  51. package/fesm2022/{c8y-ngx-components-computed-asset-properties-event-count-config.component-C-Lc5Ble.mjs → c8y-ngx-components-computed-asset-properties-event-count-config.component-CaTb9cph.mjs} +4 -4
  52. package/fesm2022/{c8y-ngx-components-computed-asset-properties-event-count-config.component-C-Lc5Ble.mjs.map → c8y-ngx-components-computed-asset-properties-event-count-config.component-CaTb9cph.mjs.map} +1 -1
  53. package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-BXfM7hTQ.mjs → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-DkrSvf9F.mjs} +4 -4
  54. package/fesm2022/{c8y-ngx-components-computed-asset-properties-last-measurement-config.component-BXfM7hTQ.mjs.map → c8y-ngx-components-computed-asset-properties-last-measurement-config.component-DkrSvf9F.mjs.map} +1 -1
  55. package/fesm2022/c8y-ngx-components-computed-asset-properties.mjs +6 -6
  56. package/fesm2022/c8y-ngx-components-connectivity.mjs +53 -53
  57. package/fesm2022/c8y-ngx-components-context-dashboard-asset-add.mjs +10 -10
  58. package/fesm2022/c8y-ngx-components-context-dashboard-asset-view.mjs +7 -7
  59. package/fesm2022/c8y-ngx-components-context-dashboard-cockpit-home-dashboard.mjs +11 -11
  60. package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-BuGMpNrA.mjs → c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-DM3hASUP.mjs} +4 -4
  61. package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-BuGMpNrA.mjs.map → c8y-ngx-components-context-dashboard-dashboard-appearance-settings.component-DM3hASUP.mjs.map} +1 -1
  62. package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-general-settings.component-DN-f35bA.mjs → c8y-ngx-components-context-dashboard-dashboard-general-settings.component-CC5346kW.mjs} +10 -10
  63. package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-general-settings.component-DN-f35bA.mjs.map → c8y-ngx-components-context-dashboard-dashboard-general-settings.component-CC5346kW.mjs.map} +1 -1
  64. package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-version-history.component-BlIVEV__.mjs → c8y-ngx-components-context-dashboard-dashboard-version-history.component-CHuc--XM.mjs} +4 -4
  65. package/fesm2022/{c8y-ngx-components-context-dashboard-dashboard-version-history.component-BlIVEV__.mjs.map → c8y-ngx-components-context-dashboard-dashboard-version-history.component-CHuc--XM.mjs.map} +1 -1
  66. package/fesm2022/c8y-ngx-components-context-dashboard-device-add.mjs +10 -10
  67. package/fesm2022/c8y-ngx-components-context-dashboard-device-view.mjs +7 -7
  68. package/fesm2022/c8y-ngx-components-context-dashboard-devicemanagement.mjs +3 -3
  69. package/fesm2022/c8y-ngx-components-context-dashboard-state.mjs +3 -3
  70. package/fesm2022/c8y-ngx-components-context-dashboard.mjs +113 -108
  71. package/fesm2022/c8y-ngx-components-context-dashboard.mjs.map +1 -1
  72. package/fesm2022/{c8y-ngx-components-dashboard-details-advanced-tab-dashboard-details-advanced-tab.component-m7YeEj9R.mjs → c8y-ngx-components-dashboard-details-advanced-tab-dashboard-details-advanced-tab.component-D0C7SH6L.mjs} +16 -16
  73. package/fesm2022/{c8y-ngx-components-dashboard-details-advanced-tab-dashboard-details-advanced-tab.component-m7YeEj9R.mjs.map → c8y-ngx-components-dashboard-details-advanced-tab-dashboard-details-advanced-tab.component-D0C7SH6L.mjs.map} +1 -1
  74. package/fesm2022/c8y-ngx-components-dashboard-details-advanced-tab.mjs +12 -12
  75. package/fesm2022/c8y-ngx-components-dashboard-manager-devicemanagement.mjs +6 -6
  76. package/fesm2022/c8y-ngx-components-dashboard-manager.mjs +22 -22
  77. package/fesm2022/c8y-ngx-components-data-broker.mjs +7 -7
  78. package/fesm2022/c8y-ngx-components-data-grid-columns-asset-type.mjs +3 -3
  79. package/fesm2022/c8y-ngx-components-data-grid-columns.mjs +3 -3
  80. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +31 -26
  81. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
  82. package/fesm2022/c8y-ngx-components-datapoint-explorer.mjs +13 -13
  83. package/fesm2022/c8y-ngx-components-datapoint-library-details.mjs +6 -19
  84. package/fesm2022/c8y-ngx-components-datapoint-library-details.mjs.map +1 -1
  85. package/fesm2022/c8y-ngx-components-datapoint-library-list.mjs +3 -3
  86. package/fesm2022/c8y-ngx-components-datapoint-library-services.mjs +3 -3
  87. package/fesm2022/c8y-ngx-components-datapoint-library.mjs +4 -4
  88. package/fesm2022/c8y-ngx-components-datapoint-selector.mjs +56 -57
  89. package/fesm2022/c8y-ngx-components-datapoint-selector.mjs.map +1 -1
  90. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +34 -34
  91. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
  92. package/fesm2022/c8y-ngx-components-default-subscriptions.mjs +16 -16
  93. package/fesm2022/c8y-ngx-components-device-grid.mjs +48 -44
  94. package/fesm2022/c8y-ngx-components-device-grid.mjs.map +1 -1
  95. package/fesm2022/c8y-ngx-components-device-list.mjs +22 -22
  96. package/fesm2022/c8y-ngx-components-device-map.mjs +12 -12
  97. package/fesm2022/c8y-ngx-components-device-profile.mjs +34 -34
  98. package/fesm2022/c8y-ngx-components-device-protocol-object-mappings.mjs +3 -3
  99. package/fesm2022/c8y-ngx-components-device-protocols.mjs +16 -16
  100. package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs +13 -13
  101. package/fesm2022/c8y-ngx-components-device-shell.mjs +31 -31
  102. package/fesm2022/c8y-ngx-components-diagnostics.mjs +13 -13
  103. package/fesm2022/c8y-ngx-components-echart-models.mjs.map +1 -1
  104. package/fesm2022/c8y-ngx-components-echart.mjs +120 -61
  105. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
  106. package/fesm2022/c8y-ngx-components-ecosystem-application-plugins.mjs +43 -43
  107. package/fesm2022/c8y-ngx-components-ecosystem-archived-confirm.mjs +7 -7
  108. package/fesm2022/c8y-ngx-components-ecosystem-license-confirm.mjs +10 -10
  109. package/fesm2022/c8y-ngx-components-ecosystem-plugin-setup-stepper.mjs +7 -7
  110. package/fesm2022/c8y-ngx-components-ecosystem-shared.mjs +46 -46
  111. package/fesm2022/c8y-ngx-components-ecosystem.mjs +82 -82
  112. package/fesm2022/c8y-ngx-components-editor.mjs +6 -6
  113. package/fesm2022/c8y-ngx-components-events-events-timeline.mjs +4 -4
  114. package/fesm2022/c8y-ngx-components-events-events-timeline.mjs.map +1 -1
  115. package/fesm2022/c8y-ngx-components-events.mjs +3 -3
  116. package/fesm2022/c8y-ngx-components-exports-list.mjs +6 -6
  117. package/fesm2022/c8y-ngx-components-file-preview.mjs +7 -7
  118. package/fesm2022/c8y-ngx-components-files-repository.mjs +19 -19
  119. package/fesm2022/c8y-ngx-components-global-context.mjs +134 -134
  120. package/fesm2022/c8y-ngx-components-global-context.mjs.map +1 -1
  121. package/fesm2022/c8y-ngx-components-icon-selector.mjs +21 -21
  122. package/fesm2022/c8y-ngx-components-icon-selector.mjs.map +1 -1
  123. package/fesm2022/c8y-ngx-components-interval-picker.mjs +3 -3
  124. package/fesm2022/c8y-ngx-components-location.mjs +28 -28
  125. package/fesm2022/c8y-ngx-components-loriot-device-registration.mjs +16 -16
  126. package/fesm2022/c8y-ngx-components-map.mjs +19 -19
  127. package/fesm2022/c8y-ngx-components-messaging-management.mjs +55 -55
  128. package/fesm2022/c8y-ngx-components-operations-bulk-operation-from-single.mjs +7 -7
  129. package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs +19 -19
  130. package/fesm2022/c8y-ngx-components-operations-bulk-operation-scheduler.mjs +7 -7
  131. package/fesm2022/c8y-ngx-components-operations-bulk-operation-stepper.mjs +13 -13
  132. package/fesm2022/c8y-ngx-components-operations-bulk-operations-list.mjs +13 -13
  133. package/fesm2022/c8y-ngx-components-operations-bulk-operations-service.mjs +7 -7
  134. package/fesm2022/c8y-ngx-components-operations-bulk-operations-stepper-container.mjs +7 -7
  135. package/fesm2022/c8y-ngx-components-operations-bulk-single-operations-list.mjs +3 -3
  136. package/fesm2022/c8y-ngx-components-operations-create-bulk-operation-details.mjs +7 -7
  137. package/fesm2022/c8y-ngx-components-operations-device-selector.mjs +7 -7
  138. package/fesm2022/c8y-ngx-components-operations-grid-columns.mjs +12 -12
  139. package/fesm2022/c8y-ngx-components-operations-operation-details.mjs +13 -13
  140. package/fesm2022/c8y-ngx-components-operations-operation-summary.mjs +7 -7
  141. package/fesm2022/c8y-ngx-components-operations-operations-list-item-details.mjs +10 -10
  142. package/fesm2022/c8y-ngx-components-operations-operations-list.mjs +12 -12
  143. package/fesm2022/c8y-ngx-components-operations-operations-timeline.mjs +10 -12
  144. package/fesm2022/c8y-ngx-components-operations-operations-timeline.mjs.map +1 -1
  145. package/fesm2022/c8y-ngx-components-operations-shared.mjs +10 -10
  146. package/fesm2022/c8y-ngx-components-operations-status-filter.mjs +7 -7
  147. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-configuration.mjs +7 -7
  148. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs +13 -13
  149. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-firmware.mjs +13 -13
  150. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs +13 -13
  151. package/fesm2022/c8y-ngx-components-operations-stepper-frames.mjs +13 -13
  152. package/fesm2022/c8y-ngx-components-operations.mjs +7 -7
  153. package/fesm2022/c8y-ngx-components-pending-mo-request.mjs +7 -7
  154. package/fesm2022/c8y-ngx-components-platform-configuration.mjs +10 -10
  155. package/fesm2022/c8y-ngx-components-protocol-lpwan.mjs +38 -38
  156. package/fesm2022/c8y-ngx-components-protocol-opcua.mjs +58 -58
  157. package/fesm2022/c8y-ngx-components-register-device.mjs +58 -58
  158. package/fesm2022/c8y-ngx-components-remote-access-configurations.mjs +9 -9
  159. package/fesm2022/c8y-ngx-components-remote-access-data.mjs +3 -3
  160. package/fesm2022/c8y-ngx-components-remote-access-passthrough.mjs +3 -3
  161. package/fesm2022/c8y-ngx-components-remote-access-shared.mjs +6 -6
  162. package/fesm2022/c8y-ngx-components-remote-access-ssh-remote-access-ssh-endpoint-modal.mjs +3 -3
  163. package/fesm2022/c8y-ngx-components-remote-access-ssh.mjs +3 -3
  164. package/fesm2022/c8y-ngx-components-remote-access-telnet.mjs +3 -3
  165. package/fesm2022/c8y-ngx-components-remote-access-terminal-viewer.mjs +3 -3
  166. package/fesm2022/c8y-ngx-components-remote-access-vnc-remote-access-vnc-endpoint-modal.mjs +3 -3
  167. package/fesm2022/c8y-ngx-components-remote-access-vnc-vnc-viewer.mjs +6 -6
  168. package/fesm2022/c8y-ngx-components-remote-access-vnc.mjs +3 -3
  169. package/fesm2022/c8y-ngx-components-replace-device-replace-device-wizard.mjs +6 -6
  170. package/fesm2022/c8y-ngx-components-replace-device.mjs +10 -10
  171. package/fesm2022/c8y-ngx-components-report-dashboard.mjs +16 -16
  172. package/fesm2022/c8y-ngx-components-reports.mjs +19 -19
  173. package/fesm2022/c8y-ngx-components-repository-configuration.mjs +48 -48
  174. package/fesm2022/c8y-ngx-components-repository-firmware.mjs +33 -33
  175. package/fesm2022/c8y-ngx-components-repository-shared.mjs +34 -34
  176. package/fesm2022/c8y-ngx-components-repository-software.mjs +42 -42
  177. package/fesm2022/c8y-ngx-components-repository.mjs +4 -4
  178. package/fesm2022/c8y-ngx-components-search.mjs +48 -45
  179. package/fesm2022/c8y-ngx-components-search.mjs.map +1 -1
  180. package/fesm2022/c8y-ngx-components-sensor-phone-sensor-phone-modal.mjs +6 -6
  181. package/fesm2022/c8y-ngx-components-sensor-phone.mjs +7 -7
  182. package/fesm2022/c8y-ngx-components-services-service-command-tab.mjs +3 -3
  183. package/fesm2022/c8y-ngx-components-services-shared.mjs +3 -3
  184. package/fesm2022/c8y-ngx-components-services.mjs +29 -29
  185. package/fesm2022/c8y-ngx-components-sigfox-device-registration.mjs +16 -16
  186. package/fesm2022/c8y-ngx-components-sms-gateway.mjs +7 -7
  187. package/fesm2022/c8y-ngx-components-static-assets-data.mjs +3 -3
  188. package/fesm2022/c8y-ngx-components-static-assets-modal.mjs +9 -9
  189. package/fesm2022/c8y-ngx-components-static-assets.mjs +6 -6
  190. package/fesm2022/c8y-ngx-components-sub-assets.mjs +76 -66
  191. package/fesm2022/c8y-ngx-components-sub-assets.mjs.map +1 -1
  192. package/fesm2022/c8y-ngx-components-tenants.mjs +40 -40
  193. package/fesm2022/c8y-ngx-components-time-context.mjs +14 -7
  194. package/fesm2022/c8y-ngx-components-time-context.mjs.map +1 -1
  195. package/fesm2022/c8y-ngx-components-tracking.mjs +15 -15
  196. package/fesm2022/c8y-ngx-components-tracking.mjs.map +1 -1
  197. package/fesm2022/c8y-ngx-components-translation-editor-data.mjs +3 -3
  198. package/fesm2022/c8y-ngx-components-translation-editor-lazy.mjs +12 -12
  199. package/fesm2022/c8y-ngx-components-translation-editor.mjs +6 -6
  200. package/fesm2022/c8y-ngx-components-trusted-certificates.mjs +33 -33
  201. package/fesm2022/c8y-ngx-components-upgrade-upgraded-services.mjs +4 -4
  202. package/fesm2022/c8y-ngx-components-upgrade.mjs +41 -41
  203. package/fesm2022/c8y-ngx-components-user-roles.mjs +10 -10
  204. package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-graph.mjs +3 -3
  205. package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget-ai-config.mjs +4 -4
  206. package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget-ai-config.mjs.map +1 -1
  207. package/fesm2022/c8y-ngx-components-widgets-definitions-html-widget.mjs +6 -6
  208. package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +19 -19
  209. package/fesm2022/c8y-ngx-components-widgets-implementations-asset-notes.mjs +3 -3
  210. package/fesm2022/c8y-ngx-components-widgets-implementations-cockpit-legacy-welcome.mjs +3 -3
  211. package/fesm2022/c8y-ngx-components-widgets-implementations-cockpit-welcome.mjs +3 -3
  212. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs +7 -7
  213. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-graph.mjs.map +1 -1
  214. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +27 -27
  215. package/fesm2022/c8y-ngx-components-widgets-implementations-device-control-message.mjs +3 -3
  216. package/fesm2022/c8y-ngx-components-widgets-implementations-device-management-welcome.mjs +7 -7
  217. package/fesm2022/c8y-ngx-components-widgets-implementations-help-and-service-widget.mjs +3 -3
  218. package/fesm2022/c8y-ngx-components-widgets-implementations-html-widget.mjs +24 -24
  219. package/fesm2022/c8y-ngx-components-widgets-implementations-image.mjs +9 -9
  220. package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs +24 -20
  221. package/fesm2022/c8y-ngx-components-widgets-implementations-info-gauge.mjs.map +1 -1
  222. package/fesm2022/c8y-ngx-components-widgets-implementations-kpi.mjs +6 -6
  223. package/fesm2022/c8y-ngx-components-widgets-implementations-linear-gauge.mjs +6 -6
  224. package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs +9 -9
  225. package/fesm2022/c8y-ngx-components-widgets-implementations-markdown.mjs +9 -9
  226. package/fesm2022/c8y-ngx-components-widgets-implementations-quick-links.mjs +18 -18
  227. package/fesm2022/c8y-ngx-components-widgets-implementations-three-d-rotation.mjs +9 -9
  228. package/fesm2022/c8y-ngx-components.mjs +9450 -9420
  229. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  230. package/global-context/index.d.ts.map +1 -1
  231. package/index.d.ts +3283 -3271
  232. package/index.d.ts.map +1 -1
  233. package/locales/de.po +124 -133
  234. package/locales/es.po +48 -40
  235. package/locales/fr.po +41 -33
  236. package/locales/ja_JP.po +35 -28
  237. package/locales/ko.po +46 -38
  238. package/locales/locales.pot +17 -8
  239. package/locales/nl.po +44 -36
  240. package/locales/pl.po +62 -54
  241. package/locales/pt_BR.po +45 -37
  242. package/locales/zh_CN.po +42 -35
  243. package/locales/zh_TW.po +55 -46
  244. package/operations/operations-timeline/index.d.ts.map +1 -1
  245. package/package.json +1 -1
  246. package/search/index.d.ts +5 -5
  247. package/search/index.d.ts.map +1 -1
  248. package/sub-assets/index.d.ts +3 -3
  249. package/sub-assets/index.d.ts.map +1 -1
  250. package/time-context/index.d.ts +3 -2
  251. package/time-context/index.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"c8y-ngx-components-datapoints-export-selector.mjs","sources":["../../datapoints-export-selector/datapoints-export-selector.model.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/utils.service.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-preview/datapoints-export-selector-preview.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-preview/datapoints-export-selector-preview.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-data-scope/datapoints-exports-selector-data-scope.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-data-scope/datapoints-exports-selector-data-scope.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-file-types/datapoints-exports-selector-file-types.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-file-types/datapoints-exports-selector-file-types.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-time-range/datapoints-exports-selector-time-range.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-time-range/datapoints-exports-selector-time-range.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/generators/csv-generator.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/generators/excel-generator.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-processing.service.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-modal.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-modal.component.html","../../datapoints-export-selector/datapoints-export-selector.component.ts","../../datapoints-export-selector/datapoints-export-selector.component.html","../../datapoints-export-selector/c8y-ngx-components-datapoints-export-selector.ts"],"sourcesContent":["import { gettext } from '@c8y/ngx-components/gettext';\nimport { AggregationOption } from '@c8y/ngx-components';\nimport { Measurement } from './datapoints-export-selector-modal/datapoints-export-selector-file-exporter/utils.service';\nimport { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons';\nexport const HAS_ERROR = 'has-error';\nexport const MEASUREMENTS_PREVIEW_ITEMS_LIMIT = 5;\nexport const SERIES_DATA_MERGED_FILE_NAME = 'seriesDataMergedFileName';\n\n/**\n * Represents counts of datapoints data categorized by their availability and delivery method.\n */\nexport interface DatapointCounts {\n /**\n * The number of datapoints whose data can be directly downloaded\n * through a web browser.\n */\n browserDownloadableCount: number;\n /**\n * The number of datapoints whose data will be sent via email because its record count exceeded 50_000.\n */\n emailDeliverableCount: number;\n /**\n * The number of datapoints whose data cannot be retrieved at all,\n * neither through direct download nor via email because its record count exceeded 1_000_000 API limit.\n */\n nonRetrievableCount: number;\n}\n\n/**\n * Represents a datapoints which number of records exceed a threshold where data will be precessed by a backend.\n */\nexport interface DatapointsExceedingLimit {\n datapointDetail: DatapointDetails;\n totalElements: number;\n}\n\nexport interface DateFetchConfig {\n date: string;\n shouldFetchData: boolean;\n}\n\nexport interface IDataTransformer {\n transformToMergedFormat(data: ExportData[]): TimeSeriesColumnData;\n}\n\nexport interface FileGenerator {\n generateMerged?: (exportData: ExportData[], mergedExportDetails: MergedExportDetails) => BlobPart;\n getFileExtension(): string;\n getMimeType(): string;\n getLabel(): string;\n getIcon(): string;\n getType(): string;\n getTitle(): string;\n getZipName(): string;\n getAcceptType(): string;\n}\n\nexport interface FileTypeMetadata {\n extension: string;\n icon: SupportedIconsSuggestions;\n label: string;\n title: string;\n type: string;\n zipName: string;\n}\n\n/**\n * Represents the data structure, which is used to be transformed into a file (series) or used for a preview (series and measurements).\n */\nexport interface ExportData {\n time?: string | null;\n source: string | number;\n device_name: string;\n fragment_series: string;\n /**\n * Represents the value of a measurement for /measurement data API.\n */\n value?: number | null;\n /**\n * Represents the min value of a measurement for /series data API.\n */\n value_min?: number | null;\n /**\n * Represents the value of a measurement for /series data API.\n * Measurement API data does not contain max value.\n */\n value_max?: number | null;\n unit?: string | null;\n}\n\nexport interface DatapointDetails {\n deviceName?: string;\n source: string | number;\n valueFragmentSeries: string;\n valueFragmentType: string;\n}\n\n/**\n * Represents the data structure, which is used to be\n * transformed into an ExportData.\n */\nexport interface DataToExport extends DatapointDetails {\n unit: string | undefined;\n timeValueMap: { [timestamp: string]: Measurement } | undefined;\n}\n/**\n * Represents the data to be exported along with the backend-created file.\n * Only measurements API generates a file on the backend.\n */\nexport interface DataToExportWithBackendCreatedFile {\n source: string | number;\n valueFragmentSeries: string;\n valueFragmentType: string;\n fetchedMeasurementsBlobFile: Blob;\n}\n/**\n * Base configuration for the export process.\n */\nexport interface ExportConfig {\n aggregation?: AggregationOption;\n datapointDetails: DatapointDetails[];\n dateFrom: string;\n dateTo: string;\n}\n/**\n * Represents the configuration on the basis of which the zip file is created.\n */\nexport interface FileExportConfig {\n fileType: string;\n zipName: string;\n}\n/**\n * Represents a required config properties used in a process of generating a measurements based export file.\n */\nexport interface MeasurementFileConfig {\n exportConfig: ExportConfig;\n acceptFileType: string;\n}\n/**\n * Represents a required config properties along with transformed data structures,\n * used in a process of generating a series based export file.\n */\nexport interface SeriesExportParams {\n flattenedAndSortedExportData: ExportData[];\n fileType: string;\n mergedExportDetails: MergedExportDetails;\n}\n\nexport interface TimeSeriesColumnData {\n timeSeries: Map<TimeStamp, ColumnValueMap>;\n uniqueColumnIdentifiers: string[];\n}\n/**\n * Represents a mapping of datapoints series values.\n * The key of the map is a source, and the value is the value data from requested series.\n */\nexport type DatapointsValuesDataMap = Map<SourceId | number, string[]>;\n\nexport type SourceId = string | number;\n\nexport type FileCompressionTypes = 'STORE' | 'DEFLATE';\n\nexport type TimeSeriesData = {\n [timestamp: string]: Measurement;\n};\n\nexport interface FileTypeConfig {\n extension: string;\n mimeType: string;\n acceptType: string;\n}\n\n/**\n * Represents the details unique for a merged file.\n */\nexport type MergedExportDetails = {\n aggregation: AggregationOption;\n dateFrom: string;\n dateTo: string;\n};\n\nexport type ExportedFile = {\n fileName: string;\n fileData: Blob;\n};\n\nexport type TimeStamp = string;\n\nexport type ReadingValue = number;\n/**\n * Represents the min and max values for a specific timestamp.\n * Both min and max values are available only when using series API.\n */\nexport type MinMaxValues = {\n min: number;\n max: number;\n};\n\n/**\n * Represents a merged export column header,\n * e.g. 'Temperature - 5 -> c8y_Temperature.T [ºC] (max)'\n */\ntype ColumnHeader = string;\n/**\n * Represents a mapping of column headers and their corresponding values.\n * e.g. 'Temperature - 5 -> c8y_Temperature.T [ºC] (max)': 25\n */\nexport type ColumnValueMap = {\n [key: ColumnHeader]: ReadingValue;\n};\n\nexport const EXPORT_MODE_LABELS = {\n FULL: gettext('Full`export type`') as 'Full',\n COMPACT: gettext('Compact`export type`') as 'Compact'\n} as const;\n\n/**\n * Each export type is based on a different API:\n * - COMPACT - series\n * - FULL - measurements\n * All differences between export modes:\n * Compact:\n * Processes up to 5,000 records per data point, or up to the data retention limit (API limit)\n * Creates a single merged file containing all the data\n * Provides minimum and maximum values (API feature)\n * Preview is not available\n * Supports optional data aggregation (API feature)\n * Full:\n * Processes up to 1,000,000 records per data point, or up to the data retention limit (API limit)\n * For exports exceeding 50,000 records, data will be sent via email\n * Creates a compressed ZIP file containing separate data files for each selected data point\n * Preview is available\n * Does not support data aggregation\n */\nexport const EXPORT_MODE_VALUES = {\n full: 'FULL',\n compact: 'COMPACT'\n} as const;\n\nexport const FILE_COMPRESSION_TYPES_VALUES = {\n store: 'STORE',\n deflate: 'DEFLATE'\n} as const;\n\nexport const PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR = {\n EVENTS: {\n EXPORT_SELECTOR: 'exportSelector'\n },\n COMPONENTS: {\n DATAPOINTS_EXPORT_SELECTOR: 'datapoints-export-selector',\n DATAPOINTS_EXPORT_SELECTOR_FILE_EXPORTER: 'datapoints-export-selector-file-exporter'\n },\n ACTIONS: {\n OPEN_MODAL: 'openModal',\n DOWNLOAD_STARTED: 'downloadStarted'\n },\n EXPORT_CONFIG: {\n FULL_EXPORT_TYPE: 'fullExportType',\n COMPACT_EXPORT_TYPE: 'compactExportType'\n }\n} as const;\n","import { Injectable } from '@angular/core';\n\nexport type Measurement = number | { min: number; max: number };\n\nexport interface SeriesInfo {\n unit: string | null | undefined;\n name: string;\n type: string | null | undefined;\n}\n\nexport interface SourceData {\n series: SeriesInfo[];\n values: {\n [timestamp: string]: (Measurement | null)[] | undefined;\n };\n truncated: boolean;\n}\n\nexport interface SourceItem {\n source: string | number;\n data: SourceData;\n}\n\nexport interface TransformedSeries {\n values: { [timestamp: string]: Measurement } | null;\n seriesDetails: SeriesInfo;\n}\n\nexport interface TransformedSource {\n [seriesType: string]: TransformedSeries;\n}\n\nexport interface TransformedData {\n [sourceId: string]: TransformedSource;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class UtilsService {\n transformDataStructure(data: SourceItem[]): TransformedData {\n const result: TransformedData = {};\n\n data.forEach(sourceItem => {\n const { source: sourceId, data: sourceData } = sourceItem;\n result[sourceId] = {};\n\n sourceData.series.forEach((seriesInfo, index) => {\n const { type, name, unit } = seriesInfo;\n /**\n * Unique key to distinguish between different series from same source,\n * e.g.: c8y_Acceleration.accelerationX, c8y_Acceleration.accelerationY, c8y_Acceleration.accelerationZ\n */\n const seriesKey = `${type}.${name}`;\n\n result[sourceId][seriesKey] = {\n values: {},\n seriesDetails: { name, unit, type }\n };\n\n let hasValues = false;\n Object.entries(sourceData.values).forEach(([timestamp, measurements]) => {\n if (!measurements) {\n return;\n }\n const measurement = measurements[index];\n\n if (measurement !== null && measurement !== undefined) {\n result[sourceId][seriesKey].values[timestamp] = measurement;\n hasValues = true;\n }\n });\n\n if (!hasValues) {\n result[sourceId][seriesKey].values = null;\n }\n });\n });\n\n return result;\n }\n\n /**\n * Formats a date range into a specific string format, handling UTC dates correctly.\n *\n * @param fromDate - The start date in ISO format (e.g., \"2023-12-04T12:40:00.000Z\")\n * @param toDate - The end date in ISO format (e.g., \"2023-12-06T23:50:00.000Z\")\n * @returns A string representing the date range in the format \"ddmmmyyhhmm-ddmmmyyhhmm\"\n * where d=day, m=month, y=year, h=hour, m=minute\n *\n * Example\n * ```typescript\n * const fromDate = \"2023-12-04T12:40:00.000Z\";\n * const toDate = \"2023-12-06T23:50:00.000Z\";\n * const formattedRange = getFormattedDateRange(fromDate, toDate);\n * console.log(formattedRange); // Output: \"04dec231240-06dec232350\"\n * ```\n */\n getFormattedDateRange(fromDate: string, toDate: string): string {\n const formatDate = (dateString: string): string => {\n const date = new Date(dateString);\n if (isNaN(date.getTime())) {\n throw new Error(`Invalid date string: ${dateString}`);\n }\n const day = date.getUTCDate().toString().padStart(2, '0');\n const month = date.toLocaleString('en', { month: 'short', timeZone: 'UTC' }).toLowerCase();\n const hours = date.getUTCHours().toString().padStart(2, '0');\n const minutes = date.getUTCMinutes().toString().padStart(2, '0');\n const seconds = date.getUTCSeconds().toString().padStart(2, '0');\n return `${day}${month}${hours}${minutes}${seconds}`;\n };\n\n return `${formatDate(fromDate)}-${formatDate(toDate)}`;\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n aggregationType,\n IFetchResponse,\n IMeasurement,\n IMeasurementFilter,\n IResult,\n IResultList,\n ISeries,\n ISeriesFilter,\n MeasurementService\n} from '@c8y/client';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { AGGREGATION_VALUES, AlertService } from '@c8y/ngx-components';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n DatapointDetails,\n DatapointsExceedingLimit,\n DatapointsValuesDataMap,\n DataToExport,\n DataToExportWithBackendCreatedFile,\n ExportConfig,\n MeasurementFileConfig,\n MEASUREMENTS_PREVIEW_ITEMS_LIMIT,\n TimeSeriesData\n} from '../../datapoints-export-selector.model';\nimport { SourceItem, UtilsService } from './utils.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DataFetchingService {\n constructor(\n private alertService: AlertService,\n private measurementService: MeasurementService,\n private translateService: TranslateService,\n private utilsService: UtilsService\n ) {}\n\n /**\n * Checks if any of measurements requests may exceeded the limit,\n * after which the export data is processed by the backend and the generated CSV/Excel file is sent by email.\n *\n * The threshold is set to 50_000 records in application's core properties (export.data.synchronous.limit).\n *\n * @param exportConfig - The export configuration.\n * @returns A promise that returns an array of objects representing datapoints files that will be sent by email.\n */\n async getDatapointsExceedingLimit(\n exportConfig: ExportConfig\n ): Promise<DatapointsExceedingLimit[]> {\n const backendProcessingLimit = 50_000;\n\n const promises: Promise<DatapointsExceedingLimit>[] = exportConfig.datapointDetails.map(\n async details => {\n try {\n const filter: IMeasurementFilter = {\n dateFrom: exportConfig.dateFrom,\n dateTo: exportConfig.dateTo,\n pageSize: 1,\n source: details.source,\n valueFragmentSeries: details.valueFragmentSeries,\n valueFragmentType: details.valueFragmentType,\n withTotalElements: true\n };\n\n const response = await this.measurementService.list(filter);\n\n if (response?.paging?.totalElements > backendProcessingLimit) {\n return {\n datapointDetail: {\n source: details.source,\n valueFragmentSeries: details.valueFragmentSeries,\n valueFragmentType: details.valueFragmentType\n },\n totalElements: response.paging.totalElements\n };\n } else {\n return null;\n }\n } catch (error) {\n this.alertService.addServerFailure(error);\n return null;\n }\n }\n );\n\n const results: DatapointsExceedingLimit[] = await Promise.all(promises);\n\n const datapointsExceedingLimit = results.filter(result => result !== null);\n\n return datapointsExceedingLimit;\n }\n\n /**\n * Retrieves the message to be displayed when the limit of datapoints is exceeded during file export.\n *\n * @param hasNoExportableData - Indicates if there is no exportable data because the date range of all selected datapoints exceeds 1,000,000 records.\n * @param emailDeliverableCount - The number of datapoint exports that exceed the limit, will be proceeded by the backend and sent by email.\n * @param browserDownloadableCount - The number of datapoint exports that can be downloaded directly.\n * @param skippedDatapointCount - The number of datapoint exports skipped due to exceeding the measurements API limit of 1,000,000 records.\n * @param totalDatapointsSelectedForExportCount - Total number of datapoint selected for exports.\n * @returns The message that can be injected.\n */\n getLimitExceededMessage(\n hasNoExportableData: boolean,\n emailDeliverableCount?: number,\n browserDownloadableCount?: number,\n nonRetrievableCount?: number,\n totalDatapointsSelectedForExportCount?: number\n ): string {\n if (hasNoExportableData) {\n const message = this.translateService.instant(\n gettext(\n `The data for selected datapoint(s) exceed 1,000,000 records, which is the limit for backend processing. To export this data, please reduce the date range.`\n )\n );\n return message;\n }\n\n const message = this.translateService.instant(\n gettext(\n `After clicking \"Download\":<br>\n <ul>\n <li><strong>{{$browserDownloadableCount}}</strong> datapoint(s) exports will be downloaded directly within one file: <em>exported_[csv/excel].zip</em></li>\n <li><strong>{{$emailDeliverableCount}}</strong> datapoint(s) exports require further processing. The files will be sent to you via separate emails once completed, which may take some time.</li>\n <li><strong>{{$nonRetrievableCount}}</strong> datapoint(s) exports exceeded 1,000,000 records, which is the limit for backend processing. To export these data, please reduce the date range. Otherwise, the data will neither be downloaded nor sent via email.</li>\n </ul>\n <p>The total number of data points that can be exported is: <strong>{{$totalExportableDatapointsCount}} out of {{$totalDatapointsSelectedForExportCount}}</strong>.</p>\n <p><strong>Note:</strong> The file name convention of files within zip file is: <code>[source]_[fragment_series].[csv/xls]</code></p>`\n ),\n {\n $browserDownloadableCount: browserDownloadableCount,\n $emailDeliverableCount: emailDeliverableCount,\n $nonRetrievableCount: nonRetrievableCount,\n $totalDatapointsSelectedForExportCount: totalDatapointsSelectedForExportCount,\n $totalExportableDatapointsCount: browserDownloadableCount + emailDeliverableCount\n }\n );\n\n const trimmedMessage = this.removeZeroCountListItems(message, [\n browserDownloadableCount,\n emailDeliverableCount,\n nonRetrievableCount\n ]);\n\n return trimmedMessage;\n }\n\n /**\n * Trims the given HTML message by removing list items that correspond to zero counts.\n *\n * @param message - The HTML string containing the message with list items.\n * @param counts - An array of number values corresponding to each list item.\n * @param countToTrim - A count that will be trimmed with corresponding list item.\n * @returns A trimmed HTML string with list items removed where the corresponding count is zero.\n *\n * Example:\n * ```typescript\n * const message = '<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul>';\n * const counts = [1, 0, 2];\n * const trimmedMessage = this.removeZeroCountListItems(message, counts);\n * // Result: '<ul><li>Item 1</li><li>Item 3</li></ul>'\n * ```\n */\n removeZeroCountListItems(message: string, counts: number[], countToTrim = 0): string {\n const parser = new DOMParser();\n const doc = parser.parseFromString(message, 'text/html');\n const listItems = doc.querySelectorAll('ul li');\n\n listItems.forEach((item, index) => {\n if (counts[index] === countToTrim) {\n item.remove();\n }\n });\n\n return doc.body.innerHTML;\n }\n\n /**\n * Displays an information alert about sending data via email.\n *\n * Only measurements API can send files via email.\n *\n * @param fileType - The type of file to be sent.\n * @param datapointsExceedingLimit - The array of datapoints exceeding the limit.\n */\n showSendViaEmailInfoAlert(\n fileType: string,\n datapointsExceedingLimit: DatapointsExceedingLimit[]\n ): void {\n const messageTemplate = this.translateService.instant(\n gettext(`You will get {{$fileTypeText}} file(s) for {{$count}} series via email.`),\n { $count: datapointsExceedingLimit.length, $fileTypeText: fileType }\n );\n const formattedList = datapointsExceedingLimit\n .map(\n datapoint =>\n `• ${datapoint.datapointDetail.source}_${datapoint.datapointDetail.valueFragmentType}_${datapoint.datapointDetail.valueFragmentSeries}`\n )\n .join('\\n');\n\n this.alertService.info(messageTemplate, formattedList);\n }\n\n async fetchMeasurementDataFilesAndPairWithSourceDetails(\n acceptFileType: string,\n exportConfig: ExportConfig\n ): Promise<DataToExportWithBackendCreatedFile[]> {\n const measurementFileConfig: MeasurementFileConfig = {\n exportConfig,\n acceptFileType\n };\n const filePromises = exportConfig.datapointDetails.map(details =>\n this.fetchAndProcessMeasurementFile(details, measurementFileConfig)\n );\n return Promise.all(filePromises);\n }\n\n async fetchAndProcessMeasurementFile(\n details: DatapointDetails,\n measurementFileConfig: MeasurementFileConfig,\n roundSeconds = false\n ): Promise<DataToExportWithBackendCreatedFile | undefined> {\n const filter: IMeasurementFilter = this.prepareMeasurementsFilter(\n details,\n measurementFileConfig.exportConfig,\n roundSeconds\n );\n const header = { accept: measurementFileConfig.acceptFileType };\n\n try {\n const measurementFileResponse: IFetchResponse =\n await this.measurementService.getMeasurementsFile(filter, header);\n\n // If the status is 200, then the file is in the response.\n // If the status is 202, then the file is being processed by the backend and will be sent by email.\n if (measurementFileResponse.status === 200) {\n return this.mergeMeasurementsWithItsSourceDetails(details, measurementFileResponse);\n }\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n }\n\n async mergeMeasurementsWithItsSourceDetails(\n details: DatapointDetails,\n measurementFile: IFetchResponse\n ): Promise<DataToExportWithBackendCreatedFile> {\n return {\n source: details.source,\n valueFragmentSeries: details.valueFragmentSeries,\n valueFragmentType: details.valueFragmentType,\n fetchedMeasurementsBlobFile: await measurementFile.blob()\n };\n }\n\n async fetchAndPrepareDataToExport(\n exportConfig: ExportConfig,\n isMeasurement: boolean\n ): Promise<DataToExport[]> {\n return isMeasurement\n ? await this.fetchAndPrepareMeasurementDataToExportForPreview(exportConfig)\n : await this.fetchAndPrepareSeriesDataToExport(exportConfig);\n }\n\n prepareMeasurementsFilter(\n details: DatapointDetails,\n exportConfig: ExportConfig,\n roundSeconds: boolean,\n pageSize?: number\n ): IMeasurementFilter {\n const filter: IMeasurementFilter = {\n dateFrom: this.adjustDate(exportConfig.dateFrom, 0, roundSeconds),\n dateTo: this.adjustDate(exportConfig.dateTo, 0, roundSeconds),\n source: details.source,\n valueFragmentSeries: details.valueFragmentSeries,\n valueFragmentType: details.valueFragmentType\n };\n\n if (pageSize) {\n filter.pageSize = pageSize;\n }\n\n return filter;\n }\n\n processMeasurementDataForPreview(details: DatapointDetails, data: IMeasurement[]): DataToExport {\n const unit = data[0][details.valueFragmentType][details.valueFragmentSeries]?.unit || '';\n\n const values: { [timestamp: string]: number } = {};\n data.forEach(measurement => {\n values[measurement.time] =\n measurement[details.valueFragmentType][details.valueFragmentSeries].value;\n });\n\n return { ...details, unit, timeValueMap: values };\n }\n\n /**\n * Returns a map of active data points device IDs with their corresponding series.\n *\n * Example output:\n * ```typescript\n * new Map([\n * ['844657202', ['c8y_Temperature.T']],\n * ['32666427', ['c8y_Battery.Battery']]\n * ]);\n * ```\n * @param datapointDetails - An array of data points details.\n * @returns A map where the key is the data point ID and the value is an array of data point series.\n */\n groupSeriesByDeviceId(datapointDetails: DatapointDetails[]): DatapointsValuesDataMap {\n return datapointDetails.reduce(\n (\n map: DatapointsValuesDataMap,\n { valueFragmentType, valueFragmentSeries, source }: DatapointDetails\n ) => {\n const value = `${valueFragmentType}.${valueFragmentSeries}`;\n const existingValue = map.get(source) ?? [];\n map.set(source, [...existingValue, value]);\n return map;\n },\n new Map<string, string[]>()\n );\n }\n\n /**\n * Processes the fetched series data and prepares it for export.\n *\n * @param datapointDetails - An array of data point details.\n * @param fetchedDataMap - A map of fetched series data grouped by source.\n * @returns An array of DataToExport objects.\n */\n processSeriesData(\n datapointDetails: DatapointDetails[],\n fetchedDataMap: SourceItem[]\n ): DataToExport[] {\n const valuesGroupedBySource = this.utilsService.transformDataStructure(fetchedDataMap);\n\n return datapointDetails.map((details: DatapointDetails) => {\n let unit: string | undefined;\n let data: TimeSeriesData;\n\n /**\n * Unique key to distinguish between different series from same source,\n * e.g.: c8y_Acceleration.accelerationX, c8y_Acceleration.accelerationY, c8y_Acceleration.accelerationZ\n */\n const seriesKey = `${details.valueFragmentType}.${details.valueFragmentSeries}`;\n\n if (valuesGroupedBySource[details.source][seriesKey]) {\n unit = valuesGroupedBySource[details.source][seriesKey].seriesDetails.unit;\n data = valuesGroupedBySource[details.source][seriesKey].values;\n }\n\n return {\n ...details,\n unit,\n timeValueMap: data\n };\n });\n }\n\n async getSourcesWithPermissionsToRead(datapointDetails: DatapointDetails[]): Promise<string[]> {\n const dateFrom = new Date();\n const dateTo = new Date(dateFrom);\n\n const fetchedDataPromises = datapointDetails.map(async datapoint => {\n const rawFilter: ISeriesFilter = {\n dateFrom,\n dateTo,\n source: datapoint.source\n };\n\n try {\n const { res }: IResult<ISeries> = await this.fetchSeriesData(rawFilter);\n if (res?.status === 200) {\n return datapoint.source;\n }\n return null;\n } catch (error) {\n // If an error occurs during fetch, return null to prevent promise rejection\n return null;\n }\n });\n\n const fetchedSources = await Promise.all(fetchedDataPromises);\n return fetchedSources.filter((source): source is string => source !== null);\n }\n\n /**\n * Adjusts the given date by adding the specified number of minutes and setting seconds to 0.\n *\n * @param date - The date to be adjusted in string format.\n * @param minutes - The number of minutes to add to the date.\n * @param roundSeconds - Whether to round the seconds or not.\n * If true, the seconds will be rounded to 0.\n * If false, the seconds will be displayed as they are.\n * @returns The adjusted date in ISO string format.\n */\n adjustDate(date: string | Date, minutes: number, roundSeconds = true): string {\n const dateTime = new Date(date);\n if (isNaN(dateTime.getTime())) {\n throw new Error('Invalid date');\n }\n\n dateTime.setUTCMinutes(dateTime.getUTCMinutes() + minutes);\n if (roundSeconds) {\n dateTime.setUTCSeconds(0, 0);\n }\n\n return dateTime.toISOString();\n }\n\n /**\n * Asynchronously loads series data based on the provided parameters.\n *\n * This method constructs a filter for retrieving series data within a specified date range,\n * from a specific source, and optionally applying an aggregation type.\n *\n * @param rawFilter - The parameters for loading series data, including date range, source, series names, and aggregation type.\n * @param roundSeconds - Indicates whether to round the seconds in the date range to the nearest whole number.\n * @returns A promise that resolves to series data wrapped in result object.\n */\n async fetchSeriesData(\n rawFilter: ISeriesFilter,\n roundSeconds = false\n ): Promise<IResult<ISeries>> | undefined {\n let seriesData: IResult<ISeries> | undefined;\n\n const filter: ISeriesFilter = this.prepareSeriesFilter(\n {\n dateFrom: rawFilter.dateFrom,\n dateTo: rawFilter.dateTo,\n source: rawFilter.source,\n series: rawFilter.series,\n aggregationType: rawFilter.aggregationType\n },\n roundSeconds\n );\n\n try {\n seriesData = await this.measurementService.listSeries(filter);\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n\n if (seriesData?.res?.status === 422) {\n throw {\n status: seriesData.res.status,\n message: seriesData.data['message'],\n data: seriesData.data\n };\n }\n\n return seriesData;\n }\n\n /**\n * Fetches and prepares measurement data for preview.\n *\n * Empty DataToExport object can be returned, because unlike series data,\n * measurement data is not further processed besides showing only in the preview.\n * CSV/Excel files are generated by the backend for measurements.\n *\n * @param exportConfig - The export configuration.\n * @param roundSeconds - Indicates whether to round the seconds in the date range to the nearest whole number.\n * @returns A promise that resolves to an array of DataToExport objects or null when no data is fetched.\n */\n private async fetchAndPrepareMeasurementDataToExportForPreview(\n exportConfig: ExportConfig,\n roundSeconds = false\n ): Promise<DataToExport[]> | null {\n const dataToExportPromises: Promise<DataToExport>[] = exportConfig.datapointDetails.map(\n async details => {\n const fetchedMeasurementData: IResultList<IMeasurement> =\n await this.fetchMeasurementDataForPreview(details, exportConfig, roundSeconds);\n\n if (fetchedMeasurementData?.data?.length) {\n return this.processMeasurementDataForPreview(details, fetchedMeasurementData.data);\n }\n return null;\n }\n );\n\n return await Promise.all(dataToExportPromises);\n }\n\n private async fetchMeasurementDataForPreview(\n details: DatapointDetails,\n exportConfig: ExportConfig,\n roundSeconds: boolean\n ): Promise<IResultList<IMeasurement>> | undefined {\n let measurements: IResultList<IMeasurement> | undefined;\n\n const filter: IMeasurementFilter = this.prepareMeasurementsFilter(\n details,\n exportConfig,\n roundSeconds,\n MEASUREMENTS_PREVIEW_ITEMS_LIMIT\n );\n\n try {\n measurements = await this.measurementService.list(filter);\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n\n return measurements;\n }\n\n private async fetchAndPrepareSeriesDataToExport(exportConfig: ExportConfig) {\n const datapointsValuesDataMap: DatapointsValuesDataMap = this.groupSeriesByDeviceId(\n exportConfig.datapointDetails\n );\n\n const fetchedDataPromises = Array.from(datapointsValuesDataMap).map(\n async ([source, series]) => {\n const { dateFrom, dateTo, aggregation } = exportConfig;\n\n const rawFilter: ISeriesFilter = {\n dateFrom,\n dateTo,\n source,\n series,\n aggregationType: aggregation as aggregationType\n };\n\n const { data }: IResult<ISeries> = await this.fetchSeriesData(rawFilter);\n\n return { source, data };\n }\n );\n\n const fetchedDataGroupedBySource: SourceItem[] = await Promise.all(fetchedDataPromises);\n\n return this.processSeriesData(exportConfig.datapointDetails, fetchedDataGroupedBySource);\n }\n\n private prepareSeriesFilter(filters: ISeriesFilter, roundSeconds: boolean): ISeriesFilter {\n const { dateFrom, dateTo, source, series, aggregationType } = filters;\n const from = this.adjustDate(dateFrom, 0, roundSeconds);\n const to = this.adjustDate(dateTo, 0, roundSeconds);\n\n const filter: ISeriesFilter = {\n dateFrom: from,\n dateTo: to,\n source: source,\n revert: true\n };\n\n // The 'NONE' aggregation type is not handled by a backend, so even when is selected, it is not passed as a filter parameter.\n if (aggregationType && aggregationType !== (AGGREGATION_VALUES.none as aggregationType)) {\n filter.aggregationType = aggregationType;\n }\n\n if (series) {\n filter.series = series;\n }\n\n return filter;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { AlertService } from '@c8y/ngx-components';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n DataToExport,\n DataToExportWithBackendCreatedFile,\n ExportData,\n ExportedFile,\n MergedExportDetails,\n SeriesExportParams\n} from '../../datapoints-export-selector.model';\nimport { DataProcessingService } from './data-processing.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DatapointsExportSelectorFileExporterService {\n /**\n * Cached data is reused when both CSV and Excel files were selected for export, used for merged file.\n */\n private cachedFlatteredAndSortedSeriesExportData: ExportData[];\n /**\n * Cached data is reused when both CSV and Excel files were selected for export, used for raw files.\n */\n private cachedRawExportSeriesData: ExportData[][];\n\n constructor(\n private alertService: AlertService,\n private datapointsExportSelectorDataProcessingService: DataProcessingService,\n private translateService: TranslateService\n ) {}\n\n async getMeasurementExportedDataBlob(\n extension: string,\n dataToExport: DataToExportWithBackendCreatedFile[]\n ): Promise<Blob | null> {\n try {\n return await this.getMeasurementDataZipBlob(\n extension,\n dataToExport as DataToExportWithBackendCreatedFile[]\n );\n } catch (error) {\n this.showZipCreationErrorAlert();\n\n return null;\n }\n }\n\n async getSeriesExportedDataBlob(\n fileType: string,\n dataToExport: DataToExport[],\n mergedExportDetails: MergedExportDetails\n ): Promise<Blob | null> {\n try {\n return await this.getSeriesDataBlob(\n fileType,\n dataToExport as DataToExport[],\n mergedExportDetails\n );\n } catch (error) {\n this.showZipCreationErrorAlert();\n\n return null;\n }\n }\n\n cleanupCachedData(): void {\n this.cachedRawExportSeriesData = null;\n this.cachedFlatteredAndSortedSeriesExportData = null;\n }\n\n private showZipCreationErrorAlert(): void {\n const alertMessage = this.translateService.instant(gettext('Could not create zip file.'));\n this.alertService.danger(alertMessage);\n\n return null;\n }\n\n private getMeasurementDataZipBlob(\n extension: string,\n dataToExportWithBackendCreatedFile: DataToExportWithBackendCreatedFile[]\n ): Promise<Blob | null> {\n const files: ExportedFile[] = [];\n\n this.createRawMeasurementExportedFiles(dataToExportWithBackendCreatedFile, extension, files);\n\n return this.datapointsExportSelectorDataProcessingService.zipFiles(files);\n }\n\n private createRawMeasurementExportedFiles(\n dataToExportWithBackendCreatedFile: DataToExportWithBackendCreatedFile[],\n fileExtension: string,\n files: ExportedFile[]\n ): void {\n dataToExportWithBackendCreatedFile.forEach(data => {\n if (data) {\n const fragmentSeries = `${data.valueFragmentType}_${data.valueFragmentSeries}`;\n\n const fileName = this.datapointsExportSelectorDataProcessingService.createFileName(\n data.source,\n fragmentSeries,\n fileExtension\n );\n\n const fileData = data.fetchedMeasurementsBlobFile;\n\n const exportedFile: ExportedFile = { fileName, fileData };\n\n files.push(exportedFile);\n }\n });\n }\n\n /**\n * Converts data to a specified file type and returns the generated blob.\n *\n * Unlike measurements, data must be transformed to an exportable file structure before exporting.\n *\n * @param fileType - The type of file to which the data points should be exported. This can be 'csv' or 'excel'.\n * @param dataToExport - An array of processed measurement data combined with the respective properties of the datapoint.\n * @param mergedExportDetails - The details for the merged export, contains date range and aggregation.\n * @returns A promise that resolves to the generated ZIP blob or null if an error occurs.\n */\n private async getSeriesDataBlob(\n fileType: string,\n dataToExport: DataToExport[],\n mergedExportDetails: MergedExportDetails\n ): Promise<Blob | null> {\n this.transformSeriesDataToExportableFileStructure(dataToExport);\n\n const exportParams: SeriesExportParams = {\n flattenedAndSortedExportData: this.cachedFlatteredAndSortedSeriesExportData,\n fileType,\n mergedExportDetails: mergedExportDetails\n };\n\n return await this.datapointsExportSelectorDataProcessingService.exportSeriesData(exportParams);\n }\n\n private transformSeriesDataToExportableFileStructure(dataToExport: DataToExport[]): void {\n if (!this.cachedRawExportSeriesData) {\n this.cachedRawExportSeriesData =\n this.datapointsExportSelectorDataProcessingService.transformToExportFileStructure(\n dataToExport\n );\n this.cachedFlatteredAndSortedSeriesExportData = this.cachedRawExportSeriesData\n .flat()\n .sort((a, b) => {\n return new Date(a.time).getTime() - new Date(b.time).getTime();\n });\n }\n }\n}\n","import { A11yModule } from '@angular/cdk/a11y';\nimport { Component, Input } from '@angular/core';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport {\n ExportData,\n MEASUREMENTS_PREVIEW_ITEMS_LIMIT\n} from '../../../datapoints-export-selector.model';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-preview',\n templateUrl: './datapoints-export-selector-preview.component.html',\n standalone: true,\n imports: [A11yModule, CoreModule, PopoverModule]\n})\nexport class DataPointsExportSelectorPreviewComponent {\n @Input() hasFetchedDataAnyValuesToExport: boolean;\n @Input() isPreviewLoading: boolean;\n @Input() previewTableData: ExportData[];\n\n readonly MEASUREMENTS_PREVIEW_ITEMS_LIMIT = MEASUREMENTS_PREVIEW_ITEMS_LIMIT;\n}\n","<div class=\"p-t-16 p-l-16 p-r-16 m-b-0\">\n <div class=\"d-flex a-i-center\">\n <label\n class=\"m-b-0 d-flex a-i-center gap-4\"\n [title]=\"'Preview`of exported file`' | translate\"\n >\n {{ 'Preview`of exported file`' | translate }}\n <button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"popoverPreviewTemplate\"\n placement=\"right\"\n triggers=\"focus\"\n data-cy=\"preview--help\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n <ng-template #popoverPreviewTemplate>\n <span translate>\n <p>The preview shows the structure of the raw file from a single source.</p>\n <p>If no data is available, only the column headers are visible.</p>\n <p>\n The preview is limited to\n <b>{{ MEASUREMENTS_PREVIEW_ITEMS_LIMIT }}</b>\n records.\n </p>\n </span>\n </ng-template>\n </label>\n </div>\n <div\n class=\"table-responsive\"\n style=\"min-height: 275px\"\n >\n <table class=\"table\">\n <thead>\n <tr>\n <th>{{ 'Time' | translate }}</th>\n <th>{{ 'Source' | translate }}</th>\n <th>{{ 'Device name' | translate }}</th>\n <th>\n {{ 'Fragment and series' | translate }}\n </th>\n <th>{{ 'Value' | translate }}</th>\n <th>{{ 'Unit' | translate }}</th>\n </tr>\n </thead>\n <ng-container *ngIf=\"hasFetchedDataAnyValuesToExport || isPreviewLoading; else emptyState\">\n <ng-container *ngIf=\"!isPreviewLoading; else loading\">\n <tbody>\n <tr *ngFor=\"let row of previewTableData\">\n <td>{{ row.time }}</td>\n <td>{{ row.source }}</td>\n <td>{{ row.device_name }}</td>\n <td>\n {{ row.fragment_series }}\n </td>\n <td>{{ row.value }}</td>\n <td>{{ row.unit }}</td>\n </tr>\n </tbody>\n </ng-container>\n </ng-container>\n <ng-template #emptyState>\n <tbody>\n <tr>\n <td colspan=\"8\">\n <div class=\"d-col a-i-center\">\n <c8y-ui-empty-state\n [icon]=\"'search'\"\n [title]=\"'No data available.' | translate\"\n [horizontal]=\"true\"\n data-cy=\"datapoints-table-list--empty-state\"\n ></c8y-ui-empty-state>\n </div>\n </td>\n </tr>\n </tbody>\n </ng-template>\n <ng-template #loading>\n <tbody>\n <tr>\n <td colspan=\"8\">\n <c8y-loading></c8y-loading>\n </td>\n </tr>\n </tbody>\n </ng-template>\n </table>\n </div>\n</div>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CoreModule } from '@c8y/ngx-components';\nimport {\n AGGREGATION_LABELS,\n AGGREGATION_VALUES_ARR,\n AggregationOption,\n AggregationOptionStatus\n} from '@c8y/ngx-components/global-context';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { EXPORT_MODE_LABELS, EXPORT_MODE_VALUES } from '../../../datapoints-export-selector.model';\nimport { DatapointsExportSelectorFileExporterComponent } from '../datapoints-export-selector-file-exporter.component';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-data-scope',\n templateUrl: './datapoints-exports-selector-data-scope.component.html',\n standalone: true,\n imports: [CoreModule, FormsModule, PopoverModule]\n})\nexport class DataPointsExportSelectorDataScopeComponent {\n @Input() disabledAggregationOptions: AggregationOptionStatus;\n @Input() formGroup: ReturnType<DatapointsExportSelectorFileExporterComponent['createForm']>;\n @Output() onAggregationChange: EventEmitter<AggregationOption> =\n new EventEmitter<AggregationOption>();\n @Output() onExportTypeChange: EventEmitter<string> = new EventEmitter<string>();\n\n readonly AGGREGATION_LABELS = AGGREGATION_LABELS;\n readonly AGGREGATION_VALUES_ARR = AGGREGATION_VALUES_ARR;\n readonly EXPORT_MODE_LABELS = EXPORT_MODE_LABELS;\n readonly EXPORT_MODE_VALUES_ARR = [EXPORT_MODE_VALUES.full, EXPORT_MODE_VALUES.compact] as const;\n\n emitAggregationChange(aggregation: AggregationOption): void {\n this.onAggregationChange.emit(aggregation);\n }\n\n emitExportTypeChange(exportType: string): void {\n this.onExportTypeChange.emit(exportType);\n }\n}\n","<fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex a-i-center\">\n {{ 'Data scope' | translate }}\n <button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"popoverDataScopeTemplate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n data-cy=\"data-scope--help\"\n [adaptivePosition]=\"true\"\n ></button>\n <ng-template #popoverDataScopeTemplate>\n <p\n class=\"m-b-8\"\n translate\n >\n Choose export type from available options:\n </p>\n <p><strong translate>Compact</strong></p>\n <ul class=\"p-l-16\">\n <li translate>Up to 5,000 records per data point or data retention limit</li>\n <li translate>Single merged file for all data</li>\n <li translate>No preview available</li>\n <li translate>Optional data aggregation supported</li>\n </ul>\n <p><strong translate>Full</strong></p>\n <ul class=\"p-l-16\">\n <li translate>Up to 1,000,000 records per data point or data retention limit</li>\n <li translate>Email delivery if exceeds 50,000 records</li>\n <li translate>Separate files for each data point in ZIP format</li>\n <li translate>Preview available</li>\n <li translate>No data aggregation</li>\n </ul>\n </ng-template>\n </legend>\n <c8y-form-group class=\"m-b-8\">\n <label>\n {{ 'Export mode' | translate }}\n </label>\n <div\n class=\"c8y-select-wrapper\"\n [formGroup]=\"formGroup\"\n data-cy=\"data-scope--export-selector\"\n >\n <select\n class=\"form-control text-12\"\n [title]=\"'Export mode' | translate\"\n id=\"exportMode\"\n formControlName=\"exportMode\"\n (ngModelChange)=\"emitExportTypeChange($event)\"\n >\n <option\n *ngFor=\"let exportModeValue of EXPORT_MODE_VALUES_ARR\"\n [ngValue]=\"exportModeValue\"\n >\n {{ EXPORT_MODE_LABELS[exportModeValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n <c8y-form-group class=\"m-b-8\">\n <label>\n {{ 'Aggregation' | translate }}\n </label>\n <div\n class=\"c8y-select-wrapper\"\n [formGroup]=\"formGroup\"\n data-cy=\"data-scope--aggregation-selector\"\n >\n <select\n class=\"form-control text-12\"\n [title]=\"'Aggregation' | translate\"\n id=\"aggregation\"\n formControlName=\"aggregation\"\n (ngModelChange)=\"emitAggregationChange($event)\"\n >\n <option\n *ngFor=\"let aggregationValue of AGGREGATION_VALUES_ARR\"\n [ngValue]=\"aggregationValue\"\n [disabled]=\"disabledAggregationOptions[aggregationValue]\"\n >\n {{ AGGREGATION_LABELS[aggregationValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n</fieldset>\n","import { Component, Input } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { FileTypeMetadata } from '../../../datapoints-export-selector.model';\nimport { DatapointsExportSelectorFileExporterComponent } from '../datapoints-export-selector-file-exporter.component';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-file-types',\n templateUrl: './datapoints-exports-selector-file-types.component.html',\n standalone: true,\n imports: [CoreModule, FormsModule]\n})\nexport class DataPointsExportSelectorFileTypesComponent {\n @Input() dynamicFilesTypeMetadata: { [key: string]: FileTypeMetadata } = {};\n @Input() formGroup: ReturnType<DatapointsExportSelectorFileExporterComponent['createForm']>;\n}\n","<fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex a-i-center\">{{ 'File types' | translate }}</legend>\n <div [formGroup]=\"formGroup\">\n <div formGroupName=\"fileTypes\">\n <c8y-form-group\n class=\"m-b-8\"\n *ngFor=\"let item of dynamicFilesTypeMetadata | keyvalue\"\n >\n <label\n class=\"c8y-checkbox m-t-0\"\n title=\"{{ item.value.title }}\"\n >\n <input\n type=\"checkbox\"\n formControlName=\"{{ item.key }}\"\n />\n <span></span>\n <i\n class=\"m-l-8 m-r-4\"\n c8yIcon=\"{{ item.value.icon }}\"\n ></i>\n <span>{{ item.value.label | translate }}</span>\n </label>\n </c8y-form-group>\n </div>\n </div>\n</fieldset>\n","import { Component, EventEmitter, Input, Output, OnInit, OnDestroy } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { HAS_ERROR } from '../../../datapoints-export-selector.model';\nimport { DatapointsExportSelectorFileExporterComponent } from '../datapoints-export-selector-file-exporter.component';\nimport { Subject } from 'rxjs';\nimport { skip, takeUntil } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-time-range',\n templateUrl: './datapoints-exports-selector-time-range.component.html',\n standalone: true,\n imports: [CoreModule, FormsModule]\n})\nexport class DataPointsExportSelectorTimeRangeComponent implements OnInit, OnDestroy {\n @Input() formGroup: ReturnType<DatapointsExportSelectorFileExporterComponent['createForm']>;\n @Output() onDateFromChange: EventEmitter<string> = new EventEmitter<string>();\n @Output() onDateToChange: EventEmitter<string> = new EventEmitter<string>();\n\n private destroy$ = new Subject<void>();\n\n readonly DATE_FROM = 'dateFrom';\n readonly DATE_TO = 'dateTo';\n readonly FROM_DATE = gettext('From`date`');\n readonly HAS_ERROR = HAS_ERROR;\n readonly INVALID_DATE_TIME = 'invalidDateTime';\n readonly THIS_DATE_IS_INVALID = gettext('This date is invalid.');\n readonly THIS_DATE_IS_AFTER_THE_LAST_ALLOWED_DATE = gettext(\n 'This date is after the latest allowed date.'\n );\n readonly THIS_DATE_IS_BEFORE_THE_EARLIEST_ALLOWED_DATE = gettext(\n 'This date is before the earliest allowed date.'\n );\n readonly TO_DATE = gettext('To`date`');\n\n ngOnInit(): void {\n if (this.formGroup?.controls?.dateFrom) {\n this.formGroup.controls.dateFrom.valueChanges\n // Skip the first value emitted by the observable to avoid overriding the initial value while form is being created\n .pipe(skip(1), takeUntil(this.destroy$))\n .subscribe((updatedDate: string) => this.onDateFromChange.emit(updatedDate));\n }\n if (this.formGroup?.controls?.dateTo) {\n this.formGroup.controls.dateTo.valueChanges\n // Skip the first value emitted by the observable to avoid overriding the initial value while form is being created\n .pipe(skip(1), takeUntil(this.destroy$))\n .subscribe((updatedDate: string) => this.onDateToChange.emit(updatedDate));\n }\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n}\n","<fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Time range' | translate }}</legend>\n <c8y-form-group\n class=\"m-b-8\"\n [ngClass]=\"formGroup.controls.dateFrom.errors ? HAS_ERROR : ''\"\n >\n <label\n [title]=\"FROM_DATE | translate\"\n [for]=\"DATE_FROM\"\n >\n {{ FROM_DATE | translate }}\n </label>\n <div>\n <c8y-date-time-picker\n id=\"DATE_FROM\"\n [maxDate]=\"formGroup.value.dateTo\"\n [placeholder]=\"FROM_DATE | translate\"\n [formControl]=\"formGroup.controls.dateFrom\"\n [ngClass]=\"formGroup.controls.dateFrom.errors ? HAS_ERROR : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"formGroup.controls.dateFrom.errors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"THIS_DATE_IS_AFTER_THE_LAST_ALLOWED_DATE | translate\"\n ></c8y-message>\n <c8y-message\n name=\"INVALID_DATE_TIME\"\n [text]=\"THIS_DATE_IS_INVALID | translate\"\n ></c8y-message>\n </c8y-messages>\n </div>\n </c8y-form-group>\n <c8y-form-group\n class=\"m-b-8\"\n [ngClass]=\"formGroup.controls.dateTo.errors ? HAS_ERROR : ''\"\n >\n <label\n [title]=\"TO_DATE | translate\"\n [for]=\"DATE_TO\"\n >\n {{ TO_DATE | translate }}\n </label>\n <div>\n <c8y-date-time-picker\n id=\"DATE_TO\"\n [minDate]=\"formGroup.value.dateFrom\"\n [placeholder]=\"TO_DATE | translate\"\n [formControl]=\"formGroup.controls.dateTo\"\n [ngClass]=\"formGroup.controls.dateTo.errors ? HAS_ERROR : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"formGroup.controls.dateTo.errors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"THIS_DATE_IS_BEFORE_THE_EARLIEST_ALLOWED_DATE | translate\"\n ></c8y-message>\n <c8y-message\n name=\"INVALID_DATE_TIME\"\n [text]=\"THIS_DATE_IS_INVALID | translate\"\n ></c8y-message>\n </c8y-messages>\n </div>\n </c8y-form-group>\n</fieldset>\n","import { gettext } from '@c8y/ngx-components/gettext';\nimport {\n ExportData,\n FileGenerator,\n IDataTransformer,\n MergedExportDetails,\n TimeSeriesColumnData\n} from '../../../datapoints-export-selector.model';\n\ninterface ICsvFileCreator {\n createFile(content: string, mimeType: string): Promise<Blob>;\n}\n\nclass CSVDataTransformer implements IDataTransformer {\n transformToMergedFormat(exportData: ExportData[]): TimeSeriesColumnData {\n const timeSeries = new Map<string, Record<string, number>>();\n const uniqueColumnIdentifiers = new Set<string>();\n\n exportData.forEach(\n ({ time, device_name, fragment_series, unit, value_min, value_max, source }) => {\n const measurementIdentifier = this.createMeasurementIdentifier(\n device_name,\n fragment_series,\n unit,\n source\n );\n\n if (!timeSeries.has(time)) {\n timeSeries.set(time, {});\n }\n\n const timeEntry = timeSeries.get(time);\n if (timeEntry) {\n const minKey = this.formatMinKey(measurementIdentifier);\n const maxKey = this.formatMaxKey(measurementIdentifier);\n\n timeEntry[minKey] = value_min;\n timeEntry[maxKey] = value_max;\n\n uniqueColumnIdentifiers.add(minKey);\n uniqueColumnIdentifiers.add(maxKey);\n }\n }\n );\n\n return {\n timeSeries,\n uniqueColumnIdentifiers: Array.from(uniqueColumnIdentifiers)\n };\n }\n\n private createMeasurementIdentifier(\n deviceName: string,\n fragmentSeries: string,\n unit: string,\n source: string | number\n ): string {\n return unit\n ? `(${source}) ${deviceName} -> ${fragmentSeries} [${unit}]`\n : `(${source}) ${deviceName} -> ${fragmentSeries}`;\n }\n\n private formatMinKey(baseKey: string): string {\n return `${baseKey} (min)`;\n }\n\n private formatMaxKey(baseKey: string): string {\n return `${baseKey} (max)`;\n }\n}\n\nclass CSVFileCreator implements ICsvFileCreator {\n async createFile(content: string, mimeType: string): Promise<Blob> {\n return new Blob([content], { type: mimeType });\n }\n}\n\nclass CSVGenerator {\n static getLabel(): string {\n return gettext('Comma-separated value');\n }\n\n static getTitle(): string {\n return 'CSV';\n }\n\n static getType(): string {\n return 'csv';\n }\n\n static getIcon(): string {\n return 'table';\n }\n\n static getFileExtension(): string {\n return 'csv';\n }\n\n static getAcceptType(): string {\n return 'text/csv';\n }\n\n static getMimeType(): string {\n return 'text/csv';\n }\n\n static getZipName(): string {\n return 'export_csv.zip';\n }\n\n static async convertToMergedCSV(\n exportData: ExportData[],\n mergedExportDetails: MergedExportDetails\n ): Promise<Blob> {\n const instance = CSVGenerator.getInstance();\n const { timeSeries, uniqueColumnIdentifiers } =\n instance.dataTransformer.transformToMergedFormat(exportData);\n\n const rows = [\n instance.createMergedFileHeaderRow(uniqueColumnIdentifiers, mergedExportDetails),\n ...instance.createMergedFileDataRows(timeSeries, uniqueColumnIdentifiers)\n ];\n\n const csvContent = rows.map(row => row.join(',')).join('\\n');\n return instance.fileCreator.createFile(csvContent, CSVGenerator.getMimeType());\n }\n private static instance: CSVGenerator;\n\n private static getInstance(): CSVGenerator {\n if (!CSVGenerator.instance) {\n CSVGenerator.instance = new CSVGenerator();\n }\n return CSVGenerator.instance;\n }\n private dataTransformer: IDataTransformer;\n private fileCreator: ICsvFileCreator;\n\n private constructor() {\n this.dataTransformer = new CSVDataTransformer();\n this.fileCreator = new CSVFileCreator();\n }\n\n private createMergedFileHeaderRow(\n uniqueColumnIdentifiers: string[],\n details?: MergedExportDetails\n ): string[] {\n const time = details ? `time => from ${details.dateFrom} to ${details.dateTo}` : 'time';\n return [time, ...uniqueColumnIdentifiers];\n }\n\n private createMergedFileDataRows(\n timeSeries: Map<string, Record<string, number>>,\n uniqueColumnIdentifiers: string[]\n ): string[][] {\n return Array.from(timeSeries.entries())\n .filter(([time, values]) => this.isValidEntry(time, values))\n .map(([time, values]) => this.createDataRow(time, values, uniqueColumnIdentifiers));\n }\n\n private isValidEntry(time: string, values: Record<string, number>): boolean {\n return time !== null && Object.values(values).some(value => value != null);\n }\n\n private createDataRow(\n time: string,\n values: Record<string, number>,\n uniqueColumnIdentifiers: string[]\n ): string[] {\n const row = [time];\n uniqueColumnIdentifiers.forEach(key => {\n const value = values[key];\n row.push(value?.toString() || '');\n });\n return row;\n }\n}\n\nexport const CSVGeneratorAdapter: FileGenerator = {\n getLabel: CSVGenerator.getLabel.bind(CSVGenerator),\n getIcon: CSVGenerator.getIcon.bind(CSVGenerator),\n getFileExtension: CSVGenerator.getFileExtension.bind(CSVGenerator),\n getMimeType: CSVGenerator.getMimeType.bind(CSVGenerator),\n generateMerged: CSVGenerator.convertToMergedCSV.bind(CSVGenerator),\n getType: CSVGenerator.getType.bind(CSVGenerator),\n getTitle: CSVGenerator.getTitle.bind(CSVGenerator),\n getZipName: CSVGenerator.getZipName.bind(CSVGenerator),\n getAcceptType: CSVGenerator.getAcceptType.bind(CSVGenerator)\n};\n","import { gettext } from '@c8y/ngx-components/gettext';\nimport JSZip from 'jszip';\nimport { isEmpty, isNil, isNumber } from 'lodash-es';\nimport {\n ExportData,\n FILE_COMPRESSION_TYPES_VALUES,\n FileCompressionTypes,\n FileGenerator,\n IDataTransformer,\n MergedExportDetails,\n TimeSeriesColumnData\n} from '../../../datapoints-export-selector.model';\n\ninterface IXmlGenerator {\n RELS_XML: string;\n CONTENT_TYPES_XML: string;\n WORKBOOK_RELS_XML: string;\n SHARED_STRINGS_XML: string;\n generateWorkbookXml(sheetName?: string): string;\n generateSheetXml(data: string[][]): string;\n generateAppXml(name: string): string;\n generateCoreXml(name: string): string;\n}\n\ninterface IXmlFileCreator {\n createZipFile(\n contents: Map<string, string>,\n compressionType: FileCompressionTypes,\n compressionLevel: number\n ): Promise<Blob>;\n}\n\n// Utility functions\nclass XmlUtils {\n static escapeXml(unsafe: string): string {\n return unsafe.replace(/[<>&'\"]/g, c => {\n switch (c) {\n case '<':\n return '&lt;';\n case '>':\n return '&gt;';\n case '&':\n return '&amp;';\n case \"'\":\n return '&apos;';\n case '\"':\n return '&quot;';\n }\n });\n }\n}\n\nexport class ExcelDataTransformer implements IDataTransformer {\n transformToMergedFormat(exportData: ExportData[]): TimeSeriesColumnData {\n const timeSeries = new Map<string, Record<string, number>>();\n const uniqueColumnIdentifiers = new Set<string>();\n\n exportData.forEach(\n ({ time, device_name, fragment_series, unit, value_min, value_max, source }) => {\n const measurementIdentifier = this.createMeasurementIdentifier(\n device_name,\n fragment_series,\n unit,\n source\n );\n\n if (!timeSeries.has(time)) {\n timeSeries.set(time, {});\n }\n\n const timeEntry = timeSeries.get(time);\n if (timeEntry) {\n const minKey = this.formatMinKey(measurementIdentifier);\n const maxKey = this.formatMaxKey(measurementIdentifier);\n\n timeEntry[minKey] = value_min;\n timeEntry[maxKey] = value_max;\n\n uniqueColumnIdentifiers.add(minKey);\n uniqueColumnIdentifiers.add(maxKey);\n }\n }\n );\n\n return {\n timeSeries,\n uniqueColumnIdentifiers: Array.from(uniqueColumnIdentifiers)\n };\n }\n\n private createMeasurementIdentifier(\n deviceName: string,\n fragmentSeries: string,\n unit: string,\n source: string | number\n ): string {\n return unit\n ? `(${source}) ${deviceName} -> ${fragmentSeries} [${unit}]`\n : `(${source}) ${deviceName} -> ${fragmentSeries}`;\n }\n\n private formatMinKey(baseKey: string): string {\n return `${baseKey} (min)`;\n }\n\n private formatMaxKey(baseKey: string): string {\n return `${baseKey} (max)`;\n }\n}\n\nclass ExcelXmlGenerator implements IXmlGenerator {\n private columnWidths = {\n time: 25,\n source: 10,\n device_name: 20,\n 'fragment.series': 20,\n value_min: 15,\n value_max: 15,\n unit: 5\n };\n private defaultWidth = 30;\n\n readonly RELS_XML =\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\\n' +\n ' <Relationship Id=\"rId1\" Target=\"xl/workbook.xml\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\"/>\\n' +\n ' <Relationship Id=\"rId2\" Target=\"docProps/app.xml\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\"/>\\n' +\n ' <Relationship Id=\"rId3\" Target=\"docProps/core.xml\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\"/>\\n' +\n '</Relationships>';\n\n readonly CONTENT_TYPES_XML =\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\\n' +\n '<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\\n' +\n ' <Default ContentType=\"application/vnd.openxmlformats-package.relationships+xml\" Extension=\"rels\"/>\\n' +\n ' <Default ContentType=\"application/xml\" Extension=\"xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\" PartName=\"/docProps/app.xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" PartName=\"/docProps/core.xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml\" PartName=\"/xl/sharedStrings.xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\" PartName=\"/xl/workbook.xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\" PartName=\"/xl/worksheets/sheet1.xml\"/>\\n' +\n '</Types>';\n\n readonly WORKBOOK_RELS_XML =\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\\n' +\n ' <Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\" Target=\"sharedStrings.xml\"/>\\n' +\n ' <Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\" Target=\"worksheets/sheet1.xml\"/>\\n' +\n '</Relationships>';\n\n readonly SHARED_STRINGS_XML =\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' +\n '<sst count=\"0\" uniqueCount=\"0\" xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"/>';\n\n generateWorkbookXml(sheetName = 'Measurements'): string {\n return (\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n `<workbook xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"><sheets><sheet name='${sheetName}' r:id=\"rId3\" sheetId=\"1\"/></sheets></workbook>`\n );\n }\n\n generateSheetXml(data: string[][]): string {\n const headers = data[0];\n const colsXml = this.generateColsXml(headers);\n const rowsXml = this.generateRowsXml(data);\n\n return `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n <worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">\n <cols>${colsXml}</cols>\n <sheetData>${rowsXml}</sheetData>\n </worksheet>`;\n }\n\n generateAppXml(name: string): string {\n return (\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n '<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">\\n' +\n ` <Application>${name}</Application>\\n` +\n ' <DocSecurity>0</DocSecurity>\\n' +\n ' <ScaleCrop>false</ScaleCrop>\\n' +\n ' <HeadingPairs>\\n' +\n ' <vt:vector size=\"2\" baseType=\"variant\">\\n' +\n ' <vt:variant>\\n' +\n ' <vt:lpstr>Worksheets</vt:lpstr>\\n' +\n ' </vt:variant>\\n' +\n ' <vt:variant>\\n' +\n ' <vt:i4>1</vt:i4>\\n' +\n ' </vt:variant>\\n' +\n ' </vt:vector>\\n' +\n ' </HeadingPairs>\\n' +\n ' <TitlesOfParts>\\n' +\n ' <vt:vector size=\"1\" baseType=\"lpstr\">\\n' +\n ' <vt:lpstr>Sheet1</vt:lpstr>\\n' +\n ' </vt:vector>\\n' +\n ' </TitlesOfParts>\\n' +\n ' <Company></Company>\\n' +\n ' <LinksUpToDate>false</LinksUpToDate>\\n' +\n ' <SharedDoc>false</SharedDoc>\\n' +\n ' <HyperlinksChanged>false</HyperlinksChanged>\\n' +\n ' <AppVersion>16.0300</AppVersion>\\n' +\n '</Properties>'\n );\n }\n\n generateCoreXml(name: string): string {\n const now = new Date().toISOString();\n return (\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n '<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\\n' +\n ` <dc:creator>${name}</dc:creator>\\n` +\n ` <cp:lastModifiedBy>${name}</cp:lastModifiedBy>\\n` +\n ` <dcterms:created xsi:type=\"dcterms:W3CDTF\">${now}</dcterms:created>\\n` +\n ` <dcterms:modified xsi:type=\"dcterms:W3CDTF\">${now}</dcterms:modified>\\n` +\n '</cp:coreProperties>'\n );\n }\n\n private generateColsXml(headers: string[]): string {\n return headers\n .map((header, index) => {\n const width = this.columnWidths[header] || this.defaultWidth;\n return `<col min=\"${index + 1}\" max=\"${index + 1}\" width=\"${width}\" customWidth=\"1\"/>`;\n })\n .join('');\n }\n\n private generateRowsXml(data: string[][]): string {\n return data\n .map(\n row =>\n `<row>${row\n .map(cell => {\n if (isNil(cell) || isEmpty(cell)) {\n return `<c t=\"inlineStr\"><is><t></t></is></c>`; // String cell\n } else if (isNumber(Number(cell)) && !isNaN(Number(cell))) {\n return `<c t=\"n\"><v>${Number(cell)}</v></c>`; // Number cell\n } else {\n return `<c t=\"inlineStr\"><is><t>${XmlUtils.escapeXml(cell)}</t></is></c>`; // String cell\n }\n })\n .join('')}</row>`\n )\n .join('');\n }\n}\n\nclass ZipFileCreator implements IXmlFileCreator {\n async createZipFile(\n contents: Map<string, string>,\n compressionType: FileCompressionTypes,\n compressionLevel: number\n ): Promise<Blob> {\n const zip = new JSZip();\n const blob = 'blob';\n\n contents.forEach((content, filename) => {\n zip.file(filename, content);\n });\n\n const options: JSZip.JSZipGeneratorOptions = { type: blob };\n if (compressionType !== FILE_COMPRESSION_TYPES_VALUES.store) {\n options.compression = compressionType;\n options.compressionOptions = { level: compressionLevel };\n }\n\n return (await zip.generateAsync(options)) as Blob;\n }\n}\n\nclass ExcelGenerator {\n static getLabel(): string {\n return gettext('Microsoft Excel');\n }\n\n static getTitle(): string {\n return 'Excel';\n }\n\n static getType(): string {\n return 'excel';\n }\n\n static getIcon(): string {\n return 'excel';\n }\n\n static getFileExtension(): string {\n return 'xlsx';\n }\n\n static getAcceptType(): string {\n return 'application/vnd.ms-excel';\n }\n\n static getMimeType(): string {\n return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';\n }\n\n static getZipName(): string {\n return 'export_excel.zip';\n }\n\n static async convertToMergedExcel(\n exportData: ExportData[],\n mergedExportDetails: MergedExportDetails\n ): Promise<Blob> {\n const instance = ExcelGenerator.getInstance();\n const { timeSeries, uniqueColumnIdentifiers } =\n instance.dataTransformer.transformToMergedFormat(exportData);\n\n const rows = [\n instance.createMergedFileHeaderRow(uniqueColumnIdentifiers, mergedExportDetails),\n ...instance.createMergedFileDataRows(timeSeries, uniqueColumnIdentifiers)\n ];\n\n return instance.createExcelFile(rows, mergedExportDetails);\n }\n\n private static getInstance(): ExcelGenerator {\n if (!ExcelGenerator.instance) {\n ExcelGenerator.instance = new ExcelGenerator();\n }\n return ExcelGenerator.instance;\n }\n\n private static instance: ExcelGenerator;\n private dataTransformer: IDataTransformer;\n private xmlGenerator: IXmlGenerator;\n private fileCreator: IXmlFileCreator;\n\n private constructor() {\n this.dataTransformer = new ExcelDataTransformer();\n this.xmlGenerator = new ExcelXmlGenerator();\n this.fileCreator = new ZipFileCreator();\n }\n\n private async createExcelFile(data: string[][], details?: MergedExportDetails): Promise<Blob> {\n const contents = new Map<string, string>([\n ['[Content_Types].xml', this.xmlGenerator.CONTENT_TYPES_XML],\n ['_rels/.rels', this.xmlGenerator.RELS_XML],\n [\n 'xl/workbook.xml',\n this.xmlGenerator.generateWorkbookXml(\n details?.aggregation ? details?.aggregation : 'NO AGGREGATION'\n )\n ],\n ['xl/worksheets/sheet1.xml', this.xmlGenerator.generateSheetXml(data)],\n ['xl/sharedStrings.xml', this.xmlGenerator.SHARED_STRINGS_XML],\n ['docProps/app.xml', this.xmlGenerator.generateAppXml('Custom Script')],\n ['docProps/core.xml', this.xmlGenerator.generateCoreXml('Custom Script')],\n ['xl/_rels/workbook.xml.rels', this.xmlGenerator.WORKBOOK_RELS_XML]\n ]);\n\n return this.fileCreator.createZipFile(contents, FILE_COMPRESSION_TYPES_VALUES.deflate, 9);\n }\n\n private createMergedFileHeaderRow(\n uniqueColumnIdentifiers: string[],\n details?: MergedExportDetails\n ): string[] {\n const time = details ? `time => from ${details.dateFrom} to ${details.dateTo}` : 'time';\n return [time, ...uniqueColumnIdentifiers];\n }\n\n private createMergedFileDataRows(\n timeSeries: Map<string, Record<string, number>>,\n uniqueColumnIdentifiers: string[]\n ): string[][] {\n return Array.from(timeSeries.entries())\n .filter(([time, values]) => this.isValidEntry(time, values))\n .map(([time, values]) => this.createDataRow(time, values, uniqueColumnIdentifiers));\n }\n\n private isValidEntry(time: string, values: Record<string, number>): boolean {\n return (\n time !== null && Object.values(values).some(value => value !== null && value !== undefined)\n );\n }\n\n private createDataRow(\n time: string,\n values: Record<string, number>,\n uniqueColumnIdentifiers: string[]\n ): string[] {\n const row = [time];\n uniqueColumnIdentifiers.forEach(key => {\n const value = values[key];\n row.push(value !== undefined && value !== null ? value.toString() : '');\n });\n return row;\n }\n}\n\nexport const ExcelGeneratorAdapter: FileGenerator = {\n getLabel: ExcelGenerator.getLabel.bind(ExcelGenerator),\n getIcon: ExcelGenerator.getIcon.bind(ExcelGenerator),\n getFileExtension: ExcelGenerator.getFileExtension.bind(ExcelGenerator),\n getMimeType: ExcelGenerator.getMimeType.bind(ExcelGenerator),\n generateMerged: ExcelGenerator.convertToMergedExcel.bind(ExcelGenerator),\n getType: ExcelGenerator.getType.bind(ExcelGenerator),\n getTitle: ExcelGenerator.getTitle.bind(ExcelGenerator),\n getZipName: ExcelGenerator.getZipName.bind(ExcelGenerator),\n getAcceptType: ExcelGenerator.getAcceptType.bind(ExcelGenerator)\n};\n","import {\n Component,\n EventEmitter,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Output\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n AbstractControl,\n FormBuilder,\n FormControl,\n ReactiveFormsModule,\n ValidationErrors,\n ValidatorFn\n} from '@angular/forms';\nimport {\n AGGREGATION_VALUES,\n AggregationOption,\n AggregationOptionStatus,\n AggregationService,\n CoreModule,\n GainsightService\n} from '@c8y/ngx-components';\nimport saveAs from 'file-saver';\nimport { debounceTime, merge, Subject, takeUntil } from 'rxjs';\nimport {\n DatapointCounts,\n DatapointDetails,\n DatapointsExceedingLimit,\n DataToExport,\n DataToExportWithBackendCreatedFile,\n DateFetchConfig,\n EXPORT_MODE_VALUES,\n ExportConfig,\n ExportData,\n FileExportConfig,\n FileGenerator,\n FileTypeMetadata,\n MergedExportDetails,\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR,\n SERIES_DATA_MERGED_FILE_NAME\n} from '../../datapoints-export-selector.model';\nimport { DataFetchingService } from './data-fetching.service';\nimport { DataProcessingService } from './data-processing.service';\nimport { DatapointsExportSelectorFileExporterService } from './datapoints-export-selector-file-exporter.service';\nimport { DataPointsExportSelectorPreviewComponent } from './datapoints-export-selector-preview/datapoints-export-selector-preview.component';\nimport { DataPointsExportSelectorDataScopeComponent } from './datapoints-exports-selector-data-scope/datapoints-exports-selector-data-scope.component';\nimport { DataPointsExportSelectorFileTypesComponent } from './datapoints-exports-selector-file-types/datapoints-exports-selector-file-types.component';\nimport { DataPointsExportSelectorTimeRangeComponent } from './datapoints-exports-selector-time-range/datapoints-exports-selector-time-range.component';\nimport { CSVGeneratorAdapter } from './generators/csv-generator';\nimport { ExcelGeneratorAdapter } from './generators/excel-generator';\n\nexport const FILE_GENERATORS = new InjectionToken<FileGenerator[]>('FILE_GENERATORS', {\n providedIn: 'root',\n factory: () => [ExcelGeneratorAdapter, CSVGeneratorAdapter]\n});\n\nexport const dateRangeValidator: ValidatorFn = (\n control: AbstractControl\n): ValidationErrors | null => {\n const dateFrom = control.get('dateFrom');\n const dateTo = control.get('dateTo');\n\n if (!dateFrom || !dateTo) {\n return null;\n }\n\n const dateFromValue = dateFrom.value;\n const dateToValue = dateTo.value;\n if (dateFromValue && dateToValue) {\n if (new Date(dateFromValue) > new Date(dateToValue)) {\n dateFrom.setErrors({ dateAfterRangeMax: true });\n dateTo.setErrors({ dateBeforeRangeMin: true });\n } else {\n dateFrom.setErrors(null);\n dateTo.setErrors(null);\n }\n }\n return null;\n};\n\n@Component({\n selector: 'c8y-datapoints-export-selector-file-exporter',\n templateUrl: './datapoints-export-selector-file-exporter.component.html',\n standalone: true,\n imports: [\n CoreModule,\n DataPointsExportSelectorDataScopeComponent,\n DataPointsExportSelectorFileTypesComponent,\n DataPointsExportSelectorPreviewComponent,\n DataPointsExportSelectorTimeRangeComponent,\n ReactiveFormsModule\n ]\n})\nexport class DatapointsExportSelectorFileExporterComponent implements OnInit, OnDestroy {\n @Input() exportConfig: ExportConfig;\n @Output() onDownloadButtonStateChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n /**\n * Represents aggregation selector options that are disabled.\n * This state is determined based on the current date range.\n */\n disabledAggregationOptions: AggregationOptionStatus = {};\n\n formGroup: ReturnType<DatapointsExportSelectorFileExporterComponent['createForm']>;\n\n /**\n * Contains all datapoints that number of records exceeds a threshold, where data for these datapoints will be processed by the backend.\n * Applies only to measurement API which can return processed CSV, Excel or XML data.\n */\n datapointsExceedingBrowserDownloadLimit: DatapointsExceedingLimit[] = [];\n /**\n * Indicates whether any of DataToExport objects timeValueMap property is not undefined (series data)\n * or dataPointToExport is not undefined at all (measurement data).\n */\n\n hasFetchedDataAnyValuesToExport = false;\n\n /**\n * Indicates if there is no exportable data because the date range of all selected datapoints exceeds 1,000,000 records.\n */\n hasNoExportableData: boolean;\n\n hasPermissionToReadAnyMeasurements = false;\n\n isPreviewLoading = true;\n /**\n * Indicates whether the full or compact type of export is selected.\n * Full type of export is based on measurement API data.\n * Compact type of export is based on series API data.\n */\n isFullTypeOfExport = false;\n\n previewTableData: ExportData[];\n\n limitExceededMessage: string;\n\n /**\n * Contains processed data that is prepared to be exported if series data was fetched\n * or shown in the preview table in case of measurements data.\n */\n private dataToExport: DataToExport[];\n /**\n * Contains a list of datapoints that selected date range exceeds API limit of 1_000_000 records.\n */\n private dataPointsExceedingOneMillionLimit: DatapointsExceedingLimit[];\n /**\n * Represents the state of file type selection checkboxes.\n */\n private fileTypeSelectionState: { [key: string]: boolean };\n /**\n * Hold the initial state of the aggregation from the export config.\n * Value will be loaded on component destroy.\n */\n private initialAggregation: AggregationOption;\n /**\n * Hold the initial state of the dateFrom from the export config.\n * Value will be loaded on component destroy.\n */\n private initialDateFrom: string;\n /**\n * Hold the initial state of the dateTo from the export config.\n * Value will be loaded on component destroy.\n */\n private initialDateTo: string;\n /**\n * Hold the initial state of the datapointDetails from the export config.\n * Some logic may filter out datapoints in datapointDetails array, that exceeds 1_000_000 limit for measurements API,\n * but full list is still needed when component is reopened.\n * Value will be loaded on component destroy.\n */\n private initialDatapointDetails: DatapointDetails[];\n /**\n * Indicates whether the aggregation value was changed programmatically.\n * It prevents a case where fetching may be triggered twice when export type is changed.\n * Both options alone can trigger fetching data.\n */\n private isAggregationChangedProgrammatically = false;\n /**\n * Indicates whether any of the export file types (CSV, Excel) are checked.\n */\n private isAnyOfExportFileTypeChecked = false;\n\n private dateFromSubject = new Subject<DateFetchConfig>();\n private dateToSubject = new Subject<DateFetchConfig>();\n private destroy$ = new Subject<void>();\n\n dynamicFilesTypeMetadata: { [key: string]: FileTypeMetadata } = {};\n\n constructor(\n private aggregationService: AggregationService,\n private datapointsExportModalService: DataProcessingService,\n private datapointsExportSelectorFileExporterService: DatapointsExportSelectorFileExporterService,\n private dataFetchingService: DataFetchingService,\n private formBuilder: FormBuilder,\n @Inject(FILE_GENERATORS) private generators: FileGenerator[],\n private gainsightService: GainsightService\n ) {\n this.setFilesType(this.generators);\n\n this.dateFromSubject\n .pipe(debounceTime(300), takeUntilDestroyed())\n .subscribe(async (dateInfo: DateFetchConfig) => {\n await this.updateDateAndFetchData('dateFrom', dateInfo);\n });\n\n this.dateToSubject\n .pipe(debounceTime(300), takeUntilDestroyed())\n .subscribe(async (dateInfo: DateFetchConfig) => {\n await this.updateDateAndFetchData('dateTo', dateInfo);\n });\n }\n\n setFilesType(generators: FileGenerator[]) {\n generators.forEach(g => {\n this.dynamicFilesTypeMetadata[g.getType()] = {\n label: g.getLabel(),\n icon: g.getIcon(),\n title: g.getTitle(),\n extension: g.getFileExtension(),\n zipName: g.getZipName(),\n type: g.getType()\n };\n });\n }\n\n async ngOnInit(): Promise<void> {\n const sourcesPermittedToRead: string[] =\n await this.dataFetchingService.getSourcesWithPermissionsToRead(\n this.exportConfig.datapointDetails\n );\n\n if (sourcesPermittedToRead.length === 0) {\n return;\n }\n\n if (sourcesPermittedToRead.length !== this.exportConfig.datapointDetails.length) {\n this.exportConfig.datapointDetails = this.exportConfig.datapointDetails.filter(dataPoint =>\n sourcesPermittedToRead.includes(String(dataPoint.source))\n );\n }\n\n this.hasPermissionToReadAnyMeasurements = true;\n\n this.storeInitialChangeableConfig();\n\n this.fileTypeSelectionState = this.getInitialSelection(this.dynamicFilesTypeMetadata, [0]);\n\n this.formGroup = this.createForm();\n this.dataToExport = await this.dataFetchingService.fetchAndPrepareDataToExport(\n this.exportConfig,\n this.isFullTypeOfExport\n );\n\n this.handleDateSelectorChanges();\n this.determineShowingPreviewOrEmptyState();\n this.handleExportModeChanges();\n this.handleFileTypeSelectionChanges();\n this.handleFormValidationChanges();\n\n this.updateFileTypeControl();\n\n this.updateDisabledAggregationOptions();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.loadInitialChangeableConfig();\n }\n\n async exportAndDownload(): Promise<void> {\n const fileExports: FileExportConfig[] = Object.entries(this.dynamicFilesTypeMetadata).map(\n ([_, value]) => ({\n fileType: value.type as string,\n zipName: value.zipName\n })\n );\n\n const selectedFileExports: FileExportConfig[] = this.getOnlySelectedFileExports(fileExports);\n\n this.triggerGainsightDownloadEvent(selectedFileExports);\n\n await Promise.all(\n selectedFileExports.map(async ({ fileType, zipName }) => {\n const blob = await this.exportFile(fileType);\n await this.downloadFile(blob, fileType, zipName);\n })\n );\n\n this.datapointsExportSelectorFileExporterService.cleanupCachedData();\n }\n\n getOnlySelectedFileExports(fileExports: FileExportConfig[]): FileExportConfig[] {\n return fileExports.filter(f => this.fileTypeSelectionState[f.fileType] === true);\n }\n\n async exportFile(fileType: string): Promise<Blob | null> {\n return this.isFullTypeOfExport\n ? await this.exportMeasurementFile(fileType)\n : await this.exportSeriesFile(fileType);\n }\n\n async downloadFile(\n blob: Blob | null,\n fileType: string,\n measurementsZipFileName: string\n ): Promise<void> {\n this.datapointsExceedingBrowserDownloadLimit =\n this.datapointsExceedingBrowserDownloadLimit.filter(\n datapoint => !this.dataPointsExceedingOneMillionLimit.includes(datapoint)\n );\n\n const shouldShowAlert = this.datapointsExceedingBrowserDownloadLimit.length > 0;\n\n // Handles a case where all files are sent by email.\n if (!blob && shouldShowAlert) {\n this.dataFetchingService.showSendViaEmailInfoAlert(\n fileType,\n this.datapointsExceedingBrowserDownloadLimit\n );\n return;\n }\n\n if (blob) {\n // Handles the case where some of the files are sent by email.\n if (shouldShowAlert) {\n this.dataFetchingService.showSendViaEmailInfoAlert(\n fileType,\n this.datapointsExceedingBrowserDownloadLimit\n );\n }\n\n this.isFullTypeOfExport\n ? saveAs(blob, measurementsZipFileName)\n : saveAs(blob, blob[SERIES_DATA_MERGED_FILE_NAME]);\n }\n }\n\n /**\n * Exports a measurement file of the specified type.\n *\n * Measurements API does provide a way to fetch a preprocessed CSV/Excel file.\n *\n * At this point a backed file needs to be fetched.\n * Measurement data used for a preview contains just 5 first records\n * and it's not fetched with CSV/Excel headers.\n *\n * @param fileType - The type of file to export.\n * @returns A Promise that resolves to a Blob representing the exported file or null when no data to export or it's sent via email.\n */\n async exportMeasurementFile(fileType: string): Promise<Blob> | null {\n const { acceptType, extension } = this.datapointsExportModalService.fileTypesConfigs[fileType];\n\n const updatedExportConfig: ExportConfig = this.excludeDatapointsThatExceedsApiLimit(\n this.exportConfig\n );\n\n const dataToExport: DataToExportWithBackendCreatedFile[] =\n await this.dataFetchingService.fetchMeasurementDataFilesAndPairWithSourceDetails(\n acceptType,\n updatedExportConfig\n );\n\n const isAllUndefined = dataToExport.every(data => data === undefined);\n if (isAllUndefined) {\n return null;\n }\n\n return this.datapointsExportSelectorFileExporterService.getMeasurementExportedDataBlob(\n extension,\n dataToExport\n );\n }\n\n excludeDatapointsThatExceedsApiLimit(exportConfig: ExportConfig): ExportConfig {\n const skippedDatapointsSource: string[] = this.dataPointsExceedingOneMillionLimit.map(\n datapoint => datapoint.datapointDetail.source.toString()\n );\n\n const filteredDatapoints: DatapointDetails[] = exportConfig.datapointDetails.filter(\n datapoint => !skippedDatapointsSource.includes(String(datapoint.source))\n );\n\n exportConfig.datapointDetails = filteredDatapoints;\n return exportConfig;\n }\n\n /**\n * Exports the series data to a file of the specified type.\n *\n * Series API does not provide a way to fetch a preprocessed CSV/Excel file.\n *\n * Series data used for exporting a file is already fetched for a preview\n * and can be reused for exporting.\n *\n * @param fileType - The type of file to export (e.g., CSV, Excel).\n * @returns A Promise that resolves to a Blob representing the exported file.\n */\n async exportSeriesFile(fileType: string): Promise<Blob> {\n const mergedExportDetails: MergedExportDetails = {\n aggregation: this.exportConfig.aggregation,\n dateFrom: this.exportConfig.dateFrom,\n dateTo: this.exportConfig.dateTo\n };\n\n return this.datapointsExportSelectorFileExporterService.getSeriesExportedDataBlob(\n fileType,\n this.dataToExport,\n mergedExportDetails\n );\n }\n\n async onAggregationChange(newAggregation: AggregationOption): Promise<void> {\n const currentAggregation = this.exportConfig.aggregation ?? AGGREGATION_VALUES.none;\n\n if (currentAggregation === newAggregation) {\n return;\n }\n\n this.exportConfig.aggregation = newAggregation;\n\n if (this.isAggregationChangedProgrammatically) {\n return;\n }\n\n await this.loadExportData();\n this.updateDownloadButtonState();\n }\n\n onDateFromChange(updatedDate: string): void {\n this.update(updatedDate, this.exportConfig.dateTo);\n }\n\n onDateToChange(updatedDate: string): void {\n this.update(this.exportConfig.dateFrom, updatedDate);\n }\n\n async updateDateAndFetchData(\n dateType: 'dateFrom' | 'dateTo',\n dateInfo: DateFetchConfig\n ): Promise<void> {\n this.exportConfig[dateType] = dateInfo.date;\n if (!dateInfo.shouldFetchData) {\n return;\n }\n\n await this.loadExportData();\n\n if (this.isFullTypeOfExport) {\n await this.determineIfMeasurementResponseWillBeProcessedByBackend();\n } else {\n this.updateDownloadButtonState();\n }\n }\n\n async onExportTypeChange(exportType: string): Promise<void> {\n if (exportType === EXPORT_MODE_VALUES.full) {\n this.isAggregationChangedProgrammatically = true;\n this.formGroup.controls.aggregation.setValue(AGGREGATION_VALUES.none);\n this.isAggregationChangedProgrammatically = false;\n\n this.isFullTypeOfExport = true;\n await this.loadExportData();\n await this.determineIfMeasurementResponseWillBeProcessedByBackend();\n return;\n }\n\n this.resetFullExportRelatedProperties();\n this.isFullTypeOfExport = false;\n await this.loadExportData();\n\n this.updateDisabledAggregationOptions();\n\n this.updateDownloadButtonState();\n }\n\n private updateDisabledAggregationOptions(): void {\n this.disabledAggregationOptions = this.aggregationService.getDisabledAggregationOptions(\n this.formGroup.controls.dateFrom.value,\n this.formGroup.controls.dateTo.value\n );\n }\n\n private createForm() {\n return this.formBuilder.group(\n {\n dateFrom: new FormControl(this.exportConfig.dateFrom),\n dateTo: new FormControl(this.exportConfig.dateTo),\n aggregation: new FormControl(\n this.exportConfig.aggregation ? this.exportConfig.aggregation : AGGREGATION_VALUES.none\n ),\n exportMode: new FormControl(EXPORT_MODE_VALUES.compact),\n fileTypes: this.formBuilder.group(\n this.generators.reduce((a, c) => {\n a[c.getType()] = false;\n return a;\n }, {})\n )\n },\n {\n validators: [dateRangeValidator]\n }\n );\n }\n\n private preparePreview(): void {\n this.isPreviewLoading = true;\n this.previewTableData =\n this.datapointsExportModalService.transformToExportFileStructureForPreview(this.dataToExport);\n this.isPreviewLoading = false;\n }\n\n private handleDateSelectorChanges(): void {\n const aggregationControl = this.formGroup.controls.aggregation;\n const dateFromSelector = this.formGroup.controls.dateFrom;\n const dateToSelector = this.formGroup.controls.dateTo;\n\n const updateAggregationOptions = () => {\n if (!this.isFullTypeOfExport) {\n this.updateDisabledAggregationOptions();\n\n const firstAvailableAggregationValue: AggregationOption =\n this.aggregationService.determineFirstNewAvailableAggregationValue(\n aggregationControl.value,\n this.disabledAggregationOptions\n );\n\n if (firstAvailableAggregationValue) {\n aggregationControl.setValue(firstAvailableAggregationValue);\n }\n }\n };\n\n merge(dateFromSelector.valueChanges, dateToSelector.valueChanges)\n .pipe(takeUntil(this.destroy$))\n .subscribe(updateAggregationOptions);\n }\n\n private handleExportModeChanges(): void {\n const aggregationControl = this.formGroup.controls.aggregation;\n\n this.formGroup.controls.exportMode.valueChanges\n .pipe(takeUntil(this.destroy$))\n .subscribe(exportModeValue => {\n if (exportModeValue.toString() === EXPORT_MODE_VALUES.full) {\n aggregationControl.disable();\n } else {\n aggregationControl.enable();\n }\n });\n }\n\n private handleFileTypeSelectionChanges(): void {\n this.formGroup.controls.fileTypes.valueChanges\n .pipe(takeUntil(this.destroy$))\n .subscribe(fileTypesSelectionState => {\n this.updateFileTypeSelectionState(fileTypesSelectionState);\n });\n }\n\n private updateFileTypeSelectionState(checkboxesState: { [key: string]: boolean }): void {\n this.isAnyOfExportFileTypeChecked = Object.values(checkboxesState).some(\n value => value === true\n );\n this.fileTypeSelectionState = checkboxesState;\n this.updateDownloadButtonState();\n }\n\n private handleFormValidationChanges(): void {\n this.formGroup.statusChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateDownloadButtonState();\n });\n }\n\n private updateFileTypeControl(): void {\n const fileTypesControl = this.formGroup.controls.fileTypes;\n if (fileTypesControl) {\n const currentValue = fileTypesControl.value || {};\n const updatedValue = { ...currentValue };\n\n Object.entries(this.fileTypeSelectionState).forEach(([fileType, isSelected]) => {\n if (fileType in currentValue) {\n updatedValue[fileType] = isSelected;\n }\n });\n\n fileTypesControl.patchValue(updatedValue);\n }\n }\n\n private determineShowingPreviewOrEmptyState(): void {\n const hasDataToShow = this.dataToExport.some(dataToExportItem =>\n this.isFullTypeOfExport\n ? !!dataToExportItem\n : dataToExportItem.timeValueMap && Object.keys(dataToExportItem.timeValueMap).length > 0\n );\n\n this.hasFetchedDataAnyValuesToExport = hasDataToShow;\n\n if (hasDataToShow) {\n this.preparePreview();\n } else {\n this.isPreviewLoading = false;\n }\n }\n\n private async determineIfMeasurementResponseWillBeProcessedByBackend(): Promise<void> {\n this.isPreviewLoading = true;\n\n this.datapointsExceedingBrowserDownloadLimit =\n await this.dataFetchingService.getDatapointsExceedingLimit(this.exportConfig);\n\n const { browserDownloadableCount, emailDeliverableCount, nonRetrievableCount } =\n this.calculateDatapointCounts();\n\n this.hasNoExportableData =\n browserDownloadableCount === 0 && emailDeliverableCount === 0 && nonRetrievableCount > 0;\n\n if (this.datapointsExceedingBrowserDownloadLimit.length > 0 && !this.hasNoExportableData) {\n this.limitExceededMessage = this.dataFetchingService.getLimitExceededMessage(\n this.hasNoExportableData,\n emailDeliverableCount,\n browserDownloadableCount,\n nonRetrievableCount,\n this.exportConfig.datapointDetails.length\n );\n }\n\n if (this.datapointsExceedingBrowserDownloadLimit.length > 0 && this.hasNoExportableData) {\n this.limitExceededMessage = this.dataFetchingService.getLimitExceededMessage(\n this.hasNoExportableData\n );\n }\n\n this.updateDownloadButtonState();\n\n this.isPreviewLoading = false;\n }\n\n private calculateDatapointCounts(): DatapointCounts {\n const RECORD_API_LIMIT = 1_000_000;\n\n this.dataPointsExceedingOneMillionLimit = this.datapointsExceedingBrowserDownloadLimit.filter(\n datapointsExceedingBrowserDownloadLimit =>\n datapointsExceedingBrowserDownloadLimit.totalElements > RECORD_API_LIMIT\n );\n\n const nonRetrievableCount = this.dataPointsExceedingOneMillionLimit.length;\n\n const emailDeliverableCount =\n this.datapointsExceedingBrowserDownloadLimit.length - nonRetrievableCount;\n\n const browserDownloadableCount =\n this.exportConfig.datapointDetails.length - emailDeliverableCount - nonRetrievableCount;\n\n return {\n browserDownloadableCount,\n emailDeliverableCount,\n nonRetrievableCount\n };\n }\n\n private storeInitialChangeableConfig(): void {\n this.initialDateFrom = this.exportConfig.dateFrom;\n this.initialDateTo = this.exportConfig.dateTo;\n this.initialDatapointDetails = this.exportConfig.datapointDetails;\n if (!this.isFullTypeOfExport) {\n this.initialAggregation = this.exportConfig.aggregation;\n }\n }\n\n private loadInitialChangeableConfig(): void {\n this.exportConfig.dateFrom = this.initialDateFrom;\n this.exportConfig.dateTo = this.initialDateTo;\n this.exportConfig.datapointDetails = this.initialDatapointDetails;\n if (!this.isFullTypeOfExport) {\n this.exportConfig.aggregation = this.initialAggregation;\n }\n }\n\n private async loadExportData(): Promise<void> {\n if (this.formGroup.invalid) {\n return;\n }\n\n this.isPreviewLoading = true;\n\n this.onDownloadButtonStateChange.emit(false);\n\n this.dataToExport = await this.dataFetchingService.fetchAndPrepareDataToExport(\n this.exportConfig,\n this.isFullTypeOfExport\n );\n\n this.determineShowingPreviewOrEmptyState();\n }\n\n private updateDownloadButtonState(): void {\n const canEnableDownloadButton =\n this.hasFetchedDataAnyValuesToExport &&\n !this.formGroup.invalid &&\n this.isAnyOfExportFileTypeChecked &&\n !this.hasNoExportableData;\n\n this.onDownloadButtonStateChange.emit(canEnableDownloadButton);\n }\n\n private resetFullExportRelatedProperties(): void {\n this.hasNoExportableData = false;\n this.datapointsExceedingBrowserDownloadLimit = [];\n }\n\n private getInitialSelection(\n fileType: { [key: string]: FileTypeMetadata },\n selectByDefault: number[]\n ) {\n const keys = Object.keys(fileType);\n if (keys.length === 0) {\n return {};\n }\n\n const initialSelection = keys.reduce<{ [key: string]: boolean }>((acc, key) => {\n acc[key] = false;\n return acc;\n }, {});\n\n selectByDefault.forEach(index => {\n if (index >= 0 && index < keys.length) {\n initialSelection[keys[index]] = true;\n }\n });\n\n return initialSelection;\n }\n\n /**\n * Adjusts both \"from\" and \"to\" dates when either is updated:\n * - Resets seconds to 00 even when only one date changes\n * - Prevents persisting hidden seconds ≠ 00 from initial load\n * - Triggers data fetch\n *\n * Example:\n * When user changes \"from\" date:\n * Input: startDate = \"2024-03-26 13:30:45\", endDate = \"2024-03-27 15:20:45\"\n * Result: startDate -> \"2024-03-26 14:30:00\", endDate -> \"2024-03-27 15:20:00\"\n *\n * When user changes \"to\" date:\n * Input: startDate = \"2024-03-26 14:30:45\", endDate = \"2024-03-27 15:20:45\"\n * Result: startDate -> \"2024-03-26 14:30:00\", endDate -> \"2024-03-27 16:20:00\"\n *\n * @param startDate - The \"start\" date to be adjusted.\n * @param endDate - The \"end\" date to be adjusted.\n */\n private update(startDate: string, endDate: string): void {\n this.dateFromSubject.next({\n date: this.dataFetchingService.adjustDate(startDate, 0),\n shouldFetchData: false\n });\n\n this.dateToSubject.next({\n date: this.dataFetchingService.adjustDate(endDate, 0),\n shouldFetchData: true\n });\n }\n\n private triggerGainsightDownloadEvent(selectedFileExports: FileExportConfig[]): void {\n const commonEventData = {\n action: PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.ACTIONS.DOWNLOAD_STARTED,\n component:\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.COMPONENTS\n .DATAPOINTS_EXPORT_SELECTOR_FILE_EXPORTER,\n selectedFileType: selectedFileExports.map(item => item.fileType)\n };\n\n if (this.isFullTypeOfExport) {\n this.gainsightService.triggerEvent(\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EVENTS.EXPORT_SELECTOR,\n {\n ...commonEventData,\n selectedExportType:\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EXPORT_CONFIG.FULL_EXPORT_TYPE\n }\n );\n } else {\n this.gainsightService.triggerEvent(\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EVENTS.EXPORT_SELECTOR,\n {\n ...commonEventData,\n selectedExportType:\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EXPORT_CONFIG.COMPACT_EXPORT_TYPE,\n selectedAggregation: this.exportConfig.aggregation ?? AGGREGATION_VALUES.none\n }\n );\n }\n }\n}\n","<div class=\"p-b-16\">\n <ng-container *ngIf=\"hasPermissionToReadAnyMeasurements; else hasNoRoleToReadAnyMeasurements\">\n <div class=\"p-16 text-center separator-bottom sticky-top bg-component\">\n <p class=\"text-medium text-16\">\n {{ 'Configure export' | translate }}\n </p>\n </div>\n <div\n class=\"p-t-24 p-r-16 p-l-16 gap-8 p-b-16 flex-wrap\"\n [ngClass]=\"{ 'separator-bottom': isFullTypeOfExport }\"\n >\n <div class=\"row\">\n <div class=\"col-md-4\">\n <c8y-datapoints-export-selector-time-range\n *ngIf=\"this.hasPermissionToReadAnyMeasurements\"\n [formGroup]=\"formGroup\"\n (onDateFromChange)=\"onDateFromChange($event)\"\n (onDateToChange)=\"onDateToChange($event)\"\n ></c8y-datapoints-export-selector-time-range>\n </div>\n <div class=\"col-md-4\">\n <c8y-datapoints-export-selector-data-scope\n *ngIf=\"this.hasPermissionToReadAnyMeasurements\"\n [disabledAggregationOptions]=\"disabledAggregationOptions\"\n [formGroup]=\"formGroup\"\n (onAggregationChange)=\"onAggregationChange($event)\"\n (onExportTypeChange)=\"onExportTypeChange($event)\"\n ></c8y-datapoints-export-selector-data-scope>\n </div>\n <div class=\"col-md-4\">\n <c8y-datapoints-export-selector-file-types\n *ngIf=\"this.hasPermissionToReadAnyMeasurements\"\n [dynamicFilesTypeMetadata]=\"dynamicFilesTypeMetadata\"\n [formGroup]=\"formGroup\"\n ></c8y-datapoints-export-selector-file-types>\n </div>\n </div>\n </div>\n <ng-container\n *ngIf=\"!isFullTypeOfExport && !hasFetchedDataAnyValuesToExport && !isPreviewLoading\"\n >\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 d-flex\">\n <div\n class=\"alert alert-warning center-block\"\n role=\"alert\"\n data-cy=\"file-exporter--no-data-available\"\n translate\n >\n No data available.\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"datapointsExceedingBrowserDownloadLimit.length > 0\">\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 separator-bottom d-flex\">\n <div\n [class]=\"\n hasNoExportableData\n ? 'alert alert-warning center-block'\n : 'alert alert-info center-block'\n \"\n role=\"alert\"\n [attr.data-cy]=\"\n hasNoExportableData\n ? 'file-exporter--over-one-million-message'\n : 'file-exporter--over-50k-message'\n \"\n [innerHTML]=\"limitExceededMessage\"\n ></div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"isFullTypeOfExport\">\n <c8y-datapoints-export-selector-preview\n *ngIf=\"this.hasPermissionToReadAnyMeasurements\"\n [hasFetchedDataAnyValuesToExport]=\"hasFetchedDataAnyValuesToExport\"\n [isPreviewLoading]=\"isPreviewLoading\"\n [previewTableData]=\"previewTableData\"\n ></c8y-datapoints-export-selector-preview>\n </ng-container>\n </ng-container>\n <ng-template #hasNoRoleToReadAnyMeasurements>\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 d-flex\">\n <div\n class=\"alert alert-info center-block\"\n role=\"alert\"\n translate\n >\n <p>To export data, you must meet at least one of these criteria:</p>\n <ul>\n <li>\n Have\n <b>READ permission for \"Measurements\" permission type</b>\n (either as a global role or for the specific source)\n </li>\n <li>\n Be the\n <b>owner of the source</b>\n you want to export data from\n </li>\n </ul>\n <p>Don't meet these requirements? Contact your system administrator for assistance.</p>\n </div>\n </div>\n </ng-template>\n</div>\n","import { Inject, Injectable } from '@angular/core';\nimport JSZip from 'jszip';\nimport {\n DataToExport,\n ExportData,\n ExportedFile,\n FILE_COMPRESSION_TYPES_VALUES,\n FileCompressionTypes,\n FileGenerator,\n MEASUREMENTS_PREVIEW_ITEMS_LIMIT,\n MergedExportDetails,\n SERIES_DATA_MERGED_FILE_NAME,\n SeriesExportParams\n} from '../../datapoints-export-selector.model';\nimport { FILE_GENERATORS } from './datapoints-export-selector-file-exporter.component';\nimport { UtilsService } from './utils.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DataProcessingService {\n mergeMapping = {};\n fileTypesConfigs: {\n [key: string]: {\n extension: string;\n mimeType: string;\n acceptType: string;\n };\n };\n\n constructor(\n @Inject(FILE_GENERATORS) private fileGenerators: FileGenerator[],\n private utils: UtilsService\n ) {\n this.setGenerators(this.fileGenerators);\n\n this.fileTypesConfigs = this.fileGenerators.reduce((acc, g) => {\n acc[g.getType()] = {\n extension: g.getFileExtension(),\n mimeType: g.getMimeType(),\n acceptType: g.getAcceptType()\n };\n return acc;\n }, {});\n }\n\n setGenerators(fileGenerators: FileGenerator[]) {\n fileGenerators.forEach(g => {\n this.mergeMapping[g.getType()] = g.generateMerged;\n });\n }\n\n /**\n * Transforms the data into a structured format for an export.\n *\n * @param dataToExport - An array of processed measurement data combined with the respective properties of the datapoint.\n * @returns Provides a two-dimensional array of ExportData,\n * where each inner array contains ExportData entries representing the transformed measurements and metadata of each datapoint.\n */\n transformToExportFileStructure(dataToExport: DataToExport[]): ExportData[][] {\n const exportData: ExportData[][] = [];\n\n for (const data of dataToExport) {\n const rowsData: ExportData[] = this.processDataToExport(data);\n exportData.push(rowsData);\n }\n return exportData;\n }\n\n /**\n * Transforms the input datapoints with values into a structured format for a preview.\n *\n * @param dataToExport - An array of processed measurement data combined with the respective properties of the datapoint.\n * @returns Provides an array of up to 5 ExportData elements (no more is needed for a preview) or an empty array,\n */\n transformToExportFileStructureForPreview(dataToExport: DataToExport[]): ExportData[] {\n const data = dataToExport.find(data => {\n return data !== null && data.timeValueMap;\n });\n\n if (!data) {\n return [];\n }\n\n const exportData = this.processDataToExport(data);\n\n return exportData.slice(0, MEASUREMENTS_PREVIEW_ITEMS_LIMIT);\n }\n\n /**\n * Processes a single dataToExport and transforms it into an array of ExportData.\n *\n * Used further for creating series data based export and also for measurements and series data based preview.\n * Series data provides min and max values for each timestamp.\n *\n * @param dataToExport - A processed measurement or series data combined with the respective properties of the datapoint to be precessed\n * @returns An array of ExportData representing the processed datapoint,\n * that can be used as a row data in the exported files or for preview.\n */\n processDataToExport(dataToExport: DataToExport): ExportData[] {\n const rowsData: ExportData[] = [];\n\n // When measurements or series data is not available, add an empty header row with only device_name, source and fragment_series.\n // This data is needed later to be used to create the file name and merged file header string.\n const responseDoesNotContainData = !Object.keys(dataToExport.timeValueMap || {}).length;\n if (responseDoesNotContainData) {\n rowsData.push({\n time: null,\n source: dataToExport.source,\n device_name: dataToExport.deviceName,\n fragment_series: `${dataToExport.valueFragmentType}.${dataToExport.valueFragmentSeries}`,\n value: null,\n value_min: null,\n value_max: null,\n unit: null\n });\n return rowsData;\n }\n\n for (const [time, value] of Object.entries(dataToExport.timeValueMap)) {\n // Measurements data contains only one value as a number, series data contains object with min and max values.\n const isMeasurementData = typeof value === 'number';\n if (isMeasurementData) {\n rowsData.push(this.createExportData(dataToExport, time, isMeasurementData, value));\n } else {\n rowsData.push(\n this.createExportData(dataToExport, time, isMeasurementData, value.min, value.max)\n );\n }\n }\n return rowsData;\n }\n\n createExportData(\n dataToExport: DataToExport,\n time: string,\n isMeasurement: boolean,\n value: number,\n valueMax?: number\n ): ExportData {\n const commonExportData = {\n time: new Date(time).toISOString(),\n source: dataToExport.source,\n device_name: dataToExport.deviceName,\n fragment_series: `${dataToExport.valueFragmentType}.${dataToExport.valueFragmentSeries}`,\n unit: dataToExport.unit\n };\n\n return isMeasurement\n ? { ...commonExportData, value }\n : { ...commonExportData, value_min: value, value_max: valueMax };\n }\n\n /**\n * Exports the given data to merged CSV or Excel files.\n *\n * @param exportData - An array containing ExportData objects that will be used as parts of the merged file.\n * @param fileType - Indicates the type of the file to be exported.\n * @param mergedExportDetails - An object containing the date range from which the export was created and aggregation type.\n * @returns An objects containing file name and its respective content as Blob.\n *\n * Example of exported merged file structure:\n * date from\tdate to\n * 2024-04-15T12:14:00.000Z\t2024-07-16T14:14:28+02:00\n * time\t G6Fit -> c8y_Acceleration.accelerationX [G]\tG6Fit -> c8y_Acceleration.accelerationY [G]\n * 2024-05-13T13:45:10.500+02:00\t0.0109026359624273\t 0.789461628278069\n *\n * Example of exported file name format:\n * 04dec231240-06dec232350.xlsx\n */\n async exportSeriesDataToMergedFiles(\n exportData: ExportData[],\n fileType: string,\n mergedExportDetails: MergedExportDetails\n ): Promise<ExportedFile> {\n const fileTypeConfig = this.fileTypesConfigs[fileType];\n\n mergedExportDetails.dateFrom = new Date(mergedExportDetails.dateFrom).toISOString();\n mergedExportDetails.dateTo = new Date(mergedExportDetails.dateTo).toISOString();\n\n const mergedFileContent = this.mergeMapping[fileType](exportData, mergedExportDetails);\n\n const mergedFileNameDateRange = this.utils.getFormattedDateRange(\n mergedExportDetails.dateFrom,\n mergedExportDetails.dateTo\n );\n return {\n fileName: `${mergedFileNameDateRange}.${fileTypeConfig.extension}`,\n fileData: new Blob([await mergedFileContent], { type: fileTypeConfig.mimeType })\n };\n }\n\n /**\n * Zips all created files.\n *\n * @param files - An array of objects containing file names and their respective content as Blobs.\n * @returns A Promise that resolves to a Blob representing the generated zip file.\n */\n async zipFiles(files: ExportedFile[]): Promise<Blob> {\n const zip = new JSZip();\n\n files.forEach(file => {\n zip.file(file.fileName, file.fileData);\n });\n\n return await this.generateZipBlob(zip, FILE_COMPRESSION_TYPES_VALUES.deflate, 9);\n }\n\n /**\n * Exports the given data to CSV or Excel files.\n *\n * @param params - An object containing all the necessary parameters for the export and zip process.\n * @returns A Promise that resolves to a Blob representing the exported file.\n */\n async exportSeriesData(params: SeriesExportParams): Promise<Blob> {\n const { flattenedAndSortedExportData, fileType, mergedExportDetails } = params;\n const exportedMergedFile: ExportedFile = await this.exportSeriesDataToMergedFiles(\n flattenedAndSortedExportData,\n fileType,\n mergedExportDetails\n );\n\n const blob = new Blob([exportedMergedFile.fileData], { type: fileType });\n\n Object.defineProperty(blob, SERIES_DATA_MERGED_FILE_NAME, {\n value: exportedMergedFile.fileName,\n writable: false,\n enumerable: false,\n configurable: true\n });\n\n return blob;\n }\n\n createFileName(source: string | number, fragmentSeries: string, fileExtension: string): string {\n return `${source}_${fragmentSeries}.${fileExtension}`;\n }\n\n /**\n * Generates a zip blob using the provided zip object.\n *\n * @param zip - The zip object used for generating the blob.\n * @param compressionType - The compression type for the zip file. 'STORE' is no compression, 'DEFLATE' is compression.\n * @param compressionLevel - The compression level for the zip file.\n * Level 1 is quickest, 9 is best compressed.\n * @returns A Promise that resolves to a Blob containing the generated zip file.\n */\n private async generateZipBlob(\n zip: JSZip,\n compressionType: FileCompressionTypes = FILE_COMPRESSION_TYPES_VALUES.store,\n compressionLevel = 1\n ): Promise<Blob> {\n const blob = 'blob';\n\n if (compressionType === FILE_COMPRESSION_TYPES_VALUES.store) {\n return await zip.generateAsync({ type: blob });\n }\n return await zip.generateAsync({\n type: blob,\n compression: compressionType,\n compressionOptions: {\n level: compressionLevel\n }\n });\n }\n}\n","import { Component, HostListener, ViewChild } from '@angular/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { CommonModule, ModalLabels, ModalModule } from '@c8y/ngx-components';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { ExportConfig } from '../datapoints-export-selector.model';\nimport { DatapointsExportSelectorFileExporterComponent } from './datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-modal',\n templateUrl: './datapoints-export-selector-modal.component.html',\n standalone: true,\n imports: [CommonModule, DatapointsExportSelectorFileExporterComponent, ModalModule]\n})\nexport class DatapointsExportSelectorModalComponent {\n @ViewChild(DatapointsExportSelectorFileExporterComponent, { static: false })\n private datapointsExportSelectorFileExporterComponent: DatapointsExportSelectorFileExporterComponent;\n\n exportConfig: ExportConfig;\n isDownloadEnabled = false;\n labels: ModalLabels = { ok: gettext('Download'), cancel: gettext('Cancel') };\n\n result: Promise<boolean> = new Promise(resolve => {\n this._close = resolve;\n });\n\n private _close: (value: boolean) => void;\n\n constructor(private bsModalRef: BsModalRef) {}\n\n @HostListener('document:keydown', ['$event'])\n handleKeyboardEvent(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n this.dismiss();\n }\n }\n\n dismiss(): void {\n this._close(false);\n this.bsModalRef.hide();\n }\n\n async exportAndDownload(): Promise<void> {\n await this.datapointsExportSelectorFileExporterComponent.exportAndDownload();\n this.dismiss();\n }\n\n changeDownloadButtonState(isEnabled: boolean): void {\n this.isDownloadEnabled = isEnabled;\n }\n}\n","<c8y-modal\n [title]=\"'Generate export' | translate\"\n [labels]=\"labels\"\n [disabled]=\"!isDownloadEnabled\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"dismiss()\"\n (onClose)=\"exportAndDownload()\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'data-export'\"></span>\n </ng-container>\n <c8y-datapoints-export-selector-file-exporter\n [exportConfig]=\"exportConfig\"\n (onDownloadButtonStateChange)=\"changeDownloadButtonState($event)\"\n ></c8y-datapoints-export-selector-file-exporter>\n</c8y-modal>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { CommonModule, GainsightService } from '@c8y/ngx-components';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { DatapointsExportSelectorModalComponent } from './datapoints-export-selector-modal/datapoints-export-selector-modal.component';\nimport {\n ExportConfig,\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR\n} from './datapoints-export-selector.model';\n\n@Component({\n selector: 'c8y-datapoints-export-selector',\n templateUrl: './datapoints-export-selector.component.html',\n standalone: true,\n imports: [CommonModule, TooltipModule]\n})\nexport class DatapointsExportSelectorComponent {\n /**\n * CSS class for the container element.\n * Defaults to 'd-flex p-t-4 p-b-4' if not provided.\n */\n @Input() containerClass: string;\n /**\n * Configuration for the export selector modal.\n */\n @Input() exportConfig: ExportConfig;\n @Output() isOpen: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n readonly DEFAULT_CSS_STYLE = 'd-flex';\n\n constructor(\n private bsModalService: BsModalService,\n private gainsightService: GainsightService\n ) {}\n\n async openExportModal(): Promise<void> {\n this.gainsightService.triggerEvent(\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EVENTS.EXPORT_SELECTOR,\n {\n action: PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.ACTIONS.OPEN_MODAL,\n component:\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.COMPONENTS.DATAPOINTS_EXPORT_SELECTOR\n }\n );\n\n const exportConfig = this.exportConfig;\n const initialState: Pick<DatapointsExportSelectorModalComponent, 'exportConfig'> = {\n exportConfig\n };\n\n this.isOpen.emit(true);\n const modalRef = this.bsModalService.show(DatapointsExportSelectorModalComponent, {\n class: 'modal-lg',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title',\n initialState,\n ignoreBackdropClick: true\n }).content as DatapointsExportSelectorModalComponent;\n // Result will be 'false' on modal close or dismiss\n this.isOpen.emit(await modalRef.result);\n }\n}\n","<ng-container *ngIf=\"containerClass != 'd-contents'; else actionBarBtn\">\n <div\n class=\"input-group-btn\"\n [ngClass]=\"containerClass || DEFAULT_CSS_STYLE\"\n >\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Generate export' | translate\"\n tooltip=\"{{ 'Generate export' | translate }}\"\n container=\"body\"\n type=\"button\"\n data-cy=\"datapoints-export-selector--open-export-button\"\n (click)=\"openExportModal()\"\n [adaptivePosition]=\"false\"\n [disabled]=\"!exportConfig\"\n [delay]=\"500\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"data-export\"\n ></i>\n </button>\n </div>\n</ng-container>\n\n<ng-template #actionBarBtn>\n <button\n class=\"btn btn-link\"\n type=\"button\"\n (click)=\"openExportModal()\"\n [disabled]=\"!exportConfig\"\n >\n <i c8yIcon=\"data-export\"></i>\n {{ 'Generate export' | translate }}\n </button>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i4.UtilsService","i2.DataProcessingService","i3","i2","i4","takeUntil","i6","i5","i1.UtilsService","i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAM,SAAS,GAAG;AAClB,MAAM,gCAAgC,GAAG;AACzC,MAAM,4BAA4B,GAAG;AA6MrC,MAAM,kBAAkB,GAAG;AAChC,IAAA,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAW;AAC5C,IAAA,OAAO,EAAE,OAAO,CAAC,sBAAsB;;AAGzC;;;;;;;;;;;;;;;;;AAiBG;AACI,MAAM,kBAAkB,GAAG;AAChC,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE;;AAGJ,MAAM,6BAA6B,GAAG;AAC3C,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,OAAO,EAAE;;AAGJ,MAAM,6CAA6C,GAAG;AAC3D,IAAA,MAAM,EAAE;AACN,QAAA,eAAe,EAAE;AAClB,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA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C,cAE9B,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,49BAAA,EAAA;;sBAOrC;;sBAIA;;sBACA;;;AE1BH;;AAEG;;;;"}
1
+ {"version":3,"file":"c8y-ngx-components-datapoints-export-selector.mjs","sources":["../../datapoints-export-selector/datapoints-export-selector.model.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/utils.service.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.service.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-preview/datapoints-export-selector-preview.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-preview/datapoints-export-selector-preview.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-data-scope/datapoints-exports-selector-data-scope.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-data-scope/datapoints-exports-selector-data-scope.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-file-types/datapoints-exports-selector-file-types.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-file-types/datapoints-exports-selector-file-types.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-time-range/datapoints-exports-selector-time-range.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-exports-selector-time-range/datapoints-exports-selector-time-range.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/generators/csv-generator.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/generators/excel-generator.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component.html","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-processing.service.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-modal.component.ts","../../datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-modal.component.html","../../datapoints-export-selector/datapoints-export-selector.component.ts","../../datapoints-export-selector/datapoints-export-selector.component.html","../../datapoints-export-selector/c8y-ngx-components-datapoints-export-selector.ts"],"sourcesContent":["import { gettext } from '@c8y/ngx-components/gettext';\nimport { AggregationOption } from '@c8y/ngx-components';\nimport { Measurement } from './datapoints-export-selector-modal/datapoints-export-selector-file-exporter/utils.service';\nimport { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons';\nexport const HAS_ERROR = 'has-error';\nexport const MEASUREMENTS_PREVIEW_ITEMS_LIMIT = 5;\nexport const SERIES_DATA_MERGED_FILE_NAME = 'seriesDataMergedFileName';\n\n/**\n * Represents counts of datapoints data categorized by their availability and delivery method.\n */\nexport interface DatapointCounts {\n /**\n * The number of datapoints whose data can be directly downloaded\n * through a web browser.\n */\n browserDownloadableCount: number;\n /**\n * The number of datapoints whose data will be sent via email because its record count exceeded 50_000.\n */\n emailDeliverableCount: number;\n /**\n * The number of datapoints whose data cannot be retrieved at all,\n * neither through direct download nor via email because its record count exceeded 1_000_000 API limit.\n */\n nonRetrievableCount: number;\n}\n\n/**\n * Represents a datapoints which number of records exceed a threshold where data will be precessed by a backend.\n */\nexport interface DatapointsExceedingLimit {\n datapointDetail: DatapointDetails;\n totalElements: number;\n}\n\nexport interface DateFetchConfig {\n date: string;\n shouldFetchData: boolean;\n}\n\nexport interface IDataTransformer {\n transformToMergedFormat(data: ExportData[]): TimeSeriesColumnData;\n}\n\nexport interface FileGenerator {\n generateMerged?: (exportData: ExportData[], mergedExportDetails: MergedExportDetails) => BlobPart;\n getFileExtension(): string;\n getMimeType(): string;\n getLabel(): string;\n getIcon(): string;\n getType(): string;\n getTitle(): string;\n getZipName(): string;\n getAcceptType(): string;\n}\n\nexport interface FileTypeMetadata {\n extension: string;\n icon: SupportedIconsSuggestions;\n label: string;\n title: string;\n type: string;\n zipName: string;\n}\n\n/**\n * Represents the data structure, which is used to be transformed into a file (series) or used for a preview (series and measurements).\n */\nexport interface ExportData {\n time?: string | null;\n source: string | number;\n device_name: string;\n fragment_series: string;\n /**\n * Represents the value of a measurement for /measurement data API.\n */\n value?: number | null;\n /**\n * Represents the min value of a measurement for /series data API.\n */\n value_min?: number | null;\n /**\n * Represents the value of a measurement for /series data API.\n * Measurement API data does not contain max value.\n */\n value_max?: number | null;\n unit?: string | null;\n}\n\nexport interface DatapointDetails {\n deviceName?: string;\n source: string | number;\n valueFragmentSeries: string;\n valueFragmentType: string;\n}\n\n/**\n * Represents the data structure, which is used to be\n * transformed into an ExportData.\n */\nexport interface DataToExport extends DatapointDetails {\n unit: string | undefined;\n timeValueMap: { [timestamp: string]: Measurement } | undefined;\n}\n/**\n * Represents the data to be exported along with the backend-created file.\n * Only measurements API generates a file on the backend.\n */\nexport interface DataToExportWithBackendCreatedFile {\n source: string | number;\n valueFragmentSeries: string;\n valueFragmentType: string;\n fetchedMeasurementsBlobFile: Blob;\n}\n/**\n * Base configuration for the export process.\n */\nexport interface ExportConfig {\n aggregation?: AggregationOption;\n datapointDetails: DatapointDetails[];\n dateFrom: string;\n dateTo: string;\n}\n/**\n * Represents the configuration on the basis of which the zip file is created.\n */\nexport interface FileExportConfig {\n fileType: string;\n zipName: string;\n}\n/**\n * Represents a required config properties used in a process of generating a measurements based export file.\n */\nexport interface MeasurementFileConfig {\n exportConfig: ExportConfig;\n acceptFileType: string;\n}\n/**\n * Represents a required config properties along with transformed data structures,\n * used in a process of generating a series based export file.\n */\nexport interface SeriesExportParams {\n flattenedAndSortedExportData: ExportData[];\n fileType: string;\n mergedExportDetails: MergedExportDetails;\n}\n\nexport interface TimeSeriesColumnData {\n timeSeries: Map<TimeStamp, ColumnValueMap>;\n uniqueColumnIdentifiers: string[];\n}\n/**\n * Represents a mapping of datapoints series values.\n * The key of the map is a source, and the value is the value data from requested series.\n */\nexport type DatapointsValuesDataMap = Map<SourceId | number, string[]>;\n\nexport type SourceId = string | number;\n\nexport type FileCompressionTypes = 'STORE' | 'DEFLATE';\n\nexport type TimeSeriesData = {\n [timestamp: string]: Measurement;\n};\n\nexport interface FileTypeConfig {\n extension: string;\n mimeType: string;\n acceptType: string;\n}\n\n/**\n * Represents the details unique for a merged file.\n */\nexport type MergedExportDetails = {\n aggregation: AggregationOption;\n dateFrom: string;\n dateTo: string;\n};\n\nexport type ExportedFile = {\n fileName: string;\n fileData: Blob;\n};\n\nexport type TimeStamp = string;\n\nexport type ReadingValue = number;\n/**\n * Represents the min and max values for a specific timestamp.\n * Both min and max values are available only when using series API.\n */\nexport type MinMaxValues = {\n min: number;\n max: number;\n};\n\n/**\n * Represents a merged export column header,\n * e.g. 'Temperature - 5 -> c8y_Temperature.T [ºC] (max)'\n */\ntype ColumnHeader = string;\n/**\n * Represents a mapping of column headers and their corresponding values.\n * e.g. 'Temperature - 5 -> c8y_Temperature.T [ºC] (max)': 25\n */\nexport type ColumnValueMap = {\n [key: ColumnHeader]: ReadingValue;\n};\n\nexport const EXPORT_MODE_LABELS = {\n FULL: gettext('Full`export type`') as 'Full',\n COMPACT: gettext('Compact`export type`') as 'Compact'\n} as const;\n\n/**\n * Each export type is based on a different API:\n * - COMPACT - series\n * - FULL - measurements\n * All differences between export modes:\n * Compact:\n * Processes up to 5,000 records per data point, or up to the data retention limit (API limit)\n * Creates a single merged file containing all the data\n * Provides minimum and maximum values (API feature)\n * Preview is not available\n * Supports optional data aggregation (API feature)\n * Full:\n * Processes up to 1,000,000 records per data point, or up to the data retention limit (API limit)\n * For exports exceeding 50,000 records, data will be sent via email\n * Creates a compressed ZIP file containing separate data files for each selected data point\n * Preview is available\n * Does not support data aggregation\n */\nexport const EXPORT_MODE_VALUES = {\n full: 'FULL',\n compact: 'COMPACT'\n} as const;\n\nexport const FILE_COMPRESSION_TYPES_VALUES = {\n store: 'STORE',\n deflate: 'DEFLATE'\n} as const;\n\nexport const PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR = {\n EVENTS: {\n EXPORT_SELECTOR: 'exportSelector'\n },\n COMPONENTS: {\n DATAPOINTS_EXPORT_SELECTOR: 'datapoints-export-selector',\n DATAPOINTS_EXPORT_SELECTOR_FILE_EXPORTER: 'datapoints-export-selector-file-exporter'\n },\n ACTIONS: {\n OPEN_MODAL: 'openModal',\n DOWNLOAD_STARTED: 'downloadStarted'\n },\n EXPORT_CONFIG: {\n FULL_EXPORT_TYPE: 'fullExportType',\n COMPACT_EXPORT_TYPE: 'compactExportType'\n }\n} as const;\n","import { Injectable } from '@angular/core';\n\nexport type Measurement = number | { min: number; max: number };\n\nexport interface SeriesInfo {\n unit: string | null | undefined;\n name: string;\n type: string | null | undefined;\n}\n\nexport interface SourceData {\n series: SeriesInfo[];\n values: {\n [timestamp: string]: (Measurement | null)[] | undefined;\n };\n truncated: boolean;\n}\n\nexport interface SourceItem {\n source: string | number;\n data: SourceData;\n}\n\nexport interface TransformedSeries {\n values: { [timestamp: string]: Measurement } | null;\n seriesDetails: SeriesInfo;\n}\n\nexport interface TransformedSource {\n [seriesType: string]: TransformedSeries;\n}\n\nexport interface TransformedData {\n [sourceId: string]: TransformedSource;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class UtilsService {\n transformDataStructure(data: SourceItem[]): TransformedData {\n const result: TransformedData = {};\n\n data.forEach(sourceItem => {\n const { source: sourceId, data: sourceData } = sourceItem;\n result[sourceId] = {};\n\n sourceData.series.forEach((seriesInfo, index) => {\n const { type, name, unit } = seriesInfo;\n /**\n * Unique key to distinguish between different series from same source,\n * e.g.: c8y_Acceleration.accelerationX, c8y_Acceleration.accelerationY, c8y_Acceleration.accelerationZ\n */\n const seriesKey = `${type}.${name}`;\n\n result[sourceId][seriesKey] = {\n values: {},\n seriesDetails: { name, unit, type }\n };\n\n let hasValues = false;\n Object.entries(sourceData.values).forEach(([timestamp, measurements]) => {\n if (!measurements) {\n return;\n }\n const measurement = measurements[index];\n\n if (measurement !== null && measurement !== undefined) {\n result[sourceId][seriesKey].values[timestamp] = measurement;\n hasValues = true;\n }\n });\n\n if (!hasValues) {\n result[sourceId][seriesKey].values = null;\n }\n });\n });\n\n return result;\n }\n\n /**\n * Formats a date range into a specific string format, handling UTC dates correctly.\n *\n * @param fromDate - The start date in ISO format (e.g., \"2023-12-04T12:40:00.000Z\")\n * @param toDate - The end date in ISO format (e.g., \"2023-12-06T23:50:00.000Z\")\n * @returns A string representing the date range in the format \"ddmmmyyhhmm-ddmmmyyhhmm\"\n * where d=day, m=month, y=year, h=hour, m=minute\n *\n * Example\n * ```typescript\n * const fromDate = \"2023-12-04T12:40:00.000Z\";\n * const toDate = \"2023-12-06T23:50:00.000Z\";\n * const formattedRange = getFormattedDateRange(fromDate, toDate);\n * console.log(formattedRange); // Output: \"04dec231240-06dec232350\"\n * ```\n */\n getFormattedDateRange(fromDate: string, toDate: string): string {\n const formatDate = (dateString: string): string => {\n const date = new Date(dateString);\n if (isNaN(date.getTime())) {\n throw new Error(`Invalid date string: ${dateString}`);\n }\n const day = date.getUTCDate().toString().padStart(2, '0');\n const month = date.toLocaleString('en', { month: 'short', timeZone: 'UTC' }).toLowerCase();\n const hours = date.getUTCHours().toString().padStart(2, '0');\n const minutes = date.getUTCMinutes().toString().padStart(2, '0');\n const seconds = date.getUTCSeconds().toString().padStart(2, '0');\n return `${day}${month}${hours}${minutes}${seconds}`;\n };\n\n return `${formatDate(fromDate)}-${formatDate(toDate)}`;\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n aggregationType,\n IFetchResponse,\n IMeasurement,\n IMeasurementFilter,\n IResult,\n IResultList,\n ISeries,\n ISeriesFilter,\n MeasurementService\n} from '@c8y/client';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { AGGREGATION_VALUES, AlertService } from '@c8y/ngx-components';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n DatapointDetails,\n DatapointsExceedingLimit,\n DatapointsValuesDataMap,\n DataToExport,\n DataToExportWithBackendCreatedFile,\n ExportConfig,\n MeasurementFileConfig,\n MEASUREMENTS_PREVIEW_ITEMS_LIMIT,\n TimeSeriesData\n} from '../../datapoints-export-selector.model';\nimport { SourceItem, UtilsService } from './utils.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DataFetchingService {\n constructor(\n private alertService: AlertService,\n private measurementService: MeasurementService,\n private translateService: TranslateService,\n private utilsService: UtilsService\n ) {}\n\n /**\n * Checks if any of measurements requests may exceeded the limit,\n * after which the export data is processed by the backend and the generated CSV/Excel file is sent by email.\n *\n * The threshold is set to 50_000 records in application's core properties (export.data.synchronous.limit).\n *\n * @param exportConfig - The export configuration.\n * @returns A promise that returns an array of objects representing datapoints files that will be sent by email.\n */\n async getDatapointsExceedingLimit(\n exportConfig: ExportConfig\n ): Promise<DatapointsExceedingLimit[]> {\n const backendProcessingLimit = 50_000;\n\n const promises: Promise<DatapointsExceedingLimit>[] = exportConfig.datapointDetails.map(\n async details => {\n try {\n const filter: IMeasurementFilter = {\n dateFrom: exportConfig.dateFrom,\n dateTo: exportConfig.dateTo,\n pageSize: 1,\n source: details.source,\n valueFragmentSeries: details.valueFragmentSeries,\n valueFragmentType: details.valueFragmentType,\n withTotalElements: true\n };\n\n const response = await this.measurementService.list(filter);\n\n if (response?.paging?.totalElements > backendProcessingLimit) {\n return {\n datapointDetail: {\n source: details.source,\n valueFragmentSeries: details.valueFragmentSeries,\n valueFragmentType: details.valueFragmentType\n },\n totalElements: response.paging.totalElements\n };\n } else {\n return null;\n }\n } catch (error) {\n this.alertService.addServerFailure(error);\n return null;\n }\n }\n );\n\n const results: DatapointsExceedingLimit[] = await Promise.all(promises);\n\n const datapointsExceedingLimit = results.filter(result => result !== null);\n\n return datapointsExceedingLimit;\n }\n\n /**\n * Retrieves the message to be displayed when the limit of datapoints is exceeded during file export.\n *\n * @param hasNoExportableData - Indicates if there is no exportable data because the date range of all selected datapoints exceeds 1,000,000 records.\n * @param emailDeliverableCount - The number of datapoint exports that exceed the limit, will be proceeded by the backend and sent by email.\n * @param browserDownloadableCount - The number of datapoint exports that can be downloaded directly.\n * @param skippedDatapointCount - The number of datapoint exports skipped due to exceeding the measurements API limit of 1,000,000 records.\n * @param totalDatapointsSelectedForExportCount - Total number of datapoint selected for exports.\n * @returns The message that can be injected.\n */\n getLimitExceededMessage(\n hasNoExportableData: boolean,\n emailDeliverableCount?: number,\n browserDownloadableCount?: number,\n nonRetrievableCount?: number,\n totalDatapointsSelectedForExportCount?: number\n ): string {\n if (hasNoExportableData) {\n const message = this.translateService.instant(\n gettext(\n `The data for selected datapoint(s) exceed 1,000,000 records, which is the limit for backend processing. To export this data, please reduce the date range.`\n )\n );\n return message;\n }\n\n const message = this.translateService.instant(\n gettext(\n `After clicking \"Download\":<br>\n <ul>\n <li><strong>{{$browserDownloadableCount}}</strong> datapoint(s) exports will be downloaded directly within one file: <em>exported_[csv/excel].zip</em></li>\n <li><strong>{{$emailDeliverableCount}}</strong> datapoint(s) exports require further processing. The files will be sent to you via separate emails once completed, which may take some time.</li>\n <li><strong>{{$nonRetrievableCount}}</strong> datapoint(s) exports exceeded 1,000,000 records, which is the limit for backend processing. To export these data, please reduce the date range. Otherwise, the data will neither be downloaded nor sent via email.</li>\n </ul>\n <p>The total number of data points that can be exported is: <strong>{{$totalExportableDatapointsCount}} out of {{$totalDatapointsSelectedForExportCount}}</strong>.</p>\n <p><strong>Note:</strong> The file name convention of files within zip file is: <code>[source]_[fragment_series].[csv/xls]</code></p>`\n ),\n {\n $browserDownloadableCount: browserDownloadableCount,\n $emailDeliverableCount: emailDeliverableCount,\n $nonRetrievableCount: nonRetrievableCount,\n $totalDatapointsSelectedForExportCount: totalDatapointsSelectedForExportCount,\n $totalExportableDatapointsCount: browserDownloadableCount + emailDeliverableCount\n }\n );\n\n const trimmedMessage = this.removeZeroCountListItems(message, [\n browserDownloadableCount,\n emailDeliverableCount,\n nonRetrievableCount\n ]);\n\n return trimmedMessage;\n }\n\n /**\n * Trims the given HTML message by removing list items that correspond to zero counts.\n *\n * @param message - The HTML string containing the message with list items.\n * @param counts - An array of number values corresponding to each list item.\n * @param countToTrim - A count that will be trimmed with corresponding list item.\n * @returns A trimmed HTML string with list items removed where the corresponding count is zero.\n *\n * Example:\n * ```typescript\n * const message = '<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul>';\n * const counts = [1, 0, 2];\n * const trimmedMessage = this.removeZeroCountListItems(message, counts);\n * // Result: '<ul><li>Item 1</li><li>Item 3</li></ul>'\n * ```\n */\n removeZeroCountListItems(message: string, counts: number[], countToTrim = 0): string {\n const parser = new DOMParser();\n const doc = parser.parseFromString(message, 'text/html');\n const listItems = doc.querySelectorAll('ul li');\n\n listItems.forEach((item, index) => {\n if (counts[index] === countToTrim) {\n item.remove();\n }\n });\n\n return doc.body.innerHTML;\n }\n\n /**\n * Displays an information alert about sending data via email.\n *\n * Only measurements API can send files via email.\n *\n * @param fileType - The type of file to be sent.\n * @param datapointsExceedingLimit - The array of datapoints exceeding the limit.\n */\n showSendViaEmailInfoAlert(\n fileType: string,\n datapointsExceedingLimit: DatapointsExceedingLimit[]\n ): void {\n const messageTemplate = this.translateService.instant(\n gettext(`You will get {{$fileTypeText}} file(s) for {{$count}} series via email.`),\n { $count: datapointsExceedingLimit.length, $fileTypeText: fileType }\n );\n const formattedList = datapointsExceedingLimit\n .map(\n datapoint =>\n `• ${datapoint.datapointDetail.source}_${datapoint.datapointDetail.valueFragmentType}_${datapoint.datapointDetail.valueFragmentSeries}`\n )\n .join('\\n');\n\n this.alertService.info(messageTemplate, formattedList);\n }\n\n async fetchMeasurementDataFilesAndPairWithSourceDetails(\n acceptFileType: string,\n exportConfig: ExportConfig\n ): Promise<DataToExportWithBackendCreatedFile[]> {\n const measurementFileConfig: MeasurementFileConfig = {\n exportConfig,\n acceptFileType\n };\n const filePromises = exportConfig.datapointDetails.map(details =>\n this.fetchAndProcessMeasurementFile(details, measurementFileConfig)\n );\n return Promise.all(filePromises);\n }\n\n async fetchAndProcessMeasurementFile(\n details: DatapointDetails,\n measurementFileConfig: MeasurementFileConfig,\n roundSeconds = false\n ): Promise<DataToExportWithBackendCreatedFile | undefined> {\n const filter: IMeasurementFilter = this.prepareMeasurementsFilter(\n details,\n measurementFileConfig.exportConfig,\n roundSeconds\n );\n const header = { accept: measurementFileConfig.acceptFileType };\n\n try {\n const measurementFileResponse: IFetchResponse =\n await this.measurementService.getMeasurementsFile(filter, header);\n\n // If the status is 200, then the file is in the response.\n // If the status is 202, then the file is being processed by the backend and will be sent by email.\n if (measurementFileResponse.status === 200) {\n return this.mergeMeasurementsWithItsSourceDetails(details, measurementFileResponse);\n }\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n }\n\n async mergeMeasurementsWithItsSourceDetails(\n details: DatapointDetails,\n measurementFile: IFetchResponse\n ): Promise<DataToExportWithBackendCreatedFile> {\n return {\n source: details.source,\n valueFragmentSeries: details.valueFragmentSeries,\n valueFragmentType: details.valueFragmentType,\n fetchedMeasurementsBlobFile: await measurementFile.blob()\n };\n }\n\n async fetchAndPrepareDataToExport(\n exportConfig: ExportConfig,\n isMeasurement: boolean\n ): Promise<DataToExport[]> {\n return isMeasurement\n ? await this.fetchAndPrepareMeasurementDataToExportForPreview(exportConfig)\n : await this.fetchAndPrepareSeriesDataToExport(exportConfig);\n }\n\n prepareMeasurementsFilter(\n details: DatapointDetails,\n exportConfig: ExportConfig,\n roundSeconds: boolean,\n pageSize?: number\n ): IMeasurementFilter {\n const filter: IMeasurementFilter = {\n dateFrom: this.adjustDate(exportConfig.dateFrom, 0, roundSeconds),\n dateTo: this.adjustDate(exportConfig.dateTo, 0, roundSeconds),\n source: details.source,\n valueFragmentSeries: details.valueFragmentSeries,\n valueFragmentType: details.valueFragmentType\n };\n\n if (pageSize) {\n filter.pageSize = pageSize;\n }\n\n return filter;\n }\n\n processMeasurementDataForPreview(details: DatapointDetails, data: IMeasurement[]): DataToExport {\n const unit = data[0][details.valueFragmentType][details.valueFragmentSeries]?.unit || '';\n\n const values: { [timestamp: string]: number } = {};\n data.forEach(measurement => {\n values[measurement.time] =\n measurement[details.valueFragmentType][details.valueFragmentSeries].value;\n });\n\n return { ...details, unit, timeValueMap: values };\n }\n\n /**\n * Returns a map of active data points device IDs with their corresponding series.\n *\n * Example output:\n * ```typescript\n * new Map([\n * ['844657202', ['c8y_Temperature.T']],\n * ['32666427', ['c8y_Battery.Battery']]\n * ]);\n * ```\n * @param datapointDetails - An array of data points details.\n * @returns A map where the key is the data point ID and the value is an array of data point series.\n */\n groupSeriesByDeviceId(datapointDetails: DatapointDetails[]): DatapointsValuesDataMap {\n return datapointDetails.reduce(\n (\n map: DatapointsValuesDataMap,\n { valueFragmentType, valueFragmentSeries, source }: DatapointDetails\n ) => {\n const value = `${valueFragmentType}.${valueFragmentSeries}`;\n const existingValue = map.get(source) ?? [];\n map.set(source, [...existingValue, value]);\n return map;\n },\n new Map<string, string[]>()\n );\n }\n\n /**\n * Processes the fetched series data and prepares it for export.\n *\n * @param datapointDetails - An array of data point details.\n * @param fetchedDataMap - A map of fetched series data grouped by source.\n * @returns An array of DataToExport objects.\n */\n processSeriesData(\n datapointDetails: DatapointDetails[],\n fetchedDataMap: SourceItem[]\n ): DataToExport[] {\n const valuesGroupedBySource = this.utilsService.transformDataStructure(fetchedDataMap);\n\n return datapointDetails.map((details: DatapointDetails) => {\n let unit: string | undefined;\n let data: TimeSeriesData;\n\n /**\n * Unique key to distinguish between different series from same source,\n * e.g.: c8y_Acceleration.accelerationX, c8y_Acceleration.accelerationY, c8y_Acceleration.accelerationZ\n */\n const seriesKey = `${details.valueFragmentType}.${details.valueFragmentSeries}`;\n\n if (valuesGroupedBySource[details.source][seriesKey]) {\n unit = valuesGroupedBySource[details.source][seriesKey].seriesDetails.unit;\n data = valuesGroupedBySource[details.source][seriesKey].values;\n }\n\n return {\n ...details,\n unit,\n timeValueMap: data\n };\n });\n }\n\n async getSourcesWithPermissionsToRead(datapointDetails: DatapointDetails[]): Promise<string[]> {\n const dateFrom = new Date();\n const dateTo = new Date(dateFrom);\n\n const fetchedDataPromises = datapointDetails.map(async datapoint => {\n const rawFilter: ISeriesFilter = {\n dateFrom,\n dateTo,\n source: datapoint.source\n };\n\n try {\n const { res }: IResult<ISeries> = await this.fetchSeriesData(rawFilter);\n if (res?.status === 200) {\n return datapoint.source;\n }\n return null;\n } catch (error) {\n // If an error occurs during fetch, return null to prevent promise rejection\n return null;\n }\n });\n\n const fetchedSources = await Promise.all(fetchedDataPromises);\n return fetchedSources.filter((source): source is string => source !== null);\n }\n\n /**\n * Adjusts the given date by adding the specified number of minutes and setting seconds to 0.\n *\n * @param date - The date to be adjusted in string format.\n * @param minutes - The number of minutes to add to the date.\n * @param roundSeconds - Whether to round the seconds or not.\n * If true, the seconds will be rounded to 0.\n * If false, the seconds will be displayed as they are.\n * @returns The adjusted date in ISO string format.\n */\n adjustDate(date: string | Date, minutes: number, roundSeconds = true): string {\n const dateTime = new Date(date);\n if (isNaN(dateTime.getTime())) {\n throw new Error('Invalid date');\n }\n\n dateTime.setUTCMinutes(dateTime.getUTCMinutes() + minutes);\n if (roundSeconds) {\n dateTime.setUTCSeconds(0, 0);\n }\n\n return dateTime.toISOString();\n }\n\n /**\n * Asynchronously loads series data based on the provided parameters.\n *\n * This method constructs a filter for retrieving series data within a specified date range,\n * from a specific source, and optionally applying an aggregation type.\n *\n * @param rawFilter - The parameters for loading series data, including date range, source, series names, and aggregation type.\n * @param roundSeconds - Indicates whether to round the seconds in the date range to the nearest whole number.\n * @returns A promise that resolves to series data wrapped in result object.\n */\n async fetchSeriesData(\n rawFilter: ISeriesFilter,\n roundSeconds = false\n ): Promise<IResult<ISeries>> | undefined {\n let seriesData: IResult<ISeries> | undefined;\n\n const filter: ISeriesFilter = this.prepareSeriesFilter(\n {\n dateFrom: rawFilter.dateFrom,\n dateTo: rawFilter.dateTo,\n source: rawFilter.source,\n series: rawFilter.series,\n aggregationType: rawFilter.aggregationType\n },\n roundSeconds\n );\n\n try {\n seriesData = await this.measurementService.listSeries(filter);\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n\n if (seriesData?.res?.status === 422) {\n throw {\n status: seriesData.res.status,\n message: seriesData.data['message'],\n data: seriesData.data\n };\n }\n\n return seriesData;\n }\n\n /**\n * Fetches and prepares measurement data for preview.\n *\n * Empty DataToExport object can be returned, because unlike series data,\n * measurement data is not further processed besides showing only in the preview.\n * CSV/Excel files are generated by the backend for measurements.\n *\n * @param exportConfig - The export configuration.\n * @param roundSeconds - Indicates whether to round the seconds in the date range to the nearest whole number.\n * @returns A promise that resolves to an array of DataToExport objects or null when no data is fetched.\n */\n private async fetchAndPrepareMeasurementDataToExportForPreview(\n exportConfig: ExportConfig,\n roundSeconds = false\n ): Promise<DataToExport[]> | null {\n const dataToExportPromises: Promise<DataToExport>[] = exportConfig.datapointDetails.map(\n async details => {\n const fetchedMeasurementData: IResultList<IMeasurement> =\n await this.fetchMeasurementDataForPreview(details, exportConfig, roundSeconds);\n\n if (fetchedMeasurementData?.data?.length) {\n return this.processMeasurementDataForPreview(details, fetchedMeasurementData.data);\n }\n return null;\n }\n );\n\n return await Promise.all(dataToExportPromises);\n }\n\n private async fetchMeasurementDataForPreview(\n details: DatapointDetails,\n exportConfig: ExportConfig,\n roundSeconds: boolean\n ): Promise<IResultList<IMeasurement>> | undefined {\n let measurements: IResultList<IMeasurement> | undefined;\n\n const filter: IMeasurementFilter = this.prepareMeasurementsFilter(\n details,\n exportConfig,\n roundSeconds,\n MEASUREMENTS_PREVIEW_ITEMS_LIMIT\n );\n\n try {\n measurements = await this.measurementService.list(filter);\n } catch (error) {\n this.alertService.addServerFailure(error);\n }\n\n return measurements;\n }\n\n private async fetchAndPrepareSeriesDataToExport(exportConfig: ExportConfig) {\n const datapointsValuesDataMap: DatapointsValuesDataMap = this.groupSeriesByDeviceId(\n exportConfig.datapointDetails\n );\n\n const fetchedDataPromises = Array.from(datapointsValuesDataMap).map(\n async ([source, series]) => {\n const { dateFrom, dateTo, aggregation } = exportConfig;\n\n const rawFilter: ISeriesFilter = {\n dateFrom,\n dateTo,\n source,\n series,\n aggregationType: aggregation as aggregationType\n };\n\n const { data }: IResult<ISeries> = await this.fetchSeriesData(rawFilter);\n\n return { source, data };\n }\n );\n\n const fetchedDataGroupedBySource: SourceItem[] = await Promise.all(fetchedDataPromises);\n\n return this.processSeriesData(exportConfig.datapointDetails, fetchedDataGroupedBySource);\n }\n\n private prepareSeriesFilter(filters: ISeriesFilter, roundSeconds: boolean): ISeriesFilter {\n const { dateFrom, dateTo, source, series, aggregationType } = filters;\n const from = this.adjustDate(dateFrom, 0, roundSeconds);\n const to = this.adjustDate(dateTo, 0, roundSeconds);\n\n const filter: ISeriesFilter = {\n dateFrom: from,\n dateTo: to,\n source: source,\n revert: true\n };\n\n // The 'NONE' aggregation type is not handled by a backend, so even when is selected, it is not passed as a filter parameter.\n if (aggregationType && aggregationType !== (AGGREGATION_VALUES.none as aggregationType)) {\n filter.aggregationType = aggregationType;\n }\n\n if (series) {\n filter.series = series;\n }\n\n return filter;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { AlertService } from '@c8y/ngx-components';\nimport { TranslateService } from '@ngx-translate/core';\nimport {\n DataToExport,\n DataToExportWithBackendCreatedFile,\n ExportData,\n ExportedFile,\n MergedExportDetails,\n SeriesExportParams\n} from '../../datapoints-export-selector.model';\nimport { DataProcessingService } from './data-processing.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DatapointsExportSelectorFileExporterService {\n /**\n * Cached data is reused when both CSV and Excel files were selected for export, used for merged file.\n */\n private cachedFlatteredAndSortedSeriesExportData: ExportData[];\n /**\n * Cached data is reused when both CSV and Excel files were selected for export, used for raw files.\n */\n private cachedRawExportSeriesData: ExportData[][];\n\n constructor(\n private alertService: AlertService,\n private datapointsExportSelectorDataProcessingService: DataProcessingService,\n private translateService: TranslateService\n ) {}\n\n async getMeasurementExportedDataBlob(\n extension: string,\n dataToExport: DataToExportWithBackendCreatedFile[]\n ): Promise<Blob | null> {\n try {\n return await this.getMeasurementDataZipBlob(\n extension,\n dataToExport as DataToExportWithBackendCreatedFile[]\n );\n } catch (error) {\n this.showZipCreationErrorAlert();\n\n return null;\n }\n }\n\n async getSeriesExportedDataBlob(\n fileType: string,\n dataToExport: DataToExport[],\n mergedExportDetails: MergedExportDetails\n ): Promise<Blob | null> {\n try {\n return await this.getSeriesDataBlob(\n fileType,\n dataToExport as DataToExport[],\n mergedExportDetails\n );\n } catch (error) {\n this.showZipCreationErrorAlert();\n\n return null;\n }\n }\n\n cleanupCachedData(): void {\n this.cachedRawExportSeriesData = null;\n this.cachedFlatteredAndSortedSeriesExportData = null;\n }\n\n private showZipCreationErrorAlert(): void {\n const alertMessage = this.translateService.instant(gettext('Could not create zip file.'));\n this.alertService.danger(alertMessage);\n\n return null;\n }\n\n private getMeasurementDataZipBlob(\n extension: string,\n dataToExportWithBackendCreatedFile: DataToExportWithBackendCreatedFile[]\n ): Promise<Blob | null> {\n const files: ExportedFile[] = [];\n\n this.createRawMeasurementExportedFiles(dataToExportWithBackendCreatedFile, extension, files);\n\n return this.datapointsExportSelectorDataProcessingService.zipFiles(files);\n }\n\n private createRawMeasurementExportedFiles(\n dataToExportWithBackendCreatedFile: DataToExportWithBackendCreatedFile[],\n fileExtension: string,\n files: ExportedFile[]\n ): void {\n dataToExportWithBackendCreatedFile.forEach(data => {\n if (data) {\n const fragmentSeries = `${data.valueFragmentType}_${data.valueFragmentSeries}`;\n\n const fileName = this.datapointsExportSelectorDataProcessingService.createFileName(\n data.source,\n fragmentSeries,\n fileExtension\n );\n\n const fileData = data.fetchedMeasurementsBlobFile;\n\n const exportedFile: ExportedFile = { fileName, fileData };\n\n files.push(exportedFile);\n }\n });\n }\n\n /**\n * Converts data to a specified file type and returns the generated blob.\n *\n * Unlike measurements, data must be transformed to an exportable file structure before exporting.\n *\n * @param fileType - The type of file to which the data points should be exported. This can be 'csv' or 'excel'.\n * @param dataToExport - An array of processed measurement data combined with the respective properties of the datapoint.\n * @param mergedExportDetails - The details for the merged export, contains date range and aggregation.\n * @returns A promise that resolves to the generated ZIP blob or null if an error occurs.\n */\n private async getSeriesDataBlob(\n fileType: string,\n dataToExport: DataToExport[],\n mergedExportDetails: MergedExportDetails\n ): Promise<Blob | null> {\n this.transformSeriesDataToExportableFileStructure(dataToExport);\n\n const exportParams: SeriesExportParams = {\n flattenedAndSortedExportData: this.cachedFlatteredAndSortedSeriesExportData,\n fileType,\n mergedExportDetails: mergedExportDetails\n };\n\n return await this.datapointsExportSelectorDataProcessingService.exportSeriesData(exportParams);\n }\n\n private transformSeriesDataToExportableFileStructure(dataToExport: DataToExport[]): void {\n if (!this.cachedRawExportSeriesData) {\n this.cachedRawExportSeriesData =\n this.datapointsExportSelectorDataProcessingService.transformToExportFileStructure(\n dataToExport\n );\n this.cachedFlatteredAndSortedSeriesExportData = this.cachedRawExportSeriesData\n .flat()\n .sort((a, b) => {\n return new Date(a.time).getTime() - new Date(b.time).getTime();\n });\n }\n }\n}\n","import { A11yModule } from '@angular/cdk/a11y';\nimport { Component, Input } from '@angular/core';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport {\n ExportData,\n MEASUREMENTS_PREVIEW_ITEMS_LIMIT\n} from '../../../datapoints-export-selector.model';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-preview',\n templateUrl: './datapoints-export-selector-preview.component.html',\n standalone: true,\n imports: [A11yModule, CoreModule, PopoverModule]\n})\nexport class DataPointsExportSelectorPreviewComponent {\n @Input() hasFetchedDataAnyValuesToExport: boolean;\n @Input() isPreviewLoading: boolean;\n @Input() previewTableData: ExportData[];\n\n readonly MEASUREMENTS_PREVIEW_ITEMS_LIMIT = MEASUREMENTS_PREVIEW_ITEMS_LIMIT;\n}\n","<div class=\"p-t-16 p-l-16 p-r-16 m-b-0\">\n <div class=\"d-flex a-i-center\">\n <label\n class=\"m-b-0 d-flex a-i-center gap-4\"\n [title]=\"'Preview`of exported file`' | translate\"\n >\n {{ 'Preview`of exported file`' | translate }}\n <button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"popoverPreviewTemplate\"\n placement=\"right\"\n triggers=\"focus\"\n data-cy=\"preview--help\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n <ng-template #popoverPreviewTemplate>\n <span translate>\n <p>The preview shows the structure of the raw file from a single source.</p>\n <p>If no data is available, only the column headers are visible.</p>\n <p>\n The preview is limited to\n <b>{{ MEASUREMENTS_PREVIEW_ITEMS_LIMIT }}</b>\n records.\n </p>\n </span>\n </ng-template>\n </label>\n </div>\n <div\n class=\"table-responsive\"\n style=\"min-height: 275px\"\n >\n <table class=\"table\">\n <thead>\n <tr>\n <th>{{ 'Time' | translate }}</th>\n <th>{{ 'Source' | translate }}</th>\n <th>{{ 'Device name' | translate }}</th>\n <th>\n {{ 'Fragment and series' | translate }}\n </th>\n <th>{{ 'Value' | translate }}</th>\n <th>{{ 'Unit' | translate }}</th>\n </tr>\n </thead>\n <ng-container *ngIf=\"hasFetchedDataAnyValuesToExport || isPreviewLoading; else emptyState\">\n <ng-container *ngIf=\"!isPreviewLoading; else loading\">\n <tbody>\n <tr *ngFor=\"let row of previewTableData\">\n <td>{{ row.time }}</td>\n <td>{{ row.source }}</td>\n <td>{{ row.device_name }}</td>\n <td>\n {{ row.fragment_series }}\n </td>\n <td>{{ row.value }}</td>\n <td>{{ row.unit }}</td>\n </tr>\n </tbody>\n </ng-container>\n </ng-container>\n <ng-template #emptyState>\n <tbody>\n <tr>\n <td colspan=\"8\">\n <div class=\"d-col a-i-center\">\n <c8y-ui-empty-state\n [icon]=\"'search'\"\n [title]=\"'No data available.' | translate\"\n [horizontal]=\"true\"\n data-cy=\"datapoints-table-list--empty-state\"\n ></c8y-ui-empty-state>\n </div>\n </td>\n </tr>\n </tbody>\n </ng-template>\n <ng-template #loading>\n <tbody>\n <tr>\n <td colspan=\"8\">\n <c8y-loading></c8y-loading>\n </td>\n </tr>\n </tbody>\n </ng-template>\n </table>\n </div>\n</div>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CoreModule } from '@c8y/ngx-components';\nimport {\n AGGREGATION_LABELS,\n AGGREGATION_VALUES_ARR,\n AggregationOption,\n AggregationOptionStatus\n} from '@c8y/ngx-components/global-context';\nimport { PopoverModule } from 'ngx-bootstrap/popover';\nimport { EXPORT_MODE_LABELS, EXPORT_MODE_VALUES } from '../../../datapoints-export-selector.model';\nimport { DatapointsExportSelectorFileExporterComponent } from '../datapoints-export-selector-file-exporter.component';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-data-scope',\n templateUrl: './datapoints-exports-selector-data-scope.component.html',\n standalone: true,\n imports: [CoreModule, FormsModule, PopoverModule]\n})\nexport class DataPointsExportSelectorDataScopeComponent {\n @Input() disabledAggregationOptions: AggregationOptionStatus;\n @Input() formGroup: ReturnType<DatapointsExportSelectorFileExporterComponent['createForm']>;\n @Output() onAggregationChange: EventEmitter<AggregationOption> =\n new EventEmitter<AggregationOption>();\n @Output() onExportTypeChange: EventEmitter<string> = new EventEmitter<string>();\n\n readonly AGGREGATION_LABELS = AGGREGATION_LABELS;\n readonly AGGREGATION_VALUES_ARR = AGGREGATION_VALUES_ARR;\n readonly EXPORT_MODE_LABELS = EXPORT_MODE_LABELS;\n readonly EXPORT_MODE_VALUES_ARR = [EXPORT_MODE_VALUES.full, EXPORT_MODE_VALUES.compact] as const;\n\n emitAggregationChange(aggregation: AggregationOption): void {\n this.onAggregationChange.emit(aggregation);\n }\n\n emitExportTypeChange(exportType: string): void {\n this.onExportTypeChange.emit(exportType);\n }\n}\n","<fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex a-i-center\">\n {{ 'Data scope' | translate }}\n <button\n class=\"btn-help\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"popoverDataScopeTemplate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n data-cy=\"data-scope--help\"\n [adaptivePosition]=\"true\"\n ></button>\n <ng-template #popoverDataScopeTemplate>\n <p\n class=\"m-b-8\"\n translate\n >\n Choose export type from available options:\n </p>\n <p><strong translate>Compact</strong></p>\n <ul class=\"p-l-16\">\n <li translate>Up to 5,000 records per data point or data retention limit</li>\n <li translate>Single merged file for all data</li>\n <li translate>No preview available</li>\n <li translate>Optional data aggregation supported</li>\n </ul>\n <p><strong translate>Full</strong></p>\n <ul class=\"p-l-16\">\n <li translate>Up to 1,000,000 records per data point or data retention limit</li>\n <li translate>Email delivery if exceeds 50,000 records</li>\n <li translate>Separate files for each data point in ZIP format</li>\n <li translate>Preview available</li>\n <li translate>No data aggregation</li>\n </ul>\n </ng-template>\n </legend>\n <c8y-form-group class=\"m-b-8\">\n <label>\n {{ 'Export mode' | translate }}\n </label>\n <div\n class=\"c8y-select-wrapper\"\n [formGroup]=\"formGroup\"\n data-cy=\"data-scope--export-selector\"\n >\n <select\n class=\"form-control text-12\"\n [title]=\"'Export mode' | translate\"\n id=\"exportMode\"\n formControlName=\"exportMode\"\n (ngModelChange)=\"emitExportTypeChange($event)\"\n >\n <option\n *ngFor=\"let exportModeValue of EXPORT_MODE_VALUES_ARR\"\n [ngValue]=\"exportModeValue\"\n >\n {{ EXPORT_MODE_LABELS[exportModeValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n <c8y-form-group class=\"m-b-8\">\n <label>\n {{ 'Aggregation' | translate }}\n </label>\n <div\n class=\"c8y-select-wrapper\"\n [formGroup]=\"formGroup\"\n data-cy=\"data-scope--aggregation-selector\"\n >\n <select\n class=\"form-control text-12\"\n [title]=\"'Aggregation' | translate\"\n id=\"aggregation\"\n formControlName=\"aggregation\"\n (ngModelChange)=\"emitAggregationChange($event)\"\n >\n <option\n *ngFor=\"let aggregationValue of AGGREGATION_VALUES_ARR\"\n [ngValue]=\"aggregationValue\"\n [disabled]=\"disabledAggregationOptions[aggregationValue]\"\n >\n {{ AGGREGATION_LABELS[aggregationValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n</fieldset>\n","import { Component, Input } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { FileTypeMetadata } from '../../../datapoints-export-selector.model';\nimport { DatapointsExportSelectorFileExporterComponent } from '../datapoints-export-selector-file-exporter.component';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-file-types',\n templateUrl: './datapoints-exports-selector-file-types.component.html',\n standalone: true,\n imports: [CoreModule, FormsModule]\n})\nexport class DataPointsExportSelectorFileTypesComponent {\n @Input() dynamicFilesTypeMetadata: { [key: string]: FileTypeMetadata } = {};\n @Input() formGroup: ReturnType<DatapointsExportSelectorFileExporterComponent['createForm']>;\n}\n","<fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex a-i-center\">{{ 'File types' | translate }}</legend>\n <div [formGroup]=\"formGroup\">\n <div formGroupName=\"fileTypes\">\n <c8y-form-group\n class=\"m-b-8\"\n *ngFor=\"let item of dynamicFilesTypeMetadata | keyvalue\"\n >\n <label\n class=\"c8y-checkbox m-t-0\"\n title=\"{{ item.value.title }}\"\n >\n <input\n type=\"checkbox\"\n formControlName=\"{{ item.key }}\"\n />\n <span></span>\n <i\n class=\"m-l-8 m-r-4\"\n c8yIcon=\"{{ item.value.icon }}\"\n ></i>\n <span>{{ item.value.label | translate }}</span>\n </label>\n </c8y-form-group>\n </div>\n </div>\n</fieldset>\n","import { Component, EventEmitter, Input, Output, OnInit, OnDestroy } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { CoreModule } from '@c8y/ngx-components';\nimport { HAS_ERROR } from '../../../datapoints-export-selector.model';\nimport { DatapointsExportSelectorFileExporterComponent } from '../datapoints-export-selector-file-exporter.component';\nimport { Subject } from 'rxjs';\nimport { skip, takeUntil } from 'rxjs/operators';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-time-range',\n templateUrl: './datapoints-exports-selector-time-range.component.html',\n standalone: true,\n imports: [CoreModule, FormsModule]\n})\nexport class DataPointsExportSelectorTimeRangeComponent implements OnInit, OnDestroy {\n @Input() formGroup: ReturnType<DatapointsExportSelectorFileExporterComponent['createForm']>;\n @Output() onDateFromChange: EventEmitter<string> = new EventEmitter<string>();\n @Output() onDateToChange: EventEmitter<string> = new EventEmitter<string>();\n\n private destroy$ = new Subject<void>();\n\n readonly DATE_FROM = 'dateFrom';\n readonly DATE_TO = 'dateTo';\n readonly FROM_DATE = gettext('From`date`');\n readonly HAS_ERROR = HAS_ERROR;\n readonly INVALID_DATE_TIME = 'invalidDateTime';\n readonly THIS_DATE_IS_INVALID = gettext('This date is invalid.');\n readonly THIS_DATE_IS_AFTER_THE_LAST_ALLOWED_DATE = gettext(\n 'This date is after the latest allowed date.'\n );\n readonly THIS_DATE_IS_BEFORE_THE_EARLIEST_ALLOWED_DATE = gettext(\n 'This date is before the earliest allowed date.'\n );\n readonly TO_DATE = gettext('To`date`');\n\n ngOnInit(): void {\n if (this.formGroup?.controls?.dateFrom) {\n this.formGroup.controls.dateFrom.valueChanges\n // Skip the first value emitted by the observable to avoid overriding the initial value while form is being created\n .pipe(skip(1), takeUntil(this.destroy$))\n .subscribe((updatedDate: string) => this.onDateFromChange.emit(updatedDate));\n }\n if (this.formGroup?.controls?.dateTo) {\n this.formGroup.controls.dateTo.valueChanges\n // Skip the first value emitted by the observable to avoid overriding the initial value while form is being created\n .pipe(skip(1), takeUntil(this.destroy$))\n .subscribe((updatedDate: string) => this.onDateToChange.emit(updatedDate));\n }\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n}\n","<fieldset class=\"c8y-fieldset\">\n <legend>{{ 'Time range' | translate }}</legend>\n <c8y-form-group\n class=\"m-b-8\"\n [ngClass]=\"formGroup.controls.dateFrom.errors ? HAS_ERROR : ''\"\n >\n <label\n [title]=\"FROM_DATE | translate\"\n [for]=\"DATE_FROM\"\n >\n {{ FROM_DATE | translate }}\n </label>\n <div>\n <c8y-date-time-picker\n id=\"DATE_FROM\"\n [maxDate]=\"formGroup.value.dateTo\"\n [placeholder]=\"FROM_DATE | translate\"\n [formControl]=\"formGroup.controls.dateFrom\"\n [ngClass]=\"formGroup.controls.dateFrom.errors ? HAS_ERROR : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"formGroup.controls.dateFrom.errors\">\n <c8y-message\n name=\"dateAfterRangeMax\"\n [text]=\"THIS_DATE_IS_AFTER_THE_LAST_ALLOWED_DATE | translate\"\n ></c8y-message>\n <c8y-message\n name=\"INVALID_DATE_TIME\"\n [text]=\"THIS_DATE_IS_INVALID | translate\"\n ></c8y-message>\n </c8y-messages>\n </div>\n </c8y-form-group>\n <c8y-form-group\n class=\"m-b-8\"\n [ngClass]=\"formGroup.controls.dateTo.errors ? HAS_ERROR : ''\"\n >\n <label\n [title]=\"TO_DATE | translate\"\n [for]=\"DATE_TO\"\n >\n {{ TO_DATE | translate }}\n </label>\n <div>\n <c8y-date-time-picker\n id=\"DATE_TO\"\n [minDate]=\"formGroup.value.dateFrom\"\n [placeholder]=\"TO_DATE | translate\"\n [formControl]=\"formGroup.controls.dateTo\"\n [ngClass]=\"formGroup.controls.dateTo.errors ? HAS_ERROR : ''\"\n ></c8y-date-time-picker>\n <c8y-messages [show]=\"formGroup.controls.dateTo.errors\">\n <c8y-message\n name=\"dateBeforeRangeMin\"\n [text]=\"THIS_DATE_IS_BEFORE_THE_EARLIEST_ALLOWED_DATE | translate\"\n ></c8y-message>\n <c8y-message\n name=\"INVALID_DATE_TIME\"\n [text]=\"THIS_DATE_IS_INVALID | translate\"\n ></c8y-message>\n </c8y-messages>\n </div>\n </c8y-form-group>\n</fieldset>\n","import { gettext } from '@c8y/ngx-components/gettext';\nimport {\n ExportData,\n FileGenerator,\n IDataTransformer,\n MergedExportDetails,\n TimeSeriesColumnData\n} from '../../../datapoints-export-selector.model';\n\ninterface ICsvFileCreator {\n createFile(content: string, mimeType: string): Promise<Blob>;\n}\n\nclass CSVDataTransformer implements IDataTransformer {\n transformToMergedFormat(exportData: ExportData[]): TimeSeriesColumnData {\n const timeSeries = new Map<string, Record<string, number>>();\n const uniqueColumnIdentifiers = new Set<string>();\n\n exportData.forEach(\n ({ time, device_name, fragment_series, unit, value_min, value_max, source }) => {\n const measurementIdentifier = this.createMeasurementIdentifier(\n device_name,\n fragment_series,\n unit,\n source\n );\n\n if (!timeSeries.has(time)) {\n timeSeries.set(time, {});\n }\n\n const timeEntry = timeSeries.get(time);\n if (timeEntry) {\n const minKey = this.formatMinKey(measurementIdentifier);\n const maxKey = this.formatMaxKey(measurementIdentifier);\n\n timeEntry[minKey] = value_min;\n timeEntry[maxKey] = value_max;\n\n uniqueColumnIdentifiers.add(minKey);\n uniqueColumnIdentifiers.add(maxKey);\n }\n }\n );\n\n return {\n timeSeries,\n uniqueColumnIdentifiers: Array.from(uniqueColumnIdentifiers)\n };\n }\n\n private createMeasurementIdentifier(\n deviceName: string,\n fragmentSeries: string,\n unit: string,\n source: string | number\n ): string {\n return unit\n ? `(${source}) ${deviceName} -> ${fragmentSeries} [${unit}]`\n : `(${source}) ${deviceName} -> ${fragmentSeries}`;\n }\n\n private formatMinKey(baseKey: string): string {\n return `${baseKey} (min)`;\n }\n\n private formatMaxKey(baseKey: string): string {\n return `${baseKey} (max)`;\n }\n}\n\nclass CSVFileCreator implements ICsvFileCreator {\n async createFile(content: string, mimeType: string): Promise<Blob> {\n return new Blob([content], { type: mimeType });\n }\n}\n\nclass CSVGenerator {\n static getLabel(): string {\n return gettext('Comma-separated value');\n }\n\n static getTitle(): string {\n return 'CSV';\n }\n\n static getType(): string {\n return 'csv';\n }\n\n static getIcon(): string {\n return 'table';\n }\n\n static getFileExtension(): string {\n return 'csv';\n }\n\n static getAcceptType(): string {\n return 'text/csv';\n }\n\n static getMimeType(): string {\n return 'text/csv';\n }\n\n static getZipName(): string {\n return 'export_csv.zip';\n }\n\n static async convertToMergedCSV(\n exportData: ExportData[],\n mergedExportDetails: MergedExportDetails\n ): Promise<Blob> {\n const instance = CSVGenerator.getInstance();\n const { timeSeries, uniqueColumnIdentifiers } =\n instance.dataTransformer.transformToMergedFormat(exportData);\n\n const rows = [\n instance.createMergedFileHeaderRow(uniqueColumnIdentifiers, mergedExportDetails),\n ...instance.createMergedFileDataRows(timeSeries, uniqueColumnIdentifiers)\n ];\n\n const csvContent = rows.map(row => row.join(',')).join('\\n');\n return instance.fileCreator.createFile(csvContent, CSVGenerator.getMimeType());\n }\n private static instance: CSVGenerator;\n\n private static getInstance(): CSVGenerator {\n if (!CSVGenerator.instance) {\n CSVGenerator.instance = new CSVGenerator();\n }\n return CSVGenerator.instance;\n }\n private dataTransformer: IDataTransformer;\n private fileCreator: ICsvFileCreator;\n\n private constructor() {\n this.dataTransformer = new CSVDataTransformer();\n this.fileCreator = new CSVFileCreator();\n }\n\n private createMergedFileHeaderRow(\n uniqueColumnIdentifiers: string[],\n details?: MergedExportDetails\n ): string[] {\n const time = details ? `time => from ${details.dateFrom} to ${details.dateTo}` : 'time';\n return [time, ...uniqueColumnIdentifiers];\n }\n\n private createMergedFileDataRows(\n timeSeries: Map<string, Record<string, number>>,\n uniqueColumnIdentifiers: string[]\n ): string[][] {\n return Array.from(timeSeries.entries())\n .filter(([time, values]) => this.isValidEntry(time, values))\n .map(([time, values]) => this.createDataRow(time, values, uniqueColumnIdentifiers));\n }\n\n private isValidEntry(time: string, values: Record<string, number>): boolean {\n return time !== null && Object.values(values).some(value => value != null);\n }\n\n private createDataRow(\n time: string,\n values: Record<string, number>,\n uniqueColumnIdentifiers: string[]\n ): string[] {\n const row = [time];\n uniqueColumnIdentifiers.forEach(key => {\n const value = values[key];\n row.push(value?.toString() || '');\n });\n return row;\n }\n}\n\nexport const CSVGeneratorAdapter: FileGenerator = {\n getLabel: CSVGenerator.getLabel.bind(CSVGenerator),\n getIcon: CSVGenerator.getIcon.bind(CSVGenerator),\n getFileExtension: CSVGenerator.getFileExtension.bind(CSVGenerator),\n getMimeType: CSVGenerator.getMimeType.bind(CSVGenerator),\n generateMerged: CSVGenerator.convertToMergedCSV.bind(CSVGenerator),\n getType: CSVGenerator.getType.bind(CSVGenerator),\n getTitle: CSVGenerator.getTitle.bind(CSVGenerator),\n getZipName: CSVGenerator.getZipName.bind(CSVGenerator),\n getAcceptType: CSVGenerator.getAcceptType.bind(CSVGenerator)\n};\n","import { gettext } from '@c8y/ngx-components/gettext';\nimport JSZip from 'jszip';\nimport { isEmpty, isNil, isNumber } from 'lodash-es';\nimport {\n ExportData,\n FILE_COMPRESSION_TYPES_VALUES,\n FileCompressionTypes,\n FileGenerator,\n IDataTransformer,\n MergedExportDetails,\n TimeSeriesColumnData\n} from '../../../datapoints-export-selector.model';\n\ninterface IXmlGenerator {\n RELS_XML: string;\n CONTENT_TYPES_XML: string;\n WORKBOOK_RELS_XML: string;\n SHARED_STRINGS_XML: string;\n generateWorkbookXml(sheetName?: string): string;\n generateSheetXml(data: string[][]): string;\n generateAppXml(name: string): string;\n generateCoreXml(name: string): string;\n}\n\ninterface IXmlFileCreator {\n createZipFile(\n contents: Map<string, string>,\n compressionType: FileCompressionTypes,\n compressionLevel: number\n ): Promise<Blob>;\n}\n\n// Utility functions\nclass XmlUtils {\n static escapeXml(unsafe: string): string {\n return unsafe.replace(/[<>&'\"]/g, c => {\n switch (c) {\n case '<':\n return '&lt;';\n case '>':\n return '&gt;';\n case '&':\n return '&amp;';\n case \"'\":\n return '&apos;';\n case '\"':\n return '&quot;';\n }\n });\n }\n}\n\nexport class ExcelDataTransformer implements IDataTransformer {\n transformToMergedFormat(exportData: ExportData[]): TimeSeriesColumnData {\n const timeSeries = new Map<string, Record<string, number>>();\n const uniqueColumnIdentifiers = new Set<string>();\n\n exportData.forEach(\n ({ time, device_name, fragment_series, unit, value_min, value_max, source }) => {\n const measurementIdentifier = this.createMeasurementIdentifier(\n device_name,\n fragment_series,\n unit,\n source\n );\n\n if (!timeSeries.has(time)) {\n timeSeries.set(time, {});\n }\n\n const timeEntry = timeSeries.get(time);\n if (timeEntry) {\n const minKey = this.formatMinKey(measurementIdentifier);\n const maxKey = this.formatMaxKey(measurementIdentifier);\n\n timeEntry[minKey] = value_min;\n timeEntry[maxKey] = value_max;\n\n uniqueColumnIdentifiers.add(minKey);\n uniqueColumnIdentifiers.add(maxKey);\n }\n }\n );\n\n return {\n timeSeries,\n uniqueColumnIdentifiers: Array.from(uniqueColumnIdentifiers)\n };\n }\n\n private createMeasurementIdentifier(\n deviceName: string,\n fragmentSeries: string,\n unit: string,\n source: string | number\n ): string {\n return unit\n ? `(${source}) ${deviceName} -> ${fragmentSeries} [${unit}]`\n : `(${source}) ${deviceName} -> ${fragmentSeries}`;\n }\n\n private formatMinKey(baseKey: string): string {\n return `${baseKey} (min)`;\n }\n\n private formatMaxKey(baseKey: string): string {\n return `${baseKey} (max)`;\n }\n}\n\nclass ExcelXmlGenerator implements IXmlGenerator {\n private columnWidths = {\n time: 25,\n source: 10,\n device_name: 20,\n 'fragment.series': 20,\n value_min: 15,\n value_max: 15,\n unit: 5\n };\n private defaultWidth = 30;\n\n readonly RELS_XML =\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\\n' +\n ' <Relationship Id=\"rId1\" Target=\"xl/workbook.xml\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\"/>\\n' +\n ' <Relationship Id=\"rId2\" Target=\"docProps/app.xml\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\"/>\\n' +\n ' <Relationship Id=\"rId3\" Target=\"docProps/core.xml\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\"/>\\n' +\n '</Relationships>';\n\n readonly CONTENT_TYPES_XML =\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\\n' +\n '<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\\n' +\n ' <Default ContentType=\"application/vnd.openxmlformats-package.relationships+xml\" Extension=\"rels\"/>\\n' +\n ' <Default ContentType=\"application/xml\" Extension=\"xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\" PartName=\"/docProps/app.xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" PartName=\"/docProps/core.xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml\" PartName=\"/xl/sharedStrings.xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\" PartName=\"/xl/workbook.xml\"/>\\n' +\n ' <Override ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\" PartName=\"/xl/worksheets/sheet1.xml\"/>\\n' +\n '</Types>';\n\n readonly WORKBOOK_RELS_XML =\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\\n' +\n ' <Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\" Target=\"sharedStrings.xml\"/>\\n' +\n ' <Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\" Target=\"worksheets/sheet1.xml\"/>\\n' +\n '</Relationships>';\n\n readonly SHARED_STRINGS_XML =\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' +\n '<sst count=\"0\" uniqueCount=\"0\" xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"/>';\n\n generateWorkbookXml(sheetName = 'Measurements'): string {\n return (\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n `<workbook xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"><sheets><sheet name='${sheetName}' r:id=\"rId3\" sheetId=\"1\"/></sheets></workbook>`\n );\n }\n\n generateSheetXml(data: string[][]): string {\n const headers = data[0];\n const colsXml = this.generateColsXml(headers);\n const rowsXml = this.generateRowsXml(data);\n\n return `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n <worksheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">\n <cols>${colsXml}</cols>\n <sheetData>${rowsXml}</sheetData>\n </worksheet>`;\n }\n\n generateAppXml(name: string): string {\n return (\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n '<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">\\n' +\n ` <Application>${name}</Application>\\n` +\n ' <DocSecurity>0</DocSecurity>\\n' +\n ' <ScaleCrop>false</ScaleCrop>\\n' +\n ' <HeadingPairs>\\n' +\n ' <vt:vector size=\"2\" baseType=\"variant\">\\n' +\n ' <vt:variant>\\n' +\n ' <vt:lpstr>Worksheets</vt:lpstr>\\n' +\n ' </vt:variant>\\n' +\n ' <vt:variant>\\n' +\n ' <vt:i4>1</vt:i4>\\n' +\n ' </vt:variant>\\n' +\n ' </vt:vector>\\n' +\n ' </HeadingPairs>\\n' +\n ' <TitlesOfParts>\\n' +\n ' <vt:vector size=\"1\" baseType=\"lpstr\">\\n' +\n ' <vt:lpstr>Sheet1</vt:lpstr>\\n' +\n ' </vt:vector>\\n' +\n ' </TitlesOfParts>\\n' +\n ' <Company></Company>\\n' +\n ' <LinksUpToDate>false</LinksUpToDate>\\n' +\n ' <SharedDoc>false</SharedDoc>\\n' +\n ' <HyperlinksChanged>false</HyperlinksChanged>\\n' +\n ' <AppVersion>16.0300</AppVersion>\\n' +\n '</Properties>'\n );\n }\n\n generateCoreXml(name: string): string {\n const now = new Date().toISOString();\n return (\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\\n' +\n '<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\\n' +\n ` <dc:creator>${name}</dc:creator>\\n` +\n ` <cp:lastModifiedBy>${name}</cp:lastModifiedBy>\\n` +\n ` <dcterms:created xsi:type=\"dcterms:W3CDTF\">${now}</dcterms:created>\\n` +\n ` <dcterms:modified xsi:type=\"dcterms:W3CDTF\">${now}</dcterms:modified>\\n` +\n '</cp:coreProperties>'\n );\n }\n\n private generateColsXml(headers: string[]): string {\n return headers\n .map((header, index) => {\n const width = this.columnWidths[header] || this.defaultWidth;\n return `<col min=\"${index + 1}\" max=\"${index + 1}\" width=\"${width}\" customWidth=\"1\"/>`;\n })\n .join('');\n }\n\n private generateRowsXml(data: string[][]): string {\n return data\n .map(\n row =>\n `<row>${row\n .map(cell => {\n if (isNil(cell) || isEmpty(cell)) {\n return `<c t=\"inlineStr\"><is><t></t></is></c>`; // String cell\n } else if (isNumber(Number(cell)) && !isNaN(Number(cell))) {\n return `<c t=\"n\"><v>${Number(cell)}</v></c>`; // Number cell\n } else {\n return `<c t=\"inlineStr\"><is><t>${XmlUtils.escapeXml(cell)}</t></is></c>`; // String cell\n }\n })\n .join('')}</row>`\n )\n .join('');\n }\n}\n\nclass ZipFileCreator implements IXmlFileCreator {\n async createZipFile(\n contents: Map<string, string>,\n compressionType: FileCompressionTypes,\n compressionLevel: number\n ): Promise<Blob> {\n const zip = new JSZip();\n const blob = 'blob';\n\n contents.forEach((content, filename) => {\n zip.file(filename, content);\n });\n\n const options: JSZip.JSZipGeneratorOptions = { type: blob };\n if (compressionType !== FILE_COMPRESSION_TYPES_VALUES.store) {\n options.compression = compressionType;\n options.compressionOptions = { level: compressionLevel };\n }\n\n return (await zip.generateAsync(options)) as Blob;\n }\n}\n\nclass ExcelGenerator {\n static getLabel(): string {\n return gettext('Microsoft Excel');\n }\n\n static getTitle(): string {\n return 'Excel';\n }\n\n static getType(): string {\n return 'excel';\n }\n\n static getIcon(): string {\n return 'excel';\n }\n\n static getFileExtension(): string {\n return 'xlsx';\n }\n\n static getAcceptType(): string {\n return 'application/vnd.ms-excel';\n }\n\n static getMimeType(): string {\n return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';\n }\n\n static getZipName(): string {\n return 'export_excel.zip';\n }\n\n static async convertToMergedExcel(\n exportData: ExportData[],\n mergedExportDetails: MergedExportDetails\n ): Promise<Blob> {\n const instance = ExcelGenerator.getInstance();\n const { timeSeries, uniqueColumnIdentifiers } =\n instance.dataTransformer.transformToMergedFormat(exportData);\n\n const rows = [\n instance.createMergedFileHeaderRow(uniqueColumnIdentifiers, mergedExportDetails),\n ...instance.createMergedFileDataRows(timeSeries, uniqueColumnIdentifiers)\n ];\n\n return instance.createExcelFile(rows, mergedExportDetails);\n }\n\n private static getInstance(): ExcelGenerator {\n if (!ExcelGenerator.instance) {\n ExcelGenerator.instance = new ExcelGenerator();\n }\n return ExcelGenerator.instance;\n }\n\n private static instance: ExcelGenerator;\n private dataTransformer: IDataTransformer;\n private xmlGenerator: IXmlGenerator;\n private fileCreator: IXmlFileCreator;\n\n private constructor() {\n this.dataTransformer = new ExcelDataTransformer();\n this.xmlGenerator = new ExcelXmlGenerator();\n this.fileCreator = new ZipFileCreator();\n }\n\n private async createExcelFile(data: string[][], details?: MergedExportDetails): Promise<Blob> {\n const contents = new Map<string, string>([\n ['[Content_Types].xml', this.xmlGenerator.CONTENT_TYPES_XML],\n ['_rels/.rels', this.xmlGenerator.RELS_XML],\n [\n 'xl/workbook.xml',\n this.xmlGenerator.generateWorkbookXml(\n details?.aggregation ? details?.aggregation : 'NO AGGREGATION'\n )\n ],\n ['xl/worksheets/sheet1.xml', this.xmlGenerator.generateSheetXml(data)],\n ['xl/sharedStrings.xml', this.xmlGenerator.SHARED_STRINGS_XML],\n ['docProps/app.xml', this.xmlGenerator.generateAppXml('Custom Script')],\n ['docProps/core.xml', this.xmlGenerator.generateCoreXml('Custom Script')],\n ['xl/_rels/workbook.xml.rels', this.xmlGenerator.WORKBOOK_RELS_XML]\n ]);\n\n return this.fileCreator.createZipFile(contents, FILE_COMPRESSION_TYPES_VALUES.deflate, 9);\n }\n\n private createMergedFileHeaderRow(\n uniqueColumnIdentifiers: string[],\n details?: MergedExportDetails\n ): string[] {\n const time = details ? `time => from ${details.dateFrom} to ${details.dateTo}` : 'time';\n return [time, ...uniqueColumnIdentifiers];\n }\n\n private createMergedFileDataRows(\n timeSeries: Map<string, Record<string, number>>,\n uniqueColumnIdentifiers: string[]\n ): string[][] {\n return Array.from(timeSeries.entries())\n .filter(([time, values]) => this.isValidEntry(time, values))\n .map(([time, values]) => this.createDataRow(time, values, uniqueColumnIdentifiers));\n }\n\n private isValidEntry(time: string, values: Record<string, number>): boolean {\n return (\n time !== null && Object.values(values).some(value => value !== null && value !== undefined)\n );\n }\n\n private createDataRow(\n time: string,\n values: Record<string, number>,\n uniqueColumnIdentifiers: string[]\n ): string[] {\n const row = [time];\n uniqueColumnIdentifiers.forEach(key => {\n const value = values[key];\n row.push(value !== undefined && value !== null ? value.toString() : '');\n });\n return row;\n }\n}\n\nexport const ExcelGeneratorAdapter: FileGenerator = {\n getLabel: ExcelGenerator.getLabel.bind(ExcelGenerator),\n getIcon: ExcelGenerator.getIcon.bind(ExcelGenerator),\n getFileExtension: ExcelGenerator.getFileExtension.bind(ExcelGenerator),\n getMimeType: ExcelGenerator.getMimeType.bind(ExcelGenerator),\n generateMerged: ExcelGenerator.convertToMergedExcel.bind(ExcelGenerator),\n getType: ExcelGenerator.getType.bind(ExcelGenerator),\n getTitle: ExcelGenerator.getTitle.bind(ExcelGenerator),\n getZipName: ExcelGenerator.getZipName.bind(ExcelGenerator),\n getAcceptType: ExcelGenerator.getAcceptType.bind(ExcelGenerator)\n};\n","import {\n Component,\n EventEmitter,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n OnInit,\n Output\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n AbstractControl,\n FormBuilder,\n FormControl,\n ReactiveFormsModule,\n ValidationErrors,\n ValidatorFn\n} from '@angular/forms';\nimport {\n AGGREGATION_VALUES,\n AggregationOption,\n AggregationOptionStatus,\n AggregationService,\n CoreModule,\n GainsightService\n} from '@c8y/ngx-components';\nimport saveAs from 'file-saver';\nimport { debounceTime, merge, Subject, takeUntil } from 'rxjs';\nimport {\n DatapointCounts,\n DatapointDetails,\n DatapointsExceedingLimit,\n DataToExport,\n DataToExportWithBackendCreatedFile,\n DateFetchConfig,\n EXPORT_MODE_VALUES,\n ExportConfig,\n ExportData,\n FileExportConfig,\n FileGenerator,\n FileTypeMetadata,\n MergedExportDetails,\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR,\n SERIES_DATA_MERGED_FILE_NAME\n} from '../../datapoints-export-selector.model';\nimport { DataFetchingService } from './data-fetching.service';\nimport { DataProcessingService } from './data-processing.service';\nimport { DatapointsExportSelectorFileExporterService } from './datapoints-export-selector-file-exporter.service';\nimport { DataPointsExportSelectorPreviewComponent } from './datapoints-export-selector-preview/datapoints-export-selector-preview.component';\nimport { DataPointsExportSelectorDataScopeComponent } from './datapoints-exports-selector-data-scope/datapoints-exports-selector-data-scope.component';\nimport { DataPointsExportSelectorFileTypesComponent } from './datapoints-exports-selector-file-types/datapoints-exports-selector-file-types.component';\nimport { DataPointsExportSelectorTimeRangeComponent } from './datapoints-exports-selector-time-range/datapoints-exports-selector-time-range.component';\nimport { CSVGeneratorAdapter } from './generators/csv-generator';\nimport { ExcelGeneratorAdapter } from './generators/excel-generator';\n\nexport const FILE_GENERATORS = new InjectionToken<FileGenerator[]>('FILE_GENERATORS', {\n providedIn: 'root',\n factory: () => [ExcelGeneratorAdapter, CSVGeneratorAdapter]\n});\n\nexport const dateRangeValidator: ValidatorFn = (\n control: AbstractControl\n): ValidationErrors | null => {\n const dateFrom = control.get('dateFrom');\n const dateTo = control.get('dateTo');\n\n if (!dateFrom || !dateTo) {\n return null;\n }\n\n const dateFromValue = dateFrom.value;\n const dateToValue = dateTo.value;\n if (dateFromValue && dateToValue) {\n if (new Date(dateFromValue) > new Date(dateToValue)) {\n dateFrom.setErrors({ dateAfterRangeMax: true });\n dateTo.setErrors({ dateBeforeRangeMin: true });\n } else {\n dateFrom.setErrors(null);\n dateTo.setErrors(null);\n }\n }\n return null;\n};\n\n@Component({\n selector: 'c8y-datapoints-export-selector-file-exporter',\n templateUrl: './datapoints-export-selector-file-exporter.component.html',\n standalone: true,\n imports: [\n CoreModule,\n DataPointsExportSelectorDataScopeComponent,\n DataPointsExportSelectorFileTypesComponent,\n DataPointsExportSelectorPreviewComponent,\n DataPointsExportSelectorTimeRangeComponent,\n ReactiveFormsModule\n ]\n})\nexport class DatapointsExportSelectorFileExporterComponent implements OnInit, OnDestroy {\n @Input() exportConfig: ExportConfig;\n @Output() onDownloadButtonStateChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n /**\n * Represents aggregation selector options that are disabled.\n * This state is determined based on the current date range.\n */\n disabledAggregationOptions: AggregationOptionStatus = {};\n\n formGroup: ReturnType<DatapointsExportSelectorFileExporterComponent['createForm']>;\n\n /**\n * Contains all datapoints that number of records exceeds a threshold, where data for these datapoints will be processed by the backend.\n * Applies only to measurement API which can return processed CSV, Excel or XML data.\n */\n datapointsExceedingBrowserDownloadLimit: DatapointsExceedingLimit[] = [];\n /**\n * Indicates whether any of DataToExport objects timeValueMap property is not undefined (series data)\n * or dataPointToExport is not undefined at all (measurement data).\n */\n\n hasFetchedDataAnyValuesToExport = false;\n\n /**\n * Indicates if there is no exportable data because the date range of all selected datapoints exceeds 1,000,000 records.\n */\n hasNoExportableData: boolean;\n\n hasPermissionToReadAnyMeasurements = false;\n\n isPreviewLoading = true;\n /**\n * Indicates whether the full or compact type of export is selected.\n * Full type of export is based on measurement API data.\n * Compact type of export is based on series API data.\n */\n isFullTypeOfExport = false;\n\n previewTableData: ExportData[];\n\n limitExceededMessage: string;\n\n /**\n * Contains processed data that is prepared to be exported if series data was fetched\n * or shown in the preview table in case of measurements data.\n */\n private dataToExport: DataToExport[];\n /**\n * Contains a list of datapoints that selected date range exceeds API limit of 1_000_000 records.\n */\n private dataPointsExceedingOneMillionLimit: DatapointsExceedingLimit[];\n /**\n * Represents the state of file type selection checkboxes.\n */\n private fileTypeSelectionState: { [key: string]: boolean };\n /**\n * Hold the initial state of the aggregation from the export config.\n * Value will be loaded on component destroy.\n */\n private initialAggregation: AggregationOption;\n /**\n * Hold the initial state of the dateFrom from the export config.\n * Value will be loaded on component destroy.\n */\n private initialDateFrom: string;\n /**\n * Hold the initial state of the dateTo from the export config.\n * Value will be loaded on component destroy.\n */\n private initialDateTo: string;\n /**\n * Hold the initial state of the datapointDetails from the export config.\n * Some logic may filter out datapoints in datapointDetails array, that exceeds 1_000_000 limit for measurements API,\n * but full list is still needed when component is reopened.\n * Value will be loaded on component destroy.\n */\n private initialDatapointDetails: DatapointDetails[];\n /**\n * Indicates whether the aggregation value was changed programmatically.\n * It prevents a case where fetching may be triggered twice when export type is changed.\n * Both options alone can trigger fetching data.\n */\n private isAggregationChangedProgrammatically = false;\n /**\n * Indicates whether any of the export file types (CSV, Excel) are checked.\n */\n private isAnyOfExportFileTypeChecked = false;\n\n private dateFromSubject = new Subject<DateFetchConfig>();\n private dateToSubject = new Subject<DateFetchConfig>();\n private destroy$ = new Subject<void>();\n\n dynamicFilesTypeMetadata: { [key: string]: FileTypeMetadata } = {};\n\n constructor(\n private aggregationService: AggregationService,\n private datapointsExportModalService: DataProcessingService,\n private datapointsExportSelectorFileExporterService: DatapointsExportSelectorFileExporterService,\n private dataFetchingService: DataFetchingService,\n private formBuilder: FormBuilder,\n @Inject(FILE_GENERATORS) private generators: FileGenerator[],\n private gainsightService: GainsightService\n ) {\n this.setFilesType(this.generators);\n\n this.dateFromSubject\n .pipe(debounceTime(300), takeUntilDestroyed())\n .subscribe(async (dateInfo: DateFetchConfig) => {\n await this.updateDateAndFetchData('dateFrom', dateInfo);\n });\n\n this.dateToSubject\n .pipe(debounceTime(300), takeUntilDestroyed())\n .subscribe(async (dateInfo: DateFetchConfig) => {\n await this.updateDateAndFetchData('dateTo', dateInfo);\n });\n }\n\n setFilesType(generators: FileGenerator[]) {\n generators.forEach(g => {\n this.dynamicFilesTypeMetadata[g.getType()] = {\n label: g.getLabel(),\n icon: g.getIcon(),\n title: g.getTitle(),\n extension: g.getFileExtension(),\n zipName: g.getZipName(),\n type: g.getType()\n };\n });\n }\n\n async ngOnInit(): Promise<void> {\n const sourcesPermittedToRead: string[] =\n await this.dataFetchingService.getSourcesWithPermissionsToRead(\n this.exportConfig.datapointDetails\n );\n\n if (sourcesPermittedToRead.length === 0) {\n return;\n }\n\n if (sourcesPermittedToRead.length !== this.exportConfig.datapointDetails.length) {\n this.exportConfig.datapointDetails = this.exportConfig.datapointDetails.filter(dataPoint =>\n sourcesPermittedToRead.includes(String(dataPoint.source))\n );\n }\n\n this.hasPermissionToReadAnyMeasurements = true;\n\n this.storeInitialChangeableConfig();\n\n this.fileTypeSelectionState = this.getInitialSelection(this.dynamicFilesTypeMetadata, [0]);\n\n this.formGroup = this.createForm();\n this.dataToExport = await this.dataFetchingService.fetchAndPrepareDataToExport(\n this.exportConfig,\n this.isFullTypeOfExport\n );\n\n this.handleDateSelectorChanges();\n this.determineShowingPreviewOrEmptyState();\n this.handleExportModeChanges();\n this.handleFileTypeSelectionChanges();\n this.handleFormValidationChanges();\n\n this.updateFileTypeControl();\n\n this.updateDisabledAggregationOptions();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.loadInitialChangeableConfig();\n }\n\n async exportAndDownload(): Promise<void> {\n const fileExports: FileExportConfig[] = Object.entries(this.dynamicFilesTypeMetadata).map(\n ([_, value]) => ({\n fileType: value.type as string,\n zipName: value.zipName\n })\n );\n\n const selectedFileExports: FileExportConfig[] = this.getOnlySelectedFileExports(fileExports);\n\n this.triggerGainsightDownloadEvent(selectedFileExports);\n\n await Promise.all(\n selectedFileExports.map(async ({ fileType, zipName }) => {\n const blob = await this.exportFile(fileType);\n await this.downloadFile(blob, fileType, zipName);\n })\n );\n\n this.datapointsExportSelectorFileExporterService.cleanupCachedData();\n }\n\n getOnlySelectedFileExports(fileExports: FileExportConfig[]): FileExportConfig[] {\n return fileExports.filter(f => this.fileTypeSelectionState[f.fileType] === true);\n }\n\n async exportFile(fileType: string): Promise<Blob | null> {\n return this.isFullTypeOfExport\n ? await this.exportMeasurementFile(fileType)\n : await this.exportSeriesFile(fileType);\n }\n\n async downloadFile(\n blob: Blob | null,\n fileType: string,\n measurementsZipFileName: string\n ): Promise<void> {\n this.datapointsExceedingBrowserDownloadLimit =\n this.datapointsExceedingBrowserDownloadLimit.filter(\n datapoint => !this.dataPointsExceedingOneMillionLimit.includes(datapoint)\n );\n\n const shouldShowAlert = this.datapointsExceedingBrowserDownloadLimit.length > 0;\n\n // Handles a case where all files are sent by email.\n if (!blob && shouldShowAlert) {\n this.dataFetchingService.showSendViaEmailInfoAlert(\n fileType,\n this.datapointsExceedingBrowserDownloadLimit\n );\n return;\n }\n\n if (blob) {\n // Handles the case where some of the files are sent by email.\n if (shouldShowAlert) {\n this.dataFetchingService.showSendViaEmailInfoAlert(\n fileType,\n this.datapointsExceedingBrowserDownloadLimit\n );\n }\n\n this.isFullTypeOfExport\n ? saveAs(blob, measurementsZipFileName)\n : saveAs(blob, blob[SERIES_DATA_MERGED_FILE_NAME]);\n }\n }\n\n /**\n * Exports a measurement file of the specified type.\n *\n * Measurements API does provide a way to fetch a preprocessed CSV/Excel file.\n *\n * At this point a backed file needs to be fetched.\n * Measurement data used for a preview contains just 5 first records\n * and it's not fetched with CSV/Excel headers.\n *\n * @param fileType - The type of file to export.\n * @returns A Promise that resolves to a Blob representing the exported file or null when no data to export or it's sent via email.\n */\n async exportMeasurementFile(fileType: string): Promise<Blob> | null {\n const { acceptType, extension } = this.datapointsExportModalService.fileTypesConfigs[fileType];\n\n const updatedExportConfig: ExportConfig = this.excludeDatapointsThatExceedsApiLimit(\n this.exportConfig\n );\n\n const dataToExport: DataToExportWithBackendCreatedFile[] =\n await this.dataFetchingService.fetchMeasurementDataFilesAndPairWithSourceDetails(\n acceptType,\n updatedExportConfig\n );\n\n const isAllUndefined = dataToExport.every(data => data === undefined);\n if (isAllUndefined) {\n return null;\n }\n\n return this.datapointsExportSelectorFileExporterService.getMeasurementExportedDataBlob(\n extension,\n dataToExport\n );\n }\n\n excludeDatapointsThatExceedsApiLimit(exportConfig: ExportConfig): ExportConfig {\n const skippedDatapointsSource: string[] = this.dataPointsExceedingOneMillionLimit.map(\n datapoint => datapoint.datapointDetail.source.toString()\n );\n\n const filteredDatapoints: DatapointDetails[] = exportConfig.datapointDetails.filter(\n datapoint => !skippedDatapointsSource.includes(String(datapoint.source))\n );\n\n exportConfig.datapointDetails = filteredDatapoints;\n return exportConfig;\n }\n\n /**\n * Exports the series data to a file of the specified type.\n *\n * Series API does not provide a way to fetch a preprocessed CSV/Excel file.\n *\n * Series data used for exporting a file is already fetched for a preview\n * and can be reused for exporting.\n *\n * @param fileType - The type of file to export (e.g., CSV, Excel).\n * @returns A Promise that resolves to a Blob representing the exported file.\n */\n async exportSeriesFile(fileType: string): Promise<Blob> {\n const mergedExportDetails: MergedExportDetails = {\n aggregation: this.exportConfig.aggregation,\n dateFrom: this.exportConfig.dateFrom,\n dateTo: this.exportConfig.dateTo\n };\n\n return this.datapointsExportSelectorFileExporterService.getSeriesExportedDataBlob(\n fileType,\n this.dataToExport,\n mergedExportDetails\n );\n }\n\n async onAggregationChange(newAggregation: AggregationOption): Promise<void> {\n const currentAggregation = this.exportConfig.aggregation ?? AGGREGATION_VALUES.none;\n\n if (currentAggregation === newAggregation) {\n return;\n }\n\n this.exportConfig.aggregation = newAggregation;\n\n if (this.isAggregationChangedProgrammatically) {\n return;\n }\n\n await this.loadExportData();\n this.updateDownloadButtonState();\n }\n\n onDateFromChange(updatedDate: string): void {\n this.update(updatedDate, this.exportConfig.dateTo);\n }\n\n onDateToChange(updatedDate: string): void {\n this.update(this.exportConfig.dateFrom, updatedDate);\n }\n\n async updateDateAndFetchData(\n dateType: 'dateFrom' | 'dateTo',\n dateInfo: DateFetchConfig\n ): Promise<void> {\n this.exportConfig[dateType] = dateInfo.date;\n if (!dateInfo.shouldFetchData) {\n return;\n }\n\n await this.loadExportData();\n\n if (this.isFullTypeOfExport) {\n await this.determineIfMeasurementResponseWillBeProcessedByBackend();\n } else {\n this.updateDownloadButtonState();\n }\n }\n\n async onExportTypeChange(exportType: string): Promise<void> {\n if (exportType === EXPORT_MODE_VALUES.full) {\n this.isAggregationChangedProgrammatically = true;\n this.formGroup.controls.aggregation.setValue(AGGREGATION_VALUES.none);\n this.isAggregationChangedProgrammatically = false;\n\n this.isFullTypeOfExport = true;\n await this.loadExportData();\n await this.determineIfMeasurementResponseWillBeProcessedByBackend();\n return;\n }\n\n this.resetFullExportRelatedProperties();\n this.isFullTypeOfExport = false;\n await this.loadExportData();\n\n this.updateDisabledAggregationOptions();\n\n this.updateDownloadButtonState();\n }\n\n private updateDisabledAggregationOptions(): void {\n this.disabledAggregationOptions = this.aggregationService.getDisabledAggregationOptions(\n this.formGroup.controls.dateFrom.value,\n this.formGroup.controls.dateTo.value\n );\n }\n\n private createForm() {\n return this.formBuilder.group(\n {\n dateFrom: new FormControl(this.exportConfig.dateFrom),\n dateTo: new FormControl(this.exportConfig.dateTo),\n aggregation: new FormControl(\n this.exportConfig.aggregation ? this.exportConfig.aggregation : AGGREGATION_VALUES.none\n ),\n exportMode: new FormControl(EXPORT_MODE_VALUES.compact),\n fileTypes: this.formBuilder.group(\n this.generators.reduce((a, c) => {\n a[c.getType()] = false;\n return a;\n }, {})\n )\n },\n {\n validators: [dateRangeValidator]\n }\n );\n }\n\n private preparePreview(): void {\n this.isPreviewLoading = true;\n this.previewTableData =\n this.datapointsExportModalService.transformToExportFileStructureForPreview(this.dataToExport);\n this.isPreviewLoading = false;\n }\n\n private handleDateSelectorChanges(): void {\n const aggregationControl = this.formGroup.controls.aggregation;\n const dateFromSelector = this.formGroup.controls.dateFrom;\n const dateToSelector = this.formGroup.controls.dateTo;\n\n const updateAggregationOptions = () => {\n if (!this.isFullTypeOfExport) {\n this.updateDisabledAggregationOptions();\n\n const firstAvailableAggregationValue: AggregationOption =\n this.aggregationService.determineFirstNewAvailableAggregationValue(\n aggregationControl.value,\n this.disabledAggregationOptions\n );\n\n if (firstAvailableAggregationValue) {\n aggregationControl.setValue(firstAvailableAggregationValue);\n }\n }\n };\n\n merge(dateFromSelector.valueChanges, dateToSelector.valueChanges)\n .pipe(takeUntil(this.destroy$))\n .subscribe(updateAggregationOptions);\n }\n\n private handleExportModeChanges(): void {\n const aggregationControl = this.formGroup.controls.aggregation;\n\n this.formGroup.controls.exportMode.valueChanges\n .pipe(takeUntil(this.destroy$))\n .subscribe(exportModeValue => {\n if (exportModeValue.toString() === EXPORT_MODE_VALUES.full) {\n aggregationControl.disable();\n } else {\n aggregationControl.enable();\n }\n });\n }\n\n private handleFileTypeSelectionChanges(): void {\n this.formGroup.controls.fileTypes.valueChanges\n .pipe(takeUntil(this.destroy$))\n .subscribe(fileTypesSelectionState => {\n this.updateFileTypeSelectionState(fileTypesSelectionState);\n });\n }\n\n private updateFileTypeSelectionState(checkboxesState: { [key: string]: boolean }): void {\n this.isAnyOfExportFileTypeChecked = Object.values(checkboxesState).some(\n value => value === true\n );\n this.fileTypeSelectionState = checkboxesState;\n this.updateDownloadButtonState();\n }\n\n private handleFormValidationChanges(): void {\n this.formGroup.statusChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateDownloadButtonState();\n });\n }\n\n private updateFileTypeControl(): void {\n const fileTypesControl = this.formGroup.controls.fileTypes;\n if (fileTypesControl) {\n const currentValue = fileTypesControl.value || {};\n const updatedValue = { ...currentValue };\n\n Object.entries(this.fileTypeSelectionState).forEach(([fileType, isSelected]) => {\n if (fileType in currentValue) {\n updatedValue[fileType] = isSelected;\n }\n });\n\n fileTypesControl.patchValue(updatedValue);\n }\n }\n\n private determineShowingPreviewOrEmptyState(): void {\n const hasDataToShow = this.dataToExport.some(dataToExportItem =>\n this.isFullTypeOfExport\n ? !!dataToExportItem\n : dataToExportItem.timeValueMap && Object.keys(dataToExportItem.timeValueMap).length > 0\n );\n\n this.hasFetchedDataAnyValuesToExport = hasDataToShow;\n\n if (hasDataToShow) {\n this.preparePreview();\n } else {\n this.isPreviewLoading = false;\n }\n }\n\n private async determineIfMeasurementResponseWillBeProcessedByBackend(): Promise<void> {\n this.isPreviewLoading = true;\n\n this.datapointsExceedingBrowserDownloadLimit =\n await this.dataFetchingService.getDatapointsExceedingLimit(this.exportConfig);\n\n const { browserDownloadableCount, emailDeliverableCount, nonRetrievableCount } =\n this.calculateDatapointCounts();\n\n this.hasNoExportableData =\n browserDownloadableCount === 0 && emailDeliverableCount === 0 && nonRetrievableCount > 0;\n\n if (this.datapointsExceedingBrowserDownloadLimit.length > 0 && !this.hasNoExportableData) {\n this.limitExceededMessage = this.dataFetchingService.getLimitExceededMessage(\n this.hasNoExportableData,\n emailDeliverableCount,\n browserDownloadableCount,\n nonRetrievableCount,\n this.exportConfig.datapointDetails.length\n );\n }\n\n if (this.datapointsExceedingBrowserDownloadLimit.length > 0 && this.hasNoExportableData) {\n this.limitExceededMessage = this.dataFetchingService.getLimitExceededMessage(\n this.hasNoExportableData\n );\n }\n\n this.updateDownloadButtonState();\n\n this.isPreviewLoading = false;\n }\n\n private calculateDatapointCounts(): DatapointCounts {\n const RECORD_API_LIMIT = 1_000_000;\n\n this.dataPointsExceedingOneMillionLimit = this.datapointsExceedingBrowserDownloadLimit.filter(\n datapointsExceedingBrowserDownloadLimit =>\n datapointsExceedingBrowserDownloadLimit.totalElements > RECORD_API_LIMIT\n );\n\n const nonRetrievableCount = this.dataPointsExceedingOneMillionLimit.length;\n\n const emailDeliverableCount =\n this.datapointsExceedingBrowserDownloadLimit.length - nonRetrievableCount;\n\n const browserDownloadableCount =\n this.exportConfig.datapointDetails.length - emailDeliverableCount - nonRetrievableCount;\n\n return {\n browserDownloadableCount,\n emailDeliverableCount,\n nonRetrievableCount\n };\n }\n\n private storeInitialChangeableConfig(): void {\n this.initialDateFrom = this.exportConfig.dateFrom;\n this.initialDateTo = this.exportConfig.dateTo;\n this.initialDatapointDetails = this.exportConfig.datapointDetails;\n if (!this.isFullTypeOfExport) {\n this.initialAggregation = this.exportConfig.aggregation;\n }\n }\n\n private loadInitialChangeableConfig(): void {\n this.exportConfig.dateFrom = this.initialDateFrom;\n this.exportConfig.dateTo = this.initialDateTo;\n this.exportConfig.datapointDetails = this.initialDatapointDetails;\n if (!this.isFullTypeOfExport) {\n this.exportConfig.aggregation = this.initialAggregation;\n }\n }\n\n private async loadExportData(): Promise<void> {\n if (this.formGroup.invalid) {\n return;\n }\n\n this.isPreviewLoading = true;\n\n this.onDownloadButtonStateChange.emit(false);\n\n this.dataToExport = await this.dataFetchingService.fetchAndPrepareDataToExport(\n this.exportConfig,\n this.isFullTypeOfExport\n );\n\n this.determineShowingPreviewOrEmptyState();\n }\n\n private updateDownloadButtonState(): void {\n const canEnableDownloadButton =\n this.hasFetchedDataAnyValuesToExport &&\n !this.formGroup.invalid &&\n this.isAnyOfExportFileTypeChecked &&\n !this.hasNoExportableData;\n\n this.onDownloadButtonStateChange.emit(canEnableDownloadButton);\n }\n\n private resetFullExportRelatedProperties(): void {\n this.hasNoExportableData = false;\n this.datapointsExceedingBrowserDownloadLimit = [];\n }\n\n private getInitialSelection(\n fileType: { [key: string]: FileTypeMetadata },\n selectByDefault: number[]\n ) {\n const keys = Object.keys(fileType);\n if (keys.length === 0) {\n return {};\n }\n\n const initialSelection = keys.reduce<{ [key: string]: boolean }>((acc, key) => {\n acc[key] = false;\n return acc;\n }, {});\n\n selectByDefault.forEach(index => {\n if (index >= 0 && index < keys.length) {\n initialSelection[keys[index]] = true;\n }\n });\n\n return initialSelection;\n }\n\n /**\n * Adjusts both \"from\" and \"to\" dates when either is updated:\n * - Resets seconds to 00 even when only one date changes\n * - Prevents persisting hidden seconds ≠ 00 from initial load\n * - Triggers data fetch\n *\n * Example:\n * When user changes \"from\" date:\n * Input: startDate = \"2024-03-26 13:30:45\", endDate = \"2024-03-27 15:20:45\"\n * Result: startDate -> \"2024-03-26 14:30:00\", endDate -> \"2024-03-27 15:20:00\"\n *\n * When user changes \"to\" date:\n * Input: startDate = \"2024-03-26 14:30:45\", endDate = \"2024-03-27 15:20:45\"\n * Result: startDate -> \"2024-03-26 14:30:00\", endDate -> \"2024-03-27 16:20:00\"\n *\n * @param startDate - The \"start\" date to be adjusted.\n * @param endDate - The \"end\" date to be adjusted.\n */\n private update(startDate: string, endDate: string): void {\n this.dateFromSubject.next({\n date: this.dataFetchingService.adjustDate(startDate, 0),\n shouldFetchData: false\n });\n\n this.dateToSubject.next({\n date: this.dataFetchingService.adjustDate(endDate, 0),\n shouldFetchData: true\n });\n }\n\n private triggerGainsightDownloadEvent(selectedFileExports: FileExportConfig[]): void {\n const commonEventData = {\n action: PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.ACTIONS.DOWNLOAD_STARTED,\n component:\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.COMPONENTS\n .DATAPOINTS_EXPORT_SELECTOR_FILE_EXPORTER,\n selectedFileType: selectedFileExports.map(item => item.fileType)\n };\n\n if (this.isFullTypeOfExport) {\n this.gainsightService.triggerEvent(\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EVENTS.EXPORT_SELECTOR,\n {\n ...commonEventData,\n selectedExportType:\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EXPORT_CONFIG.FULL_EXPORT_TYPE\n }\n );\n } else {\n this.gainsightService.triggerEvent(\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EVENTS.EXPORT_SELECTOR,\n {\n ...commonEventData,\n selectedExportType:\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EXPORT_CONFIG.COMPACT_EXPORT_TYPE,\n selectedAggregation: this.exportConfig.aggregation ?? AGGREGATION_VALUES.none\n }\n );\n }\n }\n}\n","<div class=\"p-b-16\">\n <ng-container *ngIf=\"hasPermissionToReadAnyMeasurements; else hasNoRoleToReadAnyMeasurements\">\n <div class=\"p-16 text-center separator-bottom sticky-top bg-component\">\n <p class=\"text-medium text-16\">\n {{ 'Configure export' | translate }}\n </p>\n </div>\n <div\n class=\"p-t-24 p-r-16 p-l-16 gap-8 p-b-16 flex-wrap\"\n [ngClass]=\"{ 'separator-bottom': isFullTypeOfExport }\"\n >\n <div class=\"row\">\n <div class=\"col-md-4\">\n <c8y-datapoints-export-selector-time-range\n *ngIf=\"this.hasPermissionToReadAnyMeasurements\"\n [formGroup]=\"formGroup\"\n (onDateFromChange)=\"onDateFromChange($event)\"\n (onDateToChange)=\"onDateToChange($event)\"\n ></c8y-datapoints-export-selector-time-range>\n </div>\n <div class=\"col-md-4\">\n <c8y-datapoints-export-selector-data-scope\n *ngIf=\"this.hasPermissionToReadAnyMeasurements\"\n [disabledAggregationOptions]=\"disabledAggregationOptions\"\n [formGroup]=\"formGroup\"\n (onAggregationChange)=\"onAggregationChange($event)\"\n (onExportTypeChange)=\"onExportTypeChange($event)\"\n ></c8y-datapoints-export-selector-data-scope>\n </div>\n <div class=\"col-md-4\">\n <c8y-datapoints-export-selector-file-types\n *ngIf=\"this.hasPermissionToReadAnyMeasurements\"\n [dynamicFilesTypeMetadata]=\"dynamicFilesTypeMetadata\"\n [formGroup]=\"formGroup\"\n ></c8y-datapoints-export-selector-file-types>\n </div>\n </div>\n </div>\n <ng-container\n *ngIf=\"!isFullTypeOfExport && !hasFetchedDataAnyValuesToExport && !isPreviewLoading\"\n >\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 d-flex\">\n <div\n class=\"alert alert-warning center-block\"\n role=\"alert\"\n data-cy=\"file-exporter--no-data-available\"\n translate\n >\n No data available.\n </div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"datapointsExceedingBrowserDownloadLimit.length > 0\">\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 separator-bottom d-flex\">\n <div\n [class]=\"\n hasNoExportableData\n ? 'alert alert-warning center-block'\n : 'alert alert-info center-block'\n \"\n role=\"alert\"\n [attr.data-cy]=\"\n hasNoExportableData\n ? 'file-exporter--over-one-million-message'\n : 'file-exporter--over-50k-message'\n \"\n [innerHTML]=\"limitExceededMessage\"\n ></div>\n </div>\n </ng-container>\n <ng-container *ngIf=\"isFullTypeOfExport\">\n <c8y-datapoints-export-selector-preview\n *ngIf=\"this.hasPermissionToReadAnyMeasurements\"\n [hasFetchedDataAnyValuesToExport]=\"hasFetchedDataAnyValuesToExport\"\n [isPreviewLoading]=\"isPreviewLoading\"\n [previewTableData]=\"previewTableData\"\n ></c8y-datapoints-export-selector-preview>\n </ng-container>\n </ng-container>\n <ng-template #hasNoRoleToReadAnyMeasurements>\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 d-flex\">\n <div\n class=\"alert alert-info center-block\"\n role=\"alert\"\n translate\n >\n <p>To export data, you must meet at least one of these criteria:</p>\n <ul>\n <li>\n Have\n <b>READ permission for \"Measurements\" permission type</b>\n (either as a global role or for the specific source)\n </li>\n <li>\n Be the\n <b>owner of the source</b>\n you want to export data from\n </li>\n </ul>\n <p>Don't meet these requirements? Contact your system administrator for assistance.</p>\n </div>\n </div>\n </ng-template>\n</div>\n","import { Inject, Injectable } from '@angular/core';\nimport JSZip from 'jszip';\nimport {\n DataToExport,\n ExportData,\n ExportedFile,\n FILE_COMPRESSION_TYPES_VALUES,\n FileCompressionTypes,\n FileGenerator,\n MEASUREMENTS_PREVIEW_ITEMS_LIMIT,\n MergedExportDetails,\n SERIES_DATA_MERGED_FILE_NAME,\n SeriesExportParams\n} from '../../datapoints-export-selector.model';\nimport { FILE_GENERATORS } from './datapoints-export-selector-file-exporter.component';\nimport { UtilsService } from './utils.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DataProcessingService {\n mergeMapping = {};\n fileTypesConfigs: {\n [key: string]: {\n extension: string;\n mimeType: string;\n acceptType: string;\n };\n };\n\n constructor(\n @Inject(FILE_GENERATORS) private fileGenerators: FileGenerator[],\n private utils: UtilsService\n ) {\n this.setGenerators(this.fileGenerators);\n\n this.fileTypesConfigs = this.fileGenerators.reduce((acc, g) => {\n acc[g.getType()] = {\n extension: g.getFileExtension(),\n mimeType: g.getMimeType(),\n acceptType: g.getAcceptType()\n };\n return acc;\n }, {});\n }\n\n setGenerators(fileGenerators: FileGenerator[]) {\n fileGenerators.forEach(g => {\n this.mergeMapping[g.getType()] = g.generateMerged;\n });\n }\n\n /**\n * Transforms the data into a structured format for an export.\n *\n * @param dataToExport - An array of processed measurement data combined with the respective properties of the datapoint.\n * @returns Provides a two-dimensional array of ExportData,\n * where each inner array contains ExportData entries representing the transformed measurements and metadata of each datapoint.\n */\n transformToExportFileStructure(dataToExport: DataToExport[]): ExportData[][] {\n const exportData: ExportData[][] = [];\n\n for (const data of dataToExport) {\n const rowsData: ExportData[] = this.processDataToExport(data);\n exportData.push(rowsData);\n }\n return exportData;\n }\n\n /**\n * Transforms the input datapoints with values into a structured format for a preview.\n *\n * @param dataToExport - An array of processed measurement data combined with the respective properties of the datapoint.\n * @returns Provides an array of up to 5 ExportData elements (no more is needed for a preview) or an empty array,\n */\n transformToExportFileStructureForPreview(dataToExport: DataToExport[]): ExportData[] {\n const data = dataToExport.find(data => {\n return data !== null && data.timeValueMap;\n });\n\n if (!data) {\n return [];\n }\n\n const exportData = this.processDataToExport(data);\n\n return exportData.slice(0, MEASUREMENTS_PREVIEW_ITEMS_LIMIT);\n }\n\n /**\n * Processes a single dataToExport and transforms it into an array of ExportData.\n *\n * Used further for creating series data based export and also for measurements and series data based preview.\n * Series data provides min and max values for each timestamp.\n *\n * @param dataToExport - A processed measurement or series data combined with the respective properties of the datapoint to be precessed\n * @returns An array of ExportData representing the processed datapoint,\n * that can be used as a row data in the exported files or for preview.\n */\n processDataToExport(dataToExport: DataToExport): ExportData[] {\n const rowsData: ExportData[] = [];\n\n // When measurements or series data is not available, add an empty header row with only device_name, source and fragment_series.\n // This data is needed later to be used to create the file name and merged file header string.\n const responseDoesNotContainData = !Object.keys(dataToExport.timeValueMap || {}).length;\n if (responseDoesNotContainData) {\n rowsData.push({\n time: null,\n source: dataToExport.source,\n device_name: dataToExport.deviceName,\n fragment_series: `${dataToExport.valueFragmentType}.${dataToExport.valueFragmentSeries}`,\n value: null,\n value_min: null,\n value_max: null,\n unit: null\n });\n return rowsData;\n }\n\n for (const [time, value] of Object.entries(dataToExport.timeValueMap)) {\n // Measurements data contains only one value as a number, series data contains object with min and max values.\n const isMeasurementData = typeof value === 'number';\n if (isMeasurementData) {\n rowsData.push(this.createExportData(dataToExport, time, isMeasurementData, value));\n } else {\n rowsData.push(\n this.createExportData(dataToExport, time, isMeasurementData, value.min, value.max)\n );\n }\n }\n return rowsData;\n }\n\n createExportData(\n dataToExport: DataToExport,\n time: string,\n isMeasurement: boolean,\n value: number,\n valueMax?: number\n ): ExportData {\n const commonExportData = {\n time: new Date(time).toISOString(),\n source: dataToExport.source,\n device_name: dataToExport.deviceName,\n fragment_series: `${dataToExport.valueFragmentType}.${dataToExport.valueFragmentSeries}`,\n unit: dataToExport.unit\n };\n\n return isMeasurement\n ? { ...commonExportData, value }\n : { ...commonExportData, value_min: value, value_max: valueMax };\n }\n\n /**\n * Exports the given data to merged CSV or Excel files.\n *\n * @param exportData - An array containing ExportData objects that will be used as parts of the merged file.\n * @param fileType - Indicates the type of the file to be exported.\n * @param mergedExportDetails - An object containing the date range from which the export was created and aggregation type.\n * @returns An objects containing file name and its respective content as Blob.\n *\n * Example of exported merged file structure:\n * date from\tdate to\n * 2024-04-15T12:14:00.000Z\t2024-07-16T14:14:28+02:00\n * time\t G6Fit -> c8y_Acceleration.accelerationX [G]\tG6Fit -> c8y_Acceleration.accelerationY [G]\n * 2024-05-13T13:45:10.500+02:00\t0.0109026359624273\t 0.789461628278069\n *\n * Example of exported file name format:\n * 04dec231240-06dec232350.xlsx\n */\n async exportSeriesDataToMergedFiles(\n exportData: ExportData[],\n fileType: string,\n mergedExportDetails: MergedExportDetails\n ): Promise<ExportedFile> {\n const fileTypeConfig = this.fileTypesConfigs[fileType];\n\n mergedExportDetails.dateFrom = new Date(mergedExportDetails.dateFrom).toISOString();\n mergedExportDetails.dateTo = new Date(mergedExportDetails.dateTo).toISOString();\n\n const mergedFileContent = this.mergeMapping[fileType](exportData, mergedExportDetails);\n\n const mergedFileNameDateRange = this.utils.getFormattedDateRange(\n mergedExportDetails.dateFrom,\n mergedExportDetails.dateTo\n );\n return {\n fileName: `${mergedFileNameDateRange}.${fileTypeConfig.extension}`,\n fileData: new Blob([await mergedFileContent], { type: fileTypeConfig.mimeType })\n };\n }\n\n /**\n * Zips all created files.\n *\n * @param files - An array of objects containing file names and their respective content as Blobs.\n * @returns A Promise that resolves to a Blob representing the generated zip file.\n */\n async zipFiles(files: ExportedFile[]): Promise<Blob> {\n const zip = new JSZip();\n\n files.forEach(file => {\n zip.file(file.fileName, file.fileData);\n });\n\n return await this.generateZipBlob(zip, FILE_COMPRESSION_TYPES_VALUES.deflate, 9);\n }\n\n /**\n * Exports the given data to CSV or Excel files.\n *\n * @param params - An object containing all the necessary parameters for the export and zip process.\n * @returns A Promise that resolves to a Blob representing the exported file.\n */\n async exportSeriesData(params: SeriesExportParams): Promise<Blob> {\n const { flattenedAndSortedExportData, fileType, mergedExportDetails } = params;\n const exportedMergedFile: ExportedFile = await this.exportSeriesDataToMergedFiles(\n flattenedAndSortedExportData,\n fileType,\n mergedExportDetails\n );\n\n const blob = new Blob([exportedMergedFile.fileData], { type: fileType });\n\n Object.defineProperty(blob, SERIES_DATA_MERGED_FILE_NAME, {\n value: exportedMergedFile.fileName,\n writable: false,\n enumerable: false,\n configurable: true\n });\n\n return blob;\n }\n\n createFileName(source: string | number, fragmentSeries: string, fileExtension: string): string {\n return `${source}_${fragmentSeries}.${fileExtension}`;\n }\n\n /**\n * Generates a zip blob using the provided zip object.\n *\n * @param zip - The zip object used for generating the blob.\n * @param compressionType - The compression type for the zip file. 'STORE' is no compression, 'DEFLATE' is compression.\n * @param compressionLevel - The compression level for the zip file.\n * Level 1 is quickest, 9 is best compressed.\n * @returns A Promise that resolves to a Blob containing the generated zip file.\n */\n private async generateZipBlob(\n zip: JSZip,\n compressionType: FileCompressionTypes = FILE_COMPRESSION_TYPES_VALUES.store,\n compressionLevel = 1\n ): Promise<Blob> {\n const blob = 'blob';\n\n if (compressionType === FILE_COMPRESSION_TYPES_VALUES.store) {\n return await zip.generateAsync({ type: blob });\n }\n return await zip.generateAsync({\n type: blob,\n compression: compressionType,\n compressionOptions: {\n level: compressionLevel\n }\n });\n }\n}\n","import { Component, HostListener, ViewChild } from '@angular/core';\nimport { gettext } from '@c8y/ngx-components/gettext';\nimport { CommonModule, ModalLabels, ModalModule } from '@c8y/ngx-components';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { ExportConfig } from '../datapoints-export-selector.model';\nimport { DatapointsExportSelectorFileExporterComponent } from './datapoints-export-selector-file-exporter/datapoints-export-selector-file-exporter.component';\n\n@Component({\n selector: 'c8y-datapoints-export-selector-modal',\n templateUrl: './datapoints-export-selector-modal.component.html',\n standalone: true,\n imports: [CommonModule, DatapointsExportSelectorFileExporterComponent, ModalModule]\n})\nexport class DatapointsExportSelectorModalComponent {\n @ViewChild(DatapointsExportSelectorFileExporterComponent, { static: false })\n private datapointsExportSelectorFileExporterComponent: DatapointsExportSelectorFileExporterComponent;\n\n exportConfig: ExportConfig;\n isDownloadEnabled = false;\n labels: ModalLabels = { ok: gettext('Download'), cancel: gettext('Cancel') };\n\n result: Promise<boolean> = new Promise(resolve => {\n this._close = resolve;\n });\n\n private _close: (value: boolean) => void;\n\n constructor(private bsModalRef: BsModalRef) {}\n\n @HostListener('document:keydown', ['$event'])\n handleKeyboardEvent(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n this.dismiss();\n }\n }\n\n dismiss(): void {\n this._close(false);\n this.bsModalRef.hide();\n }\n\n async exportAndDownload(): Promise<void> {\n await this.datapointsExportSelectorFileExporterComponent.exportAndDownload();\n this.dismiss();\n }\n\n changeDownloadButtonState(isEnabled: boolean): void {\n this.isDownloadEnabled = isEnabled;\n }\n}\n","<c8y-modal\n [title]=\"'Generate export' | translate\"\n [labels]=\"labels\"\n [disabled]=\"!isDownloadEnabled\"\n [headerClasses]=\"'dialog-header'\"\n (onDismiss)=\"dismiss()\"\n (onClose)=\"exportAndDownload()\"\n>\n <ng-container c8y-modal-title>\n <span [c8yIcon]=\"'data-export'\"></span>\n </ng-container>\n <c8y-datapoints-export-selector-file-exporter\n [exportConfig]=\"exportConfig\"\n (onDownloadButtonStateChange)=\"changeDownloadButtonState($event)\"\n ></c8y-datapoints-export-selector-file-exporter>\n</c8y-modal>\n","import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { CommonModule, GainsightService } from '@c8y/ngx-components';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\nimport { DatapointsExportSelectorModalComponent } from './datapoints-export-selector-modal/datapoints-export-selector-modal.component';\nimport {\n ExportConfig,\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR\n} from './datapoints-export-selector.model';\n\n@Component({\n selector: 'c8y-datapoints-export-selector',\n templateUrl: './datapoints-export-selector.component.html',\n standalone: true,\n imports: [CommonModule, TooltipModule]\n})\nexport class DatapointsExportSelectorComponent {\n /**\n * CSS class for the container element.\n * Defaults to 'd-flex p-t-4 p-b-4' if not provided.\n */\n @Input() containerClass: string;\n /**\n * Configuration for the export selector modal.\n */\n @Input() exportConfig: ExportConfig;\n @Output() isOpen: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n readonly DEFAULT_CSS_STYLE = 'd-flex';\n\n constructor(\n private bsModalService: BsModalService,\n private gainsightService: GainsightService\n ) {}\n\n async openExportModal(): Promise<void> {\n this.gainsightService.triggerEvent(\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.EVENTS.EXPORT_SELECTOR,\n {\n action: PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.ACTIONS.OPEN_MODAL,\n component:\n PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR.COMPONENTS.DATAPOINTS_EXPORT_SELECTOR\n }\n );\n\n const exportConfig = this.exportConfig;\n const initialState: Pick<DatapointsExportSelectorModalComponent, 'exportConfig'> = {\n exportConfig\n };\n\n this.isOpen.emit(true);\n const modalRef = this.bsModalService.show(DatapointsExportSelectorModalComponent, {\n class: 'modal-lg',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title',\n initialState,\n ignoreBackdropClick: true\n }).content as DatapointsExportSelectorModalComponent;\n // Result will be 'false' on modal close or dismiss\n this.isOpen.emit(await modalRef.result);\n }\n}\n","@if (containerClass != 'd-contents') {\n <div [ngClass]=\"containerClass || DEFAULT_CSS_STYLE\">\n <button\n class=\"btn btn-default btn-sm\"\n [attr.aria-label]=\"'Generate export' | translate\"\n tooltip=\"{{ 'Generate export' | translate }}\"\n container=\"body\"\n type=\"button\"\n data-cy=\"datapoints-export-selector--open-export-button\"\n (click)=\"openExportModal()\"\n [adaptivePosition]=\"false\"\n [disabled]=\"!exportConfig\"\n [delay]=\"500\"\n >\n <i\n class=\"icon-14\"\n c8yIcon=\"data-export\"\n ></i>\n </button>\n </div>\n} @else {\n <button\n class=\"btn btn-link\"\n type=\"button\"\n (click)=\"openExportModal()\"\n [disabled]=\"!exportConfig\"\n >\n <i c8yIcon=\"data-export\"></i>\n {{ 'Generate export' | translate }}\n </button>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i4.UtilsService","i2.DataProcessingService","i3","i2","i4","takeUntil","i6","i5","i1.UtilsService","i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAM,SAAS,GAAG;AAClB,MAAM,gCAAgC,GAAG;AACzC,MAAM,4BAA4B,GAAG;AA6MrC,MAAM,kBAAkB,GAAG;AAChC,IAAA,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAW;AAC5C,IAAA,OAAO,EAAE,OAAO,CAAC,sBAAsB;;AAGzC;;;;;;;;;;;;;;;;;AAiBG;AACI,MAAM,kBAAkB,GAAG;AAChC,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE;;AAGJ,MAAM,6BAA6B,GAAG;AAC3C,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,OAAO,EAAE;;AAGJ,MAAM,6CAA6C,GAAG;AAC3D,IAAA,MAAM,EAAE;AACN,QAAA,eAAe,EAAE;AAClB,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,0BAA0B,EAAE,4BAA4B;AACxD,QAAA,wCAAwC,EAAE;AAC3C,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,UAAU,EAAE,WAAW;AACvB,QAAA,gBAAgB,EAAE;AACnB,KAAA;AACD,IAAA,aAAa,EAAE;AACb,QAAA,gBAAgB,EAAE,gBAAgB;AAClC,QAAA,mBAAmB,EAAE;AACtB;;;MC9NU,YAAY,C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