@alfadocs/ui-kit 1.73.3 → 1.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/_chunks/alia-sidebar-CsTRAxC8.js +1323 -0
  2. package/dist/_chunks/{anamnesis-summary-rows-BedVmSAB.js → anamnesis-summary-rows-vNDyE5HW.js} +2 -2
  3. package/dist/_chunks/{antenatal-schedule-timeline-DW_qkGo1.js → antenatal-schedule-timeline-BGewPfEX.js} +18 -18
  4. package/dist/_chunks/{appointment-timeline-CKwMXUid.js → appointment-timeline-1-Za2miy.js} +2 -2
  5. package/dist/_chunks/{ar-pLopgMbL.js → ar-C4YQVTH6.js} +2 -2
  6. package/dist/_chunks/{auth-form-parts-DHv6LVV2.js → auth-form-parts-B3GWChvG.js} +2 -2
  7. package/dist/_chunks/{balance-badge-cell-DG5JWB2p.js → balance-badge-cell-B49xgL6H.js} +2 -2
  8. package/dist/_chunks/{booking-4BCeh7OY.js → booking-sq9sa29d.js} +8 -8
  9. package/dist/_chunks/brand-mark-DLk9kD8g.js +63 -0
  10. package/dist/_chunks/{calendar-appointment-editor-dialog-Lji2y0qJ.js → calendar-appointment-editor-dialog-CctI6mpd.js} +8 -8
  11. package/dist/_chunks/{cycle-calculator-Ycp3li61.js → cycle-calculator-HO3s5InI.js} +5 -5
  12. package/dist/_chunks/{date-picker-KcoNNsM0.js → date-picker-CdhXlgVI.js} +4 -4
  13. package/dist/_chunks/{date-picker-variants-DN37Oj5-.js → date-picker-variants-Dt6UbonG.js} +25 -25
  14. package/dist/_chunks/{date-range-picker-CjcjUJLW.js → date-range-picker-B_j4VQlV.js} +5 -5
  15. package/dist/_chunks/{date-time-picker-BVQNZ4yC.js → date-time-picker-n-yrlMJq.js} +3 -3
  16. package/dist/_chunks/{de-lVkJRPnh.js → de-B1B3PIgY.js} +2 -2
  17. package/dist/_chunks/{due-date-calculator-B0gyOijA.js → due-date-calculator-CDWTSblh.js} +6 -6
  18. package/dist/_chunks/{el-CHzxNWPj.js → el-iLqGpapg.js} +16 -16
  19. package/dist/_chunks/{en-GB-CwxYmmhU.js → en-GB-CxPRQbD6.js} +6 -6
  20. package/dist/_chunks/{es-Ck-oxbHW.js → es-Bg1oqwDs.js} +2 -2
  21. package/dist/_chunks/{forgot-password-form-D6kB72OD.js → forgot-password-form-BSOZVrZG.js} +3 -3
  22. package/dist/_chunks/{format-D-1gTdHF.js → format--x5jypvH.js} +13 -13
  23. package/dist/_chunks/{fr-fWRnDcSD.js → fr-DpGxyOGI.js} +2 -2
  24. package/dist/_chunks/{gestational-age-calculator-Bu_a-K9z.js → gestational-age-calculator-CTHeJJdb.js} +7 -7
  25. package/dist/_chunks/{hcg-doubling-BnopYgd-.js → hcg-doubling-BBk-a33g.js} +11 -11
  26. package/dist/_chunks/{hi-B5uX0h3V.js → hi-3Dtsksrw.js} +2 -2
  27. package/dist/_chunks/{isSameWeek-u81Z-J7h.js → isSameWeek-DyVftHWi.js} +2 -2
  28. package/dist/_chunks/{it-DBoNIelY.js → it-Cp0CA13d.js} +3 -3
  29. package/dist/_chunks/{ja-Du8gfg8p.js → ja-9FOyR1lb.js} +22 -22
  30. package/dist/_chunks/{kit-extensions-DgBi3tsK.js → kit-extensions-sNTZWkoo.js} +4 -4
  31. package/dist/_chunks/{link-cell-renderer-BDxxpfJM.js → link-cell-renderer-B0riA_h_.js} +2 -2
  32. package/dist/_chunks/{login-dev-card-pnJbVaoQ.js → login-dev-card-DRxTPkE9.js} +3 -3
  33. package/dist/_chunks/{nl-BCBwxYi8.js → nl-sfx-zJgR.js} +2 -2
  34. package/dist/_chunks/{notes-panel-C_QshXyI.js → notes-panel-CxjMovCh.js} +2 -2
  35. package/dist/_chunks/{parse-UB4FJGNA.js → parse-B0s7bY4d.js} +3 -3
  36. package/dist/_chunks/{parseISO-y3LncvfO.js → parseISO-DZZ5a-zK.js} +2 -2
  37. package/dist/_chunks/{patient-details-Cd_dCqkg.js → patient-details-Dgd_tocD.js} +2 -2
  38. package/dist/_chunks/{patient-field-row-D6Ftm46u.js → patient-field-row-BFVlJnS9.js} +3 -3
  39. package/dist/_chunks/{patient-summary-card-BSOHR4Ol.js → patient-summary-card-BTKvFUmh.js} +2 -2
  40. package/dist/_chunks/{phone-input-O9camxkq.js → phone-input-EwVuqFik.js} +74 -74
  41. package/dist/_chunks/{pl-HwLM6gPs.js → pl-BLh7KO-s.js} +3 -3
  42. package/dist/_chunks/{pregnancy-dating-CvNFirHt.js → pregnancy-dating-JBAUbM40.js} +7 -7
  43. package/dist/_chunks/{pt-BxhT5ZQH.js → pt-CPKOrOLj.js} +2 -2
  44. package/dist/_chunks/{radiograph-panel.agent-ESnkuDfH.js → radiograph-panel.agent-DQh2SX8G.js} +3 -3
  45. package/dist/_chunks/registration-form-B6qqeXP1.js +1310 -0
  46. package/dist/_chunks/{rich-text-editor-BXFgcvBW.js → rich-text-editor-BZTyxQBd.js} +1683 -1673
  47. package/dist/_chunks/{ro-Do9W55ae.js → ro-Dc-oNqbF.js} +2 -2
  48. package/dist/_chunks/{ru-PDBX5gdf.js → ru-BtNpDZRR.js} +3 -3
  49. package/dist/_chunks/send-registration-link-form-pO2bGjGa.js +409 -0
  50. package/dist/_chunks/{slot-grid-uA9j7Nik.js → slot-grid-Bb13H9Rl.js} +3 -3
  51. package/dist/_chunks/{sq-DnvsgyIh.js → sq-D4c7olaV.js} +2 -2
  52. package/dist/_chunks/subDays-DKISP2nE.js +8 -0
  53. package/dist/_chunks/{sv-CpFSK8xS.js → sv-Bf_dHPvh.js} +2 -2
  54. package/dist/_chunks/{task-editor-BTeUFGUX.js → task-editor-CRhfwP9T.js} +2 -2
  55. package/dist/_chunks/{tr-DW4oQYHT.js → tr-xqQ6cbGY.js} +2 -2
  56. package/dist/_chunks/{use-appointment-details-read-BWbOiLVw.js → use-appointment-details-read-BFslxbRr.js} +2 -2
  57. package/dist/_chunks/use-field-match-C8ug3sdQ.js +30 -0
  58. package/dist/_chunks/use-registration-submit-CLGHxwoT.js +112 -0
  59. package/dist/_chunks/{zh-CN-QGEs29fQ.js → zh-CN-C657DBCO.js} +3 -3
  60. package/dist/agent-catalog.json +87 -3
  61. package/dist/agent-i18n/en.json +9 -2
  62. package/dist/alia-asteroid-icon/index.js +52 -0
  63. package/dist/aws-transcribe/index.js +320 -0
  64. package/dist/components/appointment-details-panel/index.js +1 -1
  65. package/dist/components/appointment-timeline/index.js +1 -1
  66. package/dist/components/booking/index.js +1 -1
  67. package/dist/components/cycle-calculator/index.js +1 -1
  68. package/dist/components/data-table/index.js +1 -1
  69. package/dist/components/date-picker/index.js +1 -1
  70. package/dist/components/date-range-picker/index.js +1 -1
  71. package/dist/components/date-time-picker/index.js +1 -1
  72. package/dist/components/due-date-calculator/index.js +2 -2
  73. package/dist/components/gestational-age-calculator/index.js +1 -1
  74. package/dist/components/hcg-doubling/index.js +1 -1
  75. package/dist/components/index.d.ts +1 -0
  76. package/dist/components/notes-panel/index.js +1 -1
  77. package/dist/components/patient-details/index.js +1 -1
  78. package/dist/components/patient-summary-card/index.js +1 -1
  79. package/dist/components/patient-table/index.js +1 -1
  80. package/dist/components/phone-input/index.js +1 -1
  81. package/dist/components/pregnancy-dating/index.js +1 -1
  82. package/dist/components/radiograph-panel/index.js +1 -1
  83. package/dist/components/rich-text-editor/index.js +2 -2
  84. package/dist/components/slot-grid/index.js +1 -1
  85. package/dist/components/task-editor/index.js +1 -1
  86. package/dist/hooks/index.js +1 -1
  87. package/dist/hooks/use-field-match.d.ts +2 -2
  88. package/dist/i18n/locales/ar.d.ts +36 -0
  89. package/dist/i18n/locales/ar.js +38 -2
  90. package/dist/i18n/locales/de.d.ts +36 -0
  91. package/dist/i18n/locales/de.js +38 -2
  92. package/dist/i18n/locales/el.d.ts +36 -0
  93. package/dist/i18n/locales/el.js +38 -2
  94. package/dist/i18n/locales/en.d.ts +36 -0
  95. package/dist/i18n/locales/en.js +38 -2
  96. package/dist/i18n/locales/es.d.ts +36 -0
  97. package/dist/i18n/locales/es.js +38 -2
  98. package/dist/i18n/locales/fr.d.ts +36 -0
  99. package/dist/i18n/locales/fr.js +38 -2
  100. package/dist/i18n/locales/hi.d.ts +36 -0
  101. package/dist/i18n/locales/hi.js +38 -2
  102. package/dist/i18n/locales/it.d.ts +36 -0
  103. package/dist/i18n/locales/it.js +38 -2
  104. package/dist/i18n/locales/ja.d.ts +36 -0
  105. package/dist/i18n/locales/ja.js +38 -2
  106. package/dist/i18n/locales/nl.d.ts +36 -0
  107. package/dist/i18n/locales/nl.js +38 -2
  108. package/dist/i18n/locales/pl.d.ts +36 -0
  109. package/dist/i18n/locales/pl.js +38 -2
  110. package/dist/i18n/locales/pt.d.ts +36 -0
  111. package/dist/i18n/locales/pt.js +38 -2
  112. package/dist/i18n/locales/ro.d.ts +36 -0
  113. package/dist/i18n/locales/ro.js +38 -2
  114. package/dist/i18n/locales/ru.d.ts +36 -0
  115. package/dist/i18n/locales/ru.js +38 -2
  116. package/dist/i18n/locales/sq.d.ts +36 -0
  117. package/dist/i18n/locales/sq.js +38 -2
  118. package/dist/i18n/locales/sv.d.ts +36 -0
  119. package/dist/i18n/locales/sv.js +38 -2
  120. package/dist/i18n/locales/tr.d.ts +36 -0
  121. package/dist/i18n/locales/tr.js +38 -2
  122. package/dist/i18n/locales/zh.d.ts +36 -0
  123. package/dist/i18n/locales/zh.js +38 -2
  124. package/dist/index.js +296 -292
  125. package/dist/locales/ar.json +38 -2
  126. package/dist/locales/de.json +38 -2
  127. package/dist/locales/el.json +38 -2
  128. package/dist/locales/en.json +38 -2
  129. package/dist/locales/es.json +38 -2
  130. package/dist/locales/fr.json +38 -2
  131. package/dist/locales/hi.json +38 -2
  132. package/dist/locales/it.json +38 -2
  133. package/dist/locales/ja.json +38 -2
  134. package/dist/locales/nl.json +38 -2
  135. package/dist/locales/pl.json +38 -2
  136. package/dist/locales/pt.json +38 -2
  137. package/dist/locales/ro.json +38 -2
  138. package/dist/locales/ru.json +38 -2
  139. package/dist/locales/sq.json +38 -2
  140. package/dist/locales/sv.json +38 -2
  141. package/dist/locales/tr.json +38 -2
  142. package/dist/locales/zh.json +38 -2
  143. package/dist/patterns/alia-assistant/alia-types.d.ts +22 -0
  144. package/dist/patterns/alia-assistant/index.js +7 -6
  145. package/dist/patterns/anamnesis/index.js +1 -1
  146. package/dist/patterns/calendar/index.js +1 -1
  147. package/dist/patterns/forgot-password-form/index.js +1 -1
  148. package/dist/patterns/login-form/index.js +1 -1
  149. package/dist/patterns/registration-form/index.d.ts +1 -0
  150. package/dist/patterns/registration-form/index.js +1 -1
  151. package/dist/patterns/registration-form/registration-form.d.ts +43 -0
  152. package/dist/patterns/registration-form/registration-verification.d.ts +38 -0
  153. package/dist/patterns/registration-form/use-contact-verification.d.ts +107 -0
  154. package/dist/patterns/registration-form/verification-requests.d.ts +9 -0
  155. package/dist/patterns/send-registration-link-form/index.d.ts +3 -0
  156. package/dist/patterns/send-registration-link-form/index.js +6 -0
  157. package/dist/patterns/send-registration-link-form/send-registration-link-form.d.ts +80 -0
  158. package/dist/speech/aws-transcribe.d.ts +65 -0
  159. package/dist/speech/event-stream.d.ts +13 -0
  160. package/dist/tokens.css +1 -1
  161. package/package.json +13 -1
  162. package/dist/_chunks/alia-sidebar-DZoyUFW8.js +0 -1290
  163. package/dist/_chunks/registration-form-BGSVMAga.js +0 -819
  164. package/dist/_chunks/subDays-xH7cpN6B.js +0 -8
  165. package/dist/_chunks/use-field-match-pdbEnKvO.js +0 -28
  166. package/dist/_chunks/use-registration-submit-eWAECgUC.js +0 -171
@@ -1,4 +1,4 @@
1
- import { d as m, o as t, p as n, q as s } from "./format-D-1gTdHF.js";
1
+ import { e as m, p as t, q as n, r as s } from "./format--x5jypvH.js";
2
2
  const d = {
3
3
  lessThanXSeconds: {
4
4
  one: "mai puțin de o secundă",
@@ -358,4 +358,4 @@ const d = {
358
358
  export {
359
359
  N as ro
360
360
  };
361
- //# sourceMappingURL=ro-Do9W55ae.js.map
361
+ //# sourceMappingURL=ro-Dc-oNqbF.js.map
@@ -1,5 +1,5 @@
1
- import { d as s, o as u, p as o, q as g } from "./format-D-1gTdHF.js";
2
- import { i as d } from "./isSameWeek-u81Z-J7h.js";
1
+ import { e as s, p as u, q as o, r as g } from "./format--x5jypvH.js";
2
+ import { i as d } from "./isSameWeek-DyVftHWi.js";
3
3
  function l(e, t) {
4
4
  if (e.one !== void 0 && t === 1)
5
5
  return e.one;
@@ -558,4 +558,4 @@ const P = {
558
558
  export {
559
559
  B as ru
560
560
  };
561
- //# sourceMappingURL=ru-PDBX5gdf.js.map
561
+ //# sourceMappingURL=ru-BtNpDZRR.js.map
@@ -0,0 +1,409 @@
1
+ import { jsx as n, jsxs as D } from "react/jsx-runtime";
2
+ import { forwardRef as Ke, useId as G, useState as f, useRef as I, useEffect as We } from "react";
3
+ import { useTranslation as Je } from "react-i18next";
4
+ import { c as Qe } from "./index-D2ZczOXr.js";
5
+ import { parsePhoneNumberFromString as Xe } from "libphonenumber-js/min";
6
+ import { i as Ye, E as pe } from "./email-input-C7THAwh2.js";
7
+ import { A as h } from "./alert-9kEwDza3.js";
8
+ import { B as he } from "./button-DohK_Ak_.js";
9
+ import { C as B } from "./card-BA4Ig_kn.js";
10
+ import { D as Ze } from "./date-picker-CdhXlgVI.js";
11
+ import { E as Ve } from "./error-summary-mGxIyDAY.js";
12
+ import { F } from "./form-field-Ani72sVY.js";
13
+ import { P as ue } from "./phone-input-EwVuqFik.js";
14
+ import { a as en, i as nn } from "./safe-href-5dbsfbQn.js";
15
+ import { u as ge } from "./use-state-backed-input-DhRQo6gM.js";
16
+ import { u as Ce } from "./use-field-match-C8ug3sdQ.js";
17
+ import { u as on, b as rn, a as tn } from "./use-registration-submit-CLGHxwoT.js";
18
+ import { s as we, i as an, f as sn } from "./format--x5jypvH.js";
19
+ import { p as mn } from "./parseISO-DZZ5a-zK.js";
20
+ import { i as ln, a as dn } from "./date-picker-variants-Dt6UbonG.js";
21
+ const q = [
22
+ "email",
23
+ "emailConfirm",
24
+ "phone",
25
+ "phoneConfirm",
26
+ "allowLoginUntil"
27
+ ], ve = Qe(
28
+ "ds:w-full ds:[max-inline-size:36rem] ds:text-start ds:text-[var(--foreground)]"
29
+ ), ye = (a) => sn(a, "yyyy-MM-dd"), M = (a) => {
30
+ if (!a) return;
31
+ const p = mn(a);
32
+ return an(p) ? we(p) : void 0;
33
+ }, cn = (a) => {
34
+ var p;
35
+ return ((p = Xe(a)) == null ? void 0 : p.isPossible()) ?? !1;
36
+ }, Le = (a) => Object.values(a).some(Boolean), fn = Ke(
37
+ ({
38
+ title: a,
39
+ headingLevel: p = 2,
40
+ guidance: k,
41
+ minDate: Re,
42
+ maxDate: be,
43
+ initialValues: r,
44
+ errors: C,
45
+ blockPaste: m,
46
+ submitLabel: De,
47
+ submitting: Fe = !1,
48
+ sent: w,
49
+ sendAnotherHref: T,
50
+ fieldNames: l,
51
+ action: O,
52
+ hiddenFields: Ee,
53
+ onSubmit: A,
54
+ className: H,
55
+ ...K
56
+ }, W) => {
57
+ const { t: i, i18n: Se } = Je("ui"), J = G(), Ue = G(), v = (e) => `${Ue}-${e}`, Q = G(), d = l !== void 0, X = `h${p}`, [xe] = f(() => {
58
+ const e = we(/* @__PURE__ */ new Date());
59
+ return e.setDate(e.getDate() + 1), e;
60
+ }), N = M(Re) ?? xe, R = M(be), Ie = (e) => !ln(e, N) && !(R && dn(e, R)), [t, Be] = f(() => ({
61
+ email: (r == null ? void 0 : r.email) ?? "",
62
+ emailConfirm: (r == null ? void 0 : r.emailConfirm) ?? "",
63
+ phone: (r == null ? void 0 : r.phone) ?? "",
64
+ phoneConfirm: (r == null ? void 0 : r.phoneConfirm) ?? ""
65
+ })), [c, qe] = f(
66
+ () => M(r == null ? void 0 : r.allowLoginUntil)
67
+ ), [Me, ke] = f(
68
+ () => cn((r == null ? void 0 : r.phone) ?? "")
69
+ ), [Te, Oe] = f(() => ({ email: !!(r != null && r.email) })), [j, Y] = f(!1), [Z, V] = f(() => C ?? {}), ee = (e) => V(
70
+ (o) => o[e] ? { ...o, [e]: void 0 } : o
71
+ ), E = (e, o) => {
72
+ Be((g) => ({ ...g, [e]: o })), ee(e);
73
+ }, S = (e) => Oe(
74
+ (o) => o[e] ? o : { ...o, [e]: !0 }
75
+ ), $ = Ce({
76
+ value: t.email,
77
+ confirmValue: t.emailConfirm,
78
+ kind: "email",
79
+ submitted: j
80
+ }), P = Ce({
81
+ value: t.phone,
82
+ confirmValue: t.phoneConfirm,
83
+ kind: "phone",
84
+ submitted: j
85
+ }), ne = {
86
+ email: !Ye(t.email),
87
+ emailConfirm: t.emailConfirm === "" || !$.matches,
88
+ phone: t.phone === "" || !Me,
89
+ phoneConfirm: t.phoneConfirm === "" || !P.matches,
90
+ allowLoginUntil: !c || !Ie(c)
91
+ }, y = i("registrationForm.required"), _ = (e) => new Intl.DateTimeFormat(Se.language, { dateStyle: "medium" }).format(
92
+ e
93
+ ), L = {
94
+ email: i("registrationForm.email"),
95
+ emailConfirm: i("registrationForm.emailConfirm"),
96
+ phone: i("sendRegistrationLink.phone"),
97
+ phoneConfirm: i("sendRegistrationLink.phoneConfirm"),
98
+ allowLoginUntil: i("sendRegistrationLink.allowLoginUntil")
99
+ }, Ae = (e) => j || (e === "allowLoginUntil" ? c !== void 0 : Te[e] === !0), b = (e, o) => Ae(e) && ne[e] ? o : void 0, Ne = {
100
+ email: b(
101
+ "email",
102
+ t.email === "" ? y : i("inputs.email.invalid")
103
+ ),
104
+ emailConfirm: t.emailConfirm === "" ? b("emailConfirm", y) : $.error,
105
+ phone: b(
106
+ "phone",
107
+ t.phone === "" ? y : i("registrationForm.phoneInvalid")
108
+ ),
109
+ phoneConfirm: t.phoneConfirm === "" ? b("phoneConfirm", y) : P.error,
110
+ allowLoginUntil: b(
111
+ "allowLoginUntil",
112
+ c ? i("sendRegistrationLink.dateOutOfRange", {
113
+ min: _(N),
114
+ max: R ? _(R) : "…"
115
+ }) : y
116
+ )
117
+ }, u = (e) => Z[e] ?? Ne[e], oe = I(null), re = I(null), je = I(null), $e = I(null), te = ge(t.email, je), ie = ge(
118
+ t.emailConfirm,
119
+ $e
120
+ ), Pe = (e) => {
121
+ var o, g, fe;
122
+ if (e === "form") {
123
+ (o = re.current) == null || o.focus();
124
+ return;
125
+ }
126
+ (fe = (g = oe.current) == null ? void 0 : g.querySelector(`[data-field="${e}"] input`)) == null || fe.focus();
127
+ }, ae = (e) => q.find((o) => e[o]) ?? (Le(e) ? "form" : void 0), [se] = f(
128
+ () => q.some((e) => !!(C != null && C[e]))
129
+ ), s = on(
130
+ q,
131
+ u,
132
+ se
133
+ ), [z, me] = f(() => {
134
+ const e = se ? void 0 : ae(C ?? {});
135
+ return e ? { target: e } : null;
136
+ });
137
+ We(() => {
138
+ z && Pe(z.target);
139
+ }, [z]);
140
+ const U = rn({
141
+ errors: C,
142
+ submitting: Fe,
143
+ native: d,
144
+ captcha: !1,
145
+ firstProblem: () => q.find((e) => ne[e]),
146
+ onRefused: (e) => {
147
+ Y(!0), s.open(() => me({ target: e }));
148
+ },
149
+ deliver: () => A == null ? void 0 : A({
150
+ ...t,
151
+ allowLoginUntil: c ? ye(c) : ""
152
+ }),
153
+ onAnswer: (e) => {
154
+ const o = e;
155
+ V(o), Le(o) && (Y(!1), s.open(() => {
156
+ const g = ae(o);
157
+ g && me({ target: g });
158
+ }));
159
+ }
160
+ }), le = (e) => d ? l[e] : e, _e = d && O && en(O) ? O : void 0, x = Z.form, ze = tn(
161
+ x,
162
+ s.listed.length > 0
163
+ ), Ge = new Set(Object.values(l ?? {})), He = d ? Object.entries(Ee ?? {}).filter(
164
+ ([e]) => !Ge.has(e)
165
+ ) : [], de = T && nn(T) ? T : void 0, ce = M(w == null ? void 0 : w.allowLoginUntil);
166
+ return w ? /* @__PURE__ */ n(
167
+ "div",
168
+ {
169
+ ref: W,
170
+ ...K,
171
+ "data-component": "send-registration-link-form",
172
+ "data-state": "sent",
173
+ className: ve({ className: H }),
174
+ children: /* @__PURE__ */ n(B, { variant: "elevated", children: /* @__PURE__ */ D(B.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
175
+ /* @__PURE__ */ n(X, { className: "type-title-card", children: a ?? i("sendRegistrationLink.title") }),
176
+ /* @__PURE__ */ D(h, { variant: "success", "data-slot": "sent", children: [
177
+ /* @__PURE__ */ n(h.Title, { as: "p", children: i("sendRegistrationLink.sentTitle") }),
178
+ /* @__PURE__ */ n(h.Description, { children: i("sendRegistrationLink.sentEmail", { email: w.email }) }),
179
+ ce && /* @__PURE__ */ n(h.Description, { children: i("sendRegistrationLink.sentUntil", {
180
+ date: _(ce)
181
+ }) })
182
+ ] }),
183
+ de && /* @__PURE__ */ n(he, { asChild: !0, intent: "secondary", "data-action": "send-another", children: /* @__PURE__ */ n("a", { href: de, children: i("sendRegistrationLink.sendAnother") }) })
184
+ ] }) })
185
+ }
186
+ ) : /* @__PURE__ */ n(
187
+ "div",
188
+ {
189
+ ref: W,
190
+ ...K,
191
+ "data-component": "send-registration-link-form",
192
+ className: ve({ className: H }),
193
+ children: /* @__PURE__ */ n(B, { variant: "elevated", children: /* @__PURE__ */ D(B.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
194
+ /* @__PURE__ */ n(X, { id: J, className: "type-title-card", children: a ?? i("sendRegistrationLink.title") }),
195
+ k && /* @__PURE__ */ D(h, { variant: "warning", "data-slot": "guidance", children: [
196
+ /* @__PURE__ */ n(h.Title, { as: "p", children: k.title }),
197
+ /* @__PURE__ */ n("ul", { className: "ds:mx-0 ds:mb-0 ds:mt-[var(--spacing-xs)] ds:ps-[var(--spacing-lg)] ds:list-disc type-body-sm", children: k.points.map((e) => /* @__PURE__ */ n("li", { children: e }, e)) })
198
+ ] }),
199
+ /* @__PURE__ */ D(
200
+ "form",
201
+ {
202
+ ref: oe,
203
+ noValidate: !0,
204
+ method: "post",
205
+ action: _e,
206
+ "aria-labelledby": J,
207
+ "aria-busy": U.busy || void 0,
208
+ onSubmit: U.handleSubmit,
209
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
210
+ children: [
211
+ /* @__PURE__ */ n(
212
+ Ve,
213
+ {
214
+ ref: s.ref,
215
+ headingLevel: p + 1,
216
+ "aria-describedby": x ? Q : void 0,
217
+ errors: s.listed.map((e) => {
218
+ const o = u(e) ?? "";
219
+ return {
220
+ field: e,
221
+ message: o,
222
+ label: o === y ? L[e] : void 0,
223
+ targetId: v(e)
224
+ };
225
+ })
226
+ }
227
+ ),
228
+ x && /* @__PURE__ */ n(
229
+ h,
230
+ {
231
+ ref: re,
232
+ id: Q,
233
+ variant: "error",
234
+ announce: ze,
235
+ tabIndex: -1,
236
+ "data-field": "form",
237
+ children: /* @__PURE__ */ n(h.Description, { children: x })
238
+ }
239
+ ),
240
+ /* @__PURE__ */ n(
241
+ F,
242
+ {
243
+ id: v("email"),
244
+ label: L.email,
245
+ required: !0,
246
+ error: u("email"),
247
+ announceError: !s.lists("email"),
248
+ "data-field": "email",
249
+ children: /* @__PURE__ */ n(
250
+ pe,
251
+ {
252
+ ref: te.ref,
253
+ name: le("email"),
254
+ errorMessage: null,
255
+ onChange: te.quiet(
256
+ (e) => E("email", e.target.value)
257
+ ),
258
+ onBlur: () => S("email"),
259
+ blockPaste: (m == null ? void 0 : m.includes("email")) ?? !1
260
+ }
261
+ )
262
+ }
263
+ ),
264
+ /* @__PURE__ */ n(
265
+ F,
266
+ {
267
+ id: v("emailConfirm"),
268
+ label: L.emailConfirm,
269
+ required: !0,
270
+ error: u("emailConfirm"),
271
+ announceError: !s.lists("emailConfirm"),
272
+ "data-field": "emailConfirm",
273
+ children: /* @__PURE__ */ n(
274
+ pe,
275
+ {
276
+ ref: ie.ref,
277
+ name: le("emailConfirm"),
278
+ disableBuiltInValidation: !0,
279
+ onChange: ie.quiet(
280
+ (e) => E("emailConfirm", e.target.value)
281
+ ),
282
+ onBlur: () => {
283
+ S("emailConfirm"), $.confirmProps.onBlur();
284
+ },
285
+ blockPaste: (m == null ? void 0 : m.includes("emailConfirm")) ?? !1
286
+ }
287
+ )
288
+ }
289
+ ),
290
+ /* @__PURE__ */ n(
291
+ F,
292
+ {
293
+ id: v("phone"),
294
+ label: L.phone,
295
+ required: !0,
296
+ description: i("sendRegistrationLink.phoneDescription"),
297
+ error: u("phone"),
298
+ announceError: !s.lists("phone"),
299
+ "data-field": "phone",
300
+ onBlur: () => S("phone"),
301
+ children: /* @__PURE__ */ n(
302
+ ue,
303
+ {
304
+ name: d ? void 0 : "phone",
305
+ value: t.phone,
306
+ onChange: (e, o) => {
307
+ E("phone", e), ke(o.isPossible);
308
+ }
309
+ }
310
+ )
311
+ }
312
+ ),
313
+ /* @__PURE__ */ n(
314
+ F,
315
+ {
316
+ id: v("phoneConfirm"),
317
+ label: L.phoneConfirm,
318
+ required: !0,
319
+ error: u("phoneConfirm"),
320
+ announceError: !s.lists("phoneConfirm"),
321
+ "data-field": "phoneConfirm",
322
+ onBlur: () => {
323
+ S("phoneConfirm"), P.confirmProps.onBlur();
324
+ },
325
+ onPasteCapture: m != null && m.includes("phoneConfirm") ? (e) => e.preventDefault() : void 0,
326
+ children: /* @__PURE__ */ n(
327
+ ue,
328
+ {
329
+ name: d ? void 0 : "phoneConfirm",
330
+ value: t.phoneConfirm,
331
+ onChange: (e) => E("phoneConfirm", e)
332
+ }
333
+ )
334
+ }
335
+ ),
336
+ /* @__PURE__ */ n(
337
+ F,
338
+ {
339
+ id: v("allowLoginUntil"),
340
+ label: L.allowLoginUntil,
341
+ required: !0,
342
+ error: u("allowLoginUntil"),
343
+ announceError: !s.lists("allowLoginUntil"),
344
+ "data-field": "allowLoginUntil",
345
+ children: /* @__PURE__ */ n(
346
+ Ze,
347
+ {
348
+ value: c,
349
+ minDate: N,
350
+ maxDate: R,
351
+ onChange: (e) => {
352
+ qe(e), ee("allowLoginUntil");
353
+ }
354
+ }
355
+ )
356
+ }
357
+ ),
358
+ d && l.phone && /* @__PURE__ */ n(
359
+ "input",
360
+ {
361
+ type: "hidden",
362
+ name: l.phone,
363
+ value: t.phone
364
+ }
365
+ ),
366
+ d && l.phoneConfirm && /* @__PURE__ */ n(
367
+ "input",
368
+ {
369
+ type: "hidden",
370
+ name: l.phoneConfirm,
371
+ value: t.phoneConfirm
372
+ }
373
+ ),
374
+ d && l.allowLoginUntil && /* @__PURE__ */ n(
375
+ "input",
376
+ {
377
+ type: "hidden",
378
+ name: l.allowLoginUntil,
379
+ value: c ? ye(c) : ""
380
+ }
381
+ ),
382
+ He.map(([e, o]) => /* @__PURE__ */ n("input", { type: "hidden", name: e, value: o }, e)),
383
+ /* @__PURE__ */ n(
384
+ he,
385
+ {
386
+ type: "submit",
387
+ intent: "primary",
388
+ size: "lg",
389
+ loading: U.busy,
390
+ className: "ds:w-full",
391
+ "data-action": "submit",
392
+ children: De ?? i("sendRegistrationLink.submit")
393
+ }
394
+ ),
395
+ /* @__PURE__ */ n("p", { role: "status", className: "ds:sr-only", children: U.busy ? i("chat.message.status.sending") : "" })
396
+ ]
397
+ }
398
+ )
399
+ ] }) })
400
+ }
401
+ );
402
+ }
403
+ );
404
+ fn.displayName = "SendRegistrationLinkForm";
405
+ export {
406
+ q as S,
407
+ fn as a
408
+ };
409
+ //# sourceMappingURL=send-registration-link-form-pO2bGjGa.js.map
@@ -7,8 +7,8 @@ import { I as q } from "./icon-button-S8_weU3g.js";
7
7
  import { E as xe } from "./empty-state-DwJ5YNzz.js";
8
8
  import { S as W } from "./skeleton-tTWJpvAq.js";
9
9
  import { u as Se } from "./registry-DvAUVLHh.js";
10
- import { b as ke, f as De } from "./format-D-1gTdHF.js";
11
- import { p as Ie } from "./parseISO-y3LncvfO.js";
10
+ import { d as ke, f as De } from "./format--x5jypvH.js";
11
+ import { p as Ie } from "./parseISO-DZZ5a-zK.js";
12
12
  const Ge = {
13
13
  id: "slot-grid",
14
14
  // pick → `select_slot` + the `selectedSlotId` state slot.
@@ -637,4 +637,4 @@ export {
637
637
  Qe as i,
638
638
  Ge as s
639
639
  };
640
- //# sourceMappingURL=slot-grid-uA9j7Nik.js.map
640
+ //# sourceMappingURL=slot-grid-Bb13H9Rl.js.map
@@ -1,4 +1,4 @@
1
- import { d as s, o as r, p as i, q as m } from "./format-D-1gTdHF.js";
1
+ import { e as s, p as r, q as i, r as m } from "./format--x5jypvH.js";
2
2
  const d = {
3
3
  lessThanXSeconds: {
4
4
  one: "më pak se një sekondë",
@@ -352,4 +352,4 @@ const d = {
352
352
  export {
353
353
  T as sq
354
354
  };
355
- //# sourceMappingURL=sq-DnvsgyIh.js.map
355
+ //# sourceMappingURL=sq-D4c7olaV.js.map
@@ -0,0 +1,8 @@
1
+ import { b as o } from "./date-picker-variants-Dt6UbonG.js";
2
+ function n(s, a, r) {
3
+ return o(s, -a, r);
4
+ }
5
+ export {
6
+ n as s
7
+ };
8
+ //# sourceMappingURL=subDays-DKISP2nE.js.map
@@ -1,4 +1,4 @@
1
- import { d, o as r, p as i, q as m } from "./format-D-1gTdHF.js";
1
+ import { e as d, p as r, q as i, r as m } from "./format--x5jypvH.js";
2
2
  const s = {
3
3
  lessThanXSeconds: {
4
4
  one: "mindre än en sekund",
@@ -373,4 +373,4 @@ const s = {
373
373
  export {
374
374
  q as sv
375
375
  };
376
- //# sourceMappingURL=sv-CpFSK8xS.js.map
376
+ //# sourceMappingURL=sv-Bf_dHPvh.js.map
@@ -7,7 +7,7 @@ import { B as Me } from "./button-DohK_Ak_.js";
7
7
  import { I as We } from "./icon-button-S8_weU3g.js";
8
8
  import { C as Qe } from "./combobox-vF9O-QoG.js";
9
9
  import { D as ce } from "./dialog-C7RWaH08.js";
10
- import { D as Bt } from "./date-picker-KcoNNsM0.js";
10
+ import { D as Bt } from "./date-picker-CdhXlgVI.js";
11
11
  import { F as H } from "./form-field-Ani72sVY.js";
12
12
  import { I as Ft } from "./icon-button-group-CRKFR48b.js";
13
13
  import { P as Pt } from "./panel-header-CbtlTe85.js";
@@ -1239,4 +1239,4 @@ export {
1239
1239
  vn as T,
1240
1240
  ln as t
1241
1241
  };
1242
- //# sourceMappingURL=task-editor-BTeUFGUX.js.map
1242
+ //# sourceMappingURL=task-editor-CRhfwP9T.js.map
@@ -1,4 +1,4 @@
1
- import { d as o, o as n, p as i, q as m } from "./format-D-1gTdHF.js";
1
+ import { e as o, p as n, q as i, r as m } from "./format--x5jypvH.js";
2
2
  const d = {
3
3
  lessThanXSeconds: {
4
4
  one: "bir saniyeden az",
@@ -375,4 +375,4 @@ const d = {
375
375
  export {
376
376
  O as tr
377
377
  };
378
- //# sourceMappingURL=tr-DW4oQYHT.js.map
378
+ //# sourceMappingURL=tr-xqQ6cbGY.js.map
@@ -16,7 +16,7 @@ import { E as zt } from "./editable-description-KU56SP4P.js";
16
16
  import { N as Xe } from "./note-timeline-KzL52MmB.js";
17
17
  import { P as Ot } from "./panel-header-CbtlTe85.js";
18
18
  import { P as Ge } from "./panel-subview-DCyvn-49.js";
19
- import { P as _t } from "./patient-summary-card-BSOHR4Ol.js";
19
+ import { P as _t } from "./patient-summary-card-BTKvFUmh.js";
20
20
  import { S as ne } from "./section-card-D5nWiTcK.js";
21
21
  import { C as nn, S as ue } from "./skeleton-tTWJpvAq.js";
22
22
  import { T as an } from "./text-area-COMVJ1yE.js";
@@ -2195,4 +2195,4 @@ export {
2195
2195
  Kn as s,
2196
2196
  _s as u
2197
2197
  };
2198
- //# sourceMappingURL=use-appointment-details-read-BWbOiLVw.js.map
2198
+ //# sourceMappingURL=use-appointment-details-read-BFslxbRr.js.map
@@ -0,0 +1,30 @@
1
+ import { useState as M, useCallback as w, useEffect as E } from "react";
2
+ import { useTranslation as b } from "react-i18next";
3
+ const L = {
4
+ email: (e) => e.trim().toLowerCase(),
5
+ password: (e) => e,
6
+ // Phones arrive in E.164 form, so they are compared as they come.
7
+ phone: (e) => e
8
+ };
9
+ function C({
10
+ value: e,
11
+ confirmValue: i,
12
+ kind: s,
13
+ submitted: f = !1,
14
+ normalise: u
15
+ }) {
16
+ const { t: o } = b("ui"), [m, a] = M(!1), p = w(() => a(!0), []), c = u ?? L[s], t = c(e), r = c(i), n = t === r, h = t !== "" && r !== "" && !n, l = t === "" && r === "";
17
+ E(() => {
18
+ l && a(!1);
19
+ }, [l]);
20
+ const d = o(s === "email" ? "fieldMatch.email" : s === "phone" ? "fieldMatch.phone" : "fieldMatch.password");
21
+ return {
22
+ matches: n,
23
+ error: h && (m || f) ? d : void 0,
24
+ confirmProps: { onBlur: p }
25
+ };
26
+ }
27
+ export {
28
+ C as u
29
+ };
30
+ //# sourceMappingURL=use-field-match-C8ug3sdQ.js.map
@@ -0,0 +1,112 @@
1
+ import { useState as d, useRef as i, useEffect as S } from "react";
2
+ function N(r, e, c = !1) {
3
+ const [n, E] = d(
4
+ () => c ? {} : null
5
+ ), [g, T] = d(null), [s, v] = d([]);
6
+ if (n !== g)
7
+ T(n), v(r.filter((t) => !!e(t)));
8
+ else {
9
+ const t = s.filter((l) => !!e(l));
10
+ t.length !== s.length && v(t);
11
+ }
12
+ const h = i(null), o = i(null);
13
+ return S(() => {
14
+ var t, l;
15
+ !n || o.current === n || (o.current = n, s.length > 0 ? (t = h.current) == null || t.focus() : (l = n.fallback) == null || l.call(n));
16
+ }, [n, s]), {
17
+ listed: s,
18
+ lists: (t) => s.includes(t),
19
+ // A new object each time, so a second refused submit moves focus again.
20
+ open: (t) => E({ fallback: t }),
21
+ ref: h
22
+ };
23
+ }
24
+ function H(r, e) {
25
+ const [c, n] = d(void 0);
26
+ return r && e && c !== r && n(r), !r && c !== void 0 && n(void 0), r && (e || c === r) ? "off" : void 0;
27
+ }
28
+ const x = 8e3, B = (r) => JSON.stringify(
29
+ Object.entries(r ?? {}).filter(([, e]) => !!e).sort(([e], [c]) => e < c ? -1 : e > c ? 1 : 0)
30
+ );
31
+ function O(r) {
32
+ const e = i(r);
33
+ e.current = r;
34
+ const [c, n] = d(!1), [E, g] = d(!1), [T, s] = d(!1), v = r.submitting || c || E, h = i(null), o = i(!1), t = i(void 0), l = i(!1), m = i(!1), A = i(void 0), P = () => {
35
+ o.current = !1, clearTimeout(t.current), g(!1);
36
+ };
37
+ S(() => () => clearTimeout(t.current), []);
38
+ const R = (u) => {
39
+ e.current.native ? n(!0) : (l.current = !0, m.current = !1, A.current = e.current.errors), e.current.deliver(u);
40
+ }, C = (u) => {
41
+ if (v) {
42
+ u.preventDefault();
43
+ return;
44
+ }
45
+ s(!1);
46
+ const f = e.current.firstProblem();
47
+ if (f !== void 0) {
48
+ u.preventDefault(), e.current.onRefused(f);
49
+ return;
50
+ }
51
+ if (e.current.captcha) {
52
+ u.preventDefault();
53
+ const a = h.current;
54
+ if (!a) {
55
+ s(!0);
56
+ return;
57
+ }
58
+ o.current = !1, a.reset(), o.current = !0, g(!0), clearTimeout(t.current), t.current = setTimeout(
59
+ () => g(!1),
60
+ x
61
+ ), a.execute();
62
+ return;
63
+ }
64
+ if (e.current.native) {
65
+ n(!0);
66
+ return;
67
+ }
68
+ u.preventDefault(), R();
69
+ }, F = (u) => {
70
+ if (!o.current) return;
71
+ if (P(), !u) {
72
+ s(!0);
73
+ return;
74
+ }
75
+ const f = e.current.firstProblem();
76
+ if (f !== void 0) {
77
+ e.current.onRefused(f);
78
+ return;
79
+ }
80
+ R(u);
81
+ }, D = () => {
82
+ o.current && (P(), s(!0));
83
+ }, p = r.errors, b = B(p), w = i(null);
84
+ return S(() => {
85
+ var a;
86
+ if (w.current === null) {
87
+ w.current = b;
88
+ return;
89
+ }
90
+ const u = b !== w.current;
91
+ w.current = b, l.current && r.submitting && (m.current = !0);
92
+ const f = l.current && m.current && !r.submitting && p !== A.current;
93
+ !u && !f || (l.current = !1, m.current = !1, o.current = !1, clearTimeout(t.current), g(!1), (a = h.current) == null || a.reset(), e.current.onAnswer(p ?? {}));
94
+ }, [p, b, r.submitting]), S(() => {
95
+ const u = (f) => {
96
+ var a, y;
97
+ f.persisted && (n(!1), (y = (a = e.current).onRestore) == null || y.call(a));
98
+ };
99
+ return window.addEventListener("pageshow", u), () => window.removeEventListener("pageshow", u);
100
+ }, []), {
101
+ busy: v,
102
+ captchaFailed: T,
103
+ handleSubmit: C,
104
+ captcha: { ref: h, onChange: F, onError: D }
105
+ };
106
+ }
107
+ export {
108
+ H as a,
109
+ O as b,
110
+ N as u
111
+ };
112
+ //# sourceMappingURL=use-registration-submit-CLGHxwoT.js.map