@alfadocs/ui-kit 1.31.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{agenda-card-pdN49pMu.js → agenda-card-DVz3jwTf.js} +2 -2
- package/dist/_chunks/{agenda-tray-BweO8pDo.js → agenda-tray-1oDWCJdB.js} +2 -2
- package/dist/_chunks/{ai-prompt-input-CrHr-5H8.js → ai-prompt-input-Dt7tpCBh.js} +2 -2
- package/dist/_chunks/{alia-sidebar-BWcWZivN.js → alia-sidebar-D18kp3p9.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-rows-DMO3MWSt.js → anamnesis-summary-rows-BYgyp_i2.js} +6 -6
- package/dist/_chunks/{appointment-card-CvUFFEdS.js → appointment-card-D-oj_ugh.js} +2 -2
- package/dist/_chunks/{appointment-timeline-DsMZY7U9.js → appointment-timeline-CymGHyIP.js} +2 -2
- package/dist/_chunks/{appointment-tray-Z2GaOIYQ.js → appointment-tray-DCk8gHod.js} +2 -2
- package/dist/_chunks/{audio-recorder-DXG6LTtO.js → audio-recorder-11wClczr.js} +2 -2
- package/dist/_chunks/{avatar-BNQNhoyL.js → avatar-CkDeQOSI.js} +37 -37
- package/dist/_chunks/{balance-badge-cell-CX6b0ML4.js → balance-badge-cell-DhBtFRoW.js} +4 -4
- package/dist/_chunks/{bishop-score-CJUVBfAu.js → bishop-score-CAl7C5hm.js} +2 -2
- package/dist/_chunks/{bmi-calculator-CcH6upht.js → bmi-calculator-Dwkih9a4.js} +3 -3
- package/dist/_chunks/{booking-jGzRUETo.js → booking-BqkEtsKx.js} +777 -747
- package/dist/_chunks/{calculator-dialog-12d3Sxaz.js → calculator-dialog-C0ixc3SU.js} +2 -2
- package/dist/_chunks/{calendar-BNQKpxhE.js → calendar-Dgvl5L4T.js} +2 -2
- package/dist/_chunks/{calendar-workspace-Dy1jHBvG.js → calendar-workspace-BX-zDyVR.js} +14 -14
- package/dist/_chunks/{care-plan-card-CQVboTn1.js → care-plan-card-CZW476Kg.js} +2 -2
- package/dist/_chunks/{care-plan-entry-card-jxHkzez5.js → care-plan-entry-card-BMUYagEw.js} +2 -2
- package/dist/_chunks/{chat-message-DBQu10rs.js → chat-message-C-8UU2av.js} +2 -2
- package/dist/_chunks/{clinical-note-card-yCTR9DB6.js → clinical-note-card-D2WTV2CO.js} +2 -2
- package/dist/_chunks/{data-table-DB5BiVQ0.js → data-table-DC96JJIq.js} +2 -2
- package/dist/_chunks/{dependent-selector-cJlJFAKD.js → dependent-selector-yTKKsuc9.js} +2 -2
- package/dist/_chunks/{dialog-UbKJCi1X.js → dialog-BJiLqhx6.js} +54 -46
- package/dist/_chunks/{document-preview-CDb-n_W7.js → document-preview-BrhMHNh8.js} +2 -2
- package/dist/_chunks/{due-date-calculator-BtgWeFqp.js → due-date-calculator-CxgK8vzt.js} +3 -3
- package/dist/_chunks/{entity-summary-B_vO5Ur4.js → entity-summary-5o768XLU.js} +2 -2
- package/dist/_chunks/{file-manager-Cd8V9IcZ.js → file-manager-CI2Qn8qW.js} +3 -3
- package/dist/_chunks/{gestational-age-calculator-KdMg9z9H.js → gestational-age-calculator-CZHVrERT.js} +4 -4
- package/dist/_chunks/{link-cell-renderer-tWEOv3Sc.js → link-cell-renderer-BEpMNtAa.js} +3 -3
- package/dist/_chunks/{marketplace-app-shell-C4AjQmvz.js → marketplace-app-shell-CK_ND8Tr.js} +2 -2
- package/dist/_chunks/{message-card-D8GB4FdF.js → message-card-BUMv16un.js} +2 -2
- package/dist/_chunks/{message-tray-CGIRQjx5.js → message-tray-0zsv27xX.js} +2 -2
- package/dist/_chunks/{muscle-scheme-BSJsI4-I.js → muscle-scheme-UVz_x4iE.js} +2 -2
- package/dist/_chunks/{notes-panel-am6e-Lwh.js → notes-panel-C4G-mhZ9.js} +3 -3
- package/dist/_chunks/{operator-hero-BnFv-Uef.js → operator-hero-D7-iiFQ9.js} +2 -2
- package/dist/_chunks/{optical-prescription-BvwuqTpl.js → optical-prescription-DUJOhKz_.js} +2 -2
- package/dist/_chunks/{patient-details-CdfursHt.js → patient-details-BGiawUHd.js} +3 -3
- package/dist/_chunks/{patient-summary-card-C9WBwct-.js → patient-summary-card--CT_gbaQ.js} +2 -2
- package/dist/_chunks/{periodontal-diagnosis-HrFsVi-C.js → periodontal-diagnosis-lEwA8wqX.js} +3 -3
- package/dist/_chunks/{practice-profile-hero-YQ7h2K4o.js → practice-profile-hero-DQyDvpJL.js} +2 -2
- package/dist/_chunks/{practice-results-CxIsU2YO.js → practice-results-DjEzPgAK.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-m-c05DOI.js → pregnancy-dating-n5j5dAKy.js} +4 -4
- package/dist/_chunks/{pregnancy-weight-gain-CJwbs9W-.js → pregnancy-weight-gain-D5A8vPjj.js} +3 -3
- package/dist/_chunks/qr-code-DOJs4suh.js +750 -0
- package/dist/_chunks/radio-DNRe6H_8.js +193 -0
- package/dist/_chunks/radio-group-DyVBgnA3.js +297 -0
- package/dist/_chunks/{radiograph-panel.agent-ByM9M3qm.js → radiograph-panel.agent-o4jwEJPC.js} +2 -2
- package/dist/_chunks/{rich-text-editor-VJATL1Tk.js → rich-text-editor-CQ7yZdG3.js} +2 -2
- package/dist/_chunks/select-CLSUnKjF.js +520 -0
- package/dist/_chunks/signature-request-vihDT8On.js +2232 -0
- package/dist/_chunks/{tabs-DqKtTIjZ.js → tabs-BnRaLT0y.js} +2 -2
- package/dist/_chunks/{tasks-panel-DPCNaRko.js → tasks-panel-DQuaVvl5.js} +2 -2
- package/dist/_chunks/{timeline-u-2t9t_M.js → timeline-Bs9Erxlo.js} +2 -2
- package/dist/_chunks/{tooth-scheme-C9jssOmy.js → tooth-scheme-Qe7LO5Di.js} +2 -2
- package/dist/_chunks/{unit-converter-C6jMjqL9.js → unit-converter-BTgU50gk.js} +2 -2
- package/dist/_chunks/{widget-picker-em4xGgv0.js → widget-picker-DvUkBemi.js} +2 -2
- package/dist/agent-catalog.json +316 -20
- package/dist/agent-i18n/en.json +18 -8
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/avatar/avatar.d.ts +2 -0
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calculator-dialog/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/dependent-selector/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts +9 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/muscle-scheme/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/periodontal-diagnosis/index.js +1 -1
- package/dist/components/practice-profile-hero/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/qr-code/index.js +1 -1
- package/dist/components/qr-code/qr-encode.d.ts +14 -16
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio-group/index.js +2 -2
- package/dist/components/radio-group/radio-group-context.d.ts +4 -1
- package/dist/components/radio-group/radio-group.d.ts +13 -1
- package/dist/components/radio-group/radio.d.ts +24 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +33 -0
- package/dist/components/skeleton-scheme/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/widget-picker/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +68 -0
- package/dist/i18n/locales/ar.js +69 -1
- package/dist/i18n/locales/de.d.ts +68 -0
- package/dist/i18n/locales/de.js +71 -1
- package/dist/i18n/locales/el.d.ts +68 -0
- package/dist/i18n/locales/el.js +69 -1
- package/dist/i18n/locales/en.d.ts +68 -0
- package/dist/i18n/locales/en.js +69 -1
- package/dist/i18n/locales/es.d.ts +68 -0
- package/dist/i18n/locales/es.js +69 -1
- package/dist/i18n/locales/fr.d.ts +68 -0
- package/dist/i18n/locales/fr.js +69 -1
- package/dist/i18n/locales/hi.d.ts +68 -0
- package/dist/i18n/locales/hi.js +69 -1
- package/dist/i18n/locales/it.d.ts +68 -0
- package/dist/i18n/locales/it.js +69 -1
- package/dist/i18n/locales/ja.d.ts +68 -0
- package/dist/i18n/locales/ja.js +69 -1
- package/dist/i18n/locales/nl.d.ts +68 -0
- package/dist/i18n/locales/nl.js +69 -1
- package/dist/i18n/locales/pl.d.ts +68 -0
- package/dist/i18n/locales/pl.js +69 -1
- package/dist/i18n/locales/pt.d.ts +68 -0
- package/dist/i18n/locales/pt.js +69 -1
- package/dist/i18n/locales/ro.d.ts +68 -0
- package/dist/i18n/locales/ro.js +69 -1
- package/dist/i18n/locales/ru.d.ts +68 -0
- package/dist/i18n/locales/ru.js +69 -1
- package/dist/i18n/locales/sq.d.ts +68 -0
- package/dist/i18n/locales/sq.js +69 -1
- package/dist/i18n/locales/sv.d.ts +68 -0
- package/dist/i18n/locales/sv.js +69 -1
- package/dist/i18n/locales/tr.d.ts +68 -0
- package/dist/i18n/locales/tr.js +69 -1
- package/dist/i18n/locales/zh.d.ts +68 -0
- package/dist/i18n/locales/zh.js +69 -1
- package/dist/index.js +57 -57
- package/dist/locales/ar.json +69 -1
- package/dist/locales/de.json +69 -1
- package/dist/locales/el.json +69 -1
- package/dist/locales/en.json +69 -1
- package/dist/locales/es.json +69 -1
- package/dist/locales/fr.json +69 -1
- package/dist/locales/hi.json +69 -1
- package/dist/locales/it.json +69 -1
- package/dist/locales/ja.json +69 -1
- package/dist/locales/nl.json +69 -1
- package/dist/locales/pl.json +69 -1
- package/dist/locales/pt.json +69 -1
- package/dist/locales/ro.json +69 -1
- package/dist/locales/ru.json +69 -1
- package/dist/locales/sq.json +69 -1
- package/dist/locales/sv.json +69 -1
- package/dist/locales/tr.json +69 -1
- package/dist/locales/zh.json +69 -1
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/signature-request/channel-meta.d.ts +27 -0
- package/dist/patterns/signature-request/index.d.ts +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signature-request/load-status.d.ts +13 -0
- package/dist/patterns/signature-request/person-grid.d.ts +32 -0
- package/dist/patterns/signature-request/required-documents.d.ts +127 -0
- package/dist/patterns/signature-request/signature-history.d.ts +57 -0
- package/dist/patterns/signature-request/signature-outcome.d.ts +29 -0
- package/dist/patterns/signature-request/signature-request.d.ts +390 -26
- package/dist/tokens.css +1 -1
- package/package.json +3 -1
- package/dist/_chunks/qr-code-CPkEs5mG.js +0 -574
- package/dist/_chunks/radio-TWf9Q-mp.js +0 -108
- package/dist/_chunks/radio-group-rXDJADzW.js +0 -175
- package/dist/_chunks/select-Bi8zril7.js +0 -471
- package/dist/_chunks/signature-request-C-IsbkPf.js +0 -417
|
@@ -0,0 +1,2232 @@
|
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { useState as M, useRef as ge, useEffect as Ee, useId as j, forwardRef as ga } from "react";
|
|
3
|
+
import { useTranslation as fn } from "react-i18next";
|
|
4
|
+
import { D as S } from "./dialog-BJiLqhx6.js";
|
|
5
|
+
import { Q as fa } from "./qr-code-DOJs4suh.js";
|
|
6
|
+
import { S as va } from "./spinner-hbwuKwMf.js";
|
|
7
|
+
import { B as F } from "./button-nJaPh_HC.js";
|
|
8
|
+
import { I as gn } from "./icon-button-DA2CAGHZ.js";
|
|
9
|
+
import { s as ba, S as Ae } from "./select-CLSUnKjF.js";
|
|
10
|
+
import { S as ct } from "./switch-OILsBLWo.js";
|
|
11
|
+
import { A as K } from "./alert-CiJT540z.js";
|
|
12
|
+
import { S as dt } from "./separator-CYU_bGFn.js";
|
|
13
|
+
import { A as ut } from "./avatar-CkDeQOSI.js";
|
|
14
|
+
import { a as St, T as It } from "./tooltip-DvmfrNvB.js";
|
|
15
|
+
import { a as kt } from "./whatsapp-button-Ai4YAVkl.js";
|
|
16
|
+
import { c as vn } from "./createLucideIcon-DhHxpK9K.js";
|
|
17
|
+
import { M as Ot } from "./mail-BqXVF2zH.js";
|
|
18
|
+
import { M as xa } from "./message-square-Bye4ATvx.js";
|
|
19
|
+
import { S as Pe } from "./skeleton-CZbwyJAA.js";
|
|
20
|
+
import { D as tn } from "./dropdown-menu-DU-Hrf33.js";
|
|
21
|
+
import { S as Ra } from "./signature-status-chip-T5fyS-k9.js";
|
|
22
|
+
import { C as Na } from "./chevron-down-DWE7GSq9.js";
|
|
23
|
+
import { E as qa } from "./eye-BjhN2nYf.js";
|
|
24
|
+
import { D as ht } from "./download-CfYKJO_j.js";
|
|
25
|
+
import { S as Ca } from "./share-2-B49jcW2I.js";
|
|
26
|
+
import { T as mt } from "./trash-2-uumy3fy1.js";
|
|
27
|
+
import { L as pt } from "./list-DgE1xWBM.js";
|
|
28
|
+
import { T as ya } from "./triangle-alert-CBnO6nq_.js";
|
|
29
|
+
import { C as wa } from "./circle-check-BN6rz4NV.js";
|
|
30
|
+
import { P as gt } from "./plus-DzMQ_c6b.js";
|
|
31
|
+
import { X as Sa } from "./x-B5YnXwCz.js";
|
|
32
|
+
import { P as Ia } from "./pen-line-D0De5zdl.js";
|
|
33
|
+
/**
|
|
34
|
+
* @license lucide-react v1.22.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/
|
|
39
|
+
const ka = [
|
|
40
|
+
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
41
|
+
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
42
|
+
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
43
|
+
], Oa = vn("link-2", ka);
|
|
44
|
+
/**
|
|
45
|
+
* @license lucide-react v1.22.0 - ISC
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the ISC license.
|
|
48
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/
|
|
50
|
+
const Ta = [
|
|
51
|
+
["rect", { width: "5", height: "5", x: "3", y: "3", rx: "1", key: "1tu5fj" }],
|
|
52
|
+
["rect", { width: "5", height: "5", x: "16", y: "3", rx: "1", key: "1v8r4q" }],
|
|
53
|
+
["rect", { width: "5", height: "5", x: "3", y: "16", rx: "1", key: "1x03jg" }],
|
|
54
|
+
["path", { d: "M21 16h-3a2 2 0 0 0-2 2v3", key: "177gqh" }],
|
|
55
|
+
["path", { d: "M21 21v.01", key: "ents32" }],
|
|
56
|
+
["path", { d: "M12 7v3a2 2 0 0 1-2 2H7", key: "8crl2c" }],
|
|
57
|
+
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
58
|
+
["path", { d: "M12 3h.01", key: "n36tog" }],
|
|
59
|
+
["path", { d: "M12 16v.01", key: "133mhm" }],
|
|
60
|
+
["path", { d: "M16 12h1", key: "1slzba" }],
|
|
61
|
+
["path", { d: "M21 12v.01", key: "1lwtk9" }],
|
|
62
|
+
["path", { d: "M12 21v-1", key: "1880an" }]
|
|
63
|
+
], Ea = vn("qr-code", Ta);
|
|
64
|
+
/**
|
|
65
|
+
* @license lucide-react v1.22.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/
|
|
70
|
+
const Aa = [
|
|
71
|
+
["circle", { cx: "8", cy: "21", r: "1", key: "jimo8o" }],
|
|
72
|
+
["circle", { cx: "19", cy: "21", r: "1", key: "13723u" }],
|
|
73
|
+
[
|
|
74
|
+
"path",
|
|
75
|
+
{
|
|
76
|
+
d: "M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",
|
|
77
|
+
key: "9zh506"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
], Pa = vn("shopping-cart", Aa);
|
|
81
|
+
/**
|
|
82
|
+
* @license lucide-react v1.22.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/
|
|
87
|
+
const _a = [
|
|
88
|
+
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
|
|
89
|
+
["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
|
|
90
|
+
], Da = vn("tablet", _a);
|
|
91
|
+
/**
|
|
92
|
+
* @license lucide-react v1.22.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/
|
|
97
|
+
const Ma = [
|
|
98
|
+
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
99
|
+
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
100
|
+
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
101
|
+
["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
|
|
102
|
+
], Tt = vn("user-plus", Ma), En = [
|
|
103
|
+
"sms",
|
|
104
|
+
"email",
|
|
105
|
+
"on-device"
|
|
106
|
+
];
|
|
107
|
+
function cs() {
|
|
108
|
+
const { t: i } = fn();
|
|
109
|
+
return {
|
|
110
|
+
sms: {
|
|
111
|
+
label: i("signatureRequest.viaSms"),
|
|
112
|
+
icon: /* @__PURE__ */ n(xa, { className: "ds:size-4", "aria-hidden": !0 })
|
|
113
|
+
},
|
|
114
|
+
email: {
|
|
115
|
+
label: i("signatureRequest.viaEmail"),
|
|
116
|
+
icon: /* @__PURE__ */ n(Ot, { className: "ds:size-4", "aria-hidden": !0 })
|
|
117
|
+
},
|
|
118
|
+
whatsapp: {
|
|
119
|
+
label: i("signatureRequest.viaWhatsapp"),
|
|
120
|
+
icon: /* @__PURE__ */ n(kt, { className: "ds:size-4", "aria-hidden": !0 })
|
|
121
|
+
},
|
|
122
|
+
"on-device": {
|
|
123
|
+
label: i("signatureRequest.onThisDevice"),
|
|
124
|
+
icon: /* @__PURE__ */ n(Da, { className: "ds:size-4", "aria-hidden": !0 })
|
|
125
|
+
},
|
|
126
|
+
qr: {
|
|
127
|
+
label: i("signatureRequest.viaQr"),
|
|
128
|
+
icon: /* @__PURE__ */ n(Ea, { className: "ds:size-4", "aria-hidden": !0 })
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function Et({
|
|
133
|
+
loading: i,
|
|
134
|
+
loadingText: r,
|
|
135
|
+
loadedText: c,
|
|
136
|
+
message: l
|
|
137
|
+
}) {
|
|
138
|
+
const [g, I] = M(""), _ = ge(!1);
|
|
139
|
+
return Ee(() => {
|
|
140
|
+
i ? I(r) : _.current && I(c), _.current = i;
|
|
141
|
+
}, [i, r, c]), /* @__PURE__ */ n("span", { role: "status", className: "ds:sr-only", children: l !== void 0 && !i ? l : g });
|
|
142
|
+
}
|
|
143
|
+
const ue = "ds:grid ds:grid-cols-[var(--spacing-xl)_minmax(0,1fr)_var(--min-target-size)] ds:@[512px]/person:grid-cols-[var(--spacing-xl)_minmax(0,1fr)_max-content_var(--min-target-size)] ds:items-center ds:gap-x-[var(--spacing-sm)] ds:gap-y-[var(--spacing-sm)]", ft = "ds:col-start-1 ds:row-start-1 ds:flex ds:items-center ds:justify-center", vt = "ds:col-start-2 ds:row-start-1 ds:min-w-0", La = "ds:col-[2/-2] ds:row-start-1 ds:min-w-0", is = "ds:col-[-3/-2] ds:row-start-2 ds:min-w-0 ds:@[512px]/person:row-start-1", $a = "ds:col-[-2/-1] ds:row-start-1 ds:flex ds:items-center ds:justify-center", H = "ds:col-[2/-2] ds:min-w-0 ds:text-start", An = "ds:col-[1/-2] ds:row-start-1 ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", za = "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", pn = "ds:@container/person";
|
|
144
|
+
function At({ meta: i }) {
|
|
145
|
+
return /* @__PURE__ */ n(
|
|
146
|
+
"span",
|
|
147
|
+
{
|
|
148
|
+
"aria-hidden": "true",
|
|
149
|
+
"data-channel-sizer": "",
|
|
150
|
+
className: "ds:invisible ds:block ds:h-0 ds:overflow-hidden",
|
|
151
|
+
children: Object.entries(i).map(([r, { label: c, icon: l }]) => /* @__PURE__ */ n("span", { className: "ds:flex ds:w-max", children: /* @__PURE__ */ h("span", { className: ba({ size: "md" }), children: [
|
|
152
|
+
/* @__PURE__ */ h("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
153
|
+
/* @__PURE__ */ n("span", { className: "ds:inline-flex ds:shrink-0", children: l }),
|
|
154
|
+
/* @__PURE__ */ n("span", { className: "ds:whitespace-nowrap", children: c })
|
|
155
|
+
] }),
|
|
156
|
+
/* @__PURE__ */ n(Na, { className: "ds:size-4 ds:shrink-0" })
|
|
157
|
+
] }) }, r))
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
const bt = [
|
|
162
|
+
"link",
|
|
163
|
+
"email",
|
|
164
|
+
"whatsapp"
|
|
165
|
+
], Fa = [0, 1], Ha = "ds:flex ds:flex-col ds:@[512px]/person:grid ds:@[512px]/person:grid-cols-[max-content_minmax(0,1fr)_max-content] ds:@[512px]/person:gap-x-[var(--spacing-md)]", xt = "ds:flex ds:flex-col ds:@[512px]/person:col-span-full ds:@[512px]/person:grid ds:@[512px]/person:grid-cols-subgrid", rs = "ds:grid ds:grid-cols-[minmax(0,1fr)_max-content] ds:items-center ds:gap-x-[var(--spacing-sm)] ds:gap-y-[var(--spacing-xs)] ds:py-[var(--spacing-xs)] ds:@[512px]/person:col-span-full ds:@[512px]/person:grid-cols-subgrid ds:@[512px]/person:gap-x-[var(--spacing-md)]", Rt = "ds:col-start-1 ds:row-start-1 ds:min-w-0 ds:text-start ds:@[512px]/person:col-start-1 ds:@[512px]/person:whitespace-nowrap", Nt = "ds:col-span-full ds:row-start-2 ds:min-w-0 ds:text-start ds:@[512px]/person:col-span-1 ds:@[512px]/person:col-start-2 ds:@[512px]/person:row-start-1", qt = "ds:col-start-2 ds:row-start-1 ds:flex ds:justify-end ds:@[512px]/person:col-start-3";
|
|
166
|
+
function Pt(i) {
|
|
167
|
+
const r = (i instanceof Date ? i : new Date(i)).getTime();
|
|
168
|
+
return Number.isNaN(r) ? null : r;
|
|
169
|
+
}
|
|
170
|
+
function ja(i) {
|
|
171
|
+
return i.map((r, c) => ({ record: r, index: c, ms: Pt(r.createdAt) })).sort((r, c) => r.ms === c.ms ? r.index - c.index : r.ms === null ? 1 : c.ms === null ? -1 : c.ms - r.ms).map(({ record: r }) => r);
|
|
172
|
+
}
|
|
173
|
+
function Ua({
|
|
174
|
+
signatures: i,
|
|
175
|
+
loading: r = !1,
|
|
176
|
+
showLegalLevel: c = !0,
|
|
177
|
+
onView: l,
|
|
178
|
+
onDownload: g,
|
|
179
|
+
onShare: I,
|
|
180
|
+
shareTargets: _ = bt,
|
|
181
|
+
onDelete: $
|
|
182
|
+
}) {
|
|
183
|
+
const { t: b, i18n: X } = fn(), D = cs(), fe = j(), ve = {
|
|
184
|
+
link: { label: b("signatureRequest.shareLink"), icon: /* @__PURE__ */ n(Oa, {}) },
|
|
185
|
+
email: { label: b("signatureRequest.viaEmail"), icon: /* @__PURE__ */ n(Ot, {}) },
|
|
186
|
+
whatsapp: {
|
|
187
|
+
label: b("signatureRequest.viaWhatsapp"),
|
|
188
|
+
icon: /* @__PURE__ */ n(kt, {})
|
|
189
|
+
}
|
|
190
|
+
}, De = X.language || "en", k = De === "en" ? "en-GB" : De, re = new Intl.DateTimeFormat(k, {
|
|
191
|
+
weekday: "short"
|
|
192
|
+
}), Me = new Intl.DateTimeFormat(k, {
|
|
193
|
+
day: "2-digit",
|
|
194
|
+
month: "2-digit",
|
|
195
|
+
year: "numeric"
|
|
196
|
+
}), Le = new Intl.DateTimeFormat(k, {
|
|
197
|
+
hour: "2-digit",
|
|
198
|
+
minute: "2-digit"
|
|
199
|
+
}), be = (A) => {
|
|
200
|
+
const v = re.format(A);
|
|
201
|
+
return b("signatureRequest.signedAt", {
|
|
202
|
+
weekday: v.charAt(0).toLocaleUpperCase(k) + v.slice(1),
|
|
203
|
+
date: Me.format(A),
|
|
204
|
+
time: Le.format(A),
|
|
205
|
+
interpolation: { escapeValue: !1 }
|
|
206
|
+
});
|
|
207
|
+
}, U = ge(null), $e = ge(null), he = ge(null), [xe, Re] = M();
|
|
208
|
+
Ee(() => {
|
|
209
|
+
const A = he.current;
|
|
210
|
+
if (!A || r) return;
|
|
211
|
+
const v = new Set((i ?? []).map((f) => f.id));
|
|
212
|
+
if (v.has(A.id)) return;
|
|
213
|
+
he.current = null, Re(b("signatureRequest.signatureDeleted"));
|
|
214
|
+
const y = A.order.indexOf(A.id), W = A.order.slice(y + 1).find((f) => v.has(f)) ?? A.order.slice(0, y).reverse().find((f) => v.has(f));
|
|
215
|
+
window.setTimeout(() => {
|
|
216
|
+
var we, J, Se;
|
|
217
|
+
const f = document.activeElement;
|
|
218
|
+
if (!(!f || f === document.body || !f.isConnected || f.matches('[role="dialog"], [role="alertdialog"]'))) return;
|
|
219
|
+
if (W === void 0) {
|
|
220
|
+
(we = $e.current) == null || we.focus();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const P = Array.from(
|
|
224
|
+
((J = U.current) == null ? void 0 : J.querySelectorAll(
|
|
225
|
+
"[data-signature-id]"
|
|
226
|
+
)) ?? []
|
|
227
|
+
).find((Y) => Y.dataset.signatureId === W);
|
|
228
|
+
(Se = P == null ? void 0 : P.querySelector('[role="group"] button')) == null || Se.focus();
|
|
229
|
+
}, 0);
|
|
230
|
+
}, [i, r, b]);
|
|
231
|
+
const C = i ? ja(i) : [];
|
|
232
|
+
let me;
|
|
233
|
+
if (r)
|
|
234
|
+
me = /* @__PURE__ */ n(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
"aria-busy": "true",
|
|
238
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
239
|
+
children: Fa.map((A) => /* @__PURE__ */ h(
|
|
240
|
+
"div",
|
|
241
|
+
{
|
|
242
|
+
className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ h("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
245
|
+
/* @__PURE__ */ n(Pe, { size: "md", width: "40%" }),
|
|
246
|
+
/* @__PURE__ */ n(Pe, { size: "sm", width: "70%" })
|
|
247
|
+
] }),
|
|
248
|
+
/* @__PURE__ */ n(Pe, { variant: "circular", size: "sm" }),
|
|
249
|
+
/* @__PURE__ */ n(Pe, { variant: "circular", size: "sm" }),
|
|
250
|
+
/* @__PURE__ */ n(Pe, { variant: "circular", size: "sm" })
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
A
|
|
254
|
+
))
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
else if (C.length === 0)
|
|
258
|
+
me = /* @__PURE__ */ n(
|
|
259
|
+
"p",
|
|
260
|
+
{
|
|
261
|
+
ref: $e,
|
|
262
|
+
tabIndex: -1,
|
|
263
|
+
"data-note": "no-signed-versions",
|
|
264
|
+
className: "type-body-sm ds:text-[color:var(--muted-foreground)] ds:outline-none",
|
|
265
|
+
children: b("signatureRequest.noSignedVersions")
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
else {
|
|
269
|
+
const A = "type-label ds:text-[color:var(--muted-foreground)] ds:pb-[var(--spacing-xs)]";
|
|
270
|
+
me = // The chip's tooltip and the icon-button tooltips need a provider; the
|
|
271
|
+
// section brings its own so a host without one does not crash.
|
|
272
|
+
/* @__PURE__ */ n(St, { children: /* @__PURE__ */ h(
|
|
273
|
+
"div",
|
|
274
|
+
{
|
|
275
|
+
ref: U,
|
|
276
|
+
role: "table",
|
|
277
|
+
"aria-labelledby": fe,
|
|
278
|
+
className: Ha,
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ n(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
role: "rowgroup",
|
|
284
|
+
className: `${xt} ds:sr-only ds:@[512px]/person:not-sr-only`,
|
|
285
|
+
children: /* @__PURE__ */ h(
|
|
286
|
+
"div",
|
|
287
|
+
{
|
|
288
|
+
role: "row",
|
|
289
|
+
className: `${rs} ds:border-b ds:border-[color:var(--border)]`,
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ n(
|
|
292
|
+
"span",
|
|
293
|
+
{
|
|
294
|
+
role: "columnheader",
|
|
295
|
+
className: `${Rt} ${A}`,
|
|
296
|
+
children: b("signatureRequest.columnDate")
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
/* @__PURE__ */ n(
|
|
300
|
+
"span",
|
|
301
|
+
{
|
|
302
|
+
role: "columnheader",
|
|
303
|
+
className: `${Nt} ${A}`,
|
|
304
|
+
children: b("signatureRequest.columnSignatureType")
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
/* @__PURE__ */ n(
|
|
308
|
+
"span",
|
|
309
|
+
{
|
|
310
|
+
role: "columnheader",
|
|
311
|
+
className: `${qt} ${A}`,
|
|
312
|
+
children: b("signatureRequest.columnActions")
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
)
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
/* @__PURE__ */ n("div", { role: "rowgroup", className: xt, children: C.map((v, y) => {
|
|
321
|
+
const W = Pt(v.createdAt), f = W === null ? String(v.createdAt) : be(W), ee = W === null ? void 0 : new Date(W).toISOString(), P = D[v.channel], we = v.shareTargets ?? _, J = I ? bt.filter(
|
|
322
|
+
(Y) => we.includes(Y)
|
|
323
|
+
) : [], Se = l !== void 0 || g !== void 0 || J.length > 0 || $ !== void 0;
|
|
324
|
+
return /* @__PURE__ */ h(
|
|
325
|
+
"div",
|
|
326
|
+
{
|
|
327
|
+
role: "row",
|
|
328
|
+
"data-signature-id": v.id,
|
|
329
|
+
className: y === 0 ? rs : `${rs} ds:border-t ds:border-[color:var(--border)]`,
|
|
330
|
+
children: [
|
|
331
|
+
/* @__PURE__ */ n("div", { role: "cell", className: `${Rt} type-body`, children: /* @__PURE__ */ n("time", { dateTime: ee, children: f }) }),
|
|
332
|
+
/* @__PURE__ */ n("div", { role: "cell", className: Nt, children: /* @__PURE__ */ h("span", { className: "type-body-sm ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
|
|
333
|
+
c && v.legalLevel ? /* @__PURE__ */ n("span", { children: v.legalLevel === "advanced" ? b("signatureRequest.legalLevelAdvanced") : b("signatureRequest.legalLevelSimple") }) : null,
|
|
334
|
+
/* @__PURE__ */ h("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
335
|
+
/* @__PURE__ */ n(
|
|
336
|
+
"span",
|
|
337
|
+
{
|
|
338
|
+
"aria-hidden": "true",
|
|
339
|
+
className: "ds:text-[var(--accent)]",
|
|
340
|
+
children: P.icon
|
|
341
|
+
}
|
|
342
|
+
),
|
|
343
|
+
P.label
|
|
344
|
+
] }),
|
|
345
|
+
/* @__PURE__ */ n(
|
|
346
|
+
Ra,
|
|
347
|
+
{
|
|
348
|
+
size: "sm",
|
|
349
|
+
operator: v.operator,
|
|
350
|
+
patient: v.patient,
|
|
351
|
+
secondary: v.secondary,
|
|
352
|
+
names: v.names,
|
|
353
|
+
tooltip: !0
|
|
354
|
+
}
|
|
355
|
+
)
|
|
356
|
+
] }) }),
|
|
357
|
+
/* @__PURE__ */ n("div", { role: "cell", className: qt, children: Se ? /* @__PURE__ */ h(
|
|
358
|
+
"span",
|
|
359
|
+
{
|
|
360
|
+
role: "group",
|
|
361
|
+
"aria-label": b("signatureRequest.signatureActions", {
|
|
362
|
+
date: f,
|
|
363
|
+
interpolation: { escapeValue: !1 }
|
|
364
|
+
}),
|
|
365
|
+
className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
366
|
+
children: [
|
|
367
|
+
l ? /* @__PURE__ */ n(
|
|
368
|
+
gn,
|
|
369
|
+
{
|
|
370
|
+
intent: "ghost",
|
|
371
|
+
size: "sm",
|
|
372
|
+
icon: /* @__PURE__ */ n(qa, {}),
|
|
373
|
+
"aria-label": b("signatureRequest.viewSignature"),
|
|
374
|
+
tooltip: b("signatureRequest.viewSignature"),
|
|
375
|
+
onClick: () => l(v.id)
|
|
376
|
+
}
|
|
377
|
+
) : null,
|
|
378
|
+
g && v.hasAnonymisedVersion ? /* @__PURE__ */ h(
|
|
379
|
+
Ct,
|
|
380
|
+
{
|
|
381
|
+
id: `signature-download-${v.id}`,
|
|
382
|
+
label: b("signatureRequest.downloadSignature"),
|
|
383
|
+
icon: /* @__PURE__ */ n(ht, {}),
|
|
384
|
+
children: [
|
|
385
|
+
/* @__PURE__ */ n(
|
|
386
|
+
tn.Item,
|
|
387
|
+
{
|
|
388
|
+
onSelect: () => g(v.id, "full"),
|
|
389
|
+
children: b("signatureRequest.downloadFull")
|
|
390
|
+
}
|
|
391
|
+
),
|
|
392
|
+
/* @__PURE__ */ n(
|
|
393
|
+
tn.Item,
|
|
394
|
+
{
|
|
395
|
+
onSelect: () => g(v.id, "anonymised"),
|
|
396
|
+
children: b("signatureRequest.downloadAnonymised")
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
) : g ? (
|
|
402
|
+
// One file only: a menu with a single entry would
|
|
403
|
+
// be an extra click for nothing.
|
|
404
|
+
/* @__PURE__ */ n(
|
|
405
|
+
gn,
|
|
406
|
+
{
|
|
407
|
+
intent: "ghost",
|
|
408
|
+
size: "sm",
|
|
409
|
+
icon: /* @__PURE__ */ n(ht, {}),
|
|
410
|
+
"aria-label": b("signatureRequest.downloadSignature"),
|
|
411
|
+
tooltip: b("signatureRequest.downloadSignature"),
|
|
412
|
+
onClick: () => g(v.id, "full")
|
|
413
|
+
}
|
|
414
|
+
)
|
|
415
|
+
) : null,
|
|
416
|
+
I && J.length > 0 ? /* @__PURE__ */ n(
|
|
417
|
+
Ct,
|
|
418
|
+
{
|
|
419
|
+
id: `signature-share-${v.id}`,
|
|
420
|
+
label: b("signatureRequest.shareSignature"),
|
|
421
|
+
icon: /* @__PURE__ */ n(Ca, {}),
|
|
422
|
+
children: J.map((Y) => /* @__PURE__ */ n(
|
|
423
|
+
tn.Item,
|
|
424
|
+
{
|
|
425
|
+
startIcon: ve[Y].icon,
|
|
426
|
+
onSelect: () => I(v.id, Y),
|
|
427
|
+
children: ve[Y].label
|
|
428
|
+
},
|
|
429
|
+
Y
|
|
430
|
+
))
|
|
431
|
+
}
|
|
432
|
+
) : null,
|
|
433
|
+
$ ? /* @__PURE__ */ n(
|
|
434
|
+
Wa,
|
|
435
|
+
{
|
|
436
|
+
id: `signature-delete-${v.id}`,
|
|
437
|
+
when: f,
|
|
438
|
+
dateTime: ee,
|
|
439
|
+
onConfirm: () => {
|
|
440
|
+
he.current = {
|
|
441
|
+
id: v.id,
|
|
442
|
+
order: C.map((Y) => Y.id)
|
|
443
|
+
}, Re(""), $(v.id);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
) : null
|
|
447
|
+
]
|
|
448
|
+
}
|
|
449
|
+
) : null })
|
|
450
|
+
]
|
|
451
|
+
},
|
|
452
|
+
v.id
|
|
453
|
+
);
|
|
454
|
+
}) })
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
) });
|
|
458
|
+
}
|
|
459
|
+
return /* @__PURE__ */ h(
|
|
460
|
+
"section",
|
|
461
|
+
{
|
|
462
|
+
"aria-labelledby": fe,
|
|
463
|
+
"data-section": "signed-versions",
|
|
464
|
+
className: `${pn} ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start`,
|
|
465
|
+
children: [
|
|
466
|
+
/* @__PURE__ */ n("div", { className: ue, children: /* @__PURE__ */ n("div", { className: An, children: /* @__PURE__ */ n(
|
|
467
|
+
"h3",
|
|
468
|
+
{
|
|
469
|
+
id: fe,
|
|
470
|
+
className: "type-eyebrow ds:m-0 ds:text-[color:var(--muted-foreground)]",
|
|
471
|
+
children: b("signatureRequest.signedVersions")
|
|
472
|
+
}
|
|
473
|
+
) }) }),
|
|
474
|
+
/* @__PURE__ */ n("div", { className: ue, children: /* @__PURE__ */ h("div", { className: "ds:col-[1/-2] ds:min-w-0", children: [
|
|
475
|
+
/* @__PURE__ */ n(
|
|
476
|
+
Et,
|
|
477
|
+
{
|
|
478
|
+
loading: r,
|
|
479
|
+
loadingText: b("signatureRequest.signaturesLoading"),
|
|
480
|
+
loadedText: b("signatureRequest.signaturesLoaded"),
|
|
481
|
+
message: xe
|
|
482
|
+
}
|
|
483
|
+
),
|
|
484
|
+
me
|
|
485
|
+
] }) })
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
function _t() {
|
|
491
|
+
const [i, r] = M(!1), c = ge(!1);
|
|
492
|
+
return {
|
|
493
|
+
tooltipProps: {
|
|
494
|
+
open: i,
|
|
495
|
+
onOpenChange: (l) => {
|
|
496
|
+
l && c.current || r(l);
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
triggerProps: {
|
|
500
|
+
onPointerMove: () => {
|
|
501
|
+
c.current = !1;
|
|
502
|
+
},
|
|
503
|
+
onBlur: () => {
|
|
504
|
+
c.current = !1;
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
hideTip: () => r(!1),
|
|
508
|
+
/** Call just before focus returns to the trigger. */
|
|
509
|
+
markReturning: () => {
|
|
510
|
+
c.current = !0;
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
function Ct({ id: i, label: r, icon: c, children: l }) {
|
|
515
|
+
const g = _t();
|
|
516
|
+
return /* @__PURE__ */ h(
|
|
517
|
+
tn.Root,
|
|
518
|
+
{
|
|
519
|
+
id: i,
|
|
520
|
+
onOpenChange: (I) => {
|
|
521
|
+
I && g.hideTip();
|
|
522
|
+
},
|
|
523
|
+
children: [
|
|
524
|
+
/* @__PURE__ */ n(It, { label: r, ...g.tooltipProps, children: /* @__PURE__ */ n(tn.Trigger, { asChild: !0, children: /* @__PURE__ */ n(
|
|
525
|
+
gn,
|
|
526
|
+
{
|
|
527
|
+
intent: "ghost",
|
|
528
|
+
size: "sm",
|
|
529
|
+
icon: c,
|
|
530
|
+
"aria-label": r,
|
|
531
|
+
...g.triggerProps
|
|
532
|
+
}
|
|
533
|
+
) }) }),
|
|
534
|
+
/* @__PURE__ */ n(
|
|
535
|
+
tn.Content,
|
|
536
|
+
{
|
|
537
|
+
align: "end",
|
|
538
|
+
onCloseAutoFocus: g.markReturning,
|
|
539
|
+
children: l
|
|
540
|
+
}
|
|
541
|
+
)
|
|
542
|
+
]
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
}
|
|
546
|
+
function Wa({ id: i, when: r, dateTime: c, onConfirm: l }) {
|
|
547
|
+
const { t: g } = fn(), I = _t(), [_, $] = M(!1), b = g("signatureRequest.deleteSignature");
|
|
548
|
+
return /* @__PURE__ */ h(
|
|
549
|
+
S,
|
|
550
|
+
{
|
|
551
|
+
id: i,
|
|
552
|
+
open: _,
|
|
553
|
+
onOpenChange: (X) => {
|
|
554
|
+
X && I.hideTip(), $(X);
|
|
555
|
+
},
|
|
556
|
+
children: [
|
|
557
|
+
/* @__PURE__ */ n(It, { label: b, ...I.tooltipProps, children: /* @__PURE__ */ n(S.Trigger, { asChild: !0, children: /* @__PURE__ */ n(
|
|
558
|
+
gn,
|
|
559
|
+
{
|
|
560
|
+
intent: "destructiveOutline",
|
|
561
|
+
size: "sm",
|
|
562
|
+
icon: /* @__PURE__ */ n(mt, {}),
|
|
563
|
+
"aria-label": b,
|
|
564
|
+
...I.triggerProps
|
|
565
|
+
}
|
|
566
|
+
) }) }),
|
|
567
|
+
/* @__PURE__ */ h(
|
|
568
|
+
S.Content,
|
|
569
|
+
{
|
|
570
|
+
variant: "alert",
|
|
571
|
+
size: "sm",
|
|
572
|
+
onCloseAutoFocus: I.markReturning,
|
|
573
|
+
children: [
|
|
574
|
+
/* @__PURE__ */ h(S.Header, { children: [
|
|
575
|
+
/* @__PURE__ */ n(S.Title, { children: g("signatureRequest.deleteSignatureConfirm") }),
|
|
576
|
+
/* @__PURE__ */ n(S.Description, { children: /* @__PURE__ */ n("time", { dateTime: c, children: r }) })
|
|
577
|
+
] }),
|
|
578
|
+
/* @__PURE__ */ h(S.Footer, { children: [
|
|
579
|
+
/* @__PURE__ */ n(S.Close, { asChild: !0, children: /* @__PURE__ */ n(F, { intent: "outline", children: g("common.cancel") }) }),
|
|
580
|
+
/* @__PURE__ */ n(
|
|
581
|
+
F,
|
|
582
|
+
{
|
|
583
|
+
intent: "destructive",
|
|
584
|
+
startIcon: /* @__PURE__ */ n(mt, {}),
|
|
585
|
+
onClick: () => {
|
|
586
|
+
l(), $(!1);
|
|
587
|
+
},
|
|
588
|
+
children: b
|
|
589
|
+
}
|
|
590
|
+
)
|
|
591
|
+
] })
|
|
592
|
+
]
|
|
593
|
+
}
|
|
594
|
+
)
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
const Q = "__assign-later__";
|
|
600
|
+
function Ba(i) {
|
|
601
|
+
return i.filter((r) => r.signed !== !0);
|
|
602
|
+
}
|
|
603
|
+
function Ga(i) {
|
|
604
|
+
return i.length > 0 && i.every(
|
|
605
|
+
(r) => r.kind === "document" && r.canCarrySecondary === !0
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
function _e(i) {
|
|
609
|
+
return i.requiresOperator;
|
|
610
|
+
}
|
|
611
|
+
function Dt(i, r) {
|
|
612
|
+
return i.filter((c) => c.deleted !== !0 || c.value === r).map(({ deleted: c, ...l }) => l);
|
|
613
|
+
}
|
|
614
|
+
function Mt(i, r) {
|
|
615
|
+
return i.some(
|
|
616
|
+
(c) => c.value === r && c.disabled !== !0 && c.deleted !== !0
|
|
617
|
+
);
|
|
618
|
+
}
|
|
619
|
+
function Lt(i, r) {
|
|
620
|
+
const c = i.filter((l) => l.disabled === !0 && l.deleted !== !0).map(
|
|
621
|
+
(l) => l.description ? `${l.label} (${l.description})` : l.label
|
|
622
|
+
);
|
|
623
|
+
if (c.length !== 0)
|
|
624
|
+
return new Intl.ListFormat(r || "en", { type: "unit" }).format(c);
|
|
625
|
+
}
|
|
626
|
+
function Tn({
|
|
627
|
+
items: i,
|
|
628
|
+
channel: r,
|
|
629
|
+
primaryIsPatient: c
|
|
630
|
+
}) {
|
|
631
|
+
return Ga(i) ? c ? "patient" : r !== "on-device" ? "channel" : null : i.some((l) => l.kind === "anamnesis") ? "anamnesis" : "documents";
|
|
632
|
+
}
|
|
633
|
+
function Va({
|
|
634
|
+
primaryId: i,
|
|
635
|
+
secondId: r,
|
|
636
|
+
channel: c,
|
|
637
|
+
options: l
|
|
638
|
+
}) {
|
|
639
|
+
if (r === i) return "sameAsPrimary";
|
|
640
|
+
const g = l.find((_) => _.value === r);
|
|
641
|
+
if (!g || g.isPatient === !0) return "unknownSignee";
|
|
642
|
+
const I = (_) => {
|
|
643
|
+
var $;
|
|
644
|
+
return (!g.availableChannels || g.availableChannels.length === 0 || g.availableChannels.includes(_)) && !(($ = g.unavailableChannels) != null && $.some((b) => b.channel === _));
|
|
645
|
+
};
|
|
646
|
+
return (c === "sms" || c === "whatsapp") && !I(c) ? "missingPhone" : c === "email" && !I("email") ? "missingEmail" : null;
|
|
647
|
+
}
|
|
648
|
+
const Qa = [0, 1, 2], Ka = "ds:grid ds:grid-cols-1 ds:@[512px]/person:grid-cols-2 ds:items-center ds:gap-[var(--spacing-sm)] ds:font-normal", Xa = "ds:grid ds:grid-cols-1 ds:@[512px]/person:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_max-content] ds:items-center ds:gap-[var(--spacing-sm)] ds:font-normal", Ya = "ds:min-w-0 ds:font-medium", Ja = "ds:col-span-full ds:min-w-0 ds:font-medium", ls = "ds:block ds:min-w-0", yt = "ds:!gap-[var(--spacing-sm)] ds:!p-[var(--spacing-sm)]";
|
|
649
|
+
function Za({
|
|
650
|
+
items: i,
|
|
651
|
+
loading: r = !1,
|
|
652
|
+
operatorOptions: c,
|
|
653
|
+
assignments: l,
|
|
654
|
+
onAssign: g,
|
|
655
|
+
onAssignAllToMe: I,
|
|
656
|
+
busy: _ = !1,
|
|
657
|
+
showOperatorChannels: $ = !1,
|
|
658
|
+
operatorChannels: b = {},
|
|
659
|
+
onOperatorChannel: X
|
|
660
|
+
}) {
|
|
661
|
+
const { t: D, i18n: fe } = fn(), ve = cs(), De = En.map(
|
|
662
|
+
(C) => ({
|
|
663
|
+
value: C,
|
|
664
|
+
label: ve[C].label,
|
|
665
|
+
startAdornment: ve[C].icon
|
|
666
|
+
})
|
|
667
|
+
), k = j(), re = j(), Me = j(), Le = /* @__PURE__ */ n(
|
|
668
|
+
Et,
|
|
669
|
+
{
|
|
670
|
+
loading: r,
|
|
671
|
+
loadingText: D("signatureRequest.requiredLoading"),
|
|
672
|
+
loadedText: D("signatureRequest.requiredLoaded")
|
|
673
|
+
}
|
|
674
|
+
);
|
|
675
|
+
if (r)
|
|
676
|
+
return /* @__PURE__ */ h(ye, { children: [
|
|
677
|
+
Le,
|
|
678
|
+
/* @__PURE__ */ n(
|
|
679
|
+
"div",
|
|
680
|
+
{
|
|
681
|
+
"aria-busy": "true",
|
|
682
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
683
|
+
children: Qa.map((C) => /* @__PURE__ */ h(
|
|
684
|
+
"div",
|
|
685
|
+
{
|
|
686
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
687
|
+
children: [
|
|
688
|
+
/* @__PURE__ */ n(Pe, { size: "md", width: "50%" }),
|
|
689
|
+
/* @__PURE__ */ n(Pe, { size: "sm", width: "30%" })
|
|
690
|
+
]
|
|
691
|
+
},
|
|
692
|
+
C
|
|
693
|
+
))
|
|
694
|
+
}
|
|
695
|
+
)
|
|
696
|
+
] });
|
|
697
|
+
const be = i.filter((C) => C.kind === "document"), U = i.filter((C) => C.kind === "anamnesis"), $e = i.some(
|
|
698
|
+
(C) => _e(C) && l[C.id] === Q
|
|
699
|
+
), he = [be, U].find(
|
|
700
|
+
(C) => C.some(_e)
|
|
701
|
+
), xe = Lt(c, fe.language), Re = (C, me, A) => {
|
|
702
|
+
if (C.length === 0) return null;
|
|
703
|
+
const v = C === he;
|
|
704
|
+
return /* @__PURE__ */ h(
|
|
705
|
+
"section",
|
|
706
|
+
{
|
|
707
|
+
className: `${pn} ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]`,
|
|
708
|
+
children: [
|
|
709
|
+
/* @__PURE__ */ h("div", { className: ue, children: [
|
|
710
|
+
/* @__PURE__ */ h("div", { className: An, children: [
|
|
711
|
+
/* @__PURE__ */ n(
|
|
712
|
+
"p",
|
|
713
|
+
{
|
|
714
|
+
id: me,
|
|
715
|
+
className: "type-eyebrow ds:text-[color:var(--muted-foreground)]",
|
|
716
|
+
children: A
|
|
717
|
+
}
|
|
718
|
+
),
|
|
719
|
+
v && I ? /* @__PURE__ */ n(
|
|
720
|
+
F,
|
|
721
|
+
{
|
|
722
|
+
intent: "outline",
|
|
723
|
+
size: "sm",
|
|
724
|
+
startIcon: /* @__PURE__ */ n(Tt, {}),
|
|
725
|
+
disabled: _,
|
|
726
|
+
onClick: I,
|
|
727
|
+
children: D("signatureRequest.assignAllToMe")
|
|
728
|
+
}
|
|
729
|
+
) : null
|
|
730
|
+
] }),
|
|
731
|
+
v && $e ? /* @__PURE__ */ n(
|
|
732
|
+
K,
|
|
733
|
+
{
|
|
734
|
+
variant: "info",
|
|
735
|
+
"data-note": "assign-later",
|
|
736
|
+
className: `${H} ${yt}`,
|
|
737
|
+
children: /* @__PURE__ */ n(K.Description, { children: D("signatureRequest.assignLaterNote") })
|
|
738
|
+
}
|
|
739
|
+
) : null,
|
|
740
|
+
v && !$ ? /* @__PURE__ */ n(
|
|
741
|
+
K,
|
|
742
|
+
{
|
|
743
|
+
variant: "info",
|
|
744
|
+
"data-note": "operator-channel",
|
|
745
|
+
className: `${H} ${yt}`,
|
|
746
|
+
children: /* @__PURE__ */ n(K.Description, { children: D("signatureRequest.operatorChannelNote") })
|
|
747
|
+
}
|
|
748
|
+
) : null
|
|
749
|
+
] }),
|
|
750
|
+
/* @__PURE__ */ n("div", { className: ue, children: /* @__PURE__ */ n(
|
|
751
|
+
pt,
|
|
752
|
+
{
|
|
753
|
+
density: "relaxed",
|
|
754
|
+
"aria-labelledby": me,
|
|
755
|
+
className: H,
|
|
756
|
+
children: C.map((y) => {
|
|
757
|
+
const W = _e(y), f = W && $, ee = W && l[y.id] !== void 0 && l[y.id] !== Q && l[y.id] !== "";
|
|
758
|
+
return /* @__PURE__ */ n(
|
|
759
|
+
pt.Item,
|
|
760
|
+
{
|
|
761
|
+
value: y.id,
|
|
762
|
+
"data-required-item-id": y.id,
|
|
763
|
+
className: "ds:!p-[var(--spacing-none)]",
|
|
764
|
+
title: /* @__PURE__ */ h(
|
|
765
|
+
"span",
|
|
766
|
+
{
|
|
767
|
+
className: f ? Xa : Ka,
|
|
768
|
+
children: [
|
|
769
|
+
/* @__PURE__ */ n("span", { className: W ? Ya : Ja, children: y.name }),
|
|
770
|
+
W ? /* @__PURE__ */ n("span", { className: ls, children: /* @__PURE__ */ n(
|
|
771
|
+
Ae,
|
|
772
|
+
{
|
|
773
|
+
id: `signature-request-item-operator-${y.id}`,
|
|
774
|
+
options: Dt(
|
|
775
|
+
c,
|
|
776
|
+
l[y.id]
|
|
777
|
+
),
|
|
778
|
+
value: l[y.id],
|
|
779
|
+
onValueChange: (P) => {
|
|
780
|
+
P && Mt(c, P) && g(y.id, P);
|
|
781
|
+
},
|
|
782
|
+
showDescriptions: !0,
|
|
783
|
+
"aria-describedby": xe ? Me : void 0,
|
|
784
|
+
required: !0,
|
|
785
|
+
disabled: _,
|
|
786
|
+
placeholder: D(
|
|
787
|
+
"signatureRequest.operatorPlaceholder"
|
|
788
|
+
),
|
|
789
|
+
"aria-label": D(
|
|
790
|
+
"signatureRequest.itemOperatorLabel",
|
|
791
|
+
{ name: y.name }
|
|
792
|
+
)
|
|
793
|
+
}
|
|
794
|
+
) }) : null,
|
|
795
|
+
f ? (
|
|
796
|
+
// The chosen operator's channel, from their settings
|
|
797
|
+
// unless changed here. Nobody to deliver to while
|
|
798
|
+
// unassigned, but the column keeps its width.
|
|
799
|
+
/* @__PURE__ */ h(
|
|
800
|
+
"span",
|
|
801
|
+
{
|
|
802
|
+
className: ee ? ls : `${ls} ds:hidden ds:@[512px]/person:block`,
|
|
803
|
+
children: [
|
|
804
|
+
ee ? /* @__PURE__ */ n(
|
|
805
|
+
Ae,
|
|
806
|
+
{
|
|
807
|
+
id: `signature-request-item-operator-channel-${y.id}`,
|
|
808
|
+
options: De,
|
|
809
|
+
value: b[y.id],
|
|
810
|
+
adornmentInTrigger: !0,
|
|
811
|
+
disabled: _,
|
|
812
|
+
"aria-label": D(
|
|
813
|
+
"signatureRequest.itemOperatorChannelLabel",
|
|
814
|
+
{ name: y.name }
|
|
815
|
+
),
|
|
816
|
+
onValueChange: (P) => {
|
|
817
|
+
En.includes(
|
|
818
|
+
P
|
|
819
|
+
) && (X == null || X(
|
|
820
|
+
y.id,
|
|
821
|
+
P
|
|
822
|
+
));
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
) : null,
|
|
826
|
+
/* @__PURE__ */ n(At, { meta: ve })
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
)
|
|
830
|
+
) : null
|
|
831
|
+
]
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
},
|
|
835
|
+
y.id
|
|
836
|
+
);
|
|
837
|
+
})
|
|
838
|
+
}
|
|
839
|
+
) })
|
|
840
|
+
]
|
|
841
|
+
}
|
|
842
|
+
);
|
|
843
|
+
};
|
|
844
|
+
return /* @__PURE__ */ h(ye, { children: [
|
|
845
|
+
Le,
|
|
846
|
+
xe ? /* @__PURE__ */ n("span", { id: Me, className: "ds:sr-only", children: xe }) : null,
|
|
847
|
+
/* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:text-start", children: [
|
|
848
|
+
Re(
|
|
849
|
+
be,
|
|
850
|
+
k,
|
|
851
|
+
D("signatureRequest.requiredDocumentsHeading", {
|
|
852
|
+
count: be.length
|
|
853
|
+
})
|
|
854
|
+
),
|
|
855
|
+
Re(
|
|
856
|
+
U,
|
|
857
|
+
re,
|
|
858
|
+
D("signatureRequest.requiredAnamnesisHeading", {
|
|
859
|
+
count: U.length
|
|
860
|
+
})
|
|
861
|
+
)
|
|
862
|
+
] })
|
|
863
|
+
] });
|
|
864
|
+
}
|
|
865
|
+
function ei(i, r, { required: c = !1 } = {}) {
|
|
866
|
+
switch (i) {
|
|
867
|
+
case "linkSent":
|
|
868
|
+
return c ? {
|
|
869
|
+
title: r("signatureRequest.requiredLinkSentTitle"),
|
|
870
|
+
description: r("signatureRequest.requiredLinkSentDescription")
|
|
871
|
+
} : {
|
|
872
|
+
title: r("signatureRequest.outcomeLinkSentTitle"),
|
|
873
|
+
description: r("signatureRequest.outcomeLinkSentDescription")
|
|
874
|
+
};
|
|
875
|
+
case "allSigned":
|
|
876
|
+
return {
|
|
877
|
+
title: r("signatureRequest.outcomeAllSignedTitle"),
|
|
878
|
+
description: r("signatureRequest.outcomeAllSignedDescription")
|
|
879
|
+
};
|
|
880
|
+
case "creditsExhausted":
|
|
881
|
+
return {
|
|
882
|
+
title: r("signatureRequest.outcomeCreditsTitle"),
|
|
883
|
+
description: r("signatureRequest.outcomeCreditsDescription")
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
function ni({
|
|
888
|
+
outcome: i
|
|
889
|
+
}) {
|
|
890
|
+
const r = i === "creditsExhausted";
|
|
891
|
+
return /* @__PURE__ */ n(
|
|
892
|
+
"div",
|
|
893
|
+
{
|
|
894
|
+
"data-outcome": i,
|
|
895
|
+
className: "ds:flex ds:justify-center ds:py-[var(--spacing-md)]",
|
|
896
|
+
children: /* @__PURE__ */ n(
|
|
897
|
+
"span",
|
|
898
|
+
{
|
|
899
|
+
"aria-hidden": "true",
|
|
900
|
+
className: r ? "ds:text-[color:var(--warning)]" : "ds:text-[color:var(--success)]",
|
|
901
|
+
children: r ? /* @__PURE__ */ n(ya, { className: "ds:size-[var(--icon-size-lg)]" }) : /* @__PURE__ */ n(wa, { className: "ds:size-[var(--icon-size-lg)]" })
|
|
902
|
+
}
|
|
903
|
+
)
|
|
904
|
+
}
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
const nn = [
|
|
908
|
+
"sms",
|
|
909
|
+
"email",
|
|
910
|
+
"whatsapp",
|
|
911
|
+
"on-device",
|
|
912
|
+
"qr"
|
|
913
|
+
], wt = "signature-request-batch-channel", os = {
|
|
914
|
+
anamnesis: "signatureRequest.secondSigneeUnavailableAnamnesis",
|
|
915
|
+
documents: "signatureRequest.secondSigneeUnavailableDocuments",
|
|
916
|
+
patient: "signatureRequest.secondSigneeUnavailablePatient",
|
|
917
|
+
channel: "signatureRequest.secondSigneeUnavailableChannel"
|
|
918
|
+
}, si = {
|
|
919
|
+
sameAsPrimary: "signatureRequest.secondSigneeSameAsPrimary",
|
|
920
|
+
unknownSignee: "signatureRequest.secondSigneeUnknown",
|
|
921
|
+
missingPhone: "signatureRequest.secondSigneeMissingPhone",
|
|
922
|
+
missingEmail: "signatureRequest.secondSigneeMissingEmail"
|
|
923
|
+
};
|
|
924
|
+
function ti(i, r, c) {
|
|
925
|
+
const l = i instanceof Date ? i : new Date(i);
|
|
926
|
+
if (Number.isNaN(l.getTime())) return null;
|
|
927
|
+
const g = { hour: "2-digit", minute: "2-digit" };
|
|
928
|
+
return l.toDateString() === (/* @__PURE__ */ new Date()).toDateString() ? c("signatureRequest.qrExpiresAt", {
|
|
929
|
+
time: new Intl.DateTimeFormat(r, g).format(l)
|
|
930
|
+
}) : c("signatureRequest.qrExpiresOn", {
|
|
931
|
+
dateTime: new Intl.DateTimeFormat(r, {
|
|
932
|
+
day: "numeric",
|
|
933
|
+
month: "short",
|
|
934
|
+
year: "numeric",
|
|
935
|
+
...g
|
|
936
|
+
}).format(l)
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
function sn(i, r) {
|
|
940
|
+
var c;
|
|
941
|
+
return ((c = i.find((l) => l.value === r)) == null ? void 0 : c.label) ?? "";
|
|
942
|
+
}
|
|
943
|
+
const ai = ga(
|
|
944
|
+
({
|
|
945
|
+
open: i,
|
|
946
|
+
onOpenChange: r,
|
|
947
|
+
operators: c,
|
|
948
|
+
signerOptions: l,
|
|
949
|
+
currentOperatorId: g,
|
|
950
|
+
allowAssignLater: I = !0,
|
|
951
|
+
requireOperator: _ = !0,
|
|
952
|
+
requirePatient: $ = !0,
|
|
953
|
+
initialOperatorId: b,
|
|
954
|
+
initialOperatorChannel: X,
|
|
955
|
+
initialSigners: D,
|
|
956
|
+
maxSigners: fe = 2,
|
|
957
|
+
channelMode: ve = "perSigner",
|
|
958
|
+
initialBatchChannel: De,
|
|
959
|
+
busy: k = !1,
|
|
960
|
+
error: re,
|
|
961
|
+
title: Me,
|
|
962
|
+
description: Le,
|
|
963
|
+
onRequestSignature: be,
|
|
964
|
+
qrCodes: U,
|
|
965
|
+
qrPending: $e = !1,
|
|
966
|
+
onQrDone: he,
|
|
967
|
+
signatures: xe,
|
|
968
|
+
signaturesLoading: Re = !1,
|
|
969
|
+
showLegalLevel: C = !0,
|
|
970
|
+
onViewSignature: me,
|
|
971
|
+
onDownloadSignature: A,
|
|
972
|
+
onShareSignature: v,
|
|
973
|
+
signatureShareTargets: y,
|
|
974
|
+
onDeleteSignature: W,
|
|
975
|
+
resolveChannels: f,
|
|
976
|
+
requiredItems: ee,
|
|
977
|
+
requiredItemsLoading: P = !1,
|
|
978
|
+
showOperatorChannels: we = !1,
|
|
979
|
+
outcome: J,
|
|
980
|
+
onBuyMoreSignatures: Se,
|
|
981
|
+
onOutcomeCancel: Y,
|
|
982
|
+
onAddSignee: ds,
|
|
983
|
+
contentProps: $t
|
|
984
|
+
}, zt) => {
|
|
985
|
+
var et, nt, st, tt, at, it;
|
|
986
|
+
const { t: d, i18n: Pn } = fn(), bn = ge(0), us = ge(null), ze = ge(null), _n = j(), hs = j(), ms = j(), ps = j(), gs = j(), Ft = j(), fs = j(), Ht = j(), vs = j(), xn = j(), x = ee !== void 0 || P, B = ee ? Ba(ee) : [], ne = _ && !x, Ne = $ || x, N = ve === "batch", Rn = (e) => {
|
|
987
|
+
var s;
|
|
988
|
+
return ((s = l.find((t) => t.value === e)) == null ? void 0 : s.isPatient) === !0;
|
|
989
|
+
}, bs = (e, s) => {
|
|
990
|
+
var a, u;
|
|
991
|
+
return x ? Tn({
|
|
992
|
+
items: B,
|
|
993
|
+
channel: N ? s : ((a = e[0]) == null ? void 0 : a.channel) ?? s,
|
|
994
|
+
primaryIsPatient: Rn((u = e[0]) == null ? void 0 : u.signerId)
|
|
995
|
+
}) === null ? Math.min(fe, 2) : 1 : fe;
|
|
996
|
+
}, [jt, Dn] = M(!1), [Ut, Wt] = M(J);
|
|
997
|
+
J !== Ut && (Wt(J), Dn(!1));
|
|
998
|
+
const le = (jt ? void 0 : J) ?? (ee !== void 0 && !P && B.length === 0 ? "allSigned" : void 0), an = le ? ei(le, d, { required: x }) : null, rn = (e) => {
|
|
999
|
+
var s;
|
|
1000
|
+
return new Map(
|
|
1001
|
+
(((s = l.find((t) => t.value === e)) == null ? void 0 : s.unavailableChannels) ?? []).map(({ channel: t, reason: a }) => [t, a])
|
|
1002
|
+
);
|
|
1003
|
+
}, Mn = (e, s) => {
|
|
1004
|
+
var p;
|
|
1005
|
+
const t = (p = l.find(
|
|
1006
|
+
(m) => m.value === e
|
|
1007
|
+
)) == null ? void 0 : p.availableChannels, a = t && t.length > 0 ? nn.filter((m) => t.includes(m)) : nn;
|
|
1008
|
+
if (!s) return a;
|
|
1009
|
+
const u = rn(e), o = a.filter((m) => s.includes(m));
|
|
1010
|
+
return o.some((m) => !u.has(m)) ? o : a;
|
|
1011
|
+
}, ln = (e, s) => {
|
|
1012
|
+
const t = rn(e);
|
|
1013
|
+
return Mn(e, s).filter(
|
|
1014
|
+
(a) => !t.has(a)
|
|
1015
|
+
);
|
|
1016
|
+
}, xs = (e) => {
|
|
1017
|
+
const s = e == null ? void 0 : e.operatorAvailableChannels;
|
|
1018
|
+
return s && s.length > 0 ? En.filter((t) => s.includes(t)) : En;
|
|
1019
|
+
}, Nn = (e, s) => {
|
|
1020
|
+
const t = ln(e);
|
|
1021
|
+
return t.includes(s) ? s : t[0] ?? s;
|
|
1022
|
+
}, Fe = l.find(
|
|
1023
|
+
(e) => e.isPatient === !0
|
|
1024
|
+
), Rs = (e) => e === void 0 ? [] : Fe && Fe.value !== e ? [e, Fe.value] : [e], Ln = (e) => {
|
|
1025
|
+
const s = Rs(e), t = /* @__PURE__ */ new Map();
|
|
1026
|
+
for (const a of nn) {
|
|
1027
|
+
if (a === "on-device" || s.some((o) => ln(o).includes(a))) continue;
|
|
1028
|
+
const u = s.map((o) => rn(o).get(a)).find((o) => o !== void 0);
|
|
1029
|
+
u !== void 0 && t.set(a, u);
|
|
1030
|
+
}
|
|
1031
|
+
return t;
|
|
1032
|
+
}, Ns = (e, s) => {
|
|
1033
|
+
if (e === void 0) return nn;
|
|
1034
|
+
const t = Rs(e), a = nn.filter(
|
|
1035
|
+
(m) => t.some((R) => Mn(R).includes(m))
|
|
1036
|
+
), u = Ln(e), o = s ? a.filter((m) => s.includes(m)) : a, p = o.some((m) => !u.has(m)) ? o : a;
|
|
1037
|
+
return nn.filter(
|
|
1038
|
+
(m) => m === "on-device" || p.includes(m)
|
|
1039
|
+
);
|
|
1040
|
+
}, on = (e, s) => {
|
|
1041
|
+
const t = Ln(e);
|
|
1042
|
+
return Ns(e, s).filter(
|
|
1043
|
+
(a) => !t.has(a)
|
|
1044
|
+
);
|
|
1045
|
+
}, qs = (e, s = !0) => {
|
|
1046
|
+
const t = on(e), a = (s ? De : void 0) ?? (Rn(e) && t.includes("sms") ? "sms" : "email");
|
|
1047
|
+
return t.includes(a) ? a : t[0];
|
|
1048
|
+
}, Cs = (et = c.find(
|
|
1049
|
+
(e) => e.disabled !== !0 && e.deleted !== !0
|
|
1050
|
+
)) == null ? void 0 : et.value, ys = (e) => e === null ? I ? Q : Cs ?? Q : e ?? Cs ?? (I ? Q : ""), Bt = () => ys(b), Gt = () => (D && D.length > 0 ? D : l.length > 0 ? [
|
|
1051
|
+
{
|
|
1052
|
+
signerId: l[0].value,
|
|
1053
|
+
channel: Nn(l[0].value, "on-device")
|
|
1054
|
+
}
|
|
1055
|
+
] : []).map((s) => {
|
|
1056
|
+
const t = Nn(s.signerId, s.channel), { skipOtp: a, ...u } = s;
|
|
1057
|
+
return {
|
|
1058
|
+
...u,
|
|
1059
|
+
channel: t,
|
|
1060
|
+
...t === "on-device" && a !== void 0 ? { skipOtp: a } : {},
|
|
1061
|
+
rowId: bn.current++
|
|
1062
|
+
};
|
|
1063
|
+
}), se = (e, s = !0) => {
|
|
1064
|
+
var a;
|
|
1065
|
+
const t = ((a = c.find((u) => u.value === e)) == null ? void 0 : a.defaultChannel) ?? "email";
|
|
1066
|
+
return t === "on-device" && !s ? "email" : t;
|
|
1067
|
+
}, ws = (e, s) => X === "on-device" ? s ? "on-device" : se(e, !1) : X ?? se(e, s), Ss = (e, s, t) => {
|
|
1068
|
+
const a = xs(e), u = e.operatorChannel ?? t, o = se(s);
|
|
1069
|
+
return a.includes(u) ? u : a.includes(o) ? o : a[0];
|
|
1070
|
+
}, $n = (e, s, t, a, u = "on-device") => {
|
|
1071
|
+
const o = ne && e !== Q && e !== "", p = x ? t.slice(0, bs(t, u)) : t, m = {};
|
|
1072
|
+
if (Ne)
|
|
1073
|
+
for (const R of p) {
|
|
1074
|
+
const L = [...rn(R.signerId).keys()];
|
|
1075
|
+
L.length > 0 && (m[R.signerId] = L);
|
|
1076
|
+
}
|
|
1077
|
+
return {
|
|
1078
|
+
operatorId: o ? e : null,
|
|
1079
|
+
operatorChannel: o ? s : null,
|
|
1080
|
+
signers: Ne ? p.map(
|
|
1081
|
+
({ rowId: R, ...L }) => N ? { signerId: L.signerId, channel: u } : L
|
|
1082
|
+
) : [],
|
|
1083
|
+
changed: a,
|
|
1084
|
+
...Object.keys(m).length > 0 ? { signerUnavailableChannels: m } : {}
|
|
1085
|
+
};
|
|
1086
|
+
}, zn = (e, s, t, a, u) => {
|
|
1087
|
+
const o = $n(s, t, a, u), p = e(o), m = o.operatorChannel === null ? t : Ss(p, s, t), R = o.signers.length, L = a.map((T, Ce) => {
|
|
1088
|
+
var ie, Je;
|
|
1089
|
+
if (Ce >= R) return T;
|
|
1090
|
+
const te = ln(
|
|
1091
|
+
T.signerId,
|
|
1092
|
+
(ie = p.signerAvailableChannels) == null ? void 0 : ie[T.signerId]
|
|
1093
|
+
), G = ((Je = p.signers.find((On) => On.signerId === T.signerId)) == null ? void 0 : Je.channel) ?? T.channel, ae = te.includes(G) ? G : te[0] ?? T.channel;
|
|
1094
|
+
return ae === T.channel ? T : { ...T, channel: ae, skipOtp: void 0 };
|
|
1095
|
+
});
|
|
1096
|
+
return { operatorChannel: m, rows: L };
|
|
1097
|
+
}, Is = (e, s, t, a = "", u = "email") => {
|
|
1098
|
+
var T, Ce, te;
|
|
1099
|
+
const o = (T = e[0]) == null ? void 0 : T.signerId;
|
|
1100
|
+
if (!f) {
|
|
1101
|
+
const G = on(o);
|
|
1102
|
+
return {
|
|
1103
|
+
batch: G.includes(s) ? s : G[0],
|
|
1104
|
+
operatorChannel: u
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
const p = $n(a, u, e, t, s), m = f(p), R = on(
|
|
1108
|
+
o,
|
|
1109
|
+
o === void 0 || (Ce = m.signerAvailableChannels) == null ? void 0 : Ce[o]
|
|
1110
|
+
), L = ((te = m.signers.find((G) => G.signerId === o)) == null ? void 0 : te.channel) ?? s;
|
|
1111
|
+
return {
|
|
1112
|
+
batch: R.includes(L) ? L : R.includes(s) ? s : R[0],
|
|
1113
|
+
operatorChannel: p.operatorChannel === null ? u : Ss(m, a, u)
|
|
1114
|
+
};
|
|
1115
|
+
}, ks = () => {
|
|
1116
|
+
var u, o;
|
|
1117
|
+
const e = Bt(), s = Gt();
|
|
1118
|
+
if (N) {
|
|
1119
|
+
const p = Is(
|
|
1120
|
+
s,
|
|
1121
|
+
qs((u = s[0]) == null ? void 0 : u.signerId),
|
|
1122
|
+
null,
|
|
1123
|
+
e,
|
|
1124
|
+
X ?? se(e)
|
|
1125
|
+
);
|
|
1126
|
+
return {
|
|
1127
|
+
operator: e,
|
|
1128
|
+
rows: s,
|
|
1129
|
+
// Required documents mode has no operator row: nothing reads it.
|
|
1130
|
+
operatorChannel: f ? p.operatorChannel : ws(
|
|
1131
|
+
e,
|
|
1132
|
+
s.length > 0 && p.batch === "on-device"
|
|
1133
|
+
),
|
|
1134
|
+
batchChannel: p.batch,
|
|
1135
|
+
otpOverride: ((o = D == null ? void 0 : D[0]) == null ? void 0 : o.skipOtp) ?? null
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
const t = { batchChannel: "on-device", otpOverride: null };
|
|
1139
|
+
if (!f)
|
|
1140
|
+
return {
|
|
1141
|
+
operator: e,
|
|
1142
|
+
rows: s,
|
|
1143
|
+
operatorChannel: ws(
|
|
1144
|
+
e,
|
|
1145
|
+
s.some((p) => p.channel === "on-device")
|
|
1146
|
+
),
|
|
1147
|
+
...t
|
|
1148
|
+
};
|
|
1149
|
+
const a = zn(
|
|
1150
|
+
f,
|
|
1151
|
+
e,
|
|
1152
|
+
X ?? se(e),
|
|
1153
|
+
s,
|
|
1154
|
+
null
|
|
1155
|
+
);
|
|
1156
|
+
return {
|
|
1157
|
+
operator: e,
|
|
1158
|
+
rows: a.rows,
|
|
1159
|
+
operatorChannel: a.operatorChannel,
|
|
1160
|
+
...t
|
|
1161
|
+
};
|
|
1162
|
+
}, [cn] = M(ks), [z, Fn] = M(cn.operator), [q, pe] = M(cn.rows), [Z, qe] = M(
|
|
1163
|
+
cn.operatorChannel
|
|
1164
|
+
), [O, Os] = M(
|
|
1165
|
+
cn.batchChannel
|
|
1166
|
+
), [Vt, Hn] = M(
|
|
1167
|
+
cn.otpOverride
|
|
1168
|
+
), Ts = bs(q, O), w = x ? q.slice(0, Ts) : q, [Qt, jn] = M({}), He = {};
|
|
1169
|
+
for (const e of B)
|
|
1170
|
+
_e(e) && (He[e.id] = Qt[e.id] ?? ys(
|
|
1171
|
+
e.initialOperatorId !== void 0 ? e.initialOperatorId : b
|
|
1172
|
+
));
|
|
1173
|
+
const [Kt, Un] = M({}), Wn = {};
|
|
1174
|
+
for (const e of B) {
|
|
1175
|
+
const s = He[e.id];
|
|
1176
|
+
s === void 0 || s === Q || s === "" || (Wn[e.id] = Kt[e.id] ?? se(s));
|
|
1177
|
+
}
|
|
1178
|
+
const Es = (e) => {
|
|
1179
|
+
e.length !== 0 && Un(
|
|
1180
|
+
(s) => Object.fromEntries(
|
|
1181
|
+
Object.entries(s).filter(([t]) => !e.includes(t))
|
|
1182
|
+
)
|
|
1183
|
+
);
|
|
1184
|
+
}, Xt = (e, s) => {
|
|
1185
|
+
He[e] !== s && Es([e]), jn((t) => ({ ...t, [e]: s }));
|
|
1186
|
+
}, Yt = () => {
|
|
1187
|
+
g !== void 0 && (Es(
|
|
1188
|
+
B.filter(
|
|
1189
|
+
(e) => _e(e) && He[e.id] !== g
|
|
1190
|
+
).map((e) => e.id)
|
|
1191
|
+
), jn((e) => {
|
|
1192
|
+
const s = { ...e };
|
|
1193
|
+
for (const t of B)
|
|
1194
|
+
_e(t) && (s[t.id] = g);
|
|
1195
|
+
return s;
|
|
1196
|
+
}));
|
|
1197
|
+
}, [As, oe] = M(null), [Jt, je] = M(
|
|
1198
|
+
null
|
|
1199
|
+
), [Zt, Bn] = M(!1), [ea, qn] = M(0), Gn = !x && (xe !== void 0 || Re), [na, sa] = M(i);
|
|
1200
|
+
i !== na && (sa(i), i && (Bn(!1), qn(0), Dn(!1)));
|
|
1201
|
+
const Ps = ge(i);
|
|
1202
|
+
Ee(() => {
|
|
1203
|
+
if (i && !Ps.current) {
|
|
1204
|
+
const e = ks();
|
|
1205
|
+
Fn(e.operator), pe(e.rows), qe(e.operatorChannel), Os(e.batchChannel), Hn(e.otpOverride), oe(null), je(null), jn({}), Un({});
|
|
1206
|
+
}
|
|
1207
|
+
Ps.current = i;
|
|
1208
|
+
}, [i]);
|
|
1209
|
+
const Vn = (e) => ln(e).length === 0, Ue = N ? w.length > 0 && O === "on-device" : w.some(
|
|
1210
|
+
(e) => e.channel === "on-device" && !Vn(e.signerId)
|
|
1211
|
+
), Cn = f !== void 0;
|
|
1212
|
+
Ee(() => {
|
|
1213
|
+
if (!(Cn || !ne) && Z === "on-device" && !Ue) {
|
|
1214
|
+
const e = se(z, !1);
|
|
1215
|
+
qe(e), oe(e);
|
|
1216
|
+
}
|
|
1217
|
+
}, [Z, Ue, z, Cn, ne]);
|
|
1218
|
+
const _s = I ? [{ value: Q, label: d("signatureRequest.assignLater") }] : [], Ds = c.map(
|
|
1219
|
+
({ value: e, label: s, disabled: t, reason: a, deleted: u }) => ({
|
|
1220
|
+
value: e,
|
|
1221
|
+
label: s,
|
|
1222
|
+
...t === !0 ? { disabled: !0, ...a ? { description: a } : {} } : {},
|
|
1223
|
+
...u === !0 ? { deleted: !0 } : {}
|
|
1224
|
+
})
|
|
1225
|
+
), yn = x ? [..._s, ...Ds] : [...Ds, ..._s], Qn = Lt(yn, Pn.language), Ms = j(), We = z === Q, ce = cs(), de = f ? f(
|
|
1226
|
+
$n(z, Z, q, null, O)
|
|
1227
|
+
) : void 0, Ie = (e, s, t, a, u = []) => {
|
|
1228
|
+
if (!f) return;
|
|
1229
|
+
if (N) {
|
|
1230
|
+
Be(t, O, {
|
|
1231
|
+
operatorId: e,
|
|
1232
|
+
opChannel: s,
|
|
1233
|
+
changed: a
|
|
1234
|
+
});
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1237
|
+
const o = zn(
|
|
1238
|
+
f,
|
|
1239
|
+
e,
|
|
1240
|
+
s,
|
|
1241
|
+
t,
|
|
1242
|
+
a
|
|
1243
|
+
);
|
|
1244
|
+
qe(o.operatorChannel), pe(o.rows), oe(null);
|
|
1245
|
+
const p = [];
|
|
1246
|
+
ne && e !== Q && e !== "" && o.operatorChannel !== s && p.push(
|
|
1247
|
+
d("signatureRequest.operatorChannelChanged", {
|
|
1248
|
+
channel: ce[o.operatorChannel].label
|
|
1249
|
+
})
|
|
1250
|
+
), o.rows.forEach((R, L) => {
|
|
1251
|
+
R.channel !== t[L].channel && p.push(
|
|
1252
|
+
d("signatureRequest.signerChannelChanged", {
|
|
1253
|
+
name: sn(l, R.signerId),
|
|
1254
|
+
channel: ce[R.channel].label
|
|
1255
|
+
})
|
|
1256
|
+
);
|
|
1257
|
+
}), p.push(...u), je(p.length > 0 ? p.join(" ") : null);
|
|
1258
|
+
}, Be = (e, s, {
|
|
1259
|
+
primaryChanged: t = !1,
|
|
1260
|
+
userChannel: a = !1,
|
|
1261
|
+
operatorId: u = z,
|
|
1262
|
+
opChannel: o = Z,
|
|
1263
|
+
changed: p = "signers"
|
|
1264
|
+
} = {}) => {
|
|
1265
|
+
var te, G, ae;
|
|
1266
|
+
const m = Is(
|
|
1267
|
+
e,
|
|
1268
|
+
t ? qs((te = e[0]) == null ? void 0 : te.signerId, !1) : s,
|
|
1269
|
+
p,
|
|
1270
|
+
u,
|
|
1271
|
+
o
|
|
1272
|
+
), R = m.batch, L = x && e.length > 1 && t, T = [];
|
|
1273
|
+
if (ne && u !== Q && u !== "" && m.operatorChannel !== o && T.push(
|
|
1274
|
+
d("signatureRequest.operatorChannelChanged", {
|
|
1275
|
+
channel: ce[m.operatorChannel].label
|
|
1276
|
+
})
|
|
1277
|
+
), R !== (a ? s : O) && T.push(
|
|
1278
|
+
d("signatureRequest.signerChannelChanged", {
|
|
1279
|
+
name: sn(l, ((G = e[0]) == null ? void 0 : G.signerId) ?? ""),
|
|
1280
|
+
channel: ce[R].label
|
|
1281
|
+
})
|
|
1282
|
+
), x && w.length > 1) {
|
|
1283
|
+
const ie = Tn({
|
|
1284
|
+
items: B,
|
|
1285
|
+
channel: R,
|
|
1286
|
+
primaryIsPatient: Rn((ae = e[0]) == null ? void 0 : ae.signerId)
|
|
1287
|
+
});
|
|
1288
|
+
L ? T.push(d("signatureRequest.secondSigneeCleared")) : ie !== null && e.length > 1 && T.push(d(os[ie]));
|
|
1289
|
+
}
|
|
1290
|
+
pe(L ? e.slice(0, 1) : e), ne && qe(m.operatorChannel), R !== O && Hn(null), Os(R), oe(null), je(T.length > 0 ? T.join(" ") : null);
|
|
1291
|
+
}, Ls = on(
|
|
1292
|
+
(nt = q[0]) == null ? void 0 : nt.signerId,
|
|
1293
|
+
q[0] === void 0 || (st = de == null ? void 0 : de.signerAvailableChannels) == null ? void 0 : st[q[0].signerId]
|
|
1294
|
+
);
|
|
1295
|
+
N && !Ls.includes(O) && Be(q, Ls[0]);
|
|
1296
|
+
const Kn = N ? q : q.map((e) => {
|
|
1297
|
+
const s = ln(e.signerId);
|
|
1298
|
+
return s.length === 0 || s.includes(e.channel) ? e : { ...e, channel: s[0], skipOtp: void 0 };
|
|
1299
|
+
});
|
|
1300
|
+
if (Kn.some((e, s) => e !== q[s])) {
|
|
1301
|
+
const e = f ? zn(
|
|
1302
|
+
f,
|
|
1303
|
+
z,
|
|
1304
|
+
Z,
|
|
1305
|
+
Kn,
|
|
1306
|
+
"signers"
|
|
1307
|
+
) : { operatorChannel: Z, rows: Kn };
|
|
1308
|
+
pe(e.rows), qe(e.operatorChannel), oe(null);
|
|
1309
|
+
const s = e.rows.filter((t, a) => t.channel !== q[a].channel).map(
|
|
1310
|
+
(t) => d("signatureRequest.signerChannelChanged", {
|
|
1311
|
+
name: sn(l, t.signerId),
|
|
1312
|
+
channel: ce[t.channel].label
|
|
1313
|
+
})
|
|
1314
|
+
);
|
|
1315
|
+
je(s.length > 0 ? s.join(" ") : null);
|
|
1316
|
+
}
|
|
1317
|
+
const Ge = (e, s) => ({
|
|
1318
|
+
value: e,
|
|
1319
|
+
label: ce[s].label,
|
|
1320
|
+
startAdornment: ce[s].icon
|
|
1321
|
+
}), wn = Cn || Ue ? void 0 : d("signatureRequest.onDeviceUnavailableHint"), $s = Cn ? xs(de).map(
|
|
1322
|
+
(e) => Ge(e, e)
|
|
1323
|
+
) : [
|
|
1324
|
+
Ge("sms", "sms"),
|
|
1325
|
+
Ge("email", "email"),
|
|
1326
|
+
{
|
|
1327
|
+
...Ge("on-device", "on-device"),
|
|
1328
|
+
disabled: !Ue,
|
|
1329
|
+
description: wn
|
|
1330
|
+
}
|
|
1331
|
+
], zs = /* @__PURE__ */ n(At, { meta: ce }), Fs = w.map((e) => e.signerId), Ve = l.find(
|
|
1332
|
+
(e) => !Fs.includes(e.value) && !(x && e.isPatient === !0)
|
|
1333
|
+
), ta = !k && w.length < Ts && Ve !== void 0, ke = x || N ? (tt = w[0]) == null ? void 0 : tt.signerId : void 0, Xn = Rn(ke), aa = N ? O : ((at = w[0]) == null ? void 0 : at.channel) ?? O, Hs = x ? Tn({
|
|
1334
|
+
items: B,
|
|
1335
|
+
channel: aa,
|
|
1336
|
+
primaryIsPatient: Xn
|
|
1337
|
+
}) : null, Yn = x && !P && B.length > 0 && Hs !== null && l.length > 1 ? d(os[Hs]) : null, Sn = x && w.length > 1 ? Va({
|
|
1338
|
+
primaryId: ke,
|
|
1339
|
+
secondId: w[1].signerId,
|
|
1340
|
+
channel: N ? O : w[1].channel,
|
|
1341
|
+
options: l
|
|
1342
|
+
}) : null, Jn = on(
|
|
1343
|
+
(Fe == null ? void 0 : Fe.value) ?? ke
|
|
1344
|
+
).includes("sms"), Qe = (x || N) && Xn && !Jn, Zn = N && O === "on-device" && (Qe || (Vt ?? !Jn)), ia = N && w.length > 0 && (Qe || Zn), es = (e) => x && e === 0, ns = (e, s) => e.channel === "on-device" && (es(s) ? Qe || (e.skipOtp ?? !Jn) : e.skipOtp === !0), In = Ne && !(x && P), ra = (e, s) => {
|
|
1345
|
+
pe(
|
|
1346
|
+
(t) => t.map(
|
|
1347
|
+
(a) => a.rowId === e ? { ...a, ...s } : a
|
|
1348
|
+
)
|
|
1349
|
+
);
|
|
1350
|
+
}, la = () => {
|
|
1351
|
+
if (!Ve) return;
|
|
1352
|
+
if (N) {
|
|
1353
|
+
Be(
|
|
1354
|
+
[
|
|
1355
|
+
...q,
|
|
1356
|
+
{
|
|
1357
|
+
signerId: Ve.value,
|
|
1358
|
+
channel: O,
|
|
1359
|
+
rowId: bn.current++
|
|
1360
|
+
}
|
|
1361
|
+
],
|
|
1362
|
+
O
|
|
1363
|
+
);
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1366
|
+
const e = Nn(
|
|
1367
|
+
Ve.value,
|
|
1368
|
+
x ? "on-device" : "sms"
|
|
1369
|
+
);
|
|
1370
|
+
if (f) {
|
|
1371
|
+
Ie(
|
|
1372
|
+
z,
|
|
1373
|
+
Z,
|
|
1374
|
+
[
|
|
1375
|
+
...q,
|
|
1376
|
+
{
|
|
1377
|
+
signerId: Ve.value,
|
|
1378
|
+
channel: e,
|
|
1379
|
+
rowId: bn.current++
|
|
1380
|
+
}
|
|
1381
|
+
],
|
|
1382
|
+
"signers"
|
|
1383
|
+
);
|
|
1384
|
+
return;
|
|
1385
|
+
}
|
|
1386
|
+
pe((s) => [
|
|
1387
|
+
...s,
|
|
1388
|
+
{
|
|
1389
|
+
signerId: Ve.value,
|
|
1390
|
+
channel: e,
|
|
1391
|
+
rowId: bn.current++
|
|
1392
|
+
}
|
|
1393
|
+
]);
|
|
1394
|
+
}, oa = (e) => {
|
|
1395
|
+
var s;
|
|
1396
|
+
if ((s = us.current) == null || s.focus(), N) {
|
|
1397
|
+
Be(
|
|
1398
|
+
q.filter((t) => t.rowId !== e),
|
|
1399
|
+
O
|
|
1400
|
+
);
|
|
1401
|
+
return;
|
|
1402
|
+
}
|
|
1403
|
+
if (f) {
|
|
1404
|
+
Ie(
|
|
1405
|
+
z,
|
|
1406
|
+
Z,
|
|
1407
|
+
q.filter((t) => t.rowId !== e),
|
|
1408
|
+
"signers"
|
|
1409
|
+
);
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
pe(
|
|
1413
|
+
(t) => t.filter((a) => a.rowId !== e)
|
|
1414
|
+
);
|
|
1415
|
+
}, js = Ne && !N && w.some((e) => Vn(e.signerId)), Us = Ne && (N ? w.length > 0 && O === "qr" : w.some((e) => e.channel === "qr")), Ws = !N && w.some(
|
|
1416
|
+
(e, s) => ns(e, s) && !Vn(e.signerId)
|
|
1417
|
+
), ss = (e) => new Intl.ListFormat(Pn.language || "en", { type: "unit" }).format(
|
|
1418
|
+
e
|
|
1419
|
+
), Bs = (e, s) => e.map((t) => {
|
|
1420
|
+
const a = s.get(t);
|
|
1421
|
+
return a === void 0 ? Ge(t, t) : {
|
|
1422
|
+
...Ge(t, t),
|
|
1423
|
+
disabled: !0,
|
|
1424
|
+
description: a
|
|
1425
|
+
};
|
|
1426
|
+
}), Gs = (e, s, t) => {
|
|
1427
|
+
const a = /* @__PURE__ */ new Map();
|
|
1428
|
+
for (const u of e) {
|
|
1429
|
+
const o = s.get(u);
|
|
1430
|
+
o !== void 0 && a.set(o, [
|
|
1431
|
+
...a.get(o) ?? [],
|
|
1432
|
+
ce[u].label
|
|
1433
|
+
]);
|
|
1434
|
+
}
|
|
1435
|
+
if (a.size !== 0)
|
|
1436
|
+
return ss(t ? [...a.keys()] : [...a].map(
|
|
1437
|
+
([u, o]) => `${ss(o)} (${u})`
|
|
1438
|
+
));
|
|
1439
|
+
}, Vs = Ns(
|
|
1440
|
+
ke,
|
|
1441
|
+
ke === void 0 || (it = de == null ? void 0 : de.signerAvailableChannels) == null ? void 0 : it[ke]
|
|
1442
|
+
), Qs = Ln(ke), Ks = Bs(
|
|
1443
|
+
Vs,
|
|
1444
|
+
Qs
|
|
1445
|
+
), ts = Gs(
|
|
1446
|
+
Vs,
|
|
1447
|
+
Qs,
|
|
1448
|
+
!1
|
|
1449
|
+
), ca = () => {
|
|
1450
|
+
var t;
|
|
1451
|
+
if (js || Sn !== null) return;
|
|
1452
|
+
Bn(Us), Us && ((t = ze.current) == null || t.focus(), qn(0));
|
|
1453
|
+
const e = w.map(
|
|
1454
|
+
({ rowId: a, ...u }, o) => N ? {
|
|
1455
|
+
signerId: u.signerId,
|
|
1456
|
+
channel: O,
|
|
1457
|
+
// The batch's OTP waiver rides on the main signer.
|
|
1458
|
+
...o === 0 && O === "on-device" ? { skipOtp: Zn } : {}
|
|
1459
|
+
} : es(o) && u.channel === "on-device" ? { ...u, skipOtp: ns(u, o) } : u
|
|
1460
|
+
), s = N ? { signMode: O } : {};
|
|
1461
|
+
if (x) {
|
|
1462
|
+
const a = {};
|
|
1463
|
+
let u = null;
|
|
1464
|
+
for (const p of B) {
|
|
1465
|
+
if (!_e(p)) continue;
|
|
1466
|
+
const m = He[p.id], R = m === Q || m === "" || m === void 0 ? null : m;
|
|
1467
|
+
a[p.id] = R, u ?? (u = R);
|
|
1468
|
+
}
|
|
1469
|
+
const o = {};
|
|
1470
|
+
for (const [p, m] of Object.entries(
|
|
1471
|
+
a
|
|
1472
|
+
))
|
|
1473
|
+
m !== null && (o[p] = Wn[p]);
|
|
1474
|
+
be({
|
|
1475
|
+
operatorId: u,
|
|
1476
|
+
operatorChannel: null,
|
|
1477
|
+
signers: e,
|
|
1478
|
+
...s,
|
|
1479
|
+
operatorAssignments: a,
|
|
1480
|
+
...we ? { operatorChannels: o } : {},
|
|
1481
|
+
requiredItemIds: B.map((p) => p.id)
|
|
1482
|
+
});
|
|
1483
|
+
return;
|
|
1484
|
+
}
|
|
1485
|
+
be({
|
|
1486
|
+
operatorId: !_ || We ? null : z,
|
|
1487
|
+
operatorChannel: !_ || We ? null : Z,
|
|
1488
|
+
signers: $ ? e : [],
|
|
1489
|
+
...$ ? s : {}
|
|
1490
|
+
});
|
|
1491
|
+
};
|
|
1492
|
+
Ee(() => {
|
|
1493
|
+
re && Bn(!1);
|
|
1494
|
+
}, [re]);
|
|
1495
|
+
const Ke = ((U == null ? void 0 : U.length) ?? 0) > 0, Xe = Ke || !re && ($e || Zt), kn = Ne ? w.filter(
|
|
1496
|
+
(e) => (N ? O : e.channel) === "qr"
|
|
1497
|
+
).map((e) => e.signerId) : [];
|
|
1498
|
+
for (const e of U ?? [])
|
|
1499
|
+
kn.includes(e.signerId) || kn.push(e.signerId);
|
|
1500
|
+
const dn = kn.length, Oe = Math.min(ea, Math.max(dn - 1, 0)), Te = kn[Oe], Ye = Te === void 0 ? "" : sn(l, Te), un = U == null ? void 0 : U.find((e) => e.signerId === Te), Xs = un ? ti(un.expiresAt, Pn.language || "en", d) : null, da = Oe >= dn - 1, Ys = Ke && dn > 1, Js = i && Xe && !le ? `${Ke}:${Oe}` : null;
|
|
1501
|
+
Ee(() => {
|
|
1502
|
+
var e;
|
|
1503
|
+
Js !== null && ((e = ze.current) == null || e.focus());
|
|
1504
|
+
}, [Js]);
|
|
1505
|
+
const Zs = i && le ? le : null;
|
|
1506
|
+
Ee(() => {
|
|
1507
|
+
var e;
|
|
1508
|
+
Zs !== null && ((e = ze.current) == null || e.focus());
|
|
1509
|
+
}, [Zs]);
|
|
1510
|
+
const ua = Ke ? un ? Ye ? d("signatureRequest.qrCaptionNamed", { name: Ye }) : d("signatureRequest.qrCaption") : (
|
|
1511
|
+
// The error alert in the body carries the message (and announces
|
|
1512
|
+
// itself); the description only names whose slot this is.
|
|
1513
|
+
Ye || Te
|
|
1514
|
+
) : d("signatureRequest.qrPending");
|
|
1515
|
+
return /* @__PURE__ */ n("div", { ref: zt, className: "ds:contents", "data-component": "signature-request", children: /* @__PURE__ */ n(St, { children: /* @__PURE__ */ n(S, { open: i, onOpenChange: r, children: /* @__PURE__ */ h(
|
|
1516
|
+
S.Content,
|
|
1517
|
+
{
|
|
1518
|
+
size: "lg",
|
|
1519
|
+
scroll: "body",
|
|
1520
|
+
hideCloseButton: !0,
|
|
1521
|
+
onOpenAutoFocus: (e) => {
|
|
1522
|
+
var s;
|
|
1523
|
+
!Xe && !Gn && !le || (e.preventDefault(), (s = ze.current) == null || s.focus());
|
|
1524
|
+
},
|
|
1525
|
+
...$t,
|
|
1526
|
+
children: [
|
|
1527
|
+
/* @__PURE__ */ h(S.Header, { children: [
|
|
1528
|
+
/* @__PURE__ */ n(
|
|
1529
|
+
S.Title,
|
|
1530
|
+
{
|
|
1531
|
+
ref: ze,
|
|
1532
|
+
tabIndex: -1,
|
|
1533
|
+
"aria-describedby": an ? ms : Xe ? Ys ? `${_n} ${hs}` : _n : void 0,
|
|
1534
|
+
className: "ds:outline-none",
|
|
1535
|
+
children: an ? an.title : Xe ? d("signatureRequest.qrTitle") : Me ?? d(
|
|
1536
|
+
x ? "signatureRequest.requiredTitle" : "signatureRequest.title"
|
|
1537
|
+
)
|
|
1538
|
+
}
|
|
1539
|
+
),
|
|
1540
|
+
an ? /* @__PURE__ */ n(S.Description, { asChild: !0, children: /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n("p", { id: ms, children: an.description }) }) }) : Xe ? /* @__PURE__ */ n(S.Description, { asChild: !0, children: /* @__PURE__ */ n("div", { children: /* @__PURE__ */ h(
|
|
1541
|
+
"div",
|
|
1542
|
+
{
|
|
1543
|
+
id: _n,
|
|
1544
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
1545
|
+
children: [
|
|
1546
|
+
/* @__PURE__ */ n("p", { children: ua }),
|
|
1547
|
+
Xs ? /* @__PURE__ */ n("p", { children: Xs }) : null
|
|
1548
|
+
]
|
|
1549
|
+
}
|
|
1550
|
+
) }) }) : /* @__PURE__ */ n(S.Description, { children: Le ?? d(
|
|
1551
|
+
x ? "signatureRequest.requiredDescription" : Gn ? (
|
|
1552
|
+
// The table says whether there are signed
|
|
1553
|
+
// versions, so the header describes the form.
|
|
1554
|
+
"signatureRequest.requestDescription"
|
|
1555
|
+
) : "signatureRequest.noSignedVersions"
|
|
1556
|
+
) })
|
|
1557
|
+
] }),
|
|
1558
|
+
le ? /* @__PURE__ */ h(ye, { children: [
|
|
1559
|
+
/* @__PURE__ */ n(S.Body, { children: /* @__PURE__ */ n(ni, { outcome: le }) }),
|
|
1560
|
+
/* @__PURE__ */ h(S.Footer, { children: [
|
|
1561
|
+
le === "creditsExhausted" && Se ? /* @__PURE__ */ n(
|
|
1562
|
+
F,
|
|
1563
|
+
{
|
|
1564
|
+
intent: "primary",
|
|
1565
|
+
startIcon: /* @__PURE__ */ n(Pa, {}),
|
|
1566
|
+
onClick: Se,
|
|
1567
|
+
children: d("signatureRequest.buyMoreSignatures")
|
|
1568
|
+
}
|
|
1569
|
+
) : null,
|
|
1570
|
+
le === "creditsExhausted" && J === "creditsExhausted" && Y ? /* @__PURE__ */ n(
|
|
1571
|
+
F,
|
|
1572
|
+
{
|
|
1573
|
+
intent: "ghost",
|
|
1574
|
+
onClick: () => {
|
|
1575
|
+
var e;
|
|
1576
|
+
(e = ze.current) == null || e.focus(), Dn(!0), Y();
|
|
1577
|
+
},
|
|
1578
|
+
children: d("signatureRequest.outcomeCancel")
|
|
1579
|
+
}
|
|
1580
|
+
) : null,
|
|
1581
|
+
/* @__PURE__ */ n(S.Close, { asChild: !0, children: /* @__PURE__ */ n(F, { intent: "outline", children: d("signatureRequest.close") }) })
|
|
1582
|
+
] })
|
|
1583
|
+
] }) : Xe ? /* @__PURE__ */ h(ye, { children: [
|
|
1584
|
+
/* @__PURE__ */ n(S.Body, { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:text-center", children: Ke ? /* @__PURE__ */ h(ye, { children: [
|
|
1585
|
+
Ys ? (
|
|
1586
|
+
// Also describes the heading, so screen readers hear
|
|
1587
|
+
// the position when Previous or Next moves focus there.
|
|
1588
|
+
/* @__PURE__ */ n(
|
|
1589
|
+
"p",
|
|
1590
|
+
{
|
|
1591
|
+
id: hs,
|
|
1592
|
+
className: "type-label ds:text-[var(--muted-foreground)]",
|
|
1593
|
+
children: d("signatureRequest.qrStepCount", {
|
|
1594
|
+
current: Oe + 1,
|
|
1595
|
+
total: dn
|
|
1596
|
+
})
|
|
1597
|
+
}
|
|
1598
|
+
)
|
|
1599
|
+
) : null,
|
|
1600
|
+
Ye ? /* @__PURE__ */ n("p", { className: "type-title-item ds:break-words", children: Ye }) : null,
|
|
1601
|
+
un ? (
|
|
1602
|
+
// The QrCode's own name speaks of check-in, so the
|
|
1603
|
+
// pattern names the code and hides the inner figure.
|
|
1604
|
+
// `lg` keeps a long signing link at a module size a
|
|
1605
|
+
// phone camera can read off a desk monitor.
|
|
1606
|
+
/* @__PURE__ */ n(
|
|
1607
|
+
"div",
|
|
1608
|
+
{
|
|
1609
|
+
role: "img",
|
|
1610
|
+
"aria-label": d("signatureRequest.qrCodeLabel"),
|
|
1611
|
+
"data-signer-id": Te,
|
|
1612
|
+
children: /* @__PURE__ */ n(
|
|
1613
|
+
fa,
|
|
1614
|
+
{
|
|
1615
|
+
value: un.url,
|
|
1616
|
+
variant: "framed",
|
|
1617
|
+
size: "lg",
|
|
1618
|
+
decorative: !0
|
|
1619
|
+
}
|
|
1620
|
+
)
|
|
1621
|
+
}
|
|
1622
|
+
)
|
|
1623
|
+
) : /* @__PURE__ */ n(
|
|
1624
|
+
K,
|
|
1625
|
+
{
|
|
1626
|
+
variant: "error",
|
|
1627
|
+
className: "ds:text-start",
|
|
1628
|
+
"data-signer-id": Te,
|
|
1629
|
+
children: /* @__PURE__ */ n(K.Description, { children: d("signatureRequest.qrMissing", {
|
|
1630
|
+
name: Ye || Te
|
|
1631
|
+
}) })
|
|
1632
|
+
}
|
|
1633
|
+
)
|
|
1634
|
+
] }) : (
|
|
1635
|
+
// Waiting for the server: the spinner's status role
|
|
1636
|
+
// announces the wait politely.
|
|
1637
|
+
/* @__PURE__ */ n("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)] ds:py-[var(--spacing-xl)]", children: /* @__PURE__ */ n(
|
|
1638
|
+
va,
|
|
1639
|
+
{
|
|
1640
|
+
size: "lg",
|
|
1641
|
+
label: d("signatureRequest.qrPending")
|
|
1642
|
+
}
|
|
1643
|
+
) })
|
|
1644
|
+
) }),
|
|
1645
|
+
/* @__PURE__ */ n(S.Footer, { children: Ke ? /* @__PURE__ */ h(ye, { children: [
|
|
1646
|
+
dn > 1 ? /* @__PURE__ */ n(
|
|
1647
|
+
F,
|
|
1648
|
+
{
|
|
1649
|
+
intent: "outline",
|
|
1650
|
+
disabled: Oe === 0,
|
|
1651
|
+
onClick: () => qn(Oe - 1),
|
|
1652
|
+
children: d("signatureRequest.qrPrevious")
|
|
1653
|
+
}
|
|
1654
|
+
) : null,
|
|
1655
|
+
da ? /* @__PURE__ */ n(
|
|
1656
|
+
F,
|
|
1657
|
+
{
|
|
1658
|
+
intent: "primary",
|
|
1659
|
+
onClick: () => {
|
|
1660
|
+
he == null || he(), r(!1);
|
|
1661
|
+
},
|
|
1662
|
+
children: d("signatureRequest.qrDone")
|
|
1663
|
+
}
|
|
1664
|
+
) : /* @__PURE__ */ n(
|
|
1665
|
+
F,
|
|
1666
|
+
{
|
|
1667
|
+
intent: "primary",
|
|
1668
|
+
onClick: () => qn(Oe + 1),
|
|
1669
|
+
children: d("signatureRequest.qrNext")
|
|
1670
|
+
}
|
|
1671
|
+
)
|
|
1672
|
+
] }) : /* @__PURE__ */ n(S.Close, { asChild: !0, children: /* @__PURE__ */ n(F, { intent: "outline", children: d("signatureRequest.close") }) }) })
|
|
1673
|
+
] }) : /* @__PURE__ */ h(ye, { children: [
|
|
1674
|
+
/* @__PURE__ */ h(S.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
|
|
1675
|
+
Gn ? /* @__PURE__ */ h(ye, { children: [
|
|
1676
|
+
/* @__PURE__ */ n(
|
|
1677
|
+
Ua,
|
|
1678
|
+
{
|
|
1679
|
+
signatures: xe,
|
|
1680
|
+
loading: Re,
|
|
1681
|
+
showLegalLevel: C,
|
|
1682
|
+
onView: me,
|
|
1683
|
+
onDownload: A,
|
|
1684
|
+
onShare: v,
|
|
1685
|
+
shareTargets: y,
|
|
1686
|
+
onDelete: W
|
|
1687
|
+
}
|
|
1688
|
+
),
|
|
1689
|
+
ne || In ? /* @__PURE__ */ n(dt, { decorative: !0 }) : null
|
|
1690
|
+
] }) : null,
|
|
1691
|
+
x ? /* @__PURE__ */ n(
|
|
1692
|
+
Za,
|
|
1693
|
+
{
|
|
1694
|
+
items: B,
|
|
1695
|
+
loading: P,
|
|
1696
|
+
operatorOptions: yn,
|
|
1697
|
+
assignments: He,
|
|
1698
|
+
onAssign: Xt,
|
|
1699
|
+
showOperatorChannels: we,
|
|
1700
|
+
operatorChannels: Wn,
|
|
1701
|
+
onOperatorChannel: (e, s) => Un((t) => ({
|
|
1702
|
+
...t,
|
|
1703
|
+
[e]: s
|
|
1704
|
+
})),
|
|
1705
|
+
onAssignAllToMe: g !== void 0 ? Yt : void 0,
|
|
1706
|
+
busy: k
|
|
1707
|
+
}
|
|
1708
|
+
) : null,
|
|
1709
|
+
ne ? /* @__PURE__ */ h(
|
|
1710
|
+
"section",
|
|
1711
|
+
{
|
|
1712
|
+
className: `${pn} ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start`,
|
|
1713
|
+
children: [
|
|
1714
|
+
/* @__PURE__ */ n("div", { className: ue, children: /* @__PURE__ */ h("div", { className: An, children: [
|
|
1715
|
+
/* @__PURE__ */ n("p", { className: "type-eyebrow ds:text-[color:var(--muted-foreground)]", children: d("signatureRequest.operatorSection") }),
|
|
1716
|
+
g !== void 0 ? /* @__PURE__ */ n(
|
|
1717
|
+
F,
|
|
1718
|
+
{
|
|
1719
|
+
intent: "outline",
|
|
1720
|
+
size: "sm",
|
|
1721
|
+
startIcon: /* @__PURE__ */ n(Tt, {}),
|
|
1722
|
+
disabled: k,
|
|
1723
|
+
onClick: () => {
|
|
1724
|
+
if (Fn(g), f) {
|
|
1725
|
+
Ie(
|
|
1726
|
+
g,
|
|
1727
|
+
se(g),
|
|
1728
|
+
q,
|
|
1729
|
+
"operator"
|
|
1730
|
+
);
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
qe(
|
|
1734
|
+
se(
|
|
1735
|
+
g,
|
|
1736
|
+
Ue
|
|
1737
|
+
)
|
|
1738
|
+
), oe(null);
|
|
1739
|
+
},
|
|
1740
|
+
children: d("signatureRequest.assignToMe")
|
|
1741
|
+
}
|
|
1742
|
+
) : null
|
|
1743
|
+
] }) }),
|
|
1744
|
+
/* @__PURE__ */ h("div", { className: ue, "data-person-row": "operator", children: [
|
|
1745
|
+
/* @__PURE__ */ n("div", { className: ft, children: /* @__PURE__ */ n(
|
|
1746
|
+
ut,
|
|
1747
|
+
{
|
|
1748
|
+
"aria-hidden": "true",
|
|
1749
|
+
name: We ? void 0 : sn(c, z),
|
|
1750
|
+
size: "sm"
|
|
1751
|
+
}
|
|
1752
|
+
) }),
|
|
1753
|
+
/* @__PURE__ */ h("div", { className: vt, children: [
|
|
1754
|
+
/* @__PURE__ */ n(
|
|
1755
|
+
Ae,
|
|
1756
|
+
{
|
|
1757
|
+
options: Dt(
|
|
1758
|
+
yn,
|
|
1759
|
+
z
|
|
1760
|
+
),
|
|
1761
|
+
value: z,
|
|
1762
|
+
showDescriptions: !0,
|
|
1763
|
+
"aria-describedby": Qn ? Ms : void 0,
|
|
1764
|
+
onValueChange: (e) => {
|
|
1765
|
+
if (!(!e || !Mt(yn, e))) {
|
|
1766
|
+
if (Fn(e), f) {
|
|
1767
|
+
Ie(
|
|
1768
|
+
e,
|
|
1769
|
+
e === Q ? "email" : se(e),
|
|
1770
|
+
q,
|
|
1771
|
+
"operator"
|
|
1772
|
+
);
|
|
1773
|
+
return;
|
|
1774
|
+
}
|
|
1775
|
+
qe(
|
|
1776
|
+
e === Q ? "email" : se(
|
|
1777
|
+
e,
|
|
1778
|
+
Ue
|
|
1779
|
+
)
|
|
1780
|
+
), oe(null);
|
|
1781
|
+
}
|
|
1782
|
+
},
|
|
1783
|
+
required: !0,
|
|
1784
|
+
disabled: k,
|
|
1785
|
+
placeholder: d(
|
|
1786
|
+
"signatureRequest.operatorPlaceholder"
|
|
1787
|
+
),
|
|
1788
|
+
"aria-label": d("signatureRequest.operatorSection")
|
|
1789
|
+
}
|
|
1790
|
+
),
|
|
1791
|
+
Qn ? /* @__PURE__ */ n(
|
|
1792
|
+
"span",
|
|
1793
|
+
{
|
|
1794
|
+
id: Ms,
|
|
1795
|
+
className: "ds:sr-only",
|
|
1796
|
+
children: Qn
|
|
1797
|
+
}
|
|
1798
|
+
) : null
|
|
1799
|
+
] }),
|
|
1800
|
+
/* @__PURE__ */ h(
|
|
1801
|
+
"div",
|
|
1802
|
+
{
|
|
1803
|
+
className: We ? `${is} ds:hidden ds:@[512px]/person:block` : is,
|
|
1804
|
+
children: [
|
|
1805
|
+
We ? null : /* @__PURE__ */ n(
|
|
1806
|
+
Ae,
|
|
1807
|
+
{
|
|
1808
|
+
id: "signature-request-operator-channel",
|
|
1809
|
+
options: $s,
|
|
1810
|
+
value: Z,
|
|
1811
|
+
adornmentInTrigger: !0,
|
|
1812
|
+
showDescriptions: !0,
|
|
1813
|
+
disabled: k,
|
|
1814
|
+
"aria-label": d(
|
|
1815
|
+
"signatureRequest.operatorChannelLabel"
|
|
1816
|
+
),
|
|
1817
|
+
"aria-describedby": wn ? gs : void 0,
|
|
1818
|
+
onValueChange: (e) => {
|
|
1819
|
+
if ($s.some(
|
|
1820
|
+
(t) => t.value === e && !t.disabled
|
|
1821
|
+
)) {
|
|
1822
|
+
if (f) {
|
|
1823
|
+
Ie(
|
|
1824
|
+
z,
|
|
1825
|
+
e,
|
|
1826
|
+
q,
|
|
1827
|
+
"operator"
|
|
1828
|
+
);
|
|
1829
|
+
return;
|
|
1830
|
+
}
|
|
1831
|
+
qe(e), oe(null);
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
),
|
|
1836
|
+
zs
|
|
1837
|
+
]
|
|
1838
|
+
}
|
|
1839
|
+
),
|
|
1840
|
+
wn && !We ? /* @__PURE__ */ n("span", { id: gs, className: "ds:sr-only", children: wn }) : null
|
|
1841
|
+
] })
|
|
1842
|
+
]
|
|
1843
|
+
}
|
|
1844
|
+
) : null,
|
|
1845
|
+
ne || In ? /* @__PURE__ */ n("span", { role: "status", className: "ds:sr-only", children: As ? d("signatureRequest.operatorChannelReverted", {
|
|
1846
|
+
channel: ce[As].label
|
|
1847
|
+
}) : Jt }) : null,
|
|
1848
|
+
(ne || x) && In ? /* @__PURE__ */ n(dt, { decorative: !0 }) : null,
|
|
1849
|
+
In ? /* @__PURE__ */ h(
|
|
1850
|
+
"section",
|
|
1851
|
+
{
|
|
1852
|
+
className: `${pn} ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start`,
|
|
1853
|
+
children: [
|
|
1854
|
+
/* @__PURE__ */ h("div", { className: ue, children: [
|
|
1855
|
+
/* @__PURE__ */ h("div", { className: An, children: [
|
|
1856
|
+
/* @__PURE__ */ n("p", { className: "type-eyebrow ds:text-[color:var(--muted-foreground)]", children: d("signatureRequest.signersSection") }),
|
|
1857
|
+
l.length > 1 ? /* @__PURE__ */ n(
|
|
1858
|
+
F,
|
|
1859
|
+
{
|
|
1860
|
+
ref: us,
|
|
1861
|
+
intent: "outline",
|
|
1862
|
+
size: "sm",
|
|
1863
|
+
startIcon: /* @__PURE__ */ n(gt, {}),
|
|
1864
|
+
disabled: !ta,
|
|
1865
|
+
"aria-describedby": Yn ? ps : void 0,
|
|
1866
|
+
onClick: la,
|
|
1867
|
+
children: d("signatureRequest.addSigner")
|
|
1868
|
+
}
|
|
1869
|
+
) : null
|
|
1870
|
+
] }),
|
|
1871
|
+
x && ds && !l.some(
|
|
1872
|
+
(e) => e.isPatient !== !0
|
|
1873
|
+
) ? /* @__PURE__ */ n("div", { className: H, children: /* @__PURE__ */ n(
|
|
1874
|
+
F,
|
|
1875
|
+
{
|
|
1876
|
+
intent: "link",
|
|
1877
|
+
size: "sm",
|
|
1878
|
+
startIcon: /* @__PURE__ */ n(gt, {}),
|
|
1879
|
+
disabled: k,
|
|
1880
|
+
onClick: ds,
|
|
1881
|
+
children: d("signatureRequest.addSignatory")
|
|
1882
|
+
}
|
|
1883
|
+
) }) : null,
|
|
1884
|
+
N ? /* @__PURE__ */ h(
|
|
1885
|
+
"div",
|
|
1886
|
+
{
|
|
1887
|
+
className: `${H} ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]`,
|
|
1888
|
+
children: [
|
|
1889
|
+
/* @__PURE__ */ n(
|
|
1890
|
+
"label",
|
|
1891
|
+
{
|
|
1892
|
+
htmlFor: wt,
|
|
1893
|
+
className: "type-label ds:text-foreground",
|
|
1894
|
+
children: d("signatureRequest.channelLabel")
|
|
1895
|
+
}
|
|
1896
|
+
),
|
|
1897
|
+
/* @__PURE__ */ n(
|
|
1898
|
+
Ae,
|
|
1899
|
+
{
|
|
1900
|
+
id: wt,
|
|
1901
|
+
options: Ks,
|
|
1902
|
+
value: O,
|
|
1903
|
+
adornmentInTrigger: !0,
|
|
1904
|
+
showDescriptions: !0,
|
|
1905
|
+
disabled: k,
|
|
1906
|
+
"aria-label": d("signatureRequest.channelLabel"),
|
|
1907
|
+
"aria-describedby": ts ? fs : void 0,
|
|
1908
|
+
onValueChange: (e) => {
|
|
1909
|
+
Ks.some(
|
|
1910
|
+
(t) => t.value === e && !t.disabled
|
|
1911
|
+
) && Be(
|
|
1912
|
+
q,
|
|
1913
|
+
e,
|
|
1914
|
+
{ userChannel: !0 }
|
|
1915
|
+
);
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
),
|
|
1919
|
+
ts ? /* @__PURE__ */ n(
|
|
1920
|
+
"span",
|
|
1921
|
+
{
|
|
1922
|
+
id: fs,
|
|
1923
|
+
className: "ds:sr-only",
|
|
1924
|
+
children: ts
|
|
1925
|
+
}
|
|
1926
|
+
) : null
|
|
1927
|
+
]
|
|
1928
|
+
}
|
|
1929
|
+
) : null,
|
|
1930
|
+
N && O === "on-device" ? /* @__PURE__ */ n("div", { className: H, children: /* @__PURE__ */ n(
|
|
1931
|
+
ct,
|
|
1932
|
+
{
|
|
1933
|
+
label: d("signatureRequest.noOtp"),
|
|
1934
|
+
checked: Zn,
|
|
1935
|
+
disabled: k || Qe,
|
|
1936
|
+
"aria-describedby": Qe ? xn : void 0,
|
|
1937
|
+
onCheckedChange: (e) => Hn(e)
|
|
1938
|
+
}
|
|
1939
|
+
) }) : null,
|
|
1940
|
+
ia ? /* @__PURE__ */ n(
|
|
1941
|
+
K,
|
|
1942
|
+
{
|
|
1943
|
+
variant: "warning",
|
|
1944
|
+
id: xn,
|
|
1945
|
+
className: H,
|
|
1946
|
+
children: /* @__PURE__ */ n(K.Description, { children: d("signatureRequest.noOtpWarning") })
|
|
1947
|
+
}
|
|
1948
|
+
) : null,
|
|
1949
|
+
Yn ? /* @__PURE__ */ n(
|
|
1950
|
+
"p",
|
|
1951
|
+
{
|
|
1952
|
+
id: ps,
|
|
1953
|
+
className: `${H} type-body-sm ds:text-[color:var(--muted-foreground)]`,
|
|
1954
|
+
children: Yn
|
|
1955
|
+
}
|
|
1956
|
+
) : null
|
|
1957
|
+
] }),
|
|
1958
|
+
/* @__PURE__ */ n("div", { className: za, children: w.map((e, s) => {
|
|
1959
|
+
var lt, ot;
|
|
1960
|
+
const t = l.filter(
|
|
1961
|
+
(E) => E.value === e.signerId || !Fs.includes(E.value)
|
|
1962
|
+
), a = sn(
|
|
1963
|
+
l,
|
|
1964
|
+
e.signerId
|
|
1965
|
+
), u = ((lt = l.find(
|
|
1966
|
+
(E) => E.value === e.signerId
|
|
1967
|
+
)) == null ? void 0 : lt.isMinor) === !0, o = x && s > 0, p = o ? t.filter(
|
|
1968
|
+
(E) => E.isPatient !== !0
|
|
1969
|
+
) : t, m = p.some(
|
|
1970
|
+
(E) => E.value === e.signerId
|
|
1971
|
+
), R = o ? Sn : null, L = `${vs}-${e.rowId}`, T = `${Ht}-${e.rowId}`, Ce = rn(
|
|
1972
|
+
e.signerId
|
|
1973
|
+
), te = Mn(
|
|
1974
|
+
e.signerId,
|
|
1975
|
+
(ot = de == null ? void 0 : de.signerAvailableChannels) == null ? void 0 : ot[e.signerId]
|
|
1976
|
+
), G = Bs(
|
|
1977
|
+
te,
|
|
1978
|
+
Ce
|
|
1979
|
+
), ae = !N && G.every(
|
|
1980
|
+
(E) => E.disabled
|
|
1981
|
+
), ie = N ? void 0 : Gs(
|
|
1982
|
+
te,
|
|
1983
|
+
Ce,
|
|
1984
|
+
ae
|
|
1985
|
+
), Je = `${Ft}-${e.rowId}`, On = es(s) && Qe, ha = x ? o : w.length > 1, ma = (E) => {
|
|
1986
|
+
if (!E || !p.some(
|
|
1987
|
+
(V) => V.value === E
|
|
1988
|
+
))
|
|
1989
|
+
return;
|
|
1990
|
+
if (N) {
|
|
1991
|
+
Be(
|
|
1992
|
+
q.map(
|
|
1993
|
+
(V) => V.rowId === e.rowId ? { ...V, signerId: E } : V
|
|
1994
|
+
),
|
|
1995
|
+
O,
|
|
1996
|
+
{ primaryChanged: x && !o }
|
|
1997
|
+
);
|
|
1998
|
+
return;
|
|
1999
|
+
}
|
|
2000
|
+
const as = Nn(
|
|
2001
|
+
E,
|
|
2002
|
+
e.channel
|
|
2003
|
+
), hn = x && !o && q.length > 1, mn = (hn ? q.slice(0, 1) : q).map(
|
|
2004
|
+
(V) => V.rowId === e.rowId ? {
|
|
2005
|
+
...V,
|
|
2006
|
+
signerId: E,
|
|
2007
|
+
channel: as,
|
|
2008
|
+
skipOtp: as === "on-device" ? V.skipOtp : void 0
|
|
2009
|
+
} : V
|
|
2010
|
+
), Ze = hn && w.length > 1 ? [d("signatureRequest.secondSigneeCleared")] : [];
|
|
2011
|
+
if (f) {
|
|
2012
|
+
Ie(
|
|
2013
|
+
z,
|
|
2014
|
+
Z,
|
|
2015
|
+
mn,
|
|
2016
|
+
"signers",
|
|
2017
|
+
Ze
|
|
2018
|
+
);
|
|
2019
|
+
return;
|
|
2020
|
+
}
|
|
2021
|
+
pe(mn), Ze.length > 0 && (oe(null), je(Ze.join(" ")));
|
|
2022
|
+
}, pa = (E) => {
|
|
2023
|
+
if (!G.some(
|
|
2024
|
+
(en) => en.value === E && !en.disabled
|
|
2025
|
+
)) return;
|
|
2026
|
+
const hn = E, mn = q.map(
|
|
2027
|
+
(en) => en.rowId === e.rowId ? { ...en, channel: hn, skipOtp: void 0 } : en
|
|
2028
|
+
), Ze = x && !o && w.length > 1 ? Tn({
|
|
2029
|
+
items: B,
|
|
2030
|
+
channel: hn,
|
|
2031
|
+
primaryIsPatient: Xn
|
|
2032
|
+
}) : null, V = Ze === null ? [] : [d(os[Ze])];
|
|
2033
|
+
if (f) {
|
|
2034
|
+
Ie(
|
|
2035
|
+
z,
|
|
2036
|
+
Z,
|
|
2037
|
+
mn,
|
|
2038
|
+
"signers",
|
|
2039
|
+
V
|
|
2040
|
+
);
|
|
2041
|
+
return;
|
|
2042
|
+
}
|
|
2043
|
+
pe(mn), V.length > 0 && (oe(null), je(V.join(" ")));
|
|
2044
|
+
}, rt = /* @__PURE__ */ h(
|
|
2045
|
+
"div",
|
|
2046
|
+
{
|
|
2047
|
+
role: "group",
|
|
2048
|
+
"aria-label": o ? void 0 : a,
|
|
2049
|
+
"aria-labelledby": o ? T : void 0,
|
|
2050
|
+
"data-signer-id": e.signerId,
|
|
2051
|
+
"data-signer-role": x ? o ? "second" : "main" : void 0,
|
|
2052
|
+
className: ue,
|
|
2053
|
+
children: [
|
|
2054
|
+
/* @__PURE__ */ n("div", { className: ft, children: /* @__PURE__ */ n(
|
|
2055
|
+
ut,
|
|
2056
|
+
{
|
|
2057
|
+
"aria-hidden": "true",
|
|
2058
|
+
name: x && !m ? void 0 : a,
|
|
2059
|
+
size: "sm"
|
|
2060
|
+
}
|
|
2061
|
+
) }),
|
|
2062
|
+
/* @__PURE__ */ n(
|
|
2063
|
+
"div",
|
|
2064
|
+
{
|
|
2065
|
+
className: N ? La : vt,
|
|
2066
|
+
children: /* @__PURE__ */ n(
|
|
2067
|
+
Ae,
|
|
2068
|
+
{
|
|
2069
|
+
options: p,
|
|
2070
|
+
value: x && !m ? "" : e.signerId,
|
|
2071
|
+
tone: R ? "error" : "default",
|
|
2072
|
+
"aria-describedby": R ? L : void 0,
|
|
2073
|
+
onValueChange: ma,
|
|
2074
|
+
required: !0,
|
|
2075
|
+
disabled: k,
|
|
2076
|
+
placeholder: d(
|
|
2077
|
+
"signatureRequest.signerPlaceholder"
|
|
2078
|
+
),
|
|
2079
|
+
"aria-label": d(
|
|
2080
|
+
"signatureRequest.signerPlaceholder"
|
|
2081
|
+
)
|
|
2082
|
+
}
|
|
2083
|
+
)
|
|
2084
|
+
}
|
|
2085
|
+
),
|
|
2086
|
+
N ? null : /* @__PURE__ */ h("div", { className: is, children: [
|
|
2087
|
+
/* @__PURE__ */ n(
|
|
2088
|
+
Ae,
|
|
2089
|
+
{
|
|
2090
|
+
id: `signature-request-signer-channel-${e.rowId}`,
|
|
2091
|
+
options: G,
|
|
2092
|
+
value: ae ? "" : e.channel,
|
|
2093
|
+
adornmentInTrigger: !0,
|
|
2094
|
+
showDescriptions: !0,
|
|
2095
|
+
disabled: k,
|
|
2096
|
+
"aria-label": d(
|
|
2097
|
+
"signatureRequest.channelLabel"
|
|
2098
|
+
),
|
|
2099
|
+
"aria-describedby": ie ? Je : void 0,
|
|
2100
|
+
onValueChange: pa
|
|
2101
|
+
}
|
|
2102
|
+
),
|
|
2103
|
+
zs
|
|
2104
|
+
] }),
|
|
2105
|
+
ie && !ae ? /* @__PURE__ */ n(
|
|
2106
|
+
"span",
|
|
2107
|
+
{
|
|
2108
|
+
id: Je,
|
|
2109
|
+
className: "ds:sr-only",
|
|
2110
|
+
children: ie
|
|
2111
|
+
}
|
|
2112
|
+
) : null,
|
|
2113
|
+
ha ? /* @__PURE__ */ n("div", { className: $a, children: /* @__PURE__ */ n(
|
|
2114
|
+
gn,
|
|
2115
|
+
{
|
|
2116
|
+
intent: "ghost",
|
|
2117
|
+
size: "sm",
|
|
2118
|
+
icon: /* @__PURE__ */ n(Sa, {}),
|
|
2119
|
+
disabled: k,
|
|
2120
|
+
"aria-label": d(
|
|
2121
|
+
"signatureRequest.removeSigner"
|
|
2122
|
+
),
|
|
2123
|
+
onClick: () => oa(e.rowId)
|
|
2124
|
+
}
|
|
2125
|
+
) }) : null,
|
|
2126
|
+
u ? /* @__PURE__ */ n(
|
|
2127
|
+
K,
|
|
2128
|
+
{
|
|
2129
|
+
variant: "warning",
|
|
2130
|
+
announce: "polite",
|
|
2131
|
+
"data-note": "minor-signer",
|
|
2132
|
+
className: H,
|
|
2133
|
+
children: /* @__PURE__ */ n(K.Description, { children: d("signatureRequest.minorSignerWarning") })
|
|
2134
|
+
}
|
|
2135
|
+
) : null,
|
|
2136
|
+
R ? /* @__PURE__ */ n(
|
|
2137
|
+
"p",
|
|
2138
|
+
{
|
|
2139
|
+
id: L,
|
|
2140
|
+
role: "status",
|
|
2141
|
+
"data-note": "second-signee-issue",
|
|
2142
|
+
"data-issue": R,
|
|
2143
|
+
className: `${H} type-body-sm ds:text-[color:var(--destructive)]`,
|
|
2144
|
+
children: d(si[R])
|
|
2145
|
+
}
|
|
2146
|
+
) : null,
|
|
2147
|
+
ae && ie ? /* @__PURE__ */ n(
|
|
2148
|
+
"p",
|
|
2149
|
+
{
|
|
2150
|
+
id: Je,
|
|
2151
|
+
"data-note": "no-channel",
|
|
2152
|
+
className: `${H} type-body-sm ds:text-[color:var(--muted-foreground)]`,
|
|
2153
|
+
children: ie
|
|
2154
|
+
}
|
|
2155
|
+
) : null,
|
|
2156
|
+
!N && e.channel === "on-device" && !ae ? /* @__PURE__ */ n("div", { className: H, children: /* @__PURE__ */ n(
|
|
2157
|
+
ct,
|
|
2158
|
+
{
|
|
2159
|
+
label: d("signatureRequest.noOtp"),
|
|
2160
|
+
checked: ns(e, s),
|
|
2161
|
+
disabled: k || On,
|
|
2162
|
+
"aria-describedby": On ? xn : void 0,
|
|
2163
|
+
onCheckedChange: (E) => ra(e.rowId, {
|
|
2164
|
+
skipOtp: E
|
|
2165
|
+
})
|
|
2166
|
+
}
|
|
2167
|
+
) }) : null
|
|
2168
|
+
]
|
|
2169
|
+
},
|
|
2170
|
+
e.rowId
|
|
2171
|
+
);
|
|
2172
|
+
return o ? /* @__PURE__ */ h(
|
|
2173
|
+
"div",
|
|
2174
|
+
{
|
|
2175
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
2176
|
+
children: [
|
|
2177
|
+
/* @__PURE__ */ n("div", { className: ue, children: /* @__PURE__ */ n(
|
|
2178
|
+
"p",
|
|
2179
|
+
{
|
|
2180
|
+
id: T,
|
|
2181
|
+
className: `${H} type-label ds:text-[color:var(--muted-foreground)]`,
|
|
2182
|
+
children: d("signatureRequest.secondSigneeLabel")
|
|
2183
|
+
}
|
|
2184
|
+
) }),
|
|
2185
|
+
rt
|
|
2186
|
+
]
|
|
2187
|
+
},
|
|
2188
|
+
e.rowId
|
|
2189
|
+
) : rt;
|
|
2190
|
+
}) })
|
|
2191
|
+
]
|
|
2192
|
+
}
|
|
2193
|
+
) : null,
|
|
2194
|
+
Ws || re ? /* @__PURE__ */ n("div", { className: pn, children: /* @__PURE__ */ h("div", { className: ue, children: [
|
|
2195
|
+
Ws ? /* @__PURE__ */ n(
|
|
2196
|
+
K,
|
|
2197
|
+
{
|
|
2198
|
+
variant: "warning",
|
|
2199
|
+
id: xn,
|
|
2200
|
+
className: H,
|
|
2201
|
+
children: /* @__PURE__ */ n(K.Description, { children: d("signatureRequest.noOtpWarning") })
|
|
2202
|
+
}
|
|
2203
|
+
) : null,
|
|
2204
|
+
re ? /* @__PURE__ */ n(K, { variant: "error", className: H, children: /* @__PURE__ */ n(K.Description, { children: re }) }) : null
|
|
2205
|
+
] }) }) : null
|
|
2206
|
+
] }),
|
|
2207
|
+
/* @__PURE__ */ h(S.Footer, { children: [
|
|
2208
|
+
/* @__PURE__ */ n(
|
|
2209
|
+
F,
|
|
2210
|
+
{
|
|
2211
|
+
intent: "primary",
|
|
2212
|
+
startIcon: /* @__PURE__ */ n(Ia, {}),
|
|
2213
|
+
onClick: ca,
|
|
2214
|
+
"aria-describedby": Sn !== null && w[1] ? `${vs}-${w[1].rowId}` : void 0,
|
|
2215
|
+
disabled: k || Ne && w.length === 0 || js || Sn !== null || !Ne && !ne || x && (P || B.length === 0),
|
|
2216
|
+
loading: k,
|
|
2217
|
+
children: d("signatureRequest.requestSignature")
|
|
2218
|
+
}
|
|
2219
|
+
),
|
|
2220
|
+
/* @__PURE__ */ n(S.Close, { asChild: !0, children: /* @__PURE__ */ n(F, { intent: "outline", disabled: k, children: d("signatureRequest.close") }) })
|
|
2221
|
+
] })
|
|
2222
|
+
] })
|
|
2223
|
+
]
|
|
2224
|
+
}
|
|
2225
|
+
) }) }) });
|
|
2226
|
+
}
|
|
2227
|
+
);
|
|
2228
|
+
ai.displayName = "SignatureRequestModal";
|
|
2229
|
+
export {
|
|
2230
|
+
ai as S
|
|
2231
|
+
};
|
|
2232
|
+
//# sourceMappingURL=signature-request-vihDT8On.js.map
|