@alfadocs/ui-kit 1.143.0 → 1.145.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 (338) hide show
  1. package/dist/_chunks/{actions-cell-renderer-CPNyF6ye.js → actions-cell-renderer-BA1FB6cT.js} +3 -3
  2. package/dist/_chunks/{address-autocomplete-yDLqg43e.js → address-autocomplete-_LeOFdM7.js} +2 -2
  3. package/dist/_chunks/{address-fields-Bh9JZJHZ.js → address-fields-C4khof4C.js} +2 -2
  4. package/dist/_chunks/{agenda-tray-CGcS_qoM.js → agenda-tray-NgxPuAAz.js} +3 -3
  5. package/dist/_chunks/{ai-credits-exhausted-notice-Lws3113e.js → ai-credits-exhausted-notice-DCq27xy2.js} +2 -2
  6. package/dist/_chunks/{ai-credits-notice-D_Zm_N2A.js → ai-credits-notice-B6buIgmV.js} +3 -3
  7. package/dist/_chunks/{ai-permission-notice-CEDEWE2-.js → ai-permission-notice-C_YB3MBA.js} +2 -2
  8. package/dist/_chunks/{ai-prompt-input-y4-dtQIT.js → ai-prompt-input-Bwoa8gNc.js} +2 -2
  9. package/dist/_chunks/{ai-summary-panel-CJVOjr2I.js → ai-summary-panel-Cdsve-XN.js} +7 -7
  10. package/dist/_chunks/{alia-sidebar-AKz42_XE.js → alia-sidebar-Bjuxk8mU.js} +7 -7
  11. package/dist/_chunks/{anamnesis-card-W8ZaDytS.js → anamnesis-card-G0qzw0Oi.js} +2 -2
  12. package/dist/_chunks/{anamnesis-summary-rows-wUl7oXBO.js → anamnesis-summary-rows-QCv6zW-J.js} +7 -7
  13. package/dist/_chunks/{appointment-details-panel.history-B8R8XfGe.js → appointment-details-panel.history-eqPMKmW0.js} +3 -3
  14. package/dist/_chunks/{appointment-details-panel.identity-C20Y9xNC.js → appointment-details-panel.identity--_j07UG1.js} +2 -2
  15. package/dist/_chunks/{appointment-peek-BCzekfWh.js → appointment-peek-B3raO90X.js} +3 -3
  16. package/dist/_chunks/{appointment-timeline-CMc_3C74.js → appointment-timeline-D5qbZ7in.js} +5 -5
  17. package/dist/_chunks/{appointment-tray-D8k5YKLU.js → appointment-tray-CFCxukwq.js} +3 -3
  18. package/dist/_chunks/{audio-recorder-DxhCiLqG.js → audio-recorder-DcUIVMWj.js} +3 -3
  19. package/dist/_chunks/{balance-badge-cell-10BdaOQ8.js → balance-badge-cell-BPz9bQAB.js} +4 -4
  20. package/dist/_chunks/{bill-line-table-qAdmV19W.js → bill-line-table-DnkFqMnM.js} +2 -2
  21. package/dist/_chunks/{bishop-score-DbvfBlBM.js → bishop-score-fJRN0MtR.js} +2 -2
  22. package/dist/_chunks/{bmi-calculator-rq3ZsKp0.js → bmi-calculator-FmXBHbot.js} +2 -2
  23. package/dist/_chunks/{button-DohK_Ak_.js → button-Dp4j9ygh.js} +6 -6
  24. package/dist/_chunks/{button-group-DoKG16Fy.js → button-group-N60L3HMa.js} +2 -2
  25. package/dist/_chunks/{calendar-CyLtLBNP.js → calendar-DDTWUYnw.js} +2 -2
  26. package/dist/_chunks/{calendar-appointment-editor-dialog-9kVppi9f.js → calendar-appointment-editor-dialog-sY-k0GGW.js} +21 -21
  27. package/dist/_chunks/{calendar-editor-discard-host-BblBxMqT.js → calendar-editor-discard-host-DWS_kM-a.js} +6 -6
  28. package/dist/_chunks/{calendar-waiting-list-panel-CSFJw5np.js → calendar-waiting-list-panel-Bm7NAZdk.js} +9 -9
  29. package/dist/_chunks/{calendar-workspace.model-B8yPwuBv.js → calendar-workspace.model-4zmA3BFE.js} +2 -2
  30. package/dist/_chunks/{calendar.sheets-DZh3p8HE.js → calendar.sheets-CCvdZF-R.js} +15 -15
  31. package/dist/_chunks/{calls-panel-CnjAKFgA.js → calls-panel-BTTfHnPD.js} +5 -5
  32. package/dist/_chunks/{care-plan-card-CkRqA58O.js → care-plan-card-2U2LuIJD.js} +2 -2
  33. package/dist/_chunks/{care-plan-entry-card-DurPuYAP.js → care-plan-entry-card-CUAlQv1c.js} +2 -2
  34. package/dist/_chunks/{care-plan-header-C4i93i8H.js → care-plan-header-Dm9KZ41y.js} +2 -2
  35. package/dist/_chunks/{carousel.agent-CkDXR3-8.js → carousel.agent-CN78qTiR.js} +2 -2
  36. package/dist/_chunks/{chart-ChNsJf9_.js → chart-EUdS8caO.js} +3 -3
  37. package/dist/_chunks/{chat-input-BmvnuZqj.js → chat-input-kduOKc5Q.js} +2 -2
  38. package/dist/_chunks/{chat-message-IG9uRq6y.js → chat-message-Db7cWCgO.js} +3 -3
  39. package/dist/_chunks/{check-in-documents-CEVcgcYZ.js → check-in-documents-v1jFfDE1.js} +2 -2
  40. package/dist/_chunks/{code-block-BTsCXVGI.js → code-block-BpmhaXp_.js} +2 -2
  41. package/dist/_chunks/{communications-panel-MgAuWYBy.js → communications-panel-DDzUyoHi.js} +6 -6
  42. package/dist/_chunks/{connection-status-DWClakYw.js → connection-status-Bi6KPTlh.js} +3 -3
  43. package/dist/_chunks/{contact-profile-card-CsZNMlws.js → contact-profile-card-BxnBI1z1.js} +3 -3
  44. package/dist/_chunks/{control-room-rail-DBmNpbDE.js → control-room-rail-BQvaYowi.js} +3 -3
  45. package/dist/_chunks/{copy-field-BaYEDJ9f.js → copy-field-Bp0rH_YO.js} +2 -2
  46. package/dist/_chunks/{cycle-calculator-BUCGfEcy.js → cycle-calculator-Dd-dNPyR.js} +2 -2
  47. package/dist/_chunks/{dashboard-grid-D2egA1Zu.js → dashboard-grid-C_cby1Cf.js} +2 -2
  48. package/dist/_chunks/{data-grid-tyE2kGfx.js → data-grid-CujX-2tF.js} +6 -6
  49. package/dist/_chunks/{data-grid-tabs-Mbj6bSK2.js → data-grid-tabs-3NIWrciW.js} +2 -2
  50. package/dist/_chunks/{data-table-Huk4CNHs.js → data-table-DFAYYsSc.js} +6 -6
  51. package/dist/_chunks/{data-table-tabs-D5ujdK56.js → data-table-tabs-BKdmGcyD.js} +2 -2
  52. package/dist/_chunks/{date-range-panel-BOgfP_V3.js → date-range-panel-B86RANxB.js} +2 -2
  53. package/dist/_chunks/{default-tabs-ChkVzOL8.js → default-tabs-CqP1uWdx.js} +9 -9
  54. package/dist/_chunks/{description-list-BxzDN9o2.js → description-list-DA4TgL_I.js} +2 -2
  55. package/dist/_chunks/{dev-bypass-button-B7ePcJcg.js → dev-bypass-button-BzfYGPuf.js} +2 -2
  56. package/dist/_chunks/{document-preview-x_S8V7VC.js → document-preview-oSuJsJ3k.js} +4 -4
  57. package/dist/_chunks/{document-scanner-CETscDea.js → document-scanner-C_9P-ysi.js} +2 -2
  58. package/dist/_chunks/{due-date-calculator-DpN0Z9p4.js → due-date-calculator-CcYdmiCI.js} +2 -2
  59. package/dist/_chunks/{editable-currency-cell-renderer-C6z6ABN_.js → editable-currency-cell-renderer-DXJI0fnU.js} +3 -3
  60. package/dist/_chunks/{editable-description-KU56SP4P.js → editable-description-BQauSuCG.js} +3 -3
  61. package/dist/_chunks/{editor-overlay-Dc8uVxEp.js → editor-overlay-jc9HUeQ2.js} +30 -27
  62. package/dist/_chunks/{empty-state-DwJ5YNzz.js → empty-state-5REM7oDM.js} +2 -2
  63. package/dist/_chunks/{entity-summary-DgZSdp6d.js → entity-summary-CZmGcWi2.js} +3 -3
  64. package/dist/_chunks/{error-boundary-tAn_GuCu.js → error-boundary-BQ5mRqEd.js} +2 -2
  65. package/dist/_chunks/{error-page-WLhmWUTq.js → error-page-CdNGIezW.js} +2 -2
  66. package/dist/_chunks/{face-scheme-S88jbOzl.js → face-scheme-ByYeboH9.js} +5 -5
  67. package/dist/_chunks/{fetal-weight-DWj-_ME8.js → fetal-weight-BZql9VkN.js} +2 -2
  68. package/dist/_chunks/{field-array-CA-gn526.js → field-array-kwUgFOIr.js} +3 -3
  69. package/dist/_chunks/{file-manager-kdPsJq_k.js → file-manager-Cp3Z4VvM.js} +7 -7
  70. package/dist/_chunks/{finished-terminal-unDnXT4j.js → finished-terminal-YrhOLYbx.js} +2 -2
  71. package/dist/_chunks/{fiscal-code-input-DZlpaMGg.js → fiscal-code-input-BsQS8gaD.js} +2 -2
  72. package/dist/_chunks/{forgot-password-form-B4ufmBFn.js → forgot-password-form-BUC_hDCJ.js} +2 -2
  73. package/dist/_chunks/{freemium-paywall-BDeq9QWR.js → freemium-paywall-DafloSRi.js} +2 -2
  74. package/dist/_chunks/{gestational-age-calculator-CCDIhSMV.js → gestational-age-calculator-DrVw8arH.js} +2 -2
  75. package/dist/_chunks/{hcg-doubling-BekuksBv.js → hcg-doubling-XWQ6IhEg.js} +2 -2
  76. package/dist/_chunks/{header-l_B8MV0g.js → header-lzhNZEij.js} +2 -2
  77. package/dist/_chunks/{header-settings-CvZ7Qii6.js → header-settings-BIiYXX9_.js} +4 -4
  78. package/dist/_chunks/{heatmap-Cb4JSpv_.js → heatmap-DvsZ-mcL.js} +6 -6
  79. package/dist/_chunks/{help-me-write-templates-C84_4iwX.js → help-me-write-templates-DlA54nu5.js} +6 -6
  80. package/dist/_chunks/{hover-card-CIiPOlyM.js → hover-card-CS8ulBf9.js} +2 -2
  81. package/dist/_chunks/{icon-button-group-CLhC7wjU.js → icon-button-group-DEAx9M5v.js} +2 -2
  82. package/dist/_chunks/{icon-button-S8_weU3g.js → icon-button-u9VMQn3x.js} +2 -2
  83. package/dist/_chunks/{icon-picker-Ct6n8GTa.js → icon-picker-CF4nDCzC.js} +3 -3
  84. package/dist/_chunks/{image-cropper-Ch80rFdt.js → image-cropper-CfaSPVt3.js} +2 -2
  85. package/dist/_chunks/{info-tip-CkH2En-i.js → info-tip-cCppV1fD.js} +2 -2
  86. package/dist/_chunks/{insert-result-CDMMt7q8.js → insert-result-UUow9IIY.js} +2 -2
  87. package/dist/_chunks/{invoice-upload-list-CZ1B9yWh.js → invoice-upload-list-srvWy5_d.js} +5 -5
  88. package/dist/_chunks/{key-value-pair-DOTl68_U.js → key-value-pair-BykhMTcP.js} +2 -2
  89. package/dist/_chunks/{kit-extensions-C_oZ7WOq.js → kit-extensions-CSPGIdcn.js} +7 -7
  90. package/dist/_chunks/{link-cell-renderer-Bt_sl4iP.js → link-cell-renderer-CWLArl5e.js} +3 -3
  91. package/dist/_chunks/{locale-picker-OrojXX6E.js → locale-picker-BEJjNGCO.js} +3 -3
  92. package/dist/_chunks/{login-dev-card-oRh9h7N2.js → login-dev-card-DqUNJcd7.js} +2 -2
  93. package/dist/_chunks/{map-view-Cm69dCnY.js → map-view-n6GiDRWM.js} +3 -3
  94. package/dist/_chunks/{marketplace-app-shell-DnL187-U.js → marketplace-app-shell-CGA-R-zt.js} +4 -4
  95. package/dist/_chunks/{medication-line-BohqbCYD.js → medication-line-DFa5oFhf.js} +2 -2
  96. package/dist/_chunks/{medication-search-DoEDakoM.js → medication-search-CTUtXuPT.js} +2 -2
  97. package/dist/_chunks/{message-card-DvBjcZgH.js → message-card-DQML_W8I.js} +3 -3
  98. package/dist/_chunks/{message-tray-BHaE254g.js → message-tray-Dx2HPcKB.js} +4 -4
  99. package/dist/_chunks/{muscle-scheme-vNd8wU7V.js → muscle-scheme-BMFuuKGh.js} +2 -2
  100. package/dist/_chunks/{notes-panel-DCKbuZqS.js → notes-panel-C9aB1Cma.js} +4 -4
  101. package/dist/_chunks/{notification-card-CDuzAytQ.js → notification-card-BPGZhE5t.js} +3 -3
  102. package/dist/_chunks/{notification-tray-CnPV8jDA.js → notification-tray-BnC5OItw.js} +4 -4
  103. package/dist/_chunks/{optical-prescription-CWwrW4YQ.js → optical-prescription-DZvauMiM.js} +2 -2
  104. package/dist/_chunks/{panel-subview-DCyvn-49.js → panel-subview-DjBwNV16.js} +2 -2
  105. package/dist/_chunks/{parts-IFiXO68Y.js → parts-DyCxaRF0.js} +4 -4
  106. package/dist/_chunks/{patient-account-settings-BQ9bMsJS.js → patient-account-settings-Do0QbDJe.js} +5 -5
  107. package/dist/_chunks/{patient-card-Cpr8iD19.js → patient-card-D1DrK4BT.js} +2 -2
  108. package/dist/_chunks/{patient-check-in-resume-v5lYhMsh.js → patient-check-in-resume-Bxy1_Pfo.js} +8 -8
  109. package/dist/_chunks/{patient-details-6uJZ27ZL.js → patient-details-Cj3dp9GB.js} +3 -3
  110. package/dist/_chunks/{patient-field-row-D8Cu_MQp.js → patient-field-row-DDjsUsc_.js} +6 -6
  111. package/dist/_chunks/{patient-picker-CQNsqYn2.js → patient-picker-Dm74jHIk.js} +2 -2
  112. package/dist/_chunks/{patient-search-C6-INPjs.js → patient-search-5nLD0jpg.js} +3 -3
  113. package/dist/_chunks/{patient-sign-in-pin-DmMBwWet.js → patient-sign-in-pin-da7C8DOd.js} +3 -3
  114. package/dist/_chunks/{patient-sign-in-steps-BKcxNkdY.js → patient-sign-in-steps-kS2ktytw.js} +5 -5
  115. package/dist/_chunks/{patient-summary-card-NYjO0IfN.js → patient-summary-card-roM9Esfb.js} +5 -5
  116. package/dist/_chunks/{payment-automation-upsell-CGdG2Mwk.js → payment-automation-upsell-N1A_IIw0.js} +2 -2
  117. package/dist/_chunks/{payment-request-card-CNW00DCx.js → payment-request-card-C9VglWsV.js} +3 -3
  118. package/dist/_chunks/{periodontal-chart-DqHrQY4e.js → periodontal-chart-C5JFeQS7.js} +2 -2
  119. package/dist/_chunks/{periodontal-chart-card-q9WSHRC2.js → periodontal-chart-card-DiZYn_60.js} +2 -2
  120. package/dist/_chunks/{popover-CkvP3rHZ.js → popover-C9O7my6h.js} +2 -2
  121. package/dist/_chunks/{portal-details-CwX3VNxh.js → portal-details-CKF4yFHs.js} +5 -5
  122. package/dist/_chunks/{portal-documents-BWdXhWpZ.js → portal-documents-DvpAwmSI.js} +5 -5
  123. package/dist/_chunks/{portal-parts-DbCMuZVl.js → portal-parts-Cvu4PfIY.js} +4 -4
  124. package/dist/_chunks/{practice-results-BUEsl2Pj.js → practice-results-D0TAgL8v.js} +6 -6
  125. package/dist/_chunks/{pregnancy-dating-wc9iCN0f.js → pregnancy-dating-BEVI6zvu.js} +2 -2
  126. package/dist/_chunks/{pregnancy-weight-gain-DmrVHk9y.js → pregnancy-weight-gain-CDkFYcWW.js} +2 -2
  127. package/dist/_chunks/{prescription-history-DPjqflwJ.js → prescription-history-CD3e3U3I.js} +14 -14
  128. package/dist/_chunks/{privacy-lock-CcrjIbBv.js → privacy-lock-C25IybCx.js} +3 -3
  129. package/dist/_chunks/{privacy-mask-C2ZLKrMh.js → privacy-mask-zVh0ntm0.js} +2 -2
  130. package/dist/_chunks/{product-hub-panel-DiWjSIR2.js → product-hub-panel-NVpRuJeW.js} +3 -3
  131. package/dist/_chunks/{public-header.agent-Dsl9zhA2.js → public-header.agent-Dzo6ujrE.js} +3 -3
  132. package/dist/_chunks/{radiograph-panel.agent-CSpr2paU.js → radiograph-panel.agent-BUZPsuSP.js} +4 -4
  133. package/dist/_chunks/{registration-form-BEsIjznv.js → registration-form-AtRCt8n5.js} +3 -3
  134. package/dist/_chunks/{reserved.agent-C_pr0bHy.js → reserved.agent-DjvapRF1.js} +6 -6
  135. package/dist/_chunks/{reset-password-form-DwtSNhnA.js → reset-password-form-AMUxqdAS.js} +2 -2
  136. package/dist/_chunks/{reviews-panel-CdHUSndF.js → reviews-panel-Cw5ygAxs.js} +4 -4
  137. package/dist/_chunks/rich-text-editor-CJXc5GgH.js +4351 -0
  138. package/dist/_chunks/{row-actions-C6d6vy5z.js → row-actions-CA938TAd.js} +3 -3
  139. package/dist/_chunks/{saved-view-tabs-CVUM3Nqz.js → saved-view-tabs-COU4bT59.js} +3 -3
  140. package/dist/_chunks/{send-registration-link-form-D-NkS__p.js → send-registration-link-form-D1lPdOPC.js} +2 -2
  141. package/dist/_chunks/{session-countdown-StcyUU5O.js → session-countdown-CGsIG01-.js} +2 -2
  142. package/dist/_chunks/{sheet-BIAhwdyS.js → sheet-CZDjW9Q-.js} +2 -2
  143. package/dist/_chunks/{sign-in-with-alfadocs-button-DzrNgbWv.js → sign-in-with-alfadocs-button-D7JQVzZK.js} +2 -2
  144. package/dist/_chunks/{signature-request-BfKo3vOz.js → signature-request-CfHfAEQt.js} +3 -3
  145. package/dist/_chunks/{signed-out-frame-Oa2e1yps.js → signed-out-frame-CC25CgKo.js} +3 -3
  146. package/dist/_chunks/{signing-end-screen-Pmda6tCH.js → signing-end-screen-Bq6tkFE6.js} +5 -5
  147. package/dist/_chunks/{slot-grid-CfA5zeMv.js → slot-grid-khIpy8Gx.js} +4 -4
  148. package/dist/_chunks/{sms-code-entry-Dgp4GwlM.js → sms-code-entry-C70L3m6-.js} +2 -2
  149. package/dist/_chunks/{specialty-list-BzalHR8_.js → specialty-list-1tltjGRG.js} +2 -2
  150. package/dist/_chunks/{step-up-dialog-C1O8ctoh.js → step-up-dialog-NkVLEV9z.js} +3 -3
  151. package/dist/_chunks/{streaming-text-Nb3Q7L94.js → streaming-text-BXoHgx0l.js} +2 -2
  152. package/dist/_chunks/{sync-tray-BgrO4QjH.js → sync-tray-BQD-HuA4.js} +3 -3
  153. package/dist/_chunks/{task-editor-DNkrLbgK.js → task-editor-B9YpfwcW.js} +7 -7
  154. package/dist/_chunks/{task-tray-Bmi9wCHq.js → task-tray-CxxcGGgx.js} +3 -3
  155. package/dist/_chunks/{tasks-panel-CDFHAHrN.js → tasks-panel-DsjfS_k5.js} +5 -5
  156. package/dist/_chunks/{theme-toggle-C2LPw3xr.js → theme-toggle-DAqT_Yxy.js} +3 -3
  157. package/dist/_chunks/{toast-DQ1Zu1kk.js → toast-Cgmh1cvj.js} +2 -2
  158. package/dist/_chunks/{token-insert-menu-sGtftx4Y.js → token-insert-menu-BxqGMrZN.js} +2 -2
  159. package/dist/_chunks/{tool-rail-mWmYNRCV.js → tool-rail-DjPEiBa2.js} +2 -2
  160. package/dist/_chunks/{toolbar-JTR20W-U.js → toolbar-z_6tE7zG.js} +3 -3
  161. package/dist/_chunks/{tooth-scheme-DpgciFU8.js → tooth-scheme-C7xJEzaK.js} +2 -2
  162. package/dist/_chunks/{types-BrJRsnSG.js → types-DjQeiZXC.js} +2 -2
  163. package/dist/_chunks/{unit-converter-D1e1wZRE.js → unit-converter-CdrdnDlr.js} +2 -2
  164. package/dist/_chunks/{use-appointment-details-read-xj0PyEhI.js → use-appointment-details-read-Dod21IxM.js} +109 -101
  165. package/dist/_chunks/{verify-identity-types-CpeJIc9F.js → verify-identity-types-D0-sw1Qk.js} +2 -2
  166. package/dist/_chunks/{voice-control-panel-DqvvZN2A.js → voice-control-panel-DeWo646r.js} +6 -6
  167. package/dist/_chunks/{warning-stack-Dx7cpj10.js → warning-stack-BvfxZNfR.js} +3 -3
  168. package/dist/_chunks/{week-availability-CsTiwtYj.js → week-availability-D0tTll4q.js} +2 -2
  169. package/dist/_chunks/{weekly-hours-editor-BsVsgeOc.js → weekly-hours-editor-pTLyK8tt.js} +2 -2
  170. package/dist/_chunks/{workflow-map-CwfLHuiD.js → workflow-map-F7OThorL.js} +5 -5
  171. package/dist/_chunks/{workflow-webhook-action-BUWc2txJ.js → workflow-webhook-action-FImC6mwH.js} +6 -6
  172. package/dist/agent-catalog.json +1 -1
  173. package/dist/appointment-editor-panel/index.js +4 -4
  174. package/dist/aws-transcribe/index.js +176 -152
  175. package/dist/booking-tools-data/index.js +1 -1
  176. package/dist/browser-support.js +1 -1
  177. package/dist/calendar-action-buttons/index.js +4 -4
  178. package/dist/components/address-autocomplete/index.js +1 -1
  179. package/dist/components/address-fields/index.js +1 -1
  180. package/dist/components/agenda-tray/index.js +1 -1
  181. package/dist/components/ai-credits-notice/index.js +2 -2
  182. package/dist/components/ai-permission-notice/index.js +1 -1
  183. package/dist/components/ai-prompt-input/index.js +1 -1
  184. package/dist/components/ai-summary-panel/index.js +1 -1
  185. package/dist/components/anamnesis-card/index.js +1 -1
  186. package/dist/components/appointment-card/index.js +1 -1
  187. package/dist/components/appointment-details-panel/index.js +2 -2
  188. package/dist/components/appointment-peek/index.js +1 -1
  189. package/dist/components/appointment-timeline/index.js +1 -1
  190. package/dist/components/audio-recorder/index.js +1 -1
  191. package/dist/components/bill-line-table/index.js +1 -1
  192. package/dist/components/bill-table/index.js +1 -1
  193. package/dist/components/bishop-score/index.js +1 -1
  194. package/dist/components/bmi-calculator/index.js +1 -1
  195. package/dist/components/booking/index.js +1 -1
  196. package/dist/components/button/index.js +2 -2
  197. package/dist/components/button-group/index.js +1 -1
  198. package/dist/components/calendar/index.js +1 -1
  199. package/dist/components/calls-panel/index.js +1 -1
  200. package/dist/components/care-plan-card/index.js +1 -1
  201. package/dist/components/care-plan-entry-card/index.js +1 -1
  202. package/dist/components/care-plan-header/index.js +1 -1
  203. package/dist/components/carousel/index.js +1 -1
  204. package/dist/components/chart/index.js +1 -1
  205. package/dist/components/chat-input/index.js +1 -1
  206. package/dist/components/chat-message/index.js +1 -1
  207. package/dist/components/communications-panel/index.js +1 -1
  208. package/dist/components/connection-status/index.js +1 -1
  209. package/dist/components/contact-profile-card/index.js +1 -1
  210. package/dist/components/control-room-rail/index.js +1 -1
  211. package/dist/components/copy-field/index.js +1 -1
  212. package/dist/components/cycle-calculator/index.js +1 -1
  213. package/dist/components/dashboard-grid/index.js +1 -1
  214. package/dist/components/data-grid/index.js +2 -2
  215. package/dist/components/data-grid-tabs/index.js +1 -1
  216. package/dist/components/data-table/index.js +4 -4
  217. package/dist/components/data-table-tabs/index.js +1 -1
  218. package/dist/components/description-list/index.js +1 -1
  219. package/dist/components/dev-bypass-button/index.js +1 -1
  220. package/dist/components/document-preview/index.js +1 -1
  221. package/dist/components/document-scanner/index.js +1 -1
  222. package/dist/components/due-date-calculator/index.js +1 -1
  223. package/dist/components/editable-description/index.js +1 -1
  224. package/dist/components/editor-overlay/index.js +1 -1
  225. package/dist/components/empty-state/index.js +1 -1
  226. package/dist/components/entity-summary/index.js +1 -1
  227. package/dist/components/error-boundary/index.js +1 -1
  228. package/dist/components/face-scheme/index.js +1 -1
  229. package/dist/components/fetal-weight/index.js +1 -1
  230. package/dist/components/field-array/index.js +1 -1
  231. package/dist/components/file-manager/index.js +1 -1
  232. package/dist/components/finished-terminal/index.js +1 -1
  233. package/dist/components/fiscal-code-input/index.js +1 -1
  234. package/dist/components/freemium-paywall/index.js +1 -1
  235. package/dist/components/gestational-age-calculator/index.js +1 -1
  236. package/dist/components/hcg-doubling/index.js +1 -1
  237. package/dist/components/header/index.js +1 -1
  238. package/dist/components/header-settings/index.js +1 -1
  239. package/dist/components/heatmap/index.js +1 -1
  240. package/dist/components/hover-card/index.js +1 -1
  241. package/dist/components/icon-button/index.js +1 -1
  242. package/dist/components/icon-button-group/index.js +1 -1
  243. package/dist/components/icon-picker/index.js +1 -1
  244. package/dist/components/image-cropper/index.js +1 -1
  245. package/dist/components/info-tip/index.js +1 -1
  246. package/dist/components/invoice-upload/index.js +1 -1
  247. package/dist/components/invoice-upload-list/index.js +1 -1
  248. package/dist/components/key-value-pair/index.js +1 -1
  249. package/dist/components/locale-picker/index.js +1 -1
  250. package/dist/components/map-view/index.js +1 -1
  251. package/dist/components/medication-line/index.js +1 -1
  252. package/dist/components/medication-search/index.js +1 -1
  253. package/dist/components/message-card/index.js +1 -1
  254. package/dist/components/message-tray/index.js +1 -1
  255. package/dist/components/muscle-scheme/index.js +1 -1
  256. package/dist/components/notes-panel/index.js +1 -1
  257. package/dist/components/notification-card/index.js +1 -1
  258. package/dist/components/notification-tray/index.js +1 -1
  259. package/dist/components/optical-prescription/index.js +1 -1
  260. package/dist/components/panel-subview/index.js +1 -1
  261. package/dist/components/patient-details/index.js +1 -1
  262. package/dist/components/patient-search/index.js +1 -1
  263. package/dist/components/patient-summary-card/index.js +1 -1
  264. package/dist/components/patient-table/index.js +1 -1
  265. package/dist/components/payment-card/index.js +1 -1
  266. package/dist/components/periodontal-chart/index.js +1 -1
  267. package/dist/components/periodontal-chart-card/index.js +1 -1
  268. package/dist/components/popover/index.js +1 -1
  269. package/dist/components/practice-results/index.js +1 -1
  270. package/dist/components/pregnancy-dating/index.js +1 -1
  271. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  272. package/dist/components/privacy-lock/index.js +1 -1
  273. package/dist/components/product-hub-tray/index.js +1 -1
  274. package/dist/components/public-header/index.js +1 -1
  275. package/dist/components/radiograph-panel/index.js +1 -1
  276. package/dist/components/reviews-panel/index.js +1 -1
  277. package/dist/components/rich-text-editor/editor-toolbar.d.ts +2 -0
  278. package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +2 -0
  279. package/dist/components/rich-text-editor/index.js +2 -2
  280. package/dist/components/rich-text-editor/rich-text-editor.d.ts +7 -0
  281. package/dist/components/row-actions/index.js +1 -1
  282. package/dist/components/session-countdown/index.js +1 -1
  283. package/dist/components/sheet/index.js +1 -1
  284. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  285. package/dist/components/slot-grid/index.js +1 -1
  286. package/dist/components/sms-code-entry/index.js +1 -1
  287. package/dist/components/specialty-list/index.js +1 -1
  288. package/dist/components/step-up-dialog/index.js +1 -1
  289. package/dist/components/streaming-text/index.js +1 -1
  290. package/dist/components/sync-tray/index.js +1 -1
  291. package/dist/components/task-editor/index.js +1 -1
  292. package/dist/components/task-tray/index.js +1 -1
  293. package/dist/components/tasks-panel/index.js +1 -1
  294. package/dist/components/theme-toggle/index.js +1 -1
  295. package/dist/components/toast/index.js +1 -1
  296. package/dist/components/token-insert-menu/index.js +1 -1
  297. package/dist/components/tool-rail/index.js +1 -1
  298. package/dist/components/tooth-scheme/index.js +1 -1
  299. package/dist/components/unit-converter/index.js +1 -1
  300. package/dist/components/voice-control-panel/index.js +1 -1
  301. package/dist/components/warning-stack/index.js +1 -1
  302. package/dist/components/week-availability/index.js +1 -1
  303. package/dist/components/weekly-hours-editor/index.js +1 -1
  304. package/dist/components/workflow/index.js +1 -1
  305. package/dist/core.css +1 -1
  306. package/dist/find-free-slots-panel/index.js +1 -1
  307. package/dist/host-calendar-selection.css +89 -0
  308. package/dist/index.js +157 -157
  309. package/dist/online-bookings-panel/index.js +2 -2
  310. package/dist/patterns/alia-assistant/index.js +1 -1
  311. package/dist/patterns/anamnesis/index.js +1 -1
  312. package/dist/patterns/calendar/index.js +4 -4
  313. package/dist/patterns/check-in-documents/index.js +1 -1
  314. package/dist/patterns/error-page/index.js +1 -1
  315. package/dist/patterns/forgot-password-form/index.js +1 -1
  316. package/dist/patterns/help-me-write-templates/index.js +2 -2
  317. package/dist/patterns/login-form/index.js +1 -1
  318. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  319. package/dist/patterns/patient-account-settings/index.js +1 -1
  320. package/dist/patterns/patient-check-in/index.js +1 -1
  321. package/dist/patterns/patient-portal/index.js +2 -2
  322. package/dist/patterns/patient-sign-in/index.js +2 -2
  323. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  324. package/dist/patterns/prescription/index.js +1 -1
  325. package/dist/patterns/registration-form/index.js +1 -1
  326. package/dist/patterns/reset-password-form/index.js +1 -1
  327. package/dist/patterns/send-registration-link-form/index.js +1 -1
  328. package/dist/patterns/signature-request/index.js +1 -1
  329. package/dist/patterns/signed-out-frame/index.js +1 -1
  330. package/dist/patterns/signing/index.js +1 -1
  331. package/dist/patterns/verify-identity/index.js +1 -1
  332. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  333. package/dist/redactor.css +3 -0
  334. package/dist/speech/aws-transcribe.d.ts +9 -0
  335. package/dist/tokens.css +4 -1
  336. package/dist/waiting-list-panel/index.js +4 -4
  337. package/package.json +7 -2
  338. package/dist/_chunks/rich-text-editor-DoCaj0qc.js +0 -4264
@@ -1,4264 +0,0 @@
1
- import { jsx as t, jsxs as C, Fragment as De } from "react/jsx-runtime";
2
- import { useId as je, useState as E, useRef as x, useCallback as k, useEffect as I, Fragment as vt, useLayoutEffect as ti, forwardRef as ni, useMemo as gt, useImperativeHandle as ri } from "react";
3
- import { c as yt } from "./index-D2ZczOXr.js";
4
- import { useTranslation as ie } from "react-i18next";
5
- import { SafeHtml as oi, sanitiseHtml as ii } from "../safe-html/index.js";
6
- import { a as ai, c as si, d as li, b as Yr } from "./ai-fab-pill-BOu96kCx.js";
7
- import { u as ci } from "./registry-DvAUVLHh.js";
8
- import { u as di } from "./use-ai-sparkle-Cf4yVTLB.js";
9
- import { S as Kn } from "./spinner-CoflYlEx.js";
10
- import { A as ui } from "./ai-sparkle-D23NT8Z_.js";
11
- import { B as Ne } from "./button-DohK_Ak_.js";
12
- import { I as W } from "./icon-button-S8_weU3g.js";
13
- import { A as mi } from "./ai-permission-notice-CEDEWE2-.js";
14
- import { T as fi } from "./text-area-COMVJ1yE.js";
15
- import { E as Dn } from "./editor-overlay-Dc8uVxEp.js";
16
- import { u as gi } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
17
- import { X as hi } from "./x-B5YnXwCz.js";
18
- import { R as pi } from "./rotate-ccw-BBQnIVTr.js";
19
- import { C as bi } from "./check-DrFSN__t.js";
20
- import { S as zt } from "./square-DASBRZ0U.js";
21
- import { M as qn } from "./mic-CUklMZGF.js";
22
- import { S as vi } from "./send-C5kDJ-Mz.js";
23
- import { D as G } from "./dropdown-menu-Bm1KALnk.js";
24
- import * as rn from "@radix-ui/react-popover";
25
- import { u as yi, f as wi } from "./non-modal-tab-exit-DqJao_E-.js";
26
- import { V as eo } from "./variables-menu-C4NcClKi.js";
27
- import { a as Vn } from "./tooltip-uEBdD1-5.js";
28
- import { P as oe } from "./popover-CkvP3rHZ.js";
29
- import { D as le } from "./dialog-239Geb7Z.js";
30
- import { C as Wn } from "./color-picker-5FKOk_z1.js";
31
- import { S as cn } from "./state-backed-text-input-DVETOhSS.js";
32
- import { C as ki } from "./checkbox-DV4sNDeB.js";
33
- import { F as xi } from "./file-upload-DQc0LsBM.js";
34
- import { c as $ } from "./createLucideIcon-DhHxpK9K.js";
35
- import { E as Ci } from "./ellipsis-dRo9ouSU.js";
36
- import { H as Ai } from "./highlighter-DSkckT2Q.js";
37
- import { C as Xn } from "./chevron-down-DWE7GSq9.js";
38
- import { I as Ni } from "./image-B_5MNK0x.js";
39
- import { P as Ti } from "./plus-DzMQ_c6b.js";
40
- import { S as Ei } from "./settings-d25ju_6L.js";
41
- import { U as Ri } from "./undo-2-EBxWjj1W.js";
42
- import { T as Mi } from "./trash-2-uumy3fy1.js";
43
- import { u as zi, w as ht } from "./ai-credits-notice-D_Zm_N2A.js";
44
- /**
45
- * @license lucide-react v1.22.0 - ISC
46
- *
47
- * This source code is licensed under the ISC license.
48
- * See the LICENSE file in the root directory of this source tree.
49
- */
50
- const Si = [
51
- ["path", { d: "M4 20h16", key: "14thso" }],
52
- ["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
53
- ["path", { d: "M8 12h8", key: "1wcyev" }]
54
- ], Li = $("baseline", Si);
55
- /**
56
- * @license lucide-react v1.22.0 - ISC
57
- *
58
- * This source code is licensed under the ISC license.
59
- * See the LICENSE file in the root directory of this source tree.
60
- */
61
- const _i = [
62
- ["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
63
- ["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
64
- ["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
65
- ], Ii = $("between-horizontal-end", _i);
66
- /**
67
- * @license lucide-react v1.22.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */
72
- const $i = [
73
- ["rect", { width: "13", height: "7", x: "8", y: "3", rx: "1", key: "pkso9a" }],
74
- ["path", { d: "m2 9 3 3-3 3", key: "1agib5" }],
75
- ["rect", { width: "13", height: "7", x: "8", y: "14", rx: "1", key: "1q5fc1" }]
76
- ], Hi = $("between-horizontal-start", $i);
77
- /**
78
- * @license lucide-react v1.22.0 - ISC
79
- *
80
- * This source code is licensed under the ISC license.
81
- * See the LICENSE file in the root directory of this source tree.
82
- */
83
- const Oi = [
84
- ["rect", { width: "7", height: "13", x: "3", y: "3", rx: "1", key: "1fdu0f" }],
85
- ["path", { d: "m9 22 3-3 3 3", key: "17z65a" }],
86
- ["rect", { width: "7", height: "13", x: "14", y: "3", rx: "1", key: "1squn4" }]
87
- ], Di = $("between-vertical-end", Oi);
88
- /**
89
- * @license lucide-react v1.22.0 - ISC
90
- *
91
- * This source code is licensed under the ISC license.
92
- * See the LICENSE file in the root directory of this source tree.
93
- */
94
- const qi = [
95
- ["rect", { width: "7", height: "13", x: "3", y: "8", rx: "1", key: "1fjrkv" }],
96
- ["path", { d: "m15 2-3 3-3-3", key: "1uh6eb" }],
97
- ["rect", { width: "7", height: "13", x: "14", y: "8", rx: "1", key: "w3fjg8" }]
98
- ], Pi = $("between-vertical-start", qi);
99
- /**
100
- * @license lucide-react v1.22.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */
105
- const Bi = [
106
- [
107
- "path",
108
- {
109
- d: "M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",
110
- key: "1ah6g2"
111
- }
112
- ],
113
- ["rect", { x: "14", y: "2", width: "8", height: "8", rx: "1", key: "88lufb" }]
114
- ], Pn = $("blocks", Bi);
115
- /**
116
- * @license lucide-react v1.22.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */
121
- const Fi = [
122
- [
123
- "path",
124
- { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
125
- ]
126
- ], ji = $("bold", Fi);
127
- /**
128
- * @license lucide-react v1.22.0 - ISC
129
- *
130
- * This source code is licensed under the ISC license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */
133
- const Gi = [
134
- [
135
- "path",
136
- { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
137
- ],
138
- [
139
- "path",
140
- {
141
- d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
142
- key: "e1hn23"
143
- }
144
- ]
145
- ], Ki = $("braces", Gi);
146
- /**
147
- * @license lucide-react v1.22.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */
152
- const Vi = [
153
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
154
- ["path", { d: "M12 3v18", key: "108xh3" }]
155
- ], Wi = $("columns-2", Vi);
156
- /**
157
- * @license lucide-react v1.22.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */
162
- const Xi = [
163
- ["path", { d: "M4 12h8", key: "17cfdx" }],
164
- ["path", { d: "M4 18V6", key: "1rz3zl" }],
165
- ["path", { d: "M12 18V6", key: "zqpxq5" }],
166
- ["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
167
- ], Ui = $("heading-2", Xi);
168
- /**
169
- * @license lucide-react v1.22.0 - ISC
170
- *
171
- * This source code is licensed under the ISC license.
172
- * See the LICENSE file in the root directory of this source tree.
173
- */
174
- const Zi = [
175
- ["path", { d: "M4 12h8", key: "17cfdx" }],
176
- ["path", { d: "M4 18V6", key: "1rz3zl" }],
177
- ["path", { d: "M12 18V6", key: "zqpxq5" }],
178
- ["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
179
- ["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
180
- ], Qi = $("heading-3", Zi);
181
- /**
182
- * @license lucide-react v1.22.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */
187
- const Ji = [
188
- ["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
189
- ["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
190
- ["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
191
- ], Yi = $("italic", Ji);
192
- /**
193
- * @license lucide-react v1.22.0 - ISC
194
- *
195
- * This source code is licensed under the ISC license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */
198
- const ea = [
199
- ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
200
- ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
201
- ], ta = $("link", ea);
202
- /**
203
- * @license lucide-react v1.22.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */
208
- const na = [
209
- ["path", { d: "M11 5h10", key: "1cz7ny" }],
210
- ["path", { d: "M11 12h10", key: "1438ji" }],
211
- ["path", { d: "M11 19h10", key: "11t30w" }],
212
- ["path", { d: "M4 4h1v5", key: "10yrso" }],
213
- ["path", { d: "M4 9h2", key: "r1h2o0" }],
214
- ["path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02", key: "xtkcd5" }]
215
- ], ra = $("list-ordered", na);
216
- /**
217
- * @license lucide-react v1.22.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */
222
- const oa = [
223
- ["path", { d: "M3 5h.01", key: "18ugdj" }],
224
- ["path", { d: "M3 12h.01", key: "nlz23k" }],
225
- ["path", { d: "M3 19h.01", key: "noohij" }],
226
- ["path", { d: "M8 5h13", key: "1pao27" }],
227
- ["path", { d: "M8 12h13", key: "1za7za" }],
228
- ["path", { d: "M8 19h13", key: "m83p4d" }]
229
- ], ia = $("list", oa);
230
- /**
231
- * @license lucide-react v1.22.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */
236
- const aa = [
237
- ["path", { d: "M11 7 6 2", key: "1jwth8" }],
238
- ["path", { d: "M18.992 12H2.041", key: "xw1gg" }],
239
- [
240
- "path",
241
- {
242
- d: "M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595",
243
- key: "1nkol4"
244
- }
245
- ],
246
- [
247
- "path",
248
- {
249
- d: "m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33",
250
- key: "1nk1rd"
251
- }
252
- ]
253
- ], sa = $("paint-bucket", aa);
254
- /**
255
- * @license lucide-react v1.22.0 - ISC
256
- *
257
- * This source code is licensed under the ISC license.
258
- * See the LICENSE file in the root directory of this source tree.
259
- */
260
- const la = [
261
- ["rect", { width: "16", height: "6", x: "2", y: "2", rx: "2", key: "jcyz7m" }],
262
- ["path", { d: "M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2", key: "1b9h7c" }],
263
- ["rect", { width: "4", height: "6", x: "8", y: "16", rx: "1", key: "d6e7yl" }]
264
- ], ca = $("paint-roller", la);
265
- /**
266
- * @license lucide-react v1.22.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */
271
- const da = [
272
- [
273
- "path",
274
- {
275
- d: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",
276
- key: "e79jfc"
277
- }
278
- ],
279
- ["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
280
- ["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
281
- ["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
282
- ["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
283
- ], ua = $("palette", da);
284
- /**
285
- * @license lucide-react v1.22.0 - ISC
286
- *
287
- * This source code is licensed under the ISC license.
288
- * See the LICENSE file in the root directory of this source tree.
289
- */
290
- const ma = [
291
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
292
- ["path", { d: "M9 3v18", key: "fh3hqa" }]
293
- ], fa = $("panel-left", ma);
294
- /**
295
- * @license lucide-react v1.22.0 - ISC
296
- *
297
- * This source code is licensed under the ISC license.
298
- * See the LICENSE file in the root directory of this source tree.
299
- */
300
- const ga = [
301
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
302
- ["path", { d: "M15 3v18", key: "14nvp0" }]
303
- ], ha = $("panel-right", ga);
304
- /**
305
- * @license lucide-react v1.22.0 - ISC
306
- *
307
- * This source code is licensed under the ISC license.
308
- * See the LICENSE file in the root directory of this source tree.
309
- */
310
- const pa = [
311
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
312
- ["path", { d: "M14 9h1", key: "l0svgy" }],
313
- ["path", { d: "M19 9h2", key: "te2zfg" }],
314
- ["path", { d: "M3 9h2", key: "1h4ldw" }],
315
- ["path", { d: "M9 9h1", key: "15jzuz" }]
316
- ], ba = $("panel-top-dashed", pa);
317
- /**
318
- * @license lucide-react v1.22.0 - ISC
319
- *
320
- * This source code is licensed under the ISC license.
321
- * See the LICENSE file in the root directory of this source tree.
322
- */
323
- const va = [
324
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
325
- ["path", { d: "M3 9h18", key: "1pudct" }]
326
- ], ya = $("panel-top", va);
327
- /**
328
- * @license lucide-react v1.22.0 - ISC
329
- *
330
- * This source code is licensed under the ISC license.
331
- * See the LICENSE file in the root directory of this source tree.
332
- */
333
- const wa = [
334
- ["path", { d: "M10 3H8", key: "mzdi2d" }],
335
- ["path", { d: "m15.007 5.008 3.987 3.986", key: "1scubj" }],
336
- ["path", { d: "M20 15v4", key: "nmhudv" }],
337
- [
338
- "path",
339
- {
340
- d: "M21.174 6.813a2.82 2.82 0 0 0-3.986-3.987L3.842 16.175a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
341
- key: "fs0856"
342
- }
343
- ],
344
- ["path", { d: "M22 17h-4", key: "1sj068" }],
345
- ["path", { d: "M4 5v4", key: "13jjxc" }],
346
- ["path", { d: "M6 7H2", key: "8zbtv0" }],
347
- ["path", { d: "M9 2v2", key: "165o2o" }]
348
- ], Ir = $("pencil-sparkles", wa);
349
- /**
350
- * @license lucide-react v1.22.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */
355
- const ka = [
356
- ["path", { d: "M13 4v16", key: "8vvj80" }],
357
- ["path", { d: "M17 4v16", key: "7dpous" }],
358
- ["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
359
- ], xa = $("pilcrow", ka);
360
- /**
361
- * @license lucide-react v1.22.0 - ISC
362
- *
363
- * This source code is licensed under the ISC license.
364
- * See the LICENSE file in the root directory of this source tree.
365
- */
366
- const Ca = [
367
- [
368
- "path",
369
- {
370
- d: "M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
371
- key: "rib7q0"
372
- }
373
- ],
374
- [
375
- "path",
376
- {
377
- d: "M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
378
- key: "1ymkrd"
379
- }
380
- ]
381
- ], Aa = $("quote", Ca);
382
- /**
383
- * @license lucide-react v1.22.0 - ISC
384
- *
385
- * This source code is licensed under the ISC license.
386
- * See the LICENSE file in the root directory of this source tree.
387
- */
388
- const Na = [
389
- ["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
390
- ["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13", key: "6uklza" }]
391
- ], Ta = $("redo-2", Na);
392
- /**
393
- * @license lucide-react v1.22.0 - ISC
394
- *
395
- * This source code is licensed under the ISC license.
396
- * See the LICENSE file in the root directory of this source tree.
397
- */
398
- const Ea = [
399
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
400
- ["path", { d: "M3 12h18", key: "1i2n21" }]
401
- ], Ra = $("rows-2", Ea);
402
- /**
403
- * @license lucide-react v1.22.0 - ISC
404
- *
405
- * This source code is licensed under the ISC license.
406
- * See the LICENSE file in the root directory of this source tree.
407
- */
408
- const Ma = [
409
- ["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
410
- ["path", { d: "M8 12h8", key: "1wcyev" }],
411
- ["path", { d: "m16 20 2 2 4-4", key: "13tcca" }]
412
- ], $r = $("spell-check", Ma);
413
- /**
414
- * @license lucide-react v1.22.0 - ISC
415
- *
416
- * This source code is licensed under the ISC license.
417
- * See the LICENSE file in the root directory of this source tree.
418
- */
419
- const za = [
420
- ["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
421
- ["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
422
- ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
423
- ], Sa = $("strikethrough", za);
424
- /**
425
- * @license lucide-react v1.22.0 - ISC
426
- *
427
- * This source code is licensed under the ISC license.
428
- * See the LICENSE file in the root directory of this source tree.
429
- */
430
- const La = [
431
- ["path", { d: "M12 3v18", key: "108xh3" }],
432
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
433
- ["path", { d: "M3 9h18", key: "1pudct" }],
434
- ["path", { d: "M3 15h18", key: "5xshup" }]
435
- ], _a = $("table", La);
436
- /**
437
- * @license lucide-react v1.22.0 - ISC
438
- *
439
- * This source code is licensed under the ISC license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */
442
- const Ia = [
443
- ["path", { d: "M21 5H3", key: "1fi0y6" }],
444
- ["path", { d: "M17 12H7", key: "16if0g" }],
445
- ["path", { d: "M19 19H5", key: "vjpgq2" }]
446
- ], to = $("text-align-center", Ia);
447
- /**
448
- * @license lucide-react v1.22.0 - ISC
449
- *
450
- * This source code is licensed under the ISC license.
451
- * See the LICENSE file in the root directory of this source tree.
452
- */
453
- const $a = [
454
- ["path", { d: "M21 5H3", key: "1fi0y6" }],
455
- ["path", { d: "M21 12H9", key: "dn1m92" }],
456
- ["path", { d: "M21 19H7", key: "4cu937" }]
457
- ], no = $("text-align-end", $a);
458
- /**
459
- * @license lucide-react v1.22.0 - ISC
460
- *
461
- * This source code is licensed under the ISC license.
462
- * See the LICENSE file in the root directory of this source tree.
463
- */
464
- const Ha = [
465
- ["path", { d: "M3 5h18", key: "1u36vt" }],
466
- ["path", { d: "M3 12h18", key: "1i2n21" }],
467
- ["path", { d: "M3 19h18", key: "awlh7x" }]
468
- ], Oa = $("text-align-justify", Ha);
469
- /**
470
- * @license lucide-react v1.22.0 - ISC
471
- *
472
- * This source code is licensed under the ISC license.
473
- * See the LICENSE file in the root directory of this source tree.
474
- */
475
- const Da = [
476
- ["path", { d: "M21 5H3", key: "1fi0y6" }],
477
- ["path", { d: "M15 12H3", key: "6jk70r" }],
478
- ["path", { d: "M17 19H3", key: "z6ezky" }]
479
- ], ro = $("text-align-start", Da);
480
- /**
481
- * @license lucide-react v1.22.0 - ISC
482
- *
483
- * This source code is licensed under the ISC license.
484
- * See the LICENSE file in the root directory of this source tree.
485
- */
486
- const qa = [
487
- ["rect", { width: "18", height: "12", x: "3", y: "8", rx: "1", key: "158fvp" }],
488
- ["path", { d: "M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3", key: "s0042v" }],
489
- ["path", { d: "M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3", key: "9wmeh2" }]
490
- ], Bn = $("toy-brick", qa);
491
- /**
492
- * @license lucide-react v1.22.0 - ISC
493
- *
494
- * This source code is licensed under the ISC license.
495
- * See the LICENSE file in the root directory of this source tree.
496
- */
497
- const Pa = [
498
- ["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
499
- ["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
500
- ], Ba = $("underline", Pa);
501
- /**
502
- * @license lucide-react v1.22.0 - ISC
503
- *
504
- * This source code is licensed under the ISC license.
505
- * See the LICENSE file in the root directory of this source tree.
506
- */
507
- const Fa = [
508
- [
509
- "path",
510
- {
511
- d: "m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",
512
- key: "ul74o6"
513
- }
514
- ],
515
- ["path", { d: "m14 7 3 3", key: "1r5n42" }],
516
- ["path", { d: "M5 6v4", key: "ilb8ba" }],
517
- ["path", { d: "M19 14v4", key: "blhpug" }],
518
- ["path", { d: "M10 2v2", key: "7u0qdc" }],
519
- ["path", { d: "M7 8H3", key: "zfb6yr" }],
520
- ["path", { d: "M21 16h-4", key: "1cnmox" }],
521
- ["path", { d: "M11 3H9", key: "1obp7u" }]
522
- ], Hr = $("wand-sparkles", Fa);
523
- function Or(n) {
524
- return {
525
- format: n("editor.vendor.format"),
526
- image: n("editor.vendor.image"),
527
- file: n("editor.vendor.file"),
528
- link: n("editor.vendor.link"),
529
- bold: n("editor.bold"),
530
- italic: n("editor.italic"),
531
- deleted: n("editor.strike"),
532
- underline: n("editor.underline"),
533
- superscript: n("editor.vendor.superscript"),
534
- subscript: n("editor.vendor.subscript"),
535
- "bold-abbr": n("editor.vendor.boldAbbr"),
536
- "italic-abbr": n("editor.vendor.italicAbbr"),
537
- "deleted-abbr": n("editor.vendor.deletedAbbr"),
538
- "underline-abbr": n("editor.vendor.underlineAbbr"),
539
- "superscript-abbr": n("editor.vendor.superscriptAbbr"),
540
- "subscript-abbr": n("editor.vendor.subscriptAbbr"),
541
- lists: n("editor.vendor.lists"),
542
- "link-insert": n("editor.link.insert"),
543
- "link-edit": n("editor.link.edit"),
544
- "link-in-new-tab": n("editor.vendor.linkInNewTab"),
545
- unlink: n("editor.vendor.unlink"),
546
- cancel: n("common.cancel"),
547
- close: n("common.close"),
548
- insert: n("editor.link.insertAction"),
549
- save: n("common.save"),
550
- delete: n("common.delete"),
551
- text: n("editor.vendor.text"),
552
- edit: n("editor.vendor.edit"),
553
- title: n("editor.image.alt"),
554
- paragraph: n("editor.vendor.paragraph"),
555
- quote: n("editor.quote"),
556
- code: n("editor.vendor.code"),
557
- heading1: n("editor.vendor.heading1"),
558
- heading2: n("editor.heading2"),
559
- heading3: n("editor.heading3"),
560
- heading4: n("editor.vendor.heading4"),
561
- heading5: n("editor.vendor.heading5"),
562
- heading6: n("editor.vendor.heading6"),
563
- filename: n("editor.vendor.filename"),
564
- optional: n("common.optional"),
565
- unorderedlist: n("editor.vendor.unorderedlist"),
566
- orderedlist: n("editor.vendor.orderedlist"),
567
- outdent: n("editor.vendor.outdent"),
568
- indent: n("editor.vendor.indent"),
569
- horizontalrule: n("editor.vendor.horizontalrule"),
570
- upload: n("editor.image.upload"),
571
- "upload-label": n("editor.vendor.uploadLabel"),
572
- "accessibility-help-label": n("editor.regionLabel"),
573
- caption: n("editor.vendor.caption"),
574
- bulletslist: n("editor.vendor.bulletslist"),
575
- numberslist: n("editor.vendor.numberslist"),
576
- "image-position": n("editor.vendor.imagePosition"),
577
- none: n("editor.vendor.none"),
578
- left: n("editor.vendor.left"),
579
- right: n("editor.vendor.right"),
580
- center: n("editor.vendor.center"),
581
- undo: n("editor.undo"),
582
- redo: n("editor.redo"),
583
- size: n("editor.vendor.fontSize"),
584
- "remove-size": n("editor.vendor.removeSize"),
585
- fontcolor: n("editor.textColor"),
586
- highlight: n("editor.highlightColor"),
587
- table: n("editor.vendor.table"),
588
- "insert-table": n("editor.table.insert"),
589
- "insert-row-above": n("editor.table.rowAbove"),
590
- "insert-row-below": n("editor.table.rowBelow"),
591
- "insert-column-left": n("editor.table.columnLeft"),
592
- "insert-column-right": n("editor.table.columnRight"),
593
- "add-head": n("editor.table.addHeader"),
594
- "delete-head": n("editor.table.deleteHeader"),
595
- "delete-column": n("editor.table.deleteColumn"),
596
- "delete-row": n("editor.table.deleteRow"),
597
- "delete-table": n("editor.table.deleteTable")
598
- };
599
- }
600
- const ja = {
601
- id: "rich-text-editor",
602
- capabilities: ["edit_inline"],
603
- state: {
604
- html: {
605
- type: "string",
606
- descriptionKey: "ui.agent.richTextEditor.state.html",
607
- description: "Sanitised HTML representation of the editor content.",
608
- read: (n) => n.getHTML()
609
- },
610
- text: {
611
- type: "string",
612
- descriptionKey: "ui.agent.richTextEditor.state.text",
613
- description: "Plain-text content of the editor (tags stripped).",
614
- read: (n) => n.getText()
615
- },
616
- markdown: {
617
- type: "string",
618
- descriptionKey: "ui.agent.richTextEditor.state.markdown",
619
- description: "Markdown representation of the editor content. The Redactor engine has no native Markdown serialiser, so this is always empty — read `html` instead.",
620
- read: (n) => n.getMarkdown()
621
- },
622
- aiBusy: {
623
- type: "boolean",
624
- descriptionKey: "ui.agent.richTextEditor.state.aiBusy",
625
- description: "True while a one-shot AI action (a practice template, spelling or auto-format) is rewriting the note. Read `html` once it is false.",
626
- read: (n) => n.isAiBusy()
627
- }
628
- },
629
- // Image wrap/align/resize are intentionally NOT agent actions — they target
630
- // the ephemeral click-selected image the handle can't address. Agents emit
631
- // `<img class="wysiwyg-img-*" style="width:N%">` via set_content instead.
632
- actions: {
633
- set_content: {
634
- // Replaces the whole document — discards whatever the user had typed.
635
- safety: "destructive",
636
- argsType: "{ html: string }",
637
- argsSchema: {
638
- type: "object",
639
- properties: {
640
- html: {
641
- type: "string",
642
- description: "Replacement HTML (sanitised via DOMPurify)."
643
- }
644
- },
645
- required: ["html"]
646
- },
647
- idempotent: !0,
648
- descriptionKey: "ui.agent.richTextEditor.actions.setContent",
649
- description: "Replace the editor content. Loses unsaved input.",
650
- invoke: (n, a) => {
651
- n.setContent(a.html);
652
- }
653
- },
654
- insert_at_cursor: {
655
- // Reversible via the editor's own undo stack — write, not destructive.
656
- safety: "write",
657
- argsType: "{ content: string; asHtml?: boolean }",
658
- argsSchema: {
659
- type: "object",
660
- properties: {
661
- content: {
662
- type: "string",
663
- description: "Content to insert at the caret."
664
- },
665
- asHtml: {
666
- type: "boolean",
667
- description: "Treat content as HTML (sanitised). Pass false for plain text. Defaults to true."
668
- }
669
- },
670
- required: ["content"]
671
- },
672
- descriptionKey: "ui.agent.richTextEditor.actions.insertAtCursor",
673
- description: "Insert content at the caret (replacing any selection). HTML is sanitised; pass asHtml:false for plain text. Seam for merge/template variables and AI-generated drafts.",
674
- examples: [
675
- {
676
- args: { content: "{{patient.firstName}}", asHtml: !1 },
677
- note: "Insert a merge variable as plain text."
678
- }
679
- ],
680
- invoke: (n, a) => {
681
- n.insertAtCursor(a.content, { asHtml: a.asHtml });
682
- }
683
- },
684
- apply_format: {
685
- // Reversible via undo — write, not destructive.
686
- safety: "write",
687
- argsType: "{ format: 'bold' | 'italic' | 'strikethrough' | 'bulletedList' | 'numberedList' | 'heading' | 'quote' | 'paragraph' }",
688
- argsSchema: {
689
- type: "object",
690
- properties: {
691
- format: {
692
- type: "string",
693
- enum: [
694
- "bold",
695
- "italic",
696
- "strikethrough",
697
- "bulletedList",
698
- "numberedList",
699
- "heading",
700
- "quote",
701
- "paragraph"
702
- ],
703
- description: "Block or inline format to toggle/apply."
704
- }
705
- },
706
- required: ["format"]
707
- },
708
- descriptionKey: "ui.agent.richTextEditor.actions.applyFormat",
709
- description: "Toggle/apply a block or inline format on the current selection (bold, italic, strikethrough, bulleted/numbered list, heading, quote, paragraph).",
710
- examples: [{ args: { format: "bold" }, note: "Bold the selection." }],
711
- invoke: (n, a) => {
712
- n.applyFormat(a.format);
713
- }
714
- },
715
- clear: {
716
- // Empties the document — loses unsaved input.
717
- safety: "destructive",
718
- idempotent: !0,
719
- descriptionKey: "ui.agent.richTextEditor.actions.clear",
720
- description: "Empty the editor. Loses unsaved input.",
721
- invoke: (n) => {
722
- n.clear();
723
- }
724
- },
725
- focus: {
726
- safety: "read",
727
- idempotent: !0,
728
- descriptionKey: "ui.agent.richTextEditor.actions.focus",
729
- description: "Move keyboard focus to the editor surface.",
730
- invoke: (n) => {
731
- n.focus();
732
- }
733
- }
734
- },
735
- domHooks: {
736
- root: { attr: "data-component", value: "rich-text-editor" },
737
- instanceId: {
738
- attr: "data-component-id",
739
- sourceProp: "id",
740
- description: "Sourced from the id prop."
741
- }
742
- }
743
- }, Ga = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", pt = "ds:!size-[var(--min-target-size)]", Ka = 384, Va = "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", Dr = yt("ds:flex ds:gap-[var(--spacing-sm)]", {
744
- variants: { stacked: { true: "ds:flex-col", false: "ds:items-center" } }
745
- }), qr = yt("ds:min-w-0", {
746
- variants: { stacked: { true: "", false: "ds:flex-1" } }
747
- }), Pr = yt(
748
- "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
749
- { variants: { stacked: { true: "ds:justify-end", false: "" } } }
750
- ), Wa = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Xa = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]";
751
- function oo({ id: n }) {
752
- const { t: a } = ie("ui");
753
- return /* @__PURE__ */ t(
754
- "p",
755
- {
756
- "data-component": "editor-request-error",
757
- id: n,
758
- role: "alert",
759
- className: Xa,
760
- children: a("editor.ai.error")
761
- }
762
- );
763
- }
764
- const Br = [
765
- "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
766
- "ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
767
- "ds:p-[var(--spacing-sm)] ds:[max-block-size:10rem] ds:overflow-y-auto",
768
- "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]",
769
- // The preview renders arbitrary model-generated rich text, and the
770
- // `rich-text` SafeHtml profile allows ul/ol/li. Inside a
771
- // [data-component] preflight's list reset still applies and the host
772
- // undo deliberately does not reach, so markers and indent have to be
773
- // asked for explicitly — otherwise a generated bullet list previews as
774
- // flush, marker-less lines.
775
- "ds:[&_ul]:list-disc ds:[&_ol]:list-decimal",
776
- "ds:[&_ul]:ps-[var(--spacing-md)] ds:[&_ol]:ps-[var(--spacing-md)]"
777
- ].join(" ");
778
- function Fr(n, a) {
779
- return a ? n ? /\s$/.test(n) ? `${n}${a}` : `${n} ${a}` : a : n;
780
- }
781
- function Ua({
782
- open: n,
783
- onClose: a,
784
- onRequestAiDraft: d,
785
- onInsert: l,
786
- previewAsHtml: p = !0,
787
- privacyNotice: g,
788
- onDictate: b
789
- }) {
790
- const { t: f } = ie("ui"), y = je(), A = je(), [w, N] = E(""), [z, R] = E(!1), [q, m] = E(!1), [u, h] = E(null), L = x(null), [M, P] = E(!1), [U, O] = E(""), [F, T] = E(""), J = x(null), j = x(null), Z = k((B = !1) => {
791
- var K;
792
- j.current && (j.current.keepLate = B), (K = J.current) == null || K.abort();
793
- }, []), pe = k(() => {
794
- if (!b) return;
795
- const B = new AbortController();
796
- J.current = B;
797
- const K = { keepLate: !1 };
798
- j.current = K;
799
- let Ee = !1;
800
- const me = () => !Ee && (!B.signal.aborted || K.keepLate);
801
- P(!0), O(""), T(f("editor.ai.listening")), b({
802
- signal: B.signal,
803
- onPartialTranscript: (_) => {
804
- me() && O(_);
805
- },
806
- onFinalTranscript: (_) => {
807
- if (!me()) return;
808
- const it = _.trim();
809
- O(""), it && (N((_t) => Fr(_t, it)), T(it));
810
- }
811
- }).catch(() => {
812
- }).finally(() => {
813
- Ee = !0, O(""), J.current === B && (J.current = null, j.current = null, P(!1), T(""));
814
- });
815
- }, [b, f]), Y = k(() => {
816
- M ? Z(!0) : pe();
817
- }, [M, pe, Z]);
818
- I(() => {
819
- var B, K;
820
- n ? (N(""), R(!1), m(!1), h(null), O(""), T("")) : ((B = L.current) == null || B.abort(), L.current = null, (K = J.current) == null || K.abort());
821
- }, [n]), I(
822
- () => () => {
823
- var B, K;
824
- (B = L.current) == null || B.abort(), (K = J.current) == null || K.abort();
825
- },
826
- []
827
- );
828
- const Te = k(() => {
829
- var Ee;
830
- const B = w.trim();
831
- if (!B || z) return;
832
- Z(), (Ee = L.current) == null || Ee.abort();
833
- const K = new AbortController();
834
- L.current = K, m(!1), R(!0), d({ prompt: B, signal: K.signal }).then((me) => {
835
- K.signal.aborted || (h(me), R(!1));
836
- }).catch((me) => {
837
- K.signal.aborted || me && typeof me == "object" && "name" in me && me.name === "AbortError" || (m(!0), R(!1));
838
- });
839
- }, [w, z, d, Z]), X = k(() => {
840
- u != null && (l(u), a());
841
- }, [u, l, a]), ze = x(null), [D, ae] = E(!1);
842
- gi(() => {
843
- const B = ze.current;
844
- if (!n || !B) return;
845
- const K = () => {
846
- const me = B.clientWidth;
847
- ae(me > 0 && me < Ka);
848
- };
849
- if (K(), typeof ResizeObserver > "u") return;
850
- const Ee = new ResizeObserver(K);
851
- return Ee.observe(B), () => Ee.disconnect();
852
- }, [n]);
853
- const se = u != null, qe = M ? Fr(w, U) : w, ot = D ? null : /* @__PURE__ */ t(
854
- W,
855
- {
856
- size: "md",
857
- intent: "outline",
858
- className: pt,
859
- icon: /* @__PURE__ */ t(hi, {}),
860
- "aria-label": f("common.close"),
861
- onClick: a
862
- }
863
- );
864
- return /* @__PURE__ */ t(
865
- Dn,
866
- {
867
- open: n,
868
- onClose: a,
869
- title: D ? f("editor.ai.dialogTitle") : void 0,
870
- ariaLabel: f("editor.ai.dialogTitle"),
871
- children: /* @__PURE__ */ t("div", { ref: ze, className: Va, children: se ? /* @__PURE__ */ C("div", { className: Dr({ stacked: D }), children: [
872
- ot,
873
- /* @__PURE__ */ t("div", { className: qr({ stacked: D }), children: p ? /* @__PURE__ */ t(
874
- oi,
875
- {
876
- html: u,
877
- profile: "rich-text",
878
- className: Br,
879
- tabIndex: 0,
880
- "aria-label": f("editor.ai.dialogTitle")
881
- }
882
- ) : (
883
- // Focusable so a keyboard user can scroll a long draft preview
884
- // (mirrors the SafeHtml preview branch above). The lint rule's
885
- // tabIndex allowlist doesn't cover a scrollable, non-interactive
886
- // text region.
887
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
888
- /* @__PURE__ */ t("p", { className: Br, tabIndex: 0, children: u })
889
- ) }),
890
- /* @__PURE__ */ C("div", { className: Pr({ stacked: D }), children: [
891
- /* @__PURE__ */ t(
892
- W,
893
- {
894
- size: "md",
895
- intent: "outline",
896
- className: `${pt} ds:rounded-full`,
897
- icon: /* @__PURE__ */ t(pi, {}),
898
- "aria-label": f("editor.ai.retry"),
899
- onClick: () => h(null)
900
- }
901
- ),
902
- /* @__PURE__ */ t(
903
- W,
904
- {
905
- size: "md",
906
- intent: "primary",
907
- className: `${pt} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
908
- icon: /* @__PURE__ */ t(bi, {}),
909
- "aria-label": f("common.confirm"),
910
- onClick: X
911
- }
912
- )
913
- ] })
914
- ] }) : /* @__PURE__ */ C(De, { children: [
915
- /* @__PURE__ */ C("div", { className: Dr({ stacked: D }), children: [
916
- ot,
917
- /* @__PURE__ */ t("div", { className: qr({ stacked: D }), children: /* @__PURE__ */ t(
918
- fi,
919
- {
920
- id: y,
921
- size: "md",
922
- value: qe,
923
- onChange: (B) => N(B.target.value),
924
- placeholder: f("editor.ai.promptPlaceholder"),
925
- "aria-label": f("editor.ai.promptLabel"),
926
- autoResize: !0,
927
- minRows: 1,
928
- maxRows: 3,
929
- readOnly: M,
930
- tone: q ? "error" : "default",
931
- "aria-describedby": q ? A : void 0
932
- }
933
- ) }),
934
- /* @__PURE__ */ C("div", { className: Pr({ stacked: D }), children: [
935
- b ? /* @__PURE__ */ t(
936
- W,
937
- {
938
- size: "md",
939
- intent: "outline",
940
- className: M ? `${pt} ${Ga}` : pt,
941
- icon: M ? /* @__PURE__ */ t(zt, { className: "ds:fill-current" }) : /* @__PURE__ */ t(qn, {}),
942
- "aria-pressed": M,
943
- "aria-label": f(M ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
944
- onClick: Y
945
- }
946
- ) : null,
947
- /* @__PURE__ */ t(
948
- W,
949
- {
950
- size: "md",
951
- intent: "primary",
952
- icon: z ? /* @__PURE__ */ t(Kn, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ t(vi, {}),
953
- className: `${pt} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
954
- disabled: z || !w.trim(),
955
- "aria-busy": z || void 0,
956
- "aria-label": f("editor.ai.generate"),
957
- onClick: Te
958
- }
959
- )
960
- ] })
961
- ] }),
962
- b ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: F }) : null,
963
- q ? /* @__PURE__ */ t(oo, { id: A }) : g ? /* @__PURE__ */ t("p", { className: Wa, children: g }) : null
964
- ] }) })
965
- }
966
- );
967
- }
968
- function io(n, a) {
969
- return n(a, { nsSeparator: !1, defaultValue: a });
970
- }
971
- const ao = {
972
- // Redactor's own history. AI rewrites push onto it too (see
973
- // `pushUndoState` in rich-text-editor.tsx), so Undo steps back over them.
974
- undo: {
975
- id: "undo",
976
- icon: /* @__PURE__ */ t(Ri, {}),
977
- label: ["editor.undo", "Undo"],
978
- command: ["module.buffer.undo"]
979
- },
980
- redo: {
981
- id: "redo",
982
- icon: /* @__PURE__ */ t(Ta, {}),
983
- label: ["editor.redo", "Redo"],
984
- command: ["module.buffer.redo"]
985
- },
986
- bold: {
987
- id: "bold",
988
- icon: /* @__PURE__ */ t(ji, {}),
989
- label: ["editor.bold", "Bold"],
990
- command: ["module.inline.format", { tag: "b" }],
991
- toggle: "bold"
992
- },
993
- italic: {
994
- id: "italic",
995
- icon: /* @__PURE__ */ t(Yi, {}),
996
- label: ["editor.italic", "Italic"],
997
- command: ["module.inline.format", { tag: "i" }],
998
- toggle: "italic"
999
- },
1000
- underline: {
1001
- id: "underline",
1002
- icon: /* @__PURE__ */ t(Ba, {}),
1003
- label: ["editor.underline", "Underline"],
1004
- command: ["module.inline.format", { tag: "u" }],
1005
- toggle: "underline"
1006
- },
1007
- strike: {
1008
- id: "strike",
1009
- icon: /* @__PURE__ */ t(Sa, {}),
1010
- label: ["editor.strike", "Strikethrough"],
1011
- command: ["module.inline.format", { tag: "del" }],
1012
- toggle: "strike"
1013
- },
1014
- ul: {
1015
- id: "ul",
1016
- icon: /* @__PURE__ */ t(ia, {}),
1017
- label: ["editor.list.bullet", "Bulleted list"],
1018
- command: ["module.list.toggle", "ul"],
1019
- toggle: "ul"
1020
- },
1021
- ol: {
1022
- id: "ol",
1023
- icon: /* @__PURE__ */ t(ra, {}),
1024
- label: ["editor.list.ordered", "Numbered list"],
1025
- command: ["module.list.toggle", "ol"],
1026
- toggle: "ol"
1027
- }
1028
- }, Hn = [
1029
- {
1030
- id: "paragraph",
1031
- tag: "p",
1032
- icon: /* @__PURE__ */ t(xa, {}),
1033
- label: ["editor.paragraph", "Paragraph"]
1034
- },
1035
- {
1036
- id: "h2",
1037
- tag: "h2",
1038
- icon: /* @__PURE__ */ t(Ui, {}),
1039
- label: ["editor.heading2", "Heading 2"]
1040
- },
1041
- {
1042
- id: "h3",
1043
- tag: "h3",
1044
- icon: /* @__PURE__ */ t(Qi, {}),
1045
- label: ["editor.heading3", "Heading 3"]
1046
- },
1047
- {
1048
- id: "quote",
1049
- tag: "blockquote",
1050
- icon: /* @__PURE__ */ t(Aa, {}),
1051
- label: ["editor.quote", "Quote"]
1052
- }
1053
- ], on = [
1054
- {
1055
- id: "left",
1056
- icon: /* @__PURE__ */ t(ro, {}),
1057
- label: ["editor.align.left", "Align left"]
1058
- },
1059
- {
1060
- id: "center",
1061
- icon: /* @__PURE__ */ t(to, {}),
1062
- label: ["editor.align.center", "Align centre"]
1063
- },
1064
- {
1065
- id: "right",
1066
- icon: /* @__PURE__ */ t(no, {}),
1067
- label: ["editor.align.right", "Align right"]
1068
- },
1069
- {
1070
- id: "justify",
1071
- icon: /* @__PURE__ */ t(Oa, {}),
1072
- label: ["editor.align.justify", "Justify"]
1073
- }
1074
- ], jr = [
1075
- "p",
1076
- "div",
1077
- "blockquote",
1078
- "pre",
1079
- "h1",
1080
- "h2",
1081
- "h3",
1082
- "h4",
1083
- "h5",
1084
- "h6",
1085
- "li"
1086
- ], Za = {
1087
- minimal: ["bold", "italic", "underline", "link"],
1088
- standard: [
1089
- "undo",
1090
- "redo",
1091
- "format",
1092
- "bold",
1093
- "italic",
1094
- "underline",
1095
- "strike",
1096
- "align",
1097
- "ul",
1098
- "ol",
1099
- "link"
1100
- ],
1101
- full: [
1102
- "undo",
1103
- "redo",
1104
- "format",
1105
- "bold",
1106
- "italic",
1107
- "underline",
1108
- "strike",
1109
- "align",
1110
- "ul",
1111
- "ol",
1112
- "link"
1113
- ]
1114
- }, so = [
1115
- {
1116
- id: "rowAbove",
1117
- command: "plugin.table.addRowAbove",
1118
- icon: /* @__PURE__ */ t(Hi, {}),
1119
- label: ["editor.table.rowAbove", "Add row above"]
1120
- },
1121
- {
1122
- id: "rowBelow",
1123
- command: "plugin.table.addRowBelow",
1124
- icon: /* @__PURE__ */ t(Ii, {}),
1125
- label: ["editor.table.rowBelow", "Add row below"]
1126
- },
1127
- {
1128
- id: "colLeft",
1129
- command: "plugin.table.addColumnLeft",
1130
- icon: /* @__PURE__ */ t(Pi, {}),
1131
- label: ["editor.table.columnLeft", "Add column left"]
1132
- },
1133
- {
1134
- id: "colRight",
1135
- command: "plugin.table.addColumnRight",
1136
- icon: /* @__PURE__ */ t(Di, {}),
1137
- label: ["editor.table.columnRight", "Add column right"]
1138
- },
1139
- {
1140
- id: "addHead",
1141
- command: "plugin.table.addHead",
1142
- icon: /* @__PURE__ */ t(ya, {}),
1143
- label: ["editor.table.addHeader", "Add header row"]
1144
- },
1145
- {
1146
- id: "deleteHead",
1147
- command: "plugin.table.deleteHead",
1148
- icon: /* @__PURE__ */ t(ba, {}),
1149
- label: ["editor.table.deleteHeader", "Remove header row"]
1150
- },
1151
- {
1152
- id: "deleteRow",
1153
- command: "plugin.table.deleteRow",
1154
- icon: /* @__PURE__ */ t(Ra, {}),
1155
- label: ["editor.table.deleteRow", "Delete row"]
1156
- },
1157
- {
1158
- id: "deleteColumn",
1159
- command: "plugin.table.deleteColumn",
1160
- icon: /* @__PURE__ */ t(Wi, {}),
1161
- label: ["editor.table.deleteColumn", "Delete column"]
1162
- },
1163
- {
1164
- id: "deleteTable",
1165
- command: "plugin.table.deleteTable",
1166
- icon: /* @__PURE__ */ t(Mi, {}),
1167
- label: ["editor.table.deleteTable", "Delete table"]
1168
- }
1169
- ], an = 6, lo = "ds:[&_[data-intent=ghost]:hover]:bg-[color-mix(in_srgb,var(--accent)_12%,transparent)] ds:[&_[data-intent=ghost]:hover]:text-[color:var(--accent)]", Qa = yt(
1170
- [
1171
- "ds:@container/toolbar",
1172
- "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1173
- "ds:bg-[var(--background)] ds:p-[var(--spacing-xs)]",
1174
- "ds:shadow-[var(--shadow-md)]",
1175
- lo
1176
- ].join(" ")
1177
- ), Ja = "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", un = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", St = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
1178
- function dn(n) {
1179
- return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1180
- }
1181
- function Ya({
1182
- variables: n,
1183
- recentVariableTokens: a,
1184
- insertVariable: d,
1185
- saveSelection: l
1186
- }) {
1187
- const { t: p } = ie("ui"), [g, b] = E(!1), [f, y] = E(""), A = x(null), w = x(!1), N = yi(!0, {
1188
- getAnchor: wi,
1189
- onReturnToTrigger: () => b(!1)
1190
- }), z = n;
1191
- return /* @__PURE__ */ C(
1192
- rn.Root,
1193
- {
1194
- open: g,
1195
- onOpenChange: (R) => {
1196
- R && l(), b(R), R && y("");
1197
- },
1198
- children: [
1199
- /* @__PURE__ */ t(rn.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1200
- W,
1201
- {
1202
- ref: A,
1203
- size: "sm",
1204
- intent: "ghost",
1205
- icon: /* @__PURE__ */ t(Ki, {}),
1206
- "aria-label": p("editor.insertVariable", "Insert variable")
1207
- }
1208
- ) }),
1209
- /* @__PURE__ */ t(rn.Portal, { children: /* @__PURE__ */ t(
1210
- rn.Content,
1211
- {
1212
- align: "start",
1213
- sideOffset: 4,
1214
- className: "ds:z-[var(--z-popover)]",
1215
- onKeyDown: N,
1216
- onCloseAutoFocus: (R) => {
1217
- w.current && (R.preventDefault(), w.current = !1);
1218
- },
1219
- children: /* @__PURE__ */ t(
1220
- eo,
1221
- {
1222
- variables: z,
1223
- recentTokens: a,
1224
- query: f,
1225
- onQueryChange: y,
1226
- searchFocusable: !0,
1227
- "aria-label": p("editor.insertVariable", "Insert variable"),
1228
- onSelect: (R) => {
1229
- w.current = !0, d(R.token), b(!1);
1230
- },
1231
- onClose: () => b(!1)
1232
- }
1233
- )
1234
- }
1235
- ) })
1236
- ]
1237
- }
1238
- );
1239
- }
1240
- function es({
1241
- run: n,
1242
- active: a,
1243
- onTriggerDown: d
1244
- }) {
1245
- const { t: l } = ie("ui"), p = Hn.find((g) => a.has(g.id)) ?? Hn[0];
1246
- return /* @__PURE__ */ C(G.Root, { children: [
1247
- /* @__PURE__ */ t(G.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1248
- Ne,
1249
- {
1250
- size: "sm",
1251
- intent: "ghost",
1252
- startIcon: p.icon,
1253
- endIcon: /* @__PURE__ */ t(Xn, {}),
1254
- "aria-label": `${l("editor.format", "Paragraph style")}: ${l(
1255
- p.label[0],
1256
- p.label[1]
1257
- )}`,
1258
- onMouseDown: d,
1259
- children: /* @__PURE__ */ t("span", { className: "ds:hidden ds:@[448px]/toolbar:inline", children: l(p.label[0], p.label[1]) })
1260
- }
1261
- ) }),
1262
- /* @__PURE__ */ t(G.Content, { align: "start", children: Hn.map((g) => /* @__PURE__ */ t(
1263
- G.Item,
1264
- {
1265
- startIcon: g.icon,
1266
- onSelect: () => n("module.block.format", { tag: g.tag }),
1267
- children: l(g.label[0], g.label[1])
1268
- },
1269
- g.id
1270
- )) })
1271
- ] });
1272
- }
1273
- function ts({
1274
- run: n,
1275
- active: a,
1276
- onTriggerDown: d
1277
- }) {
1278
- const { t: l } = ie("ui"), p = x(null), [g, b] = E(!1);
1279
- ti(() => {
1280
- const N = p.current;
1281
- N && b(getComputedStyle(N).direction === "rtl");
1282
- }, []);
1283
- const f = g ? "right" : "left", y = on.find((N) => a.has(`align-${N.id}`)) ?? on.find((N) => N.id === f) ?? on[0], A = (N) => {
1284
- N === f ? n("module.block.remove", { style: "text-align" }, jr) : n("module.block.add", { style: { "text-align": N } }, jr), N === f || N === "justify" ? n("module.block.remove", { style: "list-style-position" }, ["li"]) : n("module.block.add", { style: { "list-style-position": "inside" } }, [
1285
- "li"
1286
- ]);
1287
- }, w = `${l("editor.align.label", "Text alignment")}: ${l(
1288
- y.label[0],
1289
- y.label[1]
1290
- )}`;
1291
- return /* @__PURE__ */ C(G.Root, { children: [
1292
- /* @__PURE__ */ t(G.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1293
- Ne,
1294
- {
1295
- ref: p,
1296
- size: "sm",
1297
- intent: "ghost",
1298
- startIcon: y.icon,
1299
- endIcon: /* @__PURE__ */ t(Xn, {}),
1300
- "aria-label": w,
1301
- onMouseDown: d
1302
- }
1303
- ) }),
1304
- /* @__PURE__ */ t(G.Content, { align: "start", children: /* @__PURE__ */ t(G.RadioGroup, { value: y.id, onValueChange: A, children: on.map((N) => /* @__PURE__ */ t(G.RadioItem, { value: N.id, children: l(N.label[0], N.label[1]) }, N.id)) }) })
1305
- ] });
1306
- }
1307
- function ns({
1308
- insertHtml: n,
1309
- saveSelection: a,
1310
- restoreSelection: d,
1311
- getSelectedText: l
1312
- }) {
1313
- const { t: p } = ie("ui"), [g, b] = E(!1), [f, y] = E(""), [A, w] = E(""), [N, z] = E(!1), R = je(), q = je(), m = () => {
1314
- y(""), w(""), z(!1);
1315
- }, u = () => {
1316
- const h = f.trim();
1317
- if (!h) return;
1318
- const L = A.trim() || h, M = N ? ' target="_blank" rel="noopener noreferrer"' : "", P = `<a href="${dn(h)}"${M}>${dn(L)}</a>`;
1319
- b(!1), m(), window.requestAnimationFrame(() => {
1320
- d(), n(P);
1321
- });
1322
- };
1323
- return /* @__PURE__ */ C(le.Root, { open: g, onOpenChange: b, children: [
1324
- /* @__PURE__ */ t(le.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1325
- W,
1326
- {
1327
- size: "sm",
1328
- intent: "ghost",
1329
- icon: /* @__PURE__ */ t(ta, {}),
1330
- "aria-label": p("editor.link.insert", "Insert link"),
1331
- onMouseDown: () => {
1332
- a(), w(l());
1333
- }
1334
- }
1335
- ) }),
1336
- /* @__PURE__ */ C(le.Content, { children: [
1337
- /* @__PURE__ */ t(le.Header, { children: /* @__PURE__ */ t(le.Title, { children: p("editor.link.insert", "Insert link") }) }),
1338
- /* @__PURE__ */ C(le.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1339
- /* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1340
- /* @__PURE__ */ t("label", { htmlFor: R, className: St, children: p("editor.link.url", "URL") }),
1341
- /* @__PURE__ */ t(
1342
- cn,
1343
- {
1344
- id: R,
1345
- type: "url",
1346
- value: f,
1347
- onChange: (h) => y(h.target.value),
1348
- placeholder: "https://…"
1349
- }
1350
- )
1351
- ] }),
1352
- /* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1353
- /* @__PURE__ */ t("label", { htmlFor: q, className: St, children: p("editor.link.text", "Text to display") }),
1354
- /* @__PURE__ */ t(
1355
- cn,
1356
- {
1357
- id: q,
1358
- value: A,
1359
- onChange: (h) => w(h.target.value),
1360
- placeholder: p("editor.link.textPlaceholder", "Link text")
1361
- }
1362
- )
1363
- ] }),
1364
- /* @__PURE__ */ t(
1365
- ki,
1366
- {
1367
- checked: N,
1368
- onCheckedChange: (h) => z(h === !0),
1369
- label: p("editor.link.newTab", "Open in new tab")
1370
- }
1371
- )
1372
- ] }),
1373
- /* @__PURE__ */ C(le.Footer, { children: [
1374
- /* @__PURE__ */ t(le.Close, { asChild: !0, children: /* @__PURE__ */ t(Ne, { intent: "secondary", children: p("common.cancel") }) }),
1375
- /* @__PURE__ */ t(Ne, { onClick: u, disabled: !f.trim(), children: p("editor.link.insertAction", "Insert") })
1376
- ] })
1377
- ] })
1378
- ] });
1379
- }
1380
- function rs({
1381
- insertHtml: n,
1382
- saveSelection: a,
1383
- restoreSelection: d,
1384
- uploadImage: l
1385
- }) {
1386
- const { t: p } = ie("ui"), [g, b] = E(!1), [f, y] = E(""), [A, w] = E(""), N = je(), z = je(), R = (m, u) => {
1387
- const h = `<img src="${dn(m)}" alt="${dn(u)}" loading="lazy">`;
1388
- b(!1), y(""), w(""), window.requestAnimationFrame(() => {
1389
- d(), n(h);
1390
- });
1391
- }, q = () => {
1392
- const m = f.trim();
1393
- m && R(m, A.trim());
1394
- };
1395
- return /* @__PURE__ */ C(le.Root, { open: g, onOpenChange: b, children: [
1396
- /* @__PURE__ */ t(le.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1397
- W,
1398
- {
1399
- size: "sm",
1400
- intent: "ghost",
1401
- icon: /* @__PURE__ */ t(Ni, {}),
1402
- "aria-label": p("editor.image.insert", "Insert image"),
1403
- onMouseDown: () => a()
1404
- }
1405
- ) }),
1406
- /* @__PURE__ */ C(le.Content, { children: [
1407
- /* @__PURE__ */ t(le.Header, { children: /* @__PURE__ */ t(le.Title, { children: p("editor.image.insert", "Insert image") }) }),
1408
- /* @__PURE__ */ C(le.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1409
- l ? /* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1410
- /* @__PURE__ */ t("span", { className: St, children: p("editor.image.upload", "Upload") }),
1411
- /* @__PURE__ */ t(
1412
- xi,
1413
- {
1414
- variant: "dropzone",
1415
- accept: {
1416
- "image/*": [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"]
1417
- },
1418
- maxFiles: 1,
1419
- onUpload: async (m, { signal: u }) => {
1420
- const h = await l(m, u);
1421
- R(h, m.name);
1422
- }
1423
- }
1424
- ),
1425
- /* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: p("editor.image.orUrl", "Or paste an image URL") })
1426
- ] }) : null,
1427
- /* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1428
- /* @__PURE__ */ t("label", { htmlFor: N, className: St, children: p("editor.image.url", "Image URL") }),
1429
- /* @__PURE__ */ t(
1430
- cn,
1431
- {
1432
- id: N,
1433
- type: "url",
1434
- value: f,
1435
- onChange: (m) => y(m.target.value),
1436
- placeholder: "https://…"
1437
- }
1438
- )
1439
- ] }),
1440
- /* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1441
- /* @__PURE__ */ t("label", { htmlFor: z, className: St, children: p("editor.image.alt", "Alt text") }),
1442
- /* @__PURE__ */ t(
1443
- cn,
1444
- {
1445
- id: z,
1446
- value: A,
1447
- onChange: (m) => w(m.target.value),
1448
- placeholder: p(
1449
- "editor.image.altPlaceholder",
1450
- "Describe the image"
1451
- )
1452
- }
1453
- )
1454
- ] })
1455
- ] }),
1456
- /* @__PURE__ */ C(le.Footer, { children: [
1457
- /* @__PURE__ */ t(le.Close, { asChild: !0, children: /* @__PURE__ */ t(Ne, { intent: "secondary", children: p("common.cancel") }) }),
1458
- /* @__PURE__ */ t(Ne, { onClick: q, disabled: !f.trim(), children: p("editor.image.insertAction", "Insert") })
1459
- ] })
1460
- ] })
1461
- ] });
1462
- }
1463
- function os({
1464
- run: n,
1465
- saveSelection: a,
1466
- restoreSelection: d
1467
- }) {
1468
- const { t: l } = ie("ui"), [p, g] = E("#1f2a5c"), b = (y) => {
1469
- g(y), d(), n("module.inline.format", {
1470
- tag: "span",
1471
- style: { color: y },
1472
- type: "toggle"
1473
- });
1474
- }, f = () => {
1475
- d(), n("module.inline.remove", { style: "color" });
1476
- };
1477
- return /* @__PURE__ */ C(oe, { onOpenChange: (y) => y && a(), children: [
1478
- /* @__PURE__ */ t(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1479
- W,
1480
- {
1481
- size: "sm",
1482
- intent: "ghost",
1483
- icon: /* @__PURE__ */ t(ua, {}),
1484
- "aria-label": l("editor.textColor", "Text colour"),
1485
- onMouseDown: (y) => {
1486
- y.preventDefault(), a();
1487
- }
1488
- }
1489
- ) }),
1490
- /* @__PURE__ */ C(oe.Content, { side: "bottom", align: "start", children: [
1491
- /* @__PURE__ */ t(oe.Heading, { children: l("editor.textColor", "Text colour") }),
1492
- /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
1493
- Wn,
1494
- {
1495
- variant: "inline",
1496
- size: "sm",
1497
- value: p,
1498
- onChange: b
1499
- }
1500
- ) }),
1501
- /* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(Ne, { size: "sm", intent: "secondary", onClick: f, children: l("editor.color.remove", "Remove colour") }) })
1502
- ] })
1503
- ] });
1504
- }
1505
- function is({
1506
- run: n,
1507
- saveSelection: a,
1508
- restoreSelection: d
1509
- }) {
1510
- const { t: l } = ie("ui"), [p, g] = E("#fff3a3"), b = (y) => {
1511
- g(y), d(), n("module.inline.format", {
1512
- tag: "span",
1513
- style: { "background-color": y },
1514
- type: "toggle"
1515
- });
1516
- }, f = () => {
1517
- d(), n("module.inline.remove", { style: "background-color" });
1518
- };
1519
- return /* @__PURE__ */ C(oe, { onOpenChange: (y) => y && a(), children: [
1520
- /* @__PURE__ */ t(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1521
- W,
1522
- {
1523
- size: "sm",
1524
- intent: "ghost",
1525
- icon: /* @__PURE__ */ t(Ai, {}),
1526
- "aria-label": l("editor.highlightColor", "Highlight"),
1527
- onMouseDown: (y) => {
1528
- y.preventDefault(), a();
1529
- }
1530
- }
1531
- ) }),
1532
- /* @__PURE__ */ C(oe.Content, { side: "bottom", align: "start", children: [
1533
- /* @__PURE__ */ t(oe.Heading, { children: l("editor.highlightColor", "Highlight") }),
1534
- /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
1535
- Wn,
1536
- {
1537
- variant: "inline",
1538
- size: "sm",
1539
- value: p,
1540
- onChange: b
1541
- }
1542
- ) }),
1543
- /* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(Ne, { size: "sm", intent: "secondary", onClick: f, children: l("editor.highlight.remove", "Remove highlight") }) })
1544
- ] })
1545
- ] });
1546
- }
1547
- function as(n, a) {
1548
- const d = Array.from({ length: a }, () => "<td><br></td>").join("");
1549
- return `<table><tbody>${Array.from({ length: n }, () => `<tr>${d}</tr>`).join("")}</tbody></table>`;
1550
- }
1551
- function ss({
1552
- run: n,
1553
- insertTable: a,
1554
- active: d
1555
- }) {
1556
- const { t: l } = ie("ui"), [p, g] = E({ r: 0, c: 0 }), [b, f] = E(!1), y = d.has("table") || b, A = /* @__PURE__ */ t(
1557
- W,
1558
- {
1559
- size: "sm",
1560
- intent: "ghost",
1561
- icon: /* @__PURE__ */ t(_a, {}),
1562
- "aria-label": l("editor.table.insert", "Insert table"),
1563
- onMouseDown: (w) => w.preventDefault()
1564
- }
1565
- );
1566
- return y ? /* @__PURE__ */ C(G.Root, { open: b, onOpenChange: f, children: [
1567
- /* @__PURE__ */ t(G.Trigger, { asChild: !0, children: A }),
1568
- /* @__PURE__ */ t(G.Content, { side: "bottom", align: "start", children: so.map((w) => /* @__PURE__ */ t(
1569
- G.Item,
1570
- {
1571
- startIcon: w.icon,
1572
- onSelect: () => n(w.command),
1573
- children: l(w.label[0], w.label[1])
1574
- },
1575
- w.id
1576
- )) })
1577
- ] }) : /* @__PURE__ */ C(oe, { onOpenChange: (w) => !w && g({ r: 0, c: 0 }), children: [
1578
- /* @__PURE__ */ t(oe.Trigger, { asChild: !0, children: A }),
1579
- /* @__PURE__ */ C(oe.Content, { side: "bottom", align: "start", children: [
1580
- /* @__PURE__ */ t(oe.Heading, { children: l("editor.table.insert", "Insert table") }),
1581
- /* @__PURE__ */ t(
1582
- "div",
1583
- {
1584
- role: "group",
1585
- "aria-label": l("editor.table.sizePicker", "Table size"),
1586
- className: "ds:mt-[var(--spacing-sm)] ds:grid ds:w-fit ds:grid-cols-6 ds:gap-[var(--spacing-2xs)]",
1587
- onMouseLeave: () => g({ r: 0, c: 0 }),
1588
- children: Array.from({ length: an * an }, (w, N) => {
1589
- const z = Math.floor(N / an) + 1, R = N % an + 1, q = z <= p.r && R <= p.c;
1590
- return /* @__PURE__ */ t(
1591
- "button",
1592
- {
1593
- type: "button",
1594
- "aria-label": l("editor.table.sizeCell", "{{r}}×{{c}}", {
1595
- r: z,
1596
- c: R
1597
- }),
1598
- onMouseEnter: () => g({ r: z, c: R }),
1599
- onClick: () => a(as(z, R)),
1600
- className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${q ? "ds:bg-[var(--primary)]" : "ds:bg-[var(--muted)]"}`
1601
- },
1602
- N
1603
- );
1604
- })
1605
- }
1606
- ),
1607
- /* @__PURE__ */ t("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: p.r > 0 ? l("editor.table.sizeCell", "{{r}}×{{c}}", {
1608
- r: p.r,
1609
- c: p.c
1610
- }) : l("editor.table.sizeHint", "Pick a size") })
1611
- ] })
1612
- ] });
1613
- }
1614
- const ls = Object.fromEntries(so.map((n) => [n.id, n])), cs = [
1615
- "ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1616
- "ds:[inset-block-start:var(--rte-tt-top)] ds:[inset-inline-start:var(--rte-tt-start)]",
1617
- "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1618
- "ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
1619
- ].join(" "), ds = "#fde68a";
1620
- function Gr({
1621
- scope: n,
1622
- icon: a,
1623
- label: d,
1624
- onOpenChange: l,
1625
- saveTableCell: p,
1626
- applyTableBackground: g
1627
- }) {
1628
- const { t: b } = ie("ui"), [f, y] = E(ds);
1629
- return /* @__PURE__ */ C(
1630
- oe,
1631
- {
1632
- onOpenChange: (A) => {
1633
- l(A), A && p();
1634
- },
1635
- children: [
1636
- /* @__PURE__ */ t(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1637
- W,
1638
- {
1639
- size: "sm",
1640
- intent: "ghost",
1641
- icon: a,
1642
- tooltip: d,
1643
- onMouseDown: (A) => A.preventDefault()
1644
- }
1645
- ) }),
1646
- /* @__PURE__ */ C(oe.Content, { side: "bottom", align: "center", children: [
1647
- /* @__PURE__ */ t(
1648
- Wn,
1649
- {
1650
- variant: "inline",
1651
- size: "sm",
1652
- value: f,
1653
- onChange: (A) => {
1654
- y(A), g(n, A);
1655
- }
1656
- }
1657
- ),
1658
- /* @__PURE__ */ t(
1659
- Ne,
1660
- {
1661
- size: "sm",
1662
- intent: "ghost",
1663
- className: "ds:mt-[var(--spacing-xs)] ds:w-full",
1664
- onClick: () => g(n, null),
1665
- children: b("editor.table.clearColor", "Clear colour")
1666
- }
1667
- )
1668
- ] })
1669
- ]
1670
- }
1671
- );
1672
- }
1673
- function us({
1674
- active: n,
1675
- run: a,
1676
- areaRef: d,
1677
- getActiveTableEl: l,
1678
- enableColor: p = !1,
1679
- saveTableCell: g,
1680
- applyTableBackground: b
1681
- }) {
1682
- const { t: f } = ie("ui"), y = n.has("table"), [A, w] = E(null), N = x(0), [z, R] = E(!1), q = k((u) => {
1683
- N.current = Math.max(
1684
- 0,
1685
- N.current + (u ? 1 : -1)
1686
- ), R(N.current > 0);
1687
- }, []);
1688
- if (I(() => {
1689
- if (z) return;
1690
- if (!y || typeof window > "u") {
1691
- w(null);
1692
- return;
1693
- }
1694
- const u = () => {
1695
- const P = d.current, U = l();
1696
- if (!P || !U) {
1697
- w(null);
1698
- return;
1699
- }
1700
- const O = P.getBoundingClientRect(), F = U.getBoundingClientRect(), T = getComputedStyle(P).direction === "rtl", J = Math.max(0, F.top - O.top - 44), j = T ? O.right - F.right + F.width / 2 : F.left - O.left + F.width / 2;
1701
- w({ top: J, start: Math.max(0, j), rtl: T });
1702
- };
1703
- u();
1704
- const h = new ResizeObserver(u), L = d.current, M = l();
1705
- return L && h.observe(L), M && h.observe(M), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
1706
- h.disconnect(), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
1707
- };
1708
- }, [y, z, d, l]), !y && !z || !A) return null;
1709
- const m = [
1710
- ["rowAbove", "rowBelow"],
1711
- ["colLeft", "colRight"],
1712
- ["addHead"],
1713
- ...p ? ["colour"] : [],
1714
- ["deleteRow", "deleteColumn"],
1715
- ["deleteTable"]
1716
- ];
1717
- return (
1718
- // Tooltips disambiguate the icon-only ops on hover (and provide each
1719
- // button's accessible name via IconButton's `tooltip` prop). Radix Tooltip
1720
- // needs a provider ancestor, so scope one to the bar.
1721
- /* @__PURE__ */ t(Vn, { children: /* @__PURE__ */ t(
1722
- "div",
1723
- {
1724
- role: "group",
1725
- "aria-label": f("editor.table.toolbar", "Table tools"),
1726
- className: `${cs} ${A.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
1727
- style: {
1728
- "--rte-tt-top": `${A.top}px`,
1729
- "--rte-tt-start": `${A.start}px`
1730
- },
1731
- children: m.map((u, h) => /* @__PURE__ */ C(vt, { children: [
1732
- h > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: un }) : null,
1733
- u === "colour" ? /* @__PURE__ */ C(De, { children: [
1734
- /* @__PURE__ */ t(
1735
- Gr,
1736
- {
1737
- scope: "cell",
1738
- icon: /* @__PURE__ */ t(sa, {}),
1739
- label: f("editor.table.cellColor", "Cell colour"),
1740
- onOpenChange: q,
1741
- saveTableCell: g,
1742
- applyTableBackground: b
1743
- }
1744
- ),
1745
- /* @__PURE__ */ t(
1746
- Gr,
1747
- {
1748
- scope: "row",
1749
- icon: /* @__PURE__ */ t(ca, {}),
1750
- label: f("editor.table.rowColor", "Row colour"),
1751
- onOpenChange: q,
1752
- saveTableCell: g,
1753
- applyTableBackground: b
1754
- }
1755
- )
1756
- ] }) : u.map((L) => {
1757
- const M = ls[L];
1758
- return /* @__PURE__ */ t(
1759
- W,
1760
- {
1761
- size: "sm",
1762
- intent: "ghost",
1763
- icon: M.icon,
1764
- tooltip: f(M.label[0], M.label[1]),
1765
- onMouseDown: (P) => P.preventDefault(),
1766
- onClick: () => a(M.command)
1767
- },
1768
- L
1769
- );
1770
- })
1771
- ] }, u === "colour" ? "colour" : u[0]))
1772
- }
1773
- ) })
1774
- );
1775
- }
1776
- const Fn = [
1777
- "wysiwyg-img-inline",
1778
- "wysiwyg-img-wrap-left",
1779
- "wysiwyg-img-wrap-right"
1780
- ], co = [
1781
- "wysiwyg-img-align-left",
1782
- "wysiwyg-img-align-center",
1783
- "wysiwyg-img-align-right"
1784
- ];
1785
- function Kr(n, a) {
1786
- return a.find((d) => n.classList.contains(d)) ?? "";
1787
- }
1788
- function ms(n) {
1789
- const a = n.closest(".redactor-in"), d = a instanceof HTMLElement ? a.clientWidth : 0, l = n.getBoundingClientRect().width;
1790
- return d <= 0 || l <= 0 ? Lt : Math.round(Math.min(Lt, l / d * 100));
1791
- }
1792
- const jn = 10, Lt = 100, fs = 5, gs = 10, Vr = (n) => Math.min(Lt, Math.max(jn, Math.round(n))), hs = [
1793
- {
1794
- id: "wysiwyg-img-inline",
1795
- icon: /* @__PURE__ */ t(Li, {}),
1796
- label: ["editor.image.inline", "Inline with text"]
1797
- },
1798
- {
1799
- id: "wysiwyg-img-wrap-left",
1800
- icon: /* @__PURE__ */ t(fa, {}),
1801
- label: ["editor.image.wrapLeft", "Wrap left"]
1802
- },
1803
- {
1804
- id: "wysiwyg-img-wrap-right",
1805
- icon: /* @__PURE__ */ t(ha, {}),
1806
- label: ["editor.image.wrapRight", "Wrap right"]
1807
- }
1808
- ], ps = [
1809
- {
1810
- id: "wysiwyg-img-align-left",
1811
- icon: /* @__PURE__ */ t(ro, {}),
1812
- label: ["editor.image.alignLeft", "Align left"]
1813
- },
1814
- {
1815
- id: "wysiwyg-img-align-center",
1816
- icon: /* @__PURE__ */ t(to, {}),
1817
- label: ["editor.image.alignCenter", "Align centre"]
1818
- },
1819
- {
1820
- id: "wysiwyg-img-align-right",
1821
- icon: /* @__PURE__ */ t(no, {}),
1822
- label: ["editor.image.alignRight", "Align right"]
1823
- }
1824
- ], bs = [
1825
- {
1826
- id: "tl",
1827
- pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
1828
- cursor: "ds:cursor-nwse-resize",
1829
- sign: -1,
1830
- labelKey: "editor.image.resizeTopStart",
1831
- labelFallback: "Resize image, top-start corner"
1832
- },
1833
- {
1834
- id: "tr",
1835
- pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-end:calc(var(--spacing-md)*-0.5)]",
1836
- cursor: "ds:cursor-nesw-resize",
1837
- sign: 1,
1838
- labelKey: "editor.image.resizeTopEnd",
1839
- labelFallback: "Resize image, top-end corner"
1840
- },
1841
- {
1842
- id: "bl",
1843
- pos: "ds:[inset-block-end:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
1844
- cursor: "ds:cursor-nesw-resize",
1845
- sign: -1,
1846
- labelKey: "editor.image.resizeBottomStart",
1847
- labelFallback: "Resize image, bottom-start corner"
1848
- },
1849
- {
1850
- id: "br",
1851
- pos: "ds:[inset-block-end:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-end:calc(var(--spacing-md)*-0.5)]",
1852
- cursor: "ds:cursor-nwse-resize",
1853
- sign: 1,
1854
- labelKey: "editor.image.resizeBottomEnd",
1855
- labelFallback: "Resize image, bottom-end corner"
1856
- }
1857
- ], vs = [
1858
- "ds:absolute ds:z-20 ds:pointer-events-none",
1859
- "ds:[inset-block-start:var(--rte-img-top)] ds:[inset-inline-start:var(--rte-img-start)]",
1860
- "ds:[inline-size:var(--rte-img-width)] ds:[block-size:var(--rte-img-height)]",
1861
- "ds:rounded-[var(--radius-2xs)]",
1862
- "ds:[outline-style:solid] ds:[outline-width:var(--border-width-md)]",
1863
- "ds:[outline-color:var(--accent)] ds:[outline-offset:var(--focus-ring-offset)]"
1864
- ].join(" "), ys = [
1865
- "ds:absolute ds:pointer-events-auto ds:touch-none",
1866
- "ds:[inline-size:var(--spacing-md)] ds:[block-size:var(--spacing-md)]",
1867
- "ds:rounded-[var(--radius-2xs)] ds:shadow-[var(--shadow-sm)]",
1868
- "ds:bg-[var(--accent)] ds:border ds:border-[color:var(--background)]",
1869
- "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
1870
- "ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)]",
1871
- "ds:focus-visible:[outline-offset:var(--focus-ring-offset)]",
1872
- "ds:forced-colors:bg-[CanvasText]"
1873
- ].join(" "), ws = [
1874
- "ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1875
- "ds:[inset-block-start:var(--rte-img-bar-top)] ds:[inset-inline-start:var(--rte-img-center)]",
1876
- "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1877
- "ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
1878
- ].join(" ");
1879
- function ks({
1880
- areaRef: n,
1881
- activeImageEl: a,
1882
- applyImageClass: d,
1883
- setImageWidth: l
1884
- }) {
1885
- const { t: p } = ie("ui"), [g, b] = E(null), f = x(null);
1886
- I(() => {
1887
- if (!a || typeof window > "u") {
1888
- b(null);
1889
- return;
1890
- }
1891
- const m = () => {
1892
- const P = n.current;
1893
- if (!P) {
1894
- b(null);
1895
- return;
1896
- }
1897
- const U = P.getBoundingClientRect(), O = a.getBoundingClientRect(), F = getComputedStyle(P).direction === "rtl", T = O.top - U.top, J = F ? U.right - O.right : O.left - U.left, j = J + O.width / 2, Z = Math.max(0, T - 44);
1898
- b({
1899
- top: T,
1900
- start: Math.max(0, J),
1901
- width: O.width,
1902
- height: O.height,
1903
- center: Math.max(0, j),
1904
- barTop: Z,
1905
- pct: ms(a),
1906
- rtl: F
1907
- });
1908
- };
1909
- m();
1910
- const u = new ResizeObserver(m);
1911
- u.observe(a);
1912
- const h = n.current;
1913
- h && u.observe(h);
1914
- const L = a.closest(".redactor-in");
1915
- let M = null;
1916
- return L && (M = new MutationObserver(m), M.observe(L, {
1917
- subtree: !0,
1918
- childList: !0,
1919
- characterData: !0,
1920
- attributes: !0,
1921
- attributeFilter: ["class", "style", "width", "height", "src"]
1922
- })), window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
1923
- u.disconnect(), M == null || M.disconnect(), window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
1924
- };
1925
- }, [a, n]);
1926
- const y = k(
1927
- (m) => (u) => {
1928
- !u.isPrimary || !g || (u.preventDefault(), u.currentTarget.setPointerCapture(u.pointerId), f.current = {
1929
- pointerId: u.pointerId,
1930
- startX: u.clientX,
1931
- startPct: g.pct,
1932
- sign: m.sign * (g.rtl ? -1 : 1)
1933
- });
1934
- },
1935
- [g]
1936
- ), A = k(
1937
- (m) => {
1938
- const u = f.current;
1939
- if (!u || m.pointerId !== u.pointerId || !a) return;
1940
- const h = a.closest(".redactor-in"), L = h instanceof HTMLElement ? h.clientWidth : 0;
1941
- if (L <= 0) return;
1942
- const M = u.sign * (m.clientX - u.startX) / L * 100;
1943
- l(Vr(u.startPct + M));
1944
- },
1945
- [a, l]
1946
- ), w = k(
1947
- (m) => {
1948
- const u = f.current;
1949
- !u || m.pointerId !== u.pointerId || (m.currentTarget.releasePointerCapture(m.pointerId), f.current = null);
1950
- },
1951
- []
1952
- ), N = k(
1953
- (m) => {
1954
- if (!g) return;
1955
- let u = null;
1956
- const h = m.shiftKey ? gs : fs;
1957
- switch (m.key) {
1958
- // Up / right always grow; down / left always shrink — independent of
1959
- // which corner has focus, so the gesture reads the same everywhere.
1960
- case "ArrowRight":
1961
- case "ArrowUp":
1962
- u = g.pct + h;
1963
- break;
1964
- case "ArrowLeft":
1965
- case "ArrowDown":
1966
- u = g.pct - h;
1967
- break;
1968
- case "Home":
1969
- u = jn;
1970
- break;
1971
- case "End":
1972
- u = Lt;
1973
- break;
1974
- default:
1975
- return;
1976
- }
1977
- m.preventDefault(), l(Vr(u));
1978
- },
1979
- [g, l]
1980
- );
1981
- if (!a || !g) return null;
1982
- const z = Kr(a, Fn), R = Kr(a, co), q = p("editor.image.widthAnnounce", {
1983
- width: g.pct,
1984
- defaultValue: "{{width}} percent"
1985
- });
1986
- return /* @__PURE__ */ C(De, { children: [
1987
- /* @__PURE__ */ t(
1988
- "div",
1989
- {
1990
- className: vs,
1991
- style: {
1992
- "--rte-img-top": `${g.top}px`,
1993
- "--rte-img-start": `${g.start}px`,
1994
- "--rte-img-width": `${g.width}px`,
1995
- "--rte-img-height": `${g.height}px`
1996
- },
1997
- children: bs.map((m) => /* @__PURE__ */ t(
1998
- "div",
1999
- {
2000
- role: "slider",
2001
- tabIndex: 0,
2002
- "aria-label": p(m.labelKey, m.labelFallback),
2003
- "aria-orientation": "horizontal",
2004
- "aria-valuemin": jn,
2005
- "aria-valuemax": Lt,
2006
- "aria-valuenow": g.pct,
2007
- "aria-valuetext": q,
2008
- className: `${ys} ${m.pos} ${m.cursor}`,
2009
- onPointerDown: y(m),
2010
- onPointerMove: A,
2011
- onPointerUp: w,
2012
- onPointerCancel: w,
2013
- onKeyDown: N
2014
- },
2015
- m.id
2016
- ))
2017
- }
2018
- ),
2019
- /* @__PURE__ */ t(Vn, { children: /* @__PURE__ */ t(
2020
- "div",
2021
- {
2022
- role: "group",
2023
- "aria-label": p("editor.image.toolbar", "Image tools"),
2024
- className: `${ws} ${g.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
2025
- style: {
2026
- "--rte-img-bar-top": `${g.barTop}px`,
2027
- "--rte-img-center": `${g.center}px`
2028
- },
2029
- children: [hs, ps].map((m, u) => /* @__PURE__ */ C(vt, { children: [
2030
- u > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: un }) : null,
2031
- m.map((h) => {
2032
- const L = u === 0 ? z === h.id : R === h.id;
2033
- return /* @__PURE__ */ t(
2034
- W,
2035
- {
2036
- size: "sm",
2037
- intent: "ghost",
2038
- icon: h.icon,
2039
- "aria-pressed": L,
2040
- tooltip: p(h.label[0], h.label[1]),
2041
- onMouseDown: (M) => M.preventDefault(),
2042
- onClick: () => d(h.id)
2043
- },
2044
- h.id
2045
- );
2046
- })
2047
- ] }, u === 0 ? "flow" : "align"))
2048
- }
2049
- ) })
2050
- ] });
2051
- }
2052
- function xs({
2053
- templates: n,
2054
- onPick: a,
2055
- onManage: d,
2056
- noteEmpty: l,
2057
- onOpenChange: p,
2058
- trigger: g,
2059
- side: b = "top"
2060
- }) {
2061
- const { t: f } = ie("ui"), y = je();
2062
- return /* @__PURE__ */ C(G.Root, { onOpenChange: p, children: [
2063
- /* @__PURE__ */ t(G.Trigger, { asChild: !0, children: g }),
2064
- /* @__PURE__ */ C(G.Content, { side: b, align: "end", sideOffset: 8, children: [
2065
- /* @__PURE__ */ t(G.Label, { children: n.length > 0 ? f("editor.ai.templatesGroup") : f("editor.ai.noTemplates") }),
2066
- n.map((A) => /* @__PURE__ */ t(
2067
- G.Item,
2068
- {
2069
- startIcon: /* @__PURE__ */ t(Pn, {}),
2070
- description: A.description || void 0,
2071
- "aria-disabled": l || void 0,
2072
- "aria-describedby": l ? y : void 0,
2073
- className: "ds:aria-disabled:opacity-50 ds:aria-disabled:cursor-not-allowed",
2074
- onSelect: (w) => {
2075
- if (l) {
2076
- w.preventDefault();
2077
- return;
2078
- }
2079
- a(A);
2080
- },
2081
- children: A.name
2082
- },
2083
- A.id
2084
- )),
2085
- l && n.length > 0 ? /* @__PURE__ */ t(
2086
- "p",
2087
- {
2088
- id: y,
2089
- className: "ds:m-0 ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-2xs)] ds:text-[length:var(--font-size-xs)] ds:text-[color:var(--muted-foreground)]",
2090
- children: f("editor.ai.templatesNoteEmpty")
2091
- }
2092
- ) : null,
2093
- d && n.length === 0 ? /* @__PURE__ */ t(
2094
- G.Item,
2095
- {
2096
- startIcon: /* @__PURE__ */ t(Ti, {}),
2097
- onSelect: () => d("create"),
2098
- children: f("editor.ai.createFirstTemplate")
2099
- }
2100
- ) : null,
2101
- d && n.length > 0 ? /* @__PURE__ */ C(De, { children: [
2102
- /* @__PURE__ */ t(G.Separator, {}),
2103
- /* @__PURE__ */ t(
2104
- G.Item,
2105
- {
2106
- startIcon: /* @__PURE__ */ t(Ei, {}),
2107
- onSelect: () => d("list"),
2108
- children: f("editor.ai.manageTemplates")
2109
- }
2110
- )
2111
- ] }) : null
2112
- ] })
2113
- ] });
2114
- }
2115
- const Cs = [
2116
- "ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
2117
- "ds:[inset-block-start:var(--rte-sel-top)] ds:[inset-inline-start:var(--rte-sel-start)]",
2118
- "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
2119
- "ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]",
2120
- lo
2121
- ].join(" "), As = ["bold", "italic", "underline", "strike"];
2122
- function Ns({
2123
- active: n,
2124
- run: a,
2125
- areaRef: d,
2126
- getEditorRoot: l,
2127
- suppressed: p = !1,
2128
- holdOpen: g = !1,
2129
- children: b
2130
- }) {
2131
- const { t: f } = ie("ui"), y = x(null), [A, w] = E(null), N = x(g);
2132
- return I(() => {
2133
- N.current = g;
2134
- }, [g]), I(() => {
2135
- if (p || typeof window > "u") {
2136
- w(null);
2137
- return;
2138
- }
2139
- let z = !1, R = 0, q = !1, m = !1;
2140
- const u = () => {
2141
- var se;
2142
- if (N.current || z) return;
2143
- if (m) {
2144
- w(null);
2145
- return;
2146
- }
2147
- const O = d.current, F = l(), T = window.getSelection();
2148
- if (!O || !F || !T || T.rangeCount === 0 || T.isCollapsed || !O.contains(document.activeElement)) {
2149
- w(null);
2150
- return;
2151
- }
2152
- const J = T.getRangeAt(0);
2153
- if (!F.contains(J.commonAncestorContainer)) {
2154
- w(null);
2155
- return;
2156
- }
2157
- if (!J.toString().trim()) {
2158
- w(null);
2159
- return;
2160
- }
2161
- const j = O.getBoundingClientRect(), Z = J.getBoundingClientRect(), pe = getComputedStyle(O).direction === "rtl", Y = Z.top - j.top - 48, Te = Y >= 0 ? Y : Z.bottom - j.top + 8, X = ((se = y.current) == null ? void 0 : se.offsetWidth) ?? 0, ze = pe ? j.right - Z.right + Z.width / 2 : Z.left - j.left + Z.width / 2, D = X / 2, ae = Math.min(
2162
- Math.max(ze, D),
2163
- Math.max(D, j.width - D)
2164
- );
2165
- w({ top: Te, start: ae, rtl: pe }), X === 0 && !q && (q = !0, R = requestAnimationFrame(u));
2166
- }, h = () => {
2167
- cancelAnimationFrame(R), R = requestAnimationFrame(u);
2168
- }, L = (O) => {
2169
- const F = l();
2170
- F && O.target instanceof Node && F.contains(O.target) && (z = !0, w(null));
2171
- }, M = () => {
2172
- z && (z = !1, h());
2173
- }, P = (O) => {
2174
- if (O.key !== "Escape") return;
2175
- const F = d.current;
2176
- !F || !F.contains(document.activeElement) || (m = !0, w(null));
2177
- }, U = () => {
2178
- m = !1, h();
2179
- };
2180
- return document.addEventListener("selectionchange", U), document.addEventListener("focusin", h), document.addEventListener("keydown", P, !0), document.addEventListener("pointerdown", L, !0), document.addEventListener("pointerup", M, !0), document.addEventListener("pointercancel", M, !0), window.addEventListener("scroll", h, !0), window.addEventListener("resize", h), h(), () => {
2181
- cancelAnimationFrame(R), document.removeEventListener("selectionchange", U), document.removeEventListener("focusin", h), document.removeEventListener("keydown", P, !0), document.removeEventListener("pointerdown", L, !0), document.removeEventListener("pointerup", M, !0), document.removeEventListener("pointercancel", M, !0), window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
2182
- };
2183
- }, [p, d, l]), p || !A ? null : /* @__PURE__ */ t(Vn, { children: /* @__PURE__ */ C(
2184
- "div",
2185
- {
2186
- ref: y,
2187
- role: "group",
2188
- "aria-label": f("editor.ai.selectionTools"),
2189
- "data-component-part": "selection-toolbar",
2190
- className: `${Cs} ${A.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
2191
- style: {
2192
- "--rte-sel-top": `${A.top}px`,
2193
- "--rte-sel-start": `${A.start}px`
2194
- },
2195
- children: [
2196
- As.map((z) => {
2197
- const R = ao[z];
2198
- return /* @__PURE__ */ t(
2199
- W,
2200
- {
2201
- size: "sm",
2202
- intent: "ghost",
2203
- icon: R.icon,
2204
- tooltip: f(R.label[0], R.label[1]),
2205
- "aria-pressed": R.toggle ? n.has(R.toggle) : void 0,
2206
- onMouseDown: (q) => q.preventDefault(),
2207
- onClick: () => a(...R.command)
2208
- },
2209
- z
2210
- );
2211
- }),
2212
- b ? /* @__PURE__ */ C(De, { children: [
2213
- /* @__PURE__ */ t("span", { "aria-hidden": "true", className: un }),
2214
- b
2215
- ] }) : null
2216
- ]
2217
- }
2218
- ) });
2219
- }
2220
- function Ts({
2221
- run: n,
2222
- active: a,
2223
- preset: d,
2224
- insertHtml: l,
2225
- insertTable: p,
2226
- saveSelection: g,
2227
- restoreSelection: b,
2228
- getSelectedText: f,
2229
- uploadImage: y,
2230
- enableColor: A = !1,
2231
- enableImage: w = !1,
2232
- enableTable: N = !1,
2233
- showExtensions: z = !1,
2234
- extensionControl: R,
2235
- variables: q,
2236
- recentVariableTokens: m,
2237
- insertVariable: u
2238
- }) {
2239
- const { t: h } = ie("ui"), L = (D) => D.preventDefault(), M = (D) => Za[d].includes(D), P = (D) => {
2240
- if (!M(D)) return null;
2241
- const ae = ao[D];
2242
- return /* @__PURE__ */ t(
2243
- W,
2244
- {
2245
- size: "sm",
2246
- intent: "ghost",
2247
- icon: ae.icon,
2248
- "aria-label": h(ae.label[0], ae.label[1]),
2249
- "aria-pressed": ae.toggle ? a.has(ae.toggle) : void 0,
2250
- onMouseDown: L,
2251
- onClick: () => n(...ae.command)
2252
- },
2253
- ae.id
2254
- );
2255
- }, U = () => /* @__PURE__ */ t("span", { "aria-hidden": "true", className: un }), O = M("format"), F = [P("undo"), P("redo")].filter(Boolean), T = [
2256
- P("bold"),
2257
- P("italic"),
2258
- P("underline"),
2259
- P("strike"),
2260
- A ? /* @__PURE__ */ t(
2261
- os,
2262
- {
2263
- run: n,
2264
- saveSelection: g,
2265
- restoreSelection: b
2266
- },
2267
- "colour"
2268
- ) : null,
2269
- A ? /* @__PURE__ */ t(
2270
- is,
2271
- {
2272
- run: n,
2273
- saveSelection: g,
2274
- restoreSelection: b
2275
- },
2276
- "highlight"
2277
- ) : null
2278
- ].filter(Boolean), J = F.length > 0 || O || T.length > 0, j = M("align") ? [
2279
- /* @__PURE__ */ t(
2280
- ts,
2281
- {
2282
- run: n,
2283
- active: a,
2284
- onTriggerDown: L
2285
- },
2286
- "align"
2287
- )
2288
- ] : [], Z = [P("ul"), P("ol")].filter(Boolean), pe = [
2289
- M("link") ? /* @__PURE__ */ t(
2290
- ns,
2291
- {
2292
- insertHtml: l,
2293
- saveSelection: g,
2294
- restoreSelection: b,
2295
- getSelectedText: f
2296
- },
2297
- "link"
2298
- ) : null,
2299
- w ? /* @__PURE__ */ t(
2300
- rs,
2301
- {
2302
- insertHtml: l,
2303
- saveSelection: g,
2304
- restoreSelection: b,
2305
- uploadImage: y
2306
- },
2307
- "image"
2308
- ) : null,
2309
- N ? /* @__PURE__ */ t(
2310
- ss,
2311
- {
2312
- run: n,
2313
- insertTable: p,
2314
- active: a
2315
- },
2316
- "table"
2317
- ) : null,
2318
- q && q.length > 0 && u ? /* @__PURE__ */ t(
2319
- Ya,
2320
- {
2321
- variables: q,
2322
- recentVariableTokens: m,
2323
- insertVariable: u,
2324
- saveSelection: g
2325
- },
2326
- "variables"
2327
- ) : null
2328
- ].filter(Boolean), Y = R ? [/* @__PURE__ */ t(vt, { children: R }, "extensions")] : z ? [
2329
- /* @__PURE__ */ t(
2330
- W,
2331
- {
2332
- size: "sm",
2333
- intent: "ghost",
2334
- icon: /* @__PURE__ */ t(Bn, {}),
2335
- "aria-label": h("editor.extensions", "Editor extensions"),
2336
- disabled: !0,
2337
- onMouseDown: L
2338
- },
2339
- "extensions"
2340
- )
2341
- ] : [], Te = [
2342
- j,
2343
- Z,
2344
- pe,
2345
- Y
2346
- ].filter((D) => D.length > 0), X = Te.length > 0, ze = (D) => Te.map((ae, se) => /* @__PURE__ */ C(vt, { children: [
2347
- se > 0 || D ? /* @__PURE__ */ t(U, {}) : null,
2348
- ae
2349
- ] }, se));
2350
- return (
2351
- // Outer element is the query container + visual chrome; the flex row is an
2352
- // inner child so `container-type` never lands on the flex parent (which
2353
- // would blockify the inline controls).
2354
- /* @__PURE__ */ t("div", { className: Qa(), "data-component": "editor-toolbar", children: /* @__PURE__ */ C(
2355
- "div",
2356
- {
2357
- role: "group",
2358
- "aria-label": h("editor.toolbarLabel"),
2359
- className: Ja,
2360
- children: [
2361
- F,
2362
- F.length > 0 && (O || T.length > 0) ? /* @__PURE__ */ t(U, {}) : null,
2363
- O ? /* @__PURE__ */ t(es, { run: n, active: a, onTriggerDown: L }) : null,
2364
- O && T.length > 0 ? /* @__PURE__ */ t(U, {}) : null,
2365
- T,
2366
- X ? /* @__PURE__ */ C(De, { children: [
2367
- /* @__PURE__ */ t("div", { className: "ds:hidden ds:@[384px]/toolbar:contents", children: ze(J) }),
2368
- /* @__PURE__ */ C("div", { className: "ds:contents ds:@[384px]/toolbar:hidden", children: [
2369
- J ? /* @__PURE__ */ t(U, {}) : null,
2370
- /* @__PURE__ */ C(oe, { children: [
2371
- /* @__PURE__ */ t(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
2372
- W,
2373
- {
2374
- size: "sm",
2375
- intent: "ghost",
2376
- icon: /* @__PURE__ */ t(Ci, {}),
2377
- "aria-label": h("editor.more", "More options"),
2378
- onMouseDown: L
2379
- }
2380
- ) }),
2381
- /* @__PURE__ */ t(oe.Content, { side: "bottom", align: "end", children: /* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: ze(!1) }) })
2382
- ] })
2383
- ] })
2384
- ] }) : null
2385
- ]
2386
- }
2387
- ) })
2388
- );
2389
- }
2390
- function Ae(n) {
2391
- return ii(n, "rich-text");
2392
- }
2393
- function sn(n = "") {
2394
- const a = String(n).trim();
2395
- if (a === "" || a === "<p><br></p>" || a === "<p>&nbsp;</p>")
2396
- return "";
2397
- const d = a.replace(/<br\s*\/?>/gi, "").replace(/&nbsp;/gi, "").replace(/<[^>]+>/g, "").trim();
2398
- return d === "" && /<img\b[^>]*>/i.test(a) ? a : d === "" ? "" : a;
2399
- }
2400
- function Wr(n) {
2401
- return n.replace(
2402
- /<img(?![^>]*\sloading=)([^>]*)>/gi,
2403
- '<img loading="lazy"$1>'
2404
- );
2405
- }
2406
- const On = /^[A-Za-z0-9_]+$/, uo = /\[\[([A-Za-z0-9_]+)\]\]/g, Gn = "rte-variable-invalid", Es = new RegExp(
2407
- `\\s*\\b${Gn}\\b`,
2408
- "g"
2409
- );
2410
- function Xr(n) {
2411
- return n.includes('data-redactor-type="variable"') ? n.replace(
2412
- /<span\b[^>]*data-redactor-type="variable"[^>]*>/g,
2413
- (a) => a.replace(/\s(?:data-label|title)="[^"]*"/g, "").replace(Es, "").replace(/\sclass=""/g, "")
2414
- ) : n;
2415
- }
2416
- function Rs(n) {
2417
- const a = n.replace(/<[^>]*>/g, " ");
2418
- return Array.from(a.matchAll(uo), (d) => d[1]);
2419
- }
2420
- function Ur(n) {
2421
- return typeof n == "object" && n !== null && "name" in n && n.name === "AiCreditsExhaustedError";
2422
- }
2423
- function Ms(n) {
2424
- return typeof n == "object" && n !== null && "name" in n && n.name === "AbortError";
2425
- }
2426
- function zs(n) {
2427
- const a = document.createElement("template");
2428
- return a.content.appendChild(n), a.innerHTML;
2429
- }
2430
- function Zr(n) {
2431
- const a = document.createElement("template");
2432
- return a.innerHTML = n, (a.content.textContent ?? "").replace(/\s+/g, " ").trim();
2433
- }
2434
- function Qr(n) {
2435
- return n.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, "").replace(/[\s\u200B\uFEFF]+/g, "");
2436
- }
2437
- function Ss(n) {
2438
- const a = window.getSelection();
2439
- if (!a || a.rangeCount === 0) return null;
2440
- const d = a.getRangeAt(0);
2441
- if (!n.contains(d.startContainer)) return null;
2442
- const l = document.createRange();
2443
- return l.selectNodeContents(n), l.setEnd(d.startContainer, d.startOffset), l.toString().length;
2444
- }
2445
- function Ls(n, a) {
2446
- var g;
2447
- const d = window.getSelection();
2448
- if (!d) return;
2449
- const l = document.createTreeWalker(n, NodeFilter.SHOW_TEXT);
2450
- let p = 0;
2451
- for (let b = l.nextNode(); b; b = l.nextNode()) {
2452
- const f = b;
2453
- if (p + f.data.length >= a) {
2454
- const y = document.createRange(), A = (g = f.parentElement) == null ? void 0 : g.closest(
2455
- '[data-redactor-type="variable"]'
2456
- );
2457
- A ? y.setStartAfter(A) : y.setStart(f, a - p), y.collapse(!0), d.removeAllRanges(), d.addRange(y);
2458
- return;
2459
- }
2460
- p += f.data.length;
2461
- }
2462
- }
2463
- function Jr(n) {
2464
- return `<span data-redactor-type="variable">[[${n}]]</span>`;
2465
- }
2466
- function bt(n, a) {
2467
- var b;
2468
- if (a.size === 0 || !n.includes("[[") || typeof DOMParser > "u")
2469
- return n;
2470
- const d = new DOMParser().parseFromString(
2471
- `<body>${n}</body>`,
2472
- "text/html"
2473
- ), l = d.createTreeWalker(d.body, NodeFilter.SHOW_TEXT), p = [];
2474
- for (let f = l.nextNode(); f; f = l.nextNode()) {
2475
- const y = f;
2476
- (b = y.parentElement) != null && b.closest('[data-redactor-type="variable"]') || y.data.includes("[[") && p.push(y);
2477
- }
2478
- let g = !1;
2479
- for (const f of p) {
2480
- const y = d.createDocumentFragment();
2481
- let A = 0;
2482
- for (const w of f.data.matchAll(uo)) {
2483
- const N = a.get(w[1].toLowerCase());
2484
- if (!N || w.index === void 0) continue;
2485
- y.append(f.data.slice(A, w.index));
2486
- const z = d.createElement("span");
2487
- z.setAttribute("data-redactor-type", "variable"), z.textContent = `[[${N}]]`, y.append(z), A = w.index + w[0].length;
2488
- }
2489
- A !== 0 && (y.append(f.data.slice(A)), f.replaceWith(y), g = !0);
2490
- }
2491
- return g ? d.body.innerHTML : n;
2492
- }
2493
- function _s(n) {
2494
- if (!n || typeof n != "object") return;
2495
- const a = n, d = (l) => {
2496
- if (l && typeof l == "object" && "url" in l) {
2497
- const p = l.url;
2498
- return typeof p == "string" ? p : void 0;
2499
- }
2500
- };
2501
- return typeof a.url == "string" ? a.url : d(a.file) ?? d(a.data) ?? Object.values(a).map(d).find(Boolean);
2502
- }
2503
- function Is(n) {
2504
- if (n) return n;
2505
- if (typeof window > "u") return null;
2506
- const a = window;
2507
- return a.$R ?? a.Redactor ?? null;
2508
- }
2509
- const $s = {
2510
- bold: ["module.inline.format", { tag: "b" }],
2511
- italic: ["module.inline.format", { tag: "i" }],
2512
- strikethrough: ["module.inline.format", { tag: "del" }],
2513
- bulletedList: ["module.list.toggle", "ul"],
2514
- numberedList: ["module.list.toggle", "ol"],
2515
- heading: ["module.block.format", { tag: "h2" }],
2516
- quote: ["module.block.format", { tag: "blockquote" }],
2517
- paragraph: ["module.block.format", { tag: "p" }]
2518
- }, Hs = {
2519
- zh: "zh_cn",
2520
- pt: "pt_br"
2521
- };
2522
- function Os(n) {
2523
- const a = n.split("-")[0];
2524
- return Hs[a] ?? a ?? "en";
2525
- }
2526
- const Ds = yt(
2527
- "redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
2528
- ), qs = [
2529
- "ds:absolute ds:z-30",
2530
- "ds:[inset-inline-start:var(--rte-typeahead-x)] ds:[inset-block-start:var(--rte-typeahead-y)]"
2531
- ].join(" "), Ps = yt(
2532
- [
2533
- "ds:block ds:[inline-size:100%]",
2534
- "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--control-border)]",
2535
- "ds:bg-[var(--background)] ds:text-[var(--foreground)]",
2536
- "ds:shadow-[var(--shadow-md)]",
2537
- "ds:font-[family-name:var(--font-sans)] ds:text-[length:var(--font-size-base)]",
2538
- "ds:p-[var(--spacing-md)] ds:[min-block-size:var(--rich-text-editor-min-block-size)]",
2539
- "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
2540
- "ds:focus-visible:outline-solid",
2541
- "ds:focus-visible:outline-[var(--ring)]",
2542
- "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2543
- "ds:forced-colors:focus-visible:outline-[CanvasText]"
2544
- ].join(" ")
2545
- ), Bs = Yr({ recording: !1 }), Fs = Yr({ recording: !0 });
2546
- function ln(n, a) {
2547
- return a ? { "aria-label": n } : { tooltip: n };
2548
- }
2549
- const mo = ["kit", "marketplace"];
2550
- function js({
2551
- groupedExtensions: n,
2552
- showExtensionGroups: a,
2553
- extensionPending: d,
2554
- extensionSession: l,
2555
- extensionError: p,
2556
- openExtension: g,
2557
- closeExtension: b,
2558
- saveSelection: f,
2559
- closeSignal: y,
2560
- restoreFocusOnCloseRef: A
2561
- }) {
2562
- const { t: w } = ie("ui"), [N, z] = E(!1), R = x(null), q = x(!1);
2563
- return I(() => {
2564
- z(!1);
2565
- }, [y]), I(() => {
2566
- q.current && !l && (q.current = !1, A.current && window.requestAnimationFrame(() => {
2567
- var m;
2568
- return (m = R.current) == null ? void 0 : m.focus();
2569
- }));
2570
- }, [l, A]), /* @__PURE__ */ C(
2571
- G.Root,
2572
- {
2573
- open: N,
2574
- onOpenChange: (m) => {
2575
- m ? (f(), z(!0)) : (z(!1), d && b());
2576
- },
2577
- children: [
2578
- /* @__PURE__ */ t(G.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
2579
- W,
2580
- {
2581
- ref: R,
2582
- "data-component-part": "extensions-trigger",
2583
- size: "sm",
2584
- intent: "ghost",
2585
- icon: /* @__PURE__ */ t(Bn, {}),
2586
- "aria-label": w("editor.extensions"),
2587
- onPointerDown: () => f()
2588
- }
2589
- ) }),
2590
- /* @__PURE__ */ t(
2591
- G.Content,
2592
- {
2593
- align: "end",
2594
- onCloseAutoFocus: (m) => {
2595
- (l == null ? void 0 : l.extension.kind) === "panel" && !p && m.preventDefault();
2596
- },
2597
- children: n.map(
2598
- (m, u) => m.length > 0 ? /* @__PURE__ */ C(vt, { children: [
2599
- a ? /* @__PURE__ */ t(G.Label, { children: w(
2600
- u === 0 ? "editor.extensionsKit" : "editor.extensionsMarketplace"
2601
- ) }) : null,
2602
- m.map((h) => {
2603
- var L;
2604
- return /* @__PURE__ */ C(
2605
- G.Item,
2606
- {
2607
- "data-extension-id": h.id,
2608
- disabled: d && (l == null ? void 0 : l.extension.id) !== h.id,
2609
- "aria-busy": d && (l == null ? void 0 : l.extension.id) === h.id || void 0,
2610
- onSelect: (M) => {
2611
- h.kind === "action" && M.preventDefault(), q.current = !0, g(h);
2612
- },
2613
- children: [
2614
- d && (l == null ? void 0 : l.extension.id) === h.id ? /* @__PURE__ */ t(Kn, { size: "sm" }) : h.icon ?? /* @__PURE__ */ t(Bn, {}),
2615
- /* @__PURE__ */ C("span", { className: "ds:flex ds:min-w-0 ds:flex-col ds:text-start", children: [
2616
- /* @__PURE__ */ t("span", { children: io(w, h.label) }),
2617
- h.description ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-muted-foreground", children: h.description }) : null,
2618
- ((L = h.source) == null ? void 0 : L.kind) === "marketplace" ? /* @__PURE__ */ C("span", { className: "type-meta ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-muted-foreground", children: [
2619
- h.source.appIconUrl ? /* @__PURE__ */ t(
2620
- "img",
2621
- {
2622
- src: h.source.appIconUrl,
2623
- alt: "",
2624
- className: "ds:size-[var(--spacing-md)]"
2625
- }
2626
- ) : null,
2627
- h.source.appName
2628
- ] }) : null
2629
- ] })
2630
- ]
2631
- },
2632
- h.id
2633
- );
2634
- })
2635
- ] }, mo[u]) : null
2636
- )
2637
- }
2638
- )
2639
- ]
2640
- }
2641
- );
2642
- }
2643
- const Gs = ni(
2644
- ({
2645
- id: n,
2646
- defaultValue: a,
2647
- value: d,
2648
- onChange: l,
2649
- toolbar: p = "standard",
2650
- placeholder: g,
2651
- readOnly: b = !1,
2652
- ariaLabel: f,
2653
- minHeight: y,
2654
- showExtensions: A,
2655
- extensions: w,
2656
- extensionContext: N,
2657
- onExtensionRun: z,
2658
- className: R,
2659
- redactor: q,
2660
- options: m,
2661
- plugins: u,
2662
- lang: h,
2663
- imageUploadUrl: L,
2664
- onUploadImage: M,
2665
- onKeyDown: P,
2666
- onRequestAiDraft: U,
2667
- aiDraftFormat: O = "html",
2668
- aiPrivacyNotice: F,
2669
- aiConsent: T,
2670
- aiConsentHeadingLevel: J,
2671
- onDictate: j,
2672
- onProofread: Z,
2673
- onAutoFormat: pe,
2674
- aiTemplates: Y,
2675
- onAiApplied: Te,
2676
- aiSparkle: X = !0,
2677
- selectionToolbar: ze,
2678
- variables: D,
2679
- recentVariableTokens: ae,
2680
- onVariableInserted: se,
2681
- validateVariable: qe,
2682
- onVariableValidityChange: ot,
2683
- renderHelpMeWrite: B,
2684
- onAiCreditsExhausted: K,
2685
- aiCreditsNotice: Ee
2686
- }, me) => {
2687
- var Lr, _r;
2688
- const { t: _, i18n: it } = ie("ui"), _t = je(), Ge = gt(
2689
- () => `rte-${_t.replace(/[^a-zA-Z0-9-_]/g, "")}`,
2690
- [_t]
2691
- ), H = `#${Ge}`, ee = x(null), te = x(null), Se = x(null), mn = x(!1), It = x(b), Q = x(null), wt = x(null), [fe, Un] = E(!1), [kt, Pe] = E(!1), [ve, Zn] = E(null), [fn, Qn] = E(!1), [gn, hn] = E(!1), xt = x(null), $t = x(z);
2692
- $t.current = z;
2693
- const Ke = x(null), [fo, go] = E(0), Jn = x(!0), pn = k((e = !0) => {
2694
- Jn.current = e, go((r) => r + 1);
2695
- }, []), bn = k(() => {
2696
- var e, r;
2697
- (e = xt.current) == null || e.abort(), xt.current = null, (r = Ke.current) == null || r.call(Ke, { status: "aborted" }), Zn(null), hn(!1), Qn(!1);
2698
- }, []), Le = k(
2699
- (e = !0) => {
2700
- bn(), pn(e);
2701
- },
2702
- [bn, pn]
2703
- );
2704
- I(
2705
- () => () => {
2706
- var e, r;
2707
- (e = xt.current) == null || e.abort(), (r = Ke.current) == null || r.call(Ke, { status: "aborted" });
2708
- },
2709
- []
2710
- );
2711
- const [ho, po] = E(""), [bo, vo] = E(
2712
- "document"
2713
- ), [yo, vn] = E(!1), Ve = x(K), yn = x(B);
2714
- I(() => {
2715
- Ve.current = K, yn.current = B;
2716
- }, [K, B]);
2717
- const Ht = x(null), ge = gt(
2718
- () => new Map(
2719
- (D ?? []).map((e) => e.token).filter((e) => On.test(e)).map((e) => [e.toLowerCase(), e])
2720
- ),
2721
- [D]
2722
- ), Yn = gt(
2723
- () => new Map(
2724
- (D ?? []).map(
2725
- (e) => [e.token.toLowerCase(), e.label]
2726
- )
2727
- ),
2728
- [D]
2729
- ), at = x(ge);
2730
- I(() => {
2731
- at.current = ge;
2732
- }, [ge]);
2733
- const er = gt(
2734
- () => (D ?? []).filter((e) => On.test(e.token)),
2735
- [D]
2736
- ), wn = x(qe);
2737
- I(() => {
2738
- wn.current = qe;
2739
- }, [qe]);
2740
- const kn = qe !== void 0, xn = k(
2741
- (e) => kn && wn.current ? wn.current(e) : ge.has(e.toLowerCase()),
2742
- [kn, ge]
2743
- ), st = ge.size > 0 || kn, [lt, tr] = E([]), We = x(ot);
2744
- I(() => {
2745
- We.current = ot;
2746
- }, [ot]);
2747
- const _e = x(() => {
2748
- }), [Cn, wo] = E(
2749
- () => /* @__PURE__ */ new Set()
2750
- ), Ot = x(null), [ko, xo] = E(
2751
- null
2752
- ), Dt = k((e) => {
2753
- Ot.current = e, xo(e);
2754
- }, []), Ct = x(null), qt = x(null), he = x(l), Pt = x(P);
2755
- I(() => {
2756
- he.current = l, Pt.current = P;
2757
- }, [l, P]);
2758
- const Co = x(
2759
- (() => {
2760
- const e = d ?? a ?? "";
2761
- return e ? Ae(e) : "";
2762
- })()
2763
- ), ce = k(() => {
2764
- var r;
2765
- const e = te.current;
2766
- if (e)
2767
- try {
2768
- const o = e(H, "source.getCode");
2769
- if (typeof o == "string") return Xr(o);
2770
- } catch {
2771
- }
2772
- return ((r = ee.current) == null ? void 0 : r.value) ?? "";
2773
- }, [H]);
2774
- I(() => {
2775
- _e.current = () => {
2776
- var o;
2777
- if (!st) {
2778
- tr((i) => i.length ? [] : i);
2779
- return;
2780
- }
2781
- const e = (o = Q.current) == null ? void 0 : o.querySelector(".redactor-in");
2782
- e == null || e.querySelectorAll('[data-redactor-type="variable"]').forEach((i) => {
2783
- const s = /^\[\[([A-Za-z0-9_]+)\]\]$/.exec(
2784
- i.textContent ?? ""
2785
- ), c = !s || !xn(s[1]);
2786
- i.classList.contains(Gn) !== c && i.classList.toggle(Gn, c);
2787
- const v = s ? Yn.get(s[1].toLowerCase()) ?? s[1] : i.textContent ?? "";
2788
- i.getAttribute("data-label") !== v && i.setAttribute("data-label", v);
2789
- const S = i.textContent ?? "";
2790
- i.getAttribute("title") !== S && i.setAttribute("title", S);
2791
- });
2792
- const r = Array.from(
2793
- new Set(
2794
- Rs(ce()).filter(
2795
- (i) => !xn(i)
2796
- )
2797
- )
2798
- );
2799
- tr(
2800
- (i) => i.length === r.length && i.every((s, c) => s === r[c]) ? i : r
2801
- );
2802
- }, _e.current();
2803
- }, [st, xn, Yn, ce]), I(() => {
2804
- var o;
2805
- const r = ((o = Q.current) == null ? void 0 : o.querySelector(".redactor-in")) ?? ee.current;
2806
- r && (lt.length > 0 ? (r.setAttribute("aria-invalid", "true"), r.setAttribute("aria-describedby", `${Ge}-variables-error`)) : (r.removeAttribute("aria-invalid"), r.removeAttribute("aria-describedby")));
2807
- }, [lt, Ge, fe]);
2808
- const An = x(!1);
2809
- I(() => {
2810
- var e, r;
2811
- st ? (An.current = !0, (e = We.current) == null || e.call(We, lt)) : An.current && (An.current = !1, (r = We.current) == null || r.call(We, []));
2812
- }, [lt, st]), I(() => {
2813
- qe && _e.current();
2814
- }, [qe]);
2815
- const de = k(
2816
- (e, ...r) => {
2817
- const o = te.current;
2818
- if (!o) return !1;
2819
- const i = It.current;
2820
- if (i)
2821
- try {
2822
- o(H, "disableReadOnly");
2823
- } catch {
2824
- }
2825
- try {
2826
- return o(H, e, ...r), !0;
2827
- } catch {
2828
- return !1;
2829
- } finally {
2830
- if (i)
2831
- try {
2832
- o(H, "enableReadOnly");
2833
- } catch {
2834
- }
2835
- }
2836
- },
2837
- [H]
2838
- ), ue = k(
2839
- (e, r) => {
2840
- var ne;
2841
- const o = (r == null ? void 0 : r.asHtml) ?? !0, i = o ? Ae(e) : e;
2842
- if (de(o ? "insertion.insertHtml" : "insertion.insertText", i)) return;
2843
- const c = ee.current;
2844
- if (!c) return;
2845
- const v = c.selectionStart ?? c.value.length, S = c.selectionEnd ?? c.value.length;
2846
- c.value = c.value.slice(0, v) + i + c.value.slice(S);
2847
- const V = v + i.length;
2848
- try {
2849
- c.setSelectionRange(V, V);
2850
- } catch {
2851
- }
2852
- (ne = he.current) == null || ne.call(he, { html: Ae(c.value), markdown: "" });
2853
- },
2854
- [de]
2855
- ), ye = x(null), we = k(() => {
2856
- var i;
2857
- const e = (i = Q.current) == null ? void 0 : i.querySelector(".redactor-in"), r = typeof window < "u" ? window.getSelection() : null, o = /* @__PURE__ */ new Set();
2858
- if (e && r && r.anchorNode && e.contains(r.anchorNode) && typeof document.queryCommandState == "function") {
2859
- r.rangeCount > 0 && (ye.current = r.getRangeAt(0).cloneRange());
2860
- try {
2861
- document.queryCommandState("bold") && o.add("bold"), document.queryCommandState("italic") && o.add("italic"), document.queryCommandState("underline") && o.add("underline"), document.queryCommandState("strikeThrough") && o.add("strike"), document.queryCommandState("insertUnorderedList") && o.add("ul"), document.queryCommandState("insertOrderedList") && o.add("ol");
2862
- const s = String(
2863
- document.queryCommandValue("formatBlock") || ""
2864
- ).toLowerCase();
2865
- /^h[1-6]$/.test(s) ? (o.add("heading"), o.add(s)) : s === "blockquote" ? o.add("quote") : o.add("paragraph");
2866
- const c = r.anchorNode.nodeType === Node.TEXT_NODE ? r.anchorNode.parentElement : r.anchorNode;
2867
- c && e.contains(c) && c.closest("table") && o.add("table");
2868
- const v = c == null ? void 0 : c.closest(
2869
- "p, div, blockquote, pre, h1, h2, h3, h4, h5, h6, li, td, th"
2870
- );
2871
- if (v && e.contains(v) && v !== e) {
2872
- const S = getComputedStyle(v), V = S.direction === "rtl", ne = S.textAlign.replace(/^-webkit-/, ""), Ce = V ? "right" : "left", Fe = V ? "left" : "right", re = ["left", "center", "right", "justify"].includes(ne) ? ne : ne === "end" ? Fe : Ce;
2873
- o.add(`align-${re}`);
2874
- }
2875
- } catch {
2876
- }
2877
- }
2878
- wo(
2879
- (s) => s.size === o.size && [...o].every((c) => s.has(c)) ? s : o
2880
- );
2881
- }, []), Xe = k(
2882
- (e, ...r) => {
2883
- de(e, ...r), typeof window < "u" ? window.requestAnimationFrame(() => we()) : we();
2884
- },
2885
- [de, we]
2886
- );
2887
- I(() => {
2888
- const e = Q.current;
2889
- if (!e) return;
2890
- const r = {
2891
- b: ["module.inline.format", { tag: "b" }],
2892
- i: ["module.inline.format", { tag: "i" }],
2893
- u: ["module.inline.format", { tag: "u" }]
2894
- }, o = (i) => {
2895
- if (!(i.metaKey || i.ctrlKey) || i.altKey || i.shiftKey || i.isComposing) return;
2896
- const s = r[i.key.toLowerCase()];
2897
- if (!s) return;
2898
- const c = e.querySelector(".redactor-in");
2899
- !c || !(i.target instanceof Node) || !c.contains(i.target) || It.current || (i.preventDefault(), i.stopImmediatePropagation(), Xe(...s));
2900
- };
2901
- return e.addEventListener("keydown", o, !0), () => e.removeEventListener("keydown", o, !0);
2902
- }, [Xe]);
2903
- const Ue = k(
2904
- (e) => {
2905
- ue(e, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => we());
2906
- },
2907
- [ue, we]
2908
- ), [ct, Nn] = E(null), Bt = x(null), Tn = `${Ge}-variables`, nr = x(null), [En, Ao] = E(void 0), Re = k(() => {
2909
- Bt.current = null, Nn(null);
2910
- }, []), Ft = k(
2911
- (e, r) => {
2912
- const o = window.getSelection();
2913
- if (!o) return;
2914
- const i = document.createRange();
2915
- i.setStart(r.node, r.start), i.setEnd(r.node, r.end), o.removeAllRanges(), o.addRange(i), Ue(Jr(e)), window.requestAnimationFrame(() => _e.current());
2916
- },
2917
- [Ue]
2918
- );
2919
- I(() => {
2920
- const e = Q.current;
2921
- if (!e || !st) return;
2922
- const r = () => {
2923
- var Oe;
2924
- const s = e.querySelector(".redactor-in"), c = window.getSelection();
2925
- if (!s || !c || c.rangeCount === 0 || !c.isCollapsed) {
2926
- Re();
2927
- return;
2928
- }
2929
- const { startContainer: v, startOffset: S } = c.getRangeAt(0);
2930
- if (v.nodeType !== Node.TEXT_NODE || !s.contains(v) || (((Oe = v.parentElement) == null ? void 0 : Oe.closest(
2931
- '[data-redactor-type="variable"]'
2932
- )) ?? null) !== null) {
2933
- Re();
2934
- return;
2935
- }
2936
- const V = v, ne = V.data.slice(0, S), Ce = /\[\[([A-Za-z0-9_]+)\]\]$/.exec(ne);
2937
- if (Ce) {
2938
- Re(), Ft(
2939
- ge.get(Ce[1].toLowerCase()) ?? Ce[1],
2940
- { node: V, start: S - Ce[0].length, end: S }
2941
- );
2942
- return;
2943
- }
2944
- const Fe = /\[\[([A-Za-z0-9_ ]{0,40})$/.exec(ne), re = wt.current;
2945
- if (!Fe || !re || (D ?? []).length === 0) {
2946
- Re();
2947
- return;
2948
- }
2949
- const He = {
2950
- node: V,
2951
- start: S - Fe[0].length,
2952
- end: S
2953
- };
2954
- Bt.current = He;
2955
- const ft = document.createRange();
2956
- ft.setStart(V, He.start), ft.setEnd(V, He.end);
2957
- const rt = ft.getBoundingClientRect(), Mt = re.getBoundingClientRect(), $n = getComputedStyle(re).direction === "rtl";
2958
- Nn({
2959
- query: Fe[1],
2960
- left: $n ? Mt.right - rt.right : rt.left - Mt.left,
2961
- top: rt.bottom - Mt.top + 4
2962
- });
2963
- }, o = (s) => {
2964
- var v;
2965
- if (!Bt.current || !["ArrowDown", "ArrowUp", "Home", "End", "Enter", "Escape"].includes(
2966
- s.key
2967
- ))
2968
- return;
2969
- (((v = nr.current) == null ? void 0 : v.handleKeyDown(s)) ?? !1) && (s.preventDefault(), s.stopImmediatePropagation());
2970
- }, i = () => Re();
2971
- return e.addEventListener("input", r), e.addEventListener("keydown", o, !0), e.addEventListener("focusout", i), () => {
2972
- e.removeEventListener("input", r), e.removeEventListener("keydown", o, !0), e.removeEventListener("focusout", i);
2973
- };
2974
- }, [
2975
- st,
2976
- ge,
2977
- D,
2978
- Ft,
2979
- Re
2980
- ]), I(() => {
2981
- var r;
2982
- const e = (r = Q.current) == null ? void 0 : r.querySelector(".redactor-in");
2983
- e && (ct ? (e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-controls", `${Tn}-list`), En ? e.setAttribute("aria-activedescendant", En) : e.removeAttribute("aria-activedescendant")) : (e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls"), e.removeAttribute("aria-activedescendant")));
2984
- }, [ct, Tn, En]);
2985
- const No = k(
2986
- (e) => {
2987
- const r = Bt.current;
2988
- Re(), r && Ft(e.token, r), se == null || se(e.token);
2989
- },
2990
- [Re, Ft, se]
2991
- ), To = k(() => {
2992
- Re();
2993
- }, [Re]), Eo = k((e) => {
2994
- Nn((r) => r && { ...r, query: e });
2995
- }, []), dt = k(() => {
2996
- var r;
2997
- if (typeof window < "u") {
2998
- const o = (r = Q.current) == null ? void 0 : r.querySelector(".redactor-in"), i = window.getSelection();
2999
- o && i && i.rangeCount > 0 && i.anchorNode && o.contains(i.anchorNode) && (ye.current = i.getRangeAt(0).cloneRange());
3000
- }
3001
- const e = te.current;
3002
- if (e)
3003
- try {
3004
- e(H, "selection.save");
3005
- } catch {
3006
- }
3007
- }, [H]), be = k(() => {
3008
- const e = te.current;
3009
- if (!e) return;
3010
- const r = ye.current;
3011
- try {
3012
- e(H, "editor.focus");
3013
- } catch {
3014
- }
3015
- if (r && typeof window < "u") {
3016
- const o = window.getSelection();
3017
- if (o)
3018
- try {
3019
- o.removeAllRanges(), o.addRange(r);
3020
- return;
3021
- } catch {
3022
- }
3023
- }
3024
- try {
3025
- e(H, "selection.restore");
3026
- } catch {
3027
- }
3028
- }, [H]), Ro = k(() => {
3029
- var o;
3030
- if (typeof window > "u") return "";
3031
- const e = (o = Q.current) == null ? void 0 : o.querySelector(".redactor-in"), r = window.getSelection();
3032
- return !e || !r || !r.anchorNode || !e.contains(r.anchorNode) ? "" : r.toString();
3033
- }, []), Mo = k(() => {
3034
- var s;
3035
- if (typeof window > "u") return null;
3036
- const e = (s = Q.current) == null ? void 0 : s.querySelector(".redactor-in"), r = window.getSelection();
3037
- if (!e || !r || r.rangeCount === 0) return null;
3038
- const o = r.anchorNode, i = o && o.nodeType === Node.TEXT_NODE ? o.parentElement : o;
3039
- return !i || !e.contains(i) ? null : i.closest("table");
3040
- }, []), rr = x(null), jt = k(() => {
3041
- var s;
3042
- if (typeof window > "u") return null;
3043
- const e = (s = Q.current) == null ? void 0 : s.querySelector(".redactor-in"), r = window.getSelection();
3044
- if (!e || !r || r.rangeCount === 0) return null;
3045
- const o = r.anchorNode, i = o && o.nodeType === Node.TEXT_NODE ? o.parentElement : o;
3046
- return !i || !e.contains(i) ? null : i.closest("td,th");
3047
- }, []), zo = k(() => {
3048
- rr.current = jt();
3049
- }, [jt]), So = k(
3050
- (e, r) => {
3051
- var c;
3052
- const o = rr.current ?? jt();
3053
- if (!o) return;
3054
- const i = e === "row" ? Array.from(((c = o.closest("tr")) == null ? void 0 : c.children) ?? [o]).filter(
3055
- (v) => v instanceof HTMLElement && (v.tagName === "TD" || v.tagName === "TH")
3056
- ) : [o], s = te.current;
3057
- if (s)
3058
- try {
3059
- s(H, "module.buffer.trigger");
3060
- } catch {
3061
- }
3062
- for (const v of i)
3063
- r ? v.style.setProperty("background-color", r) : v.style.removeProperty("background-color");
3064
- if (s)
3065
- try {
3066
- s(H, "broadcast", "hardsync");
3067
- } catch {
3068
- }
3069
- typeof window < "u" && window.requestAnimationFrame(() => we());
3070
- },
3071
- [jt, H, we]
3072
- );
3073
- I(() => {
3074
- const e = Q.current;
3075
- if (typeof window > "u" || !e) return;
3076
- const r = (s) => {
3077
- const c = e.querySelector(".redactor-in"), v = s.target;
3078
- if (!c || !(v instanceof Node) || !c.contains(v))
3079
- return;
3080
- const S = v instanceof Element ? v.closest("img") : null;
3081
- Dt(S && c.contains(S) ? S : null);
3082
- }, o = (s) => {
3083
- s.key === "Escape" && Ot.current && Dt(null);
3084
- }, i = (s) => {
3085
- const c = s.relatedTarget;
3086
- (!(c instanceof Node) || !e.contains(c)) && Dt(null);
3087
- };
3088
- return e.addEventListener("click", r), e.addEventListener("keydown", o), e.addEventListener("focusout", i), () => {
3089
- e.removeEventListener("click", r), e.removeEventListener("keydown", o), e.removeEventListener("focusout", i);
3090
- };
3091
- }, [Dt]);
3092
- const Lo = k(
3093
- (e) => {
3094
- const r = Ot.current;
3095
- if (!r) return;
3096
- const o = Fn.includes(
3097
- e
3098
- ) ? Fn : co, i = te.current;
3099
- if (i)
3100
- try {
3101
- i(H, "module.buffer.trigger");
3102
- } catch {
3103
- }
3104
- for (const s of o) r.classList.remove(s);
3105
- if (r.classList.add(e), i)
3106
- try {
3107
- i(H, "broadcast", "hardsync");
3108
- } catch {
3109
- }
3110
- typeof window < "u" && window.requestAnimationFrame(() => we());
3111
- },
3112
- [H, we]
3113
- ), _o = k(
3114
- (e) => {
3115
- const r = Ot.current;
3116
- if (!r) return;
3117
- const o = te.current;
3118
- if (o)
3119
- try {
3120
- o(H, "module.buffer.trigger");
3121
- } catch {
3122
- }
3123
- if (r.style.setProperty("width", `${e}%`), o)
3124
- try {
3125
- o(H, "broadcast", "hardsync");
3126
- } catch {
3127
- }
3128
- typeof window < "u" && window.requestAnimationFrame(() => we());
3129
- },
3130
- [H, we]
3131
- ), Io = k(
3132
- (e) => {
3133
- var o;
3134
- const r = te.current;
3135
- if (r && typeof window < "u") {
3136
- const i = (o = Q.current) == null ? void 0 : o.querySelector(".redactor-in"), s = window.getSelection(), c = s == null ? void 0 : s.anchorNode, v = c && c.nodeType === Node.TEXT_NODE ? c.parentElement : c, S = v && (i != null && i.contains(v)) ? v.closest("ul,ol") : null;
3137
- if (S)
3138
- try {
3139
- r(H, "caret.setAfter", S);
3140
- } catch {
3141
- }
3142
- }
3143
- Ue(e), typeof window < "u" && window.requestAnimationFrame(() => {
3144
- var s;
3145
- const i = (s = Q.current) == null ? void 0 : s.querySelector(".redactor-in");
3146
- i == null || i.querySelectorAll("table td, table th").forEach((c) => {
3147
- let v = c.lastChild;
3148
- for (; v && v.nodeType === Node.TEXT_NODE && !(v.textContent ?? "").trim(); ) {
3149
- const S = v.previousSibling;
3150
- c.removeChild(v), v = S;
3151
- }
3152
- });
3153
- });
3154
- },
3155
- [Ue, H]
3156
- ), or = k(
3157
- async (e, r) => {
3158
- if (M) return M(e, r);
3159
- if (!L) throw new Error("No image upload URL configured.");
3160
- const o = new FormData();
3161
- o.append("file", e);
3162
- const i = await fetch(L, {
3163
- method: "POST",
3164
- body: o,
3165
- credentials: "same-origin",
3166
- signal: r
3167
- });
3168
- if (!i.ok) throw new Error(`Image upload failed (${i.status}).`);
3169
- const s = _s(await i.json());
3170
- if (!s) throw new Error("Image upload response contained no URL.");
3171
- return s;
3172
- },
3173
- [L, M]
3174
- ), Ze = di({ enabled: X }), {
3175
- start: ut,
3176
- land: Ie,
3177
- reset: mt
3178
- } = Ze, At = x(null), Gt = x(null), [ke, ir] = E(!1), [$o, ar] = E(!1), [Ho, Kt] = E(""), Vt = k(() => {
3179
- const e = Gt.current;
3180
- e != null && e.parentNode && e.parentNode.removeChild(e), Gt.current = null;
3181
- }, []), sr = k((e) => {
3182
- var i;
3183
- const r = (i = Q.current) == null ? void 0 : i.querySelector(
3184
- ".redactor-in"
3185
- );
3186
- if (!r) return;
3187
- let o = Gt.current;
3188
- if (!o || !r.contains(o)) {
3189
- o = document.createElement("span"), o.setAttribute("data-rte-interim", ""), o.setAttribute("contenteditable", "false");
3190
- const s = window.getSelection();
3191
- if (s && s.rangeCount > 0 && r.contains(s.anchorNode)) {
3192
- const c = s.getRangeAt(0);
3193
- c.collapse(!1), c.insertNode(o);
3194
- } else
3195
- r.appendChild(o);
3196
- Gt.current = o;
3197
- }
3198
- o.textContent = e;
3199
- }, []), Wt = x(null), Xt = k((e = !1) => {
3200
- var r;
3201
- Wt.current && (Wt.current.keepLate = e), (r = At.current) == null || r.abort();
3202
- }, []), lr = k(() => {
3203
- var c;
3204
- if (typeof window > "u") return !1;
3205
- const e = window.getSelection(), r = (c = Q.current) == null ? void 0 : c.querySelector(".redactor-in");
3206
- if (!e || e.rangeCount === 0 || !r) return !1;
3207
- const { startContainer: o, startOffset: i } = e.getRangeAt(0);
3208
- if (!r.contains(o) || o.nodeType !== Node.TEXT_NODE || i === 0)
3209
- return !1;
3210
- const s = o.data.charAt(i - 1);
3211
- return /\S/.test(s) && s !== " ";
3212
- }, []), xe = T !== void 0 && !T.granted, Rn = x(null), Ut = k(() => {
3213
- if (!j || xe) return;
3214
- const e = new AbortController();
3215
- At.current = e;
3216
- const r = { keepLate: !1 };
3217
- Wt.current = r;
3218
- let o = !1;
3219
- const i = () => !o && (!e.signal.aborted || r.keepLate);
3220
- ar(!1), ir(!0), Kt(_("editor.ai.listening")), X && ut(), Vt(), j({
3221
- signal: e.signal,
3222
- // Interim text shows live in the editor (grey + caret); each final
3223
- // replaces it with committed text at the caret.
3224
- onPartialTranscript: (s) => {
3225
- i() && sr(s);
3226
- },
3227
- onFinalTranscript: (s) => {
3228
- if (!i()) return;
3229
- Vt();
3230
- const c = s.trim();
3231
- if (c) {
3232
- const v = Rn.current;
3233
- if (v) {
3234
- Rn.current = null, ye.current = v, be(), ue(`${c} `, { asHtml: !1 }), X && Ie(), Kt(c);
3235
- return;
3236
- }
3237
- const S = lr() ? " " : "";
3238
- ue(`${S}${c} `, { asHtml: !1 }), X && Ie(), Kt(c);
3239
- }
3240
- }
3241
- }).catch((s) => {
3242
- var c;
3243
- if (!(e.signal.aborted || s && typeof s == "object" && "name" in s && s.name === "AbortError")) {
3244
- if (Ur(s) && ((c = Ve.current) == null || c.call(Ve), yn.current)) {
3245
- vn(!0), Pe(!0);
3246
- return;
3247
- }
3248
- ar(!0);
3249
- }
3250
- }).finally(() => {
3251
- o = !0, Vt(), At.current === e && (At.current = null, Wt.current = null, ir(!1), Kt(""), X && !$e.current && mt());
3252
- });
3253
- }, [
3254
- j,
3255
- xe,
3256
- ue,
3257
- be,
3258
- Vt,
3259
- sr,
3260
- lr,
3261
- X,
3262
- ut,
3263
- Ie,
3264
- mt,
3265
- _
3266
- ]);
3267
- I(() => () => {
3268
- var e;
3269
- return (e = At.current) == null ? void 0 : e.abort();
3270
- }, []);
3271
- const [Zt, Nt] = E(null), Qe = x(null), Qt = x(null), [Oo, cr] = E(!1), Do = ((T == null ? void 0 : T.pending) ?? !1) || Oo, Jt = x(!1), Mn = k(() => {
3272
- Qe.current = null, Qt.current = null, Jt.current = !1, Nt(null);
3273
- }, []), qo = k(() => {
3274
- var r;
3275
- Jt.current = !0;
3276
- const e = (r = T == null ? void 0 : T.onGrant) == null ? void 0 : r.call(T);
3277
- e && typeof e.then == "function" && (cr(!0), Promise.resolve(e).catch(() => {
3278
- }).finally(() => cr(!1)));
3279
- }, [T]), dr = x((T == null ? void 0 : T.granted) ?? !0);
3280
- I(() => {
3281
- const e = dr.current;
3282
- if (dr.current = (T == null ? void 0 : T.granted) ?? !0, !e && (T != null && T.granted) && Qe.current) {
3283
- const r = Qe.current, o = Jt.current;
3284
- Qe.current = null, Jt.current = !1, Nt(null);
3285
- const i = Qt.current;
3286
- if (Qt.current = null, !o) return;
3287
- r === "write" ? Pe(!0) : r === "action" ? i == null || i() : (be(), Ut());
3288
- }
3289
- }, [T == null ? void 0 : T.granted, be, Ut]), I(() => {
3290
- xe && (Pe(!1), ke && Xt());
3291
- }, [xe, ke, Xt]);
3292
- const ur = k(
3293
- (e = "document") => {
3294
- if (ke) {
3295
- Xt(!0);
3296
- return;
3297
- }
3298
- dt();
3299
- const r = ye.current;
3300
- if (Rn.current = e === "selection" && r && !r.collapsed ? r.cloneRange() : null, xe) {
3301
- Qe.current = "dictate", Nt("dictate");
3302
- return;
3303
- }
3304
- Ut();
3305
- },
3306
- [ke, Xt, xe, dt, Ut]
3307
- ), mr = k(
3308
- (e = "document") => {
3309
- dt();
3310
- const r = ye.current, o = r ? r.cloneRange() : null, i = e === "selection" && !!(o && !o.collapsed);
3311
- if (o && !i && o.collapse(!1), Ht.current = o, vo(i ? "selection" : "document"), po(i && o ? o.toString() : ""), xe) {
3312
- Qe.current = "write", Nt("write");
3313
- return;
3314
- }
3315
- Pe(!0);
3316
- },
3317
- [dt, xe]
3318
- ), fr = gt(() => T != null && T.granted ? /* @__PURE__ */ C(De, { children: [
3319
- _(
3320
- "editor.ai.consentRecorded",
3321
- "AI assistance consent has been recorded."
3322
- ),
3323
- F ? /* @__PURE__ */ C(De, { children: [
3324
- " ",
3325
- F
3326
- ] }) : null
3327
- ] }) : F, [T, F, _]), [Je, zn] = E(null), [Po, Yt] = E(!1), [gr, hr] = E(!1), [Bo, Ye] = E(""), pr = x(null), $e = x(null), en = x(Te);
3328
- I(() => {
3329
- en.current = Te;
3330
- }, [Te]), I(() => {
3331
- X && (!ke && Je === null || Ze.state === null && ut());
3332
- }, [X, ke, Je, Ze.state, ut]);
3333
- const Tt = (e) => e.preventDefault(), br = k(
3334
- (e) => {
3335
- var o;
3336
- const r = te.current;
3337
- if (r)
3338
- try {
3339
- const i = r(H);
3340
- (o = i == null ? void 0 : i.broadcast) == null || o.call(i, "state", !1, e);
3341
- } catch {
3342
- }
3343
- },
3344
- [H]
3345
- ), vr = x(!1), et = k(
3346
- (e) => {
3347
- const r = te.current;
3348
- if (!r || vr.current === e) return;
3349
- vr.current = e;
3350
- const o = e || b;
3351
- It.current = o;
3352
- try {
3353
- r(H, o ? "enableReadOnly" : "disableReadOnly");
3354
- } catch {
3355
- }
3356
- },
3357
- [H, b]
3358
- ), Sn = k(
3359
- (e) => {
3360
- var o;
3361
- const r = bt(
3362
- Ae(e),
3363
- at.current
3364
- );
3365
- !de("source.setCode", r) && ee.current && (ee.current.value = r), (o = he.current) == null || o.call(he, { html: r, markdown: "" });
3366
- },
3367
- [de]
3368
- ), tt = k(
3369
- (e) => {
3370
- var s;
3371
- const r = (s = Q.current) == null ? void 0 : s.querySelector(".redactor-in"), o = typeof window < "u" ? window.getSelection() : null;
3372
- if (e === "selection" && r && o && o.rangeCount > 0 && !o.isCollapsed) {
3373
- const c = o.getRangeAt(0);
3374
- if (r.contains(c.commonAncestorContainer)) {
3375
- const v = c.toString();
3376
- if (v.trim())
3377
- return {
3378
- scope: "selection",
3379
- range: c.cloneRange(),
3380
- html: zs(c.cloneContents()),
3381
- text: v
3382
- };
3383
- }
3384
- }
3385
- const i = ce();
3386
- return { scope: "document", range: null, html: i, text: Zr(i) };
3387
- },
3388
- [ce]
3389
- ), Ln = k(
3390
- (e, r, o, i) => {
3391
- if ($e.current || !o.text.trim()) return;
3392
- const s = new AbortController();
3393
- $e.current = s, zn(e), hr(!1), pr.current = e, Ye(_("editor.ai.generating")), Yt(!1), X && ut();
3394
- const c = ce();
3395
- et(!0), Promise.resolve(
3396
- r({
3397
- html: o.html,
3398
- text: o.text,
3399
- scope: o.scope,
3400
- signal: s.signal
3401
- })
3402
- ).then((v) => {
3403
- var V;
3404
- if (s.signal.aborted) return;
3405
- et(!1);
3406
- const S = String(v ?? "");
3407
- if (ce() !== c) {
3408
- hr(!0), Ye("");
3409
- return;
3410
- }
3411
- if (!Zr(S)) {
3412
- Yt(!0), Ye("");
3413
- return;
3414
- }
3415
- if (br(c), o.scope === "selection" && o.range) {
3416
- if (!o.range.startContainer.isConnected) {
3417
- Yt(!0), Ye("");
3418
- return;
3419
- }
3420
- ye.current = o.range, be();
3421
- const ne = bt(
3422
- Ae(S),
3423
- at.current
3424
- );
3425
- de("insertion.insertHtml", ne) || ue(S, { asHtml: !0 });
3426
- } else
3427
- Sn(S);
3428
- X && Ie(), Ye(_("editor.ai.actionDone")), (V = en.current) == null || V.call(en, {
3429
- action: e,
3430
- template: i,
3431
- scope: o.scope,
3432
- previousHtml: c,
3433
- undo: () => Sn(c)
3434
- });
3435
- }).catch((v) => {
3436
- var S;
3437
- if (et(!1), !(s.signal.aborted || Ms(v))) {
3438
- if (Ur(v) && ((S = Ve.current) == null || S.call(Ve), yn.current)) {
3439
- vn(!0), Pe(!0);
3440
- return;
3441
- }
3442
- Yt(!0), Ye("");
3443
- }
3444
- }).finally(() => {
3445
- $e.current === s && ($e.current = null, et(!1), zn(null), mt());
3446
- });
3447
- },
3448
- [
3449
- X,
3450
- ut,
3451
- Ie,
3452
- mt,
3453
- et,
3454
- ce,
3455
- be,
3456
- de,
3457
- ue,
3458
- Sn,
3459
- br,
3460
- _
3461
- ]
3462
- ), Et = k(
3463
- (e, r, o, i) => {
3464
- if (xe) {
3465
- Qt.current = () => Ln(e, r, o, i), Qe.current = "action", Nt("action");
3466
- return;
3467
- }
3468
- Ln(e, r, o, i);
3469
- },
3470
- [xe, Ln]
3471
- ), yr = k(
3472
- (e, r) => {
3473
- const o = Y == null ? void 0 : Y.onRun;
3474
- o && Et(
3475
- "template",
3476
- (i) => o({ ...i, template: e }),
3477
- r,
3478
- e
3479
- );
3480
- },
3481
- [Y, Et]
3482
- ), wr = k(() => {
3483
- var e;
3484
- (e = $e.current) == null || e.abort(), $e.current = null, et(!1), zn(null), Ye(""), mt();
3485
- }, [et, mt]), kr = x(null);
3486
- I(() => {
3487
- const e = Je ?? pr.current;
3488
- if (!e) return;
3489
- const r = e === "template" ? "ai-templates" : `ai-${e}`, o = requestAnimationFrame(() => {
3490
- var s, c;
3491
- const i = document.activeElement;
3492
- i && i !== document.body && i.isConnected || (c = (s = kr.current) == null ? void 0 : s.querySelector(`[data-component-part="${r}"]`)) == null || c.focus();
3493
- });
3494
- return () => cancelAnimationFrame(o);
3495
- }, [Je]), I(() => () => {
3496
- var e;
3497
- return (e = $e.current) == null ? void 0 : e.abort();
3498
- }, []), I(() => {
3499
- const e = ee.current;
3500
- if (!e) return;
3501
- e.value = Co.current, _e.current();
3502
- const r = Is(q);
3503
- if (!r) {
3504
- Un(!0);
3505
- return;
3506
- }
3507
- if (te.current = r, e.value = bt(e.value, at.current), h === void 0 && (m == null ? void 0 : m.lang) === void 0 && r.addLang && r.lang) {
3508
- const v = `alfadocs-${Ge}`;
3509
- r.addLang(v, Or(_)), Se.current = v;
3510
- }
3511
- const o = {
3512
- lang: Se.current ?? h ?? Os(it.language || "en"),
3513
- // The kit renders its OWN toolbar (EditorToolbar) and drives Redactor
3514
- // via the command API, so Redactor's native toolbar is suppressed.
3515
- toolbar: !1,
3516
- plugins: u ?? [],
3517
- placeholder: g ?? _("editor.placeholder"),
3518
- toolbarFixed: !1,
3519
- // Platform parity (RedactorWysiwyg.js:84): no inline shortcode expansion.
3520
- shortcodes: !1,
3521
- // The kit owns image editing: ImageFloatingToolbar provides DS-native,
3522
- // keyboard-accessible resize + wrap/align, so Redactor's own image
3523
- // popup AND its single-handle drag-resizer are both disabled to avoid a
3524
- // second, untokenised, mouse-only UI competing with ours.
3525
- imageEditable: !1,
3526
- imageResizable: !1
3527
- }, i = L ? { imageUpload: L } : {}, s = (m == null ? void 0 : m.callbacks) ?? {}, c = {
3528
- ...o,
3529
- ...i,
3530
- ...m ?? {},
3531
- // Re-pin safety-critical keys LAST so consumer `options` can't override
3532
- // the sanitising change handler or re-enable Redactor's native image UI
3533
- // (the kit's ImageFloatingToolbar replaces both — see kitDefaults above).
3534
- imageEditable: !1,
3535
- imageResizable: !1,
3536
- callbacks: {
3537
- ...s,
3538
- changed(v) {
3539
- _e.current();
3540
- const S = sn(
3541
- Wr(Xr(v))
3542
- ), V = Ae(S), ne = Cr.current;
3543
- if (ne && Date.now() < ne.until && Qr(V) === ne.text) {
3544
- qt.current = V;
3545
- return;
3546
- }
3547
- V !== qt.current && (qt.current = V, mn.current = !0, he.current && (Ct.current && clearTimeout(Ct.current), Ct.current = setTimeout(() => {
3548
- var Ce;
3549
- (Ce = he.current) == null || Ce.call(he, { html: V, markdown: "" });
3550
- }, 100)));
3551
- },
3552
- keydown(v) {
3553
- var S;
3554
- (S = Pt.current) == null || S.call(Pt, v);
3555
- },
3556
- observe() {
3557
- we();
3558
- }
3559
- }
3560
- };
3561
- try {
3562
- if (r(H, c), qt.current = Ae(
3563
- sn(Wr(ce()))
3564
- ), _e.current(), b)
3565
- try {
3566
- r(H, "enableReadOnly");
3567
- } catch {
3568
- }
3569
- } catch {
3570
- Se.current && r.lang && delete r.lang[Se.current], Se.current = null, te.current = null, Un(!0);
3571
- }
3572
- return () => {
3573
- Ct.current && clearTimeout(Ct.current);
3574
- try {
3575
- r(H, "destroy");
3576
- } catch {
3577
- }
3578
- Se.current && r.lang && delete r.lang[Se.current], Se.current = null, te.current = null;
3579
- };
3580
- }, []), I(() => {
3581
- const e = te.current, r = Se.current;
3582
- if (!(!(e != null && e.addLang) || !r)) {
3583
- e.addLang(r, Or(_));
3584
- try {
3585
- e(H, "lang.rebuild", r);
3586
- } catch {
3587
- }
3588
- }
3589
- }, [_, it.language, H]);
3590
- const xr = x(ge), Cr = x(
3591
- null
3592
- );
3593
- I(() => {
3594
- var o, i;
3595
- if (xr.current === ge || (xr.current = ge, !te.current || ge.size === 0)) return;
3596
- const e = ce(), r = bt(e, ge);
3597
- if (r !== e) {
3598
- const s = (o = Q.current) == null ? void 0 : o.querySelector(".redactor-in"), v = s != null && s.contains(document.activeElement) && s ? Ss(s) : null;
3599
- Cr.current = {
3600
- text: Qr(e),
3601
- until: Date.now() + 1e3
3602
- }, de("source.setCode", r);
3603
- const S = (i = Q.current) == null ? void 0 : i.querySelector(".redactor-in");
3604
- v !== null && S && Ls(S, v);
3605
- }
3606
- window.requestAnimationFrame(() => _e.current());
3607
- }, [ge, ce, de]), I(() => {
3608
- if (!te.current || d === void 0) return;
3609
- if (mn.current) {
3610
- mn.current = !1;
3611
- return;
3612
- }
3613
- const e = bt(
3614
- Ae(sn(d)),
3615
- at.current
3616
- );
3617
- sn(ce()) !== e && de("source.setCode", e);
3618
- }, [d, ce, de]), I(() => {
3619
- It.current = b;
3620
- const e = te.current;
3621
- if (e)
3622
- try {
3623
- e(H, b ? "enableReadOnly" : "disableReadOnly");
3624
- } catch {
3625
- }
3626
- }, [b, H]), I(() => {
3627
- if (!fe || d === void 0) return;
3628
- const e = ee.current;
3629
- if (!e) return;
3630
- const r = Ae(d);
3631
- e.value !== r && document.activeElement !== e && (e.value = r);
3632
- }, [fe, d]);
3633
- const Be = gt(
3634
- () => ({
3635
- getHTML() {
3636
- return ce();
3637
- },
3638
- getText() {
3639
- return ce().replace(/<[^>]*>/g, " ").replace(/&nbsp;/gi, " ").replace(/\s+/g, " ").trim();
3640
- },
3641
- getMarkdown() {
3642
- return "";
3643
- },
3644
- isAiBusy() {
3645
- return $e.current !== null;
3646
- },
3647
- setContent(e) {
3648
- const r = Ae(e);
3649
- de(
3650
- "source.setCode",
3651
- bt(r, at.current)
3652
- ) || ee.current && (ee.current.value = r);
3653
- },
3654
- insertAtCursor: ue,
3655
- applyFormat(e) {
3656
- const r = $s[e];
3657
- r && Xe(...r);
3658
- },
3659
- focus() {
3660
- var r;
3661
- const e = te.current;
3662
- if (e)
3663
- try {
3664
- e(H, "editor.focus");
3665
- return;
3666
- } catch {
3667
- }
3668
- (r = ee.current) == null || r.focus();
3669
- },
3670
- clear() {
3671
- de("source.setCode", "") || ee.current && (ee.current.value = "");
3672
- }
3673
- }),
3674
- [H, ce, de, ue, Xe]
3675
- );
3676
- ri(me, () => Be, [Be]), ci(ja, Be, n);
3677
- const Fo = k(
3678
- (e) => {
3679
- var r;
3680
- _e.current(), (r = he.current) == null || r.call(he, {
3681
- html: Ae(e.target.value),
3682
- markdown: ""
3683
- });
3684
- },
3685
- []
3686
- ), tn = f ?? _("editor.regionLabel"), _n = m == null ? void 0 : m.placeholder, Rt = typeof _n == "string" || _n === !1 ? _n : g ?? _("editor.placeholder");
3687
- I(() => {
3688
- var i;
3689
- if (fe) return;
3690
- const e = (i = Q.current) == null ? void 0 : i.querySelector(".redactor-in");
3691
- if (!e) return;
3692
- const r = () => {
3693
- e.getAttribute("role") !== "textbox" && e.setAttribute("role", "textbox"), e.getAttribute("aria-multiline") !== "true" && e.setAttribute("aria-multiline", "true"), e.getAttribute("aria-label") !== tn && e.setAttribute("aria-label", tn), Rt === !1 ? e.hasAttribute("placeholder") && e.removeAttribute("placeholder") : e.getAttribute("placeholder") !== Rt && e.setAttribute("placeholder", Rt), e.hasAttribute("aria-labelledby") && e.removeAttribute("aria-labelledby");
3694
- };
3695
- r();
3696
- const o = new MutationObserver(r);
3697
- return o.observe(e, {
3698
- attributes: !0,
3699
- attributeFilter: ["role", "aria-labelledby", "placeholder"]
3700
- }), () => o.disconnect();
3701
- }, [fe, tn, Rt]);
3702
- const nn = Je !== null, jo = k(
3703
- (e) => {
3704
- On.test(e) && (fe ? ue(`[[${e}]]`, { asHtml: !1 }) : (be(), Ue(Jr(e))), se == null || se(e));
3705
- },
3706
- [
3707
- fe,
3708
- ue,
3709
- be,
3710
- Ue,
3711
- se
3712
- ]
3713
- ), In = x(null), [Go, Ko] = E(!1), [Vo, Wo] = E(!1), Xo = k(
3714
- (e, r) => {
3715
- if (Wo(e), !e) return;
3716
- const o = tt(r);
3717
- In.current = o, Ko(!o.text.trim());
3718
- },
3719
- [tt]
3720
- ), Uo = k(
3721
- (e) => {
3722
- const r = In.current ?? tt("document");
3723
- In.current = null, yr(e, r);
3724
- },
3725
- [tt, yr]
3726
- ), Ar = (e, r) => {
3727
- if (!r) return null;
3728
- const o = Je === e;
3729
- return {
3730
- key: e,
3731
- // While running, the segment becomes a Stop/Cancel button (progress
3732
- // shows on the scrim spinner).
3733
- icon: o ? /* @__PURE__ */ t(zt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : e === "proofread" ? /* @__PURE__ */ t($r, { "aria-hidden": "true", className: "ds:size-5" }) : /* @__PURE__ */ t(Hr, { "aria-hidden": "true", className: "ds:size-5" }),
3734
- label: o ? _("common.cancel") : e === "proofread" ? _("editor.ai.proofread", "Check spelling & grammar") : _("editor.ai.autoFormat", "Auto-format document"),
3735
- onClick: o ? wr : () => Et(e, r, tt("document")),
3736
- running: o
3737
- };
3738
- }, Me = zi(Ee), nt = [];
3739
- if (j && nt.push({
3740
- key: "dictate",
3741
- icon: ke ? /* @__PURE__ */ t(zt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(qn, { "aria-hidden": "true", className: "ds:size-5" }),
3742
- label: _(ke ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
3743
- onClick: () => ur("document"),
3744
- recording: ke
3745
- }), Y) {
3746
- const e = Je === "template";
3747
- nt.push({
3748
- key: "templates",
3749
- icon: e ? /* @__PURE__ */ t(zt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(Pn, { "aria-hidden": "true", className: "ds:size-5" }),
3750
- label: _(e ? "common.cancel" : "editor.ai.templates"),
3751
- onClick: e ? wr : void 0,
3752
- running: e,
3753
- menu: !e
3754
- });
3755
- }
3756
- const Nr = Ar("proofread", Z);
3757
- Nr && nt.push(Nr);
3758
- const Tr = Ar("format", pe);
3759
- Tr && nt.push(Tr), (U || B) && nt.push({
3760
- key: "write",
3761
- icon: /* @__PURE__ */ t(Ir, { "aria-hidden": "true", className: "ds:size-5" }),
3762
- label: _("editor.ai.helpMeWrite"),
3763
- onClick: () => mr("document")
3764
- });
3765
- const Er = (e, r) => Y ? /* @__PURE__ */ t(
3766
- xs,
3767
- {
3768
- side: r === "document" ? "top" : "bottom",
3769
- templates: Y.templates,
3770
- onPick: Uo,
3771
- onManage: Y.onManage,
3772
- noteEmpty: Go,
3773
- onOpenChange: (o) => Xo(o, r),
3774
- trigger: e
3775
- }
3776
- ) : null, Rr = (w ?? []).filter(
3777
- (e) => !e.contexts || N !== void 0 && e.contexts.includes(N)
3778
- );
3779
- I(() => {
3780
- (kt || Zt !== null || b) && Le(!1);
3781
- }, [kt, Zt, b, Le]), I(() => {
3782
- ve && !(w ?? []).some(
3783
- (e) => e.id === ve.extension.id && (!e.contexts || N !== void 0 && e.contexts.includes(N))
3784
- ) && Le();
3785
- }, [w, N, ve, Le]);
3786
- const Zo = (e) => {
3787
- var Ce, Fe;
3788
- if (gn) return;
3789
- bn(), Pe(!1), Mn();
3790
- const r = new AbortController();
3791
- xt.current = r;
3792
- const o = (Ce = ye.current) == null ? void 0 : Ce.cloneRange(), i = ee.current ? [
3793
- ee.current.selectionStart,
3794
- ee.current.selectionEnd
3795
- ] : null, s = (o == null ? void 0 : o.toString()) ?? (i ? (((Fe = ee.current) == null ? void 0 : Fe.value) ?? "").slice(...i) : "");
3796
- let c = !1;
3797
- const v = (re) => {
3798
- var He;
3799
- c || (c = !0, (He = $t.current) == null || He.call($t, e.id, re));
3800
- };
3801
- Ke.current = v;
3802
- const S = () => {
3803
- r.signal.aborted || (v({ status: "error" }), r.abort(), hn(!1), Qn(!0), pn());
3804
- }, V = async (re) => {
3805
- var ft;
3806
- if (r.signal.aborted) return;
3807
- let He = re.mode === "image" ? "" : re.html;
3808
- if (re.mode !== "text") {
3809
- const rt = await re.pngDataUri();
3810
- if (r.signal.aborted) return;
3811
- const Mt = await (await fetch(rt.dataUri, { signal: r.signal })).blob(), $n = await or(
3812
- new File([Mt], "extension-result.png", { type: "image/png" }),
3813
- r.signal
3814
- );
3815
- if (r.signal.aborted) return;
3816
- const Oe = document.createElement("img");
3817
- Oe.src = $n, Oe.alt = re.text, Oe.width = rt.width, Oe.height = rt.height, Oe.loading = "lazy", He += Oe.outerHTML;
3818
- }
3819
- r.signal.aborted || (o && (ye.current = o.cloneRange()), i && ((ft = ee.current) == null || ft.setSelectionRange(...i)), be(), ue(He, { asHtml: !0 }), v({ status: "success" }), Le());
3820
- }, ne = {
3821
- html: Be.getHTML(),
3822
- text: Be.getText(),
3823
- selectionText: s,
3824
- scope: s ? "selection" : "document",
3825
- signal: r.signal,
3826
- close: () => {
3827
- xt.current === r && Le();
3828
- },
3829
- insert: async (re) => {
3830
- try {
3831
- await V(re);
3832
- } catch {
3833
- S();
3834
- }
3835
- }
3836
- };
3837
- Zn({ extension: e, context: ne }), e.kind === "action" && (hn(!0), (async () => {
3838
- try {
3839
- if (!e.run) throw new Error("Missing extension run");
3840
- const re = await e.run(ne);
3841
- if (r.signal.aborted) return;
3842
- re ? await V(re) : (v({ status: "success" }), Le());
3843
- } catch {
3844
- S();
3845
- }
3846
- })());
3847
- }, Mr = mo.map(
3848
- (e) => Rr.filter(
3849
- (r) => {
3850
- var o;
3851
- return (((o = r.source) == null ? void 0 : o.kind) ?? "kit") === e;
3852
- }
3853
- )
3854
- ), Qo = Mr.every(
3855
- (e) => e.length > 0
3856
- ), Jo = Rr.length > 0 ? /* @__PURE__ */ t(
3857
- js,
3858
- {
3859
- groupedExtensions: Mr,
3860
- showExtensionGroups: Qo,
3861
- extensionPending: gn,
3862
- extensionSession: ve,
3863
- extensionError: fn,
3864
- openExtension: Zo,
3865
- closeExtension: Le,
3866
- saveSelection: dt,
3867
- closeSignal: fo,
3868
- restoreFocusOnCloseRef: Jn
3869
- }
3870
- ) : void 0, zr = !!(U || B), Sr = !!(Y || Z || pe || zr || j), Yo = !fe && !b && (ze ?? Sr), ei = k(
3871
- () => {
3872
- var e;
3873
- return ((e = Q.current) == null ? void 0 : e.querySelector(".redactor-in")) ?? null;
3874
- },
3875
- []
3876
- );
3877
- return /* @__PURE__ */ C(
3878
- "div",
3879
- {
3880
- ref: Q,
3881
- className: [Ds(), R].filter(Boolean).join(" "),
3882
- "data-component": "rich-text-editor",
3883
- "data-component-id": n,
3884
- "data-min-height": y,
3885
- children: [
3886
- !fe && !b ? /* @__PURE__ */ t(
3887
- Ts,
3888
- {
3889
- run: Xe,
3890
- active: Cn,
3891
- preset: p,
3892
- insertHtml: Ue,
3893
- insertTable: Io,
3894
- saveSelection: dt,
3895
- restoreSelection: be,
3896
- getSelectedText: Ro,
3897
- uploadImage: L || M ? or : void 0,
3898
- enableColor: (u == null ? void 0 : u.includes("fontcolor")) ?? !1,
3899
- enableImage: !!(L || M),
3900
- enableTable: (u == null ? void 0 : u.includes("table")) ?? !1,
3901
- showExtensions: A,
3902
- extensionControl: Jo,
3903
- variables: er,
3904
- recentVariableTokens: ae,
3905
- insertVariable: jo
3906
- }
3907
- ) : null,
3908
- /* @__PURE__ */ C("div", { className: "ds:relative", ref: wt, children: [
3909
- /* @__PURE__ */ t(
3910
- "textarea",
3911
- {
3912
- ref: ee,
3913
- id: Ge,
3914
- "aria-label": tn,
3915
- "aria-multiline": "true",
3916
- "aria-busy": nn || void 0,
3917
- placeholder: Rt || void 0,
3918
- onChange: fe ? Fo : void 0,
3919
- readOnly: fe ? b : void 0,
3920
- className: fe ? Ps() : void 0
3921
- }
3922
- ),
3923
- nn ? /* @__PURE__ */ t(
3924
- "div",
3925
- {
3926
- "aria-hidden": "true",
3927
- className: "ds:absolute ds:inset-0 ds:z-[5] ds:flex ds:items-center ds:justify-center ds:cursor-wait ds:rounded-[var(--radius-md)] ds:bg-[color-mix(in_srgb,var(--background)_40%,transparent)]",
3928
- children: /* @__PURE__ */ t(Kn, { size: "lg", variant: "prism" })
3929
- }
3930
- ) : null,
3931
- /* @__PURE__ */ C("div", { className: "ds:sticky ds:bottom-0 ds:z-10", children: [
3932
- nt.length > 0 ? /* @__PURE__ */ C(
3933
- "div",
3934
- {
3935
- ref: kr,
3936
- className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10",
3937
- "data-ai-sparkle": Ze.props["data-ai-sparkle"],
3938
- children: [
3939
- /* @__PURE__ */ C("div", { className: ai, children: [
3940
- nt.map((e, r) => {
3941
- const o = /* @__PURE__ */ t(
3942
- "button",
3943
- {
3944
- type: "button",
3945
- onClick: e.onClick,
3946
- "aria-pressed": e.recording || void 0,
3947
- "aria-busy": e.running || void 0,
3948
- "aria-haspopup": e.menu ? "menu" : void 0,
3949
- "data-component-part": `ai-${e.key}`,
3950
- disabled: nn && !e.running || void 0,
3951
- "aria-label": e.label,
3952
- className: e.recording ? Fs : Bs,
3953
- children: e.icon
3954
- }
3955
- );
3956
- return /* @__PURE__ */ C(vt, { children: [
3957
- r > 0 ? /* @__PURE__ */ t(
3958
- "span",
3959
- {
3960
- "aria-hidden": "true",
3961
- className: si
3962
- }
3963
- ) : null,
3964
- ht(
3965
- e.menu ? Er(o, "document") : o,
3966
- Me
3967
- )
3968
- ] }, e.key);
3969
- }),
3970
- Ze.state ? /* @__PURE__ */ t(
3971
- "span",
3972
- {
3973
- "aria-hidden": "true",
3974
- className: `${li} ${Ze.props.className}`
3975
- }
3976
- ) : null
3977
- ] }),
3978
- /* @__PURE__ */ t(ui, { state: Ze.state })
3979
- ]
3980
- }
3981
- ) : null,
3982
- /* @__PURE__ */ t(
3983
- Dn,
3984
- {
3985
- open: !!(ve && (!gn || fn)),
3986
- onClose: Le,
3987
- title: ve ? io(_, ve.extension.label) : void 0,
3988
- children: fn ? /* @__PURE__ */ t(oo, {}) : /* @__PURE__ */ t("div", { className: "ds:overflow-y-auto ds:[max-block-size:min(60dvh,calc(var(--rich-text-editor-min-block-size)*3))]", children: (_r = ve == null ? void 0 : (Lr = ve.extension).render) == null ? void 0 : _r.call(
3989
- Lr,
3990
- ve.context
3991
- ) })
3992
- }
3993
- ),
3994
- B ? B({
3995
- open: kt && !xe,
3996
- onClose: () => {
3997
- Pe(!1), vn(!1);
3998
- },
3999
- selectionText: ho,
4000
- scope: bo,
4001
- creditsExhausted: yo,
4002
- getHTML: Be.getHTML,
4003
- getText: Be.getText,
4004
- // All three write seams put AI output into the note, so
4005
- // each one is an action landing and sparkles the pill.
4006
- insertAtSelection: (e) => {
4007
- Ht.current && (ye.current = Ht.current.cloneRange()), be(), ue(e, { asHtml: !0 }), X && Ie();
4008
- },
4009
- insertAfterSelection: (e) => {
4010
- const r = Ht.current ?? ye.current;
4011
- if (r) {
4012
- const o = r.cloneRange();
4013
- o.collapse(!1), ye.current = o;
4014
- }
4015
- be(), ue(e, { asHtml: !0 }), X && Ie();
4016
- },
4017
- setContent: (e) => {
4018
- Be.setContent(e), X && Ie();
4019
- },
4020
- onDictate: j,
4021
- privacyNotice: fr
4022
- }) : U ? /* @__PURE__ */ t(
4023
- Ua,
4024
- {
4025
- open: kt && !xe,
4026
- onClose: () => Pe(!1),
4027
- onRequestAiDraft: U,
4028
- onInsert: (e) => {
4029
- be(), ue(e, { asHtml: O !== "text" }), X && Ie();
4030
- },
4031
- previewAsHtml: O !== "text",
4032
- privacyNotice: fr,
4033
- onDictate: j
4034
- }
4035
- ) : null,
4036
- T ? /* @__PURE__ */ t(
4037
- Dn,
4038
- {
4039
- open: Zt !== null,
4040
- onClose: Mn,
4041
- ariaLabel: _(
4042
- "editor.ai.consentRegionLabel",
4043
- "AI assistance consent for this document"
4044
- ),
4045
- footer: /* @__PURE__ */ t(Ne, { intent: "ghost", size: "sm", onClick: Mn, children: _("common.close") }),
4046
- children: /* @__PURE__ */ t(
4047
- mi,
4048
- {
4049
- granted: T.granted,
4050
- grantedAt: T.grantedAt,
4051
- grantedBy: T.grantedBy,
4052
- canGrant: (T.canGrant ?? !0) && T.onGrant !== void 0,
4053
- pending: Do,
4054
- onGrantConsent: qo,
4055
- headingLevel: J,
4056
- "aria-label": _(
4057
- "editor.ai.consentRegionLabel",
4058
- "AI assistance consent for this document"
4059
- )
4060
- }
4061
- )
4062
- }
4063
- ) : null
4064
- ] }),
4065
- !fe && !b && ((u == null ? void 0 : u.includes("table")) ?? !1) ? /* @__PURE__ */ t(
4066
- us,
4067
- {
4068
- active: Cn,
4069
- run: Xe,
4070
- areaRef: wt,
4071
- getActiveTableEl: Mo,
4072
- enableColor: (u == null ? void 0 : u.includes("fontcolor")) ?? !1,
4073
- saveTableCell: zo,
4074
- applyTableBackground: So
4075
- }
4076
- ) : null,
4077
- !fe && !b ? /* @__PURE__ */ t(
4078
- ks,
4079
- {
4080
- areaRef: wt,
4081
- activeImageEl: ko,
4082
- applyImageClass: Lo,
4083
- setImageWidth: _o
4084
- }
4085
- ) : null,
4086
- Yo ? /* @__PURE__ */ t(
4087
- Ns,
4088
- {
4089
- active: Cn,
4090
- run: Xe,
4091
- areaRef: wt,
4092
- getEditorRoot: ei,
4093
- suppressed: nn || kt || Zt !== null || ve !== null,
4094
- holdOpen: Vo,
4095
- children: Sr ? /* @__PURE__ */ C(De, { children: [
4096
- j ? ht(
4097
- /* @__PURE__ */ t(
4098
- W,
4099
- {
4100
- size: "sm",
4101
- intent: "ghost",
4102
- "data-component-part": "selection-ai-dictate",
4103
- onMouseDown: Tt,
4104
- icon: ke ? /* @__PURE__ */ t(zt, {}) : /* @__PURE__ */ t(qn, {}),
4105
- "aria-pressed": ke,
4106
- ...ln(
4107
- _(ke ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
4108
- !!Me
4109
- ),
4110
- onClick: () => ur("selection")
4111
- }
4112
- ),
4113
- Me
4114
- ) : null,
4115
- Y ? ht(
4116
- Er(
4117
- /* @__PURE__ */ t(
4118
- Ne,
4119
- {
4120
- size: "sm",
4121
- intent: "ghost",
4122
- "data-component-part": "selection-ai-templates",
4123
- onMouseDown: Tt,
4124
- startIcon: /* @__PURE__ */ t(Pn, {}),
4125
- endIcon: /* @__PURE__ */ t(Xn, {}),
4126
- children: _("editor.ai.templates")
4127
- }
4128
- ),
4129
- "selection"
4130
- ),
4131
- Me
4132
- ) : null,
4133
- Z ? ht(
4134
- /* @__PURE__ */ t(
4135
- W,
4136
- {
4137
- size: "sm",
4138
- intent: "ghost",
4139
- "data-component-part": "selection-ai-proofread",
4140
- onMouseDown: Tt,
4141
- icon: /* @__PURE__ */ t($r, {}),
4142
- ...ln(
4143
- _("editor.ai.proofread"),
4144
- !!Me
4145
- ),
4146
- onClick: () => Et(
4147
- "proofread",
4148
- Z,
4149
- tt("selection")
4150
- )
4151
- }
4152
- ),
4153
- Me
4154
- ) : null,
4155
- pe ? ht(
4156
- /* @__PURE__ */ t(
4157
- W,
4158
- {
4159
- size: "sm",
4160
- intent: "ghost",
4161
- "data-component-part": "selection-ai-format",
4162
- onMouseDown: Tt,
4163
- icon: /* @__PURE__ */ t(Hr, {}),
4164
- ...ln(
4165
- _("editor.ai.autoFormat"),
4166
- !!Me
4167
- ),
4168
- onClick: () => Et(
4169
- "format",
4170
- pe,
4171
- tt("selection")
4172
- )
4173
- }
4174
- ),
4175
- Me
4176
- ) : null,
4177
- zr ? ht(
4178
- /* @__PURE__ */ t(
4179
- W,
4180
- {
4181
- size: "sm",
4182
- intent: "ghost",
4183
- "data-component-part": "selection-ai-write",
4184
- onMouseDown: Tt,
4185
- icon: /* @__PURE__ */ t(Ir, {}),
4186
- ...ln(
4187
- _("editor.ai.helpMeWrite"),
4188
- !!Me
4189
- ),
4190
- onClick: () => mr("selection")
4191
- }
4192
- ),
4193
- Me
4194
- ) : null
4195
- ] }) : null
4196
- }
4197
- ) : null,
4198
- ct ? /* @__PURE__ */ t(
4199
- "div",
4200
- {
4201
- className: qs,
4202
- style: {
4203
- "--rte-typeahead-x": `${ct.left}px`,
4204
- "--rte-typeahead-y": `${ct.top}px`
4205
- },
4206
- children: /* @__PURE__ */ t(
4207
- eo,
4208
- {
4209
- ref: nr,
4210
- id: Tn,
4211
- variables: er,
4212
- recentTokens: ae,
4213
- query: ct.query,
4214
- onQueryChange: Eo,
4215
- onSelect: No,
4216
- onClose: To,
4217
- searchFocusable: !1,
4218
- onActiveDescendantChange: Ao
4219
- }
4220
- )
4221
- }
4222
- ) : null
4223
- ] }),
4224
- j ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: Ho }) : null,
4225
- lt.length > 0 ? /* @__PURE__ */ t(
4226
- "p",
4227
- {
4228
- id: `${Ge}-variables-error`,
4229
- role: "alert",
4230
- className: "ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
4231
- children: _("editor.variableInvalid", {
4232
- tokens: lt.map((e) => `[[${e}]]`).join(", ")
4233
- })
4234
- }
4235
- ) : null,
4236
- j && $o ? /* @__PURE__ */ t(
4237
- "p",
4238
- {
4239
- role: "alert",
4240
- className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
4241
- children: _("editor.ai.dictationError")
4242
- }
4243
- ) : null,
4244
- Y || Z || pe ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: Bo }) : null,
4245
- Po || gr ? /* @__PURE__ */ t(
4246
- "p",
4247
- {
4248
- role: "alert",
4249
- className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
4250
- children: _(gr ? "editor.ai.actionStale" : "editor.ai.actionError")
4251
- }
4252
- ) : null
4253
- ]
4254
- }
4255
- );
4256
- }
4257
- );
4258
- Gs.displayName = "RichTextEditor";
4259
- export {
4260
- Gs as R,
4261
- ja as r,
4262
- Ds as w
4263
- };
4264
- //# sourceMappingURL=rich-text-editor-DoCaj0qc.js.map