@alfadocs/ui-kit-debug 0.48.0 → 0.50.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/{address-autocomplete-CSjMrBvu.js → address-autocomplete-CT-9AOli.js} +2 -2
- package/dist/_chunks/{address-autocomplete-CSjMrBvu.js.map → address-autocomplete-CT-9AOli.js.map} +1 -1
- package/dist/_chunks/{ai-consent-banner-DO5ingMq.js → ai-consent-banner-F2md5JD3.js} +2 -2
- package/dist/_chunks/{ai-consent-banner-DO5ingMq.js.map → ai-consent-banner-F2md5JD3.js.map} +1 -1
- package/dist/_chunks/{ai-tools-rail-CxYG04cw.js → ai-tools-rail-CYLWrRmm.js} +6 -6
- package/dist/_chunks/ai-tools-rail-CYLWrRmm.js.map +1 -0
- package/dist/_chunks/{alert-ywPR59NE.js → alert-CUTxnym2.js} +56 -35
- package/dist/_chunks/alert-CUTxnym2.js.map +1 -0
- package/dist/_chunks/antenatal-schedule-timeline-CdiqkF05.js +413 -0
- package/dist/_chunks/antenatal-schedule-timeline-CdiqkF05.js.map +1 -0
- package/dist/_chunks/{ar-DEz65ZJW.js → ar-C68WKG5a.js} +2 -2
- package/dist/_chunks/{ar-DEz65ZJW.js.map → ar-C68WKG5a.js.map} +1 -1
- package/dist/_chunks/{audio-recorder-DC-v9YFW.js → audio-recorder-DVJXV7_k.js} +2 -2
- package/dist/_chunks/{audio-recorder-DC-v9YFW.js.map → audio-recorder-DVJXV7_k.js.map} +1 -1
- package/dist/_chunks/bishop-score-2MzAz8NE.js +185 -0
- package/dist/_chunks/bishop-score-2MzAz8NE.js.map +1 -0
- package/dist/_chunks/{booking-WV2GSru5.js → booking-DljH0JkS.js} +5 -5
- package/dist/_chunks/{booking-WV2GSru5.js.map → booking-DljH0JkS.js.map} +1 -1
- package/dist/_chunks/circle-arrow-up-CC_85SuH.js +16 -0
- package/dist/_chunks/circle-arrow-up-CC_85SuH.js.map +1 -0
- package/dist/_chunks/cycle-calculator-oOkj5wlB.js +252 -0
- package/dist/_chunks/cycle-calculator-oOkj5wlB.js.map +1 -0
- package/dist/_chunks/{date-picker-Bq7xhMA-.js → date-picker-BfHblqwA.js} +2 -2
- package/dist/_chunks/{date-picker-Bq7xhMA-.js.map → date-picker-BfHblqwA.js.map} +1 -1
- package/dist/_chunks/{date-picker-variants-DLi1Va_e.js → date-picker-variants-CXEAx3O_.js} +22 -22
- package/dist/_chunks/{date-picker-variants-DLi1Va_e.js.map → date-picker-variants-CXEAx3O_.js.map} +1 -1
- package/dist/_chunks/{date-range-picker-DcXuI9y7.js → date-range-picker-hcAMs1wO.js} +3 -3
- package/dist/_chunks/{date-range-picker-DcXuI9y7.js.map → date-range-picker-hcAMs1wO.js.map} +1 -1
- package/dist/_chunks/{date-time-picker-RimumeLR.js → date-time-picker-H-3Pwqlb.js} +9 -9
- package/dist/_chunks/{date-time-picker-RimumeLR.js.map → date-time-picker-H-3Pwqlb.js.map} +1 -1
- package/dist/_chunks/{de-bTBGdjPS.js → de-DK4A9_a8.js} +2 -2
- package/dist/_chunks/{de-bTBGdjPS.js.map → de-DK4A9_a8.js.map} +1 -1
- package/dist/_chunks/{document-scanner-BqLsGs4Y.js → document-scanner-Cxqvq7GR.js} +2 -2
- package/dist/_chunks/{document-scanner-BqLsGs4Y.js.map → document-scanner-Cxqvq7GR.js.map} +1 -1
- package/dist/_chunks/due-date-calculator-DykajWzh.js +256 -0
- package/dist/_chunks/due-date-calculator-DykajWzh.js.map +1 -0
- package/dist/_chunks/{editable-currency-cell-renderer-CLil9B29.js → editable-currency-cell-renderer-Bh48OHRv.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-CLil9B29.js.map → editable-currency-cell-renderer-Bh48OHRv.js.map} +1 -1
- package/dist/_chunks/{el-BWG5RXxa.js → el-B29HXhG5.js} +2 -2
- package/dist/_chunks/{el-BWG5RXxa.js.map → el-B29HXhG5.js.map} +1 -1
- package/dist/_chunks/{es-DfO_G435.js → es-BOwPVwWn.js} +2 -2
- package/dist/_chunks/{es-DfO_G435.js.map → es-BOwPVwWn.js.map} +1 -1
- package/dist/_chunks/fetal-weight-Da-B4P4k.js +122 -0
- package/dist/_chunks/fetal-weight-Da-B4P4k.js.map +1 -0
- package/dist/_chunks/{fr-BTn24bs8.js → fr-DoDBtn0T.js} +2 -2
- package/dist/_chunks/{fr-BTn24bs8.js.map → fr-DoDBtn0T.js.map} +1 -1
- package/dist/_chunks/{freemium-paywall-DzpD63WY.js → freemium-paywall-BWaLWje-.js} +2 -2
- package/dist/_chunks/{freemium-paywall-DzpD63WY.js.map → freemium-paywall-BWaLWje-.js.map} +1 -1
- package/dist/_chunks/gestational-age-calculator-Bc55hq6t.js +311 -0
- package/dist/_chunks/gestational-age-calculator-Bc55hq6t.js.map +1 -0
- package/dist/_chunks/hcg-doubling-DAnpbale.js +170 -0
- package/dist/_chunks/hcg-doubling-DAnpbale.js.map +1 -0
- package/dist/_chunks/{hi-Dj3oYd84.js → hi-DGByrKby.js} +2 -2
- package/dist/_chunks/{hi-Dj3oYd84.js.map → hi-DGByrKby.js.map} +1 -1
- package/dist/_chunks/{isSameWeek-HfxKk6Lz.js → isSameWeek-B1odL2vR.js} +2 -2
- package/dist/_chunks/{isSameWeek-HfxKk6Lz.js.map → isSameWeek-B1odL2vR.js.map} +1 -1
- package/dist/_chunks/{it-Y85ofIQQ.js → it-B16rEecm.js} +3 -3
- package/dist/_chunks/{it-Y85ofIQQ.js.map → it-B16rEecm.js.map} +1 -1
- package/dist/_chunks/{ja-CQ7J6YoA.js → ja-B0viOgft.js} +2 -2
- package/dist/_chunks/{ja-CQ7J6YoA.js.map → ja-B0viOgft.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-Gfsf78ge.js → marketplace-app-shell-UKSLx9K_.js} +3 -3
- package/dist/_chunks/{marketplace-app-shell-Gfsf78ge.js.map → marketplace-app-shell-UKSLx9K_.js.map} +1 -1
- package/dist/_chunks/{nl-D9kHCmp3.js → nl-cBxEX2QU.js} +2 -2
- package/dist/_chunks/{nl-D9kHCmp3.js.map → nl-cBxEX2QU.js.map} +1 -1
- package/dist/_chunks/{patient-search-CocVcGJ3.js → patient-search-BJOmTmDA.js} +2 -2
- package/dist/_chunks/{patient-search-CocVcGJ3.js.map → patient-search-BJOmTmDA.js.map} +1 -1
- package/dist/_chunks/{patient-shell-CnT4L8gn.js → patient-shell-DUmhXnFq.js} +2 -2
- package/dist/_chunks/{patient-shell-CnT4L8gn.js.map → patient-shell-DUmhXnFq.js.map} +1 -1
- package/dist/_chunks/{payment-form-BNTx4876.js → payment-form-xmeCkxas.js} +2 -2
- package/dist/_chunks/{payment-form-BNTx4876.js.map → payment-form-xmeCkxas.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-G8SU6Azw.js → pdf-viewer-q1D3Uion.js} +2 -2
- package/dist/_chunks/{pdf-viewer-G8SU6Azw.js.map → pdf-viewer-q1D3Uion.js.map} +1 -1
- package/dist/_chunks/{pl-B3Smqpkr.js → pl-DtS08ioY.js} +3 -3
- package/dist/_chunks/{pl-B3Smqpkr.js.map → pl-DtS08ioY.js.map} +1 -1
- package/dist/_chunks/{practice-results-BFL_mcDW.js → practice-results-Cq1y8JFD.js} +2 -2
- package/dist/_chunks/{practice-results-BFL_mcDW.js.map → practice-results-Cq1y8JFD.js.map} +1 -1
- package/dist/_chunks/pregnancy-dating-48Gfvod1.js +421 -0
- package/dist/_chunks/pregnancy-dating-48Gfvod1.js.map +1 -0
- package/dist/_chunks/pregnancy-weight-gain-CCGrvarh.js +322 -0
- package/dist/_chunks/pregnancy-weight-gain-CCGrvarh.js.map +1 -0
- package/dist/_chunks/product-hub-panel-CkfZBA3t.js +620 -0
- package/dist/_chunks/product-hub-panel-CkfZBA3t.js.map +1 -0
- package/dist/_chunks/{pt-D3J-1c_7.js → pt-yFXs1VvH.js} +2 -2
- package/dist/_chunks/{pt-D3J-1c_7.js.map → pt-yFXs1VvH.js.map} +1 -1
- package/dist/_chunks/{ro-BKAbbEA3.js → ro-DsCzSrzR.js} +2 -2
- package/dist/_chunks/{ro-BKAbbEA3.js.map → ro-DsCzSrzR.js.map} +1 -1
- package/dist/_chunks/{ru-BeG8f0Ep.js → ru-DgDxL0pc.js} +3 -3
- package/dist/_chunks/{ru-BeG8f0Ep.js.map → ru-DgDxL0pc.js.map} +1 -1
- package/dist/_chunks/{sidebar-_vJXI9rB.js → sidebar-h78cTNLh.js} +440 -338
- package/dist/_chunks/sidebar-h78cTNLh.js.map +1 -0
- package/dist/_chunks/{sign-document-DPI2pY9V.js → sign-document-CZkAf28g.js} +2 -2
- package/dist/_chunks/{sign-document-DPI2pY9V.js.map → sign-document-CZkAf28g.js.map} +1 -1
- package/dist/_chunks/{sq-_hRPaeUy.js → sq-DHlCYN67.js} +2 -2
- package/dist/_chunks/{sq-_hRPaeUy.js.map → sq-DHlCYN67.js.map} +1 -1
- package/dist/_chunks/subDays-Bs00akhK.js +8 -0
- package/dist/_chunks/{subDays-Dv7q9S7u.js.map → subDays-Bs00akhK.js.map} +1 -1
- package/dist/_chunks/{sv-g009fSpe.js → sv-O0QaQs_s.js} +2 -2
- package/dist/_chunks/{sv-g009fSpe.js.map → sv-O0QaQs_s.js.map} +1 -1
- package/dist/_chunks/{tr-OKUOuhMW.js → tr-BmNDRuio.js} +2 -2
- package/dist/_chunks/{tr-OKUOuhMW.js.map → tr-BmNDRuio.js.map} +1 -1
- package/dist/_chunks/warning-stack-CXfoAT-_.js +220 -0
- package/dist/_chunks/warning-stack-CXfoAT-_.js.map +1 -0
- package/dist/_chunks/{workflow-map-ZXw-zsZ8.js → workflow-map-DzX_LI4y.js} +2 -2
- package/dist/_chunks/{workflow-map-ZXw-zsZ8.js.map → workflow-map-DzX_LI4y.js.map} +1 -1
- package/dist/_chunks/{zh-CN-De4zwEhx.js → zh-CN-CgVJZEzz.js} +3 -3
- package/dist/_chunks/{zh-CN-De4zwEhx.js.map → zh-CN-CgVJZEzz.js.map} +1 -1
- package/dist/agent-catalog.json +44 -1
- package/dist/components/_shared/antenatal-schedule-timeline.d.ts +18 -0
- package/dist/components/_shared/antenatal-schedule-timeline.d.ts.map +1 -0
- package/dist/components/_shared/antenatal-schedule.d.ts +68 -0
- package/dist/components/_shared/antenatal-schedule.d.ts.map +1 -0
- package/dist/components/_shared/index.d.ts +3 -0
- package/dist/components/_shared/index.d.ts.map +1 -1
- package/dist/components/_shared/obstetrics.d.ts +138 -0
- package/dist/components/_shared/obstetrics.d.ts.map +1 -0
- package/dist/components/address-autocomplete/index.js +1 -1
- package/dist/components/ai-consent-banner/index.js +1 -1
- package/dist/components/ai-tools-rail/ai-tools-rail.d.ts.map +1 -1
- package/dist/components/ai-tools-rail/index.js +1 -1
- package/dist/components/alert/alert.d.ts +2 -2
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/bishop-score/bishop-score.d.ts +27 -0
- package/dist/components/bishop-score/bishop-score.d.ts.map +1 -0
- package/dist/components/bishop-score/bishop.d.ts +30 -0
- package/dist/components/bishop-score/bishop.d.ts.map +1 -0
- package/dist/components/bishop-score/index.d.ts +4 -0
- package/dist/components/bishop-score/index.d.ts.map +1 -0
- package/dist/components/bishop-score/index.js +10 -0
- package/dist/components/bishop-score/index.js.map +1 -0
- package/dist/components/booking/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.d.ts.map +1 -1
- package/dist/components/cycle-calculator/cycle.d.ts +5 -0
- package/dist/components/cycle-calculator/cycle.d.ts.map +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +19 -1
- package/dist/components/due-date-calculator/due-date-calculator.d.ts.map +1 -1
- package/dist/components/due-date-calculator/gestation.d.ts +1 -59
- package/dist/components/due-date-calculator/gestation.d.ts.map +1 -1
- package/dist/components/due-date-calculator/index.d.ts +1 -1
- package/dist/components/due-date-calculator/index.d.ts.map +1 -1
- package/dist/components/due-date-calculator/index.js +16 -10
- package/dist/components/fetal-weight/efw.d.ts +25 -0
- package/dist/components/fetal-weight/efw.d.ts.map +1 -0
- package/dist/components/fetal-weight/fetal-weight.d.ts +27 -0
- package/dist/components/fetal-weight/fetal-weight.d.ts.map +1 -0
- package/dist/components/fetal-weight/index.d.ts +4 -0
- package/dist/components/fetal-weight/index.d.ts.map +1 -0
- package/dist/components/fetal-weight/index.js +6 -0
- package/dist/components/fetal-weight/index.js.map +1 -0
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +32 -1
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts.map +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/hcg-doubling.d.ts +31 -0
- package/dist/components/hcg-doubling/hcg-doubling.d.ts.map +1 -0
- package/dist/components/hcg-doubling/hcg.d.ts +33 -0
- package/dist/components/hcg-doubling/hcg.d.ts.map +1 -0
- package/dist/components/hcg-doubling/index.d.ts +4 -0
- package/dist/components/hcg-doubling/index.d.ts.map +1 -0
- package/dist/components/hcg-doubling/index.js +7 -0
- package/dist/components/hcg-doubling/index.js.map +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/patient-search/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/pregnancy-dating/index.d.ts +3 -0
- package/dist/components/pregnancy-dating/index.d.ts.map +1 -0
- package/dist/components/pregnancy-dating/index.js +5 -0
- package/dist/components/pregnancy-dating/index.js.map +1 -0
- package/dist/components/pregnancy-dating/pregnancy-dating.d.ts +60 -0
- package/dist/components/pregnancy-dating/pregnancy-dating.d.ts.map +1 -0
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +7 -0
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts.map +1 -1
- package/dist/components/pregnancy-weight-gain/weight-gain.d.ts +33 -8
- package/dist/components/pregnancy-weight-gain/weight-gain.d.ts.map +1 -1
- package/dist/components/product-hub-tray/index.d.ts +8 -0
- package/dist/components/product-hub-tray/index.d.ts.map +1 -0
- package/dist/components/product-hub-tray/index.js +10 -0
- package/dist/components/product-hub-tray/index.js.map +1 -0
- package/dist/components/product-hub-tray/product-hub-panel.agent.d.ts +4 -0
- package/dist/components/product-hub-tray/product-hub-panel.agent.d.ts.map +1 -0
- package/dist/components/product-hub-tray/product-hub-panel.d.ts +54 -0
- package/dist/components/product-hub-tray/product-hub-panel.d.ts.map +1 -0
- package/dist/components/product-hub-tray/product-hub-tray.agent.d.ts +4 -0
- package/dist/components/product-hub-tray/product-hub-tray.agent.d.ts.map +1 -0
- package/dist/components/product-hub-tray/product-hub-tray.d.ts +115 -0
- package/dist/components/product-hub-tray/product-hub-tray.d.ts.map +1 -0
- package/dist/components/sidebar/index.d.ts +2 -2
- package/dist/components/sidebar/index.d.ts.map +1 -1
- package/dist/components/sidebar/index.js +12 -11
- package/dist/components/sidebar/sidebar.d.ts +14 -1
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/warning-stack/warning-stack.d.ts.map +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +262 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +261 -2
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +262 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +261 -2
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +262 -1
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +261 -2
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +262 -1
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +261 -2
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +262 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +261 -2
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +262 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +261 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +262 -1
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +261 -2
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +262 -1
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +261 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +262 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +261 -2
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +262 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +261 -2
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +262 -1
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +261 -2
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +262 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +261 -2
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +262 -1
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +261 -2
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +262 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +261 -2
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +262 -1
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +261 -2
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +262 -1
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +261 -2
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +262 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +261 -2
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +262 -1
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +261 -2
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +661 -632
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +263 -2
- package/dist/locales/de.json +263 -2
- package/dist/locales/el.json +263 -2
- package/dist/locales/en.json +263 -2
- package/dist/locales/es.json +263 -2
- package/dist/locales/fr.json +263 -2
- package/dist/locales/hi.json +263 -2
- package/dist/locales/it.json +263 -2
- package/dist/locales/ja.json +263 -2
- package/dist/locales/nl.json +263 -2
- package/dist/locales/pl.json +263 -2
- package/dist/locales/pt.json +263 -2
- package/dist/locales/ro.json +263 -2
- package/dist/locales/ru.json +263 -2
- package/dist/locales/sq.json +263 -2
- package/dist/locales/sv.json +263 -2
- package/dist/locales/tr.json +263 -2
- package/dist/locales/zh.json +263 -2
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +21 -1
- package/dist/_chunks/ai-tools-rail-CxYG04cw.js.map +0 -1
- package/dist/_chunks/alert-ywPR59NE.js.map +0 -1
- package/dist/_chunks/cycle-calculator-DYvGm_m1.js +0 -211
- package/dist/_chunks/cycle-calculator-DYvGm_m1.js.map +0 -1
- package/dist/_chunks/due-date-calculator-BXd3ANj7.js +0 -216
- package/dist/_chunks/due-date-calculator-BXd3ANj7.js.map +0 -1
- package/dist/_chunks/gestation-mWF4AXea.js +0 -50
- package/dist/_chunks/gestation-mWF4AXea.js.map +0 -1
- package/dist/_chunks/gestational-age-calculator-Crj6FgZw.js +0 -203
- package/dist/_chunks/gestational-age-calculator-Crj6FgZw.js.map +0 -1
- package/dist/_chunks/pregnancy-weight-gain-C7dK89jE.js +0 -246
- package/dist/_chunks/pregnancy-weight-gain-C7dK89jE.js.map +0 -1
- package/dist/_chunks/sidebar-_vJXI9rB.js.map +0 -1
- package/dist/_chunks/subDays-Dv7q9S7u.js +0 -8
- package/dist/_chunks/warning-stack-DNR3-IbP.js +0 -180
- package/dist/_chunks/warning-stack-DNR3-IbP.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { forwardRef as de, useState as _, useEffect as D, useRef as G, useMemo a
|
|
|
3
3
|
import { c as A } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as W } from "react-i18next";
|
|
5
5
|
import { S as te } from "./spinner-OjQNn8oN.js";
|
|
6
|
-
import { A as ee } from "./alert-
|
|
6
|
+
import { A as ee } from "./alert-CUTxnym2.js";
|
|
7
7
|
import { loadStripe as ue } from "@stripe/stripe-js";
|
|
8
8
|
import { Elements as pe, useStripe as fe, useElements as be, PaymentElement as ye, AddressElement as ge } from "@stripe/react-stripe-js";
|
|
9
9
|
import { u as ve } from "./registry-nPAVE19X.js";
|
|
@@ -668,4 +668,4 @@ export {
|
|
|
668
668
|
we as p,
|
|
669
669
|
se as s
|
|
670
670
|
};
|
|
671
|
-
//# sourceMappingURL=payment-form-
|
|
671
|
+
//# sourceMappingURL=payment-form-xmeCkxas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-form-BNTx4876.js","sources":["../../src/tokens/themes/bridges/stripe-appearance.ts","../../src/components/payment-form/payment-form.agent.ts","../../src/components/payment-form/payment-form.tsx"],"sourcesContent":["import type { Appearance } from '@stripe/stripe-js';\n\n/**\n * Reads the current design-system tokens from a theme-root element and maps\n * them to Stripe Elements' Appearance API. `root` defaults to\n * `document.documentElement` but consumers can pass a scoped theme wrapper\n * (e.g. a modal with its own `.theme-accessible` override) so that Stripe\n * iframes pick up the right token set.\n *\n * Tokens referenced: --primary, --background, --foreground, --muted,\n * --muted-foreground, --border, --destructive, --radius-md, --font-sans,\n * --font-size-base, --spacing-sm, --animation-duration, --focus-ring-width,\n * --ring.\n *\n * No hex / rgb / hsl literals — every value flows from the token layer.\n */\n\nfunction isBrowser(): boolean {\n return typeof document !== 'undefined' && typeof window !== 'undefined';\n}\n\nexport function getStripeAppearance(root?: HTMLElement): Appearance {\n if (!isBrowser()) {\n return { theme: 'stripe' };\n }\n\n const target = root ?? document.documentElement;\n const styles = getComputedStyle(target);\n const read = (token: string) => styles.getPropertyValue(token).trim();\n const isDark = target.classList.contains('theme-dark');\n\n return {\n theme: isDark ? 'night' : 'stripe',\n variables: {\n colorPrimary: read('--primary'),\n colorBackground: read('--background'),\n colorText: read('--foreground'),\n colorDanger: read('--destructive'),\n colorTextSecondary: read('--muted-foreground'),\n colorTextPlaceholder: read('--muted-foreground'),\n borderRadius: read('--radius-md'),\n fontFamily: read('--font-sans'),\n fontSizeBase: read('--font-size-base'),\n // Stripe multiplies spacingUnit throughout every Element; --spacing-sm\n // gives readable density. Keep this in sync with the JSDoc above.\n spacingUnit: read('--spacing-sm'),\n },\n rules: {\n '.Input': {\n backgroundColor: read('--background'),\n border: `1px solid ${read('--border')}`,\n color: read('--foreground'),\n padding: read('--spacing-sm'),\n transition: `border-color ${read('--animation-duration')} ease-out`,\n },\n '.Input:focus': {\n borderColor: read('--primary'),\n boxShadow: `0 0 0 ${read('--focus-ring-width')} ${read('--ring')}`,\n outline: 'none',\n },\n '.Input--invalid': {\n borderColor: read('--destructive'),\n color: read('--foreground'),\n },\n '.Label': {\n color: read('--foreground'),\n fontWeight: read('--font-weight-medium'),\n fontSize: read('--font-size-sm'),\n },\n '.Error': {\n color: read('--destructive'),\n fontSize: read('--font-size-sm'),\n },\n '.Tab': {\n border: `1px solid ${read('--border')}`,\n backgroundColor: read('--background'),\n color: read('--foreground'),\n },\n '.Tab--selected': {\n borderColor: read('--primary'),\n backgroundColor: read('--background'),\n color: read('--primary'),\n },\n // Accordion method rows (the `accordion` layout): keep Stripe's native\n // per-method card structure, restyled with our tokens — our border +\n // radius, our background, `--primary` on the selected row, no extra shadow.\n '.AccordionItem': {\n backgroundColor: read('--background'),\n border: `1px solid ${read('--border')}`,\n borderRadius: read('--radius-md'),\n boxShadow: 'none',\n },\n '.AccordionItem--selected': {\n borderColor: read('--primary'),\n backgroundColor: read('--background'),\n },\n // Stripe's in-method notice blocks (e.g. PayPal's \"you'll be redirected\")\n // otherwise render in their own bordered box — a card nested inside the\n // selected method card. Flatten to inline icon + text, no inner box.\n '.Block': {\n border: 'none',\n borderRadius: '0',\n boxShadow: 'none',\n backgroundColor: 'transparent',\n },\n },\n };\n}\n\n/**\n * Calls `onChange(getStripeAppearance(root))` whenever the theme root's\n * class list mutates (theme switch) or the user toggles\n * `prefers-color-scheme` / `prefers-reduced-motion`. Returns an\n * unsubscribe function.\n */\nexport function subscribeStripeAppearance(\n onChange: (next: Appearance) => void,\n root?: HTMLElement,\n): () => void {\n if (!isBrowser()) return () => undefined;\n\n const target = root ?? document.documentElement;\n const emit = () => onChange(getStripeAppearance(root));\n\n const observer = new MutationObserver(emit);\n observer.observe(target, {\n attributes: true,\n attributeFilter: ['class', 'dir', 'lang'],\n });\n\n const schemeMql = window.matchMedia('(prefers-color-scheme: dark)');\n const motionMql = window.matchMedia('(prefers-reduced-motion: reduce)');\n schemeMql.addEventListener('change', emit);\n motionMql.addEventListener('change', emit);\n\n return () => {\n observer.disconnect();\n schemeMql.removeEventListener('change', emit);\n motionMql.removeEventListener('change', emit);\n };\n}\n","import type { AgentAdapter } from '../../agent/types';\nimport type { PaymentFormHandle } from './payment-form';\n\nexport const paymentFormAgent: AgentAdapter<PaymentFormHandle> = {\n id: 'payment-form',\n capabilities: ['submit'],\n state: {},\n actions: {\n submit: {\n safety: 'destructive',\n description:\n 'Submit the payment. Charges the configured payment method — irreversible.',\n invoke: (handle) => handle.submit(),\n },\n reset: {\n safety: 'destructive',\n description:\n 'Reset the form to its initial state. Loses any in-progress input.',\n invoke: (handle) => {\n handle.reset();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'payment-form' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* PaymentForm — Stripe Elements wrapper (PCI DSS SAQ-A). */\n/* */\n/* - Library: `@stripe/react-stripe-js` + `@stripe/stripe-js` (see */\n/* `src/docs/08-third-party.mdx §Payments`). Card number, expiry, */\n/* CVC, and postal code all live inside Stripe-hosted iframes on */\n/* `js.stripe.com` — raw PAN never touches our origin, keeping us */\n/* inside PCI DSS SAQ-A scope. */\n/* */\n/* - Theming: the `stripe-appearance` bridge snapshots our tokens into */\n/* Stripe's Appearance API (`variables`, `rules`). A */\n/* `MutationObserver` on `<html class>` re-runs the snapshot when */\n/* the user flips theme so the embedded iframes repaint. */\n/* */\n/* - Security invariants enforced in this file: */\n/* 1. No `<input type=\"tel\" name=\"card\">` anywhere. */\n/* 2. Error strings are sanitised via `stripCardLikeDigits` before */\n/* forwarding to `onError` (replaces any `\\b\\d{4,}\\b` with */\n/* `****`). */\n/* 3. Element change events are never logged; any dev-only logging */\n/* is gated behind `import.meta.env.DEV` — never runs in prod. */\n/* */\n/* TODO: */\n/* - Stripe's `direction: 'rtl'` is not part of the current */\n/* `Appearance` TypeScript type; we rely on CSS mirroring of our */\n/* chrome via logical properties and let Stripe lay out the iframe */\n/* ltr for now. Revisit when @stripe/stripe-js publishes the type. */\n/* - No `<CardNumberElement>` / split-fields story — `PaymentElement` */\n/* handles tabs + card-only modes via its own `layout` option. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type FormEvent,\n type ReactElement,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Spinner } from '../spinner';\nimport { Alert } from '../alert';\nimport {\n loadStripe,\n type Stripe,\n type Appearance,\n type StripeElementLocale,\n type StripeElementsOptions,\n} from '@stripe/stripe-js';\nimport {\n Elements,\n PaymentElement,\n AddressElement,\n useElements,\n useStripe,\n} from '@stripe/react-stripe-js';\n\nimport {\n getStripeAppearance,\n subscribeStripeAppearance,\n} from '../../tokens/themes/bridges/stripe-appearance';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { paymentFormAgent } from './payment-form.agent';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type PaymentCurrency = string; // ISO-4217\n\nexport interface PaymentFormProps {\n /** Opaque instance id — emitted as `data-component-id` for the agent registry. */\n id?: string;\n /**\n * Client secret from your server, created via the PaymentIntents API.\n *\n * Omit to use **deferred-intent mode** — the Payment Element renders from\n * just the publishable key (no `clientSecret`, no backend round-trip up\n * front). In deferred mode supply `onCreatePaymentIntent` to actually\n * confirm: your server mints + returns the client secret at submit time.\n */\n clientSecret?: string;\n /**\n * Deferred-intent setup: `'payment'` collects a charge, `'setup'` saves a\n * method for later. Ignored when `clientSecret` is supplied (the secret's\n * own intent type wins). Defaults to `'payment'`.\n */\n mode?: 'payment' | 'setup';\n /**\n * Deferred-confirm callback. Called at submit time (after client-side\n * field validation succeeds) so your server can mint a PaymentIntent and\n * return its `client_secret`. The returned secret is used ONLY to confirm\n * and is never logged or sent to any third-party origin. When omitted in\n * deferred mode the form runs in PREVIEW: fields render + validate, but no\n * charge is attempted.\n */\n onCreatePaymentIntent?: () => Promise<string>;\n /** Stripe publishable key (`pk_test_…` / `pk_live_…`). */\n publishableKey: string;\n /** ISO-4217 currency code (e.g. 'EUR', 'USD', 'JPY'). */\n currency: PaymentCurrency;\n /** Amount in the currency's smallest unit (cents for EUR/USD, yen for JPY). */\n amount: number;\n /** Called with the PaymentIntent id on successful confirmation. */\n onSuccess?: (paymentIntentId: string) => void;\n /** Called with a sanitised error (no PAN digits, no Stripe English strings). */\n onError?: (error: { code: string; translatedMessage: string }) => void;\n /** Show the billing-address collector below the payment fields. */\n billingAddress?: boolean;\n /** Locale override — defaults to the active i18next locale. */\n locale?: string;\n /** Accessible label for the form. */\n ariaLabel?: string;\n /** URL Stripe redirects to when a payment method requires it. */\n returnUrl?: string;\n /** Pre-injected Stripe instance — used by tests + stories to bypass the network. */\n stripePromise?: Promise<Stripe | null> | null;\n /**\n * Payment Element layout. `tabs` (default) renders methods as a tile row —\n * best in wide containers. `accordion` stacks them as full-width rows — use\n * it in narrow columns (< ~400px) where Stripe's tab row clips a partial tile.\n */\n layout?: 'tabs' | 'accordion';\n className?: string;\n}\n\nexport interface PaymentFormHandle {\n /** Programmatically submit the form (same flow as the Pay button). */\n submit: () => Promise<void>;\n /** Reset the form to its initial state. */\n reset: () => void;\n}\n\n/* ------------------------------------------------------------------ */\n/* Currency helpers */\n/* ------------------------------------------------------------------ */\n\n/**\n * Currencies that Stripe bills in their base unit (no decimals). Source:\n * https://stripe.com/docs/currencies#zero-decimal — list pinned per\n * 08-third-party.mdx.\n */\nconst ZERO_DECIMAL_CURRENCIES = new Set<string>([\n 'BIF',\n 'CLP',\n 'DJF',\n 'GNF',\n 'IDR',\n 'JPY',\n 'KMF',\n 'KRW',\n 'MGA',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n]);\n\nexport function formatPaymentAmount(\n amount: number,\n currency: string,\n locale: string,\n): string {\n const iso = currency.toUpperCase();\n const major = ZERO_DECIMAL_CURRENCIES.has(iso) ? amount : amount / 100;\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: iso,\n }).format(major);\n } catch {\n // Invalid locale/currency pair — fall back to a safe format so we\n // never leak raw amount integers into the UI.\n return new Intl.NumberFormat('en', {\n style: 'currency',\n currency: iso,\n }).format(major);\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Return URL validation */\n/* ------------------------------------------------------------------ */\n\n/**\n * Resolve `returnUrl` against the current origin. Accepts:\n * - absolute URLs on the same origin as `window.location`\n * - relative paths (resolved against the current origin)\n * Rejects (returns `null`):\n * - cross-origin URLs — would leak `payment_intent_client_secret`\n * - `javascript:` / `data:` / `file:` / `blob:` schemes\n * - SSR contexts (no `window`) — the submit path requires a browser\n * anyway, so rejecting here is the safer default.\n * See security-hardening.mdx.\n */\nexport function validateReturnUrl(\n returnUrl: string | undefined,\n): string | null {\n if (returnUrl === undefined) return null;\n const raw = returnUrl.trim();\n if (raw === '') return null;\n if (typeof window === 'undefined') return null;\n try {\n const resolved = new URL(raw, window.location.href);\n const allowedSchemes = new Set(['http:', 'https:']);\n if (!allowedSchemes.has(resolved.protocol)) return null;\n if (resolved.origin !== window.location.origin) return null;\n return resolved.toString();\n } catch {\n return null;\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Error sanitisation */\n/* ------------------------------------------------------------------ */\n\n/**\n * Replace any run of 4+ consecutive digits with `****`. Called before any\n * error text leaves the wrapper. Defensive: even though Stripe's error\n * strings don't normally contain PANs, a future SDK change could, and we\n * want a hard guarantee that `console` / analytics / Sentry breadcrumbs\n * stay clear of anything that looks like card data.\n */\nexport function stripCardLikeDigits(message: string): string {\n if (!message) return message;\n // Deliberately no word boundaries: a PAN run embedded between word\n // characters (e.g. \"CARD4242424242424242DECLINED\") must still be masked.\n return message.replace(/\\d{4,}/g, '****');\n}\n\n/**\n * Map a Stripe error code (e.g. `card_declined`, `incorrect_number`) to a\n * translation key under `payment.error.*`. Unknown codes fall through to\n * `payment.error.generic`.\n */\nexport function stripeErrorCodeToI18nKey(code: string | undefined): string {\n switch (code) {\n case 'incorrect_number':\n case 'invalid_number':\n return 'payment.error.cardNumber';\n case 'invalid_expiry_month':\n case 'invalid_expiry_year':\n case 'expired_card':\n return 'payment.error.expiry';\n case 'invalid_cvc':\n case 'incorrect_cvc':\n return 'payment.error.cvc';\n case 'incorrect_zip':\n case 'invalid_zip':\n return 'payment.error.postalCode';\n case 'card_declined':\n case 'do_not_honor':\n case 'generic_decline':\n return 'payment.error.declined';\n case 'network_error':\n case 'api_connection_error':\n return 'payment.error.network';\n default:\n return 'payment.error.generic';\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst formVariants = cva(\n [\n 'ds:payment-form-alfadocs ds:flex ds:flex-col',\n 'ds:gap-[var(--spacing-md)]',\n // Transparent, padding-less container — the consuming surface (a Card, the\n // check-in step, a checkout column) owns the card chrome + padding, so the\n // Stripe method boxes never read as cards nested inside another card.\n 'ds:text-[var(--foreground)]',\n 'ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed',\n ].join(' '),\n);\n\nconst fieldLabelVariants = cva(\n ['ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]'].join(' '),\n);\n\nconst labelTextVariants = cva(\n ['type-label', 'ds:text-[var(--foreground)]'].join(' '),\n);\n\nconst amountSummaryVariants = cva(\n [\n 'ds:flex ds:items-baseline ds:justify-between',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]',\n 'ds:bg-[var(--muted)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[var(--foreground)]',\n ].join(' '),\n);\n\nconst submitButtonVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]',\n 'ds:[min-block-size:var(--min-target-size)]',\n 'ds:[min-inline-size:var(--min-target-size)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]',\n 'ds:text-[length:var(--font-size-base)] ds:font-medium',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-[var(--primary-hover)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed',\n 'ds:aria-busy:cursor-wait',\n ].join(' '),\n);\n\n/* ------------------------------------------------------------------ */\n/* Inner form — lives inside the <Elements> provider */\n/* ------------------------------------------------------------------ */\n\ninterface InnerPaymentFormProps {\n amount: number;\n currency: string;\n locale: string;\n billingAddress: boolean;\n returnUrl: string | undefined;\n /** Present in immediate mode; `undefined` in deferred mode. */\n clientSecret: string | undefined;\n /** Deferred-confirm callback; `undefined` → preview (validate-only). */\n onCreatePaymentIntent: PaymentFormProps['onCreatePaymentIntent'];\n onSuccess: PaymentFormProps['onSuccess'];\n onError: PaymentFormProps['onError'];\n layout: NonNullable<PaymentFormProps['layout']>;\n}\n\nfunction InnerPaymentForm(props: InnerPaymentFormProps): ReactElement {\n const {\n amount,\n currency,\n locale,\n billingAddress,\n returnUrl,\n clientSecret,\n onCreatePaymentIntent,\n onSuccess,\n onError,\n layout,\n } = props;\n\n const { t } = useTranslation();\n const stripe = useStripe();\n const elements = useElements();\n\n const rawId = useId();\n const idSafe = useMemo(\n () => `pay-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n const paymentFieldId = `${idSafe}-payment`;\n const addressFieldId = `${idSafe}-address`;\n const errorId = `${idSafe}-error`;\n\n const [processing, setProcessing] = useState(false);\n const [elementComplete, setElementComplete] = useState(false);\n const [errorKey, setErrorKey] = useState<string | null>(null);\n const [errorMessage, setErrorMessage] = useState<string>('');\n\n const onSuccessRef = useRef(onSuccess);\n const onErrorRef = useRef(onError);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onErrorRef.current = onError;\n }, [onSuccess, onError]);\n\n const handleSubmit = useCallback(\n async (event?: FormEvent<HTMLFormElement>): Promise<void> => {\n if (event) event.preventDefault();\n if (!stripe || !elements) return;\n if (processing) return;\n\n setProcessing(true);\n setErrorKey(null);\n setErrorMessage('');\n\n // The single sanitise → map → setError → onError pipeline. Every error\n // surfaced by either path (immediate or deferred) flows through here so\n // raw Stripe English / PAN-like digit runs can never reach the UI or\n // `onError`. `rawMessage` is sanitised; the i18n key is mapped from\n // the Stripe error code.\n const reportError = (\n code: string,\n rawMessage: string | undefined,\n ): void => {\n const key = stripeErrorCodeToI18nKey(code);\n // CRITICAL: sanitise before storing OR forwarding.\n const safe = stripCardLikeDigits(rawMessage ?? '');\n setErrorKey(key);\n setErrorMessage(t(key));\n onErrorRef.current?.({\n code,\n translatedMessage: safe || t(key),\n });\n };\n\n // Validate returnUrl at the boundary so even a careless consumer\n // cannot leak payment_intent_client_secret to a third-party origin.\n const safeReturnUrl = validateReturnUrl(returnUrl);\n if (returnUrl !== undefined && safeReturnUrl === null) {\n setErrorKey('payment.error.invalidReturnUrl');\n setErrorMessage(t('payment.error.invalidReturnUrl'));\n onErrorRef.current?.({\n code: 'invalid_return_url',\n translatedMessage: t('payment.error.invalidReturnUrl'),\n });\n setProcessing(false);\n return;\n }\n\n const confirmParams = safeReturnUrl ? { return_url: safeReturnUrl } : {};\n\n try {\n if (clientSecret !== undefined) {\n // ----- Immediate mode: the consumer already minted the secret. ---\n const result = await stripe.confirmPayment({\n elements,\n confirmParams,\n redirect: 'if_required',\n });\n\n if (result.error) {\n reportError(result.error.code ?? 'generic', result.error.message);\n return;\n }\n\n // Success path — only the PaymentIntent id leaves the wrapper.\n if (result.paymentIntent) {\n onSuccessRef.current?.(result.paymentIntent.id);\n }\n return;\n }\n\n // ----- Deferred-intent mode: no secret up front. -----------------\n // Run client-side field validation first; on failure we run the\n // SAME sanitise/map/report pipeline and stop (no secret minted).\n const { error: submitError } = await elements.submit();\n if (submitError) {\n reportError(submitError.code ?? 'generic', submitError.message);\n return;\n }\n\n // No confirm callback → PREVIEW mode. The field validation above is\n // the end of the flow: no secret is minted, no charge is attempted,\n // and we surface no error — the fields simply validated.\n if (!onCreatePaymentIntent) {\n return;\n }\n\n // Mint the secret on the consumer's server, then confirm with it.\n // The minted secret is used ONLY here and is never logged or sent to\n // a third-party origin.\n const mintedSecret = await onCreatePaymentIntent();\n const result = await stripe.confirmPayment({\n elements,\n clientSecret: mintedSecret,\n confirmParams,\n redirect: 'if_required',\n });\n\n if (result.error) {\n reportError(result.error.code ?? 'generic', result.error.message);\n return;\n }\n\n if (result.paymentIntent) {\n onSuccessRef.current?.(result.paymentIntent.id);\n }\n } catch (err: unknown) {\n const raw = err instanceof Error ? err.message : '';\n // Generic, sanitised — covers a thrown onCreatePaymentIntent and any\n // unexpected SDK rejection. Never surface the raw thrown text.\n reportError('unexpected', raw);\n } finally {\n setProcessing(false);\n }\n },\n [\n stripe,\n elements,\n processing,\n returnUrl,\n clientSecret,\n onCreatePaymentIntent,\n t,\n ],\n );\n\n // Imperative submit hook used by the outer component's ref handle.\n useEffect(() => {\n const host = document.getElementById(idSafe);\n if (!host) return;\n const submitter = () => {\n void handleSubmit();\n };\n host.addEventListener('payment-form:submit', submitter);\n return () => host.removeEventListener('payment-form:submit', submitter);\n }, [idSafe, handleSubmit]);\n\n // Preview mode = deferred (no clientSecret) with no confirm callback. There\n // no charge happens, so we keep the button enabled even before the fields\n // report complete: clicking it triggers `elements.submit()` validation,\n // which is the entire point of the preview.\n const isPreview = clientSecret === undefined && !onCreatePaymentIntent;\n const submitDisabled =\n !stripe || !elements || processing || (!isPreview && !elementComplete);\n\n return (\n <form\n id={idSafe}\n onSubmit={handleSubmit}\n aria-label={t('payment.ariaLabel')}\n aria-busy={processing || undefined}\n noValidate\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <div className={amountSummaryVariants()}>\n <span className={labelTextVariants()}>\n {t('payment.amountLabel')}\n </span>\n <span className=\"type-title-card\" data-testid=\"payment-amount\">\n {formatPaymentAmount(amount, currency, locale)}\n </span>\n </div>\n\n <label\n htmlFor={paymentFieldId}\n className={fieldLabelVariants()}\n data-testid=\"payment-field\"\n >\n <span className={labelTextVariants()}>\n {t('payment.fields.card')}\n </span>\n <PaymentElement\n id={paymentFieldId}\n options={{\n // `tabs` = method tiles (Card selected by default); `accordion`\n // = full-width stacked rows for narrow columns where the tab row\n // clips. Stripe owns overflow + tab alignment either way.\n layout:\n layout === 'accordion'\n ? { type: 'accordion', defaultCollapsed: true }\n : { type: 'tabs' },\n }}\n onChange={(ev) => {\n // NOTE: never log `ev` — change events may include hints\n // about field contents. Keep only the boolean completeness.\n setElementComplete(ev.complete === true);\n if (ev.complete) {\n setErrorKey(null);\n setErrorMessage('');\n }\n }}\n />\n </label>\n\n {billingAddress ? (\n <label\n htmlFor={addressFieldId}\n className={fieldLabelVariants()}\n data-testid=\"payment-address\"\n >\n <span className={labelTextVariants()}>\n {t('payment.billingAddress')}\n </span>\n <AddressElement id={addressFieldId} options={{ mode: 'billing' }} />\n </label>\n ) : null}\n\n {errorKey ? (\n <Alert\n id={errorId}\n variant=\"error\"\n live=\"polite\"\n data-testid=\"payment-error\"\n >\n <Alert.Description>{errorMessage}</Alert.Description>\n </Alert>\n ) : null}\n\n <button\n type=\"submit\"\n aria-disabled={submitDisabled || undefined}\n aria-busy={processing || undefined}\n aria-describedby={errorKey ? errorId : undefined}\n className={submitButtonVariants()}\n data-testid=\"payment-submit\"\n >\n {processing ? (\n <>\n <Spinner size=\"sm\" label={t('payment.processing')} />\n <span>{t('payment.processing')}</span>\n </>\n ) : (\n <span>\n {t('payment.submit', {\n amount: formatPaymentAmount(amount, currency, locale),\n })}\n </span>\n )}\n </button>\n </div>\n </form>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* PaymentForm — outer wrapper */\n/* ------------------------------------------------------------------ */\n\n/**\n * Stripe ships a closed union of supported locales; anything outside it\n * must fall through to `'auto'` (Stripe picks the best match from the\n * browser). We also normalise the legacy `cn` code to `zh` per\n * `src/docs/06-i18n.mdx`.\n */\nconst STRIPE_LOCALES = new Set<StripeElementLocale>([\n 'auto',\n 'ar',\n 'bg',\n 'cs',\n 'da',\n 'de',\n 'el',\n 'en',\n 'en-AU',\n 'en-CA',\n 'en-NZ',\n 'en-GB',\n 'es',\n 'es-ES',\n 'es-419',\n 'et',\n 'fi',\n 'fil',\n 'fr',\n 'fr-CA',\n 'fr-FR',\n 'he',\n 'hu',\n 'hr',\n 'id',\n 'it',\n 'it-IT',\n 'ja',\n 'ko',\n 'lt',\n 'lv',\n 'ms',\n 'mt',\n 'nb',\n 'nl',\n 'no',\n 'pl',\n 'pt',\n 'pt-BR',\n 'ro',\n 'ru',\n 'sk',\n 'sl',\n 'sv',\n 'th',\n 'tr',\n 'vi',\n 'zh',\n 'zh-HK',\n 'zh-TW',\n]);\n\nfunction normaliseLocale(input: string): StripeElementLocale {\n if (!input) return 'auto';\n const candidate = input === 'cn' ? 'zh' : input;\n if ((STRIPE_LOCALES as Set<string>).has(candidate)) {\n return candidate as StripeElementLocale;\n }\n // Try stripping region (\"en-US\" → \"en\") before giving up.\n const base = candidate.split('-')[0];\n if ((STRIPE_LOCALES as Set<string>).has(base)) {\n return base as StripeElementLocale;\n }\n return 'auto';\n}\n\nexport const PaymentForm = forwardRef<HTMLDivElement, PaymentFormProps>(\n (\n {\n id,\n clientSecret,\n mode = 'payment',\n onCreatePaymentIntent,\n publishableKey,\n currency,\n amount,\n onSuccess,\n onError,\n billingAddress = false,\n locale,\n ariaLabel,\n returnUrl,\n stripePromise: injectedStripe,\n layout = 'tabs',\n className,\n },\n ref,\n ) => {\n const { i18n } = useTranslation();\n const activeLocale = normaliseLocale(locale ?? i18n.language ?? 'en');\n\n // Stripe instance — pre-injected (tests/stories) or lazily loaded.\n const [stripeInstance, setStripeInstance] =\n useState<Promise<Stripe | null> | null>(injectedStripe ?? null);\n\n useEffect(() => {\n if (injectedStripe !== undefined) {\n setStripeInstance(injectedStripe);\n return;\n }\n if (!publishableKey) {\n setStripeInstance(null);\n return;\n }\n // `loadStripe` is cached by the SDK — safe to call per mount.\n setStripeInstance(loadStripe(publishableKey));\n }, [injectedStripe, publishableKey]);\n\n // Appearance bridge — snapshot + subscribe.\n const [appearance, setAppearance] = useState<Appearance>(() =>\n getStripeAppearance(),\n );\n useEffect(() => {\n setAppearance(getStripeAppearance());\n const unsubscribe = subscribeStripeAppearance(setAppearance);\n return unsubscribe;\n }, []);\n\n // Imperative handle — dispatch a custom event at the inner form so we\n // can trigger the same submit path as the button without leaking refs\n // through the Stripe `<Elements>` provider (which owns its own tree).\n const hostRef = useRef<HTMLDivElement>(null);\n\n const agentHandle = useMemo<PaymentFormHandle>(\n () => ({\n submit: async () => {\n const form = hostRef.current?.querySelector('form');\n if (form) {\n form.dispatchEvent(\n new CustomEvent('payment-form:submit', { bubbles: true }),\n );\n }\n },\n reset: () => {\n const form = hostRef.current?.querySelector('form');\n if (form instanceof HTMLFormElement) {\n form.reset();\n }\n },\n }),\n [],\n );\n useImperativeHandle(ref, () => hostRef.current as HTMLDivElement, []);\n useAgentRegistration(paymentFormAgent, agentHandle, id);\n\n const elementsOptions = useMemo<StripeElementsOptions>(\n () =>\n clientSecret !== undefined\n ? // Immediate mode — the consumer already created the intent.\n { clientSecret, appearance, locale: activeLocale }\n : // Deferred-intent mode — no secret yet; Stripe needs the intent\n // shape (mode + amount + currency) to render the Payment Element.\n // Stripe expects a lowercase ISO-4217 currency here.\n {\n mode,\n amount,\n currency: currency.toLowerCase(),\n appearance,\n locale: activeLocale,\n },\n [clientSecret, mode, amount, currency, appearance, activeLocale],\n );\n\n return (\n <div\n ref={hostRef}\n aria-label={ariaLabel}\n className={[formVariants(), className].filter(Boolean).join(' ')}\n data-component=\"payment-form\"\n data-component-id={id}\n data-testid=\"payment-form-root\"\n >\n {stripeInstance ? (\n // Render the real Payment Element whenever a Stripe instance is\n // available — in immediate mode (clientSecret present) AND in\n // deferred mode (no secret). The skeleton is reserved for the\n // no-Stripe case (missing publishableKey / injected null).\n <Elements\n stripe={stripeInstance}\n options={elementsOptions}\n key={clientSecret ?? 'deferred'}\n >\n <InnerPaymentForm\n amount={amount}\n currency={currency}\n locale={activeLocale}\n billingAddress={billingAddress}\n returnUrl={returnUrl}\n clientSecret={clientSecret}\n onCreatePaymentIntent={onCreatePaymentIntent}\n onSuccess={onSuccess}\n onError={onError}\n layout={layout}\n />\n </Elements>\n ) : (\n <PaymentFormSkeleton\n amount={amount}\n currency={currency}\n locale={activeLocale}\n billingAddress={billingAddress}\n />\n )}\n </div>\n );\n },\n);\n\nPaymentForm.displayName = 'PaymentForm';\n\n/* ------------------------------------------------------------------ */\n/* Skeleton — visual chrome when Stripe hasn't loaded yet */\n/* ------------------------------------------------------------------ */\n\ninterface PaymentFormSkeletonProps {\n amount: number;\n currency: string;\n locale: string;\n billingAddress: boolean;\n}\n\nfunction PaymentFormSkeleton(props: PaymentFormSkeletonProps): ReactElement {\n const { amount, currency, locale, billingAddress } = props;\n const { t } = useTranslation();\n\n return (\n <div\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n data-testid=\"payment-skeleton\"\n aria-busy=\"true\"\n >\n <div className={amountSummaryVariants()}>\n <span className={labelTextVariants()}>{t('payment.amountLabel')}</span>\n <span className=\"type-title-card\">\n {formatPaymentAmount(amount, currency, locale)}\n </span>\n </div>\n <div className={fieldLabelVariants()}>\n <span className={labelTextVariants()}>{t('payment.fields.card')}</span>\n <div\n className=\"ds:[min-block-size:var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--muted)]\"\n aria-hidden=\"true\"\n />\n </div>\n {billingAddress ? (\n <div className={fieldLabelVariants()} data-testid=\"payment-address\">\n <span className={labelTextVariants()}>\n {t('payment.billingAddress')}\n </span>\n <div\n className=\"ds:[min-block-size:calc(var(--min-target-size)*2)] ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--muted)]\"\n aria-hidden=\"true\"\n />\n </div>\n ) : null}\n <button\n type=\"button\"\n aria-disabled=\"true\"\n className={submitButtonVariants()}\n disabled\n >\n <Spinner size=\"sm\" label={t('payment.processing')} />\n <span>{t('payment.processing')}</span>\n </button>\n </div>\n );\n}\n\nexport {\n formVariants as paymentFormVariants,\n submitButtonVariants as paymentSubmitButtonVariants,\n};\n"],"names":["isBrowser","getStripeAppearance","root","target","styles","read","token","subscribeStripeAppearance","onChange","emit","observer","schemeMql","motionMql","paymentFormAgent","handle","ZERO_DECIMAL_CURRENCIES","formatPaymentAmount","amount","currency","locale","iso","major","validateReturnUrl","returnUrl","raw","resolved","stripCardLikeDigits","message","stripeErrorCodeToI18nKey","code","formVariants","cva","fieldLabelVariants","labelTextVariants","amountSummaryVariants","submitButtonVariants","InnerPaymentForm","props","billingAddress","clientSecret","onCreatePaymentIntent","onSuccess","onError","layout","t","useTranslation","stripe","useStripe","elements","useElements","rawId","useId","idSafe","useMemo","paymentFieldId","addressFieldId","errorId","processing","setProcessing","useState","elementComplete","setElementComplete","errorKey","setErrorKey","errorMessage","setErrorMessage","onSuccessRef","useRef","onErrorRef","useEffect","handleSubmit","useCallback","event","reportError","rawMessage","key","safe","_a","safeReturnUrl","confirmParams","result","_b","submitError","mintedSecret","_c","err","host","submitter","submitDisabled","jsx","jsxs","PaymentElement","ev","AddressElement","Alert","Fragment","Spinner","STRIPE_LOCALES","normaliseLocale","input","candidate","base","PaymentForm","forwardRef","id","mode","publishableKey","ariaLabel","injectedStripe","className","ref","i18n","activeLocale","stripeInstance","setStripeInstance","loadStripe","appearance","setAppearance","hostRef","agentHandle","form","useImperativeHandle","useAgentRegistration","elementsOptions","Elements","PaymentFormSkeleton"],"mappings":";;;;;;;;;AAiBA,SAASA,KAAqB;AAC5B,SAAO,OAAO,WAAa,OAAe,OAAO,SAAW;AAC9D;AAEO,SAASC,EAAoBC,GAAgC;AAClE,MAAI,CAACF;AACH,WAAO,EAAE,OAAO,SAAA;AAGlB,QAAMG,IAASD,KAAQ,SAAS,iBAC1BE,IAAS,iBAAiBD,CAAM,GAChCE,IAAO,CAACC,MAAkBF,EAAO,iBAAiBE,CAAK,EAAE,KAAA;AAG/D,SAAO;AAAA,IACL,OAHaH,EAAO,UAAU,SAAS,YAAY,IAGnC,UAAU;AAAA,IAC1B,WAAW;AAAA,MACT,cAAcE,EAAK,WAAW;AAAA,MAC9B,iBAAiBA,EAAK,cAAc;AAAA,MACpC,WAAWA,EAAK,cAAc;AAAA,MAC9B,aAAaA,EAAK,eAAe;AAAA,MACjC,oBAAoBA,EAAK,oBAAoB;AAAA,MAC7C,sBAAsBA,EAAK,oBAAoB;AAAA,MAC/C,cAAcA,EAAK,aAAa;AAAA,MAChC,YAAYA,EAAK,aAAa;AAAA,MAC9B,cAAcA,EAAK,kBAAkB;AAAA;AAAA;AAAA,MAGrC,aAAaA,EAAK,cAAc;AAAA,IAAA;AAAA,IAElC,OAAO;AAAA,MACL,UAAU;AAAA,QACR,iBAAiBA,EAAK,cAAc;AAAA,QACpC,QAAQ,aAAaA,EAAK,UAAU,CAAC;AAAA,QACrC,OAAOA,EAAK,cAAc;AAAA,QAC1B,SAASA,EAAK,cAAc;AAAA,QAC5B,YAAY,gBAAgBA,EAAK,sBAAsB,CAAC;AAAA,MAAA;AAAA,MAE1D,gBAAgB;AAAA,QACd,aAAaA,EAAK,WAAW;AAAA,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A;AAAA,cAAA,gBAAAsD,EAACO,MAAQ,MAAK,MAAK,OAAOpD,EAAE,oBAAoB,GAAG;AAAA,cACnD,gBAAA6C,EAAC,QAAA,EAAM,UAAA7C,EAAE,oBAAoB,EAAA,CAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACjC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"payment-form-xmeCkxas.js","sources":["../../src/tokens/themes/bridges/stripe-appearance.ts","../../src/components/payment-form/payment-form.agent.ts","../../src/components/payment-form/payment-form.tsx"],"sourcesContent":["import type { Appearance } from '@stripe/stripe-js';\n\n/**\n * Reads the current design-system tokens from a theme-root element and maps\n * them to Stripe Elements' Appearance API. `root` defaults to\n * `document.documentElement` but consumers can pass a scoped theme wrapper\n * (e.g. a modal with its own `.theme-accessible` override) so that Stripe\n * iframes pick up the right token set.\n *\n * Tokens referenced: --primary, --background, --foreground, --muted,\n * --muted-foreground, --border, --destructive, --radius-md, --font-sans,\n * --font-size-base, --spacing-sm, --animation-duration, --focus-ring-width,\n * --ring.\n *\n * No hex / rgb / hsl literals — every value flows from the token layer.\n */\n\nfunction isBrowser(): boolean {\n return typeof document !== 'undefined' && typeof window !== 'undefined';\n}\n\nexport function getStripeAppearance(root?: HTMLElement): Appearance {\n if (!isBrowser()) {\n return { theme: 'stripe' };\n }\n\n const target = root ?? document.documentElement;\n const styles = getComputedStyle(target);\n const read = (token: string) => styles.getPropertyValue(token).trim();\n const isDark = target.classList.contains('theme-dark');\n\n return {\n theme: isDark ? 'night' : 'stripe',\n variables: {\n colorPrimary: read('--primary'),\n colorBackground: read('--background'),\n colorText: read('--foreground'),\n colorDanger: read('--destructive'),\n colorTextSecondary: read('--muted-foreground'),\n colorTextPlaceholder: read('--muted-foreground'),\n borderRadius: read('--radius-md'),\n fontFamily: read('--font-sans'),\n fontSizeBase: read('--font-size-base'),\n // Stripe multiplies spacingUnit throughout every Element; --spacing-sm\n // gives readable density. Keep this in sync with the JSDoc above.\n spacingUnit: read('--spacing-sm'),\n },\n rules: {\n '.Input': {\n backgroundColor: read('--background'),\n border: `1px solid ${read('--border')}`,\n color: read('--foreground'),\n padding: read('--spacing-sm'),\n transition: `border-color ${read('--animation-duration')} ease-out`,\n },\n '.Input:focus': {\n borderColor: read('--primary'),\n boxShadow: `0 0 0 ${read('--focus-ring-width')} ${read('--ring')}`,\n outline: 'none',\n },\n '.Input--invalid': {\n borderColor: read('--destructive'),\n color: read('--foreground'),\n },\n '.Label': {\n color: read('--foreground'),\n fontWeight: read('--font-weight-medium'),\n fontSize: read('--font-size-sm'),\n },\n '.Error': {\n color: read('--destructive'),\n fontSize: read('--font-size-sm'),\n },\n '.Tab': {\n border: `1px solid ${read('--border')}`,\n backgroundColor: read('--background'),\n color: read('--foreground'),\n },\n '.Tab--selected': {\n borderColor: read('--primary'),\n backgroundColor: read('--background'),\n color: read('--primary'),\n },\n // Accordion method rows (the `accordion` layout): keep Stripe's native\n // per-method card structure, restyled with our tokens — our border +\n // radius, our background, `--primary` on the selected row, no extra shadow.\n '.AccordionItem': {\n backgroundColor: read('--background'),\n border: `1px solid ${read('--border')}`,\n borderRadius: read('--radius-md'),\n boxShadow: 'none',\n },\n '.AccordionItem--selected': {\n borderColor: read('--primary'),\n backgroundColor: read('--background'),\n },\n // Stripe's in-method notice blocks (e.g. PayPal's \"you'll be redirected\")\n // otherwise render in their own bordered box — a card nested inside the\n // selected method card. Flatten to inline icon + text, no inner box.\n '.Block': {\n border: 'none',\n borderRadius: '0',\n boxShadow: 'none',\n backgroundColor: 'transparent',\n },\n },\n };\n}\n\n/**\n * Calls `onChange(getStripeAppearance(root))` whenever the theme root's\n * class list mutates (theme switch) or the user toggles\n * `prefers-color-scheme` / `prefers-reduced-motion`. Returns an\n * unsubscribe function.\n */\nexport function subscribeStripeAppearance(\n onChange: (next: Appearance) => void,\n root?: HTMLElement,\n): () => void {\n if (!isBrowser()) return () => undefined;\n\n const target = root ?? document.documentElement;\n const emit = () => onChange(getStripeAppearance(root));\n\n const observer = new MutationObserver(emit);\n observer.observe(target, {\n attributes: true,\n attributeFilter: ['class', 'dir', 'lang'],\n });\n\n const schemeMql = window.matchMedia('(prefers-color-scheme: dark)');\n const motionMql = window.matchMedia('(prefers-reduced-motion: reduce)');\n schemeMql.addEventListener('change', emit);\n motionMql.addEventListener('change', emit);\n\n return () => {\n observer.disconnect();\n schemeMql.removeEventListener('change', emit);\n motionMql.removeEventListener('change', emit);\n };\n}\n","import type { AgentAdapter } from '../../agent/types';\nimport type { PaymentFormHandle } from './payment-form';\n\nexport const paymentFormAgent: AgentAdapter<PaymentFormHandle> = {\n id: 'payment-form',\n capabilities: ['submit'],\n state: {},\n actions: {\n submit: {\n safety: 'destructive',\n description:\n 'Submit the payment. Charges the configured payment method — irreversible.',\n invoke: (handle) => handle.submit(),\n },\n reset: {\n safety: 'destructive',\n description:\n 'Reset the form to its initial state. Loses any in-progress input.',\n invoke: (handle) => {\n handle.reset();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'payment-form' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* PaymentForm — Stripe Elements wrapper (PCI DSS SAQ-A). */\n/* */\n/* - Library: `@stripe/react-stripe-js` + `@stripe/stripe-js` (see */\n/* `src/docs/08-third-party.mdx §Payments`). Card number, expiry, */\n/* CVC, and postal code all live inside Stripe-hosted iframes on */\n/* `js.stripe.com` — raw PAN never touches our origin, keeping us */\n/* inside PCI DSS SAQ-A scope. */\n/* */\n/* - Theming: the `stripe-appearance` bridge snapshots our tokens into */\n/* Stripe's Appearance API (`variables`, `rules`). A */\n/* `MutationObserver` on `<html class>` re-runs the snapshot when */\n/* the user flips theme so the embedded iframes repaint. */\n/* */\n/* - Security invariants enforced in this file: */\n/* 1. No `<input type=\"tel\" name=\"card\">` anywhere. */\n/* 2. Error strings are sanitised via `stripCardLikeDigits` before */\n/* forwarding to `onError` (replaces any `\\b\\d{4,}\\b` with */\n/* `****`). */\n/* 3. Element change events are never logged; any dev-only logging */\n/* is gated behind `import.meta.env.DEV` — never runs in prod. */\n/* */\n/* TODO: */\n/* - Stripe's `direction: 'rtl'` is not part of the current */\n/* `Appearance` TypeScript type; we rely on CSS mirroring of our */\n/* chrome via logical properties and let Stripe lay out the iframe */\n/* ltr for now. Revisit when @stripe/stripe-js publishes the type. */\n/* - No `<CardNumberElement>` / split-fields story — `PaymentElement` */\n/* handles tabs + card-only modes via its own `layout` option. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type FormEvent,\n type ReactElement,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Spinner } from '../spinner';\nimport { Alert } from '../alert';\nimport {\n loadStripe,\n type Stripe,\n type Appearance,\n type StripeElementLocale,\n type StripeElementsOptions,\n} from '@stripe/stripe-js';\nimport {\n Elements,\n PaymentElement,\n AddressElement,\n useElements,\n useStripe,\n} from '@stripe/react-stripe-js';\n\nimport {\n getStripeAppearance,\n subscribeStripeAppearance,\n} from '../../tokens/themes/bridges/stripe-appearance';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { paymentFormAgent } from './payment-form.agent';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type PaymentCurrency = string; // ISO-4217\n\nexport interface PaymentFormProps {\n /** Opaque instance id — emitted as `data-component-id` for the agent registry. */\n id?: string;\n /**\n * Client secret from your server, created via the PaymentIntents API.\n *\n * Omit to use **deferred-intent mode** — the Payment Element renders from\n * just the publishable key (no `clientSecret`, no backend round-trip up\n * front). In deferred mode supply `onCreatePaymentIntent` to actually\n * confirm: your server mints + returns the client secret at submit time.\n */\n clientSecret?: string;\n /**\n * Deferred-intent setup: `'payment'` collects a charge, `'setup'` saves a\n * method for later. Ignored when `clientSecret` is supplied (the secret's\n * own intent type wins). Defaults to `'payment'`.\n */\n mode?: 'payment' | 'setup';\n /**\n * Deferred-confirm callback. Called at submit time (after client-side\n * field validation succeeds) so your server can mint a PaymentIntent and\n * return its `client_secret`. The returned secret is used ONLY to confirm\n * and is never logged or sent to any third-party origin. When omitted in\n * deferred mode the form runs in PREVIEW: fields render + validate, but no\n * charge is attempted.\n */\n onCreatePaymentIntent?: () => Promise<string>;\n /** Stripe publishable key (`pk_test_…` / `pk_live_…`). */\n publishableKey: string;\n /** ISO-4217 currency code (e.g. 'EUR', 'USD', 'JPY'). */\n currency: PaymentCurrency;\n /** Amount in the currency's smallest unit (cents for EUR/USD, yen for JPY). */\n amount: number;\n /** Called with the PaymentIntent id on successful confirmation. */\n onSuccess?: (paymentIntentId: string) => void;\n /** Called with a sanitised error (no PAN digits, no Stripe English strings). */\n onError?: (error: { code: string; translatedMessage: string }) => void;\n /** Show the billing-address collector below the payment fields. */\n billingAddress?: boolean;\n /** Locale override — defaults to the active i18next locale. */\n locale?: string;\n /** Accessible label for the form. */\n ariaLabel?: string;\n /** URL Stripe redirects to when a payment method requires it. */\n returnUrl?: string;\n /** Pre-injected Stripe instance — used by tests + stories to bypass the network. */\n stripePromise?: Promise<Stripe | null> | null;\n /**\n * Payment Element layout. `tabs` (default) renders methods as a tile row —\n * best in wide containers. `accordion` stacks them as full-width rows — use\n * it in narrow columns (< ~400px) where Stripe's tab row clips a partial tile.\n */\n layout?: 'tabs' | 'accordion';\n className?: string;\n}\n\nexport interface PaymentFormHandle {\n /** Programmatically submit the form (same flow as the Pay button). */\n submit: () => Promise<void>;\n /** Reset the form to its initial state. */\n reset: () => void;\n}\n\n/* ------------------------------------------------------------------ */\n/* Currency helpers */\n/* ------------------------------------------------------------------ */\n\n/**\n * Currencies that Stripe bills in their base unit (no decimals). Source:\n * https://stripe.com/docs/currencies#zero-decimal — list pinned per\n * 08-third-party.mdx.\n */\nconst ZERO_DECIMAL_CURRENCIES = new Set<string>([\n 'BIF',\n 'CLP',\n 'DJF',\n 'GNF',\n 'IDR',\n 'JPY',\n 'KMF',\n 'KRW',\n 'MGA',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n]);\n\nexport function formatPaymentAmount(\n amount: number,\n currency: string,\n locale: string,\n): string {\n const iso = currency.toUpperCase();\n const major = ZERO_DECIMAL_CURRENCIES.has(iso) ? amount : amount / 100;\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency: iso,\n }).format(major);\n } catch {\n // Invalid locale/currency pair — fall back to a safe format so we\n // never leak raw amount integers into the UI.\n return new Intl.NumberFormat('en', {\n style: 'currency',\n currency: iso,\n }).format(major);\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Return URL validation */\n/* ------------------------------------------------------------------ */\n\n/**\n * Resolve `returnUrl` against the current origin. Accepts:\n * - absolute URLs on the same origin as `window.location`\n * - relative paths (resolved against the current origin)\n * Rejects (returns `null`):\n * - cross-origin URLs — would leak `payment_intent_client_secret`\n * - `javascript:` / `data:` / `file:` / `blob:` schemes\n * - SSR contexts (no `window`) — the submit path requires a browser\n * anyway, so rejecting here is the safer default.\n * See security-hardening.mdx.\n */\nexport function validateReturnUrl(\n returnUrl: string | undefined,\n): string | null {\n if (returnUrl === undefined) return null;\n const raw = returnUrl.trim();\n if (raw === '') return null;\n if (typeof window === 'undefined') return null;\n try {\n const resolved = new URL(raw, window.location.href);\n const allowedSchemes = new Set(['http:', 'https:']);\n if (!allowedSchemes.has(resolved.protocol)) return null;\n if (resolved.origin !== window.location.origin) return null;\n return resolved.toString();\n } catch {\n return null;\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Error sanitisation */\n/* ------------------------------------------------------------------ */\n\n/**\n * Replace any run of 4+ consecutive digits with `****`. Called before any\n * error text leaves the wrapper. Defensive: even though Stripe's error\n * strings don't normally contain PANs, a future SDK change could, and we\n * want a hard guarantee that `console` / analytics / Sentry breadcrumbs\n * stay clear of anything that looks like card data.\n */\nexport function stripCardLikeDigits(message: string): string {\n if (!message) return message;\n // Deliberately no word boundaries: a PAN run embedded between word\n // characters (e.g. \"CARD4242424242424242DECLINED\") must still be masked.\n return message.replace(/\\d{4,}/g, '****');\n}\n\n/**\n * Map a Stripe error code (e.g. `card_declined`, `incorrect_number`) to a\n * translation key under `payment.error.*`. Unknown codes fall through to\n * `payment.error.generic`.\n */\nexport function stripeErrorCodeToI18nKey(code: string | undefined): string {\n switch (code) {\n case 'incorrect_number':\n case 'invalid_number':\n return 'payment.error.cardNumber';\n case 'invalid_expiry_month':\n case 'invalid_expiry_year':\n case 'expired_card':\n return 'payment.error.expiry';\n case 'invalid_cvc':\n case 'incorrect_cvc':\n return 'payment.error.cvc';\n case 'incorrect_zip':\n case 'invalid_zip':\n return 'payment.error.postalCode';\n case 'card_declined':\n case 'do_not_honor':\n case 'generic_decline':\n return 'payment.error.declined';\n case 'network_error':\n case 'api_connection_error':\n return 'payment.error.network';\n default:\n return 'payment.error.generic';\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst formVariants = cva(\n [\n 'ds:payment-form-alfadocs ds:flex ds:flex-col',\n 'ds:gap-[var(--spacing-md)]',\n // Transparent, padding-less container — the consuming surface (a Card, the\n // check-in step, a checkout column) owns the card chrome + padding, so the\n // Stripe method boxes never read as cards nested inside another card.\n 'ds:text-[var(--foreground)]',\n 'ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed',\n ].join(' '),\n);\n\nconst fieldLabelVariants = cva(\n ['ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]'].join(' '),\n);\n\nconst labelTextVariants = cva(\n ['type-label', 'ds:text-[var(--foreground)]'].join(' '),\n);\n\nconst amountSummaryVariants = cva(\n [\n 'ds:flex ds:items-baseline ds:justify-between',\n 'ds:gap-[var(--spacing-sm)]',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]',\n 'ds:bg-[var(--muted)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[var(--foreground)]',\n ].join(' '),\n);\n\nconst submitButtonVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]',\n 'ds:[min-block-size:var(--min-target-size)]',\n 'ds:[min-inline-size:var(--min-target-size)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]',\n 'ds:text-[length:var(--font-size-base)] ds:font-medium',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-[var(--primary-hover)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed',\n 'ds:aria-busy:cursor-wait',\n ].join(' '),\n);\n\n/* ------------------------------------------------------------------ */\n/* Inner form — lives inside the <Elements> provider */\n/* ------------------------------------------------------------------ */\n\ninterface InnerPaymentFormProps {\n amount: number;\n currency: string;\n locale: string;\n billingAddress: boolean;\n returnUrl: string | undefined;\n /** Present in immediate mode; `undefined` in deferred mode. */\n clientSecret: string | undefined;\n /** Deferred-confirm callback; `undefined` → preview (validate-only). */\n onCreatePaymentIntent: PaymentFormProps['onCreatePaymentIntent'];\n onSuccess: PaymentFormProps['onSuccess'];\n onError: PaymentFormProps['onError'];\n layout: NonNullable<PaymentFormProps['layout']>;\n}\n\nfunction InnerPaymentForm(props: InnerPaymentFormProps): ReactElement {\n const {\n amount,\n currency,\n locale,\n billingAddress,\n returnUrl,\n clientSecret,\n onCreatePaymentIntent,\n onSuccess,\n onError,\n layout,\n } = props;\n\n const { t } = useTranslation();\n const stripe = useStripe();\n const elements = useElements();\n\n const rawId = useId();\n const idSafe = useMemo(\n () => `pay-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n const paymentFieldId = `${idSafe}-payment`;\n const addressFieldId = `${idSafe}-address`;\n const errorId = `${idSafe}-error`;\n\n const [processing, setProcessing] = useState(false);\n const [elementComplete, setElementComplete] = useState(false);\n const [errorKey, setErrorKey] = useState<string | null>(null);\n const [errorMessage, setErrorMessage] = useState<string>('');\n\n const onSuccessRef = useRef(onSuccess);\n const onErrorRef = useRef(onError);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onErrorRef.current = onError;\n }, [onSuccess, onError]);\n\n const handleSubmit = useCallback(\n async (event?: FormEvent<HTMLFormElement>): Promise<void> => {\n if (event) event.preventDefault();\n if (!stripe || !elements) return;\n if (processing) return;\n\n setProcessing(true);\n setErrorKey(null);\n setErrorMessage('');\n\n // The single sanitise → map → setError → onError pipeline. Every error\n // surfaced by either path (immediate or deferred) flows through here so\n // raw Stripe English / PAN-like digit runs can never reach the UI or\n // `onError`. `rawMessage` is sanitised; the i18n key is mapped from\n // the Stripe error code.\n const reportError = (\n code: string,\n rawMessage: string | undefined,\n ): void => {\n const key = stripeErrorCodeToI18nKey(code);\n // CRITICAL: sanitise before storing OR forwarding.\n const safe = stripCardLikeDigits(rawMessage ?? '');\n setErrorKey(key);\n setErrorMessage(t(key));\n onErrorRef.current?.({\n code,\n translatedMessage: safe || t(key),\n });\n };\n\n // Validate returnUrl at the boundary so even a careless consumer\n // cannot leak payment_intent_client_secret to a third-party origin.\n const safeReturnUrl = validateReturnUrl(returnUrl);\n if (returnUrl !== undefined && safeReturnUrl === null) {\n setErrorKey('payment.error.invalidReturnUrl');\n setErrorMessage(t('payment.error.invalidReturnUrl'));\n onErrorRef.current?.({\n code: 'invalid_return_url',\n translatedMessage: t('payment.error.invalidReturnUrl'),\n });\n setProcessing(false);\n return;\n }\n\n const confirmParams = safeReturnUrl ? { return_url: safeReturnUrl } : {};\n\n try {\n if (clientSecret !== undefined) {\n // ----- Immediate mode: the consumer already minted the secret. ---\n const result = await stripe.confirmPayment({\n elements,\n confirmParams,\n redirect: 'if_required',\n });\n\n if (result.error) {\n reportError(result.error.code ?? 'generic', result.error.message);\n return;\n }\n\n // Success path — only the PaymentIntent id leaves the wrapper.\n if (result.paymentIntent) {\n onSuccessRef.current?.(result.paymentIntent.id);\n }\n return;\n }\n\n // ----- Deferred-intent mode: no secret up front. -----------------\n // Run client-side field validation first; on failure we run the\n // SAME sanitise/map/report pipeline and stop (no secret minted).\n const { error: submitError } = await elements.submit();\n if (submitError) {\n reportError(submitError.code ?? 'generic', submitError.message);\n return;\n }\n\n // No confirm callback → PREVIEW mode. The field validation above is\n // the end of the flow: no secret is minted, no charge is attempted,\n // and we surface no error — the fields simply validated.\n if (!onCreatePaymentIntent) {\n return;\n }\n\n // Mint the secret on the consumer's server, then confirm with it.\n // The minted secret is used ONLY here and is never logged or sent to\n // a third-party origin.\n const mintedSecret = await onCreatePaymentIntent();\n const result = await stripe.confirmPayment({\n elements,\n clientSecret: mintedSecret,\n confirmParams,\n redirect: 'if_required',\n });\n\n if (result.error) {\n reportError(result.error.code ?? 'generic', result.error.message);\n return;\n }\n\n if (result.paymentIntent) {\n onSuccessRef.current?.(result.paymentIntent.id);\n }\n } catch (err: unknown) {\n const raw = err instanceof Error ? err.message : '';\n // Generic, sanitised — covers a thrown onCreatePaymentIntent and any\n // unexpected SDK rejection. Never surface the raw thrown text.\n reportError('unexpected', raw);\n } finally {\n setProcessing(false);\n }\n },\n [\n stripe,\n elements,\n processing,\n returnUrl,\n clientSecret,\n onCreatePaymentIntent,\n t,\n ],\n );\n\n // Imperative submit hook used by the outer component's ref handle.\n useEffect(() => {\n const host = document.getElementById(idSafe);\n if (!host) return;\n const submitter = () => {\n void handleSubmit();\n };\n host.addEventListener('payment-form:submit', submitter);\n return () => host.removeEventListener('payment-form:submit', submitter);\n }, [idSafe, handleSubmit]);\n\n // Preview mode = deferred (no clientSecret) with no confirm callback. There\n // no charge happens, so we keep the button enabled even before the fields\n // report complete: clicking it triggers `elements.submit()` validation,\n // which is the entire point of the preview.\n const isPreview = clientSecret === undefined && !onCreatePaymentIntent;\n const submitDisabled =\n !stripe || !elements || processing || (!isPreview && !elementComplete);\n\n return (\n <form\n id={idSafe}\n onSubmit={handleSubmit}\n aria-label={t('payment.ariaLabel')}\n aria-busy={processing || undefined}\n noValidate\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <div className={amountSummaryVariants()}>\n <span className={labelTextVariants()}>\n {t('payment.amountLabel')}\n </span>\n <span className=\"type-title-card\" data-testid=\"payment-amount\">\n {formatPaymentAmount(amount, currency, locale)}\n </span>\n </div>\n\n <label\n htmlFor={paymentFieldId}\n className={fieldLabelVariants()}\n data-testid=\"payment-field\"\n >\n <span className={labelTextVariants()}>\n {t('payment.fields.card')}\n </span>\n <PaymentElement\n id={paymentFieldId}\n options={{\n // `tabs` = method tiles (Card selected by default); `accordion`\n // = full-width stacked rows for narrow columns where the tab row\n // clips. Stripe owns overflow + tab alignment either way.\n layout:\n layout === 'accordion'\n ? { type: 'accordion', defaultCollapsed: true }\n : { type: 'tabs' },\n }}\n onChange={(ev) => {\n // NOTE: never log `ev` — change events may include hints\n // about field contents. Keep only the boolean completeness.\n setElementComplete(ev.complete === true);\n if (ev.complete) {\n setErrorKey(null);\n setErrorMessage('');\n }\n }}\n />\n </label>\n\n {billingAddress ? (\n <label\n htmlFor={addressFieldId}\n className={fieldLabelVariants()}\n data-testid=\"payment-address\"\n >\n <span className={labelTextVariants()}>\n {t('payment.billingAddress')}\n </span>\n <AddressElement id={addressFieldId} options={{ mode: 'billing' }} />\n </label>\n ) : null}\n\n {errorKey ? (\n <Alert\n id={errorId}\n variant=\"error\"\n live=\"polite\"\n data-testid=\"payment-error\"\n >\n <Alert.Description>{errorMessage}</Alert.Description>\n </Alert>\n ) : null}\n\n <button\n type=\"submit\"\n aria-disabled={submitDisabled || undefined}\n aria-busy={processing || undefined}\n aria-describedby={errorKey ? errorId : undefined}\n className={submitButtonVariants()}\n data-testid=\"payment-submit\"\n >\n {processing ? (\n <>\n <Spinner size=\"sm\" label={t('payment.processing')} />\n <span>{t('payment.processing')}</span>\n </>\n ) : (\n <span>\n {t('payment.submit', {\n amount: formatPaymentAmount(amount, currency, locale),\n })}\n </span>\n )}\n </button>\n </div>\n </form>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* PaymentForm — outer wrapper */\n/* ------------------------------------------------------------------ */\n\n/**\n * Stripe ships a closed union of supported locales; anything outside it\n * must fall through to `'auto'` (Stripe picks the best match from the\n * browser). We also normalise the legacy `cn` code to `zh` per\n * `src/docs/06-i18n.mdx`.\n */\nconst STRIPE_LOCALES = new Set<StripeElementLocale>([\n 'auto',\n 'ar',\n 'bg',\n 'cs',\n 'da',\n 'de',\n 'el',\n 'en',\n 'en-AU',\n 'en-CA',\n 'en-NZ',\n 'en-GB',\n 'es',\n 'es-ES',\n 'es-419',\n 'et',\n 'fi',\n 'fil',\n 'fr',\n 'fr-CA',\n 'fr-FR',\n 'he',\n 'hu',\n 'hr',\n 'id',\n 'it',\n 'it-IT',\n 'ja',\n 'ko',\n 'lt',\n 'lv',\n 'ms',\n 'mt',\n 'nb',\n 'nl',\n 'no',\n 'pl',\n 'pt',\n 'pt-BR',\n 'ro',\n 'ru',\n 'sk',\n 'sl',\n 'sv',\n 'th',\n 'tr',\n 'vi',\n 'zh',\n 'zh-HK',\n 'zh-TW',\n]);\n\nfunction normaliseLocale(input: string): StripeElementLocale {\n if (!input) return 'auto';\n const candidate = input === 'cn' ? 'zh' : input;\n if ((STRIPE_LOCALES as Set<string>).has(candidate)) {\n return candidate as StripeElementLocale;\n }\n // Try stripping region (\"en-US\" → \"en\") before giving up.\n const base = candidate.split('-')[0];\n if ((STRIPE_LOCALES as Set<string>).has(base)) {\n return base as StripeElementLocale;\n }\n return 'auto';\n}\n\nexport const PaymentForm = forwardRef<HTMLDivElement, PaymentFormProps>(\n (\n {\n id,\n clientSecret,\n mode = 'payment',\n onCreatePaymentIntent,\n publishableKey,\n currency,\n amount,\n onSuccess,\n onError,\n billingAddress = false,\n locale,\n ariaLabel,\n returnUrl,\n stripePromise: injectedStripe,\n layout = 'tabs',\n className,\n },\n ref,\n ) => {\n const { i18n } = useTranslation();\n const activeLocale = normaliseLocale(locale ?? i18n.language ?? 'en');\n\n // Stripe instance — pre-injected (tests/stories) or lazily loaded.\n const [stripeInstance, setStripeInstance] =\n useState<Promise<Stripe | null> | null>(injectedStripe ?? null);\n\n useEffect(() => {\n if (injectedStripe !== undefined) {\n setStripeInstance(injectedStripe);\n return;\n }\n if (!publishableKey) {\n setStripeInstance(null);\n return;\n }\n // `loadStripe` is cached by the SDK — safe to call per mount.\n setStripeInstance(loadStripe(publishableKey));\n }, [injectedStripe, publishableKey]);\n\n // Appearance bridge — snapshot + subscribe.\n const [appearance, setAppearance] = useState<Appearance>(() =>\n getStripeAppearance(),\n );\n useEffect(() => {\n setAppearance(getStripeAppearance());\n const unsubscribe = subscribeStripeAppearance(setAppearance);\n return unsubscribe;\n }, []);\n\n // Imperative handle — dispatch a custom event at the inner form so we\n // can trigger the same submit path as the button without leaking refs\n // through the Stripe `<Elements>` provider (which owns its own tree).\n const hostRef = useRef<HTMLDivElement>(null);\n\n const agentHandle = useMemo<PaymentFormHandle>(\n () => ({\n submit: async () => {\n const form = hostRef.current?.querySelector('form');\n if (form) {\n form.dispatchEvent(\n new CustomEvent('payment-form:submit', { bubbles: true }),\n );\n }\n },\n reset: () => {\n const form = hostRef.current?.querySelector('form');\n if (form instanceof HTMLFormElement) {\n form.reset();\n }\n },\n }),\n [],\n );\n useImperativeHandle(ref, () => hostRef.current as HTMLDivElement, []);\n useAgentRegistration(paymentFormAgent, agentHandle, id);\n\n const elementsOptions = useMemo<StripeElementsOptions>(\n () =>\n clientSecret !== undefined\n ? // Immediate mode — the consumer already created the intent.\n { clientSecret, appearance, locale: activeLocale }\n : // Deferred-intent mode — no secret yet; Stripe needs the intent\n // shape (mode + amount + currency) to render the Payment Element.\n // Stripe expects a lowercase ISO-4217 currency here.\n {\n mode,\n amount,\n currency: currency.toLowerCase(),\n appearance,\n locale: activeLocale,\n },\n [clientSecret, mode, amount, currency, appearance, activeLocale],\n );\n\n return (\n <div\n ref={hostRef}\n aria-label={ariaLabel}\n className={[formVariants(), className].filter(Boolean).join(' ')}\n data-component=\"payment-form\"\n data-component-id={id}\n data-testid=\"payment-form-root\"\n >\n {stripeInstance ? (\n // Render the real Payment Element whenever a Stripe instance is\n // available — in immediate mode (clientSecret present) AND in\n // deferred mode (no secret). The skeleton is reserved for the\n // no-Stripe case (missing publishableKey / injected null).\n <Elements\n stripe={stripeInstance}\n options={elementsOptions}\n key={clientSecret ?? 'deferred'}\n >\n <InnerPaymentForm\n amount={amount}\n currency={currency}\n locale={activeLocale}\n billingAddress={billingAddress}\n returnUrl={returnUrl}\n clientSecret={clientSecret}\n onCreatePaymentIntent={onCreatePaymentIntent}\n onSuccess={onSuccess}\n onError={onError}\n layout={layout}\n />\n </Elements>\n ) : (\n <PaymentFormSkeleton\n amount={amount}\n currency={currency}\n locale={activeLocale}\n billingAddress={billingAddress}\n />\n )}\n </div>\n );\n },\n);\n\nPaymentForm.displayName = 'PaymentForm';\n\n/* ------------------------------------------------------------------ */\n/* Skeleton — visual chrome when Stripe hasn't loaded yet */\n/* ------------------------------------------------------------------ */\n\ninterface PaymentFormSkeletonProps {\n amount: number;\n currency: string;\n locale: string;\n billingAddress: boolean;\n}\n\nfunction PaymentFormSkeleton(props: PaymentFormSkeletonProps): ReactElement {\n const { amount, currency, locale, billingAddress } = props;\n const { t } = useTranslation();\n\n return (\n <div\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\"\n data-testid=\"payment-skeleton\"\n aria-busy=\"true\"\n >\n <div className={amountSummaryVariants()}>\n <span className={labelTextVariants()}>{t('payment.amountLabel')}</span>\n <span className=\"type-title-card\">\n {formatPaymentAmount(amount, currency, locale)}\n </span>\n </div>\n <div className={fieldLabelVariants()}>\n <span className={labelTextVariants()}>{t('payment.fields.card')}</span>\n <div\n className=\"ds:[min-block-size:var(--min-target-size)] ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--muted)]\"\n aria-hidden=\"true\"\n />\n </div>\n {billingAddress ? (\n <div className={fieldLabelVariants()} data-testid=\"payment-address\">\n <span className={labelTextVariants()}>\n {t('payment.billingAddress')}\n </span>\n <div\n className=\"ds:[min-block-size:calc(var(--min-target-size)*2)] ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ds:bg-[var(--muted)]\"\n aria-hidden=\"true\"\n />\n </div>\n ) : null}\n <button\n type=\"button\"\n aria-disabled=\"true\"\n className={submitButtonVariants()}\n disabled\n >\n <Spinner size=\"sm\" label={t('payment.processing')} />\n <span>{t('payment.processing')}</span>\n </button>\n </div>\n );\n}\n\nexport {\n formVariants as paymentFormVariants,\n submitButtonVariants as paymentSubmitButtonVariants,\n};\n"],"names":["isBrowser","getStripeAppearance","root","target","styles","read","token","subscribeStripeAppearance","onChange","emit","observer","schemeMql","motionMql","paymentFormAgent","handle","ZERO_DECIMAL_CURRENCIES","formatPaymentAmount","amount","currency","locale","iso","major","validateReturnUrl","returnUrl","raw","resolved","stripCardLikeDigits","message","stripeErrorCodeToI18nKey","code","formVariants","cva","fieldLabelVariants","labelTextVariants","amountSummaryVariants","submitButtonVariants","InnerPaymentForm","props","billingAddress","clientSecret","onCreatePaymentIntent","onSuccess","onError","layout","t","useTranslation","stripe","useStripe","elements","useElements","rawId","useId","idSafe","useMemo","paymentFieldId","addressFieldId","errorId","processing","setProcessing","useState","elementComplete","setElementComplete","errorKey","setErrorKey","errorMessage","setErrorMessage","onSuccessRef","useRef","onErrorRef","useEffect","handleSubmit","useCallback","event","reportError","rawMessage","key","safe","_a","safeReturnUrl","confirmParams","result","_b","submitError","mintedSecret","_c","err","host","submitter","submitDisabled","jsx","jsxs","PaymentElement","ev","AddressElement","Alert","Fragment","Spinner","STRIPE_LOCALES","normaliseLocale","input","candidate","base","PaymentForm","forwardRef","id","mode","publishableKey","ariaLabel","injectedStripe","className","ref","i18n","activeLocale","stripeInstance","setStripeInstance","loadStripe","appearance","setAppearance","hostRef","agentHandle","form","useImperativeHandle","useAgentRegistration","elementsOptions","Elements","PaymentFormSkeleton"],"mappings":";;;;;;;;;AAiBA,SAASA,KAAqB;AAC5B,SAAO,OAAO,WAAa,OAAe,OAAO,SAAW;AAC9D;AAEO,SAASC,EAAoBC,GAAgC;AAClE,MAAI,CAACF;AACH,WAAO,EAAE,OAAO,SAAA;AAGlB,QAAMG,IAASD,KAAQ,SAAS,iBAC1BE,IAAS,iBAAiBD,CAAM,GAChCE,IAAO,CAACC,MAAkBF,EAAO,iBAAiBE,CAAK,EAAE,KAAA;AAG/D,SAAO;AAAA,IACL,OAHaH,EAAO,UAAU,SAAS,YAAY,IAGnC,UAAU;AAAA,IAC1B,WAAW;AAAA,MACT,cAAcE,EAAK,WAAW;AAAA,MAC9B,iBAAiBA,EAAK,cAAc;AAAA,MACpC,WAAWA,EAAK,cAAc;AAAA,MAC9B,aAAaA,EAAK,eAAe;AAAA,MACjC,oBAAoBA,EAAK,oBAAoB;AAAA,MAC7C,sBAAsBA,EAAK,oBAAoB;AAAA,MAC/C,cAAcA,EAAK,aAAa;AAAA,MAChC,YAAYA,EAAK,aAAa;AAAA,MAC9B,cAAcA,EAAK,kBAAkB;AAAA;AAAA;AAAA,MAGrC,aAAaA,EAAK,cAAc;AAAA,IAAA;AAAA,IAElC,OAAO;AAAA,MACL,UAAU;AAAA,QACR,iBAAiBA,EAAK,cAAc;AAAA,QACpC,QAAQ,aAAaA,EAAK,UAAU,CAAC;AAAA,QACrC,OAAOA,EAAK,cAAc;AAAA,QAC1B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;AAAA,QACJ,gBAAAC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,iBAAc;AAAA,YACd,WAAWvD,GAAA;AAAA,YACX,UAAQ;AAAA,YAER,UAAA;AAAA,cAAA,gBAAAsD,EAACO,MAAQ,MAAK,MAAK,OAAOpD,EAAE,oBAAoB,GAAG;AAAA,cACnD,gBAAA6C,EAAC,QAAA,EAAM,UAAA7C,EAAE,oBAAoB,EAAA,CAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACjC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -6,7 +6,7 @@ import { useTranslation as pe } from "react-i18next";
|
|
|
6
6
|
import * as ee from "@radix-ui/react-popover";
|
|
7
7
|
import Ce from "pdfjs-dist/legacy/build/pdf.worker.min.mjs?url";
|
|
8
8
|
import { S as Ze } from "./spinner-OjQNn8oN.js";
|
|
9
|
-
import { A as we } from "./alert-
|
|
9
|
+
import { A as we } from "./alert-CUTxnym2.js";
|
|
10
10
|
import { u as Ke } from "./registry-nPAVE19X.js";
|
|
11
11
|
import { X as Be } from "./x-CCcI3eJp.js";
|
|
12
12
|
import { C as He } from "./chevron-left-CX1jqD2M.js";
|
|
@@ -957,4 +957,4 @@ export {
|
|
|
957
957
|
at as P,
|
|
958
958
|
Ge as p
|
|
959
959
|
};
|
|
960
|
-
//# sourceMappingURL=pdf-viewer-
|
|
960
|
+
//# sourceMappingURL=pdf-viewer-q1D3Uion.js.map
|