@funkit/connect-rn 9.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{chunk-3ZNAGQHD.js → chunk-GCPIOARQ.js} +2 -2
  3. package/dist/{chunk-MVQH4YFI.js → chunk-MMXSERQM.js} +281 -73
  4. package/dist/chunk-MMXSERQM.js.map +7 -0
  5. package/dist/{chunk-BC4RXFI7.js → chunk-ZBWCG4O6.js} +2 -1
  6. package/dist/chunk-ZBWCG4O6.js.map +7 -0
  7. package/dist/clients/lighter.js +1 -1
  8. package/dist/clients/nado.js +2 -2
  9. package/dist/index.js +1048 -740
  10. package/dist/index.js.map +4 -4
  11. package/dist/preview.js +11 -1
  12. package/dist/preview.js.map +2 -2
  13. package/dist/src/components/PillButton.d.ts.map +1 -1
  14. package/dist/src/components/v2/AccountBalanceChip.d.ts.map +1 -1
  15. package/dist/src/components/v2/AmountDisplay.d.ts.map +1 -1
  16. package/dist/src/components/v2/NumPad.d.ts.map +1 -1
  17. package/dist/src/fiat/FiatChoiceField.d.ts.map +1 -1
  18. package/dist/src/fiat/FiatChoiceList.d.ts.map +1 -1
  19. package/dist/src/fiat/FiatCountrySheet.d.ts.map +1 -1
  20. package/dist/src/fiat/FiatErrorNotice.d.ts.map +1 -1
  21. package/dist/src/fiat/FiatFailureBanner.d.ts.map +1 -1
  22. package/dist/src/fiat/FiatFormFieldRow.d.ts.map +1 -1
  23. package/dist/src/fiat/FiatFormHeading.d.ts.map +1 -1
  24. package/dist/src/fiat/FiatKycIntroScreen.d.ts.map +1 -1
  25. package/dist/src/fiat/FiatKycNotice.d.ts.map +1 -1
  26. package/dist/src/fiat/FiatKycOptionRow.d.ts.map +1 -1
  27. package/dist/src/fiat/FiatOtpScreen.d.ts.map +1 -1
  28. package/dist/src/fiat/FiatPhoneField.d.ts.map +1 -1
  29. package/dist/src/fiat/FiatReceipt.d.ts.map +1 -1
  30. package/dist/src/fiat/closeFailure.d.ts.map +1 -1
  31. package/dist/src/fiat/kycFormTheme.d.ts +2 -29
  32. package/dist/src/fiat/kycFormTheme.d.ts.map +1 -1
  33. package/dist/src/fiat/paymentReroute.d.ts +30 -0
  34. package/dist/src/fiat/paymentReroute.d.ts.map +1 -0
  35. package/dist/src/fiat/paymentSurfaceFailure.d.ts +7 -7
  36. package/dist/src/fiat/paymentSurfaceFailure.d.ts.map +1 -1
  37. package/dist/src/fiat/providers/StripeSessionAuthScreen.d.ts.map +1 -1
  38. package/dist/src/fiat/providers/adapter.d.ts +15 -5
  39. package/dist/src/fiat/providers/adapter.d.ts.map +1 -1
  40. package/dist/src/fiat/providers/coinbaseFailureCopy.d.ts +7 -2
  41. package/dist/src/fiat/providers/coinbaseFailureCopy.d.ts.map +1 -1
  42. package/dist/src/fiat/providers/kycIntro.d.ts +1 -1
  43. package/dist/src/fiat/providers/moonpayFailureCopy.d.ts +15 -0
  44. package/dist/src/fiat/providers/moonpayFailureCopy.d.ts.map +1 -0
  45. package/dist/src/fiat/providers/stripeCheckout.d.ts.map +1 -1
  46. package/dist/src/fiat/providers/stripeFailureCopy.d.ts +16 -0
  47. package/dist/src/fiat/providers/stripeFailureCopy.d.ts.map +1 -0
  48. package/dist/src/fiat/providers/stripePayment.d.ts.map +1 -1
  49. package/dist/src/flow/DepositFlowContent.d.ts +2 -2
  50. package/dist/src/flow/DepositFlowContent.d.ts.map +1 -1
  51. package/dist/src/flow/DepositReceivedToast.d.ts.map +1 -1
  52. package/dist/src/flow/FiatDepositAmountStep.d.ts +2 -2
  53. package/dist/src/flow/FiatDepositAmountStep.d.ts.map +1 -1
  54. package/dist/src/flow/FlowSheet.d.ts.map +1 -1
  55. package/dist/src/flow/SheetMaterial.d.ts +1 -9
  56. package/dist/src/flow/SheetMaterial.d.ts.map +1 -1
  57. package/dist/src/flow/useDepositReceivedToast.d.ts +10 -1
  58. package/dist/src/flow/useDepositReceivedToast.d.ts.map +1 -1
  59. package/dist/src/preview/flowPreview.d.ts +3 -0
  60. package/dist/src/preview/flowPreview.d.ts.map +1 -1
  61. package/dist/src/preview/scenarioCatalog.d.ts +6 -0
  62. package/dist/src/preview/scenarioCatalog.d.ts.map +1 -1
  63. package/dist/src/preview/scenarios.d.ts.map +1 -1
  64. package/dist/src/screens/FeeDetailsScreen.d.ts.map +1 -1
  65. package/dist/src/screens/depositMetrics.d.ts +2 -25
  66. package/dist/src/screens/depositMetrics.d.ts.map +1 -1
  67. package/dist/src/theme/buildFunkitTheme.d.ts +14 -0
  68. package/dist/src/theme/buildFunkitTheme.d.ts.map +1 -1
  69. package/dist/src/theme/inputTextStyle.d.ts +3 -2
  70. package/dist/src/theme/inputTextStyle.d.ts.map +1 -1
  71. package/dist/src/theme/restyle.d.ts +429 -0
  72. package/dist/src/theme/restyle.d.ts.map +1 -1
  73. package/dist/src/theme/textStyle.d.ts +1 -0
  74. package/dist/src/theme/textStyle.d.ts.map +1 -1
  75. package/dist/src/theme/toRestyleTheme.d.ts +39 -0
  76. package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
  77. package/dist/src/theme/typeScale.d.ts +98 -0
  78. package/dist/src/theme/typeScale.d.ts.map +1 -0
  79. package/package.json +4 -4
  80. package/dist/chunk-BC4RXFI7.js.map +0 -7
  81. package/dist/chunk-MVQH4YFI.js.map +0 -7
  82. package/dist/src/fiat/FiatGradientTitle.d.ts +0 -15
  83. package/dist/src/fiat/FiatGradientTitle.d.ts.map +0 -1
  84. /package/dist/{chunk-3ZNAGQHD.js.map → chunk-GCPIOARQ.js.map} +0 -0
package/dist/index.js CHANGED
@@ -18,13 +18,13 @@ import {
18
18
  useHostFlowPreview,
19
19
  useSeed,
20
20
  useSeededState
21
- } from "./chunk-BC4RXFI7.js";
21
+ } from "./chunk-ZBWCG4O6.js";
22
22
  import {
23
23
  useDynamicConfig,
24
24
  useIsStablecoin,
25
25
  useSourceTokenUsdPrice,
26
26
  useUserIpInfo
27
- } from "./chunk-3ZNAGQHD.js";
27
+ } from "./chunk-GCPIOARQ.js";
28
28
  import {
29
29
  FunkitI18nProvider,
30
30
  FunkitIdentityProvider,
@@ -35,7 +35,7 @@ import {
35
35
  resolveFunkitIdentity,
36
36
  useFunkitIdentity,
37
37
  useFunkitTranslation
38
- } from "./chunk-MVQH4YFI.js";
38
+ } from "./chunk-MMXSERQM.js";
39
39
  import {
40
40
  logger
41
41
  } from "./chunk-ZE77GVDW.js";
@@ -252,6 +252,24 @@ var darkTokens = {
252
252
  // src/theme/toRestyleTheme.ts
253
253
  import { createTheme } from "@shopify/restyle";
254
254
 
255
+ // src/theme/typeScale.ts
256
+ var TYPE_SCALE = {
257
+ display: { size: 40, leading: 1.12, tracking: -0.03, weight: "semibold" },
258
+ title: { size: 24, leading: 1.12, tracking: -0.02, weight: "medium" },
259
+ lead: { size: 21, leading: 1.16, tracking: -0.02, weight: "base" },
260
+ bodyLarge: { size: 17, leading: 1.15, tracking: -0.025, weight: "medium" },
261
+ link: { size: 16, leading: 1.12, tracking: -0.02, weight: "medium" },
262
+ notice: { size: 15, leading: 1.2, tracking: -0.015, weight: "medium" },
263
+ // The fee drawer keeps the pitch and measure its geometry is taken from.
264
+ drawerDetail: { size: 14, leading: 20 / 14, tracking: -0.01, weight: "base" },
265
+ drawerRow: { size: 15, leading: 22 / 15, tracking: 0, weight: "base" },
266
+ caption: { size: 12, leading: 1.24, tracking: -0.02, weight: "medium" },
267
+ codeDigit: { size: 28, leading: 1.12, tracking: -0.02, weight: "medium" },
268
+ amountHero: { size: 96, leading: 1.25, tracking: -0.015, weight: "medium" },
269
+ keypad: { size: 24, leading: 4 / 3, tracking: -0.015, weight: "medium" },
270
+ keypadGlyph: { size: 48, leading: 7 / 6, tracking: -0.015, weight: "medium" }
271
+ };
272
+
255
273
  // src/theme/buildFunkitTheme.ts
256
274
  function cut(family, styleName) {
257
275
  return {
@@ -259,6 +277,19 @@ function cut(family, styleName) {
259
277
  fontWeight: FONT_STYLE_CSS_WEIGHT[styleName]
260
278
  };
261
279
  }
280
+ var toHundredths = (value) => Math.round(value * 100) / 100;
281
+ function scaleVariants(cuts) {
282
+ const variants = {};
283
+ for (const [name, role] of Object.entries(TYPE_SCALE)) {
284
+ variants[name] = {
285
+ ...cuts[role.weight],
286
+ fontSize: role.size,
287
+ lineHeight: toHundredths(role.size * role.leading),
288
+ letterSpacing: toHundredths(role.size * role.tracking)
289
+ };
290
+ }
291
+ return variants;
292
+ }
262
293
  function buildFunkitTheme(tokens) {
263
294
  const { font } = tokens;
264
295
  const base = cut(font.body.family, font.body.weight.base);
@@ -363,7 +394,8 @@ function buildFunkitTheme(tokens) {
363
394
  amountSummary: {
364
395
  ...medium,
365
396
  fontSize: font.header.size.amountSummary
366
- }
397
+ },
398
+ ...scaleVariants({ base, medium, semibold })
367
399
  },
368
400
  // Per-weight `{ fontFamily, fontWeight }` the `Text` `weight` prop applies on
369
401
  // top of any variant (both are required for custom fonts — see
@@ -567,7 +599,7 @@ function useFunkitBranding() {
567
599
  import {
568
600
  forgetRouteLimits as forgetRouteLimits2,
569
601
  randomUuid,
570
- useFeatureGate as useFeatureGate3
602
+ useFeatureGate as useFeatureGate4
571
603
  } from "@funkit/connect-core";
572
604
  import { useQueryClient as useQueryClient3 } from "@tanstack/react-query";
573
605
  import {
@@ -668,13 +700,11 @@ function isDarkColor(color) {
668
700
  // src/flow/SheetMaterial.tsx
669
701
  import { jsx as jsx3 } from "react/jsx-runtime";
670
702
  var BLUR_INTENSITY = 90;
703
+ var DARK_BLUR_INTENSITY = 100;
704
+ var DARK_FILL = "rgba(0, 0, 0, 0.85)";
671
705
  var MATERIAL_CORNER_RADIUS = 65;
672
706
  var SHEET_GLASS_FLOOR = 36;
673
- var GLASS_TINT_ALPHA = iosMajorVersion() >= 27 ? 0.9 : 1;
674
- var GLASS_TINT = {
675
- dark: `rgba(0, 0, 0, ${GLASS_TINT_ALPHA})`,
676
- light: `rgba(255, 255, 255, ${GLASS_TINT_ALPHA})`
677
- };
707
+ var LIGHT_GLASS_TINT = `rgba(255, 255, 255, ${iosMajorVersion() >= 27 ? 0.9 : 1})`;
678
708
  var BLUR_TINT = {
679
709
  dark: "systemUltraThinMaterialDark",
680
710
  light: "systemUltraThinMaterialLight"
@@ -687,15 +717,17 @@ function SheetMaterial({
687
717
  if (FrostedGlassView === null) {
688
718
  return /* @__PURE__ */ jsx3(BlurredSlab, { corner, scheme });
689
719
  }
720
+ const useDarkFrost = scheme === "dark" && isLiquidGlassAvailable;
690
721
  return /* @__PURE__ */ jsx3(
691
722
  FrostedGlassView,
692
723
  {
693
724
  pointerEvents: "none",
694
725
  blurStyle: BLUR_TINT[scheme],
695
- blurIntensity: BLUR_INTENSITY,
726
+ blurIntensity: useDarkFrost ? DARK_BLUR_INTENSITY : BLUR_INTENSITY,
696
727
  colorScheme: scheme,
697
- glassStyle: isLiquidGlassAvailable ? "clear" : void 0,
698
- glassTint: isLiquidGlassAvailable ? GLASS_TINT[scheme] : void 0,
728
+ glassStyle: isLiquidGlassAvailable && !useDarkFrost ? "clear" : void 0,
729
+ glassTint: isLiquidGlassAvailable && !useDarkFrost ? LIGHT_GLASS_TINT : void 0,
730
+ fillColor: useDarkFrost ? DARK_FILL : void 0,
699
731
  cornerRadius: corner ?? MATERIAL_CORNER_RADIUS,
700
732
  concentricCorners: corner === void 0,
701
733
  concentricMinimumRadius: SHEET_GLASS_FLOOR,
@@ -3649,158 +3681,6 @@ function usePressScale({
3649
3681
  return { pressStyle, onPressIn, onPressOut };
3650
3682
  }
3651
3683
 
3652
- // src/screens/depositMetrics.ts
3653
- var DEPOSIT_METRICS = {
3654
- reference: { width: 393, height: 852, insetTop: 59, insetBottom: 34 },
3655
- narrowDeviceWidth: 380,
3656
- sideMargin: 24,
3657
- narrowSideMargin: 16,
3658
- grabber: { width: 60, height: 5, radius: 5, top: 64 },
3659
- header: {
3660
- top: 92,
3661
- height: 32,
3662
- titleTop: 100,
3663
- titleSize: 24,
3664
- titleLineHeight: 23.76
3665
- },
3666
- balance: {
3667
- labelSize: 12,
3668
- labelLineHeight: 13.8,
3669
- labelTracking: -0.36,
3670
- labelTop: 93,
3671
- valueSize: 15,
3672
- valueLineHeight: 17.25,
3673
- valueTracking: -0.48,
3674
- valueTop: 107,
3675
- centsSize: 10.5,
3676
- avatarSize: 32,
3677
- avatarRight: 16,
3678
- avatarGap: 6
3679
- },
3680
- amount: {
3681
- size: 96,
3682
- tracking: -1.44,
3683
- height: 114,
3684
- centerY: 291,
3685
- placeholderOpacity: 0.1
3686
- },
3687
- method: { left: 36, top: 444, width: 56.6, height: 24 },
3688
- // PaymentSourceItem on the picker frame, Figma 3121:9891. The frame keeps the
3689
- // chips and the keypad where they were and centres the amount higher.
3690
- paymentMethodPicker: {
3691
- top: 412,
3692
- height: 68,
3693
- radius: 26,
3694
- leadingWidth: 68,
3695
- // No frame draws the row without a glyph; the label then sits this far in.
3696
- labelInsetWithoutIcon: 20,
3697
- iconSize: 26,
3698
- trailingWidth: 56,
3699
- chevronSize: 20,
3700
- labelSize: 17,
3701
- labelLineHeight: 22,
3702
- labelTracking: -0.425,
3703
- amountCenterY: 253,
3704
- feeGap: 20
3705
- },
3706
- notice: { bottom: 126 },
3707
- fee: {
3708
- size: 15,
3709
- lineHeight: 15,
3710
- tracking: -0.6,
3711
- rightInset: 2,
3712
- centerY: 459.5,
3713
- buttonGap: 21
3714
- },
3715
- // AmountRecommendationsRow, Figma 2814:7823 — four 82.25pt chips over 353.
3716
- // Size comes from the `detail` type token, so only tracking is measured here.
3717
- chips: {
3718
- width: 329,
3719
- height: 64,
3720
- top: 483,
3721
- paddingVertical: 5,
3722
- chipWidth: 70,
3723
- chipHeight: 48,
3724
- gap: 8,
3725
- radius: 14,
3726
- tracking: -0.28
3727
- },
3728
- button: { height: 56, top: 488, radius: 999, fontSize: 17, tracking: -0.68 },
3729
- numpad: {
3730
- width: 274,
3731
- height: 198,
3732
- top: 574,
3733
- rowPitch: 60,
3734
- lineHeight: 18,
3735
- fontSize: 24,
3736
- tracking: -0.36,
3737
- decimalSize: 48,
3738
- decimalTracking: -0.72,
3739
- decimalOffsetY: -10,
3740
- buttonGap: 30,
3741
- bottomGap: 80
3742
- },
3743
- disclosure: { keypadGap: 28, bottomGap: 24, height: 28 },
3744
- // Figma 2812:2233, the fee drawer over this frame.
3745
- feeDrawer: { height: 369 },
3746
- watermarkTop: 818
3747
- };
3748
- function depositSideMargin(width) {
3749
- return width <= DEPOSIT_METRICS.narrowDeviceWidth ? DEPOSIT_METRICS.narrowSideMargin : DEPOSIT_METRICS.sideMargin;
3750
- }
3751
- var ACTIONS_BOTTOM = DEPOSIT_METRICS.button.top + DEPOSIT_METRICS.button.height;
3752
- var DEPOSIT_ACTIONS_HEIGHT = ACTIONS_BOTTOM - DEPOSIT_METRICS.method.top;
3753
- function depositActionsHeight(hasPaymentMethodPicker) {
3754
- return hasPaymentMethodPicker ? ACTIONS_BOTTOM - DEPOSIT_METRICS.paymentMethodPicker.top : DEPOSIT_ACTIONS_HEIGHT;
3755
- }
3756
- var FEE_ROW_BOTTOM = DEPOSIT_METRICS.button.height + DEPOSIT_METRICS.fee.buttonGap;
3757
- function depositFeeRowBottom(hasPaymentMethodPicker) {
3758
- return hasPaymentMethodPicker ? depositActionsHeight(true) + DEPOSIT_METRICS.paymentMethodPicker.feeGap : FEE_ROW_BOTTOM;
3759
- }
3760
- function depositNoticeBottom(hasPaymentMethodPicker) {
3761
- return DEPOSIT_METRICS.notice.bottom - FEE_ROW_BOTTOM + depositFeeRowBottom(hasPaymentMethodPicker);
3762
- }
3763
- function depositFeeOverhang(hasPaymentMethodPicker) {
3764
- return hasPaymentMethodPicker ? depositFeeRowBottom(true) + DEPOSIT_METRICS.method.height - depositActionsHeight(true) : 0;
3765
- }
3766
- function depositNoticeOverhang(noticeHeight, hasPaymentMethodPicker = false) {
3767
- return Math.max(
3768
- 0,
3769
- depositNoticeBottom(hasPaymentMethodPicker) + noticeHeight - depositActionsHeight(hasPaymentMethodPicker)
3770
- );
3771
- }
3772
- function depositNumpadBottom(insetBottom) {
3773
- return DEPOSIT_METRICS.numpad.bottomGap - DEPOSIT_METRICS.reference.insetBottom + insetBottom;
3774
- }
3775
- function feeDrawerMinHeight(insetBottom) {
3776
- const ctaTop = depositNumpadBottom(insetBottom) + DEPOSIT_METRICS.numpad.height + DEPOSIT_METRICS.numpad.buttonGap + DEPOSIT_METRICS.button.height;
3777
- const overlap = DEPOSIT_METRICS.feeDrawer.height - (DEPOSIT_METRICS.reference.height - DEPOSIT_METRICS.button.top);
3778
- return ctaTop + overlap;
3779
- }
3780
- function depositAmountCenter(height, insetTop, insetBottom, noticeOverhang = 0, hasPaymentMethodPicker = false) {
3781
- const headerBottom = DEPOSIT_METRICS.header.top + DEPOSIT_METRICS.header.height;
3782
- const regionTop = headerBottom + insetTop - DEPOSIT_METRICS.reference.insetTop;
3783
- const regionBottom = height - depositNumpadBottom(insetBottom) - DEPOSIT_METRICS.numpad.height - DEPOSIT_METRICS.numpad.buttonGap - depositActionsHeight(hasPaymentMethodPicker);
3784
- const centerFraction = hasPaymentMethodPicker ? (DEPOSIT_METRICS.paymentMethodPicker.amountCenterY - headerBottom) / (DEPOSIT_METRICS.paymentMethodPicker.top - headerBottom) : (DEPOSIT_METRICS.amount.centerY - headerBottom) / (DEPOSIT_METRICS.method.top - headerBottom);
3785
- const firstCenter = regionTop + DEPOSIT_METRICS.amount.height / 2;
3786
- const lastCenter = Math.max(
3787
- firstCenter,
3788
- regionBottom - DEPOSIT_METRICS.amount.height / 2
3789
- );
3790
- const centered = Math.min(
3791
- lastCenter,
3792
- Math.max(
3793
- firstCenter,
3794
- regionTop + (regionBottom - regionTop) * centerFraction
3795
- )
3796
- );
3797
- const clearOfNotice = regionBottom - Math.max(noticeOverhang, depositFeeOverhang(hasPaymentMethodPicker)) - DEPOSIT_METRICS.amount.height / 2;
3798
- return Math.max(firstCenter, Math.min(centered, clearOfNotice));
3799
- }
3800
- function depositMinimumHeight(insetTop, insetBottom, hasPaymentMethodPicker = false) {
3801
- return DEPOSIT_METRICS.header.top + DEPOSIT_METRICS.header.height + insetTop - DEPOSIT_METRICS.reference.insetTop + DEPOSIT_METRICS.amount.height + depositFeeOverhang(hasPaymentMethodPicker) + depositActionsHeight(hasPaymentMethodPicker) + DEPOSIT_METRICS.numpad.buttonGap + DEPOSIT_METRICS.numpad.height + depositNumpadBottom(insetBottom);
3802
- }
3803
-
3804
3684
  // src/components/DepositActionMotion.tsx
3805
3685
  import {
3806
3686
  createContext as createContext7,
@@ -4274,13 +4154,9 @@ function LabelledPill({
4274
4154
  /* @__PURE__ */ jsx27(
4275
4155
  Text,
4276
4156
  {
4277
- variant: "bodyMedium",
4157
+ variant: "bodyLarge",
4278
4158
  numberOfLines: 1,
4279
- style: {
4280
- color: labelColor,
4281
- fontSize: DEPOSIT_METRICS.button.fontSize,
4282
- letterSpacing: DEPOSIT_METRICS.button.tracking
4283
- },
4159
+ style: { color: labelColor },
4284
4160
  children: label
4285
4161
  }
4286
4162
  ),
@@ -4677,9 +4553,11 @@ function FlowSheet({
4677
4553
  const { t } = useFunkitTranslation();
4678
4554
  const hasPresented = useRef10(false);
4679
4555
  const sheetSelfDismissed = useRef10(false);
4556
+ const dismissReported = useRef10(false);
4680
4557
  useEffect16(() => {
4681
4558
  if (isOpen) {
4682
4559
  sheetSelfDismissed.current = false;
4560
+ dismissReported.current = false;
4683
4561
  ref.current?.present();
4684
4562
  hasPresented.current = true;
4685
4563
  return;
@@ -4703,11 +4581,20 @@ function FlowSheet({
4703
4581
  to,
4704
4582
  session: latest.current.session
4705
4583
  });
4584
+ dismissReported.current = false;
4706
4585
  if (to === -1) {
4707
4586
  closingSession.current = latest.current.session;
4708
4587
  }
4709
4588
  }, []);
4710
4589
  const handleDismiss = useCallback7(() => {
4590
+ if (dismissReported.current) {
4591
+ dismissReported.current = false;
4592
+ logger.info("connect-rn:flow:repeat_dismiss_ignored", {
4593
+ session: latest.current.session
4594
+ });
4595
+ return;
4596
+ }
4597
+ dismissReported.current = true;
4711
4598
  const { isOpen: open, session: current } = latest.current;
4712
4599
  const closed = closingSession.current;
4713
4600
  closingSession.current = void 0;
@@ -8304,8 +8191,141 @@ var styles20 = StyleSheet21.create({
8304
8191
 
8305
8192
  // src/components/v2/AccountBalanceChip.tsx
8306
8193
  import { Pressable as Pressable14, StyleSheet as StyleSheet22 } from "react-native";
8194
+
8195
+ // src/screens/depositMetrics.ts
8196
+ var DEPOSIT_METRICS = {
8197
+ reference: { width: 393, height: 852, insetTop: 59, insetBottom: 34 },
8198
+ narrowDeviceWidth: 380,
8199
+ sideMargin: 24,
8200
+ narrowSideMargin: 16,
8201
+ grabber: { width: 60, height: 5, radius: 5, top: 64 },
8202
+ header: {
8203
+ top: 92,
8204
+ height: 32,
8205
+ titleTop: 100
8206
+ },
8207
+ balance: {
8208
+ labelTop: 93,
8209
+ valueTop: 107,
8210
+ avatarSize: 32,
8211
+ avatarRight: 16,
8212
+ avatarGap: 6
8213
+ },
8214
+ amount: {
8215
+ height: 114,
8216
+ centerY: 291,
8217
+ placeholderOpacity: 0.1
8218
+ },
8219
+ method: { left: 36, top: 444, width: 56.6, height: 24 },
8220
+ // PaymentSourceItem on the picker frame, Figma 3121:9891. The frame keeps the
8221
+ // chips and the keypad where they were and centres the amount higher.
8222
+ paymentMethodPicker: {
8223
+ top: 412,
8224
+ height: 68,
8225
+ radius: 26,
8226
+ leadingWidth: 68,
8227
+ // No frame draws the row without a glyph; the label then sits this far in.
8228
+ labelInsetWithoutIcon: 20,
8229
+ iconSize: 26,
8230
+ trailingWidth: 56,
8231
+ chevronSize: 20,
8232
+ amountCenterY: 253,
8233
+ feeGap: 20
8234
+ },
8235
+ notice: { bottom: 126 },
8236
+ fee: {
8237
+ rightInset: 2,
8238
+ centerY: 459.5,
8239
+ buttonGap: 21
8240
+ },
8241
+ // AmountRecommendationsRow, Figma 2814:7823 — four 82.25pt chips over 353.
8242
+ chips: {
8243
+ width: 329,
8244
+ height: 64,
8245
+ top: 483,
8246
+ paddingVertical: 5,
8247
+ chipWidth: 70,
8248
+ chipHeight: 48,
8249
+ gap: 8,
8250
+ radius: 14
8251
+ },
8252
+ button: { height: 56, top: 488, radius: 999 },
8253
+ numpad: {
8254
+ width: 274,
8255
+ height: 198,
8256
+ top: 574,
8257
+ rowPitch: 60,
8258
+ /** The height Figma bounds each row of glyphs to, inside its pitch. */
8259
+ glyphRowHeight: 18,
8260
+ decimalOffsetY: -10,
8261
+ buttonGap: 30,
8262
+ bottomGap: 80
8263
+ },
8264
+ disclosure: { keypadGap: 28, bottomGap: 24, height: 28 },
8265
+ // Figma 2812:2233, the fee drawer over this frame.
8266
+ feeDrawer: { height: 369 },
8267
+ watermarkTop: 818
8268
+ };
8269
+ function depositSideMargin(width) {
8270
+ return width <= DEPOSIT_METRICS.narrowDeviceWidth ? DEPOSIT_METRICS.narrowSideMargin : DEPOSIT_METRICS.sideMargin;
8271
+ }
8272
+ var ACTIONS_BOTTOM = DEPOSIT_METRICS.button.top + DEPOSIT_METRICS.button.height;
8273
+ var DEPOSIT_ACTIONS_HEIGHT = ACTIONS_BOTTOM - DEPOSIT_METRICS.method.top;
8274
+ function depositActionsHeight(hasPaymentMethodPicker) {
8275
+ return hasPaymentMethodPicker ? ACTIONS_BOTTOM - DEPOSIT_METRICS.paymentMethodPicker.top : DEPOSIT_ACTIONS_HEIGHT;
8276
+ }
8277
+ var FEE_ROW_BOTTOM = DEPOSIT_METRICS.button.height + DEPOSIT_METRICS.fee.buttonGap;
8278
+ function depositFeeRowBottom(hasPaymentMethodPicker) {
8279
+ return hasPaymentMethodPicker ? depositActionsHeight(true) + DEPOSIT_METRICS.paymentMethodPicker.feeGap : FEE_ROW_BOTTOM;
8280
+ }
8281
+ function depositNoticeBottom(hasPaymentMethodPicker) {
8282
+ return DEPOSIT_METRICS.notice.bottom - FEE_ROW_BOTTOM + depositFeeRowBottom(hasPaymentMethodPicker);
8283
+ }
8284
+ function depositFeeOverhang(hasPaymentMethodPicker) {
8285
+ return hasPaymentMethodPicker ? depositFeeRowBottom(true) + DEPOSIT_METRICS.method.height - depositActionsHeight(true) : 0;
8286
+ }
8287
+ function depositNoticeOverhang(noticeHeight, hasPaymentMethodPicker = false) {
8288
+ return Math.max(
8289
+ 0,
8290
+ depositNoticeBottom(hasPaymentMethodPicker) + noticeHeight - depositActionsHeight(hasPaymentMethodPicker)
8291
+ );
8292
+ }
8293
+ function depositNumpadBottom(insetBottom) {
8294
+ return DEPOSIT_METRICS.numpad.bottomGap - DEPOSIT_METRICS.reference.insetBottom + insetBottom;
8295
+ }
8296
+ function feeDrawerMinHeight(insetBottom) {
8297
+ const ctaTop = depositNumpadBottom(insetBottom) + DEPOSIT_METRICS.numpad.height + DEPOSIT_METRICS.numpad.buttonGap + DEPOSIT_METRICS.button.height;
8298
+ const overlap = DEPOSIT_METRICS.feeDrawer.height - (DEPOSIT_METRICS.reference.height - DEPOSIT_METRICS.button.top);
8299
+ return ctaTop + overlap;
8300
+ }
8301
+ function depositAmountCenter(height, insetTop, insetBottom, noticeOverhang = 0, hasPaymentMethodPicker = false) {
8302
+ const headerBottom = DEPOSIT_METRICS.header.top + DEPOSIT_METRICS.header.height;
8303
+ const regionTop = headerBottom + insetTop - DEPOSIT_METRICS.reference.insetTop;
8304
+ const regionBottom = height - depositNumpadBottom(insetBottom) - DEPOSIT_METRICS.numpad.height - DEPOSIT_METRICS.numpad.buttonGap - depositActionsHeight(hasPaymentMethodPicker);
8305
+ const centerFraction = hasPaymentMethodPicker ? (DEPOSIT_METRICS.paymentMethodPicker.amountCenterY - headerBottom) / (DEPOSIT_METRICS.paymentMethodPicker.top - headerBottom) : (DEPOSIT_METRICS.amount.centerY - headerBottom) / (DEPOSIT_METRICS.method.top - headerBottom);
8306
+ const firstCenter = regionTop + DEPOSIT_METRICS.amount.height / 2;
8307
+ const lastCenter = Math.max(
8308
+ firstCenter,
8309
+ regionBottom - DEPOSIT_METRICS.amount.height / 2
8310
+ );
8311
+ const centered = Math.min(
8312
+ lastCenter,
8313
+ Math.max(
8314
+ firstCenter,
8315
+ regionTop + (regionBottom - regionTop) * centerFraction
8316
+ )
8317
+ );
8318
+ const clearOfNotice = regionBottom - Math.max(noticeOverhang, depositFeeOverhang(hasPaymentMethodPicker)) - DEPOSIT_METRICS.amount.height / 2;
8319
+ return Math.max(firstCenter, Math.min(centered, clearOfNotice));
8320
+ }
8321
+ function depositMinimumHeight(insetTop, insetBottom, hasPaymentMethodPicker = false) {
8322
+ return DEPOSIT_METRICS.header.top + DEPOSIT_METRICS.header.height + insetTop - DEPOSIT_METRICS.reference.insetTop + DEPOSIT_METRICS.amount.height + depositFeeOverhang(hasPaymentMethodPicker) + depositActionsHeight(hasPaymentMethodPicker) + DEPOSIT_METRICS.numpad.buttonGap + DEPOSIT_METRICS.numpad.height + depositNumpadBottom(insetBottom);
8323
+ }
8324
+
8325
+ // src/components/v2/AccountBalanceChip.tsx
8307
8326
  import { jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
8308
8327
  var AVATAR_SIZE = DEPOSIT_METRICS.balance.avatarSize;
8328
+ var CENTS_SIZE = 10.5;
8309
8329
  function AccountBalanceChip({
8310
8330
  label,
8311
8331
  value,
@@ -8320,25 +8340,35 @@ function AccountBalanceChip({
8320
8340
  /* @__PURE__ */ jsx44(
8321
8341
  Text,
8322
8342
  {
8343
+ variant: "caption",
8344
+ weight: "base",
8323
8345
  numberOfLines: 1,
8324
- style: [styles21.label, { color: theme.content.elements.secondary }],
8346
+ style: { color: theme.content.elements.secondary },
8325
8347
  children: label
8326
8348
  }
8327
8349
  ),
8328
- /* @__PURE__ */ jsxs24(Text, { weight: "medium", numberOfLines: 1, style: styles21.value, children: [
8329
- whole,
8330
- cents ? /* @__PURE__ */ jsx44(
8331
- Text,
8332
- {
8333
- weight: "medium",
8334
- style: [
8335
- styles21.cents,
8336
- { color: theme.content.elements.secondary }
8337
- ],
8338
- children: cents
8339
- }
8340
- ) : null
8341
- ] })
8350
+ /* @__PURE__ */ jsxs24(
8351
+ Text,
8352
+ {
8353
+ variant: "notice",
8354
+ numberOfLines: 1,
8355
+ style: { marginTop: valueGap(theme) },
8356
+ children: [
8357
+ whole,
8358
+ cents ? /* @__PURE__ */ jsx44(
8359
+ Text,
8360
+ {
8361
+ variant: "notice",
8362
+ style: [
8363
+ styles21.cents,
8364
+ { color: theme.content.elements.secondary }
8365
+ ],
8366
+ children: cents
8367
+ }
8368
+ ) : null
8369
+ ]
8370
+ }
8371
+ )
8342
8372
  ] }),
8343
8373
  /* @__PURE__ */ jsx44(Box, { style: styles21.avatar, children: avatar })
8344
8374
  ] });
@@ -8356,6 +8386,9 @@ function AccountBalanceChip({
8356
8386
  }
8357
8387
  );
8358
8388
  }
8389
+ function valueGap(theme) {
8390
+ return DEPOSIT_METRICS.balance.valueTop - DEPOSIT_METRICS.balance.labelTop - (theme.textVariants.caption.lineHeight ?? 0);
8391
+ }
8359
8392
  function splitCents(value) {
8360
8393
  const point = value.lastIndexOf(".");
8361
8394
  if (point < 0) {
@@ -8369,21 +8402,8 @@ var styles21 = StyleSheet22.create({
8369
8402
  height: DEPOSIT_METRICS.header.height,
8370
8403
  paddingTop: DEPOSIT_METRICS.balance.labelTop - DEPOSIT_METRICS.header.top
8371
8404
  },
8372
- label: {
8373
- fontSize: DEPOSIT_METRICS.balance.labelSize,
8374
- lineHeight: DEPOSIT_METRICS.balance.labelLineHeight,
8375
- letterSpacing: DEPOSIT_METRICS.balance.labelTracking
8376
- },
8377
- value: {
8378
- fontSize: DEPOSIT_METRICS.balance.valueSize,
8379
- lineHeight: DEPOSIT_METRICS.balance.valueLineHeight,
8380
- letterSpacing: DEPOSIT_METRICS.balance.valueTracking,
8381
- marginTop: DEPOSIT_METRICS.balance.valueTop - DEPOSIT_METRICS.balance.labelTop - DEPOSIT_METRICS.balance.labelLineHeight
8382
- },
8383
- cents: {
8384
- fontSize: DEPOSIT_METRICS.balance.centsSize,
8385
- lineHeight: DEPOSIT_METRICS.balance.valueLineHeight
8386
- },
8405
+ // oxlint-disable-next-line funkit/no-raw-typography -- a suffix run inside the notice line, smaller than any role
8406
+ cents: { fontSize: CENTS_SIZE },
8387
8407
  avatar: {
8388
8408
  width: AVATAR_SIZE,
8389
8409
  height: AVATAR_SIZE,
@@ -8496,10 +8516,7 @@ var styles22 = StyleSheet23.create({
8496
8516
  overflow: { width: "auto" },
8497
8517
  // The amount above sets the screen's figure style, so the chips take it too —
8498
8518
  // otherwise their digits read as a different face next to it.
8499
- label: {
8500
- letterSpacing: DEPOSIT_METRICS.chips.tracking,
8501
- fontVariant: ["tabular-nums"]
8502
- },
8519
+ label: { fontVariant: ["tabular-nums"] },
8503
8520
  animatedContent: { flex: 1, justifyContent: "center", alignItems: "center" },
8504
8521
  // Sharing the row means sharing its width; a scrolling row keeps Figma's.
8505
8522
  shortcut: { flex: 1 },
@@ -8595,10 +8612,8 @@ function amountRowGeometry(measured, available) {
8595
8612
 
8596
8613
  // src/components/v2/AmountDisplay.tsx
8597
8614
  import { jsx as jsx46 } from "react/jsx-runtime";
8598
- var AMOUNT_FONT_SIZE = DEPOSIT_METRICS.amount.size;
8599
8615
  var PLACEHOLDER_OPACITY = DEPOSIT_METRICS.amount.placeholderOpacity;
8600
- var LINE_HEIGHT = 120;
8601
- var LETTER_SPACING = DEPOSIT_METRICS.amount.tracking;
8616
+ var LINE_HEIGHT = TYPE_SCALE.amountHero.size * TYPE_SCALE.amountHero.leading;
8602
8617
  var CAP_BOX = 68;
8603
8618
  var WARNING_COLOR = "#FFF530";
8604
8619
  var AnimatedBox2 = Animated9.createAnimatedComponent(Box);
@@ -8712,7 +8727,7 @@ var Glyph = memo2(function Glyph2({
8712
8727
  children: /* @__PURE__ */ jsx46(
8713
8728
  AnimatedText,
8714
8729
  {
8715
- weight: "medium",
8730
+ variant: "amountHero",
8716
8731
  numberOfLines: 1,
8717
8732
  style: [styles23.glyph, { color }, dimming ?? null],
8718
8733
  children: char
@@ -8853,12 +8868,7 @@ var styles23 = StyleSheet24.create({
8853
8868
  alignSelf: "flex-start",
8854
8869
  transformOrigin: "left center"
8855
8870
  },
8856
- glyph: {
8857
- fontSize: AMOUNT_FONT_SIZE,
8858
- lineHeight: LINE_HEIGHT,
8859
- letterSpacing: LETTER_SPACING,
8860
- fontVariant: []
8861
- }
8871
+ glyph: { fontVariant: [] }
8862
8872
  });
8863
8873
 
8864
8874
  // src/components/v2/NumPad.tsx
@@ -8881,7 +8891,6 @@ function DepositChevronIcon({ color }) {
8881
8891
 
8882
8892
  // src/components/v2/NumPad.tsx
8883
8893
  import { jsx as jsx48 } from "react/jsx-runtime";
8884
- var KEY_FONT_SIZE = DEPOSIT_METRICS.numpad.fontSize;
8885
8894
  var COLUMN_ALIGNMENT = ["flex-start", "center", "flex-end"];
8886
8895
  var KEY_PRESS_SCALE = 2.3;
8887
8896
  var KEY_PRESS_IN_DURATION = 80;
@@ -8973,7 +8982,7 @@ var NumPadKey = memo3(function NumPadKey2({
8973
8982
  children: /* @__PURE__ */ jsx48(AnimatedBox3, { style: pressScaling, children: numpadKey === "backspace" ? /* @__PURE__ */ jsx48(DepositChevronIcon, { color: deleteColor }) : /* @__PURE__ */ jsx48(
8974
8983
  Text,
8975
8984
  {
8976
- weight: "medium",
8985
+ variant: numpadKey === "." ? "keypadGlyph" : "keypad",
8977
8986
  style: [
8978
8987
  styles24.label,
8979
8988
  numpadKey === "." ? styles24.decimalLabel : null
@@ -8987,19 +8996,11 @@ var NumPadKey = memo3(function NumPadKey2({
8987
8996
  var styles24 = StyleSheet25.create({
8988
8997
  // Figma bounds the glyph rows; touch cells extend half a gap beyond them.
8989
8998
  grid: {
8990
- marginVertical: (DEPOSIT_METRICS.numpad.lineHeight - DEPOSIT_METRICS.numpad.rowPitch) / 2
8999
+ marginVertical: (DEPOSIT_METRICS.numpad.glyphRowHeight - DEPOSIT_METRICS.numpad.rowPitch) / 2
8991
9000
  },
8992
9001
  key: { flex: 1, justifyContent: "center" },
8993
- label: {
8994
- fontSize: KEY_FONT_SIZE,
8995
- lineHeight: 32,
8996
- letterSpacing: DEPOSIT_METRICS.numpad.tracking,
8997
- textAlign: "center"
8998
- },
9002
+ label: { textAlign: "center" },
8999
9003
  decimalLabel: {
9000
- fontSize: DEPOSIT_METRICS.numpad.decimalSize,
9001
- letterSpacing: DEPOSIT_METRICS.numpad.decimalTracking,
9002
- lineHeight: 56,
9003
9004
  transform: [{ translateY: DEPOSIT_METRICS.numpad.decimalOffsetY }]
9004
9005
  }
9005
9006
  });
@@ -9044,7 +9045,7 @@ function PaymentMethodPicker({
9044
9045
  ],
9045
9046
  children: [
9046
9047
  icon === void 0 ? /* @__PURE__ */ jsx49(Box, { style: styles25.noLeading }) : /* @__PURE__ */ jsx49(Box, { style: styles25.leading, children: icon }),
9047
- /* @__PURE__ */ jsx49(Text, { weight: "medium", numberOfLines: 1, style: styles25.label, children: label }),
9048
+ /* @__PURE__ */ jsx49(Text, { variant: "bodyLarge", numberOfLines: 1, style: styles25.label, children: label }),
9048
9049
  /* @__PURE__ */ jsx49(Box, { style: styles25.trailing, children: /* @__PURE__ */ jsx49(
9049
9050
  FigmaChevronDownIcon,
9050
9051
  {
@@ -9075,12 +9076,7 @@ var styles25 = StyleSheet26.create({
9075
9076
  noLeading: {
9076
9077
  width: DEPOSIT_METRICS.paymentMethodPicker.labelInsetWithoutIcon
9077
9078
  },
9078
- label: {
9079
- flex: 1,
9080
- fontSize: DEPOSIT_METRICS.paymentMethodPicker.labelSize,
9081
- lineHeight: DEPOSIT_METRICS.paymentMethodPicker.labelLineHeight,
9082
- letterSpacing: DEPOSIT_METRICS.paymentMethodPicker.labelTracking
9083
- },
9079
+ label: { flex: 1 },
9084
9080
  trailing: {
9085
9081
  width: DEPOSIT_METRICS.paymentMethodPicker.trailingWidth,
9086
9082
  alignItems: "center",
@@ -9331,7 +9327,7 @@ function DepositAmountScreen({
9331
9327
  ) : null : /* @__PURE__ */ jsx52(
9332
9328
  Text,
9333
9329
  {
9334
- weight: "medium",
9330
+ variant: "notice",
9335
9331
  style: [
9336
9332
  { color: theme.content.elements.secondary },
9337
9333
  styles26.boundNotice
@@ -9499,6 +9495,12 @@ function boundMessage({
9499
9495
  minLimitUsd,
9500
9496
  t
9501
9497
  }) {
9498
+ if (aboveMaximum && belowMinimum && limitUsd !== void 0 && minLimitUsd !== void 0) {
9499
+ return t("depositAmount.gapAmount", {
9500
+ max: formatUsd(Number(limitUsd)),
9501
+ min: formatUsd(Number(minLimitUsd))
9502
+ });
9503
+ }
9502
9504
  if (aboveMaximum && limitUsd !== void 0) {
9503
9505
  return t("depositAmount.maximumAmount", {
9504
9506
  amount: formatUsd(Number(limitUsd))
@@ -9553,7 +9555,7 @@ function FeeLine({
9553
9555
  alignItems: "center",
9554
9556
  style: [styles26.fee, onPress ? pressStyle : null],
9555
9557
  children: [
9556
- /* @__PURE__ */ jsx52(Text, { weight: "medium", style: [styles26.feeText, { color }], children: fee }),
9558
+ /* @__PURE__ */ jsx52(Text, { variant: "notice", style: { color }, children: fee }),
9557
9559
  /* @__PURE__ */ jsx52(DepositInfoCircleIcon, { color })
9558
9560
  ]
9559
9561
  }
@@ -9622,18 +9624,8 @@ var styles26 = StyleSheet27.create({
9622
9624
  paddingRight: DEPOSIT_METRICS.fee.rightInset,
9623
9625
  gap: 12
9624
9626
  },
9625
- feeText: {
9626
- fontSize: DEPOSIT_METRICS.fee.size,
9627
- lineHeight: DEPOSIT_METRICS.fee.lineHeight,
9628
- letterSpacing: DEPOSIT_METRICS.fee.tracking
9629
- },
9630
9627
  // Sits in the fee's slot, so it carries the fee's type
9631
- boundNotice: {
9632
- fontSize: DEPOSIT_METRICS.fee.size,
9633
- lineHeight: DEPOSIT_METRICS.fee.lineHeight,
9634
- letterSpacing: DEPOSIT_METRICS.fee.tracking,
9635
- textAlign: "right"
9636
- },
9628
+ boundNotice: { textAlign: "right" },
9637
9629
  // Let a wide payment badge yield to the fee.
9638
9630
  feeLead: { flexShrink: 1 },
9639
9631
  fee: { gap: 4 },
@@ -9718,10 +9710,6 @@ import { StyleSheet as StyleSheet28 } from "react-native";
9718
9710
  import { useSafeAreaInsets as useSafeAreaInsets11 } from "react-native-safe-area-context";
9719
9711
  import { jsx as jsx55, jsxs as jsxs27 } from "react/jsx-runtime";
9720
9712
  var FEE_DETAILS_METRICS = {
9721
- // A point under the `body` token, matching the fee line that opens the drawer
9722
- // and the balance beside it — the drawer sat a size larger than both.
9723
- rowSize: 15,
9724
- rowLeading: 22,
9725
9713
  /** Drawer top to the title. */
9726
9714
  titleTop: 68,
9727
9715
  /** Title box to the summary (105 - 99). */
@@ -9730,8 +9718,6 @@ var FEE_DETAILS_METRICS = {
9730
9718
  rowsGap: 38,
9731
9719
  /** The paragraph takes a shorter measure than the rules: 298 of the 313. */
9732
9720
  summaryInset: 15,
9733
- /** -0.01em on the summary paragraph. */
9734
- summaryTracking: -0.14,
9735
9721
  /** The design's clearance either side of a breakdown rule. */
9736
9722
  dividerGap: 9
9737
9723
  };
@@ -9757,7 +9743,7 @@ function FeeDetailsScreen({
9757
9743
  summary ? /* @__PURE__ */ jsx55(
9758
9744
  Text,
9759
9745
  {
9760
- variant: "detail",
9746
+ variant: "drawerDetail",
9761
9747
  style: [
9762
9748
  styles27.summary,
9763
9749
  { color: theme.content.elements.secondary }
@@ -9786,10 +9772,10 @@ function Row({ row: row2 }) {
9786
9772
  /* @__PURE__ */ jsx55(
9787
9773
  Text,
9788
9774
  {
9789
- variant: "body",
9775
+ variant: "drawerRow",
9790
9776
  weight,
9791
9777
  numberOfLines: 1,
9792
- style: [styles27.rowText, styles27.rowValue, styles27.rowValueColumn],
9778
+ style: [styles27.rowValue, styles27.rowValueColumn],
9793
9779
  children: row2.value
9794
9780
  }
9795
9781
  )
@@ -9800,35 +9786,21 @@ function RowLabel({ row: row2 }) {
9800
9786
  const weight = row2.isTotal ? "semibold" : "base";
9801
9787
  const at = row2.rate === void 0 ? -1 : row2.label.indexOf(row2.rate);
9802
9788
  if (row2.rate === void 0 || at < 0) {
9803
- return /* @__PURE__ */ jsx55(
9789
+ return /* @__PURE__ */ jsx55(Text, { variant: "drawerRow", weight, style: styles27.rowLabel, children: row2.label });
9790
+ }
9791
+ return /* @__PURE__ */ jsxs27(Text, { variant: "drawerRow", weight, style: styles27.rowLabel, children: [
9792
+ row2.label.slice(0, at),
9793
+ /* @__PURE__ */ jsx55(
9804
9794
  Text,
9805
9795
  {
9806
- variant: "body",
9807
- weight,
9808
- style: [styles27.rowText, styles27.rowLabel],
9809
- children: row2.label
9796
+ variant: "drawerRow",
9797
+ weight: "base",
9798
+ style: { color: theme.content.elements.secondary },
9799
+ children: row2.rate
9810
9800
  }
9811
- );
9812
- }
9813
- return /* @__PURE__ */ jsxs27(
9814
- Text,
9815
- {
9816
- variant: "body",
9817
- weight,
9818
- style: [styles27.rowText, styles27.rowLabel],
9819
- children: [
9820
- row2.label.slice(0, at),
9821
- /* @__PURE__ */ jsx55(
9822
- Text,
9823
- {
9824
- style: [styles27.rowText, { color: theme.content.elements.secondary }],
9825
- children: row2.rate
9826
- }
9827
- ),
9828
- row2.label.slice(at + row2.rate.length)
9829
- ]
9830
- }
9831
- );
9801
+ ),
9802
+ row2.label.slice(at + row2.rate.length)
9803
+ ] });
9832
9804
  }
9833
9805
  function RowDivider() {
9834
9806
  const theme = useTheme();
@@ -9851,14 +9823,9 @@ var styles27 = StyleSheet28.create({
9851
9823
  },
9852
9824
  summary: {
9853
9825
  marginTop: FEE_DETAILS_METRICS.summaryGap,
9854
- marginRight: FEE_DETAILS_METRICS.summaryInset,
9855
- letterSpacing: FEE_DETAILS_METRICS.summaryTracking
9826
+ marginRight: FEE_DETAILS_METRICS.summaryInset
9856
9827
  },
9857
9828
  rows: { marginTop: FEE_DETAILS_METRICS.rowsGap },
9858
- rowText: {
9859
- fontSize: FEE_DETAILS_METRICS.rowSize,
9860
- lineHeight: FEE_DETAILS_METRICS.rowLeading
9861
- },
9862
9829
  // Equal-advance digits, so the figures line up down the value column.
9863
9830
  rowValue: { fontVariant: ["tabular-nums"] },
9864
9831
  rowLabel: { flexShrink: 1, marginRight: 16 },
@@ -10215,6 +10182,7 @@ import {
10215
10182
  isQuotableAmount,
10216
10183
  isStaleQuoteFailure as isStaleQuoteFailure2,
10217
10184
  recordTermsAcceptance,
10185
+ refreshRoutingTable,
10218
10186
  renewCaptureSurface,
10219
10187
  requestCheckoutClientSecret,
10220
10188
  selectEntryCta,
@@ -10224,6 +10192,7 @@ import {
10224
10192
  surfaceControl,
10225
10193
  termsToAccept,
10226
10194
  useEffectEvent as useEffectEvent5,
10195
+ useFeatureGate,
10227
10196
  useFiatQuote,
10228
10197
  useFiatTransitions,
10229
10198
  useSwappedDefaultCurrencyQuery as useSwappedDefaultCurrencyQuery2
@@ -10492,6 +10461,7 @@ var styles29 = StyleSheet30.create({
10492
10461
  paddingHorizontal: 24,
10493
10462
  gap: 12
10494
10463
  },
10464
+ // oxlint-disable-next-line funkit/no-raw-typography -- a placeholder status mark sized as an icon, until the faceplates land
10495
10465
  glyph: { fontSize: 48, lineHeight: 56 },
10496
10466
  title: { textAlign: "center" },
10497
10467
  detail: { textAlign: "center" },
@@ -10837,83 +10807,90 @@ function useApplePayPaintGate(onReady, log, checkoutTiming) {
10837
10807
 
10838
10808
  // src/fiat/providers/coinbaseFailureCopy.ts
10839
10809
  function coinbaseFailureCopy(code, t) {
10840
- const decline = declineCopy(code, t);
10841
- if (decline !== void 0) {
10842
- return decline;
10843
- }
10844
- const message = failureMessage(code, t);
10845
- return message === void 0 ? void 0 : { message };
10846
- }
10847
- function declineCopy(code, t) {
10848
10810
  switch (code) {
10811
+ // Design 2830:10739.
10849
10812
  case "ERROR_CODE_GUEST_CARD_SOFT_DECLINED":
10850
10813
  case "ERROR_CODE_GUEST_CARD_HARD_DECLINED":
10851
10814
  return {
10852
- title: t("fiat.coinbaseBankDeclinedTitle"),
10853
- message: t("fiat.coinbaseBankDeclinedMessage")
10815
+ kind: "declined",
10816
+ title: t("fiat.cardDeclinedTitle"),
10817
+ message: t("fiat.cardDeclinedMessage")
10854
10818
  };
10819
+ // Design 2830:10803.
10855
10820
  case "ERROR_CODE_GUEST_CARD_RISK_DECLINED":
10856
10821
  return {
10822
+ kind: "declined",
10857
10823
  title: t("fiat.coinbaseRiskDeclinedTitle"),
10858
10824
  message: t("fiat.coinbaseRiskDeclinedMessage")
10859
10825
  };
10860
- default:
10861
- return void 0;
10862
- }
10863
- }
10864
- function failureMessage(code, t) {
10865
- switch (code) {
10866
10826
  case "ERROR_CODE_GUEST_APPLE_PAY_NOT_SETUP":
10867
- return t("fiat.applePayNotSetUp");
10827
+ return {
10828
+ kind: "refused",
10829
+ title: t("fiat.applePayNotSetUpTitle"),
10830
+ message: t("fiat.applePayNotSetUp")
10831
+ };
10868
10832
  case "ERROR_CODE_GUEST_APPLE_PAY_NOT_SUPPORTED":
10869
- return t("fiat.applePayUnsupported");
10833
+ return {
10834
+ kind: "refused",
10835
+ title: t("fiat.applePayUnsupportedTitle"),
10836
+ message: t("fiat.applePayUnsupported")
10837
+ };
10870
10838
  case "ERROR_CODE_GUEST_INVALID_CARD":
10871
- return t("fiat.coinbaseInvalidCard");
10839
+ return cardRefused(t("fiat.cardInvalid"), t);
10872
10840
  case "ERROR_CODE_GUEST_CARD_INSUFFICIENT_BALANCE":
10873
- return t("fiat.coinbaseInsufficientBalance");
10841
+ return cardRefused(t("fiat.cardInsufficientBalance"), t);
10874
10842
  case "ERROR_CODE_GUEST_CARD_PREPAID_DECLINED":
10875
- return t("fiat.coinbasePrepaidCard");
10843
+ return cardRefused(t("fiat.coinbasePrepaidCard"), t);
10844
+ case "ERROR_CODE_INVALID_BILLING_ZIP":
10845
+ return cardRefused(t("fiat.cardBillingZip"), t);
10846
+ case "ERROR_CODE_INVALID_BILLING_ADDRESS":
10847
+ return cardRefused(t("fiat.coinbaseBillingAddress"), t);
10848
+ case "ERROR_CODE_INVALID_BILLING_NAME":
10849
+ return cardRefused(t("fiat.coinbaseBillingName"), t);
10850
+ case "ERROR_CODE_GUEST_TRANSACTION_AVS_VALIDATION_FAILED":
10851
+ return cardRefused(t("fiat.coinbaseAvsFailed"), t);
10876
10852
  // Two codes, one situation: the buyer is somewhere the rail cannot serve,
10877
10853
  // and nothing they do on this screen changes that.
10878
10854
  case "ERROR_CODE_GUEST_REGION_MISMATCH":
10879
10855
  case "ERROR_CODE_GUEST_REGION_FORBIDDEN":
10880
- return t("fiat.coinbaseRegionUnsupported");
10856
+ return unavailableHere(t("fiat.coinbaseRegionUnsupported"), t);
10881
10857
  case "ERROR_CODE_GUEST_PERMISSION_DENIED":
10882
- return t("fiat.coinbasePermissionDenied");
10858
+ return unavailableHere(t("fiat.coinbasePermissionDenied"), t);
10859
+ case "ERROR_CODE_NETWORK_NOT_TRADEABLE":
10860
+ return unavailableHere(t("fiat.coinbaseNetworkUnsupported"), t);
10861
+ case "ASSET_NOT_TRADABLE":
10862
+ return unavailableHere(t("fiat.coinbaseAssetUnsupported"), t);
10883
10863
  case "ERROR_CODE_GUEST_TRANSACTION_LIMIT":
10884
- return t("fiat.coinbaseWeeklyLimit");
10864
+ return limitReached(t("fiat.coinbaseWeeklyLimit"), t);
10885
10865
  // Coinbase names a figure for this one (15 as of writing). Left out of the
10886
10866
  // copy: it is theirs to change, and a stale number reads as a promise.
10887
10867
  case "ERROR_CODE_GUEST_TRANSACTION_COUNT":
10888
- return t("fiat.coinbaseLifetimeCount");
10868
+ return limitReached(t("fiat.coinbaseLifetimeCount"), t);
10889
10869
  case "ERROR_CODE_GUEST_DAILY_TRANSACTION_COUNT":
10890
- return t("fiat.coinbaseDailyCount");
10891
- case "ERROR_CODE_INVALID_BILLING_ZIP":
10892
- return t("fiat.coinbaseBillingZip");
10893
- case "ERROR_CODE_INVALID_BILLING_ADDRESS":
10894
- return t("fiat.coinbaseBillingAddress");
10895
- case "ERROR_CODE_INVALID_BILLING_NAME":
10896
- return t("fiat.coinbaseBillingName");
10870
+ return limitReached(t("fiat.coinbaseDailyCount"), t);
10897
10871
  case "ERROR_CODE_INIT":
10898
- return t("fiat.coinbaseSessionExpired");
10899
- case "ERROR_CODE_NETWORK_NOT_TRADEABLE":
10900
- return t("fiat.coinbaseNetworkUnsupported");
10901
- case "ASSET_NOT_TRADABLE":
10902
- return t("fiat.coinbaseAssetUnsupported");
10872
+ return {
10873
+ kind: "refused",
10874
+ title: t("fiat.coinbaseSessionExpiredTitle"),
10875
+ message: t("fiat.coinbaseSessionExpired")
10876
+ };
10903
10877
  // Nothing the buyer did, and nothing they can fix — INVALID_REQUEST is a
10904
- // fault in the order we asked Coinbase for. All three say the same thing.
10878
+ // fault in the order we asked Coinbase for. All three say the same thing,
10879
+ // and can arrive as the page loads, so they must not remount.
10905
10880
  case "ERROR_CODE_INTERNAL":
10906
10881
  case "ERROR_CODE_INVALID_REQUEST":
10907
10882
  case "ERROR_CODE_GUEST_TRANSACTION_TRANSACTION_FAILED":
10908
- return t("fiat.coinbaseProviderError");
10883
+ return {
10884
+ kind: "refused",
10885
+ title: t("fiat.applePayUnavailableTitle"),
10886
+ message: t("fiat.coinbaseProviderError")
10887
+ };
10909
10888
  // The money answers are Coinbase's own, stated per code in their docs, and
10910
10889
  // they are the first thing a buyer wants after a failure.
10911
10890
  case "ERROR_CODE_GUEST_TRANSACTION_BUY_FAILED":
10912
- return t("fiat.coinbaseBuyFailed");
10891
+ return paymentFailed(t("fiat.coinbaseBuyFailed"), t);
10913
10892
  case "ERROR_CODE_GUEST_TRANSACTION_SEND_FAILED":
10914
- return t("fiat.coinbaseSendFailed");
10915
- case "ERROR_CODE_GUEST_TRANSACTION_AVS_VALIDATION_FAILED":
10916
- return t("fiat.coinbaseAvsFailed");
10893
+ return paymentFailed(t("fiat.coinbaseSendFailed"), t);
10917
10894
  // `ERROR_CODE_GUEST_GOOGLE_PAY_NOT_SUPPORTED` is deliberately absent: the
10918
10895
  // adapter claims Apple Pay button surfaces only, so that page never loads
10919
10896
  // here and never posts.
@@ -10921,6 +10898,26 @@ function failureMessage(code, t) {
10921
10898
  return void 0;
10922
10899
  }
10923
10900
  }
10901
+ function cardRefused(message, t) {
10902
+ return { kind: "refused", title: t("fiat.cardRefusedTitle"), message };
10903
+ }
10904
+ function unavailableHere(message, t) {
10905
+ return {
10906
+ kind: "refused",
10907
+ title: t("fiat.coinbaseUnavailableHereTitle"),
10908
+ message
10909
+ };
10910
+ }
10911
+ function limitReached(message, t) {
10912
+ return { kind: "refused", title: t("fiat.cardLimitTitle"), message };
10913
+ }
10914
+ function paymentFailed(message, t) {
10915
+ return {
10916
+ kind: "refused",
10917
+ title: t("fiat.coinbasePaymentFailedTitle"),
10918
+ message
10919
+ };
10920
+ }
10924
10921
  var INSTRUMENT_REFUSALS = /* @__PURE__ */ new Set([
10925
10922
  "ERROR_CODE_GUEST_APPLE_PAY_NOT_SETUP",
10926
10923
  "ERROR_CODE_GUEST_INVALID_CARD",
@@ -11538,7 +11535,6 @@ var KYC_FORM_METRICS = {
11538
11535
  noticeRadius: 26,
11539
11536
  /** Card bottom (364) to the notice (411). */
11540
11537
  noticeTop: 47,
11541
- noticeTracking: -0.14,
11542
11538
  /*
11543
11539
  * The questionnaire pages (2475:8992), which draw their answers on the page
11544
11540
  * rather than behind a chooser. Rounder and tighter than a form field: the
@@ -11548,14 +11544,8 @@ var KYC_FORM_METRICS = {
11548
11544
  choiceRowHeight: 52,
11549
11545
  choiceRowPaddingHorizontal: 20,
11550
11546
  /** Makes 52 on one line and the design's 64 on two — see `FiatChoiceList`. */
11551
- choiceRowPaddingVertical: 15,
11552
- choiceLabelFontSize: 15,
11553
- choiceLabelLineHeight: 16.8,
11547
+ choiceRowPaddingVertical: 14,
11554
11548
  choiceCheckSize: 21,
11555
- /** The title's own line, which these pages carry instead of two. */
11556
- questionnaireTitleFontSize: 24,
11557
- questionnaireTitleLineHeight: 26.88,
11558
- questionnaireTitleTracking: -0.48,
11559
11549
  /** Below the back disc (108) to the title (162), as every `headingTop` is. */
11560
11550
  questionnaireHeadingTop: 54,
11561
11551
  /** Title to card (18), less the column's own gap. */
@@ -11585,9 +11575,6 @@ var KYC_FORM_METRICS = {
11585
11575
  headingGap: 8,
11586
11576
  /** Below the paragraph, before the first field. */
11587
11577
  headingBottom: 16,
11588
- /** The paragraph: larger than body, and the only place this size is used. */
11589
- detailFontSize: 21,
11590
- detailLineHeight: 24,
11591
11578
  /** KYC R2 actions clear the keyboard by 24 points (1951:8864). */
11592
11579
  advanceGap: 24,
11593
11580
  /**
@@ -11606,15 +11593,10 @@ var KYC_FORM_METRICS = {
11606
11593
  */
11607
11594
  /** Disc bottom (108) to the headline's line box (181). */
11608
11595
  introHeadingTop: 73,
11609
- /** 38/38 with the box 286 wide, which is what wraps it onto two lines. */
11610
- introTitleFontSize: 38,
11611
- introTitleTracking: -1.14,
11612
- introTitleWidth: 286,
11613
11596
  /** Headline bottom (257) to the paragraph (276). */
11614
11597
  introTitleGap: 19,
11615
11598
  /** The paragraph's own measure (268), four lines of it. */
11616
11599
  introDetailWidth: 268,
11617
- introDetailTracking: -0.42,
11618
11600
  /**
11619
11601
  * Below the action (784) to the frame's foot: the watermark's own 16 band,
11620
11602
  * its 18 of type, and the 34 the design clears the action by.
@@ -11623,31 +11605,15 @@ var KYC_FORM_METRICS = {
11623
11605
  /** The consent checkbox, and the gap to the copy beside it. */
11624
11606
  consentBoxSize: 32,
11625
11607
  consentBoxGap: 10,
11626
- /** Smaller than any body token, and used on the legal lines alone. */
11627
- consentFontSize: 12,
11628
- /** Four lines of it fill the 52 the frame gives the consent row. */
11629
- consentLineHeight: 13,
11630
11608
  /** Between each legal line and the action below them. */
11631
11609
  consentGap: 16,
11632
11610
  /** They are inset past the action, as the heading is past the fields. */
11633
11611
  consentInset: 16,
11634
- /*
11635
- * The code screen's headline (2475:3268): larger, tighter and set in the
11636
- * primary colour, unlike the KYC paragraph it used to borrow.
11637
- */
11638
- otpHeadingFontSize: 24,
11639
- otpHeadingLineHeight: 27,
11640
- otpHeadingTracking: -0.24,
11641
- /** A code box is taller than a form field, and its digit larger. */
11612
+ /** A code box is taller than a form field. */
11642
11613
  codeBoxHeight: 64,
11643
11614
  codeBoxGap: 8,
11644
- codeDigitFontSize: 28,
11645
- codeDigitTracking: -0.56,
11646
11615
  /** The resend row sits 48 below the boxes (1951:8864), past the column's 24 gap. */
11647
- otpResendTop: 24,
11648
- otpResendFontSize: 17,
11649
- otpResendLineHeight: 19,
11650
- otpResendTracking: -0.34
11616
+ otpResendTop: 24
11651
11617
  };
11652
11618
 
11653
11619
  // src/fiat/FiatBackButton.tsx
@@ -12599,6 +12565,16 @@ function MoonPayPayment({
12599
12565
  },
12600
12566
  [context, params.environment]
12601
12567
  );
12568
+ const failWith = useCallback19(
12569
+ (error) => {
12570
+ if (error instanceof MoonPayQuoteFailure) {
12571
+ fail(`quote_${error.code}`, error.message);
12572
+ return;
12573
+ }
12574
+ fail(error instanceof Error ? error.message : "quote_failed");
12575
+ },
12576
+ [fail]
12577
+ );
12602
12578
  const terminationProps = useWebViewTermination("MOONPAY", fail);
12603
12579
  const challengeOpen = useRef22(false);
12604
12580
  challengeOpen.current = challengeUrl !== void 0;
@@ -12657,7 +12633,11 @@ function MoonPayPayment({
12657
12633
  logger.debug("connect-rn:fiat:moonpay_payment_quote_completed", {
12658
12634
  environment: params.environment,
12659
12635
  executable: result.value.data.executable,
12660
- paymentDisclosureCount: result.value.data.paymentDisclosures.length
12636
+ paymentDisclosureCount: result.value.data.paymentDisclosures.length,
12637
+ // Ids only: each names a fixed text MoonPay requires us to render.
12638
+ paymentDisclosureIds: result.value.data.paymentDisclosures.map(
12639
+ ({ id, version }) => `${id}@${version}`
12640
+ )
12661
12641
  });
12662
12642
  if (result.value.data.challenge !== void 0) {
12663
12643
  if (holdsChallenge?.()) {
@@ -12706,12 +12686,13 @@ function MoonPayPayment({
12706
12686
  onInitialQuoteFailure();
12707
12687
  return;
12708
12688
  }
12709
- fail(error instanceof Error ? error.message : "quote_failed");
12689
+ failWith(error);
12710
12690
  });
12711
12691
  }, [
12712
12692
  connected,
12713
12693
  context,
12714
12694
  fail,
12695
+ failWith,
12715
12696
  loadQuote,
12716
12697
  onInitialQuoteFailure,
12717
12698
  params.environment
@@ -12781,10 +12762,8 @@ function MoonPayPayment({
12781
12762
  [applePayReady.paintToken, context, fail]
12782
12763
  );
12783
12764
  const requote = useCallback19(() => {
12784
- void loadQuote().catch(
12785
- (error) => fail(error instanceof Error ? error.message : "quote_failed")
12786
- );
12787
- }, [fail, loadQuote]);
12765
+ void loadQuote().catch((error) => failWith(error));
12766
+ }, [fail, failWith, loadQuote]);
12788
12767
  const reportTransaction = useCallback19(
12789
12768
  (transaction) => {
12790
12769
  if (transaction.status === "failed" && transaction.failureCode === "authorizationDeclined") {
@@ -12796,7 +12775,9 @@ function MoonPayPayment({
12796
12775
  requote();
12797
12776
  } else if (transaction.status === "failed" || transaction.id === void 0) {
12798
12777
  onBusyChange?.(false);
12799
- fail("transaction_failed");
12778
+ fail(
12779
+ transaction.failureCode === void 0 ? "transaction_failed" : `transaction_${transaction.failureCode}`
12780
+ );
12800
12781
  } else {
12801
12782
  onBusyChange?.(true);
12802
12783
  context.report({ paymentAuthorisationId: transaction.id });
@@ -12829,9 +12810,7 @@ function MoonPayPayment({
12829
12810
  if (freshSignature !== void 0) {
12830
12811
  event.payload.setQuote(freshSignature);
12831
12812
  }
12832
- }).catch(
12833
- (error) => fail(error instanceof Error ? error.message : "quote_failed")
12834
- );
12813
+ }).catch((error) => failWith(error));
12835
12814
  } else if (event.kind === "unsupported") {
12836
12815
  logger.warn("connect-rn:fiat:moonpay_apple_pay_event", {
12837
12816
  environment: params.environment,
@@ -12869,6 +12848,7 @@ function MoonPayPayment({
12869
12848
  },
12870
12849
  [
12871
12850
  fail,
12851
+ failWith,
12872
12852
  loadQuote,
12873
12853
  markApplePayFrameReady,
12874
12854
  params.environment,
@@ -12895,15 +12875,13 @@ function MoonPayPayment({
12895
12875
  if (buttonIsDead()) {
12896
12876
  return;
12897
12877
  }
12898
- void loadQuote().catch(
12899
- (error) => fail(error instanceof Error ? error.message : "quote_failed")
12900
- );
12878
+ void loadQuote().catch((error) => failWith(error));
12901
12879
  } else {
12902
12880
  fail(`challenge_${event.payload.status}`);
12903
12881
  }
12904
12882
  }
12905
12883
  },
12906
- [fail, loadQuote, onBusyChange, reportTransaction]
12884
+ [fail, failWith, loadQuote, onBusyChange, reportTransaction]
12907
12885
  );
12908
12886
  return /* @__PURE__ */ jsxs31(View13, { style: [styles34.button, { height: buttonHeight }], children: [
12909
12887
  needsTerms ? /* @__PURE__ */ jsx68(
@@ -13875,7 +13853,8 @@ function StripeSessionAuthScreen({
13875
13853
  /* @__PURE__ */ jsx79(
13876
13854
  Text,
13877
13855
  {
13878
- style: [styles40.detail, { color: theme.content.elements.secondary }],
13856
+ variant: "lead",
13857
+ style: { color: theme.content.elements.secondary },
13879
13858
  children: t("fiat.stripeAuthDetail", { email: verifiedEmail })
13880
13859
  }
13881
13860
  )
@@ -13915,10 +13894,6 @@ var styles40 = StyleSheet41.create({
13915
13894
  paddingHorizontal: KYC_FORM_METRICS.headingInset - KYC_FORM_METRICS.screenInset,
13916
13895
  gap: KYC_FORM_METRICS.headingGap
13917
13896
  },
13918
- detail: {
13919
- fontSize: KYC_FORM_METRICS.detailFontSize,
13920
- lineHeight: KYC_FORM_METRICS.detailLineHeight
13921
- },
13922
13897
  error: { paddingHorizontal: KYC_FORM_METRICS.fieldPaddingHorizontal },
13923
13898
  action: { marginTop: "auto" }
13924
13899
  });
@@ -14725,6 +14700,7 @@ function StripeApplePaySurface({
14725
14700
  void collectApplePay(stripe, params, seamlessClientSecret).then((token) => {
14726
14701
  if (mounted.current) {
14727
14702
  contextRef.current.report(stripePaymentReport(token));
14703
+ contextRef.current.onProcessing?.();
14728
14704
  }
14729
14705
  }).catch((error) => {
14730
14706
  if (mounted.current) {
@@ -14756,6 +14732,8 @@ function stripePaymentErrorCode(error) {
14756
14732
  const candidate = error;
14757
14733
  for (const code of [
14758
14734
  candidate.apiErrorCode,
14735
+ // More specific than `stripeErrorCode`, which is `card_declined` for all.
14736
+ candidate.declineCode,
14759
14737
  candidate.stripeErrorCode,
14760
14738
  candidate.onrampErrorType
14761
14739
  ]) {
@@ -14917,7 +14895,7 @@ function stripeCheckoutAdapter(stripe, requestClientSecret) {
14917
14895
  return void 0;
14918
14896
  }
14919
14897
  return {
14920
- control: "HANDOFF",
14898
+ control: "BACKGROUND",
14921
14899
  render: (context) => /* @__PURE__ */ jsx83(
14922
14900
  StripeCheckoutSurface,
14923
14901
  {
@@ -14936,7 +14914,6 @@ function StripeCheckoutSurface({
14936
14914
  requestClientSecret,
14937
14915
  context
14938
14916
  }) {
14939
- const { t } = useFunkitTranslation();
14940
14917
  const mounted = useRef30(true);
14941
14918
  const started = useRef30(false);
14942
14919
  const contextRef = useRef30(context);
@@ -14960,6 +14937,7 @@ function StripeCheckoutSurface({
14960
14937
  return;
14961
14938
  }
14962
14939
  contextRef.current.report({ checkoutOutcome: "completed" });
14940
+ contextRef.current.onSettled?.("PAID");
14963
14941
  }).catch((error) => {
14964
14942
  const code = stripePaymentErrorCode(error);
14965
14943
  logger.warn("connect-rn:fiat:stripe_checkout_failed", {
@@ -14976,14 +14954,7 @@ function StripeCheckoutSurface({
14976
14954
  contextRef.current.onFailed(code);
14977
14955
  });
14978
14956
  }, [params, requestClientSecret, stripe]);
14979
- return /* @__PURE__ */ jsx83(
14980
- FiatStatusScreen,
14981
- {
14982
- tone: "waiting",
14983
- title: t("fiat.stripeCheckoutRunning"),
14984
- onClose: () => contextRef.current.onClose()
14985
- }
14986
- );
14957
+ return null;
14987
14958
  }
14988
14959
  async function performStripeCheckout(stripe, params, requestClientSecret) {
14989
14960
  logger.info("connect-rn:fiat:stripe_payment_stage_started", {
@@ -15571,7 +15542,15 @@ function FiatErrorNotice({ message }) {
15571
15542
  {
15572
15543
  accessibilityRole: "alert",
15573
15544
  style: [styles41.notice, { backgroundColor: theme.form.errorNotice.fill }],
15574
- children: /* @__PURE__ */ jsx84(Text, { style: [styles41.copy, { color: theme.form.errorNotice.content }], children: message })
15545
+ children: /* @__PURE__ */ jsx84(
15546
+ Text,
15547
+ {
15548
+ variant: "notice",
15549
+ weight: "base",
15550
+ style: [styles41.copy, { color: theme.form.errorNotice.content }],
15551
+ children: message
15552
+ }
15553
+ )
15575
15554
  }
15576
15555
  );
15577
15556
  }
@@ -15584,12 +15563,7 @@ var styles41 = StyleSheet42.create({
15584
15563
  alignItems: "center",
15585
15564
  justifyContent: "center"
15586
15565
  },
15587
- copy: {
15588
- fontSize: 14,
15589
- lineHeight: 16,
15590
- letterSpacing: KYC_FORM_METRICS.noticeTracking,
15591
- textAlign: "center"
15592
- }
15566
+ copy: { textAlign: "center" }
15593
15567
  });
15594
15568
 
15595
15569
  // src/fiat/FiatFormFieldRow.tsx
@@ -15601,8 +15575,8 @@ import {
15601
15575
  } from "react-native";
15602
15576
 
15603
15577
  // src/theme/inputTextStyle.ts
15604
- function inputTextStyle(theme) {
15605
- const { lineHeight: _lineHeight, ...text3 } = theme.textVariants.body;
15578
+ function inputTextStyle(theme, variant = "body") {
15579
+ const { lineHeight: _lineHeight, ...text3 } = theme.textVariants[variant];
15606
15580
  return text3;
15607
15581
  }
15608
15582
 
@@ -15829,7 +15803,15 @@ function FieldBox({
15829
15803
  ]
15830
15804
  }
15831
15805
  ),
15832
- optional ? /* @__PURE__ */ jsx85(Text, { style: [styles42.optional, { color: surface.placeholder }], children: t("fiat.kycOptional") }) : null
15806
+ optional ? /* @__PURE__ */ jsx85(
15807
+ Text,
15808
+ {
15809
+ variant: "caption",
15810
+ weight: "base",
15811
+ style: [styles42.optional, { color: surface.placeholder }],
15812
+ children: t("fiat.kycOptional")
15813
+ }
15814
+ ) : null
15833
15815
  ]
15834
15816
  }
15835
15817
  );
@@ -15985,10 +15967,7 @@ var styles42 = StyleSheet43.create({
15985
15967
  optional: {
15986
15968
  position: "absolute",
15987
15969
  left: KYC_FORM_METRICS.fieldPaddingHorizontal,
15988
- bottom: KYC_FORM_METRICS.optionalCaptionBottom,
15989
- fontSize: 11,
15990
- lineHeight: 13,
15991
- letterSpacing: -0.22
15970
+ bottom: KYC_FORM_METRICS.optionalCaptionBottom
15992
15971
  },
15993
15972
  option: {
15994
15973
  borderRadius: KYC_FORM_METRICS.fieldRadius,
@@ -16115,7 +16094,7 @@ function GlassSurface({
16115
16094
 
16116
16095
  // src/theme/textStyle.ts
16117
16096
  function flatTextStyle(theme, options = {}) {
16118
- const variant = theme.textVariants?.defaults;
16097
+ const variant = theme.textVariants?.[options.variant ?? "defaults"];
16119
16098
  const weight = options.weight ? theme.textWeights?.[options.weight] : void 0;
16120
16099
  const color = theme.content?.elements?.primary;
16121
16100
  return [
@@ -16259,8 +16238,10 @@ var FiatCountryIndexRail = memo4(function FiatCountryIndexRail2({
16259
16238
  function letterPalette(theme, pitch) {
16260
16239
  const metrics = {
16261
16240
  height: pitch,
16241
+ // oxlint-disable-next-line funkit/no-raw-typography -- each letter's line is the rail's row pitch
16262
16242
  lineHeight: pitch,
16263
- fontSize: Math.min(RAIL.fontSize, pitch - 1)
16243
+ // oxlint-disable-next-line funkit/no-raw-typography -- shrinks to fit the pitch, as the native index does
16244
+ fontSize: Math.min(RAIL.letterSize, pitch - 1)
16264
16245
  };
16265
16246
  const base = [
16266
16247
  ...flatTextStyle(theme, { weight: "medium" }),
@@ -16285,7 +16266,7 @@ var PEEK_LETTER = 140;
16285
16266
  var RAIL = {
16286
16267
  /** What iOS gives a letter when the whole alphabet fits. */
16287
16268
  maxPitch: 14,
16288
- fontSize: 11,
16269
+ letterSize: 11,
16289
16270
  /** The strip iOS gives the index on a phone (2861:12812). */
16290
16271
  width: 24,
16291
16272
  /** The peek bubble, and the gap it keeps off the letters. */
@@ -16326,6 +16307,7 @@ var styles44 = StyleSheet45.create({
16326
16307
  alignItems: "center",
16327
16308
  justifyContent: "center"
16328
16309
  },
16310
+ // oxlint-disable-next-line funkit/no-raw-typography -- one glyph sized to its 44pt peek disc, not a line of text
16329
16311
  peekText: { fontSize: 20 },
16330
16312
  letter: { textAlign: "center", width: "100%" }
16331
16313
  });
@@ -16536,7 +16518,7 @@ function FiatSearchListHeader({
16536
16518
  }) {
16537
16519
  return /* @__PURE__ */ jsxs39(View22, { style: styles45.header, children: [
16538
16520
  /* @__PURE__ */ jsx89(BlurBand, { edge: "top" }),
16539
- /* @__PURE__ */ jsx89(Text, { weight: "medium", numberOfLines: 1, style: styles45.title, children: title }),
16521
+ /* @__PURE__ */ jsx89(View22, { style: styles45.title, children: /* @__PURE__ */ jsx89(Text, { variant: "bodyLarge", numberOfLines: 1, style: styles45.titleText, children: title }) }),
16540
16522
  /* @__PURE__ */ jsx89(CountryCloseButton, { onPress: onClose })
16541
16523
  ] });
16542
16524
  }
@@ -16733,6 +16715,8 @@ function SearchPill({ query, onChangeQuery, label }) {
16733
16715
  returnKeyType: "search",
16734
16716
  style: [
16735
16717
  styles45.searchInput,
16718
+ inputTextStyle(theme, "bodyLarge"),
16719
+ theme.textWeights.base,
16736
16720
  { color: theme.content.elements.primary }
16737
16721
  ]
16738
16722
  }
@@ -16776,14 +16760,13 @@ function CountryCloseButton({ onPress }) {
16776
16760
  }
16777
16761
  var entryKey = (entry) => `${entry.kind}:${entry.key}`;
16778
16762
  function rowPalette(theme) {
16779
- const base = flatTextStyle(theme);
16780
- const medium = flatTextStyle(theme, { weight: "medium" });
16763
+ const row2 = flatTextStyle(theme, { variant: "bodyLarge", weight: "base" });
16781
16764
  return {
16782
16765
  card: { backgroundColor: theme.form.field },
16783
16766
  divider: { backgroundColor: theme.form.divider },
16784
- flag: [...base, styles45.flag],
16785
- name: [...base, styles45.name],
16786
- section: [...medium, styles45.sectionText],
16767
+ flag: row2,
16768
+ name: [...row2, styles45.name],
16769
+ section: flatTextStyle(theme, { variant: "bodyLarge" }),
16787
16770
  check: theme.brand.primary
16788
16771
  };
16789
16772
  }
@@ -16839,18 +16822,11 @@ var METRICS = {
16839
16822
  rowPaddingHorizontal: 20,
16840
16823
  /** Flag glyph to the name beside it. */
16841
16824
  rowGap: 12,
16842
- flagFontSize: 17,
16843
- nameFontSize: 17,
16844
- nameTracking: -0.34,
16845
16825
  check: 21,
16846
16826
  /** The rule a card rules its rows with. */
16847
16827
  dividerInset: 16,
16848
16828
  sectionHeight: 43,
16849
- sectionFontSize: 17,
16850
- sectionLineHeight: 22,
16851
- sectionTracking: -0.43,
16852
16829
  sectionInset: 16,
16853
- titleFontSize: 17,
16854
16830
  /** Between one section's card and the next section's heading (2290:2679). */
16855
16831
  sectionGap: 8,
16856
16832
  /** The disc the list is left by, in the bar's right corner (2861:12574). */
@@ -16902,17 +16878,17 @@ var styles45 = StyleSheet46.create({
16902
16878
  justifyContent: "flex-end"
16903
16879
  },
16904
16880
  closeSlot: { zIndex: 1 },
16905
- // Centred on the sheet, not on the room the disc leaves.
16881
+ // Centred on the sheet, not on the room the disc leaves, and on the disc's
16882
+ // own height so the two share a midline.
16906
16883
  title: {
16907
16884
  position: "absolute",
16908
16885
  left: METRICS.closeInset + METRICS.closeSize,
16909
16886
  right: METRICS.closeInset + METRICS.closeSize,
16910
16887
  top: METRICS.closeInset,
16911
- lineHeight: METRICS.closeSize,
16912
- textAlign: "center",
16913
- fontSize: METRICS.titleFontSize,
16914
- letterSpacing: METRICS.nameTracking
16888
+ height: METRICS.closeSize,
16889
+ justifyContent: "center"
16915
16890
  },
16891
+ titleText: { textAlign: "center" },
16916
16892
  close: {
16917
16893
  width: METRICS.closeSize,
16918
16894
  height: METRICS.closeSize,
@@ -16938,9 +16914,7 @@ var styles45 = StyleSheet46.create({
16938
16914
  searchInput: {
16939
16915
  flex: 1,
16940
16916
  height: "100%",
16941
- padding: 0,
16942
- fontSize: METRICS.nameFontSize,
16943
- letterSpacing: METRICS.nameTracking
16917
+ padding: 0
16944
16918
  },
16945
16919
  sectionTitle: {
16946
16920
  height: METRICS.sectionHeight,
@@ -16948,11 +16922,6 @@ var styles45 = StyleSheet46.create({
16948
16922
  justifyContent: "center"
16949
16923
  },
16950
16924
  sectionGap: { marginTop: METRICS.sectionGap },
16951
- sectionText: {
16952
- fontSize: METRICS.sectionFontSize,
16953
- lineHeight: METRICS.sectionLineHeight,
16954
- letterSpacing: METRICS.sectionTracking
16955
- },
16956
16925
  // The fill is the card's, so the rule between two rows sits on it rather
16957
16926
  // than on the sheet behind them.
16958
16927
  card: { height: METRICS.rowHeight },
@@ -16971,17 +16940,12 @@ var styles45 = StyleSheet46.create({
16971
16940
  paddingHorizontal: METRICS.rowPaddingHorizontal,
16972
16941
  gap: METRICS.rowGap
16973
16942
  },
16974
- flag: { fontSize: METRICS.flagFontSize },
16975
16943
  // The check's place, held open without drawing one: `SvgXml` parses its
16976
16944
  // markup per row, and 245 invisible checks is what blanks a fast scroll.
16977
16945
  // The design cuts every name at the same width (2184:14277), which the empty
16978
16946
  // slot keeps.
16979
16947
  uncheckedSlot: { width: METRICS.check },
16980
- name: {
16981
- flex: 1,
16982
- fontSize: METRICS.nameFontSize,
16983
- letterSpacing: METRICS.nameTracking
16984
- },
16948
+ name: { flex: 1 },
16985
16949
  // Absolute, so the rule costs the row no height and the pitch stays 52.
16986
16950
  divider: {
16987
16951
  position: "absolute",
@@ -17055,11 +17019,11 @@ function FiatPhoneField({
17055
17019
  },
17056
17020
  accessibilityState: { expanded: isOpen },
17057
17021
  children: /* @__PURE__ */ jsxs40(Box, { flexDirection: "row", alignItems: "center", style: styles46.chip, children: [
17058
- /* @__PURE__ */ jsx90(Text, { style: styles46.flag, children: countryFlag(country2.alpha2) }),
17022
+ /* @__PURE__ */ jsx90(Text, { variant: "bodyLarge", weight: "base", children: countryFlag(country2.alpha2) }),
17059
17023
  /* @__PURE__ */ jsx90(
17060
17024
  Text,
17061
17025
  {
17062
- weight: "medium",
17026
+ variant: "bodyLarge",
17063
17027
  style: [
17064
17028
  styles46.countryCode,
17065
17029
  { color: theme.content.elements.primary }
@@ -17098,8 +17062,7 @@ function FiatPhoneField({
17098
17062
  onSubmitEditing,
17099
17063
  onFocus,
17100
17064
  style: [
17101
- inputTextStyle(theme),
17102
- theme.textWeights.medium,
17065
+ inputTextStyle(theme, "bodyLarge"),
17103
17066
  styles46.input,
17104
17067
  { color: theme.content.elements.primary }
17105
17068
  ]
@@ -17112,8 +17075,6 @@ function FiatPhoneField({
17112
17075
  var PHONE_FIELD_METRICS = {
17113
17076
  /** Between the flag, the code and the chevron. */
17114
17077
  chipGap: 6,
17115
- /** Large enough to read as a flag beside body-sized type. */
17116
- flagFontSize: 17,
17117
17078
  /** The rule is shorter than the box, as a card's rules are. */
17118
17079
  dividerHeight: 34
17119
17080
  };
@@ -17128,8 +17089,8 @@ var styles46 = StyleSheet47.create({
17128
17089
  paddingHorizontal: KYC_FORM_METRICS.fieldPaddingHorizontal,
17129
17090
  gap: PHONE_FIELD_METRICS.chipGap
17130
17091
  },
17131
- countryCode: { fontSize: 17, letterSpacing: 1.02 },
17132
- flag: { fontSize: PHONE_FIELD_METRICS.flagFontSize },
17092
+ // oxlint-disable-next-line funkit/no-raw-typography -- the phone spec (#6693) opens the dial code's digits out
17093
+ countryCode: { letterSpacing: 1.02 },
17133
17094
  divider: {
17134
17095
  width: StyleSheet47.hairlineWidth,
17135
17096
  height: PHONE_FIELD_METRICS.dividerHeight
@@ -17139,9 +17100,7 @@ var styles46 = StyleSheet47.create({
17139
17100
  flex: 1,
17140
17101
  padding: 0,
17141
17102
  paddingLeft: 11,
17142
- paddingRight: KYC_FORM_METRICS.fieldPaddingHorizontal,
17143
- fontSize: 17,
17144
- letterSpacing: -0.425
17103
+ paddingRight: KYC_FORM_METRICS.fieldPaddingHorizontal
17145
17104
  }
17146
17105
  });
17147
17106
 
@@ -17389,7 +17348,7 @@ function FiatContactContent({
17389
17348
  /* @__PURE__ */ jsx91(
17390
17349
  Text,
17391
17350
  {
17392
- weight: "medium",
17351
+ variant: "title",
17393
17352
  style: [styles47.heading, { color: theme.content.elements.primary }],
17394
17353
  children: heading(t, fields)
17395
17354
  }
@@ -17541,11 +17500,8 @@ var CONTACT_METRICS = {
17541
17500
  headingInset: 6,
17542
17501
  /** Heading box (216) to the first field (235). */
17543
17502
  headingBottom: 19,
17544
- headingFontSize: 24,
17545
- headingTracking: -0.48,
17546
17503
  headingWidth: 203,
17547
- headingHeight: 54,
17548
- headingLineHeight: 26.88
17504
+ headingHeight: 54
17549
17505
  };
17550
17506
  var styles47 = StyleSheet48.create({
17551
17507
  scroll: { flex: 1 },
@@ -17560,11 +17516,8 @@ var styles47 = StyleSheet48.create({
17560
17516
  ask: { gap: CONTACT_METRICS.headingBottom },
17561
17517
  heading: {
17562
17518
  paddingHorizontal: CONTACT_METRICS.headingInset,
17563
- fontSize: CONTACT_METRICS.headingFontSize,
17564
- lineHeight: CONTACT_METRICS.headingLineHeight,
17565
17519
  maxWidth: CONTACT_METRICS.headingWidth + 2 * CONTACT_METRICS.headingInset,
17566
- minHeight: CONTACT_METRICS.headingHeight,
17567
- letterSpacing: CONTACT_METRICS.headingTracking
17520
+ minHeight: CONTACT_METRICS.headingHeight
17568
17521
  },
17569
17522
  // The same gap the KYC form sets between the rows of one section.
17570
17523
  rows: { gap: KYC_FORM_METRICS.rowGap },
@@ -17739,11 +17692,10 @@ function FiatChoiceField({
17739
17692
  /* @__PURE__ */ jsx93(
17740
17693
  Text,
17741
17694
  {
17742
- weight: "medium",
17695
+ variant: "bodyLarge",
17743
17696
  numberOfLines: 1,
17744
17697
  style: [
17745
17698
  paired ? null : styles48.fieldLabel,
17746
- styles48.fieldText,
17747
17699
  {
17748
17700
  color: selected === void 0 ? surface.placeholder : surface.content
17749
17701
  }
@@ -17828,7 +17780,7 @@ function ChoiceList({
17828
17780
  ],
17829
17781
  keyboardShouldPersistTaps: "handled",
17830
17782
  children: [
17831
- /* @__PURE__ */ jsx93(Text, { weight: "medium", style: styles48.heading, children: title }),
17783
+ /* @__PURE__ */ jsx93(Text, { variant: "headerTitle", style: styles48.heading, children: title }),
17832
17784
  /* @__PURE__ */ jsx93(View24, { style: [styles48.card, { backgroundColor: theme.form.field }], children: options.map((option, index) => /* @__PURE__ */ jsxs43(
17833
17785
  View24,
17834
17786
  {
@@ -17851,7 +17803,7 @@ function ChoiceList({
17851
17803
  accessibilityState: { selected: option.id === value },
17852
17804
  onPress: () => onChange(option.id),
17853
17805
  style: styles48.option,
17854
- children: /* @__PURE__ */ jsx93(Text, { style: styles48.optionLabel, children: option.labelFallback })
17806
+ children: /* @__PURE__ */ jsx93(Text, { variant: "bodyLarge", weight: "base", children: option.labelFallback })
17855
17807
  }
17856
17808
  )
17857
17809
  ]
@@ -17866,7 +17818,6 @@ function ChoiceList({
17866
17818
  var METRICS2 = {
17867
17819
  screenInset: 24,
17868
17820
  headerTop: 84,
17869
- headingFontSize: 18,
17870
17821
  headingBottom: 12
17871
17822
  };
17872
17823
  var styles48 = StyleSheet50.create({
@@ -17882,17 +17833,13 @@ var styles48 = StyleSheet50.create({
17882
17833
  // The card rounds its own corners; a yellow row follows them by the clip.
17883
17834
  groupedField: { borderRadius: 0 },
17884
17835
  fieldLabel: { flex: 1 },
17885
- fieldText: { fontSize: 17, letterSpacing: -0.34 },
17886
17836
  content: {
17887
17837
  paddingHorizontal: METRICS2.screenInset,
17888
17838
  paddingTop: METRICS2.headerTop,
17889
17839
  gap: METRICS2.headingBottom
17890
17840
  },
17891
- heading: {
17892
- paddingHorizontal: 16,
17893
- fontSize: METRICS2.headingFontSize,
17894
- letterSpacing: -0.36
17895
- },
17841
+ // The question reads as the list's heading, so it keeps the list's edge.
17842
+ heading: { paddingHorizontal: 16, textAlign: "left" },
17896
17843
  card: { borderRadius: 24, overflow: "hidden" },
17897
17844
  option: {
17898
17845
  minHeight: 56,
@@ -17900,7 +17847,6 @@ var styles48 = StyleSheet50.create({
17900
17847
  paddingVertical: 18,
17901
17848
  justifyContent: "center"
17902
17849
  },
17903
- optionLabel: { fontSize: 17, lineHeight: 19.55, letterSpacing: -0.34 },
17904
17850
  divider: { height: 1, marginHorizontal: 16 }
17905
17851
  });
17906
17852
 
@@ -17937,7 +17883,15 @@ function FiatChoiceList({
17937
17883
  onPress: () => onChange(option.id),
17938
17884
  style: styles49.option,
17939
17885
  children: [
17940
- /* @__PURE__ */ jsx94(Text, { style: [styles49.optionLabel, { color: label }], children: option.labelFallback }),
17886
+ /* @__PURE__ */ jsx94(
17887
+ Text,
17888
+ {
17889
+ variant: "notice",
17890
+ weight: "base",
17891
+ style: [styles49.optionLabel, { color: label }],
17892
+ children: option.labelFallback
17893
+ }
17894
+ ),
17941
17895
  /* @__PURE__ */ jsx94(View25, { style: option.id === value ? void 0 : styles49.unworn, children: /* @__PURE__ */ jsx94(
17942
17896
  FigmaCheckIcon,
17943
17897
  {
@@ -17966,12 +17920,7 @@ var styles49 = StyleSheet51.create({
17966
17920
  alignItems: "center",
17967
17921
  gap: 12
17968
17922
  },
17969
- optionLabel: {
17970
- flex: 1,
17971
- fontSize: KYC_FORM_METRICS.choiceLabelFontSize,
17972
- lineHeight: KYC_FORM_METRICS.choiceLabelLineHeight,
17973
- letterSpacing: -0.3
17974
- },
17923
+ optionLabel: { flex: 1 },
17975
17924
  unworn: { opacity: 0 },
17976
17925
  divider: {
17977
17926
  height: 1,
@@ -18276,7 +18225,7 @@ function FiatKycFieldControl({
18276
18225
  /* @__PURE__ */ jsx98(
18277
18226
  Text,
18278
18227
  {
18279
- weight: "medium",
18228
+ variant: "caption",
18280
18229
  style: [styles50.caption, { color: theme.content.elements.secondary }],
18281
18230
  children: caption
18282
18231
  }
@@ -18419,12 +18368,7 @@ function KycFieldControl({
18419
18368
  }
18420
18369
  var styles50 = StyleSheet52.create({
18421
18370
  captioned: { gap: 6 },
18422
- caption: {
18423
- paddingHorizontal: 16,
18424
- fontSize: 13,
18425
- lineHeight: 16,
18426
- letterSpacing: -0.26
18427
- }
18371
+ caption: { paddingHorizontal: 16 }
18428
18372
  });
18429
18373
 
18430
18374
  // src/fiat/kycFormState.ts
@@ -18801,10 +18745,7 @@ var styles52 = StyleSheet54.create({
18801
18745
  alignItems: "center",
18802
18746
  justifyContent: "center"
18803
18747
  },
18804
- validationErrorText: {
18805
- textAlign: "center",
18806
- letterSpacing: KYC_FORM_METRICS.noticeTracking
18807
- },
18748
+ validationErrorText: { textAlign: "center" },
18808
18749
  spinner: {
18809
18750
  height: KYC_FORM_METRICS.fieldHeight,
18810
18751
  alignItems: "center",
@@ -18853,12 +18794,16 @@ function FiatFormHeading({
18853
18794
  layout === "QUESTIONNAIRE" ? { paddingHorizontal: 16, marginBottom: 16 } : void 0
18854
18795
  ],
18855
18796
  children: [
18856
- title === void 0 ? null : /* @__PURE__ */ jsx103(Text, { weight: "semibold", style: styles53.title, children: title }),
18797
+ title === void 0 ? null : /* @__PURE__ */ jsx103(Text, { variant: "title", weight: "semibold", children: title }),
18857
18798
  /* @__PURE__ */ jsx103(
18858
18799
  Text,
18859
18800
  {
18801
+ variant: detailVariant(layout),
18860
18802
  weight: "medium",
18861
- style: [styles53.detail, { color: detailColor }, detailMetrics(layout)],
18803
+ style: [
18804
+ { color: detailColor },
18805
+ layout === "DATE" ? styles53.dateDetail : void 0
18806
+ ],
18862
18807
  children: withShield ? /* @__PURE__ */ jsxs48(Fragment9, { children: [
18863
18808
  /* @__PURE__ */ jsx103(KycSecurityIcon, { color: detailColor }),
18864
18809
  " ",
@@ -18870,17 +18815,11 @@ function FiatFormHeading({
18870
18815
  }
18871
18816
  );
18872
18817
  }
18873
- function detailMetrics(layout) {
18874
- if (layout !== "INLINE_CHOICE" && layout !== "DATE") {
18875
- return void 0;
18818
+ function detailVariant(layout) {
18819
+ if (layout === "INLINE_CHOICE" || layout === "DATE") {
18820
+ return "title";
18876
18821
  }
18877
- return {
18878
- fontSize: KYC_FORM_METRICS.questionnaireTitleFontSize,
18879
- lineHeight: KYC_FORM_METRICS.questionnaireTitleLineHeight,
18880
- letterSpacing: KYC_FORM_METRICS.questionnaireTitleTracking,
18881
- // The measure is what breaks the line over two, not the frame's width.
18882
- ...layout === "DATE" ? { width: KYC_FORM_METRICS.dateTitleWidth } : {}
18883
- };
18822
+ return "lead";
18884
18823
  }
18885
18824
  var styles53 = StyleSheet55.create({
18886
18825
  heading: {
@@ -18889,15 +18828,9 @@ var styles53 = StyleSheet55.create({
18889
18828
  gap: KYC_FORM_METRICS.headingGap,
18890
18829
  marginBottom: 19
18891
18830
  },
18892
- title: {
18893
- fontSize: 22.5,
18894
- lineHeight: 22.3,
18895
- letterSpacing: -0.45
18896
- },
18897
- detail: {
18898
- letterSpacing: -0.42,
18899
- fontSize: KYC_FORM_METRICS.detailFontSize,
18900
- lineHeight: KYC_FORM_METRICS.detailLineHeight
18831
+ // The measure is what breaks the line over two, not the frame's width.
18832
+ dateDetail: {
18833
+ width: KYC_FORM_METRICS.dateTitleWidth
18901
18834
  }
18902
18835
  });
18903
18836
 
@@ -19207,7 +19140,7 @@ function FiatFormContent({
19207
19140
  const isInlineChoice = page !== void 0 && isInlineChoiceSection(page.section);
19208
19141
  const [dockHeightDrawn, setDockHeightDrawn] = useState41(0);
19209
19142
  const [headingHeight, setHeadingHeight] = useState41(
19210
- KYC_FORM_METRICS.questionnaireTitleLineHeight * 2
19143
+ (theme.textVariants.title.lineHeight ?? 0) * 2
19211
19144
  );
19212
19145
  const pageTurn = usePageTurn(String(step));
19213
19146
  const [defaultValues] = useState41(() => typedValues(values));
@@ -19553,7 +19486,7 @@ function FiatFormContent({
19553
19486
  taxLength === void 0 ? null : /* @__PURE__ */ jsx105(
19554
19487
  Text,
19555
19488
  {
19556
- weight: "medium",
19489
+ variant: "caption",
19557
19490
  style: [
19558
19491
  styles54.note,
19559
19492
  { color: theme.content.elements.secondary }
@@ -19564,7 +19497,7 @@ function FiatFormContent({
19564
19497
  note === void 0 ? null : /* @__PURE__ */ jsx105(
19565
19498
  Text,
19566
19499
  {
19567
- weight: "medium",
19500
+ variant: "caption",
19568
19501
  style: [
19569
19502
  styles54.note,
19570
19503
  { color: theme.content.elements.secondary }
@@ -19680,9 +19613,6 @@ function headingPaddingTop(section, taxLength) {
19680
19613
  var styles54 = StyleSheet57.create({
19681
19614
  // Under the fields: the SSN page's protection line, or why a country is asked.
19682
19615
  note: {
19683
- fontSize: 12.5,
19684
- letterSpacing: -0.25,
19685
- lineHeight: 14,
19686
19616
  marginLeft: 5,
19687
19617
  marginTop: 10,
19688
19618
  maxWidth: 292
@@ -19865,7 +19795,7 @@ function FiatKycIntroScreen({
19865
19795
  /* @__PURE__ */ jsx109(
19866
19796
  Text,
19867
19797
  {
19868
- weight: "semibold",
19798
+ variant: "display",
19869
19799
  style: [styles55.title, { color: theme.content.elements.primary }],
19870
19800
  children: title
19871
19801
  }
@@ -19873,8 +19803,8 @@ function FiatKycIntroScreen({
19873
19803
  /* @__PURE__ */ jsx109(
19874
19804
  Text,
19875
19805
  {
19806
+ variant: "lead",
19876
19807
  style: [
19877
- styles55.detail,
19878
19808
  {
19879
19809
  marginTop: variant === "consent" ? -3 : 0,
19880
19810
  maxWidth: additionalInformation ? 283 : 268,
@@ -19888,11 +19818,8 @@ function FiatKycIntroScreen({
19888
19818
  Text,
19889
19819
  {
19890
19820
  accessibilityLabel: correctionReason,
19891
- weight: "medium",
19892
- style: [
19893
- styles55.correctionReason,
19894
- { color: theme.content.elements.primary }
19895
- ],
19821
+ variant: "link",
19822
+ style: { color: theme.content.elements.primary },
19896
19823
  children: correctionReason
19897
19824
  }
19898
19825
  ) : null,
@@ -19907,13 +19834,8 @@ function FiatKycIntroScreen({
19907
19834
  /* @__PURE__ */ jsx109(
19908
19835
  Text,
19909
19836
  {
19910
- weight: "medium",
19911
- style: {
19912
- fontSize: 16,
19913
- lineHeight: 18,
19914
- letterSpacing: -0.32,
19915
- color: theme.content.elements.primary
19916
- },
19837
+ variant: "link",
19838
+ style: { color: theme.content.elements.primary },
19917
19839
  children: t("fiat.kycFindOutMore")
19918
19840
  }
19919
19841
  ),
@@ -19927,7 +19849,7 @@ function FiatKycIntroScreen({
19927
19849
  hasConsent ? /* @__PURE__ */ jsx109(
19928
19850
  Text,
19929
19851
  {
19930
- weight: "medium",
19852
+ variant: "caption",
19931
19853
  style: [
19932
19854
  styles55.consent,
19933
19855
  { color: theme.content.elements.secondary }
@@ -19949,15 +19871,8 @@ var styles55 = StyleSheet58.create({
19949
19871
  scroll: { flex: 1 },
19950
19872
  scrollContent: { flexGrow: 1 },
19951
19873
  copy: { paddingHorizontal: 40, paddingTop: 99, gap: 16 },
19952
- documentCopy: { paddingTop: 100 },
19953
- title: {
19954
- fontSize: 40,
19955
- lineHeight: 40,
19956
- letterSpacing: -1.2,
19957
- maxWidth: 314
19958
- },
19959
- detail: { fontSize: 21, lineHeight: 23.52, letterSpacing: -0.42 },
19960
- correctionReason: { fontSize: 16, lineHeight: 20, letterSpacing: -0.32 },
19874
+ documentCopy: { paddingTop: 100 },
19875
+ title: { maxWidth: 314 },
19961
19876
  link: {
19962
19877
  minHeight: 44,
19963
19878
  flexDirection: "row",
@@ -19972,7 +19887,7 @@ var styles55 = StyleSheet58.create({
19972
19887
  paddingTop: 32,
19973
19888
  gap: 18
19974
19889
  },
19975
- consent: { paddingHorizontal: 9, fontSize: 12, lineHeight: 13 }
19890
+ consent: { paddingHorizontal: 9 }
19976
19891
  });
19977
19892
 
19978
19893
  // src/fiat/FiatIdentityStep.tsx
@@ -20332,7 +20247,8 @@ function FiatOtpContent({
20332
20247
  children: /* @__PURE__ */ jsxs51(
20333
20248
  Text,
20334
20249
  {
20335
- variant: "body",
20250
+ variant: "bodyLarge",
20251
+ weight: "base",
20336
20252
  style: [
20337
20253
  styles56.resendRow,
20338
20254
  { color: theme.content.elements.secondary }
@@ -20343,7 +20259,7 @@ function FiatOtpContent({
20343
20259
  /* @__PURE__ */ jsx113(
20344
20260
  Text,
20345
20261
  {
20346
- weight: "medium",
20262
+ variant: "bodyLarge",
20347
20263
  style: {
20348
20264
  color: canResend ? theme.content.elements.hyperlink : theme.content.elements.tertiary
20349
20265
  },
@@ -20454,8 +20370,8 @@ function CodeBox({ digit, isNext }) {
20454
20370
  children: /* @__PURE__ */ jsx113(
20455
20371
  Text,
20456
20372
  {
20457
- weight: "medium",
20458
- style: [styles56.digit, { color: theme.content.elements.primary }],
20373
+ variant: "codeDigit",
20374
+ style: { color: theme.content.elements.primary },
20459
20375
  children: digit ?? ""
20460
20376
  }
20461
20377
  )
@@ -20471,11 +20387,6 @@ var styles56 = StyleSheet59.create({
20471
20387
  gap: 24
20472
20388
  },
20473
20389
  heading: { paddingHorizontal: 6 },
20474
- headingDetail: {
20475
- fontSize: KYC_FORM_METRICS.otpHeadingFontSize,
20476
- lineHeight: KYC_FORM_METRICS.otpHeadingLineHeight,
20477
- letterSpacing: KYC_FORM_METRICS.otpHeadingTracking
20478
- },
20479
20390
  codeRow: { flexDirection: "row", gap: KYC_FORM_METRICS.codeBoxGap },
20480
20391
  codeBox: {
20481
20392
  flex: 1,
@@ -20484,32 +20395,21 @@ var styles56 = StyleSheet59.create({
20484
20395
  alignItems: "center",
20485
20396
  justifyContent: "center"
20486
20397
  },
20487
- digit: {
20488
- fontSize: KYC_FORM_METRICS.codeDigitFontSize,
20489
- lineHeight: Math.round(KYC_FORM_METRICS.codeDigitFontSize * 1.12),
20490
- letterSpacing: KYC_FORM_METRICS.codeDigitTracking
20491
- },
20492
20398
  hiddenField: { position: "absolute", opacity: 0, width: 1, height: 1 },
20493
20399
  resend: { marginTop: KYC_FORM_METRICS.otpResendTop },
20494
- resendRow: {
20495
- paddingHorizontal: 6,
20496
- fontSize: KYC_FORM_METRICS.otpResendFontSize,
20497
- lineHeight: KYC_FORM_METRICS.otpResendLineHeight,
20498
- letterSpacing: KYC_FORM_METRICS.otpResendTracking
20499
- },
20400
+ resendRow: { paddingHorizontal: 6 },
20500
20401
  // The design rests the action at the foot of the screen, riding up on the
20501
20402
  // keyboard rather than following the boxes.
20502
20403
  action: { marginTop: "auto" }
20503
20404
  });
20504
20405
  var HEADING_TAGS = {
20505
- line: /* @__PURE__ */ jsx113(Text, { weight: "medium", style: styles56.headingDetail }),
20406
+ line: /* @__PURE__ */ jsx113(Text, { variant: "title" }),
20506
20407
  // An address wider than the line shrinks, then elides mid-string, rather
20507
20408
  // than breaking inside its domain.
20508
20409
  recipient: /* @__PURE__ */ jsx113(
20509
20410
  Text,
20510
20411
  {
20511
- weight: "medium",
20512
- style: styles56.headingDetail,
20412
+ variant: "title",
20513
20413
  numberOfLines: 1,
20514
20414
  adjustsFontSizeToFit: true,
20515
20415
  minimumFontScale: 0.7,
@@ -20672,8 +20572,16 @@ function FiatFailureBanner({
20672
20572
  ),
20673
20573
  /* @__PURE__ */ jsx115(Box, { style: styles57.glyph, children: glyph ? /* @__PURE__ */ jsx115(KycStatusIcon, { glyph, color: accent }) : /* @__PURE__ */ jsx115(FigmaAlertCircleOutlineIcon, { size: ICON_SIZE2, color: accent }) }),
20674
20574
  /* @__PURE__ */ jsxs52(Box, { flex: 1, style: styles57.copy, children: [
20675
- /* @__PURE__ */ jsx115(Text, { weight: "medium", style: [styles57.text, { color: accent }], children: title }),
20676
- /* @__PURE__ */ jsx115(Text, { style: [styles57.text, styles57.detail, { color: accent }], children: detail })
20575
+ /* @__PURE__ */ jsx115(Text, { variant: "notice", style: { color: accent }, children: title }),
20576
+ /* @__PURE__ */ jsx115(
20577
+ Text,
20578
+ {
20579
+ variant: "notice",
20580
+ weight: "base",
20581
+ style: [styles57.detail, { color: accent }],
20582
+ children: detail
20583
+ }
20584
+ )
20677
20585
  ] })
20678
20586
  ]
20679
20587
  }
@@ -20698,7 +20606,6 @@ var styles57 = StyleSheet60.create({
20698
20606
  wash: { borderRadius: 20 },
20699
20607
  glyph: { justifyContent: "center" },
20700
20608
  copy: { justifyContent: "center" },
20701
- text: { fontSize: 15, lineHeight: 18, letterSpacing: -0.225 },
20702
20609
  // Figma caps the reason at 256 so it breaks a line earlier than the card's
20703
20610
  // own width would.
20704
20611
  detail: { opacity: 0.5, maxWidth: 256 }
@@ -20783,15 +20690,8 @@ function FiatKycNotice({ title, detail, status }) {
20783
20690
  ),
20784
20691
  /* @__PURE__ */ jsx117(Box, { style: styles58.glyph, children: /* @__PURE__ */ jsx117(KycStatusIcon, { glyph: status, color: accent }) }),
20785
20692
  /* @__PURE__ */ jsxs53(Box, { flex: 1, style: styles58.copy, children: [
20786
- /* @__PURE__ */ jsx117(Text, { weight: "medium", style: [styles58.text, { color: accent }], children: title }),
20787
- /* @__PURE__ */ jsx117(
20788
- Text,
20789
- {
20790
- weight: "medium",
20791
- style: [styles58.text, styles58.detail, { color: accent }],
20792
- children: detail
20793
- }
20794
- )
20693
+ /* @__PURE__ */ jsx117(Text, { variant: "notice", style: { color: accent }, children: title }),
20694
+ /* @__PURE__ */ jsx117(Text, { variant: "notice", style: [styles58.detail, { color: accent }], children: detail })
20795
20695
  ] })
20796
20696
  ]
20797
20697
  }
@@ -20805,18 +20705,11 @@ function FiatKycNotice({ title, detail, status }) {
20805
20705
  accessibilityRole: "alert",
20806
20706
  children: [
20807
20707
  /* @__PURE__ */ jsx117(Box, { style: styles58.glyph, children: /* @__PURE__ */ jsx117(KycLimitIcon, { color: accent }) }),
20808
- /* @__PURE__ */ jsx117(Box, { flex: 1, style: styles58.copy, children: /* @__PURE__ */ jsxs53(
20809
- Text,
20810
- {
20811
- weight: "medium",
20812
- style: [styles58.text, styles58.held, { color: accent }],
20813
- children: [
20814
- title,
20815
- title && detail ? " " : "",
20816
- detail
20817
- ]
20818
- }
20819
- ) }),
20708
+ /* @__PURE__ */ jsx117(Box, { flex: 1, style: styles58.copy, children: /* @__PURE__ */ jsxs53(Text, { variant: "notice", style: { color: accent }, children: [
20709
+ title,
20710
+ title && detail ? " " : "",
20711
+ detail
20712
+ ] }) }),
20820
20713
  /* @__PURE__ */ jsx117(
20821
20714
  Box,
20822
20715
  {
@@ -20851,8 +20744,6 @@ var styles58 = StyleSheet61.create({
20851
20744
  },
20852
20745
  glyph: { justifyContent: "center" },
20853
20746
  copy: { justifyContent: "center" },
20854
- text: { fontSize: 15, lineHeight: 18, letterSpacing: -0.225 },
20855
- held: { fontSize: 14.5, letterSpacing: -0.145 },
20856
20747
  // Figma caps the detail at 245 so it breaks a line earlier than the
20857
20748
  // card's own width would.
20858
20749
  detail: { opacity: 0.5, maxWidth: 245 },
@@ -20895,18 +20786,20 @@ function FiatKycOptionRow({
20895
20786
  /* @__PURE__ */ jsx118(
20896
20787
  Text,
20897
20788
  {
20898
- weight: "medium",
20899
- style: [styles59.title, { color: theme.content.elements.primary }],
20789
+ variant: "bodyLarge",
20790
+ style: { color: theme.content.elements.primary },
20900
20791
  children: title
20901
20792
  }
20902
20793
  ),
20903
20794
  /* @__PURE__ */ jsx118(
20904
20795
  Text,
20905
20796
  {
20906
- style: [
20907
- styles59.detail,
20908
- { maxWidth: detailWidth, color: theme.content.elements.secondary }
20909
- ],
20797
+ variant: "caption",
20798
+ weight: "base",
20799
+ style: {
20800
+ maxWidth: detailWidth,
20801
+ color: theme.content.elements.secondary
20802
+ },
20910
20803
  children: detail
20911
20804
  }
20912
20805
  )
@@ -20923,11 +20816,8 @@ function FiatKycOptionRow({
20923
20816
  children: /* @__PURE__ */ jsx118(
20924
20817
  Text,
20925
20818
  {
20926
- weight: "medium",
20927
- style: [
20928
- styles59.action,
20929
- { color: theme.content.button.secondary.default }
20930
- ],
20819
+ variant: "notice",
20820
+ style: { color: theme.content.button.secondary.default },
20931
20821
  children: action
20932
20822
  }
20933
20823
  )
@@ -20950,20 +20840,13 @@ var styles59 = StyleSheet62.create({
20950
20840
  borderRadius: 26
20951
20841
  },
20952
20842
  copy: { gap: 4 },
20953
- title: { fontSize: 17, lineHeight: 19, letterSpacing: -0.34 },
20954
- detail: {
20955
- fontSize: 11.5,
20956
- lineHeight: 14,
20957
- letterSpacing: -0.23
20958
- },
20959
20843
  chip: {
20960
20844
  width: 60,
20961
20845
  height: 38,
20962
20846
  borderRadius: 32,
20963
20847
  alignItems: "center",
20964
20848
  justifyContent: "center"
20965
- },
20966
- action: { fontSize: 15, lineHeight: 18, letterSpacing: -0.3 }
20849
+ }
20967
20850
  });
20968
20851
 
20969
20852
  // src/fiat/FiatKycOptionsScreen.tsx
@@ -20998,7 +20881,7 @@ function FiatKycOptionsScreen({
20998
20881
  /* @__PURE__ */ jsx119(
20999
20882
  Text,
21000
20883
  {
21001
- weight: "medium",
20884
+ variant: "title",
21002
20885
  style: [styles60.title, { color: theme.content.elements.primary }],
21003
20886
  children: title
21004
20887
  }
@@ -21007,7 +20890,7 @@ function FiatKycOptionsScreen({
21007
20890
  /* @__PURE__ */ jsx119(
21008
20891
  Text,
21009
20892
  {
21010
- weight: "medium",
20893
+ variant: "bodyLarge",
21011
20894
  style: [styles60.label, { color: theme.content.elements.secondary }],
21012
20895
  children: optionsLabel
21013
20896
  }
@@ -21037,18 +20920,10 @@ var styles60 = StyleSheet63.create({
21037
20920
  title: {
21038
20921
  marginHorizontal: 31,
21039
20922
  // Held to the width the frames give it, so it breaks where they break.
21040
- maxWidth: 309,
21041
- fontSize: 24,
21042
- lineHeight: 27,
21043
- letterSpacing: -0.48
20923
+ maxWidth: 309
21044
20924
  },
21045
20925
  slack: { minHeight: 40 },
21046
- label: {
21047
- marginHorizontal: 31,
21048
- fontSize: 17,
21049
- lineHeight: 19,
21050
- letterSpacing: -0.34
21051
- },
20926
+ label: { marginHorizontal: 31 },
21052
20927
  options: { marginTop: 13, marginHorizontal: 24, gap: 8 },
21053
20928
  attribution: { alignItems: "center" }
21054
20929
  });
@@ -21159,7 +21034,7 @@ function FiatReceipt({
21159
21034
  /* @__PURE__ */ jsx122(Box, { style: styles61.center, children: /* @__PURE__ */ jsxs56(Box, { style: styles61.copy, children: [
21160
21035
  /* @__PURE__ */ jsx122(StateSwap, { stateKey: restricted ? "restricted" : "neutral", children: /* @__PURE__ */ jsx122(KycOutcomeIcon, { restricted }) }),
21161
21036
  /* @__PURE__ */ jsxs56(Box, { testID: "receipt-title", style: styles61.titleBox, children: [
21162
- /* @__PURE__ */ jsx122(StateSwap, { stateKey: title, style: styles61.titleLayer, children: /* @__PURE__ */ jsx122(Text, { weight: "medium", style: [styles61.title, { color }], children: title }) }),
21037
+ /* @__PURE__ */ jsx122(StateSwap, { stateKey: title, style: styles61.titleLayer, children: /* @__PURE__ */ jsx122(Text, { variant: "title", style: { color }, children: title }) }),
21163
21038
  reservedTitles.map((reserved) => /* @__PURE__ */ jsx122(
21164
21039
  Box,
21165
21040
  {
@@ -21168,7 +21043,7 @@ function FiatReceipt({
21168
21043
  pointerEvents: "none",
21169
21044
  accessibilityElementsHidden: true,
21170
21045
  importantForAccessibility: "no-hide-descendants",
21171
- children: /* @__PURE__ */ jsx122(Text, { weight: "medium", style: styles61.title, children: reserved })
21046
+ children: /* @__PURE__ */ jsx122(Text, { variant: "title", children: reserved })
21172
21047
  },
21173
21048
  reserved
21174
21049
  ))
@@ -21181,7 +21056,7 @@ function FiatReceipt({
21181
21056
  onPress: openKycSupport,
21182
21057
  style: styles61.link,
21183
21058
  children: [
21184
- /* @__PURE__ */ jsx122(Text, { weight: "medium", style: [styles61.linkLabel, { color }], children: supportLabel }),
21059
+ /* @__PURE__ */ jsx122(Text, { variant: "link", style: { color }, children: supportLabel }),
21185
21060
  /* @__PURE__ */ jsx122(KycExternalLinkIcon, { color })
21186
21061
  ]
21187
21062
  }
@@ -21200,11 +21075,6 @@ var styles61 = StyleSheet64.create({
21200
21075
  titleBox: { marginTop: 20, maxWidth: 275, flexDirection: "row" },
21201
21076
  titleLayer: { width: "100%", flexShrink: 0 },
21202
21077
  reserve: { marginLeft: "-100%", opacity: 0 },
21203
- title: {
21204
- fontSize: 24,
21205
- lineHeight: 26.88,
21206
- letterSpacing: -0.48
21207
- },
21208
21078
  link: {
21209
21079
  // 8 + half the 44pt target's slack keeps the label on the frame's baseline.
21210
21080
  marginTop: 8,
@@ -21214,7 +21084,6 @@ var styles61 = StyleSheet64.create({
21214
21084
  alignSelf: "flex-start",
21215
21085
  gap: 5
21216
21086
  },
21217
- linkLabel: { fontSize: 16, lineHeight: 17.92, letterSpacing: -0.32 },
21218
21087
  actions: { paddingHorizontal: 24, gap: 12 }
21219
21088
  });
21220
21089
 
@@ -21844,18 +21713,207 @@ function useReplayableFailure(flow) {
21844
21713
 
21845
21714
  // src/fiat/paymentSurfaceFailure.ts
21846
21715
  import { Alert as Alert2 } from "react-native";
21716
+
21717
+ // src/fiat/providers/moonpayFailureCopy.ts
21718
+ function moonpayFailureCopy(code, t) {
21719
+ switch (code) {
21720
+ case "transaction_transactionDeclined":
21721
+ return {
21722
+ kind: "declined",
21723
+ title: t("fiat.cardDeclinedTitle"),
21724
+ message: t("fiat.cardDeclinedMessage")
21725
+ };
21726
+ case "transaction_cardNotSupported":
21727
+ return {
21728
+ kind: "refused",
21729
+ title: t("fiat.cardRefusedTitle"),
21730
+ message: t("fiat.cardNotSupported")
21731
+ };
21732
+ case "transaction_transactionNotAllowed":
21733
+ return unavailableHere2(t("fiat.moonpayNotAllowed"), t);
21734
+ // `unavailable` is the connection check's word for a customer MoonPay
21735
+ // will not serve, which in practice is where they are.
21736
+ case "quote_unsupported_country":
21737
+ case "check_unavailable":
21738
+ return unavailableHere2(t("fiat.moonpayRegionUnsupported"), t);
21739
+ case "quote_country_mismatch":
21740
+ return unavailableHere2(t("fiat.moonpayCountryMismatch"), t);
21741
+ // A quote that carries disclosures we do not render yet: every retry
21742
+ // meets the same ones, so it must not remount into a loop.
21743
+ case "payment_disclosures_required":
21744
+ return unavailableHere2(t("fiat.moonpayDisclosuresRequired"), t);
21745
+ // The frame's `applePayUnavailable`, which their docs give as device or
21746
+ // region.
21747
+ case "apple_pay_unsupported":
21748
+ return {
21749
+ kind: "refused",
21750
+ title: t("fiat.moonpayApplePayUnsupportedTitle"),
21751
+ message: t("fiat.moonpayApplePayUnsupported")
21752
+ };
21753
+ case "quote_verification_rejected":
21754
+ return {
21755
+ kind: "refused",
21756
+ title: t("fiat.kycUnavailableProviderTitle"),
21757
+ message: t("fiat.moonpayVerificationRejected")
21758
+ };
21759
+ case "challenge_rejected":
21760
+ return {
21761
+ kind: "refused",
21762
+ title: t("fiat.cardLimitTitle"),
21763
+ message: t("fiat.moonpayLimitRejected")
21764
+ };
21765
+ case "challenge_pending":
21766
+ case "check_pending":
21767
+ return {
21768
+ kind: "refused",
21769
+ title: t("fiat.moonpayReviewPendingTitle"),
21770
+ message: t("fiat.moonpayReviewPending")
21771
+ };
21772
+ case "quote_too_many_requests":
21773
+ return {
21774
+ kind: "unavailable",
21775
+ message: t("fiat.paymentRateLimited"),
21776
+ mapped: true
21777
+ };
21778
+ default:
21779
+ return void 0;
21780
+ }
21781
+ }
21782
+ function unavailableHere2(message, t) {
21783
+ return {
21784
+ kind: "refused",
21785
+ title: t("fiat.moonpayUnavailableHereTitle"),
21786
+ message
21787
+ };
21788
+ }
21789
+ function isMoonpayCardRefusal(code) {
21790
+ return code === "transaction_cardNotSupported";
21791
+ }
21792
+
21793
+ // src/fiat/providers/stripeFailureCopy.ts
21794
+ function stripeFailureCopy(code, t) {
21795
+ if (code === "apple_pay_unavailable") {
21796
+ return {
21797
+ kind: "refused",
21798
+ title: t("fiat.applePayNotSetUpTitle"),
21799
+ message: t("fiat.stripeApplePayNoCard")
21800
+ };
21801
+ }
21802
+ const stage = code.indexOf(":");
21803
+ if (stage < 0) {
21804
+ return void 0;
21805
+ }
21806
+ const reason = code.slice(stage + 1);
21807
+ if (reason === "crypto_onramp_wallet_address_not_allowed") {
21808
+ return {
21809
+ kind: "refused",
21810
+ title: t("fiat.walletLinkedElsewhereTitle"),
21811
+ message: t("fiat.walletLinkedElsewhere")
21812
+ };
21813
+ }
21814
+ const card2 = cardRefusal(reason);
21815
+ if (card2 === void 0) {
21816
+ return void 0;
21817
+ }
21818
+ return { kind: "refused", ...cardCopy(card2, t) };
21819
+ }
21820
+ function isStripeCardRefusal(code) {
21821
+ const stage = code.indexOf(":");
21822
+ return stage >= 0 && cardRefusal(code.slice(stage + 1)) !== void 0;
21823
+ }
21824
+ function cardRefusal(reason) {
21825
+ switch (reason) {
21826
+ case "insufficient_funds":
21827
+ return "funds";
21828
+ case "expired_card":
21829
+ case "incorrect_cvc":
21830
+ case "invalid_cvc":
21831
+ case "incorrect_number":
21832
+ case "invalid_number":
21833
+ case "invalid_expiry_month":
21834
+ case "invalid_expiry_year":
21835
+ return "details";
21836
+ case "incorrect_zip":
21837
+ return "zip";
21838
+ case "card_not_supported":
21839
+ case "currency_not_supported":
21840
+ return "unsupported";
21841
+ case "card_velocity_exceeded":
21842
+ case "withdrawal_count_limit_exceeded":
21843
+ return "limit";
21844
+ case "card_declined":
21845
+ case "generic_decline":
21846
+ case "do_not_honor":
21847
+ case "call_issuer":
21848
+ case "fraudulent":
21849
+ case "lost_card":
21850
+ case "stolen_card":
21851
+ case "pickup_card":
21852
+ case "restricted_card":
21853
+ case "security_violation":
21854
+ case "transaction_not_allowed":
21855
+ case "not_permitted":
21856
+ case "service_not_allowed":
21857
+ case "revocation_of_authorization":
21858
+ case "stop_payment_order":
21859
+ return "declined";
21860
+ default:
21861
+ return void 0;
21862
+ }
21863
+ }
21864
+ function cardCopy(refusal, t) {
21865
+ switch (refusal) {
21866
+ case "funds":
21867
+ return {
21868
+ title: t("fiat.cardRefusedTitle"),
21869
+ message: t("fiat.cardInsufficientBalance")
21870
+ };
21871
+ case "details":
21872
+ return {
21873
+ title: t("fiat.cardRefusedTitle"),
21874
+ message: t("fiat.cardInvalid")
21875
+ };
21876
+ case "zip":
21877
+ return {
21878
+ title: t("fiat.cardRefusedTitle"),
21879
+ message: t("fiat.cardBillingZip")
21880
+ };
21881
+ case "unsupported":
21882
+ return {
21883
+ title: t("fiat.cardRefusedTitle"),
21884
+ message: t("fiat.cardNotSupported")
21885
+ };
21886
+ case "limit":
21887
+ return {
21888
+ title: t("fiat.cardLimitTitle"),
21889
+ message: t("fiat.cardDeclinedMessage")
21890
+ };
21891
+ case "declined":
21892
+ return {
21893
+ title: t("fiat.cardDeclinedTitle"),
21894
+ message: t("fiat.cardDeclinedMessage")
21895
+ };
21896
+ }
21897
+ }
21898
+
21899
+ // src/fiat/paymentSurfaceFailure.ts
21847
21900
  function paymentSurfaceFailure(code, t) {
21848
21901
  if (code === STRIPE_PAYMENT_CANCELLED) {
21849
21902
  return { kind: "cancelled" };
21850
21903
  }
21851
- const copy = coinbaseFailureCopy(code, t);
21852
- if (copy === void 0) {
21853
- return { kind: "unavailable" };
21854
- }
21855
- if (copy.title !== void 0) {
21856
- return { kind: "declined", title: copy.title, message: copy.message };
21857
- }
21858
- return { kind: "refused", detail: copy.message };
21904
+ return coinbaseFailureCopy(code, t) ?? moonpayFailureCopy(code, t) ?? stripeFailureCopy(code, t) ?? {
21905
+ kind: "unavailable",
21906
+ message: isConnectionFailure(code) ? t("fiat.paymentUnavailableDetail") : t("fiat.paymentUnavailableRetry"),
21907
+ mapped: false
21908
+ };
21909
+ }
21910
+ var CONNECTION_FAILURES = /* @__PURE__ */ new Set([
21911
+ "load_timeout",
21912
+ "surface_ready_timeout",
21913
+ WEBVIEW_TERMINATED
21914
+ ]);
21915
+ function isConnectionFailure(code) {
21916
+ return code.startsWith("load_failed") || CONNECTION_FAILURES.has(code);
21859
21917
  }
21860
21918
  function paymentSurfaceRecovery({
21861
21919
  cause,
@@ -21871,15 +21929,19 @@ function paymentSurfaceRecovery({
21871
21929
  }
21872
21930
  return reopenableUntil !== void 0 && reopenableUntil > now ? "hold" : "requote";
21873
21931
  }
21874
- function showPaymentSurfaceUnavailableAlert(t, { applePay, ...options }) {
21932
+ function showPaymentSurfaceUnavailableAlert(t, {
21933
+ applePay,
21934
+ message,
21935
+ ...options
21936
+ }) {
21875
21937
  showRecoveringAlert(
21876
21938
  t,
21877
21939
  applePay ? t("fiat.applePayUnavailableTitle") : t("fiat.refusalUnavailableTitle"),
21878
- t("fiat.paymentUnavailableDetail"),
21940
+ message,
21879
21941
  options
21880
21942
  );
21881
21943
  }
21882
- function showPaymentDeclinedAlert(t, {
21944
+ function showPaymentFailureAlert(t, {
21883
21945
  title,
21884
21946
  message,
21885
21947
  ...options
@@ -21913,6 +21975,50 @@ function isCaptureStale(surface, quote, now = Date.now()) {
21913
21975
  });
21914
21976
  }
21915
21977
 
21978
+ // src/fiat/paymentReroute.ts
21979
+ var OVERRIDE_PROVIDERS = [
21980
+ "TRANSAK",
21981
+ "BANXA",
21982
+ "STRIPE",
21983
+ "COINBASE",
21984
+ "MOONPAY"
21985
+ ];
21986
+ function overridesWithout(skipped, current) {
21987
+ if (skipped.length === 0) {
21988
+ return current;
21989
+ }
21990
+ const candidates = current?.providers ?? OVERRIDE_PROVIDERS;
21991
+ return {
21992
+ providers: candidates.filter((provider) => !skipped.includes(provider))
21993
+ };
21994
+ }
21995
+ function paymentRerouteOverrides({
21996
+ failure: failure2,
21997
+ paymentMethod,
21998
+ failedProvider,
21999
+ skipped,
22000
+ current
22001
+ }) {
22002
+ if (paymentMethod !== "apple_pay" || failedProvider === void 0 || failure2?.kind !== "declined" && failure2?.kind !== "unavailable") {
22003
+ return void 0;
22004
+ }
22005
+ const overrides = overridesWithout([...skipped, failedProvider], current);
22006
+ return overrides !== void 0 && overrides.providers.length > 0 ? overrides : void 0;
22007
+ }
22008
+ function isServableReroute(entry) {
22009
+ switch (entry.kind) {
22010
+ case "PAY":
22011
+ case "AUTHENTICATE":
22012
+ return true;
22013
+ case "CONTINUE": {
22014
+ const { state } = entry.control.stepResponse;
22015
+ return state.kind === "KYC" && state.phase !== "NO_ACTION_REQUIRED";
22016
+ }
22017
+ default:
22018
+ return false;
22019
+ }
22020
+ }
22021
+
21916
22022
  // src/fiat/useStaleQuoteRecovery.ts
21917
22023
  import { isStaleQuoteFailure } from "@funkit/connect-core";
21918
22024
  import { useEffect as useEffect64, useState as useState49 } from "react";
@@ -22344,7 +22450,7 @@ function closeFailure({
22344
22450
  if (failure2.kind === "cancelled") {
22345
22451
  return void 0;
22346
22452
  }
22347
- const error = failure2.kind === "declined" || isCoinbaseInstrumentRefusal(surfaceCode) ? flowError("payment_declined", t("fiat.failure")) : flowError("provider_unavailable", t("fiat.submitFailed"));
22453
+ const error = failure2.kind === "declined" || isCoinbaseInstrumentRefusal(surfaceCode) || isMoonpayCardRefusal(surfaceCode) || isStripeCardRefusal(surfaceCode) ? flowError("payment_declined", t("fiat.failure")) : flowError("provider_unavailable", t("fiat.submitFailed"));
22348
22454
  return { error, detail: { ...detail, reasonCode: surfaceCode } };
22349
22455
  }
22350
22456
 
@@ -22435,6 +22541,7 @@ function contactRefusal(error) {
22435
22541
  // src/flow/FiatDepositAmountStep.tsx
22436
22542
  import { jsx as jsx128, jsxs as jsxs59 } from "react/jsx-runtime";
22437
22543
  var DEFAULT_QUICK_AMOUNTS2 = ["20", "50", "100", "200"];
22544
+ var FIAT_ROUTING_TABLE_GATE = "fiat-routing-table";
22438
22545
  var IS_DEV_BUILD = typeof __DEV__ !== "undefined" && !!__DEV__;
22439
22546
  var noop4 = () => void 0;
22440
22547
  function quotedMinimum(routeMinimum, currency) {
@@ -22611,26 +22718,46 @@ function FiatDepositAmountStep({
22611
22718
  const [kycRecheck, setKycRecheck] = useState51(
22612
22719
  void 0
22613
22720
  );
22721
+ const [reroutedFailureCode, setReroutedFailureCode] = useSeededState(SEED.fiatReroutedFailureCode, void 0);
22614
22722
  const onBackToEntry = useCallback24(() => {
22723
+ refreshRoutingTable(retryLimits);
22615
22724
  setIsKycRequote(false);
22616
22725
  setKycRecheck(void 0);
22726
+ setReroutedFailureCode(void 0);
22617
22727
  setFlowRun((n) => n + 1);
22618
- }, []);
22619
- const onKycRecheck = useCallback24((from) => {
22620
- setIsKycRequote(false);
22621
- setKycRecheck(from);
22622
- setFlowRun((n) => n + 1);
22623
- }, []);
22728
+ }, [retryLimits]);
22729
+ const onKycRecheck = useCallback24(
22730
+ (from) => {
22731
+ refreshRoutingTable(retryLimits);
22732
+ setReroutedFailureCode(void 0);
22733
+ setIsKycRequote(false);
22734
+ setKycRecheck(from);
22735
+ setFlowRun((n) => n + 1);
22736
+ },
22737
+ [retryLimits]
22738
+ );
22624
22739
  const onKycRetry = useCallback24(
22625
22740
  (rejectedProvider) => {
22626
22741
  forgetRouteLimits(retryLimits);
22627
22742
  setTriedKycProviders((providers) => [...providers, rejectedProvider]);
22743
+ setReroutedFailureCode(void 0);
22628
22744
  setIsKycRequote(true);
22629
22745
  setKycRecheck(void 0);
22630
22746
  setFlowRun((n) => n + 1);
22631
22747
  },
22632
22748
  [retryLimits]
22633
22749
  );
22750
+ const [skippedPaymentProviders, setSkippedPaymentProviders] = useState51([]);
22751
+ const onPaymentReroute = useCallback24(
22752
+ (failed2, failureCode) => {
22753
+ setSkippedPaymentProviders((providers) => [...providers, failed2]);
22754
+ setReroutedFailureCode(failureCode);
22755
+ setIsKycRequote(false);
22756
+ setKycRecheck(void 0);
22757
+ setFlowRun((n) => n + 1);
22758
+ },
22759
+ []
22760
+ );
22634
22761
  const onChangeAmount = useCallback24((next) => {
22635
22762
  setTriedKycProviders([]);
22636
22763
  setAmount(next);
@@ -22665,6 +22792,9 @@ function FiatDepositAmountStep({
22665
22792
  amount,
22666
22793
  onChangeAmount,
22667
22794
  triedKycProviders,
22795
+ skippedPaymentProviders,
22796
+ onPaymentReroute,
22797
+ reroutedFailureCode,
22668
22798
  isKycRequote,
22669
22799
  kycRecheck,
22670
22800
  lockAmount,
@@ -22695,7 +22825,6 @@ var FiatFlowSession = memo6(function FiatFlowSession2({
22695
22825
  return entry === null ? /* @__PURE__ */ jsx128(FlowPage, { motion: "push", turn, children: screen2 }, key) : null;
22696
22826
  });
22697
22827
  var ENTRY_KEY = "entry";
22698
- var STRIPE_PROCESSING_PAGE = "stripe-processing";
22699
22828
  var pageIds = /* @__PURE__ */ new Map();
22700
22829
  function pageKey(screen2) {
22701
22830
  let id = pageIds.get(screen2.type);
@@ -22716,6 +22845,9 @@ function useFiatFlowScreen({
22716
22845
  amount,
22717
22846
  onChangeAmount,
22718
22847
  triedKycProviders,
22848
+ skippedPaymentProviders,
22849
+ onPaymentReroute,
22850
+ reroutedFailureCode,
22719
22851
  isKycRequote,
22720
22852
  kycRecheck,
22721
22853
  lockAmount,
@@ -22835,6 +22967,7 @@ function useFiatFlowScreen({
22835
22967
  }, [isRegionCurrencyFailed]);
22836
22968
  const quoteCurrency = isRegionCurrencyLoading || isRegionCurrencyFailed ? void 0 : regionCurrency ?? DEFAULT_FIAT_CURRENCY2;
22837
22969
  const buyerGeo = userIpInfo === void 0 ? void 0 : { alpha2: userIpInfo.alpha2, region: userIpInfo.state };
22970
+ const isRoutingTableOn = useFeatureGate(FIAT_ROUTING_TABLE_GATE);
22838
22971
  const quoteState = useFiatQuote({
22839
22972
  apiKey,
22840
22973
  userId,
@@ -22846,12 +22979,44 @@ function useFiatFlowScreen({
22846
22979
  cryptoCurrencyCode: fiat.cryptoCurrencyCode,
22847
22980
  chainId: fiat.chainId,
22848
22981
  geo: buyerGeo,
22849
- unstable_routingOverrides: fiat.unstable_routingOverrides,
22982
+ unstable_routingOverrides: overridesWithout(
22983
+ skippedPaymentProviders,
22984
+ fiat.unstable_routingOverrides
22985
+ ),
22850
22986
  prepareSessionAuth: true,
22987
+ routingTableSessionId: isRoutingTableOn ? checkoutId : void 0,
22988
+ // A KYC requote must not spend its first request on the provider that just refused.
22989
+ excludedProviders: triedKycProviders,
22851
22990
  // Off once the flow holds a round: a refetch mints a new quoteRef, and the
22852
22991
  // session just verified against the current one would be orphaned by it.
22853
22992
  enabled: flow.stepResponse === void 0
22854
22993
  });
22994
+ const isQuoteSurfaceFailure = surfaceFailure !== void 0 && flow.stepResponse === void 0;
22995
+ const failedPaymentProvider = flow.stepResponse?.provider ?? quoteState.provider;
22996
+ const rerouteOverrides = paymentRerouteOverrides({
22997
+ failure: surfaceFailure !== void 0 && (flow.page.screen === "PAYMENT_CAPTURE" || isQuoteSurfaceFailure) ? paymentSurfaceFailure(surfaceFailure.code, t) : void 0,
22998
+ paymentMethod: fiat.paymentMethod,
22999
+ failedProvider: failedPaymentProvider,
23000
+ skipped: skippedPaymentProviders,
23001
+ current: fiat.unstable_routingOverrides
23002
+ });
23003
+ const rerouteProbe = useFiatQuote({
23004
+ apiKey,
23005
+ userId,
23006
+ logger,
23007
+ flow,
23008
+ amount,
23009
+ currency: quoteCurrency,
23010
+ paymentMethod: fiat.paymentMethod,
23011
+ cryptoCurrencyCode: fiat.cryptoCurrencyCode,
23012
+ chainId: fiat.chainId,
23013
+ geo: buyerGeo,
23014
+ unstable_routingOverrides: rerouteOverrides,
23015
+ enabled: rerouteOverrides !== void 0,
23016
+ debounceMs: 0
23017
+ });
23018
+ const rerouteProvider = rerouteProbe.isQuoteFresh && isServableReroute(rerouteProbe.entryCta) ? rerouteProbe.provider : void 0;
23019
+ const isRerouteSettled = rerouteOverrides === void 0 || !rerouteProbe.isQuoting;
22855
23020
  const refusal = quoteRefusal(flow.stepResponse);
22856
23021
  const overLimitSilenced = refusal !== void 0 && isOverLimit(refusal) && hasOverLimitCeiling(flow.stepResponse, quoteState.maximum, amount);
22857
23022
  const flowQuoteExpired = refusal?.category === "EXPIRED" && refusal.recovery === "REQUOTE";
@@ -23043,14 +23208,45 @@ function useFiatFlowScreen({
23043
23208
  onBackToEntry();
23044
23209
  }
23045
23210
  );
23211
+ const announcedPayment = useRef46(void 0);
23212
+ const reroutePayment = useEffectEvent5((failure2) => {
23213
+ if (rerouteOverrides === void 0 || failedPaymentProvider === void 0) {
23214
+ return false;
23215
+ }
23216
+ if (rerouteProvider === void 0) {
23217
+ logger.info("connect-rn:fiat:payment_reroute_unavailable", {
23218
+ provider: failedPaymentProvider,
23219
+ code: failure2.code,
23220
+ providers: rerouteOverrides.providers
23221
+ });
23222
+ return false;
23223
+ }
23224
+ logger.info("connect-rn:fiat:payment_rerouted", {
23225
+ provider: failedPaymentProvider,
23226
+ next: rerouteProvider,
23227
+ code: failure2.code,
23228
+ skipped: skippedPaymentProviders
23229
+ });
23230
+ onPaymentReroute(failedPaymentProvider, failure2.code);
23231
+ return true;
23232
+ });
23046
23233
  const announcePaymentFailure = useEffectEvent5((failure2) => {
23047
23234
  const payment = paymentSurfaceFailure(failure2.code, t);
23048
23235
  if (payment.kind === "cancelled") {
23049
23236
  recoverPaymentSurface("cancelled");
23050
23237
  return;
23051
23238
  }
23239
+ if (payment.kind === "unavailable" && !payment.mapped) {
23240
+ logger.warn("connect-rn:fiat:payment_failure_unmapped", {
23241
+ provider: flow.stepResponse?.provider,
23242
+ code: failure2.code
23243
+ });
23244
+ }
23245
+ if (reroutePayment(failure2)) {
23246
+ return;
23247
+ }
23052
23248
  if (payment.kind === "declined") {
23053
- showPaymentDeclinedAlert(t, {
23249
+ showPaymentFailureAlert(t, {
23054
23250
  title: payment.title,
23055
23251
  message: payment.message,
23056
23252
  scheme: alertScheme,
@@ -23059,11 +23255,13 @@ function useFiatFlowScreen({
23059
23255
  return;
23060
23256
  }
23061
23257
  if (payment.kind === "refused") {
23062
- showPaymentUnavailableAlert(
23063
- t,
23064
- fiat.paymentMethod === "apple_pay",
23065
- alertScheme
23066
- );
23258
+ showPaymentFailureAlert(t, {
23259
+ title: payment.title,
23260
+ message: payment.message,
23261
+ scheme: alertScheme,
23262
+ onDismiss: () => {
23263
+ }
23264
+ });
23067
23265
  return;
23068
23266
  }
23069
23267
  logger.warn("connect-rn:fiat:payment_surface_unavailable", {
@@ -23072,6 +23270,7 @@ function useFiatFlowScreen({
23072
23270
  });
23073
23271
  showPaymentSurfaceUnavailableAlert(t, {
23074
23272
  applePay: fiat.paymentMethod === "apple_pay",
23273
+ message: payment.message,
23075
23274
  scheme: alertScheme,
23076
23275
  onDismiss: () => recoverPaymentSurface("unavailable")
23077
23276
  });
@@ -23112,11 +23311,17 @@ function useFiatFlowScreen({
23112
23311
  if (surfaceFailure !== void 0 && flow.page.screen === "KYC_CAPTURE" && surfaceFailure.code !== STRIPE_KYC_CANCELLED) {
23113
23312
  announceSurfaceFailure(surfaceFailure);
23114
23313
  } else if (surfaceFailure !== void 0 && flow.page.screen === "PAYMENT_CAPTURE") {
23115
- announcePaymentFailure(surfaceFailure);
23314
+ if (isRerouteSettled && announcedPayment.current !== surfaceFailure) {
23315
+ announcedPayment.current = surfaceFailure;
23316
+ announcePaymentFailure(surfaceFailure);
23317
+ }
23116
23318
  } else if (surfaceFailure !== void 0 && flow.page.screen === "AUTH_CAPTURE") {
23117
23319
  announceAuthFailure(surfaceFailure);
23320
+ } else if (isQuoteSurfaceFailure && isRerouteSettled && announcedPayment.current !== surfaceFailure) {
23321
+ announcedPayment.current = surfaceFailure;
23322
+ reroutePayment(surfaceFailure);
23118
23323
  }
23119
- }, [surfaceFailure, flow.page.screen]);
23324
+ }, [surfaceFailure, flow.page.screen, isRerouteSettled]);
23120
23325
  useEffect66(() => {
23121
23326
  if (isContactStepOver) {
23122
23327
  setContactRound(void 0);
@@ -23214,11 +23419,12 @@ function useFiatFlowScreen({
23214
23419
  const stripeAuthState = flow.stepResponse?.state;
23215
23420
  const stripeAuthSheet = flow.page.screen === "AUTH_CAPTURE" && flow.stepResponse?.provider === "STRIPE" && (flow.surface !== void 0 || authResultTransition !== void 0) && stripeAuthState?.kind === "SESSION_AUTH" && stripeAuthState.surface !== void 0 && stripeAuthSurface(stripeAuthState.surface) !== void 0 ? stripeAuthState.surface : void 0;
23216
23421
  const stripePaySheet = flow.page.screen === "PAYMENT_CAPTURE" && captureModel === "HANDOFF" && captureSurface !== void 0 && matchStripePayParams(captureSurface) !== void 0 ? captureSurface : void 0;
23422
+ const backgroundCapture = flow.page.screen === "PAYMENT_CAPTURE" && captureModel === "BACKGROUND" ? captureSurface : void 0;
23217
23423
  const startsStripeLink = flow.page.screen === "OTP" && flow.stepResponse?.provider === "STRIPE" && stripeSessionAuthStart(flow.stepResponse, flow.ctas) !== void 0;
23218
23424
  const opensStripeSheet = stripeOnramp !== void 0 && (startsStripeLink || stripeAuthSheet !== void 0 || stripePaySheet !== void 0);
23219
23425
  const isAmountHosted = isHeldForTap || opensStripeSheet || paymentUnavailable || flow.page.screen === "AMOUNT_ENTRY" || flow.page.screen === "QUOTE_REVIEW" || // A resolved check is a banner over the amount, not a screen with a back
23220
23426
  // control of its own, so the sheet still has to swipe away under it.
23221
- isKycVerdictScreen(flow.page.screen) || isEmbeddedAuth || flow.page.screen === "PAYMENT_CAPTURE" && captureModel === "EMBEDDED";
23427
+ isKycVerdictScreen(flow.page.screen) || isEmbeddedAuth || backgroundCapture !== void 0 || flow.page.screen === "PAYMENT_CAPTURE" && captureModel === "EMBEDDED";
23222
23428
  useLockFlowDismiss(contactRound !== void 0 || !isAmountHosted);
23223
23429
  useEffect66(() => {
23224
23430
  if (captureSurface === void 0 || captureModel !== void 0) {
@@ -23651,18 +23857,27 @@ function useFiatFlowScreen({
23651
23857
  setResolvedKyc(void 0);
23652
23858
  }
23653
23859
  }, [isOrdered]);
23654
- const orderCreated = flow.stepResponse?.state.kind === "ORDER";
23655
- const [providerSettled, setProviderSettled] = useState51(false);
23656
- const markProviderSettled = () => {
23860
+ const hasOrderId = orderIdOf(flow) !== void 0;
23861
+ const [providerSettled, setProviderSettled] = useState51();
23862
+ const [processingAnnounced, setProcessingAnnounced] = useState51(false);
23863
+ const markProviderSettled = (settlement) => {
23657
23864
  logger.info("connect-rn:fiat:provider_settled", {
23658
23865
  orderId: orderIdOf(flow),
23659
23866
  provider,
23660
- awaitingOrder: !orderCreated,
23867
+ settlement: settlement ?? "SENT",
23868
+ awaitingOrderId: !hasOrderId,
23661
23869
  route: isDirect ? "recipient" : "depositAddress"
23662
23870
  });
23663
- setProviderSettled(true);
23871
+ setProviderSettled(settlement ?? "SENT");
23664
23872
  };
23665
- const deliveryConfirmed = flow.page.screen === "SUCCESS" || providerSettled && orderCreated;
23873
+ const deliveryConfirmed = flow.page.screen === "SUCCESS" || providerSettled !== void 0 && hasOrderId;
23874
+ const shownDepositAmount = () => paidAmount(flow, shownQuote) ?? formatFiat(
23875
+ Number(amount),
23876
+ shownQuote?.fiat.currency ?? DEFAULT_FIAT_CURRENCY2
23877
+ );
23878
+ const shownDepositMethod = () => t("fiat.depositReceivedFrom", {
23879
+ method: config.methodName ?? methodDisplayName(fiat.paymentMethod, t)
23880
+ });
23666
23881
  const settled = useRef46(false);
23667
23882
  const settleDeposit = useEffectEvent5(() => {
23668
23883
  if (settled.current) {
@@ -23682,16 +23897,11 @@ function useFiatFlowScreen({
23682
23897
  if (!isDirect) {
23683
23898
  return;
23684
23899
  }
23900
+ const shownAmount = shownDepositAmount();
23901
+ const delivered = flow.page.screen === "SUCCESS" || providerSettled !== "PAID";
23685
23902
  showDepositToast({
23686
- title: t("fiat.depositReceived", {
23687
- amount: paidAmount(flow, shownQuote) ?? formatFiat(
23688
- Number(amount),
23689
- shownQuote?.fiat.currency ?? DEFAULT_FIAT_CURRENCY2
23690
- )
23691
- }),
23692
- detail: t("fiat.depositReceivedFrom", {
23693
- method: config.methodName ?? methodDisplayName(fiat.paymentMethod, t)
23694
- })
23903
+ title: delivered ? t("fiat.depositReceived", { amount: shownAmount }) : t("fiat.depositOnTheWay", { amount: shownAmount }),
23904
+ detail: shownDepositMethod()
23695
23905
  });
23696
23906
  close();
23697
23907
  if (orderId === void 0) {
@@ -23757,6 +23967,20 @@ function useFiatFlowScreen({
23757
23967
  wasInKyc.current = false;
23758
23968
  forgetRouteLimits(queryClient);
23759
23969
  }, [inKyc, queryClient]);
23970
+ const authKind = flow.stepResponse?.state.kind;
23971
+ const inAuth = authKind === "SESSION_AUTH" || authKind === "FUN_AUTH";
23972
+ const wasInAuth = useRef46(false);
23973
+ useEffect66(() => {
23974
+ if (inAuth) {
23975
+ wasInAuth.current = true;
23976
+ return;
23977
+ }
23978
+ if (!wasInAuth.current) {
23979
+ return;
23980
+ }
23981
+ wasInAuth.current = false;
23982
+ refreshRoutingTable(queryClient);
23983
+ }, [inAuth, queryClient]);
23760
23984
  const railCopy = resolveDepositRailCopy(config, fiat.paymentMethod, t);
23761
23985
  const quotedLabel = isEntryReady ? entryCtaLabel(entryCta, t, railCopy.submitLabel) : railCopy.submitLabel;
23762
23986
  const contactFields = isEntryReady ? sessionContactFields(entryCta) : [];
@@ -23926,10 +24150,25 @@ function useFiatFlowScreen({
23926
24150
  setHeldSlot(liveSlot);
23927
24151
  }
23928
24152
  }, [liveSlot?.key]);
23929
- const isAwaitingSettlement = capturedPayment && flow.phase !== "SURFACE_RUNNING" && WAITS_ON_PAYMENT.has(flow.page.screen);
24153
+ const isAwaitingSettlement = capturedPayment && flow.phase !== "SURFACE_RUNNING" && WAITS_ON_PAYMENT.has(flow.page.screen) || backgroundCapture !== void 0;
24154
+ const announcesProcessing = processingAnnounced && isAwaitingSettlement && flow.phase !== "RETRYABLE";
24155
+ const announceProcessing = useEffectEvent5(
24156
+ () => showDepositToast(
24157
+ {
24158
+ title: t("fiat.depositProcessing", { amount: shownDepositAmount() }),
24159
+ detail: shownDepositMethod()
24160
+ },
24161
+ { untilReplaced: true }
24162
+ )
24163
+ );
24164
+ useEffect66(() => {
24165
+ if (!announcesProcessing) {
24166
+ return;
24167
+ }
24168
+ const hideProcessing = announceProcessing();
24169
+ return hideProcessing;
24170
+ }, [announcesProcessing]);
23930
24171
  const orderFailed = capturedPayment && flow.page.screen === "FAILURE";
23931
- const holdsStripeProcessing = capturedPayment && flow.stepResponse?.provider === "STRIPE" && (isAwaitingSettlement || flow.page.screen === "SUCCESS" && isDirect);
23932
- const stripeCheckoutRan = flow.page.screen !== "PAYMENT_CAPTURE" || captureSurface !== void 0 && matchStripeCheckoutParams(captureSurface) !== void 0;
23933
24172
  useEffect66(() => {
23934
24173
  if (orderFailed) {
23935
24174
  setFailureEvent((n) => n + 1);
@@ -24114,7 +24353,8 @@ function useFiatFlowScreen({
24114
24353
  }
24115
24354
  }
24116
24355
  const paymentFailure = surfaceFailure !== void 0 && flow.page.screen === "PAYMENT_CAPTURE" ? paymentSurfaceFailure(surfaceFailure.code, t) : void 0;
24117
- if (paymentFailure !== void 0 && paymentFailure.kind !== "refused") {
24356
+ const holdsForReroute = isQuoteSurfaceFailure && rerouteOverrides !== void 0 && (!isRerouteSettled || rerouteProvider !== void 0);
24357
+ if (holdsForReroute || paymentFailure !== void 0 && paymentFailure.kind !== "refused") {
24118
24358
  renderSubmit = () => /* @__PURE__ */ jsx128(SurfaceSlot, { label: t("common.loading"), size: SURFACE_MATCHED_SIZE });
24119
24359
  } else if (paymentFailure !== void 0 || surfaceFailure?.code === STRIPE_KYC_CANCELLED) {
24120
24360
  renderSubmit = () => /* @__PURE__ */ jsx128(FiatActionButton, { label: t("common.tryAgain"), onPress: retrySurface });
@@ -24186,11 +24426,6 @@ function useFiatFlowScreen({
24186
24426
  title: t("fiat.failure"),
24187
24427
  detail: t("fiat.submitFailed")
24188
24428
  };
24189
- } else if (paymentFailure?.kind === "refused") {
24190
- failureCopy = {
24191
- title: t("fiat.paymentFailed"),
24192
- detail: paymentFailure.detail
24193
- };
24194
24429
  }
24195
24430
  const failureDismissal = useToastDismissal(
24196
24431
  failureCopy === void 0 ? void 0 : String(failureEvent)
@@ -24228,6 +24463,24 @@ function useFiatFlowScreen({
24228
24463
  )
24229
24464
  }
24230
24465
  );
24466
+ const rerouteCopy = reroutedPaymentCopy(reroutedFailureCode, t);
24467
+ const rerouteDismissal = useToastDismissal(
24468
+ rerouteCopy === void 0 ? void 0 : `reroute:${skippedPaymentProviders.join(",")}`
24469
+ );
24470
+ const dismissReroute = rerouteDismissal.dismiss;
24471
+ useEffect66(() => {
24472
+ if (rerouteCopy !== void 0 && !isOnEntry) {
24473
+ dismissReroute();
24474
+ }
24475
+ }, [rerouteCopy, isOnEntry, dismissReroute]);
24476
+ const rerouteBanner = rerouteCopy === void 0 || rerouteDismissal.isDismissed ? void 0 : /* @__PURE__ */ jsx128(
24477
+ DismissibleToast,
24478
+ {
24479
+ style: [styles64.failureBanner, { top: bannerTop }],
24480
+ onDismiss: rerouteDismissal.dismiss,
24481
+ children: /* @__PURE__ */ jsx128(FiatFailureBanner, { ...rerouteCopy })
24482
+ }
24483
+ );
24231
24484
  const outcomeDismissal = useToastDismissal(
24232
24485
  identityNoticeState === void 0 ? void 0 : `${kycSubmission}:${identityNoticeState}`
24233
24486
  );
@@ -24287,6 +24540,13 @@ function useFiatFlowScreen({
24287
24540
  onFailed: failSurface,
24288
24541
  onClose: onBackToEntry,
24289
24542
  onSettled: markProviderSettled,
24543
+ onProcessing: () => {
24544
+ logger.info("connect-rn:fiat:provider_processing", {
24545
+ orderId: orderIdOf(flow),
24546
+ provider
24547
+ });
24548
+ setProcessingAnnounced(true);
24549
+ },
24290
24550
  report: (result) => void reportSurface(result)
24291
24551
  }) }, surfaceAttempt);
24292
24552
  }
@@ -24373,7 +24633,7 @@ function useFiatFlowScreen({
24373
24633
  showAttribution: !hideAttribution
24374
24634
  }
24375
24635
  ),
24376
- failureBanner ?? outcomeBanner ?? handoffBanner,
24636
+ failureBanner ?? outcomeBanner ?? handoffBanner ?? rerouteBanner,
24377
24637
  /* @__PURE__ */ jsx128(
24378
24638
  FeeDetailsSheet,
24379
24639
  {
@@ -24413,7 +24673,7 @@ function useFiatFlowScreen({
24413
24673
  if (recoverableRejection || paymentUnavailable) {
24414
24674
  return entryScreen;
24415
24675
  }
24416
- if (surfaceFailure !== void 0 && flow.page.screen === "PAYMENT_CAPTURE") {
24676
+ if (holdsForReroute || surfaceFailure !== void 0 && flow.page.screen === "PAYMENT_CAPTURE") {
24417
24677
  return entryScreen;
24418
24678
  }
24419
24679
  if (surfaceFailure?.code === STRIPE_KYC_CANCELLED) {
@@ -24562,18 +24822,22 @@ function useFiatFlowScreen({
24562
24822
  "kyc-completion"
24563
24823
  );
24564
24824
  }
24565
- if (holdsStripeProcessing) {
24566
- return /* @__PURE__ */ jsx128(Fragment11, { children: /* @__PURE__ */ jsx128(
24567
- FiatStatusScreen,
24568
- {
24569
- tone: "waiting",
24570
- title: stripeCheckoutRan ? t("fiat.processing") : t("fiat.orderConfirmingTitle"),
24571
- onClose: close
24572
- }
24573
- ) }, STRIPE_PROCESSING_PAGE);
24574
- }
24575
24825
  if (isAwaitingSettlement || isHeldForTap) {
24576
- return entryScreen;
24826
+ if (backgroundCapture === void 0) {
24827
+ return entryScreen;
24828
+ }
24829
+ return renderEntry(
24830
+ /* @__PURE__ */ jsx128(Fragment11, { children: renderCaptureSurface({
24831
+ surface: backgroundCapture,
24832
+ adapters: stripeCaptureAdapters,
24833
+ placement: "SCREEN",
24834
+ onReady: noop4,
24835
+ onFailed: failSurface,
24836
+ onClose: onBackToEntry,
24837
+ onSettled: markProviderSettled,
24838
+ report: (result) => void reportSurface(result)
24839
+ }) }, surfaceAttempt)
24840
+ );
24577
24841
  }
24578
24842
  const unsupportedContext = {
24579
24843
  provider: flow.stepResponse?.provider,
@@ -24601,7 +24865,7 @@ function useFiatFlowScreen({
24601
24865
  return entryScreen;
24602
24866
  }
24603
24867
  if (control === "HANDOFF") {
24604
- const handoff = /* @__PURE__ */ jsx128(Fragment11, { children: renderCaptureSurface({
24868
+ return /* @__PURE__ */ jsx128(Fragment11, { children: renderCaptureSurface({
24605
24869
  surface: surfaceData,
24606
24870
  adapters: stripeCaptureAdapters,
24607
24871
  placement: "SCREEN",
@@ -24611,7 +24875,6 @@ function useFiatFlowScreen({
24611
24875
  onSettled: markProviderSettled,
24612
24876
  report: (result) => void reportSurface(result)
24613
24877
  }) }, surfaceAttempt);
24614
- return capturedPayment && matchStripeCheckoutParams(surfaceData) !== void 0 ? /* @__PURE__ */ jsx128(Fragment11, { children: handoff }, STRIPE_PROCESSING_PAGE) : handoff;
24615
24878
  }
24616
24879
  return entryScreen;
24617
24880
  }
@@ -25399,6 +25662,17 @@ function usePreviewSubmit(flow, seededStep) {
25399
25662
  }
25400
25663
  }, [cta, flow]);
25401
25664
  }
25665
+ function reroutedPaymentCopy(code, t) {
25666
+ if (code === void 0) {
25667
+ return void 0;
25668
+ }
25669
+ const failure2 = paymentSurfaceFailure(code, t);
25670
+ return {
25671
+ // Anything else is a code we have no copy for, a card refusal among them.
25672
+ title: failure2.kind === "declined" ? failure2.title : t("fiat.submitFailed"),
25673
+ detail: t("fiat.paymentReroutedDetail")
25674
+ };
25675
+ }
25402
25676
 
25403
25677
  // src/flow/FiatRegionBlockedStep.tsx
25404
25678
  import { useEffect as useEffect67, useRef as useRef47 } from "react";
@@ -26410,7 +26684,7 @@ var GLYPH_SLOT = 26;
26410
26684
  var GLYPH_HEIGHT2 = 21;
26411
26685
  var CARD_RADIUS2 = 20;
26412
26686
  var SURFACE_OPACITY = 0.5;
26413
- var DARK_FILL = "#3E3E42";
26687
+ var DARK_FILL2 = "#3E3E42";
26414
26688
  var BLUR_INTENSITY2 = 90;
26415
26689
  var enterAnimation2 = new Keyframe7({
26416
26690
  0: { opacity: 0, transform: [{ translateY: -12 }] },
@@ -26429,7 +26703,7 @@ function DepositReceivedToast({
26429
26703
  const accent = theme.content.elements.primary;
26430
26704
  const dark = isDarkColor(theme.background.modal);
26431
26705
  const fill3 = withAlpha(
26432
- dark ? DARK_FILL : theme.background.modal,
26706
+ dark ? DARK_FILL2 : theme.background.modal,
26433
26707
  SURFACE_OPACITY
26434
26708
  );
26435
26709
  return /* @__PURE__ */ jsx135(Animated30.View, { entering: enterAnimation2, exiting: exitAnimation2, children: /* @__PURE__ */ jsxs62(
@@ -26443,8 +26717,16 @@ function DepositReceivedToast({
26443
26717
  /* @__PURE__ */ jsx135(CardMaterial, { dark, fill: fill3 }),
26444
26718
  /* @__PURE__ */ jsx135(Box, { style: styles67.glyph, children: /* @__PURE__ */ jsx135(ApplePayIcon, { size: GLYPH_HEIGHT2, color: accent }) }),
26445
26719
  /* @__PURE__ */ jsxs62(Box, { flex: 1, style: styles67.copy, children: [
26446
- /* @__PURE__ */ jsx135(Text, { weight: "semibold", style: [styles67.text, { color: accent }], children: title }),
26447
- /* @__PURE__ */ jsx135(Text, { style: [styles67.text, styles67.detail, { color: accent }], children: detail })
26720
+ /* @__PURE__ */ jsx135(Text, { variant: "notice", weight: "semibold", style: { color: accent }, children: title }),
26721
+ /* @__PURE__ */ jsx135(
26722
+ Text,
26723
+ {
26724
+ variant: "notice",
26725
+ weight: "base",
26726
+ style: [styles67.detail, { color: accent }],
26727
+ children: detail
26728
+ }
26729
+ )
26448
26730
  ] })
26449
26731
  ]
26450
26732
  }
@@ -26497,7 +26779,6 @@ var styles67 = StyleSheet71.create({
26497
26779
  clip: { borderRadius: CARD_RADIUS2, overflow: "hidden" },
26498
26780
  glyph: { width: GLYPH_SLOT, alignItems: "center", justifyContent: "center" },
26499
26781
  copy: { justifyContent: "center" },
26500
- text: { fontSize: 15, lineHeight: 18, letterSpacing: -0.225 },
26501
26782
  detail: { opacity: 0.5 }
26502
26783
  });
26503
26784
 
@@ -26509,31 +26790,47 @@ var TOAST_TOP = 56;
26509
26790
  var TOAST_SIDE = 14;
26510
26791
  function useDepositReceivedToast() {
26511
26792
  const insets = useSafeAreaInsets26();
26512
- const [receipt, setReceipt] = useState54();
26793
+ const [card2, setCard] = useState54();
26794
+ const nextId = useRef50(0);
26513
26795
  const [shown, setShown] = useState54(false);
26514
26796
  const hideTimer = useRef50(void 0);
26515
26797
  const unmountTimer = useRef50(void 0);
26798
+ const activeId = useRef50(void 0);
26516
26799
  const clearDepositToast = useCallback27(() => {
26517
26800
  clearTimeout(hideTimer.current);
26518
26801
  clearTimeout(unmountTimer.current);
26802
+ activeId.current = void 0;
26519
26803
  setShown(false);
26520
- setReceipt(void 0);
26804
+ setCard(void 0);
26521
26805
  }, []);
26522
- const showDepositToast = useCallback27((next) => {
26806
+ const hide = useCallback27(() => {
26523
26807
  clearTimeout(hideTimer.current);
26524
- clearTimeout(unmountTimer.current);
26525
- setReceipt(next);
26526
- setShown(true);
26527
- hideTimer.current = setTimeout(() => {
26528
- setShown(false);
26529
- unmountTimer.current = setTimeout(
26530
- () => setReceipt(void 0),
26531
- TOAST_EXIT_MS2
26532
- );
26533
- }, TOAST_VISIBLE_MS2);
26808
+ activeId.current = void 0;
26809
+ setShown(false);
26810
+ unmountTimer.current = setTimeout(() => setCard(void 0), TOAST_EXIT_MS2);
26534
26811
  }, []);
26812
+ const showDepositToast = useCallback27(
26813
+ (next, options) => {
26814
+ clearTimeout(hideTimer.current);
26815
+ clearTimeout(unmountTimer.current);
26816
+ nextId.current += 1;
26817
+ const id = nextId.current;
26818
+ activeId.current = id;
26819
+ setCard({ id, receipt: next });
26820
+ setShown(true);
26821
+ if (!options?.untilReplaced) {
26822
+ hideTimer.current = setTimeout(hide, TOAST_VISIBLE_MS2);
26823
+ }
26824
+ return () => {
26825
+ if (activeId.current === id) {
26826
+ hide();
26827
+ }
26828
+ };
26829
+ },
26830
+ [hide]
26831
+ );
26535
26832
  useEffect70(() => () => clearDepositToast(), [clearDepositToast]);
26536
- const depositToast = receipt === void 0 ? null : /* @__PURE__ */ jsx136(
26833
+ const depositToast = card2 === void 0 ? null : /* @__PURE__ */ jsx136(
26537
26834
  View35,
26538
26835
  {
26539
26836
  pointerEvents: "box-none",
@@ -26541,7 +26838,18 @@ function useDepositReceivedToast() {
26541
26838
  styles68.overlay,
26542
26839
  { top: insets.top + TOAST_TOP - DEPOSIT_METRICS.reference.insetTop }
26543
26840
  ],
26544
- children: shown ? /* @__PURE__ */ jsx136(DismissibleToast, { onDismiss: clearDepositToast, children: /* @__PURE__ */ jsx136(DepositReceivedToast, { ...receipt }) }) : null
26841
+ children: shown ? /* @__PURE__ */ jsx136(
26842
+ DismissibleToast,
26843
+ {
26844
+ onDismiss: () => {
26845
+ if (activeId.current === card2.id) {
26846
+ clearDepositToast();
26847
+ }
26848
+ },
26849
+ children: /* @__PURE__ */ jsx136(DepositReceivedToast, { ...card2.receipt })
26850
+ },
26851
+ card2.id
26852
+ ) : null
26545
26853
  }
26546
26854
  );
26547
26855
  return { depositToast, showDepositToast, clearDepositToast };
@@ -26925,12 +27233,12 @@ var ICON_ENTERING = FadeIn3.duration(420);
26925
27233
  var DISPLACED_TRANSITION = LinearTransition2.duration(420).easing(
26926
27234
  Easing10.bezier(0.34, 1.56, 0.64, 1)
26927
27235
  );
26928
- var AMOUNT_FONT_SIZE2 = 64;
27236
+ var AMOUNT_FONT_SIZE = 64;
26929
27237
  var LETTER_SPACING_RATIO = -0.96 / 64;
26930
27238
  var LINE_HEIGHT_RATIO = 1.25;
26931
27239
  var CAP_BOX_RATIO = 45 / 64;
26932
- var AMOUNT_LINE_HEIGHT = AMOUNT_FONT_SIZE2 * LINE_HEIGHT_RATIO;
26933
- var AMOUNT_OVERHANG = AMOUNT_FONT_SIZE2 * (LINE_HEIGHT_RATIO - CAP_BOX_RATIO) / 2;
27240
+ var AMOUNT_LINE_HEIGHT = AMOUNT_FONT_SIZE * LINE_HEIGHT_RATIO;
27241
+ var AMOUNT_OVERHANG = AMOUNT_FONT_SIZE * (LINE_HEIGHT_RATIO - CAP_BOX_RATIO) / 2;
26934
27242
  var AMOUNT_SKELETON_WIDTH = 200;
26935
27243
  var TOKEN_SKELETON_WIDTH = 96;
26936
27244
  function ReceiveAmountSummary({
@@ -26982,7 +27290,7 @@ function ReceiveAmountSummary({
26982
27290
  SkeletonBar,
26983
27291
  {
26984
27292
  width: AMOUNT_SKELETON_WIDTH,
26985
- height: AMOUNT_FONT_SIZE2 * CAP_BOX_RATIO,
27293
+ height: AMOUNT_FONT_SIZE * CAP_BOX_RATIO,
26986
27294
  borderRadius: theme.borderRadii.element
26987
27295
  }
26988
27296
  ) : null,
@@ -27038,9 +27346,9 @@ var styles69 = StyleSheet73.create({
27038
27346
  root: { gap: 24 },
27039
27347
  figure: { gap: 24 },
27040
27348
  amount: {
27041
- fontSize: AMOUNT_FONT_SIZE2,
27349
+ fontSize: AMOUNT_FONT_SIZE,
27042
27350
  lineHeight: AMOUNT_LINE_HEIGHT,
27043
- letterSpacing: AMOUNT_FONT_SIZE2 * LETTER_SPACING_RATIO,
27351
+ letterSpacing: AMOUNT_FONT_SIZE * LETTER_SPACING_RATIO,
27044
27352
  marginVertical: -AMOUNT_OVERHANG
27045
27353
  },
27046
27354
  tokenRow: { gap: 6 }
@@ -27258,7 +27566,7 @@ function resolveStatus({
27258
27566
 
27259
27567
  // src/screens/WithdrawCryptoSteps.tsx
27260
27568
  import { BottomSheetModal as BottomSheetModal5, BottomSheetView as BottomSheetView5 } from "@gorhom/bottom-sheet";
27261
- import { useFeatureGate as useFeatureGate2 } from "@funkit/connect-core";
27569
+ import { useFeatureGate as useFeatureGate3 } from "@funkit/connect-core";
27262
27570
  import { useState as useState62 } from "react";
27263
27571
  import { useSafeAreaInsets as useSafeAreaInsets32 } from "react-native-safe-area-context";
27264
27572
 
@@ -27985,13 +28293,13 @@ function useWithdrawalDestinationTokens({
27985
28293
  import {
27986
28294
  isAddressCompatibleWithChain as isAddressCompatibleWithChain3,
27987
28295
  isWithdrawalRisky,
27988
- useFeatureGate
28296
+ useFeatureGate as useFeatureGate2
27989
28297
  } from "@funkit/connect-core";
27990
28298
  import { useQuery as useQuery10 } from "@tanstack/react-query";
27991
28299
  var WITHDRAWAL_RISK_QUERY_KEY = "withdrawalRisk";
27992
28300
  function useWithdrawalRisk(address, chainId) {
27993
28301
  const { apiKey } = useFunkitIdentity();
27994
- const screeningDisabled = useFeatureGate("disable-frontend-chainalysis");
28302
+ const screeningDisabled = useFeatureGate2("disable-frontend-chainalysis");
27995
28303
  const query = useQuery10({
27996
28304
  queryKey: [WITHDRAWAL_RISK_QUERY_KEY, apiKey, address, chainId],
27997
28305
  queryFn: () => isWithdrawalRisky({
@@ -29258,7 +29566,7 @@ function amountGlyphs2(value, prefix) {
29258
29566
 
29259
29567
  // src/components/AmountDisplay.tsx
29260
29568
  import { jsx as jsx147 } from "react/jsx-runtime";
29261
- var AMOUNT_FONT_SIZE3 = 96;
29569
+ var AMOUNT_FONT_SIZE2 = 96;
29262
29570
  var PLACEHOLDER_OPACITY2 = 0.2;
29263
29571
  var LINE_HEIGHT_RATIO2 = 1.25;
29264
29572
  var LETTER_SPACING_RATIO2 = -1.44 / 96;
@@ -29363,7 +29671,7 @@ function slideKeyframes2(offset) {
29363
29671
  }
29364
29672
  function fitAmountFontSize(text3, available) {
29365
29673
  const fitted = available / (text3.length * CHARACTER_ADVANCE_RATIO);
29366
- return Math.max(MIN_FONT_SIZE, Math.min(AMOUNT_FONT_SIZE3, fitted));
29674
+ return Math.max(MIN_FONT_SIZE, Math.min(AMOUNT_FONT_SIZE2, fitted));
29367
29675
  }
29368
29676
  var styles75 = StyleSheet79.create({
29369
29677
  row: {
@@ -29377,7 +29685,7 @@ var styles75 = StyleSheet79.create({
29377
29685
  // src/components/NumPad.tsx
29378
29686
  import { Pressable as Pressable34, StyleSheet as StyleSheet80 } from "react-native";
29379
29687
  import { jsx as jsx148 } from "react/jsx-runtime";
29380
- var KEY_FONT_SIZE2 = 24;
29688
+ var KEY_FONT_SIZE = 24;
29381
29689
  var COLUMN_ALIGNMENT2 = ["flex-start", "center", "flex-end"];
29382
29690
  var ROWS3 = [
29383
29691
  ["1", "2", "3"],
@@ -29404,7 +29712,7 @@ function NumPad3({
29404
29712
  children: key === "backspace" ? /* @__PURE__ */ jsx148(
29405
29713
  FigmaChevronLeftIcon,
29406
29714
  {
29407
- size: KEY_FONT_SIZE2,
29715
+ size: KEY_FONT_SIZE,
29408
29716
  color: theme.content.elements.primary
29409
29717
  }
29410
29718
  ) : /* @__PURE__ */ jsx148(
@@ -29425,8 +29733,8 @@ function NumPad3({
29425
29733
  var styles76 = StyleSheet80.create({
29426
29734
  key: { flex: 1, justifyContent: "center" },
29427
29735
  label: {
29428
- fontSize: KEY_FONT_SIZE2,
29429
- minWidth: KEY_FONT_SIZE2,
29736
+ fontSize: KEY_FONT_SIZE,
29737
+ minWidth: KEY_FONT_SIZE,
29430
29738
  lineHeight: 32,
29431
29739
  letterSpacing: -0.36,
29432
29740
  textAlign: "center"
@@ -29800,7 +30108,7 @@ function WithdrawCryptoSteps({
29800
30108
  } = useNestedSheet();
29801
30109
  const connectedWalletAddress = useConnectedRecipientAddress(config);
29802
30110
  const isStablecoin = useIsStablecoin();
29803
- const hideStablecoinSwap = useFeatureGate2("hide-stablecoin-amount-switch") && config.displayCurrency !== "EUR" && isStablecoin(form.sourceToken.symbol);
30111
+ const hideStablecoinSwap = useFeatureGate3("hide-stablecoin-amount-switch") && config.displayCurrency !== "EUR" && isStablecoin(form.sourceToken.symbol);
29804
30112
  const canSwapDenomination = form.canSwapDenomination && !hideStablecoinSwap;
29805
30113
  const amountFiatLabel = form.amountFiat === void 0 ? void 0 : formatFiat(Number(form.amountFiat), config.displayCurrency ?? "USD");
29806
30114
  const receiveFiatLabel = form.receiveFiat === void 0 ? void 0 : formatFiat(form.receiveFiat, config.displayCurrency ?? "USD");
@@ -30914,7 +31222,7 @@ function FunkitFlowProvider({
30914
31222
  setRootHeight(event.nativeEvent.layout.height);
30915
31223
  }, []);
30916
31224
  const [stripeOnrampClient, setStripeOnrampClient] = useState65(void 0);
30917
- const isV2DepositGateOn = useFeatureGate3(RN_V2_DEPOSIT_GATE);
31225
+ const isV2DepositGateOn = useFeatureGate4(RN_V2_DEPOSIT_GATE);
30918
31226
  const isV2DepositEnabled = isV2DepositGateOn || isV2DepositCustomer(apiKey);
30919
31227
  const nativeCapabilities = useMemo37(
30920
31228
  () => ({
@@ -31324,7 +31632,7 @@ function sameIdentity(a, b) {
31324
31632
  }
31325
31633
 
31326
31634
  // src/version.ts
31327
- var CONNECT_RN_VERSION = true ? "9.0.0" : "0.0.0-dev";
31635
+ var CONNECT_RN_VERSION = true ? "9.0.1" : "0.0.0-dev";
31328
31636
 
31329
31637
  // src/providers/FunkitStatsigProvider.tsx
31330
31638
  import {