unleash-server 7.3.0 → 7.4.1

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 (1436) hide show
  1. package/README.md +36 -36
  2. package/dist/lib/addons/datadog.js +1 -1
  3. package/dist/lib/addons/datadog.js.map +1 -1
  4. package/dist/lib/addons/datadog.test.js +11 -11
  5. package/dist/lib/addons/datadog.test.js.map +1 -1
  6. package/dist/lib/addons/feature-event-formatter-md-events.d.ts.map +1 -1
  7. package/dist/lib/addons/feature-event-formatter-md-events.js +11 -1
  8. package/dist/lib/addons/feature-event-formatter-md-events.js.map +1 -1
  9. package/dist/lib/addons/feature-event-formatter-md.test.js +8 -6
  10. package/dist/lib/addons/feature-event-formatter-md.test.js.map +1 -1
  11. package/dist/lib/addons/new-relic-definition.js +1 -1
  12. package/dist/lib/addons/new-relic-definition.js.map +1 -1
  13. package/dist/lib/addons/new-relic.js +4 -4
  14. package/dist/lib/addons/new-relic.js.map +1 -1
  15. package/dist/lib/addons/new-relic.test.js +4 -4
  16. package/dist/lib/addons/new-relic.test.js.map +1 -1
  17. package/dist/lib/addons/slack-app-definition.d.ts.map +1 -1
  18. package/dist/lib/addons/slack-app-definition.js +3 -1
  19. package/dist/lib/addons/slack-app-definition.js.map +1 -1
  20. package/dist/lib/addons/slack-app.test.js +1 -2
  21. package/dist/lib/addons/slack-app.test.js.map +1 -1
  22. package/dist/lib/addons/slack-definition.d.ts.map +1 -1
  23. package/dist/lib/addons/slack-definition.js +3 -1
  24. package/dist/lib/addons/slack-definition.js.map +1 -1
  25. package/dist/lib/addons/slack.js +1 -1
  26. package/dist/lib/addons/slack.js.map +1 -1
  27. package/dist/lib/addons/slack.test.js +1 -1
  28. package/dist/lib/addons/slack.test.js.map +1 -1
  29. package/dist/lib/addons/teams-definition.d.ts.map +1 -1
  30. package/dist/lib/addons/teams-definition.js +3 -1
  31. package/dist/lib/addons/teams-definition.js.map +1 -1
  32. package/dist/lib/addons/teams.js +1 -1
  33. package/dist/lib/addons/teams.js.map +1 -1
  34. package/dist/lib/addons/teams.test.js +1 -1
  35. package/dist/lib/addons/teams.test.js.map +1 -1
  36. package/dist/lib/addons/webhook-definition.d.ts.map +1 -1
  37. package/dist/lib/addons/webhook-definition.js +4 -2
  38. package/dist/lib/addons/webhook-definition.js.map +1 -1
  39. package/dist/lib/addons/webhook.js +1 -1
  40. package/dist/lib/addons/webhook.js.map +1 -1
  41. package/dist/lib/addons/webhook.test.js +3 -3
  42. package/dist/lib/addons/webhook.test.js.map +1 -1
  43. package/dist/lib/app.js +2 -2
  44. package/dist/lib/app.js.map +1 -1
  45. package/dist/lib/app.test.js +6 -2
  46. package/dist/lib/app.test.js.map +1 -1
  47. package/dist/lib/create-config.test.js +9 -2
  48. package/dist/lib/create-config.test.js.map +1 -1
  49. package/dist/lib/db/access-store.d.ts +1 -2
  50. package/dist/lib/db/access-store.d.ts.map +1 -1
  51. package/dist/lib/db/access-store.js +2 -3
  52. package/dist/lib/db/access-store.js.map +1 -1
  53. package/dist/lib/db/access-store.test.js +5 -1
  54. package/dist/lib/db/access-store.test.js.map +1 -1
  55. package/dist/lib/db/api-token-store.d.ts +1 -2
  56. package/dist/lib/db/api-token-store.d.ts.map +1 -1
  57. package/dist/lib/db/api-token-store.js +1 -2
  58. package/dist/lib/db/api-token-store.js.map +1 -1
  59. package/dist/lib/db/favorite-features-store.d.ts +1 -3
  60. package/dist/lib/db/favorite-features-store.d.ts.map +1 -1
  61. package/dist/lib/db/favorite-features-store.js +1 -3
  62. package/dist/lib/db/favorite-features-store.js.map +1 -1
  63. package/dist/lib/db/favorite-projects-store.d.ts +2 -3
  64. package/dist/lib/db/favorite-projects-store.d.ts.map +1 -1
  65. package/dist/lib/db/favorite-projects-store.js +20 -4
  66. package/dist/lib/db/favorite-projects-store.js.map +1 -1
  67. package/dist/lib/db/feature-environment-store.d.ts +1 -2
  68. package/dist/lib/db/feature-environment-store.d.ts.map +1 -1
  69. package/dist/lib/db/feature-environment-store.js +1 -2
  70. package/dist/lib/db/feature-environment-store.js.map +1 -1
  71. package/dist/lib/db/feature-type-store.d.ts +1 -2
  72. package/dist/lib/db/feature-type-store.d.ts.map +1 -1
  73. package/dist/lib/db/feature-type-store.js +1 -2
  74. package/dist/lib/db/feature-type-store.js.map +1 -1
  75. package/dist/lib/db/project-stats-store.d.ts +1 -2
  76. package/dist/lib/db/project-stats-store.d.ts.map +1 -1
  77. package/dist/lib/db/project-stats-store.js +1 -2
  78. package/dist/lib/db/project-stats-store.js.map +1 -1
  79. package/dist/lib/db/public-signup-token-store.d.ts +1 -2
  80. package/dist/lib/db/public-signup-token-store.d.ts.map +1 -1
  81. package/dist/lib/db/public-signup-token-store.js +1 -2
  82. package/dist/lib/db/public-signup-token-store.js.map +1 -1
  83. package/dist/lib/db/reset-token-store.d.ts +2 -3
  84. package/dist/lib/db/reset-token-store.d.ts.map +1 -1
  85. package/dist/lib/db/reset-token-store.js +31 -6
  86. package/dist/lib/db/reset-token-store.js.map +1 -1
  87. package/dist/lib/db/user-feedback-store.d.ts +1 -1
  88. package/dist/lib/db/user-feedback-store.d.ts.map +1 -1
  89. package/dist/lib/db/user-feedback-store.js +1 -1
  90. package/dist/lib/db/user-feedback-store.js.map +1 -1
  91. package/dist/lib/db/user-splash-store.d.ts +1 -1
  92. package/dist/lib/db/user-splash-store.d.ts.map +1 -1
  93. package/dist/lib/db/user-splash-store.js +1 -1
  94. package/dist/lib/db/user-splash-store.js.map +1 -1
  95. package/dist/lib/default-custom-auth-deny-all.js +1 -1
  96. package/dist/lib/default-custom-auth-deny-all.js.map +1 -1
  97. package/dist/lib/domain/project-health/project-health.js +1 -1
  98. package/dist/lib/domain/project-health/project-health.js.map +1 -1
  99. package/dist/lib/error/unleash-error.test.js +4 -1
  100. package/dist/lib/error/unleash-error.test.js.map +1 -1
  101. package/dist/lib/events/index.d.ts +5 -1
  102. package/dist/lib/events/index.d.ts.map +1 -1
  103. package/dist/lib/events/index.js +8 -0
  104. package/dist/lib/events/index.js.map +1 -1
  105. package/dist/lib/features/access/access-read-model.d.ts.map +1 -1
  106. package/dist/lib/features/access/access-read-model.js +3 -2
  107. package/dist/lib/features/access/access-read-model.js.map +1 -1
  108. package/dist/lib/features/access/createAccessService.d.ts +5 -1
  109. package/dist/lib/features/access/createAccessService.d.ts.map +1 -1
  110. package/dist/lib/features/access/createAccessService.js +2 -2
  111. package/dist/lib/features/access/createAccessService.js.map +1 -1
  112. package/dist/lib/features/change-request-segment-usage-service/change-request-segment-usage-read-model.test.js.map +1 -1
  113. package/dist/lib/features/client-feature-toggles/client-feature-toggle-service.d.ts +1 -2
  114. package/dist/lib/features/client-feature-toggles/client-feature-toggle-service.d.ts.map +1 -1
  115. package/dist/lib/features/client-feature-toggles/client-feature-toggle-service.js +1 -2
  116. package/dist/lib/features/client-feature-toggles/client-feature-toggle-service.js.map +1 -1
  117. package/dist/lib/features/client-feature-toggles/client-feature-toggle.controller.d.ts.map +1 -1
  118. package/dist/lib/features/client-feature-toggles/client-feature-toggle.controller.js +18 -9
  119. package/dist/lib/features/client-feature-toggles/client-feature-toggle.controller.js.map +1 -1
  120. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta.test.js +54 -0
  121. package/dist/lib/features/client-feature-toggles/delta/client-feature-toggle-delta.test.js.map +1 -1
  122. package/dist/lib/features/client-feature-toggles/delta/delta-cache.d.ts +1 -0
  123. package/dist/lib/features/client-feature-toggles/delta/delta-cache.d.ts.map +1 -1
  124. package/dist/lib/features/client-feature-toggles/delta/delta-cache.js +14 -0
  125. package/dist/lib/features/client-feature-toggles/delta/delta-cache.js.map +1 -1
  126. package/dist/lib/features/client-feature-toggles/delta/delta-cache.test.js +1 -1
  127. package/dist/lib/features/client-feature-toggles/delta/delta-cache.test.js.map +1 -1
  128. package/dist/lib/features/client-feature-toggles/tests/client-feature-toggles.e2e.test.js +1 -1
  129. package/dist/lib/features/client-feature-toggles/tests/client-feature-toggles.e2e.test.js.map +1 -1
  130. package/dist/lib/features/context/context-field-store-type.d.ts +2 -0
  131. package/dist/lib/features/context/context-field-store-type.d.ts.map +1 -1
  132. package/dist/lib/features/context/context-field-store.d.ts +3 -3
  133. package/dist/lib/features/context/context-field-store.d.ts.map +1 -1
  134. package/dist/lib/features/context/context-field-store.js +12 -3
  135. package/dist/lib/features/context/context-field-store.js.map +1 -1
  136. package/dist/lib/features/context/context-service.d.ts +9 -3
  137. package/dist/lib/features/context/context-service.d.ts.map +1 -1
  138. package/dist/lib/features/context/context-service.js +33 -4
  139. package/dist/lib/features/context/context-service.js.map +1 -1
  140. package/dist/lib/features/context/context.d.ts +10 -5
  141. package/dist/lib/features/context/context.d.ts.map +1 -1
  142. package/dist/lib/features/context/context.js +65 -37
  143. package/dist/lib/features/context/context.js.map +1 -1
  144. package/dist/lib/features/context/fake-context-field-store.d.ts +1 -0
  145. package/dist/lib/features/context/fake-context-field-store.d.ts.map +1 -1
  146. package/dist/lib/features/context/fake-context-field-store.js +4 -1
  147. package/dist/lib/features/context/fake-context-field-store.js.map +1 -1
  148. package/dist/lib/features/dependent-features/fake-dependent-features-read-model.d.ts +1 -1
  149. package/dist/lib/features/dependent-features/fake-dependent-features-read-model.d.ts.map +1 -1
  150. package/dist/lib/features/dependent-features/fake-dependent-features-read-model.js +1 -1
  151. package/dist/lib/features/dependent-features/fake-dependent-features-read-model.js.map +1 -1
  152. package/dist/lib/features/environments/environments-controller.d.ts +1 -2
  153. package/dist/lib/features/environments/environments-controller.d.ts.map +1 -1
  154. package/dist/lib/features/environments/environments-controller.js +2 -3
  155. package/dist/lib/features/environments/environments-controller.js.map +1 -1
  156. package/dist/lib/features/events/event-created-by-migration.test.js +3 -3
  157. package/dist/lib/features/events/event-created-by-migration.test.js.map +1 -1
  158. package/dist/lib/features/events/event-search-controller.js +1 -1
  159. package/dist/lib/features/events/event-search-controller.js.map +1 -1
  160. package/dist/lib/features/events/event-service.test.js.map +1 -1
  161. package/dist/lib/features/events/event-store.d.ts.map +1 -1
  162. package/dist/lib/features/events/event-store.js +22 -9
  163. package/dist/lib/features/events/event-store.js.map +1 -1
  164. package/dist/lib/features/export-import-toggles/export-import-api-usage.test.js +1 -1
  165. package/dist/lib/features/export-import-toggles/export-import-api-usage.test.js.map +1 -1
  166. package/dist/lib/features/export-import-toggles/export-import-controller.d.ts +0 -1
  167. package/dist/lib/features/export-import-toggles/export-import-controller.d.ts.map +1 -1
  168. package/dist/lib/features/export-import-toggles/export-import-controller.js +5 -6
  169. package/dist/lib/features/export-import-toggles/export-import-controller.js.map +1 -1
  170. package/dist/lib/features/export-import-toggles/export-import-service.d.ts.map +1 -1
  171. package/dist/lib/features/export-import-toggles/export-import-service.js +10 -1
  172. package/dist/lib/features/export-import-toggles/export-import-service.js.map +1 -1
  173. package/dist/lib/features/export-import-toggles/export-import.e2e.test.js +8 -3
  174. package/dist/lib/features/export-import-toggles/export-import.e2e.test.js.map +1 -1
  175. package/dist/lib/features/feature-lifecycle/fake-feature-lifecycle-read-model.d.ts +1 -1
  176. package/dist/lib/features/feature-lifecycle/fake-feature-lifecycle-read-model.d.ts.map +1 -1
  177. package/dist/lib/features/feature-lifecycle/fake-feature-lifecycle-read-model.js +1 -1
  178. package/dist/lib/features/feature-lifecycle/fake-feature-lifecycle-read-model.js.map +1 -1
  179. package/dist/lib/features/feature-lifecycle/fake-feature-lifecycle-store.js +1 -1
  180. package/dist/lib/features/feature-lifecycle/fake-feature-lifecycle-store.js.map +1 -1
  181. package/dist/lib/features/feature-lifecycle/feature-lifecycle-count-controller.d.ts +5 -4
  182. package/dist/lib/features/feature-lifecycle/feature-lifecycle-count-controller.d.ts.map +1 -1
  183. package/dist/lib/features/feature-lifecycle/feature-lifecycle-count-controller.js +9 -3
  184. package/dist/lib/features/feature-lifecycle/feature-lifecycle-count-controller.js.map +1 -1
  185. package/dist/lib/features/feature-lifecycle/feature-lifecycle-read-model-type.d.ts +1 -1
  186. package/dist/lib/features/feature-lifecycle/feature-lifecycle-read-model-type.d.ts.map +1 -1
  187. package/dist/lib/features/feature-lifecycle/feature-lifecycle-read-model.d.ts +1 -1
  188. package/dist/lib/features/feature-lifecycle/feature-lifecycle-read-model.d.ts.map +1 -1
  189. package/dist/lib/features/feature-lifecycle/feature-lifecycle-read-model.js +17 -18
  190. package/dist/lib/features/feature-lifecycle/feature-lifecycle-read-model.js.map +1 -1
  191. package/dist/lib/features/feature-lifecycle/feature-lifecycle-read-model.test.js +17 -0
  192. package/dist/lib/features/feature-lifecycle/feature-lifecycle-read-model.test.js.map +1 -1
  193. package/dist/lib/features/feature-lifecycle/feature-lifecycle-store.d.ts.map +1 -1
  194. package/dist/lib/features/feature-lifecycle/feature-lifecycle-store.js +3 -2
  195. package/dist/lib/features/feature-lifecycle/feature-lifecycle-store.js.map +1 -1
  196. package/dist/lib/features/feature-lifecycle/feature-lifecycle.e2e.test.js +4 -1
  197. package/dist/lib/features/feature-lifecycle/feature-lifecycle.e2e.test.js.map +1 -1
  198. package/dist/lib/features/feature-links/createFeatureLinkService.d.ts +4 -1
  199. package/dist/lib/features/feature-links/createFeatureLinkService.d.ts.map +1 -1
  200. package/dist/lib/features/feature-links/createFeatureLinkService.js +7 -3
  201. package/dist/lib/features/feature-links/createFeatureLinkService.js.map +1 -1
  202. package/dist/lib/features/feature-links/fake-feature-links-read-model.d.ts +1 -1
  203. package/dist/lib/features/feature-links/fake-feature-links-read-model.d.ts.map +1 -1
  204. package/dist/lib/features/feature-links/fake-feature-links-read-model.js +1 -1
  205. package/dist/lib/features/feature-links/fake-feature-links-read-model.js.map +1 -1
  206. package/dist/lib/features/feature-links/feature-link-service.d.ts +3 -0
  207. package/dist/lib/features/feature-links/feature-link-service.d.ts.map +1 -1
  208. package/dist/lib/features/feature-links/feature-link-service.js +6 -1
  209. package/dist/lib/features/feature-links/feature-link-service.js.map +1 -1
  210. package/dist/lib/features/feature-links/feature-link-service.test.js +20 -3
  211. package/dist/lib/features/feature-links/feature-link-service.test.js.map +1 -1
  212. package/dist/lib/features/feature-naming-pattern/feature-naming-validation.test.js +10 -2
  213. package/dist/lib/features/feature-naming-pattern/feature-naming-validation.test.js.map +1 -1
  214. package/dist/lib/features/feature-search/createFeatureSearchService.d.ts +3 -2
  215. package/dist/lib/features/feature-search/createFeatureSearchService.d.ts.map +1 -1
  216. package/dist/lib/features/feature-search/createFeatureSearchService.js +4 -4
  217. package/dist/lib/features/feature-search/createFeatureSearchService.js.map +1 -1
  218. package/dist/lib/features/feature-search/fake-feature-search-store.d.ts +1 -1
  219. package/dist/lib/features/feature-search/fake-feature-search-store.d.ts.map +1 -1
  220. package/dist/lib/features/feature-search/fake-feature-search-store.js +1 -1
  221. package/dist/lib/features/feature-search/fake-feature-search-store.js.map +1 -1
  222. package/dist/lib/features/feature-search/feature-search-controller.js +2 -2
  223. package/dist/lib/features/feature-search/feature-search-controller.js.map +1 -1
  224. package/dist/lib/features/feature-search/feature-search-service.d.ts +4 -3
  225. package/dist/lib/features/feature-search/feature-search-service.d.ts.map +1 -1
  226. package/dist/lib/features/feature-search/feature-search-service.js +12 -4
  227. package/dist/lib/features/feature-search/feature-search-service.js.map +1 -1
  228. package/dist/lib/features/feature-search/feature-search-store.d.ts +1 -3
  229. package/dist/lib/features/feature-search/feature-search-store.d.ts.map +1 -1
  230. package/dist/lib/features/feature-search/feature-search-store.js +1 -3
  231. package/dist/lib/features/feature-search/feature-search-store.js.map +1 -1
  232. package/dist/lib/features/feature-search/feature.search.e2e.test.js +1 -1
  233. package/dist/lib/features/feature-search/feature.search.e2e.test.js.map +1 -1
  234. package/dist/lib/features/feature-toggle/archive-feature-toggle-controller.js +1 -1
  235. package/dist/lib/features/feature-toggle/archive-feature-toggle-controller.js.map +1 -1
  236. package/dist/lib/features/feature-toggle/configuration-revision-service.d.ts +2 -1
  237. package/dist/lib/features/feature-toggle/configuration-revision-service.d.ts.map +1 -1
  238. package/dist/lib/features/feature-toggle/configuration-revision-service.js +16 -0
  239. package/dist/lib/features/feature-toggle/configuration-revision-service.js.map +1 -1
  240. package/dist/lib/features/feature-toggle/converters/feature-toggle-row-converter.d.ts +3 -4
  241. package/dist/lib/features/feature-toggle/converters/feature-toggle-row-converter.d.ts.map +1 -1
  242. package/dist/lib/features/feature-toggle/converters/feature-toggle-row-converter.js +2 -3
  243. package/dist/lib/features/feature-toggle/converters/feature-toggle-row-converter.js.map +1 -1
  244. package/dist/lib/features/feature-toggle/createFeatureToggleService.d.ts.map +1 -1
  245. package/dist/lib/features/feature-toggle/createFeatureToggleService.js +1 -12
  246. package/dist/lib/features/feature-toggle/createFeatureToggleService.js.map +1 -1
  247. package/dist/lib/features/feature-toggle/fake-feature-collaborators-read-model.d.ts +1 -1
  248. package/dist/lib/features/feature-toggle/fake-feature-collaborators-read-model.d.ts.map +1 -1
  249. package/dist/lib/features/feature-toggle/fake-feature-collaborators-read-model.js +1 -1
  250. package/dist/lib/features/feature-toggle/fake-feature-collaborators-read-model.js.map +1 -1
  251. package/dist/lib/features/feature-toggle/fakes/fake-feature-strategies-store.d.ts +5 -5
  252. package/dist/lib/features/feature-toggle/fakes/fake-feature-strategies-store.d.ts.map +1 -1
  253. package/dist/lib/features/feature-toggle/fakes/fake-feature-strategies-store.js +6 -6
  254. package/dist/lib/features/feature-toggle/fakes/fake-feature-strategies-store.js.map +1 -1
  255. package/dist/lib/features/feature-toggle/fakes/fake-feature-toggle-store.d.ts +8 -8
  256. package/dist/lib/features/feature-toggle/fakes/fake-feature-toggle-store.d.ts.map +1 -1
  257. package/dist/lib/features/feature-toggle/fakes/fake-feature-toggle-store.js +10 -12
  258. package/dist/lib/features/feature-toggle/fakes/fake-feature-toggle-store.js.map +1 -1
  259. package/dist/lib/features/feature-toggle/fakes/fake-features-read-model.d.ts +7 -1
  260. package/dist/lib/features/feature-toggle/fakes/fake-features-read-model.d.ts.map +1 -1
  261. package/dist/lib/features/feature-toggle/fakes/fake-features-read-model.js +7 -3
  262. package/dist/lib/features/feature-toggle/fakes/fake-features-read-model.js.map +1 -1
  263. package/dist/lib/features/feature-toggle/feature-toggle-controller.d.ts.map +1 -1
  264. package/dist/lib/features/feature-toggle/feature-toggle-controller.js +4 -3
  265. package/dist/lib/features/feature-toggle/feature-toggle-controller.js.map +1 -1
  266. package/dist/lib/features/feature-toggle/feature-toggle-service.d.ts +3 -10
  267. package/dist/lib/features/feature-toggle/feature-toggle-service.d.ts.map +1 -1
  268. package/dist/lib/features/feature-toggle/feature-toggle-service.js +10 -26
  269. package/dist/lib/features/feature-toggle/feature-toggle-service.js.map +1 -1
  270. package/dist/lib/features/feature-toggle/feature-toggle-store.d.ts.map +1 -1
  271. package/dist/lib/features/feature-toggle/feature-toggle-store.js +7 -3
  272. package/dist/lib/features/feature-toggle/feature-toggle-store.js.map +1 -1
  273. package/dist/lib/features/feature-toggle/feature-toggle-strategies-store.d.ts +1 -3
  274. package/dist/lib/features/feature-toggle/feature-toggle-strategies-store.d.ts.map +1 -1
  275. package/dist/lib/features/feature-toggle/feature-toggle-strategies-store.js +1 -3
  276. package/dist/lib/features/feature-toggle/feature-toggle-strategies-store.js.map +1 -1
  277. package/dist/lib/features/feature-toggle/legacy/feature-toggle-legacy-controller.d.ts +0 -1
  278. package/dist/lib/features/feature-toggle/legacy/feature-toggle-legacy-controller.d.ts.map +1 -1
  279. package/dist/lib/features/feature-toggle/legacy/feature-toggle-legacy-controller.js +0 -1
  280. package/dist/lib/features/feature-toggle/legacy/feature-toggle-legacy-controller.js.map +1 -1
  281. package/dist/lib/features/feature-toggle/tests/feature-toggle-service.e2e.test.js +1 -1
  282. package/dist/lib/features/feature-toggle/tests/feature-toggle-service.e2e.test.js.map +1 -1
  283. package/dist/lib/features/feature-toggle/tests/feature-toggle-store.e2e.test.js +1 -1
  284. package/dist/lib/features/feature-toggle/tests/feature-toggle-store.e2e.test.js.map +1 -1
  285. package/dist/lib/features/feature-toggle/tests/feature-toggle-strategies-store.e2e.test.js +2 -2
  286. package/dist/lib/features/feature-toggle/tests/feature-toggle-strategies-store.e2e.test.js.map +1 -1
  287. package/dist/lib/features/feature-toggle/tests/feature-toggles.e2e.test.js +3 -3
  288. package/dist/lib/features/feature-toggle/tests/feature-toggles.e2e.test.js.map +1 -1
  289. package/dist/lib/features/frontend-api/frontend-api-controller.js +2 -2
  290. package/dist/lib/features/frontend-api/frontend-api-controller.js.map +1 -1
  291. package/dist/lib/features/frontend-api/frontend-api-repository.d.ts +1 -3
  292. package/dist/lib/features/frontend-api/frontend-api-repository.d.ts.map +1 -1
  293. package/dist/lib/features/frontend-api/frontend-api-repository.js +6 -6
  294. package/dist/lib/features/frontend-api/frontend-api-repository.js.map +1 -1
  295. package/dist/lib/features/frontend-api/frontend-api-service.d.ts.map +1 -1
  296. package/dist/lib/features/frontend-api/frontend-api-service.js +3 -1
  297. package/dist/lib/features/frontend-api/frontend-api-service.js.map +1 -1
  298. package/dist/lib/features/frontend-api/frontend-api-service.test.js +2 -2
  299. package/dist/lib/features/frontend-api/frontend-api.concurrency.e2e.test.js +1 -1
  300. package/dist/lib/features/frontend-api/frontend-api.concurrency.e2e.test.js.map +1 -1
  301. package/dist/lib/features/frontend-api/global-frontend-api-cache.d.ts +0 -2
  302. package/dist/lib/features/frontend-api/global-frontend-api-cache.d.ts.map +1 -1
  303. package/dist/lib/features/frontend-api/global-frontend-api-cache.js +0 -7
  304. package/dist/lib/features/frontend-api/global-frontend-api-cache.js.map +1 -1
  305. package/dist/lib/features/frontend-api/proxy-repository.js +1 -1
  306. package/dist/lib/features/frontend-api/proxy-repository.js.map +1 -1
  307. package/dist/lib/features/instance-stats/createInstanceStatsService.d.ts.map +1 -1
  308. package/dist/lib/features/instance-stats/createInstanceStatsService.js +5 -2
  309. package/dist/lib/features/instance-stats/createInstanceStatsService.js.map +1 -1
  310. package/dist/lib/features/instance-stats/getEdgeInstances.d.ts.map +1 -1
  311. package/dist/lib/features/instance-stats/getEdgeInstances.e2e.test.js +28 -19
  312. package/dist/lib/features/instance-stats/getEdgeInstances.e2e.test.js.map +1 -1
  313. package/dist/lib/features/instance-stats/getEdgeInstances.js +14 -2
  314. package/dist/lib/features/instance-stats/getEdgeInstances.js.map +1 -1
  315. package/dist/lib/features/instance-stats/getProductionChanges.e2e.test.js +2 -2
  316. package/dist/lib/features/instance-stats/getProductionChanges.e2e.test.js.map +1 -1
  317. package/dist/lib/features/instance-stats/getReadOnlyUsers.d.ts +5 -0
  318. package/dist/lib/features/instance-stats/getReadOnlyUsers.d.ts.map +1 -0
  319. package/dist/lib/features/instance-stats/getReadOnlyUsers.js +9 -0
  320. package/dist/lib/features/instance-stats/getReadOnlyUsers.js.map +1 -0
  321. package/dist/lib/features/instance-stats/instance-stats-service.d.ts +8 -5
  322. package/dist/lib/features/instance-stats/instance-stats-service.d.ts.map +1 -1
  323. package/dist/lib/features/instance-stats/instance-stats-service.js +17 -4
  324. package/dist/lib/features/instance-stats/instance-stats-service.js.map +1 -1
  325. package/dist/lib/features/instance-stats/instance-stats-service.test.js +8 -6
  326. package/dist/lib/features/instance-stats/instance-stats-service.test.js.map +1 -1
  327. package/dist/lib/features/integration-events/integration-events-service.d.ts +1 -3
  328. package/dist/lib/features/integration-events/integration-events-service.d.ts.map +1 -1
  329. package/dist/lib/features/integration-events/integration-events-service.js +1 -3
  330. package/dist/lib/features/integration-events/integration-events-service.js.map +1 -1
  331. package/dist/lib/features/maintenance/maintenance-controller.d.ts +1 -1
  332. package/dist/lib/features/maintenance/maintenance-controller.d.ts.map +1 -1
  333. package/dist/lib/features/maintenance/maintenance-controller.js +1 -1
  334. package/dist/lib/features/maintenance/maintenance-controller.js.map +1 -1
  335. package/dist/lib/features/maintenance/maintenance-service.js +1 -1
  336. package/dist/lib/features/maintenance/maintenance-service.js.map +1 -1
  337. package/dist/lib/features/metrics/client-metrics/client-metrics-service.e2e.test.js +10 -10
  338. package/dist/lib/features/metrics/client-metrics/client-metrics-service.e2e.test.js.map +1 -1
  339. package/dist/lib/features/metrics/client-metrics/client-metrics-store-v2.d.ts +1 -3
  340. package/dist/lib/features/metrics/client-metrics/client-metrics-store-v2.d.ts.map +1 -1
  341. package/dist/lib/features/metrics/client-metrics/client-metrics-store-v2.js +2 -4
  342. package/dist/lib/features/metrics/client-metrics/client-metrics-store-v2.js.map +1 -1
  343. package/dist/lib/features/metrics/client-metrics/client-metrics.d.ts +0 -1
  344. package/dist/lib/features/metrics/client-metrics/client-metrics.d.ts.map +1 -1
  345. package/dist/lib/features/metrics/client-metrics/client-metrics.js +0 -1
  346. package/dist/lib/features/metrics/client-metrics/client-metrics.js.map +1 -1
  347. package/dist/lib/features/metrics/client-metrics/fake-client-metrics-store-v2.d.ts +10 -10
  348. package/dist/lib/features/metrics/client-metrics/fake-client-metrics-store-v2.d.ts.map +1 -1
  349. package/dist/lib/features/metrics/client-metrics/fake-client-metrics-store-v2.js +13 -11
  350. package/dist/lib/features/metrics/client-metrics/fake-client-metrics-store-v2.js.map +1 -1
  351. package/dist/lib/features/metrics/client-metrics/metrics-service-v2.d.ts +1 -1
  352. package/dist/lib/features/metrics/client-metrics/metrics-service-v2.d.ts.map +1 -1
  353. package/dist/lib/features/metrics/client-metrics/metrics-service-v2.js +3 -3
  354. package/dist/lib/features/metrics/client-metrics/metrics-service-v2.js.map +1 -1
  355. package/dist/lib/features/metrics/client-metrics/metrics-service-v2.test.js +2 -2
  356. package/dist/lib/features/metrics/client-metrics/metrics-service-v2.test.js.map +1 -1
  357. package/dist/lib/features/metrics/custom/custom-metrics-controller.d.ts +2 -2
  358. package/dist/lib/features/metrics/custom/custom-metrics-controller.d.ts.map +1 -1
  359. package/dist/lib/features/metrics/custom/custom-metrics-controller.js +2 -2
  360. package/dist/lib/features/metrics/custom/custom-metrics-controller.js.map +1 -1
  361. package/dist/lib/features/metrics/impact/metrics-translator.js +3 -1
  362. package/dist/lib/features/metrics/impact/metrics-translator.js.map +1 -1
  363. package/dist/lib/features/metrics/instance/instance-service.d.ts.map +1 -1
  364. package/dist/lib/features/metrics/instance/instance-service.js +1 -0
  365. package/dist/lib/features/metrics/instance/instance-service.js.map +1 -1
  366. package/dist/lib/features/metrics/instance/instance-service.test.js +2 -2
  367. package/dist/lib/features/metrics/instance/instance-service.test.js.map +1 -1
  368. package/dist/lib/features/metrics/instance/metrics.d.ts +1 -0
  369. package/dist/lib/features/metrics/instance/metrics.d.ts.map +1 -1
  370. package/dist/lib/features/metrics/instance/metrics.js +22 -6
  371. package/dist/lib/features/metrics/instance/metrics.js.map +1 -1
  372. package/dist/lib/features/metrics/last-seen/fake-last-seen-read-model.d.ts +1 -1
  373. package/dist/lib/features/metrics/last-seen/fake-last-seen-read-model.d.ts.map +1 -1
  374. package/dist/lib/features/metrics/last-seen/fake-last-seen-read-model.js +1 -1
  375. package/dist/lib/features/metrics/last-seen/fake-last-seen-read-model.js.map +1 -1
  376. package/dist/lib/features/metrics/shared/schema.test.js +0 -1
  377. package/dist/lib/features/metrics/shared/schema.test.js.map +1 -1
  378. package/dist/lib/features/metrics/sizes/fake-largest-resources-read-model.d.ts +2 -2
  379. package/dist/lib/features/metrics/sizes/fake-largest-resources-read-model.d.ts.map +1 -1
  380. package/dist/lib/features/metrics/sizes/fake-largest-resources-read-model.js +2 -2
  381. package/dist/lib/features/metrics/sizes/fake-largest-resources-read-model.js.map +1 -1
  382. package/dist/lib/features/metrics/unknown-flags/unknown-flags-service.d.ts +1 -2
  383. package/dist/lib/features/metrics/unknown-flags/unknown-flags-service.d.ts.map +1 -1
  384. package/dist/lib/features/metrics/unknown-flags/unknown-flags-service.js +1 -2
  385. package/dist/lib/features/metrics/unknown-flags/unknown-flags-service.js.map +1 -1
  386. package/dist/lib/features/onboarding/fake-onboarding-store.d.ts +2 -2
  387. package/dist/lib/features/onboarding/fake-onboarding-store.d.ts.map +1 -1
  388. package/dist/lib/features/onboarding/fake-onboarding-store.js +2 -2
  389. package/dist/lib/features/onboarding/fake-onboarding-store.js.map +1 -1
  390. package/dist/lib/features/onboarding/onboarding-service.d.ts +1 -3
  391. package/dist/lib/features/onboarding/onboarding-service.d.ts.map +1 -1
  392. package/dist/lib/features/onboarding/onboarding-service.js +2 -4
  393. package/dist/lib/features/onboarding/onboarding-service.js.map +1 -1
  394. package/dist/lib/features/personal-dashboard/fake-personal-dashboard-read-model.d.ts +3 -3
  395. package/dist/lib/features/personal-dashboard/fake-personal-dashboard-read-model.d.ts.map +1 -1
  396. package/dist/lib/features/personal-dashboard/fake-personal-dashboard-read-model.js +3 -3
  397. package/dist/lib/features/personal-dashboard/fake-personal-dashboard-read-model.js.map +1 -1
  398. package/dist/lib/features/playground/feature-evaluator/constraint.js +1 -1
  399. package/dist/lib/features/playground/feature-evaluator/constraint.js.map +1 -1
  400. package/dist/lib/features/playground/feature-evaluator/repository/index.js +1 -1
  401. package/dist/lib/features/playground/feature-evaluator/repository/index.js.map +1 -1
  402. package/dist/lib/features/playground/feature-evaluator/strategy/gradual-rollout-random.d.ts +1 -1
  403. package/dist/lib/features/playground/feature-evaluator/strategy/gradual-rollout-random.d.ts.map +1 -1
  404. package/dist/lib/features/playground/feature-evaluator/strategy/gradual-rollout-random.js +1 -1
  405. package/dist/lib/features/playground/feature-evaluator/strategy/gradual-rollout-random.js.map +1 -1
  406. package/dist/lib/features/playground/feature-evaluator/strategy/remote-address-strategy.js +1 -1
  407. package/dist/lib/features/playground/feature-evaluator/strategy/remote-address-strategy.js.map +1 -1
  408. package/dist/lib/features/playground/feature-evaluator/strategy/strategy.d.ts +1 -1
  409. package/dist/lib/features/playground/feature-evaluator/strategy/strategy.d.ts.map +1 -1
  410. package/dist/lib/features/playground/feature-evaluator/strategy/strategy.js +1 -1
  411. package/dist/lib/features/playground/feature-evaluator/strategy/strategy.js.map +1 -1
  412. package/dist/lib/features/playground/feature-evaluator/strategy/unknown-strategy.d.ts +1 -1
  413. package/dist/lib/features/playground/feature-evaluator/strategy/unknown-strategy.d.ts.map +1 -1
  414. package/dist/lib/features/playground/feature-evaluator/strategy/unknown-strategy.js +1 -1
  415. package/dist/lib/features/playground/feature-evaluator/strategy/unknown-strategy.js.map +1 -1
  416. package/dist/lib/features/playground/offline-unleash-client.test.js +6 -2
  417. package/dist/lib/features/playground/offline-unleash-client.test.js.map +1 -1
  418. package/dist/lib/features/playground/playground-service.d.ts.map +1 -1
  419. package/dist/lib/features/playground/playground-service.js +3 -2
  420. package/dist/lib/features/playground/playground-service.js.map +1 -1
  421. package/dist/lib/features/playground/playground.test.js +1 -1
  422. package/dist/lib/features/playground/playground.test.js.map +1 -1
  423. package/dist/lib/features/private-project/fakePrivateProjectChecker.d.ts +3 -3
  424. package/dist/lib/features/private-project/fakePrivateProjectChecker.d.ts.map +1 -1
  425. package/dist/lib/features/private-project/fakePrivateProjectChecker.js +3 -3
  426. package/dist/lib/features/private-project/fakePrivateProjectChecker.js.map +1 -1
  427. package/dist/lib/features/private-project/privateProjectStore.d.ts +1 -2
  428. package/dist/lib/features/private-project/privateProjectStore.d.ts.map +1 -1
  429. package/dist/lib/features/private-project/privateProjectStore.js +2 -3
  430. package/dist/lib/features/private-project/privateProjectStore.js.map +1 -1
  431. package/dist/lib/features/project/fake-project-flag-creators-read-model.d.ts +1 -1
  432. package/dist/lib/features/project/fake-project-flag-creators-read-model.d.ts.map +1 -1
  433. package/dist/lib/features/project/fake-project-flag-creators-read-model.js +1 -1
  434. package/dist/lib/features/project/fake-project-flag-creators-read-model.js.map +1 -1
  435. package/dist/lib/features/project/project-controller.d.ts +1 -1
  436. package/dist/lib/features/project/project-controller.d.ts.map +1 -1
  437. package/dist/lib/features/project/project-controller.js +3 -1
  438. package/dist/lib/features/project/project-controller.js.map +1 -1
  439. package/dist/lib/features/project/project-read-model.d.ts +1 -2
  440. package/dist/lib/features/project/project-read-model.d.ts.map +1 -1
  441. package/dist/lib/features/project/project-read-model.js +1 -2
  442. package/dist/lib/features/project/project-read-model.js.map +1 -1
  443. package/dist/lib/features/project/project-service.e2e.test.js +10 -3
  444. package/dist/lib/features/project/project-service.e2e.test.js.map +1 -1
  445. package/dist/lib/features/project/project-store.d.ts +2 -3
  446. package/dist/lib/features/project/project-store.d.ts.map +1 -1
  447. package/dist/lib/features/project/project-store.js +43 -3
  448. package/dist/lib/features/project/project-store.js.map +1 -1
  449. package/dist/lib/features/project/projects.e2e.test.js +1 -1
  450. package/dist/lib/features/project/projects.e2e.test.js.map +1 -1
  451. package/dist/lib/features/project-environments/environment-service.d.ts +1 -0
  452. package/dist/lib/features/project-environments/environment-service.d.ts.map +1 -1
  453. package/dist/lib/features/project-environments/environment-service.js +8 -1
  454. package/dist/lib/features/project-environments/environment-service.js.map +1 -1
  455. package/dist/lib/features/project-environments/fake-environment-store.d.ts +3 -3
  456. package/dist/lib/features/project-environments/fake-environment-store.d.ts.map +1 -1
  457. package/dist/lib/features/project-environments/fake-environment-store.js +5 -5
  458. package/dist/lib/features/project-environments/fake-environment-store.js.map +1 -1
  459. package/dist/lib/features/project-insights/project-insights-service.e2e.test.js +1 -1
  460. package/dist/lib/features/project-insights/project-insights-service.e2e.test.js.map +1 -1
  461. package/dist/lib/features/project-status/projects-status.e2e.test.js +1 -1
  462. package/dist/lib/features/project-status/projects-status.e2e.test.js.map +1 -1
  463. package/dist/lib/features/scheduler/job-service.js +1 -1
  464. package/dist/lib/features/scheduler/job-service.js.map +1 -1
  465. package/dist/lib/features/scheduler/job-service.test.js +1 -1
  466. package/dist/lib/features/scheduler/job-service.test.js.map +1 -1
  467. package/dist/lib/features/scheduler/job-store.d.ts +0 -1
  468. package/dist/lib/features/scheduler/job-store.d.ts.map +1 -1
  469. package/dist/lib/features/scheduler/job-store.js +0 -1
  470. package/dist/lib/features/scheduler/job-store.js.map +1 -1
  471. package/dist/lib/features/segment/admin-segment.e2e.test.js +7 -25
  472. package/dist/lib/features/segment/admin-segment.e2e.test.js.map +1 -1
  473. package/dist/lib/features/segment/fake-segment-read-model.d.ts +2 -2
  474. package/dist/lib/features/segment/fake-segment-read-model.d.ts.map +1 -1
  475. package/dist/lib/features/segment/fake-segment-read-model.js +2 -2
  476. package/dist/lib/features/segment/fake-segment-read-model.js.map +1 -1
  477. package/dist/lib/features/segment/segment-controller.d.ts +1 -2
  478. package/dist/lib/features/segment/segment-controller.d.ts.map +1 -1
  479. package/dist/lib/features/segment/segment-controller.js +6 -4
  480. package/dist/lib/features/segment/segment-controller.js.map +1 -1
  481. package/dist/lib/features/segment/segment-service-interface.d.ts +2 -2
  482. package/dist/lib/features/segment/segment-service-interface.d.ts.map +1 -1
  483. package/dist/lib/features/segment/segment-service.d.ts +3 -3
  484. package/dist/lib/features/segment/segment-service.d.ts.map +1 -1
  485. package/dist/lib/features/segment/segment-service.js +31 -5
  486. package/dist/lib/features/segment/segment-service.js.map +1 -1
  487. package/dist/lib/features/tag-type/fake-tag-type-store.d.ts.map +1 -1
  488. package/dist/lib/features/tag-type/fake-tag-type-store.js +3 -1
  489. package/dist/lib/features/tag-type/fake-tag-type-store.js.map +1 -1
  490. package/dist/lib/features/tag-type/tag-type.d.ts +1 -2
  491. package/dist/lib/features/tag-type/tag-type.d.ts.map +1 -1
  492. package/dist/lib/features/tag-type/tag-type.js +1 -2
  493. package/dist/lib/features/tag-type/tag-type.js.map +1 -1
  494. package/dist/lib/features/traffic-data-usage/fake-traffic-data-usage-store.d.ts +4 -4
  495. package/dist/lib/features/traffic-data-usage/fake-traffic-data-usage-store.d.ts.map +1 -1
  496. package/dist/lib/features/traffic-data-usage/fake-traffic-data-usage-store.js +4 -4
  497. package/dist/lib/features/traffic-data-usage/fake-traffic-data-usage-store.js.map +1 -1
  498. package/dist/lib/features/traffic-data-usage/traffic-data-usage-store.d.ts +1 -2
  499. package/dist/lib/features/traffic-data-usage/traffic-data-usage-store.d.ts.map +1 -1
  500. package/dist/lib/features/traffic-data-usage/traffic-data-usage-store.js +3 -4
  501. package/dist/lib/features/traffic-data-usage/traffic-data-usage-store.js.map +1 -1
  502. package/dist/lib/features/ui-observability-controller/ui-observability-controller.js +1 -1
  503. package/dist/lib/features/ui-observability-controller/ui-observability-controller.js.map +1 -1
  504. package/dist/lib/features/unique-connection/unique-connection-service.d.ts +0 -1
  505. package/dist/lib/features/unique-connection/unique-connection-service.d.ts.map +1 -1
  506. package/dist/lib/features/unique-connection/unique-connection-service.js +0 -1
  507. package/dist/lib/features/unique-connection/unique-connection-service.js.map +1 -1
  508. package/dist/lib/features/user-subscriptions/fake-user-subscriptions-read-model.d.ts +2 -2
  509. package/dist/lib/features/user-subscriptions/fake-user-subscriptions-read-model.d.ts.map +1 -1
  510. package/dist/lib/features/user-subscriptions/fake-user-subscriptions-read-model.js +2 -2
  511. package/dist/lib/features/user-subscriptions/fake-user-subscriptions-read-model.js.map +1 -1
  512. package/dist/lib/features/user-subscriptions/user-subscriptions-read-model.test.js +1 -1
  513. package/dist/lib/features/user-subscriptions/user-subscriptions-read-model.test.js.map +1 -1
  514. package/dist/lib/features/user-subscriptions/user-subscriptions-service.d.ts +1 -2
  515. package/dist/lib/features/user-subscriptions/user-subscriptions-service.d.ts.map +1 -1
  516. package/dist/lib/features/user-subscriptions/user-subscriptions-service.js +1 -2
  517. package/dist/lib/features/user-subscriptions/user-subscriptions-service.js.map +1 -1
  518. package/dist/lib/features/users/createUserService.d.ts.map +1 -1
  519. package/dist/lib/features/users/createUserService.js +3 -1
  520. package/dist/lib/features/users/createUserService.js.map +1 -1
  521. package/dist/lib/features/users/user-store.d.ts +1 -2
  522. package/dist/lib/features/users/user-store.d.ts.map +1 -1
  523. package/dist/lib/features/users/user-store.js +3 -2
  524. package/dist/lib/features/users/user-store.js.map +1 -1
  525. package/dist/lib/features/users/user-updates-read-model.d.ts +2 -2
  526. package/dist/lib/features/users/user-updates-read-model.d.ts.map +1 -1
  527. package/dist/lib/features/users/user-updates-read-model.js +2 -2
  528. package/dist/lib/features/users/user-updates-read-model.js.map +1 -1
  529. package/dist/lib/logger.test.js +2 -2
  530. package/dist/lib/logger.test.js.map +1 -1
  531. package/dist/lib/metric-events.d.ts +15 -2
  532. package/dist/lib/metric-events.d.ts.map +1 -1
  533. package/dist/lib/metric-events.js +2 -1
  534. package/dist/lib/metric-events.js.map +1 -1
  535. package/dist/lib/metrics.d.ts.map +1 -1
  536. package/dist/lib/metrics.js +65 -4
  537. package/dist/lib/metrics.js.map +1 -1
  538. package/dist/lib/metrics.test.js +13 -8
  539. package/dist/lib/metrics.test.js.map +1 -1
  540. package/dist/lib/middleware/api-token-middleware.js +1 -1
  541. package/dist/lib/middleware/api-token-middleware.js.map +1 -1
  542. package/dist/lib/middleware/api-token-middleware.test.js +4 -1
  543. package/dist/lib/middleware/api-token-middleware.test.js.map +1 -1
  544. package/dist/lib/middleware/audit-middleware.js +1 -1
  545. package/dist/lib/middleware/audit-middleware.js.map +1 -1
  546. package/dist/lib/middleware/catch-all-error-handler.js +1 -1
  547. package/dist/lib/middleware/catch-all-error-handler.js.map +1 -1
  548. package/dist/lib/middleware/conditional-middleware.d.ts.map +1 -1
  549. package/dist/lib/middleware/conditional-middleware.js +2 -5
  550. package/dist/lib/middleware/conditional-middleware.js.map +1 -1
  551. package/dist/lib/middleware/content_type_checker.test.js +3 -6
  552. package/dist/lib/middleware/content_type_checker.test.js.map +1 -1
  553. package/dist/lib/middleware/cors-origin-middleware.js +1 -1
  554. package/dist/lib/middleware/cors-origin-middleware.js.map +1 -1
  555. package/dist/lib/middleware/demo-authentication.js +3 -3
  556. package/dist/lib/middleware/demo-authentication.js.map +1 -1
  557. package/dist/lib/middleware/no-authentication.js +3 -3
  558. package/dist/lib/middleware/no-authentication.js.map +1 -1
  559. package/dist/lib/middleware/oss-authentication.test.js +2 -2
  560. package/dist/lib/middleware/oss-authentication.test.js.map +1 -1
  561. package/dist/lib/middleware/pat-middleware.js +1 -1
  562. package/dist/lib/middleware/pat-middleware.js.map +1 -1
  563. package/dist/lib/middleware/rbac-middleware.js +1 -1
  564. package/dist/lib/middleware/rbac-middleware.js.map +1 -1
  565. package/dist/lib/middleware/rbac-middleware.test.js +7 -3
  566. package/dist/lib/middleware/rbac-middleware.test.js.map +1 -1
  567. package/dist/lib/middleware/response-time-metrics.js +1 -1
  568. package/dist/lib/middleware/response-time-metrics.js.map +1 -1
  569. package/dist/lib/middleware/response-time-metrics.test.js +4 -1
  570. package/dist/lib/middleware/response-time-metrics.test.js.map +1 -1
  571. package/dist/lib/middleware/secure-headers.d.ts.map +1 -1
  572. package/dist/lib/middleware/secure-headers.js +3 -1
  573. package/dist/lib/middleware/secure-headers.js.map +1 -1
  574. package/dist/lib/openapi/meta-schema-rules.test.js +1 -1
  575. package/dist/lib/openapi/meta-schema-rules.test.js.map +1 -1
  576. package/dist/lib/openapi/spec/addon-create-update-schema.d.ts +2 -2
  577. package/dist/lib/openapi/spec/addon-create-update-schema.js +6 -6
  578. package/dist/lib/openapi/spec/addon-create-update-schema.js.map +1 -1
  579. package/dist/lib/openapi/spec/addon-parameter-schema.js +1 -1
  580. package/dist/lib/openapi/spec/addon-parameter-schema.js.map +1 -1
  581. package/dist/lib/openapi/spec/addon-schema.d.ts +1 -1
  582. package/dist/lib/openapi/spec/addon-schema.js +1 -1
  583. package/dist/lib/openapi/spec/addon-schema.js.map +1 -1
  584. package/dist/lib/openapi/spec/addon-type-schema.d.ts +2 -2
  585. package/dist/lib/openapi/spec/addon-type-schema.js +2 -2
  586. package/dist/lib/openapi/spec/addon-type-schema.js.map +1 -1
  587. package/dist/lib/openapi/spec/addons-schema.d.ts +5 -5
  588. package/dist/lib/openapi/spec/addons-schema.js +2 -2
  589. package/dist/lib/openapi/spec/addons-schema.js.map +1 -1
  590. package/dist/lib/openapi/spec/admin-segment-schema.d.ts +6 -4
  591. package/dist/lib/openapi/spec/admin-segment-schema.d.ts.map +1 -1
  592. package/dist/lib/openapi/spec/admin-segment-schema.js +1 -1
  593. package/dist/lib/openapi/spec/admin-segment-schema.js.map +1 -1
  594. package/dist/lib/openapi/spec/advanced-playground-environment-feature-schema.d.ts +14 -14
  595. package/dist/lib/openapi/spec/advanced-playground-feature-schema.d.ts +28 -28
  596. package/dist/lib/openapi/spec/advanced-playground-response-schema.d.ts +61 -59
  597. package/dist/lib/openapi/spec/advanced-playground-response-schema.d.ts.map +1 -1
  598. package/dist/lib/openapi/spec/api-token-schema.d.ts +1 -1
  599. package/dist/lib/openapi/spec/api-token-schema.js +1 -1
  600. package/dist/lib/openapi/spec/api-token-schema.js.map +1 -1
  601. package/dist/lib/openapi/spec/api-token-schema.test.js +5 -1
  602. package/dist/lib/openapi/spec/api-token-schema.test.js.map +1 -1
  603. package/dist/lib/openapi/spec/api-tokens-schema.d.ts +2 -2
  604. package/dist/lib/openapi/spec/api-tokens-schema.js +1 -1
  605. package/dist/lib/openapi/spec/api-tokens-schema.js.map +1 -1
  606. package/dist/lib/openapi/spec/application-schema.d.ts +1 -1
  607. package/dist/lib/openapi/spec/application-schema.js +1 -1
  608. package/dist/lib/openapi/spec/application-schema.js.map +1 -1
  609. package/dist/lib/openapi/spec/applications-schema.d.ts +1 -1
  610. package/dist/lib/openapi/spec/bulk-metrics-schema.d.ts +2 -2
  611. package/dist/lib/openapi/spec/bulk-registration-schema.d.ts +2 -2
  612. package/dist/lib/openapi/spec/bulk-registration-schema.js +2 -2
  613. package/dist/lib/openapi/spec/bulk-registration-schema.js.map +1 -1
  614. package/dist/lib/openapi/spec/client-feature-schema.d.ts +20 -18
  615. package/dist/lib/openapi/spec/client-feature-schema.d.ts.map +1 -1
  616. package/dist/lib/openapi/spec/client-feature-schema.js +3 -3
  617. package/dist/lib/openapi/spec/client-feature-schema.js.map +1 -1
  618. package/dist/lib/openapi/spec/client-features-delta-schema.d.ts +37 -35
  619. package/dist/lib/openapi/spec/client-features-delta-schema.d.ts.map +1 -1
  620. package/dist/lib/openapi/spec/client-features-schema.d.ts +38 -36
  621. package/dist/lib/openapi/spec/client-features-schema.d.ts.map +1 -1
  622. package/dist/lib/openapi/spec/client-features-schema.js +1 -1
  623. package/dist/lib/openapi/spec/client-features-schema.js.map +1 -1
  624. package/dist/lib/openapi/spec/client-metrics-schema.d.ts +1 -1
  625. package/dist/lib/openapi/spec/client-metrics-schema.js +1 -1
  626. package/dist/lib/openapi/spec/client-metrics-schema.js.map +1 -1
  627. package/dist/lib/openapi/spec/client-segment-schema.d.ts +5 -3
  628. package/dist/lib/openapi/spec/client-segment-schema.d.ts.map +1 -1
  629. package/dist/lib/openapi/spec/clone-feature-schema.d.ts +1 -1
  630. package/dist/lib/openapi/spec/clone-feature-schema.js +1 -1
  631. package/dist/lib/openapi/spec/clone-feature-schema.js.map +1 -1
  632. package/dist/lib/openapi/spec/constraint-schema.d.ts +7 -5
  633. package/dist/lib/openapi/spec/constraint-schema.d.ts.map +1 -1
  634. package/dist/lib/openapi/spec/constraint-schema.js +2 -2
  635. package/dist/lib/openapi/spec/constraint-schema.js.map +1 -1
  636. package/dist/lib/openapi/spec/constraint-schema.test.js +2 -0
  637. package/dist/lib/openapi/spec/constraint-schema.test.js.map +1 -1
  638. package/dist/lib/openapi/spec/context-field-schema.d.ts +7 -2
  639. package/dist/lib/openapi/spec/context-field-schema.d.ts.map +1 -1
  640. package/dist/lib/openapi/spec/context-field-schema.js +7 -2
  641. package/dist/lib/openapi/spec/context-field-schema.js.map +1 -1
  642. package/dist/lib/openapi/spec/context-fields-schema.d.ts +7 -2
  643. package/dist/lib/openapi/spec/context-fields-schema.d.ts.map +1 -1
  644. package/dist/lib/openapi/spec/context-query-parameters.d.ts +12 -0
  645. package/dist/lib/openapi/spec/context-query-parameters.d.ts.map +1 -0
  646. package/dist/lib/openapi/spec/context-query-parameters.js +12 -0
  647. package/dist/lib/openapi/spec/context-query-parameters.js.map +1 -0
  648. package/dist/lib/openapi/spec/create-api-token-schema.d.ts +2 -2
  649. package/dist/lib/openapi/spec/create-api-token-schema.js +1 -1
  650. package/dist/lib/openapi/spec/create-api-token-schema.js.map +1 -1
  651. package/dist/lib/openapi/spec/create-application-schema.d.ts +1 -1
  652. package/dist/lib/openapi/spec/create-application-schema.js +1 -1
  653. package/dist/lib/openapi/spec/create-application-schema.js.map +1 -1
  654. package/dist/lib/openapi/spec/create-context-field-schema.d.ts +6 -1
  655. package/dist/lib/openapi/spec/create-context-field-schema.d.ts.map +1 -1
  656. package/dist/lib/openapi/spec/create-feature-schema.d.ts +3 -3
  657. package/dist/lib/openapi/spec/create-feature-schema.js +1 -1
  658. package/dist/lib/openapi/spec/create-feature-schema.js.map +1 -1
  659. package/dist/lib/openapi/spec/create-feature-strategy-schema.d.ts +9 -7
  660. package/dist/lib/openapi/spec/create-feature-strategy-schema.d.ts.map +1 -1
  661. package/dist/lib/openapi/spec/create-feature-strategy-schema.js +1 -1
  662. package/dist/lib/openapi/spec/create-feature-strategy-schema.js.map +1 -1
  663. package/dist/lib/openapi/spec/create-pat-schema.d.ts +1 -1
  664. package/dist/lib/openapi/spec/create-pat-schema.js +1 -1
  665. package/dist/lib/openapi/spec/create-pat-schema.js.map +1 -1
  666. package/dist/lib/openapi/spec/create-strategy-schema.d.ts +2 -2
  667. package/dist/lib/openapi/spec/create-strategy-schema.js +2 -2
  668. package/dist/lib/openapi/spec/create-strategy-schema.js.map +1 -1
  669. package/dist/lib/openapi/spec/create-strategy-variant-schema.d.ts +3 -3
  670. package/dist/lib/openapi/spec/create-strategy-variant-schema.js +3 -3
  671. package/dist/lib/openapi/spec/create-strategy-variant-schema.js.map +1 -1
  672. package/dist/lib/openapi/spec/create-tag-schema.d.ts +2 -2
  673. package/dist/lib/openapi/spec/create-tag-schema.js +1 -1
  674. package/dist/lib/openapi/spec/create-tag-schema.js.map +1 -1
  675. package/dist/lib/openapi/spec/create-user-response-schema.d.ts +8 -2
  676. package/dist/lib/openapi/spec/create-user-response-schema.d.ts.map +1 -1
  677. package/dist/lib/openapi/spec/create-user-response-schema.js +9 -2
  678. package/dist/lib/openapi/spec/create-user-response-schema.js.map +1 -1
  679. package/dist/lib/openapi/spec/create-user-schema.d.ts +1 -1
  680. package/dist/lib/openapi/spec/create-user-schema.d.ts.map +1 -1
  681. package/dist/lib/openapi/spec/create-user-schema.js +8 -1
  682. package/dist/lib/openapi/spec/create-user-schema.js.map +1 -1
  683. package/dist/lib/openapi/spec/edge-token-schema.d.ts +3 -3
  684. package/dist/lib/openapi/spec/edge-token-schema.js +3 -3
  685. package/dist/lib/openapi/spec/edge-token-schema.js.map +1 -1
  686. package/dist/lib/openapi/spec/environment-project-schema.d.ts +15 -13
  687. package/dist/lib/openapi/spec/environment-project-schema.d.ts.map +1 -1
  688. package/dist/lib/openapi/spec/environment-project-schema.js +1 -1
  689. package/dist/lib/openapi/spec/environment-project-schema.js.map +1 -1
  690. package/dist/lib/openapi/spec/environment-schema.d.ts +1 -1
  691. package/dist/lib/openapi/spec/environment-schema.js +1 -1
  692. package/dist/lib/openapi/spec/environment-schema.js.map +1 -1
  693. package/dist/lib/openapi/spec/environments-project-schema.d.ts +26 -24
  694. package/dist/lib/openapi/spec/environments-project-schema.d.ts.map +1 -1
  695. package/dist/lib/openapi/spec/environments-schema.d.ts +1 -1
  696. package/dist/lib/openapi/spec/event-schema.d.ts +7 -7
  697. package/dist/lib/openapi/spec/event-schema.js +1 -1
  698. package/dist/lib/openapi/spec/event-schema.js.map +1 -1
  699. package/dist/lib/openapi/spec/event-search-response-schema.d.ts +9 -9
  700. package/dist/lib/openapi/spec/events-schema.d.ts +9 -9
  701. package/dist/lib/openapi/spec/export-query-schema.d.ts +1 -1
  702. package/dist/lib/openapi/spec/export-query-schema.js +1 -1
  703. package/dist/lib/openapi/spec/export-query-schema.js.map +1 -1
  704. package/dist/lib/openapi/spec/export-result-schema.d.ts +1991 -529
  705. package/dist/lib/openapi/spec/export-result-schema.d.ts.map +1 -1
  706. package/dist/lib/openapi/spec/export-result-schema.js +6 -0
  707. package/dist/lib/openapi/spec/export-result-schema.js.map +1 -1
  708. package/dist/lib/openapi/spec/feature-environment-schema.d.ts +372 -107
  709. package/dist/lib/openapi/spec/feature-environment-schema.d.ts.map +1 -1
  710. package/dist/lib/openapi/spec/feature-environment-schema.js +12 -0
  711. package/dist/lib/openapi/spec/feature-environment-schema.js.map +1 -1
  712. package/dist/lib/openapi/spec/feature-events-schema.d.ts +9 -9
  713. package/dist/lib/openapi/spec/feature-schema.d.ts +950 -215
  714. package/dist/lib/openapi/spec/feature-schema.d.ts.map +1 -1
  715. package/dist/lib/openapi/spec/feature-schema.js +17 -0
  716. package/dist/lib/openapi/spec/feature-schema.js.map +1 -1
  717. package/dist/lib/openapi/spec/feature-search-environment-schema.d.ts +729 -213
  718. package/dist/lib/openapi/spec/feature-search-environment-schema.d.ts.map +1 -1
  719. package/dist/lib/openapi/spec/feature-search-response-schema.d.ts +745 -229
  720. package/dist/lib/openapi/spec/feature-search-response-schema.d.ts.map +1 -1
  721. package/dist/lib/openapi/spec/feature-strategy-schema.d.ts +9 -7
  722. package/dist/lib/openapi/spec/feature-strategy-schema.d.ts.map +1 -1
  723. package/dist/lib/openapi/spec/feature-strategy-schema.js +1 -1
  724. package/dist/lib/openapi/spec/feature-strategy-schema.js.map +1 -1
  725. package/dist/lib/openapi/spec/feature-tag-schema.d.ts +2 -2
  726. package/dist/lib/openapi/spec/feature-tag-schema.js +2 -2
  727. package/dist/lib/openapi/spec/feature-tag-schema.js.map +1 -1
  728. package/dist/lib/openapi/spec/feature-type-schema.d.ts +2 -2
  729. package/dist/lib/openapi/spec/feature-type-schema.js +2 -2
  730. package/dist/lib/openapi/spec/feature-type-schema.js.map +1 -1
  731. package/dist/lib/openapi/spec/feature-types-schema.d.ts +3 -3
  732. package/dist/lib/openapi/spec/feature-types-schema.js +1 -1
  733. package/dist/lib/openapi/spec/feature-types-schema.js.map +1 -1
  734. package/dist/lib/openapi/spec/feature-variants-schema.d.ts +3 -3
  735. package/dist/lib/openapi/spec/group-schema.d.ts +14 -2
  736. package/dist/lib/openapi/spec/group-schema.d.ts.map +1 -1
  737. package/dist/lib/openapi/spec/group-user-model-schema.d.ts +7 -1
  738. package/dist/lib/openapi/spec/group-user-model-schema.d.ts.map +1 -1
  739. package/dist/lib/openapi/spec/groups-schema.d.ts +29 -5
  740. package/dist/lib/openapi/spec/groups-schema.d.ts.map +1 -1
  741. package/dist/lib/openapi/spec/groups-schema.js +1 -1
  742. package/dist/lib/openapi/spec/groups-schema.js.map +1 -1
  743. package/dist/lib/openapi/spec/health-overview-schema.d.ts +1784 -535
  744. package/dist/lib/openapi/spec/health-overview-schema.d.ts.map +1 -1
  745. package/dist/lib/openapi/spec/health-overview-schema.js +3 -3
  746. package/dist/lib/openapi/spec/health-overview-schema.js.map +1 -1
  747. package/dist/lib/openapi/spec/health-report-schema.d.ts +1783 -534
  748. package/dist/lib/openapi/spec/health-report-schema.d.ts.map +1 -1
  749. package/dist/lib/openapi/spec/import-toggles-schema.d.ts +66 -27262
  750. package/dist/lib/openapi/spec/import-toggles-schema.d.ts.map +1 -1
  751. package/dist/lib/openapi/spec/import-toggles-schema.js +40 -31
  752. package/dist/lib/openapi/spec/import-toggles-schema.js.map +1 -1
  753. package/dist/lib/openapi/spec/import-toggles-validate-schema.d.ts +1 -1
  754. package/dist/lib/openapi/spec/import-toggles-validate-schema.js +1 -1
  755. package/dist/lib/openapi/spec/import-toggles-validate-schema.js.map +1 -1
  756. package/dist/lib/openapi/spec/index.d.ts +3 -0
  757. package/dist/lib/openapi/spec/index.d.ts.map +1 -1
  758. package/dist/lib/openapi/spec/index.js +3 -0
  759. package/dist/lib/openapi/spec/index.js.map +1 -1
  760. package/dist/lib/openapi/spec/instance-admin-stats-schema.d.ts +6 -0
  761. package/dist/lib/openapi/spec/instance-admin-stats-schema.d.ts.map +1 -1
  762. package/dist/lib/openapi/spec/instance-admin-stats-schema.js +6 -0
  763. package/dist/lib/openapi/spec/instance-admin-stats-schema.js.map +1 -1
  764. package/dist/lib/openapi/spec/integration-event-schema.d.ts +12 -12
  765. package/dist/lib/openapi/spec/integration-events-schema.d.ts +24 -24
  766. package/dist/lib/openapi/spec/me-schema.d.ts +8 -2
  767. package/dist/lib/openapi/spec/me-schema.d.ts.map +1 -1
  768. package/dist/lib/openapi/spec/metric-query-schema.d.ts +44 -0
  769. package/dist/lib/openapi/spec/metric-query-schema.d.ts.map +1 -0
  770. package/dist/lib/openapi/spec/metric-query-schema.js +42 -0
  771. package/dist/lib/openapi/spec/metric-query-schema.js.map +1 -0
  772. package/dist/lib/openapi/spec/pat-schema.d.ts +1 -1
  773. package/dist/lib/openapi/spec/pat-schema.js +1 -1
  774. package/dist/lib/openapi/spec/pat-schema.js.map +1 -1
  775. package/dist/lib/openapi/spec/pats-schema.d.ts +2 -2
  776. package/dist/lib/openapi/spec/pats-schema.js +1 -1
  777. package/dist/lib/openapi/spec/pats-schema.js.map +1 -1
  778. package/dist/lib/openapi/spec/permission-schema.d.ts +1 -1
  779. package/dist/lib/openapi/spec/permission-schema.js +1 -1
  780. package/dist/lib/openapi/spec/permission-schema.js.map +1 -1
  781. package/dist/lib/openapi/spec/personal-dashboard-project-details-schema.d.ts +1 -1
  782. package/dist/lib/openapi/spec/personal-dashboard-project-details-schema.js +1 -1
  783. package/dist/lib/openapi/spec/personal-dashboard-project-details-schema.js.map +1 -1
  784. package/dist/lib/openapi/spec/personal-dashboard-schema.d.ts +1 -1
  785. package/dist/lib/openapi/spec/personal-dashboard-schema.js +1 -1
  786. package/dist/lib/openapi/spec/personal-dashboard-schema.js.map +1 -1
  787. package/dist/lib/openapi/spec/playground-constraint-schema.d.ts +5 -3
  788. package/dist/lib/openapi/spec/playground-constraint-schema.d.ts.map +1 -1
  789. package/dist/lib/openapi/spec/playground-feature-schema.d.ts +17 -15
  790. package/dist/lib/openapi/spec/playground-feature-schema.d.ts.map +1 -1
  791. package/dist/lib/openapi/spec/playground-response-schema.d.ts +33 -31
  792. package/dist/lib/openapi/spec/playground-response-schema.d.ts.map +1 -1
  793. package/dist/lib/openapi/spec/playground-response-schema.test.js +1 -1
  794. package/dist/lib/openapi/spec/playground-response-schema.test.js.map +1 -1
  795. package/dist/lib/openapi/spec/playground-segment-schema.d.ts +5 -3
  796. package/dist/lib/openapi/spec/playground-segment-schema.d.ts.map +1 -1
  797. package/dist/lib/openapi/spec/playground-strategy-schema.d.ts +10 -8
  798. package/dist/lib/openapi/spec/playground-strategy-schema.d.ts.map +1 -1
  799. package/dist/lib/openapi/spec/profile-schema.d.ts +947 -214
  800. package/dist/lib/openapi/spec/profile-schema.d.ts.map +1 -1
  801. package/dist/lib/openapi/spec/project-environment-schema.d.ts +9 -9
  802. package/dist/lib/openapi/spec/project-feature-schema.d.ts +2 -2
  803. package/dist/lib/openapi/spec/project-features-schema.d.ts +4 -4
  804. package/dist/lib/openapi/spec/project-insights-schema.d.ts +2 -2
  805. package/dist/lib/openapi/spec/project-insights-schema.js +2 -2
  806. package/dist/lib/openapi/spec/project-insights-schema.js.map +1 -1
  807. package/dist/lib/openapi/spec/project-overview-schema.d.ts +1781 -532
  808. package/dist/lib/openapi/spec/project-overview-schema.d.ts.map +1 -1
  809. package/dist/lib/openapi/spec/project-overview-schema.js +2 -2
  810. package/dist/lib/openapi/spec/project-overview-schema.js.map +1 -1
  811. package/dist/lib/openapi/spec/project-schema.d.ts +2 -2
  812. package/dist/lib/openapi/spec/project-schema.js +2 -2
  813. package/dist/lib/openapi/spec/project-schema.js.map +1 -1
  814. package/dist/lib/openapi/spec/projects-schema.d.ts +2 -2
  815. package/dist/lib/openapi/spec/public-signup-token-create-schema.d.ts +1 -1
  816. package/dist/lib/openapi/spec/public-signup-token-create-schema.js +1 -1
  817. package/dist/lib/openapi/spec/public-signup-token-create-schema.js.map +1 -1
  818. package/dist/lib/openapi/spec/public-signup-token-schema.d.ts +8 -2
  819. package/dist/lib/openapi/spec/public-signup-token-schema.d.ts.map +1 -1
  820. package/dist/lib/openapi/spec/public-signup-token-schema.js +1 -1
  821. package/dist/lib/openapi/spec/public-signup-token-schema.js.map +1 -1
  822. package/dist/lib/openapi/spec/public-signup-tokens-schema.d.ts +15 -3
  823. package/dist/lib/openapi/spec/public-signup-tokens-schema.d.ts.map +1 -1
  824. package/dist/lib/openapi/spec/push-variants-schema.d.ts +3 -3
  825. package/dist/lib/openapi/spec/release-plan-milestone-schema.d.ts +45 -25
  826. package/dist/lib/openapi/spec/release-plan-milestone-schema.d.ts.map +1 -1
  827. package/dist/lib/openapi/spec/release-plan-milestone-schema.js +12 -1
  828. package/dist/lib/openapi/spec/release-plan-milestone-schema.js.map +1 -1
  829. package/dist/lib/openapi/spec/release-plan-milestone-strategy-schema.d.ts +15 -13
  830. package/dist/lib/openapi/spec/release-plan-milestone-strategy-schema.d.ts.map +1 -1
  831. package/dist/lib/openapi/spec/release-plan-schema.d.ts +283 -48
  832. package/dist/lib/openapi/spec/release-plan-schema.d.ts.map +1 -1
  833. package/dist/lib/openapi/spec/release-plan-schema.js +13 -0
  834. package/dist/lib/openapi/spec/release-plan-schema.js.map +1 -1
  835. package/dist/lib/openapi/spec/release-plan-template-schema.d.ts +68 -48
  836. package/dist/lib/openapi/spec/release-plan-template-schema.d.ts.map +1 -1
  837. package/dist/lib/openapi/spec/resource-limits-schema.d.ts +6 -0
  838. package/dist/lib/openapi/spec/resource-limits-schema.d.ts.map +1 -1
  839. package/dist/lib/openapi/spec/resource-limits-schema.js +6 -0
  840. package/dist/lib/openapi/spec/resource-limits-schema.js.map +1 -1
  841. package/dist/lib/openapi/spec/safeguard-schema.d.ts +149 -0
  842. package/dist/lib/openapi/spec/safeguard-schema.d.ts.map +1 -0
  843. package/dist/lib/openapi/spec/safeguard-schema.js +59 -0
  844. package/dist/lib/openapi/spec/safeguard-schema.js.map +1 -0
  845. package/dist/lib/openapi/spec/safeguard-trigger-condition-schema.d.ts +24 -0
  846. package/dist/lib/openapi/spec/safeguard-trigger-condition-schema.d.ts.map +1 -0
  847. package/dist/lib/openapi/spec/safeguard-trigger-condition-schema.js +22 -0
  848. package/dist/lib/openapi/spec/safeguard-trigger-condition-schema.js.map +1 -0
  849. package/dist/lib/openapi/spec/search-features-schema.d.ts +1578 -548
  850. package/dist/lib/openapi/spec/search-features-schema.d.ts.map +1 -1
  851. package/dist/lib/openapi/spec/segment-schema.d.ts +5 -3
  852. package/dist/lib/openapi/spec/segment-schema.d.ts.map +1 -1
  853. package/dist/lib/openapi/spec/segments-schema.d.ts +9 -7
  854. package/dist/lib/openapi/spec/segments-schema.d.ts.map +1 -1
  855. package/dist/lib/openapi/spec/segments-schema.js +1 -1
  856. package/dist/lib/openapi/spec/segments-schema.js.map +1 -1
  857. package/dist/lib/openapi/spec/strategies-schema.d.ts +1 -1
  858. package/dist/lib/openapi/spec/strategy-schema.d.ts +1 -1
  859. package/dist/lib/openapi/spec/strategy-schema.js +1 -1
  860. package/dist/lib/openapi/spec/strategy-schema.js.map +1 -1
  861. package/dist/lib/openapi/spec/strategy-variant-schema.d.ts +3 -3
  862. package/dist/lib/openapi/spec/tag-schema.d.ts +2 -2
  863. package/dist/lib/openapi/spec/tag-schema.js +2 -2
  864. package/dist/lib/openapi/spec/tag-schema.js.map +1 -1
  865. package/dist/lib/openapi/spec/tag-with-version-schema.d.ts +2 -2
  866. package/dist/lib/openapi/spec/tags-bulk-add-schema.d.ts +4 -4
  867. package/dist/lib/openapi/spec/tags-schema.d.ts +2 -2
  868. package/dist/lib/openapi/spec/ui-config-schema.d.ts +6 -0
  869. package/dist/lib/openapi/spec/ui-config-schema.d.ts.map +1 -1
  870. package/dist/lib/openapi/spec/update-context-field-schema.d.ts +6 -1
  871. package/dist/lib/openapi/spec/update-context-field-schema.d.ts.map +1 -1
  872. package/dist/lib/openapi/spec/update-context-field-schema.js +6 -1
  873. package/dist/lib/openapi/spec/update-context-field-schema.js.map +1 -1
  874. package/dist/lib/openapi/spec/update-feature-schema.d.ts +6 -4
  875. package/dist/lib/openapi/spec/update-feature-schema.d.ts.map +1 -1
  876. package/dist/lib/openapi/spec/update-feature-schema.js +1 -1
  877. package/dist/lib/openapi/spec/update-feature-schema.js.map +1 -1
  878. package/dist/lib/openapi/spec/update-feature-strategy-schema.d.ts +6 -4
  879. package/dist/lib/openapi/spec/update-feature-strategy-schema.d.ts.map +1 -1
  880. package/dist/lib/openapi/spec/update-feature-strategy-schema.js +1 -1
  881. package/dist/lib/openapi/spec/update-feature-strategy-schema.js.map +1 -1
  882. package/dist/lib/openapi/spec/update-feature-type-lifetime-schema.d.ts +1 -1
  883. package/dist/lib/openapi/spec/update-feature-type-lifetime-schema.js +1 -1
  884. package/dist/lib/openapi/spec/update-feature-type-lifetime-schema.js.map +1 -1
  885. package/dist/lib/openapi/spec/update-strategy-schema.d.ts +1 -1
  886. package/dist/lib/openapi/spec/update-strategy-schema.js +1 -1
  887. package/dist/lib/openapi/spec/update-strategy-schema.js.map +1 -1
  888. package/dist/lib/openapi/spec/update-tags-schema.d.ts +2 -2
  889. package/dist/lib/openapi/spec/update-user-schema.d.ts +1 -1
  890. package/dist/lib/openapi/spec/update-user-schema.d.ts.map +1 -1
  891. package/dist/lib/openapi/spec/update-user-schema.js +8 -1
  892. package/dist/lib/openapi/spec/update-user-schema.js.map +1 -1
  893. package/dist/lib/openapi/spec/upsert-segment-schema.d.ts +5 -3
  894. package/dist/lib/openapi/spec/upsert-segment-schema.d.ts.map +1 -1
  895. package/dist/lib/openapi/spec/upsert-segment-schema.test.js +6 -2
  896. package/dist/lib/openapi/spec/upsert-segment-schema.test.js.map +1 -1
  897. package/dist/lib/openapi/spec/user-access-overview-schema.d.ts +7 -1
  898. package/dist/lib/openapi/spec/user-access-overview-schema.d.ts.map +1 -1
  899. package/dist/lib/openapi/spec/user-schema.d.ts +7 -1
  900. package/dist/lib/openapi/spec/user-schema.d.ts.map +1 -1
  901. package/dist/lib/openapi/spec/user-schema.js +7 -1
  902. package/dist/lib/openapi/spec/user-schema.js.map +1 -1
  903. package/dist/lib/openapi/spec/users-groups-base-schema.d.ts +28 -4
  904. package/dist/lib/openapi/spec/users-groups-base-schema.d.ts.map +1 -1
  905. package/dist/lib/openapi/spec/users-schema.d.ts +8 -2
  906. package/dist/lib/openapi/spec/users-schema.d.ts.map +1 -1
  907. package/dist/lib/openapi/spec/users-schema.js +1 -1
  908. package/dist/lib/openapi/spec/users-schema.js.map +1 -1
  909. package/dist/lib/openapi/spec/users-search-schema.d.ts +7 -1
  910. package/dist/lib/openapi/spec/users-search-schema.d.ts.map +1 -1
  911. package/dist/lib/openapi/spec/validated-edge-tokens-schema.d.ts +3 -3
  912. package/dist/lib/openapi/spec/variant-schema.d.ts +3 -3
  913. package/dist/lib/openapi/spec/variant-schema.js +3 -3
  914. package/dist/lib/openapi/spec/variant-schema.js.map +1 -1
  915. package/dist/lib/openapi/spec/variants-schema.d.ts +3 -3
  916. package/dist/lib/openapi/util/api-operation.d.ts +1 -3
  917. package/dist/lib/openapi/util/api-operation.d.ts.map +1 -1
  918. package/dist/lib/openapi/util/openapi-tags.d.ts +40 -40
  919. package/dist/lib/openapi/util/openapi-tags.js +20 -20
  920. package/dist/lib/openapi/util/openapi-tags.js.map +1 -1
  921. package/dist/lib/openapi/validate.d.ts +2 -2
  922. package/dist/lib/openapi/validate.d.ts.map +1 -1
  923. package/dist/lib/routes/admin-api/addon.d.ts +1 -2
  924. package/dist/lib/routes/admin-api/addon.d.ts.map +1 -1
  925. package/dist/lib/routes/admin-api/addon.js +1 -2
  926. package/dist/lib/routes/admin-api/addon.js.map +1 -1
  927. package/dist/lib/routes/admin-api/api-token.js +2 -2
  928. package/dist/lib/routes/admin-api/api-token.js.map +1 -1
  929. package/dist/lib/routes/admin-api/event.d.ts +1 -1
  930. package/dist/lib/routes/admin-api/event.d.ts.map +1 -1
  931. package/dist/lib/routes/admin-api/event.js +1 -1
  932. package/dist/lib/routes/admin-api/event.js.map +1 -1
  933. package/dist/lib/routes/admin-api/events.test.js +1 -1
  934. package/dist/lib/routes/admin-api/events.test.js.map +1 -1
  935. package/dist/lib/routes/admin-api/feature-type.d.ts +1 -2
  936. package/dist/lib/routes/admin-api/feature-type.d.ts.map +1 -1
  937. package/dist/lib/routes/admin-api/feature-type.js +2 -3
  938. package/dist/lib/routes/admin-api/feature-type.js.map +1 -1
  939. package/dist/lib/routes/admin-api/instance-admin.d.ts +1 -3
  940. package/dist/lib/routes/admin-api/instance-admin.d.ts.map +1 -1
  941. package/dist/lib/routes/admin-api/instance-admin.js +4 -4
  942. package/dist/lib/routes/admin-api/instance-admin.js.map +1 -1
  943. package/dist/lib/routes/admin-api/metrics.d.ts +2 -3
  944. package/dist/lib/routes/admin-api/metrics.d.ts.map +1 -1
  945. package/dist/lib/routes/admin-api/metrics.js +2 -3
  946. package/dist/lib/routes/admin-api/metrics.js.map +1 -1
  947. package/dist/lib/routes/admin-api/project/api-token.d.ts +0 -1
  948. package/dist/lib/routes/admin-api/project/api-token.d.ts.map +1 -1
  949. package/dist/lib/routes/admin-api/project/api-token.js +3 -4
  950. package/dist/lib/routes/admin-api/project/api-token.js.map +1 -1
  951. package/dist/lib/routes/admin-api/project/health-report.js +1 -1
  952. package/dist/lib/routes/admin-api/project/health-report.js.map +1 -1
  953. package/dist/lib/routes/admin-api/public-signup.d.ts +2 -4
  954. package/dist/lib/routes/admin-api/public-signup.d.ts.map +1 -1
  955. package/dist/lib/routes/admin-api/public-signup.js +2 -4
  956. package/dist/lib/routes/admin-api/public-signup.js.map +1 -1
  957. package/dist/lib/routes/admin-api/search/index.d.ts +1 -1
  958. package/dist/lib/routes/admin-api/search/index.d.ts.map +1 -1
  959. package/dist/lib/routes/admin-api/search/index.js +1 -1
  960. package/dist/lib/routes/admin-api/search/index.js.map +1 -1
  961. package/dist/lib/routes/admin-api/strategy.d.ts +1 -2
  962. package/dist/lib/routes/admin-api/strategy.d.ts.map +1 -1
  963. package/dist/lib/routes/admin-api/strategy.js +7 -8
  964. package/dist/lib/routes/admin-api/strategy.js.map +1 -1
  965. package/dist/lib/routes/admin-api/tag.d.ts +2 -4
  966. package/dist/lib/routes/admin-api/tag.d.ts.map +1 -1
  967. package/dist/lib/routes/admin-api/tag.js +4 -6
  968. package/dist/lib/routes/admin-api/tag.js.map +1 -1
  969. package/dist/lib/routes/admin-api/telemetry.d.ts +1 -1
  970. package/dist/lib/routes/admin-api/telemetry.d.ts.map +1 -1
  971. package/dist/lib/routes/admin-api/telemetry.js +1 -1
  972. package/dist/lib/routes/admin-api/telemetry.js.map +1 -1
  973. package/dist/lib/routes/admin-api/user/pat.js +3 -3
  974. package/dist/lib/routes/admin-api/user/pat.js.map +1 -1
  975. package/dist/lib/routes/admin-api/user/user.test.js +2 -2
  976. package/dist/lib/routes/admin-api/user/user.test.js.map +1 -1
  977. package/dist/lib/routes/admin-api/user-admin.d.ts +3 -3
  978. package/dist/lib/routes/admin-api/user-admin.d.ts.map +1 -1
  979. package/dist/lib/routes/admin-api/user-admin.js +4 -4
  980. package/dist/lib/routes/admin-api/user-admin.js.map +1 -1
  981. package/dist/lib/routes/admin-api/user-feedback.d.ts +0 -1
  982. package/dist/lib/routes/admin-api/user-feedback.d.ts.map +1 -1
  983. package/dist/lib/routes/admin-api/user-feedback.js +2 -3
  984. package/dist/lib/routes/admin-api/user-feedback.js.map +1 -1
  985. package/dist/lib/routes/admin-api/user-splash.d.ts +0 -1
  986. package/dist/lib/routes/admin-api/user-splash.d.ts.map +1 -1
  987. package/dist/lib/routes/admin-api/user-splash.js +2 -2
  988. package/dist/lib/routes/admin-api/user-splash.js.map +1 -1
  989. package/dist/lib/routes/auth/reset-password-controller.d.ts +0 -1
  990. package/dist/lib/routes/auth/reset-password-controller.d.ts.map +1 -1
  991. package/dist/lib/routes/auth/reset-password-controller.js +0 -1
  992. package/dist/lib/routes/auth/reset-password-controller.js.map +1 -1
  993. package/dist/lib/routes/auth/simple-password-provider.d.ts +0 -1
  994. package/dist/lib/routes/auth/simple-password-provider.d.ts.map +1 -1
  995. package/dist/lib/routes/auth/simple-password-provider.js +0 -1
  996. package/dist/lib/routes/auth/simple-password-provider.js.map +1 -1
  997. package/dist/lib/routes/auth/simple-password-provider.test.js +2 -2
  998. package/dist/lib/routes/auth/simple-password-provider.test.js.map +1 -1
  999. package/dist/lib/routes/backstage.js +3 -3
  1000. package/dist/lib/routes/backstage.js.map +1 -1
  1001. package/dist/lib/routes/health-check.d.ts +0 -2
  1002. package/dist/lib/routes/health-check.d.ts.map +1 -1
  1003. package/dist/lib/routes/health-check.js +0 -2
  1004. package/dist/lib/routes/health-check.js.map +1 -1
  1005. package/dist/lib/routes/logout.test.js +5 -5
  1006. package/dist/lib/routes/logout.test.js.map +1 -1
  1007. package/dist/lib/routes/public-invite.d.ts +0 -1
  1008. package/dist/lib/routes/public-invite.d.ts.map +1 -1
  1009. package/dist/lib/routes/public-invite.js +0 -1
  1010. package/dist/lib/routes/public-invite.js.map +1 -1
  1011. package/dist/lib/schema/constraint-value-types.d.ts +1 -1
  1012. package/dist/lib/schema/constraint-value-types.d.ts.map +1 -1
  1013. package/dist/lib/server-impl.d.ts +5 -6
  1014. package/dist/lib/server-impl.d.ts.map +1 -1
  1015. package/dist/lib/server-impl.js +13 -4
  1016. package/dist/lib/server-impl.js.map +1 -1
  1017. package/dist/lib/services/access-service.d.ts +2 -1
  1018. package/dist/lib/services/access-service.d.ts.map +1 -1
  1019. package/dist/lib/services/access-service.js +20 -1
  1020. package/dist/lib/services/access-service.js.map +1 -1
  1021. package/dist/lib/services/access-service.test.js +22 -6
  1022. package/dist/lib/services/access-service.test.js.map +1 -1
  1023. package/dist/lib/services/account-service.d.ts.map +1 -1
  1024. package/dist/lib/services/account-service.js +1 -0
  1025. package/dist/lib/services/account-service.js.map +1 -1
  1026. package/dist/lib/services/addon-service.d.ts +2 -2
  1027. package/dist/lib/services/addon-service.d.ts.map +1 -1
  1028. package/dist/lib/services/addon-service.js +22 -21
  1029. package/dist/lib/services/addon-service.js.map +1 -1
  1030. package/dist/lib/services/addon-service.test.js +1 -1
  1031. package/dist/lib/services/addon-service.test.js.map +1 -1
  1032. package/dist/lib/services/api-token-service.d.ts.map +1 -1
  1033. package/dist/lib/services/api-token-service.js +3 -1
  1034. package/dist/lib/services/api-token-service.js.map +1 -1
  1035. package/dist/lib/services/api-token-service.limit.test.js.map +1 -1
  1036. package/dist/lib/services/api-token-service.test.js +2 -2
  1037. package/dist/lib/services/api-token-service.test.js.map +1 -1
  1038. package/dist/lib/services/client-spec-service.d.ts +1 -2
  1039. package/dist/lib/services/client-spec-service.d.ts.map +1 -1
  1040. package/dist/lib/services/client-spec-service.js +1 -2
  1041. package/dist/lib/services/client-spec-service.js.map +1 -1
  1042. package/dist/lib/services/context-schema.d.ts.map +1 -1
  1043. package/dist/lib/services/context-schema.js +1 -0
  1044. package/dist/lib/services/context-schema.js.map +1 -1
  1045. package/dist/lib/services/favorites-service.d.ts +1 -3
  1046. package/dist/lib/services/favorites-service.d.ts.map +1 -1
  1047. package/dist/lib/services/favorites-service.js +2 -4
  1048. package/dist/lib/services/favorites-service.js.map +1 -1
  1049. package/dist/lib/services/feature-tag-service.d.ts.map +1 -1
  1050. package/dist/lib/services/feature-tag-service.js +1 -0
  1051. package/dist/lib/services/feature-tag-service.js.map +1 -1
  1052. package/dist/lib/services/group-service.d.ts +2 -2
  1053. package/dist/lib/services/group-service.d.ts.map +1 -1
  1054. package/dist/lib/services/group-service.js +3 -2
  1055. package/dist/lib/services/group-service.js.map +1 -1
  1056. package/dist/lib/services/health-service.d.ts +1 -3
  1057. package/dist/lib/services/health-service.d.ts.map +1 -1
  1058. package/dist/lib/services/health-service.js +1 -2
  1059. package/dist/lib/services/health-service.js.map +1 -1
  1060. package/dist/lib/services/index.d.ts +1 -1
  1061. package/dist/lib/services/index.d.ts.map +1 -1
  1062. package/dist/lib/services/index.js +5 -4
  1063. package/dist/lib/services/index.js.map +1 -1
  1064. package/dist/lib/services/openapi-service.js +7 -5
  1065. package/dist/lib/services/openapi-service.js.map +1 -1
  1066. package/dist/lib/services/public-signup-token-service.d.ts +0 -1
  1067. package/dist/lib/services/public-signup-token-service.d.ts.map +1 -1
  1068. package/dist/lib/services/public-signup-token-service.js +0 -1
  1069. package/dist/lib/services/public-signup-token-service.js.map +1 -1
  1070. package/dist/lib/services/reset-token-service.js +3 -3
  1071. package/dist/lib/services/reset-token-service.js.map +1 -1
  1072. package/dist/lib/services/strategy-service.d.ts +1 -2
  1073. package/dist/lib/services/strategy-service.d.ts.map +1 -1
  1074. package/dist/lib/services/strategy-service.js +2 -3
  1075. package/dist/lib/services/strategy-service.js.map +1 -1
  1076. package/dist/lib/services/user-service.d.ts +3 -0
  1077. package/dist/lib/services/user-service.d.ts.map +1 -1
  1078. package/dist/lib/services/user-service.js +11 -7
  1079. package/dist/lib/services/user-service.js.map +1 -1
  1080. package/dist/lib/services/user-service.test.js +28 -1
  1081. package/dist/lib/services/user-service.test.js.map +1 -1
  1082. package/dist/lib/services/version-service.d.ts +7 -1
  1083. package/dist/lib/services/version-service.d.ts.map +1 -1
  1084. package/dist/lib/services/version-service.js +5 -1
  1085. package/dist/lib/services/version-service.js.map +1 -1
  1086. package/dist/lib/services/version-service.test.js +44 -0
  1087. package/dist/lib/services/version-service.test.js.map +1 -1
  1088. package/dist/lib/types/experimental.d.ts +1 -1
  1089. package/dist/lib/types/experimental.d.ts.map +1 -1
  1090. package/dist/lib/types/experimental.js +13 -7
  1091. package/dist/lib/types/experimental.js.map +1 -1
  1092. package/dist/lib/types/model.d.ts +6 -1
  1093. package/dist/lib/types/model.d.ts.map +1 -1
  1094. package/dist/lib/types/model.js +1 -0
  1095. package/dist/lib/types/model.js.map +1 -1
  1096. package/dist/lib/types/permissions.d.ts +1 -0
  1097. package/dist/lib/types/permissions.d.ts.map +1 -1
  1098. package/dist/lib/types/permissions.js +2 -0
  1099. package/dist/lib/types/permissions.js.map +1 -1
  1100. package/dist/lib/types/user.d.ts +6 -1
  1101. package/dist/lib/types/user.d.ts.map +1 -1
  1102. package/dist/lib/types/user.js +3 -1
  1103. package/dist/lib/types/user.js.map +1 -1
  1104. package/dist/lib/ui-config/ui-config-service.d.ts.map +1 -1
  1105. package/dist/lib/ui-config/ui-config-service.js.map +1 -1
  1106. package/dist/lib/ui-config/ui-config.test.js +2 -2
  1107. package/dist/lib/ui-config/ui-config.test.js.map +1 -1
  1108. package/dist/lib/users/inactive/fakes/fake-inactive-users-store.d.ts.map +1 -1
  1109. package/dist/lib/users/inactive/fakes/fake-inactive-users-store.js +1 -0
  1110. package/dist/lib/users/inactive/fakes/fake-inactive-users-store.js.map +1 -1
  1111. package/dist/lib/users/inactive/inactive-users-store.d.ts +1 -3
  1112. package/dist/lib/users/inactive/inactive-users-store.d.ts.map +1 -1
  1113. package/dist/lib/users/inactive/inactive-users-store.js +1 -3
  1114. package/dist/lib/users/inactive/inactive-users-store.js.map +1 -1
  1115. package/dist/lib/util/anonymise.test.js.map +1 -1
  1116. package/dist/lib/util/batchExecute.d.ts.map +1 -1
  1117. package/dist/lib/util/batchExecute.js +3 -1
  1118. package/dist/lib/util/batchExecute.js.map +1 -1
  1119. package/dist/lib/util/flag-resolver.d.ts.map +1 -1
  1120. package/dist/lib/util/flag-resolver.js +11 -3
  1121. package/dist/lib/util/flag-resolver.js.map +1 -1
  1122. package/dist/lib/util/flag-resolver.test.js +66 -15
  1123. package/dist/lib/util/flag-resolver.test.js.map +1 -1
  1124. package/dist/lib/util/graceful-shutdown.js +1 -1
  1125. package/dist/lib/util/graceful-shutdown.js.map +1 -1
  1126. package/dist/lib/util/parseEnvVar.d.ts +2 -0
  1127. package/dist/lib/util/parseEnvVar.d.ts.map +1 -1
  1128. package/dist/lib/util/parseEnvVar.js +21 -1
  1129. package/dist/lib/util/parseEnvVar.js.map +1 -1
  1130. package/dist/lib/util/parseEnvVar.test.js +24 -1
  1131. package/dist/lib/util/parseEnvVar.test.js.map +1 -1
  1132. package/dist/lib/util/postgres-version-checker.test.js +17 -5
  1133. package/dist/lib/util/postgres-version-checker.test.js.map +1 -1
  1134. package/dist/lib/util/semver.js +1 -1
  1135. package/dist/lib/util/semver.js.map +1 -1
  1136. package/dist/lib/util/validateJsonString.js +1 -1
  1137. package/dist/lib/util/validateJsonString.js.map +1 -1
  1138. package/dist/mailtemplates/getting-started/getting-started.html.mustache +1 -1
  1139. package/dist/migrations/20251118131212-edge-observability-hosting.d.ts +3 -0
  1140. package/dist/migrations/20251118131212-edge-observability-hosting.d.ts.map +1 -0
  1141. package/dist/migrations/20251118131212-edge-observability-hosting.js +14 -0
  1142. package/dist/migrations/20251118131212-edge-observability-hosting.js.map +1 -0
  1143. package/dist/migrations/20251209090115-add-default-release-plan-template.d.ts +3 -0
  1144. package/dist/migrations/20251209090115-add-default-release-plan-template.d.ts.map +1 -0
  1145. package/dist/migrations/20251209090115-add-default-release-plan-template.js +45 -0
  1146. package/dist/migrations/20251209090115-add-default-release-plan-template.js.map +1 -0
  1147. package/dist/migrations/20251210144308-add-project-column-to-context-fields.d.ts +3 -0
  1148. package/dist/migrations/20251210144308-add-project-column-to-context-fields.d.ts.map +1 -0
  1149. package/dist/migrations/20251210144308-add-project-column-to-context-fields.js +8 -0
  1150. package/dist/migrations/20251210144308-add-project-column-to-context-fields.js.map +1 -0
  1151. package/dist/migrations/20251218153722-predefined-project-role-reader.d.ts +3 -0
  1152. package/dist/migrations/20251218153722-predefined-project-role-reader.d.ts.map +1 -0
  1153. package/dist/migrations/20251218153722-predefined-project-role-reader.js +24 -0
  1154. package/dist/migrations/20251218153722-predefined-project-role-reader.js.map +1 -0
  1155. package/dist/migrations/20260106164443-users-seat-type.d.ts +3 -0
  1156. package/dist/migrations/20260106164443-users-seat-type.d.ts.map +1 -0
  1157. package/dist/migrations/20260106164443-users-seat-type.js +8 -0
  1158. package/dist/migrations/20260106164443-users-seat-type.js.map +1 -0
  1159. package/dist/migrations/20260112111353-add-project-context-permission.d.ts +3 -0
  1160. package/dist/migrations/20260112111353-add-project-context-permission.d.ts.map +1 -0
  1161. package/dist/migrations/20260112111353-add-project-context-permission.js +9 -0
  1162. package/dist/migrations/20260112111353-add-project-context-permission.js.map +1 -0
  1163. package/dist/migrations/20260115122651-project-owner-crud-project-context.d.ts +3 -0
  1164. package/dist/migrations/20260115122651-project-owner-crud-project-context.d.ts.map +1 -0
  1165. package/dist/migrations/20260115122651-project-owner-crud-project-context.js +14 -0
  1166. package/dist/migrations/20260115122651-project-owner-crud-project-context.js.map +1 -0
  1167. package/dist/migrations/20260115122720-project-owner-crud-project-segment.d.ts +3 -0
  1168. package/dist/migrations/20260115122720-project-owner-crud-project-segment.d.ts.map +1 -0
  1169. package/dist/migrations/20260115122720-project-owner-crud-project-segment.js +14 -0
  1170. package/dist/migrations/20260115122720-project-owner-crud-project-segment.js.map +1 -0
  1171. package/dist/migrations/20260119100647-add-api-key-revision-id-to-edge-observability.d.ts +3 -0
  1172. package/dist/migrations/20260119100647-add-api-key-revision-id-to-edge-observability.d.ts.map +1 -0
  1173. package/dist/migrations/20260119100647-add-api-key-revision-id-to-edge-observability.js +8 -0
  1174. package/dist/migrations/20260119100647-add-api-key-revision-id-to-edge-observability.js.map +1 -0
  1175. package/dist/server-dev.js +6 -2
  1176. package/dist/server-dev.js.map +1 -1
  1177. package/dist/test/arbitraries.test.d.ts.map +1 -1
  1178. package/dist/test/arbitraries.test.js +1 -0
  1179. package/dist/test/arbitraries.test.js.map +1 -1
  1180. package/dist/test/config/create-config.test.js +2 -2
  1181. package/dist/test/config/create-config.test.js.map +1 -1
  1182. package/dist/test/e2e/api/admin/addon.e2e.test.js +4 -1
  1183. package/dist/test/e2e/api/admin/addon.e2e.test.js.map +1 -1
  1184. package/dist/test/e2e/api/admin/api-token.auth.e2e.test.js +6 -3
  1185. package/dist/test/e2e/api/admin/api-token.auth.e2e.test.js.map +1 -1
  1186. package/dist/test/e2e/api/admin/api-token.e2e.test.js +12 -3
  1187. package/dist/test/e2e/api/admin/api-token.e2e.test.js.map +1 -1
  1188. package/dist/test/e2e/api/admin/conditional-middleware.e2e.test.js +8 -8
  1189. package/dist/test/e2e/api/admin/conditional-middleware.e2e.test.js.map +1 -1
  1190. package/dist/test/e2e/api/admin/context-api-include-query-params.e2e.test.d.ts +2 -0
  1191. package/dist/test/e2e/api/admin/context-api-include-query-params.e2e.test.d.ts.map +1 -0
  1192. package/dist/test/e2e/api/admin/context-api-include-query-params.e2e.test.js +81 -0
  1193. package/dist/test/e2e/api/admin/context-api-include-query-params.e2e.test.js.map +1 -0
  1194. package/dist/test/e2e/api/admin/feature-type.test.js +4 -1
  1195. package/dist/test/e2e/api/admin/feature-type.test.js.map +1 -1
  1196. package/dist/test/e2e/api/admin/feature.custom-auth.e2e.test.js +3 -3
  1197. package/dist/test/e2e/api/admin/feature.custom-auth.e2e.test.js.map +1 -1
  1198. package/dist/test/e2e/api/admin/feedback.e2e.test.js +3 -3
  1199. package/dist/test/e2e/api/admin/feedback.e2e.test.js.map +1 -1
  1200. package/dist/test/e2e/api/admin/instance-admin.e2e.test.js +1 -1
  1201. package/dist/test/e2e/api/admin/metrics.e2e.test.js +3 -3
  1202. package/dist/test/e2e/api/admin/metrics.e2e.test.js.map +1 -1
  1203. package/dist/test/e2e/api/admin/playground.e2e.test.js +12 -11
  1204. package/dist/test/e2e/api/admin/playground.e2e.test.js.map +1 -1
  1205. package/dist/test/e2e/api/admin/project/project.api.tokens.e2e.test.js +5 -1
  1206. package/dist/test/e2e/api/admin/project/project.api.tokens.e2e.test.js.map +1 -1
  1207. package/dist/test/e2e/api/admin/project/project.health.e2e.test.js +1 -1
  1208. package/dist/test/e2e/api/admin/project/project.health.e2e.test.js.map +1 -1
  1209. package/dist/test/e2e/api/admin/project/variants.e2e.test.js +2 -2
  1210. package/dist/test/e2e/api/admin/project/variants.e2e.test.js.map +1 -1
  1211. package/dist/test/e2e/api/admin/project-context.e2e.test.d.ts +2 -0
  1212. package/dist/test/e2e/api/admin/project-context.e2e.test.d.ts.map +1 -0
  1213. package/dist/test/e2e/api/admin/project-context.e2e.test.js +102 -0
  1214. package/dist/test/e2e/api/admin/project-context.e2e.test.js.map +1 -0
  1215. package/dist/test/e2e/api/admin/public-signup-token.e2e.test.js +12 -12
  1216. package/dist/test/e2e/api/admin/public-signup-token.e2e.test.js.map +1 -1
  1217. package/dist/test/e2e/api/admin/splash.e2e.test.js +3 -3
  1218. package/dist/test/e2e/api/admin/splash.e2e.test.js.map +1 -1
  1219. package/dist/test/e2e/api/admin/user/pat.e2e.test.d.ts +1 -1
  1220. package/dist/test/e2e/api/admin/user/pat.e2e.test.js +1 -1
  1221. package/dist/test/e2e/api/admin/user-admin.e2e.test.js +1 -1
  1222. package/dist/test/e2e/api/admin/user-admin.e2e.test.js.map +1 -1
  1223. package/dist/test/e2e/api/auth/reset-password-controller.e2e.test.js +3 -0
  1224. package/dist/test/e2e/api/auth/reset-password-controller.e2e.test.js.map +1 -1
  1225. package/dist/test/e2e/api/auth/simple-password-provider.e2e.test.js +3 -0
  1226. package/dist/test/e2e/api/auth/simple-password-provider.e2e.test.js.map +1 -1
  1227. package/dist/test/e2e/api/client/bulk-metrics-rejections.e2e.test.d.ts +2 -0
  1228. package/dist/test/e2e/api/client/bulk-metrics-rejections.e2e.test.d.ts.map +1 -0
  1229. package/dist/test/e2e/api/client/bulk-metrics-rejections.e2e.test.js +173 -0
  1230. package/dist/test/e2e/api/client/bulk-metrics-rejections.e2e.test.js.map +1 -0
  1231. package/dist/test/e2e/api/client/feature.auth-none.e2e.test.js +1 -1
  1232. package/dist/test/e2e/api/client/feature.auth-none.e2e.test.js.map +1 -1
  1233. package/dist/test/e2e/api/client/feature.e2e.test.js +15 -2
  1234. package/dist/test/e2e/api/client/feature.e2e.test.js.map +1 -1
  1235. package/dist/test/e2e/api/client/feature.optimal304.e2e.test.js +254 -113
  1236. package/dist/test/e2e/api/client/feature.optimal304.e2e.test.js.map +1 -1
  1237. package/dist/test/e2e/api/client/feature.token.access.e2e.test.js +1 -1
  1238. package/dist/test/e2e/api/client/feature.token.access.e2e.test.js.map +1 -1
  1239. package/dist/test/e2e/api/client/metrics.e2e.test.js +2 -1
  1240. package/dist/test/e2e/api/client/metrics.e2e.test.js.map +1 -1
  1241. package/dist/test/e2e/api/client/register.e2e.test.js +4 -4
  1242. package/dist/test/e2e/api/client/register.e2e.test.js.map +1 -1
  1243. package/dist/test/e2e/custom-auth.test.js +2 -2
  1244. package/dist/test/e2e/custom-auth.test.js.map +1 -1
  1245. package/dist/test/e2e/features-created-by-user-id-data-migration.e2e.test.js +4 -4
  1246. package/dist/test/e2e/features-created-by-user-id-data-migration.e2e.test.js.map +1 -1
  1247. package/dist/test/e2e/helpers/database-init.d.ts +1 -1
  1248. package/dist/test/e2e/helpers/database-init.d.ts.map +1 -1
  1249. package/dist/test/e2e/helpers/database-init.js +1 -1
  1250. package/dist/test/e2e/helpers/database-init.js.map +1 -1
  1251. package/dist/test/e2e/seed/segment.seed.js +2 -2
  1252. package/dist/test/e2e/seed/segment.seed.js.map +1 -1
  1253. package/dist/test/e2e/services/access-service.e2e.test.js +34 -2
  1254. package/dist/test/e2e/services/access-service.e2e.test.js.map +1 -1
  1255. package/dist/test/e2e/services/addon-service.e2e.test.js +1 -1
  1256. package/dist/test/e2e/services/addon-service.e2e.test.js.map +1 -1
  1257. package/dist/test/e2e/services/api-token-service.e2e.test.js +1 -1
  1258. package/dist/test/e2e/services/api-token-service.e2e.test.js.map +1 -1
  1259. package/dist/test/e2e/services/playground-service.test.js +18 -12
  1260. package/dist/test/e2e/services/playground-service.test.js.map +1 -1
  1261. package/dist/test/e2e/services/reset-token-service.e2e.test.js +3 -0
  1262. package/dist/test/e2e/services/reset-token-service.e2e.test.js.map +1 -1
  1263. package/dist/test/e2e/services/setting-service.test.js +2 -2
  1264. package/dist/test/e2e/services/setting-service.test.js.map +1 -1
  1265. package/dist/test/e2e/services/user-service.e2e.test.js +4 -1
  1266. package/dist/test/e2e/services/user-service.e2e.test.js.map +1 -1
  1267. package/dist/test/e2e/stores/client-application-store.e2e.test.js +22 -22
  1268. package/dist/test/e2e/stores/client-application-store.e2e.test.js.map +1 -1
  1269. package/dist/test/e2e/stores/client-instance-store.e2e.test.js +2 -2
  1270. package/dist/test/e2e/stores/client-instance-store.e2e.test.js.map +1 -1
  1271. package/dist/test/e2e/stores/context-field-store.e2e.test.js +2 -2
  1272. package/dist/test/e2e/stores/context-field-store.e2e.test.js.map +1 -1
  1273. package/dist/test/e2e/stores/event-store.e2e.test.js +17 -29
  1274. package/dist/test/e2e/stores/event-store.e2e.test.js.map +1 -1
  1275. package/dist/test/e2e/users/inactive/inactive-users-service.test.js +3 -1
  1276. package/dist/test/e2e/users/inactive/inactive-users-service.test.js.map +1 -1
  1277. package/dist/test/fixtures/access-service-mock.d.ts +13 -13
  1278. package/dist/test/fixtures/access-service-mock.d.ts.map +1 -1
  1279. package/dist/test/fixtures/access-service-mock.js +13 -13
  1280. package/dist/test/fixtures/access-service-mock.js.map +1 -1
  1281. package/dist/test/fixtures/fake-access-store.d.ts +38 -34
  1282. package/dist/test/fixtures/fake-access-store.d.ts.map +1 -1
  1283. package/dist/test/fixtures/fake-access-store.js +37 -35
  1284. package/dist/test/fixtures/fake-access-store.js.map +1 -1
  1285. package/dist/test/fixtures/fake-account-store.d.ts +2 -2
  1286. package/dist/test/fixtures/fake-account-store.d.ts.map +1 -1
  1287. package/dist/test/fixtures/fake-account-store.js +2 -2
  1288. package/dist/test/fixtures/fake-account-store.js.map +1 -1
  1289. package/dist/test/fixtures/fake-client-applications-store.d.ts +2 -2
  1290. package/dist/test/fixtures/fake-client-applications-store.d.ts.map +1 -1
  1291. package/dist/test/fixtures/fake-client-applications-store.js +6 -4
  1292. package/dist/test/fixtures/fake-client-applications-store.js.map +1 -1
  1293. package/dist/test/fixtures/fake-client-instance-store.d.ts +1 -1
  1294. package/dist/test/fixtures/fake-client-instance-store.d.ts.map +1 -1
  1295. package/dist/test/fixtures/fake-client-instance-store.js +4 -2
  1296. package/dist/test/fixtures/fake-client-instance-store.js.map +1 -1
  1297. package/dist/test/fixtures/fake-event-store.d.ts +3 -3
  1298. package/dist/test/fixtures/fake-event-store.d.ts.map +1 -1
  1299. package/dist/test/fixtures/fake-event-store.js +3 -3
  1300. package/dist/test/fixtures/fake-event-store.js.map +1 -1
  1301. package/dist/test/fixtures/fake-favorite-features-store.d.ts +5 -5
  1302. package/dist/test/fixtures/fake-favorite-features-store.d.ts.map +1 -1
  1303. package/dist/test/fixtures/fake-favorite-features-store.js +5 -5
  1304. package/dist/test/fixtures/fake-favorite-features-store.js.map +1 -1
  1305. package/dist/test/fixtures/fake-favorite-projects-store.d.ts +5 -5
  1306. package/dist/test/fixtures/fake-favorite-projects-store.d.ts.map +1 -1
  1307. package/dist/test/fixtures/fake-favorite-projects-store.js +5 -5
  1308. package/dist/test/fixtures/fake-favorite-projects-store.js.map +1 -1
  1309. package/dist/test/fixtures/fake-feature-environment-store.d.ts +9 -9
  1310. package/dist/test/fixtures/fake-feature-environment-store.d.ts.map +1 -1
  1311. package/dist/test/fixtures/fake-feature-environment-store.js +19 -19
  1312. package/dist/test/fixtures/fake-feature-environment-store.js.map +1 -1
  1313. package/dist/test/fixtures/fake-feature-tag-store.d.ts +1 -1
  1314. package/dist/test/fixtures/fake-feature-tag-store.d.ts.map +1 -1
  1315. package/dist/test/fixtures/fake-feature-tag-store.js +2 -2
  1316. package/dist/test/fixtures/fake-feature-tag-store.js.map +1 -1
  1317. package/dist/test/fixtures/fake-group-store.d.ts +16 -16
  1318. package/dist/test/fixtures/fake-group-store.d.ts.map +1 -1
  1319. package/dist/test/fixtures/fake-group-store.js +16 -16
  1320. package/dist/test/fixtures/fake-group-store.js.map +1 -1
  1321. package/dist/test/fixtures/fake-pat-store.d.ts +9 -9
  1322. package/dist/test/fixtures/fake-pat-store.d.ts.map +1 -1
  1323. package/dist/test/fixtures/fake-pat-store.js +9 -9
  1324. package/dist/test/fixtures/fake-pat-store.js.map +1 -1
  1325. package/dist/test/fixtures/fake-project-store.d.ts +11 -11
  1326. package/dist/test/fixtures/fake-project-store.d.ts.map +1 -1
  1327. package/dist/test/fixtures/fake-project-store.js +16 -16
  1328. package/dist/test/fixtures/fake-project-store.js.map +1 -1
  1329. package/dist/test/fixtures/fake-public-signup-store.d.ts +2 -2
  1330. package/dist/test/fixtures/fake-public-signup-store.d.ts.map +1 -1
  1331. package/dist/test/fixtures/fake-public-signup-store.js +2 -2
  1332. package/dist/test/fixtures/fake-public-signup-store.js.map +1 -1
  1333. package/dist/test/fixtures/fake-role-store.d.ts +9 -9
  1334. package/dist/test/fixtures/fake-role-store.d.ts.map +1 -1
  1335. package/dist/test/fixtures/fake-role-store.js +9 -9
  1336. package/dist/test/fixtures/fake-role-store.js.map +1 -1
  1337. package/dist/test/fixtures/fake-strategies-store.d.ts.map +1 -1
  1338. package/dist/test/fixtures/fake-strategies-store.js +0 -2
  1339. package/dist/test/fixtures/fake-strategies-store.js.map +1 -1
  1340. package/dist/test/fixtures/fake-tag-store.d.ts.map +1 -1
  1341. package/dist/test/fixtures/fake-tag-store.js +4 -2
  1342. package/dist/test/fixtures/fake-tag-store.js.map +1 -1
  1343. package/dist/test/fixtures/fake-user-feedback-store.d.ts +6 -6
  1344. package/dist/test/fixtures/fake-user-feedback-store.d.ts.map +1 -1
  1345. package/dist/test/fixtures/fake-user-feedback-store.js +6 -6
  1346. package/dist/test/fixtures/fake-user-feedback-store.js.map +1 -1
  1347. package/dist/test/fixtures/fake-user-splash-store.d.ts +6 -6
  1348. package/dist/test/fixtures/fake-user-splash-store.d.ts.map +1 -1
  1349. package/dist/test/fixtures/fake-user-splash-store.js +6 -6
  1350. package/dist/test/fixtures/fake-user-splash-store.js.map +1 -1
  1351. package/dist/test/fixtures/fake-user-store.d.ts +2 -2
  1352. package/dist/test/fixtures/fake-user-store.d.ts.map +1 -1
  1353. package/dist/test/fixtures/fake-user-store.js +2 -2
  1354. package/dist/test/fixtures/fake-user-store.js.map +1 -1
  1355. package/dist/test/fixtures/permissions.js +1 -1
  1356. package/dist/test/fixtures/permissions.js.map +1 -1
  1357. package/frontend/build/index.html +3 -3
  1358. package/frontend/build/static/AdvancedPlayground-B70Djk8B.js +3 -0
  1359. package/frontend/build/static/BackendConnections-mlK6EAYQ.js +1 -0
  1360. package/frontend/build/static/{CreateProject-De6TDUjF.js → CreateProject-Dnggz6io.js} +1 -1
  1361. package/frontend/build/static/EnterpriseEdge-Dnk6MbDj.js +3 -0
  1362. package/frontend/build/static/FeatureMetricsChart-CFEixeGp.js +2 -0
  1363. package/frontend/build/static/FeatureStaleDialog-DZoiwwdR.js +7 -0
  1364. package/frontend/build/static/FeatureViewLazyExport-CUnXEEwm.js +10 -0
  1365. package/frontend/build/static/FlagMetricsChart-ujKp_v58.js +2 -0
  1366. package/frontend/build/static/FrontendNetworkTrafficUsage-Dq8wwaXR.js +1 -0
  1367. package/frontend/build/static/GridLayoutWrapper-Cg_xypvQ.js +3 -0
  1368. package/frontend/build/static/ImpactMetricsPage-ZRSvDBg4.js +1 -0
  1369. package/frontend/build/static/LazyAdminExport-B8GV3V8t.js +38 -0
  1370. package/frontend/build/static/LazyProjectExport-B9SJl4_L.js +728 -0
  1371. package/frontend/build/static/{LifecycleChartComponent-iH7Xwal_.js → LifecycleChartComponent-DulnIgCV.js} +2 -2
  1372. package/frontend/build/static/{LineChartComponent-BnogHewS.js → LineChartComponent-BVdLj0q6.js} +1 -1
  1373. package/frontend/build/static/{MarkCompletedDialogue-BOSV3MHM.js → MarkCompletedDialogue-Cu7y0hRZ.js} +1 -1
  1374. package/frontend/build/static/NetworkOverview-CUmX-taY.js +1 -0
  1375. package/frontend/build/static/{NetworkPrometheusAPIWarning-2jclDnfE.js → NetworkPrometheusAPIWarning-BwnVz0CY.js} +1 -1
  1376. package/frontend/build/static/{NetworkTraffic-DDSLmVgI.js → NetworkTraffic-DCMn8UWo.js} +1 -1
  1377. package/frontend/build/static/NetworkTrafficUsage-DSZK447X.js +1 -0
  1378. package/frontend/build/static/{PercentageDonut-aa1oSbho.js → PercentageDonut-B2OwM0Er.js} +1 -1
  1379. package/frontend/build/static/{ReactJSONEditor-BKB6MheT.js → ReactJSONEditor-BPlzE1Zx.js} +1 -1
  1380. package/frontend/build/static/RoleCell-D5skjCJn.js +1 -0
  1381. package/frontend/build/static/aggregateFeatureMetrics-Bcfo39hn.js +1 -0
  1382. package/frontend/build/static/banner-progression-B6JPzTEE.svg +52 -0
  1383. package/frontend/build/static/docker-HG7DQx-Z.svg +5 -0
  1384. package/frontend/build/static/enterpriseEdgeCloud-DzRtm8v6.svg +58 -0
  1385. package/frontend/build/static/enterpriseEdgeSelfHosted-4bnmOQVF.svg +44 -0
  1386. package/frontend/build/static/{formatTickValue-BCAqKqmg.js → formatTickValue-CqTJlzJZ.js} +2 -2
  1387. package/frontend/build/static/impact-metrics-icon-a6_57VN1.svg +9 -0
  1388. package/frontend/build/static/index-g9pKMnOR.js +542 -0
  1389. package/frontend/build/static/lenovo-DIzNtfrT.svg +3 -0
  1390. package/frontend/build/static/lloyds-DxlC9g3t.svg +10 -0
  1391. package/frontend/build/static/networkTrafficUsageHighlightPlugin-Dmm54dMG.js +1 -0
  1392. package/frontend/build/static/new-feature-badge-FwMmHlwT.svg +7 -0
  1393. package/frontend/build/static/samsung-DOytOsnV.svg +10 -0
  1394. package/frontend/build/static/style-BfdqROT6.css +1 -0
  1395. package/frontend/build/static/{useApiTokens-eXyUbKcO.js → useApiTokens-D1XvAIIA.js} +1 -1
  1396. package/frontend/build/static/visa-CkneNM2O.svg +10 -0
  1397. package/frontend/package.json +2 -2
  1398. package/package.json +49 -54
  1399. package/dist/lib/features/release-plans/release-plan-read-model-type.d.ts +0 -5
  1400. package/dist/lib/features/release-plans/release-plan-read-model-type.d.ts.map +0 -1
  1401. package/dist/lib/features/release-plans/release-plan-read-model-type.js +0 -2
  1402. package/dist/lib/features/release-plans/release-plan-read-model-type.js.map +0 -1
  1403. package/dist/lib/features/release-plans/release-plan-read-model.d.ts +0 -11
  1404. package/dist/lib/features/release-plans/release-plan-read-model.d.ts.map +0 -1
  1405. package/dist/lib/features/release-plans/release-plan-read-model.js +0 -133
  1406. package/dist/lib/features/release-plans/release-plan-read-model.js.map +0 -1
  1407. package/dist/lib/features/release-plans/release-plan-read-model.test.d.ts +0 -2
  1408. package/dist/lib/features/release-plans/release-plan-read-model.test.d.ts.map +0 -1
  1409. package/dist/lib/features/release-plans/release-plan-read-model.test.js +0 -165
  1410. package/dist/lib/features/release-plans/release-plan-read-model.test.js.map +0 -1
  1411. package/dist/test/fixtures/fake/fake-release-plan-read-model.d.ts +0 -8
  1412. package/dist/test/fixtures/fake/fake-release-plan-read-model.d.ts.map +0 -1
  1413. package/dist/test/fixtures/fake/fake-release-plan-read-model.js +0 -9
  1414. package/dist/test/fixtures/fake/fake-release-plan-read-model.js.map +0 -1
  1415. package/frontend/build/static/AdvancedPlayground-BMmRjlFK.js +0 -3
  1416. package/frontend/build/static/BackendConnections-C4TwFekS.js +0 -1
  1417. package/frontend/build/static/FeatureMetricsChart-CQOjOGdB.js +0 -2
  1418. package/frontend/build/static/FeatureStaleDialog-DFBMJIHQ.js +0 -7
  1419. package/frontend/build/static/FeatureViewLazyExport-CUraS5Co.js +0 -10
  1420. package/frontend/build/static/FlagMetricsChart-BqT9hgdO.js +0 -2
  1421. package/frontend/build/static/FrontendNetworkTrafficUsage-BzwFAGbK.js +0 -1
  1422. package/frontend/build/static/GridLayoutWrapper-DY9lNz0U.js +0 -3
  1423. package/frontend/build/static/ImpactMetricsPage-Bqewvmqu.js +0 -1
  1424. package/frontend/build/static/LazyAdminExport-DSSpZhpf.js +0 -38
  1425. package/frontend/build/static/LazyProjectExport-Cd5au6uN.js +0 -728
  1426. package/frontend/build/static/NetworkConnectedEdges-d0ZBRss5.js +0 -1
  1427. package/frontend/build/static/NetworkOverview-DivQ4b83.js +0 -1
  1428. package/frontend/build/static/NetworkTrafficUsage-DYNGGkkm.js +0 -1
  1429. package/frontend/build/static/RoleCell-CkV0Kf4-.js +0 -1
  1430. package/frontend/build/static/aggregateFeatureMetrics-CrQXQAeM.js +0 -1
  1431. package/frontend/build/static/howToApplyReleaseTemplates-CkjJPTRh.png +0 -0
  1432. package/frontend/build/static/howToApplyReleaseTemplatesDark-CfwfIMua.png +0 -0
  1433. package/frontend/build/static/index-B33kIVre.js +0 -542
  1434. package/frontend/build/static/metricsFormatters-C7iN2dDH.js +0 -1
  1435. package/frontend/build/static/networkTrafficUsageHighlightPlugin-o9kHeQ2O.js +0 -1
  1436. package/frontend/build/static/style-BW9ZTER3.css +0 -1
@@ -0,0 +1,38 @@
1
+ import{dI as yo,j as e,dJ as fe,dK as xn,dL as gn,dM as De,aA as se,aB as ne,av as ue,dN as bo,dO as So,dP as Qa,dQ as Xa,dR as Kt,dS as ei,x as vo,dT as ti,s as u,bP as si,f as K,ba as F,br as Ce,r as d,cV as Zt,bI as Ee,dU as Co,dV as Gs,i as V,dW as Pe,A as wo,m as ee,C as T,dX as To,b8 as Qt,b7 as te,dY as ni,dZ as ko,b9 as ce,d_ as Ge,dv as f,d$ as re,e0 as pe,e1 as Xt,u as xe,e2 as nt,R as Y,e3 as oi,e4 as ai,aZ as ze,k as N,aV as X,T as k,e5 as Eo,cm as we,L as oe,B as M,h as kt,dn as Ws,e6 as ot,e7 as ii,cY as at,cZ as _,e8 as zs,aC as Ye,E as it,e9 as rt,ea as Hs,eb as At,ec as Ao,ed as Ro,ee as ri,ef as li,eg as qs,d as Vs,eh as ci,ei as Ys,ej as di,M as Ie,ek as ui,aa as z,ab as ye,ai as ae,ac as hi,ad as pi,ae as Js,af as Et,ag as mi,aw as le,el as je,D as $e,em as xi,bb as gi,F as lt,H as ct,en as et,cJ as es,cf as ts,bn as ss,cK as ns,eo as ji,as as Rt,ep as Q,bq as Do,eq as fi,er as Io,es as Po,et as de,bt as Lo,cg as jn,eu as Bo,ev as Uo,J as Oo,y as Te,aX as $o,aY as _o,a_ as Ss,a$ as Dt,b0 as Ht,b1 as Le,bk as yi,bl as bi,b2 as os,ew as Si,ex as Ks,b6 as fn,ey as Vt,ez as vi,eA as Ci,eB as wi,eC as Ti,eD as ki,eE as vs,n as as,o as Ei,q as Ai,eF as Je,al as ve,an as be,bA as Mo,c_ as is,eG as No,ar as Fo,aj as me,du as Be,eH as Zs,bf as rs,eI as Ri,ax as Ne,I as Ke,dH as Di,v as Ii,eJ as Pi,eK as Li,c7 as tt,eL as Bi,eM as Ui,aO as ls,eN as Qs,ap as Oi,b as It,eO as Me,eP as $i,au as dt,cG as Ue,eQ as _i,eR as Mi,eS as Ni,eT as Fi,da as yn,eU as Go,w as Gi,aq as Xs,eV as Wi,dx as ut,dk as Wo,dl as zo,at as Ho,eW as bn,eX as Oe,eY as st,eZ as Sn,e_ as zi,e$ as Hi,f0 as qo,f1 as qi,f2 as Vo,f3 as Vi,f4 as Yi,d0 as Ji,f5 as Ki,f6 as Zi,f7 as Qi,f8 as Yo,ah as Jo,f9 as Xi,am as Pt,fa as vn,fb as er,fc as Ko,fd as Yt,fe as Zo,ff as tr,d8 as en,fg as sr,fh as Cn,fi as cs,fj as Cs,fk as nr,fl as or,fm as ar,G as Qo,b3 as ir,fn as rr,fo as ds,fp as Xo,fq as lr,fr as cr,fs as dr,ft as ur,fu as hr,fv as pr,fw as mr,dE as xr,dF as gr,fx as jr,cN as ea,fy as ta,K as sa,fz as na,ao as fr,dz as yr,ay as br,dB as wn,fA as oa,fB as aa,fC as Sr,fD as vr,fE as Cr,fF as ia,fG as wr,fH as Tr,fI as kr,fJ as Er,fK as Ar,fL as Rr}from"./index-g9pKMnOR.js";import{u as Dr,C as Ir,A as Pr,a as Lr,R as Br,S as Ur,T as Or,b as $r,c as _r,d as Mr,e as Nr,E as Fr,f as Gr,m as Wr,g as Lt,h as us,i as tn}from"./RoleCell-D5skjCJn.js";import{u as hs}from"./useApiTokens-D1XvAIIA.js";import{P as zr}from"./PercentageDonut-B2OwM0Er.js";const Hr=()=>{const{tokens:t,loading:s,refetch:n}=hs(),{deleteToken:o}=yo(),{headerGroups:a,rows:i,prepareRow:r,state:{globalFilter:l},setGlobalFilter:c,setHiddenColumns:m,columns:h}=Dr(t,p=>{const g=p.row.original.type==="client"?xn:p.row.original.type==="frontend"?gn:De,x=p.row.original.type==="client"?Qa:p.row.original.type==="frontend"?Xa:De;return e.jsxs(Kt,{children:[e.jsx(Lr,{token:p.row.original,permission:g}),e.jsx(Br,{token:p.row.original,permission:x,onRemove:async()=>{await o(p.row.original.secret),n()}})]})});return e.jsx(fe,{permissions:[xn,gn,De],children:e.jsx(se,{header:e.jsx(ne,{title:`API access (${i.length})`,actions:e.jsxs(e.Fragment,{children:[e.jsx(ue,{initialValue:l,onChange:c}),e.jsx(ne.Divider,{}),e.jsx(Ir,{permission:[bo,So,De],path:"/admin/api/create-token"})]})}),children:e.jsx(Pr,{loading:s,headerGroups:a,setHiddenColumns:m,prepareRow:r,rows:i,columns:h,globalFilter:l})})})},qr=({type:t,projects:s,setProjects:n,errors:o,clearErrors:a})=>{const i=ei("projectId"),{projects:r}=vo(),l=r.map(c=>({value:c.id,label:c.name}));return i?null:e.jsxs(e.Fragment,{children:[e.jsx(Ur,{children:"Which project do you want to give access to?"}),e.jsx(ti,{disabled:t===Or.ADMIN,options:l,defaultValue:s,onChange:n,error:o==null?void 0:o.projects,onFocus:()=>a("projects")})]})},Tn="Create API token",Vr=u(si)(({theme:t})=>({margin:t.spacing(2,0,4)})),Yr=()=>{const{tokens:t,loading:s}=hs(),{uiConfig:n,loading:o}=F(),a=n.resourceLimits.apiTokens;return{limit:a,currentValue:t.length,limitReached:t.length>=a,loading:o||s}},Jr=({modal:t=!1})=>{const{setToastApiError:s}=K(),{uiConfig:n}=F(),o=Ce(),[a,i]=d.useState(!1),[r,l]=d.useState(""),{limit:c,currentValue:m,limitReached:h,loading:p}=Yr(),{getApiTokenPayload:g,tokenName:x,type:j,projects:b,environment:y,setTokenName:C,setTokenType:A,setProjects:v,setEnvironment:R,isValid:S,errors:L,clearErrors:B,apiTokenTypes:w}=$r(),{createToken:H,loading:P}=yo(),{refetch:O}=hs();Zt(Tn);const E="api/admin/api-tokens",D=async U=>{if(U.preventDefault(),!!S())try{const $=g();await H($).then(W=>W.json()).then(W=>{Gs(),l(W.secret),i(!0),O()})}catch($){s(V($))}},I=()=>{i(!1),o(Pe)},G=()=>`curl --location --request POST '${n.unleashUrl}/${E}' \\
2
+ --header 'Authorization: INSERT_API_KEY' \\
3
+ --header 'Content-Type: application/json' \\
4
+ --data-raw '${JSON.stringify(g(),void 0,2)}'`,Z=()=>{o(Pe)};return e.jsxs(Ee,{loading:P,title:Tn,modal:t,description:"Unleash SDKs use API tokens to authenticate with the Unleash API. An SDK must be configured with a token of the corresponding type, so they can fetch feature flags and post usage metrics.",documentationLink:"https://docs.getunleash.io/concepts/api-tokens-and-client-keys",documentationLinkLabel:"API tokens documentation",formatApiCode:G,children:[e.jsxs(_r,{handleSubmit:D,handleCancel:Z,mode:"Create",actions:e.jsx(Co,{name:"token",permission:[De,So,bo],disabled:h||p||P}),children:[e.jsx(Mr,{tokenName:x,setTokenName:C,errors:L,clearErrors:B}),e.jsx(Nr,{type:j,setType:A,apiTokenTypes:w}),e.jsx(qr,{type:j,projects:b,setProjects:v,errors:L,clearErrors:B}),e.jsx(Fr,{type:j,environment:y,setEnvironment:R}),e.jsx(Vr,{name:"API tokens",shortName:"tokens",currentValue:m,limit:c})]}),e.jsx(Gr,{open:a,setOpen:i,closeConfirm:I,token:r,type:j})]})},Kr=u("div")(({theme:t})=>({display:"flex",flexDirection:"column","& > span:last-of-type":{fontSize:t.fontSizes.smallerBody,color:t.palette.text.secondary}})),ps=({roles:t,value:s,setValue:n,required:o,hideDescription:a,...i})=>{const r=(l,c)=>e.jsx("li",{...l,children:e.jsxs(Kr,{children:[e.jsx("span",{children:c.name}),e.jsx("span",{children:c.description})]})});return e.jsxs(e.Fragment,{children:[e.jsx(wo,{openOnFocus:!0,size:"small",value:s,onChange:(l,c)=>n(c||null),options:t,renderOption:r,getOptionLabel:l=>l.name,renderInput:l=>e.jsx(ee,{...l,label:"Role",required:o}),...i}),e.jsx(T,{condition:!!s&&!a,show:()=>e.jsx(To,{sx:{marginTop:1},roleId:s.id})})]})},Bt=()=>{const{isEnterprise:t}=F(),{data:s,error:n,mutate:o}=Qt(t(),{roles:[],projectRoles:[]},te("api/admin/roles"),Zr);return d.useMemo(()=>({roles:(s==null?void 0:s.roles.filter(({type:a})=>ni.includes(a)).sort(kn))??[],projectRoles:(s==null?void 0:s.roles.filter(({type:a})=>ko.includes(a)).sort(kn))??[],loading:!n&&!s,refetch:()=>o(),error:n}),[s,n,o])},Zr=t=>fetch(t).then(ce("Roles")).then(s=>s.json()),kn=(t,s)=>Ge.includes(t.type)&&!Ge.includes(s.type)?-1:!Ge.includes(t.type)&&Ge.includes(s.type)?1:t.name.localeCompare(s.name),ra=({data:t={enabled:!1,autoCreate:!1},setValue:s,onUpdateRole:n,disabled:o=!1})=>{const{roles:a}=Bt(),i=()=>{s("autoCreate",!t.autoCreate)},r=c=>{s(c.target.name,c.target.value)},l=({defaultRootRole:c,defaultRootRoleId:m})=>m?a.find(({id:h})=>h===m)||null:a.find(({name:h})=>h===c)||null;return e.jsxs(d.Fragment,{children:[e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Auto-create users"}),e.jsx("p",{children:"Enable automatic creation of new users when signing in."})]}),e.jsx(f,{item:!0,md:6,style:{padding:"20px"},children:e.jsx(re,{control:e.jsx(pe,{onChange:i,name:"enabled",checked:t.autoCreate,disabled:!t.enabled||o}),label:"Auto-create users"})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Default Root Role"}),e.jsx("p",{children:"Choose which root role the user should get when no explicit role mapping exists."})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(Xt,{style:{width:"400px"},children:e.jsx(ps,{roles:a,value:l(t),setValue:n,disabled:!t.autoCreate||!t.enabled||o,required:!0,hideDescription:!0})})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Email domains"}),e.jsx("p",{children:"Comma separated list of email domains that should be allowed to sign in."})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:r,label:"Email domains",name:"emailDomains",disabled:!t.autoCreate||!t.enabled||o,required:!!t.autoCreate,value:t.emailDomains||"",placeholder:"@company.com, @anotherCompany.com",style:{width:"400px"},rows:2,variant:"outlined",size:"small"})})]})]})},Qr=async(t,s)=>{var n,o;if(t){if(s){const a=await s.json(),i=((o=(n=a.details)==null?void 0:n[0])==null?void 0:o.message)??a.message;throw t({message:i}),new Error(i)}throw new Error}},ms=t=>{const{makeRequest:s,createRequest:n,errors:o,loading:a}=xe({propagateErrors:!0,handleBadRequest:Qr});return{updateSettings:async r=>{const l=`api/admin/auth/${t}/settings`,c=n(l,{method:"POST",body:JSON.stringify(r)});await s(c.caller,c.id)},errors:o,loading:a}},sn=t=>{const n=Object.entries(t).filter(([,o])=>o!=="");return Object.fromEntries(n)},la=({ssoType:t,data:s={enabled:!1,enableGroupSyncing:!1,groupJsonPath:"",addGroupsScope:!1},setValue:n,disabled:o=!1})=>{const a=()=>{n("enableGroupSyncing",!s.enableGroupSyncing)},i=l=>{n(l.target.name,l.target.value)},r=()=>{n("addGroupsScope",!s.addGroupsScope)};return e.jsxs(e.Fragment,{children:[e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Enable Group Syncing"}),e.jsxs("p",{children:["Enables automatically syncing of users from the"," ",t," provider when a user logs in."]})]}),e.jsx(f,{item:!0,md:6,style:{padding:"20px"},children:e.jsx(re,{control:e.jsx(pe,{onChange:a,value:s.enableGroupSyncing,name:"enableGroupSyncing",checked:s.enableGroupSyncing,disabled:!s.enabled||o}),label:s.enableGroupSyncing?"Enabled":"Disabled"})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Group Field JSON Path"}),e.jsxs("p",{children:["Specifies the path in the ",t," token response from which to read the groups the user belongs to."]})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:i,label:"Group JSON Path",name:"groupJsonPath",value:s.groupJsonPath,disabled:!s.enableGroupSyncing||o,style:{width:"400px"},variant:"outlined",size:"small",required:!0})})]}),e.jsx(T,{condition:t==="OIDC",show:e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Request 'groups' Scope"}),e.jsx("p",{children:"When enabled Unleash will also request the 'groups' scope as part of the login request."})]}),e.jsx(f,{item:!0,md:6,style:{padding:"20px"},children:e.jsx(re,{control:e.jsx(pe,{onChange:r,value:s.addGroupsScope,disabled:!s.enableGroupSyncing||o,name:"addGroupsScope",checked:s.addGroupsScope}),label:s.addGroupsScope?"Enabled":"Disabled"})})]})})]})},Xr={enabled:!1,enableSingleSignOut:!1,addGroupsScope:!1,enableGroupSyncing:!1,autoCreate:!1,unleashHostname:location.hostname,groupJsonPath:"",clientId:"",discoverUrl:"",secret:"",acrValues:"",idTokenSigningAlgorithm:"RS256",enablePkce:!1},el=()=>{var A;const{setToastData:t,setToastApiError:s}=K(),{uiConfig:n}=F(),{oidcConfiguredThroughEnv:o}=n,a=!!((A=n.flags)!=null&&A.oidcPkceSupport),[i,r]=d.useState(Xr),{config:l}=nt("oidc"),{updateSettings:c,errors:m,loading:h}=ms("oidc");d.useEffect(()=>{l.discoverUrl&&r(l)},[l]);const p=v=>{b(v.target.name,v.target.value)},g=v=>{b(v.target.name,v.target.value.trim())},x=()=>{r({...i,enabled:!i.enabled})},j=()=>{r({...i,enableSingleSignOut:!i.enableSingleSignOut})},b=(v,R)=>{r({...i,[v]:R})},y=v=>{r({...i,defaultRootRole:void 0,defaultRootRoleId:v==null?void 0:v.id})},C=async v=>{v.preventDefault();try{await c(sn(i)),t({text:"Settings stored",type:"success"})}catch(R){s(V(R))}};return e.jsxs(e.Fragment,{children:[e.jsx(f,{container:!0,sx:{mb:3},children:e.jsxs(f,{item:!0,md:12,children:[e.jsx(T,{condition:!!o,show:e.jsxs(Y,{sx:{mb:2},severity:"warning",children:["OIDC is currently configured via environment variables. Please refer to the"," ",e.jsx("a",{href:"https://www.unleash-hosted.com/docs/enterprise-authentication",target:"_blank",rel:"noreferrer",children:"documentation"})," ","for detailed instructions on how to set up OIDC using these variables."]})}),e.jsxs(Y,{severity:"info",children:["Please read the"," ",e.jsx("a",{href:"https://www.unleash-hosted.com/docs/enterprise-authentication",target:"_blank",rel:"noreferrer",children:"documentation"})," ","to learn how to integrate with specific OpenID Connect providers (such as Okta and Keycloak). ",e.jsx("br",{}),"Callback URL:"," ",e.jsxs("code",{children:[n.unleashUrl,"/auth/oidc/callback"]})]})]})}),e.jsxs("form",{onSubmit:C,children:[e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Enable"}),e.jsx("p",{children:"Enable Open Id Connect Authentication."})]}),e.jsx(f,{item:!0,md:6,style:{padding:"20px"},children:e.jsx(re,{control:e.jsx(pe,{onChange:x,value:i.enabled,name:"enabled",checked:i.enabled}),label:i.enabled?"Enabled":"Disabled",disabled:o})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Discover URL"}),e.jsx("p",{children:"(Required) Issuer discover metadata URL"})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:g,label:"Discover URL",name:"discoverUrl",value:i.discoverUrl,disabled:!i.enabled||o,style:{width:"400px"},variant:"outlined",size:"small"})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Client ID"}),e.jsx("p",{children:"(Required) Client ID of your OpenID application"})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:g,label:"Client ID",name:"clientId",value:i.clientId,disabled:!i.enabled||o,style:{width:"400px"},variant:"outlined",size:"small",required:!0})})]}),e.jsxs(f,{container:!0,spacing:3,mb:4,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Client secret"}),e.jsxs("p",{children:["(Required) Client secret of your OpenID application."," "]})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:g,label:"Client Secret",name:"secret",value:i.secret,disabled:!i.enabled||o,style:{width:"400px"},variant:"outlined",size:"small",required:!0})})]}),e.jsx("h3",{children:"Optional Configuration"}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Enable Single Sign-Out"}),e.jsx("p",{children:"If you enable Single Sign-Out Unleash will redirect the user to the IDP as part of the Sign-out process."})]}),e.jsx(f,{item:!0,md:6,style:{padding:"20px"},children:e.jsx(re,{control:e.jsx(pe,{onChange:j,value:i.enableSingleSignOut,disabled:!i.enabled||o,name:"enableSingleSignOut",checked:i.enableSingleSignOut}),label:i.enableSingleSignOut?"Enabled":"Disabled"})})]}),e.jsx(T,{condition:a,show:e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Enable PKCE"}),e.jsx("p",{children:"Require Proof Key for Code Exchange (PKCE) to add an extra layer of security for the authorization code flow."})]}),e.jsx(f,{item:!0,md:6,style:{padding:"20px"},children:e.jsx(re,{control:e.jsx(pe,{onChange:v=>b("enablePkce",v.target.checked),name:"enablePkce",checked:!!i.enablePkce,disabled:!i.enabled||o}),label:i.enablePkce?"Enabled":"Disabled"})})]})}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"ACR Values"}),e.jsx("p",{children:'Requested Authentication Context Class Reference values. If multiple values are specified they should be "space" separated. Will be sent as "acr_values" as part of the authentication request. Unleash will validate the acr value in the id token claims against the list of acr values.'})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:p,label:"ACR Values",name:"acrValues",value:i.acrValues,disabled:!i.enabled||o,style:{width:"400px"},variant:"outlined",size:"small"})})]}),e.jsx(la,{ssoType:"OIDC",data:i,setValue:b,disabled:o}),e.jsx(ra,{data:i,setValue:b,onUpdateRole:y,disabled:o}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"ID Signing algorithm"}),e.jsxs("p",{children:["Which signing algorithm to use. ",e.jsx("br",{}),' Leave this alone unless you see errors that look like "unexpected JWT alg received, expected RS256, got: RS512" in your logs.']})]}),e.jsx(f,{item:!0,md:6,children:e.jsxs(Xt,{style:{minWidth:"200px"},children:[e.jsx(oi,{id:"defaultRootRole-label",children:"Signing algorithm"}),e.jsxs(ai,{label:"Signing algorithm",labelId:"idTokenSigningAlgorithm-label",id:"idTokenSigningAlgorithm",name:"idTokenSigningAlgorithm",value:i.idTokenSigningAlgorithm||"RS256",onChange:v=>b("idTokenSigningAlgorithm",v.target.value),disabled:o,children:[e.jsx(ze,{value:"RS256",children:"RS256"}),e.jsx(ze,{value:"RS384",children:"RS384"}),e.jsx(ze,{value:"RS512",children:"RS512"})]})]})})]}),e.jsx(f,{container:!0,spacing:3,children:e.jsxs(f,{item:!0,md:12,children:[e.jsx(N,{variant:"contained",color:"primary",type:"submit",disabled:h||o,children:"Save"})," ",e.jsx("p",{children:e.jsx("small",{style:{color:"red"},children:m==null?void 0:m.message})})]})})]})]})},tl={enabled:!1,autoCreate:!1,enableGroupSyncing:!1,addGroupsScope:!1,unleashHostname:location.hostname,entityId:"",signOnUrl:"",certificate:"",signOutUrl:"",spCertificate:"",groupJsonPath:""},sl=()=>{const{setToastData:t,setToastApiError:s}=K(),{uiConfig:n}=F(),{samlConfiguredThroughEnv:o}=n,[a,i]=d.useState(tl),{config:r}=nt("saml"),{updateSettings:l,errors:c,loading:m}=ms("saml");d.useEffect(()=>{r.entityId&&i(r)},[r]);const h=y=>{x(y.target.name,y.target.value)},p=y=>{x(y.target.name,y.target.value.trim())},g=()=>{i({...a,enabled:!a.enabled})},x=(y,C)=>{i({...a,[y]:C})},j=y=>{i({...a,defaultRootRole:void 0,defaultRootRoleId:y==null?void 0:y.id})},b=async y=>{y.preventDefault();try{await l(sn(a)),t({text:"Settings stored",type:"success"})}catch(C){s(V(C))}};return e.jsxs(e.Fragment,{children:[e.jsx(f,{container:!0,sx:{mb:3},children:e.jsxs(f,{item:!0,md:12,children:[e.jsx(T,{condition:!!o,show:e.jsxs(Y,{sx:{mb:2},severity:"warning",children:["SAML is currently configured via environment variables. Please refer to the"," ",e.jsx("a",{href:"https://www.unleash-hosted.com/docs/enterprise-authentication",target:"_blank",rel:"noreferrer",children:"documentation"})," ","for detailed instructions on how to set up SAML using these variables."]})}),e.jsxs(Y,{severity:"info",children:["Please read the"," ",e.jsx("a",{href:"https://www.unleash-hosted.com/docs/enterprise-authentication",target:"_blank",rel:"noreferrer",children:"documentation"})," ","to learn how to integrate with specific SAML 2.0 providers (such as Okta, Keycloak, and Microsoft Entra ID). ",e.jsx("br",{}),"Callback URL:"," ",e.jsxs("code",{children:[n.unleashUrl,"/auth/saml/callback"]})]})]})}),e.jsxs("form",{onSubmit:b,children:[e.jsxs(f,{container:!0,spacing:3,children:[e.jsxs(f,{item:!0,md:5,mb:2,children:[e.jsx("strong",{children:"Enable"}),e.jsx("p",{children:"Enable SAML 2.0 Authentication."})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(re,{control:e.jsx(pe,{onChange:g,value:a.enabled,name:"enabled",checked:a.enabled,disabled:o}),label:a.enabled?"Enabled":"Disabled"})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Entity ID"}),e.jsx("p",{children:"(Required) The Entity Identity provider issuer."})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:p,label:"Entity ID",name:"entityId",value:a.entityId,disabled:!a.enabled||o,style:{width:"400px"},variant:"outlined",size:"small",required:!0})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Single Sign-On URL"}),e.jsx("p",{children:"(Required) The url to redirect the user to for signing in."})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:p,label:"Single Sign-On URL",name:"signOnUrl",value:a.signOnUrl,disabled:!a.enabled||o,style:{width:"400px"},variant:"outlined",size:"small",required:!0})})]}),e.jsxs(f,{container:!0,spacing:3,mb:4,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"X.509 Certificate"}),e.jsx("p",{children:"(Required) The certificate used to sign the SAML 2.0 request."})]}),e.jsx(f,{item:!0,md:7,children:e.jsx(ee,{onChange:h,label:"X.509 Certificate",name:"certificate",value:a.certificate,disabled:!a.enabled||o,style:{width:"100%"},InputProps:{style:{fontSize:"0.6em",fontFamily:"monospace"}},multiline:!0,rows:14,maxRows:14,variant:"outlined",size:"small",required:!0})})]}),e.jsx("h3",{children:"Optional Configuration"}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Single Sign-out URL"}),e.jsx("p",{children:"(Optional) The url to redirect the user to for signing out of the IDP."})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:p,label:"Single Sign-out URL",name:"signOutUrl",value:a.signOutUrl,disabled:!a.enabled||o,style:{width:"400px"},variant:"outlined",size:"small"})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Service Provider X.509 Certificate"}),e.jsx("p",{children:"(Optional) The private certificate used by the Service Provider used to sign the SAML 2.0 request towards the IDP. E.g. used to sign single logout requests (SLO)."})]}),e.jsx(f,{item:!0,md:7,children:e.jsx(ee,{onChange:h,label:"X.509 Certificate",name:"spCertificate",value:a.spCertificate,disabled:!a.enabled||o,style:{width:"100%"},InputProps:{style:{fontSize:"0.6em",fontFamily:"monospace"}},multiline:!0,rows:14,maxRows:14,variant:"outlined",size:"small"})})]}),e.jsx(la,{ssoType:"SAML",data:a,setValue:x,disabled:o}),e.jsx(ra,{data:a,setValue:x,onUpdateRole:j,disabled:o}),e.jsx(f,{container:!0,spacing:3,children:e.jsxs(f,{item:!0,md:5,children:[e.jsx(N,{variant:"contained",color:"primary",type:"submit",disabled:m||o,children:"Save"})," ",e.jsx("p",{children:e.jsx("small",{style:{color:"red"},children:c==null?void 0:c.message})})]})})]})]})},nl=u(Y)(({theme:t})=>({marginBottom:t.spacing(3)})),ol=({open:t,setOpen:s,onConfirm:n})=>e.jsx(X,{open:t,secondaryButtonText:"Close",onClose:(o,a)=>{a||s(!1)},primaryButtonText:"Generate new token",onClick:n,title:"Generate new SCIM API token?",children:e.jsxs(nl,{severity:"error",children:["Generating a new token will ",e.jsx("strong",{children:"immediately revoke"})," the current one, which may break any existing provision integrations currently using it."]})}),al=u(Y)(({theme:t})=>({marginBottom:t.spacing(3)})),il=({open:t,setOpen:s,token:n})=>e.jsxs(X,{open:t,secondaryButtonText:"Close",onClose:(o,a)=>{a||s(!1)},title:"SCIM API token created",children:[e.jsx(al,{severity:"info",children:"Make sure to copy your SCIM API token now. You won't be able to see it again!"}),e.jsx(k,{variant:"body1",children:"Your token:"}),e.jsx(Eo,{token:n||""})]}),En="api/admin/scim-settings",rl=()=>{const{loading:t,makeRequest:s,createRequest:n,errors:o}=xe({propagateErrors:!0});return{saveSettings:async r=>{const c=n(En,{method:"POST",body:JSON.stringify(r)},"saveSettings");await s(c.caller,c.id)},generateNewToken:async()=>{const l=n(`${En}/generate-new-token`,{method:"POST"},"generateNewToken"),c=await s(l.caller,l.id),{token:m}=await c.json();return m},errors:o,loading:t}},ll="api/admin/scim-settings",An={enabled:!1,hasToken:!1},Ut=()=>{const{isEnterprise:t}=F(),{data:s,error:n,mutate:o}=Qt(t(),An,te(ll),cl);return d.useMemo(()=>({settings:s??An,loading:!n&&!s,refetch:()=>o(),error:n}),[s,n,o])},cl=t=>fetch(t).then(ce("SCIM settings")).then(s=>s.json());u(Y)(({theme:t})=>({marginBottom:t.spacing(3)}));const Rn=({open:t,closeDialog:s,deleteEntities:n,entityType:o})=>e.jsx(X,{open:t,primaryButtonText:`Delete SCIM ${o}`,secondaryButtonText:"Cancel",title:`Do you really want to delete ALL SCIM ${o}?`,onClose:s,onClick:n,children:e.jsxs(k,{variant:"body1",children:["This will delete all ",o.toLocaleLowerCase()," created or managed by SCIM."]})}),Jt="removeUser",Ze=()=>{const{loading:t,makeRequest:s,createRequest:n,errors:o}=xe({propagateErrors:!0});return{addUser:async p=>{const x=n("api/admin/user-admin",{method:"POST",body:JSON.stringify(p)},"addUser");return s(x.caller,x.id)},updateUser:async p=>{const x=n(`api/admin/user-admin/${p.id}`,{method:"PUT",body:JSON.stringify(p)},"updateUser");return s(x.caller,x.id)},removeUser:async p=>{const x=n(`api/admin/user-admin/${p}`,{method:"DELETE"},"removeUser");return s(x.caller,x.id)},changePassword:async(p,g)=>{const j=n(`api/admin/user-admin/${p}/change-password`,{method:"POST",body:JSON.stringify({password:g})},"changePassword");return s(j.caller,j.id)},validatePassword:async p=>{const x=n("api/admin/user-admin/validate-password",{method:"POST",body:JSON.stringify({password:p})},"validatePassword");return s(x.caller,x.id)},resetPassword:async p=>{const x=n("api/admin/user-admin/reset-password",{method:"POST",body:JSON.stringify({id:p})},"resetPassword");return s(x.caller,x.id)},deleteScimUsers:async()=>{const g=n("api/admin/user-admin/scim-users",{method:"DELETE"},"deleteScimUsers");return s(g.caller,g.id)},userApiErrors:o,userLoading:t}},ht=()=>{const{makeRequest:t,createRequest:s,errors:n,loading:o}=xe({propagateErrors:!0});return{createGroup:async c=>{const h=s("api/admin/groups",{method:"POST",body:JSON.stringify(c)});return(await t(h.caller,h.id)).json()},updateGroup:async(c,m)=>{const h=`api/admin/groups/${c}`,p=s(h,{method:"PUT",body:JSON.stringify(m)});await t(p.caller,p.id)},removeGroup:async c=>{const m=`api/admin/groups/${c}`,h=s(m,{method:"DELETE"});await t(h.caller,h.id)},deleteScimGroups:async()=>{const m=s("api/admin/groups/scim-groups",{method:"DELETE"});await t(m.caller,m.id)},errors:n,loading:o}},dl=u("div")(({theme:t})=>({padding:t.spacing(3),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadiusLarge})),ws=u("div")(({theme:t})=>({marginBottom:t.spacing(1)})),ul=()=>{const{uiConfig:t}=F(),{setToastData:s,setToastApiError:n}=K(),[o,a]=d.useState(""),[i,r]=d.useState(!1),[l,c]=d.useState(!1),[m,h]=d.useState(!1),[p,g]=d.useState(!1),{settings:x,refetch:j}=Ut(),{deleteScimUsers:b}=Ze(),{deleteScimGroups:y}=ht(),[C,A]=d.useState(x.enabled??!0);d.useEffect(()=>{A(x.enabled??!1)},[x]);const{saveSettings:v,generateNewToken:R,errors:S,loading:L}=rl(),B=async()=>{r(!0)},w=async()=>{try{await y(),s({text:"Scim Groups have been deleted",type:"success"}),c(!1),j()}catch(E){n(V(E))}},H=async()=>{try{await b(),s({text:"Scim Users have been deleted",type:"success"}),h(!1),j()}catch(E){n(V(E))}},P=async()=>{r(!1);const E=await R();a(E),g(!0)},O=async E=>{try{if(A(E),await v({enabled:E}),E&&!x.hasToken){const D=await R();a(D),g(!0)}s({text:"Settings stored",type:"success"}),await j()}catch(D){n(V(D))}};return e.jsxs(e.Fragment,{children:[e.jsx(f,{container:!0,sx:{mb:3},children:e.jsx(f,{item:!0,md:12,children:e.jsxs(Y,{severity:"info",children:["Please read the"," ",e.jsx("a",{href:"https://docs.getunleash.io/concepts/scim",target:"_blank",rel:"noreferrer",children:"documentation"})," ","to learn how to integrate with specific SCIM clients (Microsoft Entra, Okta, etc). ",e.jsx("br",{}),"SCIM API URL: ",e.jsxs("code",{children:[t.unleashUrl,"/scim"]})]})})}),e.jsxs(dl,{children:[e.jsxs(f,{container:!0,spacing:3,children:[e.jsxs(f,{item:!0,md:10.5,mb:2,children:[e.jsx(ws,{children:e.jsx("strong",{children:"SCIM provisioning"})}),e.jsx("p",{children:"Enables SCIM provisioning. If SCIM provisioning has not previously been enabled here this will also set up a new auth token to use with your SCIM client, and display it to the user. After the dialog has been closed, this token will not be displayed again. If you need a new token you can click the Generate new token button below which will replace the old token with a new token, and similarly display the new token one time to the user."})]}),e.jsx(f,{item:!0,md:1.5,children:e.jsx(re,{control:e.jsx(pe,{onChange:(E,D)=>{O(D)},value:C,name:"enabled",checked:C}),label:C?"Enabled":"Disabled"})})]}),e.jsx(f,{container:!0,spacing:3,children:e.jsx(f,{item:!0,md:5,mb:2,children:e.jsx(T,{condition:!!x.hasToken,show:e.jsx(N,{variant:"outlined",color:"error",disabled:L,onClick:B,children:"Generate new token"})})})}),e.jsxs(f,{container:!0,spacing:3,children:[e.jsxs(f,{item:!0,md:10.5,mb:2,children:[e.jsx(ws,{children:e.jsx("strong",{children:"Delete SCIM Users"})}),e.jsx("p",{children:"This will remove all SCIM users from the Unleash database. This action cannot be undone through Unleash but the upstream SCIM provider may re sync these users."})]}),e.jsx(f,{item:!0,md:1.5,children:e.jsx(N,{variant:"outlined",color:"error",disabled:L,onClick:()=>{h(!0)},children:"Delete Users"})}),e.jsxs(f,{item:!0,md:10.5,mb:2,children:[e.jsx(ws,{children:e.jsx("strong",{children:"Delete SCIM Groups"})}),e.jsx("p",{children:"This will remove all SCIM groups from the Unleash database. This action cannot be undone through Unleash but the upstream SCIM provider may re sync these groups. Note that this may affect the permissions of users present in those groups."})]}),e.jsx(f,{item:!0,md:1.5,children:e.jsx(N,{variant:"outlined",color:"error",disabled:L,onClick:()=>{c(!0)},children:"Delete Groups"})})]}),e.jsx(ol,{open:i,setOpen:r,onConfirm:P}),e.jsx(il,{open:p,setOpen:g,token:o}),e.jsx(Rn,{open:m,closeDialog:()=>h(!1),deleteEntities:H,entityType:"Users"}),e.jsx(Rn,{open:l,closeDialog:()=>c(!1),deleteEntities:w,entityType:"Groups"})]})]})},hl=()=>{const{data:t,error:s,mutate:n}=we(te("api/admin/user-admin/admin-count"),pl);return{data:t,loading:!s&&!t,refetch:()=>n(),error:s}},pl=t=>fetch(t).then(ce("Admin count")).then(s=>s.json()),ml=({open:t,setOpen:s,onClick:n,adminCount:o,tokens:a})=>e.jsxs(X,{open:t,onClose:()=>{s(!1)},onClick:n,title:"Disable password based login?",primaryButtonText:"Disable password based login",secondaryButtonText:"Cancel",children:[e.jsxs(Y,{severity:"warning",children:[e.jsx("strong",{children:"Warning!"})," Disabling password based login may lock you out of the system permanently if you do not have any alternative admin credentials (such as an admin SSO account or admin API token) secured beforehand.",e.jsx("br",{}),e.jsx("br",{}),e.jsx("strong",{children:"Password based administrators: "})," ",o==null?void 0:o.password,e.jsx("br",{}),e.jsx("strong",{children:"Other administrators: "})," ",o==null?void 0:o.noPassword,e.jsx("br",{}),e.jsx("strong",{children:"Admin service accounts: "})," ",o==null?void 0:o.service,e.jsx("br",{}),e.jsx("strong",{children:"Admin API tokens: "})," ",a.filter(({type:i})=>i==="admin").length]}),e.jsx(k,{sx:{mt:3},children:"You are about to disable password based login. Are you sure you want to proceed?"})]}),xl=()=>{const{setToastData:t,setToastApiError:s}=K(),{config:n,refetch:o}=nt("simple"),[a,i]=d.useState(!1),{updateSettings:r,errors:l,loading:c}=ms("simple"),[m,h]=d.useState(!1),{data:p}=hl(),{tokens:g}=hs();d.useEffect(()=>{i(!!n.disabled)},[n.disabled]);const x=()=>{i(!a)},j=async y=>{y.preventDefault(),!n.disabled&&a?h(!0):b()},b=async()=>{try{await r({disabled:a}),o(),t({text:"Password authentication settings stored",autoHideDuration:4e3,type:"success",show:!0})}catch(y){s(V(y)),i(n.disabled)}};return e.jsx(e.Fragment,{children:e.jsxs("form",{onSubmit:j,children:[e.jsxs(Y,{severity:"info",sx:{mb:3},children:["Overview of administrators on your Unleash instance:",e.jsx("br",{}),e.jsx("br",{}),e.jsx("strong",{children:"Password based administrators: "})," ",e.jsx(oe,{to:"/admin/users",children:p==null?void 0:p.password}),e.jsx("br",{}),e.jsx("strong",{children:"Other administrators: "})," ",e.jsx(oe,{to:"/admin/users",children:p==null?void 0:p.noPassword}),e.jsx("br",{}),e.jsx("strong",{children:"Admin service accounts: "})," ",e.jsx(oe,{to:"/admin/service-accounts",children:p==null?void 0:p.service}),e.jsx("br",{}),e.jsx("strong",{children:"Admin API tokens: "})," ",e.jsx(oe,{to:"/admin/api",children:g.filter(({type:y})=>y==="admin").length})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Password based login"}),e.jsx("p",{children:"Allow users to login with username & password"})]}),e.jsx(f,{item:!0,md:6,style:{padding:"20px"},children:e.jsx(re,{control:e.jsx(pe,{onChange:x,value:!a,name:"disabled",checked:!a}),label:a?"Disabled":"Enabled"})})]}),e.jsx(f,{container:!0,spacing:3,children:e.jsxs(f,{item:!0,md:12,children:[e.jsx(N,{variant:"contained",color:"primary",type:"submit",disabled:c,children:"Save"})," ",e.jsx("p",{children:e.jsx("small",{style:{color:"red"},children:l==null?void 0:l.message})})]})}),e.jsx(ml,{open:m,setOpen:h,onClick:()=>{h(!1),b()},adminCount:p,tokens:g})]})})},gl={enabled:!1,autoCreate:!1,unleashHostname:location.hostname,clientId:"",clientSecret:"",emailDomains:""},jl=()=>{const{setToastData:t,setToastApiError:s}=K(),{uiConfig:n}=F(),[o,a]=d.useState(gl),{config:i}=nt("google"),{updateSettings:r,errors:l,loading:c}=ms("google");d.useEffect(()=>{i.clientId&&a(i)},[i]);const m=x=>{a({...o,[x.target.name]:x.target.value})},h=()=>{a({...o,enabled:!o.enabled})},p=()=>{a({...o,autoCreate:!o.autoCreate})},g=async x=>{x.preventDefault();try{await r(sn(o)),t({text:"Settings stored",type:"success"})}catch(j){s(V(j))}};return e.jsxs(e.Fragment,{children:[e.jsxs(M,{children:[e.jsxs(Y,{severity:"error",sx:{mb:2},children:["This integration is deprecated and will be removed in next major version. Please use ",e.jsx("strong",{children:"OpenID Connect"})," to enable Google SSO."]}),e.jsxs(Y,{severity:"info",sx:{mb:3},children:["Read the"," ",e.jsx("a",{href:"https://www.unleash-hosted.com/docs/enterprise-authentication/google",target:"_blank",rel:"noreferrer",children:"documentation"})," ","to learn how to integrate with Google OAuth 2.0. ",e.jsx("br",{}),"Callback URL:"," ",e.jsxs("code",{children:[n.unleashUrl,"/auth/google/callback"]})]})]}),e.jsxs("form",{onSubmit:g,children:[e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,xs:5,children:[e.jsx("strong",{children:"Enable"}),e.jsx("p",{children:"Enable Google users to login. Value is ignored if Client ID and Client Secret are not defined."})]}),e.jsx(f,{item:!0,xs:6,style:{padding:"20px"},children:e.jsx(re,{control:e.jsx(pe,{onChange:h,value:o.enabled,name:"enabled",checked:o.enabled}),label:o.enabled?"Enabled":"Disabled"})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,xs:5,children:[e.jsx("strong",{children:"Client ID"}),e.jsx("p",{children:"(Required) The Client ID provided by Google when registering the application."})]}),e.jsx(f,{item:!0,xs:6,children:e.jsx(ee,{onChange:m,label:"Client ID",name:"clientId",placeholder:"",value:o.clientId,style:{width:"400px"},variant:"outlined",size:"small",required:!0})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Client Secret"}),e.jsx("p",{children:"(Required) Client Secret provided by Google when registering the application."})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:m,label:"Client Secret",name:"clientSecret",value:o.clientSecret,placeholder:"",style:{width:"400px"},variant:"outlined",size:"small",required:!0})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Unleash hostname"}),e.jsxs("p",{children:["(Required) The hostname you are running Unleash on that Google should send the user back to. The final callback URL will be"," ",e.jsx("small",{children:e.jsx("code",{children:"https://[unleash.hostname.com]/auth/google/callback"})})]})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:m,label:"Unleash Hostname",name:"unleashHostname",placeholder:"",value:o.unleashHostname||"",style:{width:"400px"},variant:"outlined",size:"small"})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Auto-create users"}),e.jsx("p",{children:"Enable automatic creation of new users when signing in with Google."})]}),e.jsx(f,{item:!0,md:6,style:{padding:"20px"},children:e.jsx(pe,{onChange:p,name:"enabled",checked:o.autoCreate})})]}),e.jsxs(f,{container:!0,spacing:3,mb:2,children:[e.jsxs(f,{item:!0,md:5,children:[e.jsx("strong",{children:"Email domains"}),e.jsx("p",{children:"(Optional) Comma separated list of email domains that should be allowed to sign in."})]}),e.jsx(f,{item:!0,md:6,children:e.jsx(ee,{onChange:m,label:"Email domains",name:"emailDomains",value:o.emailDomains,placeholder:"@company.com, @anotherCompany.com",style:{width:"400px"},rows:2,multiline:!0,variant:"outlined",size:"small"})})]}),e.jsx(f,{container:!0,spacing:3,children:e.jsxs(f,{item:!0,md:5,children:[e.jsx(N,{variant:"contained",color:"primary",type:"submit",disabled:c,children:"Save"})," ",e.jsx("p",{children:e.jsx("small",{style:{color:"error.dark"},children:l==null?void 0:l.message})})]})})]})]})},fl=()=>{var i;const{isEnterprise:t}=F(),s=kt("googleAuthEnabled"),n=[{label:"Single sign-on: OpenID Connect",path:"/admin/auth/oidc"},{label:"Single sign-on: SAML 2.0",path:"/admin/auth/saml"},{label:"Password login",path:"/admin/auth/password"},{label:"Single sign-on: Google",path:"/admin/auth/google"},{label:"Single sign-on: SCIM",path:"/admin/auth/scim"}],{pathname:o}=Ws(),a=((i=n.find(r=>o===r.path))==null?void 0:i.label)||"Single sign-on: OpenID Connect";return Zt(a),t()?e.jsx("div",{children:e.jsx(fe,{permissions:[De,ii],children:e.jsx(se,{header:a,children:e.jsxs(at,{children:[e.jsx(_,{path:"/",index:!0,element:e.jsx(zs,{to:"/admin/auth/oidc"})}),e.jsx(_,{path:"/oidc",index:!0,element:e.jsx(el,{})}),e.jsx(_,{path:"/saml",element:e.jsx(sl,{})}),e.jsx(_,{path:"/password",element:e.jsx(xl,{})}),s&&e.jsx(_,{path:"/google",element:e.jsx(jl,{})}),e.jsx(_,{path:"/scim",element:e.jsx(ul,{})})]})})})}):e.jsx(ot,{feature:"sso",page:!0})},yl=te("api/admin/invoices"),bl=u(N)(({theme:t})=>({width:"100%",marginBottom:t.spacing(1.5)})),Sl=({update:t})=>e.jsx(bl,{href:`${yl}/${t?"portal":"checkout"}`,variant:t?"outlined":"contained",children:t?"Update billing information":"Add billing information"}),Dn=u(Ye)(({theme:t})=>({padding:t.spacing(4),height:"100%",borderRadius:t.shape.borderRadiusLarge,backgroundColor:t.palette.background.paper})),vl=u(k)(({theme:t})=>({marginBottom:t.spacing(4)})),Cl=u(Y)(({theme:t})=>({marginBottom:t.spacing(4)})),Ts=u(k)(({theme:t})=>({fontSize:t.fontSizes.smallBody,color:t.palette.text.secondary})),wl=u(it)(({theme:t})=>({margin:`${t.spacing(2.5)} 0`,borderColor:t.palette.divider})),Tl=()=>{const{instanceStatus:t}=rt(),{uiConfig:{billing:s}}=F(),n=s==="pay-as-you-go";if(!t)return e.jsx(f,{item:!0,xs:12,md:5,children:e.jsx(Dn,{"data-loading":!0,sx:{flex:1,height:"400px"}})});const o=`${t.plan}${n?" Pay-as-You-Go":""}`,a=t.state!==Hs.ACTIVE,{isCustomBilling:i}=t;return e.jsx(f,{item:!0,xs:12,md:5,children:e.jsxs(Dn,{children:[e.jsx(vl,{variant:"body1",children:"Billing information"}),e.jsx(T,{condition:!!i,show:e.jsx(Ts,{children:"Your billing is managed by Unleash"}),elseShow:e.jsxs(e.Fragment,{children:[e.jsx(T,{condition:a,show:e.jsxs(Cl,{severity:"warning",children:["In order to"," ",e.jsx("strong",{children:"Upgrade trial"})," you need to provide us your billing information."]})}),e.jsx(Sl,{update:!a}),e.jsx(Ts,{children:a?"Once we have received your billing information we will upgrade your trial within 1 business day":"Update your credit card and business information and change which email address we send invoices to"})]})}),e.jsx(wl,{}),e.jsxs(Ts,{children:[e.jsx("a",{href:`mailto:support@getunleash.io?subject=${o} plan clarifications`,children:"Get in touch with us"})," ","for any clarification"]})]})})},kl=u(f)(({theme:t})=>({flexWrap:"nowrap",gap:t.spacing(1)})),ke=({sx:t,children:s})=>e.jsx(kl,{container:!0,item:!0,justifyContent:"space-between",alignItems:"center",sx:t,children:s}),ie=({children:t,vertical:s=!1})=>e.jsx(f,{container:s,item:!0,display:"flex",alignItems:s?"start":"center",direction:s?"column":void 0,children:t}),El=u("span")(({theme:t})=>({fontSize:t.fontSizes.smallBody,marginLeft:t.spacing(1)})),wt=({children:t})=>e.jsxs(El,{children:["(",t,")"]}),Se=()=>{const{data:t,error:s,mutate:n}=we(te("api/admin/user-admin"),Al);return d.useMemo(()=>({users:(t==null?void 0:t.users)??[],roles:(t==null?void 0:t.rootRoles)??[],loading:!s&&!t,refetch:()=>n(),error:s}),[t,s,n])},Al=t=>fetch(t).then(ce("Users")).then(s=>s.json()),ca=new Date,Fx=At(ca,"yyyy-MM");Ao(ca);const Gx=t=>At(t,"yyyy-MM"),Wx=t=>At(t,"yyyy-MM-dd"),zx=t=>Ro(t,"yyyy-MM",new Date),Rl=t=>Ro(t,"yyyy-MM-dd",new Date),nn=5,on=1e6,Dl=Rl("2024-05-01"),Il=["/api/admin","/api/frontend","/api/client"],Pl=t=>{const{apiData:s,...n}=t;return{apiData:s.filter(a=>Il.includes(a.apiPath)).map(a=>(a.dataPoints=a.dataPoints.filter(({period:i})=>new Date(i)>=Dl),a)),...n}},Ll=(t,s)=>t.reduce((n,o)=>{const a=o.dataPoints.find(({period:r})=>r===s),i=(a==null?void 0:a.trafficTypes.reduce((r,l)=>r+l.count,0))??0;return n+i},0),da=t=>t.flatMap(s=>s.dataPoints.flatMap(n=>n.trafficTypes.map(o=>o.count))).reduce((s,n)=>s+n,0),Bl=t=>{const{grouping:s,apiData:n}=t;if(s==="monthly"){const o=At(new Date(t.dateRange.to),"yyyy-MM");return Ll(n,o)}else return da(n)},Ul=(t,s=nn,n=on)=>Math.ceil(t/n)*s,ua=(t,s,n=nn,o=on)=>{if(t===0)return 0;const a=Math.floor((t-s)/o)*o;return a>0?Ul(a,n,o):0},Ol=({dayOfMonth:t,daysInMonth:s,trafficData:n})=>{if(t<5)return 0;const o=n.map(i=>({...i,dataPoints:i.dataPoints.filter(r=>Number(r.period.slice(-2))<t)}));return da(o)/(t-1)*s},Hx=(t,s,n,o=nn,a=on)=>{if(!t)return 0;const i=n.getDate(),r=Ao(n),l=Ol({dayOfMonth:i,daysInMonth:r,trafficData:t});return ua(l,s,o,a)},$l=(t,{from:s,to:n})=>{const o=`api/admin/metrics/traffic?grouping=${t}&from=${s}&to=${n}`,{data:a,error:i,mutate:r}=we(te(o),_l);return d.useMemo(()=>{const l=a?{state:"success",data:Pl(a)}:i?{state:"error",error:i}:{state:"loading"};return{refetch:()=>r(),result:l}},[a,i,r])},_l=t=>fetch(t).then(ce("Instance Metrics")).then(s=>s.json()),ha=t=>{const s=new Date,n=h=>At(h,"yyyy-MM-dd"),o=n(ri(s)),a=n(li(s)),{instanceStatus:i}=rt(),{instancePrices:r}=qs(),l=(i==null?void 0:i.billing)==="pay-as-you-go"?r.payg.traffic:r.pro.traffic,{result:c}=$l("daily",{from:o,to:a});return d.useMemo(()=>{if(c.state!=="success")return 0;const h=Bl(c.data);return ua(h,t,l)},[t,JSON.stringify(c),l])},ks=u(k)(({theme:t})=>({fontSize:t.fontSizes.smallBody,color:t.palette.text.secondary})),Ml=u(Vs)(({theme:t})=>({fontSize:"1rem",marginRight:t.spacing(1)})),Nl=u(it)(({theme:t})=>({margin:`${t.spacing(3)} 0`})),Fl=({instancePrices:t})=>{const{users:s,loading:n}=Se(),o=s.filter(x=>x.email),a=t.pro.base,i=t.pro.seat,r=t.pro.traffic,l=pa,c=Math.min(o.length,l),m=o.length-c,h=i*m,p=ha(ma),g=a+h+p;return n?null:e.jsxs(e.Fragment,{children:[e.jsxs(f,{container:!0,children:[e.jsxs(ke,{sx:x=>({marginBottom:x.spacing(1.5)}),children:[e.jsxs(ie,{vertical:!0,children:[e.jsxs(k,{children:[e.jsx("strong",{children:"Included members"}),e.jsx(wt,{children:e.jsxs(oe,{to:"/admin/users",children:[c," of ",l," assigned"]})})]}),e.jsxs(ks,{children:["You have ",l," team members included in your PRO plan"]})]}),e.jsxs(ie,{children:[e.jsx(Ml,{}),e.jsx(k,{variant:"body2",children:"included"})]})]}),e.jsxs(ke,{sx:x=>({marginBottom:x.spacing(1.5)}),children:[e.jsxs(ie,{vertical:!0,children:[e.jsxs(k,{children:[e.jsx("strong",{children:"Paid members"}),e.jsx(wt,{children:e.jsxs(oe,{to:"/admin/users",children:[m," assigned"]})})]}),e.jsxs(ks,{children:["$",i,"/month per paid member"]})]}),e.jsx(ie,{children:e.jsxs(k,{sx:x=>({fontSize:x.fontSizes.mainHeader}),children:["$",h.toFixed(2)]})})]}),e.jsx(T,{condition:p>0,show:e.jsxs(ke,{children:[e.jsxs(ie,{vertical:!0,children:[e.jsxs(k,{children:[e.jsx("strong",{children:"Accrued traffic charges"}),e.jsx(wt,{children:e.jsx(oe,{to:"/admin/network/data-usage",children:"view details"})})]}),e.jsxs(ks,{children:["$",r," per 1 million started above included data"]})]}),e.jsx(ie,{children:e.jsxs(k,{sx:x=>({fontSize:x.fontSizes.mainHeader}),children:["$",p.toFixed(2)]})})]})})]}),e.jsx(Nl,{}),e.jsx(f,{container:!0,children:e.jsxs(ke,{children:[e.jsx(ie,{children:e.jsx(k,{sx:x=>({fontWeight:x.fontWeight.bold,fontSize:x.fontSizes.mainHeader}),children:"Total"})}),e.jsx(ie,{children:e.jsxs(k,{sx:x=>({fontWeight:x.fontWeight.bold,fontSize:"2rem"}),children:["$",g.toFixed(2)]})})]})})]})},In=u(k)(({theme:t})=>({fontSize:t.fontSizes.smallBody,color:t.palette.text.secondary})),Gl=u(it)(({theme:t})=>({margin:`${t.spacing(3)} 0`})),Wl=({instanceStatus:t,instancePrices:s})=>{const{users:n,loading:o}=Se(),a=n.filter(g=>g.email),i=s.payg.seat,r=s.payg.traffic,l=t.minSeats??Vl,c=Math.max(a.length,l),m=i*c,h=ha(ma),p=m+h;return o?null:e.jsxs(e.Fragment,{children:[e.jsxs(f,{container:!0,children:[e.jsxs(ke,{sx:g=>({marginBottom:g.spacing(1.5)}),children:[e.jsxs(ie,{vertical:!0,children:[e.jsxs(k,{children:[e.jsx("strong",{children:"Paid members"}),e.jsx(wt,{children:e.jsxs(oe,{to:"/admin/users",children:[a.length," assigned of"," ",l," minimum"]})})]}),e.jsxs(In,{children:["$",i,"/month per paid member"]})]}),e.jsx(ie,{children:e.jsxs(k,{sx:g=>({fontSize:g.fontSizes.mainHeader}),children:["$",m.toFixed(2)]})})]}),e.jsx(T,{condition:h>0,show:e.jsxs(ke,{children:[e.jsxs(ie,{vertical:!0,children:[e.jsxs(k,{children:[e.jsx("strong",{children:"Accrued traffic charges"}),e.jsx(wt,{children:e.jsx(oe,{to:"/admin/network/data-usage",children:"view details"})})]}),e.jsxs(In,{children:["$",r," per 1 million started above included data"]})]}),e.jsx(ie,{children:e.jsxs(k,{sx:g=>({fontSize:g.fontSizes.mainHeader}),children:["$",h.toFixed(2)]})})]})})]}),e.jsx(Gl,{}),e.jsx(f,{container:!0,children:e.jsxs(ke,{children:[e.jsx(ie,{children:e.jsx(k,{sx:g=>({fontWeight:g.fontWeight.bold,fontSize:g.fontSizes.mainHeader}),children:"Total"})}),e.jsx(ie,{children:e.jsxs(k,{sx:g=>({fontWeight:g.fontWeight.bold,fontSize:"2rem"}),children:["$",p.toFixed(2)]})})]})})]})};u(k)(({theme:t})=>({fontSize:t.fontSizes.smallerBody,color:t.palette.text.secondary}));const zl=u(N)(({theme:t})=>({marginTop:t.spacing(1),display:"inline-flex",alignItems:"center"})),Hl=()=>{const t=te("api/admin/invoices/portal");return e.jsx(e.Fragment,{children:e.jsx(f,{container:!0,children:e.jsx(ke,{sx:s=>({marginBottom:s.spacing(3)}),children:e.jsx(ie,{vertical:!0,children:e.jsx(zl,{href:t,variant:"outlined",endIcon:e.jsx(ci,{}),children:"View usage charges"})})})})})},ql=({instanceStatus:t,instancePrices:s,isPAYG:n,isEnterpriseConsumption:o})=>n?e.jsx(Wl,{instanceStatus:t,instancePrices:s}):t.plan===Ys.PRO?e.jsx(Fl,{instancePrices:s}):o?e.jsx(Hl,{}):null,Vl=5,pa=5,ma=53e6,Pn=u(Ye)(({theme:t})=>({padding:t.spacing(4),height:"100%",borderRadius:t.shape.borderRadiusLarge,backgroundColor:t.palette.background.paper})),Yl=u("span")(({theme:t})=>({fontSize:"3.25rem",lineHeight:1,color:t.palette.primary.main,fontWeight:800,marginRight:t.spacing(1.5)})),Jl=u("span")(({theme:t})=>({fontWeight:t.fontWeight.bold})),Kl=u("span")(({theme:t})=>({fontWeight:t.fontWeight.bold})),Zl=u("span")(({theme:t})=>({color:t.palette.primary.main,fontSize:t.fontSizes.mainHeader,fontWeight:t.fontWeight.bold})),Ql=u(Y)(({theme:t})=>({fontSize:t.fontSizes.smallerBody,marginBottom:t.spacing(3),marginTop:t.spacing(-1.5),[t.breakpoints.up("md")]:{marginTop:t.spacing(-4.5)}})),Xl=()=>{const{uiConfig:{billing:t}}=F(),{instanceStatus:s}=rt(),{instancePrices:n}=qs(),o=(s==null?void 0:s.plan)&&(s==null?void 0:s.plan)===Ys.PRO,a=t==="pay-as-you-go",i=t==="enterprise-consumption";if(!s)return e.jsx(f,{item:!0,xs:12,md:7,children:e.jsx(Pn,{"data-loading":!0,sx:{flex:1,height:"400px"}})});const r=di(s),l=n.pro.base,c=`${s.plan}${a?" Pay-as-You-Go":""}`,m=s.state!==Hs.ACTIVE;return e.jsx(f,{item:!0,xs:12,md:7,children:e.jsxs(Pn,{children:[e.jsx(T,{condition:m,show:e.jsxs(Ql,{severity:"info",children:["After you have sent your billing information, your instance will be upgraded - you don't have to do anything."," ",e.jsx("a",{href:`mailto:support@getunleash.io?subject=${c} plan clarifications`,children:"Get in touch with us"})," ","for any clarification"]})}),e.jsx(Ie,{color:"success",children:"Current plan"}),e.jsxs(f,{container:!0,sx:h=>({marginBottom:h.spacing(3)}),children:[e.jsxs(ke,{children:[e.jsxs(ie,{children:[e.jsx(Yl,{children:s.plan}),e.jsx(T,{condition:ui(s),show:e.jsx(Kl,{sx:h=>({color:r?h.palette.error.dark:h.palette.warning.dark}),children:r?"Trial expired":s.trialExtended?"Extended Trial":"Trial"})})]}),e.jsx(ie,{children:e.jsx(T,{condition:!!o,show:e.jsxs(Zl,{children:["$",l.toFixed(2)]})})})]}),e.jsx(ke,{children:e.jsx(T,{condition:a||i,show:e.jsxs(Jl,{children:["Pay-as-You-Go"," ",i?"Consumption":""]})})})]}),e.jsx(ql,{instanceStatus:s,instancePrices:n,isPAYG:a,isEnterpriseConsumption:i})]})})},ec=()=>e.jsxs(f,{container:!0,spacing:2,children:[e.jsx(Tl,{}),e.jsx(Xl,{})]}),tc=u(k)(({theme:t})=>({marginTop:t.spacing(6),marginBottom:t.spacing(2.5),fontSize:t.fontSizes.mainHeader})),sc=[{Header:"Amount",accessor:"amountFormatted"},{Header:"Status",accessor:"status",disableGlobalFilter:!0},{Header:"Created date",accessor:"created",Cell:je,disableGlobalFilter:!0},{Header:"Due date",accessor:"dueDate",Cell:je,disableGlobalFilter:!0},{Header:"Download",accessor:"invoicePDF",align:"center",Cell:({value:t})=>e.jsx(M,{sx:{display:"flex",justifyContent:"center"},"data-loading":!0,children:e.jsx($e,{href:t,children:e.jsx(xi,{})})}),width:100,disableGlobalFilter:!0,disableSortBy:!0}],nc=({data:t,isLoading:s=!1})=>{const n=d.useMemo(()=>({sortBy:[{id:"created",desc:!0}]}),[]),{getTableProps:o,getTableBodyProps:a,headerGroups:i,rows:r,prepareRow:l}=z.useTable({columns:sc,data:t,initialState:n,sortTypes:ye,autoResetGlobalFilter:!1,disableSortRemove:!0,defaultColumn:{Cell:ae}},z.useGlobalFilter,z.useSortBy);return e.jsxs(se,{isLoading:s,disablePadding:!0,children:[e.jsx(tc,{children:"Payment history"}),e.jsxs(hi,{...o(),children:[e.jsx(pi,{headerGroups:i}),e.jsx(Js,{...a(),children:r.map(c=>{l(c);const{key:m,...h}=c.getRowProps();return e.jsx(Et,{hover:!0,...h,children:c.cells.map(p=>{const{key:g,...x}=p.getCellProps();return e.jsx(mi,{...x,children:p.render("Cell")},g)})},m)})})]}),e.jsx(T,{condition:r.length===0,show:e.jsx(le,{children:"No invoices to show."})})]})},Fs="api/admin/invoices",oc=te(Fs),xa=(t={})=>{const s=()=>fetch(oc,{method:"GET"}).then(ce("Invoices")).then(l=>l.json()),{data:n,error:o}=we(Fs,s,t),[a,i]=d.useState(!o&&!n),r=()=>{gi(Fs)};return d.useEffect(()=>{i(!o&&!n)},[n,o]),{invoices:(n==null?void 0:n.invoices)||[],error:o,loading:a,refetchInvoices:r}};var an={},ac=ct;Object.defineProperty(an,"__esModule",{value:!0});var ga=an.default=void 0,ic=ac(lt()),rc=e,lc=(0,ic.default)((0,rc.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5z"}),"DownloadOutlined");ga=an.default=lc;const He=(t,s)=>s&&s.toLocaleLowerCase()==="usd"?`$${t.toLocaleString("en-US")}`:s&&s.toLocaleLowerCase()==="eur"?`€ ${t.toLocaleString("no-NO")}`:`${t}${s?" ":""}${s||""}`,ja=u("div",{shouldForwardProp:t=>t!=="withBackground"})(({theme:t,withBackground:s})=>({display:"grid",gridTemplateColumns:"subgrid",gridColumn:"1 / -1",background:s?t.palette.background.elevation1:"transparent",margin:t.spacing(.5,0),padding:s?t.spacing(2,2,3):t.spacing(.5,2,1.5),borderRadius:t.shape.borderRadiusLarge,gap:t.spacing(2)})),qe=u("div")(({theme:t})=>({textAlign:"right",paddingRight:t.spacing(1.5)})),fa=u("div",{shouldForwardProp:t=>t!=="expand"})(({expand:t})=>({display:"flex",flexDirection:"column",gridColumn:t?"1 / span 2":void 0})),cc=u(ja)(({theme:t})=>({gridColumn:"3 / -1",padding:t.spacing(1,1,0,0),gap:0})),Es=u("div")(({theme:t,last:s})=>({marginRight:t.spacing(1),display:"grid",gridColumn:"1 / -1",gridTemplateColumns:"subgrid",...s?{fontWeight:t.typography.fontWeightBold}:{borderBottom:`1px solid ${t.palette.divider}`},padding:t.spacing(1.25,0)})),We=u("div",{shouldForwardProp:t=>t!=="colSpan"})(({theme:t,colSpan:s})=>({padding:t.spacing(0,0,0,.5),...s?{gridColumn:`span ${s}`}:{}})),dc=({value:t,percentage:s,currency:n,status:o})=>{if(t===void 0)return e.jsx(We,{colSpan:2,children:"Customer tax is exempt"});const i=o==="estimate"&&s!==void 0?`Tax (${s}%)`:"Tax";return e.jsxs(e.Fragment,{children:[e.jsx(We,{children:i}),e.jsx(We,{children:e.jsx(qe,{children:He(t,n)})})]})},uc=({subTotal:t,taxAmount:s,taxPercentage:n,totalAmount:o,currency:a,status:i})=>e.jsxs(cc,{children:[e.jsxs(Es,{children:[e.jsx(We,{children:"Sub total"}),e.jsx(We,{children:e.jsx(qe,{children:He(t||0,a)})})]}),e.jsx(Es,{children:e.jsx(dc,{value:s,percentage:n,currency:a,status:i})}),e.jsxs(Es,{last:!0,children:[e.jsx(We,{children:"Total"}),e.jsx(We,{children:e.jsx(qe,{children:He(o,a)})})]})]}),hc=({percentage:t})=>e.jsx(zr,{percentage:t,size:"1.25rem",strokeRatio:.3}),rn=(t,s)=>!!(t&&s),Ln=(t,s)=>rn(t,s)?Math.floor(Math.max(0,t-s)):0,pc=(t,s)=>rn(t,s)?Math.min(t,s):t,mc=u("div")(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(1),maxHeight:t.spacing(2.5)})),xc=({quantity:t,consumption:s,limit:n,description:o,totalAmount:a,unitPrice:i,invoiceCurrency:r,invoiceStatus:l})=>{const c=n&&n>0?Math.min(100,Math.round((s||0)/n*100)):void 0,m=l==="estimate",h=rn(s,n),p=m&&h?Ln(s,n):t,g=m&&h?pc(s,n):s,x=m&&i&&h?Ln(s,n)*i:a,j=x&&x>0,b=h,y=()=>g!==void 0&&n!==void 0?`${et(g)}/${et(n)}`:g!==void 0?et(g):n!==void 0?et(n):"–";return e.jsxs(e.Fragment,{children:[e.jsx(fa,{children:o}),b?e.jsxs(mc,{children:[e.jsx(hc,{percentage:c||0}),e.jsx("div",{children:y()})]}):e.jsx("div",{}),e.jsx("div",{children:p?et(p):""}),j?e.jsx(qe,{children:He(x,r)}):e.jsx("div",{})]})},gc=u(k)(({theme:t})=>({color:t.palette.text.secondary,fontSize:t.typography.caption.fontSize})),jc=({quantity:t,description:s,currency:n,totalAmount:o,startDate:a,endDate:i,invoiceCurrency:r})=>{const l=a?new Date(a).toLocaleDateString(void 0,{month:"short",day:"numeric"}):void 0,c=i?new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"}):void 0;return e.jsxs(e.Fragment,{children:[e.jsxs(fa,{expand:!0,children:[e.jsx("div",{children:s}),l||c?e.jsxs(gc,{children:[l," - ",c]}):null]}),e.jsx("div",{children:t?et(t):"–"}),e.jsx(qe,{children:He(o||0,r)})]})},fc=(t,s,n,o,a,i,r)=>{if(t!=="estimate")return{subtotal:s,taxAmount:n,totalAmount:o};const l=i.reduce((g,x)=>g+(x.totalAmount||0),0),c=r.reduce((g,x)=>{const j=x.consumption&&x.limit?Math.floor(Math.max(0,x.consumption-x.limit)):0;return g+j*(x.unitPrice||0)},0),m=l+c,h=a?m*(a/100):0,p=m+h;return{subtotal:m,taxAmount:h,totalAmount:p}},yc=u(es)(({theme:t})=>({background:t.palette.background.paper,borderRadius:t.shape.borderRadiusLarge,boxShadow:t.boxShadows.card,"&:before":{display:"none"},"&.MuiAccordion-root":{margin:0,border:"none"}})),bc=u(ts)(({theme:t})=>({padding:t.spacing(2,4),gap:t.spacing(1.5),"& .MuiAccordionSummary-content":{margin:0,display:"flex",alignItems:"center",gap:t.spacing(1.5),"&.Mui-expanded":{margin:0}}})),Sc=u("div")(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(1.5),flex:1,minWidth:0})),vc=u("div")(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(2)})),Cc=u("div")(({theme:t})=>({display:"grid",gridTemplateColumns:"45% 20% 15% 20%",padding:t.spacing(0,2,2)})),_e=u("div")(({theme:t})=>({fontSize:t.typography.body2.fontSize,fontWeight:t.typography.fontWeightMedium,color:t.palette.text.secondary})),Bn=({children:t,title:s})=>e.jsx(ja,{withBackground:!!s,children:t}),$t=u("div")(({theme:t})=>({display:"grid",gridColumn:"1 / -1",gridTemplateColumns:"subgrid"})),wc=u("span")(({theme:t})=>({color:t.palette.text.primary,fontSize:t.typography.body1.fontSize})),Tc=u(it)(({theme:t})=>({gridColumn:"1 / -1",margin:t.spacing(0,2)})),kc=u("div")(({theme:t})=>({display:"flex",justifyContent:"flex-end",gap:t.spacing(1),padding:t.spacing(0,2,2)})),Ec=({status:t,invoiceDate:s,invoicePDF:n,invoiceURL:o,totalAmount:a,subtotal:i,taxAmount:r,taxPercentage:l,currency:c,mainLines:m,usageLines:h,monthText:p,defaultExpanded:g})=>{const x=s?new Date(s).toLocaleDateString(void 0,{month:"long",day:"numeric"}):"",b=new Date(s).getFullYear()===new Date().getFullYear()?`, ${new Date(s).getFullYear()}`:"",{subtotal:y,taxAmount:C,totalAmount:A}=fc(t,i,r,a,l,m,h);return e.jsxs(yc,{defaultExpanded:!!g,children:[e.jsxs(bc,{expandIcon:e.jsx(ss,{}),id:`billing-invoice-${x}-header`,children:[e.jsx(Sc,{children:e.jsxs(k,{variant:"h2",component:"h3",sx:{fontWeight:700},children:[x,b]})}),e.jsxs(vc,{children:[t==="estimate"?e.jsx(Ie,{color:"disabled",children:"Estimate"}):null,t==="upcoming"?e.jsx(Ie,{color:"info",children:"Next invoice"}):null,t==="invoiced"?e.jsx(Ie,{color:"success",children:"Invoiced"}):null,t==="paid"?e.jsx(Ie,{color:"success",children:"Paid"}):null,e.jsx(k,{variant:"body1",sx:{fontWeight:700},children:He(A,c)})]})]}),e.jsxs(ns,{sx:v=>({padding:v.spacing(2,0,0),borderTop:`1px solid ${v.palette.divider}`}),children:[e.jsxs(Cc,{children:[e.jsxs(Bn,{children:[e.jsxs($t,{children:[e.jsx(_e,{children:"Description"}),e.jsx(_e,{}),e.jsx(_e,{children:"Quantity"}),e.jsx(_e,{children:e.jsx(qe,{children:"Amount"})})]}),m.map(v=>e.jsx($t,{children:e.jsx(jc,{...v,invoiceCurrency:c})},v.description))]}),h.length?e.jsxs(Bn,{title:"Usage",children:[e.jsxs($t,{children:[e.jsx(_e,{children:e.jsxs(wc,{children:["Usage – ",p]})}),e.jsx(_e,{children:"Included"}),e.jsx(_e,{children:"Overages"}),e.jsx(_e,{children:e.jsx(qe,{children:"Amount"})})]}),h.map(v=>e.jsx($t,{children:e.jsx(xc,{...v,invoiceCurrency:c,invoiceStatus:t})},v.description))]},"usage"):e.jsx(Tc,{}),e.jsx(uc,{subTotal:y,taxAmount:C,taxPercentage:l,totalAmount:A,currency:c,status:t})]}),o||n?e.jsxs(kc,{children:[o?e.jsx(N,{variant:"outlined",href:o,target:"_blank",rel:"noreferrer",startIcon:e.jsx(ji,{}),children:"View invoice"}):null,n?e.jsx(N,{variant:"outlined",href:n,target:"_blank",rel:"noreferrer",startIcon:e.jsx(ga,{}),children:"Download PDF"}):null]}):null]})]})},Ac=u(es)(({theme:t})=>({background:t.palette.background.paper,borderRadius:t.shape.borderRadiusLarge})),Rc=u(ts)(({theme:t})=>({padding:t.spacing(2,4),gap:t.spacing(1.5)})),Dc=u("div")(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(1.5),flex:1,minWidth:0})),Ic=u("div")(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(2)})),Pc=u("div")(({theme:t})=>({height:t.spacing(2.5),backgroundColor:t.palette.action.hover,borderRadius:t.spacing(.5),margin:t.spacing(.5,0)})),Lc=u("div")(({theme:t})=>({height:t.spacing(3),width:t.spacing(10),backgroundColor:t.palette.action.hover,borderRadius:t.spacing(1.5)})),Bc=u("div")(({theme:t})=>({height:t.spacing(3),width:t.spacing(12.5),backgroundColor:t.palette.action.hover,borderRadius:t.spacing(.5)})),Uc=u("div")(({theme:t})=>({height:t.spacing(25),backgroundColor:t.palette.action.hover,borderRadius:t.spacing(.5),margin:t.spacing(2,4)})),Oc=()=>e.jsxs(Ac,{defaultExpanded:!0,"data-loading":!0,children:[e.jsxs(Rc,{expandIcon:e.jsx(ss,{}),children:[e.jsx(Dc,{children:e.jsx(Pc,{sx:{width:t=>t.spacing(15),height:t=>t.spacing(4)}})}),e.jsxs(Ic,{children:[e.jsx(Lc,{}),e.jsx(Bc,{})]})]}),e.jsx(ns,{children:e.jsx(Uc,{})})]}),ya="api/admin/invoices/list",$c=te(ya),ba=(t={})=>{const s=()=>fetch($c,{method:"GET"}).then(ce("Detailed invoices")).then(c=>c.json()),{data:n,error:o,isLoading:a}=we(ya,s,t),i=d.useMemo(()=>(n==null?void 0:n.invoices)??[],[n]),r=n==null?void 0:n.planPrice,l=n==null?void 0:n.planCurrency;return{invoices:i,planPrice:r,planCurrency:l,error:o,loading:a}},Un=u(M)(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(2)})),_c=()=>{const{invoices:t,loading:s}=ba(),n=Rt(s);return s?e.jsx(Un,{ref:n,children:[1,2,3].map(o=>e.jsx(Oc,{},o))}):e.jsx(Un,{children:t.length>0?e.jsx(e.Fragment,{children:t.map((o,a)=>e.jsx(Ec,{defaultExpanded:a===0,...o},o.invoiceDate))}):e.jsx(le,{children:"There are no invoices or estimates available right now."})})};var ln={},Mc=ct;Object.defineProperty(ln,"__esModule",{value:!0});var Sa=ln.default=void 0,Nc=Mc(lt()),Fc=e,Gc=(0,Nc.default)((0,Fc.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}),"CreditCard");Sa=ln.default=Gc;const Wc=u(Ye)(({theme:t})=>({padding:t.spacing(2),borderRadius:t.shape.borderRadiusLarge,display:"flex",flexDirection:"column",gap:t.spacing(1)})),On=u("div")(({theme:t})=>({display:"flex",justifyContent:"space-between",fontSize:t.typography.body2.fontSize})),_t=u("div")(({theme:t})=>({height:t.spacing(2.5),backgroundColor:t.palette.action.hover,borderRadius:t.spacing(.5),margin:t.spacing(.5,0)})),zc=u("div")(({theme:t})=>({height:t.spacing(4),backgroundColor:t.palette.action.hover,borderRadius:t.spacing(.5),margin:t.spacing(.5,0),width:t.spacing(20)})),Hc=u("div")(({theme:t})=>({height:t.spacing(5),backgroundColor:t.palette.action.hover,borderRadius:t.spacing(.5),margin:t.spacing(1,0),width:"100%"})),qc=u("div")(({theme:t})=>({height:t.spacing(.125),backgroundColor:t.palette.action.hover,borderRadius:t.spacing(.5),margin:t.spacing(1.5,0),width:"100%"})),$n=u("div")(({theme:t})=>({height:t.spacing(2),backgroundColor:t.palette.action.hover,borderRadius:t.spacing(.5),margin:t.spacing(.5,0),width:t.spacing(25)})),Vc=()=>e.jsxs(Wc,{"data-loading":!0,children:[e.jsx(zc,{}),e.jsxs(On,{children:[e.jsx(_t,{sx:{width:t=>t.spacing(12)}}),e.jsx(_t,{sx:{width:t=>t.spacing(8)}})]}),e.jsxs(On,{children:[e.jsx(_t,{sx:{width:t=>t.spacing(10)}}),e.jsx(_t,{sx:{width:t=>t.spacing(6)}})]}),e.jsx(qc,{}),e.jsx(Hc,{}),e.jsx($n,{}),e.jsx($n,{sx:{width:t=>t.spacing(20)}})]}),Yc=te("api/admin/invoices"),As=u(Ye)(({theme:t})=>({padding:t.spacing(2),borderRadius:t.shape.borderRadiusLarge,boxShadow:t.boxShadows.card,display:"flex",flexDirection:"column",gap:t.spacing(1)})),_n=u("div")(({theme:t})=>({display:"flex",justifyContent:"space-between",fontSize:t.typography.body2.fontSize})),Mn=u("span")(({theme:t})=>({color:t.palette.text.secondary,whiteSpace:"nowrap"})),Nn=u("span")(({theme:t})=>({textAlign:"right"})),Jc=u(N)(({theme:t})=>({margin:t.spacing(0,0,1,0)})),qt=u(k)(({theme:t})=>({fontSize:t.fontSizes.smallBody,color:t.palette.text.secondary})),Kc=u(it)(({theme:t})=>({margin:t.spacing(1.5,0),borderColor:t.palette.divider})),Rs=()=>e.jsxs(qt,{children:[e.jsx("a",{href:"mailto:support@getunleash.io?subject=Billing plan clarifications",children:"Get in touch with us"})," ","for any clarification"]}),Zc=()=>{const{instanceStatus:t,loading:s}=rt(),{uiConfig:{billing:n}}=F(),{planPrice:o,planCurrency:a,loading:i}=ba();if(s||i)return e.jsx(Vc,{});if(!t)return e.jsxs(As,{children:[e.jsx(k,{variant:"h3",children:"Billing details"}),e.jsx(qt,{children:"Your billing is managed by Unleash"}),e.jsx(Rs,{})]});const r=n==="pay-as-you-go",l=t.state!==Hs.ACTIVE,{isCustomBilling:c}=t;return c?e.jsxs(As,{children:[e.jsx(k,{variant:"h3",children:"Billing details"}),e.jsx(qt,{children:"Your billing is managed by Unleash"}),e.jsx(Rs,{})]}):e.jsxs(As,{children:[e.jsx(k,{variant:"h3",children:"Billing details"}),e.jsxs(_n,{children:[e.jsx(Mn,{children:"Current plan"})," ",e.jsx(Nn,{children:r?"Pay-as-You-Go":"Consumption"})]}),e.jsxs(_n,{children:[e.jsx(Mn,{children:"Plan price"})," ",e.jsx(Nn,{children:o!==void 0?`${He(o,a)} ${r?"per seat":"/ month"}`:"-"})]}),e.jsx(Kc,{}),e.jsx(Jc,{href:`${Yc}/${l?"checkout":"portal"}`,variant:l?"contained":"outlined",startIcon:e.jsx(Sa,{}),children:l?"Add billing details":"Edit billing details"}),l?e.jsx(qt,{children:"Once we have received your billing information we will upgrade your trial within 1 business day."}):null,e.jsx(Rs,{})]})},Qc=u(k)(({theme:t})=>({fontSize:t.fontSizes.mainHeader,color:t.palette.text.primary})),Xc=u(M)(({theme:t})=>({display:"grid",gridTemplateColumns:"1fr 320px",gap:t.spacing(2),[t.breakpoints.down("md")]:{display:"flex",flexDirection:"column-reverse"}})),ed=()=>{const{isBilling:t,refetchInstanceStatus:s,refresh:n,loading:o}=rt(),{invoices:a}=xa(),{uiConfig:{billing:i}}=F(),r=i==="pay-as-you-go"||i==="enterprise-consumption";return d.useEffect(()=>{(async()=>{await n(),s()})()},[s,n]),r?e.jsxs(M,{sx:l=>({display:"flex",flexDirection:"column",gap:l.spacing(4)}),children:[e.jsx(Qc,{children:"Usage and invoices"}),e.jsxs(Xc,{children:[e.jsx(_c,{}),e.jsx("div",{children:e.jsx(Zc,{})})]})]}):e.jsx("div",{children:e.jsx(se,{header:"Billing",isLoading:o,children:e.jsx(T,{condition:t,show:e.jsx(fe,{permissions:Q,children:e.jsxs(e.Fragment,{children:[e.jsx(ec,{}),e.jsx(nc,{data:a})]})}),elseShow:e.jsx(Y,{severity:"error",children:"Billing is not enabled for this instance."})})})})},td=te("api/admin/invoices/portal"),sd=()=>{const{refetchInvoices:t,invoices:s}=xa(),[n,o]=d.useState(!1),{locationSettings:a}=Do();return d.useEffect(()=>{t(),o(!0)},[]),e.jsx(T,{condition:s.length>0,show:e.jsx(se,{header:e.jsx(ne,{title:"Invoices",actions:e.jsx(N,{href:td,rel:"noreferrer",target:"_blank",endIcon:e.jsx(fi,{}),children:"Billing portal"})}),children:e.jsx("div",{children:e.jsxs(Io,{children:[e.jsx(Po,{children:e.jsxs(Et,{children:[e.jsx(de,{children:"Amount"}),e.jsx(de,{children:"Status"}),e.jsx(de,{children:"Due date"}),e.jsx(de,{children:"PDF"}),e.jsx(de,{children:"Link"})]})}),e.jsx(Js,{children:s.map(i=>e.jsxs(Et,{style:{backgroundColor:i.status==="past-due"?"error.dark":"inherit"},children:[e.jsx(de,{style:{textAlign:"left"},children:i.amountFormatted}),e.jsx(de,{style:{textAlign:"left"},children:i.status}),e.jsx(de,{style:{textAlign:"left"},children:i.dueDate&&Lo(i.dueDate,a.locale)}),e.jsx(de,{style:{textAlign:"left"},children:e.jsx("a",{href:i.invoicePDF,children:"PDF"})}),e.jsx(de,{style:{textAlign:"left"},children:e.jsx("a",{href:i.invoiceURL,target:"_blank",rel:"noreferrer",children:"Payment link"})})]},i.invoiceURL))})]})})}),elseShow:e.jsx(se,{children:n&&"No invoices to show."})})},nd=()=>e.jsx("div",{children:e.jsx(fe,{permissions:Q,children:e.jsx(sd,{})})}),od=()=>{const{uiConfig:t,loading:s}=F();return s?null:t.flags.UNLEASH_CLOUD?e.jsx(zs,{to:"/admin/billing",replace:!0}):e.jsx(nd,{})},ad=()=>e.jsxs(Y,{severity:"info",children:[e.jsxs("p",{children:["Use this page to configure allowed CORS origins for the Frontend API (",e.jsx("code",{children:"/api/frontend"}),")."]}),e.jsxs("p",{children:["This configuration will not affect the Admin API (",e.jsx("code",{children:"/api/admin"}),") nor the Client API (",e.jsx("code",{children:"/api/client"}),")."]}),e.jsxs("p",{children:["An asterisk (",e.jsx("code",{children:"*"}),") may be used to allow API calls from any origin."]}),e.jsx("br",{}),e.jsx("p",{children:"Be aware that changes here will take up to two minutes to be updated. In addition, there is a maxAge on the Access-Control-Allow-Origin header that will instruct browsers to cache this header for some time. The cache period is set to the maxium that the browser allows (2h for Chrome, 24h for Firefox)."})]}),id=()=>{const{makeRequest:t,createRequest:s,errors:n,loading:o}=xe({propagateErrors:!0});return{setCors:async i=>{const r=s("api/admin/ui-config/cors",{method:"POST",body:JSON.stringify({frontendApiOrigins:i})},"setCors");await t(r.caller,r.id)},loading:o,errors:n}},rd=({frontendApiOrigins:t})=>{const{setCors:s}=id(),{setToastData:n,setToastApiError:o}=K(),[a,i]=d.useState(Fn(t)),r=jn(),l=jn(),c=async m=>{try{const h=ld(a);m.preventDefault(),await s(h),i(Fn(h)),n({text:"Settings saved",type:"success"})}catch(h){o(V(h))}};return e.jsx("form",{onSubmit:c,children:e.jsxs(M,{sx:{display:"grid",gap:1},children:[e.jsxs("label",{htmlFor:r,children:["Which origins should be allowed to call the Frontend API? Add only one origin per line. The CORS specification does not support wildcard for subdomains, it needs to be a fully qualified domain, including the protocol.",e.jsx("br",{}),e.jsx("br",{}),'If you specify "*" it will be the chosen origin.',e.jsx("br",{}),e.jsx("br",{}),"Example:"]}),e.jsxs("code",{style:{fontSize:"0.7em"},children:["https://www.example.com",e.jsx("br",{}),"https://www.example2.com"]}),e.jsx(ee,{id:r,"aria-describedby":l,placeholder:cd,value:a,onChange:m=>i(m.target.value),multiline:!0,rows:12,variant:"outlined",fullWidth:!0,InputProps:{style:{fontFamily:"monospace",fontSize:"0.8em"}}}),e.jsx(Bo,{permission:[De,Uo]})]})})},ld=t=>t.split(/[,\n\s]+/).map(s=>s.replace(/\/$/,"")).filter(Boolean),Fn=t=>(t==null?void 0:t.join(`
5
+ `))??"",cd=["https://example.com","https://example.org"].join(`
6
+ `),dd=()=>e.jsx("div",{children:e.jsx(fe,{permissions:[De,Uo],children:e.jsx(ud,{})})}),ud=()=>{const{uiConfig:t,loading:s}=F();return s?null:e.jsx(se,{header:e.jsx(ne,{title:"CORS origins"}),children:e.jsxs(M,{sx:{display:"grid",gap:4},children:[e.jsx(ad,{}),e.jsx(rd,{frontendApiOrigins:t.frontendApiOrigins})]})})},Ve=()=>{const{data:t,error:s,mutate:n}=we(te("api/admin/groups"),hd);return d.useMemo(()=>({groups:(t==null?void 0:t.groups.map(o=>({...o,users:Wr(o.users??[])})))??[],loading:!s&&!t,refetchGroups:()=>n(),error:s}),[t,s,n])},hd=t=>fetch(t).then(ce("Groups")).then(s=>s.json());var cn={},pd=ct;Object.defineProperty(cn,"__esModule",{value:!0});var va=cn.default=void 0,md=pd(lt()),xd=e,gd=(0,md.default)((0,xd.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V18c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-1.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05.02.01.03.03.04.04 1.14.83 1.93 1.94 1.93 3.41V18c0 .35-.07.69-.18 1H22c.55 0 1-.45 1-1v-1.5c0-2.33-4.67-3.5-7-3.5z"}),"GroupRounded");va=cn.default=gd;const Tt="This group is managed by your SCIM provider, only the role and description can be changed manually",jd=u("div")(({theme:t})=>({margin:t.spacing(-1),marginLeft:t.spacing(-.5),display:"flex",justifyContent:"center",alignItems:"center"})),fd=u(Oo)(({theme:t})=>({borderRadius:t.shape.borderRadiusLarge,padding:t.spacing(1,1.5)})),yd=({groupId:t,onEditUsers:s,onRemove:n,isScimGroup:o})=>{const[a,i]=d.useState(null),r=!!a,l=p=>{i(p.currentTarget)},c=()=>{i(null)},m=`group-${t}-actions`,h=`${m}-menu`;return e.jsxs(jd,{onClick:p=>{p.preventDefault(),p.stopPropagation()},children:[e.jsx(Te,{title:o?Tt:"Group actions",arrow:!0,describeChild:!0,children:e.jsx("div",{children:e.jsx($e,{id:m,"aria-controls":r?h:void 0,"aria-haspopup":"true","aria-expanded":r?"true":void 0,onClick:l,type:"button",size:"small",children:e.jsx($o,{})})})}),e.jsx(fd,{id:h,anchorEl:a,open:r,onClose:c,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},disableScrollLock:!0,children:e.jsxs(_o,{"aria-labelledby":m,children:[e.jsxs(ze,{onClick:c,component:oe,to:`/admin/groups/${t}/edit`,children:[e.jsx(Ss,{children:e.jsx(Dt,{})}),e.jsx(Ht,{children:e.jsx(k,{variant:"body2",children:"Edit group"})})]}),e.jsxs(ze,{disabled:o,onClick:()=>{s(),c()},children:[e.jsx(Ss,{children:e.jsx(va,{})}),e.jsx(Ht,{children:e.jsx(k,{variant:"body2",children:"Edit group users"})})]}),e.jsxs(ze,{onClick:()=>{n(),c()},children:[e.jsx(Ss,{children:e.jsx(Le,{})}),e.jsx(Ht,{children:e.jsx(k,{variant:"body2",children:"Delete group"})})]})]})})]})},bd=u(yi)(({theme:t})=>({height:t.spacing(2.5),width:t.spacing(2.5),marginLeft:t.spacing(-.75)})),Sd=u(M)(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(1),maxWidth:t.spacing(25)})),vd=u(Ie)({cursor:"pointer",overflowWrap:"anywhere"}),Cd=({group:t})=>{const s=Ce();return e.jsxs(e.Fragment,{children:[t.users.length>0?e.jsx(bi,{users:t.users,AvatarComponent:bd}):e.jsx("span",{children:"This group has no users"}),t.projects.length>0&&e.jsx(os,{component:"span",tooltip:e.jsx(Sd,{children:t.projects.map(n=>e.jsx(vd,{onClick:o=>{o.preventDefault(),s(`/projects/${n}/settings/access`)},color:"secondary",icon:e.jsx(Si,{}),children:n},n))}),children:e.jsxs("span",{children:[t.projects.length," project",t.projects.length!==1&&"s"]})})]})},wd=u(oe)(({theme:t})=>({color:"inherit",textDecoration:"none",border:"none",padding:"0",background:"transparent",fontFamily:t.typography.fontFamily,pointer:"cursor"})),Td=u("h3")(({theme:t})=>({margin:0,marginRight:"auto",fontWeight:t.typography.fontWeightRegular,fontSize:t.typography.body1.fontSize,lineHeight:"1.2"})),kd=({group:t,onEditUsers:s,onRemoveGroup:n})=>{const{searchQuery:o}=Ks(),{settings:{enabled:a}}=Ut(),i=a&&!!t.scimId,r=e.jsx(fn,{title:t.name,arrow:!0,component:Td,children:e.jsx(Vt,{search:o,children:t.name})}),l=e.jsxs(e.Fragment,{children:[t.rootRole&&e.jsx(vi,{roleId:t.rootRole,hideIcon:!0}),e.jsx(yd,{groupId:t.id,onEditUsers:()=>s(t),onRemove:()=>n(t),isScimGroup:i})]}),c=t.description&&e.jsx(fn,{lines:2,title:t.description,arrow:!0,children:e.jsx(Vt,{search:o,children:t.description})});return e.jsx(wd,{to:`/admin/groups/${t.id}`,children:e.jsx(Ci,{title:r,icon:e.jsx(wi,{}),headerActions:l,footer:e.jsx(Cd,{group:t}),children:c})})},Ed=()=>{const t=u("div")(({theme:n})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:n.spacing(6),marginLeft:"auto",marginRight:"auto"})),s=u(k)(({theme:n})=>({fontSize:n.fontSizes.bodySize,marginBottom:n.spacing(2.5)}));return e.jsxs(t,{children:[e.jsx(s,{children:"No groups available. Get started by adding a new group."}),e.jsx(N,{to:"/admin/groups/create-group",component:oe,variant:"outlined",color:"primary",children:"Create your first group"})]})},Ad=u("div")(({theme:t})=>({display:"flex",flexDirection:"column","& > span:first-of-type":{color:t.palette.text.secondary}})),Rd=u("div")(({theme:t})=>({paddingLeft:t.spacing(1)})),Dd=u("div")(({theme:t})=>({display:"flex",marginBottom:t.spacing(3),"& > div:first-of-type":{width:"100%",maxWidth:t.spacing(50),marginRight:t.spacing(1)}})),Id=u("li")({width:"100%"}),Pd=(t,s,{selected:n})=>d.createElement(Id,{...t,key:s.id},e.jsx(as,{icon:e.jsx(Ei,{fontSize:"small"}),checkedIcon:e.jsx(Ai,{fontSize:"small"}),style:{marginRight:8},checked:n}),e.jsxs(Ad,{children:[e.jsx("span",{children:s.name||s.username}),e.jsx("span",{children:s.name&&s.username?s.username:s.email})]})),Ld=t=>e.jsx(Rd,{children:t.length>1?`${t.length} users selected`:t[0].name||t[0].username||t[0].email}),Ca=({users:t,setUsers:s})=>{const{users:n,loading:o}=Se(),{serviceAccounts:a,loading:i}=Lt(),r=o||i,l=r?[]:[...n.map(c=>({...c,type:"USERS"})).sort((c,m)=>{const h=c.name||c.username||"",p=m.name||m.username||"";return h.localeCompare(p)}),...a.map(c=>({...c,type:"SERVICE ACCOUNTS"})).sort((c,m)=>{const h=c.name||c.username||"",p=m.name||m.username||"";return h.localeCompare(p)})];return l.length>200,e.jsx(Dd,{children:e.jsx(Ti,{"data-testid":ki,size:"small",limitTags:1,openOnFocus:!0,multiple:!0,disableCloseOnSelect:!0,value:t,onChange:(c,m,h)=>{c.type==="keydown"&&c.key==="Backspace"&&h==="removeOption"||s(m)},options:l,groupBy:c=>c.type,renderOption:Pd,filterOptions:(c,{inputValue:m})=>c.filter(({name:h,username:p,email:g})=>vs(m,g)||vs(m,h)||vs(m,p)),isOptionEqualToValue:(c,m)=>c.id===m.id,getOptionLabel:c=>c.email||c.name||c.username||"",renderInput:c=>e.jsx(ee,{...c,label:"Select users"}),renderTags:c=>Ld(c),noOptionsText:r?"Loading…":"No options"})})},wa=({users:t,setUsers:s})=>{const n=d.useMemo(()=>[{Header:"Avatar",accessor:"imageUrl",Cell:({row:{original:l}})=>e.jsx(ae,{children:e.jsx(Je,{user:l})}),maxWidth:85,disableSortBy:!0},{id:"name",Header:"Name",accessor:l=>l.name||"",Cell:({value:l,row:{original:c}})=>e.jsx(ve,{value:l,subtitle:c.email||c.username}),minWidth:100,searchable:!0},{Header:"Action",id:"Action",align:"center",Cell:({row:{original:l}})=>e.jsx(Kt,{children:e.jsx(Te,{title:"Remove user from group",arrow:!0,describeChild:!0,children:e.jsx($e,{onClick:()=>s(c=>c.filter(m=>m.id!==l.id)),children:e.jsx(Le,{})})})}),maxWidth:100,disableSortBy:!0},{accessor:l=>l.username||"",Header:"Username",searchable:!0},{accessor:l=>l.email||"",Header:"Email",searchable:!0}],[s]),[o]=d.useState(()=>({hiddenColumns:["Username","Email"]})),{headerGroups:a,rows:i,prepareRow:r}=z.useTable({columns:n,data:t,initialState:o,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},z.useSortBy,z.useFlexLayout);return e.jsx(T,{condition:i.length>0,show:e.jsx(be,{rows:i,headerGroups:a,prepareRow:r})})},dn=(t="",s="",n=[],o=[],a=null)=>{const r=Mo().get("name"),[l,c]=d.useState(r||t),[m,h]=d.useState(s),[p,g]=d.useState(n),[x,j]=d.useState(o),[b,y]=d.useState(a),[C,A]=d.useState({});return{name:l,setName:c,description:m,setDescription:h,mappingsSSO:p,setMappingsSSO:g,users:x,setUsers:j,getGroupPayload:()=>({name:l,description:m,mappingsSSO:p,users:x.map(({id:S})=>({user:{id:S}})),rootRole:b||void 0}),clearErrors:()=>{A({})},errors:C,setErrors:A,rootRole:b,setRootRole:y}},Bd=u("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),Ud=u("p")(({theme:t})=>({color:t.palette.text.secondary,marginBottom:t.spacing(1)})),Od=u("div")(()=>({marginTop:"auto",display:"flex",justifyContent:"flex-end"})),$d=u(N)(({theme:t})=>({marginLeft:t.spacing(3)})),_d=u(M)(({theme:t})=>({marginTop:t.spacing(2)})),Ta=({open:t,setOpen:s,group:n})=>{const{refetchGroup:o}=us(n.id),{refetchGroups:a}=Ve(),{updateGroup:i,loading:r}=ht(),{setToastData:l,setToastApiError:c}=K(),{uiConfig:m}=F(),{users:h,setUsers:p,getGroupPayload:g}=dn(n.name,n.description,n.mappingsSSO,n.users,n.rootRole);d.useEffect(()=>{p(n.users)},[n.users,t,p]);const x=async b=>{b.preventDefault();try{await i(n.id,g()),o(),a(),s(!1),l({text:"Group users saved successfully",type:"success"})}catch(y){c(V(y))}},j=()=>`curl --location --request PUT '${m.unleashUrl}/api/admin/groups/${n.id}' \\
7
+ --header 'Authorization: INSERT_API_KEY' \\
8
+ --header 'Content-Type: application/json' \\
9
+ --data-raw '${JSON.stringify(g(),void 0,2)}'`;return e.jsx(is,{open:t,onClose:()=>{s(!1)},label:"Edit users",children:e.jsx(Ee,{loading:r,modal:!0,title:"Edit users",description:"Groups is the best and easiest way to organize users and then use them in projects to assign a specific role in one go to all the users in a group.",documentationLink:"https://docs.getunleash.io/concepts/rbac#user-groups",documentationLinkLabel:"Groups documentation",formatApiCode:j,children:e.jsxs(Bd,{onSubmit:x,children:[e.jsxs("div",{children:[e.jsx(Ud,{children:"Edit users in this group"}),e.jsx(Ca,{users:h,setUsers:p}),e.jsx(wa,{users:h,setUsers:p})]}),e.jsx(Od,{children:e.jsxs(_d,{children:[e.jsx(N,{type:"submit",variant:"contained",color:"primary","data-testid":No,children:"Save"}),e.jsx($d,{onClick:()=>{s(!1)},children:"Cancel"})]})})]})})})},ka=({open:t,setOpen:s,group:n})=>{const{refetchGroups:o}=Ve(),{removeGroup:a}=ht(),{setToastData:i,setToastApiError:r}=K(),l=Ce(),c=async()=>{try{await a(n.id),o(),s(!1),l("/admin/groups"),i({text:"Group removed successfully",type:"success"})}catch(m){r(V(m))}};return e.jsx(X,{open:t,primaryButtonText:"Delete group",secondaryButtonText:"Cancel",onClick:c,onClose:()=>{s(!1)},title:"Delete group?",children:e.jsxs(k,{children:["Do you really want to delete ",e.jsx("strong",{children:n.name}),"? Users who are granted access to projects only via this group will lose access to those projects."]})})},Md=u("div")(({theme:t})=>({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:t.spacing(2),gridAutoRows:"1fr"})),Nd=(t,s)=>{var a,i,r,l,c,m,h;const n=s.toLowerCase(),o={names:(a=t.users)==null?void 0:a.map(p=>{var g;return((g=p.name)==null?void 0:g.toLowerCase())||""}),usernames:(i=t.users)==null?void 0:i.map(p=>{var g;return((g=p.username)==null?void 0:g.toLowerCase())||""}),emails:(r=t.users)==null?void 0:r.map(p=>{var g;return((g=p.email)==null?void 0:g.toLowerCase())||""})};return t.name.toLowerCase().includes(n)||((l=t.description)==null?void 0:l.toLowerCase().includes(n))||((c=o.names)==null?void 0:c.some(p=>p.includes(n)))||((m=o.usernames)==null?void 0:m.some(p=>p.includes(n)))||((h=o.emails)==null?void 0:h.some(p=>p.includes(n)))},Fd=()=>{const t=Ce(),[s,n]=d.useState(!1),[o,a]=d.useState(!1),[i,r]=d.useState(void 0),{groups:l=[],loading:c}=Ve(),[m,h]=Fo(),[p,g]=d.useState(m.get("search")||""),x=me(Be.breakpoints.down("md"));d.useEffect(()=>{const C={};p&&(C.search=p),h(C,{replace:!0})},[p,h]);const j=d.useMemo(()=>{const C=l.sort((A,v)=>A.name.localeCompare(v.name));return p?C.filter(A=>Nd(A,p)):C},[l,p]),b=C=>{r(C),n(!0)},y=C=>{r(C),a(!0)};return e.jsxs(se,{isLoading:c,header:e.jsx(ne,{title:`Groups (${j.length})`,actions:e.jsxs(e.Fragment,{children:[e.jsx(T,{condition:!x,show:e.jsxs(e.Fragment,{children:[e.jsx(ue,{initialValue:p,onChange:g}),e.jsx(ne.Divider,{})]})}),e.jsx(Zs,{onClick:()=>t("/admin/groups/create-group"),maxWidth:"700px",Icon:rs,permission:Q,"data-testid":Ri,children:"New group"})]}),children:e.jsx(T,{condition:x,show:e.jsx(ue,{initialValue:p,onChange:g})})}),children:[e.jsx(Ne,{value:p,children:e.jsx(Md,{children:j.map(C=>e.jsx(kd,{group:C,onEditUsers:b,onRemoveGroup:y},C.id))})}),e.jsx(T,{condition:!c&&j.length===0,show:e.jsx(T,{condition:(p==null?void 0:p.length)>0,show:e.jsxs(le,{children:["No groups found matching “",p,"”"]}),elseShow:e.jsx(Ed,{})})}),e.jsx(T,{condition:!!i,show:e.jsx(Ta,{open:s,setOpen:n,group:i})}),e.jsx(T,{condition:!!i,show:e.jsx(ka,{open:o,setOpen:a,group:i})})]})},Gd=u("div")(({theme:t})=>({display:"flex",marginBottom:t.spacing(1),"& > div:first-of-type":{width:"100%",marginRight:t.spacing(1),"& > div:first-of-type":{width:"100%"}}})),Wd=({label:t,value:s,onChange:n,...o})=>{const[a,i]=d.useState(""),r=()=>{n(c=>[...c,a]),i("")},l=c=>{n(m=>m.filter(h=>h!==c))};return e.jsxs("div",{...o,children:[e.jsxs(Gd,{children:[e.jsx(Ke,{label:t,value:a,onChange:c=>i(c.target.value),onKeyPress:c=>{c.key==="Enter"&&r()}}),e.jsx(N,{startIcon:e.jsx(rs,{}),onClick:r,variant:"outlined",color:"primary",disabled:!a.trim()||s.includes(a),children:"Add"})]}),e.jsx(Di,{flexDirection:"row",flexWrap:"wrap",gap:1,children:s==null?void 0:s.map((c,m)=>e.jsx(Ii,{label:c,onDelete:()=>l(c)},m))})]})},zd=u("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),jt=u("p")(({theme:t})=>({color:t.palette.text.secondary,marginBottom:t.spacing(1)})),Gn=u(Ke)(({theme:t})=>({width:"100%",maxWidth:t.spacing(60),marginBottom:t.spacing(2)})),Hd=u(Wd)(({theme:t})=>({width:"100%",maxWidth:t.spacing(60),marginBottom:t.spacing(2)})),qd=u("div")(({theme:t})=>({marginBottom:t.spacing(6)})),Vd=u("div")(()=>({marginTop:"auto",display:"flex",justifyContent:"flex-end"})),Yd=u(N)(({theme:t})=>({marginLeft:t.spacing(3)})),Jd=u("div")(({theme:t})=>({width:"100%",maxWidth:t.spacing(60),padding:t.spacing(3),backgroundColor:t.palette.neutral.light,color:t.palette.text.primary,fontSize:t.fontSizes.smallBody,borderRadius:t.shape.borderRadiusMedium,marginBottom:t.spacing(2),a:{color:t.palette.links}})),Kd=u("div")(({theme:t})=>({"& > div:first-of-type":{width:"100%",maxWidth:t.spacing(50),marginBottom:t.spacing(2)}})),Ea=({name:t,description:s,mappingsSSO:n,users:o,rootRole:a,isScimGroup:i,setName:r,setDescription:l,setMappingsSSO:c,setUsers:m,handleSubmit:h,handleCancel:p,setRootRole:g,errors:x,mode:j,children:b})=>{const{config:y}=nt("oidc"),{config:C}=nt("saml"),{roles:A}=Se(),v=(y==null?void 0:y.enabled)&&y.enableGroupSyncing||(C==null?void 0:C.enabled)&&C.enableGroupSyncing,R=S=>A.find(L=>L.id===S)||null;return e.jsxs(zd,{onSubmit:h,children:[e.jsxs("div",{children:[e.jsx(jt,{children:"What would you like to call your group?"}),e.jsx(Gn,{autoFocus:!0,label:"Name",id:"group-name",error:!!x.name,errorText:x.name,value:t,onChange:S=>r(S.target.value),"data-testid":Pi,required:!0,disabled:i}),e.jsx(jt,{children:"How would you describe your group?"}),e.jsx(Gn,{multiline:!0,rows:4,label:"Description",placeholder:"A short description of the group",value:s,onChange:S=>l(S.target.value),"data-testid":Li}),e.jsx(T,{condition:v&&!i,show:e.jsxs(e.Fragment,{children:[e.jsx(jt,{children:"Is this group associated with SSO groups?"}),e.jsx(Hd,{label:"SSO group ID / name",value:n,onChange:c})]}),elseShow:()=>e.jsxs(Jd,{children:[e.jsxs(M,{sx:{display:"flex"},children:["You can enable SSO groups synchronization if needed",e.jsx(tt,{tooltip:"SSO groups synchronization allows SSO groups to be mapped to Unleash groups, so that user group membership is properly synchronized."})]}),e.jsx(oe,{"data-loading":!0,to:"/admin/auth",children:e.jsx("span",{"data-loading":!0,children:"View SSO configuration"})})]})}),e.jsx(jt,{children:e.jsxs(M,{sx:{display:"flex"},children:["Do you want to associate a root role with this group?",e.jsx(tt,{tooltip:"When you associate a root role with this group, users in this group will automatically inherit the role globally."})]})}),e.jsx(Kd,{children:e.jsx(ps,{"data-testid":"GROUP_ROOT_ROLE",roles:A,value:R(a),setValue:S=>g((S==null?void 0:S.id)||null)})}),e.jsx(T,{condition:j==="Create",show:e.jsxs(e.Fragment,{children:[e.jsx(jt,{children:"Add users to this group"}),e.jsx(Ca,{users:o,setUsers:m}),e.jsx(qd,{children:e.jsx(wa,{users:o,setUsers:m})})]})})]}),e.jsxs(Vd,{children:[b,e.jsx(Yd,{onClick:p,children:"Cancel"})]})]})},Zd=()=>{const{setToastData:t,setToastApiError:s}=K(),{uiConfig:n}=F(),o=Ce(),{name:a,setName:i,description:r,setDescription:l,mappingsSSO:c,setMappingsSSO:m,users:h,setUsers:p,rootRole:g,setRootRole:x,getGroupPayload:j,clearErrors:b,errors:y,setErrors:C}=dn(),{groups:A}=Ve(),{createGroup:v,loading:R}=ht(),S=async E=>{if(E.preventDefault(),b(),!P)return;const D=j();try{const I=await v(D);o(`/admin/groups/${I.id}`),t({text:"Group created successfully",type:"success"})}catch(I){s(V(I))}},L=()=>`curl --location --request POST '${n.unleashUrl}/api/admin/groups' \\
10
+ --header 'Authorization: INSERT_API_KEY' \\
11
+ --header 'Content-Type: application/json' \\
12
+ --data-raw '${JSON.stringify(j(),void 0,2)}'`,B=()=>{o(Pe)},w=E=>E.length,H=E=>!(A!=null&&A.filter(D=>D.name===E).length),P=w(a)&&H(a),O=E=>{b(),H(E)||C({name:"A group with that name already exists."}),i(E)};return e.jsx(Ee,{loading:R,title:"Create group",description:"Groups is the best and easiest way to organize users and then use them in projects to assign a specific role in one go to all the users in a group.",documentationLink:"https://docs.getunleash.io/concepts/rbac#user-groups",documentationLinkLabel:"Groups documentation",formatApiCode:L,children:e.jsx(Ea,{name:a,description:r,mappingsSSO:c,rootRole:g,users:h,setName:O,setDescription:l,setMappingsSSO:m,setRootRole:x,setUsers:p,errors:y,handleSubmit:S,handleCancel:B,mode:Bi,isScimGroup:!1,children:e.jsx(N,{type:"submit",variant:"contained",color:"primary",disabled:!P,"data-testid":Ui,children:"Create group"})})})},Qd=()=>{const t=Number(ls("groupId")),{group:s,refetchGroup:n}=us(t);return s?e.jsx(Xd,{group:s,groupId:t,refetchGroup:n}):null},Xd=({group:t,groupId:s,refetchGroup:n})=>{const{refetchGroups:o}=Ve(),{setToastData:a,setToastApiError:i}=K(),{uiConfig:r}=F(),l=Ce(),{settings:{enabled:c}}=Ut(),m=c&&!!(t!=null&&t.scimId),{name:h,setName:p,description:g,setDescription:x,mappingsSSO:j,setMappingsSSO:b,users:y,setUsers:C,rootRole:A,setRootRole:v,getGroupPayload:R,clearErrors:S,errors:L,setErrors:B}=dn(t==null?void 0:t.name,t==null?void 0:t.description,t==null?void 0:t.mappingsSSO,t==null?void 0:t.users,t==null?void 0:t.rootRole),{groups:w}=Ve(),{updateGroup:H,loading:P}=ht(),O=async $=>{$.preventDefault(),S();const W=R();try{await H(s,W),n(),o(),l(Pe),a({text:"Group updated successfully",type:"success"})}catch(ge){i(V(ge))}},E=()=>`curl --location --request PUT '${r.unleashUrl}/api/admin/groups/${s}' \\
13
+ --header 'Authorization: INSERT_API_KEY' \\
14
+ --header 'Content-Type: application/json' \\
15
+ --data-raw '${JSON.stringify(R(),void 0,2)}'`,D=()=>{l(Pe)},I=$=>$.length,G=$=>!(w!=null&&w.filter(W=>W.name===$&&W.id!==s).length),Z=I(h)&&G(h),U=$=>{S(),G($)||B({name:"A group with that name already exists."}),p($)};return e.jsx(Ee,{loading:P,title:"Edit group",description:"Groups is the best and easiest way to organize users and then use them in projects to assign a specific role in one go to all the users in a group.",documentationLink:"https://docs.getunleash.io/concepts/rbac#user-groups",documentationLinkLabel:"Groups documentation",formatApiCode:E,children:e.jsx(Ea,{name:h,description:g,mappingsSSO:j,users:y,rootRole:A,setName:U,setDescription:x,setMappingsSSO:b,setUsers:C,setRootRole:v,errors:L,handleSubmit:O,handleCancel:D,mode:Qs,isScimGroup:m,children:e.jsx(Te,{title:m?Tt:"",arrow:!0,children:e.jsx("div",{children:e.jsx(N,{type:"submit",variant:"contained",color:"primary",disabled:!Z,"data-testid":No,children:"Save"})})})})})},eu=u(Ye)(({theme:t})=>({borderRadius:t.shape.borderRadiusLarge,padding:t.spacing(2.5,4),boxShadow:"none",marginBottom:t.spacing(2),fontSize:t.fontSizes.smallBody})),tu=u("div")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between"})),su=u("div")(({theme:t})=>({display:"flex"})),nu=u("span")(({theme:t})=>({color:t.palette.text.secondary,fontSize:t.fontSizes.smallBody,marginLeft:t.spacing(1)})),ou=({title:t,description:s,actions:n})=>(Zt(t),e.jsxs(eu,{children:[e.jsxs(tu,{children:[e.jsx(k,{variant:"h1",component:"h1",children:t}),e.jsx(su,{children:n})]}),e.jsx(T,{condition:!!(s!=null&&s.length),show:e.jsxs(e.Fragment,{children:["Description:",e.jsx(nu,{children:s})]})})]})),au=({open:t,setOpen:s,user:n,group:o})=>{const{refetchGroup:a}=us(o.id),{updateGroup:i}=ht(),{setToastData:r,setToastApiError:l}=K(),c=async()=>{try{const h={...o,users:o.users.filter(({id:p})=>p!==(n==null?void 0:n.id)).map(({id:p})=>({user:{id:p}}))};await i(o.id,h),a(),s(!1),r({text:"User removed from group successfully",type:"success"})}catch(h){l(V(h))}},m=(n==null?void 0:n.name)||(n==null?void 0:n.username)||(n==null?void 0:n.email);return e.jsx(X,{open:t&&!!n,primaryButtonText:"Remove user",secondaryButtonText:"Cancel",onClick:c,onClose:()=>{s(!1)},title:"Remove user from group?",children:e.jsxs(k,{children:["Do you really want to remove ",e.jsx("strong",{children:m})," from"," ",e.jsx("strong",{children:o.name}),"? ",e.jsx("strong",{children:m})," will lose all access rights granted by this group."]})})},iu=Array(15).fill({name:"Name of the user",username:"Username of the user"}),ru={id:"joinedAt",desc:!0},{value:Wn,setValue:lu}=Oi("Group:v1",ru),cu=()=>{const t=Number(ls("groupId")),s=It(),n=me(s.breakpoints.down("md")),{group:o,loading:a}=us(t),[i,r]=d.useState(!1),[l,c]=d.useState(!1),[m,h]=d.useState(!1),[p,g]=d.useState(),{settings:{enabled:x}}=Ut(),j=x&&!!(o!=null&&o.scimId),b=d.useMemo(()=>[{Header:"Avatar",accessor:"imageUrl",Cell:({row:{original:D}})=>e.jsx(ae,{children:e.jsx(Je,{user:D})}),maxWidth:85,disableSortBy:!0},{id:"name",Header:"Name",accessor:D=>D.name||"",Cell:({value:D,row:{original:I}})=>e.jsx(ve,{value:D,subtitle:I.email||I.username}),minWidth:100,searchable:!0},{Header:"Joined",accessor:"joinedAt",Cell:je,maxWidth:150},{id:"createdBy",Header:"Added by",accessor:"createdBy",Cell:ve,minWidth:90,searchable:!0},{Header:"Last login",accessor:"seenAt",Cell:Me,maxWidth:150},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:D}})=>e.jsx(Kt,{children:e.jsx(Te,{title:j?Tt:"Remove user from group",arrow:!0,describeChild:!0,children:e.jsx("span",{children:e.jsx($e,{"data-testid":`${$i}-${D.id}`,onClick:()=>{g(D),h(!0)},disabled:j,children:e.jsx(Le,{})})})})}),maxWidth:100,disableSortBy:!0},{accessor:D=>D.username||"",Header:"Username",searchable:!0},{accessor:D=>D.email||"",Header:"Email",searchable:!0}],[g,h]),[y,C]=Fo(),[A]=d.useState(()=>({sortBy:[{id:y.get("sort")||Wn.id,desc:y.has("order")?y.get("order")==="desc":Wn.desc}],hiddenColumns:["Username","Email"],globalFilter:y.get("search")||""})),[v,R]=d.useState(A.globalFilter),{data:S,getSearchText:L,getSearchContext:B}=dt(b,v,(o==null?void 0:o.users)??[]),w=d.useMemo(()=>(S==null?void 0:S.length)===0&&a?iu:S,[S,a]),{headerGroups:H,rows:P,prepareRow:O,state:{sortBy:E}}=z.useTable({columns:b,data:w,initialState:A,sortTypes:ye,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},z.useSortBy,z.useFlexLayout);return d.useEffect(()=>{const D={};D.sort=E[0].id,E[0].desc&&(D.order="desc"),v&&(D.search=v),C(D,{replace:!0}),lu({id:E[0].id,desc:E[0].desc||!1})},[E,v,C]),e.jsx(T,{condition:!!o,show:e.jsxs(e.Fragment,{children:[e.jsx(ou,{title:o==null?void 0:o.name,description:o==null?void 0:o.description,actions:e.jsxs(e.Fragment,{children:[e.jsx(Ue,{"data-testid":_i,to:`/admin/groups/${t}/edit`,component:oe,"data-loading":!0,permission:Q,tooltipProps:{title:j?Tt:"Edit group"},children:e.jsx(Dt,{})}),e.jsx(Ue,{"data-testid":Mi,"data-loading":!0,onClick:()=>r(!0),permission:Q,tooltipProps:{title:"Delete group"},children:e.jsx(Le,{})})]})}),e.jsxs(se,{isLoading:a,header:e.jsx(ne,{secondary:!0,title:`Users (${P.length<w.length?`${P.length} of ${w.length}`:w.length})`,actions:e.jsxs(e.Fragment,{children:[e.jsx(T,{condition:!n,show:e.jsxs(e.Fragment,{children:[e.jsx(ue,{initialValue:v,onChange:R,hasFilters:!0,getSearchContext:B}),e.jsx(ne.Divider,{})]})}),e.jsx(Zs,{"data-testid":Ni,onClick:()=>{c(!0)},maxWidth:"700px",Icon:rs,permission:Q,disabled:j,tooltipProps:{title:j?Tt:""},children:"Edit users"})]}),children:e.jsx(T,{condition:n,show:e.jsx(ue,{initialValue:v,onChange:R,hasFilters:!0,getSearchContext:B})})}),children:[e.jsx(Ne,{value:L(v),children:e.jsx(be,{rows:P,headerGroups:H,prepareRow:O})}),e.jsx(T,{condition:P.length===0,show:e.jsx(T,{condition:(v==null?void 0:v.length)>0,show:e.jsxs(le,{children:["No users found matching “",v,"” in this group."]}),elseShow:e.jsx(le,{children:"This group is empty. Get started by adding a user to the group."})})}),e.jsx(ka,{open:i,setOpen:r,group:o}),e.jsx(Ta,{open:l,setOpen:c,group:o}),e.jsx(au,{open:m,setOpen:h,user:p,group:o})]})]})})},du=()=>{const{uiConfig:t,isEnterprise:s}=F();return s()||t.flags[Fi]===!0?e.jsx("div",{children:e.jsx(fe,{permissions:De,children:e.jsxs(at,{children:[e.jsx(_,{index:!0,element:e.jsx(Fd,{})}),e.jsx(_,{path:"create-group",element:e.jsx(Zd,{})}),e.jsx(_,{path:":groupId/edit",element:e.jsx(Qd,{})}),e.jsx(_,{path:":groupId",element:e.jsx(cu,{})})]})})}):e.jsx(ot,{feature:"groups",page:!0})},Aa=()=>{const{data:t,error:s,mutate:n}=we(te("api/admin/instance-admin/statistics"),uu);return d.useMemo(()=>({stats:t,loading:!s&&!t,refetchGroup:()=>n(),error:s}),[t,s,n])},uu=t=>fetch(t).then(ce("Instance Stats")).then(s=>s.json()),hu=()=>{var l,c,m;const{stats:t}=Aa(),{uiConfig:{resourceLimits:s}}=F(),n=kt("readOnlyUsersUI");let o,a;t!=null&&t.versionEnterprise?(o="Unleash Enterprise version",a=t.versionEnterprise):(o="Unleash OSS version",a=t==null?void 0:t.versionOSS);const i=Object.values((t==null?void 0:t.apiTokens)??{}).reduce((h,p)=>h+p,0),r=[{title:"Instance Id",value:t==null?void 0:t.instanceId,offset:!1},{title:o,value:a},{title:"Users",value:t==null?void 0:t.users},{title:"Feature flags",value:t==null?void 0:t.featureToggles},{title:"Projects",value:t==null?void 0:t.projects},{title:"Environments",value:t==null?void 0:t.environments},{title:"Roles",value:t==null?void 0:t.roles},{title:"Groups",value:t==null?void 0:t.groups},{title:"Context fields",value:t==null?void 0:t.contextFields},{title:"Strategies",value:t==null?void 0:t.strategies},{title:"Feature exports",value:t==null?void 0:t.featureExports},{title:"Feature imports",value:t==null?void 0:t.featureImports},{title:"Admin API tokens",value:(l=t==null?void 0:t.apiTokens)==null?void 0:l.admin},{title:"Client API tokens",value:(c=t==null?void 0:t.apiTokens)==null?void 0:c.client},{title:"Frontend API tokens",value:(m=t==null?void 0:t.apiTokens)==null?void 0:m.frontend},{title:"API tokens total",value:i},{title:"Segments",value:t==null?void 0:t.segments},{title:"Highest number of strategies used for a single flag in a single environment",value:t==null?void 0:t.maxEnvironmentStrategies},{title:"Highest number of constraints used on a single strategy",value:t==null?void 0:t.maxConstraints},{title:"Highest number of values used for a single constraint",value:t==null?void 0:t.maxConstraintValues},{title:"Release templates",value:t==null?void 0:t.releaseTemplates},{title:"Release plans",value:t==null?void 0:t.releasePlans}];return t!=null&&t.versionEnterprise&&(r.push({title:"SAML enabled",value:t!=null&&t.SAMLenabled?"Yes":"No"},{title:"OIDC enabled",value:t!=null&&t.OIDCenabled?"Yes":"No"}),n&&s.readOnlyUsers&&r.push({title:"ReadOnly users",value:t==null?void 0:t.readOnlyUsers})),e.jsx(se,{header:e.jsx(ne,{title:"Instance Statistics"}),children:e.jsxs(yn,{sx:{display:"grid",gap:4},children:[e.jsxs(Io,{"aria-label":"Instance statistics",children:[e.jsx(Po,{children:e.jsxs(Et,{children:[e.jsx(de,{children:"Field"}),e.jsx(de,{align:"right",children:"Value"})]})}),e.jsx(Js,{children:r.map(h=>e.jsxs(Et,{children:[e.jsx(de,{component:"th",scope:"row",children:e.jsx(yn,{component:"span",sx:p=>({marginLeft:h.offset?p.spacing(2):0}),children:h.title})}),e.jsx(de,{align:"right",children:h.value})]},h.title))})]}),e.jsx("span",{style:{textAlign:"center"},children:e.jsx(N,{startIcon:e.jsx(Go,{}),"aria-label":"Download instance statistics",color:"primary",variant:"contained",target:"_blank",rel:"noreferrer",href:te("/api/admin/instance-admin/statistics/csv"),children:"Download"})})]})})},pu=()=>e.jsx("div",{children:e.jsx(hu,{})}),mu=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",padding:t.spacing(3),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadiusLarge})),xu=u(M)(()=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"})),gu=u(M)(({theme:t})=>({color:t.palette.text.secondary,fontSize:t.fontSizes.smallBody,marginTop:t.spacing(2)})),ju=u("p")(({theme:t})=>({display:"table-cell",fontWeight:t.fontWeight.bold,paddingTop:t.spacing(2)})),fu=u("p")(({theme:t})=>({display:"table-cell",paddingTop:t.spacing(2),paddingLeft:t.spacing(4)})),yu=u("div")(({theme:t})=>({display:"table-cell",width:"75%",paddingTop:t.spacing(2),paddingBottom:t.spacing(2)})),bu=u("div")(({theme:t})=>({display:"table-cell"})),Su=u("span")(({theme:t})=>({display:"block",textAlign:"right",color:t.palette.neutral.dark})),vu=u("div")(({theme:t})=>({maxWidth:t.spacing(50),color:t.palette.text.secondary,fontSize:t.fontSizes.smallBody})),Cu=u("div")(()=>({display:"table-row"})),zn=u("div")(()=>({display:"table"})),wu=u("div")(()=>({display:"table-cell"})),Tu=({changeInfoText:t,variablesText:s,dependsOnText:n})=>e.jsxs(vu,{children:[e.jsx(Hn,{children:t}),e.jsx(ku,{children:e.jsx("div",{children:s})}),e.jsx(T,{condition:!!n,show:e.jsx(Hn,{children:n})})]}),ku=u("code")(({theme:t})=>({display:"block",color:t.palette.text.primary,backgroundColor:t.palette.background.application,fontSize:t.fontSizes.smallerBody,marginTop:t.spacing(1),padding:t.spacing(1),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius,borderWidth:1,wordWrap:"break-word",whiteSpace:"pre-wrap",fontFamily:"monospace",lineHeight:1.5})),Hn=u("p")(({theme:t})=>({color:t.palette.text.primary,fontSize:t.fontSizes.smallBody,marginTop:t.spacing(1)})),qn=({title:t,infoText:s,concreteDetails:n,enabled:o,changeInfoText:a,variablesText:i,dependsOnText:r})=>e.jsxs(mu,{children:[e.jsxs(xu,{children:[e.jsx("b",{children:t}),e.jsx(bu,{children:e.jsx(T,{condition:o,show:e.jsx(Ie,{color:"success",icon:e.jsx(Vs,{}),children:"Data is collected"}),elseShow:e.jsx(Ie,{color:"neutral",icon:e.jsx(Gi,{}),children:"No data is collected"})})})]}),e.jsxs(gu,{children:[e.jsxs(zn,{children:[e.jsx(yu,{children:s}),e.jsx(wu,{children:e.jsx(Su,{children:e.jsx(os,{tooltip:e.jsx(Tu,{changeInfoText:a,variablesText:i,dependsOnText:r}),children:o?"How to disable collecting data?":"How to enable collecting data?"})})})]}),e.jsx(zn,{children:Object.entries(n).map(([l,c])=>e.jsxs(Cu,{children:[e.jsx(ju,{children:l}),e.jsx(fu,{children:c})]},l))})]})]}),Eu=()=>{const{data:t,error:s,mutate:n}=we(te("api/admin/telemetry/settings"),Au);return d.useMemo(()=>({settings:t,loading:!s&&!t,refetchGroup:()=>n(),error:s}),[t,s,n])},Au=t=>fetch(t).then(ce("Telemetry Settings")).then(s=>s.json()),Ru=u(M)(({theme:t})=>({display:"grid",gap:t.spacing(4)})),Ds={title:"Version data collection",infoText:"We collect the version of Unleash that you're using. We use this information to inform your Unleash instance of latest updates and critical security patches.",concreteDetails:{"Instance ID":"A unique ID generated for your instance",Version:"The version of Unleash that you're using"}},Is={title:"Feature data collection",infoText:"We collect data about your instance to improve the Unleash product user experience. We may also use the data in case you need help from our support team. Data collection is for internal use only and is not shared with third parties outside Unleash. As we want you to be in control of your data, we will leave it up to you to allow us to collect your data.",concreteDetails:{"Feature flags":"The number of feature flags in your instance",Users:"The number of users registered in your instance",Projects:"The number of projects in your instance","Context Fields":"The number of custom context fields in use",Groups:"The number of groups present in your instance",Roles:"The number of custom roles defined in your instance","Custom Root Roles":"The number of custom root roles defined in your instance","Custom Root Roles In Use":"The number of custom root roles that are in use by entities (users, groups, service accounts)",Environments:"The number of environments in your instance",Segments:"The number of segments defined in your instance",Strategies:"The number of strategies defined in your instance","Feature Exports":"The number of feature exports performed","Feature Imports":"The number of feature imports performed","Custom Strategies":"The number of custom strategies defined in your instance","Custom Strategies In Use":"The number of custom strategies that are in use by feature flags"}},Vn={enabled:{environmentVariables:"CHECK_VERSION=false",changeInfoText:"Version info collection can be disabled by setting the environment variable `CHECK_VERSION` to `false` and restarting Unleash."},disabled:{environmentVariables:"CHECK_VERSION=true",changeInfoText:"Version info collection can be enabled by setting the environment variable to true and restarting Unleash."}},Yn={enabled:{environmentVariables:"SEND_TELEMETRY=false",changeInfoText:"Feature usage collection can be disabled by setting the environment variable to false and restarting Unleash."},disabled:{environmentVariables:"SEND_TELEMETRY=true",changeInfoText:"To enable feature usage collection set the environment variable to true and restart Unleash."}},Du=()=>{const{settings:t}=Eu(),{loading:s}=F();if(s)return null;const n=t!=null&&t.versionInfoCollectionEnabled?Vn.enabled:Vn.disabled,o=t!=null&&t.featureInfoCollectionEnabled?Yn.enabled:Yn.disabled;let a;return t!=null&&t.versionInfoCollectionEnabled||(a=t!=null&&t.featureInfoCollectionEnabled?"Note: Feature usage collection is enabled, but for it to be active you must also enable version info collection":"When you enable feature usage collection you must also enable version info collection"),e.jsx(se,{header:e.jsx(ne,{title:"Instance Privacy"}),children:e.jsxs(Ru,{children:[e.jsx(qn,{title:Ds.title,infoText:Ds.infoText,concreteDetails:Ds.concreteDetails,enabled:t==null?void 0:t.versionInfoCollectionEnabled,changeInfoText:n.changeInfoText,variablesText:n.environmentVariables}),e.jsx(qn,{title:Is.title,infoText:Is.infoText,concreteDetails:Is.concreteDetails,enabled:(t==null?void 0:t.featureInfoCollectionEnabled)&&(t==null?void 0:t.versionInfoCollectionEnabled),changeInfoText:o.changeInfoText,variablesText:o.environmentVariables,dependsOnText:a})]})})},Iu=()=>e.jsx(Y,{severity:"warning",children:e.jsxs("p",{children:[e.jsx("b",{children:"Heads up!"})," If you enable maintenance mode, edit access in the entire system will be disabled for all the users (admins, editors, custom roles, etc). During this time nobody will be able to do changes or to make new configurations."]})}),Pu=()=>{const{data:t,error:s,mutate:n}=we(te("api/admin/maintenance"),Lu);return d.useMemo(()=>({enabled:!!(t!=null&&t.enabled),loading:!s&&!t,refetchMaintenance:n,error:s}),[t,s,n])},Lu=t=>fetch(t).then(ce("Maintenance")).then(s=>s.json()),Bu=()=>{const{makeRequest:t,createRequest:s,errors:n,loading:o}=xe({propagateErrors:!0});return{toggleMaintenance:async i=>{const l=s("api/admin/maintenance",{method:"POST",body:JSON.stringify(i)});await t(l.caller,l.id)},errors:n,loading:o}},Uu=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",padding:t.spacing(3),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadiusLarge})),Ou=u(M)({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"}),$u=u(M)(({theme:t})=>({color:t.palette.text.secondary,fontSize:t.fontSizes.smallBody,marginTop:t.spacing(2)})),_u=u(k)(({theme:t})=>({fontSize:t.fontSizes.smallBody})),Mu=()=>{const{enabled:t,refetchMaintenance:s}=Pu(),{refetch:n}=F(),{toggleMaintenance:o}=Bu(),{trackEvent:a}=Xs(),{setToastData:i}=K(),r=async()=>{i({type:"success",text:`Maintenance mode has been successfully ${t?"disabled":"enabled"}`}),a("maintenance",{props:{eventType:`maintenance ${t?"de":""}activated`}}),await o({enabled:!t}),s(),n()};return e.jsxs(Uu,{children:[e.jsxs(Ou,{children:[e.jsx("b",{children:"Maintenance Mode"}),e.jsx(re,{sx:{margin:0},control:e.jsx(pe,{onChange:r,value:t,name:"enabled",checked:t}),label:e.jsx(_u,{children:t?"Enabled":"Disabled"})})]}),e.jsx($u,{children:"Maintenance Mode is useful when you want to freeze your system so nobody can do any changes during this time. When enabled it will show a banner at the top of the applications and only an admin can enable it or disable it."})]})},Nu=()=>e.jsx("div",{children:e.jsx(fe,{permissions:[Q,Wi],children:e.jsx(Gu,{})})}),Fu=u(M)(({theme:t})=>({display:"grid",gap:t.spacing(4)})),Gu=()=>{const{loading:t}=F();return t?null:e.jsx(se,{header:e.jsx(ne,{title:"Maintenance"}),children:e.jsxs(Fu,{children:[e.jsx(Iu,{}),e.jsx(Mu,{})]})})},Wu=u(oe)(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",textDecoration:"none",color:"inherit",padding:t.spacing(0,5),"&.active":{fontWeight:"bold"}})),Ra=({to:t,children:s})=>e.jsx(Wu,{to:t,children:s}),zu=d.lazy(()=>ut(()=>import("./NetworkOverview-CUmX-taY.js"),[])),Hu=d.lazy(()=>ut(()=>import("./NetworkTraffic-DCMn8UWo.js"),[])),qu=d.lazy(()=>ut(()=>import("./NetworkTrafficUsage-DSZK447X.js"),[])),Vu=d.lazy(()=>ut(()=>import("./BackendConnections-mlK6EAYQ.js"),[])),Yu=d.lazy(()=>ut(()=>import("./FrontendNetworkTrafficUsage-Dq8wwaXR.js"),[])),Jn=[{label:"Overview",path:"/admin/network"},{label:"Traffic",path:"/admin/network/traffic"}],Ju=[{label:"Data Usage",path:"/admin/network/data-usage"}],Ku=[{label:"Backend Connections",path:"/admin/network/backend-connections"},{label:"Frontend Traffic",path:"/admin/network/frontend-data-usage"}],Zu=()=>{const{pathname:t}=Ws(),n=kt("consumptionModelUI")?[...Jn,...Ku]:[...Jn,...Ju];return e.jsx("div",{children:e.jsx(se,{withTabs:!0,header:e.jsx(Wo,{value:t,indicatorColor:"primary",textColor:"primary",variant:"scrollable",allowScrollButtonsMobile:!0,children:n.map(({label:o,path:a})=>e.jsx(zo,{value:a,label:e.jsx(Ra,{to:a,children:e.jsx("span",{children:o})}),sx:{padding:0}},o))}),children:e.jsxs(at,{children:[e.jsx(_,{path:"*",element:e.jsx(zu,{})}),e.jsx(_,{path:"traffic",element:e.jsx(Hu,{})}),e.jsx(_,{path:"connected-edges",element:e.jsx(zs,{to:"/admin/enterprise-edge",replace:!0})}),e.jsx(_,{path:"data-usage",element:e.jsx(qu,{})}),e.jsx(_,{path:"backend-connections",element:e.jsx(Vu,{})}),e.jsx(_,{path:"frontend-data-usage",element:e.jsx(Yu,{})})]})})})},Qu=u(M)(()=>({display:"flex",justifyContent:"center"})),Xu=({role:t,onEdit:s,onDelete:n})=>{const o=Ge.includes(t.type);return e.jsxs(Qu,{children:[e.jsx(Ue,{"data-loading":!0,onClick:s,permission:Q,disabled:o,tooltipProps:{title:o?"You cannot edit a predefined role":"Edit role"},children:e.jsx(Dt,{})}),e.jsx(Ue,{"data-loading":!0,onClick:n,permission:Q,disabled:o,tooltipProps:{title:o?"You cannot remove a predefined role":"Remove role"},children:e.jsx(Le,{})})]})},eh=u(Ie)(({theme:t})=>({marginLeft:t.spacing(1)})),th=({role:t})=>e.jsx(ve,{value:t.name,subtitle:t.description,afterTitle:e.jsx(T,{condition:Ge.includes(t.type),show:e.jsx(eh,{color:"success",children:"Predefined"})})}),sh=({users:t})=>{const[s]=d.useState(()=>({sortBy:[{id:"last-login",desc:!0}]})),n=d.useMemo(()=>[{id:"name",Header:"Name",accessor:r=>r.name||"",minWidth:200,Cell:({row:{original:r}})=>e.jsx(ve,{value:r.name,subtitle:r.email||r.username})},{Header:"Created",accessor:"createdAt",Cell:je,width:120,maxWidth:120},{id:"last-login",Header:"Last login",accessor:"seenAt",Cell:Me,maxWidth:150}],[]),{headerGroups:o,rows:a,prepareRow:i}=z.useTable({columns:n,data:t,initialState:s,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},z.useSortBy,z.useFlexLayout);return e.jsx(be,{rows:a,headerGroups:o,prepareRow:i})},nh=u(k)(({theme:t})=>({fontSize:t.fontSizes.smallerBody})),Da=({serviceAccount:t,value:s,onCreateToken:n})=>{var a,i,r;const{searchQuery:o}=Ks();return!t.tokens||t.tokens.length===0?n?e.jsx(Ho,{title:"Create token",onClick:n}):e.jsx(ae,{children:"0 tokens"}):e.jsx(ae,{children:e.jsx(os,{tooltip:e.jsx(e.Fragment,{children:(a=t.tokens)==null?void 0:a.map(({id:l,description:c})=>e.jsx(nh,{children:e.jsx(Vt,{search:o,children:c})},l))}),highlighted:o.length>0&&s.toLowerCase().includes(o.toLowerCase()),children:((i=t.tokens)==null?void 0:i.length)===1?"1 token":`${(r=t.tokens)==null?void 0:r.length} tokens`})})},oh=({serviceAccounts:t})=>{const[s]=d.useState(()=>({sortBy:[{id:"seenAt",desc:!0}]})),n=d.useMemo(()=>[{id:"name",Header:"Name",accessor:r=>r.name||"",minWidth:200,Cell:({row:{original:r}})=>e.jsx(ve,{value:r.name,subtitle:r.username})},{id:"tokens",Header:"Tokens",accessor:r=>{var l;return((l=r.tokens)==null?void 0:l.map(({description:c})=>c).join(`
16
+ `))||""},Cell:({row:{original:r},value:l})=>e.jsx(Da,{serviceAccount:r,value:l}),maxWidth:100},{Header:"Created",accessor:"createdAt",Cell:je,width:120,maxWidth:120},{id:"seenAt",Header:"Last seen",accessor:r=>{var l;return(l=r.tokens.sort((c,m)=>{const h=new Date(c.seenAt||0),p=new Date(m.seenAt||0);return(p==null?void 0:p.getTime())-(h==null?void 0:h.getTime())})[0])==null?void 0:l.seenAt},Cell:Me,maxWidth:150}],[]),{headerGroups:o,rows:a,prepareRow:i}=z.useTable({columns:n,data:t,initialState:s,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},z.useSortBy,z.useFlexLayout);return e.jsx(be,{rows:a,headerGroups:o,prepareRow:i})},ah=({groups:t})=>{const[s]=d.useState(()=>({sortBy:[{id:"createdAt",desc:!0}]})),n=d.useMemo(()=>[{id:"name",Header:"Name",accessor:r=>r.name||"",minWidth:200,Cell:({row:{original:r}})=>e.jsx(ve,{value:r.name,subtitle:r.description})},{Header:"Created",accessor:"createdAt",Cell:je,width:120,maxWidth:120},{id:"users",Header:"Users",accessor:r=>r.users.length===1?"1 user":`${r.users.length} users`,Cell:ae,maxWidth:150}],[]),{headerGroups:o,rows:a,prepareRow:i}=z.useTable({columns:n,data:t,initialState:s,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},z.useSortBy,z.useFlexLayout);return e.jsx(be,{rows:a,headerGroups:o,prepareRow:i})},Ps=u("div")(({theme:t})=>({marginTop:t.spacing(1.5)})),Ls=u("p")(({theme:t})=>({marginTop:t.spacing(3)})),ih=({role:t,open:s,setOpen:n,onConfirm:o})=>{const{users:a}=Se(),{serviceAccounts:i}=Lt(),{groups:r}=Ve(),l=a.filter(({rootRole:p})=>p===(t==null?void 0:t.id)),c=i.filter(({rootRole:p})=>p===(t==null?void 0:t.id)),m=r==null?void 0:r.filter(({rootRole:p})=>p===(t==null?void 0:t.id)),h=!!(l.length||c.length||m!=null&&m.length);return e.jsx(X,{title:"Delete root role?",open:s,primaryButtonText:"Delete role",secondaryButtonText:"Cancel",disabledPrimaryButton:h,onClick:()=>o(t),onClose:()=>{n(!1)},children:e.jsx(T,{condition:h,show:e.jsxs(e.Fragment,{children:[e.jsx(Y,{severity:"error",children:"You are not allowed to delete a role that is currently in use. Please change the role of the following entities first:"}),e.jsx(T,{condition:!!l.length,show:e.jsxs(e.Fragment,{children:[e.jsxs(Ls,{children:["Users (",l.length,"):"]}),e.jsx(Ps,{children:e.jsx(sh,{users:l})})]})}),e.jsx(T,{condition:!!c.length,show:e.jsxs(e.Fragment,{children:[e.jsxs(Ls,{children:["Service accounts (",c.length,"):"]}),e.jsx(Ps,{children:e.jsx(oh,{serviceAccounts:c})})]})}),e.jsx(T,{condition:!!(m!=null&&m.length),show:e.jsxs(e.Fragment,{children:[e.jsxs(Ls,{children:["Groups (",m==null?void 0:m.length,"):"]}),e.jsx(Ps,{children:e.jsx(ah,{groups:m})})]})})]}),elseShow:e.jsxs("p",{children:["You are about to delete role:"," ",e.jsx("strong",{children:t==null?void 0:t.name})]})})})},rh=t=>{const{isEnterprise:s}=F(),{data:n,error:o,mutate:a}=Qt(s()&&t,{projects:[]},te(`api/admin/projects/roles/${t}/access`),lh);return d.useMemo(()=>({projects:(n==null?void 0:n.projects)??[],loading:!o&&!n,refetch:()=>a(),error:o}),[n,o,a])},lh=t=>fetch(t).then(ce("Project role usage")).then(s=>s.json()),ch=({projects:t})=>{const[s]=d.useState(()=>({sortBy:[{id:"name"}]})),n=d.useMemo(()=>[{id:"name",Header:"Project name",accessor:r=>r.project||"",minWidth:200,Cell:({row:{original:r}})=>e.jsx(Ho,{title:r.project,to:`/projects/${r.project}`})},{id:"users",Header:"Assigned users",accessor:r=>r.userCount===1?"1 user":`${r.userCount} users`,Cell:ae,maxWidth:150},{id:"serviceAccounts",Header:"Service accounts",accessor:r=>r.serviceAccountCount===1?"1 account":`${r.serviceAccountCount} accounts`,Cell:ae,maxWidth:150},{id:"groups",Header:"Assigned groups",accessor:r=>r.groupCount===1?"1 group":`${r.groupCount} groups`,Cell:ae,maxWidth:150}],[]),{headerGroups:o,rows:a,prepareRow:i}=z.useTable({columns:n,data:t,initialState:s,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},z.useSortBy,z.useFlexLayout);return e.jsx(be,{rows:a,headerGroups:o,prepareRow:i})},dh=u("div")(({theme:t})=>({marginTop:t.spacing(1.5)})),uh=u("p")(({theme:t})=>({marginTop:t.spacing(3)})),hh=({role:t,open:s,setOpen:n,onConfirm:o})=>{const{projects:a}=rh(t==null?void 0:t.id),i=!!(a!=null&&a.length);return e.jsx(X,{title:"Delete project role?",open:s,primaryButtonText:"Delete role",secondaryButtonText:"Cancel",disabledPrimaryButton:i,onClick:()=>o(t),onClose:()=>{n(!1)},maxWidth:"md",children:e.jsx(T,{condition:i,show:e.jsxs(e.Fragment,{children:[e.jsx(Y,{severity:"error",children:"You are not allowed to delete a role that is currently in use. Please change the role of the following entities first:"}),e.jsx(T,{condition:!!(a!=null&&a.length),show:e.jsxs(e.Fragment,{children:[e.jsxs(uh,{children:["Role assigned in ",a==null?void 0:a.length," ","projects:"]}),e.jsx(dh,{children:e.jsx(ch,{projects:a})})]})})]}),elseShow:e.jsxs("p",{children:["You are about to delete role:"," ",e.jsx("strong",{children:t==null?void 0:t.name})]})})})},ph="custom",mh=({role:t,open:s,setOpen:n,onConfirm:o})=>(t==null?void 0:t.type)===ph?e.jsx(hh,{role:t,open:s,setOpen:n,onConfirm:o}):e.jsx(ih,{role:t,open:s,setOpen:n,onConfirm:o}),Ia=()=>{const{loading:t,makeRequest:s,createRequest:n,errors:o}=xe({propagateErrors:!0});return{addRole:async c=>{const h=n("api/admin/roles",{method:"POST",body:JSON.stringify(c)},"addRole");return(await s(h.caller,h.id)).json()},updateRole:async(c,m)=>{const p=n(`api/admin/roles/${c}`,{method:"PUT",body:JSON.stringify(m)},"updateRole");await s(p.caller,p.id)},removeRole:async c=>{const h=n(`api/admin/roles/${c}`,{method:"DELETE"},"removeRole");await s(h.caller,h.id)},validateRole:async c=>{const h=n("api/admin/roles/validate",{method:"POST",body:JSON.stringify(c)},"validateRole");await s(h.caller,h.id)},errors:o,loading:t}},Kn={name:void 0,description:void 0,permissions:void 0},xh=(t="",s="",n=[])=>{const{roles:o,projectRoles:a}=Bt(),[i,r]=d.useState(t),l=E=>r(E.trim()),[c,m]=d.useState(s),[h,p]=d.useState({}),[g,x]=d.useState(Kn),[j,b]=d.useState(!1);d.useEffect(()=>{r(t)},[t]),d.useEffect(()=>{m(s)},[s]),d.useEffect(()=>{const E=bn(n);p(E)},[n.length]);const y=(E=Oe)=>({name:i,description:c,type:E===Oe?"root-custom":"custom",permissions:Object.values(h).map(({name:D,environment:I})=>({name:D,environment:I}))}),C=E=>![...o,...a].some(D=>D.name!==t&&D.name.toLowerCase()===E.toLowerCase()),A=E=>E.length,v=E=>Object.keys(E).length>0,R=E=>{x(D=>({...D,[E]:void 0}))},S=(E,D)=>{x(I=>({...I,[E]:D}))},L=E=>{const D=E.trim();return A(D)?C(D)?(R("name"),!0):(S("name","Name must be unique."),!1):(S("name","Name is required."),!1)},B=E=>{const D=E.trim();return A(D)?(R("description"),!0):(S("description","Description is required."),!1)},w=E=>v(E)?(R("permissions"),!0):(S("permissions","You must select at least one permission."),!1),H=()=>{const E=L(i),D=B(c),I=w(h);return b(!0),E&&D&&I},P=j&&Object.values(g).some(Boolean);return{name:i,setName:l,validateName:L,description:c,setDescription:m,validateDescription:B,checkedPermissions:h,setCheckedPermissions:p,validatePermissions:w,getRolePayload:y,errors:g,showErrors:P,validate:H,reload:()=>{r(t),m(s),p(bn(n)),b(!1),x(Kn)}}};var un={},gh=ct;Object.defineProperty(un,"__esModule",{value:!0});var Pa=un.default=void 0,jh=gh(lt()),fh=e,yh=(0,jh.default)((0,fh.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-6 10H6v-2h8v2zm4-4H6v-2h12v2z"}),"Topic");Pa=un.default=yh;const bh=({permissions:t,checkedPermissions:s,onPermissionChange:n})=>e.jsx(M,{display:"grid",gridTemplateColumns:{sm:"1fr 1fr",xs:"1fr"},children:t==null?void 0:t.map(o=>e.jsx(re,{"data-testid":st(o),control:e.jsx(as,{checked:!!s[st(o)],onChange:()=>n(o),color:"primary"}),label:o.displayName},st(o)))}),La=t=>{const s=(t==null?void 0:t.map(i=>st(i)).sort())||[],n=Sn.flatMap(i=>i.permissions.map(([r])=>r)).sort(),o=s.filter(i=>!n.includes(i));return[...Sn,{label:"Other",permissions:o.map(i=>[i])}].map(i=>({label:i.label,permissions:i.permissions.filter(([r])=>s.includes(r)).map(([r,l])=>[t.find(c=>st(c)===r),l])})).filter(i=>i.permissions.length>0)},Sh=({permission:t,onChange:s,isChecked:n,hasParentPermission:o,isParentPermissionChecked:a})=>e.jsx(M,{sx:i=>({marginLeft:o?i.spacing(1.5):0}),children:e.jsx(re,{"data-testid":t,control:e.jsx(as,{checked:!!(n||a),onChange:s,color:"primary",disabled:a}),label:t.displayName},t.name)}),vh=u("div")(({theme:t})=>({display:"grid",gridTemplateColumns:"1fr 1fr",gap:t.spacing(1),[t.breakpoints.down("md")]:{gridTemplateColumns:"1fr"}})),Ch=u(k)(({theme:t})=>({fontWeight:t.typography.fontWeightBold,marginTop:t.spacing(2),marginBottom:t.spacing(1)})),wh=({permissions:t,checkedPermissions:s,onPermissionChange:n})=>{const o=d.useMemo(()=>La(t),[t]);return e.jsx(vh,{children:o.map(a=>e.jsxs("div",{children:[e.jsx(Ch,{children:a.label}),e.jsx("div",{children:a.permissions.map(([i,r])=>e.jsx(Sh,{permission:i,onChange:()=>n(i),isChecked:!!s[i.name],hasParentPermission:!!r,isParentPermissionChecked:!!(r&&s[r])}))})]}))})},Th=u(M)(({theme:t})=>({display:"flex",alignItems:"center",[t.breakpoints.down(500)]:{flexDirection:"column",alignItems:"flex-start"}})),kh=u(zi)(({theme:t})=>({fontWeight:t.typography.fontWeightBold,marginRight:t.spacing(1)})),Eh=({title:t,permissions:s,checkedPermissions:n,Icon:o,isInitiallyExpanded:a=!1,context:i,children:r,onCheckAll:l})=>{const[c,m]=d.useState(a),h=d.useMemo(()=>(s==null?void 0:s.reduce((x,j)=>(x[st(j)]=!0,x),{}))||{},[s]),p=d.useMemo(()=>Object.keys(n).filter(x=>h[x]).length||0,[n,h]),g=d.useMemo(()=>p===(s==null?void 0:s.length),[p,s]);return e.jsx(M,{sx:{my:2,pb:1},children:e.jsxs(es,{expanded:c,onChange:()=>m(!c),sx:{boxShadow:"none",px:3,py:1,border:x=>`1px solid ${x.palette.divider}`,borderRadius:x=>`${x.shape.borderRadiusLarge}px`},children:[e.jsx(ts,{expandIcon:e.jsx($e,{children:e.jsx(ss,{titleAccess:"Toggle"})}),sx:{boxShadow:"none",padding:"0"},children:e.jsxs(Th,{children:[o,e.jsx(kh,{text:t,maxWidth:"120",maxLength:25})," ",e.jsxs(k,{variant:"body2",color:"text.secondary",children:["(",p," / ",s==null?void 0:s.length," ","permissions)"]})]})}),e.jsxs(ns,{sx:{px:0,py:1,flexWrap:"wrap"},children:[e.jsx(it,{sx:{mb:1}}),e.jsxs(N,{variant:"text",size:"small",onClick:l,sx:{fontWeight:x=>x.typography.fontWeightRegular},children:[g?"Unselect ":"Select ","all ",i," permissions"]}),r]})]})})},Ah=({type:t,checkedPermissions:s,setCheckedPermissions:n,validatePermissions:o})=>{const{permissions:a}=Hi({revalidateIfStale:!1,revalidateOnReconnect:!1,revalidateOnFocus:!1}),i=ko.includes(t),r=d.useMemo(()=>i?qo(qi(a.project,a.environments)):Vo(a.root),[a,i]),l=m=>{const h=Zi(s,m);o(h),n(h)},c=m=>{const h=Qi(s,m);o(h),n(h)};return d.useMemo(()=>e.jsx(e.Fragment,{children:r.map(({label:m,type:h,permissions:p})=>e.jsx(Eh,{title:m,context:m.toLowerCase(),Icon:h===Vi?e.jsx(Pa,{color:"disabled",sx:{mr:1}}):h===Yi?e.jsx(Ji,{color:"disabled",sx:{mr:1}}):e.jsx(Ki,{color:"disabled",sx:{mr:1}}),permissions:p,checkedPermissions:s,onCheckAll:()=>c(p),children:h==="project"?e.jsx(wh,{permissions:p,checkedPermissions:s,onPermissionChange:l}):e.jsx(bh,{permissions:p,checkedPermissions:s,onPermissionChange:l})},m))}),[r,s])},Bs=u("p")(({theme:t})=>({display:"flex",color:t.palette.text.primary,marginBottom:t.spacing(1),"&:not(:first-of-type)":{marginTop:t.spacing(4)}})),Rh=u(Ke)(({theme:t})=>({width:"100%",maxWidth:t.spacing(50)})),Dh=u(Ke)({width:"100%"}),Ih=({type:t=Oe,name:s,setName:n,description:o,setDescription:a,checkedPermissions:i,setCheckedPermissions:r,errors:l,showErrors:c,validateName:m,validateDescription:h,validatePermissions:p})=>{const g=x=>{setTimeout(()=>x(),300)};return e.jsxs("div",{children:[e.jsx(Bs,{children:"What is your new role name?"}),e.jsx(Rh,{autoFocus:!0,label:"Role name *",error:!!l.name,errorText:l.name,value:s,onChange:x=>{m(x.target.value),n(x.target.value)},onBlur:x=>g(()=>m(x.target.value)),autoComplete:"off"}),e.jsx(Bs,{children:"What is your new role description?"}),e.jsx(Dh,{label:"Role description *",error:!!l.description,errorText:l.description,value:o,onChange:x=>{h(x.target.value),a(x.target.value)},onBlur:x=>g(()=>h(x.target.value)),autoComplete:"off"}),e.jsx(Bs,{children:"What is your role allowed to do?"}),e.jsx(Y,{severity:"info",children:"You must select at least one permission."}),e.jsx(Ah,{type:t,checkedPermissions:i,setCheckedPermissions:r,validatePermissions:p}),e.jsx(T,{condition:c,show:()=>e.jsx(Y,{severity:"error",icon:!1,children:e.jsx("ul",{children:Object.values(l).filter(Boolean).map(x=>e.jsx("li",{children:x},x))})})})]})},Ph=u("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),Lh=u("div")(({theme:t})=>({marginTop:"auto",display:"flex",justifyContent:"flex-end",paddingTop:t.spacing(4)})),Bh=u(N)(({theme:t})=>({marginLeft:t.spacing(3)})),Uh=({type:t=Oe,roleId:s,open:n,setOpen:o})=>{const{role:a,refetch:i}=Yo(s==null?void 0:s.toString()),{name:r,setName:l,validateName:c,description:m,setDescription:h,validateDescription:p,checkedPermissions:g,setCheckedPermissions:x,validatePermissions:j,getRolePayload:b,errors:y,showErrors:C,validate:A,reload:v}=xh(a==null?void 0:a.name,a==null?void 0:a.description,a==null?void 0:a.permissions),{refetch:R}=Bt(),{addRole:S,updateRole:L,loading:B}=Ia(),{setToastData:w,setToastApiError:H}=K(),{uiConfig:P}=F(),O=a!==void 0,E=b(t),D=()=>`curl --location --request ${O?"PUT":"POST"} '${P.unleashUrl}/api/admin/roles${O?`/${a.id}`:""}' \\
17
+ --header 'Authorization: INSERT_API_KEY' \\
18
+ --header 'Content-Type: application/json' \\
19
+ --data-raw '${JSON.stringify(E,void 0,2)}'`,I=()=>{R(),i()},G=async U=>{if(U.preventDefault(),!!A())try{O?await L(a.id,E):await S(E),w({text:`Role ${O?"updated":"added"} successfully`,type:"success"}),I(),o(!1)}catch($){H(V($))}};d.useEffect(()=>{v()},[n]);const Z=t[0].toUpperCase()+t.slice(1);return e.jsx(is,{open:n,onClose:()=>{o(!1)},label:O?`Edit ${t} role`:`New ${t} role`,children:e.jsx(Ee,{loading:B,modal:!0,title:O?`Edit ${t} role`:`New ${t} role`,description:`${Z} roles allow you to control access to ${t} resources. Besides the built-in ${t} roles, you can create and manage custom ${t} roles to fit your needs.`,documentationLink:`https://docs.getunleash.io/concepts/rbac${t===Oe?"#custom-root-roles":"#custom-project-roles"}`,documentationLinkLabel:"Roles documentation",formatApiCode:D,children:e.jsxs(Ph,{onSubmit:G,children:[e.jsx(Ih,{type:t,name:r,setName:l,validateName:c,description:m,setDescription:h,validateDescription:p,checkedPermissions:g,setCheckedPermissions:x,validatePermissions:j,errors:y,showErrors:C}),e.jsxs(Lh,{children:[e.jsxs(N,{type:"submit",variant:"contained",color:"primary",children:[O?"Save":"Add"," role"]}),e.jsx(Bh,{onClick:()=>{o(!1)},children:"Cancel"})]})]})})})},Oh=({row:t})=>{var o,a;const{original:s}=t,{role:n}=Yo(s.id.toString());return!n||Ge.includes(n.type)?null:e.jsx(ae,{children:e.jsx(os,{tooltip:e.jsx(To,{roleId:s.id,tooltip:!0}),children:((o=n.permissions)==null?void 0:o.length)===1?"1 permission":`${(a=n.permissions)==null?void 0:a.length} permissions`})})},Zn=({type:t=Oe,searchValue:s="",modalOpen:n,setModalOpen:o,selectedRole:a,setSelectedRole:i})=>{const{setToastData:r,setToastApiError:l}=K(),c=It(),{roles:m,projectRoles:h,refetch:p,loading:g}=Bt(),{removeRole:x}=Ia(),[j,b]=d.useState(!1),y=async P=>{try{await x(P.id),r({text:`${P.name} has been deleted`,type:"success"}),p(),b(!1)}catch(O){l(V(O))}},C=me(c.breakpoints.down("md")),A=d.useMemo(()=>[{id:"Icon",Cell:()=>e.jsx(Jo,{icon:e.jsx(Xi,{color:"disabled"})}),disableGlobalFilter:!0,maxWidth:50},{Header:"Role",accessor:"name",Cell:({row:{original:P}})=>e.jsx(th,{role:P}),searchable:!0,minWidth:100},{id:"permissions",Header:"Permissions",Cell:Oh,maxWidth:140},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:P}})=>e.jsx(Xu,{role:P,onEdit:()=>{i(P),o(!0)},onDelete:()=>{i(P),b(!0)}}),width:150,disableSortBy:!0},{accessor:"description",Header:"Description",searchable:!0}],[]),[v]=d.useState({sortBy:[{id:"name"}],hiddenColumns:["description"]}),{data:R,getSearchText:S}=dt(A,s,t===Oe?m:h),{headerGroups:L,rows:B,prepareRow:w,setHiddenColumns:H}=z.useTable({columns:A,data:R,initialState:v,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:ae}},z.useSortBy,z.useFlexLayout);return Pt([{condition:C,columns:["Icon"]}],H,A),e.jsxs(se,{isLoading:g,children:[e.jsx(Ne,{value:S(s),children:e.jsx(be,{rows:B,headerGroups:L,prepareRow:w})}),e.jsx(T,{condition:B.length===0,show:e.jsx(T,{condition:(s==null?void 0:s.length)>0,show:e.jsxs(le,{children:["No ",t," roles found matching “",s,"”"]}),elseShow:e.jsxs(le,{children:["No ",t," roles available. Get started by adding one."]})})}),e.jsx(Uh,{type:t,roleId:a==null?void 0:a.id,open:n,setOpen:o}),e.jsx(mh,{role:a,open:j,setOpen:b,onConfirm:y})]})},$h=u("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center"})),_h=u("div")({flex:1}),Mh=u("div")({display:"flex",alignItems:"center"}),Nh=()=>{Zt("Roles");const{pathname:t}=Ws(),{roles:s,projectRoles:n,loading:o}=Bt(),[a,i]=d.useState(""),[r,l]=d.useState(!1),[c,m]=d.useState(),h=[{label:"Root roles",path:"/admin/roles",total:s.length},{label:"Project roles",path:"/admin/roles/project-roles",total:n.length}],p=me(Be.breakpoints.down("md")),g=t.includes("project-roles")?vn:Oe;return e.jsx(se,{withTabs:!0,bodyClass:"page-body",isLoading:o,header:e.jsxs(e.Fragment,{children:[e.jsxs($h,{children:[e.jsx(_h,{children:e.jsx(Wo,{value:t,indicatorColor:"primary",textColor:"primary",variant:"scrollable",allowScrollButtonsMobile:!0,children:h.map(({label:x,path:j,total:b})=>e.jsx(zo,{value:j,label:e.jsxs(Ra,{to:j,children:[x," (",b,")"]}),sx:{padding:0}},x))})}),e.jsxs(Mh,{children:[e.jsx(T,{condition:!p,show:e.jsxs(e.Fragment,{children:[e.jsx(ue,{initialValue:a,onChange:i}),e.jsx(ne.Divider,{})]})}),e.jsxs(Zs,{onClick:()=>{m(void 0),l(!0)},maxWidth:`${Be.breakpoints.values.sm}px`,Icon:rs,permission:Q,children:["New ",g," role"]})]})]}),e.jsx(T,{condition:p,show:e.jsx(ue,{initialValue:a,onChange:i})})]}),children:e.jsxs(at,{children:[e.jsx(_,{path:"project-roles",element:e.jsx(Zn,{type:vn,searchValue:a,modalOpen:r,setModalOpen:l,selectedRole:c,setSelectedRole:m})}),e.jsx(_,{path:"*",element:e.jsx(Zn,{type:Oe,searchValue:a,modalOpen:r,setModalOpen:l,selectedRole:c,setSelectedRole:m})})]})})},Fh=()=>{const{isEnterprise:t}=F();return t()?e.jsx("div",{children:e.jsx(fe,{permissions:[er,Q],children:e.jsx(Nh,{})})}):e.jsx(ot,{feature:"project-roles",page:!0})},Ba=()=>{const{loading:t,makeRequest:s,createRequest:n,errors:o}=xe({propagateErrors:!0});return{addServiceAccount:async l=>{const m=n("api/admin/service-account",{method:"POST",body:JSON.stringify(l)},"addServiceAccount");return(await s(m.caller,m.id)).json()},updateServiceAccount:async(l,c)=>{const h=n(`api/admin/service-account/${l}`,{method:"PUT",body:JSON.stringify(c)},"updateServiceAccount");await s(h.caller,h.id)},removeServiceAccount:async l=>{const m=n(`api/admin/service-account/${l}`,{method:"DELETE"},"removeServiceAccount");await s(m.caller,m.id)},errors:o,loading:t}},Ua=()=>{const{makeRequest:t,createRequest:s,errors:n,loading:o}=xe({propagateErrors:!0});return{createServiceAccountToken:async(r,l)=>{const c=s(`api/admin/service-account/${r}/token`,{method:"POST",body:JSON.stringify(l)});return(await t(c.caller,c.id)).json()},deleteServiceAccountToken:async(r,l)=>{const c=s(`api/admin/service-account/${r}/token/${l}`,{method:"DELETE"});await t(c.caller,c.id)},errors:n,loading:o}},Gh=t=>{const{isEnterprise:s}=F(),{data:n,error:o,mutate:a}=Qt(s(),{pats:[]},te(`api/admin/service-account/${t}/token`),Wh);return{tokens:n?n.pats:void 0,loading:!o&&!n,refetchTokens:()=>a(),error:o}},Wh=t=>fetch(t).then(ce("Service Account Tokens")).then(s=>s.json()),Mt=Ko["30DAYS"],zh=({open:t,setOpen:s,tokens:n,onCreateClick:o})=>{const[a,i]=d.useState(""),[r,l]=d.useState(Mt),[c,m]=d.useState(Yt(Mt)),[h,p]=d.useState({});d.useEffect(()=>{i(""),l(Mt),m(Yt(Mt)),p({})},[t]);const g=j=>!(n!=null&&n.some(b=>b.description===j)),x=a.length&&g(a)&&c>new Date;return e.jsx(X,{open:t,primaryButtonText:"Create token",secondaryButtonText:"Cancel",onClick:()=>o({description:a,expiresAt:c}),disabledPrimaryButton:!x,onClose:()=>{s(!1)},title:"New token",children:e.jsx(Zo,{description:a,setDescription:i,isDescriptionUnique:g,expiration:r,setExpiration:l,expiresAt:c,setExpiresAt:m,errors:h,setErrors:p})})},Hh=u(Y)(({theme:t})=>({marginBottom:t.spacing(3)})),Oa=({open:t,setOpen:s,token:n})=>e.jsxs(X,{open:t,secondaryButtonText:"Close",onClose:(o,a)=>{a||s(!1)},title:"Service account token created",children:[e.jsx(Hh,{severity:"info",children:"Make sure to copy your service account API token now. You won't be able to see it again!"}),e.jsx(k,{variant:"body1",children:"Your token:"}),e.jsx(Eo,{token:(n==null?void 0:n.secret)||""})]}),qh=u("div")(({theme:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:t.spacing(2),gap:t.spacing(2),"& > div":{[t.breakpoints.down("md")]:{marginTop:0}}})),Vh=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"center",padding:t.spacing(3)})),Yh=u(k)(({theme:t})=>({fontSize:t.fontSizes.bodySize,marginBottom:t.spacing(.5)})),Jh=u(k)(({theme:t})=>({fontSize:t.fontSizes.smallBody,color:t.palette.text.secondary,marginBottom:t.spacing(1.5)})),Kh={id:"createdAt",desc:!0},$a=({serviceAccount:t,readOnly:s})=>{const n=It(),{setToastData:o,setToastApiError:a}=K(),i=me(n.breakpoints.down("md")),r=me(n.breakpoints.down("sm")),{tokens:l=[],refetchTokens:c}=Gh(t.id),{refetch:m}=Lt(),{createServiceAccountToken:h,deleteServiceAccountToken:p}=Ua(),[g]=d.useState(()=>({sortBy:s?[{id:"seenAt"}]:[Kh]})),[x,j]=d.useState(""),[b,y]=d.useState(!1),[C,A]=d.useState(!1),[v,R]=d.useState(!1),[S,L]=d.useState(),[B,w]=d.useState(),H=async W=>{try{const ge=await h(t.id,W);m(),c(),y(!1),L(ge),A(!0),o({text:"Token created successfully",type:"success"})}catch(ge){a(V(ge))}},P=async()=>{if(B)try{await p(t.id,B==null?void 0:B.id),m(),c(),R(!1),o({text:"Token deleted successfully",type:"success"})}catch(W){a(V(W))}},O=d.useMemo(()=>[{Header:"Description",accessor:"description",Cell:ve,minWidth:100,searchable:!0},{Header:"Expires",accessor:"expiresAt",Cell:({value:W})=>new Date(W).getFullYear()>new Date().getFullYear()+100?e.jsx(ae,{children:"Never"}):e.jsx(je,{value:W}),maxWidth:150},{Header:"Created",accessor:"createdAt",Cell:je,maxWidth:150},{Header:"Last seen",accessor:"seenAt",Cell:Me,maxWidth:150},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:W}})=>e.jsx(Kt,{children:e.jsx(Te,{title:"Delete token",arrow:!0,describeChild:!0,children:e.jsx("span",{children:e.jsx($e,{onClick:()=>{w(W),R(!0)},children:e.jsx(Le,{})})})})}),maxWidth:100,disableSortBy:!0}],[w,R]),{data:E,getSearchText:D,getSearchContext:I}=dt(O,x,l),{headerGroups:G,rows:Z,prepareRow:U,setHiddenColumns:$}=z.useTable({columns:O,data:E,initialState:g,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},z.useSortBy,z.useFlexLayout);return Pt([{condition:r,columns:["expiresAt"]},{condition:i,columns:["createdAt"]},{condition:!!s,columns:["Actions","expiresAt","createdAt"]}],$,O),e.jsxs(e.Fragment,{children:[e.jsx(T,{condition:!s,show:e.jsxs(qh,{children:[e.jsx(ue,{initialValue:x,onChange:j,getSearchContext:I}),e.jsx(N,{variant:"contained",color:"primary",disabled:l.length>=tr,onClick:()=>y(!0),children:"New token"})]})}),e.jsx(Ne,{value:D(x),children:e.jsx(be,{rows:Z,headerGroups:G,prepareRow:U})}),e.jsx(T,{condition:Z.length===0,show:e.jsx(T,{condition:(x==null?void 0:x.length)>0,show:e.jsxs(le,{children:["No tokens found matching “",x,"”"]}),elseShow:e.jsxs(Vh,{children:[e.jsx(Yh,{children:"You have no tokens for this service account yet."}),e.jsx(Jh,{children:"Create a service account token for access to the Unleash API."}),e.jsx(N,{variant:"outlined",onClick:()=>y(!0),children:"Create new service account token"})]})})}),e.jsx(zh,{open:b,setOpen:y,tokens:l,onCreateClick:H}),e.jsx(Oa,{open:C,setOpen:A,token:S}),e.jsx(X,{open:v,primaryButtonText:"Delete token",secondaryButtonText:"Cancel",onClick:P,onClose:()=>{R(!1)},title:"Delete token?",children:e.jsxs(k,{children:['Any applications or scripts using this token "',e.jsx("strong",{children:B==null?void 0:B.description}),'" will no longer be able to access the Unleash API. You cannot undo this action.']})})]})},Zh=u("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),ft=u("p")(({theme:t})=>({display:"flex",color:t.palette.text.primary,marginBottom:t.spacing(1),"&:not(:first-of-type)":{marginTop:t.spacing(4)}})),Qn=u("p")(({theme:t})=>({color:t.palette.text.secondary,marginBottom:t.spacing(1)})),Xn=u(Ke)(({theme:t})=>({width:"100%",maxWidth:t.spacing(50)})),Qh=u(ps)(({theme:t})=>({width:"100%",maxWidth:t.spacing(50)})),Xh=u("div")(({theme:t})=>({padding:t.spacing(3),backgroundColor:t.palette.background.elevation2,borderRadius:t.shape.borderRadiusMedium,marginTop:t.spacing(4),marginBottom:t.spacing(2)})),ep=u("div")(({theme:t})=>({padding:t.spacing(0,4),"& > p:not(:first-of-type)":{marginTop:t.spacing(2)}})),tp=u("div")(({theme:t})=>({marginTop:"auto",display:"flex",justifyContent:"flex-end",paddingTop:t.spacing(4)})),sp=u(N)(({theme:t})=>({marginLeft:t.spacing(3)})),Nt=Ko["30DAYS"],np=({serviceAccount:t,open:s,setOpen:n,newToken:o})=>{const{users:a}=Se(),{serviceAccounts:i,roles:r,refetch:l}=Lt(),{addServiceAccount:c,updateServiceAccount:m,loading:h}=Ba(),{createServiceAccountToken:p}=Ua(),{setToastData:g,setToastApiError:x}=K(),{uiConfig:j}=F(),[b,y]=d.useState(""),[C,A]=d.useState(""),[v,R]=d.useState(null),[S,L]=d.useState("later"),[B,w]=d.useState({}),H=J=>{w(he=>({...he,[J]:void 0}))},P=(J,he)=>{w(gt=>({...gt,[J]:he}))},[O,E]=d.useState(""),[D,I]=d.useState(Nt),[G,Z]=d.useState(Yt(Nt)),[U,$]=d.useState({}),W=t!==void 0;d.useEffect(()=>{y((t==null?void 0:t.name)||""),A((t==null?void 0:t.username)||""),R(r.find(({id:J})=>J===(t==null?void 0:t.rootRole))||null),L("later"),w({}),E(""),I(Nt),Z(Yt(Nt)),$({})},[s,t]);const ge=()=>({name:b,username:C,rootRole:(v==null?void 0:v.id)||0}),mt=async J=>{J.preventDefault();try{if(W)await m(t.id,ge());else{const{id:he}=await c(ge());if(S==="now"){const gt=await p(he,{description:O,expiresAt:G});o(gt)}}g({text:`Service account ${W?"updated":"added"} successfully`,type:"success"}),l(),n(!1)}catch(he){x(V(he))}},Ot=()=>`curl --location --request ${W?"PUT":"POST"} '${j.unleashUrl}/api/admin/service-account${W?`/${t.id}`:""}' \\
20
+ --header 'Authorization: INSERT_API_KEY' \\
21
+ --header 'Content-Type: application/json' \\
22
+ --data-raw '${JSON.stringify(ge(),void 0,2)}'`,Fe=J=>J.length,xt=J=>!(a!=null&&a.some(he=>he.username===J))&&!(i!=null&&i.some(he=>he.username===J)),xs=v!==null,gs=S==="later"||Fe(O)&&G>new Date,js=Fe(b)&&Fe(C)&&(W||xt(C))&&xs&&gs,fs=()=>{if(Fe(b)&&!Fe(C)){const J=`service-${b.toLowerCase().replace(/ /g,"-").replace(/[^\w_-]/g,"")}`;xt(J)&&A(J)}},ys=J=>{H("username"),xt(J)||P("username","A service account or user with that username already exists."),A(J)};return e.jsx(is,{open:s,onClose:()=>{n(!1)},label:W?"Edit service account":"New service account",children:e.jsx(Ee,{loading:h,modal:!0,title:W?"Edit service account":"New service account",description:"A service account is a special type of account that can only be used to authenticate with the Unleash API. Service accounts can be used to automate tasks.",documentationLink:"https://docs.getunleash.io/concepts/service-accounts",documentationLinkLabel:"Service accounts documentation",formatApiCode:Ot,children:e.jsxs(Zh,{onSubmit:mt,children:[e.jsxs("div",{children:[e.jsx(ft,{children:"What is your new service account name?"}),e.jsx(Xn,{autoFocus:!0,label:"Service account name",value:b,onChange:J=>y(J.target.value),onBlur:fs,autoComplete:"off",required:!0}),e.jsx(ft,{children:"What is your new service account username?"}),e.jsx(Xn,{label:"Service account username",error:!!B.username,errorText:B.username,value:C,onChange:J=>ys(J.target.value),autoComplete:"off",required:!0,disabled:W}),e.jsx(ft,{children:"What is your service account allowed to do?"}),e.jsx(Qh,{roles:r,value:v,setValue:R,required:!0}),e.jsx(T,{condition:!W,show:e.jsxs(Xh,{children:[e.jsx(ft,{children:"Token"}),e.jsxs(Qn,{children:["In order to connect your newly created service account, you will also need a token."," ",e.jsx(en,{href:"https://docs.getunleash.io/concepts/api-tokens-and-client-keys",target:"_blank",rel:"noreferrer",children:"Read more about API tokens"}),"."]}),e.jsx(Xt,{children:e.jsxs(sr,{value:S,onChange:J=>L(J.target.value),name:"token-generation",children:[e.jsx(re,{value:"later",control:e.jsx(Cn,{}),label:"I want to generate a token later"}),e.jsx(re,{value:"now",control:e.jsx(Cn,{}),label:"Generate a token now"})]})}),e.jsxs(ep,{children:[e.jsx(Qn,{children:"A new personal access token (PAT) will be generated for the service account, so you can get started right away."}),e.jsx(T,{condition:S==="now",show:e.jsx(Zo,{description:O,setDescription:E,expiration:D,setExpiration:I,expiresAt:G,setExpiresAt:Z,errors:U,setErrors:$})})]})]}),elseShow:e.jsxs(e.Fragment,{children:[e.jsx(ft,{children:"Service account tokens"}),e.jsx($a,{serviceAccount:t})]})})]}),e.jsxs(tp,{children:[e.jsxs(N,{type:"submit",variant:"contained",color:"primary",disabled:!js,children:[W?"Save":"Add"," service account"]}),e.jsx(sp,{onClick:()=>{n(!1)},children:"Cancel"})]})]})})})},op=u("div")(({theme:t})=>({marginTop:t.spacing(1.5)})),eo=u("p")(({theme:t})=>({marginTop:t.spacing(3)})),ap=({serviceAccount:t,open:s,setOpen:n,onConfirm:o})=>{const a=e.jsxs(e.Fragment,{children:["You are about to delete service account:"," ",e.jsx("strong",{children:t==null?void 0:t.name})]});return e.jsx(X,{title:"Delete service account?",open:s,primaryButtonText:"Delete service account",secondaryButtonText:"Cancel",onClick:()=>o(t),onClose:()=>{n(!1)},children:e.jsx(T,{condition:!!(t!=null&&t.tokens.length),show:e.jsxs(e.Fragment,{children:[e.jsx(Y,{severity:"error",children:"Deleting this service account may break any existing implementations currently using it."}),e.jsx(eo,{children:a}),e.jsx(eo,{children:"Service account tokens:"}),e.jsx(op,{children:e.jsx($a,{serviceAccount:t,readOnly:!0})})]}),elseShow:e.jsx("p",{children:a})})})},ip=u(M)(()=>({display:"flex",justifyContent:"center"})),rp=({onEdit:t,onDelete:s})=>e.jsxs(ip,{children:[e.jsx(Ue,{"data-loading":!0,onClick:t,permission:Q,tooltipProps:{title:"Edit service account"},children:e.jsx(Dt,{})}),e.jsx(Ue,{"data-loading":!0,onClick:s,permission:Q,tooltipProps:{title:"Remove service account"},children:e.jsx(Le,{})})]}),lp=()=>{const{setToastData:t,setToastApiError:s}=K(),{serviceAccounts:n,roles:o,refetch:a,loading:i}=Lt(),{removeServiceAccount:r}=Ba(),[l,c]=d.useState(""),[m,h]=d.useState(!1),[p,g]=d.useState(!1),[x,j]=d.useState(),[b,y]=d.useState(!1),[C,A]=d.useState(),v=async I=>{try{await r(I.id),t({text:`${I.name} has been deleted`,type:"success"}),a(),y(!1)}catch(G){s(V(G))}},R=me(Be.breakpoints.down("sm")),S=me(Be.breakpoints.down("md")),L=d.useMemo(()=>[{Header:"Avatar",accessor:"imageUrl",Cell:({row:{original:I}})=>e.jsx(ae,{children:e.jsx(Je,{user:I})}),disableSortBy:!0,maxWidth:80},{id:"name",Header:"Name",accessor:I=>I.name||"",minWidth:200,Cell:({row:{original:I}})=>e.jsx(ve,{value:I.name,subtitle:I.username}),searchable:!0},{id:"role",Header:"Role",accessor:I=>{var G;return((G=o.find(Z=>Z.id===I.rootRole))==null?void 0:G.name)||""},Cell:({row:{original:I},value:G})=>e.jsx(tn,{value:G,role:I.rootRole}),maxWidth:120},{id:"tokens",Header:"Tokens",accessor:I=>{var G;return((G=I.tokens)==null?void 0:G.map(({description:Z})=>Z).join(`
23
+ `))||""},Cell:({row:{original:I},value:G})=>e.jsx(Da,{serviceAccount:I,value:G,onCreateToken:()=>{A(I),h(!0)}}),searchable:!0},{Header:"Created",accessor:"createdAt",Cell:je,width:120,maxWidth:120},{id:"seenAt",Header:"Last seen",accessor:I=>{var G;return(G=I.tokens.sort((Z,U)=>{const $=new Date(Z.seenAt||0),W=new Date(U.seenAt||0);return(W==null?void 0:W.getTime())-($==null?void 0:$.getTime())})[0])==null?void 0:G.seenAt},Cell:Me,maxWidth:150},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:I}})=>e.jsx(rp,{onEdit:()=>{A(I),h(!0)},onDelete:()=>{A(I),y(!0)}}),width:150,disableSortBy:!0},{accessor:"username",Header:"Username",searchable:!0}],[o]),[B]=d.useState({sortBy:[{id:"createdAt",desc:!0}],hiddenColumns:["username"]}),{data:w,getSearchText:H}=dt(L,l,n),{headerGroups:P,rows:O,prepareRow:E,setHiddenColumns:D}=z.useTable({columns:L,data:w,initialState:B,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:ae}},z.useSortBy,z.useFlexLayout);return Pt([{condition:R,columns:["role","seenAt"]},{condition:S,columns:["imageUrl","tokens","createdAt"]}],D,L),e.jsxs(se,{isLoading:i,header:e.jsx(ne,{title:`Service Accounts (${O.length})`,actions:e.jsxs(e.Fragment,{children:[e.jsx(T,{condition:!S,show:e.jsxs(e.Fragment,{children:[e.jsx(ue,{initialValue:l,onChange:c}),e.jsx(ne.Divider,{})]})}),e.jsx(N,{variant:"contained",color:"primary",onClick:()=>{A(void 0),h(!0)},children:"New service account"})]}),children:e.jsx(T,{condition:S,show:e.jsx(ue,{initialValue:l,onChange:c})})}),children:[e.jsx(Ne,{value:H(l),children:e.jsx(be,{rows:O,headerGroups:P,prepareRow:E})}),e.jsx(T,{condition:O.length===0,show:e.jsx(T,{condition:(l==null?void 0:l.length)>0,show:e.jsxs(le,{children:["No service accounts found matching “",l,"”"]}),elseShow:e.jsx(le,{children:"No service accounts available. Get started by adding one."})})}),e.jsx(np,{serviceAccount:C,open:m,setOpen:h,newToken:I=>{j(I),g(!0)}}),e.jsx(Oa,{open:p,setOpen:g,token:x}),e.jsx(ap,{serviceAccount:C,open:b,setOpen:y,onConfirm:v})]})},cp=()=>{const{isEnterprise:t}=F();return e.jsx("div",{children:e.jsx(T,{condition:t(),show:e.jsx(fe,{permissions:Q,children:e.jsx(lp,{})}),elseShow:e.jsx(ot,{feature:"service-accounts",page:!0})})})},dp=u("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),up=u("div")(({theme:t})=>({maxWidth:t.spacing(50)})),hp=u("p")(({theme:t})=>({marginBottom:t.spacing(1)})),to=u(Ke)(({theme:t})=>({width:"100%",marginBottom:t.spacing(2)})),so=u(k)(({theme:t})=>({margin:t.spacing(1,0)})),pp=u("div")(()=>({display:"flex",alignItems:"center"})),mp=u("div")(()=>({marginTop:"auto",display:"flex",justifyContent:"flex-end"})),xp=u(N)(({theme:t})=>({marginLeft:t.spacing(3)})),_a=({children:t,email:s,name:n,rootRole:o,sendEmail:a,setEmail:i,setName:r,setSendEmail:l,setRootRole:c,handleSubmit:m,handleCancel:h,errors:p,clearErrors:g,mode:x})=>{const{uiConfig:j}=F(),{roles:b}=Se();return e.jsxs(dp,{onSubmit:m,children:[e.jsxs(up,{children:[e.jsx(hp,{children:"Who is the new Unleash user?"}),e.jsx(to,{label:"Full name",value:n,onChange:y=>r(y.target.value),error:!!p.name,errorText:p.name,onFocus:()=>g(),autoFocus:!0}),e.jsx(to,{label:"Email",type:"email",value:s,onChange:y=>i(y.target.value),error:!!p.email,errorText:p.email,onFocus:()=>g()}),e.jsx(so,{variant:"subtitle1","data-loading":!0,children:"What is your team member allowed to do?"}),e.jsx(ps,{roles:b,value:o,setValue:c,required:!0}),e.jsx(T,{condition:x!==Qs&&!!(j!=null&&j.emailEnabled),show:e.jsxs(Xt,{children:[e.jsx(so,{variant:"subtitle1","data-loading":!0,children:"Should we send an email to your new team member"}),e.jsxs(pp,{children:[e.jsx(pe,{name:"sendEmail",onChange:()=>l(!a),checked:a}),e.jsx(k,{children:a?"Yes":"No"})]})]})})]}),e.jsxs(mp,{children:[t,e.jsx(xp,{onClick:h,children:"Cancel"})]})]})},Ma=(t="",s="",n=null)=>{const{uiConfig:o}=F(),{users:a,roles:i}=Se(),[r,l]=d.useState(t),[c,m]=d.useState(s),[h,p]=d.useState(!1),[g,x]=d.useState(i.find(({id:R})=>R===n)||null),[j,b]=d.useState({});return d.useEffect(()=>{l(t)},[t]),d.useEffect(()=>{m(s)},[s]),d.useEffect(()=>{p((o==null?void 0:o.emailEnabled)||!1)},[o==null?void 0:o.emailEnabled]),d.useEffect(()=>{x(i.find(({id:R})=>R===n)||null)},[n]),{name:r,setName:l,email:c,setEmail:m,sendEmail:h,setSendEmail:p,rootRole:g,setRootRole:x,getAddUserPayload:()=>({name:r,email:c,sendEmail:h,rootRole:(g==null?void 0:g.id)||0}),validateName:()=>r.length===0?(b(R=>({...R,name:"Name can not be empty."})),!1):c.length===0?(b(R=>({...R,email:"Email can not be empty."})),!1):!0,validateEmail:()=>a.some(R=>R.email===c)?(b(R=>({...R,email:"Email already exists"})),!1):!0,clearErrors:()=>{b({})},errors:j}},gp=t=>d.createElement("svg",{width:197,height:177,viewBox:"0 0 197 177",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},d.createElement("g",{clipPath:"url(#clip0)"},d.createElement("path",{d:"M195.272 67.6884C195.201 67.6884 195.132 67.6668 195.074 67.6264L99.4918 1.00044C99.2009 0.798626 98.8553 0.690774 98.5013 0.691378C98.1474 0.691982 97.8021 0.801012 97.5119 1.00382L2.61779 67.6257C2.54273 67.6784 2.44984 67.6991 2.35954 67.6832C2.26924 67.6674 2.18893 67.6163 2.13629 67.5411C2.08364 67.466 2.06297 67.373 2.07881 67.2826C2.09466 67.1923 2.14573 67.1119 2.22079 67.0592L97.115 0.437299C97.5213 0.153417 98.0047 0.000817369 98.5002 2.3283e-06C98.9957 -0.000812712 99.4796 0.150195 99.8868 0.432738L195.469 67.0585C195.53 67.1006 195.575 67.1609 195.599 67.2306C195.623 67.3004 195.624 67.3758 195.602 67.4461C195.58 67.5164 195.536 67.5778 195.476 67.6214C195.417 67.6649 195.345 67.6884 195.272 67.6884L195.272 67.6884Z",fill:"#3F3D56"}),d.createElement("path",{d:"M8.04028 70.0501L98.5953 2.87773L189.837 74.8297L103.261 126.199L56.2576 115.476L8.04028 70.0501Z",fill:"#E6E6E6"}),d.createElement("path",{d:"M60.2251 157.928H15.4887C15.214 157.928 14.942 157.875 14.6881 157.77C14.4342 157.665 14.2035 157.511 14.0091 157.316C13.8147 157.122 13.6606 156.891 13.5554 156.637C13.4502 156.383 13.396 156.111 13.396 155.836C13.396 155.561 13.4502 155.289 13.5554 155.035C13.6606 154.781 13.8147 154.55 14.0091 154.356C14.2035 154.162 14.4342 154.008 14.6881 153.903C14.942 153.798 15.214 153.744 15.4887 153.744H60.2251C60.4998 153.744 60.7719 153.798 61.0258 153.903C61.2797 154.008 61.5104 154.162 61.7048 154.356C61.8991 154.55 62.0533 154.781 62.1585 155.035C62.2637 155.289 62.3179 155.561 62.3179 155.836C62.3179 156.111 62.2637 156.383 62.1585 156.637C62.0533 156.891 61.8991 157.122 61.7048 157.316C61.5104 157.511 61.2797 157.665 61.0258 157.77C60.7719 157.875 60.4998 157.928 60.2251 157.928Z",fill:"#607D8B"}),d.createElement("path",{d:"M31.5392 148.934H15.4887C15.214 148.934 14.942 148.88 14.6881 148.776C14.4342 148.671 14.2035 148.516 14.0091 148.322C13.8147 148.128 13.6606 147.897 13.5554 147.643C13.4502 147.389 13.396 147.117 13.396 146.842C13.396 146.567 13.4502 146.295 13.5554 146.041C13.6606 145.787 13.8147 145.556 14.0091 145.362C14.2035 145.168 14.4342 145.014 14.6881 144.909C14.942 144.804 15.214 144.75 15.4887 144.75H31.5392C31.8139 144.75 32.0859 144.804 32.3398 144.909C32.5937 145.014 32.8244 145.168 33.0188 145.362C33.2132 145.556 33.3674 145.787 33.4726 146.041C33.5778 146.295 33.6319 146.567 33.6319 146.842C33.6319 147.117 33.5778 147.389 33.4726 147.643C33.3674 147.897 33.2132 148.128 33.0188 148.322C32.8244 148.516 32.5937 148.671 32.3398 148.776C32.0859 148.88 31.8139 148.934 31.5392 148.934Z",fill:"#607D8B"}),d.createElement("path",{d:"M99.8687 107.464C99.5287 107.465 99.1918 107.399 98.8771 107.27L43.0291 84.0761V11.4759C43.0298 10.8339 43.2849 10.2184 43.7385 9.76446C44.192 9.31051 44.8069 9.05515 45.4484 9.0544H152.589C153.23 9.05515 153.845 9.31051 154.299 9.76446C154.752 10.2184 155.007 10.8339 155.008 11.4759V84.1267L154.903 84.1717L100.89 107.258C100.567 107.394 100.22 107.464 99.8687 107.464Z",fill:"white"}),d.createElement("path",{d:"M99.8687 107.637C99.5061 107.637 99.1469 107.567 98.8112 107.43L42.8562 84.1916V11.4759C42.857 10.788 43.1303 10.1286 43.6163 9.64218C44.1022 9.1558 44.7611 8.88221 45.4483 8.88143H152.589C153.276 8.88221 153.935 9.1558 154.421 9.64218C154.907 10.1286 155.18 10.788 155.181 11.4759V84.2409L100.958 107.417C100.613 107.563 100.243 107.637 99.8687 107.637ZM43.5474 83.7295L99.0748 106.79C99.5928 107.001 100.173 106.997 100.688 106.781L154.49 83.7842V11.4759C154.489 10.9714 154.288 10.4879 153.932 10.1312C153.576 9.77452 153.093 9.57387 152.589 9.57328H45.4483C44.9444 9.57387 44.4612 9.77452 44.1049 10.1312C43.7485 10.4879 43.548 10.9714 43.5474 11.4759L43.5474 83.7295Z",fill:"#3F3D56"}),d.createElement("path",{d:"M194.581 66.9965H194.512L154.835 83.9537L100.55 107.155C100.337 107.244 100.11 107.291 99.8797 107.292C99.6496 107.293 99.4215 107.249 99.2084 107.162L43.2018 83.9052L2.55059 67.0242L2.48849 66.9965H2.4193C1.77788 66.9972 1.16293 67.2526 0.70938 67.7066C0.255828 68.1605 0.000711706 68.776 0 69.418V174.579C0.000712619 175.221 0.255828 175.836 0.70938 176.29C1.16293 176.744 1.77788 176.999 2.4193 177H194.581C195.222 176.999 195.837 176.744 196.291 176.29C196.744 175.836 196.999 175.221 197 174.579V69.418C196.999 68.776 196.744 68.1605 196.291 67.7066C195.837 67.2526 195.222 66.9972 194.581 66.9965ZM196.309 174.579C196.309 175.037 196.126 175.477 195.802 175.801C195.478 176.126 195.039 176.308 194.581 176.308H2.4193C1.96104 176.308 1.52161 176.126 1.19757 175.801C0.873536 175.477 0.691411 175.037 0.691228 174.579V69.418C0.691855 68.9707 0.865197 68.541 1.17501 68.2187C1.48483 67.8963 1.90713 67.7063 2.35365 67.6884L43.2018 84.6524L98.9425 107.802C99.5459 108.047 100.222 108.044 100.823 107.791L154.835 84.7043L194.65 67.6884C195.096 67.7076 195.517 67.8982 195.826 68.2203C196.135 68.5425 196.308 68.9714 196.309 69.418V174.579Z",fill:"#3F3D56"}),d.createElement("path",{d:"M99.3104 86.8775C97.2487 86.8813 95.2416 86.214 93.5919 84.9762L93.4896 84.8994L71.9541 68.3963C70.9567 67.6314 70.1197 66.6774 69.4907 65.5888C68.8617 64.5001 68.4531 63.2981 68.2882 62.0514C68.1233 60.8047 68.2054 59.5377 68.5297 58.3228C68.8541 57.1078 69.4143 55.9687 70.1785 54.9704C70.9426 53.9722 71.8958 53.1344 72.9835 52.5048C74.0711 51.8753 75.2721 51.4663 76.5177 51.3013C77.7632 51.1362 79.0291 51.2184 80.243 51.543C81.4569 51.8676 82.595 52.4284 83.5923 53.1932L97.5414 63.8988L130.505 20.8706C131.27 19.8726 132.223 19.0351 133.311 18.4059C134.399 17.7767 135.6 17.3682 136.846 17.2036C138.091 17.039 139.357 17.1216 140.571 17.4467C141.785 17.7718 142.923 18.333 143.92 19.0982L143.715 19.3767L143.925 19.1023C145.936 20.6494 147.252 22.9319 147.584 25.449C147.916 27.9661 147.237 30.5122 145.696 32.5287L106.922 83.1402C106.026 84.3065 104.872 85.2503 103.552 85.8984C102.232 86.5466 100.781 86.8816 99.3104 86.8775Z",fill:"#607D8B"})),d.createElement("defs",null,d.createElement("clipPath",{id:"clip0"},d.createElement("rect",{width:197,height:177,fill:"white"})))),jp=({open:t,closeConfirm:s,inviteLink:n})=>e.jsxs(X,{open:t,title:"Team member added",primaryButtonText:"Close",onClick:s,children:[e.jsx(k,{children:"A new team member has been added. We’ve sent an email on your behalf to inform them of their new account and role. No further steps are required."}),e.jsx(M,{sx:{width:"100%",textAlign:"center",px:"auto",py:4},children:e.jsx(gp,{})}),e.jsx(k,{style:{fontWeight:"bold"},variant:"subtitle1",children:"In a rush?"}),e.jsx(k,{children:"You may also copy the invite link and send it to the user."}),e.jsx(cs,{inviteLink:n})]}),fp=({open:t,closeConfirm:s,inviteLink:n})=>e.jsxs(X,{open:t,onClick:s,primaryButtonText:"Close",title:"Team member added",children:[e.jsx(k,{variant:"body1",sx:{mb:2},children:"A new team member has been added."}),e.jsx(k,{variant:"body1",children:"Please provide them with the following link. This will allow them to set up their password and get started with their Unleash account."}),e.jsx(cs,{inviteLink:n}),e.jsx(Y,{severity:"info",sx:{mt:2},children:e.jsxs(k,{variant:"body2",children:["Want to avoid this step in the future?"," ",e.jsx("a",{href:"https://docs.getunleash.io/docs/deploy/email",target:"_blank",rel:"noopener noreferrer",children:"If you configure an email server for Unleash"})," ","we'll automatically send informational getting started emails to new users once you add them."]})})]}),Na=({open:t,closeConfirm:s,emailSent:n,inviteLink:o})=>n?e.jsx(jp,{open:t,closeConfirm:s,inviteLink:o}):e.jsx(fp,{open:t,closeConfirm:s,inviteLink:o}),hn=t=>{const{instanceStatus:s}=rt(),n=(s==null?void 0:s.plan)===Ys.PRO,o=pa,a=d.useMemo(()=>yp(t,n,o),[t,n,o]),i=a.filter(r=>r.paid).length;return{seats:o,extraSeats:i,planUsers:a,isBillingUsers:n}},yp=(t,s,n=0)=>(!s||!n||t.sort((o,a)=>o.createdAt.localeCompare(a.createdAt)).forEach((o,a)=>{o.paid=!1,a>=n&&(o.paid=!0)}),t),bp=()=>{const{users:t}=Se(),{isBillingUsers:s,seats:n,planUsers:o}=hn(t),{instancePrices:a}=qs(),i=a.pro.seat;return!s||o.length<n?null:e.jsx(Y,{severity:"info",sx:{marginBottom:r=>r.spacing(3)},children:e.jsxs("p",{children:[e.jsx("strong",{children:"Heads up!"})," You are exceeding your allocated free members included in your plan (",o.length," of ",n,"). Creating this user will add ",e.jsxs("strong",{children:["$",i,"/month"]})," ","to your invoice, starting with your next payment."]})})},Sp=()=>{const{setToastApiError:t}=K(),{uiConfig:s}=F(),n=Ce(),o=Mo(),a=o.get("name")||"",i=o.get("email")||"",{name:r,setName:l,email:c,setEmail:m,sendEmail:h,setSendEmail:p,rootRole:g,setRootRole:x,getAddUserPayload:j,validateName:b,validateEmail:y,errors:C,clearErrors:A}=Ma(a,i),[v,R]=d.useState(!1),[S,L]=d.useState(""),{addUser:B,userLoading:w}=Ze(),H=async D=>{D.preventDefault(),A();const I=b(),G=y();if(I&&G){const Z=j();try{await B(Z).then(U=>U.json()).then(U=>{Gs(),L(U.inviteLink),R(!0)})}catch(U){t(V(U))}}},P=()=>{R(!1),n("/admin/users")},O=()=>`curl --location --request POST '${s.unleashUrl}/api/admin/user-admin' \\
24
+ --header 'Authorization: INSERT_API_KEY' \\
25
+ --header 'Content-Type: application/json' \\
26
+ --data-raw '${JSON.stringify(j(),void 0,2)}'`,E=()=>{n(Pe)};return e.jsxs(Ee,{loading:w,title:"Create Unleash user",description:"In order for a user to get access to Unleash, they need to be assigned a root role, such as Viewer, Editor, or Admin.",documentationLink:"https://docs.getunleash.io/concepts/rbac#predefined-roles",documentationLinkLabel:"User management documentation",formatApiCode:O,children:[e.jsx(bp,{}),e.jsx(_a,{errors:C,handleSubmit:H,handleCancel:E,name:r,setName:l,email:c,setEmail:m,sendEmail:h,setSendEmail:p,rootRole:g,setRootRole:x,clearErrors:A,children:e.jsx(Co,{name:"user",permission:Q})}),e.jsx(Na,{open:v,closeConfirm:P,emailSent:h,inviteLink:S})]})},no=[{key:Cs(new Date,{hours:48}).toISOString(),label:"48 hours"},{key:Cs(new Date,{weeks:1}).toISOString(),label:"1 week"},{key:Cs(new Date,{months:1}).toISOString(),label:"1 month"}],vp=(t,s)=>{const{uiConfig:n}=F();return t?()=>`curl --location --request PUT '${n.unleashUrl}/api/admin/invite-link/tokens/default' \\
27
+ --header 'Authorization: INSERT_API_KEY' \\
28
+ --header 'Content-Type: application/json' \\
29
+ --data-raw '${JSON.stringify({expiresAt:s},void 0,2)}'`:()=>`curl --location --request POST '${n.unleashUrl}/api/admin/invite-link/tokens' \\
30
+ --header 'Authorization: INSERT_API_KEY' \\
31
+ --header 'Content-Type: application/json' \\
32
+ --data-raw '${JSON.stringify({name:"default",expiresAt:s},void 0,2)}'`},Cp=()=>{var B;const t=Ce(),{data:s,loading:n}=nr(),[o,a]=d.useState(""),{mutate:i}=or(),{trackEvent:r}=Xs(),[l,c]=d.useState(no[0].key),[m,h]=d.useState(!1),p=(B=s==null?void 0:s.tokens)==null?void 0:B.find(w=>w.name==="default"),g=!!p,x=vp(g,l),[j,b]=d.useState(!1),{setToastApiError:y}=K(),{createToken:C,updateToken:A}=ar(),v=async w=>{w.preventDefault(),b(!0),r("invite",{props:{eventType:g?"link update submitted":"link created"}});try{if(g)await A(p.secret,{expiresAt:l}),a(p.url);else{const P=await(await C({name:"default",expiresAt:l})).json();a(P.url)}}catch(H){y(V(H))}finally{b(!1),i(rr)}},R=async()=>{b(!0);try{await A(p.secret,{enabled:!1}),t(Pe)}catch(w){y(V(w))}finally{b(!1)}},S=async()=>{h(!0)},L=()=>{a(""),t("/admin/users")};return e.jsxs(Ee,{loading:n||j,title:g?"Update invite link":"Create invite link",description:"When you send an invite link to someone, they will be able to create an account and get access to Unleash. This new user will only have read access, until you change their assigned role.",documentationLink:"https://docs.getunleash.io/concepts/public-signup",documentationLinkLabel:"Invite link documentation",formatApiCode:x,children:[e.jsxs(M,{component:"form",onSubmit:v,sx:{display:"flex",flexDirection:"column",flexGrow:1},"data-testid":"create-invite-link-form",children:[e.jsxs(M,{sx:{maxWidth:"400px"},children:[e.jsxs(M,{sx:{mb:2},children:[e.jsx(k,{sx:{mb:1},children:"Expiration period for the invite link"}),e.jsx(Qo,{label:"Link will expire in",name:"type",options:no,value:l,onChange:c,fullWidth:!0})]}),e.jsx(k,{sx:{mb:1},children:"People using this link will be invited as:"}),e.jsxs(M,{sx:{p:2,borderRadius:w=>`${w.shape.borderRadiusMedium}px`,backgroundColor:w=>w.palette.background.elevation2},children:[e.jsx(k,{variant:"body2",fontWeight:"bold",children:"Viewer"}),e.jsx(k,{variant:"body2",color:"text.secondary",children:"Users with this role can only read root resources in Unleash. The viewer can be added to specific projects as project member. Viewers may not view API tokens."})]})]}),e.jsxs(M,{sx:{display:"flex",justifyContent:"flex-end",mt:"auto"},children:[e.jsx(ir,{type:"submit",permission:Q,disabled:j,children:g?"Update invite link":"Create invite link"}),e.jsx(T,{condition:g,show:e.jsx(N,{sx:{ml:2},onClick:S,color:"error",children:"Delete link"})}),e.jsx(N,{sx:{ml:2},onClick:()=>{t(Pe)},children:"Cancel"})]})]}),e.jsx(X,{open:!!o,onClick:L,primaryButtonText:"Close",title:"Invite link created",children:e.jsxs(M,{children:[e.jsx(k,{variant:"body1",sx:{mb:2},children:"Using this link, new team members can now sign-up to Unleash."}),e.jsx(k,{variant:"body1",children:"Please provide them with the following link to get started. This will allow them to set up their password and get started with their Unleash account."}),e.jsx(cs,{inviteLink:o})]})}),e.jsx(X,{open:m,onClose:()=>h(!1),onClick:R,title:"Are you sure you want to delete your invite link?"})]})},Fa={overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.25)",zIndex:5},content:{width:"500px",maxWidth:"90%",margin:"0",top:"50%",left:"50%",right:"auto",bottom:"auto",transform:"translate(-50%, -50%)"}},wp=u(Je)(({theme:t})=>({width:t.spacing(5),height:t.spacing(5),margin:0})),Tp=({showDialog:t,closeDialog:s,user:n})=>{const[o,a]=d.useState({}),[i,r]=d.useState(),[l,c]=d.useState(!1),{classes:m}=ds(),{changePassword:h}=Ze(),{setToastData:p,setToastApiError:g}=K(),x=y=>{r(void 0),a({...o,[y.target.name]:dr(y.target.value)})},j=async y=>{if(y.preventDefault(),o.password===o.confirm){if(!l){r(ur);return}try{await h(n.id,o.password),a({}),s(),p({text:"Password changed successfully",type:"success"})}catch(C){const A=V(C);r(A),g(A)}}},b=y=>{y.preventDefault(),a({}),r(void 0),s()};return e.jsx(X,{open:t,onClick:j,style:Fa,onClose:b,primaryButtonText:"Save",title:"Update password",secondaryButtonText:"Cancel",maxWidth:"xs",children:e.jsxs("form",{onSubmit:j,className:Xo(m.contentSpacingY,m.flexColumn),children:[e.jsx(k,{variant:"subtitle1",children:"Changing password for user"}),e.jsxs("div",{className:m.flexRow,children:[e.jsx(wp,{user:n,variant:"rounded"}),e.jsx(k,{variant:"subtitle1",style:{marginLeft:"1rem"},children:n.username||n.email})]}),e.jsx(lr,{password:o.password,callback:c}),e.jsx(ee,{label:"New password",name:"password",type:"password",value:o.password,error:!!i,helperText:i,onChange:x,variant:"outlined",size:"small"}),e.jsx(ee,{label:"Confirm password",name:"confirm",type:"password",value:o.confirm,onChange:x,variant:"outlined",size:"small"}),e.jsx(cr,{started:!!(o.password&&o.confirm),passwordsDoNotMatch:o.password!==o.confirm})]})})},kp=u(Je)(({theme:t})=>({width:t.spacing(5),height:t.spacing(5),margin:0})),Ep=({showDialog:t,closeDialog:s,user:n})=>{const{classes:o}=ds(),{resetPassword:a}=Ze(),{setToastApiError:i}=K(),[r,l]=d.useState(""),c=async p=>{if(p.preventDefault(),!n.email){i("You can't reset the password of a user who doesn't have an email address.");return}try{const g=await a(n.email).then(x=>x.ok?x.json():void 0);g?l(g.resetPasswordUrl):i("Could not reset password. This may be to prevent too many resets. Try again in a minute.")}catch(g){i(V(g))}},m=p=>{p.preventDefault(),s()},h=()=>{l(""),s()};return e.jsxs(X,{open:t,onClick:c,style:Fa,onClose:m,primaryButtonText:"Generate Link",title:"Reset password",secondaryButtonText:"Cancel",maxWidth:"xs",children:[e.jsxs("form",{onSubmit:c,className:Xo(o.contentSpacingY,o.flexColumn),children:[e.jsx(k,{variant:"subtitle1",children:"Resetting password for user"}),e.jsxs("div",{className:o.flexRow,children:[e.jsx(kp,{user:n,variant:"rounded"}),e.jsx(k,{variant:"subtitle1",style:{marginLeft:"1rem"},children:n.username||n.email})]})]}),e.jsx(X,{open:!!r,onClick:h,primaryButtonText:"Close",title:"Reset password link created",children:e.jsxs(M,{children:[e.jsx(k,{variant:"body1",children:"The user can use this link to reset their password. You should not share this link with anyone but the user in question."}),e.jsx(cs,{inviteLink:r})]})})]})},Ap=u(Je)(({theme:t})=>({width:t.spacing(5),height:t.spacing(5),margin:0})),Rp=({showDialog:t,closeDialog:s,user:n,userLoading:o,removeUser:a,userApiErrors:i})=>{const r=Rt(o),{classes:l}=ds();return e.jsx(X,{open:t,title:"Really delete user?",onClose:s,onClick:a,primaryButtonText:"Delete user",secondaryButtonText:"Cancel",children:e.jsxs("div",{ref:r,children:[e.jsx(T,{condition:!!i[Jt],show:e.jsx(Y,{"data-loading":!0,severity:"error",style:{margin:"1rem 0"},children:i[Jt]})}),e.jsxs("div",{"data-loading":!0,className:l.flexRow,children:[e.jsx(Ap,{user:n,variant:"rounded"}),e.jsx(k,{variant:"subtitle1",style:{marginLeft:"1rem"},children:n.username||n.email})]}),e.jsxs(k,{"data-loading":!0,variant:"body1",style:{marginTop:"1rem"},children:["Are you sure you want to delete"," ",n?`${n.name||"user"} (${n.email||n.username})`:"","?",n.scimId?" This user is currently managed by SCIM and may be re-added by your SCIM provider.":""]})]})})},Dp=()=>{const{loading:t,makeRequest:s,createRequest:n,errors:o}=xe({propagateErrors:!0});return{downloadCSV:async()=>{const r=n("api/admin/access/overview",{method:"GET",responseType:"blob",headers:{Accept:"text/csv"}},"downloadCSV"),l=await(await s(r.caller,r.id)).blob(),c=window.URL.createObjectURL(l);window.location.assign(c)},errors:o,loading:t}};var pn={},Ip=ct;Object.defineProperty(pn,"__esModule",{value:!0});var Ga=pn.default=void 0,Pp=Ip(lt()),Lp=e,Bp=(0,Pp.default)((0,Lp.jsx)("path",{d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.42 0 2.13.54 2.39 1.4.12.4.45.7.87.7h.3c.66 0 1.13-.65.9-1.27-.42-1.18-1.4-2.16-2.96-2.54V4.5c0-.83-.67-1.5-1.5-1.5S10 3.67 10 4.5v.66c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-1.65 0-2.5-.59-2.83-1.43-.15-.39-.49-.67-.9-.67h-.28c-.67 0-1.14.68-.89 1.3.57 1.39 1.9 2.21 3.4 2.53v.67c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5v-.65c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"}),"AttachMoneyRounded");Ga=pn.default=Bp;const Up=u(Ga)(({theme:t})=>({color:t.palette.primary.light,fontSize:"1.5rem",backgroundColor:"#F1F0FC",borderRadius:t.shape.borderRadiusLarge})),Op=({value:t})=>e.jsx(ae,{children:e.jsx(T,{condition:t,show:e.jsx(Te,{title:"Paid user",arrow:!0,children:e.jsx(Up,{})}),elseShow:"Included"})}),$p=u("div")(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(-1),marginLeft:t.spacing(-.5)})),_p=u(Oo)(({theme:t})=>({borderRadius:t.shape.borderRadiusLarge,padding:t.spacing(1,1.5)})),Mp=({onEdit:t,onViewAccess:s,onChangePassword:n,onResetPassword:o,onDelete:a,isScimUser:i,userId:r})=>{const[l,c]=d.useState(null),m=!!l,h=j=>{c(j.currentTarget)},p=()=>{c(null)},g=`user-${r}-actions`,x=`${g}-menu`;return e.jsxs($p,{children:[e.jsx(Te,{title:"User actions",arrow:!0,describeChild:!0,children:e.jsx($e,{id:g,"aria-controls":m?"actions-menu":void 0,"aria-haspopup":"true","aria-expanded":m?"true":void 0,onClick:h,type:"button",size:"small",children:e.jsx($o,{})})}),e.jsx(_p,{id:x,anchorEl:l,open:m,onClose:p,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},disableScrollLock:!0,children:e.jsxs(_o,{"aria-labelledby":g,children:[e.jsx(yt,{onClick:t,isScimUser:i,children:"Edit user"}),s&&e.jsx(yt,{onClick:s,children:"Access overview"}),e.jsx(yt,{onClick:()=>{n(),p()},isScimUser:i,children:"Change password"}),e.jsx(yt,{onClick:()=>{o(),p()},isScimUser:i,children:"Reset password"}),e.jsx(yt,{onClick:()=>{a(),p()},children:"Remove user"})]})})]})},yt=({onClick:t,isScimUser:s,children:n})=>e.jsx(Te,{title:s?"This user is managed by your SCIM provider and cannot be changed manually":"",arrow:!0,placement:"left",children:e.jsx("div",{children:e.jsx(ze,{onClick:t,disabled:s,children:e.jsx(Ht,{children:e.jsx(k,{variant:"body2",children:n})})})})}),oo=20,Np=()=>{const{users:t}=Se(),{isBillingUsers:s,planUsers:n}=hn(t);return!s||(n==null?void 0:n.length)<oo?null:e.jsx(Y,{severity:"info",sx:{marginBottom:o=>o.spacing(3)},children:e.jsxs("p",{children:[e.jsx("strong",{children:"Heads up!"})," You have reached your maximum number of registered users for you PRO account (up to max ",oo," ","users). If you need more users please"," ",e.jsx(en,{component:oe,to:"https://www.getunleash.io/signup-enterprise",children:"get in touch with us"}),"."]})})},Wa=u("div")(({theme:t})=>({marginTop:t.spacing(-2),paddingBottom:t.spacing(2)})),Fp=({count:t})=>!t||t<4?null:e.jsx(Jo,{icon:e.jsx(e.Fragment,{children:e.jsx(Te,{title:`Multiple parallel browser sessions (${t})`,children:e.jsx(hr,{"aria-label":"Multiple parallel browser sessions",color:"warning"})})})}),Gp=u("article")(({theme:t})=>({display:"flex",flexFlow:"row wrap",gap:t.spacing(2),justifyContent:"space-between",alignItems:"center"})),Wp=()=>{const{trackEvent:t}=Xs(),s=n=>{t("invite",{props:{eventType:n?"link bar action: edit":"link bar action: create"}})};return e.jsx(Gp,{children:e.jsx(pr,{onActionClick:s})})},zp=({licensedUsers:t})=>{const s=It(),n={datasets:[{label:"Seats used",data:t,borderColor:s.palette.primary.main,backgroundColor:s.palette.primary.main,fill:!1}]};return e.jsx(mr,{data:n,overrideOptions:{parsing:{yAxisKey:"count",xAxisKey:"date"},plugins:{legend:{display:!1}},scales:{x:{time:{unit:"month",tooltipFormat:"MMM yyyy",displayFormats:{month:"MMM"}}}}}})},ao="api/admin/licensed-users",Hp={seatCount:0,licensedUsers:{current:0,history:[]}},za=()=>{const{data:t,refetch:s,loading:n,error:o}=xr(te(ao),()=>gr(te(ao),"Seats used"));return{data:t||Hp,refetch:s,loading:n,error:o}},qp=u("section")(({theme:t})=>({minHeight:"100vh",maxWidth:700,width:"95vw",backgroundColor:t.palette.background.default,display:"flex",flexFlow:"column",gap:t.spacing(4),paddingInline:t.spacing(4),paddingBlock:t.spacing(3.75)})),Vp=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(9)})),Yp=u("div")(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(1.5)})),Jp=u("h3")(({theme:t})=>({fontSize:t.typography.h2.fontSize,margin:0,fontWeight:t.typography.h4.fontWeight})),io=u("h4")(({theme:t})=>({margin:0,fontWeight:t.typography.h4.fontWeight,fontSize:t.spacing(1.75)})),ro=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(2)})),Kp=u("div")(({theme:t})=>({display:"flex",justifyContent:"flex-end",marginBlockStart:"auto",gap:t.spacing(4)})),Zp=u("div")(({theme:t})=>({display:"flex",gap:t.spacing(2),width:"100%"})),Qp=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",width:"100%",background:t.palette.background.elevation1,padding:t.spacing(3,2,3,2),borderRadius:t.shape.borderRadiusLarge})),Xp=({open:t,close:s})=>{const{data:n}=za();return e.jsx(jr,{open:t,onClose:s,label:"Project status",onClick:o=>{o.target instanceof HTMLAnchorElement&&s()},children:e.jsxs(qp,{children:[e.jsx(Yp,{children:e.jsx(Jp,{children:"Seats used"})}),e.jsxs(Vp,{children:[e.jsxs(ro,{children:[e.jsx(io,{children:"Last 30 days"}),e.jsxs(Zp,{children:[e.jsxs(Qp,{children:[e.jsxs(k,{fontWeight:"bold",children:[n.licensedUsers.current,"/",n.seatCount]}),e.jsx(k,{variant:"body2",children:"Seats used over the last 30 days"})]}),e.jsx(Y,{severity:"info",children:"A licensed seat is a unique user that had access to your Unleash instance within the last 30 days, and thereby occupied a seat."})]})]}),e.jsxs(ro,{children:[e.jsx(io,{children:"Last year"}),e.jsx(zp,{licensedUsers:n.licensedUsers.history})]})]}),e.jsx(Kp,{children:e.jsx(N,{variant:"outlined",onClick:s,children:"Close"})})]})})},em=u("button")(({theme:t})=>({background:"none",border:"none",fontSize:"inherit",textDecoration:"underline",color:t.palette.primary.main,cursor:"pointer",padding:0,textAlign:"left"})),tm=u("div")(({theme:t})=>({display:"flex",justifyContent:"space-between",gap:t.spacing(2)})),sm=u("figcaption")(({theme:t})=>({fontSize:t.typography.body2.fontSize,display:"flex",flexFlow:"row wrap",gap:t.spacing(1),justifyContent:"space-between"})),nm=u("figure")(({theme:t})=>({margin:0,display:"flex",flexFlow:"column",justifyContent:"center"})),om=u("span")(({theme:t})=>({fontSize:t.typography.body1.fontSize,fontWeight:"bold"})),am=()=>{const[t,s]=d.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(em,{onClick:()=>{s(!0)},children:"View graph over time"}),e.jsx(Xp,{open:t,close:()=>s(!1)})]})},im=()=>{const{data:t,loading:s}=za(),n=Rt(s,"[data-loading-licensed-users=true]");return e.jsxs(nm,{ref:n,children:[e.jsxs(tm,{children:[e.jsxs(om,{"data-loading-licensed-users":!0,children:[t.licensedUsers.current,"/",t.seatCount]}),e.jsx(tt,{htmlTooltip:!0,tooltip:e.jsx(M,{children:"A licensed seat is a unique user that had access to your instance within the last 30 days, and thereby occupied a seat."})})]}),e.jsxs(sm,{children:[e.jsx("span",{children:"Seats used over the last 30 days"}),e.jsx(am,{})]})]})},rm=u(M)(({theme:t})=>({display:"flex",flexFlow:"row",gap:t.spacing(2),paddingBottom:t.spacing(3)})),lo=u(M)(({theme:t})=>({backgroundColor:t.palette.background.paper,padding:t.spacing(2,3,2,2),borderRadius:`${t.shape.borderRadiusLarge}px`,border:"2px solid",borderColor:t.palette.divider,flex:"auto",display:"flex",flexFlow:"column",justifyContent:"center"})),lm=()=>{const{isEnterprise:t,uiConfig:{billing:s}}=F(),n=t()&&s!=="pay-as-you-go";return e.jsxs(rm,{children:[e.jsx(lo,{children:e.jsx(Wp,{})}),n&&e.jsx(lo,{children:e.jsx(im,{})})]})},cm="/static/upgradeSso-DCY0_83O.png",dm=u(M)(({theme:t})=>({marginTop:t.spacing(10),width:"100%",backgroundColor:t.palette.background.elevation1,borderRadius:t.shape.borderRadiusMedium,padding:t.spacing(2),display:"flex",justifyContent:"center",position:"relative"})),um=u(en)(({theme:t})=>({textDecoration:"none",fontWeight:t.typography.fontWeightBold})),hm=u("img")(({theme:t})=>({width:t.spacing(14)})),pm=u($e)(({theme:t})=>({position:"absolute",top:t.spacing(1.25),right:t.spacing(1.5)})),mm=u(M)(({theme:t})=>({display:"flex",gap:t.spacing(3),marginTop:t.spacing(1),marginBottom:t.spacing(1)})),xm=u(M)(({theme:t})=>({display:"flex",flexDirection:"column",justifyContent:"center",gap:t.spacing(1),maxWidth:t.spacing(60)})),gm=()=>{const[t,s]=ea("upgrade-sso:v1","open");return t==="closed"?null:e.jsxs(dm,{children:[e.jsxs(mm,{children:[e.jsx(hm,{src:ta(cm),alt:"Single sign-on"}),e.jsxs(xm,{children:[e.jsxs("p",{children:["Streamline access and account management, reduce setup time and enhance security with ",e.jsx("b",{children:"Single Sign-On"})," and"," ",e.jsx("b",{children:"Automatic User Provisioning via SCIM"}),"."]}),e.jsx(um,{href:"https://www.getunleash.io/upgrade-unleash?utm_source=oss&utm_medium=feature&utm_content=sso",target:"_blank",children:"View our Enterprise offering"})]})]}),e.jsx(Te,{title:"Dismiss",arrow:!0,children:e.jsx(pm,{"aria-label":"dismiss",onClick:()=>{s("closed")},size:"small",children:e.jsx(sa,{fontSize:"inherit"})})})]})},jm=()=>{const t=Ce(),{isEnterprise:s,isOss:n,uiConfig:{resourceLimits:o}}=F(),{users:a,roles:i,refetch:r,loading:l}=Se(),{setToastData:c,setToastApiError:m}=K(),{removeUser:h,userLoading:p,userApiErrors:g}=Ze(),{downloadCSV:x}=Dp(),[j,b]=d.useState({open:!1}),[y,C]=d.useState({open:!1}),A=kt("showUserDeviceCount"),v=n()&&a.length>3,R=kt("readOnlyUsersUI")&&o.readOnlyUsers,{settings:{enabled:S}}=Ut(),[L,B]=d.useState(!1),[w,H]=d.useState(!1),[P,O]=d.useState(!1),[E,D]=d.useState(""),[I,G]=d.useState(),{planUsers:Z,isBillingUsers:U}=hn(a),[$,W]=d.useState(""),ge=me(Be.breakpoints.down("sm")),mt=me(Be.breakpoints.down("md")),Ot=()=>{B(!1),G(void 0)},Fe=q=>()=>{B(!0),G(q)},xt=q=>()=>{b({open:!0,user:q})},xs=q=>()=>{C({open:!0,user:q})},gs=()=>{b({open:!1})},js=()=>{C({open:!1})},fs=async q=>{try{await h(q.id),c({text:`${q.name} has been deleted`,type:"success"}),r(),Ot()}catch(Qe){m(V(Qe))}},ys=()=>{H(!1),O(!1),D("")},J=d.useMemo(()=>[{Header:"Avatar",accessor:"imageUrl",Cell:({row:{original:q}})=>e.jsx(ae,{children:e.jsx(Je,{user:q})}),disableSortBy:!0,maxWidth:80},{id:"name",Header:"Name",accessor:q=>q.name||"",minWidth:180,Cell:({row:{original:q}})=>e.jsx(ve,{value:q.name,subtitle:q.email||q.username}),searchable:!0},...A?[{id:"warning",Header:" ",accessor:q=>q.name||"",maxWidth:40,Cell:({row:{original:q}})=>e.jsx(Fp,{count:q.activeSessions}),searchable:!1,disableSortBy:!0}]:[],{id:"role",Header:"Role",accessor:q=>{var Qe;return((Qe=i.find(Za=>Za.id===q.rootRole))==null?void 0:Qe.name)||""},Cell:({row:{original:q},value:Qe})=>e.jsx(tn,{value:Qe,role:q.rootRole}),maxWidth:120},{Header:"Created",accessor:"createdAt",Cell:je,width:120,maxWidth:120},{id:"last-login",Header:"Last login",accessor:"seenAt",Cell:Me,maxWidth:150},{id:"type",Header:"Type",accessor:"paid",maxWidth:100,Cell:({row:{original:q}})=>e.jsx(Op,{value:U&&q.paid}),sortType:"boolean"},{id:"seatType",Header:"Seat type",accessor:"seatType",maxWidth:100,sortType:"boolean",Cell:ae},{Header:"",id:"Actions",align:"center",Cell:({row:{original:q}})=>e.jsx(Mp,{onEdit:()=>{t(`/admin/users/${q.id}/edit`)},onViewAccess:()=>{t(`/admin/users/${q.id}/access`)},onChangePassword:xt(q),onResetPassword:xs(q),onDelete:Fe(q),isScimUser:S&&!!q.scimId,userId:q.id}),width:80,disableSortBy:!0},{accessor:"username",Header:"Username",searchable:!0},{accessor:"email",Header:"Email",searchable:!0}],[i,t,U,R]),he=d.useMemo(()=>({sortBy:[{id:"createdAt",desc:!0}],hiddenColumns:["username","email",...U?[]:["type"],...R?[]:["seatType"]]}),[U,R]),{data:gt,getSearchText:Va}=dt(J,$,U?Z:a),{headerGroups:Ya,rows:bs,prepareRow:Ja,setHiddenColumns:Ka}=z.useTable({columns:J,data:gt,initialState:he,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:ae}},z.useSortBy,z.useFlexLayout);return Pt([{condition:!U||mt,columns:["type"]},{condition:!R||mt,columns:["seatType"]},{condition:ge,columns:["imageUrl","role"]},{condition:mt,columns:["createdAt","last-login","warning"]}],Ka,J),e.jsxs(se,{isLoading:l,header:e.jsx(ne,{title:`Users (${bs.length})`,actions:e.jsxs(e.Fragment,{children:[e.jsx(ue,{initialValue:$,onChange:W}),e.jsx(ne.Divider,{}),e.jsx(Te,{title:"Exports user access information",arrow:!0,describeChild:!0,children:e.jsx($e,{onClick:x,children:e.jsx(Go,{})})}),e.jsx(N,{variant:"contained",color:"primary",onClick:()=>t("/admin/create-user"),children:"Add new user"})]})}),children:[e.jsx(Np,{}),e.jsx(T,{condition:s(),show:e.jsx(Wa,{children:e.jsx(oe,{to:"/admin/users/inactive",children:"View inactive users"})})}),e.jsx(lm,{}),e.jsx(Ne,{value:Va($),children:e.jsx(be,{rows:bs,headerGroups:Ya,prepareRow:Ja})}),e.jsx(T,{condition:bs.length===0,show:e.jsx(T,{condition:($==null?void 0:$.length)>0,show:e.jsxs(le,{children:["No users found matching “",$,"”"]}),elseShow:e.jsx(le,{children:e.jsx("span",{"data-loading":!0,children:"No users available. Get started by adding one."})})})}),e.jsx(Na,{open:w,closeConfirm:ys,emailSent:P,inviteLink:E}),e.jsx(T,{condition:!!j.user,show:()=>e.jsx(Tp,{showDialog:j.open,closeDialog:gs,user:j.user})}),e.jsx(T,{condition:!!y.user,show:()=>e.jsx(Ep,{showDialog:y.open,closeDialog:js,user:y.user})}),e.jsx(T,{condition:!!I,show:e.jsx(Rp,{showDialog:L,closeDialog:Ot,user:I,removeUser:()=>fs(I),userLoading:p,userApiErrors:g})}),v?e.jsx(gm,{}):null]})},fm=()=>{d.useEffect(()=>{Gs()},[]);const{uiConfig:t}=F(),{setToastData:s,setToastApiError:n}=K(),o=ls("id"),{user:a,refetch:i}=na(o),{updateUser:r,userLoading:l}=Ze(),c=Ce(),{name:m,setName:h,email:p,setEmail:g,sendEmail:x,setSendEmail:j,rootRole:b,setRootRole:y,getAddUserPayload:C,validateName:A,errors:v,clearErrors:R}=Ma(a==null?void 0:a.name,a==null?void 0:a.email,a==null?void 0:a.rootRole),S=()=>`curl --location --request PUT '${t.unleashUrl}/api/admin/user-admin/${o}' \\
33
+ --header 'Authorization: INSERT_API_KEY' \\
34
+ --header 'Content-Type: application/json' \\
35
+ --data-raw '${JSON.stringify(C(),void 0,2)}'`,L=async w=>{w.preventDefault();const H=C();if(A())try{await r({...H,id:o}),i(),c("/admin/users"),s({text:"User information updated",type:"success"})}catch(O){n(V(O))}},B=()=>{c(Pe)};return e.jsx(Ee,{loading:l,title:"Edit user",description:"In order for a user to get access to Unleash, they need to be assigned a root role, such as Viewer, Editor, or Admin.",documentationLink:"https://docs.getunleash.io/concepts/rbac#predefined-roles",documentationLinkLabel:"User management documentation",formatApiCode:S,children:e.jsx(_a,{errors:v,handleSubmit:L,handleCancel:B,name:m,setName:h,email:p,setEmail:g,sendEmail:x,setSendEmail:j,rootRole:b,setRootRole:y,clearErrors:R,mode:Qs,children:e.jsx(Bo,{permission:Q})})})},ym=()=>{const{data:t,error:s,mutate:n}=we(te("api/admin/user-admin/inactive"),bm);return d.useMemo(()=>({inactiveUsers:(t==null?void 0:t.inactiveUsers)??[],error:s,refetchInactiveUsers:()=>n(),loading:!s&&!t}),[t,s,n])},bm=t=>fetch(t).then(ce("User")).then(s=>s.json()),co="delInactiveUsers",Sm=()=>{const{makeRequest:t,createRequest:s,errors:n,loading:o}=xe({propagateErrors:!0});return{deleteInactiveUsers:async i=>{const l=s("api/admin/user-admin/inactive/delete",{method:"POST",body:JSON.stringify({ids:i})});return t(l.caller,l.id)},errors:n,loading:o}},vm=u(M)(()=>({display:"flex",justifyContent:"center"})),Cm=({onDelete:t})=>e.jsx(vm,{children:e.jsx(Ue,{"data-loading":!0,onClick:t,permission:Q,tooltipProps:{title:"Remove user"},children:e.jsx(Le,{})})}),wm=({showDialog:t,closeDialog:s,user:n,userLoading:o,removeUser:a,userApiErrors:i})=>{const r=Rt(o),{classes:l}=ds();return e.jsx(X,{open:t,title:"Really delete user?",onClose:s,onClick:a,primaryButtonText:"Delete user",secondaryButtonText:"Cancel",children:e.jsxs("div",{ref:r,children:[e.jsx(T,{condition:!!i[Jt],show:e.jsx(Y,{"data-loading":!0,severity:"error",style:{margin:"1rem 0"},children:i[Jt]})}),e.jsx("div",{"data-loading":!0,className:l.flexRow,children:e.jsx(k,{variant:"subtitle1",style:{marginLeft:"1rem"},children:n.username||n.email})}),e.jsxs(k,{"data-loading":!0,variant:"body1",style:{marginTop:"1rem"},children:["Are you sure you want to delete"," ",`${n.name||"user"} (${n.email||n.username})`]})]})})},Tm=({showDialog:t,closeDialog:s,inactiveUsersLoading:n,removeInactiveUsers:o,inactiveUserApiErrors:a,inactiveUsers:i})=>{const r=Rt(n);return e.jsx(X,{open:t,title:"Really delete all inactive users?",onClose:s,onClick:o,primaryButtonText:"Delete all inactive users",secondaryButtonText:"Cancel",children:e.jsxs("div",{ref:r,children:[e.jsx(T,{condition:!!a[co],show:e.jsx(Y,{"data-loading":!0,severity:"error",style:{margin:"1rem 0"},children:a[co]})}),e.jsx("div",{style:fr,children:e.jsxs(k,{variant:"subtitle1",children:["You will be deleting"," ",i.length===1?"1 inactive user":`${i.length} inactive users`]})})]})})},km=()=>{const{removeUser:t,userApiErrors:s}=Ze(),{deleteInactiveUsers:n,errors:o}=Sm(),{setToastData:a,setToastApiError:i}=K(),{inactiveUsers:r,refetchInactiveUsers:l,loading:c,error:m}=ym(),{users:h,roles:p,loading:g,refetch:x,error:j}=Se(),[b,y]=d.useState(!1),[C,A]=d.useState(),[v,R]=d.useState(!1),S=()=>{y(!1),A(void 0)},L=U=>$=>{$.preventDefault(),y(!0),A(U)},B=U=>{U.preventDefault(),R(!0)},w=()=>{R(!1)},H=async()=>{try{await n(r.map(U=>U.id)),a({text:"Inactive users has been deleted",type:"success"}),R(!1),l()}catch(U){i(V(U))}},P=async U=>{try{await t(U),a({text:"User has been deleted",type:"success"}),l(),S()}catch($){i(V($))}},O=d.useMemo(()=>r.map(U=>{const $=h.find(W=>W.id===U.id);return{...U,rootRole:$==null?void 0:$.rootRole}}),[r,h]),E=d.useMemo(()=>[{id:"name",Header:"Name",accessor:U=>U.name||"",minWidth:200,Cell:({row:{original:U}})=>e.jsx(ve,{value:U.name,subtitle:U.email||U.username}),searchable:!0},{id:"role",Header:"Role",accessor:U=>{var $;return(($=p.find(W=>W.id===U.rootRole))==null?void 0:$.name)||""},Cell:({row:{original:U},value:$})=>e.jsx(tn,{value:$,role:U.rootRole}),maxWidth:120},{Header:"Created",accessor:"createdAt",Cell:je,width:120,maxWidth:120},{id:"last-login",Header:"Last login",accessor:"seenAt",Cell:Me,maxWidth:150},{id:"pat-last-login",Header:"PAT last used",accessor:"patSeenAt",Cell:Me,maxWidth:150},{id:"Actions",Header:"Actions",align:"center",Cell:({row:{original:U}})=>e.jsx(Cm,{onDelete:L(U)}),width:200,disableSortBy:!0}],[p]),D=d.useMemo(()=>({sortBy:[{id:"createdAt",desc:!0}],hiddenColumns:["username","email"]}),[]),{headerGroups:I,rows:G,prepareRow:Z}=z.useTable({columns:E,data:O,initialState:D,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:ae}},z.useSortBy,z.useFlexLayout);return e.jsxs(se,{isLoading:c,header:e.jsx(ne,{title:`Inactive users (${G.length})`,actions:e.jsx(e.Fragment,{children:e.jsx(N,{variant:"contained",color:"primary",onClick:B,disabled:r.length===0,children:"Delete all inactive users"})})}),children:[e.jsx(Wa,{children:e.jsx(oe,{to:"/admin/users",children:"View all users"})}),e.jsx(be,{rows:G,headerGroups:I,prepareRow:Z}),e.jsx(T,{condition:G.length===0,show:e.jsx(le,{children:"No inactive users found."})}),e.jsx(T,{condition:!!C,show:e.jsx(wm,{showDialog:b,closeDialog:S,user:C,userLoading:g,removeUser:()=>P(C.id),userApiErrors:s})}),e.jsx(Tm,{showDialog:v,closeDialog:w,inactiveUsersLoading:c,inactiveUserApiErrors:o,inactiveUsers:r,removeInactiveUsers:H})]})},uo=({label:t,options:s,value:n,setValue:o,...a})=>e.jsx(wo,{options:s,value:n,onChange:(i,r)=>o(r),renderInput:i=>e.jsx(ee,{...i,label:t,fullWidth:!0}),size:"small",fullWidth:!0,...a}),Em=(t,s,n)=>{const o=`${s?`?project=${s}`:""}${n?`${s?"&":"?"}environment=${n}`:""}`,a=`api/admin/user-admin/${t}/permissions${o}`,{data:i,error:r,mutate:l}=we(te(a),Am);return d.useMemo(()=>({overview:i==null?void 0:i.overview,projectRoles:i==null?void 0:i.projectRoles,rootRole:i==null?void 0:i.rootRole,user:i==null?void 0:i.user,loading:!r&&!i,refetch:()=>l(),error:r}),[i,r,l])},Am=t=>fetch(t).then(ce("User access matrix")).then(s=>s.json()),ho=u("ul")(({theme:t})=>({listStyle:"none",padding:0,margin:0,fontSize:t.fontSizes.smallBody,"& > li":{display:"flex",justifyContent:"space-between",padding:t.spacing(2),borderBottom:`1px solid ${t.palette.divider}`},"& ul li":{paddingLeft:t.spacing(4)},"& ul:last-of-type > li:last-child":{borderBottom:"none"}})),Rm=u("div",{shouldForwardProp:t=>t!=="hasPermission"})(({theme:t,hasPermission:s})=>({display:"flex",gap:t.spacing(1),alignItems:"center",width:t.spacing(17.5),color:s?t.palette.text.primary:t.palette.text.secondary,"& > svg":{color:s?t.palette.success.main:t.palette.error.main}})),Dm=({categories:t})=>{const{searchQuery:s}=Ks();return e.jsx(M,{sx:{maxHeight:500,overflow:"auto"},children:e.jsx(ho,{children:t.map(n=>e.jsxs(e.Fragment,{children:[e.jsx("li",{children:e.jsx("strong",{children:n.label})},n.label),e.jsx(ho,{children:n.permissions.map(o=>e.jsxs("li",{children:[e.jsx("div",{children:e.jsx(Vt,{search:s,children:o.displayName})}),e.jsx(Im,{hasPermission:o.hasPermission})]},o.name))})]}))})})},Im=({hasPermission:t})=>e.jsx(Rm,{hasPermission:t,children:t?e.jsxs(e.Fragment,{children:[e.jsx(Vs,{}),"Has permission"]}):e.jsxs(e.Fragment,{children:[e.jsx(sa,{}),"No permission"]})}),Pm=u(es)(({theme:t})=>({border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadiusLarge,overflow:"hidden",boxShadow:"none",margin:0,"&:before":{display:"none"}})),Lm=u(ts)(({theme:t})=>({backgroundColor:t.palette.background.elevation1,"& .MuiAccordionSummary-content":{justifyContent:"space-between",alignItems:"center",minHeight:"30px"}})),Bm=u("div")(({theme:t})=>({display:"flex",alignItems:"start",flexDirection:"column",gap:t.spacing(.5)})),Um=u("span")(({theme:t})=>({fontWeight:t.fontWeight.bold})),Om=u("span")(({theme:t})=>({color:t.palette.text.secondary,fontSize:t.fontSizes.smallBody,marginRight:t.spacing(1)})),$m=u(ns)(({theme:t})=>({padding:0})),Us=({categories:t,children:s})=>{const n=t.flatMap(({permissions:o})=>o);return e.jsxs(Pm,{children:[e.jsxs(Lm,{expandIcon:e.jsx(ss,{}),children:[e.jsx(Bm,{children:e.jsx(Um,{children:s})}),e.jsxs(Om,{children:[n.filter(({hasPermission:o})=>o).length,"/",n.length," permissions"]})]}),e.jsx($m,{children:e.jsx(Dm,{categories:t})})]})},_m=u("div")(({theme:t})=>({display:"flex",flex:1,gap:t.spacing(1),maxWidth:800,[t.breakpoints.down("md")]:{flexDirection:"column",maxWidth:"100%"},"& > div":{width:"100%"}})),Mm=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(2)})),Os=(t,s)=>{const n=s.toLowerCase(),o=t.permissions.filter(({displayName:a})=>a.toLowerCase().includes(n));if(o.length)return{...t,permissions:o}},Nm=()=>{const t=ls("id"),[s,n]=yr({project:wn,environment:wn}),{projects:o}=vo(),{environments:a}=br(),{user:i,loading:r}=na(t),l=me(Be.breakpoints.down("md")),[c,m]=d.useState(""),[h,p]=d.useState(s.project??""),[g,x]=d.useState(s.environment??void 0),{overview:j,rootRole:b,projectRoles:y}=Em(t,h,g);d.useEffect(()=>{n({project:h||void 0,environment:g},"replace")},[h,g]);const C=e.jsxs(_m,{children:[e.jsx(ue,{initialValue:c,onChange:m}),e.jsx(uo,{label:"Project",options:o,getOptionLabel:S=>(S==null?void 0:S.name)??"",value:o.find(({id:S})=>S===h),setValue:S=>p((S==null?void 0:S.id)??"")}),e.jsx(uo,{label:"Environment",options:a,getOptionLabel:S=>(S==null?void 0:S.name.concat(S.enabled?"":" - deprecated"))??"",value:a.find(({name:S})=>S===g),setValue:S=>x(S==null?void 0:S.name)})]}),A=d.useMemo(()=>{const S=Vo((j==null?void 0:j.root)??[]);return c?S.map(L=>Os(L,c)).filter(Boolean):S},[j==null?void 0:j.root,c]),v=d.useMemo(()=>La((j==null?void 0:j.project)??[]).map(({label:L,permissions:B})=>({label:L,permissions:B.map(([w])=>w)})).map(L=>Os(L,c)).filter(Boolean),[j==null?void 0:j.project,c]),R=d.useMemo(()=>qo((j==null?void 0:j.environment)??[]).map(L=>Os(L,c)).filter(Boolean),[j==null?void 0:j.environment,c]);return e.jsx(se,{isLoading:r,header:e.jsx(ne,{title:`Access overview for ${i.name||i.email||i.username}`,actions:e.jsx(T,{condition:!l,show:C}),children:e.jsx(T,{condition:l,show:C})}),children:e.jsx(Mm,{children:e.jsxs(Ne,{value:c,children:[e.jsxs(Us,{categories:A,children:["Root permissions for role ",b==null?void 0:b.name]}),e.jsxs(Us,{categories:v,children:["Project permissions",h?` for project ${h}${y!=null&&y.length?` with project role${y.length!==1?"s":""} ${y==null?void 0:y.map(S=>S.name).join(", ")}`:""}`:""]}),g&&e.jsxs(Us,{categories:R,children:["Environment permissions for ",g]})]})})})},Fm=()=>{const{isEnterprise:t}=F();return e.jsx("div",{children:e.jsx(fe,{permissions:Q,children:e.jsxs(at,{children:[e.jsx(_,{index:!0,element:e.jsx(e.Fragment,{children:e.jsx(jm,{})})}),e.jsx(_,{path:":id/edit",element:e.jsx(fm,{})}),e.jsx(_,{path:":id/access",element:e.jsx(Nm,{})}),e.jsx(_,{path:"inactive",element:e.jsx(T,{condition:t(),show:e.jsx(km,{}),elseShow:e.jsx(ot,{feature:"inactive-users",page:!0})})}),e.jsx(_,{path:"*",element:e.jsx(oa,{})})]})})})},bt="api/admin/banners",Ha=()=>{const{loading:t,makeRequest:s,createRequest:n,errors:o}=xe({propagateErrors:!0}),a=async h=>{const g=n(bt,{method:"POST",body:JSON.stringify(h)},"addBanner");return(await s(g.caller,g.id)).json()},i=async(h,p)=>{const x=n(`${bt}/${h}`,{method:"PUT",body:JSON.stringify(p)},"updateBanner");await s(x.caller,x.id)},r=async h=>{const g=n(`${bt}/${h}/on`,{method:"POST"},"enableBanner");await s(g.caller,g.id)},l=async h=>{const g=n(`${bt}/${h}/off`,{method:"POST"},"disableBanner");await s(g.caller,g.id)};return{addBanner:a,updateBanner:i,removeBanner:async h=>{const g=n(`${bt}/${h}`,{method:"DELETE"},"removeBanner");await s(g.caller,g.id)},toggleBanner:async(h,p)=>{p?await r(h):await l(h)},errors:o,loading:t}},Gm=u(M)(()=>({display:"flex",justifyContent:"center"})),Wm=({onEdit:t,onDelete:s})=>e.jsxs(Gm,{children:[e.jsx(Ue,{"data-loading":!0,onClick:t,permission:Q,tooltipProps:{title:"Edit banner"},children:e.jsx(Dt,{})}),e.jsx(Ue,{"data-loading":!0,onClick:s,permission:Q,tooltipProps:{title:"Remove banner"},children:e.jsx(Le,{})})]}),zm=({banner:t,open:s,setOpen:n,onConfirm:o})=>e.jsx(X,{title:"Delete banner?",open:s,primaryButtonText:"Delete banner",secondaryButtonText:"Cancel",onClick:()=>o(t),onClose:()=>{n(!1)},children:e.jsxs("p",{children:["You are about to delete banner: ",e.jsx("strong",{children:t==null?void 0:t.message})]})}),Hm=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(4)})),qm=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"center",padding:t.spacing(1.5),gap:t.spacing(1.5),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadiusMedium})),Vm=u("p")(({theme:t})=>({fontSize:t.fontSizes.smallBody,color:t.palette.text.secondary})),Ym=u("div")(({theme:t})=>({background:t.palette.background.elevation1,padding:t.spacing(2,3),borderRadius:t.shape.borderRadiusLarge})),$s=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(1.5)})),_s=u("p")(({theme:t})=>({fontWeight:t.fontWeight.bold})),Ae=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(1)})),Re=u("p")(({theme:t})=>({display:"flex",color:t.palette.text.primary})),Xe=u(Ke)({width:"100%"}),Ms=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",padding:t.spacing(.5),gap:t.spacing(.5)})),Ns=u(Qo)(({theme:t})=>({width:"100%",maxWidth:t.spacing(50)})),Jm=u(N)(({theme:t})=>({marginRight:"auto"})),Km=[{key:"info",label:"Information"},{key:"warning",label:"Warning"},{key:"error",label:"Error"},{key:"success",label:"Success"}],po=t=>t===""?"Default":t==="none"?"None":"Custom",mo=t=>t===""?"None":t==="dialog"?"Dialog":"Link",Zm=({enabled:t,message:s,variant:n,sticky:o,icon:a,link:i,linkText:r,dialogTitle:l,dialog:c,setEnabled:m,setMessage:h,setVariant:p,setSticky:g,setIcon:x,setLink:j,setLinkText:b,setDialogTitle:y,setDialog:C})=>{const[A,v]=d.useState(!1),[R,S]=d.useState(()=>po(a)),[L,B]=d.useState(()=>mo(i));return d.useEffect(()=>{S(po(a)),B(mo(i))},[a,i]),e.jsxs(Hm,{children:[e.jsxs(qm,{children:[e.jsx(Vm,{children:"Banner preview:"}),e.jsx(aa,{banner:{message:s||"*No message set. Please enter a message below.*",variant:n,sticky:!1,icon:a,link:i,linkText:r,dialogTitle:l,dialog:c},inline:!0})]}),e.jsx(Ym,{children:e.jsx(Sr,{checked:t,setChecked:m,children:"Banner status"})}),e.jsxs($s,{children:[e.jsx(_s,{children:"Configuration"}),e.jsxs(Ae,{children:[e.jsx(Re,{children:"What type of banner is it?"}),e.jsx(Ns,{size:"small",value:n,onChange:w=>p(w),options:Km})]}),e.jsxs(Ae,{children:[e.jsx(Re,{children:"What icon should be displayed on the banner?"}),e.jsx(Ns,{size:"small",value:R,onChange:w=>{S(w),x(w==="None"?"none":"")},options:["Default","Custom","None"].map(w=>({key:w,label:w}))})]}),e.jsx(T,{condition:R==="Custom",show:e.jsxs(Ae,{children:[e.jsxs(Re,{children:["Which custom icon?",e.jsx(tt,{htmlTooltip:!0,tooltip:e.jsxs(Ms,{children:[e.jsxs("p",{children:["Choose an icon from"," ",e.jsx("a",{href:"https://fonts.google.com/icons",target:"_blank",rel:"noreferrer",children:"Material Symbols"}),"."]}),e.jsx("p",{children:'For example, if you want to display the "Rocket Launch" icon, you can enter "rocket_launch" in the field below.'})]})})]}),e.jsx(Xe,{label:"Banner icon",value:a,onChange:w=>x(w.target.value),autoComplete:"off"})]})}),e.jsxs(Ae,{children:[e.jsxs(Re,{children:["What is your banner message?",e.jsx(tt,{htmlTooltip:!0,tooltip:e.jsx(Ms,{children:e.jsxs("p",{children:[e.jsx("a",{href:"https://www.markdownguide.org/basic-syntax/",target:"_blank",rel:"noreferrer",children:"Markdown"})," ","is supported."]})})})]}),e.jsx(Xe,{autoFocus:!0,label:"Banner message",multiline:!0,minRows:2,maxRows:6,value:s,onChange:w=>h(w.target.value),autoComplete:"off",required:!0})]})]}),e.jsxs($s,{children:[e.jsx(_s,{children:"Banner action"}),e.jsxs(Ae,{children:[e.jsx(Re,{children:"What action should be available in the banner?"}),e.jsx(Ns,{size:"small",value:L,onChange:w=>{B(w),j(w==="Dialog"?"dialog":""),b(""),y(""),C("")},options:["None","Link","Dialog"].map(w=>({key:w,label:w}))})]}),e.jsx(T,{condition:L==="Link",show:e.jsxs(Ae,{children:[e.jsx(Re,{children:"What URL should be opened?"}),e.jsx(Xe,{label:"URL",value:i,onChange:w=>j(w.target.value),onBlur:()=>{r||b(i)},autoComplete:"off"})]})}),e.jsx(T,{condition:L!=="None",show:e.jsxs(Ae,{children:[e.jsx(Re,{children:"What is the action text?"}),e.jsx(Xe,{label:"Action text",value:r,onChange:w=>b(w.target.value),autoComplete:"off"})]})}),e.jsx(T,{condition:L==="Dialog",show:e.jsxs(e.Fragment,{children:[e.jsxs(Ae,{children:[e.jsx(Re,{children:"What is the dialog title?"}),e.jsx(Xe,{label:"Dialog title",value:l,onChange:w=>y(w.target.value),autoComplete:"off"})]}),e.jsxs(Ae,{children:[e.jsxs(Re,{children:["What is the dialog content?",e.jsx(tt,{htmlTooltip:!0,tooltip:e.jsx(Ms,{children:e.jsxs("p",{children:[e.jsx("a",{href:"https://www.markdownguide.org/basic-syntax/",target:"_blank",rel:"noreferrer",children:"Markdown"})," ","is supported."]})})})]}),e.jsx(Xe,{label:"Dialog content",multiline:!0,minRows:4,value:c,onChange:w=>C(w.target.value),autoComplete:"off"})]}),e.jsx(Jm,{variant:"outlined",color:"primary",startIcon:e.jsx(vr,{}),onClick:()=>v(!0),children:"Preview dialog"}),e.jsx(Cr,{open:A,setOpen:v,title:l||r,children:c})]})})]}),e.jsxs($s,{children:[e.jsx(_s,{children:"Sticky banner"}),e.jsx(re,{control:e.jsx(as,{checked:o,onChange:w=>g(w.target.checked)}),label:"Make the banner sticky on the screen when scrolling"})]})]})},Qm=u("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),Xm=u("div")(({theme:t})=>({marginTop:"auto",display:"flex",justifyContent:"flex-end",paddingTop:t.spacing(4)})),ex=u(N)(({theme:t})=>({marginLeft:t.spacing(3)})),tx=({banner:t,open:s,setOpen:n})=>{const{refetch:o}=ia(),{addBanner:a,updateBanner:i,loading:r}=Ha(),{setToastData:l,setToastApiError:c}=K(),{uiConfig:m}=F(),[h,p]=d.useState(!0),[g,x]=d.useState(""),[j,b]=d.useState("info"),[y,C]=d.useState(!1),[A,v]=d.useState(""),[R,S]=d.useState(""),[L,B]=d.useState(""),[w,H]=d.useState(""),[P,O]=d.useState("");d.useEffect(()=>{p((t==null?void 0:t.enabled)??!0),x((t==null?void 0:t.message)||""),b((t==null?void 0:t.variant)||"info"),C((t==null?void 0:t.sticky)||!1),v((t==null?void 0:t.icon)||""),S((t==null?void 0:t.link)||""),B((t==null?void 0:t.linkText)||""),H((t==null?void 0:t.dialogTitle)||""),O(typeof(t==null?void 0:t.dialog)=="string"?t==null?void 0:t.dialog:"")},[s,t]);const E=t!==void 0,D=E?"Edit banner":"New banner",I=g.length,G={enabled:h,variant:j,icon:A,message:g,link:R,linkText:L,dialogTitle:w,dialog:P,sticky:y},Z=()=>`curl --location --request ${E?"PUT":"POST"} '${m.unleashUrl}/api/admin/banners${E?`/${t.id}`:""}' \\
36
+ --header 'Authorization: INSERT_API_KEY' \\
37
+ --header 'Content-Type: application/json' \\
38
+ --data-raw '${JSON.stringify(G,void 0,2)}'`,U=async $=>{if($.preventDefault(),!!I)try{E?await i(t.id,G):await a(G),l({text:`Banner ${E?"updated":"added"} successfully`,type:"success"}),o(),n(!1)}catch(W){c(V(W))}};return e.jsx(is,{open:s,onClose:()=>{n(!1)},label:D,children:e.jsx(Ee,{loading:r,modal:!0,title:D,description:"Banners allow you to display messages to other users inside your Unleash instance.",documentationLink:"https://docs.getunleash.io/concepts/banners",documentationLinkLabel:"Banners documentation",formatApiCode:Z,children:e.jsxs(Qm,{onSubmit:U,children:[e.jsx(Zm,{enabled:h,message:g,variant:j,sticky:y,icon:A,link:R,linkText:L,dialogTitle:w,dialog:P,setEnabled:p,setMessage:x,setVariant:b,setSticky:C,setIcon:v,setLink:S,setLinkText:B,setDialogTitle:H,setDialog:O}),e.jsxs(Xm,{children:[e.jsxs(N,{type:"submit",variant:"contained",color:"primary",disabled:!I,children:[E?"Save":"Add"," banner"]}),e.jsx(ex,{onClick:()=>{n(!1)},children:"Cancel"})]})]})})})},sx=()=>{const{setToastData:t,setToastApiError:s}=K(),{banners:n,refetch:o,loading:a}=ia(),{toggleBanner:i,removeBanner:r}=Ha(),[l,c]=d.useState(""),[m,h]=d.useState(!1),[p,g]=d.useState(!1),[x,j]=d.useState(),b=async(P,O)=>{try{await i(P.id,O),t({text:`"${P.message}" has been ${O?"enabled":"disabled"}`,type:"success"}),o()}catch(E){s(V(E))}},y=async P=>{try{await r(P.id),t({text:`"${P.message}" has been deleted`,type:"success"}),o(),g(!1)}catch(O){s(V(O))}},C=me(Be.breakpoints.down("md")),A=d.useMemo(()=>[{Header:"Banner",accessor:"message",Cell:({row:{original:P}})=>e.jsx(aa,{banner:{...P,sticky:!1},inline:!0,maxHeight:42}),disableSortBy:!0,minWidth:200,searchable:!0},{Header:"Created",accessor:"createdAt",Cell:je,width:120,maxWidth:120},{Header:"Enabled",accessor:"enabled",Cell:({row:{original:P}})=>e.jsx(wr,{checked:P.enabled,setChecked:O=>b(P,O)}),sortType:"boolean",width:90,maxWidth:90},{Header:"Actions",id:"Actions",align:"center",Cell:({row:{original:P}})=>e.jsx(Wm,{onEdit:()=>{j(P),h(!0)},onDelete:()=>{j(P),g(!0)}}),width:100,disableSortBy:!0}],[]),[v]=d.useState({sortBy:[{id:"createdAt",desc:!0}]}),{data:R,getSearchText:S}=dt(A,l,n),{headerGroups:L,rows:B,prepareRow:w,setHiddenColumns:H}=z.useTable({columns:A,data:R,initialState:v,sortTypes:ye,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:ae}},z.useSortBy,z.useFlexLayout);return Pt([{condition:C,columns:["createdAt"]}],H,A),e.jsxs(se,{isLoading:a,header:e.jsx(ne,{title:`Banners (${B.length})`,actions:e.jsxs(e.Fragment,{children:[e.jsx(T,{condition:!C,show:e.jsxs(e.Fragment,{children:[e.jsx(ue,{initialValue:l,onChange:c}),e.jsx(ne.Divider,{})]})}),e.jsx(N,{variant:"contained",color:"primary",onClick:()=>{j(void 0),h(!0)},children:"New banner"})]}),children:e.jsx(T,{condition:C,show:e.jsx(ue,{initialValue:l,onChange:c})})}),children:[e.jsx(Ne,{value:S(l),children:e.jsx(be,{rows:B,headerGroups:L,prepareRow:w})}),e.jsx(T,{condition:B.length===0,show:e.jsx(T,{condition:(l==null?void 0:l.length)>0,show:e.jsxs(le,{children:["No banners found matching “",l,"”"]}),elseShow:e.jsx(le,{children:"No banners available. Get started by adding one."})})}),e.jsx(tx,{banner:x,open:m,setOpen:h}),e.jsx(zm,{banner:x,open:p,setOpen:g,onConfirm:y})]})},nx=()=>{const{isEnterprise:t}=F();return t()?e.jsx("div",{children:e.jsx(fe,{permissions:[Q,Tr],children:e.jsx(sx,{})})}):e.jsx(ot,{feature:"banners",page:!0})},ox=async(t,s)=>{if(t){if(s){const n=await s.json();throw t({message:n.message}),new Error(n.message)}throw new Error("Did not receive a response from the server.")}},ax=()=>{const{makeRequest:t,createRequest:s,errors:n,loading:o}=xe({propagateErrors:!0,handleBadRequest:ox});return{updateLicenseKey:async i=>{const l=s("api/admin/license",{method:"POST",body:JSON.stringify({token:i})});await t(l.caller,l.id)},errors:n,loading:o}},ix=u(M)(({theme:t})=>({display:"grid",gap:t.spacing(4)})),St=u("div")(()=>({display:"table-row"})),vt=u("p")(({theme:t})=>({display:"table-cell",fontWeight:t.fontWeight.bold,paddingTop:t.spacing(2)})),Ct=u("p")(({theme:t})=>({display:"table-cell",paddingTop:t.spacing(2),paddingLeft:t.spacing(4)})),rx=()=>{const{setToastData:t,setToastApiError:s}=K(),{license:n,error:o,refetchLicense:a}=kr(),{reCheckLicense:i}=Er(),{loading:r}=F(),{locationSettings:l}=Do(),[c,m]=d.useState(""),{updateLicenseKey:h}=ax(),p=j=>{m(j.target.value.trim())};if(r||!n)return null;const g=async j=>{j.preventDefault();try{await h(c),t({text:"License key updated",type:"success"}),a(),i()}catch(b){s(V(b))}},x={Seats:n.resources.seats,"Release templates":n.resources.releaseTemplates,"Edge instances":n.resources.edgeInstances};return e.jsx(se,{header:e.jsx(ne,{title:"Unleash Enterprise License"}),children:e.jsxs(ix,{children:[e.jsx(T,{condition:!!n.token,show:e.jsxs("div",{children:[e.jsxs(St,{children:[e.jsx(vt,{children:"Customer"}),e.jsx(Ct,{children:n.customer})]}),e.jsxs(St,{children:[e.jsx(vt,{children:"Instance Name"}),e.jsx(Ct,{children:n.instanceName})]}),e.jsxs(St,{children:[e.jsx(vt,{children:"Plan"}),e.jsx(Ct,{children:n.plan})]}),Object.entries(x).map(([j,b])=>b&&e.jsxs(St,{children:[e.jsx(vt,{children:j}),e.jsx(Ct,{children:b})]},j)),e.jsxs(St,{children:[e.jsx(vt,{children:"Expire at"}),e.jsx(Ct,{children:Lo(n.expireAt,l.locale)})]})]}),elseShow:e.jsx("p",{children:"You do not have a registered Unleash Enterprise License."})}),e.jsxs("form",{onSubmit:g,children:[e.jsx(ee,{onChange:p,label:"New license key",name:"licenseKey",value:c,style:{width:"100%"},variant:"outlined",size:"small",multiline:!0,rows:6,required:!0}),e.jsx(f,{container:!0,spacing:3,marginTop:2,children:e.jsxs(f,{item:!0,md:5,children:[e.jsx(N,{variant:"contained",color:"primary",type:"submit",disabled:r,children:"Update license key"})," ",e.jsx("p",{children:e.jsx("small",{style:{color:"red"},children:o==null?void 0:o.message})})]})})]})]})})},lx=()=>e.jsx("div",{children:e.jsx(fe,{permissions:[Q],children:e.jsx(rx,{})})});var mn={},cx=ct;Object.defineProperty(mn,"__esModule",{value:!0});var qa=mn.default=void 0,dx=cx(lt()),ux=e,hx=(0,dx.default)((0,ux.jsx)("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward");qa=mn.default=hx;const px="/static/easyToDeploy-rluTX8sF.png",mx=t=>d.createElement("svg",{width:312,height:145,viewBox:"0 0 312 145",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},d.createElement("rect",{width:312,height:144.519,rx:8,fill:"#F1F0FC"}),d.createElement("g",{opacity:.2},d.createElement("circle",{cx:159.392,cy:72.1494,r:59.9326,stroke:"#657A80",strokeWidth:1.35669,strokeLinecap:"square"}),d.createElement("ellipse",{cx:159.392,cy:72.2595,rx:43.5873,ry:60.2595,stroke:"#657A80",strokeWidth:1.35669,strokeLinecap:"square"}),d.createElement("ellipse",{cx:159.828,cy:72.1494,rx:27.2421,ry:59.9326,stroke:"#657A80",strokeWidth:1.35669,strokeLinecap:"square"}),d.createElement("ellipse",{cx:159.828,cy:72.1494,rx:10.8968,ry:59.9326,stroke:"#657A80",strokeWidth:1.35669,strokeLinecap:"square"})),d.createElement("g",{opacity:.2},d.createElement("mask",{id:"mask0_35832_1341",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:99,y:12,width:121,height:121},d.createElement("circle",{cx:159.392,cy:72.1494,r:59.2542,fill:"#92A1A5",stroke:"#657A80",strokeWidth:1.35669})),d.createElement("g",{mask:"url(#mask0_35832_1341)"},d.createElement("path",{d:"M99.4591 48.1777C99.4591 48.1777 112.535 59.2925 159.392 59.2925C206.248 59.2925 219.324 48.1777 219.324 48.1777",stroke:"#657A80",strokeWidth:1.35669}),d.createElement("path",{d:"M99.4591 28.3438C99.4591 28.3438 112.535 45.7787 159.392 45.7787C206.248 45.7787 219.324 28.3438 219.324 28.3438",stroke:"#657A80",strokeWidth:1.35669}),d.createElement("path",{d:"M99.4591 2.19141C99.4591 2.19141 112.535 33.1384 159.392 33.1384C206.248 33.1384 219.324 2.19141 219.324 2.19141",stroke:"#657A80",strokeWidth:1.35669}),d.createElement("path",{d:"M99.4591 -39.4336C99.4591 -39.4336 112.535 21.3707 159.392 21.3707C206.248 21.3707 219.324 -39.4336 219.324 -39.4336",stroke:"#657A80",strokeWidth:1.35669}),d.createElement("line",{x1:99.4591,y1:71.472,x2:219.324,y2:71.472,stroke:"#657A80",strokeWidth:1.35669}),d.createElement("path",{d:"M219.325 95.6855C219.325 95.6855 206.249 84.5708 159.392 84.5708C112.536 84.5708 99.4596 95.6855 99.4596 95.6855",stroke:"#657A80",strokeWidth:1.35669}),d.createElement("path",{d:"M219.325 115.518C219.325 115.518 206.249 98.0826 159.392 98.0826C112.536 98.0826 99.4596 115.518 99.4596 115.518",stroke:"#657A80",strokeWidth:1.35669}),d.createElement("path",{d:"M219.325 141.672C219.325 141.672 206.249 110.725 159.392 110.725C112.536 110.725 99.4596 141.672 99.4596 141.672",stroke:"#657A80",strokeWidth:1.35669}),d.createElement("path",{d:"M219.325 183.297C219.325 183.297 206.248 122.493 159.392 122.493C112.536 122.493 99.4594 183.297 99.4594 183.297",stroke:"#657A80",strokeWidth:1.35669}))),d.createElement("rect",{x:184.932,y:83.9727,width:51.1664,height:25.5832,rx:12.7916,transform:"rotate(-180 184.932 83.9727)",fill:"url(#paint0_linear_35832_1341)"}),d.createElement("ellipse",{cx:172.107,cy:71.1803,rx:12.8251,ry:12.7916,fill:"#817AFE"}),d.createElement("path",{d:"M175.693 67.627H168.587V74.7334H175.693V67.627Z",fill:"white"}),d.createElement("path",{d:"M139.097 58.4531L139.004 51.4804L133.012 55.0473L139.097 58.4531ZM123.133 50.0488L129.385 53.1377L128.934 46.1789L123.133 50.0488ZM136.317 53.7832L136.728 53.3399C135.792 52.474 134.566 51.5847 132.963 50.7408L132.682 51.2751L132.4 51.8095C133.918 52.6085 135.055 53.4382 135.907 54.2265L136.317 53.7832ZM132.682 51.2751L132.963 50.7408C131.36 49.8968 129.933 49.3899 128.69 49.1084L128.556 49.6974L128.423 50.2864C129.555 50.5427 130.883 51.0105 132.4 51.8095L132.682 51.2751Z",fill:"#6C65E5"}),d.createElement("path",{d:"M183.041 43.7773L176.874 40.5221L177.139 47.4904L183.041 43.7773ZM167.263 56.659L172.082 51.6188L165.308 49.9655L167.263 56.659ZM177.61 43.9834L177.42 43.4101C175.852 43.9294 174.048 44.8631 172.087 46.4639L172.469 46.9317L172.851 47.3995C174.707 45.8841 176.383 45.026 177.8 44.5567L177.61 43.9834ZM172.469 46.9317L172.087 46.4639C170.126 48.0648 168.851 49.6454 168.028 51.0778L168.552 51.3785L169.076 51.6792C169.819 50.3847 170.995 48.9149 172.851 47.3995L172.469 46.9317Z",fill:"#6C65E5"}),d.createElement("path",{d:"M161.818 87.9746L165.538 93.8726L158.57 94.1455L161.818 87.9746ZM152.37 104.338L156.09 98.4405L159.338 104.611L152.37 104.338ZM162.03 93.4062L162.617 93.5508C162.284 94.9012 161.682 96.4622 160.667 98.2196L160.144 97.9176L159.621 97.6157C160.584 95.948 161.14 94.4924 161.444 93.2617L162.03 93.4062ZM160.144 97.9176L160.667 98.2196C159.652 99.977 158.602 101.279 157.599 102.242L157.18 101.807L156.762 101.371C157.676 100.493 158.658 99.2834 159.621 97.6157L160.144 97.9176Z",fill:"#6C65E5"}),d.createElement("rect",{x:122.135,y:56.5781,width:29.4595,height:14.7297,rx:7.36487,transform:"rotate(-180 122.135 56.5781)",fill:"url(#paint1_linear_35832_1341)"}),d.createElement("ellipse",{cx:114.751,cy:49.2125,rx:7.38412,ry:7.36487,fill:"#1A4049"}),d.createElement("path",{d:"M116.816 47.168H112.724V51.2596H116.816V47.168Z",fill:"#EDF0F1"}),d.createElement("rect",{x:215.746,y:51.1504,width:29.4595,height:14.7297,rx:7.36487,transform:"rotate(-180 215.746 51.1504)",fill:"url(#paint2_linear_35832_1341)"}),d.createElement("ellipse",{cx:208.362,cy:43.7848,rx:7.38412,ry:7.36487,fill:"#1A4049"}),d.createElement("path",{d:"M210.428 41.7383H206.336V45.8299H210.428V41.7383Z",fill:"#EDF0F1"}),d.createElement("rect",{x:150.626,y:116.271,width:29.4595,height:14.7297,rx:7.36487,transform:"rotate(-180 150.626 116.271)",fill:"url(#paint3_linear_35832_1341)"}),d.createElement("ellipse",{cx:143.241,cy:108.906,rx:7.38412,ry:7.36487,fill:"#1A4049"}),d.createElement("path",{d:"M145.306 106.859H141.215V110.951H145.306V106.859Z",fill:"#EDF0F1"}),d.createElement("defs",null,d.createElement("linearGradient",{id:"paint0_linear_35832_1341",x1:184.921,y1:96.703,x2:236.126,y2:96.703,gradientUnits:"userSpaceOnUse"},d.createElement("stop",{stopColor:"#1A4049",stopOpacity:0}),d.createElement("stop",{offset:1,stopColor:"#0E1A1D"})),d.createElement("linearGradient",{id:"paint1_linear_35832_1341",x1:122.129,y1:63.9077,x2:151.611,y2:63.9077,gradientUnits:"userSpaceOnUse"},d.createElement("stop",{stopColor:"#657A80",stopOpacity:0}),d.createElement("stop",{offset:1,stopColor:"#1A4049",stopOpacity:.75})),d.createElement("linearGradient",{id:"paint2_linear_35832_1341",x1:215.74,y1:58.48,x2:245.222,y2:58.48,gradientUnits:"userSpaceOnUse"},d.createElement("stop",{stopColor:"#657A80",stopOpacity:0}),d.createElement("stop",{offset:1,stopColor:"#1A4049",stopOpacity:.75})),d.createElement("linearGradient",{id:"paint3_linear_35832_1341",x1:150.619,y1:123.601,x2:180.101,y2:123.601,gradientUnits:"userSpaceOnUse"},d.createElement("stop",{stopColor:"#657A80",stopOpacity:0}),d.createElement("stop",{offset:1,stopColor:"#1A4049",stopOpacity:.75})))),xx=u(Y)(({theme:t})=>({fontSize:t.typography.body1.fontSize,"& > .MuiAlert-icon":{paddingBlock:"7px"},"& > .MuiAlert-message":{padding:t.spacing(1),display:"flex",flexFlow:"row wrap",justifyContent:"space-between",width:"100%",gap:t.spacing(1)},"&.MuiPaper-root":{backgroundColor:t.palette.secondary.light,color:t.palette.text.primary,border:`1px solid ${t.palette.secondary.border}`}})),gx=u("div")(({theme:t})=>({width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.spacing(2)})),xo=u("div")(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"start",gap:t.spacing(1),flex:"1 1 auto"})),jx=u(N)(({theme:t})=>({"&&":{marginTop:t.spacing(1),color:"white"}})),fx=u(mx)(({theme:t})=>({flex:0,width:"auto",display:"block",[t.breakpoints.down("md")]:{display:"none"}})),yx=({...t})=>{const[s,n]=ea("enterpriseEdgeUIDismissibleAlert","open");return e.jsx(Ar,{in:s==="open",children:e.jsx(xx,{onClose:()=>n("closed"),icon:!1,...t,children:e.jsxs(gx,{children:[e.jsxs(xo,{children:[e.jsx(k,{variant:"h3",children:"Instant flag updates worldwide"}),e.jsx(k,{variant:"body2",color:"text.secondary",children:"Enterprise Edge is a high-performance proxy between your SDKs and Unleash, giving you global reach, minimal latency, and making flag changes instantly available to your users."}),e.jsx(jx,{component:oe,to:"/admin/enterprise-edge",variant:"contained",children:"Check out Enterprise Edge"})]}),e.jsx(xo,{sx:{alignItems:"end"},children:e.jsx(fx,{})})]})})})},pt=1505,bx=u(f)(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(2)})),Sx=u(Ye)(({theme:t})=>({position:"relative",height:t.spacing(44),padding:t.spacing(3),borderRadius:`${t.shape.borderRadiusLarge}px`,boxShadow:"none",color:"white",backgroundColor:t.palette.web.main,overflow:"hidden",[t.breakpoints.down(pt)]:{height:t.spacing(28),paddingBottom:t.spacing(6)},[t.breakpoints.down(800)]:{height:t.spacing(34)}})),vx=u(Ye)(({theme:t})=>({minHeight:t.spacing(44),padding:t.spacing(3),borderRadius:`${t.shape.borderRadiusLarge}px`,boxShadow:"none",[t.breakpoints.up("md")]:{flexDirection:"row",flexWrap:"nowrap"}})),Cx=u(k)(({theme:t})=>({width:"100%",fontSize:t.fontSizes.largeHeader,fontWeight:"bold",marginBottom:t.spacing(1)})),wx=u("div")(({theme:t})=>({marginBottom:t.spacing(6),[t.breakpoints.down(pt)]:{marginBottom:t.spacing()}})),go=u(k)(({theme:t})=>({fontSize:t.fontSizes.bodySize,marginTop:t.spacing(2),marginBottom:t.spacing(2),flexDirection:"row",display:"flex",gap:t.spacing(1),justifyContent:"space-between",[t.breakpoints.down(pt)]:{maxWidth:t.spacing(65)},[t.breakpoints.down(800)]:{flexDirection:"column",justifyContent:"start"}})),jo=u("span")(({theme:t})=>({fontSize:t.fontSizes.bodySize,fontWeight:"bold"})),fo=u("span")({color:"white"}),Tx=u(k)(({theme:t})=>({fontSize:t.fontSizes.mainHeader,marginTop:t.spacing(2),marginBottom:t.spacing(4)})),kx=u(f)(({theme:t})=>({display:"flex",flexDirection:"row",gap:t.spacing(2),justifyContent:"space-between",marginBottom:t.spacing(7)})),Ft=u(f)(({theme:t})=>({width:t.spacing(16),aspectRatio:"1 / 1",padding:t.spacing(2),alignItems:"center",borderRadius:"50%",backgroundColor:t.mode==="light"?"#F1F0FC":"#302E42"})),Gt=u(M)({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),Wt=u(k)(({theme:t})=>({color:t.palette.primary.main,fontSize:t.fontSizes.largeHeader,fontWeight:"bold",marginTop:t.spacing(1)})),zt=u(k)(({theme:t})=>({color:t.palette.text.primary,fontSize:t.fontSizes.bodySize})),Ex=u("div")(({theme:t})=>({display:"flex",justifyContent:"flex-start",marginTop:t.spacing(3)})),Ax=u("div")(({theme:t})=>({position:"absolute",left:t.spacing(2.5),bottom:t.spacing(3),[t.breakpoints.down(pt)]:{position:"static",marginTop:t.spacing(2)}})),Rx=u(oe)(({theme:t})=>({color:t.palette.common.white,textDecoration:"underline !important",fontSize:t.typography.body2.fontSize,display:"flex",alignItems:"center",gap:t.spacing(1)})),Dx=u("div")(({theme:t})=>({display:"flex",justifyContent:"flex-end",marginTop:t.spacing(-6),marginRight:t.spacing(-10),[t.breakpoints.down(pt)]:{marginTop:t.spacing(-22),marginRight:t.spacing(-12),paddingTop:t.spacing(1)},[t.breakpoints.down(800)]:{paddingTop:0}})),Ix=u("img")(({theme:t})=>({width:t.spacing(33),transform:"rotate(180deg)",clipPath:"polygon(21% 28%, 100% 28%, 21% 94%)"})),Px=({plan:t,instanceId:s,version:n})=>e.jsxs(Sx,{children:[e.jsxs(wx,{children:[e.jsx("div",{children:"Current plan"}),e.jsx(Cx,{variant:"h3",children:t})]}),e.jsxs(go,{children:[e.jsx(jo,{children:"Instance id"}),e.jsx(fo,{children:s})]}),e.jsxs(go,{children:[e.jsx(jo,{children:"Unleash version"}),e.jsx(fo,{children:n})]}),e.jsx(Ax,{children:e.jsxs(Rx,{to:"https://docs.getunleash.io/availability#versioning",target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Rr,{sx:{color:o=>o.palette.common.white}}),"Learn about versioning"]})}),e.jsx(Dx,{children:e.jsx(Ix,{src:ta(px)})})]}),Lx=({users:t,featureToggles:s,projects:n,environments:o})=>{const a=Ce();return e.jsxs(vx,{children:[e.jsx(Tx,{children:"Instance statistics"}),e.jsxs(kx,{container:!0,children:[e.jsx(Ft,{item:!0,children:e.jsxs(Gt,{children:[e.jsx(Wt,{children:t}),e.jsx(zt,{children:"Users"})]})}),e.jsx(Ft,{item:!0,children:e.jsxs(Gt,{children:[e.jsx(Wt,{children:s}),e.jsx(zt,{children:"Feature flags"})]})}),e.jsx(Ft,{item:!0,children:e.jsxs(Gt,{children:[e.jsx(Wt,{children:n}),e.jsx(zt,{children:"Projects"})]})}),e.jsx(Ft,{item:!0,children:e.jsxs(Gt,{children:[e.jsx(Wt,{children:o}),e.jsx(zt,{children:"Environments"})]})})]}),e.jsx(Ex,{children:e.jsx(N,{rel:"noreferrer",endIcon:e.jsx(qa,{}),onClick:()=>{a("/admin/instance")},children:"View all instance statistics"})})]})},Bx=()=>{var m,h,p,g,x,j;const t=Aa(),s=It(),n=me(s.breakpoints.down(pt)),o=n?12:7,a=n?12:5,{isOss:i,isPro:r,isEnterprise:l}=F(),c=i()?"Open source":r()?"Pro":l()?"Enterprise":"Unknown";return e.jsxs(bx,{children:[e.jsx(yx,{}),t&&!t.loading&&e.jsxs(f,{container:!0,spacing:3,children:[e.jsx(f,{item:!0,md:a,sm:12,xs:12,children:e.jsx(Px,{plan:c,instanceId:((m=t.stats)==null?void 0:m.instanceId)??"unknown",version:((h=t.stats)==null?void 0:h.versionEnterprise)??"unknown"})}),e.jsx(f,{item:!0,md:o,sm:12,xs:12,children:e.jsx(Lx,{environments:((p=t.stats)==null?void 0:p.environments)??0,featureToggles:((g=t.stats)==null?void 0:g.featureToggles)??0,projects:((x=t.stats)==null?void 0:x.projects)??0,users:((j=t.stats)==null?void 0:j.users)??0})})]})]})},Ux=d.lazy(()=>ut(()=>import("./EnterpriseEdge-Dnk6MbDj.js"),[])),Ox=()=>e.jsx(e.Fragment,{children:e.jsxs(at,{children:[e.jsx(_,{index:!0,element:e.jsx(Bx,{})}),e.jsx(_,{path:"users/*",element:e.jsx(Fm,{})}),e.jsx(_,{path:"api",element:e.jsx(Hr,{})}),e.jsx(_,{path:"api/create-token",element:e.jsx(Jr,{})}),e.jsx(_,{path:"service-accounts",element:e.jsx(cp,{})}),e.jsx(_,{path:"create-user",element:e.jsx(Sp,{})}),e.jsx(_,{path:"invite-link",element:e.jsx(Cp,{})}),e.jsx(_,{path:"groups/*",element:e.jsx(du,{})}),e.jsx(_,{path:"roles/*",element:e.jsx(Fh,{})}),e.jsx(_,{path:"instance",element:e.jsx(pu,{})}),e.jsx(_,{path:"enterprise-edge",element:e.jsx(Ux,{})}),e.jsx(_,{path:"network/*",element:e.jsx(Zu,{})}),e.jsx(_,{path:"maintenance",element:e.jsx(Nu,{})}),e.jsx(_,{path:"banners",element:e.jsx(nx,{})}),e.jsx(_,{path:"license",element:e.jsx(lx,{})}),e.jsx(_,{path:"cors",element:e.jsx(dd,{})}),e.jsx(_,{path:"auth/*",element:e.jsx(fl,{})}),e.jsx(_,{path:"admin-invoices",element:e.jsx(od,{})}),e.jsx(_,{path:"billing",element:e.jsx(ed,{})}),e.jsx(_,{path:"instance-privacy",element:e.jsx(Du,{})}),e.jsx(_,{path:"*",element:e.jsx(oa,{})})]})}),qx=Object.freeze(Object.defineProperty({__proto__:null,default:Ox},Symbol.toStringTag,{value:"Module"}));export{qx as L,mx as S,Dl as T,ca as a,Rl as b,Fx as c,Wx as d,Bl as e,Gx as f,ua as g,Hx as h,zx as p,$l as u};