@conduction/nextcloud-vue 2.83.0 → 2.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue.js +1 -1
  2. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js +131 -3
  3. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js.map +1 -1
  4. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js +54 -18
  5. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js.map +1 -1
  6. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
  7. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +1 -1
  8. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
  9. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
  10. package/dist/esm/components/CnBoardView/CnBoardView.vue.js +1 -1
  11. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js +232 -4
  12. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js.map +1 -1
  13. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js +95 -51
  14. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js.map +1 -1
  15. package/dist/esm/components/CnBodySections/CnBodySections.vue.js +1 -1
  16. package/dist/esm/components/CnBodySections/CnBodySections.vue2.js +22 -1
  17. package/dist/esm/components/CnBodySections/CnBodySections.vue2.js.map +1 -1
  18. package/dist/esm/components/CnBodySections/CnBodySections.vue3.js.map +1 -1
  19. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
  20. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js +47 -4
  21. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
  22. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
  23. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
  24. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +239 -3
  25. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  26. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js +5 -5
  27. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  28. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  29. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +50 -0
  30. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  31. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +22 -12
  32. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  33. package/dist/esm/components/CnDeltaWidget/CnDeltaWidget.vue.js +1 -1
  34. package/dist/esm/components/CnDeltaWidget/CnDeltaWidget.vue2.js +1 -1
  35. package/dist/esm/components/CnDeltaWidget/CnDeltaWidget.vue2.js.map +1 -1
  36. package/dist/esm/components/CnDeltaWidget/CnDeltaWidget.vue3.js.map +1 -1
  37. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +226 -8
  38. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  39. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  40. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  41. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +3 -1
  42. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  43. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  44. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  45. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +18 -5
  46. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  47. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  48. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
  49. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +38 -1
  50. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
  51. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +45 -5
  52. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
  53. package/dist/esm/components/CnGaugeWidget/CnGaugeWidget.vue.js +1 -1
  54. package/dist/esm/components/CnGaugeWidget/CnGaugeWidget.vue2.js +1 -1
  55. package/dist/esm/components/CnGaugeWidget/CnGaugeWidget.vue2.js.map +1 -1
  56. package/dist/esm/components/CnGaugeWidget/CnGaugeWidget.vue3.js.map +1 -1
  57. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +548 -77
  58. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  59. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +191 -82
  60. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  61. package/dist/esm/components/CnIndexPage/useSelfFetchList.js +11 -2
  62. package/dist/esm/components/CnIndexPage/useSelfFetchList.js.map +1 -1
  63. package/dist/esm/components/CnInteractionFormWidget/CnInteractionFormWidget.vue2.js +29 -6
  64. package/dist/esm/components/CnInteractionFormWidget/CnInteractionFormWidget.vue2.js.map +1 -1
  65. package/dist/esm/components/CnInteractionFormWidget/CnInteractionFormWidget.vue3.js.map +1 -1
  66. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
  67. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +126 -2
  68. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
  69. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +24 -2
  70. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
  71. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  72. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +106 -3
  73. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  74. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  75. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue.js +1 -1
  76. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue2.js +67 -5
  77. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue2.js.map +1 -1
  78. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue3.js +181 -124
  79. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue3.js.map +1 -1
  80. package/dist/esm/components/CnReportsPage/CnReportsPage.vue.js +1 -1
  81. package/dist/esm/components/CnReportsPage/CnReportsPage.vue2.js +135 -2
  82. package/dist/esm/components/CnReportsPage/CnReportsPage.vue2.js.map +1 -1
  83. package/dist/esm/components/CnReportsPage/CnReportsPage.vue3.js +95 -43
  84. package/dist/esm/components/CnReportsPage/CnReportsPage.vue3.js.map +1 -1
  85. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue.js +1 -1
  86. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue2.js +5 -1
  87. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue2.js.map +1 -1
  88. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue3.js.map +1 -1
  89. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue.js +1 -1
  90. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js +72 -5
  91. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js.map +1 -1
  92. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js +33 -8
  93. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js.map +1 -1
  94. package/dist/esm/components/CnStatWidget/CnStatWidget.vue.js +1 -1
  95. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +135 -11
  96. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  97. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js +6 -2
  98. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  99. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue.js +1 -1
  100. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js +17 -2
  101. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js.map +1 -1
  102. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js +1 -1
  103. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js.map +1 -1
  104. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
  105. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +39 -6
  106. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
  107. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
  108. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue.js +1 -1
  109. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue2.js +140 -7
  110. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue2.js.map +1 -1
  111. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue3.js.map +1 -1
  112. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue.js +1 -1
  113. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue2.js +37 -9
  114. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue2.js.map +1 -1
  115. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue3.js +6 -5
  116. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue3.js.map +1 -1
  117. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue.js +1 -1
  118. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js +16 -0
  119. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js.map +1 -1
  120. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue3.js.map +1 -1
  121. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue.js +1 -1
  122. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js +2 -1
  123. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js.map +1 -1
  124. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue3.js.map +1 -1
  125. package/dist/esm/components/CnWidgetCardGrid/CnWidgetCardGrid.vue2.js +53 -1
  126. package/dist/esm/components/CnWidgetCardGrid/CnWidgetCardGrid.vue2.js.map +1 -1
  127. package/dist/esm/components/CnWidgetCardGrid/CnWidgetCardGrid.vue3.js +3 -2
  128. package/dist/esm/components/CnWidgetCardGrid/CnWidgetCardGrid.vue3.js.map +1 -1
  129. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue.js +1 -1
  130. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +135 -0
  131. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
  132. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
  133. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue.js +1 -1
  134. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js +19 -0
  135. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js.map +1 -1
  136. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue3.js +37 -19
  137. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue3.js.map +1 -1
  138. package/dist/esm/composables/useListView.js +21 -0
  139. package/dist/esm/composables/useListView.js.map +1 -1
  140. package/dist/esm/dialogs/CnTransitionInputDialog.vue.js +1 -1
  141. package/dist/esm/dialogs/CnTransitionInputDialog.vue2.js +68 -6
  142. package/dist/esm/dialogs/CnTransitionInputDialog.vue2.js.map +1 -1
  143. package/dist/esm/dialogs/CnTransitionInputDialog.vue3.js +133 -105
  144. package/dist/esm/dialogs/CnTransitionInputDialog.vue3.js.map +1 -1
  145. package/dist/esm/index.js +1 -0
  146. package/dist/esm/index.js.map +1 -1
  147. package/dist/esm/l10n/en.json.js +38 -1
  148. package/dist/esm/l10n/en.json.js.map +1 -1
  149. package/dist/esm/l10n/nl.json.js +78 -1
  150. package/dist/esm/l10n/nl.json.js.map +1 -1
  151. package/dist/esm/library-style.js +1 -1
  152. package/dist/esm/nextcloud-vue.css +1030 -533
  153. package/dist/esm/store/useObjectStore.js +16 -2
  154. package/dist/esm/store/useObjectStore.js.map +1 -1
  155. package/dist/esm/utils/boardColumns.js +8 -1
  156. package/dist/esm/utils/boardColumns.js.map +1 -1
  157. package/dist/esm/utils/boardReferenceColumns.js +278 -0
  158. package/dist/esm/utils/boardReferenceColumns.js.map +1 -0
  159. package/dist/esm/utils/buildManifest.js +41 -4
  160. package/dist/esm/utils/buildManifest.js.map +1 -1
  161. package/dist/esm/utils/detailWidgetVisibility.js +149 -0
  162. package/dist/esm/utils/detailWidgetVisibility.js.map +1 -0
  163. package/dist/esm/utils/formatMetric.js +39 -3
  164. package/dist/esm/utils/formatMetric.js.map +1 -1
  165. package/dist/esm/utils/gridStack.js +40 -1
  166. package/dist/esm/utils/gridStack.js.map +1 -1
  167. package/dist/esm/utils/humaniseKey.js +41 -0
  168. package/dist/esm/utils/humaniseKey.js.map +1 -0
  169. package/dist/esm/utils/notificationRuleLabel.js +6 -23
  170. package/dist/esm/utils/notificationRuleLabel.js.map +1 -1
  171. package/dist/esm/utils/resolveManifestTokens.js +1 -0
  172. package/dist/esm/utils/resolveManifestTokens.js.map +1 -1
  173. package/dist/esm/utils/sentinelTokens.js +9 -0
  174. package/dist/esm/utils/sentinelTokens.js.map +1 -1
  175. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  176. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  177. package/dist/esm/utils/widgetDispatch.js +8 -2
  178. package/dist/esm/utils/widgetDispatch.js.map +1 -1
  179. package/dist/nextcloud-vue.cjs.js +17159 -13422
  180. package/dist/nextcloud-vue.cjs.js.map +2 -2
  181. package/dist/nextcloud-vue.css +1030 -533
  182. package/l10n/en.json +38 -1
  183. package/l10n/nl.json +78 -1
  184. package/package.json +1 -1
  185. package/src/components/CnAdminSettingsShell/CnAdminSettingsShell.vue +160 -8
  186. package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +1 -1
  187. package/src/components/CnBoardView/CnBoardView.vue +262 -6
  188. package/src/components/CnBodySections/CnBodySections.vue +22 -1
  189. package/src/components/CnCountdownWidget/CnCountdownWidget.vue +47 -4
  190. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +244 -8
  191. package/src/components/CnDashboardPage/CnDashboardPage.vue +62 -2
  192. package/src/components/CnDeltaWidget/CnDeltaWidget.vue +1 -1
  193. package/src/components/CnDetailPage/CnDetailPage.md +3 -1
  194. package/src/components/CnDetailPage/CnDetailPage.vue +226 -8
  195. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +3 -1
  196. package/src/components/CnFactsWidget/CnFactsWidget.vue +18 -5
  197. package/src/components/CnFieldListWidget/CnFieldListWidget.vue +63 -1
  198. package/src/components/CnGaugeWidget/CnGaugeWidget.vue +1 -1
  199. package/src/components/CnIndexPage/CnIndexPage.vue +586 -25
  200. package/src/components/CnIndexPage/useSelfFetchList.js +10 -1
  201. package/src/components/CnInteractionFormWidget/CnInteractionFormWidget.vue +29 -6
  202. package/src/components/CnObjectDataWidget/CnObjectDataWidget.md +1 -1
  203. package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +154 -5
  204. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +106 -3
  205. package/src/components/CnRegisterMapping/CnRegisterMapping.md +5 -0
  206. package/src/components/CnRegisterMapping/CnRegisterMapping.vue +231 -96
  207. package/src/components/CnReportsPage/CnReportsPage.vue +179 -1
  208. package/src/components/CnSettingsPage/CnSettingsPage.vue +5 -1
  209. package/src/components/CnStagesWidget/CnStagesWidget.vue +103 -6
  210. package/src/components/CnStatWidget/CnStatWidget.vue +137 -12
  211. package/src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue +34 -3
  212. package/src/components/CnTabsWidget/CnTabsWidget.vue +39 -6
  213. package/src/components/CnToggleTableWidget/CnToggleTableWidget.vue +140 -7
  214. package/src/components/CnVersionInfoCard/CnVersionInfoCard.md +2 -1
  215. package/src/components/CnVersionInfoCard/CnVersionInfoCard.vue +42 -13
  216. package/src/components/CnWalkthrough/CnWalkthrough.vue +16 -0
  217. package/src/components/CnWeekStripWidget/CnWeekStripWidget.vue +2 -1
  218. package/src/components/CnWidgetCardGrid/CnWidgetCardGrid.vue +55 -2
  219. package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +135 -0
  220. package/src/components/CnWidgetWrapper/CnWidgetWrapper.md +10 -0
  221. package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +44 -1
  222. package/src/composables/useListView.js +21 -0
  223. package/src/css/board.css +65 -4
  224. package/src/css/dialog.css +4 -2
  225. package/src/css/form-field.css +14 -0
  226. package/src/css/form-widget.css +11 -0
  227. package/src/css/index-page.css +49 -0
  228. package/src/css/kpi-card.css +13 -0
  229. package/src/css/look-board-reports.css +58 -0
  230. package/src/css/look-board.css +108 -7
  231. package/src/dialogs/CnTransitionInputDialog.vue +87 -7
  232. package/src/index.js +2 -0
  233. package/src/schemas/app-manifest-v2.schema.json +137 -6
  234. package/src/store/useObjectStore.js +16 -2
  235. package/src/utils/boardColumns.js +8 -1
  236. package/src/utils/boardReferenceColumns.js +274 -0
  237. package/src/utils/buildManifest.js +40 -3
  238. package/src/utils/detailWidgetVisibility.js +145 -0
  239. package/src/utils/formatMetric.js +38 -2
  240. package/src/utils/gridStack.js +39 -0
  241. package/src/utils/humaniseKey.js +38 -0
  242. package/src/utils/notificationRuleLabel.js +5 -23
  243. package/src/utils/resolveManifestTokens.js +1 -0
  244. package/src/utils/sentinelTokens.js +9 -0
  245. package/src/utils/validateManifestV2.compiled.js +3 -3
  246. package/src/utils/widgetDispatch.js +8 -2
@@ -1 +1 @@
1
- {"version":3,"file":"CnSettingsPage.vue3.js","sources":["../../../../src/components/CnSettingsPage/CnSettingsPage.vue?vue&type=template&id=1c7a70aa&lang.js"],"sourcesContent":["<!--\n CnSettingsPage — Admin / config surface.\n\n Renders manifest-driven config sections. The page MAY declare\n EITHER a flat `sections[]` array (back-compat) OR a `tabs[]` array\n (each tab owns its own `sections[]`) — XOR, never both. See\n manifest-settings-orchestration spec.\n\n Each section is a CnSettingsCard wrapping a CnSettingsSection.\n A section MUST declare exactly one of three body kinds:\n\n 1. `fields[]` — flat form fields (back-compat, default)\n 2. `component` — registry-resolved component as the section body\n 3. `widgets[]` — ordered list of widgets (built-in + customComponents)\n\n Built-in widget types (resolved BEFORE the customComponents registry):\n - `version-info` → CnVersionInfoCard\n - `register-mapping` → CnRegisterMapping\n - `component` → discriminator; `widget.componentName`\n resolves against customComponents\n\n Saves via `axios.put(saveEndpoint, formData)` with the consumer's\n settings controller URL. Widget events bubble up through\n `@widget-event` so consumers wire one page-level handler that\n dispatches by `widgetType` + event `name` (the manifest can't carry\n inline JS).\n\n Supports the same `headerComponent` / `actionsComponent` / generic\n `slots` overrides that the other built-in page types do — the\n CnPageRenderer wires them via the `#header`, `#actions`, and named\n `slots[]` slots exposed here.\n-->\n<template>\n\t<div class=\"cn-settings-page\" data-testid=\"cn-settings-page\">\n\t\t<!-- Header — overridable via #header slot. CnPageHeader renders whenever\n\t\t there is a title: `visuallyHidden` keeps the <h1> in the\n\t\t accessibility tree (and out of the visual layout) when showTitle is\n\t\t false, so <main> is never left with no heading at all\n\t\t (WCAG 2.4.6 / 1.3.1). -->\n\t\t<slot\n\t\t\tname=\"header\"\n\t\t\t:title=\"title\"\n\t\t\t:description=\"description\"\n\t\t\t:icon=\"icon\">\n\t\t\t<CnPageHeader\n\t\t\t\tv-if=\"title\"\n\t\t\t\t:title=\"title\"\n\t\t\t\t:description=\"resolvedDescription\"\n\t\t\t\t:icon=\"icon\"\n\t\t\t\t:visuallyHidden=\"!showTitle\">\n\t\t\t\t<!-- Board look: the buildiq square, then the page Save as the\n\t\t\t\t last header button. -->\n\t\t\t\t<template v-if=\"headerButtonsInHeader\" #extra>\n\t\t\t\t\t<div class=\"cn-settings-page__header-buttons\" data-testid=\"cn-settings-page-header-buttons\">\n\t\t\t\t\t\t<CnBuildiqEditButton v-if=\"isBoard\" />\n\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\tv-if=\"pageSave\"\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\t\t\t\tdata-testid=\"cn-settings-page-save\"\n\t\t\t\t\t\t\t@click=\"save\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<NcLoadingIcon v-if=\"saving\" :size=\"20\" />\n\t\t\t\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ saveLabel }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t</CnPageHeader>\n\t\t</slot>\n\n\t\t<!-- The same buttons when the header itself is hidden or replaced. -->\n\t\t<div\n\t\t\tv-if=\"headerButtonsOutside\"\n\t\t\tclass=\"cn-settings-page__header-buttons\"\n\t\t\tdata-testid=\"cn-settings-page-header-buttons\">\n\t\t\t<CnBuildiqEditButton v-if=\"isBoard\" />\n\t\t\t<NcButton\n\t\t\t\tv-if=\"pageSave\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\tdata-testid=\"cn-settings-page-save\"\n\t\t\t\t@click=\"save\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcLoadingIcon v-if=\"saving\" :size=\"20\" />\n\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ saveLabel }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<!-- The Changes card of a page that saves in its header. -->\n\t\t<div\n\t\t\tv-if=\"pageSave && changedFields.length > 0\"\n\t\t\tclass=\"cn-settings-page__changes\"\n\t\t\tdata-testid=\"cn-settings-page-changes\">\n\t\t\t<h2 class=\"cn-settings-page__changes-title\">\n\t\t\t\t{{ changesLabel }}\n\t\t\t</h2>\n\t\t\t<ul>\n\t\t\t\t<li v-for=\"field in changedFields\" :key=\"field.key\">\n\t\t\t\t\t{{ field.label }}\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\n\t\t<!-- Actions slot for save / discard / reset overrides -->\n\t\t<div v-if=\"$slots.actions || $slots.actions\" class=\"cn-settings-page__actions\">\n\t\t\t<slot name=\"actions\" />\n\t\t</div>\n\n\t\t<!-- Tab strip — only rendered when `tabs[]` is set\n\t\t\t (manifest-settings-orchestration REQ-MSO-5). Built with\n\t\t\t native <button role=\"tab\"> + ARIA wiring; uses Nextcloud\n\t\t\t CSS variables only (no hex literals). -->\n\t\t<div\n\t\t\tv-if=\"hasTabs\"\n\t\t\tclass=\"cn-settings-page__tabs\"\n\t\t\trole=\"tablist\"\n\t\t\tdata-testid=\"cn-settings-page-tabs\">\n\t\t\t<button\n\t\t\t\tv-for=\"(tab, tabIndex) in tabs\"\n\t\t\t\t:key=\"`tab-${tab.id}`\"\n\t\t\t\trole=\"tab\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-settings-page__tab\"\n\t\t\t\t:class=\"{ 'cn-settings-page__tab--active': activeTabId === tab.id }\"\n\t\t\t\t:aria-selected=\"activeTabId === tab.id ? 'true' : 'false'\"\n\t\t\t\t:aria-controls=\"`cn-settings-tab-panel-${tab.id}`\"\n\t\t\t\t:data-testid=\"`cn-settings-page-tab-${tab.id}`\"\n\t\t\t\t@click=\"onTabClick(tab, tabIndex)\">\n\t\t\t\t{{ resolveLabel(tab.label) }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<!-- Sections — rendered for the active tab when `tabs[]` is\n\t\t\t set, otherwise the flat `sections[]` (back-compat). The wrapper\n\t\t\t draws no box of its own (`display: contents`); the board look\n\t\t\t turns it into the card grid. -->\n\t\t<div class=\"cn-settings-page__sections\">\n\t\t\t<CnSettingsCard\n\t\t\t\tv-for=\"(section, sectionIndex) in activeSections\"\n\t\t\t\t:key=\"`section-${activeTabId || 'flat'}-${sectionIndex}`\"\n\t\t\t\t:title=\"resolveLabel(section.title)\"\n\t\t\t\t:icon=\"section.icon || ''\"\n\t\t\t\t:collapsible=\"section.collapsible || false\">\n\t\t\t\t<!--\n\t\t\t\t\tBody resolution — see `sectionBodyKind(section)` in the\n\t\t\t\t\tscript: returns 'fields' (default + back-compat),\n\t\t\t\t\t'component', or 'widgets'.\n\t\t\t\t-->\n\n\t\t\t\t<!-- Body: bare fields[] (back-compat). Wrapped in a\n\t\t\t\t\t CnSettingsSection mirroring the pre-rich-sections layout. -->\n\t\t\t\t<CnSettingsSection\n\t\t\t\t\tv-if=\"sectionBodyKind(section) === 'fields'\"\n\t\t\t\t\t:name=\"resolveLabel(section.title)\"\n\t\t\t\t\t:description=\"resolveLabel(section.description)\"\n\t\t\t\t\t:docUrl=\"section.docUrl || ''\"\n\t\t\t\t\t:wide=\"Boolean(section.wide)\">\n\t\t\t\t\t<div class=\"cn-settings-page__fields\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"field in section.fields\"\n\t\t\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\t\t\tclass=\"cn-settings-page__field\">\n\t\t\t\t\t\t\t<!-- Per-field slot — `field-<key>` lets a consumer override the input entirely. -->\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:name=\"`field-${field.key}`\"\n\t\t\t\t\t\t\t\t:field=\"field\"\n\t\t\t\t\t\t\t\t:value=\"formData[field.key]\"\n\t\t\t\t\t\t\t\t:onInput=\"(v) => updateField(field.key, v)\">\n\t\t\t\t\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\t\t\t\t\tv-if=\"field.type === 'boolean'\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"!!formData[field.key]\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, $event)\">\n\t\t\t\t\t\t\t\t\t{{ resolveLabel(field.label) }}\n\t\t\t\t\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\t\t\tv-else-if=\"field.type === 'number'\"\n\t\t\t\t\t\t\t\t\t:label=\"resolveLabel(field.label)\"\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"String(fieldValue(field.key, ''))\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, $event === '' ? null : Number($event))\" />\n\t\t\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\t\t\tv-else-if=\"field.type === 'password'\"\n\t\t\t\t\t\t\t\t\t:label=\"resolveLabel(field.label)\"\n\t\t\t\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"fieldValue(field.key, '')\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, $event)\" />\n\t\t\t\t\t\t\t\t<NcSelect\n\t\t\t\t\t\t\t\t\tv-else-if=\"field.type === 'enum' && Array.isArray(field.options)\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"selectedOption(field)\"\n\t\t\t\t\t\t\t\t\t:options=\"field.options\"\n\t\t\t\t\t\t\t\t\t:inputLabel=\"resolveLabel(field.label)\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, optionValue($event))\" />\n\t\t\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\t\t\tv-else\n\t\t\t\t\t\t\t\t\t:label=\"resolveLabel(field.label)\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"fieldValue(field.key, '')\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, $event)\" />\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t<small\n\t\t\t\t\t\t\t\tv-if=\"field.help\"\n\t\t\t\t\t\t\t\tclass=\"cn-settings-page__field-help\">\n\t\t\t\t\t\t\t\t{{ resolveLabel(field.help) }}\n\t\t\t\t\t\t\t</small>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<template v-if=\"sectionSave\" #footer>\n\t\t\t\t\t\t<div class=\"cn-settings-section__save\" data-testid=\"cn-settings-section-save\">\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\t\t\t\t\t@click=\"save\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcLoadingIcon v-if=\"saving\" :size=\"20\" />\n\t\t\t\t\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ saveLabel }}\n\t\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</template>\n\t\t\t\t</CnSettingsSection>\n\n\t\t\t\t<!-- Body: a single registry-resolved component. The\n\t\t\t\t\t component is responsible for its own chrome — we do\n\t\t\t\t\t NOT wrap it in CnSettingsSection because the existing\n\t\t\t\t\t widget shape (CnVersionInfoCard, CnRegisterMapping)\n\t\t\t\t\t already wraps itself. Custom components are expected\n\t\t\t\t\t to do the same OR opt in by adding their own section\n\t\t\t\t\t wrapper.\n\n\t\t\t\t\t Wrapped in CnSettingsWidgetMount so the child's $emit\n\t\t\t\t\t is intercepted and re-emitted as @widget-event on this\n\t\t\t\t\t page (manifests can't carry inline JS). -->\n\t\t\t\t<CnSettingsWidgetMount\n\t\t\t\t\tv-else-if=\"sectionBodyKind(section) === 'component' && resolveSectionComponent(section)\"\n\t\t\t\t\t:component=\"resolveSectionComponent(section)\"\n\t\t\t\t\t:componentProps=\"section.props || {}\"\n\t\t\t\t\t:widgetType=\"section.component\"\n\t\t\t\t\t:sectionIndex=\"sectionIndex\"\n\t\t\t\t\t:widgetIndex=\"0\"\n\t\t\t\t\t@widgetEvent=\"onWidgetEvent\" />\n\n\t\t\t\t<!-- Body: ordered list of widgets. Each widget is its own\n\t\t\t\t\t mounted component with v-bind props + bubbled events\n\t\t\t\t\t via CnSettingsWidgetMount. Built-ins (version-info,\n\t\t\t\t\t register-mapping) wrap themselves in CnSettingsSection;\n\t\t\t\t\t custom widgets are expected to do the same. -->\n\t\t\t\t<template v-else-if=\"sectionBodyKind(section) === 'widgets'\">\n\t\t\t\t\t<CnSettingsWidgetMount\n\t\t\t\t\t\tv-for=\"entry in resolvedWidgetEntries(section, sectionIndex)\"\n\t\t\t\t\t\t:key=\"entry.key\"\n\t\t\t\t\t\t:component=\"entry.component\"\n\t\t\t\t\t\t:componentProps=\"entry.props\"\n\t\t\t\t\t\t:widgetType=\"entry.widgetType\"\n\t\t\t\t\t\t:sectionIndex=\"sectionIndex\"\n\t\t\t\t\t\t:widgetIndex=\"entry.widgetIndex\"\n\t\t\t\t\t\t@widgetEvent=\"onWidgetEvent\" />\n\t\t\t\t</template>\n\t\t\t</CnSettingsCard>\n\t\t</div>\n\n\t\t<!-- Save bar -->\n\t\t<div v-if=\"showSaveBar && !saveMode && !autosave\" class=\"cn-settings-page__save-bar\">\n\t\t\t<NcButton\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\t@click=\"save\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcLoadingIcon v-if=\"saving\" :size=\"20\" />\n\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ saveLabel }}\n\t\t\t</NcButton>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"dirty\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:disabled=\"saving\"\n\t\t\t\t@click=\"reset\">\n\t\t\t\t{{ resetLabel }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<!-- Error -->\n\t\t<div v-if=\"lastError\" class=\"cn-settings-page__error\">\n\t\t\t{{ lastError }}\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport {\n\tNcButton,\n\tNcCheckboxRadioSwitch,\n\tNcLoadingIcon,\n\tNcSelect,\n\tNcTextField,\n} from '@nextcloud/vue'\nimport ContentSave from 'vue-material-design-icons/ContentSave.vue'\nimport CnBuildiqEditButton from '../CnBuildiqEditButton/CnBuildiqEditButton.vue'\nimport CnRegisterMapping from '../CnRegisterMapping/CnRegisterMapping.vue'\nimport CnVersionInfoCard from '../CnVersionInfoCard/CnVersionInfoCard.vue'\nimport { useLook } from '../../composables/useLook.js'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { CnPageHeader } from '../CnPageHeader/index.js'\nimport { CnSettingsCard } from '../CnSettingsCard/index.js'\nimport { CnSettingsSection } from '../CnSettingsSection/index.js'\nimport CnSettingsWidgetMount from './CnSettingsWidgetMount.js'\n\n/**\n * Sentinel value used in the built-in widget registry to mark the\n * `'component'` discriminator (manifest-settings-orchestration\n * REQ-MSO-6). The discriminator does NOT resolve to a fixed\n * component — instead, the resolver detects this sentinel and looks\n * up `widget.componentName` in the customComponents registry.\n */\nconst COMPONENT_DISCRIMINATOR = Symbol('cn-settings-component-widget')\n\n/**\n * Built-in widget registry. Used by `CnSettingsPage` to resolve\n * `widgets[].type` to a component BEFORE consulting the\n * consumer-provided customComponents registry.\n *\n * The order matters — built-ins win on collision so consumers can't\n * accidentally shadow `version-info` with their own component. If a\n * consumer needs to truly replace one of these, they can render their\n * own component via `section.component` or\n * `{ type: \"component\", componentName: <name> }` instead of `widgets[]`.\n *\n * Spec:\n * - REQ-MSRS-2 (manifest-settings-rich-sections) — fixed-component\n * built-ins (`version-info`, `register-mapping`).\n * - REQ-MSO-6 (manifest-settings-orchestration) — `'component'`\n * discriminator (sentinel value, resolved via componentName).\n */\nconst BUILTIN_SETTINGS_WIDGETS = Object.freeze({\n\t'version-info': CnVersionInfoCard,\n\t'register-mapping': CnRegisterMapping,\n\tcomponent: COMPONENT_DISCRIMINATOR,\n})\n\n/**\n * CnSettingsPage — Manifest-driven settings page.\n *\n * Reads `sections[]` from `pages[].config` and renders one\n * `CnSettingsCard` per section. Each section declares EXACTLY ONE of\n * three body kinds:\n *\n * - `fields[]` — flat form fields (back-compat default).\n * Each field's `type` controls which input renders:\n * - `boolean` → NcCheckboxRadioSwitch\n * - `number` → NcTextField (type=number)\n * - `string` → NcTextField (default)\n * - `password` → NcTextField (type=password)\n * - `enum` → NcSelect (requires `options: string[]`)\n * Per-field `#field-<key>` slots are exposed so consumers can drop\n * in their own widget.\n *\n * - `component` — registry-resolved component as the section body.\n * `section.props` is v-bind'd to it. Useful when a whole section\n * is one bespoke widget the library doesn't know about.\n *\n * - `widgets[]` — ordered list of widgets. Each entry has a `type`\n * string and optional `props`. Built-in widget types resolve\n * first (`version-info` → `CnVersionInfoCard`, `register-mapping`\n * → `CnRegisterMapping`); unknown types fall back to the\n * `customComponents` registry.\n *\n * Widget events (e.g. CnRegisterMapping's `@save`, CnVersionInfoCard's\n * `@update`) bubble up as a single `@widget-event` event on the page,\n * with payload `{ widgetType, widgetIndex, sectionIndex, name, args }`.\n * Consumers wire one handler at the CnAppRoot level and dispatch by\n * `widgetType` / `name` — the manifest can't carry inline JS, so this\n * is the documented event-wiring escape hatch.\n *\n * Saves via `axios.put(saveEndpoint, formData)`. The `saveEndpoint`\n * default is `/index.php/apps/{appId}/api/settings` — consumers should\n * pass a fully-qualified URL via the manifest (or `saveEndpoint` prop)\n * because the library has no knowledge of the consumer's app id at\n * import time.\n *\n * Slots:\n * - `#header` — Replaces the CnPageHeader.\n * - `#actions` — Right-aligned actions area (the renderer fills this\n * via `pages[].actionsComponent`).\n * - `#field-<key>` — Replaces the input for a specific field within\n * a `fields[]` section. Scope: `{ field, value, onInput }`.\n *\n * Events:\n * - `@save` — Emitted on successful save. Payload: the form data.\n * - `@error` — Emitted when save fails. Payload: the error.\n * - `@input` — Emitted on every field change. Payload: `{ key, value }`.\n * - `@widget-event` — Emitted when a widget mounted via `widgets[]`\n * or `component` re-emits one of its own events. Payload:\n * `{ widgetType, widgetIndex, sectionIndex, name, args }`.\n */\nexport default {\n\tname: 'CnSettingsPage',\n\n\tcomponents: {\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcLoadingIcon,\n\t\tNcSelect,\n\t\tNcTextField,\n\t\tContentSave,\n\t\tCnBuildiqEditButton,\n\t\tCnSettingsCard,\n\t\tCnSettingsSection,\n\t\tCnPageHeader,\n\t\tCnSettingsWidgetMount,\n\t},\n\n\tinject: {\n\t\t/**\n\t\t * Custom-component registry injected from CnAppRoot. Used to\n\t\t * resolve `section.component` and to fall back when a\n\t\t * `widgets[].type` isn't in the built-in widget map. Defaults\n\t\t * to an empty object when the page is mounted standalone.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcnCustomComponents: { default: () => ({}) },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The look the page is drawn in: `board` or `nextcloud`. Empty follows\n\t\t * the `cnLook` that CnAppRoot (or the page's `config.look`) provides.\n\t\t *\n\t\t * @spec openspec/changes/screens-chrome-parity/specs/app-look/spec.md#requirement-an-app-can-take-the-board-look\n\t\t */\n\t\tlook: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Where the page saves (`config.saveMode`): `section` ends each section\n\t\t * that has fields in its own Save button, `page` draws one Save as the\n\t\t * last header button and a Changes card, and empty keeps the save bar\n\t\t * under the last section. Never both a section and a page save.\n\t\t *\n\t\t * @spec openspec/changes/screens-chrome-parity/specs/settings-board-look/spec.md#requirement-a-settings-page-saves-in-one-declared-place\n\t\t * @type {'section'|'page'|''}\n\t\t */\n\t\tsaveMode: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t\tvalidator: (value) => ['', 'section', 'page'].includes(value),\n\t\t},\n\n\t\t/**\n\t\t * The page saves on change (`config.autosave`): no save button at all,\n\t\t * and the description ends with \"Changes are saved automatically.\"\n\t\t *\n\t\t * @spec openspec/changes/screens-chrome-parity/specs/settings-board-look/spec.md#requirement-a-settings-page-saves-in-one-declared-place\n\t\t */\n\t\tautosave: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Page title. */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Settings'),\n\t\t},\n\n\t\t/** Description shown under the title when `showTitle` is set. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Whether to render the inline page header VISIBLY. When false the\n\t\t * `<h1>` is still rendered visually-hidden, so the `<main>` landmark\n\t\t * always has an accessible heading (WCAG 2.4.6 / 1.3.1).\n\t\t */\n\t\tshowTitle: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** MDI icon name for the header. */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Section definitions (flat shape — back-compat). Each section\n\t\t * MUST declare EXACTLY ONE of:\n\t\t * - `fields: Array<Field>` (back-compat flat-field body)\n\t\t * - `component: <registry-name>` + optional `props`\n\t\t * - `widgets: Array<{ type, props?, componentName? }>`\n\t\t *\n\t\t * Common keys: `{ title, description?, icon?, collapsible?, docUrl? }`.\n\t\t *\n\t\t * Mutually exclusive with `tabs[]` (XOR — see\n\t\t * manifest-settings-orchestration REQ-MSO-1).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tsections: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Tab definitions (orchestration shape — manifest-settings-\n\t\t * orchestration REQ-MSO-2). When set, CnSettingsPage renders\n\t\t * a tab strip above the section area; the active tab's\n\t\t * `sections[]` flow into the same renderer used by the flat\n\t\t * shape. Mutually exclusive with `sections[]`.\n\t\t *\n\t\t * Each tab MUST be `{ id: string, label: string,\n\t\t * icon?: string, sections: array<Section> }`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\ttabs: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Optional ID of the tab to activate on mount. When empty AND\n\t\t * `tabs[]` is non-empty, the first tab is active by default.\n\t\t * Unknown IDs fall back to the first tab.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tinitialTab: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Initial values keyed by `field.key`. Defaults to an empty\n\t\t * object; in practice the consumer passes the current\n\t\t * IAppConfig snapshot loaded from their settings controller.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tinitialValues: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Endpoint that receives the PUT on save. Pass a fully-qualified\n\t\t * URL — the library has no knowledge of the consumer's app id.\n\t\t * When empty, no PUT is issued and `@save` is emitted with the\n\t\t * form data so the consumer can persist it themselves.\n\t\t */\n\t\tsaveEndpoint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Whether to render the built-in save/reset bar. */\n\t\tshowSaveBar: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Label for the save button. */\n\t\tsaveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Save'),\n\t\t},\n\n\t\t/** Label for the reset (discard) button. */\n\t\tresetLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Discard changes'),\n\t\t},\n\n\t\t/**\n\t\t * Optional translation function. When provided, applied to\n\t\t * section titles, field labels, and other i18n-key strings\n\t\t * declared in the manifest. Defaults to the identity function.\n\t\t *\n\t\t * @type {((key: string) => string)|null}\n\t\t */\n\t\ttranslate: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Optional explicit custom-component registry. When set, takes\n\t\t * precedence over the injected `cnCustomComponents`. Use this\n\t\t * when mounting CnSettingsPage outside a CnAppRoot tree (or\n\t\t * when test-mounting with a stub registry).\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcustomComponents: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['save', 'error', 'input', 'widget-event', 'tab-change'],\n\n\tsetup(props) {\n\t\tconst { isBoard } = useLook(props)\n\t\treturn { isBoard }\n\t},\n\n\tdata() {\n\t\t// Resolve the initial active-tab id synchronously so the very\n\t\t// first render has the correct tab active (otherwise tests\n\t\t// that mount + assert without an `await tick` see the empty\n\t\t// default). Mirrors the logic in `resolveInitialTabId` (the\n\t\t// watcher path); keep them aligned.\n\t\tlet activeTabId = ''\n\t\tconst tabs = Array.isArray(this.tabs) ? this.tabs : []\n\t\tif (tabs.length > 0) {\n\t\t\tif (typeof this.initialTab === 'string' && this.initialTab.length > 0\n\t\t\t\t&& tabs.some((t) => t && t.id === this.initialTab)) {\n\t\t\t\tactiveTabId = this.initialTab\n\t\t\t} else if (tabs[0] && typeof tabs[0].id === 'string') {\n\t\t\t\tactiveTabId = tabs[0].id\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tformData: this.cloneInitial(),\n\t\t\toriginalData: this.cloneInitial(),\n\t\t\tsaving: false,\n\t\t\tlastError: null,\n\t\t\tactiveTabId,\n\t\t\tautosaveTimer: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} The page saves from its header (`saveMode: \"page\"`, not autosave). */\n\t\tpageSave() {\n\t\t\treturn this.saveMode === 'page' && !this.autosave\n\t\t},\n\n\t\t/** @return {boolean} Each section with fields saves on its own (`saveMode: \"section\"`). */\n\t\tsectionSave() {\n\t\t\treturn this.saveMode === 'section' && !this.autosave\n\t\t},\n\n\t\t/**\n\t\t * The description, with the autosave note appended when the page saves\n\t\t * on change.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tresolvedDescription() {\n\t\t\tif (!this.autosave) {\n\t\t\t\treturn this.description\n\t\t\t}\n\t\t\tconst note = t('nextcloud-vue', 'Changes are saved automatically.')\n\t\t\treturn this.description ? `${this.description} ${note}` : note\n\t\t},\n\n\t\t/** @return {boolean} The header buttons render inside the visible page header. */\n\t\theaderButtonsInHeader() {\n\t\t\treturn Boolean(this.title && this.showTitle && !this.$slots.header && (this.isBoard || this.pageSave))\n\t\t},\n\n\t\t/** @return {boolean} The header buttons need a row of their own (header hidden or replaced). */\n\t\theaderButtonsOutside() {\n\t\t\treturn Boolean((this.isBoard || this.pageSave) && !this.headerButtonsInHeader)\n\t\t},\n\n\t\t/** @return {string} Title of the Changes card. */\n\t\tchangesLabel() {\n\t\t\treturn t('nextcloud-vue', 'Changes')\n\t\t},\n\n\t\t/**\n\t\t * The fields that differ from their saved value, across every section,\n\t\t * labelled for the Changes card.\n\t\t *\n\t\t * @return {Array<{key: string, label: string}>}\n\t\t */\n\t\tchangedFields() {\n\t\t\tconst labels = {}\n\t\t\tconst sections = [...(this.sections || [])]\n\t\t\tfor (const tab of this.tabs || []) {\n\t\t\t\tif (tab && Array.isArray(tab.sections)) {\n\t\t\t\t\tsections.push(...tab.sections)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const section of sections) {\n\t\t\t\tfor (const field of (section && section.fields) || []) {\n\t\t\t\t\tlabels[field.key] = this.resolveLabel(field.label) || field.key\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst keys = new Set([...Object.keys(this.formData), ...Object.keys(this.originalData)])\n\t\t\treturn [...keys]\n\t\t\t\t.filter((key) => JSON.stringify(this.formData[key]) !== JSON.stringify(this.originalData[key]))\n\t\t\t\t.map((key) => ({ key, label: labels[key] || key }))\n\t\t},\n\n\t\t/** Whether any field has changed since load. */\n\t\tdirty() {\n\t\t\treturn JSON.stringify(this.formData) !== JSON.stringify(this.originalData)\n\t\t},\n\n\t\t/**\n\t\t * Effective custom-component registry. Explicit prop wins over\n\t\t * the injected value (mirrors CnPageRenderer's resolution\n\t\t * order).\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\teffectiveCustomComponents() {\n\t\t\treturn this.customComponents ?? this.cnCustomComponents ?? {}\n\t\t},\n\n\t\t/**\n\t\t * Whether the page is in tabs orchestration mode. True when\n\t\t * `tabs[]` is non-empty — drives the tab-strip render gate\n\t\t * (manifest-settings-orchestration REQ-MSO-5).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasTabs() {\n\t\t\treturn Array.isArray(this.tabs) && this.tabs.length > 0\n\t\t},\n\n\t\t/**\n\t\t * The sections to render right now. In flat mode, this is the\n\t\t * `sections` prop directly. In tabs mode, this is the\n\t\t * `sections[]` array of the currently active tab. Centralising\n\t\t * this in one computed keeps the template's `v-for` simple\n\t\t * and decouples it from the body kind dispatcher (which\n\t\t * applies per-section, not per-mode).\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tactiveSections() {\n\t\t\tif (!this.hasTabs) {\n\t\t\t\treturn this.sections || []\n\t\t\t}\n\t\t\tconst active = this.tabs.find((t) => t && t.id === this.activeTabId)\n\t\t\tif (active && Array.isArray(active.sections)) {\n\t\t\t\treturn active.sections\n\t\t\t}\n\t\t\t// Defensive fallback — should not happen because\n\t\t\t// `resolveInitialTabId` always lands on a known tab.\n\t\t\tconst first = this.tabs[0]\n\t\t\treturn first && Array.isArray(first.sections) ? first.sections : []\n\t\t},\n\t},\n\n\twatch: {\n\t\tinitialValues: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.formData = this.cloneInitial()\n\t\t\t\tthis.originalData = this.cloneInitial()\n\t\t\t},\n\t\t},\n\n\t\t// When `tabs[]` changes (e.g. consumer swaps manifests at\n\t\t// runtime), re-resolve the active tab so the page doesn't get\n\t\t// stuck on a removed id.\n\t\ttabs: {\n\t\t\thandler() {\n\t\t\t\tthis.activeTabId = this.resolveInitialTabId()\n\t\t\t},\n\t\t},\n\n\t\t// When `initialTab` changes (consumer-controlled tab\n\t\t// activation), follow it.\n\t\tinitialTab(next) {\n\t\t\tif (typeof next === 'string' && next.length > 0) {\n\t\t\t\tconst exists = this.tabs.some((t) => t && t.id === next)\n\t\t\t\tif (exists) {\n\t\t\t\t\tthis.activeTabId = next\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.autosaveTimer)\n\t},\n\n\tmethods: {\n\t\t// Coalesce a field value to a fallback when null / undefined.\n\t\t// Used in template bindings instead of `formData[key] ?? ''` because\n\t\t// vue-template-es2015-compiler (the Rollup VuePlugin's parser) does\n\t\t// not accept ES2020 nullish-coalescing inside template expressions.\n\t\tfieldValue(key, fallback) {\n\t\t\tconst v = this.formData[key]\n\t\t\treturn (v === null || v === undefined) ? fallback : v\n\t\t},\n\n\t\t// Resolve the currently-selected option for an enum field.\n\t\t// `field.options` may be an array of strings/numbers OR an array\n\t\t// of `{ label, value }`-shaped objects. NcSelect needs the actual\n\t\t// option entry (not the bare value) to render the selection\n\t\t// correctly, so this resolver looks up the matching object form\n\t\t// when a primitive value is stored. Returns `null` when nothing\n\t\t// is selected so NcSelect renders the empty state instead of\n\t\t// emitting a Vue warning about an undefined `value` prop.\n\t\tselectedOption(field) {\n\t\t\tconst v = this.formData[field.key]\n\t\t\tif (v === null || v === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (!Array.isArray(field.options)) {\n\t\t\t\treturn v\n\t\t\t}\n\t\t\tfor (const opt of field.options) {\n\t\t\t\tif (opt && typeof opt === 'object') {\n\t\t\t\t\tif (opt.value === v) {\n\t\t\t\t\t\treturn opt\n\t\t\t\t\t}\n\t\t\t\t} else if (opt === v) {\n\t\t\t\t\treturn opt\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn v\n\t\t},\n\n\t\t// Inverse of `selectedOption` — extract the storable value from\n\t\t// whatever NcSelect emits. NcSelect emits the full option entry\n\t\t// when options are objects, the primitive when options are\n\t\t// primitives, or `null` on clear.\n\t\toptionValue(emitted) {\n\t\t\tif (emitted === null || emitted === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (typeof emitted === 'object' && 'value' in emitted) {\n\t\t\t\treturn emitted.value\n\t\t\t}\n\t\t\treturn emitted\n\t\t},\n\n\t\tcloneInitial() {\n\t\t\tconst merged = { ...(this.initialValues || {}) }\n\t\t\t// Collect every section across both modes (flat\n\t\t\t// `sections[]` AND `tabs[].sections[]`) so default values\n\t\t\t// are applied regardless of orchestration shape.\n\t\t\t// Only flat-field sections contribute defaults; component\n\t\t\t// and widgets sections own their own state.\n\t\t\tconst allSections = []\n\t\t\tfor (const section of this.sections || []) {\n\t\t\t\tallSections.push(section)\n\t\t\t}\n\t\t\tfor (const tab of this.tabs || []) {\n\t\t\t\tif (tab && Array.isArray(tab.sections)) {\n\t\t\t\t\tfor (const section of tab.sections) {\n\t\t\t\t\t\tallSections.push(section)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const section of allSections) {\n\t\t\t\tif (!section || !Array.isArray(section.fields)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor (const field of section.fields) {\n\t\t\t\t\tif (field.default !== undefined && merged[field.key] === undefined) {\n\t\t\t\t\t\tmerged[field.key] = field.default\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn merged\n\t\t},\n\n\t\tresolveLabel(value) {\n\t\t\tif (!value) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (this.translate) {\n\t\t\t\treturn this.translate(value)\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\tupdateField(key, value) {\n\t\t\tthis.formData[key] = value\n\t\t\tthis.$emit('input', { key, value })\n\t\t\tif (this.autosave) {\n\t\t\t\tthis.queueAutosave()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Determine which body kind a section declares. Returns\n\t\t * `'fields'` (default + back-compat), `'component'`, or\n\t\t * `'widgets'`. The validator (`validateManifest`) enforces\n\t\t * exactly-one at parse time; this method is the runtime\n\t\t * equivalent and is permissive when one of the keys is set\n\t\t * (last-defined wins in the rare case of an unvalidated\n\t\t * manifest).\n\t\t *\n\t\t * @param {object} section A section entry from `sections[]`.\n\t\t * @return {'fields' | 'component' | 'widgets'}\n\t\t */\n\t\tsectionBodyKind(section) {\n\t\t\tif (Array.isArray(section.widgets) && section.widgets.length > 0) {\n\t\t\t\treturn 'widgets'\n\t\t\t}\n\t\t\tif (typeof section.component === 'string' && section.component.length > 0) {\n\t\t\t\treturn 'component'\n\t\t\t}\n\t\t\treturn 'fields'\n\t\t},\n\n\t\t/**\n\t\t * Resolve a `section.component` registry name to a Vue\n\t\t * component via `effectiveCustomComponents`. Returns `null`\n\t\t * (and warns) when the registry has no entry.\n\t\t *\n\t\t * @param {object} section A section entry.\n\t\t * @return {object|null} Vue component or null.\n\t\t */\n\t\tresolveSectionComponent(section) {\n\t\t\tconst name = section.component\n\t\t\tif (!name) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst resolved = this.effectiveCustomComponents[name]\n\t\t\tif (!resolved) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(`[CnSettingsPage] Section component \"${name}\" not found in customComponents registry. Section body will be empty.`)\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn resolved\n\t\t},\n\n\t\t/**\n\t\t * Resolve a single `widgets[]` entry to a concrete Vue\n\t\t * component. Lookup order:\n\t\t *\n\t\t * 1. Built-in widget map (`version-info`, `register-mapping`).\n\t\t * 2. `'component'` discriminator (REQ-MSO-6) — resolves\n\t\t * `widget.componentName` against `effectiveCustomComponents`.\n\t\t * 3. Legacy fallback — looks up `widget.type` against\n\t\t * `effectiveCustomComponents`. Kept for back-compat with\n\t\t * manifest-settings-rich-sections consumers; flagged as\n\t\t * deprecated in JSDoc — manifest authors should migrate to\n\t\t * the explicit `{ type: \"component\", componentName }` shape.\n\t\t *\n\t\t * Returns `null` (and warns) when nothing resolves. Built-ins\n\t\t * win on collision so consumers can't accidentally shadow them.\n\t\t *\n\t\t * @param {object} widget A `widgets[]` entry, e.g. `{ type, props?, componentName? }`.\n\t\t * @return {object|null} Vue component or null.\n\t\t */\n\t\tresolveWidgetComponent(widget) {\n\t\t\tconst type = widget && typeof widget.type === 'string' ? widget.type : ''\n\t\t\tif (!type) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (Object.hasOwn(BUILTIN_SETTINGS_WIDGETS, type)) {\n\t\t\t\tconst builtin = BUILTIN_SETTINGS_WIDGETS[type]\n\t\t\t\tif (builtin === COMPONENT_DISCRIMINATOR) {\n\t\t\t\t\t// REQ-MSO-6: discriminator — look up `componentName`.\n\t\t\t\t\tconst name = widget.componentName\n\t\t\t\t\tif (typeof name !== 'string' || name.length === 0) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.warn('[CnSettingsPage] Widget {type:\"component\"} requires a non-empty `componentName`. Widget will be skipped.')\n\t\t\t\t\t\treturn null\n\t\t\t\t\t}\n\t\t\t\t\tconst resolved = this.effectiveCustomComponents[name]\n\t\t\t\t\tif (!resolved) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.warn(`[CnSettingsPage] Widget component \"${name}\" not found in customComponents registry. Widget will be skipped.`)\n\t\t\t\t\t\treturn null\n\t\t\t\t\t}\n\t\t\t\t\treturn resolved\n\t\t\t\t}\n\t\t\t\treturn builtin\n\t\t\t}\n\t\t\t// Legacy fallback (manifest-settings-rich-sections REQ-MSRS-2).\n\t\t\t// Deprecated — manifest authors should migrate to\n\t\t\t// `{ type: \"component\", componentName: <X> }`. Kept here so\n\t\t\t// existing consumers continue working unchanged.\n\t\t\tconst resolved = this.effectiveCustomComponents[type]\n\t\t\tif (!resolved) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(`[CnSettingsPage] Widget type \"${type}\" not found in built-in widgets or customComponents registry. Widget will be skipped.`)\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn resolved\n\t\t},\n\n\t\t/**\n\t\t * Build the list of widget mount entries for a `widgets[]`\n\t\t * section. Filters out entries whose `widget.type` doesn't\n\t\t * resolve (built-in OR customComponents) — `resolveWidgetComponent`\n\t\t * has already logged a warn. The filter happens here so the\n\t\t * template can use a clean `v-for` without nested `v-if`.\n\t\t *\n\t\t * The `widgetType` carried on the bubbled `@widget-event`\n\t\t * payload is the widget's `componentName` (when the\n\t\t * discriminator is `'component'`) or `widget.type` otherwise —\n\t\t * giving consumers a stable identifier for the dispatch.\n\t\t *\n\t\t * @param {object} section A section entry with `widgets[]`.\n\t\t * @param {number} sectionIndex Index in `sections[]`.\n\t\t * @return {Array<{key: string, component: object, props: object, widgetType: string, widgetIndex: number}>}\n\t\t */\n\t\tresolvedWidgetEntries(section, sectionIndex) {\n\t\t\tconst entries = []\n\t\t\tconst widgets = Array.isArray(section.widgets) ? section.widgets : []\n\t\t\tfor (let widgetIndex = 0; widgetIndex < widgets.length; widgetIndex++) {\n\t\t\t\tconst widget = widgets[widgetIndex] || {}\n\t\t\t\tconst component = this.resolveWidgetComponent(widget)\n\t\t\t\tif (!component) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst widgetType = widget.type === 'component' && typeof widget.componentName === 'string'\n\t\t\t\t\t? widget.componentName\n\t\t\t\t\t: widget.type\n\t\t\t\tentries.push({\n\t\t\t\t\tkey: `widget-${sectionIndex}-${widgetIndex}`,\n\t\t\t\t\tcomponent,\n\t\t\t\t\tprops: widget.props || {},\n\t\t\t\t\twidgetType,\n\t\t\t\t\twidgetIndex,\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn entries\n\t\t},\n\n\t\t/**\n\t\t * Resolve the active-tab id on mount / when `tabs[]` changes.\n\t\t * Lookup order: explicit `initialTab` prop → first tab in\n\t\t * `tabs[]` → empty string. Unknown `initialTab` values fall\n\t\t * back to the first tab so the page never gets stuck.\n\t\t * (manifest-settings-orchestration REQ-MSO-5.)\n\t\t *\n\t\t * @return {string} The resolved tab id (empty in flat mode).\n\t\t */\n\t\tresolveInitialTabId() {\n\t\t\tif (!this.hasTabs) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (typeof this.initialTab === 'string' && this.initialTab.length > 0) {\n\t\t\t\tconst exists = this.tabs.some((t) => t && t.id === this.initialTab)\n\t\t\t\tif (exists) {\n\t\t\t\t\treturn this.initialTab\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst first = this.tabs[0]\n\t\t\treturn first && typeof first.id === 'string' ? first.id : ''\n\t\t},\n\n\t\t/**\n\t\t * Handle a tab button click. Switches the active tab and\n\t\t * emits `@tab-change` so consumers can react (e.g. persist the\n\t\t * active tab in their preference store, update the URL hash).\n\t\t * (manifest-settings-orchestration REQ-MSO-5.)\n\t\t *\n\t\t * @param {object} tab The clicked tab definition.\n\t\t * @param {number} tabIndex The tab's index in `tabs[]`.\n\t\t */\n\t\tonTabClick(tab, tabIndex) {\n\t\t\tif (!tab || typeof tab.id !== 'string') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.activeTabId === tab.id) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.activeTabId = tab.id\n\t\t\tthis.$emit('tab-change', { tabId: tab.id, tabIndex })\n\t\t},\n\n\t\t/**\n\t\t * Re-emit a widget's `widget-event` (caught by the local\n\t\t * CnSettingsWidgetMount helper) as a top-level `widget-event`\n\t\t * on this page. Consumers wire one `@widget-event` handler at\n\t\t * the CnAppRoot mount point and dispatch by `widgetType` /\n\t\t * `name`.\n\t\t *\n\t\t * @param {object} payload `{ widgetType, widgetIndex, sectionIndex, name, args }`\n\t\t */\n\t\tonWidgetEvent(payload) {\n\t\t\tthis.$emit('widget-event', payload)\n\t\t},\n\n\t\t/**\n\t\t * Save shortly after the last change (`autosave`): a burst of typing\n\t\t * is one request.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tqueueAutosave() {\n\t\t\tclearTimeout(this.autosaveTimer)\n\t\t\tthis.autosaveTimer = setTimeout(() => {\n\t\t\t\tthis.autosaveTimer = null\n\t\t\t\tif (this.dirty && !this.saving) {\n\t\t\t\t\tthis.save()\n\t\t\t\t}\n\t\t\t}, 600)\n\t\t},\n\n\t\treset() {\n\t\t\tthis.formData = this.cloneInitial()\n\t\t\tthis.lastError = null\n\t\t},\n\n\t\tasync save() {\n\t\t\tthis.saving = true\n\t\t\tthis.lastError = null\n\t\t\ttry {\n\t\t\t\tif (this.saveEndpoint) {\n\t\t\t\t\tawait axios.put(prefixUrl(this.saveEndpoint), this.formData)\n\t\t\t\t}\n\t\t\t\tthis.originalData = JSON.parse(JSON.stringify(this.formData))\n\t\t\t\tthis.$emit('save', this.formData)\n\t\t\t} catch (err) {\n\t\t\t\tthis.lastError = err?.response?.data?.message || err?.message || t('nextcloud-vue', 'Save failed')\n\t\t\t\tthis.$emit('error', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* The section wrapper draws no box; the board look makes it the card grid. */\n.cn-settings-page__sections {\n\tdisplay: contents;\n}\n\n.cn-settings-page__header-buttons {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tmargin-inline-start: auto;\n}\n\n.cn-settings-page {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n}\n\n.cn-settings-page__actions {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: 8px;\n}\n\n/*\n * Tab strip for the orchestration shape (manifest-settings-\n * orchestration REQ-MSO-5). Uses Nextcloud CSS variables only — no\n * hex literals, no rgba overrides on the elements themselves.\n */\n.cn-settings-page__tabs {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px;\n\tborder-bottom: 1px solid var(--color-border);\n\tpadding-bottom: 0;\n\tmargin-bottom: 8px;\n}\n\n.cn-settings-page__tab {\n\tbackground: transparent;\n\tborder: 0;\n\tborder-bottom: 3px solid transparent;\n\tpadding: 8px 16px;\n\tmargin: 0;\n\tcursor: pointer;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: normal;\n\tborder-radius: var(--border-radius-large) var(--border-radius-large) 0 0;\n\ttransition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border-color 0.1s ease-in-out;\n}\n\n.cn-settings-page__tab:hover,\n.cn-settings-page__tab:focus-visible {\n\tbackground-color: var(--color-background-hover);\n\tcolor: var(--color-main-text);\n\toutline: none;\n}\n\n.cn-settings-page__tab--active {\n\tcolor: var(--color-primary-element);\n\tborder-bottom-color: var(--color-primary-element);\n\tfont-weight: bold;\n}\n\n@media (max-width: 768px) {\n\t.cn-settings-page__tabs {\n\t\tflex-direction: column;\n\t\tgap: 0;\n\t\tborder-bottom: 0;\n\t}\n\n\t.cn-settings-page__tab {\n\t\tborder-bottom: 1px solid var(--color-border);\n\t\tborder-radius: 0;\n\t\ttext-align: left;\n\t}\n\n\t.cn-settings-page__tab--active {\n\t\tborder-bottom-width: 1px;\n\t\tbackground-color: var(--color-background-hover);\n\t}\n}\n\n.cn-settings-page__fields {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-settings-page__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-settings-page__field-help {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-settings-page__save-bar {\n\tdisplay: flex;\n\tgap: 8px;\n\tmargin-top: 16px;\n}\n\n.cn-settings-page__error {\n\tcolor: var(--color-error);\n\tbackground: var(--color-error-light, var(--color-background-hover));\n\tpadding: 8px 12px;\n\tborder-radius: var(--border-radius);\n}\n</style>\n"],"names":["_createBlock","_createElementVNode","_createTextVNode","_openBlock","_createElementBlock","_toDisplayString","_renderSlot","_Fragment","_renderList","_createVNode"],"mappings":";;;OAiEW,EAAC,kBAAS;AAAA,EAAA,aAAA,EAAA,kBAAA;;;AAoBX,EAAA,KAAK,EAAC,kCAA8B;AAAA,EAAA,aAAA,EAAA,iCAAA;;;;AAsB3C,EAAA,KAAK,EAAC,kCAAkC;AACxC,EAAA,aAAW,EAAC,iCAAiC;;;;AAmB5C,EAAA,KAAI,EAAC,2BAA2B;eACtB,EAAC,0BAA0B;;AAClC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,iCAAiC,GAAA;;;AAWL,EAAA,KAAA,EAAA,2BAAA;;;;OAUjC,EAAC,wBAAqB;AAC1B,EAAA,IAAE,EAAA,SAAA;;;;AAqBE,MAAA,UAAA,GAAA,EAAA,KAAI,EAAC,4BAAgB,GAAA;AAqBnB,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,0BAAgB,GAAA;;;AA2CxB,EAAA,KAAK,EAAC,8BAAW;;;AAMd,EAAA,KAAK,EAAC,2BAAG;AAAA,EAAA,aAAA,EAAA,0BAAA;;;;;;;;;;;;;;;;;;;;;;;;;cA5IX,CAAA,IAAA,CAAA,MAAA,EAAA,QAAA,EAAA;AA7BL,MAAA,KAAC,EAAA,MAAA,CAAA,KAAA;AACD,MAAA,WAAW,EAAE,MAAW,CAAA,WAAA;AACxB,MAAA,IAAI,EAAE,MAAI,CAAA,IAAA;aA2BL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,KAAA,CAAA,KAAA;wBACV,UAAA,EAAA,KAAA,CAAA,UAAA;AACD,wBAAA,YAAA,EAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnSettingsPage.vue3.js","sources":["../../../../src/components/CnSettingsPage/CnSettingsPage.vue?vue&type=template&id=04e49f77&lang.js"],"sourcesContent":["<!--\n CnSettingsPage — Admin / config surface.\n\n Renders manifest-driven config sections. The page MAY declare\n EITHER a flat `sections[]` array (back-compat) OR a `tabs[]` array\n (each tab owns its own `sections[]`) — XOR, never both. See\n manifest-settings-orchestration spec.\n\n Each section is a CnSettingsCard wrapping a CnSettingsSection.\n A section MUST declare exactly one of three body kinds:\n\n 1. `fields[]` — flat form fields (back-compat, default)\n 2. `component` — registry-resolved component as the section body\n 3. `widgets[]` — ordered list of widgets (built-in + customComponents)\n\n Built-in widget types (resolved BEFORE the customComponents registry):\n - `version-info` → CnVersionInfoCard\n - `register-mapping` → CnRegisterMapping\n - `component` → discriminator; `widget.componentName`\n resolves against customComponents\n\n Saves via `axios.put(saveEndpoint, formData)` with the consumer's\n settings controller URL. Widget events bubble up through\n `@widget-event` so consumers wire one page-level handler that\n dispatches by `widgetType` + event `name` (the manifest can't carry\n inline JS).\n\n Supports the same `headerComponent` / `actionsComponent` / generic\n `slots` overrides that the other built-in page types do — the\n CnPageRenderer wires them via the `#header`, `#actions`, and named\n `slots[]` slots exposed here.\n-->\n<template>\n\t<div class=\"cn-settings-page\" data-testid=\"cn-settings-page\">\n\t\t<!-- Header — overridable via #header slot. CnPageHeader renders whenever\n\t\t there is a title: `visuallyHidden` keeps the <h1> in the\n\t\t accessibility tree (and out of the visual layout) when showTitle is\n\t\t false, so <main> is never left with no heading at all\n\t\t (WCAG 2.4.6 / 1.3.1). -->\n\t\t<slot\n\t\t\tname=\"header\"\n\t\t\t:title=\"title\"\n\t\t\t:description=\"description\"\n\t\t\t:icon=\"icon\">\n\t\t\t<CnPageHeader\n\t\t\t\tv-if=\"title\"\n\t\t\t\t:title=\"title\"\n\t\t\t\t:description=\"resolvedDescription\"\n\t\t\t\t:icon=\"icon\"\n\t\t\t\t:visuallyHidden=\"!showTitle\">\n\t\t\t\t<!-- Board look: the buildiq square, then the page Save as the\n\t\t\t\t last header button. -->\n\t\t\t\t<template v-if=\"headerButtonsInHeader\" #extra>\n\t\t\t\t\t<div class=\"cn-settings-page__header-buttons\" data-testid=\"cn-settings-page-header-buttons\">\n\t\t\t\t\t\t<CnBuildiqEditButton v-if=\"isBoard\" />\n\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\tv-if=\"pageSave\"\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\t\t\t\tdata-testid=\"cn-settings-page-save\"\n\t\t\t\t\t\t\t@click=\"save\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<NcLoadingIcon v-if=\"saving\" :size=\"20\" />\n\t\t\t\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ saveLabel }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t</CnPageHeader>\n\t\t</slot>\n\n\t\t<!-- The same buttons when the header itself is hidden or replaced. -->\n\t\t<div\n\t\t\tv-if=\"headerButtonsOutside\"\n\t\t\tclass=\"cn-settings-page__header-buttons\"\n\t\t\tdata-testid=\"cn-settings-page-header-buttons\">\n\t\t\t<CnBuildiqEditButton v-if=\"isBoard\" />\n\t\t\t<NcButton\n\t\t\t\tv-if=\"pageSave\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\tdata-testid=\"cn-settings-page-save\"\n\t\t\t\t@click=\"save\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcLoadingIcon v-if=\"saving\" :size=\"20\" />\n\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ saveLabel }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<!-- The Changes card of a page that saves in its header. -->\n\t\t<div\n\t\t\tv-if=\"pageSave && changedFields.length > 0\"\n\t\t\tclass=\"cn-settings-page__changes\"\n\t\t\tdata-testid=\"cn-settings-page-changes\">\n\t\t\t<h2 class=\"cn-settings-page__changes-title\">\n\t\t\t\t{{ changesLabel }}\n\t\t\t</h2>\n\t\t\t<ul>\n\t\t\t\t<li v-for=\"field in changedFields\" :key=\"field.key\">\n\t\t\t\t\t{{ field.label }}\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\n\t\t<!-- Actions slot for save / discard / reset overrides -->\n\t\t<div v-if=\"$slots.actions || $slots.actions\" class=\"cn-settings-page__actions\">\n\t\t\t<slot name=\"actions\" />\n\t\t</div>\n\n\t\t<!-- Tab strip — only rendered when `tabs[]` is set\n\t\t\t (manifest-settings-orchestration REQ-MSO-5). Built with\n\t\t\t native <button role=\"tab\"> + ARIA wiring; uses Nextcloud\n\t\t\t CSS variables only (no hex literals). -->\n\t\t<div\n\t\t\tv-if=\"hasTabs\"\n\t\t\tclass=\"cn-settings-page__tabs\"\n\t\t\trole=\"tablist\"\n\t\t\tdata-testid=\"cn-settings-page-tabs\">\n\t\t\t<button\n\t\t\t\tv-for=\"(tab, tabIndex) in tabs\"\n\t\t\t\t:key=\"`tab-${tab.id}`\"\n\t\t\t\trole=\"tab\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-settings-page__tab\"\n\t\t\t\t:class=\"{ 'cn-settings-page__tab--active': activeTabId === tab.id }\"\n\t\t\t\t:aria-selected=\"activeTabId === tab.id ? 'true' : 'false'\"\n\t\t\t\t:aria-controls=\"`cn-settings-tab-panel-${tab.id}`\"\n\t\t\t\t:data-testid=\"`cn-settings-page-tab-${tab.id}`\"\n\t\t\t\t@click=\"onTabClick(tab, tabIndex)\">\n\t\t\t\t{{ resolveLabel(tab.label) }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<!-- Sections — rendered for the active tab when `tabs[]` is\n\t\t\t set, otherwise the flat `sections[]` (back-compat). The wrapper\n\t\t\t draws no box of its own (`display: contents`); the board look\n\t\t\t turns it into the card grid. -->\n\t\t<div class=\"cn-settings-page__sections\">\n\t\t\t<CnSettingsCard\n\t\t\t\tv-for=\"(section, sectionIndex) in activeSections\"\n\t\t\t\t:key=\"`section-${activeTabId || 'flat'}-${sectionIndex}`\"\n\t\t\t\t:title=\"resolveLabel(section.title)\"\n\t\t\t\t:icon=\"section.icon || ''\"\n\t\t\t\t:collapsible=\"section.collapsible || false\">\n\t\t\t\t<!--\n\t\t\t\t\tBody resolution — see `sectionBodyKind(section)` in the\n\t\t\t\t\tscript: returns 'fields' (default + back-compat),\n\t\t\t\t\t'component', or 'widgets'.\n\t\t\t\t-->\n\n\t\t\t\t<!-- Body: bare fields[] (back-compat). Wrapped in a\n\t\t\t\t\t CnSettingsSection mirroring the pre-rich-sections layout. -->\n\t\t\t\t<CnSettingsSection\n\t\t\t\t\tv-if=\"sectionBodyKind(section) === 'fields'\"\n\t\t\t\t\t:name=\"resolveLabel(section.title)\"\n\t\t\t\t\t:description=\"resolveLabel(section.description)\"\n\t\t\t\t\t:docUrl=\"section.docUrl || ''\"\n\t\t\t\t\t:wide=\"Boolean(section.wide)\">\n\t\t\t\t\t<div class=\"cn-settings-page__fields\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"field in section.fields\"\n\t\t\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\t\t\tclass=\"cn-settings-page__field\">\n\t\t\t\t\t\t\t<!-- Per-field slot — `field-<key>` lets a consumer override the input entirely. -->\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:name=\"`field-${field.key}`\"\n\t\t\t\t\t\t\t\t:field=\"field\"\n\t\t\t\t\t\t\t\t:value=\"formData[field.key]\"\n\t\t\t\t\t\t\t\t:onInput=\"(v) => updateField(field.key, v)\">\n\t\t\t\t\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\t\t\t\t\tv-if=\"field.type === 'boolean'\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"!!formData[field.key]\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, $event)\">\n\t\t\t\t\t\t\t\t\t{{ resolveLabel(field.label) }}\n\t\t\t\t\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\t\t\tv-else-if=\"field.type === 'number'\"\n\t\t\t\t\t\t\t\t\t:label=\"resolveLabel(field.label)\"\n\t\t\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"String(fieldValue(field.key, ''))\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, $event === '' ? null : Number($event))\" />\n\t\t\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\t\t\tv-else-if=\"field.type === 'password'\"\n\t\t\t\t\t\t\t\t\t:label=\"resolveLabel(field.label)\"\n\t\t\t\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"fieldValue(field.key, '')\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, $event)\" />\n\t\t\t\t\t\t\t\t<NcSelect\n\t\t\t\t\t\t\t\t\tv-else-if=\"field.type === 'enum' && Array.isArray(field.options)\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"selectedOption(field)\"\n\t\t\t\t\t\t\t\t\t:options=\"field.options\"\n\t\t\t\t\t\t\t\t\t:inputLabel=\"resolveLabel(field.label)\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, optionValue($event))\" />\n\t\t\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\t\t\tv-else\n\t\t\t\t\t\t\t\t\t:label=\"resolveLabel(field.label)\"\n\t\t\t\t\t\t\t\t\t:modelValue=\"fieldValue(field.key, '')\"\n\t\t\t\t\t\t\t\t\t@update:modelValue=\"updateField(field.key, $event)\" />\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t<small\n\t\t\t\t\t\t\t\tv-if=\"field.help\"\n\t\t\t\t\t\t\t\tclass=\"cn-settings-page__field-help\">\n\t\t\t\t\t\t\t\t{{ resolveLabel(field.help) }}\n\t\t\t\t\t\t\t</small>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<template v-if=\"sectionSave\" #footer>\n\t\t\t\t\t\t<div class=\"cn-settings-section__save\" data-testid=\"cn-settings-section-save\">\n\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\t\t\t\t\t@click=\"save\">\n\t\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t\t<NcLoadingIcon v-if=\"saving\" :size=\"20\" />\n\t\t\t\t\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t{{ saveLabel }}\n\t\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</template>\n\t\t\t\t</CnSettingsSection>\n\n\t\t\t\t<!-- Body: a single registry-resolved component. The\n\t\t\t\t\t component is responsible for its own chrome — we do\n\t\t\t\t\t NOT wrap it in CnSettingsSection because the existing\n\t\t\t\t\t widget shape (CnVersionInfoCard, CnRegisterMapping)\n\t\t\t\t\t already wraps itself. Custom components are expected\n\t\t\t\t\t to do the same OR opt in by adding their own section\n\t\t\t\t\t wrapper.\n\n\t\t\t\t\t Wrapped in CnSettingsWidgetMount so the child's $emit\n\t\t\t\t\t is intercepted and re-emitted as @widget-event on this\n\t\t\t\t\t page (manifests can't carry inline JS). -->\n\t\t\t\t<CnSettingsWidgetMount\n\t\t\t\t\tv-else-if=\"sectionBodyKind(section) === 'component' && resolveSectionComponent(section)\"\n\t\t\t\t\t:component=\"resolveSectionComponent(section)\"\n\t\t\t\t\t:componentProps=\"section.props || {}\"\n\t\t\t\t\t:widgetType=\"section.component\"\n\t\t\t\t\t:sectionIndex=\"sectionIndex\"\n\t\t\t\t\t:widgetIndex=\"0\"\n\t\t\t\t\t@widgetEvent=\"onWidgetEvent\" />\n\n\t\t\t\t<!-- Body: ordered list of widgets. Each widget is its own\n\t\t\t\t\t mounted component with v-bind props + bubbled events\n\t\t\t\t\t via CnSettingsWidgetMount. Built-ins (version-info,\n\t\t\t\t\t register-mapping) wrap themselves in CnSettingsSection;\n\t\t\t\t\t custom widgets are expected to do the same. -->\n\t\t\t\t<template v-else-if=\"sectionBodyKind(section) === 'widgets'\">\n\t\t\t\t\t<CnSettingsWidgetMount\n\t\t\t\t\t\tv-for=\"entry in resolvedWidgetEntries(section, sectionIndex)\"\n\t\t\t\t\t\t:key=\"entry.key\"\n\t\t\t\t\t\t:component=\"entry.component\"\n\t\t\t\t\t\t:componentProps=\"entry.props\"\n\t\t\t\t\t\t:widgetType=\"entry.widgetType\"\n\t\t\t\t\t\t:sectionIndex=\"sectionIndex\"\n\t\t\t\t\t\t:widgetIndex=\"entry.widgetIndex\"\n\t\t\t\t\t\t@widgetEvent=\"onWidgetEvent\" />\n\t\t\t\t</template>\n\t\t\t</CnSettingsCard>\n\t\t</div>\n\n\t\t<!-- Save bar -->\n\t\t<div v-if=\"showSaveBar && !saveMode && !autosave\" class=\"cn-settings-page__save-bar\">\n\t\t\t<NcButton\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"saving || !dirty\"\n\t\t\t\t@click=\"save\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcLoadingIcon v-if=\"saving\" :size=\"20\" />\n\t\t\t\t\t<ContentSave v-else :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ saveLabel }}\n\t\t\t</NcButton>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"dirty\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:disabled=\"saving\"\n\t\t\t\t@click=\"reset\">\n\t\t\t\t{{ resetLabel }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<!-- Error -->\n\t\t<div v-if=\"lastError\" class=\"cn-settings-page__error\">\n\t\t\t{{ lastError }}\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport {\n\tNcButton,\n\tNcCheckboxRadioSwitch,\n\tNcLoadingIcon,\n\tNcSelect,\n\tNcTextField,\n} from '@nextcloud/vue'\nimport ContentSave from 'vue-material-design-icons/ContentSave.vue'\nimport CnBuildiqEditButton from '../CnBuildiqEditButton/CnBuildiqEditButton.vue'\nimport CnRegisterMapping from '../CnRegisterMapping/CnRegisterMapping.vue'\nimport CnToggleTableWidget from '../CnToggleTableWidget/CnToggleTableWidget.vue'\nimport CnVersionInfoCard from '../CnVersionInfoCard/CnVersionInfoCard.vue'\nimport { useLook } from '../../composables/useLook.js'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { CnPageHeader } from '../CnPageHeader/index.js'\nimport { CnSettingsCard } from '../CnSettingsCard/index.js'\nimport { CnSettingsSection } from '../CnSettingsSection/index.js'\nimport CnSettingsWidgetMount from './CnSettingsWidgetMount.js'\n\n/**\n * Sentinel value used in the built-in widget registry to mark the\n * `'component'` discriminator (manifest-settings-orchestration\n * REQ-MSO-6). The discriminator does NOT resolve to a fixed\n * component — instead, the resolver detects this sentinel and looks\n * up `widget.componentName` in the customComponents registry.\n */\nconst COMPONENT_DISCRIMINATOR = Symbol('cn-settings-component-widget')\n\n/**\n * Built-in widget registry. Used by `CnSettingsPage` to resolve\n * `widgets[].type` to a component BEFORE consulting the\n * consumer-provided customComponents registry.\n *\n * The order matters — built-ins win on collision so consumers can't\n * accidentally shadow `version-info` with their own component. If a\n * consumer needs to truly replace one of these, they can render their\n * own component via `section.component` or\n * `{ type: \"component\", componentName: <name> }` instead of `widgets[]`.\n *\n * Spec:\n * - REQ-MSRS-2 (manifest-settings-rich-sections) — fixed-component\n * built-ins (`version-info`, `register-mapping`).\n * - REQ-MSO-6 (manifest-settings-orchestration) — `'component'`\n * discriminator (sentinel value, resolved via componentName).\n */\nconst BUILTIN_SETTINGS_WIDGETS = Object.freeze({\n\t'version-info': CnVersionInfoCard,\n\t'register-mapping': CnRegisterMapping,\n\t// Rows with a switch: objects (`bind.mode: 'each'`) or a config map (`'map'`).\n\t'toggle-table': CnToggleTableWidget,\n\tcomponent: COMPONENT_DISCRIMINATOR,\n})\n\n/**\n * CnSettingsPage — Manifest-driven settings page.\n *\n * Reads `sections[]` from `pages[].config` and renders one\n * `CnSettingsCard` per section. Each section declares EXACTLY ONE of\n * three body kinds:\n *\n * - `fields[]` — flat form fields (back-compat default).\n * Each field's `type` controls which input renders:\n * - `boolean` → NcCheckboxRadioSwitch\n * - `number` → NcTextField (type=number)\n * - `string` → NcTextField (default)\n * - `password` → NcTextField (type=password)\n * - `enum` → NcSelect (requires `options: string[]`)\n * Per-field `#field-<key>` slots are exposed so consumers can drop\n * in their own widget.\n *\n * - `component` — registry-resolved component as the section body.\n * `section.props` is v-bind'd to it. Useful when a whole section\n * is one bespoke widget the library doesn't know about.\n *\n * - `widgets[]` — ordered list of widgets. Each entry has a `type`\n * string and optional `props`. Built-in widget types resolve\n * first (`version-info` → `CnVersionInfoCard`, `register-mapping`\n * → `CnRegisterMapping`, `toggle-table` → `CnToggleTableWidget`);\n * unknown types fall back to the\n * `customComponents` registry.\n *\n * Widget events (e.g. CnRegisterMapping's `@save`, CnVersionInfoCard's\n * `@update`) bubble up as a single `@widget-event` event on the page,\n * with payload `{ widgetType, widgetIndex, sectionIndex, name, args }`.\n * Consumers wire one handler at the CnAppRoot level and dispatch by\n * `widgetType` / `name` — the manifest can't carry inline JS, so this\n * is the documented event-wiring escape hatch.\n *\n * Saves via `axios.put(saveEndpoint, formData)`. The `saveEndpoint`\n * default is `/index.php/apps/{appId}/api/settings` — consumers should\n * pass a fully-qualified URL via the manifest (or `saveEndpoint` prop)\n * because the library has no knowledge of the consumer's app id at\n * import time.\n *\n * Slots:\n * - `#header` — Replaces the CnPageHeader.\n * - `#actions` — Right-aligned actions area (the renderer fills this\n * via `pages[].actionsComponent`).\n * - `#field-<key>` — Replaces the input for a specific field within\n * a `fields[]` section. Scope: `{ field, value, onInput }`.\n *\n * Events:\n * - `@save` — Emitted on successful save. Payload: the form data.\n * - `@error` — Emitted when save fails. Payload: the error.\n * - `@input` — Emitted on every field change. Payload: `{ key, value }`.\n * - `@widget-event` — Emitted when a widget mounted via `widgets[]`\n * or `component` re-emits one of its own events. Payload:\n * `{ widgetType, widgetIndex, sectionIndex, name, args }`.\n */\nexport default {\n\tname: 'CnSettingsPage',\n\n\tcomponents: {\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcLoadingIcon,\n\t\tNcSelect,\n\t\tNcTextField,\n\t\tContentSave,\n\t\tCnBuildiqEditButton,\n\t\tCnSettingsCard,\n\t\tCnSettingsSection,\n\t\tCnPageHeader,\n\t\tCnSettingsWidgetMount,\n\t},\n\n\tinject: {\n\t\t/**\n\t\t * Custom-component registry injected from CnAppRoot. Used to\n\t\t * resolve `section.component` and to fall back when a\n\t\t * `widgets[].type` isn't in the built-in widget map. Defaults\n\t\t * to an empty object when the page is mounted standalone.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcnCustomComponents: { default: () => ({}) },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The look the page is drawn in: `board` or `nextcloud`. Empty follows\n\t\t * the `cnLook` that CnAppRoot (or the page's `config.look`) provides.\n\t\t *\n\t\t * @spec openspec/changes/screens-chrome-parity/specs/app-look/spec.md#requirement-an-app-can-take-the-board-look\n\t\t */\n\t\tlook: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Where the page saves (`config.saveMode`): `section` ends each section\n\t\t * that has fields in its own Save button, `page` draws one Save as the\n\t\t * last header button and a Changes card, and empty keeps the save bar\n\t\t * under the last section. Never both a section and a page save.\n\t\t *\n\t\t * @spec openspec/changes/screens-chrome-parity/specs/settings-board-look/spec.md#requirement-a-settings-page-saves-in-one-declared-place\n\t\t * @type {'section'|'page'|''}\n\t\t */\n\t\tsaveMode: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t\tvalidator: (value) => ['', 'section', 'page'].includes(value),\n\t\t},\n\n\t\t/**\n\t\t * The page saves on change (`config.autosave`): no save button at all,\n\t\t * and the description ends with \"Changes are saved automatically.\"\n\t\t *\n\t\t * @spec openspec/changes/screens-chrome-parity/specs/settings-board-look/spec.md#requirement-a-settings-page-saves-in-one-declared-place\n\t\t */\n\t\tautosave: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Page title. */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Settings'),\n\t\t},\n\n\t\t/** Description shown under the title when `showTitle` is set. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Whether to render the inline page header VISIBLY. When false the\n\t\t * `<h1>` is still rendered visually-hidden, so the `<main>` landmark\n\t\t * always has an accessible heading (WCAG 2.4.6 / 1.3.1).\n\t\t */\n\t\tshowTitle: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** MDI icon name for the header. */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Section definitions (flat shape — back-compat). Each section\n\t\t * MUST declare EXACTLY ONE of:\n\t\t * - `fields: Array<Field>` (back-compat flat-field body)\n\t\t * - `component: <registry-name>` + optional `props`\n\t\t * - `widgets: Array<{ type, props?, componentName? }>`\n\t\t *\n\t\t * Common keys: `{ title, description?, icon?, collapsible?, docUrl? }`.\n\t\t *\n\t\t * Mutually exclusive with `tabs[]` (XOR — see\n\t\t * manifest-settings-orchestration REQ-MSO-1).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tsections: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Tab definitions (orchestration shape — manifest-settings-\n\t\t * orchestration REQ-MSO-2). When set, CnSettingsPage renders\n\t\t * a tab strip above the section area; the active tab's\n\t\t * `sections[]` flow into the same renderer used by the flat\n\t\t * shape. Mutually exclusive with `sections[]`.\n\t\t *\n\t\t * Each tab MUST be `{ id: string, label: string,\n\t\t * icon?: string, sections: array<Section> }`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\ttabs: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Optional ID of the tab to activate on mount. When empty AND\n\t\t * `tabs[]` is non-empty, the first tab is active by default.\n\t\t * Unknown IDs fall back to the first tab.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tinitialTab: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Initial values keyed by `field.key`. Defaults to an empty\n\t\t * object; in practice the consumer passes the current\n\t\t * IAppConfig snapshot loaded from their settings controller.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tinitialValues: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Endpoint that receives the PUT on save. Pass a fully-qualified\n\t\t * URL — the library has no knowledge of the consumer's app id.\n\t\t * When empty, no PUT is issued and `@save` is emitted with the\n\t\t * form data so the consumer can persist it themselves.\n\t\t */\n\t\tsaveEndpoint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Whether to render the built-in save/reset bar. */\n\t\tshowSaveBar: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Label for the save button. */\n\t\tsaveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Save'),\n\t\t},\n\n\t\t/** Label for the reset (discard) button. */\n\t\tresetLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Discard changes'),\n\t\t},\n\n\t\t/**\n\t\t * Optional translation function. When provided, applied to\n\t\t * section titles, field labels, and other i18n-key strings\n\t\t * declared in the manifest. Defaults to the identity function.\n\t\t *\n\t\t * @type {((key: string) => string)|null}\n\t\t */\n\t\ttranslate: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Optional explicit custom-component registry. When set, takes\n\t\t * precedence over the injected `cnCustomComponents`. Use this\n\t\t * when mounting CnSettingsPage outside a CnAppRoot tree (or\n\t\t * when test-mounting with a stub registry).\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcustomComponents: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['save', 'error', 'input', 'widget-event', 'tab-change'],\n\n\tsetup(props) {\n\t\tconst { isBoard } = useLook(props)\n\t\treturn { isBoard }\n\t},\n\n\tdata() {\n\t\t// Resolve the initial active-tab id synchronously so the very\n\t\t// first render has the correct tab active (otherwise tests\n\t\t// that mount + assert without an `await tick` see the empty\n\t\t// default). Mirrors the logic in `resolveInitialTabId` (the\n\t\t// watcher path); keep them aligned.\n\t\tlet activeTabId = ''\n\t\tconst tabs = Array.isArray(this.tabs) ? this.tabs : []\n\t\tif (tabs.length > 0) {\n\t\t\tif (typeof this.initialTab === 'string' && this.initialTab.length > 0\n\t\t\t\t&& tabs.some((t) => t && t.id === this.initialTab)) {\n\t\t\t\tactiveTabId = this.initialTab\n\t\t\t} else if (tabs[0] && typeof tabs[0].id === 'string') {\n\t\t\t\tactiveTabId = tabs[0].id\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tformData: this.cloneInitial(),\n\t\t\toriginalData: this.cloneInitial(),\n\t\t\tsaving: false,\n\t\t\tlastError: null,\n\t\t\tactiveTabId,\n\t\t\tautosaveTimer: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} The page saves from its header (`saveMode: \"page\"`, not autosave). */\n\t\tpageSave() {\n\t\t\treturn this.saveMode === 'page' && !this.autosave\n\t\t},\n\n\t\t/** @return {boolean} Each section with fields saves on its own (`saveMode: \"section\"`). */\n\t\tsectionSave() {\n\t\t\treturn this.saveMode === 'section' && !this.autosave\n\t\t},\n\n\t\t/**\n\t\t * The description, with the autosave note appended when the page saves\n\t\t * on change.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tresolvedDescription() {\n\t\t\tif (!this.autosave) {\n\t\t\t\treturn this.description\n\t\t\t}\n\t\t\tconst note = t('nextcloud-vue', 'Changes are saved automatically.')\n\t\t\treturn this.description ? `${this.description} ${note}` : note\n\t\t},\n\n\t\t/** @return {boolean} The header buttons render inside the visible page header. */\n\t\theaderButtonsInHeader() {\n\t\t\treturn Boolean(this.title && this.showTitle && !this.$slots.header && (this.isBoard || this.pageSave))\n\t\t},\n\n\t\t/** @return {boolean} The header buttons need a row of their own (header hidden or replaced). */\n\t\theaderButtonsOutside() {\n\t\t\treturn Boolean((this.isBoard || this.pageSave) && !this.headerButtonsInHeader)\n\t\t},\n\n\t\t/** @return {string} Title of the Changes card. */\n\t\tchangesLabel() {\n\t\t\treturn t('nextcloud-vue', 'Changes')\n\t\t},\n\n\t\t/**\n\t\t * The fields that differ from their saved value, across every section,\n\t\t * labelled for the Changes card.\n\t\t *\n\t\t * @return {Array<{key: string, label: string}>}\n\t\t */\n\t\tchangedFields() {\n\t\t\tconst labels = {}\n\t\t\tconst sections = [...(this.sections || [])]\n\t\t\tfor (const tab of this.tabs || []) {\n\t\t\t\tif (tab && Array.isArray(tab.sections)) {\n\t\t\t\t\tsections.push(...tab.sections)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const section of sections) {\n\t\t\t\tfor (const field of (section && section.fields) || []) {\n\t\t\t\t\tlabels[field.key] = this.resolveLabel(field.label) || field.key\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst keys = new Set([...Object.keys(this.formData), ...Object.keys(this.originalData)])\n\t\t\treturn [...keys]\n\t\t\t\t.filter((key) => JSON.stringify(this.formData[key]) !== JSON.stringify(this.originalData[key]))\n\t\t\t\t.map((key) => ({ key, label: labels[key] || key }))\n\t\t},\n\n\t\t/** Whether any field has changed since load. */\n\t\tdirty() {\n\t\t\treturn JSON.stringify(this.formData) !== JSON.stringify(this.originalData)\n\t\t},\n\n\t\t/**\n\t\t * Effective custom-component registry. Explicit prop wins over\n\t\t * the injected value (mirrors CnPageRenderer's resolution\n\t\t * order).\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\teffectiveCustomComponents() {\n\t\t\treturn this.customComponents ?? this.cnCustomComponents ?? {}\n\t\t},\n\n\t\t/**\n\t\t * Whether the page is in tabs orchestration mode. True when\n\t\t * `tabs[]` is non-empty — drives the tab-strip render gate\n\t\t * (manifest-settings-orchestration REQ-MSO-5).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasTabs() {\n\t\t\treturn Array.isArray(this.tabs) && this.tabs.length > 0\n\t\t},\n\n\t\t/**\n\t\t * The sections to render right now. In flat mode, this is the\n\t\t * `sections` prop directly. In tabs mode, this is the\n\t\t * `sections[]` array of the currently active tab. Centralising\n\t\t * this in one computed keeps the template's `v-for` simple\n\t\t * and decouples it from the body kind dispatcher (which\n\t\t * applies per-section, not per-mode).\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tactiveSections() {\n\t\t\tif (!this.hasTabs) {\n\t\t\t\treturn this.sections || []\n\t\t\t}\n\t\t\tconst active = this.tabs.find((t) => t && t.id === this.activeTabId)\n\t\t\tif (active && Array.isArray(active.sections)) {\n\t\t\t\treturn active.sections\n\t\t\t}\n\t\t\t// Defensive fallback — should not happen because\n\t\t\t// `resolveInitialTabId` always lands on a known tab.\n\t\t\tconst first = this.tabs[0]\n\t\t\treturn first && Array.isArray(first.sections) ? first.sections : []\n\t\t},\n\t},\n\n\twatch: {\n\t\tinitialValues: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.formData = this.cloneInitial()\n\t\t\t\tthis.originalData = this.cloneInitial()\n\t\t\t},\n\t\t},\n\n\t\t// When `tabs[]` changes (e.g. consumer swaps manifests at\n\t\t// runtime), re-resolve the active tab so the page doesn't get\n\t\t// stuck on a removed id.\n\t\ttabs: {\n\t\t\thandler() {\n\t\t\t\tthis.activeTabId = this.resolveInitialTabId()\n\t\t\t},\n\t\t},\n\n\t\t// When `initialTab` changes (consumer-controlled tab\n\t\t// activation), follow it.\n\t\tinitialTab(next) {\n\t\t\tif (typeof next === 'string' && next.length > 0) {\n\t\t\t\tconst exists = this.tabs.some((t) => t && t.id === next)\n\t\t\t\tif (exists) {\n\t\t\t\t\tthis.activeTabId = next\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.autosaveTimer)\n\t},\n\n\tmethods: {\n\t\t// Coalesce a field value to a fallback when null / undefined.\n\t\t// Used in template bindings instead of `formData[key] ?? ''` because\n\t\t// vue-template-es2015-compiler (the Rollup VuePlugin's parser) does\n\t\t// not accept ES2020 nullish-coalescing inside template expressions.\n\t\tfieldValue(key, fallback) {\n\t\t\tconst v = this.formData[key]\n\t\t\treturn (v === null || v === undefined) ? fallback : v\n\t\t},\n\n\t\t// Resolve the currently-selected option for an enum field.\n\t\t// `field.options` may be an array of strings/numbers OR an array\n\t\t// of `{ label, value }`-shaped objects. NcSelect needs the actual\n\t\t// option entry (not the bare value) to render the selection\n\t\t// correctly, so this resolver looks up the matching object form\n\t\t// when a primitive value is stored. Returns `null` when nothing\n\t\t// is selected so NcSelect renders the empty state instead of\n\t\t// emitting a Vue warning about an undefined `value` prop.\n\t\tselectedOption(field) {\n\t\t\tconst v = this.formData[field.key]\n\t\t\tif (v === null || v === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (!Array.isArray(field.options)) {\n\t\t\t\treturn v\n\t\t\t}\n\t\t\tfor (const opt of field.options) {\n\t\t\t\tif (opt && typeof opt === 'object') {\n\t\t\t\t\tif (opt.value === v) {\n\t\t\t\t\t\treturn opt\n\t\t\t\t\t}\n\t\t\t\t} else if (opt === v) {\n\t\t\t\t\treturn opt\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn v\n\t\t},\n\n\t\t// Inverse of `selectedOption` — extract the storable value from\n\t\t// whatever NcSelect emits. NcSelect emits the full option entry\n\t\t// when options are objects, the primitive when options are\n\t\t// primitives, or `null` on clear.\n\t\toptionValue(emitted) {\n\t\t\tif (emitted === null || emitted === undefined) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (typeof emitted === 'object' && 'value' in emitted) {\n\t\t\t\treturn emitted.value\n\t\t\t}\n\t\t\treturn emitted\n\t\t},\n\n\t\tcloneInitial() {\n\t\t\tconst merged = { ...(this.initialValues || {}) }\n\t\t\t// Collect every section across both modes (flat\n\t\t\t// `sections[]` AND `tabs[].sections[]`) so default values\n\t\t\t// are applied regardless of orchestration shape.\n\t\t\t// Only flat-field sections contribute defaults; component\n\t\t\t// and widgets sections own their own state.\n\t\t\tconst allSections = []\n\t\t\tfor (const section of this.sections || []) {\n\t\t\t\tallSections.push(section)\n\t\t\t}\n\t\t\tfor (const tab of this.tabs || []) {\n\t\t\t\tif (tab && Array.isArray(tab.sections)) {\n\t\t\t\t\tfor (const section of tab.sections) {\n\t\t\t\t\t\tallSections.push(section)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const section of allSections) {\n\t\t\t\tif (!section || !Array.isArray(section.fields)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor (const field of section.fields) {\n\t\t\t\t\tif (field.default !== undefined && merged[field.key] === undefined) {\n\t\t\t\t\t\tmerged[field.key] = field.default\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn merged\n\t\t},\n\n\t\tresolveLabel(value) {\n\t\t\tif (!value) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (this.translate) {\n\t\t\t\treturn this.translate(value)\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\tupdateField(key, value) {\n\t\t\tthis.formData[key] = value\n\t\t\tthis.$emit('input', { key, value })\n\t\t\tif (this.autosave) {\n\t\t\t\tthis.queueAutosave()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Determine which body kind a section declares. Returns\n\t\t * `'fields'` (default + back-compat), `'component'`, or\n\t\t * `'widgets'`. The validator (`validateManifest`) enforces\n\t\t * exactly-one at parse time; this method is the runtime\n\t\t * equivalent and is permissive when one of the keys is set\n\t\t * (last-defined wins in the rare case of an unvalidated\n\t\t * manifest).\n\t\t *\n\t\t * @param {object} section A section entry from `sections[]`.\n\t\t * @return {'fields' | 'component' | 'widgets'}\n\t\t */\n\t\tsectionBodyKind(section) {\n\t\t\tif (Array.isArray(section.widgets) && section.widgets.length > 0) {\n\t\t\t\treturn 'widgets'\n\t\t\t}\n\t\t\tif (typeof section.component === 'string' && section.component.length > 0) {\n\t\t\t\treturn 'component'\n\t\t\t}\n\t\t\treturn 'fields'\n\t\t},\n\n\t\t/**\n\t\t * Resolve a `section.component` registry name to a Vue\n\t\t * component via `effectiveCustomComponents`. Returns `null`\n\t\t * (and warns) when the registry has no entry.\n\t\t *\n\t\t * @param {object} section A section entry.\n\t\t * @return {object|null} Vue component or null.\n\t\t */\n\t\tresolveSectionComponent(section) {\n\t\t\tconst name = section.component\n\t\t\tif (!name) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst resolved = this.effectiveCustomComponents[name]\n\t\t\tif (!resolved) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(`[CnSettingsPage] Section component \"${name}\" not found in customComponents registry. Section body will be empty.`)\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn resolved\n\t\t},\n\n\t\t/**\n\t\t * Resolve a single `widgets[]` entry to a concrete Vue\n\t\t * component. Lookup order:\n\t\t *\n\t\t * 1. Built-in widget map (`version-info`, `register-mapping`).\n\t\t * 2. `'component'` discriminator (REQ-MSO-6) — resolves\n\t\t * `widget.componentName` against `effectiveCustomComponents`.\n\t\t * 3. Legacy fallback — looks up `widget.type` against\n\t\t * `effectiveCustomComponents`. Kept for back-compat with\n\t\t * manifest-settings-rich-sections consumers; flagged as\n\t\t * deprecated in JSDoc — manifest authors should migrate to\n\t\t * the explicit `{ type: \"component\", componentName }` shape.\n\t\t *\n\t\t * Returns `null` (and warns) when nothing resolves. Built-ins\n\t\t * win on collision so consumers can't accidentally shadow them.\n\t\t *\n\t\t * @param {object} widget A `widgets[]` entry, e.g. `{ type, props?, componentName? }`.\n\t\t * @return {object|null} Vue component or null.\n\t\t */\n\t\tresolveWidgetComponent(widget) {\n\t\t\tconst type = widget && typeof widget.type === 'string' ? widget.type : ''\n\t\t\tif (!type) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (Object.hasOwn(BUILTIN_SETTINGS_WIDGETS, type)) {\n\t\t\t\tconst builtin = BUILTIN_SETTINGS_WIDGETS[type]\n\t\t\t\tif (builtin === COMPONENT_DISCRIMINATOR) {\n\t\t\t\t\t// REQ-MSO-6: discriminator — look up `componentName`.\n\t\t\t\t\tconst name = widget.componentName\n\t\t\t\t\tif (typeof name !== 'string' || name.length === 0) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.warn('[CnSettingsPage] Widget {type:\"component\"} requires a non-empty `componentName`. Widget will be skipped.')\n\t\t\t\t\t\treturn null\n\t\t\t\t\t}\n\t\t\t\t\tconst resolved = this.effectiveCustomComponents[name]\n\t\t\t\t\tif (!resolved) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.warn(`[CnSettingsPage] Widget component \"${name}\" not found in customComponents registry. Widget will be skipped.`)\n\t\t\t\t\t\treturn null\n\t\t\t\t\t}\n\t\t\t\t\treturn resolved\n\t\t\t\t}\n\t\t\t\treturn builtin\n\t\t\t}\n\t\t\t// Legacy fallback (manifest-settings-rich-sections REQ-MSRS-2).\n\t\t\t// Deprecated — manifest authors should migrate to\n\t\t\t// `{ type: \"component\", componentName: <X> }`. Kept here so\n\t\t\t// existing consumers continue working unchanged.\n\t\t\tconst resolved = this.effectiveCustomComponents[type]\n\t\t\tif (!resolved) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(`[CnSettingsPage] Widget type \"${type}\" not found in built-in widgets or customComponents registry. Widget will be skipped.`)\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn resolved\n\t\t},\n\n\t\t/**\n\t\t * Build the list of widget mount entries for a `widgets[]`\n\t\t * section. Filters out entries whose `widget.type` doesn't\n\t\t * resolve (built-in OR customComponents) — `resolveWidgetComponent`\n\t\t * has already logged a warn. The filter happens here so the\n\t\t * template can use a clean `v-for` without nested `v-if`.\n\t\t *\n\t\t * The `widgetType` carried on the bubbled `@widget-event`\n\t\t * payload is the widget's `componentName` (when the\n\t\t * discriminator is `'component'`) or `widget.type` otherwise —\n\t\t * giving consumers a stable identifier for the dispatch.\n\t\t *\n\t\t * @param {object} section A section entry with `widgets[]`.\n\t\t * @param {number} sectionIndex Index in `sections[]`.\n\t\t * @return {Array<{key: string, component: object, props: object, widgetType: string, widgetIndex: number}>}\n\t\t */\n\t\tresolvedWidgetEntries(section, sectionIndex) {\n\t\t\tconst entries = []\n\t\t\tconst widgets = Array.isArray(section.widgets) ? section.widgets : []\n\t\t\tfor (let widgetIndex = 0; widgetIndex < widgets.length; widgetIndex++) {\n\t\t\t\tconst widget = widgets[widgetIndex] || {}\n\t\t\t\tconst component = this.resolveWidgetComponent(widget)\n\t\t\t\tif (!component) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst widgetType = widget.type === 'component' && typeof widget.componentName === 'string'\n\t\t\t\t\t? widget.componentName\n\t\t\t\t\t: widget.type\n\t\t\t\tentries.push({\n\t\t\t\t\tkey: `widget-${sectionIndex}-${widgetIndex}`,\n\t\t\t\t\tcomponent,\n\t\t\t\t\tprops: widget.props || {},\n\t\t\t\t\twidgetType,\n\t\t\t\t\twidgetIndex,\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn entries\n\t\t},\n\n\t\t/**\n\t\t * Resolve the active-tab id on mount / when `tabs[]` changes.\n\t\t * Lookup order: explicit `initialTab` prop → first tab in\n\t\t * `tabs[]` → empty string. Unknown `initialTab` values fall\n\t\t * back to the first tab so the page never gets stuck.\n\t\t * (manifest-settings-orchestration REQ-MSO-5.)\n\t\t *\n\t\t * @return {string} The resolved tab id (empty in flat mode).\n\t\t */\n\t\tresolveInitialTabId() {\n\t\t\tif (!this.hasTabs) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (typeof this.initialTab === 'string' && this.initialTab.length > 0) {\n\t\t\t\tconst exists = this.tabs.some((t) => t && t.id === this.initialTab)\n\t\t\t\tif (exists) {\n\t\t\t\t\treturn this.initialTab\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst first = this.tabs[0]\n\t\t\treturn first && typeof first.id === 'string' ? first.id : ''\n\t\t},\n\n\t\t/**\n\t\t * Handle a tab button click. Switches the active tab and\n\t\t * emits `@tab-change` so consumers can react (e.g. persist the\n\t\t * active tab in their preference store, update the URL hash).\n\t\t * (manifest-settings-orchestration REQ-MSO-5.)\n\t\t *\n\t\t * @param {object} tab The clicked tab definition.\n\t\t * @param {number} tabIndex The tab's index in `tabs[]`.\n\t\t */\n\t\tonTabClick(tab, tabIndex) {\n\t\t\tif (!tab || typeof tab.id !== 'string') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.activeTabId === tab.id) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.activeTabId = tab.id\n\t\t\tthis.$emit('tab-change', { tabId: tab.id, tabIndex })\n\t\t},\n\n\t\t/**\n\t\t * Re-emit a widget's `widget-event` (caught by the local\n\t\t * CnSettingsWidgetMount helper) as a top-level `widget-event`\n\t\t * on this page. Consumers wire one `@widget-event` handler at\n\t\t * the CnAppRoot mount point and dispatch by `widgetType` /\n\t\t * `name`.\n\t\t *\n\t\t * @param {object} payload `{ widgetType, widgetIndex, sectionIndex, name, args }`\n\t\t */\n\t\tonWidgetEvent(payload) {\n\t\t\tthis.$emit('widget-event', payload)\n\t\t},\n\n\t\t/**\n\t\t * Save shortly after the last change (`autosave`): a burst of typing\n\t\t * is one request.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tqueueAutosave() {\n\t\t\tclearTimeout(this.autosaveTimer)\n\t\t\tthis.autosaveTimer = setTimeout(() => {\n\t\t\t\tthis.autosaveTimer = null\n\t\t\t\tif (this.dirty && !this.saving) {\n\t\t\t\t\tthis.save()\n\t\t\t\t}\n\t\t\t}, 600)\n\t\t},\n\n\t\treset() {\n\t\t\tthis.formData = this.cloneInitial()\n\t\t\tthis.lastError = null\n\t\t},\n\n\t\tasync save() {\n\t\t\tthis.saving = true\n\t\t\tthis.lastError = null\n\t\t\ttry {\n\t\t\t\tif (this.saveEndpoint) {\n\t\t\t\t\tawait axios.put(prefixUrl(this.saveEndpoint), this.formData)\n\t\t\t\t}\n\t\t\t\tthis.originalData = JSON.parse(JSON.stringify(this.formData))\n\t\t\t\tthis.$emit('save', this.formData)\n\t\t\t} catch (err) {\n\t\t\t\tthis.lastError = err?.response?.data?.message || err?.message || t('nextcloud-vue', 'Save failed')\n\t\t\t\tthis.$emit('error', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* The section wrapper draws no box; the board look makes it the card grid. */\n.cn-settings-page__sections {\n\tdisplay: contents;\n}\n\n.cn-settings-page__header-buttons {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tmargin-inline-start: auto;\n}\n\n.cn-settings-page {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n}\n\n.cn-settings-page__actions {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: 8px;\n}\n\n/*\n * Tab strip for the orchestration shape (manifest-settings-\n * orchestration REQ-MSO-5). Uses Nextcloud CSS variables only — no\n * hex literals, no rgba overrides on the elements themselves.\n */\n.cn-settings-page__tabs {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px;\n\tborder-bottom: 1px solid var(--color-border);\n\tpadding-bottom: 0;\n\tmargin-bottom: 8px;\n}\n\n.cn-settings-page__tab {\n\tbackground: transparent;\n\tborder: 0;\n\tborder-bottom: 3px solid transparent;\n\tpadding: 8px 16px;\n\tmargin: 0;\n\tcursor: pointer;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: normal;\n\tborder-radius: var(--border-radius-large) var(--border-radius-large) 0 0;\n\ttransition: background-color 0.1s ease-in-out, color 0.1s ease-in-out, border-color 0.1s ease-in-out;\n}\n\n.cn-settings-page__tab:hover,\n.cn-settings-page__tab:focus-visible {\n\tbackground-color: var(--color-background-hover);\n\tcolor: var(--color-main-text);\n\toutline: none;\n}\n\n.cn-settings-page__tab--active {\n\tcolor: var(--color-primary-element);\n\tborder-bottom-color: var(--color-primary-element);\n\tfont-weight: bold;\n}\n\n@media (max-width: 768px) {\n\t.cn-settings-page__tabs {\n\t\tflex-direction: column;\n\t\tgap: 0;\n\t\tborder-bottom: 0;\n\t}\n\n\t.cn-settings-page__tab {\n\t\tborder-bottom: 1px solid var(--color-border);\n\t\tborder-radius: 0;\n\t\ttext-align: left;\n\t}\n\n\t.cn-settings-page__tab--active {\n\t\tborder-bottom-width: 1px;\n\t\tbackground-color: var(--color-background-hover);\n\t}\n}\n\n.cn-settings-page__fields {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-settings-page__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-settings-page__field-help {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-settings-page__save-bar {\n\tdisplay: flex;\n\tgap: 8px;\n\tmargin-top: 16px;\n}\n\n.cn-settings-page__error {\n\tcolor: var(--color-error);\n\tbackground: var(--color-error-light, var(--color-background-hover));\n\tpadding: 8px 12px;\n\tborder-radius: var(--border-radius);\n}\n</style>\n"],"names":["_createBlock","_createElementVNode","_createTextVNode","_openBlock","_createElementBlock","_toDisplayString","_renderSlot","_Fragment","_renderList","_createVNode"],"mappings":";;;OAiEW,EAAC,kBAAS;AAAA,EAAA,aAAA,EAAA,kBAAA;;;AAoBX,EAAA,KAAK,EAAC,kCAA8B;AAAA,EAAA,aAAA,EAAA,iCAAA;;;;AAsB3C,EAAA,KAAK,EAAC,kCAAkC;AACxC,EAAA,aAAW,EAAC,iCAAiC;;;;AAmB5C,EAAA,KAAI,EAAC,2BAA2B;eACtB,EAAC,0BAA0B;;AAClC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,iCAAiC,GAAA;;;AAWL,EAAA,KAAA,EAAA,2BAAA;;;;OAUjC,EAAC,wBAAqB;AAC1B,EAAA,IAAE,EAAA,SAAA;;;;AAqBE,MAAA,UAAA,GAAA,EAAA,KAAI,EAAC,4BAAgB,GAAA;AAqBnB,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,0BAAgB,GAAA;;;AA2CxB,EAAA,KAAK,EAAC,8BAAW;;;AAMd,EAAA,KAAK,EAAC,2BAAG;AAAA,EAAA,aAAA,EAAA,0BAAA;;;;;;;;;;;;;;;;;;;;;;;;;cA5IX,CAAA,IAAA,CAAA,MAAA,EAAA,QAAA,EAAA;AA7BL,MAAA,KAAC,EAAA,MAAA,CAAA,KAAA;AACD,MAAA,WAAW,EAAE,MAAW,CAAA,WAAA;AACxB,MAAA,IAAI,EAAE,MAAI,CAAA,IAAA;aA2BL;OAzBC,MAAK,CAAA,KAAA;wBADZA,WAyBe,CAAA,uBAAA,EAAA;;AAvBb,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AAA,EAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnStagesWidget.vue2.js';
2
2
  import { render } from './CnStagesWidget.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-a394760a";
5
+ script.__scopeId = "data-v-3946def5";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -5,7 +5,7 @@ import { inject, ref } from 'vue';
5
5
  import __sfc_main$1 from '../../dialogs/CnTransitionInputDialog.vue.js';
6
6
  import __sfc_main from '../CnTimelineStages/CnTimelineStages.vue.js';
7
7
  import { useEndpointSource, getByPath } from '../../composables/useEndpointSource.js';
8
- import { actionsByTarget, isBlockedAction, actionNote, declaresInputs, performTransition, transitionError, readAvailableActions } from '../../composables/useLifecycleTransitions.js';
8
+ import { actionsByTarget, isBlockedAction, actionNote, declaresInputs, performTransition, transitionError, transitionFieldErrors, readAvailableActions } from '../../composables/useLifecycleTransitions.js';
9
9
  import { normalizeLook } from '../../composables/useLook.js';
10
10
  import { useObjectStore } from '../../store/useObjectStore.js';
11
11
  import { resolveObjectOpType } from '../../utils/actionsDispatcher.js';
@@ -353,6 +353,17 @@ var script = {
353
353
  pendingAction: null,
354
354
  /** @type {boolean} Whether a move is running. */
355
355
  busy: false,
356
+ /**
357
+ * @type {string} The stage a running move leads to, or ''. Drives
358
+ * the loading indicator on that one stage.
359
+ */
360
+ movingTo: '',
361
+ /** @type {string} A refusal shown inside the open input dialog. */
362
+ inputError: '',
363
+ /** @type {string[]} The input keys that refusal named. */
364
+ inputFieldErrors: [],
365
+ /** @type {string[]} The input keys the last refused move named. */
366
+ lastFieldErrors: [],
356
367
  /** @type {string} Why the last move failed, or ''. */
357
368
  moveError: '',
358
369
  /**
@@ -585,6 +596,20 @@ var script = {
585
596
  return this.interactive && !this.busy
586
597
  },
587
598
 
599
+ /**
600
+ * What the stage a move is running to says while it runs: the
601
+ * loading indicator's name and the live region's sentence.
602
+ *
603
+ * @return {string} The sentence, or '' when nothing is moving.
604
+ */
605
+ movingMessage() {
606
+ if (!this.movingTo) {
607
+ return ''
608
+ }
609
+ const stage = this.stages.find((s) => s.id === this.movingTo);
610
+ return this.tr('Moving to {stage}', { stage: stage ? stage.label : this.movingTo })
611
+ },
612
+
588
613
  /**
589
614
  * The allowed moves by the stage they lead to, or null while they are
590
615
  * unknown.
@@ -1044,13 +1069,44 @@ var script = {
1044
1069
  * @param {object} data The collected input values.
1045
1070
  * @return {void}
1046
1071
  */
1047
- onInputConfirm(data) {
1072
+ async onInputConfirm(data) {
1048
1073
  const pending = this.pendingAction;
1049
- this.pendingAction = null;
1050
1074
  if (!pending || !pending.__request) {
1075
+ this.closeInputDialog();
1076
+ return
1077
+ }
1078
+ this.inputError = '';
1079
+ this.inputFieldErrors = [];
1080
+ // THE DIALOG STAYS OPEN WHILE THE MOVE RUNS, with its confirm
1081
+ // button busy. Closing it first left the person looking at an
1082
+ // unchanged strip for as long as the transition took, which on a
1083
+ // live case was long enough to reload the page thinking it had
1084
+ // not been sent.
1085
+ const moved = await this.performMove(pending.__request, data);
1086
+ if (this.pendingAction !== pending) {
1087
+ // Closed while the move ran; nothing left to update.
1051
1088
  return
1052
1089
  }
1053
- this.performMove(pending.__request, data);
1090
+ if (moved) {
1091
+ this.closeInputDialog();
1092
+ return
1093
+ }
1094
+ // Refused. The sentence goes into the dialog the person is looking
1095
+ // at, with what they typed still in it.
1096
+ this.inputError = this.moveError;
1097
+ this.inputFieldErrors = this.lastFieldErrors;
1098
+ this.moveError = '';
1099
+ },
1100
+
1101
+ /**
1102
+ * Close the input dialog and forget the refusal it was showing.
1103
+ *
1104
+ * @return {void}
1105
+ */
1106
+ closeInputDialog() {
1107
+ this.pendingAction = null;
1108
+ this.inputError = '';
1109
+ this.inputFieldErrors = [];
1054
1110
  },
1055
1111
 
1056
1112
  /**
@@ -1058,11 +1114,17 @@ var script = {
1058
1114
  *
1059
1115
  * @param {{stage: {id: string, label: string}, action: string}} request The move.
1060
1116
  * @param {object} [data] The collected transition inputs, when any.
1061
- * @return {Promise<void>}
1117
+ * @return {Promise<boolean>} Whether the move was made.
1062
1118
  */
1063
1119
  async performMove(request, data) {
1064
1120
  this.busy = true;
1121
+ this.movingTo = request.stage.id;
1065
1122
  this.moveError = '';
1123
+ this.lastFieldErrors = [];
1124
+ // Said as the move starts, not only when it lands: a screen reader
1125
+ // user otherwise hears nothing for as long as the server takes.
1126
+ this.statusMessage = this.movingMessage;
1127
+ let moved = false;
1066
1128
  try {
1067
1129
  if (this.lifecycleMode) {
1068
1130
  await performTransition(this.recordId, request.action, data);
@@ -1089,11 +1151,16 @@ var script = {
1089
1151
  if (this.lifecycleMode) {
1090
1152
  await this.loadActions();
1091
1153
  }
1154
+ moved = true;
1092
1155
  } catch (error) {
1093
1156
  this.moveError = transitionError(error, this.tr('The move could not be made'));
1157
+ this.lastFieldErrors = transitionFieldErrors(error);
1158
+ this.statusMessage = this.moveError;
1094
1159
  } finally {
1095
1160
  this.busy = false;
1161
+ this.movingTo = '';
1096
1162
  }
1163
+ return moved
1097
1164
  },
1098
1165
 
1099
1166
  /**