@conduction/nextcloud-vue 2.115.0 → 2.116.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 (117) hide show
  1. package/dist/esm/components/CnActionButtons/CnActionButtons.vue.js +1 -1
  2. package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js +92 -0
  3. package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js +2 -2
  5. package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js.map +1 -1
  6. package/dist/esm/components/CnChecklistWidget/CnChecklistWidget.vue.js +9 -0
  7. package/dist/esm/components/CnChecklistWidget/CnChecklistWidget.vue.js.map +1 -0
  8. package/dist/esm/components/CnChecklistWidget/CnChecklistWidget.vue2.js +145 -0
  9. package/dist/esm/components/CnChecklistWidget/CnChecklistWidget.vue2.js.map +1 -0
  10. package/dist/esm/components/CnChecklistWidget/CnChecklistWidget.vue3.js +58 -0
  11. package/dist/esm/components/CnChecklistWidget/CnChecklistWidget.vue3.js.map +1 -0
  12. package/dist/esm/components/CnChecklistWidget/index.js +28 -0
  13. package/dist/esm/components/CnChecklistWidget/index.js.map +1 -0
  14. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  15. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +25 -0
  16. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  17. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +1 -1
  18. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  19. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +376 -51
  20. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  21. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +364 -285
  22. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  23. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  24. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +11 -0
  25. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  26. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js +6 -4
  27. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  28. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue.js +1 -1
  29. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue2.js +48 -1
  30. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue2.js.map +1 -1
  31. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue3.js +11 -2
  32. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue3.js.map +1 -1
  33. package/dist/esm/components/CnMacrosWidget/CnMacrosWidget.vue.js +1 -1
  34. package/dist/esm/components/CnMacrosWidget/CnMacrosWidget.vue2.js +11 -3
  35. package/dist/esm/components/CnMacrosWidget/CnMacrosWidget.vue2.js.map +1 -1
  36. package/dist/esm/components/CnMacrosWidget/CnMacrosWidget.vue3.js +8 -3
  37. package/dist/esm/components/CnMacrosWidget/CnMacrosWidget.vue3.js.map +1 -1
  38. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue.js +1 -1
  39. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +55 -2
  40. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
  41. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
  42. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  43. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +94 -4
  44. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  45. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +248 -239
  46. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  47. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue.js +9 -0
  48. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue.js.map +1 -0
  49. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue2.js +282 -0
  50. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue2.js.map +1 -0
  51. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue3.js +202 -0
  52. package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue3.js.map +1 -0
  53. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
  54. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +10 -5
  55. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
  56. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
  57. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
  58. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
  59. package/dist/esm/composables/indexSources.js +64 -0
  60. package/dist/esm/composables/indexSources.js.map +1 -1
  61. package/dist/esm/composables/useTaskInboxStore.js +85 -0
  62. package/dist/esm/composables/useTaskInboxStore.js.map +1 -1
  63. package/dist/esm/dialogs/CnAccessPurposeDialog.vue.js +9 -0
  64. package/dist/esm/dialogs/CnAccessPurposeDialog.vue.js.map +1 -0
  65. package/dist/esm/dialogs/CnAccessPurposeDialog.vue2.js +107 -0
  66. package/dist/esm/dialogs/CnAccessPurposeDialog.vue2.js.map +1 -0
  67. package/dist/esm/dialogs/CnAccessPurposeDialog.vue3.js +110 -0
  68. package/dist/esm/dialogs/CnAccessPurposeDialog.vue3.js.map +1 -0
  69. package/dist/esm/index.js +1 -0
  70. package/dist/esm/index.js.map +1 -1
  71. package/dist/esm/l10n/en.json.js +19 -1
  72. package/dist/esm/l10n/en.json.js.map +1 -1
  73. package/dist/esm/l10n/nl.json.js +23 -1
  74. package/dist/esm/l10n/nl.json.js.map +1 -1
  75. package/dist/esm/library-style.js +1 -1
  76. package/dist/esm/nextcloud-vue.css +1054 -911
  77. package/dist/esm/utils/actionsDispatcher.js +10 -5
  78. package/dist/esm/utils/actionsDispatcher.js.map +1 -1
  79. package/dist/esm/utils/detailActionModel.js +6 -2
  80. package/dist/esm/utils/detailActionModel.js.map +1 -1
  81. package/dist/esm/utils/libraryWidgetKeys.js +1 -0
  82. package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
  83. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  84. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  85. package/dist/esm/utils/widgetDispatch.js +1 -1
  86. package/dist/esm/utils/widgetDispatch.js.map +1 -1
  87. package/dist/nextcloud-vue.cjs.js +17078 -15224
  88. package/dist/nextcloud-vue.cjs.js.map +2 -2
  89. package/dist/nextcloud-vue.css +1054 -911
  90. package/l10n/en.json +19 -1
  91. package/l10n/nl.json +23 -1
  92. package/package.json +1 -1
  93. package/src/components/CnActionButtons/CnActionButtons.vue +93 -1
  94. package/src/components/CnChecklistWidget/CnChecklistWidget.vue +206 -0
  95. package/src/components/CnChecklistWidget/index.js +27 -0
  96. package/src/components/CnDashboardPage/CnDashboardPage.vue +26 -1
  97. package/src/components/CnDetailPage/CnDetailPage.md +2 -0
  98. package/src/components/CnDetailPage/CnDetailPage.vue +377 -10
  99. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +15 -2
  100. package/src/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue +59 -1
  101. package/src/components/CnMacrosWidget/CnMacrosWidget.vue +16 -6
  102. package/src/components/CnObjectListWidget/CnObjectListWidget.vue +55 -2
  103. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +101 -3
  104. package/src/components/CnRecordListWidget/CnRecordNoteRows.vue +508 -0
  105. package/src/components/CnTabsWidget/CnTabsWidget.vue +10 -5
  106. package/src/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
  107. package/src/components/index.js +1 -0
  108. package/src/composables/indexSources.js +64 -0
  109. package/src/composables/useTaskInboxStore.js +85 -0
  110. package/src/dialogs/CnAccessPurposeDialog.vue +183 -0
  111. package/src/index.js +1 -0
  112. package/src/schemas/app-manifest-v2.schema.json +49 -3
  113. package/src/utils/actionsDispatcher.js +10 -5
  114. package/src/utils/detailActionModel.js +6 -2
  115. package/src/utils/libraryWidgetKeys.js +1 -0
  116. package/src/utils/validateManifestV2.compiled.js +3 -3
  117. package/src/utils/widgetDispatch.js +1 -1
@@ -2,7 +2,7 @@ import script from './CnActionButtons.vue2.js';
2
2
  import { render } from './CnActionButtons.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-0f9733ca";
5
+ script.__scopeId = "data-v-6714bcf7";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -37,6 +37,11 @@ import __sfc_main from '../CnIcon/CnIcon.vue.js';
37
37
  * `excludeFields` / `fieldOverrides` narrow what the button asks for, which
38
38
  * is how one schema serves both a full editor and a quick-create button.
39
39
  * `advanced: true` swaps in the properties/JSON table for a power user.
40
+ * With `endpoint: { url, method?, loadUrl?, responsePath? }` and
41
+ * `formProperties` (JSON-schema properties) it edits a record that is not a
42
+ * register object instead: it reads the record from the endpoint, shows the
43
+ * declared fields filled in, and sends them back with PATCH (or PUT). With
44
+ * `method: "POST"` it creates one: an empty form, posted to the endpoint.
40
45
  * - **`toggle`** — a two-way state button: `GET`s `stateSource` on mount,
41
46
  * renders `labelOn` / `labelOff`, and on click `writes` the flipped
42
47
  * value OPTIMISTICALLY, reverting on failure.
@@ -218,6 +223,8 @@ var script = {
218
223
  formEntry: null,
219
224
  /** The fetched schema object for the open-form dialog (null until loaded). */
220
225
  formSchema: null,
226
+ /** The record an endpoint form edits (null for a create form). */
227
+ formItem: null,
221
228
  /** The run-node action currently in flight / showing its dialog (null = closed). */
222
229
  runNodeEntry: null,
223
230
  /** The target node's declared config-form fields, from the describe GET. */
@@ -783,6 +790,11 @@ var script = {
783
790
  async openForm(entry) {
784
791
  this.formEntry = entry;
785
792
  this.formSchema = null;
793
+ this.formItem = null;
794
+ if (entry.endpoint && typeof entry.endpoint.url === 'string' && entry.endpoint.url !== '') {
795
+ await this.openEndpointForm(entry);
796
+ return
797
+ }
786
798
  const register = entry.register || this.objectCtx.register || '';
787
799
  const schema = entry.schema || '';
788
800
  if (!schema) {
@@ -805,6 +817,81 @@ var script = {
805
817
  }
806
818
  },
807
819
 
820
+ /**
821
+ * Open an `open-form` action with an `endpoint` as an edit form over a
822
+ * record that is not a register object (an OpenRegister organisation):
823
+ * the fields are the action's `formProperties`, the values are read from
824
+ * `endpoint.loadUrl` (else `endpoint.url`) at `endpoint.responsePath`,
825
+ * and the save sends the changed fields to `endpoint.url`. A failed
826
+ * read toasts and opens nothing.
827
+ *
828
+ * @param {object} entry The open-form action with `endpoint` and `formProperties`.
829
+ * @return {Promise<void>}
830
+ * @spec openspec/changes/open-form-endpoint/specs/open-form-endpoint/spec.md#requirement-an-open-form-action-can-edit-a-record-through-an-endpoint
831
+ */
832
+ async openEndpointForm(entry) {
833
+ const properties = entry.formProperties && typeof entry.formProperties === 'object' && !Array.isArray(entry.formProperties) ? entry.formProperties : {};
834
+ if (String(entry.endpoint.method || '').toUpperCase() === 'POST') {
835
+ this.formSchema = { type: 'object', properties };
836
+ return
837
+ }
838
+ const loadUrl = entry.endpoint.loadUrl || entry.endpoint.url;
839
+ const record = await fetchEndpointSource({ url: loadUrl, responsePath: entry.endpoint.responsePath || '' }, this.tokenCtx, { force: true })
840
+ .catch(() => null);
841
+ if (!record || typeof record !== 'object') {
842
+ const { showError } = await import('../../node_modules/@nextcloud/dialogs/dist/index.js');
843
+ if (typeof showError === 'function') {
844
+ showError(translate('nextcloud-vue', 'Could not open the form.'));
845
+ }
846
+ this.formEntry = null;
847
+ return
848
+ }
849
+ this.formItem = record;
850
+ this.formSchema = { type: 'object', properties };
851
+ },
852
+
853
+ /**
854
+ * Save an endpoint form: send the declared fields to `endpoint.url`
855
+ * with `endpoint.method` (`PATCH` by default, or `PUT`), then toast and
856
+ * refresh the page as an object save does.
857
+ *
858
+ * @param {object} entry The open-form action.
859
+ * @param {object} formData The form's values.
860
+ * @return {Promise<void>}
861
+ * @spec openspec/changes/open-form-endpoint/specs/open-form-endpoint/spec.md#requirement-an-open-form-action-can-edit-a-record-through-an-endpoint
862
+ */
863
+ async saveEndpointForm(entry, formData) {
864
+ const dialog = this.$refs.formDialog;
865
+ const keys = Object.keys(this.formSchema?.properties || {});
866
+ const body = Object.fromEntries(keys.filter((key) => key in formData).map((key) => [key, formData[key]]));
867
+ const verb = String(entry.endpoint.method || 'PATCH').toUpperCase();
868
+ const method = verb === 'PUT' ? 'put' : (verb === 'POST' ? 'post' : 'patch');
869
+ try {
870
+ const [{ default: axios }, { generateUrl }] = await Promise.all([
871
+ import('@nextcloud/axios'),
872
+ import('@nextcloud/router'),
873
+ ]);
874
+ const url = interpolateActionTarget(entry.endpoint.url, this.tokenCtx);
875
+ const response = await axios[method](/^https?:\/\//i.test(url) ? url : generateUrl(url), body);
876
+ if (dialog && typeof dialog.setResult === 'function') {
877
+ dialog.setResult({ success: true });
878
+ }
879
+ const { showSuccess } = await import('../../node_modules/@nextcloud/dialogs/dist/index.js');
880
+ if (typeof showSuccess === 'function') {
881
+ showSuccess(this.tr(entry.successMessage) || translate('nextcloud-vue', 'Saved.'));
882
+ }
883
+ const { emit } = await import('@nextcloud/event-bus');
884
+ emit('cn:page:refresh', {});
885
+ this.$emit('created', response && response.data);
886
+ } catch (error) {
887
+ const serverMessage = error && error.response && error.response.data
888
+ && (error.response.data.error || error.response.data.message);
889
+ if (dialog && typeof dialog.setResult === 'function') {
890
+ dialog.setResult({ error: serverMessage || this.tr(entry.errorMessage) || translate('nextcloud-vue', 'Save failed.') });
891
+ }
892
+ }
893
+ },
894
+
808
895
  /**
809
896
  * Open (or skip) the `run-node` config dialog: GET the target node's
810
897
  * describe endpoint (`or-flow-run-node`'s `GET .../{flowId}/{nodeId}/run`),
@@ -915,6 +1002,10 @@ var script = {
915
1002
  */
916
1003
  async onFormConfirm(formData, dynamic = null) {
917
1004
  const entry = this.formEntry;
1005
+ if (entry && entry.endpoint) {
1006
+ await this.saveEndpointForm(entry, formData);
1007
+ return
1008
+ }
918
1009
  const dialog = this.$refs.formDialog;
919
1010
  const register = this.formRegister;
920
1011
  const schema = (entry && entry.schema) || '';
@@ -1057,6 +1148,7 @@ var script = {
1057
1148
  closeForm() {
1058
1149
  this.formEntry = null;
1059
1150
  this.formSchema = null;
1151
+ this.formItem = null;
1060
1152
  },
1061
1153
  },
1062
1154
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CnActionButtons.vue2.js","sources":["../../../../src/components/CnActionButtons/CnActionButtons.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-action-buttons\"\n\t\t:class=\"{ 'cn-action-buttons--menu': display === 'menu' }\"\n\t\tdata-testid=\"cn-action-buttons\">\n\t\t<!-- `display: \"menu\"` keeps every dialog below but renders no buttons of\n\t\t its own: the host draws the entries as NcActionButtons inside an\n\t\t overflow menu instead, driven by the `entries` event. NcActions\n\t\t keeps only NcAction* vnodes out of its default slot, so this\n\t\t component cannot be placed in the menu itself.\n\t\t That mode is enforced in `barActions` / `overflowActions`, which\n\t\t both answer empty for it — so `inline` only means anything while\n\t\t this component is the one drawing. -->\n\t\t<template v-for=\"entry in barActions\">\n\t\t\t<!-- Toggle: a stateful two-way state button (GET on mount, write on\n\t\t\t click, optimistic + revert). Rendered inline, never dispatched. -->\n\t\t\t<NcButton\n\t\t\t\tv-if=\"entry.type === 'toggle'\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"toggleState[entry.id] ? 'primary' : 'secondary'\"\n\t\t\t\t:disabled=\"Boolean(togglePending[entry.id])\"\n\t\t\t\t:data-testid=\"`cn-action-toggle-${entry.id}`\"\n\t\t\t\t:aria-pressed=\"String(Boolean(toggleState[entry.id]))\"\n\t\t\t\t@click=\"onToggleClick(entry)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(toggleState[entry.id] ? (entry.labelOn || entry.label) : (entry.labelOff || entry.label)) }}\n\t\t\t</NcButton>\n\t\t\t<!-- An entry that goes to a URL is a LINK, not a button that calls\n\t\t\t the browser. NcButton renders an anchor when given `href`, so it\n\t\t\t keeps the cluster's styling while the browser supplies the\n\t\t\t pointer, the focus ring, middle-click and \"open in new tab\" —\n\t\t\t none of which a click handler can offer. -->\n\t\t\t<NcButton\n\t\t\t\tv-else-if=\"entry.href\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"entry.variant || 'secondary'\"\n\t\t\t\t:href=\"entry.href\"\n\t\t\t\t:target=\"linkTargetOf(entry)\"\n\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t@click=\"onLinkClick(entry, $event)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(entry.label) }}\n\t\t\t</NcButton>\n\t\t\t<!-- Everything else: a plain action button routed through the shared\n\t\t\t dispatcher (api-call / open-form / navigate / open-modal / refresh),\n\t\t\t confirm-gated first when the action asks for it. -->\n\t\t\t<!-- `variant`, NOT `type`. NcButton carries both: `type` is the\n\t\t\t native button type (default \"button\") and `variant` is the\n\t\t\t styling. Binding the descriptor's variant to `type` set an\n\t\t\t invalid native type and left `variant` at its \"secondary\"\n\t\t\t default, so `variant: \"primary\"` / `\"error\"` had never once\n\t\t\t rendered — silently, since an unknown native type is ignored. -->\n\t\t\t<NcButton\n\t\t\t\tv-else\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"entry.variant || 'secondary'\"\n\t\t\t\t:disabled=\"Boolean(actionPending[entry.id])\"\n\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t@click=\"onActionClick(entry)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(entry.label) }}\n\t\t\t</NcButton>\n\t\t\t<!-- Sub-actions. Its OWN chevron rather than entries folded into the\n\t\t\t overflow below, because NcActions cannot nest — and a grouped\n\t\t\t dropdown is the point of declaring children (a version list\n\t\t\t flattened into the page's one menu grows without bound). The\n\t\t\t parent's own button above still renders alongside this chevron —\n\t\t\t a parent meant only to group children needs a real `handler` (or\n\t\t\t `href`/other type) of its own, or its button dispatches nothing. -->\n\t\t\t<NcActions\n\t\t\t\tv-if=\"hasChildren(entry)\"\n\t\t\t\t:key=\"`${entry.id}-children`\"\n\t\t\t\t:menuName=\"childMenuName(entry)\"\n\t\t\t\t:data-testid=\"`cn-action-children-${entry.id}`\">\n\t\t\t\t<template v-for=\"child in visibleChildren(entry)\">\n\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\tv-if=\"child.href\"\n\t\t\t\t\t\t:key=\"`${child.id}-link`\"\n\t\t\t\t\t\t:href=\"child.href\"\n\t\t\t\t\t\t:target=\"linkTargetOf(child)\"\n\t\t\t\t\t\t:data-testid=\"`cn-action-${child.id}`\"\n\t\t\t\t\t\t@click=\"onLinkClick(child, $event)\">\n\t\t\t\t\t\t<template v-if=\"child.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(child.icon)\" :name=\"child.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t<span v-else :class=\"child.icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ tr(child.label) }}\n\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\t:key=\"child.id\"\n\t\t\t\t\t\t:disabled=\"Boolean(actionPending[child.id])\"\n\t\t\t\t\t\t:data-testid=\"`cn-action-${child.id}`\"\n\t\t\t\t\t\t@click=\"onActionClick(child)\">\n\t\t\t\t\t\t<template v-if=\"child.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(child.icon)\" :name=\"child.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t<span v-else :class=\"child.icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ tr(child.label) }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcActions>\n\t\t</template>\n\n\t\t<!-- Overflow. Only ever rendered when `inline` is set, so a consumer\n\t\t that never asked for a limit keeps every action as a button. -->\n\t\t<NcActions\n\t\t\tv-if=\"overflowActions.length > 0\"\n\t\t\t:menuName=\"overflowMenuName\"\n\t\t\t:forceMenu=\"true\"\n\t\t\tdata-testid=\"cn-action-buttons-overflow\">\n\t\t\t<template v-for=\"entry in overflowActions\">\n\t\t\t\t<NcActionLink\n\t\t\t\t\tv-if=\"entry.href\"\n\t\t\t\t\t:key=\"`${entry.id}-link`\"\n\t\t\t\t\t:href=\"entry.href\"\n\t\t\t\t\t:target=\"linkTargetOf(entry)\"\n\t\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t\t@click=\"onLinkClick(entry, $event)\">\n\t\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(entry.label) }}\n\t\t\t\t</NcActionLink>\n\t\t\t\t<NcActionButton\n\t\t\t\t\tv-else\n\t\t\t\t\t:key=\"entry.id\"\n\t\t\t\t\t:disabled=\"Boolean(actionPending[entry.id])\"\n\t\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t\t@click=\"onActionClick(entry)\">\n\t\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(entry.label) }}\n\t\t\t\t</NcActionButton>\n\t\t\t</template>\n\t\t</NcActions>\n\n\t\t<!-- Confirm gate for a confirm:true action (reuses CnConfirmDialog). -->\n\t\t<CnConfirmDialog\n\t\t\tv-if=\"confirmEntry\"\n\t\t\tref=\"confirmDialog\"\n\t\t\t:dialogTitle=\"tr(confirmEntry.confirmTitle || confirmEntry.label)\"\n\t\t\t:message=\"tr(confirmEntry.confirmMessage) || defaultConfirmMessage\"\n\t\t\t:variant=\"confirmEntry.variant === 'error' ? 'error' : 'primary'\"\n\t\t\t@confirm=\"onConfirmProceed\"\n\t\t\t@close=\"confirmEntry = null\" />\n\n\t\t<!-- Schema-driven create dialog for an open-form action. The plain\n\t\t form is the default: the properties/JSON table is a power-user\n\t\t surface, and a header button that says \"New case\" is aimed at\n\t\t someone filing one, not at someone inspecting the schema. Set\n\t\t `advanced: true` on the action to get the table back. -->\n\t\t<CnFormDialog\n\t\t\tv-if=\"formEntry && formSchema && !formEntry.advanced\"\n\t\t\tref=\"formDialog\"\n\t\t\t:schema=\"formSchema\"\n\t\t\t:item=\"null\"\n\t\t\t:register=\"formRegister\"\n\t\t\t:initialData=\"formInitialValues || {}\"\n\t\t\t:dialogTitle=\"tr(formEntry.formTitle) || ''\"\n\t\t\t:eyebrow=\"tr(formEntry.formEyebrow) || ''\"\n\t\t\t:subtitle=\"tr(formEntry.formSubtitle) || ''\"\n\t\t\t:includeFields=\"formEntry.includeFields || null\"\n\t\t\t:excludeFields=\"formEntry.excludeFields || []\"\n\t\t\t:fieldOverrides=\"formEntry.fieldOverrides || {}\"\n\t\t\t:size=\"formEntry.size || 'normal'\"\n\t\t\t:columns=\"formEntry.columns || 1\"\n\t\t\t@confirm=\"onFormConfirm\"\n\t\t\t@close=\"closeForm\" />\n\t\t<CnAdvancedFormDialog\n\t\t\tv-if=\"formEntry && formSchema && formEntry.advanced\"\n\t\t\tref=\"formDialog\"\n\t\t\t:schema=\"formSchema\"\n\t\t\t:item=\"null\"\n\t\t\t:initialValues=\"formInitialValues\"\n\t\t\t@confirm=\"onFormConfirm\"\n\t\t\t@close=\"closeForm\" />\n\n\t\t<!-- run-node's config dialog (manifest-run-node-action): only mounted\n\t\t when the target node declared at least one field AND that\n\t\t describe call succeeded — an empty/no form runs immediately with\n\t\t no dialog at all (openRunNode below), and a describe FAILURE also\n\t\t skips the dialog (toasts instead) rather than showing an empty,\n\t\t confusing one. -->\n\t\t<CnRunNodeDialog\n\t\t\tv-if=\"runNodeEntry && runNodeFields.length\"\n\t\t\t:title=\"tr(runNodeEntry.formTitle) || tr(runNodeEntry.label)\"\n\t\t\t:fields=\"runNodeFields\"\n\t\t\t:loading=\"Boolean(actionPending[runNodeEntry.id])\"\n\t\t\t:translate=\"effectiveTranslate\"\n\t\t\t@confirm=\"onRunNodeConfirm\"\n\t\t\t@close=\"closeRunNode\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcActionLink, NcActions, NcButton } from '@nextcloud/vue'\nimport { inject } from 'vue'\nimport CnConfirmDialog from '../../dialogs/CnConfirmDialog.vue'\nimport CnRunNodeDialog from '../../dialogs/CnRunNodeDialog.vue'\nimport { fetchEndpointSource } from '../../composables/useEndpointSource.js'\nimport { useObjectStore } from '../../store/useObjectStore.js'\nimport { actionLink, buildOnSuccessRoute, dispatchAction, interpolateActionTarget, isExternalActionTarget, postRunNode, resolveCreateOverrideHandler, resolveObjectOpType } from '../../utils/actionsDispatcher.js'\nimport { resolveObjectTokenContext } from '../../utils/detailObjectContext.js'\nimport { usesArrayValues, valueArrayFor, valueRecordsFor } from '../../utils/dynamicProperties.js'\nimport { followLinkClick } from '../../utils/linkNavigation.js'\nimport { resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\nimport { evaluateVisibleWhen } from '../../utils/visibleWhen.js'\nimport { CnAdvancedFormDialog } from '../CnAdvancedFormDialog/index.js'\nimport { CnFormDialog } from '../CnFormDialog/index.js'\nimport { CnIcon } from '../CnIcon/index.js'\n\n/**\n * CnActionButtons — declarative header-actions surface (#91 Wave 3).\n *\n * Renders a page's `headerActions[]` as buttons and owns the two action\n * behaviours that need STATE or a DIALOG the one-shot `dispatchAction`\n * can't provide on its own:\n *\n * - **`open-form`** — mounts the shared `CnAdvancedFormDialog` for the\n * action's `schema` (fetched through the object store), saves on\n * confirm, toasts, refreshes the page, and optionally navigates to\n * `onSuccessRoute`. Two optional keys cover the schemas a bare create\n * cannot satisfy: `props` seeds fixed field values into the create form\n * (so one schema can back several buttons, each fixing its own\n * discriminator), and `createOverride` names a registry handler that owns\n * the persist instead of `objectStore.saveObject` (for a schema requiring\n * a server-minted field the form cannot supply). `includeFields` /\n * `excludeFields` / `fieldOverrides` narrow what the button asks for, which\n * is how one schema serves both a full editor and a quick-create button.\n * `advanced: true` swaps in the properties/JSON table for a power user.\n * - **`toggle`** — a two-way state button: `GET`s `stateSource` on mount,\n * renders `labelOn` / `labelOff`, and on click `writes` the flipped\n * value OPTIMISTICALLY, reverting on failure.\n * - **`run-node`** (manifest-run-node-action) — GETs the target flow node's\n * describe endpoint (OpenRegister's `or-flow-run-node`); a node with\n * declared fields mounts `CnRunNodeDialog` (its own small field renderer —\n * see that component's docblock for why it is not `CnFlowNodeEditModal`'s),\n * a node with none runs immediately. Either way `postRunNode()`\n * (`actionsDispatcher.js`) makes the actual call, subject-token-resolved\n * exactly like `agent`.\n *\n * Every other type (`api-call`, `navigate`, `open-modal`, `open-page`,\n * `refresh`, `handler`) routes through the shared `dispatchAction` — with\n * a `CnConfirmDialog` gate first when the action sets `confirm: true`\n * (the object-op precedent: the dispatcher runs AFTER confirmation).\n *\n * Each action may carry a `visibleWhen` predicate (the shared banner\n * shape — `{ endpoint | source | field, op, value }`) evaluated against\n * the page / object context; a hidden action simply doesn't render.\n *\n * Placement: CnDashboardPage / CnDetailPage / CnPageRenderer mount this in\n * their header-actions area, passing the page's `headerActions[]`. The\n * object context (`{ objectId, object, register, schema }`) and the page\n * workspace / app-config bags are injected so tokens + local `visibleWhen`\n * resolve against the current record and page state.\n *\n * ```json\n * \"headerActions\": [\n * { \"id\": \"new-lead\", \"label\": \"New lead\", \"type\": \"open-form\",\n * \"register\": \"crm\", \"schema\": \"lead\", \"onSuccessRoute\": \"Leads\", \"variant\": \"primary\" },\n * { \"id\": \"approve\", \"label\": \"Approve\", \"type\": \"api-call\",\n * \"url\": \"/apps/shillinq/api/payment-runs/@objectId/approve\", \"confirm\": true,\n * \"visibleWhen\": { \"field\": \"state\", \"op\": \"eq\", \"value\": \"pending\" } },\n * { \"id\": \"toggle-open\", \"type\": \"toggle\", \"labelOn\": \"Open\", \"labelOff\": \"Closed\",\n * \"stateSource\": { \"url\": \"/apps/pipelinq/api/werkplek/@objectId/state\", \"responsePath\": \"open\" },\n * \"field\": \"open\", \"writeUrl\": \"/apps/pipelinq/api/werkplek/@objectId/state\", \"method\": \"PUT\" }\n * ]\n * ```\n */\nexport default {\n\tname: 'CnActionButtons',\n\n\tcomponents: { NcActions, NcActionButton, NcActionLink, NcButton, CnIcon, CnConfirmDialog, CnFormDialog, CnAdvancedFormDialog, CnRunNodeDialog },\n\n\tinject: {\n\t\t/** Detail-page object context (`{ objectId, object, register, schema }`). */\n\t\tcnObjectContext: { default: null },\n\t\t/** v2 slot-grid detail context holder (CnPageRenderer). */\n\t\tcnDetailObjectContext: { default: null },\n\t\t/** Page-level workspace context bag (reactive). */\n\t\tcnWorkspaceContext: { default: () => ({}) },\n\t\t/** Page-level app config bag (reactive). */\n\t\tcnAppConfig: { default: () => ({}) },\n\t\t/** Pre-bound dispatchAction from CnPageRenderer (router/registry/handlers/openModal wired). */\n\t\tcnDispatchAction: { default: null },\n\t\t/**\n\t\t * Host translate function provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). The\n\t\t * manifest-authored action labels, confirm copy and api-call toasts\n\t\t * are run through it. Defaults to an identity function so an\n\t\t * untranslated key renders as itself.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** v2 component registry, for resolving an `open-form` createOverride. */\n\t\tcnRegistry: { default: () => ({}) },\n\t\t/** Legacy customComponents map, same resolution fallback. */\n\t\tcnCustomComponents: { default: () => ({}) },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The page's declarative header actions. Each entry is a typed action\n\t\t * (`open-form` | `toggle` | `api-call` | `navigate` | `open-modal` |\n\t\t * `refresh` | `handler`) plus `id` / `label` and an optional\n\t\t * `visibleWhen` predicate, `icon`, `variant`, and `confirm`.\n\t\t *\n\t\t * An entry carrying `href` (with optional `target`) renders as a real\n\t\t * link instead — an anchor in the bar, an NcActionLink in a menu — and\n\t\t * is never dispatched. Use it for anything that ends in a URL, so the\n\t\t * browser keeps middle-click, \"open in new tab\" and the link semantics\n\t\t * assistive tech announces.\n\t\t *\n\t\t * `href` is used as given, so it must be a finished URL. A manifest\n\t\t * `headerActions[]` entry may carry `href` too: the page (CnDetailPage,\n\t\t * CnDashboardPage) resolves an instance path through `generateUrl()`\n\t\t * and sets `target` before the entry reaches this component.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tactions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * How many collapsible actions stay as buttons; the rest fall into a\n\t\t * single `···` overflow menu.\n\t\t *\n\t\t * `0` (the default) renders EVERY action as a button, which is what\n\t\t * every existing consumer already gets — the overflow only ever\n\t\t * appears once a host asks for a limit.\n\t\t *\n\t\t * A `variant: \"primary\"` action, an action carrying `children`, and a\n\t\t * `toggle` are never collapsed and never consume one of the N slots:\n\t\t * NcActions paints all of its inline actions with one shared variant\n\t\t * (so a lone primary among them is not expressible), it cannot nest\n\t\t * another NcActions, and a toggle's state lives in its button.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tinline: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * Name for the overflow menu. Empty falls back to a translated\n\t\t * \"Actions\".\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\toverflowLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Explicit Vue Router instance for `navigate` / `open-page` /\n\t\t * `onSuccessRoute`. Falls back to `this.$router`. Only needed for\n\t\t * standalone mounts outside a router tree.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\trouter: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Where the actions are drawn. `buttons` (the default) puts one\n\t\t * NcButton per action in the host's header. `menu` draws none and\n\t\t * emits `entries` instead, so the host can render them inside an\n\t\t * overflow menu while this component keeps owning the dialogs.\n\t\t *\n\t\t * @type {'buttons'|'menu'}\n\t\t */\n\t\tdisplay: {\n\t\t\ttype: String,\n\t\t\tdefault: 'buttons',\n\t\t\tvalidator: (v) => ['buttons', 'menu'].includes(v),\n\t\t},\n\t},\n\n\temits: ['created', 'entries'],\n\n\tsetup() {\n\t\t// Read the two detail-surface injects once so the object token context\n\t\t// resolves identically to the endpoint-bound widgets (Wave 3).\n\t\tconst objectCtxRaw = inject('cnObjectContext', null)\n\t\tconst detailCtxRaw = inject('cnDetailObjectContext', null)\n\t\tconst workspaceRaw = inject('cnWorkspaceContext', null)\n\t\tconst appConfigRaw = inject('cnAppConfig', null)\n\t\treturn { objectCtxRaw, detailCtxRaw, workspaceRaw, appConfigRaw }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Evaluated visibleWhen outcome per action id (true when no predicate). */\n\t\t\tvisibility: {},\n\t\t\t/** Current boolean state per toggle action id. */\n\t\t\ttoggleState: {},\n\t\t\t/** In-flight flag per toggle action id (disables the button). */\n\t\t\ttogglePending: {},\n\t\t\t/** In-flight flag per non-toggle action id. */\n\t\t\tactionPending: {},\n\t\t\t/** The action awaiting confirmation (null = no dialog). */\n\t\t\tconfirmEntry: null,\n\t\t\t/** The open-form action currently showing its dialog (null = closed). */\n\t\t\tformEntry: null,\n\t\t\t/** The fetched schema object for the open-form dialog (null until loaded). */\n\t\t\tformSchema: null,\n\t\t\t/** The run-node action currently in flight / showing its dialog (null = closed). */\n\t\t\trunNodeEntry: null,\n\t\t\t/** The target node's declared config-form fields, from the describe GET. */\n\t\t\trunNodeFields: [],\n\t\t\t/** Default confirm-dialog message. */\n\t\t\tdefaultConfirmMessage: t('nextcloud-vue', 'Are you sure you want to continue?'),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Effective translate function: the injected `cnTranslate` (the host\n\t\t * app's bound `t()`), identity by default.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\teffectiveTranslate() {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t},\n\n\t\t/**\n\t\t * Create-form seed values for the open `open-form` action. An action\n\t\t * declares them as `props`, which is how a single schema backs several\n\t\t * buttons — \"New request\" and \"New complaint\" both open the `ticket`\n\t\t * form, each fixing its own `ticketType`.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tformInitialValues() {\n\t\t\tconst props = this.formEntry && this.formEntry.props\n\t\t\tif (!props || typeof props !== 'object' || Array.isArray(props)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\t// Seed values go through the SAME token grammar as filters, so an\n\t\t\t// action on a detail page can stamp the record it belongs to:\n\t\t\t// `{ \"domainObjectRef\": \"@objectId\" }`. Without this the literal\n\t\t\t// string \"@objectId\" is saved, and a foreign key pointing at nothing\n\t\t\t// is a defect that only shows up in whatever reads it later.\n\t\t\treturn resolveFilterTokens(props, this.tokenCtx)\n\t\t},\n\n\t\t/**\n\t\t * The register the open dialog reads and writes against. The plain\n\t\t * form needs it to resolve `$ref` pickers into real dropdowns; without\n\t\t * one a reference field renders as an empty select and the action is\n\t\t * unusable for exactly the schemas that need it most.\n\t\t *\n\t\t * @return {string} The register slug, '' when none is resolvable.\n\t\t */\n\t\tformRegister() {\n\t\t\treturn (this.formEntry && this.formEntry.register) || this.objectCtx.register || ''\n\t\t},\n\n\t\t/**\n\t\t * The actions whose visibleWhen evaluated true (or carry no predicate).\n\t\t *\n\t\t * A `navigate` action whose target leaves the app is turned into a link\n\t\t * entry here, so it takes the `href` branch above instead of being\n\t\t * dispatched. An absolute URL is not a route: pushing one at the router\n\t\t * matched nothing and landed on the fallback page, carrying the URL's\n\t\t * own query string with it. The action's `target` (the URL) is replaced\n\t\t * by the anchor's `target`, since the two fields share a name and the\n\t\t * URL now lives in `href`. An author's explicit `href` still wins.\n\t\t *\n\t\t * An in-app `navigate` or `open-page` becomes a link too (see\n\t\t * `toLinkEntry`), keeping its own `target` so a fallback dispatch works.\n\t\t */\n\t\tvisibleActions() {\n\t\t\treturn (this.actions || [])\n\t\t\t\t.filter((a) => a && a.id && this.visibility[a.id] !== false)\n\t\t\t\t.map((a) => this.toLinkEntry(a))\n\t\t},\n\n\t\t/**\n\t\t * The actions rendered in the bar itself: every non-collapsible one,\n\t\t * plus the first `inline` collapsible ones. Declaration order is kept,\n\t\t * so promoting an action never reshuffles the row.\n\t\t *\n\t\t * Empty in `display: \"menu\"` — the host draws the entries itself there,\n\t\t * so this component renders no buttons and has nothing to cap.\n\t\t *\n\t\t * @return {Array<object>} Actions to render as buttons / chevrons.\n\t\t */\n\t\tbarActions() {\n\t\t\tif (this.display === 'menu') {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (!(this.inline > 0)) {\n\t\t\t\treturn this.visibleActions\n\t\t\t}\n\t\t\tconst promoted = new Set(this.visibleActions\n\t\t\t\t.filter((a) => this.isCollapsible(a))\n\t\t\t\t.slice(0, this.inline)\n\t\t\t\t.map((a) => a.id))\n\t\t\treturn this.visibleActions.filter((a) => !this.isCollapsible(a) || promoted.has(a.id))\n\t\t},\n\n\t\t/**\n\t\t * The actions that did not fit, for the `···` menu. Always empty while\n\t\t * `inline` is 0, and in `display: \"menu\"` where the host owns the menu.\n\t\t *\n\t\t * @return {Array<object>} Actions to render as menu items.\n\t\t */\n\t\toverflowActions() {\n\t\t\tif (this.display === 'menu' || !(this.inline > 0)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst shown = new Set(this.barActions.map((a) => a.id))\n\t\t\treturn this.visibleActions.filter((a) => !shown.has(a.id))\n\t\t},\n\n\t\t/**\n\t\t * Name for the overflow trigger.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\toverflowMenuName() {\n\t\t\treturn this.tr(this.overflowLabel) || t('nextcloud-vue', 'Actions')\n\t\t},\n\n\t\t/**\n\t\t * The visible actions flattened for a host that draws them as menu\n\t\t * items. Everything the item needs to render is resolved here — the\n\t\t * translated label a toggle currently shows, its pressed state, its\n\t\t * pending flag, and which of the two icon shapes applies — so the host\n\t\t * template stays a plain v-for and needs none of this component's\n\t\t * state. `run()` is pre-bound, the way CnIndexPage pre-binds a header\n\t\t * action's handler for the index bar, so the host dispatches without\n\t\t * reaching back through a ref.\n\t\t *\n\t\t * @return {Array<object>} One menu-ready descriptor per visible action.\n\t\t */\n\t\tmenuEntries() {\n\t\t\treturn this.visibleActions.map((entry) => {\n\t\t\t\tconst isToggle = entry.type === 'toggle'\n\t\t\t\tconst on = Boolean(this.toggleState[entry.id])\n\t\t\t\tconst label = isToggle\n\t\t\t\t\t? (on ? (entry.labelOn || entry.label) : (entry.labelOff || entry.label))\n\t\t\t\t\t: entry.label\n\t\t\t\treturn {\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tlabel: this.tr(label),\n\t\t\t\t\t// An mdi name goes to CnIcon; a legacy `icon-*` class goes\n\t\t\t\t\t// on a bare span. Deciding it here keeps isMdiIconName from\n\t\t\t\t\t// having to be duplicated into every host.\n\t\t\t\t\ticonName: this.isMdiIconName(entry.icon) ? entry.icon : '',\n\t\t\t\t\ticonClass: (entry.icon && !this.isMdiIconName(entry.icon)) ? entry.icon : '',\n\t\t\t\t\tdisabled: Boolean(isToggle ? this.togglePending[entry.id] : this.actionPending[entry.id]),\n\t\t\t\t\t// null, not false: a non-toggle carries no pressed state at\n\t\t\t\t\t// all, and `aria-pressed=\"false\"` would announce every\n\t\t\t\t\t// action as an un-pressed toggle button.\n\t\t\t\t\tpressed: isToggle ? on : null,\n\t\t\t\t\ttestid: isToggle ? `cn-action-toggle-${entry.id}` : `cn-action-${entry.id}`,\n\t\t\t\t\t// A link entry, for a host to render as an anchor rather\n\t\t\t\t\t// than a button with a click handler. Named `linkTarget`\n\t\t\t\t\t// because an action's own `target` is its destination. An in-app\n\t\t\t\t\t// link (`linkTo`) is left to `run()`: a host anchor has no router.\n\t\t\t\t\thref: (!entry.linkTo && entry.href) || '',\n\t\t\t\t\tlinkTarget: (!entry.linkTo && entry.href) ? (entry.target || '_blank') : '',\n\t\t\t\t\trun: () => (isToggle ? this.onToggleClick(entry) : this.onActionClick(entry)),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/** Unwrapped page workspace bag. */\n\t\tworkspaceCtx() {\n\t\t\tconst c = this.workspaceRaw\n\t\t\tconst v = (c && typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t\treturn (v && typeof v === 'object') ? v : {}\n\t\t},\n\n\t\t/** Unwrapped app-config bag. */\n\t\tconfigCtx() {\n\t\t\tconst c = this.appConfigRaw\n\t\t\tconst v = (c && typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t\treturn (v && typeof v === 'object') ? v : {}\n\t\t},\n\n\t\t/** The merged object token context (both detail-surface injects). */\n\t\tobjectCtx() {\n\t\t\treturn resolveObjectTokenContext(this.objectCtxRaw, this.detailCtxRaw) || {}\n\t\t},\n\n\t\t/** The full token context for url/param interpolation + local visibleWhen. */\n\t\ttokenCtx() {\n\t\t\treturn {\n\t\t\t\t...this.objectCtx,\n\t\t\t\tworkspace: this.workspaceCtx,\n\t\t\t\tconfig: this.configCtx,\n\t\t\t}\n\t\t},\n\n\t\t/** The effective router (explicit prop wins, else this.$router). */\n\t\teffectiveRouter() {\n\t\t\treturn this.router || this.$router || null\n\t\t},\n\t},\n\n\twatch: {\n\t\tactions: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.evaluateVisibility()\n\t\t\t\tthis.initToggles()\n\t\t\t},\n\t\t},\n\n\t\t// Re-evaluate local (object-context) visibleWhen when the record loads.\n\t\tobjectCtx: {\n\t\t\tdeep: true,\n\t\t\thandler() { this.evaluateVisibility() },\n\t\t},\n\n\t\t// Push the menu-ready descriptors at a `display: \"menu\"` host. It fires\n\t\t// immediately so the host has the list on first paint, and again on\n\t\t// every change of visibility, toggle state or pending flag — the three\n\t\t// things that would otherwise leave a stale item in an open menu.\n\t\tmenuEntries: {\n\t\t\timmediate: true,\n\t\t\thandler(entries) {\n\t\t\t\tif (this.display === 'menu') {\n\t\t\t\t\t/**\n\t\t\t\t\t * @event entries Emitted in `display: \"menu\"` only, whenever the visible actions, their toggle state or their pending flags change. Payload: one menu-ready descriptor per visible action, each carrying `id`, `label`, `iconName`, `iconClass`, `disabled`, `pressed`, `testid` and a pre-bound `run()`.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('entries', entries)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Heuristic MDI-name check (an `icon-`-prefixed string is a CSS class).\n\t\t *\n\t\t * @param {string} name The icon string.\n\t\t * @return {boolean} True when it should render via CnIcon.\n\t\t */\n\t\tisMdiIconName(name) {\n\t\t\treturn typeof name === 'string' && name !== '' && !name.startsWith('icon-')\n\t\t},\n\n\t\t/**\n\t\t * Evaluate every action's `visibleWhen` against the current context.\n\t\t * Fail-safe (a broken predicate hides its action); actions without a\n\t\t * predicate are always visible.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync evaluateVisibility() {\n\t\t\t// Children are walked too: a sub-action whose predicate was never\n\t\t\t// evaluated would read as visible and render regardless.\n\t\t\tconst flat = []\n\t\t\tfor (const action of this.actions || []) {\n\t\t\t\tif (!action || !action.id) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tflat.push(action)\n\t\t\t\tif (Array.isArray(action.children)) {\n\t\t\t\t\tflat.push(...action.children.filter((c) => c && c.id))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const action of flat) {\n\t\t\t\tif (!action.visibleWhen) {\n\t\t\t\t\tthis.visibility[action.id] = true\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst ok = await evaluateVisibleWhen(action.visibleWhen, this.tokenCtx)\n\t\t\t\tthis.visibility[action.id] = ok\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Seed each toggle action's state from its `stateSource` endpoint\n\t\t * (fetched through the shared endpoint engine so `@objectId` etc.\n\t\t * resolve). No-op for non-toggle actions.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync initToggles() {\n\t\t\tfor (const action of this.actions || []) {\n\t\t\t\tif (!action || action.type !== 'toggle' || !action.id) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tthis.toggleState[action.id] = false\n\t\t\t\tif (!action.stateSource || !action.stateSource.url) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst payload = await fetchEndpointSource(action.stateSource, this.tokenCtx)\n\t\t\t\t\tconst value = action.field ? this.readField(payload, action.field) : payload\n\t\t\t\t\tthis.toggleState[action.id] = Boolean(value)\n\t\t\t\t} catch {\n\t\t\t\t\t// Leave the default (off); a failed state read never breaks the bar.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether an action may be pushed into the overflow menu. See the\n\t\t * `inline` prop for why these three shapes never can be.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {boolean} True when it can collapse.\n\t\t */\n\t\tisCollapsible(entry) {\n\t\t\treturn !this.hasChildren(entry)\n\t\t\t\t&& entry.variant !== 'primary'\n\t\t\t\t&& entry.type !== 'toggle'\n\t\t},\n\n\t\t/**\n\t\t * Whether an action declares sub-actions worth a chevron.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {boolean} True when it has at least one visible child.\n\t\t */\n\t\thasChildren(entry) {\n\t\t\treturn this.visibleChildren(entry).length > 0\n\t\t},\n\n\t\t/**\n\t\t * An action's sub-actions, minus any hidden by `visibleWhen`.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {Array<object>} The renderable children.\n\t\t */\n\t\tvisibleChildren(entry) {\n\t\t\tif (!Array.isArray(entry?.children)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn entry.children\n\t\t\t\t.filter((c) => c && c.id && this.visibility[c.id] !== false)\n\t\t\t\t.map((c) => this.toLinkEntry(c))\n\t\t},\n\n\t\t/**\n\t\t * Give a navigating action the `href` it renders as. An external\n\t\t * `navigate` target becomes the href with a `_blank` anchor target. An\n\t\t * in-app `navigate` / `open-page` gets the router-resolved href plus\n\t\t * `linkTo`, the location a plain click routes to; one with `confirm`,\n\t\t * an `onSelect` function, or an unresolvable route stays a button.\n\t\t *\n\t\t * @param {object} a The action descriptor.\n\t\t * @return {object} The descriptor, possibly with `href` / `linkTo` added.\n\t\t */\n\t\ttoLinkEntry(a) {\n\t\t\tif (a.href || (a.type !== 'navigate' && a.type !== 'open-page')) {\n\t\t\t\treturn a\n\t\t\t}\n\t\t\tlet entry = a\n\t\t\tif (a.type === 'navigate') {\n\t\t\t\t// Interpolated BEFORE the external test and before it becomes an\n\t\t\t\t// href, so the anchor carries the record's id rather than the token.\n\t\t\t\tconst target = interpolateActionTarget(a.target, this.tokenCtx)\n\t\t\t\tif (isExternalActionTarget(target)) {\n\t\t\t\t\treturn { ...a, href: target, target: '_blank' }\n\t\t\t\t}\n\t\t\t\tentry = target === a.target ? a : { ...a, target }\n\t\t\t}\n\t\t\tif (typeof entry.onSelect === 'function') {\n\t\t\t\treturn entry\n\t\t\t}\n\t\t\tconst link = actionLink(entry, { router: this.effectiveRouter })\n\t\t\treturn link ? { ...entry, href: link.href, linkTo: link.to } : entry\n\t\t},\n\n\t\t/**\n\t\t * The anchor `target` of a link entry. An in-app link opens in place;\n\t\t * its own `target` is the destination, not an anchor target.\n\t\t *\n\t\t * @param {object} entry The link entry.\n\t\t * @return {string|undefined} The anchor target.\n\t\t */\n\t\tlinkTargetOf(entry) {\n\t\t\treturn entry.linkTo ? undefined : (entry.target || undefined)\n\t\t},\n\n\t\t/**\n\t\t * Click on a link entry: a plain click on an in-app link routes in\n\t\t * place; a URL or a modified click is left to the browser.\n\t\t *\n\t\t * @param {object} entry The link entry.\n\t\t * @param {MouseEvent} event The click event.\n\t\t * @return {void}\n\t\t */\n\t\tonLinkClick(entry, event) {\n\t\t\tif (entry.linkTo) {\n\t\t\t\tfollowLinkClick(event, entry.linkTo, this.effectiveRouter)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Name for a sub-action chevron. `childrenLabel` when set, else the\n\t\t * parent's own label, so the dropdown is never announced unlabelled.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {string} The menu name.\n\t\t */\n\t\tchildMenuName(entry) {\n\t\t\treturn this.tr(entry.childrenLabel) || this.tr(entry.label) || ''\n\t\t},\n\n\t\t/**\n\t\t * Read a dot-path off a payload (the toggle state field).\n\t\t *\n\t\t * @param {unknown} data The payload.\n\t\t * @param {string} field The dot-path.\n\t\t * @return {unknown} The value at the path.\n\t\t */\n\t\treadField(data, field) {\n\t\t\tif (!field) {\n\t\t\t\treturn data\n\t\t\t}\n\t\t\treturn String(field).split('.').reduce((o, k) => (o === null || o === undefined ? o : o[k]), data)\n\t\t},\n\n\t\t/**\n\t\t * Toggle click: flip the state OPTIMISTICALLY, write it, and revert on\n\t\t * failure. Success/error toast via the api-call dispatch path (which\n\t\t * also refreshes the page unless `refresh: false`).\n\t\t *\n\t\t * @param {object} entry The toggle action.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onToggleClick(entry) {\n\t\t\tif (this.togglePending[entry.id]) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = Boolean(this.toggleState[entry.id])\n\t\t\tconst next = !previous\n\t\t\tthis.toggleState[entry.id] = next\n\t\t\tthis.togglePending[entry.id] = true\n\t\t\tconst writeParams = { ...(entry.params || {}) }\n\t\t\tif (entry.field) {\n\t\t\t\twriteParams[entry.field] = next\n\t\t\t}\n\t\t\tconst result = await this.dispatch({\n\t\t\t\ttype: 'api-call',\n\t\t\t\turl: entry.writeUrl,\n\t\t\t\tmethod: entry.method || 'PUT',\n\t\t\t\tparams: writeParams,\n\t\t\t\tsuccessMessage: entry.successMessage,\n\t\t\t\terrorMessage: entry.errorMessage,\n\t\t\t\trefresh: entry.refresh,\n\t\t\t})\n\t\t\tif (!result || result.ok === false) {\n\t\t\t\t// Revert the optimistic flip.\n\t\t\t\tthis.toggleState[entry.id] = previous\n\t\t\t}\n\t\t\tthis.togglePending[entry.id] = false\n\t\t},\n\n\t\t/**\n\t\t * Non-toggle action click: gate on `confirm` first, else run.\n\t\t *\n\t\t * @param {object} entry The action.\n\t\t * @return {void}\n\t\t */\n\t\tonActionClick(entry) {\n\t\t\tif (entry.confirm === true) {\n\t\t\t\tthis.confirmEntry = entry\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.runAction(entry)\n\t\t},\n\n\t\t/**\n\t\t * The confirm dialog's proceed handler: run the pending action, then\n\t\t * report the outcome back to the dialog's result phase.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onConfirmProceed() {\n\t\t\tconst entry = this.confirmEntry\n\t\t\tif (!entry) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst result = await this.runAction(entry)\n\t\t\tconst dialog = this.$refs.confirmDialog\n\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\tconst ok = result === undefined || (result && result.ok !== false)\n\t\t\t\tdialog.setResult(ok ? { success: true } : { error: t('nextcloud-vue', 'Action failed.') })\n\t\t\t} else {\n\t\t\t\tthis.confirmEntry = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run an action (post-confirmation). `open-form` opens the schema\n\t\t * dialog; everything else dispatches. Returns the dispatch result so\n\t\t * the confirm dialog can report success/failure.\n\t\t *\n\t\t * @param {object} entry The action.\n\t\t * @return {Promise<unknown>} The dispatch result (undefined for open-form).\n\t\t */\n\t\tasync runAction(entry) {\n\t\t\t// A function on the descriptor, for a PARENT COMPONENT composing\n\t\t\t// entries in JS (CnDetailPage folds its own Edit in this way).\n\t\t\t// Manifest JSON cannot carry one, so the declarative path is\n\t\t\t// untouched — and it runs after the confirm gate, like every\n\t\t\t// dispatched type.\n\t\t\tif (typeof entry.onSelect === 'function') {\n\t\t\t\tentry.onSelect(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (entry.type === 'open-form') {\n\t\t\t\tawait this.openForm(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (entry.type === 'run-node') {\n\t\t\t\tawait this.openRunNode(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthis.actionPending[entry.id] = true\n\t\t\tconst result = await this.dispatch(entry)\n\t\t\tthis.actionPending[entry.id] = false\n\t\t\treturn result\n\t\t},\n\n\t\t/**\n\t\t * Resolve a manifest-authored UI string through the host translate\n\t\t * function. A pure pass-through: an empty value, or a catalogue that\n\t\t * lacks the key, returns the input unchanged.\n\t\t *\n\t\t * @param {string} [value] The English source string.\n\t\t * @return {string|undefined} The translated (or source) string.\n\t\t */\n\t\ttr(value) {\n\t\t\treturn value ? this.effectiveTranslate(value) : value\n\t\t},\n\n\t\t/**\n\t\t * Route an action through the shared dispatcher — the pre-bound\n\t\t * `cnDispatchAction` (router/registry/handlers/openModal already\n\t\t * wired) when available, else a direct call with a minimal context.\n\t\t * The token context and the host translate function are always\n\t\t * merged in (the latter localises `api-call` success/error toasts).\n\t\t *\n\t\t * @param {object} action The action to dispatch.\n\t\t * @return {Promise<unknown>} The dispatch result.\n\t\t */\n\t\tdispatch(action) {\n\t\t\tconst extra = { tokenCtx: this.tokenCtx, translate: this.effectiveTranslate }\n\t\t\tif (typeof this.cnDispatchAction === 'function') {\n\t\t\t\treturn this.cnDispatchAction(action, extra)\n\t\t\t}\n\t\t\treturn dispatchAction(action, {\n\t\t\t\trouter: this.effectiveRouter,\n\t\t\t\topenForm: (a) => this.openForm(a),\n\t\t\t\topenRunNode: (a) => this.openRunNode(a),\n\t\t\t\t...extra,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Open the schema-driven create dialog for an `open-form` action:\n\t\t * fetch the schema object through the shared object store, then mount\n\t\t * CnAdvancedFormDialog. A failed schema load toasts and no-ops.\n\t\t *\n\t\t * @param {object} entry The open-form action (`register`, `schema`).\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync openForm(entry) {\n\t\t\tthis.formEntry = entry\n\t\t\tthis.formSchema = null\n\t\t\tconst register = entry.register || this.objectCtx.register || ''\n\t\t\tconst schema = entry.schema || ''\n\t\t\tif (!schema) {\n\t\t\t\tthis.formEntry = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst store = useObjectStore()\n\t\t\t\tconst type = resolveObjectOpType(store, { register, schema })\n\t\t\t\tthis.formSchema = await store.fetchSchema(type)\n\t\t\t} catch {\n\t\t\t\tthis.formSchema = null\n\t\t\t}\n\t\t\tif (!this.formSchema) {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(t('nextcloud-vue', 'Could not open the form.'))\n\t\t\t\t}\n\t\t\t\tthis.formEntry = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Open (or skip) the `run-node` config dialog: GET the target node's\n\t\t * describe endpoint (`or-flow-run-node`'s `GET .../{flowId}/{nodeId}/run`),\n\t\t * and either mount `CnRunNodeDialog` with its declared fields, or —\n\t\t * for a node with none — run immediately with an empty config. A\n\t\t * failed describe call toasts and does neither (RN-4: this resolves\n\t\t * as soon as the decision is made, never waiting on the person).\n\t\t *\n\t\t * @param {object} entry The run-node action (`flowId`, `nodeId`, ...).\n\t\t * @return {Promise<void>}\n\t\t *\n\t\t * @spec openspec/changes/manifest-run-node-action/specs/manifest-run-node-action/spec.md#requirement-the-nodes-own-config-form-drives-the-dialog-not-a-new-token\n\t\t */\n\t\tasync openRunNode(entry) {\n\t\t\tconst flowId = entry.flowId\n\t\t\tconst nodeId = entry.nodeId\n\t\t\tif (!flowId || !nodeId) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnActionButtons] run-node requires flowId and nodeId.', entry)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// The try assigns it and the catch returns, so an initialiser here\n\t\t\t// would never be read.\n\t\t\tlet fields\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 url = generateUrl(`/apps/openregister/api/flows/${encodeURIComponent(flowId)}/nodes/${encodeURIComponent(nodeId)}/run`)\n\t\t\t\tconst response = await axios.get(url)\n\t\t\t\tfields = Array.isArray(response.data && response.data.configForm) ? response.data.configForm : []\n\t\t\t} catch (error) {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tconst serverMessage = error && error.response && error.response.data\n\t\t\t\t\t&& (error.response.data.error || error.response.data.message)\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(serverMessage || t('nextcloud-vue', 'Could not open this action.'))\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!fields.length) {\n\t\t\t\t// Empty (or undeclared) form: the \"empty form is itself\n\t\t\t\t// information\" rule flow-node-config-forms already established\n\t\t\t\t// for the editor — run immediately, no dialog.\n\t\t\t\tthis.actionPending[entry.id] = true\n\t\t\t\tawait this.runNodePost(entry, {})\n\t\t\t\tthis.actionPending[entry.id] = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.runNodeFields = fields\n\t\t\tthis.runNodeEntry = entry\n\t\t},\n\n\t\t/**\n\t\t * The run-node dialog's confirm: POST the collected config, close the\n\t\t * dialog either way (success or failure both end the interaction —\n\t\t * a failure already toasted its own message).\n\t\t *\n\t\t * @param {object} config The dialog's collected field values.\n\t\t * @return {Promise<void>}\n\t\t *\n\t\t * @spec openspec/changes/manifest-run-node-action/specs/manifest-run-node-action/spec.md#requirement-a-run-node-action-invokes-one-flow-node-against-the-page-object\n\t\t */\n\t\tasync onRunNodeConfirm(config) {\n\t\t\tconst entry = this.runNodeEntry\n\t\t\tif (!entry) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.actionPending[entry.id] = true\n\t\t\tawait this.runNodePost(entry, config)\n\t\t\tthis.actionPending[entry.id] = false\n\t\t\tthis.closeRunNode()\n\t\t},\n\n\t\t/**\n\t\t * POST the run-node call through the shared dispatcher's `postRunNode`\n\t\t * (subject/register/schema resolution, fail-closed, toast + refresh —\n\t\t * see its own docblock in actionsDispatcher.js).\n\t\t *\n\t\t * @param {object} entry The run-node action.\n\t\t * @param {object} config The node's collected config.\n\t\t * @return {Promise<{ok: boolean}>}\n\t\t */\n\t\trunNodePost(entry, config) {\n\t\t\treturn postRunNode(entry, { tokenCtx: this.tokenCtx, translate: this.effectiveTranslate }, config)\n\t\t},\n\n\t\t/** Close the run-node dialog without running anything. */\n\t\tcloseRunNode() {\n\t\t\tthis.runNodeEntry = null\n\t\t\tthis.runNodeFields = []\n\t\t},\n\n\t\t/**\n\t\t * The create dialog's confirm: save the new object through the shared\n\t\t * object store, report the result phase, toast, refresh the page, and\n\t\t * navigate to `onSuccessRoute` when set — merging the saved object's id\n\t\t * into the route params (via `buildOnSuccessRoute`) so the navigation\n\t\t * can deep-link to the created object's detail page.\n\t\t *\n\t\t * @param {object} formData The dialog's form payload.\n\t\t * @param {object|null} [dynamic] The answers to the schema's data-driven questions (`{ answers, declarations }`), when it has any.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onFormConfirm(formData, dynamic = null) {\n\t\t\tconst entry = this.formEntry\n\t\t\tconst dialog = this.$refs.formDialog\n\t\t\tconst register = this.formRegister\n\t\t\tconst schema = (entry && entry.schema) || ''\n\t\t\ttry {\n\t\t\t\tconst store = useObjectStore()\n\t\t\t\tconst type = resolveObjectOpType(store, { register, schema })\n\t\t\t\t// A schema can require a field the form cannot supply — a\n\t\t\t\t// server-minted foreign key, say — in which case a straight\n\t\t\t\t// saveObject 400s. `createOverride` names a registry handler\n\t\t\t\t// that owns the persist instead (the CnIndexPage precedent).\n\t\t\t\tconst override = resolveCreateOverrideHandler(\n\t\t\t\t\tentry && entry.createOverride,\n\t\t\t\t\tthis.cnRegistry,\n\t\t\t\t\tthis.cnCustomComponents,\n\t\t\t\t)\n\t\t\t\tconst payload = { ...formData }\n\t\t\t\t// Array-mode declarations fold their answers into the parent's\n\t\t\t\t// own payload, so the whole record saves in ONE write. The\n\t\t\t\t// child-record mode below cannot do that (the rows need the\n\t\t\t\t// parent's id), which is why it writes afterwards and can leave\n\t\t\t\t// answers behind if that second write fails.\n\t\t\t\tthis.foldArrayAnswers(payload, dynamic)\n\t\t\t\tconst saved = override\n\t\t\t\t\t? await override(payload, { register, schema, type })\n\t\t\t\t\t: await store.saveObject(type, payload)\n\t\t\t\tif (!saved) {\n\t\t\t\t\tthrow new Error('save rejected')\n\t\t\t\t}\n\t\t\t\tawait this.saveDynamicAnswers(store, register, dynamic, saved)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ success: true })\n\t\t\t\t}\n\t\t\t\tconst { showSuccess } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showSuccess === 'function') {\n\t\t\t\t\tshowSuccess((entry && entry.successMessage) || t('nextcloud-vue', 'Saved.'))\n\t\t\t\t}\n\t\t\t\tconst { emit } = await import('@nextcloud/event-bus')\n\t\t\t\temit('cn:page:refresh', {})\n\t\t\t\t/**\n\t\t\t\t * @event created Emitted after an open-form action saves. Payload: the created object.\n\t\t\t\t */\n\t\t\t\tthis.$emit('created', saved)\n\t\t\t\tif (entry && entry.onSuccessRoute && this.effectiveRouter) {\n\t\t\t\t\tconst location = buildOnSuccessRoute(entry.onSuccessRoute, saved)\n\t\t\t\t\tif (location) {\n\t\t\t\t\t\tthis.effectiveRouter.push(location).catch(() => {})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ error: (e && e.message) || t('nextcloud-vue', 'Save failed.') })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write the answers to a schema's data-driven questions, once the\n\t\t * object they belong to exists.\n\t\t *\n\t\t * This runs AFTER the parent save and deliberately does not roll it\n\t\t * back on failure: a case that exists without one of its custom values\n\t\t * is recoverable by editing it, whereas discarding a case the user\n\t\t * believes they filed is not. A failure here surfaces as the dialog's\n\t\t * error so it is never silent.\n\t\t *\n\t\t * @param {object} store The object store.\n\t\t * @param {string} register The register the object was saved in.\n\t\t * @param {object|null} dynamic The `{ answers, declarations }` payload.\n\t\t * @param {object} saved The saved parent object.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync saveDynamicAnswers(store, register, dynamic, saved) {\n\t\t\tif (!dynamic || !Array.isArray(dynamic.answers) || dynamic.answers.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst objectId = saved && (saved.id || saved.uuid)\n\t\t\tif (!objectId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declarations = dynamic.declarations || []\n\t\t\tfor (const { key, config } of declarations) {\n\t\t\t\tconst values = config && config.values\n\t\t\t\tif (!values || !values.schema) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Already written as part of the parent payload.\n\t\t\t\tif (usesArrayValues(config)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// An answer belongs to exactly one declaration. With a single\n\t\t\t\t// declaration every answer carries its key anyway; the filter\n\t\t\t\t// only matters once a schema has two, where writing an answer\n\t\t\t\t// to both value schemas would invent a row nobody entered.\n\t\t\t\tconst mine = declarations.length === 1\n\t\t\t\t\t? dynamic.answers\n\t\t\t\t\t: dynamic.answers.filter((a) => a.declarationKey === key)\n\t\t\t\tconst rows = valueRecordsFor(mine, config, objectId)\n\t\t\t\tif (rows.length === 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst valueRegister = values.register || register\n\t\t\t\tconst type = resolveObjectOpType(store, { register: valueRegister, schema: values.schema })\n\t\t\t\tfor (const row of rows) {\n\t\t\t\t\tawait store.saveObject(type, row)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fold array-mode dynamic answers into the parent payload.\n\t\t *\n\t\t * @param {object} payload The parent object payload, mutated in place.\n\t\t * @param {object|null} dynamic The `{ answers, declarations }` payload.\n\t\t * @return {void}\n\t\t */\n\t\tfoldArrayAnswers(payload, dynamic) {\n\t\t\tif (!dynamic || !Array.isArray(dynamic.answers) || dynamic.answers.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declarations = dynamic.declarations || []\n\t\t\tfor (const { key, config } of declarations) {\n\t\t\t\tif (!usesArrayValues(config)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst mine = declarations.length === 1\n\t\t\t\t\t? dynamic.answers\n\t\t\t\t\t: dynamic.answers.filter((a) => a.declarationKey === key)\n\t\t\t\tconst entries = valueArrayFor(mine, config, dynamic.definitions || [])\n\t\t\t\tif (entries.length) {\n\t\t\t\t\tpayload[config.values.arrayKey] = entries\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close the create dialog.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcloseForm() {\n\t\t\tthis.formEntry = null\n\t\t\tthis.formSchema = null\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-action-buttons {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 8px;\n\tflex-wrap: wrap;\n}\n\n/* In menu mode the only children are dialogs, so the wrapper must not be a\n box: an empty inline-flex child still eats one of the header's flex gaps\n and pushes the Actions menu away from the Edit button beside it. */\n.cn-action-buttons--menu {\n\tdisplay: contents;\n}\n</style>\n"],"names":["CnIcon","CnConfirmDialog","CnFormDialog","CnAdvancedFormDialog","CnRunNodeDialog","t"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsOA;;AAEC;;;AAGA;AACA;;;;;;;AAOA;AACA;;AAEA;;;;;AAKA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;;;;AAIA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAED,aAAe;CACd,IAAI,EAAE,iBAAiB;;AAEvB,CAAA,UAAU,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,UAAEA,UAAM,mBAAEC,YAAe,gBAAEC,YAAY,wBAAEC,YAAoB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AA,IAAI,CAAC,SAAQ,GAAI,KAAG;AACpB,GAAA,IAAI,CAAC,aAAa,KAAG;GACrB;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnActionButtons.vue2.js","sources":["../../../../src/components/CnActionButtons/CnActionButtons.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-action-buttons\"\n\t\t:class=\"{ 'cn-action-buttons--menu': display === 'menu' }\"\n\t\tdata-testid=\"cn-action-buttons\">\n\t\t<!-- `display: \"menu\"` keeps every dialog below but renders no buttons of\n\t\t its own: the host draws the entries as NcActionButtons inside an\n\t\t overflow menu instead, driven by the `entries` event. NcActions\n\t\t keeps only NcAction* vnodes out of its default slot, so this\n\t\t component cannot be placed in the menu itself.\n\t\t That mode is enforced in `barActions` / `overflowActions`, which\n\t\t both answer empty for it — so `inline` only means anything while\n\t\t this component is the one drawing. -->\n\t\t<template v-for=\"entry in barActions\">\n\t\t\t<!-- Toggle: a stateful two-way state button (GET on mount, write on\n\t\t\t click, optimistic + revert). Rendered inline, never dispatched. -->\n\t\t\t<NcButton\n\t\t\t\tv-if=\"entry.type === 'toggle'\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"toggleState[entry.id] ? 'primary' : 'secondary'\"\n\t\t\t\t:disabled=\"Boolean(togglePending[entry.id])\"\n\t\t\t\t:data-testid=\"`cn-action-toggle-${entry.id}`\"\n\t\t\t\t:aria-pressed=\"String(Boolean(toggleState[entry.id]))\"\n\t\t\t\t@click=\"onToggleClick(entry)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(toggleState[entry.id] ? (entry.labelOn || entry.label) : (entry.labelOff || entry.label)) }}\n\t\t\t</NcButton>\n\t\t\t<!-- An entry that goes to a URL is a LINK, not a button that calls\n\t\t\t the browser. NcButton renders an anchor when given `href`, so it\n\t\t\t keeps the cluster's styling while the browser supplies the\n\t\t\t pointer, the focus ring, middle-click and \"open in new tab\" —\n\t\t\t none of which a click handler can offer. -->\n\t\t\t<NcButton\n\t\t\t\tv-else-if=\"entry.href\"\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"entry.variant || 'secondary'\"\n\t\t\t\t:href=\"entry.href\"\n\t\t\t\t:target=\"linkTargetOf(entry)\"\n\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t@click=\"onLinkClick(entry, $event)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(entry.label) }}\n\t\t\t</NcButton>\n\t\t\t<!-- Everything else: a plain action button routed through the shared\n\t\t\t dispatcher (api-call / open-form / navigate / open-modal / refresh),\n\t\t\t confirm-gated first when the action asks for it. -->\n\t\t\t<!-- `variant`, NOT `type`. NcButton carries both: `type` is the\n\t\t\t native button type (default \"button\") and `variant` is the\n\t\t\t styling. Binding the descriptor's variant to `type` set an\n\t\t\t invalid native type and left `variant` at its \"secondary\"\n\t\t\t default, so `variant: \"primary\"` / `\"error\"` had never once\n\t\t\t rendered — silently, since an unknown native type is ignored. -->\n\t\t\t<NcButton\n\t\t\t\tv-else\n\t\t\t\t:key=\"entry.id\"\n\t\t\t\t:variant=\"entry.variant || 'secondary'\"\n\t\t\t\t:disabled=\"Boolean(actionPending[entry.id])\"\n\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t@click=\"onActionClick(entry)\">\n\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t</template>\n\t\t\t\t{{ tr(entry.label) }}\n\t\t\t</NcButton>\n\t\t\t<!-- Sub-actions. Its OWN chevron rather than entries folded into the\n\t\t\t overflow below, because NcActions cannot nest — and a grouped\n\t\t\t dropdown is the point of declaring children (a version list\n\t\t\t flattened into the page's one menu grows without bound). The\n\t\t\t parent's own button above still renders alongside this chevron —\n\t\t\t a parent meant only to group children needs a real `handler` (or\n\t\t\t `href`/other type) of its own, or its button dispatches nothing. -->\n\t\t\t<NcActions\n\t\t\t\tv-if=\"hasChildren(entry)\"\n\t\t\t\t:key=\"`${entry.id}-children`\"\n\t\t\t\t:menuName=\"childMenuName(entry)\"\n\t\t\t\t:data-testid=\"`cn-action-children-${entry.id}`\">\n\t\t\t\t<template v-for=\"child in visibleChildren(entry)\">\n\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\tv-if=\"child.href\"\n\t\t\t\t\t\t:key=\"`${child.id}-link`\"\n\t\t\t\t\t\t:href=\"child.href\"\n\t\t\t\t\t\t:target=\"linkTargetOf(child)\"\n\t\t\t\t\t\t:data-testid=\"`cn-action-${child.id}`\"\n\t\t\t\t\t\t@click=\"onLinkClick(child, $event)\">\n\t\t\t\t\t\t<template v-if=\"child.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(child.icon)\" :name=\"child.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t<span v-else :class=\"child.icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ tr(child.label) }}\n\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\t:key=\"child.id\"\n\t\t\t\t\t\t:disabled=\"Boolean(actionPending[child.id])\"\n\t\t\t\t\t\t:data-testid=\"`cn-action-${child.id}`\"\n\t\t\t\t\t\t@click=\"onActionClick(child)\">\n\t\t\t\t\t\t<template v-if=\"child.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(child.icon)\" :name=\"child.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t<span v-else :class=\"child.icon\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ tr(child.label) }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</template>\n\t\t\t</NcActions>\n\t\t</template>\n\n\t\t<!-- Overflow. Only ever rendered when `inline` is set, so a consumer\n\t\t that never asked for a limit keeps every action as a button. -->\n\t\t<NcActions\n\t\t\tv-if=\"overflowActions.length > 0\"\n\t\t\t:menuName=\"overflowMenuName\"\n\t\t\t:forceMenu=\"true\"\n\t\t\tdata-testid=\"cn-action-buttons-overflow\">\n\t\t\t<template v-for=\"entry in overflowActions\">\n\t\t\t\t<NcActionLink\n\t\t\t\t\tv-if=\"entry.href\"\n\t\t\t\t\t:key=\"`${entry.id}-link`\"\n\t\t\t\t\t:href=\"entry.href\"\n\t\t\t\t\t:target=\"linkTargetOf(entry)\"\n\t\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t\t@click=\"onLinkClick(entry, $event)\">\n\t\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(entry.label) }}\n\t\t\t\t</NcActionLink>\n\t\t\t\t<NcActionButton\n\t\t\t\t\tv-else\n\t\t\t\t\t:key=\"entry.id\"\n\t\t\t\t\t:disabled=\"Boolean(actionPending[entry.id])\"\n\t\t\t\t\t:data-testid=\"`cn-action-${entry.id}`\"\n\t\t\t\t\t@click=\"onActionClick(entry)\">\n\t\t\t\t\t<template v-if=\"entry.icon\" #icon>\n\t\t\t\t\t\t<CnIcon v-if=\"isMdiIconName(entry.icon)\" :name=\"entry.icon\" :size=\"20\" />\n\t\t\t\t\t\t<span v-else :class=\"entry.icon\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(entry.label) }}\n\t\t\t\t</NcActionButton>\n\t\t\t</template>\n\t\t</NcActions>\n\n\t\t<!-- Confirm gate for a confirm:true action (reuses CnConfirmDialog). -->\n\t\t<CnConfirmDialog\n\t\t\tv-if=\"confirmEntry\"\n\t\t\tref=\"confirmDialog\"\n\t\t\t:dialogTitle=\"tr(confirmEntry.confirmTitle || confirmEntry.label)\"\n\t\t\t:message=\"tr(confirmEntry.confirmMessage) || defaultConfirmMessage\"\n\t\t\t:variant=\"confirmEntry.variant === 'error' ? 'error' : 'primary'\"\n\t\t\t@confirm=\"onConfirmProceed\"\n\t\t\t@close=\"confirmEntry = null\" />\n\n\t\t<!-- Schema-driven create dialog for an open-form action. The plain\n\t\t form is the default: the properties/JSON table is a power-user\n\t\t surface, and a header button that says \"New case\" is aimed at\n\t\t someone filing one, not at someone inspecting the schema. Set\n\t\t `advanced: true` on the action to get the table back. -->\n\t\t<CnFormDialog\n\t\t\tv-if=\"formEntry && formSchema && !formEntry.advanced\"\n\t\t\tref=\"formDialog\"\n\t\t\t:schema=\"formSchema\"\n\t\t\t:item=\"formItem\"\n\t\t\t:register=\"formRegister\"\n\t\t\t:initialData=\"formInitialValues || {}\"\n\t\t\t:dialogTitle=\"tr(formEntry.formTitle) || ''\"\n\t\t\t:eyebrow=\"tr(formEntry.formEyebrow) || ''\"\n\t\t\t:subtitle=\"tr(formEntry.formSubtitle) || ''\"\n\t\t\t:includeFields=\"formEntry.includeFields || null\"\n\t\t\t:excludeFields=\"formEntry.excludeFields || []\"\n\t\t\t:fieldOverrides=\"formEntry.fieldOverrides || {}\"\n\t\t\t:size=\"formEntry.size || 'normal'\"\n\t\t\t:columns=\"formEntry.columns || 1\"\n\t\t\t@confirm=\"onFormConfirm\"\n\t\t\t@close=\"closeForm\" />\n\t\t<CnAdvancedFormDialog\n\t\t\tv-if=\"formEntry && formSchema && formEntry.advanced\"\n\t\t\tref=\"formDialog\"\n\t\t\t:schema=\"formSchema\"\n\t\t\t:item=\"null\"\n\t\t\t:initialValues=\"formInitialValues\"\n\t\t\t@confirm=\"onFormConfirm\"\n\t\t\t@close=\"closeForm\" />\n\n\t\t<!-- run-node's config dialog (manifest-run-node-action): only mounted\n\t\t when the target node declared at least one field AND that\n\t\t describe call succeeded — an empty/no form runs immediately with\n\t\t no dialog at all (openRunNode below), and a describe FAILURE also\n\t\t skips the dialog (toasts instead) rather than showing an empty,\n\t\t confusing one. -->\n\t\t<CnRunNodeDialog\n\t\t\tv-if=\"runNodeEntry && runNodeFields.length\"\n\t\t\t:title=\"tr(runNodeEntry.formTitle) || tr(runNodeEntry.label)\"\n\t\t\t:fields=\"runNodeFields\"\n\t\t\t:loading=\"Boolean(actionPending[runNodeEntry.id])\"\n\t\t\t:translate=\"effectiveTranslate\"\n\t\t\t@confirm=\"onRunNodeConfirm\"\n\t\t\t@close=\"closeRunNode\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcActionLink, NcActions, NcButton } from '@nextcloud/vue'\nimport { inject } from 'vue'\nimport CnConfirmDialog from '../../dialogs/CnConfirmDialog.vue'\nimport CnRunNodeDialog from '../../dialogs/CnRunNodeDialog.vue'\nimport { fetchEndpointSource } from '../../composables/useEndpointSource.js'\nimport { useObjectStore } from '../../store/useObjectStore.js'\nimport { actionLink, buildOnSuccessRoute, dispatchAction, interpolateActionTarget, isExternalActionTarget, postRunNode, resolveCreateOverrideHandler, resolveObjectOpType } from '../../utils/actionsDispatcher.js'\nimport { resolveObjectTokenContext } from '../../utils/detailObjectContext.js'\nimport { usesArrayValues, valueArrayFor, valueRecordsFor } from '../../utils/dynamicProperties.js'\nimport { followLinkClick } from '../../utils/linkNavigation.js'\nimport { resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\nimport { evaluateVisibleWhen } from '../../utils/visibleWhen.js'\nimport { CnAdvancedFormDialog } from '../CnAdvancedFormDialog/index.js'\nimport { CnFormDialog } from '../CnFormDialog/index.js'\nimport { CnIcon } from '../CnIcon/index.js'\n\n/**\n * CnActionButtons — declarative header-actions surface (#91 Wave 3).\n *\n * Renders a page's `headerActions[]` as buttons and owns the two action\n * behaviours that need STATE or a DIALOG the one-shot `dispatchAction`\n * can't provide on its own:\n *\n * - **`open-form`** — mounts the shared `CnAdvancedFormDialog` for the\n * action's `schema` (fetched through the object store), saves on\n * confirm, toasts, refreshes the page, and optionally navigates to\n * `onSuccessRoute`. Two optional keys cover the schemas a bare create\n * cannot satisfy: `props` seeds fixed field values into the create form\n * (so one schema can back several buttons, each fixing its own\n * discriminator), and `createOverride` names a registry handler that owns\n * the persist instead of `objectStore.saveObject` (for a schema requiring\n * a server-minted field the form cannot supply). `includeFields` /\n * `excludeFields` / `fieldOverrides` narrow what the button asks for, which\n * is how one schema serves both a full editor and a quick-create button.\n * `advanced: true` swaps in the properties/JSON table for a power user.\n * With `endpoint: { url, method?, loadUrl?, responsePath? }` and\n * `formProperties` (JSON-schema properties) it edits a record that is not a\n * register object instead: it reads the record from the endpoint, shows the\n * declared fields filled in, and sends them back with PATCH (or PUT). With\n * `method: \"POST\"` it creates one: an empty form, posted to the endpoint.\n * - **`toggle`** — a two-way state button: `GET`s `stateSource` on mount,\n * renders `labelOn` / `labelOff`, and on click `writes` the flipped\n * value OPTIMISTICALLY, reverting on failure.\n * - **`run-node`** (manifest-run-node-action) — GETs the target flow node's\n * describe endpoint (OpenRegister's `or-flow-run-node`); a node with\n * declared fields mounts `CnRunNodeDialog` (its own small field renderer —\n * see that component's docblock for why it is not `CnFlowNodeEditModal`'s),\n * a node with none runs immediately. Either way `postRunNode()`\n * (`actionsDispatcher.js`) makes the actual call, subject-token-resolved\n * exactly like `agent`.\n *\n * Every other type (`api-call`, `navigate`, `open-modal`, `open-page`,\n * `refresh`, `handler`) routes through the shared `dispatchAction` — with\n * a `CnConfirmDialog` gate first when the action sets `confirm: true`\n * (the object-op precedent: the dispatcher runs AFTER confirmation).\n *\n * Each action may carry a `visibleWhen` predicate (the shared banner\n * shape — `{ endpoint | source | field, op, value }`) evaluated against\n * the page / object context; a hidden action simply doesn't render.\n *\n * Placement: CnDashboardPage / CnDetailPage / CnPageRenderer mount this in\n * their header-actions area, passing the page's `headerActions[]`. The\n * object context (`{ objectId, object, register, schema }`) and the page\n * workspace / app-config bags are injected so tokens + local `visibleWhen`\n * resolve against the current record and page state.\n *\n * ```json\n * \"headerActions\": [\n * { \"id\": \"new-lead\", \"label\": \"New lead\", \"type\": \"open-form\",\n * \"register\": \"crm\", \"schema\": \"lead\", \"onSuccessRoute\": \"Leads\", \"variant\": \"primary\" },\n * { \"id\": \"approve\", \"label\": \"Approve\", \"type\": \"api-call\",\n * \"url\": \"/apps/shillinq/api/payment-runs/@objectId/approve\", \"confirm\": true,\n * \"visibleWhen\": { \"field\": \"state\", \"op\": \"eq\", \"value\": \"pending\" } },\n * { \"id\": \"toggle-open\", \"type\": \"toggle\", \"labelOn\": \"Open\", \"labelOff\": \"Closed\",\n * \"stateSource\": { \"url\": \"/apps/pipelinq/api/werkplek/@objectId/state\", \"responsePath\": \"open\" },\n * \"field\": \"open\", \"writeUrl\": \"/apps/pipelinq/api/werkplek/@objectId/state\", \"method\": \"PUT\" }\n * ]\n * ```\n */\nexport default {\n\tname: 'CnActionButtons',\n\n\tcomponents: { NcActions, NcActionButton, NcActionLink, NcButton, CnIcon, CnConfirmDialog, CnFormDialog, CnAdvancedFormDialog, CnRunNodeDialog },\n\n\tinject: {\n\t\t/** Detail-page object context (`{ objectId, object, register, schema }`). */\n\t\tcnObjectContext: { default: null },\n\t\t/** v2 slot-grid detail context holder (CnPageRenderer). */\n\t\tcnDetailObjectContext: { default: null },\n\t\t/** Page-level workspace context bag (reactive). */\n\t\tcnWorkspaceContext: { default: () => ({}) },\n\t\t/** Page-level app config bag (reactive). */\n\t\tcnAppConfig: { default: () => ({}) },\n\t\t/** Pre-bound dispatchAction from CnPageRenderer (router/registry/handlers/openModal wired). */\n\t\tcnDispatchAction: { default: null },\n\t\t/**\n\t\t * Host translate function provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). The\n\t\t * manifest-authored action labels, confirm copy and api-call toasts\n\t\t * are run through it. Defaults to an identity function so an\n\t\t * untranslated key renders as itself.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** v2 component registry, for resolving an `open-form` createOverride. */\n\t\tcnRegistry: { default: () => ({}) },\n\t\t/** Legacy customComponents map, same resolution fallback. */\n\t\tcnCustomComponents: { default: () => ({}) },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The page's declarative header actions. Each entry is a typed action\n\t\t * (`open-form` | `toggle` | `api-call` | `navigate` | `open-modal` |\n\t\t * `refresh` | `handler`) plus `id` / `label` and an optional\n\t\t * `visibleWhen` predicate, `icon`, `variant`, and `confirm`.\n\t\t *\n\t\t * An entry carrying `href` (with optional `target`) renders as a real\n\t\t * link instead — an anchor in the bar, an NcActionLink in a menu — and\n\t\t * is never dispatched. Use it for anything that ends in a URL, so the\n\t\t * browser keeps middle-click, \"open in new tab\" and the link semantics\n\t\t * assistive tech announces.\n\t\t *\n\t\t * `href` is used as given, so it must be a finished URL. A manifest\n\t\t * `headerActions[]` entry may carry `href` too: the page (CnDetailPage,\n\t\t * CnDashboardPage) resolves an instance path through `generateUrl()`\n\t\t * and sets `target` before the entry reaches this component.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tactions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * How many collapsible actions stay as buttons; the rest fall into a\n\t\t * single `···` overflow menu.\n\t\t *\n\t\t * `0` (the default) renders EVERY action as a button, which is what\n\t\t * every existing consumer already gets — the overflow only ever\n\t\t * appears once a host asks for a limit.\n\t\t *\n\t\t * A `variant: \"primary\"` action, an action carrying `children`, and a\n\t\t * `toggle` are never collapsed and never consume one of the N slots:\n\t\t * NcActions paints all of its inline actions with one shared variant\n\t\t * (so a lone primary among them is not expressible), it cannot nest\n\t\t * another NcActions, and a toggle's state lives in its button.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tinline: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * Name for the overflow menu. Empty falls back to a translated\n\t\t * \"Actions\".\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\toverflowLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Explicit Vue Router instance for `navigate` / `open-page` /\n\t\t * `onSuccessRoute`. Falls back to `this.$router`. Only needed for\n\t\t * standalone mounts outside a router tree.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\trouter: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Where the actions are drawn. `buttons` (the default) puts one\n\t\t * NcButton per action in the host's header. `menu` draws none and\n\t\t * emits `entries` instead, so the host can render them inside an\n\t\t * overflow menu while this component keeps owning the dialogs.\n\t\t *\n\t\t * @type {'buttons'|'menu'}\n\t\t */\n\t\tdisplay: {\n\t\t\ttype: String,\n\t\t\tdefault: 'buttons',\n\t\t\tvalidator: (v) => ['buttons', 'menu'].includes(v),\n\t\t},\n\t},\n\n\temits: ['created', 'entries'],\n\n\tsetup() {\n\t\t// Read the two detail-surface injects once so the object token context\n\t\t// resolves identically to the endpoint-bound widgets (Wave 3).\n\t\tconst objectCtxRaw = inject('cnObjectContext', null)\n\t\tconst detailCtxRaw = inject('cnDetailObjectContext', null)\n\t\tconst workspaceRaw = inject('cnWorkspaceContext', null)\n\t\tconst appConfigRaw = inject('cnAppConfig', null)\n\t\treturn { objectCtxRaw, detailCtxRaw, workspaceRaw, appConfigRaw }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Evaluated visibleWhen outcome per action id (true when no predicate). */\n\t\t\tvisibility: {},\n\t\t\t/** Current boolean state per toggle action id. */\n\t\t\ttoggleState: {},\n\t\t\t/** In-flight flag per toggle action id (disables the button). */\n\t\t\ttogglePending: {},\n\t\t\t/** In-flight flag per non-toggle action id. */\n\t\t\tactionPending: {},\n\t\t\t/** The action awaiting confirmation (null = no dialog). */\n\t\t\tconfirmEntry: null,\n\t\t\t/** The open-form action currently showing its dialog (null = closed). */\n\t\t\tformEntry: null,\n\t\t\t/** The fetched schema object for the open-form dialog (null until loaded). */\n\t\t\tformSchema: null,\n\t\t\t/** The record an endpoint form edits (null for a create form). */\n\t\t\tformItem: null,\n\t\t\t/** The run-node action currently in flight / showing its dialog (null = closed). */\n\t\t\trunNodeEntry: null,\n\t\t\t/** The target node's declared config-form fields, from the describe GET. */\n\t\t\trunNodeFields: [],\n\t\t\t/** Default confirm-dialog message. */\n\t\t\tdefaultConfirmMessage: t('nextcloud-vue', 'Are you sure you want to continue?'),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Effective translate function: the injected `cnTranslate` (the host\n\t\t * app's bound `t()`), identity by default.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\teffectiveTranslate() {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t},\n\n\t\t/**\n\t\t * Create-form seed values for the open `open-form` action. An action\n\t\t * declares them as `props`, which is how a single schema backs several\n\t\t * buttons — \"New request\" and \"New complaint\" both open the `ticket`\n\t\t * form, each fixing its own `ticketType`.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tformInitialValues() {\n\t\t\tconst props = this.formEntry && this.formEntry.props\n\t\t\tif (!props || typeof props !== 'object' || Array.isArray(props)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\t// Seed values go through the SAME token grammar as filters, so an\n\t\t\t// action on a detail page can stamp the record it belongs to:\n\t\t\t// `{ \"domainObjectRef\": \"@objectId\" }`. Without this the literal\n\t\t\t// string \"@objectId\" is saved, and a foreign key pointing at nothing\n\t\t\t// is a defect that only shows up in whatever reads it later.\n\t\t\treturn resolveFilterTokens(props, this.tokenCtx)\n\t\t},\n\n\t\t/**\n\t\t * The register the open dialog reads and writes against. The plain\n\t\t * form needs it to resolve `$ref` pickers into real dropdowns; without\n\t\t * one a reference field renders as an empty select and the action is\n\t\t * unusable for exactly the schemas that need it most.\n\t\t *\n\t\t * @return {string} The register slug, '' when none is resolvable.\n\t\t */\n\t\tformRegister() {\n\t\t\treturn (this.formEntry && this.formEntry.register) || this.objectCtx.register || ''\n\t\t},\n\n\t\t/**\n\t\t * The actions whose visibleWhen evaluated true (or carry no predicate).\n\t\t *\n\t\t * A `navigate` action whose target leaves the app is turned into a link\n\t\t * entry here, so it takes the `href` branch above instead of being\n\t\t * dispatched. An absolute URL is not a route: pushing one at the router\n\t\t * matched nothing and landed on the fallback page, carrying the URL's\n\t\t * own query string with it. The action's `target` (the URL) is replaced\n\t\t * by the anchor's `target`, since the two fields share a name and the\n\t\t * URL now lives in `href`. An author's explicit `href` still wins.\n\t\t *\n\t\t * An in-app `navigate` or `open-page` becomes a link too (see\n\t\t * `toLinkEntry`), keeping its own `target` so a fallback dispatch works.\n\t\t */\n\t\tvisibleActions() {\n\t\t\treturn (this.actions || [])\n\t\t\t\t.filter((a) => a && a.id && this.visibility[a.id] !== false)\n\t\t\t\t.map((a) => this.toLinkEntry(a))\n\t\t},\n\n\t\t/**\n\t\t * The actions rendered in the bar itself: every non-collapsible one,\n\t\t * plus the first `inline` collapsible ones. Declaration order is kept,\n\t\t * so promoting an action never reshuffles the row.\n\t\t *\n\t\t * Empty in `display: \"menu\"` — the host draws the entries itself there,\n\t\t * so this component renders no buttons and has nothing to cap.\n\t\t *\n\t\t * @return {Array<object>} Actions to render as buttons / chevrons.\n\t\t */\n\t\tbarActions() {\n\t\t\tif (this.display === 'menu') {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (!(this.inline > 0)) {\n\t\t\t\treturn this.visibleActions\n\t\t\t}\n\t\t\tconst promoted = new Set(this.visibleActions\n\t\t\t\t.filter((a) => this.isCollapsible(a))\n\t\t\t\t.slice(0, this.inline)\n\t\t\t\t.map((a) => a.id))\n\t\t\treturn this.visibleActions.filter((a) => !this.isCollapsible(a) || promoted.has(a.id))\n\t\t},\n\n\t\t/**\n\t\t * The actions that did not fit, for the `···` menu. Always empty while\n\t\t * `inline` is 0, and in `display: \"menu\"` where the host owns the menu.\n\t\t *\n\t\t * @return {Array<object>} Actions to render as menu items.\n\t\t */\n\t\toverflowActions() {\n\t\t\tif (this.display === 'menu' || !(this.inline > 0)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst shown = new Set(this.barActions.map((a) => a.id))\n\t\t\treturn this.visibleActions.filter((a) => !shown.has(a.id))\n\t\t},\n\n\t\t/**\n\t\t * Name for the overflow trigger.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\toverflowMenuName() {\n\t\t\treturn this.tr(this.overflowLabel) || t('nextcloud-vue', 'Actions')\n\t\t},\n\n\t\t/**\n\t\t * The visible actions flattened for a host that draws them as menu\n\t\t * items. Everything the item needs to render is resolved here — the\n\t\t * translated label a toggle currently shows, its pressed state, its\n\t\t * pending flag, and which of the two icon shapes applies — so the host\n\t\t * template stays a plain v-for and needs none of this component's\n\t\t * state. `run()` is pre-bound, the way CnIndexPage pre-binds a header\n\t\t * action's handler for the index bar, so the host dispatches without\n\t\t * reaching back through a ref.\n\t\t *\n\t\t * @return {Array<object>} One menu-ready descriptor per visible action.\n\t\t */\n\t\tmenuEntries() {\n\t\t\treturn this.visibleActions.map((entry) => {\n\t\t\t\tconst isToggle = entry.type === 'toggle'\n\t\t\t\tconst on = Boolean(this.toggleState[entry.id])\n\t\t\t\tconst label = isToggle\n\t\t\t\t\t? (on ? (entry.labelOn || entry.label) : (entry.labelOff || entry.label))\n\t\t\t\t\t: entry.label\n\t\t\t\treturn {\n\t\t\t\t\tid: entry.id,\n\t\t\t\t\tlabel: this.tr(label),\n\t\t\t\t\t// An mdi name goes to CnIcon; a legacy `icon-*` class goes\n\t\t\t\t\t// on a bare span. Deciding it here keeps isMdiIconName from\n\t\t\t\t\t// having to be duplicated into every host.\n\t\t\t\t\ticonName: this.isMdiIconName(entry.icon) ? entry.icon : '',\n\t\t\t\t\ticonClass: (entry.icon && !this.isMdiIconName(entry.icon)) ? entry.icon : '',\n\t\t\t\t\tdisabled: Boolean(isToggle ? this.togglePending[entry.id] : this.actionPending[entry.id]),\n\t\t\t\t\t// null, not false: a non-toggle carries no pressed state at\n\t\t\t\t\t// all, and `aria-pressed=\"false\"` would announce every\n\t\t\t\t\t// action as an un-pressed toggle button.\n\t\t\t\t\tpressed: isToggle ? on : null,\n\t\t\t\t\ttestid: isToggle ? `cn-action-toggle-${entry.id}` : `cn-action-${entry.id}`,\n\t\t\t\t\t// A link entry, for a host to render as an anchor rather\n\t\t\t\t\t// than a button with a click handler. Named `linkTarget`\n\t\t\t\t\t// because an action's own `target` is its destination. An in-app\n\t\t\t\t\t// link (`linkTo`) is left to `run()`: a host anchor has no router.\n\t\t\t\t\thref: (!entry.linkTo && entry.href) || '',\n\t\t\t\t\tlinkTarget: (!entry.linkTo && entry.href) ? (entry.target || '_blank') : '',\n\t\t\t\t\trun: () => (isToggle ? this.onToggleClick(entry) : this.onActionClick(entry)),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/** Unwrapped page workspace bag. */\n\t\tworkspaceCtx() {\n\t\t\tconst c = this.workspaceRaw\n\t\t\tconst v = (c && typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t\treturn (v && typeof v === 'object') ? v : {}\n\t\t},\n\n\t\t/** Unwrapped app-config bag. */\n\t\tconfigCtx() {\n\t\t\tconst c = this.appConfigRaw\n\t\t\tconst v = (c && typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t\treturn (v && typeof v === 'object') ? v : {}\n\t\t},\n\n\t\t/** The merged object token context (both detail-surface injects). */\n\t\tobjectCtx() {\n\t\t\treturn resolveObjectTokenContext(this.objectCtxRaw, this.detailCtxRaw) || {}\n\t\t},\n\n\t\t/** The full token context for url/param interpolation + local visibleWhen. */\n\t\ttokenCtx() {\n\t\t\treturn {\n\t\t\t\t...this.objectCtx,\n\t\t\t\tworkspace: this.workspaceCtx,\n\t\t\t\tconfig: this.configCtx,\n\t\t\t}\n\t\t},\n\n\t\t/** The effective router (explicit prop wins, else this.$router). */\n\t\teffectiveRouter() {\n\t\t\treturn this.router || this.$router || null\n\t\t},\n\t},\n\n\twatch: {\n\t\tactions: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.evaluateVisibility()\n\t\t\t\tthis.initToggles()\n\t\t\t},\n\t\t},\n\n\t\t// Re-evaluate local (object-context) visibleWhen when the record loads.\n\t\tobjectCtx: {\n\t\t\tdeep: true,\n\t\t\thandler() { this.evaluateVisibility() },\n\t\t},\n\n\t\t// Push the menu-ready descriptors at a `display: \"menu\"` host. It fires\n\t\t// immediately so the host has the list on first paint, and again on\n\t\t// every change of visibility, toggle state or pending flag — the three\n\t\t// things that would otherwise leave a stale item in an open menu.\n\t\tmenuEntries: {\n\t\t\timmediate: true,\n\t\t\thandler(entries) {\n\t\t\t\tif (this.display === 'menu') {\n\t\t\t\t\t/**\n\t\t\t\t\t * @event entries Emitted in `display: \"menu\"` only, whenever the visible actions, their toggle state or their pending flags change. Payload: one menu-ready descriptor per visible action, each carrying `id`, `label`, `iconName`, `iconClass`, `disabled`, `pressed`, `testid` and a pre-bound `run()`.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('entries', entries)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Heuristic MDI-name check (an `icon-`-prefixed string is a CSS class).\n\t\t *\n\t\t * @param {string} name The icon string.\n\t\t * @return {boolean} True when it should render via CnIcon.\n\t\t */\n\t\tisMdiIconName(name) {\n\t\t\treturn typeof name === 'string' && name !== '' && !name.startsWith('icon-')\n\t\t},\n\n\t\t/**\n\t\t * Evaluate every action's `visibleWhen` against the current context.\n\t\t * Fail-safe (a broken predicate hides its action); actions without a\n\t\t * predicate are always visible.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync evaluateVisibility() {\n\t\t\t// Children are walked too: a sub-action whose predicate was never\n\t\t\t// evaluated would read as visible and render regardless.\n\t\t\tconst flat = []\n\t\t\tfor (const action of this.actions || []) {\n\t\t\t\tif (!action || !action.id) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tflat.push(action)\n\t\t\t\tif (Array.isArray(action.children)) {\n\t\t\t\t\tflat.push(...action.children.filter((c) => c && c.id))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const action of flat) {\n\t\t\t\tif (!action.visibleWhen) {\n\t\t\t\t\tthis.visibility[action.id] = true\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst ok = await evaluateVisibleWhen(action.visibleWhen, this.tokenCtx)\n\t\t\t\tthis.visibility[action.id] = ok\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Seed each toggle action's state from its `stateSource` endpoint\n\t\t * (fetched through the shared endpoint engine so `@objectId` etc.\n\t\t * resolve). No-op for non-toggle actions.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync initToggles() {\n\t\t\tfor (const action of this.actions || []) {\n\t\t\t\tif (!action || action.type !== 'toggle' || !action.id) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tthis.toggleState[action.id] = false\n\t\t\t\tif (!action.stateSource || !action.stateSource.url) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst payload = await fetchEndpointSource(action.stateSource, this.tokenCtx)\n\t\t\t\t\tconst value = action.field ? this.readField(payload, action.field) : payload\n\t\t\t\t\tthis.toggleState[action.id] = Boolean(value)\n\t\t\t\t} catch {\n\t\t\t\t\t// Leave the default (off); a failed state read never breaks the bar.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether an action may be pushed into the overflow menu. See the\n\t\t * `inline` prop for why these three shapes never can be.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {boolean} True when it can collapse.\n\t\t */\n\t\tisCollapsible(entry) {\n\t\t\treturn !this.hasChildren(entry)\n\t\t\t\t&& entry.variant !== 'primary'\n\t\t\t\t&& entry.type !== 'toggle'\n\t\t},\n\n\t\t/**\n\t\t * Whether an action declares sub-actions worth a chevron.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {boolean} True when it has at least one visible child.\n\t\t */\n\t\thasChildren(entry) {\n\t\t\treturn this.visibleChildren(entry).length > 0\n\t\t},\n\n\t\t/**\n\t\t * An action's sub-actions, minus any hidden by `visibleWhen`.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {Array<object>} The renderable children.\n\t\t */\n\t\tvisibleChildren(entry) {\n\t\t\tif (!Array.isArray(entry?.children)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn entry.children\n\t\t\t\t.filter((c) => c && c.id && this.visibility[c.id] !== false)\n\t\t\t\t.map((c) => this.toLinkEntry(c))\n\t\t},\n\n\t\t/**\n\t\t * Give a navigating action the `href` it renders as. An external\n\t\t * `navigate` target becomes the href with a `_blank` anchor target. An\n\t\t * in-app `navigate` / `open-page` gets the router-resolved href plus\n\t\t * `linkTo`, the location a plain click routes to; one with `confirm`,\n\t\t * an `onSelect` function, or an unresolvable route stays a button.\n\t\t *\n\t\t * @param {object} a The action descriptor.\n\t\t * @return {object} The descriptor, possibly with `href` / `linkTo` added.\n\t\t */\n\t\ttoLinkEntry(a) {\n\t\t\tif (a.href || (a.type !== 'navigate' && a.type !== 'open-page')) {\n\t\t\t\treturn a\n\t\t\t}\n\t\t\tlet entry = a\n\t\t\tif (a.type === 'navigate') {\n\t\t\t\t// Interpolated BEFORE the external test and before it becomes an\n\t\t\t\t// href, so the anchor carries the record's id rather than the token.\n\t\t\t\tconst target = interpolateActionTarget(a.target, this.tokenCtx)\n\t\t\t\tif (isExternalActionTarget(target)) {\n\t\t\t\t\treturn { ...a, href: target, target: '_blank' }\n\t\t\t\t}\n\t\t\t\tentry = target === a.target ? a : { ...a, target }\n\t\t\t}\n\t\t\tif (typeof entry.onSelect === 'function') {\n\t\t\t\treturn entry\n\t\t\t}\n\t\t\tconst link = actionLink(entry, { router: this.effectiveRouter })\n\t\t\treturn link ? { ...entry, href: link.href, linkTo: link.to } : entry\n\t\t},\n\n\t\t/**\n\t\t * The anchor `target` of a link entry. An in-app link opens in place;\n\t\t * its own `target` is the destination, not an anchor target.\n\t\t *\n\t\t * @param {object} entry The link entry.\n\t\t * @return {string|undefined} The anchor target.\n\t\t */\n\t\tlinkTargetOf(entry) {\n\t\t\treturn entry.linkTo ? undefined : (entry.target || undefined)\n\t\t},\n\n\t\t/**\n\t\t * Click on a link entry: a plain click on an in-app link routes in\n\t\t * place; a URL or a modified click is left to the browser.\n\t\t *\n\t\t * @param {object} entry The link entry.\n\t\t * @param {MouseEvent} event The click event.\n\t\t * @return {void}\n\t\t */\n\t\tonLinkClick(entry, event) {\n\t\t\tif (entry.linkTo) {\n\t\t\t\tfollowLinkClick(event, entry.linkTo, this.effectiveRouter)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Name for a sub-action chevron. `childrenLabel` when set, else the\n\t\t * parent's own label, so the dropdown is never announced unlabelled.\n\t\t *\n\t\t * @param {object} entry The action descriptor.\n\t\t * @return {string} The menu name.\n\t\t */\n\t\tchildMenuName(entry) {\n\t\t\treturn this.tr(entry.childrenLabel) || this.tr(entry.label) || ''\n\t\t},\n\n\t\t/**\n\t\t * Read a dot-path off a payload (the toggle state field).\n\t\t *\n\t\t * @param {unknown} data The payload.\n\t\t * @param {string} field The dot-path.\n\t\t * @return {unknown} The value at the path.\n\t\t */\n\t\treadField(data, field) {\n\t\t\tif (!field) {\n\t\t\t\treturn data\n\t\t\t}\n\t\t\treturn String(field).split('.').reduce((o, k) => (o === null || o === undefined ? o : o[k]), data)\n\t\t},\n\n\t\t/**\n\t\t * Toggle click: flip the state OPTIMISTICALLY, write it, and revert on\n\t\t * failure. Success/error toast via the api-call dispatch path (which\n\t\t * also refreshes the page unless `refresh: false`).\n\t\t *\n\t\t * @param {object} entry The toggle action.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onToggleClick(entry) {\n\t\t\tif (this.togglePending[entry.id]) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = Boolean(this.toggleState[entry.id])\n\t\t\tconst next = !previous\n\t\t\tthis.toggleState[entry.id] = next\n\t\t\tthis.togglePending[entry.id] = true\n\t\t\tconst writeParams = { ...(entry.params || {}) }\n\t\t\tif (entry.field) {\n\t\t\t\twriteParams[entry.field] = next\n\t\t\t}\n\t\t\tconst result = await this.dispatch({\n\t\t\t\ttype: 'api-call',\n\t\t\t\turl: entry.writeUrl,\n\t\t\t\tmethod: entry.method || 'PUT',\n\t\t\t\tparams: writeParams,\n\t\t\t\tsuccessMessage: entry.successMessage,\n\t\t\t\terrorMessage: entry.errorMessage,\n\t\t\t\trefresh: entry.refresh,\n\t\t\t})\n\t\t\tif (!result || result.ok === false) {\n\t\t\t\t// Revert the optimistic flip.\n\t\t\t\tthis.toggleState[entry.id] = previous\n\t\t\t}\n\t\t\tthis.togglePending[entry.id] = false\n\t\t},\n\n\t\t/**\n\t\t * Non-toggle action click: gate on `confirm` first, else run.\n\t\t *\n\t\t * @param {object} entry The action.\n\t\t * @return {void}\n\t\t */\n\t\tonActionClick(entry) {\n\t\t\tif (entry.confirm === true) {\n\t\t\t\tthis.confirmEntry = entry\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.runAction(entry)\n\t\t},\n\n\t\t/**\n\t\t * The confirm dialog's proceed handler: run the pending action, then\n\t\t * report the outcome back to the dialog's result phase.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onConfirmProceed() {\n\t\t\tconst entry = this.confirmEntry\n\t\t\tif (!entry) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst result = await this.runAction(entry)\n\t\t\tconst dialog = this.$refs.confirmDialog\n\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\tconst ok = result === undefined || (result && result.ok !== false)\n\t\t\t\tdialog.setResult(ok ? { success: true } : { error: t('nextcloud-vue', 'Action failed.') })\n\t\t\t} else {\n\t\t\t\tthis.confirmEntry = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run an action (post-confirmation). `open-form` opens the schema\n\t\t * dialog; everything else dispatches. Returns the dispatch result so\n\t\t * the confirm dialog can report success/failure.\n\t\t *\n\t\t * @param {object} entry The action.\n\t\t * @return {Promise<unknown>} The dispatch result (undefined for open-form).\n\t\t */\n\t\tasync runAction(entry) {\n\t\t\t// A function on the descriptor, for a PARENT COMPONENT composing\n\t\t\t// entries in JS (CnDetailPage folds its own Edit in this way).\n\t\t\t// Manifest JSON cannot carry one, so the declarative path is\n\t\t\t// untouched — and it runs after the confirm gate, like every\n\t\t\t// dispatched type.\n\t\t\tif (typeof entry.onSelect === 'function') {\n\t\t\t\tentry.onSelect(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (entry.type === 'open-form') {\n\t\t\t\tawait this.openForm(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (entry.type === 'run-node') {\n\t\t\t\tawait this.openRunNode(entry)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthis.actionPending[entry.id] = true\n\t\t\tconst result = await this.dispatch(entry)\n\t\t\tthis.actionPending[entry.id] = false\n\t\t\treturn result\n\t\t},\n\n\t\t/**\n\t\t * Resolve a manifest-authored UI string through the host translate\n\t\t * function. A pure pass-through: an empty value, or a catalogue that\n\t\t * lacks the key, returns the input unchanged.\n\t\t *\n\t\t * @param {string} [value] The English source string.\n\t\t * @return {string|undefined} The translated (or source) string.\n\t\t */\n\t\ttr(value) {\n\t\t\treturn value ? this.effectiveTranslate(value) : value\n\t\t},\n\n\t\t/**\n\t\t * Route an action through the shared dispatcher — the pre-bound\n\t\t * `cnDispatchAction` (router/registry/handlers/openModal already\n\t\t * wired) when available, else a direct call with a minimal context.\n\t\t * The token context and the host translate function are always\n\t\t * merged in (the latter localises `api-call` success/error toasts).\n\t\t *\n\t\t * @param {object} action The action to dispatch.\n\t\t * @return {Promise<unknown>} The dispatch result.\n\t\t */\n\t\tdispatch(action) {\n\t\t\tconst extra = { tokenCtx: this.tokenCtx, translate: this.effectiveTranslate }\n\t\t\tif (typeof this.cnDispatchAction === 'function') {\n\t\t\t\treturn this.cnDispatchAction(action, extra)\n\t\t\t}\n\t\t\treturn dispatchAction(action, {\n\t\t\t\trouter: this.effectiveRouter,\n\t\t\t\topenForm: (a) => this.openForm(a),\n\t\t\t\topenRunNode: (a) => this.openRunNode(a),\n\t\t\t\t...extra,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Open the schema-driven create dialog for an `open-form` action:\n\t\t * fetch the schema object through the shared object store, then mount\n\t\t * CnAdvancedFormDialog. A failed schema load toasts and no-ops.\n\t\t *\n\t\t * @param {object} entry The open-form action (`register`, `schema`).\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync openForm(entry) {\n\t\t\tthis.formEntry = entry\n\t\t\tthis.formSchema = null\n\t\t\tthis.formItem = null\n\t\t\tif (entry.endpoint && typeof entry.endpoint.url === 'string' && entry.endpoint.url !== '') {\n\t\t\t\tawait this.openEndpointForm(entry)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst register = entry.register || this.objectCtx.register || ''\n\t\t\tconst schema = entry.schema || ''\n\t\t\tif (!schema) {\n\t\t\t\tthis.formEntry = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst store = useObjectStore()\n\t\t\t\tconst type = resolveObjectOpType(store, { register, schema })\n\t\t\t\tthis.formSchema = await store.fetchSchema(type)\n\t\t\t} catch {\n\t\t\t\tthis.formSchema = null\n\t\t\t}\n\t\t\tif (!this.formSchema) {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(t('nextcloud-vue', 'Could not open the form.'))\n\t\t\t\t}\n\t\t\t\tthis.formEntry = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Open an `open-form` action with an `endpoint` as an edit form over a\n\t\t * record that is not a register object (an OpenRegister organisation):\n\t\t * the fields are the action's `formProperties`, the values are read from\n\t\t * `endpoint.loadUrl` (else `endpoint.url`) at `endpoint.responsePath`,\n\t\t * and the save sends the changed fields to `endpoint.url`. A failed\n\t\t * read toasts and opens nothing.\n\t\t *\n\t\t * @param {object} entry The open-form action with `endpoint` and `formProperties`.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/open-form-endpoint/specs/open-form-endpoint/spec.md#requirement-an-open-form-action-can-edit-a-record-through-an-endpoint\n\t\t */\n\t\tasync openEndpointForm(entry) {\n\t\t\tconst properties = entry.formProperties && typeof entry.formProperties === 'object' && !Array.isArray(entry.formProperties) ? entry.formProperties : {}\n\t\t\tif (String(entry.endpoint.method || '').toUpperCase() === 'POST') {\n\t\t\t\tthis.formSchema = { type: 'object', properties }\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst loadUrl = entry.endpoint.loadUrl || entry.endpoint.url\n\t\t\tconst record = await fetchEndpointSource({ url: loadUrl, responsePath: entry.endpoint.responsePath || '' }, this.tokenCtx, { force: true })\n\t\t\t\t.catch(() => null)\n\t\t\tif (!record || typeof record !== 'object') {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(t('nextcloud-vue', 'Could not open the form.'))\n\t\t\t\t}\n\t\t\t\tthis.formEntry = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.formItem = record\n\t\t\tthis.formSchema = { type: 'object', properties }\n\t\t},\n\n\t\t/**\n\t\t * Save an endpoint form: send the declared fields to `endpoint.url`\n\t\t * with `endpoint.method` (`PATCH` by default, or `PUT`), then toast and\n\t\t * refresh the page as an object save does.\n\t\t *\n\t\t * @param {object} entry The open-form action.\n\t\t * @param {object} formData The form's values.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/open-form-endpoint/specs/open-form-endpoint/spec.md#requirement-an-open-form-action-can-edit-a-record-through-an-endpoint\n\t\t */\n\t\tasync saveEndpointForm(entry, formData) {\n\t\t\tconst dialog = this.$refs.formDialog\n\t\t\tconst keys = Object.keys(this.formSchema?.properties || {})\n\t\t\tconst body = Object.fromEntries(keys.filter((key) => key in formData).map((key) => [key, formData[key]]))\n\t\t\tconst verb = String(entry.endpoint.method || 'PATCH').toUpperCase()\n\t\t\tconst method = verb === 'PUT' ? 'put' : (verb === 'POST' ? 'post' : 'patch')\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 url = interpolateActionTarget(entry.endpoint.url, this.tokenCtx)\n\t\t\t\tconst response = await axios[method](/^https?:\\/\\//i.test(url) ? url : generateUrl(url), body)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ success: true })\n\t\t\t\t}\n\t\t\t\tconst { showSuccess } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showSuccess === 'function') {\n\t\t\t\t\tshowSuccess(this.tr(entry.successMessage) || t('nextcloud-vue', 'Saved.'))\n\t\t\t\t}\n\t\t\t\tconst { emit } = await import('@nextcloud/event-bus')\n\t\t\t\temit('cn:page:refresh', {})\n\t\t\t\tthis.$emit('created', response && response.data)\n\t\t\t} catch (error) {\n\t\t\t\tconst serverMessage = error && error.response && error.response.data\n\t\t\t\t\t&& (error.response.data.error || error.response.data.message)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ error: serverMessage || this.tr(entry.errorMessage) || t('nextcloud-vue', 'Save failed.') })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Open (or skip) the `run-node` config dialog: GET the target node's\n\t\t * describe endpoint (`or-flow-run-node`'s `GET .../{flowId}/{nodeId}/run`),\n\t\t * and either mount `CnRunNodeDialog` with its declared fields, or —\n\t\t * for a node with none — run immediately with an empty config. A\n\t\t * failed describe call toasts and does neither (RN-4: this resolves\n\t\t * as soon as the decision is made, never waiting on the person).\n\t\t *\n\t\t * @param {object} entry The run-node action (`flowId`, `nodeId`, ...).\n\t\t * @return {Promise<void>}\n\t\t *\n\t\t * @spec openspec/changes/manifest-run-node-action/specs/manifest-run-node-action/spec.md#requirement-the-nodes-own-config-form-drives-the-dialog-not-a-new-token\n\t\t */\n\t\tasync openRunNode(entry) {\n\t\t\tconst flowId = entry.flowId\n\t\t\tconst nodeId = entry.nodeId\n\t\t\tif (!flowId || !nodeId) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnActionButtons] run-node requires flowId and nodeId.', entry)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// The try assigns it and the catch returns, so an initialiser here\n\t\t\t// would never be read.\n\t\t\tlet fields\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 url = generateUrl(`/apps/openregister/api/flows/${encodeURIComponent(flowId)}/nodes/${encodeURIComponent(nodeId)}/run`)\n\t\t\t\tconst response = await axios.get(url)\n\t\t\t\tfields = Array.isArray(response.data && response.data.configForm) ? response.data.configForm : []\n\t\t\t} catch (error) {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tconst serverMessage = error && error.response && error.response.data\n\t\t\t\t\t&& (error.response.data.error || error.response.data.message)\n\t\t\t\tif (typeof showError === 'function') {\n\t\t\t\t\tshowError(serverMessage || t('nextcloud-vue', 'Could not open this action.'))\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (!fields.length) {\n\t\t\t\t// Empty (or undeclared) form: the \"empty form is itself\n\t\t\t\t// information\" rule flow-node-config-forms already established\n\t\t\t\t// for the editor — run immediately, no dialog.\n\t\t\t\tthis.actionPending[entry.id] = true\n\t\t\t\tawait this.runNodePost(entry, {})\n\t\t\t\tthis.actionPending[entry.id] = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.runNodeFields = fields\n\t\t\tthis.runNodeEntry = entry\n\t\t},\n\n\t\t/**\n\t\t * The run-node dialog's confirm: POST the collected config, close the\n\t\t * dialog either way (success or failure both end the interaction —\n\t\t * a failure already toasted its own message).\n\t\t *\n\t\t * @param {object} config The dialog's collected field values.\n\t\t * @return {Promise<void>}\n\t\t *\n\t\t * @spec openspec/changes/manifest-run-node-action/specs/manifest-run-node-action/spec.md#requirement-a-run-node-action-invokes-one-flow-node-against-the-page-object\n\t\t */\n\t\tasync onRunNodeConfirm(config) {\n\t\t\tconst entry = this.runNodeEntry\n\t\t\tif (!entry) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.actionPending[entry.id] = true\n\t\t\tawait this.runNodePost(entry, config)\n\t\t\tthis.actionPending[entry.id] = false\n\t\t\tthis.closeRunNode()\n\t\t},\n\n\t\t/**\n\t\t * POST the run-node call through the shared dispatcher's `postRunNode`\n\t\t * (subject/register/schema resolution, fail-closed, toast + refresh —\n\t\t * see its own docblock in actionsDispatcher.js).\n\t\t *\n\t\t * @param {object} entry The run-node action.\n\t\t * @param {object} config The node's collected config.\n\t\t * @return {Promise<{ok: boolean}>}\n\t\t */\n\t\trunNodePost(entry, config) {\n\t\t\treturn postRunNode(entry, { tokenCtx: this.tokenCtx, translate: this.effectiveTranslate }, config)\n\t\t},\n\n\t\t/** Close the run-node dialog without running anything. */\n\t\tcloseRunNode() {\n\t\t\tthis.runNodeEntry = null\n\t\t\tthis.runNodeFields = []\n\t\t},\n\n\t\t/**\n\t\t * The create dialog's confirm: save the new object through the shared\n\t\t * object store, report the result phase, toast, refresh the page, and\n\t\t * navigate to `onSuccessRoute` when set — merging the saved object's id\n\t\t * into the route params (via `buildOnSuccessRoute`) so the navigation\n\t\t * can deep-link to the created object's detail page.\n\t\t *\n\t\t * @param {object} formData The dialog's form payload.\n\t\t * @param {object|null} [dynamic] The answers to the schema's data-driven questions (`{ answers, declarations }`), when it has any.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onFormConfirm(formData, dynamic = null) {\n\t\t\tconst entry = this.formEntry\n\t\t\tif (entry && entry.endpoint) {\n\t\t\t\tawait this.saveEndpointForm(entry, formData)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst dialog = this.$refs.formDialog\n\t\t\tconst register = this.formRegister\n\t\t\tconst schema = (entry && entry.schema) || ''\n\t\t\ttry {\n\t\t\t\tconst store = useObjectStore()\n\t\t\t\tconst type = resolveObjectOpType(store, { register, schema })\n\t\t\t\t// A schema can require a field the form cannot supply — a\n\t\t\t\t// server-minted foreign key, say — in which case a straight\n\t\t\t\t// saveObject 400s. `createOverride` names a registry handler\n\t\t\t\t// that owns the persist instead (the CnIndexPage precedent).\n\t\t\t\tconst override = resolveCreateOverrideHandler(\n\t\t\t\t\tentry && entry.createOverride,\n\t\t\t\t\tthis.cnRegistry,\n\t\t\t\t\tthis.cnCustomComponents,\n\t\t\t\t)\n\t\t\t\tconst payload = { ...formData }\n\t\t\t\t// Array-mode declarations fold their answers into the parent's\n\t\t\t\t// own payload, so the whole record saves in ONE write. The\n\t\t\t\t// child-record mode below cannot do that (the rows need the\n\t\t\t\t// parent's id), which is why it writes afterwards and can leave\n\t\t\t\t// answers behind if that second write fails.\n\t\t\t\tthis.foldArrayAnswers(payload, dynamic)\n\t\t\t\tconst saved = override\n\t\t\t\t\t? await override(payload, { register, schema, type })\n\t\t\t\t\t: await store.saveObject(type, payload)\n\t\t\t\tif (!saved) {\n\t\t\t\t\tthrow new Error('save rejected')\n\t\t\t\t}\n\t\t\t\tawait this.saveDynamicAnswers(store, register, dynamic, saved)\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ success: true })\n\t\t\t\t}\n\t\t\t\tconst { showSuccess } = await import('@nextcloud/dialogs')\n\t\t\t\tif (typeof showSuccess === 'function') {\n\t\t\t\t\tshowSuccess((entry && entry.successMessage) || t('nextcloud-vue', 'Saved.'))\n\t\t\t\t}\n\t\t\t\tconst { emit } = await import('@nextcloud/event-bus')\n\t\t\t\temit('cn:page:refresh', {})\n\t\t\t\t/**\n\t\t\t\t * @event created Emitted after an open-form action saves. Payload: the created object.\n\t\t\t\t */\n\t\t\t\tthis.$emit('created', saved)\n\t\t\t\tif (entry && entry.onSuccessRoute && this.effectiveRouter) {\n\t\t\t\t\tconst location = buildOnSuccessRoute(entry.onSuccessRoute, saved)\n\t\t\t\t\tif (location) {\n\t\t\t\t\t\tthis.effectiveRouter.push(location).catch(() => {})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tif (dialog && typeof dialog.setResult === 'function') {\n\t\t\t\t\tdialog.setResult({ error: (e && e.message) || t('nextcloud-vue', 'Save failed.') })\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write the answers to a schema's data-driven questions, once the\n\t\t * object they belong to exists.\n\t\t *\n\t\t * This runs AFTER the parent save and deliberately does not roll it\n\t\t * back on failure: a case that exists without one of its custom values\n\t\t * is recoverable by editing it, whereas discarding a case the user\n\t\t * believes they filed is not. A failure here surfaces as the dialog's\n\t\t * error so it is never silent.\n\t\t *\n\t\t * @param {object} store The object store.\n\t\t * @param {string} register The register the object was saved in.\n\t\t * @param {object|null} dynamic The `{ answers, declarations }` payload.\n\t\t * @param {object} saved The saved parent object.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync saveDynamicAnswers(store, register, dynamic, saved) {\n\t\t\tif (!dynamic || !Array.isArray(dynamic.answers) || dynamic.answers.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst objectId = saved && (saved.id || saved.uuid)\n\t\t\tif (!objectId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declarations = dynamic.declarations || []\n\t\t\tfor (const { key, config } of declarations) {\n\t\t\t\tconst values = config && config.values\n\t\t\t\tif (!values || !values.schema) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Already written as part of the parent payload.\n\t\t\t\tif (usesArrayValues(config)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// An answer belongs to exactly one declaration. With a single\n\t\t\t\t// declaration every answer carries its key anyway; the filter\n\t\t\t\t// only matters once a schema has two, where writing an answer\n\t\t\t\t// to both value schemas would invent a row nobody entered.\n\t\t\t\tconst mine = declarations.length === 1\n\t\t\t\t\t? dynamic.answers\n\t\t\t\t\t: dynamic.answers.filter((a) => a.declarationKey === key)\n\t\t\t\tconst rows = valueRecordsFor(mine, config, objectId)\n\t\t\t\tif (rows.length === 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst valueRegister = values.register || register\n\t\t\t\tconst type = resolveObjectOpType(store, { register: valueRegister, schema: values.schema })\n\t\t\t\tfor (const row of rows) {\n\t\t\t\t\tawait store.saveObject(type, row)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fold array-mode dynamic answers into the parent payload.\n\t\t *\n\t\t * @param {object} payload The parent object payload, mutated in place.\n\t\t * @param {object|null} dynamic The `{ answers, declarations }` payload.\n\t\t * @return {void}\n\t\t */\n\t\tfoldArrayAnswers(payload, dynamic) {\n\t\t\tif (!dynamic || !Array.isArray(dynamic.answers) || dynamic.answers.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declarations = dynamic.declarations || []\n\t\t\tfor (const { key, config } of declarations) {\n\t\t\t\tif (!usesArrayValues(config)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst mine = declarations.length === 1\n\t\t\t\t\t? dynamic.answers\n\t\t\t\t\t: dynamic.answers.filter((a) => a.declarationKey === key)\n\t\t\t\tconst entries = valueArrayFor(mine, config, dynamic.definitions || [])\n\t\t\t\tif (entries.length) {\n\t\t\t\t\tpayload[config.values.arrayKey] = entries\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Close the create dialog.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcloseForm() {\n\t\t\tthis.formEntry = null\n\t\t\tthis.formSchema = null\n\t\t\tthis.formItem = null\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-action-buttons {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 8px;\n\tflex-wrap: wrap;\n}\n\n/* In menu mode the only children are dialogs, so the wrapper must not be a\n box: an empty inline-flex child still eats one of the header's flex gaps\n and pushes the Actions menu away from the Edit button beside it. */\n.cn-action-buttons--menu {\n\tdisplay: contents;\n}\n</style>\n"],"names":["CnIcon","CnConfirmDialog","CnFormDialog","CnAdvancedFormDialog","CnRunNodeDialog","t"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsOA;;AAEC;;;AAGA;AACA;;;;;;;AAOA;AACA;;AAEA;;;;AAIA;AACA;;;;;AAKA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;;;;AAIA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAED,aAAe;CACd,IAAI,EAAE,iBAAiB;;AAEvB,CAAA,UAAU,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,UAAEA,UAAM,mBAAEC,YAAe,gBAAEC,YAAY,wBAAEC,YAAoB,mBAAEC,cAAiB;;AAE/I,CAAA,MAAM,EAAE;AACP;AACA,EAAA,eAA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AAM;AACzC,KAAA;AACD,IAAA;GACA;;AAED;AACC;AACA;;;EAGD,SAAS,GAAG;AACX,GAAA,IAAI,CAAC,SAAQ,GAAI,KAAG;AACpB,GAAA,IAAI,CAAC,aAAa,KAAG;AACrB,GAAA,IAAI,CAAC,QAAO,GAAI,KAAG;GACnB;EACD;AACF;;;;"}
@@ -287,7 +287,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
287
287
  key: 2,
288
288
  ref: "formDialog",
289
289
  schema: $data.formSchema,
290
- item: null,
290
+ item: $data.formItem,
291
291
  register: $options.formRegister,
292
292
  initialData: $options.formInitialValues || {},
293
293
  dialogTitle: $options.tr($data.formEntry.formTitle) || '',
@@ -300,7 +300,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
300
300
  columns: $data.formEntry.columns || 1,
301
301
  onConfirm: $options.onFormConfirm,
302
302
  onClose: $options.closeForm
303
- }, null, 8 /* PROPS */, ["schema", "register", "initialData", "dialogTitle", "eyebrow", "subtitle", "includeFields", "excludeFields", "fieldOverrides", "size", "columns", "onConfirm", "onClose"]))
303
+ }, null, 8 /* PROPS */, ["schema", "item", "register", "initialData", "dialogTitle", "eyebrow", "subtitle", "includeFields", "excludeFields", "fieldOverrides", "size", "columns", "onConfirm", "onClose"]))
304
304
  : createCommentVNode("v-if", true),
305
305
  ($data.formEntry && $data.formSchema && $data.formEntry.advanced)
306
306
  ? (openBlock(), createBlock(_component_CnAdvancedFormDialog, {