@alfadocs/ui-kit 1.148.0 → 1.149.1
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/_chunks/{calendar-appointment-editor-dialog-Cz8F2H4M.js → calendar-appointment-editor-dialog-fQleWmJE.js} +5 -5
- package/dist/_chunks/{calendar-waiting-list-panel-C4T85b4q.js → calendar-waiting-list-panel-BKBHfBpn.js} +2 -2
- package/dist/_chunks/{calendar.sheets-DsgPdycU.js → calendar.sheets-lgAqJB34.js} +2 -2
- package/dist/_chunks/notes-panel-Cw06dLDm.js +1135 -0
- package/dist/_chunks/rich-text-editor-eGdYDPK2.js +4405 -0
- package/dist/_chunks/task-editor-C-4I2sBa.js +1162 -0
- package/dist/_chunks/{tasks-panel-DufAoAxG.js → tasks-panel-BDPQPOP6.js} +475 -461
- package/dist/_chunks/{use-appointment-details-read-kYp-gfhb.js → use-appointment-details-read-Bl1DHXQ2.js} +568 -554
- package/dist/agent-catalog.json +9 -7
- package/dist/agent-i18n/en.json +4 -4
- package/dist/appointment-editor-panel/index.js +1 -1
- package/dist/aws-transcribe/index.js +287 -181
- package/dist/browser-support.js +1 -1
- package/dist/components/_shared/save-outcome.d.ts +23 -0
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +12 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +5 -3
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/task-editor/use-task-editor-form.d.ts +7 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/find-free-slots-panel/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.js +2 -1
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.js +2 -1
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.js +2 -1
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.js +2 -1
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.js +2 -1
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.js +2 -1
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.js +2 -1
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.js +2 -1
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.js +2 -1
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.js +2 -1
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.js +2 -1
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.js +2 -1
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.js +2 -1
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.js +2 -1
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.js +2 -1
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.js +2 -1
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.js +2 -1
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.js +2 -1
- package/dist/index.js +1407 -1403
- package/dist/locales/ar.json +2 -1
- package/dist/locales/de.json +2 -1
- package/dist/locales/el.json +2 -1
- package/dist/locales/en.json +2 -1
- package/dist/locales/es.json +2 -1
- package/dist/locales/fr.json +2 -1
- package/dist/locales/hi.json +2 -1
- package/dist/locales/it.json +2 -1
- package/dist/locales/ja.json +2 -1
- package/dist/locales/nl.json +2 -1
- package/dist/locales/pl.json +2 -1
- package/dist/locales/pt.json +2 -1
- package/dist/locales/ro.json +2 -1
- package/dist/locales/ru.json +2 -1
- package/dist/locales/sq.json +2 -1
- package/dist/locales/sv.json +2 -1
- package/dist/locales/tr.json +2 -1
- package/dist/locales/zh.json +2 -1
- package/dist/online-bookings-panel/index.js +1 -1
- package/dist/patterns/calendar/index.js +2 -2
- package/dist/save-outcome/index.js +20 -0
- package/dist/speech/aws-transcribe.d.ts +30 -6
- package/dist/tokens.css +1 -1
- package/dist/waiting-list-panel/index.js +2 -2
- package/package.json +5 -1
- package/dist/_chunks/notes-panel-BHMnLbEH.js +0 -1116
- package/dist/_chunks/rich-text-editor-BAcJq1PO.js +0 -4359
- package/dist/_chunks/task-editor-B9YpfwcW.js +0 -1095
|
@@ -0,0 +1,1162 @@
|
|
|
1
|
+
import { jsxs as b, jsx as n, Fragment as be } from "react/jsx-runtime";
|
|
2
|
+
import { useState as K, useRef as E, useEffect as Je, forwardRef as Ft, useId as Ot, useMemo as Fe } from "react";
|
|
3
|
+
import { c as Qe } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Ut } from "react-i18next";
|
|
5
|
+
import { A as C } from "./alert-C4WKViaS.js";
|
|
6
|
+
import { B as Le } from "./button-Dp4j9ygh.js";
|
|
7
|
+
import { I as ze } from "./icon-button-u9VMQn3x.js";
|
|
8
|
+
import { C as Pt } from "./combobox-BYl6mY4c.js";
|
|
9
|
+
import { D as X } from "./dialog-239Geb7Z.js";
|
|
10
|
+
import { D as xt } from "./date-picker-CD-PBzXM.js";
|
|
11
|
+
import { F as B } from "./form-field-CyHfOVKF.js";
|
|
12
|
+
import { I as jt } from "./icon-button-group-DEAx9M5v.js";
|
|
13
|
+
import { P as $t } from "./panel-header-CbtlTe85.js";
|
|
14
|
+
import { P as Mt } from "./panel-subview-DjBwNV16.js";
|
|
15
|
+
import { R as Oe } from "./radio-BZQs6_36.js";
|
|
16
|
+
import { R as qt } from "./radio-group-ChIKyeSJ.js";
|
|
17
|
+
import { S as Vt } from "./scroll-area-CY5SLYNw.js";
|
|
18
|
+
import { S as Ge } from "./select-Bw5FvGJ7.js";
|
|
19
|
+
import { S as He } from "./skeleton-tTWJpvAq.js";
|
|
20
|
+
import { S as _t } from "./switch-DO6uC4HJ.js";
|
|
21
|
+
import { T as Wt } from "./text-area-COMVJ1yE.js";
|
|
22
|
+
import { T as Ue } from "./text-input-B6iAgCr3.js";
|
|
23
|
+
import { T as Kt } from "./time-picker-DDr5vhwQ.js";
|
|
24
|
+
import { u as Lt } from "./registry-DvAUVLHh.js";
|
|
25
|
+
import { u as zt } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
26
|
+
import { c as Gt } from "./compose-refs-C0k0tdqF.js";
|
|
27
|
+
import { E as Ht, a as Yt } from "./compact-editor-fields-cP6yh7xv.js";
|
|
28
|
+
import { P as Xt } from "./patient-picker-Dm74jHIk.js";
|
|
29
|
+
import { b as Jt } from "./privacy-mask-zVh0ntm0.js";
|
|
30
|
+
import { isSaveOutcomeUnknownError as Pe, useSaveOutcomeUnknownMessage as Qt } from "../save-outcome/index.js";
|
|
31
|
+
import { g as Ye } from "./get-error-message-DbFUzuja.js";
|
|
32
|
+
import { h as Zt } from "./handled-rejection-C-6Dq0As.js";
|
|
33
|
+
import { L as en } from "./lock-ClAFG1gy.js";
|
|
34
|
+
import { X as tn } from "./x-B5YnXwCz.js";
|
|
35
|
+
import { C as nn } from "./circle-off-DuT9pVy2.js";
|
|
36
|
+
import { U as on } from "./user-B12p7bVF.js";
|
|
37
|
+
import { B as rn } from "./building-2-D33bLCWL.js";
|
|
38
|
+
import { S as an } from "./stethoscope-sZXGC43m.js";
|
|
39
|
+
import { T as ut } from "./trash-2-uumy3fy1.js";
|
|
40
|
+
import { S as pt } from "./square-check-big-dj0o8yA3.js";
|
|
41
|
+
import { p as sn } from "./privacy-mask-text-B8YfzB7L.js";
|
|
42
|
+
import { L as dn } from "./loader-circle-BECIU_8N.js";
|
|
43
|
+
import { S as ln } from "./save-Dn8uje3f.js";
|
|
44
|
+
const cn = {
|
|
45
|
+
id: "task-editor",
|
|
46
|
+
// set_value backs set_fields and set_done; submit backs save; dismiss
|
|
47
|
+
// backs cancel.
|
|
48
|
+
capabilities: ["set_value", "submit", "dismiss"],
|
|
49
|
+
state: {
|
|
50
|
+
status: {
|
|
51
|
+
type: "'loading' | 'ready' | 'error' | 'locked' | 'withheld'",
|
|
52
|
+
descriptionKey: "ui.agent.taskEditor.state.status",
|
|
53
|
+
description: "Where the form is: loading the task, ready, failed to load, locked (edit mode with nothing to load) or withheld behind the privacy notice. Writes need 'ready'.",
|
|
54
|
+
read: (r) => r.getStatus()
|
|
55
|
+
},
|
|
56
|
+
draft: {
|
|
57
|
+
type: "{ mode: string; dateIso: string | null; about: string; patientId: string | null; companyId: string | null; operatorId: string | null; typeId: string | null; assigneeId: string | null; done: boolean; hasNote: boolean; noteLength: number }",
|
|
58
|
+
descriptionKey: "ui.agent.taskEditor.state.draft",
|
|
59
|
+
description: "The draft as Save would send it: ids and structure only, never the note body. done is the last value the host confirmed, or the value the reader chose when a Done save ended with SaveOutcomeUnknownError.",
|
|
60
|
+
read: (r) => r.getDraft()
|
|
61
|
+
},
|
|
62
|
+
canSave: {
|
|
63
|
+
type: "boolean",
|
|
64
|
+
descriptionKey: "ui.agent.taskEditor.state.canSave",
|
|
65
|
+
description: "Whether save would reach the host now: the form is ready, the note is filled, a chosen counterpart has an id and no write is pending.",
|
|
66
|
+
read: (r) => r.canSave()
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
actions: {
|
|
70
|
+
set_fields: {
|
|
71
|
+
safety: "phi",
|
|
72
|
+
argsType: "{ dateIso?: string; note?: string; typeId?: string; assigneeId?: string | null; about?: 'nobody' | 'patient' | 'company' | 'operator'; patientId?: string; companyId?: string; operatorId?: string }",
|
|
73
|
+
argsSchema: {
|
|
74
|
+
type: "object",
|
|
75
|
+
properties: {
|
|
76
|
+
dateIso: { type: "string", format: "date-time" },
|
|
77
|
+
note: { type: "string" },
|
|
78
|
+
typeId: { type: "string" },
|
|
79
|
+
assigneeId: { type: ["string", "null"] },
|
|
80
|
+
about: {
|
|
81
|
+
type: "string",
|
|
82
|
+
enum: ["nobody", "patient", "company", "operator"]
|
|
83
|
+
},
|
|
84
|
+
patientId: { type: "string" },
|
|
85
|
+
companyId: { type: "string" },
|
|
86
|
+
operatorId: { type: "string" }
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
idempotent: !0,
|
|
90
|
+
errors: [
|
|
91
|
+
"An id the host lists, its patient search or the stored task do not resolve.",
|
|
92
|
+
"More than one of patientId, companyId and operatorId.",
|
|
93
|
+
"The form is not ready, is read-only or is withheld."
|
|
94
|
+
],
|
|
95
|
+
descriptionKey: "ui.agent.taskEditor.actions.setFields",
|
|
96
|
+
description: "Set draft fields. Ids must come from the host lists, a patient the host search returned, or equal the stored one. At most one counterpart per call, and it selects its branch; assigneeId null is nobody. Nothing is saved.",
|
|
97
|
+
invoke: (r, u) => {
|
|
98
|
+
r.setFields(u);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
save: {
|
|
102
|
+
safety: "phi",
|
|
103
|
+
// Reaches the host's data source; the result is the host's promise.
|
|
104
|
+
openWorld: !0,
|
|
105
|
+
descriptionKey: "ui.agent.taskEditor.actions.save",
|
|
106
|
+
description: "Save the task through the host. Resolves once the write lands and rejects with the host error, which the form also shows.",
|
|
107
|
+
invoke: (r) => r.save()
|
|
108
|
+
},
|
|
109
|
+
set_done: {
|
|
110
|
+
safety: "write",
|
|
111
|
+
argsType: "{ done: boolean }",
|
|
112
|
+
argsSchema: {
|
|
113
|
+
type: "object",
|
|
114
|
+
properties: { done: { type: "boolean" } },
|
|
115
|
+
required: ["done"]
|
|
116
|
+
},
|
|
117
|
+
openWorld: !0,
|
|
118
|
+
errors: [
|
|
119
|
+
"The form is not ready, is read-only or has no Done seam.",
|
|
120
|
+
"A save, a delete or another Done change is in flight.",
|
|
121
|
+
"The task was already saved or deleted in this session."
|
|
122
|
+
],
|
|
123
|
+
descriptionKey: "ui.agent.taskEditor.actions.setDone",
|
|
124
|
+
description: "Mark an existing task done or not done through the host. A rejection rolls the switch back, except a SaveOutcomeUnknownError (the save hit its time limit), which keeps the chosen value and shows the neutral kit message.",
|
|
125
|
+
invoke: (r, u) => r.setDone(u.done)
|
|
126
|
+
},
|
|
127
|
+
delete: {
|
|
128
|
+
safety: "destructive",
|
|
129
|
+
idempotent: !0,
|
|
130
|
+
openWorld: !0,
|
|
131
|
+
descriptionKey: "ui.agent.taskEditor.actions.delete",
|
|
132
|
+
description: "Delete the task through the host, without the confirmation dialog. Resolves once the delete lands.",
|
|
133
|
+
invoke: (r) => r.deleteTask()
|
|
134
|
+
},
|
|
135
|
+
cancel: {
|
|
136
|
+
safety: "destructive",
|
|
137
|
+
errors: ["A save or delete is in flight: wait for it to settle."],
|
|
138
|
+
descriptionKey: "ui.agent.taskEditor.actions.cancel",
|
|
139
|
+
description: "Close the editor without saving. Anything typed since the last save is lost. Refused while a save or delete is in flight.",
|
|
140
|
+
invoke: (r) => {
|
|
141
|
+
r.cancel();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
domHooks: {
|
|
146
|
+
root: {
|
|
147
|
+
attr: "data-component",
|
|
148
|
+
value: "task-editor",
|
|
149
|
+
description: "Marks the TaskEditor body. It also carries data-variant and data-status. In the subview variant it sits inside the panel-subview section, which repeats data-component-id, data-variant and data-status and holds the heading and footer."
|
|
150
|
+
},
|
|
151
|
+
instanceId: {
|
|
152
|
+
attr: "data-component-id",
|
|
153
|
+
sourceProp: "id",
|
|
154
|
+
description: "Sourced from the id prop, or generated. Addresses one editor from the agent. [data-component-id] reaches the footer actions in both variants."
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}, N = "none", mt = {
|
|
158
|
+
showError: !1,
|
|
159
|
+
saving: !1,
|
|
160
|
+
saveError: void 0,
|
|
161
|
+
saveErrorUnknown: !1,
|
|
162
|
+
done: !1,
|
|
163
|
+
confirmedDone: !1,
|
|
164
|
+
donePending: !1,
|
|
165
|
+
doneError: void 0,
|
|
166
|
+
doneErrorUnknown: !1,
|
|
167
|
+
deleting: !1,
|
|
168
|
+
deleteError: void 0,
|
|
169
|
+
deleteErrorUnknown: !1,
|
|
170
|
+
confirmDeleteOpen: !1,
|
|
171
|
+
accepted: !1
|
|
172
|
+
};
|
|
173
|
+
function un(r) {
|
|
174
|
+
return r.patientId ? "patient" : r.companyId ? "company" : r.operatorId ? "operator" : "nobody";
|
|
175
|
+
}
|
|
176
|
+
function Ze(r) {
|
|
177
|
+
return { hours: r.getHours(), minutes: r.getMinutes() };
|
|
178
|
+
}
|
|
179
|
+
function ft(r) {
|
|
180
|
+
const u = r ?? /* @__PURE__ */ new Date();
|
|
181
|
+
return {
|
|
182
|
+
date: u,
|
|
183
|
+
time: Ze(u),
|
|
184
|
+
note: "",
|
|
185
|
+
operatorId: N,
|
|
186
|
+
typeId: "",
|
|
187
|
+
assigneeId: N,
|
|
188
|
+
about: "nobody",
|
|
189
|
+
patientId: "",
|
|
190
|
+
companyId: ""
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function pn(r) {
|
|
194
|
+
const u = new Date(r.dateIso);
|
|
195
|
+
return {
|
|
196
|
+
date: u,
|
|
197
|
+
time: Ze(u),
|
|
198
|
+
note: r.note,
|
|
199
|
+
/* `||`, not `??`: a host's '' is unset, like patient and company. */
|
|
200
|
+
operatorId: r.operatorId || N,
|
|
201
|
+
/* A stored type wins. With none, '' falls through to the first entry. */
|
|
202
|
+
typeId: r.typeId ?? "",
|
|
203
|
+
/* `||` too: '' would become a Select option with an empty value. */
|
|
204
|
+
assigneeId: r.assigneeId || N,
|
|
205
|
+
about: un(r),
|
|
206
|
+
patientId: r.patientId ?? "",
|
|
207
|
+
companyId: r.companyId ?? ""
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const mn = [
|
|
211
|
+
["patientId", "patient"],
|
|
212
|
+
["companyId", "company"],
|
|
213
|
+
["operatorId", "operator"]
|
|
214
|
+
];
|
|
215
|
+
function fn({
|
|
216
|
+
mode: r,
|
|
217
|
+
taskId: u,
|
|
218
|
+
initialDate: S,
|
|
219
|
+
active: F,
|
|
220
|
+
taskTypes: $,
|
|
221
|
+
assignees: x,
|
|
222
|
+
companies: xe,
|
|
223
|
+
operators: L,
|
|
224
|
+
patients: ne,
|
|
225
|
+
searchedPatients: J,
|
|
226
|
+
resolvePatientLabel: z,
|
|
227
|
+
loadTask: G,
|
|
228
|
+
onCreateTask: H,
|
|
229
|
+
onUpdateTask: oe,
|
|
230
|
+
onDeleteTask: Y,
|
|
231
|
+
onSetTaskDone: re,
|
|
232
|
+
onSaved: M,
|
|
233
|
+
onDeleted: pe,
|
|
234
|
+
readOnly: q,
|
|
235
|
+
withheld: Ee,
|
|
236
|
+
maskPatient: je,
|
|
237
|
+
fallbackError: me,
|
|
238
|
+
unknownOutcomeMessage: ke
|
|
239
|
+
}) {
|
|
240
|
+
var ye;
|
|
241
|
+
const T = r === "edit", [$e, Me] = K(0), [Q, Se] = K(F);
|
|
242
|
+
Q !== F && (Se(F), F && Me((e) => e + 1));
|
|
243
|
+
const O = `${r}|${u ?? ""}|${$e}`, [p, ae] = K(
|
|
244
|
+
() => ft(S)
|
|
245
|
+
), [U, fe] = K(mt), [o, De] = K(), g = (e) => fe((s) => ({ ...s, ...e })), ie = (e) => ae((s) => ({ ...s, ...e })), [se, V] = K(O);
|
|
246
|
+
se !== O && (V(O), ae(ft(S)), fe(mt), De(void 0));
|
|
247
|
+
const k = E({
|
|
248
|
+
subject: O,
|
|
249
|
+
saving: !1,
|
|
250
|
+
deleting: !1,
|
|
251
|
+
donePending: !1,
|
|
252
|
+
accepted: !1
|
|
253
|
+
});
|
|
254
|
+
k.current.subject !== O && (k.current = {
|
|
255
|
+
subject: O,
|
|
256
|
+
saving: !1,
|
|
257
|
+
deleting: !1,
|
|
258
|
+
donePending: !1,
|
|
259
|
+
accepted: !1
|
|
260
|
+
});
|
|
261
|
+
const de = E(!0);
|
|
262
|
+
Je(() => (de.current = !0, () => {
|
|
263
|
+
de.current = !1;
|
|
264
|
+
}), []);
|
|
265
|
+
const I = (e) => de.current && k.current === e, Z = E(G);
|
|
266
|
+
Z.current = G;
|
|
267
|
+
const d = !!G, [w, l] = K(0), [a, m] = K(null), he = E(a);
|
|
268
|
+
he.current = a;
|
|
269
|
+
const le = F && T && !!u && d && !Ee;
|
|
270
|
+
Je(() => {
|
|
271
|
+
const e = Z.current;
|
|
272
|
+
if (!le || !u || !e) return;
|
|
273
|
+
const s = k.current, h = he.current;
|
|
274
|
+
if ((h == null ? void 0 : h.subject) === s.subject && h.status === "ready")
|
|
275
|
+
return;
|
|
276
|
+
const c = new AbortController();
|
|
277
|
+
return Promise.resolve().then(
|
|
278
|
+
() => (
|
|
279
|
+
/* Cleaned up before this ran (StrictMode's replay, a quick re-run):
|
|
280
|
+
never call the host with a signal already aborted. */
|
|
281
|
+
c.signal.aborted ? Promise.reject(c.signal.reason) : e(u, { signal: c.signal })
|
|
282
|
+
)
|
|
283
|
+
).then(
|
|
284
|
+
(f) => {
|
|
285
|
+
c.signal.aborted || !I(s) || (ae(pn(f)), g({ done: f.done, confirmedDone: f.done }), De(f), m({ subject: s.subject, status: "ready" }));
|
|
286
|
+
},
|
|
287
|
+
(f) => {
|
|
288
|
+
c.signal.aborted || !I(s) || m({
|
|
289
|
+
subject: s.subject,
|
|
290
|
+
status: "error",
|
|
291
|
+
message: Ye(f, me)
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
), () => c.abort();
|
|
295
|
+
}, [le, O, w]);
|
|
296
|
+
const D = T ? !u || !d ? "locked" : Ee ? "withheld" : (a == null ? void 0 : a.subject) === O ? a.status : "loading" : "ready", P = () => {
|
|
297
|
+
D === "error" && (m(null), l((e) => e + 1));
|
|
298
|
+
}, ee = p.typeId || (((ye = $[0]) == null ? void 0 : ye.id) ?? ""), qe = p.about === "nobody" || p.about === "patient" && p.patientId !== "" || p.about === "company" && p.companyId !== "" || p.about === "operator" && p.operatorId !== N, te = !q && p.note.trim() !== "" && p.date !== void 0 && qe && /* Required whenever the host offers a list. */
|
|
299
|
+
($.length === 0 || ee !== "") && !U.saving && !U.donePending, ce = T ? oe : H, ve = () => {
|
|
300
|
+
const { date: e, time: s } = p;
|
|
301
|
+
return e ? {
|
|
302
|
+
dateIso: new Date(
|
|
303
|
+
e.getFullYear(),
|
|
304
|
+
e.getMonth(),
|
|
305
|
+
e.getDate(),
|
|
306
|
+
s.hours,
|
|
307
|
+
s.minutes,
|
|
308
|
+
0,
|
|
309
|
+
0
|
|
310
|
+
).toISOString(),
|
|
311
|
+
note: p.note.trim(),
|
|
312
|
+
/* Sent whatever the host's list says, including a value the list no
|
|
313
|
+
longer resolves: a real link must survive a Save that never
|
|
314
|
+
offered to change it. */
|
|
315
|
+
typeId: ee === "" ? void 0 : ee,
|
|
316
|
+
assigneeId: p.assigneeId === N ? void 0 : p.assigneeId,
|
|
317
|
+
/* ONE counterpart, decided by `about` alone: the platform refuses a
|
|
318
|
+
task carrying two. Never gated on a list being loaded, or a list
|
|
319
|
+
that empties mid-edit would unlink the task on Save. */
|
|
320
|
+
patientId: p.about === "patient" && p.patientId ? p.patientId : void 0,
|
|
321
|
+
companyId: p.about === "company" && p.companyId ? p.companyId : void 0,
|
|
322
|
+
operatorId: p.about === "operator" && p.operatorId !== N ? p.operatorId : void 0,
|
|
323
|
+
/* The last CONFIRMED value only, never an optimistic or rolled-back
|
|
324
|
+
toggle. */
|
|
325
|
+
done: U.confirmedDone
|
|
326
|
+
} : void 0;
|
|
327
|
+
}, ge = (e) => Pe(e) ? ke : Ye(e, me), y = (e) => Zt(new Error(`TaskEditor: ${e}`)), Ce = () => {
|
|
328
|
+
const e = k.current;
|
|
329
|
+
if (D !== "ready") return y(`cannot save while ${D}.`);
|
|
330
|
+
if (!ce) return y("the host gave no save seam.");
|
|
331
|
+
if (e.accepted) return y("this task was already saved.");
|
|
332
|
+
if (e.deleting) return y("a delete is in flight.");
|
|
333
|
+
if (e.saving || !te) return y("the task cannot be saved.");
|
|
334
|
+
const s = ve();
|
|
335
|
+
if (!s)
|
|
336
|
+
return g({ showError: !0 }), y("the task has no date.");
|
|
337
|
+
const h = u;
|
|
338
|
+
e.saving = !0, g({
|
|
339
|
+
saving: !0,
|
|
340
|
+
saveError: void 0,
|
|
341
|
+
saveErrorUnknown: !1
|
|
342
|
+
});
|
|
343
|
+
const c = (async () => {
|
|
344
|
+
try {
|
|
345
|
+
if (T)
|
|
346
|
+
await (oe == null ? void 0 : oe(h, s)), e.accepted = !0, I(e) && (g({ accepted: !0 }), M == null || M({
|
|
347
|
+
...s,
|
|
348
|
+
id: h,
|
|
349
|
+
done: s.done ?? !1
|
|
350
|
+
}));
|
|
351
|
+
else {
|
|
352
|
+
const f = await (H == null ? void 0 : H(s));
|
|
353
|
+
e.accepted = !0, I(e) && (g({ accepted: !0 }), f && (M == null || M(f)));
|
|
354
|
+
}
|
|
355
|
+
} catch (f) {
|
|
356
|
+
throw I(e) && g({
|
|
357
|
+
saveError: ge(f),
|
|
358
|
+
saveErrorUnknown: Pe(f)
|
|
359
|
+
}), f;
|
|
360
|
+
} finally {
|
|
361
|
+
e.saving = !1, I(e) && g({ saving: !1 });
|
|
362
|
+
}
|
|
363
|
+
})();
|
|
364
|
+
return c.catch(() => {
|
|
365
|
+
}), c;
|
|
366
|
+
}, Ne = (e) => {
|
|
367
|
+
const s = k.current;
|
|
368
|
+
if (D !== "ready")
|
|
369
|
+
return y(`cannot change Done while ${D}.`);
|
|
370
|
+
if (!T || !u || !re || q)
|
|
371
|
+
return y("the host gave no Done seam.");
|
|
372
|
+
if (s.donePending) return y("a Done change is already pending.");
|
|
373
|
+
if (s.saving || s.deleting)
|
|
374
|
+
return y("a save or delete is in flight.");
|
|
375
|
+
if (s.accepted)
|
|
376
|
+
return y("this task was already saved or deleted.");
|
|
377
|
+
if (e === U.done) return Promise.resolve();
|
|
378
|
+
const h = U.confirmedDone, c = u;
|
|
379
|
+
s.donePending = !0, g({
|
|
380
|
+
done: e,
|
|
381
|
+
donePending: !0,
|
|
382
|
+
doneError: void 0,
|
|
383
|
+
doneErrorUnknown: !1
|
|
384
|
+
});
|
|
385
|
+
const f = (async () => {
|
|
386
|
+
try {
|
|
387
|
+
await re(c, e), I(s) && g({ confirmedDone: e });
|
|
388
|
+
} catch (R) {
|
|
389
|
+
throw I(s) && Pe(R) ? g({
|
|
390
|
+
confirmedDone: e,
|
|
391
|
+
doneError: ke,
|
|
392
|
+
doneErrorUnknown: !0
|
|
393
|
+
}) : I(s) && g({
|
|
394
|
+
done: h,
|
|
395
|
+
doneError: Ye(R, me),
|
|
396
|
+
doneErrorUnknown: !1
|
|
397
|
+
}), R;
|
|
398
|
+
} finally {
|
|
399
|
+
s.donePending = !1, I(s) && g({ donePending: !1 });
|
|
400
|
+
}
|
|
401
|
+
})();
|
|
402
|
+
return f.catch(() => {
|
|
403
|
+
}), f;
|
|
404
|
+
}, Te = () => {
|
|
405
|
+
const e = k.current;
|
|
406
|
+
if (D !== "ready") return y(`cannot delete while ${D}.`);
|
|
407
|
+
if (!T || !u || !Y || q)
|
|
408
|
+
return y("the host gave no delete seam.");
|
|
409
|
+
if (e.saving || e.accepted || e.deleting)
|
|
410
|
+
return y("the task cannot be deleted now.");
|
|
411
|
+
const s = u;
|
|
412
|
+
e.deleting = !0, g({
|
|
413
|
+
deleting: !0,
|
|
414
|
+
deleteError: void 0,
|
|
415
|
+
deleteErrorUnknown: !1
|
|
416
|
+
});
|
|
417
|
+
const h = (async () => {
|
|
418
|
+
try {
|
|
419
|
+
await Y(s), e.accepted = !0, I(e) && (g({ accepted: !0, confirmDeleteOpen: !1 }), pe == null || pe(s));
|
|
420
|
+
} catch (c) {
|
|
421
|
+
throw I(e) && g({
|
|
422
|
+
deleteError: ge(c),
|
|
423
|
+
deleteErrorUnknown: Pe(c)
|
|
424
|
+
}), c;
|
|
425
|
+
} finally {
|
|
426
|
+
e.deleting = !1, I(e) && g({ deleting: !1 });
|
|
427
|
+
}
|
|
428
|
+
})();
|
|
429
|
+
return h.catch(() => {
|
|
430
|
+
}), h;
|
|
431
|
+
}, j = (e, s, h) => (
|
|
432
|
+
/* '' is never an id, even when the stored record holds one. */
|
|
433
|
+
s !== "" && (s === h || e.some((c) => c.id === s))
|
|
434
|
+
), Re = (e) => {
|
|
435
|
+
var f;
|
|
436
|
+
if (D !== "ready")
|
|
437
|
+
throw new Error(`TaskEditor: cannot set fields while ${D}.`);
|
|
438
|
+
if (q) throw new Error("TaskEditor: the task is read-only.");
|
|
439
|
+
const s = mn.filter(([R]) => e[R] !== void 0);
|
|
440
|
+
if (s.length > 1)
|
|
441
|
+
throw new Error(
|
|
442
|
+
"TaskEditor: set at most one of patientId, companyId and operatorId."
|
|
443
|
+
);
|
|
444
|
+
const h = (f = s[0]) == null ? void 0 : f[1];
|
|
445
|
+
if (e.about !== void 0 && h && e.about !== h)
|
|
446
|
+
throw new Error(
|
|
447
|
+
`TaskEditor: about "${e.about}" does not match the ${h} id.`
|
|
448
|
+
);
|
|
449
|
+
if (e.typeId !== void 0 && !j($, e.typeId, o == null ? void 0 : o.typeId))
|
|
450
|
+
throw new Error(`TaskEditor: unknown typeId "${e.typeId}".`);
|
|
451
|
+
if (e.assigneeId !== void 0 && e.assigneeId !== null && !j(x, e.assigneeId, o == null ? void 0 : o.assigneeId))
|
|
452
|
+
throw new Error(`TaskEditor: unknown assigneeId "${e.assigneeId}".`);
|
|
453
|
+
if (e.companyId !== void 0 && !j(xe, e.companyId, o == null ? void 0 : o.companyId))
|
|
454
|
+
throw new Error(`TaskEditor: unknown companyId "${e.companyId}".`);
|
|
455
|
+
if (e.operatorId !== void 0 && !j(L, e.operatorId, o == null ? void 0 : o.operatorId))
|
|
456
|
+
throw new Error(`TaskEditor: unknown operatorId "${e.operatorId}".`);
|
|
457
|
+
if (e.patientId !== void 0) {
|
|
458
|
+
if (je)
|
|
459
|
+
throw new Error("TaskEditor: no patient can be set in privacy mode.");
|
|
460
|
+
if (!(j(ne, e.patientId, o == null ? void 0 : o.patientId) || J.has(e.patientId) || (z == null ? void 0 : z(e.patientId)) !== void 0))
|
|
461
|
+
throw new Error(`TaskEditor: unknown patientId "${e.patientId}".`);
|
|
462
|
+
}
|
|
463
|
+
const c = {};
|
|
464
|
+
if (e.dateIso !== void 0) {
|
|
465
|
+
const R = new Date(e.dateIso);
|
|
466
|
+
if (Number.isNaN(R.getTime()))
|
|
467
|
+
throw new Error(`TaskEditor: "${e.dateIso}" is not a date.`);
|
|
468
|
+
c.date = R, c.time = Ze(R);
|
|
469
|
+
}
|
|
470
|
+
e.note !== void 0 && (c.note = e.note), e.typeId !== void 0 && (c.typeId = e.typeId), e.assigneeId !== void 0 && (c.assigneeId = e.assigneeId ?? N), e.about !== void 0 && (c.about = e.about), e.patientId !== void 0 && (c.patientId = e.patientId, c.about = "patient"), e.companyId !== void 0 && (c.companyId = e.companyId, c.about = "company"), e.operatorId !== void 0 && (c.operatorId = e.operatorId, c.about = "operator"), ie(c);
|
|
471
|
+
}, Ae = () => {
|
|
472
|
+
const e = ve();
|
|
473
|
+
return {
|
|
474
|
+
mode: r,
|
|
475
|
+
dateIso: (e == null ? void 0 : e.dateIso) ?? null,
|
|
476
|
+
about: p.about,
|
|
477
|
+
patientId: (e == null ? void 0 : e.patientId) ?? null,
|
|
478
|
+
companyId: (e == null ? void 0 : e.companyId) ?? null,
|
|
479
|
+
operatorId: (e == null ? void 0 : e.operatorId) ?? null,
|
|
480
|
+
typeId: (e == null ? void 0 : e.typeId) ?? null,
|
|
481
|
+
assigneeId: (e == null ? void 0 : e.assigneeId) ?? null,
|
|
482
|
+
done: U.confirmedDone,
|
|
483
|
+
hasNote: p.note.trim() !== "",
|
|
484
|
+
noteLength: p.note.trim().length
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
return {
|
|
488
|
+
status: D,
|
|
489
|
+
loadError: (a == null ? void 0 : a.subject) === O ? a.message : void 0,
|
|
490
|
+
retry: P,
|
|
491
|
+
fields: p,
|
|
492
|
+
patchFields: ie,
|
|
493
|
+
stored: o,
|
|
494
|
+
chosenTypeId: ee,
|
|
495
|
+
canSave: te,
|
|
496
|
+
/** What the agent's `canSave` reports: the button's rule plus the
|
|
497
|
+
* status, the seam and a save that has not landed yet. */
|
|
498
|
+
agentCanSave: D === "ready" && !!ce && te && !U.accepted,
|
|
499
|
+
showSave: !q && !!ce,
|
|
500
|
+
showDelete: T && !q && !!Y && !!u,
|
|
501
|
+
showDone: T && !q && !!re,
|
|
502
|
+
ui: U,
|
|
503
|
+
patchUi: g,
|
|
504
|
+
/** True once a save or delete landed in this session. */
|
|
505
|
+
isAccepted: () => k.current.accepted,
|
|
506
|
+
/** A save or delete is in flight: closing now would lose its outcome. */
|
|
507
|
+
isBusy: () => k.current.saving || k.current.deleting,
|
|
508
|
+
submit: Ce,
|
|
509
|
+
setDone: Ne,
|
|
510
|
+
remove: Te,
|
|
511
|
+
applyPatch: Re,
|
|
512
|
+
draftState: Ae
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
const ht = Qe("ds:flex ds:min-h-0 ds:flex-col", {
|
|
516
|
+
variants: {
|
|
517
|
+
/** The panel fills its box; the subview body sits in its scroll area. */
|
|
518
|
+
variant: {
|
|
519
|
+
/* Focusable from script only, as the subview section is: where focus
|
|
520
|
+
waits when a control takes itself away. */
|
|
521
|
+
panel: "ds:h-full ds:focus-visible:outline-none",
|
|
522
|
+
/* The states pad themselves, so the subview's ring inset is cancelled. */
|
|
523
|
+
subview: "ds:-m-[var(--panel-subview-inset)]"
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
defaultVariants: { variant: "panel" }
|
|
527
|
+
}), vt = Qe("ds:min-w-0 ds:p-[var(--spacing-md)]", {
|
|
528
|
+
variants: {
|
|
529
|
+
/** 'form': sized by the fields. 'notice': fills the body. */
|
|
530
|
+
layout: {
|
|
531
|
+
form: "",
|
|
532
|
+
notice: "ds:flex-1"
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
defaultVariants: { layout: "form" }
|
|
536
|
+
}), gt = Qe(
|
|
537
|
+
`ds:m-0 ds:min-w-0 ds:border-0 ds:p-0 ${Yt}`,
|
|
538
|
+
{
|
|
539
|
+
variants: {
|
|
540
|
+
/** 'form': the fields in a column. 'notice': the locked notice. */
|
|
541
|
+
layout: {
|
|
542
|
+
form: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
543
|
+
notice: ""
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
defaultVariants: { layout: "form" }
|
|
547
|
+
}
|
|
548
|
+
), i = (r) => `calendarWorkspace.taskEditor.${r}`, hn = (r, u, S) => S.includes(u) ? 1 : 0, we = [], Xe = (r, u) => Array.from(r.querySelectorAll("[data-task-id]")).filter(
|
|
549
|
+
(S) => !u.contains(S)
|
|
550
|
+
), vn = 'button:not([disabled]), a[href], input:not([disabled]), [tabindex]:not([tabindex="-1"])', yt = (r, u) => {
|
|
551
|
+
if (!r) return [];
|
|
552
|
+
const S = Array.from(
|
|
553
|
+
r.querySelectorAll("[data-action]")
|
|
554
|
+
);
|
|
555
|
+
return [
|
|
556
|
+
...S.filter((F) => u && F.dataset.action === u),
|
|
557
|
+
...S.filter((F) => F.dataset.action === "open-task"),
|
|
558
|
+
...Array.from(r.querySelectorAll(vn))
|
|
559
|
+
];
|
|
560
|
+
}, gn = Ft(
|
|
561
|
+
({
|
|
562
|
+
id: r,
|
|
563
|
+
mode: u,
|
|
564
|
+
taskId: S,
|
|
565
|
+
initialDate: F,
|
|
566
|
+
variant: $ = "panel",
|
|
567
|
+
open: x = !0,
|
|
568
|
+
onExited: xe,
|
|
569
|
+
taskTypes: L = we,
|
|
570
|
+
assignees: ne = we,
|
|
571
|
+
companies: J = we,
|
|
572
|
+
operators: z = we,
|
|
573
|
+
patients: G = we,
|
|
574
|
+
searchPatients: H,
|
|
575
|
+
patientLabel: oe,
|
|
576
|
+
resolvePatientLabel: Y,
|
|
577
|
+
companyLabel: re,
|
|
578
|
+
operatorLabel: M,
|
|
579
|
+
backLabel: pe,
|
|
580
|
+
loadTask: q,
|
|
581
|
+
onCreateTask: Ee,
|
|
582
|
+
onUpdateTask: je,
|
|
583
|
+
onDeleteTask: me,
|
|
584
|
+
onSetTaskDone: ke,
|
|
585
|
+
onCancel: T,
|
|
586
|
+
onSaved: $e,
|
|
587
|
+
onDeleted: Me,
|
|
588
|
+
readOnly: Q = !1,
|
|
589
|
+
privacy: Se = !1,
|
|
590
|
+
privacyMode: O = "notice",
|
|
591
|
+
onPrivacyOff: p,
|
|
592
|
+
className: ae,
|
|
593
|
+
...U
|
|
594
|
+
}, fe) => {
|
|
595
|
+
const { t: o } = Ut("ui"), De = Qt(), g = Ot(), ie = r ?? g, se = u === "edit", V = $ === "subview", k = !V || x, de = Se && se && O === "notice", I = Se && !de, [Z] = K(() => /* @__PURE__ */ new Map()), d = fn({
|
|
596
|
+
mode: u,
|
|
597
|
+
taskId: S,
|
|
598
|
+
initialDate: F,
|
|
599
|
+
active: k,
|
|
600
|
+
taskTypes: L,
|
|
601
|
+
assignees: ne,
|
|
602
|
+
companies: J,
|
|
603
|
+
operators: z,
|
|
604
|
+
patients: G,
|
|
605
|
+
searchedPatients: Z,
|
|
606
|
+
resolvePatientLabel: Y,
|
|
607
|
+
loadTask: q,
|
|
608
|
+
onCreateTask: Ee,
|
|
609
|
+
onUpdateTask: je,
|
|
610
|
+
onDeleteTask: me,
|
|
611
|
+
onSetTaskDone: ke,
|
|
612
|
+
onSaved: $e,
|
|
613
|
+
onDeleted: Me,
|
|
614
|
+
readOnly: Q,
|
|
615
|
+
withheld: de,
|
|
616
|
+
maskPatient: I,
|
|
617
|
+
fallbackError: o("emptyState.error.title"),
|
|
618
|
+
unknownOutcomeMessage: De
|
|
619
|
+
}), { status: w, fields: l, ui: a, stored: m } = d, he = E(H);
|
|
620
|
+
he.current = H;
|
|
621
|
+
const le = !!H, D = Fe(
|
|
622
|
+
() => le ? async (t, v) => {
|
|
623
|
+
const A = await he.current(t, v);
|
|
624
|
+
for (const W of A)
|
|
625
|
+
Z.set(W.id, W.name);
|
|
626
|
+
return A;
|
|
627
|
+
} : void 0,
|
|
628
|
+
[le, Z]
|
|
629
|
+
), P = E(d);
|
|
630
|
+
P.current = d;
|
|
631
|
+
const ee = E(T);
|
|
632
|
+
ee.current = T;
|
|
633
|
+
const qe = Fe(
|
|
634
|
+
() => ({
|
|
635
|
+
getStatus: () => P.current.status,
|
|
636
|
+
getDraft: () => P.current.draftState(),
|
|
637
|
+
canSave: () => P.current.agentCanSave,
|
|
638
|
+
setFields: (t) => P.current.applyPatch(t),
|
|
639
|
+
save: () => P.current.submit(),
|
|
640
|
+
setDone: (t) => P.current.setDone(t),
|
|
641
|
+
deleteTask: () => P.current.remove(),
|
|
642
|
+
cancel: () => {
|
|
643
|
+
if (P.current.isBusy())
|
|
644
|
+
throw new Error("TaskEditor: a save or delete is in flight.");
|
|
645
|
+
ee.current();
|
|
646
|
+
}
|
|
647
|
+
}),
|
|
648
|
+
[]
|
|
649
|
+
);
|
|
650
|
+
Lt(cn, k ? qe : null, ie);
|
|
651
|
+
const te = E(null), ce = Fe(
|
|
652
|
+
() => Gt(fe, te),
|
|
653
|
+
[fe]
|
|
654
|
+
), ve = E(null), ge = E(null), y = E(!1);
|
|
655
|
+
V && x && !y.current && (ge.current = typeof document < "u" && document.activeElement instanceof HTMLElement ? document.activeElement : null), y.current = V && x;
|
|
656
|
+
const Ce = E(x);
|
|
657
|
+
Ce.current = x;
|
|
658
|
+
const Ne = E(S);
|
|
659
|
+
Ne.current = se ? S : void 0, Je(() => {
|
|
660
|
+
var ct;
|
|
661
|
+
const t = te.current, v = t == null ? void 0 : t.parentElement;
|
|
662
|
+
if (!V || !x || !t || !v) return;
|
|
663
|
+
const A = ge.current, W = A && v.contains(A) && !t.contains(A) ? A : null, At = Ne.current, Ie = (W == null ? void 0 : W.closest("[data-task-id]")) ?? Xe(v, t).find((Be) => Be.dataset.taskId === At), st = Ie == null ? void 0 : Ie.dataset.taskId, dt = (ct = W == null ? void 0 : W.closest("[data-action]")) == null ? void 0 : ct.dataset.action, lt = Ie ? Xe(v, t).indexOf(Ie) : -1;
|
|
664
|
+
return () => {
|
|
665
|
+
if (Ce.current && t.isConnected) return;
|
|
666
|
+
const Be = document.activeElement;
|
|
667
|
+
if (!v.isConnected || Be && Be !== document.body) return;
|
|
668
|
+
const Ke = Xe(v, t), Bt = [
|
|
669
|
+
...yt(
|
|
670
|
+
Ke.find((ue) => st !== void 0 && ue.dataset.taskId === st),
|
|
671
|
+
dt
|
|
672
|
+
),
|
|
673
|
+
/* The row that took its place, or the last row when it was last. */
|
|
674
|
+
...lt >= 0 ? yt(Ke[Math.min(lt, Ke.length - 1)], dt) : [],
|
|
675
|
+
v.querySelector('[data-action="add-task"]'),
|
|
676
|
+
v.querySelector("[data-tasks-panel-region]")
|
|
677
|
+
];
|
|
678
|
+
for (const ue of Bt)
|
|
679
|
+
if (!(!ue || t.contains(ue)) && (ue.focus(), document.activeElement === ue))
|
|
680
|
+
return;
|
|
681
|
+
};
|
|
682
|
+
}, [x, V]);
|
|
683
|
+
const Te = E(null), j = E(!1), Re = (t) => () => {
|
|
684
|
+
j.current = !0, t();
|
|
685
|
+
};
|
|
686
|
+
zt(() => {
|
|
687
|
+
var A;
|
|
688
|
+
if (!j.current) return;
|
|
689
|
+
const t = te.current, v = document.activeElement;
|
|
690
|
+
if (v && v !== document.body && v !== t) {
|
|
691
|
+
j.current = !1;
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
w !== "loading" && (j.current = !1), (A = w === "error" ? Te.current : t) == null || A.focus({
|
|
695
|
+
preventScroll: !0
|
|
696
|
+
});
|
|
697
|
+
}, [w]);
|
|
698
|
+
const Ae = o(i(se ? "editTitle" : "title")), ye = J.length > 0, e = z.length > 0, s = le || G.length > 0, h = Fe(
|
|
699
|
+
() => J.map((t) => ({ value: t.id, label: t.label })),
|
|
700
|
+
[J]
|
|
701
|
+
), c = (t) => {
|
|
702
|
+
var v;
|
|
703
|
+
return (Y == null ? void 0 : Y(t)) ?? ((v = G.find((A) => A.id === t)) == null ? void 0 : v.name) ?? Z.get(t) ?? (t === (m == null ? void 0 : m.patientId) ? oe : void 0) ?? o("calendarWorkspace.details.patientNotLoaded");
|
|
704
|
+
}, f = (t) => t === (m == null ? void 0 : m.operatorId) && M ? M : o(i("operatorUnresolved"), { id: t }), R = [
|
|
705
|
+
{ value: N, label: o(i("operatorNone")) },
|
|
706
|
+
...z.map((t) => ({ value: t.id, label: t.label })),
|
|
707
|
+
/* An operator the roster no longer lists is still a real link, so it
|
|
708
|
+
stays pickable and survives a Save. */
|
|
709
|
+
...l.operatorId !== N && !z.some((t) => t.id === l.operatorId) ? [
|
|
710
|
+
{
|
|
711
|
+
value: l.operatorId,
|
|
712
|
+
label: f(l.operatorId)
|
|
713
|
+
}
|
|
714
|
+
] : []
|
|
715
|
+
], It = L.some((t) => t.custom) && L.some((t) => !t.custom), bt = [
|
|
716
|
+
...L.map((t) => ({
|
|
717
|
+
value: t.id,
|
|
718
|
+
label: t.label,
|
|
719
|
+
group: It ? o(i(t.custom ? "typeGroupCustom" : "typeGroupStandard")) : void 0
|
|
720
|
+
})),
|
|
721
|
+
/* An id the list no longer resolves is still a real link: offered as
|
|
722
|
+
its own option so Save re-sends it. */
|
|
723
|
+
...d.chosenTypeId && !L.some((t) => t.id === d.chosenTypeId) ? [
|
|
724
|
+
{
|
|
725
|
+
value: d.chosenTypeId,
|
|
726
|
+
label: o(i("typeUnresolved"), { id: d.chosenTypeId })
|
|
727
|
+
}
|
|
728
|
+
] : []
|
|
729
|
+
], wt = [
|
|
730
|
+
{ value: N, label: o(i("assigneeNone")) },
|
|
731
|
+
...ne.map((t) => ({ value: t.id, label: t.label })),
|
|
732
|
+
...l.assigneeId !== N && !ne.some((t) => t.id === l.assigneeId) ? [
|
|
733
|
+
{
|
|
734
|
+
value: l.assigneeId,
|
|
735
|
+
label: o(i("assigneeUnresolved"), { id: l.assigneeId })
|
|
736
|
+
}
|
|
737
|
+
] : []
|
|
738
|
+
], _ = l.about === "company" && l.companyId && !J.some((t) => t.id === l.companyId) ? l.companyId : void 0, Et = _ && _ === (m == null ? void 0 : m.companyId) && re ? re : o(i("companyUnresolved"), { id: _ }), et = /* @__PURE__ */ b(C, { variant: "info", announce: "off", icon: /* @__PURE__ */ n(en, { "aria-hidden": "true" }), children: [
|
|
739
|
+
/* @__PURE__ */ n(C.Title, { as: "p", children: o("calendarWorkspace.details.readOnlyTitle") }),
|
|
740
|
+
/* @__PURE__ */ n(C.Description, { children: o(i("readOnlyBody")) })
|
|
741
|
+
] }), Ve = a.saving || a.deleting, tt = () => {
|
|
742
|
+
d.isBusy() || T();
|
|
743
|
+
}, kt = /* @__PURE__ */ n(
|
|
744
|
+
ze,
|
|
745
|
+
{
|
|
746
|
+
size: "sm",
|
|
747
|
+
intent: "outline",
|
|
748
|
+
icon: /* @__PURE__ */ n(tn, { "aria-hidden": "true" }),
|
|
749
|
+
"aria-label": o(i("cancel")),
|
|
750
|
+
tooltip: o(i("cancel")),
|
|
751
|
+
"data-action": "cancel-task",
|
|
752
|
+
disabled: Ve,
|
|
753
|
+
onClick: tt
|
|
754
|
+
}
|
|
755
|
+
), _e = a.saving || a.accepted, nt = (t) => /* @__PURE__ */ b(be, { children: [
|
|
756
|
+
t && d.showDelete ? /* @__PURE__ */ n(
|
|
757
|
+
ze,
|
|
758
|
+
{
|
|
759
|
+
ref: ve,
|
|
760
|
+
size: "sm",
|
|
761
|
+
intent: "destructiveOutline",
|
|
762
|
+
icon: /* @__PURE__ */ n(ut, { "aria-hidden": "true" }),
|
|
763
|
+
"aria-label": o(i("delete")),
|
|
764
|
+
tooltip: o(i("delete")),
|
|
765
|
+
"data-action": "delete-task",
|
|
766
|
+
disabled: Ve || a.accepted,
|
|
767
|
+
onClick: () => d.patchUi({ confirmDeleteOpen: !0, deleteError: void 0 })
|
|
768
|
+
}
|
|
769
|
+
) : null,
|
|
770
|
+
/* @__PURE__ */ b(
|
|
771
|
+
jt,
|
|
772
|
+
{
|
|
773
|
+
role: "toolbar",
|
|
774
|
+
"aria-label": o(i("actionsLabel")),
|
|
775
|
+
className: "ds:ms-auto",
|
|
776
|
+
children: [
|
|
777
|
+
kt,
|
|
778
|
+
t && d.showSave ? /* @__PURE__ */ n(
|
|
779
|
+
ze,
|
|
780
|
+
{
|
|
781
|
+
size: "sm",
|
|
782
|
+
intent: "primary",
|
|
783
|
+
icon: a.saving ? /* @__PURE__ */ n(
|
|
784
|
+
dn,
|
|
785
|
+
{
|
|
786
|
+
"aria-hidden": "true",
|
|
787
|
+
className: "ds:animate-spin ds:motion-reduce:animate-none"
|
|
788
|
+
}
|
|
789
|
+
) : /* @__PURE__ */ n(ln, { "aria-hidden": "true" }),
|
|
790
|
+
"aria-label": o(i("save")),
|
|
791
|
+
tooltip: o(i("save")),
|
|
792
|
+
disabled: !_e && !d.canSave,
|
|
793
|
+
"aria-disabled": _e || void 0,
|
|
794
|
+
"aria-busy": a.saving || void 0,
|
|
795
|
+
"data-action": "save-task",
|
|
796
|
+
onClick: () => {
|
|
797
|
+
_e || d.submit();
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
) : null
|
|
801
|
+
]
|
|
802
|
+
}
|
|
803
|
+
),
|
|
804
|
+
t && d.showSave ? (
|
|
805
|
+
/* Out of flow, so it never moves the footer's two ends. */
|
|
806
|
+
/* @__PURE__ */ n("span", { role: "status", className: "ds:sr-only", children: a.saving ? o(i("saving")) : "" })
|
|
807
|
+
) : null
|
|
808
|
+
] }), St = /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
|
|
809
|
+
/* @__PURE__ */ n("span", { role: "status", className: "ds:sr-only", children: o("common.loading") }),
|
|
810
|
+
/* @__PURE__ */ b(
|
|
811
|
+
"div",
|
|
812
|
+
{
|
|
813
|
+
"aria-hidden": "true",
|
|
814
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
815
|
+
children: [
|
|
816
|
+
/* @__PURE__ */ n(
|
|
817
|
+
He,
|
|
818
|
+
{
|
|
819
|
+
variant: "rounded",
|
|
820
|
+
height: "calc(var(--spacing-xl) + var(--spacing-sm))"
|
|
821
|
+
}
|
|
822
|
+
),
|
|
823
|
+
/* @__PURE__ */ n(
|
|
824
|
+
He,
|
|
825
|
+
{
|
|
826
|
+
variant: "rounded",
|
|
827
|
+
height: "calc(var(--spacing-xl) * 3)",
|
|
828
|
+
stagger: 1
|
|
829
|
+
}
|
|
830
|
+
),
|
|
831
|
+
/* @__PURE__ */ n(
|
|
832
|
+
He,
|
|
833
|
+
{
|
|
834
|
+
variant: "rounded",
|
|
835
|
+
height: "calc(var(--spacing-xl) + var(--spacing-sm))",
|
|
836
|
+
stagger: 2
|
|
837
|
+
}
|
|
838
|
+
)
|
|
839
|
+
]
|
|
840
|
+
}
|
|
841
|
+
)
|
|
842
|
+
] }), Dt = /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
|
|
843
|
+
/* @__PURE__ */ n(C, { variant: "error", children: /* @__PURE__ */ n(C.Description, { children: d.loadError }) }),
|
|
844
|
+
/* @__PURE__ */ n(
|
|
845
|
+
Le,
|
|
846
|
+
{
|
|
847
|
+
ref: Te,
|
|
848
|
+
intent: "outline",
|
|
849
|
+
"data-action": "retry-load",
|
|
850
|
+
onClick: Re(d.retry),
|
|
851
|
+
children: o("emptyState.error.cta")
|
|
852
|
+
}
|
|
853
|
+
)
|
|
854
|
+
] }), Ct = /* @__PURE__ */ n("div", { className: vt({ layout: "notice" }), children: /* @__PURE__ */ n("fieldset", { disabled: !0, className: gt({ layout: "notice" }), children: et }) }), Nt = () => l.about !== "patient" ? null : I ? /* @__PURE__ */ n(B, { label: o(i("aboutPatient")), children: /* @__PURE__ */ n(Ue, { value: sn(), disabled: !0, readOnly: !0 }) }) : s ? /* @__PURE__ */ n(B, { label: o(i("aboutPatient")), children: /* @__PURE__ */ n(
|
|
855
|
+
Xt,
|
|
856
|
+
{
|
|
857
|
+
value: l.patientId,
|
|
858
|
+
onValueChange: (t) => d.patchFields({ patientId: t }),
|
|
859
|
+
patients: G,
|
|
860
|
+
searchPatients: D,
|
|
861
|
+
selectedLabel: l.patientId ? c(l.patientId) : void 0,
|
|
862
|
+
placeholder: o("calendarWorkspace.editor.patientSearch"),
|
|
863
|
+
disabled: Q
|
|
864
|
+
}
|
|
865
|
+
) }) : l.patientId ? /* @__PURE__ */ n(B, { label: o(i("aboutPatient")), children: /* @__PURE__ */ n(Ue, { value: c(l.patientId), disabled: !0, readOnly: !0 }) }) : null, Tt = /* @__PURE__ */ b("fieldset", { disabled: Q, className: gt(), children: [
|
|
866
|
+
Q ? et : null,
|
|
867
|
+
/* @__PURE__ */ n(B, { label: o(i("date")), children: /* @__PURE__ */ n(
|
|
868
|
+
xt,
|
|
869
|
+
{
|
|
870
|
+
value: l.date,
|
|
871
|
+
onChange: (t) => d.patchFields({ date: t })
|
|
872
|
+
}
|
|
873
|
+
) }),
|
|
874
|
+
/* @__PURE__ */ n(B, { label: o(i("time")), children: /* @__PURE__ */ n(
|
|
875
|
+
Kt,
|
|
876
|
+
{
|
|
877
|
+
value: l.time,
|
|
878
|
+
onChange: (t) => d.patchFields({ time: t })
|
|
879
|
+
}
|
|
880
|
+
) }),
|
|
881
|
+
/* @__PURE__ */ n(
|
|
882
|
+
B,
|
|
883
|
+
{
|
|
884
|
+
label: o(i("note")),
|
|
885
|
+
required: !0,
|
|
886
|
+
error: a.showError && l.note.trim() === "" ? o(i("noteRequired")) : void 0,
|
|
887
|
+
children: /* @__PURE__ */ n(
|
|
888
|
+
Wt,
|
|
889
|
+
{
|
|
890
|
+
value: l.note,
|
|
891
|
+
onChange: (t) => {
|
|
892
|
+
d.patchFields({ note: t.target.value }), d.patchUi({ showError: !1 });
|
|
893
|
+
},
|
|
894
|
+
minRows: 3,
|
|
895
|
+
autoResize: !0
|
|
896
|
+
}
|
|
897
|
+
)
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
L.length > 0 ? /* @__PURE__ */ n(B, { label: o(i("type")), required: !0, children: /* @__PURE__ */ n(
|
|
901
|
+
Ge,
|
|
902
|
+
{
|
|
903
|
+
options: bt,
|
|
904
|
+
value: d.chosenTypeId,
|
|
905
|
+
onValueChange: (t) => t && d.patchFields({ typeId: t })
|
|
906
|
+
}
|
|
907
|
+
) }) : null,
|
|
908
|
+
ne.length > 0 ? /* @__PURE__ */ n(B, { label: o(i("assignee")), children: /* @__PURE__ */ n(
|
|
909
|
+
Ge,
|
|
910
|
+
{
|
|
911
|
+
options: wt,
|
|
912
|
+
value: l.assigneeId,
|
|
913
|
+
onValueChange: (t) => t && d.patchFields({ assigneeId: t })
|
|
914
|
+
}
|
|
915
|
+
) }) : null,
|
|
916
|
+
/* @__PURE__ */ b(
|
|
917
|
+
qt,
|
|
918
|
+
{
|
|
919
|
+
label: o(i("about")),
|
|
920
|
+
variant: "segmented",
|
|
921
|
+
className: Ht,
|
|
922
|
+
value: l.about,
|
|
923
|
+
onValueChange: (t) => d.patchFields({ about: t }),
|
|
924
|
+
children: [
|
|
925
|
+
/* @__PURE__ */ n(
|
|
926
|
+
Oe,
|
|
927
|
+
{
|
|
928
|
+
value: "nobody",
|
|
929
|
+
label: o(i("aboutNobody")),
|
|
930
|
+
icon: /* @__PURE__ */ n(nn, { "aria-hidden": "true" })
|
|
931
|
+
}
|
|
932
|
+
),
|
|
933
|
+
s || l.about === "patient" || m != null && m.patientId ? /* @__PURE__ */ n(
|
|
934
|
+
Oe,
|
|
935
|
+
{
|
|
936
|
+
value: "patient",
|
|
937
|
+
label: o(i("aboutPatient")),
|
|
938
|
+
icon: /* @__PURE__ */ n(on, { "aria-hidden": "true" })
|
|
939
|
+
}
|
|
940
|
+
) : null,
|
|
941
|
+
ye || l.about === "company" || m != null && m.companyId ? /* @__PURE__ */ n(
|
|
942
|
+
Oe,
|
|
943
|
+
{
|
|
944
|
+
value: "company",
|
|
945
|
+
label: o(i("aboutCompany")),
|
|
946
|
+
icon: /* @__PURE__ */ n(rn, { "aria-hidden": "true" })
|
|
947
|
+
}
|
|
948
|
+
) : null,
|
|
949
|
+
e || l.about === "operator" || m != null && m.operatorId ? /* @__PURE__ */ n(
|
|
950
|
+
Oe,
|
|
951
|
+
{
|
|
952
|
+
value: "operator",
|
|
953
|
+
label: o(i("aboutOperator")),
|
|
954
|
+
icon: /* @__PURE__ */ n(an, { "aria-hidden": "true" })
|
|
955
|
+
}
|
|
956
|
+
) : null
|
|
957
|
+
]
|
|
958
|
+
}
|
|
959
|
+
),
|
|
960
|
+
Nt(),
|
|
961
|
+
l.about === "company" ? /* @__PURE__ */ b(be, { children: [
|
|
962
|
+
_ ? /* @__PURE__ */ n(B, { label: o(i("companyName")), children: /* @__PURE__ */ n(Ue, { value: Et, disabled: !0, readOnly: !0 }) }) : null,
|
|
963
|
+
ye ? /* @__PURE__ */ n(
|
|
964
|
+
B,
|
|
965
|
+
{
|
|
966
|
+
label: o(
|
|
967
|
+
i(_ ? "companyReplace" : "companyName")
|
|
968
|
+
),
|
|
969
|
+
children: /* @__PURE__ */ n(
|
|
970
|
+
Pt,
|
|
971
|
+
{
|
|
972
|
+
options: h,
|
|
973
|
+
value: _ ? "" : l.companyId,
|
|
974
|
+
onValueChange: (t) => _ ? t && d.patchFields({ companyId: t }) : d.patchFields({ companyId: t }),
|
|
975
|
+
clearable: !_ && !Q,
|
|
976
|
+
filter: hn,
|
|
977
|
+
placeholder: o(i("companySearch")),
|
|
978
|
+
"aria-label": o(
|
|
979
|
+
i(_ ? "companyReplace" : "companyName")
|
|
980
|
+
)
|
|
981
|
+
}
|
|
982
|
+
)
|
|
983
|
+
}
|
|
984
|
+
) : null
|
|
985
|
+
] }) : null,
|
|
986
|
+
l.about === "operator" ? e ? /* @__PURE__ */ n(B, { label: o(i("operator")), children: /* @__PURE__ */ n(
|
|
987
|
+
Ge,
|
|
988
|
+
{
|
|
989
|
+
options: R,
|
|
990
|
+
value: l.operatorId,
|
|
991
|
+
onValueChange: (t) => t && d.patchFields({ operatorId: t })
|
|
992
|
+
}
|
|
993
|
+
) }) : l.operatorId !== N ? (
|
|
994
|
+
/* No roster to pick from: name the link read-only. */
|
|
995
|
+
/* @__PURE__ */ n(B, { label: o(i("operator")), children: /* @__PURE__ */ n(
|
|
996
|
+
Ue,
|
|
997
|
+
{
|
|
998
|
+
value: f(l.operatorId),
|
|
999
|
+
disabled: !0,
|
|
1000
|
+
readOnly: !0
|
|
1001
|
+
}
|
|
1002
|
+
) })
|
|
1003
|
+
) : null : null,
|
|
1004
|
+
d.showDone ? /* @__PURE__ */ b(be, { children: [
|
|
1005
|
+
/* @__PURE__ */ n(
|
|
1006
|
+
_t,
|
|
1007
|
+
{
|
|
1008
|
+
label: o(i("done")),
|
|
1009
|
+
checked: a.done,
|
|
1010
|
+
disabled: Ve || a.accepted,
|
|
1011
|
+
"aria-disabled": a.donePending || void 0,
|
|
1012
|
+
"aria-busy": a.donePending || void 0,
|
|
1013
|
+
className: "ds:aria-disabled:cursor-progress",
|
|
1014
|
+
onCheckedChange: (t) => {
|
|
1015
|
+
a.donePending || d.setDone(t);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
),
|
|
1019
|
+
a.doneError ? /* @__PURE__ */ n(
|
|
1020
|
+
C,
|
|
1021
|
+
{
|
|
1022
|
+
variant: a.doneErrorUnknown ? "warning" : "error",
|
|
1023
|
+
announce: a.doneErrorUnknown ? "assertive" : void 0,
|
|
1024
|
+
children: /* @__PURE__ */ n(C.Description, { children: a.doneError })
|
|
1025
|
+
}
|
|
1026
|
+
) : null
|
|
1027
|
+
] }) : null,
|
|
1028
|
+
a.saveError ? /* @__PURE__ */ n(
|
|
1029
|
+
C,
|
|
1030
|
+
{
|
|
1031
|
+
variant: a.saveErrorUnknown ? "warning" : "error",
|
|
1032
|
+
announce: a.saveErrorUnknown ? "assertive" : void 0,
|
|
1033
|
+
children: /* @__PURE__ */ n(C.Description, { children: a.saveError })
|
|
1034
|
+
}
|
|
1035
|
+
) : null,
|
|
1036
|
+
a.deleteError && !a.confirmDeleteOpen ? /* @__PURE__ */ n(
|
|
1037
|
+
C,
|
|
1038
|
+
{
|
|
1039
|
+
variant: a.deleteErrorUnknown ? "warning" : "error",
|
|
1040
|
+
announce: a.deleteErrorUnknown ? "assertive" : void 0,
|
|
1041
|
+
children: /* @__PURE__ */ n(C.Description, { children: a.deleteError })
|
|
1042
|
+
}
|
|
1043
|
+
) : null
|
|
1044
|
+
] }), ot = /* @__PURE__ */ n("div", { className: vt(), children: Tt }), rt = w === "loading" ? St : w === "error" ? Dt : w === "locked" ? Ct : w === "withheld" ? /* @__PURE__ */ n(
|
|
1045
|
+
Jt,
|
|
1046
|
+
{
|
|
1047
|
+
onTurnOff: p ? Re(p) : void 0
|
|
1048
|
+
}
|
|
1049
|
+
) : V ? ot : /* @__PURE__ */ n(Vt, { orientation: "vertical", className: "ds:min-h-0 ds:flex-1", children: ot }), We = w === "ready" ? nt(!0) : w === "locked" || w === "withheld" ? nt(!1) : null, Rt = w === "ready" && d.showDelete, at = se ? /* @__PURE__ */ n(
|
|
1050
|
+
X,
|
|
1051
|
+
{
|
|
1052
|
+
scope: "container",
|
|
1053
|
+
open: a.confirmDeleteOpen && k,
|
|
1054
|
+
onOpenChange: (t) => {
|
|
1055
|
+
a.deleting || d.patchUi(
|
|
1056
|
+
t ? { confirmDeleteOpen: !0 } : { confirmDeleteOpen: !1, deleteError: void 0 }
|
|
1057
|
+
);
|
|
1058
|
+
},
|
|
1059
|
+
children: /* @__PURE__ */ b(
|
|
1060
|
+
X.Content,
|
|
1061
|
+
{
|
|
1062
|
+
size: "sm",
|
|
1063
|
+
variant: "alert",
|
|
1064
|
+
onCloseAutoFocus: (t) => {
|
|
1065
|
+
var v;
|
|
1066
|
+
t.defaultPrevented || (t.preventDefault(), d.isAccepted() || (v = ve.current) == null || v.focus());
|
|
1067
|
+
},
|
|
1068
|
+
children: [
|
|
1069
|
+
/* @__PURE__ */ b(X.Header, { children: [
|
|
1070
|
+
/* @__PURE__ */ n(X.Title, { children: o(i("deleteConfirmTitle")) }),
|
|
1071
|
+
/* @__PURE__ */ n(X.Description, { children: o(i("deleteConfirmBody")) })
|
|
1072
|
+
] }),
|
|
1073
|
+
a.deleteError ? /* @__PURE__ */ n(X.Body, { children: /* @__PURE__ */ n(
|
|
1074
|
+
C,
|
|
1075
|
+
{
|
|
1076
|
+
variant: a.deleteErrorUnknown ? "warning" : "error",
|
|
1077
|
+
announce: a.deleteErrorUnknown ? "assertive" : void 0,
|
|
1078
|
+
children: /* @__PURE__ */ n(C.Description, { children: a.deleteError })
|
|
1079
|
+
}
|
|
1080
|
+
) }) : null,
|
|
1081
|
+
/* @__PURE__ */ b(X.Footer, { divider: !0, children: [
|
|
1082
|
+
/* @__PURE__ */ n(X.Close, { asChild: !0, children: /* @__PURE__ */ n(Le, { intent: "outline", "aria-disabled": a.deleting || void 0, children: o(i("deleteCancel")) }) }),
|
|
1083
|
+
/* @__PURE__ */ n(
|
|
1084
|
+
Le,
|
|
1085
|
+
{
|
|
1086
|
+
intent: "destructive",
|
|
1087
|
+
startIcon: /* @__PURE__ */ n(ut, { "aria-hidden": "true" }),
|
|
1088
|
+
"aria-disabled": a.deleting || void 0,
|
|
1089
|
+
"aria-busy": a.deleting || void 0,
|
|
1090
|
+
onClick: () => {
|
|
1091
|
+
a.deleting || d.remove();
|
|
1092
|
+
},
|
|
1093
|
+
children: o(i("deleteConfirm"))
|
|
1094
|
+
}
|
|
1095
|
+
)
|
|
1096
|
+
] })
|
|
1097
|
+
]
|
|
1098
|
+
}
|
|
1099
|
+
)
|
|
1100
|
+
}
|
|
1101
|
+
) : null, it = {
|
|
1102
|
+
"data-component": "task-editor",
|
|
1103
|
+
"data-component-id": ie,
|
|
1104
|
+
"data-variant": $,
|
|
1105
|
+
"data-status": w
|
|
1106
|
+
};
|
|
1107
|
+
return V ? /* @__PURE__ */ b(be, { children: [
|
|
1108
|
+
/* @__PURE__ */ n(
|
|
1109
|
+
Mt,
|
|
1110
|
+
{
|
|
1111
|
+
...U,
|
|
1112
|
+
"data-component-id": ie,
|
|
1113
|
+
"data-variant": $,
|
|
1114
|
+
"data-status": w,
|
|
1115
|
+
ref: ce,
|
|
1116
|
+
open: x,
|
|
1117
|
+
onBack: tt,
|
|
1118
|
+
onExited: xe,
|
|
1119
|
+
title: Ae,
|
|
1120
|
+
icon: /* @__PURE__ */ n(pt, { "aria-hidden": "true" }),
|
|
1121
|
+
backLabel: pe ?? o(i("back")),
|
|
1122
|
+
footer: We,
|
|
1123
|
+
footerAlign: Rt ? "between" : "end",
|
|
1124
|
+
className: ae,
|
|
1125
|
+
children: /* @__PURE__ */ n("div", { ...it, className: ht({ variant: $ }), children: rt })
|
|
1126
|
+
}
|
|
1127
|
+
),
|
|
1128
|
+
at
|
|
1129
|
+
] }) : /* @__PURE__ */ b(be, { children: [
|
|
1130
|
+
/* @__PURE__ */ b(
|
|
1131
|
+
"div",
|
|
1132
|
+
{
|
|
1133
|
+
tabIndex: -1,
|
|
1134
|
+
...U,
|
|
1135
|
+
...it,
|
|
1136
|
+
ref: ce,
|
|
1137
|
+
className: ht({ variant: $, className: ae }),
|
|
1138
|
+
children: [
|
|
1139
|
+
/* @__PURE__ */ n(
|
|
1140
|
+
$t,
|
|
1141
|
+
{
|
|
1142
|
+
title: Ae,
|
|
1143
|
+
icon: /* @__PURE__ */ n(pt, { "aria-hidden": "true" }),
|
|
1144
|
+
sticky: !0,
|
|
1145
|
+
divider: !0
|
|
1146
|
+
}
|
|
1147
|
+
),
|
|
1148
|
+
rt,
|
|
1149
|
+
We ? /* @__PURE__ */ n("div", { className: "ds:relative ds:z-[var(--z-sticky)] ds:shrink-0 ds:border-t ds:border-[color:var(--border)] ds:bg-[var(--background)]", children: /* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: We }) }) : null
|
|
1150
|
+
]
|
|
1151
|
+
}
|
|
1152
|
+
),
|
|
1153
|
+
at
|
|
1154
|
+
] });
|
|
1155
|
+
}
|
|
1156
|
+
);
|
|
1157
|
+
gn.displayName = "TaskEditor";
|
|
1158
|
+
export {
|
|
1159
|
+
gn as T,
|
|
1160
|
+
cn as t
|
|
1161
|
+
};
|
|
1162
|
+
//# sourceMappingURL=task-editor-C-4I2sBa.js.map
|