@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
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as S, useId as E } from "react";
|
|
3
|
+
import { c as x } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as A } from "react-i18next";
|
|
5
|
+
import { C as P, A as b } from "./alert-DjsJMGRE.js";
|
|
6
|
+
import { B as U } from "./button-D-MQxsA_.js";
|
|
7
|
+
import { P as _ } from "./progress-D_g_Sl2g.js";
|
|
8
|
+
import { f as j, n as F } from "./intl-locale-FWh-Y5_3.js";
|
|
9
|
+
import { T as H } from "./trending-up-C_luYBzS.js";
|
|
10
|
+
import { c as M } from "./createLucideIcon-DhHxpK9K.js";
|
|
11
|
+
import { A as k } from "./astroid-BN4f5VXU.js";
|
|
12
|
+
import { A as O } from "./arrow-left-BfaGqVam.js";
|
|
13
|
+
import { H as W } from "./hourglass-BEAzW1wE.js";
|
|
14
|
+
/**
|
|
15
|
+
* @license lucide-react v1.22.0 - ISC
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the ISC license.
|
|
18
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/
|
|
20
|
+
const G = [
|
|
21
|
+
[
|
|
22
|
+
"path",
|
|
23
|
+
{
|
|
24
|
+
d: "M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",
|
|
25
|
+
key: "12oyoe"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
["path", { d: "M21 16v2a4 4 0 0 1-4 4h-5", key: "1x7m43" }]
|
|
29
|
+
], q = M("headset", G), Z = 0.8;
|
|
30
|
+
function $(n) {
|
|
31
|
+
if (!n) return !1;
|
|
32
|
+
if (n.runningLow !== void 0) return n.runningLow;
|
|
33
|
+
const { remaining: i, limit: o } = n;
|
|
34
|
+
return i === void 0 || o === void 0 || o <= 0 ? !1 : i > 0 && o - i >= o * Z;
|
|
35
|
+
}
|
|
36
|
+
function J(n) {
|
|
37
|
+
return (n == null ? void 0 : n.renewsOn) ?? (n == null ? void 0 : n.resetsOn);
|
|
38
|
+
}
|
|
39
|
+
function V() {
|
|
40
|
+
const { i18n: n } = A("ui"), i = j(n.language), o = new Intl.NumberFormat(F(i), {
|
|
41
|
+
maximumFractionDigits: 1
|
|
42
|
+
}), g = new Intl.DateTimeFormat(i, {
|
|
43
|
+
day: "numeric",
|
|
44
|
+
month: "long",
|
|
45
|
+
year: "numeric"
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
number: (d) => o.format(d),
|
|
49
|
+
date: (d) => g.format(d)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const z = "ds:min-h-[var(--min-target-size)]", K = [
|
|
53
|
+
z,
|
|
54
|
+
"ds:!h-auto ds:!whitespace-normal ds:text-start ds:[overflow-wrap:anywhere]",
|
|
55
|
+
"ds:py-[var(--spacing-xs)]"
|
|
56
|
+
].join(" "), L = x(
|
|
57
|
+
[
|
|
58
|
+
"ds:inline-flex ds:items-center ds:min-h-[var(--min-target-size)]",
|
|
59
|
+
"ds:rounded-[var(--radius-sm)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-2xs)]",
|
|
60
|
+
"type-body-sm ds:font-medium ds:underline ds:underline-offset-2 ds:hover:no-underline ds:cursor-pointer",
|
|
61
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
62
|
+
"ds:forced-colors:text-[color:LinkText]"
|
|
63
|
+
].join(" "),
|
|
64
|
+
{
|
|
65
|
+
variants: {
|
|
66
|
+
tone: {
|
|
67
|
+
inherit: "ds:text-[color:inherit]",
|
|
68
|
+
link: "ds:text-[color:var(--link)]"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: { tone: "link" }
|
|
72
|
+
}
|
|
73
|
+
), Q = x(
|
|
74
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
|
|
75
|
+
), X = "ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Y = S(
|
|
76
|
+
({
|
|
77
|
+
credits: n,
|
|
78
|
+
onBack: i,
|
|
79
|
+
footnote: o,
|
|
80
|
+
headingLevel: g = 2,
|
|
81
|
+
announce: d,
|
|
82
|
+
className: l,
|
|
83
|
+
...m
|
|
84
|
+
}, f) => {
|
|
85
|
+
var R;
|
|
86
|
+
const { t: e } = A("ui"), u = V(), c = E(), t = n == null ? void 0 : n.limit, h = (n == null ? void 0 : n.remaining) ?? 0, p = t !== void 0 && t > 0 ? e("aiCredits.remaining", {
|
|
87
|
+
remaining: u.number(h),
|
|
88
|
+
limit: u.number(t)
|
|
89
|
+
}) : void 0, I = J(n), v = I ? u.date(I) : void 0, y = [
|
|
90
|
+
n != null && n.onBuyCredits ? {
|
|
91
|
+
key: "buy",
|
|
92
|
+
label: e("aiCredits.buy"),
|
|
93
|
+
icon: /* @__PURE__ */ a(H, { "aria-hidden": "true" }),
|
|
94
|
+
onClick: n.onBuyCredits
|
|
95
|
+
} : null,
|
|
96
|
+
n != null && n.onUpgrade ? {
|
|
97
|
+
key: "upgrade",
|
|
98
|
+
label: e("aiCredits.upgrade"),
|
|
99
|
+
icon: /* @__PURE__ */ a(P, { "aria-hidden": "true" }),
|
|
100
|
+
onClick: n.onUpgrade
|
|
101
|
+
} : null,
|
|
102
|
+
n != null && n.onContactSupport ? {
|
|
103
|
+
key: "support",
|
|
104
|
+
label: e("aiCredits.contactSupport"),
|
|
105
|
+
icon: /* @__PURE__ */ a(q, { "aria-hidden": "true" }),
|
|
106
|
+
onClick: n.onContactSupport
|
|
107
|
+
} : null
|
|
108
|
+
].filter((s) => s !== null), C = (R = y[0]) == null ? void 0 : R.key, B = C === "buy" ? e("aiCredits.bodyBuy") : C === "upgrade" ? e("aiCredits.bodyUpgrade") : C === "support" ? e("aiCredits.bodySupport") : v ? e("aiCredits.bodyRenews", { date: v }) : e("aiCredits.bodyNone"), T = C && v ? v : void 0;
|
|
109
|
+
return /* @__PURE__ */ r(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
...m,
|
|
113
|
+
ref: f,
|
|
114
|
+
"data-component": "ai-credits-exhausted-notice",
|
|
115
|
+
role: "group",
|
|
116
|
+
"aria-labelledby": c,
|
|
117
|
+
className: Q({ className: l }),
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ r(
|
|
120
|
+
b,
|
|
121
|
+
{
|
|
122
|
+
variant: "promo",
|
|
123
|
+
announce: d,
|
|
124
|
+
icon: /* @__PURE__ */ a(k, { "aria-hidden": "true" }),
|
|
125
|
+
className: "ds:[--ring:var(--promo-foreground)]",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ a(b.Title, { as: `h${g}`, id: c, children: e("aiCredits.title") }),
|
|
128
|
+
/* @__PURE__ */ a(b.Description, { children: B }),
|
|
129
|
+
T ? /* @__PURE__ */ a(
|
|
130
|
+
"p",
|
|
131
|
+
{
|
|
132
|
+
className: "ds:m-0 ds:[margin-block-start:var(--spacing-2xs)] type-body-sm",
|
|
133
|
+
"data-credits-renews": "",
|
|
134
|
+
children: e("aiCredits.renewsOn", { date: T })
|
|
135
|
+
}
|
|
136
|
+
) : null,
|
|
137
|
+
p && t !== void 0 ? /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]", children: [
|
|
138
|
+
/* @__PURE__ */ r("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
139
|
+
/* @__PURE__ */ a("span", { className: "type-label", children: e("aiCredits.meterLabel") }),
|
|
140
|
+
/* @__PURE__ */ a("span", { className: "type-label ds:ms-auto ds:tabular-nums", children: p })
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ a(
|
|
143
|
+
_,
|
|
144
|
+
{
|
|
145
|
+
value: Math.max(0, t - h),
|
|
146
|
+
max: t,
|
|
147
|
+
size: "sm",
|
|
148
|
+
ariaLabel: e("aiCredits.meterLabel"),
|
|
149
|
+
ariaValueText: p
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
] }) : null,
|
|
153
|
+
y.length > 0 || n != null && n.onSeeCosts ? /* @__PURE__ */ r(b.Action, { children: [
|
|
154
|
+
y.map(
|
|
155
|
+
(s, D) => D === 0 ? /* @__PURE__ */ a(
|
|
156
|
+
U,
|
|
157
|
+
{
|
|
158
|
+
intent: "tonal",
|
|
159
|
+
size: "md",
|
|
160
|
+
startIcon: s.icon,
|
|
161
|
+
onClick: s.onClick,
|
|
162
|
+
className: K,
|
|
163
|
+
"data-credits-action": s.key,
|
|
164
|
+
children: s.label
|
|
165
|
+
},
|
|
166
|
+
s.key
|
|
167
|
+
) : /* @__PURE__ */ a(
|
|
168
|
+
"button",
|
|
169
|
+
{
|
|
170
|
+
type: "button",
|
|
171
|
+
onClick: s.onClick,
|
|
172
|
+
className: L({ tone: "inherit" }),
|
|
173
|
+
"data-credits-action": s.key,
|
|
174
|
+
children: s.label
|
|
175
|
+
},
|
|
176
|
+
s.key
|
|
177
|
+
)
|
|
178
|
+
),
|
|
179
|
+
n != null && n.onSeeCosts ? /* @__PURE__ */ a(
|
|
180
|
+
"button",
|
|
181
|
+
{
|
|
182
|
+
type: "button",
|
|
183
|
+
onClick: n.onSeeCosts,
|
|
184
|
+
className: L({ tone: "inherit" }),
|
|
185
|
+
"data-credits-action": "costs",
|
|
186
|
+
children: e("aiCredits.seeCosts")
|
|
187
|
+
}
|
|
188
|
+
) : null
|
|
189
|
+
] }) : null
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
i || o ? /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
194
|
+
i ? /* @__PURE__ */ a(
|
|
195
|
+
U,
|
|
196
|
+
{
|
|
197
|
+
intent: "ghost",
|
|
198
|
+
startIcon: /* @__PURE__ */ a(O, {}),
|
|
199
|
+
flipIconInRtl: !0,
|
|
200
|
+
onClick: i,
|
|
201
|
+
className: z,
|
|
202
|
+
children: e("aiCredits.back")
|
|
203
|
+
}
|
|
204
|
+
) : null,
|
|
205
|
+
o ? /* @__PURE__ */ a("p", { className: X, children: o }) : null
|
|
206
|
+
] }) : null
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
Y.displayName = "AiCreditsExhaustedNotice";
|
|
213
|
+
const w = x(
|
|
214
|
+
"ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-xs)] type-body-sm",
|
|
215
|
+
{
|
|
216
|
+
variants: {
|
|
217
|
+
// Quiet: muted text and no tint, so it never competes with the
|
|
218
|
+
// promo notice. Out of credits reads in the body colour.
|
|
219
|
+
emphasis: {
|
|
220
|
+
quiet: "ds:text-[color:var(--muted-foreground)]",
|
|
221
|
+
plain: "ds:text-[color:var(--foreground)]"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
defaultVariants: { emphasis: "quiet" }
|
|
225
|
+
}
|
|
226
|
+
), nn = x(
|
|
227
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]"
|
|
228
|
+
), N = "ds:size-4 ds:shrink-0", an = S(({ credits: n, exhausted: i = !1, className: o, ...g }, d) => {
|
|
229
|
+
const { t: l } = A("ui"), m = V(), f = !i && $(n), e = n != null && n.expiring ? Math.round(n.expiring.amount * 10) / 10 : 0, u = !i && (n != null && n.expiring) && e > 0 ? n.expiring : void 0;
|
|
230
|
+
if (!i && !f && !u) return null;
|
|
231
|
+
const { remaining: c, limit: t } = n ?? {}, h = c !== void 0 && t !== void 0 && t > 0 ? l("aiCredits.runningLow", {
|
|
232
|
+
remaining: m.number(c),
|
|
233
|
+
limit: m.number(t)
|
|
234
|
+
}) : c !== void 0 ? l("aiCredits.runningLowCount", {
|
|
235
|
+
remaining: m.number(c)
|
|
236
|
+
}) : l("aiCredits.runningLowPlain"), p = n != null && n.onBuyCredits ? { label: l("aiCredits.buy"), onClick: n.onBuyCredits } : n != null && n.onUpgrade ? { label: l("aiCredits.upgrade"), onClick: n.onUpgrade } : void 0;
|
|
237
|
+
return /* @__PURE__ */ r(
|
|
238
|
+
"div",
|
|
239
|
+
{
|
|
240
|
+
...g,
|
|
241
|
+
ref: d,
|
|
242
|
+
"data-component": "ai-credits-warning",
|
|
243
|
+
className: nn({ className: o }),
|
|
244
|
+
children: [
|
|
245
|
+
i ? /* @__PURE__ */ r(
|
|
246
|
+
"p",
|
|
247
|
+
{
|
|
248
|
+
className: w({ emphasis: "plain" }),
|
|
249
|
+
"data-credits-line": "exhausted",
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ a(k, { "aria-hidden": "true", className: N }),
|
|
252
|
+
/* @__PURE__ */ a("span", { children: l("aiCredits.title") })
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
) : null,
|
|
256
|
+
f ? /* @__PURE__ */ r("p", { className: w(), "data-credits-line": "low", children: [
|
|
257
|
+
/* @__PURE__ */ a(k, { "aria-hidden": "true", className: N }),
|
|
258
|
+
/* @__PURE__ */ a("span", { children: h }),
|
|
259
|
+
p ? /* @__PURE__ */ a(
|
|
260
|
+
"button",
|
|
261
|
+
{
|
|
262
|
+
type: "button",
|
|
263
|
+
onClick: p.onClick,
|
|
264
|
+
className: L({ tone: "link" }),
|
|
265
|
+
children: p.label
|
|
266
|
+
}
|
|
267
|
+
) : null
|
|
268
|
+
] }) : null,
|
|
269
|
+
u ? /* @__PURE__ */ r("p", { className: w(), "data-credits-line": "expiring", children: [
|
|
270
|
+
/* @__PURE__ */ a(W, { "aria-hidden": "true", className: N }),
|
|
271
|
+
/* @__PURE__ */ a("span", { children: l("aiCredits.expiring", {
|
|
272
|
+
count: e,
|
|
273
|
+
amount: m.number(e),
|
|
274
|
+
date: m.date(u.date)
|
|
275
|
+
}) })
|
|
276
|
+
] }) : null
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
});
|
|
281
|
+
an.displayName = "AiCreditsWarning";
|
|
282
|
+
export {
|
|
283
|
+
Y as A,
|
|
284
|
+
an as a,
|
|
285
|
+
$ as i
|
|
286
|
+
};
|
|
287
|
+
//# sourceMappingURL=ai-credits-exhausted-notice-DfAgfZDF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-credits-exhausted-notice-DfAgfZDF.js","sources":["../../node_modules/lucide-react/dist/esm/icons/headset.mjs","../../src/components/ai-credits-notice/ai-credits-exhausted-notice.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z\",\n key: \"12oyoe\"\n }\n ],\n [\"path\", { d: \"M21 16v2a4 4 0 0 1-4 4h-5\", key: \"1x7m43\" }]\n];\nconst Headset = createLucideIcon(\"headset\", __iconNode);\n\nexport { __iconNode, Headset as default };\n//# sourceMappingURL=headset.mjs.map\n","import { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n ArrowLeft,\n Astroid,\n CircleArrowUp,\n Headset,\n Hourglass,\n TrendingUp,\n} from 'lucide-react';\nimport { Alert, type AlertAnnounce } from '../alert';\nimport { Button } from '../button';\nimport { Progress } from '../progress';\nimport { formatLocale, numberLocale } from '../_shared/intl-locale';\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsExhaustedNotice and AiCreditsWarning */\n/* */\n/* The practice's AI credits, as the platform keeps them: a yearly */\n/* allowance that comes with the AI credits module and expires at the */\n/* end of the subscription term, then welcome and bought credits that */\n/* never expire. The kit never talks to a backend: the host passes what */\n/* it knows (`AiCreditsInfo`) and the next steps it can offer. */\n/* */\n/* - `AiCreditsExhaustedNotice`: the out-of-credits state. A promo */\n/* Alert with the allowance meter and one clear next step. Promoted */\n/* from the help-me-write-templates pattern, which re-exports it. */\n/* - `AiCreditsWarning`: the quiet, non-blocking lines: running low */\n/* (80% used), credits expiring, or out of credits at rest. */\n/* */\n/* The hover card every AI trigger can carry is `AiCreditsNotice`, in */\n/* the sibling file. */\n/* -------------------------------------------------------------------- */\n\n/** Credits that expire soon: the platform's yearly allowance at the end of\n * the subscription term. Welcome and bought credits never expire. */\nexport interface AiCreditsExpiring {\n /** How many credits expire. */\n amount: number;\n /** When they expire. */\n date: Date;\n}\n\n/** The practice's AI credits and the next steps the host can offer. All\n * optional: the kit shows only what it is given. */\nexport interface AiCreditsInfo {\n /** Credits left. */\n remaining?: number;\n /** The allowance `remaining` counts down from, for the meter. */\n limit?: number;\n /**\n * When a new allowance starts: \"renews on\". On the platform, the yearly\n * allowance at the subscription's renewal. Omit when it will not renew.\n */\n renewsOn?: Date;\n /** @deprecated Use `renewsOn`. Read the same way, as a renewal date. */\n resetsOn?: Date;\n /**\n * Credits that expire soon: \"expire on\". `AiCreditsWarning` shows it as\n * a quiet line; the out-of-credits notice never does (nothing is left to\n * expire).\n */\n expiring?: AiCreditsExpiring;\n /**\n * Shows the running-low line in `AiCreditsWarning`. Default: true when\n * 80% or more of `limit` is used and some credit is left. A host whose\n * balance mixes the yearly allowance with welcome or bought credits\n * passes it itself: 80% of one `limit` does not describe that balance.\n */\n runningLow?: boolean;\n /**\n * Shows a \"Buy AI credits\" button. Omit while the practice cannot buy\n * credits (on the platform, without the module and the pack page).\n */\n onBuyCredits?: () => void;\n /**\n * Shows an \"Enable the AI credits module\" button: the upgrade path for a\n * practice without the module.\n */\n onUpgrade?: () => void;\n /** Shows a \"Contact support\" button. */\n onContactSupport?: () => void;\n /** Shows a \"See what each action costs\" link. */\n onSeeCosts?: () => void;\n}\n\n/** Heading levels the notice title accepts. */\nexport type AiCreditsHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** Share of `limit` used at which credits count as running low. */\nconst RUNNING_LOW_USED = 0.8;\n\n/** Whether `credits` are running low: the host's `runningLow`, else 80% or\n * more of `limit` used with some credit left. */\nexport function isAiCreditsRunningLow(credits?: AiCreditsInfo): boolean {\n if (!credits) return false;\n if (credits.runningLow !== undefined) return credits.runningLow;\n const { remaining, limit } = credits;\n if (remaining === undefined || limit === undefined || limit <= 0) {\n return false;\n }\n return remaining > 0 && limit - remaining >= limit * RUNNING_LOW_USED;\n}\n\n/** The renewal date, from `renewsOn` or the older `resetsOn`. */\nfunction renewalDate(credits?: AiCreditsInfo): Date | undefined {\n return credits?.renewsOn ?? credits?.resetsOn;\n}\n\n/** The kit's number and date formatting for the active UI language.\n * Credits can be fractional on the platform (0.1 is the minimum cost). */\nfunction useCreditsFormat() {\n const { i18n } = useTranslation('ui');\n const locale = formatLocale(i18n.language);\n const numbers = new Intl.NumberFormat(numberLocale(locale), {\n maximumFractionDigits: 1,\n });\n const dates = new Intl.DateTimeFormat(locale, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n });\n return {\n number: (value: number) => numbers.format(value),\n date: (value: Date) => dates.format(value),\n };\n}\n\n// The kit's target size (44px, 48px in the accessible themes) on every\n// control, at every width. On a size `md` Button: size `sm` drops its\n// minimum height from 640px up.\nconst TARGET = 'ds:min-h-[var(--min-target-size)]';\n\n// The lead step's label wraps instead of truncating: a long translation\n// (\"Das KI-Guthaben-Modul aktivieren\") never loses words in a narrow\n// panel. The Button's own height and nowrap give way; the target stays.\nconst WRAPPING_LABEL = [\n TARGET,\n 'ds:!h-auto ds:!whitespace-normal ds:text-start ds:[overflow-wrap:anywhere]',\n 'ds:py-[var(--spacing-xs)]',\n].join(' ');\n\n// The text links: the notice's secondary steps and the quiet line's step.\n// Native buttons at the target size with the kit focus ring. `inherit`\n// takes the promo Alert's own text colour, which holds AA on its gradient\n// (the Button `link` intent's `--primary` does not); `link` is the `--link`\n// token, which holds AA on the card and popover surfaces in every theme,\n// as in AgendaTray's footer link.\nconst textLinkVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:min-h-[var(--min-target-size)]',\n 'ds:rounded-[var(--radius-sm)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-2xs)]',\n 'type-body-sm ds:font-medium ds:underline ds:underline-offset-2 ds:hover:no-underline ds:cursor-pointer',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:text-[color:LinkText]',\n ].join(' '),\n {\n variants: {\n tone: {\n inherit: 'ds:text-[color:inherit]',\n link: 'ds:text-[color:var(--link)]',\n },\n },\n defaultVariants: { tone: 'link' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsExhaustedNotice */\n/* -------------------------------------------------------------------- */\n\nconst noticeRootVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]',\n);\n\nconst metaClass =\n 'ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]';\n\nexport interface AiCreditsExhaustedNoticeProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /** The allowance and the next steps the host can offer. */\n credits?: AiCreditsInfo;\n /** Shows a Back button under the notice. */\n onBack?: () => void;\n /** A quiet line under the notice, beside Back: what the user keeps. */\n footnote?: ReactNode;\n /** Heading level of the title. Default 2. */\n headingLevel?: AiCreditsHeadingLevel;\n /**\n * How the notice is announced when it appears. Default: the promo\n * Alert's polite status. Pass `'off'` when the host announces it.\n */\n announce?: AlertAnnounce;\n}\n\n/**\n * The out-of-credits state: what happened, the allowance, and the next\n * step. The first of buy, enable the module and contact support the host\n * passes is the main button; any others follow as links. With none, it\n * says when AI comes back, or plainly that it is unavailable and how to\n * get help: never a dead end.\n */\nexport const AiCreditsExhaustedNotice = forwardRef<\n HTMLDivElement,\n AiCreditsExhaustedNoticeProps\n>(\n (\n {\n credits,\n onBack,\n footnote,\n headingLevel = 2,\n announce,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const format = useCreditsFormat();\n const titleId = useId();\n const limit = credits?.limit;\n const remaining = credits?.remaining ?? 0;\n // A limit of 0 (a host still loading) would divide by zero in the meter.\n const remainingText =\n limit !== undefined && limit > 0\n ? t('aiCredits.remaining', {\n remaining: format.number(remaining),\n limit: format.number(limit),\n })\n : undefined;\n const renews = renewalDate(credits);\n const renewsText = renews ? format.date(renews) : undefined;\n\n // The first next step the host offers leads; the rest follow as links.\n const steps = [\n credits?.onBuyCredits\n ? {\n key: 'buy',\n label: t('aiCredits.buy'),\n icon: <TrendingUp aria-hidden=\"true\" />,\n onClick: credits.onBuyCredits,\n }\n : null,\n credits?.onUpgrade\n ? {\n key: 'upgrade',\n label: t('aiCredits.upgrade'),\n icon: <CircleArrowUp aria-hidden=\"true\" />,\n onClick: credits.onUpgrade,\n }\n : null,\n credits?.onContactSupport\n ? {\n key: 'support',\n label: t('aiCredits.contactSupport'),\n icon: <Headset aria-hidden=\"true\" />,\n onClick: credits.onContactSupport,\n }\n : null,\n ].filter((step) => step !== null);\n const lead = steps[0]?.key;\n\n // The body names the lead step. Without one, it says when AI comes\n // back, or that it is unavailable and how to get help.\n const body =\n lead === 'buy'\n ? t('aiCredits.bodyBuy')\n : lead === 'upgrade'\n ? t('aiCredits.bodyUpgrade')\n : lead === 'support'\n ? t('aiCredits.bodySupport')\n : renewsText\n ? t('aiCredits.bodyRenews', { date: renewsText })\n : t('aiCredits.bodyNone');\n // With a next step, the renewal date is a line of its own.\n const renewsLine = lead && renewsText ? renewsText : undefined;\n\n return (\n <div\n {...rest}\n ref={ref}\n // After `rest`: the marker always wins over a caller's attribute.\n data-component=\"ai-credits-exhausted-notice\"\n // Named by its title, so a host that moves focus here (the\n // VoiceControlPanel does) has it read from the title.\n role=\"group\"\n aria-labelledby={titleId}\n className={noticeRootVariants({ className })}\n >\n <Alert\n variant=\"promo\"\n announce={announce}\n icon={<Astroid aria-hidden=\"true\" />}\n // The focus ring takes the promo text colour, which holds 3:1 on\n // the promo tint in every theme (`--ring` does not on dark).\n className=\"ds:[--ring:var(--promo-foreground)]\"\n >\n <Alert.Title as={`h${headingLevel}` as const} id={titleId}>\n {t('aiCredits.title')}\n </Alert.Title>\n <Alert.Description>{body}</Alert.Description>\n {renewsLine ? (\n <p\n className=\"ds:m-0 ds:[margin-block-start:var(--spacing-2xs)] type-body-sm\"\n data-credits-renews=\"\"\n >\n {t('aiCredits.renewsOn', { date: renewsLine })}\n </p>\n ) : null}\n {remainingText && limit !== undefined ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label\">{t('aiCredits.meterLabel')}</span>\n <span className=\"type-label ds:ms-auto ds:tabular-nums\">\n {remainingText}\n </span>\n </div>\n <Progress\n value={Math.max(0, limit - remaining)}\n max={limit}\n size=\"sm\"\n ariaLabel={t('aiCredits.meterLabel')}\n ariaValueText={remainingText}\n />\n </div>\n ) : null}\n {steps.length > 0 || credits?.onSeeCosts ? (\n <Alert.Action>\n {steps.map((step, index) =>\n index === 0 ? (\n <Button\n key={step.key}\n intent=\"tonal\"\n size=\"md\"\n startIcon={step.icon}\n onClick={step.onClick}\n className={WRAPPING_LABEL}\n data-credits-action={step.key}\n >\n {step.label}\n </Button>\n ) : (\n <button\n key={step.key}\n type=\"button\"\n onClick={step.onClick}\n className={textLinkVariants({ tone: 'inherit' })}\n data-credits-action={step.key}\n >\n {step.label}\n </button>\n ),\n )}\n {credits?.onSeeCosts ? (\n <button\n type=\"button\"\n onClick={credits.onSeeCosts}\n className={textLinkVariants({ tone: 'inherit' })}\n data-credits-action=\"costs\"\n >\n {t('aiCredits.seeCosts')}\n </button>\n ) : null}\n </Alert.Action>\n ) : null}\n </Alert>\n {onBack || footnote ? (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n {onBack ? (\n <Button\n intent=\"ghost\"\n startIcon={<ArrowLeft />}\n flipIconInRtl\n onClick={onBack}\n className={TARGET}\n >\n {t('aiCredits.back')}\n </Button>\n ) : null}\n {footnote ? <p className={metaClass}>{footnote}</p> : null}\n </div>\n ) : null}\n </div>\n );\n },\n);\nAiCreditsExhaustedNotice.displayName = 'AiCreditsExhaustedNotice';\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsWarning */\n/* -------------------------------------------------------------------- */\n\nconst warningLineVariants = cva(\n 'ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-xs)] type-body-sm',\n {\n variants: {\n // Quiet: muted text and no tint, so it never competes with the\n // promo notice. Out of credits reads in the body colour.\n emphasis: {\n quiet: 'ds:text-[color:var(--muted-foreground)]',\n plain: 'ds:text-[color:var(--foreground)]',\n },\n },\n defaultVariants: { emphasis: 'quiet' },\n },\n);\n\nconst warningRootVariants = cva(\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]',\n);\n\nconst warningIconClass = 'ds:size-4 ds:shrink-0';\n\nexport interface AiCreditsWarningProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /** The allowance, the expiring credits and the next steps. */\n credits?: AiCreditsInfo;\n /**\n * Out of credits: one quiet line saying so, instead of the running-low\n * and expiring lines. The full notice is `AiCreditsExhaustedNotice`.\n */\n exhausted?: boolean;\n}\n\n/**\n * The quiet, non-blocking credit lines: running low (with the buy or\n * upgrade step as a link) and credits expiring, or out of credits at rest.\n * Renders nothing when none applies.\n */\nexport const AiCreditsWarning = forwardRef<\n HTMLDivElement,\n AiCreditsWarningProps\n>(({ credits, exhausted = false, className, ...rest }, ref) => {\n const { t } = useTranslation('ui');\n const format = useCreditsFormat();\n const low = !exhausted && isAiCreditsRunningLow(credits);\n // Rounded as it is shown, so the plural matches the figure (\"1 AI\n // credit\", never \"1 AI credits\" for 0.96).\n const expiringAmount = credits?.expiring\n ? Math.round(credits.expiring.amount * 10) / 10\n : 0;\n const expiring =\n !exhausted && credits?.expiring && expiringAmount > 0\n ? credits.expiring\n : undefined;\n if (!exhausted && !low && !expiring) return null;\n\n const { remaining, limit } = credits ?? {};\n const lowText =\n remaining !== undefined && limit !== undefined && limit > 0\n ? t('aiCredits.runningLow', {\n remaining: format.number(remaining),\n limit: format.number(limit),\n })\n : remaining !== undefined\n ? t('aiCredits.runningLowCount', {\n remaining: format.number(remaining),\n })\n : t('aiCredits.runningLowPlain');\n // Before the wall, the way to more credits: buy, else enable the module.\n const step = credits?.onBuyCredits\n ? { label: t('aiCredits.buy'), onClick: credits.onBuyCredits }\n : credits?.onUpgrade\n ? { label: t('aiCredits.upgrade'), onClick: credits.onUpgrade }\n : undefined;\n\n return (\n <div\n {...rest}\n ref={ref}\n data-component=\"ai-credits-warning\"\n className={warningRootVariants({ className })}\n >\n {exhausted ? (\n <p\n className={warningLineVariants({ emphasis: 'plain' })}\n data-credits-line=\"exhausted\"\n >\n <Astroid aria-hidden=\"true\" className={warningIconClass} />\n <span>{t('aiCredits.title')}</span>\n </p>\n ) : null}\n {low ? (\n <p className={warningLineVariants()} data-credits-line=\"low\">\n <Astroid aria-hidden=\"true\" className={warningIconClass} />\n <span>{lowText}</span>\n {step ? (\n <button\n type=\"button\"\n onClick={step.onClick}\n className={textLinkVariants({ tone: 'link' })}\n >\n {step.label}\n </button>\n ) : null}\n </p>\n ) : null}\n {expiring ? (\n <p className={warningLineVariants()} data-credits-line=\"expiring\">\n <Hourglass aria-hidden=\"true\" className={warningIconClass} />\n <span>\n {t('aiCredits.expiring', {\n count: expiringAmount,\n amount: format.number(expiringAmount),\n date: format.date(expiring.date),\n })}\n </span>\n </p>\n ) : null}\n </div>\n );\n});\nAiCreditsWarning.displayName = 'AiCreditsWarning';\n"],"names":["__iconNode","Headset","createLucideIcon","RUNNING_LOW_USED","isAiCreditsRunningLow","credits","remaining","limit","renewalDate","useCreditsFormat","i18n","useTranslation","locale","formatLocale","numbers","numberLocale","dates","value","TARGET","WRAPPING_LABEL","textLinkVariants","cva","noticeRootVariants","metaClass","AiCreditsExhaustedNotice","forwardRef","onBack","footnote","headingLevel","announce","className","rest","ref","t","format","titleId","useId","remainingText","renews","renewsText","steps","jsx","TrendingUp","CircleArrowUp","step","lead","_a","body","renewsLine","jsxs","Alert","Astroid","Progress","index","Button","ArrowLeft","warningLineVariants","warningRootVariants","warningIconClass","AiCreditsWarning","exhausted","low","expiringAmount","expiring","lowText","Hourglass"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,6BAA6B,KAAK,SAAQ,CAAE;AAC5D,GACMC,IAAUC,EAAiB,WAAWF,CAAU,GCwEhDG,IAAmB;AAIlB,SAASC,EAAsBC,GAAkC;AACtE,MAAI,CAACA,EAAS,QAAO;AACrB,MAAIA,EAAQ,eAAe,OAAW,QAAOA,EAAQ;AACrD,QAAM,EAAE,WAAAC,GAAW,OAAAC,EAAA,IAAUF;AAC7B,SAAIC,MAAc,UAAaC,MAAU,UAAaA,KAAS,IACtD,KAEFD,IAAY,KAAKC,IAAQD,KAAaC,IAAQJ;AACvD;AAGA,SAASK,EAAYH,GAA2C;AAC9D,UAAOA,KAAA,gBAAAA,EAAS,cAAYA,KAAA,gB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,KAAuB,qBAAkB,YACrD,UAAA;AAAA,UAAA,gBAAAf,EAACwB,GAAA,EAAU,eAAY,QAAO,WAAWP,GAAkB;AAAA,UAC3D,gBAAAjB,EAAC,QAAA,EACE,UAAAR,EAAE,sBAAsB;AAAA,YACvB,OAAO6B;AAAA,YACP,QAAQ5B,EAAO,OAAO4B,CAAc;AAAA,YACpC,MAAM5B,EAAO,KAAK6B,EAAS,IAAI;AAAA,UAAA,CAChC,EAAA,CACH;AAAA,QAAA,EAAA,CACF,IACE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDJ,GAAiB,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
id: "ai-credits-notice",
|
|
3
|
+
capabilities: [],
|
|
4
|
+
state: {},
|
|
5
|
+
actions: {},
|
|
6
|
+
domHooks: {
|
|
7
|
+
root: {
|
|
8
|
+
attr: "data-component",
|
|
9
|
+
value: "ai-credits-notice",
|
|
10
|
+
description: 'Marks the element as a kit AiCreditsNotice card body. Carries a sibling `data-mode="included|bundles"` attribute for which notice is showing.'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}, i = {
|
|
14
|
+
id: "ai-credits-exhausted-notice",
|
|
15
|
+
capabilities: [],
|
|
16
|
+
state: {},
|
|
17
|
+
actions: {},
|
|
18
|
+
domHooks: {
|
|
19
|
+
root: {
|
|
20
|
+
attr: "data-component",
|
|
21
|
+
value: "ai-credits-exhausted-notice",
|
|
22
|
+
description: 'Marks the out-of-credits notice. Each next-step button carries `data-credits-action="buy|upgrade|support|costs"`.'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, e = {
|
|
26
|
+
id: "ai-credits-warning",
|
|
27
|
+
capabilities: [],
|
|
28
|
+
state: {},
|
|
29
|
+
actions: {},
|
|
30
|
+
domHooks: {
|
|
31
|
+
root: {
|
|
32
|
+
attr: "data-component",
|
|
33
|
+
value: "ai-credits-warning",
|
|
34
|
+
description: 'Marks the quiet credit lines. Each line carries `data-credits-line="low|expiring|exhausted"`.'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
i as a,
|
|
40
|
+
t as b,
|
|
41
|
+
e as c
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=ai-credits-exhausted-notice.agent-DgTSTgez.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-credits-exhausted-notice.agent-DgTSTgez.js","sources":["../../src/components/ai-credits-notice/ai-credits-notice.agent.ts","../../src/components/ai-credits-notice/ai-credits-exhausted-notice.agent.ts"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — AiCreditsNotice. */\n/* */\n/* Pure presentation: the body of a hover card explaining whether AI is */\n/* free today ('included') or metered ('bundles'). Its actions */\n/* (`onLearnMore` / `onViewBundles` / `onSeeCosts`) are host-supplied */\n/* seams with no return value, so the kit exposes only the DOM hooks a */\n/* future runtime would click through — no imperative handle to register. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\n\nexport const aiCreditsNoticeAgent: AgentAdapter = {\n id: 'ai-credits-notice',\n capabilities: [],\n state: {},\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'ai-credits-notice',\n description:\n 'Marks the element as a kit AiCreditsNotice card body. Carries a ' +\n 'sibling `data-mode=\"included|bundles\"` attribute for which notice is showing.',\n },\n },\n};\n","/* -------------------------------------------------------------------- */\n/* Agent adapters: AiCreditsExhaustedNotice and AiCreditsWarning. */\n/* */\n/* Pure presentation. Their buttons (buy credits, enable the module, */\n/* contact support, see costs, Back) are host-supplied seams with no */\n/* return value that take the user somewhere else, so the kit registers */\n/* no imperative handle: an agent never buys or upgrades on the user's */\n/* behalf. Only the DOM hooks a runtime would read are declared. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\n\nexport const aiCreditsExhaustedNoticeAgent: AgentAdapter = {\n id: 'ai-credits-exhausted-notice',\n capabilities: [],\n state: {},\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'ai-credits-exhausted-notice',\n description:\n 'Marks the out-of-credits notice. Each next-step button carries ' +\n '`data-credits-action=\"buy|upgrade|support|costs\"`.',\n },\n },\n};\n\nexport const aiCreditsWarningAgent: AgentAdapter = {\n id: 'ai-credits-warning',\n capabilities: [],\n state: {},\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'ai-credits-warning',\n description:\n 'Marks the quiet credit lines. Each line carries ' +\n '`data-credits-line=\"low|expiring|exhausted\"`.',\n },\n },\n};\n"],"names":["aiCreditsNoticeAgent","aiCreditsExhaustedNoticeAgent","aiCreditsWarningAgent"],"mappings":"AAYO,MAAMA,IAAqC;AAAA,EAChD,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO,CAAA;AAAA,EACP,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aACE;AAAA,IAAA;AAAA,EAEJ;AAEJ,GCdaC,IAA8C;AAAA,EACzD,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO,CAAA;AAAA,EACP,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aACE;AAAA,IAAA;AAAA,EAEJ;AAEJ,GAEaC,IAAsC;AAAA,EACjD,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO,CAAA;AAAA,EACP,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aACE;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as L, useState as x, useMemo as B, useRef as y, useCallback as u, useEffect as D } from "react";
|
|
3
|
+
import { c as S } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as T } from "react-i18next";
|
|
5
|
+
import { B as C } from "./button-D-MQxsA_.js";
|
|
6
|
+
import { P as p } from "./progress-D_g_Sl2g.js";
|
|
7
|
+
import { H as a, u as z } from "./hover-card-CTNhQXWS.js";
|
|
8
|
+
import { f as O } from "./intl-locale-FWh-Y5_3.js";
|
|
9
|
+
const P = S("ds:flex ds:flex-col ds:items-start", {
|
|
10
|
+
variants: {
|
|
11
|
+
mode: {
|
|
12
|
+
included: "",
|
|
13
|
+
bundles: ""
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
mode: "included"
|
|
18
|
+
}
|
|
19
|
+
}), k = L((e, o) => {
|
|
20
|
+
const { t: i, i18n: r } = T("ui"), { allowance: n, className: d, mode: s, ...h } = e, {
|
|
21
|
+
onLearnMore: N,
|
|
22
|
+
onDismiss: c,
|
|
23
|
+
onViewBundles: b,
|
|
24
|
+
onSeeCosts: g,
|
|
25
|
+
...f
|
|
26
|
+
} = h, m = !!(n && n.limit > 0), v = m && (n != null && n.resetsOn) ? (
|
|
27
|
+
// The allowance is yearly, so the year is part of the date.
|
|
28
|
+
new Intl.DateTimeFormat(O(r.language), {
|
|
29
|
+
day: "numeric",
|
|
30
|
+
month: "long",
|
|
31
|
+
year: "numeric"
|
|
32
|
+
}).format(n.resetsOn)
|
|
33
|
+
) : void 0, w = m ? i("aiCreditsNotice.included.allowance", {
|
|
34
|
+
remaining: n.remaining,
|
|
35
|
+
limit: n.limit
|
|
36
|
+
}) : void 0, A = s === "included" ? i("aiCreditsNotice.included.heading") : m ? i("aiCreditsNotice.bundles.headingWithAllowance", {
|
|
37
|
+
remaining: n.remaining,
|
|
38
|
+
limit: n.limit
|
|
39
|
+
}) : i("aiCreditsNotice.bundles.eyebrow"), M = s === "included" ? i("aiCreditsNotice.included.body") : m ? i("aiCreditsNotice.bundles.body", { limit: n.limit }) : i("aiCreditsNotice.bundles.bodyGeneric");
|
|
40
|
+
return /* @__PURE__ */ l(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
...f,
|
|
44
|
+
ref: o,
|
|
45
|
+
"data-component": "ai-credits-notice",
|
|
46
|
+
"data-mode": s,
|
|
47
|
+
className: P({ mode: s, className: d }),
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ t(a.Eyebrow, { children: i(s === "included" ? "aiCreditsNotice.included.eyebrow" : "aiCreditsNotice.bundles.eyebrow") }),
|
|
50
|
+
/* @__PURE__ */ t(a.Heading, { children: A }),
|
|
51
|
+
/* @__PURE__ */ l(a.Body, { children: [
|
|
52
|
+
/* @__PURE__ */ t("p", { className: "ds:m-0", children: M }),
|
|
53
|
+
s === "included" && m ? /* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]", children: [
|
|
54
|
+
/* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: /* @__PURE__ */ t("span", { className: "type-label", children: w }) }),
|
|
55
|
+
/* @__PURE__ */ t(
|
|
56
|
+
p,
|
|
57
|
+
{
|
|
58
|
+
value: Math.max(0, n.limit - n.remaining),
|
|
59
|
+
max: n.limit,
|
|
60
|
+
size: "sm",
|
|
61
|
+
ariaLabel: i("aiCreditsNotice.included.eyebrow"),
|
|
62
|
+
ariaValueText: w
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
v ? /* @__PURE__ */ t("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: i("aiCreditsNotice.included.resetsOn", { date: v }) }) : null
|
|
66
|
+
] }) : null
|
|
67
|
+
] }),
|
|
68
|
+
s === "included" ? e.onLearnMore || e.onDismiss ? /* @__PURE__ */ l(a.Footer, { children: [
|
|
69
|
+
e.onDismiss ? /* @__PURE__ */ t(
|
|
70
|
+
C,
|
|
71
|
+
{
|
|
72
|
+
intent: "link",
|
|
73
|
+
size: "sm",
|
|
74
|
+
onClick: e.onDismiss,
|
|
75
|
+
className: "ds:me-auto",
|
|
76
|
+
children: i("aiCreditsNotice.dismiss")
|
|
77
|
+
}
|
|
78
|
+
) : null,
|
|
79
|
+
e.onLearnMore ? /* @__PURE__ */ t(C, { intent: "link", size: "sm", onClick: e.onLearnMore, children: i("aiCreditsNotice.included.learnMore") }) : null
|
|
80
|
+
] }) : null : /* @__PURE__ */ l(a.Footer, { children: [
|
|
81
|
+
e.onSeeCosts || e.onDismiss ? /* @__PURE__ */ l("div", { className: "ds:me-auto ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
82
|
+
e.onSeeCosts ? /* @__PURE__ */ t(C, { intent: "link", size: "sm", onClick: e.onSeeCosts, children: i("aiCreditsNotice.bundles.seeCosts") }) : null,
|
|
83
|
+
e.onDismiss ? /* @__PURE__ */ t(C, { intent: "link", size: "sm", onClick: e.onDismiss, children: i("aiCreditsNotice.dismiss") }) : null
|
|
84
|
+
] }) : null,
|
|
85
|
+
/* @__PURE__ */ t(C, { intent: "tonal", size: "sm", onClick: e.onViewBundles, children: i("aiCreditsNotice.bundles.viewBundles") })
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
k.displayName = "AiCreditsNotice";
|
|
92
|
+
function F({
|
|
93
|
+
notice: e,
|
|
94
|
+
side: o,
|
|
95
|
+
children: i
|
|
96
|
+
}) {
|
|
97
|
+
const [r, n] = x(!1);
|
|
98
|
+
return /* @__PURE__ */ l(a, { open: r, onOpenChange: n, children: [
|
|
99
|
+
/* @__PURE__ */ t(
|
|
100
|
+
H,
|
|
101
|
+
{
|
|
102
|
+
onOpen: () => n(!0),
|
|
103
|
+
onPress: () => n(!1),
|
|
104
|
+
children: i
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
a.Content,
|
|
109
|
+
{
|
|
110
|
+
side: o,
|
|
111
|
+
align: "start",
|
|
112
|
+
size: "sm",
|
|
113
|
+
collisionPadding: 8,
|
|
114
|
+
children: /* @__PURE__ */ t(k, { ...e })
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
function H({
|
|
120
|
+
onOpen: e,
|
|
121
|
+
onPress: o,
|
|
122
|
+
children: i
|
|
123
|
+
}) {
|
|
124
|
+
const { cancelClose: r, closeWithDelay: n } = z(), d = y(null), s = u(() => {
|
|
125
|
+
d.current && (clearTimeout(d.current), d.current = null);
|
|
126
|
+
}, []);
|
|
127
|
+
D(() => s, [s]);
|
|
128
|
+
const h = u(() => {
|
|
129
|
+
s(), r(), d.current = setTimeout(e, 300);
|
|
130
|
+
}, [s, r, e]), N = u(() => {
|
|
131
|
+
s(), n();
|
|
132
|
+
}, [s, n]), c = y(!1), b = u(() => {
|
|
133
|
+
c.current = !0, s(), o();
|
|
134
|
+
}, [s, o]);
|
|
135
|
+
D(() => {
|
|
136
|
+
const f = () => {
|
|
137
|
+
c.current = !1;
|
|
138
|
+
};
|
|
139
|
+
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
140
|
+
}, []);
|
|
141
|
+
const g = u(() => {
|
|
142
|
+
if (c.current) {
|
|
143
|
+
c.current = !1;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
s(), r(), e();
|
|
147
|
+
}, [s, r, e]);
|
|
148
|
+
return (
|
|
149
|
+
// `ds:inline-flex`, NOT `ds:contents`, so this span has a real box
|
|
150
|
+
// that hugs the button and Floating UI has a real rect to measure.
|
|
151
|
+
// `display: contents` generates no box of its own; inside the pill's
|
|
152
|
+
// flex/absolute layout that collapsed to a zero-size rect at the
|
|
153
|
+
// editor's origin, so the card rendered top-left instead of at the
|
|
154
|
+
// trigger (caught in review on :6007).
|
|
155
|
+
/* @__PURE__ */ t(a.Anchor, { asChild: !0, children: /* @__PURE__ */ t(
|
|
156
|
+
"span",
|
|
157
|
+
{
|
|
158
|
+
className: "ds:inline-flex",
|
|
159
|
+
onMouseEnter: h,
|
|
160
|
+
onMouseLeave: N,
|
|
161
|
+
onPointerDown: b,
|
|
162
|
+
onFocusCapture: g,
|
|
163
|
+
onBlurCapture: N,
|
|
164
|
+
children: i
|
|
165
|
+
}
|
|
166
|
+
) })
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
function U(e, o, i = "bottom") {
|
|
170
|
+
return o ? /* @__PURE__ */ t(F, { notice: o, side: i, children: e }) : e;
|
|
171
|
+
}
|
|
172
|
+
function q(e) {
|
|
173
|
+
const [o, i] = x(() => /* @__PURE__ */ new Set());
|
|
174
|
+
return B(() => {
|
|
175
|
+
if (!e || o.has(e.mode)) return;
|
|
176
|
+
if (!e.onDismiss) return e;
|
|
177
|
+
const r = e.onDismiss, n = e.mode;
|
|
178
|
+
return {
|
|
179
|
+
...e,
|
|
180
|
+
onDismiss: () => {
|
|
181
|
+
i((d) => new Set(d).add(n)), r();
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}, [e, o]);
|
|
185
|
+
}
|
|
186
|
+
export {
|
|
187
|
+
k as A,
|
|
188
|
+
q as u,
|
|
189
|
+
U as w
|
|
190
|
+
};
|
|
191
|
+
//# sourceMappingURL=ai-credits-notice-DQ-r3iQU.js.map
|