@wildo-ai/saas-frontend-lib 1.1.16 → 1.1.18

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 (685) hide show
  1. package/LICENSE +114 -26
  2. package/LICENSE.enterprise +129 -0
  3. package/dist/esm/companion-exports.d.ts +5 -2
  4. package/dist/esm/companion-exports.d.ts.map +1 -1
  5. package/dist/esm/companion-exports.js +4 -2
  6. package/dist/esm/companion-exports.js.map +1 -1
  7. package/dist/esm/components/actions/action-bar.d.ts +16 -1
  8. package/dist/esm/components/actions/action-bar.d.ts.map +1 -1
  9. package/dist/esm/components/actions/action-bar.js.map +1 -1
  10. package/dist/esm/components/app/AppLayout_AuthenticatedRoute.d.ts.map +1 -1
  11. package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js +6 -14
  12. package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js.map +1 -1
  13. package/dist/esm/components/app/AppLayout_DecisionInbox.d.ts.map +1 -1
  14. package/dist/esm/components/app/AppLayout_DecisionInbox.js +2 -4
  15. package/dist/esm/components/app/AppLayout_DecisionInbox.js.map +1 -1
  16. package/dist/esm/components/app/AppLayout_Home.d.ts.map +1 -1
  17. package/dist/esm/components/app/AppLayout_Home.js +14 -7
  18. package/dist/esm/components/app/AppLayout_Home.js.map +1 -1
  19. package/dist/esm/components/app/AppLayout_IdentityPortalContainer.d.ts +13 -0
  20. package/dist/esm/components/app/AppLayout_IdentityPortalContainer.d.ts.map +1 -0
  21. package/dist/esm/components/app/AppLayout_IdentityPortalContainer.js +16 -0
  22. package/dist/esm/components/app/AppLayout_IdentityPortalContainer.js.map +1 -0
  23. package/dist/esm/components/app/DecisionInboxSection.d.ts +10 -0
  24. package/dist/esm/components/app/DecisionInboxSection.d.ts.map +1 -0
  25. package/dist/esm/components/app/DecisionInboxSection.js +15 -0
  26. package/dist/esm/components/app/DecisionInboxSection.js.map +1 -0
  27. package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.d.ts +13 -0
  28. package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.d.ts.map +1 -0
  29. package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.js +28 -0
  30. package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.js.map +1 -0
  31. package/dist/esm/components/app/IdentityPortalPage_Home.d.ts +10 -0
  32. package/dist/esm/components/app/IdentityPortalPage_Home.d.ts.map +1 -0
  33. package/dist/esm/components/app/IdentityPortalPage_Home.js +40 -0
  34. package/dist/esm/components/app/IdentityPortalPage_Home.js.map +1 -0
  35. package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.d.ts +16 -0
  36. package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.d.ts.map +1 -0
  37. package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.js +41 -0
  38. package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.js.map +1 -0
  39. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.d.ts +15 -0
  40. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.d.ts.map +1 -0
  41. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.js +268 -0
  42. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.js.map +1 -0
  43. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.d.ts +3 -0
  44. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.d.ts.map +1 -0
  45. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.js +35 -0
  46. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.js.map +1 -0
  47. package/dist/esm/components/auth/Auth_Main.d.ts.map +1 -1
  48. package/dist/esm/components/auth/Auth_Main.js +5 -0
  49. package/dist/esm/components/auth/Auth_Main.js.map +1 -1
  50. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.d.ts +19 -0
  51. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.d.ts.map +1 -0
  52. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.js +156 -0
  53. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.js.map +1 -0
  54. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.d.ts +3 -0
  55. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.d.ts.map +1 -0
  56. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.js +107 -0
  57. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.js.map +1 -0
  58. package/dist/esm/components/auth/StepUpAuthDialog.d.ts +31 -10
  59. package/dist/esm/components/auth/StepUpAuthDialog.d.ts.map +1 -1
  60. package/dist/esm/components/auth/StepUpAuthDialog.js +81 -17
  61. package/dist/esm/components/auth/StepUpAuthDialog.js.map +1 -1
  62. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.d.ts.map +1 -1
  63. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js +19 -0
  64. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js.map +1 -1
  65. package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.d.ts +11 -0
  66. package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.d.ts.map +1 -0
  67. package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.js +25 -0
  68. package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.js.map +1 -0
  69. package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.d.ts +11 -0
  70. package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.d.ts.map +1 -0
  71. package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.js +25 -0
  72. package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.js.map +1 -0
  73. package/dist/esm/components/billing/billing-pricing-table.d.ts.map +1 -1
  74. package/dist/esm/components/billing/billing-pricing-table.js +40 -7
  75. package/dist/esm/components/billing/billing-pricing-table.js.map +1 -1
  76. package/dist/esm/components/billing/billing-subscription-status.d.ts.map +1 -1
  77. package/dist/esm/components/billing/billing-subscription-status.js +9 -1
  78. package/dist/esm/components/billing/billing-subscription-status.js.map +1 -1
  79. package/dist/esm/components/billing/billing-usage-dashboard.d.ts.map +1 -1
  80. package/dist/esm/components/billing/billing-usage-dashboard.js +3 -2
  81. package/dist/esm/components/billing/billing-usage-dashboard.js.map +1 -1
  82. package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts.map +1 -1
  83. package/dist/esm/components/compliance/EmbeddedSigningFrame.js +17 -6
  84. package/dist/esm/components/compliance/EmbeddedSigningFrame.js.map +1 -1
  85. package/dist/esm/components/data-display/AutomaticDisplayer.d.ts.map +1 -1
  86. package/dist/esm/components/data-display/AutomaticDisplayer.js +7 -2
  87. package/dist/esm/components/data-display/AutomaticDisplayer.js.map +1 -1
  88. package/dist/esm/components/data-display/DisplayField.d.ts.map +1 -1
  89. package/dist/esm/components/data-display/DisplayField.js +67 -45
  90. package/dist/esm/components/data-display/DisplayField.js.map +1 -1
  91. package/dist/esm/components/data-display/DisplayFieldEditable.d.ts.map +1 -1
  92. package/dist/esm/components/data-display/DisplayFieldEditable.js +4 -1
  93. package/dist/esm/components/data-display/DisplayFieldEditable.js.map +1 -1
  94. package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
  95. package/dist/esm/components/data-display/DisplayValueDispatcher.js +16 -6
  96. package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
  97. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
  98. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +3 -1
  99. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
  100. package/dist/esm/components/data-display/approval-seal.d.ts +7 -5
  101. package/dist/esm/components/data-display/approval-seal.d.ts.map +1 -1
  102. package/dist/esm/components/data-display/approval-seal.js +10 -4
  103. package/dist/esm/components/data-display/approval-seal.js.map +1 -1
  104. package/dist/esm/components/data-display/signature-requests.d.ts +81 -0
  105. package/dist/esm/components/data-display/signature-requests.d.ts.map +1 -0
  106. package/dist/esm/components/data-display/signature-requests.js +123 -0
  107. package/dist/esm/components/data-display/signature-requests.js.map +1 -0
  108. package/dist/esm/components/feedback/empty-state-marker.d.ts +16 -0
  109. package/dist/esm/components/feedback/empty-state-marker.d.ts.map +1 -0
  110. package/dist/esm/components/feedback/empty-state-marker.js +16 -0
  111. package/dist/esm/components/feedback/empty-state-marker.js.map +1 -0
  112. package/dist/esm/components/feedback/empty-state.d.ts.map +1 -1
  113. package/dist/esm/components/feedback/empty-state.js +2 -1
  114. package/dist/esm/components/feedback/empty-state.js.map +1 -1
  115. package/dist/esm/components/feedback/features/feature-unavailable-prompt.d.ts +7 -1
  116. package/dist/esm/components/feedback/features/feature-unavailable-prompt.d.ts.map +1 -1
  117. package/dist/esm/components/feedback/features/feature-unavailable-prompt.js +8 -2
  118. package/dist/esm/components/feedback/features/feature-unavailable-prompt.js.map +1 -1
  119. package/dist/esm/components/feedback/resource-empty-state.d.ts.map +1 -1
  120. package/dist/esm/components/feedback/resource-empty-state.js +2 -1
  121. package/dist/esm/components/feedback/resource-empty-state.js.map +1 -1
  122. package/dist/esm/components/flows-actors/approval.d.ts +25 -1
  123. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  124. package/dist/esm/components/flows-actors/approval.js +22 -24
  125. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  126. package/dist/esm/components/flows-actors/approval.labels.d.ts.map +1 -1
  127. package/dist/esm/components/flows-actors/approval.labels.js +30 -0
  128. package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
  129. package/dist/esm/components/flows-actors/flow-node.labels.d.ts.map +1 -1
  130. package/dist/esm/components/flows-actors/flow-node.labels.js +4 -1
  131. package/dist/esm/components/flows-actors/flow-node.labels.js.map +1 -1
  132. package/dist/esm/components/flows-actors/flow-step-visuals.d.ts.map +1 -1
  133. package/dist/esm/components/flows-actors/flow-step-visuals.js +8 -2
  134. package/dist/esm/components/flows-actors/flow-step-visuals.js.map +1 -1
  135. package/dist/esm/components/flows-actors/human-decision-form.d.ts.map +1 -1
  136. package/dist/esm/components/flows-actors/human-decision-form.js +4 -1
  137. package/dist/esm/components/flows-actors/human-decision-form.js.map +1 -1
  138. package/dist/esm/components/form/Form.d.ts +2 -0
  139. package/dist/esm/components/form/Form.d.ts.map +1 -1
  140. package/dist/esm/components/form/Form.js +1 -0
  141. package/dist/esm/components/form/Form.js.map +1 -1
  142. package/dist/esm/components/form/automated/AutomatedArrayField.d.ts.map +1 -1
  143. package/dist/esm/components/form/automated/AutomatedArrayField.js +7 -4
  144. package/dist/esm/components/form/automated/AutomatedArrayField.js.map +1 -1
  145. package/dist/esm/components/form/automated/AutosaveContext.d.ts.map +1 -1
  146. package/dist/esm/components/form/automated/AutosaveContext.js +8 -0
  147. package/dist/esm/components/form/automated/AutosaveContext.js.map +1 -1
  148. package/dist/esm/components/form/automated/FormField.d.ts +5 -3
  149. package/dist/esm/components/form/automated/FormField.d.ts.map +1 -1
  150. package/dist/esm/components/form/automated/FormField.js +38 -13
  151. package/dist/esm/components/form/automated/FormField.js.map +1 -1
  152. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts +1 -1
  153. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  154. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +75 -47
  155. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  156. package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.d.ts +1 -1
  157. package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.js +1 -1
  158. package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.js.map +1 -1
  159. package/dist/esm/components/form/validation-errors/form-validation.d.ts +5 -7
  160. package/dist/esm/components/form/validation-errors/form-validation.d.ts.map +1 -1
  161. package/dist/esm/components/form/validation-errors/form-validation.js +7 -22
  162. package/dist/esm/components/form/validation-errors/form-validation.js.map +1 -1
  163. package/dist/esm/components/form/validation-errors/getFieldError.d.ts +25 -2
  164. package/dist/esm/components/form/validation-errors/getFieldError.d.ts.map +1 -1
  165. package/dist/esm/components/form/validation-errors/getFieldError.js +29 -2
  166. package/dist/esm/components/form/validation-errors/getFieldError.js.map +1 -1
  167. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts +5 -0
  168. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts.map +1 -1
  169. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js +3 -0
  170. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js.map +1 -1
  171. package/dist/esm/components/form/validation-errors/save-attempt.d.ts +9 -0
  172. package/dist/esm/components/form/validation-errors/save-attempt.d.ts.map +1 -0
  173. package/dist/esm/components/form/validation-errors/save-attempt.js +42 -0
  174. package/dist/esm/components/form/validation-errors/save-attempt.js.map +1 -0
  175. package/dist/esm/components/form/validation-errors/unstarted-field-visit.d.ts +3 -1
  176. package/dist/esm/components/form/validation-errors/unstarted-field-visit.d.ts.map +1 -1
  177. package/dist/esm/components/form/validation-errors/unstarted-field-visit.js +3 -1
  178. package/dist/esm/components/form/validation-errors/unstarted-field-visit.js.map +1 -1
  179. package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.d.ts +2 -2
  180. package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.d.ts.map +1 -1
  181. package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.js +3 -0
  182. package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.js.map +1 -1
  183. package/dist/esm/components/navigation/NavigationItemBadge.d.ts +16 -0
  184. package/dist/esm/components/navigation/NavigationItemBadge.d.ts.map +1 -1
  185. package/dist/esm/components/navigation/NavigationItemBadge.js +14 -2
  186. package/dist/esm/components/navigation/NavigationItemBadge.js.map +1 -1
  187. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts +3 -3
  188. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js +3 -3
  189. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js.map +1 -1
  190. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.d.ts +5 -13
  191. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.d.ts.map +1 -1
  192. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js +30 -255
  193. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js.map +1 -1
  194. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts +22 -1
  195. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts.map +1 -1
  196. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js +57 -26
  197. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js.map +1 -1
  198. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts +1 -1
  199. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts.map +1 -1
  200. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js +40 -4
  201. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js.map +1 -1
  202. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts +1 -1
  203. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts.map +1 -1
  204. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js +26 -4
  205. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js.map +1 -1
  206. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.d.ts +31 -0
  207. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.d.ts.map +1 -0
  208. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.js +42 -0
  209. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.js.map +1 -0
  210. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.d.ts +76 -0
  211. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.d.ts.map +1 -0
  212. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.js +268 -0
  213. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.js.map +1 -0
  214. package/dist/esm/components/navigation/command.d.ts +5 -0
  215. package/dist/esm/components/navigation/command.d.ts.map +1 -1
  216. package/dist/esm/components/navigation/command.js.map +1 -1
  217. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts +19 -0
  218. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
  219. package/dist/esm/components/resources/ResourceLayout_DangerZone.js +51 -12
  220. package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
  221. package/dist/esm/components/resources/ResourceLayout_InsertedViews.d.ts.map +1 -1
  222. package/dist/esm/components/resources/ResourceLayout_InsertedViews.js +21 -7
  223. package/dist/esm/components/resources/ResourceLayout_InsertedViews.js.map +1 -1
  224. package/dist/esm/components/resources/ResourceLayout_List.d.ts.map +1 -1
  225. package/dist/esm/components/resources/ResourceLayout_List.js +17 -7
  226. package/dist/esm/components/resources/ResourceLayout_List.js.map +1 -1
  227. package/dist/esm/components/resources/ResourceLayout_RecordSharing.d.ts +1 -1
  228. package/dist/esm/components/resources/ResourceLayout_RecordSharing.d.ts.map +1 -1
  229. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +4 -1
  230. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
  231. package/dist/esm/components/resources/ResourceLayout_Search.d.ts.map +1 -1
  232. package/dist/esm/components/resources/ResourceLayout_Search.js +12 -8
  233. package/dist/esm/components/resources/ResourceLayout_Search.js.map +1 -1
  234. package/dist/esm/components/resources/ResourceOwnedViewEmbeds.d.ts +1 -1
  235. package/dist/esm/components/resources/ResourceOwnedViewEmbeds.d.ts.map +1 -1
  236. package/dist/esm/components/resources/ResourceOwnedViewEmbeds.js +11 -4
  237. package/dist/esm/components/resources/ResourceOwnedViewEmbeds.js.map +1 -1
  238. package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.d.ts.map +1 -1
  239. package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.js +4 -1
  240. package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.js.map +1 -1
  241. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.d.ts.map +1 -1
  242. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js +4 -1
  243. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js.map +1 -1
  244. package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.d.ts.map +1 -1
  245. package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.js +4 -1
  246. package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.js.map +1 -1
  247. package/dist/esm/components/resources/embeds/RelatedResourceSections.d.ts +1 -1
  248. package/dist/esm/components/resources/embeds/RelatedResourceSections.js.map +1 -1
  249. package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts +5 -5
  250. package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts.map +1 -1
  251. package/dist/esm/components/resources/embeds/ResourceEmbeds.js +21 -14
  252. package/dist/esm/components/resources/embeds/ResourceEmbeds.js.map +1 -1
  253. package/dist/esm/components/resources/skeleton/DisplayLayout.d.ts.map +1 -1
  254. package/dist/esm/components/resources/skeleton/DisplayLayout.js +40 -4
  255. package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
  256. package/dist/esm/components/resources/skeleton/FormLayout.d.ts.map +1 -1
  257. package/dist/esm/components/resources/skeleton/FormLayout.js +22 -6
  258. package/dist/esm/components/resources/skeleton/FormLayout.js.map +1 -1
  259. package/dist/esm/components/resources/skeleton/Group.d.ts.map +1 -1
  260. package/dist/esm/components/resources/skeleton/Group.js +4 -1
  261. package/dist/esm/components/resources/skeleton/Group.js.map +1 -1
  262. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.d.ts +1 -1
  263. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js +1 -1
  264. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js.map +1 -1
  265. package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts +21 -1
  266. package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts.map +1 -1
  267. package/dist/esm/components/resources/skeleton/SectionFieldsContext.js +53 -9
  268. package/dist/esm/components/resources/skeleton/SectionFieldsContext.js.map +1 -1
  269. package/dist/esm/components/sections/ContentSectionContainer.d.ts.map +1 -1
  270. package/dist/esm/components/sections/ContentSectionContainer.js +11 -7
  271. package/dist/esm/components/sections/ContentSectionContainer.js.map +1 -1
  272. package/dist/esm/components/sections/content-section.d.ts +1 -3
  273. package/dist/esm/components/sections/content-section.d.ts.map +1 -1
  274. package/dist/esm/components/sections/content-section.js.map +1 -1
  275. package/dist/esm/components/settings/AppPage_AgentActivitySettings.d.ts.map +1 -1
  276. package/dist/esm/components/settings/AppPage_AgentActivitySettings.js +2 -1
  277. package/dist/esm/components/settings/AppPage_AgentActivitySettings.js.map +1 -1
  278. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts +12 -0
  279. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts.map +1 -1
  280. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js +28 -6
  281. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js.map +1 -1
  282. package/dist/esm/components/settings/SettingsHub.d.ts +15 -0
  283. package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
  284. package/dist/esm/components/settings/SettingsHub.js +14 -4
  285. package/dist/esm/components/settings/SettingsHub.js.map +1 -1
  286. package/dist/esm/components/typography/document-heading-level.d.ts +28 -0
  287. package/dist/esm/components/typography/document-heading-level.d.ts.map +1 -0
  288. package/dist/esm/components/typography/document-heading-level.js +63 -0
  289. package/dist/esm/components/typography/document-heading-level.js.map +1 -0
  290. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts +3 -2
  291. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts.map +1 -1
  292. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js +4 -3
  293. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js.map +1 -1
  294. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts +1 -1
  295. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts.map +1 -1
  296. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js.map +1 -1
  297. package/dist/esm/components/views/chart-view/ChartKpiFigure.d.ts +33 -0
  298. package/dist/esm/components/views/chart-view/ChartKpiFigure.d.ts.map +1 -1
  299. package/dist/esm/components/views/chart-view/ChartKpiFigure.js +63 -4
  300. package/dist/esm/components/views/chart-view/ChartKpiFigure.js.map +1 -1
  301. package/dist/esm/components/views/chart-view/ChartView.d.ts.map +1 -1
  302. package/dist/esm/components/views/chart-view/ChartView.js +52 -22
  303. package/dist/esm/components/views/chart-view/ChartView.js.map +1 -1
  304. package/dist/esm/components/views/chart-view/ChartView.labels.d.ts.map +1 -1
  305. package/dist/esm/components/views/chart-view/ChartView.labels.js +76 -3
  306. package/dist/esm/components/views/chart-view/ChartView.labels.js.map +1 -1
  307. package/dist/esm/components/views/chart-view/ChartView.lazy.d.ts.map +1 -1
  308. package/dist/esm/components/views/chart-view/ChartView.lazy.js +2 -1
  309. package/dist/esm/components/views/chart-view/ChartView.lazy.js.map +1 -1
  310. package/dist/esm/components/views/chart-view/ChartWidget.d.ts.map +1 -1
  311. package/dist/esm/components/views/chart-view/ChartWidget.js +12 -4
  312. package/dist/esm/components/views/chart-view/ChartWidget.js.map +1 -1
  313. package/dist/esm/components/views/chart-view/chart-export.utils.d.ts +8 -0
  314. package/dist/esm/components/views/chart-view/chart-export.utils.d.ts.map +1 -1
  315. package/dist/esm/components/views/chart-view/chart-export.utils.js +15 -25
  316. package/dist/esm/components/views/chart-view/chart-export.utils.js.map +1 -1
  317. package/dist/esm/components/views/chart-view/chart-view-defaults.d.ts +6 -0
  318. package/dist/esm/components/views/chart-view/chart-view-defaults.d.ts.map +1 -0
  319. package/dist/esm/components/views/chart-view/chart-view-defaults.js +6 -0
  320. package/dist/esm/components/views/chart-view/chart-view-defaults.js.map +1 -0
  321. package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts +47 -12
  322. package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts.map +1 -1
  323. package/dist/esm/components/views/chart-view/option-builder/builder-utils.js +87 -32
  324. package/dist/esm/components/views/chart-view/option-builder/builder-utils.js.map +1 -1
  325. package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.d.ts.map +1 -1
  326. package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js +8 -8
  327. package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js.map +1 -1
  328. package/dist/esm/components/views/chart-view/option-builder/builders/composed.builder.js +1 -1
  329. package/dist/esm/components/views/chart-view/option-builder/builders/composed.builder.js.map +1 -1
  330. package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.d.ts.map +1 -1
  331. package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.js +7 -3
  332. package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.js.map +1 -1
  333. package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.d.ts.map +1 -1
  334. package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.js +6 -2
  335. package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.js.map +1 -1
  336. package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.d.ts.map +1 -1
  337. package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js +8 -2
  338. package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js.map +1 -1
  339. package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.d.ts.map +1 -1
  340. package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.js +13 -9
  341. package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.js.map +1 -1
  342. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.d.ts +1 -1
  343. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.d.ts.map +1 -1
  344. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js +9 -8
  345. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js.map +1 -1
  346. package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.d.ts.map +1 -1
  347. package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.js +2 -1
  348. package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.js.map +1 -1
  349. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.d.ts +1 -1
  350. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.d.ts.map +1 -1
  351. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js +10 -11
  352. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js.map +1 -1
  353. package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.d.ts.map +1 -1
  354. package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.js +2 -1
  355. package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.js.map +1 -1
  356. package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.d.ts.map +1 -1
  357. package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.js +5 -1
  358. package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.js.map +1 -1
  359. package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.d.ts.map +1 -1
  360. package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js +7 -3
  361. package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js.map +1 -1
  362. package/dist/esm/components/views/chart-view/option-builder/echarts-option-builder.d.ts.map +1 -1
  363. package/dist/esm/components/views/chart-view/option-builder/echarts-option-builder.js +13 -13
  364. package/dist/esm/components/views/chart-view/option-builder/echarts-option-builder.js.map +1 -1
  365. package/dist/esm/components/views/chart-view/useResourceChartData.d.ts +1 -1
  366. package/dist/esm/components/views/chart-view/useResourceChartData.js +1 -1
  367. package/dist/esm/components/views/chart-view/useResourceChartData.js.map +1 -1
  368. package/dist/esm/components/views/composite-view/CompositeView.d.ts +6 -0
  369. package/dist/esm/components/views/composite-view/CompositeView.d.ts.map +1 -1
  370. package/dist/esm/components/views/composite-view/CompositeView.js +6 -2
  371. package/dist/esm/components/views/composite-view/CompositeView.js.map +1 -1
  372. package/dist/esm/components/views/execution-view/ExecutionView.d.ts +7 -0
  373. package/dist/esm/components/views/execution-view/ExecutionView.d.ts.map +1 -1
  374. package/dist/esm/components/views/execution-view/ExecutionView.js +11 -1
  375. package/dist/esm/components/views/execution-view/ExecutionView.js.map +1 -1
  376. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts +7 -0
  377. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts.map +1 -1
  378. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js +6 -2
  379. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js.map +1 -1
  380. package/dist/esm/components/views/full-custom-view/FullCustomView.d.ts +7 -0
  381. package/dist/esm/components/views/full-custom-view/FullCustomView.d.ts.map +1 -1
  382. package/dist/esm/components/views/full-custom-view/FullCustomView.js +8 -3
  383. package/dist/esm/components/views/full-custom-view/FullCustomView.js.map +1 -1
  384. package/dist/esm/components/views/onboarding-view/OnboardingView.d.ts +7 -0
  385. package/dist/esm/components/views/onboarding-view/OnboardingView.d.ts.map +1 -1
  386. package/dist/esm/components/views/onboarding-view/OnboardingView.js +11 -1
  387. package/dist/esm/components/views/onboarding-view/OnboardingView.js.map +1 -1
  388. package/dist/esm/core/app-shell/AppShellBuildingBlocks.d.ts +2 -2
  389. package/dist/esm/core/app-shell/AppShellBuildingBlocks.js +2 -2
  390. package/dist/esm/core/app-shell/AppShellBuildingBlocks.js.map +1 -1
  391. package/dist/esm/core/app-shell/app-shell.schemas.d.ts +87 -16
  392. package/dist/esm/core/app-shell/app-shell.schemas.d.ts.map +1 -1
  393. package/dist/esm/core/app-shell/app-shell.schemas.js +16 -0
  394. package/dist/esm/core/app-shell/app-shell.schemas.js.map +1 -1
  395. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +4 -4
  396. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +3 -3
  397. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
  398. package/dist/esm/core/app-shell/useIdentityPortalShellLayout.d.ts +45 -0
  399. package/dist/esm/core/app-shell/useIdentityPortalShellLayout.d.ts.map +1 -0
  400. package/dist/esm/core/app-shell/useIdentityPortalShellLayout.js +72 -0
  401. package/dist/esm/core/app-shell/useIdentityPortalShellLayout.js.map +1 -0
  402. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts +4 -3
  403. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts.map +1 -1
  404. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js +4 -3
  405. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js.map +1 -1
  406. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts +15 -8
  407. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts.map +1 -1
  408. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js +22 -21
  409. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js.map +1 -1
  410. package/dist/esm/core/billing/BillingContext.d.ts +27 -4
  411. package/dist/esm/core/billing/BillingContext.d.ts.map +1 -1
  412. package/dist/esm/core/billing/BillingContext.js +61 -2
  413. package/dist/esm/core/billing/BillingContext.js.map +1 -1
  414. package/dist/esm/core/billing/useBillingAction.d.ts.map +1 -1
  415. package/dist/esm/core/billing/useBillingAction.js +3 -2
  416. package/dist/esm/core/billing/useBillingAction.js.map +1 -1
  417. package/dist/esm/core/components-registry/RegisteredComponentRoot.d.ts +19 -0
  418. package/dist/esm/core/components-registry/RegisteredComponentRoot.d.ts.map +1 -0
  419. package/dist/esm/core/components-registry/RegisteredComponentRoot.js +23 -0
  420. package/dist/esm/core/components-registry/RegisteredComponentRoot.js.map +1 -0
  421. package/dist/esm/core/components-registry/register-framework-layouts.d.ts.map +1 -1
  422. package/dist/esm/core/components-registry/register-framework-layouts.js +4 -0
  423. package/dist/esm/core/components-registry/register-framework-layouts.js.map +1 -1
  424. package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts +159 -0
  425. package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts.map +1 -1
  426. package/dist/esm/core/config/app-configuration-frontend.schemas.js +68 -3
  427. package/dist/esm/core/config/app-configuration-frontend.schemas.js.map +1 -1
  428. package/dist/esm/core/config/app-level-components.frontend.schemas.d.ts +2 -2
  429. package/dist/esm/core/config/app-level-components.frontend.schemas.js +2 -2
  430. package/dist/esm/core/config/app-level-components.frontend.schemas.js.map +1 -1
  431. package/dist/esm/core/config/chart-view.frontend.schemas.d.ts +59 -18
  432. package/dist/esm/core/config/chart-view.frontend.schemas.d.ts.map +1 -1
  433. package/dist/esm/core/config/chart-view.frontend.schemas.js +42 -7
  434. package/dist/esm/core/config/chart-view.frontend.schemas.js.map +1 -1
  435. package/dist/esm/core/config/composite-view.schemas.d.ts +8 -1
  436. package/dist/esm/core/config/composite-view.schemas.d.ts.map +1 -1
  437. package/dist/esm/core/config/composite-view.schemas.js +1 -0
  438. package/dist/esm/core/config/composite-view.schemas.js.map +1 -1
  439. package/dist/esm/core/config/decision-inbox-capability.frontend.utils.d.ts +1 -1
  440. package/dist/esm/core/config/decision-inbox-capability.frontend.utils.d.ts.map +1 -1
  441. package/dist/esm/core/config/decision-inbox-capability.frontend.utils.js +1 -1
  442. package/dist/esm/core/config/decision-inbox-capability.frontend.utils.js.map +1 -1
  443. package/dist/esm/core/config/engine-settings-destinations.d.ts +6 -0
  444. package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
  445. package/dist/esm/core/config/engine-settings-destinations.js +12 -0
  446. package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
  447. package/dist/esm/core/config/execution-view.schemas.d.ts +1 -1
  448. package/dist/esm/core/config/execution-view.schemas.js.map +1 -1
  449. package/dist/esm/core/config/identity-portal-settings.frontend.d.ts +17 -0
  450. package/dist/esm/core/config/identity-portal-settings.frontend.d.ts.map +1 -0
  451. package/dist/esm/core/config/identity-portal-settings.frontend.js +64 -0
  452. package/dist/esm/core/config/identity-portal-settings.frontend.js.map +1 -0
  453. package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts +8 -8
  454. package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts.map +1 -1
  455. package/dist/esm/core/config/launcher-items.frontend.schemas.js.map +1 -1
  456. package/dist/esm/core/config/settings-hub-gating.frontend.utils.d.ts +1 -1
  457. package/dist/esm/core/config/settings-hub-gating.frontend.utils.d.ts.map +1 -1
  458. package/dist/esm/core/config/settings-hub-gating.frontend.utils.js +1 -1
  459. package/dist/esm/core/config/settings-hub-gating.frontend.utils.js.map +1 -1
  460. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +17 -6
  461. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
  462. package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
  463. package/dist/esm/core/config/useSettingsHubConfig.d.ts.map +1 -1
  464. package/dist/esm/core/config/useSettingsHubConfig.js +1 -0
  465. package/dist/esm/core/config/useSettingsHubConfig.js.map +1 -1
  466. package/dist/esm/core/config/useVisibleSettingsHubConfig.d.ts +7 -0
  467. package/dist/esm/core/config/useVisibleSettingsHubConfig.d.ts.map +1 -1
  468. package/dist/esm/core/config/useVisibleSettingsHubConfig.js +9 -1
  469. package/dist/esm/core/config/useVisibleSettingsHubConfig.js.map +1 -1
  470. package/dist/esm/core/config/verify-launcher-content.d.ts +7 -1
  471. package/dist/esm/core/config/verify-launcher-content.d.ts.map +1 -1
  472. package/dist/esm/core/config/verify-launcher-content.js +31 -0
  473. package/dist/esm/core/config/verify-launcher-content.js.map +1 -1
  474. package/dist/esm/core/errors/GlobalErrorHandler.d.ts.map +1 -1
  475. package/dist/esm/core/errors/GlobalErrorHandler.js +10 -0
  476. package/dist/esm/core/errors/GlobalErrorHandler.js.map +1 -1
  477. package/dist/esm/core/errors/backend-refusal.frontend.d.ts +1 -1
  478. package/dist/esm/core/errors/backend-refusal.frontend.d.ts.map +1 -1
  479. package/dist/esm/core/errors/backend-refusal.frontend.js.map +1 -1
  480. package/dist/esm/core/events/NotificationContext.d.ts.map +1 -1
  481. package/dist/esm/core/events/NotificationContext.js +19 -2
  482. package/dist/esm/core/events/NotificationContext.js.map +1 -1
  483. package/dist/esm/core/events/notification-display-policy.frontend.schemas.d.ts +21 -2
  484. package/dist/esm/core/events/notification-display-policy.frontend.schemas.d.ts.map +1 -1
  485. package/dist/esm/core/events/notification-display-policy.frontend.schemas.js +25 -4
  486. package/dist/esm/core/events/notification-display-policy.frontend.schemas.js.map +1 -1
  487. package/dist/esm/core/execution/useExecution.d.ts +3 -3
  488. package/dist/esm/core/execution/useExecution.js.map +1 -1
  489. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.d.ts +1 -1
  490. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js +1 -1
  491. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js.map +1 -1
  492. package/dist/esm/core/features/FeatureGate.d.ts +13 -1
  493. package/dist/esm/core/features/FeatureGate.d.ts.map +1 -1
  494. package/dist/esm/core/features/FeatureGate.js +6 -1
  495. package/dist/esm/core/features/FeatureGate.js.map +1 -1
  496. package/dist/esm/core/features/InPlaceFeatureLock.d.ts +28 -0
  497. package/dist/esm/core/features/InPlaceFeatureLock.d.ts.map +1 -0
  498. package/dist/esm/core/features/InPlaceFeatureLock.js +49 -0
  499. package/dist/esm/core/features/InPlaceFeatureLock.js.map +1 -0
  500. package/dist/esm/core/features/PlanRefusalPrompt.d.ts +12 -0
  501. package/dist/esm/core/features/PlanRefusalPrompt.d.ts.map +1 -0
  502. package/dist/esm/core/features/PlanRefusalPrompt.js +90 -0
  503. package/dist/esm/core/features/PlanRefusalPrompt.js.map +1 -0
  504. package/dist/esm/core/features/RequiredFeaturesGate.d.ts +39 -0
  505. package/dist/esm/core/features/RequiredFeaturesGate.d.ts.map +1 -0
  506. package/dist/esm/core/features/RequiredFeaturesGate.js +51 -0
  507. package/dist/esm/core/features/RequiredFeaturesGate.js.map +1 -0
  508. package/dist/esm/core/features/feature-unavailability.frontend.utils.d.ts +6 -0
  509. package/dist/esm/core/features/feature-unavailability.frontend.utils.d.ts.map +1 -1
  510. package/dist/esm/core/features/feature-unavailability.frontend.utils.js +27 -10
  511. package/dist/esm/core/features/feature-unavailability.frontend.utils.js.map +1 -1
  512. package/dist/esm/core/features/plan-refusal.frontend.d.ts +43 -0
  513. package/dist/esm/core/features/plan-refusal.frontend.d.ts.map +1 -0
  514. package/dist/esm/core/features/plan-refusal.frontend.js +67 -0
  515. package/dist/esm/core/features/plan-refusal.frontend.js.map +1 -0
  516. package/dist/esm/core/features/required-features-gate-presentation.d.ts +21 -0
  517. package/dist/esm/core/features/required-features-gate-presentation.d.ts.map +1 -0
  518. package/dist/esm/core/features/required-features-gate-presentation.js +26 -0
  519. package/dist/esm/core/features/required-features-gate-presentation.js.map +1 -0
  520. package/dist/esm/core/features/useFeatureAvailability.d.ts.map +1 -1
  521. package/dist/esm/core/features/useFeatureAvailability.js +4 -0
  522. package/dist/esm/core/features/useFeatureAvailability.js.map +1 -1
  523. package/dist/esm/core/features/useOperationFeatureAvailability.d.ts +2 -0
  524. package/dist/esm/core/features/useOperationFeatureAvailability.d.ts.map +1 -1
  525. package/dist/esm/core/features/useOperationFeatureAvailability.js +6 -1
  526. package/dist/esm/core/features/useOperationFeatureAvailability.js.map +1 -1
  527. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +11 -0
  528. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
  529. package/dist/esm/core/flows-actors/FlowsActorsContext.js +117 -3
  530. package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
  531. package/dist/esm/core/guidance/renderers/GuidanceAnnouncement.d.ts.map +1 -1
  532. package/dist/esm/core/guidance/renderers/GuidanceAnnouncement.js +3 -1
  533. package/dist/esm/core/guidance/renderers/GuidanceAnnouncement.js.map +1 -1
  534. package/dist/esm/core/navigation/NavigationContentAreas.d.ts.map +1 -1
  535. package/dist/esm/core/navigation/NavigationContentAreas.js +28 -9
  536. package/dist/esm/core/navigation/NavigationContentAreas.js.map +1 -1
  537. package/dist/esm/{components/views/chart-dashboard/chart-dashboard.utils.d.ts → core/navigation/chart-read-gate.d.ts} +11 -7
  538. package/dist/esm/core/navigation/chart-read-gate.d.ts.map +1 -0
  539. package/dist/esm/{components/views/chart-dashboard/chart-dashboard.utils.js → core/navigation/chart-read-gate.js} +27 -11
  540. package/dist/esm/core/navigation/chart-read-gate.js.map +1 -0
  541. package/dist/esm/core/navigation/home-resolution.d.ts +36 -0
  542. package/dist/esm/core/navigation/home-resolution.d.ts.map +1 -0
  543. package/dist/esm/core/navigation/home-resolution.js +46 -0
  544. package/dist/esm/core/navigation/home-resolution.js.map +1 -0
  545. package/dist/esm/core/navigation/launcher-resolution.d.ts +2 -34
  546. package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
  547. package/dist/esm/core/navigation/launcher-resolution.js +13 -18
  548. package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
  549. package/dist/esm/core/navigation/launcher-runtime-availability.d.ts +1 -1
  550. package/dist/esm/core/navigation/launcher-runtime-availability.d.ts.map +1 -1
  551. package/dist/esm/core/navigation/launcher-runtime-availability.js +7 -2
  552. package/dist/esm/core/navigation/launcher-runtime-availability.js.map +1 -1
  553. package/dist/esm/core/navigation/primary-destination-layout.d.ts +2 -2
  554. package/dist/esm/core/navigation/primary-destination-layout.d.ts.map +1 -1
  555. package/dist/esm/core/navigation/primary-destination-layout.js +1 -1
  556. package/dist/esm/core/navigation/primary-destination-layout.js.map +1 -1
  557. package/dist/esm/core/navigation/useChartReadDecision.d.ts +26 -0
  558. package/dist/esm/core/navigation/useChartReadDecision.d.ts.map +1 -0
  559. package/dist/esm/core/navigation/useChartReadDecision.js +58 -0
  560. package/dist/esm/core/navigation/useChartReadDecision.js.map +1 -0
  561. package/dist/esm/core/navigation/useCurrentOrganizationConfigurationPresence.d.ts +1 -1
  562. package/dist/esm/core/navigation/useCurrentOrganizationConfigurationPresence.d.ts.map +1 -1
  563. package/dist/esm/core/navigation/useCurrentOrganizationConfigurationPresence.js.map +1 -1
  564. package/dist/esm/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.d.ts +1 -1
  565. package/dist/esm/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.d.ts.map +1 -1
  566. package/dist/esm/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.js.map +1 -1
  567. package/dist/esm/core/navigation/view-title-resolution.d.ts +21 -0
  568. package/dist/esm/core/navigation/view-title-resolution.d.ts.map +1 -1
  569. package/dist/esm/core/navigation/view-title-resolution.js +25 -0
  570. package/dist/esm/core/navigation/view-title-resolution.js.map +1 -1
  571. package/dist/esm/core/navigation/viewer-field-reader.d.ts +81 -0
  572. package/dist/esm/core/navigation/viewer-field-reader.d.ts.map +1 -0
  573. package/dist/esm/core/navigation/viewer-field-reader.js +113 -0
  574. package/dist/esm/core/navigation/viewer-field-reader.js.map +1 -0
  575. package/dist/esm/core/navigation/viewer-roles.d.ts +40 -0
  576. package/dist/esm/core/navigation/viewer-roles.d.ts.map +1 -0
  577. package/dist/esm/core/navigation/viewer-roles.js +26 -0
  578. package/dist/esm/core/navigation/viewer-roles.js.map +1 -0
  579. package/dist/esm/core/requests/user-interaction-clock.d.ts +32 -0
  580. package/dist/esm/core/requests/user-interaction-clock.d.ts.map +1 -0
  581. package/dist/esm/core/requests/user-interaction-clock.js +47 -0
  582. package/dist/esm/core/requests/user-interaction-clock.js.map +1 -0
  583. package/dist/esm/core/requests/websockets/WebSocketEventBridge.d.ts.map +1 -1
  584. package/dist/esm/core/requests/websockets/WebSocketEventBridge.js +2 -0
  585. package/dist/esm/core/requests/websockets/WebSocketEventBridge.js.map +1 -1
  586. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +66 -10
  587. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
  588. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +63 -8
  589. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
  590. package/dist/esm/core/requests/wildo-http-client.frontend.service.d.ts.map +1 -1
  591. package/dist/esm/core/requests/wildo-http-client.frontend.service.js +13 -0
  592. package/dist/esm/core/requests/wildo-http-client.frontend.service.js.map +1 -1
  593. package/dist/esm/core/resources/hooks/useOperationEnabled.d.ts.map +1 -1
  594. package/dist/esm/core/resources/hooks/useOperationEnabled.js +45 -3
  595. package/dist/esm/core/resources/hooks/useOperationEnabled.js.map +1 -1
  596. package/dist/esm/core/resources/resource-addressability.frontend.utils.d.ts +1 -1
  597. package/dist/esm/core/resources/resource-addressability.frontend.utils.d.ts.map +1 -1
  598. package/dist/esm/core/resources/resource-addressability.frontend.utils.js.map +1 -1
  599. package/dist/esm/core/resources/resources-repository.frontend.service.d.ts.map +1 -1
  600. package/dist/esm/core/resources/resources-repository.frontend.service.js +2 -0
  601. package/dist/esm/core/resources/resources-repository.frontend.service.js.map +1 -1
  602. package/dist/esm/core/resources/resources.frontend.schemas.d.ts +29 -23
  603. package/dist/esm/core/resources/resources.frontend.schemas.d.ts.map +1 -1
  604. package/dist/esm/core/resources/resources.frontend.schemas.js +20 -20
  605. package/dist/esm/core/resources/resources.frontend.schemas.js.map +1 -1
  606. package/dist/esm/core/resources/rmm/ResourceMutationManager.d.ts.map +1 -1
  607. package/dist/esm/core/resources/rmm/ResourceMutationManager.js +4 -0
  608. package/dist/esm/core/resources/rmm/ResourceMutationManager.js.map +1 -1
  609. package/dist/esm/core/resources/useResourceOperationActions.d.ts.map +1 -1
  610. package/dist/esm/core/resources/useResourceOperationActions.js +7 -7
  611. package/dist/esm/core/resources/useResourceOperationActions.js.map +1 -1
  612. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  613. package/dist/esm/core/runtime/AppRouter.js +11 -33
  614. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  615. package/dist/esm/core/runtime/ApplicationMainContext.d.ts +15 -1
  616. package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
  617. package/dist/esm/core/runtime/ApplicationMainContext.js +41 -23
  618. package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
  619. package/dist/esm/core/runtime/IdentityPortalRouter.d.ts +20 -0
  620. package/dist/esm/core/runtime/IdentityPortalRouter.d.ts.map +1 -0
  621. package/dist/esm/core/runtime/IdentityPortalRouter.js +31 -0
  622. package/dist/esm/core/runtime/IdentityPortalRouter.js.map +1 -0
  623. package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts +9 -0
  624. package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts.map +1 -1
  625. package/dist/esm/core/runtime/domain-module.frontend.definitions.js +3 -2
  626. package/dist/esm/core/runtime/domain-module.frontend.definitions.js.map +1 -1
  627. package/dist/esm/core/runtime/frontend-companion-resource-inputs.d.ts +21 -0
  628. package/dist/esm/core/runtime/frontend-companion-resource-inputs.d.ts.map +1 -1
  629. package/dist/esm/core/runtime/frontend-companion-resource-inputs.js +19 -1
  630. package/dist/esm/core/runtime/frontend-companion-resource-inputs.js.map +1 -1
  631. package/dist/esm/core/runtime/identity-routes.d.ts +13 -0
  632. package/dist/esm/core/runtime/identity-routes.d.ts.map +1 -0
  633. package/dist/esm/core/runtime/identity-routes.js +50 -0
  634. package/dist/esm/core/runtime/identity-routes.js.map +1 -0
  635. package/dist/esm/core/runtime/routes.frontend.definitions.d.ts +19 -0
  636. package/dist/esm/core/runtime/routes.frontend.definitions.d.ts.map +1 -1
  637. package/dist/esm/core/runtime/routes.frontend.definitions.js +20 -1
  638. package/dist/esm/core/runtime/routes.frontend.definitions.js.map +1 -1
  639. package/dist/esm/core/runtime/runtime.frontend.schemas.d.ts +3 -1
  640. package/dist/esm/core/runtime/runtime.frontend.schemas.d.ts.map +1 -1
  641. package/dist/esm/core/runtime/runtime.frontend.schemas.js +2 -0
  642. package/dist/esm/core/runtime/runtime.frontend.schemas.js.map +1 -1
  643. package/dist/esm/core/runtime/start-application.frontend.service.d.ts +7 -0
  644. package/dist/esm/core/runtime/start-application.frontend.service.d.ts.map +1 -1
  645. package/dist/esm/core/runtime/start-application.frontend.service.js +4 -2
  646. package/dist/esm/core/runtime/start-application.frontend.service.js.map +1 -1
  647. package/dist/esm/core/search/command-score.d.ts +33 -0
  648. package/dist/esm/core/search/command-score.d.ts.map +1 -0
  649. package/dist/esm/core/search/command-score.js +109 -0
  650. package/dist/esm/core/search/command-score.js.map +1 -0
  651. package/dist/esm/core/security/AuthSessionContext.d.ts.map +1 -1
  652. package/dist/esm/core/security/AuthSessionContext.js +4 -0
  653. package/dist/esm/core/security/AuthSessionContext.js.map +1 -1
  654. package/dist/esm/core/security/StepUpAuthContext.d.ts +3 -2
  655. package/dist/esm/core/security/StepUpAuthContext.d.ts.map +1 -1
  656. package/dist/esm/core/security/StepUpAuthContext.js +7 -2
  657. package/dist/esm/core/security/StepUpAuthContext.js.map +1 -1
  658. package/dist/esm/core/security/federated-reauthentication.frontend.d.ts +13 -2
  659. package/dist/esm/core/security/federated-reauthentication.frontend.d.ts.map +1 -1
  660. package/dist/esm/core/security/federated-reauthentication.frontend.js +21 -1
  661. package/dist/esm/core/security/federated-reauthentication.frontend.js.map +1 -1
  662. package/dist/esm/core/security/useAuthenticatedRouteEntry.d.ts +24 -0
  663. package/dist/esm/core/security/useAuthenticatedRouteEntry.d.ts.map +1 -0
  664. package/dist/esm/core/security/useAuthenticatedRouteEntry.js +37 -0
  665. package/dist/esm/core/security/useAuthenticatedRouteEntry.js.map +1 -0
  666. package/dist/esm/core/ui/design-token.utils.d.ts +9 -0
  667. package/dist/esm/core/ui/design-token.utils.d.ts.map +1 -1
  668. package/dist/esm/core/ui/design-token.utils.js +24 -3
  669. package/dist/esm/core/ui/design-token.utils.js.map +1 -1
  670. package/dist/esm/core/ui/themes/focus-indicator.d.ts +1 -1
  671. package/dist/esm/core/ui/themes/focus-indicator.js +1 -1
  672. package/dist/esm/core/ui/themes/focus-indicator.js.map +1 -1
  673. package/dist/esm/core/ui/ui.frontend.schemas.d.ts.map +1 -1
  674. package/dist/esm/index.d.ts +19 -1
  675. package/dist/esm/index.d.ts.map +1 -1
  676. package/dist/esm/index.js +22 -1
  677. package/dist/esm/index.js.map +1 -1
  678. package/dist/esm/testing/mock-builders.d.ts +1 -1
  679. package/dist/esm/testing/mock-builders.d.ts.map +1 -1
  680. package/dist/esm/testing/mock-builders.js +1 -0
  681. package/dist/esm/testing/mock-builders.js.map +1 -1
  682. package/dist/tsconfig.build.tsbuildinfo +1 -1
  683. package/package.json +9 -6
  684. package/dist/esm/components/views/chart-dashboard/chart-dashboard.utils.d.ts.map +0 -1
  685. package/dist/esm/components/views/chart-dashboard/chart-dashboard.utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"launcher-runtime-availability.js","sourceRoot":"","sources":["../../../../src/core/navigation/launcher-runtime-availability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4DAA4D,CAAC;AACtG,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,cAAc,EAA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C;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,8CAA8C,CAC5D,QAA0C,EAC1C,OAA2C;IAE3C,OAAO,4CAA4C,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC;AAMD,MAAM,UAAU,4CAA4C,CAC1D,KAAsB,EACtB,OAA2C;IAE3C,IAAI,CAAC,KAAK,EAAE,MAAM;QAAE,OAAO,KAAK,CAAC;IAEjC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CACzB,sCAAsC,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAC1E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2CAA2C,CACzD,KAAoC,EACpC,OAA2C;IAE3C,OAAO,4CAA4C,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,uCAAuC,CACrD,KAAgC,EAChC,OAA2C;IAE3C,OAAO,4CAA4C,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,4CAA4C,CAC1D,KAAqC,EACrC,OAA2C;IAE3C,OAAO,4CAA4C,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,yCAAyC,CACvD,QAAqC,EACrC,OAA2C;IAE3C,OAAO,4CAA4C,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,uCAAuC,CACrD,KAAwC,EACxC,OAA2C;IAE3C,OAAO,4CAA4C,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import { useCallback, useContext, useMemo, useRef } from 'react';\nimport type { AppScopeValue } from '~wildo-frontend-lib/core/scope/scope.frontend.schemas';\nimport { useAppModeSafe } from '~wildo-frontend-lib/core/mode/AppModeContext';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { UserOrgsContext } from '~wildo-frontend-lib/core/security/UserOrgsContext';\nimport { useApplicationRoleTables } from '~wildo-frontend-lib/core/security/useApplicationRoleTables';\nimport { FeaturesContext } from '~wildo-frontend-lib/core/features/FeaturesContext';\nimport { useBillingSafe } from '~wildo-frontend-lib/core/billing/useBilling';\nimport { ApplicationContext } from '~wildo-frontend-lib/core/runtime/ApplicationContext.shared';\nimport {\n deriveRelationshipShapeCapabilities,\n deriveRelationshipSideCapabilities,\n type RelationshipShapeCapability,\n type RelationshipSideCapability,\n type RelationshipCapabilityInput,\n} from '~wildo-frontend-lib/core/config/relationship-side-capabilities.frontend.utils';\nimport {\n deriveDirectoryProvisioningCapabilities,\n isUnrevokedScimTokenProbeNeeded,\n} from '~wildo-frontend-lib/core/config/directory-provisioning-capabilities.frontend.utils';\nimport { PROFESSIONAL_QUALIFICATIONS_DECLARED_CAPABILITY } from '~wildo-frontend-lib/core/config/engine-settings-destinations';\nimport { deriveDecisionInboxCapabilities } from '~wildo-frontend-lib/core/config/decision-inbox-capability.frontend.utils';\nimport { useCurrentOrganizationHoldsUnrevokedScimToken } from './useCurrentOrganizationHoldsUnrevokedScimToken';\nimport { useCurrentOrganizationConfigurationPresence, type ConfigurationPresenceProbe } from './useCurrentOrganizationConfigurationPresence';\nimport { CoreFeature, CoreResourceOperation, CoreResourceType, isOrganizationTypeDirectoryProvisioned } from '@wildo-ai/saas-models';\nimport { type LauncherEffectiveRoles, viewerHoldsOneOfRoles, viewerMayPerformOperation } from './launcher-resolution';\nimport type { AncestorViewerDecision } from './navigation-cascade';\nimport {\n SidebarSectionContentKind,\n type AppModeDefinition,\n type CommandMenuCommand,\n type ControlPanelItem,\n type HotkeyBinding,\n type LauncherRuntimeAvailabilityConfig,\n type MenubarLauncherItem,\n type QuickActionItem,\n type SidebarItem,\n type SidebarSection,\n type SidebarSection_NavigationList,\n type ToolbarItem,\n} from '~wildo-frontend-lib/core/config/launcher-items.frontend.schemas';\n\nexport interface LauncherRuntimeAvailabilityContext {\n activeMode: string | null;\n availableModes: AppModeDefinition[];\n allScopeValues: Record<string, AppScopeValue>;\n effectiveRoles: LauncherEffectiveRoles;\n resolvedFeatures: string[];\n runtimeCapabilities: Record<string, boolean>;\n}\n\n/**\n * Centralized runtime signals used by declarative launcher availability.\n *\n * The filter evaluates `runtimeCapabilities` and `effectiveRoles`; the broader context is exposed so the same hook\n * stays the single source of truth when future launcher slices need more runtime information.\n */\n/**\n * The viewer's roles, the ONE place they are derived for the shell's visibility checks (#2376): their application\n * roles, their roles in the CURRENT organization, and the application's role tables to expand them against.\n *\n * Read from the session context without the throwing `useUserOrgs`, so a surface outside the session provider gets a\n * viewer who holds no role. Roles not loaded yet are empty too (see `LauncherEffectiveRoles`): a role-gated entry\n * appears once they arrive, never offered first and withdrawn after.\n */\nexport function useViewerEffectiveRoles(): LauncherEffectiveRoles {\n return useViewerEffectiveRolesInOrganization(undefined);\n}\n\n/**\n * The viewer's roles as they stand IN ONE ORGANIZATION (#2473): the same derivation as {@link useViewerEffectiveRoles},\n * with the organization roles read for `organizationId` instead of the current organization.\n *\n * For a decision about a record of another tenant. A platform operator who opened a tenant through the directory holds\n * no role in that tenant, whatever they hold in their own current organization, and offering them a write on the\n * strength of their own organization's roles would offer an edit the backend refuses (and records as an attempted\n * crossing). `undefined` means the current organization.\n */\nexport function useViewerEffectiveRolesInOrganization(organizationId: string | undefined): LauncherEffectiveRoles {\n const permissions = useContext(UserOrgsContext)?.permissions ?? null;\n const currentOrganizationId = useAppScopeSafe()?.currentOrganizationId ?? null;\n const roleTables = useApplicationRoleTables();\n const scopeOrganizationId = organizationId ?? currentOrganizationId;\n return useMemo(() => ({\n applicationRoles: permissions?.appLevel ?? [],\n organizationRoles: (scopeOrganizationId && permissions?.organizations?.[scopeOrganizationId]) || [],\n roleTables,\n organizationId: scopeOrganizationId,\n accessProfile: permissions?.accessProfile ?? null,\n }), [permissions, scopeOrganizationId, roleTables]);\n}\n\n/**\n * The decision the navigation cascade asks before a crossed READ takes an ancestor pane (#3304). Stable across renders\n * and reading the latest viewer, because the cascade runs inside effects and callbacks that must not re-run on a role\n * change. Before the viewer's roles have loaded it answers no, the fail-closed side: an operator's deep link then opens\n * without the tenant's pane, and an owner's never opens onto the operator's page.\n */\nexport function useViewerMayPerformAncestor(): AncestorViewerDecision {\n const viewer = useViewerEffectiveRolesInOrganization(undefined);\n const viewerRef = useRef(viewer);\n viewerRef.current = viewer;\n return useCallback((operation) => viewerMayPerformOperation(operation, viewerRef.current), []);\n}\n\n/**\n * Which sides of which relationship kinds the CURRENT organization's type can take (#1597, #2722), as the runtime\n * capabilities the relationship settings and forms require. Read from the declaration\n * (`appConfig.organizationRelationships` and `appConfig.organizationTypes`), the organizations the session has loaded,\n * and the current organization; `false` everywhere until all are known. Read without the throwing hooks, so a surface\n * outside the providers is offered neither side.\n */\nfunction useRelationshipCapabilityInput(): RelationshipCapabilityInput {\n const appConfig = useContext(ApplicationContext)?.appConfig;\n const organizationRelationships = appConfig?.organizationRelationships;\n const organizationTypes = appConfig?.organizationTypes as RelationshipCapabilityInput['organizationTypes'];\n const organizations = useContext(UserOrgsContext)?.organizations;\n const currentOrganizationId = useAppScopeSafe()?.currentOrganizationId ?? null;\n return useMemo(\n () => ({ organizationRelationships, organizationTypes, organizations, currentOrganizationId }),\n [organizationRelationships, organizationTypes, organizations, currentOrganizationId],\n );\n}\n\nexport function useRelationshipSideCapabilities(): Record<RelationshipSideCapability, boolean> {\n const input = useRelationshipCapabilityInput();\n return useMemo(() => deriveRelationshipSideCapabilities(input), [input]);\n}\n\n/** Where the operator stands in the kinds the current organization takes a side in (#2618, #2722), as runtime capabilities. */\nexport function useRelationshipShapeCapabilities(): Record<RelationshipShapeCapability, boolean> {\n const input = useRelationshipCapabilityInput();\n return useMemo(() => deriveRelationshipShapeCapabilities(input), [input]);\n}\n\n/** The CURRENT organization's declared type, from the organizations the session has loaded; `undefined` until known. */\nfunction useCurrentOrganizationType(): string | undefined {\n const organizations = useContext(UserOrgsContext)?.organizations;\n const currentOrganizationId = useAppScopeSafe()?.currentOrganizationId ?? null;\n return useMemo(() => {\n if (!currentOrganizationId) return undefined;\n const type = organizations?.find((organization) => organization._id === currentOrganizationId)?.type;\n return typeof type === 'string' && type.length > 0 ? type : undefined;\n }, [organizations, currentOrganizationId]);\n}\n\n/**\n * Whether a directory may provision the CURRENT organization (#2613): its declared type says `scimProvisioning`, by\n * the one rule the SCIM API, token generation and the directory-managed check also read. `false` until the declaration,\n * the organizations and the current organization are known, so SCIM settings never appear first and vanish after.\n */\nexport function useCurrentOrganizationDirectoryProvisioned(): boolean {\n const organizationTypes = useContext(ApplicationContext)?.appConfig?.organizationTypes;\n const currentType = useCurrentOrganizationType();\n return useMemo(\n () => isOrganizationTypeDirectoryProvisioned(organizationTypes as never, currentType),\n [organizationTypes, currentType],\n );\n}\n\n/**\n * Single sign-on is configured while the organization holds an SSO connection (#3126): a connection is what makes\n * sign-in go through an identity provider. Read beside {@link SSO_POLICY_PRESENCE_PROBE}.\n */\nexport const SSO_CONNECTION_PRESENCE_PROBE: ConfigurationPresenceProbe = {\n key: 'sso-connection',\n resourceType: CoreResourceType.ORGANIZATION_SSO_CONNECTIONS,\n operation: CoreResourceOperation.LIST,\n matches: () => true,\n};\n\nconst isNonEmptyArray = (value: unknown): boolean => Array.isArray(value) && value.length > 0;\nconst objectAt = (value: unknown): Record<string, unknown> =>\n (value && typeof value === 'object' && !Array.isArray(value) ? value : {}) as Record<string, unknown>;\n\n/**\n * The organization's single sign-on POLICY says something (#3126): SSO is required, a domain is claimed, a break-glass\n * account is named, social providers are restricted, or the organization overrides a social provider's credentials.\n * The settings row exists for every organization with defaults, so its presence says nothing; only an authored value\n * does. Some of these keep applying when the entitlement lapses (a social provider restriction is enforced with no\n * entitlement check), so the section must stay where they are configured.\n */\nexport const SSO_POLICY_PRESENCE_PROBE: ConfigurationPresenceProbe = {\n key: 'sso-policy',\n resourceType: CoreResourceType.ORGANIZATION_SSO_CONFIG,\n operation: CoreResourceOperation.READ,\n matches: (config) => {\n const enforcement = objectAt(config.enforcement);\n const domains = objectAt(config.domains);\n const emergencyAccess = objectAt(config.emergencyAccess);\n const restrictions = objectAt(config.oauth2ProviderRestrictions);\n return enforcement.requireSSO === true\n || isNonEmptyArray(domains.verifiedDomains)\n || isNonEmptyArray(domains.ssoEnabledDomains)\n || isNonEmptyArray(emergencyAccess.breakGlassAccounts)\n || isNonEmptyArray(restrictions.allowedProviders)\n || isNonEmptyArray(restrictions.blockedProviders)\n || restrictions.requireEnterpriseSSOOnly === true\n || isNonEmptyArray(config.socialCredentialOverrides);\n },\n};\n\n/**\n * Security-event export is configured while the organization's export is switched on (#3126). The export settings are\n * a singleton every organization has, so their presence says nothing; `enabled` is what an administrator turned on.\n */\nexport const SIEM_EXPORT_PRESENCE_PROBE: ConfigurationPresenceProbe = {\n key: 'siem-export-enabled',\n resourceType: CoreResourceType.ORGANIZATION_SIEM_EXPORT_CONFIG,\n operation: CoreResourceOperation.READ,\n matches: (config) => config.enabled === true,\n};\n\n/**\n * Webhook delivery is configured while the organization's delivery is switched on or it has an endpoint (#3172). The\n * configuration is a singleton every organization has, so its presence says nothing; `enabled` is what an administrator\n * turned on, and an endpoint is a destination they authored, which stays to be edited or removed while delivery is off.\n */\nexport const WEBHOOK_CONFIG_PRESENCE_PROBE: ConfigurationPresenceProbe = {\n key: 'webhook-config-configured',\n resourceType: CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG,\n operation: CoreResourceOperation.READ,\n matches: (config) => config.enabled === true || isNonEmptyArray(config.endpoints),\n};\n\n/** Outside the features provider nothing is offered. Module-level, so the memo below sees one identity. */\nconst offersNoFeature = (_featureId: string): boolean => false;\n\nexport function useLauncherRuntimeAvailabilityContext(): LauncherRuntimeAvailabilityContext {\n const appMode = useAppModeSafe();\n const appScope = useAppScopeSafe();\n const effectiveRoles = useViewerEffectiveRoles();\n // Read without the throwing `useFeatures`, like the roles above: a surface outside the features provider (a resource\n // action bar in an isolated host, a test) gets a shell that offers no feature rather than a crash. Inside the\n // application every reader sits under the provider, so nothing there changes.\n const features = useContext(FeaturesContext);\n const resolvedFeatures = features?.resolvedFeatures;\n const isFeatureOffered = features?.isFeatureOffered ?? offersNoFeature;\n const billing = useBillingSafe();\n\n // Enterprise-config features (SSO / SCIM / SIEM / webhooks) are gated by the\n // framework FEATURE system, along the correct axis. This capability is the\n // app-shell SURVIVAL filter (`requiredCapabilities`) — false → the item is\n // removed entirely — so it must answer \"does this app OFFER feature X?\", NOT\n // \"is the current org ENTITLED to it?\". Using `isFeatureOffered` (entitled OR\n // reachable via an upgrade/add-on) means a billing-on org whose plan lacks the\n // feature still SURVIVES the filter and the section can render an upgrade/add-on\n // prompt via {@link FeatureGate} + `unavailabilityPolicy`, instead of vanishing.\n // Billing off → offered == entitled, so behaviour is unchanged there. Entitlement\n // itself is enforced at render time (FeatureGate) and by the backend FeatureGate.\n //\n // Offered is not the whole survival question, though (#3126). #2367 keeps a capability's configuration when its\n // entitlement lapses, stops applying it, and says so where it is configured (the settings hub's kept-configuration\n // notice). A lapse no plan in the catalogue can cure (a manual override removed, a default grant withdrawn) is not\n // OFFERED, so on that axis alone the section, its notice and its kept configuration all vanished. So a section also\n // survives while something is CONFIGURED there, which the shell has to ask the server: asked only once the features\n // have settled and only when the feature is not offered, since an offered feature keeps the section anyway.\n // Settled for THIS organization: the features answered for the previous scope would ask once, be dropped when the\n // loading flag flips, and ask again.\n const featuresSettled = !!features && features.isLoading !== true\n && (appScope?.currentOrganizationId ?? null) === features.resolvedForOrganizationId;\n const singleSignOnOffered = isFeatureOffered(CoreFeature.SINGLE_SIGN_ON);\n const askAboutSingleSignOn = featuresSettled && !singleSignOnOffered;\n const holdsSsoConnection = useCurrentOrganizationConfigurationPresence(SSO_CONNECTION_PRESENCE_PROBE, askAboutSingleSignOn, effectiveRoles);\n const holdsSsoPolicy = useCurrentOrganizationConfigurationPresence(SSO_POLICY_PRESENCE_PROBE, askAboutSingleSignOn, effectiveRoles);\n const ssoEnabled = singleSignOnOffered || holdsSsoConnection || holdsSsoPolicy;\n // SCIM also needs the current organization's TYPE to admit a directory (#2613): the feature can be offered while the\n // type says no, and then the settings would mint a token the SCIM API refuses. Where the type says no but the\n // organization still holds an unrevoked token, the settings stay reachable with that token's Revoke and nothing else\n // (#2649); whether it holds one is the one capability the shell has to ask the server.\n const directoryProvisioningOffered = isFeatureOffered(CoreFeature.DIRECTORY_PROVISIONING);\n const currentOrganizationType = useCurrentOrganizationType();\n const currentOrganizationDirectoryProvisioned = useCurrentOrganizationDirectoryProvisioned();\n const holdsUnrevokedScimToken = useCurrentOrganizationHoldsUnrevokedScimToken(\n featuresSettled && isUnrevokedScimTokenProbeNeeded({\n featureOffered: directoryProvisioningOffered,\n organizationTypeKnown: currentOrganizationType !== undefined,\n organizationTypeDirectoryProvisioned: currentOrganizationDirectoryProvisioned,\n }),\n effectiveRoles,\n );\n const directoryProvisioningCapabilities = useMemo(\n () => deriveDirectoryProvisioningCapabilities({\n featureOffered: directoryProvisioningOffered,\n organizationTypeDirectoryProvisioned: currentOrganizationDirectoryProvisioned,\n holdsUnrevokedToken: holdsUnrevokedScimToken,\n }),\n [directoryProvisioningOffered, currentOrganizationDirectoryProvisioned, holdsUnrevokedScimToken],\n );\n const securityEventExportOffered = isFeatureOffered(CoreFeature.SECURITY_EVENT_EXPORT);\n const securityEventExportConfigured = useCurrentOrganizationConfigurationPresence(\n SIEM_EXPORT_PRESENCE_PROBE,\n featuresSettled && !securityEventExportOffered,\n effectiveRoles,\n );\n const siemEnabled = securityEventExportOffered || securityEventExportConfigured;\n // Webhooks ask the same two questions (#3172). Since #3114 `M2M_WEBHOOK_DELIVERY`, a scope-boundary feature, is\n // answered at the organization's own scope, so a lapse there makes it not offered; the section then stays while the\n // organization's delivery is switched on or has an endpoint, and shows Test endpoint and the delivery log's Retry\n // locked (#3162) beside the kept-configuration notice.\n const webhookDeliveryOffered = isFeatureOffered(CoreFeature.M2M_WEBHOOK_DELIVERY);\n const webhookDeliveryConfigured = useCurrentOrganizationConfigurationPresence(\n WEBHOOK_CONFIG_PRESENCE_PROBE,\n featuresSettled && !webhookDeliveryOffered,\n effectiveRoles,\n );\n const webhooksEnabled = webhookDeliveryOffered || webhookDeliveryConfigured;\n\n // Which side of an organization relationship the CURRENT organization's type can take (#1597): read from the\n // declaration, so a representing organization is not offered a granting organization's register and a granting\n // organization is not offered a representing organization's list of the organizations it represents.\n const relationshipSides = useRelationshipSideCapabilities();\n // Which form the relationship verbs take in this application's shape (#2618): the operator asked without a name, or\n // the other organization named.\n const relationshipShape = useRelationshipShapeCapabilities();\n // Who is offered the decision inbox (#2577): a holder of an answering role in ANY organization entry the server reads\n // an answerer from, not only in the current organization. Read without the throwing `useApplication`.\n const decisionInboxOffer = useContext(ApplicationContext)?.appConfig?.decisionInbox;\n // Whether the application declares any professional qualification kind (#2967): the qualifications settings need one.\n const professionalQualificationsDeclared = Object.keys(useContext(ApplicationContext)?.appConfig?.professionalQualificationKinds ?? {}).length > 0;\n const decisionInbox = useMemo(\n () => deriveDecisionInboxCapabilities({ offer: decisionInboxOffer, effectiveRoles }),\n [decisionInboxOffer, effectiveRoles],\n );\n\n return useMemo(() => ({\n activeMode: appMode?.activeMode ?? null,\n availableModes: appMode?.availableModes ?? [],\n allScopeValues: appScope?.allScopeValues ?? {},\n effectiveRoles,\n resolvedFeatures: resolvedFeatures?.features ?? [],\n runtimeCapabilities: {\n billingEnabled: Boolean(billing?.isEnabled),\n ssoEnabled,\n ...directoryProvisioningCapabilities,\n siemEnabled,\n webhooksEnabled,\n ...relationshipSides,\n ...relationshipShape,\n ...decisionInbox,\n [PROFESSIONAL_QUALIFICATIONS_DECLARED_CAPABILITY]: professionalQualificationsDeclared,\n },\n }), [\n appMode?.activeMode,\n appMode?.availableModes,\n appScope?.allScopeValues,\n effectiveRoles,\n resolvedFeatures?.features,\n billing?.isEnabled,\n ssoEnabled,\n directoryProvisioningCapabilities,\n siemEnabled,\n webhooksEnabled,\n relationshipSides,\n relationshipShape,\n decisionInbox,\n professionalQualificationsDeclared,\n ]);\n}\n\n/**\n * Whether a launcher item (or a Settings Hub section) survives the app-shell filtering pass: every required runtime\n * capability is on, and the viewer holds one of its `requiredRoles` (#2376).\n *\n * `requiredFeatures` remains the canonical plan/subscription gate later in the\n * launcher resolution + surface rendering pipeline.\n */\nexport function isLauncherRuntimeAvailabilitySatisfied(\n config: LauncherRuntimeAvailabilityConfig | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): boolean {\n const capabilitiesOn = (config?.requiredCapabilities ?? []).every(capability => Boolean(context.runtimeCapabilities[capability]));\n return capabilitiesOn && viewerHoldsOneOfRoles(config?.requiredRoles, context.effectiveRoles);\n}\n\nfunction filterSidebarItemsByRuntimeAvailability(\n items: SidebarItem[],\n context: LauncherRuntimeAvailabilityContext,\n): SidebarItem[] {\n return items.flatMap(item => {\n if (!isLauncherRuntimeAvailabilitySatisfied(item.runtimeAvailability, context)) {\n return [];\n }\n\n if (!item.children?.length) {\n return [item];\n }\n\n return [{\n ...item,\n children: filterSidebarItemsByRuntimeAvailability(item.children, context),\n }];\n });\n}\n\nfunction filterNavigationListSectionByRuntimeAvailability(\n section: SidebarSection_NavigationList,\n context: LauncherRuntimeAvailabilityContext,\n): SidebarSection_NavigationList {\n return {\n ...section,\n children: filterSidebarItemsByRuntimeAvailability(section.children, context),\n };\n}\n\nexport function filterSidebarSectionsByRuntimeAvailability(\n sections: SidebarSection[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): SidebarSection[] | undefined {\n if (!sections?.length) return sections;\n\n const filteredSections: SidebarSection[] = [];\n\n for (const section of sections) {\n if (!isLauncherRuntimeAvailabilitySatisfied(section.runtimeAvailability, context)) {\n continue;\n }\n\n if (section.contentKind === SidebarSectionContentKind.NAVIGATION_LIST) {\n filteredSections.push(filterNavigationListSectionByRuntimeAvailability(section, context));\n continue;\n }\n\n filteredSections.push(section);\n }\n\n return filteredSections;\n}\n\nexport function filterCommandMenuCommandsByRuntimeAvailability(\n commands: CommandMenuCommand[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): CommandMenuCommand[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(commands, context);\n}\n\ntype RuntimeAvailabilityFlatLauncherItem = {\n runtimeAvailability?: LauncherRuntimeAvailabilityConfig;\n};\n\nexport function filterFlatLauncherItemsByRuntimeAvailability<T extends RuntimeAvailabilityFlatLauncherItem>(\n items: T[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): T[] | undefined {\n if (!items?.length) return items;\n\n return items.filter(item =>\n isLauncherRuntimeAvailabilitySatisfied(item.runtimeAvailability, context),\n );\n}\n\nexport function filterQuickActionItemsByRuntimeAvailability(\n items: QuickActionItem[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): QuickActionItem[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(items, context);\n}\n\nexport function filterToolbarItemsByRuntimeAvailability(\n items: ToolbarItem[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): ToolbarItem[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(items, context);\n}\n\nexport function filterControlPanelItemsByRuntimeAvailability(\n items: ControlPanelItem[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): ControlPanelItem[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(items, context);\n}\n\nexport function filterHotkeyBindingsByRuntimeAvailability(\n bindings: HotkeyBinding[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): HotkeyBinding[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(bindings, context);\n}\n\nexport function filterMenubarItemsByRuntimeAvailability(\n items: MenubarLauncherItem[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): MenubarLauncherItem[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(items, context);\n}\n"]}
1
+ {"version":3,"file":"launcher-runtime-availability.js","sourceRoot":"","sources":["../../../../src/core/navigation/launcher-runtime-availability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WA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1D,KAAqC,EACrC,OAA2C;IAE3C,OAAO,4CAA4C,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,yCAAyC,CACvD,QAAqC,EACrC,OAA2C;IAE3C,OAAO,4CAA4C,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,uCAAuC,CACrD,KAAwC,EACxC,OAA2C;IAE3C,OAAO,4CAA4C,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import { useCallback, useContext, useMemo, useRef } from 'react';\nimport type { AppScopeValue } from '~wildo-frontend-lib/core/scope/scope.frontend.schemas';\nimport { useAppModeSafe } from '~wildo-frontend-lib/core/mode/AppModeContext';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { UserOrgsContext } from '~wildo-frontend-lib/core/security/UserOrgsContext';\nimport { useApplicationRoleTables } from '~wildo-frontend-lib/core/security/useApplicationRoleTables';\nimport { FeaturesContext } from '~wildo-frontend-lib/core/features/FeaturesContext';\nimport { useBillingSafe } from '~wildo-frontend-lib/core/billing/useBilling';\nimport { ApplicationContext } from '~wildo-frontend-lib/core/runtime/ApplicationContext.shared';\nimport {\n deriveRelationshipShapeCapabilities,\n deriveRelationshipSideCapabilities,\n type RelationshipShapeCapability,\n type RelationshipSideCapability,\n type RelationshipCapabilityInput,\n} from '~wildo-frontend-lib/core/config/relationship-side-capabilities.frontend.utils';\nimport {\n deriveDirectoryProvisioningCapabilities,\n isUnrevokedScimTokenProbeNeeded,\n} from '~wildo-frontend-lib/core/config/directory-provisioning-capabilities.frontend.utils';\nimport { AUDIT_LOG_OFFERED_CAPABILITY, PROFESSIONAL_QUALIFICATIONS_DECLARED_CAPABILITY } from '~wildo-frontend-lib/core/config/engine-settings-destinations';\nimport { deriveDecisionInboxCapabilities } from '~wildo-frontend-lib/core/config/decision-inbox-capability.frontend.utils';\nimport { useCurrentOrganizationHoldsUnrevokedScimToken } from './useCurrentOrganizationHoldsUnrevokedScimToken';\nimport { useCurrentOrganizationConfigurationPresence, type ConfigurationPresenceProbe } from './useCurrentOrganizationConfigurationPresence';\nimport { CoreFeature, CoreResourceOperation, CoreResourceType, isOrganizationTypeDirectoryProvisioned } from '@wildo-ai/saas-models';\nimport { viewerMayPerformOperation } from './launcher-resolution';\nimport { type LauncherEffectiveRoles, viewerHoldsOneOfRoles } from './viewer-roles';\nimport type { AncestorViewerDecision } from './navigation-cascade';\nimport {\n SidebarSectionContentKind,\n type AppModeDefinition,\n type CommandMenuCommand,\n type ControlPanelItem,\n type HotkeyBinding,\n type LauncherRuntimeAvailabilityConfig,\n type MenubarLauncherItem,\n type QuickActionItem,\n type SidebarItem,\n type SidebarSection,\n type SidebarSection_NavigationList,\n type ToolbarItem,\n} from '~wildo-frontend-lib/core/config/launcher-items.frontend.schemas';\n\nexport interface LauncherRuntimeAvailabilityContext {\n activeMode: string | null;\n availableModes: AppModeDefinition[];\n allScopeValues: Record<string, AppScopeValue>;\n effectiveRoles: LauncherEffectiveRoles;\n resolvedFeatures: string[];\n runtimeCapabilities: Record<string, boolean>;\n}\n\n/**\n * Centralized runtime signals used by declarative launcher availability.\n *\n * The filter evaluates `runtimeCapabilities` and `effectiveRoles`; the broader context is exposed so the same hook\n * stays the single source of truth when future launcher slices need more runtime information.\n */\n/**\n * The viewer's roles, the ONE place they are derived for the shell's visibility checks (#2376): their application\n * roles, their roles in the CURRENT organization, and the application's role tables to expand them against.\n *\n * Read from the session context without the throwing `useUserOrgs`, so a surface outside the session provider gets a\n * viewer who holds no role. Roles not loaded yet are empty too (see `LauncherEffectiveRoles`): a role-gated entry\n * appears once they arrive, never offered first and withdrawn after.\n */\nexport function useViewerEffectiveRoles(): LauncherEffectiveRoles {\n return useViewerEffectiveRolesInOrganization(undefined);\n}\n\n/**\n * The viewer's roles as they stand IN ONE ORGANIZATION (#2473): the same derivation as {@link useViewerEffectiveRoles},\n * with the organization roles read for `organizationId` instead of the current organization.\n *\n * For a decision about a record of another tenant. A platform operator who opened a tenant through the directory holds\n * no role in that tenant, whatever they hold in their own current organization, and offering them a write on the\n * strength of their own organization's roles would offer an edit the backend refuses (and records as an attempted\n * crossing). `undefined` means the current organization.\n */\nexport function useViewerEffectiveRolesInOrganization(organizationId: string | undefined): LauncherEffectiveRoles {\n const permissions = useContext(UserOrgsContext)?.permissions ?? null;\n const currentOrganizationId = useAppScopeSafe()?.currentOrganizationId ?? null;\n const roleTables = useApplicationRoleTables();\n const scopeOrganizationId = organizationId ?? currentOrganizationId;\n return useMemo(() => ({\n applicationRoles: permissions?.appLevel ?? [],\n organizationRoles: (scopeOrganizationId && permissions?.organizations?.[scopeOrganizationId]) || [],\n roleTables,\n organizationId: scopeOrganizationId,\n accessProfile: permissions?.accessProfile ?? null,\n }), [permissions, scopeOrganizationId, roleTables]);\n}\n\n/**\n * The decision the navigation cascade asks before a crossed READ takes an ancestor pane (#3304). Stable across renders\n * and reading the latest viewer, because the cascade runs inside effects and callbacks that must not re-run on a role\n * change. Before the viewer's roles have loaded it answers no, the fail-closed side: an operator's deep link then opens\n * without the tenant's pane, and an owner's never opens onto the operator's page.\n */\nexport function useViewerMayPerformAncestor(): AncestorViewerDecision {\n const viewer = useViewerEffectiveRolesInOrganization(undefined);\n const viewerRef = useRef(viewer);\n viewerRef.current = viewer;\n return useCallback((operation) => viewerMayPerformOperation(operation, viewerRef.current), []);\n}\n\n/**\n * Which sides of which relationship kinds the CURRENT organization's type can take (#1597, #2722), as the runtime\n * capabilities the relationship settings and forms require. Read from the declaration\n * (`appConfig.organizationRelationships` and `appConfig.organizationTypes`), the organizations the session has loaded,\n * and the current organization; `false` everywhere until all are known. Read without the throwing hooks, so a surface\n * outside the providers is offered neither side.\n */\nfunction useRelationshipCapabilityInput(): RelationshipCapabilityInput {\n const appConfig = useContext(ApplicationContext)?.appConfig;\n const organizationRelationships = appConfig?.organizationRelationships;\n const organizationTypes = appConfig?.organizationTypes as RelationshipCapabilityInput['organizationTypes'];\n const organizations = useContext(UserOrgsContext)?.organizations;\n const currentOrganizationId = useAppScopeSafe()?.currentOrganizationId ?? null;\n return useMemo(\n () => ({ organizationRelationships, organizationTypes, organizations, currentOrganizationId }),\n [organizationRelationships, organizationTypes, organizations, currentOrganizationId],\n );\n}\n\nexport function useRelationshipSideCapabilities(): Record<RelationshipSideCapability, boolean> {\n const input = useRelationshipCapabilityInput();\n return useMemo(() => deriveRelationshipSideCapabilities(input), [input]);\n}\n\n/** Where the operator stands in the kinds the current organization takes a side in (#2618, #2722), as runtime capabilities. */\nexport function useRelationshipShapeCapabilities(): Record<RelationshipShapeCapability, boolean> {\n const input = useRelationshipCapabilityInput();\n return useMemo(() => deriveRelationshipShapeCapabilities(input), [input]);\n}\n\n/** The CURRENT organization's declared type, from the organizations the session has loaded; `undefined` until known. */\nfunction useCurrentOrganizationType(): string | undefined {\n const organizations = useContext(UserOrgsContext)?.organizations;\n const currentOrganizationId = useAppScopeSafe()?.currentOrganizationId ?? null;\n return useMemo(() => {\n if (!currentOrganizationId) return undefined;\n const type = organizations?.find((organization) => organization._id === currentOrganizationId)?.type;\n return typeof type === 'string' && type.length > 0 ? type : undefined;\n }, [organizations, currentOrganizationId]);\n}\n\n/**\n * Whether a directory may provision the CURRENT organization (#2613): its declared type says `scimProvisioning`, by\n * the one rule the SCIM API, token generation and the directory-managed check also read. `false` until the declaration,\n * the organizations and the current organization are known, so SCIM settings never appear first and vanish after.\n */\nexport function useCurrentOrganizationDirectoryProvisioned(): boolean {\n const organizationTypes = useContext(ApplicationContext)?.appConfig?.organizationTypes;\n const currentType = useCurrentOrganizationType();\n return useMemo(\n () => isOrganizationTypeDirectoryProvisioned(organizationTypes as never, currentType),\n [organizationTypes, currentType],\n );\n}\n\n/**\n * Single sign-on is configured while the organization holds an SSO connection (#3126): a connection is what makes\n * sign-in go through an identity provider. Read beside {@link SSO_POLICY_PRESENCE_PROBE}.\n */\nexport const SSO_CONNECTION_PRESENCE_PROBE: ConfigurationPresenceProbe = {\n key: 'sso-connection',\n resourceType: CoreResourceType.ORGANIZATION_SSO_CONNECTIONS,\n operation: CoreResourceOperation.LIST,\n matches: () => true,\n};\n\nconst isNonEmptyArray = (value: unknown): boolean => Array.isArray(value) && value.length > 0;\nconst objectAt = (value: unknown): Record<string, unknown> =>\n (value && typeof value === 'object' && !Array.isArray(value) ? value : {}) as Record<string, unknown>;\n\n/**\n * The organization's single sign-on POLICY says something (#3126): SSO is required, a domain is claimed, a break-glass\n * account is named, social providers are restricted, or the organization overrides a social provider's credentials.\n * The settings row exists for every organization with defaults, so its presence says nothing; only an authored value\n * does. Some of these keep applying when the entitlement lapses (a social provider restriction is enforced with no\n * entitlement check), so the section must stay where they are configured.\n */\nexport const SSO_POLICY_PRESENCE_PROBE: ConfigurationPresenceProbe = {\n key: 'sso-policy',\n resourceType: CoreResourceType.ORGANIZATION_SSO_CONFIG,\n operation: CoreResourceOperation.READ,\n matches: (config) => {\n const enforcement = objectAt(config.enforcement);\n const domains = objectAt(config.domains);\n const emergencyAccess = objectAt(config.emergencyAccess);\n const restrictions = objectAt(config.oauth2ProviderRestrictions);\n return enforcement.requireSSO === true\n || isNonEmptyArray(domains.verifiedDomains)\n || isNonEmptyArray(domains.ssoEnabledDomains)\n || isNonEmptyArray(emergencyAccess.breakGlassAccounts)\n || isNonEmptyArray(restrictions.allowedProviders)\n || isNonEmptyArray(restrictions.blockedProviders)\n || restrictions.requireEnterpriseSSOOnly === true\n || isNonEmptyArray(config.socialCredentialOverrides);\n },\n};\n\n/**\n * Security-event export is configured while the organization's export is switched on (#3126). The export settings are\n * a singleton every organization has, so their presence says nothing; `enabled` is what an administrator turned on.\n */\nexport const SIEM_EXPORT_PRESENCE_PROBE: ConfigurationPresenceProbe = {\n key: 'siem-export-enabled',\n resourceType: CoreResourceType.ORGANIZATION_SIEM_EXPORT_CONFIG,\n operation: CoreResourceOperation.READ,\n matches: (config) => config.enabled === true,\n};\n\n/**\n * Webhook delivery is configured while the organization's delivery is switched on or it has an endpoint (#3172). The\n * configuration is a singleton every organization has, so its presence says nothing; `enabled` is what an administrator\n * turned on, and an endpoint is a destination they authored, which stays to be edited or removed while delivery is off.\n */\nexport const WEBHOOK_CONFIG_PRESENCE_PROBE: ConfigurationPresenceProbe = {\n key: 'webhook-config-configured',\n resourceType: CoreResourceType.ORGANIZATION_WEBHOOK_CONFIG,\n operation: CoreResourceOperation.READ,\n matches: (config) => config.enabled === true || isNonEmptyArray(config.endpoints),\n};\n\n/** Outside the features provider nothing is offered. Module-level, so the memo below sees one identity. */\nconst offersNoFeature = (_featureId: string): boolean => false;\n\nexport function useLauncherRuntimeAvailabilityContext(): LauncherRuntimeAvailabilityContext {\n const appMode = useAppModeSafe();\n const appScope = useAppScopeSafe();\n const effectiveRoles = useViewerEffectiveRoles();\n // Read without the throwing `useFeatures`, like the roles above: a surface outside the features provider (a resource\n // action bar in an isolated host, a test) gets a shell that offers no feature rather than a crash. Inside the\n // application every reader sits under the provider, so nothing there changes.\n const features = useContext(FeaturesContext);\n const resolvedFeatures = features?.resolvedFeatures;\n const isFeatureOffered = features?.isFeatureOffered ?? offersNoFeature;\n const billing = useBillingSafe();\n\n // Enterprise-config features (SSO / SCIM / SIEM / webhooks) are gated by the\n // framework FEATURE system, along the correct axis. This capability is the\n // app-shell SURVIVAL filter (`requiredCapabilities`) — false → the item is\n // removed entirely — so it must answer \"does this app OFFER feature X?\", NOT\n // \"is the current org ENTITLED to it?\". Using `isFeatureOffered` (entitled OR\n // reachable via an upgrade/add-on) means a billing-on org whose plan lacks the\n // feature still SURVIVES the filter and the section can render an upgrade/add-on\n // prompt via {@link FeatureGate} + `unavailabilityPolicy`, instead of vanishing.\n // Billing off → offered == entitled, so behaviour is unchanged there. Entitlement\n // itself is enforced at render time (FeatureGate) and by the backend FeatureGate.\n //\n // Offered is not the whole survival question, though (#3126). #2367 keeps a capability's configuration when its\n // entitlement lapses, stops applying it, and says so where it is configured (the settings hub's kept-configuration\n // notice). A lapse no plan in the catalogue can cure (a manual override removed, a default grant withdrawn) is not\n // OFFERED, so on that axis alone the section, its notice and its kept configuration all vanished. So a section also\n // survives while something is CONFIGURED there, which the shell has to ask the server: asked only once the features\n // have settled and only when the feature is not offered, since an offered feature keeps the section anyway.\n // Settled for THIS organization: the features answered for the previous scope would ask once, be dropped when the\n // loading flag flips, and ask again.\n const featuresSettled = !!features && features.isLoading !== true\n && (appScope?.currentOrganizationId ?? null) === features.resolvedForOrganizationId;\n const singleSignOnOffered = isFeatureOffered(CoreFeature.SINGLE_SIGN_ON);\n const askAboutSingleSignOn = featuresSettled && !singleSignOnOffered;\n const holdsSsoConnection = useCurrentOrganizationConfigurationPresence(SSO_CONNECTION_PRESENCE_PROBE, askAboutSingleSignOn, effectiveRoles);\n const holdsSsoPolicy = useCurrentOrganizationConfigurationPresence(SSO_POLICY_PRESENCE_PROBE, askAboutSingleSignOn, effectiveRoles);\n const ssoEnabled = singleSignOnOffered || holdsSsoConnection || holdsSsoPolicy;\n // SCIM also needs the current organization's TYPE to admit a directory (#2613): the feature can be offered while the\n // type says no, and then the settings would mint a token the SCIM API refuses. Where the type says no but the\n // organization still holds an unrevoked token, the settings stay reachable with that token's Revoke and nothing else\n // (#2649); whether it holds one is the one capability the shell has to ask the server.\n const directoryProvisioningOffered = isFeatureOffered(CoreFeature.DIRECTORY_PROVISIONING);\n const currentOrganizationType = useCurrentOrganizationType();\n const currentOrganizationDirectoryProvisioned = useCurrentOrganizationDirectoryProvisioned();\n const holdsUnrevokedScimToken = useCurrentOrganizationHoldsUnrevokedScimToken(\n featuresSettled && isUnrevokedScimTokenProbeNeeded({\n featureOffered: directoryProvisioningOffered,\n organizationTypeKnown: currentOrganizationType !== undefined,\n organizationTypeDirectoryProvisioned: currentOrganizationDirectoryProvisioned,\n }),\n effectiveRoles,\n );\n const directoryProvisioningCapabilities = useMemo(\n () => deriveDirectoryProvisioningCapabilities({\n featureOffered: directoryProvisioningOffered,\n organizationTypeDirectoryProvisioned: currentOrganizationDirectoryProvisioned,\n holdsUnrevokedToken: holdsUnrevokedScimToken,\n }),\n [directoryProvisioningOffered, currentOrganizationDirectoryProvisioned, holdsUnrevokedScimToken],\n );\n const securityEventExportOffered = isFeatureOffered(CoreFeature.SECURITY_EVENT_EXPORT);\n const securityEventExportConfigured = useCurrentOrganizationConfigurationPresence(\n SIEM_EXPORT_PRESENCE_PROBE,\n featuresSettled && !securityEventExportOffered,\n effectiveRoles,\n );\n const siemEnabled = securityEventExportOffered || securityEventExportConfigured;\n // Webhooks ask the same two questions (#3172). Since #3114 `M2M_WEBHOOK_DELIVERY`, a scope-boundary feature, is\n // answered at the organization's own scope, so a lapse there makes it not offered; the section then stays while the\n // organization's delivery is switched on or has an endpoint, and shows Test endpoint and the delivery log's Retry\n // locked (#3162) beside the kept-configuration notice.\n const webhookDeliveryOffered = isFeatureOffered(CoreFeature.M2M_WEBHOOK_DELIVERY);\n const webhookDeliveryConfigured = useCurrentOrganizationConfigurationPresence(\n WEBHOOK_CONFIG_PRESENCE_PROBE,\n featuresSettled && !webhookDeliveryOffered,\n effectiveRoles,\n );\n const webhooksEnabled = webhookDeliveryOffered || webhookDeliveryConfigured;\n // The organization audit log is offered or it is not: reading it configures nothing, so no presence probe.\n const auditLogOffered = isFeatureOffered(CoreFeature.AUDIT_LOGS);\n\n // Which side of an organization relationship the CURRENT organization's type can take (#1597): read from the\n // declaration, so a representing organization is not offered a granting organization's register and a granting\n // organization is not offered a representing organization's list of the organizations it represents.\n const relationshipSides = useRelationshipSideCapabilities();\n // Which form the relationship verbs take in this application's shape (#2618): the operator asked without a name, or\n // the other organization named.\n const relationshipShape = useRelationshipShapeCapabilities();\n // Who is offered the decision inbox (#2577): a holder of an answering role in ANY organization entry the server reads\n // an answerer from, not only in the current organization. Read without the throwing `useApplication`.\n const decisionInboxOffer = useContext(ApplicationContext)?.appConfig?.decisionInbox;\n // Whether the application declares any professional qualification kind (#2967): the qualifications settings need one.\n const professionalQualificationsDeclared = Object.keys(useContext(ApplicationContext)?.appConfig?.professionalQualificationKinds ?? {}).length > 0;\n const decisionInbox = useMemo(\n () => deriveDecisionInboxCapabilities({ offer: decisionInboxOffer, effectiveRoles }),\n [decisionInboxOffer, effectiveRoles],\n );\n\n return useMemo(() => ({\n activeMode: appMode?.activeMode ?? null,\n availableModes: appMode?.availableModes ?? [],\n allScopeValues: appScope?.allScopeValues ?? {},\n effectiveRoles,\n resolvedFeatures: resolvedFeatures?.features ?? [],\n runtimeCapabilities: {\n billingEnabled: Boolean(billing?.isEnabled),\n ssoEnabled,\n ...directoryProvisioningCapabilities,\n siemEnabled,\n webhooksEnabled,\n [AUDIT_LOG_OFFERED_CAPABILITY]: auditLogOffered,\n ...relationshipSides,\n ...relationshipShape,\n ...decisionInbox,\n [PROFESSIONAL_QUALIFICATIONS_DECLARED_CAPABILITY]: professionalQualificationsDeclared,\n },\n }), [\n appMode?.activeMode,\n appMode?.availableModes,\n appScope?.allScopeValues,\n effectiveRoles,\n resolvedFeatures?.features,\n billing?.isEnabled,\n ssoEnabled,\n directoryProvisioningCapabilities,\n siemEnabled,\n webhooksEnabled,\n auditLogOffered,\n relationshipSides,\n relationshipShape,\n decisionInbox,\n professionalQualificationsDeclared,\n ]);\n}\n\n/**\n * Whether a launcher item (or a Settings Hub section) survives the app-shell filtering pass: every required runtime\n * capability is on, and the viewer holds one of its `requiredRoles` (#2376).\n *\n * `requiredFeatures` remains the canonical plan/subscription gate later in the\n * launcher resolution + surface rendering pipeline.\n */\nexport function isLauncherRuntimeAvailabilitySatisfied(\n config: LauncherRuntimeAvailabilityConfig | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): boolean {\n const capabilitiesOn = (config?.requiredCapabilities ?? []).every(capability => Boolean(context.runtimeCapabilities[capability]));\n return capabilitiesOn && viewerHoldsOneOfRoles(config?.requiredRoles, context.effectiveRoles);\n}\n\nfunction filterSidebarItemsByRuntimeAvailability(\n items: SidebarItem[],\n context: LauncherRuntimeAvailabilityContext,\n): SidebarItem[] {\n return items.flatMap(item => {\n if (!isLauncherRuntimeAvailabilitySatisfied(item.runtimeAvailability, context)) {\n return [];\n }\n\n if (!item.children?.length) {\n return [item];\n }\n\n return [{\n ...item,\n children: filterSidebarItemsByRuntimeAvailability(item.children, context),\n }];\n });\n}\n\nfunction filterNavigationListSectionByRuntimeAvailability(\n section: SidebarSection_NavigationList,\n context: LauncherRuntimeAvailabilityContext,\n): SidebarSection_NavigationList {\n return {\n ...section,\n children: filterSidebarItemsByRuntimeAvailability(section.children, context),\n };\n}\n\nexport function filterSidebarSectionsByRuntimeAvailability(\n sections: SidebarSection[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): SidebarSection[] | undefined {\n if (!sections?.length) return sections;\n\n const filteredSections: SidebarSection[] = [];\n\n for (const section of sections) {\n if (!isLauncherRuntimeAvailabilitySatisfied(section.runtimeAvailability, context)) {\n continue;\n }\n\n if (section.contentKind === SidebarSectionContentKind.NAVIGATION_LIST) {\n filteredSections.push(filterNavigationListSectionByRuntimeAvailability(section, context));\n continue;\n }\n\n filteredSections.push(section);\n }\n\n return filteredSections;\n}\n\nexport function filterCommandMenuCommandsByRuntimeAvailability(\n commands: CommandMenuCommand[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): CommandMenuCommand[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(commands, context);\n}\n\ntype RuntimeAvailabilityFlatLauncherItem = {\n runtimeAvailability?: LauncherRuntimeAvailabilityConfig;\n};\n\nexport function filterFlatLauncherItemsByRuntimeAvailability<T extends RuntimeAvailabilityFlatLauncherItem>(\n items: T[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): T[] | undefined {\n if (!items?.length) return items;\n\n return items.filter(item =>\n isLauncherRuntimeAvailabilitySatisfied(item.runtimeAvailability, context),\n );\n}\n\nexport function filterQuickActionItemsByRuntimeAvailability(\n items: QuickActionItem[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): QuickActionItem[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(items, context);\n}\n\nexport function filterToolbarItemsByRuntimeAvailability(\n items: ToolbarItem[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): ToolbarItem[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(items, context);\n}\n\nexport function filterControlPanelItemsByRuntimeAvailability(\n items: ControlPanelItem[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): ControlPanelItem[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(items, context);\n}\n\nexport function filterHotkeyBindingsByRuntimeAvailability(\n bindings: HotkeyBinding[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): HotkeyBinding[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(bindings, context);\n}\n\nexport function filterMenubarItemsByRuntimeAvailability(\n items: MenubarLauncherItem[] | undefined,\n context: LauncherRuntimeAvailabilityContext,\n): MenubarLauncherItem[] | undefined {\n return filterFlatLauncherItemsByRuntimeAvailability(items, context);\n}\n"]}
@@ -89,7 +89,7 @@ export type PrimaryDestinationExecutionViewResolver = (viewRef: string) => Prima
89
89
  *
90
90
  * ## The gap this closes
91
91
  *
92
- * `homeDefinition.compositeViewReference` renders its view IN PLACE at `/` — the app root keeps its
92
+ * A composite home (the viewer's resolved `compositeViewReference`) renders its view IN PLACE at `/` — the app root keeps its
93
93
  * URL, and `AppLayout_Home` returns `<CompositeView …>` as the router's children. Its own comment
94
94
  * says it "mirrors the canonical composite render in `NavigationContentAreas`", and it does mirror
95
95
  * the RENDER. What it cannot mirror is the DESTINATION: nothing is pushed onto primary's zone stack,
@@ -135,7 +135,7 @@ export type PrimaryDestinationExecutionViewResolver = (viewRef: string) => Prima
135
135
  * displaced. If something with its own declaration is there, it wins.
136
136
  */
137
137
  export declare function resolveHomeCompositeDestination(params: {
138
- /** `homeDefinition.compositeViewReference`, or `undefined` when the home is not a composite. */
138
+ /** The viewer's resolved home's `compositeViewReference` (`useResolvedHome`, #4576), or `undefined` when it is not a composite. */
139
139
  homeCompositeViewRef: string | undefined;
140
140
  /** Whether the router is at the application root — where, and only where, the home layout renders. */
141
141
  isAppRootPath: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"primary-destination-layout.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/primary-destination-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,qGAAqG;AACrG,MAAM,WAAW,mCAAmC;IAClD,8DAA8D;IAC9D,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;IACxC,8DAA8D;IAC9D,mBAAmB,CAAC,EAAE,kBAAkB,CAAC;IACzC,iEAAiE;IACjE,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GACjC;IACA,WAAW,EAAE,qBAAqB,CAAC,kBAAkB,CAAC;IACtD,eAAe,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE;YAAE,uBAAuB,CAAC,EAAE,mCAAmC,CAAA;SAAE,CAAA;KAAE,CAAC;CACrG,GACC;IAAE,WAAW,EAAE,qBAAqB,CAAC,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACtE;IAAE,WAAW,EAAE,qBAAqB,CAAC,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACtE;IACA,WAAW,EAAE,OAAO,CAClB,qBAAqB,EACrB,qBAAqB,CAAC,kBAAkB,GAAG,qBAAqB,CAAC,cAAc,GAAG,qBAAqB,CAAC,cAAc,CACvH,CAAC;CACH,CAAC;AAEJ,6EAA6E;AAC7E,MAAM,MAAM,+BAA+B,GAAG,mCAAmC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpG;;;;;;;;GAQG;AACH,MAAM,MAAM,uCAAuC,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,mCAAmC,GAAG,SAAS,CAAC;AAE3H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE;IACtD,gGAAgG;IAChG,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,sGAAsG;IACtG,aAAa,EAAE,OAAO,CAAC;IACvB,gFAAgF;IAChF,eAAe,EAAE,yBAAyB,GAAG,SAAS,CAAC;CACxD,GAAG,yBAAyB,GAAG,SAAS,CAKxC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,oCAAoC,CAAC,MAAM,EAAE;IAC3D,cAAc,EAAE,yBAAyB,GAAG,SAAS,CAAC;IACtD,cAAc,EAAE,SAAS,+BAA+B,EAAE,GAAG,SAAS,CAAC;CACxE,GAAG,OAAO,CAWV;AAED;;;;;;;GAOG;AACH,wBAAgB,0CAA0C,CAAC,MAAM,EAAE;IACjE,cAAc,EAAE,yBAAyB,GAAG,SAAS,CAAC;IACtD,cAAc,EAAE,SAAS,+BAA+B,EAAE,GAAG,SAAS,CAAC;IACvE,qHAAqH;IACrH,oBAAoB,CAAC,EAAE,uCAAuC,CAAC;CAChE,GAAG,mCAAmC,GAAG,SAAS,CAmBlD"}
1
+ {"version":3,"file":"primary-destination-layout.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/primary-destination-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,s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AG,SAAS,CAAC;CACxD,GAAG,yBAAyB,GAAG,SAAS,CAKxC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,oCAAoC,CAAC,MAAM,EAAE;IAC3D,cAAc,EAAE,yBAAyB,GAAG,SAAS,CAAC;IACtD,cAAc,EAAE,SAAS,+BAA+B,EAAE,GAAG,SAAS,CAAC;CACxE,GAAG,OAAO,CAWV;AAED;;;;;;;GAOG;AACH,wBAAgB,0CAA0C,CAAC,MAAM,EAAE;IACjE,cAAc,EAAE,yBAAyB,GAAG,SAAS,CAAC;IACtD,cAAc,EAAE,SAAS,+BAA+B,EAAE,GAAG,SAAS,CAAC;IACvE,qHAAqH;IACrH,oBAAoB,CAAC,EAAE,uCAAuC,CAAC;CAChE,GAAG,mCAAmC,GAAG,SAAS,CAmBlD"}
@@ -43,7 +43,7 @@ import { NavigationContentType } from './navigation.schemas.js';
43
43
  *
44
44
  * ## The gap this closes
45
45
  *
46
- * `homeDefinition.compositeViewReference` renders its view IN PLACE at `/` — the app root keeps its
46
+ * A composite home (the viewer's resolved `compositeViewReference`) renders its view IN PLACE at `/` — the app root keeps its
47
47
  * URL, and `AppLayout_Home` returns `<CompositeView …>` as the router's children. Its own comment
48
48
  * says it "mirrors the canonical composite render in `NavigationContentAreas`", and it does mirror
49
49
  * the RENDER. What it cannot mirror is the DESTINATION: nothing is pushed onto primary's zone stack,
@@ -1 +1 @@
1
- {"version":3,"file":"primary-destination-layout.js","sourceRoot":"","sources":["../../../../src/core/navigation/primary-destination-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AA6C7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,UAAU,+BAA+B,CAAC,MAO/C;IACC,MAAM,EAAE,oBAAoB,EAAE,aAAa,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AC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,cAAc,CAAC,OAAO,CAAC,CAAC;IACvF,CAAC;IAED,IAAI,cAAc,CAAC,WAAW,KAAK,qBAAqB,CAAC,cAAc,EAAE,CAAC;QACxE,OAAO,oBAAoB,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/**\n * Layout declarations read off whatever occupies the PRIMARY zone.\n *\n * ## Why one reader for several concerns\n *\n * Two independent layout questions are answered by the destination in primary — what its adjacent\n * zone does when it empties (`adjacentZoneOnEmpty`, issue #191) and how much of the zone its own\n * content occupies (`zoneContentMaxWidth` / `zoneContentFillsHeight`, issue #176) — and both are answered by the SAME lookup: switch\n * on the content kind, then read the composite-view definition or the resource operation's frontend\n * config.\n *\n * Written once for exactly the reason `invariant-call-site-enumeration.md` exists. Two copies of this\n * switch would be two places to remember when a third content kind becomes a destination, and the one\n * that was forgotten would answer `undefined` — a silent deferral to the default, indistinguishable\n * from a destination that deliberately declared nothing.\n *\n * ## Which content kinds can declare\n *\n * A RESOURCE_OPERATION (a list drilling into a detail), a COMPOSITE_VIEW (a canvas or board\n * selecting an item) and an EXECUTION_VIEW (a resource-owned execution surface such as a flow\n * canvas, opened from a launcher on its host record). Everything else — charts, engine pages, the\n * settings hub — answers `undefined` and defers, which is an answer rather than an omission: those\n * surfaces neither open a detail pane nor own a canvas, so they have no opinion to express.\n *\n * EXECUTION_VIEW joined the switch with #1259. An execution view is a separate PRIMARY destination,\n * not a section of the record that launches it: `ResourceLayout_InsertedViews` renders only its\n * LAUNCHER on the host operation, and the launcher navigates to `NavigationContentType.EXECUTION_VIEW`\n * (deep links land there too, in PRIMARY, through `useViewRouterSync`). So declaring geometry on the\n * host READ operation could never reach the canvas, and the switch answered `undefined` for the\n * destination that was actually there — which is how the Wonder Todos flow canvas came to hand-roll\n * pixel heights. Its declaration lives on the execution view itself\n * (`ResourceExecutionViewAuthoringConfig.zoneContentFillsHeight`), and is read through a resolver the\n * caller supplies, because finding a definition from its inserted ref needs the resource registry and\n * this module stays registry-free (see `PrimaryDestinationContent`).\n *\n * `undefined` content is the router-fallback case: primary's stack is empty and `routerChildren` is\n * rendering. It defers too, and that matters on a cold deep-link — neither a reserved empty strip nor\n * an uncapped page should flash before the stack is reconciled from the URL.\n */\n\nimport type { ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport type { ZoneEmptyBehavior } from '@wildo-ai/saas-models';\n\nimport { NavigationContentType } from './navigation.schemas';\n\n/** The layout declarations a destination may carry. Both optional; both default at the read site. */\nexport interface PrimaryDestinationLayoutDeclaration {\n /** See `CompositeViewAuthoringConfig.adjacentZoneOnEmpty`. */\n adjacentZoneOnEmpty?: ZoneEmptyBehavior;\n /** See `CompositeViewAuthoringConfig.zoneContentMaxWidth`. */\n zoneContentMaxWidth?: ResponsiveMaxWidth;\n /** See `CompositeViewAuthoringConfig.zoneContentFillsHeight`. */\n zoneContentFillsHeight?: boolean;\n}\n\n/**\n * The two content shapes this module reads, structurally typed so it does not depend on the full\n * navigation-content union — which already reaches into the resource registry and would make this a\n * cycle.\n */\nexport type PrimaryDestinationContent =\n | {\n contentType: NavigationContentType.RESOURCE_OPERATION;\n resourceContext?: { operation?: { operationFrontendConfig?: PrimaryDestinationLayoutDeclaration } };\n }\n | { contentType: NavigationContentType.COMPOSITE_VIEW; viewRef: string }\n | { contentType: NavigationContentType.EXECUTION_VIEW; viewRef: string }\n | {\n contentType: Exclude<\n NavigationContentType,\n NavigationContentType.RESOURCE_OPERATION | NavigationContentType.COMPOSITE_VIEW | NavigationContentType.EXECUTION_VIEW\n >;\n };\n\n/** A composite view definition, narrowed to the fields this module needs. */\nexport type PrimaryDestinationCompositeView = PrimaryDestinationLayoutDeclaration & { ref: string };\n\n/**\n * Finds the layout declaration of an EXECUTION_VIEW destination from its navigable (inserted) ref.\n *\n * A function rather than a list because execution views are resource-owned: the definition lives on\n * the owning resource's frontend configuration and is reached by parsing the inserted ref\n * (`resolveExecutionViewDefinition`), which needs the registry this module must not import. Omitted\n * means \"no execution view can be resolved here\", and such a destination defers like any kind that\n * declares nothing.\n */\nexport type PrimaryDestinationExecutionViewResolver = (viewRef: string) => PrimaryDestinationLayoutDeclaration | undefined;\n\n/**\n * The destination primary holds when the app root renders a COMPOSITE HOME.\n *\n * ## The gap this closes\n *\n * `homeDefinition.compositeViewReference` renders its view IN PLACE at `/` — the app root keeps its\n * URL, and `AppLayout_Home` returns `<CompositeView …>` as the router's children. Its own comment\n * says it \"mirrors the canonical composite render in `NavigationContentAreas`\", and it does mirror\n * the RENDER. What it cannot mirror is the DESTINATION: nothing is pushed onto primary's zone stack,\n * so `getTopContent(PRIMARY)` answers for a stack the home never wrote to, and every layout\n * declaration the view carries is unreadable.\n *\n * Measured on the workbench at 1512×950 (#1278), whose board declares `adjacentZoneOnEmpty: COLLAPSE`\n * against a zone whose default is `EMPTY_STATE`:\n *\n * | board reached by | primary |\n * |---|---|\n * | `/` after login, hard reload, or a deep link | **470px** — the split's own `[33, 67]` share |\n * | `/composite/creation-board` | 1424px |\n * | sidebar navigation to it | 1424px |\n *\n * So the override worked everywhere the board was a real destination, and nowhere on the one URL the\n * application actually opens at. An operator met a board in a third of the window on every load and\n * could only widen it by navigating away and back.\n *\n * ## Why here, and why it fixes three things at once\n *\n * `NavigationContentAreas` reads primary's destination ONCE and feeds it to the `onEmpty` override,\n * the zone geometry (`zoneContentMaxWidth` / `zoneContentFillsHeight`) and the resolved/unresolved\n * predicate. All three were blind in the same way, so a composite home was also silently capped at\n * the default content width — the defect #176 fixed for canvases, arriving again through the home\n * door. One fallback at the shared seam answers all three, which is the same argument this module's\n * own docstring makes for owning the content-kind switch.\n *\n * ## What is actually in primary at the root, measured rather than assumed\n *\n * `ENGINE_PAGE`. The first version of this fix was a `??` fallback for an EMPTY stack and changed\n * nothing, because the stack is not empty: the shell pushes the home as an engine page, and an\n * engine page is precisely the kind `primaryDestinationDeclarationIsKnown` answers `true` for and\n * `resolvePrimaryDestinationLayoutDeclaration` answers `undefined` for — resolved, declares nothing.\n * Correct for a real engine page; wrong for one whose whole content is a composite view.\n *\n * So this OVERRIDES rather than defaults, and the two guards are what keep the override narrow:\n *\n * - **the root path**, because that is where and only where the home layout renders. An empty or\n * engine-page primary elsewhere is a different surface, and handing it the home's `COLLAPSE` would\n * HIDE a pane that destination wanted reserved — a worse failure than the one being fixed.\n * - **the stack top being absent or an ENGINE_PAGE**, so a real destination in primary is never\n * displaced. If something with its own declaration is there, it wins.\n */\nexport function resolveHomeCompositeDestination(params: {\n /** `homeDefinition.compositeViewReference`, or `undefined` when the home is not a composite. */\n homeCompositeViewRef: string | undefined;\n /** Whether the router is at the application root — where, and only where, the home layout renders. */\n isAppRootPath: boolean;\n /** What primary's own stack holds, so a real destination is never displaced. */\n primaryStackTop: PrimaryDestinationContent | undefined;\n}): PrimaryDestinationContent | undefined {\n const { homeCompositeViewRef, isAppRootPath, primaryStackTop } = params;\n if (!isAppRootPath || !homeCompositeViewRef) return undefined;\n if (primaryStackTop && primaryStackTop.contentType !== NavigationContentType.ENGINE_PAGE) return undefined;\n return { contentType: NavigationContentType.COMPOSITE_VIEW, viewRef: homeCompositeViewRef };\n}\n\n/**\n * Whether we YET KNOW what the destination in primary declares.\n *\n * `resolvePrimaryDestinationLayoutDeclaration` answers `undefined` for two different situations, and\n * for the reads that only pick a default they are interchangeable — which is why they were allowed to\n * stay merged. For one read they are NOT:\n *\n * - **resolved, and declares nothing** — a chart, an engine page, the settings hub. An answer.\n * - **not resolved yet** — primary's stack is empty while the URL is being reconciled, or the\n * composite-view definition has not reached `compositeViews`. Not an answer; a moment.\n *\n * The read that must tell them apart is whether an empty adjacent zone RESERVES space. Reserving is a\n * structural decision: it takes a third of the window away from primary. Taking a default during the\n * unresolved moment means the zone's `onEmpty` briefly wins over a destination override that is about\n * to say the opposite, and the pane appears and vanishes within ~25ms — measured on the workbench\n * creation board, whose zone declares `EMPTY_STATE` and whose every destination overrides `COLLAPSE`.\n *\n * This module's own docstring already named that hazard — \"neither a reserved empty strip nor an\n * uncapped page should flash before the stack is reconciled from the URL\" — and deferring to the zone\n * default is exactly what produced it. The distinction it says costs nothing to keep is what this\n * predicate finally spends.\n *\n * Width does NOT need this. Both sides of an unresolved width answer `'content'`, so nothing moves.\n */\nexport function primaryDestinationDeclarationIsKnown(params: {\n primaryContent: PrimaryDestinationContent | undefined;\n compositeViews: readonly PrimaryDestinationCompositeView[] | undefined;\n}): boolean {\n const { primaryContent, compositeViews } = params;\n if (!primaryContent) {\n return false;\n }\n if (primaryContent.contentType === NavigationContentType.COMPOSITE_VIEW) {\n // A view whose definition has not arrived is indistinguishable from one that declares nothing —\n // and the two want opposite structural answers, so treat the absence as \"not yet\".\n return compositeViews?.some((candidate) => candidate.ref === primaryContent.viewRef) ?? false;\n }\n return true;\n}\n\n/**\n * Resolve the layout declarations carried by the destination currently in PRIMARY.\n *\n * Returns `undefined` when there is no destination or the destination kind carries no declarations —\n * distinct from returning an empty object, so a caller can tell \"nothing there\" from \"there, and\n * declared nothing\". Both defer to the same defaults today; keeping them distinct costs nothing and\n * makes a future default-by-content-kind expressible.\n */\nexport function resolvePrimaryDestinationLayoutDeclaration(params: {\n primaryContent: PrimaryDestinationContent | undefined;\n compositeViews: readonly PrimaryDestinationCompositeView[] | undefined;\n /** How an EXECUTION_VIEW destination's declaration is found. See {@link PrimaryDestinationExecutionViewResolver}. */\n resolveExecutionView?: PrimaryDestinationExecutionViewResolver;\n}): PrimaryDestinationLayoutDeclaration | undefined {\n const { primaryContent, compositeViews, resolveExecutionView } = params;\n if (!primaryContent) {\n return undefined;\n }\n\n if (primaryContent.contentType === NavigationContentType.RESOURCE_OPERATION) {\n return primaryContent.resourceContext?.operation?.operationFrontendConfig;\n }\n\n if (primaryContent.contentType === NavigationContentType.COMPOSITE_VIEW) {\n return compositeViews?.find((candidate) => candidate.ref === primaryContent.viewRef);\n }\n\n if (primaryContent.contentType === NavigationContentType.EXECUTION_VIEW) {\n return resolveExecutionView?.(primaryContent.viewRef);\n }\n\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"primary-destination-layout.js","sourceRoot":"","sources":["../../../../src/core/navigation/primary-destination-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AA6C7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,UAAU,+BAA+B,CAAC,MAO/C;IACC,MAAM,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IACxE,IAAI,CAAC,aAAa,IAAI,CAAC,oBAAoB;QAAE,OAAO,SAAS,CAAC;IAC9D,IAAI,eAAe,IAAI,eAAe,CAAC,WAAW,KAAK,qBAAqB,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC;IAC3G,OAAO,EAAE,WAAW,EAAE,qBAAqB,CAAC,cAAc,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAC9F,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,oCAAoC,CAAC,MAGpD;IACC,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAClD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,cAAc,CAAC,WAAW,KAAK,qBAAqB,CAAC,cAAc,EAAE,CAAC;QACxE,gGAAgG;QAChG,mFAAmF;QACnF,OAAO,cAAc,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,cAAc,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC;IAChG,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,0CAA0C,CAAC,MAK1D;IACC,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;IACxE,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,cAAc,CAAC,WAAW,KAAK,qBAAqB,CAAC,kBAAkB,EAAE,CAAC;QAC5E,OAAO,cAAc,CAAC,eAAe,EAAE,SAAS,EAAE,uBAAuB,CAAC;IAC5E,CAAC;IAED,IAAI,cAAc,CAAC,WAAW,KAAK,qBAAqB,CAAC,cAAc,EAAE,CAAC;QACxE,OAAO,cAAc,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,cAAc,CAAC,OAAO,CAAC,CAAC;IACvF,CAAC;IAED,IAAI,cAAc,CAAC,WAAW,KAAK,qBAAqB,CAAC,cAAc,EAAE,CAAC;QACxE,OAAO,oBAAoB,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/**\n * Layout declarations read off whatever occupies the PRIMARY zone.\n *\n * ## Why one reader for several concerns\n *\n * Two independent layout questions are answered by the destination in primary — what its adjacent\n * zone does when it empties (`adjacentZoneOnEmpty`, issue #191) and how much of the zone its own\n * content occupies (`zoneContentMaxWidth` / `zoneContentFillsHeight`, issue #176) — and both are answered by the SAME lookup: switch\n * on the content kind, then read the composite-view definition or the resource operation's frontend\n * config.\n *\n * Written once for exactly the reason `invariant-call-site-enumeration.md` exists. Two copies of this\n * switch would be two places to remember when a third content kind becomes a destination, and the one\n * that was forgotten would answer `undefined` — a silent deferral to the default, indistinguishable\n * from a destination that deliberately declared nothing.\n *\n * ## Which content kinds can declare\n *\n * A RESOURCE_OPERATION (a list drilling into a detail), a COMPOSITE_VIEW (a canvas or board\n * selecting an item) and an EXECUTION_VIEW (a resource-owned execution surface such as a flow\n * canvas, opened from a launcher on its host record). Everything else — charts, engine pages, the\n * settings hub — answers `undefined` and defers, which is an answer rather than an omission: those\n * surfaces neither open a detail pane nor own a canvas, so they have no opinion to express.\n *\n * EXECUTION_VIEW joined the switch with #1259. An execution view is a separate PRIMARY destination,\n * not a section of the record that launches it: `ResourceLayout_InsertedViews` renders only its\n * LAUNCHER on the host operation, and the launcher navigates to `NavigationContentType.EXECUTION_VIEW`\n * (deep links land there too, in PRIMARY, through `useViewRouterSync`). So declaring geometry on the\n * host READ operation could never reach the canvas, and the switch answered `undefined` for the\n * destination that was actually there — which is how the Wonder Todos flow canvas came to hand-roll\n * pixel heights. Its declaration lives on the execution view itself\n * (`ResourceExecutionViewAuthoringConfig.zoneContentFillsHeight`), and is read through a resolver the\n * caller supplies, because finding a definition from its inserted ref needs the resource registry and\n * this module stays registry-free (see `PrimaryDestinationContent`).\n *\n * `undefined` content is the router-fallback case: primary's stack is empty and `routerChildren` is\n * rendering. It defers too, and that matters on a cold deep-link — neither a reserved empty strip nor\n * an uncapped page should flash before the stack is reconciled from the URL.\n */\n\nimport type { ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport type { ZoneEmptyBehavior } from '@wildo-ai/saas-models';\n\nimport { NavigationContentType } from './navigation.schemas';\n\n/** The layout declarations a destination may carry. Both optional; both default at the read site. */\nexport interface PrimaryDestinationLayoutDeclaration {\n /** See `CompositeViewAuthoringConfig.adjacentZoneOnEmpty`. */\n adjacentZoneOnEmpty?: ZoneEmptyBehavior;\n /** See `CompositeViewAuthoringConfig.zoneContentMaxWidth`. */\n zoneContentMaxWidth?: ResponsiveMaxWidth;\n /** See `CompositeViewAuthoringConfig.zoneContentFillsHeight`. */\n zoneContentFillsHeight?: boolean;\n}\n\n/**\n * The two content shapes this module reads, structurally typed so it does not depend on the full\n * navigation-content union — which already reaches into the resource registry and would make this a\n * cycle.\n */\nexport type PrimaryDestinationContent =\n | {\n contentType: NavigationContentType.RESOURCE_OPERATION;\n resourceContext?: { operation?: { operationFrontendConfig?: PrimaryDestinationLayoutDeclaration } };\n }\n | { contentType: NavigationContentType.COMPOSITE_VIEW; viewRef: string }\n | { contentType: NavigationContentType.EXECUTION_VIEW; viewRef: string }\n | {\n contentType: Exclude<\n NavigationContentType,\n NavigationContentType.RESOURCE_OPERATION | NavigationContentType.COMPOSITE_VIEW | NavigationContentType.EXECUTION_VIEW\n >;\n };\n\n/** A composite view definition, narrowed to the fields this module needs. */\nexport type PrimaryDestinationCompositeView = PrimaryDestinationLayoutDeclaration & { ref: string };\n\n/**\n * Finds the layout declaration of an EXECUTION_VIEW destination from its navigable (inserted) ref.\n *\n * A function rather than a list because execution views are resource-owned: the definition lives on\n * the owning resource's frontend configuration and is reached by parsing the inserted ref\n * (`resolveExecutionViewDefinition`), which needs the registry this module must not import. Omitted\n * means \"no execution view can be resolved here\", and such a destination defers like any kind that\n * declares nothing.\n */\nexport type PrimaryDestinationExecutionViewResolver = (viewRef: string) => PrimaryDestinationLayoutDeclaration | undefined;\n\n/**\n * The destination primary holds when the app root renders a COMPOSITE HOME.\n *\n * ## The gap this closes\n *\n * A composite home (the viewer's resolved `compositeViewReference`) renders its view IN PLACE at `/` — the app root keeps its\n * URL, and `AppLayout_Home` returns `<CompositeView …>` as the router's children. Its own comment\n * says it \"mirrors the canonical composite render in `NavigationContentAreas`\", and it does mirror\n * the RENDER. What it cannot mirror is the DESTINATION: nothing is pushed onto primary's zone stack,\n * so `getTopContent(PRIMARY)` answers for a stack the home never wrote to, and every layout\n * declaration the view carries is unreadable.\n *\n * Measured on the workbench at 1512×950 (#1278), whose board declares `adjacentZoneOnEmpty: COLLAPSE`\n * against a zone whose default is `EMPTY_STATE`:\n *\n * | board reached by | primary |\n * |---|---|\n * | `/` after login, hard reload, or a deep link | **470px** — the split's own `[33, 67]` share |\n * | `/composite/creation-board` | 1424px |\n * | sidebar navigation to it | 1424px |\n *\n * So the override worked everywhere the board was a real destination, and nowhere on the one URL the\n * application actually opens at. An operator met a board in a third of the window on every load and\n * could only widen it by navigating away and back.\n *\n * ## Why here, and why it fixes three things at once\n *\n * `NavigationContentAreas` reads primary's destination ONCE and feeds it to the `onEmpty` override,\n * the zone geometry (`zoneContentMaxWidth` / `zoneContentFillsHeight`) and the resolved/unresolved\n * predicate. All three were blind in the same way, so a composite home was also silently capped at\n * the default content width — the defect #176 fixed for canvases, arriving again through the home\n * door. One fallback at the shared seam answers all three, which is the same argument this module's\n * own docstring makes for owning the content-kind switch.\n *\n * ## What is actually in primary at the root, measured rather than assumed\n *\n * `ENGINE_PAGE`. The first version of this fix was a `??` fallback for an EMPTY stack and changed\n * nothing, because the stack is not empty: the shell pushes the home as an engine page, and an\n * engine page is precisely the kind `primaryDestinationDeclarationIsKnown` answers `true` for and\n * `resolvePrimaryDestinationLayoutDeclaration` answers `undefined` for — resolved, declares nothing.\n * Correct for a real engine page; wrong for one whose whole content is a composite view.\n *\n * So this OVERRIDES rather than defaults, and the two guards are what keep the override narrow:\n *\n * - **the root path**, because that is where and only where the home layout renders. An empty or\n * engine-page primary elsewhere is a different surface, and handing it the home's `COLLAPSE` would\n * HIDE a pane that destination wanted reserved — a worse failure than the one being fixed.\n * - **the stack top being absent or an ENGINE_PAGE**, so a real destination in primary is never\n * displaced. If something with its own declaration is there, it wins.\n */\nexport function resolveHomeCompositeDestination(params: {\n /** The viewer's resolved home's `compositeViewReference` (`useResolvedHome`, #4576), or `undefined` when it is not a composite. */\n homeCompositeViewRef: string | undefined;\n /** Whether the router is at the application root — where, and only where, the home layout renders. */\n isAppRootPath: boolean;\n /** What primary's own stack holds, so a real destination is never displaced. */\n primaryStackTop: PrimaryDestinationContent | undefined;\n}): PrimaryDestinationContent | undefined {\n const { homeCompositeViewRef, isAppRootPath, primaryStackTop } = params;\n if (!isAppRootPath || !homeCompositeViewRef) return undefined;\n if (primaryStackTop && primaryStackTop.contentType !== NavigationContentType.ENGINE_PAGE) return undefined;\n return { contentType: NavigationContentType.COMPOSITE_VIEW, viewRef: homeCompositeViewRef };\n}\n\n/**\n * Whether we YET KNOW what the destination in primary declares.\n *\n * `resolvePrimaryDestinationLayoutDeclaration` answers `undefined` for two different situations, and\n * for the reads that only pick a default they are interchangeable — which is why they were allowed to\n * stay merged. For one read they are NOT:\n *\n * - **resolved, and declares nothing** — a chart, an engine page, the settings hub. An answer.\n * - **not resolved yet** — primary's stack is empty while the URL is being reconciled, or the\n * composite-view definition has not reached `compositeViews`. Not an answer; a moment.\n *\n * The read that must tell them apart is whether an empty adjacent zone RESERVES space. Reserving is a\n * structural decision: it takes a third of the window away from primary. Taking a default during the\n * unresolved moment means the zone's `onEmpty` briefly wins over a destination override that is about\n * to say the opposite, and the pane appears and vanishes within ~25ms — measured on the workbench\n * creation board, whose zone declares `EMPTY_STATE` and whose every destination overrides `COLLAPSE`.\n *\n * This module's own docstring already named that hazard — \"neither a reserved empty strip nor an\n * uncapped page should flash before the stack is reconciled from the URL\" — and deferring to the zone\n * default is exactly what produced it. The distinction it says costs nothing to keep is what this\n * predicate finally spends.\n *\n * Width does NOT need this. Both sides of an unresolved width answer `'content'`, so nothing moves.\n */\nexport function primaryDestinationDeclarationIsKnown(params: {\n primaryContent: PrimaryDestinationContent | undefined;\n compositeViews: readonly PrimaryDestinationCompositeView[] | undefined;\n}): boolean {\n const { primaryContent, compositeViews } = params;\n if (!primaryContent) {\n return false;\n }\n if (primaryContent.contentType === NavigationContentType.COMPOSITE_VIEW) {\n // A view whose definition has not arrived is indistinguishable from one that declares nothing —\n // and the two want opposite structural answers, so treat the absence as \"not yet\".\n return compositeViews?.some((candidate) => candidate.ref === primaryContent.viewRef) ?? false;\n }\n return true;\n}\n\n/**\n * Resolve the layout declarations carried by the destination currently in PRIMARY.\n *\n * Returns `undefined` when there is no destination or the destination kind carries no declarations —\n * distinct from returning an empty object, so a caller can tell \"nothing there\" from \"there, and\n * declared nothing\". Both defer to the same defaults today; keeping them distinct costs nothing and\n * makes a future default-by-content-kind expressible.\n */\nexport function resolvePrimaryDestinationLayoutDeclaration(params: {\n primaryContent: PrimaryDestinationContent | undefined;\n compositeViews: readonly PrimaryDestinationCompositeView[] | undefined;\n /** How an EXECUTION_VIEW destination's declaration is found. See {@link PrimaryDestinationExecutionViewResolver}. */\n resolveExecutionView?: PrimaryDestinationExecutionViewResolver;\n}): PrimaryDestinationLayoutDeclaration | undefined {\n const { primaryContent, compositeViews, resolveExecutionView } = params;\n if (!primaryContent) {\n return undefined;\n }\n\n if (primaryContent.contentType === NavigationContentType.RESOURCE_OPERATION) {\n return primaryContent.resourceContext?.operation?.operationFrontendConfig;\n }\n\n if (primaryContent.contentType === NavigationContentType.COMPOSITE_VIEW) {\n return compositeViews?.find((candidate) => candidate.ref === primaryContent.viewRef);\n }\n\n if (primaryContent.contentType === NavigationContentType.EXECUTION_VIEW) {\n return resolveExecutionView?.(primaryContent.viewRef);\n }\n\n return undefined;\n}\n"]}
@@ -0,0 +1,26 @@
1
+ import type { ChartDefinition } from '@wildo-ai/saas-models';
2
+ /** What a rendering surface does with one chart. */
3
+ export declare enum ChartReadDecision {
4
+ /** The viewer's roles have not loaded yet: render nothing, and decide once they arrive (never shown, then withdrawn). */
5
+ PENDING = "pending",
6
+ /** The chart gate would answer this viewer: render the chart. */
7
+ ALLOWED = "allowed",
8
+ /** The chart gate would refuse this viewer: do not render the chart (a page shows "not found", an embed nothing). */
9
+ REFUSED = "refused"
10
+ }
11
+ /**
12
+ * The decision for `chartDefinition` and the current viewer.
13
+ *
14
+ * Outside a signed-in session (no `UserOrgsProvider` above the surface, or nobody signed in: a public page, a test
15
+ * harness rendering a chart alone) there is no viewer to judge, and the chart is rendered for the backend to decide, as
16
+ * before #4252. The routes that render charts sit behind the authenticated-route guard, so in the app a viewer reaching
17
+ * one is signed in.
18
+ */
19
+ export declare function useChartReadDecision(chartDefinition: Pick<ChartDefinition, 'dataQuery' | 'accessControl'> | undefined): ChartReadDecision;
20
+ /**
21
+ * The same decision as a predicate, for a surface that FILTERS a list of charts (the charts a resource page inserts).
22
+ * While the viewer's roles load it answers no, so a chart appears once they arrive rather than being shown and then
23
+ * withdrawn; outside a signed-in session it answers yes, as {@link useChartReadDecision} does.
24
+ */
25
+ export declare function useViewerMayReadChartPredicate(): (chartDefinition: Pick<ChartDefinition, 'dataQuery' | 'accessControl'>) => boolean;
26
+ //# sourceMappingURL=useChartReadDecision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChartReadDecision.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/useChartReadDecision.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAW7D,oDAAoD;AACpD,oBAAY,iBAAiB;IAC3B,yHAAyH;IACzH,OAAO,YAAY;IACnB,iEAAiE;IACjE,OAAO,YAAY;IACnB,qHAAqH;IACrH,OAAO,YAAY;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,eAAe,CAAC,GAAG,SAAS,GAAG,iBAAiB,CAOzI;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,eAAe,CAAC,KAAK,OAAO,CASnI"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Whether the current viewer may read one chart, for a surface that RENDERS it (#4252): a chart's page, the charts a
3
+ * resource page inserts, and every chart embed. The decision is {@link viewerMayReadChart}, the frontend's one copy of
4
+ * the backend's chart gate, so a surface shows exactly the charts the backend would answer.
5
+ *
6
+ * Presentation, never authorization: the backend decides every request. What this removes is a surface offering a
7
+ * chart and then showing its error card.
8
+ */
9
+ import { useCallback, useContext } from 'react';
10
+ import { useResourceRegistry } from '../../core/resources/useResourceRegistry.js';
11
+ import { UserOrgsContext } from '../../core/security/UserOrgsContext.js';
12
+ import { useViewerEffectiveRoles } from './launcher-runtime-availability.js';
13
+ import { viewerMayReadChart } from './chart-read-gate.js';
14
+ /** Whether a viewer is signed in, so there is someone to judge. */
15
+ function isSignedIn(userOrgs) {
16
+ return userOrgs !== undefined && userOrgs.isAuthenticated();
17
+ }
18
+ /** What a rendering surface does with one chart. */
19
+ export var ChartReadDecision;
20
+ (function (ChartReadDecision) {
21
+ /** The viewer's roles have not loaded yet: render nothing, and decide once they arrive (never shown, then withdrawn). */
22
+ ChartReadDecision["PENDING"] = "pending";
23
+ /** The chart gate would answer this viewer: render the chart. */
24
+ ChartReadDecision["ALLOWED"] = "allowed";
25
+ /** The chart gate would refuse this viewer: do not render the chart (a page shows "not found", an embed nothing). */
26
+ ChartReadDecision["REFUSED"] = "refused";
27
+ })(ChartReadDecision || (ChartReadDecision = {}));
28
+ /**
29
+ * The decision for `chartDefinition` and the current viewer.
30
+ *
31
+ * Outside a signed-in session (no `UserOrgsProvider` above the surface, or nobody signed in: a public page, a test
32
+ * harness rendering a chart alone) there is no viewer to judge, and the chart is rendered for the backend to decide, as
33
+ * before #4252. The routes that render charts sit behind the authenticated-route guard, so in the app a viewer reaching
34
+ * one is signed in.
35
+ */
36
+ export function useChartReadDecision(chartDefinition) {
37
+ const userOrgs = useContext(UserOrgsContext);
38
+ const viewer = useViewerEffectiveRoles();
39
+ const { registry } = useResourceRegistry();
40
+ if (!chartDefinition || !isSignedIn(userOrgs))
41
+ return ChartReadDecision.ALLOWED;
42
+ if (userOrgs.permissions === null)
43
+ return ChartReadDecision.PENDING;
44
+ return viewerMayReadChart(chartDefinition, registry, viewer) ? ChartReadDecision.ALLOWED : ChartReadDecision.REFUSED;
45
+ }
46
+ /**
47
+ * The same decision as a predicate, for a surface that FILTERS a list of charts (the charts a resource page inserts).
48
+ * While the viewer's roles load it answers no, so a chart appears once they arrive rather than being shown and then
49
+ * withdrawn; outside a signed-in session it answers yes, as {@link useChartReadDecision} does.
50
+ */
51
+ export function useViewerMayReadChartPredicate() {
52
+ const userOrgs = useContext(UserOrgsContext);
53
+ const viewer = useViewerEffectiveRoles();
54
+ const { registry } = useResourceRegistry();
55
+ const outsideSession = !isSignedIn(userOrgs);
56
+ return useCallback((chartDefinition) => outsideSession || viewerMayReadChart(chartDefinition, registry, viewer), [outsideSession, registry, viewer]);
57
+ }
58
+ //# sourceMappingURL=useChartReadDecision.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChartReadDecision.js","sourceRoot":"","sources":["../../../../src/core/navigation/useChartReadDecision.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,mEAAmE;AACnE,SAAS,UAAU,CAAC,QAAwD;IAC1E,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,eAAe,EAAE,CAAC;AAC9D,CAAC;AAED,oDAAoD;AACpD,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,yHAAyH;IACzH,wCAAmB,CAAA;IACnB,iEAAiE;IACjE,wCAAmB,CAAA;IACnB,qHAAqH;IACrH,wCAAmB,CAAA;AACrB,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,eAAiF;IACpH,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,MAAM,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC3C,IAAI,CAAC,eAAe,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,iBAAiB,CAAC,OAAO,CAAC;IAChF,IAAI,QAAQ,CAAC,WAAW,KAAK,IAAI;QAAE,OAAO,iBAAiB,CAAC,OAAO,CAAC;IACpE,OAAO,kBAAkB,CAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC;AACvH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,MAAM,EAAE,QAAQ,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC3C,MAAM,cAAc,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC7C,OAAO,WAAW,CAChB,CAAC,eAAe,EAAE,EAAE,CAAC,cAAc,IAAI,kBAAkB,CAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,EAC5F,CAAC,cAAc,EAAE,QAAQ,EAAE,MAAM,CAAC,CACnC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Whether the current viewer may read one chart, for a surface that RENDERS it (#4252): a chart's page, the charts a\n * resource page inserts, and every chart embed. The decision is {@link viewerMayReadChart}, the frontend's one copy of\n * the backend's chart gate, so a surface shows exactly the charts the backend would answer.\n *\n * Presentation, never authorization: the backend decides every request. What this removes is a surface offering a\n * chart and then showing its error card.\n */\nimport { useCallback, useContext } from 'react';\nimport type { ChartDefinition } from '@wildo-ai/saas-models';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { UserOrgsContext } from '~wildo-frontend-lib/core/security/UserOrgsContext';\nimport { useViewerEffectiveRoles } from './launcher-runtime-availability';\nimport { viewerMayReadChart } from './chart-read-gate';\n\n/** Whether a viewer is signed in, so there is someone to judge. */\nfunction isSignedIn(userOrgs: { isAuthenticated: () => boolean } | undefined): boolean {\n return userOrgs !== undefined && userOrgs.isAuthenticated();\n}\n\n/** What a rendering surface does with one chart. */\nexport enum ChartReadDecision {\n /** The viewer's roles have not loaded yet: render nothing, and decide once they arrive (never shown, then withdrawn). */\n PENDING = 'pending',\n /** The chart gate would answer this viewer: render the chart. */\n ALLOWED = 'allowed',\n /** The chart gate would refuse this viewer: do not render the chart (a page shows \"not found\", an embed nothing). */\n REFUSED = 'refused',\n}\n\n/**\n * The decision for `chartDefinition` and the current viewer.\n *\n * Outside a signed-in session (no `UserOrgsProvider` above the surface, or nobody signed in: a public page, a test\n * harness rendering a chart alone) there is no viewer to judge, and the chart is rendered for the backend to decide, as\n * before #4252. The routes that render charts sit behind the authenticated-route guard, so in the app a viewer reaching\n * one is signed in.\n */\nexport function useChartReadDecision(chartDefinition: Pick<ChartDefinition, 'dataQuery' | 'accessControl'> | undefined): ChartReadDecision {\n const userOrgs = useContext(UserOrgsContext);\n const viewer = useViewerEffectiveRoles();\n const { registry } = useResourceRegistry();\n if (!chartDefinition || !isSignedIn(userOrgs)) return ChartReadDecision.ALLOWED;\n if (userOrgs.permissions === null) return ChartReadDecision.PENDING;\n return viewerMayReadChart(chartDefinition, registry, viewer) ? ChartReadDecision.ALLOWED : ChartReadDecision.REFUSED;\n}\n\n/**\n * The same decision as a predicate, for a surface that FILTERS a list of charts (the charts a resource page inserts).\n * While the viewer's roles load it answers no, so a chart appears once they arrive rather than being shown and then\n * withdrawn; outside a signed-in session it answers yes, as {@link useChartReadDecision} does.\n */\nexport function useViewerMayReadChartPredicate(): (chartDefinition: Pick<ChartDefinition, 'dataQuery' | 'accessControl'>) => boolean {\n const userOrgs = useContext(UserOrgsContext);\n const viewer = useViewerEffectiveRoles();\n const { registry } = useResourceRegistry();\n const outsideSession = !isSignedIn(userOrgs);\n return useCallback(\n (chartDefinition) => outsideSession || viewerMayReadChart(chartDefinition, registry, viewer),\n [outsideSession, registry, viewer],\n );\n}\n"]}
@@ -45,7 +45,7 @@
45
45
  * a loop, and the API stays reachable.
46
46
  */
47
47
  import { CoreResourceOperation, type ResourceType } from '@wildo-ai/saas-models';
48
- import { type LauncherEffectiveRoles } from './launcher-resolution';
48
+ import { type LauncherEffectiveRoles } from './viewer-roles';
49
49
  /**
50
50
  * What one probe asks: which resource, through which of its default operations, and which row counts as "configured".
51
51
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentOrganizationConfigurationPresence.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/useCurrentOrganizationConfigurationPresence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAGH,OAAO,EACL,qBAAqB,EAMrB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAA6B,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAO/F;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,6GAA6G;IAC7G,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;IAC5E,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC;CACvE;AAED,8DAA8D;AAC9D,oBAAY,+BAA+B;IACzC,2DAA2D;IAC3D,OAAO,YAAY;IACnB,sDAAsD;IACtD,IAAI,SAAS;IACb,+DAA+D;IAC/D,IAAI,SAAS;IACb,6GAA6G;IAC7G,OAAO,YAAY;IACnB,iHAAiH;IACjH,KAAK,UAAU;CAChB;AAyCD,6HAA6H;AAC7H,wBAAgB,iCAAiC,IAAI,IAAI,CAIxD;AA+CD;;;GAGG;AACH,wBAAgB,2CAA2C,CACzD,KAAK,EAAE,0BAA0B,EACjC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAwHT"}
1
+ {"version":3,"file":"useCurrentOrganizationConfigurationPresence.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/useCurrentOrganizationConfigurationPresence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAGH,OAAO,EACL,qBAAqB,EAMrB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAO7D;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,6GAA6G;IAC7G,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;IAC5E,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC;CACvE;AAED,8DAA8D;AAC9D,oBAAY,+BAA+B;IACzC,2DAA2D;IAC3D,OAAO,YAAY;IACnB,sDAAsD;IACtD,IAAI,SAAS;IACb,+DAA+D;IAC/D,IAAI,SAAS;IACb,6GAA6G;IAC7G,OAAO,YAAY;IACnB,iHAAiH;IACjH,KAAK,UAAU;CAChB;AAyCD,6HAA6H;AAC7H,wBAAgB,iCAAiC,IAAI,IAAI,CAIxD;AA+CD;;;GAGG;AACH,wBAAgB,2CAA2C,CACzD,KAAK,EAAE,0BAA0B,EACjC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAwHT"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentOrganizationConfigurationPresence.js","sourceRoot":"","sources":["../../../../src/core/navigation/useCurrentOrganizationConfig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IAC3F,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAC3B,OAAO,GAAG,CAAC,EAAE,CACX,cAAc,CAAC,2BAA2B,EAC1C,GAAG,EAAE,CAAC,mCAAmC,CAAC,GAAG,CAAC,EAC9C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY;eACnD,CAAC,qBAAqB,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,EAAE,CAAC,CACvG,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC","sourcesContent":["/**\n * Whether the CURRENT organization holds a piece of configuration the shell has to FETCH rather than derive (#2649,\n * #3126, #3172): an unrevoked SCIM token, an SSO connection, a SIEM export or webhook delivery that is switched on.\n *\n * Read by `useLauncherRuntimeAvailabilityContext`. Two cases ask it:\n *\n * - **SCIM, a type no directory may use** (#2649): the section stays reachable, Revoke only, while a token is live.\n * - **A capability whose entitlement lapsed and no plan sells** (#3126): #2367 keeps the configuration, stops applying\n * it, and says so where it is configured. The rail used to keep an entitlement-gated section only while the feature\n * was OFFERED (entitled, or reachable through an upgrade), so a lapse no plan could cure removed the section, and with\n * it the notice and the kept configuration. The section now also survives while something is configured there.\n *\n * ## One answer per (probe, account, organization), shared by every reader\n *\n * The launcher context is read by every launcher surface (sidebar, command menu, toolbar, settings hub, resource action\n * bars), so a fetch inside each reader would send one request per surface. The answer is kept in a module-level table\n * instead, keyed by probe, account and organization, and every reader subscribes to the same entry: the first reader\n * that needs it asks, the rest wait for that answer. A different account or organization is a different key, so nothing\n * is ever read across a sign-in or an organization switch.\n *\n * ## When it asks, and when it asks again\n *\n * It asks only when the caller says the answer can change what is shown (`asked`) AND the viewer may perform the\n * probe's operation, by the registry's own roles. Every other caller gets `false` without a request.\n *\n * The answer goes STALE, and is asked again by the next reader, when:\n *\n * - a write on the probe's resource succeeds (`RESOURCE_OPERATION_EXECUTED`), so revoking the last token or deleting\n * the last connection removes the section;\n * - a reader moves to another organization, so coming back asks again rather than reusing what was true when it left\n * (which is also how a failed read gets another try).\n *\n * While a stale answer is re-asked, readers keep the LAST SETTLED answer (#2649 review F4). Reading `false` meanwhile\n * would drop the section for the length of the request: an administrator revoking one of three leftover tokens would\n * watch the hub jump to its default section and back. A change made in another session is seen on the next of those\n * two events, or on a reload: the shell's ordinary staleness for a configuration-like signal, and the server refuses\n * nothing on the strength of it.\n *\n * ## Reads\n *\n * A LIST probe pages its rows until one matches or none remain, because no LIST declares a filter for every predicate a\n * probe asks (the SCIM tokens LIST has no `isActive` filter, and a page of revoked tokens would otherwise hide a live\n * one). A READ probe reads the organization's one row, the shape of a context-addressed configuration singleton. A\n * failed read answers `false` and is kept until one of the two events above: it hides a section rather than retrying in\n * a loop, and the API stays reachable.\n */\n\nimport { useContext, useEffect, useMemo, useRef, useSyncExternalStore } from 'react';\nimport {\n CoreResourceOperation,\n CoreResourceType,\n ErrorType,\n ResourceOperationVariantType,\n ResourcesConfig_OperationPathUtils,\n isReadShapedOperation,\n type ResourceType,\n} from '@wildo-ai/saas-models';\nimport { ResourceRegistryContext } from '~wildo-frontend-lib/core/resources/ResourceRegistryContext';\nimport type { FrontendResourceConfiguration_Operation } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { EventBusContext } from '~wildo-frontend-lib/core/events/EventBusContext';\nimport { FrontendEvents } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { viewerMayPerformOperation, type LauncherEffectiveRoles } from './launcher-resolution';\n\nconst logger: LoggerFrontendService = LoggerFrontendService.getLogger();\n\n/** The largest page a LIST serves by default; fewer round trips while paging for a matching row. */\nconst CONFIGURATION_PRESENCE_PROBE_PAGE_LIMIT = 100;\n\n/**\n * What one probe asks: which resource, through which of its default operations, and which row counts as \"configured\".\n *\n * `key` names the probe in the shared table. Two probes of one resource with different predicates must use different\n * keys, or they would read each other's answers.\n */\nexport interface ConfigurationPresenceProbe {\n readonly key: string;\n readonly resourceType: ResourceType;\n /** LIST pages the organization's rows; READ reads the organization's one row (a configuration singleton). */\n readonly operation: CoreResourceOperation.LIST | CoreResourceOperation.READ;\n readonly matches: (row: Readonly<Record<string, unknown>>) => boolean;\n}\n\n/** Where one (probe, account, organization) answer stands. */\nexport enum ConfigurationPresenceProbeState {\n /** Asked; the answer has not arrived. Reads as `false`. */\n PENDING = 'pending',\n /** The organization holds a row the probe matches. */\n HELD = 'held',\n /** No row the organization holds matches, or it holds none. */\n NONE = 'none',\n /** The read failed. Reads as `false`, and is kept rather than retried in a loop (see the module comment). */\n UNKNOWN = 'unknown',\n /** A write on the probe's resource succeeded or the reader left the organization: the next reader asks again. */\n STALE = 'stale',\n}\n\ninterface ConfigurationPresenceProbeEntry {\n readonly state: ConfigurationPresenceProbeState;\n /** While PENDING or STALE: the last settled answer, which readers keep until the new one arrives. */\n readonly previouslyHeld?: boolean;\n}\n\n/** Whether an entry reads as \"holds\": settled HELD, or re-asking after a settled HELD. */\nfunction entryReadsAsHeld(entry: ConfigurationPresenceProbeEntry | undefined): boolean {\n if (!entry) return false;\n if (entry.state === ConfigurationPresenceProbeState.HELD) return true;\n return (entry.state === ConfigurationPresenceProbeState.PENDING || entry.state === ConfigurationPresenceProbeState.STALE)\n && entry.previouslyHeld === true;\n}\n\nconst probeEntries = new Map<string, ConfigurationPresenceProbeEntry>();\nconst probeListeners = new Set<() => void>();\n\nfunction subscribeToProbes(listener: () => void): () => void {\n probeListeners.add(listener);\n return () => {\n probeListeners.delete(listener);\n };\n}\n\nfunction notifyProbeListeners(): void {\n for (const listener of probeListeners) listener();\n}\n\n/**\n * Mark one answer STALE so the next reader asks again, keeping what it last settled on for the readers in the meantime.\n * A no-op for an entry already being re-asked, so a burst of events sends one request.\n */\nfunction markConfigurationPresenceProbeStale(key: string): void {\n const entry = probeEntries.get(key);\n if (!entry || entry.state === ConfigurationPresenceProbeState.STALE) return;\n probeEntries.set(key, { state: ConfigurationPresenceProbeState.STALE, previouslyHeld: entryReadsAsHeld(entry) });\n notifyProbeListeners();\n}\n\n/** Forget every answer, so the next reader starts from nothing. Exported for tests, which must start from an empty table. */\nexport function forgetConfigurationPresenceProbes(): void {\n if (probeEntries.size === 0) return;\n probeEntries.clear();\n notifyProbeListeners();\n}\n\n/** The resource's default, non-bulk API operation of the probe's verb. */\nfunction findProbeOperation(\n operations: readonly FrontendResourceConfiguration_Operation[] | undefined,\n verb: CoreResourceOperation,\n): FrontendResourceConfiguration_Operation | undefined {\n return operations?.find((operation) =>\n operation.operationIdentifier === verb\n && operation.isOperationDefault === true\n && operation.isBulkOperation !== true\n && operation.variantType === ResourceOperationVariantType.API_CALL);\n}\n\n/** The rows and page count of one LIST answer, from either the paginated or the bare-array shape. */\nfunction readListPage(result: unknown): { rows: readonly Record<string, unknown>[]; totalPages: number } {\n if (Array.isArray(result)) return { rows: result as Record<string, unknown>[], totalPages: 1 };\n const paginated = result as { data?: unknown; pagination?: { totalPages?: unknown } } | null | undefined;\n const rows = Array.isArray(paginated?.data) ? paginated.data as Record<string, unknown>[] : [];\n const totalPages = typeof paginated?.pagination?.totalPages === 'number' ? paginated.pagination.totalPages : 1;\n return { rows, totalPages };\n}\n\n/**\n * Whether a failed read answered \"not found\": the normalized error the transport attaches (`error.wildoError`, typed\n * NOT_FOUND or carrying HTTP 404 in its context), or the raw response status.\n */\nfunction readsAsNotFound(error: unknown): boolean {\n const candidate = error as {\n wildoError?: { type?: unknown; context?: { httpStatus?: unknown } };\n response?: { status?: unknown };\n status?: unknown;\n } | null | undefined;\n return candidate?.wildoError?.type === ErrorType.NOT_FOUND\n || candidate?.wildoError?.context?.httpStatus === 404\n || candidate?.response?.status === 404\n || candidate?.status === 404;\n}\n\n/** One READ answer's row, whether bare or wrapped in `{ data }`. */\nfunction readSingleRow(result: unknown): Readonly<Record<string, unknown>> | undefined {\n if (!result || typeof result !== 'object' || Array.isArray(result)) return undefined;\n const wrapped = (result as { data?: unknown }).data;\n if (wrapped && typeof wrapped === 'object' && !Array.isArray(wrapped)) return wrapped as Record<string, unknown>;\n return result as Record<string, unknown>;\n}\n\n/**\n * See the module comment. `asked` says the answer can change what is shown; `viewer` is the launcher context's effective\n * roles, so the probe runs only for a viewer the probe's operation admits.\n */\nexport function useCurrentOrganizationConfigurationPresence(\n probe: ConfigurationPresenceProbe,\n asked: boolean,\n viewer: LauncherEffectiveRoles,\n): boolean {\n // The context itself, not a hook module: this runs inside every launcher reader, and a reader rendered outside the\n // registry provider (or under a test that substitutes the hook module) must read \"no registry\" rather than fail.\n const registryContext = useContext(ResourceRegistryContext);\n const appScope = useAppScopeSafe();\n const bus = useContext(EventBusContext);\n const currentUserId = appScope?.currentUserId ?? null;\n const currentOrganizationId = appScope?.currentOrganizationId ?? null;\n\n const registry = registryContext?.registry;\n const probeOperation = useMemo(\n () => findProbeOperation(\n registry?.resourceConfigurations[probe.resourceType]?.operations as readonly FrontendResourceConfiguration_Operation[] | undefined,\n probe.operation,\n ),\n [registry, probe.resourceType, probe.operation],\n );\n const organizationFieldIdentifier = registry?.resourceConfigurations[CoreResourceType.ORGANIZATIONS]?.resourceFieldIdentifier;\n const viewerMayAsk = !!probeOperation\n && viewerMayPerformOperation({ ...probeOperation, resourceType: probe.resourceType }, viewer);\n\n const key = asked && viewerMayAsk && currentUserId && currentOrganizationId && organizationFieldIdentifier\n ? `${probe.key}|${currentUserId}|${currentOrganizationId}`\n : null;\n\n // The scoped `doOperation` changes identity with every scope change; the probe reads the latest one through a ref so\n // a settling scope does not cancel and resend it (the same reason `useRouteOrganizationAccess` gives).\n const doOperationRef = useRef(registryContext?.doOperation);\n doOperationRef.current = registryContext?.doOperation;\n // The predicate is read through a ref too: a caller passing an inline probe must not resend the read on every render.\n const matchesRef = useRef(probe.matches);\n matchesRef.current = probe.matches;\n\n const entry = useSyncExternalStore(\n subscribeToProbes,\n () => (key ? probeEntries.get(key) : undefined),\n () => undefined,\n );\n\n useEffect(() => {\n const current = key ? probeEntries.get(key) : undefined;\n if (!key || (current && current.state !== ConfigurationPresenceProbeState.STALE) || !probeOperation || !organizationFieldIdentifier || !currentOrganizationId) return;\n const doOperation = doOperationRef.current;\n if (!doOperation) return;\n\n const pending: ConfigurationPresenceProbeEntry = { state: ConfigurationPresenceProbeState.PENDING, previouslyHeld: entryReadsAsHeld(current) };\n probeEntries.set(key, pending);\n notifyProbeListeners();\n\n const settle = (state: ConfigurationPresenceProbeState): void => {\n // A write that succeeded while this read was in flight has already marked `pending` stale; its answer would\n // describe the rows before that write, so it is dropped and the next reader asks again.\n if (probeEntries.get(key) !== pending) return;\n probeEntries.set(key, { state });\n notifyProbeListeners();\n };\n\n const operationPathKey = ResourcesConfig_OperationPathUtils.buildOperationPathKeyFromOperation(probeOperation);\n const contextualParameters = { [organizationFieldIdentifier]: currentOrganizationId };\n void (async () => {\n try {\n if (probe.operation === CoreResourceOperation.READ) {\n // Silent: an unanswered probe hides a section; it is not an error the viewer acted on.\n const row = readSingleRow(await doOperation(operationPathKey, { contextualParameters }, { silent: true }));\n settle(row && matchesRef.current(row) ? ConfigurationPresenceProbeState.HELD : ConfigurationPresenceProbeState.NONE);\n return;\n }\n for (let page = 1; ; page += 1) {\n const result = await doOperation(\n operationPathKey,\n { contextualParameters, queryParameters: { page, limit: CONFIGURATION_PRESENCE_PROBE_PAGE_LIMIT } },\n { silent: true },\n );\n const { rows, totalPages } = readListPage(result);\n if (rows.some((row) => matchesRef.current(row))) {\n settle(ConfigurationPresenceProbeState.HELD);\n return;\n }\n if (page >= totalPages || rows.length === 0) {\n settle(ConfigurationPresenceProbeState.NONE);\n return;\n }\n }\n } catch (error: unknown) {\n // A READ probe's row that does not exist is a configuration nobody authored, not a failed read.\n if (probe.operation === CoreResourceOperation.READ && readsAsNotFound(error)) {\n settle(ConfigurationPresenceProbeState.NONE);\n return;\n }\n logger.warn('Could not read whether the organization holds this configuration', {\n probe: probe.key,\n organizationId: currentOrganizationId,\n error,\n });\n settle(ConfigurationPresenceProbeState.UNKNOWN);\n }\n })();\n }, [key, entry, probeOperation, organizationFieldIdentifier, currentOrganizationId, probe.key, probe.operation]);\n\n // Leaving an organization makes its answer stale (#2649 review F6): coming back asks again, while it keeps showing what\n // was last settled. Keyed on the key CHANGING, not on unmounting: a list row unmounting must not re-ask for every\n // other reader still showing the same organization.\n const previousKeyRef = useRef<string | null>(key);\n useEffect(() => {\n const previousKey = previousKeyRef.current;\n previousKeyRef.current = key;\n if (previousKey && previousKey !== key) markConfigurationPresenceProbeStale(previousKey);\n }, [key]);\n\n useEffect(() => {\n if (!key) return undefined;\n return bus.on(\n FrontendEvents.RESOURCE_OPERATION_EXECUTED,\n () => markConfigurationPresenceProbeStale(key),\n (payload) => payload.resourceType === probe.resourceType\n && !isReadShapedOperation(payload.operation ?? { operationIdentifier: payload.operationIdentifier }),\n );\n }, [bus, key, probe.resourceType]);\n\n return entryReadsAsHeld(entry);\n}\n"]}
1
+ {"version":3,"file":"useCurrentOrganizationConfigurationPresence.js","sourceRoot":"","sources":["../../../../src/core/navigation/useCurrentOrganizationConfigurationPresence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,SAAS,EACT,4BAA4B,EAC5B,kCAAkC,EAClC,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;A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ACnD,CAAC,qBAAqB,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,EAAE,CAAC,CACvG,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC","sourcesContent":["/**\n * Whether the CURRENT organization holds a piece of configuration the shell has to FETCH rather than derive (#2649,\n * #3126, #3172): an unrevoked SCIM token, an SSO connection, a SIEM export or webhook delivery that is switched on.\n *\n * Read by `useLauncherRuntimeAvailabilityContext`. Two cases ask it:\n *\n * - **SCIM, a type no directory may use** (#2649): the section stays reachable, Revoke only, while a token is live.\n * - **A capability whose entitlement lapsed and no plan sells** (#3126): #2367 keeps the configuration, stops applying\n * it, and says so where it is configured. The rail used to keep an entitlement-gated section only while the feature\n * was OFFERED (entitled, or reachable through an upgrade), so a lapse no plan could cure removed the section, and with\n * it the notice and the kept configuration. The section now also survives while something is configured there.\n *\n * ## One answer per (probe, account, organization), shared by every reader\n *\n * The launcher context is read by every launcher surface (sidebar, command menu, toolbar, settings hub, resource action\n * bars), so a fetch inside each reader would send one request per surface. The answer is kept in a module-level table\n * instead, keyed by probe, account and organization, and every reader subscribes to the same entry: the first reader\n * that needs it asks, the rest wait for that answer. A different account or organization is a different key, so nothing\n * is ever read across a sign-in or an organization switch.\n *\n * ## When it asks, and when it asks again\n *\n * It asks only when the caller says the answer can change what is shown (`asked`) AND the viewer may perform the\n * probe's operation, by the registry's own roles. Every other caller gets `false` without a request.\n *\n * The answer goes STALE, and is asked again by the next reader, when:\n *\n * - a write on the probe's resource succeeds (`RESOURCE_OPERATION_EXECUTED`), so revoking the last token or deleting\n * the last connection removes the section;\n * - a reader moves to another organization, so coming back asks again rather than reusing what was true when it left\n * (which is also how a failed read gets another try).\n *\n * While a stale answer is re-asked, readers keep the LAST SETTLED answer (#2649 review F4). Reading `false` meanwhile\n * would drop the section for the length of the request: an administrator revoking one of three leftover tokens would\n * watch the hub jump to its default section and back. A change made in another session is seen on the next of those\n * two events, or on a reload: the shell's ordinary staleness for a configuration-like signal, and the server refuses\n * nothing on the strength of it.\n *\n * ## Reads\n *\n * A LIST probe pages its rows until one matches or none remain, because no LIST declares a filter for every predicate a\n * probe asks (the SCIM tokens LIST has no `isActive` filter, and a page of revoked tokens would otherwise hide a live\n * one). A READ probe reads the organization's one row, the shape of a context-addressed configuration singleton. A\n * failed read answers `false` and is kept until one of the two events above: it hides a section rather than retrying in\n * a loop, and the API stays reachable.\n */\n\nimport { useContext, useEffect, useMemo, useRef, useSyncExternalStore } from 'react';\nimport {\n CoreResourceOperation,\n CoreResourceType,\n ErrorType,\n ResourceOperationVariantType,\n ResourcesConfig_OperationPathUtils,\n isReadShapedOperation,\n type ResourceType,\n} from '@wildo-ai/saas-models';\nimport { ResourceRegistryContext } from '~wildo-frontend-lib/core/resources/ResourceRegistryContext';\nimport type { FrontendResourceConfiguration_Operation } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { EventBusContext } from '~wildo-frontend-lib/core/events/EventBusContext';\nimport { FrontendEvents } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { viewerMayPerformOperation } from './launcher-resolution';\nimport { type LauncherEffectiveRoles } from './viewer-roles';\n\nconst logger: LoggerFrontendService = LoggerFrontendService.getLogger();\n\n/** The largest page a LIST serves by default; fewer round trips while paging for a matching row. */\nconst CONFIGURATION_PRESENCE_PROBE_PAGE_LIMIT = 100;\n\n/**\n * What one probe asks: which resource, through which of its default operations, and which row counts as \"configured\".\n *\n * `key` names the probe in the shared table. Two probes of one resource with different predicates must use different\n * keys, or they would read each other's answers.\n */\nexport interface ConfigurationPresenceProbe {\n readonly key: string;\n readonly resourceType: ResourceType;\n /** LIST pages the organization's rows; READ reads the organization's one row (a configuration singleton). */\n readonly operation: CoreResourceOperation.LIST | CoreResourceOperation.READ;\n readonly matches: (row: Readonly<Record<string, unknown>>) => boolean;\n}\n\n/** Where one (probe, account, organization) answer stands. */\nexport enum ConfigurationPresenceProbeState {\n /** Asked; the answer has not arrived. Reads as `false`. */\n PENDING = 'pending',\n /** The organization holds a row the probe matches. */\n HELD = 'held',\n /** No row the organization holds matches, or it holds none. */\n NONE = 'none',\n /** The read failed. Reads as `false`, and is kept rather than retried in a loop (see the module comment). */\n UNKNOWN = 'unknown',\n /** A write on the probe's resource succeeded or the reader left the organization: the next reader asks again. */\n STALE = 'stale',\n}\n\ninterface ConfigurationPresenceProbeEntry {\n readonly state: ConfigurationPresenceProbeState;\n /** While PENDING or STALE: the last settled answer, which readers keep until the new one arrives. */\n readonly previouslyHeld?: boolean;\n}\n\n/** Whether an entry reads as \"holds\": settled HELD, or re-asking after a settled HELD. */\nfunction entryReadsAsHeld(entry: ConfigurationPresenceProbeEntry | undefined): boolean {\n if (!entry) return false;\n if (entry.state === ConfigurationPresenceProbeState.HELD) return true;\n return (entry.state === ConfigurationPresenceProbeState.PENDING || entry.state === ConfigurationPresenceProbeState.STALE)\n && entry.previouslyHeld === true;\n}\n\nconst probeEntries = new Map<string, ConfigurationPresenceProbeEntry>();\nconst probeListeners = new Set<() => void>();\n\nfunction subscribeToProbes(listener: () => void): () => void {\n probeListeners.add(listener);\n return () => {\n probeListeners.delete(listener);\n };\n}\n\nfunction notifyProbeListeners(): void {\n for (const listener of probeListeners) listener();\n}\n\n/**\n * Mark one answer STALE so the next reader asks again, keeping what it last settled on for the readers in the meantime.\n * A no-op for an entry already being re-asked, so a burst of events sends one request.\n */\nfunction markConfigurationPresenceProbeStale(key: string): void {\n const entry = probeEntries.get(key);\n if (!entry || entry.state === ConfigurationPresenceProbeState.STALE) return;\n probeEntries.set(key, { state: ConfigurationPresenceProbeState.STALE, previouslyHeld: entryReadsAsHeld(entry) });\n notifyProbeListeners();\n}\n\n/** Forget every answer, so the next reader starts from nothing. Exported for tests, which must start from an empty table. */\nexport function forgetConfigurationPresenceProbes(): void {\n if (probeEntries.size === 0) return;\n probeEntries.clear();\n notifyProbeListeners();\n}\n\n/** The resource's default, non-bulk API operation of the probe's verb. */\nfunction findProbeOperation(\n operations: readonly FrontendResourceConfiguration_Operation[] | undefined,\n verb: CoreResourceOperation,\n): FrontendResourceConfiguration_Operation | undefined {\n return operations?.find((operation) =>\n operation.operationIdentifier === verb\n && operation.isOperationDefault === true\n && operation.isBulkOperation !== true\n && operation.variantType === ResourceOperationVariantType.API_CALL);\n}\n\n/** The rows and page count of one LIST answer, from either the paginated or the bare-array shape. */\nfunction readListPage(result: unknown): { rows: readonly Record<string, unknown>[]; totalPages: number } {\n if (Array.isArray(result)) return { rows: result as Record<string, unknown>[], totalPages: 1 };\n const paginated = result as { data?: unknown; pagination?: { totalPages?: unknown } } | null | undefined;\n const rows = Array.isArray(paginated?.data) ? paginated.data as Record<string, unknown>[] : [];\n const totalPages = typeof paginated?.pagination?.totalPages === 'number' ? paginated.pagination.totalPages : 1;\n return { rows, totalPages };\n}\n\n/**\n * Whether a failed read answered \"not found\": the normalized error the transport attaches (`error.wildoError`, typed\n * NOT_FOUND or carrying HTTP 404 in its context), or the raw response status.\n */\nfunction readsAsNotFound(error: unknown): boolean {\n const candidate = error as {\n wildoError?: { type?: unknown; context?: { httpStatus?: unknown } };\n response?: { status?: unknown };\n status?: unknown;\n } | null | undefined;\n return candidate?.wildoError?.type === ErrorType.NOT_FOUND\n || candidate?.wildoError?.context?.httpStatus === 404\n || candidate?.response?.status === 404\n || candidate?.status === 404;\n}\n\n/** One READ answer's row, whether bare or wrapped in `{ data }`. */\nfunction readSingleRow(result: unknown): Readonly<Record<string, unknown>> | undefined {\n if (!result || typeof result !== 'object' || Array.isArray(result)) return undefined;\n const wrapped = (result as { data?: unknown }).data;\n if (wrapped && typeof wrapped === 'object' && !Array.isArray(wrapped)) return wrapped as Record<string, unknown>;\n return result as Record<string, unknown>;\n}\n\n/**\n * See the module comment. `asked` says the answer can change what is shown; `viewer` is the launcher context's effective\n * roles, so the probe runs only for a viewer the probe's operation admits.\n */\nexport function useCurrentOrganizationConfigurationPresence(\n probe: ConfigurationPresenceProbe,\n asked: boolean,\n viewer: LauncherEffectiveRoles,\n): boolean {\n // The context itself, not a hook module: this runs inside every launcher reader, and a reader rendered outside the\n // registry provider (or under a test that substitutes the hook module) must read \"no registry\" rather than fail.\n const registryContext = useContext(ResourceRegistryContext);\n const appScope = useAppScopeSafe();\n const bus = useContext(EventBusContext);\n const currentUserId = appScope?.currentUserId ?? null;\n const currentOrganizationId = appScope?.currentOrganizationId ?? null;\n\n const registry = registryContext?.registry;\n const probeOperation = useMemo(\n () => findProbeOperation(\n registry?.resourceConfigurations[probe.resourceType]?.operations as readonly FrontendResourceConfiguration_Operation[] | undefined,\n probe.operation,\n ),\n [registry, probe.resourceType, probe.operation],\n );\n const organizationFieldIdentifier = registry?.resourceConfigurations[CoreResourceType.ORGANIZATIONS]?.resourceFieldIdentifier;\n const viewerMayAsk = !!probeOperation\n && viewerMayPerformOperation({ ...probeOperation, resourceType: probe.resourceType }, viewer);\n\n const key = asked && viewerMayAsk && currentUserId && currentOrganizationId && organizationFieldIdentifier\n ? `${probe.key}|${currentUserId}|${currentOrganizationId}`\n : null;\n\n // The scoped `doOperation` changes identity with every scope change; the probe reads the latest one through a ref so\n // a settling scope does not cancel and resend it (the same reason `useRouteOrganizationAccess` gives).\n const doOperationRef = useRef(registryContext?.doOperation);\n doOperationRef.current = registryContext?.doOperation;\n // The predicate is read through a ref too: a caller passing an inline probe must not resend the read on every render.\n const matchesRef = useRef(probe.matches);\n matchesRef.current = probe.matches;\n\n const entry = useSyncExternalStore(\n subscribeToProbes,\n () => (key ? probeEntries.get(key) : undefined),\n () => undefined,\n );\n\n useEffect(() => {\n const current = key ? probeEntries.get(key) : undefined;\n if (!key || (current && current.state !== ConfigurationPresenceProbeState.STALE) || !probeOperation || !organizationFieldIdentifier || !currentOrganizationId) return;\n const doOperation = doOperationRef.current;\n if (!doOperation) return;\n\n const pending: ConfigurationPresenceProbeEntry = { state: ConfigurationPresenceProbeState.PENDING, previouslyHeld: entryReadsAsHeld(current) };\n probeEntries.set(key, pending);\n notifyProbeListeners();\n\n const settle = (state: ConfigurationPresenceProbeState): void => {\n // A write that succeeded while this read was in flight has already marked `pending` stale; its answer would\n // describe the rows before that write, so it is dropped and the next reader asks again.\n if (probeEntries.get(key) !== pending) return;\n probeEntries.set(key, { state });\n notifyProbeListeners();\n };\n\n const operationPathKey = ResourcesConfig_OperationPathUtils.buildOperationPathKeyFromOperation(probeOperation);\n const contextualParameters = { [organizationFieldIdentifier]: currentOrganizationId };\n void (async () => {\n try {\n if (probe.operation === CoreResourceOperation.READ) {\n // Silent: an unanswered probe hides a section; it is not an error the viewer acted on.\n const row = readSingleRow(await doOperation(operationPathKey, { contextualParameters }, { silent: true }));\n settle(row && matchesRef.current(row) ? ConfigurationPresenceProbeState.HELD : ConfigurationPresenceProbeState.NONE);\n return;\n }\n for (let page = 1; ; page += 1) {\n const result = await doOperation(\n operationPathKey,\n { contextualParameters, queryParameters: { page, limit: CONFIGURATION_PRESENCE_PROBE_PAGE_LIMIT } },\n { silent: true },\n );\n const { rows, totalPages } = readListPage(result);\n if (rows.some((row) => matchesRef.current(row))) {\n settle(ConfigurationPresenceProbeState.HELD);\n return;\n }\n if (page >= totalPages || rows.length === 0) {\n settle(ConfigurationPresenceProbeState.NONE);\n return;\n }\n }\n } catch (error: unknown) {\n // A READ probe's row that does not exist is a configuration nobody authored, not a failed read.\n if (probe.operation === CoreResourceOperation.READ && readsAsNotFound(error)) {\n settle(ConfigurationPresenceProbeState.NONE);\n return;\n }\n logger.warn('Could not read whether the organization holds this configuration', {\n probe: probe.key,\n organizationId: currentOrganizationId,\n error,\n });\n settle(ConfigurationPresenceProbeState.UNKNOWN);\n }\n })();\n }, [key, entry, probeOperation, organizationFieldIdentifier, currentOrganizationId, probe.key, probe.operation]);\n\n // Leaving an organization makes its answer stale (#2649 review F6): coming back asks again, while it keeps showing what\n // was last settled. Keyed on the key CHANGING, not on unmounting: a list row unmounting must not re-ask for every\n // other reader still showing the same organization.\n const previousKeyRef = useRef<string | null>(key);\n useEffect(() => {\n const previousKey = previousKeyRef.current;\n previousKeyRef.current = key;\n if (previousKey && previousKey !== key) markConfigurationPresenceProbeStale(previousKey);\n }, [key]);\n\n useEffect(() => {\n if (!key) return undefined;\n return bus.on(\n FrontendEvents.RESOURCE_OPERATION_EXECUTED,\n () => markConfigurationPresenceProbeStale(key),\n (payload) => payload.resourceType === probe.resourceType\n && !isReadShapedOperation(payload.operation ?? { operationIdentifier: payload.operationIdentifier }),\n );\n }, [bus, key, probe.resourceType]);\n\n return entryReadsAsHeld(entry);\n}\n"]}
@@ -42,7 +42,7 @@
42
42
  * hide a live one. A failed read answers `false` and is kept until one of the two events above: it hides a revoke-only
43
43
  * section rather than retrying in a loop, and the API stays reachable.
44
44
  */
45
- import type { LauncherEffectiveRoles } from './launcher-resolution';
45
+ import type { LauncherEffectiveRoles } from './viewer-roles';
46
46
  import { type ConfigurationPresenceProbe } from './useCurrentOrganizationConfigurationPresence';
47
47
  /** A token counts while `isActive` is true, whatever its `expiresAt` (see the module comment). */
48
48
  export declare const UNREVOKED_SCIM_TOKEN_PROBE: ConfigurationPresenceProbe;
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentOrganizationHoldsUnrevokedScimToken.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,+CAA+C,CAAC;AAEvD,kGAAkG;AAClG,eAAO,MAAM,0BAA0B,EAAE,0BAKxC,CAAC;AAEF,6HAA6H;AAC7H,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAED;;;GAGG;AACH,wBAAgB,6CAA6C,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAErH"}
1
+ {"version":3,"file":"useCurrentOrganizationHoldsUnrevokedScimToken.d.ts","sourceRoot":"","sources":["../../../../src/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,+CAA+C,CAAC;AAEvD,kGAAkG;AAClG,eAAO,MAAM,0BAA0B,EAAE,0BAKxC,CAAC;AAEF,6HAA6H;AAC7H,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAED;;;GAGG;AACH,wBAAgB,6CAA6C,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAErH"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentOrganizationHoldsUnrevokedScimToken.js","sourceRoot":"","sources":["../../../../src/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EACL,iCAAiC,EACjC,2CAA2C,GAE5C,MAAM,+CAA+C,CAAC;AAEvD,kGAAkG;AAClG,MAAM,CAAC,MAAM,0BAA0B,GAA+B;IACpE,GAAG,EAAE,sBAAsB;IAC3B,YAAY,EAAE,gBAAgB,CAAC,wBAAwB;IACvD,SAAS,EAAE,qBAAqB,CAAC,IAAI;IACrC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,IAAI;CAC5C,CAAC;AAEF,6HAA6H;AAC7H,MAAM,UAAU,8BAA8B;IAC5C,iCAAiC,EAAE,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,6CAA6C,CAAC,KAAc,EAAE,MAA8B;IAC1G,OAAO,2CAA2C,CAAC,0BAA0B,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAChG,CAAC","sourcesContent":["/**\n * Whether the CURRENT organization still holds an unrevoked SCIM token (#2649): a runtime capability the shell has to\n * FETCH rather than derive from configuration. One probe of the shared configuration-presence table\n * (`useCurrentOrganizationConfigurationPresence`), which owns the caching, staleness and paging described below.\n *\n * Read by `useLauncherRuntimeAvailabilityContext` to decide {@link DirectoryProvisioningCapability.SETTINGS_REACHABLE},\n * so the SCIM section stays reachable for as long as a token is live: Revoke only for an organization whose type admits\n * no directory (#2649), and with the kept-configuration notice where the entitlement lapsed (#3126).\n *\n * ## One answer per (account, organization), shared by every reader\n *\n * The launcher context is read by every launcher surface (sidebar, command menu, toolbar, settings hub, resource action\n * bars), so a fetch inside each reader would send one request per surface. The answer is kept in a module-level table\n * instead, keyed by account and organization, and every reader subscribes to the same entry: the first reader that\n * needs it asks, the rest wait for that answer. A different account or organization is a different key, so nothing is\n * ever read across a sign-in or an organization switch.\n *\n * ## When it asks, and when it asks again\n *\n * It asks only when the caller says the answer can change what is shown (`asked`: the organization's type is known and\n * the organization is not SCIM-enabled, `isUnrevokedScimTokenProbeNeeded`) AND the viewer may read the organization's\n * tokens, by the registry's own LIST roles. Every other caller gets `false` without a request.\n *\n * The answer goes STALE, and is asked again by the next reader, when:\n *\n * - a token operation succeeds (`RESOURCE_OPERATION_EXECUTED` on the tokens resource, a write), so revoking the last\n * token removes the section;\n * - a reader moves to another organization, so coming back asks again rather than reusing what was true when it left\n * (which is also how a failed read gets another try).\n *\n * While a stale answer is re-asked, readers keep the LAST SETTLED answer (#2649 review F4). Reading `false` meanwhile\n * would drop the SCIM section for the length of the request: an administrator revoking one of three leftover tokens\n * would watch the hub jump to its default section and back. A change made in another session is seen on the next of\n * those two events, or on a reload: the shell's ordinary staleness for a configuration-like signal, and the server\n * refuses nothing on the strength of it.\n *\n * ## \"Unrevoked\" is the rule `organizations.changeType` reads\n *\n * A token counts while `isActive` is true, whatever its `expiresAt`: that is what makes the organization\n * directory-managed and what refuses a move across the directory boundary (#2613 review 4). The rows are paged until one\n * is found or none remain, because the LIST declares no `isActive` filter and a page of revoked tokens would otherwise\n * hide a live one. A failed read answers `false` and is kept until one of the two events above: it hides a revoke-only\n * section rather than retrying in a loop, and the API stays reachable.\n */\n\nimport { CoreResourceOperation, CoreResourceType } from '@wildo-ai/saas-models';\nimport type { LauncherEffectiveRoles } from './launcher-resolution';\nimport {\n forgetConfigurationPresenceProbes,\n useCurrentOrganizationConfigurationPresence,\n type ConfigurationPresenceProbe,\n} from './useCurrentOrganizationConfigurationPresence';\n\n/** A token counts while `isActive` is true, whatever its `expiresAt` (see the module comment). */\nexport const UNREVOKED_SCIM_TOKEN_PROBE: ConfigurationPresenceProbe = {\n key: 'scim-unrevoked-token',\n resourceType: CoreResourceType.ORGANIZATION_SCIM_TOKENS,\n operation: CoreResourceOperation.LIST,\n matches: (token) => token.isActive === true,\n};\n\n/** Forget every answer, so the next reader starts from nothing. Exported for tests, which must start from an empty table. */\nexport function forgetUnrevokedScimTokenProbes(): void {\n forgetConfigurationPresenceProbes();\n}\n\n/**\n * See the module comment. `asked` is `isUnrevokedScimTokenProbeNeeded(...)`; `viewer` is the launcher context's\n * effective roles, so the probe runs only for a viewer the LIST admits.\n */\nexport function useCurrentOrganizationHoldsUnrevokedScimToken(asked: boolean, viewer: LauncherEffectiveRoles): boolean {\n return useCurrentOrganizationConfigurationPresence(UNREVOKED_SCIM_TOKEN_PROBE, asked, viewer);\n}\n"]}
1
+ {"version":3,"file":"useCurrentOrganizationHoldsUnrevokedScimToken.js","sourceRoot":"","sources":["../../../../src/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EACL,iCAAiC,EACjC,2CAA2C,GAE5C,MAAM,+CAA+C,CAAC;AAEvD,kGAAkG;AAClG,MAAM,CAAC,MAAM,0BAA0B,GAA+B;IACpE,GAAG,EAAE,sBAAsB;IAC3B,YAAY,EAAE,gBAAgB,CAAC,wBAAwB;IACvD,SAAS,EAAE,qBAAqB,CAAC,IAAI;IACrC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,IAAI;CAC5C,CAAC;AAEF,6HAA6H;AAC7H,MAAM,UAAU,8BAA8B;IAC5C,iCAAiC,EAAE,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,6CAA6C,CAAC,KAAc,EAAE,MAA8B;IAC1G,OAAO,2CAA2C,CAAC,0BAA0B,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAChG,CAAC","sourcesContent":["/**\n * Whether the CURRENT organization still holds an unrevoked SCIM token (#2649): a runtime capability the shell has to\n * FETCH rather than derive from configuration. One probe of the shared configuration-presence table\n * (`useCurrentOrganizationConfigurationPresence`), which owns the caching, staleness and paging described below.\n *\n * Read by `useLauncherRuntimeAvailabilityContext` to decide {@link DirectoryProvisioningCapability.SETTINGS_REACHABLE},\n * so the SCIM section stays reachable for as long as a token is live: Revoke only for an organization whose type admits\n * no directory (#2649), and with the kept-configuration notice where the entitlement lapsed (#3126).\n *\n * ## One answer per (account, organization), shared by every reader\n *\n * The launcher context is read by every launcher surface (sidebar, command menu, toolbar, settings hub, resource action\n * bars), so a fetch inside each reader would send one request per surface. The answer is kept in a module-level table\n * instead, keyed by account and organization, and every reader subscribes to the same entry: the first reader that\n * needs it asks, the rest wait for that answer. A different account or organization is a different key, so nothing is\n * ever read across a sign-in or an organization switch.\n *\n * ## When it asks, and when it asks again\n *\n * It asks only when the caller says the answer can change what is shown (`asked`: the organization's type is known and\n * the organization is not SCIM-enabled, `isUnrevokedScimTokenProbeNeeded`) AND the viewer may read the organization's\n * tokens, by the registry's own LIST roles. Every other caller gets `false` without a request.\n *\n * The answer goes STALE, and is asked again by the next reader, when:\n *\n * - a token operation succeeds (`RESOURCE_OPERATION_EXECUTED` on the tokens resource, a write), so revoking the last\n * token removes the section;\n * - a reader moves to another organization, so coming back asks again rather than reusing what was true when it left\n * (which is also how a failed read gets another try).\n *\n * While a stale answer is re-asked, readers keep the LAST SETTLED answer (#2649 review F4). Reading `false` meanwhile\n * would drop the SCIM section for the length of the request: an administrator revoking one of three leftover tokens\n * would watch the hub jump to its default section and back. A change made in another session is seen on the next of\n * those two events, or on a reload: the shell's ordinary staleness for a configuration-like signal, and the server\n * refuses nothing on the strength of it.\n *\n * ## \"Unrevoked\" is the rule `organizations.changeType` reads\n *\n * A token counts while `isActive` is true, whatever its `expiresAt`: that is what makes the organization\n * directory-managed and what refuses a move across the directory boundary (#2613 review 4). The rows are paged until one\n * is found or none remain, because the LIST declares no `isActive` filter and a page of revoked tokens would otherwise\n * hide a live one. A failed read answers `false` and is kept until one of the two events above: it hides a revoke-only\n * section rather than retrying in a loop, and the API stays reachable.\n */\n\nimport { CoreResourceOperation, CoreResourceType } from '@wildo-ai/saas-models';\nimport type { LauncherEffectiveRoles } from './viewer-roles';\nimport {\n forgetConfigurationPresenceProbes,\n useCurrentOrganizationConfigurationPresence,\n type ConfigurationPresenceProbe,\n} from './useCurrentOrganizationConfigurationPresence';\n\n/** A token counts while `isActive` is true, whatever its `expiresAt` (see the module comment). */\nexport const UNREVOKED_SCIM_TOKEN_PROBE: ConfigurationPresenceProbe = {\n key: 'scim-unrevoked-token',\n resourceType: CoreResourceType.ORGANIZATION_SCIM_TOKENS,\n operation: CoreResourceOperation.LIST,\n matches: (token) => token.isActive === true,\n};\n\n/** Forget every answer, so the next reader starts from nothing. Exported for tests, which must start from an empty table. */\nexport function forgetUnrevokedScimTokenProbes(): void {\n forgetConfigurationPresenceProbes();\n}\n\n/**\n * See the module comment. `asked` is `isUnrevokedScimTokenProbeNeeded(...)`; `viewer` is the launcher context's\n * effective roles, so the probe runs only for a viewer the LIST admits.\n */\nexport function useCurrentOrganizationHoldsUnrevokedScimToken(asked: boolean, viewer: LauncherEffectiveRoles): boolean {\n return useCurrentOrganizationConfigurationPresence(UNREVOKED_SCIM_TOKEN_PROBE, asked, viewer);\n}\n"]}