@vtex/faststore 0.0.8 → 0.0.11

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 (568) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +0 -1
  3. package/dist/actions.json +48 -1
  4. package/dist/catalog.json +1397 -1594
  5. package/dist/cli/index.d.ts +66 -28
  6. package/dist/cli/index.js +7371 -512
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/cli/server-runtime.js +41 -60
  9. package/dist/cli/server-runtime.js.map +1 -1
  10. package/dist/client.d.ts +3 -3
  11. package/dist/client.js +2 -2
  12. package/dist/components.d.ts +67 -56
  13. package/dist/components.js +64 -53
  14. package/dist/content-types.json +5886 -555
  15. package/dist/core/dist/define-component.d.ts +7 -2
  16. package/dist/core/dist/define-content-type.d.ts +50 -2
  17. package/dist/core/dist/define-content-type.js +107 -3
  18. package/dist/core/dist/define-content-type.js.map +1 -1
  19. package/dist/core/dist/index.d.ts +2 -2
  20. package/dist/docs/access-code-field.md +1 -1
  21. package/dist/docs/access-code-sign-in.md +126 -77
  22. package/dist/docs/account-address-book.md +210 -95
  23. package/dist/docs/account-entry-point.md +4 -4
  24. package/dist/docs/account-menu.md +16 -17
  25. package/dist/docs/account-saved-cards.md +306 -0
  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 +157 -0
  30. package/dist/docs/buy-button.md +7 -8
  31. package/dist/docs/card-entry.md +42 -29
  32. package/dist/docs/card-summary.md +185 -0
  33. package/dist/docs/cardholder-document.md +5 -3
  34. package/dist/docs/carousel.md +5 -4
  35. package/dist/docs/cart-destination.md +251 -0
  36. package/dist/docs/cart-item.md +48 -15
  37. package/dist/docs/cart-totalizer.md +8 -6
  38. package/dist/docs/cart.md +240 -39
  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/footer-social.md +1 -1
  50. package/dist/docs/form.md +54 -18
  51. package/dist/docs/free-shipping-progress.md +18 -13
  52. package/dist/docs/identity-edit.md +8 -2
  53. package/dist/docs/identity-summary.md +18 -5
  54. package/dist/docs/incentives.md +2 -2
  55. package/dist/docs/installments.md +46 -32
  56. package/dist/docs/logo.md +1 -1
  57. package/dist/docs/my-account-profile.md +16 -11
  58. package/dist/docs/navigation-link.md +5 -3
  59. package/dist/docs/order-cancel.md +3 -1
  60. package/dist/docs/order-delivery-address.md +7 -5
  61. package/dist/docs/order-delivery-group.md +1 -3
  62. package/dist/docs/order-details-back.md +1 -1
  63. package/dist/docs/order-details-header.md +1 -4
  64. package/dist/docs/order-invoice-download.md +60 -0
  65. package/dist/docs/order-list-row.md +1 -1
  66. package/dist/docs/order-list-search.md +13 -20
  67. package/dist/docs/order-list-views.md +11 -17
  68. package/dist/docs/order-list.md +12 -5
  69. package/dist/docs/order-payment.md +9 -7
  70. package/dist/docs/order-placed-date.md +1 -1
  71. package/dist/docs/order-placed-payment-summary.md +28 -15
  72. package/dist/docs/order-placed.md +49 -14
  73. package/dist/docs/order-progress.md +1 -1
  74. package/dist/docs/order-status-badge.md +20 -9
  75. package/dist/docs/order-summary.md +2 -2
  76. package/dist/docs/order-tracking-link.md +58 -0
  77. package/dist/docs/payment-method-badges.md +32 -6
  78. package/dist/docs/payment-methods.md +2 -2
  79. package/dist/docs/payment.md +36 -17
  80. package/dist/docs/phone-field.md +4 -4
  81. package/dist/docs/place-order.md +84 -36
  82. package/dist/docs/postal-code-field.md +3 -1
  83. package/dist/docs/pricing.md +21 -23
  84. package/dist/docs/product-gallery.md +19 -20
  85. package/dist/docs/product-information.md +14 -10
  86. package/dist/docs/product-list.md +7 -6
  87. package/dist/docs/product-shelf.md +7 -1
  88. package/dist/docs/promotion.md +4 -2
  89. package/dist/docs/region.md +23 -15
  90. package/dist/docs/save-card.md +7 -6
  91. package/dist/docs/saved-cards.md +65 -36
  92. package/dist/docs/select.md +3 -4
  93. package/dist/docs/shipping-address.md +57 -21
  94. package/dist/docs/shipping-simulator.md +53 -15
  95. package/dist/docs/sign-in-disclosure.md +176 -0
  96. package/dist/docs/sign-in-form.md +78 -47
  97. package/dist/docs/sign-in-redirect.md +5 -3
  98. package/dist/docs/sign-in.md +173 -0
  99. package/dist/docs/toast.md +45 -16
  100. package/dist/docs/variant-selector.md +15 -11
  101. package/dist/graphql/types.d.ts +4 -14
  102. package/dist/index.d.ts +3 -2
  103. package/dist/internal/client.d.ts +4 -3
  104. package/dist/internal/client.js +5 -2
  105. package/dist/internal/server.d.ts +10 -5
  106. package/dist/internal/server.js +9 -4
  107. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
  108. package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
  109. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  110. package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
  111. package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
  112. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
  113. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
  114. package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
  115. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
  116. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
  117. package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
  118. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
  119. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
  120. package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
  121. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
  122. package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
  123. package/dist/matter/account-address-book/account-address-book.js +74 -33
  124. package/dist/matter/account-address-book/account-address-book.js.map +1 -1
  125. package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
  126. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
  127. package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
  128. package/dist/matter/account-address-book/account-address-country.js +83 -49
  129. package/dist/matter/account-address-book/account-address-country.js.map +1 -1
  130. package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
  131. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
  132. package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
  133. package/dist/matter/account-address-book/account-address-form.js +518 -155
  134. package/dist/matter/account-address-book/account-address-form.js.map +1 -1
  135. package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
  136. package/dist/matter/account-address-book/account-address-record.js +32 -17
  137. package/dist/matter/account-address-book/account-address-record.js.map +1 -1
  138. package/dist/matter/account-menu/account-menu.d.ts +34 -17
  139. package/dist/matter/account-menu/account-menu.js +46 -54
  140. package/dist/matter/account-menu/account-menu.js.map +1 -1
  141. package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
  142. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +463 -0
  143. package/dist/matter/account-saved-cards/account-saved-cards.js +1011 -0
  144. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
  145. package/dist/matter/billing-address/billing-address.d.ts +156 -74
  146. package/dist/matter/billing-address/billing-address.js +227 -156
  147. package/dist/matter/billing-address/billing-address.js.map +1 -1
  148. package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
  149. package/dist/matter/breadcrumb/breadcrumb.js +24 -9
  150. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  151. package/dist/matter/buy-button/buy-button.d.ts +8 -11
  152. package/dist/matter/buy-button/buy-button.js +10 -19
  153. package/dist/matter/buy-button/buy-button.js.map +1 -1
  154. package/dist/matter/card-entry/card-capture.js +12 -4
  155. package/dist/matter/card-entry/card-capture.js.map +1 -1
  156. package/dist/matter/card-entry/card-entry.d.ts +123 -32
  157. package/dist/matter/card-entry/card-entry.js +348 -221
  158. package/dist/matter/card-entry/card-entry.js.map +1 -1
  159. package/dist/matter/cart/cart-namespace.d.ts +11 -1
  160. package/dist/matter/cart/cart-namespace.js +11 -1
  161. package/dist/matter/cart/cart-namespace.js.map +1 -1
  162. package/dist/matter/cart/cart.d.ts +416 -45
  163. package/dist/matter/cart/cart.js +782 -101
  164. package/dist/matter/cart/cart.js.map +1 -1
  165. package/dist/matter/cart-destination/cart-destination.d.ts +233 -0
  166. package/dist/matter/cart-destination/cart-destination.js +703 -0
  167. package/dist/matter/cart-destination/cart-destination.js.map +1 -0
  168. package/dist/matter/cart-item/cart-item.d.ts +145 -16
  169. package/dist/matter/cart-item/cart-item.js +230 -54
  170. package/dist/matter/cart-item/cart-item.js.map +1 -1
  171. package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
  172. package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
  173. package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
  174. package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
  175. package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
  176. package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
  177. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
  178. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
  179. package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
  180. package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
  181. package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
  182. package/dist/matter/cart-totalizer/cart-totalizer.js +49 -19
  183. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  184. package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
  185. package/dist/matter/challenge-return/challenge-return.js +241 -0
  186. package/dist/matter/challenge-return/challenge-return.js.map +1 -0
  187. package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
  188. package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
  189. package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
  190. package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
  191. package/dist/matter/client-preferences/client-preferences.js +84 -15
  192. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  193. package/dist/matter/client-profile/client-profile.d.ts +44 -9
  194. package/dist/matter/client-profile/client-profile.js +64 -24
  195. package/dist/matter/client-profile/client-profile.js.map +1 -1
  196. package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
  197. package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
  198. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  199. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
  200. package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
  201. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
  202. package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
  203. package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
  204. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
  205. package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
  206. package/dist/matter/delivery-options/delivery-options.js +75 -12
  207. package/dist/matter/delivery-options/delivery-options.js.map +1 -1
  208. package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
  209. package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
  210. package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
  211. package/dist/matter/email-identification/email-identification.d.ts +25 -3
  212. package/dist/matter/email-identification/email-identification.js +49 -12
  213. package/dist/matter/email-identification/email-identification.js.map +1 -1
  214. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +85 -10
  215. package/dist/matter/free-shipping-progress/free-shipping-progress.js +153 -53
  216. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  217. package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
  218. package/dist/matter/identity-edit/identity-edit.js +47 -19
  219. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  220. package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
  221. package/dist/matter/identity-summary/identity-summary.js +95 -45
  222. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  223. package/dist/matter/installments/installments-select.d.ts +98 -16
  224. package/dist/matter/installments/installments-select.js +156 -48
  225. package/dist/matter/installments/installments-select.js.map +1 -1
  226. package/dist/matter/installments/installments.d.ts +96 -16
  227. package/dist/matter/installments/installments.js +115 -40
  228. package/dist/matter/installments/installments.js.map +1 -1
  229. package/dist/matter/installments/use-installments-selection.d.ts +1 -0
  230. package/dist/matter/installments/use-installments-selection.js +8 -3
  231. package/dist/matter/installments/use-installments-selection.js.map +1 -1
  232. package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
  233. package/dist/matter/my-account-profile/my-account-profile.js +370 -174
  234. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  235. package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
  236. package/dist/matter/order-cancel/order-cancel.js +118 -51
  237. package/dist/matter/order-cancel/order-cancel.js.map +1 -1
  238. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
  239. package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
  240. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
  241. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
  242. package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
  243. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
  244. package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
  245. package/dist/matter/order-details-header/order-details-header.js +66 -58
  246. package/dist/matter/order-details-header/order-details-header.js.map +1 -1
  247. package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
  248. package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
  249. package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
  250. package/dist/matter/order-list/order-list.d.ts +164 -19
  251. package/dist/matter/order-list/order-list.js +229 -87
  252. package/dist/matter/order-list/order-list.js.map +1 -1
  253. package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
  254. package/dist/matter/order-list-row/order-list-row.js +3 -2
  255. package/dist/matter/order-list-row/order-list-row.js.map +1 -1
  256. package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
  257. package/dist/matter/order-list-search/order-list-search.js +30 -69
  258. package/dist/matter/order-list-search/order-list-search.js.map +1 -1
  259. package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
  260. package/dist/matter/order-list-views/order-list-views.js +22 -68
  261. package/dist/matter/order-list-views/order-list-views.js.map +1 -1
  262. package/dist/matter/order-payment/order-payment.d.ts +33 -10
  263. package/dist/matter/order-payment/order-payment.js +44 -39
  264. package/dist/matter/order-payment/order-payment.js.map +1 -1
  265. package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
  266. package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
  267. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
  268. package/dist/matter/order-placed/order-placed.d.ts +198 -31
  269. package/dist/matter/order-placed/order-placed.js +230 -139
  270. package/dist/matter/order-placed/order-placed.js.map +1 -1
  271. package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
  272. package/dist/matter/order-placed-date/order-placed-date.js +7 -8
  273. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
  274. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
  275. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
  276. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  277. package/dist/matter/order-progress/order-progress.d.ts +19 -8
  278. package/dist/matter/order-progress/order-progress.js +37 -45
  279. package/dist/matter/order-progress/order-progress.js.map +1 -1
  280. package/dist/matter/order-summary/order-summary.d.ts +19 -9
  281. package/dist/matter/order-summary/order-summary.js +38 -44
  282. package/dist/matter/order-summary/order-summary.js.map +1 -1
  283. package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
  284. package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
  285. package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
  286. package/dist/matter/payment/payment-card-capture.js +17 -10
  287. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  288. package/dist/matter/payment/payment-controller.d.ts +4 -2
  289. package/dist/matter/payment/payment-controller.js +30 -9
  290. package/dist/matter/payment/payment-controller.js.map +1 -1
  291. package/dist/matter/payment/payment-method-badges.js +1 -1
  292. package/dist/matter/payment/payment.d.ts +69 -19
  293. package/dist/matter/payment/payment.js +101 -35
  294. package/dist/matter/payment/payment.js.map +1 -1
  295. package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
  296. package/dist/matter/payment/use-payment-method-selection.js +94 -32
  297. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  298. package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
  299. package/dist/matter/payment/use-payment-submit-gate.js +47 -8
  300. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  301. package/dist/matter/place-order/place-order.d.ts +171 -57
  302. package/dist/matter/place-order/place-order.js +376 -185
  303. package/dist/matter/place-order/place-order.js.map +1 -1
  304. package/dist/matter/pricing/pricing.d.ts +152 -13
  305. package/dist/matter/pricing/pricing.js +153 -52
  306. package/dist/matter/pricing/pricing.js.map +1 -1
  307. package/dist/matter/product-information/product-information.d.ts +27 -4
  308. package/dist/matter/product-information/product-information.js +32 -15
  309. package/dist/matter/product-information/product-information.js.map +1 -1
  310. package/dist/matter/product-list/product-list.d.ts +24 -6
  311. package/dist/matter/product-list/product-list.js +32 -26
  312. package/dist/matter/product-list/product-list.js.map +1 -1
  313. package/dist/matter/product-shelf/product-shelf.d.ts +8 -3
  314. package/dist/matter/product-shelf/product-shelf.js +111 -10
  315. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  316. package/dist/matter/region/region.d.ts +33 -16
  317. package/dist/matter/region/region.js +59 -52
  318. package/dist/matter/region/region.js.map +1 -1
  319. package/dist/matter/save-card/save-card.d.ts +43 -8
  320. package/dist/matter/save-card/save-card.js +61 -23
  321. package/dist/matter/save-card/save-card.js.map +1 -1
  322. package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
  323. package/dist/matter/saved-cards/saved-cards.js +349 -77
  324. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  325. package/dist/matter/shipping-address/address-payload.js +25 -0
  326. package/dist/matter/shipping-address/address-payload.js.map +1 -0
  327. package/dist/matter/shipping-address/country-descriptors.js +71 -71
  328. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  329. package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
  330. package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
  331. package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
  332. package/dist/matter/shipping-address/shipping-address.js +443 -188
  333. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  334. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +251 -25
  335. package/dist/matter/shipping-simulator/shipping-simulator.js +261 -51
  336. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  337. package/dist/matter/sign-in/sign-in.d.ts +108 -0
  338. package/dist/matter/sign-in/sign-in.js +285 -0
  339. package/dist/matter/sign-in/sign-in.js.map +1 -0
  340. package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
  341. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
  342. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
  343. package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
  344. package/dist/matter/sign-in-form/sign-in-form.js +134 -144
  345. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
  346. package/dist/particles/binding-switcher/binding-switcher.d.ts +59 -0
  347. package/dist/particles/binding-switcher/binding-switcher.js +194 -0
  348. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
  349. package/dist/particles/card-summary/card-network.d.ts +17 -0
  350. package/dist/particles/card-summary/card-network.js +25 -0
  351. package/dist/particles/card-summary/card-network.js.map +1 -0
  352. package/dist/particles/card-summary/card-summary.d.ts +113 -0
  353. package/dist/particles/card-summary/card-summary.js +221 -0
  354. package/dist/particles/card-summary/card-summary.js.map +1 -0
  355. package/dist/particles/carousel/carousel.d.ts +99 -11
  356. package/dist/particles/carousel/carousel.js +103 -35
  357. package/dist/particles/carousel/carousel.js.map +1 -1
  358. package/dist/particles/copy-text/copy-text.js +5 -15
  359. package/dist/particles/copy-text/copy-text.js.map +1 -1
  360. package/dist/particles/dialog/dialog.d.ts +14 -6
  361. package/dist/particles/dialog/dialog.js +6 -3
  362. package/dist/particles/dialog/dialog.js.map +1 -1
  363. package/dist/particles/drawer/drawer.js +1 -1
  364. package/dist/particles/drawer/drawer.js.map +1 -1
  365. package/dist/particles/email-field/email-field.d.ts +2 -1
  366. package/dist/particles/email-field/email-field.js +2 -1
  367. package/dist/particles/email-field/email-field.js.map +1 -1
  368. package/dist/particles/footer-link-group/footer-link-group.js +1 -0
  369. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  370. package/dist/particles/footer-social/footer-social.d.ts +1 -1
  371. package/dist/particles/footer-social/footer-social.js +1 -1
  372. package/dist/particles/footer-social/footer-social.js.map +1 -1
  373. package/dist/particles/form/form.d.ts +85 -13
  374. package/dist/particles/form/form.js +91 -42
  375. package/dist/particles/form/form.js.map +1 -1
  376. package/dist/particles/gallery/gallery.d.ts +129 -12
  377. package/dist/particles/gallery/gallery.js +121 -34
  378. package/dist/particles/gallery/gallery.js.map +1 -1
  379. package/dist/particles/incentives/incentives.d.ts +1 -1
  380. package/dist/particles/incentives/incentives.js +1 -1
  381. package/dist/particles/incentives/incentives.js.map +1 -1
  382. package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
  383. package/dist/particles/order-details-back/order-details-back.js +8 -10
  384. package/dist/particles/order-details-back/order-details-back.js.map +1 -1
  385. package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
  386. package/dist/particles/order-status-badge/order-status-badge.js +4 -20
  387. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
  388. package/dist/particles/password-field/password-field.d.ts +1 -1
  389. package/dist/particles/password-field/password-field.js +2 -4
  390. package/dist/particles/password-field/password-field.js.map +1 -1
  391. package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
  392. package/dist/particles/payment-methods/payment-methods.js +1 -1
  393. package/dist/particles/payment-methods/payment-methods.js.map +1 -1
  394. package/dist/particles/phone-field/phone-field.d.ts +4 -4
  395. package/dist/particles/phone-field/phone-field.js +8 -11
  396. package/dist/particles/phone-field/phone-field.js.map +1 -1
  397. package/dist/particles/spinner/spinner.d.ts +24 -4
  398. package/dist/particles/spinner/spinner.js +25 -9
  399. package/dist/particles/spinner/spinner.js.map +1 -1
  400. package/dist/particles/switch/switch.d.ts +4 -1
  401. package/dist/particles/switch/switch.js +3 -1
  402. package/dist/particles/switch/switch.js.map +1 -1
  403. package/dist/particles/toast/toast.d.ts +49 -9
  404. package/dist/particles/toast/toast.js +81 -15
  405. package/dist/particles/toast/toast.js.map +1 -1
  406. package/dist/schema.graphql +461 -89
  407. package/dist/sdk/actions/index.d.ts +3 -1
  408. package/dist/sdk/actions/index.js +3 -1
  409. package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
  410. package/dist/sdk/actions/locale-action-provider.js +20 -0
  411. package/dist/sdk/actions/locale-action-provider.js.map +1 -0
  412. package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
  413. package/dist/sdk/actions/saved-card-action-provider.js +16 -0
  414. package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
  415. package/dist/sdk/actions/types.d.ts +6 -2
  416. package/dist/sdk/address/address-fields.js +4 -4
  417. package/dist/sdk/address/address-fields.js.map +1 -1
  418. package/dist/sdk/address/constants.js +1 -6
  419. package/dist/sdk/address/constants.js.map +1 -1
  420. package/dist/sdk/address/messages.js +44 -44
  421. package/dist/sdk/address/messages.js.map +1 -1
  422. package/dist/sdk/address/postal-code.js +15 -2
  423. package/dist/sdk/address/postal-code.js.map +1 -1
  424. package/dist/sdk/address/types.d.ts +5 -3
  425. package/dist/sdk/address/validate-address.js +3 -3
  426. package/dist/sdk/address/validate-address.js.map +1 -1
  427. package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
  428. package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
  429. package/dist/sdk/cache/storefront-cache.js +2 -1
  430. package/dist/sdk/cache/storefront-cache.js.map +1 -1
  431. package/dist/sdk/cart/operations.d.ts +2 -1
  432. package/dist/sdk/cart/operations.js +55 -1
  433. package/dist/sdk/cart/operations.js.map +1 -1
  434. package/dist/sdk/cart/optimistic.d.ts +30 -7
  435. package/dist/sdk/cart/optimistic.js +78 -41
  436. package/dist/sdk/cart/optimistic.js.map +1 -1
  437. package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
  438. package/dist/sdk/cart/use-cart-actions.js +61 -15
  439. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  440. package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
  441. package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
  442. package/dist/sdk/data/index.js +2 -2
  443. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  444. package/dist/sdk/generated/gql.js +16 -12
  445. package/dist/sdk/generated/gql.js.map +1 -1
  446. package/dist/sdk/generated/graphql.d.ts +197 -51
  447. package/dist/sdk/generated/graphql.js +2318 -91
  448. package/dist/sdk/generated/graphql.js.map +1 -1
  449. package/dist/sdk/i18n/format-error-code.js +23 -0
  450. package/dist/sdk/i18n/format-error-code.js.map +1 -0
  451. package/dist/sdk/i18n/message-formatter.d.ts +22 -0
  452. package/dist/sdk/i18n/message-formatter.js +140 -0
  453. package/dist/sdk/i18n/message-formatter.js.map +1 -0
  454. package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
  455. package/dist/sdk/i18n/use-message-formatter.js +18 -0
  456. package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
  457. package/dist/sdk/identity/use-identity-actions.js.map +1 -1
  458. package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
  459. package/dist/sdk/locale/binding-switch-provider.js +20 -0
  460. package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
  461. package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
  462. package/dist/sdk/locale/use-locale-actions.js +70 -0
  463. package/dist/sdk/locale/use-locale-actions.js.map +1 -0
  464. package/dist/sdk/navigation/binding-switch.d.ts +39 -0
  465. package/dist/sdk/navigation/binding-switch.js +129 -0
  466. package/dist/sdk/navigation/binding-switch.js.map +1 -0
  467. package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
  468. package/dist/sdk/navigation/decode-route-params.js +32 -0
  469. package/dist/sdk/navigation/decode-route-params.js.map +1 -0
  470. package/dist/sdk/navigation/redirect.d.ts +2 -0
  471. package/dist/sdk/navigation/redirect.js +19 -1
  472. package/dist/sdk/navigation/redirect.js.map +1 -1
  473. package/dist/sdk/navigation/types.d.ts +13 -0
  474. package/dist/sdk/payment/bin-format.js +20 -0
  475. package/dist/sdk/payment/bin-format.js.map +1 -0
  476. package/dist/sdk/payment/challenge-return.js +37 -0
  477. package/dist/sdk/payment/challenge-return.js.map +1 -0
  478. package/dist/sdk/payment/confirmation-last-four.js +39 -0
  479. package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
  480. package/dist/sdk/payment/gateway.d.ts +1 -1
  481. package/dist/sdk/payment/gateway.js +8 -2
  482. package/dist/sdk/payment/gateway.js.map +1 -1
  483. package/dist/sdk/payment/operations.d.ts +1 -0
  484. package/dist/sdk/payment/operations.js +28 -6
  485. package/dist/sdk/payment/operations.js.map +1 -1
  486. package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
  487. package/dist/sdk/payment/resumed-purchase.js +119 -0
  488. package/dist/sdk/payment/resumed-purchase.js.map +1 -0
  489. package/dist/sdk/payment/security-code-mask.js +16 -23
  490. package/dist/sdk/payment/security-code-mask.js.map +1 -1
  491. package/dist/sdk/payment/submission-registry.js +6 -2
  492. package/dist/sdk/payment/submission-registry.js.map +1 -1
  493. package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
  494. package/dist/sdk/payment/use-payment-actions.js +23 -3
  495. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  496. package/dist/sdk/payment/use-place-order.d.ts +10 -2
  497. package/dist/sdk/payment/use-place-order.js +138 -76
  498. package/dist/sdk/payment/use-place-order.js.map +1 -1
  499. package/dist/sdk/provider/storefront-provider.d.ts +1 -7
  500. package/dist/sdk/provider/storefront-provider.js +4 -11
  501. package/dist/sdk/provider/storefront-provider.js.map +1 -1
  502. package/dist/sdk/saved-cards/operations.d.ts +16 -0
  503. package/dist/sdk/saved-cards/operations.js +41 -0
  504. package/dist/sdk/saved-cards/operations.js.map +1 -0
  505. package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
  506. package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
  507. package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
  508. package/dist/sdk/seo/entity-landing.d.ts +24 -0
  509. package/dist/sdk/seo/entity-landing.js +30 -0
  510. package/dist/sdk/seo/entity-landing.js.map +1 -0
  511. package/dist/sdk/seo/page-alternates.d.ts +8 -5
  512. package/dist/sdk/seo/page-alternates.js +11 -14
  513. package/dist/sdk/seo/page-alternates.js.map +1 -1
  514. package/dist/sdk/seo/search-landing.d.ts +42 -0
  515. package/dist/sdk/seo/search-landing.js +85 -0
  516. package/dist/sdk/seo/search-landing.js.map +1 -0
  517. package/dist/sdk/session/mock-session.d.ts +9 -0
  518. package/dist/sdk/session/mock-session.js +31 -0
  519. package/dist/sdk/session/mock-session.js.map +1 -0
  520. package/dist/sdk/session/read-server-session.d.ts +3 -0
  521. package/dist/sdk/session/read-server-session.js +5 -0
  522. package/dist/sdk/session/read-server-session.js.map +1 -1
  523. package/dist/sdk/session/return-path-segment.d.ts +10 -0
  524. package/dist/sdk/session/return-path-segment.js +15 -0
  525. package/dist/sdk/session/return-path-segment.js.map +1 -0
  526. package/dist/sdk/session/use-session-actions.js.map +1 -1
  527. package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
  528. package/dist/sdk/shipping/shipping-operations.js +13 -0
  529. package/dist/sdk/shipping/shipping-operations.js.map +1 -1
  530. package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
  531. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
  532. package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
  533. package/dist/sdk/state/cart.d.ts +9 -2
  534. package/dist/sdk/state/cart.js +9 -2
  535. package/dist/sdk/state/cart.js.map +1 -1
  536. package/dist/utils/safe-href.d.ts +2 -0
  537. package/package.json +4 -3
  538. package/skills/storefront-asset/SKILL.md +2 -2
  539. package/skills/storefront-asset/references/api-side.md +27 -14
  540. package/skills/storefront-asset/references/findings.md +5 -2
  541. package/src/styles/tailwind.css +9 -2
  542. package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
  543. package/dist/message-locales.json +0 -7
  544. package/dist/sdk/i18n/client.d.ts +0 -4
  545. package/dist/sdk/i18n/client.js +0 -4
  546. package/dist/sdk/i18n/locales.d.ts +0 -8
  547. package/dist/sdk/i18n/locales.js +0 -57
  548. package/dist/sdk/i18n/locales.js.map +0 -1
  549. package/dist/sdk/i18n/messages/en-US.js +0 -164
  550. package/dist/sdk/i18n/messages/en-US.js.map +0 -1
  551. package/dist/sdk/i18n/messages/en-US.json +0 -159
  552. package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -163
  553. package/dist/sdk/i18n/messages/es-ES.js +0 -164
  554. package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
  555. package/dist/sdk/i18n/messages/es-ES.json +0 -159
  556. package/dist/sdk/i18n/messages/pt-BR.js +0 -164
  557. package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
  558. package/dist/sdk/i18n/messages/pt-BR.json +0 -159
  559. package/dist/sdk/i18n/provider.d.ts +0 -1
  560. package/dist/sdk/i18n/provider.js +0 -30
  561. package/dist/sdk/i18n/provider.js.map +0 -1
  562. package/dist/sdk/i18n/server.d.ts +0 -28
  563. package/dist/sdk/i18n/server.js +0 -59
  564. package/dist/sdk/i18n/server.js.map +0 -1
  565. package/dist/utils/resolve-authored-copy.js +0 -18
  566. package/dist/utils/resolve-authored-copy.js.map +0 -1
  567. package/dist/utils/substitute-template.js +0 -33
  568. package/dist/utils/substitute-template.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"place-order.js","names":[],"sources":["../../../src/matter/place-order/place-order.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport { type ComponentPropsWithRef, useEffect, useId, useLayoutEffect, useState } from 'react';\nimport { Button } from '../../particles/button/button.js';\nimport { 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 type { PageRef } from '../../sdk/navigation/types.js';\nimport { useStorefrontNavigation } from '../../sdk/navigation/use-storefront-navigation.js';\nimport type { PaymentUserError } from '../../sdk/payment/operations.js';\nimport { type PlaceOrderData, type UsePlaceOrder, usePlaceOrder } from '../../sdk/payment/use-place-order.js';\nimport { resolveSiteRelativeHref, type SafeHrefRejection } from '../../utils/safe-href.js';\nimport { usePayment } from '../payment/payment.js';\nimport { refusalTargetOf, usePaymentSubmitGate } from '../payment/use-payment-submit-gate.js';\n\n/**\n * The `PlaceOrder` CTA matter (specs/place-order.md, T14 of the Credit Card epic;\n * docs/features/credit-card/rfc.md § D9). Drives T13's `usePlaceOrder` orchestration hook and renders\n * the three v1 states the RFC names: the idle CTA, a blocking loading state while the three-call\n * sequence runs, and an inline outcome (error or success) once it settles.\n *\n * **Composes as a sibling of the card entry (T7) and the saved cards list (T12) under the payment\n * root, never nested inside either.** That placement is what lets this one CTA serve both the\n * new-card and saved-card paths — nesting it inside a card form, as the legacy `CardForm` does,\n * would force a second CTA for the saved-card path. This is a documented authoring convention, not a\n * compiler guarantee: `requiresContext: 'payment'` (ADR-0009) only fails the build when *no* ancestor\n * at any depth declares `providesContext: 'payment'` — there is no `forbidsAncestor` token, so a\n * schema that nests this component inside `CardEntry`/`SavedCards` instead of beside them still\n * compiles and still resolves the context from the payment root further up. This component throws\n * at runtime only when rendered entirely outside a `PaymentSectionRoot`/`Controller` subtree — both\n * `usePayment()` (read directly below, for `draft.billingAddressDifferent`) and `usePlaceOrder` (via\n * the submission channel those roots provide) enforce that guard, with `usePayment()` throwing first\n * since its value feeds `usePlaceOrder`'s own argument — a real, load-bearing guard, but a weaker one\n * than \"must be a sibling.\" See specs/place-order.md's open items for this gap.\n *\n * **This component never touches card data.** It declares its own thin fragment for the read-model\n * slice `usePlaceOrder` needs (`selectedMethodId`, `selectedInstallment`, `methods` — ADR-0011,\n * mirroring `PaymentSummaryData`/`PaymentSectionData`) and forwards it plus `$actions` straight into\n * the hook. The one fact it reads off `usePayment()`'s context directly is `draft.billingAddressDifferent`\n * (T11's widening of `PaymentDraft`), forwarded into `usePlaceOrder`'s own optional argument of the\n * same name so the gateway descriptor carries the shopper's choice (fix pass, PR #544 review F1) —\n * still not a card field, since `PaymentDraft` never carries one. `usePaymentSubmitGate()` (T24)\n * resolves the client-side document/billing refusal off that same context and is forwarded as\n * `usePlaceOrder`'s `submitGate` argument — an opaque `PaymentUserError | null`, never the facts\n * behind it. The hook already owns `placing`, `userErrors`, and `orderId` — including releasing\n * `placing` on every failure path — so this component only reflects that state, never re-implements it.\n *\n * `attempted` is the one bit of state this component adds, and it is not a duplicate of anything the\n * hook owns: `usePlaceOrder`'s `userErrors: []` is both the pre-attempt state and the settled-success\n * state (T13 does not disambiguate the two, by design — see `UsePlaceOrder`'s doc), so distinguishing\n * \"never attempted\" from \"attempted and succeeded\" is exactly this component's job. `succeeded` is\n * derived, not stored: `attempted && !placing && userErrors.length === 0`.\n *\n * **T29 widens both `succeeded` and the button label with the surviving `attempt` record read off\n * `usePayment()`** (specs/make-an-order-attempt-survive-a.md), never mirrored into local state:\n * `attempted`/`userErrors`/`orderId` all restart at their pre-attempt defaults on every mount, but the\n * attempt record does not, so a remount renders its truth rather than this instance's own fresh state.\n * `succeeded` is `true` whenever the record's own phase is `'settled'`, independent of `attempted`; the\n * button shows `resumeLabel` instead of `label` whenever the phase is `'sent'` or `'unresolved'` — the\n * card already left the browser (or its fate is unknown) and the next click finalizes it through\n * `usePlaceOrder`'s `resume()` rather than opening a new transaction.\n *\n * The button disables on `placing` (the required blocking state) and, deliberately, on `succeeded`\n * too — an already-placed order has nothing left to submit, and a second click risks exactly the\n * duplicate-transaction outcome T13's own concurrency guard (Decision 6) calls \"the worst outcome\n * this task's surface has\". `usePlaceOrder`'s in-flight ref is the inner guard; this is the outer one.\n * Fix pass, finding S-F1: it also disables on the *shared* `usePayment().placing`, since a second\n * composed `PlaceOrder` has no other way to learn a sibling instance already opened a transaction —\n * each `usePlaceOrder()` call owns its own, independent `inFlight` ref.\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — raw template literal, matching the merged `payment`/`payment-summary` siblings:\n// the codegen `documents` glob does not scan `src/matter/place-order*`, so the typed `graphql()`\n// factory is unavailable here; `data-component-contract.test.ts` validates this fragment against the\n// real schema and the built catalog.\n//\n// Selects exactly the three fields `PlaceOrderData` (sdk/payment/use-place-order.ts) needs — nothing\n// from `PaymentSectionData` is re-selected, and nothing card-shaped is ever in scope.\n// ---------------------------------------------------------------------------\n\nconst fragment = /* GraphQL */ `\n fragment PlaceOrderData on Query {\n payment {\n __typename\n id\n selectedMethodId\n selectedInstallment {\n __typename\n count\n value {\n amount\n currencyCode\n }\n interestRate\n }\n methods {\n __typename\n id\n groupName\n }\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport type PlaceOrderProps = ComponentPropsWithRef<'div'> & {\n /** CTA label while idle. */\n label?: string;\n /** CTA label while the three-call sequence is in flight. */\n placingLabel?: string;\n /** Status message shown beside the button for as long as the order is being placed. Absent or blank renders nothing. */\n placingMessage?: string;\n /**\n * CTA label while a surviving attempt (T29) offers a resume — the card already left the browser\n * (`sent`) or its fate is unknown (`unresolved`), and the next click finalizes it rather than running\n * the full sequence again. Shown instead of `label`, never alongside `placingLabel` (mutually\n * exclusive — `placing` takes priority whenever both could apply).\n */\n resumeLabel?: string;\n /** Inline message shown once the sequence has settled with no `userErrors`. */\n successMessage?: string;\n /** Shown when `placeOrder()` is invoked with no registered submission for the current path. */\n missingSubmissionMessage?: string;\n /** Shown when no payment method is selected yet. */\n missingMethodMessage?: string;\n /** Shown when `startTransaction` resolves incomplete transaction data. */\n invalidTransactionMessage?: string;\n /** Shown for an infrastructure-level failure reaching the payment gateway action. */\n networkErrorMessage?: string;\n /** Shown when the selected method requires a cardholder document and none is set. */\n missingDocumentMessage?: string;\n /** Shown when the typed cardholder document fails validation. */\n invalidDocumentMessage?: string;\n /**\n * Shown instead of the two document messages above when the selected method calls for a cardholder\n * document the page is not showing — a method the card form cannot pay with, or one outside the\n * section's `group` — so the shopper has to choose another payment method (T192).\n */\n unavailableMethodMessage?: string;\n /** Shown when the shopper declined \"same as delivery\" but never saved a billing address. */\n unsavedBillingAddressMessage?: string;\n /** Shown when the new-card draft itself fails validation before ever reaching the gateway. */\n invalidCardDataMessage?: string;\n /** Shown when the typed card number is well-formed but no payment network the store accepts claims it (T47). */\n unsupportedNetworkMessage?: string;\n /** Shown when a saved-card submission is refused for a missing or invalid CVV. */\n invalidSecurityCodeMessage?: string;\n /** Shown when the payment gateway itself refuses the submitted card. */\n gatewayErrorMessage?: string;\n /**\n * Shown when a click lands on an order-placement attempt whose own sequence is still running — a\n * transaction this instance did not open, and which nothing here may finalize or re-run (T170).\n */\n inFlightMessage?: string;\n /**\n * Shown when the payment was handed to the gateway but the order could not be confirmed, so it may still be\n * processing (T176). Rendered as a status, never as the error alert.\n */\n unconfirmedMessage?: string;\n /**\n * Where the shopper lands after a successful placement. A page reference gets the placed order's\n * group as its `orderGroup` param. A string is a logical path of this store, navigated as written;\n * an absolute, protocol-relative, or non-http(s) value, or a `{orderGroup}` template, is refused\n * rather than navigated to (fail closed, dev-only warn).\n * e.g. `{ standard: 'order-placed' }`\n */\n successHref?: PageRef | string;\n /** `Payment` slice forwarded by the reactive runtime (arity-1, ADR-0015) — `null` until it resolves. */\n $data?: PlaceOrderData;\n /** Compiler-injected action surface; carries `payment.startTransaction`, `payment.gatewayCallback`, `analytics.track`. */\n $actions?: ComponentActions;\n};\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const PlaceOrderDefinition = defineComponent<PlaceOrderProps>({\n name: 'PlaceOrder',\n importPath: '@vtex/faststore/components',\n component: PlaceOrder,\n fragment,\n fetchStrategy: 'reactive',\n actions: { payment: ['startTransaction', 'gatewayCallback'], analytics: ['track'] },\n requiresContext: 'payment',\n editor: { label: 'Place Order', category: 'commerce' },\n schema: {\n // Literals, not shared constants: the native catalog builder extracts `schema` statically and\n // silently drops an identifier-valued default (place-order.test.tsx asserts the built catalog\n // keeps every one of them, mirroring payment.tsx's group-default guard).\n label: { type: 'string', default: 'Place order', label: 'Button label' },\n placingLabel: { type: 'string', default: 'Placing order...', label: 'Button label while placing' },\n // No default on purpose: absent means no surface, so a store that does not author it renders today's markup.\n placingMessage: { type: 'string', label: 'Message shown while placing the order' },\n resumeLabel: {\n type: 'string',\n default: 'Complete your order',\n label: 'Button label while a surviving attempt offers a resume',\n },\n successMessage: { type: 'string', default: 'Order placed successfully.', label: 'Success message' },\n // T31 (specs/make-the-payment-components-authored-copy.md, FR-4, Decision 1) — one prop per\n // client-synthesized PaymentUserError code this CTA's alert can render, each defaulting to that\n // error's current, unchanged `message` (Decision 11 — the module-level constants that produce\n // these codes elsewhere in the payment surface keep their own message verbatim).\n missingSubmissionMessage: {\n type: 'string',\n default: 'Enter your payment details before placing the order.',\n label: 'Missing payment submission message',\n },\n missingMethodMessage: {\n type: 'string',\n default: 'Choose a payment method before placing the order.',\n label: 'Missing payment method message',\n },\n invalidTransactionMessage: {\n type: 'string',\n default: 'Unable to start the payment. Please try again.',\n label: 'Invalid transaction message',\n },\n networkErrorMessage: {\n type: 'string',\n default: 'Unable to complete the request. Please try again.',\n label: 'Network error message',\n },\n missingDocumentMessage: {\n type: 'string',\n default: 'Enter your document before placing the order.',\n label: 'Missing document message',\n },\n invalidDocumentMessage: {\n type: 'string',\n default: 'Enter a valid document before placing the order.',\n label: 'Invalid document message',\n },\n unavailableMethodMessage: {\n type: 'string',\n default: 'Choose another payment method before placing the order.',\n label: 'Unavailable payment method message',\n },\n unsavedBillingAddressMessage: {\n type: 'string',\n default: 'Save your billing address before placing the order.',\n label: 'Unsaved billing address message',\n },\n invalidCardDataMessage: {\n type: 'string',\n default: 'Enter valid card details before placing the order.',\n label: 'Invalid card data message',\n },\n unsupportedNetworkMessage: {\n type: 'string',\n default: 'This card is not from a network the store accepts. Use another card or choose another payment method.',\n label: 'Unsupported card network message',\n },\n invalidSecurityCodeMessage: {\n type: 'string',\n default: 'Enter a valid security code before placing the order.',\n label: 'Invalid security code message',\n },\n gatewayErrorMessage: {\n type: 'string',\n default: 'Unable to complete the payment. Please try again.',\n label: 'Gateway error message',\n },\n inFlightMessage: {\n type: 'string',\n default: 'This order is already being placed. Please wait.',\n label: 'Order already in flight message',\n },\n unconfirmedMessage: {\n type: 'string',\n default: 'We could not confirm your order yet. Your payment may still be processing, so please do not pay again.',\n label: 'Unconfirmed order message',\n },\n successHref: {\n type: 'link',\n default: { standard: 'order-placed' },\n fills: ['orderGroup'],\n label: 'Confirmation Page',\n },\n },\n guideline:\n \"The place-order CTA: invokes usePlaceOrder's three-call sequence (start transaction, the registered submission's own direct-to-gateway leg, then the gateway callback) and blocks interaction while it runs. Compose it as a sibling — never a child — of every other payment-entry leaf under the same PaymentSectionRoot or PaymentSectionController, so the one CTA serves every entry path. Renders one inline outcome after settling: the first userError's message, or successMessage on a clean settle. While the order is being placed it renders nothing but the button, unless placingMessage is set: then a status message shows beside the button, and the rest of the payment form is blocked for as long as it shows. This component reaches no payment-sensitive input. Must be inside a payment root. See place-order.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/** The default confirmation page. */\nconst ORDER_PLACED_PAGE: PageRef = { standard: 'order-placed' };\n\n/**\n * Fail-closed warning for a string `successHref` that is not a path of this store. Nothing upstream\n * validates a string prop's shape, and an absolute or protocol-relative value would turn this CTA into\n * an open redirect that fires right after a real purchase, carrying the shopper's own order group to\n * another origin. Dev-only, like every other authoring warning in this component.\n */\nfunction warnUnsafeSuccessHref(successHref: string, reason: SafeHrefRejection): void {\n if (process.env.NODE_ENV === 'production') return;\n console.warn(\n `[PlaceOrder] successHref \"${successHref}\" is not a path of this store (${reason}); refusing to ` +\n 'navigate there rather than sending the shopper off-site right after a purchase.',\n );\n}\n\n/**\n * Fail-closed warning for a string `successHref` that still carries a `{token}`, the template form this\n * prop took before page references. Nothing fills the token any more, so navigating would land the\n * shopper on a literal `%7BorderGroup%7D` 404 right after paying. Dev-only.\n */\nfunction warnTemplateSuccessHref(successHref: string): void {\n if (process.env.NODE_ENV === 'production') return;\n console.warn(\n `[PlaceOrder] successHref \"${successHref}\" is a route template; refusing to navigate there. ` +\n \"Reference the confirmation page instead: { standard: 'order-placed' }.\",\n );\n}\n\ntype PlaceOrderNavigateOnSuccessProps = Pick<UsePlaceOrder, 'orderId' | 'userErrors'> & {\n successHref: PageRef | string;\n};\n\n/**\n * Navigates once `orderId` transitions to a non-empty value — not on `succeeded` (Decision 4) — so a\n * null or empty order group and every failure path never navigate. `userErrors` is also consulted\n * directly (INV-1): this component does not own `usePlaceOrder`, so it does not rely on that hook never\n * settling an order id beside an error.\n *\n * The call site passes `displayOrderId` (`orderId ?? the surviving attempt's own orderId`), not the\n * mount-local `orderId` this type is named for: a remounted CTA whose own `usePlaceOrder()` never ran\n * has an empty local `orderId` forever, and would otherwise leave the shopper on the payment page.\n *\n * The effect keys on the serialized `successHref`, not on its identity: a reference authored in a\n * schema arrives as a new object on every server render, and keying on it would navigate again on a\n * `router.refresh()`.\n */\nfunction PlaceOrderNavigateOnSuccess({ successHref, orderId, userErrors }: PlaceOrderNavigateOnSuccessProps) {\n const { replace } = useStorefrontNavigation();\n const successKey = JSON.stringify(successHref);\n\n useEffect(() => {\n if (!orderId || userErrors.length > 0) return;\n const authored: PageRef | string = JSON.parse(successKey);\n if (typeof authored !== 'string') {\n replace({ ...authored, params: { ...authored.params, orderGroup: orderId } });\n return;\n }\n const destination = resolveSiteRelativeHref(authored);\n if (!destination.safe) {\n warnUnsafeSuccessHref(authored, destination.reason);\n return;\n }\n if (destination.href.includes('{')) {\n warnTemplateSuccessHref(authored);\n return;\n }\n replace(destination.href);\n }, [orderId, successKey, userErrors, replace]);\n\n return null;\n}\n\n/** The message props FR-4 adds, unnested — one field per client-synthesized `PaymentUserError` code\n * this CTA can render. Ten from T31; `inFlightMessage` joins them for T170's own code,\n * `unconfirmedMessage` for T176's, which renders in the status node instead of the alert, and\n * `unavailableMethodMessage` for T192's. */\nexport type AuthoredPlaceOrderMessages = Readonly<{\n missingSubmissionMessage: string;\n missingMethodMessage: string;\n invalidTransactionMessage: string;\n networkErrorMessage: string;\n missingDocumentMessage: string;\n invalidDocumentMessage: string;\n unsavedBillingAddressMessage: string;\n invalidCardDataMessage: string;\n unsupportedNetworkMessage: string;\n invalidSecurityCodeMessage: string;\n gatewayErrorMessage: string;\n inFlightMessage: string;\n unconfirmedMessage: string;\n unavailableMethodMessage: string;\n}>;\n\n/**\n * Builds the code -> copy map `resolveErrorMessage` reads (Decision 1, FR-4). The codes are literal\n * strings, never imported constants: importing them from card-entry.tsx / saved-cards.tsx /\n * use-place-order.ts / use-payment-submit-gate.ts / gateway.ts here would make this file a matter ->\n * matter dependency (R5) — `resolvePaymentSubmitGate` and `use-place-order.ts` stay untouched and this\n * component still imports nothing from either module beyond the hooks it already called. Exported for\n * direct unit testing, mirroring card-entry.tsx's convention for its own pure helpers:\n * place-order.test.tsx imports the five files' own real exported code constants and asserts this\n * function's returned key set equals their union.\n */\nexport function buildAuthoredErrorMessages(messages: AuthoredPlaceOrderMessages): Readonly<Record<string, string>> {\n return {\n MISSING_PAYMENT_SUBMISSION: messages.missingSubmissionMessage,\n MISSING_PAYMENT_METHOD_SELECTION: messages.missingMethodMessage,\n INVALID_TRANSACTION_DATA: messages.invalidTransactionMessage,\n NETWORK_ERROR: messages.networkErrorMessage,\n MISSING_CARDHOLDER_DOCUMENT: messages.missingDocumentMessage,\n INVALID_CARDHOLDER_DOCUMENT: messages.invalidDocumentMessage,\n UNSAVED_BILLING_ADDRESS: messages.unsavedBillingAddressMessage,\n INVALID_CARD_DATA: messages.invalidCardDataMessage,\n UNSUPPORTED_CARD_NETWORK: messages.unsupportedNetworkMessage,\n INVALID_SECURITY_CODE: messages.invalidSecurityCodeMessage,\n GATEWAY_ERROR: messages.gatewayErrorMessage,\n PLACE_ORDER_IN_FLIGHT: messages.inFlightMessage,\n PLACE_ORDER_UNCONFIRMED: messages.unconfirmedMessage,\n UNAVAILABLE_PAYMENT_METHOD: messages.unavailableMethodMessage,\n };\n}\n\n/**\n * Resolves the alert's rendered message for one client-synthesized `PaymentUserError`: the authored\n * copy for its `code` when this component owns one, otherwise the error's own `message` unchanged\n * (US-2 AC2 — a server-returned code this component does not author must render verbatim).\n *\n * `||`, not `??` (fix pass, finding 7): a store author can write `\"\"` for a code's authored message —\n * a valid, if unusual, `type: 'string'` prop value — and `??` only falls through on `null`/`undefined`,\n * so an authored empty string would render as an empty `role=\"alert\"` on a genuine gateway refusal,\n * leaving the shopper with no feedback at all where the unauthored default always rendered\n * `error.message`. Falling through on any falsy authored value is the exception on this surface, not\n * the rule: eight sibling `??` resolutions elsewhere (`access-code-sign-in.tsx`, `region.tsx`) stay on\n * `??`; `billing-address.tsx`'s `fieldLabels` fallback (fix pass round 2, finding N1) is fixed the\n * same way, for the same reason.\n */\nexport function resolveErrorMessage(error: PaymentUserError, authored: Readonly<Record<string, string>>): string {\n return authored[error.code] || error.message;\n}\n\ntype PlaceOrderFeedbackProps = Readonly<{\n placing: boolean;\n placingMessage: string | undefined;\n firstError: PaymentUserError | undefined;\n unconfirmed: boolean;\n succeeded: boolean;\n successMessage: string;\n displayOrderId: string | null;\n authoredErrorMessages: Readonly<Record<string, string>>;\n}>;\n\n/**\n * The CTA's feedback nodes: the authored placing message, the alert for a refusal, the status notice for\n * an order that could not be confirmed (T176), and the success line. Rendered as the CTA's own children,\n * so none of them adds a wrapper.\n */\nfunction PlaceOrderFeedback({\n placing,\n placingMessage,\n firstError,\n unconfirmed,\n succeeded,\n successMessage,\n displayOrderId,\n authoredErrorMessages,\n}: PlaceOrderFeedbackProps) {\n return (\n <>\n {placing && placingMessage?.trim() ? <output data-fs-place-order-placing=\"\">{placingMessage}</output> : null}\n {firstError && !unconfirmed ? (\n <div role=\"alert\" data-fs-place-order-error=\"\">\n {resolveErrorMessage(firstError, authoredErrorMessages)}\n </div>\n ) : null}\n {firstError && unconfirmed && !succeeded ? (\n <output data-fs-place-order-unconfirmed=\"\">{resolveErrorMessage(firstError, authoredErrorMessages)}</output>\n ) : null}\n {succeeded ? (\n <output data-fs-place-order-success=\"\">\n <span data-fs-place-order-success-message=\"\">{successMessage}</span>\n {displayOrderId ? <span data-fs-place-order-success-order-id=\"\">{displayOrderId}</span> : null}\n </output>\n ) : null}\n </>\n );\n}\n\n/**\n * T212: where focus moves after a refusal. Only a refusal raised before anything left the browser\n * (`reachedGateway === false`) that names an element the shopper must fix has a target; a result the\n * gateway returned never does, whatever its code.\n */\nfunction refusalFocusTarget(refusals: readonly PaymentUserError[], reachedGateway: boolean) {\n const [refusal] = refusals;\n return reachedGateway === false && refusal ? refusalTargetOf(refusal) : null;\n}\n\nexport function PlaceOrder({\n label = 'Place order',\n placingLabel = 'Placing order...',\n placingMessage,\n resumeLabel = 'Complete your order',\n successMessage = 'Order placed successfully.',\n missingSubmissionMessage = 'Enter your payment details before placing the order.',\n missingMethodMessage = 'Choose a payment method before placing the order.',\n invalidTransactionMessage = 'Unable to start the payment. Please try again.',\n networkErrorMessage = 'Unable to complete the request. Please try again.',\n missingDocumentMessage = 'Enter your document before placing the order.',\n invalidDocumentMessage = 'Enter a valid document before placing the order.',\n unavailableMethodMessage = 'Choose another payment method before placing the order.',\n unsavedBillingAddressMessage = 'Save your billing address before placing the order.',\n invalidCardDataMessage = 'Enter valid card details before placing the order.',\n unsupportedNetworkMessage = 'This card is not from a network the store accepts. Use another card or choose another payment method.',\n invalidSecurityCodeMessage = 'Enter a valid security code before placing the order.',\n gatewayErrorMessage = 'Unable to complete the payment. Please try again.',\n inFlightMessage = 'This order is already being placed. Please wait.',\n unconfirmedMessage = 'We could not confirm your order yet. Your payment may still be processing, so please do not pay again.',\n successHref = ORDER_PLACED_PAGE,\n $data: $dataProp,\n $actions: $actionsProp,\n className,\n ...props\n}: PlaceOrderProps) {\n const $data = useDataOverride($dataProp);\n const $actions = useActionsOverride($actionsProp);\n // T28: this instance's own stable identity, so its publish effect below retracts only its own key\n // (Decision 4) — never a second composed PlaceOrder's still-in-flight one.\n const instanceKey = useId();\n // Also enforces the PaymentSectionRoot/PaymentSectionController ancestor: usePayment() throws\n // outside that subtree (see the module doc comment) — the first of the two guards to run, since its\n // result feeds usePlaceOrder's own argument below.\n //\n // Fix pass, finding S-F1 (High, duplicate-transaction route (a)): `sectionPlacing` is the shared\n // fact this instance also *writes* below — read back so this CTA's own `disabled` can OR it in.\n // Without this, a second composed PlaceOrder stayed enabled for the whole time a first instance's\n // sequence was open: each instance's `usePlaceOrder()` call owns its own independent `placing`/\n // `inFlight` guard, so nothing local to a second CTA ever knew a sibling had already opened a\n // transaction. This never makes this CTA's own subtree inert (FR-6/Decision 5 are untouched) — it\n // only widens the *button's* own disabled condition.\n //\n // T29: `attempt`/`setAttempt` are this same contract's own record of an order-placement attempt —\n // read here (never mirrored locally) so a remount renders the surviving truth instead of this\n // instance's own fresh, reset local state (see `succeeded`/`resumable` below).\n const { draft, placing: sectionPlacing, setPlacing, attempt, setAttempt, focusRefusal } = usePayment();\n // T24's submit gate: an already-resolved client-side refusal (a missing/malformed cardholder\n // document, or an unsaved billing address), forwarded verbatim into usePlaceOrder's own opaque\n // argument — still not a card field, since the hook only ever receives the resolved verdict.\n const submitGate = usePaymentSubmitGate();\n const { placeOrder, placing, userErrors, orderId } = usePlaceOrder({\n $data,\n $actions,\n attempt,\n setAttempt,\n billingAddressDifferent: draft.billingAddressDifferent,\n submitGate,\n });\n const authoredErrorMessages = buildAuthoredErrorMessages({\n missingSubmissionMessage,\n missingMethodMessage,\n invalidTransactionMessage,\n networkErrorMessage,\n missingDocumentMessage,\n invalidDocumentMessage,\n unsavedBillingAddressMessage,\n invalidCardDataMessage,\n unsupportedNetworkMessage,\n invalidSecurityCodeMessage,\n gatewayErrorMessage,\n inFlightMessage,\n unconfirmedMessage,\n unavailableMethodMessage,\n });\n const [attempted, setAttempted] = useState(false);\n\n // T28 (FR-1/FR-7): mirrors this CTA's own in-flight state onto the payment context so the sibling\n // entry leaves can freeze while an order-placement sequence is open. Retracts only this instance's\n // key on unmount, so a second composed PlaceOrder's own live sequence is never unblocked by this one\n // settling or unmounting (Decision 4, R5).\n //\n // Fix pass, finding F7 (assumption A-3): a *layout* effect, not a passive one — it must commit in\n // the same frame as `placing`'s own render, so no intermediate paint ever shows this CTA's button\n // still enabled beside leaves that are about to go inert (or the reverse, on release). A passive\n // `useEffect` here leaves a ~1-frame window where a fast key-repeat could land.\n //\n // T29 (FR-5, INV-5): the cleanup's own release is now conditional on `placing` — closed over from\n // the same render as this effect instance, so it reflects this CTA's own sequence at the moment it\n // unmounts. `placing` is true for the whole span from before `startTransaction()`/`gatewayCallback()`\n // to `run()`/`resume()` settling (unchanged by this task), so an unmount while it is still true is\n // exactly an unmount mid-sequence (the overlay closing with no `keepMounted`) — the `run()`/`resume()`\n // closure this CTA started keeps writing the surviving attempt's phase after this CTA is gone\n // (NFR-3), and nothing else will ever flip this key back, so the release must not happen. A routine\n // re-render where `placing` itself just flipped self-corrects immediately after, via this same\n // effect's next body call, which re-publishes the current value directly.\n //\n // Fix pass (Critical finding): this instance's own key in `usePayment()`'s ref-counted set is\n // therefore genuinely never retracted once abandoned here — by design, since nothing can safely\n // predict at unmount time whether the closure is about to resolve to a terminal phase or is still\n // truly in flight. What bounds the damage is `usePaymentMethodSelection`'s own `placing` derivation,\n // which folds the shared attempt's phase into every reader of this fact: once the abandoned closure\n // finally writes `refused` or `settled`, `placing` reads `false` again for this root regardless of\n // how many stale keys the ref-counted set still carries. `blockedByOtherInstance`/`resumable` below\n // read that same, already-corrected `sectionPlacing` value, so they need no separate escape hatch of\n // their own for this case.\n useLayoutEffect(() => {\n setPlacing(instanceKey, placing);\n return () => {\n if (placing) return;\n setPlacing(instanceKey, false);\n };\n }, [instanceKey, placing, setPlacing]);\n\n const [firstError] = userErrors;\n // T29: a settled attempt renders as succeeded even across a remount, where this component's own\n // `attempted`/`userErrors` restart at their pre-attempt defaults (FR-1) but the shared `attempt`\n // does not. On the same mount, `attempted && !placing && userErrors.length === 0` already covers it\n // (both a clean `run()` and a clean `resume()` settle through the same wrapper), so this only adds\n // the case local state cannot see.\n const settledAttemptOrderId = attempt?.phase === 'settled' ? attempt.orderId : null;\n const succeeded = (attempted && !placing && userErrors.length === 0) || attempt?.phase === 'settled';\n // T29 (FR-2, FR-3): the next click finalizes rather than re-runs the sequence. Never true once\n // `succeeded` is (phases are mutually exclusive), and `placing` already takes priority in the label\n // below, so this needs no exclusion of its own here. The `'sent'` check is defensive-only today: no\n // write site in `run()` rests there (it writes `finalizing` directly, same tick, specs/make-an-order-\n // attempt-survive-a.md §2) — kept in case a future write path ever rests there again, rather than\n // silently treating that phase as non-resumable.\n const resumable = attempt?.phase === 'sent' || attempt?.phase === 'unresolved';\n // Local `orderId` (this mount's own settle) is preferred; a remounted CTA reading a settled attempt\n // has none of its own yet, so it falls back to the record's.\n const displayOrderId = orderId ?? settledAttemptOrderId;\n // T176 (FR-10, INV-11): the card was handed to the gateway and the order could not be confirmed, so\n // the payment may still be processing. That is a pending state, not a refusal: it renders in its own\n // status node, never in the alert stores style as an error, and never beside a success line — another\n // composed CTA can settle the shared record while this one still holds the outcome.\n const unconfirmed = firstError?.code === 'PLACE_ORDER_UNCONFIRMED';\n\n // T29: `sectionPlacing` overrides `resumable` below, not the other way round — a CTA that unmounted\n // mid-sequence (FR-5) leaves its own key published forever, because the `run()`/`resume()` closure it\n // abandoned settles through *local* state (`setPlacing(false)` inside `usePlaceOrder`'s own `settle`)\n // that has nowhere left to render once that CTA is gone, so the shared key it once set is never\n // retracted by anything else either. A resumable attempt must still be reachable through that stale\n // lock: `resume()` cannot re-pay by construction (Decision 3), so overriding a stuck `sectionPlacing`\n // here is safe exactly when it matters — a lock a *different*, still-genuinely-placing instance holds\n // is never resumable at the same time (the shared attempt is one fact — Decision 1 — so a real\n // concurrent opener keeps this attempt at `opening`/`finalizing`, not `sent`/`unresolved`).\n const blockedByOtherInstance = sectionPlacing && !resumable;\n\n function handleClick() {\n // FR-2 (T56): `setAttempted(true)` moved off the click and onto settlement, so `succeeded`\n // means \"an attempt settled with no refusals\" rather than \"a click happened and nothing is\n // in flight\". `placeOrder()` resolves; it never rejects (T13's own contract), and this\n // component reflects its state from the hook's own return value on every render rather than\n // from the awaited result — a rejection handler here would be dead code, and (review finding\n // F3) setting `attempted` from one would not \"keep the CTA disabled\": it would make\n // `succeeded` `true` with the attempt's real outcome unknown, the exact false-success frame\n // FR-2 exists to prevent.\n //\n // Review finding F1: settling `attempted` is not enough on its own past the first attempt.\n // Once an attempt settles, `attempted` stays `true` until something lowers it — and nothing\n // did, so a second click's own synchronous commit (`placeOrder` resets `userErrors` to `[]`\n // unconditionally, and a refusal leaves `placing` `false`) satisfied `succeeded` immediately,\n // one microtask before the new refusal arrived. Resetting `attempted` here, in the same\n // synchronous batch as that reset, makes every attempt — not just the first — start its own\n // click commit from \"not attempted\"; the `.then` below raises it again only once *this*\n // attempt's own outcome is in.\n setAttempted(false);\n //\n // T212: a refusal raised before anything left the browser (`reachedGateway === false`) that names an\n // element the shopper must fix moves focus there, once, as the continuation of this one click. A\n // result the gateway returned never does, whatever its code. Imperative on purpose, unlike the rest\n // of this component: derived from render state it would also fire on a remount or a re-render.\n void placeOrder().then(({ userErrors: refusals, reachedGateway }) => {\n setAttempted(true);\n const target = refusalFocusTarget(refusals, reachedGateway);\n if (target) focusRefusal(target);\n });\n }\n\n return (\n <div\n {...props}\n className={className}\n data-fs-place-order=\"\"\n {...(placing ? { 'data-fs-place-order-pending': '' } : {})}\n >\n <Button\n onClick={handleClick}\n disabled={placing || succeeded || blockedByOtherInstance}\n aria-busy={placing || undefined}\n data-fs-place-order-button=\"\"\n {...(placing ? { 'data-fs-place-order-button-pending': '' } : {})}\n >\n {placing ? placingLabel : resumable ? resumeLabel : label}\n </Button>\n <PlaceOrderFeedback\n placing={placing}\n placingMessage={placingMessage}\n firstError={firstError}\n unconfirmed={unconfirmed}\n succeeded={succeeded}\n successMessage={successMessage}\n displayOrderId={displayOrderId}\n authoredErrorMessages={authoredErrorMessages}\n />\n <PlaceOrderNavigateOnSuccess successHref={successHref} orderId={displayOrderId} userErrors={userErrors} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAsLA,MAAa,uBAAuB,gBAAiC;CACnE,MAAM;CACN,YAAY;CACZ,WAAW;CACX;;;;;;;;;;;;;;;;;;;;;;;CACA,eAAe;CACf,SAAS;EAAE,SAAS,CAAC,oBAAoB,iBAAiB;EAAG,WAAW,CAAC,OAAO;CAAE;CAClF,iBAAiB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ACT,UAAU,WAAW,aAAa;IAClC,aAAW,WAAW,KAAA;IACtB,8BAA2B;IAC3B,GAAK,UAAU,EAAE,sCAAsC,GAAG,IAAI,CAAC;IAE9D,UAAA,UAAU,eAAe,YAAY,cAAc;GAC9C,CAAA;GACR,oBAAC,oBAAD;IACW;IACO;IACJ;IACC;IACF;IACK;IACA;IACO;GACxB,CAAA;GACD,oBAAC,6BAAD;IAA0C;IAAa,SAAS;IAA4B;GAAa,CAAA;EACtG;;AAET"}
1
+ {"version":3,"file":"place-order.js","names":[],"sources":["../../../src/matter/place-order/place-order.tsx"],"sourcesContent":["'use client';\n\nimport {\n type ContentValue,\n defineComponent,\n defineContentType,\n type MessageFieldName,\n type MessageLocaleProp,\n} from '@vtex/fs-core';\nimport { type ComponentPropsWithRef, useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';\nimport { Button } from '../../particles/button/button.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { useStorefrontContext } from '../../sdk/context/storefront-context.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { formatErrorCode } from '../../sdk/i18n/format-error-code.js';\nimport { useMessageFormatter } from '../../sdk/i18n/use-message-formatter.js';\nimport { resolveStorefrontHref } from '../../sdk/navigation/resolve-storefront-href.js';\nimport { useRouteMap } from '../../sdk/navigation/route-map-provider.js';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { useStorefrontNavigation } from '../../sdk/navigation/use-storefront-navigation.js';\nimport { buildChallengeReturnQuery } from '../../sdk/payment/challenge-return.js';\nimport type { PaymentUserError } from '../../sdk/payment/operations.js';\nimport { useSettledOrderRead } from '../../sdk/payment/resumed-purchase.js';\nimport { type PlaceOrderData, type UsePlaceOrder, usePlaceOrder } from '../../sdk/payment/use-place-order.js';\nimport { resolveSiteRelativeHref, type SafeHrefRejection } from '../../utils/safe-href.js';\nimport { usePayment } from '../payment/payment.js';\nimport { refusalTargetOf, usePaymentSubmitGate } from '../payment/use-payment-submit-gate.js';\n\n/**\n * The `PlaceOrder` CTA matter (specs/place-order.md, T14 of the Credit Card epic;\n * docs/features/credit-card/rfc.md § D9). Drives T13's `usePlaceOrder` orchestration hook and renders\n * the three v1 states the RFC names: the idle CTA, a blocking loading state while the three-call\n * sequence runs, and an inline outcome (error or success) once it settles.\n *\n * **Composes as a sibling of the card entry (T7) and the saved cards list (T12) under the payment\n * root, never nested inside either.** That placement is what lets this one CTA serve both the\n * new-card and saved-card paths — nesting it inside a card form, as the legacy `CardForm` does,\n * would force a second CTA for the saved-card path. This is a documented authoring convention, not a\n * compiler guarantee: `requiresContext: 'payment'` (ADR-0009) only fails the build when *no* ancestor\n * at any depth declares `providesContext: 'payment'` — there is no `forbidsAncestor` token, so a\n * schema that nests this component inside `CardEntry`/`SavedCards` instead of beside them still\n * compiles and still resolves the context from the payment root further up. This component throws\n * at runtime only when rendered entirely outside a `PaymentSectionRoot`/`Controller` subtree — both\n * `usePayment()` (read directly below, for `draft.billingAddressDifferent`) and `usePlaceOrder` (via\n * the submission channel those roots provide) enforce that guard, with `usePayment()` throwing first\n * since its value feeds `usePlaceOrder`'s own argument — a real, load-bearing guard, but a weaker one\n * than \"must be a sibling.\" See specs/place-order.md's open items for this gap.\n *\n * **This component never touches card data.** It declares its own thin fragment for the read-model\n * slice `usePlaceOrder` needs (`selectedMethodId`, `selectedInstallment`, `methods` — ADR-0011,\n * mirroring `PaymentSummaryData`/`PaymentSectionData`) and forwards it plus `$actions` straight into\n * the hook. The one fact it reads off `usePayment()`'s context directly is `draft.billingAddressDifferent`\n * (T11's widening of `PaymentDraft`), forwarded into `usePlaceOrder`'s own optional argument of the\n * same name so the gateway descriptor carries the shopper's choice (fix pass, PR #544 review F1) —\n * still not a card field, since `PaymentDraft` never carries one. `usePaymentSubmitGate()` (T24)\n * resolves the client-side document/billing refusal off that same context and is forwarded as\n * `usePlaceOrder`'s `submitGate` argument — an opaque `PaymentUserError | null`, never the facts\n * behind it. The hook already owns `placing`, `userErrors`, and `orderId` — including releasing\n * `placing` on every failure path — so this component only reflects that state, never re-implements it.\n *\n * `attempted` is the one bit of state this component adds, and it is not a duplicate of anything the\n * hook owns: `usePlaceOrder`'s `userErrors: []` is both the pre-attempt state and the settled-success\n * state (T13 does not disambiguate the two, by design — see `UsePlaceOrder`'s doc), so distinguishing\n * \"never attempted\" from \"attempted and succeeded\" is exactly this component's job. `succeeded` is\n * derived, not stored: `attempted && !placing && userErrors.length === 0`.\n *\n * **T29 widens both `succeeded` and the button label with the surviving `attempt` record read off\n * `usePayment()`** (specs/make-an-order-attempt-survive-a.md), never mirrored into local state:\n * `attempted`/`userErrors`/`orderId` all restart at their pre-attempt defaults on every mount, but the\n * attempt record does not, so a remount renders its truth rather than this instance's own fresh state.\n * `succeeded` is `true` whenever the record's own phase is `'settled'`, independent of `attempted`; the\n * button shows `resumeLabel` instead of `label` whenever the phase is `'sent'` or `'unresolved'` — the\n * card already left the browser (or its fate is unknown) and the next click finalizes it through\n * `usePlaceOrder`'s `resume()` rather than opening a new transaction.\n *\n * The button disables on `placing` (the required blocking state) and, deliberately, on `succeeded`\n * too — an already-placed order has nothing left to submit, and a second click risks exactly the\n * duplicate-transaction outcome T13's own concurrency guard (Decision 6) calls \"the worst outcome\n * this task's surface has\". `usePlaceOrder`'s in-flight ref is the inner guard; this is the outer one.\n * Fix pass, finding S-F1: it also disables on the *shared* `usePayment().placing`, since a second\n * composed `PlaceOrder` has no other way to learn a sibling instance already opened a transaction —\n * each `usePlaceOrder()` call owns its own, independent `inFlight` ref.\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — raw template literal, matching the merged `payment`/`payment-summary` siblings:\n// the codegen `documents` glob does not scan `src/matter/place-order*`, so the typed `graphql()`\n// factory is unavailable here; `data-component-contract.test.ts` validates this fragment against the\n// real schema and the built catalog.\n//\n// Selects exactly the three fields `PlaceOrderData` (sdk/payment/use-place-order.ts) needs — nothing\n// from `PaymentSectionData` is re-selected, and nothing card-shaped is ever in scope.\n// ---------------------------------------------------------------------------\n\nconst fragment = /* GraphQL */ `\n fragment PlaceOrderData on Query {\n payment {\n __typename\n id\n selectedMethodId\n selectedInstallment {\n __typename\n count\n value {\n amount\n currencyCode\n }\n interestRate\n }\n methods {\n __typename\n id\n groupName\n }\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport type PlaceOrderProps = ComponentPropsWithRef<'div'> &\n MessageLocaleProp & {\n /**\n * Where the shopper lands after a successful placement. A page reference gets the placed order's\n * Node id as its `orderId` param. A string is a logical path of this store, navigated as written;\n * an absolute, protocol-relative, or non-http(s) value, or a `{orderId}` template, is refused\n * rather than navigated to (fail closed, dev-only warn).\n * e.g. `{ standard: 'order-placed' }`\n */\n successHref?: PageRef | string;\n /**\n * The page the bank sends the shopper back to after a 3D Secure challenge, a page of this store that\n * composes `ChallengeReturn`. A page reference only: a string, or a page the route map does not hold, is\n * refused with a dev-only warning, since the return URL is built from the page's public path. No default:\n * a store that authors none keeps the refusal a challenge answer gets today, with no redirect.\n * e.g. `{ page: 'checkout-challenge-return' }`\n */\n challengeReturnHref?: PageRef;\n /** `Payment` slice forwarded by the reactive runtime (arity-1, ADR-0015) — `null` until it resolves. */\n $data?: PlaceOrderData;\n /** Compiler-injected action surface; carries `payment.startTransaction`, `payment.gatewayCallback`, `analytics.track`. */\n $actions?: ComponentActions;\n /** The button labels, the message while placing, the success message and the message for each refusal code this CTA words. */\n $content?: ContentValue<typeof PlaceOrderContent>;\n };\n\n// ---------------------------------------------------------------------------\n// Definition\n// ---------------------------------------------------------------------------\n\nexport const PlaceOrderContent = defineContentType({\n id: 'place-order',\n title: 'Place Order',\n description:\n 'The place-order button labels, the message while placing, the success message, and the message for each refusal it words.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Button label', format: 'icu-message', messageSource: 'Place order' },\n placingLabel: {\n type: 'string',\n title: 'Button label while placing',\n format: 'icu-message',\n messageSource: 'Placing order...',\n },\n placingMessage: {\n type: 'string',\n title: 'Message while placing',\n format: 'icu-message',\n messageSource: 'Processing your payment. Please keep this page open.',\n messageOptional: true,\n },\n resumeLabel: {\n type: 'string',\n title: 'Button label while a surviving attempt offers a resume',\n format: 'icu-message',\n messageSource: 'Complete your order',\n },\n successMessage: {\n type: 'string',\n title: 'Success message',\n format: 'icu-message',\n messageSource: 'Order placed successfully.',\n },\n missingSubmissionMessage: {\n type: 'string',\n title: 'Missing payment submission message',\n format: 'icu-message',\n messageSource: 'Enter your payment details before placing the order.',\n },\n missingMethodMessage: {\n type: 'string',\n title: 'Missing payment method message',\n format: 'icu-message',\n messageSource: 'Choose a payment method before placing the order.',\n },\n invalidTransactionMessage: {\n type: 'string',\n title: 'Invalid transaction message',\n format: 'icu-message',\n messageSource: 'Unable to start the payment. Please try again.',\n },\n networkErrorMessage: {\n type: 'string',\n title: 'Network error message',\n format: 'icu-message',\n messageSource: 'Unable to complete the request. Please try again.',\n },\n missingDocumentMessage: {\n type: 'string',\n title: 'Missing document message',\n format: 'icu-message',\n messageSource: 'Enter your document before placing the order.',\n },\n invalidDocumentMessage: {\n type: 'string',\n title: 'Invalid document message',\n format: 'icu-message',\n messageSource: 'Enter a valid document before placing the order.',\n },\n unavailableMethodMessage: {\n type: 'string',\n title: 'Unavailable payment method message',\n format: 'icu-message',\n messageSource: 'Choose another payment method before placing the order.',\n },\n unsavedBillingAddressMessage: {\n type: 'string',\n title: 'Unsaved billing address message',\n format: 'icu-message',\n messageSource: 'Save your billing address before placing the order.',\n },\n missingProfileNameMessage: {\n type: 'string',\n title: 'Missing name message',\n format: 'icu-message',\n messageSource: 'Enter your first and last name before placing the order.',\n },\n missingProfilePhoneMessage: {\n type: 'string',\n title: 'Missing phone message',\n format: 'icu-message',\n messageSource: 'Enter your phone number before placing the order.',\n },\n invalidCardDataMessage: {\n type: 'string',\n title: 'Invalid card data message',\n format: 'icu-message',\n messageSource: 'Enter valid card details before placing the order.',\n },\n unsupportedNetworkMessage: {\n type: 'string',\n title: 'Unsupported card network message',\n format: 'icu-message',\n messageSource:\n 'This card is not from a network the store accepts. Use another card or choose another payment method.',\n },\n invalidSecurityCodeMessage: {\n type: 'string',\n title: 'Invalid security code message',\n format: 'icu-message',\n messageSource: 'Enter a valid security code before placing the order.',\n },\n gatewayErrorMessage: {\n type: 'string',\n title: 'Gateway error message',\n format: 'icu-message',\n messageSource: 'Unable to complete the payment. Please try again.',\n },\n inFlightMessage: {\n type: 'string',\n title: 'Order already in flight message',\n format: 'icu-message',\n messageSource: 'This order is already being placed. Please wait.',\n },\n unconfirmedMessage: {\n type: 'string',\n title: 'Unconfirmed order message',\n format: 'icu-message',\n messageSource:\n 'We could not confirm your order yet. Your payment may still be processing, so please do not pay again.',\n },\n declinedMessage: {\n type: 'string',\n title: 'Declined payment message',\n format: 'icu-message',\n messageSource: 'Check your payment information or choose another payment method.',\n },\n lapsedTransactionMessage: {\n type: 'string',\n title: 'Lapsed payment window message',\n format: 'icu-message',\n messageSource:\n 'We could not confirm your order yet. Your payment may still be processing, so please do not pay again.',\n },\n challengeUnavailableMessage: {\n type: 'string',\n title: 'Unavailable bank verification message',\n format: 'icu-message',\n messageSource:\n 'Your bank asked for an extra verification step that we could not open. Your payment may still be processing, so please do not pay again.',\n },\n },\n },\n});\n\nexport const PlaceOrderDefinition = defineComponent<PlaceOrderProps>({\n name: 'PlaceOrder',\n importPath: '@vtex/faststore/components',\n component: PlaceOrder,\n fragment,\n fetchStrategy: 'reactive',\n actions: { payment: ['startTransaction', 'gatewayCallback'], analytics: ['track'] },\n requiresContext: 'payment',\n editor: { label: 'Place Order', category: 'commerce' },\n content: PlaceOrderContent,\n schema: {\n successHref: {\n type: 'link',\n default: { standard: 'order-placed' },\n fills: ['orderId'],\n label: 'Confirmation Page',\n },\n // No default on purpose: a standard page cannot name a return page, and absent means no 3D Secure redirect.\n challengeReturnHref: { type: 'link', label: 'Bank challenge return page' },\n },\n guideline:\n \"The place-order CTA: invokes usePlaceOrder's three-call sequence (start transaction, the registered submission's own direct-to-gateway leg, then the gateway callback) and blocks interaction while it runs. Compose it as a sibling — never a child — of every other payment-entry leaf under the same PaymentSectionRoot or PaymentSectionController, so the one CTA serves every entry path. Its button labels and messages are $content fields (label, placingLabel, placingMessage, resumeLabel, successMessage, and one message per refusal code it words). Renders one inline outcome after settling: the message for the first userError's code (networkErrorMessage for a code it does not word), or successMessage on a clean settle. While the order is being placed it renders nothing but the button, unless the placingMessage message is authored: then a status message shows beside the button, and the rest of the payment form is blocked for as long as it shows. When challengeReturnHref names a return page of the store and the bank asks for a challenge, the shopper is sent to the bank with the form blocked and no success or error shown; the return page finishes the order. This component reaches no payment-sensitive input. Must be inside a payment root. See place-order.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementation\n// ---------------------------------------------------------------------------\n\n/** The default confirmation page. */\nconst ORDER_PLACED_PAGE: PageRef = { standard: 'order-placed' };\n\n/**\n * Fail-closed warning for a string `successHref` that is not a path of this store. Nothing upstream\n * validates a string prop's shape, and an absolute or protocol-relative value would turn this CTA into\n * an open redirect that fires right after a real purchase, carrying the shopper's own order id to\n * another origin. Dev-only, like every other authoring warning in this component.\n */\nfunction warnUnsafeSuccessHref(successHref: string, reason: SafeHrefRejection): void {\n if (process.env.NODE_ENV === 'production') return;\n console.warn(\n `[PlaceOrder] successHref \"${successHref}\" is not a path of this store (${reason}); refusing to ` +\n 'navigate there rather than sending the shopper off-site right after a purchase.',\n );\n}\n\n/**\n * Fail-closed warning for a string `successHref` that still carries a `{token}`, the template form this\n * prop took before page references. Nothing fills the token any more, so navigating would land the\n * shopper on a literal `%7BorderId%7D` 404 right after paying. Dev-only.\n */\nfunction warnTemplateSuccessHref(successHref: string): void {\n if (process.env.NODE_ENV === 'production') return;\n console.warn(\n `[PlaceOrder] successHref \"${successHref}\" is a route template; refusing to navigate there. ` +\n \"Reference the confirmation page instead: { standard: 'order-placed' }.\",\n );\n}\n\n/**\n * Dev-only warning for a `challengeReturnHref` this CTA cannot build a return URL from. Nothing upstream\n * validates a link prop's shape at runtime, and a string would have to be turned into an absolute URL the\n * bank must come back to; so the prop is a page reference or nothing, and the shopper keeps the refusal\n * a challenge answer gets without a return page.\n */\nfunction warnUnusableChallengeReturnHref(reason: string): void {\n if (process.env.NODE_ENV === 'production') return;\n console.warn(\n `[PlaceOrder] challengeReturnHref ${reason}; sending no return URL, so a bank challenge cannot be ` +\n \"followed. Reference a page of this store instead: { page: 'checkout-challenge-return' }.\",\n );\n}\n\nfunction isPageRef(value: unknown): value is PageRef {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * The builder `usePlaceOrder` calls with an opened order's group: the absolute URL of the authored return\n * page, carrying the group and the literal flag, or `null` when the store authored none or it cannot be\n * built. Resolved through `resolveStorefrontHref`, which never logs, so an unusable prop warns exactly once\n * here, naming itself. Keyed on the serialized reference, not its identity: a reference authored in a\n * schema arrives as a new object on every server render.\n */\nfunction useChallengeReturn(challengeReturnHref: PageRef | undefined): ((orderGroup: string) => string | null) | null {\n const { bindingId, basePath } = useStorefrontContext();\n const { routeMap } = useRouteMap();\n const authoredKey = challengeReturnHref === undefined ? null : JSON.stringify(challengeReturnHref);\n\n return useCallback(\n (orderGroup: string) => {\n if (authoredKey === null) return null;\n const authored: unknown = JSON.parse(authoredKey);\n if (!isPageRef(authored)) {\n warnUnusableChallengeReturnHref('is not a page reference');\n return null;\n }\n const query = buildChallengeReturnQuery(orderGroup);\n if (query === null) return null;\n const resolved = resolveStorefrontHref({ bindingId, basePath }, routeMap, {\n ...authored,\n query: { ...authored.query, ...query },\n });\n if (resolved.href === null) {\n warnUnusableChallengeReturnHref(`names a page this store does not serve (${resolved.reason})`);\n return null;\n }\n return `${globalThis.location.origin}${resolved.href}`;\n },\n [authoredKey, bindingId, basePath, routeMap],\n );\n}\n\ntype PlaceOrderNavigateOnRedirectProps = Pick<UsePlaceOrder, 'redirectUrl'>;\n\n/**\n * Hands the document to the bank once `redirectUrl` is set. `useStorefrontNavigation().push` makes an\n * absolute URL a document load, which unloads this page: nothing here draws a success or an error, and the\n * hook keeps `placing` true so the form stays blocked until the browser leaves. A ref remembers the URL\n * already navigated to, so neither a re-render nor StrictMode's second effect pass navigates twice.\n */\nfunction PlaceOrderNavigateOnRedirect({ redirectUrl }: PlaceOrderNavigateOnRedirectProps) {\n const { push } = useStorefrontNavigation();\n const navigatedTo = useRef<string | null>(null);\n\n useEffect(() => {\n if (!redirectUrl || navigatedTo.current === redirectUrl) return;\n navigatedTo.current = redirectUrl;\n push(redirectUrl);\n }, [redirectUrl, push]);\n\n return null;\n}\n\ntype PlaceOrderNavigateOnSuccessProps = Pick<UsePlaceOrder, 'orderNodeId' | 'userErrors'> & {\n successHref: PageRef | string;\n};\n\n/**\n * Navigates once `orderNodeId` transitions to a non-empty value — not on `succeeded` (Decision 4) — so a\n * null or empty order Node id and every failure path never navigate. `userErrors` is also consulted\n * directly (INV-1): this component does not own `usePlaceOrder`, so it does not rely on that hook never\n * settling an order id beside an error.\n *\n * The call site passes `displayOrderNodeId` (`orderNodeId ?? the surviving attempt's own orderNodeId`),\n * not the mount-local `orderNodeId` this type is named for: a remounted CTA whose own `usePlaceOrder()`\n * never ran has an empty local `orderNodeId` forever, and would otherwise leave the shopper on the payment page.\n *\n * The effect keys on the serialized `successHref`, not on its identity: a reference authored in a\n * schema arrives as a new object on every server render, and keying on it would navigate again on a\n * `router.refresh()`.\n */\nfunction PlaceOrderNavigateOnSuccess({ successHref, orderNodeId, userErrors }: PlaceOrderNavigateOnSuccessProps) {\n const { replace } = useStorefrontNavigation();\n const successKey = JSON.stringify(successHref);\n\n useEffect(() => {\n if (!orderNodeId || userErrors.length > 0) return;\n const authored: PageRef | string = JSON.parse(successKey);\n if (typeof authored !== 'string') {\n replace({ ...authored, params: { ...authored.params, orderId: orderNodeId } });\n return;\n }\n const destination = resolveSiteRelativeHref(authored);\n if (!destination.safe) {\n warnUnsafeSuccessHref(authored, destination.reason);\n return;\n }\n if (destination.href.includes('{')) {\n warnTemplateSuccessHref(authored);\n return;\n }\n replace(destination.href);\n }, [orderNodeId, successKey, userErrors, replace]);\n\n return null;\n}\n\n/**\n * Every `PaymentUserError` code that reaches this CTA's alert: the client-synthesized codes (the submit\n * gate's, the card forms', the gateway leg's and `usePlaceOrder`'s own), and the server codes of\n * `paymentStartTransaction` and `paymentGatewayCallback`.\n */\ntype PlaceOrderErrorCode =\n | 'MISSING_PAYMENT_SUBMISSION'\n | 'MISSING_PAYMENT_METHOD_SELECTION'\n | 'INVALID_TRANSACTION_DATA'\n | 'NETWORK_ERROR'\n | 'MISSING_CARDHOLDER_DOCUMENT'\n | 'INVALID_CARDHOLDER_DOCUMENT'\n | 'UNSAVED_BILLING_ADDRESS'\n | 'MISSING_PROFILE_NAME'\n | 'MISSING_PROFILE_PHONE'\n | 'INVALID_CARD_DATA'\n | 'UNSUPPORTED_CARD_NETWORK'\n | 'CARD_ENTRY_COLLAPSED'\n | 'INVALID_SECURITY_CODE'\n | 'GATEWAY_ERROR'\n | 'PLACE_ORDER_IN_FLIGHT'\n | 'PLACE_ORDER_UNCONFIRMED'\n | 'UNAVAILABLE_PAYMENT_METHOD'\n | 'MISSING_CART_CONTEXT'\n | 'CART_NOT_FOUND'\n | 'PAYMENT_DECLINED'\n | 'MISSING_TRANSACTION_COOKIES'\n | 'ORDER_GROUP_MISMATCH'\n | 'REDIRECT_REQUIRED';\n\n/**\n * The message field for each code in `PlaceOrderErrorCode`. The codes are literal strings, never imported\n * constants: importing them from card-entry.tsx / saved-cards.tsx / use-place-order.ts /\n * use-payment-submit-gate.ts / gateway.ts would make this file a matter -> matter dependency (R5).\n * `CARD_ENTRY_COLLAPSED` reads as an unavailable method; the two cart codes and `NETWORK_ERROR` share the\n * generic message; `ORDER_GROUP_MISMATCH`, like a lapsed cookie, means the card POST was accepted.\n */\nexport const PLACE_ORDER_ERROR_FIELDS = {\n MISSING_PAYMENT_SUBMISSION: 'missingSubmissionMessage',\n MISSING_PAYMENT_METHOD_SELECTION: 'missingMethodMessage',\n INVALID_TRANSACTION_DATA: 'invalidTransactionMessage',\n NETWORK_ERROR: 'networkErrorMessage',\n MISSING_CARDHOLDER_DOCUMENT: 'missingDocumentMessage',\n INVALID_CARDHOLDER_DOCUMENT: 'invalidDocumentMessage',\n UNSAVED_BILLING_ADDRESS: 'unsavedBillingAddressMessage',\n MISSING_PROFILE_NAME: 'missingProfileNameMessage',\n MISSING_PROFILE_PHONE: 'missingProfilePhoneMessage',\n INVALID_CARD_DATA: 'invalidCardDataMessage',\n UNSUPPORTED_CARD_NETWORK: 'unsupportedNetworkMessage',\n CARD_ENTRY_COLLAPSED: 'unavailableMethodMessage',\n INVALID_SECURITY_CODE: 'invalidSecurityCodeMessage',\n GATEWAY_ERROR: 'gatewayErrorMessage',\n PLACE_ORDER_IN_FLIGHT: 'inFlightMessage',\n PLACE_ORDER_UNCONFIRMED: 'unconfirmedMessage',\n UNAVAILABLE_PAYMENT_METHOD: 'unavailableMethodMessage',\n MISSING_CART_CONTEXT: 'networkErrorMessage',\n CART_NOT_FOUND: 'networkErrorMessage',\n PAYMENT_DECLINED: 'declinedMessage',\n MISSING_TRANSACTION_COOKIES: 'lapsedTransactionMessage',\n ORDER_GROUP_MISMATCH: 'lapsedTransactionMessage',\n REDIRECT_REQUIRED: 'challengeUnavailableMessage',\n} as const satisfies Record<PlaceOrderErrorCode, MessageFieldName<typeof PlaceOrderContent>>;\n\ntype PlaceOrderFormat = (field: MessageFieldName<typeof PlaceOrderContent>) => string;\n\n/**\n * The alert's message for one `PaymentUserError`: the message field for its `code`, or networkErrorMessage\n * for a code this CTA does not word. A missing message renders empty and the formatter logs it.\n */\nexport function resolveErrorMessage(error: PaymentUserError, format: PlaceOrderFormat): string {\n return formatErrorCode(PlaceOrderContent, PLACE_ORDER_ERROR_FIELDS, error, format, 'networkErrorMessage');\n}\n\ntype PlaceOrderFeedbackProps = Readonly<{\n placing: boolean;\n firstError: PaymentUserError | undefined;\n unconfirmed: boolean;\n succeeded: boolean;\n displayOrderId: string | null;\n format: PlaceOrderFormat;\n}>;\n\n/**\n * The CTA's feedback nodes: the authored placing message, the alert for a refusal, the status notice for\n * an order that could not be confirmed (T176), and the success line. Rendered as the CTA's own children,\n * so none of them adds a wrapper.\n */\nfunction PlaceOrderFeedback({\n placing,\n firstError,\n unconfirmed,\n succeeded,\n displayOrderId,\n format,\n}: PlaceOrderFeedbackProps) {\n const placingMessage = placing ? format('placingMessage') : '';\n return (\n <>\n {placingMessage.trim() ? <output data-fs-place-order-placing=\"\">{placingMessage}</output> : null}\n {firstError && !unconfirmed ? (\n <div role=\"alert\" data-fs-place-order-error=\"\">\n {resolveErrorMessage(firstError, format)}\n </div>\n ) : null}\n {firstError && unconfirmed && !succeeded ? (\n <output data-fs-place-order-unconfirmed=\"\">{resolveErrorMessage(firstError, format)}</output>\n ) : null}\n {succeeded ? (\n <output data-fs-place-order-success=\"\">\n <span data-fs-place-order-success-message=\"\">{format('successMessage')}</span>\n {displayOrderId ? <span data-fs-place-order-success-order-id=\"\">{displayOrderId}</span> : null}\n </output>\n ) : null}\n </>\n );\n}\n\n/**\n * T212: where focus moves after a refusal. Only a refusal raised before anything left the browser\n * (`reachedGateway === false`) that names an element the shopper must fix has a target; a result the\n * gateway returned never does, whatever its code.\n */\nfunction refusalFocusTarget(refusals: readonly PaymentUserError[], reachedGateway: boolean) {\n const [refusal] = refusals;\n return reachedGateway === false && refusal ? refusalTargetOf(refusal) : null;\n}\n\nexport function PlaceOrder({\n successHref = ORDER_PLACED_PAGE,\n challengeReturnHref,\n $data: $dataProp,\n $actions: $actionsProp,\n $content,\n $locale,\n className,\n ...props\n}: PlaceOrderProps) {\n const $data = useDataOverride($dataProp);\n const $actions = useActionsOverride($actionsProp);\n // T28: this instance's own stable identity, so its publish effect below retracts only its own key\n // (Decision 4) — never a second composed PlaceOrder's still-in-flight one.\n const instanceKey = useId();\n // Also enforces the PaymentSectionRoot/PaymentSectionController ancestor: usePayment() throws\n // outside that subtree (see the module doc comment) — the first of the two guards to run, since its\n // result feeds usePlaceOrder's own argument below.\n //\n // Fix pass, finding S-F1 (High, duplicate-transaction route (a)): `sectionPlacing` is the shared\n // fact this instance also *writes* below — read back so this CTA's own `disabled` can OR it in.\n // Without this, a second composed PlaceOrder stayed enabled for the whole time a first instance's\n // sequence was open: each instance's `usePlaceOrder()` call owns its own independent `placing`/\n // `inFlight` guard, so nothing local to a second CTA ever knew a sibling had already opened a\n // transaction. This never makes this CTA's own subtree inert (FR-6/Decision 5 are untouched) — it\n // only widens the *button's* own disabled condition.\n //\n // T29: `attempt`/`setAttempt` are this same contract's own record of an order-placement attempt —\n // read here (never mirrored locally) so a remount renders the surviving truth instead of this\n // instance's own fresh, reset local state (see `succeeded`/`resumable` below).\n const { draft, placing: sectionPlacing, setPlacing, attempt, setAttempt, focusRefusal } = usePayment();\n // T24's submit gate: an already-resolved client-side refusal (a missing/malformed cardholder\n // document, an unsaved billing address, or an incomplete cart profile), forwarded verbatim into\n // usePlaceOrder's own opaque argument — still not a card field, since the hook only ever receives the\n // resolved verdict.\n const submitGate = usePaymentSubmitGate();\n const challengeReturn = useChallengeReturn(challengeReturnHref);\n const readSettledOrder = useSettledOrderRead();\n const { placeOrder, placing, userErrors, orderId, orderNodeId, redirectUrl } = usePlaceOrder({\n $data,\n $actions,\n attempt,\n setAttempt,\n billingAddressDifferent: draft.billingAddressDifferent,\n submitGate,\n challengeReturn,\n readSettledOrder,\n });\n const { format } = useMessageFormatter(PlaceOrderContent, $content);\n const [attempted, setAttempted] = useState(false);\n\n // T28 (FR-1/FR-7): mirrors this CTA's own in-flight state onto the payment context so the sibling\n // entry leaves can freeze while an order-placement sequence is open. Retracts only this instance's\n // key on unmount, so a second composed PlaceOrder's own live sequence is never unblocked by this one\n // settling or unmounting (Decision 4, R5).\n //\n // Fix pass, finding F7 (assumption A-3): a *layout* effect, not a passive one — it must commit in\n // the same frame as `placing`'s own render, so no intermediate paint ever shows this CTA's button\n // still enabled beside leaves that are about to go inert (or the reverse, on release). A passive\n // `useEffect` here leaves a ~1-frame window where a fast key-repeat could land.\n //\n // T29 (FR-5, INV-5): the cleanup's own release is now conditional on `placing` — closed over from\n // the same render as this effect instance, so it reflects this CTA's own sequence at the moment it\n // unmounts. `placing` is true for the whole span from before `startTransaction()`/`gatewayCallback()`\n // to `run()`/`resume()` settling (unchanged by this task), so an unmount while it is still true is\n // exactly an unmount mid-sequence (the overlay closing with no `keepMounted`) — the `run()`/`resume()`\n // closure this CTA started keeps writing the surviving attempt's phase after this CTA is gone\n // (NFR-3), and nothing else will ever flip this key back, so the release must not happen. A routine\n // re-render where `placing` itself just flipped self-corrects immediately after, via this same\n // effect's next body call, which re-publishes the current value directly.\n //\n // Fix pass (Critical finding): this instance's own key in `usePayment()`'s ref-counted set is\n // therefore genuinely never retracted once abandoned here — by design, since nothing can safely\n // predict at unmount time whether the closure is about to resolve to a terminal phase or is still\n // truly in flight. What bounds the damage is `usePaymentMethodSelection`'s own `placing` derivation,\n // which folds the shared attempt's phase into every reader of this fact: once the abandoned closure\n // finally writes `refused` or `settled`, `placing` reads `false` again for this root regardless of\n // how many stale keys the ref-counted set still carries. `blockedByOtherInstance`/`resumable` below\n // read that same, already-corrected `sectionPlacing` value, so they need no separate escape hatch of\n // their own for this case.\n useLayoutEffect(() => {\n setPlacing(instanceKey, placing);\n return () => {\n if (placing) return;\n setPlacing(instanceKey, false);\n };\n }, [instanceKey, placing, setPlacing]);\n\n const [firstError] = userErrors;\n // T29: a settled attempt renders as succeeded even across a remount, where this component's own\n // `attempted`/`userErrors` restart at their pre-attempt defaults (FR-1) but the shared `attempt`\n // does not. On the same mount, `attempted && !placing && userErrors.length === 0` already covers it\n // (both a clean `run()` and a clean `resume()` settle through the same wrapper), so this only adds\n // the case local state cannot see.\n const settledAttemptOrderId = attempt?.phase === 'settled' ? attempt.orderId : null;\n const settledAttemptOrderNodeId = attempt?.phase === 'settled' ? (attempt.orderNodeId ?? null) : null;\n const succeeded = (attempted && !placing && userErrors.length === 0) || attempt?.phase === 'settled';\n // T29 (FR-2, FR-3): the next click finalizes rather than re-runs the sequence. Never true once\n // `succeeded` is (phases are mutually exclusive), and `placing` already takes priority in the label\n // below, so this needs no exclusion of its own here. The `'sent'` check is defensive-only today: no\n // write site in `run()` rests there (it writes `finalizing` directly, same tick, specs/make-an-order-\n // attempt-survive-a.md §2) — kept in case a future write path ever rests there again, rather than\n // silently treating that phase as non-resumable.\n const resumable = attempt?.phase === 'sent' || attempt?.phase === 'unresolved';\n // Local `orderId` (this mount's own settle) is preferred; a remounted CTA reading a settled attempt\n // has none of its own yet, so it falls back to the record's.\n const displayOrderId = orderId ?? settledAttemptOrderId;\n const displayOrderNodeId = orderNodeId ?? settledAttemptOrderNodeId;\n // T176 (FR-10, INV-11): the card was handed to the gateway and the order could not be confirmed, so\n // the payment may still be processing. That is a pending state, not a refusal: it renders in its own\n // status node, never in the alert stores style as an error, and never beside a success line — another\n // composed CTA can settle the shared record while this one still holds the outcome.\n const unconfirmed = firstError?.code === 'PLACE_ORDER_UNCONFIRMED';\n\n // T29: `sectionPlacing` overrides `resumable` below, not the other way round — a CTA that unmounted\n // mid-sequence (FR-5) leaves its own key published forever, because the `run()`/`resume()` closure it\n // abandoned settles through *local* state (`setPlacing(false)` inside `usePlaceOrder`'s own `settle`)\n // that has nowhere left to render once that CTA is gone, so the shared key it once set is never\n // retracted by anything else either. A resumable attempt must still be reachable through that stale\n // lock: `resume()` cannot re-pay by construction (Decision 3), so overriding a stuck `sectionPlacing`\n // here is safe exactly when it matters — a lock a *different*, still-genuinely-placing instance holds\n // is never resumable at the same time (the shared attempt is one fact — Decision 1 — so a real\n // concurrent opener keeps this attempt at `opening`/`finalizing`, not `sent`/`unresolved`).\n const blockedByOtherInstance = sectionPlacing && !resumable;\n\n function handleClick() {\n // FR-2 (T56): `setAttempted(true)` moved off the click and onto settlement, so `succeeded`\n // means \"an attempt settled with no refusals\" rather than \"a click happened and nothing is\n // in flight\". `placeOrder()` resolves; it never rejects (T13's own contract), and this\n // component reflects its state from the hook's own return value on every render rather than\n // from the awaited result — a rejection handler here would be dead code, and (review finding\n // F3) setting `attempted` from one would not \"keep the CTA disabled\": it would make\n // `succeeded` `true` with the attempt's real outcome unknown, the exact false-success frame\n // FR-2 exists to prevent.\n //\n // Review finding F1: settling `attempted` is not enough on its own past the first attempt.\n // Once an attempt settles, `attempted` stays `true` until something lowers it — and nothing\n // did, so a second click's own synchronous commit (`placeOrder` resets `userErrors` to `[]`\n // unconditionally, and a refusal leaves `placing` `false`) satisfied `succeeded` immediately,\n // one microtask before the new refusal arrived. Resetting `attempted` here, in the same\n // synchronous batch as that reset, makes every attempt — not just the first — start its own\n // click commit from \"not attempted\"; the `.then` below raises it again only once *this*\n // attempt's own outcome is in.\n setAttempted(false);\n //\n // T212: a refusal raised before anything left the browser (`reachedGateway === false`) that names an\n // element the shopper must fix moves focus there, once, as the continuation of this one click. A\n // result the gateway returned never does, whatever its code. Imperative on purpose, unlike the rest\n // of this component: derived from render state it would also fire on a remount or a re-render.\n void placeOrder().then(({ userErrors: refusals, reachedGateway }) => {\n setAttempted(true);\n const target = refusalFocusTarget(refusals, reachedGateway);\n if (target) focusRefusal(target);\n });\n }\n\n let buttonLabelField: 'placingLabel' | 'resumeLabel' | 'label' = 'label';\n if (placing) buttonLabelField = 'placingLabel';\n else if (resumable) buttonLabelField = 'resumeLabel';\n\n return (\n <div\n {...props}\n className={className}\n data-fs-place-order=\"\"\n {...(placing ? { 'data-fs-place-order-pending': '' } : {})}\n >\n <Button\n onClick={handleClick}\n disabled={placing || succeeded || blockedByOtherInstance}\n aria-busy={placing || undefined}\n data-fs-place-order-button=\"\"\n {...(placing ? { 'data-fs-place-order-button-pending': '' } : {})}\n >\n {format(buttonLabelField)}\n </Button>\n <PlaceOrderFeedback\n placing={placing}\n firstError={firstError}\n unconfirmed={unconfirmed}\n succeeded={succeeded}\n displayOrderId={displayOrderId}\n format={format}\n />\n <PlaceOrderNavigateOnSuccess successHref={successHref} orderNodeId={displayOrderNodeId} userErrors={userErrors} />\n <PlaceOrderNavigateOnRedirect redirectUrl={redirectUrl} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,MAAM,WAAyB;;;;;;;;;;;;;;;;;;;;;;;AA0D/B,MAAa,oBAAoB,kBAAkB;CACjD,IAAI;CACJ,OAAO;CACP,aACE;CACF,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,OAAO;IAAE,MAAM;IAAU,OAAO;IAAgB,QAAQ;IAAe,eAAe;GAAc;GACpG,cAAc;IACZ,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,gBAAgB;IACd,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;IACf,iBAAiB;GACnB;GACA,aAAa;IACX,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,gBAAgB;IACd,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,0BAA0B;IACxB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,sBAAsB;IACpB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,2BAA2B;IACzB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,qBAAqB;IACnB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,wBAAwB;IACtB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,wBAAwB;IACtB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,0BAA0B;IACxB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,8BAA8B;IAC5B,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;GACA,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EAAE,sCAAsC,GAAG,IAAI,CAAC;IAE9D,UAAA,OAAO,gBAAgB;GAClB,CAAA;GACR,oBAAC,oBAAD;IACW;IACG;IACC;IACF;IACK;IACR;GACT,CAAA;GACD,oBAAC,6BAAD;IAA0C;IAAa,aAAa;IAAgC;GAAa,CAAA;GACjH,oBAAC,8BAAD,EAA2C,YAAc,CAAA;EACtD;;AAET"}
@@ -1,3 +1,4 @@
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 "../../sdk/generated/graphql.js";
@@ -42,6 +43,145 @@ type RawPricingData = {
42
43
  }>;
43
44
  };
44
45
  };
46
+ export declare const PricingInstallmentContent: {
47
+ readonly id: "pricing-installment";
48
+ readonly title: "Pricing Installment";
49
+ readonly description: "Text of an installment line.";
50
+ readonly schema: {
51
+ readonly type: "object";
52
+ readonly additionalProperties: false;
53
+ readonly properties: {
54
+ readonly template: {
55
+ readonly type: "string";
56
+ readonly title: "Installment";
57
+ readonly format: "icu-message";
58
+ readonly messageSource: "{count}x of {value}";
59
+ readonly messageArguments: {
60
+ readonly type: "object";
61
+ readonly properties: {
62
+ readonly count: {
63
+ readonly type: "integer";
64
+ };
65
+ readonly value: {
66
+ readonly type: "string";
67
+ };
68
+ };
69
+ };
70
+ readonly messageExample: {
71
+ readonly count: 10;
72
+ readonly value: "$19.90";
73
+ };
74
+ };
75
+ readonly interestFreeLabel: {
76
+ readonly type: "string";
77
+ readonly title: "Interest-free label";
78
+ readonly format: "icu-message";
79
+ readonly messageSource: "interest-free";
80
+ };
81
+ };
82
+ };
83
+ };
84
+ export declare const PricingDiscountContent: {
85
+ readonly id: "pricing-discount";
86
+ readonly title: "Pricing Discount";
87
+ readonly description: "Text of the list-price discount badge.";
88
+ readonly schema: {
89
+ readonly type: "object";
90
+ readonly additionalProperties: false;
91
+ readonly properties: {
92
+ readonly percentageTemplate: {
93
+ readonly type: "string";
94
+ readonly title: "Percentage discount";
95
+ readonly format: "icu-message";
96
+ readonly messageSource: "-{percentage}%";
97
+ readonly messageArguments: {
98
+ readonly type: "object";
99
+ readonly properties: {
100
+ readonly percentage: {
101
+ readonly type: "integer";
102
+ };
103
+ };
104
+ };
105
+ readonly messageExample: {
106
+ readonly percentage: 25;
107
+ };
108
+ };
109
+ readonly amountTemplate: {
110
+ readonly type: "string";
111
+ readonly title: "Amount discount";
112
+ readonly format: "icu-message";
113
+ readonly messageSource: "-{amount}";
114
+ readonly messageArguments: {
115
+ readonly type: "object";
116
+ readonly properties: {
117
+ readonly amount: {
118
+ readonly type: "string";
119
+ };
120
+ };
121
+ };
122
+ readonly messageExample: {
123
+ readonly amount: "$10.00";
124
+ };
125
+ };
126
+ };
127
+ };
128
+ };
129
+ export declare const PricingSpotDiscountContent: {
130
+ readonly id: "pricing-spot-discount";
131
+ readonly title: "Pricing Spot Discount";
132
+ readonly description: "Text of the spot-price discount badge.";
133
+ readonly schema: {
134
+ readonly type: "object";
135
+ readonly additionalProperties: false;
136
+ readonly properties: {
137
+ readonly template: {
138
+ readonly type: "string";
139
+ readonly title: "Spot discount";
140
+ readonly format: "icu-message";
141
+ readonly messageSource: "-{percentage}%";
142
+ readonly messageArguments: {
143
+ readonly type: "object";
144
+ readonly properties: {
145
+ readonly percentage: {
146
+ readonly type: "integer";
147
+ };
148
+ };
149
+ };
150
+ readonly messageExample: {
151
+ readonly percentage: 10;
152
+ };
153
+ };
154
+ };
155
+ };
156
+ };
157
+ export declare const PricingPromotionContent: {
158
+ readonly id: "pricing-promotion";
159
+ readonly title: "Pricing Promotion";
160
+ readonly description: "Text of a promotion line.";
161
+ readonly schema: {
162
+ readonly type: "object";
163
+ readonly additionalProperties: false;
164
+ readonly properties: {
165
+ readonly template: {
166
+ readonly type: "string";
167
+ readonly title: "Promotion";
168
+ readonly format: "icu-message";
169
+ readonly messageSource: "{name}";
170
+ readonly messageArguments: {
171
+ readonly type: "object";
172
+ readonly properties: {
173
+ readonly name: {
174
+ readonly type: "string";
175
+ };
176
+ };
177
+ };
178
+ readonly messageExample: {
179
+ readonly name: "Buy 3, get 2";
180
+ };
181
+ };
182
+ };
183
+ };
184
+ };
45
185
  type InstallmentData = {
46
186
  count: number;
47
187
  value: number;
@@ -73,22 +213,21 @@ export type PricingPaymentMethodsListProps = ComponentPropsWithRef<'div'>;
73
213
  export type PricingPaymentMethodsTabListProps = ComponentPropsWithRef<'div'>;
74
214
  export type PricingPaymentMethodsTabPanelsProps = ComponentPropsWithRef<'div'>;
75
215
  export type PricingPaymentMethodNameProps = ComponentPropsWithRef<'span'>;
76
- export type PricingInstallmentProps = ComponentPropsWithRef<'span'> & {
77
- template?: string;
78
- interestFreeLabel?: string;
216
+ export type PricingInstallmentProps = ComponentPropsWithRef<'span'> & MessageLocaleProp & {
217
+ $content?: ContentValue<typeof PricingInstallmentContent>;
79
218
  };
80
- export type PricingDiscountProps = ComponentPropsWithRef<'span'> & {
81
- template?: string;
219
+ export type PricingDiscountProps = ComponentPropsWithRef<'span'> & MessageLocaleProp & {
82
220
  format?: 'percentage' | 'absolute';
221
+ $content?: ContentValue<typeof PricingDiscountContent>;
83
222
  };
84
223
  export type PricingHighlightsProps = ComponentPropsWithRef<'div'>;
85
224
  export type PricingHighlightProps = ComponentPropsWithRef<'span'>;
86
225
  export type PricingPromotionsProps = ComponentPropsWithRef<'div'>;
87
- export type PricingPromotionProps = ComponentPropsWithRef<'span'> & {
88
- template?: string;
226
+ export type PricingPromotionProps = ComponentPropsWithRef<'span'> & MessageLocaleProp & {
227
+ $content?: ContentValue<typeof PricingPromotionContent>;
89
228
  };
90
- export type PricingSpotDiscountProps = ComponentPropsWithRef<'span'> & {
91
- template?: string;
229
+ export type PricingSpotDiscountProps = ComponentPropsWithRef<'span'> & MessageLocaleProp & {
230
+ $content?: ContentValue<typeof PricingSpotDiscountContent>;
92
231
  };
93
232
  export declare function useInstallmentPlanItem(caller?: string, parent?: string): InstallmentPlanItemContextData;
94
233
  export declare const PricingRootDefinition: ComponentDefinition<PricingRootProps>;
@@ -127,13 +266,13 @@ export declare function PricingPaymentMethodsList({ className, children, ...prop
127
266
  export declare function PricingPaymentMethodsTabList({ className, children, ...props }: PricingPaymentMethodsTabListProps): import("react/jsx-runtime").JSX.Element | null;
128
267
  export declare function PricingPaymentMethodsTabPanels({ className, children, ...props }: PricingPaymentMethodsTabPanelsProps): import("react/jsx-runtime").JSX.Element | null;
129
268
  export declare function PricingPaymentMethodName({ className, children, ...props }: PricingPaymentMethodNameProps): import("react/jsx-runtime").JSX.Element;
130
- export declare function PricingInstallment({ template, interestFreeLabel, className, children, ...props }: PricingInstallmentProps): import("react/jsx-runtime").JSX.Element | null;
131
- export declare function PricingDiscount({ template, format, className, children, ...props }: PricingDiscountProps): import("react/jsx-runtime").JSX.Element | null;
132
- export declare function PricingSpotDiscount({ template, className, children, ...props }: PricingSpotDiscountProps): import("react/jsx-runtime").JSX.Element | null;
269
+ export declare function PricingInstallment({ $content, $locale, className, children, ...props }: PricingInstallmentProps): import("react/jsx-runtime").JSX.Element | null;
270
+ export declare function PricingDiscount({ format, $content, $locale, className, children, ...props }: PricingDiscountProps): import("react/jsx-runtime").JSX.Element | null;
271
+ export declare function PricingSpotDiscount({ $content, $locale, className, children, ...props }: PricingSpotDiscountProps): import("react/jsx-runtime").JSX.Element | null;
133
272
  export declare function PricingHighlights({ className, children, ...props }: PricingHighlightsProps): import("react/jsx-runtime").JSX.Element | null;
134
273
  export declare function PricingHighlight({ className, children, ...props }: PricingHighlightProps): import("react/jsx-runtime").JSX.Element;
135
274
  export declare function PricingPromotions({ className, children, ...props }: PricingPromotionsProps): import("react/jsx-runtime").JSX.Element | null;
136
- export declare function PricingPromotion({ template, className, children, ...props }: PricingPromotionProps): import("react/jsx-runtime").JSX.Element;
275
+ export declare function PricingPromotion({ $content, $locale, className, children, ...props }: PricingPromotionProps): import("react/jsx-runtime").JSX.Element;
137
276
  export declare function PricingSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>): import("react/jsx-runtime").JSX.Element;
138
277
  export declare const Pricing: {
139
278
  Root: typeof PricingRoot;