@conduction/nextcloud-vue 2.56.0-beta.70 → 2.56.0-beta.71
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/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +67 -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/CnDetailPage/CnDetailPage.vue2.js +55 -6
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +40 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePage.vue.js +1 -1
- package/dist/esm/components/CnStorePage/CnStorePage.vue2.js +3 -3
- package/dist/esm/components/CnStorePage/CnStorePage.vue2.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePage.vue3.js +5 -5
- package/dist/esm/components/CnStorePage/CnStorePage.vue3.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue.js +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue2.js +6 -6
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue3.js +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +59 -59
- package/dist/esm/l10n/nl.json.js +59 -59
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +55 -55
- package/dist/esm/utils/parentCrumb.js +86 -0
- package/dist/esm/utils/parentCrumb.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +813 -576
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +55 -55
- package/l10n/en.json +59 -59
- package/l10n/nl.json +59 -59
- package/package.json +1 -1
- package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +67 -1
- package/src/components/CnDetailPage/CnDetailPage.vue +55 -6
- package/src/components/CnIndexPage/CnIndexPage.vue +40 -1
- package/src/components/CnStorePage/CnStorePage.vue +8 -8
- package/src/components/CnStorePage/CnStorePublishDialog.vue +7 -7
- package/src/utils/parentCrumb.js +83 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnChecklistRunWidget.vue2.js","sources":["../../../../src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-checklist-run\" data-testid=\"cn-checklist-run\">\n\t\t<p v-if=\"error\"\n\t\t\tclass=\"cn-checklist-run__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-checklist-run-error\">\n\t\t\t{{ error }}\n\t\t</p>\n\t\t<div v-else-if=\"loading\" class=\"cn-checklist-run__loading\">\n\t\t\t<NcLoadingIcon :size=\"20\" :name=\"loadingLabel\" />\n\t\t</div>\n\t\t<p v-else-if=\"questions.length === 0\" class=\"cn-checklist-run__empty\" data-testid=\"cn-checklist-run-empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<form v-else\n\t\t\tclass=\"cn-checklist-run__form\"\n\t\t\tnovalidate\n\t\t\t@submit.prevent=\"next\">\n\t\t\t<div v-if=\"timeLeftText || savedLine\" class=\"cn-checklist-run__status\">\n\t\t\t\t<span v-if=\"timeLeftText\"\n\t\t\t\t\tclass=\"cn-checklist-run__time-left\"\n\t\t\t\t\t:class=\"{ 'cn-checklist-run__time-left--warning': timeWarning }\"\n\t\t\t\t\trole=\"timer\"\n\t\t\t\t\taria-live=\"off\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-time-left\">\n\t\t\t\t\t{{ timeLeftText }}\n\t\t\t\t</span>\n\t\t\t\t<span v-if=\"savedLine\"\n\t\t\t\t\tclass=\"cn-checklist-run__saved\"\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-saved\">\n\t\t\t\t\t{{ savedLine }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<p\n\t\t\t\tref=\"position\"\n\t\t\t\tclass=\"cn-checklist-run__position\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\tdata-testid=\"cn-checklist-run-position\">\n\t\t\t\t{{ positionText }}\n\t\t\t</p>\n\t\t\t<span\n\t\t\t\tclass=\"cn-checklist-run__progress\"\n\t\t\t\trole=\"progressbar\"\n\t\t\t\t:aria-label=\"progressLabel\"\n\t\t\t\taria-valuemin=\"0\"\n\t\t\t\t:aria-valuemax=\"questions.length\"\n\t\t\t\t:aria-valuenow=\"answeredCount\"\n\t\t\t\tdata-testid=\"cn-checklist-run-progress\">\n\t\t\t\t<span class=\"cn-checklist-run__progress-fill\" :style=\"{ width: `${progressShare}%` }\" />\n\t\t\t</span>\n\t\t\t<span class=\"cn-checklist-run__live\" aria-live=\"polite\">{{ liveText }}</span>\n\n\t\t\t<p v-if=\"pageGroup\" class=\"cn-checklist-run__group\" data-testid=\"cn-checklist-run-group\">\n\t\t\t\t{{ pageGroup }}\n\t\t\t</p>\n\t\t\t<fieldset\n\t\t\t\tv-for=\"question in pageQuestions\"\n\t\t\t\t:key=\"question.id\"\n\t\t\t\tclass=\"cn-checklist-run__question\"\n\t\t\t\t:aria-describedby=\"question.help ? `${uid}-help-${question.id}` : null\"\n\t\t\t\tdata-testid=\"cn-checklist-run-question\">\n\t\t\t\t<legend class=\"cn-checklist-run__legend\">\n\t\t\t\t\t{{ question.text }}<span v-if=\"question.required\" class=\"cn-checklist-run__required\">\n\t\t\t\t\t\t<span aria-hidden=\"true\"> *</span><span class=\"cn-checklist-run__sr\">{{ requiredLabel }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</legend>\n\t\t\t\t<p v-if=\"question.help\" :id=\"`${uid}-help-${question.id}`\" class=\"cn-checklist-run__help\">\n\t\t\t\t\t{{ question.help }}\n\t\t\t\t</p>\n\t\t\t\t<template v-if=\"question.choices.length\">\n\t\t\t\t\t<label\n\t\t\t\t\t\tv-for=\"choice in question.choices\"\n\t\t\t\t\t\t:key=\"choice.value\"\n\t\t\t\t\t\tclass=\"cn-checklist-run__choice\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tv-model=\"draft[question.id].value\"\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t:name=\"`${uid}-${question.id}`\"\n\t\t\t\t\t\t\t:value=\"choice.value\"\n\t\t\t\t\t\t\t:required=\"question.required\"\n\t\t\t\t\t\t\tdata-testid=\"cn-checklist-run-choice\"\n\t\t\t\t\t\t\t@change=\"markDirty(question.id)\">\n\t\t\t\t\t\t{{ choice.label }}\n\t\t\t\t\t</label>\n\t\t\t\t</template>\n\t\t\t\t<input\n\t\t\t\t\tv-else-if=\"question.kind === 'number'\"\n\t\t\t\t\tv-model=\"draft[question.id].value\"\n\t\t\t\t\tclass=\"cn-checklist-run__number\"\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tinputmode=\"decimal\"\n\t\t\t\t\t:aria-label=\"question.text\"\n\t\t\t\t\t:required=\"question.required\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-number\"\n\t\t\t\t\t@input=\"markDirty(question.id)\">\n\t\t\t\t<p v-else-if=\"question.kind === 'photo'\" class=\"cn-checklist-run__help\">\n\t\t\t\t\t{{ photoOnlyLabel }}\n\t\t\t\t</p>\n\t\t\t\t<textarea\n\t\t\t\t\tv-else\n\t\t\t\t\tv-model=\"draft[question.id].value\"\n\t\t\t\t\tclass=\"cn-checklist-run__text\"\n\t\t\t\t\trows=\"3\"\n\t\t\t\t\t:aria-label=\"question.text\"\n\t\t\t\t\t:required=\"question.required\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-text\"\n\t\t\t\t\t@input=\"markDirty(question.id)\" />\n\t\t\t\t<label v-if=\"allowNote && noteShown(question)\" class=\"cn-checklist-run__note-label\">\n\t\t\t\t\t{{ noteLabel }}\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tv-model=\"draft[question.id].note\"\n\t\t\t\t\t\tclass=\"cn-checklist-run__text\"\n\t\t\t\t\t\trows=\"2\"\n\t\t\t\t\t\tdata-testid=\"cn-checklist-run-note\"\n\t\t\t\t\t\t@input=\"markDirty(question.id)\" />\n\t\t\t\t</label>\n\t\t\t\t<CnGeoCaptureField\n\t\t\t\t\tv-if=\"locationField && (locating[question.id] || draft[question.id].location)\"\n\t\t\t\t\t:modelValue=\"draft[question.id].location || null\"\n\t\t\t\t\t:busy=\"locating[question.id] === true\"\n\t\t\t\t\t:goodAccuracy=\"goodAccuracy\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-location\"\n\t\t\t\t\t@update:modelValue=\"setLocation(question.id, $event)\" />\n\t\t\t\t<p\n\t\t\t\t\tv-if=\"missing.includes(question.id)\"\n\t\t\t\t\tclass=\"cn-checklist-run__error\"\n\t\t\t\t\trole=\"alert\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-missing\">\n\t\t\t\t\t{{ missingLabel }}\n\t\t\t\t</p>\n\t\t\t</fieldset>\n\n\t\t\t<div\n\t\t\t\tv-for=\"question in photoQuestions\"\n\t\t\t\t:key=\"`photos-${question.id}`\"\n\t\t\t\tclass=\"cn-checklist-run__photos\"\n\t\t\t\tdata-testid=\"cn-checklist-run-photos\">\n\t\t\t\t<strong class=\"cn-checklist-run__photos-title\">{{ photoTitle(question) }}</strong>\n\t\t\t\t<ul v-if=\"photoNamesFor(question).length\" class=\"cn-checklist-run__photo-list\">\n\t\t\t\t\t<li v-for=\"name in photoNamesFor(question)\" :key=\"name\" data-testid=\"cn-checklist-run-photo\">\n\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t<!-- A button that opens the hidden file input, so the control is\n\t\t\t\t a button to every reader; the input stays out of the tab\n\t\t\t\t order and the accessibility tree. -->\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-checklist-run__photo-button\"\n\t\t\t\t\t:aria-describedby=\"missingPhoto.includes(question.id) ? `${uid}-photo-${question.id}` : null\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-photo-button\"\n\t\t\t\t\t@click=\"openPhotoPicker\">\n\t\t\t\t\t<CameraOutline :size=\"16\" />\n\t\t\t\t\t{{ photoNamesFor(question).length || (storedPhotos[question.id] || []).length ? morePhotoLabel : addPhotoLabel }}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\tclass=\"cn-checklist-run__photo-input\"\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\tcapture=\"environment\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-photo-input\"\n\t\t\t\t\t@change=\"addPhotos($event, question.id)\">\n\t\t\t\t<p\n\t\t\t\t\tv-if=\"missingPhoto.includes(question.id)\"\n\t\t\t\t\t:id=\"`${uid}-photo-${question.id}`\"\n\t\t\t\t\tclass=\"cn-checklist-run__error\"\n\t\t\t\t\trole=\"alert\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-missing-photo\">\n\t\t\t\t\t{{ missingPhotoLabel }}\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t<div class=\"cn-checklist-run__nav\">\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t:disabled=\"page === 0 || saving || closed\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-previous\"\n\t\t\t\t\t@click=\"previous\">\n\t\t\t\t\t{{ previousLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton v-if=\"submitLabel\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t:disabled=\"saving || closed\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-submit\"\n\t\t\t\t\t@click=\"submit\">\n\t\t\t\t\t{{ submitLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton v-if=\"!submitLabel || !isLastPage\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t:disabled=\"saving || closed\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-next\">\n\t\t\t\t\t{{ isLastPage ? finishLabel : nextLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<p v-if=\"saveError\"\n\t\t\t\tclass=\"cn-checklist-run__error\"\n\t\t\t\trole=\"alert\"\n\t\t\t\tdata-testid=\"cn-checklist-run-save-error\">\n\t\t\t\t{{ saveError }}\n\t\t\t</p>\n\t\t</form>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcLoadingIcon } from '@nextcloud/vue'\nimport CameraOutline from 'vue-material-design-icons/CameraOutline.vue'\nimport { uploadHeldFiles } from '../../composables/useHeldFileUpload.js'\nimport { dispatchAction } from '../../utils/actionsDispatcher.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { captureLocation } from '../../utils/captureLocation.js'\nimport { parseDateValue } from '../../utils/dateVariant.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { hasUnresolvedTokens, resolveDeepTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\nimport { CnGeoCaptureField } from '../CnGeoCaptureField/index.js'\n\nconst OBJECT_API = '/apps/openregister/api/objects'\nconst TICK_MS = 1000\nconst DEFAULT_TIME_WARNING_SECONDS = 300\nconst LAST_MINUTE_SECONDS = 60\n\nlet instanceCounter = 0\n\n/**\n * The choices a question type offers, before translation.\n *\n * @type {Record<string, Array<{value: string, label: string}>>}\n */\nconst TYPE_CHOICES = Object.freeze({\n\tyes_no: [{ key: 'yes', label: 'Yes' }, { key: 'no', label: 'No' }],\n\tyes_no_na: [{ key: 'yes', label: 'Yes' }, { key: 'no', label: 'No' }, { key: 'na', label: 'Not applicable' }],\n})\n\n/** The kinds of question the widget draws. */\nconst KINDS = Object.freeze(['yes_no', 'yes_no_na', 'choice', 'text', 'number', 'photo'])\n\n/**\n * Sort by a numeric field, lowest first, keeping the given order for ties and\n * for entries without the field.\n *\n * @param {Array<object>} list The entries.\n * @param {string} field The field.\n * @return {Array<object>} A sorted copy.\n */\nfunction byOrder(list, field) {\n\tif (!field) {\n\t\treturn [...list]\n\t}\n\tconst rank = (entry) => {\n\t\tconst n = Number(readPath(entry, field))\n\t\treturn Number.isFinite(n) ? n : Infinity\n\t}\n\treturn list.map((entry, index) => ({ entry, index })).sort((a, b) => (rank(a.entry) - rank(b.entry)) || (a.index - b.index)).map(({ entry }) => entry)\n}\n\n/**\n * A register or schema as the object API path takes it.\n *\n * @param {string|object} value A slug, or a register/schema object.\n * @return {string} The slug or id.\n */\nfunction slugOf(value) {\n\tif (value && typeof value === 'object') {\n\t\treturn String(value.slug ?? value.id ?? '')\n\t}\n\treturn value ? String(value) : ''\n}\n\n/**\n * The id of an object, wherever OpenRegister carries it.\n *\n * @param {object|null} object The object.\n * @return {string} The id, or ''.\n */\nfunction idOf(object) {\n\treturn String(object?.id ?? object?.['@self']?.id ?? object?.uuid ?? '')\n}\n\n/**\n * A number of seconds as a clock: \"18:42\", or \"1:04:05\" from an hour.\n *\n * @param {number} seconds The seconds.\n * @return {string} The clock.\n */\nfunction clockOf(seconds) {\n\tconst pad = (value) => String(value).padStart(2, '0')\n\tconst hours = Math.floor(seconds / 3600)\n\tconst minutes = Math.floor((seconds % 3600) / 60)\n\treturn hours > 0\n\t\t? `${hours}:${pad(minutes)}:${pad(seconds % 60)}`\n\t\t: `${pad(minutes)}:${pad(seconds % 60)}`\n}\n\n/**\n * CnChecklistRunWidget — the `checklist-run` widget: a checklist answered a\n * page of questions at a time (board DqInspectie, the middle phone frame).\n *\n * The questions are records of a register, listed with a token-resolved\n * filter. Each page shows `pageSize` questions (one by default) as radio\n * choices or a text field, an optional note, and photos for the first\n * question of the page, then Previous and Next. The answers of a page are\n * saved when the user moves on.\n *\n * Answers are stored one record per question through the OpenRegister object\n * API, under the reader's own rights: an existing answer is updated, a new\n * one created with the `answers.create` fields. Photos go up through the\n * object's own file upload (`uploadHeldFiles`) and are attached to the\n * answer's `photosField`. An app that stores answers its own way names a\n * `saveAction` instead; it is dispatched per answer with the answer as its\n * last argument, and photos are not uploaded then.\n *\n * ```json\n * {\n * \"type\": \"checklist-run\",\n * \"content\": {\n * \"questions\": { \"register\": \"app\", \"schema\": \"question\", \"filter\": { \"checklist\": \"@object.checklist\" }, \"orderField\": \"position\" },\n * \"fields\": { \"text\": \"text\", \"type\": \"type\", \"options\": \"options\", \"required\": \"required\", \"help\": \"help\" },\n * \"answers\": {\n * \"register\": \"app\", \"schema\": \"answer\", \"filter\": { \"run\": \"@objectId\" },\n * \"questionField\": \"question\", \"valueField\": \"answer\", \"noteField\": \"note\", \"photosField\": \"photos\",\n * \"create\": { \"run\": \"@objectId\" }\n * },\n * \"pageSize\": 1,\n * \"caption\": \"{title} version {version}\"\n * }\n * }\n * ```\n *\n * The questions and answers can also live inside the open record:\n * `questionsPath` (with `itemsKey` for groups, both sorted by `orderField`)\n * reads the questions off it, and `answersPath` writes the answers into an\n * array on it, one entry per question keyed by `answerKey`, by updating the\n * record through the object API. Photos then go to the record's own files\n * (`recordPhotosField`) and their references into the answer.\n *\n * A question can require a photo: `fields.photoRequired` names its rule,\n * `photoRequiredValues` maps the stored values onto `never`, `always` or\n * `{ whenAnswer }`, and the page holds until the photo is there. On a page\n * with no bound record, `record: { register, schema, filter, sort }` picks\n * the open record: the first match, under the reader's rights.\n *\n * A timed run names the record's deadline in `deadlineField`: the time left\n * follows that moment rather than the page's start, so a reload keeps it. At\n * zero the page is saved and the run finishes. `submitLabel` adds a button\n * that finishes from any page, and `savedText` says so while nothing is unsaved.\n *\n * `noteWhen: { answers: [...] }` shows a question's note field only once its\n * answer is one of those stored values (the board shows a note under \"Nee\"),\n * or when the question already holds a note; without it every question shows\n * one (`allowNote: false` hides them all).\n *\n * `startAt: \"firstOpen\"` opens a run that was started earlier at the page of\n * its first unanswered question (the last page when all are answered), once\n * per record; `startAt: \"lastAnswered\"` at the page of its last answered\n * question, where the inspector was; without it the run opens at the first\n * page.\n *\n * `captureLocation: { field, goodAccuracy? }` captures where each answer was\n * given, unasked, the first time it changes: the page's save waits for the\n * device, a rough fix or none says so and takes an address by hand, and the\n * place is stored in `field` of the answer.\n *\n * Question kinds: `yes_no`, `yes_no_na`, `choice` (the question's `options`,\n * a list of strings or `{ value, label }`), `number`, `photo` and `text`.\n * `typeMap` maps the app's type values onto them, `choiceValues` the stored\n * values of yes / no / not applicable.\n * Keyboard: the choices are native radio buttons in a fieldset whose legend is\n * the question; on a new page focus moves to the position line and a polite\n * live region reads it.\n */\nexport default {\n\tname: 'CnChecklistRunWidget',\n\n\tcomponents: { CameraOutline, CnGeoCaptureField, NcButton, NcLoadingIcon },\n\n\tinject: {\n\t\t/** The detail page's object context (`{ objectId, object }`), for tokens. */\n\t\tcnObjectContext: { default: null },\n\t\t/** The page's workspace values, for `@workspace.<key>` tokens. */\n\t\tcnWorkspaceContext: { default: null },\n\t\t/** The host's translate, for manifest texts and question texts. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The page's pre-bound action dispatcher, for `saveAction` / `finishAction`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget config: `{ questions | questionsPath, itemsKey?,\n\t\t * groupLabelField?, orderField?, fields?, typeMap?, choiceValues?,\n\t\t * answers | answersPath, answerKey?, answerFields?, recordPhotosField?,\n\t\t * record?, saveAction?, finishAction?, pageSize?, allowNote?, noteWhen?,\n\t\t * allowPhotos?, caption?, emptyText?, deadlineField?, serverNowField?,\n\t\t * timeLeftText?, timeWarningSeconds?, savedText?, submitLabel? }`, as in the component\n\t\t * description and docs/components/cn-checklist-run-widget.md.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The bound record's id, for `@objectId`. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record, for `@object.<field>`, the caption and `questionsPath` / `answersPath`. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The bound record's register, for writing `answersPath` (`content.record` wins). */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record's schema, for writing `answersPath` (`content.record` wins). */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['finished'],\n\n\tdata() {\n\t\tinstanceCounter += 1\n\t\treturn {\n\t\t\tuid: `cn-checklist-run-${instanceCounter}`,\n\t\t\tloading: false,\n\t\t\terror: '',\n\t\t\tsaving: false,\n\t\t\tsaveError: '',\n\t\t\tquestions: [],\n\t\t\tanswerIds: {},\n\t\t\t// Photos an answer already holds, kept when new ones are attached.\n\t\t\tstoredPhotos: {},\n\t\t\t// `answersPath` mode: the answer entries as last read or written.\n\t\t\trecordAnswers: [],\n\t\t\tdraft: {},\n\t\t\tdirty: {},\n\t\t\tlocating: {},\n\t\t\tlocationPending: {},\n\t\t\tphotos: {},\n\t\t\tpage: 0,\n\t\t\t// The source the page was last positioned for; `startAt` applies once per source.\n\t\t\tpositionedFor: '',\n\t\t\tmissing: [],\n\t\t\t// Questions on this page that still need their photo.\n\t\t\tmissingPhoto: [],\n\t\t\t// `content.record` with a filter: the record it picked, or null.\n\t\t\tpickedRecord: null,\n\t\t\tliveText: '',\n\t\t\t// The deadline ticker: the moment now, its timer, and whether the run has finished.\n\t\t\tnow: Date.now(),\n\t\t\trecordReadAt: Date.now(),\n\t\t\tdeadlineTimer: null,\n\t\t\tfinishedRun: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} What the tokens resolve against. */\n\t\ttokenCtx() {\n\t\t\tconst unwrap = (c) => (c && typeof c === 'object' && 'value' in c ? c.value : c)\n\t\t\tconst injected = unwrap(this.cnObjectContext) || {}\n\t\t\treturn {\n\t\t\t\t...injected,\n\t\t\t\tobjectId: (this.pickedRecord && idOf(this.pickedRecord)) || this.objectId || injected.objectId || this.objectData?.id || null,\n\t\t\t\tobject: this.pickedRecord || this.objectData || injected.object || null,\n\t\t\t\tworkspace: unwrap(this.cnWorkspaceContext) || {},\n\t\t\t}\n\t\t},\n\n\t\t/** @return {object} The question field paths, with their defaults. */\n\t\tfields() {\n\t\t\treturn { id: 'id', text: 'text', type: 'type', options: 'options', required: 'required', help: 'help', ...(this.content?.fields || {}) }\n\t\t},\n\n\t\t/** @return {number} Questions per page, at least 1. */\n\t\tpageSize() {\n\t\t\tconst n = Math.floor(Number(this.content?.pageSize))\n\t\t\treturn Number.isFinite(n) && n >= 1 ? n : 1\n\t\t},\n\n\t\t/** @return {number} The number of pages. */\n\t\tpageCount() {\n\t\t\treturn Math.max(1, Math.ceil(this.questions.length / this.pageSize))\n\t\t},\n\n\t\t/** @return {boolean} Whether this is the last page. */\n\t\tisLastPage() {\n\t\t\treturn this.page >= this.pageCount - 1\n\t\t},\n\n\t\t/** @return {object[]} The questions on this page. */\n\t\tpageQuestions() {\n\t\t\treturn this.questions.slice(this.page * this.pageSize, (this.page + 1) * this.pageSize)\n\t\t},\n\n\t\t/** @return {object|null} The first question on this page, the one photos belong to. */\n\t\tcurrentQuestion() {\n\t\t\treturn this.pageQuestions[0] || null\n\t\t},\n\n\t\t/** @return {number} Questions with an answer. */\n\t\tansweredCount() {\n\t\t\treturn this.questions.filter((q) => this.isAnswered(q)).length\n\t\t},\n\n\t\t/** @return {number} The share answered, 0 to 100. */\n\t\tprogressShare() {\n\t\t\treturn this.questions.length ? Math.round((this.answeredCount / this.questions.length) * 100) : 0\n\t\t},\n\n\t\t/** @return {string} \"Question 7 of 24\", with the caption after it. */\n\t\tpositionText() {\n\t\t\tconst first = this.page * this.pageSize + 1\n\t\t\tconst position = t('nextcloud-vue', 'Question {n} of {total}', { n: first, total: this.questions.length })\n\t\t\tconst caption = this.caption\n\t\t\treturn caption ? `${position} · ${caption}` : position\n\t\t},\n\n\t\t/** @return {string} `content.caption` with `{field}` filled from the record. */\n\t\tcaption() {\n\t\t\tconst template = this.content?.caption\n\t\t\tif (typeof template !== 'string' || template === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst object = this.tokenCtx.object || {}\n\t\t\treturn this.translate(template).replace(/\\{([A-Za-z0-9_.]+)\\}/g, (_m, path) => {\n\t\t\t\tconst value = readPath(object, path)\n\t\t\t\treturn value === null || value === undefined ? '' : String(value)\n\t\t\t}).trim()\n\t\t},\n\n\t\t/** @return {string} The answer field a captured place is stored in, '' when none is asked for. */\n\t\tlocationField() {\n\t\t\treturn this.content?.captureLocation?.field || ''\n\t\t},\n\n\t\t/** @return {number} The accuracy in metres above which a fix counts as low. */\n\t\tgoodAccuracy() {\n\t\t\treturn this.content?.captureLocation?.goodAccuracy ?? 50\n\t\t},\n\n\t\t/** @return {boolean} Whether a note field shows (default true). */\n\t\tallowNote() {\n\t\t\treturn this.content?.allowNote !== false\n\t\t},\n\n\t\t/** @return {boolean} Whether the answers are written into an array on the open record. */\n\t\tinRecord() {\n\t\t\treturn typeof this.content?.answersPath === 'string' && this.content.answersPath !== ''\n\t\t},\n\n\t\t/** @return {object} `answersPath` field names, with their defaults. */\n\t\tanswerFields() {\n\t\t\treturn { value: 'value', number: 'value', choice: 'value', note: 'note', photos: 'photos', ...(this.content?.answerFields || {}) }\n\t\t},\n\n\t\t/** @return {{register: string, schema: string}} Where the open record lives. */\n\t\trecordRef() {\n\t\t\tconst own = this.content?.record || {}\n\t\t\treturn { register: slugOf(own.register || this.register), schema: slugOf(own.schema || this.schema) }\n\t\t},\n\n\t\t/**\n\t\t * Whether photos can be added: allowed, and somewhere to put them.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-questions-and-answers-can-live-inside-the-open-record\n\t\t */\n\t\tphotosEnabled() {\n\t\t\tif (this.content?.allowPhotos === false || this.content?.saveAction) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (this.inRecord) {\n\t\t\t\treturn Boolean(this.content?.recordPhotosField && this.answerFields.photos)\n\t\t\t}\n\t\t\treturn Boolean(this.content?.answers?.photosField)\n\t\t},\n\n\t\t/** @return {string} The group (section) of this page's first question, or ''. */\n\t\tpageGroup() {\n\t\t\treturn this.currentQuestion?.group || ''\n\t\t},\n\n\t\t/**\n\t\t * The questions of this page that get a photo control: with a\n\t\t * `photoRequired` field, those whose rule is not never (and photo\n\t\t * questions), less a `{ whenAnswer }` question answered otherwise that\n\t\t * holds no photo; without one, the first question of the page.\n\t\t *\n\t\t * @return {object[]} The questions.\n\t\t * @spec openspec/changes/checklist-run-photo-rule/specs/checklist-run-photo-rule/spec.md#requirement-a-question-can-require-a-photo\n\t\t */\n\t\tphotoQuestions() {\n\t\t\tif (!this.photosEnabled) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (this.fields.photoRequired) {\n\t\t\t\treturn this.pageQuestions.filter((q) => q.kind === 'photo' || (q.photoRule !== 'never' && !this.photoRuledOut(q)))\n\t\t\t}\n\t\t\tconst first = this.currentQuestion\n\t\t\tconst extra = this.pageQuestions.filter((q) => q.kind === 'photo' && q !== first)\n\t\t\treturn first ? [first, ...extra] : extra\n\t\t},\n\n\t\t/**\n\t\t * `content.record` with a `filter`: the list to pick the open record\n\t\t * from (first match of `sort`), `'blocked'` while a token is\n\t\t * unresolved, or null without a filter.\n\t\t *\n\t\t * @return {object|string|null}\n\t\t * @spec openspec/changes/checklist-run-photo-rule/specs/checklist-run-photo-rule/spec.md#requirement-a-checklist-run-can-pick-its-record-by-filter\n\t\t */\n\t\trecordPicker() {\n\t\t\tconst own = this.content?.record\n\t\t\tif (!own || typeof own !== 'object' || !own.filter || typeof own.filter !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst unwrap = (c) => (c && typeof c === 'object' && 'value' in c ? c.value : c)\n\t\t\tconst filter = resolveFilterTokens(own.filter, { objectId: this.objectId || null, object: this.objectData, workspace: unwrap(this.cnWorkspaceContext) || {} })\n\t\t\tif (hasUnresolvedTokens(filter)) {\n\t\t\t\treturn 'blocked'\n\t\t\t}\n\t\t\tconst sort = own.sort && typeof own.sort === 'object' && own.sort.field ? { [`_order[${own.sort.field}]`]: own.sort.dir === 'asc' ? 'asc' : 'desc' } : {}\n\t\t\treturn { register: slugOf(own.register), schema: slugOf(own.schema), filter: { ...filter, ...sort } }\n\t\t},\n\n\t\t/** @return {object|null} The record the run lives in: the picked one, else the bound one. */\n\t\topenRecord() {\n\t\t\treturn this.recordPicker ? this.pickedRecord : this.tokenCtx.object\n\t\t},\n\n\t\t/** @return {string} The key of the source lists, to read them again when they change. */\n\t\tsourceKey() {\n\t\t\tconst picker = this.recordPicker\n\t\t\tif (picker === 'blocked') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (picker && typeof this.content?.questionsPath === 'string' && this.content.questionsPath !== '') {\n\t\t\t\treturn JSON.stringify({ pick: picker, path: this.content.questionsPath })\n\t\t\t}\n\t\t\tif (typeof this.content?.questionsPath === 'string' && this.content.questionsPath !== '') {\n\t\t\t\tconst object = this.tokenCtx.object\n\t\t\t\treturn object ? JSON.stringify({ path: this.content.questionsPath, id: idOf(object), at: object['@self']?.updated ?? null }) : ''\n\t\t\t}\n\t\t\tconst q = this.content?.questions\n\t\t\tif (!q || !q.register || !q.schema) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst qFilter = resolveFilterTokens(q.filter || {}, this.tokenCtx)\n\t\t\tconst a = this.content?.answers\n\t\t\tconst aFilter = a && a.register && a.schema ? resolveFilterTokens(a.filter || {}, this.tokenCtx) : null\n\t\t\tif (hasUnresolvedTokens(qFilter) || (aFilter && hasUnresolvedTokens(aFilter))) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn JSON.stringify({ q: [q.register, q.schema, qFilter], a: aFilter ? [a.register, a.schema, aFilter] : null })\n\t\t},\n\n\t\tloadingLabel: () => t('nextcloud-vue', 'Loading …'),\n\t\tprogressLabel: () => t('nextcloud-vue', 'Questions answered'),\n\t\trequiredLabel: () => ` ${t('nextcloud-vue', '(required)')}`,\n\t\tmissingLabel: () => t('nextcloud-vue', 'Answer this question to go on.'),\n\t\tpreviousLabel: () => t('nextcloud-vue', 'Previous'),\n\t\tnextLabel: () => t('nextcloud-vue', 'Next'),\n\t\tfinishLabel: () => t('nextcloud-vue', 'Finish'),\n\t\taddPhotoLabel: () => t('nextcloud-vue', 'Take or add a photo'),\n\t\tmissingPhotoLabel: () => t('nextcloud-vue', 'This answer needs a photo. Add one to go on.'),\n\t\tphotoOnlyLabel: () => t('nextcloud-vue', 'Answer with a photo.'),\n\t\tmorePhotoLabel: () => t('nextcloud-vue', 'Another photo'),\n\n\t\t/** @return {number|null} The deadline as read off the open record, on this device's clock; null without one. */\n\t\tdeadlineAt() {\n\t\t\tconst field = this.content?.deadlineField\n\t\t\tconst date = field ? parseDateValue(readPath(this.openRecord, field)) : null\n\t\t\treturn date ? date.getTime() + this.serverOffset : null\n\t\t},\n\n\t\t/** @return {number} How far this device's clock runs ahead of the server's, in milliseconds. */\n\t\tserverOffset() {\n\t\t\tconst field = this.content?.serverNowField\n\t\t\tconst serverNow = field ? parseDateValue(readPath(this.openRecord, field)) : null\n\t\t\treturn serverNow ? this.recordReadAt - serverNow.getTime() : 0\n\t\t},\n\n\t\t/** @return {number|null} Whole seconds until the deadline, never below 0; null without one. */\n\t\tsecondsLeft() {\n\t\t\treturn this.deadlineAt === null ? null : Math.max(0, Math.ceil((this.deadlineAt - this.now) / 1000))\n\t\t},\n\n\t\t/** @return {boolean} Whether the time left is in its warning stretch. */\n\t\ttimeWarning() {\n\t\t\treturn this.secondsLeft !== null && this.secondsLeft <= (this.content?.timeWarningSeconds ?? DEFAULT_TIME_WARNING_SECONDS)\n\t\t},\n\n\t\t/** @return {string} The time left in words, or ''. */\n\t\ttimeLeftText() {\n\t\t\tif (this.secondsLeft === null) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst time = clockOf(this.secondsLeft)\n\t\t\treturn this.content?.timeLeftText\n\t\t\t\t? this.translate(this.content.timeLeftText).replace('{time}', time)\n\t\t\t\t: t('nextcloud-vue', 'Time left: {time}', { time })\n\t\t},\n\n\t\t/** @return {string} `savedText`, while nothing is unsaved and something was answered. */\n\t\tsavedLine() {\n\t\t\tconst text = this.content?.savedText\n\t\t\tif (!text || this.answeredCount === 0 || Object.keys(this.dirty).length > 0 || this.saveError) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.translate(text)\n\t\t},\n\n\t\t/** @return {boolean} A timed run finishes once: it is over, so nothing moves any more. */\n\t\tclosed() {\n\t\t\treturn this.finishedRun && this.deadlineAt !== null\n\t\t},\n\n\t\t/** @return {string} The label of the button that finishes from any page, or ''. */\n\t\tsubmitLabel() {\n\t\t\treturn this.content?.submitLabel ? this.translate(this.content.submitLabel) : ''\n\t\t},\n\n\t\t/** @return {string} The note field's label. */\n\t\tnoteLabel() {\n\t\t\treturn this.content?.noteLabel ? this.translate(this.content.noteLabel) : t('nextcloud-vue', 'Note')\n\t\t},\n\n\t\t/** @return {string} The empty-state text. */\n\t\temptyLabel() {\n\t\t\treturn this.content?.emptyText ? this.translate(this.content.emptyText) : t('nextcloud-vue', 'This checklist has no questions.')\n\t\t},\n\t},\n\n\twatch: {\n\t\tsourceKey: {\n\t\t\thandler() {\n\t\t\t\tthis.load()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\topenRecord: {\n\t\t\thandler() {\n\t\t\t\tthis.recordReadAt = Date.now()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\tdeadlineAt() {\n\t\t\tthis.startDeadlineTimer()\n\t\t},\n\n\t\t'questions.length': function() {\n\t\t\tthis.startDeadlineTimer()\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.startDeadlineTimer()\n\t},\n\n\tbeforeUnmount() {\n\t\tclearInterval(this.deadlineTimer)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Run the ticker while a run with questions has a deadline.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstartDeadlineTimer() {\n\t\t\tclearInterval(this.deadlineTimer)\n\t\t\tthis.deadlineTimer = null\n\t\t\tif (this.deadlineAt === null || this.questions.length === 0 || this.finishedRun) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.deadlineTimer = setInterval(this.onDeadlineTick, TICK_MS)\n\t\t\tthis.onDeadlineTick()\n\t\t},\n\n\t\t/**\n\t\t * Bring the time left up to date, say the warning and the last minute\n\t\t * once, and at zero save and finish. A failed save leaves the run open,\n\t\t * so the user can try again and sees why. While a save runs it waits for\n\t\t * the next tick.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onDeadlineTick() {\n\t\t\tconst before = this.secondsLeft\n\t\t\tthis.now = Date.now()\n\t\t\tconst left = this.secondsLeft\n\t\t\tif (left === null) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst warning = this.content?.timeWarningSeconds ?? DEFAULT_TIME_WARNING_SECONDS\n\t\t\tif (left > 0 && before !== null && [warning, LAST_MINUTE_SECONDS].some((mark) => before > mark && left <= mark)) {\n\t\t\t\tthis.liveText = this.timeLeftText\n\t\t\t}\n\t\t\tif (left > 0 || this.saving) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tclearInterval(this.deadlineTimer)\n\t\t\tthis.deadlineTimer = null\n\t\t\tif (await this.savePage()) {\n\t\t\t\tawait this.finish('deadline')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether a question shows its note field: always, unless `noteWhen`\n\t\t * names the answers that ask for one and this question has none of\n\t\t * them and no note yet.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean}\n\t\t */\n\t\tnoteShown(question) {\n\t\t\tconst answers = this.content?.noteWhen?.answers\n\t\t\tif (!Array.isArray(answers)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tconst draft = this.draft[question.id] || {}\n\t\t\treturn (draft.note || '') !== '' || answers.map(String).includes(String(draft.value ?? ''))\n\t\t},\n\n\t\t/**\n\t\t * The host's translate, or the text unchanged.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The translation.\n\t\t */\n\t\ttranslate(text) {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\t/**\n\t\t * Whether a value counts as an answer.\n\t\t *\n\t\t * @param {unknown} value The value.\n\t\t * @return {boolean} True for a non-empty value.\n\t\t */\n\t\thasValue(value) {\n\t\t\treturn value !== null && value !== undefined && String(value).trim() !== ''\n\t\t},\n\n\t\t/**\n\t\t * Whether a question has an answer: a value, or for a photo question\n\t\t * a photo stored or held.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean} True when answered.\n\t\t */\n\t\tisAnswered(question) {\n\t\t\tif (question.kind === 'photo') {\n\t\t\t\treturn this.hasPhoto(question)\n\t\t\t}\n\t\t\treturn this.hasValue(this.draft[question.id]?.value)\n\t\t},\n\n\t\t/**\n\t\t * A question record as the widget draws it.\n\t\t *\n\t\t * @param {object} record The question record.\n\t\t * @param {string} [group] The group (section) it belongs to.\n\t\t * @return {{id: string, text: string, kind: string, required: boolean, help: string, choices: Array<{value: string, label: string}>, group: string}} The question.\n\t\t */\n\t\ttoQuestion(record, group = '') {\n\t\t\tconst f = this.fields\n\t\t\tconst raw = String(readPath(record, f.type) ?? '')\n\t\t\tconst mapped = this.content?.typeMap && typeof this.content.typeMap === 'object' ? this.content.typeMap[raw] : undefined\n\t\t\tconst kind = KINDS.includes(mapped) ? mapped : (KINDS.includes(raw) ? raw : 'text')\n\t\t\tconst stored = { yes: 'yes', no: 'no', na: 'na', ...(this.content?.choiceValues || {}) }\n\t\t\tlet choices = (TYPE_CHOICES[kind] || []).map((c) => ({ value: String(stored[c.key]), label: t('nextcloud-vue', c.label) }))\n\t\t\tif (kind === 'choice') {\n\t\t\t\tconst options = readPath(record, f.options)\n\t\t\t\tchoices = (Array.isArray(options) ? options : []).map((o) => (o && typeof o === 'object'\n\t\t\t\t\t? { value: String(o.value ?? o.label ?? ''), label: this.translate(String(o.label ?? o.value ?? '')) }\n\t\t\t\t\t: { value: String(o), label: this.translate(String(o)) })).filter((c) => c.value !== '')\n\t\t\t}\n\t\t\tconst help = readPath(record, f.help)\n\t\t\treturn {\n\t\t\t\tid: String(readPath(record, f.id) ?? idOf(record)),\n\t\t\t\ttext: this.translate(String(readPath(record, f.text) ?? '')),\n\t\t\t\tkind,\n\t\t\t\trequired: Boolean(readPath(record, f.required)),\n\t\t\t\thelp: typeof help === 'string' && help !== '' ? this.translate(help) : '',\n\t\t\t\tchoices,\n\t\t\t\tgroup,\n\t\t\t\tphotoRule: this.photoRuleOf(record),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A question's photo rule, from its `photoRequired` field mapped\n\t\t * through `photoRequiredValues`: `'never'`, `'always'` or\n\t\t * `{ whenAnswer }` (a photo is needed when the answer is that value).\n\t\t *\n\t\t * @param {object} record The question record.\n\t\t * @return {('never'|'always'|{whenAnswer: string})} The rule.\n\t\t * @spec openspec/changes/checklist-run-photo-rule/specs/checklist-run-photo-rule/spec.md#requirement-a-question-can-require-a-photo\n\t\t */\n\t\tphotoRuleOf(record) {\n\t\t\tconst path = this.fields.photoRequired\n\t\t\tif (!path) {\n\t\t\t\treturn 'never'\n\t\t\t}\n\t\t\tconst raw = readPath(record, path)\n\t\t\tconst map = { true: 'always', false: 'never', always: 'always', never: 'never', ...(this.content?.photoRequiredValues || {}) }\n\t\t\tconst rule = raw === null || raw === undefined ? 'never' : map[String(raw)]\n\t\t\tif (rule && typeof rule === 'object' && rule.whenAnswer !== undefined) {\n\t\t\t\treturn { whenAnswer: String(rule.whenAnswer) }\n\t\t\t}\n\t\t\treturn rule === 'always' ? 'always' : 'never'\n\t\t},\n\n\t\t/**\n\t\t * Whether a question needs a photo with its current answer.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean} True when a photo is required now.\n\t\t */\n\t\tneedsPhoto(question) {\n\t\t\tconst rule = question.photoRule\n\t\t\tif (rule === 'always') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn Boolean(rule && typeof rule === 'object' && String(this.draft[question.id]?.value ?? '') === rule.whenAnswer)\n\t\t},\n\n\t\t/**\n\t\t * Whether a question's answer rules its photo out: a `{ whenAnswer }`\n\t\t * question answered with another value and holding no photo.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean} True when no photo control is needed.\n\t\t */\n\t\tphotoRuledOut(question) {\n\t\t\tconst rule = question.photoRule\n\t\t\tconst value = String(this.draft[question.id]?.value ?? '')\n\t\t\treturn Boolean(rule && typeof rule === 'object' && value !== '' && value !== rule.whenAnswer && !this.hasPhoto(question))\n\t\t},\n\n\t\t/**\n\t\t * Whether a question has a photo, stored or held.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean} True with at least one photo.\n\t\t */\n\t\thasPhoto(question) {\n\t\t\treturn (this.storedPhotos[question.id] || []).length > 0 || (this.photos[question.id] || []).length > 0\n\t\t},\n\n\t\t/**\n\t\t * The photo card title for a question: its position in the run.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {string} The title.\n\t\t */\n\t\tphotoTitle(question) {\n\t\t\tconst n = this.questions.indexOf(question) + 1\n\t\t\treturn t('nextcloud-vue', 'Photo for question {n}', { n })\n\t\t},\n\n\t\t/**\n\t\t * The names of the photos held for a question.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {string[]} The file names.\n\t\t */\n\t\tphotoNamesFor(question) {\n\t\t\treturn (this.photos[question.id] || []).map((file) => file.name)\n\t\t},\n\n\t\t/**\n\t\t * The questions on the open record (`questionsPath`): a list of\n\t\t * questions, or of groups whose `itemsKey` holds them, both levels\n\t\t * sorted by `orderField`.\n\t\t *\n\t\t * @return {object[]} The questions.\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-questions-and-answers-can-live-inside-the-open-record\n\t\t */\n\t\tquestionsFromRecord() {\n\t\t\tconst c = this.content\n\t\t\tconst list = readPath(this.openRecord, c.questionsPath)\n\t\t\tconst orderField = c.orderField === undefined ? 'order' : c.orderField\n\t\t\tconst top = byOrder(Array.isArray(list) ? list : [], orderField)\n\t\t\tif (!c.itemsKey) {\n\t\t\t\treturn top.map((record) => this.toQuestion(record))\n\t\t\t}\n\t\t\tconst labelField = c.groupLabelField || 'name'\n\t\t\treturn top.flatMap((group) => {\n\t\t\t\tconst items = readPath(group, c.itemsKey)\n\t\t\t\tconst label = readPath(group, labelField)\n\t\t\t\treturn byOrder(Array.isArray(items) ? items : [], orderField).map((record) => this.toQuestion(record, typeof label === 'string' ? this.translate(label) : ''))\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The draft of one answer entry from the open record's `answersPath`.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @param {object} entry The stored entry.\n\t\t * @return {{value: string, note: string}} The draft.\n\t\t */\n\t\tdraftFromEntry(question, entry) {\n\t\t\tconst af = this.answerFields\n\t\t\tconst field = question.kind === 'number' ? af.number : (question.kind === 'choice' ? af.choice : af.value)\n\t\t\tconst value = readPath(entry, field)\n\t\t\tconst note = readPath(entry, af.note)\n\t\t\treturn { value: value === null || value === undefined ? '' : String(value), note: note === null || note === undefined ? '' : String(note) }\n\t\t},\n\n\t\t/**\n\t\t * Read the questions and the answers given so far.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-a-checklist-run-shows-a-page-of-questions-at-a-time\n\t\t */\n\t\tasync load() {\n\t\t\tconst key = this.sourceKey\n\t\t\tif (key === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.error = ''\n\t\t\ttry {\n\t\t\t\tconst picker = this.recordPicker\n\t\t\t\tif (picker) {\n\t\t\t\t\tconst found = await fetchReferenceObjects({ register: picker.register, schema: picker.schema, filter: picker.filter, limit: 1 })\n\t\t\t\t\tif (key !== this.sourceKey) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthis.pickedRecord = found[0] || null\n\t\t\t\t}\n\t\t\t\tlet questions\n\t\t\t\tif (picker && !this.pickedRecord) {\n\t\t\t\t\tquestions = []\n\t\t\t\t} else if (this.content.questionsPath) {\n\t\t\t\t\tquestions = this.questionsFromRecord()\n\t\t\t\t} else {\n\t\t\t\t\tconst q = this.content.questions\n\t\t\t\t\tconst records = await fetchReferenceObjects({ register: q.register, schema: q.schema, filter: resolveFilterTokens(q.filter || {}, this.tokenCtx), limit: q.limit || 500 })\n\t\t\t\t\tquestions = byOrder(records, q.orderField).map((r) => this.toQuestion(r))\n\t\t\t\t}\n\t\t\t\tquestions = questions.filter((x) => x.id !== '' && x.text !== '')\n\t\t\t\tconst a = this.inRecord ? null : this.content.answers\n\t\t\t\tconst answers = a && a.register && a.schema\n\t\t\t\t\t? await fetchReferenceObjects({ register: a.register, schema: a.schema, filter: resolveFilterTokens(a.filter || {}, this.tokenCtx), limit: a.limit || 500 })\n\t\t\t\t\t: []\n\t\t\t\tif (key !== this.sourceKey) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst draft = {}\n\t\t\t\tconst answerIds = {}\n\t\t\t\tconst storedPhotos = {}\n\t\t\t\tfor (const question of questions) {\n\t\t\t\t\tdraft[question.id] = { value: '', note: '' }\n\t\t\t\t}\n\t\t\t\tif (this.inRecord) {\n\t\t\t\t\tconst entries = readPath(this.openRecord, this.content.answersPath)\n\t\t\t\t\tthis.recordAnswers = Array.isArray(entries) ? entries : []\n\t\t\t\t\tconst key = this.content.answerKey || 'questionId'\n\t\t\t\t\tfor (const entry of this.recordAnswers) {\n\t\t\t\t\t\tconst qid = String(readPath(entry, key) ?? '')\n\t\t\t\t\t\tconst question = questions.find((x) => x.id === qid)\n\t\t\t\t\t\tif (question && !answerIds[qid]) {\n\t\t\t\t\t\t\tdraft[qid] = { ...this.draftFromEntry(question, entry), location: this.locationField ? (readPath(entry, this.locationField) ?? null) : null }\n\t\t\t\t\t\t\tanswerIds[qid] = qid\n\t\t\t\t\t\t\tconst photos = readPath(entry, this.answerFields.photos)\n\t\t\t\t\t\t\tstoredPhotos[qid] = Array.isArray(photos) ? photos : []\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const answer of answers) {\n\t\t\t\t\tconst qid = String(readPath(answer, a.questionField || 'question') ?? '')\n\t\t\t\t\tif (draft[qid] && !answerIds[qid]) {\n\t\t\t\t\t\tdraft[qid] = {\n\t\t\t\t\t\t\tvalue: String(readPath(answer, a.valueField || 'answer') ?? ''),\n\t\t\t\t\t\t\tnote: String(readPath(answer, a.noteField || 'note') ?? ''),\n\t\t\t\t\t\t\tlocation: this.locationField ? (readPath(answer, this.locationField) ?? null) : null,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanswerIds[qid] = idOf(answer)\n\t\t\t\t\t\tconst stored = a.photosField ? readPath(answer, a.photosField) : null\n\t\t\t\t\t\tstoredPhotos[qid] = Array.isArray(stored) ? stored : []\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.questions = questions\n\t\t\t\tthis.draft = draft\n\t\t\t\tthis.answerIds = answerIds\n\t\t\t\tthis.storedPhotos = storedPhotos\n\t\t\t\tthis.dirty = {}\n\t\t\t\tconst lastPage = Math.max(0, Math.ceil(questions.length / this.pageSize) - 1)\n\t\t\t\tif (this.positionedFor !== key && this.content?.startAt === 'firstOpen') {\n\t\t\t\t\tconst open = questions.findIndex((question) => !this.isAnswered(question))\n\t\t\t\t\tthis.page = open === -1 ? lastPage : Math.floor(open / this.pageSize)\n\t\t\t\t} else if (this.positionedFor !== key && this.content?.startAt === 'lastAnswered') {\n\t\t\t\t\tconst last = questions.findLastIndex((question) => this.isAnswered(question))\n\t\t\t\t\tthis.page = last === -1 ? 0 : Math.floor(last / this.pageSize)\n\t\t\t\t}\n\t\t\t\tthis.positionedFor = key\n\t\t\t\tthis.page = Math.min(this.page, lastPage)\n\t\t\t} catch {\n\t\t\t\tthis.error = t('nextcloud-vue', 'The checklist could not be loaded.')\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Note that a question's answer changed, so the page saves it.\n\t\t *\n\t\t * @param {string} id The question id.\n\t\t * @return {void}\n\t\t */\n\t\tmarkDirty(id) {\n\t\t\tthis.dirty = { ...this.dirty, [id]: true }\n\t\t\tthis.missing = this.missing.filter((m) => m !== id)\n\t\t\tthis.startLocating(id)\n\t\t},\n\n\t\t/**\n\t\t * Capture the place of an answer once, the first time it changes. The\n\t\t * promise is kept so the page's save can wait for it.\n\t\t *\n\t\t * @param {string} id The question id.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/checklist-run-location/specs/checklist-run-location/spec.md#requirement-an-answer-carries-where-it-was-given\n\t\t */\n\t\tstartLocating(id) {\n\t\t\tif (!this.locationField || this.draft[id]?.location || this.locating[id]) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.locating = { ...this.locating, [id]: true }\n\t\t\tthis.locationPending[id] = captureLocation().then((fix) => {\n\t\t\t\tdelete this.locationPending[id]\n\t\t\t\tthis.locating = { ...this.locating, [id]: false }\n\t\t\t\tthis.draft[id].location = fix ? { ...fix, low: fix.accuracy > this.goodAccuracy } : { low: true }\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The place was changed in the field: a new fix or a typed address.\n\t\t *\n\t\t * @param {string} id The question id.\n\t\t * @param {object} location The place.\n\t\t * @return {void}\n\t\t */\n\t\tsetLocation(id, location) {\n\t\t\tthis.draft[id].location = location\n\t\t\tthis.dirty = { ...this.dirty, [id]: true }\n\t\t},\n\n\t\t/**\n\t\t * Open the file picker of the photo button's own question: the hidden\n\t\t * input that follows the button.\n\t\t *\n\t\t * @param {MouseEvent} event The button's click.\n\t\t * @return {void}\n\t\t */\n\t\topenPhotoPicker(event) {\n\t\t\tconst input = event.currentTarget.nextElementSibling\n\t\t\tif (input && input.type === 'file') {\n\t\t\t\tinput.click()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Hold the photos picked for a question until the page saves.\n\t\t *\n\t\t * @param {Event} event The file input's change event.\n\t\t * @param {string} [questionId] The question, else the first of the page.\n\t\t * @return {void}\n\t\t */\n\t\taddPhotos(event, questionId) {\n\t\t\tconst id = questionId || this.currentQuestion?.id\n\t\t\tconst files = Array.from(event?.target?.files || [])\n\t\t\tif (!id || files.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.photos = { ...this.photos, [id]: [...(this.photos[id] || []), ...files] }\n\t\t\tthis.dirty = { ...this.dirty, [id]: true }\n\t\t\tthis.missingPhoto = this.missingPhoto.filter((m) => m !== id)\n\t\t\tif (event.target) {\n\t\t\t\tevent.target.value = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Save the changed answers of this page: through `saveAction` when\n\t\t * set, else one answer record per question through the object API,\n\t\t * then its held photos.\n\t\t *\n\t\t * @return {Promise<boolean>} True when everything saved.\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-answers-are-saved-under-the-readers-own-rights\n\t\t */\n\t\tasync savePage() {\n\t\t\tconst changed = this.pageQuestions.filter((q) => this.dirty[q.id])\n\t\t\tif (changed.length === 0) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tthis.saveError = ''\n\t\t\ttry {\n\t\t\t\tawait Promise.all(Object.values(this.locationPending))\n\t\t\t\tif (this.inRecord && !this.content?.saveAction) {\n\t\t\t\t\tawait this.saveIntoRecord(changed)\n\t\t\t\t\tthis.dirty = Object.fromEntries(Object.entries(this.dirty).filter(([id]) => !changed.some((q) => q.id === id)))\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tfor (const question of changed) {\n\t\t\t\t\tawait this.saveAnswer(question)\n\t\t\t\t\tconst { [question.id]: _done, ...rest } = this.dirty\n\t\t\t\t\tthis.dirty = rest\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t} catch {\n\t\t\t\tthis.saveError = t('nextcloud-vue', 'The answer could not be saved. Try again.')\n\t\t\t\treturn false\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write the changed answers of this page into the open record's\n\t\t * `answersPath` array (one entry per question, keyed by `answerKey`)\n\t\t * with one update of the record through the object API. Held photos\n\t\t * go first to the record's own files (`recordPhotosField`), and their\n\t\t * references (`photoRefField`, default `id`) into the answer.\n\t\t *\n\t\t * @param {object[]} changed The changed questions.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-questions-and-answers-can-live-inside-the-open-record\n\t\t */\n\t\tasync saveIntoRecord(changed) {\n\t\t\tconst { register, schema } = this.recordRef\n\t\t\tconst objectId = idOf(this.openRecord) || String(this.openRecordId || '')\n\t\t\tif (!register || !schema || !objectId) {\n\t\t\t\tthrow new Error('no record to write to')\n\t\t\t}\n\t\t\tconst c = this.content\n\t\t\tconst af = this.answerFields\n\t\t\tconst key = c.answerKey || 'questionId'\n\t\t\tconst refField = c.photoRefField || 'id'\n\t\t\tlet recordPhotos = Array.isArray(readPath(this.openRecord, c.recordPhotosField)) ? readPath(this.openRecord, c.recordPhotosField) : []\n\t\t\tconst entries = [...this.recordAnswers]\n\t\t\tfor (const question of changed) {\n\t\t\t\tconst draft = this.draft[question.id]\n\t\t\t\tconst index = entries.findIndex((entry) => String(readPath(entry, key) ?? '') === question.id)\n\t\t\t\tconst entry = { ...(index >= 0 ? entries[index] : { [key]: question.id }) }\n\t\t\t\tif (question.kind === 'number') {\n\t\t\t\t\tentry[af.number] = draft.value === '' ? null : Number(draft.value)\n\t\t\t\t} else if (question.kind === 'choice') {\n\t\t\t\t\tentry[af.choice] = draft.value\n\t\t\t\t} else if (question.kind !== 'photo') {\n\t\t\t\t\tentry[af.value] = draft.value\n\t\t\t\t}\n\t\t\t\tif (this.allowNote) {\n\t\t\t\t\tentry[af.note] = draft.note\n\t\t\t\t}\n\t\t\t\tif (af.at) {\n\t\t\t\t\tentry[af.at] = new Date().toISOString()\n\t\t\t\t}\n\t\t\t\tif (this.locationField) {\n\t\t\t\t\tentry[this.locationField] = draft.location ?? null\n\t\t\t\t}\n\t\t\t\tconst held = this.photos[question.id] || []\n\t\t\t\tif (this.photosEnabled && held.length) {\n\t\t\t\t\tconst field = c.recordPhotosField\n\t\t\t\t\tconst { failed, attached } = await uploadHeldFiles({ register, schema, objectId, held: { [field]: held }, kept: { [field]: recordPhotos } })\n\t\t\t\t\tif (failed.length) {\n\t\t\t\t\t\tthrow new Error('photo upload failed')\n\t\t\t\t\t}\n\t\t\t\t\tconst now = Array.isArray(attached[field]) ? attached[field] : recordPhotos\n\t\t\t\t\tconst added = now.slice(recordPhotos.length).map((ref) => (ref && typeof ref === 'object' ? ref[refField] ?? ref : ref))\n\t\t\t\t\trecordPhotos = now\n\t\t\t\t\tconst existing = Array.isArray(entry[af.photos]) ? entry[af.photos] : []\n\t\t\t\t\tentry[af.photos] = [...existing, ...added]\n\t\t\t\t\tthis.storedPhotos = { ...this.storedPhotos, [question.id]: entry[af.photos] }\n\t\t\t\t\tconst { [question.id]: _sent, ...rest } = this.photos\n\t\t\t\t\tthis.photos = rest\n\t\t\t\t}\n\t\t\t\tif (index >= 0) {\n\t\t\t\t\tentries[index] = entry\n\t\t\t\t} else {\n\t\t\t\t\tentries.push(entry)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst url = generateUrl(`${OBJECT_API}/${encodeURIComponent(register)}/${encodeURIComponent(schema)}/${encodeURIComponent(objectId)}`)\n\t\t\tawait axios.patch(url, { [c.answersPath]: entries })\n\t\t\tthis.recordAnswers = entries\n\t\t},\n\n\t\t/**\n\t\t * Save one answer.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync saveAnswer(question) {\n\t\t\tconst entry = this.draft[question.id]\n\t\t\tconst answer = { questionId: question.id, value: entry.value, note: entry.note }\n\t\t\tif (this.locationField) {\n\t\t\t\tanswer.location = entry.location ?? null\n\t\t\t}\n\t\t\tconst action = this.content?.saveAction\n\t\t\tif (action && typeof action === 'object') {\n\t\t\t\tconst resolved = resolveDeepTokens(action, this.tokenCtx)\n\t\t\t\tconst wrapped = { ...resolved, args: [...(Array.isArray(resolved.args) ? resolved.args : []), answer] }\n\t\t\t\tconst run = typeof this.cnDispatchAction === 'function' ? this.cnDispatchAction(wrapped) : dispatchAction(wrapped, { router: this.$router || null, tokenCtx: this.tokenCtx })\n\t\t\t\tawait run\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst a = this.content?.answers\n\t\t\tif (!a || !a.register || !a.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst body = {\n\t\t\t\t[a.questionField || 'question']: question.id,\n\t\t\t\t[a.valueField || 'answer']: entry.value,\n\t\t\t}\n\t\t\tif (this.allowNote) {\n\t\t\t\tbody[a.noteField || 'note'] = entry.note\n\t\t\t}\n\t\t\tif (this.locationField) {\n\t\t\t\tbody[this.locationField] = entry.location ?? null\n\t\t\t}\n\t\t\tconst base = generateUrl(`${OBJECT_API}/${encodeURIComponent(a.register)}/${encodeURIComponent(a.schema)}`)\n\t\t\tlet id = this.answerIds[question.id]\n\t\t\tif (id) {\n\t\t\t\tawait axios.patch(`${base}/${encodeURIComponent(id)}`, body)\n\t\t\t} else {\n\t\t\t\tconst create = resolveDeepTokens(a.create && typeof a.create === 'object' ? a.create : {}, this.tokenCtx)\n\t\t\t\tconst response = await axios.post(base, { ...create, ...body })\n\t\t\t\tid = idOf(response?.data)\n\t\t\t\tthis.answerIds = { ...this.answerIds, [question.id]: id }\n\t\t\t}\n\t\t\tconst held = this.photos[question.id] || []\n\t\t\tif (this.photosEnabled && held.length && id) {\n\t\t\t\tconst { failed, attached } = await uploadHeldFiles({ register: a.register, schema: a.schema, objectId: id, held: { [a.photosField]: held }, kept: { [a.photosField]: this.storedPhotos[question.id] || [] } })\n\t\t\t\tif (failed.length) {\n\t\t\t\t\tthrow new Error('photo upload failed')\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(attached[a.photosField])) {\n\t\t\t\t\tthis.storedPhotos = { ...this.storedPhotos, [question.id]: attached[a.photosField] }\n\t\t\t\t}\n\t\t\t\tconst { [question.id]: _sent, ...rest } = this.photos\n\t\t\t\tthis.photos = rest\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The required questions on this page without an answer.\n\t\t *\n\t\t * @return {string[]} Their ids.\n\t\t */\n\t\tunansweredRequired() {\n\t\t\treturn this.pageQuestions.filter((q) => q.required && !this.isAnswered(q)).map((q) => q.id)\n\t\t},\n\n\t\t/**\n\t\t * Save this page and go to the next one; on the last page, finish.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-a-checklist-run-shows-a-page-of-questions-at-a-time\n\t\t */\n\t\tasync next() {\n\t\t\tthis.missing = this.unansweredRequired()\n\t\t\tthis.missingPhoto = this.photosEnabled ? this.pageQuestions.filter((q) => this.needsPhoto(q) && !this.hasPhoto(q)).map((q) => q.id) : []\n\t\t\tif (this.missing.length || this.missingPhoto.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!(await this.savePage())) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.secondsLeft === 0) {\n\t\t\t\tawait this.finish('deadline')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.isLastPage) {\n\t\t\t\tif (!this.submitLabel) {\n\t\t\t\t\tawait this.finish()\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.goTo(this.page + 1)\n\t\t},\n\n\t\t/**\n\t\t * Finish from any page. A required question without an answer holds it\n\t\t * back and opens that question's page.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync submit() {\n\t\t\tconst open = this.questions.findIndex((q) => q.required && !this.isAnswered(q))\n\t\t\tif (open >= 0) {\n\t\t\t\tif (!(await this.savePage())) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.missing = [this.questions[open].id]\n\t\t\t\tthis.goTo(Math.floor(open / this.pageSize))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.missing = []\n\t\t\tif (await this.savePage()) {\n\t\t\t\tawait this.finish()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Save this page and go back one.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync previous() {\n\t\t\tif (this.page === 0 || !(await this.savePage())) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.missing = []\n\t\t\tthis.missingPhoto = []\n\t\t\tthis.goTo(this.page - 1)\n\t\t},\n\n\t\t/**\n\t\t * Show a page, move focus to its position line and announce it.\n\t\t *\n\t\t * @param {number} page The page.\n\t\t * @return {void}\n\t\t */\n\t\tgoTo(page) {\n\t\t\tthis.page = page\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.liveText = this.positionText\n\t\t\t\tthis.$refs.position?.focus?.()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The run is done: dispatch `finishAction` when set, and emit `finished`.\n\t\t *\n\t\t * @param {string} [reason] `user`, or `deadline` when the time ran out.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync finish(reason = 'user') {\n\t\t\tif (this.closed) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.finishedRun = true\n\t\t\tclearInterval(this.deadlineTimer)\n\t\t\tthis.deadlineTimer = null\n\t\t\tconst action = this.content?.finishAction\n\t\t\tif (action && typeof action === 'object') {\n\t\t\t\tconst resolved = resolveDeepTokens(action, this.tokenCtx)\n\t\t\t\tconst run = typeof this.cnDispatchAction === 'function' ? this.cnDispatchAction(resolved) : dispatchAction(resolved, { router: this.$router || null, tokenCtx: this.tokenCtx })\n\t\t\t\tawait run\n\t\t\t}\n\t\t\tthis.liveText = t('nextcloud-vue', 'Checklist finished.')\n\t\t\t/**\n\t\t\t * @event finished The last page was saved.\n\t\t\t * @type {{answered: number, total: number, reason: string}}\n\t\t\t */\n\t\t\tthis.$emit('finished', { answered: this.answeredCount, total: this.questions.length, reason })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-checklist-run__form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-checklist-run__position {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tline-height: 17px;\n\tmargin: 0;\n}\n\n.cn-checklist-run__progress {\n\tbackground: var(--color-border);\n\tborder-radius: 3px;\n\tdisplay: block;\n\theight: 6px;\n\toverflow: hidden;\n}\n\n.cn-checklist-run__progress-fill {\n\tbackground: var(--color-primary-element);\n\tdisplay: block;\n\theight: 100%;\n}\n\n.cn-checklist-run__live,\n.cn-checklist-run__sr {\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n\n.cn-checklist-run__question,\n.cn-checklist-run__photos {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large, 12px);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmargin: 0;\n\tpadding: 12px 14px;\n}\n\n.cn-checklist-run__photos-title {\n\tfont-size: 15px;\n\tline-height: 1.2;\n}\n\n.cn-checklist-run__legend {\n\tfont-size: 15px;\n\tfont-weight: 600;\n\tline-height: 1.2;\n\tpadding: 0 4px;\n}\n\n.cn-checklist-run__help {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 14px;\n\tline-height: 1.2;\n\tmargin: 0;\n}\n\n/* An option reads as text, not as a field label (a theme makes every label\n bold with !important); 15px, 31px apart, as the board draws it (DqInspectie). */\n.cn-checklist-run__choice {\n\talign-items: center;\n\tdisplay: flex;\n\tfont-size: 15px;\n\tfont-weight: 400 !important;\n\tgap: 10px;\n\tmin-height: 23px;\n}\n\n/* The board draws the radio with the browser's own 3px 3px 0 5px margin. */\n.cn-checklist-run__choice input {\n\taccent-color: var(--color-primary-element);\n\theight: 20px;\n\tmargin: 3px 3px 0 5px;\n\twidth: 20px;\n}\n\n/* The board look sizes every radio 18px with a (0,4,1) rule. */\n.cn-checklist-run__choice.cn-checklist-run__choice.cn-checklist-run__choice input[type=\"radio\"] {\n\theight: 20px;\n\tmin-height: 20px;\n\tmin-width: 20px;\n\twidth: 20px;\n}\n\n.cn-checklist-run__text,\n.cn-checklist-run__number {\n\tbox-sizing: border-box;\n\twidth: 100%;\n}\n\n/* A note is two 15px lines on the normal line height, 8px 12px in: 54px, as\n the board draws it. A theme pads every textarea 5px 12px with !important. */\n.cn-checklist-run__text.cn-checklist-run__text {\n\tpadding: 8px 12px !important;\n\tline-height: normal;\n\tmargin: 0;\n}\n\n.cn-checklist-run__group {\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tline-height: normal;\n\tmargin: 0;\n}\n\n.cn-checklist-run__note-label {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 14px;\n\tfont-weight: 600 !important;\n\tline-height: 1.2;\n}\n\n.cn-checklist-run__photo-list {\n\tmargin: 0;\n\tpadding-inline-start: 18px;\n}\n\n/* The photo button is the board's 34px secondary control across its card\n (DqInspectie, 272px), its 14px/600 label after a camera. The doubled class\n outranks Nextcloud's `button:not(.button-vue)` margin, padding and height,\n and a theme's bold label weight set with !important. */\n.cn-checklist-run__photo-button.cn-checklist-run__photo-button {\n\talign-items: center;\n\talign-self: stretch;\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--cn-board-control-border, var(--color-border-dark));\n\tborder-radius: var(--border-radius-element, 8px);\n\tbox-sizing: border-box;\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n\tdisplay: flex;\n\tfont-size: 14px;\n\tfont-weight: 600 !important;\n\tgap: 8px;\n\theight: 34px;\n\tmargin: 0;\n\tmin-height: 34px;\n\tpadding: 0 14px;\n}\n\n.cn-checklist-run__photo-button:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n.cn-checklist-run__photo-input {\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twidth: 1px;\n}\n\n.cn-checklist-run__nav {\n\tdisplay: flex;\n\tjustify-content: space-between;\n}\n\n/* Previous and Next are as wide as the board draws them: the board pads the\n button 14px and the label not at all (Vorige 70.3px); NcButton's label\n padding made them 4px wider. */\n.cn-checklist-run__nav :deep(.button-vue__text) {\n\tpadding-inline: 0;\n}\n\n.cn-checklist-run__status {\n\talign-items: center;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px 16px;\n\tjustify-content: space-between;\n}\n\n.cn-checklist-run__time-left {\n\tfont-variant-numeric: tabular-nums;\n\tfont-weight: 600;\n}\n\n.cn-checklist-run__time-left--warning {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-checklist-run__saved {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-checklist-run__error {\n\tcolor: var(--color-error-text, var(--color-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E,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAE,GAAE,cAAc,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAQ,IAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAA;AAC9K,IAAA,MAAM,IAAE;AACT,IAAA;GACA,IAAI,CAAC,WAAWD,SAAC,CAAC,eAAe,EAAE,qBAAqB,EAAA;AACxD;AACC;;;AAGD,GAAA,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAA;GAC7F;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnChecklistRunWidget.vue2.js","sources":["../../../../src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-checklist-run\" data-testid=\"cn-checklist-run\">\n\t\t<p v-if=\"error\"\n\t\t\tclass=\"cn-checklist-run__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-checklist-run-error\">\n\t\t\t{{ error }}\n\t\t</p>\n\t\t<div v-else-if=\"loading\" class=\"cn-checklist-run__loading\">\n\t\t\t<NcLoadingIcon :size=\"20\" :name=\"loadingLabel\" />\n\t\t</div>\n\t\t<p v-else-if=\"questions.length === 0\" class=\"cn-checklist-run__empty\" data-testid=\"cn-checklist-run-empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<form v-else\n\t\t\tclass=\"cn-checklist-run__form\"\n\t\t\tnovalidate\n\t\t\t@submit.prevent=\"next\">\n\t\t\t<div v-if=\"timeLeftText || savedLine\" class=\"cn-checklist-run__status\">\n\t\t\t\t<span v-if=\"timeLeftText\"\n\t\t\t\t\tclass=\"cn-checklist-run__time-left\"\n\t\t\t\t\t:class=\"{ 'cn-checklist-run__time-left--warning': timeWarning }\"\n\t\t\t\t\trole=\"timer\"\n\t\t\t\t\taria-live=\"off\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-time-left\">\n\t\t\t\t\t{{ timeLeftText }}\n\t\t\t\t</span>\n\t\t\t\t<span v-if=\"savedLine\"\n\t\t\t\t\tclass=\"cn-checklist-run__saved\"\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-saved\">\n\t\t\t\t\t{{ savedLine }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<p\n\t\t\t\tref=\"position\"\n\t\t\t\tclass=\"cn-checklist-run__position\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\tdata-testid=\"cn-checklist-run-position\">\n\t\t\t\t{{ positionText }}\n\t\t\t</p>\n\t\t\t<span\n\t\t\t\tclass=\"cn-checklist-run__progress\"\n\t\t\t\trole=\"progressbar\"\n\t\t\t\t:aria-label=\"progressLabel\"\n\t\t\t\taria-valuemin=\"0\"\n\t\t\t\t:aria-valuemax=\"questions.length\"\n\t\t\t\t:aria-valuenow=\"answeredCount\"\n\t\t\t\tdata-testid=\"cn-checklist-run-progress\">\n\t\t\t\t<span class=\"cn-checklist-run__progress-fill\" :style=\"{ width: `${progressShare}%` }\" />\n\t\t\t</span>\n\t\t\t<span class=\"cn-checklist-run__live\" aria-live=\"polite\">{{ liveText }}</span>\n\n\t\t\t<p v-if=\"pageGroup\" class=\"cn-checklist-run__group\" data-testid=\"cn-checklist-run-group\">\n\t\t\t\t{{ pageGroup }}\n\t\t\t</p>\n\t\t\t<fieldset\n\t\t\t\tv-for=\"question in pageQuestions\"\n\t\t\t\t:key=\"question.id\"\n\t\t\t\tclass=\"cn-checklist-run__question\"\n\t\t\t\t:aria-describedby=\"question.help ? `${uid}-help-${question.id}` : null\"\n\t\t\t\tdata-testid=\"cn-checklist-run-question\">\n\t\t\t\t<legend class=\"cn-checklist-run__legend\">\n\t\t\t\t\t{{ question.text }}<span v-if=\"question.required\" class=\"cn-checklist-run__required\">\n\t\t\t\t\t\t<span aria-hidden=\"true\"> *</span><span class=\"cn-checklist-run__sr\">{{ requiredLabel }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t</legend>\n\t\t\t\t<p v-if=\"question.help\" :id=\"`${uid}-help-${question.id}`\" class=\"cn-checklist-run__help\">\n\t\t\t\t\t{{ question.help }}\n\t\t\t\t</p>\n\t\t\t\t<template v-if=\"question.choices.length\">\n\t\t\t\t\t<label\n\t\t\t\t\t\tv-for=\"choice in question.choices\"\n\t\t\t\t\t\t:key=\"choice.value\"\n\t\t\t\t\t\tclass=\"cn-checklist-run__choice\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tv-model=\"draft[question.id].value\"\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t:name=\"`${uid}-${question.id}`\"\n\t\t\t\t\t\t\t:value=\"choice.value\"\n\t\t\t\t\t\t\t:required=\"question.required\"\n\t\t\t\t\t\t\tdata-testid=\"cn-checklist-run-choice\"\n\t\t\t\t\t\t\t@change=\"markDirty(question.id)\">\n\t\t\t\t\t\t{{ choice.label }}\n\t\t\t\t\t</label>\n\t\t\t\t</template>\n\t\t\t\t<input\n\t\t\t\t\tv-else-if=\"question.kind === 'number'\"\n\t\t\t\t\tv-model=\"draft[question.id].value\"\n\t\t\t\t\tclass=\"cn-checklist-run__number\"\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tinputmode=\"decimal\"\n\t\t\t\t\t:aria-label=\"question.text\"\n\t\t\t\t\t:required=\"question.required\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-number\"\n\t\t\t\t\t@input=\"markDirty(question.id)\">\n\t\t\t\t<p v-else-if=\"question.kind === 'photo'\" class=\"cn-checklist-run__help\">\n\t\t\t\t\t{{ photoOnlyLabel }}\n\t\t\t\t</p>\n\t\t\t\t<textarea\n\t\t\t\t\tv-else\n\t\t\t\t\tv-model=\"draft[question.id].value\"\n\t\t\t\t\tclass=\"cn-checklist-run__text\"\n\t\t\t\t\trows=\"3\"\n\t\t\t\t\t:aria-label=\"question.text\"\n\t\t\t\t\t:required=\"question.required\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-text\"\n\t\t\t\t\t@input=\"markDirty(question.id)\" />\n\t\t\t\t<label v-if=\"allowNote && noteShown(question)\" class=\"cn-checklist-run__note-label\">\n\t\t\t\t\t{{ noteLabel }}\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tv-model=\"draft[question.id].note\"\n\t\t\t\t\t\tclass=\"cn-checklist-run__text\"\n\t\t\t\t\t\trows=\"2\"\n\t\t\t\t\t\tdata-testid=\"cn-checklist-run-note\"\n\t\t\t\t\t\t@input=\"markDirty(question.id)\" />\n\t\t\t\t</label>\n\t\t\t\t<CnGeoCaptureField\n\t\t\t\t\tv-if=\"locationField && (locating[question.id] || draft[question.id].location)\"\n\t\t\t\t\t:modelValue=\"draft[question.id].location || null\"\n\t\t\t\t\t:busy=\"locating[question.id] === true\"\n\t\t\t\t\t:goodAccuracy=\"goodAccuracy\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-location\"\n\t\t\t\t\t@update:modelValue=\"setLocation(question.id, $event)\" />\n\t\t\t\t<p\n\t\t\t\t\tv-if=\"missing.includes(question.id)\"\n\t\t\t\t\tclass=\"cn-checklist-run__error\"\n\t\t\t\t\trole=\"alert\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-missing\">\n\t\t\t\t\t{{ missingLabel }}\n\t\t\t\t</p>\n\t\t\t</fieldset>\n\n\t\t\t<div\n\t\t\t\tv-for=\"question in photoQuestions\"\n\t\t\t\t:key=\"`photos-${question.id}`\"\n\t\t\t\tclass=\"cn-checklist-run__photos\"\n\t\t\t\tdata-testid=\"cn-checklist-run-photos\">\n\t\t\t\t<strong class=\"cn-checklist-run__photos-title\">{{ photoTitle(question) }}</strong>\n\t\t\t\t<ul v-if=\"photoNamesFor(question).length\" class=\"cn-checklist-run__photo-list\">\n\t\t\t\t\t<li v-for=\"name in photoNamesFor(question)\" :key=\"name\" data-testid=\"cn-checklist-run-photo\">\n\t\t\t\t\t\t{{ name }}\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t<!-- A button that opens the hidden file input, so the control is\n\t\t\t\t a button to every reader; the input stays out of the tab\n\t\t\t\t order and the accessibility tree. -->\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-checklist-run__photo-button\"\n\t\t\t\t\t:aria-describedby=\"missingPhoto.includes(question.id) ? `${uid}-photo-${question.id}` : null\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-photo-button\"\n\t\t\t\t\t@click=\"openPhotoPicker\">\n\t\t\t\t\t<CameraOutline :size=\"16\" />\n\t\t\t\t\t{{ photoNamesFor(question).length || (storedPhotos[question.id] || []).length ? morePhotoLabel : addPhotoLabel }}\n\t\t\t\t</button>\n\t\t\t\t<input\n\t\t\t\t\tclass=\"cn-checklist-run__photo-input\"\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\tcapture=\"environment\"\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-photo-input\"\n\t\t\t\t\t@change=\"addPhotos($event, question.id)\">\n\t\t\t\t<p\n\t\t\t\t\tv-if=\"missingPhoto.includes(question.id)\"\n\t\t\t\t\t:id=\"`${uid}-photo-${question.id}`\"\n\t\t\t\t\tclass=\"cn-checklist-run__error\"\n\t\t\t\t\trole=\"alert\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-missing-photo\">\n\t\t\t\t\t{{ missingPhotoLabel }}\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t<div class=\"cn-checklist-run__nav\">\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t:disabled=\"page === 0 || saving || closed\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-previous\"\n\t\t\t\t\t@click=\"previous\">\n\t\t\t\t\t{{ previousLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton v-if=\"submitLabel\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t:disabled=\"saving || closed\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-submit\"\n\t\t\t\t\t@click=\"submit\">\n\t\t\t\t\t{{ submitLabel }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton v-if=\"!submitLabel || !isLastPage\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t:disabled=\"saving || closed\"\n\t\t\t\t\tdata-testid=\"cn-checklist-run-next\">\n\t\t\t\t\t{{ isLastPage ? finishLabel : nextLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<p v-if=\"saveError\"\n\t\t\t\tclass=\"cn-checklist-run__error\"\n\t\t\t\trole=\"alert\"\n\t\t\t\tdata-testid=\"cn-checklist-run-save-error\">\n\t\t\t\t{{ saveError }}\n\t\t\t</p>\n\t\t</form>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcLoadingIcon } from '@nextcloud/vue'\nimport CameraOutline from 'vue-material-design-icons/CameraOutline.vue'\nimport { uploadHeldFiles } from '../../composables/useHeldFileUpload.js'\nimport { dispatchAction } from '../../utils/actionsDispatcher.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { captureLocation } from '../../utils/captureLocation.js'\nimport { parseDateValue } from '../../utils/dateVariant.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { hasUnresolvedTokens, resolveDeepTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\nimport { CnGeoCaptureField } from '../CnGeoCaptureField/index.js'\n\nconst OBJECT_API = '/apps/openregister/api/objects'\nconst TICK_MS = 1000\nconst DEFAULT_TIME_WARNING_SECONDS = 300\nconst LAST_MINUTE_SECONDS = 60\n\nlet instanceCounter = 0\n\n/**\n * The choices a question type offers, before translation.\n *\n * @type {Record<string, Array<{value: string, label: string}>>}\n */\nconst TYPE_CHOICES = Object.freeze({\n\tyes_no: [{ key: 'yes', label: 'Yes' }, { key: 'no', label: 'No' }],\n\tyes_no_na: [{ key: 'yes', label: 'Yes' }, { key: 'no', label: 'No' }, { key: 'na', label: 'Not applicable' }],\n})\n\n/** The kinds of question the widget draws. */\nconst KINDS = Object.freeze(['yes_no', 'yes_no_na', 'choice', 'text', 'number', 'photo'])\n\n/**\n * Sort by a numeric field, lowest first, keeping the given order for ties and\n * for entries without the field.\n *\n * @param {Array<object>} list The entries.\n * @param {string} field The field.\n * @return {Array<object>} A sorted copy.\n */\nfunction byOrder(list, field) {\n\tif (!field) {\n\t\treturn [...list]\n\t}\n\tconst rank = (entry) => {\n\t\tconst n = Number(readPath(entry, field))\n\t\treturn Number.isFinite(n) ? n : Infinity\n\t}\n\treturn list.map((entry, index) => ({ entry, index })).sort((a, b) => (rank(a.entry) - rank(b.entry)) || (a.index - b.index)).map(({ entry }) => entry)\n}\n\n/**\n * A register or schema as the object API path takes it.\n *\n * @param {string|object} value A slug, or a register/schema object.\n * @return {string} The slug or id.\n */\nfunction slugOf(value) {\n\tif (value && typeof value === 'object') {\n\t\treturn String(value.slug ?? value.id ?? '')\n\t}\n\treturn value ? String(value) : ''\n}\n\n/**\n * The id of an object, wherever OpenRegister carries it.\n *\n * @param {object|null} object The object.\n * @return {string} The id, or ''.\n */\nfunction idOf(object) {\n\treturn String(object?.id ?? object?.['@self']?.id ?? object?.uuid ?? '')\n}\n\n/**\n * A number of seconds as a clock: \"18:42\", or \"1:04:05\" from an hour.\n *\n * @param {number} seconds The seconds.\n * @return {string} The clock.\n */\nfunction clockOf(seconds) {\n\tconst pad = (value) => String(value).padStart(2, '0')\n\tconst hours = Math.floor(seconds / 3600)\n\tconst minutes = Math.floor((seconds % 3600) / 60)\n\treturn hours > 0\n\t\t? `${hours}:${pad(minutes)}:${pad(seconds % 60)}`\n\t\t: `${pad(minutes)}:${pad(seconds % 60)}`\n}\n\n/**\n * CnChecklistRunWidget — the `checklist-run` widget: a checklist answered a\n * page of questions at a time (board DqInspectie, the middle phone frame).\n *\n * The questions are records of a register, listed with a token-resolved\n * filter. Each page shows `pageSize` questions (one by default) as radio\n * choices or a text field, an optional note, and photos for the first\n * question of the page, then Previous and Next. The answers of a page are\n * saved when the user moves on.\n *\n * Answers are stored one record per question through the OpenRegister object\n * API, under the reader's own rights: an existing answer is updated, a new\n * one created with the `answers.create` fields. Photos go up through the\n * object's own file upload (`uploadHeldFiles`) and are attached to the\n * answer's `photosField`. An app that stores answers its own way names a\n * `saveAction` instead; it is dispatched per answer with the answer as its\n * last argument, and photos are not uploaded then.\n *\n * ```json\n * {\n * \"type\": \"checklist-run\",\n * \"content\": {\n * \"questions\": { \"register\": \"app\", \"schema\": \"question\", \"filter\": { \"checklist\": \"@object.checklist\" }, \"orderField\": \"position\" },\n * \"fields\": { \"text\": \"text\", \"type\": \"type\", \"options\": \"options\", \"required\": \"required\", \"help\": \"help\" },\n * \"answers\": {\n * \"register\": \"app\", \"schema\": \"answer\", \"filter\": { \"run\": \"@objectId\" },\n * \"questionField\": \"question\", \"valueField\": \"answer\", \"noteField\": \"note\", \"photosField\": \"photos\",\n * \"create\": { \"run\": \"@objectId\" }\n * },\n * \"pageSize\": 1,\n * \"caption\": \"{title} version {version}\"\n * }\n * }\n * ```\n *\n * The questions and answers can also live inside the open record:\n * `questionsPath` (with `itemsKey` for groups, both sorted by `orderField`)\n * reads the questions off it, and `answersPath` writes the answers into an\n * array on it, one entry per question keyed by `answerKey`, by updating the\n * record through the object API. Photos then go to the record's own files\n * (`recordPhotosField`) and their references into the answer.\n *\n * A question can require a photo: `fields.photoRequired` names its rule,\n * `photoRequiredValues` maps the stored values onto `never`, `always` or\n * `{ whenAnswer }`, and the page holds until the photo is there. On a page\n * with no bound record, `record: { register, schema, filter, sort }` picks\n * the open record: the first match, under the reader's rights.\n *\n * A timed run names the record's deadline in `deadlineField`: the time left\n * follows that moment rather than the page's start, so a reload keeps it. At\n * zero the page is saved and the run finishes. `submitLabel` adds a button\n * that finishes from any page, and `savedText` says so while nothing is unsaved.\n * `saveEachAnswer: true` (or a wait in ms) saves each answer a moment after\n * it is given instead of when the user moves on.\n *\n * `noteWhen: { answers: [...] }` shows a question's note field only once its\n * answer is one of those stored values (the board shows a note under \"Nee\"),\n * or when the question already holds a note; without it every question shows\n * one (`allowNote: false` hides them all).\n *\n * `startAt: \"firstOpen\"` opens a run that was started earlier at the page of\n * its first unanswered question (the last page when all are answered), once\n * per record; `startAt: \"lastAnswered\"` at the page of its last answered\n * question, where the inspector was; without it the run opens at the first\n * page.\n *\n * `captureLocation: { field, goodAccuracy? }` captures where each answer was\n * given, unasked, the first time it changes: the page's save waits for the\n * device, a rough fix or none says so and takes an address by hand, and the\n * place is stored in `field` of the answer.\n *\n * Question kinds: `yes_no`, `yes_no_na`, `choice` (the question's `options`,\n * a list of strings or `{ value, label }`), `number`, `photo` and `text`.\n * `typeMap` maps the app's type values onto them, `choiceValues` the stored\n * values of yes / no / not applicable.\n * Keyboard: the choices are native radio buttons in a fieldset whose legend is\n * the question; on a new page focus moves to the position line and a polite\n * live region reads it.\n */\nexport default {\n\tname: 'CnChecklistRunWidget',\n\n\tcomponents: { CameraOutline, CnGeoCaptureField, NcButton, NcLoadingIcon },\n\n\tinject: {\n\t\t/** The detail page's object context (`{ objectId, object }`), for tokens. */\n\t\tcnObjectContext: { default: null },\n\t\t/** The page's workspace values, for `@workspace.<key>` tokens. */\n\t\tcnWorkspaceContext: { default: null },\n\t\t/** The host's translate, for manifest texts and question texts. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The page's pre-bound action dispatcher, for `saveAction` / `finishAction`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget config: `{ questions | questionsPath, itemsKey?,\n\t\t * groupLabelField?, orderField?, fields?, typeMap?, choiceValues?,\n\t\t * answers | answersPath, answerKey?, answerFields?, recordPhotosField?,\n\t\t * record?, saveAction?, finishAction?, pageSize?, allowNote?, noteWhen?,\n\t\t * allowPhotos?, caption?, emptyText?, deadlineField?, serverNowField?,\n\t\t * timeLeftText?, timeWarningSeconds?, savedText?, submitLabel?,\n\t\t * saveEachAnswer? }`, as in the component\n\t\t * description and docs/components/cn-checklist-run-widget.md.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The bound record's id, for `@objectId`. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record, for `@object.<field>`, the caption and `questionsPath` / `answersPath`. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The bound record's register, for writing `answersPath` (`content.record` wins). */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record's schema, for writing `answersPath` (`content.record` wins). */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['finished'],\n\n\tdata() {\n\t\tinstanceCounter += 1\n\t\treturn {\n\t\t\tuid: `cn-checklist-run-${instanceCounter}`,\n\t\t\tloading: false,\n\t\t\terror: '',\n\t\t\tsaving: false,\n\t\t\tsaveError: '',\n\t\t\tquestions: [],\n\t\t\tanswerIds: {},\n\t\t\t// Photos an answer already holds, kept when new ones are attached.\n\t\t\tstoredPhotos: {},\n\t\t\t// `answersPath` mode: the answer entries as last read or written.\n\t\t\trecordAnswers: [],\n\t\t\tdraft: {},\n\t\t\tdirty: {},\n\t\t\tlocating: {},\n\t\t\tlocationPending: {},\n\t\t\tphotos: {},\n\t\t\tpage: 0,\n\t\t\t// The source the page was last positioned for; `startAt` applies once per source.\n\t\t\tpositionedFor: '',\n\t\t\tmissing: [],\n\t\t\t// Questions on this page that still need their photo.\n\t\t\tmissingPhoto: [],\n\t\t\t// `content.record` with a filter: the record it picked, or null.\n\t\t\tpickedRecord: null,\n\t\t\tliveText: '',\n\t\t\t// The deadline ticker: the moment now, its timer, and whether the run has finished.\n\t\t\tnow: Date.now(),\n\t\t\trecordReadAt: Date.now(),\n\t\t\tdeadlineTimer: null,\n\t\t\t// `saveEachAnswer`: the pending save, and the save that runs now.\n\t\t\tanswerSaveTimer: null,\n\t\t\tpageSave: null,\n\t\t\tfinishedRun: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The wait before an answer saves on its own (`saveEachAnswer`: `true`\n\t\t * waits 800 ms, a number that many ms), or null to save on moving on.\n\t\t *\n\t\t * @return {number|null}\n\t\t * @spec openspec/changes/checklist-run-save-each-answer/specs/checklist-run-widget/spec.md#requirement-a-run-can-save-each-answer-as-it-is-given\n\t\t */\n\t\tanswerSaveDelay() {\n\t\t\tconst option = this.content?.saveEachAnswer\n\t\t\tif (option === true) {\n\t\t\t\treturn 800\n\t\t\t}\n\t\t\treturn typeof option === 'number' && option >= 0 ? option : null\n\t\t},\n\n\t\t/** @return {object} What the tokens resolve against. */\n\t\ttokenCtx() {\n\t\t\tconst unwrap = (c) => (c && typeof c === 'object' && 'value' in c ? c.value : c)\n\t\t\tconst injected = unwrap(this.cnObjectContext) || {}\n\t\t\treturn {\n\t\t\t\t...injected,\n\t\t\t\tobjectId: (this.pickedRecord && idOf(this.pickedRecord)) || this.objectId || injected.objectId || this.objectData?.id || null,\n\t\t\t\tobject: this.pickedRecord || this.objectData || injected.object || null,\n\t\t\t\tworkspace: unwrap(this.cnWorkspaceContext) || {},\n\t\t\t}\n\t\t},\n\n\t\t/** @return {object} The question field paths, with their defaults. */\n\t\tfields() {\n\t\t\treturn { id: 'id', text: 'text', type: 'type', options: 'options', required: 'required', help: 'help', ...(this.content?.fields || {}) }\n\t\t},\n\n\t\t/** @return {number} Questions per page, at least 1. */\n\t\tpageSize() {\n\t\t\tconst n = Math.floor(Number(this.content?.pageSize))\n\t\t\treturn Number.isFinite(n) && n >= 1 ? n : 1\n\t\t},\n\n\t\t/** @return {number} The number of pages. */\n\t\tpageCount() {\n\t\t\treturn Math.max(1, Math.ceil(this.questions.length / this.pageSize))\n\t\t},\n\n\t\t/** @return {boolean} Whether this is the last page. */\n\t\tisLastPage() {\n\t\t\treturn this.page >= this.pageCount - 1\n\t\t},\n\n\t\t/** @return {object[]} The questions on this page. */\n\t\tpageQuestions() {\n\t\t\treturn this.questions.slice(this.page * this.pageSize, (this.page + 1) * this.pageSize)\n\t\t},\n\n\t\t/** @return {object|null} The first question on this page, the one photos belong to. */\n\t\tcurrentQuestion() {\n\t\t\treturn this.pageQuestions[0] || null\n\t\t},\n\n\t\t/** @return {number} Questions with an answer. */\n\t\tansweredCount() {\n\t\t\treturn this.questions.filter((q) => this.isAnswered(q)).length\n\t\t},\n\n\t\t/** @return {number} The share answered, 0 to 100. */\n\t\tprogressShare() {\n\t\t\treturn this.questions.length ? Math.round((this.answeredCount / this.questions.length) * 100) : 0\n\t\t},\n\n\t\t/** @return {string} \"Question 7 of 24\", with the caption after it. */\n\t\tpositionText() {\n\t\t\tconst first = this.page * this.pageSize + 1\n\t\t\tconst position = t('nextcloud-vue', 'Question {n} of {total}', { n: first, total: this.questions.length })\n\t\t\tconst caption = this.caption\n\t\t\treturn caption ? `${position} · ${caption}` : position\n\t\t},\n\n\t\t/** @return {string} `content.caption` with `{field}` filled from the record. */\n\t\tcaption() {\n\t\t\tconst template = this.content?.caption\n\t\t\tif (typeof template !== 'string' || template === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst object = this.tokenCtx.object || {}\n\t\t\treturn this.translate(template).replace(/\\{([A-Za-z0-9_.]+)\\}/g, (_m, path) => {\n\t\t\t\tconst value = readPath(object, path)\n\t\t\t\treturn value === null || value === undefined ? '' : String(value)\n\t\t\t}).trim()\n\t\t},\n\n\t\t/** @return {string} The answer field a captured place is stored in, '' when none is asked for. */\n\t\tlocationField() {\n\t\t\treturn this.content?.captureLocation?.field || ''\n\t\t},\n\n\t\t/** @return {number} The accuracy in metres above which a fix counts as low. */\n\t\tgoodAccuracy() {\n\t\t\treturn this.content?.captureLocation?.goodAccuracy ?? 50\n\t\t},\n\n\t\t/** @return {boolean} Whether a note field shows (default true). */\n\t\tallowNote() {\n\t\t\treturn this.content?.allowNote !== false\n\t\t},\n\n\t\t/** @return {boolean} Whether the answers are written into an array on the open record. */\n\t\tinRecord() {\n\t\t\treturn typeof this.content?.answersPath === 'string' && this.content.answersPath !== ''\n\t\t},\n\n\t\t/** @return {object} `answersPath` field names, with their defaults. */\n\t\tanswerFields() {\n\t\t\treturn { value: 'value', number: 'value', choice: 'value', note: 'note', photos: 'photos', ...(this.content?.answerFields || {}) }\n\t\t},\n\n\t\t/** @return {{register: string, schema: string}} Where the open record lives. */\n\t\trecordRef() {\n\t\t\tconst own = this.content?.record || {}\n\t\t\treturn { register: slugOf(own.register || this.register), schema: slugOf(own.schema || this.schema) }\n\t\t},\n\n\t\t/**\n\t\t * Whether photos can be added: allowed, and somewhere to put them.\n\t\t *\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-questions-and-answers-can-live-inside-the-open-record\n\t\t */\n\t\tphotosEnabled() {\n\t\t\tif (this.content?.allowPhotos === false || this.content?.saveAction) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (this.inRecord) {\n\t\t\t\treturn Boolean(this.content?.recordPhotosField && this.answerFields.photos)\n\t\t\t}\n\t\t\treturn Boolean(this.content?.answers?.photosField)\n\t\t},\n\n\t\t/** @return {string} The group (section) of this page's first question, or ''. */\n\t\tpageGroup() {\n\t\t\treturn this.currentQuestion?.group || ''\n\t\t},\n\n\t\t/**\n\t\t * The questions of this page that get a photo control: with a\n\t\t * `photoRequired` field, those whose rule is not never (and photo\n\t\t * questions), less a `{ whenAnswer }` question answered otherwise that\n\t\t * holds no photo; without one, the first question of the page.\n\t\t *\n\t\t * @return {object[]} The questions.\n\t\t * @spec openspec/changes/checklist-run-photo-rule/specs/checklist-run-photo-rule/spec.md#requirement-a-question-can-require-a-photo\n\t\t */\n\t\tphotoQuestions() {\n\t\t\tif (!this.photosEnabled) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (this.fields.photoRequired) {\n\t\t\t\treturn this.pageQuestions.filter((q) => q.kind === 'photo' || (q.photoRule !== 'never' && !this.photoRuledOut(q)))\n\t\t\t}\n\t\t\tconst first = this.currentQuestion\n\t\t\tconst extra = this.pageQuestions.filter((q) => q.kind === 'photo' && q !== first)\n\t\t\treturn first ? [first, ...extra] : extra\n\t\t},\n\n\t\t/**\n\t\t * `content.record` with a `filter`: the list to pick the open record\n\t\t * from (first match of `sort`), `'blocked'` while a token is\n\t\t * unresolved, or null without a filter.\n\t\t *\n\t\t * @return {object|string|null}\n\t\t * @spec openspec/changes/checklist-run-photo-rule/specs/checklist-run-photo-rule/spec.md#requirement-a-checklist-run-can-pick-its-record-by-filter\n\t\t */\n\t\trecordPicker() {\n\t\t\tconst own = this.content?.record\n\t\t\tif (!own || typeof own !== 'object' || !own.filter || typeof own.filter !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst unwrap = (c) => (c && typeof c === 'object' && 'value' in c ? c.value : c)\n\t\t\tconst filter = resolveFilterTokens(own.filter, { objectId: this.objectId || null, object: this.objectData, workspace: unwrap(this.cnWorkspaceContext) || {} })\n\t\t\tif (hasUnresolvedTokens(filter)) {\n\t\t\t\treturn 'blocked'\n\t\t\t}\n\t\t\tconst sort = own.sort && typeof own.sort === 'object' && own.sort.field ? { [`_order[${own.sort.field}]`]: own.sort.dir === 'asc' ? 'asc' : 'desc' } : {}\n\t\t\treturn { register: slugOf(own.register), schema: slugOf(own.schema), filter: { ...filter, ...sort } }\n\t\t},\n\n\t\t/** @return {object|null} The record the run lives in: the picked one, else the bound one. */\n\t\topenRecord() {\n\t\t\treturn this.recordPicker ? this.pickedRecord : this.tokenCtx.object\n\t\t},\n\n\t\t/** @return {string} The key of the source lists, to read them again when they change. */\n\t\tsourceKey() {\n\t\t\tconst picker = this.recordPicker\n\t\t\tif (picker === 'blocked') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (picker && typeof this.content?.questionsPath === 'string' && this.content.questionsPath !== '') {\n\t\t\t\treturn JSON.stringify({ pick: picker, path: this.content.questionsPath })\n\t\t\t}\n\t\t\tif (typeof this.content?.questionsPath === 'string' && this.content.questionsPath !== '') {\n\t\t\t\tconst object = this.tokenCtx.object\n\t\t\t\treturn object ? JSON.stringify({ path: this.content.questionsPath, id: idOf(object), at: object['@self']?.updated ?? null }) : ''\n\t\t\t}\n\t\t\tconst q = this.content?.questions\n\t\t\tif (!q || !q.register || !q.schema) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst qFilter = resolveFilterTokens(q.filter || {}, this.tokenCtx)\n\t\t\tconst a = this.content?.answers\n\t\t\tconst aFilter = a && a.register && a.schema ? resolveFilterTokens(a.filter || {}, this.tokenCtx) : null\n\t\t\tif (hasUnresolvedTokens(qFilter) || (aFilter && hasUnresolvedTokens(aFilter))) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn JSON.stringify({ q: [q.register, q.schema, qFilter], a: aFilter ? [a.register, a.schema, aFilter] : null })\n\t\t},\n\n\t\tloadingLabel: () => t('nextcloud-vue', 'Loading …'),\n\t\tprogressLabel: () => t('nextcloud-vue', 'Questions answered'),\n\t\trequiredLabel: () => ` ${t('nextcloud-vue', '(required)')}`,\n\t\tmissingLabel: () => t('nextcloud-vue', 'Answer this question to go on.'),\n\t\tpreviousLabel: () => t('nextcloud-vue', 'Previous'),\n\t\tnextLabel: () => t('nextcloud-vue', 'Next'),\n\t\tfinishLabel: () => t('nextcloud-vue', 'Finish'),\n\t\taddPhotoLabel: () => t('nextcloud-vue', 'Take or add a photo'),\n\t\tmissingPhotoLabel: () => t('nextcloud-vue', 'This answer needs a photo. Add one to go on.'),\n\t\tphotoOnlyLabel: () => t('nextcloud-vue', 'Answer with a photo.'),\n\t\tmorePhotoLabel: () => t('nextcloud-vue', 'Another photo'),\n\n\t\t/** @return {number|null} The deadline as read off the open record, on this device's clock; null without one. */\n\t\tdeadlineAt() {\n\t\t\tconst field = this.content?.deadlineField\n\t\t\tconst date = field ? parseDateValue(readPath(this.openRecord, field)) : null\n\t\t\treturn date ? date.getTime() + this.serverOffset : null\n\t\t},\n\n\t\t/** @return {number} How far this device's clock runs ahead of the server's, in milliseconds. */\n\t\tserverOffset() {\n\t\t\tconst field = this.content?.serverNowField\n\t\t\tconst serverNow = field ? parseDateValue(readPath(this.openRecord, field)) : null\n\t\t\treturn serverNow ? this.recordReadAt - serverNow.getTime() : 0\n\t\t},\n\n\t\t/** @return {number|null} Whole seconds until the deadline, never below 0; null without one. */\n\t\tsecondsLeft() {\n\t\t\treturn this.deadlineAt === null ? null : Math.max(0, Math.ceil((this.deadlineAt - this.now) / 1000))\n\t\t},\n\n\t\t/** @return {boolean} Whether the time left is in its warning stretch. */\n\t\ttimeWarning() {\n\t\t\treturn this.secondsLeft !== null && this.secondsLeft <= (this.content?.timeWarningSeconds ?? DEFAULT_TIME_WARNING_SECONDS)\n\t\t},\n\n\t\t/** @return {string} The time left in words, or ''. */\n\t\ttimeLeftText() {\n\t\t\tif (this.secondsLeft === null) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst time = clockOf(this.secondsLeft)\n\t\t\treturn this.content?.timeLeftText\n\t\t\t\t? this.translate(this.content.timeLeftText).replace('{time}', time)\n\t\t\t\t: t('nextcloud-vue', 'Time left: {time}', { time })\n\t\t},\n\n\t\t/** @return {string} `savedText`, while nothing is unsaved and something was answered. */\n\t\tsavedLine() {\n\t\t\tconst text = this.content?.savedText\n\t\t\tif (!text || this.answeredCount === 0 || Object.keys(this.dirty).length > 0 || this.saveError) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.translate(text)\n\t\t},\n\n\t\t/** @return {boolean} A timed run finishes once: it is over, so nothing moves any more. */\n\t\tclosed() {\n\t\t\treturn this.finishedRun && this.deadlineAt !== null\n\t\t},\n\n\t\t/** @return {string} The label of the button that finishes from any page, or ''. */\n\t\tsubmitLabel() {\n\t\t\treturn this.content?.submitLabel ? this.translate(this.content.submitLabel) : ''\n\t\t},\n\n\t\t/** @return {string} The note field's label. */\n\t\tnoteLabel() {\n\t\t\treturn this.content?.noteLabel ? this.translate(this.content.noteLabel) : t('nextcloud-vue', 'Note')\n\t\t},\n\n\t\t/** @return {string} The empty-state text. */\n\t\temptyLabel() {\n\t\t\treturn this.content?.emptyText ? this.translate(this.content.emptyText) : t('nextcloud-vue', 'This checklist has no questions.')\n\t\t},\n\t},\n\n\twatch: {\n\t\tsourceKey: {\n\t\t\thandler() {\n\t\t\t\tthis.load()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\topenRecord: {\n\t\t\thandler() {\n\t\t\t\tthis.recordReadAt = Date.now()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\tdeadlineAt() {\n\t\t\tthis.startDeadlineTimer()\n\t\t},\n\n\t\t'questions.length': function() {\n\t\t\tthis.startDeadlineTimer()\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.startDeadlineTimer()\n\t},\n\n\tbeforeUnmount() {\n\t\tclearInterval(this.deadlineTimer)\n\t\tif (this.answerSaveTimer) {\n\t\t\tclearTimeout(this.answerSaveTimer)\n\t\t\tthis.answerSaveTimer = null\n\t\t\tthis.savePage()\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Run the ticker while a run with questions has a deadline.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstartDeadlineTimer() {\n\t\t\tclearInterval(this.deadlineTimer)\n\t\t\tthis.deadlineTimer = null\n\t\t\tif (this.deadlineAt === null || this.questions.length === 0 || this.finishedRun) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.deadlineTimer = setInterval(this.onDeadlineTick, TICK_MS)\n\t\t\tthis.onDeadlineTick()\n\t\t},\n\n\t\t/**\n\t\t * Bring the time left up to date, say the warning and the last minute\n\t\t * once, and at zero save and finish. A failed save leaves the run open,\n\t\t * so the user can try again and sees why. While a save runs it waits for\n\t\t * the next tick.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onDeadlineTick() {\n\t\t\tconst before = this.secondsLeft\n\t\t\tthis.now = Date.now()\n\t\t\tconst left = this.secondsLeft\n\t\t\tif (left === null) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst warning = this.content?.timeWarningSeconds ?? DEFAULT_TIME_WARNING_SECONDS\n\t\t\tif (left > 0 && before !== null && [warning, LAST_MINUTE_SECONDS].some((mark) => before > mark && left <= mark)) {\n\t\t\t\tthis.liveText = this.timeLeftText\n\t\t\t}\n\t\t\tif (left > 0 || this.saving) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tclearInterval(this.deadlineTimer)\n\t\t\tthis.deadlineTimer = null\n\t\t\tif (await this.savePage()) {\n\t\t\t\tawait this.finish('deadline')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether a question shows its note field: always, unless `noteWhen`\n\t\t * names the answers that ask for one and this question has none of\n\t\t * them and no note yet.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean}\n\t\t */\n\t\tnoteShown(question) {\n\t\t\tconst answers = this.content?.noteWhen?.answers\n\t\t\tif (!Array.isArray(answers)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tconst draft = this.draft[question.id] || {}\n\t\t\treturn (draft.note || '') !== '' || answers.map(String).includes(String(draft.value ?? ''))\n\t\t},\n\n\t\t/**\n\t\t * The host's translate, or the text unchanged.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The translation.\n\t\t */\n\t\ttranslate(text) {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\t/**\n\t\t * Whether a value counts as an answer.\n\t\t *\n\t\t * @param {unknown} value The value.\n\t\t * @return {boolean} True for a non-empty value.\n\t\t */\n\t\thasValue(value) {\n\t\t\treturn value !== null && value !== undefined && String(value).trim() !== ''\n\t\t},\n\n\t\t/**\n\t\t * Whether a question has an answer: a value, or for a photo question\n\t\t * a photo stored or held.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean} True when answered.\n\t\t */\n\t\tisAnswered(question) {\n\t\t\tif (question.kind === 'photo') {\n\t\t\t\treturn this.hasPhoto(question)\n\t\t\t}\n\t\t\treturn this.hasValue(this.draft[question.id]?.value)\n\t\t},\n\n\t\t/**\n\t\t * A question record as the widget draws it.\n\t\t *\n\t\t * @param {object} record The question record.\n\t\t * @param {string} [group] The group (section) it belongs to.\n\t\t * @return {{id: string, text: string, kind: string, required: boolean, help: string, choices: Array<{value: string, label: string}>, group: string}} The question.\n\t\t */\n\t\ttoQuestion(record, group = '') {\n\t\t\tconst f = this.fields\n\t\t\tconst raw = String(readPath(record, f.type) ?? '')\n\t\t\tconst mapped = this.content?.typeMap && typeof this.content.typeMap === 'object' ? this.content.typeMap[raw] : undefined\n\t\t\tconst kind = KINDS.includes(mapped) ? mapped : (KINDS.includes(raw) ? raw : 'text')\n\t\t\tconst stored = { yes: 'yes', no: 'no', na: 'na', ...(this.content?.choiceValues || {}) }\n\t\t\tlet choices = (TYPE_CHOICES[kind] || []).map((c) => ({ value: String(stored[c.key]), label: t('nextcloud-vue', c.label) }))\n\t\t\tif (kind === 'choice') {\n\t\t\t\tconst options = readPath(record, f.options)\n\t\t\t\tchoices = (Array.isArray(options) ? options : []).map((o) => (o && typeof o === 'object'\n\t\t\t\t\t? { value: String(o.value ?? o.label ?? ''), label: this.translate(String(o.label ?? o.value ?? '')) }\n\t\t\t\t\t: { value: String(o), label: this.translate(String(o)) })).filter((c) => c.value !== '')\n\t\t\t}\n\t\t\tconst help = readPath(record, f.help)\n\t\t\treturn {\n\t\t\t\tid: String(readPath(record, f.id) ?? idOf(record)),\n\t\t\t\ttext: this.translate(String(readPath(record, f.text) ?? '')),\n\t\t\t\tkind,\n\t\t\t\trequired: Boolean(readPath(record, f.required)),\n\t\t\t\thelp: typeof help === 'string' && help !== '' ? this.translate(help) : '',\n\t\t\t\tchoices,\n\t\t\t\tgroup,\n\t\t\t\tphotoRule: this.photoRuleOf(record),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A question's photo rule, from its `photoRequired` field mapped\n\t\t * through `photoRequiredValues`: `'never'`, `'always'` or\n\t\t * `{ whenAnswer }` (a photo is needed when the answer is that value).\n\t\t *\n\t\t * @param {object} record The question record.\n\t\t * @return {('never'|'always'|{whenAnswer: string})} The rule.\n\t\t * @spec openspec/changes/checklist-run-photo-rule/specs/checklist-run-photo-rule/spec.md#requirement-a-question-can-require-a-photo\n\t\t */\n\t\tphotoRuleOf(record) {\n\t\t\tconst path = this.fields.photoRequired\n\t\t\tif (!path) {\n\t\t\t\treturn 'never'\n\t\t\t}\n\t\t\tconst raw = readPath(record, path)\n\t\t\tconst map = { true: 'always', false: 'never', always: 'always', never: 'never', ...(this.content?.photoRequiredValues || {}) }\n\t\t\tconst rule = raw === null || raw === undefined ? 'never' : map[String(raw)]\n\t\t\tif (rule && typeof rule === 'object' && rule.whenAnswer !== undefined) {\n\t\t\t\treturn { whenAnswer: String(rule.whenAnswer) }\n\t\t\t}\n\t\t\treturn rule === 'always' ? 'always' : 'never'\n\t\t},\n\n\t\t/**\n\t\t * Whether a question needs a photo with its current answer.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean} True when a photo is required now.\n\t\t */\n\t\tneedsPhoto(question) {\n\t\t\tconst rule = question.photoRule\n\t\t\tif (rule === 'always') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn Boolean(rule && typeof rule === 'object' && String(this.draft[question.id]?.value ?? '') === rule.whenAnswer)\n\t\t},\n\n\t\t/**\n\t\t * Whether a question's answer rules its photo out: a `{ whenAnswer }`\n\t\t * question answered with another value and holding no photo.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean} True when no photo control is needed.\n\t\t */\n\t\tphotoRuledOut(question) {\n\t\t\tconst rule = question.photoRule\n\t\t\tconst value = String(this.draft[question.id]?.value ?? '')\n\t\t\treturn Boolean(rule && typeof rule === 'object' && value !== '' && value !== rule.whenAnswer && !this.hasPhoto(question))\n\t\t},\n\n\t\t/**\n\t\t * Whether a question has a photo, stored or held.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {boolean} True with at least one photo.\n\t\t */\n\t\thasPhoto(question) {\n\t\t\treturn (this.storedPhotos[question.id] || []).length > 0 || (this.photos[question.id] || []).length > 0\n\t\t},\n\n\t\t/**\n\t\t * The photo card title for a question: its position in the run.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {string} The title.\n\t\t */\n\t\tphotoTitle(question) {\n\t\t\tconst n = this.questions.indexOf(question) + 1\n\t\t\treturn t('nextcloud-vue', 'Photo for question {n}', { n })\n\t\t},\n\n\t\t/**\n\t\t * The names of the photos held for a question.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {string[]} The file names.\n\t\t */\n\t\tphotoNamesFor(question) {\n\t\t\treturn (this.photos[question.id] || []).map((file) => file.name)\n\t\t},\n\n\t\t/**\n\t\t * The questions on the open record (`questionsPath`): a list of\n\t\t * questions, or of groups whose `itemsKey` holds them, both levels\n\t\t * sorted by `orderField`.\n\t\t *\n\t\t * @return {object[]} The questions.\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-questions-and-answers-can-live-inside-the-open-record\n\t\t */\n\t\tquestionsFromRecord() {\n\t\t\tconst c = this.content\n\t\t\tconst list = readPath(this.openRecord, c.questionsPath)\n\t\t\tconst orderField = c.orderField === undefined ? 'order' : c.orderField\n\t\t\tconst top = byOrder(Array.isArray(list) ? list : [], orderField)\n\t\t\tif (!c.itemsKey) {\n\t\t\t\treturn top.map((record) => this.toQuestion(record))\n\t\t\t}\n\t\t\tconst labelField = c.groupLabelField || 'name'\n\t\t\treturn top.flatMap((group) => {\n\t\t\t\tconst items = readPath(group, c.itemsKey)\n\t\t\t\tconst label = readPath(group, labelField)\n\t\t\t\treturn byOrder(Array.isArray(items) ? items : [], orderField).map((record) => this.toQuestion(record, typeof label === 'string' ? this.translate(label) : ''))\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The draft of one answer entry from the open record's `answersPath`.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @param {object} entry The stored entry.\n\t\t * @return {{value: string, note: string}} The draft.\n\t\t */\n\t\tdraftFromEntry(question, entry) {\n\t\t\tconst af = this.answerFields\n\t\t\tconst field = question.kind === 'number' ? af.number : (question.kind === 'choice' ? af.choice : af.value)\n\t\t\tconst value = readPath(entry, field)\n\t\t\tconst note = readPath(entry, af.note)\n\t\t\treturn { value: value === null || value === undefined ? '' : String(value), note: note === null || note === undefined ? '' : String(note) }\n\t\t},\n\n\t\t/**\n\t\t * Read the questions and the answers given so far.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-a-checklist-run-shows-a-page-of-questions-at-a-time\n\t\t */\n\t\tasync load() {\n\t\t\tconst key = this.sourceKey\n\t\t\tif (key === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.error = ''\n\t\t\ttry {\n\t\t\t\tconst picker = this.recordPicker\n\t\t\t\tif (picker) {\n\t\t\t\t\tconst found = await fetchReferenceObjects({ register: picker.register, schema: picker.schema, filter: picker.filter, limit: 1 })\n\t\t\t\t\tif (key !== this.sourceKey) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthis.pickedRecord = found[0] || null\n\t\t\t\t}\n\t\t\t\tlet questions\n\t\t\t\tif (picker && !this.pickedRecord) {\n\t\t\t\t\tquestions = []\n\t\t\t\t} else if (this.content.questionsPath) {\n\t\t\t\t\tquestions = this.questionsFromRecord()\n\t\t\t\t} else {\n\t\t\t\t\tconst q = this.content.questions\n\t\t\t\t\tconst records = await fetchReferenceObjects({ register: q.register, schema: q.schema, filter: resolveFilterTokens(q.filter || {}, this.tokenCtx), limit: q.limit || 500 })\n\t\t\t\t\tquestions = byOrder(records, q.orderField).map((r) => this.toQuestion(r))\n\t\t\t\t}\n\t\t\t\tquestions = questions.filter((x) => x.id !== '' && x.text !== '')\n\t\t\t\tconst a = this.inRecord ? null : this.content.answers\n\t\t\t\tconst answers = a && a.register && a.schema\n\t\t\t\t\t? await fetchReferenceObjects({ register: a.register, schema: a.schema, filter: resolveFilterTokens(a.filter || {}, this.tokenCtx), limit: a.limit || 500 })\n\t\t\t\t\t: []\n\t\t\t\tif (key !== this.sourceKey) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst draft = {}\n\t\t\t\tconst answerIds = {}\n\t\t\t\tconst storedPhotos = {}\n\t\t\t\tfor (const question of questions) {\n\t\t\t\t\tdraft[question.id] = { value: '', note: '' }\n\t\t\t\t}\n\t\t\t\tif (this.inRecord) {\n\t\t\t\t\tconst entries = readPath(this.openRecord, this.content.answersPath)\n\t\t\t\t\tthis.recordAnswers = Array.isArray(entries) ? entries : []\n\t\t\t\t\tconst key = this.content.answerKey || 'questionId'\n\t\t\t\t\tfor (const entry of this.recordAnswers) {\n\t\t\t\t\t\tconst qid = String(readPath(entry, key) ?? '')\n\t\t\t\t\t\tconst question = questions.find((x) => x.id === qid)\n\t\t\t\t\t\tif (question && !answerIds[qid]) {\n\t\t\t\t\t\t\tdraft[qid] = { ...this.draftFromEntry(question, entry), location: this.locationField ? (readPath(entry, this.locationField) ?? null) : null }\n\t\t\t\t\t\t\tanswerIds[qid] = qid\n\t\t\t\t\t\t\tconst photos = readPath(entry, this.answerFields.photos)\n\t\t\t\t\t\t\tstoredPhotos[qid] = Array.isArray(photos) ? photos : []\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const answer of answers) {\n\t\t\t\t\tconst qid = String(readPath(answer, a.questionField || 'question') ?? '')\n\t\t\t\t\tif (draft[qid] && !answerIds[qid]) {\n\t\t\t\t\t\tdraft[qid] = {\n\t\t\t\t\t\t\tvalue: String(readPath(answer, a.valueField || 'answer') ?? ''),\n\t\t\t\t\t\t\tnote: String(readPath(answer, a.noteField || 'note') ?? ''),\n\t\t\t\t\t\t\tlocation: this.locationField ? (readPath(answer, this.locationField) ?? null) : null,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanswerIds[qid] = idOf(answer)\n\t\t\t\t\t\tconst stored = a.photosField ? readPath(answer, a.photosField) : null\n\t\t\t\t\t\tstoredPhotos[qid] = Array.isArray(stored) ? stored : []\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.questions = questions\n\t\t\t\tthis.draft = draft\n\t\t\t\tthis.answerIds = answerIds\n\t\t\t\tthis.storedPhotos = storedPhotos\n\t\t\t\tthis.dirty = {}\n\t\t\t\tconst lastPage = Math.max(0, Math.ceil(questions.length / this.pageSize) - 1)\n\t\t\t\tif (this.positionedFor !== key && this.content?.startAt === 'firstOpen') {\n\t\t\t\t\tconst open = questions.findIndex((question) => !this.isAnswered(question))\n\t\t\t\t\tthis.page = open === -1 ? lastPage : Math.floor(open / this.pageSize)\n\t\t\t\t} else if (this.positionedFor !== key && this.content?.startAt === 'lastAnswered') {\n\t\t\t\t\tconst last = questions.findLastIndex((question) => this.isAnswered(question))\n\t\t\t\t\tthis.page = last === -1 ? 0 : Math.floor(last / this.pageSize)\n\t\t\t\t}\n\t\t\t\tthis.positionedFor = key\n\t\t\t\tthis.page = Math.min(this.page, lastPage)\n\t\t\t} catch {\n\t\t\t\tthis.error = t('nextcloud-vue', 'The checklist could not be loaded.')\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Note that a question's answer changed, so the page saves it.\n\t\t *\n\t\t * @param {string} id The question id.\n\t\t * @return {void}\n\t\t */\n\t\tmarkDirty(id) {\n\t\t\tthis.dirty = { ...this.dirty, [id]: true }\n\t\t\tthis.missing = this.missing.filter((m) => m !== id)\n\t\t\tthis.startLocating(id)\n\t\t\tthis.scheduleAnswerSave()\n\t\t},\n\n\t\t/**\n\t\t * With `saveEachAnswer`, save the page a moment after the last change,\n\t\t * so typing saves once and a quick run of answers saves together.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/checklist-run-save-each-answer/specs/checklist-run-widget/spec.md#requirement-a-run-can-save-each-answer-as-it-is-given\n\t\t */\n\t\tscheduleAnswerSave() {\n\t\t\tconst delay = this.answerSaveDelay\n\t\t\tif (delay === null) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tclearTimeout(this.answerSaveTimer)\n\t\t\tthis.answerSaveTimer = setTimeout(() => {\n\t\t\t\tthis.answerSaveTimer = null\n\t\t\t\tthis.savePage()\n\t\t\t}, delay)\n\t\t},\n\n\t\t/**\n\t\t * Capture the place of an answer once, the first time it changes. The\n\t\t * promise is kept so the page's save can wait for it.\n\t\t *\n\t\t * @param {string} id The question id.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/checklist-run-location/specs/checklist-run-location/spec.md#requirement-an-answer-carries-where-it-was-given\n\t\t */\n\t\tstartLocating(id) {\n\t\t\tif (!this.locationField || this.draft[id]?.location || this.locating[id]) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.locating = { ...this.locating, [id]: true }\n\t\t\tthis.locationPending[id] = captureLocation().then((fix) => {\n\t\t\t\tdelete this.locationPending[id]\n\t\t\t\tthis.locating = { ...this.locating, [id]: false }\n\t\t\t\tthis.draft[id].location = fix ? { ...fix, low: fix.accuracy > this.goodAccuracy } : { low: true }\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The place was changed in the field: a new fix or a typed address.\n\t\t *\n\t\t * @param {string} id The question id.\n\t\t * @param {object} location The place.\n\t\t * @return {void}\n\t\t */\n\t\tsetLocation(id, location) {\n\t\t\tthis.draft[id].location = location\n\t\t\tthis.dirty = { ...this.dirty, [id]: true }\n\t\t\tthis.scheduleAnswerSave()\n\t\t},\n\n\t\t/**\n\t\t * Open the file picker of the photo button's own question: the hidden\n\t\t * input that follows the button.\n\t\t *\n\t\t * @param {MouseEvent} event The button's click.\n\t\t * @return {void}\n\t\t */\n\t\topenPhotoPicker(event) {\n\t\t\tconst input = event.currentTarget.nextElementSibling\n\t\t\tif (input && input.type === 'file') {\n\t\t\t\tinput.click()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Hold the photos picked for a question until the page saves.\n\t\t *\n\t\t * @param {Event} event The file input's change event.\n\t\t * @param {string} [questionId] The question, else the first of the page.\n\t\t * @return {void}\n\t\t */\n\t\taddPhotos(event, questionId) {\n\t\t\tconst id = questionId || this.currentQuestion?.id\n\t\t\tconst files = Array.from(event?.target?.files || [])\n\t\t\tif (!id || files.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.photos = { ...this.photos, [id]: [...(this.photos[id] || []), ...files] }\n\t\t\tthis.dirty = { ...this.dirty, [id]: true }\n\t\t\tthis.scheduleAnswerSave()\n\t\t\tthis.missingPhoto = this.missingPhoto.filter((m) => m !== id)\n\t\t\tif (event.target) {\n\t\t\t\tevent.target.value = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Save the changed answers of this page: through `saveAction` when\n\t\t * set, else one answer record per question through the object API,\n\t\t * then its held photos.\n\t\t *\n\t\t * @return {Promise<boolean>} True when everything saved.\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-answers-are-saved-under-the-readers-own-rights\n\t\t */\n\t\tasync savePage() {\n\t\t\t// One save at a time, so an answer is never created twice.\n\t\t\twhile (this.pageSave) {\n\t\t\t\tawait this.pageSave\n\t\t\t}\n\t\t\tthis.pageSave = this.savePageNow()\n\t\t\ttry {\n\t\t\t\treturn await this.pageSave\n\t\t\t} finally {\n\t\t\t\tthis.pageSave = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Save the changed answers of this page now (see `savePage`).\n\t\t *\n\t\t * @return {Promise<boolean>} True when everything saved.\n\t\t */\n\t\tasync savePageNow() {\n\t\t\tconst changed = this.pageQuestions.filter((q) => this.dirty[q.id])\n\t\t\tif (changed.length === 0) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tthis.saving = true\n\t\t\tthis.saveError = ''\n\t\t\ttry {\n\t\t\t\tawait Promise.all(Object.values(this.locationPending))\n\t\t\t\tif (this.inRecord && !this.content?.saveAction) {\n\t\t\t\t\tawait this.saveIntoRecord(changed)\n\t\t\t\t\tthis.dirty = Object.fromEntries(Object.entries(this.dirty).filter(([id]) => !changed.some((q) => q.id === id)))\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tfor (const question of changed) {\n\t\t\t\t\tawait this.saveAnswer(question)\n\t\t\t\t\tconst { [question.id]: _done, ...rest } = this.dirty\n\t\t\t\t\tthis.dirty = rest\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t} catch {\n\t\t\t\tthis.saveError = t('nextcloud-vue', 'The answer could not be saved. Try again.')\n\t\t\t\treturn false\n\t\t\t} finally {\n\t\t\t\tthis.saving = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write the changed answers of this page into the open record's\n\t\t * `answersPath` array (one entry per question, keyed by `answerKey`)\n\t\t * with one update of the record through the object API. Held photos\n\t\t * go first to the record's own files (`recordPhotosField`), and their\n\t\t * references (`photoRefField`, default `id`) into the answer.\n\t\t *\n\t\t * @param {object[]} changed The changed questions.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-questions-and-answers-can-live-inside-the-open-record\n\t\t */\n\t\tasync saveIntoRecord(changed) {\n\t\t\tconst { register, schema } = this.recordRef\n\t\t\tconst objectId = idOf(this.openRecord) || String(this.openRecordId || '')\n\t\t\tif (!register || !schema || !objectId) {\n\t\t\t\tthrow new Error('no record to write to')\n\t\t\t}\n\t\t\tconst c = this.content\n\t\t\tconst af = this.answerFields\n\t\t\tconst key = c.answerKey || 'questionId'\n\t\t\tconst refField = c.photoRefField || 'id'\n\t\t\tlet recordPhotos = Array.isArray(readPath(this.openRecord, c.recordPhotosField)) ? readPath(this.openRecord, c.recordPhotosField) : []\n\t\t\tconst entries = [...this.recordAnswers]\n\t\t\tfor (const question of changed) {\n\t\t\t\tconst draft = this.draft[question.id]\n\t\t\t\tconst index = entries.findIndex((entry) => String(readPath(entry, key) ?? '') === question.id)\n\t\t\t\tconst entry = { ...(index >= 0 ? entries[index] : { [key]: question.id }) }\n\t\t\t\tif (question.kind === 'number') {\n\t\t\t\t\tentry[af.number] = draft.value === '' ? null : Number(draft.value)\n\t\t\t\t} else if (question.kind === 'choice') {\n\t\t\t\t\tentry[af.choice] = draft.value\n\t\t\t\t} else if (question.kind !== 'photo') {\n\t\t\t\t\tentry[af.value] = draft.value\n\t\t\t\t}\n\t\t\t\tif (this.allowNote) {\n\t\t\t\t\tentry[af.note] = draft.note\n\t\t\t\t}\n\t\t\t\tif (af.at) {\n\t\t\t\t\tentry[af.at] = new Date().toISOString()\n\t\t\t\t}\n\t\t\t\tif (this.locationField) {\n\t\t\t\t\tentry[this.locationField] = draft.location ?? null\n\t\t\t\t}\n\t\t\t\tconst held = this.photos[question.id] || []\n\t\t\t\tif (this.photosEnabled && held.length) {\n\t\t\t\t\tconst field = c.recordPhotosField\n\t\t\t\t\tconst { failed, attached } = await uploadHeldFiles({ register, schema, objectId, held: { [field]: held }, kept: { [field]: recordPhotos } })\n\t\t\t\t\tif (failed.length) {\n\t\t\t\t\t\tthrow new Error('photo upload failed')\n\t\t\t\t\t}\n\t\t\t\t\tconst now = Array.isArray(attached[field]) ? attached[field] : recordPhotos\n\t\t\t\t\tconst added = now.slice(recordPhotos.length).map((ref) => (ref && typeof ref === 'object' ? ref[refField] ?? ref : ref))\n\t\t\t\t\trecordPhotos = now\n\t\t\t\t\tconst existing = Array.isArray(entry[af.photos]) ? entry[af.photos] : []\n\t\t\t\t\tentry[af.photos] = [...existing, ...added]\n\t\t\t\t\tthis.storedPhotos = { ...this.storedPhotos, [question.id]: entry[af.photos] }\n\t\t\t\t\tconst { [question.id]: _sent, ...rest } = this.photos\n\t\t\t\t\tthis.photos = rest\n\t\t\t\t}\n\t\t\t\tif (index >= 0) {\n\t\t\t\t\tentries[index] = entry\n\t\t\t\t} else {\n\t\t\t\t\tentries.push(entry)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst url = generateUrl(`${OBJECT_API}/${encodeURIComponent(register)}/${encodeURIComponent(schema)}/${encodeURIComponent(objectId)}`)\n\t\t\tawait axios.patch(url, { [c.answersPath]: entries })\n\t\t\tthis.recordAnswers = entries\n\t\t},\n\n\t\t/**\n\t\t * Save one answer.\n\t\t *\n\t\t * @param {object} question The question.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync saveAnswer(question) {\n\t\t\tconst entry = this.draft[question.id]\n\t\t\tconst answer = { questionId: question.id, value: entry.value, note: entry.note }\n\t\t\tif (this.locationField) {\n\t\t\t\tanswer.location = entry.location ?? null\n\t\t\t}\n\t\t\tconst action = this.content?.saveAction\n\t\t\tif (action && typeof action === 'object') {\n\t\t\t\tconst resolved = resolveDeepTokens(action, this.tokenCtx)\n\t\t\t\tconst wrapped = { ...resolved, args: [...(Array.isArray(resolved.args) ? resolved.args : []), answer] }\n\t\t\t\tconst run = typeof this.cnDispatchAction === 'function' ? this.cnDispatchAction(wrapped) : dispatchAction(wrapped, { router: this.$router || null, tokenCtx: this.tokenCtx })\n\t\t\t\tawait run\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst a = this.content?.answers\n\t\t\tif (!a || !a.register || !a.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst body = {\n\t\t\t\t[a.questionField || 'question']: question.id,\n\t\t\t\t[a.valueField || 'answer']: entry.value,\n\t\t\t}\n\t\t\tif (this.allowNote) {\n\t\t\t\tbody[a.noteField || 'note'] = entry.note\n\t\t\t}\n\t\t\tif (this.locationField) {\n\t\t\t\tbody[this.locationField] = entry.location ?? null\n\t\t\t}\n\t\t\tconst base = generateUrl(`${OBJECT_API}/${encodeURIComponent(a.register)}/${encodeURIComponent(a.schema)}`)\n\t\t\tlet id = this.answerIds[question.id]\n\t\t\tif (id) {\n\t\t\t\tawait axios.patch(`${base}/${encodeURIComponent(id)}`, body)\n\t\t\t} else {\n\t\t\t\tconst create = resolveDeepTokens(a.create && typeof a.create === 'object' ? a.create : {}, this.tokenCtx)\n\t\t\t\tconst response = await axios.post(base, { ...create, ...body })\n\t\t\t\tid = idOf(response?.data)\n\t\t\t\tthis.answerIds = { ...this.answerIds, [question.id]: id }\n\t\t\t}\n\t\t\tconst held = this.photos[question.id] || []\n\t\t\tif (this.photosEnabled && held.length && id) {\n\t\t\t\tconst { failed, attached } = await uploadHeldFiles({ register: a.register, schema: a.schema, objectId: id, held: { [a.photosField]: held }, kept: { [a.photosField]: this.storedPhotos[question.id] || [] } })\n\t\t\t\tif (failed.length) {\n\t\t\t\t\tthrow new Error('photo upload failed')\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(attached[a.photosField])) {\n\t\t\t\t\tthis.storedPhotos = { ...this.storedPhotos, [question.id]: attached[a.photosField] }\n\t\t\t\t}\n\t\t\t\tconst { [question.id]: _sent, ...rest } = this.photos\n\t\t\t\tthis.photos = rest\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The required questions on this page without an answer.\n\t\t *\n\t\t * @return {string[]} Their ids.\n\t\t */\n\t\tunansweredRequired() {\n\t\t\treturn this.pageQuestions.filter((q) => q.required && !this.isAnswered(q)).map((q) => q.id)\n\t\t},\n\n\t\t/**\n\t\t * Save this page and go to the next one; on the last page, finish.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-a-checklist-run-shows-a-page-of-questions-at-a-time\n\t\t */\n\t\tasync next() {\n\t\t\tthis.missing = this.unansweredRequired()\n\t\t\tthis.missingPhoto = this.photosEnabled ? this.pageQuestions.filter((q) => this.needsPhoto(q) && !this.hasPhoto(q)).map((q) => q.id) : []\n\t\t\tif (this.missing.length || this.missingPhoto.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!(await this.savePage())) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.secondsLeft === 0) {\n\t\t\t\tawait this.finish('deadline')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.isLastPage) {\n\t\t\t\tif (!this.submitLabel) {\n\t\t\t\t\tawait this.finish()\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.goTo(this.page + 1)\n\t\t},\n\n\t\t/**\n\t\t * Finish from any page. A required question without an answer holds it\n\t\t * back and opens that question's page.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync submit() {\n\t\t\tconst open = this.questions.findIndex((q) => q.required && !this.isAnswered(q))\n\t\t\tif (open >= 0) {\n\t\t\t\tif (!(await this.savePage())) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.missing = [this.questions[open].id]\n\t\t\t\tthis.goTo(Math.floor(open / this.pageSize))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.missing = []\n\t\t\tif (await this.savePage()) {\n\t\t\t\tawait this.finish()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Save this page and go back one.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync previous() {\n\t\t\tif (this.page === 0 || !(await this.savePage())) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.missing = []\n\t\t\tthis.missingPhoto = []\n\t\t\tthis.goTo(this.page - 1)\n\t\t},\n\n\t\t/**\n\t\t * Show a page, move focus to its position line and announce it.\n\t\t *\n\t\t * @param {number} page The page.\n\t\t * @return {void}\n\t\t */\n\t\tgoTo(page) {\n\t\t\tthis.page = page\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.liveText = this.positionText\n\t\t\t\tthis.$refs.position?.focus?.()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The run is done: dispatch `finishAction` when set, and emit `finished`.\n\t\t *\n\t\t * @param {string} [reason] `user`, or `deadline` when the time ran out.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync finish(reason = 'user') {\n\t\t\tif (this.closed) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.finishedRun = true\n\t\t\tclearInterval(this.deadlineTimer)\n\t\t\tthis.deadlineTimer = null\n\t\t\tconst action = this.content?.finishAction\n\t\t\tif (action && typeof action === 'object') {\n\t\t\t\tconst resolved = resolveDeepTokens(action, this.tokenCtx)\n\t\t\t\tconst run = typeof this.cnDispatchAction === 'function' ? this.cnDispatchAction(resolved) : dispatchAction(resolved, { router: this.$router || null, tokenCtx: this.tokenCtx })\n\t\t\t\tawait run\n\t\t\t}\n\t\t\tthis.liveText = t('nextcloud-vue', 'Checklist finished.')\n\t\t\t/**\n\t\t\t * @event finished The last page was saved.\n\t\t\t * @type {{answered: number, total: number, reason: string}}\n\t\t\t */\n\t\t\tthis.$emit('finished', { answered: this.answeredCount, total: this.questions.length, reason })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-checklist-run__form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-checklist-run__position {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tline-height: 17px;\n\tmargin: 0;\n}\n\n.cn-checklist-run__progress {\n\tbackground: var(--color-border);\n\tborder-radius: 3px;\n\tdisplay: block;\n\theight: 6px;\n\toverflow: hidden;\n}\n\n.cn-checklist-run__progress-fill {\n\tbackground: var(--color-primary-element);\n\tdisplay: block;\n\theight: 100%;\n}\n\n.cn-checklist-run__live,\n.cn-checklist-run__sr {\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n\twidth: 1px;\n}\n\n.cn-checklist-run__question,\n.cn-checklist-run__photos {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large, 12px);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmargin: 0;\n\tpadding: 12px 14px;\n}\n\n.cn-checklist-run__photos-title {\n\tfont-size: 15px;\n\tline-height: 1.2;\n}\n\n.cn-checklist-run__legend {\n\tfont-size: 15px;\n\tfont-weight: 600;\n\tline-height: 1.2;\n\tpadding: 0 4px;\n}\n\n.cn-checklist-run__help {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 14px;\n\tline-height: 1.2;\n\tmargin: 0;\n}\n\n/* An option reads as text, not as a field label (a theme makes every label\n bold with !important); 15px, 31px apart, as the board draws it (DqInspectie). */\n.cn-checklist-run__choice {\n\talign-items: center;\n\tdisplay: flex;\n\tfont-size: 15px;\n\tfont-weight: 400 !important;\n\tgap: 10px;\n\tmin-height: 23px;\n}\n\n/* The board draws the radio with the browser's own 3px 3px 0 5px margin. */\n.cn-checklist-run__choice input {\n\taccent-color: var(--color-primary-element);\n\theight: 20px;\n\tmargin: 3px 3px 0 5px;\n\twidth: 20px;\n}\n\n/* The board look sizes every radio 18px with a (0,4,1) rule. */\n.cn-checklist-run__choice.cn-checklist-run__choice.cn-checklist-run__choice input[type=\"radio\"] {\n\theight: 20px;\n\tmin-height: 20px;\n\tmin-width: 20px;\n\twidth: 20px;\n}\n\n.cn-checklist-run__text,\n.cn-checklist-run__number {\n\tbox-sizing: border-box;\n\twidth: 100%;\n}\n\n/* A note is two 15px lines on the normal line height, 8px 12px in: 54px, as\n the board draws it. A theme pads every textarea 5px 12px with !important. */\n.cn-checklist-run__text.cn-checklist-run__text {\n\tpadding: 8px 12px !important;\n\tline-height: normal;\n\tmargin: 0;\n}\n\n.cn-checklist-run__group {\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tline-height: normal;\n\tmargin: 0;\n}\n\n.cn-checklist-run__note-label {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n\tfont-size: 14px;\n\tfont-weight: 600 !important;\n\tline-height: 1.2;\n}\n\n.cn-checklist-run__photo-list {\n\tmargin: 0;\n\tpadding-inline-start: 18px;\n}\n\n/* The photo button is the board's 34px secondary control across its card\n (DqInspectie, 272px), its 14px/600 label after a camera. The doubled class\n outranks Nextcloud's `button:not(.button-vue)` margin, padding and height,\n and a theme's bold label weight set with !important. */\n.cn-checklist-run__photo-button.cn-checklist-run__photo-button {\n\talign-items: center;\n\talign-self: stretch;\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--cn-board-control-border, var(--color-border-dark));\n\tborder-radius: var(--border-radius-element, 8px);\n\tbox-sizing: border-box;\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n\tdisplay: flex;\n\tfont-size: 14px;\n\tfont-weight: 600 !important;\n\tgap: 8px;\n\theight: 34px;\n\tmargin: 0;\n\tmin-height: 34px;\n\tpadding: 0 14px;\n}\n\n.cn-checklist-run__photo-button:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n.cn-checklist-run__photo-input {\n\tclip-path: inset(50%);\n\theight: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twidth: 1px;\n}\n\n.cn-checklist-run__nav {\n\tdisplay: flex;\n\tjustify-content: space-between;\n}\n\n/* Previous and Next are as wide as the board draws them: the board pads the\n button 14px and the label not at all (Vorige 70.3px); NcButton's label\n padding made them 4px wider. */\n.cn-checklist-run__nav :deep(.button-vue__text) {\n\tpadding-inline: 0;\n}\n\n.cn-checklist-run__status {\n\talign-items: center;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px 16px;\n\tjustify-content: space-between;\n}\n\n.cn-checklist-run__time-left {\n\tfont-variant-numeric: tabular-nums;\n\tfont-weight: 600;\n}\n\n.cn-checklist-run__time-left--warning {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-checklist-run__saved {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-checklist-run__error {\n\tcolor: var(--color-error-text, var(--color-error));\n\tmargin: 0;\n}\n\n.cn-checklist-run__empty {\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["CnGeoCaptureField","t","axios"],"mappings":";;;;;;;;;;;;;;AAmOA,MAAM,aAAa,iCAA+B;AAClD,MAAM,OAAM,GAAI,KAAG;AACnB,MAAM,4BAA6B,GAAE,IAAE;AACvC,MAAM,mBAAoB,GAAE,GAAC;;AAE7B,IAAI,kBAAkB,EAAA;;AAEtB;;AAEC;;;AAGD,MAAM,YAAa,GAAE,MAAM,CAAC,MAAM,CAAC;CAClC,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAI,EAAG,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAK,EAAC,CAAC;AAClE,CAAA,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAI,EAAG,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAK,EAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAe,EAAG,CAAC;AAC9G,CAAC,EAAA;;AAED;AACA,MAAM,KAAM,GAAE,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAA;;AAExF;AACC;;AAEA;AACA;;AAEA;;AAED,SAAS,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE;CAC7B,IAAI,CAAC,KAAK,EAAE;AACX,EAAA,OAAO,CAAC,GAAG,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