@vtex/faststore 0.0.10 → 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 (506) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +0 -1
  3. package/dist/actions.json +6 -1
  4. package/dist/catalog.json +789 -1701
  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 +63 -57
  13. package/dist/components.js +60 -54
  14. package/dist/content-types.json +5785 -754
  15. package/dist/core/dist/define-component.d.ts +1 -1
  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-menu.md +14 -15
  24. package/dist/docs/account-saved-cards.md +44 -39
  25. package/dist/docs/alert-dialog.md +3 -1
  26. package/dist/docs/avatar.md +4 -2
  27. package/dist/docs/billing-address.md +99 -30
  28. package/dist/docs/binding-switcher.md +5 -2
  29. package/dist/docs/buy-button.md +7 -8
  30. package/dist/docs/card-entry.md +39 -26
  31. package/dist/docs/card-summary.md +18 -8
  32. package/dist/docs/cardholder-document.md +5 -3
  33. package/dist/docs/carousel.md +5 -4
  34. package/dist/docs/cart-destination.md +39 -26
  35. package/dist/docs/cart-item.md +29 -14
  36. package/dist/docs/cart-totalizer.md +7 -5
  37. package/dist/docs/cart.md +135 -41
  38. package/dist/docs/challenge-return.md +135 -0
  39. package/dist/docs/client-preferences-fieldset.md +10 -5
  40. package/dist/docs/client-preferences.md +31 -8
  41. package/dist/docs/client-profile-fieldset.md +20 -6
  42. package/dist/docs/client-profile.md +12 -3
  43. package/dist/docs/copy-text.md +9 -7
  44. package/dist/docs/document-field.md +1 -1
  45. package/dist/docs/email-field.md +2 -1
  46. package/dist/docs/email-identification.md +12 -2
  47. package/dist/docs/footer-copyright.md +4 -2
  48. package/dist/docs/form.md +54 -18
  49. package/dist/docs/free-shipping-progress.md +6 -5
  50. package/dist/docs/identity-edit.md +8 -2
  51. package/dist/docs/identity-summary.md +18 -5
  52. package/dist/docs/installments.md +46 -32
  53. package/dist/docs/my-account-profile.md +16 -11
  54. package/dist/docs/navigation-link.md +5 -3
  55. package/dist/docs/order-cancel.md +3 -1
  56. package/dist/docs/order-delivery-address.md +7 -5
  57. package/dist/docs/order-delivery-group.md +1 -3
  58. package/dist/docs/order-details-back.md +1 -1
  59. package/dist/docs/order-details-header.md +1 -4
  60. package/dist/docs/order-invoice-download.md +60 -0
  61. package/dist/docs/order-list-row.md +1 -1
  62. package/dist/docs/order-list-search.md +13 -20
  63. package/dist/docs/order-list-views.md +11 -17
  64. package/dist/docs/order-list.md +12 -5
  65. package/dist/docs/order-payment.md +9 -7
  66. package/dist/docs/order-placed-date.md +1 -1
  67. package/dist/docs/order-placed-payment-summary.md +28 -15
  68. package/dist/docs/order-placed.md +49 -14
  69. package/dist/docs/order-progress.md +1 -1
  70. package/dist/docs/order-status-badge.md +20 -9
  71. package/dist/docs/order-summary.md +2 -2
  72. package/dist/docs/order-tracking-link.md +58 -0
  73. package/dist/docs/payment-method-badges.md +30 -4
  74. package/dist/docs/payment-methods.md +1 -1
  75. package/dist/docs/payment.md +36 -17
  76. package/dist/docs/phone-field.md +4 -4
  77. package/dist/docs/place-order.md +84 -36
  78. package/dist/docs/postal-code-field.md +3 -1
  79. package/dist/docs/pricing.md +21 -23
  80. package/dist/docs/product-gallery.md +19 -20
  81. package/dist/docs/product-information.md +13 -9
  82. package/dist/docs/product-list.md +7 -6
  83. package/dist/docs/product-shelf.md +0 -1
  84. package/dist/docs/promotion.md +4 -2
  85. package/dist/docs/region.md +23 -15
  86. package/dist/docs/save-card.md +7 -6
  87. package/dist/docs/saved-cards.md +65 -36
  88. package/dist/docs/shipping-address.md +57 -21
  89. package/dist/docs/shipping-simulator.md +53 -15
  90. package/dist/docs/sign-in-disclosure.md +176 -0
  91. package/dist/docs/sign-in-form.md +78 -47
  92. package/dist/docs/sign-in-redirect.md +4 -2
  93. package/dist/docs/sign-in.md +173 -0
  94. package/dist/docs/toast.md +15 -4
  95. package/dist/docs/variant-selector.md +15 -11
  96. package/dist/graphql/types.d.ts +4 -14
  97. package/dist/index.d.ts +2 -2
  98. package/dist/internal/client.d.ts +1 -3
  99. package/dist/internal/client.js +1 -1
  100. package/dist/internal/server.d.ts +7 -4
  101. package/dist/internal/server.js +7 -4
  102. package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
  103. package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
  104. package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
  105. package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
  106. package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
  107. package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
  108. package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
  109. package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
  110. package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
  111. package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
  112. package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
  113. package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
  114. package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
  115. package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
  116. package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
  117. package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
  118. package/dist/matter/account-address-book/account-address-book.js +74 -33
  119. package/dist/matter/account-address-book/account-address-book.js.map +1 -1
  120. package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
  121. package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
  122. package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
  123. package/dist/matter/account-address-book/account-address-country.js +83 -49
  124. package/dist/matter/account-address-book/account-address-country.js.map +1 -1
  125. package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
  126. package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
  127. package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
  128. package/dist/matter/account-address-book/account-address-form.js +518 -155
  129. package/dist/matter/account-address-book/account-address-form.js.map +1 -1
  130. package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
  131. package/dist/matter/account-address-book/account-address-record.js +32 -17
  132. package/dist/matter/account-address-book/account-address-record.js.map +1 -1
  133. package/dist/matter/account-menu/account-menu.d.ts +34 -17
  134. package/dist/matter/account-menu/account-menu.js +46 -54
  135. package/dist/matter/account-menu/account-menu.js.map +1 -1
  136. package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
  137. package/dist/matter/account-saved-cards/account-saved-cards.d.ts +108 -28
  138. package/dist/matter/account-saved-cards/account-saved-cards.js +177 -122
  139. package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -1
  140. package/dist/matter/billing-address/billing-address.d.ts +156 -74
  141. package/dist/matter/billing-address/billing-address.js +227 -156
  142. package/dist/matter/billing-address/billing-address.js.map +1 -1
  143. package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
  144. package/dist/matter/breadcrumb/breadcrumb.js +24 -9
  145. package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
  146. package/dist/matter/buy-button/buy-button.d.ts +8 -11
  147. package/dist/matter/buy-button/buy-button.js +10 -19
  148. package/dist/matter/buy-button/buy-button.js.map +1 -1
  149. package/dist/matter/card-entry/card-capture.js +12 -4
  150. package/dist/matter/card-entry/card-capture.js.map +1 -1
  151. package/dist/matter/card-entry/card-entry.d.ts +123 -32
  152. package/dist/matter/card-entry/card-entry.js +348 -221
  153. package/dist/matter/card-entry/card-entry.js.map +1 -1
  154. package/dist/matter/cart/cart-namespace.d.ts +7 -1
  155. package/dist/matter/cart/cart-namespace.js +7 -1
  156. package/dist/matter/cart/cart-namespace.js.map +1 -1
  157. package/dist/matter/cart/cart.d.ts +402 -61
  158. package/dist/matter/cart/cart.js +624 -153
  159. package/dist/matter/cart/cart.js.map +1 -1
  160. package/dist/matter/cart-destination/cart-destination.d.ts +30 -19
  161. package/dist/matter/cart-destination/cart-destination.js +160 -70
  162. package/dist/matter/cart-destination/cart-destination.js.map +1 -1
  163. package/dist/matter/cart-item/cart-item.d.ts +144 -17
  164. package/dist/matter/cart-item/cart-item.js +166 -49
  165. package/dist/matter/cart-item/cart-item.js.map +1 -1
  166. package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
  167. package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
  168. package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
  169. package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
  170. package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
  171. package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
  172. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
  173. package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
  174. package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
  175. package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
  176. package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
  177. package/dist/matter/cart-totalizer/cart-totalizer.js +46 -17
  178. package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
  179. package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
  180. package/dist/matter/challenge-return/challenge-return.js +241 -0
  181. package/dist/matter/challenge-return/challenge-return.js.map +1 -0
  182. package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
  183. package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
  184. package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
  185. package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
  186. package/dist/matter/client-preferences/client-preferences.js +84 -15
  187. package/dist/matter/client-preferences/client-preferences.js.map +1 -1
  188. package/dist/matter/client-profile/client-profile.d.ts +44 -9
  189. package/dist/matter/client-profile/client-profile.js +64 -24
  190. package/dist/matter/client-profile/client-profile.js.map +1 -1
  191. package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
  192. package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
  193. package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
  194. package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
  195. package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
  196. package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
  197. package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
  198. package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
  199. package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
  200. package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
  201. package/dist/matter/delivery-options/delivery-options.js +75 -12
  202. package/dist/matter/delivery-options/delivery-options.js.map +1 -1
  203. package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
  204. package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
  205. package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
  206. package/dist/matter/email-identification/email-identification.d.ts +25 -3
  207. package/dist/matter/email-identification/email-identification.js +49 -12
  208. package/dist/matter/email-identification/email-identification.js.map +1 -1
  209. package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +79 -7
  210. package/dist/matter/free-shipping-progress/free-shipping-progress.js +77 -20
  211. package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
  212. package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
  213. package/dist/matter/identity-edit/identity-edit.js +47 -19
  214. package/dist/matter/identity-edit/identity-edit.js.map +1 -1
  215. package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
  216. package/dist/matter/identity-summary/identity-summary.js +95 -45
  217. package/dist/matter/identity-summary/identity-summary.js.map +1 -1
  218. package/dist/matter/installments/installments-select.d.ts +98 -16
  219. package/dist/matter/installments/installments-select.js +156 -48
  220. package/dist/matter/installments/installments-select.js.map +1 -1
  221. package/dist/matter/installments/installments.d.ts +96 -16
  222. package/dist/matter/installments/installments.js +115 -40
  223. package/dist/matter/installments/installments.js.map +1 -1
  224. package/dist/matter/installments/use-installments-selection.d.ts +1 -0
  225. package/dist/matter/installments/use-installments-selection.js +8 -3
  226. package/dist/matter/installments/use-installments-selection.js.map +1 -1
  227. package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
  228. package/dist/matter/my-account-profile/my-account-profile.js +370 -174
  229. package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
  230. package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
  231. package/dist/matter/order-cancel/order-cancel.js +118 -51
  232. package/dist/matter/order-cancel/order-cancel.js.map +1 -1
  233. package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
  234. package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
  235. package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
  236. package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
  237. package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
  238. package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
  239. package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
  240. package/dist/matter/order-details-header/order-details-header.js +66 -58
  241. package/dist/matter/order-details-header/order-details-header.js.map +1 -1
  242. package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
  243. package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
  244. package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
  245. package/dist/matter/order-list/order-list.d.ts +164 -19
  246. package/dist/matter/order-list/order-list.js +229 -87
  247. package/dist/matter/order-list/order-list.js.map +1 -1
  248. package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
  249. package/dist/matter/order-list-row/order-list-row.js +3 -2
  250. package/dist/matter/order-list-row/order-list-row.js.map +1 -1
  251. package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
  252. package/dist/matter/order-list-search/order-list-search.js +30 -69
  253. package/dist/matter/order-list-search/order-list-search.js.map +1 -1
  254. package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
  255. package/dist/matter/order-list-views/order-list-views.js +22 -68
  256. package/dist/matter/order-list-views/order-list-views.js.map +1 -1
  257. package/dist/matter/order-payment/order-payment.d.ts +33 -10
  258. package/dist/matter/order-payment/order-payment.js +44 -39
  259. package/dist/matter/order-payment/order-payment.js.map +1 -1
  260. package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
  261. package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
  262. package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
  263. package/dist/matter/order-placed/order-placed.d.ts +198 -31
  264. package/dist/matter/order-placed/order-placed.js +230 -139
  265. package/dist/matter/order-placed/order-placed.js.map +1 -1
  266. package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
  267. package/dist/matter/order-placed-date/order-placed-date.js +7 -8
  268. package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
  269. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
  270. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
  271. package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
  272. package/dist/matter/order-progress/order-progress.d.ts +19 -8
  273. package/dist/matter/order-progress/order-progress.js +37 -45
  274. package/dist/matter/order-progress/order-progress.js.map +1 -1
  275. package/dist/matter/order-summary/order-summary.d.ts +19 -9
  276. package/dist/matter/order-summary/order-summary.js +38 -44
  277. package/dist/matter/order-summary/order-summary.js.map +1 -1
  278. package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
  279. package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
  280. package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
  281. package/dist/matter/payment/payment-card-capture.js +17 -10
  282. package/dist/matter/payment/payment-card-capture.js.map +1 -1
  283. package/dist/matter/payment/payment-controller.d.ts +4 -2
  284. package/dist/matter/payment/payment-controller.js +30 -9
  285. package/dist/matter/payment/payment-controller.js.map +1 -1
  286. package/dist/matter/payment/payment-method-badges.js +1 -1
  287. package/dist/matter/payment/payment.d.ts +69 -19
  288. package/dist/matter/payment/payment.js +101 -35
  289. package/dist/matter/payment/payment.js.map +1 -1
  290. package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
  291. package/dist/matter/payment/use-payment-method-selection.js +94 -32
  292. package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
  293. package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
  294. package/dist/matter/payment/use-payment-submit-gate.js +47 -8
  295. package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
  296. package/dist/matter/place-order/place-order.d.ts +171 -57
  297. package/dist/matter/place-order/place-order.js +376 -185
  298. package/dist/matter/place-order/place-order.js.map +1 -1
  299. package/dist/matter/pricing/pricing.d.ts +152 -13
  300. package/dist/matter/pricing/pricing.js +153 -52
  301. package/dist/matter/pricing/pricing.js.map +1 -1
  302. package/dist/matter/product-information/product-information.d.ts +27 -4
  303. package/dist/matter/product-information/product-information.js +32 -15
  304. package/dist/matter/product-information/product-information.js.map +1 -1
  305. package/dist/matter/product-list/product-list.d.ts +24 -6
  306. package/dist/matter/product-list/product-list.js +32 -26
  307. package/dist/matter/product-list/product-list.js.map +1 -1
  308. package/dist/matter/product-shelf/product-shelf.d.ts +1 -3
  309. package/dist/matter/product-shelf/product-shelf.js +2 -15
  310. package/dist/matter/product-shelf/product-shelf.js.map +1 -1
  311. package/dist/matter/region/region.d.ts +33 -16
  312. package/dist/matter/region/region.js +59 -52
  313. package/dist/matter/region/region.js.map +1 -1
  314. package/dist/matter/save-card/save-card.d.ts +43 -8
  315. package/dist/matter/save-card/save-card.js +61 -23
  316. package/dist/matter/save-card/save-card.js.map +1 -1
  317. package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
  318. package/dist/matter/saved-cards/saved-cards.js +349 -77
  319. package/dist/matter/saved-cards/saved-cards.js.map +1 -1
  320. package/dist/matter/shipping-address/address-payload.js +25 -0
  321. package/dist/matter/shipping-address/address-payload.js.map +1 -0
  322. package/dist/matter/shipping-address/country-descriptors.js +71 -71
  323. package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
  324. package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
  325. package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
  326. package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
  327. package/dist/matter/shipping-address/shipping-address.js +443 -188
  328. package/dist/matter/shipping-address/shipping-address.js.map +1 -1
  329. package/dist/matter/shipping-simulator/shipping-simulator.d.ts +250 -24
  330. package/dist/matter/shipping-simulator/shipping-simulator.js +257 -51
  331. package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
  332. package/dist/matter/sign-in/sign-in.d.ts +108 -0
  333. package/dist/matter/sign-in/sign-in.js +285 -0
  334. package/dist/matter/sign-in/sign-in.js.map +1 -0
  335. package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
  336. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
  337. package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
  338. package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
  339. package/dist/matter/sign-in-form/sign-in-form.js +134 -144
  340. package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
  341. package/dist/particles/binding-switcher/binding-switcher.d.ts +29 -8
  342. package/dist/particles/binding-switcher/binding-switcher.js +37 -26
  343. package/dist/particles/binding-switcher/binding-switcher.js.map +1 -1
  344. package/dist/particles/card-summary/card-summary.d.ts +38 -8
  345. package/dist/particles/card-summary/card-summary.js +55 -22
  346. package/dist/particles/card-summary/card-summary.js.map +1 -1
  347. package/dist/particles/carousel/carousel.d.ts +99 -11
  348. package/dist/particles/carousel/carousel.js +103 -35
  349. package/dist/particles/carousel/carousel.js.map +1 -1
  350. package/dist/particles/copy-text/copy-text.js +5 -15
  351. package/dist/particles/copy-text/copy-text.js.map +1 -1
  352. package/dist/particles/dialog/dialog.d.ts +14 -6
  353. package/dist/particles/dialog/dialog.js +6 -3
  354. package/dist/particles/dialog/dialog.js.map +1 -1
  355. package/dist/particles/drawer/drawer.js +1 -1
  356. package/dist/particles/drawer/drawer.js.map +1 -1
  357. package/dist/particles/email-field/email-field.d.ts +2 -1
  358. package/dist/particles/email-field/email-field.js +2 -1
  359. package/dist/particles/email-field/email-field.js.map +1 -1
  360. package/dist/particles/footer-link-group/footer-link-group.js +1 -0
  361. package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
  362. package/dist/particles/form/form.d.ts +85 -13
  363. package/dist/particles/form/form.js +91 -42
  364. package/dist/particles/form/form.js.map +1 -1
  365. package/dist/particles/gallery/gallery.d.ts +129 -12
  366. package/dist/particles/gallery/gallery.js +121 -34
  367. package/dist/particles/gallery/gallery.js.map +1 -1
  368. package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
  369. package/dist/particles/order-details-back/order-details-back.js +8 -10
  370. package/dist/particles/order-details-back/order-details-back.js.map +1 -1
  371. package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
  372. package/dist/particles/order-status-badge/order-status-badge.js +4 -20
  373. package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
  374. package/dist/particles/password-field/password-field.d.ts +1 -1
  375. package/dist/particles/password-field/password-field.js +2 -4
  376. package/dist/particles/password-field/password-field.js.map +1 -1
  377. package/dist/particles/phone-field/phone-field.d.ts +4 -4
  378. package/dist/particles/phone-field/phone-field.js +8 -11
  379. package/dist/particles/phone-field/phone-field.js.map +1 -1
  380. package/dist/particles/spinner/spinner.d.ts +24 -4
  381. package/dist/particles/spinner/spinner.js +25 -9
  382. package/dist/particles/spinner/spinner.js.map +1 -1
  383. package/dist/particles/switch/switch.d.ts +4 -1
  384. package/dist/particles/switch/switch.js +3 -1
  385. package/dist/particles/switch/switch.js.map +1 -1
  386. package/dist/particles/toast/toast.d.ts +29 -3
  387. package/dist/particles/toast/toast.js +34 -10
  388. package/dist/particles/toast/toast.js.map +1 -1
  389. package/dist/schema.graphql +164 -56
  390. package/dist/sdk/address/address-fields.js +4 -4
  391. package/dist/sdk/address/address-fields.js.map +1 -1
  392. package/dist/sdk/address/constants.js +1 -6
  393. package/dist/sdk/address/constants.js.map +1 -1
  394. package/dist/sdk/address/messages.js +44 -44
  395. package/dist/sdk/address/messages.js.map +1 -1
  396. package/dist/sdk/address/postal-code.js +15 -2
  397. package/dist/sdk/address/postal-code.js.map +1 -1
  398. package/dist/sdk/address/types.d.ts +5 -3
  399. package/dist/sdk/address/validate-address.js +3 -3
  400. package/dist/sdk/address/validate-address.js.map +1 -1
  401. package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
  402. package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
  403. package/dist/sdk/cart/use-cart-actions.js.map +1 -1
  404. package/dist/sdk/data/index.js +2 -2
  405. package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
  406. package/dist/sdk/generated/gql.js +1 -1
  407. package/dist/sdk/generated/gql.js.map +1 -1
  408. package/dist/sdk/generated/graphql.d.ts +20 -5
  409. package/dist/sdk/generated/graphql.js +6 -0
  410. package/dist/sdk/generated/graphql.js.map +1 -1
  411. package/dist/sdk/i18n/format-error-code.js +23 -0
  412. package/dist/sdk/i18n/format-error-code.js.map +1 -0
  413. package/dist/sdk/i18n/message-formatter.d.ts +22 -0
  414. package/dist/sdk/i18n/message-formatter.js +140 -0
  415. package/dist/sdk/i18n/message-formatter.js.map +1 -0
  416. package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
  417. package/dist/sdk/i18n/use-message-formatter.js +18 -0
  418. package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
  419. package/dist/sdk/identity/use-identity-actions.js.map +1 -1
  420. package/dist/sdk/navigation/redirect.d.ts +2 -0
  421. package/dist/sdk/navigation/redirect.js +19 -1
  422. package/dist/sdk/navigation/redirect.js.map +1 -1
  423. package/dist/sdk/navigation/types.d.ts +13 -0
  424. package/dist/sdk/payment/bin-format.js +20 -0
  425. package/dist/sdk/payment/bin-format.js.map +1 -0
  426. package/dist/sdk/payment/challenge-return.js +37 -0
  427. package/dist/sdk/payment/challenge-return.js.map +1 -0
  428. package/dist/sdk/payment/confirmation-last-four.js +39 -0
  429. package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
  430. package/dist/sdk/payment/gateway.d.ts +1 -1
  431. package/dist/sdk/payment/gateway.js +8 -2
  432. package/dist/sdk/payment/gateway.js.map +1 -1
  433. package/dist/sdk/payment/operations.d.ts +1 -0
  434. package/dist/sdk/payment/operations.js +28 -6
  435. package/dist/sdk/payment/operations.js.map +1 -1
  436. package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
  437. package/dist/sdk/payment/resumed-purchase.js +119 -0
  438. package/dist/sdk/payment/resumed-purchase.js.map +1 -0
  439. package/dist/sdk/payment/security-code-mask.js +16 -23
  440. package/dist/sdk/payment/security-code-mask.js.map +1 -1
  441. package/dist/sdk/payment/submission-registry.js +6 -2
  442. package/dist/sdk/payment/submission-registry.js.map +1 -1
  443. package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
  444. package/dist/sdk/payment/use-payment-actions.js +23 -3
  445. package/dist/sdk/payment/use-payment-actions.js.map +1 -1
  446. package/dist/sdk/payment/use-place-order.d.ts +10 -2
  447. package/dist/sdk/payment/use-place-order.js +138 -76
  448. package/dist/sdk/payment/use-place-order.js.map +1 -1
  449. package/dist/sdk/provider/storefront-provider.d.ts +1 -7
  450. package/dist/sdk/provider/storefront-provider.js +4 -11
  451. package/dist/sdk/provider/storefront-provider.js.map +1 -1
  452. package/dist/sdk/seo/entity-landing.d.ts +24 -0
  453. package/dist/sdk/seo/entity-landing.js +30 -0
  454. package/dist/sdk/seo/entity-landing.js.map +1 -0
  455. package/dist/sdk/seo/page-alternates.d.ts +3 -2
  456. package/dist/sdk/seo/page-alternates.js +4 -2
  457. package/dist/sdk/seo/page-alternates.js.map +1 -1
  458. package/dist/sdk/seo/search-landing.d.ts +42 -0
  459. package/dist/sdk/seo/search-landing.js +85 -0
  460. package/dist/sdk/seo/search-landing.js.map +1 -0
  461. package/dist/sdk/session/mock-session.d.ts +9 -0
  462. package/dist/sdk/session/mock-session.js +31 -0
  463. package/dist/sdk/session/mock-session.js.map +1 -0
  464. package/dist/sdk/session/read-server-session.d.ts +3 -0
  465. package/dist/sdk/session/read-server-session.js +5 -0
  466. package/dist/sdk/session/read-server-session.js.map +1 -1
  467. package/dist/sdk/session/return-path-segment.d.ts +10 -0
  468. package/dist/sdk/session/return-path-segment.js +15 -0
  469. package/dist/sdk/session/return-path-segment.js.map +1 -0
  470. package/dist/sdk/session/use-session-actions.js.map +1 -1
  471. package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
  472. package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
  473. package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
  474. package/dist/utils/safe-href.d.ts +2 -0
  475. package/package.json +4 -3
  476. package/skills/storefront-asset/SKILL.md +2 -2
  477. package/skills/storefront-asset/references/api-side.md +27 -14
  478. package/skills/storefront-asset/references/findings.md +5 -2
  479. package/src/styles/tailwind.css +8 -0
  480. package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
  481. package/dist/message-locales.json +0 -7
  482. package/dist/sdk/i18n/client.d.ts +0 -4
  483. package/dist/sdk/i18n/client.js +0 -4
  484. package/dist/sdk/i18n/locales.d.ts +0 -8
  485. package/dist/sdk/i18n/locales.js +0 -57
  486. package/dist/sdk/i18n/locales.js.map +0 -1
  487. package/dist/sdk/i18n/messages/en-US.js +0 -183
  488. package/dist/sdk/i18n/messages/en-US.js.map +0 -1
  489. package/dist/sdk/i18n/messages/en-US.json +0 -178
  490. package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -182
  491. package/dist/sdk/i18n/messages/es-ES.js +0 -183
  492. package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
  493. package/dist/sdk/i18n/messages/es-ES.json +0 -178
  494. package/dist/sdk/i18n/messages/pt-BR.js +0 -183
  495. package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
  496. package/dist/sdk/i18n/messages/pt-BR.json +0 -178
  497. package/dist/sdk/i18n/provider.d.ts +0 -1
  498. package/dist/sdk/i18n/provider.js +0 -30
  499. package/dist/sdk/i18n/provider.js.map +0 -1
  500. package/dist/sdk/i18n/server.d.ts +0 -28
  501. package/dist/sdk/i18n/server.js +0 -59
  502. package/dist/sdk/i18n/server.js.map +0 -1
  503. package/dist/utils/resolve-authored-copy.js +0 -18
  504. package/dist/utils/resolve-authored-copy.js.map +0 -1
  505. package/dist/utils/substitute-template.js +0 -33
  506. package/dist/utils/substitute-template.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"my-account-profile.js","names":[],"sources":["../../../src/matter/my-account-profile/my-account-profile.tsx"],"sourcesContent":["'use client';\n\nimport { defineComponent } from '@vtex/fs-core';\nimport {\n type ChangeEvent,\n type ComponentPropsWithRef,\n createContext,\n type ReactNode,\n type SyntheticEvent,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n DOCUMENTS,\n DocumentField,\n isSupportedDocumentType,\n isValidDocument,\n maskDocumentValue,\n} from '../../particles/document-field/document-field.js';\nimport { Field } from '../../particles/field/field.js';\nimport { Input } from '../../particles/input/input.js';\nimport {\n applyPhoneMask,\n type PhoneCountry,\n PhoneField,\n toE164,\n validatePhoneNumber,\n} from '../../particles/phone-field/phone-field.js';\nimport { Select } from '../../particles/select/select.js';\nimport { useToast } from '../../particles/toast/toast.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 { CustomerProfileUserError } from '../../sdk/identity/operations.js';\nimport { loggableErrorName } from '../../utils/loggable-error-name.js';\nimport { useSession } from '../session/session.js';\n\n/**\n * The `my-account-profile` compound (see my-account-profile.md; spec archived at the specs-archive tag) — the data root\n * plus form mechanics for the shopper's persistent account profile. `Root` owns the saved profile,\n * the draft, the view↔edit toggle, and the single batched Save; it publishes a context whose\n * registration API is the seam every field Control attaches to.\n *\n * Unlike `ClientProfileFormRoot`, the Root does not enumerate the field set: a Control registers\n * its key plus an optional validator and normalizer, and the Root derives which fields to validate,\n * which to send, and which to focus from the live registry only. A field absent from the\n * composition is absent from the payload by construction (Decision 1).\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL fragment — raw literal, outside codegen (Decision 8)\n// ---------------------------------------------------------------------------\n\nconst fragment = /* GraphQL */ `\n fragment MyAccountProfileData on Query {\n customerProfile {\n __typename\n id\n firstName\n lastName\n email\n homePhone\n mobilePhone\n document\n documentType\n birthDate\n gender\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * The `$data` slice forwarded by the reactive runtime — the `customerProfile` entity itself, not the\n * `Query` shape the fragment above is authored against. The compiler derives an entity fragment `on\n * CustomerProfile` from the root-field selection for the reactive path (rfc-data-layer.md §\"Entity\n * fragments and schema introspection\"), and `ReactiveDataProvider` publishes that entity data\n * directly — the same convention `SessionRoot` reads `$data.loggedIn` under, not `$data.session`.\n *\n * `null` whenever `customerProfile` is: an anonymous session, or a signed-in read that failed. The\n * Root treats it as unresolved data, so the first renders nothing and the second keeps the skeleton.\n */\nexport type MyAccountProfileData = {\n id?: string | null;\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n homePhone?: string | null;\n mobilePhone?: string | null;\n document?: string | null;\n documentType?: string | null;\n birthDate?: string | null;\n gender?: string | null;\n} | null;\n\n/**\n * The shopper-editable keys. `email` is absent (login identifier) and `documentType` is absent\n * (read for the tax-ID control's active type; not writable in V0).\n */\nexport type MyAccountProfileFieldKey =\n | 'firstName'\n | 'lastName'\n | 'homePhone'\n | 'mobilePhone'\n | 'document'\n | 'birthDate'\n | 'gender';\n\nconst FIELD_KEYS: readonly MyAccountProfileFieldKey[] = [\n 'firstName',\n 'lastName',\n 'homePhone',\n 'mobilePhone',\n 'document',\n 'birthDate',\n 'gender',\n];\n\nexport type MyAccountProfileMode = 'view' | 'edit';\n\n/** Every editable key, always a string — a `null` upstream value is seeded as `''`. */\nexport type MyAccountProfileValues = Readonly<Record<MyAccountProfileFieldKey, string>>;\n\n/**\n * What a Control hands the Root. `validate` returns a message when the value is unacceptable and\n * `null` when it is fine — requiredness is expressed as a validator that rejects `''`. `normalize`\n * is applied on Save, to dirty values only.\n */\nexport type MyAccountProfileFieldRegistration = Readonly<{\n key: MyAccountProfileFieldKey;\n validate?: (value: string) => string | null;\n normalize?: (value: string) => string;\n}>;\n\nexport type MyAccountProfileFieldErrors = Readonly<Partial<Record<MyAccountProfileFieldKey, string>>>;\n\nexport type MyAccountProfileContextValue = Readonly<{\n mode: MyAccountProfileMode;\n savedValues: MyAccountProfileValues;\n draft: MyAccountProfileValues;\n fieldErrors: MyAccountProfileFieldErrors;\n email: string;\n activeDocumentType: string | undefined;\n pending: boolean;\n registerField: (registration: MyAccountProfileFieldRegistration) => () => void;\n setField: (key: MyAccountProfileFieldKey, value: string) => void;\n edit: () => void;\n cancel: () => void;\n}>;\n\nexport type MyAccountProfileRootProps = Readonly<{\n /** Store-configured tax-ID type fallback, used when the saved `documentType` is not registered. */\n documentType?: string;\n saveFailedMessage?: string;\n savedMessage?: string;\n className?: string;\n children?: ReactNode;\n $data?: MyAccountProfileData;\n /** Compiler-injected action surface; carries `identity.customerProfileUpdate`. */\n $actions?: ComponentActions;\n}>;\n\nexport type MyAccountProfileEditButtonProps = Readonly<{ label?: string; className?: string; children?: ReactNode }>;\nexport type MyAccountProfileSaveButtonProps = Readonly<{ label?: string; className?: string; children?: ReactNode }>;\nexport type MyAccountProfileCancelButtonProps = Readonly<{\n label?: string;\n className?: string;\n children?: ReactNode;\n}>;\nexport type MyAccountProfileEmailProps = Readonly<{ className?: string }>;\n\nconst DEFAULT_SAVE_FAILED_MESSAGE = 'Unable to save your profile. Please try again.';\nconst DEFAULT_SAVED_MESSAGE = 'Your profile has been saved.';\n\nfunction buildSavedValues($data: MyAccountProfileData | undefined): MyAccountProfileValues {\n return {\n firstName: $data?.firstName ?? '',\n lastName: $data?.lastName ?? '',\n homePhone: $data?.homePhone ?? '',\n mobilePhone: $data?.mobilePhone ?? '',\n document: $data?.document ?? '',\n birthDate: $data?.birthDate ?? '',\n gender: $data?.gender ?? '',\n };\n}\n\n/**\n * Native `<input type=\"date\">` values and the profile's stored `birthDate` are both `yyyy-mm-dd`.\n * `toNativeDate` stays defensive against a `yyyy-mm-ddTHH:mm:ss...` upstream value slipping through\n * unnormalized — the resolver already strips the time component, this is a second line of defense —\n * since the native input rejects anything but the date-only form outright.\n */\nfunction toNativeDate(stored: string): string {\n const [datePart] = stored.split('T');\n return datePart ?? '';\n}\nfunction toStoredDate(native: string): string {\n return native;\n}\n\nconst DEFAULT_GENDER_OPTIONS: readonly MyAccountProfileGenderOption[] = [\n { value: 'female', label: 'Female' },\n { value: 'male', label: 'Male' },\n { value: 'other', label: 'Other' },\n { value: 'prefer_not_to_say', label: 'Prefer not to say' },\n];\n\n// ---------------------------------------------------------------------------\n// Context — Root publishes the draft + registration API to its Controls\n// ---------------------------------------------------------------------------\n\nconst MY_ACCOUNT_PROFILE_UNSET = Symbol('MyAccountProfileContextUnset');\n\nconst MyAccountProfileContext = createContext<MyAccountProfileContextValue | typeof MY_ACCOUNT_PROFILE_UNSET>(\n MY_ACCOUNT_PROFILE_UNSET,\n);\n\n/** Throws when used outside `MyAccountProfileRoot`, per ADR-0009. */\nexport function useMyAccountProfile(): MyAccountProfileContextValue {\n const ctx = useContext(MyAccountProfileContext);\n if (ctx === MY_ACCOUNT_PROFILE_UNSET) {\n throw new Error('MyAccountProfile components must be used inside MyAccountProfileRoot.');\n }\n return ctx;\n}\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileRootDefinition = defineComponent<MyAccountProfileRootProps>({\n name: 'MyAccountProfileRoot',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileRoot,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'session',\n providesContext: 'my-account-profile',\n actions: { identity: ['customerProfileUpdate'] },\n skeleton: MyAccountProfileSkeleton,\n editor: { label: 'My Account Profile Root', category: 'identity' },\n schema: {\n documentType: { type: 'string', label: 'Default document type (e.g. CPF)' },\n saveFailedMessage: {\n type: 'string',\n default: 'Unable to save your profile. Please try again.',\n label: 'Save failure message',\n },\n savedMessage: {\n type: 'string',\n default: 'Your profile has been saved.',\n label: 'Save success message',\n },\n },\n guideline:\n 'Data root + form mechanics for the persistent My Account profile: owns the saved profile, the draft, the view/edit toggle, and the single batched Save (dispatches only dirty, registered fields; an empty string erases, an omitted field is untouched). Self-gates on the authenticated (loggedIn) session; requires a SessionRoot ancestor and a mounted ToastProvider ancestor — Save success/failure surface as a toast, not an inline part. Field Controls register their key plus an optional validator and normalizer through useMyAccountProfile() — the field set is a merchant composition decision, never enumerated here. Compose EditButton (view state), SaveButton/CancelButton (edit state), and Email as children in any order. See my-account-profile.md.',\n});\n\nexport function MyAccountProfileRoot({\n $data: $dataProp,\n $actions: $actionsProp,\n documentType: documentTypeProp,\n saveFailedMessage = DEFAULT_SAVE_FAILED_MESSAGE,\n savedMessage = DEFAULT_SAVED_MESSAGE,\n className,\n children,\n}: MyAccountProfileRootProps) {\n // Enforces the SessionRoot ancestor: useSession() throws when rendered outside one.\n const { state } = useSession();\n // Enforces the ToastProvider ancestor: useToast() throws when rendered outside one (Decision 10).\n const toast = useToast();\n const $data = useDataOverride($dataProp);\n const $actions = useActionsOverride($actionsProp);\n const resolved = $data != null;\n\n const savedValues = useMemo(() => buildSavedValues($data), [$data]);\n const savedEmail = $data?.email ?? '';\n const savedDocumentType = $data?.documentType?.toUpperCase();\n const activeDocumentType =\n savedDocumentType && isSupportedDocumentType(savedDocumentType) ? savedDocumentType : documentTypeProp;\n\n const [mode, setMode] = useState<MyAccountProfileMode>('view');\n const [draft, setDraft] = useState<MyAccountProfileValues>(savedValues);\n const [fieldErrors, setFieldErrors] = useState<MyAccountProfileFieldErrors>({});\n const [pending, setPending] = useState(false);\n const [registry, setRegistry] = useState<ReadonlyMap<MyAccountProfileFieldKey, MyAccountProfileFieldRegistration>>(\n () => new Map(),\n );\n\n const formRef = useRef<HTMLFormElement>(null);\n\n // Re-seed pristine fields when the saved profile changes underneath an open edit; a field the\n // shopper has touched (draft no longer equals the previous saved value) is never clobbered. Runs\n // during render (previous-saved in state, not a ref) so the re-seed lands in the same commit.\n const [prevSaved, setPrevSaved] = useState(savedValues);\n const changedKeys = FIELD_KEYS.filter((key) => prevSaved[key] !== savedValues[key]);\n if (changedKeys.length > 0) {\n setPrevSaved(savedValues);\n setDraft((prevDraft) => {\n let next = prevDraft;\n for (const key of changedKeys) {\n if (prevDraft[key] !== prevSaved[key]) continue;\n if (next === prevDraft) next = { ...prevDraft };\n (next as Record<MyAccountProfileFieldKey, string>)[key] = savedValues[key];\n }\n return next;\n });\n }\n\n const registerField = useCallback((registration: MyAccountProfileFieldRegistration) => {\n setRegistry((prev) => {\n const next = new Map(prev);\n next.set(registration.key, registration);\n return next;\n });\n return () => {\n setRegistry((prev) => {\n if (!prev.has(registration.key)) return prev;\n const next = new Map(prev);\n next.delete(registration.key);\n return next;\n });\n };\n }, []);\n\n const setField = useCallback((key: MyAccountProfileFieldKey, value: string) => {\n setDraft((prev) => ({ ...prev, [key]: value }));\n setFieldErrors((prev) => {\n if (!prev[key]) return prev;\n const next = { ...prev };\n delete next[key];\n return next;\n });\n }, []);\n\n // Opening an edit always starts from the latest truth, so a value the server normalized (e.g. a\n // reformatted phone) on a previous save is what the shopper sees, not their own stale keystrokes.\n const edit = useCallback(() => {\n setDraft(savedValues);\n setFieldErrors({});\n setMode('edit');\n }, [savedValues]);\n\n const cancel = useCallback(() => {\n setDraft(savedValues);\n setFieldErrors({});\n setMode('view');\n }, [savedValues]);\n\n function focusFirstInvalid(errors: MyAccountProfileFieldErrors) {\n const wrappers = formRef.current?.querySelectorAll<HTMLElement>('[data-fs-my-account-profile-field]');\n if (!wrappers) return;\n for (const wrapper of wrappers) {\n const key = wrapper.dataset.fsMyAccountProfileField as MyAccountProfileFieldKey | undefined;\n if (key && errors[key]) {\n const target = wrapper.querySelector<HTMLElement>('input, select, textarea') ?? wrapper;\n target.focus();\n return;\n }\n }\n }\n\n async function handleSubmit(event: SyntheticEvent<HTMLFormElement>) {\n event.preventDefault();\n if (pending) return;\n\n const dirtyKeys = Array.from(registry.keys()).filter((key) => draft[key] !== savedValues[key]);\n if (dirtyKeys.length === 0) {\n setFieldErrors({});\n setMode('view');\n toast.add({ title: savedMessage, type: 'success' });\n return;\n }\n\n // Validate only the fields the shopper actually changed (Decision 9, product-confirmed): a\n // stale invalid value the shopper never touched must not block an unrelated field's save.\n const errors: Record<string, string> = {};\n for (const key of dirtyKeys) {\n const registration = registry.get(key);\n const message = registration?.validate?.(draft[key]);\n if (message) errors[key] = message;\n }\n if (Object.keys(errors).length > 0) {\n setFieldErrors(errors as MyAccountProfileFieldErrors);\n focusFirstInvalid(errors as MyAccountProfileFieldErrors);\n return;\n }\n setFieldErrors({});\n\n const identity = $actions?.identity;\n if (!identity?.customerProfileUpdate) {\n // A composition/platform gap (the provider chain never delivered customerProfileUpdate) is\n // otherwise indistinguishable from a dead button — surface it the same way a rejected write\n // would, rather than returning silently.\n toast.add({ title: saveFailedMessage, type: 'error' });\n return;\n }\n\n const payload: Partial<Record<MyAccountProfileFieldKey, string>> = {};\n for (const key of dirtyKeys) {\n const registration = registry.get(key);\n const rawValue = draft[key];\n payload[key] = registration?.normalize ? registration.normalize(rawValue) : rawValue;\n }\n\n setPending(true);\n try {\n const userErrors: readonly CustomerProfileUserError[] = await identity.customerProfileUpdate(payload);\n if (userErrors.length > 0) {\n toast.add({ title: userErrors[0]?.message ?? saveFailedMessage, type: 'error' });\n return;\n }\n setMode('view');\n toast.add({ title: savedMessage, type: 'success' });\n } catch (error) {\n // Log only the error name — the message can echo a submitted profile value (PII).\n console.error('[MyAccountProfileRoot] customerProfileUpdate failed', loggableErrorName(error));\n toast.add({ title: saveFailedMessage, type: 'error' });\n } finally {\n setPending(false);\n }\n }\n\n const contextValue = useMemo<MyAccountProfileContextValue>(\n () => ({\n mode,\n savedValues,\n draft,\n fieldErrors,\n email: savedEmail,\n activeDocumentType,\n pending,\n registerField,\n setField,\n edit,\n cancel,\n }),\n [\n mode,\n savedValues,\n draft,\n fieldErrors,\n savedEmail,\n activeDocumentType,\n pending,\n registerField,\n setField,\n edit,\n cancel,\n ],\n );\n\n // Self-gate: an anonymous or identified-but-not-authenticated session never reaches the DOM,\n // even if the topology's SessionGuard is missing (US-5).\n if (state !== 'loggedIn') return null;\n\n // Empty is a post-resolution state — the skeleton renders while $data is unresolved, never an\n // empty summary.\n if (!resolved) return <MyAccountProfileSkeleton className={className} />;\n\n return (\n <MyAccountProfileContext value={contextValue}>\n <form\n ref={formRef}\n onSubmit={handleSubmit}\n className={className}\n data-fs-my-account-profile=\"\"\n data-fs-my-account-profile-mode={mode}\n {...(pending ? { 'data-fs-my-account-profile-pending': '' } : {})}\n >\n {children}\n </form>\n </MyAccountProfileContext>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Frame parts\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileEditButtonDefinition = defineComponent<MyAccountProfileEditButtonProps>({\n name: 'MyAccountProfileEditButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileEditButton,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Edit Button', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Edit', label: 'Button label' },\n },\n guideline:\n 'Switches MyAccountProfileRoot from the view state to the edit state. Renders only in the view state. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileEditButton({ label = 'Edit', className, children }: MyAccountProfileEditButtonProps) {\n const { mode, edit } = useMyAccountProfile();\n if (mode !== 'view') return null;\n return (\n <button type=\"button\" onClick={edit} className={className} data-fs-my-account-profile-edit=\"\">\n {children ?? label}\n </button>\n );\n}\n\nexport const MyAccountProfileSaveButtonDefinition = defineComponent<MyAccountProfileSaveButtonProps>({\n name: 'MyAccountProfileSaveButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileSaveButton,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Save Button', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Save', label: 'Button label' },\n },\n guideline:\n \"Submits MyAccountProfileRoot's batched Save. Renders only in the edit state; disabled while the write is pending. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileSaveButton({ label = 'Save', className, children }: MyAccountProfileSaveButtonProps) {\n const { mode, pending } = useMyAccountProfile();\n if (mode !== 'edit') return null;\n return (\n <button type=\"submit\" disabled={pending} className={className} data-fs-my-account-profile-save=\"\">\n {children ?? label}\n </button>\n );\n}\n\nexport const MyAccountProfileCancelButtonDefinition = defineComponent<MyAccountProfileCancelButtonProps>({\n name: 'MyAccountProfileCancelButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileCancelButton,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Cancel Button', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Cancel', label: 'Button label' },\n },\n guideline:\n 'Reverts every field to its last saved value and returns MyAccountProfileRoot to the view state, without persisting. Renders only in the edit state; disabled while the write is pending. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileCancelButton({\n label = 'Cancel',\n className,\n children,\n}: MyAccountProfileCancelButtonProps) {\n const { mode, pending, cancel } = useMyAccountProfile();\n if (mode !== 'edit') return null;\n return (\n <button\n type=\"button\"\n disabled={pending}\n onClick={cancel}\n className={className}\n data-fs-my-account-profile-cancel=\"\"\n >\n {children ?? label}\n </button>\n );\n}\n\nexport const MyAccountProfileEmailDefinition = defineComponent<MyAccountProfileEmailProps>({\n name: 'MyAccountProfileEmail',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileEmail,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Email', category: 'identity' },\n schema: {},\n guideline:\n \"The shopper's read-only login identifier, or nothing when absent. Never editable — no edit-state rendering exists for it. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileEmail({ className }: MyAccountProfileEmailProps) {\n const { email } = useMyAccountProfile();\n if (!email) return null;\n return (\n <p className={className} data-fs-my-account-profile-email=\"\">\n {email}\n </p>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton — no context: it is rendered directly by the Root before any Provider exists\n// (mirrors ProductShelfSkeleton / PricingSkeleton; see spec deviation note).\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileSkeletonDefinition = defineComponent<ComponentPropsWithRef<'div'>>({\n name: 'MyAccountProfileSkeleton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileSkeleton,\n editor: { label: 'My Account Profile Skeleton', category: 'identity' },\n schema: {},\n guideline:\n 'Loading placeholder rendered by MyAccountProfileRoot while $data is unresolved. Declares no context requirement — it renders before the Root has anything to provide.',\n});\n\nexport function MyAccountProfileSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n return (\n <div {...props} className={className} data-fs-my-account-profile-skeleton=\"\" aria-hidden=\"true\">\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n </div>\n );\n}\n\nMyAccountProfileRoot.Skeleton = MyAccountProfileSkeleton;\n\n// ---------------------------------------------------------------------------\n// Field Controls\n//\n// Each Control is a thin binding over an existing presentational particle: it registers with the\n// Root's registration seam in an effect, reads its value off `mode` (savedValues in view, draft in\n// edit), writes through `setField`, and wraps its input in an element carrying\n// `data-fs-my-account-profile-field` — the Root's DOM-order focus seam. None persists on its own.\n// ---------------------------------------------------------------------------\n\nexport type MyAccountProfileFirstNameControlProps = Readonly<{\n label?: string;\n requiredMessage?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfileFirstNameControlDefinition = defineComponent<MyAccountProfileFirstNameControlProps>({\n name: 'MyAccountProfileFirstNameControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileFirstNameControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile First Name Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'First name', label: 'Label' },\n requiredMessage: { type: 'string', default: 'First name is required.', label: 'Required message' },\n },\n guideline:\n 'Draft-bound, required first-name field. Blocks Save with an inline message and focus when left empty. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileFirstNameControl({\n label = 'First name',\n requiredMessage = 'First name is required.',\n className,\n}: MyAccountProfileFirstNameControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'firstName', validate: (value) => (value.trim() ? null : requiredMessage) });\n }, [requiredMessage, registerField]);\n\n const error = fieldErrors.firstName;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-first-name=\"\" data-fs-my-account-profile-field=\"firstName\">\n {savedValues.firstName}\n </p>\n );\n }\n\n return (\n <Field.Root\n className={className}\n invalid={!!error}\n disabled={pending}\n data-fs-my-account-profile-first-name=\"\"\n data-fs-my-account-profile-field=\"firstName\"\n >\n <Field.Label>{label}</Field.Label>\n <Field.Control\n value={draft.firstName}\n onChange={(event) => setField('firstName', event.target.value)}\n disabled={pending}\n />\n {error ? <Field.Error match>{error}</Field.Error> : null}\n </Field.Root>\n );\n}\n\nexport type MyAccountProfileLastNameControlProps = Readonly<{\n label?: string;\n requiredMessage?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfileLastNameControlDefinition = defineComponent<MyAccountProfileLastNameControlProps>({\n name: 'MyAccountProfileLastNameControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileLastNameControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Last Name Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Last name', label: 'Label' },\n requiredMessage: { type: 'string', default: 'Last name is required.', label: 'Required message' },\n },\n guideline:\n 'Draft-bound, required last-name field. Blocks Save with an inline message and focus when left empty. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileLastNameControl({\n label = 'Last name',\n requiredMessage = 'Last name is required.',\n className,\n}: MyAccountProfileLastNameControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'lastName', validate: (value) => (value.trim() ? null : requiredMessage) });\n }, [requiredMessage, registerField]);\n\n const error = fieldErrors.lastName;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-last-name=\"\" data-fs-my-account-profile-field=\"lastName\">\n {savedValues.lastName}\n </p>\n );\n }\n\n return (\n <Field.Root\n className={className}\n invalid={!!error}\n disabled={pending}\n data-fs-my-account-profile-last-name=\"\"\n data-fs-my-account-profile-field=\"lastName\"\n >\n <Field.Label>{label}</Field.Label>\n <Field.Control\n value={draft.lastName}\n onChange={(event) => setField('lastName', event.target.value)}\n disabled={pending}\n />\n {error ? <Field.Error match>{error}</Field.Error> : null}\n </Field.Root>\n );\n}\n\nexport type MyAccountProfilePhoneControlProps = Readonly<{\n label?: string;\n /** Which draft key this instance binds. Compose the Control twice to expose both numbers. */\n field?: 'homePhone' | 'mobilePhone';\n country?: PhoneCountry;\n invalidMessage?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfilePhoneControlDefinition = defineComponent<MyAccountProfilePhoneControlProps>({\n name: 'MyAccountProfilePhoneControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfilePhoneControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Phone Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Phone', label: 'Label' },\n field: { type: ['homePhone', 'mobilePhone'] as const, default: 'mobilePhone', label: 'Bound field' },\n country: { type: ['US', 'BR'] as const, default: 'US', label: 'Country' },\n invalidMessage: { type: 'string', default: 'Invalid phone number', label: 'Invalid message' },\n },\n guideline:\n \"Draft-bound, optional phone field bound to either homePhone or mobilePhone via the field prop (Decision 1) — compose it twice to expose both numbers. Normalizes to E.164 on the Root's Save. Absent from the composition means absent from the payload. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfilePhoneControl({\n label = 'Phone',\n field = 'mobilePhone',\n country = 'US',\n invalidMessage = 'Invalid phone number',\n className,\n}: MyAccountProfilePhoneControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({\n key: field,\n validate: (value) => (value.trim() && !validatePhoneNumber(value, country) ? invalidMessage : null),\n normalize: (value) => (value.trim() ? toE164(value, country) : value),\n });\n }, [field, country, invalidMessage, registerField]);\n\n const error = fieldErrors[field];\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-phone={field} data-fs-my-account-profile-field={field}>\n {savedValues[field] ? applyPhoneMask(savedValues[field], country) : ''}\n </p>\n );\n }\n\n return (\n <div data-fs-my-account-profile-field={field}>\n <PhoneField\n className={className}\n label={label}\n country={country}\n requirement=\"optional\"\n value={draft[field]}\n onValueChange={(value) => setField(field, value)}\n invalid={!!error}\n error={error ?? undefined}\n errorInvalid={invalidMessage}\n isDisabled={pending}\n data-fs-my-account-profile-phone={field}\n />\n </div>\n );\n}\n\nexport type MyAccountProfileTaxIdControlProps = Readonly<{\n label?: string;\n invalidMessage?: string;\n /** Inline reason shown beside the locked saved document. */\n lockedReason?: string;\n className?: string;\n}>;\n\nexport const MyAccountProfileTaxIdControlDefinition = defineComponent<MyAccountProfileTaxIdControlProps>({\n name: 'MyAccountProfileTaxIdControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileTaxIdControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Tax ID Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'National tax ID', label: 'Label' },\n invalidMessage: { type: 'string', default: 'Invalid document number.', label: 'Invalid message' },\n lockedReason: { type: 'string', default: \"Your document ID can't be edited.\", label: 'Locked reason' },\n },\n guideline:\n \"Draft-bound, optional national tax-ID field for the Root's active document type: CPF, SSN, SIN or RFC, each with its own mask and validation. Self-gates on that type and renders nothing when it is unset or unknown. A saved value renders as a disabled, locked input in the edit state rather than disappearing (Decision 4); an unsaved value renders as an editable field. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileTaxIdControl({\n label = 'National tax ID',\n invalidMessage = 'Invalid document number.',\n lockedReason = \"Your document ID can't be edited.\",\n className,\n}: MyAccountProfileTaxIdControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, activeDocumentType, registerField, setField } =\n useMyAccountProfile();\n const documentType =\n activeDocumentType && isSupportedDocumentType(activeDocumentType) ? activeDocumentType : undefined;\n const hasSavedDocument = savedValues.document.trim() !== '';\n\n useEffect(() => {\n if (!documentType || hasSavedDocument) return;\n return registerField({\n key: 'document',\n validate: (value) => (value.trim() && !isValidDocument(value, documentType) ? invalidMessage : null),\n // DocumentField reports back the masked value (e.g. `111.444.777-35`); the type's own sanitiser\n // strips the punctuation before it reaches the API (digits only for CPF, SSN and SIN, letters kept\n // for RFC), so this surface sends the string the card form's gateway body sends.\n normalize: (value) => DOCUMENTS[documentType].sanitize(value),\n });\n }, [documentType, hasSavedDocument, invalidMessage, registerField]);\n\n if (!documentType) return null;\n\n const error = fieldErrors.document;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-tax-id=\"\" data-fs-my-account-profile-field=\"document\">\n {savedValues.document ? maskDocumentValue(savedValues.document, documentType) : ''}\n </p>\n );\n }\n\n if (hasSavedDocument) {\n return (\n <Field.Root\n className={className}\n data-fs-my-account-profile-tax-id=\"\"\n data-fs-my-account-profile-field=\"document\"\n >\n <Field.Label>{label}</Field.Label>\n <Field.Control\n readOnly\n aria-disabled=\"true\"\n title={lockedReason}\n value={maskDocumentValue(savedValues.document, documentType)}\n data-fs-my-account-profile-tax-id-readonly=\"\"\n />\n <Field.Description>{lockedReason}</Field.Description>\n </Field.Root>\n );\n }\n\n return (\n <DocumentField\n className={className}\n label={label}\n documentType={documentType}\n value={draft.document}\n onValueChange={(value) => setField('document', value)}\n invalid={!!error}\n errorMessage={error}\n disabled={pending}\n data-fs-my-account-profile-tax-id=\"\"\n data-fs-my-account-profile-field=\"document\"\n />\n );\n}\n\nexport type MyAccountProfileBirthDateControlProps = Readonly<{ label?: string; className?: string }>;\n\nexport const MyAccountProfileBirthDateControlDefinition = defineComponent<MyAccountProfileBirthDateControlProps>({\n name: 'MyAccountProfileBirthDateControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileBirthDateControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Birth Date Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Birth date', label: 'Label' },\n },\n guideline:\n 'Draft-bound, optional birth-date field over a native date input. Maps the native yyyy-mm-dd value to the stored profile format on read and write. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileBirthDateControl({\n label = 'Birth date',\n className,\n}: MyAccountProfileBirthDateControlProps) {\n const { mode, draft, savedValues, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'birthDate', normalize: (value) => toStoredDate(value) });\n }, [registerField]);\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-birth-date=\"\" data-fs-my-account-profile-field=\"birthDate\">\n {savedValues.birthDate}\n </p>\n );\n }\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n setField('birthDate', toStoredDate(event.target.value));\n }\n\n return (\n <Field.Root\n className={className}\n data-fs-my-account-profile-birth-date=\"\"\n data-fs-my-account-profile-field=\"birthDate\"\n >\n <Field.Label>{label}</Field.Label>\n <Input type=\"date\" value={toNativeDate(draft.birthDate)} onChange={handleChange} disabled={pending} />\n </Field.Root>\n );\n}\n\nexport type MyAccountProfileGenderOption = Readonly<{ value: string; label: string }>;\n\nexport type MyAccountProfileGenderControlProps = Readonly<{\n label?: string;\n placeholder?: string;\n clearLabel?: string;\n options?: readonly MyAccountProfileGenderOption[];\n className?: string;\n}>;\n\nexport const MyAccountProfileGenderControlDefinition = defineComponent<MyAccountProfileGenderControlProps>({\n name: 'MyAccountProfileGenderControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileGenderControl,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Gender Control', category: 'identity' },\n schema: {\n label: { type: 'string', default: 'Gender', label: 'Label' },\n placeholder: { type: 'string', default: 'Select', label: 'Placeholder' },\n clearLabel: { type: 'string', default: 'Clear', label: 'Clear button label' },\n },\n guideline:\n 'Draft-bound, optional gender field over a store-configurable set of options (the options prop). Free-string storage — no server-side enum. A Clear button erases a selected value back to empty, since the Select itself offers no such option. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileGenderControl({\n label = 'Gender',\n placeholder = 'Select',\n clearLabel = 'Clear',\n options = DEFAULT_GENDER_OPTIONS,\n className,\n}: MyAccountProfileGenderControlProps) {\n const { mode, draft, savedValues, pending, registerField, setField } = useMyAccountProfile();\n\n useEffect(() => {\n return registerField({ key: 'gender' });\n }, [registerField]);\n\n if (mode === 'view') {\n const selected = options.find((option) => option.value === savedValues.gender);\n return (\n <p className={className} data-fs-my-account-profile-gender=\"\" data-fs-my-account-profile-field=\"gender\">\n {selected?.label ?? savedValues.gender}\n </p>\n );\n }\n\n return (\n <div className={className} data-fs-my-account-profile-gender=\"\" data-fs-my-account-profile-field=\"gender\">\n <Select.Root value={draft.gender} onValueChange={(value) => setField('gender', value ?? '')} disabled={pending}>\n <Select.Label>{label}</Select.Label>\n <Select.Trigger>\n <Select.Value placeholder={placeholder} />\n <Select.Icon />\n </Select.Trigger>\n <Select.Portal>\n <Select.Positioner>\n <Select.Popup>\n <Select.List>\n {options.map((option) => (\n <Select.Item key={option.value} value={option.value}>\n <Select.ItemText>{option.label}</Select.ItemText>\n </Select.Item>\n ))}\n </Select.List>\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n {draft.gender ? (\n <button\n type=\"button\"\n onClick={() => setField('gender', '')}\n disabled={pending}\n data-fs-my-account-profile-gender-clear=\"\"\n >\n {clearLabel}\n </button>\n ) : null}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfile = {\n Root: MyAccountProfileRoot,\n RootDefinition: MyAccountProfileRootDefinition,\n EditButton: MyAccountProfileEditButton,\n EditButtonDefinition: MyAccountProfileEditButtonDefinition,\n SaveButton: MyAccountProfileSaveButton,\n SaveButtonDefinition: MyAccountProfileSaveButtonDefinition,\n CancelButton: MyAccountProfileCancelButton,\n CancelButtonDefinition: MyAccountProfileCancelButtonDefinition,\n Email: MyAccountProfileEmail,\n EmailDefinition: MyAccountProfileEmailDefinition,\n Skeleton: MyAccountProfileSkeleton,\n SkeletonDefinition: MyAccountProfileSkeletonDefinition,\n FirstNameControl: MyAccountProfileFirstNameControl,\n FirstNameControlDefinition: MyAccountProfileFirstNameControlDefinition,\n LastNameControl: MyAccountProfileLastNameControl,\n LastNameControlDefinition: MyAccountProfileLastNameControlDefinition,\n PhoneControl: MyAccountProfilePhoneControl,\n PhoneControlDefinition: MyAccountProfilePhoneControlDefinition,\n TaxIdControl: MyAccountProfileTaxIdControl,\n TaxIdControlDefinition: MyAccountProfileTaxIdControlDefinition,\n BirthDateControl: MyAccountProfileBirthDateControl,\n BirthDateControlDefinition: MyAccountProfileBirthDateControlDefinition,\n GenderControl: MyAccountProfileGenderControl,\n GenderControlDefinition: MyAccountProfileGenderControlDefinition,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,MAAM,WAAyB;;;;;;;;;;;;;;;;;AA0D/B,MAAM,aAAkD;CACtD;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAuDA,MAAM,8BAA8B;AACpC,MAAM,wBAAwB;AAE9B,SAAS,iBAAiB,OAAiE;CACzF,OAAO;EACL,WAAW,OAAO,aAAa;EAC/B,UAAU,OAAO,YAAY;EAC7B,WAAW,OAAO,aAAa;EAC/B,aAAa,OAAO,eAAe;EACnC,UAAU,OAAO,YAAY;EAC7B,WAAW,OAAO,aAAa;EAC/B,QAAQ,OAAO,UAAU;CAC3B;AACF;;;;;;;AAQA,SAAS,aAAa,QAAwB;CAC5C,MAAM,CAAC,YAAY,OAAO,MAAM,GAAG;CACnC,OAAO,YAAY;AACrB;AACA,SAAS,aAAa,QAAwB;CAC5C,OAAO;AACT;AAEA,MAAM,yBAAkE;CACtE;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAQ,OAAO;CAAO;CAC/B;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAqB,OAAO;CAAoB;AAC3D;AAMA,MAAM,2BAA2B,OAAO,8BAA8B;AAEtE,MAAM,0BAA0B,cAC9B,wBACF;;AAGA,SAAgB,sBAAoD;CAClE,MAAM,MAAM,WAAW,uBAAuB;CAC9C,IAAI,QAAQ,0BACV,MAAM,IAAI,MAAM,uEAAuE;CAEzF,OAAO;AACT;AAMA,MAAa,iCAAiC,gBAA2C;CACvF,MAAM;CACN,YAAY;CACZ,WAAW;CACX;CACA,eAAe;CACf,iBAAiB;CACjB,iBAAiB;CACjB,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE;CAC/C,UA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G,CAAA,EACN,CAAA;GACJ;EACZ,CAAA,GAAA,MAAM,SACL,oBAAC,UAAD;GACE,MAAK;GACL,eAAe,SAAS,UAAU,EAAE;GACpC,UAAU;GACV,2CAAwC;GAEvC,UAAA;EACK,CAAA,IACN,IACD;;AAET;AAMA,MAAa,mBAAmB;CAC9B,MAAM;CACN,gBAAgB;CAChB,YAAY;CACZ,sBAAsB;CACtB,YAAY;CACZ,sBAAsB;CACtB,cAAc;CACd,wBAAwB;CACxB,OAAO;CACP,iBAAiB;CACjB,UAAU;CACV,oBAAoB;CACpB,kBAAkB;CAClB,4BAA4B;CAC5B,iBAAiB;CACjB,2BAA2B;CAC3B,cAAc;CACd,wBAAwB;CACxB,cAAc;CACd,wBAAwB;CACxB,kBAAkB;CAClB,4BAA4B;CAC5B,eAAe;CACf,yBAAyB;AAC3B"}
1
+ {"version":3,"file":"my-account-profile.js","names":[],"sources":["../../../src/matter/my-account-profile/my-account-profile.tsx"],"sourcesContent":["'use client';\n\nimport {\n type ContentTypeDefinition,\n type ContentValue,\n defineComponent,\n defineContentType,\n type MessageFieldName,\n type MessageLocaleProp,\n} from '@vtex/fs-core';\nimport {\n type ChangeEvent,\n type ComponentPropsWithRef,\n createContext,\n type ReactNode,\n type SyntheticEvent,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n DOCUMENTS,\n DocumentField,\n isSupportedDocumentType,\n isValidDocument,\n maskDocumentValue,\n} from '../../particles/document-field/document-field.js';\nimport { Field } from '../../particles/field/field.js';\nimport { Input } from '../../particles/input/input.js';\nimport {\n applyPhoneMask,\n type PhoneCountry,\n PhoneField,\n toE164,\n validatePhoneNumber,\n} from '../../particles/phone-field/phone-field.js';\nimport { Select } from '../../particles/select/select.js';\nimport { useToast } from '../../particles/toast/toast.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 { formatErrorCode } from '../../sdk/i18n/format-error-code.js';\nimport { useMessageFormatter } from '../../sdk/i18n/use-message-formatter.js';\nimport type { CustomerProfileUserError } from '../../sdk/identity/operations.js';\nimport { loggableErrorName } from '../../utils/loggable-error-name.js';\nimport { useSession } from '../session/session.js';\n\n/**\n * The `my-account-profile` compound (see my-account-profile.md; spec archived at the specs-archive tag) — the data root\n * plus form mechanics for the shopper's persistent account profile. `Root` owns the saved profile,\n * the draft, the view↔edit toggle, and the single batched Save; it publishes a context whose\n * registration API is the seam every field Control attaches to.\n *\n * Unlike `ClientProfileFormRoot`, the Root does not enumerate the field set: a Control registers\n * its key plus an optional validator and normalizer, and the Root derives which fields to validate,\n * which to send, and which to focus from the live registry only. A field absent from the\n * composition is absent from the payload by construction (Decision 1).\n */\n\n// ---------------------------------------------------------------------------\n// GraphQL fragment — raw literal, outside codegen (Decision 8)\n// ---------------------------------------------------------------------------\n\nconst fragment = /* GraphQL */ `\n fragment MyAccountProfileData on Query {\n customerProfile {\n __typename\n id\n firstName\n lastName\n email\n homePhone\n mobilePhone\n document\n documentType\n birthDate\n gender\n }\n }\n`;\n\n// ---------------------------------------------------------------------------\n// Content model\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileRootContent = defineContentType({\n id: 'my-account-profile-root',\n title: 'My Account Profile Root',\n description: 'The toasts the profile Save raises.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n saveFailedMessage: {\n type: 'string',\n title: 'Save failure message',\n description: 'Shown for a network failure, and when the save cannot be dispatched at all.',\n format: 'icu-message',\n messageSource: 'Unable to save your profile. Please try again.',\n },\n invalidValueMessage: {\n type: 'string',\n title: 'Refused value message',\n description: 'Shown when the account refuses one or more of the submitted values.',\n format: 'icu-message',\n messageSource: 'Some of your details were not accepted. Check them and try again.',\n },\n sessionExpiredMessage: {\n type: 'string',\n title: 'Session expired message',\n description: 'Shown when the session ended before the save, so the shopper must sign in again.',\n format: 'icu-message',\n messageSource: 'Your session has expired. Please sign in again.',\n },\n savedMessage: {\n type: 'string',\n title: 'Save success message',\n format: 'icu-message',\n messageSource: 'Your profile has been saved.',\n },\n },\n },\n});\n\n/**\n * `CustomerProfileErrorCode` of API Core's schema plus the two codes the sdk mints: the transport failure\n * and the expired session, which the write answers with a top-level `UNAUTHORIZED`.\n */\nexport const MY_ACCOUNT_PROFILE_ERROR_FIELDS = {\n INVALID_VALUE: 'invalidValueMessage',\n UNAUTHORIZED: 'sessionExpiredMessage',\n NETWORK_ERROR: 'saveFailedMessage',\n} as const satisfies Record<string, MessageFieldName<typeof MyAccountProfileRootContent>>;\n\nexport const MyAccountProfileEditButtonContent = defineContentType({\n id: 'my-account-profile-edit',\n title: 'My Account Profile Edit Button',\n description: \"The edit button's label.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Button label', format: 'icu-message', messageSource: 'Edit' },\n },\n },\n});\n\nexport const MyAccountProfileSaveButtonContent = defineContentType({\n id: 'my-account-profile-save',\n title: 'My Account Profile Save Button',\n description: \"The save button's label.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Button label', format: 'icu-message', messageSource: 'Save' },\n },\n },\n});\n\nexport const MyAccountProfileCancelButtonContent = defineContentType({\n id: 'my-account-profile-cancel',\n title: 'My Account Profile Cancel Button',\n description: \"The cancel button's label.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Button label', format: 'icu-message', messageSource: 'Cancel' },\n },\n },\n});\n\nexport const MyAccountProfileFirstNameControlContent = defineContentType({\n id: 'my-account-profile-first-name',\n title: 'My Account Profile First Name Control',\n description: \"The first-name field's label and required message.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Label', format: 'icu-message', messageSource: 'First name' },\n requiredMessage: {\n type: 'string',\n title: 'Required message',\n format: 'icu-message',\n messageSource: 'First name is required.',\n },\n },\n },\n});\n\nexport const MyAccountProfileLastNameControlContent = defineContentType({\n id: 'my-account-profile-last-name',\n title: 'My Account Profile Last Name Control',\n description: \"The last-name field's label and required message.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Label', format: 'icu-message', messageSource: 'Last name' },\n requiredMessage: {\n type: 'string',\n title: 'Required message',\n format: 'icu-message',\n messageSource: 'Last name is required.',\n },\n },\n },\n});\n\nexport const MyAccountProfilePhoneControlContent = defineContentType({\n id: 'my-account-profile-phone',\n title: 'My Account Profile Phone Control',\n description: \"The phone field's label and invalid message.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Label', format: 'icu-message', messageSource: 'Phone' },\n invalidMessage: {\n type: 'string',\n title: 'Invalid message',\n format: 'icu-message',\n messageSource: 'Invalid phone number',\n },\n },\n },\n});\n\nexport const MyAccountProfileTaxIdControlContent = defineContentType({\n id: 'my-account-profile-tax-id',\n title: 'My Account Profile Tax ID Control',\n description: \"The tax-ID field's label, invalid message and the reason a saved document is locked.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Label', format: 'icu-message', messageSource: 'National tax ID' },\n invalidMessage: {\n type: 'string',\n title: 'Invalid message',\n format: 'icu-message',\n messageSource: 'Invalid document number.',\n },\n lockedReason: {\n type: 'string',\n title: 'Locked reason',\n format: 'icu-message',\n messageSource: \"Your document ID can't be edited.\",\n },\n },\n },\n});\n\nexport const MyAccountProfileBirthDateControlContent = defineContentType({\n id: 'my-account-profile-birth-date',\n title: 'My Account Profile Birth Date Control',\n description: \"The birth-date field's label.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Label', format: 'icu-message', messageSource: 'Birth date' },\n },\n },\n});\n\nexport const MyAccountProfileGenderControlContent = defineContentType({\n id: 'my-account-profile-gender',\n title: 'My Account Profile Gender Control',\n description: \"The gender field's label, placeholder, clear button label and the default options' labels.\",\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Label', format: 'icu-message', messageSource: 'Gender' },\n placeholder: { type: 'string', title: 'Placeholder', format: 'icu-message', messageSource: 'Select' },\n clearLabel: { type: 'string', title: 'Clear button label', format: 'icu-message', messageSource: 'Clear' },\n femaleLabel: { type: 'string', title: 'Female option label', format: 'icu-message', messageSource: 'Female' },\n maleLabel: { type: 'string', title: 'Male option label', format: 'icu-message', messageSource: 'Male' },\n otherLabel: { type: 'string', title: 'Other option label', format: 'icu-message', messageSource: 'Other' },\n preferNotToSayLabel: {\n type: 'string',\n title: 'Prefer-not-to-say option label',\n format: 'icu-message',\n messageSource: 'Prefer not to say',\n },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * The `$data` slice forwarded by the reactive runtime — the `customerProfile` entity itself, not the\n * `Query` shape the fragment above is authored against. The compiler derives an entity fragment `on\n * CustomerProfile` from the root-field selection for the reactive path (rfc-data-layer.md §\"Entity\n * fragments and schema introspection\"), and `ReactiveDataProvider` publishes that entity data\n * directly — the same convention `SessionRoot` reads `$data.loggedIn` under, not `$data.session`.\n *\n * `null` whenever `customerProfile` is: an anonymous session, or a signed-in read that failed. The\n * Root treats it as unresolved data, so the first renders nothing and the second keeps the skeleton.\n */\nexport type MyAccountProfileData = {\n id?: string | null;\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n homePhone?: string | null;\n mobilePhone?: string | null;\n document?: string | null;\n documentType?: string | null;\n birthDate?: string | null;\n gender?: string | null;\n} | null;\n\n/**\n * The shopper-editable keys. `email` is absent (login identifier) and `documentType` is absent\n * (read for the tax-ID control's active type; not writable in V0).\n */\nexport type MyAccountProfileFieldKey =\n | 'firstName'\n | 'lastName'\n | 'homePhone'\n | 'mobilePhone'\n | 'document'\n | 'birthDate'\n | 'gender';\n\nconst FIELD_KEYS: readonly MyAccountProfileFieldKey[] = [\n 'firstName',\n 'lastName',\n 'homePhone',\n 'mobilePhone',\n 'document',\n 'birthDate',\n 'gender',\n];\n\nexport type MyAccountProfileMode = 'view' | 'edit';\n\n/** Every editable key, always a string — a `null` upstream value is seeded as `''`. */\nexport type MyAccountProfileValues = Readonly<Record<MyAccountProfileFieldKey, string>>;\n\n/**\n * What a Control hands the Root. `validate` returns a message when the value is unacceptable and\n * `null` when it is fine — requiredness is expressed as a validator that rejects `''`. `normalize`\n * is applied on Save, to dirty values only.\n */\nexport type MyAccountProfileFieldRegistration = Readonly<{\n key: MyAccountProfileFieldKey;\n validate?: (value: string) => string | null;\n normalize?: (value: string) => string;\n}>;\n\nexport type MyAccountProfileFieldErrors = Readonly<Partial<Record<MyAccountProfileFieldKey, string>>>;\n\nexport type MyAccountProfileContextValue = Readonly<{\n mode: MyAccountProfileMode;\n savedValues: MyAccountProfileValues;\n draft: MyAccountProfileValues;\n fieldErrors: MyAccountProfileFieldErrors;\n email: string;\n activeDocumentType: string | undefined;\n pending: boolean;\n registerField: (registration: MyAccountProfileFieldRegistration) => () => void;\n setField: (key: MyAccountProfileFieldKey, value: string) => void;\n edit: () => void;\n cancel: () => void;\n}>;\n\nexport type MyAccountProfileRootProps = Readonly<\n MessageLocaleProp & {\n /** Store-configured tax-ID type fallback, used when the saved `documentType` is not registered. */\n documentType?: string;\n /** The save failure and success toasts. */\n $content?: ContentValue<typeof MyAccountProfileRootContent>;\n className?: string;\n children?: ReactNode;\n $data?: MyAccountProfileData;\n /** Compiler-injected action surface; carries `identity.customerProfileUpdate`. */\n $actions?: ComponentActions;\n }\n>;\n\n/** A frame button: its label is the `label` message unless children are composed. */\ntype FrameButtonProps<T extends ContentTypeDefinition> = Readonly<\n MessageLocaleProp & { $content?: ContentValue<T>; className?: string; children?: ReactNode }\n>;\n\nexport type MyAccountProfileEditButtonProps = FrameButtonProps<typeof MyAccountProfileEditButtonContent>;\nexport type MyAccountProfileSaveButtonProps = FrameButtonProps<typeof MyAccountProfileSaveButtonContent>;\nexport type MyAccountProfileCancelButtonProps = FrameButtonProps<typeof MyAccountProfileCancelButtonContent>;\nexport type MyAccountProfileEmailProps = Readonly<{ className?: string }>;\n\nfunction buildSavedValues($data: MyAccountProfileData | undefined): MyAccountProfileValues {\n return {\n firstName: $data?.firstName ?? '',\n lastName: $data?.lastName ?? '',\n homePhone: $data?.homePhone ?? '',\n mobilePhone: $data?.mobilePhone ?? '',\n document: $data?.document ?? '',\n birthDate: $data?.birthDate ?? '',\n gender: $data?.gender ?? '',\n };\n}\n\n/**\n * Native `<input type=\"date\">` values and the profile's stored `birthDate` are both `yyyy-mm-dd`.\n * `toNativeDate` stays defensive against a `yyyy-mm-ddTHH:mm:ss...` upstream value slipping through\n * unnormalized — the resolver already strips the time component, this is a second line of defense —\n * since the native input rejects anything but the date-only form outright.\n */\nfunction toNativeDate(stored: string): string {\n const [datePart] = stored.split('T');\n return datePart ?? '';\n}\nfunction toStoredDate(native: string): string {\n return native;\n}\n\n/** The default option set, each value labelled by a message field; used only when no `options` are authored. */\nconst DEFAULT_GENDER_OPTIONS = [\n { value: 'female', field: 'femaleLabel' },\n { value: 'male', field: 'maleLabel' },\n { value: 'other', field: 'otherLabel' },\n { value: 'prefer_not_to_say', field: 'preferNotToSayLabel' },\n] as const;\n\n// ---------------------------------------------------------------------------\n// Context — Root publishes the draft + registration API to its Controls\n// ---------------------------------------------------------------------------\n\nconst MY_ACCOUNT_PROFILE_UNSET = Symbol('MyAccountProfileContextUnset');\n\nconst MyAccountProfileContext = createContext<MyAccountProfileContextValue | typeof MY_ACCOUNT_PROFILE_UNSET>(\n MY_ACCOUNT_PROFILE_UNSET,\n);\n\n/** Throws when used outside `MyAccountProfileRoot`, per ADR-0009. */\nexport function useMyAccountProfile(): MyAccountProfileContextValue {\n const ctx = useContext(MyAccountProfileContext);\n if (ctx === MY_ACCOUNT_PROFILE_UNSET) {\n throw new Error('MyAccountProfile components must be used inside MyAccountProfileRoot.');\n }\n return ctx;\n}\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileRootDefinition = defineComponent<MyAccountProfileRootProps>({\n name: 'MyAccountProfileRoot',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileRoot,\n content: MyAccountProfileRootContent,\n fragment,\n fetchStrategy: 'reactive',\n requiresContext: 'session',\n providesContext: 'my-account-profile',\n actions: { identity: ['customerProfileUpdate'] },\n skeleton: MyAccountProfileSkeleton,\n editor: { label: 'My Account Profile Root', category: 'identity' },\n schema: {\n documentType: { type: 'string', label: 'Default document type (e.g. CPF)' },\n },\n guideline:\n 'Data root + form mechanics for the persistent My Account profile: owns the saved profile, the draft, the view/edit toggle, and the single batched Save (dispatches only dirty, registered fields; an empty string erases, an omitted field is untouched). Self-gates on the authenticated (loggedIn) session; requires a SessionRoot ancestor and a mounted ToastProvider ancestor — Save success/failure surface as a toast (the $content fields savedMessage, saveFailedMessage, invalidValueMessage and sessionExpiredMessage, by refusal code), not an inline part. Field Controls register their key plus an optional validator and normalizer through useMyAccountProfile() — the field set is a merchant composition decision, never enumerated here. Compose EditButton (view state), SaveButton/CancelButton (edit state), and Email as children in any order. See my-account-profile.md.',\n});\n\nexport function MyAccountProfileRoot({\n $data: $dataProp,\n $actions: $actionsProp,\n documentType: documentTypeProp,\n $content,\n $locale,\n className,\n children,\n}: MyAccountProfileRootProps) {\n const { format } = useMessageFormatter(MyAccountProfileRootContent, $content);\n // Enforces the SessionRoot ancestor: useSession() throws when rendered outside one.\n const { state } = useSession();\n // Enforces the ToastProvider ancestor: useToast() throws when rendered outside one (Decision 10).\n const toast = useToast();\n const $data = useDataOverride($dataProp);\n const $actions = useActionsOverride($actionsProp);\n const resolved = $data != null;\n\n const savedValues = useMemo(() => buildSavedValues($data), [$data]);\n const savedEmail = $data?.email ?? '';\n const savedDocumentType = $data?.documentType?.toUpperCase();\n const activeDocumentType =\n savedDocumentType && isSupportedDocumentType(savedDocumentType) ? savedDocumentType : documentTypeProp;\n\n const [mode, setMode] = useState<MyAccountProfileMode>('view');\n const [draft, setDraft] = useState<MyAccountProfileValues>(savedValues);\n const [fieldErrors, setFieldErrors] = useState<MyAccountProfileFieldErrors>({});\n const [pending, setPending] = useState(false);\n const [registry, setRegistry] = useState<ReadonlyMap<MyAccountProfileFieldKey, MyAccountProfileFieldRegistration>>(\n () => new Map(),\n );\n\n const formRef = useRef<HTMLFormElement>(null);\n\n // Re-seed pristine fields when the saved profile changes underneath an open edit; a field the\n // shopper has touched (draft no longer equals the previous saved value) is never clobbered. Runs\n // during render (previous-saved in state, not a ref) so the re-seed lands in the same commit.\n const [prevSaved, setPrevSaved] = useState(savedValues);\n const changedKeys = FIELD_KEYS.filter((key) => prevSaved[key] !== savedValues[key]);\n if (changedKeys.length > 0) {\n setPrevSaved(savedValues);\n setDraft((prevDraft) => {\n let next = prevDraft;\n for (const key of changedKeys) {\n if (prevDraft[key] !== prevSaved[key]) continue;\n if (next === prevDraft) next = { ...prevDraft };\n (next as Record<MyAccountProfileFieldKey, string>)[key] = savedValues[key];\n }\n return next;\n });\n }\n\n const registerField = useCallback((registration: MyAccountProfileFieldRegistration) => {\n setRegistry((prev) => {\n const next = new Map(prev);\n next.set(registration.key, registration);\n return next;\n });\n return () => {\n setRegistry((prev) => {\n if (!prev.has(registration.key)) return prev;\n const next = new Map(prev);\n next.delete(registration.key);\n return next;\n });\n };\n }, []);\n\n const setField = useCallback((key: MyAccountProfileFieldKey, value: string) => {\n setDraft((prev) => ({ ...prev, [key]: value }));\n setFieldErrors((prev) => {\n if (!prev[key]) return prev;\n const next = { ...prev };\n delete next[key];\n return next;\n });\n }, []);\n\n // Opening an edit always starts from the latest truth, so a value the server normalized (e.g. a\n // reformatted phone) on a previous save is what the shopper sees, not their own stale keystrokes.\n const edit = useCallback(() => {\n setDraft(savedValues);\n setFieldErrors({});\n setMode('edit');\n }, [savedValues]);\n\n const cancel = useCallback(() => {\n setDraft(savedValues);\n setFieldErrors({});\n setMode('view');\n }, [savedValues]);\n\n function focusFirstInvalid(errors: MyAccountProfileFieldErrors) {\n const wrappers = formRef.current?.querySelectorAll<HTMLElement>('[data-fs-my-account-profile-field]');\n if (!wrappers) return;\n for (const wrapper of wrappers) {\n const key = wrapper.dataset.fsMyAccountProfileField as MyAccountProfileFieldKey | undefined;\n if (key && errors[key]) {\n const target = wrapper.querySelector<HTMLElement>('input, select, textarea') ?? wrapper;\n target.focus();\n return;\n }\n }\n }\n\n async function handleSubmit(event: SyntheticEvent<HTMLFormElement>) {\n event.preventDefault();\n if (pending) return;\n\n const dirtyKeys = Array.from(registry.keys()).filter((key) => draft[key] !== savedValues[key]);\n if (dirtyKeys.length === 0) {\n setFieldErrors({});\n setMode('view');\n toast.add({ title: format('savedMessage'), type: 'success' });\n return;\n }\n\n // Validate only the fields the shopper actually changed (Decision 9, product-confirmed): a\n // stale invalid value the shopper never touched must not block an unrelated field's save.\n const errors: Record<string, string> = {};\n for (const key of dirtyKeys) {\n const registration = registry.get(key);\n const message = registration?.validate?.(draft[key]);\n if (message) errors[key] = message;\n }\n if (Object.keys(errors).length > 0) {\n setFieldErrors(errors as MyAccountProfileFieldErrors);\n focusFirstInvalid(errors as MyAccountProfileFieldErrors);\n return;\n }\n setFieldErrors({});\n\n const identity = $actions?.identity;\n if (!identity?.customerProfileUpdate) {\n // A composition/platform gap (the provider chain never delivered customerProfileUpdate) is\n // otherwise indistinguishable from a dead button — surface it the same way a rejected write\n // would, rather than returning silently.\n toast.add({ title: format('saveFailedMessage'), type: 'error' });\n return;\n }\n\n const payload: Partial<Record<MyAccountProfileFieldKey, string>> = {};\n for (const key of dirtyKeys) {\n const registration = registry.get(key);\n const rawValue = draft[key];\n payload[key] = registration?.normalize ? registration.normalize(rawValue) : rawValue;\n }\n\n setPending(true);\n try {\n const userErrors: readonly CustomerProfileUserError[] = await identity.customerProfileUpdate(payload);\n const [firstError] = userErrors;\n if (firstError) {\n const title = formatErrorCode(\n MyAccountProfileRootContent,\n MY_ACCOUNT_PROFILE_ERROR_FIELDS,\n firstError,\n format,\n 'saveFailedMessage',\n );\n toast.add({ title, type: 'error' });\n return;\n }\n setMode('view');\n toast.add({ title: format('savedMessage'), type: 'success' });\n } catch (error) {\n // Log only the error name — the message can echo a submitted profile value (PII).\n console.error('[MyAccountProfileRoot] customerProfileUpdate failed', loggableErrorName(error));\n toast.add({ title: format('saveFailedMessage'), type: 'error' });\n } finally {\n setPending(false);\n }\n }\n\n const contextValue = useMemo<MyAccountProfileContextValue>(\n () => ({\n mode,\n savedValues,\n draft,\n fieldErrors,\n email: savedEmail,\n activeDocumentType,\n pending,\n registerField,\n setField,\n edit,\n cancel,\n }),\n [\n mode,\n savedValues,\n draft,\n fieldErrors,\n savedEmail,\n activeDocumentType,\n pending,\n registerField,\n setField,\n edit,\n cancel,\n ],\n );\n\n // Self-gate: an anonymous or identified-but-not-authenticated session never reaches the DOM,\n // even if the topology's SessionGuard is missing (US-5).\n if (state !== 'loggedIn') return null;\n\n // Empty is a post-resolution state — the skeleton renders while $data is unresolved, never an\n // empty summary.\n if (!resolved) return <MyAccountProfileSkeleton className={className} />;\n\n return (\n <MyAccountProfileContext value={contextValue}>\n <form\n ref={formRef}\n onSubmit={handleSubmit}\n className={className}\n data-fs-my-account-profile=\"\"\n data-fs-my-account-profile-mode={mode}\n {...(pending ? { 'data-fs-my-account-profile-pending': '' } : {})}\n >\n {children}\n </form>\n </MyAccountProfileContext>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Frame parts\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileEditButtonDefinition = defineComponent<MyAccountProfileEditButtonProps>({\n name: 'MyAccountProfileEditButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileEditButton,\n content: MyAccountProfileEditButtonContent,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Edit Button', category: 'identity' },\n schema: {},\n guideline:\n 'Its label is the $content field label unless children are composed. Switches MyAccountProfileRoot from the view state to the edit state. Renders only in the view state. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileEditButton({\n $content,\n $locale,\n className,\n children,\n}: MyAccountProfileEditButtonProps) {\n const { mode, edit } = useMyAccountProfile();\n const { format } = useMessageFormatter(MyAccountProfileEditButtonContent, $content);\n if (mode !== 'view') return null;\n return (\n <button type=\"button\" onClick={edit} className={className} data-fs-my-account-profile-edit=\"\">\n {children ?? format('label')}\n </button>\n );\n}\n\nexport const MyAccountProfileSaveButtonDefinition = defineComponent<MyAccountProfileSaveButtonProps>({\n name: 'MyAccountProfileSaveButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileSaveButton,\n content: MyAccountProfileSaveButtonContent,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Save Button', category: 'identity' },\n schema: {},\n guideline:\n \"Its label is the $content field label unless children are composed. Submits MyAccountProfileRoot's batched Save. Renders only in the edit state; disabled while the write is pending. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileSaveButton({\n $content,\n $locale,\n className,\n children,\n}: MyAccountProfileSaveButtonProps) {\n const { mode, pending } = useMyAccountProfile();\n const { format } = useMessageFormatter(MyAccountProfileSaveButtonContent, $content);\n if (mode !== 'edit') return null;\n return (\n <button type=\"submit\" disabled={pending} className={className} data-fs-my-account-profile-save=\"\">\n {children ?? format('label')}\n </button>\n );\n}\n\nexport const MyAccountProfileCancelButtonDefinition = defineComponent<MyAccountProfileCancelButtonProps>({\n name: 'MyAccountProfileCancelButton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileCancelButton,\n content: MyAccountProfileCancelButtonContent,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Cancel Button', category: 'identity' },\n schema: {},\n guideline:\n 'Its label is the $content field label unless children are composed. Reverts every field to its last saved value and returns MyAccountProfileRoot to the view state, without persisting. Renders only in the edit state; disabled while the write is pending. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileCancelButton({\n $content,\n $locale,\n className,\n children,\n}: MyAccountProfileCancelButtonProps) {\n const { mode, pending, cancel } = useMyAccountProfile();\n const { format } = useMessageFormatter(MyAccountProfileCancelButtonContent, $content);\n if (mode !== 'edit') return null;\n return (\n <button\n type=\"button\"\n disabled={pending}\n onClick={cancel}\n className={className}\n data-fs-my-account-profile-cancel=\"\"\n >\n {children ?? format('label')}\n </button>\n );\n}\n\nexport const MyAccountProfileEmailDefinition = defineComponent<MyAccountProfileEmailProps>({\n name: 'MyAccountProfileEmail',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileEmail,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Email', category: 'identity' },\n schema: {},\n guideline:\n \"The shopper's read-only login identifier, or nothing when absent. Never editable — no edit-state rendering exists for it. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileEmail({ className }: MyAccountProfileEmailProps) {\n const { email } = useMyAccountProfile();\n if (!email) return null;\n return (\n <p className={className} data-fs-my-account-profile-email=\"\">\n {email}\n </p>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton — no context: it is rendered directly by the Root before any Provider exists\n// (mirrors ProductShelfSkeleton / PricingSkeleton; see spec deviation note).\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfileSkeletonDefinition = defineComponent<ComponentPropsWithRef<'div'>>({\n name: 'MyAccountProfileSkeleton',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileSkeleton,\n editor: { label: 'My Account Profile Skeleton', category: 'identity' },\n schema: {},\n guideline:\n 'Loading placeholder rendered by MyAccountProfileRoot while $data is unresolved. Declares no context requirement — it renders before the Root has anything to provide.',\n});\n\nexport function MyAccountProfileSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n return (\n <div {...props} className={className} data-fs-my-account-profile-skeleton=\"\" aria-hidden=\"true\">\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n <span data-fs-my-account-profile-skeleton-line=\"\" />\n </div>\n );\n}\n\nMyAccountProfileRoot.Skeleton = MyAccountProfileSkeleton;\n\n// ---------------------------------------------------------------------------\n// Field Controls\n//\n// Each Control is a thin binding over an existing presentational particle: it registers with the\n// Root's registration seam in an effect, reads its value off `mode` (savedValues in view, draft in\n// edit), writes through `setField`, and wraps its input in an element carrying\n// `data-fs-my-account-profile-field` — the Root's DOM-order focus seam. None persists on its own.\n// ---------------------------------------------------------------------------\n\nexport type MyAccountProfileFirstNameControlProps = Readonly<\n MessageLocaleProp & {\n /** The label and the message shown when the field is left empty. */\n $content?: ContentValue<typeof MyAccountProfileFirstNameControlContent>;\n className?: string;\n }\n>;\n\nexport const MyAccountProfileFirstNameControlDefinition = defineComponent<MyAccountProfileFirstNameControlProps>({\n name: 'MyAccountProfileFirstNameControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileFirstNameControl,\n content: MyAccountProfileFirstNameControlContent,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile First Name Control', category: 'identity' },\n schema: {},\n guideline:\n 'Draft-bound, required first-name field, labelled by the $content field label. Blocks Save with the inline $content field requiredMessage and focus when left empty. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileFirstNameControl({\n $content,\n $locale,\n className,\n}: MyAccountProfileFirstNameControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n const { format } = useMessageFormatter(MyAccountProfileFirstNameControlContent, $content);\n\n useEffect(() => {\n return registerField({ key: 'firstName', validate: (value) => (value.trim() ? null : format('requiredMessage')) });\n }, [format, registerField]);\n\n const error = fieldErrors.firstName;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-first-name=\"\" data-fs-my-account-profile-field=\"firstName\">\n {savedValues.firstName}\n </p>\n );\n }\n\n return (\n <Field.Root\n className={className}\n invalid={!!error}\n disabled={pending}\n data-fs-my-account-profile-first-name=\"\"\n data-fs-my-account-profile-field=\"firstName\"\n >\n <Field.Label>{format('label')}</Field.Label>\n <Field.Control\n value={draft.firstName}\n onChange={(event) => setField('firstName', event.target.value)}\n disabled={pending}\n />\n {error ? <Field.Error match>{error}</Field.Error> : null}\n </Field.Root>\n );\n}\n\nexport type MyAccountProfileLastNameControlProps = Readonly<\n MessageLocaleProp & {\n /** The label and the message shown when the field is left empty. */\n $content?: ContentValue<typeof MyAccountProfileLastNameControlContent>;\n className?: string;\n }\n>;\n\nexport const MyAccountProfileLastNameControlDefinition = defineComponent<MyAccountProfileLastNameControlProps>({\n name: 'MyAccountProfileLastNameControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileLastNameControl,\n content: MyAccountProfileLastNameControlContent,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Last Name Control', category: 'identity' },\n schema: {},\n guideline:\n 'Draft-bound, required last-name field, labelled by the $content field label. Blocks Save with the inline $content field requiredMessage and focus when left empty. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileLastNameControl({\n $content,\n $locale,\n className,\n}: MyAccountProfileLastNameControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n const { format } = useMessageFormatter(MyAccountProfileLastNameControlContent, $content);\n\n useEffect(() => {\n return registerField({ key: 'lastName', validate: (value) => (value.trim() ? null : format('requiredMessage')) });\n }, [format, registerField]);\n\n const error = fieldErrors.lastName;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-last-name=\"\" data-fs-my-account-profile-field=\"lastName\">\n {savedValues.lastName}\n </p>\n );\n }\n\n return (\n <Field.Root\n className={className}\n invalid={!!error}\n disabled={pending}\n data-fs-my-account-profile-last-name=\"\"\n data-fs-my-account-profile-field=\"lastName\"\n >\n <Field.Label>{format('label')}</Field.Label>\n <Field.Control\n value={draft.lastName}\n onChange={(event) => setField('lastName', event.target.value)}\n disabled={pending}\n />\n {error ? <Field.Error match>{error}</Field.Error> : null}\n </Field.Root>\n );\n}\n\nexport type MyAccountProfilePhoneControlProps = Readonly<\n MessageLocaleProp & {\n /** Which draft key this instance binds. Compose the Control twice to expose both numbers. */\n field?: 'homePhone' | 'mobilePhone';\n country?: PhoneCountry;\n /** The label and the message for an invalid number. */\n $content?: ContentValue<typeof MyAccountProfilePhoneControlContent>;\n className?: string;\n }\n>;\n\nexport const MyAccountProfilePhoneControlDefinition = defineComponent<MyAccountProfilePhoneControlProps>({\n name: 'MyAccountProfilePhoneControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfilePhoneControl,\n content: MyAccountProfilePhoneControlContent,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Phone Control', category: 'identity' },\n schema: {\n field: { type: ['homePhone', 'mobilePhone'] as const, default: 'mobilePhone', label: 'Bound field' },\n country: { type: ['US', 'BR'] as const, default: 'US', label: 'Country' },\n },\n guideline:\n \"Draft-bound, optional phone field bound to either homePhone or mobilePhone via the field prop (Decision 1) — compose it twice to expose both numbers. Its copy is the $content fields label and invalidMessage. Normalizes to E.164 on the Root's Save. Absent from the composition means absent from the payload. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfilePhoneControl({\n field = 'mobilePhone',\n country = 'US',\n $content,\n $locale,\n className,\n}: MyAccountProfilePhoneControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, registerField, setField } = useMyAccountProfile();\n const { format } = useMessageFormatter(MyAccountProfilePhoneControlContent, $content);\n\n useEffect(() => {\n return registerField({\n key: field,\n validate: (value) => (value.trim() && !validatePhoneNumber(value, country) ? format('invalidMessage') : null),\n normalize: (value) => (value.trim() ? toE164(value, country) : value),\n });\n }, [field, country, format, registerField]);\n\n const error = fieldErrors[field];\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-phone={field} data-fs-my-account-profile-field={field}>\n {savedValues[field] ? applyPhoneMask(savedValues[field], country) : ''}\n </p>\n );\n }\n\n return (\n <div data-fs-my-account-profile-field={field}>\n <PhoneField\n className={className}\n label={format('label')}\n country={country}\n requirement=\"optional\"\n value={draft[field]}\n onValueChange={(value) => setField(field, value)}\n invalid={!!error}\n error={error ?? undefined}\n errorInvalid={format('invalidMessage')}\n isDisabled={pending}\n data-fs-my-account-profile-phone={field}\n />\n </div>\n );\n}\n\nexport type MyAccountProfileTaxIdControlProps = Readonly<\n MessageLocaleProp & {\n /** The label, the invalid message, and the reason shown beside a locked saved document. */\n $content?: ContentValue<typeof MyAccountProfileTaxIdControlContent>;\n className?: string;\n }\n>;\n\nexport const MyAccountProfileTaxIdControlDefinition = defineComponent<MyAccountProfileTaxIdControlProps>({\n name: 'MyAccountProfileTaxIdControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileTaxIdControl,\n content: MyAccountProfileTaxIdControlContent,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Tax ID Control', category: 'identity' },\n schema: {},\n guideline:\n \"Draft-bound, optional national tax-ID field for the Root's active document type: CPF, SSN, SIN or RFC, each with its own mask and validation. Self-gates on that type and renders nothing when it is unset or unknown. Its copy is the $content fields label, invalidMessage and lockedReason. A saved value renders as a disabled, locked input in the edit state rather than disappearing (Decision 4); an unsaved value renders as an editable field. Must be a descendant of MyAccountProfileRoot.\",\n});\n\nexport function MyAccountProfileTaxIdControl({ $content, $locale, className }: MyAccountProfileTaxIdControlProps) {\n const { mode, draft, savedValues, fieldErrors, pending, activeDocumentType, registerField, setField } =\n useMyAccountProfile();\n const { format } = useMessageFormatter(MyAccountProfileTaxIdControlContent, $content);\n const documentType =\n activeDocumentType && isSupportedDocumentType(activeDocumentType) ? activeDocumentType : undefined;\n const hasSavedDocument = savedValues.document.trim() !== '';\n\n useEffect(() => {\n if (!documentType || hasSavedDocument) return;\n return registerField({\n key: 'document',\n validate: (value) => (value.trim() && !isValidDocument(value, documentType) ? format('invalidMessage') : null),\n // DocumentField reports back the masked value (e.g. `111.444.777-35`); the type's own sanitiser\n // strips the punctuation before it reaches the API (digits only for CPF, SSN and SIN, letters kept\n // for RFC), so this surface sends the string the card form's gateway body sends.\n normalize: (value) => DOCUMENTS[documentType].sanitize(value),\n });\n }, [documentType, hasSavedDocument, format, registerField]);\n\n if (!documentType) return null;\n\n const error = fieldErrors.document;\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-tax-id=\"\" data-fs-my-account-profile-field=\"document\">\n {savedValues.document ? maskDocumentValue(savedValues.document, documentType) : ''}\n </p>\n );\n }\n\n if (hasSavedDocument) {\n const lockedReason = format('lockedReason');\n return (\n <Field.Root\n className={className}\n data-fs-my-account-profile-tax-id=\"\"\n data-fs-my-account-profile-field=\"document\"\n >\n <Field.Label>{format('label')}</Field.Label>\n <Field.Control\n readOnly\n aria-disabled=\"true\"\n title={lockedReason}\n value={maskDocumentValue(savedValues.document, documentType)}\n data-fs-my-account-profile-tax-id-readonly=\"\"\n />\n <Field.Description>{lockedReason}</Field.Description>\n </Field.Root>\n );\n }\n\n return (\n <DocumentField\n className={className}\n label={format('label')}\n documentType={documentType}\n value={draft.document}\n onValueChange={(value) => setField('document', value)}\n invalid={!!error}\n errorMessage={error}\n disabled={pending}\n data-fs-my-account-profile-tax-id=\"\"\n data-fs-my-account-profile-field=\"document\"\n />\n );\n}\n\nexport type MyAccountProfileBirthDateControlProps = Readonly<\n MessageLocaleProp & { $content?: ContentValue<typeof MyAccountProfileBirthDateControlContent>; className?: string }\n>;\n\nexport const MyAccountProfileBirthDateControlDefinition = defineComponent<MyAccountProfileBirthDateControlProps>({\n name: 'MyAccountProfileBirthDateControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileBirthDateControl,\n content: MyAccountProfileBirthDateControlContent,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Birth Date Control', category: 'identity' },\n schema: {},\n guideline:\n 'Draft-bound, optional birth-date field over a native date input, labelled by the $content field label. Maps the native yyyy-mm-dd value to the stored profile format on read and write. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileBirthDateControl({\n $content,\n $locale,\n className,\n}: MyAccountProfileBirthDateControlProps) {\n const { mode, draft, savedValues, pending, registerField, setField } = useMyAccountProfile();\n const { format } = useMessageFormatter(MyAccountProfileBirthDateControlContent, $content);\n\n useEffect(() => {\n return registerField({ key: 'birthDate', normalize: (value) => toStoredDate(value) });\n }, [registerField]);\n\n if (mode === 'view') {\n return (\n <p className={className} data-fs-my-account-profile-birth-date=\"\" data-fs-my-account-profile-field=\"birthDate\">\n {savedValues.birthDate}\n </p>\n );\n }\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n setField('birthDate', toStoredDate(event.target.value));\n }\n\n return (\n <Field.Root\n className={className}\n data-fs-my-account-profile-birth-date=\"\"\n data-fs-my-account-profile-field=\"birthDate\"\n >\n <Field.Label>{format('label')}</Field.Label>\n <Input type=\"date\" value={toNativeDate(draft.birthDate)} onChange={handleChange} disabled={pending} />\n </Field.Root>\n );\n}\n\nexport type MyAccountProfileGenderOption = Readonly<{ value: string; label: string }>;\n\nexport type MyAccountProfileGenderControlProps = Readonly<\n MessageLocaleProp & {\n options?: readonly MyAccountProfileGenderOption[];\n /** The label, the placeholder and the clear button label. */\n $content?: ContentValue<typeof MyAccountProfileGenderControlContent>;\n className?: string;\n }\n>;\n\nexport const MyAccountProfileGenderControlDefinition = defineComponent<MyAccountProfileGenderControlProps>({\n name: 'MyAccountProfileGenderControl',\n importPath: '@vtex/faststore/components',\n component: MyAccountProfileGenderControl,\n content: MyAccountProfileGenderControlContent,\n requiresContext: 'my-account-profile',\n editor: { label: 'My Account Profile Gender Control', category: 'identity' },\n schema: {},\n guideline:\n 'Draft-bound, optional gender field over a store-configurable set of options (the options prop); its label, placeholder and clear label are the $content fields label, placeholder and clearLabel. Without authored options it offers female, male, other and prefer not to say, labelled by the $content fields femaleLabel, maleLabel, otherLabel and preferNotToSayLabel. Free-string storage — no server-side enum. A Clear button erases a selected value back to empty, since the Select itself offers no such option. Must be a descendant of MyAccountProfileRoot.',\n});\n\nexport function MyAccountProfileGenderControl({\n options: authoredOptions,\n $content,\n $locale,\n className,\n}: MyAccountProfileGenderControlProps) {\n const { mode, draft, savedValues, pending, registerField, setField } = useMyAccountProfile();\n const { format } = useMessageFormatter(MyAccountProfileGenderControlContent, $content);\n // An authored list keeps its own labels; the default one reads them from the messages.\n const options = useMemo<readonly MyAccountProfileGenderOption[]>(\n () => authoredOptions ?? DEFAULT_GENDER_OPTIONS.map(({ value, field }) => ({ value, label: format(field) })),\n [authoredOptions, format],\n );\n\n useEffect(() => {\n return registerField({ key: 'gender' });\n }, [registerField]);\n\n if (mode === 'view') {\n const selected = options.find((option) => option.value === savedValues.gender);\n return (\n <p className={className} data-fs-my-account-profile-gender=\"\" data-fs-my-account-profile-field=\"gender\">\n {selected?.label ?? savedValues.gender}\n </p>\n );\n }\n\n return (\n <div className={className} data-fs-my-account-profile-gender=\"\" data-fs-my-account-profile-field=\"gender\">\n <Select.Root value={draft.gender} onValueChange={(value) => setField('gender', value ?? '')} disabled={pending}>\n <Select.Label>{format('label')}</Select.Label>\n <Select.Trigger>\n <Select.Value placeholder={format('placeholder')} />\n <Select.Icon />\n </Select.Trigger>\n <Select.Portal>\n <Select.Positioner>\n <Select.Popup>\n <Select.List>\n {options.map((option) => (\n <Select.Item key={option.value} value={option.value}>\n <Select.ItemText>{option.label}</Select.ItemText>\n </Select.Item>\n ))}\n </Select.List>\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n </Select.Root>\n {draft.gender ? (\n <button\n type=\"button\"\n onClick={() => setField('gender', '')}\n disabled={pending}\n data-fs-my-account-profile-gender-clear=\"\"\n >\n {format('clearLabel')}\n </button>\n ) : null}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const MyAccountProfile = {\n Root: MyAccountProfileRoot,\n RootDefinition: MyAccountProfileRootDefinition,\n EditButton: MyAccountProfileEditButton,\n EditButtonDefinition: MyAccountProfileEditButtonDefinition,\n SaveButton: MyAccountProfileSaveButton,\n SaveButtonDefinition: MyAccountProfileSaveButtonDefinition,\n CancelButton: MyAccountProfileCancelButton,\n CancelButtonDefinition: MyAccountProfileCancelButtonDefinition,\n Email: MyAccountProfileEmail,\n EmailDefinition: MyAccountProfileEmailDefinition,\n Skeleton: MyAccountProfileSkeleton,\n SkeletonDefinition: MyAccountProfileSkeletonDefinition,\n FirstNameControl: MyAccountProfileFirstNameControl,\n FirstNameControlDefinition: MyAccountProfileFirstNameControlDefinition,\n LastNameControl: MyAccountProfileLastNameControl,\n LastNameControlDefinition: MyAccountProfileLastNameControlDefinition,\n PhoneControl: MyAccountProfilePhoneControl,\n PhoneControlDefinition: MyAccountProfilePhoneControlDefinition,\n TaxIdControl: MyAccountProfileTaxIdControl,\n TaxIdControlDefinition: MyAccountProfileTaxIdControlDefinition,\n BirthDateControl: MyAccountProfileBirthDateControl,\n BirthDateControlDefinition: MyAccountProfileBirthDateControlDefinition,\n GenderControl: MyAccountProfileGenderControl,\n GenderControlDefinition: MyAccountProfileGenderControlDefinition,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAM,WAAyB;;;;;;;;;;;;;;;;;AAsB/B,MAAa,8BAA8B,kBAAkB;CAC3D,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,mBAAmB;IACjB,MAAM;IACN,OAAO;IACP,aAAa;IACb,QAAQ;IACR,eAAe;GACjB;GACA,qBAAqB;IACnB,MAAM;IACN,OAAO;IACP,aAAa;IACb,QAAQ;IACR,eAAe;GACjB;GACA,uBAAuB;IACrB,MAAM;IACN,OAAO;IACP,aAAa;IACb,QAAQ;IACR,eAAe;GACjB;GACA,cAAc;IACZ,MAAM;IACN,OAAO;IACP,QAAQ;IACR,eAAe;GACjB;EACF;CACF;AACF,CAAC;;;;;AAMD,MAAa,kCAAkC;CAC7C,eAAe;CACf,cAAc;CACd,eAAe;AACjB;AAEA,MAAa,oCAAoC,kBAAkB;CACjE,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY,EACV,OAAO;GAAE,MAAM;GA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B;CAC3B,cAAc;CACd,wBAAwB;CACxB,cAAc;CACd,wBAAwB;CACxB,kBAAkB;CAClB,4BAA4B;CAC5B,eAAe;CACf,yBAAyB;AAC3B"}
@@ -1,4 +1,4 @@
1
- import { ContentValue } from "../../core/dist/define-content-type.js";
1
+ import { ContentValue, MessageLocaleProp } from "../../core/dist/define-content-type.js";
2
2
  import { ComponentDefinition } from "../../core/dist/define-component.js";
3
3
  import "../../core/dist/index.js";
4
4
  import { ComponentActions } from "../../sdk/actions/types.js";
@@ -14,53 +14,105 @@ export declare const OrderCancelContent: {
14
14
  readonly properties: {
15
15
  readonly trigger: {
16
16
  readonly type: "string";
17
- readonly default: "Cancel order";
18
17
  readonly title: "Trigger";
18
+ readonly format: "icu-message";
19
+ readonly messageSource: "Cancel order";
19
20
  };
20
21
  readonly title: {
21
22
  readonly type: "string";
22
- readonly default: "Cancel this order?";
23
23
  readonly title: "Title";
24
+ readonly format: "icu-message";
25
+ readonly messageSource: "Cancel this order?";
24
26
  };
25
27
  readonly description: {
26
28
  readonly type: "string";
27
- readonly default: "This cannot be undone.";
28
29
  readonly title: "Description";
30
+ readonly format: "icu-message";
31
+ readonly messageSource: "This cannot be undone.";
29
32
  };
30
33
  readonly confirm: {
31
34
  readonly type: "string";
32
- readonly default: "Cancel order";
33
35
  readonly title: "Confirm";
36
+ readonly format: "icu-message";
37
+ readonly messageSource: "Cancel order";
34
38
  };
35
39
  readonly dismiss: {
36
40
  readonly type: "string";
37
- readonly default: "Keep order";
38
41
  readonly title: "Dismiss";
42
+ readonly format: "icu-message";
43
+ readonly messageSource: "Keep order";
39
44
  };
40
45
  readonly other: {
41
46
  readonly type: "string";
42
- readonly default: "Other";
43
47
  readonly title: "Other";
48
+ readonly format: "icu-message";
49
+ readonly messageSource: "Other";
44
50
  };
45
51
  readonly otherField: {
46
52
  readonly type: "string";
47
- readonly default: "Reason";
48
53
  readonly title: "Other field";
54
+ readonly format: "icu-message";
55
+ readonly messageSource: "Reason";
49
56
  };
50
57
  readonly success: {
51
58
  readonly type: "string";
52
- readonly default: "Your order was cancelled.";
53
59
  readonly title: "Success";
60
+ readonly format: "icu-message";
61
+ readonly messageSource: "Your order was cancelled.";
54
62
  };
55
63
  readonly failure: {
56
64
  readonly type: "string";
57
- readonly default: "Unable to cancel the order. Please try again.";
58
65
  readonly title: "Failure";
66
+ readonly format: "icu-message";
67
+ readonly messageSource: "Unable to cancel the order. Please try again.";
68
+ };
69
+ readonly notCancellableMessage: {
70
+ readonly type: "string";
71
+ readonly title: "Not cancellable message";
72
+ readonly description: "Shown when the order is past the point where it can be cancelled.";
73
+ readonly format: "icu-message";
74
+ readonly messageSource: "This order can no longer be cancelled.";
75
+ };
76
+ readonly notFoundMessage: {
77
+ readonly type: "string";
78
+ readonly title: "Order not found message";
79
+ readonly description: "Shown when the order is not one the signed-in shopper can see.";
80
+ readonly format: "icu-message";
81
+ readonly messageSource: "We could not find this order.";
59
82
  };
60
83
  readonly dismissMessage: {
61
84
  readonly type: "string";
62
- readonly default: "Dismiss";
63
85
  readonly title: "Dismiss message";
86
+ readonly format: "icu-message";
87
+ readonly messageSource: "Dismiss";
88
+ };
89
+ readonly reasonChangedMind: {
90
+ readonly type: "string";
91
+ readonly title: "Reason: changed mind";
92
+ readonly description: "Default reason option.";
93
+ readonly format: "icu-message";
94
+ readonly messageSource: "Changed my mind";
95
+ };
96
+ readonly reasonBoughtByMistake: {
97
+ readonly type: "string";
98
+ readonly title: "Reason: bought by mistake";
99
+ readonly description: "Default reason option.";
100
+ readonly format: "icu-message";
101
+ readonly messageSource: "Bought by mistake";
102
+ };
103
+ readonly reasonBetterPrice: {
104
+ readonly type: "string";
105
+ readonly title: "Reason: better price";
106
+ readonly description: "Default reason option.";
107
+ readonly format: "icu-message";
108
+ readonly messageSource: "Found a better price";
109
+ };
110
+ readonly reasonSlowDelivery: {
111
+ readonly type: "string";
112
+ readonly title: "Reason: slow delivery";
113
+ readonly description: "Default reason option.";
114
+ readonly format: "icu-message";
115
+ readonly messageSource: "Delivery is too slow";
64
116
  };
65
117
  readonly reasons: {
66
118
  readonly type: "array";
@@ -88,20 +140,14 @@ export type OrderCancelData = {
88
140
  status: string;
89
141
  allowCancellation: boolean;
90
142
  };
91
- export type OrderCancelProps = Readonly<{
143
+ export type OrderCancelProps = MessageLocaleProp & Readonly<{
92
144
  $data?: OrderCancelData | null;
93
145
  $actions?: ComponentActions;
94
146
  $content?: OrderCancelContentValue;
95
147
  className?: string;
96
148
  ref?: Ref<HTMLDivElement>;
97
149
  }>;
98
- export declare const OrderCancelDefinition: ComponentDefinition<Readonly<{
99
- $data?: OrderCancelData | null;
100
- $actions?: ComponentActions;
101
- $content?: OrderCancelContentValue;
102
- className?: string;
103
- ref?: Ref<HTMLDivElement>;
104
- }>>;
150
+ export declare const OrderCancelDefinition: ComponentDefinition<OrderCancelProps>;
105
151
  export declare function OrderCancelSkeleton({ className }: Readonly<{
106
152
  className?: string;
107
153
  }>): import("react/jsx-runtime").JSX.Element;