@alfadocs/ui-kit 1.66.0 → 1.68.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 (305) hide show
  1. package/dist/_chunks/{address-fields-CJtu7LQU.js → address-fields-BUPRs3n-.js} +3 -3
  2. package/dist/_chunks/{agenda-card-DR9gDdKp.js → agenda-card-BDuvreCe.js} +2 -2
  3. package/dist/_chunks/{agenda-tray-DGB1Zup-.js → agenda-tray-CfwylhWf.js} +3 -3
  4. package/dist/_chunks/ai-credits-exhausted-notice-Bg8NpW2K.js +287 -0
  5. package/dist/_chunks/ai-credits-exhausted-notice.agent-DgTSTgez.js +43 -0
  6. package/dist/_chunks/ai-credits-notice-DQ-r3iQU.js +191 -0
  7. package/dist/_chunks/{ai-permission-notice-DpRmZ9Q3.js → ai-permission-notice-C00i6VhY.js} +2 -2
  8. package/dist/_chunks/{ai-prompt-input-DSGSe4LH.js → ai-prompt-input-DzgyoKyk.js} +141 -139
  9. package/dist/_chunks/{alert-DdDpOi-P.js → alert-9kEwDza3.js} +122 -111
  10. package/dist/_chunks/{alia-sidebar-qe0quZkB.js → alia-sidebar-B06ZSOaF.js} +3 -3
  11. package/dist/_chunks/{anamnesis-summary-card-CMzBLTiN.js → anamnesis-summary-card-DQ3iE1gD.js} +2 -2
  12. package/dist/_chunks/{anamnesis-summary-rows-BIfw890v.js → anamnesis-summary-rows-CNK0fIJk.js} +392 -388
  13. package/dist/_chunks/{appointment-card-CL32sux-.js → appointment-card-5JMWi9_f.js} +2 -2
  14. package/dist/_chunks/{appointment-peek-B5mcDcXt.js → appointment-peek-D5XCfYKu.js} +2 -2
  15. package/dist/_chunks/{appointment-timeline-CCqjORFb.js → appointment-timeline-VFP6HoXT.js} +4 -4
  16. package/dist/_chunks/{appointment-tray-qtpJt8e0.js → appointment-tray-B3PDER3I.js} +3 -3
  17. package/dist/_chunks/{audio-recorder-DR-u1qbl.js → audio-recorder-4Ll0pwYK.js} +3 -3
  18. package/dist/_chunks/{auth-form-parts-Cmb41LSQ.js → auth-form-parts-B40zvD-a.js} +2 -2
  19. package/dist/_chunks/avatar-BPiPL7ND.js +199 -0
  20. package/dist/_chunks/{balance-badge-cell-DZNthHO1.js → balance-badge-cell-BG3DMly4.js} +4 -4
  21. package/dist/_chunks/{bishop-score-CaNTrikJ.js → bishop-score-Df8nF1qg.js} +2 -2
  22. package/dist/_chunks/{booking-DkjatiXc.js → booking-B1pDbERi.js} +377 -335
  23. package/dist/_chunks/{calendar-BhN-jisv.js → calendar-BvOM8rG3.js} +2 -2
  24. package/dist/_chunks/{calendar-workspace-Cp8yTZ1g.js → calendar-workspace-CYK1M83j.js} +19 -19
  25. package/dist/_chunks/{chat-message-fRLZ95O5.js → chat-message-Be-9vIIQ.js} +2 -2
  26. package/dist/_chunks/{clinical-note-card-BnFTIs6x.js → clinical-note-card-Caidqcwa.js} +2 -2
  27. package/dist/_chunks/{color-picker-BsggJovx.js → color-picker-AcaWuKah.js} +99 -95
  28. package/dist/_chunks/{combobox-U5yfO6o0.js → combobox-vF9O-QoG.js} +92 -83
  29. package/dist/_chunks/{contact-profile-card-C4-OCshj.js → contact-profile-card-CAwwOqHl.js} +40 -40
  30. package/dist/_chunks/{control-room-rail-DUerqHeo.js → control-room-rail-BB6rCDWI.js} +3 -3
  31. package/dist/_chunks/{country-select-DF5Bd_mn.js → country-select-CSE2Zm_s.js} +2 -2
  32. package/dist/_chunks/dashboard-grid-7JzaiKnk.js +1487 -0
  33. package/dist/_chunks/{data-table-COoCQ4n_.js → data-table-Cty4-Jht.js} +3 -3
  34. package/dist/_chunks/{dependent-selector-DBr1AhLg.js → dependent-selector-C4kOgO8b.js} +2 -2
  35. package/dist/_chunks/{document-preview-B1dQm292.js → document-preview-513f3iPn.js} +4 -4
  36. package/dist/_chunks/{document-scanner-CVPVLK7z.js → document-scanner-Bd3wbzpI.js} +2 -2
  37. package/dist/_chunks/{editable-description-ChGNdYY8.js → editable-description-DnAFi360.js} +2 -2
  38. package/dist/_chunks/{entity-summary-BQ9_KA8S.js → entity-summary-C2B8yNmc.js} +4 -4
  39. package/dist/_chunks/{error-summary-DrUfuKu1.js → error-summary-mGxIyDAY.js} +2 -2
  40. package/dist/_chunks/{face-scheme-DAD-mXzM.js → face-scheme-CSJdRNad.js} +248 -244
  41. package/dist/_chunks/{file-manager-RiV7-OEE.js → file-manager-D4cPnRhL.js} +3 -3
  42. package/dist/_chunks/{forgot-password-form-CgZkEvZy.js → forgot-password-form-Dqi7R-NL.js} +4 -4
  43. package/dist/_chunks/format-number-DdzqwMs1.js +13 -0
  44. package/dist/_chunks/{freemium-paywall-DKJHRFpp.js → freemium-paywall-C73C8Rgd.js} +2 -2
  45. package/dist/_chunks/{gestational-age-calculator-CZYa2D6m.js → gestational-age-calculator-Du53p8MH.js} +2 -2
  46. package/dist/_chunks/{header-settings-BSH9Gk0J.js → header-settings-DlUbvAUx.js} +37 -36
  47. package/dist/_chunks/{heatmap-C1TeC7wT.js → heatmap-DbZIQg14.js} +4 -4
  48. package/dist/_chunks/help-me-write-templates-5WkUfvc_.js +687 -0
  49. package/dist/_chunks/hourglass-BEAzW1wE.js +26 -0
  50. package/dist/_chunks/{kit-extensions-DWs1UEXb.js → kit-extensions-CYvLL4ee.js} +3 -3
  51. package/dist/_chunks/length-token-DwMnGEYT.js +24 -0
  52. package/dist/_chunks/{link-cell-renderer-CtTsvfPY.js → link-cell-renderer-DtIsQWDO.js} +4 -4
  53. package/dist/_chunks/{login-dev-card-PnADNcI9.js → login-dev-card-vEL-o5wq.js} +3 -3
  54. package/dist/_chunks/{map-view-BuVfJMEa.js → map-view-CtohteZD.js} +300 -191
  55. package/dist/_chunks/{marketplace-app-shell-C-2e4eCD.js → marketplace-app-shell-CcLQ0Dn-.js} +4 -4
  56. package/dist/_chunks/{message-card-A3mJNqfy.js → message-card-C_ksqIYM.js} +2 -2
  57. package/dist/_chunks/{message-tray-Ft6vSr71.js → message-tray-DCoQ4GQb.js} +3 -3
  58. package/dist/_chunks/{multi-select-CMaAQQgb.js → multi-select-BOad3za9.js} +110 -98
  59. package/dist/_chunks/{muscle-scheme-YoN3rYXV.js → muscle-scheme-C66WlCxG.js} +2 -2
  60. package/dist/_chunks/{note-timeline-DDqNU46n.js → note-timeline-KzL52MmB.js} +2 -2
  61. package/dist/_chunks/{notes-panel-uEGIL7mi.js → notes-panel-BXN46XkF.js} +6 -6
  62. package/dist/_chunks/notice-group-DkYzKyAZ.js +291 -0
  63. package/dist/_chunks/{notification-tray-BR3seWA7.js → notification-tray-Cp18MW5b.js} +2 -2
  64. package/dist/_chunks/{operator-hero-3_RG4Dkj.js → operator-hero-6aAIQaFZ.js} +83 -66
  65. package/dist/_chunks/{optical-prescription-CxfMsbxi.js → optical-prescription-ulXnDbBe.js} +525 -509
  66. package/dist/_chunks/panel-header-CbtlTe85.js +190 -0
  67. package/dist/_chunks/{panel-subview-yP4qIbKS.js → panel-subview-BPU7220K.js} +2 -2
  68. package/dist/_chunks/{patient-details-4P1vA9Ls.js → patient-details-C4Dyo7Ck.js} +4 -4
  69. package/dist/_chunks/{patient-field-row-CBXhlfGD.js → patient-field-row-DROvUkFu.js} +155 -176
  70. package/dist/_chunks/{patient-search-DOnDUVsl.js → patient-search-BADdx3M1.js} +2 -2
  71. package/dist/_chunks/{patient-summary-card-CuDLo8MP.js → patient-summary-card-CAimxbuI.js} +4 -4
  72. package/dist/_chunks/{payment-automation-upsell-C8MEu0t6.js → payment-automation-upsell-CiwF5UrC.js} +2 -2
  73. package/dist/_chunks/{payment-form-C3dGY7v4.js → payment-form-PBuh8PIa.js} +2 -2
  74. package/dist/_chunks/{pdf-viewer-DJ9VN7cu.js → pdf-viewer-gAsNUsA8.js} +2 -2
  75. package/dist/_chunks/{periodontal-risk-chart-CPy7CNFe.js → periodontal-risk-chart-B7S9OmPC.js} +97 -89
  76. package/dist/_chunks/practice-profile-hero-qfrsFQI_.js +236 -0
  77. package/dist/_chunks/{practice-results-8h2Utpt3.js → practice-results-BzThnpnm.js} +328 -298
  78. package/dist/_chunks/{pregnancy-dating-B8wo4l_r.js → pregnancy-dating-EFcFUJkQ.js} +2 -2
  79. package/dist/_chunks/{privacy-mask-Ch7743uk.js → privacy-mask-CCz9zuIh.js} +2 -2
  80. package/dist/_chunks/{product-hub-panel-C_ZosrBt.js → product-hub-panel-YuFbNPlT.js} +2 -2
  81. package/dist/_chunks/progress-notice-DiHWZ8Ms.js +279 -0
  82. package/dist/_chunks/{province-select-Bd20Z9Br.js → province-select-CDjs5obD.js} +2 -2
  83. package/dist/_chunks/{radiograph-panel.agent-8Ewv8-d7.js → radiograph-panel.agent-4UllIoTQ.js} +2 -2
  84. package/dist/_chunks/{rating-C1Vrmpsi.js → rating-CGYpg5dj.js} +43 -44
  85. package/dist/_chunks/{registration-form-BQyT_kBX.js → registration-form-1B0PTDal.js} +4 -4
  86. package/dist/_chunks/{reviews-panel-AvsVgtJu.js → reviews-panel-CosDZyow.js} +29 -7
  87. package/dist/_chunks/{rich-text-editor-M2gT_E7f.js → rich-text-editor-56dSsyZI.js} +1653 -1743
  88. package/dist/_chunks/{select-k4gBdS8N.js → select-4S-eYZUf.js} +244 -214
  89. package/dist/_chunks/{sign-document-CY7xTXbm.js → sign-document-BiOTs1P4.js} +2 -2
  90. package/dist/_chunks/{signature-request-BMCHy2ZO.js → signature-request-DAmNj_uq.js} +5 -5
  91. package/dist/_chunks/skeleton-tTWJpvAq.js +415 -0
  92. package/dist/_chunks/{slot-grid-dj5f6R2w.js → slot-grid-D_gix9mJ.js} +2 -2
  93. package/dist/_chunks/{tabs-2x3L13jn.js → tabs-BTj-2qMZ.js} +2 -2
  94. package/dist/_chunks/{task-card-BS7Uqevr.js → task-card-Ci2XbLmq.js} +2 -2
  95. package/dist/_chunks/{task-editor-CifOznfq.js → task-editor-BomyxGoZ.js} +8 -8
  96. package/dist/_chunks/{task-tray-eQU4KJcA.js → task-tray-Dnc72nl-.js} +3 -3
  97. package/dist/_chunks/{tasks-panel-8nLwBw6P.js → tasks-panel-ATz9JDy8.js} +6 -6
  98. package/dist/_chunks/{theme-toggle-Ctb77x6O.js → theme-toggle-DT_Jn4DC.js} +147 -138
  99. package/dist/_chunks/{timeline-DEIuHrWz.js → timeline-wUuTDFY_.js} +2 -2
  100. package/dist/_chunks/{tool-rail-C-03rH2I.js → tool-rail-C-M3eVdY.js} +2 -2
  101. package/dist/_chunks/{transcript-panel-XudW5l6l.js → transcript-panel-CoHHpcFg.js} +2 -2
  102. package/dist/_chunks/{treatment-receipt-Cpm8tqQN.js → treatment-receipt-pFqWFyD_.js} +2 -2
  103. package/dist/_chunks/{unit-converter-BPZ0Ldkb.js → unit-converter-CIoTmCmP.js} +2 -2
  104. package/dist/_chunks/{use-appointment-details-read-B-FEWbQM.js → use-appointment-details-read-CUGfE0hV.js} +13 -13
  105. package/dist/_chunks/use-dismissed-CTOWqA0e.js +177 -0
  106. package/dist/_chunks/voice-control-panel-B8Lrk0C4.js +1148 -0
  107. package/dist/_chunks/{warning-stack-HYWAytZV.js → warning-stack-BhHUmRiD.js} +2 -2
  108. package/dist/_chunks/{workflow-map-C2B2qIr1.js → workflow-map-ln4_OG8A.js} +2 -2
  109. package/dist/agent-catalog.json +221 -6
  110. package/dist/agent-i18n/en.json +32 -5
  111. package/dist/components/_shared/format-number.d.ts +20 -0
  112. package/dist/components/_shared/length-token.d.ts +12 -0
  113. package/dist/components/_shared/option.d.ts +1 -0
  114. package/dist/components/address-fields/index.js +1 -1
  115. package/dist/components/agenda-card/index.js +1 -1
  116. package/dist/components/agenda-tray/index.js +1 -1
  117. package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.agent.d.ts +4 -0
  118. package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.d.ts +96 -0
  119. package/dist/components/ai-credits-notice/ai-credits-notice.d.ts +30 -4
  120. package/dist/components/ai-credits-notice/index.d.ts +3 -0
  121. package/dist/components/ai-credits-notice/index.js +10 -4
  122. package/dist/components/ai-permission-notice/index.js +1 -1
  123. package/dist/components/ai-prompt-input/index.js +1 -1
  124. package/dist/components/alert/alert.d.ts +26 -0
  125. package/dist/components/alert/index.js +1 -1
  126. package/dist/components/anamnesis-summary-card/index.js +1 -1
  127. package/dist/components/appointment-card/index.js +2 -2
  128. package/dist/components/appointment-details-panel/index.js +1 -1
  129. package/dist/components/appointment-peek/index.js +1 -1
  130. package/dist/components/appointment-timeline/index.js +1 -1
  131. package/dist/components/audio-recorder/index.js +1 -1
  132. package/dist/components/avatar/avatar.d.ts +2 -0
  133. package/dist/components/avatar/index.js +1 -1
  134. package/dist/components/bishop-score/index.js +1 -1
  135. package/dist/components/booking/index.js +1 -1
  136. package/dist/components/calendar/index.js +1 -1
  137. package/dist/components/chat-message/index.js +1 -1
  138. package/dist/components/clinical-note-card/index.js +1 -1
  139. package/dist/components/color-picker/index.js +1 -1
  140. package/dist/components/combobox/index.js +1 -1
  141. package/dist/components/contact-profile-card/index.js +1 -1
  142. package/dist/components/control-room-rail/index.js +1 -1
  143. package/dist/components/country-select/index.js +1 -1
  144. package/dist/components/dashboard-grid/dashboard-grid.d.ts +20 -1
  145. package/dist/components/dashboard-grid/index.js +1 -1
  146. package/dist/components/data-table/index.js +2 -2
  147. package/dist/components/dependent-selector/index.js +1 -1
  148. package/dist/components/document-preview/index.js +1 -1
  149. package/dist/components/document-scanner/index.js +1 -1
  150. package/dist/components/editable-description/index.js +1 -1
  151. package/dist/components/entity-summary/index.js +1 -1
  152. package/dist/components/error-summary/index.js +1 -1
  153. package/dist/components/face-scheme/index.js +1 -1
  154. package/dist/components/file-manager/index.js +1 -1
  155. package/dist/components/freemium-paywall/index.js +1 -1
  156. package/dist/components/gestational-age-calculator/index.js +1 -1
  157. package/dist/components/header-settings/index.js +1 -1
  158. package/dist/components/heatmap/index.js +1 -1
  159. package/dist/components/index.d.ts +4 -2
  160. package/dist/components/map-view/index.d.ts +1 -1
  161. package/dist/components/map-view/index.js +1 -1
  162. package/dist/components/map-view/map-view.d.ts +51 -0
  163. package/dist/components/message-card/index.js +1 -1
  164. package/dist/components/message-tray/index.js +1 -1
  165. package/dist/components/multi-select/index.js +1 -1
  166. package/dist/components/muscle-scheme/index.js +1 -1
  167. package/dist/components/note-timeline/index.js +1 -1
  168. package/dist/components/notes-panel/index.js +1 -1
  169. package/dist/components/notice-group/index.d.ts +3 -0
  170. package/dist/components/notice-group/index.js +6 -0
  171. package/dist/components/notice-group/notice-group.agent.d.ts +4 -0
  172. package/dist/components/notice-group/notice-group.d.ts +43 -0
  173. package/dist/components/notification-tray/index.js +1 -1
  174. package/dist/components/operator-hero/index.js +1 -1
  175. package/dist/components/optical-prescription/index.js +1 -1
  176. package/dist/components/optical-prescription/optical-prescription-data.d.ts +8 -8
  177. package/dist/components/panel-header/index.js +1 -1
  178. package/dist/components/panel-header/panel-header.d.ts +10 -0
  179. package/dist/components/panel-subview/index.js +1 -1
  180. package/dist/components/patient-details/index.js +1 -1
  181. package/dist/components/patient-search/index.js +1 -1
  182. package/dist/components/patient-summary-card/index.js +1 -1
  183. package/dist/components/patient-table/index.js +1 -1
  184. package/dist/components/payment-form/index.js +1 -1
  185. package/dist/components/pdf-viewer/index.js +1 -1
  186. package/dist/components/periodontal-risk-chart/index.js +1 -1
  187. package/dist/components/practice-profile-hero/index.js +1 -1
  188. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +4 -1
  189. package/dist/components/practice-results/index.js +1 -1
  190. package/dist/components/practice-results/practice-results.d.ts +10 -2
  191. package/dist/components/pregnancy-dating/index.js +1 -1
  192. package/dist/components/product-hub-tray/index.js +1 -1
  193. package/dist/components/progress-notice/index.d.ts +3 -0
  194. package/dist/components/progress-notice/index.js +6 -0
  195. package/dist/components/progress-notice/progress-notice.agent.d.ts +4 -0
  196. package/dist/components/progress-notice/progress-notice.d.ts +81 -0
  197. package/dist/components/province-select/index.js +1 -1
  198. package/dist/components/radiograph-panel/index.js +1 -1
  199. package/dist/components/rating/index.js +1 -1
  200. package/dist/components/reviews-panel/index.js +1 -1
  201. package/dist/components/rich-text-editor/index.js +2 -2
  202. package/dist/components/select/index.js +1 -1
  203. package/dist/components/select/select.d.ts +6 -0
  204. package/dist/components/sign-document/index.js +1 -1
  205. package/dist/components/skeleton/index.d.ts +1 -1
  206. package/dist/components/skeleton/index.js +1 -1
  207. package/dist/components/skeleton/skeleton.d.ts +41 -1
  208. package/dist/components/skeleton-scheme/index.js +1 -1
  209. package/dist/components/slot-grid/index.js +1 -1
  210. package/dist/components/tabs/index.js +1 -1
  211. package/dist/components/task-card/index.js +1 -1
  212. package/dist/components/task-editor/index.js +1 -1
  213. package/dist/components/task-tray/index.js +1 -1
  214. package/dist/components/tasks-panel/index.js +1 -1
  215. package/dist/components/theme-toggle/index.js +1 -1
  216. package/dist/components/timeline/index.js +1 -1
  217. package/dist/components/tool-rail/index.js +1 -1
  218. package/dist/components/transcript-panel/index.js +1 -1
  219. package/dist/components/treatment-receipt/index.js +1 -1
  220. package/dist/components/unit-converter/index.js +1 -1
  221. package/dist/components/voice-control-panel/index.d.ts +2 -1
  222. package/dist/components/voice-control-panel/index.js +1 -1
  223. package/dist/components/voice-control-panel/voice-control-panel.d.ts +43 -3
  224. package/dist/components/warning-stack/index.js +1 -1
  225. package/dist/components/workflow/index.js +1 -1
  226. package/dist/hooks/index.d.ts +1 -0
  227. package/dist/hooks/index.js +81 -76
  228. package/dist/hooks/use-dismissed.d.ts +58 -0
  229. package/dist/i18n/locales/ar.d.ts +49 -12
  230. package/dist/i18n/locales/ar.js +49 -12
  231. package/dist/i18n/locales/de.d.ts +49 -12
  232. package/dist/i18n/locales/de.js +49 -12
  233. package/dist/i18n/locales/el.d.ts +49 -12
  234. package/dist/i18n/locales/el.js +49 -12
  235. package/dist/i18n/locales/en.d.ts +49 -12
  236. package/dist/i18n/locales/en.js +49 -12
  237. package/dist/i18n/locales/es.d.ts +49 -12
  238. package/dist/i18n/locales/es.js +49 -12
  239. package/dist/i18n/locales/fr.d.ts +49 -12
  240. package/dist/i18n/locales/fr.js +49 -12
  241. package/dist/i18n/locales/hi.d.ts +49 -12
  242. package/dist/i18n/locales/hi.js +49 -12
  243. package/dist/i18n/locales/it.d.ts +49 -12
  244. package/dist/i18n/locales/it.js +49 -12
  245. package/dist/i18n/locales/ja.d.ts +49 -12
  246. package/dist/i18n/locales/ja.js +49 -12
  247. package/dist/i18n/locales/nl.d.ts +49 -12
  248. package/dist/i18n/locales/nl.js +49 -12
  249. package/dist/i18n/locales/pl.d.ts +49 -12
  250. package/dist/i18n/locales/pl.js +49 -12
  251. package/dist/i18n/locales/pt.d.ts +49 -12
  252. package/dist/i18n/locales/pt.js +49 -12
  253. package/dist/i18n/locales/ro.d.ts +49 -12
  254. package/dist/i18n/locales/ro.js +49 -12
  255. package/dist/i18n/locales/ru.d.ts +49 -12
  256. package/dist/i18n/locales/ru.js +49 -12
  257. package/dist/i18n/locales/sq.d.ts +49 -12
  258. package/dist/i18n/locales/sq.js +49 -12
  259. package/dist/i18n/locales/sv.d.ts +49 -12
  260. package/dist/i18n/locales/sv.js +49 -12
  261. package/dist/i18n/locales/tr.d.ts +49 -12
  262. package/dist/i18n/locales/tr.js +49 -12
  263. package/dist/i18n/locales/zh.d.ts +49 -12
  264. package/dist/i18n/locales/zh.js +49 -12
  265. package/dist/index.js +1193 -1177
  266. package/dist/locales/ar.json +49 -12
  267. package/dist/locales/de.json +49 -12
  268. package/dist/locales/el.json +49 -12
  269. package/dist/locales/en.json +49 -12
  270. package/dist/locales/es.json +49 -12
  271. package/dist/locales/fr.json +49 -12
  272. package/dist/locales/hi.json +49 -12
  273. package/dist/locales/it.json +49 -12
  274. package/dist/locales/ja.json +49 -12
  275. package/dist/locales/nl.json +49 -12
  276. package/dist/locales/pl.json +49 -12
  277. package/dist/locales/pt.json +49 -12
  278. package/dist/locales/ro.json +49 -12
  279. package/dist/locales/ru.json +49 -12
  280. package/dist/locales/sq.json +49 -12
  281. package/dist/locales/sv.json +49 -12
  282. package/dist/locales/tr.json +49 -12
  283. package/dist/locales/zh.json +49 -12
  284. package/dist/patterns/alia-assistant/index.js +1 -1
  285. package/dist/patterns/anamnesis/index.js +1 -1
  286. package/dist/patterns/calendar/index.js +1 -1
  287. package/dist/patterns/forgot-password-form/index.js +1 -1
  288. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +6 -23
  289. package/dist/patterns/help-me-write-templates/index.js +8 -7
  290. package/dist/patterns/login-form/index.js +1 -1
  291. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  292. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  293. package/dist/patterns/registration-form/index.js +1 -1
  294. package/dist/patterns/signature-request/index.js +1 -1
  295. package/dist/tokens.css +1 -1
  296. package/package.json +9 -1
  297. package/dist/_chunks/ai-credits-notice-pK9BOmEz.js +0 -90
  298. package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js +0 -17
  299. package/dist/_chunks/avatar-WZY3eGE7.js +0 -123
  300. package/dist/_chunks/dashboard-grid-B2MB7SRS.js +0 -1428
  301. package/dist/_chunks/help-me-write-templates-DFmqnsAa.js +0 -747
  302. package/dist/_chunks/panel-header-BJkaUwnl.js +0 -128
  303. package/dist/_chunks/practice-profile-hero-Dfc0F60y.js +0 -193
  304. package/dist/_chunks/skeleton-B1KTdJ4N.js +0 -116
  305. package/dist/_chunks/voice-control-panel-C0BfY23Y.js +0 -1009
@@ -0,0 +1,687 @@
1
+ import { jsxs as g, Fragment as _, jsx as e } from "react/jsx-runtime";
2
+ import { useState as h, useEffect as j, useId as ee, useRef as q, useCallback as P, useMemo as K } from "react";
3
+ import { useTranslation as U } from "react-i18next";
4
+ import { c as ce } from "./index-D2ZczOXr.js";
5
+ import { A as Z } from "./alert-9kEwDza3.js";
6
+ import { A as de } from "./ai-credits-exhausted-notice-Bg8NpW2K.js";
7
+ import { B as I } from "./button-D-MQxsA_.js";
8
+ import { I as L } from "./icon-button-C_1TgRiK.js";
9
+ import { D as W } from "./dialog-D6fkpRc4.js";
10
+ import { E as me } from "./editor-overlay-CpVO1-Kk.js";
11
+ import { E as pe } from "./empty-state-pL1qum99.js";
12
+ import { F as X } from "./form-field-Ani72sVY.js";
13
+ import { S as ue } from "./spinner-CoflYlEx.js";
14
+ import { T as se } from "./text-area-COMVJ1yE.js";
15
+ import { S as re } from "./state-backed-text-input-Cgh4ms3p.js";
16
+ import { SafeHtml as fe } from "../safe-html/index.js";
17
+ import { P as ge } from "./pencil-B1sKKyuT.js";
18
+ import { T as he } from "./trash-2-uumy3fy1.js";
19
+ import { P as be } from "./plus-DzMQ_c6b.js";
20
+ import { X as te } from "./x-B5YnXwCz.js";
21
+ import { R as ve } from "./rotate-ccw-BBQnIVTr.js";
22
+ import { S as Te } from "./square-DASBRZ0U.js";
23
+ import { M as Me } from "./mic-CUklMZGF.js";
24
+ import { S as Ce } from "./send-C5kDJ-Mz.js";
25
+ import { G as We } from "./grip-vertical-onSb1JXO.js";
26
+ class ae extends Error {
27
+ constructor(m = "AI credits exhausted") {
28
+ super(m), this.name = "AiCreditsExhaustedError";
29
+ }
30
+ }
31
+ const B = "ds:!size-[var(--min-target-size)]", we = `${B} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`, ye = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", J = "ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Ne = "type-eyebrow ds:m-0 ds:text-[color:var(--muted-foreground)]", xe = [
32
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
33
+ "ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
34
+ "ds:p-[var(--spacing-sm)] ds:[max-block-size:14rem] ds:overflow-y-auto",
35
+ "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]",
36
+ "ds:[&_ul]:list-disc ds:[&_ul]:ps-[var(--spacing-md)]",
37
+ "ds:[&_h3]:font-medium ds:[&_h3]:[margin-block-start:var(--spacing-xs)]",
38
+ "ds:[&_p]:[margin-block-end:var(--spacing-xs)]",
39
+ "ds:[&>:first-child]:[margin-block-start:0]"
40
+ ].join(" ");
41
+ function ne(r, m) {
42
+ return m ? r ? /\s$/.test(r) ? `${r}${m}` : `${r} ${m}` : m : r;
43
+ }
44
+ function ke(r) {
45
+ return typeof r == "object" && r !== null && "name" in r && r.name === "AbortError";
46
+ }
47
+ function De({
48
+ context: r,
49
+ onGenerate: m,
50
+ onApplied: v,
51
+ credits: u,
52
+ enableDictation: N = !0,
53
+ suspendClose: w = !1
54
+ }) {
55
+ const { t: n } = U("ui"), { open: t } = r, x = ee(), s = ee(), [d, k] = h(""), [y, D] = h(!1), [E, i] = h(!1), [p, l] = h(!1), [T, R] = h(null), o = q(null), f = N ? r.onDictate : void 0, [M, S] = h(!1), [A, H] = h(""), [V, a] = h(""), C = q(null), z = P(() => {
56
+ var c;
57
+ return (c = C.current) == null ? void 0 : c.abort();
58
+ }, []), ie = P(() => {
59
+ if (M) {
60
+ z();
61
+ return;
62
+ }
63
+ if (!f) return;
64
+ const c = new AbortController();
65
+ C.current = c, S(!0), a(n("helpMeWriteTemplates.bar.listening")), f({
66
+ signal: c.signal,
67
+ onPartialTranscript: (b) => {
68
+ c.signal.aborted || H(b);
69
+ },
70
+ onFinalTranscript: (b) => {
71
+ if (c.signal.aborted) return;
72
+ H("");
73
+ const F = b.trim();
74
+ F && (k((O) => ne(O, F)), a(F));
75
+ }
76
+ }).catch((b) => {
77
+ b instanceof ae && l(!0);
78
+ }).finally(() => {
79
+ H(""), C.current === c && (C.current = null, S(!1), a(""));
80
+ });
81
+ }, [M, f, z, n]);
82
+ j(() => {
83
+ var c, b;
84
+ t ? (k(""), D(!1), i(!1), l(r.creditsExhausted), R(null)) : ((c = o.current) == null || c.abort(), (b = C.current) == null || b.abort());
85
+ }, [t]), j(
86
+ () => () => {
87
+ var c, b;
88
+ (c = o.current) == null || c.abort(), (b = C.current) == null || b.abort();
89
+ },
90
+ []
91
+ );
92
+ const Q = P(() => {
93
+ var F;
94
+ if (y || !d.trim()) return;
95
+ z(), (F = o.current) == null || F.abort();
96
+ const c = new AbortController();
97
+ o.current = c, i(!1), D(!0);
98
+ const b = r.scope === "selection";
99
+ m({
100
+ prompt: d.trim(),
101
+ sourceText: b ? r.selectionText : r.getText(),
102
+ scope: b ? "selection" : "document",
103
+ signal: c.signal
104
+ }).then((O) => {
105
+ c.signal.aborted || (R(O), D(!1));
106
+ }).catch((O) => {
107
+ c.signal.aborted || ke(O) || (O instanceof ae ? l(!0) : i(!0), D(!1));
108
+ });
109
+ }, [y, d, m, z]), { onClose: G } = r, le = P(() => {
110
+ w || G();
111
+ }, [w, G]), oe = () => {
112
+ if (T === null) return;
113
+ const c = r.getHTML();
114
+ r.insertAtSelection(T), r.onClose();
115
+ const { setContent: b } = r;
116
+ v == null || v({
117
+ mode: r.scope === "selection" ? "replace" : "insert",
118
+ previousHtml: c,
119
+ undo: () => b(c)
120
+ });
121
+ };
122
+ let $;
123
+ if (p)
124
+ $ = /* @__PURE__ */ e(
125
+ de,
126
+ {
127
+ credits: u,
128
+ onBack: () => l(!1),
129
+ footnote: n("helpMeWriteTemplates.credits.kept")
130
+ }
131
+ );
132
+ else if (T !== null)
133
+ $ = /* @__PURE__ */ g(_, { children: [
134
+ /* @__PURE__ */ g(
135
+ "section",
136
+ {
137
+ "aria-labelledby": x,
138
+ className: "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]",
139
+ children: [
140
+ /* @__PURE__ */ e("h2", { id: x, className: Ne, children: n("helpMeWriteTemplates.bar.after") }),
141
+ /* @__PURE__ */ e(
142
+ fe,
143
+ {
144
+ html: T,
145
+ profile: "rich-text",
146
+ className: xe,
147
+ tabIndex: 0
148
+ }
149
+ )
150
+ ]
151
+ }
152
+ ),
153
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
154
+ /* @__PURE__ */ e(I, { intent: "ghost", startIcon: /* @__PURE__ */ e(te, {}), onClick: r.onClose, children: n("helpMeWriteTemplates.bar.discard") }),
155
+ /* @__PURE__ */ e(
156
+ I,
157
+ {
158
+ intent: "ghost",
159
+ startIcon: /* @__PURE__ */ e(ve, {}),
160
+ onClick: () => {
161
+ R(null), Q();
162
+ },
163
+ children: n("helpMeWriteTemplates.bar.retry")
164
+ }
165
+ ),
166
+ /* @__PURE__ */ e("span", { className: "ds:flex-1", "aria-hidden": "true" }),
167
+ /* @__PURE__ */ e(I, { intent: "primary", onClick: oe, children: r.scope === "selection" ? n("helpMeWriteTemplates.bar.replace") : n("helpMeWriteTemplates.bar.insert") })
168
+ ] })
169
+ ] });
170
+ else {
171
+ const c = M ? ne(d, A) : d;
172
+ $ = /* @__PURE__ */ g(_, { children: [
173
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
174
+ /* @__PURE__ */ e(
175
+ L,
176
+ {
177
+ size: "md",
178
+ intent: "outline",
179
+ className: B,
180
+ icon: /* @__PURE__ */ e(te, {}),
181
+ "aria-label": n("helpMeWriteTemplates.bar.close"),
182
+ onClick: r.onClose
183
+ }
184
+ ),
185
+ /* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ e(
186
+ se,
187
+ {
188
+ size: "md",
189
+ value: c,
190
+ onChange: (b) => k(b.target.value),
191
+ placeholder: n("editor.ai.promptPlaceholder"),
192
+ "aria-label": n("editor.ai.promptLabel"),
193
+ autoResize: !0,
194
+ minRows: 1,
195
+ maxRows: 3,
196
+ readOnly: y || M,
197
+ tone: E ? "error" : "default",
198
+ "aria-describedby": E ? s : void 0
199
+ }
200
+ ) }),
201
+ f ? /* @__PURE__ */ e(
202
+ L,
203
+ {
204
+ size: "md",
205
+ intent: "outline",
206
+ className: M ? `${B} ${ye}` : B,
207
+ icon: M ? /* @__PURE__ */ e(Te, { className: "ds:fill-current" }) : /* @__PURE__ */ e(Me, {}),
208
+ "aria-pressed": M,
209
+ "aria-label": n(M ? "helpMeWriteTemplates.bar.dictateStop" : "helpMeWriteTemplates.bar.dictateStart"),
210
+ disabled: y,
211
+ onClick: ie
212
+ }
213
+ ) : null,
214
+ /* @__PURE__ */ e(
215
+ L,
216
+ {
217
+ size: "md",
218
+ intent: "primary",
219
+ className: we,
220
+ icon: y ? /* @__PURE__ */ e(ue, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ e(Ce, {}),
221
+ disabled: y || !d.trim(),
222
+ "aria-busy": y || void 0,
223
+ "aria-label": n("helpMeWriteTemplates.bar.write"),
224
+ onClick: Q
225
+ }
226
+ )
227
+ ] }),
228
+ f ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: V }) : null,
229
+ E ? /* @__PURE__ */ e("p", { id: s, role: "alert", className: J, children: n("helpMeWriteTemplates.bar.error") }) : null,
230
+ /* @__PURE__ */ g("p", { className: J, children: [
231
+ r.scope === "selection" ? n("helpMeWriteTemplates.bar.contextSelection") : n("helpMeWriteTemplates.bar.contextDocument"),
232
+ " ",
233
+ r.privacyNotice
234
+ ] })
235
+ ] });
236
+ }
237
+ return /* @__PURE__ */ e(
238
+ me,
239
+ {
240
+ open: t,
241
+ onClose: le,
242
+ ariaLabel: n("editor.ai.helpMeWrite"),
243
+ children: /* @__PURE__ */ e("div", { className: "ds:contents", "data-component": "help-me-write-templates-bar", children: $ })
244
+ }
245
+ );
246
+ }
247
+ const Ee = ce("", {
248
+ variants: {
249
+ dragging: { true: "ds:opacity-60", false: "" },
250
+ dropTarget: {
251
+ true: "ds:outline-[length:var(--focus-ring-width)] ds:outline-dashed ds:outline-[var(--primary)] ds:outline-offset-[-2px]",
252
+ false: ""
253
+ }
254
+ },
255
+ defaultVariants: { dragging: !1, dropTarget: !1 }
256
+ });
257
+ function Re(r, m) {
258
+ const { t: v } = U("ui"), [u, N] = h(null), [w, n] = h(null), [t, x] = h(""), s = q(!1), d = (i, p) => {
259
+ const l = Math.max(0, Math.min(r.length - 1, p));
260
+ if (!m || l === i) return;
261
+ const T = r.map((f) => f.id), [R] = T.splice(i, 1);
262
+ T.splice(l, 0, R), m(T), s.current = !s.current;
263
+ const o = v("helpMeWriteTemplates.manager.reorderAnnounce", {
264
+ label: r[i].name,
265
+ to: l + 1,
266
+ total: r.length
267
+ });
268
+ x(s.current ? o : `${o}​`);
269
+ };
270
+ return { rowProps: (i) => m ? {
271
+ draggable: !0,
272
+ onDragStart: (p) => {
273
+ N(i), p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(i));
274
+ },
275
+ onDragEnd: () => {
276
+ N(null), n(null);
277
+ },
278
+ onDragOver: (p) => {
279
+ u !== null && (p.preventDefault(), p.dataTransfer.dropEffect = "move", n(i));
280
+ },
281
+ onDragLeave: () => n(null),
282
+ onDrop: (p) => {
283
+ p.preventDefault();
284
+ const l = u;
285
+ N(null), n(null), l !== null && d(l, i);
286
+ }
287
+ } : {}, rowClass: (i) => Ee({
288
+ dragging: u === i,
289
+ dropTarget: w === i && u !== i
290
+ }), handle: (i, p) => /* @__PURE__ */ e(
291
+ L,
292
+ {
293
+ size: "sm",
294
+ intent: "ghost",
295
+ icon: /* @__PURE__ */ e(We, { "aria-hidden": "true" }),
296
+ "aria-label": v("helpMeWriteTemplates.manager.reorderHandle", {
297
+ label: p
298
+ }),
299
+ className: "ds:cursor-grab ds:active:cursor-grabbing",
300
+ onKeyDown: (l) => {
301
+ if (!l.altKey) return;
302
+ const T = l.key === "ArrowUp" ? i - 1 : l.key === "ArrowDown" ? i + 1 : l.key === "Home" ? 0 : l.key === "End" ? r.length - 1 : null;
303
+ T !== null && (l.preventDefault(), d(i, T));
304
+ }
305
+ }
306
+ ), liveRegion: /* @__PURE__ */ e("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: t }) };
307
+ }
308
+ const Y = {
309
+ name: "",
310
+ description: "",
311
+ prompt: "",
312
+ submitted: !1
313
+ };
314
+ function ze({
315
+ open: r,
316
+ onOpenChange: m,
317
+ initialMode: v = "list",
318
+ templates: u,
319
+ onSaveTemplate: N,
320
+ onDeleteTemplate: w,
321
+ onReorderTemplates: n
322
+ }) {
323
+ const { t } = U("ui"), x = Re(u, n), [s, d] = h(null), [k, y] = h(!1), [D, E] = h(!1), [i, p] = h(null), [l, T] = h(!1), [R, o] = h(!1), f = async () => {
324
+ if (!(!i || l)) {
325
+ T(!0), o(!1);
326
+ try {
327
+ await (w == null ? void 0 : w(i.id)), p(null);
328
+ } catch {
329
+ o(!0);
330
+ } finally {
331
+ T(!1);
332
+ }
333
+ }
334
+ };
335
+ j(() => {
336
+ r && (E(!1), d(v === "create" ? { ...Y } : null));
337
+ }, [r]);
338
+ const M = (a, C) => u.some(
339
+ (z) => z.id !== C && z.name.toLowerCase() === a.toLowerCase()
340
+ ), S = (() => {
341
+ if (!(s != null && s.submitted)) return;
342
+ const a = s.name.trim();
343
+ return a ? M(a, s.id) ? t("helpMeWriteTemplates.manager.nameTaken") : void 0 : t("helpMeWriteTemplates.manager.nameRequired");
344
+ })(), A = s != null && s.submitted && !s.prompt.trim() ? t("helpMeWriteTemplates.manager.promptRequired") : void 0, H = async () => {
345
+ if (!s || k) return;
346
+ const a = { ...s, submitted: !0 };
347
+ d(a);
348
+ const C = a.name.trim(), z = a.prompt.trim();
349
+ if (!(!C || !z || M(C, a.id))) {
350
+ y(!0), E(!1);
351
+ try {
352
+ await N({
353
+ id: a.id,
354
+ name: C,
355
+ description: a.description.trim() || void 0,
356
+ prompt: z
357
+ }), d(null);
358
+ } catch {
359
+ E(!0);
360
+ } finally {
361
+ y(!1);
362
+ }
363
+ }
364
+ }, V = s ? s.id ? t("helpMeWriteTemplates.manager.formEdit") : t("helpMeWriteTemplates.manager.formNew") : t("helpMeWriteTemplates.manager.title");
365
+ return /* @__PURE__ */ g(_, { children: [
366
+ /* @__PURE__ */ e(W, { open: r, onOpenChange: m, children: /* @__PURE__ */ e(W.Content, { size: "lg", children: /* @__PURE__ */ g("div", { className: "ds:contents", "data-component": "ai-template-manager", children: [
367
+ /* @__PURE__ */ g(W.Header, { children: [
368
+ /* @__PURE__ */ e(W.Title, { children: V }),
369
+ /* @__PURE__ */ e(W.Description, { children: t("helpMeWriteTemplates.manager.description") })
370
+ ] }),
371
+ /* @__PURE__ */ g(W.Body, { children: [
372
+ s ? /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
373
+ D ? /* @__PURE__ */ e(Z, { variant: "error", children: t("helpMeWriteTemplates.manager.saveError") }) : null,
374
+ /* @__PURE__ */ e(
375
+ X,
376
+ {
377
+ label: t("helpMeWriteTemplates.manager.name"),
378
+ error: S,
379
+ required: !0,
380
+ children: /* @__PURE__ */ e(
381
+ re,
382
+ {
383
+ value: s.name,
384
+ maxLength: 100,
385
+ placeholder: t(
386
+ "helpMeWriteTemplates.manager.namePlaceholder"
387
+ ),
388
+ onChange: (a) => d({ ...s, name: a.target.value })
389
+ }
390
+ )
391
+ }
392
+ ),
393
+ /* @__PURE__ */ e(
394
+ X,
395
+ {
396
+ label: t("helpMeWriteTemplates.manager.descLabel"),
397
+ description: t("helpMeWriteTemplates.manager.descHint"),
398
+ optional: !0,
399
+ children: /* @__PURE__ */ e(
400
+ re,
401
+ {
402
+ value: s.description,
403
+ maxLength: 120,
404
+ onChange: (a) => d({ ...s, description: a.target.value })
405
+ }
406
+ )
407
+ }
408
+ ),
409
+ /* @__PURE__ */ e(
410
+ X,
411
+ {
412
+ label: t("helpMeWriteTemplates.manager.prompt"),
413
+ description: t(
414
+ "helpMeWriteTemplates.manager.promptDescription"
415
+ ),
416
+ error: A,
417
+ required: !0,
418
+ children: /* @__PURE__ */ e(
419
+ se,
420
+ {
421
+ value: s.prompt,
422
+ maxLength: 4e3,
423
+ autoResize: !0,
424
+ minRows: 4,
425
+ maxRows: 10,
426
+ onChange: (a) => d({ ...s, prompt: a.target.value })
427
+ }
428
+ )
429
+ }
430
+ )
431
+ ] }) : u.length === 0 ? /* @__PURE__ */ e(
432
+ pe,
433
+ {
434
+ variant: "first-use",
435
+ size: "sm",
436
+ title: t("helpMeWriteTemplates.manager.emptyTitle"),
437
+ description: t(
438
+ "helpMeWriteTemplates.manager.emptyDescription"
439
+ ),
440
+ primaryAction: {
441
+ label: t("helpMeWriteTemplates.manager.new"),
442
+ onClick: () => d({ ...Y })
443
+ }
444
+ }
445
+ ) : /* @__PURE__ */ e(
446
+ "ul",
447
+ {
448
+ "aria-label": t("helpMeWriteTemplates.manager.listLabel"),
449
+ className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0",
450
+ children: u.map((a, C) => /* @__PURE__ */ g(
451
+ "li",
452
+ {
453
+ ...x.rowProps(C),
454
+ className: `ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)] ds:p-[var(--spacing-sm)] ${x.rowClass(C)}`,
455
+ children: [
456
+ n ? x.handle(C, a.name) : null,
457
+ /* @__PURE__ */ g("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
458
+ /* @__PURE__ */ e("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: /* @__PURE__ */ e("span", { className: "type-title-item ds:text-[color:var(--foreground)]", children: a.name }) }),
459
+ /* @__PURE__ */ e("p", { className: `${J} ds:line-clamp-2`, children: a.description || a.prompt })
460
+ ] }),
461
+ /* @__PURE__ */ e(
462
+ L,
463
+ {
464
+ size: "sm",
465
+ intent: "ghost",
466
+ icon: /* @__PURE__ */ e(ge, {}),
467
+ "aria-label": t("helpMeWriteTemplates.manager.edit", {
468
+ name: a.name
469
+ }),
470
+ onClick: () => d({
471
+ id: a.id,
472
+ name: a.name,
473
+ description: a.description ?? "",
474
+ prompt: a.prompt,
475
+ submitted: !1
476
+ })
477
+ }
478
+ ),
479
+ w ? /* @__PURE__ */ e(
480
+ L,
481
+ {
482
+ size: "sm",
483
+ intent: "ghost",
484
+ icon: /* @__PURE__ */ e(he, {}),
485
+ "aria-label": t("helpMeWriteTemplates.manager.delete", {
486
+ name: a.name
487
+ }),
488
+ onClick: () => p(a)
489
+ }
490
+ ) : null
491
+ ]
492
+ },
493
+ a.id
494
+ ))
495
+ }
496
+ ),
497
+ x.liveRegion
498
+ ] }),
499
+ /* @__PURE__ */ e(W.Footer, { children: s ? /* @__PURE__ */ g(_, { children: [
500
+ /* @__PURE__ */ e(I, { intent: "secondary", onClick: () => d(null), children: t("helpMeWriteTemplates.manager.cancel") }),
501
+ /* @__PURE__ */ e(
502
+ I,
503
+ {
504
+ intent: "primary",
505
+ loading: k,
506
+ onClick: () => void H(),
507
+ children: t("helpMeWriteTemplates.manager.save")
508
+ }
509
+ )
510
+ ] }) : /* @__PURE__ */ g(_, { children: [
511
+ u.length > 0 ? /* @__PURE__ */ e(
512
+ I,
513
+ {
514
+ intent: "outline",
515
+ startIcon: /* @__PURE__ */ e(be, {}),
516
+ onClick: () => d({ ...Y }),
517
+ children: t("helpMeWriteTemplates.manager.new")
518
+ }
519
+ ) : null,
520
+ /* @__PURE__ */ e(W.Close, { asChild: !0, children: /* @__PURE__ */ e(I, { intent: "primary", children: t("helpMeWriteTemplates.manager.done") }) })
521
+ ] }) })
522
+ ] }) }) }),
523
+ /* @__PURE__ */ e(
524
+ W,
525
+ {
526
+ open: i != null,
527
+ onOpenChange: (a) => {
528
+ !a && !l && (p(null), o(!1));
529
+ },
530
+ children: /* @__PURE__ */ g(W.Content, { size: "sm", variant: "alert", children: [
531
+ /* @__PURE__ */ g(W.Header, { children: [
532
+ /* @__PURE__ */ e(W.Title, { children: t("helpMeWriteTemplates.manager.deleteTitle", {
533
+ name: (i == null ? void 0 : i.name) ?? ""
534
+ }) }),
535
+ /* @__PURE__ */ e(W.Description, { children: t("helpMeWriteTemplates.manager.deleteDescription") })
536
+ ] }),
537
+ R ? /* @__PURE__ */ e(W.Body, { children: /* @__PURE__ */ e(Z, { variant: "error", children: t("helpMeWriteTemplates.manager.deleteError") }) }) : null,
538
+ /* @__PURE__ */ g(W.Footer, { children: [
539
+ /* @__PURE__ */ e(W.Close, { asChild: !0, children: /* @__PURE__ */ e(I, { intent: "secondary", disabled: l, children: t("helpMeWriteTemplates.manager.cancel") }) }),
540
+ /* @__PURE__ */ e(
541
+ I,
542
+ {
543
+ intent: "destructive",
544
+ loading: l,
545
+ onClick: () => void f(),
546
+ children: t("helpMeWriteTemplates.manager.deleteConfirm")
547
+ }
548
+ )
549
+ ] })
550
+ ] })
551
+ }
552
+ )
553
+ ] });
554
+ }
555
+ function Ie({
556
+ applied: r,
557
+ onUndo: m,
558
+ onDismiss: v
559
+ }) {
560
+ const { t: u } = U("ui"), N = q(null);
561
+ if (j(() => {
562
+ var n;
563
+ r && ((n = N.current) == null || n.focus());
564
+ }, [r]), !(r != null && r.template)) return null;
565
+ const w = r.template.name;
566
+ return /* @__PURE__ */ e(
567
+ Z,
568
+ {
569
+ variant: "success",
570
+ dismissible: !0,
571
+ onOpenChange: (n) => {
572
+ n || v();
573
+ },
574
+ "data-component": "help-me-write-undo-notice",
575
+ children: /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
576
+ /* @__PURE__ */ e("span", { children: r.mode === "below" ? u("helpMeWriteTemplates.undo.addedBelow", { name: w }) : u("helpMeWriteTemplates.undo.replaced", { name: w }) }),
577
+ /* @__PURE__ */ e(I, { ref: N, intent: "outline", size: "sm", onClick: m, children: u("helpMeWriteTemplates.undo.undo") })
578
+ ] })
579
+ }
580
+ );
581
+ }
582
+ function nr({
583
+ templates: r,
584
+ onGenerate: m,
585
+ onSaveTemplate: v,
586
+ onDeleteTemplate: u,
587
+ onReorderTemplates: N,
588
+ credits: w,
589
+ enableDictation: n,
590
+ onApplied: t,
591
+ creditsNotice: x
592
+ }) {
593
+ const [s, d] = h({ open: !1, mode: "list" }), [k, y] = h(null), D = P(
594
+ (o = "list") => d({ open: !0, mode: o }),
595
+ []
596
+ ), E = P(
597
+ (o) => /* @__PURE__ */ e(
598
+ De,
599
+ {
600
+ context: o,
601
+ onGenerate: m,
602
+ credits: w,
603
+ enableDictation: n,
604
+ suspendClose: s.open,
605
+ onApplied: t
606
+ }
607
+ ),
608
+ [m, w, n, s.open, t]
609
+ ), i = K(() => {
610
+ const o = new Map(r.map((f) => [f.id, f]));
611
+ return {
612
+ templates: r,
613
+ onRun: ({ template: f, text: M, scope: S, signal: A }) => {
614
+ const H = o.get(f.id);
615
+ return H ? m({
616
+ template: H,
617
+ prompt: "",
618
+ sourceText: M,
619
+ scope: S,
620
+ signal: A
621
+ }) : Promise.reject(new Error("Unknown template"));
622
+ },
623
+ onManage: v ? D : void 0
624
+ };
625
+ }, [r, m, v, D]), p = P(
626
+ (o) => {
627
+ if (o.action !== "template" || !o.template) return;
628
+ const f = r.find((S) => {
629
+ var A;
630
+ return S.id === ((A = o.template) == null ? void 0 : A.id);
631
+ }), M = {
632
+ mode: "replace",
633
+ template: f,
634
+ previousHtml: o.previousHtml,
635
+ undo: o.undo
636
+ };
637
+ y(f ? M : null), t == null || t(M);
638
+ },
639
+ [r, t]
640
+ ), l = K(
641
+ () => v ? /* @__PURE__ */ e(
642
+ ze,
643
+ {
644
+ open: s.open,
645
+ initialMode: s.mode,
646
+ onOpenChange: (o) => d((f) => ({ ...f, open: o })),
647
+ templates: r,
648
+ onSaveTemplate: v,
649
+ onDeleteTemplate: u,
650
+ onReorderTemplates: N
651
+ }
652
+ ) : null,
653
+ [s, r, v, u, N]
654
+ ), T = /* @__PURE__ */ e(
655
+ Ie,
656
+ {
657
+ applied: k,
658
+ onUndo: () => {
659
+ k == null || k.undo(), y(null);
660
+ },
661
+ onDismiss: () => y(null)
662
+ }
663
+ ), R = K(
664
+ () => ({
665
+ renderHelpMeWrite: E,
666
+ aiTemplates: i,
667
+ onAiApplied: p,
668
+ aiCreditsNotice: x
669
+ }),
670
+ [E, i, p, x]
671
+ );
672
+ return {
673
+ ...R,
674
+ editorProps: R,
675
+ manager: l,
676
+ undoNotice: T,
677
+ openManager: D
678
+ };
679
+ }
680
+ export {
681
+ ae as A,
682
+ De as H,
683
+ ze as a,
684
+ Ie as b,
685
+ nr as u
686
+ };
687
+ //# sourceMappingURL=help-me-write-templates-5WkUfvc_.js.map