@conduction/nextcloud-vue 2.155.0 → 2.157.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.
- package/dist/esm/components/CnAiCompanion/CnAiInput.vue2.js +3 -1
- package/dist/esm/components/CnAiCompanion/CnAiInput.vue2.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiInput.vue3.js.map +1 -1
- package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue.js +1 -1
- package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue.js +1 -1
- package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js +2 -1
- package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js.map +1 -1
- package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js +10 -3
- package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +14 -4
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +3 -3
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue.js +1 -1
- package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +2 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js +13 -4
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js.map +1 -1
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue.js +1 -1
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue2.js +91 -7
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnMailTab/CnMailTab.vue.js +1 -1
- package/dist/esm/components/CnMailTab/CnMailTab.vue2.js +4 -4
- package/dist/esm/components/CnMailTab/CnMailTab.vue2.js.map +1 -1
- package/dist/esm/components/CnMailTab/CnMailTab.vue3.js.map +1 -1
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue.js +1 -1
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js +3 -0
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js +10 -2
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js.map +1 -1
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js +1 -1
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js +6 -0
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js.map +1 -1
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js +2 -1
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js.map +1 -1
- package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue.js +1 -1
- package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue2.js.map +1 -1
- package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js +27 -24
- package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue2.js +25 -0
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue2.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue3.js +40 -8
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue3.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue2.js +10 -0
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue.js +1 -1
- package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue2.js.map +1 -1
- package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue3.js.map +1 -1
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue.js +1 -1
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js +24 -1
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js.map +1 -1
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js +9 -0
- package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js.map +1 -1
- package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue.js +1 -1
- package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js +4 -1
- package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnStagesWidget/stagesModel.js +10 -2
- package/dist/esm/components/CnStagesWidget/stagesModel.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue.js +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js +61 -2
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js +68 -44
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js +13 -3
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +12 -7
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +14 -9
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +777 -469
- package/dist/esm/utils/dynamicProperties.js +14 -2
- package/dist/esm/utils/dynamicProperties.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +2472 -2120
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +777 -469
- package/l10n/en.json +12 -7
- package/l10n/nl.json +14 -9
- package/package.json +1 -1
- package/src/components/CnAiCompanion/CnAiInput.vue +3 -1
- package/src/components/CnBannerWidget/CnBannerWidget.vue +5 -1
- package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +12 -5
- package/src/components/CnCountdownWidget/CnCountdownWidget.vue +12 -0
- package/src/components/CnDashboardPage/CnDashboardPage.vue +3 -1
- package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +1 -0
- package/src/components/CnDuplicateWarning/CnDuplicateWarning.vue +8 -4
- package/src/components/CnFactsWidget/CnFactsWidget.vue +31 -6
- package/src/components/CnFeaturesBoard/CnFeaturesBoard.vue +4 -2
- package/src/components/CnFormDialog/CnFormDialog.vue +1 -0
- package/src/components/CnIndexSidebar/CnIndexSidebar.vue +13 -4
- package/src/components/CnLinkedWidget/CnLinkedWidget.vue +91 -7
- package/src/components/CnMailTab/CnMailTab.vue +4 -4
- package/src/components/CnNotificationMatrix/CnNotificationMatrix.vue +20 -0
- package/src/components/CnPartyPicker/CnPartyPicker.vue +7 -0
- package/src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue +27 -20
- package/src/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue +42 -0
- package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +10 -0
- package/src/components/CnSearchSelect/CnSearchSelect.vue +3 -1
- package/src/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue +37 -1
- package/src/components/CnStagesWidget/CnStagesWidget.vue +4 -1
- package/src/components/CnStagesWidget/stagesModel.js +10 -2
- package/src/components/CnTimelineWidget/CnTimelineManage.vue +69 -4
- package/src/css/dialog.css +33 -0
- package/src/css/look-board-detail.css +4 -3
- package/src/css/look-board-index.css +34 -3
- package/src/css/look-board.css +181 -4
- package/src/integrations/builtin/email/CnEmailTab.vue +13 -3
- package/src/utils/dynamicProperties.js +13 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnAiInput.vue3.js","sources":["../../../../src/components/CnAiCompanion/CnAiInput.vue?vue&type=template&id=3e0805be&lang.js"],"sourcesContent":["<!--\n CnAiInput — multi-line textarea + send button for the AI Chat Companion.\n\n - Auto-grows vertically up to ~6 lines, then scrolls internally.\n - Enter sends and clears; Shift+Enter inserts a newline.\n - Disabled prop disables both controls; send button shows NcLoadingIcon.\n - Send button disabled when the textarea is empty/whitespace-only AND no\n attachment has been added (an attachment-only send is allowed).\n - Attach button (paperclip) is a menu: Upload from device opens a hidden\n file input; Choose from Files opens the Nextcloud file picker and adds the\n chosen files as chips carrying `{ fileId, path, name }`, sent by id with no\n upload. On the device path the picked file is\n uploaded immediately as multipart/form-data (field `file`) to the chat\n backend's attachments endpoint (see composables/aiChatConfig.js\n `attachmentsUrl()`), which text-decodes and stores it, returning\n `{ path, name }`. Successful uploads render as removable chips above the\n textarea; a 400 rejection (oversized or non-UTF-8 binary) surfaces the\n backend's `{ error }` message inline via NcNoteCard rather than being\n dropped silently.\n - On send, the accumulated attachment refs are emitted alongside the text\n as `{ text, attachments }` and cleared (mirrors the existing optimistic\n textarea clear — this component fires the `send` event and does not wait\n for the parent's async request to resolve before clearing either).\n-->\n<template>\n\t<div class=\"cn-ai-input\" :class=\"{ 'cn-ai-input--stacked': stacked }\" data-testid=\"cn-ai-input\">\n\t\t<NcNoteCard\n\t\t\tv-if=\"uploadError\"\n\t\t\ttype=\"error\"\n\t\t\tclass=\"cn-ai-input__error\"\n\t\t\tdata-testid=\"cn-ai-input-error\">\n\t\t\t{{ uploadError }}\n\t\t</NcNoteCard>\n\t\t<NcNoteCard\n\t\t\tv-if=\"dictationError\"\n\t\t\ttype=\"warning\"\n\t\t\tclass=\"cn-ai-input__error\"\n\t\t\tdata-testid=\"cn-ai-input-dictation-error\">\n\t\t\t{{ dictationError }}\n\t\t</NcNoteCard>\n\t\t<ul\n\t\t\tv-if=\"attachments.length\"\n\t\t\tclass=\"cn-ai-input__chips\"\n\t\t\tdata-testid=\"cn-ai-input-chips\">\n\t\t\t<li\n\t\t\t\tv-for=\"(attachment, index) in attachments\"\n\t\t\t\t:key=\"attachment.fileId !== undefined ? 'f' + attachment.fileId : attachment.path\"\n\t\t\t\tclass=\"cn-ai-input__chip\">\n\t\t\t\t<Paperclip :size=\"14\" class=\"cn-ai-input__chip-icon\" />\n\t\t\t\t<span class=\"cn-ai-input__chip-name\">{{ attachment.name }}</span>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-ai-input__chip-remove\"\n\t\t\t\t\t:aria-label=\"cnTranslate('Remove attachment')\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:data-testid=\"'cn-ai-input-chip-remove-' + index\"\n\t\t\t\t\t@click=\"removeAttachment(index)\">\n\t\t\t\t\t<Close :size=\"14\" />\n\t\t\t\t</button>\n\t\t\t</li>\n\t\t</ul>\n\t\t<div class=\"cn-ai-input__row\">\n\t\t\t<!--\n\t\t\t Dictation sits LEFT of the paperclip: both are ways of getting content\n\t\t\t into the message, and speech is the one reached for first when typing\n\t\t\t is the obstacle.\n\n\t\t\t Rendered only where the browser can actually do it. A mic button that\n\t\t\t silently does nothing is worse than no mic button, and support is\n\t\t\t genuinely partial (WebKit-prefixed in Safari, absent in Firefox).\n\t\t\t-->\n\t\t\t<!--\n\t\t\t ⚠️ NOT the `disabled` attribute when dictation is merely blocked.\n\t\t\t Browsers suppress hover events on a disabled control, so its\n\t\t\t `title` tooltip can never appear — the button would look dead and\n\t\t\t still refuse to say why, which is the bug this is fixing.\n\n\t\t\t So: `aria-disabled` for assistive tech, a class for the muted look,\n\t\t\t and a live click handler that puts the reason on screen. The real\n\t\t\t `disabled` attribute is still used for the one case that is not a\n\t\t\t capability problem — a turn already streaming.\n\t\t\t-->\n\t\t\t<button\n\t\t\t\tv-if=\"speechButtonVisible\"\n\t\t\t\tclass=\"cn-ai-input__mic-button\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'cn-ai-input__mic-button--recording': micIsOpen,\n\t\t\t\t\t'cn-ai-input__mic-button--transcribing': transcribing,\n\t\t\t\t\t'cn-ai-input__mic-button--blocked': speechBlockedReason !== '',\n\t\t\t\t}\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t:aria-label=\"micButtonLabel\"\n\t\t\t\t:title=\"micButtonLabel\"\n\t\t\t\t:aria-pressed=\"micIsOpen ? 'true' : 'false'\"\n\t\t\t\t:aria-disabled=\"speechBlockedReason !== '' ? 'true' : 'false'\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:data-engine=\"dictationDecision.engine\"\n\t\t\t\tdata-testid=\"cn-ai-input-mic\"\n\t\t\t\t@click=\"toggleDictation\">\n\t\t\t\t<!--\n\t\t\t\t 🔴 THE FILLED MIC MEANS LIVE. THIS WAS THE OTHER WAY AROUND.\n\t\t\t\t A struck-through mic (`MicrophoneOff`) rendered WHILE\n\t\t\t\t RECORDING, on the reasoning that a button should picture the\n\t\t\t\t action its click performs. Every other product on the user's\n\t\t\t\t machine uses that glyph for \"muted\", so the composer read as\n\t\t\t\t off while it was listening and on while it was idle —\n\t\t\t\t reported from a live session where the reporter was watching\n\t\t\t\t their own words appear under an icon saying the mic was off.\n\n\t\t\t\t A control's icon states what IS, not what clicking does; the\n\t\t\t\t label and `aria-pressed` carry the action.\n\n\t\t\t\t Outline vs filled rather than a colour change alone, so the\n\t\t\t\t two states are distinguishable without perceiving the red\n\t\t\t\t (WCAG 2.2 SC 1.4.1 Use of Colour).\n\t\t\t\t-->\n\t\t\t\t<!-- The clip is recorded; this is the wait for the transcript.\n\t\t\t\t The microphone is already closed, so showing the recording\n\t\t\t\t state through it would be the same lie in a new place. -->\n\t\t\t\t<NcLoadingIcon\n\t\t\t\t\tv-if=\"transcribing\"\n\t\t\t\t\t:size=\"20\" />\n\t\t\t\t<MicrophoneIcon\n\t\t\t\t\tv-else-if=\"micIsOpen\"\n\t\t\t\t\t:size=\"20\" />\n\t\t\t\t<MicrophoneOutline\n\t\t\t\t\tv-else\n\t\t\t\t\t:size=\"20\" />\n\t\t\t</button>\n\t\t\t<!--\n\t\t\t Conversation — a SEPARATE control from the microphone, offered only\n\t\t\t where the agent allows it. Same reason it is a separate icon:\n\t\t\t pressing \"dictate\" must never post a message by itself, and\n\t\t\t pressing \"converse\" is the act of agreeing that it will.\n\t\t\t-->\n\t\t\t<button\n\t\t\t\tv-if=\"conversationButtonVisible\"\n\t\t\t\tclass=\"cn-ai-input__converse-button\"\n\t\t\t\t:class=\"{ 'cn-ai-input__converse-button--active': conversing }\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t:aria-label=\"converseButtonLabel\"\n\t\t\t\t:title=\"converseButtonLabel\"\n\t\t\t\t:aria-pressed=\"conversing ? 'true' : 'false'\"\n\t\t\t\t:disabled=\"disabled && conversing === false\"\n\t\t\t\tdata-testid=\"cn-ai-input-converse\"\n\t\t\t\t@click=\"toggleConversation\">\n\t\t\t\t<Headset\n\t\t\t\t\tv-if=\"conversing\"\n\t\t\t\t\t:size=\"20\" />\n\t\t\t\t<HeadsetOff\n\t\t\t\t\tv-else\n\t\t\t\t\t:size=\"20\" />\n\t\t\t</button>\n\t\t\t<!-- The paperclip is a small menu: upload from the device (the\n\t\t\t hidden file input below) or choose files already in Files. -->\n\t\t\t<NcActions\n\t\t\t\tclass=\"cn-ai-input__attach-menu\"\n\t\t\t\t:aria-label=\"cnTranslate('Attach file')\"\n\t\t\t\t:disabled=\"disabled || uploading\"\n\t\t\t\t:forceMenu=\"true\"\n\t\t\t\tdata-testid=\"cn-ai-input-attach\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcLoadingIcon v-if=\"uploading\" :size=\"20\" />\n\t\t\t\t\t<Paperclip v-else :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<NcActionButton\n\t\t\t\t\t:closeAfterClick=\"true\"\n\t\t\t\t\tdata-testid=\"cn-ai-input-attach-upload\"\n\t\t\t\t\t@click=\"openFilePicker\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Upload :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ cnTranslate('Upload from device') }}\n\t\t\t\t</NcActionButton>\n\t\t\t\t<NcActionButton\n\t\t\t\t\t:closeAfterClick=\"true\"\n\t\t\t\t\tdata-testid=\"cn-ai-input-attach-files\"\n\t\t\t\t\t@click=\"chooseFromFiles\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<FolderOutline :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ cnTranslate('Choose from Files') }}\n\t\t\t\t</NcActionButton>\n\t\t\t</NcActions>\n\t\t\t<!-- `:ref`, not `ref` — a fully static input with a cached handler\n\t\t\t is hoisted to module scope, and a hoisted vnode's ref has no\n\t\t\t owner, which throws in production builds where Vue's guard is\n\t\t\t compiled out. See CnFilesTab for the full account. -->\n\t\t\t<input\n\t\t\t\t:ref=\"fileInputRef\"\n\t\t\t\ttype=\"file\"\n\t\t\t\tclass=\"cn-ai-input__file-input\"\n\t\t\t\tdata-testid=\"cn-ai-input-file\"\n\t\t\t\t@change=\"onFileSelected\">\n\t\t\t<textarea\n\t\t\t\tref=\"textarea\"\n\t\t\t\tv-model=\"inputText\"\n\t\t\t\tclass=\"cn-ai-input__textarea\"\n\t\t\t\t:aria-label=\"cnTranslate('Message input')\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:placeholder=\"placeholder || cnTranslate('Message input')\"\n\t\t\t\trows=\"1\"\n\t\t\t\tdata-testid=\"cn-ai-input-textarea\"\n\t\t\t\t@keydown.enter.exact.prevent=\"handleEnter\"\n\t\t\t\t@keydown.shift.enter.exact=\"handleShiftEnter\"\n\t\t\t\t@input=\"autoGrow\" />\n\t\t\t<button\n\t\t\t\tclass=\"cn-ai-input__send-button\"\n\t\t\t\t:class=\"{ 'cn-ai-input__send-button--labelled': sendLabel }\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t:aria-label=\"sendLabel ? null : cnTranslate('Send message')\"\n\t\t\t\t:disabled=\"disabled || isSendDisabled\"\n\t\t\t\tdata-testid=\"cn-ai-input-send\"\n\t\t\t\t@click=\"handleSend\">\n\t\t\t\t<NcLoadingIcon\n\t\t\t\t\tv-if=\"disabled\"\n\t\t\t\t\t:size=\"20\" />\n\t\t\t\t<template v-else-if=\"sendLabel\">\n\t\t\t\t\t{{ sendLabel }}\n\t\t\t\t</template>\n\t\t\t\t<Send\n\t\t\t\t\tv-else\n\t\t\t\t\t:size=\"20\" />\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { FilePickerType, getFilePickerBuilder } from '@nextcloud/dialogs'\nimport { NcActionButton, NcActions, NcLoadingIcon, NcNoteCard } from '@nextcloud/vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport FolderOutline from 'vue-material-design-icons/FolderOutline.vue'\nimport Headset from 'vue-material-design-icons/Headset.vue'\nimport HeadsetOff from 'vue-material-design-icons/HeadsetOff.vue'\nimport MicrophoneIcon from 'vue-material-design-icons/Microphone.vue'\nimport MicrophoneOutline from 'vue-material-design-icons/MicrophoneOutline.vue'\nimport Paperclip from 'vue-material-design-icons/Paperclip.vue'\nimport Send from 'vue-material-design-icons/Send.vue'\nimport Upload from 'vue-material-design-icons/Upload.vue'\nimport { attachmentsUrl, DEFAULT_CHAT_APP_ID, speechTranscriptionsUrl } from '../../composables/aiChatConfig.js'\nimport { createLocalDictation } from '../../composables/aiLocalDictation.js'\nimport {\n\tbrowserRecognitionUsable,\n\tbrowserRecordingUsable,\n\tresolveDictationEngine,\n\tSPEECH_AUTO,\n\tSPEECH_LOCAL,\n\tSPEECH_OFF,\n} from '../../composables/aiSpeechPolicy.js'\nimport { libraryTranslate } from '../../utils/libraryTranslate.js'\n\n/** How long a dictation failure stays on screen, in ms. */\nconst DICTATION_ERROR_TIMEOUT = 6000\n\nexport default {\n\tname: 'CnAiInput',\n\n\tcomponents: {\n\t\tNcActionButton,\n\t\tNcActions,\n\t\tFolderOutline,\n\t\tUpload,\n\t\tNcLoadingIcon,\n\t\tNcNoteCard,\n\t\tSend,\n\t\tPaperclip,\n\t\tClose,\n\t\tMicrophoneIcon,\n\t\tMicrophoneOutline,\n\t\tHeadset,\n\t\tHeadsetOff,\n\t},\n\n\tinject: {\n\t\tcnTranslate: { default: () => libraryTranslate },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Whether the input controls are disabled (e.g. while streaming).\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The textarea's placeholder, already translated; '' keeps \"Message input\". */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A label on the send button, already translated; '' draws the send icon. */\n\t\tsendLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The narrow layout of a card: the text box and the send button on the\n\t\t * first line, dictation and attach on a line under it.\n\t\t */\n\t\tstacked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Backend app id the attach control uploads files to\n\t\t * (`POST /index.php/apps/{chatAppId}/api/chat/attachments`). See\n\t\t * composables/aiChatConfig.js `attachmentsUrl()`.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tchatAppId: {\n\t\t\ttype: String,\n\t\t\tdefault: DEFAULT_CHAT_APP_ID,\n\t\t},\n\n\t\t/**\n\t\t * How long a silence may last during dictation before the microphone is\n\t\t * released, in ms. `0` disables the timer and leaves the mic open until\n\t\t * the user stops it or the engine gives up on its own.\n\t\t *\n\t\t * Releasing the mic is ALL this does — the transcript stays in the box\n\t\t * for the user to read, edit and send. Dictation that posts by itself\n\t\t * turns a pause for thought into a sent message, and there is no\n\t\t * unsending. Conversation mode is where auto-send belongs, behind its\n\t\t * own control that the user chose to press.\n\t\t *\n\t\t * Per-agent, because the right pause length is a property of the work:\n\t\t * dictating a case note is not the same rhythm as answering a question.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tdictationSilenceTimeout: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2500,\n\t\t},\n\n\t\t/**\n\t\t * Which engine this agent's dictation may use: `auto`, `browser`,\n\t\t * `local` or `off`. Comes from the agent's `voiceInputEngine`.\n\t\t *\n\t\t * 🔴 `local` MEANS ONLY LOCAL. It is not a preference to be abandoned\n\t\t * when the instance's speech service is down — an agent is set to it\n\t\t * because its subject matter must not reach a cloud service, and the\n\t\t * browser engine IS a cloud service in Chrome, Edge and Safari alike.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tspeechInputEngine: {\n\t\t\ttype: String,\n\t\t\tdefault: SPEECH_AUTO,\n\t\t},\n\n\t\t/**\n\t\t * Whether the instance's own speech service answered its capability\n\t\t * probe. Passed in rather than probed here so one panel makes one call\n\t\t * for every composer it owns.\n\t\t *\n\t\t * ⚠️ Defaults to FALSE, so an app that does not probe never offers a\n\t\t * private engine it has not confirmed. Wrong in the safe direction: the\n\t\t * cost is the browser engine where local would have worked, not audio\n\t\t * leaving an instance that thought it was private.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tlocalSpeechAvailable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Whether this agent offers hands-free conversation — a separate\n\t\t * control from the microphone, and deliberately so.\n\t\t *\n\t\t * Dictation and conversation are different acts. Dictating is writing\n\t\t * with your voice: the words land in the box and you decide when they\n\t\t * go. Conversing is talking to someone: your turn ends when you stop\n\t\t * speaking, and it is sent. Putting both on one button would mean every\n\t\t * dictated pause risks posting a half-finished thought, which is why\n\t\t * this is a second control the user chose to press.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tconversationEnabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: ['send', 'dictation-complete', 'conversation-state'],\n\n\tdata() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * The hidden file input, set by the template's function ref (kept\n\t\t\t * off `$refs` so the ref stays dynamic).\n\t\t\t *\n\t\t\t * @type {HTMLInputElement|null}\n\t\t\t */\n\t\t\tfileInputEl: null,\n\t\t\tinputText: '',\n\t\t\t/** Uploaded attachment refs: { path, name } — awaiting send. */\n\t\t\tattachments: [],\n\t\t\t/** Whether an upload request is in-flight. */\n\t\t\tuploading: false,\n\t\t\t/** Backend `{ error }` message from a rejected (400) upload, or ''. */\n\t\t\tuploadError: '',\n\t\t\t/** Whether dictation is currently capturing. */\n\t\t\tlistening: false,\n\t\t\t/** The live SpeechRecognition instance, or null when idle. */\n\t\t\trecognition: null,\n\t\t\t/** Text already in the box when dictation started, so it is not lost. */\n\t\t\ttextBeforeDictation: '',\n\t\t\t/** Timer that releases the mic after a silence. null when not armed. */\n\t\t\tsilenceTimer: null,\n\t\t\t/** Whether a hands-free conversation is running. */\n\t\t\tconversing: false,\n\t\t\t/** The local-engine session, or null when idle. */\n\t\t\tlocalSession: null,\n\t\t\t/** Whether the local engine is recording right now. */\n\t\t\tlocalRecording: false,\n\t\t\t/**\n\t\t\t * Whether a recorded clip is being transcribed.\n\t\t\t *\n\t\t\t * Its own state, not folded into `localRecording`: the microphone is\n\t\t\t * already closed by then, and showing \"recording\" through a\n\t\t\t * multi-second upload is the same lie the mic icon used to tell.\n\t\t\t */\n\t\t\ttranscribing: false,\n\t\t\t/** Last dictation failure, shown to the user. '' when none. */\n\t\t\tdictationError: '',\n\t\t\t/** Timer clearing that message, so it does not outlive its moment. */\n\t\t\tdictationErrorTimer: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether this browser can do speech recognition at all.\n\t\t *\n\t\t * Checked rather than assumed: Chrome and Safari expose it (Safari only\n\t\t * under the `webkit` prefix) and Firefox does not expose it at all.\n\t\t *\n\t\t * ⚠️ This answers \"is the BROWSER engine available\", which since the\n\t\t * per-agent policy landed is no longer the same question as \"may this\n\t\t * agent dictate\" — see `dictationDecision`. Used only by the browser\n\t\t * path's own guard.\n\t\t *\n\t\t * @return {boolean} true when a SpeechRecognition constructor exists.\n\t\t */\n\t\tspeechSupported() {\n\t\t\treturn browserRecognitionUsable()\n\t\t},\n\n\t\t/**\n\t\t * Why dictation cannot run here, or '' when it can.\n\t\t *\n\t\t * 🔴 The constructor EXISTING is not the capability. On an insecure\n\t\t * origin Chrome still exposes `webkitSpeechRecognition`, so a\n\t\t * constructor check passes, and then `start()` fires `onerror:\n\t\t * not-allowed` immediately — measured on this instance over http://,\n\t\t * where `isSecureContext` is false and `navigator.mediaDevices` is\n\t\t * undefined. The first version of this button did exactly that and\n\t\t * appeared to do nothing at all when pressed.\n\t\t *\n\t\t * Reported rather than hidden: the button vanishing reads as a missing\n\t\t * feature, while a disabled button that says why reads as a\n\t\t * deployment fact the user can act on (serve over https).\n\t\t *\n\t\t * @return {string} A reason to show, or '' when dictation is available.\n\t\t */\n\t\tspeechBlockedReason() {\n\t\t\tif (this.dictationDecision.engine === SPEECH_OFF) {\n\t\t\t\treturn this.cnTranslate(this.dictationDecision.reason)\n\t\t\t}\n\t\t\tif (typeof window !== 'undefined' && window.isSecureContext === false) {\n\t\t\t\treturn this.cnTranslate('Dictation needs a secure (https) connection')\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/**\n\t\t * Which engine this agent's dictation may use, and why not when it may not.\n\t\t *\n\t\t * The DECISION, not a preference — `startDictation` runs exactly what\n\t\t * this names. See composables/aiSpeechPolicy.js for the rule that matters:\n\t\t * an agent pinned to the private engine never falls back to the browser's,\n\t\t * because that fallback would send confidential audio to a cloud service.\n\t\t *\n\t\t * @return {{engine: string, reason: string}} The decision.\n\t\t */\n\t\tdictationDecision() {\n\t\t\treturn resolveDictationEngine(\n\t\t\t\t{ inputEngine: this.speechInputEngine },\n\t\t\t\t{\n\t\t\t\t\tbrowserUsable: browserRecognitionUsable(),\n\t\t\t\t\tlocalUsable: this.localSpeechAvailable === true && browserRecordingUsable(),\n\t\t\t\t},\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Whether the mic button is offered at all.\n\t\t *\n\t\t * ⚠️ HIDDEN ONLY WHEN THE AGENT SAYS SO. An unavailable engine still\n\t\t * renders the button, disabled and carrying its reason: a control that\n\t\t * vanishes reads as a missing feature, while one that says \"this agent\n\t\t * may only use the private speech service, and it is unavailable\" reads\n\t\t * as a fact somebody can act on. The exception is `off`, where the agent\n\t\t * has decided there is no dictation — then there is nothing to explain.\n\t\t *\n\t\t * @return {boolean} true when the button should render.\n\t\t */\n\t\tspeechButtonVisible() {\n\t\t\tif (this.speechInputEngine === SPEECH_OFF) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn this.dictationDecision.engine !== SPEECH_OFF\n\t\t\t\t|| this.dictationDecision.reason !== ''\n\t\t},\n\n\t\t/**\n\t\t * Whether dictation is currently running on either engine.\n\t\t *\n\t\t * @return {boolean} true while the microphone is open.\n\t\t */\n\t\tmicIsOpen() {\n\t\t\treturn this.listening === true || this.localRecording === true\n\t\t},\n\n\t\t/**\n\t\t * Whether the conversation control is offered.\n\t\t *\n\t\t * Both conditions matter: the agent has to allow it, AND there has to be\n\t\t * an engine that can hear you. A hands-free control on an agent with no\n\t\t * working microphone is a button that can only disappoint.\n\t\t *\n\t\t * @return {boolean} true when the control should render.\n\t\t */\n\t\tconversationButtonVisible() {\n\t\t\treturn this.conversationEnabled === true\n\t\t\t\t&& this.dictationDecision.engine !== SPEECH_OFF\n\t\t},\n\n\t\t/**\n\t\t * The conversation control's label.\n\t\t *\n\t\t * Says what pressing it will DO, including the part people need warning\n\t\t * about — that a pause sends the message.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\tconverseButtonLabel() {\n\t\t\treturn this.conversing === true\n\t\t\t\t? this.cnTranslate('End the spoken conversation')\n\t\t\t\t: this.cnTranslate('Talk to the agent — your turn is sent when you stop speaking')\n\t\t},\n\n\t\t/**\n\t\t * The mic button's label and tooltip.\n\t\t *\n\t\t * Names the ENGINE when dictation is idle and the private one would be\n\t\t * used, because \"which service is about to hear me\" is not something a\n\t\t * user can discover any other way — and the difference between the two\n\t\t * is whether their words leave the building.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\tmicButtonLabel() {\n\t\t\tif (this.speechBlockedReason !== '') {\n\t\t\t\treturn this.speechBlockedReason\n\t\t\t}\n\t\t\tif (this.transcribing === true) {\n\t\t\t\treturn this.cnTranslate('Transcribing…')\n\t\t\t}\n\t\t\tif (this.micIsOpen === true) {\n\t\t\t\treturn this.cnTranslate('Stop dictation')\n\t\t\t}\n\t\t\tif (this.dictationDecision.engine === SPEECH_LOCAL) {\n\t\t\t\treturn this.cnTranslate('Dictate message (private, on this instance)')\n\t\t\t}\n\t\t\treturn this.cnTranslate('Dictate message')\n\t\t},\n\n\t\tisTextEmpty() {\n\t\t\treturn !this.inputText || !this.inputText.trim()\n\t\t},\n\n\t\t/** Send is only blocked when there's neither text nor an attachment. */\n\t\tisSendDisabled() {\n\t\t\treturn this.isTextEmpty && this.attachments.length === 0\n\t\t},\n\t},\n\n\tbeforeUnmount() {\n\t\t// A recogniser outliving its component keeps the microphone open — the\n\t\t// indicator stays lit in the browser chrome with nothing on screen\n\t\t// explaining why.\n\t\tthis.conversing = false\n\t\tthis.stopDictation()\n\t\tif (this.dictationErrorTimer !== null) {\n\t\t\tclearTimeout(this.dictationErrorTimer)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Function ref for the hidden file input; a method so the binding is\n\t\t * stable across renders.\n\t\t *\n\t\t * @param {HTMLInputElement|null} el The element, or null on unmount.\n\t\t * @return {void}\n\t\t */\n\t\tfileInputRef(el) {\n\t\t\tthis.fileInputEl = el || null\n\t\t},\n\n\t\t/**\n\t\t * Show a dictation failure, and take it away again.\n\t\t *\n\t\t * A banner with no lifetime is a banner that becomes furniture: the\n\t\t * first version stayed on screen for the rest of the session, sitting\n\t\t * above the composer long after the moment it described, so it read as a\n\t\t * permanent state of the chat rather than as the result of a click.\n\t\t *\n\t\t * @param {string} message What went wrong.\n\t\t * @return {void}\n\t\t */\n\t\tshowDictationError(message) {\n\t\t\tthis.dictationError = message\n\t\t\tif (this.dictationErrorTimer !== null) {\n\t\t\t\tclearTimeout(this.dictationErrorTimer)\n\t\t\t}\n\t\t\tthis.dictationErrorTimer = setTimeout(() => {\n\t\t\t\tthis.dictationError = ''\n\t\t\t\tthis.dictationErrorTimer = null\n\t\t\t}, DICTATION_ERROR_TIMEOUT)\n\t\t},\n\n\t\t/**\n\t\t * (Re)start the silence countdown that releases the microphone.\n\t\t *\n\t\t * Called on every result — interim ones included, so a long sentence\n\t\t * keeps the mic open while the words are still arriving rather than\n\t\t * being cut off between clauses.\n\t\t *\n\t\t * ⚠️ ARMED BY SPEECH, NOT BY `start()`. Arming it when dictation begins\n\t\t * closes the microphone on somebody who pressed the button and then\n\t\t * spent four seconds deciding what to say — the exact moment the\n\t\t * feature exists to serve. Until the first result arrives the engine's\n\t\t * own `no-speech` error is the backstop, and it says something useful.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tarmSilenceTimer() {\n\t\t\tthis.clearSilenceTimer()\n\t\t\tif (this.dictationSilenceTimeout <= 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.silenceTimer = setTimeout(() => {\n\t\t\t\tthis.silenceTimer = null\n\t\t\t\t// Only the microphone is released. The text stays put.\n\t\t\t\tthis.stopDictation()\n\t\t\t\t// …unless this silence is the end of a conversational turn, which\n\t\t\t\t// is the ONE case where a pause sends — and the user pressed a\n\t\t\t\t// separate control to say so.\n\t\t\t\tthis.completeConversationTurn()\n\t\t\t}, this.dictationSilenceTimeout)\n\t\t},\n\n\t\t/**\n\t\t * Cancel a pending silence countdown.\n\t\t *\n\t\t * ⚠️ A LEFTOVER TIMER OUTLIVES THE DICTATION THAT ARMED IT and would\n\t\t * close the NEXT one mid-sentence, seconds after it started, with no\n\t\t * silence involved. So this is called from every path that ends a\n\t\t * dictation — stop, `onend`, `onerror`, unmount — not only the tidy one.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tclearSilenceTimer() {\n\t\t\tif (this.silenceTimer !== null) {\n\t\t\t\tclearTimeout(this.silenceTimer)\n\t\t\t\tthis.silenceTimer = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Start dictation, or stop it if already running.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttoggleDictation() {\n\t\t\t// The reason is shown rather than the press being ignored: a button\n\t\t\t// that does nothing teaches nothing, and this one has something\n\t\t\t// specific to say — that the agent forbids the fast engine and the\n\t\t\t// private one is down.\n\t\t\tif (this.dictationDecision.engine === SPEECH_OFF) {\n\t\t\t\tthis.showDictationError(this.cnTranslate(this.dictationDecision.reason))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.micIsOpen) {\n\t\t\t\tthis.stopDictation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.dictationDecision.engine === SPEECH_LOCAL) {\n\t\t\t\tthis.startLocalDictation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.startDictation()\n\t\t},\n\n\t\t/**\n\t\t * Start or end a hands-free conversation.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttoggleConversation() {\n\t\t\tif (this.conversing === true) {\n\t\t\t\tthis.endConversation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.dictationDecision.engine === SPEECH_OFF) {\n\t\t\t\tthis.showDictationError(this.cnTranslate(this.dictationDecision.reason))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.conversing = true\n\t\t\tthis.$emit('conversation-state', true)\n\t\t\tthis.beginConversationTurn()\n\t\t},\n\n\t\t/**\n\t\t * Stop conversing and release the microphone.\n\t\t *\n\t\t * ⚠️ The FIRST thing it does is clear the flag, before stopping\n\t\t * dictation. `stopDictation` runs the same paths a silence does, and\n\t\t * with the flag still set the engine's own stop event would be read as\n\t\t * \"your turn ended\" and send whatever was captured — so pressing \"end\n\t\t * conversation\" would post one last message on the way out.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tendConversation() {\n\t\t\tthis.conversing = false\n\t\t\tthis.$emit('conversation-state', false)\n\t\t\tthis.stopDictation()\n\t\t},\n\n\t\t/**\n\t\t * Open the microphone for the user's next turn.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tbeginConversationTurn() {\n\t\t\tif (this.conversing === false || this.disabled === true) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.dictationDecision.engine === SPEECH_LOCAL) {\n\t\t\t\tthis.startLocalDictation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.startDictation()\n\t\t},\n\n\t\t/**\n\t\t * Called by the panel once the agent has finished answering — and, when\n\t\t * the reply is spoken aloud, once it has finished being spoken.\n\t\t *\n\t\t * 🔴 THE MICROPHONE MUST NOT REOPEN WHILE THE AGENT IS TALKING. It would\n\t\t * record the reply through the speakers and hand it back as the user's\n\t\t * next turn, and with auto-send on a silence that becomes a conversation\n\t\t * the agent is having with itself. Which is why the resume is driven\n\t\t * from outside rather than from a timer in here: only the side that owns\n\t\t * the speaking knows when it stopped.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tresumeConversation() {\n\t\t\tthis.beginConversationTurn()\n\t\t},\n\n\t\t/**\n\t\t * End the user's turn: send what was heard.\n\t\t *\n\t\t * Nothing is sent when nothing was heard — an empty turn means the\n\t\t * microphone opened, caught silence and closed, which should leave the\n\t\t * conversation waiting rather than post a blank message.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcompleteConversationTurn() {\n\t\t\tif (this.conversing === false) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.isSendDisabled === true) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.handleSend()\n\t\t},\n\n\t\t/**\n\t\t * Dictate through the instance's own speech service.\n\t\t *\n\t\t * No partial text on the way — whisper answers a finished clip — so the\n\t\t * feedback is the recording state and then an explicit \"transcribing\"\n\t\t * one. The result is APPENDED to whatever is already in the box, the\n\t\t * same as the browser path, so dictating twice builds a message rather\n\t\t * than replacing it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstartLocalDictation() {\n\t\t\tif (this.disabled) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.dictationError = ''\n\t\t\tthis.localSession = createLocalDictation({\n\t\t\t\tsilenceTimeout: this.dictationSilenceTimeout,\n\t\t\t\ttranscribe: (blob) => this.uploadForTranscription(blob),\n\t\t\t\tonTranscript: (text) => {\n\t\t\t\t\tconst existing = this.inputText.trim()\n\t\t\t\t\tthis.inputText = (existing === '') ? text : `${existing} ${text}`\n\t\t\t\t\tthis.$nextTick(() => this.autoGrow())\n\t\t\t\t\tthis.$emit('dictation-complete', text)\n\t\t\t\t\t// The local engine has no silence event of its own to hang\n\t\t\t\t\t// this on — the transcript ARRIVING is the end of the turn,\n\t\t\t\t\t// seconds after the speaker actually stopped.\n\t\t\t\t\tthis.completeConversationTurn()\n\t\t\t\t},\n\t\t\t\tonError: (message) => {\n\t\t\t\t\tthis.showDictationError(this.cnTranslate(message))\n\t\t\t\t},\n\t\t\t\tonStateChange: (state) => {\n\t\t\t\t\tthis.localRecording = (state === 'recording')\n\t\t\t\t\tthis.transcribing = (state === 'transcribing')\n\t\t\t\t},\n\t\t\t})\n\t\t\tthis.localSession.start()\n\t\t},\n\n\t\t/**\n\t\t * Send a recorded clip to the backend for transcription.\n\t\t *\n\t\t * @param {Blob} blob The recorded audio.\n\t\t * @return {Promise<{text: string}>} The transcript.\n\t\t */\n\t\tasync uploadForTranscription(blob) {\n\t\t\tconst formData = new FormData()\n\t\t\tformData.append('audio', blob, 'dictation.webm')\n\t\t\t// The page's language, for the same reason the browser engine is\n\t\t\t// given it: auto-detection misfires on short utterances, and a\n\t\t\t// Dutch sentence detected as English comes back as nonsense rather\n\t\t\t// than as an error.\n\t\t\tif (typeof document !== 'undefined' && document.documentElement.lang) {\n\t\t\t\tformData.append('language', document.documentElement.lang)\n\t\t\t}\n\t\t\tconst response = await axios.post(speechTranscriptionsUrl(this.chatAppId), formData)\n\n\t\t\treturn (response && response.data) || { text: '' }\n\t\t},\n\n\t\t/**\n\t\t * Begin capturing speech into the message box.\n\t\t *\n\t\t * Interim results are shown as they arrive so the user can see it is\n\t\t * working — dictation with no visible feedback reads as broken. Whatever\n\t\t * was already typed is preserved and appended to, rather than replaced.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstartDictation() {\n\t\t\tif (!this.speechSupported || this.disabled) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.dictationError = ''\n\t\t\tconst Recognition = window.SpeechRecognition || window.webkitSpeechRecognition\n\t\t\tconst recognition = new Recognition()\n\t\t\trecognition.continuous = true\n\t\t\trecognition.interimResults = true\n\t\t\t// Follow the page's language rather than hardcoding one: this ships to\n\t\t\t// Dutch and English instances alike.\n\t\t\trecognition.lang = (typeof document !== 'undefined' && document.documentElement.lang)\n\t\t\t\t? document.documentElement.lang\n\t\t\t\t: 'en-US'\n\n\t\t\tthis.textBeforeDictation = this.inputText\n\n\t\t\trecognition.onresult = (event) => {\n\t\t\t\tlet finalText = ''\n\t\t\t\tlet interimText = ''\n\t\t\t\tfor (let i = event.resultIndex; i < event.results.length; i++) {\n\t\t\t\t\tconst result = event.results[i]\n\t\t\t\t\tif (result.isFinal) {\n\t\t\t\t\t\tfinalText += result[0].transcript\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinterimText += result[0].transcript\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (finalText !== '') {\n\t\t\t\t\tthis.textBeforeDictation = `${this.textBeforeDictation}${finalText}`.replace(/\\s+/g, ' ')\n\t\t\t\t}\n\t\t\t\tthis.inputText = `${this.textBeforeDictation}${interimText}`.trimStart()\n\t\t\t\tthis.$nextTick(() => this.autoGrow())\n\t\t\t\tthis.armSilenceTimer()\n\t\t\t}\n\n\t\t\t// `onend` fires for a user stop AND for the engine giving up on\n\t\t\t// silence, so the button state is driven from here rather than from\n\t\t\t// the click — otherwise the button lies after an idle timeout.\n\t\t\trecognition.onend = () => {\n\t\t\t\tthis.clearSilenceTimer()\n\t\t\t\tthis.listening = false\n\t\t\t\tthis.recognition = null\n\t\t\t}\n\n\t\t\t// SHOW the failure. Silently resetting `listening` is what made the\n\t\t\t// button look inert: the user pressed it, nothing changed, and there\n\t\t\t// was nowhere to find out why. `not-allowed` is the common one — an\n\t\t\t// insecure origin or a denied microphone permission.\n\t\t\trecognition.onerror = (event) => {\n\t\t\t\tconst code = (event && event.error) ? String(event.error) : 'unknown'\n\t\t\t\tthis.showDictationError((code === 'not-allowed')\n\t\t\t\t\t? this.cnTranslate('Microphone blocked — allow access, or use https')\n\t\t\t\t\t: this.cnTranslate('Dictation stopped: ') + code)\n\t\t\t\tthis.clearSilenceTimer()\n\t\t\t\tthis.listening = false\n\t\t\t\tthis.recognition = null\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\trecognition.start()\n\t\t\t\tthis.recognition = recognition\n\t\t\t\tthis.listening = true\n\t\t\t} catch (e) {\n\t\t\t\t// `start()` throws if called twice, and on some browsers when the\n\t\t\t\t// origin is not permitted. Either way say so rather than resetting\n\t\t\t\t// in silence.\n\t\t\t\tthis.showDictationError(this.cnTranslate('Dictation could not start: ') + (e.message || 'unknown'))\n\t\t\t\tthis.listening = false\n\t\t\t\tthis.recognition = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Stop dictation and release the microphone.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstopDictation() {\n\t\t\tthis.clearSilenceTimer()\n\t\t\tif (this.localSession !== null) {\n\t\t\t\t// The local session owns its own teardown, including releasing\n\t\t\t\t// the microphone BEFORE the transcript request goes out.\n\t\t\t\tthis.localSession.stop()\n\t\t\t\tthis.localSession = null\n\t\t\t\tthis.localRecording = false\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!this.recognition) {\n\t\t\t\tthis.listening = false\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tthis.recognition.stop()\n\t\t\t} catch {\n\t\t\t\t// Already stopped; nothing to release.\n\t\t\t}\n\t\t\tthis.recognition = null\n\t\t\tthis.listening = false\n\t\t},\n\n\t\thandleEnter() {\n\t\t\tif (this.disabled || this.isSendDisabled) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.handleSend()\n\t\t},\n\n\t\thandleShiftEnter() {\n\t\t\t// Default browser behaviour inserts a newline — we don't need to prevent it.\n\t\t\t// But we do need to trigger autoGrow after the character is inserted.\n\t\t\tthis.$nextTick(() => this.autoGrow())\n\t\t},\n\n\t\thandleSend() {\n\t\t\tif (this.disabled || this.isSendDisabled) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst text = this.inputText.trim()\n\t\t\tconst attachments = this.attachments.slice()\n\t\t\tthis.inputText = ''\n\t\t\tthis.attachments = []\n\t\t\tthis.uploadError = ''\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.autoGrow()\n\t\t\t})\n\t\t\tthis.$emit('send', { text, attachments })\n\t\t},\n\n\t\tautoGrow() {\n\t\t\tconst el = this.$refs.textarea\n\t\t\tif (!el) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Reset height first so shrinking works\n\t\t\tel.style.height = 'auto'\n\t\t\t// Clamp to 6-line max (~1.5em per line + padding)\n\t\t\tconst maxHeight = parseInt(getComputedStyle(el).lineHeight || '24', 10) * 6 + 24\n\t\t\tel.style.height = Math.min(el.scrollHeight, maxHeight) + 'px'\n\t\t},\n\n\t\t/** Focus the textarea — called by the parent panel on open. */\n\t\tfocus() {\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.textarea) {\n\t\t\t\t\tthis.$refs.textarea.focus()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/** Open the hidden file input in response to the paperclip button. */\n\t\topenFilePicker() {\n\t\t\tif (this.disabled || this.uploading) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.uploadError = ''\n\t\t\tif (this.fileInputEl) {\n\t\t\t\tthis.fileInputEl.click()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Upload the picked file to the chat backend's attachments endpoint and,\n\t\t * on success, add it as a removable chip. Surfaces the backend's\n\t\t * `{ error }` message inline on a 400 rejection (oversized, or not\n\t\t * text-decodable) instead of silently dropping the file.\n\t\t *\n\t\t * @param {Event} event The file input's change event.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onFileSelected(event) {\n\t\t\tconst file = event.target && event.target.files && event.target.files[0]\n\t\t\tevent.target.value = ''\n\t\t\tif (!file) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.uploading = true\n\t\t\tthis.uploadError = ''\n\t\t\ttry {\n\t\t\t\tconst formData = new FormData()\n\t\t\t\tformData.append('file', file)\n\t\t\t\tconst response = await axios.post(attachmentsUrl(this.chatAppId), formData)\n\t\t\t\tconst { path, name } = response.data || {}\n\t\t\t\tthis.attachments.push({ path, name: name || file.name })\n\t\t\t} catch (err) {\n\t\t\t\tconst backendMessage = err && err.response && err.response.status === 400\n\t\t\t\t\t? err.response.data && err.response.data.error\n\t\t\t\t\t: null\n\t\t\t\tthis.uploadError = backendMessage || this.cnTranslate('Could not attach file')\n\t\t\t} finally {\n\t\t\t\tthis.uploading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Pick files already in Nextcloud Files and add each as a chip carrying\n\t\t * its file id; they are sent by id and never uploaded. A dismissed\n\t\t * picker (which rejects in some dialog versions) is a no-op.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync chooseFromFiles() {\n\t\t\tif (this.disabled || this.uploading) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.uploadError = ''\n\t\t\ttry {\n\t\t\t\tconst picker = getFilePickerBuilder(this.cnTranslate('Choose from Files'))\n\t\t\t\t\t.setMultiSelect(true)\n\t\t\t\t\t.setType(FilePickerType.Choose)\n\t\t\t\t\t.allowDirectories(false)\n\t\t\t\t\t.setModal(true)\n\t\t\t\t\t.build()\n\t\t\t\tconst nodes = await picker.pickNodes()\n\t\t\t\tfor (const node of (Array.isArray(nodes) ? nodes : [])) {\n\t\t\t\t\tconst fileId = node.fileid ?? node.attributes?.fileid\n\t\t\t\t\tconst path = node.path || ''\n\t\t\t\t\tif (fileId === null || fileId === undefined || this.attachments.some((a) => a.fileId === fileId)) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tthis.attachments.push({ fileId, path, name: node.basename || path.split('/').pop() })\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.debug('[CnAiInput] file picker closed', e)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove a pending attachment chip before it's sent.\n\t\t *\n\t\t * @param {number} index Index into `attachments`.\n\t\t */\n\t\tremoveAttachment(index) {\n\t\t\tthis.attachments.splice(index, 1)\n\t\t},\n\t},\n}\n</script>\n\n<style>\n.cn-ai-input {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 8px 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-ai-input__error {\n\tmargin: 0;\n}\n\n.cn-ai-input__chips {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 6px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-ai-input__chip {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 4px;\n\tmax-width: 220px;\n\tpadding: 4px 8px;\n\tborder-radius: var(--border-radius-pill, 16px);\n\tbackground: var(--color-background-hover);\n\tfont-size: 13px;\n}\n\n.cn-ai-input__chip-icon {\n\tflex-shrink: 0;\n\topacity: 0.7;\n}\n\n.cn-ai-input__chip-name {\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n\n.cn-ai-input__chip-remove {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: none;\n\tbackground: transparent;\n\tcolor: inherit;\n\tcursor: pointer;\n\topacity: 0.7;\n}\n\n/* `:focus-visible` and `:disabled` are declared BEFORE the compound\n `:hover:not(:disabled)` rule: stylelint's no-descending-specificity wants\n lower-specificity selectors first, and `:hover:not(:disabled)` outranks\n both. Ordering only — the cascade result is unchanged. */\n.cn-ai-input__chip-remove:focus-visible {\n\topacity: 1;\n}\n\n.cn-ai-input__chip-remove:disabled {\n\tcursor: not-allowed;\n}\n\n.cn-ai-input__chip-remove:hover:not(:disabled) {\n\topacity: 1;\n}\n\n.cn-ai-input__row {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: flex-end;\n}\n\n/* `stacked`: in a card the box keeps the line, dictation and attach wrap\n under it (DqZaakAssistent \"Vraag iets over deze zaak\" + \"Vragen\"). */\n.cn-ai-input--stacked {\n\tpadding: 12px 18px;\n}\n\n.cn-ai-input--stacked .cn-ai-input__row {\n\tflex-wrap: wrap;\n\talign-items: center;\n}\n\n.cn-ai-input--stacked .cn-ai-input__textarea {\n\torder: -2;\n\tflex: 1 1 calc(100% - 104px);\n\tmin-width: 0;\n\tmin-height: 40px;\n}\n\n.cn-ai-input--stacked .cn-ai-input__send-button {\n\torder: -1;\n}\n\n.cn-ai-input__file-input {\n\tdisplay: none;\n}\n\n/* Mic matches the paperclip exactly — they are peers in the row, and any\n difference in size or weight would read as one being the primary action. */\n.cn-ai-input__mic-button {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 36px;\n\theight: 36px;\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n/* Declared BEFORE the hover rule below, which is more specific\n (`:hover:not(:disabled)`). Source order has to follow specificity here or the\n cascade's outcome depends on which rule happens to be written last — the\n thing `no-descending-specificity` exists to stop. */\n.cn-ai-input__mic-button:disabled {\n\topacity: .5;\n\tcursor: default;\n}\n\n.cn-ai-input__mic-button:hover:not(:disabled) {\n\tbackground: var(--color-background-hover);\n}\n\n/* Recording is a STATE, not a hover: it stays visible while the user speaks and\n looks away from the button. Error colour because it is the \"something is\n live\" signal, and the icon fills in beside it — it does NOT swap to a\n struck-through mic, which is what this comment used to describe and what made\n a listening composer look muted. */\n.cn-ai-input__mic-button--recording {\n\tborder-color: var(--color-error);\n\tbackground: var(--color-error);\n\tcolor: var(--color-primary-text, #fff);\n}\n\n/* 🔴 THE BLOCKED LOOK THE COMMENT ABOVE THE BUTTON ALREADY PROMISED.\n `cn-ai-input__mic-button--blocked` was bound in the template and styled\n NOWHERE, so a microphone that cannot run — an agent pinned to the private\n engine while the speech service is down, or a browser with no recognition —\n looked exactly like a working one until you hovered it for the tooltip. A\n class set and never read is a comment, not a state.\n\n ⚠️ Muted rather than `disabled`, and NOT `pointer-events: none`. The button\n deliberately keeps a live click handler: a natively disabled control\n suppresses hover, so its `title` can never appear and it refuses without ever\n saying why. It must stay clickable in order to explain itself. */\n.cn-ai-input__mic-button--blocked {\n\topacity: .5;\n\tcursor: not-allowed;\n}\n\n/* The conversation control sits beside the mic and matches it in weight —\n neither is the primary action, and a bigger one would suggest the hands-free\n mode is the normal way to use the composer rather than a deliberate choice. */\n.cn-ai-input__converse-button {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 36px;\n\theight: 36px;\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-ai-input__converse-button:disabled {\n\topacity: .5;\n\tcursor: default;\n}\n\n.cn-ai-input__converse-button:hover:not(:disabled) {\n\tbackground: var(--color-background-hover);\n}\n\n/* Primary rather than error colour: a live conversation is a mode the user is\n in, not a recording warning — the microphone beside it carries that. */\n.cn-ai-input__converse-button--active {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n}\n\n.cn-ai-input__attach-menu {\n\tflex: 0 0 auto;\n}\n\n.cn-ai-input__attach-button {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 36px;\n\theight: 36px;\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-ai-input__attach-button:hover:not(:disabled) {\n\tbackground: var(--color-background-hover);\n}\n\n/* stylelint-disable-next-line no-descending-specificity */\n.cn-ai-input__attach-button:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n/* stylelint-disable-next-line no-descending-specificity */\n.cn-ai-input__attach-button:disabled {\n\topacity: 0.6;\n\tcursor: not-allowed;\n}\n\n.cn-ai-input__textarea {\n\tflex: 1;\n\tmin-height: 36px;\n\tmax-height: calc(6 * 1.5em + 24px);\n\tpadding: 8px;\n\tresize: none;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tfont-family: inherit;\n\tfont-size: inherit;\n\tline-height: 1.5;\n\toverflow-y: auto;\n}\n\n.cn-ai-input__textarea:focus {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 0;\n\tborder-color: var(--color-primary-element);\n}\n\n.cn-ai-input__textarea:disabled {\n\topacity: 0.6;\n\tcursor: not-allowed;\n}\n\n.cn-ai-input__send-button {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 36px;\n\theight: 36px;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n\tcursor: pointer;\n}\n\n.cn-ai-input__send-button--labelled {\n\twidth: auto;\n\tmin-height: 40px;\n\tpadding: 0 14px;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\twhite-space: nowrap;\n}\n\n/* server.css styles every button at (0,2,1), its disabled state too (grey\n ground, 15px, bold, its own margin); the element and the doubled class\n match that and load later, so the send button keeps its primary look and\n the labelled one its 40px 14px/600 (DqZaakAssistent \"Vragen\"). */\nbutton.cn-ai-input__send-button.cn-ai-input__send-button {\n\tmargin: 0;\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n}\n\nbutton.cn-ai-input__send-button--labelled.cn-ai-input__send-button--labelled {\n\theight: 40px;\n\tmin-height: 40px;\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\nbutton.cn-ai-input__send-button.cn-ai-input__send-button:hover:not(:disabled) {\n\tbackground: var(--color-primary-element-hover, var(--color-primary-element));\n}\n\n.cn-ai-input__send-button:hover:not(:disabled) {\n\tbackground: var(--color-primary-element-hover, var(--color-primary-element));\n}\n\n/* stylelint-disable-next-line no-descending-specificity */\n.cn-ai-input__send-button:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n/* stylelint-disable-next-line no-descending-specificity */\n.cn-ai-input__send-button:disabled {\n\topacity: 0.6;\n\tcursor: not-allowed;\n}\n</style>\n"],"names":["_normalizeClass","_createBlock","_Fragment","_renderList","_toDisplayString","_createVNode","_createElementVNode","_createElementBlock","_createTextVNode"],"mappings":";;;;;eAmEc,EAAC,mBAAmB;;AAMxB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAyB,GAAA;;AAYlC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAA,kBAAA,GAAA;;;;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sourcesContent":["<!--\n CnAiInput — multi-line textarea + send button for the AI Chat Companion.\n\n - Auto-grows vertically up to ~6 lines, then scrolls internally.\n - Enter sends and clears; Shift+Enter inserts a newline.\n - Disabled prop disables both controls; send button shows NcLoadingIcon.\n - Send button disabled when the textarea is empty/whitespace-only AND no\n attachment has been added (an attachment-only send is allowed).\n - Attach button (paperclip) is a menu: Upload from device opens a hidden\n file input; Choose from Files opens the Nextcloud file picker and adds the\n chosen files as chips carrying `{ fileId, path, name }`, sent by id with no\n upload. On the device path the picked file is\n uploaded immediately as multipart/form-data (field `file`) to the chat\n backend's attachments endpoint (see composables/aiChatConfig.js\n `attachmentsUrl()`), which text-decodes and stores it, returning\n `{ path, name }`. Successful uploads render as removable chips above the\n textarea; a 400 rejection (oversized or non-UTF-8 binary) surfaces the\n backend's `{ error }` message inline via NcNoteCard rather than being\n dropped silently.\n - On send, the accumulated attachment refs are emitted alongside the text\n as `{ text, attachments }` and cleared (mirrors the existing optimistic\n textarea clear — this component fires the `send` event and does not wait\n for the parent's async request to resolve before clearing either).\n-->\n<template>\n\t<div class=\"cn-ai-input\" :class=\"{ 'cn-ai-input--stacked': stacked }\" data-testid=\"cn-ai-input\">\n\t\t<NcNoteCard\n\t\t\tv-if=\"uploadError\"\n\t\t\ttype=\"error\"\n\t\t\tclass=\"cn-ai-input__error\"\n\t\t\tdata-testid=\"cn-ai-input-error\">\n\t\t\t{{ uploadError }}\n\t\t</NcNoteCard>\n\t\t<NcNoteCard\n\t\t\tv-if=\"dictationError\"\n\t\t\ttype=\"warning\"\n\t\t\tclass=\"cn-ai-input__error\"\n\t\t\tdata-testid=\"cn-ai-input-dictation-error\">\n\t\t\t{{ dictationError }}\n\t\t</NcNoteCard>\n\t\t<ul\n\t\t\tv-if=\"attachments.length\"\n\t\t\tclass=\"cn-ai-input__chips\"\n\t\t\tdata-testid=\"cn-ai-input-chips\">\n\t\t\t<li\n\t\t\t\tv-for=\"(attachment, index) in attachments\"\n\t\t\t\t:key=\"attachment.fileId !== undefined ? 'f' + attachment.fileId : attachment.path\"\n\t\t\t\tclass=\"cn-ai-input__chip\">\n\t\t\t\t<Paperclip :size=\"14\" class=\"cn-ai-input__chip-icon\" />\n\t\t\t\t<span class=\"cn-ai-input__chip-name\">{{ attachment.name }}</span>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-ai-input__chip-remove\"\n\t\t\t\t\t:aria-label=\"cnTranslate('Remove attachment')\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:data-testid=\"'cn-ai-input-chip-remove-' + index\"\n\t\t\t\t\t@click=\"removeAttachment(index)\">\n\t\t\t\t\t<Close :size=\"14\" />\n\t\t\t\t</button>\n\t\t\t</li>\n\t\t</ul>\n\t\t<div class=\"cn-ai-input__row\">\n\t\t\t<!--\n\t\t\t Dictation sits LEFT of the paperclip: both are ways of getting content\n\t\t\t into the message, and speech is the one reached for first when typing\n\t\t\t is the obstacle.\n\n\t\t\t Rendered only where the browser can actually do it. A mic button that\n\t\t\t silently does nothing is worse than no mic button, and support is\n\t\t\t genuinely partial (WebKit-prefixed in Safari, absent in Firefox).\n\t\t\t-->\n\t\t\t<!--\n\t\t\t ⚠️ NOT the `disabled` attribute when dictation is merely blocked.\n\t\t\t Browsers suppress hover events on a disabled control, so its\n\t\t\t `title` tooltip can never appear — the button would look dead and\n\t\t\t still refuse to say why, which is the bug this is fixing.\n\n\t\t\t So: `aria-disabled` for assistive tech, a class for the muted look,\n\t\t\t and a live click handler that puts the reason on screen. The real\n\t\t\t `disabled` attribute is still used for the one case that is not a\n\t\t\t capability problem — a turn already streaming.\n\t\t\t-->\n\t\t\t<button\n\t\t\t\tv-if=\"speechButtonVisible\"\n\t\t\t\tclass=\"cn-ai-input__mic-button\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'cn-ai-input__mic-button--recording': micIsOpen,\n\t\t\t\t\t'cn-ai-input__mic-button--transcribing': transcribing,\n\t\t\t\t\t'cn-ai-input__mic-button--blocked': speechBlockedReason !== '',\n\t\t\t\t}\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t:aria-label=\"micButtonLabel\"\n\t\t\t\t:title=\"micButtonLabel\"\n\t\t\t\t:aria-pressed=\"micIsOpen ? 'true' : 'false'\"\n\t\t\t\t:aria-disabled=\"speechBlockedReason !== '' ? 'true' : 'false'\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:data-engine=\"dictationDecision.engine\"\n\t\t\t\tdata-testid=\"cn-ai-input-mic\"\n\t\t\t\t@click=\"toggleDictation\">\n\t\t\t\t<!--\n\t\t\t\t 🔴 THE FILLED MIC MEANS LIVE. THIS WAS THE OTHER WAY AROUND.\n\t\t\t\t A struck-through mic (`MicrophoneOff`) rendered WHILE\n\t\t\t\t RECORDING, on the reasoning that a button should picture the\n\t\t\t\t action its click performs. Every other product on the user's\n\t\t\t\t machine uses that glyph for \"muted\", so the composer read as\n\t\t\t\t off while it was listening and on while it was idle —\n\t\t\t\t reported from a live session where the reporter was watching\n\t\t\t\t their own words appear under an icon saying the mic was off.\n\n\t\t\t\t A control's icon states what IS, not what clicking does; the\n\t\t\t\t label and `aria-pressed` carry the action.\n\n\t\t\t\t Outline vs filled rather than a colour change alone, so the\n\t\t\t\t two states are distinguishable without perceiving the red\n\t\t\t\t (WCAG 2.2 SC 1.4.1 Use of Colour).\n\t\t\t\t-->\n\t\t\t\t<!-- The clip is recorded; this is the wait for the transcript.\n\t\t\t\t The microphone is already closed, so showing the recording\n\t\t\t\t state through it would be the same lie in a new place. -->\n\t\t\t\t<NcLoadingIcon\n\t\t\t\t\tv-if=\"transcribing\"\n\t\t\t\t\t:size=\"20\" />\n\t\t\t\t<MicrophoneIcon\n\t\t\t\t\tv-else-if=\"micIsOpen\"\n\t\t\t\t\t:size=\"20\" />\n\t\t\t\t<MicrophoneOutline\n\t\t\t\t\tv-else\n\t\t\t\t\t:size=\"20\" />\n\t\t\t</button>\n\t\t\t<!--\n\t\t\t Conversation — a SEPARATE control from the microphone, offered only\n\t\t\t where the agent allows it. Same reason it is a separate icon:\n\t\t\t pressing \"dictate\" must never post a message by itself, and\n\t\t\t pressing \"converse\" is the act of agreeing that it will.\n\t\t\t-->\n\t\t\t<button\n\t\t\t\tv-if=\"conversationButtonVisible\"\n\t\t\t\tclass=\"cn-ai-input__converse-button\"\n\t\t\t\t:class=\"{ 'cn-ai-input__converse-button--active': conversing }\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t:aria-label=\"converseButtonLabel\"\n\t\t\t\t:title=\"converseButtonLabel\"\n\t\t\t\t:aria-pressed=\"conversing ? 'true' : 'false'\"\n\t\t\t\t:disabled=\"disabled && conversing === false\"\n\t\t\t\tdata-testid=\"cn-ai-input-converse\"\n\t\t\t\t@click=\"toggleConversation\">\n\t\t\t\t<Headset\n\t\t\t\t\tv-if=\"conversing\"\n\t\t\t\t\t:size=\"20\" />\n\t\t\t\t<HeadsetOff\n\t\t\t\t\tv-else\n\t\t\t\t\t:size=\"20\" />\n\t\t\t</button>\n\t\t\t<!-- The paperclip is a small menu: upload from the device (the\n\t\t\t hidden file input below) or choose files already in Files. -->\n\t\t\t<NcActions\n\t\t\t\tclass=\"cn-ai-input__attach-menu\"\n\t\t\t\t:aria-label=\"cnTranslate('Attach file')\"\n\t\t\t\t:disabled=\"disabled || uploading\"\n\t\t\t\t:forceMenu=\"true\"\n\t\t\t\tdata-testid=\"cn-ai-input-attach\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<NcLoadingIcon v-if=\"uploading\" :size=\"20\" />\n\t\t\t\t\t<Paperclip v-else :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t<NcActionButton\n\t\t\t\t\t:closeAfterClick=\"true\"\n\t\t\t\t\tdata-testid=\"cn-ai-input-attach-upload\"\n\t\t\t\t\t@click=\"openFilePicker\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<Upload :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ cnTranslate('Upload from device') }}\n\t\t\t\t</NcActionButton>\n\t\t\t\t<NcActionButton\n\t\t\t\t\t:closeAfterClick=\"true\"\n\t\t\t\t\tdata-testid=\"cn-ai-input-attach-files\"\n\t\t\t\t\t@click=\"chooseFromFiles\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<FolderOutline :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ cnTranslate('Choose from Files') }}\n\t\t\t\t</NcActionButton>\n\t\t\t</NcActions>\n\t\t\t<!-- `:ref`, not `ref` — a fully static input with a cached handler\n\t\t\t is hoisted to module scope, and a hoisted vnode's ref has no\n\t\t\t owner, which throws in production builds where Vue's guard is\n\t\t\t compiled out. See CnFilesTab for the full account. -->\n\t\t\t<input\n\t\t\t\t:ref=\"fileInputRef\"\n\t\t\t\ttype=\"file\"\n\t\t\t\tclass=\"cn-ai-input__file-input\"\n\t\t\t\tdata-testid=\"cn-ai-input-file\"\n\t\t\t\t@change=\"onFileSelected\">\n\t\t\t<textarea\n\t\t\t\tref=\"textarea\"\n\t\t\t\tv-model=\"inputText\"\n\t\t\t\tclass=\"cn-ai-input__textarea\"\n\t\t\t\t:aria-label=\"cnTranslate('Message input')\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:placeholder=\"placeholder || cnTranslate('Message input')\"\n\t\t\t\trows=\"1\"\n\t\t\t\tdata-testid=\"cn-ai-input-textarea\"\n\t\t\t\t@keydown.enter.exact.prevent=\"handleEnter\"\n\t\t\t\t@keydown.shift.enter.exact=\"handleShiftEnter\"\n\t\t\t\t@input=\"autoGrow\" />\n\t\t\t<button\n\t\t\t\tclass=\"cn-ai-input__send-button\"\n\t\t\t\t:class=\"{ 'cn-ai-input__send-button--labelled': sendLabel }\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t:aria-label=\"sendLabel ? null : cnTranslate('Send message')\"\n\t\t\t\t:disabled=\"disabled || isSendDisabled\"\n\t\t\t\tdata-testid=\"cn-ai-input-send\"\n\t\t\t\t@click=\"handleSend\">\n\t\t\t\t<NcLoadingIcon\n\t\t\t\t\tv-if=\"disabled\"\n\t\t\t\t\t:size=\"20\" />\n\t\t\t\t<template v-else-if=\"sendLabel\">\n\t\t\t\t\t{{ sendLabel }}\n\t\t\t\t</template>\n\t\t\t\t<Send\n\t\t\t\t\tv-else\n\t\t\t\t\t:size=\"20\" />\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { NcActionButton, NcActions, NcLoadingIcon, NcNoteCard } from '@nextcloud/vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport FolderOutline from 'vue-material-design-icons/FolderOutline.vue'\nimport Headset from 'vue-material-design-icons/Headset.vue'\nimport HeadsetOff from 'vue-material-design-icons/HeadsetOff.vue'\nimport MicrophoneIcon from 'vue-material-design-icons/Microphone.vue'\nimport MicrophoneOutline from 'vue-material-design-icons/MicrophoneOutline.vue'\nimport Paperclip from 'vue-material-design-icons/Paperclip.vue'\nimport Send from 'vue-material-design-icons/Send.vue'\nimport Upload from 'vue-material-design-icons/Upload.vue'\nimport { attachmentsUrl, DEFAULT_CHAT_APP_ID, speechTranscriptionsUrl } from '../../composables/aiChatConfig.js'\nimport { createLocalDictation } from '../../composables/aiLocalDictation.js'\nimport {\n\tbrowserRecognitionUsable,\n\tbrowserRecordingUsable,\n\tresolveDictationEngine,\n\tSPEECH_AUTO,\n\tSPEECH_LOCAL,\n\tSPEECH_OFF,\n} from '../../composables/aiSpeechPolicy.js'\nimport { libraryTranslate } from '../../utils/libraryTranslate.js'\n\n/** How long a dictation failure stays on screen, in ms. */\nconst DICTATION_ERROR_TIMEOUT = 6000\n\nexport default {\n\tname: 'CnAiInput',\n\n\tcomponents: {\n\t\tNcActionButton,\n\t\tNcActions,\n\t\tFolderOutline,\n\t\tUpload,\n\t\tNcLoadingIcon,\n\t\tNcNoteCard,\n\t\tSend,\n\t\tPaperclip,\n\t\tClose,\n\t\tMicrophoneIcon,\n\t\tMicrophoneOutline,\n\t\tHeadset,\n\t\tHeadsetOff,\n\t},\n\n\tinject: {\n\t\tcnTranslate: { default: () => libraryTranslate },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Whether the input controls are disabled (e.g. while streaming).\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The textarea's placeholder, already translated; '' keeps \"Message input\". */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A label on the send button, already translated; '' draws the send icon. */\n\t\tsendLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The narrow layout of a card: the text box and the send button on the\n\t\t * first line, dictation and attach on a line under it.\n\t\t */\n\t\tstacked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Backend app id the attach control uploads files to\n\t\t * (`POST /index.php/apps/{chatAppId}/api/chat/attachments`). See\n\t\t * composables/aiChatConfig.js `attachmentsUrl()`.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tchatAppId: {\n\t\t\ttype: String,\n\t\t\tdefault: DEFAULT_CHAT_APP_ID,\n\t\t},\n\n\t\t/**\n\t\t * How long a silence may last during dictation before the microphone is\n\t\t * released, in ms. `0` disables the timer and leaves the mic open until\n\t\t * the user stops it or the engine gives up on its own.\n\t\t *\n\t\t * Releasing the mic is ALL this does — the transcript stays in the box\n\t\t * for the user to read, edit and send. Dictation that posts by itself\n\t\t * turns a pause for thought into a sent message, and there is no\n\t\t * unsending. Conversation mode is where auto-send belongs, behind its\n\t\t * own control that the user chose to press.\n\t\t *\n\t\t * Per-agent, because the right pause length is a property of the work:\n\t\t * dictating a case note is not the same rhythm as answering a question.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tdictationSilenceTimeout: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2500,\n\t\t},\n\n\t\t/**\n\t\t * Which engine this agent's dictation may use: `auto`, `browser`,\n\t\t * `local` or `off`. Comes from the agent's `voiceInputEngine`.\n\t\t *\n\t\t * 🔴 `local` MEANS ONLY LOCAL. It is not a preference to be abandoned\n\t\t * when the instance's speech service is down — an agent is set to it\n\t\t * because its subject matter must not reach a cloud service, and the\n\t\t * browser engine IS a cloud service in Chrome, Edge and Safari alike.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tspeechInputEngine: {\n\t\t\ttype: String,\n\t\t\tdefault: SPEECH_AUTO,\n\t\t},\n\n\t\t/**\n\t\t * Whether the instance's own speech service answered its capability\n\t\t * probe. Passed in rather than probed here so one panel makes one call\n\t\t * for every composer it owns.\n\t\t *\n\t\t * ⚠️ Defaults to FALSE, so an app that does not probe never offers a\n\t\t * private engine it has not confirmed. Wrong in the safe direction: the\n\t\t * cost is the browser engine where local would have worked, not audio\n\t\t * leaving an instance that thought it was private.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tlocalSpeechAvailable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Whether this agent offers hands-free conversation — a separate\n\t\t * control from the microphone, and deliberately so.\n\t\t *\n\t\t * Dictation and conversation are different acts. Dictating is writing\n\t\t * with your voice: the words land in the box and you decide when they\n\t\t * go. Conversing is talking to someone: your turn ends when you stop\n\t\t * speaking, and it is sent. Putting both on one button would mean every\n\t\t * dictated pause risks posting a half-finished thought, which is why\n\t\t * this is a second control the user chose to press.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tconversationEnabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: ['send', 'dictation-complete', 'conversation-state'],\n\n\tdata() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * The hidden file input, set by the template's function ref (kept\n\t\t\t * off `$refs` so the ref stays dynamic).\n\t\t\t *\n\t\t\t * @type {HTMLInputElement|null}\n\t\t\t */\n\t\t\tfileInputEl: null,\n\t\t\tinputText: '',\n\t\t\t/** Uploaded attachment refs: { path, name } — awaiting send. */\n\t\t\tattachments: [],\n\t\t\t/** Whether an upload request is in-flight. */\n\t\t\tuploading: false,\n\t\t\t/** Backend `{ error }` message from a rejected (400) upload, or ''. */\n\t\t\tuploadError: '',\n\t\t\t/** Whether dictation is currently capturing. */\n\t\t\tlistening: false,\n\t\t\t/** The live SpeechRecognition instance, or null when idle. */\n\t\t\trecognition: null,\n\t\t\t/** Text already in the box when dictation started, so it is not lost. */\n\t\t\ttextBeforeDictation: '',\n\t\t\t/** Timer that releases the mic after a silence. null when not armed. */\n\t\t\tsilenceTimer: null,\n\t\t\t/** Whether a hands-free conversation is running. */\n\t\t\tconversing: false,\n\t\t\t/** The local-engine session, or null when idle. */\n\t\t\tlocalSession: null,\n\t\t\t/** Whether the local engine is recording right now. */\n\t\t\tlocalRecording: false,\n\t\t\t/**\n\t\t\t * Whether a recorded clip is being transcribed.\n\t\t\t *\n\t\t\t * Its own state, not folded into `localRecording`: the microphone is\n\t\t\t * already closed by then, and showing \"recording\" through a\n\t\t\t * multi-second upload is the same lie the mic icon used to tell.\n\t\t\t */\n\t\t\ttranscribing: false,\n\t\t\t/** Last dictation failure, shown to the user. '' when none. */\n\t\t\tdictationError: '',\n\t\t\t/** Timer clearing that message, so it does not outlive its moment. */\n\t\t\tdictationErrorTimer: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether this browser can do speech recognition at all.\n\t\t *\n\t\t * Checked rather than assumed: Chrome and Safari expose it (Safari only\n\t\t * under the `webkit` prefix) and Firefox does not expose it at all.\n\t\t *\n\t\t * ⚠️ This answers \"is the BROWSER engine available\", which since the\n\t\t * per-agent policy landed is no longer the same question as \"may this\n\t\t * agent dictate\" — see `dictationDecision`. Used only by the browser\n\t\t * path's own guard.\n\t\t *\n\t\t * @return {boolean} true when a SpeechRecognition constructor exists.\n\t\t */\n\t\tspeechSupported() {\n\t\t\treturn browserRecognitionUsable()\n\t\t},\n\n\t\t/**\n\t\t * Why dictation cannot run here, or '' when it can.\n\t\t *\n\t\t * 🔴 The constructor EXISTING is not the capability. On an insecure\n\t\t * origin Chrome still exposes `webkitSpeechRecognition`, so a\n\t\t * constructor check passes, and then `start()` fires `onerror:\n\t\t * not-allowed` immediately — measured on this instance over http://,\n\t\t * where `isSecureContext` is false and `navigator.mediaDevices` is\n\t\t * undefined. The first version of this button did exactly that and\n\t\t * appeared to do nothing at all when pressed.\n\t\t *\n\t\t * Reported rather than hidden: the button vanishing reads as a missing\n\t\t * feature, while a disabled button that says why reads as a\n\t\t * deployment fact the user can act on (serve over https).\n\t\t *\n\t\t * @return {string} A reason to show, or '' when dictation is available.\n\t\t */\n\t\tspeechBlockedReason() {\n\t\t\tif (this.dictationDecision.engine === SPEECH_OFF) {\n\t\t\t\treturn this.cnTranslate(this.dictationDecision.reason)\n\t\t\t}\n\t\t\tif (typeof window !== 'undefined' && window.isSecureContext === false) {\n\t\t\t\treturn this.cnTranslate('Dictation needs a secure (https) connection')\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/**\n\t\t * Which engine this agent's dictation may use, and why not when it may not.\n\t\t *\n\t\t * The DECISION, not a preference — `startDictation` runs exactly what\n\t\t * this names. See composables/aiSpeechPolicy.js for the rule that matters:\n\t\t * an agent pinned to the private engine never falls back to the browser's,\n\t\t * because that fallback would send confidential audio to a cloud service.\n\t\t *\n\t\t * @return {{engine: string, reason: string}} The decision.\n\t\t */\n\t\tdictationDecision() {\n\t\t\treturn resolveDictationEngine(\n\t\t\t\t{ inputEngine: this.speechInputEngine },\n\t\t\t\t{\n\t\t\t\t\tbrowserUsable: browserRecognitionUsable(),\n\t\t\t\t\tlocalUsable: this.localSpeechAvailable === true && browserRecordingUsable(),\n\t\t\t\t},\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Whether the mic button is offered at all.\n\t\t *\n\t\t * ⚠️ HIDDEN ONLY WHEN THE AGENT SAYS SO. An unavailable engine still\n\t\t * renders the button, disabled and carrying its reason: a control that\n\t\t * vanishes reads as a missing feature, while one that says \"this agent\n\t\t * may only use the private speech service, and it is unavailable\" reads\n\t\t * as a fact somebody can act on. The exception is `off`, where the agent\n\t\t * has decided there is no dictation — then there is nothing to explain.\n\t\t *\n\t\t * @return {boolean} true when the button should render.\n\t\t */\n\t\tspeechButtonVisible() {\n\t\t\tif (this.speechInputEngine === SPEECH_OFF) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn this.dictationDecision.engine !== SPEECH_OFF\n\t\t\t\t|| this.dictationDecision.reason !== ''\n\t\t},\n\n\t\t/**\n\t\t * Whether dictation is currently running on either engine.\n\t\t *\n\t\t * @return {boolean} true while the microphone is open.\n\t\t */\n\t\tmicIsOpen() {\n\t\t\treturn this.listening === true || this.localRecording === true\n\t\t},\n\n\t\t/**\n\t\t * Whether the conversation control is offered.\n\t\t *\n\t\t * Both conditions matter: the agent has to allow it, AND there has to be\n\t\t * an engine that can hear you. A hands-free control on an agent with no\n\t\t * working microphone is a button that can only disappoint.\n\t\t *\n\t\t * @return {boolean} true when the control should render.\n\t\t */\n\t\tconversationButtonVisible() {\n\t\t\treturn this.conversationEnabled === true\n\t\t\t\t&& this.dictationDecision.engine !== SPEECH_OFF\n\t\t},\n\n\t\t/**\n\t\t * The conversation control's label.\n\t\t *\n\t\t * Says what pressing it will DO, including the part people need warning\n\t\t * about — that a pause sends the message.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\tconverseButtonLabel() {\n\t\t\treturn this.conversing === true\n\t\t\t\t? this.cnTranslate('End the spoken conversation')\n\t\t\t\t: this.cnTranslate('Talk to the agent — your turn is sent when you stop speaking')\n\t\t},\n\n\t\t/**\n\t\t * The mic button's label and tooltip.\n\t\t *\n\t\t * Names the ENGINE when dictation is idle and the private one would be\n\t\t * used, because \"which service is about to hear me\" is not something a\n\t\t * user can discover any other way — and the difference between the two\n\t\t * is whether their words leave the building.\n\t\t *\n\t\t * @return {string} The label.\n\t\t */\n\t\tmicButtonLabel() {\n\t\t\tif (this.speechBlockedReason !== '') {\n\t\t\t\treturn this.speechBlockedReason\n\t\t\t}\n\t\t\tif (this.transcribing === true) {\n\t\t\t\treturn this.cnTranslate('Transcribing…')\n\t\t\t}\n\t\t\tif (this.micIsOpen === true) {\n\t\t\t\treturn this.cnTranslate('Stop dictation')\n\t\t\t}\n\t\t\tif (this.dictationDecision.engine === SPEECH_LOCAL) {\n\t\t\t\treturn this.cnTranslate('Dictate message (private, on this instance)')\n\t\t\t}\n\t\t\treturn this.cnTranslate('Dictate message')\n\t\t},\n\n\t\tisTextEmpty() {\n\t\t\treturn !this.inputText || !this.inputText.trim()\n\t\t},\n\n\t\t/** Send is only blocked when there's neither text nor an attachment. */\n\t\tisSendDisabled() {\n\t\t\treturn this.isTextEmpty && this.attachments.length === 0\n\t\t},\n\t},\n\n\tbeforeUnmount() {\n\t\t// A recogniser outliving its component keeps the microphone open — the\n\t\t// indicator stays lit in the browser chrome with nothing on screen\n\t\t// explaining why.\n\t\tthis.conversing = false\n\t\tthis.stopDictation()\n\t\tif (this.dictationErrorTimer !== null) {\n\t\t\tclearTimeout(this.dictationErrorTimer)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Function ref for the hidden file input; a method so the binding is\n\t\t * stable across renders.\n\t\t *\n\t\t * @param {HTMLInputElement|null} el The element, or null on unmount.\n\t\t * @return {void}\n\t\t */\n\t\tfileInputRef(el) {\n\t\t\tthis.fileInputEl = el || null\n\t\t},\n\n\t\t/**\n\t\t * Show a dictation failure, and take it away again.\n\t\t *\n\t\t * A banner with no lifetime is a banner that becomes furniture: the\n\t\t * first version stayed on screen for the rest of the session, sitting\n\t\t * above the composer long after the moment it described, so it read as a\n\t\t * permanent state of the chat rather than as the result of a click.\n\t\t *\n\t\t * @param {string} message What went wrong.\n\t\t * @return {void}\n\t\t */\n\t\tshowDictationError(message) {\n\t\t\tthis.dictationError = message\n\t\t\tif (this.dictationErrorTimer !== null) {\n\t\t\t\tclearTimeout(this.dictationErrorTimer)\n\t\t\t}\n\t\t\tthis.dictationErrorTimer = setTimeout(() => {\n\t\t\t\tthis.dictationError = ''\n\t\t\t\tthis.dictationErrorTimer = null\n\t\t\t}, DICTATION_ERROR_TIMEOUT)\n\t\t},\n\n\t\t/**\n\t\t * (Re)start the silence countdown that releases the microphone.\n\t\t *\n\t\t * Called on every result — interim ones included, so a long sentence\n\t\t * keeps the mic open while the words are still arriving rather than\n\t\t * being cut off between clauses.\n\t\t *\n\t\t * ⚠️ ARMED BY SPEECH, NOT BY `start()`. Arming it when dictation begins\n\t\t * closes the microphone on somebody who pressed the button and then\n\t\t * spent four seconds deciding what to say — the exact moment the\n\t\t * feature exists to serve. Until the first result arrives the engine's\n\t\t * own `no-speech` error is the backstop, and it says something useful.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tarmSilenceTimer() {\n\t\t\tthis.clearSilenceTimer()\n\t\t\tif (this.dictationSilenceTimeout <= 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.silenceTimer = setTimeout(() => {\n\t\t\t\tthis.silenceTimer = null\n\t\t\t\t// Only the microphone is released. The text stays put.\n\t\t\t\tthis.stopDictation()\n\t\t\t\t// …unless this silence is the end of a conversational turn, which\n\t\t\t\t// is the ONE case where a pause sends — and the user pressed a\n\t\t\t\t// separate control to say so.\n\t\t\t\tthis.completeConversationTurn()\n\t\t\t}, this.dictationSilenceTimeout)\n\t\t},\n\n\t\t/**\n\t\t * Cancel a pending silence countdown.\n\t\t *\n\t\t * ⚠️ A LEFTOVER TIMER OUTLIVES THE DICTATION THAT ARMED IT and would\n\t\t * close the NEXT one mid-sentence, seconds after it started, with no\n\t\t * silence involved. So this is called from every path that ends a\n\t\t * dictation — stop, `onend`, `onerror`, unmount — not only the tidy one.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tclearSilenceTimer() {\n\t\t\tif (this.silenceTimer !== null) {\n\t\t\t\tclearTimeout(this.silenceTimer)\n\t\t\t\tthis.silenceTimer = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Start dictation, or stop it if already running.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttoggleDictation() {\n\t\t\t// The reason is shown rather than the press being ignored: a button\n\t\t\t// that does nothing teaches nothing, and this one has something\n\t\t\t// specific to say — that the agent forbids the fast engine and the\n\t\t\t// private one is down.\n\t\t\tif (this.dictationDecision.engine === SPEECH_OFF) {\n\t\t\t\tthis.showDictationError(this.cnTranslate(this.dictationDecision.reason))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.micIsOpen) {\n\t\t\t\tthis.stopDictation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.dictationDecision.engine === SPEECH_LOCAL) {\n\t\t\t\tthis.startLocalDictation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.startDictation()\n\t\t},\n\n\t\t/**\n\t\t * Start or end a hands-free conversation.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttoggleConversation() {\n\t\t\tif (this.conversing === true) {\n\t\t\t\tthis.endConversation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.dictationDecision.engine === SPEECH_OFF) {\n\t\t\t\tthis.showDictationError(this.cnTranslate(this.dictationDecision.reason))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.conversing = true\n\t\t\tthis.$emit('conversation-state', true)\n\t\t\tthis.beginConversationTurn()\n\t\t},\n\n\t\t/**\n\t\t * Stop conversing and release the microphone.\n\t\t *\n\t\t * ⚠️ The FIRST thing it does is clear the flag, before stopping\n\t\t * dictation. `stopDictation` runs the same paths a silence does, and\n\t\t * with the flag still set the engine's own stop event would be read as\n\t\t * \"your turn ended\" and send whatever was captured — so pressing \"end\n\t\t * conversation\" would post one last message on the way out.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tendConversation() {\n\t\t\tthis.conversing = false\n\t\t\tthis.$emit('conversation-state', false)\n\t\t\tthis.stopDictation()\n\t\t},\n\n\t\t/**\n\t\t * Open the microphone for the user's next turn.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tbeginConversationTurn() {\n\t\t\tif (this.conversing === false || this.disabled === true) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.dictationDecision.engine === SPEECH_LOCAL) {\n\t\t\t\tthis.startLocalDictation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.startDictation()\n\t\t},\n\n\t\t/**\n\t\t * Called by the panel once the agent has finished answering — and, when\n\t\t * the reply is spoken aloud, once it has finished being spoken.\n\t\t *\n\t\t * 🔴 THE MICROPHONE MUST NOT REOPEN WHILE THE AGENT IS TALKING. It would\n\t\t * record the reply through the speakers and hand it back as the user's\n\t\t * next turn, and with auto-send on a silence that becomes a conversation\n\t\t * the agent is having with itself. Which is why the resume is driven\n\t\t * from outside rather than from a timer in here: only the side that owns\n\t\t * the speaking knows when it stopped.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tresumeConversation() {\n\t\t\tthis.beginConversationTurn()\n\t\t},\n\n\t\t/**\n\t\t * End the user's turn: send what was heard.\n\t\t *\n\t\t * Nothing is sent when nothing was heard — an empty turn means the\n\t\t * microphone opened, caught silence and closed, which should leave the\n\t\t * conversation waiting rather than post a blank message.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcompleteConversationTurn() {\n\t\t\tif (this.conversing === false) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.isSendDisabled === true) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.handleSend()\n\t\t},\n\n\t\t/**\n\t\t * Dictate through the instance's own speech service.\n\t\t *\n\t\t * No partial text on the way — whisper answers a finished clip — so the\n\t\t * feedback is the recording state and then an explicit \"transcribing\"\n\t\t * one. The result is APPENDED to whatever is already in the box, the\n\t\t * same as the browser path, so dictating twice builds a message rather\n\t\t * than replacing it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstartLocalDictation() {\n\t\t\tif (this.disabled) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.dictationError = ''\n\t\t\tthis.localSession = createLocalDictation({\n\t\t\t\tsilenceTimeout: this.dictationSilenceTimeout,\n\t\t\t\ttranscribe: (blob) => this.uploadForTranscription(blob),\n\t\t\t\tonTranscript: (text) => {\n\t\t\t\t\tconst existing = this.inputText.trim()\n\t\t\t\t\tthis.inputText = (existing === '') ? text : `${existing} ${text}`\n\t\t\t\t\tthis.$nextTick(() => this.autoGrow())\n\t\t\t\t\tthis.$emit('dictation-complete', text)\n\t\t\t\t\t// The local engine has no silence event of its own to hang\n\t\t\t\t\t// this on — the transcript ARRIVING is the end of the turn,\n\t\t\t\t\t// seconds after the speaker actually stopped.\n\t\t\t\t\tthis.completeConversationTurn()\n\t\t\t\t},\n\t\t\t\tonError: (message) => {\n\t\t\t\t\tthis.showDictationError(this.cnTranslate(message))\n\t\t\t\t},\n\t\t\t\tonStateChange: (state) => {\n\t\t\t\t\tthis.localRecording = (state === 'recording')\n\t\t\t\t\tthis.transcribing = (state === 'transcribing')\n\t\t\t\t},\n\t\t\t})\n\t\t\tthis.localSession.start()\n\t\t},\n\n\t\t/**\n\t\t * Send a recorded clip to the backend for transcription.\n\t\t *\n\t\t * @param {Blob} blob The recorded audio.\n\t\t * @return {Promise<{text: string}>} The transcript.\n\t\t */\n\t\tasync uploadForTranscription(blob) {\n\t\t\tconst formData = new FormData()\n\t\t\tformData.append('audio', blob, 'dictation.webm')\n\t\t\t// The page's language, for the same reason the browser engine is\n\t\t\t// given it: auto-detection misfires on short utterances, and a\n\t\t\t// Dutch sentence detected as English comes back as nonsense rather\n\t\t\t// than as an error.\n\t\t\tif (typeof document !== 'undefined' && document.documentElement.lang) {\n\t\t\t\tformData.append('language', document.documentElement.lang)\n\t\t\t}\n\t\t\tconst response = await axios.post(speechTranscriptionsUrl(this.chatAppId), formData)\n\n\t\t\treturn (response && response.data) || { text: '' }\n\t\t},\n\n\t\t/**\n\t\t * Begin capturing speech into the message box.\n\t\t *\n\t\t * Interim results are shown as they arrive so the user can see it is\n\t\t * working — dictation with no visible feedback reads as broken. Whatever\n\t\t * was already typed is preserved and appended to, rather than replaced.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstartDictation() {\n\t\t\tif (!this.speechSupported || this.disabled) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.dictationError = ''\n\t\t\tconst Recognition = window.SpeechRecognition || window.webkitSpeechRecognition\n\t\t\tconst recognition = new Recognition()\n\t\t\trecognition.continuous = true\n\t\t\trecognition.interimResults = true\n\t\t\t// Follow the page's language rather than hardcoding one: this ships to\n\t\t\t// Dutch and English instances alike.\n\t\t\trecognition.lang = (typeof document !== 'undefined' && document.documentElement.lang)\n\t\t\t\t? document.documentElement.lang\n\t\t\t\t: 'en-US'\n\n\t\t\tthis.textBeforeDictation = this.inputText\n\n\t\t\trecognition.onresult = (event) => {\n\t\t\t\tlet finalText = ''\n\t\t\t\tlet interimText = ''\n\t\t\t\tfor (let i = event.resultIndex; i < event.results.length; i++) {\n\t\t\t\t\tconst result = event.results[i]\n\t\t\t\t\tif (result.isFinal) {\n\t\t\t\t\t\tfinalText += result[0].transcript\n\t\t\t\t\t} else {\n\t\t\t\t\t\tinterimText += result[0].transcript\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (finalText !== '') {\n\t\t\t\t\tthis.textBeforeDictation = `${this.textBeforeDictation}${finalText}`.replace(/\\s+/g, ' ')\n\t\t\t\t}\n\t\t\t\tthis.inputText = `${this.textBeforeDictation}${interimText}`.trimStart()\n\t\t\t\tthis.$nextTick(() => this.autoGrow())\n\t\t\t\tthis.armSilenceTimer()\n\t\t\t}\n\n\t\t\t// `onend` fires for a user stop AND for the engine giving up on\n\t\t\t// silence, so the button state is driven from here rather than from\n\t\t\t// the click — otherwise the button lies after an idle timeout.\n\t\t\trecognition.onend = () => {\n\t\t\t\tthis.clearSilenceTimer()\n\t\t\t\tthis.listening = false\n\t\t\t\tthis.recognition = null\n\t\t\t}\n\n\t\t\t// SHOW the failure. Silently resetting `listening` is what made the\n\t\t\t// button look inert: the user pressed it, nothing changed, and there\n\t\t\t// was nowhere to find out why. `not-allowed` is the common one — an\n\t\t\t// insecure origin or a denied microphone permission.\n\t\t\trecognition.onerror = (event) => {\n\t\t\t\tconst code = (event && event.error) ? String(event.error) : 'unknown'\n\t\t\t\tthis.showDictationError((code === 'not-allowed')\n\t\t\t\t\t? this.cnTranslate('Microphone blocked — allow access, or use https')\n\t\t\t\t\t: this.cnTranslate('Dictation stopped: ') + code)\n\t\t\t\tthis.clearSilenceTimer()\n\t\t\t\tthis.listening = false\n\t\t\t\tthis.recognition = null\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\trecognition.start()\n\t\t\t\tthis.recognition = recognition\n\t\t\t\tthis.listening = true\n\t\t\t} catch (e) {\n\t\t\t\t// `start()` throws if called twice, and on some browsers when the\n\t\t\t\t// origin is not permitted. Either way say so rather than resetting\n\t\t\t\t// in silence.\n\t\t\t\tthis.showDictationError(this.cnTranslate('Dictation could not start: ') + (e.message || 'unknown'))\n\t\t\t\tthis.listening = false\n\t\t\t\tthis.recognition = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Stop dictation and release the microphone.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstopDictation() {\n\t\t\tthis.clearSilenceTimer()\n\t\t\tif (this.localSession !== null) {\n\t\t\t\t// The local session owns its own teardown, including releasing\n\t\t\t\t// the microphone BEFORE the transcript request goes out.\n\t\t\t\tthis.localSession.stop()\n\t\t\t\tthis.localSession = null\n\t\t\t\tthis.localRecording = false\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!this.recognition) {\n\t\t\t\tthis.listening = false\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tthis.recognition.stop()\n\t\t\t} catch {\n\t\t\t\t// Already stopped; nothing to release.\n\t\t\t}\n\t\t\tthis.recognition = null\n\t\t\tthis.listening = false\n\t\t},\n\n\t\thandleEnter() {\n\t\t\tif (this.disabled || this.isSendDisabled) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.handleSend()\n\t\t},\n\n\t\thandleShiftEnter() {\n\t\t\t// Default browser behaviour inserts a newline — we don't need to prevent it.\n\t\t\t// But we do need to trigger autoGrow after the character is inserted.\n\t\t\tthis.$nextTick(() => this.autoGrow())\n\t\t},\n\n\t\thandleSend() {\n\t\t\tif (this.disabled || this.isSendDisabled) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst text = this.inputText.trim()\n\t\t\tconst attachments = this.attachments.slice()\n\t\t\tthis.inputText = ''\n\t\t\tthis.attachments = []\n\t\t\tthis.uploadError = ''\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.autoGrow()\n\t\t\t})\n\t\t\tthis.$emit('send', { text, attachments })\n\t\t},\n\n\t\tautoGrow() {\n\t\t\tconst el = this.$refs.textarea\n\t\t\tif (!el) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Reset height first so shrinking works\n\t\t\tel.style.height = 'auto'\n\t\t\t// Clamp to 6-line max (~1.5em per line + padding)\n\t\t\tconst maxHeight = parseInt(getComputedStyle(el).lineHeight || '24', 10) * 6 + 24\n\t\t\tel.style.height = Math.min(el.scrollHeight, maxHeight) + 'px'\n\t\t},\n\n\t\t/** Focus the textarea — called by the parent panel on open. */\n\t\tfocus() {\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.textarea) {\n\t\t\t\t\tthis.$refs.textarea.focus()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/** Open the hidden file input in response to the paperclip button. */\n\t\topenFilePicker() {\n\t\t\tif (this.disabled || this.uploading) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.uploadError = ''\n\t\t\tif (this.fileInputEl) {\n\t\t\t\tthis.fileInputEl.click()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Upload the picked file to the chat backend's attachments endpoint and,\n\t\t * on success, add it as a removable chip. Surfaces the backend's\n\t\t * `{ error }` message inline on a 400 rejection (oversized, or not\n\t\t * text-decodable) instead of silently dropping the file.\n\t\t *\n\t\t * @param {Event} event The file input's change event.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onFileSelected(event) {\n\t\t\tconst file = event.target && event.target.files && event.target.files[0]\n\t\t\tevent.target.value = ''\n\t\t\tif (!file) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.uploading = true\n\t\t\tthis.uploadError = ''\n\t\t\ttry {\n\t\t\t\tconst formData = new FormData()\n\t\t\t\tformData.append('file', file)\n\t\t\t\tconst response = await axios.post(attachmentsUrl(this.chatAppId), formData)\n\t\t\t\tconst { path, name } = response.data || {}\n\t\t\t\tthis.attachments.push({ path, name: name || file.name })\n\t\t\t} catch (err) {\n\t\t\t\tconst backendMessage = err && err.response && err.response.status === 400\n\t\t\t\t\t? err.response.data && err.response.data.error\n\t\t\t\t\t: null\n\t\t\t\tthis.uploadError = backendMessage || this.cnTranslate('Could not attach file')\n\t\t\t} finally {\n\t\t\t\tthis.uploading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Pick files already in Nextcloud Files and add each as a chip carrying\n\t\t * its file id; they are sent by id and never uploaded. A dismissed\n\t\t * picker (which rejects in some dialog versions) is a no-op.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync chooseFromFiles() {\n\t\t\tif (this.disabled || this.uploading) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.uploadError = ''\n\t\t\ttry {\n\t\t\t\t// Loaded when someone picks from Files: the dialogs package is a large\n\t\t\t\t// share of the chat panel, which hosts load on every page.\n\t\t\t\tconst { FilePickerType, getFilePickerBuilder } = await import('@nextcloud/dialogs')\n\t\t\t\tconst picker = getFilePickerBuilder(this.cnTranslate('Choose from Files'))\n\t\t\t\t\t.setMultiSelect(true)\n\t\t\t\t\t.setType(FilePickerType.Choose)\n\t\t\t\t\t.allowDirectories(false)\n\t\t\t\t\t.setModal(true)\n\t\t\t\t\t.build()\n\t\t\t\tconst nodes = await picker.pickNodes()\n\t\t\t\tfor (const node of (Array.isArray(nodes) ? nodes : [])) {\n\t\t\t\t\tconst fileId = node.fileid ?? node.attributes?.fileid\n\t\t\t\t\tconst path = node.path || ''\n\t\t\t\t\tif (fileId === null || fileId === undefined || this.attachments.some((a) => a.fileId === fileId)) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tthis.attachments.push({ fileId, path, name: node.basename || path.split('/').pop() })\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.debug('[CnAiInput] file picker closed', e)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove a pending attachment chip before it's sent.\n\t\t *\n\t\t * @param {number} index Index into `attachments`.\n\t\t */\n\t\tremoveAttachment(index) {\n\t\t\tthis.attachments.splice(index, 1)\n\t\t},\n\t},\n}\n</script>\n\n<style>\n.cn-ai-input {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 8px 12px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-ai-input__error {\n\tmargin: 0;\n}\n\n.cn-ai-input__chips {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 6px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-ai-input__chip {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 4px;\n\tmax-width: 220px;\n\tpadding: 4px 8px;\n\tborder-radius: var(--border-radius-pill, 16px);\n\tbackground: var(--color-background-hover);\n\tfont-size: 13px;\n}\n\n.cn-ai-input__chip-icon {\n\tflex-shrink: 0;\n\topacity: 0.7;\n}\n\n.cn-ai-input__chip-name {\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n}\n\n.cn-ai-input__chip-remove {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: none;\n\tbackground: transparent;\n\tcolor: inherit;\n\tcursor: pointer;\n\topacity: 0.7;\n}\n\n/* `:focus-visible` and `:disabled` are declared BEFORE the compound\n `:hover:not(:disabled)` rule: stylelint's no-descending-specificity wants\n lower-specificity selectors first, and `:hover:not(:disabled)` outranks\n both. Ordering only — the cascade result is unchanged. */\n.cn-ai-input__chip-remove:focus-visible {\n\topacity: 1;\n}\n\n.cn-ai-input__chip-remove:disabled {\n\tcursor: not-allowed;\n}\n\n.cn-ai-input__chip-remove:hover:not(:disabled) {\n\topacity: 1;\n}\n\n.cn-ai-input__row {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: flex-end;\n}\n\n/* `stacked`: in a card the box keeps the line, dictation and attach wrap\n under it (DqZaakAssistent \"Vraag iets over deze zaak\" + \"Vragen\"). */\n.cn-ai-input--stacked {\n\tpadding: 12px 18px;\n}\n\n.cn-ai-input--stacked .cn-ai-input__row {\n\tflex-wrap: wrap;\n\talign-items: center;\n}\n\n.cn-ai-input--stacked .cn-ai-input__textarea {\n\torder: -2;\n\tflex: 1 1 calc(100% - 104px);\n\tmin-width: 0;\n\tmin-height: 40px;\n}\n\n.cn-ai-input--stacked .cn-ai-input__send-button {\n\torder: -1;\n}\n\n.cn-ai-input__file-input {\n\tdisplay: none;\n}\n\n/* Mic matches the paperclip exactly — they are peers in the row, and any\n difference in size or weight would read as one being the primary action. */\n.cn-ai-input__mic-button {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 36px;\n\theight: 36px;\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n/* Declared BEFORE the hover rule below, which is more specific\n (`:hover:not(:disabled)`). Source order has to follow specificity here or the\n cascade's outcome depends on which rule happens to be written last — the\n thing `no-descending-specificity` exists to stop. */\n.cn-ai-input__mic-button:disabled {\n\topacity: .5;\n\tcursor: default;\n}\n\n.cn-ai-input__mic-button:hover:not(:disabled) {\n\tbackground: var(--color-background-hover);\n}\n\n/* Recording is a STATE, not a hover: it stays visible while the user speaks and\n looks away from the button. Error colour because it is the \"something is\n live\" signal, and the icon fills in beside it — it does NOT swap to a\n struck-through mic, which is what this comment used to describe and what made\n a listening composer look muted. */\n.cn-ai-input__mic-button--recording {\n\tborder-color: var(--color-error);\n\tbackground: var(--color-error);\n\tcolor: var(--color-primary-text, #fff);\n}\n\n/* 🔴 THE BLOCKED LOOK THE COMMENT ABOVE THE BUTTON ALREADY PROMISED.\n `cn-ai-input__mic-button--blocked` was bound in the template and styled\n NOWHERE, so a microphone that cannot run — an agent pinned to the private\n engine while the speech service is down, or a browser with no recognition —\n looked exactly like a working one until you hovered it for the tooltip. A\n class set and never read is a comment, not a state.\n\n ⚠️ Muted rather than `disabled`, and NOT `pointer-events: none`. The button\n deliberately keeps a live click handler: a natively disabled control\n suppresses hover, so its `title` can never appear and it refuses without ever\n saying why. It must stay clickable in order to explain itself. */\n.cn-ai-input__mic-button--blocked {\n\topacity: .5;\n\tcursor: not-allowed;\n}\n\n/* The conversation control sits beside the mic and matches it in weight —\n neither is the primary action, and a bigger one would suggest the hands-free\n mode is the normal way to use the composer rather than a deliberate choice. */\n.cn-ai-input__converse-button {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 36px;\n\theight: 36px;\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-ai-input__converse-button:disabled {\n\topacity: .5;\n\tcursor: default;\n}\n\n.cn-ai-input__converse-button:hover:not(:disabled) {\n\tbackground: var(--color-background-hover);\n}\n\n/* Primary rather than error colour: a live conversation is a mode the user is\n in, not a recording warning — the microphone beside it carries that. */\n.cn-ai-input__converse-button--active {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text, #fff);\n}\n\n.cn-ai-input__attach-menu {\n\tflex: 0 0 auto;\n}\n\n.cn-ai-input__attach-button {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 36px;\n\theight: 36px;\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-ai-input__attach-button:hover:not(:disabled) {\n\tbackground: var(--color-background-hover);\n}\n\n/* stylelint-disable-next-line no-descending-specificity */\n.cn-ai-input__attach-button:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n/* stylelint-disable-next-line no-descending-specificity */\n.cn-ai-input__attach-button:disabled {\n\topacity: 0.6;\n\tcursor: not-allowed;\n}\n\n.cn-ai-input__textarea {\n\tflex: 1;\n\tmin-height: 36px;\n\tmax-height: calc(6 * 1.5em + 24px);\n\tpadding: 8px;\n\tresize: none;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tfont-family: inherit;\n\tfont-size: inherit;\n\tline-height: 1.5;\n\toverflow-y: auto;\n}\n\n.cn-ai-input__textarea:focus {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 0;\n\tborder-color: var(--color-primary-element);\n}\n\n.cn-ai-input__textarea:disabled {\n\topacity: 0.6;\n\tcursor: not-allowed;\n}\n\n.cn-ai-input__send-button {\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 36px;\n\theight: 36px;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n\tcursor: pointer;\n}\n\n.cn-ai-input__send-button--labelled {\n\twidth: auto;\n\tmin-height: 40px;\n\tpadding: 0 14px;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\twhite-space: nowrap;\n}\n\n/* server.css styles every button at (0,2,1), its disabled state too (grey\n ground, 15px, bold, its own margin); the element and the doubled class\n match that and load later, so the send button keeps its primary look and\n the labelled one its 40px 14px/600 (DqZaakAssistent \"Vragen\"). */\nbutton.cn-ai-input__send-button.cn-ai-input__send-button {\n\tmargin: 0;\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n}\n\nbutton.cn-ai-input__send-button--labelled.cn-ai-input__send-button--labelled {\n\theight: 40px;\n\tmin-height: 40px;\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\nbutton.cn-ai-input__send-button.cn-ai-input__send-button:hover:not(:disabled) {\n\tbackground: var(--color-primary-element-hover, var(--color-primary-element));\n}\n\n.cn-ai-input__send-button:hover:not(:disabled) {\n\tbackground: var(--color-primary-element-hover, var(--color-primary-element));\n}\n\n/* stylelint-disable-next-line no-descending-specificity */\n.cn-ai-input__send-button:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n/* stylelint-disable-next-line no-descending-specificity */\n.cn-ai-input__send-button:disabled {\n\topacity: 0.6;\n\tcursor: not-allowed;\n}\n</style>\n"],"names":["_normalizeClass","_createBlock","_Fragment","_renderList","_toDisplayString","_createVNode","_createElementVNode","_createElementBlock","_createTextVNode"],"mappings":";;;;;eAmEc,EAAC,mBAAmB;;AAMxB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAyB,GAAA;;AAYlC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAA,kBAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;IApCN,KAAK,EAAAA,cAAA,CAAA,CAAC,aAAa,EAAA,EAAA,sBAAA,EAAmC,MAAO,CAAA,OAAA,EAAA,CAAA,CAAA;AAAC,IAAA,aAAA,EAAA,aAA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yBAAA,EAAA;AAPH,YAAA,eAAe,EAAE,IAAA;AAClB,YAAA,aAAW,EAAC,0BAA0B;AACrC,YAAA,OAAK,EAAA,QAAA,CAAA,eAAA;;AACK,YAAA,IAAI,UACd,MAA4B;cAA5BA,WAA4B,CAAA,wBAAA,EAAA,EAAZ,IAAI,EAAE,EAAE,EAAA,CAAA;;6BACd,MACX;AADW,cAAAG,eAAA,CAAA,GACX,mBAAG,QAAW,CAAA,WAAA,CAAA,mBAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;wBAYU,CAAA,OAAA,EAAA;AAJxB,QAAA,GAAG,EAAE,QAAY,CAAA,YAAA;AAClB,QAAA,IAAI,EAAC,MAAM;AACV,QAAA,KAAI,EAAC,yBAAS;qBACL,EAAE,kBAAC;AACZ,QAAA,QAAM,0CAAC,QAAe,CAAA,cAAA,IAAA,QAAA,CAAA,cAAA,CAAA,GAAA,IAAA,CAAA,CAAA,CAAA;;;AAEvB,QAAA,GAAG,EAAC,UAAM;qEACN,KAAA,CAAA,SAAA,IAAA,MAAA,CAAA,CAAA;aACC,EAAC,uBAAA;AACL,QAAA,YAAS,EAAG,QAAA,CAAA,WAAA,CAAA,eAAA,CAAA;AACZ,QAAA,QAAM,EAAA,MAAA,CAAA,QAAA;QACN,WAAE,EAAA,MAAA,CAAA,WAAA,IAAA,QAAA,CAAA,WAAA,CAAA,eAAA,CAAA;AACH,QAAA,IAAE,EAAA,GAAA;;;;;;;;qBALE,KAAA,CAAA,SAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import script from './CnBannerWidget.vue2.js';
|
|
|
2
2
|
import { render } from './CnBannerWidget.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-4f54aeaa";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnBannerWidget.vue2.js","sources":["../../../../src/components/CnBannerWidget/CnBannerWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<section\n\t\tv-if=\"visible && isAttention\"\n\t\tclass=\"cn-banner-widget cn-banner-widget--attention\"\n\t\t:class=\"['cn-banner-widget--' + resolvedVariant, { 'cn-banner-widget--stacked': isStacked }]\"\n\t\t:aria-labelledby=\"headingId\"\n\t\tdata-testid=\"cn-banner-widget-attention\">\n\t\t<div class=\"cn-banner-widget__body\">\n\t\t\t<p v-if=\"resolvedKicker\" class=\"cn-banner-widget__kicker\">\n\t\t\t\t{{ resolvedKicker }}\n\t\t\t</p>\n\t\t\t<h3 :id=\"headingId\" class=\"cn-banner-widget__title\">\n\t\t\t\t{{ displayTitle }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"displayReason\" class=\"cn-banner-widget__reason\">\n\t\t\t\t{{ displayReason }}\n\t\t\t</p>\n\t\t</div>\n\t\t<div v-if=\"resolvedActions.length > 0\" class=\"cn-banner-widget__actions\">\n\t\t\t<component\n\t\t\t\t:is=\"action.href ? 'a' : 'button'\"\n\t\t\t\tv-for=\"action in resolvedActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\tclass=\"cn-banner-widget__action\"\n\t\t\t\t:class=\"action.primary ? 'cn-banner-widget__action--primary' : 'cn-banner-widget__action--secondary'\"\n\t\t\t\t:href=\"action.href || null\"\n\t\t\t\t:type=\"action.href ? null : 'button'\"\n\t\t\t\tdata-testid=\"cn-banner-widget-action\"\n\t\t\t\t@click=\"onActionClick($event, action)\">\n\t\t\t\t{{ action.label }}\n\t\t\t</component>\n\t\t</div>\n\t</section>\n\t<!-- The count could not be read. One quiet line, not the card and not an\n\t alarm: hidden would read as \"nothing to report\", which is not known. -->\n\t<p\n\t\tv-else-if=\"checkFailed\"\n\t\tclass=\"cn-banner-widget cn-banner-widget--unchecked\"\n\t\t:title=\"failureTooltip\"\n\t\tdata-testid=\"cn-banner-widget-unchecked\">\n\t\t<span class=\"cn-banner-widget__unchecked-text\">{{ uncheckedText }}</span>\n\t\t<span class=\"cn-banner-widget__unchecked-reason\">{{ failureTooltip }}</span>\n\t</p>\n\t<div v-else-if=\"visible\" class=\"cn-banner-widget\">\n\t\t<NcNoteCard :type=\"resolvedVariant\" class=\"cn-banner-widget__card\">\n\t\t\t<!-- A named icon replaces the variant's own glyph. -->\n\t\t\t<template v-if=\"resolvedIcon\" #icon>\n\t\t\t\t<CnIcon :name=\"resolvedIcon\" :size=\"22\" data-testid=\"cn-banner-widget-icon\" />\n\t\t\t</template>\n\t\t\t<span class=\"cn-banner-widget__line\">\n\t\t\t\t<component\n\t\t\t\t\t:is=\"clickable ? 'a' : 'span'\"\n\t\t\t\t\tclass=\"cn-banner-widget__text\"\n\t\t\t\t\t:class=\"{ 'cn-banner-widget__text--clickable': clickable }\"\n\t\t\t\t\t:href=\"clickable ? routeHref : null\"\n\t\t\t\t\tdata-testid=\"cn-banner-widget-text\"\n\t\t\t\t\t@click=\"onClick\"><strong v-if=\"displayLead\" class=\"cn-banner-widget__lead\" data-testid=\"cn-banner-widget-lead\">{{ displayLead }}</strong>{{ displayLead && displayText ? ' ' : '' }}{{ displayText }}</component>\n\t\t\t\t<!-- Board look: the actions as links at the end of the line. -->\n\t\t\t\t<a\n\t\t\t\t\tv-for=\"action in noteActions\"\n\t\t\t\t\t:key=\"action.key\"\n\t\t\t\t\tclass=\"cn-banner-widget__link\"\n\t\t\t\t\t:href=\"action.href || null\"\n\t\t\t\t\tdata-testid=\"cn-banner-widget-link\"\n\t\t\t\t\t@click=\"onActionClick($event, action)\">{{ action.label }}</a>\n\t\t\t</span>\n\t\t</NcNoteCard>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcNoteCard } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { followLinkClick, resolveHref } from '../../utils/linkNavigation.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { safeHref } from '../../utils/safeHref.js'\nimport { nextUid } from '../../utils/uid.js'\nimport { compareVisibleWhen, readVisibleWhenValue } from '../../utils/visibleWhen.js'\n\n/** Variants understood by NcNoteCard. */\nconst VARIANTS = ['info', 'warning', 'error', 'success']\n\n/** Layouts: the note card (default) or the attention card. */\nconst LAYOUTS = ['banner', 'attention']\n\n/** An attention card offers a primary and a secondary action, no more. */\nconst MAX_ACTIONS = 2\n\n/**\n * Under the board look the card takes what the boards draw: DqMijnWerk's\n * \"Vandaag eerst\" has three secondary actions and the primary one.\n */\nconst MAX_ACTIONS_BOARD = 4\n\n/**\n * CnBannerWidget — declarative notice banner for dashboards and v2 pages\n * (`banner` widget type, Wave 1 of nextcloud-vue#91).\n *\n * Renders a themed NcNoteCard with a variant (`info | warning | error`),\n * a text, an optional click-through route, and an optional `visibleWhen`\n * condition: a simple `{ field, op, value }` predicate evaluated against\n * an endpoint response or an OpenRegister source (the doriath\n * migration-banner case — \"show while `pending > 0`\").\n *\n * Config arrives either as flat props (v2 grid spreads `props`) or as a\n * stored `content` blob (CnDashboardPage's registry branch) — explicit\n * flat props win on collision.\n *\n * ```json\n * {\n * \"widgetKey\": \"banner\",\n * \"props\": {\n * \"variant\": \"warning\",\n * \"text\": \"Migrations pending — open the migration overview.\",\n * \"visibleWhen\": { \"endpoint\": \"/apps/doriath/api/migrations/status\", \"field\": \"pending\", \"op\": \"gt\", \"value\": 0 },\n * \"route\": \"migrations\"\n * }\n * }\n * ```\n *\n * Fail-safe: with a `visibleWhen`, the banner stays HIDDEN until the\n * condition evaluates true — a failed fetch never breaks (or spams) a\n * dashboard.\n *\n * An attention card (`layout: \"attention\"`) whose `visibleWhen` request\n * FAILS renders one quiet line instead, \"Could not check\", with the reason as\n * a tooltip. A hidden card reads as \"nothing needs attention\", and a failed\n * count does not know that. A request that succeeds with a value that does\n * not meet the condition still renders nothing.\n *\n * `layout: \"attention\"` turns the banner into an attention card: a card with\n * a coloured edge by severity, a `kicker` label, a `title`, a `reason` line\n * and up to two `actions` (the first is the primary one unless an action says\n * `primary` itself). `visibleWhen` works the same way. Without `layout` the\n * note card above renders, as it always did.\n *\n * ```json\n * {\n * \"widgetKey\": \"banner\",\n * \"props\": {\n * \"layout\": \"attention\",\n * \"variant\": \"error\",\n * \"kicker\": \"First today\",\n * \"title\": \"Parking permits city centre\",\n * \"reason\": \"The deadline ends today.\",\n * \"actions\": [\n * { \"label\": \"Open case\", \"route\": { \"name\": \"CaseDetail\", \"params\": { \"id\": \"2026-0061\" } } },\n * { \"label\": \"Suspend deadline\", \"route\": \"CaseSuspend\" }\n * ]\n * }\n * }\n * ```\n */\nexport default {\n\tname: 'CnBannerWidget',\n\n\tcomponents: { CnIcon, NcNoteCard },\n\n\tinject: {\n\t\t/**\n\t\t * The host's label lookup (CnAppRoot provides it); identity without one, so a\n\t\t * label that is not a key renders as written.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The app's look, provided by CnAppRoot or CnPageRenderer (`nextcloud` or `board`). */\n\t\tcnLook: { default: 'nextcloud' },\n\t\t/**\n\t\t * The detail page's object context (`{ objectId, object }`), provided by\n\t\t * CnDetailPage: a `visibleWhen.source` filter's `@objectId` and\n\t\t * `@object.<field>` tokens read it, so a notice on a record's page can\n\t\t * count that record's related rows. Null elsewhere.\n\t\t */\n\t\tcnObjectContext: { default: null },\n\t\t/** The page's pre-bound action dispatcher (CnPageRenderer), for an action with a `type`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Banner severity variant: `info | warning | error` (plus `success`\n\t\t * for completeness — NcNoteCard's set). Empty falls back to the\n\t\t * `content` blob, then `info`.\n\t\t */\n\t\tvariant: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t\tvalidator: (v) => v === '' || VARIANTS.includes(v),\n\t\t},\n\n\t\t/** Pre-translated banner text. Empty falls back to the `content` blob. */\n\t\ttext: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * A bold lead in front of the text (\"2 aanmeldingen wachten op\n\t\t * goedkeuring.\" before the rest of the sentence). `{value}` is replaced\n\t\t * like in `text`, and it goes through the app's translate. Empty falls\n\t\t * back to the `content` blob.\n\t\t */\n\t\tlead: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * A named icon (`AccountPlus`, `AlertOutline`, ...) drawn before the\n\t\t * text instead of the variant's own glyph. Empty falls back to the\n\t\t * `content` blob, then to the variant glyph.\n\t\t */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Optional visibility condition. Shape:\n\t\t * `{ endpoint?, source?, field?, op?, value }` — exactly one of\n\t\t * `endpoint` (a same-origin URL returning JSON) or `source`\n\t\t * (`{ register, schema, filter? }`, an OpenRegister object query whose\n\t\t * `filter` supports the shared @-token grammar). `field` is a\n\t\t * dot-path into the response (for a `source`, into the first result;\n\t\t * omit it — or use `@total` — to compare the collection total).\n\t\t * `op` is `eq | neq | gt | gte | lt | lte` (default `eq`); `value` is\n\t\t * the literal right-hand side. `null` (the default) shows the banner\n\t\t * unconditionally.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tvisibleWhen: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Optional click-through route: a vue-router route NAME (string) or\n\t\t * a full location object. When set, the banner text is a link to that\n\t\t * route. `null` renders static text.\n\t\t *\n\t\t * @type {string|object|null}\n\t\t */\n\t\troute: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * How the banner renders: `banner` (the note card, default) or\n\t\t * `attention` (a card with a severity edge, kicker, title, reason and\n\t\t * up to two actions). Empty falls back to the `content` blob, then\n\t\t * `banner`.\n\t\t *\n\t\t * @type {''|'banner'|'attention'}\n\t\t */\n\t\tlayout: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t\tvalidator: (v) => v === '' || LAYOUTS.includes(v),\n\t\t},\n\n\t\t/** Attention card: the small label above the title (\"First today\"). */\n\t\tkicker: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Attention card: the title. Falls back to `text` when empty. */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Attention card: the line under the title that says why this needs attention. `{value}` is replaced like in `text`. */\n\t\treason: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Attention card: its actions, two at most (four under the board look,\n\t\t * or `maxActions`). Each is `{ label, route?,\n\t\t * href?, primary?, id? }`: `route` is a route name or location,\n\t\t * `href` an URL. An action with neither renders a button that emits\n\t\t * `action`. The first action is the primary one unless one sets\n\t\t * `primary: true`.\n\t\t *\n\t\t * @type {Array<{label: string, route?: (string|object), href?: string, primary?: boolean, id?: string}>|null}\n\t\t */\n\t\tactions: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Attention card: how many actions it shows at most. Null takes the\n\t\t * default: two, four under the board look.\n\t\t *\n\t\t * @spec openspec/changes/screens-banner-actions-parity/specs/banner-actions/spec.md#requirement-the-board-attention-card-shows-the-boards-actions\n\t\t */\n\t\tmaxActions: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Attention card: stack the actions under the text instead of beside it,\n\t\t * the \"Begin hier\" card of PqMijnWerk (16px title, the action under the\n\t\t * reason). Falls back to the `content` blob.\n\t\t *\n\t\t * @spec openspec/changes/screens-start-here-banner/specs/start-here-banner/spec.md#requirement-a-card-can-stack-its-action-under-the-text\n\t\t */\n\t\tstacked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Stored content blob (CnDashboardPage registry branch) carrying the\n\t\t * same keys as the flat props: `{ variant, text, visibleWhen, route,\n\t\t * layout, kicker, title, reason, actions }`. Explicit flat props win\n\t\t * on collision.\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Pre-evaluated `visibleWhen` outcome `{ met, value }`, injected by a\n\t\t * host that already ran the predicate (CnDashboardPage evaluates it\n\t\t * to know whether to collapse the banner's grid cell). When present,\n\t\t * the banner renders from this verdict instead of fetching again —\n\t\t * no duplicate request and no hidden-until-self-evaluated flash —\n\t\t * and `value` feeds the `{value}` text placeholder. `null` (the\n\t\t * default) keeps the banner self-evaluating. A host whose request\n\t\t * failed passes `{ met: false, value: null, failed: true, reason }`,\n\t\t * and an attention card then says it could not check.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tconditionOutcome: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The record of the page the banner sits on, as a detail-page host\n\t\t * binds it. A local `visibleWhen` (a `field` with no `endpoint` or\n\t\t * `source`) reads it when no `cnObjectContext` is provided, and it is\n\t\t * the card's subject: `{subject.@self.archived.by}` fills from it.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted when an attention-card action without a `route` or `href`\n\t\t * is clicked, so the host can run it.\n\t\t *\n\t\t * @event action\n\t\t * @type {{id: (string|undefined), label: string, index: number}}\n\t\t */\n\t\t'action',\n\t],\n\n\t/**\n\t * The banner's own state: the evaluated condition, the value it read,\n\t * and whether the request for it failed.\n\t *\n\t * @return {object} The state.\n\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t */\n\tdata() {\n\t\treturn {\n\t\t\t/** Id that ties the attention card's region to its title. */\n\t\t\theadingId: `cn-banner-title-${nextUid()}`,\n\t\t\t/** Evaluated visibleWhen outcome (null = not yet evaluated). */\n\t\t\tconditionMet: null,\n\t\t\t/**\n\t\t\t * The raw field value the predicate read (from the injected\n\t\t\t * outcome or the banner's own evaluation) — interpolated into\n\t\t\t * the text wherever it says `{value}`.\n\t\t\t */\n\t\t\tconditionValue: null,\n\t\t\t/**\n\t\t\t * The first row of the `visibleWhen` source query (its `order`\n\t\t\t * applied), the card's subject: `{subject.<field>}` in the texts\n\t\t\t * and `@subject.<field>` in an action route read it.\n\t\t\t */\n\t\t\tconditionRow: null,\n\t\t\t/** Whether the visibleWhen request itself failed (not: answered \"no\"). */\n\t\t\tconditionFailed: false,\n\t\t\t/** Why it failed, as the request reported it. */\n\t\t\tconditionFailureReason: '',\n\t\t\t/** Whether the browser says it is online, for `content.connection`. */\n\t\t\tonline: typeof navigator === 'undefined' || navigator.onLine !== false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The page record's id, so the condition is asked again once it is known.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/notice-scoped-to-the-record/specs/notice-scoped-to-the-record/spec.md#requirement-a-banners-source-may-be-scoped-to-the-pages-record\n\t\t */\n\t\ttokenContextKey() {\n\t\t\tconst ctx = this.tokenContext()\n\t\t\treturn ctx && ctx.objectId ? String(ctx.objectId) : ''\n\t\t},\n\n\t\t/** The effective variant (prop → content → 'info'). */\n\t\tresolvedVariant() {\n\t\t\tconst v = this.variant || (this.content && this.content.variant) || 'info'\n\t\t\treturn VARIANTS.includes(v) ? v : 'info'\n\t\t},\n\n\t\t/** The effective banner text (prop → content → ''), through the app's translate. */\n\t\tresolvedText() {\n\t\t\tconst text = this.text || (this.content && this.content.text) || ''\n\t\t\treturn text ? this.tl(text) : ''\n\t\t},\n\n\t\t/** The effective bold lead (prop → content → ''), through the app's translate. */\n\t\tresolvedLead() {\n\t\t\tconst lead = this.lead || (this.content && this.content.lead) || ''\n\t\t\treturn lead ? this.tl(lead) : ''\n\t\t},\n\n\t\t/** The lead with `{value}` filled in, else `content.fallbackLead`. */\n\t\tdisplayLead() {\n\t\t\treturn this.withFallback(this.fillValue(this.resolvedLead), this.resolvedLead, 'fallbackLead')\n\t\t},\n\n\t\t/** The effective icon name (prop → content → ''). */\n\t\tresolvedIcon() {\n\t\t\treturn this.icon || (this.content && this.content.icon) || ''\n\t\t},\n\n\t\t/**\n\t\t * The note card's actions as links, under the board look only: the\n\t\t * first resolved action of `actions`, as the board draws \"Beleid\n\t\t * wijzigen\" at the end of the line. Without the look the note card\n\t\t * ignores `actions`, as it always did.\n\t\t *\n\t\t * @return {Array<object>} The resolved actions (at most one).\n\t\t */\n\t\tnoteActions() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board' ? this.resolvedActions.slice(0, 1) : []\n\t\t},\n\n\t\t/**\n\t\t * `content.connection`: `offline` shows the banner only while the\n\t\t * device is offline, `online` only while it is online (DqInspectie\n\t\t * \"3 wijzigingen wachten op bereik\"); unset shows it either way.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tconnectionAllows() {\n\t\t\tconst connection = this.content && this.content.connection\n\t\t\tif (connection === 'offline') {\n\t\t\t\treturn !this.online\n\t\t\t}\n\t\t\tif (connection === 'online') {\n\t\t\t\treturn this.online\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/** The effective visibleWhen condition (prop → content → null). */\n\t\tresolvedVisibleWhen() {\n\t\t\treturn this.visibleWhen || (this.content && this.content.visibleWhen) || null\n\t\t},\n\n\t\t/**\n\t\t * Whether the condition is decided on the page's own record (a `field`\n\t\t * with no `endpoint` or `source`), which is then the card's subject.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-banner-can-read-the-pages-record\n\t\t */\n\t\tisLocalCondition() {\n\t\t\tconst cond = this.resolvedVisibleWhen\n\t\t\treturn Boolean(cond) && typeof cond === 'object' && !cond.endpoint && !cond.source && typeof cond.field === 'string' && cond.field !== ''\n\t\t},\n\n\t\t/**\n\t\t * The page's record, while the condition is a local one.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tlocalSubject() {\n\t\t\tif (!this.isLocalCondition) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst ctx = this.tokenContext()\n\t\t\treturn (ctx && ctx.object) || null\n\t\t},\n\n\t\t/** The effective injected outcome (prop → content → null). */\n\t\tresolvedConditionOutcome() {\n\t\t\treturn this.conditionOutcome || (this.content && this.content.conditionOutcome) || null\n\t\t},\n\n\t\t/**\n\t\t * The rendered text: `resolvedText` with `{value}` replaced by the\n\t\t * predicate's field value once one is known. Without a known value\n\t\t * the text renders as written — a `{value}` placeholder only makes\n\t\t * sense on a conditional banner, which stays hidden until its\n\t\t * predicate (and therefore its value) resolves.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tdisplayText() {\n\t\t\treturn this.withFallback(this.fillValue(this.resolvedText), this.resolvedText, 'fallbackText')\n\t\t},\n\n\t\t/** The effective click-through route (prop → content → null). */\n\t\tresolvedRoute() {\n\t\t\treturn this.route || (this.content && this.content.route) || null\n\t\t},\n\n\t\t/**\n\t\t * Whether the attention card renders instead of the note card.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tisAttention() {\n\t\t\treturn (this.layout || (this.content && this.content.layout) || 'banner') === 'attention'\n\t\t},\n\n\t\t/**\n\t\t * Whether the actions sit under the text.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisStacked() {\n\t\t\treturn this.stacked || Boolean(this.content && this.content.stacked)\n\t\t},\n\n\t\t/**\n\t\t * The attention card's kicker (prop, else content).\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tresolvedKicker() {\n\t\t\tconst kicker = this.kicker || (this.content && this.content.kicker) || ''\n\t\t\treturn kicker ? this.fillValue(this.tl(kicker)) : ''\n\t\t},\n\n\t\t/**\n\t\t * The attention card's title: `title`, else `text`, with `{value}` filled in.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tdisplayTitle() {\n\t\t\tconst title = this.title || (this.content && this.content.title) || ''\n\t\t\treturn title ? this.fillValue(this.tl(title)) : this.displayText\n\t\t},\n\n\t\t/**\n\t\t * The attention card's reason line. When the title already used\n\t\t * `text`, the text is not repeated here.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tdisplayReason() {\n\t\t\tconst reason = this.reason || (this.content && this.content.reason) || ''\n\t\t\tif (reason) {\n\t\t\t\treturn this.withFallback(this.fillValue(this.tl(reason)), reason, 'fallbackReason')\n\t\t\t}\n\t\t\tconst title = this.title || (this.content && this.content.title) || ''\n\t\t\t// A card that sets `text` to the same words as its `title` says\n\t\t\t// them once.\n\t\t\treturn title && this.displayText !== this.displayTitle ? this.displayText : ''\n\t\t},\n\n\t\t/**\n\t\t * The attention card's actions: the first `actionCap` that have a label, each\n\t\t * with its href and whether it is the primary one.\n\t\t *\n\t\t * @return {Array<{key: string, id: (string|undefined), label: string, href: string, target: (object|null), primary: boolean, index: number}>}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\t/**\n\t\t * How many actions the attention card shows: `maxActions` (prop, then\n\t\t * content), else four under the board look and two without it.\n\t\t *\n\t\t * @return {number} The cap.\n\t\t * @spec openspec/changes/screens-banner-actions-parity/specs/banner-actions/spec.md#requirement-the-board-attention-card-shows-the-boards-actions\n\t\t */\n\t\tactionCap() {\n\t\t\tconst explicit = this.maxActions ?? (this.content ? this.content.maxActions : undefined)\n\t\t\tif (Number.isInteger(explicit) && explicit > 0) {\n\t\t\t\treturn explicit\n\t\t\t}\n\t\t\treturn normalizeLook(this.cnLook) === 'board' ? MAX_ACTIONS_BOARD : MAX_ACTIONS\n\t\t},\n\n\t\tresolvedActions() {\n\t\t\tconst raw = this.actions || (this.content && this.content.actions) || []\n\t\t\tif (!Array.isArray(raw)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst usable = raw\n\t\t\t\t.filter((action) => action && typeof action === 'object' && typeof action.label === 'string' && action.label !== '')\n\t\t\t\t.slice(0, this.actionCap)\n\t\t\tconst declaredPrimary = usable.findIndex((action) => action.primary === true)\n\t\t\tconst primaryIndex = declaredPrimary === -1 ? 0 : declaredPrimary\n\t\t\treturn usable.map((action, index) => {\n\t\t\t\tlet target = null\n\t\t\t\tlet href = ''\n\t\t\t\tif (action.route) {\n\t\t\t\t\ttarget = typeof action.route === 'string' ? { name: action.route } : this.resolveSubject(action.route)\n\t\t\t\t\thref = resolveHref(target, this.$router)\n\t\t\t\t} else if (typeof action.href === 'string' && action.href !== '') {\n\t\t\t\t\tconst safe = safeHref(action.href)\n\t\t\t\t\thref = safe === '#' ? '' : safe\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tkey: `${index}-${action.id || action.label}`,\n\t\t\t\t\tid: action.id,\n\t\t\t\t\tlabel: this.tl(action.label),\n\t\t\t\t\thref,\n\t\t\t\t\ttarget,\n\t\t\t\t\tdispatch: !target && !href && typeof action.type === 'string' && action.type !== '' ? action : null,\n\t\t\t\t\tprimary: index === primaryIndex,\n\t\t\t\t\tindex,\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Whether the banner renders: no condition = always; else the evaluated outcome.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tvisible() {\n\t\t\tif (!this.connectionAllows) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst title = this.title || (this.content && this.content.title) || ''\n\t\t\tif (this.resolvedText === '' && this.resolvedLead === '' && !(this.isAttention && title !== '')) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// Every line emptied by a subject token with no value: nothing to say.\n\t\t\tif (!this.isAttention && this.displayText === '' && this.displayLead === '') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (!this.resolvedVisibleWhen) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn this.conditionMet === true\n\t\t},\n\n\t\t/**\n\t\t * Whether to say the check failed: an attention card, with words to\n\t\t * show, whose `visibleWhen` request failed. A plain banner stays\n\t\t * hidden on failure, as it always did.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t\t */\n\t\tcheckFailed() {\n\t\t\tconst title = this.title || (this.content && this.content.title) || ''\n\t\t\treturn this.isAttention\n\t\t\t\t&& !!this.resolvedVisibleWhen\n\t\t\t\t&& this.conditionFailed\n\t\t\t\t&& (title !== '' || this.resolvedText !== '')\n\t\t},\n\n\t\t/**\n\t\t * The one line shown when the check failed. It names the card by its\n\t\t * title, unless the title needs the value that could not be read.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t\t */\n\t\tuncheckedText() {\n\t\t\tconst title = this.title || (this.content && this.content.title) || this.resolvedText\n\t\t\tif (!title || title.includes('{value}') || title.includes('{subject.')) {\n\t\t\t\treturn t('nextcloud-vue', 'Could not check')\n\t\t\t}\n\t\t\t// `escape: false`: the result is rendered through `{{ }}`, which escapes.\n\t\t\treturn t('nextcloud-vue', 'Could not check: {subject}', { subject: title }, undefined, { escape: false })\n\t\t},\n\n\t\t/**\n\t\t * The reason the check failed, for the tooltip and for assistive\n\t\t * technology.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t\t */\n\t\tfailureTooltip() {\n\t\t\tif (!this.conditionFailureReason) {\n\t\t\t\treturn t('nextcloud-vue', 'The check failed.')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'The check failed: {reason}', { reason: this.conditionFailureReason }, undefined, { escape: false })\n\t\t},\n\n\t\t/** Whether the banner navigates on click (route set + router present). */\n\t\tclickable() {\n\t\t\treturn !!this.resolvedRoute && !!this.$router\n\t\t},\n\n\t\t/** The click-through route as a router location (a string is a route name). */\n\t\trouteLocation() {\n\t\t\tconst route = this.resolvedRoute\n\t\t\treturn typeof route === 'string' ? { name: route } : route\n\t\t},\n\n\t\t/** The href of the click-through link. */\n\t\trouteHref() {\n\t\t\treturn resolveHref(this.routeLocation, this.$router)\n\t\t},\n\t},\n\n\twatch: {\n\t\tresolvedVisibleWhen: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.evaluateCondition()\n\t\t\t},\n\t\t},\n\n\t\tresolvedConditionOutcome() {\n\t\t\tthis.evaluateCondition()\n\t\t},\n\n\t\t/** The page's record arrived or changed: a token-scoped source asks again. */\n\t\ttokenContextKey() {\n\t\t\tthis.evaluateCondition()\n\t\t},\n\n\t\t/** A local condition reads the record itself, so a new record is a new answer. */\n\t\tlocalSubject() {\n\t\t\tif (this.isLocalCondition) {\n\t\t\t\tthis.evaluateCondition()\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\twindow.addEventListener('online', this.onConnection)\n\t\twindow.addEventListener('offline', this.onConnection)\n\t},\n\n\tbeforeUnmount() {\n\t\twindow.removeEventListener('online', this.onConnection)\n\t\twindow.removeEventListener('offline', this.onConnection)\n\t},\n\n\tmethods: {\n\t\t/** Follow the browser's connection, for `content.connection`. */\n\t\tonConnection() {\n\t\t\tthis.online = typeof navigator === 'undefined' || navigator.onLine !== false\n\t\t},\n\n\t\t/**\n\t\t * A manifest string through the host's label lookup (`cnTranslate`), so a key\n\t\t * such as \"Mine\" reads in the user's language.\n\t\t *\n\t\t * @param {string} text The text as written in the manifest.\n\t\t * @return {string} The translated text.\n\t\t */\n\t\ttl(text) {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\t/**\n\t\t * Replace `{value}` in a text by the value the predicate read, once\n\t\t * one is known.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The text with the value filled in.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tfillValue(text) {\n\t\t\tlet out = text\n\t\t\tif (this.conditionValue !== null && out.includes('{value}')) {\n\t\t\t\tout = out.replaceAll('{value}', String(this.conditionValue))\n\t\t\t}\n\t\t\treturn this.fillSubject(out)\n\t\t},\n\n\t\t/**\n\t\t * The filled text, or the content's fallback when a subject token left\n\t\t * the written text empty (\"filed it on {subject.@self.archived.at|date}\"\n\t\t * on a record that carries no date). The fallback is filled too.\n\t\t *\n\t\t * @param {string} filled The filled text.\n\t\t * @param {string} written The text as written.\n\t\t * @param {string} key The content key holding the fallback.\n\t\t * @return {string} The text to show.\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-banner-can-read-the-pages-record\n\t\t */\n\t\twithFallback(filled, written, key) {\n\t\t\tif (filled !== '' || !written) {\n\t\t\t\treturn filled\n\t\t\t}\n\t\t\tconst fallback = this.content && typeof this.content[key] === 'string' ? this.content[key] : ''\n\t\t\treturn fallback ? this.fillValue(this.tl(fallback)) : ''\n\t\t},\n\n\t\t/**\n\t\t * Fill `{subject.<field>}` (and `{subject.<field>|date}`, `|days`) from\n\t\t * the card's subject row. A token with no value empties the whole text,\n\t\t * as in a record list. Text without a subject token is untouched.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The filled text.\n\t\t * @spec openspec/changes/screens-start-here-banner/specs/start-here-banner/spec.md#requirement-a-banner-can-name-the-first-row-of-a-query\n\t\t */\n\t\tfillSubject(text) {\n\t\t\tif (typeof text !== 'string' || !text.includes('{subject.')) {\n\t\t\t\treturn text\n\t\t\t}\n\t\t\t// `{value}` is not a subject token: keep it out of the template fill.\n\t\t\tconst guard = '\\u0000value\\u0000'\n\t\t\tconst filled = fillTemplate(text.replaceAll('{value}', guard), { subject: this.conditionRow || {} })\n\t\t\treturn filled.replaceAll(guard, '{value}')\n\t\t},\n\n\t\t/**\n\t\t * Replace `@subject.<field>` strings anywhere in an action route\n\t\t * (params, query) by the subject's value.\n\t\t *\n\t\t * @param {unknown} node A route name, location or any nested part of one.\n\t\t * @return {unknown} The same shape with the tokens resolved.\n\t\t * @spec openspec/changes/screens-start-here-banner/specs/start-here-banner/spec.md#requirement-a-banner-can-name-the-first-row-of-a-query\n\t\t */\n\t\tresolveSubject(node) {\n\t\t\tif (typeof node === 'string') {\n\t\t\t\tif (!node.startsWith('@subject.')) {\n\t\t\t\t\treturn node\n\t\t\t\t}\n\t\t\t\tconst value = this.conditionRow ? readPath(this.conditionRow, node.slice('@subject.'.length)) : undefined\n\t\t\t\treturn value === undefined || value === null ? '' : String(value)\n\t\t\t}\n\t\t\tif (Array.isArray(node)) {\n\t\t\t\treturn node.map((item) => this.resolveSubject(item))\n\t\t\t}\n\t\t\tif (node && typeof node === 'object') {\n\t\t\t\treturn Object.fromEntries(Object.entries(node).map(([key, value]) => [key, this.resolveSubject(value)]))\n\t\t\t}\n\t\t\treturn node\n\t\t},\n\n\t\t/**\n\t\t * Run an attention-card action: route an in-app link, leave an\n\t\t * external link to the browser, dispatch a manifest action (one with a\n\t\t * `type`) through the page with its `@subject.` tokens filled, and\n\t\t * emit `action` for any other button.\n\t\t *\n\t\t * @param {MouseEvent} event The click.\n\t\t * @param {object} action The resolved action.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t * @spec openspec/changes/banner-action-dispatch/specs/banner-action-dispatch/spec.md#requirement-a-banner-action-can-be-a-manifest-action-on-the-subject\n\t\t */\n\t\tonActionClick(event, action) {\n\t\t\tif (action.target) {\n\t\t\t\tfollowLinkClick(event, action.target, this.$router)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (action.dispatch && typeof this.cnDispatchAction === 'function') {\n\t\t\t\tthis.cnDispatchAction(this.resolveSubject(action.dispatch))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!action.href) {\n\t\t\t\tthis.$emit('action', { id: action.id, label: action.label, index: action.index })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The token context a `visibleWhen.source` filter resolves against: the\n\t\t * detail page's record, when the banner sits on one.\n\t\t *\n\t\t * @return {{objectId?: string, object?: object}|undefined}\n\t\t * @spec openspec/changes/notice-scoped-to-the-record/specs/notice-scoped-to-the-record/spec.md#requirement-a-banners-source-may-be-scoped-to-the-pages-record\n\t\t */\n\t\ttokenContext() {\n\t\t\tconst raw = this.cnObjectContext\n\t\t\tconst ctx = raw && typeof raw === 'object' && 'value' in raw ? raw.value : raw\n\t\t\tif (ctx && typeof ctx === 'object' && ctx.objectId) {\n\t\t\t\treturn { objectId: ctx.objectId, object: ctx.object || this.objectData || undefined }\n\t\t\t}\n\t\t\tconst own = this.objectData\n\t\t\tif (own && typeof own === 'object') {\n\t\t\t\tconst id = own.id || (own['@self'] && own['@self'].id) || ''\n\t\t\t\treturn { objectId: id, object: own }\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\n\t\t/**\n\t\t * Resolve the `visibleWhen` verdict. A host-injected\n\t\t * `conditionOutcome` wins outright — the host already ran the\n\t\t * predicate, so re-fetching would double the request and flash the\n\t\t * banner hidden until its own copy resolved. Otherwise evaluate\n\t\t * through the shared util primitives (endpoint / OpenRegister-source\n\t\t * modes — the Wave-1 banner shape is the canonical one, extracted to\n\t\t * `utils/visibleWhen.js` in Wave 3 so manifest actions reuse it),\n\t\t * keeping the read VALUE for the `{value}` text placeholder.\n\t\t * Fail-safe: any fetch/shape error leaves the banner hidden. The\n\t\t * failure is kept (`conditionFailed`, with its reason) so an\n\t\t * attention card can say it could not check.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t\t */\n\t\tasync evaluateCondition() {\n\t\t\tconst outcome = this.resolvedConditionOutcome\n\t\t\tif (outcome) {\n\t\t\t\tthis.conditionMet = outcome.met === true\n\t\t\t\tthis.conditionValue = outcome.value !== undefined ? outcome.value : null\n\t\t\t\tthis.conditionRow = outcome.row && typeof outcome.row === 'object' ? outcome.row : null\n\t\t\t\tthis.conditionFailed = outcome.failed === true\n\t\t\t\tthis.conditionFailureReason = outcome.failed === true && typeof outcome.reason === 'string' ? outcome.reason : ''\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst cond = this.resolvedVisibleWhen\n\t\t\tif (!cond) {\n\t\t\t\tthis.conditionMet = null\n\t\t\t\tthis.conditionValue = null\n\t\t\t\tthis.conditionRow = null\n\t\t\t\tthis.conditionFailed = false\n\t\t\t\tthis.conditionFailureReason = ''\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst sink = {}\n\t\t\t\tconst ctx = this.tokenContext()\n\t\t\t\tconst value = await readVisibleWhenValue(cond, ctx, sink)\n\t\t\t\tthis.conditionRow = sink.row || (this.isLocalCondition && ctx ? ctx.object : null) || null\n\t\t\t\tthis.conditionValue = value\n\t\t\t\tthis.conditionMet = compareVisibleWhen(value, cond.op || 'eq', cond.value)\n\t\t\t\tthis.conditionFailed = false\n\t\t\t\tthis.conditionFailureReason = ''\n\t\t\t} catch (error) {\n\t\t\t\t// Still hidden: a banner that cannot tell whether it applies\n\t\t\t\t// should not claim attention. But not silently, because a\n\t\t\t\t// failed count and \"nothing to report\" look the same on screen.\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnBannerWidget] visibleWhen could not be evaluated, banner hidden:', error?.message || error)\n\t\t\t\tthis.conditionMet = false\n\t\t\t\tthis.conditionValue = null\n\t\t\t\tthis.conditionRow = null\n\t\t\t\tthis.conditionFailed = true\n\t\t\t\tthis.conditionFailureReason = typeof error?.message === 'string' ? error.message : String(error ?? '')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Route a plain click on the link; a modified click opens the href\n\t\t * in the browser.\n\t\t *\n\t\t * @param {MouseEvent} event The click event.\n\t\t * @return {void}\n\t\t */\n\t\tonClick(event) {\n\t\t\tif (!this.clickable) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfollowLinkClick(event, this.routeLocation, this.$router)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-banner-widget {\n\twidth: 100%;\n}\n\n.cn-banner-widget__card {\n\tmargin: 0;\n}\n\n.cn-banner-widget__line {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: baseline;\n\tgap: 4px 20px;\n}\n\n.cn-banner-widget__lead {\n\tfont-weight: 700;\n}\n\n.cn-banner-widget__link {\n\tmargin-inline-start: auto;\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-banner-widget__text--clickable {\n\tcursor: pointer;\n\ttext-decoration: underline;\n\tcolor: inherit;\n}\n\n/* The check failed. Muted text, no fill, no severity colour: it is a note\n that something is not known, not a warning. */\n.cn-banner-widget--unchecked {\n\tbox-sizing: border-box;\n\tmargin: 0;\n\tpadding: 8px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n\tcursor: help;\n}\n\n/* The reason, for assistive technology; sighted readers get the tooltip. */\n.cn-banner-widget__unchecked-reason {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tmargin: -1px;\n\tpadding: 0;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\twhite-space: nowrap;\n\tborder: 0;\n}\n\n/* Attention card. The severity edge is an inset shadow, so it takes no width. */\n.cn-banner-widget--attention {\n\t--cn-banner-accent: var(--color-primary-element);\n\t--cn-banner-accent-text: var(--color-primary-element);\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 16px 24px;\n\tbox-sizing: border-box;\n\tpadding: 20px 24px 20px 28px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-container, var(--border-radius-large, 12px));\n\tbackground: var(--color-main-background);\n\tbox-shadow: inset 4px 0 0 0 var(--cn-banner-accent);\n}\n\n.cn-banner-widget--attention.cn-banner-widget--warning {\n\t--cn-banner-accent: var(--color-element-warning, var(--color-warning));\n\t--cn-banner-accent-text: var(--color-text-warning, var(--color-warning-text, var(--color-main-text)));\n}\n\n.cn-banner-widget--attention.cn-banner-widget--error {\n\t--cn-banner-accent: var(--color-element-error, var(--color-error));\n\t--cn-banner-accent-text: var(--color-text-error, var(--color-error-text));\n}\n\n.cn-banner-widget--attention.cn-banner-widget--success {\n\t--cn-banner-accent: var(--color-element-success, var(--color-success));\n\t--cn-banner-accent-text: var(--color-text-success, var(--color-success-text));\n}\n\n.cn-banner-widget__body {\n\tdisplay: flex;\n\tflex: 1 1 320px;\n\tflex-direction: column;\n\tgap: 6px;\n\tmin-width: 0;\n}\n\n.cn-banner-widget__kicker {\n\tmargin: 0;\n\tfont-size: 0.85em;\n\tfont-weight: 700;\n\tletter-spacing: 0.06em;\n\ttext-transform: uppercase;\n\tcolor: var(--cn-banner-accent-text);\n}\n\n.cn-banner-widget__title {\n\tmargin: 0;\n\tfont-size: 1.3em;\n\tfont-weight: 700;\n\tline-height: 1.3;\n\tcolor: var(--color-main-text);\n}\n\n.cn-banner-widget__reason {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* Stacked (PqMijnWerk \"Begin hier\"): the text, then the action under it. */\n.cn-banner-widget--stacked {\n\tflex-direction: column;\n\talign-items: flex-start;\n\tgap: 10px;\n}\n\n.cn-banner-widget--stacked .cn-banner-widget__body {\n\tflex: 0 0 auto;\n\tgap: 10px;\n}\n\n.cn-banner-widget--stacked .cn-banner-widget__title {\n\tfont-size: 16px;\n\tline-height: 1.4;\n}\n\n.cn-banner-widget--stacked .cn-banner-widget__reason {\n\tfont-size: 14px;\n}\n\n.cn-banner-widget--stacked .cn-banner-widget__action {\n\tmin-height: var(--cn-board-control-height, 40px);\n\tfont-size: 14px;\n}\n\n.cn-banner-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 10px;\n}\n\n.cn-banner-widget__action {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbox-sizing: border-box;\n\tmin-height: var(--default-clickable-area, 40px);\n\tmargin: 0;\n\tpadding: 0 16px;\n\tborder: 1px solid var(--color-border-maxcontrast);\n\tborder-radius: var(--border-radius-element, var(--border-radius-large, 8px));\n\tfont: inherit;\n\tfont-weight: 600;\n\ttext-decoration: none;\n\tcursor: pointer;\n}\n\n.cn-banner-widget__action--secondary {\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-banner-widget__action--secondary:hover {\n\tbackground: var(--color-background-hover);\n}\n\n.cn-banner-widget__action--primary {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n}\n\n.cn-banner-widget__action--primary:hover {\n\tborder-color: var(--color-primary-element-hover);\n\tbackground: var(--color-primary-element-hover);\n}\n\n.cn-banner-widget__action:focus-visible {\n\toutline: 2px solid var(--color-main-text);\n\toutline-offset: 2px;\n}\n</style>\n"],"names":["CnIcon","t"],"mappings":";;;;;;;;;;;AAuFA;AACA,MAAM,QAAS,GAAE,CAAC,MAAM,EAAE,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AK,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,EAAA;GACvD;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnBannerWidget.vue2.js","sources":["../../../../src/components/CnBannerWidget/CnBannerWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<section\n\t\tv-if=\"visible && isAttention\"\n\t\tclass=\"cn-banner-widget cn-banner-widget--attention\"\n\t\t:class=\"['cn-banner-widget--' + resolvedVariant, { 'cn-banner-widget--stacked': isStacked }]\"\n\t\t:aria-labelledby=\"headingId\"\n\t\tdata-testid=\"cn-banner-widget-attention\">\n\t\t<div class=\"cn-banner-widget__body\">\n\t\t\t<p v-if=\"resolvedKicker\" class=\"cn-banner-widget__kicker\">\n\t\t\t\t{{ resolvedKicker }}\n\t\t\t</p>\n\t\t\t<h3 :id=\"headingId\" class=\"cn-banner-widget__title\">\n\t\t\t\t{{ displayTitle }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"displayReason\" class=\"cn-banner-widget__reason\">\n\t\t\t\t{{ displayReason }}\n\t\t\t</p>\n\t\t</div>\n\t\t<div v-if=\"resolvedActions.length > 0\" class=\"cn-banner-widget__actions\">\n\t\t\t<component\n\t\t\t\t:is=\"action.href ? 'a' : 'button'\"\n\t\t\t\tv-for=\"action in resolvedActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\tclass=\"cn-banner-widget__action\"\n\t\t\t\t:class=\"action.primary ? 'cn-banner-widget__action--primary' : 'cn-banner-widget__action--secondary'\"\n\t\t\t\t:href=\"action.href || null\"\n\t\t\t\t:type=\"action.href ? null : 'button'\"\n\t\t\t\tdata-testid=\"cn-banner-widget-action\"\n\t\t\t\t@click=\"onActionClick($event, action)\">\n\t\t\t\t{{ action.label }}\n\t\t\t</component>\n\t\t</div>\n\t</section>\n\t<!-- The count could not be read. One quiet line, not the card and not an\n\t alarm: hidden would read as \"nothing to report\", which is not known. -->\n\t<p\n\t\tv-else-if=\"checkFailed\"\n\t\tclass=\"cn-banner-widget cn-banner-widget--unchecked\"\n\t\t:title=\"failureTooltip\"\n\t\tdata-testid=\"cn-banner-widget-unchecked\">\n\t\t<span class=\"cn-banner-widget__unchecked-text\">{{ uncheckedText }}</span>\n\t\t<span class=\"cn-banner-widget__unchecked-reason\">{{ failureTooltip }}</span>\n\t</p>\n\t<div v-else-if=\"visible\" class=\"cn-banner-widget\">\n\t\t<NcNoteCard :type=\"resolvedVariant\" class=\"cn-banner-widget__card\">\n\t\t\t<!-- A named icon replaces the variant's own glyph. -->\n\t\t\t<template v-if=\"resolvedIcon\" #icon>\n\t\t\t\t<CnIcon :name=\"resolvedIcon\" :size=\"22\" data-testid=\"cn-banner-widget-icon\" />\n\t\t\t</template>\n\t\t\t<span class=\"cn-banner-widget__line\">\n\t\t\t\t<component\n\t\t\t\t\t:is=\"clickable ? 'a' : 'span'\"\n\t\t\t\t\tclass=\"cn-banner-widget__text\"\n\t\t\t\t\t:class=\"{ 'cn-banner-widget__text--clickable': clickable }\"\n\t\t\t\t\t:href=\"clickable ? routeHref : null\"\n\t\t\t\t\tdata-testid=\"cn-banner-widget-text\"\n\t\t\t\t\t@click=\"onClick\"><strong v-if=\"displayLead\" class=\"cn-banner-widget__lead\" data-testid=\"cn-banner-widget-lead\">{{ displayLead }}</strong>{{ displayLead && displayText ? ' ' : '' }}{{ displayText }}</component>\n\t\t\t\t<!-- Board look: the actions as links at the end of the line. -->\n\t\t\t\t<a\n\t\t\t\t\tv-for=\"action in noteActions\"\n\t\t\t\t\t:key=\"action.key\"\n\t\t\t\t\tclass=\"cn-banner-widget__link\"\n\t\t\t\t\t:href=\"action.href || null\"\n\t\t\t\t\tdata-testid=\"cn-banner-widget-link\"\n\t\t\t\t\t@click=\"onActionClick($event, action)\">{{ action.label }}</a>\n\t\t\t</span>\n\t\t</NcNoteCard>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcNoteCard } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { followLinkClick, resolveHref } from '../../utils/linkNavigation.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { safeHref } from '../../utils/safeHref.js'\nimport { nextUid } from '../../utils/uid.js'\nimport { compareVisibleWhen, readVisibleWhenValue } from '../../utils/visibleWhen.js'\n\n/** Variants understood by NcNoteCard. */\nconst VARIANTS = ['info', 'warning', 'error', 'success']\n\n/** Layouts: the note card (default) or the attention card. */\nconst LAYOUTS = ['banner', 'attention']\n\n/** An attention card offers a primary and a secondary action, no more. */\nconst MAX_ACTIONS = 2\n\n/**\n * Under the board look the card takes what the boards draw: DqMijnWerk's\n * \"Vandaag eerst\" has three secondary actions and the primary one.\n */\nconst MAX_ACTIONS_BOARD = 4\n\n/**\n * CnBannerWidget — declarative notice banner for dashboards and v2 pages\n * (`banner` widget type, Wave 1 of nextcloud-vue#91).\n *\n * Renders a themed NcNoteCard with a variant (`info | warning | error`),\n * a text, an optional click-through route, and an optional `visibleWhen`\n * condition: a simple `{ field, op, value }` predicate evaluated against\n * an endpoint response or an OpenRegister source (the doriath\n * migration-banner case — \"show while `pending > 0`\").\n *\n * Config arrives either as flat props (v2 grid spreads `props`) or as a\n * stored `content` blob (CnDashboardPage's registry branch) — explicit\n * flat props win on collision.\n *\n * ```json\n * {\n * \"widgetKey\": \"banner\",\n * \"props\": {\n * \"variant\": \"warning\",\n * \"text\": \"Migrations pending — open the migration overview.\",\n * \"visibleWhen\": { \"endpoint\": \"/apps/doriath/api/migrations/status\", \"field\": \"pending\", \"op\": \"gt\", \"value\": 0 },\n * \"route\": \"migrations\"\n * }\n * }\n * ```\n *\n * Fail-safe: with a `visibleWhen`, the banner stays HIDDEN until the\n * condition evaluates true — a failed fetch never breaks (or spams) a\n * dashboard.\n *\n * An attention card (`layout: \"attention\"`) whose `visibleWhen` request\n * FAILS renders one quiet line instead, \"Could not check\", with the reason as\n * a tooltip. A hidden card reads as \"nothing needs attention\", and a failed\n * count does not know that. A request that succeeds with a value that does\n * not meet the condition still renders nothing.\n *\n * `layout: \"attention\"` turns the banner into an attention card: a card with\n * a coloured edge by severity, a `kicker` label, a `title`, a `reason` line\n * and up to two `actions` (the first is the primary one unless an action says\n * `primary` itself). `visibleWhen` works the same way. Without `layout` the\n * note card above renders, as it always did.\n *\n * ```json\n * {\n * \"widgetKey\": \"banner\",\n * \"props\": {\n * \"layout\": \"attention\",\n * \"variant\": \"error\",\n * \"kicker\": \"First today\",\n * \"title\": \"Parking permits city centre\",\n * \"reason\": \"The deadline ends today.\",\n * \"actions\": [\n * { \"label\": \"Open case\", \"route\": { \"name\": \"CaseDetail\", \"params\": { \"id\": \"2026-0061\" } } },\n * { \"label\": \"Suspend deadline\", \"route\": \"CaseSuspend\" }\n * ]\n * }\n * }\n * ```\n */\nexport default {\n\tname: 'CnBannerWidget',\n\n\tcomponents: { CnIcon, NcNoteCard },\n\n\tinject: {\n\t\t/**\n\t\t * The host's label lookup (CnAppRoot provides it); identity without one, so a\n\t\t * label that is not a key renders as written.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The app's look, provided by CnAppRoot or CnPageRenderer (`nextcloud` or `board`). */\n\t\tcnLook: { default: 'nextcloud' },\n\t\t/**\n\t\t * The detail page's object context (`{ objectId, object }`), provided by\n\t\t * CnDetailPage: a `visibleWhen.source` filter's `@objectId` and\n\t\t * `@object.<field>` tokens read it, so a notice on a record's page can\n\t\t * count that record's related rows. Null elsewhere.\n\t\t */\n\t\tcnObjectContext: { default: null },\n\t\t/** The page's pre-bound action dispatcher (CnPageRenderer), for an action with a `type`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Banner severity variant: `info | warning | error` (plus `success`\n\t\t * for completeness — NcNoteCard's set). Empty falls back to the\n\t\t * `content` blob, then `info`.\n\t\t */\n\t\tvariant: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t\tvalidator: (v) => v === '' || VARIANTS.includes(v),\n\t\t},\n\n\t\t/** Pre-translated banner text. Empty falls back to the `content` blob. */\n\t\ttext: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * A bold lead in front of the text (\"2 aanmeldingen wachten op\n\t\t * goedkeuring.\" before the rest of the sentence). `{value}` is replaced\n\t\t * like in `text`, and it goes through the app's translate. Empty falls\n\t\t * back to the `content` blob.\n\t\t */\n\t\tlead: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * A named icon (`AccountPlus`, `AlertOutline`, ...) drawn before the\n\t\t * text instead of the variant's own glyph. Empty falls back to the\n\t\t * `content` blob, then to the variant glyph.\n\t\t */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Optional visibility condition. Shape:\n\t\t * `{ endpoint?, source?, field?, op?, value }` — exactly one of\n\t\t * `endpoint` (a same-origin URL returning JSON) or `source`\n\t\t * (`{ register, schema, filter? }`, an OpenRegister object query whose\n\t\t * `filter` supports the shared @-token grammar). `field` is a\n\t\t * dot-path into the response (for a `source`, into the first result;\n\t\t * omit it — or use `@total` — to compare the collection total).\n\t\t * `op` is `eq | neq | gt | gte | lt | lte` (default `eq`); `value` is\n\t\t * the literal right-hand side. `null` (the default) shows the banner\n\t\t * unconditionally.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tvisibleWhen: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Optional click-through route: a vue-router route NAME (string) or\n\t\t * a full location object. When set, the banner text is a link to that\n\t\t * route. `null` renders static text.\n\t\t *\n\t\t * @type {string|object|null}\n\t\t */\n\t\troute: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * How the banner renders: `banner` (the note card, default) or\n\t\t * `attention` (a card with a severity edge, kicker, title, reason and\n\t\t * up to two actions). Empty falls back to the `content` blob, then\n\t\t * `banner`.\n\t\t *\n\t\t * @type {''|'banner'|'attention'}\n\t\t */\n\t\tlayout: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t\tvalidator: (v) => v === '' || LAYOUTS.includes(v),\n\t\t},\n\n\t\t/** Attention card: the small label above the title (\"First today\"). */\n\t\tkicker: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Attention card: the title. Falls back to `text` when empty. */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Attention card: the line under the title that says why this needs attention. `{value}` is replaced like in `text`. */\n\t\treason: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Attention card: its actions, two at most (four under the board look,\n\t\t * or `maxActions`). Each is `{ label, route?,\n\t\t * href?, primary?, id? }`: `route` is a route name or location,\n\t\t * `href` an URL. An action with neither renders a button that emits\n\t\t * `action`. The first action is the primary one unless one sets\n\t\t * `primary: true`.\n\t\t *\n\t\t * @type {Array<{label: string, route?: (string|object), href?: string, primary?: boolean, id?: string}>|null}\n\t\t */\n\t\tactions: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Attention card: how many actions it shows at most. Null takes the\n\t\t * default: two, four under the board look.\n\t\t *\n\t\t * @spec openspec/changes/screens-banner-actions-parity/specs/banner-actions/spec.md#requirement-the-board-attention-card-shows-the-boards-actions\n\t\t */\n\t\tmaxActions: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Attention card: stack the actions under the text instead of beside it,\n\t\t * the \"Begin hier\" card of PqMijnWerk (16px title, the action under the\n\t\t * reason). Falls back to the `content` blob.\n\t\t *\n\t\t * @spec openspec/changes/screens-start-here-banner/specs/start-here-banner/spec.md#requirement-a-card-can-stack-its-action-under-the-text\n\t\t */\n\t\tstacked: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Stored content blob (CnDashboardPage registry branch) carrying the\n\t\t * same keys as the flat props: `{ variant, text, visibleWhen, route,\n\t\t * layout, kicker, title, reason, actions }`. Explicit flat props win\n\t\t * on collision.\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Pre-evaluated `visibleWhen` outcome `{ met, value }`, injected by a\n\t\t * host that already ran the predicate (CnDashboardPage evaluates it\n\t\t * to know whether to collapse the banner's grid cell). When present,\n\t\t * the banner renders from this verdict instead of fetching again —\n\t\t * no duplicate request and no hidden-until-self-evaluated flash —\n\t\t * and `value` feeds the `{value}` text placeholder. `null` (the\n\t\t * default) keeps the banner self-evaluating. A host whose request\n\t\t * failed passes `{ met: false, value: null, failed: true, reason }`,\n\t\t * and an attention card then says it could not check.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tconditionOutcome: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The record of the page the banner sits on, as a detail-page host\n\t\t * binds it. A local `visibleWhen` (a `field` with no `endpoint` or\n\t\t * `source`) reads it when no `cnObjectContext` is provided, and it is\n\t\t * the card's subject: `{subject.@self.archived.by}` fills from it.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted when an attention-card action without a `route` or `href`\n\t\t * is clicked, so the host can run it.\n\t\t *\n\t\t * @event action\n\t\t * @type {{id: (string|undefined), label: string, index: number}}\n\t\t */\n\t\t'action',\n\t],\n\n\t/**\n\t * The banner's own state: the evaluated condition, the value it read,\n\t * and whether the request for it failed.\n\t *\n\t * @return {object} The state.\n\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t */\n\tdata() {\n\t\treturn {\n\t\t\t/** Id that ties the attention card's region to its title. */\n\t\t\theadingId: `cn-banner-title-${nextUid()}`,\n\t\t\t/** Evaluated visibleWhen outcome (null = not yet evaluated). */\n\t\t\tconditionMet: null,\n\t\t\t/**\n\t\t\t * The raw field value the predicate read (from the injected\n\t\t\t * outcome or the banner's own evaluation) — interpolated into\n\t\t\t * the text wherever it says `{value}`.\n\t\t\t */\n\t\t\tconditionValue: null,\n\t\t\t/**\n\t\t\t * The first row of the `visibleWhen` source query (its `order`\n\t\t\t * applied), the card's subject: `{subject.<field>}` in the texts\n\t\t\t * and `@subject.<field>` in an action route read it.\n\t\t\t */\n\t\t\tconditionRow: null,\n\t\t\t/** Whether the visibleWhen request itself failed (not: answered \"no\"). */\n\t\t\tconditionFailed: false,\n\t\t\t/** Why it failed, as the request reported it. */\n\t\t\tconditionFailureReason: '',\n\t\t\t/** Whether the browser says it is online, for `content.connection`. */\n\t\t\tonline: typeof navigator === 'undefined' || navigator.onLine !== false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The page record's id, so the condition is asked again once it is known.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/notice-scoped-to-the-record/specs/notice-scoped-to-the-record/spec.md#requirement-a-banners-source-may-be-scoped-to-the-pages-record\n\t\t */\n\t\ttokenContextKey() {\n\t\t\tconst ctx = this.tokenContext()\n\t\t\treturn ctx && ctx.objectId ? String(ctx.objectId) : ''\n\t\t},\n\n\t\t/** The effective variant (prop → content → 'info'). */\n\t\tresolvedVariant() {\n\t\t\tconst v = this.variant || (this.content && this.content.variant) || 'info'\n\t\t\treturn VARIANTS.includes(v) ? v : 'info'\n\t\t},\n\n\t\t/** The effective banner text (prop → content → ''), through the app's translate. */\n\t\tresolvedText() {\n\t\t\tconst text = this.text || (this.content && this.content.text) || ''\n\t\t\treturn text ? this.tl(text) : ''\n\t\t},\n\n\t\t/** The effective bold lead (prop → content → ''), through the app's translate. */\n\t\tresolvedLead() {\n\t\t\tconst lead = this.lead || (this.content && this.content.lead) || ''\n\t\t\treturn lead ? this.tl(lead) : ''\n\t\t},\n\n\t\t/** The lead with `{value}` filled in, else `content.fallbackLead`. */\n\t\tdisplayLead() {\n\t\t\treturn this.withFallback(this.fillValue(this.resolvedLead), this.resolvedLead, 'fallbackLead')\n\t\t},\n\n\t\t/** The effective icon name (prop → content → ''). */\n\t\tresolvedIcon() {\n\t\t\treturn this.icon || (this.content && this.content.icon) || ''\n\t\t},\n\n\t\t/**\n\t\t * The note card's actions as links, under the board look only: the\n\t\t * first resolved action of `actions`, as the board draws \"Beleid\n\t\t * wijzigen\" at the end of the line. Without the look the note card\n\t\t * ignores `actions`, as it always did.\n\t\t *\n\t\t * @return {Array<object>} The resolved actions (at most one).\n\t\t */\n\t\tnoteActions() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board' ? this.resolvedActions.slice(0, 1) : []\n\t\t},\n\n\t\t/**\n\t\t * `content.connection`: `offline` shows the banner only while the\n\t\t * device is offline, `online` only while it is online (DqInspectie\n\t\t * \"3 wijzigingen wachten op bereik\"); unset shows it either way.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tconnectionAllows() {\n\t\t\tconst connection = this.content && this.content.connection\n\t\t\tif (connection === 'offline') {\n\t\t\t\treturn !this.online\n\t\t\t}\n\t\t\tif (connection === 'online') {\n\t\t\t\treturn this.online\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/** The effective visibleWhen condition (prop → content → null). */\n\t\tresolvedVisibleWhen() {\n\t\t\treturn this.visibleWhen || (this.content && this.content.visibleWhen) || null\n\t\t},\n\n\t\t/**\n\t\t * Whether the condition is decided on the page's own record (a `field`\n\t\t * with no `endpoint` or `source`), which is then the card's subject.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-banner-can-read-the-pages-record\n\t\t */\n\t\tisLocalCondition() {\n\t\t\tconst cond = this.resolvedVisibleWhen\n\t\t\treturn Boolean(cond) && typeof cond === 'object' && !cond.endpoint && !cond.source && typeof cond.field === 'string' && cond.field !== ''\n\t\t},\n\n\t\t/**\n\t\t * The page's record, while the condition is a local one.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tlocalSubject() {\n\t\t\tif (!this.isLocalCondition) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst ctx = this.tokenContext()\n\t\t\treturn (ctx && ctx.object) || null\n\t\t},\n\n\t\t/** The effective injected outcome (prop → content → null). */\n\t\tresolvedConditionOutcome() {\n\t\t\treturn this.conditionOutcome || (this.content && this.content.conditionOutcome) || null\n\t\t},\n\n\t\t/**\n\t\t * The rendered text: `resolvedText` with `{value}` replaced by the\n\t\t * predicate's field value once one is known. Without a known value\n\t\t * the text renders as written — a `{value}` placeholder only makes\n\t\t * sense on a conditional banner, which stays hidden until its\n\t\t * predicate (and therefore its value) resolves.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tdisplayText() {\n\t\t\treturn this.withFallback(this.fillValue(this.resolvedText), this.resolvedText, 'fallbackText')\n\t\t},\n\n\t\t/** The effective click-through route (prop → content → null). */\n\t\tresolvedRoute() {\n\t\t\treturn this.route || (this.content && this.content.route) || null\n\t\t},\n\n\t\t/**\n\t\t * Whether the attention card renders instead of the note card.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tisAttention() {\n\t\t\treturn (this.layout || (this.content && this.content.layout) || 'banner') === 'attention'\n\t\t},\n\n\t\t/**\n\t\t * Whether the actions sit under the text.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisStacked() {\n\t\t\treturn this.stacked || Boolean(this.content && this.content.stacked)\n\t\t},\n\n\t\t/**\n\t\t * The attention card's kicker (prop, else content).\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tresolvedKicker() {\n\t\t\tconst kicker = this.kicker || (this.content && this.content.kicker) || ''\n\t\t\treturn kicker ? this.fillValue(this.tl(kicker)) : ''\n\t\t},\n\n\t\t/**\n\t\t * The attention card's title: `title`, else `text`, with `{value}` filled in.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tdisplayTitle() {\n\t\t\tconst title = this.title || (this.content && this.content.title) || ''\n\t\t\treturn title ? this.fillValue(this.tl(title)) : this.displayText\n\t\t},\n\n\t\t/**\n\t\t * The attention card's reason line. When the title already used\n\t\t * `text`, the text is not repeated here.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tdisplayReason() {\n\t\t\tconst reason = this.reason || (this.content && this.content.reason) || ''\n\t\t\tif (reason) {\n\t\t\t\treturn this.withFallback(this.fillValue(this.tl(reason)), reason, 'fallbackReason')\n\t\t\t}\n\t\t\tconst title = this.title || (this.content && this.content.title) || ''\n\t\t\t// A card that sets `text` to the same words as its `title` says\n\t\t\t// them once.\n\t\t\treturn title && this.displayText !== this.displayTitle ? this.displayText : ''\n\t\t},\n\n\t\t/**\n\t\t * The attention card's actions: the first `actionCap` that have a label, each\n\t\t * with its href and whether it is the primary one.\n\t\t *\n\t\t * @return {Array<{key: string, id: (string|undefined), label: string, href: string, target: (object|null), primary: boolean, index: number}>}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\t/**\n\t\t * How many actions the attention card shows: `maxActions` (prop, then\n\t\t * content), else four under the board look and two without it.\n\t\t *\n\t\t * @return {number} The cap.\n\t\t * @spec openspec/changes/screens-banner-actions-parity/specs/banner-actions/spec.md#requirement-the-board-attention-card-shows-the-boards-actions\n\t\t */\n\t\tactionCap() {\n\t\t\tconst explicit = this.maxActions ?? (this.content ? this.content.maxActions : undefined)\n\t\t\tif (Number.isInteger(explicit) && explicit > 0) {\n\t\t\t\treturn explicit\n\t\t\t}\n\t\t\treturn normalizeLook(this.cnLook) === 'board' ? MAX_ACTIONS_BOARD : MAX_ACTIONS\n\t\t},\n\n\t\tresolvedActions() {\n\t\t\tconst raw = this.actions || (this.content && this.content.actions) || []\n\t\t\tif (!Array.isArray(raw)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst usable = raw\n\t\t\t\t.filter((action) => action && typeof action === 'object' && typeof action.label === 'string' && action.label !== '')\n\t\t\t\t.slice(0, this.actionCap)\n\t\t\tconst declaredPrimary = usable.findIndex((action) => action.primary === true)\n\t\t\tconst primaryIndex = declaredPrimary === -1 ? 0 : declaredPrimary\n\t\t\treturn usable.map((action, index) => {\n\t\t\t\tlet target = null\n\t\t\t\tlet href = ''\n\t\t\t\tif (action.route) {\n\t\t\t\t\ttarget = typeof action.route === 'string' ? { name: action.route } : this.resolveSubject(action.route)\n\t\t\t\t\thref = resolveHref(target, this.$router)\n\t\t\t\t} else if (typeof action.href === 'string' && action.href !== '') {\n\t\t\t\t\tconst safe = safeHref(action.href)\n\t\t\t\t\thref = safe === '#' ? '' : safe\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tkey: `${index}-${action.id || action.label}`,\n\t\t\t\t\tid: action.id,\n\t\t\t\t\tlabel: this.tl(action.label),\n\t\t\t\t\thref,\n\t\t\t\t\ttarget,\n\t\t\t\t\tdispatch: !target && !href && typeof action.type === 'string' && action.type !== '' ? action : null,\n\t\t\t\t\tprimary: index === primaryIndex,\n\t\t\t\t\tindex,\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Whether the banner renders: no condition = always; else the evaluated outcome.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tvisible() {\n\t\t\tif (!this.connectionAllows) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst title = this.title || (this.content && this.content.title) || ''\n\t\t\tif (this.resolvedText === '' && this.resolvedLead === '' && !(this.isAttention && title !== '')) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t// Every line emptied by a subject token with no value: nothing to say.\n\t\t\tif (!this.isAttention && this.displayText === '' && this.displayLead === '') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (!this.resolvedVisibleWhen) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn this.conditionMet === true\n\t\t},\n\n\t\t/**\n\t\t * Whether to say the check failed: an attention card, with words to\n\t\t * show, whose `visibleWhen` request failed. A plain banner stays\n\t\t * hidden on failure, as it always did.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t\t */\n\t\tcheckFailed() {\n\t\t\tconst title = this.title || (this.content && this.content.title) || ''\n\t\t\treturn this.isAttention\n\t\t\t\t&& !!this.resolvedVisibleWhen\n\t\t\t\t&& this.conditionFailed\n\t\t\t\t&& (title !== '' || this.resolvedText !== '')\n\t\t},\n\n\t\t/**\n\t\t * The one line shown when the check failed. It names the card by its\n\t\t * title, unless the title needs the value that could not be read.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t\t */\n\t\tuncheckedText() {\n\t\t\tconst title = this.title || (this.content && this.content.title) || this.resolvedText\n\t\t\tif (!title || title.includes('{value}') || title.includes('{subject.')) {\n\t\t\t\treturn t('nextcloud-vue', 'Could not check')\n\t\t\t}\n\t\t\t// `escape: false`: the result is rendered through `{{ }}`, which escapes.\n\t\t\treturn t('nextcloud-vue', 'Could not check: {subject}', { subject: title }, undefined, { escape: false })\n\t\t},\n\n\t\t/**\n\t\t * The reason the check failed, for the tooltip and for assistive\n\t\t * technology.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t\t */\n\t\tfailureTooltip() {\n\t\t\tif (!this.conditionFailureReason) {\n\t\t\t\treturn t('nextcloud-vue', 'The check failed.')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'The check failed: {reason}', { reason: this.conditionFailureReason }, undefined, { escape: false })\n\t\t},\n\n\t\t/** Whether the banner navigates on click (route set + router present). */\n\t\tclickable() {\n\t\t\treturn !!this.resolvedRoute && !!this.$router\n\t\t},\n\n\t\t/** The click-through route as a router location (a string is a route name). */\n\t\trouteLocation() {\n\t\t\tconst route = this.resolvedRoute\n\t\t\treturn typeof route === 'string' ? { name: route } : route\n\t\t},\n\n\t\t/** The href of the click-through link. */\n\t\trouteHref() {\n\t\t\treturn resolveHref(this.routeLocation, this.$router)\n\t\t},\n\t},\n\n\twatch: {\n\t\tresolvedVisibleWhen: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.evaluateCondition()\n\t\t\t},\n\t\t},\n\n\t\tresolvedConditionOutcome() {\n\t\t\tthis.evaluateCondition()\n\t\t},\n\n\t\t/** The page's record arrived or changed: a token-scoped source asks again. */\n\t\ttokenContextKey() {\n\t\t\tthis.evaluateCondition()\n\t\t},\n\n\t\t/** A local condition reads the record itself, so a new record is a new answer. */\n\t\tlocalSubject() {\n\t\t\tif (this.isLocalCondition) {\n\t\t\t\tthis.evaluateCondition()\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\twindow.addEventListener('online', this.onConnection)\n\t\twindow.addEventListener('offline', this.onConnection)\n\t},\n\n\tbeforeUnmount() {\n\t\twindow.removeEventListener('online', this.onConnection)\n\t\twindow.removeEventListener('offline', this.onConnection)\n\t},\n\n\tmethods: {\n\t\t/** Follow the browser's connection, for `content.connection`. */\n\t\tonConnection() {\n\t\t\tthis.online = typeof navigator === 'undefined' || navigator.onLine !== false\n\t\t},\n\n\t\t/**\n\t\t * A manifest string through the host's label lookup (`cnTranslate`), so a key\n\t\t * such as \"Mine\" reads in the user's language.\n\t\t *\n\t\t * @param {string} text The text as written in the manifest.\n\t\t * @return {string} The translated text.\n\t\t */\n\t\ttl(text) {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\t/**\n\t\t * Replace `{value}` in a text by the value the predicate read, once\n\t\t * one is known.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The text with the value filled in.\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t */\n\t\tfillValue(text) {\n\t\t\tlet out = text\n\t\t\tif (this.conditionValue !== null && out.includes('{value}')) {\n\t\t\t\tout = out.replaceAll('{value}', String(this.conditionValue))\n\t\t\t}\n\t\t\treturn this.fillSubject(out)\n\t\t},\n\n\t\t/**\n\t\t * The filled text, or the content's fallback when a subject token left\n\t\t * the written text empty (\"filed it on {subject.@self.archived.at|date}\"\n\t\t * on a record that carries no date). The fallback is filled too.\n\t\t *\n\t\t * @param {string} filled The filled text.\n\t\t * @param {string} written The text as written.\n\t\t * @param {string} key The content key holding the fallback.\n\t\t * @return {string} The text to show.\n\t\t * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-banner-can-read-the-pages-record\n\t\t */\n\t\twithFallback(filled, written, key) {\n\t\t\tif (filled !== '' || !written) {\n\t\t\t\treturn filled\n\t\t\t}\n\t\t\tconst fallback = this.content && typeof this.content[key] === 'string' ? this.content[key] : ''\n\t\t\treturn fallback ? this.fillValue(this.tl(fallback)) : ''\n\t\t},\n\n\t\t/**\n\t\t * Fill `{subject.<field>}` (and `{subject.<field>|date}`, `|days`) from\n\t\t * the card's subject row. A token with no value empties the whole text,\n\t\t * as in a record list. Text without a subject token is untouched.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The filled text.\n\t\t * @spec openspec/changes/screens-start-here-banner/specs/start-here-banner/spec.md#requirement-a-banner-can-name-the-first-row-of-a-query\n\t\t */\n\t\tfillSubject(text) {\n\t\t\tif (typeof text !== 'string' || !text.includes('{subject.')) {\n\t\t\t\treturn text\n\t\t\t}\n\t\t\t// `{value}` is not a subject token: keep it out of the template fill.\n\t\t\tconst guard = '\\u0000value\\u0000'\n\t\t\tconst filled = fillTemplate(text.replaceAll('{value}', guard), { subject: this.conditionRow || {} })\n\t\t\treturn filled.replaceAll(guard, '{value}')\n\t\t},\n\n\t\t/**\n\t\t * Replace `@subject.<field>` strings anywhere in an action route\n\t\t * (params, query) by the subject's value.\n\t\t *\n\t\t * @param {unknown} node A route name, location or any nested part of one.\n\t\t * @return {unknown} The same shape with the tokens resolved.\n\t\t * @spec openspec/changes/screens-start-here-banner/specs/start-here-banner/spec.md#requirement-a-banner-can-name-the-first-row-of-a-query\n\t\t */\n\t\tresolveSubject(node) {\n\t\t\tif (typeof node === 'string') {\n\t\t\t\tif (!node.startsWith('@subject.')) {\n\t\t\t\t\treturn node\n\t\t\t\t}\n\t\t\t\tconst value = this.conditionRow ? readPath(this.conditionRow, node.slice('@subject.'.length)) : undefined\n\t\t\t\treturn value === undefined || value === null ? '' : String(value)\n\t\t\t}\n\t\t\tif (Array.isArray(node)) {\n\t\t\t\treturn node.map((item) => this.resolveSubject(item))\n\t\t\t}\n\t\t\tif (node && typeof node === 'object') {\n\t\t\t\treturn Object.fromEntries(Object.entries(node).map(([key, value]) => [key, this.resolveSubject(value)]))\n\t\t\t}\n\t\t\treturn node\n\t\t},\n\n\t\t/**\n\t\t * Run an attention-card action: route an in-app link, leave an\n\t\t * external link to the browser, dispatch a manifest action (one with a\n\t\t * `type`) through the page with its `@subject.` tokens filled, and\n\t\t * emit `action` for any other button.\n\t\t *\n\t\t * @param {MouseEvent} event The click.\n\t\t * @param {object} action The resolved action.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-attention-card\n\t\t * @spec openspec/changes/banner-action-dispatch/specs/banner-action-dispatch/spec.md#requirement-a-banner-action-can-be-a-manifest-action-on-the-subject\n\t\t */\n\t\tonActionClick(event, action) {\n\t\t\tif (action.target) {\n\t\t\t\tfollowLinkClick(event, action.target, this.$router)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (action.dispatch && typeof this.cnDispatchAction === 'function') {\n\t\t\t\tthis.cnDispatchAction(this.resolveSubject(action.dispatch))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!action.href) {\n\t\t\t\tthis.$emit('action', { id: action.id, label: action.label, index: action.index })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The token context a `visibleWhen.source` filter resolves against: the\n\t\t * detail page's record, when the banner sits on one.\n\t\t *\n\t\t * @return {{objectId?: string, object?: object}|undefined}\n\t\t * @spec openspec/changes/notice-scoped-to-the-record/specs/notice-scoped-to-the-record/spec.md#requirement-a-banners-source-may-be-scoped-to-the-pages-record\n\t\t */\n\t\ttokenContext() {\n\t\t\tconst raw = this.cnObjectContext\n\t\t\tconst ctx = raw && typeof raw === 'object' && 'value' in raw ? raw.value : raw\n\t\t\tif (ctx && typeof ctx === 'object' && ctx.objectId) {\n\t\t\t\treturn { objectId: ctx.objectId, object: ctx.object || this.objectData || undefined }\n\t\t\t}\n\t\t\tconst own = this.objectData\n\t\t\tif (own && typeof own === 'object') {\n\t\t\t\tconst id = own.id || (own['@self'] && own['@self'].id) || ''\n\t\t\t\treturn { objectId: id, object: own }\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\n\t\t/**\n\t\t * Resolve the `visibleWhen` verdict. A host-injected\n\t\t * `conditionOutcome` wins outright — the host already ran the\n\t\t * predicate, so re-fetching would double the request and flash the\n\t\t * banner hidden until its own copy resolved. Otherwise evaluate\n\t\t * through the shared util primitives (endpoint / OpenRegister-source\n\t\t * modes — the Wave-1 banner shape is the canonical one, extracted to\n\t\t * `utils/visibleWhen.js` in Wave 3 so manifest actions reuse it),\n\t\t * keeping the read VALUE for the `{value}` text placeholder.\n\t\t * Fail-safe: any fetch/shape error leaves the banner hidden. The\n\t\t * failure is kept (`conditionFailed`, with its reason) so an\n\t\t * attention card can say it could not check.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/live-check-follow-ups/specs/live-check-follow-ups/spec.md#requirement-an-attention-card-says-when-it-could-not-check\n\t\t */\n\t\tasync evaluateCondition() {\n\t\t\tconst outcome = this.resolvedConditionOutcome\n\t\t\tif (outcome) {\n\t\t\t\tthis.conditionMet = outcome.met === true\n\t\t\t\tthis.conditionValue = outcome.value !== undefined ? outcome.value : null\n\t\t\t\tthis.conditionRow = outcome.row && typeof outcome.row === 'object' ? outcome.row : null\n\t\t\t\tthis.conditionFailed = outcome.failed === true\n\t\t\t\tthis.conditionFailureReason = outcome.failed === true && typeof outcome.reason === 'string' ? outcome.reason : ''\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst cond = this.resolvedVisibleWhen\n\t\t\tif (!cond) {\n\t\t\t\tthis.conditionMet = null\n\t\t\t\tthis.conditionValue = null\n\t\t\t\tthis.conditionRow = null\n\t\t\t\tthis.conditionFailed = false\n\t\t\t\tthis.conditionFailureReason = ''\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst sink = {}\n\t\t\t\tconst ctx = this.tokenContext()\n\t\t\t\tconst value = await readVisibleWhenValue(cond, ctx, sink)\n\t\t\t\tthis.conditionRow = sink.row || (this.isLocalCondition && ctx ? ctx.object : null) || null\n\t\t\t\tthis.conditionValue = value\n\t\t\t\tthis.conditionMet = compareVisibleWhen(value, cond.op || 'eq', cond.value)\n\t\t\t\tthis.conditionFailed = false\n\t\t\t\tthis.conditionFailureReason = ''\n\t\t\t} catch (error) {\n\t\t\t\t// Still hidden: a banner that cannot tell whether it applies\n\t\t\t\t// should not claim attention. But not silently, because a\n\t\t\t\t// failed count and \"nothing to report\" look the same on screen.\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnBannerWidget] visibleWhen could not be evaluated, banner hidden:', error?.message || error)\n\t\t\t\tthis.conditionMet = false\n\t\t\t\tthis.conditionValue = null\n\t\t\t\tthis.conditionRow = null\n\t\t\t\tthis.conditionFailed = true\n\t\t\t\tthis.conditionFailureReason = typeof error?.message === 'string' ? error.message : String(error ?? '')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Route a plain click on the link; a modified click opens the href\n\t\t * in the browser.\n\t\t *\n\t\t * @param {MouseEvent} event The click event.\n\t\t * @return {void}\n\t\t */\n\t\tonClick(event) {\n\t\t\tif (!this.clickable) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfollowLinkClick(event, this.routeLocation, this.$router)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-banner-widget {\n\twidth: 100%;\n}\n\n/* Doubled: NcNoteCard's own `.notecard` margin (15px above and below) is as\n strong as one scoped class and loads later, so the card kept it and stood\n 15px under its grid cell's top (DqDashboard info line, r33).\n @spec openspec/changes/banner-card-no-margin/specs/banner-card-no-margin/spec.md#requirement-a-banner-card-draws-no-margin-of-its-own */\n.cn-banner-widget__card.cn-banner-widget__card {\n\tmargin: 0;\n}\n\n.cn-banner-widget__line {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: baseline;\n\tgap: 4px 20px;\n}\n\n.cn-banner-widget__lead {\n\tfont-weight: 700;\n}\n\n.cn-banner-widget__link {\n\tmargin-inline-start: auto;\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-banner-widget__text--clickable {\n\tcursor: pointer;\n\ttext-decoration: underline;\n\tcolor: inherit;\n}\n\n/* The check failed. Muted text, no fill, no severity colour: it is a note\n that something is not known, not a warning. */\n.cn-banner-widget--unchecked {\n\tbox-sizing: border-box;\n\tmargin: 0;\n\tpadding: 8px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n\tcursor: help;\n}\n\n/* The reason, for assistive technology; sighted readers get the tooltip. */\n.cn-banner-widget__unchecked-reason {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tmargin: -1px;\n\tpadding: 0;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\twhite-space: nowrap;\n\tborder: 0;\n}\n\n/* Attention card. The severity edge is an inset shadow, so it takes no width. */\n.cn-banner-widget--attention {\n\t--cn-banner-accent: var(--color-primary-element);\n\t--cn-banner-accent-text: var(--color-primary-element);\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 16px 24px;\n\tbox-sizing: border-box;\n\tpadding: 20px 24px 20px 28px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-container, var(--border-radius-large, 12px));\n\tbackground: var(--color-main-background);\n\tbox-shadow: inset 4px 0 0 0 var(--cn-banner-accent);\n}\n\n.cn-banner-widget--attention.cn-banner-widget--warning {\n\t--cn-banner-accent: var(--color-element-warning, var(--color-warning));\n\t--cn-banner-accent-text: var(--color-text-warning, var(--color-warning-text, var(--color-main-text)));\n}\n\n.cn-banner-widget--attention.cn-banner-widget--error {\n\t--cn-banner-accent: var(--color-element-error, var(--color-error));\n\t--cn-banner-accent-text: var(--color-text-error, var(--color-error-text));\n}\n\n.cn-banner-widget--attention.cn-banner-widget--success {\n\t--cn-banner-accent: var(--color-element-success, var(--color-success));\n\t--cn-banner-accent-text: var(--color-text-success, var(--color-success-text));\n}\n\n.cn-banner-widget__body {\n\tdisplay: flex;\n\tflex: 1 1 320px;\n\tflex-direction: column;\n\tgap: 6px;\n\tmin-width: 0;\n}\n\n.cn-banner-widget__kicker {\n\tmargin: 0;\n\tfont-size: 0.85em;\n\tfont-weight: 700;\n\tletter-spacing: 0.06em;\n\ttext-transform: uppercase;\n\tcolor: var(--cn-banner-accent-text);\n}\n\n.cn-banner-widget__title {\n\tmargin: 0;\n\tfont-size: 1.3em;\n\tfont-weight: 700;\n\tline-height: 1.3;\n\tcolor: var(--color-main-text);\n}\n\n.cn-banner-widget__reason {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* Stacked (PqMijnWerk \"Begin hier\"): the text, then the action under it. */\n.cn-banner-widget--stacked {\n\tflex-direction: column;\n\talign-items: flex-start;\n\tgap: 10px;\n}\n\n.cn-banner-widget--stacked .cn-banner-widget__body {\n\tflex: 0 0 auto;\n\tgap: 10px;\n}\n\n.cn-banner-widget--stacked .cn-banner-widget__title {\n\tfont-size: 16px;\n\tline-height: 1.4;\n}\n\n.cn-banner-widget--stacked .cn-banner-widget__reason {\n\tfont-size: 14px;\n}\n\n.cn-banner-widget--stacked .cn-banner-widget__action {\n\tmin-height: var(--cn-board-control-height, 40px);\n\tfont-size: 14px;\n}\n\n.cn-banner-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 10px;\n}\n\n.cn-banner-widget__action {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbox-sizing: border-box;\n\tmin-height: var(--default-clickable-area, 40px);\n\tmargin: 0;\n\tpadding: 0 16px;\n\tborder: 1px solid var(--color-border-maxcontrast);\n\tborder-radius: var(--border-radius-element, var(--border-radius-large, 8px));\n\tfont: inherit;\n\tfont-weight: 600;\n\ttext-decoration: none;\n\tcursor: pointer;\n}\n\n.cn-banner-widget__action--secondary {\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-banner-widget__action--secondary:hover {\n\tbackground: var(--color-background-hover);\n}\n\n.cn-banner-widget__action--primary {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n}\n\n.cn-banner-widget__action--primary:hover {\n\tborder-color: var(--color-primary-element-hover);\n\tbackground: var(--color-primary-element-hover);\n}\n\n.cn-banner-widget__action:focus-visible {\n\toutline: 2px solid var(--color-main-text);\n\toutline-offset: 2px;\n}\n</style>\n"],"names":["CnIcon","t"],"mappings":";;;;;;;;;;;AAuFA;AACA,MAAM,QAAS,GAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAA;;AAEvD;AACA,MAAM,OAAM,GAAI,CAAC,QAAQ,EAAE,WAAW,EAAA;;AAEtC;AACA,MAAM,cAAc,EAAA;;AAEpB;;;;AAIA,MAAM,iBAAgB,GAAI,EAAA;;AAE1B;;AAEC;AACA;;;;;AAKA;AACA;;;;AAIA;AACA;;AAEA;AACA;AACA;;;AAGA;;;AAGA;AACA;;;;AAIA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;AAKA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;AAEtB,CAAA,UAAU,EAAE,UAAEA,UAAM,EAAE,UAAS,EAAG;;AAElC,CAAA,MAAM,EAAE;AACP;AACC;AACA;;AAED,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;AAC5C;EACA,MAAM,EAAE,EAAE,OAAO,EAAE,WAAU,EAAG;AAChC;;;;AAIC;;AAED,EAAA,eAAe,EAAE,EAAE,OAAO,EAAE,IAAG,EAAG;AAClC;AACA,EAAA,gBAAgB,EAAE,EAAE,OAAO,EAAE,MAAM;EACnC;;AAED,CAAA,KAAK,EAAE;AACN;;;;;AAKA,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;AACX,GAAA,SAAS,EAAE,CAAC,CAAC,KAAK,MAAM,EAAC,IAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC,CA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