@vtex/faststore 0.0.10 → 0.0.12

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 (509) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +0 -1
  3. package/dist/_virtual/_rolldown/runtime.js +4 -0
  4. package/dist/actions.json +6 -1
  5. package/dist/catalog.json +789 -1701
  6. package/dist/cli/index.d.ts +66 -28
  7. package/dist/cli/index.js +7371 -512
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/cli/server-runtime.js +41 -60
  10. package/dist/cli/server-runtime.js.map +1 -1
  11. package/dist/client.d.ts +3 -3
  12. package/dist/client.js +2 -2
  13. package/dist/components.d.ts +63 -57
  14. package/dist/components.js +60 -54
  15. package/dist/content-types.json +5785 -754
  16. package/dist/core/dist/define-component.d.ts +1 -1
  17. package/dist/core/dist/define-content-type.d.ts +50 -2
  18. package/dist/core/dist/define-content-type.js +107 -3
  19. package/dist/core/dist/define-content-type.js.map +1 -1
  20. package/dist/core/dist/index.d.ts +2 -2
  21. package/dist/docs/access-code-field.md +1 -1
  22. package/dist/docs/access-code-sign-in.md +126 -77
  23. package/dist/docs/account-address-book.md +210 -95
  24. package/dist/docs/account-menu.md +14 -15
  25. package/dist/docs/account-saved-cards.md +44 -39
  26. package/dist/docs/alert-dialog.md +3 -1
  27. package/dist/docs/avatar.md +4 -2
  28. package/dist/docs/billing-address.md +99 -30
  29. package/dist/docs/binding-switcher.md +5 -2
  30. package/dist/docs/buy-button.md +7 -8
  31. package/dist/docs/card-entry.md +39 -26
  32. package/dist/docs/card-summary.md +18 -8
  33. package/dist/docs/cardholder-document.md +5 -3
  34. package/dist/docs/carousel.md +5 -4
  35. package/dist/docs/cart-destination.md +39 -26
  36. package/dist/docs/cart-item.md +29 -14
  37. package/dist/docs/cart-totalizer.md +7 -5
  38. package/dist/docs/cart.md +135 -41
  39. package/dist/docs/challenge-return.md +135 -0
  40. package/dist/docs/client-preferences-fieldset.md +10 -5
  41. package/dist/docs/client-preferences.md +31 -8
  42. package/dist/docs/client-profile-fieldset.md +20 -6
  43. package/dist/docs/client-profile.md +12 -3
  44. package/dist/docs/copy-text.md +9 -7
  45. package/dist/docs/document-field.md +1 -1
  46. package/dist/docs/email-field.md +2 -1
  47. package/dist/docs/email-identification.md +12 -2
  48. package/dist/docs/footer-copyright.md +4 -2
  49. package/dist/docs/form.md +54 -18
  50. package/dist/docs/free-shipping-progress.md +6 -5
  51. package/dist/docs/identity-edit.md +8 -2
  52. package/dist/docs/identity-summary.md +18 -5
  53. package/dist/docs/installments.md +46 -32
  54. package/dist/docs/my-account-profile.md +16 -11
  55. package/dist/docs/navigation-link.md +5 -3
  56. package/dist/docs/order-cancel.md +3 -1
  57. package/dist/docs/order-delivery-address.md +7 -5
  58. package/dist/docs/order-delivery-group.md +1 -3
  59. package/dist/docs/order-details-back.md +1 -1
  60. package/dist/docs/order-details-header.md +1 -4
  61. package/dist/docs/order-invoice-download.md +60 -0
  62. package/dist/docs/order-list-row.md +1 -1
  63. package/dist/docs/order-list-search.md +13 -20
  64. package/dist/docs/order-list-views.md +11 -17
  65. package/dist/docs/order-list.md +12 -5
  66. package/dist/docs/order-payment.md +9 -7
  67. package/dist/docs/order-placed-date.md +1 -1
  68. package/dist/docs/order-placed-payment-summary.md +28 -15
  69. package/dist/docs/order-placed.md +49 -14
  70. package/dist/docs/order-progress.md +1 -1
  71. package/dist/docs/order-status-badge.md +20 -9
  72. package/dist/docs/order-summary.md +2 -2
  73. package/dist/docs/order-tracking-link.md +58 -0
  74. package/dist/docs/payment-method-badges.md +30 -4
  75. package/dist/docs/payment-methods.md +1 -1
  76. package/dist/docs/payment.md +36 -17
  77. package/dist/docs/phone-field.md +4 -4
  78. package/dist/docs/place-order.md +84 -36
  79. package/dist/docs/postal-code-field.md +3 -1
  80. package/dist/docs/pricing.md +21 -23
  81. package/dist/docs/product-gallery.md +19 -20
  82. package/dist/docs/product-information.md +13 -9
  83. package/dist/docs/product-list.md +7 -6
  84. package/dist/docs/product-shelf.md +0 -1
  85. package/dist/docs/promotion.md +4 -2
  86. package/dist/docs/region.md +23 -15
  87. package/dist/docs/save-card.md +7 -6
  88. package/dist/docs/saved-cards.md +65 -36
  89. package/dist/docs/shipping-address.md +57 -21
  90. package/dist/docs/shipping-simulator.md +53 -15
  91. package/dist/docs/sign-in-disclosure.md +176 -0
  92. package/dist/docs/sign-in-form.md +78 -47
  93. package/dist/docs/sign-in-redirect.md +4 -2
  94. package/dist/docs/sign-in.md +173 -0
  95. package/dist/docs/toast.md +15 -4
  96. package/dist/docs/variant-selector.md +15 -11
  97. package/dist/domain-logic/dist/checkout/rules.js +33 -0
  98. package/dist/domain-logic/dist/checkout/rules.js.map +1 -0
  99. package/dist/graphql/types.d.ts +4 -14
  100. package/dist/index.d.ts +2 -2
  101. package/dist/internal/client.d.ts +1 -3
  102. package/dist/internal/client.js +1 -1
  103. package/dist/internal/server.d.ts +7 -4
  104. package/dist/internal/server.js +7 -4
  105. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
  106. package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
  107. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  108. package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
  109. package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
  110. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
  111. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
  112. package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
  113. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
  114. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
  115. package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
  116. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
  117. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
  118. package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
  119. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
  120. package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
  121. package/dist/matter/account-address-book/account-address-book.js +74 -33
  122. package/dist/matter/account-address-book/account-address-book.js.map +1 -1
  123. package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
  124. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
  125. package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
  126. package/dist/matter/account-address-book/account-address-country.js +83 -49
  127. package/dist/matter/account-address-book/account-address-country.js.map +1 -1
  128. package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
  129. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
  130. package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
  131. package/dist/matter/account-address-book/account-address-form.js +518 -155
  132. package/dist/matter/account-address-book/account-address-form.js.map +1 -1
  133. package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
  134. package/dist/matter/account-address-book/account-address-record.js +32 -17
  135. package/dist/matter/account-address-book/account-address-record.js.map +1 -1
  136. package/dist/matter/account-menu/account-menu.d.ts +34 -17
  137. package/dist/matter/account-menu/account-menu.js +46 -54
  138. package/dist/matter/account-menu/account-menu.js.map +1 -1
  139. package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
  140. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +108 -28
  141. package/dist/matter/account-saved-cards/account-saved-cards.js +177 -122
  142. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -1
  143. package/dist/matter/billing-address/billing-address.d.ts +156 -74
  144. package/dist/matter/billing-address/billing-address.js +227 -156
  145. package/dist/matter/billing-address/billing-address.js.map +1 -1
  146. package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
  147. package/dist/matter/breadcrumb/breadcrumb.js +24 -9
  148. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  149. package/dist/matter/buy-button/buy-button.d.ts +8 -11
  150. package/dist/matter/buy-button/buy-button.js +10 -19
  151. package/dist/matter/buy-button/buy-button.js.map +1 -1
  152. package/dist/matter/card-entry/card-capture.js +12 -4
  153. package/dist/matter/card-entry/card-capture.js.map +1 -1
  154. package/dist/matter/card-entry/card-entry.d.ts +123 -32
  155. package/dist/matter/card-entry/card-entry.js +348 -221
  156. package/dist/matter/card-entry/card-entry.js.map +1 -1
  157. package/dist/matter/cart/cart-namespace.d.ts +7 -1
  158. package/dist/matter/cart/cart-namespace.js +7 -1
  159. package/dist/matter/cart/cart-namespace.js.map +1 -1
  160. package/dist/matter/cart/cart.d.ts +402 -61
  161. package/dist/matter/cart/cart.js +624 -153
  162. package/dist/matter/cart/cart.js.map +1 -1
  163. package/dist/matter/cart-destination/cart-destination.d.ts +30 -19
  164. package/dist/matter/cart-destination/cart-destination.js +160 -70
  165. package/dist/matter/cart-destination/cart-destination.js.map +1 -1
  166. package/dist/matter/cart-item/cart-item.d.ts +144 -17
  167. package/dist/matter/cart-item/cart-item.js +166 -49
  168. package/dist/matter/cart-item/cart-item.js.map +1 -1
  169. package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
  170. package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
  171. package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
  172. package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
  173. package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
  174. package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
  175. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
  176. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
  177. package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
  178. package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
  179. package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
  180. package/dist/matter/cart-totalizer/cart-totalizer.js +46 -17
  181. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  182. package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
  183. package/dist/matter/challenge-return/challenge-return.js +241 -0
  184. package/dist/matter/challenge-return/challenge-return.js.map +1 -0
  185. package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
  186. package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
  187. package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
  188. package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
  189. package/dist/matter/client-preferences/client-preferences.js +84 -15
  190. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  191. package/dist/matter/client-profile/client-profile.d.ts +44 -9
  192. package/dist/matter/client-profile/client-profile.js +64 -24
  193. package/dist/matter/client-profile/client-profile.js.map +1 -1
  194. package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
  195. package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
  196. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  197. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
  198. package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
  199. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
  200. package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
  201. package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
  202. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
  203. package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
  204. package/dist/matter/delivery-options/delivery-options.js +75 -12
  205. package/dist/matter/delivery-options/delivery-options.js.map +1 -1
  206. package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
  207. package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
  208. package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
  209. package/dist/matter/email-identification/email-identification.d.ts +25 -3
  210. package/dist/matter/email-identification/email-identification.js +49 -12
  211. package/dist/matter/email-identification/email-identification.js.map +1 -1
  212. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +79 -7
  213. package/dist/matter/free-shipping-progress/free-shipping-progress.js +77 -20
  214. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  215. package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
  216. package/dist/matter/identity-edit/identity-edit.js +47 -19
  217. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  218. package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
  219. package/dist/matter/identity-summary/identity-summary.js +95 -45
  220. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  221. package/dist/matter/installments/installments-select.d.ts +98 -16
  222. package/dist/matter/installments/installments-select.js +156 -48
  223. package/dist/matter/installments/installments-select.js.map +1 -1
  224. package/dist/matter/installments/installments.d.ts +96 -16
  225. package/dist/matter/installments/installments.js +115 -40
  226. package/dist/matter/installments/installments.js.map +1 -1
  227. package/dist/matter/installments/use-installments-selection.d.ts +1 -0
  228. package/dist/matter/installments/use-installments-selection.js +8 -3
  229. package/dist/matter/installments/use-installments-selection.js.map +1 -1
  230. package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
  231. package/dist/matter/my-account-profile/my-account-profile.js +370 -174
  232. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  233. package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
  234. package/dist/matter/order-cancel/order-cancel.js +118 -51
  235. package/dist/matter/order-cancel/order-cancel.js.map +1 -1
  236. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
  237. package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
  238. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
  239. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
  240. package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
  241. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
  242. package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
  243. package/dist/matter/order-details-header/order-details-header.js +66 -58
  244. package/dist/matter/order-details-header/order-details-header.js.map +1 -1
  245. package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
  246. package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
  247. package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
  248. package/dist/matter/order-list/order-list.d.ts +164 -19
  249. package/dist/matter/order-list/order-list.js +229 -87
  250. package/dist/matter/order-list/order-list.js.map +1 -1
  251. package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
  252. package/dist/matter/order-list-row/order-list-row.js +3 -2
  253. package/dist/matter/order-list-row/order-list-row.js.map +1 -1
  254. package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
  255. package/dist/matter/order-list-search/order-list-search.js +30 -69
  256. package/dist/matter/order-list-search/order-list-search.js.map +1 -1
  257. package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
  258. package/dist/matter/order-list-views/order-list-views.js +22 -68
  259. package/dist/matter/order-list-views/order-list-views.js.map +1 -1
  260. package/dist/matter/order-payment/order-payment.d.ts +33 -10
  261. package/dist/matter/order-payment/order-payment.js +44 -39
  262. package/dist/matter/order-payment/order-payment.js.map +1 -1
  263. package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
  264. package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
  265. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
  266. package/dist/matter/order-placed/order-placed.d.ts +198 -31
  267. package/dist/matter/order-placed/order-placed.js +230 -139
  268. package/dist/matter/order-placed/order-placed.js.map +1 -1
  269. package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
  270. package/dist/matter/order-placed-date/order-placed-date.js +7 -8
  271. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
  272. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
  273. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
  274. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  275. package/dist/matter/order-progress/order-progress.d.ts +19 -8
  276. package/dist/matter/order-progress/order-progress.js +37 -45
  277. package/dist/matter/order-progress/order-progress.js.map +1 -1
  278. package/dist/matter/order-summary/order-summary.d.ts +19 -9
  279. package/dist/matter/order-summary/order-summary.js +38 -44
  280. package/dist/matter/order-summary/order-summary.js.map +1 -1
  281. package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
  282. package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
  283. package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
  284. package/dist/matter/payment/payment-card-capture.js +17 -10
  285. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  286. package/dist/matter/payment/payment-controller.d.ts +4 -2
  287. package/dist/matter/payment/payment-controller.js +30 -9
  288. package/dist/matter/payment/payment-controller.js.map +1 -1
  289. package/dist/matter/payment/payment-method-badges.js +1 -1
  290. package/dist/matter/payment/payment.d.ts +69 -19
  291. package/dist/matter/payment/payment.js +101 -35
  292. package/dist/matter/payment/payment.js.map +1 -1
  293. package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
  294. package/dist/matter/payment/use-payment-method-selection.js +94 -32
  295. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  296. package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
  297. package/dist/matter/payment/use-payment-submit-gate.js +47 -8
  298. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  299. package/dist/matter/place-order/place-order.d.ts +171 -57
  300. package/dist/matter/place-order/place-order.js +376 -185
  301. package/dist/matter/place-order/place-order.js.map +1 -1
  302. package/dist/matter/pricing/pricing.d.ts +152 -13
  303. package/dist/matter/pricing/pricing.js +153 -52
  304. package/dist/matter/pricing/pricing.js.map +1 -1
  305. package/dist/matter/product-information/product-information.d.ts +27 -4
  306. package/dist/matter/product-information/product-information.js +32 -15
  307. package/dist/matter/product-information/product-information.js.map +1 -1
  308. package/dist/matter/product-list/product-list.d.ts +24 -6
  309. package/dist/matter/product-list/product-list.js +32 -26
  310. package/dist/matter/product-list/product-list.js.map +1 -1
  311. package/dist/matter/product-shelf/product-shelf.d.ts +1 -3
  312. package/dist/matter/product-shelf/product-shelf.js +2 -15
  313. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  314. package/dist/matter/region/region.d.ts +33 -16
  315. package/dist/matter/region/region.js +59 -52
  316. package/dist/matter/region/region.js.map +1 -1
  317. package/dist/matter/save-card/save-card.d.ts +43 -8
  318. package/dist/matter/save-card/save-card.js +61 -23
  319. package/dist/matter/save-card/save-card.js.map +1 -1
  320. package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
  321. package/dist/matter/saved-cards/saved-cards.js +349 -77
  322. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  323. package/dist/matter/shipping-address/address-payload.js +25 -0
  324. package/dist/matter/shipping-address/address-payload.js.map +1 -0
  325. package/dist/matter/shipping-address/country-descriptors.js +71 -71
  326. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  327. package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
  328. package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
  329. package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
  330. package/dist/matter/shipping-address/shipping-address.js +443 -188
  331. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  332. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +250 -24
  333. package/dist/matter/shipping-simulator/shipping-simulator.js +257 -51
  334. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  335. package/dist/matter/sign-in/sign-in.d.ts +108 -0
  336. package/dist/matter/sign-in/sign-in.js +285 -0
  337. package/dist/matter/sign-in/sign-in.js.map +1 -0
  338. package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
  339. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
  340. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
  341. package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
  342. package/dist/matter/sign-in-form/sign-in-form.js +134 -144
  343. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
  344. package/dist/particles/binding-switcher/binding-switcher.d.ts +29 -8
  345. package/dist/particles/binding-switcher/binding-switcher.js +37 -26
  346. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -1
  347. package/dist/particles/card-summary/card-summary.d.ts +38 -8
  348. package/dist/particles/card-summary/card-summary.js +55 -22
  349. package/dist/particles/card-summary/card-summary.js.map +1 -1
  350. package/dist/particles/carousel/carousel.d.ts +99 -11
  351. package/dist/particles/carousel/carousel.js +103 -35
  352. package/dist/particles/carousel/carousel.js.map +1 -1
  353. package/dist/particles/copy-text/copy-text.js +5 -15
  354. package/dist/particles/copy-text/copy-text.js.map +1 -1
  355. package/dist/particles/dialog/dialog.d.ts +14 -6
  356. package/dist/particles/dialog/dialog.js +6 -3
  357. package/dist/particles/dialog/dialog.js.map +1 -1
  358. package/dist/particles/drawer/drawer.js +1 -1
  359. package/dist/particles/drawer/drawer.js.map +1 -1
  360. package/dist/particles/email-field/email-field.d.ts +2 -1
  361. package/dist/particles/email-field/email-field.js +2 -1
  362. package/dist/particles/email-field/email-field.js.map +1 -1
  363. package/dist/particles/footer-link-group/footer-link-group.js +1 -0
  364. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  365. package/dist/particles/form/form.d.ts +85 -13
  366. package/dist/particles/form/form.js +91 -42
  367. package/dist/particles/form/form.js.map +1 -1
  368. package/dist/particles/gallery/gallery.d.ts +129 -12
  369. package/dist/particles/gallery/gallery.js +121 -34
  370. package/dist/particles/gallery/gallery.js.map +1 -1
  371. package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
  372. package/dist/particles/order-details-back/order-details-back.js +8 -10
  373. package/dist/particles/order-details-back/order-details-back.js.map +1 -1
  374. package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
  375. package/dist/particles/order-status-badge/order-status-badge.js +4 -20
  376. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
  377. package/dist/particles/password-field/password-field.d.ts +1 -1
  378. package/dist/particles/password-field/password-field.js +2 -4
  379. package/dist/particles/password-field/password-field.js.map +1 -1
  380. package/dist/particles/phone-field/phone-field.d.ts +4 -4
  381. package/dist/particles/phone-field/phone-field.js +8 -11
  382. package/dist/particles/phone-field/phone-field.js.map +1 -1
  383. package/dist/particles/spinner/spinner.d.ts +24 -4
  384. package/dist/particles/spinner/spinner.js +25 -9
  385. package/dist/particles/spinner/spinner.js.map +1 -1
  386. package/dist/particles/switch/switch.d.ts +4 -1
  387. package/dist/particles/switch/switch.js +3 -1
  388. package/dist/particles/switch/switch.js.map +1 -1
  389. package/dist/particles/toast/toast.d.ts +29 -3
  390. package/dist/particles/toast/toast.js +34 -10
  391. package/dist/particles/toast/toast.js.map +1 -1
  392. package/dist/schema.graphql +164 -56
  393. package/dist/sdk/address/address-fields.js +4 -4
  394. package/dist/sdk/address/address-fields.js.map +1 -1
  395. package/dist/sdk/address/constants.js +1 -6
  396. package/dist/sdk/address/constants.js.map +1 -1
  397. package/dist/sdk/address/messages.js +44 -44
  398. package/dist/sdk/address/messages.js.map +1 -1
  399. package/dist/sdk/address/postal-code.js +15 -2
  400. package/dist/sdk/address/postal-code.js.map +1 -1
  401. package/dist/sdk/address/types.d.ts +5 -3
  402. package/dist/sdk/address/validate-address.js +3 -3
  403. package/dist/sdk/address/validate-address.js.map +1 -1
  404. package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
  405. package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
  406. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  407. package/dist/sdk/data/index.js +2 -2
  408. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  409. package/dist/sdk/generated/gql.js +1 -1
  410. package/dist/sdk/generated/gql.js.map +1 -1
  411. package/dist/sdk/generated/graphql.d.ts +20 -5
  412. package/dist/sdk/generated/graphql.js +6 -0
  413. package/dist/sdk/generated/graphql.js.map +1 -1
  414. package/dist/sdk/i18n/format-error-code.js +23 -0
  415. package/dist/sdk/i18n/format-error-code.js.map +1 -0
  416. package/dist/sdk/i18n/message-formatter.d.ts +22 -0
  417. package/dist/sdk/i18n/message-formatter.js +140 -0
  418. package/dist/sdk/i18n/message-formatter.js.map +1 -0
  419. package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
  420. package/dist/sdk/i18n/use-message-formatter.js +18 -0
  421. package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
  422. package/dist/sdk/identity/use-identity-actions.js.map +1 -1
  423. package/dist/sdk/navigation/redirect.d.ts +2 -0
  424. package/dist/sdk/navigation/redirect.js +19 -1
  425. package/dist/sdk/navigation/redirect.js.map +1 -1
  426. package/dist/sdk/navigation/types.d.ts +13 -0
  427. package/dist/sdk/payment/bin-format.js +21 -0
  428. package/dist/sdk/payment/bin-format.js.map +1 -0
  429. package/dist/sdk/payment/challenge-return.js +37 -0
  430. package/dist/sdk/payment/challenge-return.js.map +1 -0
  431. package/dist/sdk/payment/confirmation-last-four.js +39 -0
  432. package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
  433. package/dist/sdk/payment/gateway.d.ts +1 -1
  434. package/dist/sdk/payment/gateway.js +8 -2
  435. package/dist/sdk/payment/gateway.js.map +1 -1
  436. package/dist/sdk/payment/operations.d.ts +1 -0
  437. package/dist/sdk/payment/operations.js +28 -6
  438. package/dist/sdk/payment/operations.js.map +1 -1
  439. package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
  440. package/dist/sdk/payment/resumed-purchase.js +119 -0
  441. package/dist/sdk/payment/resumed-purchase.js.map +1 -0
  442. package/dist/sdk/payment/security-code-mask.js +16 -23
  443. package/dist/sdk/payment/security-code-mask.js.map +1 -1
  444. package/dist/sdk/payment/submission-registry.js +6 -2
  445. package/dist/sdk/payment/submission-registry.js.map +1 -1
  446. package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
  447. package/dist/sdk/payment/use-payment-actions.js +23 -4
  448. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  449. package/dist/sdk/payment/use-place-order.d.ts +10 -2
  450. package/dist/sdk/payment/use-place-order.js +138 -76
  451. package/dist/sdk/payment/use-place-order.js.map +1 -1
  452. package/dist/sdk/provider/storefront-provider.d.ts +1 -7
  453. package/dist/sdk/provider/storefront-provider.js +4 -11
  454. package/dist/sdk/provider/storefront-provider.js.map +1 -1
  455. package/dist/sdk/seo/entity-landing.d.ts +24 -0
  456. package/dist/sdk/seo/entity-landing.js +30 -0
  457. package/dist/sdk/seo/entity-landing.js.map +1 -0
  458. package/dist/sdk/seo/page-alternates.d.ts +3 -2
  459. package/dist/sdk/seo/page-alternates.js +4 -2
  460. package/dist/sdk/seo/page-alternates.js.map +1 -1
  461. package/dist/sdk/seo/search-landing.d.ts +42 -0
  462. package/dist/sdk/seo/search-landing.js +85 -0
  463. package/dist/sdk/seo/search-landing.js.map +1 -0
  464. package/dist/sdk/session/mock-session.d.ts +9 -0
  465. package/dist/sdk/session/mock-session.js +31 -0
  466. package/dist/sdk/session/mock-session.js.map +1 -0
  467. package/dist/sdk/session/read-server-session.d.ts +3 -0
  468. package/dist/sdk/session/read-server-session.js +5 -0
  469. package/dist/sdk/session/read-server-session.js.map +1 -1
  470. package/dist/sdk/session/return-path-segment.d.ts +10 -0
  471. package/dist/sdk/session/return-path-segment.js +15 -0
  472. package/dist/sdk/session/return-path-segment.js.map +1 -0
  473. package/dist/sdk/session/use-session-actions.js.map +1 -1
  474. package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
  475. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
  476. package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
  477. package/dist/utils/safe-href.d.ts +2 -0
  478. package/package.json +4 -3
  479. package/skills/storefront-asset/SKILL.md +2 -2
  480. package/skills/storefront-asset/references/api-side.md +27 -14
  481. package/skills/storefront-asset/references/findings.md +5 -2
  482. package/src/styles/tailwind.css +8 -0
  483. package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
  484. package/dist/message-locales.json +0 -7
  485. package/dist/sdk/i18n/client.d.ts +0 -4
  486. package/dist/sdk/i18n/client.js +0 -4
  487. package/dist/sdk/i18n/locales.d.ts +0 -8
  488. package/dist/sdk/i18n/locales.js +0 -57
  489. package/dist/sdk/i18n/locales.js.map +0 -1
  490. package/dist/sdk/i18n/messages/en-US.js +0 -183
  491. package/dist/sdk/i18n/messages/en-US.js.map +0 -1
  492. package/dist/sdk/i18n/messages/en-US.json +0 -178
  493. package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -182
  494. package/dist/sdk/i18n/messages/es-ES.js +0 -183
  495. package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
  496. package/dist/sdk/i18n/messages/es-ES.json +0 -178
  497. package/dist/sdk/i18n/messages/pt-BR.js +0 -183
  498. package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
  499. package/dist/sdk/i18n/messages/pt-BR.json +0 -178
  500. package/dist/sdk/i18n/provider.d.ts +0 -1
  501. package/dist/sdk/i18n/provider.js +0 -30
  502. package/dist/sdk/i18n/provider.js.map +0 -1
  503. package/dist/sdk/i18n/server.d.ts +0 -28
  504. package/dist/sdk/i18n/server.js +0 -59
  505. package/dist/sdk/i18n/server.js.map +0 -1
  506. package/dist/utils/resolve-authored-copy.js +0 -18
  507. package/dist/utils/resolve-authored-copy.js.map +0 -1
  508. package/dist/utils/substitute-template.js +0 -33
  509. package/dist/utils/substitute-template.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"account-saved-cards.js","names":[],"sources":["../../../src/matter/account-saved-cards/account-saved-cards.tsx"],"sourcesContent":["'use client';\n\nimport type { ErrorLike } from '@apollo/client';\nimport { CombinedGraphQLErrors } from '@apollo/client/errors';\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport {\n type ComponentPropsWithRef,\n cloneElement,\n createContext,\n isValidElement,\n type MouseEvent,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n AlertDialogBackdrop,\n AlertDialogClose,\n AlertDialogDescription,\n AlertDialogPopup,\n AlertDialogPortal,\n AlertDialogRoot,\n AlertDialogTitle,\n AlertDialogTrigger,\n AlertDialogViewport,\n} from '../../particles/alert-dialog/alert-dialog.js';\nimport { CardSummary, CardSummaryRoot, useCardSummary } from '../../particles/card-summary/card-summary.js';\nimport { NavigationLink } from '../../particles/navigation-link/navigation-link.js';\nimport { ActionsOverrideContext, useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { ListItemRefContext } from '../../sdk/data/list-item-ref-context.js';\nimport { ReactiveRootContext } from '../../sdk/data/page-reactive-data-root.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport type { CustomerSavedCardStatus } from '../../sdk/generated/graphql.js';\nimport { useIntl } from '../../sdk/i18n/client.js';\nimport { useStorefrontRoute } from '../../sdk/navigation/use-storefront-route.js';\nimport { resolveAuthoredCopy } from '../../utils/resolve-authored-copy.js';\nimport { signInTarget } from '../../utils/safe-href.js';\nimport { useSession } from '../session/session.js';\n\n/**\n * The signed-in shopper's saved cards in the account.\n * The Root reads card ids only; each AccountSavedCardItem subscribes to its own CustomerSavedCard\n * (ADR-0012) and provides `card-summary` and the row itself, so the schema arranges the CardSummary\n * parts and AccountSavedCardExpiry in the row.\n * Every text resolves children, then the CMS entry, then the `fs/saved-cards.*` catalog; the expiry\n * line, repeated per row, takes no children.\n * Removal state lives in the Root, because a successful removal unmounts the row it started from. The\n * Root also declares the `savedCard.remove` write, so a remove control rendered by a default, which the\n * compiler cannot wrap, still reaches the provider.\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL fragments\n// ---------------------------------------------------------------------------\n\nconst fragment = graphql(`\n fragment AccountSavedCardsData on Query {\n customerSavedCards {\n __typename\n id\n cards {\n __typename\n id\n }\n }\n }\n`);\n\nconst itemFragment = graphql(`\n fragment AccountSavedCardItemData on Query {\n customerSavedCards {\n cards {\n __typename\n id\n network {\n name\n }\n lastDigits\n expiry {\n month\n year\n }\n status\n }\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Content models — optional and default-free, so an unauthored field falls through to the catalog\n// ---------------------------------------------------------------------------\n\nexport const AccountSavedCardsHeadingContent = defineContentType({\n id: 'account-saved-cards-heading',\n title: 'Account Saved Cards Heading',\n description: \"Heading of the account's saved-cards section.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Heading' },\n },\n },\n});\n\nexport const AccountSavedCardsEmptyContent = defineContentType({\n id: 'account-saved-cards-empty',\n title: 'Account Saved Cards Empty',\n description: 'Statement shown when the shopper has no saved cards.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Empty statement' },\n },\n },\n});\n\nexport const AccountSavedCardsLoadingContent = defineContentType({\n id: 'account-saved-cards-loading',\n title: 'Account Saved Cards Loading',\n description: 'Announcement read to assistive technology while the saved cards load.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Loading announcement' },\n },\n },\n});\n\nexport const AccountSavedCardsErrorContent = defineContentType({\n id: 'account-saved-cards-error',\n title: 'Account Saved Cards Error',\n description: 'Messages shown when the saved cards cannot be read.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Load failure message' },\n sessionExpiredText: { type: 'string', minLength: 1, title: 'Session expired message' },\n signInLabel: { type: 'string', minLength: 1, title: 'Sign-in link label' },\n },\n },\n});\n\nexport const AccountSavedCardExpiryContent = defineContentType({\n id: 'account-saved-card-expiry',\n title: 'Account Saved Card Expiry',\n description: \"A saved card's expiry line. The date follows the label and is never authored.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n expiresLabel: { type: 'string', minLength: 1, title: \"Label before a working card's date\" },\n expiredLabel: { type: 'string', minLength: 1, title: \"Label before an expired card's date\" },\n expiredText: { type: 'string', minLength: 1, title: 'Expired card with no date' },\n unusableText: { type: 'string', minLength: 1, title: 'Unusable card' },\n },\n },\n});\n\nexport const AccountSavedCardRemoveTriggerContent = defineContentType({\n id: 'account-saved-card-remove-trigger',\n title: 'Account Saved Card Remove Trigger',\n description: \"Label of the control that opens a saved card's removal prompt.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Trigger label' },\n },\n },\n});\n\nexport const AccountSavedCardRemoveTitleContent = defineContentType({\n id: 'account-saved-card-remove-title',\n title: 'Account Saved Card Remove Title',\n description: 'Question that titles the removal prompt.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Prompt title' },\n },\n },\n});\n\nexport const AccountSavedCardRemoveDescriptionContent = defineContentType({\n id: 'account-saved-card-remove-description',\n title: 'Account Saved Card Remove Description',\n description: 'What removing the card means, shown after the card in the removal prompt.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Consequence' },\n },\n },\n});\n\nexport const AccountSavedCardRemoveCancelContent = defineContentType({\n id: 'account-saved-card-remove-cancel',\n title: 'Account Saved Card Remove Cancel',\n description: 'Label of the control that keeps the card.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Cancel label' },\n },\n },\n});\n\nexport const AccountSavedCardRemoveConfirmContent = defineContentType({\n id: 'account-saved-card-remove-confirm',\n title: 'Account Saved Card Remove Confirm',\n description: 'Label of the control that removes the card, and its label while the removal runs.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Confirm label' },\n pendingText: { type: 'string', minLength: 1, title: 'Label while removing' },\n },\n },\n});\n\nexport const AccountSavedCardsRemoveFeedbackContent = defineContentType({\n id: 'account-saved-cards-remove-feedback',\n title: 'Account Saved Cards Remove Feedback',\n description: 'Messages that tell the shopper how a card removal ended.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n successText: { type: 'string', minLength: 1, title: 'Card removed' },\n failureText: { type: 'string', minLength: 1, title: 'Card not removed' },\n sessionExpiredText: { type: 'string', minLength: 1, title: 'Session expired message' },\n signInLabel: { type: 'string', minLength: 1, title: 'Sign-in link label' },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** The unwrapped `customerSavedCards` entity the reactive runtime delivers to the Root. */\nexport type AccountSavedCardsData = {\n id?: string | null;\n cards?: ReadonlyArray<{ id: string }> | null;\n} | null;\n\n/** One card's slice, delivered per row by the reactive-list-item runtime. */\nexport type AccountSavedCardItemData = {\n id: string;\n network: { name: string };\n lastDigits: string;\n expiry?: { month: number; year: number } | null;\n status: CustomerSavedCardStatus;\n} | null;\n\n/** The row a resolved AccountSavedCardItem provides to the parts inside it. */\nexport type AccountSavedCardContextValue = NonNullable<AccountSavedCardItemData>;\n\n/** `idle` is a null slice with no query in flight, such as a render with no reactive root. */\nexport type AccountSavedCardsState = 'idle' | 'loading' | 'error' | 'empty' | 'ready';\n\nexport type AccountSavedCardRemovalOutcome = Readonly<{ kind: 'removed' }> | Readonly<{ kind: 'failed'; code: string }>;\n\nexport type AccountSavedCardsRemoval = Readonly<{\n /** Card id of the removal in flight, or null. At most one per section. */\n pendingId: string | null;\n /** The last removal's outcome, or null before any and after begin(). */\n outcome: AccountSavedCardRemovalOutcome | null;\n /** Starts a removal. False, with no state change, while another is pending. */\n begin: (id: string) => boolean;\n /** Ends the pending removal with the action's userErrors (empty on success). */\n settle: (id: string, userErrors: readonly { code: string }[]) => void;\n}>;\n\nexport type AccountSavedCardsContextValue = Readonly<{\n state: AccountSavedCardsState;\n cards: ReadonlyArray<{ id: string }>;\n /** `extensions.code` of the read's error, or `null`. Set only in the `error` state. */\n errorCode: string | null;\n removal: AccountSavedCardsRemoval;\n}>;\n\nexport type AccountSavedCardsRootProps = ComponentPropsWithRef<'div'> & {\n $data?: AccountSavedCardsData;\n /** Injected by the compiler from `actions: { savedCard: ['remove'] }`, for every remove control inside. */\n $actions?: ComponentActions;\n};\n\nexport type AccountSavedCardsHeadingLevel = 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport type AccountSavedCardsHeadingProps = ComponentPropsWithRef<'h2'> & {\n /** Heading level. `h1` is excluded: the page title belongs to the page shell. Defaults to `h2`. */\n as?: AccountSavedCardsHeadingLevel;\n $content?: ContentValue<typeof AccountSavedCardsHeadingContent>;\n};\n\nexport type AccountSavedCardsListProps = ComponentPropsWithRef<'ul'> & {\n /** The per-row template, typically one AccountSavedCardItem. */\n children?: ReactNode;\n};\n\nexport type AccountSavedCardItemProps = ComponentPropsWithRef<'li'> & {\n /** Per-row slice from the reactive-list-item runtime; passed directly in tests. */\n $data?: AccountSavedCardItemData;\n};\n\nexport type AccountSavedCardExpiryProps = Omit<ComponentPropsWithRef<'p'>, 'children'> & {\n $content?: ContentValue<typeof AccountSavedCardExpiryContent>;\n};\n\nexport type AccountSavedCardsEmptyProps = ComponentPropsWithRef<'p'> & {\n $content?: ContentValue<typeof AccountSavedCardsEmptyContent>;\n};\n\nexport type AccountSavedCardsLoadingProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {\n /** Placeholder rows shown while the cards load. Defaults to 2. */\n skeletonCount?: number;\n $content?: ContentValue<typeof AccountSavedCardsLoadingContent>;\n};\n\nexport type AccountSavedCardsErrorProps = ComponentPropsWithRef<'div'> & {\n /** Replaces the message for every error code and drops the sign-in link. */\n children?: ReactNode;\n $content?: ContentValue<typeof AccountSavedCardsErrorContent>;\n};\n\n/** The remove controller a row's prompt parts read. */\nexport type AccountSavedCardRemoveValue = Readonly<{\n id: string;\n /** This card's removal is pending. */\n pending: boolean;\n /** Any removal in the section is pending. */\n blocked: boolean;\n close: () => void;\n}>;\n\nexport type AccountSavedCardRemoveProps = {\n /** One AlertDialogRoot to control, or none for the default prompt. */\n children?: ReactNode;\n};\n\nexport type AccountSavedCardRemoveTriggerProps = ComponentPropsWithRef<'button'> & {\n $content?: ContentValue<typeof AccountSavedCardRemoveTriggerContent>;\n};\n\nexport type AccountSavedCardRemoveTitleProps = ComponentPropsWithRef<'h2'> & {\n $content?: ContentValue<typeof AccountSavedCardRemoveTitleContent>;\n};\n\nexport type AccountSavedCardRemoveDescriptionProps = ComponentPropsWithRef<'p'> & {\n $content?: ContentValue<typeof AccountSavedCardRemoveDescriptionContent>;\n};\n\nexport type AccountSavedCardRemoveCancelProps = ComponentPropsWithRef<'button'> & {\n $content?: ContentValue<typeof AccountSavedCardRemoveCancelContent>;\n};\n\nexport type AccountSavedCardRemoveConfirmProps = ComponentPropsWithRef<'button'> & {\n $content?: ContentValue<typeof AccountSavedCardRemoveConfirmContent>;\n};\n\nexport type AccountSavedCardsRemoveFeedbackProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {\n $content?: ContentValue<typeof AccountSavedCardsRemoveFeedbackContent>;\n};\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nconst AccountSavedCardsContext = createContext<AccountSavedCardsContextValue | null>(null);\n\n/** The section state the nearest AccountSavedCardsRoot publishes. Throws outside one. */\nexport function useAccountSavedCards(): AccountSavedCardsContextValue {\n const ctx = useContext(AccountSavedCardsContext);\n if (!ctx) throw new Error('AccountSavedCards parts must be used inside AccountSavedCardsRoot.');\n return ctx;\n}\n\nconst AccountSavedCardContext = createContext<AccountSavedCardContextValue | null>(null);\n\n/** The card the nearest AccountSavedCardItem provides. Throws outside one. */\nexport function useAccountSavedCard(): AccountSavedCardContextValue {\n const ctx = useContext(AccountSavedCardContext);\n if (!ctx) throw new Error('AccountSavedCard parts must be used inside AccountSavedCardItem.');\n return ctx;\n}\n\nconst AccountSavedCardRemoveContext = createContext<AccountSavedCardRemoveValue | null>(null);\n\n/** The remove controller the nearest AccountSavedCardRemove provides. Throws outside one. */\nexport function useAccountSavedCardRemove(): AccountSavedCardRemoveValue {\n const ctx = useContext(AccountSavedCardRemoveContext);\n if (!ctx) throw new Error('AccountSavedCardRemove parts must be used inside AccountSavedCardRemove.');\n return ctx;\n}\n\ntype SavedCardState = 'usable' | 'expired' | 'unusable';\n\n/** Only an explicit USABLE reads as usable, so a status this client does not know never looks usable. */\nfunction savedCardState(status: string): SavedCardState {\n if (status === 'USABLE') return 'usable';\n if (status === 'EXPIRED') return 'expired';\n return 'unusable';\n}\n\nfunction validExpiry(expiry: AccountSavedCardContextValue['expiry']): { month: number; year: number } | null {\n if (!expiry) return null;\n const { month, year } = expiry;\n if (!Number.isInteger(month) || month < 1 || month > 12) return null;\n if (!Number.isInteger(year) || year < 1000 || year > 9999) return null;\n return { month, year };\n}\n\nconst EMPTY_CARDS: ReadonlyArray<{ id: string }> = Object.freeze([]);\n\n/**\n * The read's own error code. The root error is page-wide, so an error whose path names another field\n * does not count; with no path at all, the first code stands.\n */\nfunction readErrorCode(error: ErrorLike): string | null {\n if (!CombinedGraphQLErrors.is(error)) return null;\n const own =\n error.errors.find((entry) => entry.path?.[0] === 'customerSavedCards') ??\n error.errors.find((entry) => entry.path == null);\n const code = own?.extensions?.code;\n return typeof code === 'string' ? code : null;\n}\n\n/**\n * One state for the whole section. A null slice plus an error is a failed read; an error beside a\n * resolved slice belongs to another field of the page query and changes nothing here.\n */\nfunction resolveSectionState(\n data: AccountSavedCardsData,\n loading: boolean,\n error: ErrorLike | undefined,\n): Omit<AccountSavedCardsContextValue, 'removal'> {\n if (data == null) {\n if (error) return { state: 'error', cards: EMPTY_CARDS, errorCode: readErrorCode(error) };\n return { state: loading ? 'loading' : 'idle', cards: EMPTY_CARDS, errorCode: null };\n }\n const cards = data.cards ?? EMPTY_CARDS;\n return { state: cards.length === 0 ? 'empty' : 'ready', cards, errorCode: null };\n}\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const AccountSavedCardsRootDefinition = defineComponent<AccountSavedCardsRootProps>({\n name: 'AccountSavedCardsRoot',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsRoot,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'session',\n providesContext: 'account-saved-cards',\n actions: { savedCard: ['remove'] },\n editor: { label: 'Account Saved Cards Root', category: 'identity' },\n schema: {},\n guideline:\n \"The signed-in shopper's saved cards, read with no cart. Renders nothing unless the session is loggedIn, and no chrome of its own: compose AccountSavedCardsHeading, AccountSavedCardsRemoveFeedback, AccountSavedCardsLoading, AccountSavedCardsError, AccountSavedCardsEmpty, and AccountSavedCardsList (with an AccountSavedCardItem inside) as children. Exactly one of Loading, Error, Empty, or List renders at a time; the state is on data-fs-account-saved-cards-state. It owns the removal state and supplies the savedCard.remove write to every AccountSavedCardRemove inside, placed or default, so the write sits here rather than on the control that dispatches it; with no remove control composed the write is never called. Must be inside a SessionRoot, normally the my-account layout's. See account-saved-cards.md.\",\n});\n\nexport const AccountSavedCardsHeadingDefinition = defineComponent<AccountSavedCardsHeadingProps>({\n name: 'AccountSavedCardsHeading',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsHeading,\n content: AccountSavedCardsHeadingContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Heading', category: 'identity' },\n schema: {\n as: { type: ['h2', 'h3', 'h4', 'h5', 'h6'] as const, default: 'h2', label: 'Heading level' },\n },\n guideline:\n 'The section heading, rendered in every state. `as` sets the level from h2 to h6 (default h2); there is no h1, because the page title belongs to the page shell — pick the level that fits where the section is nested, or omit the heading. Text resolves children, then the CMS entry, then the catalog (fs/saved-cards.heading). Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardsListDefinition = defineComponent<AccountSavedCardsListProps>({\n name: 'AccountSavedCardsList',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsList,\n requiresContext: 'account-saved-cards',\n providesContext: 'account-saved-card',\n editor: { label: 'Account Saved Cards List', category: 'identity' },\n schema: {},\n guideline:\n 'The list of saved cards, one row per card in the platform order, rendered only when the shopper has at least one. Place one AccountSavedCardItem inside as the row template. Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardItemDefinition = defineComponent<AccountSavedCardItemProps>({\n name: 'AccountSavedCardItem',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardItem,\n fragment: itemFragment,\n fetchStrategy: 'reactive-list-item',\n requiresContext: 'account-saved-card',\n providesContext: ['card-summary', 'account-saved-card-data'],\n editor: { label: 'Account Saved Card Item', category: 'identity' },\n schema: {},\n guideline:\n 'One saved card as a list row. It provides the card to the CardSummary parts, AccountSavedCardExpiry, and AccountSavedCardRemove. With no children it renders CardSummary (mark, network name, mask, last four digits), AccountSavedCardExpiry, and AccountSavedCardRemove, whose text is then always the catalog wording; compose them as children to rearrange them or to reword them from the CMS, keep AccountSavedCardExpiry in any custom row, and leave AccountSavedCardRemove out only for a read-only list. An expired row carries data-fs-account-saved-card-expired, an unusable one data-fs-account-saved-card-unusable, and a row whose removal is pending data-fs-account-saved-card-removing, for a swatch to dim. Never shows more than the last four digits. Must be inside AccountSavedCardsList.',\n});\n\nexport const AccountSavedCardExpiryDefinition = defineComponent<AccountSavedCardExpiryProps>({\n name: 'AccountSavedCardExpiry',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardExpiry,\n content: AccountSavedCardExpiryContent,\n requiresContext: 'account-saved-card-data',\n editor: { label: 'Account Saved Card Expiry', category: 'identity' },\n schema: {},\n guideline:\n 'When a saved card expires: \"Expires 05/28\" for a working card, \"Expired 05/24\" (or \"Expired\" with no date) for an expired one, and \"This card can\\'t be used\", with no date, for an unusable one. Renders nothing for a working card with no date. The label comes from the CMS entry, then the catalog (fs/saved-cards.expires, .expired, .expired-no-date, .unusable); the component always places the MM/YY date after it, and only a placed element reads the CMS entry. The state is on data-fs-account-saved-card-expiry-status (usable, expired, unusable). Must be inside AccountSavedCardItem.',\n});\n\nexport const AccountSavedCardsEmptyDefinition = defineComponent<AccountSavedCardsEmptyProps>({\n name: 'AccountSavedCardsEmpty',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsEmpty,\n content: AccountSavedCardsEmptyContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Empty', category: 'identity' },\n schema: {},\n guideline:\n 'States that the shopper has no saved cards. Renders only once the read resolved with none — never while loading or after a failure. Text resolves children, then the CMS entry, then the catalog (fs/saved-cards.empty). Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardsLoadingDefinition = defineComponent<AccountSavedCardsLoadingProps>({\n name: 'AccountSavedCardsLoading',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsLoading,\n content: AccountSavedCardsLoadingContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Loading', category: 'identity' },\n schema: {\n skeletonCount: { type: 'number', default: 2, label: 'Placeholder rows' },\n },\n guideline:\n 'Placeholder rows while the saved cards load, plus one polite live region that announces the wait (CMS entry, then the catalog fs/saved-cards.loading). The rows are hidden from assistive technology; style them through data-fs-account-saved-cards-loading-row. Without this part the section shows no loading look. Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardsErrorDefinition = defineComponent<AccountSavedCardsErrorProps>({\n name: 'AccountSavedCardsError',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsError,\n content: AccountSavedCardsErrorContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Error', category: 'identity' },\n schema: {},\n guideline:\n 'An alert shown when the saved cards cannot be read. An expired session says so and links to sign-in, returning the shopper to this page; any other failure says the cards could not be loaded. The wording comes from the CMS entry, then the catalog (fs/saved-cards.session-expired, .sign-in, .load-failed), never from the server; children replace it for every failure and drop the link. Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardRemoveDefinition = defineComponent<AccountSavedCardRemoveProps>({\n name: 'AccountSavedCardRemove',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemove,\n requiresContext: 'account-saved-card-data',\n providesContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove', category: 'identity' },\n schema: {},\n guideline:\n \"Lets the shopper remove the row's card after confirming. State-only controller: wrap one AlertDialogRoot and it becomes controlled, so never set open or onOpenChange on it. Compose AlertDialogRoot > (AccountSavedCardRemoveTrigger + AlertDialogPortal > (AlertDialogBackdrop + AlertDialogViewport > AlertDialogPopup > (AccountSavedCardRemoveTitle + AccountSavedCardRemoveDescription + AccountSavedCardRemoveCancel + AccountSavedCardRemoveConfirm))), Cancel before Confirm so the safe action takes focus. With no children it renders that prompt with catalog text; compose the parts to reword them from the CMS. The prompt stays open while the removal runs and closes when it fails; on success the row leaves the list. AccountSavedCardsRoot supplies the savedCard.remove write, and the outcome goes unreported unless the section composes AccountSavedCardsRemoveFeedback. Must be inside AccountSavedCardItem.\",\n});\n\nexport const AccountSavedCardRemoveTriggerDefinition = defineComponent<AccountSavedCardRemoveTriggerProps>({\n name: 'AccountSavedCardRemoveTrigger',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveTrigger,\n content: AccountSavedCardRemoveTriggerContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Trigger', category: 'identity' },\n schema: {},\n guideline:\n 'Opens the removal prompt. Its accessible name is its text followed by the card, e.g. \"Remove Visa ending in 1234\"; the card part is visually hidden. Disabled while any removal in the section is pending. Text resolves children, then the CMS entry, then the catalog (fs/saved-cards.remove.trigger). Direct child of the AlertDialogRoot inside AccountSavedCardRemove.',\n});\n\nexport const AccountSavedCardRemoveTitleDefinition = defineComponent<AccountSavedCardRemoveTitleProps>({\n name: 'AccountSavedCardRemoveTitle',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveTitle,\n content: AccountSavedCardRemoveTitleContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Title', category: 'identity' },\n schema: {},\n guideline:\n \"The removal prompt's question and its accessible name. Required inside AlertDialogPopup. Text resolves children, then the CMS entry, then the catalog (fs/saved-cards.remove.title). Must be inside AccountSavedCardRemove.\",\n});\n\nexport const AccountSavedCardRemoveDescriptionDefinition = defineComponent<AccountSavedCardRemoveDescriptionProps>({\n name: 'AccountSavedCardRemoveDescription',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveDescription,\n content: AccountSavedCardRemoveDescriptionContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Description', category: 'identity' },\n schema: {},\n guideline:\n 'Names the card and states the consequence; screen readers announce it with the prompt. With no children it renders CardSummary and then the text, which resolves the CMS entry, then the catalog (fs/saved-cards.remove.description); children replace both, so keep a CardSummary in them for the prompt to name the card. Inside AlertDialogPopup, after AccountSavedCardRemoveTitle. Must be inside AccountSavedCardRemove.',\n});\n\nexport const AccountSavedCardRemoveCancelDefinition = defineComponent<AccountSavedCardRemoveCancelProps>({\n name: 'AccountSavedCardRemoveCancel',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveCancel,\n content: AccountSavedCardRemoveCancelContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Cancel', category: 'identity' },\n schema: {},\n guideline:\n 'Closes the removal prompt and keeps the card. Disabled while the removal runs. Place it before AccountSavedCardRemoveConfirm so it takes focus when the prompt opens. Text resolves children, then the CMS entry, then the catalog (fs/saved-cards.remove.cancel). Must be inside AccountSavedCardRemove.',\n});\n\nexport const AccountSavedCardRemoveConfirmDefinition = defineComponent<AccountSavedCardRemoveConfirmProps>({\n name: 'AccountSavedCardRemoveConfirm',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveConfirm,\n content: AccountSavedCardRemoveConfirmContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Confirm', category: 'identity' },\n schema: {},\n guideline:\n 'Removes the card. It dispatches savedCard.remove through the write AccountSavedCardsRoot supplies and declares none of its own. While the removal runs it is busy and shows its pending text; one removal runs at a time in the section. Text resolves children, then the CMS entry, then the catalog (fs/saved-cards.remove.confirm, .pending). Must be inside AccountSavedCardRemove.',\n});\n\nexport const AccountSavedCardsRemoveFeedbackDefinition = defineComponent<AccountSavedCardsRemoveFeedbackProps>({\n name: 'AccountSavedCardsRemoveFeedback',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsRemoveFeedback,\n content: AccountSavedCardsRemoveFeedbackContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Remove Feedback', category: 'identity' },\n schema: {},\n guideline:\n \"Tells the shopper how a card removal ended: a status message that takes focus when the card was removed, or an alert when it was not, with a sign-in link back to this page when the session expired. Renders in every state of the section, so the message outlives the removed row and an emptied list; it stays until the next removal starts. Without this part a removal's outcome goes unreported. The wording comes from the CMS entry, then the catalog (fs/saved-cards.remove.success, .failed, fs/saved-cards.session-expired, .sign-in), never from the server; the outcome is on data-fs-account-saved-cards-remove-feedback-outcome. Must be inside AccountSavedCardsRoot.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\n/**\n * One removal at a time: each success replaces the whole cached list, so two in flight could land out\n * of order and restore a card the later one removed.\n */\nfunction useRemovalState(): AccountSavedCardsRemoval {\n const [pendingId, setPendingId] = useState<string | null>(null);\n const [outcome, setOutcome] = useState<AccountSavedCardRemovalOutcome | null>(null);\n // Read synchronously, so a second activation in the same tick already sees the first.\n const pendingRef = useRef<string | null>(null);\n\n const begin = useCallback((id: string) => {\n if (pendingRef.current !== null) return false;\n pendingRef.current = id;\n setPendingId(id);\n setOutcome(null);\n return true;\n }, []);\n\n const settle = useCallback((id: string, userErrors: readonly { code: string }[]) => {\n if (pendingRef.current !== id) return;\n pendingRef.current = null;\n setPendingId(null);\n const [first] = userErrors;\n setOutcome(first ? { kind: 'failed', code: first.code } : { kind: 'removed' });\n }, []);\n\n return useMemo(() => ({ pendingId, outcome, begin, settle }), [pendingId, outcome, begin, settle]);\n}\n\nexport function AccountSavedCardsRoot({\n $data: $dataProp,\n $actions: $actionsProp,\n className,\n children,\n ...props\n}: AccountSavedCardsRootProps) {\n // Enforces the SessionRoot ancestor: useSession() throws outside one.\n const { state: sessionState } = useSession();\n const data = useDataOverride<AccountSavedCardsData | undefined>($dataProp) ?? null;\n const $actions = useActionsOverride($actionsProp);\n const { loading, error } = useContext(ReactiveRootContext);\n const section = useMemo(() => resolveSectionState(data, loading, error), [data, loading, error]);\n const removal = useRemovalState();\n const value = useMemo(() => ({ ...section, removal }), [section, removal]);\n\n if (sessionState !== 'loggedIn') return null;\n\n return (\n <AccountSavedCardsContext value={value}>\n <ActionsOverrideContext value={$actions}>\n <div\n {...props}\n className={className}\n data-fs-account-saved-cards=\"\"\n data-fs-account-saved-cards-state={value.state}\n >\n {children}\n </div>\n </ActionsOverrideContext>\n </AccountSavedCardsContext>\n );\n}\n\nexport function AccountSavedCardsHeading({\n as: Tag = 'h2',\n $content,\n className,\n children,\n ...props\n}: AccountSavedCardsHeadingProps) {\n useAccountSavedCards();\n const intl = useIntl();\n return (\n <Tag {...props} className={className} data-fs-account-saved-cards-heading=\"\">\n {children ?? resolveAuthoredCopy($content?.text, intl.formatMessage({ id: 'fs/saved-cards.heading' }))}\n </Tag>\n );\n}\n\nexport function AccountSavedCardsList({ className, children, ...props }: AccountSavedCardsListProps) {\n const { state, cards } = useAccountSavedCards();\n if (state !== 'ready') return null;\n\n return (\n <ul {...props} className={className} data-fs-account-saved-cards-list=\"\">\n {cards.map((card) => (\n // No fallback slice: the Root selects ids only, so an incomplete row renders nothing until\n // its cache entry resolves rather than a partial card.\n <ListItemRefContext\n key={card.id}\n value={{ __typename: 'CustomerSavedCard', id: card.id, fallbackData: undefined }}\n >\n {children}\n </ListItemRefContext>\n ))}\n </ul>\n );\n}\n\nexport function AccountSavedCardItem({ $data: $dataProp, className, children, ...props }: AccountSavedCardItemProps) {\n const card = useDataOverride<AccountSavedCardItemData | undefined>($dataProp) ?? null;\n // Not useAccountSavedCards(): an Item composed without a remove control stays usable outside a Root.\n const pendingId = useContext(AccountSavedCardsContext)?.removal.pendingId ?? null;\n if (!card) return null;\n const state = savedCardState(card.status);\n\n return (\n <AccountSavedCardContext value={card}>\n <li\n {...props}\n className={className}\n data-fs-account-saved-card=\"\"\n {...(state === 'expired' ? { 'data-fs-account-saved-card-expired': '' } : {})}\n {...(state === 'unusable' ? { 'data-fs-account-saved-card-unusable': '' } : {})}\n {...(pendingId === card.id ? { 'data-fs-account-saved-card-removing': '' } : {})}\n >\n <CardSummaryRoot network={card.network.name} lastDigits={card.lastDigits}>\n {children ?? (\n <>\n <CardSummary />\n <AccountSavedCardExpiry />\n <AccountSavedCardRemove />\n </>\n )}\n </CardSummaryRoot>\n </li>\n </AccountSavedCardContext>\n );\n}\n\nexport function AccountSavedCardExpiry({ $content, className, ...props }: AccountSavedCardExpiryProps) {\n const { status, expiry } = useAccountSavedCard();\n const intl = useIntl();\n const state = savedCardState(status);\n const date = state === 'unusable' ? null : validExpiry(expiry);\n if (state === 'usable' && !date) return null;\n\n let label: string;\n if (state === 'unusable') {\n label = resolveAuthoredCopy($content?.unusableText, intl.formatMessage({ id: 'fs/saved-cards.unusable' }));\n } else if (!date) {\n label = resolveAuthoredCopy($content?.expiredText, intl.formatMessage({ id: 'fs/saved-cards.expired-no-date' }));\n } else if (state === 'expired') {\n label = resolveAuthoredCopy($content?.expiredLabel, intl.formatMessage({ id: 'fs/saved-cards.expired' }));\n } else {\n label = resolveAuthoredCopy($content?.expiresLabel, intl.formatMessage({ id: 'fs/saved-cards.expires' }));\n }\n const month = date ? String(date.month).padStart(2, '0') : '';\n\n return (\n <p\n {...props}\n className={className}\n data-fs-account-saved-card-expiry=\"\"\n data-fs-account-saved-card-expiry-status={state}\n >\n <span data-fs-account-saved-card-expiry-label=\"\">{label}</span>\n {date ? (\n <>\n {' '}\n <time data-fs-account-saved-card-expiry-date=\"\" dateTime={`${date.year}-${month}`} aria-hidden=\"true\">\n {`${month}/${String(date.year % 100).padStart(2, '0')}`}\n </time>{' '}\n <span data-fs-sr-only=\"\" className=\"sr-only\">\n {/* UTC on the first of the month, so no time zone moves the date into another month. */}\n {intl.formatDate(Date.UTC(date.year, date.month - 1, 1), {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC',\n })}\n </span>\n </>\n ) : null}\n </p>\n );\n}\n\nexport function AccountSavedCardsEmpty({ $content, className, children, ...props }: AccountSavedCardsEmptyProps) {\n const { state } = useAccountSavedCards();\n const intl = useIntl();\n if (state !== 'empty') return null;\n\n return (\n <p {...props} className={className} data-fs-account-saved-cards-empty=\"\">\n {children ?? resolveAuthoredCopy($content?.text, intl.formatMessage({ id: 'fs/saved-cards.empty' }))}\n </p>\n );\n}\n\nconst DEFAULT_SKELETON_COUNT = 2;\n\nexport function AccountSavedCardsLoading({\n skeletonCount = DEFAULT_SKELETON_COUNT,\n $content,\n className,\n ...props\n}: AccountSavedCardsLoadingProps) {\n const { state } = useAccountSavedCards();\n const intl = useIntl();\n const loading = state === 'loading';\n const label = resolveAuthoredCopy($content?.text, intl.formatMessage({ id: 'fs/saved-cards.loading' }));\n const rows = Number.isFinite(skeletonCount) ? Math.max(1, Math.trunc(skeletonCount)) : DEFAULT_SKELETON_COUNT;\n\n // A live region only announces text written after it mounted, so it stays in the tree and is\n // filled on the pass after loading starts (AccountEntryPoint's pattern).\n const [announcement, setAnnouncement] = useState('');\n const pendingLabel = loading ? label : '';\n useEffect(() => {\n setAnnouncement(pendingLabel);\n }, [pendingLabel]);\n\n return (\n <>\n {loading ? (\n <div {...props} className={className} aria-hidden=\"true\" data-fs-account-saved-cards-loading=\"\">\n {Array.from({ length: rows }, (_, index) => (\n <span key={index} data-fs-account-saved-cards-loading-row=\"\" />\n ))}\n </div>\n ) : null}\n <output aria-live=\"polite\" data-fs-account-saved-cards-loading-announcement=\"\">\n {announcement}\n </output>\n </>\n );\n}\n\nexport function AccountSavedCardsError({ $content, className, children, ...props }: AccountSavedCardsErrorProps) {\n const { state, errorCode } = useAccountSavedCards();\n const intl = useIntl();\n const { path } = useStorefrontRoute();\n if (state !== 'error') return null;\n\n // Keyed on the code as a whole: confronted identity gives every refusal one UNAUTHORIZED, and the\n // server's message is never rendered.\n const sessionExpired = errorCode === 'UNAUTHORIZED';\n\n return (\n <div\n {...props}\n role=\"alert\"\n className={className}\n data-fs-account-saved-cards-error=\"\"\n data-fs-account-saved-cards-error-code={sessionExpired ? 'unauthorized' : 'failed'}\n >\n {children ??\n (sessionExpired ? (\n <>\n {resolveAuthoredCopy(\n $content?.sessionExpiredText,\n intl.formatMessage({ id: 'fs/saved-cards.session-expired' }),\n )}{' '}\n <NavigationLink href={signInTarget(path)} prefetch={false} data-fs-account-saved-cards-sign-in=\"\">\n {resolveAuthoredCopy($content?.signInLabel, intl.formatMessage({ id: 'fs/saved-cards.sign-in' }))}\n </NavigationLink>\n </>\n ) : (\n resolveAuthoredCopy($content?.text, intl.formatMessage({ id: 'fs/saved-cards.load-failed' }))\n ))}\n </div>\n );\n}\n\ntype OverlayOpenProps = {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n};\n\nexport function AccountSavedCardRemove({ children }: Readonly<AccountSavedCardRemoveProps>) {\n const { id } = useAccountSavedCard();\n const { removal } = useAccountSavedCards();\n const [open, setOpen] = useState(false);\n const pending = removal.pendingId === id;\n const blocked = removal.pendingId !== null;\n const close = useCallback(() => setOpen(false), []);\n const value = useMemo(() => ({ id, pending, blocked, close }), [id, pending, blocked, close]);\n const prompt = children ?? <AccountSavedCardRemoveDefaultPrompt />;\n\n if (!isValidElement<OverlayOpenProps>(prompt)) {\n return <AccountSavedCardRemoveContext value={value}>{prompt}</AccountSavedCardRemoveContext>;\n }\n\n return (\n <AccountSavedCardRemoveContext value={value}>\n {cloneElement(prompt, {\n open,\n onOpenChange: (next: boolean) => {\n // Escape and Cancel cannot leave a removal in flight, and no prompt opens while one runs.\n if (next ? blocked : pending) return;\n setOpen(next);\n },\n })}\n </AccountSavedCardRemoveContext>\n );\n}\n\nfunction AccountSavedCardRemoveDefaultPrompt({ open, onOpenChange }: Readonly<OverlayOpenProps>) {\n return (\n <AlertDialogRoot open={open} onOpenChange={onOpenChange}>\n <AccountSavedCardRemoveTrigger />\n <AlertDialogPortal>\n <AlertDialogBackdrop />\n <AlertDialogViewport>\n <AlertDialogPopup>\n <AccountSavedCardRemoveTitle />\n <AccountSavedCardRemoveDescription />\n <AccountSavedCardRemoveCancel />\n <AccountSavedCardRemoveConfirm />\n </AlertDialogPopup>\n </AlertDialogViewport>\n </AlertDialogPortal>\n </AlertDialogRoot>\n );\n}\n\nexport function AccountSavedCardRemoveTrigger({\n $content,\n className,\n children,\n disabled,\n ...props\n}: AccountSavedCardRemoveTriggerProps) {\n const { blocked } = useAccountSavedCardRemove();\n const { name, lastFour } = useCardSummary();\n const intl = useIntl();\n const card = [name, lastFour ? intl.formatMessage({ id: 'fs/card.ending-in' }, { lastDigits: lastFour }) : null]\n .filter(Boolean)\n .join(' ');\n\n return (\n <AlertDialogTrigger\n {...props}\n className={className}\n disabled={blocked || disabled}\n data-fs-account-saved-card-remove-trigger=\"\"\n >\n {children ?? resolveAuthoredCopy($content?.text, intl.formatMessage({ id: 'fs/saved-cards.remove.trigger' }))}\n {card ? (\n <>\n {' '}\n <span data-fs-sr-only=\"\" className=\"sr-only\">\n {card}\n </span>\n </>\n ) : null}\n </AlertDialogTrigger>\n );\n}\n\nexport function AccountSavedCardRemoveTitle({\n $content,\n className,\n children,\n ...props\n}: AccountSavedCardRemoveTitleProps) {\n useAccountSavedCardRemove();\n const intl = useIntl();\n return (\n <AlertDialogTitle {...props} className={className} data-fs-account-saved-card-remove-title=\"\">\n {children ?? resolveAuthoredCopy($content?.text, intl.formatMessage({ id: 'fs/saved-cards.remove.title' }))}\n </AlertDialogTitle>\n );\n}\n\nexport function AccountSavedCardRemoveDescription({\n $content,\n className,\n children,\n ...props\n}: AccountSavedCardRemoveDescriptionProps) {\n useAccountSavedCardRemove();\n const intl = useIntl();\n return (\n <AlertDialogDescription {...props} className={className} data-fs-account-saved-card-remove-description=\"\">\n {children ?? (\n <>\n <CardSummary />{' '}\n {resolveAuthoredCopy($content?.text, intl.formatMessage({ id: 'fs/saved-cards.remove.description' }))}\n </>\n )}\n </AlertDialogDescription>\n );\n}\n\nexport function AccountSavedCardRemoveCancel({\n $content,\n className,\n children,\n disabled,\n ...props\n}: AccountSavedCardRemoveCancelProps) {\n const { pending } = useAccountSavedCardRemove();\n const intl = useIntl();\n return (\n <AlertDialogClose\n {...props}\n className={className}\n disabled={pending || disabled}\n data-fs-account-saved-card-remove-cancel=\"\"\n >\n {children ?? resolveAuthoredCopy($content?.text, intl.formatMessage({ id: 'fs/saved-cards.remove.cancel' }))}\n </AlertDialogClose>\n );\n}\n\nexport function AccountSavedCardRemoveConfirm({\n $content,\n className,\n children,\n onClick,\n ...props\n}: AccountSavedCardRemoveConfirmProps) {\n const { id, pending, close } = useAccountSavedCardRemove();\n const { removal } = useAccountSavedCards();\n const remove = useActionsOverride(undefined)?.savedCard?.remove;\n const intl = useIntl();\n\n async function handleClick(event: MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n if (event.defaultPrevented || !remove || !removal.begin(id)) return;\n let userErrors: readonly { code: string }[];\n try {\n userErrors = await remove({ id });\n } catch {\n // An injected action may reject; a removal left pending would lock the prompt open.\n userErrors = [{ code: 'NETWORK_ERROR' }];\n }\n // On success the row, and this prompt with it, has already left the list; the Root is still there.\n removal.settle(id, userErrors);\n close();\n }\n\n return (\n <button\n {...props}\n type=\"button\"\n className={className}\n // aria-disabled rather than disabled, so focus stays on the control while it reports progress.\n aria-disabled={pending || undefined}\n aria-busy={pending || undefined}\n data-fs-account-saved-card-remove-confirm=\"\"\n {...(pending ? { 'data-fs-account-saved-card-remove-confirm-pending': '' } : {})}\n onClick={handleClick}\n >\n {pending\n ? resolveAuthoredCopy($content?.pendingText, intl.formatMessage({ id: 'fs/saved-cards.remove.pending' }))\n : (children ??\n resolveAuthoredCopy($content?.text, intl.formatMessage({ id: 'fs/saved-cards.remove.confirm' })))}\n </button>\n );\n}\n\nfunction feedbackOutcome(outcome: AccountSavedCardRemovalOutcome | null) {\n if (!outcome) return undefined;\n if (outcome.kind === 'removed') return 'removed';\n return outcome.code === 'UNAUTHORIZED' ? 'unauthorized' : 'failed';\n}\n\nexport function AccountSavedCardsRemoveFeedback({\n $content,\n className,\n ...props\n}: AccountSavedCardsRemoveFeedbackProps) {\n const {\n removal: { outcome },\n } = useAccountSavedCards();\n const intl = useIntl();\n const { path } = useStorefrontRoute();\n const statusRef = useRef<HTMLOutputElement>(null);\n const kind = feedbackOutcome(outcome);\n const successText = resolveAuthoredCopy(\n $content?.successText,\n intl.formatMessage({ id: 'fs/saved-cards.remove.success' }),\n );\n\n // A live region only announces text written after it mounted, so it stays in the tree and is filled\n // on the pass after the outcome. Focus moves to it because the trigger it would return to left with\n // the removed row.\n const [announcement, setAnnouncement] = useState('');\n useEffect(() => {\n const removed = outcome?.kind === 'removed';\n setAnnouncement(removed ? successText : '');\n if (removed) statusRef.current?.focus();\n }, [outcome, successText]);\n\n return (\n <div\n {...props}\n className={className}\n data-fs-account-saved-cards-remove-feedback=\"\"\n data-fs-account-saved-cards-remove-feedback-outcome={kind}\n >\n <output ref={statusRef} aria-live=\"polite\" tabIndex={-1}>\n {announcement}\n </output>\n {kind === 'unauthorized' ? (\n <div role=\"alert\">\n {resolveAuthoredCopy(\n $content?.sessionExpiredText,\n intl.formatMessage({ id: 'fs/saved-cards.session-expired' }),\n )}{' '}\n <NavigationLink\n href={signInTarget(path)}\n prefetch={false}\n data-fs-account-saved-cards-remove-feedback-sign-in=\"\"\n >\n {resolveAuthoredCopy($content?.signInLabel, intl.formatMessage({ id: 'fs/saved-cards.sign-in' }))}\n </NavigationLink>\n </div>\n ) : null}\n {kind === 'failed' ? (\n <div role=\"alert\">\n {resolveAuthoredCopy($content?.failureText, intl.formatMessage({ id: 'fs/saved-cards.remove.failed' }))}\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAM,WAAW,QAAQ;;;;;;;;;;;CAWxB;AAED,MA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;MACvB,UAAU;MACV,uDAAoD;MAEnD,UAAA,oBAAoB,UAAU,aAAa,KAAK,cAAc,EAAE,IAAI,yBAAyB,CAAC,CAAC;KAClF,CAAA;IACb;GACH,CAAA,IAAA;GACH,SAAS,WACR,oBAAC,OAAD;IAAK,MAAK;IACP,UAAA,oBAAoB,UAAU,aAAa,KAAK,cAAc,EAAE,IAAI,+BAA+B,CAAC,CAAC;GACnG,CAAA,IACH;EACD;;AAET"}
1
+ {"version":3,"file":"account-saved-cards.js","names":[],"sources":["../../../src/matter/account-saved-cards/account-saved-cards.tsx"],"sourcesContent":["'use client';\n\nimport type { ErrorLike } from '@apollo/client';\nimport { CombinedGraphQLErrors } from '@apollo/client/errors';\nimport { type ContentValue, defineComponent, defineContentType, type MessageLocaleProp } from '@vtex/fs-core';\nimport {\n type ComponentPropsWithRef,\n cloneElement,\n createContext,\n isValidElement,\n type MouseEvent,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n AlertDialogClose,\n AlertDialogDescription,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from '../../particles/alert-dialog/alert-dialog.js';\nimport { CardSummary, CardSummaryRoot, useCardSummary } from '../../particles/card-summary/card-summary.js';\nimport { NavigationLink } from '../../particles/navigation-link/navigation-link.js';\nimport { ActionsOverrideContext, useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { ListItemRefContext } from '../../sdk/data/list-item-ref-context.js';\nimport { ReactiveRootContext } from '../../sdk/data/page-reactive-data-root.js';\nimport { useStorefrontFormatters } from '../../sdk/format/client.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport type { CustomerSavedCardStatus } from '../../sdk/generated/graphql.js';\nimport { useMessageFormatter } from '../../sdk/i18n/use-message-formatter.js';\nimport { useStorefrontRoute } from '../../sdk/navigation/use-storefront-route.js';\nimport { signInTarget } from '../../utils/safe-href.js';\nimport { useSession } from '../session/session.js';\n\n/**\n * The signed-in shopper's saved cards in the account.\n * The Root reads card ids only; each AccountSavedCardItem subscribes to its own CustomerSavedCard\n * (ADR-0012) and provides `card-summary` and the row itself, so the schema arranges the CardSummary\n * parts and AccountSavedCardExpiry in the row.\n * Every text is children or else the part's own `$content` message; the expiry line, repeated per row,\n * takes no children.\n * Removal state lives in the Root, because a successful removal unmounts the row it started from. The\n * Root also declares the `savedCard.remove` write, so every remove control in the section reaches the\n * provider.\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL fragments\n// ---------------------------------------------------------------------------\n\nconst fragment = graphql(`\n fragment AccountSavedCardsData on Query {\n customerSavedCards {\n __typename\n id\n cards {\n __typename\n id\n }\n }\n }\n`);\n\nconst itemFragment = graphql(`\n fragment AccountSavedCardItemData on Query {\n customerSavedCards {\n cards {\n __typename\n id\n network {\n name\n }\n lastDigits\n expiry {\n month\n year\n }\n status\n }\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Content models — a missing message renders empty and logs\n// ---------------------------------------------------------------------------\n\nexport const AccountSavedCardsHeadingContent = defineContentType({\n id: 'account-saved-cards-heading',\n title: 'Account Saved Cards Heading',\n description: \"Heading of the account's saved-cards section.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Heading', format: 'icu-message', messageSource: 'Saved cards' },\n },\n },\n});\n\nexport const AccountSavedCardsEmptyContent = defineContentType({\n id: 'account-saved-cards-empty',\n title: 'Account Saved Cards Empty',\n description: 'Statement shown when the shopper has no saved cards.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: {\n type: 'string',\n minLength: 1,\n title: 'Empty statement',\n format: 'icu-message',\n messageSource: 'You have no saved cards yet.',\n },\n },\n },\n});\n\nexport const AccountSavedCardsLoadingContent = defineContentType({\n id: 'account-saved-cards-loading',\n title: 'Account Saved Cards Loading',\n description: 'Announcement read to assistive technology while the saved cards load.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: {\n type: 'string',\n minLength: 1,\n title: 'Loading announcement',\n format: 'icu-message',\n messageSource: 'Loading your saved cards…',\n },\n },\n },\n});\n\nexport const AccountSavedCardsErrorContent = defineContentType({\n id: 'account-saved-cards-error',\n title: 'Account Saved Cards Error',\n description: 'Messages shown when the saved cards cannot be read.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: {\n type: 'string',\n minLength: 1,\n title: 'Load failure message',\n format: 'icu-message',\n messageSource: \"We couldn't load your saved cards. Please try again later.\",\n },\n sessionExpiredText: {\n type: 'string',\n minLength: 1,\n title: 'Session expired message',\n format: 'icu-message',\n messageSource: 'Your session has expired.',\n },\n signInLabel: {\n type: 'string',\n minLength: 1,\n title: 'Sign-in link label',\n format: 'icu-message',\n messageSource: 'Sign in again',\n },\n },\n },\n});\n\nexport const AccountSavedCardExpiryContent = defineContentType({\n id: 'account-saved-card-expiry',\n title: 'Account Saved Card Expiry',\n description: \"A saved card's expiry line. The date follows the label and is never authored.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n expiresLabel: {\n type: 'string',\n minLength: 1,\n title: \"Label before a working card's date\",\n format: 'icu-message',\n messageSource: 'Expires',\n },\n expiredLabel: {\n type: 'string',\n minLength: 1,\n title: \"Label before an expired card's date\",\n format: 'icu-message',\n messageSource: 'Expired',\n },\n expiredText: {\n type: 'string',\n minLength: 1,\n title: 'Expired card with no date',\n format: 'icu-message',\n messageSource: 'Expired',\n },\n unusableText: {\n type: 'string',\n minLength: 1,\n title: 'Unusable card',\n format: 'icu-message',\n messageSource: \"This card can't be used\",\n },\n },\n },\n});\n\nexport const AccountSavedCardRemoveTriggerContent = defineContentType({\n id: 'account-saved-card-remove-trigger',\n title: 'Account Saved Card Remove Trigger',\n description:\n \"Label of the control that opens a saved card's removal prompt, and the card's last digits read to assistive technology.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Trigger label', format: 'icu-message', messageSource: 'Remove' },\n cardEndingIn: {\n type: 'string',\n minLength: 1,\n title: 'Card last digits',\n description: 'Read to assistive technology after the card name.',\n format: 'icu-message',\n messageSource: 'ending in {lastDigits}',\n messageArguments: { type: 'object', properties: { lastDigits: { type: 'string' } } },\n messageExample: { lastDigits: '4242' },\n },\n },\n },\n});\n\nexport const AccountSavedCardRemoveTitleContent = defineContentType({\n id: 'account-saved-card-remove-title',\n title: 'Account Saved Card Remove Title',\n description: 'Question that titles the removal prompt.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: {\n type: 'string',\n minLength: 1,\n title: 'Prompt title',\n format: 'icu-message',\n messageSource: 'Remove this card?',\n },\n },\n },\n});\n\nexport const AccountSavedCardRemoveDescriptionContent = defineContentType({\n id: 'account-saved-card-remove-body',\n title: 'Account Saved Card Remove Description',\n description:\n \"What removing the card means, shown after the card in the removal prompt, and the card's last digits read to assistive technology.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: {\n type: 'string',\n minLength: 1,\n title: 'Consequence',\n format: 'icu-message',\n messageSource: \"It will no longer be offered when you pay. This can't be undone.\",\n },\n cardEndingIn: {\n type: 'string',\n minLength: 1,\n title: 'Card last digits',\n description: 'Read to assistive technology after the card name.',\n format: 'icu-message',\n messageSource: 'ending in {lastDigits}',\n messageArguments: { type: 'object', properties: { lastDigits: { type: 'string' } } },\n messageExample: { lastDigits: '4242' },\n },\n },\n },\n});\n\nexport const AccountSavedCardRemoveCancelContent = defineContentType({\n id: 'account-saved-card-remove-cancel',\n title: 'Account Saved Card Remove Cancel',\n description: 'Label of the control that keeps the card.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Cancel label', format: 'icu-message', messageSource: 'Cancel' },\n },\n },\n});\n\nexport const AccountSavedCardRemoveConfirmContent = defineContentType({\n id: 'account-saved-card-remove-confirm',\n title: 'Account Saved Card Remove Confirm',\n description: 'Label of the control that removes the card, and its label while the removal runs.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: {\n type: 'string',\n minLength: 1,\n title: 'Confirm label',\n format: 'icu-message',\n messageSource: 'Remove card',\n },\n pendingText: {\n type: 'string',\n minLength: 1,\n title: 'Label while removing',\n format: 'icu-message',\n messageSource: 'Removing…',\n },\n },\n },\n});\n\nexport const AccountSavedCardsRemoveFeedbackContent = defineContentType({\n id: 'account-saved-cards-remove-feedback',\n title: 'Account Saved Cards Remove Feedback',\n description: 'Messages that tell the shopper how a card removal ended.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n successText: {\n type: 'string',\n minLength: 1,\n title: 'Card removed',\n format: 'icu-message',\n messageSource: 'The card was removed.',\n },\n failureText: {\n type: 'string',\n minLength: 1,\n title: 'Card not removed',\n format: 'icu-message',\n messageSource: \"We couldn't remove the card. Please try again.\",\n },\n sessionExpiredText: {\n type: 'string',\n minLength: 1,\n title: 'Session expired message',\n format: 'icu-message',\n messageSource: 'Your session has expired.',\n },\n signInLabel: {\n type: 'string',\n minLength: 1,\n title: 'Sign-in link label',\n format: 'icu-message',\n messageSource: 'Sign in again',\n },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** The unwrapped `customerSavedCards` entity the reactive runtime delivers to the Root. */\nexport type AccountSavedCardsData = {\n id?: string | null;\n cards?: ReadonlyArray<{ id: string }> | null;\n} | null;\n\n/** One card's slice, delivered per row by the reactive-list-item runtime. */\nexport type AccountSavedCardItemData = {\n id: string;\n network: { name: string };\n lastDigits: string;\n expiry?: { month: number; year: number } | null;\n status: CustomerSavedCardStatus;\n} | null;\n\n/** The row a resolved AccountSavedCardItem provides to the parts inside it. */\nexport type AccountSavedCardContextValue = NonNullable<AccountSavedCardItemData>;\n\n/** `idle` is a null slice with no query in flight, such as a render with no reactive root. */\nexport type AccountSavedCardsState = 'idle' | 'loading' | 'error' | 'empty' | 'ready';\n\nexport type AccountSavedCardRemovalOutcome = Readonly<{ kind: 'removed' }> | Readonly<{ kind: 'failed'; code: string }>;\n\nexport type AccountSavedCardsRemoval = Readonly<{\n /** Card id of the removal in flight, or null. At most one per section. */\n pendingId: string | null;\n /** The last removal's outcome, or null before any and after begin(). */\n outcome: AccountSavedCardRemovalOutcome | null;\n /** Starts a removal. False, with no state change, while another is pending. */\n begin: (id: string) => boolean;\n /** Ends the pending removal with the action's userErrors (empty on success). */\n settle: (id: string, userErrors: readonly { code: string }[]) => void;\n}>;\n\nexport type AccountSavedCardsContextValue = Readonly<{\n state: AccountSavedCardsState;\n cards: ReadonlyArray<{ id: string }>;\n /** `extensions.code` of the read's error, or `null`. Set only in the `error` state. */\n errorCode: string | null;\n removal: AccountSavedCardsRemoval;\n}>;\n\nexport type AccountSavedCardsRootProps = ComponentPropsWithRef<'div'> & {\n $data?: AccountSavedCardsData;\n /** Injected by the compiler from `actions: { savedCard: ['remove'] }`, for every remove control inside. */\n $actions?: ComponentActions;\n};\n\nexport type AccountSavedCardsHeadingLevel = 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport type AccountSavedCardsHeadingProps = ComponentPropsWithRef<'h2'> &\n MessageLocaleProp & {\n /** Heading level. `h1` is excluded: the page title belongs to the page shell. Defaults to `h2`. */\n as?: AccountSavedCardsHeadingLevel;\n $content?: ContentValue<typeof AccountSavedCardsHeadingContent>;\n };\n\nexport type AccountSavedCardsListProps = ComponentPropsWithRef<'ul'> & {\n /** The per-row template, typically one AccountSavedCardItem. */\n children?: ReactNode;\n};\n\nexport type AccountSavedCardItemProps = ComponentPropsWithRef<'li'> & {\n /** The row's parts. The item has no default anatomy. */\n children: ReactNode;\n /** Per-row slice from the reactive-list-item runtime; passed directly in tests. */\n $data?: AccountSavedCardItemData;\n};\n\nexport type AccountSavedCardExpiryProps = Omit<ComponentPropsWithRef<'p'>, 'children'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof AccountSavedCardExpiryContent>;\n };\n\nexport type AccountSavedCardsEmptyProps = ComponentPropsWithRef<'p'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof AccountSavedCardsEmptyContent>;\n };\n\nexport type AccountSavedCardsLoadingProps = Omit<ComponentPropsWithRef<'div'>, 'children'> &\n MessageLocaleProp & {\n /** Placeholder rows shown while the cards load. Defaults to 2. */\n skeletonCount?: number;\n $content?: ContentValue<typeof AccountSavedCardsLoadingContent>;\n };\n\nexport type AccountSavedCardsErrorProps = ComponentPropsWithRef<'div'> &\n MessageLocaleProp & {\n /** Replaces the message for every error code and drops the sign-in link. */\n children?: ReactNode;\n $content?: ContentValue<typeof AccountSavedCardsErrorContent>;\n };\n\n/** The remove controller a row's prompt parts read. */\nexport type AccountSavedCardRemoveValue = Readonly<{\n id: string;\n /** This card's removal is pending. */\n pending: boolean;\n /** Any removal in the section is pending. */\n blocked: boolean;\n close: () => void;\n}>;\n\nexport type AccountSavedCardRemoveProps = {\n /** One AlertDialogRoot to control. */\n children: ReactNode;\n};\n\nexport type AccountSavedCardRemoveTriggerProps = ComponentPropsWithRef<'button'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof AccountSavedCardRemoveTriggerContent>;\n };\n\nexport type AccountSavedCardRemoveTitleProps = ComponentPropsWithRef<'h2'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof AccountSavedCardRemoveTitleContent>;\n };\n\nexport type AccountSavedCardRemoveDescriptionProps = ComponentPropsWithRef<'p'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof AccountSavedCardRemoveDescriptionContent>;\n };\n\nexport type AccountSavedCardRemoveCancelProps = ComponentPropsWithRef<'button'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof AccountSavedCardRemoveCancelContent>;\n };\n\nexport type AccountSavedCardRemoveConfirmProps = ComponentPropsWithRef<'button'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof AccountSavedCardRemoveConfirmContent>;\n };\n\nexport type AccountSavedCardsRemoveFeedbackProps = Omit<ComponentPropsWithRef<'div'>, 'children'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof AccountSavedCardsRemoveFeedbackContent>;\n };\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nconst AccountSavedCardsContext = createContext<AccountSavedCardsContextValue | null>(null);\n\n/** The section state the nearest AccountSavedCardsRoot publishes. Throws outside one. */\nexport function useAccountSavedCards(): AccountSavedCardsContextValue {\n const ctx = useContext(AccountSavedCardsContext);\n if (!ctx) throw new Error('AccountSavedCards parts must be used inside AccountSavedCardsRoot.');\n return ctx;\n}\n\nconst AccountSavedCardContext = createContext<AccountSavedCardContextValue | null>(null);\n\n/** The card the nearest AccountSavedCardItem provides. Throws outside one. */\nexport function useAccountSavedCard(): AccountSavedCardContextValue {\n const ctx = useContext(AccountSavedCardContext);\n if (!ctx) throw new Error('AccountSavedCard parts must be used inside AccountSavedCardItem.');\n return ctx;\n}\n\nconst AccountSavedCardRemoveContext = createContext<AccountSavedCardRemoveValue | null>(null);\n\n/** The remove controller the nearest AccountSavedCardRemove provides. Throws outside one. */\nexport function useAccountSavedCardRemove(): AccountSavedCardRemoveValue {\n const ctx = useContext(AccountSavedCardRemoveContext);\n if (!ctx) throw new Error('AccountSavedCardRemove parts must be used inside AccountSavedCardRemove.');\n return ctx;\n}\n\ntype SavedCardState = 'usable' | 'expired' | 'unusable';\n\n/** Only an explicit USABLE reads as usable, so a status this client does not know never looks usable. */\nfunction savedCardState(status: string): SavedCardState {\n if (status === 'USABLE') return 'usable';\n if (status === 'EXPIRED') return 'expired';\n return 'unusable';\n}\n\nfunction validExpiry(expiry: AccountSavedCardContextValue['expiry']): { month: number; year: number } | null {\n if (!expiry) return null;\n const { month, year } = expiry;\n if (!Number.isInteger(month) || month < 1 || month > 12) return null;\n if (!Number.isInteger(year) || year < 1000 || year > 9999) return null;\n return { month, year };\n}\n\nconst EMPTY_CARDS: ReadonlyArray<{ id: string }> = Object.freeze([]);\n\n/**\n * The read's own error code. The root error is page-wide, so an error whose path names another field\n * does not count; with no path at all, the first code stands.\n */\nfunction readErrorCode(error: ErrorLike): string | null {\n if (!CombinedGraphQLErrors.is(error)) return null;\n const own =\n error.errors.find((entry) => entry.path?.[0] === 'customerSavedCards') ??\n error.errors.find((entry) => entry.path == null);\n const code = own?.extensions?.code;\n return typeof code === 'string' ? code : null;\n}\n\n/**\n * One state for the whole section. A null slice plus an error is a failed read; an error beside a\n * resolved slice belongs to another field of the page query and changes nothing here.\n */\nfunction resolveSectionState(\n data: AccountSavedCardsData,\n loading: boolean,\n error: ErrorLike | undefined,\n): Omit<AccountSavedCardsContextValue, 'removal'> {\n if (data == null) {\n if (error) return { state: 'error', cards: EMPTY_CARDS, errorCode: readErrorCode(error) };\n return { state: loading ? 'loading' : 'idle', cards: EMPTY_CARDS, errorCode: null };\n }\n const cards = data.cards ?? EMPTY_CARDS;\n return { state: cards.length === 0 ? 'empty' : 'ready', cards, errorCode: null };\n}\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const AccountSavedCardsRootDefinition = defineComponent<AccountSavedCardsRootProps>({\n name: 'AccountSavedCardsRoot',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsRoot,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'session',\n providesContext: 'account-saved-cards',\n actions: { savedCard: ['remove'] },\n editor: { label: 'Account Saved Cards Root', category: 'identity' },\n schema: {},\n guideline:\n \"The signed-in shopper's saved cards, read with no cart. Renders nothing unless the session is loggedIn, and no chrome of its own: compose AccountSavedCardsHeading, AccountSavedCardsRemoveFeedback, AccountSavedCardsLoading, AccountSavedCardsError, AccountSavedCardsEmpty, and AccountSavedCardsList (with an AccountSavedCardItem inside) as children. Exactly one of Loading, Error, Empty, or List renders at a time; the state is on data-fs-account-saved-cards-state. It owns the removal state and supplies the savedCard.remove write to every AccountSavedCardRemove inside, so the write sits here rather than on the control that dispatches it; with no remove control composed the write is never called. Must be inside a SessionRoot, normally the my-account layout's. See account-saved-cards.md.\",\n});\n\nexport const AccountSavedCardsHeadingDefinition = defineComponent<AccountSavedCardsHeadingProps>({\n name: 'AccountSavedCardsHeading',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsHeading,\n content: AccountSavedCardsHeadingContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Heading', category: 'identity' },\n schema: {\n as: { type: ['h2', 'h3', 'h4', 'h5', 'h6'] as const, default: 'h2', label: 'Heading level' },\n },\n guideline:\n 'The section heading, rendered in every state. `as` sets the level from h2 to h6 (default h2); there is no h1, because the page title belongs to the page shell — pick the level that fits where the section is nested, or omit the heading. Text is children, or else the text message. Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardsListDefinition = defineComponent<AccountSavedCardsListProps>({\n name: 'AccountSavedCardsList',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsList,\n requiresContext: 'account-saved-cards',\n providesContext: 'account-saved-card',\n editor: { label: 'Account Saved Cards List', category: 'identity' },\n schema: {},\n guideline:\n 'The list of saved cards, one row per card in the platform order, rendered only when the shopper has at least one. Place one AccountSavedCardItem inside as the row template. Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardItemDefinition = defineComponent<AccountSavedCardItemProps>({\n name: 'AccountSavedCardItem',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardItem,\n fragment: itemFragment,\n fetchStrategy: 'reactive-list-item',\n requiresContext: 'account-saved-card',\n providesContext: ['card-summary', 'account-saved-card-data'],\n editor: { label: 'Account Saved Card Item', category: 'identity' },\n schema: {},\n guideline:\n 'One saved card as a list row. It provides the card to the CardSummary parts, AccountSavedCardExpiry, and AccountSavedCardRemove. It renders only its children, so compose CardSummary, AccountSavedCardExpiry and AccountSavedCardRemove in it; keep AccountSavedCardExpiry in any row, and leave AccountSavedCardRemove out only for a read-only list. An expired row carries data-fs-account-saved-card-expired, an unusable one data-fs-account-saved-card-unusable, and a row whose removal is pending data-fs-account-saved-card-removing, for a swatch to dim. Never shows more than the last four digits. Must be inside AccountSavedCardsList.',\n});\n\nexport const AccountSavedCardExpiryDefinition = defineComponent<AccountSavedCardExpiryProps>({\n name: 'AccountSavedCardExpiry',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardExpiry,\n content: AccountSavedCardExpiryContent,\n requiresContext: 'account-saved-card-data',\n editor: { label: 'Account Saved Card Expiry', category: 'identity' },\n schema: {},\n guideline:\n 'When a saved card expires: \"Expires 05/28\" for a working card, \"Expired 05/24\" (or \"Expired\" with no date) for an expired one, and \"This card can\\'t be used\", with no date, for an unusable one. Renders nothing for a working card with no date. The label is the expiresLabel, expiredLabel, expiredText or unusableText message; the component always places the MM/YY date after it. The state is on data-fs-account-saved-card-expiry-status (usable, expired, unusable). Must be inside AccountSavedCardItem.',\n});\n\nexport const AccountSavedCardsEmptyDefinition = defineComponent<AccountSavedCardsEmptyProps>({\n name: 'AccountSavedCardsEmpty',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsEmpty,\n content: AccountSavedCardsEmptyContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Empty', category: 'identity' },\n schema: {},\n guideline:\n 'States that the shopper has no saved cards. Renders only once the read resolved with none — never while loading or after a failure. Text is children, or else the text message. Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardsLoadingDefinition = defineComponent<AccountSavedCardsLoadingProps>({\n name: 'AccountSavedCardsLoading',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsLoading,\n content: AccountSavedCardsLoadingContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Loading', category: 'identity' },\n schema: {\n skeletonCount: { type: 'number', default: 2, label: 'Placeholder rows' },\n },\n guideline:\n 'Placeholder rows while the saved cards load, plus one polite live region that announces the wait (the text message). The rows are hidden from assistive technology; style them through data-fs-account-saved-cards-loading-row. Without this part the section shows no loading look. Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardsErrorDefinition = defineComponent<AccountSavedCardsErrorProps>({\n name: 'AccountSavedCardsError',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsError,\n content: AccountSavedCardsErrorContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Error', category: 'identity' },\n schema: {},\n guideline:\n 'An alert shown when the saved cards cannot be read. An expired session says so and links to sign-in, returning the shopper to this page; any other failure says the cards could not be loaded. The wording is the sessionExpiredText, signInLabel and text messages, never from the server; children replace it for every failure and drop the link. Must be inside AccountSavedCardsRoot.',\n});\n\nexport const AccountSavedCardRemoveDefinition = defineComponent<AccountSavedCardRemoveProps>({\n name: 'AccountSavedCardRemove',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemove,\n requiresContext: 'account-saved-card-data',\n providesContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove', category: 'identity' },\n schema: {},\n guideline:\n \"Lets the shopper remove the row's card after confirming. State-only controller: wrap one AlertDialogRoot and it becomes controlled, so never set open or onOpenChange on it. Compose AlertDialogRoot > (AccountSavedCardRemoveTrigger + AlertDialogPortal > (AlertDialogBackdrop + AlertDialogViewport > AlertDialogPopup > (AccountSavedCardRemoveTitle + AccountSavedCardRemoveDescription + AccountSavedCardRemoveCancel + AccountSavedCardRemoveConfirm))), Cancel before Confirm so the safe action takes focus. With no children it renders nothing. The prompt stays open while the removal runs and closes when it fails; on success the row leaves the list. AccountSavedCardsRoot supplies the savedCard.remove write, and the outcome goes unreported unless the section composes AccountSavedCardsRemoveFeedback. Must be inside AccountSavedCardItem.\",\n});\n\nexport const AccountSavedCardRemoveTriggerDefinition = defineComponent<AccountSavedCardRemoveTriggerProps>({\n name: 'AccountSavedCardRemoveTrigger',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveTrigger,\n content: AccountSavedCardRemoveTriggerContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Trigger', category: 'identity' },\n schema: {},\n guideline:\n 'Opens the removal prompt. Its accessible name is its text followed by the card, e.g. \"Remove Visa ending in 1234\"; the card part is visually hidden. Disabled while any removal in the section is pending. Text is children, or else the text message; the card part is the cardEndingIn message. Direct child of the AlertDialogRoot inside AccountSavedCardRemove.',\n});\n\nexport const AccountSavedCardRemoveTitleDefinition = defineComponent<AccountSavedCardRemoveTitleProps>({\n name: 'AccountSavedCardRemoveTitle',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveTitle,\n content: AccountSavedCardRemoveTitleContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Title', category: 'identity' },\n schema: {},\n guideline:\n \"The removal prompt's question and its accessible name. Required inside AlertDialogPopup. Text is children, or else the text message. Must be inside AccountSavedCardRemove.\",\n});\n\nexport const AccountSavedCardRemoveDescriptionDefinition = defineComponent<AccountSavedCardRemoveDescriptionProps>({\n name: 'AccountSavedCardRemoveDescription',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveDescription,\n content: AccountSavedCardRemoveDescriptionContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Description', category: 'identity' },\n schema: {},\n guideline:\n 'Names the card and states the consequence; screen readers announce it with the prompt. With no children it renders CardSummary, which reads the cardEndingIn message of this part as its endingIn, and then the text message; children replace both, so keep a CardSummary in them for the prompt to name the card. Inside AlertDialogPopup, after AccountSavedCardRemoveTitle. Must be inside AccountSavedCardRemove.',\n});\n\nexport const AccountSavedCardRemoveCancelDefinition = defineComponent<AccountSavedCardRemoveCancelProps>({\n name: 'AccountSavedCardRemoveCancel',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveCancel,\n content: AccountSavedCardRemoveCancelContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Cancel', category: 'identity' },\n schema: {},\n guideline:\n 'Closes the removal prompt and keeps the card. Disabled while the removal runs. Place it before AccountSavedCardRemoveConfirm so it takes focus when the prompt opens. Text is children, or else the text message. Must be inside AccountSavedCardRemove.',\n});\n\nexport const AccountSavedCardRemoveConfirmDefinition = defineComponent<AccountSavedCardRemoveConfirmProps>({\n name: 'AccountSavedCardRemoveConfirm',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardRemoveConfirm,\n content: AccountSavedCardRemoveConfirmContent,\n requiresContext: 'account-saved-card-remove',\n editor: { label: 'Account Saved Card Remove Confirm', category: 'identity' },\n schema: {},\n guideline:\n 'Removes the card. It dispatches savedCard.remove through the write AccountSavedCardsRoot supplies and declares none of its own. While the removal runs it is busy and shows its pending text; one removal runs at a time in the section. Text is children, or else the text message; the pendingText message while removing. Must be inside AccountSavedCardRemove.',\n});\n\nexport const AccountSavedCardsRemoveFeedbackDefinition = defineComponent<AccountSavedCardsRemoveFeedbackProps>({\n name: 'AccountSavedCardsRemoveFeedback',\n importPath: '@vtex/faststore/components',\n component: AccountSavedCardsRemoveFeedback,\n content: AccountSavedCardsRemoveFeedbackContent,\n requiresContext: 'account-saved-cards',\n editor: { label: 'Account Saved Cards Remove Feedback', category: 'identity' },\n schema: {},\n guideline:\n \"Tells the shopper how a card removal ended: a status message that takes focus when the card was removed, or an alert when it was not, with a sign-in link back to this page when the session expired. Renders in every state of the section, so the message outlives the removed row and an emptied list; it stays until the next removal starts. Without this part a removal's outcome goes unreported. The wording is the successText, failureText, sessionExpiredText and signInLabel messages, never the server's; the outcome is on data-fs-account-saved-cards-remove-feedback-outcome. Must be inside AccountSavedCardsRoot.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\n/**\n * One removal at a time: each success replaces the whole cached list, so two in flight could land out\n * of order and restore a card the later one removed.\n */\nfunction useRemovalState(): AccountSavedCardsRemoval {\n const [pendingId, setPendingId] = useState<string | null>(null);\n const [outcome, setOutcome] = useState<AccountSavedCardRemovalOutcome | null>(null);\n // Read synchronously, so a second activation in the same tick already sees the first.\n const pendingRef = useRef<string | null>(null);\n\n const begin = useCallback((id: string) => {\n if (pendingRef.current !== null) return false;\n pendingRef.current = id;\n setPendingId(id);\n setOutcome(null);\n return true;\n }, []);\n\n const settle = useCallback((id: string, userErrors: readonly { code: string }[]) => {\n if (pendingRef.current !== id) return;\n pendingRef.current = null;\n setPendingId(null);\n const [first] = userErrors;\n setOutcome(first ? { kind: 'failed', code: first.code } : { kind: 'removed' });\n }, []);\n\n return useMemo(() => ({ pendingId, outcome, begin, settle }), [pendingId, outcome, begin, settle]);\n}\n\nexport function AccountSavedCardsRoot({\n $data: $dataProp,\n $actions: $actionsProp,\n className,\n children,\n ...props\n}: AccountSavedCardsRootProps) {\n // Enforces the SessionRoot ancestor: useSession() throws outside one.\n const { state: sessionState } = useSession();\n const data = useDataOverride<AccountSavedCardsData | undefined>($dataProp) ?? null;\n const $actions = useActionsOverride($actionsProp);\n const { loading, error } = useContext(ReactiveRootContext);\n const section = useMemo(() => resolveSectionState(data, loading, error), [data, loading, error]);\n const removal = useRemovalState();\n const value = useMemo(() => ({ ...section, removal }), [section, removal]);\n\n if (sessionState !== 'loggedIn') return null;\n\n return (\n <AccountSavedCardsContext value={value}>\n <ActionsOverrideContext value={$actions}>\n <div\n {...props}\n className={className}\n data-fs-account-saved-cards=\"\"\n data-fs-account-saved-cards-state={value.state}\n >\n {children}\n </div>\n </ActionsOverrideContext>\n </AccountSavedCardsContext>\n );\n}\n\nexport function AccountSavedCardsHeading({\n as: Tag = 'h2',\n $content,\n $locale,\n className,\n children,\n ...props\n}: AccountSavedCardsHeadingProps) {\n useAccountSavedCards();\n const { format } = useMessageFormatter(AccountSavedCardsHeadingContent, $content);\n return (\n <Tag {...props} className={className} data-fs-account-saved-cards-heading=\"\">\n {children ?? format('text')}\n </Tag>\n );\n}\n\nexport function AccountSavedCardsList({ className, children, ...props }: AccountSavedCardsListProps) {\n const { state, cards } = useAccountSavedCards();\n if (state !== 'ready') return null;\n\n return (\n <ul {...props} className={className} data-fs-account-saved-cards-list=\"\">\n {cards.map((card) => (\n // No fallback slice: the Root selects ids only, so an incomplete row renders nothing until\n // its cache entry resolves rather than a partial card.\n <ListItemRefContext\n key={card.id}\n value={{ __typename: 'CustomerSavedCard', id: card.id, fallbackData: undefined }}\n >\n {children}\n </ListItemRefContext>\n ))}\n </ul>\n );\n}\n\nexport function AccountSavedCardItem({ $data: $dataProp, className, children, ...props }: AccountSavedCardItemProps) {\n const card = useDataOverride<AccountSavedCardItemData | undefined>($dataProp) ?? null;\n // Not useAccountSavedCards(): an Item composed without a remove control stays usable outside a Root.\n const pendingId = useContext(AccountSavedCardsContext)?.removal.pendingId ?? null;\n if (!card) return null;\n const state = savedCardState(card.status);\n\n return (\n <AccountSavedCardContext value={card}>\n <li\n {...props}\n className={className}\n data-fs-account-saved-card=\"\"\n {...(state === 'expired' ? { 'data-fs-account-saved-card-expired': '' } : {})}\n {...(state === 'unusable' ? { 'data-fs-account-saved-card-unusable': '' } : {})}\n {...(pendingId === card.id ? { 'data-fs-account-saved-card-removing': '' } : {})}\n >\n <CardSummaryRoot network={card.network.name} lastDigits={card.lastDigits}>\n {children}\n </CardSummaryRoot>\n </li>\n </AccountSavedCardContext>\n );\n}\n\nexport function AccountSavedCardExpiry({ $content, $locale, className, ...props }: AccountSavedCardExpiryProps) {\n const { status, expiry } = useAccountSavedCard();\n const { format } = useMessageFormatter(AccountSavedCardExpiryContent, $content);\n const { formatDate } = useStorefrontFormatters();\n const state = savedCardState(status);\n const date = state === 'unusable' ? null : validExpiry(expiry);\n if (state === 'usable' && !date) return null;\n\n let label: string;\n if (state === 'unusable') {\n label = format('unusableText');\n } else if (!date) {\n label = format('expiredText');\n } else if (state === 'expired') {\n label = format('expiredLabel');\n } else {\n label = format('expiresLabel');\n }\n const month = date ? String(date.month).padStart(2, '0') : '';\n\n return (\n <p\n {...props}\n className={className}\n data-fs-account-saved-card-expiry=\"\"\n data-fs-account-saved-card-expiry-status={state}\n >\n <span data-fs-account-saved-card-expiry-label=\"\">{label}</span>\n {date ? (\n <>\n {' '}\n <time data-fs-account-saved-card-expiry-date=\"\" dateTime={`${date.year}-${month}`} aria-hidden=\"true\">\n {`${month}/${String(date.year % 100).padStart(2, '0')}`}\n </time>{' '}\n <span data-fs-sr-only=\"\" className=\"sr-only\">\n {/* UTC on the first of the month, so no time zone moves the date into another month. */}\n {formatDate(Date.UTC(date.year, date.month - 1, 1), {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC',\n })}\n </span>\n </>\n ) : null}\n </p>\n );\n}\n\nexport function AccountSavedCardsEmpty({\n $content,\n $locale,\n className,\n children,\n ...props\n}: AccountSavedCardsEmptyProps) {\n const { state } = useAccountSavedCards();\n const { format } = useMessageFormatter(AccountSavedCardsEmptyContent, $content);\n if (state !== 'empty') return null;\n\n return (\n <p {...props} className={className} data-fs-account-saved-cards-empty=\"\">\n {children ?? format('text')}\n </p>\n );\n}\n\nconst DEFAULT_SKELETON_COUNT = 2;\n\nexport function AccountSavedCardsLoading({\n skeletonCount = DEFAULT_SKELETON_COUNT,\n $content,\n $locale,\n className,\n ...props\n}: AccountSavedCardsLoadingProps) {\n const { state } = useAccountSavedCards();\n const { format } = useMessageFormatter(AccountSavedCardsLoadingContent, $content);\n const loading = state === 'loading';\n const rows = Number.isFinite(skeletonCount) ? Math.max(1, Math.trunc(skeletonCount)) : DEFAULT_SKELETON_COUNT;\n\n // A live region only announces text written after it mounted, so it stays in the tree and is\n // filled on the pass after loading starts (AccountEntryPoint's pattern).\n const [announcement, setAnnouncement] = useState('');\n const pendingLabel = loading ? format('text') : '';\n useEffect(() => {\n setAnnouncement(pendingLabel);\n }, [pendingLabel]);\n\n return (\n <>\n {loading ? (\n <div {...props} className={className} aria-hidden=\"true\" data-fs-account-saved-cards-loading=\"\">\n {Array.from({ length: rows }, (_, index) => (\n <span key={index} data-fs-account-saved-cards-loading-row=\"\" />\n ))}\n </div>\n ) : null}\n <output aria-live=\"polite\" data-fs-account-saved-cards-loading-announcement=\"\">\n {announcement}\n </output>\n </>\n );\n}\n\nexport function AccountSavedCardsError({\n $content,\n $locale,\n className,\n children,\n ...props\n}: AccountSavedCardsErrorProps) {\n const { state, errorCode } = useAccountSavedCards();\n const { format } = useMessageFormatter(AccountSavedCardsErrorContent, $content);\n const { path } = useStorefrontRoute();\n if (state !== 'error') return null;\n\n // Keyed on the code as a whole: confronted identity gives every refusal one UNAUTHORIZED, and the\n // server's message is never rendered.\n const sessionExpired = errorCode === 'UNAUTHORIZED';\n\n return (\n <div\n {...props}\n role=\"alert\"\n className={className}\n data-fs-account-saved-cards-error=\"\"\n data-fs-account-saved-cards-error-code={sessionExpired ? 'unauthorized' : 'failed'}\n >\n {children ??\n (sessionExpired ? (\n <>\n {format('sessionExpiredText')}{' '}\n <NavigationLink href={signInTarget(path)} prefetch={false} data-fs-account-saved-cards-sign-in=\"\">\n {format('signInLabel')}\n </NavigationLink>\n </>\n ) : (\n format('text')\n ))}\n </div>\n );\n}\n\ntype OverlayOpenProps = {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n};\n\nexport function AccountSavedCardRemove({ children }: Readonly<AccountSavedCardRemoveProps>) {\n const { id } = useAccountSavedCard();\n const { removal } = useAccountSavedCards();\n const [open, setOpen] = useState(false);\n const pending = removal.pendingId === id;\n const blocked = removal.pendingId !== null;\n const close = useCallback(() => setOpen(false), []);\n const value = useMemo(() => ({ id, pending, blocked, close }), [id, pending, blocked, close]);\n\n if (!isValidElement<OverlayOpenProps>(children)) {\n return <AccountSavedCardRemoveContext value={value}>{children}</AccountSavedCardRemoveContext>;\n }\n\n return (\n <AccountSavedCardRemoveContext value={value}>\n {cloneElement(children, {\n open,\n onOpenChange: (next: boolean) => {\n // Escape and Cancel cannot leave a removal in flight, and no prompt opens while one runs.\n if (next ? blocked : pending) return;\n setOpen(next);\n },\n })}\n </AccountSavedCardRemoveContext>\n );\n}\n\nexport function AccountSavedCardRemoveTrigger({\n $content,\n $locale,\n className,\n children,\n disabled,\n ...props\n}: AccountSavedCardRemoveTriggerProps) {\n const { blocked } = useAccountSavedCardRemove();\n const { name, lastFour } = useCardSummary();\n const { format } = useMessageFormatter(AccountSavedCardRemoveTriggerContent, $content);\n const card = [name, lastFour ? format('cardEndingIn', { lastDigits: lastFour }) : null].filter(Boolean).join(' ');\n\n return (\n <AlertDialogTrigger\n {...props}\n className={className}\n disabled={blocked || disabled}\n data-fs-account-saved-card-remove-trigger=\"\"\n >\n {children ?? format('text')}\n {card ? (\n <>\n {' '}\n <span data-fs-sr-only=\"\" className=\"sr-only\">\n {card}\n </span>\n </>\n ) : null}\n </AlertDialogTrigger>\n );\n}\n\nexport function AccountSavedCardRemoveTitle({\n $content,\n $locale,\n className,\n children,\n ...props\n}: AccountSavedCardRemoveTitleProps) {\n useAccountSavedCardRemove();\n const { format } = useMessageFormatter(AccountSavedCardRemoveTitleContent, $content);\n return (\n <AlertDialogTitle {...props} className={className} data-fs-account-saved-card-remove-title=\"\">\n {children ?? format('text')}\n </AlertDialogTitle>\n );\n}\n\nexport function AccountSavedCardRemoveDescription({\n $content,\n $locale,\n className,\n children,\n ...props\n}: AccountSavedCardRemoveDescriptionProps) {\n useAccountSavedCardRemove();\n const { format } = useMessageFormatter(AccountSavedCardRemoveDescriptionContent, $content);\n const cardEndingIn = $content?.cardEndingIn;\n const cardSummaryContent = useMemo(() => ({ endingIn: cardEndingIn }), [cardEndingIn]);\n return (\n <AlertDialogDescription {...props} className={className} data-fs-account-saved-card-remove-description=\"\">\n {children ?? (\n <>\n <CardSummary $content={cardSummaryContent} /> {format('text')}\n </>\n )}\n </AlertDialogDescription>\n );\n}\n\nexport function AccountSavedCardRemoveCancel({\n $content,\n $locale,\n className,\n children,\n disabled,\n ...props\n}: AccountSavedCardRemoveCancelProps) {\n const { pending } = useAccountSavedCardRemove();\n const { format } = useMessageFormatter(AccountSavedCardRemoveCancelContent, $content);\n return (\n <AlertDialogClose\n {...props}\n className={className}\n disabled={pending || disabled}\n data-fs-account-saved-card-remove-cancel=\"\"\n >\n {children ?? format('text')}\n </AlertDialogClose>\n );\n}\n\nexport function AccountSavedCardRemoveConfirm({\n $content,\n $locale,\n className,\n children,\n onClick,\n ...props\n}: AccountSavedCardRemoveConfirmProps) {\n const { id, pending, close } = useAccountSavedCardRemove();\n const { removal } = useAccountSavedCards();\n const remove = useActionsOverride(undefined)?.savedCard?.remove;\n const { format } = useMessageFormatter(AccountSavedCardRemoveConfirmContent, $content);\n\n async function handleClick(event: MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n if (event.defaultPrevented || !remove || !removal.begin(id)) return;\n let userErrors: readonly { code: string }[];\n try {\n userErrors = await remove({ id });\n } catch {\n // An injected action may reject; a removal left pending would lock the prompt open.\n userErrors = [{ code: 'NETWORK_ERROR' }];\n }\n // On success the row, and this prompt with it, has already left the list; the Root is still there.\n removal.settle(id, userErrors);\n close();\n }\n\n return (\n <button\n {...props}\n type=\"button\"\n className={className}\n // aria-disabled rather than disabled, so focus stays on the control while it reports progress.\n aria-disabled={pending || undefined}\n aria-busy={pending || undefined}\n data-fs-account-saved-card-remove-confirm=\"\"\n {...(pending ? { 'data-fs-account-saved-card-remove-confirm-pending': '' } : {})}\n onClick={handleClick}\n >\n {pending ? format('pendingText') : (children ?? format('text'))}\n </button>\n );\n}\n\nfunction feedbackOutcome(outcome: AccountSavedCardRemovalOutcome | null) {\n if (!outcome) return undefined;\n if (outcome.kind === 'removed') return 'removed';\n return outcome.code === 'UNAUTHORIZED' ? 'unauthorized' : 'failed';\n}\n\nexport function AccountSavedCardsRemoveFeedback({\n $content,\n $locale,\n className,\n ...props\n}: AccountSavedCardsRemoveFeedbackProps) {\n const {\n removal: { outcome },\n } = useAccountSavedCards();\n const { format } = useMessageFormatter(AccountSavedCardsRemoveFeedbackContent, $content);\n const { path } = useStorefrontRoute();\n const statusRef = useRef<HTMLOutputElement>(null);\n const kind = feedbackOutcome(outcome);\n\n // A live region only announces text written after it mounted, so it stays in the tree and is filled\n // on the pass after the outcome. Focus moves to it because the trigger it would return to left with\n // the removed row.\n const [announcement, setAnnouncement] = useState('');\n const removed = outcome?.kind === 'removed';\n // Formatted only once a card was removed, so an idle section never reports the message missing.\n const successText = removed ? format('successText') : '';\n useEffect(() => {\n setAnnouncement(successText);\n if (removed) statusRef.current?.focus();\n }, [removed, successText]);\n\n return (\n <div\n {...props}\n className={className}\n data-fs-account-saved-cards-remove-feedback=\"\"\n data-fs-account-saved-cards-remove-feedback-outcome={kind}\n >\n <output ref={statusRef} aria-live=\"polite\" tabIndex={-1}>\n {announcement}\n </output>\n {kind === 'unauthorized' ? (\n <div role=\"alert\">\n {format('sessionExpiredText')}{' '}\n <NavigationLink\n href={signInTarget(path)}\n prefetch={false}\n data-fs-account-saved-cards-remove-feedback-sign-in=\"\"\n >\n {format('signInLabel')}\n </NavigationLink>\n </div>\n ) : null}\n {kind === 'failed' ? <div role=\"alert\">{format('failureText')}</div> : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAM,WAAW,QAAQ;;;;;;;;;;;CAWxB;AAED,MAAM,eAAe,QAAQ;;;;;;;;;;;;;;;;;;CAkB5B;AAMD,MAAa,kCAAkC,kBAAkB;CAC/D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY,EACV,MAAM;GAAE,MAAM;GAAU,WAAW;GAAG,OAAO;GAAW,QAAQ;GAAe,eAAe;EAAc,EAC9G;CACF;AACF,CAAC;AAED,MAAa,gCAAgC,kBAAkB;CAC7D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY,EACV,MAAM;GACJ,MAAM;GACN,WAAW;GACX,OAAO;GACP,QAAQ;GACR,eAAe;EACjB,EACF;CACF;AACF,CAAC;AAED,MAAa,kCAAkC,kBAAkB;CAC/D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY,EACV,MAAM;GACJ,MAAM;GACN,WAAW;GACX,OAAO;GACP,QAAQ;GACR,eAAe;EACjB,EACF;CACF;AACF,CAAC;A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SAAS,iBACR,qBAAC,OAAD;IAAK,MAAK;IAAV,UAAA;KACG,OAAO,oBAAoB;KAAG;KAC/B,oBAAC,gBAAD;MACE,MAAM,aAAa,IAAI;MACvB,UAAU;MACV,uDAAoD;MAEnD,UAAA,OAAO,aAAa;KACP,CAAA;IACb;GACH,CAAA,IAAA;GACH,SAAS,WAAW,oBAAC,OAAD;IAAK,MAAK;IAAS,UAAA,OAAO,aAAa;GAAO,CAAA,IAAI;EACpE;;AAET"}
@@ -1,7 +1,7 @@
1
+ import { ContentValue, MessageLocaleProp } from "../../core/dist/define-content-type.js";
1
2
  import { ComponentDefinition } from "../../core/dist/define-component.js";
2
3
  import "../../core/dist/index.js";
3
4
  import { ComponentActions } from "../../sdk/actions/types.js";
4
- import "../shipping-address/country-descriptors.js";
5
5
  import { ComponentPropsWithRef } from "react";
6
6
  //#region src/matter/billing-address/billing-address.d.ts
7
7
  /**
@@ -10,11 +10,13 @@ import { ComponentPropsWithRef } from "react";
10
10
  * country-specific address form that persists via `$actions.payment.setBillingAddress`
11
11
  * (already shipped by T4, zero consumers before this task).
12
12
  *
13
- * The shared `Address` composition RFC D6 names (shipping and billing as two control matters over
14
- * one set of reusable particles) is DEFERRED — an implementation-time call the engineer resolved
15
- * narrow (specs/billing-address.md Decision 1). This component builds its own controls and imports
16
- * `countryDescriptors` from `../shipping-address/country-descriptors.js`, the one place a country's field
17
- * set, labels, copy and format rules live.
13
+ * RFC D6 names one shared `Address` under shipping and billing. What the two matters share is the country
14
+ * descriptors (`../shipping-address/country-descriptors.js`, the one place a country's field set and format
15
+ * rules live), the rule verdict (`satisfiesFieldRule`) and the payload helpers
16
+ * (`../shipping-address/address-payload.js`: value normalisation and which text fields a country sends). The
17
+ * controls are not shared: this component builds its own, over local state, where shipping binds
18
+ * react-hook-form, and their `data-fs-*` hooks, required rules and error copy differ (specs/billing-address.md
19
+ * Decision 1). Its copy is its own `$content`; country names come from `Intl.DisplayNames`.
18
20
  *
19
21
  * There is NO read-back path for a persisted billing address (specs/billing-address.md Decision 3):
20
22
  * `type Payment` carries no `billingAddress` field, and `setBillingAddress` itself resolves only
@@ -76,80 +78,19 @@ export type BillingAddressFormDraft = Readonly<{
76
78
  country: string;
77
79
  [fieldName: string]: string;
78
80
  }>;
79
- export type BillingAddressProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {
80
- /** The "same as delivery" toggle's own accessible label. */
81
- sameAsDeliveryLabel?: string;
81
+ export type BillingAddressProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & MessageLocaleProp & {
82
82
  /** ISO 3166-1 alpha-3 default country for the custom-address form's country selector. */
83
83
  defaultCountry?: string;
84
- /** Label for the country selector inside the custom-address form. */
85
- countryLabel?: string;
86
- /** Label for the control that persists a custom billing address. */
87
- submitLabel?: string;
88
- /** Label on the submit control while the mutation is in flight. */
89
- submitPendingLabel?: string;
90
- /** Shown when the selected method's validator marks a billing address required. */
91
- requiredNoticeLabel?: string;
92
- /** Label for the recipient-name descriptor field. Not rendered by the custom-address form today
93
- * (`OMITTED_FORM_FIELD_NAMES` — the write contract has no matching input slot, Decision 4); kept
94
- * for parity with the other seven field labels this same map covers. */
95
- recipientNameLabel?: string;
96
- /** Label for the street descriptor field. */
97
- streetLabel?: string;
98
- /** Label for the street-number descriptor field. */
99
- numberLabel?: string;
100
- /** Label for the complement descriptor field. Its "(optional)" suffix is the only signal that the
101
- * field is not required — `OPTIONAL_FORM_FIELD_NAMES` drives the actual `required` attribute
102
- * independently, so authoring this without the suffix loses the optionality cue, not the behavior
103
- * (R7). */
104
- complementLabel?: string;
105
- /** Label for the neighborhood descriptor field. Unused when the active country's descriptor has no
106
- * `neighborhood` field (e.g. USA). */
107
- neighborhoodLabel?: string;
108
- /** Label for the city descriptor field. */
109
- cityLabel?: string;
110
- /** Label for the state descriptor field. */
111
- stateLabel?: string;
112
- /** Label for the postal-code descriptor field. */
113
- postalCodeLabel?: string;
114
- /** Shown while the form is open and no address has been persisted yet (PR #544 N7) — the shopper
115
- * declined "same as delivery" but has not (or not yet again) had a submit succeed, so Place Order
116
- * will bill the delivery address unless they save one first. Rendered `role="status"`, not
117
- * `role="alert"`: it is a persistent, advisory condition of the form being open, not a one-off
118
- * announcement reacting to a rejected action (see this file's own existing `-error` alert for that
119
- * shape) — see `specs/billing-address.md`'s Accessibility Contract for the site count this choice is
120
- * measured against. */
121
- unsavedAddressNoticeLabel?: string;
122
- /** Always-on billing-match disclaimer (requirement 12.20): tells the shopper their billing address
123
- * must match the one their card issuer or bank statement holds, so an AVS mismatch does not get the
124
- * order declined with no explanation on screen. Gated on this prop and `billingMatchNoticeVisible`
125
- * only — reads no `usePayment()` value, no local state, no `$data` (FR-4), unlike the two notices
126
- * above. */
127
- billingMatchNoticeLabel?: string;
128
- /** Switches the billing-match disclaimer above on or off. Defaults to `true` (Decision 5 — the
129
- * requirement's own intent); subordinate to `billingMatchNoticeLabel.trim()`, which alone can still
130
- * suppress an empty notice (FR-3) regardless of this prop's value. */
84
+ /** Switches the always-on billing-match disclaimer (requirement 12.20) on or off. Defaults to `true`
85
+ * (Decision 5 — the requirement's own intent); a blank `billingMatchNoticeLabel` message also
86
+ * suppresses it (FR-3). Reads no `usePayment()` value, no local state, no `$data` (FR-4). */
131
87
  billingMatchNoticeVisible?: boolean;
132
- /**
133
- * Shown as a `Field.Error` under a required, blank, touched field (T38, FR-6/FR-7) — the same
134
- * non-blank rule `isBillingAddressFormValid` already applies, except `complement`
135
- * (`OPTIONAL_FORM_FIELD_NAMES`), which is never marked invalid. One prop, not one per field: every
136
- * rendered field shares the same rule, so seven props would be seven ways to say the same sentence.
137
- * Resolved through `resolveAuthoredCopy`.
138
- */
139
- fieldRequiredMessage?: string;
140
- /**
141
- * Shown as a `Field.Error` under a touched, non-blank postal code that does not match the selected
142
- * country's format (the descriptor's `rule.pattern`). Only the postal code reads this prop: any other
143
- * field that gains a pattern speaks with its own descriptor message. Blank wins over format: a blank
144
- * field reads `fieldRequiredMessage`, never this. Never contains the typed value. Resolved through
145
- * `resolveAuthoredCopy`, so a blank value falls back to the English default like every other copy on
146
- * this form.
147
- */
148
- postalCodeInvalidMessage?: string;
149
88
  /** Disables the toggle, every form field, the country selector, and the submit control. */
150
89
  disabled?: boolean;
151
90
  /** Compiler-injected action surface; carries `payment.setBillingAddress`. */
152
91
  $actions?: ComponentActions;
92
+ /** The toggle, notices, field labels, messages and submit labels of the form. */
93
+ $content?: ContentValue<typeof BillingAddressContent>;
153
94
  };
154
95
  /**
155
96
  * Whether the toggle reads as "same as delivery" — `true` whenever the published flag is `null`
@@ -172,7 +113,148 @@ export declare function resolveSameAsDelivery(billingAddressDifferent: boolean |
172
113
  * gate would fail on.
173
114
  */
174
115
  export declare function isBillingAddressFormValid(formDraft: BillingAddressFormDraft): boolean;
116
+ export declare const BillingAddressContent: {
117
+ readonly id: "billing-address";
118
+ readonly title: "Billing Address";
119
+ readonly description: "Copy of the billing address toggle, its notices, the custom-address form and its messages.";
120
+ readonly schema: {
121
+ readonly type: "object";
122
+ readonly additionalProperties: false;
123
+ readonly properties: {
124
+ readonly sameAsDeliveryLabel: {
125
+ readonly type: "string";
126
+ readonly title: "Same-as-delivery toggle label";
127
+ readonly format: "icu-message";
128
+ readonly messageSource: "Billing address same as delivery address";
129
+ };
130
+ readonly countryLabel: {
131
+ readonly type: "string";
132
+ readonly title: "Country field label";
133
+ readonly format: "icu-message";
134
+ readonly messageSource: "Country";
135
+ };
136
+ readonly submitLabel: {
137
+ readonly type: "string";
138
+ readonly title: "Submit button label";
139
+ readonly format: "icu-message";
140
+ readonly messageSource: "Save billing address";
141
+ };
142
+ readonly submitPendingLabel: {
143
+ readonly type: "string";
144
+ readonly title: "Submit button pending label";
145
+ readonly format: "icu-message";
146
+ readonly messageSource: "Saving...";
147
+ };
148
+ readonly requiredNoticeLabel: {
149
+ readonly type: "string";
150
+ readonly title: "Required-billing-address notice";
151
+ readonly description: "Shown when the selected method's validator marks a billing address required.";
152
+ readonly format: "icu-message";
153
+ readonly messageSource: "This payment method requires a billing address.";
154
+ };
155
+ readonly unsavedAddressNoticeLabel: {
156
+ readonly type: "string";
157
+ readonly title: "Unsaved-address notice";
158
+ readonly description: "Shown while the form is open and no address has been saved yet.";
159
+ readonly format: "icu-message";
160
+ readonly messageSource: "No billing address has been saved yet — the delivery address will be used unless you save one below.";
161
+ };
162
+ readonly billingMatchNoticeLabel: {
163
+ readonly type: "string";
164
+ readonly title: "Billing-match disclaimer";
165
+ readonly description: "Always on unless billingMatchNoticeVisible is false; blank shows no disclaimer.";
166
+ readonly format: "icu-message";
167
+ readonly messageSource: "Your billing address must match the one on your card or bank statement, or your bank may decline the order.";
168
+ };
169
+ readonly recipientNameLabel: {
170
+ readonly type: "string";
171
+ readonly title: "Recipient name field label";
172
+ readonly description: "Not rendered today: the billing write has no recipient name.";
173
+ readonly format: "icu-message";
174
+ readonly messageSource: "Recipient's name";
175
+ };
176
+ readonly streetLabel: {
177
+ readonly type: "string";
178
+ readonly title: "Street field label";
179
+ readonly format: "icu-message";
180
+ readonly messageSource: "Street";
181
+ };
182
+ readonly numberLabel: {
183
+ readonly type: "string";
184
+ readonly title: "Number field label";
185
+ readonly format: "icu-message";
186
+ readonly messageSource: "Number";
187
+ };
188
+ readonly complementLabel: {
189
+ readonly type: "string";
190
+ readonly title: "Complement field label";
191
+ readonly description: "Its \"(optional)\" is the only sign the field is optional.";
192
+ readonly format: "icu-message";
193
+ readonly messageSource: "Complement (optional)";
194
+ };
195
+ readonly neighborhoodLabel: {
196
+ readonly type: "string";
197
+ readonly title: "Neighborhood field label";
198
+ readonly format: "icu-message";
199
+ readonly messageSource: "Neighborhood";
200
+ };
201
+ readonly cityLabel: {
202
+ readonly type: "string";
203
+ readonly title: "City field label";
204
+ readonly format: "icu-message";
205
+ readonly messageSource: "City";
206
+ };
207
+ readonly stateLabel: {
208
+ readonly type: "string";
209
+ readonly title: "State field label";
210
+ readonly format: "icu-message";
211
+ readonly messageSource: "State";
212
+ };
213
+ readonly postalCodeLabel: {
214
+ readonly type: "string";
215
+ readonly title: "Postal code field label";
216
+ readonly format: "icu-message";
217
+ readonly messageSource: "Postal code";
218
+ };
219
+ readonly fieldRequiredMessage: {
220
+ readonly type: "string";
221
+ readonly title: "Field required message";
222
+ readonly description: "Shown under a required field left blank.";
223
+ readonly format: "icu-message";
224
+ readonly messageSource: "This field is required.";
225
+ };
226
+ readonly postalCodeInvalidMessage: {
227
+ readonly type: "string";
228
+ readonly title: "Postal code format message";
229
+ readonly description: "Shown under a postal code not in the selected country's format. Never contains the typed value.";
230
+ readonly format: "icu-message";
231
+ readonly messageSource: "Enter a valid postal code.";
232
+ };
233
+ readonly missingFieldsMessage: {
234
+ readonly type: "string";
235
+ readonly title: "Missing address fields message";
236
+ readonly description: "Shown when the server refuses an address without a postal code or a country.";
237
+ readonly format: "icu-message";
238
+ readonly messageSource: "Fill in the postal code and the country of your billing address.";
239
+ };
240
+ readonly invalidCountryMessage: {
241
+ readonly type: "string";
242
+ readonly title: "Invalid country message";
243
+ readonly description: "Shown when the server refuses the selected country.";
244
+ readonly format: "icu-message";
245
+ readonly messageSource: "Choose a valid country for your billing address.";
246
+ };
247
+ readonly genericErrorMessage: {
248
+ readonly type: "string";
249
+ readonly title: "Save failure message";
250
+ readonly description: "Shown when the save fails: a network failure or a fault the shopper cannot fix.";
251
+ readonly format: "icu-message";
252
+ readonly messageSource: "Unable to save your billing address. Please try again.";
253
+ };
254
+ };
255
+ };
256
+ };
175
257
  export declare const BillingAddressDefinition: ComponentDefinition<BillingAddressProps>;
176
- export declare function BillingAddress({ sameAsDeliveryLabel, defaultCountry, countryLabel, submitLabel, submitPendingLabel, requiredNoticeLabel, unsavedAddressNoticeLabel, billingMatchNoticeLabel, billingMatchNoticeVisible, recipientNameLabel, streetLabel, numberLabel, complementLabel, neighborhoodLabel, cityLabel, stateLabel, postalCodeLabel, fieldRequiredMessage, postalCodeInvalidMessage, disabled, className, $actions: $actionsProp, ...props }: BillingAddressProps): import("react/jsx-runtime").JSX.Element | null;
258
+ export declare function BillingAddress({ defaultCountry, billingMatchNoticeVisible, disabled, className, $actions: $actionsProp, $content, $locale, ...props }: BillingAddressProps): import("react/jsx-runtime").JSX.Element | null;
177
259
  //#endregion
178
260
  //# sourceMappingURL=billing-address.d.ts.map