@alfadocs/ui-kit 0.37.0 → 0.39.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 (263) hide show
  1. package/dist/_chunks/Alfadocs_Logo_Mark-7o3L3WBI.js +56 -0
  2. package/dist/_chunks/{accordion-bSU21uTV.js → accordion-9lJSMMsZ.js} +6 -6
  3. package/dist/_chunks/{agenda-tray-By_asPN9.js → agenda-tray-Dyj9ChHC.js} +22 -21
  4. package/dist/_chunks/{alia-sidebar-BEoMl6UL.js → alia-sidebar-DXsYPinm.js} +2 -2
  5. package/dist/_chunks/{ar-D1RwVZFj.js → ar-Cn_NxqkN.js} +2 -2
  6. package/dist/_chunks/bmi-BxD-tFzU.js +32 -0
  7. package/dist/_chunks/bmi-calculator-DnEr513I.js +213 -0
  8. package/dist/_chunks/{booking-DqXsd1Mv.js → booking-4mCw3Mpl.js} +5 -5
  9. package/dist/_chunks/calculator-dialog-B74fqpFZ.js +40 -0
  10. package/dist/_chunks/{chart-DnHvmiDX.js → chart-Cbt0_sKv.js} +46 -37
  11. package/dist/_chunks/{chat-message-D53_fH2w.js → chat-message-ASgGtj-L.js} +30 -39
  12. package/dist/_chunks/{collapsible-CERONory.js → collapsible-X3oaLPU3.js} +5 -5
  13. package/dist/_chunks/{contact-profile-card-BA6fgS45.js → contact-profile-card-DHyuAPXM.js} +14 -13
  14. package/dist/_chunks/cycle-calculator-B5Uj9QeT.js +185 -0
  15. package/dist/_chunks/{date-picker-CXFpu-qY.js → date-picker-CvQfs6Xh.js} +2 -2
  16. package/dist/_chunks/{date-range-picker-I-q5rifj.js → date-range-picker-U9fn1g9d.js} +3 -3
  17. package/dist/_chunks/{date-time-picker-CqpGPlcH.js → date-time-picker-Cva0ZCWw.js} +2 -2
  18. package/dist/_chunks/{de-HTQ4b4-J.js → de-BMM2H7Bs.js} +2 -2
  19. package/dist/_chunks/dependent-selector-CRWgieHm.js +324 -0
  20. package/dist/_chunks/document-scanner-CqS_klIr.js +703 -0
  21. package/dist/_chunks/due-date-calculator-CUspKSTw.js +171 -0
  22. package/dist/_chunks/{editable-currency-cell-renderer-DnjwZNZP.js → editable-currency-cell-renderer-DgkCIIcO.js} +3 -3
  23. package/dist/_chunks/{el-Dr1pjuDq.js → el-BYPonAaK.js} +2 -2
  24. package/dist/_chunks/{es-CvyTjLS0.js → es-CMkVCQ4F.js} +2 -2
  25. package/dist/_chunks/{file-upload-CdozCPct.js → file-upload-BosbPDb1.js} +3 -2
  26. package/dist/_chunks/fiscal-code-input-BZ0FxwUl.js +540 -0
  27. package/dist/_chunks/{fr-CS7aqaFR.js → fr-BcuWxqft.js} +2 -2
  28. package/dist/_chunks/{freemium-paywall-D1N02Oam.js → freemium-paywall-BAk3a6er.js} +7 -7
  29. package/dist/_chunks/gestation-BXEgDGmP.js +50 -0
  30. package/dist/_chunks/gestational-age-calculator-CsQ05qDy.js +165 -0
  31. package/dist/_chunks/header-settings-CBLwUK6t.js +244 -0
  32. package/dist/_chunks/heart-C0faivFf.js +20 -0
  33. package/dist/_chunks/{hi-3uy8KpsH.js → hi-wkq_rQAh.js} +2 -2
  34. package/dist/_chunks/image-C6RM5hfF.js +16 -0
  35. package/dist/_chunks/insert-result-yJ0QavoN.js +133 -0
  36. package/dist/_chunks/{isSameWeek-DRpMibi9.js → isSameWeek-Bim5ftRd.js} +2 -2
  37. package/dist/_chunks/{it-B_RF5VSw.js → it-GiQrQ9p4.js} +3 -3
  38. package/dist/_chunks/{ja-C1mEYy35.js → ja-qfYg3Rua.js} +2 -2
  39. package/dist/_chunks/{logo-_Z-jLq80.js → logo-yituK7sE.js} +42 -91
  40. package/dist/_chunks/{map-view-vD5pvWs9.js → map-view-qJLybrmN.js} +2 -2
  41. package/dist/_chunks/marketplace-app-shell-BlxVizU4.js +296 -0
  42. package/dist/_chunks/{message-card-BbRhZkDI.js → message-card-DSPw5ghw.js} +20 -19
  43. package/dist/_chunks/{message-tray-B762TKuv.js → message-tray-hSQff9u4.js} +3 -3
  44. package/dist/_chunks/{nl-Dl7lO2t3.js → nl-xOogO4sZ.js} +2 -2
  45. package/dist/_chunks/{notification-card-DMdO4g54.js → notification-card-CObnGdJu.js} +22 -21
  46. package/dist/_chunks/{notification-tray-Dl3FTleW.js → notification-tray-BWHDIjgd.js} +2 -2
  47. package/dist/_chunks/{otp-input-CDTWT5EK.js → otp-input-CMphfBxZ.js} +70 -71
  48. package/dist/_chunks/{patient-shell-CDvMw_Nk.js → patient-shell-DF81lALv.js} +37 -36
  49. package/dist/_chunks/{payment-form-D5rgnZu7.js → payment-form-Dy3WIIsC.js} +18 -18
  50. package/dist/_chunks/{pdf-viewer-DvtEHcEP.js → pdf-viewer-Cy6Ul3hZ.js} +2 -2
  51. package/dist/_chunks/{pl-Dgsogljx.js → pl-GnOW6eGK.js} +3 -3
  52. package/dist/_chunks/{practice-results-BFM_lyUs.js → practice-results-C0d4IL5E.js} +4 -3
  53. package/dist/_chunks/pregnancy-weight-gain-BCdi-JSv.js +209 -0
  54. package/dist/_chunks/{privacy-lock-DD-wHxBg.js → privacy-lock-BmX_gkvt.js} +2 -2
  55. package/dist/_chunks/{pt-Dm2JF4bc.js → pt-_bV5b5RW.js} +2 -2
  56. package/dist/_chunks/{public-footer.agent-Cjfe5jus.js → public-footer.agent-okt8ZRc5.js} +3 -3
  57. package/dist/_chunks/qr-code-DNXhi6se.js +568 -0
  58. package/dist/_chunks/{react-day-picker-DYDdR8Vv.js → react-day-picker-CdtIiKjx.js} +24 -24
  59. package/dist/_chunks/{reviews-panel-Dow8Dzoa.js → reviews-panel-CPrXu5TX.js} +2 -2
  60. package/dist/_chunks/{rich-text-editor-CHmr9Bz8.js → rich-text-editor-DLbg2852.js} +114 -124
  61. package/dist/_chunks/{ro-BXFZ_xIX.js → ro-BEcyh5Nj.js} +2 -2
  62. package/dist/_chunks/rotate-ccw-BWANpitO.js +15 -0
  63. package/dist/_chunks/{ru-BPQkNRRV.js → ru-Bi86hqMf.js} +3 -3
  64. package/dist/_chunks/session-countdown-LPnhTHjn.js +214 -0
  65. package/dist/_chunks/{shield-check-BhHyReu8.js → shield-check-C73ma9Cs.js} +8 -24
  66. package/dist/_chunks/{sidebar-BbR8f6oe.js → sidebar-_vJXI9rB.js} +2 -2
  67. package/dist/_chunks/sign-document-DId1p-nn.js +315 -0
  68. package/dist/_chunks/{sign-in-with-alfadocs-button-BI0fVonM.js → sign-in-with-alfadocs-button-DeHBFRNS.js} +2 -2
  69. package/dist/_chunks/{signature-capture-C-fF71xI.js → signature-capture-BRzCklg4.js} +27 -24
  70. package/dist/_chunks/social-sign-in-button-X54ySJr1.js +243 -0
  71. package/dist/_chunks/{sparkline-DEROcSl0.js → sparkline-DGhCSw8M.js} +55 -46
  72. package/dist/_chunks/{sq-ChTlGFcJ.js → sq-BujHSAWu.js} +2 -2
  73. package/dist/_chunks/{stepper-accordion-BfS6lUB9.js → stepper-accordion-Dki6r9ZE.js} +2 -2
  74. package/dist/_chunks/subDays-_T9YeKPX.js +8 -0
  75. package/dist/_chunks/{sv-Do_gs6ir.js → sv-C8AeDrTA.js} +2 -2
  76. package/dist/_chunks/{tag-CyoaEmf_.js → tag-CdA0s_VV.js} +16 -16
  77. package/dist/_chunks/{task-card-BUVMh6HN.js → task-card-CPyQ5AXC.js} +6 -5
  78. package/dist/_chunks/{task-tray-DRK0b0Qb.js → task-tray-B8jFv5FV.js} +36 -35
  79. package/dist/_chunks/{tr-da_UnkYH.js → tr-CMSs_Vgf.js} +2 -2
  80. package/dist/_chunks/{transcript-panel-DyhTpAP7.js → transcript-panel-CR7VY1uw.js} +8 -7
  81. package/dist/_chunks/unit-converter-EUwO6QYq.js +168 -0
  82. package/dist/_chunks/wallet-pay-button-DK4ESYge.js +250 -0
  83. package/dist/_chunks/{warning-stack-bDicCvxs.js → warning-stack-DNR3-IbP.js} +17 -16
  84. package/dist/_chunks/{workflow-map-uSiHbOWQ.js → workflow-map-C3gB0FvB.js} +3 -2
  85. package/dist/_chunks/{zh-CN-C9qi5oak.js → zh-CN-eXB-PFu4.js} +3 -3
  86. package/dist/agent-catalog.json +241 -1
  87. package/dist/brand/provider-marks/apple-pay.d.ts +12 -0
  88. package/dist/brand/provider-marks/apple.d.ts +12 -0
  89. package/dist/brand/provider-marks/google-pay.d.ts +12 -0
  90. package/dist/brand/provider-marks/google.d.ts +13 -0
  91. package/dist/components/_shared/insert-result.d.ts +47 -0
  92. package/dist/components/accordion/index.js +1 -1
  93. package/dist/components/agenda-tray/index.js +1 -1
  94. package/dist/components/bmi-calculator/bmi-calculator.d.ts +3 -0
  95. package/dist/components/bmi-calculator/index.js +6 -5
  96. package/dist/components/booking/index.js +1 -1
  97. package/dist/components/calculator-dialog/calculator-dialog.d.ts +26 -0
  98. package/dist/components/calculator-dialog/index.d.ts +3 -0
  99. package/dist/components/calculator-dialog/index.js +5 -0
  100. package/dist/components/chart/chart.d.ts +1 -1
  101. package/dist/components/chart/index.js +1 -1
  102. package/dist/components/chat-message/index.js +1 -1
  103. package/dist/components/collapsible/index.js +1 -1
  104. package/dist/components/contact-profile-card/index.js +1 -1
  105. package/dist/components/cycle-calculator/cycle-calculator.d.ts +21 -0
  106. package/dist/components/cycle-calculator/cycle.d.ts +37 -0
  107. package/dist/components/cycle-calculator/index.d.ts +4 -0
  108. package/dist/components/cycle-calculator/index.js +7 -0
  109. package/dist/components/data-table/index.js +1 -1
  110. package/dist/components/date-picker/index.js +1 -1
  111. package/dist/components/date-range-picker/index.js +1 -1
  112. package/dist/components/date-time-picker/index.js +1 -1
  113. package/dist/components/dependent-selector/dependent-selector.agent.d.ts +4 -0
  114. package/dist/components/dependent-selector/dependent-selector.d.ts +72 -0
  115. package/dist/components/dependent-selector/index.d.ts +4 -0
  116. package/dist/components/dependent-selector/index.js +6 -0
  117. package/dist/components/document-scanner/document-scanner.agent.d.ts +4 -0
  118. package/dist/components/document-scanner/document-scanner.d.ts +93 -0
  119. package/dist/components/document-scanner/index.d.ts +4 -0
  120. package/dist/components/document-scanner/index.js +6 -0
  121. package/dist/components/due-date-calculator/due-date-calculator.d.ts +3 -0
  122. package/dist/components/due-date-calculator/gestation.d.ts +16 -0
  123. package/dist/components/due-date-calculator/index.d.ts +1 -1
  124. package/dist/components/due-date-calculator/index.js +10 -7
  125. package/dist/components/file-upload/index.js +1 -1
  126. package/dist/components/fiscal-code-input/calculate-codice-fiscale.d.ts +24 -0
  127. package/dist/components/fiscal-code-input/fiscal-code-input.agent.d.ts +4 -0
  128. package/dist/components/fiscal-code-input/fiscal-code-input.d.ts +61 -0
  129. package/dist/components/fiscal-code-input/index.d.ts +6 -0
  130. package/dist/components/fiscal-code-input/index.js +11 -0
  131. package/dist/components/fiscal-code-input/is-valid-codice-fiscale.d.ts +21 -0
  132. package/dist/components/freemium-paywall/index.js +1 -1
  133. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +27 -0
  134. package/dist/components/gestational-age-calculator/index.d.ts +3 -0
  135. package/dist/components/gestational-age-calculator/index.js +5 -0
  136. package/dist/components/header-settings/header-settings.agent.d.ts +4 -0
  137. package/dist/components/header-settings/header-settings.d.ts +36 -0
  138. package/dist/components/header-settings/index.d.ts +2 -0
  139. package/dist/components/header-settings/index.js +2 -241
  140. package/dist/components/index.d.ts +14 -0
  141. package/dist/components/locale-picker/locale-picker.agent.d.ts +4 -0
  142. package/dist/components/locale-picker/locale-picker.d.ts +80 -0
  143. package/dist/components/logo/index.js +1 -1
  144. package/dist/components/map-view/index.js +1 -1
  145. package/dist/components/message-card/index.js +1 -1
  146. package/dist/components/message-tray/index.js +1 -1
  147. package/dist/components/notification-card/index.js +1 -1
  148. package/dist/components/notification-tray/index.js +1 -1
  149. package/dist/components/otp-input/index.d.ts +1 -1
  150. package/dist/components/otp-input/index.js +1 -1
  151. package/dist/components/otp-input/otp-input.d.ts +1 -1
  152. package/dist/components/payment-form/index.js +1 -1
  153. package/dist/components/pdf-viewer/index.js +1 -1
  154. package/dist/components/practice-results/index.js +1 -1
  155. package/dist/components/pregnancy-weight-gain/index.d.ts +4 -0
  156. package/dist/components/pregnancy-weight-gain/index.js +9 -0
  157. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +19 -0
  158. package/dist/components/pregnancy-weight-gain/weight-gain.d.ts +41 -0
  159. package/dist/components/privacy-lock/index.js +1 -1
  160. package/dist/components/public-footer/index.js +1 -1
  161. package/dist/components/qr-code/index.d.ts +5 -0
  162. package/dist/components/qr-code/index.js +8 -0
  163. package/dist/components/qr-code/qr-code.agent.d.ts +3 -0
  164. package/dist/components/qr-code/qr-code.d.ts +59 -0
  165. package/dist/components/qr-code/qr-encode.d.ts +46 -0
  166. package/dist/components/reviews-panel/index.js +1 -1
  167. package/dist/components/rich-text-editor/index.js +1 -1
  168. package/dist/components/session-countdown/index.d.ts +4 -0
  169. package/dist/components/session-countdown/index.js +6 -0
  170. package/dist/components/session-countdown/session-countdown.agent.d.ts +3 -0
  171. package/dist/components/session-countdown/session-countdown.d.ts +38 -0
  172. package/dist/components/sidebar/index.js +1 -1
  173. package/dist/components/sign-document/index.d.ts +4 -0
  174. package/dist/components/sign-document/index.js +6 -0
  175. package/dist/components/sign-document/sign-document.agent.d.ts +4 -0
  176. package/dist/components/sign-document/sign-document.d.ts +47 -0
  177. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  178. package/dist/components/signature-capture/index.js +1 -1
  179. package/dist/components/social-sign-in-button/index.d.ts +3 -0
  180. package/dist/components/social-sign-in-button/index.js +5 -0
  181. package/dist/components/social-sign-in-button/social-sign-in-button.d.ts +56 -0
  182. package/dist/components/sparkline/index.js +1 -1
  183. package/dist/components/sparkline/sparkline.d.ts +1 -1
  184. package/dist/components/stepper-accordion/index.js +1 -1
  185. package/dist/components/tag/index.js +1 -1
  186. package/dist/components/task-card/index.js +1 -1
  187. package/dist/components/task-tray/index.js +1 -1
  188. package/dist/components/transcript-panel/index.js +1 -1
  189. package/dist/components/unit-converter/index.d.ts +4 -0
  190. package/dist/components/unit-converter/index.js +9 -0
  191. package/dist/components/unit-converter/unit-converter.d.ts +21 -0
  192. package/dist/components/unit-converter/units.d.ts +18 -0
  193. package/dist/components/wallet-pay-button/index.d.ts +3 -0
  194. package/dist/components/wallet-pay-button/index.js +5 -0
  195. package/dist/components/wallet-pay-button/wallet-pay-button.d.ts +63 -0
  196. package/dist/components/warning-stack/index.js +1 -1
  197. package/dist/components/workflow/index.js +1 -1
  198. package/dist/i18n/locale-meta.d.ts +56 -0
  199. package/dist/i18n/locales/ar.d.ts +274 -0
  200. package/dist/i18n/locales/ar.js +271 -0
  201. package/dist/i18n/locales/de.d.ts +274 -0
  202. package/dist/i18n/locales/de.js +271 -0
  203. package/dist/i18n/locales/el.d.ts +274 -0
  204. package/dist/i18n/locales/el.js +271 -0
  205. package/dist/i18n/locales/en.d.ts +274 -0
  206. package/dist/i18n/locales/en.js +274 -0
  207. package/dist/i18n/locales/es.d.ts +274 -0
  208. package/dist/i18n/locales/es.js +271 -0
  209. package/dist/i18n/locales/fr.d.ts +274 -0
  210. package/dist/i18n/locales/fr.js +271 -0
  211. package/dist/i18n/locales/hi.d.ts +274 -0
  212. package/dist/i18n/locales/hi.js +271 -0
  213. package/dist/i18n/locales/it.d.ts +274 -0
  214. package/dist/i18n/locales/it.js +271 -0
  215. package/dist/i18n/locales/ja.d.ts +274 -0
  216. package/dist/i18n/locales/ja.js +267 -0
  217. package/dist/i18n/locales/nl.d.ts +274 -0
  218. package/dist/i18n/locales/nl.js +271 -0
  219. package/dist/i18n/locales/pl.d.ts +274 -0
  220. package/dist/i18n/locales/pl.js +271 -0
  221. package/dist/i18n/locales/pt.d.ts +274 -0
  222. package/dist/i18n/locales/pt.js +274 -0
  223. package/dist/i18n/locales/ro.d.ts +274 -0
  224. package/dist/i18n/locales/ro.js +271 -0
  225. package/dist/i18n/locales/ru.d.ts +274 -0
  226. package/dist/i18n/locales/ru.js +271 -0
  227. package/dist/i18n/locales/sq.d.ts +274 -0
  228. package/dist/i18n/locales/sq.js +271 -0
  229. package/dist/i18n/locales/sv.d.ts +274 -0
  230. package/dist/i18n/locales/sv.js +271 -0
  231. package/dist/i18n/locales/tr.d.ts +274 -0
  232. package/dist/i18n/locales/tr.js +271 -0
  233. package/dist/i18n/locales/zh.d.ts +274 -0
  234. package/dist/i18n/locales/zh.js +267 -0
  235. package/dist/index.js +590 -535
  236. package/dist/locales/ar.json +274 -0
  237. package/dist/locales/de.json +274 -0
  238. package/dist/locales/el.json +274 -0
  239. package/dist/locales/en.json +274 -0
  240. package/dist/locales/es.json +274 -0
  241. package/dist/locales/fr.json +274 -0
  242. package/dist/locales/hi.json +274 -0
  243. package/dist/locales/it.json +274 -0
  244. package/dist/locales/ja.json +274 -0
  245. package/dist/locales/nl.json +274 -0
  246. package/dist/locales/pl.json +274 -0
  247. package/dist/locales/pt.json +274 -0
  248. package/dist/locales/ro.json +274 -0
  249. package/dist/locales/ru.json +274 -0
  250. package/dist/locales/sq.json +274 -0
  251. package/dist/locales/sv.json +274 -0
  252. package/dist/locales/tr.json +274 -0
  253. package/dist/locales/zh.json +274 -0
  254. package/dist/patterns/alia-assistant/index.js +1 -1
  255. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  256. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +12 -8
  257. package/dist/patterns/patient-shell/index.js +1 -1
  258. package/dist/tokens.css +1 -1
  259. package/package.json +53 -1
  260. package/dist/_chunks/bmi-calculator-DQD5_nE-.js +0 -214
  261. package/dist/_chunks/due-date-calculator-kf9U_g7O.js +0 -173
  262. package/dist/_chunks/marketplace-app-shell-DXHxy9dj.js +0 -295
  263. package/dist/_chunks/subDays-D-WYRpdW.js +0 -8
@@ -0,0 +1,703 @@
1
+ import { jsxs as p, jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as Fe, useId as Te, useRef as m, useState as Y, useEffect as k, useCallback as h, useMemo as We, useImperativeHandle as Ye } from "react";
3
+ import { c as z } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as $e } from "react-i18next";
5
+ import { B as H } from "./button-DD_0Xdmr.js";
6
+ import { A as ae } from "./alert-ywPR59NE.js";
7
+ import { L as he, F as Xe } from "./file-upload-BosbPDb1.js";
8
+ import { u as Ze } from "./use-controllable-state-BiY4xTzM.js";
9
+ import { u as Ge } from "./registry-nPAVE19X.js";
10
+ import { R as Je } from "./rotate-ccw-BWANpitO.js";
11
+ import { C as Qe } from "./check-DPdL_Sm7.js";
12
+ import { c as ze } from "./createLucideIcon-CrFbzy84.js";
13
+ /**
14
+ * @license lucide-react v1.8.0 - ISC
15
+ *
16
+ * This source code is licensed under the ISC license.
17
+ * See the LICENSE file in the root directory of this source tree.
18
+ */
19
+ const er = [
20
+ [
21
+ "path",
22
+ {
23
+ d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
24
+ key: "18u6gg"
25
+ }
26
+ ],
27
+ ["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
28
+ ], ye = ze("camera", er);
29
+ /**
30
+ * @license lucide-react v1.8.0 - ISC
31
+ *
32
+ * This source code is licensed under the ISC license.
33
+ * See the LICENSE file in the root directory of this source tree.
34
+ */
35
+ const rr = [
36
+ [
37
+ "path",
38
+ {
39
+ d: "M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",
40
+ key: "9csbqa"
41
+ }
42
+ ],
43
+ ["path", { d: "m14 19.5 3-3 3 3", key: "9vmjn0" }],
44
+ ["path", { d: "M17 22v-5.5", key: "1aa6fl" }],
45
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
46
+ ], tr = ze("image-up", rr), nr = {
47
+ id: "document-scanner",
48
+ capabilities: ["submit"],
49
+ state: {
50
+ hasCapture: {
51
+ type: "boolean",
52
+ descriptionKey: "documentScanner.agent.state.hasCapture",
53
+ description: "True when a captured or uploaded image is available.",
54
+ read: (a) => a.hasCapture()
55
+ },
56
+ phase: {
57
+ type: "string",
58
+ descriptionKey: "documentScanner.agent.state.phase",
59
+ description: "Lifecycle phase: 'idle' | 'requesting' | 'streaming' | 'captured' | 'error'.",
60
+ read: (a) => a.getPhase()
61
+ }
62
+ },
63
+ actions: {
64
+ start_camera: {
65
+ safety: "write",
66
+ descriptionKey: "documentScanner.agent.actions.startCamera",
67
+ description: "Request camera permission and begin the live viewfinder.",
68
+ invoke: (a) => a.startCamera()
69
+ },
70
+ capture: {
71
+ safety: "write",
72
+ descriptionKey: "documentScanner.agent.actions.capture",
73
+ description: "Freeze the current viewfinder frame as a captured image.",
74
+ invoke: (a) => a.capture()
75
+ },
76
+ submit: {
77
+ safety: "write",
78
+ descriptionKey: "documentScanner.agent.actions.confirm",
79
+ description: "Confirm the current capture, emitting it via onConfirm.",
80
+ invoke: (a) => {
81
+ a.confirm();
82
+ }
83
+ },
84
+ retake: {
85
+ safety: "destructive",
86
+ descriptionKey: "documentScanner.agent.actions.retake",
87
+ description: "Discard the current capture and return to the capture path.",
88
+ invoke: (a) => {
89
+ a.retake();
90
+ }
91
+ }
92
+ },
93
+ domHooks: {
94
+ root: {
95
+ attr: "data-component",
96
+ value: "document-scanner",
97
+ description: "Marks the DocumentScanner wrapper."
98
+ },
99
+ instanceId: {
100
+ attr: "data-component-id",
101
+ sourceProp: "id",
102
+ description: "Sourced from the id prop."
103
+ }
104
+ }
105
+ }, ar = z(
106
+ [
107
+ "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
108
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--card-border)]",
109
+ "ds:shadow-[var(--shadow-card)] ds:[.theme-accessible_&]:border-2",
110
+ "ds:bg-[var(--background)] ds:text-[var(--foreground)]",
111
+ "ds:p-[var(--spacing-md)]",
112
+ "ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed"
113
+ ].join(" "),
114
+ {
115
+ variants: {
116
+ size: {
117
+ sm: "ds:max-inline-size-[20rem]",
118
+ md: "ds:max-inline-size-[28rem]",
119
+ lg: "ds:max-inline-size-[36rem]"
120
+ }
121
+ },
122
+ defaultVariants: { size: "md" }
123
+ }
124
+ ), be = z(
125
+ [
126
+ "ds:relative ds:block ds:inline-size-full ds:overflow-hidden",
127
+ "ds:rounded-[var(--radius-sm)]",
128
+ "ds:bg-[var(--muted)]"
129
+ ].join(" "),
130
+ {
131
+ variants: {
132
+ // ID-1 cards (Tessera Sanitaria / CIE / id-card) are ~1.586:1; the
133
+ // generic frame is a slightly squarer neutral card.
134
+ frame: {
135
+ "tessera-sanitaria": "ds:aspect-[1.586/1]",
136
+ cie: "ds:aspect-[1.586/1]",
137
+ "id-card": "ds:aspect-[1.586/1]",
138
+ generic: "ds:aspect-[1.4/1]"
139
+ }
140
+ },
141
+ defaultVariants: { frame: "tessera-sanitaria" }
142
+ }
143
+ ), we = z(
144
+ [
145
+ "ds:absolute ds:inset-0 ds:block",
146
+ "ds:inline-size-full ds:block-size-full",
147
+ "ds:object-cover"
148
+ ].join(" ")
149
+ ), sr = z(
150
+ [
151
+ "ds:pointer-events-none ds:absolute",
152
+ "ds:inset-[12%]",
153
+ "ds:rounded-[var(--radius-sm)]",
154
+ "ds:border-2 ds:border-[color:var(--background)]",
155
+ "ds:shadow-[0_0_0_100vmax_color-mix(in_srgb,var(--foreground)_45%,transparent)]"
156
+ ].join(" ")
157
+ ), $ = z(
158
+ [
159
+ "ds:pointer-events-none ds:absolute ds:size-6",
160
+ "ds:border-[color:var(--background)]"
161
+ ].join(" ")
162
+ ), Se = z(
163
+ ["ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]"].join(" ")
164
+ ), ir = z(
165
+ ["type-body-sm ds:text-center", "ds:text-[var(--muted-foreground)]"].join(
166
+ " "
167
+ )
168
+ );
169
+ function or(a) {
170
+ let o = "";
171
+ for (let f = 0; f < a.length; f += 1)
172
+ o += a[f].toString(16).padStart(2, "0");
173
+ return o;
174
+ }
175
+ async function xe(a) {
176
+ var f;
177
+ const o = globalThis;
178
+ if ((f = o.crypto) != null && f.subtle) {
179
+ const N = new Uint8Array(a.byteLength);
180
+ N.set(new Uint8Array(a));
181
+ const U = await o.crypto.subtle.digest("SHA-256", N.buffer);
182
+ return or(new Uint8Array(U));
183
+ }
184
+ return "";
185
+ }
186
+ function cr(a) {
187
+ const o = a instanceof Error ? a.name : "";
188
+ return o === "NotAllowedError" || o === "SecurityError" ? "permission-denied" : o === "NotFoundError" || o === "OverconstrainedError" ? "no-camera" : o === "NotReadableError" || o === "AbortError" ? "not-readable" : "capture-failed";
189
+ }
190
+ function dr() {
191
+ return typeof navigator < "u" && typeof navigator.mediaDevices < "u" && typeof navigator.mediaDevices.getUserMedia == "function";
192
+ }
193
+ const lr = {
194
+ "tessera-sanitaria": "documentScanner.hint.tesseraSanitaria",
195
+ cie: "documentScanner.hint.cie",
196
+ "id-card": "documentScanner.hint.idCard",
197
+ generic: "documentScanner.hint.generic"
198
+ }, ke = {
199
+ "permission-denied": "documentScanner.error.permissionDenied",
200
+ "no-camera": "documentScanner.error.noCamera",
201
+ "not-readable": "documentScanner.error.notReadable",
202
+ "insecure-context": "documentScanner.error.insecureContext",
203
+ "capture-failed": "documentScanner.error.captureFailed",
204
+ "file-invalid-type": "documentScanner.error.fileInvalidType",
205
+ "file-too-large": "documentScanner.error.fileTooLarge"
206
+ }, ur = Fe(
207
+ ({
208
+ id: a,
209
+ value: o,
210
+ defaultValue: f = null,
211
+ onConfirm: N,
212
+ onRetake: U,
213
+ onError: X,
214
+ documentType: Z = "tessera-sanitaria",
215
+ captureMode: V = "auto",
216
+ accept: Ne = {
217
+ "image/jpeg": [".jpg", ".jpeg"],
218
+ "image/png": [".png"],
219
+ "image/webp": [".webp"]
220
+ },
221
+ maxSize: se = 10 * 1024 * 1024,
222
+ facingMode: ie = "environment",
223
+ outputType: y = "image/jpeg",
224
+ outputQuality: G = 0.92,
225
+ cropToFrame: oe = !0,
226
+ disabled: g = !1,
227
+ size: Ce = "md",
228
+ ariaLabel: je,
229
+ className: Re
230
+ }, Ee) => {
231
+ const { t: s } = $e(), ce = `ds-${Te().replace(/[^a-zA-Z0-9-_]/g, "")}-hint`, [b, C] = Ze({
232
+ value: o,
233
+ defaultValue: f
234
+ }), j = m(f != null || o != null), [t, v] = Y(
235
+ f != null || o != null ? "captured" : "idle"
236
+ ), [S, q] = Y(
237
+ null
238
+ ), [Ie, de] = Y(!1), [le, J] = Y(!1), A = m(null), Ue = m(null), R = m(null), ue = m(!1), me = m(null), Ae = m(null), pe = m(null), fe = m(null), K = m(X), M = m(N), x = m(U);
239
+ k(() => {
240
+ K.current = X, M.current = N, x.current = U;
241
+ }, [X, N, U]);
242
+ const P = o !== void 0, E = V === "upload-only", w = h(() => {
243
+ const e = R.current;
244
+ e && e.getTracks().forEach((i) => i.stop()), R.current = null;
245
+ const r = A.current;
246
+ r && (r.srcObject = null), de(!1);
247
+ }, []), u = h((e) => {
248
+ var r;
249
+ q(e), v("error"), (r = K.current) == null || r.call(K, { kind: e });
250
+ }, []), O = h(async () => {
251
+ var e;
252
+ if (!(g || E)) {
253
+ if (!dr()) {
254
+ u("insecure-context");
255
+ return;
256
+ }
257
+ q(null), v("requesting");
258
+ try {
259
+ const r = await navigator.mediaDevices.getUserMedia({
260
+ video: { facingMode: ie },
261
+ audio: !1
262
+ });
263
+ if (ue.current) {
264
+ r.getTracks().forEach((d) => d.stop());
265
+ return;
266
+ }
267
+ R.current = r;
268
+ const i = A.current;
269
+ if (i) {
270
+ try {
271
+ i.srcObject = r;
272
+ } catch {
273
+ }
274
+ const d = (e = i.play) == null ? void 0 : e.call(i);
275
+ d && typeof d.catch == "function" && d.catch(() => {
276
+ });
277
+ }
278
+ v("streaming");
279
+ } catch (r) {
280
+ w(), u(cr(r));
281
+ }
282
+ }
283
+ }, [g, E, ie, w, u]), L = h(() => {
284
+ const e = A.current;
285
+ e && e.readyState >= 2 && de(!0);
286
+ }, []);
287
+ k(() => {
288
+ if (t !== "streaming") return;
289
+ L();
290
+ const e = window.setInterval(L, 100), r = window.setTimeout(
291
+ () => window.clearInterval(e),
292
+ 4e3
293
+ );
294
+ return () => {
295
+ window.clearInterval(e), window.clearTimeout(r);
296
+ };
297
+ }, [t, L]);
298
+ const Q = h(async () => {
299
+ const e = A.current;
300
+ if (!e || e.readyState < 2) {
301
+ u("capture-failed");
302
+ return;
303
+ }
304
+ const r = e.videoWidth || e.clientWidth, i = e.videoHeight || e.clientHeight;
305
+ if (r === 0 || i === 0) {
306
+ u("capture-failed");
307
+ return;
308
+ }
309
+ let d = 0, T = 0, D = r, _ = i;
310
+ if (oe) {
311
+ const B = r * 0.12, W = i * 0.12;
312
+ d = B, T = W, D = r - B * 2, _ = i - W * 2;
313
+ }
314
+ const l = document.createElement("canvas");
315
+ l.width = Math.max(1, Math.round(D)), l.height = Math.max(1, Math.round(_));
316
+ const I = l.getContext("2d");
317
+ if (!I) {
318
+ u("capture-failed");
319
+ return;
320
+ }
321
+ try {
322
+ I.drawImage(e, d, T, D, _, 0, 0, l.width, l.height);
323
+ } catch {
324
+ u("capture-failed");
325
+ return;
326
+ }
327
+ w();
328
+ const c = await new Promise((B) => {
329
+ typeof l.toBlob == "function" ? l.toBlob(
330
+ (W) => B(W),
331
+ y,
332
+ y === "image/png" ? void 0 : G
333
+ ) : B(null);
334
+ });
335
+ if (!c) {
336
+ u("capture-failed");
337
+ return;
338
+ }
339
+ const Ke = l.toDataURL(
340
+ y,
341
+ y === "image/png" ? void 0 : G
342
+ ), Me = await c.arrayBuffer(), Pe = await xe(Me);
343
+ j.current = !1;
344
+ const Oe = {
345
+ dataUrl: Ke,
346
+ blob: c,
347
+ source: "camera",
348
+ width: l.width,
349
+ height: l.height,
350
+ mimeType: y,
351
+ byteSize: c.size,
352
+ capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
353
+ sha256: Pe
354
+ };
355
+ C(Oe), v("captured");
356
+ }, [
357
+ oe,
358
+ y,
359
+ G,
360
+ w,
361
+ u,
362
+ C
363
+ ]), Le = h(
364
+ async (e) => {
365
+ const r = e[0];
366
+ if (r) {
367
+ J(!0);
368
+ try {
369
+ const i = URL.createObjectURL(r), d = await new Promise(
370
+ (l, I) => {
371
+ const c = new Image();
372
+ c.onload = () => l({ w: c.naturalWidth, h: c.naturalHeight }), c.onerror = () => I(new Error("decode-failed")), c.src = i;
373
+ }
374
+ ).finally(() => {
375
+ URL.revokeObjectURL(i);
376
+ }), T = await new Promise((l, I) => {
377
+ const c = new FileReader();
378
+ c.onload = () => l(String(c.result)), c.onerror = () => I(new Error("read-failed")), c.readAsDataURL(r);
379
+ }), D = await r.arrayBuffer(), _ = await xe(D);
380
+ j.current = !1, q(null), C({
381
+ dataUrl: T,
382
+ blob: r,
383
+ source: "upload",
384
+ width: d.w,
385
+ height: d.h,
386
+ mimeType: r.type || y,
387
+ byteSize: r.size,
388
+ capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
389
+ sha256: _
390
+ }), v("captured");
391
+ } catch {
392
+ u("capture-failed");
393
+ } finally {
394
+ J(!1);
395
+ }
396
+ }
397
+ },
398
+ [y, u, C]
399
+ ), De = h(
400
+ (e) => {
401
+ var d;
402
+ const i = ((d = e[0]) == null ? void 0 : d.reason) === "file-too-large" ? "file-too-large" : "file-invalid-type";
403
+ u(i);
404
+ },
405
+ [u]
406
+ ), ee = h(() => {
407
+ var e;
408
+ b && ((e = M.current) == null || e.call(M, b));
409
+ }, [b]), re = m(!1), te = h(() => {
410
+ var e, r;
411
+ if (P) {
412
+ (e = x.current) == null || e.call(x);
413
+ return;
414
+ }
415
+ j.current = !1, re.current = !0, C(null), q(null), J(!1), v("idle"), (r = x.current) == null || r.call(x);
416
+ }, [P, C]);
417
+ k(() => {
418
+ var e, r, i;
419
+ t === "captured" && !j.current ? (e = me.current) == null || e.focus() : t === "error" ? (r = fe.current) == null || r.focus() : t === "idle" && re.current && (re.current = !1, (i = pe.current) == null || i.focus());
420
+ }, [t]), k(() => {
421
+ if (t !== "streaming") return;
422
+ const e = (r) => {
423
+ r.key === "Escape" && (w(), v("idle"));
424
+ };
425
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
426
+ }, [t, w]), k(() => {
427
+ const e = () => {
428
+ document.visibilityState === "hidden" && R.current && (w(), v("idle"));
429
+ };
430
+ return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
431
+ }, [w]), k(() => () => {
432
+ ue.current = !0;
433
+ const e = R.current;
434
+ e && e.getTracks().forEach((r) => r.stop()), R.current = null;
435
+ }, []), k(() => {
436
+ P && (o != null ? v("captured") : t === "captured" && v("idle"));
437
+ }, [o, P]);
438
+ const ne = We(
439
+ () => ({
440
+ hasCapture: () => b != null,
441
+ getPhase: () => t,
442
+ startCamera: () => O(),
443
+ capture: () => Q(),
444
+ confirm: () => ee(),
445
+ retake: () => te()
446
+ }),
447
+ [b, t, O, Q, ee, te]
448
+ );
449
+ Ye(Ee, () => ne, [ne]), Ge(nr, ne, a);
450
+ const _e = je ?? s("documentScanner.regionLabel"), Be = s(lr[Z]), ge = Math.round(se / (1024 * 1024)), He = (() => {
451
+ if (le) return s("documentScanner.state.uploading");
452
+ switch (t) {
453
+ case "idle":
454
+ return s("documentScanner.state.idle");
455
+ case "requesting":
456
+ return s("documentScanner.state.requesting");
457
+ case "streaming":
458
+ return s("documentScanner.state.streaming");
459
+ case "captured":
460
+ return s("documentScanner.state.captured");
461
+ case "error":
462
+ return S ? s(ke[S], { maxSizeMb: ge }) : s("documentScanner.error.captureFailed");
463
+ }
464
+ })(), Ve = !E && S !== "file-invalid-type" && S !== "file-too-large" && S !== "insecure-context", ve = !g && (V === "auto" || V === "upload-only" || t === "error"), F = /* @__PURE__ */ n(
465
+ Xe,
466
+ {
467
+ variant: "button",
468
+ accept: Ne,
469
+ maxSize: se,
470
+ multiple: !1,
471
+ maxFiles: 1,
472
+ disabled: g,
473
+ showPreview: !1,
474
+ onDrop: (e) => {
475
+ Le(e);
476
+ },
477
+ onReject: De
478
+ }
479
+ ), qe = t === "idle" || t === "requesting" || t === "streaming" || t === "error";
480
+ return /* @__PURE__ */ p(
481
+ "div",
482
+ {
483
+ role: "group",
484
+ "aria-label": _e,
485
+ "aria-disabled": g || void 0,
486
+ className: [ar({ size: Ce }), Re].filter(Boolean).join(" "),
487
+ "data-component": "document-scanner",
488
+ "data-component-id": a,
489
+ "data-phase": t,
490
+ children: [
491
+ /* @__PURE__ */ n(
492
+ "span",
493
+ {
494
+ role: "status",
495
+ "aria-live": "polite",
496
+ "aria-atomic": "true",
497
+ className: "ds:sr-only",
498
+ "data-testid": "document-scanner-live",
499
+ children: He
500
+ }
501
+ ),
502
+ t === "captured" && b ? (
503
+ /* ---- Captured preview ---- */
504
+ /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
505
+ /* @__PURE__ */ p("div", { className: be({ frame: Z }), children: [
506
+ /* @__PURE__ */ n(
507
+ "img",
508
+ {
509
+ src: b.dataUrl,
510
+ alt: s("documentScanner.previewAlt"),
511
+ className: we(),
512
+ "data-testid": "document-scanner-preview"
513
+ }
514
+ ),
515
+ j.current ? /* @__PURE__ */ n("span", { className: "ds:absolute ds:top-[var(--spacing-sm)] ds:start-[var(--spacing-sm)] ds:rounded-[var(--radius-full)] ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-2xs)] type-meta", children: s("documentScanner.onFileBadge") }) : null
516
+ ] }),
517
+ /* @__PURE__ */ p("div", { className: Se(), children: [
518
+ /* @__PURE__ */ n(
519
+ H,
520
+ {
521
+ intent: "secondary",
522
+ size: "md",
523
+ className: "ds:min-block-size-[var(--min-target-size)] ds:min-inline-size-[var(--min-target-size)]",
524
+ startIcon: /* @__PURE__ */ n(Je, { "aria-hidden": "true" }),
525
+ onClick: te,
526
+ disabled: g,
527
+ children: s("documentScanner.retake")
528
+ }
529
+ ),
530
+ j.current ? null : /* @__PURE__ */ n(
531
+ H,
532
+ {
533
+ ref: me,
534
+ intent: "primary",
535
+ size: "md",
536
+ className: "ds:min-block-size-[var(--min-target-size)] ds:min-inline-size-[var(--min-target-size)]",
537
+ startIcon: /* @__PURE__ */ n(Qe, { "aria-hidden": "true" }),
538
+ onClick: ee,
539
+ disabled: g || b == null,
540
+ children: s("documentScanner.confirm")
541
+ }
542
+ )
543
+ ] })
544
+ ] })
545
+ ) : null,
546
+ qe ? /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
547
+ !E && t !== "error" ? /* @__PURE__ */ p(
548
+ "div",
549
+ {
550
+ ref: Ue,
551
+ className: be({ frame: Z }),
552
+ "aria-busy": t === "requesting" || void 0,
553
+ children: [
554
+ /* @__PURE__ */ n(
555
+ "video",
556
+ {
557
+ ref: A,
558
+ autoPlay: !0,
559
+ playsInline: !0,
560
+ muted: !0,
561
+ "aria-label": s("documentScanner.videoLabel"),
562
+ className: we(),
563
+ onLoadedMetadata: L,
564
+ onCanPlay: L,
565
+ "data-testid": "document-scanner-video"
566
+ }
567
+ ),
568
+ t === "requesting" ? /* @__PURE__ */ n("div", { className: "ds:absolute ds:inset-0 ds:flex ds:items-center ds:justify-center ds:bg-[color-mix(in_srgb,var(--foreground)_20%,transparent)]", children: /* @__PURE__ */ n(
569
+ he,
570
+ {
571
+ "aria-hidden": "true",
572
+ className: "ds:size-8 ds:animate-spin ds:text-[var(--background)] ds:motion-reduce:animate-none"
573
+ }
574
+ ) }) : null,
575
+ /* @__PURE__ */ p(
576
+ "div",
577
+ {
578
+ "aria-hidden": "true",
579
+ className: sr(),
580
+ "data-testid": "document-scanner-frame",
581
+ children: [
582
+ /* @__PURE__ */ n(
583
+ "span",
584
+ {
585
+ className: [
586
+ $(),
587
+ "ds:top-0 ds:start-0 ds:border-t-2 ds:border-s-2 ds:rounded-ss-[var(--radius-sm)]"
588
+ ].join(" ")
589
+ }
590
+ ),
591
+ /* @__PURE__ */ n(
592
+ "span",
593
+ {
594
+ className: [
595
+ $(),
596
+ "ds:top-0 ds:end-0 ds:border-t-2 ds:border-e-2 ds:rounded-se-[var(--radius-sm)]"
597
+ ].join(" ")
598
+ }
599
+ ),
600
+ /* @__PURE__ */ n(
601
+ "span",
602
+ {
603
+ className: [
604
+ $(),
605
+ "ds:bottom-0 ds:start-0 ds:border-b-2 ds:border-s-2 ds:rounded-es-[var(--radius-sm)]"
606
+ ].join(" ")
607
+ }
608
+ ),
609
+ /* @__PURE__ */ n(
610
+ "span",
611
+ {
612
+ className: [
613
+ $(),
614
+ "ds:bottom-0 ds:end-0 ds:border-b-2 ds:border-e-2 ds:rounded-ee-[var(--radius-sm)]"
615
+ ].join(" ")
616
+ }
617
+ )
618
+ ]
619
+ }
620
+ )
621
+ ]
622
+ }
623
+ ) : null,
624
+ t === "streaming" ? /* @__PURE__ */ n("p", { id: ce, className: ir(), children: Be }) : null,
625
+ t === "error" && S ? /* @__PURE__ */ p(ae, { variant: "error", live: "assertive", children: [
626
+ /* @__PURE__ */ n(ae.Description, { children: s(ke[S], { maxSizeMb: ge }) }),
627
+ /* @__PURE__ */ p(ae.Action, { children: [
628
+ Ve ? /* @__PURE__ */ n(
629
+ H,
630
+ {
631
+ ref: fe,
632
+ intent: "secondary",
633
+ size: "sm",
634
+ onClick: () => {
635
+ O();
636
+ },
637
+ disabled: g,
638
+ children: s("documentScanner.retry")
639
+ }
640
+ ) : null,
641
+ ve ? F : null
642
+ ] })
643
+ ] }) : null,
644
+ t !== "error" ? /* @__PURE__ */ p("div", { className: Se(), children: [
645
+ t === "streaming" ? /* @__PURE__ */ n(
646
+ H,
647
+ {
648
+ ref: Ae,
649
+ intent: "primary",
650
+ size: "lg",
651
+ startIcon: /* @__PURE__ */ n(ye, { "aria-hidden": "true" }),
652
+ onClick: () => {
653
+ Q();
654
+ },
655
+ disabled: g || !Ie,
656
+ "aria-describedby": ce,
657
+ "aria-label": s("documentScanner.capture"),
658
+ children: s("documentScanner.capture")
659
+ }
660
+ ) : null,
661
+ (t === "idle" || t === "requesting") && !E ? /* @__PURE__ */ n(
662
+ H,
663
+ {
664
+ ref: pe,
665
+ intent: "primary",
666
+ size: "md",
667
+ className: "ds:min-block-size-[var(--min-target-size)] ds:min-inline-size-[var(--min-target-size)]",
668
+ loading: t === "requesting",
669
+ startIcon: /* @__PURE__ */ n(ye, { "aria-hidden": "true" }),
670
+ onClick: () => {
671
+ O();
672
+ },
673
+ disabled: g,
674
+ children: s("documentScanner.useCamera")
675
+ }
676
+ ) : null,
677
+ le ? /* @__PURE__ */ p("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-[var(--muted-foreground)]", children: [
678
+ /* @__PURE__ */ n(
679
+ he,
680
+ {
681
+ "aria-hidden": "true",
682
+ className: "ds:size-4 ds:animate-spin ds:motion-reduce:animate-none"
683
+ }
684
+ ),
685
+ s("documentScanner.state.uploading")
686
+ ] }) : ve && t !== "streaming" ? E ? F : /* @__PURE__ */ p("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-[var(--muted-foreground)]", children: [
687
+ /* @__PURE__ */ n(tr, { "aria-hidden": "true", className: "ds:size-4" }),
688
+ F
689
+ ] }) : null,
690
+ t === "streaming" && V !== "camera-only" ? F : null
691
+ ] }) : null
692
+ ] }) : null
693
+ ]
694
+ }
695
+ );
696
+ }
697
+ );
698
+ ur.displayName = "DocumentScanner";
699
+ export {
700
+ ur as D,
701
+ nr as d
702
+ };
703
+ //# sourceMappingURL=document-scanner-CqS_klIr.js.map