@northern.tech/store 0.19.2 → 0.21.0

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 (148) hide show
  1. package/dist/actions.cjs +3 -0
  2. package/dist/actions.cjs.map +1 -1
  3. package/dist/actions.d.cts +2 -1
  4. package/dist/actions.d.ts +2 -1
  5. package/dist/actions.js +3 -3
  6. package/dist/api/general-api.js +1 -1
  7. package/dist/api/users-api.js +1 -1
  8. package/dist/appSlice/constants.cjs +3 -45
  9. package/dist/appSlice/constants.cjs.map +1 -1
  10. package/dist/appSlice/constants.d.cts +0 -15
  11. package/dist/appSlice/constants.d.ts +0 -15
  12. package/dist/appSlice/constants.js +1 -1
  13. package/dist/appSlice/index.js +1 -1
  14. package/dist/appSlice/mocks.js +1 -1
  15. package/dist/appSlice/thunks.cjs +14 -56
  16. package/dist/appSlice/thunks.cjs.map +1 -1
  17. package/dist/appSlice/thunks.js +13 -13
  18. package/dist/auth.js +1 -1
  19. package/dist/{chunk-KJ2SUFAU.js → chunk-4UV7ZJXY.js} +77 -12
  20. package/dist/chunk-4UV7ZJXY.js.map +1 -0
  21. package/dist/{chunk-43ZBO3JW.js → chunk-4ZYLGBJU.js} +2 -2
  22. package/dist/{chunk-45BHMNX6.js → chunk-6PYYMAFS.js} +6 -6
  23. package/dist/{chunk-ZAZTNDSY.js → chunk-7KSKENLP.js} +3 -3
  24. package/dist/{chunk-AV7SRATY.js → chunk-7VFPMJCH.js} +6 -6
  25. package/dist/{chunk-B3C6H2PR.js → chunk-7WIISD2N.js} +17 -14
  26. package/dist/{chunk-B3C6H2PR.js.map → chunk-7WIISD2N.js.map} +1 -1
  27. package/dist/{chunk-AJ6DIDO4.js → chunk-DBBE6D36.js} +4 -46
  28. package/dist/chunk-DBBE6D36.js.map +1 -0
  29. package/dist/{chunk-RJRZXDVT.js → chunk-GHATCG2U.js} +2 -2
  30. package/dist/{chunk-42GZ6FGV.js → chunk-PL6RIFD5.js} +2 -2
  31. package/dist/{chunk-VCEFZTWS.js → chunk-TIL2S3JA.js} +4 -1
  32. package/dist/chunk-TIL2S3JA.js.map +1 -0
  33. package/dist/{chunk-O7DR57RN.js → chunk-ZGRY42BZ.js} +9 -12
  34. package/dist/{chunk-O7DR57RN.js.map → chunk-ZGRY42BZ.js.map} +1 -1
  35. package/dist/{chunk-XOASGJZU.js → chunk-ZVE23XXF.js} +7 -7
  36. package/dist/{chunk-3NOV7X4M.js → chunk-ZZQJWNQT.js} +3 -1
  37. package/dist/chunk-ZZQJWNQT.js.map +1 -0
  38. package/dist/commonConstants.js +1 -1
  39. package/dist/commonSelectors.cjs +11 -56
  40. package/dist/commonSelectors.cjs.map +1 -1
  41. package/dist/commonSelectors.js +7 -7
  42. package/dist/constants.cjs +3 -45
  43. package/dist/constants.cjs.map +1 -1
  44. package/dist/constants.js +1 -1
  45. package/dist/deploymentsSlice/constants.js +1 -1
  46. package/dist/deploymentsSlice/index.js +1 -1
  47. package/dist/deploymentsSlice/mocks.js +1 -1
  48. package/dist/deploymentsSlice/selectors.js +1 -1
  49. package/dist/deploymentsSlice/thunks.cjs +14 -56
  50. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  51. package/dist/deploymentsSlice/thunks.js +13 -13
  52. package/dist/devicesSlice/constants.js +1 -1
  53. package/dist/devicesSlice/index.js +1 -1
  54. package/dist/devicesSlice/mocks.js +1 -1
  55. package/dist/devicesSlice/selectors.cjs +8 -11
  56. package/dist/devicesSlice/selectors.cjs.map +1 -1
  57. package/dist/devicesSlice/selectors.js +2 -2
  58. package/dist/devicesSlice/thunks.cjs +14 -56
  59. package/dist/devicesSlice/thunks.cjs.map +1 -1
  60. package/dist/devicesSlice/thunks.js +13 -13
  61. package/dist/liststatehook.js +1 -1
  62. package/dist/locationutils.js +1 -1
  63. package/dist/monitorSlice/index.js +1 -1
  64. package/dist/monitorSlice/mocks.js +1 -1
  65. package/dist/monitorSlice/thunks.cjs +14 -56
  66. package/dist/monitorSlice/thunks.cjs.map +1 -1
  67. package/dist/monitorSlice/thunks.js +11 -11
  68. package/dist/onboardingSlice/thunks.cjs +14 -56
  69. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  70. package/dist/onboardingSlice/thunks.js +13 -13
  71. package/dist/organizationSlice/constants.js +1 -1
  72. package/dist/organizationSlice/index.cjs +3 -0
  73. package/dist/organizationSlice/index.cjs.map +1 -1
  74. package/dist/organizationSlice/index.d.cts +4 -1
  75. package/dist/organizationSlice/index.d.ts +4 -1
  76. package/dist/organizationSlice/index.js +2 -2
  77. package/dist/organizationSlice/mocks.cjs +175 -0
  78. package/dist/organizationSlice/mocks.cjs.map +1 -1
  79. package/dist/organizationSlice/mocks.d.cts +121 -2
  80. package/dist/organizationSlice/mocks.d.ts +121 -2
  81. package/dist/organizationSlice/mocks.js +87 -2
  82. package/dist/organizationSlice/mocks.js.map +1 -1
  83. package/dist/organizationSlice/selectors.cjs +3 -0
  84. package/dist/organizationSlice/selectors.cjs.map +1 -1
  85. package/dist/organizationSlice/selectors.d.cts +3 -2
  86. package/dist/organizationSlice/selectors.d.ts +3 -2
  87. package/dist/organizationSlice/selectors.js +4 -2
  88. package/dist/organizationSlice/thunks.cjs +97 -71
  89. package/dist/organizationSlice/thunks.cjs.map +1 -1
  90. package/dist/organizationSlice/thunks.d.cts +17 -3
  91. package/dist/organizationSlice/thunks.d.ts +17 -3
  92. package/dist/organizationSlice/thunks.js +19 -15
  93. package/dist/organizationSlice/types.cjs.map +1 -1
  94. package/dist/organizationSlice/types.d.cts +30 -7
  95. package/dist/organizationSlice/types.d.ts +30 -7
  96. package/dist/releasesSlice/index.js +1 -1
  97. package/dist/releasesSlice/mocks.js +1 -1
  98. package/dist/releasesSlice/selectors.cjs.map +1 -1
  99. package/dist/releasesSlice/selectors.js +3 -3
  100. package/dist/releasesSlice/thunks.cjs +14 -56
  101. package/dist/releasesSlice/thunks.cjs.map +1 -1
  102. package/dist/releasesSlice/thunks.js +11 -11
  103. package/dist/selectors.cjs +14 -56
  104. package/dist/selectors.cjs.map +1 -1
  105. package/dist/selectors.d.cts +1 -1
  106. package/dist/selectors.d.ts +1 -1
  107. package/dist/selectors.js +9 -7
  108. package/dist/sockethook.js +1 -1
  109. package/dist/store.cjs +3 -0
  110. package/dist/store.cjs.map +1 -1
  111. package/dist/store.js +4 -4
  112. package/dist/storehooks.cjs +91 -69
  113. package/dist/storehooks.cjs.map +1 -1
  114. package/dist/storehooks.js +13 -13
  115. package/dist/thunks.cjs +95 -69
  116. package/dist/thunks.cjs.map +1 -1
  117. package/dist/thunks.d.cts +1 -1
  118. package/dist/thunks.d.ts +1 -1
  119. package/dist/thunks.js +17 -13
  120. package/dist/useDeploymentDevice.cjs +14 -56
  121. package/dist/useDeploymentDevice.cjs.map +1 -1
  122. package/dist/useDeploymentDevice.js +13 -13
  123. package/dist/usersSlice/constants.js +1 -1
  124. package/dist/usersSlice/index.js +1 -1
  125. package/dist/usersSlice/mocks.js +1 -1
  126. package/dist/usersSlice/selectors.cjs +3 -45
  127. package/dist/usersSlice/selectors.cjs.map +1 -1
  128. package/dist/usersSlice/selectors.js +3 -3
  129. package/dist/usersSlice/thunks.cjs +14 -56
  130. package/dist/usersSlice/thunks.cjs.map +1 -1
  131. package/dist/usersSlice/thunks.js +13 -13
  132. package/dist/utils.cjs +18 -57
  133. package/dist/utils.cjs.map +1 -1
  134. package/dist/utils.d.cts +1 -3
  135. package/dist/utils.d.ts +1 -3
  136. package/dist/utils.js +2 -2
  137. package/package.json +1 -1
  138. package/dist/chunk-3NOV7X4M.js.map +0 -1
  139. package/dist/chunk-AJ6DIDO4.js.map +0 -1
  140. package/dist/chunk-KJ2SUFAU.js.map +0 -1
  141. package/dist/chunk-VCEFZTWS.js.map +0 -1
  142. /package/dist/{chunk-43ZBO3JW.js.map → chunk-4ZYLGBJU.js.map} +0 -0
  143. /package/dist/{chunk-45BHMNX6.js.map → chunk-6PYYMAFS.js.map} +0 -0
  144. /package/dist/{chunk-ZAZTNDSY.js.map → chunk-7KSKENLP.js.map} +0 -0
  145. /package/dist/{chunk-AV7SRATY.js.map → chunk-7VFPMJCH.js.map} +0 -0
  146. /package/dist/{chunk-RJRZXDVT.js.map → chunk-GHATCG2U.js.map} +0 -0
  147. /package/dist/{chunk-42GZ6FGV.js.map → chunk-PL6RIFD5.js.map} +0 -0
  148. /package/dist/{chunk-XOASGJZU.js.map → chunk-ZVE23XXF.js.map} +0 -0
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  getDeviceById
3
- } from "./chunk-KJ2SUFAU.js";
4
- import "./chunk-AV7SRATY.js";
5
- import "./chunk-45BHMNX6.js";
3
+ } from "./chunk-4UV7ZJXY.js";
4
+ import "./chunk-7VFPMJCH.js";
5
+ import "./chunk-6PYYMAFS.js";
6
6
  import {
7
7
  useAppDispatch
8
- } from "./chunk-ZAZTNDSY.js";
8
+ } from "./chunk-7KSKENLP.js";
9
9
  import "./chunk-XJLZK4QY.js";
10
10
  import "./chunk-IRQRV552.js";
11
- import "./chunk-RJRZXDVT.js";
11
+ import "./chunk-GHATCG2U.js";
12
12
  import "./chunk-TRKA7XYU.js";
13
13
  import "./chunk-YR65C62H.js";
14
- import "./chunk-VCEFZTWS.js";
14
+ import "./chunk-TIL2S3JA.js";
15
15
  import "./chunk-PVCHKW35.js";
16
16
  import "./chunk-CQXDAXQF.js";
17
17
  import "./chunk-VODRLEDP.js";
@@ -20,23 +20,23 @@ import "./chunk-OLKM53RL.js";
20
20
  import "./chunk-UVTLZV34.js";
21
21
  import "./chunk-53W2NRSL.js";
22
22
  import "./chunk-NMAXZ3ZY.js";
23
- import "./chunk-XOASGJZU.js";
24
- import "./chunk-42GZ6FGV.js";
25
- import "./chunk-43ZBO3JW.js";
26
- import "./chunk-3NOV7X4M.js";
23
+ import "./chunk-ZVE23XXF.js";
24
+ import "./chunk-PL6RIFD5.js";
25
+ import "./chunk-4ZYLGBJU.js";
26
+ import "./chunk-ZZQJWNQT.js";
27
27
  import "./chunk-YO22XLHI.js";
28
28
  import "./chunk-JIS4PA3R.js";
29
29
  import "./chunk-WR6RQKF5.js";
30
30
  import {
31
31
  getDevicesById
32
- } from "./chunk-O7DR57RN.js";
32
+ } from "./chunk-ZGRY42BZ.js";
33
33
  import "./chunk-4BHM6WVX.js";
34
- import "./chunk-B3C6H2PR.js";
34
+ import "./chunk-7WIISD2N.js";
35
35
  import "./chunk-WWED74SG.js";
36
36
  import "./chunk-2DYA3X77.js";
37
37
  import "./chunk-FAJ3I2UQ.js";
38
38
  import "./chunk-ZKAH3APE.js";
39
- import "./chunk-AJ6DIDO4.js";
39
+ import "./chunk-DBBE6D36.js";
40
40
 
41
41
  // src/useDeploymentDevice.ts
42
42
  import { useEffect, useRef } from "react";
@@ -9,7 +9,7 @@ import {
9
9
  import "../chunk-2DYA3X77.js";
10
10
  import "../chunk-FAJ3I2UQ.js";
11
11
  import "../chunk-ZKAH3APE.js";
12
- import "../chunk-AJ6DIDO4.js";
12
+ import "../chunk-DBBE6D36.js";
13
13
  export {
14
14
  OWN_USER_ID,
15
15
  READ_STATES,
@@ -9,7 +9,7 @@ import "../chunk-WWED74SG.js";
9
9
  import "../chunk-2DYA3X77.js";
10
10
  import "../chunk-FAJ3I2UQ.js";
11
11
  import "../chunk-ZKAH3APE.js";
12
- import "../chunk-AJ6DIDO4.js";
12
+ import "../chunk-DBBE6D36.js";
13
13
  export {
14
14
  actions,
15
15
  usersSlice_default as default,
@@ -12,7 +12,7 @@ import {
12
12
  import "../chunk-2DYA3X77.js";
13
13
  import "../chunk-FAJ3I2UQ.js";
14
14
  import "../chunk-ZKAH3APE.js";
15
- import "../chunk-AJ6DIDO4.js";
15
+ import "../chunk-DBBE6D36.js";
16
16
 
17
17
  // src/usersSlice/mocks.ts
18
18
  var userId = "a30a780b-b843-5344-80e3-0fd95a4f6fc3";
@@ -50,10 +50,6 @@ var import_constants2 = require("@northern.tech/utils/constants");
50
50
  // src/appSlice/constants.ts
51
51
  var import_icons_material = require("@mui/icons-material");
52
52
  var import_utils = require("@northern.tech/utils");
53
- var startingDeviceCount = {
54
- os: "for first 50 devices",
55
- professional: "for first 250 devices"
56
- };
57
53
  var chartTypes = {
58
54
  bar: { key: "bar", Icon: import_icons_material.BarChart },
59
55
  pie: { key: "pie", Icon: import_icons_material.PieChartOutline }
@@ -65,31 +61,17 @@ var PLANS = {
65
61
  os: {
66
62
  id: "os",
67
63
  name: "Basic",
68
- minimalDeviceCount: { standard: 50, micro: 100 },
69
- offer: true,
70
- price: "$34 / month",
71
- deviceCount: startingDeviceCount.os,
72
- description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan.",
73
- features: ["Access to core features of Mender", "Basic support"]
64
+ description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan."
74
65
  },
75
66
  professional: {
76
67
  id: "professional",
77
68
  name: "Professional",
78
- minimalDeviceCount: { standard: 250, micro: 500 },
79
- offer: true,
80
- price: "$291 / month",
81
- deviceCount: startingDeviceCount.professional,
82
- description: "Everything in Basic, plus enhanced update management and automation features.",
83
- features: ["Advanced OTA features", "Higher priority support"]
69
+ description: "Everything in Basic, plus enhanced update management and automation features."
84
70
  },
85
71
  enterprise: {
86
72
  id: "enterprise",
87
73
  name: "Enterprise",
88
- minimalDeviceCount: { standard: 1e3, micro: 2e3 },
89
- price: "Custom pricing",
90
- deviceCount: "Unlimited devices",
91
- description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote.",
92
- features: ["All Mender features", "Advanced security features", "SLA-backed support"]
74
+ description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote."
93
75
  }
94
76
  };
95
77
  var ADDONS = {
@@ -98,14 +80,6 @@ var ADDONS = {
98
80
  title: "Configure",
99
81
  description: "Seamlessly configure applications and devices remotely \u2013 configure each device to its environment.",
100
82
  needs: ["hasDeviceConfig"],
101
- os: {
102
- price: "$11/month",
103
- deviceCount: startingDeviceCount.os
104
- },
105
- professional: {
106
- price: "$65/month",
107
- deviceCount: startingDeviceCount.professional
108
- },
109
83
  eligible: ["os", "professional", "enterprise"]
110
84
  },
111
85
  monitor: {
@@ -113,14 +87,6 @@ var ADDONS = {
113
87
  title: "Monitor",
114
88
  description: "Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.",
115
89
  needs: ["hasMonitor"],
116
- os: {
117
- price: "-",
118
- deviceCount: "-"
119
- },
120
- professional: {
121
- price: "$86/month",
122
- deviceCount: startingDeviceCount.professional
123
- },
124
90
  eligible: ["professional", "enterprise"]
125
91
  },
126
92
  troubleshoot: {
@@ -128,14 +94,6 @@ var ADDONS = {
128
94
  title: "Troubleshoot",
129
95
  description: "Secure, remote access to your devices \u2013 quickly diagnose and fix issues in real time.",
130
96
  needs: ["hasDeviceConnect"],
131
- os: {
132
- price: "$27/month",
133
- deviceCount: startingDeviceCount.os
134
- },
135
- professional: {
136
- price: "$72/month",
137
- deviceCount: startingDeviceCount.professional
138
- },
139
97
  eligible: ["os", "professional", "enterprise"]
140
98
  }
141
99
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/usersSlice/selectors.ts","../../src/constants.ts","../../src/appSlice/constants.ts","../../src/commonConstants.tsx","../../src/usersSlice/constants.ts","../../src/utils.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { DEVICE_ONLINE_CUTOFF, defaultIdAttribute } from '../constants';\nimport { twoFAStates } from '../constants';\nimport type { RootState } from '../store';\nimport { isDarkMode } from '../utils';\nimport { READ_STATES } from './constants';\nimport type { User } from './index';\n\nconst emptyObject = {} as User;\n\nexport const getRolesById = (state: RootState) => state.users.rolesById;\nexport const getTooltipsById = (state: RootState) => state.users.tooltips.byId;\nexport const getGlobalSettings = (state: RootState) => state.users.globalSettings;\nexport const getGlobalSettingsInitialized = (state: RootState) => state.users.settingsInitialized;\nexport const getUserSettingsInitialized = (state: RootState) => state.users.userSettingsInitialized;\nconst getCurrentUserId = (state: RootState) => state.users.currentUser;\nexport const getUsersById = (state: RootState) => state.users.byId;\n\nexport const getUsersList = createSelector([getUsersById], usersById => Object.values(usersById));\nexport const getCurrentUser = createSelector([getUsersById, getCurrentUserId], (usersById, userId) =>\n userId ? (usersById[userId] ?? emptyObject) : emptyObject\n);\nexport const getUserSettings = (state: RootState) => state.users.userSettings;\nexport const getSelectedDeviceAttribute = createSelector([getUserSettings], ({ columnSelection }) =>\n columnSelection.map(attribute => ({ attribute: attribute.key, scope: attribute.scope }))\n);\nexport const getIsDarkMode = createSelector([getUserSettings], ({ mode }) => isDarkMode(mode));\n\nexport const getReadAllHelptips = createSelector([getTooltipsById], tooltips =>\n Object.values(tooltips).every(({ readState }) => readState === READ_STATES.read)\n);\n\nexport const getTooltipsState = createSelector([getTooltipsById, getUserSettings], (byId, { tooltips = {} }) =>\n Object.entries(byId).reduce(\n (accu, [id, value]) => {\n accu[id] = { ...accu[id], ...value };\n return accu;\n },\n { ...tooltips }\n )\n);\n\nexport const getHas2FA = createSelector(\n [getCurrentUser],\n currentUser => currentUser.hasOwnProperty('tfa_status') && (currentUser as User).tfa_status === twoFAStates.enabled\n);\n\nexport const getIdAttribute = createSelector([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);\n\nexport const getOfflineThresholdSettings = createSelector([getGlobalSettings], ({ offlineThreshold }) => ({\n interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,\n intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName\n}));\n\nexport const getRolesList = createSelector([getRolesById], rolesById => Object.entries(rolesById).map(([value, role]) => ({ value, ...role })));\n\nexport const getCurrentSession = (state: RootState) => state.users.currentSession;\nexport const getRolesInitialized = (state: RootState) => state.users.rolesInitialized;\n\nexport const getSecurityAlertDismissedTimestamp = (state: RootState) => state.users.userSettings.securityAlertDismissedTimestamp;\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nconst startingDeviceCount = {\n os: 'for first 50 devices',\n professional: 'for first 250 devices'\n} as const;\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n deviceCount: string;\n features: string[];\n id: AvailablePlans;\n minimalDeviceCount: { micro: number; standard: number };\n name: string;\n offer?: boolean;\n offerprice?: string;\n price: string;\n price2?: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n minimalDeviceCount: { standard: 50, micro: 100 },\n offer: true,\n price: '$34 / month',\n deviceCount: startingDeviceCount.os,\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.',\n features: ['Access to core features of Mender', 'Basic support']\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n minimalDeviceCount: { standard: 250, micro: 500 },\n offer: true,\n price: '$291 / month',\n deviceCount: startingDeviceCount.professional,\n description: 'Everything in Basic, plus enhanced update management and automation features.',\n features: ['Advanced OTA features', 'Higher priority support']\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n minimalDeviceCount: { standard: 1000, micro: 2000 },\n price: 'Custom pricing',\n deviceCount: 'Unlimited devices',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.',\n features: ['All Mender features', 'Advanced security features', 'SLA-backed support']\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n} & {\n [key in Exclude<AvailablePlans, 'enterprise'>]: {\n deviceCount: string;\n price: string;\n };\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Seamlessly configure applications and devices remotely – configure each device to its environment.',\n needs: ['hasDeviceConfig'],\n os: {\n price: '$11/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$65/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.',\n needs: ['hasMonitor'],\n os: {\n price: '-',\n deviceCount: '-'\n },\n professional: {\n price: '$86/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Secure, remote access to your devices – quickly diagnose and fix issues in real time.',\n needs: ['hasDeviceConnect'],\n os: {\n price: '$27/month',\n deviceCount: startingDeviceCount.os\n },\n professional: {\n price: '$72/month',\n deviceCount: startingDeviceCount.professional\n },\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: {\n id: 'auditlog',\n benefit: 'gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays',\n requiredPlan: PLANS.enterprise.id\n },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport { mdiAws as AWS, mdiMicrosoftAzure as Azure } from '@mdi/js';\nimport type { Integration } from '@northern.tech/types/MenderTypes';\n\nimport type { DEVICE_FILTERING_OPTIONS } from './constants';\nimport { ATTRIBUTE_SCOPES } from './constants';\n\nexport const timeUnits = {\n days: 'days',\n minutes: 'minutes',\n hours: 'hours'\n};\n\nexport const UNGROUPED_GROUP = { id: '*|=ungrouped=|*', name: 'Unassigned' };\n\nexport const DEVICE_LIST_MAXIMUM_LENGTH = 50;\n\nexport type FilterOperator = keyof typeof DEVICE_FILTERING_OPTIONS;\n\nconst oneSecond = 1000;\nexport const TIMEOUTS = {\n debounceDefault: 700,\n debounceShort: 300,\n halfASecond: 0.5 * oneSecond,\n oneSecond,\n twoSeconds: 2 * oneSecond,\n threeSeconds: 3 * oneSecond,\n fiveSeconds: 5 * oneSecond,\n refreshDefault: 10 * oneSecond,\n refreshLong: 60 * oneSecond\n};\n\nexport const DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };\n\nexport interface IdAttribute {\n attribute: string;\n scope: string;\n}\nexport const defaultIdAttribute: Readonly<IdAttribute> = Object.freeze({ attribute: 'id', scope: ATTRIBUTE_SCOPES.identity });\n\nexport const credentialTypes = {\n aws: 'aws',\n http: 'http',\n sas: 'sas',\n x509: 'x509'\n};\nexport const EXTERNAL_PROVIDER = {\n 'iot-core': {\n credentialsType: credentialTypes.aws,\n icon: AWS,\n title: 'AWS IoT Core',\n twinTitle: 'Device Shadow',\n provider: 'iot-core',\n enabled: true,\n deviceTwin: true,\n configHint: <>For help finding your AWS IoT Core connection string, check the AWS IoT documentation.</>\n },\n 'iot-hub': {\n credentialsType: credentialTypes.sas,\n icon: Azure,\n title: 'Azure IoT Hub',\n twinTitle: 'Device Twin',\n provider: 'iot-hub',\n enabled: true,\n deviceTwin: true,\n configHint: (\n <span>\n For help finding your Azure IoT Hub connection string, look under &apos;Shared access policies&apos; in the Microsoft Azure UI as described{' '}\n {\n <a\n href=\"https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n here\n </a>\n }\n .\n </span>\n )\n },\n webhook: {\n credentialsType: credentialTypes.http,\n deviceTwin: false,\n twinTitle: '',\n // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.\n enabled: false,\n provider: 'webhook'\n }\n} as const;\n\nexport interface Webhook extends Integration {\n provider: 'webhook';\n}\n\nexport const emptyWebhook: Webhook = {\n description: '',\n provider: 'webhook',\n credentials: {\n type: EXTERNAL_PROVIDER.webhook.credentialsType,\n [EXTERNAL_PROVIDER.webhook.credentialsType]: {\n secret: '',\n url: ''\n }\n }\n};\n\ninterface CountryType {\n code: string;\n label: string;\n}\nexport const MAX_PAGE_SIZE = 500;\nconst regionNames = new Intl.DisplayNames(['en'], { type: 'region' });\nexport const countries: readonly CountryType[] = [\n 'AD',\n 'AE',\n 'AF',\n 'AG',\n 'AI',\n 'AL',\n 'AM',\n 'AO',\n 'AQ',\n 'AR',\n 'AS',\n 'AT',\n 'AU',\n 'AW',\n 'AX',\n 'AZ',\n 'BA',\n 'BB',\n 'BD',\n 'BE',\n 'BF',\n 'BG',\n 'BH',\n 'BI',\n 'BJ',\n 'BL',\n 'BM',\n 'BN',\n 'BO',\n 'BR',\n 'BS',\n 'BT',\n 'BV',\n 'BW',\n 'BY',\n 'BZ',\n 'CA',\n 'CC',\n 'CD',\n 'CF',\n 'CG',\n 'CH',\n 'CI',\n 'CK',\n 'CL',\n 'CM',\n 'CN',\n 'CO',\n 'CR',\n 'CU',\n 'CV',\n 'CW',\n 'CX',\n 'CY',\n 'CZ',\n 'DE',\n 'DJ',\n 'DK',\n 'DM',\n 'DO',\n 'DZ',\n 'EC',\n 'EE',\n 'EG',\n 'EH',\n 'ER',\n 'ES',\n 'ET',\n 'FI',\n 'FJ',\n 'FK',\n 'FM',\n 'FO',\n 'FR',\n 'GA',\n 'GB',\n 'GD',\n 'GE',\n 'GF',\n 'GG',\n 'GH',\n 'GI',\n 'GL',\n 'GM',\n 'GN',\n 'GP',\n 'GQ',\n 'GR',\n 'GS',\n 'GT',\n 'GU',\n 'GW',\n 'GY',\n 'HK',\n 'HM',\n 'HN',\n 'HR',\n 'HT',\n 'HU',\n 'ID',\n 'IE',\n 'IL',\n 'IM',\n 'IN',\n 'IO',\n 'IQ',\n 'IR',\n 'IS',\n 'IT',\n 'JE',\n 'JM',\n 'JO',\n 'JP',\n 'KE',\n 'KG',\n 'KH',\n 'KI',\n 'KM',\n 'KN',\n 'KP',\n 'KR',\n 'KW',\n 'KY',\n 'KZ',\n 'LA',\n 'LB',\n 'LC',\n 'LI',\n 'LK',\n 'LR',\n 'LS',\n 'LT',\n 'LU',\n 'LV',\n 'LY',\n 'MA',\n 'MC',\n 'MD',\n 'ME',\n 'MF',\n 'MG',\n 'MH',\n 'MK',\n 'ML',\n 'MM',\n 'MN',\n 'MO',\n 'MP',\n 'MQ',\n 'MR',\n 'MS',\n 'MT',\n 'MU',\n 'MV',\n 'MW',\n 'MX',\n 'MY',\n 'MZ',\n 'NA',\n 'NC',\n 'NE',\n 'NF',\n 'NG',\n 'NI',\n 'NL',\n 'NO',\n 'NP',\n 'NR',\n 'NU',\n 'NZ',\n 'OM',\n 'PA',\n 'PE',\n 'PF',\n 'PG',\n 'PH',\n 'PK',\n 'PL',\n 'PM',\n 'PN',\n 'PR',\n 'PS',\n 'PT',\n 'PW',\n 'PY',\n 'QA',\n 'RE',\n 'RO',\n 'RS',\n 'RU',\n 'RW',\n 'SA',\n 'SB',\n 'SC',\n 'SD',\n 'SE',\n 'SG',\n 'SH',\n 'SI',\n 'SJ',\n 'SK',\n 'SL',\n 'SM',\n 'SN',\n 'SO',\n 'SR',\n 'SS',\n 'ST',\n 'SV',\n 'SX',\n 'SY',\n 'SZ',\n 'TC',\n 'TD',\n 'TF',\n 'TG',\n 'TH',\n 'TJ',\n 'TK',\n 'TL',\n 'TM',\n 'TN',\n 'TO',\n 'TR',\n 'TT',\n 'TV',\n 'TW',\n 'TZ',\n 'UA',\n 'UG',\n 'US',\n 'UY',\n 'UZ',\n 'VA',\n 'VC',\n 'VE',\n 'VG',\n 'VI',\n 'VN',\n 'VU',\n 'WF',\n 'WS',\n 'XK',\n 'YE',\n 'YT',\n 'ZA',\n 'ZM',\n 'ZW'\n]\n .map(code => ({ code, label: regionNames.of(code) }))\n .sort((a, b) => a.label.localeCompare(b.label));\n","'use strict';\n\n// Copyright 2015 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport type { DeviceAttribute } from '@northern.tech/types/DeviceAttribute';\nimport type { Scope } from '@northern.tech/types/MenderTypes';\nimport { duplicateFilter, yes } from '@northern.tech/utils/helpers';\n\nimport type { DeviceIssueOptionKey } from './constants';\nimport {\n ATTRIBUTE_SCOPES,\n DARK_MODE,\n DEPLOYMENT_STATES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_MAXIMUM_LENGTH,\n defaultStats,\n deploymentDisplayStates,\n deploymentStatesToSubstates,\n deploymentStatesToSubstatesWithSkipped,\n emptyFilter,\n emptyUiPermissions,\n softwareIndicator\n} from './constants';\nimport type { DeviceFilter, DeviceGroup, InventoryAttributes } from './devicesSlice';\n\n// for some reason these functions can not be stored in the deviceConstants...\nconst filterProcessors = {\n [DEVICE_FILTERING_OPTIONS.$gt.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$gte.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$lt.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$lte.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$ltne.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$in.key]: val => ('' + val).split(',').map(i => i.trim()),\n [DEVICE_FILTERING_OPTIONS.$nin.key]: val => ('' + val).split(',').map(i => i.trim()),\n [DEVICE_FILTERING_OPTIONS.$exists.key]: yes,\n [DEVICE_FILTERING_OPTIONS.$nexists.key]: () => false\n};\nconst filterAliases = {\n $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }\n};\nexport const mapFiltersToTerms = filters =>\n filters.map(filter => ({\n scope: filter.scope,\n attribute: filter.key,\n type: filterAliases[filter.operator]?.alias || filter.operator,\n value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value\n }));\nexport const mapTermsToFilters = terms =>\n terms.map(term => {\n const aliasedFilter = Object.entries(filterAliases).find(\n aliasDefinition => aliasDefinition[1].alias === term.type && aliasDefinition[1].value === term.value\n );\n const operator = aliasedFilter ? aliasedFilter[0] : term.type;\n return { scope: term.scope as Scope, key: term.attribute, operator, value: term.value };\n });\n\nconst convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) =>\n issuesSelection.map(item => {\n if (typeof DEVICE_ISSUE_OPTIONS[item].filterRule.value === 'function') {\n return { ...DEVICE_ISSUE_OPTIONS[item].filterRule, value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };\n }\n return DEVICE_ISSUE_OPTIONS[item].filterRule;\n });\n\nexport const convertDeviceListStateToFilters = ({\n filters = [],\n group,\n groups = { byId: {} },\n offlineThreshold,\n selectedIssues = [],\n status\n}: {\n filters?: DeviceFilter[];\n group?: string;\n groups?: { byId: Record<string, DeviceGroup> };\n offlineThreshold?: string;\n selectedIssues?: DeviceIssueOptionKey[];\n status?: string;\n}) => {\n let applicableFilters = [...filters];\n if (typeof group === 'string' && !(groups.byId[group]?.filters || applicableFilters).length) {\n applicableFilters.push({ key: 'group', value: group, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'system' });\n }\n const nonMonitorFilters = applicableFilters.filter(\n filter =>\n !Object.values(DEVICE_ISSUE_OPTIONS).some(\n ({ filterRule }) => filter.scope !== 'inventory' && filterRule.scope === filter.scope && filterRule.key === filter.key\n )\n );\n const deviceIssueFilters = convertIssueOptionsToFilters(selectedIssues, { offlineThreshold });\n applicableFilters = [...nonMonitorFilters, ...deviceIssueFilters];\n const effectiveFilters = status\n ? [...applicableFilters, { key: 'status', value: status, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'identity' }]\n : applicableFilters;\n return { applicableFilters: nonMonitorFilters, filterTerms: mapFiltersToTerms(effectiveFilters) };\n};\n\nconst filterCompare = (filter, item) => Object.keys(emptyFilter).every(key => item[key]?.toString() === filter[key]?.toString());\n\nexport const filtersFilter = (item, index, array) => {\n const firstIndex = array.findIndex(filter => filterCompare(filter, item));\n return firstIndex === index;\n};\n\nexport const listItemMapper = <T>(\n byId: Record<string, T>,\n ids: string[],\n { cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH, defaultObject = {} }: { cutOffSize?: number; defaultObject?: T }\n): T[] =>\n ids.slice(0, cutOffSize).reduce((accu, id) => {\n if (id && byId[id]) {\n accu.push({ ...defaultObject, ...byId[id] });\n }\n return accu;\n }, []);\n\nexport const mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) =>\n Object.entries(existingPermissions).reduce(\n (accu, [key, value]) => {\n let values;\n if (!accu[key]) {\n accu[key] = value;\n return accu;\n }\n if (Array.isArray(value)) {\n values = [...value, ...accu[key]].filter(duplicateFilter);\n } else {\n values = mergePermissions(accu[key], { ...value });\n }\n accu[key] = values;\n return accu;\n },\n { ...addedPermissions }\n );\n\nexport const mapUserRolesToUiPermissions = (userRoles, roles) =>\n userRoles.reduce(\n (accu, roleId) => {\n if (!(roleId && roles[roleId])) {\n return accu;\n }\n return mergePermissions(accu, roles[roleId].uiPermissions);\n },\n { ...emptyUiPermissions }\n );\n\nexport const progress = ({ loaded, total }) => {\n let uploadProgress = (loaded / total) * 100;\n return (uploadProgress = uploadProgress < 50 ? Math.ceil(uploadProgress) : Math.round(uploadProgress));\n};\n\nexport const extractErrorMessage = (err, fallback = '') =>\n err.response?.data?.error?.message || err.response?.data?.error || err.error || err.message || fallback;\n\nexport const ensureVersionString = (software, fallback) =>\n software.length && software !== 'artifact_name' ? (software.endsWith(softwareIndicator) ? software : `${software}${softwareIndicator}`) : fallback;\n\nexport const getComparisonCompatibleVersion = version => (isNaN(version.charAt(0)) && version !== 'next' ? 'master' : version);\n\nexport const stringToBoolean = content => {\n if (!content) {\n return false;\n }\n const string = content + '';\n switch (string.trim().toLowerCase()) {\n case 'true':\n case 'yes':\n case '1':\n return true;\n case 'false':\n case 'no':\n case '0':\n case null:\n return false;\n default:\n return Boolean(string);\n }\n};\n\nexport const groupDeploymentDevicesStats = deployment => {\n const deviceStatCollector = (deploymentStates, devices) =>\n Object.values(devices).reduce((accu, device) => (deploymentStates.includes(device.status) ? accu + 1 : accu), 0);\n\n const inprogress = deviceStatCollector(deploymentStatesToSubstates.inprogress, deployment.devices);\n const pending = deviceStatCollector(deploymentStatesToSubstates.pending, deployment.devices);\n const successes = deviceStatCollector(deploymentStatesToSubstates.successes, deployment.devices);\n const failures = deviceStatCollector(deploymentStatesToSubstates.failures, deployment.devices);\n const paused = deviceStatCollector(deploymentStatesToSubstates.paused, deployment.devices);\n return { inprogress, paused, pending, successes, failures };\n};\n\nexport const statCollector = (items, statistics) => items.reduce((accu, property) => accu + Number(statistics[property] || 0), 0);\nexport const groupDeploymentStats = (deployment, withSkipped) => {\n const { statistics = {} } = deployment;\n const { status = {} } = statistics;\n const stats = { ...defaultStats, ...status };\n let groupStates = deploymentStatesToSubstates;\n let result = {};\n if (withSkipped) {\n groupStates = deploymentStatesToSubstatesWithSkipped;\n result.skipped = statCollector(groupStates.skipped, stats);\n }\n result = {\n ...result,\n // don't include 'pending' as inprogress, as all remaining devices will be pending - we don't discriminate based on phase membership\n inprogress: statCollector(groupStates.inprogress, stats),\n pending: statCollector(groupStates.pending, stats),\n successes: statCollector(groupStates.successes, stats),\n failures: statCollector(groupStates.failures, stats),\n paused: statCollector(groupStates.paused, stats)\n };\n return result;\n};\n\nexport const getDeploymentState = deployment => {\n const { status: deploymentStatus = DEPLOYMENT_STATES.pending } = deployment;\n const { inprogress: currentProgressCount, paused } = groupDeploymentStats(deployment);\n\n let status = deploymentDisplayStates[deploymentStatus];\n if (deploymentStatus === DEPLOYMENT_STATES.pending && currentProgressCount === 0) {\n status = 'queued';\n } else if (paused > 0) {\n status = deploymentDisplayStates.paused;\n }\n return status;\n};\n\nexport const generateDeploymentGroupDetails = (filter, groupName) =>\n filter && filter.terms?.length\n ? `${groupName} (${filter.terms\n .map(filter => `${filter.attribute || filter.key} ${DEVICE_FILTERING_OPTIONS[filter.type || filter.operator].shortform} ${filter.value}`)\n .join(', ')})`\n : groupName;\n\nexport const mapDeviceAttributes = (\n attributes: DeviceAttribute[] = []\n): {\n identity: Record<string, string>;\n inventory: InventoryAttributes;\n monitor: Record<string, string>;\n system: Record<string, string>;\n tags: Record<string, string>;\n} =>\n attributes.reduce(\n (accu, attribute) => {\n if (!(attribute.value && attribute.name) && attribute.scope === ATTRIBUTE_SCOPES.inventory) {\n return accu;\n }\n accu[attribute.scope || ATTRIBUTE_SCOPES.inventory] = {\n ...accu[attribute.scope || ATTRIBUTE_SCOPES.inventory],\n [attribute.name]: attribute.value\n };\n if (attribute.name === 'device_type' && attribute.scope === ATTRIBUTE_SCOPES.inventory) {\n accu.inventory.device_type = [].concat(attribute.value);\n }\n return accu;\n },\n { inventory: { device_type: [], artifact_name: '' }, identity: {}, monitor: {}, system: {}, tags: {} }\n );\n\nexport const isDarkMode = mode => mode === DARK_MODE;\ntype Line = { addon?: string; amount: number; currency: string; description: string; product: 'mender_standard' | 'mender_micro'; quantity: number };\n\nexport const parseSubscriptionPreview = (lines: Line[]) =>\n lines.reduce(\n (acc, { addon, amount, product }) => {\n const planId = product.slice('mender_'.length);\n if (!addon) {\n acc[planId] = (acc[planId] ?? 0) + amount;\n } else {\n acc.addons[addon] = (acc.addons[addon] ?? 0) + amount;\n }\n return acc;\n },\n { addons: {} }\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,qBAA+B;;;ACC/B,IAAAA,oBA8CO;;;AC/CP,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;AAOA,IAAM,cAAc,IAAI,KAAK,aAAa,CAAC,IAAI,GAAG,EAAE,MAAM,SAAS,CAAC;AAC7D,IAAM,YAAoC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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xG,OAAO,QAAQ,IAAI,EAAE;AAAA,IACnB,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM;AACrB,WAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,GAAG,MAAM;AACnC,aAAO;AAAA,IACT;AAAA,IACA,EAAE,GAAG,SAAS;AAAA,EAChB;AACF;AAEO,IAAM,gBAAY;AAAA,EACvB,CAAC,cAAc;AAAA,EACf,iBAAe,YAAY,eAAe,YAAY,KAAM,YAAqB,eAAe,8BAAY;AAC9G;AAEO,IAAM,qBAAiB,+BAAe,CAAC,iBAAiB,GAAG,CAAC,EAAE,eAAe,EAAE,GAAG,mBAAmB,EAAE,MAAM,YAAY;AAEzH,IAAM,kCAA8B,+BAAe,CAAC,iBAAiB,GAAG,CAAC,EAAE,iBAAiB,OAAO;AAAA,EACxG,UAAU,kBAAkB,YAAY,qBAAqB;AAAA,EAC7D,cAAc,kBAAkB,gBAAgB,qBAAqB;AACvE,EAAE;AAEK,IAAM,mBAAe,+BAAe,CAAC,YAAY,GAAG,CAAAC,eAAa,OAAO,QAAQA,UAAS,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AAEvI,IAAM,oBAAoB,CAAC,UAAqB,MAAM,MAAM;AAC5D,IAAM,sBAAsB,CAAC,UAAqB,MAAM,MAAM;AAE9D,IAAM,qCAAqC,CAAC,UAAqB,MAAM,MAAM,aAAa;","names":["import_constants","BarChartIcon","PieChartIcon","AWS","Azure","rolesById"]}
1
+ {"version":3,"sources":["../../src/usersSlice/selectors.ts","../../src/constants.ts","../../src/appSlice/constants.ts","../../src/commonConstants.tsx","../../src/usersSlice/constants.ts","../../src/utils.ts"],"sourcesContent":["// Copyright 2023 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport { DEVICE_ONLINE_CUTOFF, defaultIdAttribute } from '../constants';\nimport { twoFAStates } from '../constants';\nimport type { RootState } from '../store';\nimport { isDarkMode } from '../utils';\nimport { READ_STATES } from './constants';\nimport type { User } from './index';\n\nconst emptyObject = {} as User;\n\nexport const getRolesById = (state: RootState) => state.users.rolesById;\nexport const getTooltipsById = (state: RootState) => state.users.tooltips.byId;\nexport const getGlobalSettings = (state: RootState) => state.users.globalSettings;\nexport const getGlobalSettingsInitialized = (state: RootState) => state.users.settingsInitialized;\nexport const getUserSettingsInitialized = (state: RootState) => state.users.userSettingsInitialized;\nconst getCurrentUserId = (state: RootState) => state.users.currentUser;\nexport const getUsersById = (state: RootState) => state.users.byId;\n\nexport const getUsersList = createSelector([getUsersById], usersById => Object.values(usersById));\nexport const getCurrentUser = createSelector([getUsersById, getCurrentUserId], (usersById, userId) =>\n userId ? (usersById[userId] ?? emptyObject) : emptyObject\n);\nexport const getUserSettings = (state: RootState) => state.users.userSettings;\nexport const getSelectedDeviceAttribute = createSelector([getUserSettings], ({ columnSelection }) =>\n columnSelection.map(attribute => ({ attribute: attribute.key, scope: attribute.scope }))\n);\nexport const getIsDarkMode = createSelector([getUserSettings], ({ mode }) => isDarkMode(mode));\n\nexport const getReadAllHelptips = createSelector([getTooltipsById], tooltips =>\n Object.values(tooltips).every(({ readState }) => readState === READ_STATES.read)\n);\n\nexport const getTooltipsState = createSelector([getTooltipsById, getUserSettings], (byId, { tooltips = {} }) =>\n Object.entries(byId).reduce(\n (accu, [id, value]) => {\n accu[id] = { ...accu[id], ...value };\n return accu;\n },\n { ...tooltips }\n )\n);\n\nexport const getHas2FA = createSelector(\n [getCurrentUser],\n currentUser => currentUser.hasOwnProperty('tfa_status') && (currentUser as User).tfa_status === twoFAStates.enabled\n);\n\nexport const getIdAttribute = createSelector([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);\n\nexport const getOfflineThresholdSettings = createSelector([getGlobalSettings], ({ offlineThreshold }) => ({\n interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,\n intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName\n}));\n\nexport const getRolesList = createSelector([getRolesById], rolesById => Object.entries(rolesById).map(([value, role]) => ({ value, ...role })));\n\nexport const getCurrentSession = (state: RootState) => state.users.currentSession;\nexport const getRolesInitialized = (state: RootState) => state.users.rolesInitialized;\n\nexport const getSecurityAlertDismissedTimestamp = (state: RootState) => state.users.userSettings.securityAlertDismissedTimestamp;\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n","// Copyright 2019 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { BarChart as BarChartIcon, PieChartOutline as PieChartIcon } from '@mui/icons-material';\n\nimport { yes as yesUtil } from '@northern.tech/utils';\n\nexport const chartTypes = {\n bar: { key: 'bar', Icon: BarChartIcon },\n pie: { key: 'pie', Icon: PieChartIcon }\n} as const;\nexport const emptyChartSelection = { software: '', group: '', chartType: chartTypes.bar.key, attribute: 'artifact_name' };\nexport const defaultReportType = 'distribution';\nexport const defaultReports = [{ ...emptyChartSelection, group: null, attribute: 'artifact_name', type: defaultReportType }];\n\nexport const BEGINNING_OF_TIME = '2016-01-01T00:00:00.000Z';\n\nexport const locations = {\n cn: { key: 'cn', title: 'China', location: 'hosted.mender.cn' },\n eu: { key: 'eu', title: 'EU', location: 'eu.hosted.mender.io' },\n us: { key: 'us', title: 'US', location: 'hosted.mender.io' }\n} as const;\nexport type AvailablePlans = 'os' | 'professional' | 'enterprise';\n\nexport type Plan = {\n description: string;\n id: AvailablePlans;\n name: string;\n};\n\nexport type AvailableAddon = 'configure' | 'troubleshoot' | 'monitor';\n\nexport const PLANS: { [key in AvailablePlans]: Plan } = {\n os: {\n id: 'os',\n name: 'Basic',\n description:\n 'The core features of Mender. To continue using Enterprise Trial features—like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more—please upgrade to a higher plan.'\n },\n professional: {\n id: 'professional',\n name: 'Professional',\n description: 'Everything in Basic, plus enhanced update management and automation features.'\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n description:\n 'Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription — ask us for a quote.'\n }\n} as const;\nexport type Addon = {\n description: string;\n eligible: AvailablePlans[];\n id: string;\n needs: string[];\n title: string;\n};\n\nexport type AddonId = keyof typeof ADDONS;\n\n// the needs names need to be aligned with the name of the features in the appReducer, as they will be checked in the addonselection\nexport const ADDONS: { [key in AvailableAddon]: Addon } = {\n configure: {\n id: 'configure',\n title: 'Configure',\n description: 'Seamlessly configure applications and devices remotely – configure each device to its environment.',\n needs: ['hasDeviceConfig'],\n eligible: ['os', 'professional', 'enterprise']\n },\n monitor: {\n id: 'monitor',\n title: 'Monitor',\n description: 'Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.',\n needs: ['hasMonitor'],\n eligible: ['professional', 'enterprise']\n },\n troubleshoot: {\n id: 'troubleshoot',\n title: 'Troubleshoot',\n description: 'Secure, remote access to your devices – quickly diagnose and fix issues in real time.',\n needs: ['hasDeviceConnect'],\n eligible: ['os', 'professional', 'enterprise']\n }\n};\n\nexport const BENEFITS = {\n auditlog: {\n id: 'auditlog',\n benefit: 'gain access to logs for important events such as changes to devices, deployments and user management, as well as remote terminal session replays',\n requiredPlan: PLANS.enterprise.id\n },\n dashboard: { id: 'dashboard', benefit: 'actionable insights into the devices you are updating with Mender', requiredPlan: PLANS.enterprise.id },\n deltaGeneration: {\n id: 'deltaGeneration',\n benefit: 'automatic delta artifacts generation to minimize data transfer and improve the update delivery',\n requiredPlan: PLANS.enterprise.id\n },\n deviceConfiguration: { id: 'deviceConfiguration', benefit: 'device configuration features', requiredAddon: ADDONS.configure.id },\n deviceMonitor: { id: 'deviceMonitor', benefit: 'device monitoring features', requiredAddon: ADDONS.monitor.id, requiredPlan: PLANS.professional.id },\n deviceTroubleshoot: { id: 'deviceTroubleshoot', benefit: 'device troubleshooting features', requiredAddon: ADDONS.troubleshoot.id },\n dynamicGroups: { id: 'dynamicGroups', benefit: 'create dynamic groups to ease device management', requiredPlan: PLANS.enterprise.id },\n fullFiltering: { id: 'fullFiltering', benefit: 'filtering by multiple attributes to improve the device overview', requiredPlan: PLANS.professional.id },\n gateway: { id: 'gateway', benefit: 'see devices connected to your gateway device for easy access', requiredPlans: PLANS.professional.id },\n pausedDeployments: {\n id: 'pausedDeployments',\n benefit: 'granular control about update rollout to allow synchronization across your fleet',\n requiredPlan: PLANS.enterprise.id\n },\n phasedDeployments: { id: 'phasedDeployments', benefit: 'choose to roll out deployments in multiple phases', requiredPlan: PLANS.enterprise.id },\n rbac: { id: 'rbac', benefit: 'granular role based access control', requiredPlan: PLANS.enterprise.id },\n retryDeployments: { id: 'retryDeployments', benefit: 'optional retries for failed rollout attempts', requiredPlan: PLANS.professional.id },\n scheduledDeployments: {\n id: 'scheduledDeployments',\n benefit: 'scheduled deployments to steer the distribution of your updates.',\n requiredPlan: PLANS.professional.id\n },\n webhookEvents: {\n id: 'webhookEvents',\n benefit: 'receive inventory events and select which type(s) of events the webhook will receive',\n requiredPlan: PLANS.professional.id\n },\n\n default: { id: 'default', benefit: 'gain access to this feature', requiredPlan: PLANS.enterprise.id }\n} as const;\n\nexport const yes = yesUtil;\nexport const canAccess = yes;\n\nexport const DARK_MODE = 'dark';\nexport const LIGHT_MODE = 'light';\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport { mdiAws as AWS, mdiMicrosoftAzure as Azure } from '@mdi/js';\nimport type { Integration } from '@northern.tech/types/MenderTypes';\n\nimport type { DEVICE_FILTERING_OPTIONS } from './constants';\nimport { ATTRIBUTE_SCOPES } from './constants';\n\nexport const timeUnits = {\n days: 'days',\n minutes: 'minutes',\n hours: 'hours'\n};\n\nexport const UNGROUPED_GROUP = { id: '*|=ungrouped=|*', name: 'Unassigned' };\n\nexport const DEVICE_LIST_MAXIMUM_LENGTH = 50;\n\nexport type FilterOperator = keyof typeof DEVICE_FILTERING_OPTIONS;\n\nconst oneSecond = 1000;\nexport const TIMEOUTS = {\n debounceDefault: 700,\n debounceShort: 300,\n halfASecond: 0.5 * oneSecond,\n oneSecond,\n twoSeconds: 2 * oneSecond,\n threeSeconds: 3 * oneSecond,\n fiveSeconds: 5 * oneSecond,\n refreshDefault: 10 * oneSecond,\n refreshLong: 60 * oneSecond\n};\n\nexport const DEVICE_ONLINE_CUTOFF = { interval: 1, intervalName: timeUnits.days };\n\nexport interface IdAttribute {\n attribute: string;\n scope: string;\n}\nexport const defaultIdAttribute: Readonly<IdAttribute> = Object.freeze({ attribute: 'id', scope: ATTRIBUTE_SCOPES.identity });\n\nexport const credentialTypes = {\n aws: 'aws',\n http: 'http',\n sas: 'sas',\n x509: 'x509'\n};\nexport const EXTERNAL_PROVIDER = {\n 'iot-core': {\n credentialsType: credentialTypes.aws,\n icon: AWS,\n title: 'AWS IoT Core',\n twinTitle: 'Device Shadow',\n provider: 'iot-core',\n enabled: true,\n deviceTwin: true,\n configHint: <>For help finding your AWS IoT Core connection string, check the AWS IoT documentation.</>\n },\n 'iot-hub': {\n credentialsType: credentialTypes.sas,\n icon: Azure,\n title: 'Azure IoT Hub',\n twinTitle: 'Device Twin',\n provider: 'iot-hub',\n enabled: true,\n deviceTwin: true,\n configHint: (\n <span>\n For help finding your Azure IoT Hub connection string, look under &apos;Shared access policies&apos; in the Microsoft Azure UI as described{' '}\n {\n <a\n href=\"https://devblogs.microsoft.com/iotdev/understand-different-connection-strings-in-azure-iot-hub/#iothubconn\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n here\n </a>\n }\n .\n </span>\n )\n },\n webhook: {\n credentialsType: credentialTypes.http,\n deviceTwin: false,\n twinTitle: '',\n // disable the webhook provider here, since it is treated different than other integrations, with a custom configuration & management view, etc.\n enabled: false,\n provider: 'webhook'\n }\n} as const;\n\nexport interface Webhook extends Integration {\n provider: 'webhook';\n}\n\nexport const emptyWebhook: Webhook = {\n description: '',\n provider: 'webhook',\n credentials: {\n type: EXTERNAL_PROVIDER.webhook.credentialsType,\n [EXTERNAL_PROVIDER.webhook.credentialsType]: {\n secret: '',\n url: ''\n }\n }\n};\n\ninterface CountryType {\n code: string;\n label: string;\n}\nexport const MAX_PAGE_SIZE = 500;\nconst regionNames = new Intl.DisplayNames(['en'], { type: 'region' });\nexport const countries: readonly CountryType[] = [\n 'AD',\n 'AE',\n 'AF',\n 'AG',\n 'AI',\n 'AL',\n 'AM',\n 'AO',\n 'AQ',\n 'AR',\n 'AS',\n 'AT',\n 'AU',\n 'AW',\n 'AX',\n 'AZ',\n 'BA',\n 'BB',\n 'BD',\n 'BE',\n 'BF',\n 'BG',\n 'BH',\n 'BI',\n 'BJ',\n 'BL',\n 'BM',\n 'BN',\n 'BO',\n 'BR',\n 'BS',\n 'BT',\n 'BV',\n 'BW',\n 'BY',\n 'BZ',\n 'CA',\n 'CC',\n 'CD',\n 'CF',\n 'CG',\n 'CH',\n 'CI',\n 'CK',\n 'CL',\n 'CM',\n 'CN',\n 'CO',\n 'CR',\n 'CU',\n 'CV',\n 'CW',\n 'CX',\n 'CY',\n 'CZ',\n 'DE',\n 'DJ',\n 'DK',\n 'DM',\n 'DO',\n 'DZ',\n 'EC',\n 'EE',\n 'EG',\n 'EH',\n 'ER',\n 'ES',\n 'ET',\n 'FI',\n 'FJ',\n 'FK',\n 'FM',\n 'FO',\n 'FR',\n 'GA',\n 'GB',\n 'GD',\n 'GE',\n 'GF',\n 'GG',\n 'GH',\n 'GI',\n 'GL',\n 'GM',\n 'GN',\n 'GP',\n 'GQ',\n 'GR',\n 'GS',\n 'GT',\n 'GU',\n 'GW',\n 'GY',\n 'HK',\n 'HM',\n 'HN',\n 'HR',\n 'HT',\n 'HU',\n 'ID',\n 'IE',\n 'IL',\n 'IM',\n 'IN',\n 'IO',\n 'IQ',\n 'IR',\n 'IS',\n 'IT',\n 'JE',\n 'JM',\n 'JO',\n 'JP',\n 'KE',\n 'KG',\n 'KH',\n 'KI',\n 'KM',\n 'KN',\n 'KP',\n 'KR',\n 'KW',\n 'KY',\n 'KZ',\n 'LA',\n 'LB',\n 'LC',\n 'LI',\n 'LK',\n 'LR',\n 'LS',\n 'LT',\n 'LU',\n 'LV',\n 'LY',\n 'MA',\n 'MC',\n 'MD',\n 'ME',\n 'MF',\n 'MG',\n 'MH',\n 'MK',\n 'ML',\n 'MM',\n 'MN',\n 'MO',\n 'MP',\n 'MQ',\n 'MR',\n 'MS',\n 'MT',\n 'MU',\n 'MV',\n 'MW',\n 'MX',\n 'MY',\n 'MZ',\n 'NA',\n 'NC',\n 'NE',\n 'NF',\n 'NG',\n 'NI',\n 'NL',\n 'NO',\n 'NP',\n 'NR',\n 'NU',\n 'NZ',\n 'OM',\n 'PA',\n 'PE',\n 'PF',\n 'PG',\n 'PH',\n 'PK',\n 'PL',\n 'PM',\n 'PN',\n 'PR',\n 'PS',\n 'PT',\n 'PW',\n 'PY',\n 'QA',\n 'RE',\n 'RO',\n 'RS',\n 'RU',\n 'RW',\n 'SA',\n 'SB',\n 'SC',\n 'SD',\n 'SE',\n 'SG',\n 'SH',\n 'SI',\n 'SJ',\n 'SK',\n 'SL',\n 'SM',\n 'SN',\n 'SO',\n 'SR',\n 'SS',\n 'ST',\n 'SV',\n 'SX',\n 'SY',\n 'SZ',\n 'TC',\n 'TD',\n 'TF',\n 'TG',\n 'TH',\n 'TJ',\n 'TK',\n 'TL',\n 'TM',\n 'TN',\n 'TO',\n 'TR',\n 'TT',\n 'TV',\n 'TW',\n 'TZ',\n 'UA',\n 'UG',\n 'US',\n 'UY',\n 'UZ',\n 'VA',\n 'VC',\n 'VE',\n 'VG',\n 'VI',\n 'VN',\n 'VU',\n 'WF',\n 'WS',\n 'XK',\n 'YE',\n 'YT',\n 'ZA',\n 'ZM',\n 'ZW'\n]\n .map(code => ({ code, label: regionNames.of(code) }))\n .sort((a, b) => a.label.localeCompare(b.label));\n","'use strict';\n\n// Copyright 2015 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// @ts-nocheck\nimport type { DeviceAttribute } from '@northern.tech/types/DeviceAttribute';\nimport type { Scope } from '@northern.tech/types/MenderTypes';\nimport { duplicateFilter, yes } from '@northern.tech/utils/helpers';\n\nimport type { DeviceIssueOptionKey } from './constants';\nimport {\n ATTRIBUTE_SCOPES,\n DARK_MODE,\n DEPLOYMENT_STATES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_MAXIMUM_LENGTH,\n defaultStats,\n deploymentDisplayStates,\n deploymentStatesToSubstates,\n deploymentStatesToSubstatesWithSkipped,\n emptyFilter,\n emptyUiPermissions,\n softwareIndicator\n} from './constants';\nimport type { DeviceFilter, DeviceGroup, InventoryAttributes } from './devicesSlice';\n\n// for some reason these functions can not be stored in the deviceConstants...\nconst filterProcessors = {\n [DEVICE_FILTERING_OPTIONS.$gt.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$gte.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$lt.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$lte.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$ltne.key]: val => Number(val) || val,\n [DEVICE_FILTERING_OPTIONS.$in.key]: val => ('' + val).split(',').map(i => i.trim()),\n [DEVICE_FILTERING_OPTIONS.$nin.key]: val => ('' + val).split(',').map(i => i.trim()),\n [DEVICE_FILTERING_OPTIONS.$exists.key]: yes,\n [DEVICE_FILTERING_OPTIONS.$nexists.key]: () => false\n};\nconst filterAliases = {\n $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }\n};\nexport const mapFiltersToTerms = filters =>\n filters.map(filter => ({\n scope: filter.scope,\n attribute: filter.key,\n type: filterAliases[filter.operator]?.alias || filter.operator,\n value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value\n }));\nexport const mapTermsToFilters = terms =>\n terms.map(term => {\n const aliasedFilter = Object.entries(filterAliases).find(\n aliasDefinition => aliasDefinition[1].alias === term.type && aliasDefinition[1].value === term.value\n );\n const operator = aliasedFilter ? aliasedFilter[0] : term.type;\n return { scope: term.scope as Scope, key: term.attribute, operator, value: term.value };\n });\n\nconst convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) =>\n issuesSelection.map(item => {\n if (typeof DEVICE_ISSUE_OPTIONS[item].filterRule.value === 'function') {\n return { ...DEVICE_ISSUE_OPTIONS[item].filterRule, value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };\n }\n return DEVICE_ISSUE_OPTIONS[item].filterRule;\n });\n\nexport const convertDeviceListStateToFilters = ({\n filters = [],\n group,\n groups = { byId: {} },\n offlineThreshold,\n selectedIssues = [],\n status\n}: {\n filters?: DeviceFilter[];\n group?: string;\n groups?: { byId: Record<string, DeviceGroup> };\n offlineThreshold?: string;\n selectedIssues?: DeviceIssueOptionKey[];\n status?: string;\n}) => {\n let applicableFilters = [...filters];\n if (typeof group === 'string' && !(groups.byId[group]?.filters || applicableFilters).length) {\n applicableFilters.push({ key: 'group', value: group, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'system' });\n }\n const nonMonitorFilters = applicableFilters.filter(\n filter =>\n !Object.values(DEVICE_ISSUE_OPTIONS).some(\n ({ filterRule }) => filter.scope !== 'inventory' && filterRule.scope === filter.scope && filterRule.key === filter.key\n )\n );\n const deviceIssueFilters = convertIssueOptionsToFilters(selectedIssues, { offlineThreshold });\n applicableFilters = [...nonMonitorFilters, ...deviceIssueFilters];\n const effectiveFilters = status\n ? [...applicableFilters, { key: 'status', value: status, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: 'identity' }]\n : applicableFilters;\n return { applicableFilters: nonMonitorFilters, filterTerms: mapFiltersToTerms(effectiveFilters) };\n};\n\nconst filterCompare = (filter, item) => Object.keys(emptyFilter).every(key => item[key]?.toString() === filter[key]?.toString());\n\nexport const filtersFilter = (item, index, array) => {\n const firstIndex = array.findIndex(filter => filterCompare(filter, item));\n return firstIndex === index;\n};\n\nexport const listItemMapper = <T>(\n byId: Record<string, T>,\n ids: string[],\n { cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH, defaultObject = {} }: { cutOffSize?: number; defaultObject?: T }\n): T[] =>\n ids.slice(0, cutOffSize).reduce((accu, id) => {\n if (id && byId[id]) {\n accu.push({ ...defaultObject, ...byId[id] });\n }\n return accu;\n }, []);\n\nexport const mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) =>\n Object.entries(existingPermissions).reduce(\n (accu, [key, value]) => {\n let values;\n if (!accu[key]) {\n accu[key] = value;\n return accu;\n }\n if (Array.isArray(value)) {\n values = [...value, ...accu[key]].filter(duplicateFilter);\n } else {\n values = mergePermissions(accu[key], { ...value });\n }\n accu[key] = values;\n return accu;\n },\n { ...addedPermissions }\n );\n\nexport const mapUserRolesToUiPermissions = (userRoles, roles) =>\n userRoles.reduce(\n (accu, roleId) => {\n if (!(roleId && roles[roleId])) {\n return accu;\n }\n return mergePermissions(accu, roles[roleId].uiPermissions);\n },\n { ...emptyUiPermissions }\n );\n\nexport const progress = ({ loaded, total }) => {\n let uploadProgress = (loaded / total) * 100;\n return (uploadProgress = uploadProgress < 50 ? Math.ceil(uploadProgress) : Math.round(uploadProgress));\n};\n\nexport const extractErrorMessage = (err, fallback = '') =>\n err.response?.data?.error?.message || err.response?.data?.error || err.error || err.message || fallback;\n\nexport const ensureVersionString = (software, fallback) =>\n software.length && software !== 'artifact_name' ? (software.endsWith(softwareIndicator) ? software : `${software}${softwareIndicator}`) : fallback;\n\nexport const getComparisonCompatibleVersion = version => (isNaN(version.charAt(0)) && version !== 'next' ? 'master' : version);\n\nexport const stringToBoolean = content => {\n if (!content) {\n return false;\n }\n const string = content + '';\n switch (string.trim().toLowerCase()) {\n case 'true':\n case 'yes':\n case '1':\n return true;\n case 'false':\n case 'no':\n case '0':\n case null:\n return false;\n default:\n return Boolean(string);\n }\n};\n\nexport const groupDeploymentDevicesStats = deployment => {\n const deviceStatCollector = (deploymentStates, devices) =>\n Object.values(devices).reduce((accu, device) => (deploymentStates.includes(device.status) ? accu + 1 : accu), 0);\n\n const inprogress = deviceStatCollector(deploymentStatesToSubstates.inprogress, deployment.devices);\n const pending = deviceStatCollector(deploymentStatesToSubstates.pending, deployment.devices);\n const successes = deviceStatCollector(deploymentStatesToSubstates.successes, deployment.devices);\n const failures = deviceStatCollector(deploymentStatesToSubstates.failures, deployment.devices);\n const paused = deviceStatCollector(deploymentStatesToSubstates.paused, deployment.devices);\n return { inprogress, paused, pending, successes, failures };\n};\n\nexport const statCollector = (items, statistics) => items.reduce((accu, property) => accu + Number(statistics[property] || 0), 0);\nexport const groupDeploymentStats = (deployment, withSkipped) => {\n const { statistics = {} } = deployment;\n const { status = {} } = statistics;\n const stats = { ...defaultStats, ...status };\n let groupStates = deploymentStatesToSubstates;\n let result = {};\n if (withSkipped) {\n groupStates = deploymentStatesToSubstatesWithSkipped;\n result.skipped = statCollector(groupStates.skipped, stats);\n }\n result = {\n ...result,\n // don't include 'pending' as inprogress, as all remaining devices will be pending - we don't discriminate based on phase membership\n inprogress: statCollector(groupStates.inprogress, stats),\n pending: statCollector(groupStates.pending, stats),\n successes: statCollector(groupStates.successes, stats),\n failures: statCollector(groupStates.failures, stats),\n paused: statCollector(groupStates.paused, stats)\n };\n return result;\n};\n\nexport const getDeploymentState = deployment => {\n const { status: deploymentStatus = DEPLOYMENT_STATES.pending } = deployment;\n const { inprogress: currentProgressCount, paused } = groupDeploymentStats(deployment);\n\n let status = deploymentDisplayStates[deploymentStatus];\n if (deploymentStatus === DEPLOYMENT_STATES.pending && currentProgressCount === 0) {\n status = 'queued';\n } else if (paused > 0) {\n status = deploymentDisplayStates.paused;\n }\n return status;\n};\n\nexport const generateDeploymentGroupDetails = (filter, groupName) =>\n filter && filter.terms?.length\n ? `${groupName} (${filter.terms\n .map(filter => `${filter.attribute || filter.key} ${DEVICE_FILTERING_OPTIONS[filter.type || filter.operator].shortform} ${filter.value}`)\n .join(', ')})`\n : groupName;\n\nexport const mapDeviceAttributes = (\n attributes: DeviceAttribute[] = []\n): {\n identity: Record<string, string>;\n inventory: InventoryAttributes;\n monitor: Record<string, string>;\n system: Record<string, string>;\n tags: Record<string, string>;\n} =>\n attributes.reduce(\n (accu, attribute) => {\n if (!(attribute.value && attribute.name) && attribute.scope === ATTRIBUTE_SCOPES.inventory) {\n return accu;\n }\n accu[attribute.scope || ATTRIBUTE_SCOPES.inventory] = {\n ...accu[attribute.scope || ATTRIBUTE_SCOPES.inventory],\n [attribute.name]: attribute.value\n };\n if (attribute.name === 'device_type' && attribute.scope === ATTRIBUTE_SCOPES.inventory) {\n accu.inventory.device_type = [].concat(attribute.value);\n }\n return accu;\n },\n { inventory: { device_type: [], artifact_name: '' }, identity: {}, monitor: {}, system: {}, tags: {} }\n );\n\nexport const isDarkMode = mode => mode === DARK_MODE;\ntype Line = { addon?: string; amount: number; currency: string; description: string; product: 'mender_standard' | 'mender_micro'; quantity: number };\n\nexport const parseSubscriptionPreview = (lines: Line[]): Omit<PricePreview, 'total'> =>\n lines.reduce((acc, { addon, amount, product }) => {\n const tier = product.replace('mender_', '');\n if (!acc[tier]) {\n acc[tier] = {\n amount: 0,\n addons: {}\n };\n }\n if (!addon) {\n acc[tier].amount += amount;\n } else {\n acc[tier].addons[addon] = (acc[tier].addons[addon] ?? 0) + amount;\n }\n return acc;\n }, {});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,qBAA+B;;;ACC/B,IAAAA,oBA8CO;;;AC/CP,4BAA0E;AAE1E,mBAA+B;AAExB,IAAM,aAAa;AAAA,EACxB,KAAK,EAAE,KAAK,OAAO,MAAM,sBAAAC,SAAa;AAAA,EACtC,KAAK,EAAE,KAAK,OAAO,MAAM,sBAAAC,gBAAa;AACxC;AACO,IAAM,sBAAsB,EAAE,UAAU,IAAI,OAAO,IAAI,WAAW,WAAW,IAAI,KAAK,WAAW,gBAAgB;AACjH,IAAM,oBAAoB;AAC1B,IAAM,iBAAiB,CAAC,EAAE,GAAG,qBAAqB,OAAO,MAAM,WAAW,iBAAiB,MAAM,kBAAkB,CAAC;AAmBpH,IAAM,QAA2C;AAAA,EACtD,IAAI;AAAA,IACF,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EACJ;AAAA,EACA,cAAc;AAAA,IACZ,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,YAAY;AAAA,IAC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A;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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ACf,iBAAe,YAAY,eAAe,YAAY,KAAM,YAAqB,eAAe,8BAAY;AAC9G;AAEO,IAAM,qBAAiB,+BAAe,CAAC,iBAAiB,GAAG,CAAC,EAAE,eAAe,EAAE,GAAG,mBAAmB,EAAE,MAAM,YAAY;AAEzH,IAAM,kCAA8B,+BAAe,CAAC,iBAAiB,GAAG,CAAC,EAAE,iBAAiB,OAAO;AAAA,EACxG,UAAU,kBAAkB,YAAY,qBAAqB;AAAA,EAC7D,cAAc,kBAAkB,gBAAgB,qBAAqB;AACvE,EAAE;AAEK,IAAM,mBAAe,+BAAe,CAAC,YAAY,GAAG,CAAAC,eAAa,OAAO,QAAQA,UAAS,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AAEvI,IAAM,oBAAoB,CAAC,UAAqB,MAAM,MAAM;AAC5D,IAAM,sBAAsB,CAAC,UAAqB,MAAM,MAAM;AAE9D,IAAM,qCAAqC,CAAC,UAAqB,MAAM,MAAM,aAAa;","names":["import_constants","BarChartIcon","PieChartIcon","AWS","Azure","rolesById"]}
@@ -19,13 +19,13 @@ import {
19
19
  getUserSettingsInitialized,
20
20
  getUsersById,
21
21
  getUsersList
22
- } from "../chunk-43ZBO3JW.js";
23
- import "../chunk-B3C6H2PR.js";
22
+ } from "../chunk-4ZYLGBJU.js";
23
+ import "../chunk-7WIISD2N.js";
24
24
  import "../chunk-WWED74SG.js";
25
25
  import "../chunk-2DYA3X77.js";
26
26
  import "../chunk-FAJ3I2UQ.js";
27
27
  import "../chunk-ZKAH3APE.js";
28
- import "../chunk-AJ6DIDO4.js";
28
+ import "../chunk-DBBE6D36.js";
29
29
  export {
30
30
  getCurrentSession,
31
31
  getCurrentUser,
@@ -84,10 +84,6 @@ var import_constants5 = require("@northern.tech/utils/constants");
84
84
  // src/appSlice/constants.ts
85
85
  var import_icons_material = require("@mui/icons-material");
86
86
  var import_utils = require("@northern.tech/utils");
87
- var startingDeviceCount = {
88
- os: "for first 50 devices",
89
- professional: "for first 250 devices"
90
- };
91
87
  var chartTypes = {
92
88
  bar: { key: "bar", Icon: import_icons_material.BarChart },
93
89
  pie: { key: "pie", Icon: import_icons_material.PieChartOutline }
@@ -99,31 +95,17 @@ var PLANS = {
99
95
  os: {
100
96
  id: "os",
101
97
  name: "Basic",
102
- minimalDeviceCount: { standard: 50, micro: 100 },
103
- offer: true,
104
- price: "$34 / month",
105
- deviceCount: startingDeviceCount.os,
106
- description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan.",
107
- features: ["Access to core features of Mender", "Basic support"]
98
+ description: "The core features of Mender. To continue using Enterprise Trial features\u2014like Delta updates, scheduled deployments, phased rollouts, device filtering, dynamic groups, RBAC, audit logs, and more\u2014please upgrade to a higher plan."
108
99
  },
109
100
  professional: {
110
101
  id: "professional",
111
102
  name: "Professional",
112
- minimalDeviceCount: { standard: 250, micro: 500 },
113
- offer: true,
114
- price: "$291 / month",
115
- deviceCount: startingDeviceCount.professional,
116
- description: "Everything in Basic, plus enhanced update management and automation features.",
117
- features: ["Advanced OTA features", "Higher priority support"]
103
+ description: "Everything in Basic, plus enhanced update management and automation features."
118
104
  },
119
105
  enterprise: {
120
106
  id: "enterprise",
121
107
  name: "Enterprise",
122
- minimalDeviceCount: { standard: 1e3, micro: 2e3 },
123
- price: "Custom pricing",
124
- deviceCount: "Unlimited devices",
125
- description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote.",
126
- features: ["All Mender features", "Advanced security features", "SLA-backed support"]
108
+ description: "Every advanced feature of Mender, tailored for complex and large-scale deployments. Not available as a monthly subscription \u2014 ask us for a quote."
127
109
  }
128
110
  };
129
111
  var ADDONS = {
@@ -132,14 +114,6 @@ var ADDONS = {
132
114
  title: "Configure",
133
115
  description: "Seamlessly configure applications and devices remotely \u2013 configure each device to its environment.",
134
116
  needs: ["hasDeviceConfig"],
135
- os: {
136
- price: "$11/month",
137
- deviceCount: startingDeviceCount.os
138
- },
139
- professional: {
140
- price: "$65/month",
141
- deviceCount: startingDeviceCount.professional
142
- },
143
117
  eligible: ["os", "professional", "enterprise"]
144
118
  },
145
119
  monitor: {
@@ -147,14 +121,6 @@ var ADDONS = {
147
121
  title: "Monitor",
148
122
  description: "Detect and analyze health issues of devices, services and applications. Set up alerts so you can act quickly.",
149
123
  needs: ["hasMonitor"],
150
- os: {
151
- price: "-",
152
- deviceCount: "-"
153
- },
154
- professional: {
155
- price: "$86/month",
156
- deviceCount: startingDeviceCount.professional
157
- },
158
124
  eligible: ["professional", "enterprise"]
159
125
  },
160
126
  troubleshoot: {
@@ -162,14 +128,6 @@ var ADDONS = {
162
128
  title: "Troubleshoot",
163
129
  description: "Secure, remote access to your devices \u2013 quickly diagnose and fix issues in real time.",
164
130
  needs: ["hasDeviceConnect"],
165
- os: {
166
- price: "$27/month",
167
- deviceCount: startingDeviceCount.os
168
- },
169
- professional: {
170
- price: "$72/month",
171
- deviceCount: startingDeviceCount.professional
172
- },
173
131
  eligible: ["os", "professional", "enterprise"]
174
132
  }
175
133
  };
@@ -1556,6 +1514,9 @@ var organizationSlice = (0, import_toolkit7.createSlice)({
1556
1514
  setSubscription: (state, action) => {
1557
1515
  state.organization.subscription = { ...state.organization.subscription, ...action.payload };
1558
1516
  },
1517
+ setProducts: (state, action) => {
1518
+ state.products = action.payload;
1519
+ },
1559
1520
  setBillingProfile: (state, action) => {
1560
1521
  state.organization.billing_profile = action.payload;
1561
1522
  },
@@ -2000,17 +1961,14 @@ var getAttributesList = (0, import_toolkit11.createSelector)(
2000
1961
  [getFilteringAttributes, getFilteringAttributesFromConfig],
2001
1962
  ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers3.duplicateFilter)
2002
1963
  );
2003
- var getDeviceLimitStats = (0, import_toolkit11.createSelector)(
2004
- [getDeviceLimits, getAcceptedDevices],
2005
- (limits, accepted) => {
2006
- const { counts } = accepted;
2007
- return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
2008
- type,
2009
- limit,
2010
- total: counts[type] || 0
2011
- }));
2012
- }
2013
- );
1964
+ var getDeviceLimitStats = (0, import_toolkit11.createSelector)([getDeviceLimits, getAcceptedDevices], (limits, accepted) => {
1965
+ const { counts } = accepted;
1966
+ return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
1967
+ type,
1968
+ limit,
1969
+ total: counts[type] || 0
1970
+ }));
1971
+ });
2014
1972
  var getDeviceTypes = (0, import_toolkit11.createSelector)(
2015
1973
  [getAcceptedDevices, getDevicesById],
2016
1974
  ({ deviceIds = [] }, devicesById) => Object.keys(