@conduction/nextcloud-vue 2.98.0 → 2.100.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 (141) hide show
  1. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js +12 -0
  2. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js.map +1 -1
  3. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue3.js +11 -2
  4. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue3.js.map +1 -1
  5. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue.js +1 -1
  6. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js +6 -1
  7. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js.map +1 -1
  8. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js +2 -1
  9. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js.map +1 -1
  10. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue.js +1 -1
  11. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue2.js.map +1 -1
  12. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue3.js +1 -1
  13. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue3.js.map +1 -1
  14. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +25 -8
  15. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  16. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +7 -4
  17. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  18. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  19. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +11 -8
  20. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  21. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js +13 -4
  22. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  23. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  24. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +54 -3
  25. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  26. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +16 -2
  27. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  28. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
  29. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +42 -7
  30. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
  31. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +121 -57
  32. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
  33. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js +10 -0
  34. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js.map +1 -1
  35. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js +2 -1
  36. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js.map +1 -1
  37. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +136 -7
  38. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  39. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  40. package/dist/esm/components/CnOrderedListField/CnOrderedListField.vue.js +1 -1
  41. package/dist/esm/components/CnOrderedListField/CnOrderedListField.vue2.js +26 -7
  42. package/dist/esm/components/CnOrderedListField/CnOrderedListField.vue2.js.map +1 -1
  43. package/dist/esm/components/CnOrderedListField/CnOrderedListField.vue3.js +78 -17
  44. package/dist/esm/components/CnOrderedListField/CnOrderedListField.vue3.js.map +1 -1
  45. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  46. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +68 -7
  47. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  48. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +256 -240
  49. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  50. package/dist/esm/components/CnSettingsField/CnSettingsField.vue.js +9 -0
  51. package/dist/esm/components/CnSettingsField/CnSettingsField.vue.js.map +1 -0
  52. package/dist/esm/components/CnSettingsField/CnSettingsField.vue2.js +265 -0
  53. package/dist/esm/components/CnSettingsField/CnSettingsField.vue2.js.map +1 -0
  54. package/dist/esm/components/CnSettingsField/CnSettingsField.vue3.js +191 -0
  55. package/dist/esm/components/CnSettingsField/CnSettingsField.vue3.js.map +1 -0
  56. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue.js +9 -0
  57. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue.js.map +1 -0
  58. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js +537 -0
  59. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js.map +1 -0
  60. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js +99 -0
  61. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js.map +1 -0
  62. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue.js +1 -1
  63. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue2.js +18 -70
  64. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue2.js.map +1 -1
  65. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue3.js +6 -44
  66. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue3.js.map +1 -1
  67. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue.js +1 -1
  68. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue2.js +16 -2
  69. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue2.js.map +1 -1
  70. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue3.js +40 -25
  71. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue3.js.map +1 -1
  72. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
  73. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
  74. package/dist/esm/components/CnWizardDialog/CnWizardDialog.vue.js +1 -1
  75. package/dist/esm/components/CnWizardDialog/CnWizardDialog.vue2.js +7 -7
  76. package/dist/esm/components/CnWizardDialog/CnWizardDialog.vue2.js.map +1 -1
  77. package/dist/esm/components/CnWizardDialog/CnWizardDialog.vue3.js.map +1 -1
  78. package/dist/esm/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue.js +9 -0
  79. package/dist/esm/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue.js.map +1 -0
  80. package/dist/esm/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue2.js +472 -0
  81. package/dist/esm/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue2.js.map +1 -0
  82. package/dist/esm/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue3.js +231 -0
  83. package/dist/esm/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue3.js.map +1 -0
  84. package/dist/esm/components/CnWorkingCalendarWidget/index.js +27 -0
  85. package/dist/esm/components/CnWorkingCalendarWidget/index.js.map +1 -0
  86. package/dist/esm/composables/useFlowStore.js +2 -1
  87. package/dist/esm/composables/useFlowStore.js.map +1 -1
  88. package/dist/esm/index.js +3 -0
  89. package/dist/esm/index.js.map +1 -1
  90. package/dist/esm/l10n/en.json.js +101 -1
  91. package/dist/esm/l10n/en.json.js.map +1 -1
  92. package/dist/esm/l10n/nl.json.js +115 -1
  93. package/dist/esm/l10n/nl.json.js.map +1 -1
  94. package/dist/esm/library-style.js +1 -1
  95. package/dist/esm/nextcloud-vue.css +999 -233
  96. package/dist/esm/utils/libraryWidgetKeys.js +1 -0
  97. package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
  98. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  99. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  100. package/dist/esm/utils/workingCalendarMonth.js +85 -0
  101. package/dist/esm/utils/workingCalendarMonth.js.map +1 -0
  102. package/dist/nextcloud-vue.cjs.js +10314 -7778
  103. package/dist/nextcloud-vue.cjs.js.map +2 -2
  104. package/dist/nextcloud-vue.css +999 -233
  105. package/l10n/en.json +101 -1
  106. package/l10n/nl.json +115 -1
  107. package/package.json +1 -1
  108. package/src/components/CnActionsMenu/CnActionsMenu.vue +14 -1
  109. package/src/components/CnAdminSettingsShell/CnAdminSettingsShell.vue +7 -1
  110. package/src/components/CnBreadcrumbs/CnBreadcrumbs.vue +1 -0
  111. package/src/components/CnDetailPage/CnDetailPage.vue +29 -9
  112. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +13 -4
  113. package/src/components/CnFactsWidget/CnFactsWidget.vue +65 -3
  114. package/src/components/CnFlowsPage/CnFlowBoard.vue +77 -2
  115. package/src/components/CnFlowsPage/CnFlowEditorPage.vue +11 -0
  116. package/src/components/CnIndexPage/CnIndexPage.vue +136 -7
  117. package/src/components/CnOrderedListField/CnOrderedListField.vue +81 -9
  118. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +114 -7
  119. package/src/components/CnSettingsField/CnSettingsField.vue +449 -0
  120. package/src/components/CnSettingsField/index.js +4 -0
  121. package/src/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue +642 -0
  122. package/src/components/CnSettingsFieldsSection/index.js +4 -0
  123. package/src/components/CnSettingsPage/CnSettingsPage.vue +6 -86
  124. package/src/components/CnSetupWizard/CnSetupWizard.vue +37 -3
  125. package/src/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
  126. package/src/components/CnWizardDialog/CnWizardDialog.vue +7 -7
  127. package/src/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue +725 -0
  128. package/src/components/CnWorkingCalendarWidget/index.js +26 -0
  129. package/src/components/index.js +3 -0
  130. package/src/composables/useFlowStore.js +2 -1
  131. package/src/css/badge.css +32 -16
  132. package/src/css/detail-page.css +15 -0
  133. package/src/css/dialog.css +48 -0
  134. package/src/css/look-board-detail.css +80 -8
  135. package/src/css/look-board-index.css +52 -8
  136. package/src/css/look-board.css +301 -1
  137. package/src/index.js +3 -0
  138. package/src/schemas/app-manifest-v2.schema.json +25 -1
  139. package/src/utils/libraryWidgetKeys.js +1 -0
  140. package/src/utils/validateManifestV2.compiled.js +3 -3
  141. package/src/utils/workingCalendarMonth.js +82 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CnFactsWidget.vue3.js","sources":["../../../../src/components/CnFactsWidget/CnFactsWidget.vue?vue&type=template&id=34d72512&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-facts-widget\" data-testid=\"cn-facts-widget\">\n\t\t<p v-if=\"error\" class=\"cn-facts-widget__muted\" data-testid=\"cn-facts-error\">\n\t\t\t{{ tr('Could not load this information') }}\n\t\t</p>\n\t\t<div v-else-if=\"loading && !record\" class=\"cn-facts-widget__loading\">\n\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t</div>\n\t\t<p v-else-if=\"blocks.length === 0\" class=\"cn-facts-widget__muted\" data-testid=\"cn-facts-empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<template v-else>\n\t\t\t<template v-for=\"block in blocks\" :key=\"block.key\">\n\t\t\t\t<dl\n\t\t\t\t\tv-if=\"block.kind === 'rows'\"\n\t\t\t\t\tclass=\"cn-facts-widget__rows\"\n\t\t\t\t\t:class=\"{ 'cn-facts-widget__rows--columns': twoColumns }\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"row in block.rows\"\n\t\t\t\t\t\t:key=\"row.key\"\n\t\t\t\t\t\tclass=\"cn-facts-widget__row\"\n\t\t\t\t\t\t:data-testid=\"`cn-fact-${row.key}`\">\n\t\t\t\t\t\t<dt class=\"cn-facts-widget__label\" :class=\"{ 'cn-facts-widget__label--icon': row.icon }\">\n\t\t\t\t\t\t\t<CnIcon\n\t\t\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t\t\t<span :class=\"{ 'hidden-visually': row.icon }\">{{ row.label }}</span>\n\t\t\t\t\t\t</dt>\n\t\t\t\t\t\t<dd class=\"cn-facts-widget__value\">\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tv-if=\"row.href\"\n\t\t\t\t\t\t\t\t:href=\"row.href\"\n\t\t\t\t\t\t\t\tclass=\"cn-facts-widget__value-link\"\n\t\t\t\t\t\t\t\t:target=\"row.external ? '_blank' : undefined\"\n\t\t\t\t\t\t\t\t:rel=\"row.external ? 'noopener noreferrer' : undefined\">{{ row.value }}</a>\n\t\t\t\t\t\t\t<span v-else>{{ row.masked && !revealed[row.key] ? row.masked : row.value }}</span>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tv-if=\"row.reveal && !revealed[row.key]\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tclass=\"cn-facts-widget__inline-button\"\n\t\t\t\t\t\t\t\t:aria-label=\"revealLabel(row)\"\n\t\t\t\t\t\t\t\t:data-testid=\"`cn-fact-reveal-${row.key}`\"\n\t\t\t\t\t\t\t\t@click=\"reveal(row)\">\n\t\t\t\t\t\t\t\t<EyeOutline :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t{{ showLabel }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tv-if=\"row.copy\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tclass=\"cn-facts-widget__icon-button\"\n\t\t\t\t\t\t\t\t:aria-label=\"copyLabel(row)\"\n\t\t\t\t\t\t\t\t:title=\"copyLabel(row)\"\n\t\t\t\t\t\t\t\t:data-testid=\"`cn-fact-copy-${row.key}`\"\n\t\t\t\t\t\t\t\t@click=\"copy(row)\">\n\t\t\t\t\t\t\t\t<Check v-if=\"copied === row.key\" :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t<ContentCopy v-else :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t</div>\n\t\t\t\t</dl>\n\t\t\t\t<component\n\t\t\t\t\t:is=\"block.to ? 'router-link' : 'strong'\"\n\t\t\t\t\tv-else-if=\"block.kind === 'title'\"\n\t\t\t\t\t:to=\"block.to || undefined\"\n\t\t\t\t\tclass=\"cn-facts-widget__title\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t{{ block.value }}\n\t\t\t\t</component>\n\t\t\t\t<span\n\t\t\t\t\tv-else-if=\"block.kind === 'line'\"\n\t\t\t\t\tclass=\"cn-facts-widget__line\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t{{ block.value }}\n\t\t\t\t</span>\n\t\t\t\t<span\n\t\t\t\t\tv-else-if=\"block.kind === 'text'\"\n\t\t\t\t\tclass=\"cn-facts-widget__text\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t{{ block.value }}\n\t\t\t\t</span>\n\t\t\t\t<div\n\t\t\t\t\tv-else-if=\"block.kind === 'lead'\"\n\t\t\t\t\tclass=\"cn-facts-widget__lead\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"cn-facts-widget__lead-tile\"\n\t\t\t\t\t\t:class=\"`cn-facts-widget__lead-tile--${block.tone}`\"\n\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t\t<CnIcon v-if=\"block.icon\" :name=\"block.icon\" :size=\"20\" />\n\t\t\t\t\t\t<template v-else>{{ block.initials }}</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"cn-facts-widget__lead-text\">\n\t\t\t\t\t\t<strong class=\"cn-facts-widget__lead-title\">{{ block.value }}</strong>\n\t\t\t\t\t\t<span v-if=\"block.subtitle\" class=\"cn-facts-widget__lead-subtitle\">{{ block.subtitle }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tv-else-if=\"block.kind === 'meter'\"\n\t\t\t\t\tclass=\"cn-facts-widget__meter\"\n\t\t\t\t\t:class=\"{ 'cn-facts-widget__meter--over': block.over }\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t<div class=\"cn-facts-widget__meter-head\">\n\t\t\t\t\t\t<span class=\"cn-facts-widget__meter-label\">{{ block.label }}</span>\n\t\t\t\t\t\t<span class=\"cn-facts-widget__meter-value\">{{ block.value }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if=\"block.limit !== null\"\n\t\t\t\t\t\tclass=\"cn-facts-widget__meter-track\"\n\t\t\t\t\t\trole=\"meter\"\n\t\t\t\t\t\t:aria-label=\"block.label\"\n\t\t\t\t\t\t:aria-valuenow=\"block.amount\"\n\t\t\t\t\t\taria-valuemin=\"0\"\n\t\t\t\t\t\t:aria-valuemax=\"block.limit\"\n\t\t\t\t\t\t:aria-valuetext=\"block.value\"\n\t\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}-bar`\">\n\t\t\t\t\t\t<span class=\"cn-facts-widget__meter-bar\" :style=\"{ width: `${block.percent}%` }\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div v-else-if=\"block.kind === 'pill'\">\n\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t:label=\"block.value\"\n\t\t\t\t\t\t:variant=\"block.variant\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\" />\n\t\t\t\t</div>\n\t\t\t</template>\n\t\t</template>\n\t\t<component\n\t\t\t:is=\"link.to ? 'router-link' : 'a'\"\n\t\t\tv-if=\"link && record\"\n\t\t\t:to=\"link.to || undefined\"\n\t\t\t:href=\"link.href || undefined\"\n\t\t\tclass=\"cn-facts-widget__link\"\n\t\t\tdata-testid=\"cn-facts-link\">\n\t\t\t{{ link.label }}\n\t\t</component>\n\t\t<button\n\t\t\tv-if=\"action && record\"\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cn-facts-widget__action\"\n\t\t\tdata-testid=\"cn-facts-action\"\n\t\t\t@click=\"runAction(content.action)\">\n\t\t\t<CnIcon v-if=\"action.icon\" :name=\"action.icon\" :size=\"16\" />\n\t\t\t{{ action.label }}\n\t\t</button>\n\t</div>\n</template>\n\n<script>\nimport { emit } from '@nextcloud/event-bus'\nimport { formatFileSize } from '@nextcloud/files'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcLoadingIcon } from '@nextcloud/vue'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport ContentCopy from 'vue-material-design-icons/ContentCopy.vue'\nimport EyeOutline from 'vue-material-design-icons/EyeOutline.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { resolveEndpointRequest } from '../../composables/useEndpointSource.js'\nimport { useRefLabels } from '../../composables/useRefLabels.js'\nimport { dispatchAction } from '../../utils/actionsDispatcher.js'\nimport { isBadgeVariant } from '../../utils/badgeVariants.js'\nimport { formatBoardDate } from '../../utils/boardDate.js'\nimport { parseDateValue } from '../../utils/dateVariant.js'\nimport { formatMoney, unwrapAppConfig } from '../../utils/formatMetric.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { hasUnresolvedDeepTokens, resolveDeepTokens } from '../../utils/resolveFilterTokens.js'\nimport { userDisplayName } from '../../utils/userDisplayName.js'\n\n/** Kinds of entry a `fields[]` item can be. A labelled item without `as` is a row. */\nconst KINDS = Object.freeze(['row', 'title', 'line', 'pill', 'lead', 'text', 'meter'])\n\n/**\n * The label resolver every facts widget on the page shares, made on first use\n * (the object store needs an active pinia). One batched request per register and\n * schema for the ids it has not seen; a label it has read stays until the page\n * reloads, and an object the store already holds is not fetched at all.\n *\n * @type {{resolve: Function}|null}\n */\nlet refLabels = null\n\n/**\n * The entry that reads a resolved pill's tone: the same reference, with the\n * referenced object's `toneField` as the field to read.\n *\n * @param {object} spec A facts entry.\n * @return {object|null} `{ path, itemPath, resolve }`, or null when no `toneField` is set.\n */\nfunction toneSpec(spec) {\n\tconst resolve = spec && spec.resolve\n\tif (!resolve || typeof resolve !== 'object' || typeof resolve.toneField !== 'string' || resolve.toneField === '') {\n\t\treturn null\n\t}\n\treturn { path: spec.path, itemPath: spec.itemPath, resolve: { register: resolve.register, schema: resolve.schema, labelField: resolve.toneField } }\n}\n\n/** The page-wide reference label resolver. */\nfunction sharedRefLabels() {\n\tif (!refLabels) {\n\t\trefLabels = useRefLabels()\n\t}\n\treturn refLabels\n}\n\n/**\n * Key of a resolved reference in the widget's `labels` data.\n *\n * @param {{register: string, schema: string, labelField?: string}} resolve The entry's `resolve` config.\n * @param {string} id The referenced object's id.\n * @return {string} The key.\n */\nfunction refKey(resolve, id) {\n\treturn `${resolve.register}/${resolve.schema}/${resolve.labelField || ''}/${id}`\n}\n\n/** Event-bus channel a reveal of a masked value is announced on, so an app can log it. */\nexport const FACTS_REVEAL_CHANNEL = 'cn:facts:reveal'\n\n/**\n * CnFactsWidget — the `facts` widget: a card of facts about ONE object.\n *\n * Renders the configured fields of the current detail-page object, or of one\n * other object named by `content.source`, as the side cards on the screens\n * draw them: label/value rows (a two-column grid, label muted), a bold title\n * line that may link, muted meta lines that join several fields with \" · \",\n * a status pill, and one link at the foot.\n *\n * Everything is configuration; nothing in it knows an app:\n *\n * ```json\n * {\n * \"type\": \"facts\",\n * \"title\": \"Zaak\",\n * \"content\": {\n * \"source\": { \"register\": \"dossiq\", \"schema\": \"case\", \"id\": \"@object.case\" },\n * \"fields\": [\n * { \"as\": \"title\", \"path\": \"title\", \"route\": { \"name\": \"CaseDetail\", \"params\": { \"id\": \"@source.id\" } } },\n * { \"as\": \"line\", \"parts\": [\"identifier\", \"caseTypeTitle\"] },\n * { \"as\": \"pill\", \"path\": \"status\", \"map\": { \"open\": \"In behandeling\" } },\n * { \"path\": \"deadline\", \"label\": \"Termijn\", \"format\": \"date\" }\n * ],\n * \"link\": { \"label\": \"Naar de zaak\", \"route\": { \"name\": \"CaseDetail\", \"params\": { \"id\": \"@source.id\" } } },\n * \"emptyText\": \"Geen zaak\"\n * }\n * }\n * ```\n *\n * Tokens: `source.id` takes the shared filter tokens; `source.url` takes them\n * inside the url, the endpoint grammar (`/apps/x/api/y/@objectId`)\n * (`@objectId`, `@object.<field>`, `@workspace.<key>`, `@me`, ...). Routes\n * and the link also take `@source.<field>` (a field of the object shown).\n * A source whose id token does not resolve renders the empty text, never a\n * request for the literal token.\n *\n * Labels, map values, the link label and the empty text go through the host\n * app's translate (`cnTranslate`).\n */\nexport default {\n\tname: 'CnFactsWidget',\n\n\tcomponents: { Check, CnIcon, CnStatusBadge, ContentCopy, EyeOutline, NcLoadingIcon },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t\tcnObjectContext: { default: null },\n\t\tcnWorkspaceContext: { default: null },\n\t\t/** The page's app config; its `currency` is the reporting currency a money value falls back to. */\n\t\tcnAppConfig: { default: null },\n\t\t/** Pre-bound action dispatcher of CnPageRenderer, for `action` / `headerAction`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `fields` — the entries, in order. Each is `{ path, label?, as?, from?, format?, map?, itemPath?, parts?, separator?, route?, variant?, variantMap?, colorMap?, icon?, copy?, reveal?, text?, title?, subtitle?, initialsPath?, tone? }`.\n\t\t * `as` is `row` (default when `label` or `icon` is set), `title`, `line`, `text` (a line in the normal ink), `lead` (an icon tile or initials beside `title` and `subtitle`), `pill` or `meter`.\n\t\t * A `meter` shows the amount at `path` against the limit at `limitPath` (or a constant `limit`) as \"12 of 50\" with a bar; past the limit the bar turns red and the text says \"over the limit\"; without a positive limit it shows the amount and no bar.\n\t\t * A row's `format` may also be `email`, `phone` or `url` (a link) or `masked` (the last four characters; `reveal: true` adds Show). `copy: true` adds a copy button; `icon` replaces the label.\n\t\t * A part may be `{ text }`, a constant; a `line` or `text` entry without `path` or `parts` shows its `text`.\n\t\t * `resolve: { register, schema, labelField? }` on an entry or a part turns a value that is a reference (an id, or a list of ids) into the label of the referenced object (`labelField`, else `title`, then `name`): the case type or status of a task shows its name, not its uuid. The ids are fetched once per register and schema through the object store and shared by every facts widget on the page; the entry stays empty until its label is known, and when no label can be read. A resolved value works as a pill too: `map` is applied to the resolved label, and `variantMap` / `colorMap` look the tone up by the value of `resolve.toneField` on the referenced object when that is set (a status named by its `name`, coloured by its `state`), then by the resolved label, then by the stored value.\n\t\t * `format: 'user'` shows a Nextcloud user id as the user's display name, read once per id; the entry stays empty until the name is known.\n\t\t * - `action` — an action drawn as a button under the facts; `headerAction` — one drawn in the card header (reported through the `header` event).\n\t\t * `format` is `text` (default), `date` (board short date), `date-long` (always with the year), `list` (an array joined by \", \", each item read at `itemPath`), `bytes` (a size, \"1.5 MB\") or `currency` (a money amount in the reader's language, \"€ 1.234,50\": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).\n\t\t * `map` turns a raw value into a label (translated). `parts` (on a `line`) lists paths, or `{ path, label?, format? }`, joined by `separator` (default \" · \"); empty parts are dropped.\n\t\t * - `source` — `{ register, schema, id }` or `{ url }`; omitted = the current object. An entry with `from: \"object\"` reads the current object even then (a client card that also shows the ticket's channel).\n\t\t * - `link` — `{ label, route? | href? }` at the foot.\n\t\t * - `hideEmpty` — drop an entry whose value is empty (default true).\n\t\t * - `columns` — `2` lays the rows out in two columns with the label above the value (board DqContact); a row with `parts` joins them like a line (an address on one row).\n\t\t * - `emptyText` — shown when no entry has a value.\n\t\t *\n\t\t * @type {{fields?: Array<object>, source?: object, link?: object, hideEmpty?: boolean, emptyText?: string}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * The current detail-page object, passed by the detail page host.\n\t\t * Read when `content.source` is not set.\n\t\t */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The current detail-page object id, for the `@objectId` token. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['header', 'reveal'],\n\n\tdata() {\n\t\treturn {\n\t\t\tfetched: null,\n\t\t\tloading: false,\n\t\t\terror: false,\n\t\t\t/** Keys of the masked rows the reader chose to show. */\n\t\t\trevealed: {},\n\t\t\t/** Key of the row whose value was just copied. */\n\t\t\tcopied: '',\n\t\t\t/** Labels of the referenced objects read so far, by `refKey`. */\n\t\t\tlabels: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the rows sit in two columns, label above value.\n\t\t *\n\t\t * @spec openspec/changes/facts-columns/specs/facts-widget/spec.md#requirement-facts-rows-can-sit-in-two-columns\n\t\t * @return {boolean}\n\t\t */\n\t\ttwoColumns() {\n\t\t\treturn Number(this.content?.columns) === 2\n\t\t},\n\n\t\t/**\n\t\t * The token context: the detail object (prop, else the injected context)\n\t\t * and the page workspace.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\ttokenCtx() {\n\t\t\tconst unwrap = (c) => (c && typeof c === 'object' && 'value' in c ? c.value : c)\n\t\t\tconst injected = unwrap(this.cnObjectContext) || {}\n\t\t\treturn {\n\t\t\t\t...injected,\n\t\t\t\tobjectId: this.objectId ?? injected.objectId ?? this.objectData?.id ?? null,\n\t\t\t\tobject: this.objectData || injected.object || null,\n\t\t\t\tworkspace: unwrap(this.cnWorkspaceContext) || {},\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The source declaration with its tokens resolved, or null for the current object.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tresolvedSource() {\n\t\t\tconst source = this.content?.source\n\t\t\tif (!source || typeof source !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (typeof source.url === 'string' && source.url !== '') {\n\t\t\t\t// The endpoint grammar: tokens INSIDE the url, and a request\n\t\t\t\t// that is blocked while one leaves an empty path segment.\n\t\t\t\tconst request = resolveEndpointRequest({ url: source.url }, this.tokenCtx)\n\t\t\t\treturn { url: request.blocked ? '' : request.url }\n\t\t\t}\n\t\t\treturn resolveDeepTokens(source, this.tokenCtx)\n\t\t},\n\n\t\t/**\n\t\t * A stable key of the resolved source, so the widget refetches only when it changes.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tsourceKey() {\n\t\t\treturn this.resolvedSource ? JSON.stringify(this.resolvedSource) : ''\n\t\t},\n\n\t\t/**\n\t\t * The object the facts are read from.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\trecord() {\n\t\t\treturn this.resolvedSource ? this.fetched : this.objectData\n\t\t},\n\n\t\t/**\n\t\t * The entries to draw, consecutive rows grouped into one list.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tblocks() {\n\t\t\tconst sourceRecord = this.record\n\t\t\tif (!sourceRecord) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst fields = Array.isArray(this.content?.fields) ? this.content.fields : []\n\t\t\tconst hideEmpty = this.content?.hideEmpty !== false\n\t\t\tconst out = []\n\t\t\tfields.forEach((field, index) => {\n\t\t\t\tif (!field || typeof field !== 'object') {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// `from: \"object\"` reads the page's own object while the card shows a `source`.\n\t\t\t\tconst record = field.from === 'object' && this.objectData ? this.objectData : sourceRecord\n\t\t\t\tconst kind = this.kindOf(field)\n\t\t\t\tconst key = String(field.key || field.path || `${kind}-${index}`).replace(/[^\\w-]/g, '-')\n\t\t\t\tconst value = this.entryValue(record, field, kind)\n\t\t\t\tif (value === '' && (hideEmpty || kind === 'lead')) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (kind === 'row') {\n\t\t\t\t\tconst last = out[out.length - 1]\n\t\t\t\t\tconst row = { key, label: this.tr(field.label || ''), value, ...this.rowExtras(record, field, value) }\n\t\t\t\t\tif (last && last.kind === 'rows') {\n\t\t\t\t\t\tlast.rows.push(row)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tout.push({ kind: 'rows', key: `rows-${index}`, rows: [row] })\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst block = { kind, key, value }\n\t\t\t\tif (kind === 'lead') {\n\t\t\t\t\tblock.subtitle = this.partsValue(record, field.subtitle)\n\t\t\t\t\tblock.icon = typeof field.icon === 'string' ? field.icon : ''\n\t\t\t\t\tblock.initials = block.icon ? '' : this.initialsOf(readPath(record, field.initialsPath))\n\t\t\t\t\tblock.tone = ['success', 'info', 'warning', 'error'].includes(field.tone) ? field.tone : 'neutral'\n\t\t\t\t}\n\t\t\t\tif (kind === 'meter') {\n\t\t\t\t\tObject.assign(block, this.meterOf(record, field))\n\t\t\t\t}\n\t\t\t\tif (kind === 'title' && field.route) {\n\t\t\t\t\tblock.to = this.resolveRoute(field.route, record)\n\t\t\t\t}\n\t\t\t\tif (kind === 'pill') {\n\t\t\t\t\tconst raw = readPath(record, field.path)\n\t\t\t\t\tconst colours = field.variantMap || field.colorMap\n\t\t\t\t\t// A resolved pill looks its tone up by the referenced object's tone field,\n\t\t\t\t\t// then by the resolved label, then by the stored value.\n\t\t\t\t\tconst keys = field.resolve && typeof field.resolve === 'object'\n\t\t\t\t\t\t? [toneSpec(field) ? this.refLabels(raw, toneSpec(field))[0] : undefined, this.refLabels(raw, field)[0], raw]\n\t\t\t\t\t\t: [raw]\n\t\t\t\t\tconst hit = colours ? keys.find((candidate) => (typeof candidate === 'string' || typeof candidate === 'number') && Object.hasOwn(colours, candidate)) : undefined\n\t\t\t\t\tconst variant = hit !== undefined ? colours[hit] : field.variant\n\t\t\t\t\tblock.variant = isBadgeVariant(variant) ? variant : 'default'\n\t\t\t\t}\n\t\t\t\tout.push(block)\n\t\t\t})\n\t\t\treturn out\n\t\t},\n\n\t\t/**\n\t\t * The foot link, resolved, or null.\n\t\t *\n\t\t * @return {{label: string, to?: object, href?: string}|null}\n\t\t */\n\t\tlink() {\n\t\t\tconst link = this.content?.link\n\t\t\tif (!link || typeof link !== 'object' || !link.label) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (link.route) {\n\t\t\t\tconst to = this.resolveRoute(link.route, this.record)\n\t\t\t\treturn to ? { label: this.tr(link.label), to } : null\n\t\t\t}\n\t\t\tif (typeof link.href === 'string' && link.href !== '') {\n\t\t\t\tconst href = this.resolveTemplate(link.href, this.record)\n\t\t\t\treturn href ? { label: this.tr(link.label), href } : null\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\n\t\t/**\n\t\t * The action under the facts, as drawn: `{ label, icon }`, or null.\n\t\t *\n\t\t * @return {{label: string, icon: string}|null}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\taction() {\n\t\t\treturn this.actionView(this.content?.action)\n\t\t},\n\n\t\t/**\n\t\t * The header action, as drawn: `{ label, icon }`, or null.\n\t\t *\n\t\t * @return {{label: string, icon: string}|null}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\theaderAction() {\n\t\t\treturn this.actionView(this.content?.headerAction)\n\t\t},\n\n\t\t/** @return {string} The reveal button's text. */\n\t\tshowLabel() {\n\t\t\treturn t('nextcloud-vue', 'Show')\n\t\t},\n\n\t\t/**\n\t\t * The empty line.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\temptyLabel() {\n\t\t\treturn this.tr(this.content?.emptyText || 'Nothing to show yet')\n\t\t},\n\t},\n\n\twatch: {\n\t\tsourceKey: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.load()\n\t\t\t},\n\t\t},\n\n\t\trecord: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.loadLabels()\n\t\t\t},\n\t\t},\n\n\t\theaderAction: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.emitHeader()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate through the host app.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string}\n\t\t */\n\t\ttr(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\t/**\n\t\t * The kind of a field entry.\n\t\t *\n\t\t * @param {object} field The entry.\n\t\t * @return {string} `row`, `title`, `line` or `pill`.\n\t\t */\n\t\tkindOf(field) {\n\t\t\tif (KINDS.includes(field.as)) {\n\t\t\t\treturn field.as\n\t\t\t}\n\t\t\treturn field.label || field.icon ? 'row' : 'line'\n\t\t},\n\n\t\t/**\n\t\t * A meter entry's parts: the amount at `path` against the limit at\n\t\t * `limitPath` (or a constant `limit`), both formatted with the entry's\n\t\t * `format`. Without a positive numeric limit there is no bar, only the\n\t\t * amount. Past the limit the text says so, so the state never rests on\n\t\t * the bar's colour alone.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @return {{label: string, value: string, amount: number|null, limit: number|null, percent: number, over: boolean}}\n\t\t * @spec openspec/changes/facts-meter-row/specs/facts-meter-row/spec.md#requirement-a-facts-entry-can-be-a-meter\n\t\t */\n\t\tmeterOf(record, field) {\n\t\t\tconst amount = Number(readPath(record, field.path))\n\t\t\tconst rawLimit = typeof field.limitPath === 'string' && field.limitPath !== '' ? readPath(record, field.limitPath) : field.limit\n\t\t\tconst limit = rawLimit === null || rawLimit === undefined || rawLimit === '' ? NaN : Number(rawLimit)\n\t\t\tconst label = this.tr(field.label || '')\n\t\t\tconst value = this.valueOf(record, field)\n\t\t\tif (!Number.isFinite(amount) || !Number.isFinite(limit) || limit <= 0) {\n\t\t\t\treturn { label, value, amount: Number.isFinite(amount) ? amount : null, limit: null, percent: 0, over: false }\n\t\t\t}\n\t\t\tconst over = amount > limit\n\t\t\tconst limitText = this.format(limit, field, record)\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tvalue: over\n\t\t\t\t\t? t('nextcloud-vue', '{value} of {limit}, over the limit', { value, limit: limitText })\n\t\t\t\t\t: t('nextcloud-vue', '{value} of {limit}', { value, limit: limitText }),\n\n\t\t\t\tamount,\n\t\t\t\tlimit,\n\t\t\t\tpercent: Math.max(0, Math.min(100, (amount / limit) * 100)),\n\t\t\t\tover,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The display text of an entry of any kind: a lead's title, the parts of\n\t\t * a line or text, a constant `text`, else the value at `path`.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @param {string} kind The entry's kind.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\tentryValue(record, field, kind) {\n\t\t\tif (kind === 'lead') {\n\t\t\t\treturn this.partsValue(record, field.title)\n\t\t\t}\n\t\t\tif ((kind === 'line' || kind === 'text' || kind === 'row') && Array.isArray(field.parts)) {\n\t\t\t\treturn this.lineValue(record, field)\n\t\t\t}\n\t\t\tif ((kind === 'line' || kind === 'text') && !field.path && typeof field.text === 'string') {\n\t\t\t\treturn this.tr(field.text)\n\t\t\t}\n\t\t\treturn this.valueOf(record, field)\n\t\t},\n\n\t\t/**\n\t\t * A lead's title or subtitle: a path, a part spec, or an array of parts\n\t\t * joined as a line joins them.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {string|object|Array} spec The declaration.\n\t\t * @return {string}\n\t\t */\n\t\tpartsValue(record, spec) {\n\t\t\tif (typeof spec === 'string' && spec !== '') {\n\t\t\t\treturn this.valueOf(record, { path: spec })\n\t\t\t}\n\t\t\tif (Array.isArray(spec)) {\n\t\t\t\treturn this.lineValue(record, { parts: spec })\n\t\t\t}\n\t\t\tif (spec && typeof spec === 'object') {\n\t\t\t\treturn this.lineValue(record, { parts: [spec] })\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/**\n\t\t * The initials of a name: \"Sanne de Vries\" reads \"SV\".\n\t\t *\n\t\t * @param {unknown} name The name.\n\t\t * @return {string}\n\t\t */\n\t\tinitialsOf(name) {\n\t\t\tif (typeof name !== 'string' || name.trim() === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst words = name.trim().split(/\\s+/).filter((word) => /^\\p{Lu}/u.test(word))\n\t\t\tconst picked = words.length ? words : name.trim().split(/\\s+/)\n\t\t\tconst first = picked[0].charAt(0)\n\t\t\tconst last = picked.length > 1 ? picked[picked.length - 1].charAt(0) : ''\n\t\t\treturn (first + last).toUpperCase()\n\t\t},\n\n\t\t/**\n\t\t * What a row adds to its value: an icon, a link for the email, phone\n\t\t * and url formats, the masked text, and the copy and reveal buttons.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @param {string} value The display text.\n\t\t * @return {object}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\trowExtras(record, field, value) {\n\t\t\tconst extras = {\n\t\t\t\ticon: typeof field.icon === 'string' ? field.icon : '',\n\t\t\t\tpath: field.path || '',\n\t\t\t\traw: readPath(record, field.path),\n\t\t\t\tcopy: field.copy === true && value !== '',\n\t\t\t\treveal: false,\n\t\t\t\tmasked: '',\n\t\t\t\thref: '',\n\t\t\t\texternal: false,\n\t\t\t}\n\t\t\tif (value === '') {\n\t\t\t\treturn extras\n\t\t\t}\n\t\t\tif (field.format === 'email') {\n\t\t\t\textras.href = `mailto:${value}`\n\t\t\t} else if (field.format === 'phone') {\n\t\t\t\textras.href = `tel:${value.replace(/[^\\d+]/g, '')}`\n\t\t\t} else if (field.format === 'url') {\n\t\t\t\textras.href = /^https?:\\/\\//i.test(value) ? value : `https://${value}`\n\t\t\t\textras.external = true\n\t\t\t} else if (field.format === 'masked') {\n\t\t\t\textras.masked = value.length > 4 ? '*'.repeat(Math.min(value.length - 4, 5)) + value.slice(-4) : value\n\t\t\t\textras.reveal = field.reveal === true && value.length > 4\n\t\t\t}\n\t\t\treturn extras\n\t\t},\n\n\t\t/**\n\t\t * Show a masked value, and say so: the `reveal` event and the event-bus\n\t\t * channel {@link FACTS_REVEAL_CHANNEL}, so an app can log who saw it.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\treveal(row) {\n\t\t\tthis.revealed = { ...this.revealed, [row.key]: true }\n\t\t\tconst detail = { path: row.path }\n\t\t\t/**\n\t\t\t * @event reveal Emitted when the reader shows a masked value.\n\t\t\t * @type {{path: string}} The path of the shown field.\n\t\t\t */\n\t\t\tthis.$emit('reveal', detail)\n\t\t\temit(FACTS_REVEAL_CHANNEL, { ...detail, objectId: this.tokenCtx.objectId, register: this.tokenCtx.register || null, schema: this.tokenCtx.schema || null })\n\t\t},\n\n\t\t/**\n\t\t * Copy a row's value to the clipboard.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync copy(row) {\n\t\t\tconst text = row.raw === null || row.raw === undefined || typeof row.raw === 'object' ? row.value : String(row.raw)\n\t\t\ttry {\n\t\t\t\tawait navigator.clipboard.writeText(text)\n\t\t\t\tthis.copied = row.key\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (this.copied === row.key) {\n\t\t\t\t\t\tthis.copied = ''\n\t\t\t\t\t}\n\t\t\t\t}, 2000)\n\t\t\t} catch (e) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnFactsWidget] could not copy:', e?.message || e)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row The row.\n\t\t * @return {string} The copy button's accessible name.\n\t\t */\n\t\tcopyLabel(row) {\n\t\t\treturn this.copied === row.key\n\t\t\t\t? t('nextcloud-vue', 'Copied')\n\t\t\t\t: t('nextcloud-vue', 'Copy {label}', { label: row.label || row.value })\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row The row.\n\t\t * @return {string} The reveal button's accessible name.\n\t\t */\n\t\trevealLabel(row) {\n\t\t\treturn t('nextcloud-vue', 'Show {label}', { label: row.label || '' }).trim()\n\t\t},\n\n\t\t/**\n\t\t * The drawn part of an action declaration.\n\t\t *\n\t\t * @param {object} action The declaration.\n\t\t * @return {{label: string, icon: string}|null}\n\t\t */\n\t\tactionView(action) {\n\t\t\tif (!action || typeof action !== 'object' || typeof action.label !== 'string' || action.label === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { label: this.tr(action.label), icon: typeof action.icon === 'string' ? action.icon : '' }\n\t\t},\n\n\t\t/**\n\t\t * Dispatch an action with the record's tokens resolved (`@objectId`,\n\t\t * `@object.<field>`), through the page's dispatcher when there is one.\n\t\t *\n\t\t * @param {object} action The declaration.\n\t\t * @return {unknown}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\trunAction(action) {\n\t\t\tif (!action || typeof action !== 'object') {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst resolved = resolveDeepTokens(action, this.tokenCtx)\n\t\t\tif (typeof this.cnDispatchAction === 'function') {\n\t\t\t\treturn this.cnDispatchAction(resolved)\n\t\t\t}\n\t\t\treturn dispatchAction(resolved, { router: this.$router || null })\n\t\t},\n\n\t\t/** Tell the card around the facts what its header shows (the header action). */\n\t\temitHeader() {\n\t\t\tconst view = this.headerAction\n\t\t\t/**\n\t\t\t * @event header Emitted with the card header's parts: the header action, if any.\n\t\t\t * @type {{link: null, note: string, action: (object|null)}} `action` is `{ label, icon, run }`.\n\t\t\t */\n\t\t\tthis.$emit('header', {\n\t\t\t\tlink: null,\n\t\t\t\tnote: '',\n\t\t\t\taction: view ? { ...view, run: () => this.runAction(this.content.headerAction) } : null,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The text of a reference: the labels of the objects its id(s) name, joined\n\t\t * by \", \". An id whose label is not known yet (or cannot be read) adds nothing.\n\t\t *\n\t\t * @param {unknown} raw The id, or a list of ids (or of `{ id }` objects).\n\t\t * @param {object} spec `{ resolve: { register, schema, labelField? }, itemPath? }`.\n\t\t * @return {string}\n\t\t */\n\t\trefText(raw, spec) {\n\t\t\treturn this.refLabels(raw, spec)\n\t\t\t\t.map((label) => (spec.map && Object.hasOwn(spec.map, label) ? this.tr(spec.map[label]) : label))\n\t\t\t\t.join(', ')\n\t\t},\n\n\t\t/**\n\t\t * The labels of a reference as read, before `map` is applied: the key a\n\t\t * pill's `variantMap` and `colorMap` look up.\n\t\t *\n\t\t * @param {unknown} raw The id, or a list of ids.\n\t\t * @param {object} spec `{ resolve, itemPath? }`.\n\t\t * @return {string[]}\n\t\t */\n\t\trefLabels(raw, spec) {\n\t\t\treturn this.refIds(raw, spec)\n\t\t\t\t.map((id) => this.labels[refKey(spec.resolve, id)])\n\t\t\t\t.filter((label) => typeof label === 'string' && label !== '')\n\t\t},\n\n\t\t/**\n\t\t * The ids a reference value holds.\n\t\t *\n\t\t * @param {unknown} raw The value.\n\t\t * @param {object} spec `{ itemPath? }`.\n\t\t * @return {string[]}\n\t\t */\n\t\trefIds(raw, spec) {\n\t\t\treturn (Array.isArray(raw) ? raw : [raw])\n\t\t\t\t.map((item) => (item && typeof item === 'object' ? (spec.itemPath ? readPath(item, spec.itemPath) : (item.id ?? item.uuid)) : item))\n\t\t\t\t.filter((id) => id !== null && id !== undefined && id !== '' && typeof id !== 'object')\n\t\t\t\t.map(String)\n\t\t},\n\n\t\t/**\n\t\t * Every entry or part that carries `resolve`, with the record's value at its path.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @return {Array<{spec: object, raw: unknown}>}\n\t\t */\n\t\trefSpecs(record) {\n\t\t\tconst fields = Array.isArray(this.content?.fields) ? this.content.fields : []\n\t\t\tconst specs = []\n\t\t\tconst visit = (spec) => {\n\t\t\t\tif (!spec || typeof spec !== 'object') {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (spec.resolve && typeof spec.resolve === 'object' && spec.path) {\n\t\t\t\t\tspecs.push({ spec, raw: readPath(record, spec.path) })\n\t\t\t\t\tif (toneSpec(spec)) {\n\t\t\t\t\t\tspecs.push({ spec: toneSpec(spec), raw: readPath(record, spec.path) })\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst nested = [...(Array.isArray(spec.parts) ? spec.parts : []), ...(Array.isArray(spec.title) ? spec.title : [spec.title]), ...(Array.isArray(spec.subtitle) ? spec.subtitle : [spec.subtitle])]\n\t\t\t\tnested.forEach(visit)\n\t\t\t}\n\t\t\tfields.forEach(visit)\n\t\t\treturn specs\n\t\t},\n\n\t\t/**\n\t\t * Read the labels of the referenced objects, one batched request per\n\t\t * register and schema, and keep them in `labels`.\n\t\t *\n\t\t * @param {object|null} record The object shown (defaults to the current record).\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadLabels(record = this.record) {\n\t\t\tif (!record) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst groups = new Map()\n\t\t\tfor (const { spec, raw } of this.refSpecs(record)) {\n\t\t\t\tconst { register, schema, labelField } = spec.resolve\n\t\t\t\tif (!register || !schema) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst groupKey = `${register}/${schema}/${labelField || ''}`\n\t\t\t\tconst group = groups.get(groupKey) || { resolve: spec.resolve, ids: new Set() }\n\t\t\t\tthis.refIds(raw, spec).forEach((id) => group.ids.add(id))\n\t\t\t\tgroups.set(groupKey, group)\n\t\t\t}\n\t\t\tif (groups.size === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst resolver = sharedRefLabels()\n\t\t\tconst next = { ...this.labels }\n\t\t\tawait Promise.all([...groups.values()].map(async ({ resolve, ids }) => {\n\t\t\t\tconst found = await resolver.resolve(resolve.register, resolve.schema, [...ids], resolve.labelField)\n\t\t\t\tObject.entries(found).forEach(([id, label]) => {\n\t\t\t\t\tnext[refKey(resolve, id)] = label\n\t\t\t\t})\n\t\t\t}))\n\t\t\tthis.labels = next\n\t\t},\n\n\t\t/**\n\t\t * Read the source object.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync load() {\n\t\t\tconst source = this.resolvedSource\n\t\t\tthis.error = false\n\t\t\tif (!source) {\n\t\t\t\tthis.fetched = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst url = this.sourceUrl(source)\n\t\t\tif (!url) {\n\t\t\t\tthis.fetched = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\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 full = url.startsWith('/apps/') || url.startsWith('/ocs/') ? generateUrl(url) : url\n\t\t\t\tconst response = await axios.get(full)\n\t\t\t\tconst data = response && response.data\n\t\t\t\tthis.fetched = data && typeof data === 'object' && !Array.isArray(data) ? data : null\n\t\t\t} catch (e) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnFactsWidget] the source could not be read:', e?.message || e)\n\t\t\t\tthis.fetched = null\n\t\t\t\tthis.error = true\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 * The URL of a resolved source, or '' when it cannot be read yet.\n\t\t *\n\t\t * @param {object} source The resolved source.\n\t\t * @return {string}\n\t\t */\n\t\tsourceUrl(source) {\n\t\t\tif (typeof source.url === 'string') {\n\t\t\t\treturn source.url\n\t\t\t}\n\t\t\tif (hasUnresolvedDeepTokens(source)) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst { register, schema, id } = source\n\t\t\tif (!register || !schema || id === undefined || id === null || id === '' || typeof id === 'object') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn `/apps/openregister/api/objects/${encodeURIComponent(register)}/${encodeURIComponent(schema)}/${encodeURIComponent(String(id))}`\n\t\t},\n\n\t\t/**\n\t\t * The display text of one field.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @return {string}\n\t\t */\n\t\tvalueOf(record, field) {\n\t\t\tconst raw = readPath(record, field.path)\n\t\t\treturn this.format(raw, field, record)\n\t\t},\n\n\t\t/**\n\t\t * The text of a `line` entry that joins several parts.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @return {string}\n\t\t */\n\t\tlineValue(record, field) {\n\t\t\tconst separator = typeof field.separator === 'string' ? field.separator : ' · '\n\t\t\treturn field.parts\n\t\t\t\t.map((part) => {\n\t\t\t\t\tconst spec = typeof part === 'string' ? { path: part } : (part || {})\n\t\t\t\t\t// A constant part (`{ text }`): \"Handelsregister\" after the legal form.\n\t\t\t\t\tif (!spec.path && typeof spec.text === 'string') {\n\t\t\t\t\t\treturn this.tr(spec.text)\n\t\t\t\t\t}\n\t\t\t\t\t// A group of parts with its own separator (\"Parkstraat 24\" inside\n\t\t\t\t\t// \"Parkstraat 24, 3421 AB Zuiddrecht\").\n\t\t\t\t\tif (!spec.path && Array.isArray(spec.parts)) {\n\t\t\t\t\t\treturn this.lineValue(record, spec)\n\t\t\t\t\t}\n\t\t\t\t\tconst value = this.format(readPath(record, spec.path), spec, record)\n\t\t\t\t\tif (value === '') {\n\t\t\t\t\t\treturn ''\n\t\t\t\t\t}\n\t\t\t\t\treturn spec.label ? `${this.tr(spec.label)} ${value}` : value\n\t\t\t\t})\n\t\t\t\t.filter((value) => value !== '')\n\t\t\t\t.join(separator)\n\t\t},\n\n\t\t/**\n\t\t * Format a raw value.\n\t\t *\n\t\t * @param {unknown} raw The value.\n\t\t * @param {object} spec `{ format?, map?, itemPath?, currency?, currencyField?, decimals? }`.\n\t\t * @param {object|null} [record] The object shown, which `currencyField` reads.\n\t\t * @return {string} The text, '' when empty.\n\t\t * @spec openspec/changes/facts-currency-format/specs/facts-widget/spec.md#requirement-a-facts-entry-can-show-a-money-amount\n\t\t * @spec openspec/changes/facts-user-format/specs/facts-widget/spec.md#requirement-a-facts-entry-can-show-a-user-by-name\n\t\t */\n\t\tformat(raw, spec, record = null) {\n\t\t\tif (raw === null || raw === undefined || raw === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (spec.resolve && typeof spec.resolve === 'object') {\n\t\t\t\treturn this.refText(raw, spec)\n\t\t\t}\n\t\t\tconst format = spec.format || 'text'\n\t\t\tif (format === 'list' || Array.isArray(raw)) {\n\t\t\t\tconst items = (Array.isArray(raw) ? raw : [raw])\n\t\t\t\t\t.map((item) => (spec.itemPath && item && typeof item === 'object' ? readPath(item, spec.itemPath) : item))\n\t\t\t\t\t.map((item) => this.format(item, { ...spec, format: 'text' }))\n\t\t\t\t\t.filter((item) => item !== '')\n\t\t\t\treturn items.join(', ')\n\t\t\t}\n\t\t\tif (format === 'date' || format === 'date-long') {\n\t\t\t\tconst date = parseDateValue(raw)\n\t\t\t\tif (date === null) {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\t// A year far from now forces the long form, so date-long reuses the board formatter.\n\t\t\t\treturn format === 'date-long'\n\t\t\t\t\t? formatBoardDate(date, new Date(date.getFullYear() + 1, 0, 1))\n\t\t\t\t\t: formatBoardDate(date)\n\t\t\t}\n\t\t\tif (format === 'bytes') {\n\t\t\t\tconst bytes = Number(raw)\n\t\t\t\treturn Number.isFinite(bytes) && bytes >= 0 ? formatFileSize(bytes) : ''\n\t\t\t}\n\t\t\tif (format === 'user') {\n\t\t\t\treturn userDisplayName(raw)\n\t\t\t}\n\t\t\tif (format === 'currency') {\n\t\t\t\tconst money = formatMoney(raw, { currency: spec.currency, currencyField: spec.currencyField, decimals: spec.decimals }, record, unwrapAppConfig(this.cnAppConfig))\n\t\t\t\tif (money !== '') {\n\t\t\t\t\treturn money\n\t\t\t\t}\n\t\t\t\t// Not a number: shown as written, never as \"[object Object]\".\n\t\t\t\treturn typeof raw === 'object' ? '' : String(raw)\n\t\t\t}\n\t\t\tif (typeof raw === 'object') {\n\t\t\t\tconst label = raw.title || raw.name || raw.label || raw.displayName\n\t\t\t\treturn typeof label === 'string' ? label : ''\n\t\t\t}\n\t\t\tif (typeof raw === 'boolean') {\n\t\t\t\tconst mapped = spec.map && spec.map[String(raw)]\n\t\t\t\treturn mapped ? this.tr(mapped) : this.tr(raw ? 'Yes' : 'No')\n\t\t\t}\n\t\t\tif (spec.map && Object.hasOwn(spec.map, String(raw))) {\n\t\t\t\treturn this.tr(spec.map[String(raw)])\n\t\t\t}\n\t\t\treturn String(raw)\n\t\t},\n\n\t\t/**\n\t\t * Replace `@source.<field>` / `@source.id` and the shared tokens in a string.\n\t\t *\n\t\t * @param {string} value The template.\n\t\t * @param {object|null} record The object shown.\n\t\t * @return {string} The value, '' when a token stays unresolved.\n\t\t */\n\t\tresolveTemplate(value, record) {\n\t\t\tif (typeof value !== 'string') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tlet unresolved = false\n\t\t\tconst replaced = value.replace(/@source\\.([\\w.@]+)/g, (match, path) => {\n\t\t\t\tconst read = record ? (path === 'id' ? (record.id ?? readPath(record, '@self.id')) : readPath(record, path)) : undefined\n\t\t\t\tif (read === undefined || read === null || read === '') {\n\t\t\t\t\tunresolved = true\n\t\t\t\t\treturn match\n\t\t\t\t}\n\t\t\t\treturn String(read)\n\t\t\t})\n\t\t\tif (unresolved) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (replaced.charAt(0) === '@') {\n\t\t\t\tconst resolved = resolveDeepTokens(replaced, this.tokenCtx)\n\t\t\t\treturn typeof resolved === 'string' && resolved.charAt(0) === '@' ? '' : String(resolved)\n\t\t\t}\n\t\t\treturn replaced\n\t\t},\n\n\t\t/**\n\t\t * Resolve a route declaration (`{ name, params?, query? }`).\n\t\t *\n\t\t * @param {object} route The declaration.\n\t\t * @param {object|null} record The object shown.\n\t\t * @return {object|null} The route, or null when a param stays unresolved.\n\t\t */\n\t\tresolveRoute(route, record) {\n\t\t\tif (!route || typeof route !== 'object' || !route.name) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst out = { name: route.name }\n\t\t\tfor (const key of ['params', 'query']) {\n\t\t\t\tif (route[key] && typeof route[key] === 'object') {\n\t\t\t\t\tout[key] = {}\n\t\t\t\t\tfor (const [name, value] of Object.entries(route[key])) {\n\t\t\t\t\t\tconst resolved = this.resolveTemplate(value, record)\n\t\t\t\t\t\tif (resolved === '') {\n\t\t\t\t\t\t\treturn null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tout[key][name] = resolved\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-facts-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmin-width: 0;\n}\n\n.cn-facts-widget__rows {\n\tdisplay: grid;\n\tgrid-template-columns: max-content 1fr;\n\tgap: 8px 16px;\n\tmargin: 0;\n\tfont-size: 14px;\n}\n\n/* Each row is a grid of its own children: the wrapper takes no box. */\n.cn-facts-widget__row {\n\tdisplay: contents;\n}\n\n/* Nextcloud core styles `dt` and `dd` (text-align end, 12px padding), which\n pushed the label to the right of its column and added 12px around both. The\n class is doubled so these resets outrank that rule, and a dossiq-style\n `:deep()` override in an app is not needed. */\n.cn-facts-widget__label.cn-facts-widget__label {\n\tmargin: 0;\n\tpadding: 0;\n\ttext-align: start;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-facts-widget__value.cn-facts-widget__value {\n\tmargin: 0;\n\tpadding: 0;\n\ttext-align: start;\n\tfont-weight: 500;\n\tmin-width: 0;\n\toverflow-wrap: anywhere;\n}\n\n.cn-facts-widget__title {\n\tfont-size: 15px;\n\tfont-weight: 600;\n\tcolor: var(--color-main-text);\n}\n\n.cn-facts-widget__line {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-facts-widget__meter {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 14px;\n}\n\n.cn-facts-widget__meter-head {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tgap: 16px;\n}\n\n.cn-facts-widget__meter-label {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-facts-widget__meter-value {\n\tfont-weight: 500;\n\ttext-align: end;\n}\n\n.cn-facts-widget__meter-track {\n\theight: 6px;\n\tborder-radius: 3px;\n\tbackground: var(--color-background-darker);\n\toverflow: hidden;\n}\n\n.cn-facts-widget__meter-bar {\n\tdisplay: block;\n\theight: 100%;\n\tborder-radius: inherit;\n\tbackground: var(--color-primary-element);\n}\n\n.cn-facts-widget__meter--over .cn-facts-widget__meter-value {\n\tcolor: var(--color-error-text);\n}\n\n.cn-facts-widget__meter--over .cn-facts-widget__meter-bar {\n\tbackground: var(--color-error);\n}\n\n.cn-facts-widget__muted {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-facts-widget__label .hidden-visually {\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n\n.cn-facts-widget__label--icon {\n\talign-items: center;\n\tdisplay: flex;\n}\n\n.cn-facts-widget__value-link {\n\tcolor: var(--color-primary-element);\n\ttext-decoration: underline;\n}\n\n.cn-facts-widget__inline-button,\n.cn-facts-widget__icon-button,\n.cn-facts-widget__action {\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tfont: inherit;\n}\n\n.cn-facts-widget__inline-button {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border-dark);\n\tborder-radius: 16px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tgap: 4px;\n\tmargin-inline-start: 8px;\n\tmin-height: 28px;\n\tpadding: 0 10px;\n}\n\n.cn-facts-widget__icon-button {\n\tbackground: transparent;\n\tborder: 0;\n\tborder-radius: 6px;\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-inline-start: 4px;\n\tpadding: 2px;\n\tvertical-align: middle;\n}\n\n.cn-facts-widget__icon-button:hover,\n.cn-facts-widget__icon-button:focus-visible {\n\tbackground: var(--color-background-hover);\n\tcolor: var(--color-main-text);\n}\n\n.cn-facts-widget__text {\n\tcolor: var(--color-main-text);\n\tfont-size: 15px;\n}\n\n/* A lead: an icon tile or initials beside a bold title and a muted subtitle. */\n.cn-facts-widget__lead {\n\talign-items: center;\n\tdisplay: flex;\n\tgap: 12px;\n}\n\n.cn-facts-widget__lead-tile {\n\talign-items: center;\n\tbackground: var(--color-background-dark);\n\tborder-radius: 8px;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tflex: none;\n\tfont-size: 14px;\n\tfont-weight: 700;\n\theight: 40px;\n\tjustify-content: center;\n\twidth: 40px;\n}\n\n.cn-facts-widget__lead-tile--success {\n\tbackground: color-mix(in srgb, var(--color-success) 14%, var(--color-main-background));\n\tborder-radius: 50%;\n\tcolor: var(--color-success-text, var(--color-success));\n}\n\n.cn-facts-widget__lead-tile--info {\n\tbackground: var(--color-primary-element-light);\n\tborder-radius: 50%;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n}\n\n.cn-facts-widget__lead-text {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n}\n\n.cn-facts-widget__lead-title {\n\tfont-size: 15px;\n}\n\n.cn-facts-widget__lead-subtitle {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-facts-widget__action {\n\talign-self: flex-start;\n\tbackground: var(--color-primary-element-light);\n\tborder: 0;\n\tborder-radius: 16px;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n\tfont-size: 13px;\n\tfont-weight: 700;\n\tgap: 6px;\n\tmin-height: 32px;\n\tpadding: 0 14px;\n}\n\n.cn-facts-widget__action:hover,\n.cn-facts-widget__action:focus-visible {\n\tbackground: var(--color-primary-element-light-hover, var(--color-primary-element-light));\n}\n\n.cn-facts-widget__link {\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tcolor: var(--color-primary-element);\n\ttext-decoration: underline;\n}\n\n/* `columns: 2` (board DqContact): two columns, the label above the value, a\n hairline under each fact; one column on a phone. */\n.cn-facts-widget__rows--columns {\n\tgrid-template-columns: repeat(2, minmax(0, 1fr));\n\tgap: 14px 24px;\n\tfont-size: 15px;\n}\n\n.cn-facts-widget__rows--columns .cn-facts-widget__row {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 3px;\n\tmin-width: 0;\n\tpadding-bottom: 10px;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-facts-widget__rows--columns .cn-facts-widget__label.cn-facts-widget__label {\n\tfont-size: 13px;\n}\n\n@media (max-width: 640px) {\n\t.cn-facts-widget__rows--columns {\n\t\tgrid-template-columns: minmax(0, 1fr);\n\t}\n}\n</style>\n"],"names":["_createElementBlock","_toDisplayString","_openBlock","_createVNode","_Fragment","_renderList","_normalizeClass","_createElementVNode","_createBlock","_createTextVNode","_resolveDynamicComponent","_normalizeStyle"],"mappings":";;;AAWM,EAAA,KAAK,EAAC,iBAAiB;AAAC,EAAA,aAAA,EAAA,iBAAA;;;;AACvB,EAAA,KAAA,EAAA,wBAAA;AAAA,EAAA,aAAA,EAAA,gBAAA;;;;AAGF,EAAA,KAAA,EAAA,0BAAA;;;;AAGC,EAAA,KAAA,EAAA,wBAAA;AAAA,EAAA,aAAA,EAAA,gBAAA;;;AAsBI,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAuB,GAAA;;;;;;;;AA+DhC,MAAA,WAAA,GAAA,EAAA,KAAA,EAAA,4BAAA,GAAA;AACO,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,6BAAkB,GAAA;;;AACJ,EAAA,KAAA,EAAA,gCAAA;;;AAQxB,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,6BAAgB,GAAA;AACpB,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,8BAAuB,GAAA;AAC7B,MAAA,WAAA,GAAA,EAAA,KAAK,EAAA,8BAAA,GAAA;;;;;;;;;;;;;KAvGV,KAAA,CAAA,KAAA;sBAALA,kBAEI,CAAA,GAAA,EAFJ,UAEI,EAAAC,eAAA,CADA,QAAE,CAAA,EAAA,CAAA,iCAAA,CAAA,CAAA,EAAA,CAAA,YAAA;AAEH,QAAA,CAAA,KAAA,CAAA,OAAA,KAAA,QAAA,CAAA,MAAA;AAAH,WAAAC,SAAA,EAAA,EAAAF,kBAAA,CAEM,OAFN,UAEM,EAAA;YADLG,WAAe,CAAA,wBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;AAEZ,UAAA,CAAA,QAAA,CAAA,MAAA,CAAA,MAAA,KAAA,CAAA;0BAAFH,kBAEE,CAAA,GAAA,EAFF,UAEE,EAAAC,eAAA,C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CACN,OAAK,EAAA,KAAA,CAAA,OAAA;AACN,oCAAA,IAAI,EAAC,OAAA;oCACJ,aAAW,EAAA,CAAA,QAAA,EAAc,KAAI,CAAC,GAAA,CAAA,CAAA;;;;;;AAM5B,IAAA,CAAA,QAAA,CAAA,IAAI,IAAI,QAAC,CAAA,MAAA;iCAMJ,CAAAO,uBAAA,CAPN,QAAI,CAAA,IAAA,CAAC,EAAE,GAAA,aAAA,GAAA,GAAA,CAAA,EAAA;;AAEX,UAAA,EAAE,EAAE,QAAA,CAAA,IAAI,CAAC,EAAA,IAAA,SAAA;AACT,UAAA,IAAI,EAAA,QAAA,CAAA,IAAA,CAAA,IAAA,IAAA,SAAA;AACL,UAAA,KAAK,EAAC,uBAAgB;AACtB,UAAA,aAAW,EAAC,eAAA;;2BACZ,MAAgB;AAAb,YAAAD,eAAA,CAAAR,eAAA,CAAA,QAAA,CAAA,IAAI,CAAC,KAAK,CAAA,EAAA,CAAA,YAAA;;;;;AAGP,IAAA,CAAA,QAAA,CAAA,MAAM,IAAI,QAAM,CAAA,MAAA;sBADtBD;;AAEA,UAAA,IAAI,EAAC,QAAQ;AACb,UAAA,KAAK,EAAC,yBAAC;AACP,UAAA,aAAG,EAAA,iBAAA;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnFactsWidget.vue3.js","sources":["../../../../src/components/CnFactsWidget/CnFactsWidget.vue?vue&type=template&id=7f141540&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-facts-widget\" data-testid=\"cn-facts-widget\">\n\t\t<p v-if=\"error\" class=\"cn-facts-widget__muted\" data-testid=\"cn-facts-error\">\n\t\t\t{{ tr('Could not load this information') }}\n\t\t</p>\n\t\t<div v-else-if=\"loading && !record\" class=\"cn-facts-widget__loading\">\n\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t</div>\n\t\t<p v-else-if=\"blocks.length === 0\" class=\"cn-facts-widget__muted\" data-testid=\"cn-facts-empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<template v-else>\n\t\t\t<template v-for=\"block in blocks\" :key=\"block.key\">\n\t\t\t\t<dl\n\t\t\t\t\tv-if=\"block.kind === 'rows'\"\n\t\t\t\t\tclass=\"cn-facts-widget__rows\"\n\t\t\t\t\t:class=\"{ 'cn-facts-widget__rows--columns': twoColumns }\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"row in block.rows\"\n\t\t\t\t\t\t:key=\"row.key\"\n\t\t\t\t\t\tclass=\"cn-facts-widget__row\"\n\t\t\t\t\t\t:data-testid=\"`cn-fact-${row.key}`\">\n\t\t\t\t\t\t<dt class=\"cn-facts-widget__label\" :class=\"{ 'cn-facts-widget__label--icon': row.icon }\">\n\t\t\t\t\t\t\t<CnIcon\n\t\t\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t\t\t<span :class=\"{ 'hidden-visually': row.icon }\">{{ row.label }}</span>\n\t\t\t\t\t\t</dt>\n\t\t\t\t\t\t<dd class=\"cn-facts-widget__value\">\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tv-if=\"row.href\"\n\t\t\t\t\t\t\t\t:href=\"row.href\"\n\t\t\t\t\t\t\t\tclass=\"cn-facts-widget__value-link\"\n\t\t\t\t\t\t\t\t:target=\"row.external ? '_blank' : undefined\"\n\t\t\t\t\t\t\t\t:rel=\"row.external ? 'noopener noreferrer' : undefined\">{{ row.value }}</a>\n\t\t\t\t\t\t\t<span v-else>{{ row.masked && !revealed[row.key] ? row.masked : row.value }}</span>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tv-if=\"row.reveal && !revealed[row.key]\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tclass=\"cn-facts-widget__inline-button\"\n\t\t\t\t\t\t\t\t:aria-label=\"revealLabel(row)\"\n\t\t\t\t\t\t\t\t:data-testid=\"`cn-fact-reveal-${row.key}`\"\n\t\t\t\t\t\t\t\t@click=\"reveal(row)\">\n\t\t\t\t\t\t\t\t<EyeOutline :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t{{ showLabel }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tv-if=\"row.copy\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tclass=\"cn-facts-widget__icon-button\"\n\t\t\t\t\t\t\t\t:aria-label=\"copyLabel(row)\"\n\t\t\t\t\t\t\t\t:title=\"copyLabel(row)\"\n\t\t\t\t\t\t\t\t:data-testid=\"`cn-fact-copy-${row.key}`\"\n\t\t\t\t\t\t\t\t@click=\"copy(row)\">\n\t\t\t\t\t\t\t\t<Check v-if=\"copied === row.key\" :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t\t<ContentCopy v-else :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t</div>\n\t\t\t\t</dl>\n\t\t\t\t<component\n\t\t\t\t\t:is=\"block.to ? 'router-link' : 'strong'\"\n\t\t\t\t\tv-else-if=\"block.kind === 'title'\"\n\t\t\t\t\t:to=\"block.to || undefined\"\n\t\t\t\t\tclass=\"cn-facts-widget__title\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t{{ block.value }}\n\t\t\t\t</component>\n\t\t\t\t<span\n\t\t\t\t\tv-else-if=\"block.kind === 'line'\"\n\t\t\t\t\tclass=\"cn-facts-widget__line\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t{{ block.value }}\n\t\t\t\t</span>\n\t\t\t\t<span\n\t\t\t\t\tv-else-if=\"block.kind === 'text'\"\n\t\t\t\t\tclass=\"cn-facts-widget__text\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t{{ block.value }}\n\t\t\t\t</span>\n\t\t\t\t<div\n\t\t\t\t\tv-else-if=\"block.kind === 'lead'\"\n\t\t\t\t\tclass=\"cn-facts-widget__lead\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"cn-facts-widget__lead-tile\"\n\t\t\t\t\t\t:class=\"`cn-facts-widget__lead-tile--${block.tone}`\"\n\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t\t<CnIcon v-if=\"block.icon\" :name=\"block.icon\" :size=\"20\" />\n\t\t\t\t\t\t<template v-else>{{ block.initials }}</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"cn-facts-widget__lead-text\">\n\t\t\t\t\t\t<strong class=\"cn-facts-widget__lead-title\">{{ block.value }}</strong>\n\t\t\t\t\t\t<span v-if=\"block.subtitle\" class=\"cn-facts-widget__lead-subtitle\">{{ block.subtitle }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tv-else-if=\"block.kind === 'meter'\"\n\t\t\t\t\tclass=\"cn-facts-widget__meter\"\n\t\t\t\t\t:class=\"{ 'cn-facts-widget__meter--over': block.over }\"\n\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\">\n\t\t\t\t\t<div class=\"cn-facts-widget__meter-head\">\n\t\t\t\t\t\t<span class=\"cn-facts-widget__meter-label\">{{ block.label }}</span>\n\t\t\t\t\t\t<span class=\"cn-facts-widget__meter-value\">{{ block.value }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if=\"block.limit !== null\"\n\t\t\t\t\t\tclass=\"cn-facts-widget__meter-track\"\n\t\t\t\t\t\trole=\"meter\"\n\t\t\t\t\t\t:aria-label=\"block.label\"\n\t\t\t\t\t\t:aria-valuenow=\"block.amount\"\n\t\t\t\t\t\taria-valuemin=\"0\"\n\t\t\t\t\t\t:aria-valuemax=\"block.limit\"\n\t\t\t\t\t\t:aria-valuetext=\"block.value\"\n\t\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}-bar`\">\n\t\t\t\t\t\t<span class=\"cn-facts-widget__meter-bar\" :style=\"{ width: `${block.percent}%` }\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div v-else-if=\"block.kind === 'pill'\">\n\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t:label=\"block.value\"\n\t\t\t\t\t\t:variant=\"block.variant\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t:data-testid=\"`cn-fact-${block.key}`\" />\n\t\t\t\t</div>\n\t\t\t</template>\n\t\t</template>\n\t\t<NcNoteCard\n\t\t\tv-if=\"notice && record\"\n\t\t\t:type=\"notice.type\"\n\t\t\tclass=\"cn-facts-widget__notice\"\n\t\t\tdata-testid=\"cn-facts-notice\">\n\t\t\t{{ notice.text }}\n\t\t</NcNoteCard>\n\t\t<component\n\t\t\t:is=\"link.to ? 'router-link' : 'a'\"\n\t\t\tv-if=\"link && record\"\n\t\t\t:to=\"link.to || undefined\"\n\t\t\t:href=\"link.href || undefined\"\n\t\t\tclass=\"cn-facts-widget__link\"\n\t\t\tdata-testid=\"cn-facts-link\">\n\t\t\t{{ link.label }}\n\t\t</component>\n\t\t<button\n\t\t\tv-if=\"action && record\"\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cn-facts-widget__action\"\n\t\t\tdata-testid=\"cn-facts-action\"\n\t\t\t@click=\"runAction(content.action)\">\n\t\t\t<CnIcon v-if=\"action.icon\" :name=\"action.icon\" :size=\"16\" />\n\t\t\t{{ action.label }}\n\t\t</button>\n\t</div>\n</template>\n\n<script>\nimport { emit } from '@nextcloud/event-bus'\nimport { formatFileSize } from '@nextcloud/files'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcLoadingIcon, NcNoteCard } from '@nextcloud/vue'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport ContentCopy from 'vue-material-design-icons/ContentCopy.vue'\nimport EyeOutline from 'vue-material-design-icons/EyeOutline.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { resolveEndpointRequest } from '../../composables/useEndpointSource.js'\nimport { useRefLabels } from '../../composables/useRefLabels.js'\nimport { dispatchAction } from '../../utils/actionsDispatcher.js'\nimport { isBadgeVariant } from '../../utils/badgeVariants.js'\nimport { formatBoardDate } from '../../utils/boardDate.js'\nimport { parseDateValue } from '../../utils/dateVariant.js'\nimport { formatMoney, unwrapAppConfig } from '../../utils/formatMetric.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { hasUnresolvedDeepTokens, resolveDeepTokens } from '../../utils/resolveFilterTokens.js'\nimport { userDisplayName } from '../../utils/userDisplayName.js'\n\n/** Kinds of entry a `fields[]` item can be. A labelled item without `as` is a row. */\nconst KINDS = Object.freeze(['row', 'title', 'line', 'pill', 'lead', 'text', 'meter'])\n\n/**\n * The label resolver every facts widget on the page shares, made on first use\n * (the object store needs an active pinia). One batched request per register and\n * schema for the ids it has not seen; a label it has read stays until the page\n * reloads, and an object the store already holds is not fetched at all.\n *\n * @type {{resolve: Function}|null}\n */\nlet refLabels = null\n\n/**\n * The entry that reads a resolved pill's tone: the same reference, with the\n * referenced object's `toneField` as the field to read.\n *\n * @param {object} spec A facts entry.\n * @return {object|null} `{ path, itemPath, resolve }`, or null when no `toneField` is set.\n */\nfunction toneSpec(spec) {\n\tconst resolve = spec && spec.resolve\n\tif (!resolve || typeof resolve !== 'object' || typeof resolve.toneField !== 'string' || resolve.toneField === '') {\n\t\treturn null\n\t}\n\treturn { path: spec.path, itemPath: spec.itemPath, resolve: { register: resolve.register, schema: resolve.schema, labelField: resolve.toneField } }\n}\n\n/** The page-wide reference label resolver. */\nfunction sharedRefLabels() {\n\tif (!refLabels) {\n\t\trefLabels = useRefLabels()\n\t}\n\treturn refLabels\n}\n\n/**\n * Key of a resolved reference in the widget's `labels` data.\n *\n * @param {{register: string, schema: string, labelField?: string}} resolve The entry's `resolve` config.\n * @param {string} id The referenced object's id.\n * @return {string} The key.\n */\nfunction refKey(resolve, id) {\n\treturn `${resolve.register}/${resolve.schema}/${resolve.labelField || ''}/${id}`\n}\n\n/** Event-bus channel a reveal of a masked value is announced on, so an app can log it. */\nexport const FACTS_REVEAL_CHANNEL = 'cn:facts:reveal'\n\n/**\n * CnFactsWidget — the `facts` widget: a card of facts about ONE object.\n *\n * Renders the configured fields of the current detail-page object, or of one\n * other object named by `content.source`, as the side cards on the screens\n * draw them: label/value rows (a two-column grid, label muted), a bold title\n * line that may link, muted meta lines that join several fields with \" · \",\n * a status pill, and one link at the foot.\n *\n * Everything is configuration; nothing in it knows an app:\n *\n * ```json\n * {\n * \"type\": \"facts\",\n * \"title\": \"Zaak\",\n * \"content\": {\n * \"source\": { \"register\": \"dossiq\", \"schema\": \"case\", \"id\": \"@object.case\" },\n * \"fields\": [\n * { \"as\": \"title\", \"path\": \"title\", \"route\": { \"name\": \"CaseDetail\", \"params\": { \"id\": \"@source.id\" } } },\n * { \"as\": \"line\", \"parts\": [\"identifier\", \"caseTypeTitle\"] },\n * { \"as\": \"pill\", \"path\": \"status\", \"map\": { \"open\": \"In behandeling\" } },\n * { \"path\": \"deadline\", \"label\": \"Termijn\", \"format\": \"date\" }\n * ],\n * \"link\": { \"label\": \"Naar de zaak\", \"route\": { \"name\": \"CaseDetail\", \"params\": { \"id\": \"@source.id\" } } },\n * \"emptyText\": \"Geen zaak\"\n * }\n * }\n * ```\n *\n * Tokens: `source.id` takes the shared filter tokens; `source.url` takes them\n * inside the url, the endpoint grammar (`/apps/x/api/y/@objectId`)\n * (`@objectId`, `@object.<field>`, `@workspace.<key>`, `@me`, ...). Routes\n * and the link also take `@source.<field>` (a field of the object shown).\n * A source whose id token does not resolve renders the empty text, never a\n * request for the literal token.\n *\n * Labels, map values, the link label and the empty text go through the host\n * app's translate (`cnTranslate`).\n */\nexport default {\n\tname: 'CnFactsWidget',\n\n\tcomponents: { Check, CnIcon, CnStatusBadge, ContentCopy, EyeOutline, NcLoadingIcon, NcNoteCard },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t\tcnObjectContext: { default: null },\n\t\tcnWorkspaceContext: { default: null },\n\t\t/** The page's app config; its `currency` is the reporting currency a money value falls back to. */\n\t\tcnAppConfig: { default: null },\n\t\t/** Pre-bound action dispatcher of CnPageRenderer, for `action` / `headerAction`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `fields` — the entries, in order. Each is `{ path, label?, as?, from?, format?, map?, itemPath?, parts?, separator?, route?, variant?, variantMap?, colorMap?, icon?, copy?, reveal?, text?, title?, subtitle?, initialsPath?, tone? }`.\n\t\t * `as` is `row` (default when `label` or `icon` is set), `title`, `line`, `text` (a line in the normal ink), `lead` (an icon tile or initials beside `title` and `subtitle`), `pill` or `meter`.\n\t\t * A `meter` shows the amount at `path` against the limit at `limitPath` (or a constant `limit`) as \"12 of 50\" with a bar; past the limit the bar turns red and the text says \"over the limit\"; without a positive limit it shows the amount and no bar.\n\t\t * A row's `format` may also be `email`, `phone` or `url` (a link) or `masked` (the last four characters; `reveal: true` adds Show). `copy: true` adds a copy button; `icon` replaces the label.\n\t\t * A part may be `{ text }`, a constant; a `line` or `text` entry without `path` or `parts` shows its `text`.\n\t\t * `resolve: { register, schema, labelField? }` on an entry or a part turns a value that is a reference (an id, or a list of ids) into the label of the referenced object (`labelField`, else `title`, then `name`): the case type or status of a task shows its name, not its uuid. The ids are fetched once per register and schema through the object store and shared by every facts widget on the page; the entry stays empty until its label is known, and when no label can be read. A resolved value works as a pill too: `map` is applied to the resolved label, and `variantMap` / `colorMap` look the tone up by the value of `resolve.toneField` on the referenced object when that is set (a status named by its `name`, coloured by its `state`), then by the resolved label, then by the stored value.\n\t\t * `format: 'user'` shows a Nextcloud user id as the user's display name, read once per id; the entry stays empty until the name is known.\n\t\t * - `action` — an action drawn as a button under the facts; `headerAction` — one drawn in the card header (reported through the `header` event).\n\t\t * - `headerPill` — a status pill in the card header (reported through the `header` event): `{ path?, text?, map?, variant?, variantMap?, colorMap? }`, read from the record like a `pill` entry (DqBezwaar \"Advies ontvangen\"); nothing shows while the value is empty.\n\t\t * - `notice` — `{ text, variant? }`, a note band inside the card under the facts (`info` by default; `success`, `warning` or `error`); the text is translated.\n\t\t * `format` is `text` (default), `date` (board short date), `date-long` (always with the year), `list` (an array joined by \", \", each item read at `itemPath`), `bytes` (a size, \"1.5 MB\") or `currency` (a money amount in the reader's language, \"€ 1.234,50\": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).\n\t\t * `map` turns a raw value into a label (translated). `parts` (on a `line`) lists paths, or `{ path, label?, format? }`, joined by `separator` (default \" · \"); empty parts are dropped.\n\t\t * - `source` — `{ register, schema, id }` or `{ url }`; omitted = the current object. An entry with `from: \"object\"` reads the current object even then (a client card that also shows the ticket's channel).\n\t\t * - `link` — `{ label, route? | href? }` at the foot.\n\t\t * - `hideEmpty` — drop an entry whose value is empty (default true).\n\t\t * - `columns` — `2` lays the rows out in two columns with the label above the value (board DqContact); a row with `parts` joins them like a line (an address on one row).\n\t\t * - `emptyText` — shown when no entry has a value.\n\t\t *\n\t\t * @type {{fields?: Array<object>, source?: object, link?: object, hideEmpty?: boolean, emptyText?: string}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * The current detail-page object, passed by the detail page host.\n\t\t * Read when `content.source` is not set.\n\t\t */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The current detail-page object id, for the `@objectId` token. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['header', 'reveal'],\n\n\tdata() {\n\t\treturn {\n\t\t\tfetched: null,\n\t\t\tloading: false,\n\t\t\terror: false,\n\t\t\t/** Keys of the masked rows the reader chose to show. */\n\t\t\trevealed: {},\n\t\t\t/** Key of the row whose value was just copied. */\n\t\t\tcopied: '',\n\t\t\t/** Labels of the referenced objects read so far, by `refKey`. */\n\t\t\tlabels: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the rows sit in two columns, label above value.\n\t\t *\n\t\t * @spec openspec/changes/facts-columns/specs/facts-widget/spec.md#requirement-facts-rows-can-sit-in-two-columns\n\t\t * @return {boolean}\n\t\t */\n\t\ttwoColumns() {\n\t\t\treturn Number(this.content?.columns) === 2\n\t\t},\n\n\t\t/**\n\t\t * The token context: the detail object (prop, else the injected context)\n\t\t * and the page workspace.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\ttokenCtx() {\n\t\t\tconst unwrap = (c) => (c && typeof c === 'object' && 'value' in c ? c.value : c)\n\t\t\tconst injected = unwrap(this.cnObjectContext) || {}\n\t\t\treturn {\n\t\t\t\t...injected,\n\t\t\t\tobjectId: this.objectId ?? injected.objectId ?? this.objectData?.id ?? null,\n\t\t\t\tobject: this.objectData || injected.object || null,\n\t\t\t\tworkspace: unwrap(this.cnWorkspaceContext) || {},\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The source declaration with its tokens resolved, or null for the current object.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tresolvedSource() {\n\t\t\tconst source = this.content?.source\n\t\t\tif (!source || typeof source !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (typeof source.url === 'string' && source.url !== '') {\n\t\t\t\t// The endpoint grammar: tokens INSIDE the url, and a request\n\t\t\t\t// that is blocked while one leaves an empty path segment.\n\t\t\t\tconst request = resolveEndpointRequest({ url: source.url }, this.tokenCtx)\n\t\t\t\treturn { url: request.blocked ? '' : request.url }\n\t\t\t}\n\t\t\treturn resolveDeepTokens(source, this.tokenCtx)\n\t\t},\n\n\t\t/**\n\t\t * A stable key of the resolved source, so the widget refetches only when it changes.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tsourceKey() {\n\t\t\treturn this.resolvedSource ? JSON.stringify(this.resolvedSource) : ''\n\t\t},\n\n\t\t/**\n\t\t * The object the facts are read from.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\trecord() {\n\t\t\treturn this.resolvedSource ? this.fetched : this.objectData\n\t\t},\n\n\t\t/**\n\t\t * The entries to draw, consecutive rows grouped into one list.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tblocks() {\n\t\t\tconst sourceRecord = this.record\n\t\t\tif (!sourceRecord) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst fields = Array.isArray(this.content?.fields) ? this.content.fields : []\n\t\t\tconst hideEmpty = this.content?.hideEmpty !== false\n\t\t\tconst out = []\n\t\t\tfields.forEach((field, index) => {\n\t\t\t\tif (!field || typeof field !== 'object') {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// `from: \"object\"` reads the page's own object while the card shows a `source`.\n\t\t\t\tconst record = field.from === 'object' && this.objectData ? this.objectData : sourceRecord\n\t\t\t\tconst kind = this.kindOf(field)\n\t\t\t\tconst key = String(field.key || field.path || `${kind}-${index}`).replace(/[^\\w-]/g, '-')\n\t\t\t\tconst value = this.entryValue(record, field, kind)\n\t\t\t\tif (value === '' && (hideEmpty || kind === 'lead')) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (kind === 'row') {\n\t\t\t\t\tconst last = out[out.length - 1]\n\t\t\t\t\tconst row = { key, label: this.tr(field.label || ''), value, ...this.rowExtras(record, field, value) }\n\t\t\t\t\tif (last && last.kind === 'rows') {\n\t\t\t\t\t\tlast.rows.push(row)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tout.push({ kind: 'rows', key: `rows-${index}`, rows: [row] })\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst block = { kind, key, value }\n\t\t\t\tif (kind === 'lead') {\n\t\t\t\t\tblock.subtitle = this.partsValue(record, field.subtitle)\n\t\t\t\t\tblock.icon = typeof field.icon === 'string' ? field.icon : ''\n\t\t\t\t\tblock.initials = block.icon ? '' : this.initialsOf(readPath(record, field.initialsPath))\n\t\t\t\t\tblock.tone = ['success', 'info', 'warning', 'error'].includes(field.tone) ? field.tone : 'neutral'\n\t\t\t\t}\n\t\t\t\tif (kind === 'meter') {\n\t\t\t\t\tObject.assign(block, this.meterOf(record, field))\n\t\t\t\t}\n\t\t\t\tif (kind === 'title' && field.route) {\n\t\t\t\t\tblock.to = this.resolveRoute(field.route, record)\n\t\t\t\t}\n\t\t\t\tif (kind === 'pill') {\n\t\t\t\t\tconst raw = readPath(record, field.path)\n\t\t\t\t\tconst colours = field.variantMap || field.colorMap\n\t\t\t\t\t// A resolved pill looks its tone up by the referenced object's tone field,\n\t\t\t\t\t// then by the resolved label, then by the stored value.\n\t\t\t\t\tconst keys = field.resolve && typeof field.resolve === 'object'\n\t\t\t\t\t\t? [toneSpec(field) ? this.refLabels(raw, toneSpec(field))[0] : undefined, this.refLabels(raw, field)[0], raw]\n\t\t\t\t\t\t: [raw]\n\t\t\t\t\tconst hit = colours ? keys.find((candidate) => (typeof candidate === 'string' || typeof candidate === 'number') && Object.hasOwn(colours, candidate)) : undefined\n\t\t\t\t\tconst variant = hit !== undefined ? colours[hit] : field.variant\n\t\t\t\t\tblock.variant = isBadgeVariant(variant) ? variant : 'default'\n\t\t\t\t}\n\t\t\t\tout.push(block)\n\t\t\t})\n\t\t\treturn out\n\t\t},\n\n\t\t/**\n\t\t * The foot link, resolved, or null.\n\t\t *\n\t\t * @return {{label: string, to?: object, href?: string}|null}\n\t\t */\n\t\tlink() {\n\t\t\tconst link = this.content?.link\n\t\t\tif (!link || typeof link !== 'object' || !link.label) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (link.route) {\n\t\t\t\tconst to = this.resolveRoute(link.route, this.record)\n\t\t\t\treturn to ? { label: this.tr(link.label), to } : null\n\t\t\t}\n\t\t\tif (typeof link.href === 'string' && link.href !== '') {\n\t\t\t\tconst href = this.resolveTemplate(link.href, this.record)\n\t\t\t\treturn href ? { label: this.tr(link.label), href } : null\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\n\t\t/**\n\t\t * The action under the facts, as drawn: `{ label, icon }`, or null.\n\t\t *\n\t\t * @return {{label: string, icon: string}|null}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\taction() {\n\t\t\treturn this.actionView(this.content?.action)\n\t\t},\n\n\t\t/**\n\t\t * The header action, as drawn: `{ label, icon }`, or null.\n\t\t *\n\t\t * @return {{label: string, icon: string}|null}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\theaderAction() {\n\t\t\treturn this.actionView(this.content?.headerAction)\n\t\t},\n\n\t\t/**\n\t\t * The card header's status pill, read from the record like a `pill`\n\t\t * entry, or null when it has no text.\n\t\t *\n\t\t * @return {{label: string, variant: string}|null}\n\t\t */\n\t\theaderPill() {\n\t\t\tconst pill = this.content?.headerPill\n\t\t\tif (!pill || typeof pill !== 'object' || !this.record) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst raw = typeof pill.path === 'string' && pill.path !== '' ? readPath(this.record, pill.path) : undefined\n\t\t\tconst mapped = pill.map && (typeof raw === 'string' || typeof raw === 'number') && Object.hasOwn(pill.map, raw) ? pill.map[raw] : undefined\n\t\t\tconst text = mapped ?? pill.text ?? raw\n\t\t\tif (typeof text !== 'string' && typeof text !== 'number') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst label = this.tr(String(text))\n\t\t\tif (label === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst colours = pill.variantMap || pill.colorMap\n\t\t\tconst hit = colours && (typeof raw === 'string' || typeof raw === 'number') && Object.hasOwn(colours, raw) ? colours[raw] : pill.variant\n\t\t\treturn { label, variant: isBadgeVariant(hit) ? hit : 'default' }\n\t\t},\n\n\t\t/**\n\t\t * The note band under the facts: its text translated, its NcNoteCard\n\t\t * type from `variant` (info by default), or null without text.\n\t\t *\n\t\t * @return {{text: string, type: string}|null}\n\t\t */\n\t\tnotice() {\n\t\t\tconst notice = this.content?.notice\n\t\t\tconst text = notice && typeof notice.text === 'string' ? this.tr(notice.text) : ''\n\t\t\tif (text === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { text, type: ['success', 'warning', 'error'].includes(notice.variant) ? notice.variant : 'info' }\n\t\t},\n\n\t\t/** @return {string} The reveal button's text. */\n\t\tshowLabel() {\n\t\t\treturn t('nextcloud-vue', 'Show')\n\t\t},\n\n\t\t/**\n\t\t * The empty line.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\temptyLabel() {\n\t\t\treturn this.tr(this.content?.emptyText || 'Nothing to show yet')\n\t\t},\n\t},\n\n\twatch: {\n\t\tsourceKey: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.load()\n\t\t\t},\n\t\t},\n\n\t\trecord: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.loadLabels()\n\t\t\t},\n\t\t},\n\n\t\theaderAction: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.emitHeader()\n\t\t\t},\n\t\t},\n\n\t\theaderPill: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.emitHeader()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate through the host app.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string}\n\t\t */\n\t\ttr(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\t/**\n\t\t * The kind of a field entry.\n\t\t *\n\t\t * @param {object} field The entry.\n\t\t * @return {string} `row`, `title`, `line` or `pill`.\n\t\t */\n\t\tkindOf(field) {\n\t\t\tif (KINDS.includes(field.as)) {\n\t\t\t\treturn field.as\n\t\t\t}\n\t\t\treturn field.label || field.icon ? 'row' : 'line'\n\t\t},\n\n\t\t/**\n\t\t * A meter entry's parts: the amount at `path` against the limit at\n\t\t * `limitPath` (or a constant `limit`), both formatted with the entry's\n\t\t * `format`. Without a positive numeric limit there is no bar, only the\n\t\t * amount. Past the limit the text says so, so the state never rests on\n\t\t * the bar's colour alone.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @return {{label: string, value: string, amount: number|null, limit: number|null, percent: number, over: boolean}}\n\t\t * @spec openspec/changes/facts-meter-row/specs/facts-meter-row/spec.md#requirement-a-facts-entry-can-be-a-meter\n\t\t */\n\t\tmeterOf(record, field) {\n\t\t\tconst amount = Number(readPath(record, field.path))\n\t\t\tconst rawLimit = typeof field.limitPath === 'string' && field.limitPath !== '' ? readPath(record, field.limitPath) : field.limit\n\t\t\tconst limit = rawLimit === null || rawLimit === undefined || rawLimit === '' ? NaN : Number(rawLimit)\n\t\t\tconst label = this.tr(field.label || '')\n\t\t\tconst value = this.valueOf(record, field)\n\t\t\tif (!Number.isFinite(amount) || !Number.isFinite(limit) || limit <= 0) {\n\t\t\t\treturn { label, value, amount: Number.isFinite(amount) ? amount : null, limit: null, percent: 0, over: false }\n\t\t\t}\n\t\t\tconst over = amount > limit\n\t\t\tconst limitText = this.format(limit, field, record)\n\t\t\treturn {\n\t\t\t\tlabel,\n\t\t\t\tvalue: over\n\t\t\t\t\t? t('nextcloud-vue', '{value} of {limit}, over the limit', { value, limit: limitText })\n\t\t\t\t\t: t('nextcloud-vue', '{value} of {limit}', { value, limit: limitText }),\n\n\t\t\t\tamount,\n\t\t\t\tlimit,\n\t\t\t\tpercent: Math.max(0, Math.min(100, (amount / limit) * 100)),\n\t\t\t\tover,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The display text of an entry of any kind: a lead's title, the parts of\n\t\t * a line or text, a constant `text`, else the value at `path`.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @param {string} kind The entry's kind.\n\t\t * @return {string}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\tentryValue(record, field, kind) {\n\t\t\tif (kind === 'lead') {\n\t\t\t\treturn this.partsValue(record, field.title)\n\t\t\t}\n\t\t\tif ((kind === 'line' || kind === 'text' || kind === 'row') && Array.isArray(field.parts)) {\n\t\t\t\treturn this.lineValue(record, field)\n\t\t\t}\n\t\t\tif ((kind === 'line' || kind === 'text') && !field.path && typeof field.text === 'string') {\n\t\t\t\treturn this.tr(field.text)\n\t\t\t}\n\t\t\treturn this.valueOf(record, field)\n\t\t},\n\n\t\t/**\n\t\t * A lead's title or subtitle: a path, a part spec, or an array of parts\n\t\t * joined as a line joins them.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {string|object|Array} spec The declaration.\n\t\t * @return {string}\n\t\t */\n\t\tpartsValue(record, spec) {\n\t\t\tif (typeof spec === 'string' && spec !== '') {\n\t\t\t\treturn this.valueOf(record, { path: spec })\n\t\t\t}\n\t\t\tif (Array.isArray(spec)) {\n\t\t\t\treturn this.lineValue(record, { parts: spec })\n\t\t\t}\n\t\t\tif (spec && typeof spec === 'object') {\n\t\t\t\treturn this.lineValue(record, { parts: [spec] })\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/**\n\t\t * The initials of a name: \"Sanne de Vries\" reads \"SV\".\n\t\t *\n\t\t * @param {unknown} name The name.\n\t\t * @return {string}\n\t\t */\n\t\tinitialsOf(name) {\n\t\t\tif (typeof name !== 'string' || name.trim() === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst words = name.trim().split(/\\s+/).filter((word) => /^\\p{Lu}/u.test(word))\n\t\t\tconst picked = words.length ? words : name.trim().split(/\\s+/)\n\t\t\tconst first = picked[0].charAt(0)\n\t\t\tconst last = picked.length > 1 ? picked[picked.length - 1].charAt(0) : ''\n\t\t\treturn (first + last).toUpperCase()\n\t\t},\n\n\t\t/**\n\t\t * What a row adds to its value: an icon, a link for the email, phone\n\t\t * and url formats, the masked text, and the copy and reveal buttons.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @param {string} value The display text.\n\t\t * @return {object}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\trowExtras(record, field, value) {\n\t\t\tconst extras = {\n\t\t\t\ticon: typeof field.icon === 'string' ? field.icon : '',\n\t\t\t\tpath: field.path || '',\n\t\t\t\traw: readPath(record, field.path),\n\t\t\t\tcopy: field.copy === true && value !== '',\n\t\t\t\treveal: false,\n\t\t\t\tmasked: '',\n\t\t\t\thref: '',\n\t\t\t\texternal: false,\n\t\t\t}\n\t\t\tif (value === '') {\n\t\t\t\treturn extras\n\t\t\t}\n\t\t\tif (field.format === 'email') {\n\t\t\t\textras.href = `mailto:${value}`\n\t\t\t} else if (field.format === 'phone') {\n\t\t\t\textras.href = `tel:${value.replace(/[^\\d+]/g, '')}`\n\t\t\t} else if (field.format === 'url') {\n\t\t\t\textras.href = /^https?:\\/\\//i.test(value) ? value : `https://${value}`\n\t\t\t\textras.external = true\n\t\t\t} else if (field.format === 'masked') {\n\t\t\t\textras.masked = value.length > 4 ? '*'.repeat(Math.min(value.length - 4, 5)) + value.slice(-4) : value\n\t\t\t\textras.reveal = field.reveal === true && value.length > 4\n\t\t\t}\n\t\t\treturn extras\n\t\t},\n\n\t\t/**\n\t\t * Show a masked value, and say so: the `reveal` event and the event-bus\n\t\t * channel {@link FACTS_REVEAL_CHANNEL}, so an app can log who saw it.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\treveal(row) {\n\t\t\tthis.revealed = { ...this.revealed, [row.key]: true }\n\t\t\tconst detail = { path: row.path }\n\t\t\t/**\n\t\t\t * @event reveal Emitted when the reader shows a masked value.\n\t\t\t * @type {{path: string}} The path of the shown field.\n\t\t\t */\n\t\t\tthis.$emit('reveal', detail)\n\t\t\temit(FACTS_REVEAL_CHANNEL, { ...detail, objectId: this.tokenCtx.objectId, register: this.tokenCtx.register || null, schema: this.tokenCtx.schema || null })\n\t\t},\n\n\t\t/**\n\t\t * Copy a row's value to the clipboard.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync copy(row) {\n\t\t\tconst text = row.raw === null || row.raw === undefined || typeof row.raw === 'object' ? row.value : String(row.raw)\n\t\t\ttry {\n\t\t\t\tawait navigator.clipboard.writeText(text)\n\t\t\t\tthis.copied = row.key\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (this.copied === row.key) {\n\t\t\t\t\t\tthis.copied = ''\n\t\t\t\t\t}\n\t\t\t\t}, 2000)\n\t\t\t} catch (e) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnFactsWidget] could not copy:', e?.message || e)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row The row.\n\t\t * @return {string} The copy button's accessible name.\n\t\t */\n\t\tcopyLabel(row) {\n\t\t\treturn this.copied === row.key\n\t\t\t\t? t('nextcloud-vue', 'Copied')\n\t\t\t\t: t('nextcloud-vue', 'Copy {label}', { label: row.label || row.value })\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row The row.\n\t\t * @return {string} The reveal button's accessible name.\n\t\t */\n\t\trevealLabel(row) {\n\t\t\treturn t('nextcloud-vue', 'Show {label}', { label: row.label || '' }).trim()\n\t\t},\n\n\t\t/**\n\t\t * The drawn part of an action declaration.\n\t\t *\n\t\t * @param {object} action The declaration.\n\t\t * @return {{label: string, icon: string}|null}\n\t\t */\n\t\tactionView(action) {\n\t\t\tif (!action || typeof action !== 'object' || typeof action.label !== 'string' || action.label === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { label: this.tr(action.label), icon: typeof action.icon === 'string' ? action.icon : '' }\n\t\t},\n\n\t\t/**\n\t\t * Dispatch an action with the record's tokens resolved (`@objectId`,\n\t\t * `@object.<field>`), through the page's dispatcher when there is one.\n\t\t *\n\t\t * @param {object} action The declaration.\n\t\t * @return {unknown}\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead\n\t\t */\n\t\trunAction(action) {\n\t\t\tif (!action || typeof action !== 'object') {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst resolved = resolveDeepTokens(action, this.tokenCtx)\n\t\t\tif (typeof this.cnDispatchAction === 'function') {\n\t\t\t\treturn this.cnDispatchAction(resolved)\n\t\t\t}\n\t\t\treturn dispatchAction(resolved, { router: this.$router || null })\n\t\t},\n\n\t\t/** Tell the card around the facts what its header shows (the header action). */\n\t\temitHeader() {\n\t\t\tconst view = this.headerAction\n\t\t\t/**\n\t\t\t * @event header Emitted with the card header's parts: the header action, if any.\n\t\t\t * @type {{link: null, note: string, action: (object|null), pill: (object|null)}} `action` is `{ label, icon, run }`, `pill` is `{ label, variant }`.\n\t\t\t */\n\t\t\tthis.$emit('header', {\n\t\t\t\tlink: null,\n\t\t\t\tnote: '',\n\t\t\t\taction: view ? { ...view, run: () => this.runAction(this.content.headerAction) } : null,\n\t\t\t\tpill: this.headerPill,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The text of a reference: the labels of the objects its id(s) name, joined\n\t\t * by \", \". An id whose label is not known yet (or cannot be read) adds nothing.\n\t\t *\n\t\t * @param {unknown} raw The id, or a list of ids (or of `{ id }` objects).\n\t\t * @param {object} spec `{ resolve: { register, schema, labelField? }, itemPath? }`.\n\t\t * @return {string}\n\t\t */\n\t\trefText(raw, spec) {\n\t\t\treturn this.refLabels(raw, spec)\n\t\t\t\t.map((label) => (spec.map && Object.hasOwn(spec.map, label) ? this.tr(spec.map[label]) : label))\n\t\t\t\t.join(', ')\n\t\t},\n\n\t\t/**\n\t\t * The labels of a reference as read, before `map` is applied: the key a\n\t\t * pill's `variantMap` and `colorMap` look up.\n\t\t *\n\t\t * @param {unknown} raw The id, or a list of ids.\n\t\t * @param {object} spec `{ resolve, itemPath? }`.\n\t\t * @return {string[]}\n\t\t */\n\t\trefLabels(raw, spec) {\n\t\t\treturn this.refIds(raw, spec)\n\t\t\t\t.map((id) => this.labels[refKey(spec.resolve, id)])\n\t\t\t\t.filter((label) => typeof label === 'string' && label !== '')\n\t\t},\n\n\t\t/**\n\t\t * The ids a reference value holds.\n\t\t *\n\t\t * @param {unknown} raw The value.\n\t\t * @param {object} spec `{ itemPath? }`.\n\t\t * @return {string[]}\n\t\t */\n\t\trefIds(raw, spec) {\n\t\t\treturn (Array.isArray(raw) ? raw : [raw])\n\t\t\t\t.map((item) => (item && typeof item === 'object' ? (spec.itemPath ? readPath(item, spec.itemPath) : (item.id ?? item.uuid)) : item))\n\t\t\t\t.filter((id) => id !== null && id !== undefined && id !== '' && typeof id !== 'object')\n\t\t\t\t.map(String)\n\t\t},\n\n\t\t/**\n\t\t * Every entry or part that carries `resolve`, with the record's value at its path.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @return {Array<{spec: object, raw: unknown}>}\n\t\t */\n\t\trefSpecs(record) {\n\t\t\tconst fields = Array.isArray(this.content?.fields) ? this.content.fields : []\n\t\t\tconst specs = []\n\t\t\tconst visit = (spec) => {\n\t\t\t\tif (!spec || typeof spec !== 'object') {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (spec.resolve && typeof spec.resolve === 'object' && spec.path) {\n\t\t\t\t\tspecs.push({ spec, raw: readPath(record, spec.path) })\n\t\t\t\t\tif (toneSpec(spec)) {\n\t\t\t\t\t\tspecs.push({ spec: toneSpec(spec), raw: readPath(record, spec.path) })\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst nested = [...(Array.isArray(spec.parts) ? spec.parts : []), ...(Array.isArray(spec.title) ? spec.title : [spec.title]), ...(Array.isArray(spec.subtitle) ? spec.subtitle : [spec.subtitle])]\n\t\t\t\tnested.forEach(visit)\n\t\t\t}\n\t\t\tfields.forEach(visit)\n\t\t\treturn specs\n\t\t},\n\n\t\t/**\n\t\t * Read the labels of the referenced objects, one batched request per\n\t\t * register and schema, and keep them in `labels`.\n\t\t *\n\t\t * @param {object|null} record The object shown (defaults to the current record).\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadLabels(record = this.record) {\n\t\t\tif (!record) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst groups = new Map()\n\t\t\tfor (const { spec, raw } of this.refSpecs(record)) {\n\t\t\t\tconst { register, schema, labelField } = spec.resolve\n\t\t\t\tif (!register || !schema) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst groupKey = `${register}/${schema}/${labelField || ''}`\n\t\t\t\tconst group = groups.get(groupKey) || { resolve: spec.resolve, ids: new Set() }\n\t\t\t\tthis.refIds(raw, spec).forEach((id) => group.ids.add(id))\n\t\t\t\tgroups.set(groupKey, group)\n\t\t\t}\n\t\t\tif (groups.size === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst resolver = sharedRefLabels()\n\t\t\tconst next = { ...this.labels }\n\t\t\tawait Promise.all([...groups.values()].map(async ({ resolve, ids }) => {\n\t\t\t\tconst found = await resolver.resolve(resolve.register, resolve.schema, [...ids], resolve.labelField)\n\t\t\t\tObject.entries(found).forEach(([id, label]) => {\n\t\t\t\t\tnext[refKey(resolve, id)] = label\n\t\t\t\t})\n\t\t\t}))\n\t\t\tthis.labels = next\n\t\t},\n\n\t\t/**\n\t\t * Read the source object.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync load() {\n\t\t\tconst source = this.resolvedSource\n\t\t\tthis.error = false\n\t\t\tif (!source) {\n\t\t\t\tthis.fetched = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst url = this.sourceUrl(source)\n\t\t\tif (!url) {\n\t\t\t\tthis.fetched = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\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 full = url.startsWith('/apps/') || url.startsWith('/ocs/') ? generateUrl(url) : url\n\t\t\t\tconst response = await axios.get(full)\n\t\t\t\tconst data = response && response.data\n\t\t\t\tthis.fetched = data && typeof data === 'object' && !Array.isArray(data) ? data : null\n\t\t\t} catch (e) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnFactsWidget] the source could not be read:', e?.message || e)\n\t\t\t\tthis.fetched = null\n\t\t\t\tthis.error = true\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 * The URL of a resolved source, or '' when it cannot be read yet.\n\t\t *\n\t\t * @param {object} source The resolved source.\n\t\t * @return {string}\n\t\t */\n\t\tsourceUrl(source) {\n\t\t\tif (typeof source.url === 'string') {\n\t\t\t\treturn source.url\n\t\t\t}\n\t\t\tif (hasUnresolvedDeepTokens(source)) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst { register, schema, id } = source\n\t\t\tif (!register || !schema || id === undefined || id === null || id === '' || typeof id === 'object') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn `/apps/openregister/api/objects/${encodeURIComponent(register)}/${encodeURIComponent(schema)}/${encodeURIComponent(String(id))}`\n\t\t},\n\n\t\t/**\n\t\t * The display text of one field.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @return {string}\n\t\t */\n\t\tvalueOf(record, field) {\n\t\t\tconst raw = readPath(record, field.path)\n\t\t\treturn this.format(raw, field, record)\n\t\t},\n\n\t\t/**\n\t\t * The text of a `line` entry that joins several parts.\n\t\t *\n\t\t * @param {object} record The object.\n\t\t * @param {object} field The entry.\n\t\t * @return {string}\n\t\t */\n\t\tlineValue(record, field) {\n\t\t\tconst separator = typeof field.separator === 'string' ? field.separator : ' · '\n\t\t\treturn field.parts\n\t\t\t\t.map((part) => {\n\t\t\t\t\tconst spec = typeof part === 'string' ? { path: part } : (part || {})\n\t\t\t\t\t// A constant part (`{ text }`): \"Handelsregister\" after the legal form.\n\t\t\t\t\tif (!spec.path && typeof spec.text === 'string') {\n\t\t\t\t\t\treturn this.tr(spec.text)\n\t\t\t\t\t}\n\t\t\t\t\t// A group of parts with its own separator (\"Parkstraat 24\" inside\n\t\t\t\t\t// \"Parkstraat 24, 3421 AB Zuiddrecht\").\n\t\t\t\t\tif (!spec.path && Array.isArray(spec.parts)) {\n\t\t\t\t\t\treturn this.lineValue(record, spec)\n\t\t\t\t\t}\n\t\t\t\t\tconst value = this.format(readPath(record, spec.path), spec, record)\n\t\t\t\t\tif (value === '') {\n\t\t\t\t\t\treturn ''\n\t\t\t\t\t}\n\t\t\t\t\treturn spec.label ? `${this.tr(spec.label)} ${value}` : value\n\t\t\t\t})\n\t\t\t\t.filter((value) => value !== '')\n\t\t\t\t.join(separator)\n\t\t},\n\n\t\t/**\n\t\t * Format a raw value.\n\t\t *\n\t\t * @param {unknown} raw The value.\n\t\t * @param {object} spec `{ format?, map?, itemPath?, currency?, currencyField?, decimals? }`.\n\t\t * @param {object|null} [record] The object shown, which `currencyField` reads.\n\t\t * @return {string} The text, '' when empty.\n\t\t * @spec openspec/changes/facts-currency-format/specs/facts-widget/spec.md#requirement-a-facts-entry-can-show-a-money-amount\n\t\t * @spec openspec/changes/facts-user-format/specs/facts-widget/spec.md#requirement-a-facts-entry-can-show-a-user-by-name\n\t\t */\n\t\tformat(raw, spec, record = null) {\n\t\t\tif (raw === null || raw === undefined || raw === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (spec.resolve && typeof spec.resolve === 'object') {\n\t\t\t\treturn this.refText(raw, spec)\n\t\t\t}\n\t\t\tconst format = spec.format || 'text'\n\t\t\tif (format === 'list' || Array.isArray(raw)) {\n\t\t\t\tconst items = (Array.isArray(raw) ? raw : [raw])\n\t\t\t\t\t.map((item) => (spec.itemPath && item && typeof item === 'object' ? readPath(item, spec.itemPath) : item))\n\t\t\t\t\t.map((item) => this.format(item, { ...spec, format: 'text' }))\n\t\t\t\t\t.filter((item) => item !== '')\n\t\t\t\treturn items.join(', ')\n\t\t\t}\n\t\t\tif (format === 'date' || format === 'date-long') {\n\t\t\t\tconst date = parseDateValue(raw)\n\t\t\t\tif (date === null) {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\t// A year far from now forces the long form, so date-long reuses the board formatter.\n\t\t\t\treturn format === 'date-long'\n\t\t\t\t\t? formatBoardDate(date, new Date(date.getFullYear() + 1, 0, 1))\n\t\t\t\t\t: formatBoardDate(date)\n\t\t\t}\n\t\t\tif (format === 'bytes') {\n\t\t\t\tconst bytes = Number(raw)\n\t\t\t\treturn Number.isFinite(bytes) && bytes >= 0 ? formatFileSize(bytes) : ''\n\t\t\t}\n\t\t\tif (format === 'user') {\n\t\t\t\treturn userDisplayName(raw)\n\t\t\t}\n\t\t\tif (format === 'currency') {\n\t\t\t\tconst money = formatMoney(raw, { currency: spec.currency, currencyField: spec.currencyField, decimals: spec.decimals }, record, unwrapAppConfig(this.cnAppConfig))\n\t\t\t\tif (money !== '') {\n\t\t\t\t\treturn money\n\t\t\t\t}\n\t\t\t\t// Not a number: shown as written, never as \"[object Object]\".\n\t\t\t\treturn typeof raw === 'object' ? '' : String(raw)\n\t\t\t}\n\t\t\tif (typeof raw === 'object') {\n\t\t\t\tconst label = raw.title || raw.name || raw.label || raw.displayName\n\t\t\t\treturn typeof label === 'string' ? label : ''\n\t\t\t}\n\t\t\tif (typeof raw === 'boolean') {\n\t\t\t\tconst mapped = spec.map && spec.map[String(raw)]\n\t\t\t\treturn mapped ? this.tr(mapped) : this.tr(raw ? 'Yes' : 'No')\n\t\t\t}\n\t\t\tif (spec.map && Object.hasOwn(spec.map, String(raw))) {\n\t\t\t\treturn this.tr(spec.map[String(raw)])\n\t\t\t}\n\t\t\treturn String(raw)\n\t\t},\n\n\t\t/**\n\t\t * Replace `@source.<field>` / `@source.id` and the shared tokens in a string.\n\t\t *\n\t\t * @param {string} value The template.\n\t\t * @param {object|null} record The object shown.\n\t\t * @return {string} The value, '' when a token stays unresolved.\n\t\t */\n\t\tresolveTemplate(value, record) {\n\t\t\tif (typeof value !== 'string') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tlet unresolved = false\n\t\t\tconst replaced = value.replace(/@source\\.([\\w.@]+)/g, (match, path) => {\n\t\t\t\tconst read = record ? (path === 'id' ? (record.id ?? readPath(record, '@self.id')) : readPath(record, path)) : undefined\n\t\t\t\tif (read === undefined || read === null || read === '') {\n\t\t\t\t\tunresolved = true\n\t\t\t\t\treturn match\n\t\t\t\t}\n\t\t\t\treturn String(read)\n\t\t\t})\n\t\t\tif (unresolved) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (replaced.charAt(0) === '@') {\n\t\t\t\tconst resolved = resolveDeepTokens(replaced, this.tokenCtx)\n\t\t\t\treturn typeof resolved === 'string' && resolved.charAt(0) === '@' ? '' : String(resolved)\n\t\t\t}\n\t\t\treturn replaced\n\t\t},\n\n\t\t/**\n\t\t * Resolve a route declaration (`{ name, params?, query? }`).\n\t\t *\n\t\t * @param {object} route The declaration.\n\t\t * @param {object|null} record The object shown.\n\t\t * @return {object|null} The route, or null when a param stays unresolved.\n\t\t */\n\t\tresolveRoute(route, record) {\n\t\t\tif (!route || typeof route !== 'object' || !route.name) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst out = { name: route.name }\n\t\t\tfor (const key of ['params', 'query']) {\n\t\t\t\tif (route[key] && typeof route[key] === 'object') {\n\t\t\t\t\tout[key] = {}\n\t\t\t\t\tfor (const [name, value] of Object.entries(route[key])) {\n\t\t\t\t\t\tconst resolved = this.resolveTemplate(value, record)\n\t\t\t\t\t\tif (resolved === '') {\n\t\t\t\t\t\t\treturn null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tout[key][name] = resolved\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-facts-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmin-width: 0;\n}\n\n.cn-facts-widget__rows {\n\tdisplay: grid;\n\tgrid-template-columns: max-content 1fr;\n\tgap: 8px 16px;\n\tmargin: 0;\n\tfont-size: 14px;\n}\n\n/* Each row is a grid of its own children: the wrapper takes no box. */\n.cn-facts-widget__row {\n\tdisplay: contents;\n}\n\n/* Nextcloud core styles `dt` and `dd` (text-align end, 12px padding), which\n pushed the label to the right of its column and added 12px around both. The\n class is doubled so these resets outrank that rule, and a dossiq-style\n `:deep()` override in an app is not needed. */\n.cn-facts-widget__label.cn-facts-widget__label {\n\tmargin: 0;\n\tpadding: 0;\n\ttext-align: start;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-facts-widget__value.cn-facts-widget__value {\n\tmargin: 0;\n\tpadding: 0;\n\ttext-align: start;\n\tfont-weight: 500;\n\tmin-width: 0;\n\toverflow-wrap: anywhere;\n}\n\n.cn-facts-widget__title {\n\tfont-size: 15px;\n\tfont-weight: 600;\n\tcolor: var(--color-main-text);\n}\n\n.cn-facts-widget__line {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-facts-widget__meter {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 14px;\n}\n\n.cn-facts-widget__meter-head {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tgap: 16px;\n}\n\n.cn-facts-widget__meter-label {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-facts-widget__meter-value {\n\tfont-weight: 500;\n\ttext-align: end;\n}\n\n.cn-facts-widget__meter-track {\n\theight: 6px;\n\tborder-radius: 3px;\n\tbackground: var(--color-background-darker);\n\toverflow: hidden;\n}\n\n.cn-facts-widget__meter-bar {\n\tdisplay: block;\n\theight: 100%;\n\tborder-radius: inherit;\n\tbackground: var(--color-primary-element);\n}\n\n.cn-facts-widget__meter--over .cn-facts-widget__meter-value {\n\tcolor: var(--color-error-text);\n}\n\n.cn-facts-widget__meter--over .cn-facts-widget__meter-bar {\n\tbackground: var(--color-error);\n}\n\n.cn-facts-widget__muted {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-facts-widget__label .hidden-visually {\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n\n.cn-facts-widget__label--icon {\n\talign-items: center;\n\tdisplay: flex;\n}\n\n.cn-facts-widget__value-link {\n\tcolor: var(--color-primary-element);\n\ttext-decoration: underline;\n}\n\n.cn-facts-widget__inline-button,\n.cn-facts-widget__icon-button,\n.cn-facts-widget__action {\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tfont: inherit;\n}\n\n.cn-facts-widget__inline-button {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border-dark);\n\tborder-radius: 16px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tgap: 4px;\n\tmargin-inline-start: 8px;\n\tmin-height: 28px;\n\tpadding: 0 10px;\n}\n\n.cn-facts-widget__icon-button {\n\tbackground: transparent;\n\tborder: 0;\n\tborder-radius: 6px;\n\tcolor: var(--color-text-maxcontrast);\n\tmargin-inline-start: 4px;\n\tpadding: 2px;\n\tvertical-align: middle;\n}\n\n.cn-facts-widget__icon-button:hover,\n.cn-facts-widget__icon-button:focus-visible {\n\tbackground: var(--color-background-hover);\n\tcolor: var(--color-main-text);\n}\n\n.cn-facts-widget__text {\n\tcolor: var(--color-main-text);\n\tfont-size: 15px;\n}\n\n/* A lead: an icon tile or initials beside a bold title and a muted subtitle. */\n.cn-facts-widget__lead {\n\talign-items: center;\n\tdisplay: flex;\n\tgap: 12px;\n}\n\n.cn-facts-widget__lead-tile {\n\talign-items: center;\n\tbackground: var(--color-background-dark);\n\tborder-radius: 8px;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tflex: none;\n\tfont-size: 14px;\n\tfont-weight: 700;\n\theight: 40px;\n\tjustify-content: center;\n\twidth: 40px;\n}\n\n.cn-facts-widget__lead-tile--success {\n\tbackground: color-mix(in srgb, var(--color-success) 14%, var(--color-main-background));\n\tborder-radius: 50%;\n\tcolor: var(--color-success-text, var(--color-success));\n}\n\n.cn-facts-widget__lead-tile--info {\n\tbackground: var(--color-primary-element-light);\n\tborder-radius: 50%;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n}\n\n.cn-facts-widget__lead-text {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n}\n\n.cn-facts-widget__lead-title {\n\tfont-size: 15px;\n}\n\n.cn-facts-widget__lead-subtitle {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-facts-widget__action {\n\talign-self: flex-start;\n\tbackground: var(--color-primary-element-light);\n\tborder: 0;\n\tborder-radius: 16px;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n\tfont-size: 13px;\n\tfont-weight: 700;\n\tgap: 6px;\n\tmin-height: 32px;\n\tpadding: 0 14px;\n}\n\n.cn-facts-widget__action:hover,\n.cn-facts-widget__action:focus-visible {\n\tbackground: var(--color-primary-element-light-hover, var(--color-primary-element-light));\n}\n\n.cn-facts-widget__notice {\n\tmargin: 4px 0 0;\n}\n\n.cn-facts-widget__link {\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tcolor: var(--color-primary-element);\n\ttext-decoration: underline;\n}\n\n/* `columns: 2` (board DqContact): two columns, the label above the value, a\n hairline under each fact; one column on a phone. */\n.cn-facts-widget__rows--columns {\n\tgrid-template-columns: repeat(2, minmax(0, 1fr));\n\tgap: 14px 24px;\n\tfont-size: 15px;\n}\n\n.cn-facts-widget__rows--columns .cn-facts-widget__row {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 3px;\n\tmin-width: 0;\n\tpadding-bottom: 10px;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-facts-widget__rows--columns .cn-facts-widget__label.cn-facts-widget__label {\n\tfont-size: 13px;\n}\n\n@media (max-width: 640px) {\n\t.cn-facts-widget__rows--columns {\n\t\tgrid-template-columns: minmax(0, 1fr);\n\t}\n}\n</style>\n"],"names":["_createElementBlock","_toDisplayString","_openBlock","_createVNode","_Fragment","_renderList","_normalizeClass","_createElementVNode","_createBlock","_createTextVNode","_resolveDynamicComponent","_normalizeStyle"],"mappings":";;;AAWM,EAAA,KAAK,EAAC,iBAAiB;AAAC,EAAA,aAAA,EAAA,iBAAA;;;;AACvB,EAAA,KAAA,EAAA,wBAAA;AAAA,EAAA,aAAA,EAAA,gBAAA;;;;AAGF,EAAA,KAAA,EAAA,0BAAA;;;;AAGC,EAAA,KAAA,EAAA,wBAAA;AAAA,EAAA,aAAA,EAAA,gBAAA;;;AAsBI,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAuB,GAAA;;;;;;;;AA+DhC,MAAA,WAAA,GAAA,EAAA,KAAA,EAAA,4BAAA,GAAA;AACO,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,6BAAkB,GAAA;;;AACJ,EAAA,KAAA,EAAA,gCAAA;;;AAQxB,MAAA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A,EAAA;;AAEX,UAAA,EAAE,EAAE,QAAA,CAAA,IAAI,CAAC,EAAA,IAAA,SAAA;AACT,UAAA,IAAI,EAAA,QAAA,CAAA,IAAA,CAAA,IAAA,IAAA,SAAA;AACL,UAAA,KAAK,EAAC,uBAAgB;AACtB,UAAA,aAAW,EAAC,eAAA;;2BACZ,MAAgB;AAAb,YAAAD,eAAA,CAAAR,eAAA,CAAA,QAAA,CAAA,IAAI,CAAC,KAAK,CAAA,EAAA,CAAA,YAAA;;;;;AAGP,IAAA,CAAA,QAAA,CAAA,MAAM,IAAI,QAAM,CAAA,MAAA;sBADtBD;;AAEA,UAAA,IAAI,EAAC,QAAQ;AACb,UAAA,KAAK,EAAC,yBAAC;AACP,UAAA,aAAG,EAAA,iBAAA;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnFlowBoard.vue2.js';
2
2
  import { render } from './CnFlowBoard.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-b3c586ae";
5
+ script.__scopeId = "data-v-5c5d3119";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -1,14 +1,17 @@
1
1
  import { translate } from '@nextcloud/l10n';
2
2
  import { NcButton, NcCheckboxRadioSwitch, NcNoteCard } from '@nextcloud/vue';
3
+ import TestTube from 'vue-material-design-icons/TestTube.vue';
3
4
  import __sfc_main from '../CnBuildiqEditButton/CnBuildiqEditButton.vue.js';
4
- import __sfc_main$1 from '../CnFlowDetail/CnFlowDetail.vue.js';
5
- import __sfc_main$2 from '../CnFlowDetail/CnFlowRunSummary.vue.js';
6
- import __sfc_main$3 from '../CnFlowDetail/CnFlowSidebar.vue.js';
7
- import __sfc_main$4 from '../CnFlowDetail/CnFlowStepLog.vue.js';
5
+ import __sfc_main$1 from '../CnDialog/CnDialog.vue.js';
6
+ import __sfc_main$2 from '../CnFlowDetail/CnFlowDetail.vue.js';
7
+ import __sfc_main$4 from '../CnFlowDetail/CnFlowRunSummary.vue.js';
8
+ import __sfc_main$5 from '../CnFlowDetail/CnFlowSidebar.vue.js';
9
+ import __sfc_main$6 from '../CnFlowDetail/CnFlowStepLog.vue.js';
10
+ import __sfc_main$3 from '../CnResourceSelect/CnResourceSelect.vue.js';
8
11
  import { useFlowStore, FLOW_RUN_ACTIVE_STATUSES } from '../../composables/useFlowStore.js';
9
12
  import { formatRelativeDate } from '../../utils/boardDate.js';
10
13
  import { formatFlowDuration, flowRunDurationMs, flowRunName, flowRunLogLines, flowOutcomeLevels } from '../../utils/flowRunLog.js';
11
- import __sfc_main$5 from '../CnStatusBadge/CnStatusBadge.vue.js';
14
+ import __sfc_main$7 from '../CnStatusBadge/CnStatusBadge.vue.js';
12
15
 
13
16
  /**
14
17
  * The board-look flow editor and run view. CnFlowEditorPage renders it when
@@ -18,7 +21,7 @@ import __sfc_main$5 from '../CnStatusBadge/CnStatusBadge.vue.js';
18
21
  var script = {
19
22
  name: 'CnFlowBoard',
20
23
 
21
- components: { CnBuildiqEditButton: __sfc_main, CnFlowDetail: __sfc_main$1, CnFlowRunSummary: __sfc_main$2, CnFlowSidebar: __sfc_main$3, CnFlowStepLog: __sfc_main$4, CnStatusBadge: __sfc_main$5, NcButton, NcCheckboxRadioSwitch, NcNoteCard },
24
+ components: { CnBuildiqEditButton: __sfc_main, CnDialog: __sfc_main$1, CnFlowDetail: __sfc_main$2, CnResourceSelect: __sfc_main$3, TestTube, CnFlowRunSummary: __sfc_main$4, CnFlowSidebar: __sfc_main$5, CnFlowStepLog: __sfc_main$6, CnStatusBadge: __sfc_main$7, NcButton, NcCheckboxRadioSwitch, NcNoteCard },
22
25
 
23
26
  props: {
24
27
  /** The flow uuid, or `new`. */
@@ -39,6 +42,12 @@ var script = {
39
42
  notice: { type: String, default: '' },
40
43
  /** The pill beside the title ("Case type flow"). */
41
44
  pill: { type: String, default: '' },
45
+ /**
46
+ * The records a test run can take as its subject: `{ register, schema,
47
+ * labelField?, label? }`. Draws a header button ("Testen met een zaak",
48
+ * DqFlow) that runs the saved flow once with a picked record.
49
+ */
50
+ testSubject: { type: Object, default: null },
42
51
  },
43
52
 
44
53
  emits: ['save', 'run', 'retried'],
@@ -48,10 +57,20 @@ var script = {
48
57
  },
49
58
 
50
59
  data() {
51
- return { runTab: 'step' }
60
+ return { runTab: 'step', testOpen: false, testRecord: null }
52
61
  },
53
62
 
54
63
  computed: {
64
+ /** @return {boolean} Whether a test subject is declared well enough to pick one. */
65
+ testSubjectReady() {
66
+ return Boolean(this.testSubject && this.testSubject.register && this.testSubject.schema)
67
+ },
68
+
69
+ /** @return {string} The test button's label: the page's own, else the library's. */
70
+ testLabel() {
71
+ return (this.testSubject && this.testSubject.label) || translate('nextcloud-vue', 'Test with a record')
72
+ },
73
+
55
74
  /** @return {boolean} Whether the palette card is drawn. */
56
75
  showPalette() {
57
76
  return this.palette === 'column' && !this.store.inRunView
@@ -268,6 +287,22 @@ var script = {
268
287
  },
269
288
 
270
289
  methods: {
290
+ /**
291
+ * Run the saved flow once with the picked record as its subject, then
292
+ * close the dialog; the run shows on the canvas as any run does.
293
+ *
294
+ * @return {Promise<void>}
295
+ */
296
+ async runTest() {
297
+ const uuid = Array.isArray(this.testRecord) ? this.testRecord[0] : this.testRecord;
298
+ if (!uuid) {
299
+ return
300
+ }
301
+ await this.store.run({ uuid, register: this.testSubject.register, schema: this.testSubject.schema });
302
+ this.testOpen = false;
303
+ this.testRecord = null;
304
+ },
305
+
271
306
  t: translate,
272
307
 
273
308
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CnFlowBoard.vue2.js","sources":["../../../../src/components/CnFlowsPage/CnFlowBoard.vue"],"sourcesContent":["<!--\n CnFlowBoard — the flow editor in the board look: a page header with the\n flow's name, path and actions, then the canvas in a card beside an\n inspector card. Optionally a palette card on the left (`palette: column`).\n The same page shows one run when the route carries `?run=`: the canvas\n paints each step's outcome and the inspector holds the run's card and logs.\n\n The canvas itself is CnFlowDetail; this component only lays it out and adds\n what the board draws around it.\n\n SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-flow-board\" :class=\"{ 'cn-flow-board--with-palette': showPalette }\" data-testid=\"flow-board\">\n\t\t<header class=\"cn-flow-board__header\">\n\t\t\t<div class=\"cn-flow-board__heading\">\n\t\t\t\t<h2 class=\"cn-flow-board__title\" data-testid=\"flow-board-title\">\n\t\t\t\t\t{{ titleText }}\n\t\t\t\t</h2>\n\t\t\t\t<CnStatusBadge v-if=\"pillText\" :label=\"pillText\" variant=\"default\" />\n\t\t\t</div>\n\t\t\t<div v-if=\"!store.inRunView\" class=\"cn-flow-board__actions\">\n\t\t\t\t<NcCheckboxRadioSwitch v-if=\"store.flow.id\"\n\t\t\t\t\ttype=\"switch\"\n\t\t\t\t\t:modelValue=\"store.flow.enabled !== false\"\n\t\t\t\t\tdata-testid=\"flow-board-enabled\"\n\t\t\t\t\t@update:modelValue=\"onEnabledChange\">\n\t\t\t\t\t{{ store.flow.enabled !== false ? t('nextcloud-vue', 'Active') : t('nextcloud-vue', 'Paused') }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t<NcButton :disabled=\"store.checking || !store.nodes.length\"\n\t\t\t\t\tdata-testid=\"flow-board-check\"\n\t\t\t\t\t@click=\"store.check()\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Check') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton v-if=\"showRun\"\n\t\t\t\t\t:disabled=\"store.running || !store.flow.id\"\n\t\t\t\t\tdata-testid=\"flow-board-run\"\n\t\t\t\t\t@click=\"$emit('run')\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Run') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<CnBuildiqEditButton />\n\t\t\t\t<NcButton variant=\"primary\"\n\t\t\t\t\t:disabled=\"store.saving || !store.flow.name || store.graphLocked\"\n\t\t\t\t\tdata-testid=\"flow-board-save\"\n\t\t\t\t\t@click=\"$emit('save')\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Save') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</header>\n\n\t\t<p class=\"cn-flow-board__path\" data-testid=\"flow-board-path\">\n\t\t\t<a :href=\"listHref\" class=\"cn-flow-board__crumb\" @click=\"onCrumbClick($event, detailRoute)\">{{ listText }}</a>\n\t\t\t<span aria-hidden=\"true\"> / </span>\n\t\t\t<template v-if=\"store.inRunView\">\n\t\t\t\t<a :href=\"flowHref\" class=\"cn-flow-board__crumb\" @click=\"onCrumbClick($event, flowPath)\">{{ flowName }}</a>\n\t\t\t\t<span aria-hidden=\"true\"> / </span>\n\t\t\t\t<span>{{ runCrumb }}</span>\n\t\t\t</template>\n\t\t\t<span v-else>{{ flowName }}</span>\n\t\t\t<span v-if=\"metaText\" class=\"cn-flow-board__meta\"> · {{ metaText }}</span>\n\t\t</p>\n\n\t\t<NcNoteCard v-if=\"notice && !store.inRunView\" type=\"info\" class=\"cn-flow-board__notice\">\n\t\t\t{{ notice }}\n\t\t</NcNoteCard>\n\n\t\t<div class=\"cn-flow-board__body\">\n\t\t\t<aside v-if=\"showPalette\" class=\"cn-flow-board__card cn-flow-board__palette\" data-testid=\"flow-board-palette\">\n\t\t\t\t<h3 class=\"cn-flow-board__card-title\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Steps') }}\n\t\t\t\t</h3>\n\t\t\t\t<section v-for=\"group in paletteGroups\"\n\t\t\t\t\t:key=\"group.app\"\n\t\t\t\t\tclass=\"cn-flow-board__palette-group\">\n\t\t\t\t\t<h4 class=\"cn-flow-board__palette-app\">\n\t\t\t\t\t\t{{ group.app }}\n\t\t\t\t\t</h4>\n\t\t\t\t\t<ul class=\"cn-flow-board__palette-list\">\n\t\t\t\t\t\t<li v-for=\"entry in group.entries\" :key=\"entry.id\">\n\t\t\t\t\t\t\t<button type=\"button\"\n\t\t\t\t\t\t\t\tclass=\"cn-flow-board__palette-step\"\n\t\t\t\t\t\t\t\t:disabled=\"store.graphLocked\"\n\t\t\t\t\t\t\t\t:data-testid=\"`flow-board-palette-${entry.id}`\"\n\t\t\t\t\t\t\t\t@click=\"store.addNode(entry.id)\">\n\t\t\t\t\t\t\t\t{{ entry.displayName || entry.label || entry.id }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<p v-if=\"paletteFootnote\" class=\"cn-flow-board__palette-note\">\n\t\t\t\t\t{{ paletteFootnote }}\n\t\t\t\t</p>\n\t\t\t</aside>\n\n\t\t\t<section class=\"cn-flow-board__card cn-flow-board__canvas\" :aria-label=\"t('nextcloud-vue', 'Flow canvas')\">\n\t\t\t\t<CnFlowDetail :id=\"id\"\n\t\t\t\t\t:app=\"app\"\n\t\t\t\t\t:run=\"run\"\n\t\t\t\t\t:toolbarActions=\"false\"\n\t\t\t\t\t:addStep=\"!showPalette\"\n\t\t\t\t\t@save=\"$emit('save')\"\n\t\t\t\t\t@run=\"$emit('run')\" />\n\t\t\t\t<div v-if=\"store.inRunView\"\n\t\t\t\t\tclass=\"cn-flow-board__legend\"\n\t\t\t\t\tdata-testid=\"flow-board-legend\">\n\t\t\t\t\t<span v-for=\"level in legend\" :key=\"level.id\" class=\"cn-flow-board__legend-item\">\n\t\t\t\t\t\t<CnStatusBadge :label=\"level.label\" :variant=\"level.variant\" size=\"small\" />\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<p v-else\n\t\t\t\t\tclass=\"cn-flow-board__validity\"\n\t\t\t\t\t:class=\"`cn-flow-board__validity--${validity.tone}`\"\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\tdata-testid=\"flow-board-validity\">\n\t\t\t\t\t{{ validity.text }}\n\t\t\t\t</p>\n\t\t\t</section>\n\n\t\t\t<aside class=\"cn-flow-board__card cn-flow-board__inspector\" data-testid=\"flow-board-inspector\">\n\t\t\t\t<template v-if=\"store.inRunView\">\n\t\t\t\t\t<CnFlowRunSummary :run=\"runRecord\"\n\t\t\t\t\t\t:stepsTotal=\"store.nodes.length\"\n\t\t\t\t\t\t:canRetry=\"canRetry\"\n\t\t\t\t\t\t@back=\"onBackToFlow\"\n\t\t\t\t\t\t@retry=\"onRetry\" />\n\t\t\t\t\t<div class=\"cn-flow-board__tabs\" role=\"tablist\">\n\t\t\t\t\t\t<button v-for=\"tab in runTabs\"\n\t\t\t\t\t\t\t:key=\"tab.id\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\tclass=\"cn-flow-board__tab\"\n\t\t\t\t\t\t\t:class=\"{ 'cn-flow-board__tab--active': runTab === tab.id }\"\n\t\t\t\t\t\t\t:aria-selected=\"runTab === tab.id ? 'true' : 'false'\"\n\t\t\t\t\t\t\t:data-testid=\"`flow-board-run-tab-${tab.id}`\"\n\t\t\t\t\t\t\t@click=\"runTab = tab.id\">\n\t\t\t\t\t\t\t{{ tab.label }}\n\t\t\t\t\t\t\t<span class=\"cn-flow-board__tab-count\">{{ tab.count }}</span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<CnFlowStepLog :lines=\"runTab === 'step' ? selectedRunLines : allRunLines\"\n\t\t\t\t\t\t:emptyText=\"runTab === 'step' && !store.selectedNodeId ? t('nextcloud-vue', 'Select a step on the canvas to see what it did.') : ''\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-else-if=\"store.selectedNode\">\n\t\t\t\t\t<p class=\"cn-flow-board__eyebrow\">\n\t\t\t\t\t\t{{ stepTypeLabel }}\n\t\t\t\t\t</p>\n\t\t\t\t\t<h3 class=\"cn-flow-board__card-title\" data-testid=\"flow-board-step-name\">\n\t\t\t\t\t\t{{ stepName }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<div class=\"cn-flow-board__step-actions\">\n\t\t\t\t\t\t<NcButton data-testid=\"flow-board-edit-step\" @click=\"store.editingNodeId = store.selectedNodeId\">\n\t\t\t\t\t\t\t{{ t('nextcloud-vue', 'Edit step') }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t<NcButton v-if=\"lastRunUuid\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tdata-testid=\"flow-board-open-last-run\"\n\t\t\t\t\t\t\t@click=\"openRun(lastRunUuid)\">\n\t\t\t\t\t\t\t{{ t('nextcloud-vue', 'Open the last run on the canvas') }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t\t<h4 class=\"cn-flow-board__subtitle\">\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Recent log lines of this step') }}\n\t\t\t\t\t</h4>\n\t\t\t\t\t<CnFlowStepLog :lines=\"recentStepLines\"\n\t\t\t\t\t\twithDay\n\t\t\t\t\t\t:emptyText=\"t('nextcloud-vue', 'This step has not run yet.')\" />\n\t\t\t\t\t<div class=\"cn-flow-board__step-footer\">\n\t\t\t\t\t\t<NcButton variant=\"tertiary\"\n\t\t\t\t\t\t\t:disabled=\"store.graphLocked\"\n\t\t\t\t\t\t\tdata-testid=\"flow-board-delete-step\"\n\t\t\t\t\t\t\t@click=\"store.removeNode(store.selectedNodeId)\">\n\t\t\t\t\t\t\t{{ t('nextcloud-vue', 'Delete step') }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t<NcButton data-testid=\"flow-board-done\" @click=\"store.selectedNodeId = null\">\n\t\t\t\t\t\t\t{{ t('nextcloud-vue', 'Done') }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t\t<CnFlowSidebar v-else embedded />\n\t\t\t</aside>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcCheckboxRadioSwitch, NcNoteCard } from '@nextcloud/vue'\nimport CnBuildiqEditButton from '../CnBuildiqEditButton/CnBuildiqEditButton.vue'\nimport CnFlowDetail from '../CnFlowDetail/CnFlowDetail.vue'\nimport CnFlowRunSummary from '../CnFlowDetail/CnFlowRunSummary.vue'\nimport CnFlowSidebar from '../CnFlowDetail/CnFlowSidebar.vue'\nimport CnFlowStepLog from '../CnFlowDetail/CnFlowStepLog.vue'\nimport { FLOW_RUN_ACTIVE_STATUSES, useFlowStore } from '../../composables/useFlowStore.js'\nimport { formatRelativeDate } from '../../utils/boardDate.js'\nimport { flowOutcomeLevels, flowRunDurationMs, flowRunLogLines, flowRunName, formatFlowDuration } from '../../utils/flowRunLog.js'\nimport { CnStatusBadge } from '../CnStatusBadge/index.js'\n\n/**\n * The board-look flow editor and run view. CnFlowEditorPage renders it when\n * the app or page is in the board look; the Nextcloud look keeps the canvas\n * on its own with the app sidebar.\n */\nexport default {\n\tname: 'CnFlowBoard',\n\n\tcomponents: { CnBuildiqEditButton, CnFlowDetail, CnFlowRunSummary, CnFlowSidebar, CnFlowStepLog, CnStatusBadge, NcButton, NcCheckboxRadioSwitch, NcNoteCard },\n\n\tprops: {\n\t\t/** The flow uuid, or `new`. */\n\t\tid: { type: String, default: '' },\n\t\t/** The owning app, for a new flow and the list scope. */\n\t\tapp: { type: String, default: null },\n\t\t/** The run to show, or ''. */\n\t\trun: { type: String, default: '' },\n\t\t/** Where the flow list lives; flows open at `<detailRoute>/<id>`. */\n\t\tdetailRoute: { type: String, default: '/flows' },\n\t\t/** The list's name in the path (\"Flows\", \"Settings / Flows\"). */\n\t\tlistLabel: { type: String, default: '' },\n\t\t/** `column` draws the step palette as a card on the left. */\n\t\tpalette: { type: String, default: 'picker' },\n\t\t/** Free text under the path in the palette card. */\n\t\tpaletteFootnote: { type: String, default: '' },\n\t\t/** An info notice under the path. */\n\t\tnotice: { type: String, default: '' },\n\t\t/** The pill beside the title (\"Case type flow\"). */\n\t\tpill: { type: String, default: '' },\n\t},\n\n\temits: ['save', 'run', 'retried'],\n\n\tsetup() {\n\t\treturn { store: useFlowStore() }\n\t},\n\n\tdata() {\n\t\treturn { runTab: 'step' }\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} Whether the palette card is drawn. */\n\t\tshowPalette() {\n\t\t\treturn this.palette === 'column' && !this.store.inRunView\n\t\t},\n\n\t\t/** @return {string} The page title. */\n\t\ttitleText() {\n\t\t\treturn this.store.flow.name || this.t('nextcloud-vue', 'New flow')\n\t\t},\n\n\t\t/** @return {string} The flow's name in the path. */\n\t\tflowName() {\n\t\t\treturn this.store.flow.name || this.t('nextcloud-vue', 'New flow')\n\t\t},\n\n\t\t/** @return {string} The pill text: the page's, else the lifecycle. */\n\t\tpillText() {\n\t\t\tif (this.pill) {\n\t\t\t\treturn this.pill\n\t\t\t}\n\t\t\tconst lifecycle = String(this.store.flow.lifecycleStatus || '')\n\t\t\tif (lifecycle === 'draft') {\n\t\t\t\treturn this.t('nextcloud-vue', 'Draft')\n\t\t\t}\n\t\t\tif (lifecycle === 'deprecated') {\n\t\t\t\treturn this.t('nextcloud-vue', 'Retired')\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/** @return {string} The list label. */\n\t\tlistText() {\n\t\t\treturn this.listLabel || this.t('nextcloud-vue', 'Flows')\n\t\t},\n\n\t\t/** @return {string} The flow's own path. */\n\t\tflowPath() {\n\t\t\treturn `${this.detailRoute}/${this.store.flow.id || this.id}`\n\t\t},\n\n\t\t/** @return {string} The list href. */\n\t\tlistHref() {\n\t\t\treturn this.hrefOf(this.detailRoute)\n\t\t},\n\n\t\t/** @return {string} The flow href. */\n\t\tflowHref() {\n\t\t\treturn this.hrefOf(this.flowPath)\n\t\t},\n\n\t\t/**\n\t\t * What the path says after the name: the trigger, the step count and\n\t\t * the version in the editor; when the run started and how long it\n\t\t * took in the run view.\n\t\t *\n\t\t * @return {string} The meta text.\n\t\t */\n\t\tmetaText() {\n\t\t\tif (this.store.inRunView) {\n\t\t\t\tconst record = this.runRecord\n\t\t\t\tif (!record) {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst parts = [formatRelativeDate(record.created, { withTime: true })]\n\t\t\t\tconst duration = formatFlowDuration(flowRunDurationMs(record))\n\t\t\t\tif (duration) {\n\t\t\t\t\tparts.push(this.t('nextcloud-vue', 'done in {duration}', { duration }))\n\t\t\t\t}\n\t\t\t\treturn parts.filter(Boolean).join(' · ')\n\t\t\t}\n\t\t\tconst parts = []\n\t\t\tconst trigger = this.triggerText\n\t\t\tif (trigger) {\n\t\t\t\tparts.push(this.t('nextcloud-vue', 'trigger {trigger}', { trigger }))\n\t\t\t}\n\t\t\tconst count = this.store.nodes.length\n\t\t\tparts.push(count === 1 ? this.t('nextcloud-vue', '1 step') : this.t('nextcloud-vue', '{count} steps', { count }))\n\t\t\tif (this.store.flow.version) {\n\t\t\t\tparts.push(this.t('nextcloud-vue', 'version {version}', { version: this.store.flow.version }))\n\t\t\t}\n\t\t\treturn parts.join(' · ')\n\t\t},\n\n\t\t/** @return {string} How the flow starts, as the catalogue names it. */\n\t\ttriggerText() {\n\t\t\tconst trigger = String(this.store.flow.trigger || '')\n\t\t\tif (trigger === 'schedule') {\n\t\t\t\treturn this.t('nextcloud-vue', 'On a schedule')\n\t\t\t}\n\t\t\tif (trigger === '' || trigger === 'manual') {\n\t\t\t\treturn this.t('nextcloud-vue', 'Run by hand')\n\t\t\t}\n\t\t\tconst entry = (this.store.eventCatalog || []).find((item) => item && item.id === trigger)\n\t\t\treturn (entry && entry.label) || trigger\n\t\t},\n\n\t\t/** @return {boolean} Whether Run is offered. */\n\t\tshowRun() {\n\t\t\treturn this.store.nodes.some((node) => node?.type === 'openregister.trigger-manual')\n\t\t},\n\n\t\t/**\n\t\t * The engine's verdict on the canvas as one line under it.\n\t\t *\n\t\t * @return {{tone: string, text: string}} The validity bar.\n\t\t */\n\t\tvalidity() {\n\t\t\tconst result = this.store.checkResult\n\t\t\tif (!result) {\n\t\t\t\treturn { tone: 'unknown', text: this.t('nextcloud-vue', 'Not checked yet. Check runs the flow past the engine without saving it.') }\n\t\t\t}\n\t\t\tconst blocking = Array.isArray(result.blocking) ? result.blocking.length : 0\n\t\t\tconst warnings = Array.isArray(result.warnings) ? result.warnings.length : 0\n\t\t\tif (result.valid === false || blocking > 0) {\n\t\t\t\treturn { tone: 'error', text: result.message || this.t('nextcloud-vue', 'The flow cannot run as it is. See the messages on the canvas.') }\n\t\t\t}\n\t\t\tif (warnings > 0) {\n\t\t\t\treturn { tone: 'warning', text: this.t('nextcloud-vue', 'The flow is valid, with {count} warnings.', { count: warnings }) }\n\t\t\t}\n\t\t\treturn { tone: 'success', text: this.t('nextcloud-vue', 'The flow is valid.') }\n\t\t},\n\n\t\t/** @return {Array<object>} The palette grouped by owning app. */\n\t\tpaletteGroups() {\n\t\t\tconst groups = {}\n\t\t\t;(this.store.nodeCatalog || []).forEach((entry) => {\n\t\t\t\tconst app = String(entry?.app || String(entry?.id || '').split('.')[0] || '')\n\t\t\t\tif (!groups[app]) {\n\t\t\t\t\tgroups[app] = { app, entries: [] }\n\t\t\t\t}\n\t\t\t\tgroups[app].entries.push(entry)\n\t\t\t})\n\t\t\treturn Object.values(groups)\n\t\t},\n\n\t\t/** @return {object|null} The run on screen. */\n\t\trunRecord() {\n\t\t\treturn this.store.runDetail\n\t\t\t\t|| (this.store.runs || []).find((item) => item.uuid === this.store.inspectedRunUuid)\n\t\t\t\t|| null\n\t\t},\n\n\t\t/** @return {string} The run's place in the path. */\n\t\trunCrumb() {\n\t\t\treturn this.t('nextcloud-vue', 'Run {id}', { id: flowRunName(this.runRecord) })\n\t\t},\n\n\t\t/** @return {boolean} Whether Run again is offered. */\n\t\tcanRetry() {\n\t\t\treturn !!this.runRecord && !FLOW_RUN_ACTIVE_STATUSES.includes(this.runRecord.status)\n\t\t},\n\n\t\t/** @return {Array<object>} Every line of the run on screen. */\n\t\tallRunLines() {\n\t\t\treturn this.runRecord ? flowRunLogLines(this.runRecord) : []\n\t\t},\n\n\t\t/** @return {Array<object>} The selected step's lines in this run. */\n\t\tselectedRunLines() {\n\t\t\treturn this.runRecord && this.store.selectedNodeId\n\t\t\t\t? flowRunLogLines(this.runRecord, this.store.selectedNodeId)\n\t\t\t\t: []\n\t\t},\n\n\t\t/** @return {Array<object>} The two log tabs with their counts. */\n\t\trunTabs() {\n\t\t\treturn [\n\t\t\t\t{ id: 'step', label: this.t('nextcloud-vue', 'This step'), count: this.selectedRunLines.length },\n\t\t\t\t{ id: 'run', label: this.t('nextcloud-vue', 'Logs of the whole run'), count: this.allRunLines.length },\n\t\t\t]\n\t\t},\n\n\t\t/** @return {Array<object>} The legend of outcomes on the canvas. */\n\t\tlegend() {\n\t\t\tconst levels = flowOutcomeLevels()\n\t\t\treturn ['success', 'warning', 'error', 'info', 'skipped'].map((id) => ({ id, ...levels[id] }))\n\t\t},\n\n\t\t/** @return {string} The selected step's type, as the catalogue names it. */\n\t\tstepTypeLabel() {\n\t\t\tconst node = this.store.selectedNode\n\t\t\tconst entry = node ? this.store.catalogEntry(node.type) : null\n\t\t\treturn entry ? (entry.displayName || entry.id) : String(node?.type || '')\n\t\t},\n\n\t\t/** @return {string} The selected step's name. */\n\t\tstepName() {\n\t\t\tconst node = this.store.selectedNode\n\t\t\treturn (node && (node.name || node.label)) || this.stepTypeLabel\n\t\t},\n\n\t\t/**\n\t\t * The selected step's lines from the flow's recent runs, newest run\n\t\t * first, at most ten.\n\t\t *\n\t\t * @return {Array<object>} The lines.\n\t\t */\n\t\trecentStepLines() {\n\t\t\tconst id = this.store.selectedNodeId\n\t\t\tif (!id) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst lines = []\n\t\t\t;(this.store.runs || []).forEach((item) => {\n\t\t\t\tflowRunLogLines(item, id).forEach((line) => lines.push({ ...line, key: `${item.uuid}-${line.key}` }))\n\t\t\t})\n\t\t\treturn lines.slice(0, 10)\n\t\t},\n\n\t\t/** @return {string} The newest run's uuid, or ''. */\n\t\tlastRunUuid() {\n\t\t\treturn (this.store.runs && this.store.runs[0] && this.store.runs[0].uuid) || ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * @param {string} path An app route path.\n\t\t * @return {string} Its href.\n\t\t */\n\t\threfOf(path) {\n\t\t\tif (this.$router && typeof this.$router.resolve === 'function') {\n\t\t\t\ttry {\n\t\t\t\t\tconst resolved = this.$router.resolve(path)\n\t\t\t\t\tif (resolved && resolved.href) {\n\t\t\t\t\t\treturn resolved.href\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// A path the router does not know stays a plain path.\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn path\n\t\t},\n\n\t\t/**\n\t\t * Follow a path link on the app's router; a modified click keeps the\n\t\t * browser's own behaviour.\n\t\t *\n\t\t * @param {MouseEvent} event The click.\n\t\t * @param {string} path The target path.\n\t\t * @return {void}\n\t\t */\n\t\tonCrumbClick(event, path) {\n\t\t\tif (!this.$router || event.ctrlKey || event.metaKey || event.shiftKey || event.button === 1) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tevent.preventDefault()\n\t\t\tthis.$router.push(path).catch(() => {})\n\t\t},\n\n\t\t/**\n\t\t * Switch the flow on or off. The change is saved with the flow.\n\t\t *\n\t\t * @param {boolean} on The new state.\n\t\t * @return {void}\n\t\t */\n\t\tonEnabledChange(on) {\n\t\t\tthis.store.flow.enabled = on === true\n\t\t\tthis.store.dirty = true\n\t\t},\n\n\t\t/**\n\t\t * Open a run of this flow on the canvas.\n\t\t *\n\t\t * @param {string} uuid The run.\n\t\t * @return {void}\n\t\t */\n\t\topenRun(uuid) {\n\t\t\tif (this.$router) {\n\t\t\t\tthis.$router.push({ path: this.flowPath, query: { run: uuid } }).catch(() => {})\n\t\t\t} else {\n\t\t\t\tthis.store.inspectRun(uuid)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Leave the run view for the flow.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonBackToFlow() {\n\t\t\tthis.store.closeRun()\n\t\t\tif (this.$router) {\n\t\t\t\tthis.$router.push({ path: this.flowPath }).catch(() => {})\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Start the shown run again and open the new one.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onRetry() {\n\t\t\tconst retried = await this.store.retryRun(this.runRecord?.uuid)\n\t\t\tthis.$emit('retried', retried)\n\t\t\tif (retried && retried.uuid) {\n\t\t\t\tthis.openRun(retried.uuid)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-flow-board {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding: 20px 24px;\n\tmin-height: 100%;\n\tbox-sizing: border-box;\n}\n\n.cn-flow-board__header {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 12px;\n}\n\n.cn-flow-board__heading {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tmin-width: 0;\n}\n\n.cn-flow-board__title {\n\tmargin: 0;\n\tfont-size: 24px;\n\tfont-weight: 600;\n}\n\n.cn-flow-board__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px;\n}\n\n.cn-flow-board__path {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-board__crumb {\n\tcolor: var(--color-main-text);\n\ttext-decoration: underline;\n}\n\n.cn-flow-board__body {\n\tdisplay: grid;\n\tgrid-template-columns: minmax(0, 1fr) 340px;\n\tgap: 16px;\n\tflex: 1 1 auto;\n\tmin-height: 520px;\n}\n\n.cn-flow-board--with-palette .cn-flow-board__body {\n\tgrid-template-columns: 240px minmax(0, 1fr) 340px;\n}\n\n.cn-flow-board__card {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tmin-width: 0;\n\tpadding: 16px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: 12px;\n\tbackground: var(--color-main-background);\n}\n\n.cn-flow-board__canvas {\n\tpadding: 0;\n\toverflow: hidden;\n\tbackground-color: var(--color-background-hover);\n\tbackground-image: radial-gradient(var(--color-border-dark) 1px, transparent 1px);\n\tbackground-size: 16px 16px;\n}\n\n.cn-flow-board__canvas > :first-child {\n\tflex: 1 1 auto;\n\tmin-height: 0;\n}\n\n.cn-flow-board__card-title {\n\tmargin: 0;\n\tfont-size: 16px;\n\tfont-weight: 600;\n}\n\n.cn-flow-board__subtitle {\n\tmargin: 4px 0 0;\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-flow-board__eyebrow {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-flow-board__validity,\n.cn-flow-board__legend {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tmargin: 0;\n\tpadding: 10px 16px;\n\tborder-top: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n}\n\n.cn-flow-board__validity--success {\n\tcolor: var(--color-success-text);\n}\n\n.cn-flow-board__validity--warning {\n\tcolor: var(--color-warning-text);\n}\n\n.cn-flow-board__validity--error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-flow-board__palette-group {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-flow-board__palette-app {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-flow-board__palette-list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-flow-board__palette-step {\n\twidth: 100%;\n\tmin-height: 34px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: 8px;\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\ttext-align: start;\n\tcursor: pointer;\n}\n\n.cn-flow-board__palette-step:hover {\n\tbackground: var(--color-background-hover);\n}\n\n.cn-flow-board__palette-note {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-flow-board__tabs {\n\tdisplay: flex;\n\tgap: 4px;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-flow-board__tab {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 8px 10px;\n\tmargin-bottom: -1px;\n\tborder: 1px solid transparent;\n\tborder-radius: 8px 8px 0 0;\n\tbackground: transparent;\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-flow-board__tab--active {\n\tborder-color: var(--color-border);\n\tborder-bottom-color: var(--color-main-background);\n\tfont-weight: 600;\n}\n\n.cn-flow-board__tab-count {\n\tmin-width: 18px;\n\tpadding: 0 5px;\n\tborder-radius: 9px;\n\tbackground: var(--color-background-dark);\n\tfont-size: 12px;\n\tline-height: 18px;\n\ttext-align: center;\n}\n\n.cn-flow-board__step-actions,\n.cn-flow-board__step-footer {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-flow-board__step-footer {\n\tjustify-content: space-between;\n\tmargin-top: auto;\n}\n\n@media (max-width: 1024px) {\n\t.cn-flow-board__body,\n\t.cn-flow-board--with-palette .cn-flow-board__body {\n\t\tgrid-template-columns: minmax(0, 1fr);\n\t}\n}\n</style>\n"],"names":["CnBuildiqEditButton","CnFlowDetail","CnFlowRunSummary","CnFlowSidebar","CnFlowStepLog","CnStatusBadge","t"],"mappings":";;;;;;;;;;;;AAsMA;AACC;;;;AAID,aAAe;AACd,CAAA,IAAI,EAAE,aAAa;;AAEnB,CAAA,UAAU,EAAE,uBAAEA,UAAmB,gBAAEC,YAAY,oBAAEC,YAAgB,iBAAEC,YAAa,iBAAEC,YAAa,iBAAEC,YAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,YAAY;;AAE7J,CAAA,KAAK,EAAE;;EAEN,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAC,EAAG;AACjC;AACA,EAAA,GAAG,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IAAI,EAAE;AACb,GAAA,IAAI,IAAI,CAAC,OAAO,EAAE;AACjB,IAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,IAAK,EAAA,EAAG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,EAAA;IAC9E,MAAK;IACN,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAA;AAC3B,IAAA;GACA;;AAED;;AAEC;;;AAGD,EAAA,YAAY,GAAG;AACd,GAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAC;AACpB,GAAA,IAAI,IAAI,CAAC,OAAO,EAAE;IACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAO,EAAG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,EAAA;AAC1D,IAAA;GACA;;AAED;AACC;AACA;;;AAGD,EAAA,MAAM,OAAO,GAAG;GACf,MAAM,OAAM,GAAI,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAA;GAC9D,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,EAAA;GAC7B,IAAI,OAAM,IAAK,OAAO,CAAC,IAAI,EAAE;IAC5B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAA;AAC1B,IAAA;GACA;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnFlowBoard.vue2.js","sources":["../../../../src/components/CnFlowsPage/CnFlowBoard.vue"],"sourcesContent":["<!--\n CnFlowBoard — the flow editor in the board look: a page header with the\n flow's name, path and actions, then the canvas in a card beside an\n inspector card. Optionally a palette card on the left (`palette: column`).\n The same page shows one run when the route carries `?run=`: the canvas\n paints each step's outcome and the inspector holds the run's card and logs.\n\n The canvas itself is CnFlowDetail; this component only lays it out and adds\n what the board draws around it.\n\n SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-flow-board\" :class=\"{ 'cn-flow-board--with-palette': showPalette }\" data-testid=\"flow-board\">\n\t\t<header class=\"cn-flow-board__header\">\n\t\t\t<div class=\"cn-flow-board__heading\">\n\t\t\t\t<h2 class=\"cn-flow-board__title\" data-testid=\"flow-board-title\">\n\t\t\t\t\t{{ titleText }}\n\t\t\t\t</h2>\n\t\t\t\t<CnStatusBadge v-if=\"pillText\" :label=\"pillText\" variant=\"default\" />\n\t\t\t</div>\n\t\t\t<div v-if=\"!store.inRunView\" class=\"cn-flow-board__actions\">\n\t\t\t\t<NcCheckboxRadioSwitch v-if=\"store.flow.id\"\n\t\t\t\t\ttype=\"switch\"\n\t\t\t\t\t:modelValue=\"store.flow.enabled !== false\"\n\t\t\t\t\tdata-testid=\"flow-board-enabled\"\n\t\t\t\t\t@update:modelValue=\"onEnabledChange\">\n\t\t\t\t\t{{ store.flow.enabled !== false ? t('nextcloud-vue', 'Active') : t('nextcloud-vue', 'Paused') }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t<NcButton :disabled=\"store.checking || !store.nodes.length\"\n\t\t\t\t\tdata-testid=\"flow-board-check\"\n\t\t\t\t\t@click=\"store.check()\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Check') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton v-if=\"showRun\"\n\t\t\t\t\t:disabled=\"store.running || !store.flow.id\"\n\t\t\t\t\tdata-testid=\"flow-board-run\"\n\t\t\t\t\t@click=\"$emit('run')\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Run') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton v-if=\"testSubjectReady\"\n\t\t\t\t\t:disabled=\"store.running || !store.flow.id\"\n\t\t\t\t\tdata-testid=\"flow-board-test\"\n\t\t\t\t\t@click=\"testOpen = true\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<TestTube :size=\"16\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ testLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<CnBuildiqEditButton />\n\t\t\t\t<NcButton variant=\"primary\"\n\t\t\t\t\t:disabled=\"store.saving || !store.flow.name || store.graphLocked\"\n\t\t\t\t\tdata-testid=\"flow-board-save\"\n\t\t\t\t\t@click=\"$emit('save')\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Save') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</header>\n\n\t\t<CnDialog v-if=\"testOpen\"\n\t\t\t:name=\"testLabel\"\n\t\t\tdata-testid=\"flow-board-test-dialog\"\n\t\t\t@closing=\"testOpen = false\">\n\t\t\t<p class=\"cn-flow-board__test-intro\">\n\t\t\t\t{{ t('nextcloud-vue', 'The saved flow runs once with the record you pick as its subject.') }}\n\t\t\t</p>\n\t\t\t<CnResourceSelect v-model=\"testRecord\"\n\t\t\t\t:register=\"testSubject.register\"\n\t\t\t\t:schema=\"testSubject.schema\"\n\t\t\t\t:labelField=\"testSubject.labelField || 'title'\"\n\t\t\t\t:inputLabel=\"t('nextcloud-vue', 'Record')\"\n\t\t\t\tdata-testid=\"flow-board-test-record\" />\n\t\t\t<template #actions>\n\t\t\t\t<NcButton data-testid=\"flow-board-test-cancel\" @click=\"testOpen = false\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton variant=\"primary\"\n\t\t\t\t\t:disabled=\"!testRecord || store.running\"\n\t\t\t\t\tdata-testid=\"flow-board-test-run\"\n\t\t\t\t\t@click=\"runTest\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Run test') }}\n\t\t\t\t</NcButton>\n\t\t\t</template>\n\t\t</CnDialog>\n\n\t\t<p class=\"cn-flow-board__path\" data-testid=\"flow-board-path\">\n\t\t\t<a :href=\"listHref\" class=\"cn-flow-board__crumb\" @click=\"onCrumbClick($event, detailRoute)\">{{ listText }}</a>\n\t\t\t<span aria-hidden=\"true\"> / </span>\n\t\t\t<template v-if=\"store.inRunView\">\n\t\t\t\t<a :href=\"flowHref\" class=\"cn-flow-board__crumb\" @click=\"onCrumbClick($event, flowPath)\">{{ flowName }}</a>\n\t\t\t\t<span aria-hidden=\"true\"> / </span>\n\t\t\t\t<span>{{ runCrumb }}</span>\n\t\t\t</template>\n\t\t\t<span v-else>{{ flowName }}</span>\n\t\t\t<span v-if=\"metaText\" class=\"cn-flow-board__meta\"> · {{ metaText }}</span>\n\t\t</p>\n\n\t\t<NcNoteCard v-if=\"notice && !store.inRunView\" type=\"info\" class=\"cn-flow-board__notice\">\n\t\t\t{{ notice }}\n\t\t</NcNoteCard>\n\n\t\t<div class=\"cn-flow-board__body\">\n\t\t\t<aside v-if=\"showPalette\" class=\"cn-flow-board__card cn-flow-board__palette\" data-testid=\"flow-board-palette\">\n\t\t\t\t<h3 class=\"cn-flow-board__card-title\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Steps') }}\n\t\t\t\t</h3>\n\t\t\t\t<section v-for=\"group in paletteGroups\"\n\t\t\t\t\t:key=\"group.app\"\n\t\t\t\t\tclass=\"cn-flow-board__palette-group\">\n\t\t\t\t\t<h4 class=\"cn-flow-board__palette-app\">\n\t\t\t\t\t\t{{ group.app }}\n\t\t\t\t\t</h4>\n\t\t\t\t\t<ul class=\"cn-flow-board__palette-list\">\n\t\t\t\t\t\t<li v-for=\"entry in group.entries\" :key=\"entry.id\">\n\t\t\t\t\t\t\t<button type=\"button\"\n\t\t\t\t\t\t\t\tclass=\"cn-flow-board__palette-step\"\n\t\t\t\t\t\t\t\t:disabled=\"store.graphLocked\"\n\t\t\t\t\t\t\t\t:data-testid=\"`flow-board-palette-${entry.id}`\"\n\t\t\t\t\t\t\t\t@click=\"store.addNode(entry.id)\">\n\t\t\t\t\t\t\t\t{{ entry.displayName || entry.label || entry.id }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<p v-if=\"paletteFootnote\" class=\"cn-flow-board__palette-note\">\n\t\t\t\t\t{{ paletteFootnote }}\n\t\t\t\t</p>\n\t\t\t</aside>\n\n\t\t\t<section class=\"cn-flow-board__card cn-flow-board__canvas\" :aria-label=\"t('nextcloud-vue', 'Flow canvas')\">\n\t\t\t\t<CnFlowDetail :id=\"id\"\n\t\t\t\t\t:app=\"app\"\n\t\t\t\t\t:run=\"run\"\n\t\t\t\t\t:toolbarActions=\"false\"\n\t\t\t\t\t:addStep=\"!showPalette\"\n\t\t\t\t\t@save=\"$emit('save')\"\n\t\t\t\t\t@run=\"$emit('run')\" />\n\t\t\t\t<div v-if=\"store.inRunView\"\n\t\t\t\t\tclass=\"cn-flow-board__legend\"\n\t\t\t\t\tdata-testid=\"flow-board-legend\">\n\t\t\t\t\t<span v-for=\"level in legend\" :key=\"level.id\" class=\"cn-flow-board__legend-item\">\n\t\t\t\t\t\t<CnStatusBadge :label=\"level.label\" :variant=\"level.variant\" size=\"small\" />\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<p v-else\n\t\t\t\t\tclass=\"cn-flow-board__validity\"\n\t\t\t\t\t:class=\"`cn-flow-board__validity--${validity.tone}`\"\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\tdata-testid=\"flow-board-validity\">\n\t\t\t\t\t{{ validity.text }}\n\t\t\t\t</p>\n\t\t\t</section>\n\n\t\t\t<aside class=\"cn-flow-board__card cn-flow-board__inspector\" data-testid=\"flow-board-inspector\">\n\t\t\t\t<template v-if=\"store.inRunView\">\n\t\t\t\t\t<CnFlowRunSummary :run=\"runRecord\"\n\t\t\t\t\t\t:stepsTotal=\"store.nodes.length\"\n\t\t\t\t\t\t:canRetry=\"canRetry\"\n\t\t\t\t\t\t@back=\"onBackToFlow\"\n\t\t\t\t\t\t@retry=\"onRetry\" />\n\t\t\t\t\t<div class=\"cn-flow-board__tabs\" role=\"tablist\">\n\t\t\t\t\t\t<button v-for=\"tab in runTabs\"\n\t\t\t\t\t\t\t:key=\"tab.id\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\tclass=\"cn-flow-board__tab\"\n\t\t\t\t\t\t\t:class=\"{ 'cn-flow-board__tab--active': runTab === tab.id }\"\n\t\t\t\t\t\t\t:aria-selected=\"runTab === tab.id ? 'true' : 'false'\"\n\t\t\t\t\t\t\t:data-testid=\"`flow-board-run-tab-${tab.id}`\"\n\t\t\t\t\t\t\t@click=\"runTab = tab.id\">\n\t\t\t\t\t\t\t{{ tab.label }}\n\t\t\t\t\t\t\t<span class=\"cn-flow-board__tab-count\">{{ tab.count }}</span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<CnFlowStepLog :lines=\"runTab === 'step' ? selectedRunLines : allRunLines\"\n\t\t\t\t\t\t:emptyText=\"runTab === 'step' && !store.selectedNodeId ? t('nextcloud-vue', 'Select a step on the canvas to see what it did.') : ''\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-else-if=\"store.selectedNode\">\n\t\t\t\t\t<p class=\"cn-flow-board__eyebrow\">\n\t\t\t\t\t\t{{ stepTypeLabel }}\n\t\t\t\t\t</p>\n\t\t\t\t\t<h3 class=\"cn-flow-board__card-title\" data-testid=\"flow-board-step-name\">\n\t\t\t\t\t\t{{ stepName }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<div class=\"cn-flow-board__step-actions\">\n\t\t\t\t\t\t<NcButton data-testid=\"flow-board-edit-step\" @click=\"store.editingNodeId = store.selectedNodeId\">\n\t\t\t\t\t\t\t{{ t('nextcloud-vue', 'Edit step') }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t<NcButton v-if=\"lastRunUuid\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tdata-testid=\"flow-board-open-last-run\"\n\t\t\t\t\t\t\t@click=\"openRun(lastRunUuid)\">\n\t\t\t\t\t\t\t{{ t('nextcloud-vue', 'Open the last run on the canvas') }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t\t<h4 class=\"cn-flow-board__subtitle\">\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Recent log lines of this step') }}\n\t\t\t\t\t</h4>\n\t\t\t\t\t<CnFlowStepLog :lines=\"recentStepLines\"\n\t\t\t\t\t\twithDay\n\t\t\t\t\t\t:emptyText=\"t('nextcloud-vue', 'This step has not run yet.')\" />\n\t\t\t\t\t<div class=\"cn-flow-board__step-footer\">\n\t\t\t\t\t\t<NcButton variant=\"tertiary\"\n\t\t\t\t\t\t\t:disabled=\"store.graphLocked\"\n\t\t\t\t\t\t\tdata-testid=\"flow-board-delete-step\"\n\t\t\t\t\t\t\t@click=\"store.removeNode(store.selectedNodeId)\">\n\t\t\t\t\t\t\t{{ t('nextcloud-vue', 'Delete step') }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t<NcButton data-testid=\"flow-board-done\" @click=\"store.selectedNodeId = null\">\n\t\t\t\t\t\t\t{{ t('nextcloud-vue', 'Done') }}\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t</template>\n\t\t\t\t<CnFlowSidebar v-else embedded />\n\t\t\t</aside>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcCheckboxRadioSwitch, NcNoteCard } from '@nextcloud/vue'\nimport TestTube from 'vue-material-design-icons/TestTube.vue'\nimport CnBuildiqEditButton from '../CnBuildiqEditButton/CnBuildiqEditButton.vue'\nimport CnDialog from '../CnDialog/CnDialog.vue'\nimport CnFlowDetail from '../CnFlowDetail/CnFlowDetail.vue'\nimport CnFlowRunSummary from '../CnFlowDetail/CnFlowRunSummary.vue'\nimport CnFlowSidebar from '../CnFlowDetail/CnFlowSidebar.vue'\nimport CnFlowStepLog from '../CnFlowDetail/CnFlowStepLog.vue'\nimport CnResourceSelect from '../CnResourceSelect/CnResourceSelect.vue'\nimport { FLOW_RUN_ACTIVE_STATUSES, useFlowStore } from '../../composables/useFlowStore.js'\nimport { formatRelativeDate } from '../../utils/boardDate.js'\nimport { flowOutcomeLevels, flowRunDurationMs, flowRunLogLines, flowRunName, formatFlowDuration } from '../../utils/flowRunLog.js'\nimport { CnStatusBadge } from '../CnStatusBadge/index.js'\n\n/**\n * The board-look flow editor and run view. CnFlowEditorPage renders it when\n * the app or page is in the board look; the Nextcloud look keeps the canvas\n * on its own with the app sidebar.\n */\nexport default {\n\tname: 'CnFlowBoard',\n\n\tcomponents: { CnBuildiqEditButton, CnDialog, CnFlowDetail, CnResourceSelect, TestTube, CnFlowRunSummary, CnFlowSidebar, CnFlowStepLog, CnStatusBadge, NcButton, NcCheckboxRadioSwitch, NcNoteCard },\n\n\tprops: {\n\t\t/** The flow uuid, or `new`. */\n\t\tid: { type: String, default: '' },\n\t\t/** The owning app, for a new flow and the list scope. */\n\t\tapp: { type: String, default: null },\n\t\t/** The run to show, or ''. */\n\t\trun: { type: String, default: '' },\n\t\t/** Where the flow list lives; flows open at `<detailRoute>/<id>`. */\n\t\tdetailRoute: { type: String, default: '/flows' },\n\t\t/** The list's name in the path (\"Flows\", \"Settings / Flows\"). */\n\t\tlistLabel: { type: String, default: '' },\n\t\t/** `column` draws the step palette as a card on the left. */\n\t\tpalette: { type: String, default: 'picker' },\n\t\t/** Free text under the path in the palette card. */\n\t\tpaletteFootnote: { type: String, default: '' },\n\t\t/** An info notice under the path. */\n\t\tnotice: { type: String, default: '' },\n\t\t/** The pill beside the title (\"Case type flow\"). */\n\t\tpill: { type: String, default: '' },\n\t\t/**\n\t\t * The records a test run can take as its subject: `{ register, schema,\n\t\t * labelField?, label? }`. Draws a header button (\"Testen met een zaak\",\n\t\t * DqFlow) that runs the saved flow once with a picked record.\n\t\t */\n\t\ttestSubject: { type: Object, default: null },\n\t},\n\n\temits: ['save', 'run', 'retried'],\n\n\tsetup() {\n\t\treturn { store: useFlowStore() }\n\t},\n\n\tdata() {\n\t\treturn { runTab: 'step', testOpen: false, testRecord: null }\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} Whether a test subject is declared well enough to pick one. */\n\t\ttestSubjectReady() {\n\t\t\treturn Boolean(this.testSubject && this.testSubject.register && this.testSubject.schema)\n\t\t},\n\n\t\t/** @return {string} The test button's label: the page's own, else the library's. */\n\t\ttestLabel() {\n\t\t\treturn (this.testSubject && this.testSubject.label) || t('nextcloud-vue', 'Test with a record')\n\t\t},\n\n\t\t/** @return {boolean} Whether the palette card is drawn. */\n\t\tshowPalette() {\n\t\t\treturn this.palette === 'column' && !this.store.inRunView\n\t\t},\n\n\t\t/** @return {string} The page title. */\n\t\ttitleText() {\n\t\t\treturn this.store.flow.name || this.t('nextcloud-vue', 'New flow')\n\t\t},\n\n\t\t/** @return {string} The flow's name in the path. */\n\t\tflowName() {\n\t\t\treturn this.store.flow.name || this.t('nextcloud-vue', 'New flow')\n\t\t},\n\n\t\t/** @return {string} The pill text: the page's, else the lifecycle. */\n\t\tpillText() {\n\t\t\tif (this.pill) {\n\t\t\t\treturn this.pill\n\t\t\t}\n\t\t\tconst lifecycle = String(this.store.flow.lifecycleStatus || '')\n\t\t\tif (lifecycle === 'draft') {\n\t\t\t\treturn this.t('nextcloud-vue', 'Draft')\n\t\t\t}\n\t\t\tif (lifecycle === 'deprecated') {\n\t\t\t\treturn this.t('nextcloud-vue', 'Retired')\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/** @return {string} The list label. */\n\t\tlistText() {\n\t\t\treturn this.listLabel || this.t('nextcloud-vue', 'Flows')\n\t\t},\n\n\t\t/** @return {string} The flow's own path. */\n\t\tflowPath() {\n\t\t\treturn `${this.detailRoute}/${this.store.flow.id || this.id}`\n\t\t},\n\n\t\t/** @return {string} The list href. */\n\t\tlistHref() {\n\t\t\treturn this.hrefOf(this.detailRoute)\n\t\t},\n\n\t\t/** @return {string} The flow href. */\n\t\tflowHref() {\n\t\t\treturn this.hrefOf(this.flowPath)\n\t\t},\n\n\t\t/**\n\t\t * What the path says after the name: the trigger, the step count and\n\t\t * the version in the editor; when the run started and how long it\n\t\t * took in the run view.\n\t\t *\n\t\t * @return {string} The meta text.\n\t\t */\n\t\tmetaText() {\n\t\t\tif (this.store.inRunView) {\n\t\t\t\tconst record = this.runRecord\n\t\t\t\tif (!record) {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst parts = [formatRelativeDate(record.created, { withTime: true })]\n\t\t\t\tconst duration = formatFlowDuration(flowRunDurationMs(record))\n\t\t\t\tif (duration) {\n\t\t\t\t\tparts.push(this.t('nextcloud-vue', 'done in {duration}', { duration }))\n\t\t\t\t}\n\t\t\t\treturn parts.filter(Boolean).join(' · ')\n\t\t\t}\n\t\t\tconst parts = []\n\t\t\tconst trigger = this.triggerText\n\t\t\tif (trigger) {\n\t\t\t\tparts.push(this.t('nextcloud-vue', 'trigger {trigger}', { trigger }))\n\t\t\t}\n\t\t\tconst count = this.store.nodes.length\n\t\t\tparts.push(count === 1 ? this.t('nextcloud-vue', '1 step') : this.t('nextcloud-vue', '{count} steps', { count }))\n\t\t\tif (this.store.flow.version) {\n\t\t\t\tparts.push(this.t('nextcloud-vue', 'version {version}', { version: this.store.flow.version }))\n\t\t\t}\n\t\t\treturn parts.join(' · ')\n\t\t},\n\n\t\t/** @return {string} How the flow starts, as the catalogue names it. */\n\t\ttriggerText() {\n\t\t\tconst trigger = String(this.store.flow.trigger || '')\n\t\t\tif (trigger === 'schedule') {\n\t\t\t\treturn this.t('nextcloud-vue', 'On a schedule')\n\t\t\t}\n\t\t\tif (trigger === '' || trigger === 'manual') {\n\t\t\t\treturn this.t('nextcloud-vue', 'Run by hand')\n\t\t\t}\n\t\t\tconst entry = (this.store.eventCatalog || []).find((item) => item && item.id === trigger)\n\t\t\treturn (entry && entry.label) || trigger\n\t\t},\n\n\t\t/** @return {boolean} Whether Run is offered. */\n\t\tshowRun() {\n\t\t\treturn this.store.nodes.some((node) => node?.type === 'openregister.trigger-manual')\n\t\t},\n\n\t\t/**\n\t\t * The engine's verdict on the canvas as one line under it.\n\t\t *\n\t\t * @return {{tone: string, text: string}} The validity bar.\n\t\t */\n\t\tvalidity() {\n\t\t\tconst result = this.store.checkResult\n\t\t\tif (!result) {\n\t\t\t\treturn { tone: 'unknown', text: this.t('nextcloud-vue', 'Not checked yet. Check runs the flow past the engine without saving it.') }\n\t\t\t}\n\t\t\tconst blocking = Array.isArray(result.blocking) ? result.blocking.length : 0\n\t\t\tconst warnings = Array.isArray(result.warnings) ? result.warnings.length : 0\n\t\t\tif (result.valid === false || blocking > 0) {\n\t\t\t\treturn { tone: 'error', text: result.message || this.t('nextcloud-vue', 'The flow cannot run as it is. See the messages on the canvas.') }\n\t\t\t}\n\t\t\tif (warnings > 0) {\n\t\t\t\treturn { tone: 'warning', text: this.t('nextcloud-vue', 'The flow is valid, with {count} warnings.', { count: warnings }) }\n\t\t\t}\n\t\t\treturn { tone: 'success', text: this.t('nextcloud-vue', 'The flow is valid.') }\n\t\t},\n\n\t\t/** @return {Array<object>} The palette grouped by owning app. */\n\t\tpaletteGroups() {\n\t\t\tconst groups = {}\n\t\t\t;(this.store.nodeCatalog || []).forEach((entry) => {\n\t\t\t\tconst app = String(entry?.app || String(entry?.id || '').split('.')[0] || '')\n\t\t\t\tif (!groups[app]) {\n\t\t\t\t\tgroups[app] = { app, entries: [] }\n\t\t\t\t}\n\t\t\t\tgroups[app].entries.push(entry)\n\t\t\t})\n\t\t\treturn Object.values(groups)\n\t\t},\n\n\t\t/** @return {object|null} The run on screen. */\n\t\trunRecord() {\n\t\t\treturn this.store.runDetail\n\t\t\t\t|| (this.store.runs || []).find((item) => item.uuid === this.store.inspectedRunUuid)\n\t\t\t\t|| null\n\t\t},\n\n\t\t/** @return {string} The run's place in the path. */\n\t\trunCrumb() {\n\t\t\treturn this.t('nextcloud-vue', 'Run {id}', { id: flowRunName(this.runRecord) })\n\t\t},\n\n\t\t/** @return {boolean} Whether Run again is offered. */\n\t\tcanRetry() {\n\t\t\treturn !!this.runRecord && !FLOW_RUN_ACTIVE_STATUSES.includes(this.runRecord.status)\n\t\t},\n\n\t\t/** @return {Array<object>} Every line of the run on screen. */\n\t\tallRunLines() {\n\t\t\treturn this.runRecord ? flowRunLogLines(this.runRecord) : []\n\t\t},\n\n\t\t/** @return {Array<object>} The selected step's lines in this run. */\n\t\tselectedRunLines() {\n\t\t\treturn this.runRecord && this.store.selectedNodeId\n\t\t\t\t? flowRunLogLines(this.runRecord, this.store.selectedNodeId)\n\t\t\t\t: []\n\t\t},\n\n\t\t/** @return {Array<object>} The two log tabs with their counts. */\n\t\trunTabs() {\n\t\t\treturn [\n\t\t\t\t{ id: 'step', label: this.t('nextcloud-vue', 'This step'), count: this.selectedRunLines.length },\n\t\t\t\t{ id: 'run', label: this.t('nextcloud-vue', 'Logs of the whole run'), count: this.allRunLines.length },\n\t\t\t]\n\t\t},\n\n\t\t/** @return {Array<object>} The legend of outcomes on the canvas. */\n\t\tlegend() {\n\t\t\tconst levels = flowOutcomeLevels()\n\t\t\treturn ['success', 'warning', 'error', 'info', 'skipped'].map((id) => ({ id, ...levels[id] }))\n\t\t},\n\n\t\t/** @return {string} The selected step's type, as the catalogue names it. */\n\t\tstepTypeLabel() {\n\t\t\tconst node = this.store.selectedNode\n\t\t\tconst entry = node ? this.store.catalogEntry(node.type) : null\n\t\t\treturn entry ? (entry.displayName || entry.id) : String(node?.type || '')\n\t\t},\n\n\t\t/** @return {string} The selected step's name. */\n\t\tstepName() {\n\t\t\tconst node = this.store.selectedNode\n\t\t\treturn (node && (node.name || node.label)) || this.stepTypeLabel\n\t\t},\n\n\t\t/**\n\t\t * The selected step's lines from the flow's recent runs, newest run\n\t\t * first, at most ten.\n\t\t *\n\t\t * @return {Array<object>} The lines.\n\t\t */\n\t\trecentStepLines() {\n\t\t\tconst id = this.store.selectedNodeId\n\t\t\tif (!id) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst lines = []\n\t\t\t;(this.store.runs || []).forEach((item) => {\n\t\t\t\tflowRunLogLines(item, id).forEach((line) => lines.push({ ...line, key: `${item.uuid}-${line.key}` }))\n\t\t\t})\n\t\t\treturn lines.slice(0, 10)\n\t\t},\n\n\t\t/** @return {string} The newest run's uuid, or ''. */\n\t\tlastRunUuid() {\n\t\t\treturn (this.store.runs && this.store.runs[0] && this.store.runs[0].uuid) || ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Run the saved flow once with the picked record as its subject, then\n\t\t * close the dialog; the run shows on the canvas as any run does.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync runTest() {\n\t\t\tconst uuid = Array.isArray(this.testRecord) ? this.testRecord[0] : this.testRecord\n\t\t\tif (!uuid) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait this.store.run({ uuid, register: this.testSubject.register, schema: this.testSubject.schema })\n\t\t\tthis.testOpen = false\n\t\t\tthis.testRecord = null\n\t\t},\n\n\t\tt,\n\n\t\t/**\n\t\t * @param {string} path An app route path.\n\t\t * @return {string} Its href.\n\t\t */\n\t\threfOf(path) {\n\t\t\tif (this.$router && typeof this.$router.resolve === 'function') {\n\t\t\t\ttry {\n\t\t\t\t\tconst resolved = this.$router.resolve(path)\n\t\t\t\t\tif (resolved && resolved.href) {\n\t\t\t\t\t\treturn resolved.href\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// A path the router does not know stays a plain path.\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn path\n\t\t},\n\n\t\t/**\n\t\t * Follow a path link on the app's router; a modified click keeps the\n\t\t * browser's own behaviour.\n\t\t *\n\t\t * @param {MouseEvent} event The click.\n\t\t * @param {string} path The target path.\n\t\t * @return {void}\n\t\t */\n\t\tonCrumbClick(event, path) {\n\t\t\tif (!this.$router || event.ctrlKey || event.metaKey || event.shiftKey || event.button === 1) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tevent.preventDefault()\n\t\t\tthis.$router.push(path).catch(() => {})\n\t\t},\n\n\t\t/**\n\t\t * Switch the flow on or off. The change is saved with the flow.\n\t\t *\n\t\t * @param {boolean} on The new state.\n\t\t * @return {void}\n\t\t */\n\t\tonEnabledChange(on) {\n\t\t\tthis.store.flow.enabled = on === true\n\t\t\tthis.store.dirty = true\n\t\t},\n\n\t\t/**\n\t\t * Open a run of this flow on the canvas.\n\t\t *\n\t\t * @param {string} uuid The run.\n\t\t * @return {void}\n\t\t */\n\t\topenRun(uuid) {\n\t\t\tif (this.$router) {\n\t\t\t\tthis.$router.push({ path: this.flowPath, query: { run: uuid } }).catch(() => {})\n\t\t\t} else {\n\t\t\t\tthis.store.inspectRun(uuid)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Leave the run view for the flow.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonBackToFlow() {\n\t\t\tthis.store.closeRun()\n\t\t\tif (this.$router) {\n\t\t\t\tthis.$router.push({ path: this.flowPath }).catch(() => {})\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Start the shown run again and open the new one.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onRetry() {\n\t\t\tconst retried = await this.store.retryRun(this.runRecord?.uuid)\n\t\t\tthis.$emit('retried', retried)\n\t\t\tif (retried && retried.uuid) {\n\t\t\t\tthis.openRun(retried.uuid)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-flow-board {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding: 20px 24px;\n\tmin-height: 100%;\n\tbox-sizing: border-box;\n}\n\n.cn-flow-board__header {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 12px;\n}\n\n.cn-flow-board__heading {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tmin-width: 0;\n}\n\n.cn-flow-board__title {\n\tmargin: 0;\n\tfont-size: 24px;\n\tfont-weight: 600;\n}\n\n.cn-flow-board__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px;\n}\n\n.cn-flow-board__test-intro {\n\tmargin: 0 0 12px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-board__path {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-flow-board__crumb {\n\tcolor: var(--color-main-text);\n\ttext-decoration: underline;\n}\n\n.cn-flow-board__body {\n\tdisplay: grid;\n\tgrid-template-columns: minmax(0, 1fr) 340px;\n\tgap: 16px;\n\tflex: 1 1 auto;\n\tmin-height: 520px;\n}\n\n.cn-flow-board--with-palette .cn-flow-board__body {\n\tgrid-template-columns: 240px minmax(0, 1fr) 340px;\n}\n\n.cn-flow-board__card {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tmin-width: 0;\n\tpadding: 16px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: 12px;\n\tbackground: var(--color-main-background);\n}\n\n.cn-flow-board__canvas {\n\tpadding: 0;\n\toverflow: hidden;\n\tbackground-color: var(--color-background-hover);\n\tbackground-image: radial-gradient(var(--color-border-dark) 1px, transparent 1px);\n\tbackground-size: 16px 16px;\n}\n\n.cn-flow-board__canvas > :first-child {\n\tflex: 1 1 auto;\n\tmin-height: 0;\n}\n\n.cn-flow-board__card-title {\n\tmargin: 0;\n\tfont-size: 16px;\n\tfont-weight: 600;\n}\n\n.cn-flow-board__subtitle {\n\tmargin: 4px 0 0;\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-flow-board__eyebrow {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-flow-board__validity,\n.cn-flow-board__legend {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tmargin: 0;\n\tpadding: 10px 16px;\n\tborder-top: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n}\n\n.cn-flow-board__validity--success {\n\tcolor: var(--color-success-text);\n}\n\n.cn-flow-board__validity--warning {\n\tcolor: var(--color-warning-text);\n}\n\n.cn-flow-board__validity--error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-flow-board__palette-group {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-flow-board__palette-app {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-flow-board__palette-list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-flow-board__palette-step {\n\twidth: 100%;\n\tmin-height: 34px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: 8px;\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\ttext-align: start;\n\tcursor: pointer;\n}\n\n.cn-flow-board__palette-step:hover {\n\tbackground: var(--color-background-hover);\n}\n\n.cn-flow-board__palette-note {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-flow-board__tabs {\n\tdisplay: flex;\n\tgap: 4px;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-flow-board__tab {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 8px 10px;\n\tmargin-bottom: -1px;\n\tborder: 1px solid transparent;\n\tborder-radius: 8px 8px 0 0;\n\tbackground: transparent;\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-flow-board__tab--active {\n\tborder-color: var(--color-border);\n\tborder-bottom-color: var(--color-main-background);\n\tfont-weight: 600;\n}\n\n.cn-flow-board__tab-count {\n\tmin-width: 18px;\n\tpadding: 0 5px;\n\tborder-radius: 9px;\n\tbackground: var(--color-background-dark);\n\tfont-size: 12px;\n\tline-height: 18px;\n\ttext-align: center;\n}\n\n.cn-flow-board__step-actions,\n.cn-flow-board__step-footer {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-flow-board__step-footer {\n\tjustify-content: space-between;\n\tmargin-top: auto;\n}\n\n@media (max-width: 1024px) {\n\t.cn-flow-board__body,\n\t.cn-flow-board--with-palette .cn-flow-board__body {\n\t\tgrid-template-columns: minmax(0, 1fr);\n\t}\n}\n</style>\n"],"names":["CnBuildiqEditButton","CnDialog","CnFlowDetail","CnResourceSelect","CnFlowRunSummary","CnFlowSidebar","CnFlowStepLog","CnStatusBadge","t"],"mappings":";;;;;;;;;;;;;;;AA4OA;AACC;;;;AAID,aAAe;AACd,CAAA,IAAI,EAAE,aAAa;;AAEnB,CAAA,UAAU,EAAE,uBAAEA,UAAmB,YAAEC,YAAQ,gBAAEC,YAAY,oBAAEC,YAAgB,EAAE,QAAQ,oBAAEC,YAAgB,iBAAEC,YAAa,iBAAEC,YAAa,iBAAEC,YAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,YAAY;;AAEnM,CAAA,KAAK,EAAE;;EAEN,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAC,EAAG;AACjC;AACA,EAAA,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAG,EAAG;;EAEpC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAC,EAAG;;AAElC,EAAA,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;;AAEhD,EAAA,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI;;AAExC,EAAA,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;AAC5C;AACA,EAAA,eAAe,EAAE,EAAE,IAAI,EAAE,MAAM,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