@conduction/nextcloud-vue 2.69.0 → 2.71.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 (153) hide show
  1. package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js +25 -0
  2. package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js.map +1 -1
  3. package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js +155 -152
  4. package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js.map +1 -1
  5. package/dist/esm/components/CnAppNav/CnAppNav.vue2.js +77 -0
  6. package/dist/esm/components/CnAppNav/CnAppNav.vue2.js.map +1 -1
  7. package/dist/esm/components/CnAppNav/CnAppNav.vue3.js +8 -8
  8. package/dist/esm/components/CnAppNav/CnAppNav.vue3.js.map +1 -1
  9. package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js +151 -13
  10. package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
  11. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js +3 -1
  12. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
  13. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue.js +1 -0
  14. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue.js.map +1 -1
  15. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue2.js +28 -0
  16. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue2.js.map +1 -1
  17. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue3.js +4 -2
  18. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue3.js.map +1 -1
  19. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue2.js +25 -1
  20. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue2.js.map +1 -1
  21. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue3.js +32 -17
  22. package/dist/esm/components/CnCalendarWidget/CnCalendarWidget.vue3.js.map +1 -1
  23. package/dist/esm/components/CnCapabilityTable/CnCapabilityTable.vue2.js +14 -1
  24. package/dist/esm/components/CnCapabilityTable/CnCapabilityTable.vue2.js.map +1 -1
  25. package/dist/esm/components/CnCapabilityTable/CnCapabilityTable.vue3.js.map +1 -1
  26. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +43 -2
  27. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  28. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js +3 -3
  29. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  30. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +25 -1
  31. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  32. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +40 -43
  33. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  34. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +35 -1
  35. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  36. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  37. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +54 -3
  38. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  39. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +6 -3
  40. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  41. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +28 -0
  42. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  43. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js +3 -2
  44. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  45. package/dist/esm/components/CnFeaturesAndRoadmapPage/CnFeaturesAndRoadmapPage.vue2.js +12 -0
  46. package/dist/esm/components/CnFeaturesAndRoadmapPage/CnFeaturesAndRoadmapPage.vue2.js.map +1 -1
  47. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue2.js +9 -0
  48. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue2.js.map +1 -1
  49. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue3.js.map +1 -1
  50. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +29 -2
  51. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  52. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +71 -34
  53. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  54. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue2.js +54 -7
  55. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue2.js.map +1 -1
  56. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue3.js +26 -8
  57. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue3.js.map +1 -1
  58. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +165 -0
  59. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  60. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +69 -26
  61. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  62. package/dist/esm/components/CnNextStepCard/CnNextStepCard.vue2.js.map +1 -1
  63. package/dist/esm/components/CnNextStepCard/CnNextStepCard.vue3.js.map +1 -1
  64. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +4 -1
  65. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
  66. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
  67. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js +1 -1
  68. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js.map +1 -1
  69. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js.map +1 -1
  70. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue2.js.map +1 -1
  71. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue3.js +46 -32
  72. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue3.js.map +1 -1
  73. package/dist/esm/components/CnStackedBarWidget/CnStackedBarWidget.vue2.js +17 -3
  74. package/dist/esm/components/CnStackedBarWidget/CnStackedBarWidget.vue2.js.map +1 -1
  75. package/dist/esm/components/CnStackedBarWidget/CnStackedBarWidget.vue3.js +25 -24
  76. package/dist/esm/components/CnStackedBarWidget/CnStackedBarWidget.vue3.js.map +1 -1
  77. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js.map +1 -1
  78. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js.map +1 -1
  79. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +27 -0
  80. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  81. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js +7 -0
  82. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  83. package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue2.js +24 -1
  84. package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue2.js.map +1 -1
  85. package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue3.js +1 -1
  86. package/dist/esm/components/CnStatsBlock/CnStatsBlock.vue3.js.map +1 -1
  87. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js +11 -0
  88. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js.map +1 -1
  89. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js +4 -2
  90. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js.map +1 -1
  91. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js +30 -9
  92. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js.map +1 -1
  93. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue3.js.map +1 -1
  94. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js +15 -2
  95. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js.map +1 -1
  96. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue3.js +31 -32
  97. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue3.js.map +1 -1
  98. package/dist/esm/composables/useWalkthrough.js +11 -3
  99. package/dist/esm/composables/useWalkthrough.js.map +1 -1
  100. package/dist/esm/nextcloud-vue.css +198 -0
  101. package/dist/esm/utils/capabilityComparison.js +29 -1
  102. package/dist/esm/utils/capabilityComparison.js.map +1 -1
  103. package/dist/esm/utils/columnFilters.js +54 -4
  104. package/dist/esm/utils/columnFilters.js.map +1 -1
  105. package/dist/esm/utils/userAutocomplete.js +69 -3
  106. package/dist/esm/utils/userAutocomplete.js.map +1 -1
  107. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  108. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  109. package/dist/nextcloud-vue.cjs.js +2778 -1630
  110. package/dist/nextcloud-vue.cjs.js.map +2 -2
  111. package/dist/nextcloud-vue.css +198 -0
  112. package/package.json +1 -1
  113. package/src/components/CnActionsBar/CnActionsBar.md +2 -0
  114. package/src/components/CnActionsBar/CnActionsBar.vue +28 -2
  115. package/src/components/CnAppNav/CnAppNav.vue +85 -8
  116. package/src/components/CnAppRoot/CnAppRoot.vue +153 -13
  117. package/src/components/CnBreadcrumbs/CnBreadcrumbs.vue +45 -0
  118. package/src/components/CnCalendarWidget/CnCalendarWidget.vue +32 -4
  119. package/src/components/CnCapabilityTable/CnCapabilityTable.vue +14 -0
  120. package/src/components/CnDashboardGrid/CnDashboardGrid.md +2 -0
  121. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +54 -2
  122. package/src/components/CnDashboardPage/CnDashboardPage.vue +46 -19
  123. package/src/components/CnDataTable/CnDataTable.vue +35 -1
  124. package/src/components/CnDetailPage/CnDetailPage.md +2 -0
  125. package/src/components/CnDetailPage/CnDetailPage.vue +57 -3
  126. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +30 -1
  127. package/src/components/CnFeaturesAndRoadmapPage/CnFeaturesAndRoadmapPage.vue +12 -0
  128. package/src/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue +9 -0
  129. package/src/components/CnFormDialog/CnFormDialog.vue +62 -2
  130. package/src/components/CnHeaderWidget/CnHeaderWidget.vue +95 -8
  131. package/src/components/CnIndexPage/CnIndexPage.vue +194 -7
  132. package/src/components/CnNextStepCard/CnNextStepCard.vue +11 -0
  133. package/src/components/CnObjectListWidget/CnObjectListWidget.vue +4 -1
  134. package/src/components/CnObjectSidebar/CnNotesTab.vue +1 -1
  135. package/src/components/CnSetupWizard/CnSetupWizard.vue +7 -0
  136. package/src/components/CnStackedBarWidget/CnStackedBarWidget.vue +34 -7
  137. package/src/components/CnStagesWidget/CnStagesWidget.vue +19 -0
  138. package/src/components/CnStatWidget/CnStatWidget.vue +36 -0
  139. package/src/components/CnStatsBlock/CnStatsBlock.md +2 -0
  140. package/src/components/CnStatsBlock/CnStatsBlock.vue +25 -2
  141. package/src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue +13 -0
  142. package/src/components/CnWalkthrough/CnWalkthrough.vue +30 -9
  143. package/src/components/CnWeekStripWidget/CnWeekStripWidget.vue +24 -3
  144. package/src/composables/useWalkthrough.js +11 -3
  145. package/src/css/dashboard.css +44 -0
  146. package/src/css/detail-page.css +10 -0
  147. package/src/css/index-page.css +12 -0
  148. package/src/css/kpi-card.css +15 -0
  149. package/src/schemas/app-manifest-v2.schema.json +47 -5
  150. package/src/utils/capabilityComparison.js +28 -0
  151. package/src/utils/columnFilters.js +54 -4
  152. package/src/utils/userAutocomplete.js +68 -2
  153. package/src/utils/validateManifestV2.compiled.js +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"CnNotesTab.vue3.js","sources":["../../../../src/components/CnObjectSidebar/CnNotesTab.vue?vue&type=template&id=6e7356a8&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-sidebar-tab\">\n\t\t<!-- Add / Edit note -->\n\t\t<div class=\"cn-sidebar-tab__action\">\n\t\t\t<NcRichContenteditable\n\t\t\t\tclass=\"cn-sidebar-tab__composer\"\n\t\t\t\t:modelValue=\"newNoteText\"\n\t\t\t\t:autoComplete=\"fetchMentionSuggestions\"\n\t\t\t\t:placeholder=\"addNotePlaceholder\"\n\t\t\t\tmultiline\n\t\t\t\t@update:modelValue=\"newNoteText = $event\" />\n\t\t\t<div class=\"cn-sidebar-tab__action--row\">\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"editingNoteId\"\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t@click=\"cancelEdit\">\n\t\t\t\t\t{{ cancelLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:disabled=\"!newNoteText.trim() || saving\"\n\t\t\t\t\t@click=\"editingNoteId ? saveEdit() : addNote()\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Send :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ editingNoteId ? saveLabel : addNoteLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Notes list -->\n\t\t<!-- Standalone spinner: give it an accessible name so screen readers\n\t\t announce the loading state (WCAG 1.1.1 / 4.1.2 — a bare\n\t\t NcLoadingIcon renders an unlabelled role=\"img\"). -->\n\t\t<NcLoadingIcon v-if=\"loading\" :name=\"loadingLabel\" />\n\t\t<div v-else-if=\"notes.length === 0\" class=\"cn-sidebar-tab__empty\">\n\t\t\t{{ noNotesLabel }}\n\t\t</div>\n\t\t<!-- <ul>, not <div>: NcListItem renders an <li>, which WCAG 1.3.1\n\t\t requires to be contained in a <ul>/<ol> (axe \"listitem\"). -->\n\t\t<ul v-else class=\"cn-sidebar-tab__list\">\n\t\t\t<NcListItem\n\t\t\t\tv-for=\"note in notes\"\n\t\t\t\t:key=\"note.id\"\n\t\t\t\t:name=\"note.actorDisplayName || note.author || 'Unknown'\"\n\t\t\t\t:bold=\"false\"\n\t\t\t\t:forceDisplayActions=\"true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<CommentTextOutline :size=\"32\" />\n\t\t\t\t</template>\n\t\t\t\t<template #subname>\n\t\t\t\t\t<span class=\"cn-sidebar-tab__message\">\n\t\t\t\t\t\t<template v-for=\"(segment, index) in noteSegments(note)\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"segment.type === 'mention'\"\n\t\t\t\t\t\t\t\t:key=\"`m-${note.id}-${index}`\"\n\t\t\t\t\t\t\t\tclass=\"cn-notes-tab__mention\"\n\t\t\t\t\t\t\t\t:class=\"{ 'cn-notes-tab__mention--unknown': isUnknownMention(segment.id) }\">{{ mentionDisplayName(segment.id) }}</span>\n\t\t\t\t\t\t\t<template v-else>{{ segment.value }}</template>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</span>\n\t\t\t\t</template>\n\t\t\t\t<template #details>\n\t\t\t\t\t{{ formatDate(note.creationDateTime || note.created) }}\n\t\t\t\t\t<!-- An edited note says so where its time is, because that\n\t\t\t\t\t is where a reader already looks to date what they are\n\t\t\t\t\t reading. The line names the editor, so nobody has to\n\t\t\t\t\t open the history to learn who changed it. -->\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"wasEdited(note)\"\n\t\t\t\t\t\tclass=\"cn-notes-tab__edited\"\n\t\t\t\t\t\tdata-testid=\"cn-note-edited\">{{ editedLine(note) }}</span>\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"canDelete(note) || wasEdited(note) || noteActions.length > 0\" #actions>\n\t\t\t\t\t<NcActionButton v-if=\"canDelete(note)\" @click=\"startEdit(note)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"wasEdited(note)\"\n\t\t\t\t\t\tdata-testid=\"cn-note-history-action\"\n\t\t\t\t\t\t@click=\"openHistory(note)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<HistoryIcon :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ historyLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton v-if=\"canDelete(note)\" @click=\"deleteNote(note)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<!-- The consuming app's own per-note actions, after the\n\t\t\t\t\t library's. They render inside this NcActions and emit\n\t\t\t\t\t `note-action`; nothing about what they DO lives here. -->\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-for=\"action in noteActions\"\n\t\t\t\t\t\t:key=\"`${note.id}-${action.id}`\"\n\t\t\t\t\t\t:data-testid=\"`cn-note-action-${action.id}`\"\n\t\t\t\t\t\t@click=\"$emit('note-action', { action: action.id, note })\">\n\t\t\t\t\t\t<template v-if=\"action.icon\" #icon>\n\t\t\t\t\t\t\t<component :is=\"action.icon\" :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ action.label }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcListItem>\n\t\t</ul>\n\n\t\t<CnNoteHistoryDialog\n\t\t\tv-if=\"historyNoteId\"\n\t\t\t:open=\"true\"\n\t\t\t:noteId=\"historyNoteId\"\n\t\t\t:objectId=\"objectId\"\n\t\t\t:register=\"register\"\n\t\t\t:schema=\"schema\"\n\t\t\t:apiBase=\"apiBase\"\n\t\t\t@update:open=\"historyNoteId = null\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcButton, NcListItem, NcLoadingIcon, NcRichContenteditable } from '@nextcloud/vue'\nimport CommentTextOutline from 'vue-material-design-icons/CommentTextOutline.vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport HistoryIcon from 'vue-material-design-icons/History.vue'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Send from 'vue-material-design-icons/Send.vue'\nimport CnNoteHistoryDialog from '../../dialogs/CnNoteHistoryDialog.vue'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { extractMentionedIds, parseMentions } from '../../utils/mentions.js'\nimport { searchNextcloudUsers } from '../../utils/userAutocomplete.js'\n\nexport default {\n\tname: 'CnNotesTab',\n\n\tcomponents: { NcButton, NcListItem, NcActionButton, NcLoadingIcon, NcRichContenteditable, CnNoteHistoryDialog, CommentTextOutline, Send, Pencil, Delete, HistoryIcon },\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/** Label for the add note button */\n\t\taddNoteLabel: { type: String, default: () => t('nextcloud-vue', 'Add note') },\n\t\t/** Placeholder text for the note input field */\n\t\taddNotePlaceholder: { type: String, default: () => t('nextcloud-vue', 'Write a note…') },\n\t\t/** Label for the edit action */\n\t\teditLabel: { type: String, default: () => t('nextcloud-vue', 'Edit') },\n\t\t/** Label for the save action */\n\t\tsaveLabel: { type: String, default: () => t('nextcloud-vue', 'Save') },\n\t\t/** Label for the cancel button */\n\t\tcancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** Text shown when there are no notes */\n\t\tnoNotesLabel: { type: String, default: () => t('nextcloud-vue', 'No notes yet') },\n\t\t/** Text shown while the notes are being fetched */\n\t\tloadingLabel: { type: String, default: () => t('nextcloud-vue', 'Loading notes…') },\n\t\t/** Label for the action that opens a note's earlier versions */\n\t\thistoryLabel: { type: String, default: () => t('nextcloud-vue', 'Show earlier versions') },\n\t\t// WHY THIS PROP EXISTS, since a seam nobody asked for is the kind that\n\t\t// rots. An app-specific act on ONE note had nowhere to live: this\n\t\t// component rendered edit, history and delete and offered no fourth\n\t\t// place. Dossiq sends a single case note to a neighbouring ZGW\n\t\t// register, and its endpoint, guard, route and tests were all in place\n\t\t// while no page could call any of them. Its own change wrote that down\n\t\t// as a blocker rather than declaring a prop nothing read.\n\t\t//\n\t\t// `label` stays the app's to write and translate, so nc-vue phrases\n\t\t// nothing for somebody else's domain and adds no catalogue string here.\n\t\t/**\n\t\t * Per-note actions the consuming app owns, `[{ id, label, icon? }]`.\n\t\t * Each entry renders one NcActionButton in every note's action menu,\n\t\t * after the library's own, and clicking it emits `note-action`. Empty\n\t\t * by default, and an empty list changes nothing. `icon` is optional\n\t\t * and takes an icon component.\n\t\t */\n\t\tnoteActions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t\tvalidator: (actions) => actions.every((action) => action\n\t\t\t\t&& typeof action.id === 'string' && action.id !== ''\n\t\t\t\t&& typeof action.label === 'string' && action.label !== ''),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted after a note containing at least one `@mention` was\n\t\t * successfully created or edited, with payload\n\t\t * `{ objectId, register, schema, noteId, mentionedUserIds }`.\n\t\t * nc-vue never dispatches server-side notifications itself —\n\t\t * consuming apps listen to this event and notify from their own\n\t\t * backend.\n\t\t */\n\t\t'mention',\n\t\t/**\n\t\t * Emitted when one of the consuming app's `noteActions` is clicked,\n\t\t * with payload `{ action, note }`: the entry's `id` and the whole note\n\t\t * as the backend answered it. The library does the rendering and\n\t\t * nothing else, so what the action means stays in the app.\n\t\t */\n\t\t'note-action',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tnotes: [],\n\t\t\tloading: false,\n\t\t\tnewNoteText: '',\n\t\t\tsaving: false,\n\t\t\teditingNoteId: null,\n\t\t\t/** The note whose earlier versions are open, or null. */\n\t\t\thistoryNoteId: null,\n\t\t\t/**\n\t\t\t * Per-instance cache of mentioned-user display names, keyed by\n\t\t\t * user id. `null` marks an id that could not be resolved (unknown\n\t\t\t * or deleted user) so it is only looked up once.\n\t\t\t */\n\t\t\tmentionNames: {},\n\t\t}\n\t},\n\n\twatch: {\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id) {\n\t\t\t\t\tthis.fetchNotes()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync fetchNotes() {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tthis.notes = data.results || data || []\n\t\t\t\t\tthis.resolveMentionNames()\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to fetch notes', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Supply `@mention` suggestions to NcRichContenteditable's Tribute\n\t\t * integration. Results come from the core autocomplete OCS endpoint\n\t\t * via `searchNextcloudUsers` (fail-soft: errors resolve to []).\n\t\t *\n\t\t * @param {string} search The partial id/name typed after `@`.\n\t\t * @param {(suggestions: Array<object>) => void} callback Receives the suggestion array.\n\t\t */\n\t\tasync fetchMentionSuggestions(search, callback) {\n\t\t\tconst users = await searchNextcloudUsers(search)\n\t\t\tcallback(users.map((user) => ({\n\t\t\t\tid: user.id,\n\t\t\t\tlabel: user.label,\n\t\t\t\tsubline: user.subline,\n\t\t\t\ticon: 'icon-user',\n\t\t\t\tsource: 'users',\n\t\t\t})))\n\t\t},\n\n\t\t/**\n\t\t * Parse a note's message into text/mention segments for rendering.\n\t\t *\n\t\t * @param {object} note The note object from the backend.\n\t\t * @return {Array<object>} Segments from `parseMentions`.\n\t\t */\n\t\tnoteSegments(note) {\n\t\t\tconst message = note.message || note.content || ''\n\t\t\treturn parseMentions(message)\n\t\t},\n\n\t\t/**\n\t\t * Resolve display names for every mentioned id across the current\n\t\t * notes list. Each id is looked up at most once per component\n\t\t * instance; unresolvable ids are cached as `null`.\n\t\t */\n\t\tasync resolveMentionNames() {\n\t\t\tconst ids = new Set()\n\t\t\tfor (const note of this.notes) {\n\t\t\t\tfor (const id of extractMentionedIds(note.message || note.content || '')) {\n\t\t\t\t\tids.add(id)\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait Promise.all([...ids]\n\t\t\t\t.filter((id) => !(id in this.mentionNames))\n\t\t\t\t.map(async (id) => {\n\t\t\t\t\t// Mark as pending (null) first so concurrent calls skip it.\n\t\t\t\t\tthis.mentionNames[id] = null\n\t\t\t\t\tconst results = await searchNextcloudUsers(id)\n\t\t\t\t\tconst match = results.find((user) => user.id === id)\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tthis.mentionNames[id] = match.label\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Display name for a mentioned id — the resolved label, or the raw\n\t\t * id when the user is unknown/deleted.\n\t\t *\n\t\t * @param {string} id The mentioned user id.\n\t\t * @return {string} Chip text.\n\t\t */\n\t\tmentionDisplayName(id) {\n\t\t\treturn this.mentionNames[id] || id\n\t\t},\n\n\t\t/**\n\t\t * Whether a mentioned id failed to resolve to a real user.\n\t\t *\n\t\t * @param {string} id The mentioned user id.\n\t\t * @return {boolean} True when unresolved (renders the muted chip).\n\t\t */\n\t\tisUnknownMention(id) {\n\t\t\treturn !this.mentionNames[id]\n\t\t},\n\n\t\t/**\n\t\t * Emit the `mention` notification hook for a successfully saved note.\n\t\t *\n\t\t * @param {string} savedText The note text that was persisted.\n\t\t * @param {string|null} noteId The created/edited note's id.\n\t\t */\n\t\temitMentionEvent(savedText, noteId) {\n\t\t\tconst mentionedUserIds = extractMentionedIds(savedText)\n\t\t\tif (mentionedUserIds.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$emit('mention', {\n\t\t\t\tobjectId: this.objectId,\n\t\t\t\tregister: this.register,\n\t\t\t\tschema: this.schema,\n\t\t\t\tnoteId,\n\t\t\t\tmentionedUserIds,\n\t\t\t})\n\t\t},\n\n\t\tasync addNote() {\n\t\t\tif (!this.newNoteText.trim()) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tconst savedText = this.newNoteText.trim()\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ message: savedText }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tlet noteId = null\n\t\t\t\ttry {\n\t\t\t\t\tconst created = await response.json()\n\t\t\t\t\tnoteId = (created && (created.id || (created.results && created.results.id))) || null\n\t\t\t\t} catch {\n\t\t\t\t\t// Body not JSON — the event still fires with noteId null.\n\t\t\t\t}\n\t\t\t\tthis.emitMentionEvent(savedText, noteId)\n\t\t\t\tthis.newNoteText = ''\n\t\t\t\tawait this.fetchNotes()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to add note', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tstartEdit(note) {\n\t\t\tthis.editingNoteId = note.id\n\t\t\tthis.newNoteText = note.message || note.content || ''\n\t\t},\n\n\t\tcancelEdit() {\n\t\t\tthis.editingNoteId = null\n\t\t\tthis.newNoteText = ''\n\t\t},\n\n\t\tasync saveEdit() {\n\t\t\tif (!this.newNoteText.trim() || !this.editingNoteId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tconst savedText = this.newNoteText.trim()\n\t\t\tconst noteId = this.editingNoteId\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes/${noteId}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ message: savedText }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.emitMentionEvent(savedText, noteId)\n\t\t\t\tthis.editingNoteId = null\n\t\t\t\tthis.newNoteText = ''\n\t\t\t\tawait this.fetchNotes()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to update note', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tcanDelete(note) {\n\t\t\treturn note.actorId === OC?.currentUser || note.author === OC?.currentUser\n\t\t},\n\n\t\t/**\n\t\t * Whether this note carries a history to show.\n\t\t *\n\t\t * Read off `versionCount` rather than off `editedAt`: a note edited by\n\t\t * a since-deleted account still has its prior texts, and a marker that\n\t\t * depended on the editor still existing would quietly vanish.\n\t\t *\n\t\t * @param {object} note The note from the backend.\n\t\t * @return {boolean} True when at least one earlier version exists.\n\t\t */\n\t\twasEdited(note) {\n\t\t\treturn Number(note.versionCount || 0) > 0\n\t\t},\n\n\t\t/**\n\t\t * The \"edited\" line beside a note's time.\n\t\t *\n\t\t * @param {object} note The note from the backend.\n\t\t * @return {string} The rendered line.\n\t\t */\n\t\teditedLine(note) {\n\t\t\tconst editor = note.editedByDisplayName || note.editedBy\n\t\t\tif (!editor) {\n\t\t\t\treturn t('nextcloud-vue', 'Edited')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'Edited by {editor}', { editor })\n\t\t},\n\n\t\t/**\n\t\t * Open the earlier versions of one note.\n\t\t *\n\t\t * @param {object} note The note to open.\n\t\t */\n\t\topenHistory(note) {\n\t\t\tthis.historyNoteId = note.id\n\t\t},\n\n\t\tasync deleteNote(note) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes/${note.id}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.notes = this.notes.filter((n) => n.id !== note.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to delete note', err)\n\t\t\t}\n\t\t},\n\n\t\tformatDate(dateStr) {\n\t\t\tif (!dateStr) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Date(dateStr).toLocaleString(undefined, {\n\t\t\t\t\tyear: 'numeric',\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\thour: '2-digit',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\treturn dateStr\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab { padding: 12px; }\n\n.cn-sidebar-tab__action { margin-bottom: 16px; }\n\n.cn-sidebar-tab__action--row { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }\n\n.cn-sidebar-tab__composer {\n\twidth: 100%;\n}\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }\n\n.cn-notes-tab__mention {\n\tdisplay: inline-block;\n\tpadding: 0 6px;\n\tborder-radius: var(--border-radius-pill, 100px);\n\tbackground-color: var(--color-primary-element-light);\n\tcolor: var(--color-main-text);\n\tfont-weight: bold;\n}\n\n.cn-notes-tab__edited {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-inline-start: 6px;\n\tfont-style: italic;\n}\n\n.cn-notes-tab__mention--unknown {\n\topacity: 0.6;\n\tfont-weight: normal;\n}\n</style>\n"],"names":["_createElementVNode","_createVNode","_createBlock","_toDisplayString","_createElementBlock","_Fragment","_renderList","_createTextVNode","_openBlock","_resolveDynamicComponent"],"mappings":";;AAWM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,gBAAgB,GAAA;AAErB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAuB,GAAA;AAQ5B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,6BAAO,GAAA;;;AAwBiB,EAAA,KAAG,EAAA,uBAAA;;;;AAK5B,EAAA,KAAG,EAAA,sBAAA;;AAWL,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAmB,GAAA;;;AAmB9B,EAAA,KAAK,EAAC,sBAAS;AACd,EAAA,aAAU,EAAC,gBAAS;;;;;;;;;;;;;;;;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A,CAAA,QAAA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnNotesTab.vue3.js","sources":["../../../../src/components/CnObjectSidebar/CnNotesTab.vue?vue&type=template&id=6e7356a8&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-sidebar-tab\">\n\t\t<!-- Add / Edit note -->\n\t\t<div class=\"cn-sidebar-tab__action\">\n\t\t\t<NcRichContenteditable\n\t\t\t\tclass=\"cn-sidebar-tab__composer\"\n\t\t\t\t:modelValue=\"newNoteText\"\n\t\t\t\t:autoComplete=\"fetchMentionSuggestions\"\n\t\t\t\t:placeholder=\"addNotePlaceholder\"\n\t\t\t\tmultiline\n\t\t\t\t@update:modelValue=\"newNoteText = $event\" />\n\t\t\t<div class=\"cn-sidebar-tab__action--row\">\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"editingNoteId\"\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t@click=\"cancelEdit\">\n\t\t\t\t\t{{ cancelLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:disabled=\"!newNoteText.trim() || saving\"\n\t\t\t\t\t@click=\"editingNoteId ? saveEdit() : addNote()\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Send :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ editingNoteId ? saveLabel : addNoteLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!-- Notes list -->\n\t\t<!-- Standalone spinner: give it an accessible name so screen readers\n\t\t announce the loading state (WCAG 1.1.1 / 4.1.2 — a bare\n\t\t NcLoadingIcon renders an unlabelled role=\"img\"). -->\n\t\t<NcLoadingIcon v-if=\"loading\" :name=\"loadingLabel\" />\n\t\t<div v-else-if=\"notes.length === 0\" class=\"cn-sidebar-tab__empty\">\n\t\t\t{{ noNotesLabel }}\n\t\t</div>\n\t\t<!-- <ul>, not <div>: NcListItem renders an <li>, which WCAG 1.3.1\n\t\t requires to be contained in a <ul>/<ol> (axe \"listitem\"). -->\n\t\t<ul v-else class=\"cn-sidebar-tab__list\">\n\t\t\t<NcListItem\n\t\t\t\tv-for=\"note in notes\"\n\t\t\t\t:key=\"note.id\"\n\t\t\t\t:name=\"note.actorDisplayName || note.author || 'Unknown'\"\n\t\t\t\t:bold=\"false\"\n\t\t\t\t:forceDisplayActions=\"true\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<CommentTextOutline :size=\"32\" />\n\t\t\t\t</template>\n\t\t\t\t<template #subname>\n\t\t\t\t\t<span class=\"cn-sidebar-tab__message\">\n\t\t\t\t\t\t<template v-for=\"(segment, index) in noteSegments(note)\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"segment.type === 'mention'\"\n\t\t\t\t\t\t\t\t:key=\"`m-${note.id}-${index}`\"\n\t\t\t\t\t\t\t\tclass=\"cn-notes-tab__mention\"\n\t\t\t\t\t\t\t\t:class=\"{ 'cn-notes-tab__mention--unknown': isUnknownMention(segment.id) }\">{{ mentionDisplayName(segment.id) }}</span>\n\t\t\t\t\t\t\t<template v-else>{{ segment.value }}</template>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</span>\n\t\t\t\t</template>\n\t\t\t\t<template #details>\n\t\t\t\t\t{{ formatDate(note.creationDateTime || note.created) }}\n\t\t\t\t\t<!-- An edited note says so where its time is, because that\n\t\t\t\t\t is where a reader already looks to date what they are\n\t\t\t\t\t reading. The line names the editor, so nobody has to\n\t\t\t\t\t open the history to learn who changed it. -->\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"wasEdited(note)\"\n\t\t\t\t\t\tclass=\"cn-notes-tab__edited\"\n\t\t\t\t\t\tdata-testid=\"cn-note-edited\">{{ editedLine(note) }}</span>\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"canDelete(note) || wasEdited(note) || noteActions.length > 0\" #actions>\n\t\t\t\t\t<NcActionButton v-if=\"canDelete(note)\" @click=\"startEdit(note)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Pencil :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ editLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-if=\"wasEdited(note)\"\n\t\t\t\t\t\tdata-testid=\"cn-note-history-action\"\n\t\t\t\t\t\t@click=\"openHistory(note)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<HistoryIcon :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ historyLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<NcActionButton v-if=\"canDelete(note)\" @click=\"deleteNote(note)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t<!-- The consuming app's own per-note actions, after the\n\t\t\t\t\t library's. They render inside this NcActions and emit\n\t\t\t\t\t `note-action`; nothing about what they DO lives here. -->\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-for=\"action in noteActions\"\n\t\t\t\t\t\t:key=\"`${note.id}-${action.id}`\"\n\t\t\t\t\t\t:data-testid=\"`cn-note-action-${action.id}`\"\n\t\t\t\t\t\t@click=\"$emit('note-action', { action: action.id, note })\">\n\t\t\t\t\t\t<template v-if=\"action.icon\" #icon>\n\t\t\t\t\t\t\t<component :is=\"action.icon\" :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ action.label }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcListItem>\n\t\t</ul>\n\n\t\t<CnNoteHistoryDialog\n\t\t\tv-if=\"historyNoteId\"\n\t\t\t:open=\"true\"\n\t\t\t:noteId=\"historyNoteId\"\n\t\t\t:objectId=\"objectId\"\n\t\t\t:register=\"register\"\n\t\t\t:schema=\"schema\"\n\t\t\t:apiBase=\"apiBase\"\n\t\t\t@update:open=\"historyNoteId = null\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcButton, NcListItem, NcLoadingIcon, NcRichContenteditable } from '@nextcloud/vue'\nimport CommentTextOutline from 'vue-material-design-icons/CommentTextOutline.vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport HistoryIcon from 'vue-material-design-icons/History.vue'\nimport Pencil from 'vue-material-design-icons/Pencil.vue'\nimport Send from 'vue-material-design-icons/Send.vue'\nimport CnNoteHistoryDialog from '../../dialogs/CnNoteHistoryDialog.vue'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { extractMentionedIds, parseMentions } from '../../utils/mentions.js'\nimport { searchNextcloudUsers } from '../../utils/userAutocomplete.js'\n\nexport default {\n\tname: 'CnNotesTab',\n\n\tcomponents: { NcButton, NcListItem, NcActionButton, NcLoadingIcon, NcRichContenteditable, CnNoteHistoryDialog, CommentTextOutline, Send, Pencil, Delete, HistoryIcon },\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/** Label for the add note button */\n\t\taddNoteLabel: { type: String, default: () => t('nextcloud-vue', 'Add note') },\n\t\t/** Placeholder text for the note input field */\n\t\taddNotePlaceholder: { type: String, default: () => t('nextcloud-vue', 'Write a note…') },\n\t\t/** Label for the edit action */\n\t\teditLabel: { type: String, default: () => t('nextcloud-vue', 'Edit') },\n\t\t/** Label for the save action */\n\t\tsaveLabel: { type: String, default: () => t('nextcloud-vue', 'Save') },\n\t\t/** Label for the cancel button */\n\t\tcancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** Text shown when there are no notes */\n\t\tnoNotesLabel: { type: String, default: () => t('nextcloud-vue', 'No notes yet') },\n\t\t/** Text shown while the notes are being fetched */\n\t\tloadingLabel: { type: String, default: () => t('nextcloud-vue', 'Loading notes…') },\n\t\t/** Label for the action that opens a note's earlier versions */\n\t\thistoryLabel: { type: String, default: () => t('nextcloud-vue', 'Show earlier versions') },\n\t\t// WHY THIS PROP EXISTS, since a seam nobody asked for is the kind that\n\t\t// rots. An app-specific act on ONE note had nowhere to live: this\n\t\t// component rendered edit, history and delete and offered no fourth\n\t\t// place. Dossiq sends a single case note to a neighbouring ZGW\n\t\t// register, and its endpoint, guard, route and tests were all in place\n\t\t// while no page could call any of them. Its own change wrote that down\n\t\t// as a blocker rather than declaring a prop nothing read.\n\t\t//\n\t\t// `label` stays the app's to write and translate, so nc-vue phrases\n\t\t// nothing for somebody else's domain and adds no catalogue string here.\n\t\t/**\n\t\t * Per-note actions the consuming app owns, `[{ id, label, icon? }]`.\n\t\t * Each entry renders one NcActionButton in every note's action menu,\n\t\t * after the library's own, and clicking it emits `note-action`. Empty\n\t\t * by default, and an empty list changes nothing. `icon` is optional\n\t\t * and takes an icon component.\n\t\t */\n\t\tnoteActions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t\tvalidator: (actions) => actions.every((action) => action\n\t\t\t\t&& typeof action.id === 'string' && action.id !== ''\n\t\t\t\t&& typeof action.label === 'string' && action.label !== ''),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted after a note containing at least one `@mention` was\n\t\t * successfully created or edited, with payload\n\t\t * `{ objectId, register, schema, noteId, mentionedUserIds }`.\n\t\t * nc-vue never dispatches server-side notifications itself —\n\t\t * consuming apps listen to this event and notify from their own\n\t\t * backend.\n\t\t */\n\t\t'mention',\n\t\t/**\n\t\t * Emitted when one of the consuming app's `noteActions` is clicked,\n\t\t * with payload `{ action, note }`: the entry's `id` and the whole note\n\t\t * as the backend answered it. The library does the rendering and\n\t\t * nothing else, so what the action means stays in the app.\n\t\t */\n\t\t'note-action',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tnotes: [],\n\t\t\tloading: false,\n\t\t\tnewNoteText: '',\n\t\t\tsaving: false,\n\t\t\teditingNoteId: null,\n\t\t\t/** The note whose earlier versions are open, or null. */\n\t\t\thistoryNoteId: null,\n\t\t\t/**\n\t\t\t * Per-instance cache of mentioned-user display names, keyed by\n\t\t\t * user id. `null` marks an id that could not be resolved (unknown\n\t\t\t * or deleted user) so it is only looked up once.\n\t\t\t */\n\t\t\tmentionNames: {},\n\t\t}\n\t},\n\n\twatch: {\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id) {\n\t\t\t\t\tthis.fetchNotes()\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync fetchNotes() {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tthis.notes = data.results || data || []\n\t\t\t\t\tthis.resolveMentionNames()\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to fetch notes', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Supply `@mention` suggestions to NcRichContenteditable's Tribute\n\t\t * integration. Results come from the core autocomplete OCS endpoint\n\t\t * via `searchNextcloudUsers` (fail-soft: errors resolve to []).\n\t\t *\n\t\t * @param {string} search The partial id/name typed after `@`.\n\t\t * @param {(suggestions: Array<object>) => void} callback Receives the suggestion array.\n\t\t */\n\t\tasync fetchMentionSuggestions(search, callback) {\n\t\t\tconst users = await searchNextcloudUsers(search, { includeCurrentUser: false })\n\t\t\tcallback(users.map((user) => ({\n\t\t\t\tid: user.id,\n\t\t\t\tlabel: user.label,\n\t\t\t\tsubline: user.subline,\n\t\t\t\ticon: 'icon-user',\n\t\t\t\tsource: 'users',\n\t\t\t})))\n\t\t},\n\n\t\t/**\n\t\t * Parse a note's message into text/mention segments for rendering.\n\t\t *\n\t\t * @param {object} note The note object from the backend.\n\t\t * @return {Array<object>} Segments from `parseMentions`.\n\t\t */\n\t\tnoteSegments(note) {\n\t\t\tconst message = note.message || note.content || ''\n\t\t\treturn parseMentions(message)\n\t\t},\n\n\t\t/**\n\t\t * Resolve display names for every mentioned id across the current\n\t\t * notes list. Each id is looked up at most once per component\n\t\t * instance; unresolvable ids are cached as `null`.\n\t\t */\n\t\tasync resolveMentionNames() {\n\t\t\tconst ids = new Set()\n\t\t\tfor (const note of this.notes) {\n\t\t\t\tfor (const id of extractMentionedIds(note.message || note.content || '')) {\n\t\t\t\t\tids.add(id)\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait Promise.all([...ids]\n\t\t\t\t.filter((id) => !(id in this.mentionNames))\n\t\t\t\t.map(async (id) => {\n\t\t\t\t\t// Mark as pending (null) first so concurrent calls skip it.\n\t\t\t\t\tthis.mentionNames[id] = null\n\t\t\t\t\tconst results = await searchNextcloudUsers(id)\n\t\t\t\t\tconst match = results.find((user) => user.id === id)\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\tthis.mentionNames[id] = match.label\n\t\t\t\t\t}\n\t\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Display name for a mentioned id — the resolved label, or the raw\n\t\t * id when the user is unknown/deleted.\n\t\t *\n\t\t * @param {string} id The mentioned user id.\n\t\t * @return {string} Chip text.\n\t\t */\n\t\tmentionDisplayName(id) {\n\t\t\treturn this.mentionNames[id] || id\n\t\t},\n\n\t\t/**\n\t\t * Whether a mentioned id failed to resolve to a real user.\n\t\t *\n\t\t * @param {string} id The mentioned user id.\n\t\t * @return {boolean} True when unresolved (renders the muted chip).\n\t\t */\n\t\tisUnknownMention(id) {\n\t\t\treturn !this.mentionNames[id]\n\t\t},\n\n\t\t/**\n\t\t * Emit the `mention` notification hook for a successfully saved note.\n\t\t *\n\t\t * @param {string} savedText The note text that was persisted.\n\t\t * @param {string|null} noteId The created/edited note's id.\n\t\t */\n\t\temitMentionEvent(savedText, noteId) {\n\t\t\tconst mentionedUserIds = extractMentionedIds(savedText)\n\t\t\tif (mentionedUserIds.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$emit('mention', {\n\t\t\t\tobjectId: this.objectId,\n\t\t\t\tregister: this.register,\n\t\t\t\tschema: this.schema,\n\t\t\t\tnoteId,\n\t\t\t\tmentionedUserIds,\n\t\t\t})\n\t\t},\n\n\t\tasync addNote() {\n\t\t\tif (!this.newNoteText.trim()) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tconst savedText = this.newNoteText.trim()\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ message: savedText }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tlet noteId = null\n\t\t\t\ttry {\n\t\t\t\t\tconst created = await response.json()\n\t\t\t\t\tnoteId = (created && (created.id || (created.results && created.results.id))) || null\n\t\t\t\t} catch {\n\t\t\t\t\t// Body not JSON — the event still fires with noteId null.\n\t\t\t\t}\n\t\t\t\tthis.emitMentionEvent(savedText, noteId)\n\t\t\t\tthis.newNoteText = ''\n\t\t\t\tawait this.fetchNotes()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to add note', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tstartEdit(note) {\n\t\t\tthis.editingNoteId = note.id\n\t\t\tthis.newNoteText = note.message || note.content || ''\n\t\t},\n\n\t\tcancelEdit() {\n\t\t\tthis.editingNoteId = null\n\t\t\tthis.newNoteText = ''\n\t\t},\n\n\t\tasync saveEdit() {\n\t\t\tif (!this.newNoteText.trim() || !this.editingNoteId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tconst savedText = this.newNoteText.trim()\n\t\t\tconst noteId = this.editingNoteId\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes/${noteId}`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\t\theaders: buildHeaders(),\n\t\t\t\t\t\tbody: JSON.stringify({ message: savedText }),\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tthis.emitMentionEvent(savedText, noteId)\n\t\t\t\tthis.editingNoteId = null\n\t\t\t\tthis.newNoteText = ''\n\t\t\t\tawait this.fetchNotes()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to update note', err)\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\tcanDelete(note) {\n\t\t\treturn note.actorId === OC?.currentUser || note.author === OC?.currentUser\n\t\t},\n\n\t\t/**\n\t\t * Whether this note carries a history to show.\n\t\t *\n\t\t * Read off `versionCount` rather than off `editedAt`: a note edited by\n\t\t * a since-deleted account still has its prior texts, and a marker that\n\t\t * depended on the editor still existing would quietly vanish.\n\t\t *\n\t\t * @param {object} note The note from the backend.\n\t\t * @return {boolean} True when at least one earlier version exists.\n\t\t */\n\t\twasEdited(note) {\n\t\t\treturn Number(note.versionCount || 0) > 0\n\t\t},\n\n\t\t/**\n\t\t * The \"edited\" line beside a note's time.\n\t\t *\n\t\t * @param {object} note The note from the backend.\n\t\t * @return {string} The rendered line.\n\t\t */\n\t\teditedLine(note) {\n\t\t\tconst editor = note.editedByDisplayName || note.editedBy\n\t\t\tif (!editor) {\n\t\t\t\treturn t('nextcloud-vue', 'Edited')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'Edited by {editor}', { editor })\n\t\t},\n\n\t\t/**\n\t\t * Open the earlier versions of one note.\n\t\t *\n\t\t * @param {object} note The note to open.\n\t\t */\n\t\topenHistory(note) {\n\t\t\tthis.historyNoteId = note.id\n\t\t},\n\n\t\tasync deleteNote(note) {\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/notes/${note.id}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.notes = this.notes.filter((n) => n.id !== note.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnNotesTab: Failed to delete note', err)\n\t\t\t}\n\t\t},\n\n\t\tformatDate(dateStr) {\n\t\t\tif (!dateStr) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Date(dateStr).toLocaleString(undefined, {\n\t\t\t\t\tyear: 'numeric',\n\t\t\t\t\tmonth: 'short',\n\t\t\t\t\tday: 'numeric',\n\t\t\t\t\thour: '2-digit',\n\t\t\t\t\tminute: '2-digit',\n\t\t\t\t})\n\t\t\t} catch {\n\t\t\t\treturn dateStr\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab { padding: 12px; }\n\n.cn-sidebar-tab__action { margin-bottom: 16px; }\n\n.cn-sidebar-tab__action--row { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }\n\n.cn-sidebar-tab__composer {\n\twidth: 100%;\n}\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }\n\n.cn-notes-tab__mention {\n\tdisplay: inline-block;\n\tpadding: 0 6px;\n\tborder-radius: var(--border-radius-pill, 100px);\n\tbackground-color: var(--color-primary-element-light);\n\tcolor: var(--color-main-text);\n\tfont-weight: bold;\n}\n\n.cn-notes-tab__edited {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-inline-start: 6px;\n\tfont-style: italic;\n}\n\n.cn-notes-tab__mention--unknown {\n\topacity: 0.6;\n\tfont-weight: normal;\n}\n</style>\n"],"names":["_createElementVNode","_createVNode","_createBlock","_toDisplayString","_createElementBlock","_Fragment","_renderList","_createTextVNode","_openBlock","_resolveDynamicComponent"],"mappings":";;AAWM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,gBAAgB,GAAA;AAErB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAuB,GAAA;AAQ5B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,6BAAO,GAAA;;;AAwBiB,EAAA,KAAG,EAAA,uBAAA;;;;AAK5B,EAAA,KAAG,EAAA,sBAAA;;AAWL,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAmB,GAAA;;;AAmB9B,EAAA,KAAK,EAAC,sBAAS;AACd,EAAA,aAAU,EAAC,gBAAS;;;;;;;;;;;;;;;;;AApEvB,IAAAA,kBAAA,CAyBI,OAzBJ,UAyBI,EAAA;MAxBJ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file":"CnSetupWizard.vue2.js","sources":["../../../../src/components/CnSetupWizard/CnSetupWizard.vue"],"sourcesContent":["<!-- SPDX-License-Identifier: EUPL-1.2 -->\n<!-- SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl> -->\n<template>\n\t<CnWizardDialog\n\t\tref=\"wizard\"\n\t\t:steps=\"wizardSteps\"\n\t\t:dialogTitle=\"resolvedDialogTitle\"\n\t\t:submitLabel=\"submitLabel\"\n\t\t:cancelLabel=\"cancelLabel\"\n\t\t:nextLabel=\"nextLabel\"\n\t\t:backLabel=\"backLabel\"\n\t\t:successText=\"successText\"\n\t\t:validate=\"validateStep\"\n\t\t:cancellable=\"cancellable\"\n\t\t:initialStep=\"dependencyBlocked ? '' : initialStepId\"\n\t\t:nextDisabled=\"dependencyBlocked\"\n\t\t@stepChange=\"onStepChange\"\n\t\t@submit=\"onSubmit\"\n\t\t@close=\"onClose\">\n\t\t<!-- This `<template v-for>` defines dynamic SLOTS, not a rendered list.\n\t\t `@vue/compiler-sfc` DISCARDS a `:key` on a slot-defining\n\t\t `<template>` (verified against the generated `createSlots` call)\n\t\t and honours it only on the child, so the rule's advice is inverted\n\t\t here — moving the key up would throw it away. -->\n\t\t<!-- A required app is missing: this is the only step, and Next stays\n\t\t disabled until the app is there. -->\n\t\t<template v-if=\"dependencyBlocked\" #[dependencyStepSlot]>\n\t\t\t<div class=\"cn-setup-step\" data-step-type=\"dependencies\" data-testid=\"cn-setup-dependencies\">\n\t\t\t\t<NcNoteCard type=\"warning\">\n\t\t\t\t\t{{ dependencyBlockedText }}\n\t\t\t\t</NcNoteCard>\n\t\t\t\t<CnLeafDependencySettings\n\t\t\t\t\t:appId=\"appId\"\n\t\t\t\t\t:dependencies=\"dependencyEntries\"\n\t\t\t\t\t:isAdmin=\"isAdmin\"\n\t\t\t\t\t:sectionName=\"dependencySectionName\"\n\t\t\t\t\tsectionDescription=\"\"\n\t\t\t\t\t@installed=\"onDependencyInstalled\" />\n\t\t\t</div>\n\t\t</template>\n\t\t<!-- eslint-disable vue/no-v-for-template-key-on-child -->\n\t\t<template v-for=\"step in setupSteps\" #[stepSlot(step)]=\"scope\">\n\t\t\t<div :key=\"step.id\" class=\"cn-setup-step\" :data-step-type=\"step.type\">\n\t\t\t\t<!-- Optional apps that are missing never block, but the admin\n\t\t\t\t reads about them once, on the first step. -->\n\t\t\t\t<NcNoteCard\n\t\t\t\t\tv-if=\"step.id === firstStepId && missingOptional.length > 0\"\n\t\t\t\t\ttype=\"info\"\n\t\t\t\t\tdata-testid=\"cn-setup-optional-dependencies\">\n\t\t\t\t\t{{ optionalMissingText }}\n\t\t\t\t</NcNoteCard>\n\t\t\t\t<!-- @slot step-{id} Override a step's body (for `component` steps or\n\t\t\t\t any bespoke step). Scope: the CnWizardDialog step scope plus\n\t\t\t\t `{ step, runAction, saveConfig }`. -->\n\t\t\t\t<slot\n\t\t\t\t\tv-if=\"hasCustomSlot(step.id)\"\n\t\t\t\t\t:name=\"stepSlot(step)\"\n\t\t\t\t\tv-bind=\"scope\"\n\t\t\t\t\t:step=\"step\"\n\t\t\t\t\t:runAction=\"() => runAction(step)\"\n\t\t\t\t\t:saveConfig=\"(patch) => saveConfig(patch)\" />\n\n\t\t\t\t<!-- info -->\n\t\t\t\t<template v-else-if=\"step.type === 'info'\">\n\t\t\t\t\t<NcNoteCard type=\"info\" :heading=\"stepTitle(step)\">\n\t\t\t\t\t\t{{ stepBody(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t</template>\n\n\t\t\t\t<!-- choice -->\n\t\t\t\t<template v-else-if=\"step.type === 'choice'\">\n\t\t\t\t\t<NcNoteCard v-if=\"step.body\" type=\"info\">\n\t\t\t\t\t\t{{ stepBody(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t\t<CnChoiceCards\n\t\t\t\t\t\tv-if=\"isCardChoice(step)\"\n\t\t\t\t\t\t:label=\"stepTitle(step)\"\n\t\t\t\t\t\t:options=\"optionsFor(step)\"\n\t\t\t\t\t\t:multiple=\"step.multiple === true\"\n\t\t\t\t\t\t:disabled=\"isChoiceDisabled(step)\"\n\t\t\t\t\t\t:loading=\"isOptionsLoading(step)\"\n\t\t\t\t\t\t:modelValue=\"cardModel(step)\"\n\t\t\t\t\t\t@update:modelValue=\"(v) => onChoice(step, v)\">\n\t\t\t\t\t\t<!-- `loadAction`: every dataset card except \"none\" loads\n\t\t\t\t\t\t itself, so no separate run-action step is needed. -->\n\t\t\t\t\t\t<template v-if=\"step.loadAction\" #option-actions=\"{ option }\">\n\t\t\t\t\t\t\t<template v-if=\"isLoadableOption(step, option)\">\n\t\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t:disabled=\"isDatasetLoading(step, option)\"\n\t\t\t\t\t\t\t\t\t:aria-label=\"loadAriaLabel(option)\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-setup-load-dataset\"\n\t\t\t\t\t\t\t\t\t@click=\"loadDataset(step, option)\">\n\t\t\t\t\t\t\t\t\t<template v-if=\"isDatasetLoading(step, option)\" #icon>\n\t\t\t\t\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t\t{{ loadButtonLabel(step, option) }}\n\t\t\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\t\tv-if=\"datasetResultFor(step, option)\"\n\t\t\t\t\t\t\t\t\trole=\"status\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-setup-load-result\"\n\t\t\t\t\t\t\t\t\t:class=\"datasetResultFor(step, option).success ? 'cn-setup-load-result--success' : 'cn-setup-load-result--error'\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-setup-load-result\">\n\t\t\t\t\t\t\t\t\t{{ datasetResultFor(step, option).message }}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</CnChoiceCards>\n\t\t\t\t\t<NcSelect\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\t:inputLabel=\"stepTitle(step)\"\n\t\t\t\t\t\t:options=\"optionsFor(step)\"\n\t\t\t\t\t\t:multiple=\"step.multiple === true\"\n\t\t\t\t\t\t:disabled=\"isChoiceDisabled(step)\"\n\t\t\t\t\t\tlabel=\"label\"\n\t\t\t\t\t\t:modelValue=\"choiceModel[step.id]\"\n\t\t\t\t\t\t@update:modelValue=\"(v) => onChoice(step, v)\" />\n\t\t\t\t\t<NcNoteCard v-if=\"isChoiceDisabled(step)\" type=\"warning\">\n\t\t\t\t\t\t{{ dependsOnHint(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t</template>\n\n\t\t\t\t<!-- config-fields -->\n\t\t\t\t<template v-else-if=\"step.type === 'config-fields'\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"field in fieldsFor(step)\"\n\t\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\t\tclass=\"cn-setup-field\">\n\t\t\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\t\t\tv-if=\"field.widget === 'checkbox'\"\n\t\t\t\t\t\t\t:modelValue=\"!!configModel[field.key]\"\n\t\t\t\t\t\t\t@update:modelValue=\"(v) => configModel[field.key] = v\">\n\t\t\t\t\t\t\t{{ field.label }}\n\t\t\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t\t\t<NcSelect\n\t\t\t\t\t\t\tv-else-if=\"field.widget === 'select'\"\n\t\t\t\t\t\t\t:inputLabel=\"field.label\"\n\t\t\t\t\t\t\t:options=\"field.enum || []\"\n\t\t\t\t\t\t\t:modelValue=\"configModel[field.key]\"\n\t\t\t\t\t\t\t@update:modelValue=\"(v) => configModel[field.key] = v\" />\n\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\tv-else\n\t\t\t\t\t\t\t:label=\"field.label\"\n\t\t\t\t\t\t\t:type=\"field.widget === 'number' ? 'number' : 'text'\"\n\t\t\t\t\t\t\t:modelValue=\"configModel[field.key] != null ? String(configModel[field.key]) : ''\"\n\t\t\t\t\t\t\t@update:modelValue=\"(v) => configModel[field.key] = v\" />\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\n\t\t\t\t<!-- run-action -->\n\t\t\t\t<template v-else-if=\"step.type === 'run-action'\">\n\t\t\t\t\t<NcNoteCard v-if=\"step.body\" type=\"info\">\n\t\t\t\t\t\t{{ stepBody(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t\t<!-- The action starts automatically on entering this step\n\t\t\t\t\t (see `maybeAutoRunStep`), so the default state is the\n\t\t\t\t\t spinner, not an idle button. -->\n\t\t\t\t\t<div v-if=\"running[step.id]\" class=\"cn-setup-step__running\">\n\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t\t<span>{{ runningLabel }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t<NcNoteCard\n\t\t\t\t\t\t\tv-if=\"actionResult[step.id]\"\n\t\t\t\t\t\t\t:type=\"actionResult[step.id].success ? 'success' : 'error'\">\n\t\t\t\t\t\t\t{{ actionResult[step.id].message }}\n\t\t\t\t\t\t</NcNoteCard>\n\t\t\t\t\t\t<div class=\"cn-setup-step__nav\">\n\t\t\t\t\t\t\t<NcButton :variant=\"actionResult[step.id] ? 'secondary' : 'primary'\" @click=\"runAction(step)\">\n\t\t\t\t\t\t\t\t{{ actionResult[step.id] ? rerunLabel : runLabel }}\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</template>\n\n\t\t\t\t<!-- summary -->\n\t\t\t\t<template v-else-if=\"step.type === 'summary'\">\n\t\t\t\t\t<NcNoteCard v-if=\"step.body\" type=\"info\">\n\t\t\t\t\t\t{{ stepBody(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t\t<ul class=\"cn-setup-summary\">\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tv-for=\"item in summaryItems\"\n\t\t\t\t\t\t\t:key=\"item.id\"\n\t\t\t\t\t\t\tclass=\"cn-setup-summary__item\"\n\t\t\t\t\t\t\t:class=\"{ 'cn-setup-summary__item--done': item.done, 'cn-setup-summary__item--not-run': item.notRun }\">\n\t\t\t\t\t\t\t<span class=\"cn-setup-summary__mark\">{{ item.done ? '✓' : '○' }}</span>\n\t\t\t\t\t\t\t<span class=\"cn-setup-summary__label\">{{ item.title }}</span>\n\t\t\t\t\t\t\t<span v-if=\"item.value\" class=\"cn-setup-summary__value\">{{ item.value }}</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</template>\n\t\t\t</div>\n\t\t</template>\n\t\t<!-- eslint-enable vue/no-v-for-template-key-on-child -->\n\t</CnWizardDialog>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcNoteCard, NcSelect, NcTextField } from '@nextcloud/vue'\nimport CnChoiceCards from '../CnChoiceCards/CnChoiceCards.vue'\nimport CnLeafDependencySettings from '../CnLeafDependencySettings/CnLeafDependencySettings.vue'\nimport CnWizardDialog from '../CnWizardDialog/CnWizardDialog.vue'\nimport { checkDependencies, isDependencyResolved, missingRequiredApps, readServerAppStatuses } from '../../composables/useDependencyCheck.js'\nimport { useSetupStatus } from '../../composables/useSetupStatus.js'\nimport { fieldsFromSchema } from '../../utils/schema.js'\n\n/** Id of the synthetic step shown while a required app is missing. */\nconst DEPENDENCY_STEP_ID = 'cn-setup-dependencies'\n\n/** The dataset value that means \"seed nothing\"; it never gets a Load button. */\nconst NONE_DATASET = 'none'\n\n/**\n * CnSetupWizard — abstract, manifest-driven first-time setup wizard (ADR-042).\n *\n * Wraps {@link CnWizardDialog} and renders a `manifest.setup.steps[]` array by\n * each step's `type`: `info` (note), `config-fields` (fields from a JSON Schema\n * via `fieldsFromSchema`, the same field shapes the admin pages use), `choice`\n * (`NcSelect` persisting to an app-config key), `run-action` (POST a privileged\n * server action), `summary` (recap), and `component` (a parent-provided\n * `#step-<id>` slot). It NEVER writes OpenRegister objects from the browser —\n * all persistence goes through the per-app setup contract\n * (`POST /apps/{appId}/api/setup/config` and `/api/setup/action/{actionId}`).\n *\n * Mount it gated by `CnAppRoot`'s setup phase, or open it on demand from\n * `CnAdminSettingsShell`.\n *\n * ```vue\n * <CnSetupWizard\n * :app-id=\"'procest'\"\n * :steps=\"manifest.setup.steps\"\n * @complete=\"onSetupComplete\"\n * @close=\"showWizard = false\" />\n * ```\n */\nexport default {\n\tname: 'CnSetupWizard',\n\n\tcomponents: {\n\t\tCnWizardDialog,\n\t\tCnChoiceCards,\n\t\tCnLeafDependencySettings,\n\t\tNcButton,\n\t\tNcNoteCard,\n\t\tNcSelect,\n\t\tNcTextField,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcLoadingIcon,\n\t},\n\n\tinject: {\n\t\t/**\n\t\t * Consumer translation function, provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). Step field\n\t\t * labels come from schema property titles, authored in English as the\n\t\t * canonical source; the visible label is resolved through this function\n\t\t * so it follows the user's language. Defaults to identity when used\n\t\t * standalone (no CnAppRoot ancestor).\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/**\n\t\t * The app manifest, provided by CnAppRoot. Read only for its\n\t\t * `dependencies` when the `dependencies` prop is empty.\n\t\t */\n\t\tcnManifest: { default: null },\n\t},\n\n\tprops: {\n\t\t/** The Nextcloud app id; used to build the `/apps/{appId}/api/setup/*` URLs. */\n\t\tappId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** The `manifest.setup.steps` array to render. */\n\t\tsteps: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** Dialog title. Overridden by `appName` when that prop is set. */\n\t\tdialogTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Set up this app'),\n\t\t},\n\n\t\t/**\n\t\t * The app's human-readable display name. When set, the dialog title\n\t\t * becomes \"Set up {appName}\" instead of the generic `dialogTitle`\n\t\t * default — pass the same display name CnAppRoot already resolves\n\t\t * (`appDisplayName || manifest.name || appId`).\n\t\t */\n\t\tappName: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Final-step submit button label. */\n\t\tsubmitLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Finish'),\n\t\t},\n\n\t\t/** Cancel button label. */\n\t\tcancelLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Cancel'),\n\t\t},\n\n\t\t/** Next button label. */\n\t\tnextLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Next'),\n\t\t},\n\n\t\t/** Back button label. */\n\t\tbackLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Back'),\n\t\t},\n\n\t\t/** Run-action button label (shown before the first automatic run). */\n\t\trunLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Run'),\n\t\t},\n\n\t\t/** Run-action button label offered after a run already finished. */\n\t\trerunLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Run again'),\n\t\t},\n\n\t\t/** Label shown next to the spinner while a run-action step is running. */\n\t\trunningLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Loading…'),\n\t\t},\n\n\t\t/** Result-phase success text. */\n\t\tsuccessText: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Setup complete.'),\n\t\t},\n\n\t\t/**\n\t\t * Whether the wizard can be dismissed before finishing (Cancel\n\t\t * button, ESC, backdrop click). Pass `false` when a REQUIRED step\n\t\t * is unmet and the host is gating its shell behind this wizard\n\t\t * (ADR-042) — an offered-but-non-functional Cancel would be\n\t\t * misleading. Optional-only setup stays cancellable (default).\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tcancellable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Ids of steps the SERVER already reports as done (e.g.\n\t\t * `useSetupStatus(...).steps` filtered to `done === true`), passed by\n\t\t * the host so a freshly (re)mounted wizard doesn't re-ask something\n\t\t * already persisted in an earlier session — this component's own\n\t\t * `localDone`/`choiceModel` only track the CURRENT session and reset\n\t\t * blank on every mount. Drives both the initial step (`initialStepId`)\n\t\t * and the summary page's done markers.\n\t\t *\n\t\t * @type {Array<string>}\n\t\t */\n\t\tcompletedStepIds: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * The app's dependencies, in the manifest's own shape (app-id strings\n\t\t * or `{ id, name?, required? }`). Falls back to the injected manifest's\n\t\t * `dependencies`. A missing REQUIRED one replaces every step with the\n\t\t * dependency list and disables Next; a missing optional one is listed\n\t\t * on the first step and does not block.\n\t\t *\n\t\t * @type {Array<string|object>}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-the-wizard-checks-dependencies-before-any-step\n\t\t */\n\t\tdependencies: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** Load button label on a dataset card (`loadAction`). */\n\t\tloadLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Load'),\n\t\t},\n\n\t\t/** Load button label once that dataset loaded in this session. */\n\t\treloadLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Load again'),\n\t\t},\n\t},\n\n\temits: ['complete', 'close', 'step-change', 'action-result'],\n\n\t/**\n\t * Live option lists come from the app's own setup status document, so a\n\t * step that offers a choice of things the SERVER ships never has to\n\t * restate them in the manifest. `useSetupStatus` caches per app id, so the\n\t * host's own status fetch (CnAppRoot's setup gate) is the one that runs —\n\t * this reads the same refs rather than asking again.\n\t *\n\t * Only called when a step actually declares `optionsSource`: a wizard with\n\t * none must not start making requests it never made before.\n\t *\n\t * @param {object} props The component props.\n\t * @return {object} `setupStatus` / `setupStatusLoading` for the option resolver.\n\t */\n\tsetup(props) {\n\t\tconst wantsSource = (props.steps || []).some((s) => s && s.optionsSource)\n\t\tif (!wantsSource) {\n\t\t\treturn {}\n\t\t}\n\t\tconst { status, loading } = useSetupStatus(props.appId, { setup: { steps: props.steps } })\n\t\treturn { setupStatus: status, setupStatusLoading: loading }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tchoiceModel: {},\n\t\t\tchoiceValues: {},\n\t\t\tconfigModel: {},\n\t\t\trunning: {},\n\t\t\tactionResult: {},\n\t\t\tlocalDone: {},\n\t\t\tuserTouched: {},\n\t\t\t// Per-card load state for `loadAction` steps, keyed by `loadKey()`.\n\t\t\tdatasetRunning: {},\n\t\t\tdatasetResult: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The title actually rendered by CnWizardDialog: \"Set up {appName}\"\n\t\t * when a display name was passed, otherwise whatever `dialogTitle`\n\t\t * resolves to (a caller override, or its own generic default).\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tresolvedDialogTitle() {\n\t\t\treturn this.appName\n\t\t\t\t? t('nextcloud-vue', 'Set up {app}', { app: this.appName })\n\t\t\t\t: this.dialogTitle\n\t\t},\n\n\t\t/**\n\t\t * Every well-formed step, before `requires` is applied.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tdeclaredSteps() {\n\t\t\treturn (this.steps || []).filter((s) => s && s.id && s.type)\n\t\t},\n\n\t\t/**\n\t\t * Steps that declare `requires` on an app that is not installed and\n\t\t * enabled. They are not offered; the summary names them as skipped.\n\t\t *\n\t\t * @return {Array<{ step: object, missing: Array<string> }>}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-the-wizard-checks-dependencies-before-any-step\n\t\t * @spec openspec/changes/optional-step-requires/specs/cn-setup-wizard/spec.md#requirement-a-step-whose-required-apps-are-absent-is-not-applicable\n\t\t */\n\t\tskippedSteps() {\n\t\t\treturn this.declaredSteps\n\t\t\t\t.filter((s) => Array.isArray(s.requires) && s.requires.length > 0)\n\t\t\t\t.map((step) => {\n\t\t\t\t\tconst known = Object.fromEntries(this.dependencyRows.map((d) => [d.id, d]))\n\t\t\t\t\tconst missing = missingRequiredApps(step.requires, this.serverAppStatuses)\n\t\t\t\t\t\t.map((row) => (known[row.id] || row).name || row.id)\n\t\t\t\t\treturn { step, missing }\n\t\t\t\t})\n\t\t\t\t.filter((entry) => entry.missing.length > 0)\n\t\t},\n\n\t\tsetupSteps() {\n\t\t\tconst skipped = new Set(this.skippedSteps.map((entry) => entry.step.id))\n\t\t\treturn this.declaredSteps.filter((s) => !skipped.has(s.id))\n\t\t},\n\n\t\t/**\n\t\t * Id of the first offered step: where the optional-apps note shows.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tfirstStepId() {\n\t\t\treturn this.setupSteps.length > 0 ? this.setupSteps[0].id : ''\n\t\t},\n\n\t\t/**\n\t\t * The dependency declarations to check: the prop, else the manifest's.\n\t\t *\n\t\t * @return {Array<string|object>}\n\t\t */\n\t\tdependencyEntries() {\n\t\t\tif (Array.isArray(this.dependencies) && this.dependencies.length > 0) {\n\t\t\t\treturn this.dependencies\n\t\t\t}\n\t\t\tconst fromManifest = this.cnManifest && this.cnManifest.dependencies\n\t\t\treturn Array.isArray(fromManifest) ? fromManifest : []\n\t\t},\n\n\t\t/**\n\t\t * The `dependency_statuses` initial state an app may inject from PHP.\n\t\t * Same source CnAppRoot reads; `{}` when the app injects none.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tserverAppStatuses() {\n\t\t\treturn readServerAppStatuses(this.appId)\n\t\t},\n\n\t\t/**\n\t\t * The declared dependencies with their live status.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tdependencyRows() {\n\t\t\treturn checkDependencies(this.dependencyEntries, this.serverAppStatuses)\n\t\t},\n\n\t\t/** @return {Array<object>} Required dependencies that are missing or disabled. */\n\t\tmissingRequired() {\n\t\t\treturn this.dependencyRows.filter((d) => d.required && !isDependencyResolved(d))\n\t\t},\n\n\t\t/** @return {Array<object>} Optional dependencies that are missing or disabled. */\n\t\tmissingOptional() {\n\t\t\treturn this.dependencyRows.filter((d) => !d.required && !isDependencyResolved(d))\n\t\t},\n\n\t\t/**\n\t\t * Whether a required app is missing, so the wizard shows the\n\t\t * dependency list instead of its steps and refuses to continue.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-the-wizard-checks-dependencies-before-any-step\n\t\t */\n\t\tdependencyBlocked() {\n\t\t\treturn this.missingRequired.length > 0\n\t\t},\n\n\t\tdependencyStepSlot() {\n\t\t\treturn 'step-' + DEPENDENCY_STEP_ID\n\t\t},\n\n\t\tdependencySectionName() {\n\t\t\treturn t('nextcloud-vue', 'Apps this app needs')\n\t\t},\n\n\t\tdependencyBlockedText() {\n\t\t\treturn t('nextcloud-vue', 'Setup can start once these apps are installed and enabled: {apps}.', {\n\t\t\t\tapps: this.missingRequired.map((d) => d.name).join(', '),\n\t\t\t})\n\t\t},\n\n\t\toptionalMissingText() {\n\t\t\treturn t('nextcloud-vue', 'Optional, not installed: {apps}. You can add them later.', {\n\t\t\t\tapps: this.missingOptional.map((d) => d.name).join(', '),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Whether the current user is a Nextcloud admin; only admins get the\n\t\t * install and enable buttons.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisAdmin() {\n\t\t\ttry {\n\t\t\t\tconst user = getCurrentUser()\n\t\t\t\treturn !!(user && user.isAdmin)\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\twizardSteps() {\n\t\t\tif (this.dependencyBlocked) {\n\t\t\t\treturn [{\n\t\t\t\t\tid: DEPENDENCY_STEP_ID,\n\t\t\t\t\tlabel: t('nextcloud-vue', 'Required apps'),\n\t\t\t\t\toptional: false,\n\t\t\t\t}]\n\t\t\t}\n\t\t\treturn this.setupSteps.map((s) => ({\n\t\t\t\tid: s.id,\n\t\t\t\tlabel: this.stepTitle(s),\n\t\t\t\toptional: s.required !== true,\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Recap rows for the `summary` step — one per non-summary step, with\n\t\t * the value the user selected (choice label / config field values) and\n\t\t * a done marker (info steps always done; choice steps done when picked;\n\t\t * run-action steps done when the action succeeded).\n\t\t *\n\t\t * An on-demand step (`onDemand: true`) is the exception: it is done\n\t\t * only when its action succeeded in THIS session. Apps report such a\n\t\t * step as `done` on purpose so it never auto-runs (learniq's \"Remove\n\t\t * the example data\"), and reading that flag here ticked a removal\n\t\t * nobody ran. When it did not run it gets `notRun: true` and the value\n\t\t * \"Not run\" instead.\n\t\t *\n\t\t * @return {Array<{ id: string, title: string, value: string, done: boolean, notRun: boolean }>}\n\t\t */\n\t\tsummaryItems() {\n\t\t\tconst skipped = this.skippedSteps\n\t\t\t\t.filter((entry) => entry.step.type !== 'summary' && entry.step.type !== 'info')\n\t\t\t\t.map((entry) => ({\n\t\t\t\t\tid: entry.step.id,\n\t\t\t\t\ttitle: this.stepTitle(entry.step),\n\t\t\t\t\tvalue: t('nextcloud-vue', 'Skipped, needs {apps}', { apps: entry.missing.join(', ') }),\n\t\t\t\t\tdone: false,\n\t\t\t\t\tnotRun: true,\n\t\t\t\t}))\n\t\t\treturn this.setupSteps\n\t\t\t\t.filter((s) => s.type !== 'summary')\n\t\t\t\t.map((step) => {\n\t\t\t\t\tlet value = ''\n\t\t\t\t\tif (step.type === 'choice') {\n\t\t\t\t\t\tconst raw = this.choiceModel[step.id]\n\t\t\t\t\t\tif (Array.isArray(raw)) {\n\t\t\t\t\t\t\tvalue = raw.map((o) => this.choiceLabel(step, o)).join(', ')\n\t\t\t\t\t\t} else if (raw !== null && raw !== undefined && raw !== '') {\n\t\t\t\t\t\t\tvalue = this.choiceLabel(step, raw)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (step.type === 'config-fields') {\n\t\t\t\t\t\t// Only the fields the reader filled in: a row of empty\n\t\t\t\t\t\t// \"Name: , KvK: ,\" reads as broken, not as \"not set\".\n\t\t\t\t\t\tvalue = this.fieldsFor(step)\n\t\t\t\t\t\t\t.filter((f) => {\n\t\t\t\t\t\t\t\tconst v = this.configModel[f.key]\n\t\t\t\t\t\t\t\treturn v !== null && v !== undefined && String(v).trim() !== ''\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.map((f) => `${f.label}: ${this.configModel[f.key]}`)\n\t\t\t\t\t\t\t.join(', ') || t('nextcloud-vue', 'Not set')\n\t\t\t\t\t}\n\t\t\t\t\tif (this.isOnDemand(step)) {\n\t\t\t\t\t\tconst ran = this.ranThisSession(step.id)\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: step.id,\n\t\t\t\t\t\t\ttitle: this.stepTitle(step),\n\t\t\t\t\t\t\tvalue: ran ? '' : t('nextcloud-vue', 'Not run'),\n\t\t\t\t\t\t\tdone: ran,\n\t\t\t\t\t\t\tnotRun: !ran,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet done\n\t\t\t\t\tif (step.type === 'info') {\n\t\t\t\t\t\tdone = true\n\t\t\t\t\t} else if (step.type === 'choice') {\n\t\t\t\t\t\tdone = this.hasChoice(step) || this.isServerDone(step.id)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdone = this.isStepDone(step.id)\n\t\t\t\t\t}\n\t\t\t\t\treturn { id: step.id, title: this.stepTitle(step), value, done, notRun: false }\n\t\t\t\t})\n\t\t\t\t.concat(skipped)\n\t\t},\n\n\t\t/**\n\t\t * Id of the step the wizard should open on when RESUMING: the first\n\t\t * non-`info`/`summary` step not already done, per the CURRENT session's\n\t\t * local state OR the server-reported `completedStepIds` (a prior\n\t\t * session). Falls back to `''` (CnWizardDialog's own first-step default)\n\t\t * on a fresh setup and when every actionable step is already done.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tinitialStepId() {\n\t\t\t// Fresh setup — nothing done anywhere yet, so there is nothing to\n\t\t\t// resume past. Start at step one so a leading `info`/welcome step is\n\t\t\t// actually seen; resuming is only for returning sessions.\n\t\t\tif (this.completedStepIds.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\t// An on-demand step is never outstanding work, so it is never the\n\t\t\t// step to resume on.\n\t\t\tconst actionable = this.setupSteps.filter((s) => s.type !== 'info' && s.type !== 'summary' && !this.isOnDemand(s))\n\t\t\tconst firstUnmetIndex = actionable.findIndex((s) => {\n\t\t\t\tif (s.type === 'choice') {\n\t\t\t\t\treturn !(this.hasChoice(s) || this.isServerDone(s.id))\n\t\t\t\t}\n\t\t\t\treturn !this.isStepDone(s.id)\n\t\t\t})\n\t\t\t// Done is not the same as seen: an app that pre-satisfies a step at\n\t\t\t// install time (buildiq seeds templates from a repair step) reports it\n\t\t\t// done before anyone opens the wizard. Only finished work BEFORE the\n\t\t\t// outstanding step means there is something to resume past.\n\t\t\tif (firstUnmetIndex <= 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn actionable[firstUnmetIndex].id\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Covers a RESUMED wizard opening straight onto its run-action step\n\t\t// (`initialStepId`) — `onStepChange` only fires on later navigation,\n\t\t// so a step already active at mount time needs its own trigger.\n\t\tthis.maybeAutoRunStep(this.initialStepId || (this.setupSteps[0] && this.setupSteps[0].id))\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Start a `run-action` step's action automatically the moment it\n\t\t * becomes current, instead of waiting for a manual \"Run\" click —\n\t\t * the step has nothing else for the user to decide by then (the\n\t\t * choice it acts on was already made on an earlier step), so\n\t\t * requiring a click before showing progress just adds a stall.\n\t\t * No-ops for any other step type, or one already run/running, and\n\t\t * never fires an on-demand step (`onDemand: true`): those run only\n\t\t * when the user clicks Run.\n\t\t *\n\t\t * @param {string} stepId The step id becoming current.\n\t\t * @return {void}\n\t\t */\n\t\tmaybeAutoRunStep(stepId) {\n\t\t\t// Nothing runs while a required app is missing: every action\n\t\t\t// would fail with an error that does not name the app.\n\t\t\tif (this.dependencyBlocked) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst step = this.setupSteps.find((s) => s.id === stepId)\n\t\t\tif (step && step.type === 'run-action' && !this.isOnDemand(step) && !this.isStepDone(step.id) && !this.running[step.id]) {\n\t\t\t\tthis.runAction(step)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The visible title for a step, resolved through the host app's\n\t\t * translation function.\n\t\t *\n\t\t * `manifest.setup.steps[].title` is authored in English as the\n\t\t * canonical source, exactly like the schema property titles this\n\t\t * component already routes through `cnTranslate` for field labels\n\t\t * (see `fieldsFromSchema` below). The step titles were the one\n\t\t * remaining place rendering the manifest string verbatim, so an\n\t\t * nl-locale user saw a wizard whose field labels were translated and\n\t\t * whose step headings were not.\n\t\t *\n\t\t * Falls back to the step id when a step declares no title, which is\n\t\t * the same fallback the raw bindings used.\n\t\t *\n\t\t * @param {object} step A `manifest.setup.steps[]` entry.\n\t\t * @return {string} The translated title, or the step id.\n\t\t */\n\t\tstepTitle(step) {\n\t\t\tconst raw = (step && step.title) || (step && step.id) || ''\n\t\t\treturn raw === '' ? '' : this.cnTranslate(raw)\n\t\t},\n\n\t\t/**\n\t\t * The visible body for a step, resolved through the host app's\n\t\t * translation function.\n\t\t *\n\t\t * 🔴 THIS USED TO RENDER THE MANIFEST STRING VERBATIM, IN FOUR PLACES.\n\t\t * `stepTitle()` was routed through `cnTranslate` and the body was not,\n\t\t * so a wizard on a Dutch instance showed a translated heading over an\n\t\t * English paragraph, with translated Cancel/Next buttons underneath.\n\t\t * That reads as a bug rather than as a missing string, and the app could\n\t\t * not fix it: decidiq shipped correct Dutch for its setup copy in\n\t\t * `l10n/nl.json`, and the component never asked for it.\n\t\t *\n\t\t * @param {object} step The step declaration.\n\t\t * @return {string} The translated body, or ''.\n\t\t */\n\t\tstepBody(step) {\n\t\t\tconst raw = (step && step.body) || ''\n\t\t\treturn raw === '' ? '' : this.cnTranslate(raw)\n\t\t},\n\n\t\tstepSlot(step) {\n\t\t\treturn 'step-' + step.id\n\t\t},\n\n\t\thasCustomSlot(id) {\n\t\t\treturn !!this.$slots['step-' + id] || !!this.$slots['step-' + id]\n\t\t},\n\n\t\tfieldsFor(step) {\n\t\t\tif (step.schema && typeof step.schema === 'object') {\n\t\t\t\treturn fieldsFromSchema(step.schema, { translate: this.cnTranslate })\n\t\t\t}\n\t\t\t// Fallback: a plain text field per declared config key.\n\t\t\treturn (step.configKeys || []).map((key) => ({ key, label: key, widget: 'text' }))\n\t\t},\n\n\t\t/**\n\t\t * Options for a `choice` step. When the step declares `dependsOn`\n\t\t * (a parent step's configKey) + `optionsByParent`, the option list\n\t\t * is the entry keyed by the parent's currently-selected value — this\n\t\t * is the country → organisation-type cascade. Otherwise the static\n\t\t * `options` array.\n\t\t *\n\t\t * @param {object} step The choice step definition.\n\t\t * @return {Array} The option list to render.\n\t\t */\n\t\toptionsFor(step) {\n\t\t\tlet options = step.options || []\n\t\t\tif (step.optionsSource) {\n\t\t\t\toptions = this.sourcedOptions(step)\n\t\t\t} else if (step.dependsOn && step.optionsByParent) {\n\t\t\t\tconst parentValue = this.choiceValues[step.dependsOn]\n\t\t\t\toptions = (parentValue === null || parentValue === undefined || parentValue === '')\n\t\t\t\t\t? []\n\t\t\t\t\t: (step.optionsByParent[parentValue] || [])\n\t\t\t}\n\t\t\t// The LABEL is translated, the VALUE never is. `scalarChoice()` reads\n\t\t\t// `.value` and that is what reaches `POST /api/setup/config`, so a\n\t\t\t// translated label cannot change what gets stored — while an\n\t\t\t// untranslated one leaves the choice itself in English on a\n\t\t\t// localised instance, which is the half-translated screen this fix\n\t\t\t// exists to remove.\n\t\t\treturn options.map((option) => {\n\t\t\t\tif (!option || typeof option !== 'object' || !option.label) {\n\t\t\t\t\treturn option\n\t\t\t\t}\n\t\t\t\tconst translated = { ...option, label: this.cnTranslate(option.label) }\n\t\t\t\tif (option.description) {\n\t\t\t\t\ttranslated.description = this.cnTranslate(option.description)\n\t\t\t\t}\n\t\t\t\treturn translated\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The option list a `choice` step declares `optionsSource` for, read\n\t\t * from the setup status document the app already serves.\n\t\t *\n\t\t * `optionsSource` names a key in that document (dots walk into nested\n\t\t * objects), and the entries are normalised to the option shape: `id` is\n\t\t * accepted for `value`, `name` for `label`, and a bare `objectCount`\n\t\t * becomes the one stat a card shows. A server that already sends\n\t\t * `stats` keeps them.\n\t\t *\n\t\t * @param {object} step The choice step declaring `optionsSource`.\n\t\t * @return {Array<object>} The options, or [] while the status is loading.\n\t\t */\n\t\tsourcedOptions(step) {\n\t\t\tlet node = this.setupStatus\n\t\t\tfor (const key of String(step.optionsSource).split('.')) {\n\t\t\t\tif (node === null || node === undefined || typeof node !== 'object') {\n\t\t\t\t\treturn []\n\t\t\t\t}\n\t\t\t\tnode = node[key]\n\t\t\t}\n\t\t\tif (!Array.isArray(node)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn node\n\t\t\t\t.filter((entry) => entry && typeof entry === 'object')\n\t\t\t\t.map((entry) => {\n\t\t\t\t\tconst value = entry.value !== undefined ? entry.value : entry.id\n\t\t\t\t\tconst option = {\n\t\t\t\t\t\t...entry,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tlabel: entry.label || entry.name || String(value),\n\t\t\t\t\t}\n\t\t\t\t\tif (!option.stats && typeof entry.objectCount === 'number' && entry.objectCount > 0) {\n\t\t\t\t\t\toption.stats = [{ label: t('nextcloud-vue', 'Objects'), value: entry.objectCount }]\n\t\t\t\t\t}\n\t\t\t\t\treturn option\n\t\t\t\t})\n\t\t\t\t.filter((option) => option.value !== undefined)\n\t\t},\n\n\t\t/**\n\t\t * Whether a choice step renders as a card grid rather than a dropdown.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @return {boolean} True for `display: \"cards\"`.\n\t\t */\n\t\tisCardChoice(step) {\n\t\t\treturn step.display === 'cards'\n\t\t},\n\n\t\t/**\n\t\t * Whether this step is still waiting for its live option list.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @return {boolean} True while the status document is in flight.\n\t\t */\n\t\tisOptionsLoading(step) {\n\t\t\treturn !!step.optionsSource && this.setupStatusLoading === true\n\t\t},\n\n\t\t/**\n\t\t * The card grid's model: plain values, not the option objects NcSelect\n\t\t * binds. `scalarChoice` already reduces either shape to values, so both\n\t\t * renderers can share one `choiceModel` entry.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @return {unknown} The selected value, or [] / null when nothing is picked.\n\t\t */\n\t\tcardModel(step) {\n\t\t\tconst value = this.scalarChoice(step)\n\t\t\tif (step.multiple === true) {\n\t\t\t\treturn Array.isArray(value) ? value : []\n\t\t\t}\n\t\t\treturn value === undefined ? null : value\n\t\t},\n\n\t\tisChoiceDisabled(step) {\n\t\t\tif (!step.dependsOn) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst parentValue = this.choiceValues[step.dependsOn]\n\t\t\treturn parentValue === null || parentValue === undefined || parentValue === ''\n\t\t},\n\n\t\tdependsOnHint(step) {\n\t\t\tconst parent = this.setupSteps.find((s) => s.configKey === step.dependsOn)\n\t\t\tconst label = parent ? (parent.title || parent.id) : step.dependsOn\n\t\t\treturn t('nextcloud-vue', 'Select \"{step}\" first.', { step: label })\n\t\t},\n\n\t\t/**\n\t\t * The visible label for one selected choice entry.\n\t\t *\n\t\t * A card grid stores plain VALUES where NcSelect stores option objects,\n\t\t * so the recap looked one up and printed the other: the summary read\n\t\t * \"municipality\" instead of \"Municipality\". Resolves a bare value back\n\t\t * to its option, and falls back to the value when the option list is\n\t\t * not (yet) available.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @param {unknown} entry One selected entry: an option object or a value.\n\t\t * @return {string} The label to show.\n\t\t */\n\t\tchoiceLabel(step, entry) {\n\t\t\tif (entry && typeof entry === 'object' && entry.label) {\n\t\t\t\treturn entry.label\n\t\t\t}\n\t\t\tconst match = this.optionsFor(step).find((o) => o && String(o.value) === String(entry))\n\t\t\treturn (match && match.label) ? match.label : String(entry)\n\t\t},\n\n\t\thasChoice(step) {\n\t\t\tconst v = this.choiceModel[step.id]\n\t\t\tif (step.multiple === true) {\n\t\t\t\treturn Array.isArray(v) && v.length > 0\n\t\t\t}\n\t\t\treturn v !== null && v !== undefined && v !== ''\n\t\t},\n\n\t\tscalarChoice(step) {\n\t\t\tconst raw = this.choiceModel[step.id]\n\t\t\tif (step.multiple === true) {\n\t\t\t\treturn (raw || []).map((o) => (o && o.value !== undefined ? o.value : o))\n\t\t\t}\n\t\t\treturn raw && raw.value !== undefined ? raw.value : raw\n\t\t},\n\n\t\tonChoice(step, value) {\n\t\t\tthis.userTouched[step.id] = true\n\t\t\tthis.choiceModel[step.id] = value\n\t\t\tif (step.configKey) {\n\t\t\t\tthis.choiceValues[step.configKey] = this.scalarChoice(step)\n\t\t\t}\n\t\t\t// Reset any dependent child choices when the parent changes.\n\t\t\tfor (const child of this.setupSteps) {\n\t\t\t\tif (child.dependsOn && child.dependsOn === step.configKey) {\n\t\t\t\t\tthis.choiceModel[child.id] = child.multiple === true ? [] : null\n\t\t\t\t\tthis.userTouched[child.id] = false\n\t\t\t\t\tif (child.configKey) {\n\t\t\t\t\t\tthis.choiceValues[child.configKey] = ''\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Re-apply auto-suggestions for steps that derive a default from this one.\n\t\t\tfor (const dep of this.setupSteps) {\n\t\t\t\tif (dep.suggestFrom && dep.suggestFrom === step.configKey) {\n\t\t\t\t\tthis.applySuggestion(dep)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Auto-fill a `choice` step's suggested default from an earlier choice\n\t\t * (its `suggestFrom` configKey → `suggestMap[parentValue]`). No-op once\n\t\t * the user has manually picked here, so a suggestion never clobbers an\n\t\t * explicit choice.\n\t\t *\n\t\t * @param {object} step The dependent choice step.\n\t\t * @return {void}\n\t\t */\n\t\tapplySuggestion(step) {\n\t\t\tif (this.userTouched[step.id] === true) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst parentValue = this.choiceValues[step.suggestFrom]\n\t\t\tif (parentValue === null || parentValue === undefined || parentValue === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst wanted = (step.suggestMap || {})[parentValue]\n\t\t\tif (wanted === null || wanted === undefined) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst opt = this.optionsFor(step).find((o) => o.value === wanted) || { value: wanted, label: String(wanted) }\n\t\t\tthis.choiceModel[step.id] = opt\n\t\t\tif (step.configKey) {\n\t\t\t\tthis.choiceValues[step.configKey] = wanted\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * CnWizardDialog `validate` hook — intercepts Next/Submit to persist\n\t\t * the active step before advancing. `choice`/`config-fields` steps\n\t\t * POST their value via the setup contract; required `choice` steps\n\t\t * block advance until a value is picked; required `run-action` steps\n\t\t * block until the action has succeeded. Returns `true` to advance or\n\t\t * an error string to surface above the step and block navigation.\n\t\t *\n\t\t * @param {string} stepId The active step id.\n\t\t * @return {Promise<boolean|string>} True to advance, or an error message.\n\t\t */\n\t\tasync validateStep(stepId) {\n\t\t\tconst step = this.setupSteps.find((s) => s.id === stepId)\n\t\t\tif (!step) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (step.type === 'choice') {\n\t\t\t\tif (!this.hasChoice(step)) {\n\t\t\t\t\t// Already persisted server-side and the user only back-navigated\n\t\t\t\t\t// onto it — `choiceModel` is blank because it's session-local, not\n\t\t\t\t\t// because nothing is set. Don't force a re-pick, and don't re-POST.\n\t\t\t\t\tif (this.isServerDone(step.id)) {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t\treturn step.required === true\n\t\t\t\t\t\t? t('nextcloud-vue', 'Please make a selection to continue.')\n\t\t\t\t\t\t: true\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tawait this.saveConfig({ [step.configKey]: this.scalarChoice(step) })\n\t\t\t\t\tthis.localDone[step.id] = true\n\t\t\t\t\treturn true\n\t\t\t\t} catch (err) {\n\t\t\t\t\treturn this.errorMessage(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (step.type === 'config-fields') {\n\t\t\t\ttry {\n\t\t\t\t\tconst patch = {}\n\t\t\t\t\tfor (const field of this.fieldsFor(step)) {\n\t\t\t\t\t\tpatch[field.key] = this.configModel[field.key]\n\t\t\t\t\t}\n\t\t\t\t\tawait this.saveConfig(patch)\n\t\t\t\t\tthis.localDone[step.id] = true\n\t\t\t\t\treturn true\n\t\t\t\t} catch (err) {\n\t\t\t\t\treturn this.errorMessage(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (step.type === 'run-action' && step.required === true && !this.isStepDone(step.id)) {\n\t\t\t\treturn t('nextcloud-vue', 'Please run this step before continuing.')\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * Persist one or more app-config values via the setup contract.\n\t\t *\n\t\t * @param {object} patch `{ <configKey>: value }` to write.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync saveConfig(patch) {\n\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\timport('@nextcloud/router'),\n\t\t\t])\n\t\t\tawait axios.post(generateUrl(`/apps/${this.appId}/api/setup/config`), patch)\n\t\t},\n\n\t\tasync runAction(step) {\n\t\t\tthis.running[step.id] = true\n\t\t\tthis.actionResult[step.id] = null\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst { data } = await axios.post(generateUrl(`/apps/${this.appId}/api/setup/action/${step.action}`))\n\t\t\t\tconst result = {\n\t\t\t\t\tsuccess: data && data.success !== false,\n\t\t\t\t\tmessage: (data && data.message) || t('nextcloud-vue', 'Done.'),\n\t\t\t\t}\n\t\t\t\tthis.actionResult[step.id] = result\n\t\t\t\tif (result.success) {\n\t\t\t\t\tthis.localDone[step.id] = true\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * @event action-result Emitted when a `run-action` step finishes.\n\t\t\t\t * @type {{ stepId: string, action: string, success: boolean, message: string }}\n\t\t\t\t */\n\t\t\t\tthis.$emit('action-result', { stepId: step.id, action: step.action, ...result })\n\t\t\t} catch (err) {\n\t\t\t\tthis.actionResult[step.id] = { success: false, message: this.errorMessage(err) }\n\t\t\t\tthis.$emit('action-result', { stepId: step.id, action: step.action, success: false, message: this.errorMessage(err) })\n\t\t\t} finally {\n\t\t\t\tthis.running[step.id] = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Key for one card's load state.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @param {object} option The card's option.\n\t\t * @return {string}\n\t\t */\n\t\tloadKey(step, option) {\n\t\t\treturn step.id + '::' + String(option && option.value)\n\t\t},\n\n\t\t/**\n\t\t * Whether a card gets a Load button: the step declares `loadAction`\n\t\t * and the option is not the \"seed nothing\" answer.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @param {object} option The card's option.\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-a-dataset-card-loads-itself\n\t\t */\n\t\tisLoadableOption(step, option) {\n\t\t\treturn !!(step && step.loadAction) && !!option && String(option.value) !== NONE_DATASET\n\t\t},\n\n\t\tisDatasetLoading(step, option) {\n\t\t\treturn this.datasetRunning[this.loadKey(step, option)] === true\n\t\t},\n\n\t\tdatasetResultFor(step, option) {\n\t\t\treturn this.datasetResult[this.loadKey(step, option)] || null\n\t\t},\n\n\t\tloadButtonLabel(step, option) {\n\t\t\tif (this.isDatasetLoading(step, option)) {\n\t\t\t\treturn this.runningLabel\n\t\t\t}\n\t\t\tconst result = this.datasetResultFor(step, option)\n\t\t\treturn (result && result.success) ? this.reloadLabel : this.loadLabel\n\t\t},\n\n\t\tloadAriaLabel(option) {\n\t\t\treturn t('nextcloud-vue', 'Load {name}', { name: option.label })\n\t\t},\n\n\t\t/**\n\t\t * Load one dataset from its card: POST `{ dataset }` to the step's\n\t\t * `loadAction`, spinner on the button while it runs, the result on the\n\t\t * card after. A successful load also selects the card, so the summary\n\t\t * and the stored choice name what was loaded.\n\t\t *\n\t\t * @param {object} step The choice step declaring `loadAction`.\n\t\t * @param {object} option The card's option.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-a-dataset-card-loads-itself\n\t\t */\n\t\tasync loadDataset(step, option) {\n\t\t\tif (!this.isLoadableOption(step, option) || this.isDatasetLoading(step, option)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst key = this.loadKey(step, option)\n\t\t\tthis.datasetRunning[key] = true\n\t\t\tthis.datasetResult[key] = null\n\t\t\tlet result\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst { data } = await axios.post(\n\t\t\t\t\tgenerateUrl(`/apps/${this.appId}/api/setup/action/${step.loadAction}`),\n\t\t\t\t\t{ dataset: option.value },\n\t\t\t\t)\n\t\t\t\tresult = {\n\t\t\t\t\tsuccess: !!data && data.success !== false,\n\t\t\t\t\tmessage: (data && data.message) || t('nextcloud-vue', 'Loaded.'),\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tresult = { success: false, message: this.errorMessage(err) }\n\t\t\t} finally {\n\t\t\t\tthis.datasetRunning[key] = false\n\t\t\t}\n\t\t\tthis.datasetResult[key] = result\n\t\t\tif (result.success) {\n\t\t\t\tthis.selectLoadedOption(step, option)\n\t\t\t\tthis.localDone[step.id] = true\n\t\t\t}\n\t\t\tthis.$emit('action-result', {\n\t\t\t\tstepId: step.id,\n\t\t\t\taction: step.loadAction,\n\t\t\t\tdataset: option.value,\n\t\t\t\t...result,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Select a card that just loaded, adding to (never replacing) the\n\t\t * selection of a `multiple` step.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @param {object} option The loaded option.\n\t\t * @return {void}\n\t\t */\n\t\tselectLoadedOption(step, option) {\n\t\t\tif (step.multiple === true) {\n\t\t\t\tconst current = this.cardModel(step)\n\t\t\t\tif (current.some((v) => String(v) === String(option.value))) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.onChoice(step, current.concat([option.value]))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.onChoice(step, option.value)\n\t\t},\n\n\t\t/**\n\t\t * A required app was installed from the dependency list. A new app's\n\t\t * scripts and its `OC.appswebroots` entry exist only after a full page\n\t\t * load, and `useAppStatus` caches per page, so reload.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonDependencyInstalled() {\n\t\t\twindow.location.reload()\n\t\t},\n\n\t\t/**\n\t\t * Whether a step is marked on-demand (`onDemand: true`): it runs only\n\t\t * when the user asks, never automatically, and the summary ticks it\n\t\t * only when it ran in this session.\n\t\t *\n\t\t * @param {object} step The manifest step.\n\t\t * @return {boolean}\n\t\t */\n\t\tisOnDemand(step) {\n\t\t\treturn !!step && step.onDemand === true\n\t\t},\n\n\t\t/**\n\t\t * Whether a step's action succeeded in the CURRENT session, ignoring\n\t\t * whatever the server reports.\n\t\t *\n\t\t * @param {string} id Step id.\n\t\t * @return {boolean}\n\t\t */\n\t\tranThisSession(id) {\n\t\t\treturn !!(this.actionResult[id] && this.actionResult[id].success)\n\t\t},\n\n\t\tisStepDone(id) {\n\t\t\treturn this.isServerDone(id) || this.localDone[id] === true || (this.actionResult[id] && this.actionResult[id].success)\n\t\t},\n\n\t\t/**\n\t\t * Whether the server already reported this step done in a prior\n\t\t * session, via the `completedStepIds` prop.\n\t\t *\n\t\t * @param {string} id Step id.\n\t\t * @return {boolean}\n\t\t */\n\t\tisServerDone(id) {\n\t\t\treturn this.completedStepIds.includes(id)\n\t\t},\n\n\t\tonSubmit() {\n\t\t\tif (this.$refs.wizard && this.$refs.wizard.setResult) {\n\t\t\t\tthis.$refs.wizard.setResult({ success: true, message: this.successText })\n\t\t\t}\n\t\t\t/**\n\t\t\t * @event complete Emitted when the last step is submitted (setup finished).\n\t\t\t */\n\t\t\tthis.$emit('complete')\n\t\t},\n\n\t\tonStepChange(payload) {\n\t\t\t// Pre-fill a suggested default when entering a step that derives one.\n\t\t\tconst step = this.setupSteps.find((s) => s.id === payload.stepId)\n\t\t\tif (step && step.suggestFrom) {\n\t\t\t\tthis.applySuggestion(step)\n\t\t\t}\n\t\t\tthis.maybeAutoRunStep(payload.stepId)\n\t\t\t/**\n\t\t\t * @event step-change Emitted when the active step changes.\n\t\t\t * @type {{ stepId: string, stepIndex: number, direction: string }}\n\t\t\t */\n\t\t\tthis.$emit('step-change', payload)\n\t\t},\n\n\t\tonClose() {\n\t\t\t/**\n\t\t\t * @event close Emitted when the dialog should close.\n\t\t\t */\n\t\t\tthis.$emit('close')\n\t\t},\n\n\t\terrorMessage(err) {\n\t\t\tconst data = err && err.response && err.response.data\n\t\t\tif (data && (data.message || data.error)) {\n\t\t\t\treturn data.message || data.error\n\t\t\t}\n\t\t\treturn (err && err.message) || t('nextcloud-vue', 'Something went wrong.')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-setup-step {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-setup-step__nav {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: 8px;\n\tmargin-top: 8px;\n}\n\n.cn-setup-step__running {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 8px;\n\tpadding: 24px 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-setup-load-result {\n\tmargin: 0;\n\tfont-size: var(--font-size-small, 13px);\n}\n\n.cn-setup-load-result--success {\n\tcolor: var(--color-success-text, var(--color-success));\n}\n\n.cn-setup-load-result--error {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-setup-field {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.cn-setup-summary {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.cn-setup-summary__item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 4px 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-setup-summary__item--done {\n\tcolor: var(--color-main-text);\n}\n\n.cn-setup-summary__mark {\n\tfont-weight: bold;\n\tcolor: var(--color-success);\n}\n\n.cn-setup-summary__label {\n\tflex: 0 0 auto;\n}\n\n.cn-setup-summary__value {\n\tmargin-inline-start: auto;\n\tfont-weight: 600;\n\tcolor: var(--color-main-text);\n}\n\n/* An on-demand step that did not run says so quietly: it is a choice the\n user did not make, not a failure. */\n.cn-setup-summary__item--not-run .cn-setup-summary__value {\n\tfont-weight: normal;\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["CnWizardDialog","CnChoiceCards","CnLeafDependencySettings","t"],"mappings":";;;;;;;;;;AAkNA;AACA,MAAM,kBAAiB,GAAI,wBAAsB;;AAEjD;AACA,MAAM,YAAW,GAAI,OAAK;;AAE1B;AACC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;;AAIA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,eAAe;;CAErB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G,GAAG,CAAC,QAAQ,CAAC,KAAG;AACpD,GAAA,IAAI,IAAK,KAAI,IAAI,CAAC,OAAM,IAAK,IAAI,CAAC,KAAK,CAAC,EAAE;IACzC,OAAO,IAAI,CAAC,OAAM,IAAK,IAAI,CAAC,KAAI;AACjC,IAAA;AACA,GAAA,OAAO,CAAC,GAAI,IAAG,GAAG,CAAC,OAAO,KAAKA,SAAC,CAAC,eAAe,EAAE,uBAAuB,CAAA;GACzE;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnSetupWizard.vue2.js","sources":["../../../../src/components/CnSetupWizard/CnSetupWizard.vue"],"sourcesContent":["<!-- SPDX-License-Identifier: EUPL-1.2 -->\n<!-- SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl> -->\n<template>\n\t<CnWizardDialog\n\t\tref=\"wizard\"\n\t\t:steps=\"wizardSteps\"\n\t\t:dialogTitle=\"resolvedDialogTitle\"\n\t\t:submitLabel=\"submitLabel\"\n\t\t:cancelLabel=\"cancelLabel\"\n\t\t:nextLabel=\"nextLabel\"\n\t\t:backLabel=\"backLabel\"\n\t\t:successText=\"successText\"\n\t\t:validate=\"validateStep\"\n\t\t:cancellable=\"cancellable\"\n\t\t:initialStep=\"dependencyBlocked ? '' : initialStepId\"\n\t\t:nextDisabled=\"dependencyBlocked\"\n\t\t@stepChange=\"onStepChange\"\n\t\t@submit=\"onSubmit\"\n\t\t@close=\"onClose\">\n\t\t<!-- This `<template v-for>` defines dynamic SLOTS, not a rendered list.\n\t\t `@vue/compiler-sfc` DISCARDS a `:key` on a slot-defining\n\t\t `<template>` (verified against the generated `createSlots` call)\n\t\t and honours it only on the child, so the rule's advice is inverted\n\t\t here — moving the key up would throw it away. -->\n\t\t<!-- A required app is missing: this is the only step, and Next stays\n\t\t disabled until the app is there. -->\n\t\t<template v-if=\"dependencyBlocked\" #[dependencyStepSlot]>\n\t\t\t<div class=\"cn-setup-step\" data-step-type=\"dependencies\" data-testid=\"cn-setup-dependencies\">\n\t\t\t\t<NcNoteCard type=\"warning\">\n\t\t\t\t\t{{ dependencyBlockedText }}\n\t\t\t\t</NcNoteCard>\n\t\t\t\t<CnLeafDependencySettings\n\t\t\t\t\t:appId=\"appId\"\n\t\t\t\t\t:dependencies=\"dependencyEntries\"\n\t\t\t\t\t:isAdmin=\"isAdmin\"\n\t\t\t\t\t:sectionName=\"dependencySectionName\"\n\t\t\t\t\tsectionDescription=\"\"\n\t\t\t\t\t@installed=\"onDependencyInstalled\" />\n\t\t\t</div>\n\t\t</template>\n\t\t<!-- eslint-disable vue/no-v-for-template-key-on-child -->\n\t\t<template v-for=\"step in setupSteps\" #[stepSlot(step)]=\"scope\">\n\t\t\t<div :key=\"step.id\" class=\"cn-setup-step\" :data-step-type=\"step.type\">\n\t\t\t\t<!-- Optional apps that are missing never block, but the admin\n\t\t\t\t reads about them once, on the first step. -->\n\t\t\t\t<NcNoteCard\n\t\t\t\t\tv-if=\"step.id === firstStepId && missingOptional.length > 0\"\n\t\t\t\t\ttype=\"info\"\n\t\t\t\t\tdata-testid=\"cn-setup-optional-dependencies\">\n\t\t\t\t\t{{ optionalMissingText }}\n\t\t\t\t</NcNoteCard>\n\t\t\t\t<!-- @slot step-{id} Override a step's body (for `component` steps or\n\t\t\t\t any bespoke step). Scope: the CnWizardDialog step scope plus\n\t\t\t\t `{ step, runAction, saveConfig }`. -->\n\t\t\t\t<slot\n\t\t\t\t\tv-if=\"hasCustomSlot(step.id)\"\n\t\t\t\t\t:name=\"stepSlot(step)\"\n\t\t\t\t\tv-bind=\"scope\"\n\t\t\t\t\t:step=\"step\"\n\t\t\t\t\t:runAction=\"() => runAction(step)\"\n\t\t\t\t\t:saveConfig=\"(patch) => saveConfig(patch)\" />\n\n\t\t\t\t<!-- info -->\n\t\t\t\t<template v-else-if=\"step.type === 'info'\">\n\t\t\t\t\t<NcNoteCard type=\"info\" :heading=\"stepTitle(step)\">\n\t\t\t\t\t\t{{ stepBody(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t</template>\n\n\t\t\t\t<!-- choice -->\n\t\t\t\t<template v-else-if=\"step.type === 'choice'\">\n\t\t\t\t\t<NcNoteCard v-if=\"step.body\" type=\"info\">\n\t\t\t\t\t\t{{ stepBody(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t\t<CnChoiceCards\n\t\t\t\t\t\tv-if=\"isCardChoice(step)\"\n\t\t\t\t\t\t:label=\"stepTitle(step)\"\n\t\t\t\t\t\t:options=\"optionsFor(step)\"\n\t\t\t\t\t\t:multiple=\"step.multiple === true\"\n\t\t\t\t\t\t:disabled=\"isChoiceDisabled(step)\"\n\t\t\t\t\t\t:loading=\"isOptionsLoading(step)\"\n\t\t\t\t\t\t:modelValue=\"cardModel(step)\"\n\t\t\t\t\t\t@update:modelValue=\"(v) => onChoice(step, v)\">\n\t\t\t\t\t\t<!-- `loadAction`: every dataset card except \"none\" loads\n\t\t\t\t\t\t itself, so no separate run-action step is needed. -->\n\t\t\t\t\t\t<template v-if=\"step.loadAction\" #option-actions=\"{ option }\">\n\t\t\t\t\t\t\t<template v-if=\"isLoadableOption(step, option)\">\n\t\t\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t:disabled=\"isDatasetLoading(step, option)\"\n\t\t\t\t\t\t\t\t\t:aria-label=\"loadAriaLabel(option)\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-setup-load-dataset\"\n\t\t\t\t\t\t\t\t\t@click=\"loadDataset(step, option)\">\n\t\t\t\t\t\t\t\t\t<template v-if=\"isDatasetLoading(step, option)\" #icon>\n\t\t\t\t\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t\t{{ loadButtonLabel(step, option) }}\n\t\t\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\t\tv-if=\"datasetResultFor(step, option)\"\n\t\t\t\t\t\t\t\t\trole=\"status\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-setup-load-result\"\n\t\t\t\t\t\t\t\t\t:class=\"datasetResultFor(step, option).success ? 'cn-setup-load-result--success' : 'cn-setup-load-result--error'\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-setup-load-result\">\n\t\t\t\t\t\t\t\t\t{{ datasetResultFor(step, option).message }}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</CnChoiceCards>\n\t\t\t\t\t<NcSelect\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\t:inputLabel=\"stepTitle(step)\"\n\t\t\t\t\t\t:options=\"optionsFor(step)\"\n\t\t\t\t\t\t:multiple=\"step.multiple === true\"\n\t\t\t\t\t\t:disabled=\"isChoiceDisabled(step)\"\n\t\t\t\t\t\tlabel=\"label\"\n\t\t\t\t\t\t:modelValue=\"choiceModel[step.id]\"\n\t\t\t\t\t\t@update:modelValue=\"(v) => onChoice(step, v)\" />\n\t\t\t\t\t<NcNoteCard v-if=\"isChoiceDisabled(step)\" type=\"warning\">\n\t\t\t\t\t\t{{ dependsOnHint(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t</template>\n\n\t\t\t\t<!-- config-fields -->\n\t\t\t\t<template v-else-if=\"step.type === 'config-fields'\">\n\t\t\t\t\t<!-- The step's intro, drawn like choice and run-action steps.\n\t\t\t\t\t It was left out here, so pipelinq's organisation step\n\t\t\t\t\t (\"Your organisation details…\") showed fields with no\n\t\t\t\t\t word about what they were for. -->\n\t\t\t\t\t<NcNoteCard v-if=\"step.body\" type=\"info\" data-testid=\"cn-setup-step-intro\">\n\t\t\t\t\t\t{{ stepBody(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"field in fieldsFor(step)\"\n\t\t\t\t\t\t:key=\"field.key\"\n\t\t\t\t\t\tclass=\"cn-setup-field\">\n\t\t\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\t\t\tv-if=\"field.widget === 'checkbox'\"\n\t\t\t\t\t\t\t:modelValue=\"!!configModel[field.key]\"\n\t\t\t\t\t\t\t@update:modelValue=\"(v) => configModel[field.key] = v\">\n\t\t\t\t\t\t\t{{ field.label }}\n\t\t\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t\t\t<NcSelect\n\t\t\t\t\t\t\tv-else-if=\"field.widget === 'select'\"\n\t\t\t\t\t\t\t:inputLabel=\"field.label\"\n\t\t\t\t\t\t\t:options=\"field.enum || []\"\n\t\t\t\t\t\t\t:modelValue=\"configModel[field.key]\"\n\t\t\t\t\t\t\t@update:modelValue=\"(v) => configModel[field.key] = v\" />\n\t\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t\tv-else\n\t\t\t\t\t\t\t:label=\"field.label\"\n\t\t\t\t\t\t\t:type=\"field.widget === 'number' ? 'number' : 'text'\"\n\t\t\t\t\t\t\t:modelValue=\"configModel[field.key] != null ? String(configModel[field.key]) : ''\"\n\t\t\t\t\t\t\t@update:modelValue=\"(v) => configModel[field.key] = v\" />\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\n\t\t\t\t<!-- run-action -->\n\t\t\t\t<template v-else-if=\"step.type === 'run-action'\">\n\t\t\t\t\t<NcNoteCard v-if=\"step.body\" type=\"info\">\n\t\t\t\t\t\t{{ stepBody(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t\t<!-- The action starts automatically on entering this step\n\t\t\t\t\t (see `maybeAutoRunStep`), so the default state is the\n\t\t\t\t\t spinner, not an idle button. -->\n\t\t\t\t\t<div v-if=\"running[step.id]\" class=\"cn-setup-step__running\">\n\t\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t\t\t<span>{{ runningLabel }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t<NcNoteCard\n\t\t\t\t\t\t\tv-if=\"actionResult[step.id]\"\n\t\t\t\t\t\t\t:type=\"actionResult[step.id].success ? 'success' : 'error'\">\n\t\t\t\t\t\t\t{{ actionResult[step.id].message }}\n\t\t\t\t\t\t</NcNoteCard>\n\t\t\t\t\t\t<div class=\"cn-setup-step__nav\">\n\t\t\t\t\t\t\t<NcButton :variant=\"actionResult[step.id] ? 'secondary' : 'primary'\" @click=\"runAction(step)\">\n\t\t\t\t\t\t\t\t{{ actionResult[step.id] ? rerunLabel : runLabel }}\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</template>\n\n\t\t\t\t<!-- summary -->\n\t\t\t\t<template v-else-if=\"step.type === 'summary'\">\n\t\t\t\t\t<NcNoteCard v-if=\"step.body\" type=\"info\">\n\t\t\t\t\t\t{{ stepBody(step) }}\n\t\t\t\t\t</NcNoteCard>\n\t\t\t\t\t<ul class=\"cn-setup-summary\">\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tv-for=\"item in summaryItems\"\n\t\t\t\t\t\t\t:key=\"item.id\"\n\t\t\t\t\t\t\tclass=\"cn-setup-summary__item\"\n\t\t\t\t\t\t\t:class=\"{ 'cn-setup-summary__item--done': item.done, 'cn-setup-summary__item--not-run': item.notRun }\">\n\t\t\t\t\t\t\t<span class=\"cn-setup-summary__mark\">{{ item.done ? '✓' : '○' }}</span>\n\t\t\t\t\t\t\t<span class=\"cn-setup-summary__label\">{{ item.title }}</span>\n\t\t\t\t\t\t\t<span v-if=\"item.value\" class=\"cn-setup-summary__value\">{{ item.value }}</span>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</template>\n\t\t\t</div>\n\t\t</template>\n\t\t<!-- eslint-enable vue/no-v-for-template-key-on-child -->\n\t</CnWizardDialog>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcCheckboxRadioSwitch, NcLoadingIcon, NcNoteCard, NcSelect, NcTextField } from '@nextcloud/vue'\nimport CnChoiceCards from '../CnChoiceCards/CnChoiceCards.vue'\nimport CnLeafDependencySettings from '../CnLeafDependencySettings/CnLeafDependencySettings.vue'\nimport CnWizardDialog from '../CnWizardDialog/CnWizardDialog.vue'\nimport { checkDependencies, isDependencyResolved, missingRequiredApps, readServerAppStatuses } from '../../composables/useDependencyCheck.js'\nimport { useSetupStatus } from '../../composables/useSetupStatus.js'\nimport { fieldsFromSchema } from '../../utils/schema.js'\n\n/** Id of the synthetic step shown while a required app is missing. */\nconst DEPENDENCY_STEP_ID = 'cn-setup-dependencies'\n\n/** The dataset value that means \"seed nothing\"; it never gets a Load button. */\nconst NONE_DATASET = 'none'\n\n/**\n * CnSetupWizard — abstract, manifest-driven first-time setup wizard (ADR-042).\n *\n * Wraps {@link CnWizardDialog} and renders a `manifest.setup.steps[]` array by\n * each step's `type`: `info` (note), `config-fields` (fields from a JSON Schema\n * via `fieldsFromSchema`, the same field shapes the admin pages use), `choice`\n * (`NcSelect` persisting to an app-config key), `run-action` (POST a privileged\n * server action), `summary` (recap), and `component` (a parent-provided\n * `#step-<id>` slot). It NEVER writes OpenRegister objects from the browser —\n * all persistence goes through the per-app setup contract\n * (`POST /apps/{appId}/api/setup/config` and `/api/setup/action/{actionId}`).\n *\n * Mount it gated by `CnAppRoot`'s setup phase, or open it on demand from\n * `CnAdminSettingsShell`.\n *\n * ```vue\n * <CnSetupWizard\n * :app-id=\"'procest'\"\n * :steps=\"manifest.setup.steps\"\n * @complete=\"onSetupComplete\"\n * @close=\"showWizard = false\" />\n * ```\n */\nexport default {\n\tname: 'CnSetupWizard',\n\n\tcomponents: {\n\t\tCnWizardDialog,\n\t\tCnChoiceCards,\n\t\tCnLeafDependencySettings,\n\t\tNcButton,\n\t\tNcNoteCard,\n\t\tNcSelect,\n\t\tNcTextField,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcLoadingIcon,\n\t},\n\n\tinject: {\n\t\t/**\n\t\t * Consumer translation function, provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). Step field\n\t\t * labels come from schema property titles, authored in English as the\n\t\t * canonical source; the visible label is resolved through this function\n\t\t * so it follows the user's language. Defaults to identity when used\n\t\t * standalone (no CnAppRoot ancestor).\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/**\n\t\t * The app manifest, provided by CnAppRoot. Read only for its\n\t\t * `dependencies` when the `dependencies` prop is empty.\n\t\t */\n\t\tcnManifest: { default: null },\n\t},\n\n\tprops: {\n\t\t/** The Nextcloud app id; used to build the `/apps/{appId}/api/setup/*` URLs. */\n\t\tappId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** The `manifest.setup.steps` array to render. */\n\t\tsteps: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** Dialog title. Overridden by `appName` when that prop is set. */\n\t\tdialogTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Set up this app'),\n\t\t},\n\n\t\t/**\n\t\t * The app's human-readable display name. When set, the dialog title\n\t\t * becomes \"Set up {appName}\" instead of the generic `dialogTitle`\n\t\t * default — pass the same display name CnAppRoot already resolves\n\t\t * (`appDisplayName || manifest.name || appId`).\n\t\t */\n\t\tappName: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Final-step submit button label. */\n\t\tsubmitLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Finish'),\n\t\t},\n\n\t\t/** Cancel button label. */\n\t\tcancelLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Cancel'),\n\t\t},\n\n\t\t/** Next button label. */\n\t\tnextLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Next'),\n\t\t},\n\n\t\t/** Back button label. */\n\t\tbackLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Back'),\n\t\t},\n\n\t\t/** Run-action button label (shown before the first automatic run). */\n\t\trunLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Run'),\n\t\t},\n\n\t\t/** Run-action button label offered after a run already finished. */\n\t\trerunLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Run again'),\n\t\t},\n\n\t\t/** Label shown next to the spinner while a run-action step is running. */\n\t\trunningLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Loading…'),\n\t\t},\n\n\t\t/** Result-phase success text. */\n\t\tsuccessText: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Setup complete.'),\n\t\t},\n\n\t\t/**\n\t\t * Whether the wizard can be dismissed before finishing (Cancel\n\t\t * button, ESC, backdrop click). Pass `false` when a REQUIRED step\n\t\t * is unmet and the host is gating its shell behind this wizard\n\t\t * (ADR-042) — an offered-but-non-functional Cancel would be\n\t\t * misleading. Optional-only setup stays cancellable (default).\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tcancellable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Ids of steps the SERVER already reports as done (e.g.\n\t\t * `useSetupStatus(...).steps` filtered to `done === true`), passed by\n\t\t * the host so a freshly (re)mounted wizard doesn't re-ask something\n\t\t * already persisted in an earlier session — this component's own\n\t\t * `localDone`/`choiceModel` only track the CURRENT session and reset\n\t\t * blank on every mount. Drives both the initial step (`initialStepId`)\n\t\t * and the summary page's done markers.\n\t\t *\n\t\t * @type {Array<string>}\n\t\t */\n\t\tcompletedStepIds: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * The app's dependencies, in the manifest's own shape (app-id strings\n\t\t * or `{ id, name?, required? }`). Falls back to the injected manifest's\n\t\t * `dependencies`. A missing REQUIRED one replaces every step with the\n\t\t * dependency list and disables Next; a missing optional one is listed\n\t\t * on the first step and does not block.\n\t\t *\n\t\t * @type {Array<string|object>}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-the-wizard-checks-dependencies-before-any-step\n\t\t */\n\t\tdependencies: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** Load button label on a dataset card (`loadAction`). */\n\t\tloadLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Load'),\n\t\t},\n\n\t\t/** Load button label once that dataset loaded in this session. */\n\t\treloadLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Load again'),\n\t\t},\n\t},\n\n\temits: ['complete', 'close', 'step-change', 'action-result'],\n\n\t/**\n\t * Live option lists come from the app's own setup status document, so a\n\t * step that offers a choice of things the SERVER ships never has to\n\t * restate them in the manifest. `useSetupStatus` caches per app id, so the\n\t * host's own status fetch (CnAppRoot's setup gate) is the one that runs —\n\t * this reads the same refs rather than asking again.\n\t *\n\t * Only called when a step actually declares `optionsSource`: a wizard with\n\t * none must not start making requests it never made before.\n\t *\n\t * @param {object} props The component props.\n\t * @return {object} `setupStatus` / `setupStatusLoading` for the option resolver.\n\t */\n\tsetup(props) {\n\t\tconst wantsSource = (props.steps || []).some((s) => s && s.optionsSource)\n\t\tif (!wantsSource) {\n\t\t\treturn {}\n\t\t}\n\t\tconst { status, loading } = useSetupStatus(props.appId, { setup: { steps: props.steps } })\n\t\treturn { setupStatus: status, setupStatusLoading: loading }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tchoiceModel: {},\n\t\t\tchoiceValues: {},\n\t\t\tconfigModel: {},\n\t\t\trunning: {},\n\t\t\tactionResult: {},\n\t\t\tlocalDone: {},\n\t\t\tuserTouched: {},\n\t\t\t// Per-card load state for `loadAction` steps, keyed by `loadKey()`.\n\t\t\tdatasetRunning: {},\n\t\t\tdatasetResult: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The title actually rendered by CnWizardDialog: \"Set up {appName}\"\n\t\t * when a display name was passed, otherwise whatever `dialogTitle`\n\t\t * resolves to (a caller override, or its own generic default).\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tresolvedDialogTitle() {\n\t\t\treturn this.appName\n\t\t\t\t? t('nextcloud-vue', 'Set up {app}', { app: this.appName })\n\t\t\t\t: this.dialogTitle\n\t\t},\n\n\t\t/**\n\t\t * Every well-formed step, before `requires` is applied.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tdeclaredSteps() {\n\t\t\treturn (this.steps || []).filter((s) => s && s.id && s.type)\n\t\t},\n\n\t\t/**\n\t\t * Steps that declare `requires` on an app that is not installed and\n\t\t * enabled. They are not offered; the summary names them as skipped.\n\t\t *\n\t\t * @return {Array<{ step: object, missing: Array<string> }>}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-the-wizard-checks-dependencies-before-any-step\n\t\t * @spec openspec/changes/optional-step-requires/specs/cn-setup-wizard/spec.md#requirement-a-step-whose-required-apps-are-absent-is-not-applicable\n\t\t */\n\t\tskippedSteps() {\n\t\t\treturn this.declaredSteps\n\t\t\t\t.filter((s) => Array.isArray(s.requires) && s.requires.length > 0)\n\t\t\t\t.map((step) => {\n\t\t\t\t\tconst known = Object.fromEntries(this.dependencyRows.map((d) => [d.id, d]))\n\t\t\t\t\tconst missing = missingRequiredApps(step.requires, this.serverAppStatuses)\n\t\t\t\t\t\t.map((row) => (known[row.id] || row).name || row.id)\n\t\t\t\t\treturn { step, missing }\n\t\t\t\t})\n\t\t\t\t.filter((entry) => entry.missing.length > 0)\n\t\t},\n\n\t\tsetupSteps() {\n\t\t\tconst skipped = new Set(this.skippedSteps.map((entry) => entry.step.id))\n\t\t\treturn this.declaredSteps.filter((s) => !skipped.has(s.id))\n\t\t},\n\n\t\t/**\n\t\t * Id of the first offered step: where the optional-apps note shows.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tfirstStepId() {\n\t\t\treturn this.setupSteps.length > 0 ? this.setupSteps[0].id : ''\n\t\t},\n\n\t\t/**\n\t\t * The dependency declarations to check: the prop, else the manifest's.\n\t\t *\n\t\t * @return {Array<string|object>}\n\t\t */\n\t\tdependencyEntries() {\n\t\t\tif (Array.isArray(this.dependencies) && this.dependencies.length > 0) {\n\t\t\t\treturn this.dependencies\n\t\t\t}\n\t\t\tconst fromManifest = this.cnManifest && this.cnManifest.dependencies\n\t\t\treturn Array.isArray(fromManifest) ? fromManifest : []\n\t\t},\n\n\t\t/**\n\t\t * The `dependency_statuses` initial state an app may inject from PHP.\n\t\t * Same source CnAppRoot reads; `{}` when the app injects none.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tserverAppStatuses() {\n\t\t\treturn readServerAppStatuses(this.appId)\n\t\t},\n\n\t\t/**\n\t\t * The declared dependencies with their live status.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tdependencyRows() {\n\t\t\treturn checkDependencies(this.dependencyEntries, this.serverAppStatuses)\n\t\t},\n\n\t\t/** @return {Array<object>} Required dependencies that are missing or disabled. */\n\t\tmissingRequired() {\n\t\t\treturn this.dependencyRows.filter((d) => d.required && !isDependencyResolved(d))\n\t\t},\n\n\t\t/** @return {Array<object>} Optional dependencies that are missing or disabled. */\n\t\tmissingOptional() {\n\t\t\treturn this.dependencyRows.filter((d) => !d.required && !isDependencyResolved(d))\n\t\t},\n\n\t\t/**\n\t\t * Whether a required app is missing, so the wizard shows the\n\t\t * dependency list instead of its steps and refuses to continue.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-the-wizard-checks-dependencies-before-any-step\n\t\t */\n\t\tdependencyBlocked() {\n\t\t\treturn this.missingRequired.length > 0\n\t\t},\n\n\t\tdependencyStepSlot() {\n\t\t\treturn 'step-' + DEPENDENCY_STEP_ID\n\t\t},\n\n\t\tdependencySectionName() {\n\t\t\treturn t('nextcloud-vue', 'Apps this app needs')\n\t\t},\n\n\t\tdependencyBlockedText() {\n\t\t\treturn t('nextcloud-vue', 'Setup can start once these apps are installed and enabled: {apps}.', {\n\t\t\t\tapps: this.missingRequired.map((d) => d.name).join(', '),\n\t\t\t})\n\t\t},\n\n\t\toptionalMissingText() {\n\t\t\treturn t('nextcloud-vue', 'Optional, not installed: {apps}. You can add them later.', {\n\t\t\t\tapps: this.missingOptional.map((d) => d.name).join(', '),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Whether the current user is a Nextcloud admin; only admins get the\n\t\t * install and enable buttons.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisAdmin() {\n\t\t\ttry {\n\t\t\t\tconst user = getCurrentUser()\n\t\t\t\treturn !!(user && user.isAdmin)\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\twizardSteps() {\n\t\t\tif (this.dependencyBlocked) {\n\t\t\t\treturn [{\n\t\t\t\t\tid: DEPENDENCY_STEP_ID,\n\t\t\t\t\tlabel: t('nextcloud-vue', 'Required apps'),\n\t\t\t\t\toptional: false,\n\t\t\t\t}]\n\t\t\t}\n\t\t\treturn this.setupSteps.map((s) => ({\n\t\t\t\tid: s.id,\n\t\t\t\tlabel: this.stepTitle(s),\n\t\t\t\toptional: s.required !== true,\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Recap rows for the `summary` step — one per non-summary step, with\n\t\t * the value the user selected (choice label / config field values) and\n\t\t * a done marker (info steps always done; choice steps done when picked;\n\t\t * run-action steps done when the action succeeded).\n\t\t *\n\t\t * An on-demand step (`onDemand: true`) is the exception: it is done\n\t\t * only when its action succeeded in THIS session. Apps report such a\n\t\t * step as `done` on purpose so it never auto-runs (learniq's \"Remove\n\t\t * the example data\"), and reading that flag here ticked a removal\n\t\t * nobody ran. When it did not run it gets `notRun: true` and the value\n\t\t * \"Not run\" instead.\n\t\t *\n\t\t * @return {Array<{ id: string, title: string, value: string, done: boolean, notRun: boolean }>}\n\t\t */\n\t\tsummaryItems() {\n\t\t\tconst skipped = this.skippedSteps\n\t\t\t\t.filter((entry) => entry.step.type !== 'summary' && entry.step.type !== 'info')\n\t\t\t\t.map((entry) => ({\n\t\t\t\t\tid: entry.step.id,\n\t\t\t\t\ttitle: this.stepTitle(entry.step),\n\t\t\t\t\tvalue: t('nextcloud-vue', 'Skipped, needs {apps}', { apps: entry.missing.join(', ') }),\n\t\t\t\t\tdone: false,\n\t\t\t\t\tnotRun: true,\n\t\t\t\t}))\n\t\t\treturn this.setupSteps\n\t\t\t\t.filter((s) => s.type !== 'summary')\n\t\t\t\t.map((step) => {\n\t\t\t\t\tlet value = ''\n\t\t\t\t\tif (step.type === 'choice') {\n\t\t\t\t\t\tconst raw = this.choiceModel[step.id]\n\t\t\t\t\t\tif (Array.isArray(raw)) {\n\t\t\t\t\t\t\tvalue = raw.map((o) => this.choiceLabel(step, o)).join(', ')\n\t\t\t\t\t\t} else if (raw !== null && raw !== undefined && raw !== '') {\n\t\t\t\t\t\t\tvalue = this.choiceLabel(step, raw)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (step.type === 'config-fields') {\n\t\t\t\t\t\t// Only the fields the reader filled in: a row of empty\n\t\t\t\t\t\t// \"Name: , KvK: ,\" reads as broken, not as \"not set\".\n\t\t\t\t\t\tvalue = this.fieldsFor(step)\n\t\t\t\t\t\t\t.filter((f) => {\n\t\t\t\t\t\t\t\tconst v = this.configModel[f.key]\n\t\t\t\t\t\t\t\treturn v !== null && v !== undefined && String(v).trim() !== ''\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.map((f) => `${f.label}: ${this.configModel[f.key]}`)\n\t\t\t\t\t\t\t.join(', ') || t('nextcloud-vue', 'Not set')\n\t\t\t\t\t}\n\t\t\t\t\tif (this.isOnDemand(step)) {\n\t\t\t\t\t\tconst ran = this.ranThisSession(step.id)\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid: step.id,\n\t\t\t\t\t\t\ttitle: this.stepTitle(step),\n\t\t\t\t\t\t\tvalue: ran ? '' : t('nextcloud-vue', 'Not run'),\n\t\t\t\t\t\t\tdone: ran,\n\t\t\t\t\t\t\tnotRun: !ran,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet done\n\t\t\t\t\tif (step.type === 'info') {\n\t\t\t\t\t\tdone = true\n\t\t\t\t\t} else if (step.type === 'choice') {\n\t\t\t\t\t\tdone = this.hasChoice(step) || this.isServerDone(step.id)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdone = this.isStepDone(step.id)\n\t\t\t\t\t}\n\t\t\t\t\treturn { id: step.id, title: this.stepTitle(step), value, done, notRun: false }\n\t\t\t\t})\n\t\t\t\t.concat(skipped)\n\t\t},\n\n\t\t/**\n\t\t * Id of the step the wizard should open on when RESUMING: the first\n\t\t * non-`info`/`summary` step not already done, per the CURRENT session's\n\t\t * local state OR the server-reported `completedStepIds` (a prior\n\t\t * session). Falls back to `''` (CnWizardDialog's own first-step default)\n\t\t * on a fresh setup and when every actionable step is already done.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tinitialStepId() {\n\t\t\t// Fresh setup — nothing done anywhere yet, so there is nothing to\n\t\t\t// resume past. Start at step one so a leading `info`/welcome step is\n\t\t\t// actually seen; resuming is only for returning sessions.\n\t\t\tif (this.completedStepIds.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\t// An on-demand step is never outstanding work, so it is never the\n\t\t\t// step to resume on.\n\t\t\tconst actionable = this.setupSteps.filter((s) => s.type !== 'info' && s.type !== 'summary' && !this.isOnDemand(s))\n\t\t\tconst firstUnmetIndex = actionable.findIndex((s) => {\n\t\t\t\tif (s.type === 'choice') {\n\t\t\t\t\treturn !(this.hasChoice(s) || this.isServerDone(s.id))\n\t\t\t\t}\n\t\t\t\treturn !this.isStepDone(s.id)\n\t\t\t})\n\t\t\t// Done is not the same as seen: an app that pre-satisfies a step at\n\t\t\t// install time (buildiq seeds templates from a repair step) reports it\n\t\t\t// done before anyone opens the wizard. Only finished work BEFORE the\n\t\t\t// outstanding step means there is something to resume past.\n\t\t\tif (firstUnmetIndex <= 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn actionable[firstUnmetIndex].id\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Covers a RESUMED wizard opening straight onto its run-action step\n\t\t// (`initialStepId`) — `onStepChange` only fires on later navigation,\n\t\t// so a step already active at mount time needs its own trigger.\n\t\tthis.maybeAutoRunStep(this.initialStepId || (this.setupSteps[0] && this.setupSteps[0].id))\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Start a `run-action` step's action automatically the moment it\n\t\t * becomes current, instead of waiting for a manual \"Run\" click —\n\t\t * the step has nothing else for the user to decide by then (the\n\t\t * choice it acts on was already made on an earlier step), so\n\t\t * requiring a click before showing progress just adds a stall.\n\t\t * No-ops for any other step type, or one already run/running, and\n\t\t * never fires an on-demand step (`onDemand: true`): those run only\n\t\t * when the user clicks Run.\n\t\t *\n\t\t * @param {string} stepId The step id becoming current.\n\t\t * @return {void}\n\t\t */\n\t\tmaybeAutoRunStep(stepId) {\n\t\t\t// Nothing runs while a required app is missing: every action\n\t\t\t// would fail with an error that does not name the app.\n\t\t\tif (this.dependencyBlocked) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst step = this.setupSteps.find((s) => s.id === stepId)\n\t\t\tif (step && step.type === 'run-action' && !this.isOnDemand(step) && !this.isStepDone(step.id) && !this.running[step.id]) {\n\t\t\t\tthis.runAction(step)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The visible title for a step, resolved through the host app's\n\t\t * translation function.\n\t\t *\n\t\t * `manifest.setup.steps[].title` is authored in English as the\n\t\t * canonical source, exactly like the schema property titles this\n\t\t * component already routes through `cnTranslate` for field labels\n\t\t * (see `fieldsFromSchema` below). The step titles were the one\n\t\t * remaining place rendering the manifest string verbatim, so an\n\t\t * nl-locale user saw a wizard whose field labels were translated and\n\t\t * whose step headings were not.\n\t\t *\n\t\t * Falls back to the step id when a step declares no title, which is\n\t\t * the same fallback the raw bindings used.\n\t\t *\n\t\t * @param {object} step A `manifest.setup.steps[]` entry.\n\t\t * @return {string} The translated title, or the step id.\n\t\t */\n\t\tstepTitle(step) {\n\t\t\tconst raw = (step && step.title) || (step && step.id) || ''\n\t\t\treturn raw === '' ? '' : this.cnTranslate(raw)\n\t\t},\n\n\t\t/**\n\t\t * The visible body for a step, resolved through the host app's\n\t\t * translation function.\n\t\t *\n\t\t * 🔴 THIS USED TO RENDER THE MANIFEST STRING VERBATIM, IN FOUR PLACES.\n\t\t * `stepTitle()` was routed through `cnTranslate` and the body was not,\n\t\t * so a wizard on a Dutch instance showed a translated heading over an\n\t\t * English paragraph, with translated Cancel/Next buttons underneath.\n\t\t * That reads as a bug rather than as a missing string, and the app could\n\t\t * not fix it: decidiq shipped correct Dutch for its setup copy in\n\t\t * `l10n/nl.json`, and the component never asked for it.\n\t\t *\n\t\t * @param {object} step The step declaration.\n\t\t * @return {string} The translated body, or ''.\n\t\t */\n\t\tstepBody(step) {\n\t\t\tconst raw = (step && step.body) || ''\n\t\t\treturn raw === '' ? '' : this.cnTranslate(raw)\n\t\t},\n\n\t\tstepSlot(step) {\n\t\t\treturn 'step-' + step.id\n\t\t},\n\n\t\thasCustomSlot(id) {\n\t\t\treturn !!this.$slots['step-' + id] || !!this.$slots['step-' + id]\n\t\t},\n\n\t\tfieldsFor(step) {\n\t\t\tif (step.schema && typeof step.schema === 'object') {\n\t\t\t\treturn fieldsFromSchema(step.schema, { translate: this.cnTranslate })\n\t\t\t}\n\t\t\t// Fallback: a plain text field per declared config key.\n\t\t\treturn (step.configKeys || []).map((key) => ({ key, label: key, widget: 'text' }))\n\t\t},\n\n\t\t/**\n\t\t * Options for a `choice` step. When the step declares `dependsOn`\n\t\t * (a parent step's configKey) + `optionsByParent`, the option list\n\t\t * is the entry keyed by the parent's currently-selected value — this\n\t\t * is the country → organisation-type cascade. Otherwise the static\n\t\t * `options` array.\n\t\t *\n\t\t * @param {object} step The choice step definition.\n\t\t * @return {Array} The option list to render.\n\t\t */\n\t\toptionsFor(step) {\n\t\t\tlet options = step.options || []\n\t\t\tif (step.optionsSource) {\n\t\t\t\toptions = this.sourcedOptions(step)\n\t\t\t} else if (step.dependsOn && step.optionsByParent) {\n\t\t\t\tconst parentValue = this.choiceValues[step.dependsOn]\n\t\t\t\toptions = (parentValue === null || parentValue === undefined || parentValue === '')\n\t\t\t\t\t? []\n\t\t\t\t\t: (step.optionsByParent[parentValue] || [])\n\t\t\t}\n\t\t\t// The LABEL is translated, the VALUE never is. `scalarChoice()` reads\n\t\t\t// `.value` and that is what reaches `POST /api/setup/config`, so a\n\t\t\t// translated label cannot change what gets stored — while an\n\t\t\t// untranslated one leaves the choice itself in English on a\n\t\t\t// localised instance, which is the half-translated screen this fix\n\t\t\t// exists to remove.\n\t\t\treturn options.map((option) => {\n\t\t\t\tif (!option || typeof option !== 'object' || !option.label) {\n\t\t\t\t\treturn option\n\t\t\t\t}\n\t\t\t\tconst translated = { ...option, label: this.cnTranslate(option.label) }\n\t\t\t\tif (option.description) {\n\t\t\t\t\ttranslated.description = this.cnTranslate(option.description)\n\t\t\t\t}\n\t\t\t\treturn translated\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The option list a `choice` step declares `optionsSource` for, read\n\t\t * from the setup status document the app already serves.\n\t\t *\n\t\t * `optionsSource` names a key in that document (dots walk into nested\n\t\t * objects), and the entries are normalised to the option shape: `id` is\n\t\t * accepted for `value`, `name` for `label`, and a bare `objectCount`\n\t\t * becomes the one stat a card shows. A server that already sends\n\t\t * `stats` keeps them.\n\t\t *\n\t\t * @param {object} step The choice step declaring `optionsSource`.\n\t\t * @return {Array<object>} The options, or [] while the status is loading.\n\t\t */\n\t\tsourcedOptions(step) {\n\t\t\tlet node = this.setupStatus\n\t\t\tfor (const key of String(step.optionsSource).split('.')) {\n\t\t\t\tif (node === null || node === undefined || typeof node !== 'object') {\n\t\t\t\t\treturn []\n\t\t\t\t}\n\t\t\t\tnode = node[key]\n\t\t\t}\n\t\t\tif (!Array.isArray(node)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn node\n\t\t\t\t.filter((entry) => entry && typeof entry === 'object')\n\t\t\t\t.map((entry) => {\n\t\t\t\t\tconst value = entry.value !== undefined ? entry.value : entry.id\n\t\t\t\t\tconst option = {\n\t\t\t\t\t\t...entry,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\tlabel: entry.label || entry.name || String(value),\n\t\t\t\t\t}\n\t\t\t\t\tif (!option.stats && typeof entry.objectCount === 'number' && entry.objectCount > 0) {\n\t\t\t\t\t\toption.stats = [{ label: t('nextcloud-vue', 'Objects'), value: entry.objectCount }]\n\t\t\t\t\t}\n\t\t\t\t\treturn option\n\t\t\t\t})\n\t\t\t\t.filter((option) => option.value !== undefined)\n\t\t},\n\n\t\t/**\n\t\t * Whether a choice step renders as a card grid rather than a dropdown.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @return {boolean} True for `display: \"cards\"`.\n\t\t */\n\t\tisCardChoice(step) {\n\t\t\treturn step.display === 'cards'\n\t\t},\n\n\t\t/**\n\t\t * Whether this step is still waiting for its live option list.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @return {boolean} True while the status document is in flight.\n\t\t */\n\t\tisOptionsLoading(step) {\n\t\t\treturn !!step.optionsSource && this.setupStatusLoading === true\n\t\t},\n\n\t\t/**\n\t\t * The card grid's model: plain values, not the option objects NcSelect\n\t\t * binds. `scalarChoice` already reduces either shape to values, so both\n\t\t * renderers can share one `choiceModel` entry.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @return {unknown} The selected value, or [] / null when nothing is picked.\n\t\t */\n\t\tcardModel(step) {\n\t\t\tconst value = this.scalarChoice(step)\n\t\t\tif (step.multiple === true) {\n\t\t\t\treturn Array.isArray(value) ? value : []\n\t\t\t}\n\t\t\treturn value === undefined ? null : value\n\t\t},\n\n\t\tisChoiceDisabled(step) {\n\t\t\tif (!step.dependsOn) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst parentValue = this.choiceValues[step.dependsOn]\n\t\t\treturn parentValue === null || parentValue === undefined || parentValue === ''\n\t\t},\n\n\t\tdependsOnHint(step) {\n\t\t\tconst parent = this.setupSteps.find((s) => s.configKey === step.dependsOn)\n\t\t\tconst label = parent ? (parent.title || parent.id) : step.dependsOn\n\t\t\treturn t('nextcloud-vue', 'Select \"{step}\" first.', { step: label })\n\t\t},\n\n\t\t/**\n\t\t * The visible label for one selected choice entry.\n\t\t *\n\t\t * A card grid stores plain VALUES where NcSelect stores option objects,\n\t\t * so the recap looked one up and printed the other: the summary read\n\t\t * \"municipality\" instead of \"Municipality\". Resolves a bare value back\n\t\t * to its option, and falls back to the value when the option list is\n\t\t * not (yet) available.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @param {unknown} entry One selected entry: an option object or a value.\n\t\t * @return {string} The label to show.\n\t\t */\n\t\tchoiceLabel(step, entry) {\n\t\t\tif (entry && typeof entry === 'object' && entry.label) {\n\t\t\t\treturn entry.label\n\t\t\t}\n\t\t\tconst match = this.optionsFor(step).find((o) => o && String(o.value) === String(entry))\n\t\t\treturn (match && match.label) ? match.label : String(entry)\n\t\t},\n\n\t\thasChoice(step) {\n\t\t\tconst v = this.choiceModel[step.id]\n\t\t\tif (step.multiple === true) {\n\t\t\t\treturn Array.isArray(v) && v.length > 0\n\t\t\t}\n\t\t\treturn v !== null && v !== undefined && v !== ''\n\t\t},\n\n\t\tscalarChoice(step) {\n\t\t\tconst raw = this.choiceModel[step.id]\n\t\t\tif (step.multiple === true) {\n\t\t\t\treturn (raw || []).map((o) => (o && o.value !== undefined ? o.value : o))\n\t\t\t}\n\t\t\treturn raw && raw.value !== undefined ? raw.value : raw\n\t\t},\n\n\t\tonChoice(step, value) {\n\t\t\tthis.userTouched[step.id] = true\n\t\t\tthis.choiceModel[step.id] = value\n\t\t\tif (step.configKey) {\n\t\t\t\tthis.choiceValues[step.configKey] = this.scalarChoice(step)\n\t\t\t}\n\t\t\t// Reset any dependent child choices when the parent changes.\n\t\t\tfor (const child of this.setupSteps) {\n\t\t\t\tif (child.dependsOn && child.dependsOn === step.configKey) {\n\t\t\t\t\tthis.choiceModel[child.id] = child.multiple === true ? [] : null\n\t\t\t\t\tthis.userTouched[child.id] = false\n\t\t\t\t\tif (child.configKey) {\n\t\t\t\t\t\tthis.choiceValues[child.configKey] = ''\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Re-apply auto-suggestions for steps that derive a default from this one.\n\t\t\tfor (const dep of this.setupSteps) {\n\t\t\t\tif (dep.suggestFrom && dep.suggestFrom === step.configKey) {\n\t\t\t\t\tthis.applySuggestion(dep)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Auto-fill a `choice` step's suggested default from an earlier choice\n\t\t * (its `suggestFrom` configKey → `suggestMap[parentValue]`). No-op once\n\t\t * the user has manually picked here, so a suggestion never clobbers an\n\t\t * explicit choice.\n\t\t *\n\t\t * @param {object} step The dependent choice step.\n\t\t * @return {void}\n\t\t */\n\t\tapplySuggestion(step) {\n\t\t\tif (this.userTouched[step.id] === true) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst parentValue = this.choiceValues[step.suggestFrom]\n\t\t\tif (parentValue === null || parentValue === undefined || parentValue === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst wanted = (step.suggestMap || {})[parentValue]\n\t\t\tif (wanted === null || wanted === undefined) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst opt = this.optionsFor(step).find((o) => o.value === wanted) || { value: wanted, label: String(wanted) }\n\t\t\tthis.choiceModel[step.id] = opt\n\t\t\tif (step.configKey) {\n\t\t\t\tthis.choiceValues[step.configKey] = wanted\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * CnWizardDialog `validate` hook — intercepts Next/Submit to persist\n\t\t * the active step before advancing. `choice`/`config-fields` steps\n\t\t * POST their value via the setup contract; required `choice` steps\n\t\t * block advance until a value is picked; required `run-action` steps\n\t\t * block until the action has succeeded. Returns `true` to advance or\n\t\t * an error string to surface above the step and block navigation.\n\t\t *\n\t\t * @param {string} stepId The active step id.\n\t\t * @return {Promise<boolean|string>} True to advance, or an error message.\n\t\t */\n\t\tasync validateStep(stepId) {\n\t\t\tconst step = this.setupSteps.find((s) => s.id === stepId)\n\t\t\tif (!step) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (step.type === 'choice') {\n\t\t\t\tif (!this.hasChoice(step)) {\n\t\t\t\t\t// Already persisted server-side and the user only back-navigated\n\t\t\t\t\t// onto it — `choiceModel` is blank because it's session-local, not\n\t\t\t\t\t// because nothing is set. Don't force a re-pick, and don't re-POST.\n\t\t\t\t\tif (this.isServerDone(step.id)) {\n\t\t\t\t\t\treturn true\n\t\t\t\t\t}\n\t\t\t\t\treturn step.required === true\n\t\t\t\t\t\t? t('nextcloud-vue', 'Please make a selection to continue.')\n\t\t\t\t\t\t: true\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tawait this.saveConfig({ [step.configKey]: this.scalarChoice(step) })\n\t\t\t\t\tthis.localDone[step.id] = true\n\t\t\t\t\treturn true\n\t\t\t\t} catch (err) {\n\t\t\t\t\treturn this.errorMessage(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (step.type === 'config-fields') {\n\t\t\t\ttry {\n\t\t\t\t\tconst patch = {}\n\t\t\t\t\tfor (const field of this.fieldsFor(step)) {\n\t\t\t\t\t\tpatch[field.key] = this.configModel[field.key]\n\t\t\t\t\t}\n\t\t\t\t\tawait this.saveConfig(patch)\n\t\t\t\t\tthis.localDone[step.id] = true\n\t\t\t\t\treturn true\n\t\t\t\t} catch (err) {\n\t\t\t\t\treturn this.errorMessage(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (step.type === 'run-action' && step.required === true && !this.isStepDone(step.id)) {\n\t\t\t\treturn t('nextcloud-vue', 'Please run this step before continuing.')\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * Persist one or more app-config values via the setup contract.\n\t\t *\n\t\t * @param {object} patch `{ <configKey>: value }` to write.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync saveConfig(patch) {\n\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\timport('@nextcloud/router'),\n\t\t\t])\n\t\t\tawait axios.post(generateUrl(`/apps/${this.appId}/api/setup/config`), patch)\n\t\t},\n\n\t\tasync runAction(step) {\n\t\t\tthis.running[step.id] = true\n\t\t\tthis.actionResult[step.id] = null\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst { data } = await axios.post(generateUrl(`/apps/${this.appId}/api/setup/action/${step.action}`))\n\t\t\t\tconst result = {\n\t\t\t\t\tsuccess: data && data.success !== false,\n\t\t\t\t\tmessage: (data && data.message) || t('nextcloud-vue', 'Done.'),\n\t\t\t\t}\n\t\t\t\tthis.actionResult[step.id] = result\n\t\t\t\tif (result.success) {\n\t\t\t\t\tthis.localDone[step.id] = true\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * @event action-result Emitted when a `run-action` step finishes.\n\t\t\t\t * @type {{ stepId: string, action: string, success: boolean, message: string }}\n\t\t\t\t */\n\t\t\t\tthis.$emit('action-result', { stepId: step.id, action: step.action, ...result })\n\t\t\t} catch (err) {\n\t\t\t\tthis.actionResult[step.id] = { success: false, message: this.errorMessage(err) }\n\t\t\t\tthis.$emit('action-result', { stepId: step.id, action: step.action, success: false, message: this.errorMessage(err) })\n\t\t\t} finally {\n\t\t\t\tthis.running[step.id] = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Key for one card's load state.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @param {object} option The card's option.\n\t\t * @return {string}\n\t\t */\n\t\tloadKey(step, option) {\n\t\t\treturn step.id + '::' + String(option && option.value)\n\t\t},\n\n\t\t/**\n\t\t * Whether a card gets a Load button: the step declares `loadAction`\n\t\t * and the option is not the \"seed nothing\" answer.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @param {object} option The card's option.\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-a-dataset-card-loads-itself\n\t\t */\n\t\tisLoadableOption(step, option) {\n\t\t\treturn !!(step && step.loadAction) && !!option && String(option.value) !== NONE_DATASET\n\t\t},\n\n\t\tisDatasetLoading(step, option) {\n\t\t\treturn this.datasetRunning[this.loadKey(step, option)] === true\n\t\t},\n\n\t\tdatasetResultFor(step, option) {\n\t\t\treturn this.datasetResult[this.loadKey(step, option)] || null\n\t\t},\n\n\t\tloadButtonLabel(step, option) {\n\t\t\tif (this.isDatasetLoading(step, option)) {\n\t\t\t\treturn this.runningLabel\n\t\t\t}\n\t\t\tconst result = this.datasetResultFor(step, option)\n\t\t\treturn (result && result.success) ? this.reloadLabel : this.loadLabel\n\t\t},\n\n\t\tloadAriaLabel(option) {\n\t\t\treturn t('nextcloud-vue', 'Load {name}', { name: option.label })\n\t\t},\n\n\t\t/**\n\t\t * Load one dataset from its card: POST `{ dataset }` to the step's\n\t\t * `loadAction`, spinner on the button while it runs, the result on the\n\t\t * card after. A successful load also selects the card, so the summary\n\t\t * and the stored choice name what was loaded.\n\t\t *\n\t\t * @param {object} step The choice step declaring `loadAction`.\n\t\t * @param {object} option The card's option.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/setup-wizard-card-load-and-dependency-gate/specs/cn-setup-wizard/spec.md#requirement-a-dataset-card-loads-itself\n\t\t */\n\t\tasync loadDataset(step, option) {\n\t\t\tif (!this.isLoadableOption(step, option) || this.isDatasetLoading(step, option)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst key = this.loadKey(step, option)\n\t\t\tthis.datasetRunning[key] = true\n\t\t\tthis.datasetResult[key] = null\n\t\t\tlet result\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst { data } = await axios.post(\n\t\t\t\t\tgenerateUrl(`/apps/${this.appId}/api/setup/action/${step.loadAction}`),\n\t\t\t\t\t{ dataset: option.value },\n\t\t\t\t)\n\t\t\t\tresult = {\n\t\t\t\t\tsuccess: !!data && data.success !== false,\n\t\t\t\t\tmessage: (data && data.message) || t('nextcloud-vue', 'Loaded.'),\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tresult = { success: false, message: this.errorMessage(err) }\n\t\t\t} finally {\n\t\t\t\tthis.datasetRunning[key] = false\n\t\t\t}\n\t\t\tthis.datasetResult[key] = result\n\t\t\tif (result.success) {\n\t\t\t\tthis.selectLoadedOption(step, option)\n\t\t\t\tthis.localDone[step.id] = true\n\t\t\t}\n\t\t\tthis.$emit('action-result', {\n\t\t\t\tstepId: step.id,\n\t\t\t\taction: step.loadAction,\n\t\t\t\tdataset: option.value,\n\t\t\t\t...result,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Select a card that just loaded, adding to (never replacing) the\n\t\t * selection of a `multiple` step.\n\t\t *\n\t\t * @param {object} step The choice step.\n\t\t * @param {object} option The loaded option.\n\t\t * @return {void}\n\t\t */\n\t\tselectLoadedOption(step, option) {\n\t\t\tif (step.multiple === true) {\n\t\t\t\tconst current = this.cardModel(step)\n\t\t\t\tif (current.some((v) => String(v) === String(option.value))) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.onChoice(step, current.concat([option.value]))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.onChoice(step, option.value)\n\t\t},\n\n\t\t/**\n\t\t * A required app was installed from the dependency list. A new app's\n\t\t * scripts and its `OC.appswebroots` entry exist only after a full page\n\t\t * load, and `useAppStatus` caches per page, so reload.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonDependencyInstalled() {\n\t\t\twindow.location.reload()\n\t\t},\n\n\t\t/**\n\t\t * Whether a step is marked on-demand (`onDemand: true`): it runs only\n\t\t * when the user asks, never automatically, and the summary ticks it\n\t\t * only when it ran in this session.\n\t\t *\n\t\t * @param {object} step The manifest step.\n\t\t * @return {boolean}\n\t\t */\n\t\tisOnDemand(step) {\n\t\t\treturn !!step && step.onDemand === true\n\t\t},\n\n\t\t/**\n\t\t * Whether a step's action succeeded in the CURRENT session, ignoring\n\t\t * whatever the server reports.\n\t\t *\n\t\t * @param {string} id Step id.\n\t\t * @return {boolean}\n\t\t */\n\t\tranThisSession(id) {\n\t\t\treturn !!(this.actionResult[id] && this.actionResult[id].success)\n\t\t},\n\n\t\tisStepDone(id) {\n\t\t\treturn this.isServerDone(id) || this.localDone[id] === true || (this.actionResult[id] && this.actionResult[id].success)\n\t\t},\n\n\t\t/**\n\t\t * Whether the server already reported this step done in a prior\n\t\t * session, via the `completedStepIds` prop.\n\t\t *\n\t\t * @param {string} id Step id.\n\t\t * @return {boolean}\n\t\t */\n\t\tisServerDone(id) {\n\t\t\treturn this.completedStepIds.includes(id)\n\t\t},\n\n\t\tonSubmit() {\n\t\t\tif (this.$refs.wizard && this.$refs.wizard.setResult) {\n\t\t\t\tthis.$refs.wizard.setResult({ success: true, message: this.successText })\n\t\t\t}\n\t\t\t/**\n\t\t\t * @event complete Emitted when the last step is submitted (setup finished).\n\t\t\t */\n\t\t\tthis.$emit('complete')\n\t\t},\n\n\t\tonStepChange(payload) {\n\t\t\t// Pre-fill a suggested default when entering a step that derives one.\n\t\t\tconst step = this.setupSteps.find((s) => s.id === payload.stepId)\n\t\t\tif (step && step.suggestFrom) {\n\t\t\t\tthis.applySuggestion(step)\n\t\t\t}\n\t\t\tthis.maybeAutoRunStep(payload.stepId)\n\t\t\t/**\n\t\t\t * @event step-change Emitted when the active step changes.\n\t\t\t * @type {{ stepId: string, stepIndex: number, direction: string }}\n\t\t\t */\n\t\t\tthis.$emit('step-change', payload)\n\t\t},\n\n\t\tonClose() {\n\t\t\t/**\n\t\t\t * @event close Emitted when the dialog should close.\n\t\t\t */\n\t\t\tthis.$emit('close')\n\t\t},\n\n\t\terrorMessage(err) {\n\t\t\tconst data = err && err.response && err.response.data\n\t\t\tif (data && (data.message || data.error)) {\n\t\t\t\treturn data.message || data.error\n\t\t\t}\n\t\t\treturn (err && err.message) || t('nextcloud-vue', 'Something went wrong.')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-setup-step {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-setup-step__nav {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: 8px;\n\tmargin-top: 8px;\n}\n\n.cn-setup-step__running {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 8px;\n\tpadding: 24px 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-setup-load-result {\n\tmargin: 0;\n\tfont-size: var(--font-size-small, 13px);\n}\n\n.cn-setup-load-result--success {\n\tcolor: var(--color-success-text, var(--color-success));\n}\n\n.cn-setup-load-result--error {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-setup-field {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.cn-setup-summary {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n.cn-setup-summary__item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 4px 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-setup-summary__item--done {\n\tcolor: var(--color-main-text);\n}\n\n.cn-setup-summary__mark {\n\tfont-weight: bold;\n\tcolor: var(--color-success);\n}\n\n.cn-setup-summary__label {\n\tflex: 0 0 auto;\n}\n\n.cn-setup-summary__value {\n\tmargin-inline-start: auto;\n\tfont-weight: 600;\n\tcolor: var(--color-main-text);\n}\n\n/* An on-demand step that did not run says so quietly: it is a choice the\n user did not make, not a failure. */\n.cn-setup-summary__item--not-run .cn-setup-summary__value {\n\tfont-weight: normal;\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["CnWizardDialog","CnChoiceCards","CnLeafDependencySettings","t"],"mappings":";;;;;;;;;;AAyNA;AACA,MAAM,kBAAiB,GAAI,wBAAsB;;AAEjD;AACA,MAAM,YAAW,GAAI,OAAK;;AAE1B;AACC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;;AAIA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,eAAe;;CAErB,UAAU,EAAE;AACX,kBAAAA,UAAc;iBACdC,YAAa;4BACbC,YAAwB;AACxB,EAAA,QAAQ;EACR,UAAU;AACV,EAAA,QAAQ;EACR,WAAW;AACX,EAAA,qBAAqB;EACrB,aAAa;EACb;;AAED,CAAA,MAAM,EAAE;AACP;;;;;;AAMC;;AAED,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;AAC5C;;;;EAIA,UAAU,EAAE,EAAE,OAAO,EAAE,IAAG,EAAG;EAC7B;;AAED,CAAA,KAAK,EAAE;AACN;AACA,EAAA,KAAK,EAAE;GACN,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;AAED;AACA,EAAA,KAAK,EAAE;GACN,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;;EAGD,WAAW,EAAE;GACZ,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,MAAMC,SAAC,CAAC,eAAe,EAAE,iBAAiB,CAAC;GACp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