@alfadocs/ui-kit-debug 1.65.0 → 1.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/ai-credits-exhausted-notice-DfAgfZDF.js +287 -0
- package/dist/_chunks/ai-credits-exhausted-notice-DfAgfZDF.js.map +1 -0
- package/dist/_chunks/ai-credits-exhausted-notice.agent-DgTSTgez.js +43 -0
- package/dist/_chunks/ai-credits-exhausted-notice.agent-DgTSTgez.js.map +1 -0
- package/dist/_chunks/ai-credits-notice-DQ-r3iQU.js +191 -0
- package/dist/_chunks/ai-credits-notice-DQ-r3iQU.js.map +1 -0
- package/dist/_chunks/{ai-permission-notice-DpRmZ9Q3.js → ai-permission-notice-qsdm4Sx4.js} +2 -2
- package/dist/_chunks/{ai-permission-notice-DpRmZ9Q3.js.map → ai-permission-notice-qsdm4Sx4.js.map} +1 -1
- package/dist/_chunks/{alert-DdDpOi-P.js → alert-DjsJMGRE.js} +3 -2
- package/dist/_chunks/{alert-DdDpOi-P.js.map → alert-DjsJMGRE.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-BIfw890v.js → anamnesis-summary-rows-BQ_EokKz.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-BIfw890v.js.map → anamnesis-summary-rows-BQ_EokKz.js.map} +1 -1
- package/dist/_chunks/{audio-recorder-DR-u1qbl.js → audio-recorder-B11RR-rC.js} +2 -2
- package/dist/_chunks/{audio-recorder-DR-u1qbl.js.map → audio-recorder-B11RR-rC.js.map} +1 -1
- package/dist/_chunks/{auth-form-parts-Cmb41LSQ.js → auth-form-parts-DwUTH6YN.js} +2 -2
- package/dist/_chunks/{auth-form-parts-Cmb41LSQ.js.map → auth-form-parts-DwUTH6YN.js.map} +1 -1
- package/dist/_chunks/{booking-DkjatiXc.js → booking-tTVxKPQY.js} +2 -2
- package/dist/_chunks/{booking-DkjatiXc.js.map → booking-tTVxKPQY.js.map} +1 -1
- package/dist/_chunks/{calendar-workspace-Cp8yTZ1g.js → calendar-workspace-MRrzcxAy.js} +6 -6
- package/dist/_chunks/{calendar-workspace-Cp8yTZ1g.js.map → calendar-workspace-MRrzcxAy.js.map} +1 -1
- package/dist/_chunks/chart-CwmyCuWe.js +1340 -0
- package/dist/_chunks/chart-CwmyCuWe.js.map +1 -0
- package/dist/_chunks/{document-preview-B1dQm292.js → document-preview-VyQOjFVL.js} +2 -2
- package/dist/_chunks/{document-preview-B1dQm292.js.map → document-preview-VyQOjFVL.js.map} +1 -1
- package/dist/_chunks/{document-scanner-CVPVLK7z.js → document-scanner-CXH_GYh4.js} +2 -2
- package/dist/_chunks/{document-scanner-CVPVLK7z.js.map → document-scanner-CXH_GYh4.js.map} +1 -1
- package/dist/_chunks/{entity-summary-BQ9_KA8S.js → entity-summary-Bj-Wxq7Y.js} +2 -2
- package/dist/_chunks/{entity-summary-BQ9_KA8S.js.map → entity-summary-Bj-Wxq7Y.js.map} +1 -1
- package/dist/_chunks/{error-summary-DrUfuKu1.js → error-summary-PUE5Zxp9.js} +2 -2
- package/dist/_chunks/{error-summary-DrUfuKu1.js.map → error-summary-PUE5Zxp9.js.map} +1 -1
- package/dist/_chunks/{forgot-password-form-CgZkEvZy.js → forgot-password-form-CPOfRE0C.js} +4 -4
- package/dist/_chunks/{forgot-password-form-CgZkEvZy.js.map → forgot-password-form-CPOfRE0C.js.map} +1 -1
- package/dist/_chunks/{freemium-paywall-DKJHRFpp.js → freemium-paywall-6DO7noHX.js} +2 -2
- package/dist/_chunks/{freemium-paywall-DKJHRFpp.js.map → freemium-paywall-6DO7noHX.js.map} +1 -1
- package/dist/_chunks/heatmap-C1TeC7wT.js +3650 -0
- package/dist/_chunks/heatmap-C1TeC7wT.js.map +1 -0
- package/dist/_chunks/help-me-write-templates-Bw3Q58x-.js +687 -0
- package/dist/_chunks/help-me-write-templates-Bw3Q58x-.js.map +1 -0
- package/dist/_chunks/hourglass-BEAzW1wE.js +26 -0
- package/dist/_chunks/hourglass-BEAzW1wE.js.map +1 -0
- package/dist/_chunks/{login-dev-card-PnADNcI9.js → login-dev-card-A-CL3mjt.js} +3 -3
- package/dist/_chunks/{login-dev-card-PnADNcI9.js.map → login-dev-card-A-CL3mjt.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-C-2e4eCD.js → marketplace-app-shell-DtSX8sYb.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-C-2e4eCD.js.map → marketplace-app-shell-DtSX8sYb.js.map} +1 -1
- package/dist/_chunks/{notes-panel-uEGIL7mi.js → notes-panel-IdsmqRFC.js} +3 -3
- package/dist/_chunks/{notes-panel-uEGIL7mi.js.map → notes-panel-IdsmqRFC.js.map} +1 -1
- package/dist/_chunks/{patient-details-4P1vA9Ls.js → patient-details-C-EWQTms.js} +2 -2
- package/dist/_chunks/{patient-details-4P1vA9Ls.js.map → patient-details-C-EWQTms.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-CBXhlfGD.js → patient-field-row-lY-Tb5Mo.js} +155 -176
- package/dist/_chunks/patient-field-row-lY-Tb5Mo.js.map +1 -0
- package/dist/_chunks/{patient-search-DOnDUVsl.js → patient-search-DpAKidZ5.js} +2 -2
- package/dist/_chunks/{patient-search-DOnDUVsl.js.map → patient-search-DpAKidZ5.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-CuDLo8MP.js → patient-summary-card-Bpto_VCD.js} +2 -2
- package/dist/_chunks/{patient-summary-card-CuDLo8MP.js.map → patient-summary-card-Bpto_VCD.js.map} +1 -1
- package/dist/_chunks/{payment-automation-upsell-C8MEu0t6.js → payment-automation-upsell-BQ307qEX.js} +2 -2
- package/dist/_chunks/{payment-automation-upsell-C8MEu0t6.js.map → payment-automation-upsell-BQ307qEX.js.map} +1 -1
- package/dist/_chunks/{payment-form-C3dGY7v4.js → payment-form-XKtinW8r.js} +2 -2
- package/dist/_chunks/{payment-form-C3dGY7v4.js.map → payment-form-XKtinW8r.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-DJ9VN7cu.js → pdf-viewer-BvoVMjH4.js} +2 -2
- package/dist/_chunks/{pdf-viewer-DJ9VN7cu.js.map → pdf-viewer-BvoVMjH4.js.map} +1 -1
- package/dist/_chunks/{practice-results-8h2Utpt3.js → practice-results-BrUDDMXC.js} +2 -2
- package/dist/_chunks/{practice-results-8h2Utpt3.js.map → practice-results-BrUDDMXC.js.map} +1 -1
- package/dist/_chunks/{registration-form-BQyT_kBX.js → registration-form-BxwqUZzk.js} +3 -3
- package/dist/_chunks/{registration-form-BQyT_kBX.js.map → registration-form-BxwqUZzk.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-M2gT_E7f.js → rich-text-editor-aCIoptbg.js} +1653 -1743
- package/dist/_chunks/{rich-text-editor-M2gT_E7f.js.map → rich-text-editor-aCIoptbg.js.map} +1 -1
- package/dist/_chunks/{sign-document-CY7xTXbm.js → sign-document-D1P1nUQA.js} +2 -2
- package/dist/_chunks/{sign-document-CY7xTXbm.js.map → sign-document-D1P1nUQA.js.map} +1 -1
- package/dist/_chunks/{signature-request-BMCHy2ZO.js → signature-request-3u6TvRt2.js} +2 -2
- package/dist/_chunks/{signature-request-BMCHy2ZO.js.map → signature-request-3u6TvRt2.js.map} +1 -1
- package/dist/_chunks/{task-editor-CifOznfq.js → task-editor-Bb5MMcid.js} +2 -2
- package/dist/_chunks/{task-editor-CifOznfq.js.map → task-editor-Bb5MMcid.js.map} +1 -1
- package/dist/_chunks/{tasks-panel-8nLwBw6P.js → tasks-panel-BOb57Ysw.js} +2 -2
- package/dist/_chunks/{tasks-panel-8nLwBw6P.js.map → tasks-panel-BOb57Ysw.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-B-FEWbQM.js → use-appointment-details-read-CVSPoP5j.js} +4 -4
- package/dist/_chunks/{use-appointment-details-read-B-FEWbQM.js.map → use-appointment-details-read-CVSPoP5j.js.map} +1 -1
- package/dist/_chunks/voice-control-panel-BJIEbDq6.js +1148 -0
- package/dist/_chunks/voice-control-panel-BJIEbDq6.js.map +1 -0
- package/dist/_chunks/{warning-stack-HYWAytZV.js → warning-stack-BdY-0bd3.js} +2 -2
- package/dist/_chunks/{warning-stack-HYWAytZV.js.map → warning-stack-BdY-0bd3.js.map} +1 -1
- package/dist/_chunks/{workflow-map-C2B2qIr1.js → workflow-map-CYbRD9ek.js} +2 -2
- package/dist/_chunks/{workflow-map-C2B2qIr1.js.map → workflow-map-CYbRD9ek.js.map} +1 -1
- package/dist/agent-catalog.json +50 -3
- package/dist/agent-i18n/en.json +7 -4
- package/dist/components/_shared/use-apex-radial-centre.d.ts +7 -4
- package/dist/components/_shared/use-apex-radial-centre.d.ts.map +1 -1
- package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.agent.d.ts +4 -0
- package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.agent.d.ts.map +1 -0
- package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.d.ts +96 -0
- package/dist/components/ai-credits-notice/ai-credits-exhausted-notice.d.ts.map +1 -0
- package/dist/components/ai-credits-notice/ai-credits-notice.d.ts +30 -4
- package/dist/components/ai-credits-notice/ai-credits-notice.d.ts.map +1 -1
- package/dist/components/ai-credits-notice/index.d.ts +3 -0
- package/dist/components/ai-credits-notice/index.d.ts.map +1 -1
- package/dist/components/ai-credits-notice/index.js +10 -4
- package/dist/components/ai-credits-notice/index.js.map +1 -1
- package/dist/components/ai-permission-notice/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/error-summary/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/heatmap/heatmap-context.d.ts +3 -0
- package/dist/components/heatmap/heatmap-context.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap-disclosure.d.ts +67 -0
- package/dist/components/heatmap/heatmap-disclosure.d.ts.map +1 -0
- package/dist/components/heatmap/heatmap-format.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap-grid.d.ts +1 -1
- package/dist/components/heatmap/heatmap-grid.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap-legend.d.ts +5 -2
- package/dist/components/heatmap/heatmap-legend.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap-model.d.ts +107 -15
- package/dist/components/heatmap/heatmap-model.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap-table-view.d.ts +3 -2
- package/dist/components/heatmap/heatmap-table-view.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap.d.ts +33 -7
- package/dist/components/heatmap/heatmap.d.ts.map +1 -1
- package/dist/components/heatmap/index.d.ts +1 -1
- package/dist/components/heatmap/index.d.ts.map +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/voice-control-panel/index.d.ts +2 -1
- package/dist/components/voice-control-panel/index.d.ts.map +1 -1
- package/dist/components/voice-control-panel/index.js +1 -1
- package/dist/components/voice-control-panel/voice-control-panel.agent.d.ts.map +1 -1
- package/dist/components/voice-control-panel/voice-control-panel.d.ts +43 -3
- package/dist/components/voice-control-panel/voice-control-panel.d.ts.map +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +29 -12
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +29 -12
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +29 -12
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +29 -12
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +29 -12
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +29 -12
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +29 -12
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +29 -12
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +29 -12
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +29 -12
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +29 -12
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +29 -12
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +29 -12
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +29 -12
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +29 -12
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +29 -12
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +29 -12
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +29 -12
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +29 -12
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +29 -12
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +29 -12
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +29 -12
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +29 -12
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +29 -12
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +29 -12
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +29 -12
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +29 -12
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +29 -12
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +29 -12
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +29 -12
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +29 -12
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +29 -12
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +29 -12
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +29 -12
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +29 -12
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +29 -12
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +814 -809
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +29 -12
- package/dist/locales/de.json +29 -12
- package/dist/locales/el.json +29 -12
- package/dist/locales/en.json +29 -12
- package/dist/locales/es.json +29 -12
- package/dist/locales/fr.json +29 -12
- package/dist/locales/hi.json +29 -12
- package/dist/locales/it.json +29 -12
- package/dist/locales/ja.json +29 -12
- package/dist/locales/nl.json +29 -12
- package/dist/locales/pl.json +29 -12
- package/dist/locales/pt.json +29 -12
- package/dist/locales/ro.json +29 -12
- package/dist/locales/ru.json +29 -12
- package/dist/locales/sq.json +29 -12
- package/dist/locales/sv.json +29 -12
- package/dist/locales/tr.json +29 -12
- package/dist/locales/zh.json +29 -12
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/forgot-password-form/index.js +1 -1
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +6 -23
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -1
- package/dist/patterns/help-me-write-templates/index.js +8 -7
- package/dist/patterns/help-me-write-templates/index.js.map +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/ai-credits-notice-pK9BOmEz.js +0 -90
- package/dist/_chunks/ai-credits-notice-pK9BOmEz.js.map +0 -1
- package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js +0 -17
- package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js.map +0 -1
- package/dist/_chunks/chart-CIzXxNeM.js +0 -1322
- package/dist/_chunks/chart-CIzXxNeM.js.map +0 -1
- package/dist/_chunks/heatmap-BxRHM8Et.js +0 -2865
- package/dist/_chunks/heatmap-BxRHM8Et.js.map +0 -1
- package/dist/_chunks/help-me-write-templates-DFmqnsAa.js +0 -747
- package/dist/_chunks/help-me-write-templates-DFmqnsAa.js.map +0 -1
- package/dist/_chunks/patient-field-row-CBXhlfGD.js.map +0 -1
- package/dist/_chunks/voice-control-panel-C0BfY23Y.js +0 -1009
- package/dist/_chunks/voice-control-panel-C0BfY23Y.js.map +0 -1
|
@@ -1,747 +0,0 @@
|
|
|
1
|
-
import { jsxs as m, jsx as r, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
-
import { useState as b, useEffect as U, useId as ee, useRef as V, useCallback as L, useMemo as Y } from "react";
|
|
3
|
-
import { useTranslation as $ } from "react-i18next";
|
|
4
|
-
import { c as ce } from "./index-D2ZczOXr.js";
|
|
5
|
-
import { A as O } from "./alert-DdDpOi-P.js";
|
|
6
|
-
import { B as N } from "./button-D-MQxsA_.js";
|
|
7
|
-
import { I as B } from "./icon-button-C_1TgRiK.js";
|
|
8
|
-
import { D as x } from "./dialog-D6fkpRc4.js";
|
|
9
|
-
import { E as de } from "./editor-overlay-CpVO1-Kk.js";
|
|
10
|
-
import { E as me } from "./empty-state-pL1qum99.js";
|
|
11
|
-
import { F as Z } from "./form-field-Ani72sVY.js";
|
|
12
|
-
import { P as pe } from "./progress-D_g_Sl2g.js";
|
|
13
|
-
import { S as ue } from "./spinner-CoflYlEx.js";
|
|
14
|
-
import { T as se } from "./text-area-COMVJ1yE.js";
|
|
15
|
-
import { S as re } from "./state-backed-text-input-Cgh4ms3p.js";
|
|
16
|
-
import { SafeHtml as he } from "../safe-html/index.js";
|
|
17
|
-
import { T as ge } from "./trending-up-C_luYBzS.js";
|
|
18
|
-
import { A as fe } from "./astroid-BN4f5VXU.js";
|
|
19
|
-
import { A as ve } from "./arrow-left-BfaGqVam.js";
|
|
20
|
-
import { P as be } from "./pencil-B1sKKyuT.js";
|
|
21
|
-
import { T as Te } from "./trash-2-uumy3fy1.js";
|
|
22
|
-
import { P as Me } from "./plus-DzMQ_c6b.js";
|
|
23
|
-
import { X as te } from "./x-B5YnXwCz.js";
|
|
24
|
-
import { R as Ce } from "./rotate-ccw-BBQnIVTr.js";
|
|
25
|
-
import { S as We } from "./square-DASBRZ0U.js";
|
|
26
|
-
import { M as ye } from "./mic-CUklMZGF.js";
|
|
27
|
-
import { S as xe } from "./send-C5kDJ-Mz.js";
|
|
28
|
-
import { G as we } from "./grip-vertical-onSb1JXO.js";
|
|
29
|
-
class ae extends Error {
|
|
30
|
-
constructor(o = "AI credits exhausted") {
|
|
31
|
-
super(o), this.name = "AiCreditsExhaustedError";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const q = "ds:!size-[var(--min-target-size)]", Ne = `${q} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`, ke = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", K = "ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", De = "type-eyebrow ds:m-0 ds:text-[color:var(--muted-foreground)]", Ee = [
|
|
35
|
-
"ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
36
|
-
"ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
|
|
37
|
-
"ds:p-[var(--spacing-sm)] ds:[max-block-size:14rem] ds:overflow-y-auto",
|
|
38
|
-
"ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]",
|
|
39
|
-
"ds:[&_ul]:list-disc ds:[&_ul]:ps-[var(--spacing-md)]",
|
|
40
|
-
"ds:[&_h3]:font-medium ds:[&_h3]:[margin-block-start:var(--spacing-xs)]",
|
|
41
|
-
"ds:[&_p]:[margin-block-end:var(--spacing-xs)]",
|
|
42
|
-
"ds:[&>:first-child]:[margin-block-start:0]"
|
|
43
|
-
].join(" ");
|
|
44
|
-
function ne(e, o) {
|
|
45
|
-
return o ? e ? /\s$/.test(e) ? `${e}${o}` : `${e} ${o}` : o : e;
|
|
46
|
-
}
|
|
47
|
-
function ze(e) {
|
|
48
|
-
return typeof e == "object" && e !== null && "name" in e && e.name === "AbortError";
|
|
49
|
-
}
|
|
50
|
-
function Ie({
|
|
51
|
-
credits: e,
|
|
52
|
-
onBack: o
|
|
53
|
-
}) {
|
|
54
|
-
const { t: l, i18n: h } = $("ui"), f = e == null ? void 0 : e.limit, T = (e == null ? void 0 : e.remaining) ?? 0, a = f !== void 0 ? l("helpMeWriteTemplates.credits.remaining", { remaining: T, limit: f }) : void 0, t = e != null && e.resetsOn ? new Intl.DateTimeFormat(h.language, {
|
|
55
|
-
day: "numeric",
|
|
56
|
-
month: "long"
|
|
57
|
-
}).format(e.resetsOn) : void 0;
|
|
58
|
-
return /* @__PURE__ */ m(
|
|
59
|
-
"div",
|
|
60
|
-
{
|
|
61
|
-
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
62
|
-
"data-component": "ai-credits-exhausted-notice",
|
|
63
|
-
children: [
|
|
64
|
-
/* @__PURE__ */ m(O, { variant: "promo", icon: /* @__PURE__ */ r(fe, { "aria-hidden": "true" }), children: [
|
|
65
|
-
/* @__PURE__ */ r(O.Title, { as: "h2", children: l("helpMeWriteTemplates.credits.title") }),
|
|
66
|
-
/* @__PURE__ */ r(O.Description, { children: e != null && e.onBuyCredits ? t ? l("helpMeWriteTemplates.credits.bodyResets", { date: t }) : l("helpMeWriteTemplates.credits.body") : t ? l("helpMeWriteTemplates.credits.bodyWaitResets", {
|
|
67
|
-
date: t
|
|
68
|
-
}) : l("helpMeWriteTemplates.credits.bodyWait") }),
|
|
69
|
-
f !== void 0 && a ? /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]", children: [
|
|
70
|
-
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
71
|
-
/* @__PURE__ */ r("span", { className: "type-label", children: l("helpMeWriteTemplates.credits.meterLabel") }),
|
|
72
|
-
/* @__PURE__ */ r("span", { className: "type-label ds:ms-auto ds:tabular-nums", children: a })
|
|
73
|
-
] }),
|
|
74
|
-
/* @__PURE__ */ r(
|
|
75
|
-
pe,
|
|
76
|
-
{
|
|
77
|
-
value: Math.max(0, f - T),
|
|
78
|
-
max: f,
|
|
79
|
-
size: "sm",
|
|
80
|
-
ariaLabel: l("helpMeWriteTemplates.credits.meterLabel"),
|
|
81
|
-
ariaValueText: a
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
] }) : null,
|
|
85
|
-
e != null && e.onBuyCredits || e != null && e.onSeeCosts ? /* @__PURE__ */ m(O.Action, { children: [
|
|
86
|
-
e.onBuyCredits ? /* @__PURE__ */ r(
|
|
87
|
-
N,
|
|
88
|
-
{
|
|
89
|
-
intent: "tonal",
|
|
90
|
-
size: "sm",
|
|
91
|
-
startIcon: /* @__PURE__ */ r(ge, { "aria-hidden": "true" }),
|
|
92
|
-
onClick: e.onBuyCredits,
|
|
93
|
-
children: l("helpMeWriteTemplates.credits.cta")
|
|
94
|
-
}
|
|
95
|
-
) : null,
|
|
96
|
-
e.onSeeCosts ? /* @__PURE__ */ r(N, { intent: "link", size: "sm", onClick: e.onSeeCosts, children: l("helpMeWriteTemplates.credits.secondary") }) : null
|
|
97
|
-
] }) : null
|
|
98
|
-
] }),
|
|
99
|
-
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
100
|
-
o ? /* @__PURE__ */ r(N, { intent: "ghost", startIcon: /* @__PURE__ */ r(ve, {}), onClick: o, children: l("helpMeWriteTemplates.credits.back") }) : null,
|
|
101
|
-
/* @__PURE__ */ r("p", { className: K, children: l("helpMeWriteTemplates.credits.kept") })
|
|
102
|
-
] })
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
function Re({
|
|
108
|
-
context: e,
|
|
109
|
-
onGenerate: o,
|
|
110
|
-
onApplied: l,
|
|
111
|
-
credits: h,
|
|
112
|
-
enableDictation: f = !0,
|
|
113
|
-
suspendClose: T = !1
|
|
114
|
-
}) {
|
|
115
|
-
const { t: a } = $("ui"), { open: t } = e, k = ee(), s = ee(), [u, D] = b(""), [w, E] = b(!1), [z, i] = b(!1), [g, c] = b(!1), [C, I] = b(null), d = V(null), v = f ? e.onDictate : void 0, [W, S] = b(!1), [A, P] = b(""), [X, n] = b(""), y = V(null), R = L(() => {
|
|
116
|
-
var p;
|
|
117
|
-
return (p = y.current) == null ? void 0 : p.abort();
|
|
118
|
-
}, []), ie = L(() => {
|
|
119
|
-
if (W) {
|
|
120
|
-
R();
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (!v) return;
|
|
124
|
-
const p = new AbortController();
|
|
125
|
-
y.current = p, S(!0), n(a("helpMeWriteTemplates.bar.listening")), v({
|
|
126
|
-
signal: p.signal,
|
|
127
|
-
onPartialTranscript: (M) => {
|
|
128
|
-
p.signal.aborted || P(M);
|
|
129
|
-
},
|
|
130
|
-
onFinalTranscript: (M) => {
|
|
131
|
-
if (p.signal.aborted) return;
|
|
132
|
-
P("");
|
|
133
|
-
const H = M.trim();
|
|
134
|
-
H && (D((F) => ne(F, H)), n(H));
|
|
135
|
-
}
|
|
136
|
-
}).catch((M) => {
|
|
137
|
-
M instanceof ae && c(!0);
|
|
138
|
-
}).finally(() => {
|
|
139
|
-
P(""), y.current === p && (y.current = null, S(!1), n(""));
|
|
140
|
-
});
|
|
141
|
-
}, [W, v, R, a]);
|
|
142
|
-
U(() => {
|
|
143
|
-
var p, M;
|
|
144
|
-
t ? (D(""), E(!1), i(!1), c(e.creditsExhausted), I(null)) : ((p = d.current) == null || p.abort(), (M = y.current) == null || M.abort());
|
|
145
|
-
}, [t]), U(
|
|
146
|
-
() => () => {
|
|
147
|
-
var p, M;
|
|
148
|
-
(p = d.current) == null || p.abort(), (M = y.current) == null || M.abort();
|
|
149
|
-
},
|
|
150
|
-
[]
|
|
151
|
-
);
|
|
152
|
-
const Q = L(() => {
|
|
153
|
-
var H;
|
|
154
|
-
if (w || !u.trim()) return;
|
|
155
|
-
R(), (H = d.current) == null || H.abort();
|
|
156
|
-
const p = new AbortController();
|
|
157
|
-
d.current = p, i(!1), E(!0);
|
|
158
|
-
const M = e.scope === "selection";
|
|
159
|
-
o({
|
|
160
|
-
prompt: u.trim(),
|
|
161
|
-
sourceText: M ? e.selectionText : e.getText(),
|
|
162
|
-
scope: M ? "selection" : "document",
|
|
163
|
-
signal: p.signal
|
|
164
|
-
}).then((F) => {
|
|
165
|
-
p.signal.aborted || (I(F), E(!1));
|
|
166
|
-
}).catch((F) => {
|
|
167
|
-
p.signal.aborted || ze(F) || (F instanceof ae ? c(!0) : i(!0), E(!1));
|
|
168
|
-
});
|
|
169
|
-
}, [w, u, o, R]), { onClose: G } = e, le = L(() => {
|
|
170
|
-
T || G();
|
|
171
|
-
}, [T, G]), oe = () => {
|
|
172
|
-
if (C === null) return;
|
|
173
|
-
const p = e.getHTML();
|
|
174
|
-
e.insertAtSelection(C), e.onClose();
|
|
175
|
-
const { setContent: M } = e;
|
|
176
|
-
l == null || l({
|
|
177
|
-
mode: e.scope === "selection" ? "replace" : "insert",
|
|
178
|
-
previousHtml: p,
|
|
179
|
-
undo: () => M(p)
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
let j;
|
|
183
|
-
if (g)
|
|
184
|
-
j = /* @__PURE__ */ r(
|
|
185
|
-
Ie,
|
|
186
|
-
{
|
|
187
|
-
credits: h,
|
|
188
|
-
onBack: () => c(!1)
|
|
189
|
-
}
|
|
190
|
-
);
|
|
191
|
-
else if (C !== null)
|
|
192
|
-
j = /* @__PURE__ */ m(_, { children: [
|
|
193
|
-
/* @__PURE__ */ m(
|
|
194
|
-
"section",
|
|
195
|
-
{
|
|
196
|
-
"aria-labelledby": k,
|
|
197
|
-
className: "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
198
|
-
children: [
|
|
199
|
-
/* @__PURE__ */ r("h2", { id: k, className: De, children: a("helpMeWriteTemplates.bar.after") }),
|
|
200
|
-
/* @__PURE__ */ r(
|
|
201
|
-
he,
|
|
202
|
-
{
|
|
203
|
-
html: C,
|
|
204
|
-
profile: "rich-text",
|
|
205
|
-
className: Ee,
|
|
206
|
-
tabIndex: 0
|
|
207
|
-
}
|
|
208
|
-
)
|
|
209
|
-
]
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
213
|
-
/* @__PURE__ */ r(N, { intent: "ghost", startIcon: /* @__PURE__ */ r(te, {}), onClick: e.onClose, children: a("helpMeWriteTemplates.bar.discard") }),
|
|
214
|
-
/* @__PURE__ */ r(
|
|
215
|
-
N,
|
|
216
|
-
{
|
|
217
|
-
intent: "ghost",
|
|
218
|
-
startIcon: /* @__PURE__ */ r(Ce, {}),
|
|
219
|
-
onClick: () => {
|
|
220
|
-
I(null), Q();
|
|
221
|
-
},
|
|
222
|
-
children: a("helpMeWriteTemplates.bar.retry")
|
|
223
|
-
}
|
|
224
|
-
),
|
|
225
|
-
/* @__PURE__ */ r("span", { className: "ds:flex-1", "aria-hidden": "true" }),
|
|
226
|
-
/* @__PURE__ */ r(N, { intent: "primary", onClick: oe, children: e.scope === "selection" ? a("helpMeWriteTemplates.bar.replace") : a("helpMeWriteTemplates.bar.insert") })
|
|
227
|
-
] })
|
|
228
|
-
] });
|
|
229
|
-
else {
|
|
230
|
-
const p = W ? ne(u, A) : u;
|
|
231
|
-
j = /* @__PURE__ */ m(_, { children: [
|
|
232
|
-
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
233
|
-
/* @__PURE__ */ r(
|
|
234
|
-
B,
|
|
235
|
-
{
|
|
236
|
-
size: "md",
|
|
237
|
-
intent: "outline",
|
|
238
|
-
className: q,
|
|
239
|
-
icon: /* @__PURE__ */ r(te, {}),
|
|
240
|
-
"aria-label": a("helpMeWriteTemplates.bar.close"),
|
|
241
|
-
onClick: e.onClose
|
|
242
|
-
}
|
|
243
|
-
),
|
|
244
|
-
/* @__PURE__ */ r("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ r(
|
|
245
|
-
se,
|
|
246
|
-
{
|
|
247
|
-
size: "md",
|
|
248
|
-
value: p,
|
|
249
|
-
onChange: (M) => D(M.target.value),
|
|
250
|
-
placeholder: a("editor.ai.promptPlaceholder"),
|
|
251
|
-
"aria-label": a("editor.ai.promptLabel"),
|
|
252
|
-
autoResize: !0,
|
|
253
|
-
minRows: 1,
|
|
254
|
-
maxRows: 3,
|
|
255
|
-
readOnly: w || W,
|
|
256
|
-
tone: z ? "error" : "default",
|
|
257
|
-
"aria-describedby": z ? s : void 0
|
|
258
|
-
}
|
|
259
|
-
) }),
|
|
260
|
-
v ? /* @__PURE__ */ r(
|
|
261
|
-
B,
|
|
262
|
-
{
|
|
263
|
-
size: "md",
|
|
264
|
-
intent: "outline",
|
|
265
|
-
className: W ? `${q} ${ke}` : q,
|
|
266
|
-
icon: W ? /* @__PURE__ */ r(We, { className: "ds:fill-current" }) : /* @__PURE__ */ r(ye, {}),
|
|
267
|
-
"aria-pressed": W,
|
|
268
|
-
"aria-label": a(W ? "helpMeWriteTemplates.bar.dictateStop" : "helpMeWriteTemplates.bar.dictateStart"),
|
|
269
|
-
disabled: w,
|
|
270
|
-
onClick: ie
|
|
271
|
-
}
|
|
272
|
-
) : null,
|
|
273
|
-
/* @__PURE__ */ r(
|
|
274
|
-
B,
|
|
275
|
-
{
|
|
276
|
-
size: "md",
|
|
277
|
-
intent: "primary",
|
|
278
|
-
className: Ne,
|
|
279
|
-
icon: w ? /* @__PURE__ */ r(ue, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ r(xe, {}),
|
|
280
|
-
disabled: w || !u.trim(),
|
|
281
|
-
"aria-busy": w || void 0,
|
|
282
|
-
"aria-label": a("helpMeWriteTemplates.bar.write"),
|
|
283
|
-
onClick: Q
|
|
284
|
-
}
|
|
285
|
-
)
|
|
286
|
-
] }),
|
|
287
|
-
v ? /* @__PURE__ */ r("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: X }) : null,
|
|
288
|
-
z ? /* @__PURE__ */ r("p", { id: s, role: "alert", className: K, children: a("helpMeWriteTemplates.bar.error") }) : null,
|
|
289
|
-
/* @__PURE__ */ m("p", { className: K, children: [
|
|
290
|
-
e.scope === "selection" ? a("helpMeWriteTemplates.bar.contextSelection") : a("helpMeWriteTemplates.bar.contextDocument"),
|
|
291
|
-
" ",
|
|
292
|
-
e.privacyNotice
|
|
293
|
-
] })
|
|
294
|
-
] });
|
|
295
|
-
}
|
|
296
|
-
return /* @__PURE__ */ r(
|
|
297
|
-
de,
|
|
298
|
-
{
|
|
299
|
-
open: t,
|
|
300
|
-
onClose: le,
|
|
301
|
-
ariaLabel: a("editor.ai.helpMeWrite"),
|
|
302
|
-
children: /* @__PURE__ */ r("div", { className: "ds:contents", "data-component": "help-me-write-templates-bar", children: j })
|
|
303
|
-
}
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
const Se = ce("", {
|
|
307
|
-
variants: {
|
|
308
|
-
dragging: { true: "ds:opacity-60", false: "" },
|
|
309
|
-
dropTarget: {
|
|
310
|
-
true: "ds:outline-[length:var(--focus-ring-width)] ds:outline-dashed ds:outline-[var(--primary)] ds:outline-offset-[-2px]",
|
|
311
|
-
false: ""
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
defaultVariants: { dragging: !1, dropTarget: !1 }
|
|
315
|
-
});
|
|
316
|
-
function Ae(e, o) {
|
|
317
|
-
const { t: l } = $("ui"), [h, f] = b(null), [T, a] = b(null), [t, k] = b(""), s = V(!1), u = (i, g) => {
|
|
318
|
-
const c = Math.max(0, Math.min(e.length - 1, g));
|
|
319
|
-
if (!o || c === i) return;
|
|
320
|
-
const C = e.map((v) => v.id), [I] = C.splice(i, 1);
|
|
321
|
-
C.splice(c, 0, I), o(C), s.current = !s.current;
|
|
322
|
-
const d = l("helpMeWriteTemplates.manager.reorderAnnounce", {
|
|
323
|
-
label: e[i].name,
|
|
324
|
-
to: c + 1,
|
|
325
|
-
total: e.length
|
|
326
|
-
});
|
|
327
|
-
k(s.current ? d : `${d}`);
|
|
328
|
-
};
|
|
329
|
-
return { rowProps: (i) => o ? {
|
|
330
|
-
draggable: !0,
|
|
331
|
-
onDragStart: (g) => {
|
|
332
|
-
f(i), g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/plain", String(i));
|
|
333
|
-
},
|
|
334
|
-
onDragEnd: () => {
|
|
335
|
-
f(null), a(null);
|
|
336
|
-
},
|
|
337
|
-
onDragOver: (g) => {
|
|
338
|
-
h !== null && (g.preventDefault(), g.dataTransfer.dropEffect = "move", a(i));
|
|
339
|
-
},
|
|
340
|
-
onDragLeave: () => a(null),
|
|
341
|
-
onDrop: (g) => {
|
|
342
|
-
g.preventDefault();
|
|
343
|
-
const c = h;
|
|
344
|
-
f(null), a(null), c !== null && u(c, i);
|
|
345
|
-
}
|
|
346
|
-
} : {}, rowClass: (i) => Se({
|
|
347
|
-
dragging: h === i,
|
|
348
|
-
dropTarget: T === i && h !== i
|
|
349
|
-
}), handle: (i, g) => /* @__PURE__ */ r(
|
|
350
|
-
B,
|
|
351
|
-
{
|
|
352
|
-
size: "sm",
|
|
353
|
-
intent: "ghost",
|
|
354
|
-
icon: /* @__PURE__ */ r(we, { "aria-hidden": "true" }),
|
|
355
|
-
"aria-label": l("helpMeWriteTemplates.manager.reorderHandle", {
|
|
356
|
-
label: g
|
|
357
|
-
}),
|
|
358
|
-
className: "ds:cursor-grab ds:active:cursor-grabbing",
|
|
359
|
-
onKeyDown: (c) => {
|
|
360
|
-
if (!c.altKey) return;
|
|
361
|
-
const C = c.key === "ArrowUp" ? i - 1 : c.key === "ArrowDown" ? i + 1 : c.key === "Home" ? 0 : c.key === "End" ? e.length - 1 : null;
|
|
362
|
-
C !== null && (c.preventDefault(), u(i, C));
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
), liveRegion: /* @__PURE__ */ r("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: t }) };
|
|
366
|
-
}
|
|
367
|
-
const J = {
|
|
368
|
-
name: "",
|
|
369
|
-
description: "",
|
|
370
|
-
prompt: "",
|
|
371
|
-
submitted: !1
|
|
372
|
-
};
|
|
373
|
-
function Pe({
|
|
374
|
-
open: e,
|
|
375
|
-
onOpenChange: o,
|
|
376
|
-
initialMode: l = "list",
|
|
377
|
-
templates: h,
|
|
378
|
-
onSaveTemplate: f,
|
|
379
|
-
onDeleteTemplate: T,
|
|
380
|
-
onReorderTemplates: a
|
|
381
|
-
}) {
|
|
382
|
-
const { t } = $("ui"), k = Ae(h, a), [s, u] = b(null), [D, w] = b(!1), [E, z] = b(!1), [i, g] = b(null), [c, C] = b(!1), [I, d] = b(!1), v = async () => {
|
|
383
|
-
if (!(!i || c)) {
|
|
384
|
-
C(!0), d(!1);
|
|
385
|
-
try {
|
|
386
|
-
await (T == null ? void 0 : T(i.id)), g(null);
|
|
387
|
-
} catch {
|
|
388
|
-
d(!0);
|
|
389
|
-
} finally {
|
|
390
|
-
C(!1);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
U(() => {
|
|
395
|
-
e && (z(!1), u(l === "create" ? { ...J } : null));
|
|
396
|
-
}, [e]);
|
|
397
|
-
const W = (n, y) => h.some(
|
|
398
|
-
(R) => R.id !== y && R.name.toLowerCase() === n.toLowerCase()
|
|
399
|
-
), S = (() => {
|
|
400
|
-
if (!(s != null && s.submitted)) return;
|
|
401
|
-
const n = s.name.trim();
|
|
402
|
-
return n ? W(n, s.id) ? t("helpMeWriteTemplates.manager.nameTaken") : void 0 : t("helpMeWriteTemplates.manager.nameRequired");
|
|
403
|
-
})(), A = s != null && s.submitted && !s.prompt.trim() ? t("helpMeWriteTemplates.manager.promptRequired") : void 0, P = async () => {
|
|
404
|
-
if (!s || D) return;
|
|
405
|
-
const n = { ...s, submitted: !0 };
|
|
406
|
-
u(n);
|
|
407
|
-
const y = n.name.trim(), R = n.prompt.trim();
|
|
408
|
-
if (!(!y || !R || W(y, n.id))) {
|
|
409
|
-
w(!0), z(!1);
|
|
410
|
-
try {
|
|
411
|
-
await f({
|
|
412
|
-
id: n.id,
|
|
413
|
-
name: y,
|
|
414
|
-
description: n.description.trim() || void 0,
|
|
415
|
-
prompt: R
|
|
416
|
-
}), u(null);
|
|
417
|
-
} catch {
|
|
418
|
-
z(!0);
|
|
419
|
-
} finally {
|
|
420
|
-
w(!1);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}, X = s ? s.id ? t("helpMeWriteTemplates.manager.formEdit") : t("helpMeWriteTemplates.manager.formNew") : t("helpMeWriteTemplates.manager.title");
|
|
424
|
-
return /* @__PURE__ */ m(_, { children: [
|
|
425
|
-
/* @__PURE__ */ r(x, { open: e, onOpenChange: o, children: /* @__PURE__ */ r(x.Content, { size: "lg", children: /* @__PURE__ */ m("div", { className: "ds:contents", "data-component": "ai-template-manager", children: [
|
|
426
|
-
/* @__PURE__ */ m(x.Header, { children: [
|
|
427
|
-
/* @__PURE__ */ r(x.Title, { children: X }),
|
|
428
|
-
/* @__PURE__ */ r(x.Description, { children: t("helpMeWriteTemplates.manager.description") })
|
|
429
|
-
] }),
|
|
430
|
-
/* @__PURE__ */ m(x.Body, { children: [
|
|
431
|
-
s ? /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
|
|
432
|
-
E ? /* @__PURE__ */ r(O, { variant: "error", children: t("helpMeWriteTemplates.manager.saveError") }) : null,
|
|
433
|
-
/* @__PURE__ */ r(
|
|
434
|
-
Z,
|
|
435
|
-
{
|
|
436
|
-
label: t("helpMeWriteTemplates.manager.name"),
|
|
437
|
-
error: S,
|
|
438
|
-
required: !0,
|
|
439
|
-
children: /* @__PURE__ */ r(
|
|
440
|
-
re,
|
|
441
|
-
{
|
|
442
|
-
value: s.name,
|
|
443
|
-
maxLength: 100,
|
|
444
|
-
placeholder: t(
|
|
445
|
-
"helpMeWriteTemplates.manager.namePlaceholder"
|
|
446
|
-
),
|
|
447
|
-
onChange: (n) => u({ ...s, name: n.target.value })
|
|
448
|
-
}
|
|
449
|
-
)
|
|
450
|
-
}
|
|
451
|
-
),
|
|
452
|
-
/* @__PURE__ */ r(
|
|
453
|
-
Z,
|
|
454
|
-
{
|
|
455
|
-
label: t("helpMeWriteTemplates.manager.descLabel"),
|
|
456
|
-
description: t("helpMeWriteTemplates.manager.descHint"),
|
|
457
|
-
optional: !0,
|
|
458
|
-
children: /* @__PURE__ */ r(
|
|
459
|
-
re,
|
|
460
|
-
{
|
|
461
|
-
value: s.description,
|
|
462
|
-
maxLength: 120,
|
|
463
|
-
onChange: (n) => u({ ...s, description: n.target.value })
|
|
464
|
-
}
|
|
465
|
-
)
|
|
466
|
-
}
|
|
467
|
-
),
|
|
468
|
-
/* @__PURE__ */ r(
|
|
469
|
-
Z,
|
|
470
|
-
{
|
|
471
|
-
label: t("helpMeWriteTemplates.manager.prompt"),
|
|
472
|
-
description: t(
|
|
473
|
-
"helpMeWriteTemplates.manager.promptDescription"
|
|
474
|
-
),
|
|
475
|
-
error: A,
|
|
476
|
-
required: !0,
|
|
477
|
-
children: /* @__PURE__ */ r(
|
|
478
|
-
se,
|
|
479
|
-
{
|
|
480
|
-
value: s.prompt,
|
|
481
|
-
maxLength: 4e3,
|
|
482
|
-
autoResize: !0,
|
|
483
|
-
minRows: 4,
|
|
484
|
-
maxRows: 10,
|
|
485
|
-
onChange: (n) => u({ ...s, prompt: n.target.value })
|
|
486
|
-
}
|
|
487
|
-
)
|
|
488
|
-
}
|
|
489
|
-
)
|
|
490
|
-
] }) : h.length === 0 ? /* @__PURE__ */ r(
|
|
491
|
-
me,
|
|
492
|
-
{
|
|
493
|
-
variant: "first-use",
|
|
494
|
-
size: "sm",
|
|
495
|
-
title: t("helpMeWriteTemplates.manager.emptyTitle"),
|
|
496
|
-
description: t(
|
|
497
|
-
"helpMeWriteTemplates.manager.emptyDescription"
|
|
498
|
-
),
|
|
499
|
-
primaryAction: {
|
|
500
|
-
label: t("helpMeWriteTemplates.manager.new"),
|
|
501
|
-
onClick: () => u({ ...J })
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
) : /* @__PURE__ */ r(
|
|
505
|
-
"ul",
|
|
506
|
-
{
|
|
507
|
-
"aria-label": t("helpMeWriteTemplates.manager.listLabel"),
|
|
508
|
-
className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0",
|
|
509
|
-
children: h.map((n, y) => /* @__PURE__ */ m(
|
|
510
|
-
"li",
|
|
511
|
-
{
|
|
512
|
-
...k.rowProps(y),
|
|
513
|
-
className: `ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)] ds:p-[var(--spacing-sm)] ${k.rowClass(y)}`,
|
|
514
|
-
children: [
|
|
515
|
-
a ? k.handle(y, n.name) : null,
|
|
516
|
-
/* @__PURE__ */ m("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
|
|
517
|
-
/* @__PURE__ */ r("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: /* @__PURE__ */ r("span", { className: "type-title-item ds:text-[color:var(--foreground)]", children: n.name }) }),
|
|
518
|
-
/* @__PURE__ */ r("p", { className: `${K} ds:line-clamp-2`, children: n.description || n.prompt })
|
|
519
|
-
] }),
|
|
520
|
-
/* @__PURE__ */ r(
|
|
521
|
-
B,
|
|
522
|
-
{
|
|
523
|
-
size: "sm",
|
|
524
|
-
intent: "ghost",
|
|
525
|
-
icon: /* @__PURE__ */ r(be, {}),
|
|
526
|
-
"aria-label": t("helpMeWriteTemplates.manager.edit", {
|
|
527
|
-
name: n.name
|
|
528
|
-
}),
|
|
529
|
-
onClick: () => u({
|
|
530
|
-
id: n.id,
|
|
531
|
-
name: n.name,
|
|
532
|
-
description: n.description ?? "",
|
|
533
|
-
prompt: n.prompt,
|
|
534
|
-
submitted: !1
|
|
535
|
-
})
|
|
536
|
-
}
|
|
537
|
-
),
|
|
538
|
-
T ? /* @__PURE__ */ r(
|
|
539
|
-
B,
|
|
540
|
-
{
|
|
541
|
-
size: "sm",
|
|
542
|
-
intent: "ghost",
|
|
543
|
-
icon: /* @__PURE__ */ r(Te, {}),
|
|
544
|
-
"aria-label": t("helpMeWriteTemplates.manager.delete", {
|
|
545
|
-
name: n.name
|
|
546
|
-
}),
|
|
547
|
-
onClick: () => g(n)
|
|
548
|
-
}
|
|
549
|
-
) : null
|
|
550
|
-
]
|
|
551
|
-
},
|
|
552
|
-
n.id
|
|
553
|
-
))
|
|
554
|
-
}
|
|
555
|
-
),
|
|
556
|
-
k.liveRegion
|
|
557
|
-
] }),
|
|
558
|
-
/* @__PURE__ */ r(x.Footer, { children: s ? /* @__PURE__ */ m(_, { children: [
|
|
559
|
-
/* @__PURE__ */ r(N, { intent: "secondary", onClick: () => u(null), children: t("helpMeWriteTemplates.manager.cancel") }),
|
|
560
|
-
/* @__PURE__ */ r(
|
|
561
|
-
N,
|
|
562
|
-
{
|
|
563
|
-
intent: "primary",
|
|
564
|
-
loading: D,
|
|
565
|
-
onClick: () => void P(),
|
|
566
|
-
children: t("helpMeWriteTemplates.manager.save")
|
|
567
|
-
}
|
|
568
|
-
)
|
|
569
|
-
] }) : /* @__PURE__ */ m(_, { children: [
|
|
570
|
-
h.length > 0 ? /* @__PURE__ */ r(
|
|
571
|
-
N,
|
|
572
|
-
{
|
|
573
|
-
intent: "outline",
|
|
574
|
-
startIcon: /* @__PURE__ */ r(Me, {}),
|
|
575
|
-
onClick: () => u({ ...J }),
|
|
576
|
-
children: t("helpMeWriteTemplates.manager.new")
|
|
577
|
-
}
|
|
578
|
-
) : null,
|
|
579
|
-
/* @__PURE__ */ r(x.Close, { asChild: !0, children: /* @__PURE__ */ r(N, { intent: "primary", children: t("helpMeWriteTemplates.manager.done") }) })
|
|
580
|
-
] }) })
|
|
581
|
-
] }) }) }),
|
|
582
|
-
/* @__PURE__ */ r(
|
|
583
|
-
x,
|
|
584
|
-
{
|
|
585
|
-
open: i != null,
|
|
586
|
-
onOpenChange: (n) => {
|
|
587
|
-
!n && !c && (g(null), d(!1));
|
|
588
|
-
},
|
|
589
|
-
children: /* @__PURE__ */ m(x.Content, { size: "sm", variant: "alert", children: [
|
|
590
|
-
/* @__PURE__ */ m(x.Header, { children: [
|
|
591
|
-
/* @__PURE__ */ r(x.Title, { children: t("helpMeWriteTemplates.manager.deleteTitle", {
|
|
592
|
-
name: (i == null ? void 0 : i.name) ?? ""
|
|
593
|
-
}) }),
|
|
594
|
-
/* @__PURE__ */ r(x.Description, { children: t("helpMeWriteTemplates.manager.deleteDescription") })
|
|
595
|
-
] }),
|
|
596
|
-
I ? /* @__PURE__ */ r(x.Body, { children: /* @__PURE__ */ r(O, { variant: "error", children: t("helpMeWriteTemplates.manager.deleteError") }) }) : null,
|
|
597
|
-
/* @__PURE__ */ m(x.Footer, { children: [
|
|
598
|
-
/* @__PURE__ */ r(x.Close, { asChild: !0, children: /* @__PURE__ */ r(N, { intent: "secondary", disabled: c, children: t("helpMeWriteTemplates.manager.cancel") }) }),
|
|
599
|
-
/* @__PURE__ */ r(
|
|
600
|
-
N,
|
|
601
|
-
{
|
|
602
|
-
intent: "destructive",
|
|
603
|
-
loading: c,
|
|
604
|
-
onClick: () => void v(),
|
|
605
|
-
children: t("helpMeWriteTemplates.manager.deleteConfirm")
|
|
606
|
-
}
|
|
607
|
-
)
|
|
608
|
-
] })
|
|
609
|
-
] })
|
|
610
|
-
}
|
|
611
|
-
)
|
|
612
|
-
] });
|
|
613
|
-
}
|
|
614
|
-
function Le({
|
|
615
|
-
applied: e,
|
|
616
|
-
onUndo: o,
|
|
617
|
-
onDismiss: l
|
|
618
|
-
}) {
|
|
619
|
-
const { t: h } = $("ui"), f = V(null);
|
|
620
|
-
if (U(() => {
|
|
621
|
-
var a;
|
|
622
|
-
e && ((a = f.current) == null || a.focus());
|
|
623
|
-
}, [e]), !(e != null && e.template)) return null;
|
|
624
|
-
const T = e.template.name;
|
|
625
|
-
return /* @__PURE__ */ r(
|
|
626
|
-
O,
|
|
627
|
-
{
|
|
628
|
-
variant: "success",
|
|
629
|
-
dismissible: !0,
|
|
630
|
-
onOpenChange: (a) => {
|
|
631
|
-
a || l();
|
|
632
|
-
},
|
|
633
|
-
"data-component": "help-me-write-undo-notice",
|
|
634
|
-
children: /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
635
|
-
/* @__PURE__ */ r("span", { children: e.mode === "below" ? h("helpMeWriteTemplates.undo.addedBelow", { name: T }) : h("helpMeWriteTemplates.undo.replaced", { name: T }) }),
|
|
636
|
-
/* @__PURE__ */ r(N, { ref: f, intent: "outline", size: "sm", onClick: o, children: h("helpMeWriteTemplates.undo.undo") })
|
|
637
|
-
] })
|
|
638
|
-
}
|
|
639
|
-
);
|
|
640
|
-
}
|
|
641
|
-
function mr({
|
|
642
|
-
templates: e,
|
|
643
|
-
onGenerate: o,
|
|
644
|
-
onSaveTemplate: l,
|
|
645
|
-
onDeleteTemplate: h,
|
|
646
|
-
onReorderTemplates: f,
|
|
647
|
-
credits: T,
|
|
648
|
-
enableDictation: a,
|
|
649
|
-
onApplied: t,
|
|
650
|
-
creditsNotice: k
|
|
651
|
-
}) {
|
|
652
|
-
const [s, u] = b({ open: !1, mode: "list" }), [D, w] = b(null), E = L(
|
|
653
|
-
(d = "list") => u({ open: !0, mode: d }),
|
|
654
|
-
[]
|
|
655
|
-
), z = L(
|
|
656
|
-
(d) => /* @__PURE__ */ r(
|
|
657
|
-
Re,
|
|
658
|
-
{
|
|
659
|
-
context: d,
|
|
660
|
-
onGenerate: o,
|
|
661
|
-
credits: T,
|
|
662
|
-
enableDictation: a,
|
|
663
|
-
suspendClose: s.open,
|
|
664
|
-
onApplied: t
|
|
665
|
-
}
|
|
666
|
-
),
|
|
667
|
-
[o, T, a, s.open, t]
|
|
668
|
-
), i = Y(() => {
|
|
669
|
-
const d = new Map(e.map((v) => [v.id, v]));
|
|
670
|
-
return {
|
|
671
|
-
templates: e,
|
|
672
|
-
onRun: ({ template: v, text: W, scope: S, signal: A }) => {
|
|
673
|
-
const P = d.get(v.id);
|
|
674
|
-
return P ? o({
|
|
675
|
-
template: P,
|
|
676
|
-
prompt: "",
|
|
677
|
-
sourceText: W,
|
|
678
|
-
scope: S,
|
|
679
|
-
signal: A
|
|
680
|
-
}) : Promise.reject(new Error("Unknown template"));
|
|
681
|
-
},
|
|
682
|
-
onManage: l ? E : void 0
|
|
683
|
-
};
|
|
684
|
-
}, [e, o, l, E]), g = L(
|
|
685
|
-
(d) => {
|
|
686
|
-
if (d.action !== "template" || !d.template) return;
|
|
687
|
-
const v = e.find((S) => {
|
|
688
|
-
var A;
|
|
689
|
-
return S.id === ((A = d.template) == null ? void 0 : A.id);
|
|
690
|
-
}), W = {
|
|
691
|
-
mode: "replace",
|
|
692
|
-
template: v,
|
|
693
|
-
previousHtml: d.previousHtml,
|
|
694
|
-
undo: d.undo
|
|
695
|
-
};
|
|
696
|
-
w(v ? W : null), t == null || t(W);
|
|
697
|
-
},
|
|
698
|
-
[e, t]
|
|
699
|
-
), c = Y(
|
|
700
|
-
() => l ? /* @__PURE__ */ r(
|
|
701
|
-
Pe,
|
|
702
|
-
{
|
|
703
|
-
open: s.open,
|
|
704
|
-
initialMode: s.mode,
|
|
705
|
-
onOpenChange: (d) => u((v) => ({ ...v, open: d })),
|
|
706
|
-
templates: e,
|
|
707
|
-
onSaveTemplate: l,
|
|
708
|
-
onDeleteTemplate: h,
|
|
709
|
-
onReorderTemplates: f
|
|
710
|
-
}
|
|
711
|
-
) : null,
|
|
712
|
-
[s, e, l, h, f]
|
|
713
|
-
), C = /* @__PURE__ */ r(
|
|
714
|
-
Le,
|
|
715
|
-
{
|
|
716
|
-
applied: D,
|
|
717
|
-
onUndo: () => {
|
|
718
|
-
D == null || D.undo(), w(null);
|
|
719
|
-
},
|
|
720
|
-
onDismiss: () => w(null)
|
|
721
|
-
}
|
|
722
|
-
), I = Y(
|
|
723
|
-
() => ({
|
|
724
|
-
renderHelpMeWrite: z,
|
|
725
|
-
aiTemplates: i,
|
|
726
|
-
onAiApplied: g,
|
|
727
|
-
aiCreditsNotice: k
|
|
728
|
-
}),
|
|
729
|
-
[z, i, g, k]
|
|
730
|
-
);
|
|
731
|
-
return {
|
|
732
|
-
...I,
|
|
733
|
-
editorProps: I,
|
|
734
|
-
manager: c,
|
|
735
|
-
undoNotice: C,
|
|
736
|
-
openManager: E
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
export {
|
|
740
|
-
ae as A,
|
|
741
|
-
Re as H,
|
|
742
|
-
Ie as a,
|
|
743
|
-
Pe as b,
|
|
744
|
-
Le as c,
|
|
745
|
-
mr as u
|
|
746
|
-
};
|
|
747
|
-
//# sourceMappingURL=help-me-write-templates-DFmqnsAa.js.map
|