@alfadocs/ui-kit-debug 1.65.0 → 1.67.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 (264) hide show
  1. package/dist/_chunks/ai-credits-exhausted-notice-DfAgfZDF.js +287 -0
  2. package/dist/_chunks/ai-credits-exhausted-notice-DfAgfZDF.js.map +1 -0
  3. package/dist/_chunks/ai-credits-exhausted-notice.agent-DgTSTgez.js +43 -0
  4. package/dist/_chunks/ai-credits-exhausted-notice.agent-DgTSTgez.js.map +1 -0
  5. package/dist/_chunks/ai-credits-notice-DQ-r3iQU.js +191 -0
  6. package/dist/_chunks/ai-credits-notice-DQ-r3iQU.js.map +1 -0
  7. package/dist/_chunks/{ai-permission-notice-DpRmZ9Q3.js → ai-permission-notice-qsdm4Sx4.js} +2 -2
  8. package/dist/_chunks/{ai-permission-notice-DpRmZ9Q3.js.map → ai-permission-notice-qsdm4Sx4.js.map} +1 -1
  9. package/dist/_chunks/{alert-DdDpOi-P.js → alert-DjsJMGRE.js} +3 -2
  10. package/dist/_chunks/{alert-DdDpOi-P.js.map → alert-DjsJMGRE.js.map} +1 -1
  11. package/dist/_chunks/{anamnesis-summary-rows-BIfw890v.js → anamnesis-summary-rows-BQ_EokKz.js} +2 -2
  12. package/dist/_chunks/{anamnesis-summary-rows-BIfw890v.js.map → anamnesis-summary-rows-BQ_EokKz.js.map} +1 -1
  13. package/dist/_chunks/{audio-recorder-DR-u1qbl.js → audio-recorder-B11RR-rC.js} +2 -2
  14. package/dist/_chunks/{audio-recorder-DR-u1qbl.js.map → audio-recorder-B11RR-rC.js.map} +1 -1
  15. package/dist/_chunks/{auth-form-parts-Cmb41LSQ.js → auth-form-parts-DwUTH6YN.js} +2 -2
  16. package/dist/_chunks/{auth-form-parts-Cmb41LSQ.js.map → auth-form-parts-DwUTH6YN.js.map} +1 -1
  17. package/dist/_chunks/{booking-DkjatiXc.js → booking-tTVxKPQY.js} +2 -2
  18. package/dist/_chunks/{booking-DkjatiXc.js.map → booking-tTVxKPQY.js.map} +1 -1
  19. package/dist/_chunks/{calendar-workspace-Cp8yTZ1g.js → calendar-workspace-MRrzcxAy.js} +6 -6
  20. package/dist/_chunks/{calendar-workspace-Cp8yTZ1g.js.map → calendar-workspace-MRrzcxAy.js.map} +1 -1
  21. package/dist/_chunks/chart-CwmyCuWe.js +1340 -0
  22. package/dist/_chunks/chart-CwmyCuWe.js.map +1 -0
  23. package/dist/_chunks/{document-preview-B1dQm292.js → document-preview-VyQOjFVL.js} +2 -2
  24. package/dist/_chunks/{document-preview-B1dQm292.js.map → document-preview-VyQOjFVL.js.map} +1 -1
  25. package/dist/_chunks/{document-scanner-CVPVLK7z.js → document-scanner-CXH_GYh4.js} +2 -2
  26. package/dist/_chunks/{document-scanner-CVPVLK7z.js.map → document-scanner-CXH_GYh4.js.map} +1 -1
  27. package/dist/_chunks/{entity-summary-BQ9_KA8S.js → entity-summary-Bj-Wxq7Y.js} +2 -2
  28. package/dist/_chunks/{entity-summary-BQ9_KA8S.js.map → entity-summary-Bj-Wxq7Y.js.map} +1 -1
  29. package/dist/_chunks/{error-summary-DrUfuKu1.js → error-summary-PUE5Zxp9.js} +2 -2
  30. package/dist/_chunks/{error-summary-DrUfuKu1.js.map → error-summary-PUE5Zxp9.js.map} +1 -1
  31. package/dist/_chunks/{forgot-password-form-CgZkEvZy.js → forgot-password-form-CPOfRE0C.js} +4 -4
  32. package/dist/_chunks/{forgot-password-form-CgZkEvZy.js.map → forgot-password-form-CPOfRE0C.js.map} +1 -1
  33. package/dist/_chunks/{freemium-paywall-DKJHRFpp.js → freemium-paywall-6DO7noHX.js} +2 -2
  34. package/dist/_chunks/{freemium-paywall-DKJHRFpp.js.map → freemium-paywall-6DO7noHX.js.map} +1 -1
  35. package/dist/_chunks/heatmap-C1TeC7wT.js +3650 -0
  36. package/dist/_chunks/heatmap-C1TeC7wT.js.map +1 -0
  37. package/dist/_chunks/help-me-write-templates-Bw3Q58x-.js +687 -0
  38. package/dist/_chunks/help-me-write-templates-Bw3Q58x-.js.map +1 -0
  39. package/dist/_chunks/hourglass-BEAzW1wE.js +26 -0
  40. package/dist/_chunks/hourglass-BEAzW1wE.js.map +1 -0
  41. package/dist/_chunks/{login-dev-card-PnADNcI9.js → login-dev-card-A-CL3mjt.js} +3 -3
  42. package/dist/_chunks/{login-dev-card-PnADNcI9.js.map → login-dev-card-A-CL3mjt.js.map} +1 -1
  43. package/dist/_chunks/{marketplace-app-shell-C-2e4eCD.js → marketplace-app-shell-DtSX8sYb.js} +2 -2
  44. package/dist/_chunks/{marketplace-app-shell-C-2e4eCD.js.map → marketplace-app-shell-DtSX8sYb.js.map} +1 -1
  45. package/dist/_chunks/{notes-panel-uEGIL7mi.js → notes-panel-IdsmqRFC.js} +3 -3
  46. package/dist/_chunks/{notes-panel-uEGIL7mi.js.map → notes-panel-IdsmqRFC.js.map} +1 -1
  47. package/dist/_chunks/{patient-details-4P1vA9Ls.js → patient-details-C-EWQTms.js} +2 -2
  48. package/dist/_chunks/{patient-details-4P1vA9Ls.js.map → patient-details-C-EWQTms.js.map} +1 -1
  49. package/dist/_chunks/{patient-field-row-CBXhlfGD.js → patient-field-row-lY-Tb5Mo.js} +155 -176
  50. package/dist/_chunks/patient-field-row-lY-Tb5Mo.js.map +1 -0
  51. package/dist/_chunks/{patient-search-DOnDUVsl.js → patient-search-DpAKidZ5.js} +2 -2
  52. package/dist/_chunks/{patient-search-DOnDUVsl.js.map → patient-search-DpAKidZ5.js.map} +1 -1
  53. package/dist/_chunks/{patient-summary-card-CuDLo8MP.js → patient-summary-card-Bpto_VCD.js} +2 -2
  54. package/dist/_chunks/{patient-summary-card-CuDLo8MP.js.map → patient-summary-card-Bpto_VCD.js.map} +1 -1
  55. package/dist/_chunks/{payment-automation-upsell-C8MEu0t6.js → payment-automation-upsell-BQ307qEX.js} +2 -2
  56. package/dist/_chunks/{payment-automation-upsell-C8MEu0t6.js.map → payment-automation-upsell-BQ307qEX.js.map} +1 -1
  57. package/dist/_chunks/{payment-form-C3dGY7v4.js → payment-form-XKtinW8r.js} +2 -2
  58. package/dist/_chunks/{payment-form-C3dGY7v4.js.map → payment-form-XKtinW8r.js.map} +1 -1
  59. package/dist/_chunks/{pdf-viewer-DJ9VN7cu.js → pdf-viewer-BvoVMjH4.js} +2 -2
  60. package/dist/_chunks/{pdf-viewer-DJ9VN7cu.js.map → pdf-viewer-BvoVMjH4.js.map} +1 -1
  61. package/dist/_chunks/{practice-results-8h2Utpt3.js → practice-results-BrUDDMXC.js} +2 -2
  62. package/dist/_chunks/{practice-results-8h2Utpt3.js.map → practice-results-BrUDDMXC.js.map} +1 -1
  63. package/dist/_chunks/{registration-form-BQyT_kBX.js → registration-form-BxwqUZzk.js} +3 -3
  64. package/dist/_chunks/{registration-form-BQyT_kBX.js.map → registration-form-BxwqUZzk.js.map} +1 -1
  65. package/dist/_chunks/{rich-text-editor-M2gT_E7f.js → rich-text-editor-aCIoptbg.js} +1653 -1743
  66. package/dist/_chunks/{rich-text-editor-M2gT_E7f.js.map → rich-text-editor-aCIoptbg.js.map} +1 -1
  67. package/dist/_chunks/{sign-document-CY7xTXbm.js → sign-document-D1P1nUQA.js} +2 -2
  68. package/dist/_chunks/{sign-document-CY7xTXbm.js.map → sign-document-D1P1nUQA.js.map} +1 -1
  69. package/dist/_chunks/{signature-request-BMCHy2ZO.js → signature-request-3u6TvRt2.js} +2 -2
  70. package/dist/_chunks/{signature-request-BMCHy2ZO.js.map → signature-request-3u6TvRt2.js.map} +1 -1
  71. package/dist/_chunks/{task-editor-CifOznfq.js → task-editor-Bb5MMcid.js} +2 -2
  72. package/dist/_chunks/{task-editor-CifOznfq.js.map → task-editor-Bb5MMcid.js.map} +1 -1
  73. package/dist/_chunks/{tasks-panel-8nLwBw6P.js → tasks-panel-BOb57Ysw.js} +2 -2
  74. package/dist/_chunks/{tasks-panel-8nLwBw6P.js.map → tasks-panel-BOb57Ysw.js.map} +1 -1
  75. package/dist/_chunks/{use-appointment-details-read-B-FEWbQM.js → use-appointment-details-read-CVSPoP5j.js} +4 -4
  76. package/dist/_chunks/{use-appointment-details-read-B-FEWbQM.js.map → use-appointment-details-read-CVSPoP5j.js.map} +1 -1
  77. package/dist/_chunks/voice-control-panel-BJIEbDq6.js +1148 -0
  78. package/dist/_chunks/voice-control-panel-BJIEbDq6.js.map +1 -0
  79. package/dist/_chunks/{warning-stack-HYWAytZV.js → warning-stack-BdY-0bd3.js} +2 -2
  80. package/dist/_chunks/{warning-stack-HYWAytZV.js.map → warning-stack-BdY-0bd3.js.map} +1 -1
  81. package/dist/_chunks/{workflow-map-C2B2qIr1.js → workflow-map-CYbRD9ek.js} +2 -2
  82. package/dist/_chunks/{workflow-map-C2B2qIr1.js.map → workflow-map-CYbRD9ek.js.map} +1 -1
  83. package/dist/agent-catalog.json +50 -3
  84. package/dist/agent-i18n/en.json +7 -4
  85. package/dist/components/_shared/use-apex-radial-centre.d.ts +7 -4
  86. package/dist/components/_shared/use-apex-radial-centre.d.ts.map +1 -1
  87. package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.agent.d.ts +4 -0
  88. package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.agent.d.ts.map +1 -0
  89. package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.d.ts +96 -0
  90. package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.d.ts.map +1 -0
  91. package/dist/components/ai-credits-notice/ai-credits-notice.d.ts +30 -4
  92. package/dist/components/ai-credits-notice/ai-credits-notice.d.ts.map +1 -1
  93. package/dist/components/ai-credits-notice/index.d.ts +3 -0
  94. package/dist/components/ai-credits-notice/index.d.ts.map +1 -1
  95. package/dist/components/ai-credits-notice/index.js +10 -4
  96. package/dist/components/ai-credits-notice/index.js.map +1 -1
  97. package/dist/components/ai-permission-notice/index.js +1 -1
  98. package/dist/components/alert/index.js +1 -1
  99. package/dist/components/appointment-details-panel/index.js +1 -1
  100. package/dist/components/audio-recorder/index.js +1 -1
  101. package/dist/components/booking/index.js +1 -1
  102. package/dist/components/chart/index.js +1 -1
  103. package/dist/components/document-preview/index.js +1 -1
  104. package/dist/components/document-scanner/index.js +1 -1
  105. package/dist/components/entity-summary/index.js +1 -1
  106. package/dist/components/error-summary/index.js +1 -1
  107. package/dist/components/freemium-paywall/index.js +1 -1
  108. package/dist/components/heatmap/heatmap-context.d.ts +3 -0
  109. package/dist/components/heatmap/heatmap-context.d.ts.map +1 -1
  110. package/dist/components/heatmap/heatmap-disclosure.d.ts +67 -0
  111. package/dist/components/heatmap/heatmap-disclosure.d.ts.map +1 -0
  112. package/dist/components/heatmap/heatmap-format.d.ts.map +1 -1
  113. package/dist/components/heatmap/heatmap-grid.d.ts +1 -1
  114. package/dist/components/heatmap/heatmap-grid.d.ts.map +1 -1
  115. package/dist/components/heatmap/heatmap-legend.d.ts +5 -2
  116. package/dist/components/heatmap/heatmap-legend.d.ts.map +1 -1
  117. package/dist/components/heatmap/heatmap-model.d.ts +107 -15
  118. package/dist/components/heatmap/heatmap-model.d.ts.map +1 -1
  119. package/dist/components/heatmap/heatmap-table-view.d.ts +3 -2
  120. package/dist/components/heatmap/heatmap-table-view.d.ts.map +1 -1
  121. package/dist/components/heatmap/heatmap.d.ts +33 -7
  122. package/dist/components/heatmap/heatmap.d.ts.map +1 -1
  123. package/dist/components/heatmap/index.d.ts +1 -1
  124. package/dist/components/heatmap/index.d.ts.map +1 -1
  125. package/dist/components/heatmap/index.js +1 -1
  126. package/dist/components/notes-panel/index.js +1 -1
  127. package/dist/components/patient-details/index.js +1 -1
  128. package/dist/components/patient-search/index.js +1 -1
  129. package/dist/components/patient-summary-card/index.js +1 -1
  130. package/dist/components/payment-form/index.js +1 -1
  131. package/dist/components/pdf-viewer/index.js +1 -1
  132. package/dist/components/practice-results/index.js +1 -1
  133. package/dist/components/rich-text-editor/index.js +1 -1
  134. package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
  135. package/dist/components/sign-document/index.js +1 -1
  136. package/dist/components/task-editor/index.js +1 -1
  137. package/dist/components/tasks-panel/index.js +1 -1
  138. package/dist/components/voice-control-panel/index.d.ts +2 -1
  139. package/dist/components/voice-control-panel/index.d.ts.map +1 -1
  140. package/dist/components/voice-control-panel/index.js +1 -1
  141. package/dist/components/voice-control-panel/voice-control-panel.agent.d.ts.map +1 -1
  142. package/dist/components/voice-control-panel/voice-control-panel.d.ts +43 -3
  143. package/dist/components/voice-control-panel/voice-control-panel.d.ts.map +1 -1
  144. package/dist/components/warning-stack/index.js +1 -1
  145. package/dist/components/workflow/index.js +1 -1
  146. package/dist/i18n/locales/ar.d.ts +29 -12
  147. package/dist/i18n/locales/ar.d.ts.map +1 -1
  148. package/dist/i18n/locales/ar.js +29 -12
  149. package/dist/i18n/locales/ar.js.map +1 -1
  150. package/dist/i18n/locales/de.d.ts +29 -12
  151. package/dist/i18n/locales/de.d.ts.map +1 -1
  152. package/dist/i18n/locales/de.js +29 -12
  153. package/dist/i18n/locales/de.js.map +1 -1
  154. package/dist/i18n/locales/el.d.ts +29 -12
  155. package/dist/i18n/locales/el.d.ts.map +1 -1
  156. package/dist/i18n/locales/el.js +29 -12
  157. package/dist/i18n/locales/el.js.map +1 -1
  158. package/dist/i18n/locales/en.d.ts +29 -12
  159. package/dist/i18n/locales/en.d.ts.map +1 -1
  160. package/dist/i18n/locales/en.js +29 -12
  161. package/dist/i18n/locales/en.js.map +1 -1
  162. package/dist/i18n/locales/es.d.ts +29 -12
  163. package/dist/i18n/locales/es.d.ts.map +1 -1
  164. package/dist/i18n/locales/es.js +29 -12
  165. package/dist/i18n/locales/es.js.map +1 -1
  166. package/dist/i18n/locales/fr.d.ts +29 -12
  167. package/dist/i18n/locales/fr.d.ts.map +1 -1
  168. package/dist/i18n/locales/fr.js +29 -12
  169. package/dist/i18n/locales/fr.js.map +1 -1
  170. package/dist/i18n/locales/hi.d.ts +29 -12
  171. package/dist/i18n/locales/hi.d.ts.map +1 -1
  172. package/dist/i18n/locales/hi.js +29 -12
  173. package/dist/i18n/locales/hi.js.map +1 -1
  174. package/dist/i18n/locales/it.d.ts +29 -12
  175. package/dist/i18n/locales/it.d.ts.map +1 -1
  176. package/dist/i18n/locales/it.js +29 -12
  177. package/dist/i18n/locales/it.js.map +1 -1
  178. package/dist/i18n/locales/ja.d.ts +29 -12
  179. package/dist/i18n/locales/ja.d.ts.map +1 -1
  180. package/dist/i18n/locales/ja.js +29 -12
  181. package/dist/i18n/locales/ja.js.map +1 -1
  182. package/dist/i18n/locales/nl.d.ts +29 -12
  183. package/dist/i18n/locales/nl.d.ts.map +1 -1
  184. package/dist/i18n/locales/nl.js +29 -12
  185. package/dist/i18n/locales/nl.js.map +1 -1
  186. package/dist/i18n/locales/pl.d.ts +29 -12
  187. package/dist/i18n/locales/pl.d.ts.map +1 -1
  188. package/dist/i18n/locales/pl.js +29 -12
  189. package/dist/i18n/locales/pl.js.map +1 -1
  190. package/dist/i18n/locales/pt.d.ts +29 -12
  191. package/dist/i18n/locales/pt.d.ts.map +1 -1
  192. package/dist/i18n/locales/pt.js +29 -12
  193. package/dist/i18n/locales/pt.js.map +1 -1
  194. package/dist/i18n/locales/ro.d.ts +29 -12
  195. package/dist/i18n/locales/ro.d.ts.map +1 -1
  196. package/dist/i18n/locales/ro.js +29 -12
  197. package/dist/i18n/locales/ro.js.map +1 -1
  198. package/dist/i18n/locales/ru.d.ts +29 -12
  199. package/dist/i18n/locales/ru.d.ts.map +1 -1
  200. package/dist/i18n/locales/ru.js +29 -12
  201. package/dist/i18n/locales/ru.js.map +1 -1
  202. package/dist/i18n/locales/sq.d.ts +29 -12
  203. package/dist/i18n/locales/sq.d.ts.map +1 -1
  204. package/dist/i18n/locales/sq.js +29 -12
  205. package/dist/i18n/locales/sq.js.map +1 -1
  206. package/dist/i18n/locales/sv.d.ts +29 -12
  207. package/dist/i18n/locales/sv.d.ts.map +1 -1
  208. package/dist/i18n/locales/sv.js +29 -12
  209. package/dist/i18n/locales/sv.js.map +1 -1
  210. package/dist/i18n/locales/tr.d.ts +29 -12
  211. package/dist/i18n/locales/tr.d.ts.map +1 -1
  212. package/dist/i18n/locales/tr.js +29 -12
  213. package/dist/i18n/locales/tr.js.map +1 -1
  214. package/dist/i18n/locales/zh.d.ts +29 -12
  215. package/dist/i18n/locales/zh.d.ts.map +1 -1
  216. package/dist/i18n/locales/zh.js +29 -12
  217. package/dist/i18n/locales/zh.js.map +1 -1
  218. package/dist/index.js +814 -809
  219. package/dist/index.js.map +1 -1
  220. package/dist/locales/ar.json +29 -12
  221. package/dist/locales/de.json +29 -12
  222. package/dist/locales/el.json +29 -12
  223. package/dist/locales/en.json +29 -12
  224. package/dist/locales/es.json +29 -12
  225. package/dist/locales/fr.json +29 -12
  226. package/dist/locales/hi.json +29 -12
  227. package/dist/locales/it.json +29 -12
  228. package/dist/locales/ja.json +29 -12
  229. package/dist/locales/nl.json +29 -12
  230. package/dist/locales/pl.json +29 -12
  231. package/dist/locales/pt.json +29 -12
  232. package/dist/locales/ro.json +29 -12
  233. package/dist/locales/ru.json +29 -12
  234. package/dist/locales/sq.json +29 -12
  235. package/dist/locales/sv.json +29 -12
  236. package/dist/locales/tr.json +29 -12
  237. package/dist/locales/zh.json +29 -12
  238. package/dist/patterns/anamnesis/index.js +1 -1
  239. package/dist/patterns/calendar/index.js +1 -1
  240. package/dist/patterns/forgot-password-form/index.js +1 -1
  241. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +6 -23
  242. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -1
  243. package/dist/patterns/help-me-write-templates/index.js +8 -7
  244. package/dist/patterns/help-me-write-templates/index.js.map +1 -1
  245. package/dist/patterns/login-form/index.js +1 -1
  246. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  247. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  248. package/dist/patterns/registration-form/index.js +1 -1
  249. package/dist/patterns/signature-request/index.js +1 -1
  250. package/dist/tokens.css +1 -1
  251. package/package.json +1 -1
  252. package/dist/_chunks/ai-credits-notice-pK9BOmEz.js +0 -90
  253. package/dist/_chunks/ai-credits-notice-pK9BOmEz.js.map +0 -1
  254. package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js +0 -17
  255. package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js.map +0 -1
  256. package/dist/_chunks/chart-CIzXxNeM.js +0 -1322
  257. package/dist/_chunks/chart-CIzXxNeM.js.map +0 -1
  258. package/dist/_chunks/heatmap-BxRHM8Et.js +0 -2865
  259. package/dist/_chunks/heatmap-BxRHM8Et.js.map +0 -1
  260. package/dist/_chunks/help-me-write-templates-DFmqnsAa.js +0 -747
  261. package/dist/_chunks/help-me-write-templates-DFmqnsAa.js.map +0 -1
  262. package/dist/_chunks/patient-field-row-CBXhlfGD.js.map +0 -1
  263. package/dist/_chunks/voice-control-panel-C0BfY23Y.js +0 -1009
  264. package/dist/_chunks/voice-control-panel-C0BfY23Y.js.map +0 -1
@@ -1,1009 +0,0 @@
1
- import { jsxs as a, jsx as o, Fragment as ot } from "react/jsx-runtime";
2
- import { forwardRef as It, useId as Se, useState as _, useRef as c, useMemo as Pe, useEffect as y, useCallback as I } from "react";
3
- import { c as P } from "./index-D2ZczOXr.js";
4
- import { useTranslation as Lt, Trans as Vt } from "react-i18next";
5
- import { A as Gt } from "./ai-permission-notice-DpRmZ9Q3.js";
6
- import { A as Ft } from "./ai-sparkle-D23NT8Z_.js";
7
- import { B as Mt } from "./badge-BUk4RjTS.js";
8
- import { B as st } from "./button-D-MQxsA_.js";
9
- import { I as Dt } from "./icon-button-C_1TgRiK.js";
10
- import { C as $t, b as Bt, a as jt } from "./collapsible-DVPM46bq.js";
11
- import { F as qt } from "./form-field-Ani72sVY.js";
12
- import { K as Ht } from "./kbd-Bx7eQv9f.js";
13
- import { L as oe } from "./list-CNnn7DOD.js";
14
- import { L as Wt } from "./live-region-C41SO3cA.js";
15
- import { S as Ut } from "./select-k4gBdS8N.js";
16
- import { a as Jt, b as rt, c as Qt, d as Xt } from "./ai-fab-pill-BOu96kCx.js";
17
- import { c as Zt } from "./compose-refs-C0k0tdqF.js";
18
- import { g as Yt, a as en } from "./glass-surface-CPok0jEe.js";
19
- import { p as at } from "./floating-clearance-nIx9fFLy.js";
20
- import { u as tn } from "./registry-DvAUVLHh.js";
21
- import { u as nn } from "./use-ai-sparkle-Cf4yVTLB.js";
22
- import { u as on } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
23
- import { C as pt } from "./circle-alert-rGDZ73Wh.js";
24
- import { T as sn } from "./triangle-alert-CBnO6nq_.js";
25
- import { C as rn } from "./circle-check-BN6rz4NV.js";
26
- import { I as Re } from "./info-CGn22peZ.js";
27
- import { X as an } from "./x-B5YnXwCz.js";
28
- import { L as it } from "./loader-circle-BECIU_8N.js";
29
- import { S as lt } from "./square-DASBRZ0U.js";
30
- import { c as ln } from "./createLucideIcon-DhHxpK9K.js";
31
- import { C as dn } from "./chevron-down-DWE7GSq9.js";
32
- import { S as cn } from "./sliders-horizontal-D-F97cnE.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 un = [
40
- ["path", { d: "M2 10v3", key: "1fnikh" }],
41
- ["path", { d: "M6 6v11", key: "11sgs0" }],
42
- ["path", { d: "M10 3v18", key: "yhl04a" }],
43
- ["path", { d: "M14 8v7", key: "3a1oy3" }],
44
- ["path", { d: "M18 5v13", key: "123xd1" }],
45
- ["path", { d: "M22 10v3", key: "154ddg" }]
46
- ], dt = ln("audio-lines", un), pn = {
47
- id: "voice-control-panel",
48
- capabilities: ["capture", "pick", "expand", "open", "close"],
49
- state: {
50
- status: {
51
- type: "'idle' | 'starting' | 'listening' | 'paused' | 'error'",
52
- descriptionKey: "ui.agent.voiceControlPanel.state.status",
53
- description: "Where the host voice session is: idle, starting, listening, paused or error.",
54
- read: (t) => t.getStatus()
55
- },
56
- candidateIds: {
57
- type: "string[]",
58
- descriptionKey: "ui.agent.voiceControlPanel.state.candidateIds",
59
- description: "Ids of the matches currently offered, in spoken order (option 1 first). Empty when there is nothing to choose.",
60
- read: (t) => t.getCandidateIds()
61
- },
62
- commandsOpen: {
63
- type: "boolean",
64
- descriptionKey: "ui.agent.voiceControlPanel.state.commandsOpen",
65
- description: "True when the voice commands list is expanded.",
66
- read: (t) => t.isCommandsOpen()
67
- },
68
- panelOpen: {
69
- type: "boolean",
70
- descriptionKey: "ui.agent.voiceControlPanel.state.panelOpen",
71
- description: "Floating layout: true when the panel above the pill is open. Always false inline.",
72
- read: (t) => t.isPanelOpen()
73
- }
74
- },
75
- actions: {
76
- start_listening: {
77
- safety: "write",
78
- idempotent: !0,
79
- // The host streams the patient's audio to its transcription service.
80
- openWorld: !0,
81
- descriptionKey: "ui.agent.voiceControlPanel.actions.startListening",
82
- description: "Ask the host to start listening (it opens the microphone). Does nothing when already starting or listening, or while the panel is disabled.",
83
- errors: ["Microphone permission denied", "Speech service unavailable"],
84
- invoke: (t) => {
85
- t.start();
86
- }
87
- },
88
- stop_listening: {
89
- safety: "write",
90
- idempotent: !0,
91
- descriptionKey: "ui.agent.voiceControlPanel.actions.stopListening",
92
- description: "Ask the host to stop listening, or to cancel a start. Does nothing when not starting or listening.",
93
- invoke: (t) => {
94
- t.stop();
95
- }
96
- },
97
- pick_candidate: {
98
- // The host turns the pick into a write on the patient's record (the
99
- // care plan adds a treatment line), so it is gated as PHI.
100
- safety: "phi",
101
- argsType: "{ id: string }",
102
- argsSchema: {
103
- type: "object",
104
- properties: {
105
- id: {
106
- type: "string",
107
- description: "One of the ids in the candidateIds state slot."
108
- }
109
- },
110
- required: ["id"],
111
- additionalProperties: !1
112
- },
113
- descriptionKey: "ui.agent.voiceControlPanel.actions.pickCandidate",
114
- description: "Pick one of the offered matches by id, the same as saying its option number or pressing it. Unknown ids are ignored.",
115
- examples: [
116
- { args: { id: "otve" }, note: "Pick the match with id otve." }
117
- ],
118
- invoke: (t, g) => {
119
- t.pickCandidate(g.id);
120
- }
121
- },
122
- open_commands: {
123
- safety: "read",
124
- idempotent: !0,
125
- descriptionKey: "ui.agent.voiceControlPanel.actions.openCommands",
126
- description: "Expand the voice commands list.",
127
- invoke: (t) => {
128
- t.openCommands();
129
- }
130
- },
131
- close_commands: {
132
- safety: "read",
133
- idempotent: !0,
134
- descriptionKey: "ui.agent.voiceControlPanel.actions.closeCommands",
135
- description: "Collapse the voice commands list.",
136
- invoke: (t) => {
137
- t.closeCommands();
138
- }
139
- },
140
- open_panel: {
141
- safety: "read",
142
- idempotent: !0,
143
- descriptionKey: "ui.agent.voiceControlPanel.actions.openPanel",
144
- description: "Floating layout: open the panel above the pill. Does nothing inline.",
145
- invoke: (t) => {
146
- t.openPanel();
147
- }
148
- },
149
- close_panel: {
150
- safety: "read",
151
- idempotent: !0,
152
- descriptionKey: "ui.agent.voiceControlPanel.actions.closePanel",
153
- description: "Floating layout: close the panel above the pill. Listening carries on. Does nothing inline.",
154
- invoke: (t) => {
155
- t.closePanel();
156
- }
157
- }
158
- },
159
- domHooks: {
160
- root: {
161
- attr: "data-component",
162
- value: "voice-control-panel",
163
- description: "Marks the VoiceControlPanel root."
164
- },
165
- instanceId: {
166
- attr: "data-component-id",
167
- sourceProp: "id",
168
- description: "Sourced from the id prop on VoiceControlPanel."
169
- },
170
- item: {
171
- attr: "data-candidate-id",
172
- description: "On each match button, the candidate id that pick_candidate takes."
173
- }
174
- }
175
- }, mn = P(
176
- [
177
- // The container query lives on the root and is read by descendants only,
178
- // never by a flex parent of its own (see the grid below).
179
- "ds:@container/voice-control",
180
- "ds:block ds:w-full ds:min-w-0",
181
- // The edge is --surface-border-width (1px, 2px in the accessible themes),
182
- // at zero specificity so the nearest theme root decides it.
183
- "ds:rounded-[var(--radius-lg)] ds:[:where(&)]:border-[length:var(--surface-border-width,var(--border-width-sm))]",
184
- "ds:bg-[var(--card)] ds:text-[color:var(--foreground)]",
185
- "ds:p-[var(--spacing-md)]",
186
- "ds:print:hidden"
187
- ].join(" "),
188
- {
189
- variants: {
190
- // The border colour lives only here, never beside a base colour, so
191
- // the listening ring can't lose a race on stylesheet order.
192
- status: {
193
- idle: "ds:border-[color:var(--card-border)]",
194
- starting: "ds:border-[color:var(--card-border)]",
195
- listening: "ds:border-[color:var(--ring)]",
196
- paused: "ds:border-[color:var(--card-border)]",
197
- error: "ds:border-[color:var(--card-border)]"
198
- }
199
- },
200
- defaultVariants: { status: "idle" }
201
- }
202
- ), fn = P(
203
- [
204
- "ds:relative ds:inline-flex ds:size-2.5 ds:shrink-0 ds:rounded-[var(--radius-full)]",
205
- "ds:forced-colors:border ds:forced-colors:border-[CanvasText]"
206
- ].join(" "),
207
- {
208
- variants: {
209
- status: {
210
- idle: "ds:border ds:border-[color:var(--muted-foreground)]",
211
- starting: "ds:bg-[color:var(--muted-foreground)]",
212
- listening: "ds:bg-[color:var(--destructive)]",
213
- paused: "ds:bg-[color:var(--warning)]",
214
- error: "ds:bg-[color:var(--error)]"
215
- }
216
- },
217
- defaultVariants: { status: "idle" }
218
- }
219
- ), ct = P(
220
- "ds:m-0 ds:flex ds:items-start ds:gap-[var(--spacing-xs)] type-body-sm",
221
- {
222
- variants: {
223
- tone: {
224
- info: "ds:text-[color:var(--info-foreground)]",
225
- success: "ds:text-[color:var(--success-foreground)]",
226
- warning: "ds:text-[color:var(--warning-foreground)]",
227
- error: "ds:text-[color:var(--error-foreground)]"
228
- }
229
- },
230
- defaultVariants: { tone: "info" }
231
- }
232
- ), Oe = "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)] ds:forced-colors:focus-visible:outline-[CanvasText]", gn = P(
233
- [
234
- "ds:flex ds:w-full ds:items-center",
235
- "ds:min-h-[var(--min-target-size)] ds:rounded-[var(--radius-sm)]",
236
- "ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:py-[var(--spacing-2xs)]",
237
- "ds:text-start ds:text-[color:var(--foreground)] ds:cursor-pointer",
238
- "ds:hover:bg-[color:var(--muted)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
239
- "ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
240
- Oe
241
- ].join(" ")
242
- ), vn = P(
243
- [
244
- "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
245
- "ds:min-h-[var(--min-target-size)] ds:py-[var(--spacing-2xs)]",
246
- "ds:rounded-[var(--radius-sm)] type-meta ds:text-[color:var(--muted-foreground)] ds:text-start",
247
- "ds:hover:text-[color:var(--foreground)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
248
- Oe
249
- ].join(" ")
250
- ), hn = P(
251
- [
252
- "ds:fixed ds:z-[var(--z-fixed)]",
253
- "ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))]",
254
- "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
255
- "ds:pointer-events-none ds:[&>*]:pointer-events-auto",
256
- "ds:print:hidden"
257
- ].join(" "),
258
- {
259
- variants: {
260
- position: {
261
- "bottom-end": "ds:end-[var(--spacing-lg)] ds:items-end",
262
- "bottom-start": "ds:start-[var(--spacing-lg)] ds:items-start"
263
- }
264
- },
265
- defaultVariants: { position: "bottom-end" }
266
- }
267
- ), bn = P(
268
- [
269
- "ds:@container/voice-control",
270
- // Closed is `hidden`: never let a display utility win over it.
271
- "ds:min-w-0 ds:[&[hidden]]:hidden",
272
- "ds:[inline-size:min(24rem,calc(100vw-(var(--spacing-lg)*2)))]",
273
- "ds:[max-block-size:calc(100dvh-var(--min-target-size)-(var(--spacing-lg)*2)-var(--spacing-sm)-env(safe-area-inset-bottom,0px))]",
274
- // On a phone the panel spans the screen, so it stops at half the height
275
- // (scrolling inside) and the voice cursor row above it stays in view.
276
- "ds:max-sm:[max-block-size:calc(50dvh-var(--min-target-size)-(var(--spacing-lg)*2)-var(--spacing-sm)-env(safe-area-inset-bottom,0px))]",
277
- "ds:overflow-y-auto ds:overscroll-contain",
278
- Yt,
279
- en,
280
- "ds:text-[color:var(--foreground)]",
281
- Oe
282
- ].join(" "),
283
- {
284
- variants: {
285
- position: {
286
- "bottom-end": "ds:origin-bottom-right ds:rtl:origin-bottom-left",
287
- "bottom-start": "ds:origin-bottom-left ds:rtl:origin-bottom-right"
288
- }
289
- },
290
- defaultVariants: { position: "bottom-end" }
291
- }
292
- ), yn = P(
293
- "ds:disabled:cursor-not-allowed ds:disabled:opacity-50",
294
- {
295
- variants: {
296
- extended: {
297
- true: "ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-md)]",
298
- false: ""
299
- }
300
- },
301
- defaultVariants: { extended: !1 }
302
- }
303
- ), xn = {
304
- alt: "Alt",
305
- option: "Alt",
306
- ctrl: "Control",
307
- control: "Control",
308
- shift: "Shift",
309
- meta: "Meta",
310
- cmd: "Meta",
311
- command: "Meta"
312
- };
313
- function wn(t) {
314
- const g = t.split("+").map((R) => R.trim()).filter(Boolean);
315
- if (g.length === 0) return null;
316
- const m = g[g.length - 1], L = /* @__PURE__ */ new Set();
317
- for (const R of g.slice(0, -1)) {
318
- const q = xn[R.toLowerCase()];
319
- if (!q) return null;
320
- L.add(q);
321
- }
322
- const V = m.length === 1 ? m.toUpperCase() : m, G = ["Control", "Alt", "Shift", "Meta"].filter(
323
- (R) => L.has(R)
324
- );
325
- return {
326
- modifiers: L,
327
- key: V,
328
- aria: [...G, V].join("+"),
329
- keys: [...G, V]
330
- };
331
- }
332
- function kn(t, g) {
333
- if (t.altKey !== g.modifiers.has("Alt") || t.ctrlKey !== g.modifiers.has("Control") || t.shiftKey !== g.modifiers.has("Shift") || t.metaKey !== g.modifiers.has("Meta")) return !1;
334
- const { key: m } = g;
335
- return /^[A-Z]$/.test(m) ? t.code === `Key${m}` : /^[0-9]$/.test(m) ? t.code === `Digit${m}` : t.key.toLowerCase() === m.toLowerCase();
336
- }
337
- function Nn({ keys: t }) {
338
- return /* @__PURE__ */ o(Ht, { keys: t, separator: "plus", size: "sm" });
339
- }
340
- const Cn = {
341
- info: Re,
342
- success: rn,
343
- warning: sn,
344
- error: pt
345
- }, Sn = [], ut = "ds:min-h-[var(--min-target-size)]", Pn = "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]", Rn = /[.!?…:。.!?؟।]$/u, On = " ", An = It(
346
- ({
347
- status: t,
348
- onToggle: g,
349
- disabled: m = !1,
350
- title: L,
351
- beta: V = !1,
352
- betaNotice: G,
353
- language: R,
354
- languages: q,
355
- onLanguageChange: se,
356
- extraControls: re,
357
- target: ae,
358
- transcript: d,
359
- message: f,
360
- error: C,
361
- candidates: F = Sn,
362
- candidatesLabel: E,
363
- onCandidatePick: M,
364
- commands: ie,
365
- defaultCommandsOpen: mt = !1,
366
- shortcut: H = "Alt+V",
367
- id: D,
368
- layout: ft = "inline",
369
- position: le = "bottom-end",
370
- open: Ae,
371
- defaultOpen: gt = !1,
372
- onOpenChange: Ee,
373
- aiSparkle: vt = !0,
374
- aiConsent: r,
375
- aiConsentHeadingLevel: ht,
376
- className: ze,
377
- ...Ke
378
- }, Te) => {
379
- const { t: i } = Lt("ui"), de = Se(), _e = Se(), Ie = Se(), [ce, ue] = _(mt), v = ft === "floating", pe = c(null), Le = Pe(() => Zt(Te, pe), [Te]), W = c(null), Ve = c(null), U = c(null), me = c(null), Ge = c(null), h = Pe(
380
- () => H === !1 ? null : wn(H),
381
- [H]
382
- );
383
- y(() => {
384
- }, [H, h]);
385
- const [bt, yt] = _(gt), fe = Ae !== void 0, b = v && (fe ? Ae : bt), $ = r !== void 0 && !r.granted, [ge, ve] = _(!1), xt = ge && $, J = c(!1), B = c(!1), [wt, Fe] = _(!1), kt = ((r == null ? void 0 : r.pending) ?? !1) || wt, l = c({
386
- status: t,
387
- onToggle: g,
388
- disabled: m,
389
- candidates: F,
390
- onCandidatePick: M,
391
- commandsOpen: ce,
392
- aiBlocked: $,
393
- floating: v,
394
- panelOpen: b,
395
- controlled: fe,
396
- onOpenChange: Ee
397
- });
398
- l.current = {
399
- status: t,
400
- onToggle: g,
401
- disabled: m,
402
- candidates: F,
403
- onCandidatePick: M,
404
- commandsOpen: ce,
405
- aiBlocked: $,
406
- floating: v,
407
- panelOpen: b,
408
- controlled: fe,
409
- onOpenChange: Ee
410
- };
411
- const Q = c(null), [, Nt] = _(0), x = I((e) => {
412
- Q.current = e, Nt((n) => n + 1);
413
- }, []), z = c(null), he = c(!1), N = I((e) => {
414
- var s;
415
- const n = l.current;
416
- !n.floating || n.panelOpen === e || (n.controlled || yt(e), (s = n.onOpenChange) == null || s.call(n, e));
417
- }, []), X = I(() => {
418
- J.current = !1, B.current = !1, ve(!1);
419
- }, []), Me = I(() => {
420
- const e = typeof document > "u" ? null : document.activeElement;
421
- z.current = e instanceof HTMLElement && e !== document.body ? e : null, J.current = !0, ve(!0), N(!0), x("gate");
422
- }, [N, x]), Z = I(() => {
423
- const { status: e, disabled: n, aiBlocked: s } = l.current;
424
- if (e === "starting" || e === "listening") {
425
- l.current.onToggle("stop");
426
- return;
427
- }
428
- if (!n) {
429
- if (s) {
430
- Me();
431
- return;
432
- }
433
- l.current.onToggle("start");
434
- }
435
- }, [Me]), Y = c(Z);
436
- Y.current = Z;
437
- const Ct = I(() => {
438
- var n;
439
- B.current = !0;
440
- const e = (n = r == null ? void 0 : r.onGrant) == null ? void 0 : n.call(r);
441
- e && typeof e.then == "function" && (Fe(!0), Promise.resolve(e).catch(() => {
442
- B.current = !1;
443
- }).finally(() => Fe(!1)));
444
- }, [r]), De = c((r == null ? void 0 : r.granted) ?? !0);
445
- y(() => {
446
- const e = De.current, n = (r == null ? void 0 : r.granted) ?? !0;
447
- if (De.current = n, e || !n) return;
448
- const s = J.current, u = B.current;
449
- if (J.current = !1, B.current = !1, ve(!1), !s) return;
450
- const k = typeof document > "u" || !document.activeElement || document.activeElement === document.body;
451
- if (u) {
452
- const { status: S, disabled: p } = l.current;
453
- !p && S !== "starting" && S !== "listening" && l.current.onToggle("start"), z.current = null, x("toggle");
454
- } else k && x("toggle");
455
- }, [r == null ? void 0 : r.granted, x]), y(() => {
456
- if (!(t === "starting" || t === "listening") || !$) {
457
- he.current = !1;
458
- return;
459
- }
460
- he.current || (he.current = !0, l.current.onToggle("stop"));
461
- }, [$, t]), y(() => {
462
- v && !b && ge && X();
463
- }, [v, b, ge, X]), y(() => {
464
- if (!h || typeof document > "u") return;
465
- const e = (n) => {
466
- if (n.defaultPrevented || n.repeat || n.isComposing || !kn(n, h)) return;
467
- const { status: s, disabled: u } = l.current;
468
- u && s !== "starting" && s !== "listening" || (n.preventDefault(), Y.current());
469
- };
470
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
471
- }, [h]);
472
- const St = Pe(
473
- () => ({
474
- getStatus: () => l.current.status,
475
- start: () => {
476
- const { status: e, disabled: n } = l.current;
477
- n || e === "starting" || e === "listening" || Y.current();
478
- },
479
- stop: () => {
480
- const { status: e } = l.current;
481
- e !== "starting" && e !== "listening" || Y.current();
482
- },
483
- getCandidateIds: () => l.current.candidates.map((e) => e.id),
484
- pickCandidate: (e) => {
485
- var n, s;
486
- l.current.disabled || l.current.candidates.some((u) => u.id === e) && ((s = (n = l.current).onCandidatePick) == null || s.call(n, e));
487
- },
488
- isCommandsOpen: () => l.current.commandsOpen,
489
- openCommands: () => ue(!0),
490
- closeCommands: () => ue(!1),
491
- isPanelOpen: () => l.current.panelOpen,
492
- openPanel: () => N(!0),
493
- closePanel: () => N(!1)
494
- }),
495
- [N]
496
- );
497
- tn(pn, St, D);
498
- const K = i(`voiceControl.status.${t}`), O = C ? i(`voiceControl.error.${C}`) : "", ee = (f == null ? void 0 : f.text) ?? "", T = ee ? `${(f == null ? void 0 : f.id) ?? ""}\0${ee}` : "", be = F.length > 0, w = F.map((e) => e.id).join("\0"), $e = t === "starting" || t === "listening", te = i(t === "listening" ? "voiceControl.action.stop" : t === "starting" ? "common.cancel" : t === "paused" ? "voiceControl.action.resume" : "voiceControl.action.start"), [ye, Pt] = _({ text: "", count: 0 }), Be = c({
499
- status: t,
500
- errorText: O,
501
- messageKey: T,
502
- candidatesKey: w
503
- });
504
- y(() => {
505
- const e = Be.current, n = [];
506
- t !== e.status && n.push(K), O && O !== e.errorText && n.push(O), T && T !== e.messageKey && n.push(ee), w && w !== e.candidatesKey && n.push(E || i("voiceControl.candidates")), Be.current = { status: t, errorText: O, messageKey: T, candidatesKey: w }, n.length > 0 && Pt((s) => ({
507
- // A sentence break between parts gives the screen reader a pause:
508
- // "Stopped. Microphone access is blocked…". The break is a
509
- // translated template (Japanese ends a sentence with 。), skipped
510
- // when a part already ends one.
511
- text: n.reduce(
512
- (u, k) => Rn.test(u) ? `${u} ${k}` : i("voiceControl.announcementJoin", {
513
- first: u,
514
- next: k
515
- })
516
- ),
517
- count: s.count + 1
518
- }));
519
- }, [
520
- i,
521
- t,
522
- K,
523
- O,
524
- T,
525
- ee,
526
- w,
527
- E
528
- ]);
529
- const je = c({ error: C, candidatesKey: w });
530
- y(() => {
531
- const e = je.current;
532
- je.current = { error: C, candidatesKey: w }, v && (C && C !== e.error || w && w !== e.candidatesKey) && N(!0);
533
- }, [v, C, w, N]), y(() => {
534
- const e = pe.current;
535
- if (!v || !e) return;
536
- const n = {}, s = () => {
537
- var nt;
538
- const k = window.getComputedStyle(e), S = Number.parseFloat(k.rowGap) || 0, p = (Number.parseFloat(k.bottom) || 0) + (((nt = Ge.current) == null ? void 0 : nt.offsetHeight) ?? 0) + S, A = W.current, tt = A && !A.hidden ? A.offsetHeight : 0;
539
- at(
540
- n,
541
- tt > 0 ? Math.max(
542
- p,
543
- Math.min(p + tt + S, window.innerHeight / 2)
544
- ) : p
545
- );
546
- };
547
- s();
548
- const u = typeof ResizeObserver > "u" ? null : new ResizeObserver(s);
549
- return u == null || u.observe(e), window.addEventListener("resize", s), () => {
550
- u == null || u.disconnect(), window.removeEventListener("resize", s), at(n, null);
551
- };
552
- }, [v]);
553
- const xe = v && vt, {
554
- state: qe,
555
- props: He,
556
- land: We
557
- } = nn({ enabled: xe }), j = (f == null ? void 0 : f.tone) === "success" ? T : "", Ue = c(j);
558
- y(() => {
559
- j !== Ue.current && (Ue.current = j, xe && j && We());
560
- }, [xe, j, We]);
561
- const we = c(!1);
562
- y(() => {
563
- var n;
564
- if (be || !we.current) return;
565
- we.current = !1;
566
- const e = typeof document > "u" ? null : document.activeElement;
567
- (!e || e === document.body) && ((n = U.current) == null || n.focus());
568
- }, [be]);
569
- const Je = c(() => {
570
- });
571
- y(() => {
572
- const e = pe.current;
573
- if (!v || !e) return;
574
- const n = (s) => {
575
- s.key !== "Escape" || s.defaultPrevented || l.current.panelOpen && (s.preventDefault(), Je.current(!0));
576
- };
577
- return e.addEventListener("keydown", n), () => e.removeEventListener("keydown", n);
578
- }, [v]);
579
- const Qe = c(b);
580
- on(() => {
581
- var s;
582
- const e = Qe.current;
583
- if (Qe.current = b, !e || b || Q.current) return;
584
- const n = document.activeElement;
585
- n && ((s = W.current) != null && s.contains(n)) && x("launcher");
586
- }, [b, x]), y(() => {
587
- var n, s, u, k, S;
588
- const e = Q.current;
589
- if (e)
590
- if (Q.current = null, e === "gate") {
591
- const p = Ve.current, A = (p == null ? void 0 : p.querySelector(
592
- '[role="checkbox"]:not([disabled])'
593
- )) ?? (p == null ? void 0 : p.querySelector(
594
- '[data-component="ai-consent-banner"]'
595
- ));
596
- A == null || A.focus();
597
- } else if (e === "return") {
598
- const p = z.current;
599
- z.current = null, p != null && p.isConnected && p.getClientRects().length > 0 ? p.focus() : l.current.floating && !l.current.panelOpen ? (n = me.current) == null || n.focus() : (s = U.current) == null || s.focus();
600
- } else e === "panel" ? (u = W.current) == null || u.focus() : e === "toggle" ? (k = U.current) == null || k.focus() : (S = me.current) == null || S.focus();
601
- });
602
- const Xe = (q ?? []).map((e) => ({
603
- value: e.value,
604
- label: e.label
605
- })), Ze = Xe.length > 1, Rt = Ze || re != null && re !== !1, Ot = !!(d != null && d.final) || !!(d != null && d.partial), ne = t === "starting", At = f ? Cn[f.tone] : Re, ke = (e) => {
606
- N(!1), X(), e && x(z.current ? "return" : "launcher");
607
- };
608
- Je.current = ke;
609
- const Et = /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-xs)] ds:gap-y-[var(--spacing-2xs)]", children: [
610
- /* @__PURE__ */ o(
611
- "p",
612
- {
613
- id: de,
614
- className: "ds:m-0 type-label ds:font-semibold ds:text-[color:var(--foreground)]",
615
- children: L ?? i("voiceControl.title")
616
- }
617
- ),
618
- V ? /* @__PURE__ */ o(Mt, { variant: "brand", size: "sm", children: i("voiceControl.beta") }) : null,
619
- /* @__PURE__ */ a("span", { className: "ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-meta ds:text-[color:var(--muted-foreground)]", children: [
620
- /* @__PURE__ */ o("span", { "aria-hidden": "true", className: fn({ status: t }), children: t === "listening" ? /* @__PURE__ */ o(
621
- "span",
622
- {
623
- className: [
624
- "ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)]",
625
- "ds:bg-[color:var(--destructive)]",
626
- // No pulse in the accessible themes (--accessible-off).
627
- "ds:motion-safe:animate-[var(--accessible-off,recorder-pulse_1.2s_ease-out_infinite)]"
628
- ].join(" ")
629
- }
630
- ) : null }),
631
- /* @__PURE__ */ o("span", { "data-voice-status": "", children: K })
632
- ] }),
633
- v ? /* @__PURE__ */ o(
634
- Dt,
635
- {
636
- intent: "ghost",
637
- size: "md",
638
- icon: /* @__PURE__ */ o(an, {}),
639
- "aria-label": i("common.close"),
640
- onClick: () => ke(!0),
641
- className: Pn,
642
- "data-voice-close": ""
643
- }
644
- ) : null
645
- ] }), zt = G ? /* @__PURE__ */ a("p", { className: "ds:m-0 ds:flex ds:items-start ds:gap-[var(--spacing-2xs)] type-meta ds:text-[color:var(--muted-foreground)]", children: [
646
- /* @__PURE__ */ o(Re, { "aria-hidden": "true", className: "ds:mt-px ds:size-4 ds:shrink-0" }),
647
- /* @__PURE__ */ o("span", { children: G })
648
- ] }) : null, Kt = xt && r ? /* @__PURE__ */ a(
649
- "div",
650
- {
651
- ref: Ve,
652
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
653
- "data-voice-consent": "",
654
- children: [
655
- /* @__PURE__ */ o(
656
- Gt,
657
- {
658
- tabIndex: -1,
659
- granted: r.granted,
660
- grantedAt: r.grantedAt,
661
- grantedBy: r.grantedBy,
662
- canGrant: (r.canGrant ?? !0) && r.onGrant !== void 0,
663
- pending: kt,
664
- onGrantConsent: Ct,
665
- headingLevel: ht
666
- }
667
- ),
668
- /* @__PURE__ */ o("div", { className: "ds:flex ds:justify-end", children: /* @__PURE__ */ o(
669
- st,
670
- {
671
- intent: "ghost",
672
- size: "md",
673
- onClick: () => {
674
- X(), x("return");
675
- },
676
- className: ut,
677
- children: i("common.close")
678
- }
679
- ) })
680
- ]
681
- }
682
- ) : null, Tt = /* @__PURE__ */ a(ot, { children: [
683
- /* @__PURE__ */ a("div", { className: "ds:grid ds:grid-cols-1 ds:items-start ds:gap-[var(--spacing-sm)] ds:@[560px]/voice-control:grid-cols-[auto_minmax(0,1fr)_auto]", children: [
684
- /* @__PURE__ */ o(
685
- st,
686
- {
687
- ref: U,
688
- intent: t === "listening" ? "outline" : "primary",
689
- background: "surface",
690
- size: "md",
691
- disabled: m && !$e,
692
- "aria-busy": ne || void 0,
693
- "aria-keyshortcuts": h == null ? void 0 : h.aria,
694
- onClick: () => Z(),
695
- startIcon: ne ? /* @__PURE__ */ o(it, { className: "ds:animate-[var(--accessible-off,spin_1s_linear_infinite)] ds:motion-reduce:animate-none" }) : t === "listening" ? /* @__PURE__ */ o(lt, { className: "ds:fill-current" }) : /* @__PURE__ */ o(dt, {}),
696
- className: `${ut} ds:w-full ds:@[560px]/voice-control:w-auto`,
697
- "data-voice-toggle": "",
698
- children: te
699
- }
700
- ),
701
- /* @__PURE__ */ a("div", { className: "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
702
- ae != null && ae !== "" ? /* @__PURE__ */ o("p", { className: "ds:m-0 type-body-sm ds:font-semibold ds:[overflow-wrap:anywhere]", children: ae }) : null,
703
- Ot ? /* @__PURE__ */ a(
704
- "p",
705
- {
706
- className: "ds:m-0 type-body-sm ds:[overflow-wrap:anywhere]",
707
- "data-voice-transcript": "",
708
- children: [
709
- /* @__PURE__ */ a("span", { className: "ds:sr-only", children: [
710
- i("voiceControl.heard"),
711
- " "
712
- ] }),
713
- d != null && d.final ? /* @__PURE__ */ o("span", { className: "ds:text-[color:var(--foreground)]", children: d.final }) : null,
714
- d != null && d.final && (d != null && d.partial) ? " " : null,
715
- d != null && d.partial ? /* @__PURE__ */ o(
716
- "span",
717
- {
718
- className: "ds:italic ds:text-[color:var(--muted-foreground)]",
719
- "data-voice-partial": "",
720
- children: d.partial
721
- }
722
- ) : null
723
- ]
724
- }
725
- ) : t === "listening" ? (
726
- // Holds the line while nothing has been heard yet, so the first
727
- // words do not push the panel down.
728
- /* @__PURE__ */ o(
729
- "p",
730
- {
731
- "aria-hidden": "true",
732
- className: "ds:m-0 type-body-sm ds:min-h-[1lh]"
733
- }
734
- )
735
- ) : null,
736
- C ? /* @__PURE__ */ a("p", { className: ct({ tone: "error" }), children: [
737
- /* @__PURE__ */ o(
738
- pt,
739
- {
740
- "aria-hidden": "true",
741
- className: "ds:mt-px ds:size-4 ds:shrink-0"
742
- }
743
- ),
744
- /* @__PURE__ */ o("span", { children: O })
745
- ] }) : null,
746
- f && f.text ? /* @__PURE__ */ a(
747
- "p",
748
- {
749
- className: ct({ tone: f.tone }),
750
- "data-tone": f.tone,
751
- children: [
752
- /* @__PURE__ */ o(
753
- At,
754
- {
755
- "aria-hidden": "true",
756
- className: "ds:mt-px ds:size-4 ds:shrink-0"
757
- }
758
- ),
759
- /* @__PURE__ */ o("span", { children: f.text })
760
- ]
761
- }
762
- ) : null
763
- ] }),
764
- Rt ? /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:@[560px]/voice-control:flex-row ds:@[560px]/voice-control:flex-wrap ds:@[560px]/voice-control:items-end", children: [
765
- Ze ? (
766
- // A visible, associated label (the kit FormField pattern).
767
- /* @__PURE__ */ o(qt, { label: i("voiceControl.language"), children: /* @__PURE__ */ o(
768
- Ut,
769
- {
770
- options: Xe,
771
- value: R ?? "",
772
- onValueChange: (e) => {
773
- e && (se == null || se(e));
774
- },
775
- disabled: m
776
- }
777
- ) })
778
- ) : null,
779
- re
780
- ] }) : null
781
- ] }),
782
- be ? /* @__PURE__ */ a(
783
- "div",
784
- {
785
- role: "group",
786
- "aria-labelledby": E ? _e : void 0,
787
- "aria-label": E ? void 0 : i("voiceControl.candidates"),
788
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
789
- "data-voice-candidates": "",
790
- children: [
791
- E ? /* @__PURE__ */ o(
792
- "p",
793
- {
794
- id: _e,
795
- className: "ds:m-0 type-body-sm ds:text-[color:var(--foreground)]",
796
- children: E
797
- }
798
- ) : null,
799
- /* @__PURE__ */ o(oe, { as: "ol", density: "compact", children: F.map((e, n) => /* @__PURE__ */ o(
800
- oe.Item,
801
- {
802
- title: /* @__PURE__ */ o(
803
- "button",
804
- {
805
- type: "button",
806
- disabled: m,
807
- onClick: () => {
808
- we.current = !0, M == null || M(e.id);
809
- },
810
- className: gn(),
811
- "data-candidate-id": e.id,
812
- children: /* @__PURE__ */ a("span", { children: [
813
- /* @__PURE__ */ o("span", { className: "ds:sr-only", children: i("voiceControl.candidate", {
814
- number: n + 1
815
- }) }),
816
- " ",
817
- /* @__PURE__ */ o("span", { className: "ds:font-medium", children: e.label }),
818
- e.detail ? /* @__PURE__ */ a(ot, { children: [
819
- " ",
820
- /* @__PURE__ */ o("span", { className: "ds:ms-[var(--spacing-2xs)] type-meta ds:text-[color:var(--muted-foreground)]", children: e.detail })
821
- ] }) : null
822
- ] })
823
- }
824
- )
825
- },
826
- e.id
827
- )) })
828
- ]
829
- }
830
- ) : null,
831
- ie && ie.length > 0 ? /* @__PURE__ */ a($t, { open: ce, onOpenChange: ue, children: [
832
- /* @__PURE__ */ a(Bt, { className: vn(), children: [
833
- /* @__PURE__ */ o(
834
- dn,
835
- {
836
- "aria-hidden": "true",
837
- className: "ds:size-4 ds:shrink-0 ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:[[data-state=open]_&]:rotate-180"
838
- }
839
- ),
840
- /* @__PURE__ */ o("span", { children: h ? /* @__PURE__ */ o(
841
- Vt,
842
- {
843
- ns: "ui",
844
- i18nKey: "voiceControl.commandsWithShortcut",
845
- components: {
846
- shortcut: /* @__PURE__ */ o(Nn, { keys: h.keys })
847
- }
848
- }
849
- ) : i("voiceControl.commands") })
850
- ] }),
851
- /* @__PURE__ */ o(
852
- jt,
853
- {
854
- "aria-label": i("voiceControl.commands"),
855
- className: "ds:pt-[var(--spacing-xs)]",
856
- children: /* @__PURE__ */ o(oe, { density: "compact", children: ie.map((e, n) => /* @__PURE__ */ o(
857
- oe.Item,
858
- {
859
- title: e.phrase,
860
- description: e.description
861
- },
862
- n
863
- )) })
864
- }
865
- )
866
- ] }) : null
867
- ] }), Ye = /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
868
- Et,
869
- zt,
870
- Kt ?? Tt
871
- ] }), et = /* @__PURE__ */ o(Wt, { politeness: "polite", "data-voice-announcer": "", children: ye.text ? (
872
- // Alternate a trailing no-break space so the same words said
873
- // twice in a row still change the region and are announced.
874
- `${ye.text}${ye.count % 2 ? On : ""}`
875
- ) : "" });
876
- if (!v)
877
- return /* @__PURE__ */ a(
878
- "div",
879
- {
880
- ref: Le,
881
- role: "group",
882
- "aria-labelledby": de,
883
- "data-component": "voice-control-panel",
884
- "data-component-id": D,
885
- "data-status": t,
886
- id: D,
887
- ...Ke,
888
- className: mn({ status: t, className: ze }),
889
- children: [
890
- Ye,
891
- et
892
- ]
893
- }
894
- );
895
- const Ne = t === "listening", Ce = Ne || t === "paused", _t = Ce && !te.toLocaleLowerCase().includes(K.toLocaleLowerCase()) ? i("voiceControl.statusWithAction", {
896
- status: K,
897
- action: te
898
- }) : te;
899
- return /* @__PURE__ */ a(
900
- "div",
901
- {
902
- ref: Le,
903
- "data-component": "voice-control-panel",
904
- "data-component-id": D,
905
- "data-status": t,
906
- "data-layout": "floating",
907
- "data-position": le,
908
- "data-open": b ? "" : void 0,
909
- id: D,
910
- ...Ke,
911
- className: hn({ position: le, className: ze }),
912
- children: [
913
- /* @__PURE__ */ o(
914
- "div",
915
- {
916
- ref: W,
917
- id: Ie,
918
- role: "group",
919
- "aria-labelledby": de,
920
- tabIndex: -1,
921
- hidden: !b,
922
- className: bn({ position: le }),
923
- "data-voice-panel": "",
924
- children: Ye
925
- }
926
- ),
927
- /* @__PURE__ */ a(
928
- "div",
929
- {
930
- ref: Ge,
931
- className: "ds:relative",
932
- "data-ai-sparkle": He["data-ai-sparkle"],
933
- children: [
934
- /* @__PURE__ */ a("div", { className: Jt, "data-voice-pill": "", children: [
935
- /* @__PURE__ */ a(
936
- "button",
937
- {
938
- type: "button",
939
- onClick: () => Z(),
940
- disabled: m && !$e || void 0,
941
- "aria-label": _t,
942
- "aria-busy": ne || void 0,
943
- "aria-keyshortcuts": h == null ? void 0 : h.aria,
944
- className: rt({
945
- // The word on the red needs 7:1 in the accessible themes:
946
- // `labelled` holds the hover red there.
947
- recording: Ne ? "labelled" : !1,
948
- className: yn({ extended: Ce })
949
- }),
950
- "data-voice-mic": "",
951
- children: [
952
- ne ? /* @__PURE__ */ o(
953
- it,
954
- {
955
- "aria-hidden": "true",
956
- className: "ds:size-5 ds:animate-[var(--accessible-off,spin_1s_linear_infinite)] ds:motion-reduce:animate-none"
957
- }
958
- ) : Ne ? /* @__PURE__ */ o(
959
- lt,
960
- {
961
- "aria-hidden": "true",
962
- className: "ds:size-5 ds:fill-current"
963
- }
964
- ) : /* @__PURE__ */ o(dt, { "aria-hidden": "true", className: "ds:size-5" }),
965
- Ce ? /* @__PURE__ */ o("span", { className: "type-label ds:whitespace-nowrap", children: K }) : null
966
- ]
967
- }
968
- ),
969
- /* @__PURE__ */ o("span", { "aria-hidden": "true", className: Qt }),
970
- /* @__PURE__ */ o(
971
- "button",
972
- {
973
- ref: me,
974
- type: "button",
975
- onClick: () => {
976
- b ? ke(!1) : (z.current = null, N(!0), x("panel"));
977
- },
978
- "aria-label": i("voiceControl.panelToggle"),
979
- "aria-expanded": b,
980
- "aria-controls": Ie,
981
- className: rt({ recording: !1 }),
982
- "data-voice-launcher": "",
983
- children: /* @__PURE__ */ o(cn, { "aria-hidden": "true", className: "ds:size-5" })
984
- }
985
- ),
986
- qe ? /* @__PURE__ */ o(
987
- "span",
988
- {
989
- "aria-hidden": "true",
990
- className: `${Xt} ${He.className}`
991
- }
992
- ) : null
993
- ] }),
994
- /* @__PURE__ */ o(Ft, { state: qe })
995
- ]
996
- }
997
- ),
998
- et
999
- ]
1000
- }
1001
- );
1002
- }
1003
- );
1004
- An.displayName = "VoiceControlPanel";
1005
- export {
1006
- An as V,
1007
- pn as v
1008
- };
1009
- //# sourceMappingURL=voice-control-panel-C0BfY23Y.js.map